diff --git a/assets/AgentLogos-ClqC1BaK.js b/assets/AgentLogos-CFt_vIO2.js similarity index 99% rename from assets/AgentLogos-ClqC1BaK.js rename to assets/AgentLogos-CFt_vIO2.js index fab25e59e24411ce86e83abaa15efd59da6d7847..a7914ac88959c29b6ebe39a5492787b446ee638d 100644 --- a/assets/AgentLogos-ClqC1BaK.js +++ b/assets/AgentLogos-CFt_vIO2.js @@ -1 +1 @@ -import{j as e}from"./index-CqKcHUvZ.js";const s="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='256'%20height='257'%20preserveAspectRatio='xMidYMid'%20viewBox='0%200%20256%20257'%3e%3cpath%20fill='%23D97757'%20d='m50.228%20170.321%2050.357-28.257.843-2.463-.843-1.361h-2.462l-8.426-.518-28.775-.778-24.952-1.037-24.175-1.296-6.092-1.297L0%20125.796l.583-3.759%205.12-3.434%207.324.648%2016.202%201.101%2024.304%201.685%2017.629%201.037%2026.118%202.722h4.148l.583-1.685-1.426-1.037-1.101-1.037-25.147-17.045-27.22-18.017-14.258-10.37-7.713-5.25-3.888-4.925-1.685-10.758%207-7.713%209.397.649%202.398.648%209.527%207.323%2020.35%2015.75L94.817%2091.9l3.889%203.24%201.555-1.102.195-.777-1.75-2.917-14.453-26.118-15.425-26.572-6.87-11.018-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42%200%2082.05%201.426l4.472%203.888%206.61%2015.101%2010.694%2023.786%2016.591%2032.34%204.861%209.592%202.592%208.879.973%202.722h1.685v-1.556l1.36-18.211%202.528-22.36%202.463-28.776.843-8.1%204.018-9.722%207.971-5.25%206.222%202.981%205.12%207.324-.713%204.73-3.046%2019.768-5.962%2030.98-3.889%2020.739h2.268l2.593-2.593%2010.499-13.934%2017.628-22.036%207.778-8.749%209.073-9.657%205.833-4.601h11.018l8.1%2012.055-3.628%2012.443-11.342%2014.388-9.398%2012.184-13.48%2018.147-8.426%2014.518.778%201.166%202.01-.194%2030.46-6.481%2016.462-2.982%2019.637-3.37%208.88%204.148.971%204.213-3.5%208.62-20.998%205.184-24.628%204.926-36.682%208.685-.454.324.519.648%2016.526%201.555%207.065.389h17.304l32.21%202.398%208.426%205.574%205.055%206.805-.843%205.184-12.962%206.611-17.498-4.148-40.83-9.721-14-3.5h-1.944v1.167l11.666%2011.406%2021.387%2019.314%2026.767%2024.887%201.36%206.157-3.434%204.86-3.63-.518-23.526-17.693-9.073-7.972-20.545-17.304h-1.36v1.814l4.73%206.935%2025.017%2037.59%201.296%2011.536-1.814%203.76-6.481%202.268-7.13-1.297-14.647-20.544-15.1-23.138-12.185-20.739-1.49.843-7.194%2077.448-3.37%203.953-7.778%202.981-6.48-4.925-3.436-7.972%203.435-15.749%204.148-20.544%203.37-16.333%203.046-20.285%201.815-6.74-.13-.454-1.49.194-15.295%2020.999-23.267%2031.433-18.406%2019.702-4.407%201.75-7.648-3.954.713-7.064%204.277-6.286%2025.47-32.405%2015.36-20.092%209.917-11.6-.065-1.686h-.583L44.07%20198.125l-12.055%201.555-5.185-4.86.648-7.972%202.463-2.593%2020.35-13.999-.064.065Z'/%3e%3c/svg%3e",a="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='256'%20height='257'%20preserveAspectRatio='xMidYMid'%20viewBox='0%200%20256%20257'%3e%3cpath%20fill='%23D97757'%20d='m50.228%20170.321%2050.357-28.257.843-2.463-.843-1.361h-2.462l-8.426-.518-28.775-.778-24.952-1.037-24.175-1.296-6.092-1.297L0%20125.796l.583-3.759%205.12-3.434%207.324.648%2016.202%201.101%2024.304%201.685%2017.629%201.037%2026.118%202.722h4.148l.583-1.685-1.426-1.037-1.101-1.037-25.147-17.045-27.22-18.017-14.258-10.37-7.713-5.25-3.888-4.925-1.685-10.758%207-7.713%209.397.649%202.398.648%209.527%207.323%2020.35%2015.75L94.817%2091.9l3.889%203.24%201.555-1.102.195-.777-1.75-2.917-14.453-26.118-15.425-26.572-6.87-11.018-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42%200%2082.05%201.426l4.472%203.888%206.61%2015.101%2010.694%2023.786%2016.591%2032.34%204.861%209.592%202.592%208.879.973%202.722h1.685v-1.556l1.36-18.211%202.528-22.36%202.463-28.776.843-8.1%204.018-9.722%207.971-5.25%206.222%202.981%205.12%207.324-.713%204.73-3.046%2019.768-5.962%2030.98-3.889%2020.739h2.268l2.593-2.593%2010.499-13.934%2017.628-22.036%207.778-8.749%209.073-9.657%205.833-4.601h11.018l8.1%2012.055-3.628%2012.443-11.342%2014.388-9.398%2012.184-13.48%2018.147-8.426%2014.518.778%201.166%202.01-.194%2030.46-6.481%2016.462-2.982%2019.637-3.37%208.88%204.148.971%204.213-3.5%208.62-20.998%205.184-24.628%204.926-36.682%208.685-.454.324.519.648%2016.526%201.555%207.065.389h17.304l32.21%202.398%208.426%205.574%205.055%206.805-.843%205.184-12.962%206.611-17.498-4.148-40.83-9.721-14-3.5h-1.944v1.167l11.666%2011.406%2021.387%2019.314%2026.767%2024.887%201.36%206.157-3.434%204.86-3.63-.518-23.526-17.693-9.073-7.972-20.545-17.304h-1.36v1.814l4.73%206.935%2025.017%2037.59%201.296%2011.536-1.814%203.76-6.481%202.268-7.13-1.297-14.647-20.544-15.1-23.138-12.185-20.739-1.49.843-7.194%2077.448-3.37%203.953-7.778%202.981-6.48-4.925-3.436-7.972%203.435-15.749%204.148-20.544%203.37-16.333%203.046-20.285%201.815-6.74-.13-.454-1.49.194-15.295%2020.999-23.267%2031.433-18.406%2019.702-4.407%201.75-7.648-3.954.713-7.064%204.277-6.286%2025.47-32.405%2015.36-20.092%209.917-11.6-.065-1.686h-.583L44.07%20198.125l-12.055%201.555-5.185-4.86.648-7.972%202.463-2.593%2020.35-13.999-.064.065Z'/%3e%3c/svg%3e",h="data:image/svg+xml,%3csvg%20fill='%23111'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eCodex%3c/title%3e%3cpath%20clip-rule='evenodd'%20d='M8.086.457a6.105%206.105%200%20013.046-.415c1.333.153%202.521.72%203.564%201.7a.117.117%200%2000.107.029c1.408-.346%202.762-.224%204.061.366l.063.03.154.076c1.357.703%202.33%201.77%202.918%203.198.278.679.418%201.388.421%202.126a5.655%205.655%200%2001-.18%201.631.167.167%200%2000.04.155%205.982%205.982%200%20011.578%202.891c.385%201.901-.01%203.615-1.183%205.14l-.182.22a6.063%206.063%200%2001-2.934%201.851.162.162%200%2000-.108.102c-.255.736-.511%201.364-.987%201.992-1.199%201.582-2.962%202.462-4.948%202.451-1.583-.008-2.986-.587-4.21-1.736a.145.145%200%2000-.14-.032c-.518.167-1.04.191-1.604.185a5.924%205.924%200%2001-2.595-.622%206.058%206.058%200%2001-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74%207.74%200%2001-.495-1.283%206.11%206.11%200%2001-.017-3.064.166.166%200%2000.008-.074.115.115%200%2000-.037-.064%205.958%205.958%200%2001-1.38-2.202%205.196%205.196%200%2001-.333-1.589%206.915%206.915%200%2001.188-2.132c.45-1.484%201.309-2.648%202.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129%200%2000.087-.087A6.016%206.016%200%20015.635%202.31C6.315%201.464%207.132.846%208.086.457zm-.804%207.85a.848.848%200%2000-1.473.842l1.694%202.965-1.688%202.848a.849.849%200%20001.46.864l1.94-3.272a.849.849%200%2000.007-.854l-1.94-3.393zm5.446%206.24a.849.849%200%20000%201.695h4.848a.849.849%200%20000-1.696h-4.848z'%3e%3c/path%3e%3c/svg%3e",o="data:image/svg+xml,%3csvg%20fill='%23fff'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eCodex%3c/title%3e%3cpath%20clip-rule='evenodd'%20d='M8.086.457a6.105%206.105%200%20013.046-.415c1.333.153%202.521.72%203.564%201.7a.117.117%200%2000.107.029c1.408-.346%202.762-.224%204.061.366l.063.03.154.076c1.357.703%202.33%201.77%202.918%203.198.278.679.418%201.388.421%202.126a5.655%205.655%200%2001-.18%201.631.167.167%200%2000.04.155%205.982%205.982%200%20011.578%202.891c.385%201.901-.01%203.615-1.183%205.14l-.182.22a6.063%206.063%200%2001-2.934%201.851.162.162%200%2000-.108.102c-.255.736-.511%201.364-.987%201.992-1.199%201.582-2.962%202.462-4.948%202.451-1.583-.008-2.986-.587-4.21-1.736a.145.145%200%2000-.14-.032c-.518.167-1.04.191-1.604.185a5.924%205.924%200%2001-2.595-.622%206.058%206.058%200%2001-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74%207.74%200%2001-.495-1.283%206.11%206.11%200%2001-.017-3.064.166.166%200%2000.008-.074.115.115%200%2000-.037-.064%205.958%205.958%200%2001-1.38-2.202%205.196%205.196%200%2001-.333-1.589%206.915%206.915%200%2001.188-2.132c.45-1.484%201.309-2.648%202.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129%200%2000.087-.087A6.016%206.016%200%20015.635%202.31C6.315%201.464%207.132.846%208.086.457zm-.804%207.85a.848.848%200%2000-1.473.842l1.694%202.965-1.688%202.848a.849.849%200%20001.46.864l1.94-3.272a.849.849%200%2000.007-.854l-1.94-3.393zm5.446%206.24a.849.849%200%20000%201.695h4.848a.849.849%200%20000-1.696h-4.848z'%3e%3c/path%3e%3c/svg%3e",r="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='cursor_light__Ebene_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20466.73%20532.09'%3e%3c!--Generator:%20Adobe%20Illustrator%2029.6.1,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.1%20Build%209)--%3e%3cdefs%3e%3cstyle%3e.cursor_light__st0{fill:%2326251e}%3c/style%3e%3c/defs%3e%3cpath%20class='cursor_light__st0'%20d='M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z'/%3e%3c/svg%3e",d="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='cursor_dark__Ebene_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20466.73%20532.09'%3e%3c!--Generator:%20Adobe%20Illustrator%2029.6.1,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.1%20Build%209)--%3e%3cdefs%3e%3cstyle%3e.cursor_dark__st0{fill:%23edecec}%3c/style%3e%3c/defs%3e%3cpath%20class='cursor_dark__st0'%20d='M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z'/%3e%3c/svg%3e",n="data:image/svg+xml,%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='512'%20height='512'%20fill='%23FDFCFC'/%3e%3cpath%20d='M320%20224V352H192V224H320Z'%20fill='%23E6E5E6'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M384%20416H128V96H384V416ZM320%20160H192V352H320V160Z'%20fill='%2317181C'/%3e%3c/svg%3e",g="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='512'%20height='512'%3e%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='512'%20height='512'%20fill='%23131010'%3e%3c/rect%3e%3cpath%20d='M320%20224V352H192V224H320Z'%20fill='%235A5858'%3e%3c/path%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M384%20416H128V96H384V416ZM320%20160H192V352H320V160Z'%20fill='white'%3e%3c/path%3e%3c/svg%3e%3cstyle%3e@media%20(prefers-color-scheme:%20light)%20{%20:root%20{%20filter:%20none;%20}%20}%20@media%20(prefers-color-scheme:%20dark)%20{%20:root%20{%20filter:%20none;%20}%20}%20%3c/style%3e%3c/svg%3e",i=[{name:"Claude",light:s,dark:a},{name:"Codex",light:h,dark:o},{name:"Cursor",light:r,dark:d},{name:"OpenCode",light:n,dark:g}];function w(){return e.jsx("span",{className:"ml-1 inline-flex shrink-0 items-center gap-1.5","aria-hidden":"true",children:i.map(({name:l,light:t,dark:c})=>e.jsxs("span",{title:l,className:"inline-flex h-[18px] w-[18px]",children:[e.jsx("img",{src:t,alt:"",width:18,height:18,className:"h-full w-full object-contain dark:hidden"}),e.jsx("img",{src:c,alt:"",width:18,height:18,className:"hidden h-full w-full object-contain dark:block"})]},l))})}function m(){return e.jsx("ul",{className:"flex flex-wrap gap-2","aria-label":"Supported coding agents",children:i.map(({name:l,light:t,dark:c})=>e.jsxs("li",{className:"inline-flex items-center gap-2 rounded-full border px-3 py-1 text-sm",children:[e.jsx("img",{src:t,alt:"",width:18,height:18,className:"h-[18px] w-[18px] object-contain dark:hidden"}),e.jsx("img",{src:c,alt:"",width:18,height:18,className:"hidden h-[18px] w-[18px] object-contain dark:block"}),l]},l))})}export{w as A,m as a}; +import{j as e}from"./index-D6jcIRWs.js";const s="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='256'%20height='257'%20preserveAspectRatio='xMidYMid'%20viewBox='0%200%20256%20257'%3e%3cpath%20fill='%23D97757'%20d='m50.228%20170.321%2050.357-28.257.843-2.463-.843-1.361h-2.462l-8.426-.518-28.775-.778-24.952-1.037-24.175-1.296-6.092-1.297L0%20125.796l.583-3.759%205.12-3.434%207.324.648%2016.202%201.101%2024.304%201.685%2017.629%201.037%2026.118%202.722h4.148l.583-1.685-1.426-1.037-1.101-1.037-25.147-17.045-27.22-18.017-14.258-10.37-7.713-5.25-3.888-4.925-1.685-10.758%207-7.713%209.397.649%202.398.648%209.527%207.323%2020.35%2015.75L94.817%2091.9l3.889%203.24%201.555-1.102.195-.777-1.75-2.917-14.453-26.118-15.425-26.572-6.87-11.018-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42%200%2082.05%201.426l4.472%203.888%206.61%2015.101%2010.694%2023.786%2016.591%2032.34%204.861%209.592%202.592%208.879.973%202.722h1.685v-1.556l1.36-18.211%202.528-22.36%202.463-28.776.843-8.1%204.018-9.722%207.971-5.25%206.222%202.981%205.12%207.324-.713%204.73-3.046%2019.768-5.962%2030.98-3.889%2020.739h2.268l2.593-2.593%2010.499-13.934%2017.628-22.036%207.778-8.749%209.073-9.657%205.833-4.601h11.018l8.1%2012.055-3.628%2012.443-11.342%2014.388-9.398%2012.184-13.48%2018.147-8.426%2014.518.778%201.166%202.01-.194%2030.46-6.481%2016.462-2.982%2019.637-3.37%208.88%204.148.971%204.213-3.5%208.62-20.998%205.184-24.628%204.926-36.682%208.685-.454.324.519.648%2016.526%201.555%207.065.389h17.304l32.21%202.398%208.426%205.574%205.055%206.805-.843%205.184-12.962%206.611-17.498-4.148-40.83-9.721-14-3.5h-1.944v1.167l11.666%2011.406%2021.387%2019.314%2026.767%2024.887%201.36%206.157-3.434%204.86-3.63-.518-23.526-17.693-9.073-7.972-20.545-17.304h-1.36v1.814l4.73%206.935%2025.017%2037.59%201.296%2011.536-1.814%203.76-6.481%202.268-7.13-1.297-14.647-20.544-15.1-23.138-12.185-20.739-1.49.843-7.194%2077.448-3.37%203.953-7.778%202.981-6.48-4.925-3.436-7.972%203.435-15.749%204.148-20.544%203.37-16.333%203.046-20.285%201.815-6.74-.13-.454-1.49.194-15.295%2020.999-23.267%2031.433-18.406%2019.702-4.407%201.75-7.648-3.954.713-7.064%204.277-6.286%2025.47-32.405%2015.36-20.092%209.917-11.6-.065-1.686h-.583L44.07%20198.125l-12.055%201.555-5.185-4.86.648-7.972%202.463-2.593%2020.35-13.999-.064.065Z'/%3e%3c/svg%3e",a="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='256'%20height='257'%20preserveAspectRatio='xMidYMid'%20viewBox='0%200%20256%20257'%3e%3cpath%20fill='%23D97757'%20d='m50.228%20170.321%2050.357-28.257.843-2.463-.843-1.361h-2.462l-8.426-.518-28.775-.778-24.952-1.037-24.175-1.296-6.092-1.297L0%20125.796l.583-3.759%205.12-3.434%207.324.648%2016.202%201.101%2024.304%201.685%2017.629%201.037%2026.118%202.722h4.148l.583-1.685-1.426-1.037-1.101-1.037-25.147-17.045-27.22-18.017-14.258-10.37-7.713-5.25-3.888-4.925-1.685-10.758%207-7.713%209.397.649%202.398.648%209.527%207.323%2020.35%2015.75L94.817%2091.9l3.889%203.24%201.555-1.102.195-.777-1.75-2.917-14.453-26.118-15.425-26.572-6.87-11.018-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42%200%2082.05%201.426l4.472%203.888%206.61%2015.101%2010.694%2023.786%2016.591%2032.34%204.861%209.592%202.592%208.879.973%202.722h1.685v-1.556l1.36-18.211%202.528-22.36%202.463-28.776.843-8.1%204.018-9.722%207.971-5.25%206.222%202.981%205.12%207.324-.713%204.73-3.046%2019.768-5.962%2030.98-3.889%2020.739h2.268l2.593-2.593%2010.499-13.934%2017.628-22.036%207.778-8.749%209.073-9.657%205.833-4.601h11.018l8.1%2012.055-3.628%2012.443-11.342%2014.388-9.398%2012.184-13.48%2018.147-8.426%2014.518.778%201.166%202.01-.194%2030.46-6.481%2016.462-2.982%2019.637-3.37%208.88%204.148.971%204.213-3.5%208.62-20.998%205.184-24.628%204.926-36.682%208.685-.454.324.519.648%2016.526%201.555%207.065.389h17.304l32.21%202.398%208.426%205.574%205.055%206.805-.843%205.184-12.962%206.611-17.498-4.148-40.83-9.721-14-3.5h-1.944v1.167l11.666%2011.406%2021.387%2019.314%2026.767%2024.887%201.36%206.157-3.434%204.86-3.63-.518-23.526-17.693-9.073-7.972-20.545-17.304h-1.36v1.814l4.73%206.935%2025.017%2037.59%201.296%2011.536-1.814%203.76-6.481%202.268-7.13-1.297-14.647-20.544-15.1-23.138-12.185-20.739-1.49.843-7.194%2077.448-3.37%203.953-7.778%202.981-6.48-4.925-3.436-7.972%203.435-15.749%204.148-20.544%203.37-16.333%203.046-20.285%201.815-6.74-.13-.454-1.49.194-15.295%2020.999-23.267%2031.433-18.406%2019.702-4.407%201.75-7.648-3.954.713-7.064%204.277-6.286%2025.47-32.405%2015.36-20.092%209.917-11.6-.065-1.686h-.583L44.07%20198.125l-12.055%201.555-5.185-4.86.648-7.972%202.463-2.593%2020.35-13.999-.064.065Z'/%3e%3c/svg%3e",h="data:image/svg+xml,%3csvg%20fill='%23111'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eCodex%3c/title%3e%3cpath%20clip-rule='evenodd'%20d='M8.086.457a6.105%206.105%200%20013.046-.415c1.333.153%202.521.72%203.564%201.7a.117.117%200%2000.107.029c1.408-.346%202.762-.224%204.061.366l.063.03.154.076c1.357.703%202.33%201.77%202.918%203.198.278.679.418%201.388.421%202.126a5.655%205.655%200%2001-.18%201.631.167.167%200%2000.04.155%205.982%205.982%200%20011.578%202.891c.385%201.901-.01%203.615-1.183%205.14l-.182.22a6.063%206.063%200%2001-2.934%201.851.162.162%200%2000-.108.102c-.255.736-.511%201.364-.987%201.992-1.199%201.582-2.962%202.462-4.948%202.451-1.583-.008-2.986-.587-4.21-1.736a.145.145%200%2000-.14-.032c-.518.167-1.04.191-1.604.185a5.924%205.924%200%2001-2.595-.622%206.058%206.058%200%2001-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74%207.74%200%2001-.495-1.283%206.11%206.11%200%2001-.017-3.064.166.166%200%2000.008-.074.115.115%200%2000-.037-.064%205.958%205.958%200%2001-1.38-2.202%205.196%205.196%200%2001-.333-1.589%206.915%206.915%200%2001.188-2.132c.45-1.484%201.309-2.648%202.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129%200%2000.087-.087A6.016%206.016%200%20015.635%202.31C6.315%201.464%207.132.846%208.086.457zm-.804%207.85a.848.848%200%2000-1.473.842l1.694%202.965-1.688%202.848a.849.849%200%20001.46.864l1.94-3.272a.849.849%200%2000.007-.854l-1.94-3.393zm5.446%206.24a.849.849%200%20000%201.695h4.848a.849.849%200%20000-1.696h-4.848z'%3e%3c/path%3e%3c/svg%3e",o="data:image/svg+xml,%3csvg%20fill='%23fff'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eCodex%3c/title%3e%3cpath%20clip-rule='evenodd'%20d='M8.086.457a6.105%206.105%200%20013.046-.415c1.333.153%202.521.72%203.564%201.7a.117.117%200%2000.107.029c1.408-.346%202.762-.224%204.061.366l.063.03.154.076c1.357.703%202.33%201.77%202.918%203.198.278.679.418%201.388.421%202.126a5.655%205.655%200%2001-.18%201.631.167.167%200%2000.04.155%205.982%205.982%200%20011.578%202.891c.385%201.901-.01%203.615-1.183%205.14l-.182.22a6.063%206.063%200%2001-2.934%201.851.162.162%200%2000-.108.102c-.255.736-.511%201.364-.987%201.992-1.199%201.582-2.962%202.462-4.948%202.451-1.583-.008-2.986-.587-4.21-1.736a.145.145%200%2000-.14-.032c-.518.167-1.04.191-1.604.185a5.924%205.924%200%2001-2.595-.622%206.058%206.058%200%2001-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74%207.74%200%2001-.495-1.283%206.11%206.11%200%2001-.017-3.064.166.166%200%2000.008-.074.115.115%200%2000-.037-.064%205.958%205.958%200%2001-1.38-2.202%205.196%205.196%200%2001-.333-1.589%206.915%206.915%200%2001.188-2.132c.45-1.484%201.309-2.648%202.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129%200%2000.087-.087A6.016%206.016%200%20015.635%202.31C6.315%201.464%207.132.846%208.086.457zm-.804%207.85a.848.848%200%2000-1.473.842l1.694%202.965-1.688%202.848a.849.849%200%20001.46.864l1.94-3.272a.849.849%200%2000.007-.854l-1.94-3.393zm5.446%206.24a.849.849%200%20000%201.695h4.848a.849.849%200%20000-1.696h-4.848z'%3e%3c/path%3e%3c/svg%3e",r="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='cursor_light__Ebene_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20466.73%20532.09'%3e%3c!--Generator:%20Adobe%20Illustrator%2029.6.1,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.1%20Build%209)--%3e%3cdefs%3e%3cstyle%3e.cursor_light__st0{fill:%2326251e}%3c/style%3e%3c/defs%3e%3cpath%20class='cursor_light__st0'%20d='M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z'/%3e%3c/svg%3e",d="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='cursor_dark__Ebene_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20466.73%20532.09'%3e%3c!--Generator:%20Adobe%20Illustrator%2029.6.1,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.1%20Build%209)--%3e%3cdefs%3e%3cstyle%3e.cursor_dark__st0{fill:%23edecec}%3c/style%3e%3c/defs%3e%3cpath%20class='cursor_dark__st0'%20d='M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z'/%3e%3c/svg%3e",n="data:image/svg+xml,%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='512'%20height='512'%20fill='%23FDFCFC'/%3e%3cpath%20d='M320%20224V352H192V224H320Z'%20fill='%23E6E5E6'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M384%20416H128V96H384V416ZM320%20160H192V352H320V160Z'%20fill='%2317181C'/%3e%3c/svg%3e",g="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='512'%20height='512'%3e%3csvg%20width='512'%20height='512'%20viewBox='0%200%20512%20512'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='512'%20height='512'%20fill='%23131010'%3e%3c/rect%3e%3cpath%20d='M320%20224V352H192V224H320Z'%20fill='%235A5858'%3e%3c/path%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M384%20416H128V96H384V416ZM320%20160H192V352H320V160Z'%20fill='white'%3e%3c/path%3e%3c/svg%3e%3cstyle%3e@media%20(prefers-color-scheme:%20light)%20{%20:root%20{%20filter:%20none;%20}%20}%20@media%20(prefers-color-scheme:%20dark)%20{%20:root%20{%20filter:%20none;%20}%20}%20%3c/style%3e%3c/svg%3e",i=[{name:"Claude",light:s,dark:a},{name:"Codex",light:h,dark:o},{name:"Cursor",light:r,dark:d},{name:"OpenCode",light:n,dark:g}];function w(){return e.jsx("span",{className:"ml-1 inline-flex shrink-0 items-center gap-1.5","aria-hidden":"true",children:i.map(({name:l,light:t,dark:c})=>e.jsxs("span",{title:l,className:"inline-flex h-[18px] w-[18px]",children:[e.jsx("img",{src:t,alt:"",width:18,height:18,className:"h-full w-full object-contain dark:hidden"}),e.jsx("img",{src:c,alt:"",width:18,height:18,className:"hidden h-full w-full object-contain dark:block"})]},l))})}function m(){return e.jsx("ul",{className:"flex flex-wrap gap-2","aria-label":"Supported coding agents",children:i.map(({name:l,light:t,dark:c})=>e.jsxs("li",{className:"inline-flex items-center gap-2 rounded-full border px-3 py-1 text-sm",children:[e.jsx("img",{src:t,alt:"",width:18,height:18,className:"h-[18px] w-[18px] object-contain dark:hidden"}),e.jsx("img",{src:c,alt:"",width:18,height:18,className:"hidden h-[18px] w-[18px] object-contain dark:block"}),l]},l))})}export{w as A,m as a}; diff --git a/assets/AiDeadlinesView-DJBbqNNI.js b/assets/AiDeadlinesView-DJLyTAgt.js similarity index 96% rename from assets/AiDeadlinesView-DJBbqNNI.js rename to assets/AiDeadlinesView-DJLyTAgt.js index f74444b349ad9162b7d10e19f12f3f6469fed989..248a9ab081d0b77c09ba2a438feff45020b68bce 100644 --- a/assets/AiDeadlinesView-DJBbqNNI.js +++ b/assets/AiDeadlinesView-DJLyTAgt.js @@ -1,3 +1,3 @@ -import{r as x,j as t}from"./index-CqKcHUvZ.js";import{u as A}from"./useQuery-Cngk7eL9.js";import{c as B}from"./catalog-D26nGNnK.js";import{S as U}from"./switch-BvSgzfJM.js";import{S as W}from"./skeleton-DleNhBYA.js";import{A as O,a as V}from"./alert-Z2yFUcyL.js";import{s as z}from"./safeExternalHref-CkBrsh84.js";import{D as P,a as G,c as Y,b as H,d as K}from"./dialog-B-oqHDuH.js";import"./index-C8IgDsSE.js";const b=1e3*60*60*24,S={urgent:"#c0392b",soon:"#b9770e",normal:"#3f7d3f",passed:"var(--ink-faint)"},k=e=>e.split("-").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "),q=new Set(["machine-learning","computer-vision","natural-language-processing","data-mining","robotics","computer-graphics","human-computer-interaction","web-search","signal-processing","representation-learning","reinforcement-learning","optimization-methods","large-language-models","information-retrieval","speech","mathematics"]),Q=e=>e.trim().toLowerCase().replace(/\s+/g,"-"),D=e=>Array.from(new Set((e.tags??[]).map(Q).filter(a=>q.has(a)))),F=e=>new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),I=(e,a)=>{if(!e)return null;const n=new Date(`${e}T00:00:00`),r=a?new Date(`${a}T00:00:00`):null,o=s=>s.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=n.getFullYear();return r&&r.getTime()!==n.getTime()?n.getMonth()===r.getMonth()?`${o(n).replace(/\d+$/,"").trim()} ${n.getDate()}–${r.getDate()}, ${i}`:`${o(n)} – ${o(r)}, ${i}`:`${o(n)}, ${i}`},M=e=>[...e.deadlines??[]].sort((a,n)=>new Date(a.deadline_at).getTime()-new Date(n.deadline_at).getTime()),T=(e,a)=>M(e).find(n=>new Date(n.deadline_at).getTime()>a)??null,L=e=>{const a=M(e);return a.length?a[a.length-1]:null},J=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b);if(r>=1){const s=Math.floor((n-r*b)/36e5);return`in ${r}d ${s}h`}const o=Math.floor(n/(1e3*60*60));return o>=1?`in ${o}h`:`in ${Math.max(1,Math.floor(n/(1e3*60)))}m`},X=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b),o=Math.floor(n%b/(1e3*60*60)),i=Math.floor(n%(1e3*60*60)/(1e3*60)),s=Math.floor(n%(1e3*60)/1e3);return`${r}d ${o}h ${i}m ${s}s`},_=(e,a)=>{if(e==null)return S.passed;const n=(e-a)/b;return n<=0?S.passed:n<=7?S.urgent:n<=30?S.soon:S.normal},$={fontFamily:"var(--mono)",fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--ink-faint)"},Z=(e,a)=>{const n=Math.ceil((e-a)/b);return n<=0?"passed":`${n} ${n===1?"day":"days"}`},R=(e,a)=>{const n=I(e.start_date,e.end_date),r=e.venue||[e.city,e.country].filter(Boolean).join(", ");return[`${a.label||a.type||"Deadline"} for ${e.name}`,n?`Dates: ${n}`:null,r?`Location: ${r}`:null,e.url?`Website: ${e.url}`:null].filter(Boolean).join(` +import{r as x,j as t}from"./index-D6jcIRWs.js";import{u as A}from"./useQuery-CUJUm4FY.js";import{c as B}from"./catalog-PYrB8_bm.js";import{S as U}from"./switch-D_MyRbto.js";import{S as W}from"./skeleton-BqkYFmXl.js";import{A as O,a as V}from"./alert-2MbxVzGL.js";import{s as z}from"./safeExternalHref-CkBrsh84.js";import{D as P,a as G,c as Y,b as H,d as K}from"./dialog-vGFIbcd-.js";import"./index-DIg7XGE2.js";const b=1e3*60*60*24,S={urgent:"#c0392b",soon:"#b9770e",normal:"#3f7d3f",passed:"var(--ink-faint)"},k=e=>e.split("-").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "),q=new Set(["machine-learning","computer-vision","natural-language-processing","data-mining","robotics","computer-graphics","human-computer-interaction","web-search","signal-processing","representation-learning","reinforcement-learning","optimization-methods","large-language-models","information-retrieval","speech","mathematics"]),Q=e=>e.trim().toLowerCase().replace(/\s+/g,"-"),D=e=>Array.from(new Set((e.tags??[]).map(Q).filter(a=>q.has(a)))),F=e=>new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),I=(e,a)=>{if(!e)return null;const n=new Date(`${e}T00:00:00`),r=a?new Date(`${a}T00:00:00`):null,o=s=>s.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=n.getFullYear();return r&&r.getTime()!==n.getTime()?n.getMonth()===r.getMonth()?`${o(n).replace(/\d+$/,"").trim()} ${n.getDate()}–${r.getDate()}, ${i}`:`${o(n)} – ${o(r)}, ${i}`:`${o(n)}, ${i}`},M=e=>[...e.deadlines??[]].sort((a,n)=>new Date(a.deadline_at).getTime()-new Date(n.deadline_at).getTime()),T=(e,a)=>M(e).find(n=>new Date(n.deadline_at).getTime()>a)??null,L=e=>{const a=M(e);return a.length?a[a.length-1]:null},J=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b);if(r>=1){const s=Math.floor((n-r*b)/36e5);return`in ${r}d ${s}h`}const o=Math.floor(n/(1e3*60*60));return o>=1?`in ${o}h`:`in ${Math.max(1,Math.floor(n/(1e3*60)))}m`},X=(e,a)=>{const n=e-a;if(n<=0)return"Deadline passed";const r=Math.floor(n/b),o=Math.floor(n%b/(1e3*60*60)),i=Math.floor(n%(1e3*60*60)/(1e3*60)),s=Math.floor(n%(1e3*60)/1e3);return`${r}d ${o}h ${i}m ${s}s`},_=(e,a)=>{if(e==null)return S.passed;const n=(e-a)/b;return n<=0?S.passed:n<=7?S.urgent:n<=30?S.soon:S.normal},$={fontFamily:"var(--mono)",fontSize:10,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--ink-faint)"},Z=(e,a)=>{const n=Math.ceil((e-a)/b);return n<=0?"passed":`${n} ${n===1?"day":"days"}`},R=(e,a)=>{const n=I(e.start_date,e.end_date),r=e.venue||[e.city,e.country].filter(Boolean).join(", ");return[`${a.label||a.type||"Deadline"} for ${e.name}`,n?`Dates: ${n}`:null,r?`Location: ${r}`:null,e.url?`Website: ${e.url}`:null].filter(Boolean).join(` `)},C=e=>e.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,""),ee=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=`https://calendar.google.com/calendar/render?action=TEMPLATE&text=${encodeURIComponent(o)}&dates=${C(n)}/${C(r)}&details=${encodeURIComponent(R(e,a))}&location=${encodeURIComponent(i)}`,m=z(s);m&&window.open(m,"_blank","noopener,noreferrer")},te=(e,a)=>{const n=new Date(a.deadline_at),r=new Date(n.getTime()+60*60*1e3),o=`${e.short_name||e.name} ${a.label||a.type||"deadline"}`,i=e.venue||[e.city,e.country].filter(Boolean).join(", "),s=["BEGIN:VCALENDAR","VERSION:2.0","BEGIN:VEVENT",e.url?`URL:${e.url}`:null,`DTSTART:${C(n)}`,`DTEND:${C(r)}`,`SUMMARY:${o}`,`DESCRIPTION:${R(e,a).replace(/\n/g,"\\n")}`,i?`LOCATION:${i}`:null,"END:VEVENT","END:VCALENDAR"].filter(Boolean).join(` `),m=new Blob([s],{type:"text/calendar;charset=utf-8"}),c=document.createElement("a");c.href=URL.createObjectURL(m),c.download=`${(e.short_name||e.name).toLowerCase().replace(/\s+/g,"-")}-deadline.ics`,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(c.href)},ne=({conf:e,open:a,onOpenChange:n})=>{const[r,o]=x.useState(()=>Date.now());x.useEffect(()=>{if(!a)return;o(Date.now());const d=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(d)},[a]);const i=x.useMemo(()=>e?M(e):[],[e]),s=x.useMemo(()=>e?T(e,r):null,[e,r]),m=e?I(e.start_date,e.end_date):null,c=e?e.venue||[e.city,e.country].filter(Boolean).join(", ")||e.location:null,u=s?new Date(s.deadline_at).getTime():null;return t.jsx(P,{open:a,onOpenChange:n,children:t.jsx(G,{className:"max-w-xl",style:{background:"var(--bg-elevated)",maxHeight:"85vh",overflowY:"auto"},children:e&&t.jsxs(t.Fragment,{children:[t.jsxs(Y,{children:[t.jsx(H,{asChild:!0,children:t.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name})}),e.short_name&&e.name||e.description?t.jsx(K,{asChild:!0,children:t.jsx("span",{style:{fontFamily:"var(--serif)",fontSize:14,color:"var(--ink-soft)"},children:e.short_name?e.name:e.description})}):null]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:20,marginTop:4},children:[t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:24},children:[m&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Dates"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:m})]}),c&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsx("span",{style:$,children:"Venue"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-soft)"},children:c})]})]}),u!=null&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,padding:"12px 14px",borderRadius:8,background:"var(--bg-subtle)",border:"1px solid var(--hairline)"},children:[t.jsx("span",{style:$,children:"Next deadline in"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:22,fontWeight:600,color:_(u,r)},children:X(u,r)})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[t.jsx("span",{style:$,children:"Important deadlines"}),i.length===0?t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink-faint)"},children:"No deadlines listed"}):i.map((d,p)=>{const y=new Date(d.deadline_at).getTime(),l=s!=null&&d.deadline_at===s.deadline_at&&d.type===s.type,h=y<=r;return t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,padding:"8px 12px",borderRadius:6,background:l?"var(--accent-soft)":"transparent",border:l?"1px solid var(--hairline-strong)":"1px solid var(--hairline)",opacity:h&&!l?.55:1},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:13,color:"var(--ink)",fontWeight:l?600:400},children:[d.label||k(d.type||"deadline"),l&&t.jsx("span",{style:{...$,marginLeft:8},children:"Next"})]}),t.jsxs("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:[F(d.deadline_at),d.timezone?` · ${d.timezone}`:""]})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,fontWeight:600,whiteSpace:"nowrap",color:_(h?null:y,r)},children:Z(y,r)})]},`${d.type??"deadline"}-${p}`)})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(d=>t.jsx("span",{className:"tag-chip",style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:k(d)},d))}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:16,paddingTop:12,borderTop:"1px solid var(--hairline)"},children:[e.url&&t.jsx("a",{href:z(e.url)??void 0,target:"_blank",rel:"noopener noreferrer",style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--accent-text)"},children:"Visit website ↗"}),s&&t.jsxs("div",{style:{display:"flex",gap:12,marginLeft:"auto"},children:[t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>ee(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Google Calendar"}),t.jsx("button",{type:"button",className:"tag-chip",onClick:()=>te(e,s),style:{background:"var(--bg-subtle)",color:"var(--ink-soft)"},children:"+ Apple / .ics"})]})]})]})]})})})},E=({id:e,label:a,checked:n,onChange:r})=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[t.jsx(U,{id:e,checked:n,onCheckedChange:r}),t.jsx("label",{htmlFor:e,style:{cursor:"pointer"},children:a})]}),ae=({conf:e,now:a,selectedDomains:n,onToggleDomain:r,onOpen:o})=>{const i=T(e,a),s=i??L(e),m=s?new Date(s.deadline_at).getTime():null,c=_(i?m:null,a),u=I(e.start_date,e.end_date),d=[e.city??null,e.country??null].filter(Boolean).join(", ");return t.jsxs("div",{role:"button",tabIndex:0,onClick:()=>o(e),onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),o(e))},style:{border:"1px solid var(--hairline)",borderRadius:8,padding:20,background:"var(--bg-elevated)",display:"flex",flexDirection:"column",gap:12,cursor:"pointer"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:12},children:[t.jsx("h3",{style:{fontFamily:"var(--serif)",fontSize:20,fontWeight:500,letterSpacing:"-0.01em",margin:0},children:e.short_name?`${e.short_name} ${e.year??""}`.trim():e.name}),e.url&&t.jsx("a",{href:z(e.url)??void 0,target:"_blank",rel:"noopener noreferrer",onClick:p=>p.stopPropagation(),style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",whiteSpace:"nowrap"},children:"website ↗"})]}),t.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,paddingBottom:12,borderBottom:"1px solid var(--hairline)"},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:(s==null?void 0:s.label)||(s==null?void 0:s.type)||"Deadline"}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:s?`${F(s.deadline_at)}${s.timezone?` · ${s.timezone}`:""}`:"TBD"})]}),t.jsx("span",{style:{fontFamily:"var(--mono)",fontSize:14,fontWeight:600,color:c,whiteSpace:"nowrap"},children:m!=null?J(m,a):"TBD"})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)"},children:[u&&t.jsx("span",{children:u}),d&&t.jsx("span",{children:d})]}),D(e).length>0&&t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:D(e).map(p=>{const y=n.has(p);return t.jsx("button",{className:"tag-chip",onClick:l=>{l.stopPropagation(),r(p)},style:{background:y?"var(--ink)":"var(--bg-subtle)",color:y?"var(--bg)":"var(--ink-soft)"},children:k(p)},p)})})]})},ue=()=>{const[e,a]=x.useState(!0),[n,r]=x.useState(!1),[o,i]=x.useState(new Set),[s,m]=x.useState(null),c=x.useMemo(()=>Date.now(),[]),u=A({queryKey:["conference-deadlines"],queryFn:()=>B.conferenceDeadlines(),staleTime:10*60*1e3}),d=l=>{i(h=>{const g=new Set(h);return g.has(l)?g.delete(l):g.add(l),g})},p=x.useMemo(()=>{var h;const l=new Map;return(h=u.data)==null||h.results.forEach(g=>{D(g).forEach(j=>l.set(j,(l.get(j)??0)+1))}),Array.from(l.entries()).sort((g,j)=>j[1]-g[1]).map(([g])=>g)},[u.data]),y=x.useMemo(()=>{var j;const h=(((j=u.data)==null?void 0:j.results)??[]).filter(f=>!(e&&f.tier!=="a"||o.size>0&&!D(f).some(v=>o.has(v))||!n&&!T(f,c))),g=f=>{const w=T(f,c);if(w)return{group:0,time:new Date(w.deadline_at).getTime()};const v=L(f);return{group:1,time:-(v?new Date(v.deadline_at).getTime():0)}};return[...h].sort((f,w)=>{const v=g(f),N=g(w);return v.group!==N.group?v.group-N.group:v.time-N.time})},[u.data,e,n,o,c]);return u.error?t.jsx("div",{className:"page",children:t.jsx(O,{variant:"destructive",children:t.jsx(V,{children:"Failed to load conference deadlines. Please try again."})})}):t.jsxs("div",{className:"page",children:[t.jsx("div",{className:"feed-header",children:t.jsxs("div",{children:[t.jsxs("h1",{className:"feed-title",children:["AI Conference ",t.jsx("em",{children:"Deadlines"})]}),t.jsx("div",{className:"feed-subtitle",children:"Upcoming submission deadlines for major AI conferences, counting down."})]})}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:20,padding:"16px 0",borderBottom:"1px solid var(--hairline)",marginBottom:24},children:[t.jsx(E,{id:"top-tier-only",label:"Top tier only",checked:e,onChange:a}),t.jsx(E,{id:"show-past",label:"Show past conferences",checked:n,onChange:r})]}),p.length>0&&t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:24},children:[p.map(l=>{const h=o.has(l);return t.jsx("button",{className:"tag-chip",onClick:()=>d(l),style:{background:h?"var(--ink)":"var(--bg-subtle)",color:h?"var(--bg)":"var(--ink-soft)"},children:k(l)},l)}),o.size>0&&t.jsx("button",{className:"tag-chip",onClick:()=>i(new Set),style:{background:"transparent",color:"var(--ink-faint)"},children:"Clear ✕"})]}),t.jsx("div",{className:"sort-bar",children:t.jsx("div",{className:"results-count",children:u.isLoading?"…":`${y.length} conferences`})}),u.isLoading?t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:Array.from({length:6}).map((l,h)=>t.jsx(W,{className:"h-44"},h))}):y.length===0?t.jsxs("div",{className:"no-results",children:["No conferences match these filters",n?".":" — try enabling “Show past conferences”."]}):t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:16},children:y.map(l=>t.jsx(ae,{conf:l,now:c,selectedDomains:o,onToggleDomain:d,onOpen:m},l.id))}),t.jsx(ne,{conf:s,open:s!==null,onOpenChange:l=>{l||m(null)}})]})};export{ue as default}; diff --git a/assets/ApiDocsView-CydK1pFj.js b/assets/ApiDocsView-D3iY1sSs.js similarity index 98% rename from assets/ApiDocsView-CydK1pFj.js rename to assets/ApiDocsView-D3iY1sSs.js index f2701cb2c3547fb0c2345cde7b82c370ba9d6aee..e3831cd4bdcfeaede87e8d5831802a527f451efa 100644 --- a/assets/ApiDocsView-CydK1pFj.js +++ b/assets/ApiDocsView-D3iY1sSs.js @@ -1,4 +1,4 @@ -import{a3 as m,r as o,j as e}from"./index-CqKcHUvZ.js";import{u as f}from"./useQuery-Cngk7eL9.js";import{M as g}from"./index-CqELxJb0.js";const y={queryKey:["public-api-schema"],queryFn:()=>m("/openapi.json",{credentials:"omit"}),staleTime:5*60*1e3};function b(s,r){const n=new URLSearchParams;for(const[a,t]of Object.entries(r["x-example-parameters"]))s.includes(`{${a}}`)?s=s.replace(`{${a}}`,encodeURIComponent(String(t))):n.append(a,String(t));return`https://paperswithcode.co${s}${n.size?`?${n}`:""}`}function w(s,r){return r==="Python"?`import requests +import{a5 as m,r as o,j as e}from"./index-D6jcIRWs.js";import{u as f}from"./useQuery-CUJUm4FY.js";import{M as g}from"./index-uFGyKu5N.js";const y={queryKey:["public-api-schema"],queryFn:()=>m("/openapi.json",{credentials:"omit"}),staleTime:5*60*1e3};function b(s,r){const n=new URLSearchParams;for(const[a,t]of Object.entries(r["x-example-parameters"]))s.includes(`{${a}}`)?s=s.replace(`{${a}}`,encodeURIComponent(String(t))):n.append(a,String(t));return`https://paperswithcode.co${s}${n.size?`?${n}`:""}`}function w(s,r){return r==="Python"?`import requests response = requests.get(${JSON.stringify(s)}, timeout=30) response.raise_for_status() diff --git a/assets/ArtifactWorkspace-DZXFAFpE.js b/assets/ArtifactWorkspace-CUZCugRS.js similarity index 99% rename from assets/ArtifactWorkspace-DZXFAFpE.js rename to assets/ArtifactWorkspace-CUZCugRS.js index c9fdc445d457991e1c20c43fb3ac3c80fba689bf..df42a3c3c40d4da6906bf828b872e9fb3d814471 100644 --- a/assets/ArtifactWorkspace-DZXFAFpE.js +++ b/assets/ArtifactWorkspace-CUZCugRS.js @@ -1,4 +1,4 @@ -var TL=Object.defineProperty;var yA=n=>{throw TypeError(n)};var PL=(n,e,t)=>e in n?TL(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var oe=(n,e,t)=>PL(n,typeof e!="symbol"?e+"":e,t),av=(n,e,t)=>e.has(n)||yA("Cannot "+t);var f=(n,e,t)=>(av(n,e,"read from private field"),t?t.call(n):e.get(n)),M=(n,e,t)=>e.has(n)?yA("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),$=(n,e,t,s)=>(av(n,e,"write to private field"),s?s.call(n,t):e.set(n,t),t),P=(n,e,t)=>(av(n,e,"access private method"),t);var hs=(n,e,t,s)=>({set _(i){$(n,e,i,t)},get _(){return f(n,e,s)}});import{n as Mo,r as q,j as S,K as ee,Y as eS,Z as rn,_ as gm,$ as l0,L as Nd,a0 as RL,X as c0,a1 as ML,f as ZC,C as IL}from"./index-CqKcHUvZ.js";import{u as XC,a as OL,c as NL,P as YC,i as LL,b as JC,e as tS,A as DL,v as jL,Z as FL,_ as zL,$ as HL,a0 as QC,a1 as BL}from"./chatSessions-D75G2_U7.js";/* empty css */import{H as Np,a as Lp,b as Dp}from"./hover-card-BTsA69o8.js";import{u as wo}from"./useQuery-Cngk7eL9.js";import{f as UL,i as e$,p as qL,C as VL,a as WL,T as GL}from"./CatalogEntityPreviewLink-BWMEEf81.js";import{G as h0}from"./github-sUmGdHig.js";import{F as t$}from"./file-text-DnNBEwSF.js";import{r as KL,a as ZL,P as u0,c as XL}from"./PaperPreviewLink-C6khj_iZ.js";import{M as YL,d as JL}from"./index-CqELxJb0.js";import{r as QL}from"./index-DBHj7UWg.js";import{c as vA}from"./chat-DGBJkcmd.js";import{C as eD}from"./copy-D9WKw0Bi.js";import{T as tD}from"./thumbs-up-C19-ALYv.js";import{u as ym}from"./useMutation-BItMAQ7s.js";import{A as nD}from"./arrow-left-D_tIkkPW.js";import{E as n$}from"./external-link-CrrdDZf6.js";import{P as sD}from"./plus-DZF-NxR0.js";import{S as iD}from"./search-9n8Usynh.js";import{C as s$,a as i$}from"./chevron-up-CZWX0SDx.js";import{A as rD}from"./AuthorAvatar-CWCqOa0h.js";import{a as oD}from"./papers-bE3C_Qzl.js";/** +var TL=Object.defineProperty;var yA=n=>{throw TypeError(n)};var PL=(n,e,t)=>e in n?TL(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var oe=(n,e,t)=>PL(n,typeof e!="symbol"?e+"":e,t),av=(n,e,t)=>e.has(n)||yA("Cannot "+t);var f=(n,e,t)=>(av(n,e,"read from private field"),t?t.call(n):e.get(n)),M=(n,e,t)=>e.has(n)?yA("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),$=(n,e,t,s)=>(av(n,e,"write to private field"),s?s.call(n,t):e.set(n,t),t),P=(n,e,t)=>(av(n,e,"access private method"),t);var hs=(n,e,t,s)=>({set _(i){$(n,e,i,t)},get _(){return f(n,e,s)}});import{n as Mo,r as q,j as S,K as ee,_ as eS,$ as rn,a0 as gm,a1 as l0,L as Nd,a2 as RL,X as c0,a3 as ML,f as ZC,C as IL}from"./index-D6jcIRWs.js";import{u as XC,a as OL,c as NL,P as YC,i as LL,b as JC,e as tS,A as DL,v as jL,Z as FL,_ as zL,$ as HL,a0 as QC,a1 as BL}from"./chatSessions-DByIWBno.js";/* empty css */import{H as Np,a as Lp,b as Dp}from"./hover-card-DPpv0l_x.js";import{u as wo}from"./useQuery-CUJUm4FY.js";import{f as UL,i as e$,p as qL,C as VL,a as WL,T as GL}from"./CatalogEntityPreviewLink-BhTSUN-X.js";import{G as h0}from"./github-B7D_19Qm.js";import{F as t$}from"./file-text-4G2I5_Zo.js";import{r as KL,a as ZL,P as u0,c as XL}from"./PaperPreviewLink-fcJyP9H0.js";import{M as YL,d as JL}from"./index-uFGyKu5N.js";import{r as QL}from"./index-yduEvk9Z.js";import{c as vA}from"./chat-ChnK8XDU.js";import{C as eD}from"./copy-BmzqMihw.js";import{T as tD}from"./thumbs-up-BqRlVdvF.js";import{u as ym}from"./useMutation-p6mN4h17.js";import{A as nD}from"./arrow-left-IzGlownM.js";import{E as n$}from"./external-link-C_yz2sXa.js";import{P as sD}from"./plus-C4UQ62Q1.js";import{S as iD}from"./search-CfTufeR7.js";import{C as s$,a as i$}from"./chevron-up-CQKUhZ0S.js";import{A as rD}from"./AuthorAvatar-UMHOVOr9.js";import{a as oD}from"./papers-DIIIPDpj.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/AstraForRoboticsView-U0yBJtLA.js b/assets/AstraForRoboticsView-CEJJvKPe.js similarity index 91% rename from assets/AstraForRoboticsView-U0yBJtLA.js rename to assets/AstraForRoboticsView-CEJJvKPe.js index 695060b0568f2be185d4be447f6eeb4182c088b7..43b4fce85bc013acb25dc8c35f1e0829755ed3fc 100644 --- a/assets/AstraForRoboticsView-U0yBJtLA.js +++ b/assets/AstraForRoboticsView-CEJJvKPe.js @@ -1 +1 @@ -import{e as y,r as g,j as a,L as n}from"./index-CqKcHUvZ.js";import{P as v}from"./components-Dmnn5Z5p.js";import{P as k}from"./PaperFeedFilters-SOqb93ez.js";import{A,a as w}from"./alert-Z2yFUcyL.js";import{S as N}from"./skeleton-DleNhBYA.js";import{u as P}from"./useInfiniteScroll-DVF-b-LX.js";import{u as S}from"./usePapers-By3yMmMn.js";import{f as R,D as L}from"./latexPlainText-DI8YEXVe.js";import{t as T}from"./colors-_scCXfCe.js";import"./papers-bE3C_Qzl.js";import"./AuthorAvatar-CWCqOa0h.js";import"./LatexTitle-BI9yl-Fo.js";import"./safeExternalHref-CkBrsh84.js";import"./useIntersectionObserver-CiBk_Oug.js";import"./useQuery-Cngk7eL9.js";import"./useInfiniteQuery-lxaMAHEu.js";const x="robotics",f="gpt-6-astra",F="https://x.com/YuXiang_IRVL/status/2100395131924840570",C=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],I=[{handle:"Frame_Robotics",author:"Frame Robotics",summary:"Real-arm control that fixes grip angle and carry height on the next try after a miss.",url:"https://x.com/Frame_Robotics/status/2099900836273090614"},{handle:"qineng_wang",author:"Qineng Wang",summary:"Dual-ALOHA spatial-constraint puzzles: unlocking interlocked parts and threading a rope through three rings.",url:"https://x.com/qineng_wang/status/2099893504658866561"},{handle:"__Rhodium__",author:"Lucas",summary:"In-context learning of the controls and the workspace, reaching the task goal in three tries.",url:"https://x.com/__Rhodium__/status/2099521054678925534"},{handle:"SuveenE",author:"Suveen Ellawela",summary:"Picking up a pipette and fitting a 5 mm tip on a MolmoAct2 real-world eval, using the free hand for a better view.",url:"https://x.com/SuveenE/status/2099448450341605672"},{handle:"cdngdev",author:"thijs",summary:"A robot arm with a paintbrush painting the Golden Gate Bridge, improving across attempts from camera feedback.",url:"https://x.com/cdngdev/status/2097339677128982873"},{handle:"IsaacSin12",author:"Isaac Sin",summary:"Zero-shot sorting of irregularly shaped blocks into cups by color.",url:"https://x.com/IsaacSin12/status/2096715382166098302"},{handle:"chooi_jeq",author:"Jay Chooi",summary:"Robocurve's robot-control comparison: 95% task completion versus 40% for Fable 5.1 at lower cost.",url:"https://x.com/chooi_jeq/status/2096064315115839904"}],G=[{handle:"Lingjun_Mao",author:"Lingjun Mao",summary:"Adapting to a new embodiment to put a cake into an air fryer through CuRobo motion-planning tool APIs.",url:"https://x.com/Lingjun_Mao/status/2100294902672462176"},{handle:"walterzhu8",author:"Wentao Zhu",summary:"A day-and-a-half autonomous run that builds and trains pen spinning on a Sharpa hand in Isaac Lab.",url:"https://x.com/walterzhu8/status/2100212420840989112"},{handle:"mishig25",author:"Mishig",summary:"Painting the Eiffel Tower in MuJoCo with an SO-101 and a brush, with the full experiment shared on Hugging Face.",url:"https://x.com/mishig25/status/2099611674793668676"},{handle:"RunpeiDong",author:"Runpei Dong",summary:"Getting a humanoid into a Tesla in MuJoCo: learning from feedback, then reusing that experience with egocentric perception.",url:"https://x.com/RunpeiDong/status/2099604536327614717"},{handle:"frankzydou",author:"Zhiyang (Frank) Dou",summary:"A LeRobot SO-101 real-world pickup from a third-person RGB camera, where the arm has to bend back to reach the pen.",url:"https://x.com/frankzydou/status/2099338127915512297"},{handle:"Parvkpr",author:"Parv Kapoor",summary:"Real-to-sim: building an interactive simulation environment from a single image or video.",url:"https://x.com/Parvkpr/status/2098847963867238597"},{handle:"z_code68632",author:"code_z",summary:"One demo per task: unscrewing a bottle cap, inserting a plug, clearing obstacles, and imitating a dance on a real robot.",url:"https://x.com/z_code68632/status/2098397364725895387"}],b=({posts:t,label:i})=>a.jsxs("div",{className:"astra-posts",children:[a.jsx("div",{className:"astra-posts-label",children:i}),a.jsx("ul",{children:t.map(r=>a.jsxs("li",{children:[a.jsxs("a",{href:r.url,target:"_blank",rel:"noreferrer",children:["@",r.handle]}),a.jsxs("span",{className:"astra-post-author",children:[" ",r.author]}),a.jsxs("span",{className:"astra-post-summary",children:[" — ",r.summary]})]},r.url))})]}),O=t=>t==="date_published"||t==="citation_count"?t:"trending",W=()=>{var u,p;const[t,i]=y(),r=O(t.get("order_by")),h=t.get("has_code")==="true",d=t.get("has_hf_artifacts")==="true",o=S({task:x,method:f,page_size:12,order_by:r,order_dir:"desc",include_resources:!0,has_code:h,has_hf_artifacts:d});g.useEffect(()=>(document.title=R("GPT-6 Astra for Robotics"),()=>{document.title=L}),[]);const j=P(o),m=g.useMemo(()=>{var e;return(((e=o.data)==null?void 0:e.pages)??[]).flatMap(s=>s.results.map(T))},[o.data]),_=((p=(u=o.data)==null?void 0:u.pages[0])==null?void 0:p.count)??0,l=(e,s)=>{const c=new URLSearchParams(t);s===null?c.delete(e):c.set(e,s),i(c)};return a.jsxs("div",{className:"page",children:[a.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[a.jsx(n,{to:"/",children:"Home"}),a.jsx("span",{children:" / "}),a.jsx("span",{children:"GPT-6 Astra for Robotics"})]}),a.jsx("header",{className:"feed-header",children:a.jsxs("div",{children:[a.jsx("div",{className:"astra-eyebrow",children:"Collection"}),a.jsxs("h1",{className:"feed-title",children:["GPT-6 Astra ",a.jsx("em",{children:"for Robotics"})]}),a.jsx("div",{className:"feed-subtitle",children:"Papers, technical reports, and evaluations that put OpenAI’s frontier model in control of real and simulated robots."}),a.jsxs("p",{className:"astra-lede",children:["The GPT-6 Astra launch never mentioned robots, yet within days the model was driving arms, hands, and humanoids. As"," ",a.jsx("a",{href:F,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(b,{posts:I,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(b,{posts:G,label:"Seen on X"})]})]}),a.jsxs("p",{className:"astra-note",children:["Listing is automatic: any paper tagged with both the"," ",a.jsx(n,{to:`/tasks/${x}`,children:"Robotics"})," task and the"," ",a.jsx(n,{to:`/methods/${f}`,children:"GPT-6 Astra"})," method appears here. Missing a report or preprint?"," ",a.jsx(n,{to:"/submit",children:"Submit it"}),"."]}),a.jsxs("div",{className:"task-section-head",style:{marginTop:36},children:[a.jsx("div",{className:"task-section-eyebrow",children:"Top trending · sort below"}),a.jsxs("div",{className:"task-section-title",children:["Papers ",a.jsxs("span",{className:"meta",children:["[",_.toLocaleString(),"]"]})]})]}),a.jsx("div",{className:"sort-bar",children:a.jsxs("div",{className:"paper-feed-toolbar-controls",children:[a.jsx("div",{className:"sort-options",children:C.map(([e,s])=>a.jsx("button",{type:"button",className:`sort-btn ${r===e?"active":""}`,onClick:()=>l("order_by",e==="trending"?null:e),children:s},e))}),a.jsx(k,{hasCode:h,hasHfArtifacts:d,onHasCodeChange:e=>l("has_code",e?"true":null),onHasHfArtifactsChange:e=>l("has_hf_artifacts",e?"true":null)})]})}),o.error?a.jsx(A,{variant:"destructive",children:a.jsx(w,{children:"Failed to load the collection. Please try again."})}):o.isLoading?a.jsx("div",{className:"paper-list",children:Array.from({length:3}).map((e,s)=>a.jsx(N,{className:"h-40 w-full"},s))}):m.length===0?a.jsx("div",{className:"no-results",children:"No papers match this selection yet."}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"paper-list",children:m.map((e,s)=>a.jsx(v,{paper:e,rank:s+1},e.id))}),a.jsx("div",{ref:j,style:{height:1}}),o.isFetchingNextPage&&a.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{W as default}; +import{e as y,r as g,j as a,L as n}from"./index-D6jcIRWs.js";import{P as v}from"./components-DO1X940E.js";import{P as k}from"./PaperFeedFilters-DNebHp4l.js";import{A,a as w}from"./alert-2MbxVzGL.js";import{S as N}from"./skeleton-BqkYFmXl.js";import{u as P}from"./useInfiniteScroll-Dm7JY_X4.js";import{u as S}from"./usePapers-BbCSwcVk.js";import{f as R,D as L}from"./latexPlainText-DI8YEXVe.js";import{t as T}from"./colors-CLwl8a2d.js";import"./papers-DIIIPDpj.js";import"./AuthorAvatar-UMHOVOr9.js";import"./LatexTitle-D_92Jowu.js";import"./safeExternalHref-CkBrsh84.js";import"./useIntersectionObserver-3LTuEaFW.js";import"./useQuery-CUJUm4FY.js";import"./useInfiniteQuery-FXco4P1n.js";const x="robotics",f="gpt-6-astra",F="https://x.com/YuXiang_IRVL/status/2100395131924840570",C=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],I=[{handle:"Frame_Robotics",author:"Frame Robotics",summary:"Real-arm control that fixes grip angle and carry height on the next try after a miss.",url:"https://x.com/Frame_Robotics/status/2099900836273090614"},{handle:"qineng_wang",author:"Qineng Wang",summary:"Dual-ALOHA spatial-constraint puzzles: unlocking interlocked parts and threading a rope through three rings.",url:"https://x.com/qineng_wang/status/2099893504658866561"},{handle:"__Rhodium__",author:"Lucas",summary:"In-context learning of the controls and the workspace, reaching the task goal in three tries.",url:"https://x.com/__Rhodium__/status/2099521054678925534"},{handle:"SuveenE",author:"Suveen Ellawela",summary:"Picking up a pipette and fitting a 5 mm tip on a MolmoAct2 real-world eval, using the free hand for a better view.",url:"https://x.com/SuveenE/status/2099448450341605672"},{handle:"cdngdev",author:"thijs",summary:"A robot arm with a paintbrush painting the Golden Gate Bridge, improving across attempts from camera feedback.",url:"https://x.com/cdngdev/status/2097339677128982873"},{handle:"IsaacSin12",author:"Isaac Sin",summary:"Zero-shot sorting of irregularly shaped blocks into cups by color.",url:"https://x.com/IsaacSin12/status/2096715382166098302"},{handle:"chooi_jeq",author:"Jay Chooi",summary:"Robocurve's robot-control comparison: 95% task completion versus 40% for Fable 5.1 at lower cost.",url:"https://x.com/chooi_jeq/status/2096064315115839904"}],G=[{handle:"Lingjun_Mao",author:"Lingjun Mao",summary:"Adapting to a new embodiment to put a cake into an air fryer through CuRobo motion-planning tool APIs.",url:"https://x.com/Lingjun_Mao/status/2100294902672462176"},{handle:"walterzhu8",author:"Wentao Zhu",summary:"A day-and-a-half autonomous run that builds and trains pen spinning on a Sharpa hand in Isaac Lab.",url:"https://x.com/walterzhu8/status/2100212420840989112"},{handle:"mishig25",author:"Mishig",summary:"Painting the Eiffel Tower in MuJoCo with an SO-101 and a brush, with the full experiment shared on Hugging Face.",url:"https://x.com/mishig25/status/2099611674793668676"},{handle:"RunpeiDong",author:"Runpei Dong",summary:"Getting a humanoid into a Tesla in MuJoCo: learning from feedback, then reusing that experience with egocentric perception.",url:"https://x.com/RunpeiDong/status/2099604536327614717"},{handle:"frankzydou",author:"Zhiyang (Frank) Dou",summary:"A LeRobot SO-101 real-world pickup from a third-person RGB camera, where the arm has to bend back to reach the pen.",url:"https://x.com/frankzydou/status/2099338127915512297"},{handle:"Parvkpr",author:"Parv Kapoor",summary:"Real-to-sim: building an interactive simulation environment from a single image or video.",url:"https://x.com/Parvkpr/status/2098847963867238597"},{handle:"z_code68632",author:"code_z",summary:"One demo per task: unscrewing a bottle cap, inserting a plug, clearing obstacles, and imitating a dance on a real robot.",url:"https://x.com/z_code68632/status/2098397364725895387"}],b=({posts:t,label:i})=>a.jsxs("div",{className:"astra-posts",children:[a.jsx("div",{className:"astra-posts-label",children:i}),a.jsx("ul",{children:t.map(r=>a.jsxs("li",{children:[a.jsxs("a",{href:r.url,target:"_blank",rel:"noreferrer",children:["@",r.handle]}),a.jsxs("span",{className:"astra-post-author",children:[" ",r.author]}),a.jsxs("span",{className:"astra-post-summary",children:[" — ",r.summary]})]},r.url))})]}),O=t=>t==="date_published"||t==="citation_count"?t:"trending",W=()=>{var u,p;const[t,i]=y(),r=O(t.get("order_by")),h=t.get("has_code")==="true",d=t.get("has_hf_artifacts")==="true",o=S({task:x,method:f,page_size:12,order_by:r,order_dir:"desc",include_resources:!0,has_code:h,has_hf_artifacts:d});g.useEffect(()=>(document.title=R("GPT-6 Astra for Robotics"),()=>{document.title=L}),[]);const j=P(o),m=g.useMemo(()=>{var e;return(((e=o.data)==null?void 0:e.pages)??[]).flatMap(s=>s.results.map(T))},[o.data]),_=((p=(u=o.data)==null?void 0:u.pages[0])==null?void 0:p.count)??0,l=(e,s)=>{const c=new URLSearchParams(t);s===null?c.delete(e):c.set(e,s),i(c)};return a.jsxs("div",{className:"page",children:[a.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[a.jsx(n,{to:"/",children:"Home"}),a.jsx("span",{children:" / "}),a.jsx("span",{children:"GPT-6 Astra for Robotics"})]}),a.jsx("header",{className:"feed-header",children:a.jsxs("div",{children:[a.jsx("div",{className:"astra-eyebrow",children:"Collection"}),a.jsxs("h1",{className:"feed-title",children:["GPT-6 Astra ",a.jsx("em",{children:"for Robotics"})]}),a.jsx("div",{className:"feed-subtitle",children:"Papers, technical reports, and evaluations that put OpenAI’s frontier model in control of real and simulated robots."}),a.jsxs("p",{className:"astra-lede",children:["The GPT-6 Astra launch never mentioned robots, yet within days the model was driving arms, hands, and humanoids. As"," ",a.jsx("a",{href:F,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(b,{posts:I,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(b,{posts:G,label:"Seen on X"})]})]}),a.jsxs("p",{className:"astra-note",children:["Listing is automatic: any paper tagged with both the"," ",a.jsx(n,{to:`/tasks/${x}`,children:"Robotics"})," task and the"," ",a.jsx(n,{to:`/methods/${f}`,children:"GPT-6 Astra"})," method appears here. Missing a report or preprint?"," ",a.jsx(n,{to:"/submit",children:"Submit it"}),"."]}),a.jsxs("div",{className:"task-section-head",style:{marginTop:36},children:[a.jsx("div",{className:"task-section-eyebrow",children:"Top trending · sort below"}),a.jsxs("div",{className:"task-section-title",children:["Papers ",a.jsxs("span",{className:"meta",children:["[",_.toLocaleString(),"]"]})]})]}),a.jsx("div",{className:"sort-bar",children:a.jsxs("div",{className:"paper-feed-toolbar-controls",children:[a.jsx("div",{className:"sort-options",children:C.map(([e,s])=>a.jsx("button",{type:"button",className:`sort-btn ${r===e?"active":""}`,onClick:()=>l("order_by",e==="trending"?null:e),children:s},e))}),a.jsx(k,{hasCode:h,hasHfArtifacts:d,onHasCodeChange:e=>l("has_code",e?"true":null),onHasHfArtifactsChange:e=>l("has_hf_artifacts",e?"true":null)})]})}),o.error?a.jsx(A,{variant:"destructive",children:a.jsx(w,{children:"Failed to load the collection. Please try again."})}):o.isLoading?a.jsx("div",{className:"paper-list",children:Array.from({length:3}).map((e,s)=>a.jsx(N,{className:"h-40 w-full"},s))}):m.length===0?a.jsx("div",{className:"no-results",children:"No papers match this selection yet."}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"paper-list",children:m.map((e,s)=>a.jsx(v,{paper:e,rank:s+1},e.id))}),a.jsx("div",{ref:j,style:{height:1}}),o.isFetchingNextPage&&a.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{W as default}; diff --git a/assets/AuthorAvatar-CWCqOa0h.js b/assets/AuthorAvatar-UMHOVOr9.js similarity index 86% rename from assets/AuthorAvatar-CWCqOa0h.js rename to assets/AuthorAvatar-UMHOVOr9.js index 752513970be44af2813c409eb601dd2f50518d83..36ea43c067b6f1645db7a90007eed9e3b2624749 100644 --- a/assets/AuthorAvatar-CWCqOa0h.js +++ b/assets/AuthorAvatar-UMHOVOr9.js @@ -1 +1 @@ -import{r as c,j as e}from"./index-CqKcHUvZ.js";const p=a=>a!=null&&a.startsWith("https://")&&!a.startsWith("https://huggingface.co/avatars/")?a:null,h=({url:a,className:o,href:t,label:n})=>{const[i,l]=c.useState(!1),s=i?null:p(a);if(!s)return null;const r=e.jsx("img",{className:`author-avatar-base ${o}`,src:s,alt:"",loading:"lazy",onError:()=>l(!0)});return t?e.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer","aria-label":n,children:r}):r};export{h as A}; +import{r as c,j as e}from"./index-D6jcIRWs.js";const p=a=>a!=null&&a.startsWith("https://")&&!a.startsWith("https://huggingface.co/avatars/")?a:null,h=({url:a,className:o,href:t,label:n})=>{const[i,l]=c.useState(!1),s=i?null:p(a);if(!s)return null;const r=e.jsx("img",{className:`author-avatar-base ${o}`,src:s,alt:"",loading:"lazy",onError:()=>l(!0)});return t?e.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer","aria-label":n,children:r}):r};export{h as A}; diff --git a/assets/AuthorDetailView-CfDdV5MT.js b/assets/AuthorDetailView-BsVP0aHv.js similarity index 81% rename from assets/AuthorDetailView-CfDdV5MT.js rename to assets/AuthorDetailView-BsVP0aHv.js index d2e1806fddc6fca310148c4f0585640c6ed66d67..c33a2f65657241ad03e045c44596fe66d973f71c 100644 --- a/assets/AuthorDetailView-CfDdV5MT.js +++ b/assets/AuthorDetailView-BsVP0aHv.js @@ -1 +1 @@ -import{u as C,j as a,e as D,r as R,af as k,L as w}from"./index-CqKcHUvZ.js";import{u as H}from"./useQuery-Cngk7eL9.js";import{P as $}from"./components-Dmnn5Z5p.js";import{A as L}from"./AuthorAvatar-CWCqOa0h.js";import{a as O,P as z,b as B}from"./PaperDateFilter-zHw5tq6B.js";import{P as I}from"./PaperFeedFilters-SOqb93ez.js";import{R as T}from"./ResearchFollowButton-CrCIwiok.js";import{A as U,a as q}from"./alert-Z2yFUcyL.js";import{S as y}from"./skeleton-DleNhBYA.js";import{u as E}from"./useInfiniteScroll-DVF-b-LX.js";import{u as M}from"./usePapers-By3yMmMn.js";import{a as G}from"./papers-bE3C_Qzl.js";import{t as K}from"./colors-_scCXfCe.js";import A from"./NotFound-pWH_hqC2.js";import"./LatexTitle-BI9yl-Fo.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-BcoS9Jmp.js";import"./useMutation-BItMAQ7s.js";import"./research-Dt0MUW0x.js";import"./plus-DZF-NxR0.js";import"./useIntersectionObserver-CiBk_Oug.js";import"./useInfiniteQuery-lxaMAHEu.js";const Q=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],V=t=>t==="date_published"||t==="citation_count"?t:"trending",J=({authorId:t})=>{var g,f,x,_,j,b,N,v,P;const[n,d]=D(),h=V(n.get("order_by")),p=n.get("has_code")==="true",m=n.get("has_hf_artifacts")==="true",i=O(n),e=H({queryKey:["author",t],queryFn:()=>G.getAuthor(t)}),o=M({author:t,page_size:12,order_by:h,order_dir:"desc",include_resources:!0,has_code:p,has_hf_artifacts:m,start_date:i.startDate,end_date:i.endDate}),u=R.useMemo(()=>{var r;return(((r=o.data)==null?void 0:r.pages)??[]).flatMap(s=>s.results.map(K))},[o.data]),F=E(o),S=((f=(g=o.data)==null?void 0:g.pages[0])==null?void 0:f.count)??0,c=(r,s)=>{const l=new URLSearchParams(n);s?l.set(r,s):l.delete(r),d(l)};if(((x=e.error)==null?void 0:x.status)===404)return a.jsx(A,{});if((_=e.data)!=null&&_.organization_slug){const r=n.toString();return a.jsx(k,{to:`/orgs/${e.data.organization_slug}${r?`?${r}`:""}`,replace:!0})}return a.jsxs("div",{className:"page",children:[a.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[a.jsx(w,{to:"/",children:"Home"}),a.jsx("span",{children:" / "}),a.jsx("span",{children:"Authors"}),a.jsx("span",{children:" / "}),a.jsx("span",{children:((j=e.data)==null?void 0:j.full_name)??t})]}),a.jsxs("header",{className:"author-hero",children:[a.jsx("div",{className:"organizations-eyebrow",children:"AUTHOR"}),a.jsxs("div",{className:"author-hero-title",children:[(b=e.data)!=null&&b.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]})]}):((N=e.data)==null?void 0:N.hf_username)&&a.jsx(L,{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:((v=e.data)==null?void 0:v.full_name)??a.jsx(y,{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(T,{kind:"author",entityId:e.data.id})]}),a.jsxs("div",{className:"sort-bar",style:{alignItems:"center",gap:16},children:[a.jsxs("div",{className:"paper-feed-toolbar-controls",children:[a.jsx("div",{className:"sort-options",children:Q.map(([r,s])=>a.jsx("button",{type:"button",className:`sort-btn ${h===r?"active":""}`,onClick:()=>c("order_by",r==="trending"?null:r),children:s},r))}),a.jsx(I,{hasCode:p,hasHfArtifacts:m,onHasCodeChange:r=>c("has_code",r?"true":null),onHasHfArtifactsChange:r=>c("has_hf_artifacts",r?"true":null)})]}),a.jsx(z,{startDate:i.startDate,endDate:i.endDate,onChange:r=>d(B(n,r))}),a.jsxs("div",{className:"results-count",children:[S.toLocaleString()," papers"]})]}),o.error?a.jsx(U,{variant:"destructive",children:a.jsxs(q,{children:["Failed to load papers."," ",a.jsx("button",{type:"button",onClick:()=>void o.refetch(),children:"Try again"})]})}):o.isLoading?a.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((r,s)=>a.jsx(y,{className:"h-40 w-full"},s))}):u.length===0?a.jsx("div",{className:"no-results",children:((P=e.data)==null?void 0:P.paper_count)===0?"No public papers are available.":"No papers found for this selection."}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"paper-list",children:u.map((r,s)=>a.jsx($,{paper:r,rank:s+1},r.id))}),a.jsx("div",{ref:F,style:{height:1}}),o.isFetchingNextPage&&a.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})},_a=()=>{const{authorId:t}=C();return t?a.jsx(J,{authorId:t},t):a.jsx(A,{})};export{_a as default}; +import{u as C,j as a,e as D,r as R,ah as k,L as w}from"./index-D6jcIRWs.js";import{u as H}from"./useQuery-CUJUm4FY.js";import{P as $}from"./components-DO1X940E.js";import{A as L}from"./AuthorAvatar-UMHOVOr9.js";import{a as O,P as z,b as B}from"./PaperDateFilter-CPIqaHaq.js";import{P as I}from"./PaperFeedFilters-DNebHp4l.js";import{R as T}from"./ResearchFollowButton-C2Bfd9dP.js";import{A as U,a as q}from"./alert-2MbxVzGL.js";import{S as y}from"./skeleton-BqkYFmXl.js";import{u as E}from"./useInfiniteScroll-Dm7JY_X4.js";import{u as M}from"./usePapers-BbCSwcVk.js";import{a as G}from"./papers-DIIIPDpj.js";import{t as K}from"./colors-CLwl8a2d.js";import A from"./NotFound-BTsJlVc8.js";import"./LatexTitle-D_92Jowu.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-DCjqGpW0.js";import"./useMutation-p6mN4h17.js";import"./research-BggtGgC2.js";import"./plus-C4UQ62Q1.js";import"./useIntersectionObserver-3LTuEaFW.js";import"./useInfiniteQuery-FXco4P1n.js";const Q=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],V=t=>t==="date_published"||t==="citation_count"?t:"trending",J=({authorId:t})=>{var g,f,x,_,j,b,N,v,P;const[n,d]=D(),h=V(n.get("order_by")),p=n.get("has_code")==="true",m=n.get("has_hf_artifacts")==="true",i=O(n),e=H({queryKey:["author",t],queryFn:()=>G.getAuthor(t)}),o=M({author:t,page_size:12,order_by:h,order_dir:"desc",include_resources:!0,has_code:p,has_hf_artifacts:m,start_date:i.startDate,end_date:i.endDate}),u=R.useMemo(()=>{var r;return(((r=o.data)==null?void 0:r.pages)??[]).flatMap(s=>s.results.map(K))},[o.data]),F=E(o),S=((f=(g=o.data)==null?void 0:g.pages[0])==null?void 0:f.count)??0,c=(r,s)=>{const l=new URLSearchParams(n);s?l.set(r,s):l.delete(r),d(l)};if(((x=e.error)==null?void 0:x.status)===404)return a.jsx(A,{});if((_=e.data)!=null&&_.organization_slug){const r=n.toString();return a.jsx(k,{to:`/orgs/${e.data.organization_slug}${r?`?${r}`:""}`,replace:!0})}return a.jsxs("div",{className:"page",children:[a.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[a.jsx(w,{to:"/",children:"Home"}),a.jsx("span",{children:" / "}),a.jsx("span",{children:"Authors"}),a.jsx("span",{children:" / "}),a.jsx("span",{children:((j=e.data)==null?void 0:j.full_name)??t})]}),a.jsxs("header",{className:"author-hero",children:[a.jsx("div",{className:"organizations-eyebrow",children:"AUTHOR"}),a.jsxs("div",{className:"author-hero-title",children:[(b=e.data)!=null&&b.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]})]}):((N=e.data)==null?void 0:N.hf_username)&&a.jsx(L,{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:((v=e.data)==null?void 0:v.full_name)??a.jsx(y,{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(T,{kind:"author",entityId:e.data.id})]}),a.jsxs("div",{className:"sort-bar",style:{alignItems:"center",gap:16},children:[a.jsxs("div",{className:"paper-feed-toolbar-controls",children:[a.jsx("div",{className:"sort-options",children:Q.map(([r,s])=>a.jsx("button",{type:"button",className:`sort-btn ${h===r?"active":""}`,onClick:()=>c("order_by",r==="trending"?null:r),children:s},r))}),a.jsx(I,{hasCode:p,hasHfArtifacts:m,onHasCodeChange:r=>c("has_code",r?"true":null),onHasHfArtifactsChange:r=>c("has_hf_artifacts",r?"true":null)})]}),a.jsx(z,{startDate:i.startDate,endDate:i.endDate,onChange:r=>d(B(n,r))}),a.jsxs("div",{className:"results-count",children:[S.toLocaleString()," papers"]})]}),o.error?a.jsx(U,{variant:"destructive",children:a.jsxs(q,{children:["Failed to load papers."," ",a.jsx("button",{type:"button",onClick:()=>void o.refetch(),children:"Try again"})]})}):o.isLoading?a.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((r,s)=>a.jsx(y,{className:"h-40 w-full"},s))}):u.length===0?a.jsx("div",{className:"no-results",children:((P=e.data)==null?void 0:P.paper_count)===0?"No public papers are available.":"No papers found for this selection."}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"paper-list",children:u.map((r,s)=>a.jsx($,{paper:r,rank:s+1},r.id))}),a.jsx("div",{ref:F,style:{height:1}}),o.isFetchingNextPage&&a.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})},_a=()=>{const{authorId:t}=C();return t?a.jsx(J,{authorId:t},t):a.jsx(A,{})};export{_a as default}; diff --git a/assets/AuthorizePaperEditView-D17pnlSs.js b/assets/AuthorizePaperEditView-mMhbmAG2.js similarity index 87% rename from assets/AuthorizePaperEditView-D17pnlSs.js rename to assets/AuthorizePaperEditView-mMhbmAG2.js index b43ddc84d6fa9e2463609ffbd4cb7f897464572e..3458dd081e244dccbee39fe37bbba41a25b4e445 100644 --- a/assets/AuthorizePaperEditView-D17pnlSs.js +++ b/assets/AuthorizePaperEditView-mMhbmAG2.js @@ -1 +1 @@ -import{u,a as d,j as e,L as l,H as p}from"./index-CqKcHUvZ.js";import{u as c}from"./useQuery-Cngk7eL9.js";import{u as h}from"./useMutation-BItMAQ7s.js";import{B as m}from"./button-BYn4yUH_.js";import{p as n}from"./paperEdits-BD6cBS3E.js";function b(){const{authorizationId:t=""}=u(),{user:s,isLoading:o}=d(),i=c({queryKey:["paper-edit-authorization",t],queryFn:()=>n.authorization(t),retry:!1}),r=h({mutationFn:()=>n.approve(t)}),a=i.data;return e.jsxs("main",{className:"mx-auto max-w-xl space-y-5 px-6 py-12",children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Authorize your agent to edit a paper"}),(i.isLoading||o)&&e.jsx("p",{children:"Loading authorization…"}),i.error&&e.jsx("p",{role:"alert",children:i.error.message}),a&&e.jsxs(e.Fragment,{children:[e.jsx(l,{className:"underline",to:`/paper/${a.paper_id}`,children:a.title}),e.jsxs("p",{children:["Check that your CLI shows this code: ",e.jsx("strong",{className:"font-mono",children:a.user_code})]}),e.jsx("p",{children:"Only approve a request you started. Your agent will be able to publish changes to this paper’s links, tags, and evaluation results for one hour, without further approval."}),e.jsx("p",{children:"Edits appear publicly under your Hugging Face username. You can edit up to 20 distinct papers per UTC day. Evaluation deletion and changes to shared benchmark definitions require an administrator."}),r.isSuccess||a.approved?e.jsx("p",{role:"status",children:"Access approved. Return to your CLI to continue."}):s?e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Signed in as ",e.jsxs("strong",{children:["@",s.username]})]}),e.jsx(m,{disabled:r.isPending||!s.can_directly_edit_catalog,onClick:()=>r.mutate(),children:r.isPending?"Authorizing…":"Authorize for one hour"}),!s.can_directly_edit_catalog&&e.jsx("p",{children:"Direct editing is unavailable for this session."})]}):e.jsx(p,{returnTo:`/authorize-paper-edit/${t}`,label:"Sign in with Hugging Face"}),r.error&&e.jsx("p",{role:"alert",children:r.error.message})]})]})}export{b as default}; +import{u,a as d,j as e,L as l,H as p}from"./index-D6jcIRWs.js";import{u as c}from"./useQuery-CUJUm4FY.js";import{u as h}from"./useMutation-p6mN4h17.js";import{B as m}from"./button-Bzx0ccHH.js";import{p as n}from"./paperEdits-DUTCoe5T.js";function b(){const{authorizationId:t=""}=u(),{user:s,isLoading:o}=d(),i=c({queryKey:["paper-edit-authorization",t],queryFn:()=>n.authorization(t),retry:!1}),r=h({mutationFn:()=>n.approve(t)}),a=i.data;return e.jsxs("main",{className:"mx-auto max-w-xl space-y-5 px-6 py-12",children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Authorize your agent to edit a paper"}),(i.isLoading||o)&&e.jsx("p",{children:"Loading authorization…"}),i.error&&e.jsx("p",{role:"alert",children:i.error.message}),a&&e.jsxs(e.Fragment,{children:[e.jsx(l,{className:"underline",to:`/paper/${a.paper_id}`,children:a.title}),e.jsxs("p",{children:["Check that your CLI shows this code: ",e.jsx("strong",{className:"font-mono",children:a.user_code})]}),e.jsx("p",{children:"Only approve a request you started. Your agent will be able to publish changes to this paper’s links, tags, and evaluation results for one hour, without further approval."}),e.jsx("p",{children:"Edits appear publicly under your Hugging Face username. You can edit up to 20 distinct papers per UTC day. Evaluation deletion and changes to shared benchmark definitions require an administrator."}),r.isSuccess||a.approved?e.jsx("p",{role:"status",children:"Access approved. Return to your CLI to continue."}):s?e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Signed in as ",e.jsxs("strong",{children:["@",s.username]})]}),e.jsx(m,{disabled:r.isPending||!s.can_directly_edit_catalog,onClick:()=>r.mutate(),children:r.isPending?"Authorizing…":"Authorize for one hour"}),!s.can_directly_edit_catalog&&e.jsx("p",{children:"Direct editing is unavailable for this session."})]}):e.jsx(p,{returnTo:`/authorize-paper-edit/${t}`,label:"Sign in with Hugging Face"}),r.error&&e.jsx("p",{role:"alert",children:r.error.message})]})]})}export{b as default}; diff --git a/assets/AutonomousOperations-BNbcighz.js b/assets/AutonomousOperations-BNbcighz.js new file mode 100644 index 0000000000000000000000000000000000000000..37b2acc52d234292c08e8643fee53e2f517a141d --- /dev/null +++ b/assets/AutonomousOperations-BNbcighz.js @@ -0,0 +1 @@ +import{f as R,r as d,j as e,L as B}from"./index-D6jcIRWs.js";import{u as q}from"./useQuery-CUJUm4FY.js";import{u as H}from"./useMutation-p6mN4h17.js";import{C as n,e as i,S as I,b as l,c as r,t as C,f as m,o as x}from"./CronDashboard-B0sjsUM_.js";import{B as Q}from"./badge-t4oak8yc.js";import{B as h}from"./button-Bzx0ccHH.js";import{I as u}from"./input-CCN-4hy4.js";import{A as P}from"./activity-5IcAhZoH.js";import{A as D}from"./arrow-left-IzGlownM.js";const j={submissions:"Submission review",curation:"Scheduled curation",cron_health:"CRON health",chat_reliability:"Chat reliability"},E={healthy:"healthy",degraded:"degraded",repairing:"running","rolled-back":"broken",manual:"degraded"},S=["admin","autonomousOperations"],W=()=>{var A;const M=R(),[p,T]=d.useState(""),[f,_]=d.useState(""),[g,v]=d.useState({}),[b,N]=d.useState(""),c=q({queryKey:S,queryFn:()=>x.getAutonomousOperations(),refetchInterval:3e4,retry:!1}),t=H({mutationFn:s=>s(),onSuccess:s=>{M.setQueryData(S,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(()=>x.setAutonomousManualMode(!a.manual_mode,a.revision,f)),k=(s,o)=>t.mutate(()=>x.setAutonomousOperator(s,o,a.revision,g[s]??"")),w=()=>{var o;const s=((o=a.baseline)==null?void 0:o.revision)??0;t.mutate(()=>x.qualifyAutonomousChatBaseline(p,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(h,{asChild:!0,variant:"outline",children:e.jsxs(B,{to:"/admin-dashboard",children:[e.jsx(D,{className:"h-4 w-4 mr-2"}),"Admin dashboard"]})})]}),a.manual_mode&&e.jsx(n,{className:"cron-status--degraded",role:"status",children:e.jsxs(i,{className:"pt-6 flex gap-3",children:[e.jsx(I,{className:"h-5 w-5"}),e.jsxs("div",{children:[e.jsx("strong",{children:"Manual mode is enabled."}),e.jsxs("p",{children:[a.monitoring_active?"Monitoring remains active":"Monitoring is not currently verified","; autonomous callbacks, retries, deployments, and data mutations fail closed."]})]})]})}),e.jsxs("div",{className:"grid md:grid-cols-4 gap-4",children:[e.jsxs(n,{className:C(E[a.display_state]),children:[e.jsx(l,{children:e.jsx(r,{className:"text-sm",children:"Overall state"})}),e.jsxs(i,{children:[e.jsx("div",{className:"text-2xl font-bold capitalize",children:a.display_state}),e.jsxs("p",{className:"text-sm",children:["Monitoring ",a.monitoring_active?"active":"inactive"]})]})]}),e.jsxs(n,{children:[e.jsx(l,{children:e.jsx(r,{className:"text-sm",children:"Codex cost"})}),e.jsxs(i,{children:[e.jsxs("div",{className:"text-2xl font-bold",children:["$",a.costs.total_usd]}),e.jsxs("p",{className:"text-sm",children:[a.costs.input_tokens+a.costs.output_tokens," tokens"]})]})]}),e.jsxs(n,{children:[e.jsx(l,{children:e.jsx(r,{className:"text-sm",children:"Repair lease"})}),e.jsxs(i,{children:[e.jsx("div",{className:"text-lg font-bold",children:a.active_lease?a.active_lease.owner_operator:"Available"}),e.jsx("p",{className:"text-sm",children:a.active_lease?`Expires ${m(a.active_lease.expires_at)}`:"No active source repair"})]})]}),e.jsxs(n,{children:[e.jsx(l,{children:e.jsx(r,{className:"text-sm",children:"Global control"})}),e.jsxs(i,{className:"space-y-2",children:[e.jsx(u,{"aria-label":"Manual mode confirmation",value:f,onChange:s=>_(s.target.value),placeholder:"Type SET_MANUAL_MODE"}),e.jsx(h,{disabled:t.isPending||f!=="SET_MANUAL_MODE",onClick:O,children:a.manual_mode?"Leave manual mode":"Enable manual mode"})]})]})]}),e.jsx("div",{className:"grid md:grid-cols-4 gap-4",children:a.operators.map(s=>e.jsxs(n,{className:C(E[s.status]),children:[e.jsx(l,{children:e.jsxs(r,{className:"flex justify-between gap-2",children:[e.jsx("span",{children:j[s.operator]}),e.jsx(Q,{children:s.status})]})}),e.jsxs(i,{className:"space-y-3",children:[e.jsxs("p",{children:[s.enabled?"Mutation enabled":"Mutation disabled"," · monitoring ",s.monitoring_active?"active":"unverified"]}),e.jsxs("p",{className:"text-sm",children:["Next scheduled run: ",s.next_scheduled_run?m(s.next_scheduled_run):"not scheduled"]}),e.jsx(u,{"aria-label":`${j[s.operator]} confirmation`,value:g[s.operator]??"",onChange:o=>v(L=>({...L,[s.operator]:o.target.value})),placeholder:"Type SET_OPERATOR_STATE"}),e.jsx(h,{disabled:t.isPending||a.manual_mode&&!s.enabled||g[s.operator]!=="SET_OPERATOR_STATE",onClick:()=>k(s.operator,!s.enabled),children:s.enabled?"Disable":"Enable"})]})]},s.operator))}),e.jsxs(n,{children:[e.jsx(l,{children:e.jsx(r,{children:"Qualified scalable-chat baseline"})}),e.jsxs(i,{className:"space-y-3",children:[e.jsx("p",{className:"font-mono break-all",children:((A=a.baseline)==null?void 0:A.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(u,{"aria-label":"Exact baseline SHA",value:p,onChange:s=>T(s.target.value),placeholder:"40-character lowercase commit SHA"}),e.jsx(u,{"aria-label":"Baseline confirmation",value:b,onChange:s=>N(s.target.value),placeholder:"Type QUALIFY_CHAT_BASELINE"}),e.jsx(h,{disabled:t.isPending||!/^[0-9a-f]{40}$/.test(p)||b!=="QUALIFY_CHAT_BASELINE",onClick:w,children:"Qualify exact SHA"})]})]})]}),e.jsxs(n,{children:[e.jsx(l,{children:e.jsx(r,{children:"Provider and fallback state"})}),e.jsx(i,{children:a.provider_states.length?e.jsx("ul",{className:"space-y-2",children:a.provider_states.map(s=>e.jsxs("li",{children:[e.jsx("strong",{children:s.environment}),": ",s.active_provider," · ",s.reason_code," · manifest ",s.manifest_revision]},s.environment))}):e.jsx("p",{children:"No provider state recorded."})})]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs(n,{children:[e.jsx(l,{children:e.jsx(r,{children:"Recent runs"})}),e.jsx(i,{children:a.recent_runs.length?e.jsx("ul",{className:"space-y-2",children:a.recent_runs.map(s=>e.jsxs("li",{children:[e.jsx("strong",{children:j[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(n,{children:[e.jsx(l,{children:e.jsx(r,{children:"Recent actions"})}),e.jsx(i,{children:a.recent_actions.length?e.jsx("ul",{className:"space-y-2",children:a.recent_actions.map(s=>e.jsxs("li",{children:[e.jsx("strong",{children:j[s.operator]})," · ",s.capability," · ",s.reason_code," · ",s.resource_kind,"/",s.resource_identifier]},s.action_id))}):e.jsx("p",{children:"No actions recorded."})})]})]}),e.jsxs(n,{children:[e.jsx(l,{children:e.jsx(r,{children:"Hard exclusions"})}),e.jsx(i,{children:e.jsx("ul",{className:"list-disc pl-5",children:a.exclusions.map(s=>e.jsx("li",{children:s},s))})})]}),y&&e.jsxs("p",{role:"alert",children:["Control update failed: ",y,". Refresh before retrying."]})]})})};export{W as default}; diff --git a/assets/AutonomousOperations-CYN302r1.js b/assets/AutonomousOperations-CYN302r1.js deleted file mode 100644 index 24d1c5509faded40229452921a85be5740904b36..0000000000000000000000000000000000000000 --- a/assets/AutonomousOperations-CYN302r1.js +++ /dev/null @@ -1 +0,0 @@ -import{a as R,f as B,r as m,j as e,L as q}from"./index-CqKcHUvZ.js";import{u as H}from"./useQuery-Cngk7eL9.js";import{u as I}from"./useMutation-BItMAQ7s.js";import{C as n,d as i,a as t,b as r,f as x,o as u}from"./CronDashboard-Ch03vo4I.js";import{B as Q}from"./badge-D-oq0Pkj.js";import{B as h}from"./button-BYn4yUH_.js";import{I as j}from"./input-sw0Ix0Sa.js";import{A as P}from"./activity-DDb7qU7w.js";import{A as D}from"./arrow-left-D_tIkkPW.js";import{S as $}from"./shield-alert-B0VZio-w.js";const p={submissions:"Submission review",curation:"Scheduled curation",cron_health:"CRON health",chat_reliability:"Chat reliability"},S={healthy:"cron-status--healthy",degraded:"cron-status--degraded",repairing:"cron-status--running","rolled-back":"cron-status--broken",manual:"cron-status--degraded"},Z=()=>{var E;const{user:o}=R(),M=B(),[f,T]=m.useState(""),[b,v]=m.useState(""),[g,N]=m.useState({}),[_,y]=m.useState(""),A=["autonomousOperations",o==null?void 0:o.username],d=H({queryKey:A,queryFn:()=>u.getAutonomousOperations(),enabled:!!(o!=null&&o.is_admin),refetchInterval:3e4,retry:!1}),l=I({mutationFn:s=>s(),onSuccess:s=>{M.setQueryData(A,s),v(""),N({}),y("")}}),a=d.data,C=l.error instanceof Error?l.error.message:null;if(d.isLoading)return e.jsx("div",{className:"page","aria-busy":"true",children:"Loading autonomous operations…"});if(d.error||!a)return e.jsxs("div",{className:"page",children:[e.jsx("h1",{children:"Autonomous operations unavailable"}),e.jsx("p",{children:d.error instanceof Error?d.error.message:"No status was returned."})]});const O=()=>l.mutate(()=>u.setAutonomousManualMode(!a.manual_mode,a.revision,b)),k=(s,c)=>l.mutate(()=>u.setAutonomousOperator(s,c,a.revision,g[s]??"")),w=()=>{var c;const s=((c=a.baseline)==null?void 0:c.revision)??0;l.mutate(()=>u.qualifyAutonomousChatBaseline(f,s,_))};return e.jsx("div",{className:"cron-dashboard","data-shadcn":!0,children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8 space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold flex items-center gap-3",children:[e.jsx(P,{className:"h-8 w-8"}),"Autonomous operations"]}),e.jsx("p",{className:"mt-2 cron-muted",children:"Content-free supervision, remote controls, and bounded audit history."})]}),e.jsx(h,{asChild:!0,variant:"outline",children:e.jsxs(q,{to:"/admin-dashboard",children:[e.jsx(D,{className:"h-4 w-4 mr-2"}),"Admin dashboard"]})})]}),a.manual_mode&&e.jsx(n,{className:"cron-status--degraded",role:"status",children:e.jsxs(i,{className:"pt-6 flex gap-3",children:[e.jsx($,{className:"h-5 w-5"}),e.jsxs("div",{children:[e.jsx("strong",{children:"Manual mode is enabled."}),e.jsxs("p",{children:[a.monitoring_active?"Monitoring remains active":"Monitoring is not currently verified","; autonomous callbacks, retries, deployments, and data mutations fail closed."]})]})]})}),e.jsxs("div",{className:"grid md:grid-cols-4 gap-4",children:[e.jsxs(n,{className:S[a.display_state],children:[e.jsx(t,{children:e.jsx(r,{className:"text-sm",children:"Overall state"})}),e.jsxs(i,{children:[e.jsx("div",{className:"text-2xl font-bold capitalize",children:a.display_state}),e.jsxs("p",{className:"text-sm",children:["Monitoring ",a.monitoring_active?"active":"inactive"]})]})]}),e.jsxs(n,{children:[e.jsx(t,{children:e.jsx(r,{className:"text-sm",children:"Codex cost"})}),e.jsxs(i,{children:[e.jsxs("div",{className:"text-2xl font-bold",children:["$",a.costs.total_usd]}),e.jsxs("p",{className:"text-sm",children:[a.costs.input_tokens+a.costs.output_tokens," tokens"]})]})]}),e.jsxs(n,{children:[e.jsx(t,{children:e.jsx(r,{className:"text-sm",children:"Repair lease"})}),e.jsxs(i,{children:[e.jsx("div",{className:"text-lg font-bold",children:a.active_lease?a.active_lease.owner_operator:"Available"}),e.jsx("p",{className:"text-sm",children:a.active_lease?`Expires ${x(a.active_lease.expires_at)}`:"No active source repair"})]})]}),e.jsxs(n,{children:[e.jsx(t,{children:e.jsx(r,{className:"text-sm",children:"Global control"})}),e.jsxs(i,{className:"space-y-2",children:[e.jsx(j,{"aria-label":"Manual mode confirmation",value:b,onChange:s=>v(s.target.value),placeholder:"Type SET_MANUAL_MODE"}),e.jsx(h,{disabled:l.isPending||b!=="SET_MANUAL_MODE",onClick:O,children:a.manual_mode?"Leave manual mode":"Enable manual mode"})]})]})]}),e.jsx("div",{className:"grid md:grid-cols-4 gap-4",children:a.operators.map(s=>e.jsxs(n,{className:S[s.status],children:[e.jsx(t,{children:e.jsxs(r,{className:"flex justify-between gap-2",children:[e.jsx("span",{children:p[s.operator]}),e.jsx(Q,{children:s.status})]})}),e.jsxs(i,{className:"space-y-3",children:[e.jsxs("p",{children:[s.enabled?"Mutation enabled":"Mutation disabled"," · monitoring ",s.monitoring_active?"active":"unverified"]}),e.jsxs("p",{className:"text-sm",children:["Next scheduled run: ",s.next_scheduled_run?x(s.next_scheduled_run):"not scheduled"]}),e.jsx(j,{"aria-label":`${p[s.operator]} confirmation`,value:g[s.operator]??"",onChange:c=>N(L=>({...L,[s.operator]:c.target.value})),placeholder:"Type SET_OPERATOR_STATE"}),e.jsx(h,{disabled:l.isPending||a.manual_mode&&!s.enabled||g[s.operator]!=="SET_OPERATOR_STATE",onClick:()=>k(s.operator,!s.enabled),children:s.enabled?"Disable":"Enable"})]})]},s.operator))}),e.jsxs(n,{children:[e.jsx(t,{children:e.jsx(r,{children:"Qualified scalable-chat baseline"})}),e.jsxs(i,{className:"space-y-3",children:[e.jsx("p",{className:"font-mono break-all",children:((E=a.baseline)==null?void 0:E.sha)??"No baseline qualified"}),a.baseline&&e.jsxs("p",{className:"text-sm",children:["Revision ",a.baseline.revision," · ",a.baseline.qualified_by," · ",x(a.baseline.qualified_at)]}),e.jsxs("div",{className:"grid md:grid-cols-[1fr_1fr_auto] gap-2",children:[e.jsx(j,{"aria-label":"Exact baseline SHA",value:f,onChange:s=>T(s.target.value),placeholder:"40-character lowercase commit SHA"}),e.jsx(j,{"aria-label":"Baseline confirmation",value:_,onChange:s=>y(s.target.value),placeholder:"Type QUALIFY_CHAT_BASELINE"}),e.jsx(h,{disabled:l.isPending||!/^[0-9a-f]{40}$/.test(f)||_!=="QUALIFY_CHAT_BASELINE",onClick:w,children:"Qualify exact SHA"})]})]})]}),e.jsxs(n,{children:[e.jsx(t,{children:e.jsx(r,{children:"Provider and fallback state"})}),e.jsx(i,{children:a.provider_states.length?e.jsx("ul",{className:"space-y-2",children:a.provider_states.map(s=>e.jsxs("li",{children:[e.jsx("strong",{children:s.environment}),": ",s.active_provider," · ",s.reason_code," · manifest ",s.manifest_revision]},s.environment))}):e.jsx("p",{children:"No provider state recorded."})})]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs(n,{children:[e.jsx(t,{children:e.jsx(r,{children:"Recent runs"})}),e.jsx(i,{children:a.recent_runs.length?e.jsx("ul",{className:"space-y-2",children:a.recent_runs.map(s=>e.jsxs("li",{children:[e.jsx("strong",{children:p[s.operator]})," · ",s.status," · ",s.exit_classification," · $",s.cost_usd," · ",x(s.created_at)]},s.run_id))}):e.jsx("p",{children:"No runs recorded."})})]}),e.jsxs(n,{children:[e.jsx(t,{children:e.jsx(r,{children:"Recent actions"})}),e.jsx(i,{children:a.recent_actions.length?e.jsx("ul",{className:"space-y-2",children:a.recent_actions.map(s=>e.jsxs("li",{children:[e.jsx("strong",{children:p[s.operator]})," · ",s.capability," · ",s.reason_code," · ",s.resource_kind,"/",s.resource_identifier]},s.action_id))}):e.jsx("p",{children:"No actions recorded."})})]})]}),e.jsxs(n,{children:[e.jsx(t,{children:e.jsx(r,{children:"Hard exclusions"})}),e.jsx(i,{children:e.jsx("ul",{className:"list-disc pl-5",children:a.exclusions.map(s=>e.jsx("li",{children:s},s))})})]}),C&&e.jsxs("p",{role:"alert",children:["Control update failed: ",C,". Refresh before retrying."]})]})})};export{Z as default}; diff --git a/assets/BenchmarkDetailView-HVBhj9Ke.js b/assets/BenchmarkDetailView-DGAxl02Y.js similarity index 98% rename from assets/BenchmarkDetailView-HVBhj9Ke.js rename to assets/BenchmarkDetailView-DGAxl02Y.js index 55c8e18d44ddee5aa2a1f973cbe64259f058dd05..bcd089d17090e80d13865010cef36d0d6452ac06 100644 --- a/assets/BenchmarkDetailView-HVBhj9Ke.js +++ b/assets/BenchmarkDetailView-DGAxl02Y.js @@ -1,2 +1,2 @@ -import{r as L,j as a,D as le,L as ne,c as ct,p as ot,u as dt,e as ut,q as mt}from"./index-CqKcHUvZ.js";import{R as ht}from"./ResearchFollowButton-CrCIwiok.js";import{u as te}from"./useQuery-Cngk7eL9.js";import{c as re}from"./catalog-D26nGNnK.js";import{C as ft,E as pt,e as gt}from"./ExternalSourceEvalBadge-TyFEU7vd.js";import{L as ce}from"./LatexTitle-BI9yl-Fo.js";import{S as Ke}from"./switch-BvSgzfJM.js";import{I as xt}from"./components-Dmnn5Z5p.js";import{S as oe}from"./skeleton-DleNhBYA.js";import{A as bt,a as yt}from"./alert-Z2yFUcyL.js";import{B as wt}from"./BenchmarkTrendSparkline-BrvDBmsS.js";import{s as vt}from"./safeExternalHref-CkBrsh84.js";import{s as jt}from"./slug-BpH-Nkvz.js";import"./useMutation-BItMAQ7s.js";import"./research-Dt0MUW0x.js";import"./plus-DZF-NxR0.js";import"./papers-bE3C_Qzl.js";import"./hover-card-BTsA69o8.js";import"./index-C8IgDsSE.js";import"./AuthorAvatar-CWCqOa0h.js";import"./colors-_scCXfCe.js";function _t(e,t,r){const s=t?(e??[]).filter(l=>l.task_id===t):e??[],n=s.filter(l=>l.is_open===!1),i=n.reduce((l,o)=>l?(o.best_rank??Number.POSITIVE_INFINITY)<(l.best_rank??Number.POSITIVE_INFINITY)?o:l:o,null);return{visible:r?s.filter(l=>l.is_open!==!1):s,hiddenClosed:n,topHiddenClosed:i}}function ie(e){if(e==null)return null;if(typeof e=="number")return Number.isFinite(e)?e:null;const t=e.includes("±")?e.split("±")[0].trim():e.trim(),r=parseFloat(t);return Number.isFinite(r)?r:null}const Ge=[{label:"All",maxParametersExclusive:void 0},{label:"<10M",maxParametersExclusive:1e7},{label:"<100M",maxParametersExclusive:1e8},{label:"<1B",maxParametersExclusive:1e9},{label:"<3B",maxParametersExclusive:3e9},{label:"<6B",maxParametersExclusive:6e9},{label:"<12B",maxParametersExclusive:12e9},{label:"<32B",maxParametersExclusive:32e9},{label:"<128B",maxParametersExclusive:128e9},{label:"<500B",maxParametersExclusive:5e11}];function St(e){const t=e===null?void 0:Number(e);return Ge.some(r=>r.maxParametersExclusive===t)?t:void 0}function kt(e){return new Intl.NumberFormat("en",{notation:"compact",maximumSignificantDigits:3}).format(e)}function Ct(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function Et(e){const t=new Map;for(const r of e){const s=Ct(r),n=t.get(s);if(!n){t.set(s,{...r,metrics:{...r.metrics||{}},sourceEvaluationIds:[r.id],ranksByMetric:r.best_metric&&r.best_rank!=null?{[r.best_metric]:r.best_rank}:{},parameterCount:r.num_parameters??null,hasParameterConflict:!1});continue}n.metrics={...n.metrics,...r.metrics||{}},n.sourceEvaluationIds.push(r.id),r.best_metric&&r.best_rank!=null&&(n.ranksByMetric[r.best_metric]=r.best_rank),r.num_parameters!=null&&!n.hasParameterConflict&&(n.parameterCount===null?n.parameterCount=r.num_parameters:n.parameterCount!==r.num_parameters&&(n.parameterCount=null,n.hasParameterConflict=!0))}return Array.from(t.values())}function Le(e,t){return t===void 0?e:e.filter(r=>r.parameterCount!==null&&r.parameterCounts+n,0);for(const[s,n]of t)if(n>=2&&n*2>r)return s;return null}function $t(e,t){const r=e.evaluated_on;return r&&r!==t&&r!==Rt(e.updated_at)?r:e.paper_published_date||""}function Mt(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const s=Pt(e),n=e.map(u=>{var R;const h=ie((R=u.metrics)==null?void 0:R[t]);return{eval:u,value:h,date:$t(u,s)}}).filter(u=>u.value!==null&&!!u.date).sort((u,h)=>u.date.localeCompare(h.date)),i=[];let l=null;for(const u of n){const h=l==null?!0:r==="↓"?u.valuel;h&&(l=u.value),i.push({value:u.value,date:u.date,dateLabel:u.date.slice(0,7),modelName:u.eval.model_name||"",paperTitle:u.eval.paper_title||"",paperRouteId:u.eval.paper_arxiv_id||u.eval.paper_id||null,isSota:h})}const d=e.map(u=>{var h;return{eval:u,value:ie((h=u.metrics)==null?void 0:h[t])}}).filter(u=>u.value!==null).sort((u,h)=>r==="↓"?u.value-h.value:h.value-u.value)[0],f=(d==null?void 0:d.value)??0,x=(d==null?void 0:d.eval.model_name)||(d==null?void 0:d.eval.paper_title)||"";return{points:i,sota:f,sotaModel:x}}function Qe(e,t,r,s){const n=t.find(i=>i.id===s);if(e.length===0)return null;if(n!=null&&n.task_id&&e.some(i=>i.id===n.task_id))return n.task_id;if(r){const i=e.find(l=>l.slug===r);if(i)return i.id}if(e.length===1)return e[0].id;if(t.length>0){const i=new Map;for(const d of t)i.set(d.task_id,(i.get(d.task_id)||0)+1);let l=null,o=-1;for(const d of e){const f=i.get(d.id)||0;f>o&&(o=f,l=d.id)}if(l)return l}return e[0].id}function Tt(e){var _,X,Y;const{evaluations:t,tasks:r,taskSlug:s,highlightEvalId:n,parameterBound:i,showMoreMetrics:l,fittingMetricCount:o=1}=e,d=Qe(r,t,s,n),f=r.find(c=>c.id===d)||r[0]||null,x=t.find(c=>c.id===n),u=_t(t,d,e.hideClosed),h=Et(u.visible),R=Le(h,i),C=e.configuredMetrics.map(c=>c.metric_name),P=Array.from(new Set(h.flatMap(c=>[...c.best_metric?[c.best_metric]:[],...Object.keys(c.metrics||{})]))),S=C.length?C:P,g=new Map;for(const c of h){const m=c.best_metric;!m||ie(c.metrics[m])===null||C.length&&!S.includes(m)||g.set(m,(g.get(m)||0)+1)}const k=((_=[...g].sort((c,m)=>m[1]-c[1])[0])==null?void 0:_[0])||S[0]||"",j=S.find(c=>{var m;return c.toLocaleLowerCase()===((m=e.metric)==null?void 0:m.trim().toLocaleLowerCase())})||(x==null?void 0:x.best_metric)||k,D=((X=e.directions)==null?void 0:X.directions[j])==="lower_is_better"?"↓":"↑",W=j&&S.includes(j)?[j,...S.filter(c=>c!==j)]:S,w=W.length?l?W:W.slice(0,Math.max(1,o)):j?[j]:[],U=R.slice().sort((c,m)=>{const p=ie(c.metrics[j]),y=ie(m.metrics[j]);return p!==null&&y!==null?D==="↓"?p-y:y-p:p!==null?-1:y!==null?1:Ie(c,j)-Ie(m,j)});let I=null,N=0;const Q=U.map((c,m)=>{const p=ie(c.metrics[j]);return p!==null&&p!==I&&(I=p,N=m+1),{evaluation:c,rank:p===null?null:N,isHighlighted:Nt(c,n)}}),{points:z,sota:ee,sotaModel:O}=Mt(R,j,D),M=i===void 0?e.initialSummary:void 0,q=e.ready.evaluations&&e.ready.tasks&&e.ready.directions&&(!d||e.ready.metrics),K={parameter_coverage_known:h.filter(c=>c.parameterCount!==null).length,parameter_coverage_total:h.length};return{currentTaskId:d,primaryTask:f,activeMetric:j,arrow:D,allowedMetrics:S,orderedMetrics:W,visibleMetrics:w,rows:Q,chartPoints:z,highlightedEval:((Y=Q.find(c=>c.isHighlighted))==null?void 0:Y.evaluation)||null,hiddenClosedEvals:u.hiddenClosed,hiddenClosedTopEval:u.topHiddenClosed,parameterBound:i,parameterCoverage:K,hasParameterMetadata:K.parameter_coverage_known>0,parameterFilters:Ge.map(c=>({...c,selected:i===c.maxParametersExclusive,disabled:i!==c.maxParametersExclusive&&Le(h,c.maxParametersExclusive).length===0})),displayedMetric:q?j:M==null?void 0:M.metric,displayedSota:q?ee:M==null?void 0:M.value,displayedSotaModel:q?O:M==null?void 0:M.model_name,isSummaryLoading:!q&&!M,isInitialFilteredViewLoading:i!==void 0&&!q}}function Ft(e,t,r,s=1,n=0){const i=e-t.fixed-(r?t.harness:0);if(t.metric<=0)return 1;const l=Math.floor(i/t.metric);if(lr+he(t,s),0),harness:he(t,"--bm-harness-width"),metric:he(t,"--bm-metric-width")}}const It=20;function Ae(e,t){return e?a.jsx(ce,{title:e}):t||"—"}function At({model:e,showHarness:t,setMetric:r,highlightRowRef:s,onFittingMetricCountChange:n}){const{rows:i,visibleMetrics:l,activeMetric:o,arrow:d}=e,[f,x]=L.useState(null);return L.useEffect(()=>{if(!f)return;const u=()=>{f.classList.toggle("has-horizontal-overflow",f.scrollWidth>f.clientWidth);const R=f.firstElementChild;if(!R)return;const C=f.clientWidth,P=Lt(R);f.classList.toggle("unpins-trailing-columns",CS.clientHeight?0:It;n(k=>Ft(C,P,t,k,g))},h=new ResizeObserver(u);return h.observe(f),f.firstElementChild&&h.observe(f.firstElementChild),u(),()=>h.disconnect()},[f,t,n]),a.jsx("div",{ref:x,className:"bm-table-scroll",role:"region","aria-label":"Leaderboard metrics",tabIndex:0,children:a.jsxs("table",{id:"benchmark-leaderboard",className:"bm-table",style:{"--bm-metric-count":l.length,"--bm-harness-count":t?1:0},children:[a.jsxs("colgroup",{children:[a.jsx("col",{className:"bm-width-rank"}),a.jsx("col",{className:"bm-width-model"}),a.jsx("col",{className:"bm-width-parameters"}),t&&a.jsx("col",{className:"bm-width-harness"}),l.map(u=>a.jsx("col",{className:"bm-width-metric"},u)),a.jsx("col",{}),a.jsx("col",{className:"bm-width-year"})]}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{className:"col-rank",children:"Rank"}),a.jsx("th",{className:"col-model",children:"Model"}),a.jsxs("th",{className:"col-parameters",children:[a.jsx("span",{className:"bm-label-full",children:"Parameters"}),a.jsx("span",{className:"bm-label-short",children:"Params"})]}),t&&a.jsx("th",{className:"col-harness",children:"Harness"}),l.map(u=>{const h=u===o;return a.jsx("th",{className:`col-value ${h?"is-active":""}`,"aria-sort":h?d==="↓"?"ascending":"descending":"none",children:a.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>r(u),"aria-pressed":h,title:`Sort by ${u}`,children:[u,h?` ${d}`:""]})},u)}),a.jsx("th",{className:"col-paper",children:"Paper"}),a.jsx("th",{className:"col-year",children:"Year"})]})}),a.jsx("tbody",{children:i.map(({evaluation:u,rank:h,isHighlighted:R})=>{var S;const C=u.paper_arxiv_id||u.paper_id,P=u.paper_title||(u.paper_arxiv_id?`arXiv:${u.paper_arxiv_id}`:null);return a.jsxs("tr",{ref:R?s:void 0,className:R?"is-highlighted":void 0,children:[a.jsx("td",{className:"col-rank",children:h??"—"}),a.jsxs("td",{className:"col-model",children:[R&&a.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),u.hf_model_url?a.jsx("a",{href:u.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"bm-model-link",title:`Open ${u.model_name||"model"} on Hugging Face`,children:u.model_name||"—"}):u.model_name||"—",u.is_open===!1&&a.jsx(ft,{}),(u.external??u.is_external)&&a.jsx(pt,{sourceUrl:u.source_url||u.external_source_url||u.result_url})]}),a.jsx("td",{className:"col-parameters",title:u.parameterCount===null?void 0:u.parameterCount.toLocaleString("en-US"),"aria-label":u.parameterCount===null?"Parameters unknown":`${u.parameterCount.toLocaleString("en-US")} parameters`,children:u.parameterCount===null?"—":kt(u.parameterCount)}),t&&a.jsx("td",{className:"col-harness",children:u.harness||"—"}),l.map(g=>{var j;const k=g===o,B=(j=u.metrics)==null?void 0:j[g];return a.jsx("td",{className:`col-value${k?" is-active":""}${k&&h===1?" is-best":""}`,children:B!=null&&B!==""?le(B):"—"},g)}),a.jsx("td",{className:"col-paper",children:C?a.jsx(ne,{to:`/paper/${C}`,title:u.paper_title||P||void 0,children:Ae(u.paper_title,P)}):Ae(u.paper_title,P)}),a.jsx("td",{className:"col-year",children:((S=u.evaluated_on||u.paper_published_date)==null?void 0:S.slice(0,4))||"—"})]},u.id)})})]})})}function Be(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const fe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function pe(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function Bt(e,t){if(e===t){const{year:d,month:f}=pe(e);return[{timestamp:new Date(d,f,1).getTime(),key:`${d}-${f}`,label:`${fe[f]} ${d}`}]}const r=pe(e),s=pe(t);if(r.year===s.year){const d=s.month-r.month+1;let f=1;const x=12;d>x&&(f=Math.ceil(d/x));const u=[];for(let h=r.month;h<=s.month;h+=f)u.push({timestamp:new Date(r.year,h,1).getTime(),key:`${r.year}-${h}`,label:d<=3?`${fe[h]} ${r.year}`:fe[h]});return u}const n=s.year-r.year+1;let i=1;const l=12;n>l&&(i=Math.ceil(n/l));const o=[];for(let d=r.year;d<=s.year;d+=i)o.push({timestamp:new Date(d,0,1).getTime(),key:String(d),label:String(d)});return o}const Dt=({points:e,metric:t})=>{const r=ct(),[s,n]=L.useState(null),i=880,l=320,o=60,d=30,f=40,x=50,u=e.map(c=>c.value),h=Math.min(...u),C=Math.max(...u)-h||1,P=i-o-d,S=l-f-x,g=e.map(c=>Be(c.date)),k=Math.min(...g),B=Math.max(...g),j=B-k||1,D=c=>k===B?o+P/2:o+(c-k)/j*P,W=e.map((c,m)=>{const p=D(Be(c.date)),y=(c.value-h)/C,$=f+S*(1-y);return{x:p,y:$,data:c,idx:m}}),w=W.filter(c=>c.data.isSota);let U="";if(w.length>=2){U=`M${w[0].x},${w[0].y}`;for(let c=1;c{const m=c.data.modelName||c.data.paperTitle||"";if(!m)return null;const p=m.length>22?m.slice(0,21)+"…":m,y=p.length*I;let $=c.x-y/2,E=c.x+y/2,v="middle";return $i-d&&(E=i-d,$=E-y,v="end"),{x:v==="start"?o:v==="end"?i-d:c.x,y:c.y-Q,text:p,anchor:v,left:$,right:E}},ee=[],O=w.length>0?z(w[w.length-1]):null;let M=-1/0;for(let c=0;cO.left-N||(M=m.right,ee.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}O&&ee.push({x:O.x,y:O.y,text:O.text,anchor:O.anchor});const q=Bt(k,B),K=5,_=c=>n(m=>m===c?null:m),X=c=>{c&&r(`/paper/${c}`)},Y=(c,m)=>{const y=`${c.data.modelName||c.data.paperTitle||"Unknown model"}: ${le(c.data.value)} on ${c.data.dateLabel}`,$=!!c.data.paperRouteId;return a.jsxs("g",{children:[m,a.jsx("circle",{cx:c.x,cy:c.y,r:"10",fill:"transparent",style:{cursor:$?"pointer":"default",outline:"none"},tabIndex:0,role:$?"link":"img","aria-label":y,onMouseEnter:()=>n(c.idx),onMouseLeave:()=>_(c.idx),onFocus:()=>n(c.idx),onBlur:()=>_(c.idx),onClick:()=>X(c.data.paperRouteId),onKeyDown:E=>{$&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),X(c.data.paperRouteId))},children:a.jsx("title",{children:y})})]},c.idx)};return a.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${l}`,style:{display:"block"},children:[a.jsx("text",{x:o-38,y:f+S/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${o-38} ${f+S/2})`,children:t}),Array.from({length:K}).map((c,m)=>{const p=m/(K-1),y=f+S*(1-p),$=h+C*p;return a.jsxs("g",{children:[a.jsx("line",{x1:o,y1:y,x2:i-d,y2:y,stroke:"var(--hairline)",strokeWidth:"1"}),a.jsx("text",{x:o-10,y:y+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:le($)})]},m)}),q.map(c=>{const m=D(c.timestamp);return a.jsx("text",{x:m,y:l-x+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:c.label},c.key)}),W.filter(c=>!c.data.isSota).map(c=>{const m=s===c.idx;return Y(c,a.jsx("circle",{cx:c.x,cy:c.y,r:m?3:2,fill:"var(--ink-faint)",opacity:m?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),U&&a.jsx("path",{d:U,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),w.map(c=>{const m=s===c.idx;return Y(c,a.jsx("circle",{cx:c.x,cy:c.y,r:m?4.5:3,fill:m?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"1.5",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),ee.map((c,m)=>a.jsx("text",{x:c.x,y:c.y,fontSize:"9.5",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:c.anchor,pointerEvents:"none",style:{paintOrder:"stroke",stroke:"var(--bg-elevated)",strokeWidth:3,strokeLinejoin:"round"},children:c.text},`label-${m}`)),s!==null&&W[s]&&(()=>{const c=W[s],m=c.data.modelName||c.data.paperTitle||"Unknown model",y=`${m.length>40?m.slice(0,39)+"…":m}: ${le(c.data.value)}`,E=Math.max(120,Math.min(340,y.length*6.6+24)),v=30;let H=c.x-E/2;Hi-d&&(H=i-d-E);const G=c.y-v-14>=f?c.y-v-12:c.y+12;return a.jsxs("g",{pointerEvents:"none",children:[a.jsx("rect",{x:H,y:G,width:E,height:v,rx:"6",ry:"6",fill:"var(--bg-elevated)",stroke:"var(--hairline-strong)",strokeWidth:"1",style:{filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.08))"}}),a.jsx("text",{x:H+12,y:G+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:y})]})})()]})};function Ht(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),s=r.createElement("base"),n=r.createElement("a");return r.head.appendChild(s),r.body.appendChild(n),t&&(s.href=t),n.href=e,n.href}const Vt=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function Z(e){const t=[];for(let r=0,s=e.length;rV||e.height>V)&&(e.width>V&&e.height>V?e.width>e.height?(e.height*=V/e.width,e.width=V):(e.width*=V/e.height,e.height=V):e.width>V?(e.height*=V/e.width,e.width=V):(e.width*=V/e.height,e.height=V))}function zt(e,t={}){return e.toBlob?new Promise(r=>{e.toBlob(r,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(r=>{const s=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),n=s.length,i=new Uint8Array(n);for(let l=0;l{const s=new Image;s.onload=()=>{s.decode().then(()=>{requestAnimationFrame(()=>t(s))})},s.onerror=r,s.crossOrigin="anonymous",s.decoding="async",s.src=e})}async function Kt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Gt(e,t,r){const s="http://www.w3.org/2000/svg",n=document.createElementNS(s,"svg"),i=document.createElementNS(s,"foreignObject");return n.setAttribute("width",`${t}`),n.setAttribute("height",`${r}`),n.setAttribute("viewBox",`0 0 ${t} ${r}`),i.setAttribute("width","100%"),i.setAttribute("height","100%"),i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("externalResourcesRequired","true"),n.appendChild(i),i.appendChild(e),Kt(n)}const A=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||A(r,t)};function Qt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Xt(e,t){return Xe(t).map(r=>{const s=e.getPropertyValue(r),n=e.getPropertyPriority(r);return`${r}: ${s}${n?" !important":""};`}).join(" ")}function Yt(e,t,r,s){const n=`.${e}:${t}`,i=r.cssText?Qt(r):Xt(r,s);return document.createTextNode(`${n}{${i}}`)}function De(e,t,r,s){const n=window.getComputedStyle(e,r),i=n.getPropertyValue("content");if(i===""||i==="none")return;const l=Vt();try{t.className=`${t.className} ${l}`}catch{return}const o=document.createElement("style");o.appendChild(Yt(l,r,n,s)),t.appendChild(o)}function Jt(e,t,r){De(e,t,":before",r),De(e,t,":after",r)}const He="application/font-woff",Ve="image/jpeg",Zt={woff:He,woff2:He,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Ve,jpeg:Ve,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function er(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function ye(e){const t=er(e).toLowerCase();return Zt[t]||""}function tr(e){return e.split(/,/)[1]}function xe(e){return e.search(/^(data:)/)!==-1}function rr(e,t){return`data:${t};base64,${e}`}async function Je(e,t,r){const s=await fetch(e,t);if(s.status===404)throw new Error(`Resource "${s.url}" not found`);const n=await s.blob();return new Promise((i,l)=>{const o=new FileReader;o.onerror=l,o.onloadend=()=>{try{i(r({res:s,result:o.result}))}catch(d){l(d)}},o.readAsDataURL(n)})}const ge={};function ar(e,t,r){let s=e.replace(/\?.*/,"");return r&&(s=e),/ttf|otf|eot|woff2?/i.test(s)&&(s=s.replace(/.*\//,"")),t?`[${t}]${s}`:s}async function we(e,t,r){const s=ar(e,t,r.includeQueryParams);if(ge[s]!=null)return ge[s];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let n;try{const i=await Je(e,r.fetchRequestInit,({res:l,result:o})=>(t||(t=l.headers.get("Content-Type")||""),tr(o)));n=rr(i,t)}catch(i){n=r.imagePlaceholder||"";let l=`Failed to fetch resource: ${e}`;i&&(l=typeof i=="string"?i:i.message),l&&console.warn(l)}return ge[s]=n,n}async function sr(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ue(t)}async function nr(e,t){if(e.currentSrc){const i=document.createElement("canvas"),l=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,l==null||l.drawImage(e,0,0,i.width,i.height);const o=i.toDataURL();return ue(o)}const r=e.poster,s=ye(r),n=await we(r,s,t);return ue(n)}async function ir(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await me(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function lr(e,t){return A(e,HTMLCanvasElement)?sr(e):A(e,HTMLVideoElement)?nr(e,t):A(e,HTMLIFrameElement)?ir(e,t):e.cloneNode(Ze(e))}const cr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Ze=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function or(e,t,r){var s,n;if(Ze(t))return t;let i=[];return cr(e)&&e.assignedNodes?i=Z(e.assignedNodes()):A(e,HTMLIFrameElement)&&(!((s=e.contentDocument)===null||s===void 0)&&s.body)?i=Z(e.contentDocument.body.childNodes):i=Z(((n=e.shadowRoot)!==null&&n!==void 0?n:e).childNodes),i.length===0||A(e,HTMLVideoElement)||await i.reduce((l,o)=>l.then(()=>me(o,r)).then(d=>{d&&t.appendChild(d)}),Promise.resolve()),t}function dr(e,t,r){const s=t.style;if(!s)return;const n=window.getComputedStyle(e);n.cssText?(s.cssText=n.cssText,s.transformOrigin=n.transformOrigin):Xe(r).forEach(i=>{let l=n.getPropertyValue(i);i==="font-size"&&l.endsWith("px")&&(l=`${Math.floor(parseFloat(l.substring(0,l.length-2)))-.1}px`),A(e,HTMLIFrameElement)&&i==="display"&&l==="inline"&&(l="block"),i==="d"&&t.getAttribute("d")&&(l=`path(${t.getAttribute("d")})`),s.setProperty(i,l,n.getPropertyPriority(i))})}function ur(e,t){A(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),A(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function mr(e,t){if(A(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(n=>e.value===n.getAttribute("value"));s&&s.setAttribute("selected","")}}function hr(e,t,r){return A(t,Element)&&(dr(e,t,r),Jt(e,t,r),ur(e,t),mr(e,t)),t}async function fr(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let i=0;ilr(s,t)).then(s=>or(e,s,t)).then(s=>hr(e,s,t)).then(s=>fr(s,t))}const et=/url\((['"]?)([^'"]+?)\1\)/g,pr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,gr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function xr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function br(e){const t=[];return e.replace(et,(r,s,n)=>(t.push(n),r)),t.filter(r=>!xe(r))}async function yr(e,t,r,s,n){try{const i=r?Ht(t,r):t,l=ye(t);let o;return n||(o=await we(i,l,s)),e.replace(xr(t),`$1${o}$3`)}catch{}return e}function wr(e,{preferredFontFormat:t}){return t?e.replace(gr,r=>{for(;;){const[s,,n]=pr.exec(r)||[];if(!n)return"";if(n===t)return`src: ${s};`}}):e}function tt(e){return e.search(et)!==-1}async function rt(e,t,r){if(!tt(e))return e;const s=wr(e,r);return br(s).reduce((i,l)=>i.then(o=>yr(o,l,t,r)),Promise.resolve(s))}async function se(e,t,r){var s;const n=(s=t.style)===null||s===void 0?void 0:s.getPropertyValue(e);if(n){const i=await rt(n,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function vr(e,t){await se("background",e,t)||await se("background-image",e,t),await se("mask",e,t)||await se("-webkit-mask",e,t)||await se("mask-image",e,t)||await se("-webkit-mask-image",e,t)}async function jr(e,t){const r=A(e,HTMLImageElement);if(!(r&&!xe(e.src))&&!(A(e,SVGImageElement)&&!xe(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,n=await we(s,ye(s),t);await new Promise((i,l)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...d)=>{try{i(t.onImageErrorHandler(...d))}catch(f){l(f)}}:l;const o=e;o.decode&&(o.decode=i),o.loading==="lazy"&&(o.loading="eager"),r?(e.srcset="",e.src=n):e.href.baseVal=n})}async function _r(e,t){const s=Z(e.childNodes).map(n=>at(n,t));await Promise.all(s).then(()=>e)}async function at(e,t){A(e,Element)&&(await vr(e,t),await jr(e,t),await _r(e,t))}function Sr(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const s=t.style;return s!=null&&Object.keys(s).forEach(n=>{r[n]=s[n]}),e}const We={};async function Oe(e){let t=We[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},We[e]=t,t}async function qe(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async l=>{let o=l.replace(s,"$1");return o.startsWith("https://")||(o=new URL(o,e.url).href),Je(o,t.fetchRequestInit,({result:d})=>(r=r.replace(l,`url(${d})`),[l,d]))});return Promise.all(i).then(()=>r)}function Ue(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let s=e.replace(r,"");const n=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const d=n.exec(s);if(d===null)break;t.push(d[0])}s=s.replace(n,"");const i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,l="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",o=new RegExp(l,"gi");for(;;){let d=i.exec(s);if(d===null){if(d=o.exec(s),d===null)break;i.lastIndex=o.lastIndex}else o.lastIndex=i.lastIndex;t.push(d[0])}return t}async function kr(e,t){const r=[],s=[];return e.forEach(n=>{if("cssRules"in n)try{Z(n.cssRules||[]).forEach((i,l)=>{if(i.type===CSSRule.IMPORT_RULE){let o=l+1;const d=i.href,f=Oe(d).then(x=>qe(x,t)).then(x=>Ue(x).forEach(u=>{try{n.insertRule(u,u.startsWith("@import")?o+=1:n.cssRules.length)}catch(h){console.error("Error inserting rule from remote css",{rule:u,error:h})}})).catch(x=>{console.error("Error loading remote css",x.toString())});s.push(f)}})}catch(i){const l=e.find(o=>o.href==null)||document.styleSheets[0];n.href!=null&&s.push(Oe(n.href).then(o=>qe(o,t)).then(o=>Ue(o).forEach(d=>{l.insertRule(d,l.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",i)}}),Promise.all(s).then(()=>(e.forEach(n=>{if("cssRules"in n)try{Z(n.cssRules||[]).forEach(i=>{r.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${n.href}`,i)}}),r))}function Cr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>tt(t.style.getPropertyValue("src")))}async function Er(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=Z(e.ownerDocument.styleSheets),s=await kr(r,t);return Cr(s)}function st(e){return e.trim().replace(/["']/g,"")}function Nr(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(i=>{t.add(st(i))}),Array.from(s.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function Rr(e,t){const r=await Er(e,t),s=Nr(e);return(await Promise.all(r.filter(i=>s.has(st(i.style.fontFamily))).map(i=>{const l=i.parentStyleSheet?i.parentStyleSheet.href:null;return rt(i.cssText,l,t)}))).join(` +import{r as L,j as a,E as le,L as ne,c as ct,p as ot,u as dt,e as ut,q as mt}from"./index-D6jcIRWs.js";import{R as ht}from"./ResearchFollowButton-C2Bfd9dP.js";import{u as te}from"./useQuery-CUJUm4FY.js";import{c as re}from"./catalog-PYrB8_bm.js";import{C as ft,E as pt,e as gt}from"./ExternalSourceEvalBadge-DfhTt9yv.js";import{L as ce}from"./LatexTitle-D_92Jowu.js";import{S as Ke}from"./switch-D_MyRbto.js";import{I as xt}from"./components-DO1X940E.js";import{S as oe}from"./skeleton-BqkYFmXl.js";import{A as bt,a as yt}from"./alert-2MbxVzGL.js";import{B as wt}from"./BenchmarkTrendSparkline-BfAoxAzu.js";import{s as vt}from"./safeExternalHref-CkBrsh84.js";import{s as jt}from"./slug-BpH-Nkvz.js";import"./useMutation-p6mN4h17.js";import"./research-BggtGgC2.js";import"./plus-C4UQ62Q1.js";import"./papers-DIIIPDpj.js";import"./hover-card-DPpv0l_x.js";import"./index-DIg7XGE2.js";import"./AuthorAvatar-UMHOVOr9.js";import"./colors-CLwl8a2d.js";function _t(e,t,r){const s=t?(e??[]).filter(l=>l.task_id===t):e??[],n=s.filter(l=>l.is_open===!1),i=n.reduce((l,o)=>l?(o.best_rank??Number.POSITIVE_INFINITY)<(l.best_rank??Number.POSITIVE_INFINITY)?o:l:o,null);return{visible:r?s.filter(l=>l.is_open!==!1):s,hiddenClosed:n,topHiddenClosed:i}}function ie(e){if(e==null)return null;if(typeof e=="number")return Number.isFinite(e)?e:null;const t=e.includes("±")?e.split("±")[0].trim():e.trim(),r=parseFloat(t);return Number.isFinite(r)?r:null}const Ge=[{label:"All",maxParametersExclusive:void 0},{label:"<10M",maxParametersExclusive:1e7},{label:"<100M",maxParametersExclusive:1e8},{label:"<1B",maxParametersExclusive:1e9},{label:"<3B",maxParametersExclusive:3e9},{label:"<6B",maxParametersExclusive:6e9},{label:"<12B",maxParametersExclusive:12e9},{label:"<32B",maxParametersExclusive:32e9},{label:"<128B",maxParametersExclusive:128e9},{label:"<500B",maxParametersExclusive:5e11}];function St(e){const t=e===null?void 0:Number(e);return Ge.some(r=>r.maxParametersExclusive===t)?t:void 0}function kt(e){return new Intl.NumberFormat("en",{notation:"compact",maximumSignificantDigits:3}).format(e)}function Ct(e){return[e.paper_id,e.task_id,e.dataset_id,e.model_name,e.harness??""].join("|")}function Et(e){const t=new Map;for(const r of e){const s=Ct(r),n=t.get(s);if(!n){t.set(s,{...r,metrics:{...r.metrics||{}},sourceEvaluationIds:[r.id],ranksByMetric:r.best_metric&&r.best_rank!=null?{[r.best_metric]:r.best_rank}:{},parameterCount:r.num_parameters??null,hasParameterConflict:!1});continue}n.metrics={...n.metrics,...r.metrics||{}},n.sourceEvaluationIds.push(r.id),r.best_metric&&r.best_rank!=null&&(n.ranksByMetric[r.best_metric]=r.best_rank),r.num_parameters!=null&&!n.hasParameterConflict&&(n.parameterCount===null?n.parameterCount=r.num_parameters:n.parameterCount!==r.num_parameters&&(n.parameterCount=null,n.hasParameterConflict=!0))}return Array.from(t.values())}function Le(e,t){return t===void 0?e:e.filter(r=>r.parameterCount!==null&&r.parameterCounts+n,0);for(const[s,n]of t)if(n>=2&&n*2>r)return s;return null}function $t(e,t){const r=e.evaluated_on;return r&&r!==t&&r!==Rt(e.updated_at)?r:e.paper_published_date||""}function Mt(e,t,r){if(e.length===0)return{points:[],sota:0,sotaModel:""};const s=Pt(e),n=e.map(u=>{var R;const h=ie((R=u.metrics)==null?void 0:R[t]);return{eval:u,value:h,date:$t(u,s)}}).filter(u=>u.value!==null&&!!u.date).sort((u,h)=>u.date.localeCompare(h.date)),i=[];let l=null;for(const u of n){const h=l==null?!0:r==="↓"?u.valuel;h&&(l=u.value),i.push({value:u.value,date:u.date,dateLabel:u.date.slice(0,7),modelName:u.eval.model_name||"",paperTitle:u.eval.paper_title||"",paperRouteId:u.eval.paper_arxiv_id||u.eval.paper_id||null,isSota:h})}const d=e.map(u=>{var h;return{eval:u,value:ie((h=u.metrics)==null?void 0:h[t])}}).filter(u=>u.value!==null).sort((u,h)=>r==="↓"?u.value-h.value:h.value-u.value)[0],f=(d==null?void 0:d.value)??0,x=(d==null?void 0:d.eval.model_name)||(d==null?void 0:d.eval.paper_title)||"";return{points:i,sota:f,sotaModel:x}}function Qe(e,t,r,s){const n=t.find(i=>i.id===s);if(e.length===0)return null;if(n!=null&&n.task_id&&e.some(i=>i.id===n.task_id))return n.task_id;if(r){const i=e.find(l=>l.slug===r);if(i)return i.id}if(e.length===1)return e[0].id;if(t.length>0){const i=new Map;for(const d of t)i.set(d.task_id,(i.get(d.task_id)||0)+1);let l=null,o=-1;for(const d of e){const f=i.get(d.id)||0;f>o&&(o=f,l=d.id)}if(l)return l}return e[0].id}function Tt(e){var _,X,Y;const{evaluations:t,tasks:r,taskSlug:s,highlightEvalId:n,parameterBound:i,showMoreMetrics:l,fittingMetricCount:o=1}=e,d=Qe(r,t,s,n),f=r.find(c=>c.id===d)||r[0]||null,x=t.find(c=>c.id===n),u=_t(t,d,e.hideClosed),h=Et(u.visible),R=Le(h,i),C=e.configuredMetrics.map(c=>c.metric_name),P=Array.from(new Set(h.flatMap(c=>[...c.best_metric?[c.best_metric]:[],...Object.keys(c.metrics||{})]))),S=C.length?C:P,g=new Map;for(const c of h){const m=c.best_metric;!m||ie(c.metrics[m])===null||C.length&&!S.includes(m)||g.set(m,(g.get(m)||0)+1)}const k=((_=[...g].sort((c,m)=>m[1]-c[1])[0])==null?void 0:_[0])||S[0]||"",j=S.find(c=>{var m;return c.toLocaleLowerCase()===((m=e.metric)==null?void 0:m.trim().toLocaleLowerCase())})||(x==null?void 0:x.best_metric)||k,D=((X=e.directions)==null?void 0:X.directions[j])==="lower_is_better"?"↓":"↑",W=j&&S.includes(j)?[j,...S.filter(c=>c!==j)]:S,w=W.length?l?W:W.slice(0,Math.max(1,o)):j?[j]:[],U=R.slice().sort((c,m)=>{const p=ie(c.metrics[j]),y=ie(m.metrics[j]);return p!==null&&y!==null?D==="↓"?p-y:y-p:p!==null?-1:y!==null?1:Ie(c,j)-Ie(m,j)});let I=null,N=0;const Q=U.map((c,m)=>{const p=ie(c.metrics[j]);return p!==null&&p!==I&&(I=p,N=m+1),{evaluation:c,rank:p===null?null:N,isHighlighted:Nt(c,n)}}),{points:z,sota:ee,sotaModel:O}=Mt(R,j,D),M=i===void 0?e.initialSummary:void 0,q=e.ready.evaluations&&e.ready.tasks&&e.ready.directions&&(!d||e.ready.metrics),K={parameter_coverage_known:h.filter(c=>c.parameterCount!==null).length,parameter_coverage_total:h.length};return{currentTaskId:d,primaryTask:f,activeMetric:j,arrow:D,allowedMetrics:S,orderedMetrics:W,visibleMetrics:w,rows:Q,chartPoints:z,highlightedEval:((Y=Q.find(c=>c.isHighlighted))==null?void 0:Y.evaluation)||null,hiddenClosedEvals:u.hiddenClosed,hiddenClosedTopEval:u.topHiddenClosed,parameterBound:i,parameterCoverage:K,hasParameterMetadata:K.parameter_coverage_known>0,parameterFilters:Ge.map(c=>({...c,selected:i===c.maxParametersExclusive,disabled:i!==c.maxParametersExclusive&&Le(h,c.maxParametersExclusive).length===0})),displayedMetric:q?j:M==null?void 0:M.metric,displayedSota:q?ee:M==null?void 0:M.value,displayedSotaModel:q?O:M==null?void 0:M.model_name,isSummaryLoading:!q&&!M,isInitialFilteredViewLoading:i!==void 0&&!q}}function Ft(e,t,r,s=1,n=0){const i=e-t.fixed-(r?t.harness:0);if(t.metric<=0)return 1;const l=Math.floor(i/t.metric);if(lr+he(t,s),0),harness:he(t,"--bm-harness-width"),metric:he(t,"--bm-metric-width")}}const It=20;function Ae(e,t){return e?a.jsx(ce,{title:e}):t||"—"}function At({model:e,showHarness:t,setMetric:r,highlightRowRef:s,onFittingMetricCountChange:n}){const{rows:i,visibleMetrics:l,activeMetric:o,arrow:d}=e,[f,x]=L.useState(null);return L.useEffect(()=>{if(!f)return;const u=()=>{f.classList.toggle("has-horizontal-overflow",f.scrollWidth>f.clientWidth);const R=f.firstElementChild;if(!R)return;const C=f.clientWidth,P=Lt(R);f.classList.toggle("unpins-trailing-columns",CS.clientHeight?0:It;n(k=>Ft(C,P,t,k,g))},h=new ResizeObserver(u);return h.observe(f),f.firstElementChild&&h.observe(f.firstElementChild),u(),()=>h.disconnect()},[f,t,n]),a.jsx("div",{ref:x,className:"bm-table-scroll",role:"region","aria-label":"Leaderboard metrics",tabIndex:0,children:a.jsxs("table",{id:"benchmark-leaderboard",className:"bm-table",style:{"--bm-metric-count":l.length,"--bm-harness-count":t?1:0},children:[a.jsxs("colgroup",{children:[a.jsx("col",{className:"bm-width-rank"}),a.jsx("col",{className:"bm-width-model"}),a.jsx("col",{className:"bm-width-parameters"}),t&&a.jsx("col",{className:"bm-width-harness"}),l.map(u=>a.jsx("col",{className:"bm-width-metric"},u)),a.jsx("col",{}),a.jsx("col",{className:"bm-width-year"})]}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{className:"col-rank",children:"Rank"}),a.jsx("th",{className:"col-model",children:"Model"}),a.jsxs("th",{className:"col-parameters",children:[a.jsx("span",{className:"bm-label-full",children:"Parameters"}),a.jsx("span",{className:"bm-label-short",children:"Params"})]}),t&&a.jsx("th",{className:"col-harness",children:"Harness"}),l.map(u=>{const h=u===o;return a.jsx("th",{className:`col-value ${h?"is-active":""}`,"aria-sort":h?d==="↓"?"ascending":"descending":"none",children:a.jsxs("button",{type:"button",className:"bm-metric-header",onClick:()=>r(u),"aria-pressed":h,title:`Sort by ${u}`,children:[u,h?` ${d}`:""]})},u)}),a.jsx("th",{className:"col-paper",children:"Paper"}),a.jsx("th",{className:"col-year",children:"Year"})]})}),a.jsx("tbody",{children:i.map(({evaluation:u,rank:h,isHighlighted:R})=>{var S;const C=u.paper_arxiv_id||u.paper_id,P=u.paper_title||(u.paper_arxiv_id?`arXiv:${u.paper_arxiv_id}`:null);return a.jsxs("tr",{ref:R?s:void 0,className:R?"is-highlighted":void 0,children:[a.jsx("td",{className:"col-rank",children:h??"—"}),a.jsxs("td",{className:"col-model",children:[R&&a.jsx("span",{className:"bm-row-marker","aria-hidden":"true"}),u.hf_model_url?a.jsx("a",{href:u.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"bm-model-link",title:`Open ${u.model_name||"model"} on Hugging Face`,children:u.model_name||"—"}):u.model_name||"—",u.is_open===!1&&a.jsx(ft,{}),(u.external??u.is_external)&&a.jsx(pt,{sourceUrl:u.source_url||u.external_source_url||u.result_url})]}),a.jsx("td",{className:"col-parameters",title:u.parameterCount===null?void 0:u.parameterCount.toLocaleString("en-US"),"aria-label":u.parameterCount===null?"Parameters unknown":`${u.parameterCount.toLocaleString("en-US")} parameters`,children:u.parameterCount===null?"—":kt(u.parameterCount)}),t&&a.jsx("td",{className:"col-harness",children:u.harness||"—"}),l.map(g=>{var j;const k=g===o,B=(j=u.metrics)==null?void 0:j[g];return a.jsx("td",{className:`col-value${k?" is-active":""}${k&&h===1?" is-best":""}`,children:B!=null&&B!==""?le(B):"—"},g)}),a.jsx("td",{className:"col-paper",children:C?a.jsx(ne,{to:`/paper/${C}`,title:u.paper_title||P||void 0,children:Ae(u.paper_title,P)}):Ae(u.paper_title,P)}),a.jsx("td",{className:"col-year",children:((S=u.evaluated_on||u.paper_published_date)==null?void 0:S.slice(0,4))||"—"})]},u.id)})})]})})}function Be(e){const t=e.length===7?`${e}-01`:e,r=new Date(t).getTime();return Number.isFinite(r)?r:0}const fe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function pe(e){const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()}}function Bt(e,t){if(e===t){const{year:d,month:f}=pe(e);return[{timestamp:new Date(d,f,1).getTime(),key:`${d}-${f}`,label:`${fe[f]} ${d}`}]}const r=pe(e),s=pe(t);if(r.year===s.year){const d=s.month-r.month+1;let f=1;const x=12;d>x&&(f=Math.ceil(d/x));const u=[];for(let h=r.month;h<=s.month;h+=f)u.push({timestamp:new Date(r.year,h,1).getTime(),key:`${r.year}-${h}`,label:d<=3?`${fe[h]} ${r.year}`:fe[h]});return u}const n=s.year-r.year+1;let i=1;const l=12;n>l&&(i=Math.ceil(n/l));const o=[];for(let d=r.year;d<=s.year;d+=i)o.push({timestamp:new Date(d,0,1).getTime(),key:String(d),label:String(d)});return o}const Dt=({points:e,metric:t})=>{const r=ct(),[s,n]=L.useState(null),i=880,l=320,o=60,d=30,f=40,x=50,u=e.map(c=>c.value),h=Math.min(...u),C=Math.max(...u)-h||1,P=i-o-d,S=l-f-x,g=e.map(c=>Be(c.date)),k=Math.min(...g),B=Math.max(...g),j=B-k||1,D=c=>k===B?o+P/2:o+(c-k)/j*P,W=e.map((c,m)=>{const p=D(Be(c.date)),y=(c.value-h)/C,$=f+S*(1-y);return{x:p,y:$,data:c,idx:m}}),w=W.filter(c=>c.data.isSota);let U="";if(w.length>=2){U=`M${w[0].x},${w[0].y}`;for(let c=1;c{const m=c.data.modelName||c.data.paperTitle||"";if(!m)return null;const p=m.length>22?m.slice(0,21)+"…":m,y=p.length*I;let $=c.x-y/2,E=c.x+y/2,v="middle";return $i-d&&(E=i-d,$=E-y,v="end"),{x:v==="start"?o:v==="end"?i-d:c.x,y:c.y-Q,text:p,anchor:v,left:$,right:E}},ee=[],O=w.length>0?z(w[w.length-1]):null;let M=-1/0;for(let c=0;cO.left-N||(M=m.right,ee.push({x:m.x,y:m.y,text:m.text,anchor:m.anchor})))}O&&ee.push({x:O.x,y:O.y,text:O.text,anchor:O.anchor});const q=Bt(k,B),K=5,_=c=>n(m=>m===c?null:m),X=c=>{c&&r(`/paper/${c}`)},Y=(c,m)=>{const y=`${c.data.modelName||c.data.paperTitle||"Unknown model"}: ${le(c.data.value)} on ${c.data.dateLabel}`,$=!!c.data.paperRouteId;return a.jsxs("g",{children:[m,a.jsx("circle",{cx:c.x,cy:c.y,r:"10",fill:"transparent",style:{cursor:$?"pointer":"default",outline:"none"},tabIndex:0,role:$?"link":"img","aria-label":y,onMouseEnter:()=>n(c.idx),onMouseLeave:()=>_(c.idx),onFocus:()=>n(c.idx),onBlur:()=>_(c.idx),onClick:()=>X(c.data.paperRouteId),onKeyDown:E=>{$&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),X(c.data.paperRouteId))},children:a.jsx("title",{children:y})})]},c.idx)};return a.jsxs("svg",{width:"100%",viewBox:`0 0 ${i} ${l}`,style:{display:"block"},children:[a.jsx("text",{x:o-38,y:f+S/2,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"middle",transform:`rotate(-90 ${o-38} ${f+S/2})`,children:t}),Array.from({length:K}).map((c,m)=>{const p=m/(K-1),y=f+S*(1-p),$=h+C*p;return a.jsxs("g",{children:[a.jsx("line",{x1:o,y1:y,x2:i-d,y2:y,stroke:"var(--hairline)",strokeWidth:"1"}),a.jsx("text",{x:o-10,y:y+4,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-faint)",textAnchor:"end",children:le($)})]},m)}),q.map(c=>{const m=D(c.timestamp);return a.jsx("text",{x:m,y:l-x+18,fontSize:"11",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:"middle",children:c.label},c.key)}),W.filter(c=>!c.data.isSota).map(c=>{const m=s===c.idx;return Y(c,a.jsx("circle",{cx:c.x,cy:c.y,r:m?3:2,fill:"var(--ink-faint)",opacity:m?1:.45,style:{transition:"r 0.12s ease, opacity 0.12s ease"}}))}),U&&a.jsx("path",{d:U,stroke:"var(--accent)",strokeWidth:"2",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),w.map(c=>{const m=s===c.idx;return Y(c,a.jsx("circle",{cx:c.x,cy:c.y,r:m?4.5:3,fill:m?"var(--accent)":"var(--bg-elevated)",stroke:"var(--accent)",strokeWidth:"1.5",style:{transition:"r 0.12s ease, fill 0.12s ease"}}))}),ee.map((c,m)=>a.jsx("text",{x:c.x,y:c.y,fontSize:"9.5",fontFamily:"var(--mono)",fill:"var(--ink-soft)",textAnchor:c.anchor,pointerEvents:"none",style:{paintOrder:"stroke",stroke:"var(--bg-elevated)",strokeWidth:3,strokeLinejoin:"round"},children:c.text},`label-${m}`)),s!==null&&W[s]&&(()=>{const c=W[s],m=c.data.modelName||c.data.paperTitle||"Unknown model",y=`${m.length>40?m.slice(0,39)+"…":m}: ${le(c.data.value)}`,E=Math.max(120,Math.min(340,y.length*6.6+24)),v=30;let H=c.x-E/2;Hi-d&&(H=i-d-E);const G=c.y-v-14>=f?c.y-v-12:c.y+12;return a.jsxs("g",{pointerEvents:"none",children:[a.jsx("rect",{x:H,y:G,width:E,height:v,rx:"6",ry:"6",fill:"var(--bg-elevated)",stroke:"var(--hairline-strong)",strokeWidth:"1",style:{filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.08))"}}),a.jsx("text",{x:H+12,y:G+19,fontSize:"12",fontFamily:"var(--sans)",fill:"var(--ink)",fontWeight:500,children:y})]})})()]})};function Ht(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),s=r.createElement("base"),n=r.createElement("a");return r.head.appendChild(s),r.body.appendChild(n),t&&(s.href=t),n.href=e,n.href}const Vt=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function Z(e){const t=[];for(let r=0,s=e.length;rV||e.height>V)&&(e.width>V&&e.height>V?e.width>e.height?(e.height*=V/e.width,e.width=V):(e.width*=V/e.height,e.height=V):e.width>V?(e.height*=V/e.width,e.width=V):(e.width*=V/e.height,e.height=V))}function zt(e,t={}){return e.toBlob?new Promise(r=>{e.toBlob(r,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(r=>{const s=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),n=s.length,i=new Uint8Array(n);for(let l=0;l{const s=new Image;s.onload=()=>{s.decode().then(()=>{requestAnimationFrame(()=>t(s))})},s.onerror=r,s.crossOrigin="anonymous",s.decoding="async",s.src=e})}async function Kt(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Gt(e,t,r){const s="http://www.w3.org/2000/svg",n=document.createElementNS(s,"svg"),i=document.createElementNS(s,"foreignObject");return n.setAttribute("width",`${t}`),n.setAttribute("height",`${r}`),n.setAttribute("viewBox",`0 0 ${t} ${r}`),i.setAttribute("width","100%"),i.setAttribute("height","100%"),i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("externalResourcesRequired","true"),n.appendChild(i),i.appendChild(e),Kt(n)}const A=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||A(r,t)};function Qt(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Xt(e,t){return Xe(t).map(r=>{const s=e.getPropertyValue(r),n=e.getPropertyPriority(r);return`${r}: ${s}${n?" !important":""};`}).join(" ")}function Yt(e,t,r,s){const n=`.${e}:${t}`,i=r.cssText?Qt(r):Xt(r,s);return document.createTextNode(`${n}{${i}}`)}function De(e,t,r,s){const n=window.getComputedStyle(e,r),i=n.getPropertyValue("content");if(i===""||i==="none")return;const l=Vt();try{t.className=`${t.className} ${l}`}catch{return}const o=document.createElement("style");o.appendChild(Yt(l,r,n,s)),t.appendChild(o)}function Jt(e,t,r){De(e,t,":before",r),De(e,t,":after",r)}const He="application/font-woff",Ve="image/jpeg",Zt={woff:He,woff2:He,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Ve,jpeg:Ve,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function er(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function ye(e){const t=er(e).toLowerCase();return Zt[t]||""}function tr(e){return e.split(/,/)[1]}function xe(e){return e.search(/^(data:)/)!==-1}function rr(e,t){return`data:${t};base64,${e}`}async function Je(e,t,r){const s=await fetch(e,t);if(s.status===404)throw new Error(`Resource "${s.url}" not found`);const n=await s.blob();return new Promise((i,l)=>{const o=new FileReader;o.onerror=l,o.onloadend=()=>{try{i(r({res:s,result:o.result}))}catch(d){l(d)}},o.readAsDataURL(n)})}const ge={};function ar(e,t,r){let s=e.replace(/\?.*/,"");return r&&(s=e),/ttf|otf|eot|woff2?/i.test(s)&&(s=s.replace(/.*\//,"")),t?`[${t}]${s}`:s}async function we(e,t,r){const s=ar(e,t,r.includeQueryParams);if(ge[s]!=null)return ge[s];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let n;try{const i=await Je(e,r.fetchRequestInit,({res:l,result:o})=>(t||(t=l.headers.get("Content-Type")||""),tr(o)));n=rr(i,t)}catch(i){n=r.imagePlaceholder||"";let l=`Failed to fetch resource: ${e}`;i&&(l=typeof i=="string"?i:i.message),l&&console.warn(l)}return ge[s]=n,n}async function sr(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):ue(t)}async function nr(e,t){if(e.currentSrc){const i=document.createElement("canvas"),l=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,l==null||l.drawImage(e,0,0,i.width,i.height);const o=i.toDataURL();return ue(o)}const r=e.poster,s=ye(r),n=await we(r,s,t);return ue(n)}async function ir(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await me(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function lr(e,t){return A(e,HTMLCanvasElement)?sr(e):A(e,HTMLVideoElement)?nr(e,t):A(e,HTMLIFrameElement)?ir(e,t):e.cloneNode(Ze(e))}const cr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Ze=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function or(e,t,r){var s,n;if(Ze(t))return t;let i=[];return cr(e)&&e.assignedNodes?i=Z(e.assignedNodes()):A(e,HTMLIFrameElement)&&(!((s=e.contentDocument)===null||s===void 0)&&s.body)?i=Z(e.contentDocument.body.childNodes):i=Z(((n=e.shadowRoot)!==null&&n!==void 0?n:e).childNodes),i.length===0||A(e,HTMLVideoElement)||await i.reduce((l,o)=>l.then(()=>me(o,r)).then(d=>{d&&t.appendChild(d)}),Promise.resolve()),t}function dr(e,t,r){const s=t.style;if(!s)return;const n=window.getComputedStyle(e);n.cssText?(s.cssText=n.cssText,s.transformOrigin=n.transformOrigin):Xe(r).forEach(i=>{let l=n.getPropertyValue(i);i==="font-size"&&l.endsWith("px")&&(l=`${Math.floor(parseFloat(l.substring(0,l.length-2)))-.1}px`),A(e,HTMLIFrameElement)&&i==="display"&&l==="inline"&&(l="block"),i==="d"&&t.getAttribute("d")&&(l=`path(${t.getAttribute("d")})`),s.setProperty(i,l,n.getPropertyPriority(i))})}function ur(e,t){A(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),A(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function mr(e,t){if(A(e,HTMLSelectElement)){const r=t,s=Array.from(r.children).find(n=>e.value===n.getAttribute("value"));s&&s.setAttribute("selected","")}}function hr(e,t,r){return A(t,Element)&&(dr(e,t,r),Jt(e,t,r),ur(e,t),mr(e,t)),t}async function fr(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let i=0;ilr(s,t)).then(s=>or(e,s,t)).then(s=>hr(e,s,t)).then(s=>fr(s,t))}const et=/url\((['"]?)([^'"]+?)\1\)/g,pr=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,gr=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function xr(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function br(e){const t=[];return e.replace(et,(r,s,n)=>(t.push(n),r)),t.filter(r=>!xe(r))}async function yr(e,t,r,s,n){try{const i=r?Ht(t,r):t,l=ye(t);let o;return n||(o=await we(i,l,s)),e.replace(xr(t),`$1${o}$3`)}catch{}return e}function wr(e,{preferredFontFormat:t}){return t?e.replace(gr,r=>{for(;;){const[s,,n]=pr.exec(r)||[];if(!n)return"";if(n===t)return`src: ${s};`}}):e}function tt(e){return e.search(et)!==-1}async function rt(e,t,r){if(!tt(e))return e;const s=wr(e,r);return br(s).reduce((i,l)=>i.then(o=>yr(o,l,t,r)),Promise.resolve(s))}async function se(e,t,r){var s;const n=(s=t.style)===null||s===void 0?void 0:s.getPropertyValue(e);if(n){const i=await rt(n,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function vr(e,t){await se("background",e,t)||await se("background-image",e,t),await se("mask",e,t)||await se("-webkit-mask",e,t)||await se("mask-image",e,t)||await se("-webkit-mask-image",e,t)}async function jr(e,t){const r=A(e,HTMLImageElement);if(!(r&&!xe(e.src))&&!(A(e,SVGImageElement)&&!xe(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,n=await we(s,ye(s),t);await new Promise((i,l)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...d)=>{try{i(t.onImageErrorHandler(...d))}catch(f){l(f)}}:l;const o=e;o.decode&&(o.decode=i),o.loading==="lazy"&&(o.loading="eager"),r?(e.srcset="",e.src=n):e.href.baseVal=n})}async function _r(e,t){const s=Z(e.childNodes).map(n=>at(n,t));await Promise.all(s).then(()=>e)}async function at(e,t){A(e,Element)&&(await vr(e,t),await jr(e,t),await _r(e,t))}function Sr(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const s=t.style;return s!=null&&Object.keys(s).forEach(n=>{r[n]=s[n]}),e}const We={};async function Oe(e){let t=We[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},We[e]=t,t}async function qe(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async l=>{let o=l.replace(s,"$1");return o.startsWith("https://")||(o=new URL(o,e.url).href),Je(o,t.fetchRequestInit,({result:d})=>(r=r.replace(l,`url(${d})`),[l,d]))});return Promise.all(i).then(()=>r)}function Ue(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let s=e.replace(r,"");const n=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const d=n.exec(s);if(d===null)break;t.push(d[0])}s=s.replace(n,"");const i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,l="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",o=new RegExp(l,"gi");for(;;){let d=i.exec(s);if(d===null){if(d=o.exec(s),d===null)break;i.lastIndex=o.lastIndex}else o.lastIndex=i.lastIndex;t.push(d[0])}return t}async function kr(e,t){const r=[],s=[];return e.forEach(n=>{if("cssRules"in n)try{Z(n.cssRules||[]).forEach((i,l)=>{if(i.type===CSSRule.IMPORT_RULE){let o=l+1;const d=i.href,f=Oe(d).then(x=>qe(x,t)).then(x=>Ue(x).forEach(u=>{try{n.insertRule(u,u.startsWith("@import")?o+=1:n.cssRules.length)}catch(h){console.error("Error inserting rule from remote css",{rule:u,error:h})}})).catch(x=>{console.error("Error loading remote css",x.toString())});s.push(f)}})}catch(i){const l=e.find(o=>o.href==null)||document.styleSheets[0];n.href!=null&&s.push(Oe(n.href).then(o=>qe(o,t)).then(o=>Ue(o).forEach(d=>{l.insertRule(d,l.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",i)}}),Promise.all(s).then(()=>(e.forEach(n=>{if("cssRules"in n)try{Z(n.cssRules||[]).forEach(i=>{r.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${n.href}`,i)}}),r))}function Cr(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>tt(t.style.getPropertyValue("src")))}async function Er(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=Z(e.ownerDocument.styleSheets),s=await kr(r,t);return Cr(s)}function st(e){return e.trim().replace(/["']/g,"")}function Nr(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(i=>{t.add(st(i))}),Array.from(s.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function Rr(e,t){const r=await Er(e,t),s=Nr(e);return(await Promise.all(r.filter(i=>s.has(st(i.style.fontFamily))).map(i=>{const l=i.parentStyleSheet?i.parentStyleSheet.href:null;return rt(i.cssText,l,t)}))).join(` `)}async function Pr(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Rr(e,t);if(r){const s=document.createElement("style"),n=document.createTextNode(r);s.appendChild(n),e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}}async function $r(e,t={}){const{width:r,height:s}=Ye(e,t),n=await me(e,t,!0);return await Pr(n,t),await at(n,t),Sr(n,t),await Gt(n,r,s)}async function Mr(e,t={}){const{width:r,height:s}=Ye(e,t),n=await $r(e,t),i=await ue(n),l=document.createElement("canvas"),o=l.getContext("2d"),d=t.pixelRatio||qt(),f=t.canvasWidth||r,x=t.canvasHeight||s;return l.width=f*d,l.height=x*d,t.skipAutoScale||Ut(l),l.style.width=`${f}`,l.style.height=`${x}`,t.backgroundColor&&(o.fillStyle=t.backgroundColor,o.fillRect(0,0,l.width,l.height)),o.drawImage(i,0,0,l.width,l.height),l}async function Tr(e,t={}){const r=await Mr(e,t);return await zt(r)}const be="#ffffff";function Fr(){return typeof window>"u"?be:window.getComputedStyle(document.documentElement).getPropertyValue("--bg-elevated").trim()||be}function Lr(e){if(typeof window>"u")return be;const t=window.getComputedStyle(e).backgroundColor;return!t||t==="rgba(0, 0, 0, 0)"||t==="transparent"?Fr():t}async function Ir(e){var r,s;if(typeof window>"u"||!((s=(r=window.navigator)==null?void 0:r.clipboard)!=null&&s.write))throw new Error("Clipboard image copy is not supported in this browser.");if(typeof window.ClipboardItem>"u")throw new Error("Clipboard image copy is not supported in this browser.");const t=await Tr(e,{pixelRatio:2,cacheBust:!0,backgroundColor:Lr(e)});if(!t)throw new Error("Failed to render screenshot.");await window.navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])}const nt=({targetRef:e,label:t})=>{const{toast:r}=ot(),[s,n]=L.useState("idle"),i=L.useRef(null);L.useEffect(()=>()=>{i.current!==null&&window.clearTimeout(i.current)},[]);const l=L.useCallback(async()=>{const d=e.current;if(d){n("copying"),d.classList.add("is-capturing"),d.offsetHeight,await new Promise(f=>window.requestAnimationFrame(()=>f()));try{await Ir(d),n("copied"),r({title:"Screenshot copied",description:`Image of the ${t} copied to your clipboard.`}),i.current!==null&&window.clearTimeout(i.current),i.current=window.setTimeout(()=>n("idle"),1500)}catch(f){n("idle"),r({title:"Copy failed",description:f instanceof Error&&f.message?f.message:"Could not copy the screenshot to your clipboard.",variant:"destructive"})}finally{d.classList.remove("is-capturing")}}},[e,t,r]),o=s==="copied"?"Copied":s==="copying"?"Copying…":"Copy image";return a.jsxs("button",{type:"button",className:"bm-copy-btn",onClick:l,disabled:s==="copying","aria-label":`Copy ${t} screenshot to clipboard`,title:`Copy ${t} screenshot to clipboard`,children:[a.jsx(xt,{name:"copy",size:11}),o]})};function Ar({model:e,datasetName:t,hideClosed:r,setHideClosed:s,setMetric:n}){const i=L.useRef(null),{isInitialFilteredViewLoading:l,chartPoints:o,activeMetric:d,allowedMetrics:f,orderedMetrics:x,parameterBound:u}=e;return l||o.length===0?null:a.jsxs("div",{className:"bm-card",ref:i,children:[a.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[a.jsxs("div",{className:"bm-card-screenshot-title",children:[a.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),a.jsx("span",{className:"bm-card-screenshot-name",children:t})]}),a.jsxs("div",{className:"bm-card-screenshot-brand",children:[a.jsxs("span",{className:"brand",children:[a.jsx("span",{className:"brand-mark"}),a.jsxs("span",{className:"brand-name",children:["Papers ",a.jsx("em",{children:"With Code"})]})]}),a.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),a.jsxs("div",{className:"bm-card-head",children:[a.jsx("div",{className:"bm-card-title",children:"SOTA progression"}),a.jsxs("div",{className:"bm-card-actions",children:[f.length>1&&a.jsxs("label",{className:"bm-view-select",children:[a.jsx("span",{className:"bm-view-select-label",children:"View"}),a.jsx("select",{value:d,onChange:h=>n(h.target.value),children:x.map(h=>a.jsx("option",{value:h,children:h},h))})]}),a.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[a.jsx(Ke,{className:"bm-closed-toggle-switch",checked:!r,onCheckedChange:h=>{s(!h)},"aria-label":"Show closed-source models"}),a.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),a.jsx(nt,{targetRef:i,label:"SOTA chart"})]})]}),a.jsx("div",{className:"bm-chart-wrap",children:a.jsx(Dt,{points:o,metric:d})}),a.jsxs("div",{className:"bm-chart-foot",children:[a.jsx("span",{className:"legend-dot"}),u===void 0?"All models":"Filtered models"," over time · highlighted dots track the running best · hover for the model · click to open the paper"]})]})}function Br(e){if(!e)return null;const t=e.trim(),r=t.match(/^https?:\/\/(?:www\.)?arxiv\.org\/(?:abs|pdf)\/([^/?#]+)/i);if(r!=null&&r[1])return r[1].replace(/\.pdf$/i,"");const s=t.match(/^(?:https?:\/\/(?:www\.)?paperswithcode\.co)?\/paper\/([^/?#]+)/i);return(s==null?void 0:s[1])??null}function ze(e,t){return e?a.jsx(ce,{title:e}):t||"—"}const ia=()=>{var ve,je,_e,Se,ke,Ce,Ee,Ne,Re,Pe,$e;const{datasetSlug:e}=dt(),[t,r]=ut(),s=t.get("task")||void 0,n=t.get("eval")||void 0,i=St(t.get("max_parameters_exclusive")),{preferences:l,setHideClosedSourceEvals:o}=mt(),d=L.useRef(null),f=L.useRef(!1),x=L.useRef(null),[u,h]=L.useState(null),R=`${e}:${s||""}`,C=u===R,[P,S]=L.useState(1),g=te({queryKey:["dataset",e,"with-paper",s,l.hide_closed_source_evals?"open":"all"],queryFn:()=>re.getDatasetBySlug(e,{include_paper:!0,task:s,is_open:l.hide_closed_source_evals?!0:void 0}),enabled:!!e,staleTime:10*60*1e3}),k=te({queryKey:["dataset-evals",(ve=g.data)==null?void 0:ve.id],queryFn:()=>gt.byDataset(g.data.id),enabled:!!((je=g.data)!=null&&je.id),staleTime:5*60*1e3}),B=te({queryKey:["dataset-tasks",(_e=g.data)==null?void 0:_e.id],queryFn:()=>re.datasetTasks(g.data.id),enabled:!!((Se=g.data)!=null&&Se.id),staleTime:10*60*1e3}),j=te({queryKey:["metric-directions"],queryFn:()=>re.metricDirections(),staleTime:60*60*1e3}),D=Qe(B.data||[],k.data||[],s,n),W=te({queryKey:["task-benchmark-trends",D,l.hide_closed_source_evals?!0:void 0],queryFn:()=>re.trendingBenchmarks(D,{limit:100,min_recent_papers:0,is_open:l.hide_closed_source_evals?!0:void 0}),enabled:!!D&&!!((ke=g.data)!=null&&ke.id),staleTime:10*60*1e3}),w=L.useMemo(()=>{var b;return(((b=W.data)==null?void 0:b.results)||[]).find(T=>{var F;return T.id===((F=g.data)==null?void 0:F.id)})||null},[W.data,(Ce=g.data)==null?void 0:Ce.id]),U=te({queryKey:["leaderboard-metrics",(Ee=g.data)==null?void 0:Ee.id,D],queryFn:()=>re.leaderboardMetrics(g.data.id,D),enabled:!!((Ne=g.data)!=null&&Ne.id)&&!!D,staleTime:10*60*1e3}),I=Tt({evaluations:k.data||[],tasks:B.data||[],configuredMetrics:U.data||[],directions:j.data,initialSummary:(Re=g.data)==null?void 0:Re.leaderboard_summary,taskSlug:s,highlightEvalId:n,metric:t.get("metric")||void 0,hideClosed:l.hide_closed_source_evals,parameterBound:i,showMoreMetrics:C,fittingMetricCount:P,ready:{evaluations:k.isSuccess,tasks:B.isSuccess,directions:j.isSuccess,metrics:U.isSuccess}}),{primaryTask:N,hiddenClosedEvals:Q,hiddenClosedTopEval:z,isSummaryLoading:ee,displayedMetric:O,displayedSota:M,displayedSotaModel:q,isInitialFilteredViewLoading:K,highlightedEval:_,hasParameterMetadata:X,parameterCoverage:Y,orderedMetrics:c}=I;L.useEffect(()=>{if(f.current||!n||!k.data||k.data.length===0)return;const b=d.current;b&&(f.current=!0,b.scrollIntoView({behavior:"smooth",block:"start"}))},[n,k.data]);const m=te({queryKey:["area",N==null?void 0:N.area_id],queryFn:()=>re.getArea(N.area_id),enabled:!!(N!=null&&N.area_id),staleTime:10*60*1e3});if(g.isLoading)return a.jsxs("div",{className:"page",children:[a.jsx(oe,{className:"h-12 w-1/2 mb-6"}),a.jsx(oe,{className:"h-64 w-full"})]});if(g.error||!g.data)return a.jsx("div",{className:"page",children:a.jsx(bt,{variant:"destructive",children:a.jsx(yt,{children:"Benchmark not found."})})});const p=g.data,y=!!p.supports_harness,$=b=>{r(T=>{const F=new URLSearchParams(T);return b===void 0?F.delete("max_parameters_exclusive"):F.set("max_parameters_exclusive",String(b)),F})},E=b=>{r(T=>{const F=new URLSearchParams(T);return F.set("metric",b),F})},v=p.introducing_paper??void 0,H=(v==null?void 0:v.arxiv_id)||(v==null?void 0:v.id)||Br(p.paper_url),J=(v==null?void 0:v.title)||p.introducing_paper_title||null,G=((Pe=v==null?void 0:v.published)==null?void 0:Pe.slice(0,4))||p.introduced_year||null,it=!!H||!!p.paper_url||!!J,lt=v!=null&&v.arxiv_id||($e=p.paper_url)!=null&&$e.match(/^https?:\/\/(?:www\.)?arxiv\.org\//i)?`arXiv:${H}`:`Paper ${H}`;return a.jsx("div",{className:"page",children:a.jsxs("div",{className:"bm-page",children:[a.jsxs("div",{className:"breadcrumb",children:[a.jsx(ne,{to:"/tasks",children:"Tasks"}),m.data&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"sep",children:"/"}),a.jsx(ne,{to:`/tasks#area-${jt(m.data.name)}`,children:m.data.name})]}),N&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"sep",children:"/"}),a.jsx(ne,{to:`/tasks/${N.slug||N.id}`,children:N.name})]}),a.jsx("span",{className:"sep",children:"/"}),a.jsx("span",{style:{color:"var(--accent-text)"},children:p.name})]}),a.jsxs("div",{className:"bm-title-row",children:[a.jsx("h1",{className:"bm-title",children:p.name}),w&&a.jsxs("div",{className:"bm-title-trend","aria-label":`${p.name} reporting trend`,children:[a.jsx(wt,{history:w.history,benchmarkName:w.name}),a.jsxs("span",{className:"bm-title-trend-summary",children:[a.jsx("strong",{children:w.recent_paper_count})," ",w.recent_paper_count===1?"paper":"papers",w.rate_change==null?w.recent_paper_count>0&&a.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):a.jsxs("span",{className:`benchmark-trend-change ${w.rate_change>=1?"is-up":"is-down"}`,children:[w.rate_change>=1?"↑":"↓"," ",w.rate_change.toFixed(1),"×"]})]})]})]}),a.jsx(ht,{kind:"benchmark",entityId:p.id}),a.jsxs("div",{className:"bm-subtitle",children:[ee?a.jsx(oe,{className:"h-5 w-64 bm-summary-skeleton","aria-label":"Loading benchmark summary"}):a.jsxs("span",{children:[O&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"metric-tag",children:O}),a.jsx("span",{style:{color:"var(--hairline-strong)",margin:"0 8px"},children:"·"})]}),q?a.jsxs("span",{children:["Best: ",a.jsx("span",{className:"best-name",children:le(M)})," by ",a.jsx("span",{className:"best-name",style:{fontStyle:"normal"},children:q})]}):a.jsxs("span",{children:[I.rows.length," evaluations"]})]}),p.hf_url&&a.jsxs("a",{className:"bm-action-btn",href:p.hf_url,target:"_blank",rel:"noopener noreferrer",children:[a.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),p.description&&a.jsx("p",{className:"bm-description",children:p.description}),l.hide_closed_source_evals&&Q.length>0&&a.jsxs("div",{className:"bm-hidden-closed-notice",children:[a.jsxs("span",{children:[Q.length," closed-source ",Q.length===1?"row is":"rows are"," hidden",z!=null&&z.model_name?a.jsxs(a.Fragment,{children:[", including ",a.jsx("strong",{children:z.model_name})]}):null,"."]}),a.jsx("button",{type:"button",className:"bm-hidden-closed-action",onClick:()=>{o(!1)},children:"Show closed-source"})]}),it&&a.jsxs("div",{className:"method-source",style:{marginTop:0,marginBottom:18},children:[a.jsx("span",{className:"method-source-label",children:"Source"}),H?a.jsxs(ne,{to:`/paper/${H}`,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[a.jsx("span",{className:"method-source-title",children:J?a.jsx(ce,{title:J}):lt}),G&&a.jsx("span",{className:"method-source-meta",children:G})]}):p.paper_url?a.jsxs("a",{href:vt(p.paper_url)??void 0,target:"_blank",rel:"noopener noreferrer",className:"method-source-link",children:[a.jsx("span",{className:"method-source-title",children:J?a.jsx(ce,{title:J}):p.paper_url}),G&&a.jsx("span",{className:"method-source-meta",children:G})]}):a.jsxs("div",{className:"method-source-link is-static",children:[a.jsx("span",{className:"method-source-title",children:J?a.jsx(ce,{title:J}):null}),G&&a.jsx("span",{className:"method-source-meta",children:G})]})]}),a.jsx(Ar,{model:I,datasetName:p.name,hideClosed:l.hide_closed_source_evals,setHideClosed:o,setMetric:E}),_&&(()=>{var Te,Fe;const b=_.paper_arxiv_id||_.paper_id,T=_.paper_title||(_.paper_arxiv_id?`arXiv:${_.paper_arxiv_id}`:null),F=_.best_metric&&((Te=_.metrics)==null?void 0:Te[_.best_metric])!==void 0?_.best_metric:I.activeMetric,Me=(Fe=_.metrics)==null?void 0:Fe[F];return a.jsxs("div",{className:"bm-highlight-banner",role:"status",children:[a.jsx("span",{className:"bm-highlight-dot","aria-hidden":"true"}),a.jsxs("div",{className:"bm-highlight-text",children:[a.jsx("span",{className:"bm-highlight-label",children:"Comparing result"}),a.jsxs("span",{className:"bm-highlight-paper",children:[_.model_name||T||"—",_.harness?` · ${_.harness}`:""]}),a.jsxs("span",{className:"bm-highlight-meta",children:[Me!==void 0&&F?a.jsxs(a.Fragment,{children:[F,": ",le(Me),T?" · ":""]}):null,b?a.jsx(ne,{to:`/paper/${b}`,children:ze(_.paper_title,T)}):ze(_.paper_title,T)]})]})]})})(),a.jsxs("div",{className:"bm-card",ref:x,children:[a.jsxs("div",{className:"bm-card-screenshot-header","aria-hidden":"true",children:[a.jsxs("div",{className:"bm-card-screenshot-title",children:[a.jsx("span",{className:"bm-card-screenshot-eyebrow",children:"Benchmark"}),a.jsx("span",{className:"bm-card-screenshot-name",children:p.name})]}),a.jsxs("div",{className:"bm-card-screenshot-brand",children:[a.jsxs("span",{className:"brand",children:[a.jsx("span",{className:"brand-mark"}),a.jsxs("span",{className:"brand-name",children:["Papers ",a.jsx("em",{children:"With Code"})]})]}),a.jsx("span",{className:"bm-card-screenshot-url",children:"paperswithcode.co"})]})]}),a.jsxs("div",{className:"bm-card-head",children:[a.jsx("div",{className:"bm-card-title",children:"Leaderboard"}),a.jsxs("div",{className:"bm-card-actions",children:[I.allowedMetrics.length>1&&a.jsxs("label",{className:"bm-view-select",children:[a.jsx("span",{className:"bm-view-select-label",children:"View"}),a.jsx("select",{value:I.activeMetric,onChange:b=>E(b.target.value),children:c.map(b=>a.jsx("option",{value:b,children:b},b))})]}),a.jsxs("label",{className:"bm-closed-toggle",title:"Show or hide evaluations of closed-source models",children:[a.jsx(Ke,{className:"bm-closed-toggle-switch",checked:!l.hide_closed_source_evals,onCheckedChange:b=>{o(!b)},"aria-label":"Show closed-source models"}),a.jsx("span",{className:"bm-closed-toggle-label",children:"Closed-source"})]}),!K&&!X&&k.isSuccess?a.jsx("span",{className:"bm-parameter-unavailable",children:"Parameter metadata unavailable"}):null,a.jsx(nt,{targetRef:x,label:"leaderboard"})]})]}),!K&&X&&a.jsxs("div",{className:"bm-parameter-filter-bar",children:[a.jsx("span",{className:"bm-parameter-filter-label",children:"Parameters Size"}),a.jsx("div",{className:"bm-parameter-filter-options",role:"group","aria-label":"Filter leaderboard by parameter size",children:I.parameterFilters.map(b=>{const{selected:T,disabled:F}=b;return a.jsx("button",{type:"button",className:`bm-parameter-filter-option${T?" is-active":""}`,"aria-pressed":T,disabled:F,onClick:()=>$(b.maxParametersExclusive),children:b.label},b.label)})}),a.jsxs("span",{className:"bm-parameter-coverage",children:["Parameters known for ",Y.parameter_coverage_known," of ",Y.parameter_coverage_total," entries"]})]}),k.isLoading||K?a.jsx("div",{style:{padding:16},children:Array.from({length:5}).map((b,T)=>a.jsx(oe,{className:"h-10 w-full mb-2"},T))}):I.rows.length===0?i?a.jsxs("div",{className:"no-results",children:["No known parameter counts match this filter. "," ",a.jsx("button",{type:"button",className:"bm-empty-filter-action",onClick:()=>$(void 0),children:"Show all"})]}):a.jsx("div",{className:"no-results",children:"No evaluations submitted yet."}):a.jsxs(a.Fragment,{children:[c.length>P&&a.jsxs("div",{className:"bm-metric-columns-control",children:[a.jsx("button",{type:"button",className:"bm-metric-columns-toggle","aria-expanded":C,"aria-controls":"benchmark-leaderboard",onClick:()=>h(C?null:R),children:C?"Show fewer metrics":`Show more metrics (${c.length-P})`}),C&&a.jsx("span",{children:"Scroll metrics horizontally; model and paper details stay visible."})]}),a.jsx(At,{model:I,showHarness:y,setMetric:E,highlightRowRef:d,onFittingMetricCountChange:S})]})]})]})})};export{ia as default}; diff --git a/assets/BenchmarkTrendSparkline-BrvDBmsS.js b/assets/BenchmarkTrendSparkline-BfAoxAzu.js similarity index 97% rename from assets/BenchmarkTrendSparkline-BrvDBmsS.js rename to assets/BenchmarkTrendSparkline-BfAoxAzu.js index 53253d7a47aa2bd8c24d7d575043237e675f1648..08497c829b36ba82edb9c8e34a0888615014f4ed 100644 --- a/assets/BenchmarkTrendSparkline-BrvDBmsS.js +++ b/assets/BenchmarkTrendSparkline-BfAoxAzu.js @@ -1 +1 @@ -import{r as C,j as t}from"./index-CqKcHUvZ.js";const g=112,p=42,o=5,m=5,b=new Intl.DateTimeFormat("en",{month:"short",timeZone:"UTC"}),y=(e,d)=>{const r=new Date(`${e}T00:00:00Z`),n=new Date(`${d}T00:00:00Z`);return r.getUTCMonth()===n.getUTCMonth()?`${b.format(r)} ${r.getUTCDate()}–${n.getUTCDate()}`:`${b.format(r)} ${r.getUTCDate()}–${b.format(n)} ${n.getUTCDate()}`},I=({history:e,benchmarkName:d,interactive:r=!1})=>{const[n,x]=C.useState(null),h=e.map(s=>s.paper_count),M=Math.max(1,...h),f=g-o*2,T=p-m*2,v=h.length>1?f/(h.length-1):0,a=h.map((s,c)=>({x:o+v*c,y:m+T-s/M*T})),$=a.map(({x:s,y:c})=>`${s},${c}`).join(" "),_=a.length?`${o},${p-m} ${$} ${a[a.length-1].x},${p-m}`:"",D=h.reduce((s,c)=>s+c,0),u=49,N=14,i=n==null?null:a[n],j=i?Math.min(g-o-u,Math.max(o,i.x-u/2)):0,k=i?i.y>p/2?i.y-N-3:i.y+3:0;return t.jsxs("svg",{className:`benchmark-trend-sparkline${r?" is-interactive":""}`,viewBox:`0 0 ${g} ${p}`,role:r?"group":"img","aria-label":`${d}: ${D} reporting papers across the displayed trend history`,children:[t.jsxs("title",{children:[d,": ",D," reporting papers across the displayed trend history"]}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:p-m,x2:g-o,y2:p-m}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:m,x2:o,y2:p-m}),_&&t.jsx("polygon",{className:"benchmark-trend-area",points:_}),$&&t.jsx("polyline",{className:"benchmark-trend-line",points:$}),r?a.map(({x:s,y:c},l)=>t.jsxs("g",{className:"benchmark-trend-point",tabIndex:0,role:"img","aria-label":`${y(e[l].start_date,e[l].end_date)}: ${e[l].paper_count} ${e[l].paper_count===1?"paper":"papers"}`,onMouseEnter:()=>x(l),onMouseLeave:()=>x(null),onFocus:()=>x(l),onBlur:()=>x(null),children:[t.jsx("circle",{className:"benchmark-trend-point-hit",cx:s,cy:c,r:"5"}),t.jsx("circle",{className:"benchmark-trend-point-mark",cx:s,cy:c,r:"1.8"})]},`${e[l].start_date}-${e[l].end_date}`)):a.length>0&&t.jsx("circle",{className:"benchmark-trend-dot",cx:a[a.length-1].x,cy:a[a.length-1].y,r:"2.6"}),i&&n!=null&&t.jsxs("g",{className:"benchmark-trend-tooltip",pointerEvents:"none",children:[t.jsx("rect",{x:j,y:k,width:u,height:N,rx:"2"}),t.jsx("text",{x:j+3,y:k+5.4,children:y(e[n].start_date,e[n].end_date)}),t.jsxs("text",{className:"benchmark-trend-tooltip-value",x:j+3,y:k+11,children:[e[n].paper_count," ",e[n].paper_count===1?"paper":"papers"]})]})]})};export{I as B}; +import{r as C,j as t}from"./index-D6jcIRWs.js";const g=112,p=42,o=5,m=5,b=new Intl.DateTimeFormat("en",{month:"short",timeZone:"UTC"}),y=(e,d)=>{const r=new Date(`${e}T00:00:00Z`),n=new Date(`${d}T00:00:00Z`);return r.getUTCMonth()===n.getUTCMonth()?`${b.format(r)} ${r.getUTCDate()}–${n.getUTCDate()}`:`${b.format(r)} ${r.getUTCDate()}–${b.format(n)} ${n.getUTCDate()}`},I=({history:e,benchmarkName:d,interactive:r=!1})=>{const[n,x]=C.useState(null),h=e.map(s=>s.paper_count),M=Math.max(1,...h),f=g-o*2,T=p-m*2,v=h.length>1?f/(h.length-1):0,a=h.map((s,c)=>({x:o+v*c,y:m+T-s/M*T})),$=a.map(({x:s,y:c})=>`${s},${c}`).join(" "),_=a.length?`${o},${p-m} ${$} ${a[a.length-1].x},${p-m}`:"",D=h.reduce((s,c)=>s+c,0),u=49,N=14,i=n==null?null:a[n],j=i?Math.min(g-o-u,Math.max(o,i.x-u/2)):0,k=i?i.y>p/2?i.y-N-3:i.y+3:0;return t.jsxs("svg",{className:`benchmark-trend-sparkline${r?" is-interactive":""}`,viewBox:`0 0 ${g} ${p}`,role:r?"group":"img","aria-label":`${d}: ${D} reporting papers across the displayed trend history`,children:[t.jsxs("title",{children:[d,": ",D," reporting papers across the displayed trend history"]}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:p-m,x2:g-o,y2:p-m}),t.jsx("line",{className:"benchmark-trend-axis",x1:o,y1:m,x2:o,y2:p-m}),_&&t.jsx("polygon",{className:"benchmark-trend-area",points:_}),$&&t.jsx("polyline",{className:"benchmark-trend-line",points:$}),r?a.map(({x:s,y:c},l)=>t.jsxs("g",{className:"benchmark-trend-point",tabIndex:0,role:"img","aria-label":`${y(e[l].start_date,e[l].end_date)}: ${e[l].paper_count} ${e[l].paper_count===1?"paper":"papers"}`,onMouseEnter:()=>x(l),onMouseLeave:()=>x(null),onFocus:()=>x(l),onBlur:()=>x(null),children:[t.jsx("circle",{className:"benchmark-trend-point-hit",cx:s,cy:c,r:"5"}),t.jsx("circle",{className:"benchmark-trend-point-mark",cx:s,cy:c,r:"1.8"})]},`${e[l].start_date}-${e[l].end_date}`)):a.length>0&&t.jsx("circle",{className:"benchmark-trend-dot",cx:a[a.length-1].x,cy:a[a.length-1].y,r:"2.6"}),i&&n!=null&&t.jsxs("g",{className:"benchmark-trend-tooltip",pointerEvents:"none",children:[t.jsx("rect",{x:j,y:k,width:u,height:N,rx:"2"}),t.jsx("text",{x:j+3,y:k+5.4,children:y(e[n].start_date,e[n].end_date)}),t.jsxs("text",{className:"benchmark-trend-tooltip-value",x:j+3,y:k+11,children:[e[n].paper_count," ",e[n].paper_count===1?"paper":"papers"]})]})]})};export{I as B}; diff --git a/assets/CatalogEntityPreviewLink-BWMEEf81.js b/assets/CatalogEntityPreviewLink-BhTSUN-X.js similarity index 95% rename from assets/CatalogEntityPreviewLink-BWMEEf81.js rename to assets/CatalogEntityPreviewLink-BhTSUN-X.js index 550a4c13f9e47384790c47368a62513ad852007a..5106996261b1861e59df5e3c385bdf805fe35986 100644 --- a/assets/CatalogEntityPreviewLink-BWMEEf81.js +++ b/assets/CatalogEntityPreviewLink-BhTSUN-X.js @@ -1,4 +1,4 @@ -import{n as m,Z as h,K as d,j as s,L as g,W as f}from"./index-CqKcHUvZ.js";import{u as k}from"./useQuery-Cngk7eL9.js";import{H as w,a as y,b as v}from"./hover-card-BTsA69o8.js";import{c as l}from"./catalog-D26nGNnK.js";/** +import{n as m,$ as h,K as d,j as s,L as g,Y as f}from"./index-D6jcIRWs.js";import{u as k}from"./useQuery-CUJUm4FY.js";import{H as w,a as y,b as v}from"./hover-card-DPpv0l_x.js";import{c as l}from"./catalog-PYrB8_bm.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/ChatView-DZCqXX3T.js b/assets/ChatView-wJIPZ39W.js similarity index 98% rename from assets/ChatView-DZCqXX3T.js rename to assets/ChatView-wJIPZ39W.js index b3b9a93c89b975fa873ccc313bf865e578cb004d..d8dcef61f0416016c4e39c5474b35c4482ce24fb 100644 --- a/assets/ChatView-DZCqXX3T.js +++ b/assets/ChatView-wJIPZ39W.js @@ -1,4 +1,4 @@ -var ir=Object.defineProperty;var or=(e,r,t)=>r in e?ir(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var ee=(e,r,t)=>or(e,typeof r!="symbol"?r+"":r,t);import{n as cr,r as d,j as n,X as Pt,p as Ht,K as rt,a as Ut,u as lr,c as ur,e as dr,f as pr,h as fr,A as hr,L as Ct,Q as mr,S as gr,U as yr,V as At,m as _r}from"./index-CqKcHUvZ.js";import{u as Pe}from"./useQuery-Cngk7eL9.js";import{C as br,U as jt,b as wr,f as De,c as xr,g as vr,A as Sr,a as Er}from"./ArtifactWorkspace-DZXFAFpE.js";import{f as Ue,h as Rr,j as Kt,k as Ir,T as kr,e as Wt,l as Cr,m as Ar,n as jr,r as Tr,o as Tt,s as Yt,t as nt,v as He,w as Le,x as Mr,y as Mt,z as Nr,B as Dr,E as ut,F as $t,G as Lr,H as Fr,I as Or,J as qr,D as st,K as Br,L as Pr,M as Je,N as Qe,O as Hr,Q as ze,R as Ge,U as Ur,V as Kr,S as Wr,W as Yr,X as Nt,Y as $r}from"./chatSessions-D75G2_U7.js";import{M as Vr}from"./McpShowcase-oHgWM9FI.js";import{S as Qr}from"./share-2-Ma7ZrYBX.js";import{c as Xe}from"./chat-DGBJkcmd.js";import{u as zr,O as Gr}from"./openrouter-BNf4jDuS.js";import{q as Vt}from"./queryOptions-C9woPjwX.js";/* empty css */import"./hover-card-BTsA69o8.js";import"./CatalogEntityPreviewLink-BWMEEf81.js";import"./catalog-D26nGNnK.js";import"./github-sUmGdHig.js";import"./file-text-DnNBEwSF.js";import"./PaperPreviewLink-C6khj_iZ.js";import"./index-CqELxJb0.js";import"./index-DBHj7UWg.js";import"./katex-DkKDou_j.js";import"./papers-bE3C_Qzl.js";import"./useMutation-BItMAQ7s.js";import"./copy-D9WKw0Bi.js";import"./thumbs-up-C19-ALYv.js";import"./arrow-left-D_tIkkPW.js";import"./external-link-CrrdDZf6.js";import"./plus-DZF-NxR0.js";import"./search-9n8Usynh.js";import"./chevron-up-CZWX0SDx.js";import"./AuthorAvatar-CWCqOa0h.js";import"./AgentLogos-ClqC1BaK.js";/** +var ir=Object.defineProperty;var or=(e,r,t)=>r in e?ir(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var ee=(e,r,t)=>or(e,typeof r!="symbol"?r+"":r,t);import{n as cr,r as d,j as n,X as Pt,p as Ht,K as rt,a as Ut,u as lr,c as ur,e as dr,f as pr,Z as fr,A as hr,L as Ct,Q as mr,S as gr,U as yr,V as At,m as _r}from"./index-D6jcIRWs.js";import{u as Pe}from"./useQuery-CUJUm4FY.js";import{C as br,U as jt,b as wr,f as De,c as xr,g as vr,A as Sr,a as Er}from"./ArtifactWorkspace-CUZCugRS.js";import{f as Ue,h as Rr,j as Kt,k as Ir,T as kr,e as Wt,l as Cr,m as Ar,n as jr,r as Tr,o as Tt,s as Yt,t as nt,v as He,w as Le,x as Mr,y as Mt,z as Nr,B as Dr,E as ut,F as $t,G as Lr,H as Fr,I as Or,J as qr,D as st,K as Br,L as Pr,M as Je,N as Qe,O as Hr,Q as ze,R as Ge,U as Ur,V as Kr,S as Wr,W as Yr,X as Nt,Y as $r}from"./chatSessions-DByIWBno.js";import{M as Vr}from"./McpShowcase-CS9LZY9p.js";import{S as Qr}from"./share-2-DPo2j-OC.js";import{c as Xe}from"./chat-ChnK8XDU.js";import{u as zr,O as Gr}from"./openrouter-DrXWVMlM.js";import{q as Vt}from"./queryOptions-C9woPjwX.js";/* empty css */import"./hover-card-DPpv0l_x.js";import"./CatalogEntityPreviewLink-BhTSUN-X.js";import"./catalog-PYrB8_bm.js";import"./github-B7D_19Qm.js";import"./file-text-4G2I5_Zo.js";import"./PaperPreviewLink-fcJyP9H0.js";import"./index-uFGyKu5N.js";import"./index-yduEvk9Z.js";import"./katex-DkKDou_j.js";import"./papers-DIIIPDpj.js";import"./useMutation-p6mN4h17.js";import"./copy-BmzqMihw.js";import"./thumbs-up-BqRlVdvF.js";import"./arrow-left-IzGlownM.js";import"./external-link-C_yz2sXa.js";import"./plus-C4UQ62Q1.js";import"./search-CfTufeR7.js";import"./chevron-up-CQKUhZ0S.js";import"./AuthorAvatar-UMHOVOr9.js";import"./AgentLogos-CFt_vIO2.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/ConferenceDetailView-BP533WBF.js b/assets/ConferenceDetailView-BNri44qz.js similarity index 91% rename from assets/ConferenceDetailView-BP533WBF.js rename to assets/ConferenceDetailView-BNri44qz.js index 594c5591a8a7bc6fbed764f4208645b133647ffc..71942afded73ffa87533a7a20efe9af45c61c8b6 100644 --- a/assets/ConferenceDetailView-BP533WBF.js +++ b/assets/ConferenceDetailView-BNri44qz.js @@ -1 +1 @@ -import{u as L,r as D,j as e,L as p}from"./index-CqKcHUvZ.js";import{u as T}from"./useQuery-Cngk7eL9.js";import{M as F}from"./MarkdownText-CJQADo_f.js";import{c as A}from"./catalog-D26nGNnK.js";import{c as B,h as C,d as E}from"./colors-_scCXfCe.js";import{S as f}from"./skeleton-DleNhBYA.js";import{A as P,a as z}from"./alert-Z2yFUcyL.js";import{s as M}from"./safeExternalHref-CkBrsh84.js";/* empty css */import"./PaperPreviewLink-C6khj_iZ.js";import"./index-CqELxJb0.js";import"./index-DBHj7UWg.js";import"./katex-DkKDou_j.js";import"./hover-card-BTsA69o8.js";import"./papers-bE3C_Qzl.js";import"./useMutation-BItMAQ7s.js";const R=a=>(a==null?void 0:a.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",W=(a,t)=>{if(!a)return null;const i=new Date(`${a}T00:00:00`),s=t?new Date(`${t}T00:00:00`):null,c=g=>g.toLocaleDateString("en-US",{month:"long",day:"numeric"}),m=i.getFullYear();return s&&s.getTime()!==i.getTime()?i.getMonth()===s.getMonth()?`${c(i).replace(/\d+$/,"").trim()} ${i.getDate()}–${s.getDate()}, ${m}`:`${c(i)} – ${c(s)}, ${m}`:`${c(i)}, ${m}`},te=()=>{var k,S,b,_,$,w;const{confSlug:a}=L(),t=T({queryKey:["conference-areas-with-tasks",a],queryFn:()=>A.conferenceAreasWithTasks(a),enabled:!!a,staleTime:10*60*1e3}),i=D.useMemo(()=>{if(!t.data)return[];const n={general:0,vision:1,video:2,language:3,audio:4,other:5},r=o=>n[R(o)]??999;return[...t.data.results].sort((o,l)=>{const d=r(o.name),x=r(l.name);return d!==x?d-x:o.name.localeCompare(l.name)})},[t.data]),s=(k=t.data)==null?void 0:k.conference,c=((S=t.data)==null?void 0:S.total_paper_count)??0,m=((b=t.data)==null?void 0:b.oral_paper_count)??0,g=((_=t.data)==null?void 0:_.spotlight_paper_count)??0,u=(($=t.data)==null?void 0:$.outstanding_paper_count)??0,j=((w=t.data)==null?void 0:w.best_paper_finalist_paper_count)??0,v=i.reduce((n,r)=>n+r.tasks.length,0);if(t.error)return e.jsx("div",{className:"page",children:e.jsx(P,{variant:"destructive",children:e.jsx(z,{children:"Failed to load conference. Please try again."})})});const y=s?W(s.start_date,s.end_date):null,N=s?[s.venue,s.location].filter(Boolean).join(", "):null,h=s==null?void 0:s.name;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:s!=null&&s.image_url?"task-hero-grid":void 0,children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"CONFERENCE"}),e.jsx("h1",{className:"feed-title",children:h??e.jsx(f,{className:"h-10 w-64 inline-block"})}),e.jsxs("div",{className:"feed-subtitle",style:{display:"flex",flexDirection:"column",gap:4},children:[y&&e.jsx("span",{children:y}),N&&e.jsx("span",{children:N}),(s==null?void 0:s.url)&&e.jsx("a",{href:M(s.url)??void 0,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:s.url.replace(/^https?:\/\//,"")}),(s==null?void 0:s.hf_url)&&e.jsxs("a",{className:"bm-action-btn",href:s.hf_url,target:"_blank",rel:"noopener noreferrer",style:{alignSelf:"flex-start",marginTop:4},children:[e.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),(s==null?void 0:s.description)&&e.jsx(F,{className:"method-description",text:s.description})]}),(s==null?void 0:s.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:s.image_url,alt:h?`${h} visual`:"Conference visual",onError:n=>{var r,o;(o=(r=n.currentTarget.parentElement)==null?void 0:r.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",h??"Conference",s.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(F,{className:"task-image-credit",text:s.image_credit})]})]})]})]}),!t.isLoading&&c>0&&e.jsxs("section",{style:{marginTop:48,marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",flexWrap:"wrap",gap:"6px 24px",paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:"Browse papers"}),e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:"All accepted papers, plus oral, spotlight, outstanding, and best paper finalists."})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[c.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[e.jsxs(p,{to:`/conferences/${a}/all`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"var(--accent)"}}),"All papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[c.toLocaleString()," papers"]})})]}),m>0&&e.jsxs(p,{to:`/conferences/${a}/oral`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Oral papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[m.toLocaleString()," papers"]})})]}),g>0&&e.jsxs(p,{to:`/conferences/${a}/spotlight`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Spotlight papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[g.toLocaleString()," papers"]})})]}),u>0&&e.jsxs(p,{to:`/conferences/${a}/outstanding`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c45c26"}}),"Outstanding papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[u.toLocaleString()," papers"]})})]}),j>0&&e.jsxs(p,{to:`/conferences/${a}/best-paper-finalists`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c9a227"}}),"Best paper finalists"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[j.toLocaleString()," papers"]})})]})]})]}),t.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((n,r)=>e.jsxs("div",{children:[e.jsx(f,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((o,l)=>e.jsx(f,{className:"h-24"},l))})]},r))}):i.map(n=>{const r=n.tasks;if(r.length===0)return null;const o=r.reduce((l,d)=>l+(d.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",flexWrap:"wrap",gap:"6px 24px",paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:n.name}),n.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:n.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[r.length," ",r.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:r.map(l=>{const d=l.slug||"",x=B(C(d));return e.jsxs(p,{to:`/conferences/${a}/${d}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:x.dot}}),E(l.name,d)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})})]},l.id)})})]},n.id)}),v>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[v," tasks across ",i.filter(n=>n.tasks.length>0).length," areas."]})]})};export{te as default}; +import{u as L,r as D,j as e,L as p}from"./index-D6jcIRWs.js";import{u as T}from"./useQuery-CUJUm4FY.js";import{M as F}from"./MarkdownText-B_D3IE_p.js";import{c as A}from"./catalog-PYrB8_bm.js";import{c as B,h as C,d as E}from"./colors-CLwl8a2d.js";import{S as f}from"./skeleton-BqkYFmXl.js";import{A as P,a as z}from"./alert-2MbxVzGL.js";import{s as M}from"./safeExternalHref-CkBrsh84.js";/* empty css */import"./PaperPreviewLink-fcJyP9H0.js";import"./index-uFGyKu5N.js";import"./index-yduEvk9Z.js";import"./katex-DkKDou_j.js";import"./hover-card-DPpv0l_x.js";import"./papers-DIIIPDpj.js";import"./useMutation-p6mN4h17.js";const R=a=>(a==null?void 0:a.trim().toLowerCase().replace(/[\s_]+/g,"-"))??"",W=(a,t)=>{if(!a)return null;const i=new Date(`${a}T00:00:00`),s=t?new Date(`${t}T00:00:00`):null,c=g=>g.toLocaleDateString("en-US",{month:"long",day:"numeric"}),m=i.getFullYear();return s&&s.getTime()!==i.getTime()?i.getMonth()===s.getMonth()?`${c(i).replace(/\d+$/,"").trim()} ${i.getDate()}–${s.getDate()}, ${m}`:`${c(i)} – ${c(s)}, ${m}`:`${c(i)}, ${m}`},te=()=>{var k,S,b,_,$,w;const{confSlug:a}=L(),t=T({queryKey:["conference-areas-with-tasks",a],queryFn:()=>A.conferenceAreasWithTasks(a),enabled:!!a,staleTime:10*60*1e3}),i=D.useMemo(()=>{if(!t.data)return[];const n={general:0,vision:1,video:2,language:3,audio:4,other:5},r=o=>n[R(o)]??999;return[...t.data.results].sort((o,l)=>{const d=r(o.name),x=r(l.name);return d!==x?d-x:o.name.localeCompare(l.name)})},[t.data]),s=(k=t.data)==null?void 0:k.conference,c=((S=t.data)==null?void 0:S.total_paper_count)??0,m=((b=t.data)==null?void 0:b.oral_paper_count)??0,g=((_=t.data)==null?void 0:_.spotlight_paper_count)??0,u=(($=t.data)==null?void 0:$.outstanding_paper_count)??0,j=((w=t.data)==null?void 0:w.best_paper_finalist_paper_count)??0,v=i.reduce((n,r)=>n+r.tasks.length,0);if(t.error)return e.jsx("div",{className:"page",children:e.jsx(P,{variant:"destructive",children:e.jsx(z,{children:"Failed to load conference. Please try again."})})});const y=s?W(s.start_date,s.end_date):null,N=s?[s.venue,s.location].filter(Boolean).join(", "):null,h=s==null?void 0:s.name;return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:s!=null&&s.image_url?"task-hero-grid":void 0,children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"CONFERENCE"}),e.jsx("h1",{className:"feed-title",children:h??e.jsx(f,{className:"h-10 w-64 inline-block"})}),e.jsxs("div",{className:"feed-subtitle",style:{display:"flex",flexDirection:"column",gap:4},children:[y&&e.jsx("span",{children:y}),N&&e.jsx("span",{children:N}),(s==null?void 0:s.url)&&e.jsx("a",{href:M(s.url)??void 0,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:s.url.replace(/^https?:\/\//,"")}),(s==null?void 0:s.hf_url)&&e.jsxs("a",{className:"bm-action-btn",href:s.hf_url,target:"_blank",rel:"noopener noreferrer",style:{alignSelf:"flex-start",marginTop:4},children:[e.jsx("span",{"aria-hidden":"true",children:"🤗"})," View on Hugging Face"]})]}),(s==null?void 0:s.description)&&e.jsx(F,{className:"method-description",text:s.description})]}),(s==null?void 0:s.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:s.image_url,alt:h?`${h} visual`:"Conference visual",onError:n=>{var r,o;(o=(r=n.currentTarget.parentElement)==null?void 0:r.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",h??"Conference",s.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(F,{className:"task-image-credit",text:s.image_credit})]})]})]})]}),!t.isLoading&&c>0&&e.jsxs("section",{style:{marginTop:48,marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",flexWrap:"wrap",gap:"6px 24px",paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:"Browse papers"}),e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:"All accepted papers, plus oral, spotlight, outstanding, and best paper finalists."})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[c.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[e.jsxs(p,{to:`/conferences/${a}/all`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"var(--accent)"}}),"All papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[c.toLocaleString()," papers"]})})]}),m>0&&e.jsxs(p,{to:`/conferences/${a}/oral`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Oral papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[m.toLocaleString()," papers"]})})]}),g>0&&e.jsxs(p,{to:`/conferences/${a}/spotlight`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#fdbb02"}}),"Spotlight papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[g.toLocaleString()," papers"]})})]}),u>0&&e.jsxs(p,{to:`/conferences/${a}/outstanding`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c45c26"}}),"Outstanding papers"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[u.toLocaleString()," papers"]})})]}),j>0&&e.jsxs(p,{to:`/conferences/${a}/best-paper-finalists`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:"#c9a227"}}),"Best paper finalists"]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[j.toLocaleString()," papers"]})})]})]})]}),t.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:4}).map((n,r)=>e.jsxs("div",{children:[e.jsx(f,{className:"h-8 w-1/3 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((o,l)=>e.jsx(f,{className:"h-24"},l))})]},r))}):i.map(n=>{const r=n.tasks;if(r.length===0)return null;const o=r.reduce((l,d)=>l+(d.paper_count||0),0);return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",flexWrap:"wrap",gap:"6px 24px",paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},children:[e.jsxs("div",{children:[e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:n.name}),n.description&&e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},children:n.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[r.length," ",r.length===1?"task":"tasks"," · ",o.toLocaleString()," papers"]})]}),e.jsx("div",{className:"tag-grid",children:r.map(l=>{const d=l.slug||"",x=B(C(d));return e.jsxs(p,{to:`/conferences/${a}/${d}`,className:"tag-cell",children:[e.jsxs("div",{className:"name",children:[e.jsx("span",{className:"dot",style:{background:x.dot}}),E(l.name,d)]}),e.jsx("div",{className:"meta",children:e.jsxs("span",{children:[(l.paper_count??0).toLocaleString()," papers"]})})]},l.id)})})]},n.id)}),v>0&&e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:24},children:[v," tasks across ",i.filter(n=>n.tasks.length>0).length," areas."]})]})};export{te as default}; diff --git a/assets/ConferenceTaskView-B9U81_-o.js b/assets/ConferenceTaskView-BBbbnoRS.js similarity index 84% rename from assets/ConferenceTaskView-B9U81_-o.js rename to assets/ConferenceTaskView-BBbbnoRS.js index e43fc0c4404334ee1f1dc0fec7027046ae278982..b6ad350155be6b44db875d7e979b5c464e9d533a 100644 --- a/assets/ConferenceTaskView-B9U81_-o.js +++ b/assets/ConferenceTaskView-BBbbnoRS.js @@ -1 +1 @@ -import{u as V,e as $,r as b,j as e,L as y,K as W}from"./index-CqKcHUvZ.js";import{u as E}from"./useQuery-Cngk7eL9.js";import{P as G}from"./components-Dmnn5Z5p.js";import{P as J}from"./PaperFeedFilters-SOqb93ez.js";import{a as X,P as Y,b as Z}from"./PaperDateFilter-zHw5tq6B.js";import{M as g}from"./MarkdownText-CJQADo_f.js";import{c as M}from"./catalog-D26nGNnK.js";import{t as ee,d as se}from"./colors-_scCXfCe.js";import{d as ae}from"./usePapers-By3yMmMn.js";import{u as te}from"./useInfiniteScroll-DVF-b-LX.js";import{S as re}from"./skeleton-DleNhBYA.js";import{A as ne,a as ie}from"./alert-Z2yFUcyL.js";import"./papers-bE3C_Qzl.js";import"./AuthorAvatar-CWCqOa0h.js";import"./LatexTitle-BI9yl-Fo.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-BcoS9Jmp.js";/* empty css */import"./PaperPreviewLink-C6khj_iZ.js";import"./index-CqELxJb0.js";import"./index-DBHj7UWg.js";import"./katex-DkKDou_j.js";import"./hover-card-BTsA69o8.js";import"./useMutation-BItMAQ7s.js";import"./useInfiniteQuery-lxaMAHEu.js";import"./useIntersectionObserver-CiBk_Oug.js";const oe=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ce=t=>t==="trending"||t==="date_published"||t==="citation_count"?t:"trending",Oe=()=>{var A,F,L,T,B,O;const{confSlug:t,taskSlug:n}=V(),[i,u]=$(),S=ce(i.get("order_by")),w=i.get("has_code")==="true",k=i.get("has_hf_artifacts")==="true",f=X(i),z=a=>{const s=new URLSearchParams(i);s.set("order_by",a),u(s)},q=a=>{const s=new URLSearchParams(i);a?s.set("has_code","true"):s.delete("has_code"),u(s)},I=a=>{const s=new URLSearchParams(i);a?s.set("has_hf_artifacts","true"):s.delete("has_hf_artifacts"),u(s)},R=n==="all",P=n==="oral",_=n==="spotlight",l=n==="outstanding",d=n==="best-paper-finalists",x=l||d,p=R||P||_||l||d,K=p?void 0:n,Q=P?"oral":_?"spotlight":l?"outstanding":d?"best_paper_finalist":void 0,m=E({queryKey:["conference",t],queryFn:()=>M.getConference(t),enabled:!!t,staleTime:10*60*1e3}),j=E({queryKey:["task",n],queryFn:()=>M.getTask(n),enabled:!!n&&!p,staleTime:10*60*1e3}),c=ae({conferenceSlug:t||"",taskSlug:K,presentation:Q,page_size:12,order_by:S,order_dir:"desc",include_resources:!0,has_code:w,has_hf_artifacts:k,start_date:f.startDate,end_date:f.endDate,enabled:!!t}),U=te(c);b.useEffect(()=>{window.scrollTo(0,0)},[t,n]);const N=b.useMemo(()=>{var s;return(((s=c.data)==null?void 0:s.pages)??[]).flatMap(o=>o.results)},[c.data]),v=b.useMemo(()=>N.map(ee),[N]),h=R?"All papers":P?"Oral papers":_?"Spotlight papers":l?"Outstanding papers":d?"Best paper finalists":se(((A=j.data)==null?void 0:A.name)||n||"",((F=j.data)==null?void 0:F.slug)||n),C=((T=(L=c.data)==null?void 0:L.pages[0])==null?void 0:T.count)??((B=m.data)==null?void 0:B.paper_count)??0,r=j.data;return m.error||j.error||c.error?e.jsx("div",{className:"page",children:e.jsx(ne,{variant:"destructive",children:e.jsx(ie,{children:"Failed to load conference papers. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(y,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(y,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(y,{to:`/conferences/${t}`,children:((O=m.data)==null?void 0:O.name)??t}),e.jsx("span",{children:" / "}),e.jsx("span",{children:h})]}),e.jsxs("div",{className:!p&&(r!=null&&r.image_url)?"task-hero-grid":void 0,style:{marginTop:16,marginBottom:28},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:p?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:h}),l&&t==="iclr-2026"&&e.jsx(g,{className:"task-explainer",text:"ICLR 2026 recognized two Outstanding Papers and one Honorable Mention. [Read the announcement](https://blog.iclr.cc/2026/04/23/announcing-the-iclr-2026-outstanding-papers/)."}),l&&t==="icml-2026"&&e.jsx(g,{className:"task-explainer",text:"ICML 2026 recognized two Outstanding Papers and five Honorable Mentions. [Read the announcement](https://blog.icml.cc/2026/07/05/announcing-the-icml-2026-awards/)."}),d&&t==="cvpr-2026"&&e.jsx(g,{className:"task-explainer",text:"CVPR 2026 recognized fifteen Best Paper Award finalists, including the winners. [Read the announcement](https://x.com/CVPR/status/2062912519522717978)."}),!p&&(r==null?void 0:r.description)&&e.jsx(g,{className:"task-explainer",text:r.description}),m.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:C.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:m.data.name})]})]}),!p&&(r==null?void 0:r.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:r.image_url,alt:`${h} schematic`,onError:a=>{var s,o;(o=(s=a.currentTarget.parentElement)==null?void 0:s.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",h,r.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(g,{className:"task-image-credit",text:r.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:x?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",C.toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[!x&&e.jsx("div",{className:"sort-options",children:oe.map(([a,s])=>e.jsx("button",{className:`sort-btn ${S===a?"active":""}`,onClick:()=>z(a),children:s},a))}),e.jsx(J,{hasCode:w,hasHfArtifacts:k,onHasCodeChange:q,onHasHfArtifactsChange:I,showDivider:!x})]}),e.jsx(Y,{startDate:f.startDate,endDate:f.endDate,onChange:a=>u(Z(i,a))}),!x&&e.jsxs("div",{className:"results-count",children:[v.length," loaded in ",e.jsx("span",{children:h})]})]}),c.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,s)=>e.jsx(re,{className:"h-40 w-full"},s))}):v.length===0?e.jsx("div",{className:"no-results",children:"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:v.map((a,s)=>{var H;const o=(H=N[s])==null?void 0:H.conference_award,D=o==="outstanding"?"Outstanding Paper":o==="honorable_mention"?"Honorable Mention":o==="best_paper_finalist"&&!d?"Best Paper Finalist":null;return e.jsxs(W.Fragment,{children:[D&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.08em",marginBottom:8},children:D}),e.jsx(G,{paper:a,rank:s+1})]},a.id)})}),e.jsx("div",{ref:U,style:{height:1}}),c.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{Oe as default}; +import{u as V,e as $,r as b,j as e,L as y,K as W}from"./index-D6jcIRWs.js";import{u as E}from"./useQuery-CUJUm4FY.js";import{P as G}from"./components-DO1X940E.js";import{P as J}from"./PaperFeedFilters-DNebHp4l.js";import{a as X,P as Y,b as Z}from"./PaperDateFilter-CPIqaHaq.js";import{M as g}from"./MarkdownText-B_D3IE_p.js";import{c as M}from"./catalog-PYrB8_bm.js";import{t as ee,d as se}from"./colors-CLwl8a2d.js";import{d as ae}from"./usePapers-BbCSwcVk.js";import{u as te}from"./useInfiniteScroll-Dm7JY_X4.js";import{S as re}from"./skeleton-BqkYFmXl.js";import{A as ne,a as ie}from"./alert-2MbxVzGL.js";import"./papers-DIIIPDpj.js";import"./AuthorAvatar-UMHOVOr9.js";import"./LatexTitle-D_92Jowu.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-DCjqGpW0.js";/* empty css */import"./PaperPreviewLink-fcJyP9H0.js";import"./index-uFGyKu5N.js";import"./index-yduEvk9Z.js";import"./katex-DkKDou_j.js";import"./hover-card-DPpv0l_x.js";import"./useMutation-p6mN4h17.js";import"./useInfiniteQuery-FXco4P1n.js";import"./useIntersectionObserver-3LTuEaFW.js";const oe=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ce=t=>t==="trending"||t==="date_published"||t==="citation_count"?t:"trending",Oe=()=>{var A,F,L,T,B,O;const{confSlug:t,taskSlug:n}=V(),[i,u]=$(),S=ce(i.get("order_by")),w=i.get("has_code")==="true",k=i.get("has_hf_artifacts")==="true",f=X(i),z=a=>{const s=new URLSearchParams(i);s.set("order_by",a),u(s)},q=a=>{const s=new URLSearchParams(i);a?s.set("has_code","true"):s.delete("has_code"),u(s)},I=a=>{const s=new URLSearchParams(i);a?s.set("has_hf_artifacts","true"):s.delete("has_hf_artifacts"),u(s)},R=n==="all",P=n==="oral",_=n==="spotlight",l=n==="outstanding",d=n==="best-paper-finalists",x=l||d,p=R||P||_||l||d,K=p?void 0:n,Q=P?"oral":_?"spotlight":l?"outstanding":d?"best_paper_finalist":void 0,m=E({queryKey:["conference",t],queryFn:()=>M.getConference(t),enabled:!!t,staleTime:10*60*1e3}),j=E({queryKey:["task",n],queryFn:()=>M.getTask(n),enabled:!!n&&!p,staleTime:10*60*1e3}),c=ae({conferenceSlug:t||"",taskSlug:K,presentation:Q,page_size:12,order_by:S,order_dir:"desc",include_resources:!0,has_code:w,has_hf_artifacts:k,start_date:f.startDate,end_date:f.endDate,enabled:!!t}),U=te(c);b.useEffect(()=>{window.scrollTo(0,0)},[t,n]);const N=b.useMemo(()=>{var s;return(((s=c.data)==null?void 0:s.pages)??[]).flatMap(o=>o.results)},[c.data]),v=b.useMemo(()=>N.map(ee),[N]),h=R?"All papers":P?"Oral papers":_?"Spotlight papers":l?"Outstanding papers":d?"Best paper finalists":se(((A=j.data)==null?void 0:A.name)||n||"",((F=j.data)==null?void 0:F.slug)||n),C=((T=(L=c.data)==null?void 0:L.pages[0])==null?void 0:T.count)??((B=m.data)==null?void 0:B.paper_count)??0,r=j.data;return m.error||j.error||c.error?e.jsx("div",{className:"page",children:e.jsx(ne,{variant:"destructive",children:e.jsx(ie,{children:"Failed to load conference papers. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(y,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(y,{to:"/conferences",children:"Conferences"}),e.jsx("span",{children:" / "}),e.jsx(y,{to:`/conferences/${t}`,children:((O=m.data)==null?void 0:O.name)??t}),e.jsx("span",{children:" / "}),e.jsx("span",{children:h})]}),e.jsxs("div",{className:!p&&(r!=null&&r.image_url)?"task-hero-grid":void 0,style:{marginTop:16,marginBottom:28},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:p?"BROWSE PAPERS":"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:h}),l&&t==="iclr-2026"&&e.jsx(g,{className:"task-explainer",text:"ICLR 2026 recognized two Outstanding Papers and one Honorable Mention. [Read the announcement](https://blog.iclr.cc/2026/04/23/announcing-the-iclr-2026-outstanding-papers/)."}),l&&t==="icml-2026"&&e.jsx(g,{className:"task-explainer",text:"ICML 2026 recognized two Outstanding Papers and five Honorable Mentions. [Read the announcement](https://blog.icml.cc/2026/07/05/announcing-the-icml-2026-awards/)."}),d&&t==="cvpr-2026"&&e.jsx(g,{className:"task-explainer",text:"CVPR 2026 recognized fifteen Best Paper Award finalists, including the winners. [Read the announcement](https://x.com/CVPR/status/2062912519522717978)."}),!p&&(r==null?void 0:r.description)&&e.jsx(g,{className:"task-explainer",text:r.description}),m.data&&e.jsxs("div",{className:"task-quickstats",style:{marginTop:12},children:[e.jsxs("span",{children:[e.jsx("span",{className:"num",children:C.toLocaleString()}),"PAPERS"]}),e.jsx("span",{children:m.data.name})]})]}),!p&&(r==null?void 0:r.image_url)&&e.jsxs("figure",{className:"task-figure-card",children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:r.image_url,alt:`${h} schematic`,onError:a=>{var s,o;(o=(s=a.currentTarget.parentElement)==null?void 0:s.parentElement)==null||o.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",h,r.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(g,{className:"task-image-credit",text:r.image_credit})]})]})]})]}),e.jsxs("div",{className:"task-section-head",children:[e.jsx("div",{className:"task-section-eyebrow",children:x?"Award papers":"Conference papers · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",C.toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[!x&&e.jsx("div",{className:"sort-options",children:oe.map(([a,s])=>e.jsx("button",{className:`sort-btn ${S===a?"active":""}`,onClick:()=>z(a),children:s},a))}),e.jsx(J,{hasCode:w,hasHfArtifacts:k,onHasCodeChange:q,onHasHfArtifactsChange:I,showDivider:!x})]}),e.jsx(Y,{startDate:f.startDate,endDate:f.endDate,onChange:a=>u(Z(i,a))}),!x&&e.jsxs("div",{className:"results-count",children:[v.length," loaded in ",e.jsx("span",{children:h})]})]}),c.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((a,s)=>e.jsx(re,{className:"h-40 w-full"},s))}):v.length===0?e.jsx("div",{className:"no-results",children:"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:v.map((a,s)=>{var H;const o=(H=N[s])==null?void 0:H.conference_award,D=o==="outstanding"?"Outstanding Paper":o==="honorable_mention"?"Honorable Mention":o==="best_paper_finalist"&&!d?"Best Paper Finalist":null;return e.jsxs(W.Fragment,{children:[D&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.08em",marginBottom:8},children:D}),e.jsx(G,{paper:a,rank:s+1})]},a.id)})}),e.jsx("div",{ref:U,style:{height:1}}),c.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{Oe as default}; diff --git a/assets/ConferencesIndexView-BvdvhrAq.js b/assets/ConferencesIndexView-DF9D85K1.js similarity index 83% rename from assets/ConferencesIndexView-BvdvhrAq.js rename to assets/ConferencesIndexView-DF9D85K1.js index eb273eb353e424661b0cd7a85eee76d8ea8638a6..8431c116a71ffb74615cb9f0e92a8c6492a3c727 100644 --- a/assets/ConferencesIndexView-BvdvhrAq.js +++ b/assets/ConferencesIndexView-DF9D85K1.js @@ -1 +1 @@ -import{r as p,j as e,L as d}from"./index-CqKcHUvZ.js";import{u}from"./useQuery-Cngk7eL9.js";import{c as f}from"./catalog-D26nGNnK.js";import{S as m}from"./skeleton-DleNhBYA.js";import{A as h,a as g}from"./alert-Z2yFUcyL.js";import{T as x}from"./TaxonomySuggestionTile-Be7MdvJo.js";import"./SignInToEditDialog-B4COuqpY.js";import"./button-BYn4yUH_.js";import"./input-sw0Ix0Sa.js";import"./textarea-CQToxq8k.js";import"./searchable-select-DY1KXMvg.js";import"./popover-BcoS9Jmp.js";import"./dialog-B-oqHDuH.js";import"./search-9n8Usynh.js";import"./loader-circle-CZgakNH7.js";import"./useMutation-BItMAQ7s.js";import"./submissions-1aHdBaSr.js";import"./plus-DZF-NxR0.js";const j=(t,a)=>{if(!t)return null;const r=new Date(`${t}T00:00:00`),s=a?new Date(`${a}T00:00:00`):null,n=o=>o.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=r.getFullYear();return s&&s.getTime()!==r.getTime()?r.getMonth()===s.getMonth()?`${n(r).replace(/\d+$/,"").trim()} ${r.getDate()}–${s.getDate()}, ${i}`:`${n(r)} – ${n(s)}, ${i}`:`${n(r)}, ${i}`},v=t=>{var r;if(t.year!=null)return t.year;if(t.start_date)return Number(t.start_date.slice(0,4));const a=(r=t.slug.match(/-(\d{4})$/))==null?void 0:r[1];return a?Number(a):0},y=(t,a)=>{if(t.start_date&&a.start_date){const r=t.start_date.localeCompare(a.start_date);if(r!==0)return r}else{if(t.start_date)return-1;if(a.start_date)return 1}return t.name.localeCompare(a.name)},N={display:"flex",alignItems:"baseline",justifyContent:"space-between",flexWrap:"wrap",gap:"6px 24px",paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},H=()=>{const t=u({queryKey:["conferences"],queryFn:()=>f.conferences(),staleTime:6e5}),a=p.useMemo(()=>{var s;if(!((s=t.data)!=null&&s.results))return null;const r={};return t.data.results.forEach(n=>{const i=v(n);(r[i]||(r[i]=[])).push(n)}),Object.values(r).forEach(n=>n.sort(y)),Object.keys(r).map(Number).sort((n,i)=>i-n).map(n=>({year:n,conferences:r[n]}))},[t.data]);return t.error?e.jsx("div",{className:"page",children:e.jsx(h,{variant:"destructive",children:e.jsx(g,{children:"Failed to load conferences. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Conferences"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse accepted papers from major AI conferences, grouped by research area and task."}),e.jsxs("div",{className:"conference-deadlines-link",children:["Find deadlines for upcoming conferences"," ",e.jsx(d,{to:"/ai-deadlines",className:"underline underline-offset-2 hover:text-foreground",children:"here"}),". Conference information is based on"," ",e.jsx("a",{href:"https://huggingface.co/ai-conferences",target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"Hugging Face AI Conferences"}),"."]})]})}),t.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:2}).map((r,s)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-24 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:3}).map((n,i)=>e.jsx(m,{className:"h-32"},i))})]},s))}):a==null?void 0:a.map(({year:r,conferences:s})=>{const n=s.reduce((o,l)=>o+(l.paper_count??0),0),i=r>0?String(r):"Unknown year";return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:N,children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:i})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[s.length," ",s.length===1?"conference":"conferences"," ·"," ",n.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[s.map(o=>{const l=j(o.start_date,o.end_date),c=[o.venue,o.location].filter(Boolean).join(", ");return e.jsxs(d,{to:`/conferences/${o.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:o.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[l&&e.jsx("span",{children:l}),c&&e.jsx("span",{children:c}),e.jsxs("span",{children:[(o.paper_count??0).toLocaleString()," papers"]})]})]},o.id)}),e.jsx(x,{kind:"conference"})]})]},r)})]})};export{H as default}; +import{r as p,j as e,L as d}from"./index-D6jcIRWs.js";import{u}from"./useQuery-CUJUm4FY.js";import{c as f}from"./catalog-PYrB8_bm.js";import{S as m}from"./skeleton-BqkYFmXl.js";import{A as h,a as g}from"./alert-2MbxVzGL.js";import{T as x}from"./TaxonomySuggestionTile-BLk1tYYE.js";import"./SignInToEditDialog-RzK54RAM.js";import"./button-Bzx0ccHH.js";import"./input-CCN-4hy4.js";import"./textarea-sXKODM3W.js";import"./searchable-select-B7z6Fcrr.js";import"./popover-DCjqGpW0.js";import"./dialog-vGFIbcd-.js";import"./search-CfTufeR7.js";import"./loader-circle-BuDrH29B.js";import"./useMutation-p6mN4h17.js";import"./submissions-DNa3tQdo.js";import"./plus-C4UQ62Q1.js";const j=(t,a)=>{if(!t)return null;const r=new Date(`${t}T00:00:00`),s=a?new Date(`${a}T00:00:00`):null,n=o=>o.toLocaleDateString("en-US",{month:"long",day:"numeric"}),i=r.getFullYear();return s&&s.getTime()!==r.getTime()?r.getMonth()===s.getMonth()?`${n(r).replace(/\d+$/,"").trim()} ${r.getDate()}–${s.getDate()}, ${i}`:`${n(r)} – ${n(s)}, ${i}`:`${n(r)}, ${i}`},v=t=>{var r;if(t.year!=null)return t.year;if(t.start_date)return Number(t.start_date.slice(0,4));const a=(r=t.slug.match(/-(\d{4})$/))==null?void 0:r[1];return a?Number(a):0},y=(t,a)=>{if(t.start_date&&a.start_date){const r=t.start_date.localeCompare(a.start_date);if(r!==0)return r}else{if(t.start_date)return-1;if(a.start_date)return 1}return t.name.localeCompare(a.name)},N={display:"flex",alignItems:"baseline",justifyContent:"space-between",flexWrap:"wrap",gap:"6px 24px",paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},H=()=>{const t=u({queryKey:["conferences"],queryFn:()=>f.conferences(),staleTime:6e5}),a=p.useMemo(()=>{var s;if(!((s=t.data)!=null&&s.results))return null;const r={};return t.data.results.forEach(n=>{const i=v(n);(r[i]||(r[i]=[])).push(n)}),Object.values(r).forEach(n=>n.sort(y)),Object.keys(r).map(Number).sort((n,i)=>i-n).map(n=>({year:n,conferences:r[n]}))},[t.data]);return t.error?e.jsx("div",{className:"page",children:e.jsx(h,{variant:"destructive",children:e.jsx(g,{children:"Failed to load conferences. Please try again."})})}):e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["All ",e.jsx("em",{children:"Conferences"})]}),e.jsx("div",{className:"feed-subtitle",children:"Browse accepted papers from major AI conferences, grouped by research area and task."}),e.jsxs("div",{className:"conference-deadlines-link",children:["Find deadlines for upcoming conferences"," ",e.jsx(d,{to:"/ai-deadlines",className:"underline underline-offset-2 hover:text-foreground",children:"here"}),". Conference information is based on"," ",e.jsx("a",{href:"https://huggingface.co/ai-conferences",target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"Hugging Face AI Conferences"}),"."]})]})}),t.isLoading?e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:32},children:Array.from({length:2}).map((r,s)=>e.jsxs("div",{children:[e.jsx(m,{className:"h-8 w-24 mb-4"}),e.jsx("div",{className:"tag-grid",children:Array.from({length:3}).map((n,i)=>e.jsx(m,{className:"h-32"},i))})]},s))}):a==null?void 0:a.map(({year:r,conferences:s})=>{const n=s.reduce((o,l)=>o+(l.paper_count??0),0),i=r>0?String(r):"Unknown year";return e.jsxs("section",{style:{marginBottom:48},children:[e.jsxs("div",{style:N,children:[e.jsx("div",{children:e.jsx("h2",{style:{fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},children:i})}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[s.length," ",s.length===1?"conference":"conferences"," ·"," ",n.toLocaleString()," papers"]})]}),e.jsxs("div",{className:"tag-grid",children:[s.map(o=>{const l=j(o.start_date,o.end_date),c=[o.venue,o.location].filter(Boolean).join(", ");return e.jsxs(d,{to:`/conferences/${o.slug}`,className:"tag-cell",children:[e.jsx("div",{className:"name",children:o.name}),e.jsxs("div",{className:"meta",style:{display:"flex",flexDirection:"column",gap:4},children:[l&&e.jsx("span",{children:l}),c&&e.jsx("span",{children:c}),e.jsxs("span",{children:[(o.paper_count??0).toLocaleString()," papers"]})]})]},o.id)}),e.jsx(x,{kind:"conference"})]})]},r)})]})};export{H as default}; diff --git a/assets/CronDashboard-B0sjsUM_.js b/assets/CronDashboard-B0sjsUM_.js new file mode 100644 index 0000000000000000000000000000000000000000..5c038f955693debf9a819df96f8232dc4a73de57 --- /dev/null +++ b/assets/CronDashboard-B0sjsUM_.js @@ -0,0 +1,6 @@ +import{n as c,r,j as a,B as n,a5 as u}from"./index-D6jcIRWs.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 N=c("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]),f=r.forwardRef(({className:o,...e},t)=>a.jsx("div",{ref:t,className:n("rounded-lg border bg-card text-card-foreground shadow-sm",o),...e}));f.displayName="Card";const m=r.forwardRef(({className:o,...e},t)=>a.jsx("div",{ref:t,className:n("flex flex-col space-y-1.5 p-6",o),...e}));m.displayName="CardHeader";const p=r.forwardRef(({className:o,...e},t)=>a.jsx("h3",{ref:t,className:n("text-2xl font-semibold leading-none tracking-tight",o),...e}));p.displayName="CardTitle";const l=r.forwardRef(({className:o,...e},t)=>a.jsx("p",{ref:t,className:n("text-sm text-muted-foreground",o),...e}));l.displayName="CardDescription";const h=r.forwardRef(({className:o,...e},t)=>a.jsx("div",{ref:t,className:n("p-6 pt-0",o),...e}));h.displayName="CardContent";const C=r.forwardRef(({className:o,...e},t)=>a.jsx("div",{ref:t,className:n("flex items-center p-6 pt-0",o),...e}));C.displayName="CardFooter";const b=o=>`cron-status--${o}`,x=o=>`$${o.toFixed(2)}`,w=o=>x(o/1e6);function M(o){if(!o)return"Never";const e=new Date(o);if(Number.isNaN(e.getTime()))return o;const t=Date.now()-e.getTime(),s=Math.floor(t/6e4),i=Math.floor(t/36e5),d=Math.floor(t/864e5);return s<1?"Just now":s<60?`${s}m ago`:i<24?`${i}h ago`:d<7?`${d}d ago`:e.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}class g{constructor(e){this.request=e}getCronStatus(e=!1){const t=e?"?force_refresh=true":"";return this.request(`/cron/status${t}`,{cache:"no-store"})}getPaperMarkdownJobs(){return this.request("/cron/paper-markdown-jobs",{cache:"no-store"})}getAutonomousOperations(){return this.request("/admin/autonomous-operations",{cache:"no-store"})}setAutonomousManualMode(e,t,s){return this.request("/admin/autonomous-operations/manual-mode",{method:"PATCH",body:JSON.stringify({enabled:e,expected_revision:t,confirmation:s})})}setAutonomousOperator(e,t,s,i){return this.request(`/admin/autonomous-operations/operators/${e}`,{method:"PATCH",body:JSON.stringify({enabled:t,expected_revision:s,confirmation:i})})}qualifyAutonomousChatBaseline(e,t,s){return this.request("/admin/autonomous-operations/chat-baseline",{method:"POST",body:JSON.stringify({sha:e,expected_revision:t,confirmation:s})})}}const q=new g(u);export{f as C,N as S,x as a,m as b,p as c,l as d,h as e,M as f,w as g,q as o,b as t}; diff --git a/assets/CronDashboard-Ch03vo4I.js b/assets/CronDashboard-Ch03vo4I.js deleted file mode 100644 index d74bdf5a020bf23a57371bbe87da48bfc8ca182d..0000000000000000000000000000000000000000 --- a/assets/CronDashboard-Ch03vo4I.js +++ /dev/null @@ -1 +0,0 @@ -import{r as s,j as a,B as n,a3 as u}from"./index-CqKcHUvZ.js";const c=s.forwardRef(({className:o,...e},t)=>a.jsx("div",{ref:t,className:n("rounded-lg border bg-card text-card-foreground shadow-sm",o),...e}));c.displayName="Card";const f=s.forwardRef(({className:o,...e},t)=>a.jsx("div",{ref:t,className:n("flex flex-col space-y-1.5 p-6",o),...e}));f.displayName="CardHeader";const m=s.forwardRef(({className:o,...e},t)=>a.jsx("h3",{ref:t,className:n("text-2xl font-semibold leading-none tracking-tight",o),...e}));m.displayName="CardTitle";const p=s.forwardRef(({className:o,...e},t)=>a.jsx("p",{ref:t,className:n("text-sm text-muted-foreground",o),...e}));p.displayName="CardDescription";const l=s.forwardRef(({className:o,...e},t)=>a.jsx("div",{ref:t,className:n("p-6 pt-0",o),...e}));l.displayName="CardContent";const h=s.forwardRef(({className:o,...e},t)=>a.jsx("div",{ref:t,className:n("flex items-center p-6 pt-0",o),...e}));h.displayName="CardFooter";function y(o){if(!o)return"Never";const e=new Date(o);if(Number.isNaN(e.getTime()))return o;const t=Date.now()-e.getTime(),r=Math.floor(t/6e4),i=Math.floor(t/36e5),d=Math.floor(t/864e5);return r<1?"Just now":r<60?`${r}m ago`:i<24?`${i}h ago`:d<7?`${d}d ago`:e.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}class C{constructor(e){this.request=e}getCronStatus(e=!1){const t=e?"?force_refresh=true":"";return this.request(`/cron/status${t}`,{cache:"no-store"})}getPaperMarkdownJobs(){return this.request("/cron/paper-markdown-jobs",{cache:"no-store"})}getAutonomousOperations(){return this.request("/admin/autonomous-operations",{cache:"no-store"})}setAutonomousManualMode(e,t,r){return this.request("/admin/autonomous-operations/manual-mode",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:e,expected_revision:t,confirmation:r})})}setAutonomousOperator(e,t,r,i){return this.request(`/admin/autonomous-operations/operators/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:t,expected_revision:r,confirmation:i})})}qualifyAutonomousChatBaseline(e,t,r){return this.request("/admin/autonomous-operations/chat-baseline",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sha:e,expected_revision:t,confirmation:r})})}}const g=new C(u);export{c as C,f as a,m as b,p as c,l as d,y as f,g as o}; diff --git a/assets/CronDashboard-DPgNAdQz.js b/assets/CronDashboard-DPgNAdQz.js deleted file mode 100644 index d41bdd5b29c6e5179bcdbfa26a2b28a0bab82597..0000000000000000000000000000000000000000 --- a/assets/CronDashboard-DPgNAdQz.js +++ /dev/null @@ -1,36 +0,0 @@ -import{n as W,r as h,E as rs,v as ns,j as e,t as le,a6 as ts,R as is,I as cs,x as me,P as ls,z as ds,F as Re,B as A,f as Fe,L as xe,a as os,m as ms}from"./index-CqKcHUvZ.js";import{u as X}from"./useQuery-Cngk7eL9.js";import{f,C as v,a as b,b as y,c as q,d as _,o as ve}from"./CronDashboard-Ch03vo4I.js";import{B as S}from"./badge-D-oq0Pkj.js";import{B as C}from"./button-BYn4yUH_.js";import{C as us,a as hs}from"./chevron-up-CZWX0SDx.js";import{D as _e}from"./database-DrVmdfNa.js";import{T as xs}from"./trending-up-n0ivZSaN.js";import{A as ie}from"./activity-DDb7qU7w.js";import{F as fe}from"./file-text-DnNBEwSF.js";import{T as Te,I as ps}from"./triangle-alert-DM207o24.js";import{S as Ae}from"./shield-alert-B0VZio-w.js";import{E as ee}from"./external-link-CrrdDZf6.js";import{C as se,R as Ne}from"./refresh-cw-gVdSyglp.js";import{L as I}from"./loader-circle-CZgakNH7.js";import{C as pe}from"./circle-check-BYRHMG9x.js";import{u as D}from"./useMutation-BItMAQ7s.js";import{r as gs,f as js,h as vs,j as _s,p as fs,k as Ns,A as bs,l as ys}from"./codexAddEvals-BaTB12JK.js";import{u as ks}from"./useInfiniteQuery-lxaMAHEu.js";import{p as Ee}from"./paperEdits-BD6cBS3E.js";import{c as ue}from"./catalog-D26nGNnK.js";import{c as be}from"./chat-DGBJkcmd.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 ye=W("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** - * @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 ws=W("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** - * @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=W("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/** - * @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 Ss=W("CircleSlash2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}]]);/** - * @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=W("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/** - * @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=W("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** - * @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 Ls=W("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 de="Tabs",[Ps]=ds(de,[Re]),qe=Re(),[Rs,ge]=Ps(de),Ie=h.forwardRef((s,a)=>{const{__scopeTabs:n,value:t,onValueChange:i,defaultValue:d,orientation:p="horizontal",dir:N,activationMode:k="automatic",...m}=s,c=rs(N),[u,w]=ns({prop:t,onChange:i,defaultProp:d??"",caller:de});return e.jsx(Rs,{scope:n,baseId:ts(),value:u,onValueChange:w,orientation:p,dir:c,activationMode:k,children:e.jsx(le.div,{dir:c,"data-orientation":p,...m,ref:a})})});Ie.displayName=de;var De="TabsList",Oe=h.forwardRef((s,a)=>{const{__scopeTabs:n,loop:t=!0,...i}=s,d=ge(De,n),p=qe(n);return e.jsx(is,{asChild:!0,...p,orientation:d.orientation,dir:d.dir,loop:t,children:e.jsx(le.div,{role:"tablist","aria-orientation":d.orientation,...i,ref:a})})});Oe.displayName=De;var Je="TabsTrigger",Be=h.forwardRef((s,a)=>{const{__scopeTabs:n,value:t,disabled:i=!1,...d}=s,p=ge(Je,n),N=qe(n),k=We(p.baseId,t),m=ze(p.baseId,t),c=t===p.value;return e.jsx(cs,{asChild:!0,...N,focusable:!i,active:c,children:e.jsx(le.button,{type:"button",role:"tab","aria-selected":c,"aria-controls":m,"data-state":c?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:k,...d,ref:a,onMouseDown:me(s.onMouseDown,u=>{!i&&u.button===0&&u.ctrlKey===!1?p.onValueChange(t):u.preventDefault()}),onKeyDown:me(s.onKeyDown,u=>{[" ","Enter"].includes(u.key)&&p.onValueChange(t)}),onFocus:me(s.onFocus,()=>{const u=p.activationMode!=="manual";!c&&!i&&u&&p.onValueChange(t)})})})});Be.displayName=Je;var He="TabsContent",Ue=h.forwardRef((s,a)=>{const{__scopeTabs:n,value:t,forceMount:i,children:d,...p}=s,N=ge(He,n),k=We(N.baseId,t),m=ze(N.baseId,t),c=t===N.value,u=h.useRef(c);return h.useEffect(()=>{const w=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(w)},[]),e.jsx(ls,{present:i||c,children:({present:w})=>e.jsx(le.div,{"data-state":c?"active":"inactive","data-orientation":N.orientation,role:"tabpanel","aria-labelledby":k,hidden:!w,id:m,tabIndex:0,...p,ref:a,style:{...s.style,animationDuration:u.current?"0s":void 0},children:w&&d})})});Ue.displayName=He;function We(s,a){return`${s}-trigger-${a}`}function ze(s,a){return`${s}-content-${a}`}var Fs=Ie,Ge=Oe,Ke=Be,Qe=Ue;const Ts=Fs,Ve=h.forwardRef(({className:s,...a},n)=>e.jsx(Ge,{ref:n,className:A("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...a}));Ve.displayName=Ge.displayName;const G=h.forwardRef(({className:s,...a},n)=>e.jsx(Ke,{ref:n,className:A("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),...a}));G.displayName=Ke.displayName;const K=h.forwardRef(({className:s,...a},n)=>e.jsx(Qe,{ref:n,className:A("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...a}));K.displayName=Qe.displayName;function ce(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 Z(s){return s.replace(/_/g," ").replace(/\b\w/g,a=>a.toUpperCase())}const P=s=>`$${s.toFixed(2)}`;function ke({title:s,budget:a,profile:n}){const t=a.cost_policy==="unmetered_hf"||a.budget_enforced===!1,i=Math.min(100,a.current_exposure_usd/a.ceiling_usd*100),d=t?"Unmetered HF":a.affordable_jobs===0&&a.desired_jobs>0?"No shard fits":a.affordable_jobs0?"Now":"No scheduled admission"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"cron-label",children:"Unknown terminal reserve"}),e.jsxs("div",{children:[P(a.unknown_terminal_reservation_usd??0)," · ",(a.unknown_terminal_reservation_count??0).toLocaleString()," jobs"]})]})]}),n&&e.jsxs("div",{className:"text-xs cron-muted",children:["Profile ",e.jsx("strong",{children:n.profile_id})," · max ",n.max_papers.toLocaleString()," papers · hard ",ce(n.hard_timeout_seconds)," · soft ",ce(n.soft_deadline_seconds)]}),e.jsx("p",{className:"text-xs cron-muted",children:t?"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:pe,degraded:Te,broken:se,running:I,stuck:se,unknown:ws};function Es({status:s,isRunning:a}){const n=a?"running":s,t=As[n];return e.jsx(t,{className:`cron-status-icon cron-status--${n}${n==="running"?" animate-spin":""}`})}function we({label:s,axis:a}){return e.jsxs(S,{variant:"outline",className:`cron-status--${a.status}`,title:a.reason,children:[s,": ",a.status]})}function Ce({icon:s,title:a,metrics:n}){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:a})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:Object.entries(n).map(([t,i])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:Z(t)}),e.jsx("div",{className:"text-lg font-semibold",children:typeof i=="number"?i.toLocaleString():i})]},t))})]})}function Ms({workflow:s}){return e.jsxs("div",{children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(ie,{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",f(s.updated_at)]]:[]].map(([a,n])=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"cron-label",children:a}),e.jsx("span",{className:a==="Workflow"?"font-mono text-xs":void 0,children:n})]},a)),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(a=>e.jsx(S,{variant:"outline",className:"cron-status--broken",children:a},a))})]}),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(([a,n])=>e.jsxs(S,{variant:"outline",children:[a,": ",n??"running"]},a))})]}),(s.error||s.view_error)&&e.jsx("div",{className:"cron-message cron-message--error",children:s.error??s.view_error})]})]})}function qs(s){return s==="COMPLETED"?"cron-status--healthy":s==="ERROR"||s==="CANCELED"?"cron-status--broken":s==="RUNNING"?"cron-status--running":"cron-status--unknown"}function Se(s){return s==="success"?"cron-status--healthy":s==="partial"||s==="interrupted"?"cron-status--degraded":s==="infrastructure_failure"||s==="worker_failure"?"cron-status--broken":s==="active"?"cron-status--running":"cron-status--unknown"}function Is({job:s}){const a=s.progress,n=(a==null?void 0:a.omitted_images)??0,t=a!=null&&a.total_papers?Math.min(100,a.processed_papers/a.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(S,{variant:"outline",className:qs(s.stage),children:s.stage.toLowerCase()}),s.effective_outcome&&e.jsxs(S,{variant:"outline",className:Se(s.effective_outcome),children:["output: ",s.effective_outcome.replace(/_/g," ")]}),s.failure_cause&&e.jsxs(S,{variant:"outline",className:Se(s.effective_outcome),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(ee,{className:"h-4 w-4"})})]})]}),a?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:[a.processed_papers.toLocaleString()," / ",a.total_papers.toLocaleString()," papers"]}),e.jsxs("span",{children:[t.toFixed(0),"%"]})]}),e.jsx("div",{className:"cron-progress-track",children:e.jsx("div",{className:"cron-progress-value",style:{width:`${t}%`}})})]}),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:a.succeeded_papers.toLocaleString()})," succeeded"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.failed_papers.toLocaleString()})," failed"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.already_existed_papers.toLocaleString()})," skipped"]}),e.jsxs("span",{children:[e.jsx("strong",{children:a.extracted_images.toLocaleString()})," images"]})]}),n>0&&e.jsxs("div",{className:"text-xs cron-muted",children:[e.jsx("strong",{children:n.toLocaleString()})," unresolved image references omitted after final retry"]}),a.updated_at&&e.jsxs("div",{className:"text-xs cron-muted",children:["Progress updated ",f(a.updated_at)]}),(a.fatal_error||a.error_samples.length>0)&&e.jsxs("div",{className:"cron-message cron-message--error space-y-1",children:[a.fatal_error&&e.jsx("div",{children:a.fatal_error}),a.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 ",f(s.created_at)]}),s.duration_seconds!=null&&e.jsxs("span",{children:["Duration ",ce(s.duration_seconds)]})]}),s.stage_message&&e.jsx("div",{className:"cron-message cron-message--warning",children:s.stage_message})]})}function Ds({monitor:s,loading:a,error:n}){var t,i;return e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(ps,{className:"h-4 w-4"}),e.jsx("h4",{children:"Hugging Face OCR shards"})]}),a&&e.jsxs("div",{className:"cron-metric-card flex items-center gap-2 text-sm cron-muted",children:[e.jsx(I,{className:"h-4 w-4 animate-spin"})," Loading remote Jobs…"]}),!!n&&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:(t=s.selected_profiles)==null?void 0:t.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,p])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:Z(d)}),e.jsx("div",{className:"text-lg font-semibold",children:p.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(Is,{job:d},d.id))})]})]})}function Os({job:s,expanded:a,onToggle:n,paperMarkdownJobs:t,paperMarkdownJobsLoading:i=!1,paperMarkdownJobsError:d=null}){const p=!!(s.work_metrics&&Object.keys(s.work_metrics).length),N=!!(s.db_metrics&&Object.keys(s.db_metrics).length),k=s.job_name==="paper_markdown_backfill",m=k?t==null?void 0:t.budgets.live:void 0,c=(m==null?void 0:m.cost_policy)==="unmetered_hf"||(m==null?void 0:m.budget_enforced)===!1;return e.jsxs("div",{className:"cron-job-card",children:[e.jsx("button",{type:"button",className:"cron-job-summary",onClick:n,"aria-expanded":a,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(Es,{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(S,{variant:"outline",className:"text-[10px] uppercase tracking-wide",children:"Critical"}),s.lock_stale&&e.jsx(S,{variant:"outline",className:"cron-status--broken",children:"Held lock"}),e.jsx(we,{label:"Execution",axis:s.execution_health}),e.jsx(we,{label:"Output",axis:s.output_health}),a?e.jsx(us,{className:"h-4 w-4 cron-muted"}):e.jsx(hs,{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: ",f(s.last_run)]}),e.jsxs("span",{className:"cron-fact",children:[e.jsx(_e,{}),"DB: ",f(s.last_db_write)]}),s.recent_write_count!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(xs,{}),"Recent writes: ",s.recent_write_count.toLocaleString()]}),s.duration!=null&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(ie,{}),"Duration: ",ce(s.duration)]}),s.schedule&&e.jsxs("span",{className:"cron-fact md:col-span-2",children:[e.jsx(ye,{}),e.jsx("span",{className:"font-mono text-xs",children:s.schedule})]}),s.log_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(fe,{}),"Log status: ",s.log_status]}),s.workflow_status&&e.jsxs("span",{className:"cron-fact",children:[e.jsx(ie,{}),"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}),m&&e.jsxs("div",{className:`cron-message ${m.can_launch_planned?"":"cron-message--error"}`,children:[e.jsx("strong",{children:"Live GPU policy:"})," ",c?"unmetered on HF":`${P(m.current_exposure_usd)} current / ${P(m.ceiling_usd)} cap`," · ",m.affordable_jobs," of ",m.desired_jobs," planned",c?"":` · projects ${P(m.projected_usd)} · rolling 30 days`]})]})]}),e.jsx(S,{variant:"outline",className:`cron-status--${s.status}`,children:s.status})]})}),a&&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(ye,{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",f(s.execution_health.last_expected_at??null)],["Last started",f(s.execution_health.last_started_at??null)],["Last completed",f(s.execution_health.last_completed_at??null)],["Next expected",f(s.execution_health.next_expected_at??null)]].map(([u,w])=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"cron-label",children:u}),e.jsx("span",{children:w})]},u))})]}),s.work_metrics&&p&&e.jsx(Ce,{icon:fe,title:"Log Metrics",metrics:s.work_metrics}),s.db_metrics&&N&&e.jsx(Ce,{icon:_e,title:"Database Metrics",metrics:s.db_metrics}),s.workflow_status&&e.jsx(Ms,{workflow:s.workflow_status}),k&&e.jsx(Ds,{monitor:t,loading:i,error:d}),s.diagnostic_groups&&Object.values(s.diagnostic_groups).some(u=>u.length>0)&&e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(Te,{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(([,u])=>u.length>0).map(([u,w])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label mb-1",children:Z(u)}),e.jsx("ul",{className:"list-disc pl-4 text-sm space-y-1",children:w.map(E=>e.jsx("li",{children:E},E))})]},u))})]}),s.health_findings&&s.health_findings.some(u=>u.state!=="healthy")&&e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(Ae,{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(u=>u.state!=="healthy").map(u=>e.jsxs("div",{children:[e.jsx(S,{variant:"outline",className:`cron-status--${u.state}`,children:u.state})," ",e.jsx("strong",{children:Z(u.contract)}),": ",u.summary,Object.entries(u.evidence).length>0&&e.jsx("div",{className:"mt-1 text-xs cron-muted",children:Object.entries(u.evidence).map(([w,E])=>e.jsxs("span",{className:"mr-3",children:[Z(w),": ",String(E)]},w))})]},`${u.plane}-${u.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(ee,{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(ee,{className:"h-3.5 w-3.5"})]})]})]})]})]})})]})}const Ye=h.forwardRef(({className:s,...a},n)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:n,className:A("w-full caption-bottom text-sm",s),...a})}));Ye.displayName="Table";const Ze=h.forwardRef(({className:s,...a},n)=>e.jsx("thead",{ref:n,className:A("[&_tr]:border-b",s),...a}));Ze.displayName="TableHeader";const es=h.forwardRef(({className:s,...a},n)=>e.jsx("tbody",{ref:n,className:A("[&_tr:last-child]:border-0",s),...a}));es.displayName="TableBody";const Js=h.forwardRef(({className:s,...a},n)=>e.jsx("tfoot",{ref:n,className:A("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...a}));Js.displayName="TableFooter";const he=h.forwardRef(({className:s,...a},n)=>e.jsx("tr",{ref:n,className:A("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",s),...a}));he.displayName="TableRow";const Q=h.forwardRef(({className:s,...a},n)=>e.jsx("th",{ref:n,className:A("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...a}));Q.displayName="TableHead";const V=h.forwardRef(({className:s,...a},n)=>e.jsx("td",{ref:n,className:A("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...a}));V.displayName="TableCell";const Bs=h.forwardRef(({className:s,...a},n)=>e.jsx("caption",{ref:n,className:A("mt-4 text-sm text-muted-foreground",s),...a}));Bs.displayName="TableCaption";const ss={queued:"cron-status--unknown",dispatching:"cron-status--running",running:"cron-status--running",completed:"cron-status--healthy",failed:"cron-status--broken",canceled:"cron-status--unknown",awaiting_markdown:"cron-status--unknown"},as={queued:"queued",dispatching:"dispatching",running:"running",completed:"completed",failed:"failed",canceled:"canceled",awaiting_markdown:"waiting for Markdown"},$e={"add-evals":"Add evals","enrich-paper":"Enrich paper","resolve-model-paper":"Resolve model release","review-benchmark-gaps":"Review benchmark gaps","add-benchmark":"Add benchmark"},Hs={queued:$s,dispatching:I,running:Cs,completed:pe,failed:se,canceled:Ss,awaiting_markdown:Ls};function Us({status:s}){const a=Hs[s];return e.jsxs(S,{variant:"outline",className:ss[s],children:[e.jsx(a,{className:`mr-1 h-3.5 w-3.5 ${s==="dispatching"?"animate-spin":""}`}),as[s]]})}function Ws(s){return s.status==="awaiting_markdown"?bs: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 Le({mutationResult:s}){const a=s==null?void 0:s.skipped_configured_leaderboards;return!Array.isArray(a)||a.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 (",a.length,")"]}),e.jsx("ul",{className:"mt-1 list-disc space-y-1 pl-4",children:a.map((n,t)=>e.jsxs("li",{children:[n.benchmark," · ",n.disposition," · task ",n.task_id," / dataset ",n.dataset_id,n.metric?` / ${n.metric}`:"",n.value!=null?` = ${n.value}`:"",n.detail?` — ${n.detail}`:""]},t))})]})}function zs({autoRefresh:s,refreshToken:a}){var te;const n=Fe(),[t,i]=h.useState(""),[d,p]=h.useState(""),[N,k]=h.useState(""),[m,c]=h.useState(""),[u,w]=h.useState(""),[E,g]=h.useState({}),j={trigger:t,status:d,policy_version:N,cohort_date:m,review_status:u},{data:x,isLoading:R,isFetching:oe,error:L}=X({queryKey:["codexPaperJobs",a,j],queryFn:()=>ys(100,j),refetchInterval:s?1e4:!1,retry:!1}),F=()=>n.invalidateQueries({queryKey:["codexPaperJobs"]}),Y=D({mutationFn:gs,onSuccess:F}),je=D({mutationFn:js,onSuccess:F}),ae=D({mutationFn:vs,onSuccess:F}),re=D({mutationFn:_s,onSuccess:F}),J=D({mutationFn:({id:r,dataset:o,task:T,metric:z})=>fs(r,{dataset_id:Number(o),task_id:Number(T),best_metric:z.trim()}),onSuccess:F}),B=D({mutationFn:Ns,onSuccess:F}),ne=L&&typeof L=="object"&&"status"in L?L.status:void 0;return e.jsxs(v,{className:"mb-8",children:[e.jsx(b,{children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(y,{className:"text-xl",children:"Codex paper jobs"}),e.jsx(q,{children:"Durable queue, two-stage daily workflows, traces, and benchmark-gap follow-up"})]}),oe&&!R&&e.jsxs("span",{className:"flex items-center gap-2 text-xs cron-muted",children:[e.jsx(I,{className:"h-3.5 w-3.5 animate-spin"})," Syncing with Hugging Face"]})]})}),e.jsxs(_,{children:[R&&e.jsxs("div",{className:"flex items-center justify-center py-10 cron-muted",children:[e.jsx(I,{className:"mr-2 h-5 w-5 animate-spin"})," Loading paper jobs…"]}),L&&ne!==404&&e.jsx("div",{className:"cron-message cron-message--error mb-4",children:L instanceof Error?L.message:"Could not load Codex paper jobs."}),ne===404&&e.jsx("p",{className:"py-4 text-sm cron-muted",children:"Codex paper jobs are not enabled in this environment."}),x&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:`cron-message mb-5 ${x.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: ",x.scheduler.paused_at?"paused":x.scheduler.dispatch_enabled?"enabled":"disabled"]}),x.scheduler.pause_reason&&e.jsx("div",{className:"mt-1 text-xs",children:x.scheduler.pause_reason}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Canary ",x.scheduler.canary_released?"released":"active"," · Queue age ",x.scheduler.queue_age_level]}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Scheduled usage today ",x.scheduler.usage.current_day_tokens.toLocaleString()," tokens · ",x.scheduler.usage.mode==="enforced"?`pause threshold ${((te=x.scheduler.usage.pause_threshold_tokens)==null?void 0:te.toLocaleString())??"not established"}`:"first-week alert-only baseline"," · trailing median ",x.scheduler.usage.trailing_seven_day_median_tokens.toLocaleString()]})]}),e.jsx(C,{size:"sm",variant:x.scheduler.paused_at||!x.scheduler.dispatch_enabled?"default":"outline",disabled:re.isPending,onClick:()=>re.mutate(x.scheduler.paused_at||!x.scheduler.dispatch_enabled?"resume":"pause"),children:x.scheduler.paused_at?"Acknowledge & resume":x.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(r=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label capitalize",children:as[r]}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:x.summary[r]})]},r)),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:x.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:r=>i(r.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:d,onChange:r=>p(r.target.value),children:[e.jsx("option",{value:"",children:"All statuses"}),Object.keys(ss).map(r=>e.jsx("option",{children:r},r))]}),e.jsx("input",{"aria-label":"Policy version",className:"rounded border px-2 py-1 text-sm",placeholder:"Policy version",value:N,onChange:r=>k(r.target.value)}),e.jsx("input",{"aria-label":"Cohort date",type:"date",className:"rounded border px-2 py-1 text-sm",value:m,onChange:r=>c(r.target.value)}),e.jsxs("select",{"aria-label":"Review status",className:"rounded border px-2 py-1 text-sm",value:u,onChange:r=>w(r.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"})]})]}),x.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(he,{children:[e.jsx(Q,{children:"Status"}),e.jsx(Q,{children:"Paper"}),e.jsx(Q,{children:"Action"}),e.jsx(Q,{children:"Requested"}),e.jsx(Q,{children:"Execution"})]})}),e.jsx(es,{children:x.jobs.map(r=>{const o=Ws(r);return e.jsxs(he,{children:[e.jsx(V,{className:"align-top",children:e.jsx(Us,{status:r.status})}),e.jsx(V,{className:"min-w-[260px] align-top",children:r.paper_route?e.jsxs(e.Fragment,{children:[e.jsx(xe,{to:`/paper/${encodeURIComponent(r.paper_route)}`,className:"font-medium hover:underline",children:r.paper_title}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Paper #",r.paper_id]})]}):r.kind==="review-benchmark-gaps"?e.jsx("span",{className:"font-medium",children:"Benchmark-gap backlog"}):r.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:r.benchmark_candidate_id})]}):r.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 ",r.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 ",r.candidate_id]})]})}),e.jsxs(V,{className:"whitespace-nowrap align-top",children:[$e[r.kind],r.applied_at&&e.jsxs("div",{className:"mt-1 flex items-center gap-1 text-xs cron-status--healthy",children:[e.jsx(pe,{className:"h-3.5 w-3.5"})," Applied"]})]}),e.jsxs(V,{className:"whitespace-nowrap align-top",children:[e.jsx("div",{children:f(r.created_at)}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["@",r.requested_by]})]}),e.jsxs(V,{className:"max-w-[360px] align-top",children:[r.hf_job_url?e.jsxs("a",{href:r.hf_job_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 hover:underline",children:["Hugging Face Job ",e.jsx(ee,{className:"h-3.5 w-3.5"})]}):e.jsx("span",{className:"cron-muted",children:"Waiting to dispatch"}),o&&e.jsx("p",{className:`mt-2 line-clamp-3 text-xs ${r.error&&r.status!=="awaiting_markdown"?"text-red-700":"cron-muted"}`,title:o,children:o}),e.jsx(Le,{mutationResult:r.mutation_result}),e.jsxs("div",{className:"mt-2 flex gap-2",children:[["failed","canceled"].includes(r.status)&&e.jsx(C,{size:"sm",variant:"outline",onClick:()=>Y.mutate(r.id),children:"Retry"}),["queued","awaiting_markdown","dispatching","running"].includes(r.status)&&e.jsx(C,{size:"sm",variant:"outline",onClick:()=>je.mutate(r.id),children:"Cancel"}),r.trace_status==="finalize_failed"&&e.jsx(C,{size:"sm",variant:"outline",onClick:()=>ae.mutate(r.id),children:"Retry trace"})]})]})]},r.id)})})]}),x.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"}),x.workflows.map(r=>e.jsxs("details",{className:"rounded-md border p-3",children:[e.jsxs("summary",{className:"cursor-pointer text-sm font-medium",children:["Paper #",r.paper_id," · ",r.cohort_date," · ",r.status," · ",r.policy_version]}),e.jsxs("div",{className:"mt-3 space-y-3 text-xs",children:[r.error&&e.jsx("div",{className:"text-red-700",children:r.error}),r.stages.map(o=>{var T;return e.jsxs("div",{className:"rounded border p-3",children:[e.jsxs("div",{className:"font-medium",children:[$e[o.kind]," · ",o.status," · trace ",o.trace_status," · review ",o.audit_status]}),e.jsxs("div",{className:"mt-1 cron-muted",children:["model ",o.model??"—"," · reasoning ",o.reasoning_effort??"—"," · tokens ",(o.input_tokens??0)+(o.output_tokens??0)," · duration ",o.duration_ms??0," ms · attempts ",o.attempt_count]}),o.error&&e.jsx("div",{className:"mt-2 text-red-700",children:o.error}),o.report&&e.jsx("div",{className:"mt-2 whitespace-pre-wrap rounded border p-2",children:o.report}),o.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(o.url_candidates,null,2)})]}),o.validation_summary&&e.jsx("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap",children:JSON.stringify(o.validation_summary,null,2)}),Array.isArray((T=o.validation_summary)==null?void 0:T.manual_or_legacy_evaluation_rows_affected)&&o.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: ",o.validation_summary.manual_or_legacy_evaluation_rows_affected.join(", "),". Review the evidence and before/after diff."]}),o.proposal&&e.jsx("pre",{className:"mt-2 max-h-52 overflow-auto whitespace-pre-wrap",children:JSON.stringify(o.proposal,null,2)}),e.jsx(Le,{mutationResult:o.mutation_result}),o.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(o.mutation_result,null,2)})]}),o.trace_status==="complete"&&e.jsxs("a",{className:"mt-2 inline-flex items-center gap-1 hover:underline",href:`/api/v1/admin/codex-curation/jobs/${o.id}/trace`,target:"_blank",rel:"noreferrer",children:["Authenticated trace manifest ",e.jsx(ee,{className:"h-3.5 w-3.5"})]})]},o.id)})]})]},r.id))]}),x.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"}),x.benchmark_candidates.map(r=>{var z,H;const o=E[r.id]??{dataset:"",task:((z=r.task_ids[0])==null?void 0:z.toString())??"",metric:""},T=Number(o.dataset)>0&&Number(o.task)>0&&o.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:[r.canonical_name," · ",r.gap_type," · ",r.status]}),e.jsxs("div",{className:"cron-muted",children:[r.distinct_paper_count," paper",r.distinct_paper_count===1?"":"s"," · ",r.confidence??"unknown"," confidence"]})]}),r.canonical_url&&e.jsx("a",{className:"mt-1 block hover:underline",href:r.canonical_url,target:"_blank",rel:"noreferrer",children:r.canonical_url}),e.jsxs("div",{className:"mt-1 cron-muted",children:["Task evidence: ",r.task_ids.join(", ")||"none"," · Papers: ",r.evidence_paper_ids.join(", ")]}),r.review_reason&&e.jsxs("div",{className:"mt-1",children:["Review",r.reviewed_at?` ${f(r.reviewed_at)}`:"",": ",r.review_reason,r.deferred_until&&` · deferred until ${f(r.deferred_until)}`]}),r.resolution&&e.jsxs("div",{className:"mt-1 cron-muted",children:["Dataset #",r.resolution.dataset_id," · task #",r.resolution.task_id," · ",r.resolution.primary_metric,r.resolution.rolled_back_at&&` · rolled back ${f(r.resolution.rolled_back_at)}`]}),r.status==="promoted"&&((H=r.resolution)==null?void 0:H.created)&&!r.resolution.rolled_back_at&&e.jsx(C,{className:"mt-2",size:"sm",variant:"outline",disabled:B.isPending,onClick:()=>B.mutate(r.id),children:"Roll back automatic benchmark"}),!["promoted","merged"].includes(r.status)&&e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[["dataset","task","metric"].map(O=>e.jsx("input",{"aria-label":`${r.canonical_name} ${O}`,className:"w-36 rounded border px-2 py-1",placeholder:O==="metric"?"Exact metric":`${O} ID`,value:o[O],onChange:l=>g(M=>({...M,[r.id]:{...o,[O]:l.target.value}}))},O)),e.jsx(C,{size:"sm",variant:"outline",disabled:!T||J.isPending,onClick:()=>J.mutate({id:r.id,...o}),children:"Promote & requeue evidence papers"})]})]},r.id)}),J.error&&e.jsx("div",{className:"cron-message cron-message--error",children:J.error.message}),B.error&&e.jsx("div",{className:"cron-message cron-message--error",children:B.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 ",f(x.timestamp)]})]})]})]})}function Gs(){const[s,a]=h.useState(()=>new Date().toISOString().slice(0,10)),[n,t]=h.useState(1),i=X({queryKey:["paper-edit-digest",s,n],queryFn:()=>Ee.digest(s,n),enabled:!!s});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=>{a(d.target.value),t(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,p)=>e.jsxs("li",{children:[e.jsxs(xe,{className:"underline",to:`/paper/${d.paper_id}`,children:["Paper ",d.paper_id]})," · @",d.actor_username??"admin"," · ",d.edits," changes"]},p))}),e.jsxs("div",{className:"flex gap-2",children:[n>1&&e.jsx(C,{variant:"outline",onClick:()=>t(n-1),children:"Previous"}),i.data.has_more&&e.jsx(C,{variant:"outline",onClick:()=>t(n+1),children:"Next"})]})]})]})}const Ks=()=>{var p,N,k,m;const s=Fe(),a=ks({queryKey:["catalog-audit"],queryFn:({pageParam:c})=>ue.audit(c),initialPageParam:void 0,getNextPageParam:c=>c.next_cursor??void 0}),n=((p=a.data)==null?void 0:p.pages.flatMap(c=>c.events))??[],t=D({mutationFn:()=>ue.acknowledgeAudit(),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})}),i=D({mutationFn:c=>ue.rollbackEvent(c),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})}),d=D({mutationFn:({subject:c,suspended:u})=>Ee.suspend(c,u),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})});return e.jsxs("div",{className:"space-y-4",children:[e.jsx(Gs,{}),(i.error||d.error)&&e.jsx("p",{role:"alert",children:(N=i.error||d.error)==null?void 0:N.message}),e.jsxs(v,{children:[e.jsxs(b,{className:"flex-row items-center justify-between",children:[e.jsx(y,{children:"Catalog mutation audit"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm font-medium",children:[((m=(k=a.data)==null?void 0:k.pages[0])==null?void 0:m.unread_contributor_count)??0," unread contributor changes"]}),e.jsx(C,{variant:"outline",size:"sm",onClick:()=>t.mutate(),disabled:t.isPending,children:"Mark read"})]})]}),e.jsxs(_,{className:"space-y-3",children:[a.isLoading&&e.jsx("p",{children:"Loading audit history…"}),a.error&&e.jsx("p",{className:"text-destructive",children:"Audit history unavailable."}),n.map(c=>e.jsxs("article",{className:`rounded-md border p-3 ${c.operation==="delete"||c.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:[c.operation," ",c.entity_type," ",c.entity_id]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["@",c.actor_username??c.actor_role," ·"," ",new Date(c.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:c.before,after:c.after},null,2)})]}),c.actor_role==="contributor"&&c.actor_hf_subject&&e.jsx(C,{className:"mt-3 mr-2",variant:"outline",size:"sm",disabled:d.isPending,onClick:()=>d.mutate({subject:c.actor_hf_subject,suspended:!c.editing_suspended}),children:c.editing_suspended?"Restore editing access":"Suspend editing access"}),!c.rollback_of_event_id&&e.jsx(C,{className:"mt-3",variant:"outline",size:"sm",onClick:()=>i.mutate(c.id),disabled:i.isPending||c.rollback_eligible===!1,children:c.rollback_eligible===!1?"Rollback conflict":"Roll back if unchanged"})]},c.id)),a.hasNextPage&&e.jsx(C,{variant:"outline",onClick:()=>a.fetchNextPage(),disabled:a.isFetchingNextPage,children:a.isFetchingNextPage?"Loading…":"Load older events"})]})]})]})},Pe={hourly:"cron-status--running",daily:"cron-status--healthy",weekly:"cron-status--degraded",systemd:"cron-status--running"},$=s=>`$${(s/1e6).toFixed(2)}`,Qs=({data:s,loading:a,error:n})=>{const[t,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(a)return e.jsxs("div",{className:"flex items-center py-12",children:[e.jsx(I,{className:"h-6 w-6 animate-spin mr-3"}),"Loading chat compute…"]});if(n||!s)return e.jsx(v,{className:"cron-status--broken",children:e.jsx(_,{className:"pt-6",children:"Chat compute accounting is unavailable."})});const p=Math.min(100,s.effective_microusd/s.application_cap_microusd*100),N=s.circuit_state==="tripped"?"Chat disabled":s.circuit_state==="warning"?"Operator warning":"Enabled",k=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(v,{className:s.circuit_state==="tripped"?"cron-status--broken":s.circuit_state==="warning"?"cron-status--degraded":"",children:[e.jsx(b,{children:e.jsx(y,{className:"text-sm",children:"Circuit"})}),e.jsxs(_,{children:[e.jsx("div",{className:"text-2xl font-bold",children:N}),e.jsx("p",{className:"text-xs cron-muted",children:s.trip_reason??"Policy armed"})]})]}),e.jsxs(v,{children:[e.jsx(b,{children:e.jsx(y,{className:"text-sm",children:"Month to date"})}),e.jsxs(_,{children:[e.jsx("div",{className:"text-2xl font-bold",children:$(s.effective_microusd)}),e.jsx("div",{role:"progressbar","aria-label":"Application cap used","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(p),className:"h-2 rounded bg-muted mt-3",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${p}%`}})})]})]}),e.jsxs(v,{children:[e.jsx(b,{children:e.jsx(y,{className:"text-sm",children:"Application headroom"})}),e.jsxs(_,{children:[e.jsx("div",{className:"text-2xl font-bold",children:$(s.remaining_microusd)}),e.jsxs("p",{className:"text-xs cron-muted",children:["Cap ",$(s.application_cap_microusd)]})]})]}),e.jsxs(v,{children:[e.jsx(b,{children:e.jsx(y,{className:"text-sm",children:"Live compute"})}),e.jsxs(_,{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(v,{children:[e.jsxs(b,{children:[e.jsx(y,{children:"Accounting and policy"}),e.jsxs(q,{children:[s.environment," · cycle ",s.billing_cycle]})]}),e.jsxs(_,{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:t,onChange:m=>i(m.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[t]," · Workspace $250"]})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Conservative estimate"}),e.jsx("br",{}),$(s.estimated_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider-reported floor"}),e.jsx("br",{}),$(s.provider_floor_microusd)," · ",e.jsx(S,{children:k})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider backstops"}),e.jsx("br",{}),s.environment_cap_microusd===null?"Starter: no Environment cap":`Environment ${$(s.environment_cap_microusd)}`," · Workspace ",$(s.workspace_cap_microusd)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Active thresholds"}),e.jsx("br",{}),"Warning ",$(s.warning_microusd)," · trip ",$(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",{}),f(s.cycle_end_at)]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Last metered"}),e.jsx("br",{}),s.last_metered_at?f(s.last_metered_at):"Unavailable"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Provider reconciliation"}),e.jsx("br",{}),s.last_reconciled_at?f(s.last_reconciled_at):"Unavailable",s.last_reconciliation_attempt_at?` · attempted ${f(s.last_reconciliation_attempt_at)}`:"",s.next_reconciliation_at?` · next ${f(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":`${$(s.burn_rate_microusd_per_hour)}/hour${s.projected_cap_hit_at?` · cap ${f(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} · ${$(s.prior_cycle.effective_microusd)}`:"Not enough data"]})]})]}),e.jsxs(v,{children:[e.jsx(b,{children:e.jsx(y,{children:"Live lifecycle"})}),e.jsx(_,{className:"text-sm",children:Object.entries(s.live_states).map(([m,c])=>e.jsxs("span",{className:"mr-4",children:[m,": ",c]},m))})]}),e.jsxs(v,{children:[e.jsx(b,{children:e.jsx(y,{children:"Daily spend"})}),e.jsx(_,{children:s.daily_spend.length?e.jsx("ul",{className:"space-y-1 text-sm",children:s.daily_spend.map(m=>e.jsxs("li",{children:[m.date,": blank ",$(m.blank_pool_microusd)," · assigned ",$(m.assigned_microusd)]},m.date))}):e.jsx("p",{className:"cron-muted",children:"No compute recorded in this cycle."})})]}),e.jsxs(v,{children:[e.jsxs(b,{children:[e.jsx(y,{children:"Recent circuit events"}),e.jsx(q,{children:"Runbook: docs/chat-sandbox-spend-runbook.md"})]}),e.jsx(_,{children:s.events.length?e.jsx("ul",{className:"space-y-2 text-sm",children:s.events.map(m=>e.jsxs("li",{children:[e.jsx(S,{children:m.severity})," ",m.type," · ",f(m.created_at)]},m.id))}):e.jsx("p",{className:"cron-muted",children:"No events in this cycle."})})]})]})},Vs=({data:s,loading:a,error:n})=>{if(a)return e.jsxs("div",{className:"flex items-center py-8",children:[e.jsx(I,{className:"h-5 w-5 animate-spin mr-3"}),"Loading web-search budget…"]});if(n||!s)return e.jsx(v,{className:"cron-status--broken",children:e.jsx(_,{className:"pt-6",children:"Web-search budget accounting is unavailable."})});const t=Math.min(100,s.call_count/s.hard_limit_calls*100);return e.jsxs(v,{className:s.circuit_state==="tripped"?"cron-status--broken":s.circuit_state==="warning"||s.circuit_state==="cooldown"?"cron-status--degraded":"",children:[e.jsxs(b,{children:[e.jsx(y,{children:"Web search"}),e.jsxs(q,{children:[s.environment," · UTC cycle ",s.billing_cycle," · provider details are admin-only"]})]}),e.jsxs(_,{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(t),className:"h-2 rounded bg-muted",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${t}%`}})}),e.jsxs("p",{className:"text-xs cron-muted",children:["Cycle ends ",f(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 ${f(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," · ",f(i.created_at),i.error_class?` · ${i.error_class}`:""]},i.id))})]})]})},Xs=({data:s})=>s!=null&&s.snapshot_stale?e.jsx(v,{className:"mb-6 cron-status--degraded",role:"status",children:e.jsx(_,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[e.jsx(I,{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,Ys=(s,a)=>s!=null&&s.snapshot_stale||s!=null&&s.refreshing?5e3:a?3e4:!1,Na=()=>{const s=ms(),[a,n]=h.useState(!0),[t,i]=h.useState(!1),[d,p]=h.useState(0),[N,k]=h.useState(""),[m,c]=h.useState(""),[u,w]=h.useState(new Set),E=h.useRef(!1),{user:g}=os(),{data:j,isLoading:x,error:R,refetch:oe}=X({queryKey:["cronStatus",g==null?void 0:g.username],queryFn:()=>{const l=E.current;return E.current=!1,ve.getCronStatus(l)},enabled:!!(g!=null&&g.is_admin),refetchInterval:l=>Ys(l.state.data,a),retry:!1}),L=X({queryKey:["paperMarkdownJobs",g==null?void 0:g.username],queryFn:()=>ve.getPaperMarkdownJobs(),enabled:!!(g!=null&&g.is_admin),refetchInterval:a?3e4:!1,retry:!1}),F=X({queryKey:["chatSandboxSpend",g==null?void 0:g.username,m],queryFn:()=>be.getSandboxSpend(m||void 0),enabled:!!(g!=null&&g.is_admin),refetchInterval:a?3e4:!1,retry:!1}),Y=X({queryKey:["chatWebSearchBudget",g==null?void 0:g.username],queryFn:()=>be.getWebSearchBudget(),enabled:!!(g!=null&&g.is_admin)&&s,refetchInterval:a?3e4:!1,retry:!1}),ae=(R&&typeof R=="object"&&"status"in R?R.status:void 0)===401?"Unauthorized. Sign in with an allowlisted Hugging Face admin account.":R instanceof Error?R.message:void 0,re=l=>{w(M=>{const U=new Set(M);return U.has(l)?U.delete(l):U.add(l),U})},J=(j==null?void 0:j.jobs.filter(l=>l.dashboard_group==="leaderboard_sync"))??[],B=(j==null?void 0:j.jobs.filter(l=>l.category!=="manual"&&l.dashboard_group!=="leaderboard_sync"))??[],ne=B.filter(l=>l.critical),te=B.filter(l=>!l.critical),r=(j==null?void 0:j.manual_operations)??[],o=!!(x||t||j!=null&&j.refreshing),T=te.reduce((l,M)=>(l[M.category]||(l[M.category]=[]),l[M.category].push(M),l),{}),z=Object.keys(T).sort((l,M)=>{const U=["systemd","hourly","daily","weekly","backfill"];return U.indexOf(l)-U.indexOf(M)}),H=l=>e.jsx(Os,{job:l,expanded:u.has(l.job_name),onToggle:()=>re(l.job_name),paperMarkdownJobs:l.job_name==="paper_markdown_backfill"?L.data:void 0,paperMarkdownJobsLoading:l.job_name==="paper_markdown_backfill"?L.isLoading:!1,paperMarkdownJobsError:l.job_name==="paper_markdown_backfill"?L.error:null},l.job_name),O=async()=>{p(l=>l+1),E.current=!0,i(!0);try{await Promise.all([oe(),L.refetch(),F.refetch()])}finally{i(!1)}};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(ie,{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(C,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(xe,{to:"/autonomous-operations",children:"Autonomous operations"})}),e.jsxs(C,{variant:"outline",size:"sm",onClick:()=>n(!a),className:a?"cron-status--running":"",children:[e.jsx(Ne,{className:`h-4 w-4 mr-2 ${a?"animate-spin":""}`}),"Auto-refresh ",a?"ON":"OFF"]}),e.jsxs(C,{variant:"outline",size:"sm",onClick:()=>void O(),disabled:o,children:[e.jsx(Ne,{className:`h-4 w-4 mr-2 ${o?"animate-spin":""}`}),"Refresh"]})]})]})}),e.jsx(v,{className:"mb-6",children:e.jsx(_,{className:"pt-6",children:e.jsxs("p",{className:"text-sm cron-muted",children:["Signed in as ",e.jsxs("span",{className:"font-semibold",children:["@",g==null?void 0:g.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(Xs,{data:j}),e.jsxs(Ts,{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(G,{value:"critical-jobs",children:"Critical Jobs"}),e.jsx(G,{value:"leaderboard-syncs",children:"Leaderboard Syncs"}),e.jsx(G,{value:"codex-paper-jobs",children:"Codex Paper Jobs"}),e.jsx(G,{value:"catalog-audit",children:"Catalog Audit"}),e.jsx(G,{value:"chat-compute",children:"Chat Compute"})]}),e.jsxs(K,{value:"critical-jobs",className:"mt-6",children:[x&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(I,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading CRON jobs status..."})]}),R&&e.jsx(v,{className:"cron-status--broken",children:e.jsx(_,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(se,{className:"h-5 w-5"}),e.jsx("p",{children:ae??"Failed to load CRON jobs status. Please try again."})]})})}),j&&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(l=>e.jsxs(v,{children:[e.jsx(b,{className:"pb-2",children:e.jsx(y,{className:"text-sm font-medium cron-muted capitalize",children:l})}),e.jsx(_,{children:e.jsx("div",{className:"text-2xl font-bold",children:j.summary[l]})})]},l))}),j.summary.critical_issues.length>0&&e.jsxs(v,{className:"mb-6 cron-status--broken",children:[e.jsx(b,{children:e.jsxs(y,{className:"flex items-center gap-2",children:[e.jsx(Ae,{className:"h-5 w-5"}),"Critical job issues"]})}),e.jsx(_,{children:e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm",children:j.summary.critical_issues.map(l=>e.jsx("li",{children:l},l))})})]}),e.jsxs(v,{className:"mb-8",children:[e.jsx(b,{children:e.jsx(y,{className:"text-base",children:"What to check next"})}),e.jsxs(_,{children:[e.jsx("p",{className:"text-sm cron-muted",children:j.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: ",f(j.timestamp)," · Health score:"," ",j.summary.health_score.toFixed(0),"%"]})]})]}),e.jsxs(v,{className:`mb-8 ${j.summary.coverage.coverage_gaps?"cron-status--broken":""}`,children:[e.jsxs(b,{children:[e.jsx(y,{className:"text-base",children:"Coverage"}),e.jsx(q,{children:"Registry and deployed scheduler inventory"})]}),e.jsxs(_,{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:j.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:j.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:j.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:j.summary.coverage.coverage_gaps})]})]})]}),e.jsxs(v,{className:"mb-8",children:[e.jsxs(b,{children:[e.jsx(y,{className:"text-xl",children:"Critical jobs"}),e.jsx(q,{children:"Writers whose stale output breaks the live site"})]}),e.jsx(_,{className:"space-y-4",children:ne.map(H)})]}),e.jsx("div",{className:"space-y-6",children:z.map(l=>e.jsxs(v,{children:[e.jsx(b,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(y,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(S,{className:Pe[l]??Pe.hourly,children:l}),e.jsx("span",{children:"Supporting jobs"})]}),e.jsxs(q,{children:[T[l].length," job",T[l].length!==1?"s":""]})]})}),e.jsx(_,{className:"space-y-4",children:T[l].map(H)})]},l))}),r.length>0&&e.jsxs(v,{className:"mt-6",children:[e.jsxs(b,{children:[e.jsx(y,{className:"text-xl",children:"Manual operations"}),e.jsx(q,{children:"Visible invocation history; excluded from scheduled health and coverage"})]}),e.jsx(_,{className:"space-y-4",children:r.map(H)})]})]})]}),e.jsxs(K,{value:"leaderboard-syncs",className:"mt-6",children:[x&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(I,{className:"h-8 w-8 animate-spin cron-info-text"}),e.jsx("span",{className:"ml-3 cron-muted",children:"Loading leaderboard sync status..."})]}),R&&e.jsx(v,{className:"cron-status--broken",children:e.jsx(_,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(se,{className:"h-5 w-5"}),e.jsx("p",{children:ae??"Failed to load leaderboard sync status. Please try again."})]})})}),j&&e.jsxs(v,{children:[e.jsx(b,{children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(y,{className:"text-xl",children:"Leaderboard syncs"}),e.jsx(q,{children:"Recurring imports from externally maintained benchmark leaderboards"})]}),e.jsxs(S,{children:[J.length," jobs"]})]})}),e.jsx(_,{className:"space-y-4",children:J.map(H)})]})]}),e.jsx(K,{value:"codex-paper-jobs",className:"mt-6",children:e.jsx(zs,{autoRefresh:a,refreshToken:d})}),e.jsx(K,{value:"catalog-audit",className:"mt-6",children:e.jsx(Ks,{})}),e.jsxs(K,{value:"chat-compute",className:"mt-6",children:[e.jsxs(v,{className:"mb-6",children:[e.jsxs(b,{children:[e.jsx(y,{children:"Environment record"}),e.jsx(q,{children:"Leave blank for live staging, or enter the isolated environment printed by the spend qualification command."})]}),e.jsxs(_,{className:"flex gap-2",children:[e.jsx("input",{"aria-label":"Chat compute environment record",value:N,onChange:l=>k(l.target.value),placeholder:"staging-q-example",className:"flex-1 rounded border px-3 py-2"}),e.jsx(C,{onClick:()=>c(N.trim()),children:"Load"})]})]}),e.jsx(Qs,{data:F.data,loading:F.isLoading,error:F.error}),s&&e.jsx("div",{className:"mt-6",children:e.jsx(Vs,{data:Y.data,loading:Y.isLoading,error:Y.error})})]})]})]})})};export{Qs as ChatComputePanel,Xs as CronSnapshotNotice,Ys as cronStatusRefetchInterval,Na as default}; diff --git a/assets/CronDashboard-DZ_espzl.js b/assets/CronDashboard-DZ_espzl.js new file mode 100644 index 0000000000000000000000000000000000000000..f5ecf91373da882d5c7e27344bba786545aecaa1 --- /dev/null +++ b/assets/CronDashboard-DZ_espzl.js @@ -0,0 +1,36 @@ +import{n as D,r as x,F as is,v as cs,j as e,t as ie,a8 as ls,R as ds,I as os,x as oe,P as ms,z as us,G as Re,B as $,f as xe,A as Te,L as pe,a as hs,m as xs}from"./index-D6jcIRWs.js";import{u as z}from"./useQuery-CUJUm4FY.js";import{u as L}from"./useMutation-p6mN4h17.js";import{t as ge,f as v,a as S,S as Ae,o as ue,C as g,b as f,c as N,d as P,e as j,g as C}from"./CronDashboard-B0sjsUM_.js";import{B as I}from"./badge-t4oak8yc.js";import{B as y}from"./button-Bzx0ccHH.js";import{C as ps,a as gs}from"./chevron-up-CQKUhZ0S.js";import{D as fe}from"./database-DKdKRr_t.js";import{T as js}from"./trending-up-DqN3HzZ5.js";import{A as ne}from"./activity-5IcAhZoH.js";import{F as Ne}from"./file-text-4G2I5_Zo.js";import{T as Ee,I as vs}from"./triangle-alert-Cypc2KaL.js";import{E as X}from"./external-link-C_yz2sXa.js";import{C as Y,R as be}from"./refresh-cw-Qmu3JZxd.js";import{L as R}from"./loader-circle-BuDrH29B.js";import{C as je}from"./circle-check-BZn9Lr76.js";import{c as E,A as _s}from"./codex-P8vYbo4B.js";import{u as fs}from"./useInfiniteQuery-FXco4P1n.js";import{p as Me}from"./paperEdits-DUTCoe5T.js";import{c as me}from"./catalog-PYrB8_bm.js";import{c as ye}from"./chat-ChnK8XDU.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 we=D("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** + * @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=D("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** + * @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 bs=D("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/** + * @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 ys=D("CircleSlash2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}]]);/** + * @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 ws=D("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/** + * @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=D("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** + * @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=D("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",[Cs]=us(ce,[Re]),Ie=Re(),[Ss,ve]=Cs(ce),De=x.forwardRef((s,r)=>{const{__scopeTabs:n,value:l,onValueChange:i,defaultValue:o,orientation:m="horizontal",dir:_,activationMode:p="automatic",...h}=s,c=is(_),[t,b]=cs({prop:l,onChange:i,defaultProp:o??"",caller:ce});return e.jsx(Ss,{scope:n,baseId:ls(),value:t,onValueChange:b,orientation:m,dir:c,activationMode:p,children:e.jsx(ie.div,{dir:c,"data-orientation":m,...h,ref:r})})});De.displayName=ce;var Oe="TabsList",Je=x.forwardRef((s,r)=>{const{__scopeTabs:n,loop:l=!0,...i}=s,o=ve(Oe,n),m=Ie(n);return e.jsx(ds,{asChild:!0,...m,orientation:o.orientation,dir:o.dir,loop:l,children:e.jsx(ie.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:r})})});Je.displayName=Oe;var Be="TabsTrigger",Ue=x.forwardRef((s,r)=>{const{__scopeTabs:n,value:l,disabled:i=!1,...o}=s,m=ve(Be,n),_=Ie(n),p=Ke(m.baseId,l),h=ze(m.baseId,l),c=l===m.value;return e.jsx(os,{asChild:!0,..._,focusable:!i,active:c,children:e.jsx(ie.button,{type:"button",role:"tab","aria-selected":c,"aria-controls":h,"data-state":c?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:p,...o,ref:r,onMouseDown:oe(s.onMouseDown,t=>{!i&&t.button===0&&t.ctrlKey===!1?m.onValueChange(l):t.preventDefault()}),onKeyDown:oe(s.onKeyDown,t=>{[" ","Enter"].includes(t.key)&&m.onValueChange(l)}),onFocus:oe(s.onFocus,()=>{const t=m.activationMode!=="manual";!c&&!i&&t&&m.onValueChange(l)})})})});Ue.displayName=Be;var He="TabsContent",We=x.forwardRef((s,r)=>{const{__scopeTabs:n,value:l,forceMount:i,children:o,...m}=s,_=ve(He,n),p=Ke(_.baseId,l),h=ze(_.baseId,l),c=l===_.value,t=x.useRef(c);return x.useEffect(()=>{const b=requestAnimationFrame(()=>t.current=!1);return()=>cancelAnimationFrame(b)},[]),e.jsx(ms,{present:i||c,children:({present:b})=>e.jsx(ie.div,{"data-state":c?"active":"inactive","data-orientation":_.orientation,role:"tabpanel","aria-labelledby":p,hidden:!b,id:h,tabIndex:0,...m,ref:r,style:{...s.style,animationDuration:t.current?"0s":void 0},children:b&&o})})});We.displayName=He;function Ke(s,r){return`${s}-trigger-${r}`}function ze(s,r){return`${s}-content-${r}`}var $s=De,Ge=Je,Qe=Ue,Ve=We;const Ls=$s,Xe=x.forwardRef(({className:s,...r},n)=>e.jsx(Ge,{ref:n,className:$("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...r}));Xe.displayName=Ge.displayName;const U=x.forwardRef(({className:s,...r},n)=>e.jsx(Qe,{ref:n,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=x.forwardRef(({className:s,...r},n)=>e.jsx(Ve,{ref:n,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=Ve.displayName;function F({tone:s,className:r,...n}){return e.jsx(I,{variant:"outline",className:$(ge(s),r),...n})}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 Ye(s){return s.available?s.status==="completed"?s.conclusion??"completed":s.status??"unknown":"Unavailable"}function V(s){return s.replace(/_/g," ").replace(/\b\w/g,r=>r.toUpperCase())}function ke({title:s,budget:r,profile:n}){const l=r.cost_policy==="unmetered_hf"||r.budget_enforced===!1,i=Math.min(100,r.current_exposure_usd/r.ceiling_usd*100),o=l?"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"]})]})]}),n&&e.jsxs("div",{className:"text-xs cron-muted",children:["Profile ",e.jsx("strong",{children:n.profile_id})," · max ",n.max_papers.toLocaleString()," papers · hard ",te(n.hard_timeout_seconds)," · soft ",te(n.soft_deadline_seconds)]}),e.jsx("p",{className:"text-xs cron-muted",children:l?"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 Ps={healthy:je,degraded:Ee,broken:Y,running:R,stuck:Y,unknown:Ns};function Fs({status:s,isRunning:r}){const n=r?"running":s,l=Ps[n];return e.jsx(l,{className:`cron-status-icon ${ge(n)}${n==="running"?" animate-spin":""}`})}function Ce({label:s,axis:r}){return e.jsxs(F,{tone:r.status,title:r.reason,children:[s,": ",r.status]})}function Se({icon:s,title:r,metrics:n}){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(n).map(([l,i])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:V(l)}),e.jsx("div",{className:"text-lg font-semibold",children:typeof i=="number"?i.toLocaleString():i})]},l))})]})}function Rs({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",Ye(s)],...s.updated_at?[["Updated",v(s.updated_at)]]:[]].map(([r,n])=>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:n})]},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(F,{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,n])=>e.jsxs(I,{variant:"outline",children:[r,": ",n??"running"]},r))})]}),(s.error||s.view_error)&&e.jsx("div",{className:"cron-message cron-message--error",children:s.error??s.view_error})]})]})}const Ts={COMPLETED:"healthy",ERROR:"broken",CANCELED:"broken",RUNNING:"running"},$e={success:"healthy",partial:"degraded",interrupted:"degraded",infrastructure_failure:"broken",worker_failure:"broken",active:"running"};function As({job:s}){const r=s.progress,n=(r==null?void 0:r.omitted_images)??0,l=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(F,{tone:Ts[s.stage]??"unknown",children:s.stage.toLowerCase()}),s.effective_outcome&&e.jsxs(F,{tone:$e[s.effective_outcome]??"unknown",children:["output: ",s.effective_outcome.replace(/_/g," ")]}),s.failure_cause&&e.jsxs(F,{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(X,{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:[l.toFixed(0),"%"]})]}),e.jsx("div",{className:"cron-progress-track",children:e.jsx("div",{className:"cron-progress-value",style:{width:`${l}%`}})})]}),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"]})]}),n>0&&e.jsxs("div",{className:"text-xs cron-muted",children:[e.jsx("strong",{children:n.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 Es({monitor:s,loading:r,error:n}){var l,i;return e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(vs,{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(R,{className:"h-4 w-4 animate-spin"})," Loading remote Jobs…"]}),!!n&&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:(l=s.selected_profiles)==null?void 0:l.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(([o,m])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label",children:V(o)}),e.jsx("div",{className:"text-lg font-semibold",children:m.toLocaleString()})]},o))}),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(o=>e.jsxs("div",{className:"cron-metric-card space-y-2 text-sm",children:[e.jsx("div",{className:"font-semibold",children:o.scope==="full"?"Full catalog coverage":"Recent 14-day coverage"}),e.jsxs("div",{className:"text-lg font-semibold",children:[o.coverage_percentage.toFixed(2),"%"]}),e.jsxs("div",{children:[o.canonical_markdown_count.toLocaleString()," canonical / ",o.eligible_papers.toLocaleString()," eligible · ",o.missing_count.toLocaleString()," missing"]}),e.jsxs("div",{className:"cron-muted",children:["Copied from upstream this reconciliation: ",o.copied_from_upstream_count.toLocaleString()]}),e.jsxs("div",{className:"cron-muted",children:["7-day Δ eligible ",o.eligible_delta_7d??"collecting"," · canonical ",o.canonical_delta_7d??"collecting"," · missing ",o.missing_delta_7d??"collecting"]})]},o.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(o=>e.jsx(As,{job:o},o.id))})]})]})}function Ms({job:s,expanded:r,onToggle:n,autoRefresh:l=!1}){var c;const i=!!(s.work_metrics&&Object.keys(s.work_metrics).length),o=!!(s.db_metrics&&Object.keys(s.db_metrics).length),m=s.job_name==="paper_markdown_backfill",_=z({queryKey:["admin","paperMarkdownJobs"],queryFn:()=>ue.getPaperMarkdownJobs(),enabled:m,refetchInterval:l?3e4:!1,retry:!1}),p=m?(c=_.data)==null?void 0:c.budgets.live:void 0,h=(p==null?void 0:p.cost_policy)==="unmetered_hf"||(p==null?void 0:p.budget_enforced)===!1;return e.jsxs("div",{className:"cron-job-card",children:[e.jsx("button",{type:"button",className:"cron-job-summary",onClick:n,"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(Fs,{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(I,{variant:"outline",className:"text-[10px] uppercase tracking-wide",children:"Critical"}),s.lock_stale&&e.jsx(F,{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(ps,{className:"h-4 w-4 cron-muted"}):e.jsx(gs,{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(qe,{}),"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(js,{}),"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: ",Ye(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}),p&&e.jsxs("div",{className:`cron-message ${p.can_launch_planned?"":"cron-message--error"}`,children:[e.jsx("strong",{children:"Live GPU policy:"})," ",h?"unmetered on HF":`${S(p.current_exposure_usd)} current / ${S(p.ceiling_usd)} cap`," · ",p.affordable_jobs," of ",p.desired_jobs," planned",h?"":` · projects ${S(p.projected_usd)} · rolling 30 days`]})]})]}),e.jsx(F,{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(([t,b])=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"cron-label",children:t}),e.jsx("span",{children:b})]},t))})]}),s.work_metrics&&i&&e.jsx(Se,{icon:Ne,title:"Log Metrics",metrics:s.work_metrics}),s.db_metrics&&o&&e.jsx(Se,{icon:fe,title:"Database Metrics",metrics:s.db_metrics}),s.workflow_status&&e.jsx(Rs,{workflow:s.workflow_status}),m&&e.jsx(Es,{monitor:_.data,loading:_.isLoading,error:_.error}),s.diagnostic_groups&&Object.values(s.diagnostic_groups).some(t=>t.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(([,t])=>t.length>0).map(([t,b])=>e.jsxs("div",{className:"cron-metric-card",children:[e.jsx("div",{className:"cron-label mb-1",children:V(t)}),e.jsx("ul",{className:"list-disc pl-4 text-sm space-y-1",children:b.map(k=>e.jsx("li",{children:k},k))})]},t))})]}),s.health_findings&&s.health_findings.some(t=>t.state!=="healthy")&&e.jsxs("div",{className:"md:col-span-2",children:[e.jsxs("div",{className:"cron-section-heading",children:[e.jsx(Ae,{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(t=>t.state!=="healthy").map(t=>e.jsxs("div",{children:[e.jsx(F,{tone:t.state,children:t.state})," ",e.jsx("strong",{children:V(t.contract)}),": ",t.summary,Object.entries(t.evidence).length>0&&e.jsx("div",{className:"mt-1 text-xs cron-muted",children:Object.entries(t.evidence).map(([b,k])=>e.jsxs("span",{className:"mr-3",children:[V(b),": ",String(k)]},b))})]},`${t.plane}-${t.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(X,{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(X,{className:"h-3.5 w-3.5"})]})]})]})]})]})})]})}const Ze=x.forwardRef(({className:s,...r},n)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:n,className:$("w-full caption-bottom text-sm",s),...r})}));Ze.displayName="Table";const es=x.forwardRef(({className:s,...r},n)=>e.jsx("thead",{ref:n,className:$("[&_tr]:border-b",s),...r}));es.displayName="TableHeader";const ss=x.forwardRef(({className:s,...r},n)=>e.jsx("tbody",{ref:n,className:$("[&_tr:last-child]:border-0",s),...r}));ss.displayName="TableBody";const qs=x.forwardRef(({className:s,...r},n)=>e.jsx("tfoot",{ref:n,className:$("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...r}));qs.displayName="TableFooter";const he=x.forwardRef(({className:s,...r},n)=>e.jsx("tr",{ref:n,className:$("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",s),...r}));he.displayName="TableRow";const W=x.forwardRef(({className:s,...r},n)=>e.jsx("th",{ref:n,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 K=x.forwardRef(({className:s,...r},n)=>e.jsx("td",{ref:n,className:$("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...r}));K.displayName="TableCell";const Is=x.forwardRef(({className:s,...r},n)=>e.jsx("caption",{ref:n,className:$("mt-4 text-sm text-muted-foreground",s),...r}));Is.displayName="TableCaption";const as={queued:"unknown",dispatching:"running",running:"running",completed:"healthy",failed:"broken",canceled:"unknown",awaiting_markdown:"unknown"},rs={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"},Ds={queued:ws,dispatching:R,running:bs,completed:je,failed:Y,canceled:ys,awaiting_markdown:ks};function Os({status:s}){const r=Ds[s];return e.jsxs(F,{tone:as[s],children:[e.jsx(r,{className:`mr-1 h-3.5 w-3.5 ${s==="dispatching"?"animate-spin":""}`}),rs[s]]})}function Js(s){return s.status==="awaiting_markdown"?_s: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((n,l)=>e.jsxs("li",{children:[n.benchmark," · ",n.disposition," · task ",n.task_id," / dataset ",n.dataset_id,n.metric?` / ${n.metric}`:"",n.value!=null?` = ${n.value}`:"",n.detail?` — ${n.detail}`:""]},l))})]})}function Bs({autoRefresh:s}){var q;const r=xe(),[n,l]=x.useState(""),[i,o]=x.useState(""),[m,_]=x.useState(""),[p,h]=x.useState(""),[c,t]=x.useState(""),[b,k]=x.useState({}),O={trigger:n,status:i,policy_version:m,cohort_date:p,review_status:c},{data:u,isLoading:G,isFetching:Z,error:J}=z({queryKey:["admin","codexPaperJobs",O],queryFn:()=>E.listJobs(100,O),refetchInterval:s?1e4:!1,retry:!1}),T=()=>r.invalidateQueries({queryKey:["admin","codexPaperJobs"]}),ee=L({mutationFn:a=>E.retryJob(a),onSuccess:T}),le=L({mutationFn:a=>E.cancelJob(a),onSuccess:T}),de=L({mutationFn:a=>E.retryTrace(a),onSuccess:T}),Q=L({mutationFn:a=>E.setScheduler(a),onSuccess:T}),M=L({mutationFn:({id:a,dataset:d,task:w,metric:ae})=>E.promoteBenchmarkCandidate(a,{dataset_id:Number(d),task_id:Number(w),best_metric:ae.trim()}),onSuccess:T}),A=L({mutationFn:a=>E.rollbackBenchmarkCandidate(a),onSuccess:T}),se=J instanceof Te&&J.status===404;return e.jsxs(g,{className:"mb-8",children:[e.jsx(f,{children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(N,{className:"text-xl",children:"Codex paper jobs"}),e.jsx(P,{children:"Durable queue, two-stage daily workflows, traces, and benchmark-gap follow-up"})]}),Z&&!G&&e.jsxs("span",{className:"flex items-center gap-2 text-xs cron-muted",children:[e.jsx(R,{className:"h-3.5 w-3.5 animate-spin"})," Syncing with Hugging Face"]})]})}),e.jsxs(j,{children:[G&&e.jsxs("div",{className:"flex items-center justify-center py-10 cron-muted",children:[e.jsx(R,{className:"mr-2 h-5 w-5 animate-spin"})," Loading paper jobs…"]}),J&&!se&&e.jsx("div",{className:"cron-message cron-message--error mb-4",children:J.message}),se&&e.jsx("p",{className:"py-4 text-sm cron-muted",children:"Codex paper jobs are not enabled in this environment."}),u&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:`cron-message mb-5 ${u.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: ",u.scheduler.paused_at?"paused":u.scheduler.dispatch_enabled?"enabled":"disabled"]}),u.scheduler.pause_reason&&e.jsx("div",{className:"mt-1 text-xs",children:u.scheduler.pause_reason}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Canary ",u.scheduler.canary_released?"released":"active"," · Queue age ",u.scheduler.queue_age_level]}),e.jsxs("div",{className:"mt-1 text-xs cron-muted",children:["Scheduled usage today ",u.scheduler.usage.current_day_tokens.toLocaleString()," tokens · ",u.scheduler.usage.mode==="enforced"?`pause threshold ${((q=u.scheduler.usage.pause_threshold_tokens)==null?void 0:q.toLocaleString())??"not established"}`:"first-week alert-only baseline"," · trailing median ",u.scheduler.usage.trailing_seven_day_median_tokens.toLocaleString()]})]}),e.jsx(y,{size:"sm",variant:u.scheduler.paused_at||!u.scheduler.dispatch_enabled?"default":"outline",disabled:Q.isPending,onClick:()=>Q.mutate(u.scheduler.paused_at||!u.scheduler.dispatch_enabled?"resume":"pause"),children:u.scheduler.paused_at?"Acknowledge & resume":u.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:rs[a]}),e.jsx("div",{className:"mt-1 text-xl font-semibold",children:u.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:u.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:n,onChange:a=>l(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=>o(a.target.value),children:[e.jsx("option",{value:"",children:"All statuses"}),Object.keys(as).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:m,onChange:a=>_(a.target.value)}),e.jsx("input",{"aria-label":"Cohort date",type:"date",className:"rounded border px-2 py-1 text-sm",value:p,onChange:a=>h(a.target.value)}),e.jsxs("select",{"aria-label":"Review status",className:"rounded border px-2 py-1 text-sm",value:c,onChange:a=>t(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"})]})]}),u.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(es,{children:e.jsxs(he,{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(ss,{children:u.jobs.map(a=>{const d=Js(a);return e.jsxs(he,{children:[e.jsx(K,{className:"align-top",children:e.jsx(Os,{status:a.status})}),e.jsx(K,{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(K,{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(K,{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(K,{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(X,{className:"h-3.5 w-3.5"})]}):e.jsx("span",{className:"cron-muted",children:"Waiting to dispatch"}),d&&e.jsx("p",{className:`mt-2 line-clamp-3 text-xs ${a.error&&a.status!=="awaiting_markdown"?"text-red-700":"cron-muted"}`,title:d,children:d}),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:()=>ee.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)})})]}),u.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"}),u.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(d=>{var w;return e.jsxs("div",{className:"rounded border p-3",children:[e.jsxs("div",{className:"font-medium",children:[Le[d.kind]," · ",d.status," · trace ",d.trace_status," · review ",d.audit_status]}),e.jsxs("div",{className:"mt-1 cron-muted",children:["model ",d.model??"—"," · reasoning ",d.reasoning_effort??"—"," · tokens ",(d.input_tokens??0)+(d.output_tokens??0)," · duration ",d.duration_ms??0," ms · attempts ",d.attempt_count]}),d.error&&e.jsx("div",{className:"mt-2 text-red-700",children:d.error}),d.report&&e.jsx("div",{className:"mt-2 whitespace-pre-wrap rounded border p-2",children:d.report}),d.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(d.url_candidates,null,2)})]}),d.validation_summary&&e.jsx("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap",children:JSON.stringify(d.validation_summary,null,2)}),Array.isArray((w=d.validation_summary)==null?void 0:w.manual_or_legacy_evaluation_rows_affected)&&d.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: ",d.validation_summary.manual_or_legacy_evaluation_rows_affected.join(", "),". Review the evidence and before/after diff."]}),d.proposal&&e.jsx("pre",{className:"mt-2 max-h-52 overflow-auto whitespace-pre-wrap",children:JSON.stringify(d.proposal,null,2)}),e.jsx(Pe,{mutationResult:d.mutation_result}),d.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(d.mutation_result,null,2)})]}),d.trace_status==="complete"&&e.jsxs("a",{className:"mt-2 inline-flex items-center gap-1 hover:underline",href:E.traceUrl(d.id),target:"_blank",rel:"noreferrer",children:["Authenticated trace manifest ",e.jsx(X,{className:"h-3.5 w-3.5"})]})]},d.id)})]})]},a.id))]}),u.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"}),u.benchmark_candidates.map(a=>{var ae,_e;const d=b[a.id]??{dataset:"",task:((ae=a.task_ids[0])==null?void 0:ae.toString())??"",metric:""},w=Number(d.dataset)>0&&Number(d.task)>0&&d.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:A.isPending,onClick:()=>A.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:d[B],onChange:ns=>k(ts=>({...ts,[a.id]:{...d,[B]:ns.target.value}}))},B)),e.jsx(y,{size:"sm",variant:"outline",disabled:!w||M.isPending,onClick:()=>M.mutate({id:a.id,...d}),children:"Promote & requeue evidence papers"})]})]},a.id)}),M.error&&e.jsx("div",{className:"cron-message cron-message--error",children:M.error.message}),A.error&&e.jsx("div",{className:"cron-message cron-message--error",children:A.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(u.timestamp)]})]})]})]})}function Us(){const[s,r]=x.useState(()=>new Date().toISOString().slice(0,10)),[n,l]=x.useState(1),i=z({queryKey:["paper-edit-digest",s,n],queryFn:()=>Me.digest(s,n),enabled:!!s});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:o=>{r(o.target.value),l(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((o,m)=>e.jsxs("li",{children:[e.jsxs(pe,{className:"underline",to:`/paper/${o.paper_id}`,children:["Paper ",o.paper_id]})," · @",o.actor_username??"admin"," · ",o.edits," changes"]},m))}),e.jsxs("div",{className:"flex gap-2",children:[n>1&&e.jsx(y,{variant:"outline",onClick:()=>l(n-1),children:"Previous"}),i.data.has_more&&e.jsx(y,{variant:"outline",onClick:()=>l(n+1),children:"Next"})]})]})]})}const Hs=()=>{var m,_,p,h;const s=xe(),r=fs({queryKey:["catalog-audit"],queryFn:({pageParam:c})=>me.audit(c),initialPageParam:void 0,getNextPageParam:c=>c.next_cursor??void 0}),n=((m=r.data)==null?void 0:m.pages.flatMap(c=>c.events))??[],l=L({mutationFn:()=>me.acknowledgeAudit(),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})}),i=L({mutationFn:c=>me.rollbackEvent(c),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})}),o=L({mutationFn:({subject:c,suspended:t})=>Me.suspend(c,t),onSuccess:()=>s.invalidateQueries({queryKey:["catalog-audit"]})});return e.jsxs("div",{className:"space-y-4",children:[e.jsx(Us,{}),(i.error||o.error)&&e.jsx("p",{role:"alert",children:(_=i.error||o.error)==null?void 0:_.message}),e.jsxs(g,{children:[e.jsxs(f,{className:"flex-row items-center justify-between",children:[e.jsx(N,{children:"Catalog mutation audit"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm font-medium",children:[((h=(p=r.data)==null?void 0:p.pages[0])==null?void 0:h.unread_contributor_count)??0," unread contributor changes"]}),e.jsx(y,{variant:"outline",size:"sm",onClick:()=>l.mutate(),disabled:l.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."}),n.map(c=>e.jsxs("article",{className:`rounded-md border p-3 ${c.operation==="delete"||c.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:[c.operation," ",c.entity_type," ",c.entity_id]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["@",c.actor_username??c.actor_role," ·"," ",new Date(c.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:c.before,after:c.after},null,2)})]}),c.actor_role==="contributor"&&c.actor_hf_subject&&e.jsx(y,{className:"mt-3 mr-2",variant:"outline",size:"sm",disabled:o.isPending,onClick:()=>o.mutate({subject:c.actor_hf_subject,suspended:!c.editing_suspended}),children:c.editing_suspended?"Restore editing access":"Suspend editing access"}),!c.rollback_of_event_id&&e.jsx(y,{className:"mt-3",variant:"outline",size:"sm",onClick:()=>i.mutate(c.id),disabled:i.isPending||c.rollback_eligible===!1,children:c.rollback_eligible===!1?"Rollback conflict":"Roll back if unchanged"})]},c.id)),r.hasNextPage&&e.jsx(y,{variant:"outline",onClick:()=>r.fetchNextPage(),disabled:r.isFetchingNextPage,children:r.isFetchingNextPage?"Loading…":"Load older events"})]})]})]})},Fe={hourly:"running",daily:"healthy",weekly:"degraded",systemd:"running"},re=["admin","cronStatus"],Ws=({data:s,loading:r,error:n})=>{const[l,i]=x.useState("staging-current"),o={"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(R,{className:"h-6 w-6 animate-spin mr-3"}),"Loading chat compute…"]});if(n||!s)return e.jsx(g,{className:"cron-status--broken",children:e.jsx(j,{className:"pt-6",children:"Chat compute accounting is unavailable."})});const m=Math.min(100,s.effective_microusd/s.application_cap_microusd*100),_=s.circuit_state==="tripped"?"Chat disabled":s.circuit_state==="warning"?"Operator warning":"Enabled",p=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(f,{children:e.jsx(N,{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(f,{children:e.jsx(N,{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(m),className:"h-2 rounded bg-muted mt-3",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${m}%`}})})]})]}),e.jsxs(g,{children:[e.jsx(f,{children:e.jsx(N,{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(f,{children:e.jsx(N,{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(f,{children:[e.jsx(N,{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:l,onChange:h=>i(h.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:[o[l]," · 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(I,{children:p})]}),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(f,{children:e.jsx(N,{children:"Live lifecycle"})}),e.jsx(j,{className:"text-sm",children:Object.entries(s.live_states).map(([h,c])=>e.jsxs("span",{className:"mr-4",children:[h,": ",c]},h))})]}),e.jsxs(g,{children:[e.jsx(f,{children:e.jsx(N,{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(h=>e.jsxs("li",{children:[h.date,": blank ",C(h.blank_pool_microusd)," · assigned ",C(h.assigned_microusd)]},h.date))}):e.jsx("p",{className:"cron-muted",children:"No compute recorded in this cycle."})})]}),e.jsxs(g,{children:[e.jsxs(f,{children:[e.jsx(N,{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(h=>e.jsxs("li",{children:[e.jsx(I,{children:h.severity})," ",h.type," · ",v(h.created_at)]},h.id))}):e.jsx("p",{className:"cron-muted",children:"No events in this cycle."})})]})]})},Ks=({data:s,loading:r,error:n})=>{if(r)return e.jsxs("div",{className:"flex items-center py-8",children:[e.jsx(R,{className:"h-5 w-5 animate-spin mr-3"}),"Loading web-search budget…"]});if(n||!s)return e.jsx(g,{className:"cron-status--broken",children:e.jsx(j,{className:"pt-6",children:"Web-search budget accounting is unavailable."})});const l=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(f,{children:[e.jsx(N,{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(l),className:"h-2 rounded bg-muted",children:e.jsx("div",{className:"h-2 rounded bg-primary",style:{width:`${l}%`}})}),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))})]})]})},zs=({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(R,{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,Gs=(s,r)=>s!=null&&s.snapshot_stale||s!=null&&s.refreshing?5e3:r?3e4:!1,ga=()=>{const s=xs(),r=xe(),[n,l]=x.useState(!0),[i,o]=x.useState(""),[m,_]=x.useState(""),[p,h]=x.useState(new Set),{user:c}=hs(),{data:t,isLoading:b,error:k}=z({queryKey:re,queryFn:()=>ue.getCronStatus(),refetchInterval:a=>Gs(a.state.data,n),retry:!1}),O=z({queryKey:["admin","chatSandboxSpend",m],queryFn:()=>ye.getSandboxSpend(m||void 0),refetchInterval:n?3e4:!1,retry:!1}),u=z({queryKey:["admin","chatWebSearchBudget"],queryFn:()=>ye.getWebSearchBudget(),enabled:s,refetchInterval:n?3e4:!1,retry:!1}),G=L({mutationFn:()=>Promise.all([r.cancelQueries({queryKey:re}).then(()=>r.fetchQuery({queryKey:re,queryFn:()=>ue.getCronStatus(!0),retry:!1})),r.refetchQueries({queryKey:["admin"],type:"active",predicate:a=>a.queryKey[1]!==re[1]})])}),Z=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=>{h(d=>{const w=new Set(d);return w.has(a)?w.delete(a):w.add(a),w})},T=(t==null?void 0:t.jobs.filter(a=>a.dashboard_group==="leaderboard_sync"))??[],ee=(t==null?void 0:t.jobs.filter(a=>a.category!=="manual"&&a.dashboard_group!=="leaderboard_sync"))??[],le=ee.filter(a=>a.critical),de=ee.filter(a=>!a.critical),Q=(t==null?void 0:t.manual_operations)??[],M=!!(b||G.isPending||t!=null&&t.refreshing),A=de.reduce((a,d)=>(a[d.category]||(a[d.category]=[]),a[d.category].push(d),a),{}),se=Object.keys(A).sort((a,d)=>{const w=["systemd","hourly","daily","weekly","backfill"];return w.indexOf(a)-w.indexOf(d)}),q=a=>e.jsx(Ms,{job:a,expanded:p.has(a.job_name),onToggle:()=>J(a.job_name),autoRefresh:n},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:()=>l(!n),className:n?"cron-status--running":"",children:[e.jsx(be,{className:`h-4 w-4 mr-2 ${n?"animate-spin":""}`}),"Auto-refresh ",n?"ON":"OFF"]}),e.jsxs(y,{variant:"outline",size:"sm",onClick:()=>G.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:["@",c==null?void 0:c.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(zs,{data:t}),e.jsxs(Ls,{defaultValue:"critical-jobs",children:[e.jsxs(Xe,{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:[b&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(R,{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:Z??"Failed to load CRON jobs status. Please try again."})]})})}),t&&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(f,{className:"pb-2",children:e.jsx(N,{className:"text-sm font-medium cron-muted capitalize",children:a})}),e.jsx(j,{children:e.jsx("div",{className:"text-2xl font-bold",children:t.summary[a]})})]},a))}),t.summary.critical_issues.length>0&&e.jsxs(g,{className:"mb-6 cron-status--broken",children:[e.jsx(f,{children:e.jsxs(N,{className:"flex items-center gap-2",children:[e.jsx(Ae,{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:t.summary.critical_issues.map(a=>e.jsx("li",{children:a},a))})})]}),e.jsxs(g,{className:"mb-8",children:[e.jsx(f,{children:e.jsx(N,{className:"text-base",children:"What to check next"})}),e.jsxs(j,{children:[e.jsx("p",{className:"text-sm cron-muted",children:t.summary.what_to_check_next}),e.jsxs("p",{className:"mt-2 text-xs cron-muted flex items-center gap-2",children:[e.jsx(qe,{className:"h-4 w-4"}),"Last updated: ",v(t.timestamp)," · Health score:"," ",t.summary.health_score.toFixed(0),"%"]})]})]}),e.jsxs(g,{className:`mb-8 ${t.summary.coverage.coverage_gaps?"cron-status--broken":""}`,children:[e.jsxs(f,{children:[e.jsx(N,{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:t.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:t.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:t.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:t.summary.coverage.coverage_gaps})]})]})]}),e.jsxs(g,{className:"mb-8",children:[e.jsxs(f,{children:[e.jsx(N,{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(q)})]}),e.jsx("div",{className:"space-y-6",children:se.map(a=>e.jsxs(g,{children:[e.jsx(f,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(N,{className:"text-xl capitalize flex items-center gap-2",children:[e.jsx(I,{className:ge(Fe[a]??Fe.hourly),children:a}),e.jsx("span",{children:"Supporting jobs"})]}),e.jsxs(P,{children:[A[a].length," job",A[a].length!==1?"s":""]})]})}),e.jsx(j,{className:"space-y-4",children:A[a].map(q)})]},a))}),Q.length>0&&e.jsxs(g,{className:"mt-6",children:[e.jsxs(f,{children:[e.jsx(N,{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:Q.map(q)})]})]})]}),e.jsxs(H,{value:"leaderboard-syncs",className:"mt-6",children:[b&&e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(R,{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:Z??"Failed to load leaderboard sync status. Please try again."})]})})}),t&&e.jsxs(g,{children:[e.jsx(f,{children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(N,{className:"text-xl",children:"Leaderboard syncs"}),e.jsx(P,{children:"Recurring imports from externally maintained benchmark leaderboards"})]}),e.jsxs(I,{children:[T.length," jobs"]})]})}),e.jsx(j,{className:"space-y-4",children:T.map(q)})]})]}),e.jsx(H,{value:"codex-paper-jobs",className:"mt-6",children:e.jsx(Bs,{autoRefresh:n})}),e.jsx(H,{value:"catalog-audit",className:"mt-6",children:e.jsx(Hs,{})}),e.jsxs(H,{value:"chat-compute",className:"mt-6",children:[e.jsxs(g,{className:"mb-6",children:[e.jsxs(f,{children:[e.jsx(N,{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=>o(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(Ws,{data:O.data,loading:O.isLoading,error:O.error}),s&&e.jsx("div",{className:"mt-6",children:e.jsx(Ks,{data:u.data,loading:u.isLoading,error:u.error})})]})]})]})})};export{Ws as ChatComputePanel,zs as CronSnapshotNotice,Gs as cronStatusRefetchInterval,ga as default}; diff --git a/assets/ExternalSourceEvalBadge-TyFEU7vd.js b/assets/ExternalSourceEvalBadge-DfhTt9yv.js similarity index 94% rename from assets/ExternalSourceEvalBadge-TyFEU7vd.js rename to assets/ExternalSourceEvalBadge-DfhTt9yv.js index 0374bf9c5af088b675a005a6248dd522628759e8..f835687983ce11dc1a2887872ac8bd151f864f71 100644 --- a/assets/ExternalSourceEvalBadge-TyFEU7vd.js +++ b/assets/ExternalSourceEvalBadge-DfhTt9yv.js @@ -1 +1 @@ -import{c as o}from"./papers-bE3C_Qzl.js";import{a3 as g,j as a,L as l}from"./index-CqKcHUvZ.js";import{H as u,a as c,b as d}from"./hover-card-BTsA69o8.js";import{s as m}from"./safeExternalHref-CkBrsh84.js";class b{constructor(e){this.request=e}list(e={}){const t=new URLSearchParams(Object.entries(e).filter(r=>r[1]!==void 0).map(([r,n])=>[r,String(n)])).toString();return this.request(`/evaluations/${t?`?${t}`:""}`,{cache:"no-store"})}get(e){return this.request(`/evaluations/${e}`)}async byPaper(e){return this.allPages({paper_id:Number(e),ordering:"-benchmark_popularity"})}async byDataset(e,t){return this.allPages({dataset_id:Number(e),best_metric:t,ordering:"best_rank"})}async byLeaderboard(e,t,r={}){return this.allPages({dataset_id:Number(e),task_id:Number(t),ordering:"best_rank",...r})}create(e){return this.request("/evaluations/",{method:"POST",body:JSON.stringify(e)})}update(e,t){return this.request(`/evaluations/${e}`,{method:"PUT",body:JSON.stringify(t)})}delete(e){return this.request(`/evaluations/${e}`,{method:"DELETE"})}primeCurationState(e,t=!1){return o.primeEvaluations(e,t)}batch(e,t){return o.mutateEvaluations(e,t,"/evaluations/batch",{method:"POST",body:JSON.stringify({paper_id:e,operations:t})})}async allPages(e){const r=await this.list({...e,page_size:100});if(!r.next_page)return r.results;const n=Math.ceil(r.count/100),p=await Promise.all(Array.from({length:n-1},(i,h)=>this.list({...e,page:h+2,page_size:100})));return[r,...p].flatMap(i=>i.results)}}const w=new b(g),j=()=>a.jsxs(u,{openDelay:120,closeDelay:120,children:[a.jsx(c,{asChild:!0,children:a.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),a.jsxs(d,{side:"top",align:"start",className:"w-auto max-w-[260px] p-3 text-sm leading-snug",children:["This is an evaluation of a closed-source model. You can disable viewing these in your"," ",a.jsx(l,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});function x(s){if(!s)return"Evaluation sourced outside this paper";const e=s.toLowerCase();if(e.includes("open-asr-leaderboard"))return"Open ASR Leaderboard";if(e.includes("arcprize.org"))return"ARC Prize Leaderboard";if(e.includes("frontierswe.com"))return"FrontierSWE";if(e.includes("deepswe.datacurve.ai"))return"DeepSWE";try{const t=new URL(s,"https://paperswithcode.co");return t.pathname.startsWith("/paper/")?"Source paper":t.hostname.replace(/^www\./,"")}catch{return s}}const E=({sourceUrl:s})=>{const e=m(s),t=typeof s=="string"&&s.startsWith("/paper/")?s:null,r=x(s);return a.jsxs(u,{openDelay:120,closeDelay:120,children:[a.jsx(c,{asChild:!0,children:a.jsx("button",{type:"button",className:"bm-external-source-tag","aria-label":`Externally sourced evaluation: ${r}`,children:"External"})}),a.jsxs(d,{side:"top",align:"start",className:"w-auto max-w-[280px] p-3 text-sm leading-snug",children:["This score was sourced outside this paper.",t?a.jsxs(a.Fragment,{children:[" ",a.jsx(l,{to:t,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:r}),"."]}):e?a.jsxs(a.Fragment,{children:[" ",a.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:r}),"."]}):a.jsxs(a.Fragment,{children:[" ",r,"."]})]})]})};export{j as C,E,w as e}; +import{c as o}from"./papers-DIIIPDpj.js";import{a5 as g,j as a,L as l}from"./index-D6jcIRWs.js";import{H as u,a as c,b as d}from"./hover-card-DPpv0l_x.js";import{s as m}from"./safeExternalHref-CkBrsh84.js";class b{constructor(e){this.request=e}list(e={}){const t=new URLSearchParams(Object.entries(e).filter(r=>r[1]!==void 0).map(([r,n])=>[r,String(n)])).toString();return this.request(`/evaluations/${t?`?${t}`:""}`,{cache:"no-store"})}get(e){return this.request(`/evaluations/${e}`)}async byPaper(e){return this.allPages({paper_id:Number(e),ordering:"-benchmark_popularity"})}async byDataset(e,t){return this.allPages({dataset_id:Number(e),best_metric:t,ordering:"best_rank"})}async byLeaderboard(e,t,r={}){return this.allPages({dataset_id:Number(e),task_id:Number(t),ordering:"best_rank",...r})}create(e){return this.request("/evaluations/",{method:"POST",body:JSON.stringify(e)})}update(e,t){return this.request(`/evaluations/${e}`,{method:"PUT",body:JSON.stringify(t)})}delete(e){return this.request(`/evaluations/${e}`,{method:"DELETE"})}primeCurationState(e,t=!1){return o.primeEvaluations(e,t)}batch(e,t){return o.mutateEvaluations(e,t,"/evaluations/batch",{method:"POST",body:JSON.stringify({paper_id:e,operations:t})})}async allPages(e){const r=await this.list({...e,page_size:100});if(!r.next_page)return r.results;const n=Math.ceil(r.count/100),p=await Promise.all(Array.from({length:n-1},(i,h)=>this.list({...e,page:h+2,page_size:100})));return[r,...p].flatMap(i=>i.results)}}const w=new b(g),j=()=>a.jsxs(u,{openDelay:120,closeDelay:120,children:[a.jsx(c,{asChild:!0,children:a.jsx("button",{type:"button",className:"bm-closed-source-tag","aria-label":"Closed-source model",children:"closed"})}),a.jsxs(d,{side:"top",align:"start",className:"w-auto max-w-[260px] p-3 text-sm leading-snug",children:["This is an evaluation of a closed-source model. You can disable viewing these in your"," ",a.jsx(l,{to:"/settings",className:"closed-eval-tooltip-link",children:"settings"}),"."]})]});function x(s){if(!s)return"Evaluation sourced outside this paper";const e=s.toLowerCase();if(e.includes("open-asr-leaderboard"))return"Open ASR Leaderboard";if(e.includes("arcprize.org"))return"ARC Prize Leaderboard";if(e.includes("frontierswe.com"))return"FrontierSWE";if(e.includes("deepswe.datacurve.ai"))return"DeepSWE";try{const t=new URL(s,"https://paperswithcode.co");return t.pathname.startsWith("/paper/")?"Source paper":t.hostname.replace(/^www\./,"")}catch{return s}}const E=({sourceUrl:s})=>{const e=m(s),t=typeof s=="string"&&s.startsWith("/paper/")?s:null,r=x(s);return a.jsxs(u,{openDelay:120,closeDelay:120,children:[a.jsx(c,{asChild:!0,children:a.jsx("button",{type:"button",className:"bm-external-source-tag","aria-label":`Externally sourced evaluation: ${r}`,children:"External"})}),a.jsxs(d,{side:"top",align:"start",className:"w-auto max-w-[280px] p-3 text-sm leading-snug",children:["This score was sourced outside this paper.",t?a.jsxs(a.Fragment,{children:[" ",a.jsx(l,{to:t,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:r}),"."]}):e?a.jsxs(a.Fragment,{children:[" ",a.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"external-eval-tooltip-link",children:r}),"."]}):a.jsxs(a.Fragment,{children:[" ",r,"."]})]})]})};export{j as C,E,w as e}; diff --git a/assets/FeedView-EM1uL5u1.js b/assets/FeedView-L-eiYDg9.js similarity index 94% rename from assets/FeedView-EM1uL5u1.js rename to assets/FeedView-L-eiYDg9.js index 1a3f1ce2a7e8ccba79274e6f67c574938957ab2e..50e36c59118dc5bb719f686e419db493a804f164 100644 --- a/assets/FeedView-EM1uL5u1.js +++ b/assets/FeedView-L-eiYDg9.js @@ -1 +1 @@ -import{j as e,L as D,a as Ce,b as Fe,r as h,h as Le,C as De,c as ve,d as Ae,e as Ee,f as Re,i as qe,g as oe,k as Ne,l as Me}from"./index-CqKcHUvZ.js";import{S as Ie}from"./sparkles-BKRdZneA.js";import{u as R}from"./useQuery-Cngk7eL9.js";import{D as He,a as Ke,b as Oe}from"./dialog-B-oqHDuH.js";import{c as se}from"./catalog-D26nGNnK.js";import{T as ge,r as Q}from"./research-Dt0MUW0x.js";import{d as ne,t as fe}from"./colors-_scCXfCe.js";import{u as ke,a as Se,s as $e,b as ze,r as xe,c as be,d as Be}from"./researchTopic-k4qgoW39.js";import{P as Ue}from"./plus-DZF-NxR0.js";import{A as Ge}from"./arrow-right-DCfHXCdw.js";import{P as Qe}from"./components-Dmnn5Z5p.js";import{M as Xe}from"./McpShowcase-oHgWM9FI.js";import{r as We,P as Ye,w as Ve}from"./PaperDateFilter-zHw5tq6B.js";import{u as Je,a as Ze,P as es,i as ss,A as ts,b as as,S as z,c as is,D as te,q as os,d as ns}from"./chatSessions-D75G2_U7.js";import{c as rs}from"./chat-DGBJkcmd.js";import{u as ls}from"./usePapers-By3yMmMn.js";import{p as cs,a as ds}from"./papers-bE3C_Qzl.js";import{u as us}from"./useInfiniteScroll-DVF-b-LX.js";import{S as $}from"./skeleton-DleNhBYA.js";import{A as ae,a as ie}from"./alert-Z2yFUcyL.js";import{u as we}from"./useInfiniteQuery-lxaMAHEu.js";import"./useMutation-BItMAQ7s.js";import"./AuthorAvatar-CWCqOa0h.js";import"./LatexTitle-BI9yl-Fo.js";import"./safeExternalHref-CkBrsh84.js";import"./AgentLogos-ClqC1BaK.js";import"./popover-BcoS9Jmp.js";import"./useIntersectionObserver-CiBk_Oug.js";function ps({onBuild:i}){return e.jsxs("section",{className:"following-intro","aria-labelledby":"following-intro-title",children:[e.jsx("h2",{id:"following-intro-title",children:"Build your personal research feed"}),e.jsx("p",{className:"following-intro-lead",children:"Describe a topic in your own words, or follow the tasks, benchmarks, authors, and organizations you care about, and this page collects their latest papers and results in one place."}),i&&e.jsxs("button",{type:"button",className:"research-topic-save following-intro-topic",onClick:i,children:[e.jsx(Ie,{"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(D,{to:"/settings",children:"Settings"}),"."]})]})}const je=16;function hs({open:i,onOpenChange:r}){return e.jsx(He,{open:i,onOpenChange:r,children:e.jsx(Ke,{className:"topic-dialog","aria-describedby":void 0,children:e.jsx(ms,{onDone:()=>r(!1)})})})}function ms({onDone:i}){var B,X,W,Y,V,J,K;const{user:r}=Ce(),g=Fe(),d=R({queryKey:["research-topic",r==null?void 0:r.hf_subject],queryFn:Q.topic,enabled:!!r}),t=R({queryKey:["research-follows",r==null?void 0:r.hf_subject],queryFn:Q.follows,enabled:!!r}),b=R({queryKey:["trending-tasks-follow"],queryFn:()=>se.trendingTasks({limit:je,level:0}),staleTime:10*60*1e3}),j=R({queryKey:["trending-methods-follow"],queryFn:()=>se.trendingMethods({limit:je}),staleTime:10*60*1e3}),c=R({queryKey:["research-follow-suggestions"],queryFn:Q.followSuggestions,staleTime:10*60*1e3}),v=(n=[])=>n.map(p=>({id:String(p.entity_id),name:p.name,image:p.image_url})),[P,A]=h.useState(null),[T,F]=h.useState([]),_=ke(),q=Se(),w=((B=d.data)==null?void 0:B.text)??"",o=P??w,S=o.trim().replace(/\s+/g," "),N=((X=d.data)==null?void 0:X.status)==="failed"&&S===w,m=S.length>=3&&(S!==w||N),C=_.isPending||q.isPending,a=(n,p)=>{var y;return((y=t.data)==null?void 0:y.some(k=>k.kind===n&&String(k.entity_id)===p))??!1},f=(n,p)=>{var y;return((y=T.find(k=>k.kind===n&&k.id===p))==null?void 0:y.follow)??a(n,p)},u=T.filter(n=>n.follow!==a(n.kind,n.id)),E=!C&&(m||u.length>0),M=(n,p,y)=>F(k=>[...k.filter(U=>U.kind!==n||U.id!==p),{kind:n,id:p,name:y,follow:!f(n,p)}]),I=()=>{if(!E)return;if(!r){m&&$e(S),u.length&&ze(u),window.location.href=Le(`${g.pathname}${g.search}`);return}const n=[...u.length?[q.mutateAsync(u)]:[],...m?[_.mutateAsync(S)]:[]];Promise.allSettled(n).then(p=>{p.every(y=>y.status==="fulfilled")&&i()})},H=(n,p,y,k)=>{const Z=[...(t.data??[]).filter(x=>x.kind===p).map(x=>({id:String(x.entity_id),name:x.name,slug:x.url.split("/").pop(),image:x.image_url})),...y.filter(x=>!a(p,x.id)).map(x=>({...x,suggested:!0}))];return Z.length>0&&e.jsxs("div",{className:"topic-dialog-group",children:[e.jsx("h3",{children:n}),e.jsxs(gs,{children:[Z.map(x=>{const O=f(p,x.id),G=p==="task"?ne(x.name,x.slug??void 0):x.name;return e.jsxs("button",{type:"button",className:"topic-dialog-chip","aria-pressed":O,disabled:C,"data-suggested":"suggested"in x||void 0,onClick:()=>M(p,x.id,G),children:[O?e.jsx(De,{"aria-hidden":"true"}):e.jsx(Ue,{"aria-hidden":"true"}),(p==="author"||p==="organization")&&e.jsx(fs,{kind:p,name:G,src:x.image}),G]},x.id)}),k&&e.jsxs(D,{to:k.to,className:"topic-dialog-browse",children:[k.label,e.jsx(Ge,{"aria-hidden":"true"})]})]})]})};return e.jsxs("form",{className:"topic-dialog-form",onSubmit:n=>{n.preventDefault(),I()},children:[e.jsx(Oe,{className:"topic-dialog-title",children:w||(W=t.data)!=null&&W.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:"Describe a topic in your own words"})}),e.jsx("p",{className:"topic-dialog-hint",children:"A model reads every new paper and adds the ones that match to your Following feed."}),e.jsx("textarea",{id:"topic-dialog-input",className:"research-topic-input",rows:4,maxLength:ge,"aria-label":"Research topic",placeholder:"e.g. diffusion policies for robot manipulation, or speculative decoding for LLM inference",value:o,onChange:n=>A(n.target.value),onKeyDown:n=>{n.key==="Enter"&&!n.shiftKey&&!n.nativeEvent.isComposing&&(n.preventDefault(),I())}}),e.jsxs("span",{className:"research-topic-count",children:[o.length,"/",ge]})]}),H("Trending tasks","task",((Y=b.data)==null?void 0:Y.results)??[],{to:"/tasks",label:"Browse tasks"}),H("Trending methods","method",((V=j.data)==null?void 0:V.results)??[],{to:"/methods",label:"Browse methods"}),H("Benchmarks","benchmark",[],{to:"/tasks",label:"Browse benchmarks"}),H("Popular authors","author",v((J=c.data)==null?void 0:J.authors)),H("Popular organizations","organization",v((K=c.data)==null?void 0:K.organizations),{to:"/organizations",label:"Browse organizations"}),(_.error||q.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:[w&&e.jsx("button",{type:"button",className:"research-follow-action topic-dialog-remove",disabled:C,onClick:()=>_.mutate(null,{onSuccess:i}),children:"Remove topic"}),e.jsx("button",{type:"button",className:"research-follow-action",disabled:C,onClick:i,children:"Cancel"}),e.jsx("button",{type:"submit",className:"research-topic-save",disabled:!E,children:u.some(n=>n.follow===!1)?"Save":u.length?"Follow":N?"Retry":w?"Update topic":"Follow"})]})]})}function gs({children:i}){const r=h.useRef(null);return h.useLayoutEffect(()=>{const g=r.current;if(!g)return;const d=()=>{const t=[...g.children],b=t.filter(c=>c.dataset.suggested);b.forEach(c=>{c.hidden=!1});const j=()=>new Set(t.filter(c=>!c.hidden).map(c=>c.offsetTop)).size;for(let c=b.length-1;c>=0&&j()>2;c--)b[c].hidden=!0};return d(),window.addEventListener("resize",d),()=>window.removeEventListener("resize",d)}),e.jsx("div",{ref:r,className:"topic-dialog-chips",children:i})}function fs({kind:i,name:r,src:g}){const[d,t]=h.useState(!1);if(g&&!d)return e.jsx("img",{className:`topic-dialog-chip-image is-${i}`,src:g,alt:"",loading:"lazy",onError:()=>t(!0)});if(i!=="author")return null;const b=r.split(/\s+/).filter(Boolean).map(j=>j[0]).slice(0,2).join("").toUpperCase();return e.jsx("span",{className:"topic-dialog-chip-image is-author is-initials","aria-hidden":"true",children:b})}const ye=45,xs=1800,bs=25,ws=350,js=i=>{const[r,g]=h.useState(z[0].slice(0,1)),[d,t]=h.useState(0);return h.useEffect(()=>{var A,T;if(!i)return;if((T=(A=window.matchMedia)==null?void 0:A.call(window,"(prefers-reduced-motion: reduce)"))!=null&&T.matches){g(z[0]),t(0);return}let b=0,j=1,c=!1,v;g(z[0].slice(0,j)),t(0);const P=()=>{const F=z[b];if(!c){if(j+=1,g(F.slice(0,j)),j===F.length){c=!0,v=window.setTimeout(P,xs);return}v=window.setTimeout(P,ye);return}if(j-=1,g(F.slice(0,j)),j===0){c=!1,b=(b+1)%z.length,t(b),v=window.setTimeout(P,ws);return}v=window.setTimeout(P,bs)};return v=window.setTimeout(P,ye),()=>window.clearTimeout(v)},[i]),{placeholder:r,prompt:z[d]}},ys=()=>{var C;const i=ve(),r=Ne(),[g,d]=h.useState({text:"",paperMentions:[]}),t=g.text,[b,j]=h.useState(0),[c,v]=h.useState(!1),[P,A]=h.useState(null),{placeholder:T,prompt:F}=js(!t),_=h.useRef(null),q=R({queryKey:["chatAvailability"],queryFn:()=>rs.getAvailability(),retry:!1,enabled:oe()}),w=oe()&&((C=q.data)==null?void 0:C.paper_mentions_enabled)!==!1,o=Je({draft:g,onChange:d,enabled:w,textareaRef:_}),S=Ze(g,o.open),N=t?S.completion:F;h.useLayoutEffect(()=>{const a=_.current;if(!a)return;const f=()=>{if(a.style.height="auto",t){a.style.height=`${Math.min(is(a),160)}px`;return}const u=a.placeholder,E=z.reduce((M,I)=>(a.placeholder=I,Math.max(M,a.scrollHeight)),0);a.placeholder=u,a.style.height=`${Math.min(E,160)}px`};return f(),window.addEventListener("resize",f),()=>window.removeEventListener("resize",f)},[t,N]);const m=async(a=g)=>{const f=a.text.trim();if(!(!f||c)){if(r){const u=new URLSearchParams({q:f,model:te}),E=`${Me}?${u}`,M=window.open(E,"_blank");if(!M){A(E);return}M.opener=null,A(null),d({text:"",paperMentions:[]});return}v(!0),os(a,te);try{const u=await ns(te);i(`/chat/${u.id}`)}catch{i("/chat")}}};return e.jsxs(e.Fragment,{children:[!r&&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(es,{text:g.text,mentions:g.paperMentions,scrollTop:b,variant:"home",completion:t?N:""}),e.jsx("textarea",{ref:_,rows:1,value:t,placeholder:T,"aria-label":"Ask the assistant",disabled:c,onChange:a=>{o.updateText(a.target.value,a.target.selectionStart),S.trackCaret(a.target)},onSelect:a=>{o.refresh(a.currentTarget.selectionStart),S.trackCaret(a.currentTarget)},onClick:a=>{o.refresh(a.currentTarget.selectionStart),S.trackCaret(a.currentTarget)},onScroll:a=>j(a.currentTarget.scrollTop),onBlur:a=>{var f,u;(u=(f=a.relatedTarget)==null?void 0:f.closest)!=null&&u.call(f,".chat-paper-picker")||window.setTimeout(o.close,0)},onKeyDown:a=>{if(!o.keyDown(a)){if(ss(a)&&N){a.preventDefault();const f=t+N;o.updateText(f,f.length),window.requestAnimationFrame(()=>{var u;return(u=_.current)==null?void 0:u.setSelectionRange(f.length,f.length)});return}a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),m())}},role:w?"combobox":void 0,"aria-expanded":w?o.open:void 0,"aria-controls":o.open?o.pickerId:void 0,"aria-activedescendant":o.open&&o.results.length?`${o.optionIdPrefix}-${o.activeIndex}`:void 0,"aria-autocomplete":w?"list":void 0,"aria-describedby":o.message?"ask-home-paper-mention-message":void 0})]}),e.jsx("button",{type:"button",className:`chat-send${t.trim()?" chat-send-on":""}`,onClick:()=>void m(),disabled:!t.trim()||c,"aria-label":"Ask the assistant",children:e.jsx(ts,{})})]}),P&&e.jsx("div",{className:"chat-paper-mention-message",role:"alert",children:e.jsx("a",{href:P,target:"_blank",rel:"noreferrer",children:"Open this question on paperswithcode.co"})}),o.message&&e.jsx("div",{id:"ask-home-paper-mention-message",className:"chat-paper-mention-message",role:"alert",children:o.message}),e.jsx(as,{open:o.open,query:o.query,results:o.results,activeIndex:o.activeIndex,loading:o.loading,error:o.error,onSelect:o.select,id:o.pickerId,optionIdPrefix:o.optionIdPrefix})]})]})},Pe={task:"Tasks",method:"Methods",benchmark:"Benchmarks",author:"Authors",organization:"Orgs"},vs=Object.keys(Pe),Vs=({following:i=!1,xTrending:r=!1})=>{var le,ce,de,ue,pe,he,me;const g=ve(),d=Ae(),t=d==null?void 0:d.user,[b,j]=Ee(),c=We(b,void 0,i?"month":"week"),v=s=>{const l=new URLSearchParams(b);l.delete("order_by"),l.delete("only");const L=l.toString();g(L?`${s}?${L}`:s)},P=s=>{const l=new URLSearchParams(b);s?l.set("only","topic"):l.delete("only");const L=l.toString();return L?`/following?${L}`:"/following"},A=R({queryKey:["top-tasks-sidebar"],queryFn:()=>se.topTasks(8),staleTime:10*60*1e3}),T=R({queryKey:["trending-tasks-sidebar"],queryFn:()=>se.trendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),F=ls({enabled:!i&&!r,page_size:30,order_by:"trending",order_dir:"desc",start_date:c.startDate,end_date:c.endDate,include_resources:!0}),_={start_date:c.startDate,end_date:c.endDate},q=we({queryKey:[...cs.feeds.xTrending,_],queryFn:({pageParam:s})=>ds.xTrending({..._,page:s,page_size:30,include_resources:!0}),initialPageParam:1,getNextPageParam:s=>s.next_page??void 0,enabled:r}),w=i&&b.get("only")==="topic",o={...c,topicOnly:w},S=we({queryKey:["research-feed",t==null?void 0:t.hf_subject,o],queryFn:({pageParam:s})=>Q.following(s,o),initialPageParam:0,getNextPageParam:(s,l)=>s.length===40?l.length*40:void 0,enabled:i&&!!t}),N=R({queryKey:["research-follows",t==null?void 0:t.hf_subject],queryFn:Q.follows,enabled:i&&!!t}),m=R({queryKey:["research-topic",t==null?void 0:t.hf_subject],queryFn:Q.topic,enabled:i&&!!t,refetchInterval:s=>s.state.data&&["pending","running"].includes(s.state.data.status)?1e4:!1}),C=!!m.data&&["pending","running"].includes(m.data.status),a=m.data?m.data.label??m.data.text:"",[f,u]=h.useState(!1),E=Re(),M=h.useRef(!1);h.useEffect(()=>{M.current&&!C&&E.invalidateQueries({queryKey:["research-feed",t==null?void 0:t.hf_subject]}),M.current=C},[C,E,t==null?void 0:t.hf_subject]);const I=i&&!!t&&((le=N.data)==null?void 0:le.length)===0&&m.isSuccess&&!m.data,H=i&&!(d!=null&&d.isLoading)&&!t||I,B=!!t||!qe(),[X,W]=h.useState(!1),[Y]=h.useState(()=>!!xe()||be().length>0),[V,J]=h.useState(!1);!X&&(m.data||(ce=N.data)!=null&&ce.length)&&W(!0),H&&!V&&(J(!0),B&&!X&&!Y&&u(!0));const K=ke(),{mutate:n}=K,p=h.useRef(!1);h.useEffect(()=>{var l;const s=xe();!t||!m.isSuccess||!s||p.current||(p.current=!0,s===((l=m.data)==null?void 0:l.text)?Be():n(s))},[t,m.isSuccess,m.data,n]);const y=Se(),{mutate:k}=y,U=h.useRef(!1);h.useEffect(()=>{const s=be();!t||!s.length||U.current||(U.current=!0,k(s))},[t,k]);const Z=h.useMemo(()=>vs.map(s=>{var l;return{kind:s,follows:i?((l=N.data)==null?void 0:l.filter(L=>L.kind===s))??[]:[]}}).filter(s=>s.follows.length>0),[i,N.data]),x=i&&(!!(d!=null&&d.isLoading)||!!t&&!I),O=i?S:r?q:F,G=h.useMemo(()=>{var s,l;return i?((s=S.data)==null?void 0:s.pages.flatMap(L=>L.map(ee=>({...fe(ee.paper),followReasons:ee.reasons}))))??[]:((l=r?q.data:F.data)==null?void 0:l.pages.flatMap(L=>L.results.map(ee=>({...fe(ee),followReasons:void 0}))))??[]},[i,r,S.data,q.data,F.data]),Te=us(O,"400px"),_e=O.isLoading||i&&(d==null?void 0:d.isLoading),re=O.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:r?"Papers people share most on X, picked daily":"Curated daily from arXiv and Hugging Face"})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsxs("aside",{className:"sidebar feed-sidebar",children:[x?e.jsxs("div",{className:"sidebar-section sidebar-section-follows",children:[e.jsx("div",{className:"sidebar-label",children:"You follow"}),((d==null?void 0:d.isLoading)||N.isLoading)&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:4}).map((s,l)=>e.jsx($,{className:"h-5 w-full"},l))}),N.isError&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"Couldn't load your follows."}),e.jsxs("div",{className:"sidebar-links",children:[m.data&&e.jsxs("div",{className:`sidebar-follow-topic ${w?"active":""}`,children:[e.jsxs(D,{to:P(!w),className:"sidebar-link sidebar-follow-link",title:w?"Show papers from everything you follow":`Show only papers about “${m.data.text}”`,"aria-current":w?"true":void 0,children:[e.jsx("span",{className:"sidebar-follow-kind",children:"Topic"}),e.jsx("span",{className:"sidebar-follow-name",children:a})]}),e.jsx("button",{type:"button",className:"sidebar-follow-edit","aria-label":"Edit topic","aria-expanded":f,onClick:()=>u(!0),children:"edit"})]}),Z.map(s=>e.jsxs("div",{className:"sidebar-follow-group",children:[e.jsx("span",{className:"sidebar-follow-kind",children:Pe[s.kind]}),s.follows.map(l=>e.jsx(D,{to:l.url,className:"sidebar-link sidebar-follow-link",children:e.jsx("span",{className:"sidebar-follow-name",children:l.name})},l.entity_id))]},s.kind))]}),e.jsx(D,{to:"/settings",className:"sidebar-follow-manage",children:"Manage in Settings"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"sidebar-section sidebar-section-top-domains",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),A.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,l)=>e.jsx($,{className:"h-5 w-full"},l))}),e.jsxs("div",{className:"sidebar-links",children:[(de=A.data)==null?void 0:de.map(s=>e.jsxs(D,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[ne(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(D,{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"}),T.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,l)=>e.jsx($,{className:"h-5 w-full"},l))}),((pe=(ue=T.data)==null?void 0:ue.results)==null?void 0:pe.length)===0&&!T.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:(me=(he=T.data)==null?void 0:he.results)==null?void 0:me.map(s=>e.jsxs(D,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[ne(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))})]})]}),e.jsx(Xe,{})]}),e.jsxs("div",{className:"feed-main",children:[(oe()||Ne())&&e.jsx("div",{className:"feed-chat",children:e.jsx(ys,{})}),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 ${i||r?"":"active"}`,onClick:()=>v("/"),children:"trending"}),e.jsx("button",{className:`sort-btn ${r?"active":""}`,onClick:()=>v("/x-trending"),children:"trending (X)"}),e.jsx("button",{className:`sort-btn ${i?"active":""}`,onClick:()=>v("/following"),children:"following"})]})}),e.jsx(Ye,{startDate:c.startDate,endDate:c.endDate,onChange:s=>j(Ve(b,s))})]}),re&&e.jsx(ae,{variant:"destructive",className:"mb-4",children:e.jsxs(ie,{children:["Failed to load papers. ",e.jsx("button",{type:"button",onClick:()=>void O.refetch(),children:"Try again"})]})}),K.isError&&K.variables&&e.jsx(ae,{variant:"destructive",className:"mb-4",children:e.jsxs(ie,{children:["Could not follow “",K.variables,"”. ",e.jsx("button",{type:"button",onClick:()=>n(K.variables),children:"Try again"})]})}),y.isError&&y.variables&&e.jsx(ae,{variant:"destructive",className:"mb-4",children:e.jsxs(ie,{children:["Could not follow ",y.variables.map(s=>s.name).join(", "),". ",e.jsx("button",{type:"button",onClick:()=>k(y.variables),children:"Try again"})]})}),i&&!!t&&m.isSuccess&&!N.isPending&&!I&&(m.data?C?e.jsxs("div",{className:"following-topic-note",role:"status",children:["Showing the closest papers about “",a,"” now. A model is reading papers to refine these matches, which takes a few minutes."]}):null:e.jsxs("div",{className:"following-topic-note",role:"status",children:["Describe a topic in your own words, and a model adds matching new papers to this feed."," ",e.jsx("button",{type:"button",className:"link-button",onClick:()=>u(!0),children:"Follow a topic"})]})),i&&B&&e.jsx(hs,{open:f,onOpenChange:u}),w&&m.data&&e.jsxs("div",{className:"following-topic-note following-topic-filter",role:"status",children:["Showing only papers about “",a,"”."," ",e.jsx(D,{to:P(!1),children:"Show everything you follow"})]}),H?e.jsx(ps,{onBuild:B?()=>u(!0):void 0}):_e?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,l)=>e.jsxs("div",{className:"paper-card",children:[e.jsx("div",{className:"paper-thumb-wrap",children:e.jsx($,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx($,{className:"h-6 w-3/4"}),e.jsx($,{className:"h-4 w-1/2"}),e.jsx($,{className:"h-12 w-full"})]})]},l))}):G.length===0?re?null:e.jsx("div",{className:"no-results",children:w?e.jsxs(e.Fragment,{children:["No papers about your topic match these filters. Widen the date range or ",e.jsx("button",{type:"button",className:"link-button",onClick:()=>u(!0),children:"edit your topic"}),"."]}):i?e.jsxs(e.Fragment,{children:["No papers from your topic or follows match these filters. Widen the date range, or follow more from ",e.jsx(D,{to:"/tasks",children:"tasks"}),", ",e.jsx(D,{to:"/methods",children:"methods"}),", benchmark, author, or organization pages."]}):r?"No papers shared on X in this window.":"No papers in this window."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:G.map((s,l)=>e.jsx(Qe,{paper:s,rank:l+1,followReasons:s.followReasons},s.id))}),e.jsx("div",{ref:Te,style:{height:1}}),O.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})]})};export{ys as AskAssistant,Vs as default}; +import{j as e,L as D,a as Ce,b as Fe,r as h,h as Le,C as De,c as ve,d as Ae,e as Ee,f as Re,i as qe,g as oe,k as Ne,l as Me}from"./index-D6jcIRWs.js";import{S as Ie}from"./sparkles-r8uPx2-0.js";import{u as R}from"./useQuery-CUJUm4FY.js";import{D as He,a as Ke,b as Oe}from"./dialog-vGFIbcd-.js";import{c as se}from"./catalog-PYrB8_bm.js";import{T as ge,r as Q}from"./research-BggtGgC2.js";import{d as ne,t as fe}from"./colors-CLwl8a2d.js";import{u as ke,a as Se,s as $e,b as ze,r as xe,c as be,d as Be}from"./researchTopic-NFMcqCcs.js";import{P as Ue}from"./plus-C4UQ62Q1.js";import{A as Ge}from"./arrow-right-CFRHnFt4.js";import{P as Qe}from"./components-DO1X940E.js";import{M as Xe}from"./McpShowcase-CS9LZY9p.js";import{r as We,P as Ye,w as Ve}from"./PaperDateFilter-CPIqaHaq.js";import{u as Je,a as Ze,P as es,i as ss,A as ts,b as as,S as z,c as is,D as te,q as os,d as ns}from"./chatSessions-DByIWBno.js";import{c as rs}from"./chat-ChnK8XDU.js";import{u as ls}from"./usePapers-BbCSwcVk.js";import{p as cs,a as ds}from"./papers-DIIIPDpj.js";import{u as us}from"./useInfiniteScroll-Dm7JY_X4.js";import{S as $}from"./skeleton-BqkYFmXl.js";import{A as ae,a as ie}from"./alert-2MbxVzGL.js";import{u as we}from"./useInfiniteQuery-FXco4P1n.js";import"./useMutation-p6mN4h17.js";import"./AuthorAvatar-UMHOVOr9.js";import"./LatexTitle-D_92Jowu.js";import"./safeExternalHref-CkBrsh84.js";import"./AgentLogos-CFt_vIO2.js";import"./popover-DCjqGpW0.js";import"./useIntersectionObserver-3LTuEaFW.js";function ps({onBuild:i}){return e.jsxs("section",{className:"following-intro","aria-labelledby":"following-intro-title",children:[e.jsx("h2",{id:"following-intro-title",children:"Build your personal research feed"}),e.jsx("p",{className:"following-intro-lead",children:"Describe a topic in your own words, or follow the tasks, benchmarks, authors, and organizations you care about, and this page collects their latest papers and results in one place."}),i&&e.jsxs("button",{type:"button",className:"research-topic-save following-intro-topic",onClick:i,children:[e.jsx(Ie,{"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(D,{to:"/settings",children:"Settings"}),"."]})]})}const je=16;function hs({open:i,onOpenChange:r}){return e.jsx(He,{open:i,onOpenChange:r,children:e.jsx(Ke,{className:"topic-dialog","aria-describedby":void 0,children:e.jsx(ms,{onDone:()=>r(!1)})})})}function ms({onDone:i}){var B,X,W,Y,V,J,K;const{user:r}=Ce(),g=Fe(),d=R({queryKey:["research-topic",r==null?void 0:r.hf_subject],queryFn:Q.topic,enabled:!!r}),t=R({queryKey:["research-follows",r==null?void 0:r.hf_subject],queryFn:Q.follows,enabled:!!r}),b=R({queryKey:["trending-tasks-follow"],queryFn:()=>se.trendingTasks({limit:je,level:0}),staleTime:10*60*1e3}),j=R({queryKey:["trending-methods-follow"],queryFn:()=>se.trendingMethods({limit:je}),staleTime:10*60*1e3}),c=R({queryKey:["research-follow-suggestions"],queryFn:Q.followSuggestions,staleTime:10*60*1e3}),v=(n=[])=>n.map(p=>({id:String(p.entity_id),name:p.name,image:p.image_url})),[P,A]=h.useState(null),[T,F]=h.useState([]),_=ke(),q=Se(),w=((B=d.data)==null?void 0:B.text)??"",o=P??w,S=o.trim().replace(/\s+/g," "),N=((X=d.data)==null?void 0:X.status)==="failed"&&S===w,m=S.length>=3&&(S!==w||N),C=_.isPending||q.isPending,a=(n,p)=>{var y;return((y=t.data)==null?void 0:y.some(k=>k.kind===n&&String(k.entity_id)===p))??!1},f=(n,p)=>{var y;return((y=T.find(k=>k.kind===n&&k.id===p))==null?void 0:y.follow)??a(n,p)},u=T.filter(n=>n.follow!==a(n.kind,n.id)),E=!C&&(m||u.length>0),M=(n,p,y)=>F(k=>[...k.filter(U=>U.kind!==n||U.id!==p),{kind:n,id:p,name:y,follow:!f(n,p)}]),I=()=>{if(!E)return;if(!r){m&&$e(S),u.length&&ze(u),window.location.href=Le(`${g.pathname}${g.search}`);return}const n=[...u.length?[q.mutateAsync(u)]:[],...m?[_.mutateAsync(S)]:[]];Promise.allSettled(n).then(p=>{p.every(y=>y.status==="fulfilled")&&i()})},H=(n,p,y,k)=>{const Z=[...(t.data??[]).filter(x=>x.kind===p).map(x=>({id:String(x.entity_id),name:x.name,slug:x.url.split("/").pop(),image:x.image_url})),...y.filter(x=>!a(p,x.id)).map(x=>({...x,suggested:!0}))];return Z.length>0&&e.jsxs("div",{className:"topic-dialog-group",children:[e.jsx("h3",{children:n}),e.jsxs(gs,{children:[Z.map(x=>{const O=f(p,x.id),G=p==="task"?ne(x.name,x.slug??void 0):x.name;return e.jsxs("button",{type:"button",className:"topic-dialog-chip","aria-pressed":O,disabled:C,"data-suggested":"suggested"in x||void 0,onClick:()=>M(p,x.id,G),children:[O?e.jsx(De,{"aria-hidden":"true"}):e.jsx(Ue,{"aria-hidden":"true"}),(p==="author"||p==="organization")&&e.jsx(fs,{kind:p,name:G,src:x.image}),G]},x.id)}),k&&e.jsxs(D,{to:k.to,className:"topic-dialog-browse",children:[k.label,e.jsx(Ge,{"aria-hidden":"true"})]})]})]})};return e.jsxs("form",{className:"topic-dialog-form",onSubmit:n=>{n.preventDefault(),I()},children:[e.jsx(Oe,{className:"topic-dialog-title",children:w||(W=t.data)!=null&&W.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:"Describe a topic in your own words"})}),e.jsx("p",{className:"topic-dialog-hint",children:"A model reads every new paper and adds the ones that match to your Following feed."}),e.jsx("textarea",{id:"topic-dialog-input",className:"research-topic-input",rows:4,maxLength:ge,"aria-label":"Research topic",placeholder:"e.g. diffusion policies for robot manipulation, or speculative decoding for LLM inference",value:o,onChange:n=>A(n.target.value),onKeyDown:n=>{n.key==="Enter"&&!n.shiftKey&&!n.nativeEvent.isComposing&&(n.preventDefault(),I())}}),e.jsxs("span",{className:"research-topic-count",children:[o.length,"/",ge]})]}),H("Trending tasks","task",((Y=b.data)==null?void 0:Y.results)??[],{to:"/tasks",label:"Browse tasks"}),H("Trending methods","method",((V=j.data)==null?void 0:V.results)??[],{to:"/methods",label:"Browse methods"}),H("Benchmarks","benchmark",[],{to:"/tasks",label:"Browse benchmarks"}),H("Popular authors","author",v((J=c.data)==null?void 0:J.authors)),H("Popular organizations","organization",v((K=c.data)==null?void 0:K.organizations),{to:"/organizations",label:"Browse organizations"}),(_.error||q.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:[w&&e.jsx("button",{type:"button",className:"research-follow-action topic-dialog-remove",disabled:C,onClick:()=>_.mutate(null,{onSuccess:i}),children:"Remove topic"}),e.jsx("button",{type:"button",className:"research-follow-action",disabled:C,onClick:i,children:"Cancel"}),e.jsx("button",{type:"submit",className:"research-topic-save",disabled:!E,children:u.some(n=>n.follow===!1)?"Save":u.length?"Follow":N?"Retry":w?"Update topic":"Follow"})]})]})}function gs({children:i}){const r=h.useRef(null);return h.useLayoutEffect(()=>{const g=r.current;if(!g)return;const d=()=>{const t=[...g.children],b=t.filter(c=>c.dataset.suggested);b.forEach(c=>{c.hidden=!1});const j=()=>new Set(t.filter(c=>!c.hidden).map(c=>c.offsetTop)).size;for(let c=b.length-1;c>=0&&j()>2;c--)b[c].hidden=!0};return d(),window.addEventListener("resize",d),()=>window.removeEventListener("resize",d)}),e.jsx("div",{ref:r,className:"topic-dialog-chips",children:i})}function fs({kind:i,name:r,src:g}){const[d,t]=h.useState(!1);if(g&&!d)return e.jsx("img",{className:`topic-dialog-chip-image is-${i}`,src:g,alt:"",loading:"lazy",onError:()=>t(!0)});if(i!=="author")return null;const b=r.split(/\s+/).filter(Boolean).map(j=>j[0]).slice(0,2).join("").toUpperCase();return e.jsx("span",{className:"topic-dialog-chip-image is-author is-initials","aria-hidden":"true",children:b})}const ye=45,xs=1800,bs=25,ws=350,js=i=>{const[r,g]=h.useState(z[0].slice(0,1)),[d,t]=h.useState(0);return h.useEffect(()=>{var A,T;if(!i)return;if((T=(A=window.matchMedia)==null?void 0:A.call(window,"(prefers-reduced-motion: reduce)"))!=null&&T.matches){g(z[0]),t(0);return}let b=0,j=1,c=!1,v;g(z[0].slice(0,j)),t(0);const P=()=>{const F=z[b];if(!c){if(j+=1,g(F.slice(0,j)),j===F.length){c=!0,v=window.setTimeout(P,xs);return}v=window.setTimeout(P,ye);return}if(j-=1,g(F.slice(0,j)),j===0){c=!1,b=(b+1)%z.length,t(b),v=window.setTimeout(P,ws);return}v=window.setTimeout(P,bs)};return v=window.setTimeout(P,ye),()=>window.clearTimeout(v)},[i]),{placeholder:r,prompt:z[d]}},ys=()=>{var C;const i=ve(),r=Ne(),[g,d]=h.useState({text:"",paperMentions:[]}),t=g.text,[b,j]=h.useState(0),[c,v]=h.useState(!1),[P,A]=h.useState(null),{placeholder:T,prompt:F}=js(!t),_=h.useRef(null),q=R({queryKey:["chatAvailability"],queryFn:()=>rs.getAvailability(),retry:!1,enabled:oe()}),w=oe()&&((C=q.data)==null?void 0:C.paper_mentions_enabled)!==!1,o=Je({draft:g,onChange:d,enabled:w,textareaRef:_}),S=Ze(g,o.open),N=t?S.completion:F;h.useLayoutEffect(()=>{const a=_.current;if(!a)return;const f=()=>{if(a.style.height="auto",t){a.style.height=`${Math.min(is(a),160)}px`;return}const u=a.placeholder,E=z.reduce((M,I)=>(a.placeholder=I,Math.max(M,a.scrollHeight)),0);a.placeholder=u,a.style.height=`${Math.min(E,160)}px`};return f(),window.addEventListener("resize",f),()=>window.removeEventListener("resize",f)},[t,N]);const m=async(a=g)=>{const f=a.text.trim();if(!(!f||c)){if(r){const u=new URLSearchParams({q:f,model:te}),E=`${Me}?${u}`,M=window.open(E,"_blank");if(!M){A(E);return}M.opener=null,A(null),d({text:"",paperMentions:[]});return}v(!0),os(a,te);try{const u=await ns(te);i(`/chat/${u.id}`)}catch{i("/chat")}}};return e.jsxs(e.Fragment,{children:[!r&&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(es,{text:g.text,mentions:g.paperMentions,scrollTop:b,variant:"home",completion:t?N:""}),e.jsx("textarea",{ref:_,rows:1,value:t,placeholder:T,"aria-label":"Ask the assistant",disabled:c,onChange:a=>{o.updateText(a.target.value,a.target.selectionStart),S.trackCaret(a.target)},onSelect:a=>{o.refresh(a.currentTarget.selectionStart),S.trackCaret(a.currentTarget)},onClick:a=>{o.refresh(a.currentTarget.selectionStart),S.trackCaret(a.currentTarget)},onScroll:a=>j(a.currentTarget.scrollTop),onBlur:a=>{var f,u;(u=(f=a.relatedTarget)==null?void 0:f.closest)!=null&&u.call(f,".chat-paper-picker")||window.setTimeout(o.close,0)},onKeyDown:a=>{if(!o.keyDown(a)){if(ss(a)&&N){a.preventDefault();const f=t+N;o.updateText(f,f.length),window.requestAnimationFrame(()=>{var u;return(u=_.current)==null?void 0:u.setSelectionRange(f.length,f.length)});return}a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),m())}},role:w?"combobox":void 0,"aria-expanded":w?o.open:void 0,"aria-controls":o.open?o.pickerId:void 0,"aria-activedescendant":o.open&&o.results.length?`${o.optionIdPrefix}-${o.activeIndex}`:void 0,"aria-autocomplete":w?"list":void 0,"aria-describedby":o.message?"ask-home-paper-mention-message":void 0})]}),e.jsx("button",{type:"button",className:`chat-send${t.trim()?" chat-send-on":""}`,onClick:()=>void m(),disabled:!t.trim()||c,"aria-label":"Ask the assistant",children:e.jsx(ts,{})})]}),P&&e.jsx("div",{className:"chat-paper-mention-message",role:"alert",children:e.jsx("a",{href:P,target:"_blank",rel:"noreferrer",children:"Open this question on paperswithcode.co"})}),o.message&&e.jsx("div",{id:"ask-home-paper-mention-message",className:"chat-paper-mention-message",role:"alert",children:o.message}),e.jsx(as,{open:o.open,query:o.query,results:o.results,activeIndex:o.activeIndex,loading:o.loading,error:o.error,onSelect:o.select,id:o.pickerId,optionIdPrefix:o.optionIdPrefix})]})]})},Pe={task:"Tasks",method:"Methods",benchmark:"Benchmarks",author:"Authors",organization:"Orgs"},vs=Object.keys(Pe),Vs=({following:i=!1,xTrending:r=!1})=>{var le,ce,de,ue,pe,he,me;const g=ve(),d=Ae(),t=d==null?void 0:d.user,[b,j]=Ee(),c=We(b,void 0,i?"month":"week"),v=s=>{const l=new URLSearchParams(b);l.delete("order_by"),l.delete("only");const L=l.toString();g(L?`${s}?${L}`:s)},P=s=>{const l=new URLSearchParams(b);s?l.set("only","topic"):l.delete("only");const L=l.toString();return L?`/following?${L}`:"/following"},A=R({queryKey:["top-tasks-sidebar"],queryFn:()=>se.topTasks(8),staleTime:10*60*1e3}),T=R({queryKey:["trending-tasks-sidebar"],queryFn:()=>se.trendingTasks({limit:8,level:0}),staleTime:10*60*1e3}),F=ls({enabled:!i&&!r,page_size:30,order_by:"trending",order_dir:"desc",start_date:c.startDate,end_date:c.endDate,include_resources:!0}),_={start_date:c.startDate,end_date:c.endDate},q=we({queryKey:[...cs.feeds.xTrending,_],queryFn:({pageParam:s})=>ds.xTrending({..._,page:s,page_size:30,include_resources:!0}),initialPageParam:1,getNextPageParam:s=>s.next_page??void 0,enabled:r}),w=i&&b.get("only")==="topic",o={...c,topicOnly:w},S=we({queryKey:["research-feed",t==null?void 0:t.hf_subject,o],queryFn:({pageParam:s})=>Q.following(s,o),initialPageParam:0,getNextPageParam:(s,l)=>s.length===40?l.length*40:void 0,enabled:i&&!!t}),N=R({queryKey:["research-follows",t==null?void 0:t.hf_subject],queryFn:Q.follows,enabled:i&&!!t}),m=R({queryKey:["research-topic",t==null?void 0:t.hf_subject],queryFn:Q.topic,enabled:i&&!!t,refetchInterval:s=>s.state.data&&["pending","running"].includes(s.state.data.status)?1e4:!1}),C=!!m.data&&["pending","running"].includes(m.data.status),a=m.data?m.data.label??m.data.text:"",[f,u]=h.useState(!1),E=Re(),M=h.useRef(!1);h.useEffect(()=>{M.current&&!C&&E.invalidateQueries({queryKey:["research-feed",t==null?void 0:t.hf_subject]}),M.current=C},[C,E,t==null?void 0:t.hf_subject]);const I=i&&!!t&&((le=N.data)==null?void 0:le.length)===0&&m.isSuccess&&!m.data,H=i&&!(d!=null&&d.isLoading)&&!t||I,B=!!t||!qe(),[X,W]=h.useState(!1),[Y]=h.useState(()=>!!xe()||be().length>0),[V,J]=h.useState(!1);!X&&(m.data||(ce=N.data)!=null&&ce.length)&&W(!0),H&&!V&&(J(!0),B&&!X&&!Y&&u(!0));const K=ke(),{mutate:n}=K,p=h.useRef(!1);h.useEffect(()=>{var l;const s=xe();!t||!m.isSuccess||!s||p.current||(p.current=!0,s===((l=m.data)==null?void 0:l.text)?Be():n(s))},[t,m.isSuccess,m.data,n]);const y=Se(),{mutate:k}=y,U=h.useRef(!1);h.useEffect(()=>{const s=be();!t||!s.length||U.current||(U.current=!0,k(s))},[t,k]);const Z=h.useMemo(()=>vs.map(s=>{var l;return{kind:s,follows:i?((l=N.data)==null?void 0:l.filter(L=>L.kind===s))??[]:[]}}).filter(s=>s.follows.length>0),[i,N.data]),x=i&&(!!(d!=null&&d.isLoading)||!!t&&!I),O=i?S:r?q:F,G=h.useMemo(()=>{var s,l;return i?((s=S.data)==null?void 0:s.pages.flatMap(L=>L.map(ee=>({...fe(ee.paper),followReasons:ee.reasons}))))??[]:((l=r?q.data:F.data)==null?void 0:l.pages.flatMap(L=>L.results.map(ee=>({...fe(ee),followReasons:void 0}))))??[]},[i,r,S.data,q.data,F.data]),Te=us(O,"400px"),_e=O.isLoading||i&&(d==null?void 0:d.isLoading),re=O.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:r?"Papers people share most on X, picked daily":"Curated daily from arXiv and Hugging Face"})]})}),e.jsxs("div",{className:"layout-with-sidebar",children:[e.jsxs("aside",{className:"sidebar feed-sidebar",children:[x?e.jsxs("div",{className:"sidebar-section sidebar-section-follows",children:[e.jsx("div",{className:"sidebar-label",children:"You follow"}),((d==null?void 0:d.isLoading)||N.isLoading)&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:4}).map((s,l)=>e.jsx($,{className:"h-5 w-full"},l))}),N.isError&&e.jsx("div",{style:{fontSize:12,color:"var(--ink-faint)"},children:"Couldn't load your follows."}),e.jsxs("div",{className:"sidebar-links",children:[m.data&&e.jsxs("div",{className:`sidebar-follow-topic ${w?"active":""}`,children:[e.jsxs(D,{to:P(!w),className:"sidebar-link sidebar-follow-link",title:w?"Show papers from everything you follow":`Show only papers about “${m.data.text}”`,"aria-current":w?"true":void 0,children:[e.jsx("span",{className:"sidebar-follow-kind",children:"Topic"}),e.jsx("span",{className:"sidebar-follow-name",children:a})]}),e.jsx("button",{type:"button",className:"sidebar-follow-edit","aria-label":"Edit topic","aria-expanded":f,onClick:()=>u(!0),children:"edit"})]}),Z.map(s=>e.jsxs("div",{className:"sidebar-follow-group",children:[e.jsx("span",{className:"sidebar-follow-kind",children:Pe[s.kind]}),s.follows.map(l=>e.jsx(D,{to:l.url,className:"sidebar-link sidebar-follow-link",children:e.jsx("span",{className:"sidebar-follow-name",children:l.name})},l.entity_id))]},s.kind))]}),e.jsx(D,{to:"/settings",className:"sidebar-follow-manage",children:"Manage in Settings"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"sidebar-section sidebar-section-top-domains",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),A.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,l)=>e.jsx($,{className:"h-5 w-full"},l))}),e.jsxs("div",{className:"sidebar-links",children:[(de=A.data)==null?void 0:de.map(s=>e.jsxs(D,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[ne(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id)),e.jsx(D,{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"}),T.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,l)=>e.jsx($,{className:"h-5 w-full"},l))}),((pe=(ue=T.data)==null?void 0:ue.results)==null?void 0:pe.length)===0&&!T.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:(me=(he=T.data)==null?void 0:he.results)==null?void 0:me.map(s=>e.jsxs(D,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[ne(s.name,s.slug),e.jsxs("span",{className:"count",children:[s.share_lift.toFixed(1),"x"]})]},s.id))})]})]}),e.jsx(Xe,{})]}),e.jsxs("div",{className:"feed-main",children:[(oe()||Ne())&&e.jsx("div",{className:"feed-chat",children:e.jsx(ys,{})}),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 ${i||r?"":"active"}`,onClick:()=>v("/"),children:"trending"}),e.jsx("button",{className:`sort-btn ${r?"active":""}`,onClick:()=>v("/x-trending"),children:"trending (X)"}),e.jsx("button",{className:`sort-btn ${i?"active":""}`,onClick:()=>v("/following"),children:"following"})]})}),e.jsx(Ye,{startDate:c.startDate,endDate:c.endDate,onChange:s=>j(Ve(b,s))})]}),re&&e.jsx(ae,{variant:"destructive",className:"mb-4",children:e.jsxs(ie,{children:["Failed to load papers. ",e.jsx("button",{type:"button",onClick:()=>void O.refetch(),children:"Try again"})]})}),K.isError&&K.variables&&e.jsx(ae,{variant:"destructive",className:"mb-4",children:e.jsxs(ie,{children:["Could not follow “",K.variables,"”. ",e.jsx("button",{type:"button",onClick:()=>n(K.variables),children:"Try again"})]})}),y.isError&&y.variables&&e.jsx(ae,{variant:"destructive",className:"mb-4",children:e.jsxs(ie,{children:["Could not follow ",y.variables.map(s=>s.name).join(", "),". ",e.jsx("button",{type:"button",onClick:()=>k(y.variables),children:"Try again"})]})}),i&&!!t&&m.isSuccess&&!N.isPending&&!I&&(m.data?C?e.jsxs("div",{className:"following-topic-note",role:"status",children:["Showing the closest papers about “",a,"” now. A model is reading papers to refine these matches, which takes a few minutes."]}):null:e.jsxs("div",{className:"following-topic-note",role:"status",children:["Describe a topic in your own words, and a model adds matching new papers to this feed."," ",e.jsx("button",{type:"button",className:"link-button",onClick:()=>u(!0),children:"Follow a topic"})]})),i&&B&&e.jsx(hs,{open:f,onOpenChange:u}),w&&m.data&&e.jsxs("div",{className:"following-topic-note following-topic-filter",role:"status",children:["Showing only papers about “",a,"”."," ",e.jsx(D,{to:P(!1),children:"Show everything you follow"})]}),H?e.jsx(ps,{onBuild:B?()=>u(!0):void 0}):_e?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,l)=>e.jsxs("div",{className:"paper-card",children:[e.jsx("div",{className:"paper-thumb-wrap",children:e.jsx($,{className:"paper-thumb-skeleton"})}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx($,{className:"h-6 w-3/4"}),e.jsx($,{className:"h-4 w-1/2"}),e.jsx($,{className:"h-12 w-full"})]})]},l))}):G.length===0?re?null:e.jsx("div",{className:"no-results",children:w?e.jsxs(e.Fragment,{children:["No papers about your topic match these filters. Widen the date range or ",e.jsx("button",{type:"button",className:"link-button",onClick:()=>u(!0),children:"edit your topic"}),"."]}):i?e.jsxs(e.Fragment,{children:["No papers from your topic or follows match these filters. Widen the date range, or follow more from ",e.jsx(D,{to:"/tasks",children:"tasks"}),", ",e.jsx(D,{to:"/methods",children:"methods"}),", benchmark, author, or organization pages."]}):r?"No papers shared on X in this window.":"No papers in this window."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:G.map((s,l)=>e.jsx(Qe,{paper:s,rank:l+1,followReasons:s.followReasons},s.id))}),e.jsx("div",{ref:Te,style:{height:1}}),O.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})]})]})]})};export{ys as AskAssistant,Vs as default}; diff --git a/assets/FollowingView-CVyxNxmM.js b/assets/FollowingView-CVyxNxmM.js new file mode 100644 index 0000000000000000000000000000000000000000..cd6c15fb9d772c403a6bf0c8a754e3f5926aa627 --- /dev/null +++ b/assets/FollowingView-CVyxNxmM.js @@ -0,0 +1 @@ +import{j as o}from"./index-D6jcIRWs.js";import r from"./FeedView-L-eiYDg9.js";import"./sparkles-r8uPx2-0.js";import"./useQuery-CUJUm4FY.js";import"./dialog-vGFIbcd-.js";import"./catalog-PYrB8_bm.js";import"./research-BggtGgC2.js";import"./colors-CLwl8a2d.js";import"./researchTopic-NFMcqCcs.js";import"./useMutation-p6mN4h17.js";import"./plus-C4UQ62Q1.js";import"./arrow-right-CFRHnFt4.js";import"./components-DO1X940E.js";import"./papers-DIIIPDpj.js";import"./AuthorAvatar-UMHOVOr9.js";import"./LatexTitle-D_92Jowu.js";import"./safeExternalHref-CkBrsh84.js";import"./McpShowcase-CS9LZY9p.js";import"./AgentLogos-CFt_vIO2.js";import"./PaperDateFilter-CPIqaHaq.js";import"./popover-DCjqGpW0.js";import"./chatSessions-DByIWBno.js";import"./chat-ChnK8XDU.js";import"./usePapers-BbCSwcVk.js";import"./useInfiniteQuery-FXco4P1n.js";import"./useInfiniteScroll-Dm7JY_X4.js";import"./useIntersectionObserver-3LTuEaFW.js";import"./skeleton-BqkYFmXl.js";import"./alert-2MbxVzGL.js";function B(){return o.jsx(r,{following:!0})}export{B as default}; diff --git a/assets/FollowingView-CYdAvQ9K.js b/assets/FollowingView-CYdAvQ9K.js deleted file mode 100644 index 72f52b8c3f46c9fe27c2ccd51b9d8906045e58f3..0000000000000000000000000000000000000000 --- a/assets/FollowingView-CYdAvQ9K.js +++ /dev/null @@ -1 +0,0 @@ -import{j as o}from"./index-CqKcHUvZ.js";import r from"./FeedView-EM1uL5u1.js";import"./sparkles-BKRdZneA.js";import"./useQuery-Cngk7eL9.js";import"./dialog-B-oqHDuH.js";import"./catalog-D26nGNnK.js";import"./research-Dt0MUW0x.js";import"./colors-_scCXfCe.js";import"./researchTopic-k4qgoW39.js";import"./useMutation-BItMAQ7s.js";import"./plus-DZF-NxR0.js";import"./arrow-right-DCfHXCdw.js";import"./components-Dmnn5Z5p.js";import"./papers-bE3C_Qzl.js";import"./AuthorAvatar-CWCqOa0h.js";import"./LatexTitle-BI9yl-Fo.js";import"./safeExternalHref-CkBrsh84.js";import"./McpShowcase-oHgWM9FI.js";import"./AgentLogos-ClqC1BaK.js";import"./PaperDateFilter-zHw5tq6B.js";import"./popover-BcoS9Jmp.js";import"./chatSessions-D75G2_U7.js";import"./chat-DGBJkcmd.js";import"./usePapers-By3yMmMn.js";import"./useInfiniteQuery-lxaMAHEu.js";import"./useInfiniteScroll-DVF-b-LX.js";import"./useIntersectionObserver-CiBk_Oug.js";import"./skeleton-DleNhBYA.js";import"./alert-Z2yFUcyL.js";function B(){return o.jsx(r,{following:!0})}export{B as default}; diff --git a/assets/FrameworksIndexView-BjBwZMDx.js b/assets/FrameworksIndexView-BxWPuGhr.js similarity index 92% rename from assets/FrameworksIndexView-BjBwZMDx.js rename to assets/FrameworksIndexView-BxWPuGhr.js index 1e14166c1dc8e2e22969ff8020f71f9d07f6bfcd..13b03464b2ed7787a435717a61090eeff1041156 100644 --- a/assets/FrameworksIndexView-BjBwZMDx.js +++ b/assets/FrameworksIndexView-BxWPuGhr.js @@ -1 +1 @@ -import{c as d,j as e,L as o,K as m}from"./index-CqKcHUvZ.js";import{u as p}from"./useQuery-Cngk7eL9.js";import{I as h}from"./components-Dmnn5Z5p.js";import{c as u}from"./catalog-D26nGNnK.js";import{c as g,h as f}from"./colors-_scCXfCe.js";import"./papers-bE3C_Qzl.js";import"./AuthorAvatar-CWCqOa0h.js";import"./LatexTitle-BI9yl-Fo.js";import"./safeExternalHref-CkBrsh84.js";const x={gpu:"GPU",cpu:"CPU",apple:"Apple silicon"},j={display:"flex",alignItems:"baseline",justifyContent:"space-between",flexWrap:"wrap",gap:"6px 24px",paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},k={fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},_={fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},v={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},w=({platform:r})=>{const n=g(f(r));return e.jsx("span",{className:"framework-platform-chip",style:{background:n.bg,color:n.text},children:x[r]})},b=({framework:r})=>{const n=d(),l=`/papers?framework=${encodeURIComponent(r.slug)}`;return e.jsxs("article",{id:`framework-${r.slug}`,className:"framework-card framework-card-clickable",role:"link",tabIndex:0,"aria-label":`View papers implemented by ${r.name}`,onClick:a=>{a.target.closest("a, button")||n(l)},onKeyDown:a=>{a.target===a.currentTarget&&(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),n(l))},children:[e.jsxs("div",{className:"framework-card-head",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"framework-card-name",children:r.name}),r.organization_name&&e.jsx("div",{className:"framework-card-org",children:r.organization_name})]}),r.platforms&&r.platforms.length>0&&e.jsx("div",{className:"framework-platform-row",children:r.platforms.map(a=>e.jsx(w,{platform:a},a))})]}),e.jsx("p",{className:"framework-card-desc",children:r.description}),r.when_to_use&&e.jsxs("div",{className:"framework-card-when",children:[e.jsx("span",{className:"framework-card-when-label",children:"When to use"}),r.when_to_use]}),(r.github_url||r.docs_url||r.introducing_paper_arxiv_id)&&e.jsxs("div",{className:"framework-card-links",children:[r.introducing_paper_arxiv_id&&e.jsx(o,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"}),r.github_url&&r.paper_count>0&&e.jsxs(o,{to:l,className:"framework-link",children:["Implements ",r.paper_count," ",r.paper_count===1?"paper":"papers"]}),r.github_url&&r.paper_count===0&&e.jsx("span",{className:"framework-link framework-link-disabled","aria-disabled":"true",children:"Implements 0 papers"}),r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(h,{name:"github",size:13}),"GitHub"]}),r.docs_url&&r.docs_url!==r.github_url&&e.jsx("a",{href:r.docs_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:"Docs"})]})]})},E=()=>{var a;const r=p({queryKey:["framework-catalog"],queryFn:()=>u.frameworkCatalog()}),n=((a=r.data)==null?void 0:a.domains)??[],l=n.reduce((i,s)=>i+s.categories.reduce((t,c)=>t+c.frameworks.length,0),0);return m.useEffect(()=>{var s;const i=window.location.hash.slice(1);i&&((s=document.getElementById(i))==null||s.scrollIntoView())},[r.data]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Frameworks"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated libraries and tools to run, serve, and train models — pick the right stack for your hardware and workload."})]})}),r.isLoading&&e.jsx("div",{className:"empty",children:"Loading frameworks…"}),r.isError&&e.jsx("div",{className:"empty",children:"Could not load frameworks."}),n.map(i=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{style:j,children:[e.jsxs("div",{children:[e.jsx("h2",{style:k,children:i.name}),e.jsx("div",{style:_,children:i.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[i.categories.length," ",i.categories.length===1?"category":"categories"," ·"," ",i.categories.reduce((s,t)=>s+t.frameworks.length,0)," frameworks"]})]}),i.categories.map(s=>e.jsxs("div",{className:"framework-category",children:[e.jsxs("div",{className:"framework-category-head",children:[e.jsxs("div",{children:[e.jsx("h3",{style:v,children:s.name}),s.description&&e.jsx("p",{className:"framework-category-blurb",children:s.description}),s.guide_url&&e.jsxs("a",{href:s.guide_url,target:"_blank",rel:"noopener noreferrer",className:"framework-guide-link",children:[s.guide_label??"Read guide"," →"]})]}),e.jsxs("div",{className:"framework-category-meta",children:[s.frameworks.length," ",s.frameworks.length===1?"framework":"frameworks"]})]}),e.jsx("div",{className:"framework-grid",children:s.frameworks.map(t=>e.jsx(b,{framework:t},t.slug))})]},s.slug))]},i.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[l," frameworks across ",n.length," ",n.length===1?"domain":"domains",". More areas coming soon."]})]})};export{b as FrameworkCard,E as default}; +import{c as d,j as e,L as o,K as m}from"./index-D6jcIRWs.js";import{u as p}from"./useQuery-CUJUm4FY.js";import{I as h}from"./components-DO1X940E.js";import{c as u}from"./catalog-PYrB8_bm.js";import{c as g,h as f}from"./colors-CLwl8a2d.js";import"./papers-DIIIPDpj.js";import"./AuthorAvatar-UMHOVOr9.js";import"./LatexTitle-D_92Jowu.js";import"./safeExternalHref-CkBrsh84.js";const x={gpu:"GPU",cpu:"CPU",apple:"Apple silicon"},j={display:"flex",alignItems:"baseline",justifyContent:"space-between",flexWrap:"wrap",gap:"6px 24px",paddingBottom:12,borderBottom:"1px solid var(--hairline-strong)"},k={fontFamily:"var(--serif)",fontSize:26,fontWeight:500,letterSpacing:"-0.02em",marginBottom:4},_={fontFamily:"var(--serif)",fontStyle:"italic",fontSize:13,color:"var(--ink-soft)"},v={fontFamily:"var(--mono)",fontSize:13,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--ink)",marginBottom:6},w=({platform:r})=>{const n=g(f(r));return e.jsx("span",{className:"framework-platform-chip",style:{background:n.bg,color:n.text},children:x[r]})},b=({framework:r})=>{const n=d(),l=`/papers?framework=${encodeURIComponent(r.slug)}`;return e.jsxs("article",{id:`framework-${r.slug}`,className:"framework-card framework-card-clickable",role:"link",tabIndex:0,"aria-label":`View papers implemented by ${r.name}`,onClick:a=>{a.target.closest("a, button")||n(l)},onKeyDown:a=>{a.target===a.currentTarget&&(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),n(l))},children:[e.jsxs("div",{className:"framework-card-head",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"framework-card-name",children:r.name}),r.organization_name&&e.jsx("div",{className:"framework-card-org",children:r.organization_name})]}),r.platforms&&r.platforms.length>0&&e.jsx("div",{className:"framework-platform-row",children:r.platforms.map(a=>e.jsx(w,{platform:a},a))})]}),e.jsx("p",{className:"framework-card-desc",children:r.description}),r.when_to_use&&e.jsxs("div",{className:"framework-card-when",children:[e.jsx("span",{className:"framework-card-when-label",children:"When to use"}),r.when_to_use]}),(r.github_url||r.docs_url||r.introducing_paper_arxiv_id)&&e.jsxs("div",{className:"framework-card-links",children:[r.introducing_paper_arxiv_id&&e.jsx(o,{to:`/paper/${r.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"}),r.github_url&&r.paper_count>0&&e.jsxs(o,{to:l,className:"framework-link",children:["Implements ",r.paper_count," ",r.paper_count===1?"paper":"papers"]}),r.github_url&&r.paper_count===0&&e.jsx("span",{className:"framework-link framework-link-disabled","aria-disabled":"true",children:"Implements 0 papers"}),r.github_url&&e.jsxs("a",{href:r.github_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:[e.jsx(h,{name:"github",size:13}),"GitHub"]}),r.docs_url&&r.docs_url!==r.github_url&&e.jsx("a",{href:r.docs_url,target:"_blank",rel:"noopener noreferrer",className:"framework-link",children:"Docs"})]})]})},E=()=>{var a;const r=p({queryKey:["framework-catalog"],queryFn:()=>u.frameworkCatalog()}),n=((a=r.data)==null?void 0:a.domains)??[],l=n.reduce((i,s)=>i+s.categories.reduce((t,c)=>t+c.frameworks.length,0),0);return m.useEffect(()=>{var s;const i=window.location.hash.slice(1);i&&((s=document.getElementById(i))==null||s.scrollIntoView())},[r.data]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Frameworks"})]}),e.jsx("div",{className:"feed-subtitle",children:"Curated libraries and tools to run, serve, and train models — pick the right stack for your hardware and workload."})]})}),r.isLoading&&e.jsx("div",{className:"empty",children:"Loading frameworks…"}),r.isError&&e.jsx("div",{className:"empty",children:"Could not load frameworks."}),n.map(i=>e.jsxs("section",{style:{marginBottom:56},children:[e.jsxs("div",{style:j,children:[e.jsxs("div",{children:[e.jsx("h2",{style:k,children:i.name}),e.jsx("div",{style:_,children:i.description})]}),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",whiteSpace:"nowrap"},children:[i.categories.length," ",i.categories.length===1?"category":"categories"," ·"," ",i.categories.reduce((s,t)=>s+t.frameworks.length,0)," frameworks"]})]}),i.categories.map(s=>e.jsxs("div",{className:"framework-category",children:[e.jsxs("div",{className:"framework-category-head",children:[e.jsxs("div",{children:[e.jsx("h3",{style:v,children:s.name}),s.description&&e.jsx("p",{className:"framework-category-blurb",children:s.description}),s.guide_url&&e.jsxs("a",{href:s.guide_url,target:"_blank",rel:"noopener noreferrer",className:"framework-guide-link",children:[s.guide_label??"Read guide"," →"]})]}),e.jsxs("div",{className:"framework-category-meta",children:[s.frameworks.length," ",s.frameworks.length===1?"framework":"frameworks"]})]}),e.jsx("div",{className:"framework-grid",children:s.frameworks.map(t=>e.jsx(b,{framework:t},t.slug))})]},s.slug))]},i.slug)),e.jsxs("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",marginTop:8},children:[l," frameworks across ",n.length," ",n.length===1?"domain":"domains",". More areas coming soon."]})]})};export{b as FrameworkCard,E as default}; diff --git a/assets/LatexTitle-BI9yl-Fo.js b/assets/LatexTitle-BI9yl-Fo.js deleted file mode 100644 index bb23fc30443317ccc307679365ff866cdfbeb1ba..0000000000000000000000000000000000000000 --- a/assets/LatexTitle-BI9yl-Fo.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/katex-wklAmtGL.css"])))=>i.map(i=>d[i]); -import{j as u,r as A,_ as L}from"./index-CqKcHUvZ.js";let g=null,$=null;function M(){return $??($=Promise.all([L(()=>import("./katex-DkKDou_j.js"),[]),L(()=>Promise.resolve({}),__vite__mapDeps([0]))]).then(([n])=>(g=n.default,g))),$}const O=new Set([",",";",":","!"," ","quad","qquad","enspace","thinspace"]),S={a:"á",e:"é",i:"í",o:"ó",u:"ú",y:"ý",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú",Y:"Ý"},b={a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"},w={a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"},k={a:"ä",e:"ë",i:"ï",o:"ö",u:"ü",y:"ÿ",A:"Ä",E:"Ë",I:"Ï",O:"Ö",U:"Ü",Y:"Ÿ"},N={"'":S,"`":b,"^":w,'"':k,"~":{n:"ñ",N:"Ñ"}},T={ss:"ß",ae:"æ",AE:"Æ",oe:"œ",OE:"Œ",o:"ø",O:"Ø",l:"ł",L:"Ł"};function I(n,i){var e;return((e=N[n])==null?void 0:e[i])??null}function v(n){const i=[];let e=0,t="";const r=()=>{t&&(i.push({type:"text",content:t}),t="")};for(;e=n.length)return{name:"",end:e};if(!/[a-zA-Z]/.test(n[e]))return{name:n[e],end:e+1};const t=e;for(;e=n.length)return null;if(n[i+1]==="{"){const t=d(n,i+1);return t?{end:t.end}:null}return/[A-Za-z0-9+\-=.]/.test(n[i+1])?{end:i+2}:null}function y(n,i){let e=i;if(n[e]==="\\"){const{name:o,end:s}=j(n,e);if(!o)return null;if(e=s,n[e]==="{"){const a=d(n,e);a&&(e=a.end)}}else if(/[A-Za-z0-9]/.test(n[e])){let o=e+1;for(;oe.length-i.length)}function X(n,i,e){const t=z(i);if(!t.length)return[n];const r=t.map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),o=new RegExp(`(${r.join("|")})`,"gi");return n.split(o).filter(Boolean).map((s,a)=>t.some(p=>p.toLocaleLowerCase()===s.toLocaleLowerCase())?u.jsx("mark",{children:s},`${e}-mark-${a}`):s)}function m(n,i,e){const t=[];let r=0,o=0;const s=()=>`${i}-${o++}`,a=(p,f)=>p==="strong"?u.jsx("strong",{children:f},s()):u.jsx("em",{children:f},s());for(;rr&&t.push(...X(n.slice(r,f),e,s())),r=f}return t}function _({latex:n,display:i}){const[e,t]=A.useState(g);A.useEffect(()=>{if(e)return;let o=!0;return M().then(s=>{o&&t(()=>s)}),()=>{o=!1}},[e]);const r=A.useMemo(()=>{if(e)try{return e.renderToString(n.trim(),{displayMode:i,throwOnError:!1})}catch{return null}},[e,n,i]);return r===void 0?u.jsx(u.Fragment,{children:n}):r?u.jsx("span",{className:i?"katex-display":void 0,dangerouslySetInnerHTML:{__html:r}}):u.jsx(u.Fragment,{children:i?`$$${n}$$`:`$${n}$`})}function D(n,i){const e=v(n),t=[];return e.forEach((r,o)=>{const s=`latex-${o}`;if(r.type==="text"){const a=m(r.content,s,i);a.length===1?t.push(a[0]):a.length>1&&t.push(u.jsx(A.Fragment,{children:a},s));return}if(r.type==="display"){t.push(u.jsx(_,{latex:r.content,display:!0},s));return}t.push(u.jsx(_,{latex:r.content,display:!1},s))}),t.length===1?t[0]:u.jsx(u.Fragment,{children:t})}const P=({text:n,className:i="",highlight:e})=>{const t=A.useMemo(()=>D(n,e),[n,e]);return u.jsx("span",{className:i,children:t})},Z=({title:n,className:i="",highlight:e})=>u.jsx(P,{text:n,className:i,highlight:e});export{Z as L,P as a}; diff --git a/assets/LatexTitle-D_92Jowu.js b/assets/LatexTitle-D_92Jowu.js new file mode 100644 index 0000000000000000000000000000000000000000..c0ec4d7e0a89f65768d63dd535274c85bf95c7e7 --- /dev/null +++ b/assets/LatexTitle-D_92Jowu.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/katex-wklAmtGL.css"])))=>i.map(i=>d[i]); +import{j as u,r as A,a0 as L}from"./index-D6jcIRWs.js";let g=null,$=null;function M(){return $??($=Promise.all([L(()=>import("./katex-DkKDou_j.js"),[]),L(()=>Promise.resolve({}),__vite__mapDeps([0]))]).then(([n])=>(g=n.default,g))),$}const O=new Set([",",";",":","!"," ","quad","qquad","enspace","thinspace"]),S={a:"á",e:"é",i:"í",o:"ó",u:"ú",y:"ý",A:"Á",E:"É",I:"Í",O:"Ó",U:"Ú",Y:"Ý"},b={a:"à",e:"è",i:"ì",o:"ò",u:"ù",A:"À",E:"È",I:"Ì",O:"Ò",U:"Ù"},w={a:"â",e:"ê",i:"î",o:"ô",u:"û",A:"Â",E:"Ê",I:"Î",O:"Ô",U:"Û"},k={a:"ä",e:"ë",i:"ï",o:"ö",u:"ü",y:"ÿ",A:"Ä",E:"Ë",I:"Ï",O:"Ö",U:"Ü",Y:"Ÿ"},N={"'":S,"`":b,"^":w,'"':k,"~":{n:"ñ",N:"Ñ"}},T={ss:"ß",ae:"æ",AE:"Æ",oe:"œ",OE:"Œ",o:"ø",O:"Ø",l:"ł",L:"Ł"};function I(n,i){var e;return((e=N[n])==null?void 0:e[i])??null}function v(n){const i=[];let e=0,t="";const r=()=>{t&&(i.push({type:"text",content:t}),t="")};for(;e=n.length)return{name:"",end:e};if(!/[a-zA-Z]/.test(n[e]))return{name:n[e],end:e+1};const t=e;for(;e=n.length)return null;if(n[i+1]==="{"){const t=d(n,i+1);return t?{end:t.end}:null}return/[A-Za-z0-9+\-=.]/.test(n[i+1])?{end:i+2}:null}function y(n,i){let e=i;if(n[e]==="\\"){const{name:o,end:s}=j(n,e);if(!o)return null;if(e=s,n[e]==="{"){const a=d(n,e);a&&(e=a.end)}}else if(/[A-Za-z0-9]/.test(n[e])){let o=e+1;for(;oe.length-i.length)}function X(n,i,e){const t=z(i);if(!t.length)return[n];const r=t.map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),o=new RegExp(`(${r.join("|")})`,"gi");return n.split(o).filter(Boolean).map((s,a)=>t.some(p=>p.toLocaleLowerCase()===s.toLocaleLowerCase())?u.jsx("mark",{children:s},`${e}-mark-${a}`):s)}function m(n,i,e){const t=[];let r=0,o=0;const s=()=>`${i}-${o++}`,a=(p,f)=>p==="strong"?u.jsx("strong",{children:f},s()):u.jsx("em",{children:f},s());for(;rr&&t.push(...X(n.slice(r,f),e,s())),r=f}return t}function _({latex:n,display:i}){const[e,t]=A.useState(g);A.useEffect(()=>{if(e)return;let o=!0;return M().then(s=>{o&&t(()=>s)}),()=>{o=!1}},[e]);const r=A.useMemo(()=>{if(e)try{return e.renderToString(n.trim(),{displayMode:i,throwOnError:!1})}catch{return null}},[e,n,i]);return r===void 0?u.jsx(u.Fragment,{children:n}):r?u.jsx("span",{className:i?"katex-display":void 0,dangerouslySetInnerHTML:{__html:r}}):u.jsx(u.Fragment,{children:i?`$$${n}$$`:`$${n}$`})}function D(n,i){const e=v(n),t=[];return e.forEach((r,o)=>{const s=`latex-${o}`;if(r.type==="text"){const a=m(r.content,s,i);a.length===1?t.push(a[0]):a.length>1&&t.push(u.jsx(A.Fragment,{children:a},s));return}if(r.type==="display"){t.push(u.jsx(_,{latex:r.content,display:!0},s));return}t.push(u.jsx(_,{latex:r.content,display:!1},s))}),t.length===1?t[0]:u.jsx(u.Fragment,{children:t})}const P=({text:n,className:i="",highlight:e})=>{const t=A.useMemo(()=>D(n,e),[n,e]);return u.jsx("span",{className:i,children:t})},Z=({title:n,className:i="",highlight:e})=>u.jsx(P,{text:n,className:i,highlight:e});export{Z as L,P as a}; diff --git a/assets/MarkdownText-CJQADo_f.js b/assets/MarkdownText-B_D3IE_p.js similarity index 86% rename from assets/MarkdownText-CJQADo_f.js rename to assets/MarkdownText-B_D3IE_p.js index 0e7386d5d2164562ecdec63706899eb20ea15f68..348ee576626ee4e0737f8664b9bbb9b76d041d38 100644 --- a/assets/MarkdownText-CJQADo_f.js +++ b/assets/MarkdownText-B_D3IE_p.js @@ -1 +1 @@ -import{o as c,j as s,L as u}from"./index-CqKcHUvZ.js";/* empty css */import{r as p,a as m,P as d}from"./PaperPreviewLink-C6khj_iZ.js";import{M as h}from"./index-CqELxJb0.js";import{r as f}from"./index-DBHj7UWg.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),o=/^[1-9]\d*$/.test(r);return!n&&!o?null:c(r)}const M=({text:e,className:a=""})=>s.jsx("div",{className:a,children:s.jsx(h,{remarkPlugins:[f,m],rehypePlugins:[p],components:{a:({href:t,children:r,node:n,...o})=>{const i=k(t);if(i){const l=I(i);return l?s.jsx(d,{routeId:l,to:i,...o,children:r}):s.jsx(u,{to:i,...o,children:r})}return s.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",...o,children:r})}},children:e})});export{M,k as r}; +import{o as c,j as s,L as u}from"./index-D6jcIRWs.js";/* empty css */import{r as p,a as m,P as d}from"./PaperPreviewLink-fcJyP9H0.js";import{M as h}from"./index-uFGyKu5N.js";import{r as f}from"./index-yduEvk9Z.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),o=/^[1-9]\d*$/.test(r);return!n&&!o?null:c(r)}const M=({text:e,className:a=""})=>s.jsx("div",{className:a,children:s.jsx(h,{remarkPlugins:[f,m],rehypePlugins:[p],components:{a:({href:t,children:r,node:n,...o})=>{const i=k(t);if(i){const l=I(i);return l?s.jsx(d,{routeId:l,to:i,...o,children:r}):s.jsx(u,{to:i,...o,children:r})}return s.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",...o,children:r})}},children:e})});export{M,k as r}; diff --git a/assets/McpShowcase-oHgWM9FI.js b/assets/McpShowcase-CS9LZY9p.js similarity index 84% rename from assets/McpShowcase-oHgWM9FI.js rename to assets/McpShowcase-CS9LZY9p.js index 9275df854fd6991f19fd98c781131a59e326d2ee..1ab8badf9f67fdd536a498660f65c58c1a907b3e 100644 --- a/assets/McpShowcase-oHgWM9FI.js +++ b/assets/McpShowcase-CS9LZY9p.js @@ -1 +1 @@ -import{j as e,L as t}from"./index-CqKcHUvZ.js";import{A as a}from"./AgentLogos-ClqC1BaK.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-D6jcIRWs.js";import{A as a}from"./AgentLogos-CFt_vIO2.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-zJL3QfYL.js b/assets/McpView-Dg_zVuuF.js similarity index 97% rename from assets/McpView-zJL3QfYL.js rename to assets/McpView-Dg_zVuuF.js index 3de71d434ad3f1c86ab8e96cc32a4d97ad97b431..13577cf4a9226d0d4e9772c3b10a17cc0c925015 100644 --- a/assets/McpView-zJL3QfYL.js +++ b/assets/McpView-Dg_zVuuF.js @@ -1,4 +1,4 @@ -import{n as b,K as h,j as e,C as x}from"./index-CqKcHUvZ.js";import{u as j}from"./useQuery-Cngk7eL9.js";import{f,D as g}from"./latexPlainText-DI8YEXVe.js";import{q as y}from"./queryOptions-C9woPjwX.js";import{G as v}from"./github-sUmGdHig.js";import{E as i}from"./external-link-CrrdDZf6.js";import{C as w}from"./copy-D9WKw0Bi.js";/** +import{n as b,K as h,j as e,C as x}from"./index-D6jcIRWs.js";import{u as j}from"./useQuery-CUJUm4FY.js";import{f,D as g}from"./latexPlainText-DI8YEXVe.js";import{q as y}from"./queryOptions-C9woPjwX.js";import{G as v}from"./github-B7D_19Qm.js";import{E as i}from"./external-link-C_yz2sXa.js";import{C as w}from"./copy-BmzqMihw.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/MethodDetailView-CFqQPuPA.js b/assets/MethodDetailView-PtjfC1LZ.js similarity index 93% rename from assets/MethodDetailView-CFqQPuPA.js rename to assets/MethodDetailView-PtjfC1LZ.js index 5d710fe3984a943f23c0b2f8e1cb84d313344a98..4c3509734b89a164c484ac8256da83bc305968f5 100644 --- a/assets/MethodDetailView-CFqQPuPA.js +++ b/assets/MethodDetailView-PtjfC1LZ.js @@ -1 +1 @@ -import{j as e,r as I,u as q,e as K,L as D,ag as Q}from"./index-CqKcHUvZ.js";import{R as O}from"./ResearchFollowButton-CrCIwiok.js";import{p as U,a as G}from"./papers-bE3C_Qzl.js";import{u as w}from"./useQuery-Cngk7eL9.js";import{u as W}from"./useInfiniteQuery-lxaMAHEu.js";import{M as Z,P as X}from"./components-Dmnn5Z5p.js";import{P as Y}from"./PaperFeedFilters-SOqb93ez.js";import{a as J,P as ee,b as te}from"./PaperDateFilter-zHw5tq6B.js";import{r as se,M as $}from"./MarkdownText-CJQADo_f.js";import{c as M}from"./catalog-D26nGNnK.js";import{s as ae}from"./slug-BpH-Nkvz.js";import{t as re}from"./colors-_scCXfCe.js";import{u as ie}from"./useInfiniteScroll-DVF-b-LX.js";import{S as F}from"./skeleton-DleNhBYA.js";import{A as ne,a as le}from"./alert-Z2yFUcyL.js";import{s as oe}from"./safeExternalHref-CkBrsh84.js";import"./useMutation-BItMAQ7s.js";import"./research-Dt0MUW0x.js";import"./plus-DZF-NxR0.js";import"./AuthorAvatar-CWCqOa0h.js";import"./LatexTitle-BI9yl-Fo.js";import"./popover-BcoS9Jmp.js";/* empty css */import"./PaperPreviewLink-C6khj_iZ.js";import"./index-CqELxJb0.js";import"./index-DBHj7UWg.js";import"./katex-DkKDou_j.js";import"./hover-card-BTsA69o8.js";import"./useIntersectionObserver-CiBk_Oug.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"},o=({x:s,y:r,w:d,h:m,fill:g,stroke:u,label:x,fontSize:n=10})=>e.jsxs("g",{children:[e.jsx("rect",{x:s,y:r,width:d,height:m,rx:"3",ry:"3",fill:g,stroke:u,strokeWidth:"1"}),e.jsx("text",{x:s+d/2,y:r+m/2,fontSize:n,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:x})]}),ce=()=>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(o,{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(o,{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(o,{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(o,{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(o,{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(o,{x:100,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"Q",fontSize:13}),e.jsx(o,{x:160,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"K",fontSize:13}),e.jsx(o,{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"]})]}),de=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Contrastive learning"}),e.jsx(o,{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(o,{x:35,y:88,w:110,h:26,fill:t.yellow,stroke:t.yellowS,label:"Augment t₁",fontSize:11}),e.jsx(o,{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(o,{x:35,y:138,w:110,h:26,fill:t.orange,stroke:t.orangeS,label:"Encoder f",fontSize:11}),e.jsx(o,{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(o,{x:35,y:188,w:110,h:26,fill:t.purple,stroke:t.purpleS,label:"Projection g",fontSize:11}),e.jsx(o,{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(o,{x:35,y:238,w:110,h:26,fill:t.pink,stroke:t.pinkS,label:"z₁",fontSize:13}),e.jsx(o,{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₂) / τ"})]}),me=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],he=()=>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"}),me.map(([s,r],d)=>{const m=92+d*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:m,fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,dominantBaseline:"middle",children:s}),r?e.jsx("text",{x:"138",y:m,fontSize:"8.5",fontFamily:"var(--mono)",fill:t.faint,dominantBaseline:"middle",children:r}):null]},s)})]}),xe={attention:ce,"contrastive-learning":de,"agent-skills":he},pe=({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(o,{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(o,{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(o,{x:80,y:250,w:200,h:50,fill:t.purple,stroke:t.purpleS,label:"Output",fontSize:12})]}),ue=({method:s})=>{const r=(s.slug||"").toLowerCase(),d=xe[r];if(d)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(d,{})});if(s.image_url){const m=r==="transformer"||r==="gpt-4"||r==="gpt-4o"||r==="multi-head-attention"?" method-figure-svg--compact":r==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${m}`,children:e.jsx("img",{className:"method-figure-img",src:s.image_url,alt:`${s.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(pe,{method:s})})},P=720,C=138,p={top:8,right:10,bottom:25,left:36},H=56,fe=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),ge=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),L=s=>fe.format(new Date(`${s}T00:00:00Z`)),je=(s,r)=>{if(s===0)return new Set;const d=s>48?12:s>36?6:s>18?3:2,m=Math.max(1,Math.ceil(H/r)),g=Math.max(d,m),u=s-1,x=new Set([0,u]);for(let n=g;n=H&&x.add(n);return x},R=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}`},ye=({history:s,methodName:r})=>{const[d,m]=I.useState(null),g=Math.max(1,...s.map(l=>l.paper_count)),u=P-p.left-p.right,x=C-p.top-p.bottom,n=s.length?u/s.length:u,b=Math.max(2,n*.68),A=je(s.length,n),y=Array.from(new Set([0,Math.ceil(g/2),g])),j=d==null?null:s[d],f=j?R(j):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${P} ${C}`,role:"group","aria-label":`${r}: papers mentioning this method by publication month`,children:[e.jsxs("title",{children:[r,": papers mentioning this method by publication month"]}),y.map(l=>{const c=p.top+x-l/g*x;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:p.left,x2:P-p.right,y1:c,y2:c}),e.jsx("text",{className:"method-usage-y-label",x:p.left-8,y:c+3,textAnchor:"end",children:l})]},l)}),s.map((l,c)=>{const N=l.paper_count/g*x,S=l.paper_count>0?Math.max(1,N):0,z=p.left+n*c+(n-b)/2,a=p.top+x-S,v=d===c,k=c===s.length-1,_=R(l);return e.jsxs("g",{className:`method-usage-bar${v?" is-active":""}${k?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${L(l.start_date)}: ${l.paper_count} ${l.paper_count===1?"paper":"papers"}${_?`. ${_}`:""}`,onMouseEnter:()=>m(c),onMouseLeave:()=>m(null),onFocus:()=>m(c),onBlur:()=>m(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:p.left+n*c,y:p.top,width:n,height:x}),e.jsx("rect",{className:"method-usage-bar-mark",x:z,y:a,width:b,height:S,rx:"1.5"})]},l.start_date)}),s.map((l,c)=>A.has(c)?e.jsx("text",{className:"method-usage-x-label",x:p.left+n*(c+.5),y:C-11,textAnchor:"middle",children:s.length>48?ge.format(new Date(`${l.start_date}T00:00:00Z`)):L(l.start_date)},l.start_date):null)]}),j&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:L(j.start_date)}),e.jsxs("span",{children:[j.paper_count," ",j.paper_count===1?"paper":"papers",d===s.length-1?" · month to date":""]}),e.jsxs("span",{children:[(j.catalog_share??0).toFixed(2),"% of"," ",(j.catalog_paper_count??0).toLocaleString()," catalog papers"]}),f&&e.jsx("span",{children:f})]})]})},Se=[["trending","trending"],["new","newest"],["cited","most cited"]],Ze=()=>{var T,E,B;const{methodSlug:s}=q(),[r,d]=K(),[m,g]=I.useState("trending"),u=r.get("has_code")==="true",x=r.get("has_hf_artifacts")==="true",n=J(r),b=i=>{const h=new URLSearchParams(r);i?h.set("has_code","true"):h.delete("has_code"),d(h)},A=i=>{const h=new URLSearchParams(r);i?h.set("has_hf_artifacts","true"):h.delete("has_hf_artifacts"),d(h)},y=w({queryKey:["method",s],queryFn:()=>M.getMethod(s),enabled:!!s,staleTime:10*60*1e3}),j=w({queryKey:["areas-all"],queryFn:()=>M.listAreas({page_size:50,ordering:"name"}),enabled:!!((T=y.data)!=null&&T.area_id),staleTime:10*60*1e3}),f=w({queryKey:["method-trend",s],queryFn:()=>M.methodTrend(s),enabled:!!s,staleTime:10*60*1e3}),l=m==="trending"?"trending":m==="cited"?"citation_count":"date_published",c=W({queryKey:[...U.feeds.method,s,l,u,x,n.startDate,n.endDate],queryFn:({pageParam:i=1})=>G.forMethod(s,{page:i,page_size:20,order_by:l,order_dir:"desc",include_resources:!0,repository_limit:1,has_code:u,has_hf_artifacts:x,start_date:n.startDate,end_date:n.endDate}),getNextPageParam:i=>i.next_page,initialPageParam:1,enabled:!!s,staleTime:5*60*1e3,placeholderData:Q}),N=w({queryKey:["related-methods",s],queryFn:()=>M.relatedMethods(s),enabled:!!s,staleTime:10*60*1e3}),S=I.useMemo(()=>{var h;return(((h=c.data)==null?void 0:h.pages.flatMap(V=>V.results))||[]).map(re)},[c.data]),z=ie(c);if(y.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(F,{className:"h-12 w-1/2 mb-4"}),e.jsx(F,{className:"h-64 w-full"})]});if(y.error||!y.data)return e.jsx("div",{className:"page",children:e.jsx(ne,{variant:"destructive",children:e.jsx(le,{children:"Method not found."})})});const a=y.data,v=(E=j.data)==null?void 0:E.results.find(i=>i.id===a.area_id),k=se(a.source_url),_=k?null:oe(a.source_url);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(D,{to:"/methods",children:"Methods"}),v&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(D,{to:`/methods#area-${ae(v.name)}`,children:v.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${a.slug==="grokking"||a.slug==="latent-reasoning"||a.slug==="world-action-models"?" method-hero-grid--wide-figure":""}`,children:[e.jsxs("div",{children:[e.jsx("div",{className:"tag-hero-eyebrow",children:"METHOD"}),e.jsx("h1",{className:"tag-hero-title method-hero-title",children:a.name}),e.jsx(O,{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($,{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"}),k?e.jsxs(D,{className:"method-source-link",to:k,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("a",{className:"method-source-link",href:_,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()})]}),f.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsxs("span",{className:"value",children:[(f.data.recent_paper_count*30/f.data.recent_days).toFixed(1),e.jsx("small",{children:"/mo"})]}),!f.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})]})]}),f.isLoading?e.jsx(F,{className:"h-36 w-full method-trend-skeleton"}):f.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:f.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",f.data.recent_days,"d"]})]})]}),e.jsx(ye,{history:f.data.history,methodName:a.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(ue,{method:a}),a.image_credit&&e.jsx("figcaption",{children:e.jsx($,{className:"method-image-credit",text:a.image_credit})})]})]}),(((B=N.data)==null?void 0:B.results.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),N.data.results.map(i=>e.jsx(Z,{method:{slug:i.slug,name:i.name}},i.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:Se.map(([i,h])=>e.jsx("button",{className:`sort-btn ${m===i?"active":""}`,onClick:()=>g(i),children:h},i))}),e.jsx(Y,{hasCode:u,hasHfArtifacts:x,onHasCodeChange:b,onHasHfArtifactsChange:A})]}),e.jsx(ee,{startDate:n.startDate,endDate:n.endDate,onChange:i=>d(te(r,i))}),e.jsxs("div",{className:"results-count",children:[S.length," papers mentioning ",a.name]})]}),c.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,h)=>e.jsx(F,{className:"h-40 w-full"},h))}):S.length===0?e.jsx("div",{className:"no-results",children:"No papers tagged with this method yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:S.map((i,h)=>e.jsx(X,{paper:i,rank:h+1},i.id))}),e.jsx("div",{ref:z,style:{height:1}}),c.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{Ze as default}; +import{j as e,r as I,u as q,e as K,L as D,ai as Q}from"./index-D6jcIRWs.js";import{R as O}from"./ResearchFollowButton-C2Bfd9dP.js";import{p as U,a as G}from"./papers-DIIIPDpj.js";import{u as w}from"./useQuery-CUJUm4FY.js";import{u as W}from"./useInfiniteQuery-FXco4P1n.js";import{M as Z,P as X}from"./components-DO1X940E.js";import{P as Y}from"./PaperFeedFilters-DNebHp4l.js";import{a as J,P as ee,b as te}from"./PaperDateFilter-CPIqaHaq.js";import{r as se,M as $}from"./MarkdownText-B_D3IE_p.js";import{c as M}from"./catalog-PYrB8_bm.js";import{s as ae}from"./slug-BpH-Nkvz.js";import{t as re}from"./colors-CLwl8a2d.js";import{u as ie}from"./useInfiniteScroll-Dm7JY_X4.js";import{S as F}from"./skeleton-BqkYFmXl.js";import{A as ne,a as le}from"./alert-2MbxVzGL.js";import{s as oe}from"./safeExternalHref-CkBrsh84.js";import"./useMutation-p6mN4h17.js";import"./research-BggtGgC2.js";import"./plus-C4UQ62Q1.js";import"./AuthorAvatar-UMHOVOr9.js";import"./LatexTitle-D_92Jowu.js";import"./popover-DCjqGpW0.js";/* empty css */import"./PaperPreviewLink-fcJyP9H0.js";import"./index-uFGyKu5N.js";import"./index-yduEvk9Z.js";import"./katex-DkKDou_j.js";import"./hover-card-DPpv0l_x.js";import"./useIntersectionObserver-3LTuEaFW.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"},o=({x:s,y:r,w:d,h:m,fill:g,stroke:u,label:x,fontSize:n=10})=>e.jsxs("g",{children:[e.jsx("rect",{x:s,y:r,width:d,height:m,rx:"3",ry:"3",fill:g,stroke:u,strokeWidth:"1"}),e.jsx("text",{x:s+d/2,y:r+m/2,fontSize:n,fontFamily:"var(--sans)",fill:t.ink,textAnchor:"middle",dominantBaseline:"middle",children:x})]}),ce=()=>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(o,{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(o,{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(o,{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(o,{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(o,{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(o,{x:100,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"Q",fontSize:13}),e.jsx(o,{x:160,y:270,w:40,h:24,fill:t.pink,stroke:t.pinkS,label:"K",fontSize:13}),e.jsx(o,{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"]})]}),de=()=>e.jsxs("svg",{viewBox:"0 0 360 420",width:"100%",height:"100%",style:{display:"block"},children:[e.jsx("text",{x:"180",y:"20",fontSize:"11",fontFamily:"var(--serif)",fontStyle:"italic",fill:t.faint,textAnchor:"middle",children:"Contrastive learning"}),e.jsx(o,{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(o,{x:35,y:88,w:110,h:26,fill:t.yellow,stroke:t.yellowS,label:"Augment t₁",fontSize:11}),e.jsx(o,{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(o,{x:35,y:138,w:110,h:26,fill:t.orange,stroke:t.orangeS,label:"Encoder f",fontSize:11}),e.jsx(o,{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(o,{x:35,y:188,w:110,h:26,fill:t.purple,stroke:t.purpleS,label:"Projection g",fontSize:11}),e.jsx(o,{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(o,{x:35,y:238,w:110,h:26,fill:t.pink,stroke:t.pinkS,label:"z₁",fontSize:13}),e.jsx(o,{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₂) / τ"})]}),me=[["my-skill/",""],["├── SKILL.md","# Required: metadata + instructions"],["├── scripts/","# Optional: executable code"],["├── references/","# Optional: documentation"],["├── assets/","# Optional: templates, resources"],["└── ...","# Any additional files or directories"]],he=()=>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"}),me.map(([s,r],d)=>{const m=92+d*44;return e.jsxs("g",{children:[e.jsx("text",{x:"44",y:m,fontSize:"11",fontFamily:"var(--mono)",fill:t.ink,dominantBaseline:"middle",children:s}),r?e.jsx("text",{x:"138",y:m,fontSize:"8.5",fontFamily:"var(--mono)",fill:t.faint,dominantBaseline:"middle",children:r}):null]},s)})]}),xe={attention:ce,"contrastive-learning":de,"agent-skills":he},pe=({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(o,{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(o,{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(o,{x:80,y:250,w:200,h:50,fill:t.purple,stroke:t.purpleS,label:"Output",fontSize:12})]}),ue=({method:s})=>{const r=(s.slug||"").toLowerCase(),d=xe[r];if(d)return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(d,{})});if(s.image_url){const m=r==="transformer"||r==="gpt-4"||r==="gpt-4o"||r==="multi-head-attention"?" method-figure-svg--compact":r==="rpn"?" method-figure-svg--scaled-80":"";return e.jsx("div",{className:`method-figure-svg method-figure-svg--image${m}`,children:e.jsx("img",{className:"method-figure-img",src:s.image_url,alt:`${s.name} figure`})})}return e.jsx("div",{className:"method-figure-svg method-figure-svg--schematic",children:e.jsx(pe,{method:s})})},P=720,C=138,p={top:8,right:10,bottom:25,left:36},H=56,fe=new Intl.DateTimeFormat("en",{month:"short",year:"2-digit",timeZone:"UTC"}),ge=new Intl.DateTimeFormat("en",{year:"numeric",timeZone:"UTC"}),L=s=>fe.format(new Date(`${s}T00:00:00Z`)),je=(s,r)=>{if(s===0)return new Set;const d=s>48?12:s>36?6:s>18?3:2,m=Math.max(1,Math.ceil(H/r)),g=Math.max(d,m),u=s-1,x=new Set([0,u]);for(let n=g;n=H&&x.add(n);return x},R=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}`},ye=({history:s,methodName:r})=>{const[d,m]=I.useState(null),g=Math.max(1,...s.map(l=>l.paper_count)),u=P-p.left-p.right,x=C-p.top-p.bottom,n=s.length?u/s.length:u,b=Math.max(2,n*.68),A=je(s.length,n),y=Array.from(new Set([0,Math.ceil(g/2),g])),j=d==null?null:s[d],f=j?R(j):null;return e.jsxs("div",{className:"method-usage-chart-wrap",children:[e.jsxs("svg",{className:"method-usage-chart",viewBox:`0 0 ${P} ${C}`,role:"group","aria-label":`${r}: papers mentioning this method by publication month`,children:[e.jsxs("title",{children:[r,": papers mentioning this method by publication month"]}),y.map(l=>{const c=p.top+x-l/g*x;return e.jsxs("g",{children:[e.jsx("line",{className:"method-usage-gridline",x1:p.left,x2:P-p.right,y1:c,y2:c}),e.jsx("text",{className:"method-usage-y-label",x:p.left-8,y:c+3,textAnchor:"end",children:l})]},l)}),s.map((l,c)=>{const N=l.paper_count/g*x,S=l.paper_count>0?Math.max(1,N):0,z=p.left+n*c+(n-b)/2,a=p.top+x-S,v=d===c,k=c===s.length-1,_=R(l);return e.jsxs("g",{className:`method-usage-bar${v?" is-active":""}${k?" is-current":""}`,tabIndex:0,role:"img","aria-label":`${L(l.start_date)}: ${l.paper_count} ${l.paper_count===1?"paper":"papers"}${_?`. ${_}`:""}`,onMouseEnter:()=>m(c),onMouseLeave:()=>m(null),onFocus:()=>m(c),onBlur:()=>m(null),children:[e.jsx("rect",{className:"method-usage-bar-hit",x:p.left+n*c,y:p.top,width:n,height:x}),e.jsx("rect",{className:"method-usage-bar-mark",x:z,y:a,width:b,height:S,rx:"1.5"})]},l.start_date)}),s.map((l,c)=>A.has(c)?e.jsx("text",{className:"method-usage-x-label",x:p.left+n*(c+.5),y:C-11,textAnchor:"middle",children:s.length>48?ge.format(new Date(`${l.start_date}T00:00:00Z`)):L(l.start_date)},l.start_date):null)]}),j&&e.jsxs("div",{className:"method-usage-tooltip",role:"status",children:[e.jsx("strong",{children:L(j.start_date)}),e.jsxs("span",{children:[j.paper_count," ",j.paper_count===1?"paper":"papers",d===s.length-1?" · month to date":""]}),e.jsxs("span",{children:[(j.catalog_share??0).toFixed(2),"% of"," ",(j.catalog_paper_count??0).toLocaleString()," catalog papers"]}),f&&e.jsx("span",{children:f})]})]})},Se=[["trending","trending"],["new","newest"],["cited","most cited"]],Ze=()=>{var T,E,B;const{methodSlug:s}=q(),[r,d]=K(),[m,g]=I.useState("trending"),u=r.get("has_code")==="true",x=r.get("has_hf_artifacts")==="true",n=J(r),b=i=>{const h=new URLSearchParams(r);i?h.set("has_code","true"):h.delete("has_code"),d(h)},A=i=>{const h=new URLSearchParams(r);i?h.set("has_hf_artifacts","true"):h.delete("has_hf_artifacts"),d(h)},y=w({queryKey:["method",s],queryFn:()=>M.getMethod(s),enabled:!!s,staleTime:10*60*1e3}),j=w({queryKey:["areas-all"],queryFn:()=>M.listAreas({page_size:50,ordering:"name"}),enabled:!!((T=y.data)!=null&&T.area_id),staleTime:10*60*1e3}),f=w({queryKey:["method-trend",s],queryFn:()=>M.methodTrend(s),enabled:!!s,staleTime:10*60*1e3}),l=m==="trending"?"trending":m==="cited"?"citation_count":"date_published",c=W({queryKey:[...U.feeds.method,s,l,u,x,n.startDate,n.endDate],queryFn:({pageParam:i=1})=>G.forMethod(s,{page:i,page_size:20,order_by:l,order_dir:"desc",include_resources:!0,repository_limit:1,has_code:u,has_hf_artifacts:x,start_date:n.startDate,end_date:n.endDate}),getNextPageParam:i=>i.next_page,initialPageParam:1,enabled:!!s,staleTime:5*60*1e3,placeholderData:Q}),N=w({queryKey:["related-methods",s],queryFn:()=>M.relatedMethods(s),enabled:!!s,staleTime:10*60*1e3}),S=I.useMemo(()=>{var h;return(((h=c.data)==null?void 0:h.pages.flatMap(V=>V.results))||[]).map(re)},[c.data]),z=ie(c);if(y.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(F,{className:"h-12 w-1/2 mb-4"}),e.jsx(F,{className:"h-64 w-full"})]});if(y.error||!y.data)return e.jsx("div",{className:"page",children:e.jsx(ne,{variant:"destructive",children:e.jsx(le,{children:"Method not found."})})});const a=y.data,v=(E=j.data)==null?void 0:E.results.find(i=>i.id===a.area_id),k=se(a.source_url),_=k?null:oe(a.source_url);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(D,{to:"/methods",children:"Methods"}),v&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(D,{to:`/methods#area-${ae(v.name)}`,children:v.name})]}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.name})]}),e.jsxs("div",{className:`tag-hero method-hero-grid${a.slug==="grokking"||a.slug==="latent-reasoning"||a.slug==="world-action-models"?" method-hero-grid--wide-figure":""}`,children:[e.jsxs("div",{children:[e.jsx("div",{className:"tag-hero-eyebrow",children:"METHOD"}),e.jsx("h1",{className:"tag-hero-title method-hero-title",children:a.name}),e.jsx(O,{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($,{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"}),k?e.jsxs(D,{className:"method-source-link",to:k,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("a",{className:"method-source-link",href:_,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()})]}),f.data&&e.jsxs("div",{className:"stat",children:[e.jsx("span",{className:"label",children:"Recent mentions"}),e.jsxs("span",{className:"value",children:[(f.data.recent_paper_count*30/f.data.recent_days).toFixed(1),e.jsx("small",{children:"/mo"})]}),!f.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})]})]}),f.isLoading?e.jsx(F,{className:"h-36 w-full method-trend-skeleton"}):f.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:f.data.recent_paper_count}),e.jsxs("span",{children:["papers / ",f.data.recent_days,"d"]})]})]}),e.jsx(ye,{history:f.data.history,methodName:a.name})]}):null]}),e.jsxs("figure",{className:"method-figure-card",children:[e.jsx(ue,{method:a}),a.image_credit&&e.jsx("figcaption",{children:e.jsx($,{className:"method-image-credit",text:a.image_credit})})]})]}),(((B=N.data)==null?void 0:B.results.length)??0)>0&&e.jsxs("div",{className:"filter-row",children:[e.jsx("span",{className:"label",children:"Related methods"}),N.data.results.map(i=>e.jsx(Z,{method:{slug:i.slug,name:i.name}},i.id))]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:Se.map(([i,h])=>e.jsx("button",{className:`sort-btn ${m===i?"active":""}`,onClick:()=>g(i),children:h},i))}),e.jsx(Y,{hasCode:u,hasHfArtifacts:x,onHasCodeChange:b,onHasHfArtifactsChange:A})]}),e.jsx(ee,{startDate:n.startDate,endDate:n.endDate,onChange:i=>d(te(r,i))}),e.jsxs("div",{className:"results-count",children:[S.length," papers mentioning ",a.name]})]}),c.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((i,h)=>e.jsx(F,{className:"h-40 w-full"},h))}):S.length===0?e.jsx("div",{className:"no-results",children:"No papers tagged with this method yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:S.map((i,h)=>e.jsx(X,{paper:i,rank:h+1},i.id))}),e.jsx("div",{ref:z,style:{height:1}}),c.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]})};export{Ze as default}; diff --git a/assets/MethodsIndexView-CW-VvDvI.js b/assets/MethodsIndexView-2d98MRig.js similarity index 84% rename from assets/MethodsIndexView-CW-VvDvI.js rename to assets/MethodsIndexView-2d98MRig.js index be13ac76e24a57f3b8565cad65993672f312c93d..8e7bafd1cdd923b59eeae20788940ac9dcdc6a5a 100644 --- a/assets/MethodsIndexView-CW-VvDvI.js +++ b/assets/MethodsIndexView-2d98MRig.js @@ -1,4 +1,4 @@ -import{n as _,r as d,j as e,L as v}from"./index-CqKcHUvZ.js";import{u as c}from"./useQuery-Cngk7eL9.js";import{c as m}from"./catalog-D26nGNnK.js";import{s as N}from"./slug-BpH-Nkvz.js";import{S as x}from"./skeleton-DleNhBYA.js";import{A as w,a as F}from"./alert-Z2yFUcyL.js";import{T as L}from"./TaxonomySuggestionTile-Be7MdvJo.js";import{T}from"./TaxonomyTrending-DuJmoxuN.js";import"./SignInToEditDialog-B4COuqpY.js";import"./button-BYn4yUH_.js";import"./input-sw0Ix0Sa.js";import"./textarea-CQToxq8k.js";import"./searchable-select-DY1KXMvg.js";import"./popover-BcoS9Jmp.js";import"./dialog-B-oqHDuH.js";import"./search-9n8Usynh.js";import"./loader-circle-CZgakNH7.js";import"./useMutation-BItMAQ7s.js";import"./submissions-1aHdBaSr.js";import"./plus-DZF-NxR0.js";import"./trending-up-n0ivZSaN.js";/** +import{n as _,r as d,j as e,L as v}from"./index-D6jcIRWs.js";import{u as c}from"./useQuery-CUJUm4FY.js";import{c as m}from"./catalog-PYrB8_bm.js";import{s as N}from"./slug-BpH-Nkvz.js";import{S as x}from"./skeleton-BqkYFmXl.js";import{A as w,a as F}from"./alert-2MbxVzGL.js";import{T as L}from"./TaxonomySuggestionTile-BLk1tYYE.js";import{T}from"./TaxonomyTrending-Dqu0dPfc.js";import"./SignInToEditDialog-RzK54RAM.js";import"./button-Bzx0ccHH.js";import"./input-CCN-4hy4.js";import"./textarea-sXKODM3W.js";import"./searchable-select-B7z6Fcrr.js";import"./popover-DCjqGpW0.js";import"./dialog-vGFIbcd-.js";import"./search-CfTufeR7.js";import"./loader-circle-BuDrH29B.js";import"./useMutation-p6mN4h17.js";import"./submissions-DNa3tQdo.js";import"./plus-C4UQ62Q1.js";import"./trending-up-DqN3HzZ5.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/NotFound-pWH_hqC2.js b/assets/NotFound-BTsJlVc8.js similarity index 89% rename from assets/NotFound-pWH_hqC2.js rename to assets/NotFound-BTsJlVc8.js index c8895197535f987eebc2533eb94a5dc43ea82631..f1c02c5a0b9ab1f2164775ce3a4bf7f3d022ae3b 100644 --- a/assets/NotFound-pWH_hqC2.js +++ b/assets/NotFound-BTsJlVc8.js @@ -1 +1 @@ -import{b as o,r as s,j as t,L as a}from"./index-CqKcHUvZ.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{b as o,r as s,j as t,L as a}from"./index-D6jcIRWs.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-DUBXw9I0.js b/assets/OrganizationContributionGraph-DzcTqxNw.js similarity index 94% rename from assets/OrganizationContributionGraph-DUBXw9I0.js rename to assets/OrganizationContributionGraph-DzcTqxNw.js index d15f019c03c250a43baa759182d9178f9f1e25f7..e627030c0615af9c01e5c9bdb2fdfc00edf25a07 100644 --- a/assets/OrganizationContributionGraph-DUBXw9I0.js +++ b/assets/OrganizationContributionGraph-DzcTqxNw.js @@ -1 +1 @@ -import{r as b,j as o}from"./index-CqKcHUvZ.js";import{u as z}from"./useQuery-Cngk7eL9.js";import{S as T}from"./skeleton-DleNhBYA.js";import{c as w}from"./catalog-D26nGNnK.js";const x=24*60*60*1e3,f=12,y=3,v=new Map([[1,"Mon"],[3,"Wed"],[5,"Fri"]]),$=n=>new Date(`${n}T00:00:00Z`),N=n=>n.toISOString().slice(0,10),_=(n,r)=>{if(n===0)return 0;const i=r.findIndex(s=>n<=s);return i===-1?4:i+1},D=n=>{const r=$(n.start_date),i=$(n.end_date),s=new Date(r.getTime()-r.getUTCDay()*x),h=new Date(i.getTime()+(6-i.getUTCDay())*x),p=new Map(n.results.map(e=>[e.date,e.paper_count])),u=n.results.map(e=>e.paper_count).sort((e,m)=>e-m),c=[.25,.5,.75].map(e=>u[Math.min(u.length-1,Math.floor(u.length*e))]??1),l=[];for(let e=s.getTime();e<=h.getTime();e+=x){const m=new Date(e),d=N(m),g=e>=r.getTime()&&e<=i.getTime(),C=g?p.get(d)??0:0;l.push({key:d,date:m,count:C,inRange:g,level:_(C,c)})}const t=l.length/7,a=[];let j=-1;for(let e=0;eg.inRange&&(e===0||g.date.getUTCDate()<=7));d&&d.date.getUTCMonth()!==j&&(j=d.date.getUTCMonth(),a.length>0&&e-a[a.length-1].column<3&&a.pop(),a.push({label:d.date.toLocaleString("en",{month:"short",timeZone:"UTC"}),column:e}))}return{days:l,months:a,weekCount:t}},L=({data:n,organizationName:r,title:i="Paper contributions",noun:s="paper"})=>{const h=b.useRef(null),{days:p,months:u,weekCount:c}=b.useMemo(()=>D(n),[n]),l=c*f+(c-1)*y;return b.useEffect(()=>{const t=h.current;t&&(t.scrollLeft=t.scrollWidth)},[c]),o.jsxs("section",{className:"organization-contributions","aria-labelledby":"organization-contributions-title",children:[o.jsxs("div",{className:"organization-contributions-header",children:[o.jsx("h2",{id:"organization-contributions-title",className:"organization-contributions-title",children:i}),o.jsxs("p",{className:"organization-contributions-summary",children:[n.total_count.toLocaleString()," ",n.total_count===1?s:`${s}s`," recorded in the last year"]})]}),o.jsx("div",{className:"organization-contributions-scroll",ref:h,children:o.jsxs("div",{className:"organization-contributions-plot",style:{width:l+34},role:"img","aria-label":`${r} recorded ${n.total_count} ${n.total_count===1?s:`${s}s`} in the last year`,children:[o.jsx("div",{className:"organization-contributions-weekdays","aria-hidden":"true",children:Array.from({length:7}).map((t,a)=>o.jsx("span",{children:v.get(a)??""},a))}),o.jsxs("div",{children:[o.jsx("div",{className:"organization-contributions-months",style:{width:l,gridTemplateColumns:`repeat(${c}, ${f}px)`},"aria-hidden":"true",children:u.map(t=>o.jsx("span",{style:{gridColumnStart:t.column+1},children:t.label},`${t.label}-${t.column}`))}),o.jsx("div",{className:"organization-contributions-grid",style:{width:l,gridTemplateColumns:`repeat(${c}, ${f}px)`},"aria-hidden":"true",children:p.map(t=>o.jsx("span",{className:`organization-contribution-cell ${t.inRange?`level-${t.level}`:"is-outside"}`,title:t.inRange?`${t.count} ${t.count===1?s:`${s}s`} on ${t.date.toLocaleDateString("en",{dateStyle:"long",timeZone:"UTC"})}`:void 0},t.key))})]})]})}),o.jsxs("div",{className:"organization-contributions-legend","aria-hidden":"true",children:[o.jsx("span",{children:"Fewer"}),[0,1,2,3,4].map(t=>o.jsx("span",{className:`organization-contribution-cell level-${t}`},t)),o.jsx("span",{children:"More"})]})]})},A=({organizationSlug:n,organizationName:r})=>{const i=z({queryKey:["organization-contributions",n],queryFn:()=>w.organizationContributions(n),staleTime:6e5});return i.isLoading?o.jsx(T,{className:"organization-contributions-skeleton"}):i.data?o.jsx(L,{data:i.data,organizationName:r}):null};export{L as C,A as O}; +import{r as b,j as o}from"./index-D6jcIRWs.js";import{u as z}from"./useQuery-CUJUm4FY.js";import{S as T}from"./skeleton-BqkYFmXl.js";import{c as w}from"./catalog-PYrB8_bm.js";const x=24*60*60*1e3,f=12,y=3,v=new Map([[1,"Mon"],[3,"Wed"],[5,"Fri"]]),$=n=>new Date(`${n}T00:00:00Z`),N=n=>n.toISOString().slice(0,10),_=(n,r)=>{if(n===0)return 0;const i=r.findIndex(s=>n<=s);return i===-1?4:i+1},D=n=>{const r=$(n.start_date),i=$(n.end_date),s=new Date(r.getTime()-r.getUTCDay()*x),h=new Date(i.getTime()+(6-i.getUTCDay())*x),p=new Map(n.results.map(e=>[e.date,e.paper_count])),u=n.results.map(e=>e.paper_count).sort((e,m)=>e-m),c=[.25,.5,.75].map(e=>u[Math.min(u.length-1,Math.floor(u.length*e))]??1),l=[];for(let e=s.getTime();e<=h.getTime();e+=x){const m=new Date(e),d=N(m),g=e>=r.getTime()&&e<=i.getTime(),C=g?p.get(d)??0:0;l.push({key:d,date:m,count:C,inRange:g,level:_(C,c)})}const t=l.length/7,a=[];let j=-1;for(let e=0;eg.inRange&&(e===0||g.date.getUTCDate()<=7));d&&d.date.getUTCMonth()!==j&&(j=d.date.getUTCMonth(),a.length>0&&e-a[a.length-1].column<3&&a.pop(),a.push({label:d.date.toLocaleString("en",{month:"short",timeZone:"UTC"}),column:e}))}return{days:l,months:a,weekCount:t}},L=({data:n,organizationName:r,title:i="Paper contributions",noun:s="paper"})=>{const h=b.useRef(null),{days:p,months:u,weekCount:c}=b.useMemo(()=>D(n),[n]),l=c*f+(c-1)*y;return b.useEffect(()=>{const t=h.current;t&&(t.scrollLeft=t.scrollWidth)},[c]),o.jsxs("section",{className:"organization-contributions","aria-labelledby":"organization-contributions-title",children:[o.jsxs("div",{className:"organization-contributions-header",children:[o.jsx("h2",{id:"organization-contributions-title",className:"organization-contributions-title",children:i}),o.jsxs("p",{className:"organization-contributions-summary",children:[n.total_count.toLocaleString()," ",n.total_count===1?s:`${s}s`," recorded in the last year"]})]}),o.jsx("div",{className:"organization-contributions-scroll",ref:h,children:o.jsxs("div",{className:"organization-contributions-plot",style:{width:l+34},role:"img","aria-label":`${r} recorded ${n.total_count} ${n.total_count===1?s:`${s}s`} in the last year`,children:[o.jsx("div",{className:"organization-contributions-weekdays","aria-hidden":"true",children:Array.from({length:7}).map((t,a)=>o.jsx("span",{children:v.get(a)??""},a))}),o.jsxs("div",{children:[o.jsx("div",{className:"organization-contributions-months",style:{width:l,gridTemplateColumns:`repeat(${c}, ${f}px)`},"aria-hidden":"true",children:u.map(t=>o.jsx("span",{style:{gridColumnStart:t.column+1},children:t.label},`${t.label}-${t.column}`))}),o.jsx("div",{className:"organization-contributions-grid",style:{width:l,gridTemplateColumns:`repeat(${c}, ${f}px)`},"aria-hidden":"true",children:p.map(t=>o.jsx("span",{className:`organization-contribution-cell ${t.inRange?`level-${t.level}`:"is-outside"}`,title:t.inRange?`${t.count} ${t.count===1?s:`${s}s`} on ${t.date.toLocaleDateString("en",{dateStyle:"long",timeZone:"UTC"})}`:void 0},t.key))})]})]})}),o.jsxs("div",{className:"organization-contributions-legend","aria-hidden":"true",children:[o.jsx("span",{children:"Fewer"}),[0,1,2,3,4].map(t=>o.jsx("span",{className:`organization-contribution-cell level-${t}`},t)),o.jsx("span",{children:"More"})]})]})},A=({organizationSlug:n,organizationName:r})=>{const i=z({queryKey:["organization-contributions",n],queryFn:()=>w.organizationContributions(n),staleTime:6e5});return i.isLoading?o.jsx(T,{className:"organization-contributions-skeleton"}):i.data?o.jsx(L,{data:i.data,organizationName:r}):null};export{L as C,A as O}; diff --git a/assets/OrganizationDetailView-0SsciBmz.js b/assets/OrganizationDetailView-0SsciBmz.js deleted file mode 100644 index c4b09a09084684f76024f9115b02400264ac8b18..0000000000000000000000000000000000000000 --- a/assets/OrganizationDetailView-0SsciBmz.js +++ /dev/null @@ -1 +0,0 @@ -import{u as t,j as r}from"./index-CqKcHUvZ.js";import{O as i}from"./OrganizationPaperFeed-CF5IpMXI.js";import m from"./NotFound-pWH_hqC2.js";import"./ResearchFollowButton-CrCIwiok.js";import"./useQuery-Cngk7eL9.js";import"./useMutation-BItMAQ7s.js";import"./research-Dt0MUW0x.js";import"./plus-DZF-NxR0.js";import"./components-Dmnn5Z5p.js";import"./papers-bE3C_Qzl.js";import"./AuthorAvatar-CWCqOa0h.js";import"./LatexTitle-BI9yl-Fo.js";import"./colors-_scCXfCe.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-CJQADo_f.js";/* empty css */import"./PaperPreviewLink-C6khj_iZ.js";import"./index-CqELxJb0.js";import"./index-DBHj7UWg.js";import"./katex-DkKDou_j.js";import"./hover-card-BTsA69o8.js";import"./OrganizationContributionGraph-DUBXw9I0.js";import"./skeleton-DleNhBYA.js";import"./catalog-D26nGNnK.js";import"./PaperFeedFilters-SOqb93ez.js";import"./PaperDateFilter-zHw5tq6B.js";import"./popover-BcoS9Jmp.js";import"./alert-Z2yFUcyL.js";import"./searchable-select-DY1KXMvg.js";import"./button-BYn4yUH_.js";import"./dialog-B-oqHDuH.js";import"./search-9n8Usynh.js";import"./loader-circle-CZgakNH7.js";import"./useInfiniteScroll-DVF-b-LX.js";import"./useIntersectionObserver-CiBk_Oug.js";import"./usePapers-By3yMmMn.js";import"./useInfiniteQuery-lxaMAHEu.js";import"./organizationNames-BVKzYEBp.js";const L=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{L as default}; diff --git a/assets/OrganizationDetailView-BsHsK07O.js b/assets/OrganizationDetailView-BsHsK07O.js new file mode 100644 index 0000000000000000000000000000000000000000..25dcb04689966b2d9a96a1f27cb0c8c0e264202c --- /dev/null +++ b/assets/OrganizationDetailView-BsHsK07O.js @@ -0,0 +1 @@ +import{u as t,j as r}from"./index-D6jcIRWs.js";import{O as i}from"./OrganizationPaperFeed-BsFHy5Y7.js";import m from"./NotFound-BTsJlVc8.js";import"./ResearchFollowButton-C2Bfd9dP.js";import"./useQuery-CUJUm4FY.js";import"./useMutation-p6mN4h17.js";import"./research-BggtGgC2.js";import"./plus-C4UQ62Q1.js";import"./components-DO1X940E.js";import"./papers-DIIIPDpj.js";import"./AuthorAvatar-UMHOVOr9.js";import"./LatexTitle-D_92Jowu.js";import"./colors-CLwl8a2d.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-B_D3IE_p.js";/* empty css */import"./PaperPreviewLink-fcJyP9H0.js";import"./index-uFGyKu5N.js";import"./index-yduEvk9Z.js";import"./katex-DkKDou_j.js";import"./hover-card-DPpv0l_x.js";import"./OrganizationContributionGraph-DzcTqxNw.js";import"./skeleton-BqkYFmXl.js";import"./catalog-PYrB8_bm.js";import"./PaperFeedFilters-DNebHp4l.js";import"./PaperDateFilter-CPIqaHaq.js";import"./popover-DCjqGpW0.js";import"./alert-2MbxVzGL.js";import"./searchable-select-B7z6Fcrr.js";import"./button-Bzx0ccHH.js";import"./dialog-vGFIbcd-.js";import"./search-CfTufeR7.js";import"./loader-circle-BuDrH29B.js";import"./useInfiniteScroll-Dm7JY_X4.js";import"./useIntersectionObserver-3LTuEaFW.js";import"./usePapers-BbCSwcVk.js";import"./useInfiniteQuery-FXco4P1n.js";import"./organizationNames-BVKzYEBp.js";const L=()=>{const{orgSlug:o}=t();return o?r.jsx(i,{organizationSlug:o}):r.jsx(m,{})};export{L as default}; diff --git a/assets/OrganizationPaperFeed-CF5IpMXI.js b/assets/OrganizationPaperFeed-BsFHy5Y7.js similarity index 88% rename from assets/OrganizationPaperFeed-CF5IpMXI.js rename to assets/OrganizationPaperFeed-BsFHy5Y7.js index 5cb375d0542427a6063e10b95545d73563e53f2c..a714a8d2edc7134f2f1025e20d4c3c35bae3463d 100644 --- a/assets/OrganizationPaperFeed-CF5IpMXI.js +++ b/assets/OrganizationPaperFeed-BsFHy5Y7.js @@ -1 +1 @@ -import{c as z,e as B,r as u,j as e,L as A}from"./index-CqKcHUvZ.js";import{R as E}from"./ResearchFollowButton-CrCIwiok.js";import{u as C}from"./useQuery-Cngk7eL9.js";import{P as Q}from"./components-Dmnn5Z5p.js";import{M as U}from"./MarkdownText-CJQADo_f.js";import{O as G}from"./OrganizationContributionGraph-DUBXw9I0.js";import{P as K}from"./PaperFeedFilters-SOqb93ez.js";import{a as W,P as Z,b as J}from"./PaperDateFilter-zHw5tq6B.js";import{A as V,a as X}from"./alert-Z2yFUcyL.js";import{S as Y}from"./searchable-select-DY1KXMvg.js";import{S as $}from"./skeleton-DleNhBYA.js";import{u as ee}from"./useInfiniteScroll-DVF-b-LX.js";import{e as ae}from"./usePapers-By3yMmMn.js";import{c as R}from"./catalog-D26nGNnK.js";import{d as D,t as se}from"./colors-_scCXfCe.js";import{o as re,i as te}from"./organizationNames-BVKzYEBp.js";import ne from"./NotFound-pWH_hqC2.js";const oe=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ie=n=>n==="date_published"||n==="citation_count"?n:"trending",Pe=({organizationSlug:n,taskSlug:d})=>{var y,v,L,P,F,k,w,O;const T=z(),[o,p]=B(),[I,g]=u.useState(!1),f=ie(o.get("order_by")),_=o.get("has_code")==="true",x=o.get("has_hf_artifacts")==="true",h=W(o),j=C({queryKey:["organization",n],queryFn:()=>R.getOrganization(n),staleTime:10*60*1e3}),c=C({queryKey:["organization-areas-with-tasks",n],queryFn:()=>R.organizationAreasWithTasks(n),staleTime:10*60*1e3}),i=ae({organizationSlug:n,taskSlug:d,page_size:12,order_by:f,order_dir:"desc",include_resources:!0,has_code:_,has_hf_artifacts:x,start_date:h.startDate,end_date:h.endDate,enabled:!!n}),S=ee(i);u.useEffect(()=>{g(!1)},[n,d]);const b=u.useMemo(()=>{var s;return(((s=c.data)==null?void 0:s.results)??[]).flatMap(r=>r.tasks.filter(t=>!!t.slug).map(t=>({...t,slug:t.slug,label:D(t.name,t.slug)})))},[c.data]),l=b.find(s=>s.slug===d),N=u.useMemo(()=>{var s;return(((s=i.data)==null?void 0:s.pages)??[]).flatMap(r=>r.results.map(se))},[i.data]),a=j.data??((y=c.data)==null?void 0:y.organization),m=a?re(a):null,H=((L=(v=i.data)==null?void 0:v.pages[0])==null?void 0:L.count)??0;if(((P=j.error)==null?void 0:P.status)===404||((F=c.error)==null?void 0:F.status)===404||((k=i.error)==null?void 0:k.status)===404)return e.jsx(ne,{});if(c.error||i.error)return e.jsx("div",{className:"page",children:e.jsx(V,{variant:"destructive",children:e.jsx(X,{children:"Failed to load organization papers. Please try again."})})});const M=s=>{const r=s.trim().toLocaleLowerCase();return b.filter(t=>`${t.label} ${t.slug}`.toLocaleLowerCase().includes(r)).map(t=>({value:t.slug,label:t.label,description:`${t.paper_count.toLocaleString()} ${t.paper_count===1?"paper":"papers"}`}))},q=s=>{const r=s==="__all__"?`/orgs/${n}`:`/orgs/${n}/${s}`,t=o.toString();T({pathname:r,search:t?`?${t}`:""})};return e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(A,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(A,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:(a==null?void 0:a.name)??n}),l&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" / "}),e.jsx("span",{children:D(l.name,l.slug)})]})]}),e.jsxs("header",{className:"organization-hero",children:[e.jsxs("div",{className:"organization-hero-profile",children:[e.jsx("div",{className:"organizations-eyebrow",children:"ORGANIZATION"}),e.jsxs("h1",{className:`feed-title organization-hero-title${a&&!m&&te(a.name)?" organization-hero-title--long":""}`,children:[a!=null&&a.logo_url&&!I?e.jsx("img",{src:a.logo_url,alt:"",width:58,height:58,onError:()=>g(!0)}):a?e.jsx("span",{className:"organization-hero-monogram","aria-hidden":"true",children:(m??a.name).slice(0,1).toUpperCase()}):null,a?e.jsxs("span",{className:"organization-hero-name",children:[m??a.name,m&&e.jsx("span",{className:"organization-hero-full-name",children:a.name})]}):e.jsx($,{className:"h-12 w-64"})]}),a&&e.jsx(E,{kind:"organization",entityId:a.id}),a&&e.jsxs("div",{className:"feed-subtitle",children:[((w=a.paper_count)==null?void 0:w.toLocaleString())??0," papers",(a.organization_trending_score??0)>0&&a.trending_rank&&e.jsxs(e.Fragment,{children:[" · #",a.trending_rank," trending this month"]})]}),(a==null?void 0:a.description)&&e.jsx(U,{className:"method-description",text:a.description}),a&&e.jsxs("div",{className:"organization-hero-links",children:[a.website_url&&e.jsx("a",{href:a.website_url,target:"_blank",rel:"noreferrer",children:"Website ↗"}),a.hf_url&&e.jsx("a",{href:a.hf_url,target:"_blank",rel:"noreferrer",children:"Hugging Face ↗"}),a.github_url&&e.jsx("a",{href:a.github_url,target:"_blank",rel:"noreferrer",children:"GitHub ↗"})]})]}),e.jsx(G,{organizationSlug:n,organizationName:(a==null?void 0:a.name)??n})]}),e.jsxs("div",{className:"sort-bar",style:{alignItems:"center",gap:16},children:[e.jsx("div",{style:{minWidth:260},children:e.jsx(Y,{value:d??"__all__",onChange:q,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:l?{value:l.slug,label:l.label,description:`${l.paper_count.toLocaleString()} ${l.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((O=a==null?void 0:a.paper_count)==null?void 0:O.toLocaleString())??0} papers`},queryKey:["organization-task-options",n],queryFn:async s=>{var r;return[{value:"__all__",label:"All tasks",description:`${((r=a==null?void 0:a.paper_count)==null?void 0:r.toLocaleString())??0} papers`},...M(s)]},enabled:!c.isLoading,className:"h-[38px]"})}),e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:oe.map(([s,r])=>e.jsx("button",{type:"button",className:`sort-btn ${f===s?"active":""}`,onClick:()=>{const t=new URLSearchParams(o);s==="trending"?t.delete("order_by"):t.set("order_by",s),p(t)},children:r},s))}),e.jsx(K,{hasCode:_,hasHfArtifacts:x,onHasCodeChange:s=>{const r=new URLSearchParams(o);s?r.set("has_code","true"):r.delete("has_code"),p(r)},onHasHfArtifactsChange:s=>{const r=new URLSearchParams(o);s?r.set("has_hf_artifacts","true"):r.delete("has_hf_artifacts"),p(r)}})]}),e.jsx(Z,{startDate:h.startDate,endDate:h.endDate,onChange:s=>p(J(o,s))}),e.jsxs("div",{className:"results-count",children:[H.toLocaleString()," papers"]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((s,r)=>e.jsx($,{className:"h-40 w-full"},r))}):N.length===0?e.jsx("div",{className:"no-results",children:(a==null?void 0:a.paper_count)===0?"No papers indexed yet":"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:N.map((s,r)=>e.jsx(Q,{paper:s,rank:r+1,showInstitution:!1},s.id))}),e.jsx("div",{ref:S,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})};export{Pe as O}; +import{c as z,e as B,r as u,j as e,L as A}from"./index-D6jcIRWs.js";import{R as E}from"./ResearchFollowButton-C2Bfd9dP.js";import{u as C}from"./useQuery-CUJUm4FY.js";import{P as Q}from"./components-DO1X940E.js";import{M as U}from"./MarkdownText-B_D3IE_p.js";import{O as G}from"./OrganizationContributionGraph-DzcTqxNw.js";import{P as K}from"./PaperFeedFilters-DNebHp4l.js";import{a as W,P as Z,b as J}from"./PaperDateFilter-CPIqaHaq.js";import{A as V,a as X}from"./alert-2MbxVzGL.js";import{S as Y}from"./searchable-select-B7z6Fcrr.js";import{S as $}from"./skeleton-BqkYFmXl.js";import{u as ee}from"./useInfiniteScroll-Dm7JY_X4.js";import{e as ae}from"./usePapers-BbCSwcVk.js";import{c as R}from"./catalog-PYrB8_bm.js";import{d as D,t as se}from"./colors-CLwl8a2d.js";import{o as re,i as te}from"./organizationNames-BVKzYEBp.js";import ne from"./NotFound-BTsJlVc8.js";const oe=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],ie=n=>n==="date_published"||n==="citation_count"?n:"trending",Pe=({organizationSlug:n,taskSlug:d})=>{var y,v,L,P,F,k,w,O;const T=z(),[o,p]=B(),[I,g]=u.useState(!1),f=ie(o.get("order_by")),_=o.get("has_code")==="true",x=o.get("has_hf_artifacts")==="true",h=W(o),j=C({queryKey:["organization",n],queryFn:()=>R.getOrganization(n),staleTime:10*60*1e3}),c=C({queryKey:["organization-areas-with-tasks",n],queryFn:()=>R.organizationAreasWithTasks(n),staleTime:10*60*1e3}),i=ae({organizationSlug:n,taskSlug:d,page_size:12,order_by:f,order_dir:"desc",include_resources:!0,has_code:_,has_hf_artifacts:x,start_date:h.startDate,end_date:h.endDate,enabled:!!n}),S=ee(i);u.useEffect(()=>{g(!1)},[n,d]);const b=u.useMemo(()=>{var s;return(((s=c.data)==null?void 0:s.results)??[]).flatMap(r=>r.tasks.filter(t=>!!t.slug).map(t=>({...t,slug:t.slug,label:D(t.name,t.slug)})))},[c.data]),l=b.find(s=>s.slug===d),N=u.useMemo(()=>{var s;return(((s=i.data)==null?void 0:s.pages)??[]).flatMap(r=>r.results.map(se))},[i.data]),a=j.data??((y=c.data)==null?void 0:y.organization),m=a?re(a):null,H=((L=(v=i.data)==null?void 0:v.pages[0])==null?void 0:L.count)??0;if(((P=j.error)==null?void 0:P.status)===404||((F=c.error)==null?void 0:F.status)===404||((k=i.error)==null?void 0:k.status)===404)return e.jsx(ne,{});if(c.error||i.error)return e.jsx("div",{className:"page",children:e.jsx(V,{variant:"destructive",children:e.jsx(X,{children:"Failed to load organization papers. Please try again."})})});const M=s=>{const r=s.trim().toLocaleLowerCase();return b.filter(t=>`${t.label} ${t.slug}`.toLocaleLowerCase().includes(r)).map(t=>({value:t.slug,label:t.label,description:`${t.paper_count.toLocaleString()} ${t.paper_count===1?"paper":"papers"}`}))},q=s=>{const r=s==="__all__"?`/orgs/${n}`:`/orgs/${n}/${s}`,t=o.toString();T({pathname:r,search:t?`?${t}`:""})};return e.jsxs("div",{className:"page",children:[e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(A,{to:"/",children:"Home"}),e.jsx("span",{children:" / "}),e.jsx(A,{to:"/organizations",children:"Organizations"}),e.jsx("span",{children:" / "}),e.jsx("span",{children:(a==null?void 0:a.name)??n}),l&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:" / "}),e.jsx("span",{children:D(l.name,l.slug)})]})]}),e.jsxs("header",{className:"organization-hero",children:[e.jsxs("div",{className:"organization-hero-profile",children:[e.jsx("div",{className:"organizations-eyebrow",children:"ORGANIZATION"}),e.jsxs("h1",{className:`feed-title organization-hero-title${a&&!m&&te(a.name)?" organization-hero-title--long":""}`,children:[a!=null&&a.logo_url&&!I?e.jsx("img",{src:a.logo_url,alt:"",width:58,height:58,onError:()=>g(!0)}):a?e.jsx("span",{className:"organization-hero-monogram","aria-hidden":"true",children:(m??a.name).slice(0,1).toUpperCase()}):null,a?e.jsxs("span",{className:"organization-hero-name",children:[m??a.name,m&&e.jsx("span",{className:"organization-hero-full-name",children:a.name})]}):e.jsx($,{className:"h-12 w-64"})]}),a&&e.jsx(E,{kind:"organization",entityId:a.id}),a&&e.jsxs("div",{className:"feed-subtitle",children:[((w=a.paper_count)==null?void 0:w.toLocaleString())??0," papers",(a.organization_trending_score??0)>0&&a.trending_rank&&e.jsxs(e.Fragment,{children:[" · #",a.trending_rank," trending this month"]})]}),(a==null?void 0:a.description)&&e.jsx(U,{className:"method-description",text:a.description}),a&&e.jsxs("div",{className:"organization-hero-links",children:[a.website_url&&e.jsx("a",{href:a.website_url,target:"_blank",rel:"noreferrer",children:"Website ↗"}),a.hf_url&&e.jsx("a",{href:a.hf_url,target:"_blank",rel:"noreferrer",children:"Hugging Face ↗"}),a.github_url&&e.jsx("a",{href:a.github_url,target:"_blank",rel:"noreferrer",children:"GitHub ↗"})]})]}),e.jsx(G,{organizationSlug:n,organizationName:(a==null?void 0:a.name)??n})]}),e.jsxs("div",{className:"sort-bar",style:{alignItems:"center",gap:16},children:[e.jsx("div",{style:{minWidth:260},children:e.jsx(Y,{value:d??"__all__",onChange:q,placeholder:"All tasks",searchPlaceholder:"Search organization tasks...",emptyMessage:"No matching tasks.",ariaLabel:"Filter papers by task",selectedOption:l?{value:l.slug,label:l.label,description:`${l.paper_count.toLocaleString()} ${l.paper_count===1?"paper":"papers"}`}:{value:"__all__",label:"All tasks",description:`${((O=a==null?void 0:a.paper_count)==null?void 0:O.toLocaleString())??0} papers`},queryKey:["organization-task-options",n],queryFn:async s=>{var r;return[{value:"__all__",label:"All tasks",description:`${((r=a==null?void 0:a.paper_count)==null?void 0:r.toLocaleString())??0} papers`},...M(s)]},enabled:!c.isLoading,className:"h-[38px]"})}),e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:oe.map(([s,r])=>e.jsx("button",{type:"button",className:`sort-btn ${f===s?"active":""}`,onClick:()=>{const t=new URLSearchParams(o);s==="trending"?t.delete("order_by"):t.set("order_by",s),p(t)},children:r},s))}),e.jsx(K,{hasCode:_,hasHfArtifacts:x,onHasCodeChange:s=>{const r=new URLSearchParams(o);s?r.set("has_code","true"):r.delete("has_code"),p(r)},onHasHfArtifactsChange:s=>{const r=new URLSearchParams(o);s?r.set("has_hf_artifacts","true"):r.delete("has_hf_artifacts"),p(r)}})]}),e.jsx(Z,{startDate:h.startDate,endDate:h.endDate,onChange:s=>p(J(o,s))}),e.jsxs("div",{className:"results-count",children:[H.toLocaleString()," papers"]})]}),i.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((s,r)=>e.jsx($,{className:"h-40 w-full"},r))}):N.length===0?e.jsx("div",{className:"no-results",children:(a==null?void 0:a.paper_count)===0?"No papers indexed yet":"No papers found for this selection."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:N.map((s,r)=>e.jsx(Q,{paper:s,rank:r+1,showInstitution:!1},s.id))}),e.jsx("div",{ref:S,style:{height:1}}),i.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center"},children:"Loading more…"})]})]})};export{Pe as O}; diff --git a/assets/OrganizationTaskView--dnePIkF.js b/assets/OrganizationTaskView--dnePIkF.js new file mode 100644 index 0000000000000000000000000000000000000000..fae460cc849ab01b3d634f2bdad76164e80eadfc --- /dev/null +++ b/assets/OrganizationTaskView--dnePIkF.js @@ -0,0 +1 @@ +import{u as i,j as t}from"./index-D6jcIRWs.js";import{O as m}from"./OrganizationPaperFeed-BsFHy5Y7.js";import p from"./NotFound-BTsJlVc8.js";import"./ResearchFollowButton-C2Bfd9dP.js";import"./useQuery-CUJUm4FY.js";import"./useMutation-p6mN4h17.js";import"./research-BggtGgC2.js";import"./plus-C4UQ62Q1.js";import"./components-DO1X940E.js";import"./papers-DIIIPDpj.js";import"./AuthorAvatar-UMHOVOr9.js";import"./LatexTitle-D_92Jowu.js";import"./colors-CLwl8a2d.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-B_D3IE_p.js";/* empty css */import"./PaperPreviewLink-fcJyP9H0.js";import"./index-uFGyKu5N.js";import"./index-yduEvk9Z.js";import"./katex-DkKDou_j.js";import"./hover-card-DPpv0l_x.js";import"./OrganizationContributionGraph-DzcTqxNw.js";import"./skeleton-BqkYFmXl.js";import"./catalog-PYrB8_bm.js";import"./PaperFeedFilters-DNebHp4l.js";import"./PaperDateFilter-CPIqaHaq.js";import"./popover-DCjqGpW0.js";import"./alert-2MbxVzGL.js";import"./searchable-select-B7z6Fcrr.js";import"./button-Bzx0ccHH.js";import"./dialog-vGFIbcd-.js";import"./search-CfTufeR7.js";import"./loader-circle-BuDrH29B.js";import"./useInfiniteScroll-Dm7JY_X4.js";import"./useIntersectionObserver-3LTuEaFW.js";import"./usePapers-BbCSwcVk.js";import"./useInfiniteQuery-FXco4P1n.js";import"./organizationNames-BVKzYEBp.js";const L=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{L as default}; diff --git a/assets/OrganizationTaskView-BXRvLYFu.js b/assets/OrganizationTaskView-BXRvLYFu.js deleted file mode 100644 index ac8498cbfe6405789e80c71d4fa711e54a48be3e..0000000000000000000000000000000000000000 --- a/assets/OrganizationTaskView-BXRvLYFu.js +++ /dev/null @@ -1 +0,0 @@ -import{u as i,j as t}from"./index-CqKcHUvZ.js";import{O as m}from"./OrganizationPaperFeed-CF5IpMXI.js";import p from"./NotFound-pWH_hqC2.js";import"./ResearchFollowButton-CrCIwiok.js";import"./useQuery-Cngk7eL9.js";import"./useMutation-BItMAQ7s.js";import"./research-Dt0MUW0x.js";import"./plus-DZF-NxR0.js";import"./components-Dmnn5Z5p.js";import"./papers-bE3C_Qzl.js";import"./AuthorAvatar-CWCqOa0h.js";import"./LatexTitle-BI9yl-Fo.js";import"./colors-_scCXfCe.js";import"./safeExternalHref-CkBrsh84.js";import"./MarkdownText-CJQADo_f.js";/* empty css */import"./PaperPreviewLink-C6khj_iZ.js";import"./index-CqELxJb0.js";import"./index-DBHj7UWg.js";import"./katex-DkKDou_j.js";import"./hover-card-BTsA69o8.js";import"./OrganizationContributionGraph-DUBXw9I0.js";import"./skeleton-DleNhBYA.js";import"./catalog-D26nGNnK.js";import"./PaperFeedFilters-SOqb93ez.js";import"./PaperDateFilter-zHw5tq6B.js";import"./popover-BcoS9Jmp.js";import"./alert-Z2yFUcyL.js";import"./searchable-select-DY1KXMvg.js";import"./button-BYn4yUH_.js";import"./dialog-B-oqHDuH.js";import"./search-9n8Usynh.js";import"./loader-circle-CZgakNH7.js";import"./useInfiniteScroll-DVF-b-LX.js";import"./useIntersectionObserver-CiBk_Oug.js";import"./usePapers-By3yMmMn.js";import"./useInfiniteQuery-lxaMAHEu.js";import"./organizationNames-BVKzYEBp.js";const L=()=>{const{orgSlug:o,taskSlug:r}=i();return o&&r?t.jsx(m,{organizationSlug:o,taskSlug:r}):t.jsx(p,{})};export{L as default}; diff --git a/assets/OrganizationsIndexView-CLXjlm96.js b/assets/OrganizationsIndexView-C_uscBZY.js similarity index 96% rename from assets/OrganizationsIndexView-CLXjlm96.js rename to assets/OrganizationsIndexView-C_uscBZY.js index 2f8a4e2d59d024a0c8579f65a022dd2b71af526e..9ab5d1dfc3342d8818c4ccde730a1bdb22faa9a6 100644 --- a/assets/OrganizationsIndexView-CLXjlm96.js +++ b/assets/OrganizationsIndexView-C_uscBZY.js @@ -1 +1 @@ -import{e as g,r as h,j as e,L as x}from"./index-CqKcHUvZ.js";import{u}from"./useQuery-Cngk7eL9.js";import{A as j,a as y}from"./alert-Z2yFUcyL.js";import{c as N}from"./catalog-D26nGNnK.js";const f=n=>n==="papers"||n==="name"?n:"trending",_=({organization:n})=>{const[d,i]=h.useState(!1);return!n.logo_url||d?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:n.name.slice(0,1).toUpperCase()}):e.jsx("span",{className:"organization-logo",children:e.jsx("img",{src:n.logo_url,alt:"",width:48,height:48,onError:()=>i(!0)})})},S=()=>{const[n,d]=g(),i=f(n.get("sort")),c=n.get("q")??"",o=u({queryKey:["organizations","featured"],queryFn:()=>N.organizationIndex(),staleTime:10*60*1e3}),p=s=>{const a=new URLSearchParams(n),t=s.sort??i,r=s.query??c;t==="trending"?a.delete("sort"):a.set("sort",t),r.trim()?a.set("q",r):a.delete("q"),d(a)},m=h.useMemo(()=>{var t;const s=c.trim().toLocaleLowerCase(),a=(((t=o.data)==null?void 0:t.results)??[]).filter(r=>[r.name,r.slug,r.hf_slug??""].join(" ").toLocaleLowerCase().includes(s));return i==="papers"?[...a].sort((r,l)=>(l.paper_count??0)-(r.paper_count??0)||r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):i==="name"?[...a].sort((r,l)=>r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):a},[o.data,c,i]);return e.jsxs("div",{className:"page organizations-page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Organizations"})]}),e.jsx("div",{className:"feed-subtitle",children:"Explore papers from leading AI organizations, ranked by sustained community momentum over the past 30 days."})]})}),e.jsxs("section",{"aria-labelledby":"organizations-heading",children:[e.jsxs("div",{className:"organizations-section-heading",children:[e.jsx("h2",{id:"organizations-heading",children:o.data?`${o.data.count.toLocaleString()} organizations`:"Organizations"}),e.jsx("span",{children:i==="trending"?"Ranked by 30-day momentum":i==="papers"?"Sorted by linked papers":"Sorted A–Z"})]}),e.jsxs("div",{className:"organizations-controls",children:[e.jsxs("label",{children:[e.jsx("span",{className:"sr-only",children:"Search organizations"}),e.jsx("input",{type:"search",value:c,onChange:s=>p({query:s.target.value}),placeholder:"Search organizations"})]}),e.jsx("div",{className:"organizations-sort","aria-label":"Sort organizations",children:[["trending","Trending"],["papers","Most papers"],["name","A–Z"]].map(([s,a])=>e.jsx("button",{type:"button",className:i===s?"active":"","aria-pressed":i===s,onClick:()=>p({sort:s}),children:a},s))})]}),o.isLoading?e.jsx("div",{className:"organizations-grid","aria-busy":"true","aria-label":"Loading organizations",children:Array.from({length:12}).map((s,a)=>e.jsxs("div",{className:"organization-card organization-card-skeleton",children:[e.jsxs("div",{className:"organization-card-header",children:[e.jsx("span",{className:"organization-logo"}),e.jsxs("div",{children:[e.jsx("span",{className:"organization-skeleton-line"}),e.jsx("span",{className:"organization-skeleton-line short"})]})]}),e.jsx("div",{className:"organization-card-metrics",children:e.jsx("span",{className:"organization-skeleton-line short"})}),e.jsxs("div",{className:"organization-highlight",children:[e.jsx("span",{className:"organization-skeleton-line"}),e.jsx("span",{className:"organization-skeleton-line"})]})]},a))}):o.error?e.jsx(j,{variant:"destructive",children:e.jsxs(y,{children:["Failed to load organizations."," ",e.jsx("button",{type:"button",onClick:()=>o.refetch(),children:"Try again"})]})}):m.length===0?e.jsxs("div",{className:"organizations-empty",children:["No organizations match “",c,"”."]}):e.jsx("div",{className:"organizations-grid",children:m.map(s=>{var r;const a=s.paper_count??0,t=s.first_paper_year&&s.latest_paper_year?s.first_paper_year===s.latest_paper_year?String(s.first_paper_year):`${s.first_paper_year}–${s.latest_paper_year}`:null;return e.jsxs(x,{to:`/orgs/${s.slug}`,className:"organization-card","aria-label":a?`Browse ${a.toLocaleString()} ${s.name} papers`:`Browse ${s.name} papers`,children:[e.jsxs("div",{className:"organization-card-header",children:[e.jsx(_,{organization:s}),e.jsxs("div",{children:[e.jsx("h3",{children:s.name}),e.jsxs("span",{children:["@",s.hf_slug??s.slug]})]})]}),e.jsxs("div",{className:"organization-card-metrics",children:[e.jsx("strong",{children:a.toLocaleString()}),e.jsx("span",{children:a===1?"paper":"papers"}),i==="trending"&&s.trending_rank&&e.jsxs("span",{className:"organization-rank",children:["#",s.trending_rank]})]}),e.jsxs("div",{className:"organization-highlight",children:[e.jsx("span",{children:"Trending paper"}),e.jsx("strong",{children:((r=s.top_trending_paper)==null?void 0:r.title)??"No papers indexed yet"})]}),e.jsxs("div",{className:"organization-card-footer",children:[t?`Publishing ${t}`:"Research archive ready",e.jsx("span",{"aria-hidden":"true",children:"↗"})]})]},s.id)})})]})]})};export{S as default}; +import{e as g,r as h,j as e,L as x}from"./index-D6jcIRWs.js";import{u}from"./useQuery-CUJUm4FY.js";import{A as j,a as y}from"./alert-2MbxVzGL.js";import{c as N}from"./catalog-PYrB8_bm.js";const f=n=>n==="papers"||n==="name"?n:"trending",_=({organization:n})=>{const[d,i]=h.useState(!1);return!n.logo_url||d?e.jsx("span",{className:"organization-logo organization-logo--fallback","aria-hidden":"true",children:n.name.slice(0,1).toUpperCase()}):e.jsx("span",{className:"organization-logo",children:e.jsx("img",{src:n.logo_url,alt:"",width:48,height:48,onError:()=>i(!0)})})},S=()=>{const[n,d]=g(),i=f(n.get("sort")),c=n.get("q")??"",o=u({queryKey:["organizations","featured"],queryFn:()=>N.organizationIndex(),staleTime:10*60*1e3}),p=s=>{const a=new URLSearchParams(n),t=s.sort??i,r=s.query??c;t==="trending"?a.delete("sort"):a.set("sort",t),r.trim()?a.set("q",r):a.delete("q"),d(a)},m=h.useMemo(()=>{var t;const s=c.trim().toLocaleLowerCase(),a=(((t=o.data)==null?void 0:t.results)??[]).filter(r=>[r.name,r.slug,r.hf_slug??""].join(" ").toLocaleLowerCase().includes(s));return i==="papers"?[...a].sort((r,l)=>(l.paper_count??0)-(r.paper_count??0)||r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):i==="name"?[...a].sort((r,l)=>r.name.localeCompare(l.name)||r.slug.localeCompare(l.slug)):a},[o.data,c,i]);return e.jsxs("div",{className:"page organizations-page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["AI ",e.jsx("em",{children:"Organizations"})]}),e.jsx("div",{className:"feed-subtitle",children:"Explore papers from leading AI organizations, ranked by sustained community momentum over the past 30 days."})]})}),e.jsxs("section",{"aria-labelledby":"organizations-heading",children:[e.jsxs("div",{className:"organizations-section-heading",children:[e.jsx("h2",{id:"organizations-heading",children:o.data?`${o.data.count.toLocaleString()} organizations`:"Organizations"}),e.jsx("span",{children:i==="trending"?"Ranked by 30-day momentum":i==="papers"?"Sorted by linked papers":"Sorted A–Z"})]}),e.jsxs("div",{className:"organizations-controls",children:[e.jsxs("label",{children:[e.jsx("span",{className:"sr-only",children:"Search organizations"}),e.jsx("input",{type:"search",value:c,onChange:s=>p({query:s.target.value}),placeholder:"Search organizations"})]}),e.jsx("div",{className:"organizations-sort","aria-label":"Sort organizations",children:[["trending","Trending"],["papers","Most papers"],["name","A–Z"]].map(([s,a])=>e.jsx("button",{type:"button",className:i===s?"active":"","aria-pressed":i===s,onClick:()=>p({sort:s}),children:a},s))})]}),o.isLoading?e.jsx("div",{className:"organizations-grid","aria-busy":"true","aria-label":"Loading organizations",children:Array.from({length:12}).map((s,a)=>e.jsxs("div",{className:"organization-card organization-card-skeleton",children:[e.jsxs("div",{className:"organization-card-header",children:[e.jsx("span",{className:"organization-logo"}),e.jsxs("div",{children:[e.jsx("span",{className:"organization-skeleton-line"}),e.jsx("span",{className:"organization-skeleton-line short"})]})]}),e.jsx("div",{className:"organization-card-metrics",children:e.jsx("span",{className:"organization-skeleton-line short"})}),e.jsxs("div",{className:"organization-highlight",children:[e.jsx("span",{className:"organization-skeleton-line"}),e.jsx("span",{className:"organization-skeleton-line"})]})]},a))}):o.error?e.jsx(j,{variant:"destructive",children:e.jsxs(y,{children:["Failed to load organizations."," ",e.jsx("button",{type:"button",onClick:()=>o.refetch(),children:"Try again"})]})}):m.length===0?e.jsxs("div",{className:"organizations-empty",children:["No organizations match “",c,"”."]}):e.jsx("div",{className:"organizations-grid",children:m.map(s=>{var r;const a=s.paper_count??0,t=s.first_paper_year&&s.latest_paper_year?s.first_paper_year===s.latest_paper_year?String(s.first_paper_year):`${s.first_paper_year}–${s.latest_paper_year}`:null;return e.jsxs(x,{to:`/orgs/${s.slug}`,className:"organization-card","aria-label":a?`Browse ${a.toLocaleString()} ${s.name} papers`:`Browse ${s.name} papers`,children:[e.jsxs("div",{className:"organization-card-header",children:[e.jsx(_,{organization:s}),e.jsxs("div",{children:[e.jsx("h3",{children:s.name}),e.jsxs("span",{children:["@",s.hf_slug??s.slug]})]})]}),e.jsxs("div",{className:"organization-card-metrics",children:[e.jsx("strong",{children:a.toLocaleString()}),e.jsx("span",{children:a===1?"paper":"papers"}),i==="trending"&&s.trending_rank&&e.jsxs("span",{className:"organization-rank",children:["#",s.trending_rank]})]}),e.jsxs("div",{className:"organization-highlight",children:[e.jsx("span",{children:"Trending paper"}),e.jsx("strong",{children:((r=s.top_trending_paper)==null?void 0:r.title)??"No papers indexed yet"})]}),e.jsxs("div",{className:"organization-card-footer",children:[t?`Publishing ${t}`:"Research archive ready",e.jsx("span",{"aria-hidden":"true",children:"↗"})]})]},s.id)})})]})]})};export{S as default}; diff --git a/assets/PaperDateFilter-zHw5tq6B.js b/assets/PaperDateFilter-CPIqaHaq.js similarity index 98% rename from assets/PaperDateFilter-zHw5tq6B.js rename to assets/PaperDateFilter-CPIqaHaq.js index e8ccff48242c1017c71bd0363f77fda386dea20f..034d808138197d2e787f22fb38d7a4410a6079fa 100644 --- a/assets/PaperDateFilter-zHw5tq6B.js +++ b/assets/PaperDateFilter-CPIqaHaq.js @@ -1 +1 @@ -import{r as p,j as n}from"./index-CqKcHUvZ.js";import{P as q,a as G,b as Q}from"./popover-BcoS9Jmp.js";const E=(e,t)=>{const a=new Date(t),s=new Date(a);return s.setUTCDate(a.getUTCDate()-(e==="week"?6:29)),{startDate:s.toISOString().slice(0,10),endDate:a.toISOString().slice(0,10)}},z=e=>({startDate:e.get("start_date")||void 0,endDate:e.get("end_date")||void 0}),oe=(e,t=new Date,a="week")=>{const s=z(e);if(s.startDate||s.endDate||e.get("time")==="all_time")return s;const c=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()));return E(a,c)},J=(e,t)=>{const a=new URLSearchParams(e);return t.startDate?a.set("start_date",t.startDate):a.delete("start_date"),t.endDate?a.set("end_date",t.endDate):a.delete("end_date"),a.delete("time"),a},ie=(e,t)=>{const a=J(e,t);return!t.startDate&&!t.endDate&&a.set("time","all_time"),a},K=new Intl.DateTimeFormat("en",{month:"long",year:"numeric",timeZone:"UTC"}),O=new Intl.DateTimeFormat("en",{month:"short",timeZone:"UTC"}),L="(max-width: 640px)",X=()=>{const[e,t]=p.useState(()=>typeof window<"u"&&window.matchMedia(L).matches);return p.useEffect(()=>{const a=window.matchMedia(L),s=c=>t(c.matches);return t(a.matches),a.addEventListener("change",s),()=>a.removeEventListener("change",s)},[]),e},V=e=>e.toISOString().slice(0,10),b=e=>new Date(`${e}T00:00:00Z`),ee=()=>{const e=new Date;return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))},R=(e,t)=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+t,1)),M=e=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),1)),te=(e,t)=>new Date(Date.UTC(t,e.getUTCMonth(),1)),w=(e,t)=>e.startDate===t.startDate&&e.endDate===t.endDate,ae=(e,t)=>{const a=b(e),s=b(t),c=O.format(a),l=O.format(s),g=a.getUTCDate(),d=s.getUTCDate(),o=a.getUTCFullYear(),u=s.getUTCFullYear();return e===t?`${c} ${g}, ${o}`:o===u&&a.getUTCMonth()===s.getUTCMonth()?`${c} ${g}–${d}, ${o}`:o===u?`${c} ${g}–${l} ${d}, ${o}`:`${c} ${g}, ${o}–${l} ${d}, ${u}`},ne=e=>{const t=e.getUTCFullYear(),a=e.getUTCMonth(),s=new Date(Date.UTC(t,a,1)),c=(s.getUTCDay()+6)%7,l=new Date(s);return l.setUTCDate(s.getUTCDate()-c),Array.from({length:42},(g,d)=>{const o=new Date(l);return o.setUTCDate(l.getUTCDate()+d),{iso:V(o),day:o.getUTCDate(),outsideMonth:o.getUTCMonth()!==a}})},A=({month:e,today:t,startDate:a,endDate:s,onSelect:c,yearLabel:l,yearValue:g,onYearChange:d,secondary:o=!1})=>{const u=p.useMemo(()=>ne(e),[e]);return n.jsxs("section",{className:`paper-date-calendar${o?" paper-date-calendar-secondary":""}`,children:[n.jsxs("label",{className:"paper-date-year",children:[n.jsx("span",{children:l}),n.jsx("input",{type:"number",inputMode:"numeric",min:"1900",max:t.slice(0,4),step:"1",value:g,onChange:r=>d(r.target.value)})]}),n.jsx("h3",{children:K.format(e)}),n.jsx("div",{className:"paper-date-weekdays","aria-hidden":"true",children:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"].map(r=>n.jsx("span",{children:r},r))}),n.jsx("div",{className:"paper-date-days",children:u.map(r=>{const h=r.iso===a||r.iso===s,T=!!(a&&s&&r.iso>a&&r.isot;return n.jsx("button",{type:"button","aria-label":r.iso,"aria-selected":h,disabled:m,className:["paper-date-day",r.outsideMonth?"outside":"",h?"selected":"",T?"in-range":"",r.iso===t?"today":""].filter(Boolean).join(" "),onClick:()=>c(r.iso),children:r.day},r.iso)})})]})},I=({calendar:e,onPrevious:t,onNext:a,secondary:s=!1})=>n.jsxs("div",{className:`paper-date-navigation-group${s?" paper-date-navigation-group-secondary":""}`,children:[n.jsx("button",{type:"button","aria-label":`Previous ${e} month`,onClick:t,children:"←"}),n.jsx("button",{type:"button","aria-label":`Next ${e} month`,onClick:a,children:"→"})]}),ce=({startDate:e,endDate:t,onChange:a,currentDate:s})=>{const c=X(),l=s?b(s):ee(),[g,d]=p.useState(!1),[o,u]=p.useState(),[r,h]=p.useState(),[T,m]=p.useState(()=>M(l)),[$,D]=p.useState(()=>R(M(l),1)),[H,y]=p.useState(()=>String(l.getUTCFullYear())),[B,U]=p.useState(()=>String(l.getUTCFullYear())),f={startDate:e,endDate:t},N=E("week",l),Y=E("month",l),P=V(l),v=!!(e&&t&&!w(f,N)&&!w(f,Y)),Z=()=>{u(e),h(t);const i=M(e?b(e):l),C=M(t?b(t):R(i,1));m(i),D(C),y(String(i.getUTCFullYear())),U(String(C.getUTCFullYear())),d(!0)},k=(i,C,F)=>{if(C(i),!/^\d{4}$/.test(i))return;const x=Number(i);x>=1900&&x<=l.getUTCFullYear()&&F(j=>te(j,x))},S=(i,C,F,x)=>{const j=R(i,C);F(j),x(String(j.getUTCFullYear()))},_=i=>{!o||r?(u(i),h(void 0)):i{a({}),d(!1)};return n.jsxs("div",{className:`paper-date-filter${c?" paper-date-filter-single-calendar":""}`,role:"group","aria-label":"Publication date",children:[n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${w(f,N)?" active":""}`,onClick:()=>a(N),children:"Last Week"}),n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${w(f,Y)?" active":""}`,onClick:()=>a(Y),children:"Last Month"}),n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${!e&&!t?" active":""}`,onClick:()=>a({}),children:"All Time"}),n.jsxs(q,{open:g,onOpenChange:i=>{i?Z():d(!1)},children:[n.jsx(G,{asChild:!0,children:n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${v?" active":""}`,"aria-label":v?"Change date range":"Select a range",children:v&&e&&t?ae(e,t):"Select a range"})}),n.jsxs(Q,{align:"end",className:`paper-date-popover${c?" paper-date-popover-single-calendar":""}`,role:"dialog","aria-label":"Select a date range",children:[n.jsxs("div",{className:"paper-date-popover-header",children:[n.jsx("h2",{children:"Select a date range"}),n.jsx("p",{children:"Choose an inclusive start and end publication date."})]}),n.jsxs("div",{className:"paper-date-navigation",children:[n.jsx(I,{calendar:"start",onPrevious:()=>S(T,-1,m,y),onNext:()=>S(T,1,m,y)}),!c&&n.jsx(I,{calendar:"end",onPrevious:()=>S($,-1,D,U),onNext:()=>S($,1,D,U),secondary:!0})]}),n.jsxs("div",{className:"paper-date-calendars",children:[n.jsx(A,{month:T,today:P,startDate:o,endDate:r,onSelect:_,yearLabel:c?"Year":"Start year",yearValue:H,onYearChange:i=>k(i,y,m)}),!c&&n.jsx(A,{month:$,today:P,startDate:o,endDate:r,onSelect:_,yearLabel:"End year",yearValue:B,onYearChange:i=>k(i,U,D),secondary:!0})]}),n.jsxs("div",{className:"paper-date-actions",children:[n.jsx("button",{type:"button",className:"paper-date-clear",onClick:W,children:"Clear range"}),n.jsxs("div",{children:[n.jsx("button",{type:"button",onClick:()=>d(!1),children:"Cancel"}),n.jsx("button",{type:"button",className:"paper-date-apply",disabled:!o||!r,onClick:()=>{o&&r&&a({startDate:o,endDate:r}),d(!1)},children:"Apply"})]})]})]})]})]})};export{ce as P,z as a,J as b,oe as r,ie as w}; +import{r as p,j as n}from"./index-D6jcIRWs.js";import{P as q,a as G,b as Q}from"./popover-DCjqGpW0.js";const E=(e,t)=>{const a=new Date(t),s=new Date(a);return s.setUTCDate(a.getUTCDate()-(e==="week"?6:29)),{startDate:s.toISOString().slice(0,10),endDate:a.toISOString().slice(0,10)}},z=e=>({startDate:e.get("start_date")||void 0,endDate:e.get("end_date")||void 0}),oe=(e,t=new Date,a="week")=>{const s=z(e);if(s.startDate||s.endDate||e.get("time")==="all_time")return s;const c=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()));return E(a,c)},J=(e,t)=>{const a=new URLSearchParams(e);return t.startDate?a.set("start_date",t.startDate):a.delete("start_date"),t.endDate?a.set("end_date",t.endDate):a.delete("end_date"),a.delete("time"),a},ie=(e,t)=>{const a=J(e,t);return!t.startDate&&!t.endDate&&a.set("time","all_time"),a},K=new Intl.DateTimeFormat("en",{month:"long",year:"numeric",timeZone:"UTC"}),O=new Intl.DateTimeFormat("en",{month:"short",timeZone:"UTC"}),L="(max-width: 640px)",X=()=>{const[e,t]=p.useState(()=>typeof window<"u"&&window.matchMedia(L).matches);return p.useEffect(()=>{const a=window.matchMedia(L),s=c=>t(c.matches);return t(a.matches),a.addEventListener("change",s),()=>a.removeEventListener("change",s)},[]),e},V=e=>e.toISOString().slice(0,10),b=e=>new Date(`${e}T00:00:00Z`),ee=()=>{const e=new Date;return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))},R=(e,t)=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+t,1)),M=e=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),1)),te=(e,t)=>new Date(Date.UTC(t,e.getUTCMonth(),1)),w=(e,t)=>e.startDate===t.startDate&&e.endDate===t.endDate,ae=(e,t)=>{const a=b(e),s=b(t),c=O.format(a),l=O.format(s),g=a.getUTCDate(),d=s.getUTCDate(),o=a.getUTCFullYear(),u=s.getUTCFullYear();return e===t?`${c} ${g}, ${o}`:o===u&&a.getUTCMonth()===s.getUTCMonth()?`${c} ${g}–${d}, ${o}`:o===u?`${c} ${g}–${l} ${d}, ${o}`:`${c} ${g}, ${o}–${l} ${d}, ${u}`},ne=e=>{const t=e.getUTCFullYear(),a=e.getUTCMonth(),s=new Date(Date.UTC(t,a,1)),c=(s.getUTCDay()+6)%7,l=new Date(s);return l.setUTCDate(s.getUTCDate()-c),Array.from({length:42},(g,d)=>{const o=new Date(l);return o.setUTCDate(l.getUTCDate()+d),{iso:V(o),day:o.getUTCDate(),outsideMonth:o.getUTCMonth()!==a}})},A=({month:e,today:t,startDate:a,endDate:s,onSelect:c,yearLabel:l,yearValue:g,onYearChange:d,secondary:o=!1})=>{const u=p.useMemo(()=>ne(e),[e]);return n.jsxs("section",{className:`paper-date-calendar${o?" paper-date-calendar-secondary":""}`,children:[n.jsxs("label",{className:"paper-date-year",children:[n.jsx("span",{children:l}),n.jsx("input",{type:"number",inputMode:"numeric",min:"1900",max:t.slice(0,4),step:"1",value:g,onChange:r=>d(r.target.value)})]}),n.jsx("h3",{children:K.format(e)}),n.jsx("div",{className:"paper-date-weekdays","aria-hidden":"true",children:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"].map(r=>n.jsx("span",{children:r},r))}),n.jsx("div",{className:"paper-date-days",children:u.map(r=>{const h=r.iso===a||r.iso===s,T=!!(a&&s&&r.iso>a&&r.isot;return n.jsx("button",{type:"button","aria-label":r.iso,"aria-selected":h,disabled:m,className:["paper-date-day",r.outsideMonth?"outside":"",h?"selected":"",T?"in-range":"",r.iso===t?"today":""].filter(Boolean).join(" "),onClick:()=>c(r.iso),children:r.day},r.iso)})})]})},I=({calendar:e,onPrevious:t,onNext:a,secondary:s=!1})=>n.jsxs("div",{className:`paper-date-navigation-group${s?" paper-date-navigation-group-secondary":""}`,children:[n.jsx("button",{type:"button","aria-label":`Previous ${e} month`,onClick:t,children:"←"}),n.jsx("button",{type:"button","aria-label":`Next ${e} month`,onClick:a,children:"→"})]}),ce=({startDate:e,endDate:t,onChange:a,currentDate:s})=>{const c=X(),l=s?b(s):ee(),[g,d]=p.useState(!1),[o,u]=p.useState(),[r,h]=p.useState(),[T,m]=p.useState(()=>M(l)),[$,D]=p.useState(()=>R(M(l),1)),[H,y]=p.useState(()=>String(l.getUTCFullYear())),[B,U]=p.useState(()=>String(l.getUTCFullYear())),f={startDate:e,endDate:t},N=E("week",l),Y=E("month",l),P=V(l),v=!!(e&&t&&!w(f,N)&&!w(f,Y)),Z=()=>{u(e),h(t);const i=M(e?b(e):l),C=M(t?b(t):R(i,1));m(i),D(C),y(String(i.getUTCFullYear())),U(String(C.getUTCFullYear())),d(!0)},k=(i,C,F)=>{if(C(i),!/^\d{4}$/.test(i))return;const x=Number(i);x>=1900&&x<=l.getUTCFullYear()&&F(j=>te(j,x))},S=(i,C,F,x)=>{const j=R(i,C);F(j),x(String(j.getUTCFullYear()))},_=i=>{!o||r?(u(i),h(void 0)):i{a({}),d(!1)};return n.jsxs("div",{className:`paper-date-filter${c?" paper-date-filter-single-calendar":""}`,role:"group","aria-label":"Publication date",children:[n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${w(f,N)?" active":""}`,onClick:()=>a(N),children:"Last Week"}),n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${w(f,Y)?" active":""}`,onClick:()=>a(Y),children:"Last Month"}),n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${!e&&!t?" active":""}`,onClick:()=>a({}),children:"All Time"}),n.jsxs(q,{open:g,onOpenChange:i=>{i?Z():d(!1)},children:[n.jsx(G,{asChild:!0,children:n.jsx("button",{type:"button",className:`sort-btn sort-btn-time${v?" active":""}`,"aria-label":v?"Change date range":"Select a range",children:v&&e&&t?ae(e,t):"Select a range"})}),n.jsxs(Q,{align:"end",className:`paper-date-popover${c?" paper-date-popover-single-calendar":""}`,role:"dialog","aria-label":"Select a date range",children:[n.jsxs("div",{className:"paper-date-popover-header",children:[n.jsx("h2",{children:"Select a date range"}),n.jsx("p",{children:"Choose an inclusive start and end publication date."})]}),n.jsxs("div",{className:"paper-date-navigation",children:[n.jsx(I,{calendar:"start",onPrevious:()=>S(T,-1,m,y),onNext:()=>S(T,1,m,y)}),!c&&n.jsx(I,{calendar:"end",onPrevious:()=>S($,-1,D,U),onNext:()=>S($,1,D,U),secondary:!0})]}),n.jsxs("div",{className:"paper-date-calendars",children:[n.jsx(A,{month:T,today:P,startDate:o,endDate:r,onSelect:_,yearLabel:c?"Year":"Start year",yearValue:H,onYearChange:i=>k(i,y,m)}),!c&&n.jsx(A,{month:$,today:P,startDate:o,endDate:r,onSelect:_,yearLabel:"End year",yearValue:B,onYearChange:i=>k(i,U,D),secondary:!0})]}),n.jsxs("div",{className:"paper-date-actions",children:[n.jsx("button",{type:"button",className:"paper-date-clear",onClick:W,children:"Clear range"}),n.jsxs("div",{children:[n.jsx("button",{type:"button",onClick:()=>d(!1),children:"Cancel"}),n.jsx("button",{type:"button",className:"paper-date-apply",disabled:!o||!r,onClick:()=>{o&&r&&a({startDate:o,endDate:r}),d(!1)},children:"Apply"})]})]})]})]})]})};export{ce as P,z as a,J as b,oe as r,ie as w}; diff --git a/assets/PaperDetailView-B-27QVn7.js b/assets/PaperDetailView-B-27QVn7.js new file mode 100644 index 0000000000000000000000000000000000000000..d61773c780d6cf3d07e85fcd17158ef580d1246d --- /dev/null +++ b/assets/PaperDetailView-B-27QVn7.js @@ -0,0 +1,29 @@ +import{n as Nt,o as Xs,c as ns,p as se,q as Qs,r as m,j as e,C as he,f as ce,s as fe,P as is,t as Ne,v as os,w as Le,x as Ae,y as ls,z as Ct,B as Oe,X as St,D as Vs,L as me,E as Ws,F as Ys,R as Js,I as Zs,G as cs,J as ea,h as ta,T as sa,A as xt,g as aa,a as Ge,K as Ke,M as bt,i as ds,u as ra,N as zt,O as na,m as Ht,Q as ia,S as oa,U as la,V as ca,W as da,Y as ua}from"./index-D6jcIRWs.js";import{I as V,T as ma,M as ha,S as pa,a as fa}from"./components-DO1X940E.js";import{L as qe,a as jt}from"./LatexTitle-D_92Jowu.js";import{e as Xe,C as ga,E as xa}from"./ExternalSourceEvalBadge-DfhTt9yv.js";import{p as _e,a as Y}from"./papers-DIIIPDpj.js";import{s as ba,a as ja}from"./colors-CLwl8a2d.js";import{r as us,p as va}from"./paperReader-BIpQD5HO.js";import{u as te}from"./useQuery-CUJUm4FY.js";import{b as ya}from"./usePapers-BbCSwcVk.js";import{f as _a,D as wa}from"./latexPlainText-DI8YEXVe.js";import{s as we}from"./safeExternalHref-CkBrsh84.js";import{S as Ie}from"./skeleton-BqkYFmXl.js";import{A as ka,a as Na}from"./alert-2MbxVzGL.js";import{B as L}from"./button-Bzx0ccHH.js";import{D as ae,a as re,c as ne,b as ie,d as oe,e as de}from"./dialog-vGFIbcd-.js";import{A as Ca,a as Sa}from"./AgentLogos-CFt_vIO2.js";import{C as Ea}from"./copy-BmzqMihw.js";import{I as W}from"./input-CCN-4hy4.js";import{S as qt}from"./searchable-select-B7z6Fcrr.js";import{u as ee}from"./useMutation-p6mN4h17.js";import{c as ke}from"./catalog-PYrB8_bm.js";import{s as pe,p as Pa}from"./submissions-DNa3tQdo.js";import{i as ms,a as hs,r as ve}from"./queryInvalidation-BxCpTdQe.js";import{r as Mt,e as Ot}from"./evaluationQueryInvalidation-D5wBpmlA.js";import{S as Et,L as ue,a as $a}from"./SignInToEditDialog-RzK54RAM.js";import{L as le}from"./loader-circle-BuDrH29B.js";import{T as Te,n as et,g as Kt,C as Ra}from"./CatalogEntityPreviewLink-BhTSUN-X.js";import{D as Ia}from"./database-DKdKRr_t.js";import{P as Ue}from"./plus-C4UQ62Q1.js";import{u as ps}from"./index-DIg7XGE2.js";import{S as Fe}from"./search-CfTufeR7.js";import{B as fs}from"./badge-t4oak8yc.js";import{G as Gt}from"./globe-iw_Y78tU.js";import{G as Xt}from"./github-B7D_19Qm.js";import{c as tt,A as Aa}from"./codex-P8vYbo4B.js";import{M as Fa}from"./index-uFGyKu5N.js";import{r as La}from"./index-yduEvk9Z.js";import{u as Ta}from"./useIntersectionObserver-3LTuEaFW.js";import{S as Qt,s as Ua}from"./savedPapersAuth-aA59XSW3.js";import{o as Da}from"./organizationNames-BVKzYEBp.js";import{A as Ba}from"./AuthorAvatar-UMHOVOr9.js";import"./hover-card-DPpv0l_x.js";import"./useInfiniteQuery-FXco4P1n.js";import"./popover-DCjqGpW0.js";import"./textarea-sXKODM3W.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 za=Nt("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ha=Nt("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** + * @license lucide-react v0.462.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gs=Nt("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);function qa(t){return t!=null&&t.can_directly_edit_catalog?"direct":"pending"}function Ma(t){return(t??[]).filter(s=>!!(s.dataset_slug&&s.task_slug))}function Oa(t,s,a="https://paperswithcode.co"){return s.map(r=>{const n=encodeURIComponent(r.evaluation_id),l=`${a}/api/v1/papers/${encodeURIComponent(t)}/leaderboard-badge.svg?eval=${n}&live=1`,o=`${a}/api/v1/papers/${encodeURIComponent(t)}/leaderboard-badge-link?eval=${n}`;return`[![${`Papers with Code: ${r.best_rank===1?"SOTA":`#${r.best_rank}`} on ${r.dataset_name}`}](${l})](${o})`}).join(` +`)}function Ka(t,s=!0){return te({queryKey:["evaluations","paper",t],queryFn:()=>{if(!t)throw new Error("Paper ID is required");return Xe.byPaper(t)},enabled:s&&!!t,staleTime:0,refetchOnMount:"always"})}const xs=t=>t.replace(/v\d+$/,""),Ga={models:"https://huggingface.co/",datasets:"https://huggingface.co/datasets/",spaces:"https://huggingface.co/spaces/"},st=(t,s)=>{const a=(t[s]||[]).length;return a<100?{count:a,isLimited:!1}:{count:a,isLimited:!0}},at=(t,s)=>{const a=t[s];return Array.isArray(a)?a.map(r=>{if(typeof r=="string")return r;if(r&&typeof r=="object"){const n=r;return n.id||n.repoId||null}return null}).filter(r=>!!r).map(r=>`${Ga[s]}${r}`):[]},Xa=async t=>{try{return(await fetch(`https://huggingface.co/api/papers/${xs(t)}`)).ok}catch{return!1}},Qa=async t=>{const s=xs(t),[a,r]=await Promise.all([fetch(`https://huggingface.co/api/arxiv/${s}/repos`).then(async i=>i.ok?i.json():(console.warn(`Failed to fetch repos for arXiv:${s}, status: ${i.status}`),null)).catch(i=>(console.warn(`Failed to fetch repos for arXiv:${s}:`,i),null)),Xa(s)]);if(!a)return{models:0,datasets:0,spaces:0,modelUrls:[],datasetUrls:[],spaceUrls:[],isLimited:!1,paperExists:r};const n=st(a,"models"),l=st(a,"datasets"),o=st(a,"spaces");return{models:n.count,datasets:l.count,spaces:o.count,modelUrls:at(a,"models"),datasetUrls:at(a,"datasets"),spaceUrls:at(a,"spaces"),isLimited:n.isLimited||l.isLimited||o.isLimited,paperExists:r}},Va=t=>te({queryKey:["huggingface-repos",t],queryFn:()=>Qa(t),enabled:!!t,staleTime:10*60*1e3,retry:1});function Wa(t,s){try{const a=new URL(t),r=a.pathname.split("/").filter(Boolean);return(r[0]==="datasets"||r[0]==="spaces")&&r.shift(),r.slice(0,2).join("/")||a.hostname.replace(/^www\./,"")}catch{return s}}function rt(t,s,a){return[...new Set([...t,...s??[]])].map(r=>({href:r,label:Wa(r,a)}))}function nt(t,s,a){if(a==null&&t.length===0&&!(s!=null&&s.length))return;const r=new Set([...t,...s??[]]);return Math.max(r.size,a??0)}function it(t,s){if(!(t==null&&s==null))return Math.max(t??0,s??0)}function ot(t){return t[0]??"https://huggingface.co"}function lt(t,s){return s[0]??t}function Ya(t){const s=`${t.title.slice(0,60)}${t.title.length>60?"…":""}`,a=`${t.authors[0]||""}${t.authors.length>1?" et al.":""}`,r=t.authors.join(" and "),n=(t.published||"").slice(0,4)||"—",l=(o,i)=>t.arxiv_id?`@article{${t.arxiv_id.replace(".","")}, + title={{${o}}}, + author=${i}, + year={{${n}}}, + eprint={{${t.arxiv_id}}}, + archivePrefix={{arXiv}} +}`:`@misc{paper${t.id}, + title={{${o}}}, + author=${i}, + year={{${n}}}, + url={{${t.source_url||t.url_abs||""}}} +}`;return{citationDisplay:l(s,`{{${a}}}`),citationCopy:l(t.title,`{${r}}`)}}function Ja(t,s,a){var S,b,k,$;const r={models:t.hf_models??[],datasets:t.hf_datasets??[],spaces:t.hf_spaces??[]},n=t.linked_hf_artifacts,l=t.hf_artifact_summary,o={models:[...(s==null?void 0:s.modelUrls)??[],...(n==null?void 0:n.models)??[]],datasets:[...(s==null?void 0:s.datasetUrls)??[],...(n==null?void 0:n.datasets)??[]],spaces:[...(s==null?void 0:s.spaceUrls)??[],...(n==null?void 0:n.spaces)??[]]},i={models:it(s==null?void 0:s.models,l==null?void 0:l.model_count),datasets:it(s==null?void 0:s.datasets,l==null?void 0:l.dataset_count),spaces:it(s==null?void 0:s.spaces,l==null?void 0:l.space_count)},u={models:rt(r.models,o.models,"Model"),datasets:rt(r.datasets,o.datasets,"Dataset"),spaces:rt(r.spaces,o.spaces,"Space")},g={models:u.models.map(({href:E})=>E),datasets:u.datasets.map(({href:E})=>E),spaces:u.spaces.map(({href:E})=>E)},f=((S=t.arxiv_id)==null?void 0:S.replace(/v\d+$/,""))??null,c=t.arxiv_id?{isLoading:a,paperHref:`https://huggingface.co/papers/${f}`,rows:[{label:"Models",href:lt(`https://huggingface.co/models?other=arxiv:${t.arxiv_id}`,r.models),count:nt(r.models,o.models,i.models),isLimited:s==null?void 0:s.isLimited,links:u.models},{label:"Datasets",href:lt(`https://huggingface.co/datasets?other=arxiv:${t.arxiv_id}`,r.datasets),count:nt(r.datasets,o.datasets,i.datasets),isLimited:s==null?void 0:s.isLimited,links:u.datasets},{label:"Spaces",href:lt(`https://huggingface.co/papers/${f}`,r.spaces),count:nt(r.spaces,o.spaces,i.spaces),isLimited:s==null?void 0:s.isLimited,links:u.spaces}],footer:`Cite arxiv.org/abs/${f} in a HF README to link it here.`}:{isLoading:!1,paperHref:null,rows:[{label:"Models",href:ot(r.models),count:r.models.length,links:u.models},{label:"Datasets",href:ot(r.datasets),count:r.datasets.length,links:u.datasets},{label:"Spaces",href:ot(r.spaces),count:r.spaces.length,links:u.spaces}],footer:null},x=(t.methods??[]).filter(({source_paper_id:E})=>E===t.id),_=t.introduced_benchmarks??[],j=t.introduced_frameworks??[],C=[x.length&&(x.length===1?"this method":"these methods"),_.length&&(_.length===1?"this benchmark":"these benchmarks"),j.length&&(j.length===1?"this framework":"these frameworks")].filter(E=>!!E);return{...Ya(t),allHfArtifactUrls:g,authorEntries:t.authors.map((E,v)=>{var d,h,w,A,z,M;return{name:E,id:((h=(d=t.author_links)==null?void 0:d[v])==null?void 0:h.id)??null,hf_username:((A=(w=t.author_links)==null?void 0:w[v])==null?void 0:A.hf_username)??null,hf_avatar_url:((M=(z=t.author_links)==null?void 0:z[v])==null?void 0:M.hf_avatar_url)??null}}),copyableRanks:Ma(t.leaderboard_ranks),hasIntroducedItems:C.length>0,hasLineageItems:!!((b=t.predecessor_papers)!=null&&b.length||(k=t.successor_papers)!=null&&k.length),hfArtifactViewer:c,hfPaperExists:!!(s!=null&&s.paperExists),introducedBenchmarks:_,introducedFrameworks:j,introducedMethods:x,introducedSummary:C.join(" and "),numPages:t.num_pages||null,paperSourceLabel:t.arxiv_id?`arXiv:${t.arxiv_id}`:"External resource",predecessorPapers:t.predecessor_papers??[],projectPages:(($=t.project_pages)==null?void 0:$.filter(({url:E})=>E).map(E=>({...E,safeHref:we(E.url)})))??[],repoSummary:ba(t.repositories),safeAbstractUrl:we(t.url_abs),safeConferenceUrl:we(t.conference_url_abs),safePdfUrl:we(t.url_pdf),successorPapers:t.successor_papers??[]}}const Za=["tldr","abstract","tasks","methods","results"];function er(t){if(!t)return{section:null,resultsTaskSlug:null};const[s,a]=t.split("?",2);if(!Za.includes(s))return{section:null,resultsTaskSlug:null};const r=s;return r!=="results"||!a?{section:r,resultsTaskSlug:null}:{section:r,resultsTaskSlug:new URLSearchParams(a).get("task")}}const bs=t=>`results-task-${t}`,tr=t=>`#results?task=${encodeURIComponent(t)}`;function sr(t,s){return t&&!!s}function ar({direct:t,paperId:s,refetchEvaluations:a,refetchPaper:r}){r(),a(),!(!t||!s)&&(Y.primeCurationState(s,!0).catch(()=>{}),Xe.primeCurationState(s,!0).catch(()=>{}))}function rr(t,s){const a=t?Xs(t):"",r=ns(),{toast:n}=se(),{preferences:l}=Qs(),o=ya(a,!!a),i=o.data,[u,g]=m.useState(!1);m.useEffect(()=>{!t||t===a||r(`/paper/${a}${window.location.search}${window.location.hash}`,{replace:!0})},[a,r,t]),m.useEffect(()=>{if(i!=null&&i.title)return document.title=i.page_title||_a(i.title),()=>{document.title=wa}},[i==null?void 0:i.page_title,i==null?void 0:i.title]),m.useEffect(()=>{if(g(!1),!(i!=null&&i.id))return;const E=window.setTimeout(()=>g(!0),0);return()=>window.clearTimeout(E)},[i==null?void 0:i.id]);const f=sr(u,i==null?void 0:i.id),c=Va(u?i==null?void 0:i.arxiv_id:void 0),x=Ka(i==null?void 0:i.id,f),_=te({queryKey:[..._e.feeds.versions,i==null?void 0:i.arxiv_id],queryFn:()=>Y.versions(i.arxiv_id.replace(/v\d+$/,"")),enabled:f&&!!(i!=null&&i.arxiv_id),staleTime:10*60*1e3}),j=te({queryKey:[..._e.feeds.related,i==null?void 0:i.id],queryFn:()=>Y.related(i.arxiv_id||i.id,4),enabled:f,staleTime:10*60*1e3});m.useEffect(()=>{const E=()=>{ar({direct:s==="direct",paperId:i==null?void 0:i.id,refetchEvaluations:x.refetch,refetchPaper:o.refetch}),n({title:"This section changed",description:"The latest state has been reloaded. Review your changes before submitting again.",variant:"destructive"})};return window.addEventListener("pwc:catalog-conflict",E),()=>window.removeEventListener("pwc:catalog-conflict",E)},[s,x.refetch,i==null?void 0:i.id,o.refetch,n]);const C=m.useMemo(()=>{const E=x.data;return!E||!l.hide_closed_source_evals?E:E.filter(v=>v.is_open!==!1)},[x.data,l.hide_closed_source_evals]),S=m.useMemo(()=>{if(!C)return[];const E=new Map;for(const v of C){const d=E.get(v.task_id);d?d.rows.push(v):E.set(v.task_id,{taskId:v.task_id,taskName:v.task_name||"—",taskSlug:v.task_slug,rows:[v]})}return[...E.values()]},[C]),b=m.useMemo(()=>S.map(({taskSlug:E})=>E??"").join("|"),[S]),k=m.useMemo(()=>i?Ja(i,c.data,c.isLoading):null,[c.data,c.isLoading,i]),$=m.useRef(!1);return m.useEffect(()=>{$.current=!1},[a]),m.useEffect(()=>{let E=0;const v=(h=!1,w=!1)=>{const{section:A,resultsTaskSlug:z}=er(window.location.hash.slice(1));if(!A||!i||A==="tldr"&&!i.tldr||A==="results"&&(!f||x.isLoading)||!h&&$.current)return;let M=A==="results"&&z?document.getElementById(bs(z)):document.getElementById(A);if(!M&&A==="results"&&z){if(S.some(({taskSlug:K})=>K===z))return;M=document.getElementById("results")}M&&(E=window.requestAnimationFrame(()=>{$.current=!0,M.scrollIntoView({block:"start",behavior:w?"smooth":"auto"})}))};v();const d=()=>{$.current=!1,v(!0,!0)};return window.addEventListener("hashchange",d),()=>{window.removeEventListener("hashchange",d),E&&window.cancelAnimationFrame(E)}},[S,x.isLoading,i,b,f]),{arxivId:a,evaluations:x.data,evaluationsByTask:S,evaluationsLoading:x.isLoading,hfLoading:c.isLoading,hfRepos:c.data,paper:i,paperError:o.error,paperLoading:o.isLoading,presentation:k,refetchEvaluations:x.refetch,refetchPaper:o.refetch,relatedQuery:j,versions:_.data??[],visibleEvaluations:C}}const nr={tasks:"tasks",methods:"methods",evaluations:"results",repositories:"repositories",project_pages:"project-pages",hf_artifacts:"hf-artifacts",organizations:"organizations",source_url:"source-url",x_threads:"x-threads"};function ir(t){return nr[t]??null}function or(){const[t,s]=m.useState(null),a=m.useCallback(n=>{s(n)},[]),r=m.useCallback((n,l)=>{s(o=>l?n:o===n?null:o)},[]);return{activeEditor:t,openEditor:a,setEditorOpen:r}}function lr({paperId:t}){const[s,a]=m.useState(!1),[r,n]=m.useState(!1),[l,o]=m.useState(!1),i=`Help me edit https://paperswithcode.co/paper/${t} using the public pwc CLI from https://github.com/huggingface/pwc-cli. Install or update the CLI following its README, then run pwc skills add to load its instructions. Run pwc auth login --paper ${t}; I will authorize this paper in my browser. Export with pwc paper edit export ${t} --output edits.json, make explicit operations for the corrections I request, and preview before submitting. For organization changes, use an organizations operation with payload {"organization_ids": [existing organization IDs]}; this replaces the paper’s organization links and publishes directly. Use existing organizations, benchmark and metric definitions, preserve unrelated entries, and cite source URLs where available. Never print or copy credentials. Ask me what to change if I have not specified it.`;return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"action-btn",title:"Edit this paper page with Claude, Codex, Cursor, or OpenCode",onClick:()=>{a(!1),n(!1),o(!0)},children:["Edit with your agent",e.jsx(Ca,{})]}),e.jsx(ae,{open:l,onOpenChange:o,children:e.jsxs(re,{className:"max-w-2xl",children:[e.jsxs(ne,{children:[e.jsx(ie,{children:"Edit this paper with your agent"}),e.jsx(oe,{children:"Spotted a missing code link, a wrong task, or a missing benchmark result? Your favorite coding agent can fix it for you."})]}),e.jsx(Sa,{}),e.jsxs("ol",{className:"list-decimal space-y-1 pl-5 text-sm text-muted-foreground",children:[e.jsx("li",{children:"Copy the prompt below."}),e.jsx("li",{children:"Paste it into Claude Code, Codex, Cursor, OpenCode, or another coding agent, and tell it what to change."}),e.jsxs("li",{children:["The agent installs the ",e.jsx("a",{className:"underline",href:"https://github.com/huggingface/pwc-cli",target:"_blank",rel:"noreferrer",children:"pwc CLI"}),", asks you to authorize this paper with your Hugging Face account, and previews the edits before submitting them."]})]}),e.jsx("textarea",{"aria-label":"Paper edit prompt",readOnly:!0,value:i,className:"h-48 w-full resize-none rounded border bg-muted/40 p-3 font-mono text-xs",onFocus:u=>u.currentTarget.select()}),r&&e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:"Could not copy automatically. Select the prompt above and copy it manually."}),e.jsxs(L,{className:"justify-self-end",onClick:async()=>{try{await navigator.clipboard.writeText(i),a(!0),n(!1)}catch{n(!0)}},children:[s?e.jsx(he,{size:14}):e.jsx(Ea,{size:14}),s?"Prompt copied":"Copy prompt"]})]})})]})}function ge(t,{toast:s,queryClient:a,paperIds:r,queuedDescription:n}){if(t.status==="approved"){ms(a,r),hs(a),s({title:"Edit applied",description:"Your change is now live on this paper."});return}s({title:"Edit submitted for review",description:n})}function cr(t){return t.map(s=>{const a=s.best_metric||Object.keys(s.metrics)[0]||"";return{id:s.id,task_id:s.task_id,dataset_id:s.dataset_id,model_name:s.model_name||"",harness:s.harness||"",metric_name:a,metric_value:String(s.metrics[a]??""),original_metrics:{...s.metrics},original_metric_name:a,best_rank:s.best_rank!=null?String(s.best_rank):"",num_parameters:s.num_parameters!=null?String(s.num_parameters):"",hf_model_url:s.hf_model_url||"",is_open:s.is_open!==!1,operation:"unchanged"}})}function dr(t,s){const a={...t.original_metrics},r=a[t.original_metric_name];return t.original_metric_name!==s&&delete a[t.original_metric_name],a[s]=r!=null&&t.metric_value===String(r)?r:t.metric_value,a}function ur(t){const s=t==null?void 0:t.trim();return s?Number(s):void 0}function Vt(t){const s=t.trim();return s?Number(s):null}function ct(t){return t.trim()||null}function dt(t){return!!(t&&/^\d+$/.test(t.trim())&&Number.isSafeInteger(Number(t))&&Number(t)>0)}function js(t){const s=[];return t.forEach((a,r)=>{var o;if(!a.operation||a.operation==="unchanged")return;const n=(i,u)=>{s.push({rowIndex:r,field:i,message:u})};if(a.operation!=="create"&&!dt(a.id)&&n("id","This result has no valid evaluation ID. Reload the paper before editing it."),a.operation==="delete")return;dt(a.task_id)||n("task_id","Select a valid task."),dt(a.dataset_id)||n("dataset_id","Select a valid dataset.");const l=a.metric_name.trim();l?l!==a.original_metric_name&&Object.prototype.hasOwnProperty.call(a.original_metrics,l)&&n("metric_name",`Cannot rename a metric to "${l}": this evaluation already has that score.`):n("metric_name","Select a metric."),(o=a.best_rank)!=null&&o.trim()&&!Number.isSafeInteger(Number(a.best_rank))&&n("best_rank","Enter a whole-number rank."),a.num_parameters.trim()&&(!Number.isSafeInteger(Number(a.num_parameters))||Number(a.num_parameters)<0)&&n("num_parameters","Enter a non-negative whole-number parameter count."),a.metric_value.trim()||n("metric_value","Enter a metric value.")}),s}function mr(t,s){const a=js(t);return a.length?{valid:!1,errors:a}:{valid:!0,operations:hr(t,s)}}function hr(t,s){const a=[];for(const r of t){if(r.operation==="delete"){a.push({kind:"delete",evaluationId:Number(r.id)});continue}if(r.operation!=="create"&&r.operation!=="update")continue;const n=r.metric_name.trim(),l=s(r.task_id,r.dataset_id),o={task_id:Number(r.task_id),dataset_id:Number(r.dataset_id),metrics:dr(r,n),best_metric:n,is_open:r.is_open},i=r.model_name.trim(),u=ur(r.best_rank);if(r.operation==="create"){const g=Vt(r.num_parameters),f=ct(r.hf_model_url);a.push({kind:"create",data:{...o,...i?{model_name:i}:{},...l&&r.harness.trim()?{harness:r.harness.trim()}:{},...u!==void 0?{best_rank:u}:{},...g!==null?{num_parameters:g}:{},...f!==null?{hf_model_url:f}:{}}});continue}a.push({kind:"update",evaluationId:Number(r.id),data:{...o,...i?{model_name:i}:{},harness:l?ct(r.harness):null,...u!==void 0?{best_rank:u}:{},num_parameters:Vt(r.num_parameters),hf_model_url:ct(r.hf_model_url)}})}return a}function pr(t,s){return s.map(a=>a.kind==="delete"?{operation:"delete",evaluation_id:a.evaluationId}:{operation:a.kind,...a.kind==="update"?{evaluation_id:a.evaluationId}:{},payload:a.kind==="create"?{paper_id:t,...a.data}:a.data})}function fr(t){return t.map(s=>s.kind==="delete"?{op:"delete",evaluation_id:s.evaluationId}:s.kind==="update"?{op:"update",evaluation_id:s.evaluationId,data:s.data}:{op:"create",data:s.data})}function xe(t){const s=typeof window<"u"&&window.location.hostname==="staging.paperswithcode.co";return e.jsxs("div",{className:"rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-100",children:[e.jsx("p",{className:"font-medium",children:s?"Test-only: this change stays on staging.":"Your changes go live right away."}),e.jsx("p",{className:"mt-1 leading-snug",children:s?"This exercises staging-local pending behavior and is not queued for production review.":"Edits are applied immediately and reviewed afterwards. A few, such as links to unfamiliar sites, are held for an admin first."})]})}const ut=100;function gr(t){return(t??[]).some(s=>s.slug==="coding-agents"||s.name.trim().toLowerCase()==="coding agents")}function xr(t){const s=new Map;return t.forEach(a=>{a.task_id&&a.task_name&&s.set(a.task_id,{id:a.task_id,name:a.task_name,slug:a.task_slug,level:0})}),s}function br(t){const s=new Map;return t.forEach(a=>{a.dataset_id&&a.dataset_name&&s.set(a.dataset_id,{id:a.dataset_id,name:a.dataset_name,slug:a.dataset_slug})}),s}function Wt(t,s){return`${t}:${s}`}function jr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialEvaluations:n,paperTasks:l,onSuccess:o,submitMode:i="direct",isAdmin:u=!1,isAuthor:g=!1}){const f=m.useId(),c=gr(l),[x,_]=m.useState([]),[j,C]=m.useState(!1),S=j?js(x):[],[b,k]=m.useState(null),[$,E]=m.useState(new Map),[v,d]=m.useState(new Map),h=ce(),{toast:w}=se(),A=m.useRef(!1),z=m.useRef(!1);m.useEffect(()=>{if(!t){C(!1),A.current=!1,z.current=!1;return}A.current||z.current||n.length!==0&&(A.current=!0,_(cr(n)),E(xr(n)),d(br(n)))},[t,n]);const M=m.useMemo(()=>Array.from(new Set(x.map(y=>y.task_id).filter(y=>y&&y!==""))),[x]),K=m.useMemo(()=>{const y=new Set;return x.forEach(N=>{N.task_id&&N.dataset_id&&y.add(Wt(N.task_id,N.dataset_id))}),Array.from(y)},[x]),G=te({queryKey:["datasets-by-tasks-for-eval-edit",M,t],queryFn:async()=>{const y={};return await Promise.all(M.map(async N=>{try{const F=await ke.listDatasets({task_id:parseInt(N),page_size:ut});y[N]=F.results}catch(F){console.error(`Error fetching datasets for task ${N}:`,F),y[N]=[]}})),y},enabled:t&&M.length>0});m.useEffect(()=>{G.data&&d(y=>{const N=new Map(y);return Object.values(G.data).forEach(F=>{F.forEach(T=>{N.set(T.id,T)})}),N})},[G.data]);const p=te({queryKey:["leaderboard-metrics-for-eval-edit",K,t],queryFn:async()=>{const y={};return await Promise.all(K.map(async N=>{const[F,T]=N.split(":");try{y[N]=await ke.leaderboardMetrics(T,F)}catch(Q){console.error(`Error fetching metrics for leaderboard ${N}:`,Q),y[N]=[]}})),y},enabled:t&&K.length>0}),R=async y=>{const N=await ke.listTasks({page_size:ut,...y?{q:y}:{}});return E(F=>{const T=new Map(F);return N.results.forEach(Q=>T.set(Q.id,Q)),T}),N.results.map(F=>{var T;return{value:F.id,label:F.name,description:(T=F.description)==null?void 0:T.slice(0,100)}})},I=y=>async N=>{const F=await ke.listDatasets({task_id:parseInt(y),page_size:ut,...N?{q:N}:{}});return d(T=>{const Q=new Map(T);return F.results.forEach(X=>Q.set(X.id,X)),Q}),F.results.map(T=>({value:T.id,label:T.name,description:T.full_name}))},U=(y,N)=>{if(!y||!N)return!1;const F=v.get(N);return!!(F!=null&&F.supports_harness)},D=(y,N,F)=>{var X;if(!y||!N)return[];const Q=(((X=p.data)==null?void 0:X[Wt(y,N)])||[]).map(B=>({value:B.metric_name,label:B.metric_name,description:B.metric_direction==="higher_is_better"?"Higher is better":"Lower is better"}));return F&&!Q.some(B=>B.value===F)&&Q.unshift({value:F,label:`${F} (legacy)`}),Q},H=ee({mutationFn:async({paperId:y,canonical:N})=>{if(!u&&i==="direct"&&N.length>50)throw new Error("Contributor evaluation batches are limited to 50 operations; contact an admin.");const F=Number.parseInt(y,10);if(i==="pending"){const T=await pe.submit({paper_id:F,edit_type:"evaluations",proposed_payload:{operations:fr(N)}});T.status==="approved"&&Mt(h,Ot(y,n,N,r)),ge(T,{toast:w,queryClient:h,paperIds:[y,r],queuedDescription:"Thanks! An admin will review your proposed evaluation changes shortly."})}else{const T=Ot(y,n,N,r);await Xe.batch(F,pr(F,N)),Mt(h,T)}},onSuccess:()=>{o==null||o(),s(!1)},onError:y=>{const N=fe(y,i==="pending"?"Failed to submit your edit. Please try again.":"Failed to update evaluations.");w({title:i==="pending"?"Could not submit edit":"Could not save evaluations",description:N,variant:"destructive"})}}),q=()=>{z.current=!0,_([...x,{task_id:"",dataset_id:"",model_name:"",harness:"",metric_name:"",metric_value:"",original_metrics:{},original_metric_name:"",best_rank:"",num_parameters:"",hf_model_url:"",is_open:!0,operation:"create"}])},J=y=>{if(z.current=!0,x[y].id){if(!window.confirm("Delete this evaluation? You will be asked to sign in again if your session is older than 15 minutes."))return;_(x.map((F,T)=>T===y?{...F,operation:"delete"}:F))}else _(x.filter((F,T)=>T!==y))},Z=(y,N,F)=>{z.current=!0,_(x.map((T,Q)=>{if(Q!==y||T[N]===F)return T;const X={...T,[N]:F};return(N==="task_id"||N==="dataset_id")&&(X.original_metrics={},X.original_metric_name="",X.metric_value="",X.best_rank=""),N==="task_id"&&(X.dataset_id="",X.metric_name="",X.harness=""),N==="dataset_id"&&(X.metric_name="",F&&!U(X.task_id,F)&&(X.harness="")),T.operation==="unchanged"&&(X.operation="update"),X}))},Ye=(y,N)=>{z.current=!0,_(x.map((F,T)=>{if(T!==y)return F;const Q={...F,is_open:N};return F.operation==="unchanged"&&(Q.operation="update"),Q}))},De=()=>{C(!0);const y=mr(x,U);if(y.valid){if(y.operations.length===0){w({title:"No changes to submit",description:"Your evaluation list matches the existing data."});return}H.mutate({paperId:a,canonical:y.operations})}},ye=(y,N)=>{const F=S.find(T=>T.rowIndex===y&&T.field===N);return F?e.jsx("p",{id:`${f}-${y}-${N}-error`,className:"text-xs text-destructive",children:F.message}):null};return e.jsxs(ae,{open:t,onOpenChange:s,children:[e.jsxs(re,{className:"max-w-6xl max-h-[800px]",children:[e.jsxs(ne,{children:[e.jsx(ie,{children:"Edit Evaluation Results"}),e.jsx(oe,{children:"Add, edit, or remove evaluation results for this paper. Each row represents a benchmark result."})]}),i==="pending"&&e.jsx(xe,{isAuthor:g}),S.length>0&&e.jsxs("div",{role:"alert",className:"text-sm text-destructive",children:["Fix the following errors before saving. No changes have been submitted.",e.jsx("ul",{children:S.map(y=>e.jsxs("li",{children:["Row ",x.slice(0,y.rowIndex+1).filter(N=>N.operation!=="delete").length,": ",y.message]},`${y.rowIndex}-${y.field}`))})]}),e.jsxs("div",{className:"py-4 overflow-y-auto max-h-[600px]",children:[x.filter(y=>y.operation!=="delete").length>0?e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[180px]",children:"Task"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[180px]",children:"Dataset"}),e.jsx("th",{className:`text-left py-2 px-2 font-medium text-sm ${c?"min-w-[140px]":"min-w-[240px]"}`,children:"Model"}),c&&e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[140px]",children:"Harness"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[140px]",children:"Metric"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Value"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Parameters"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[200px]",children:"HF model URL"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-20",children:"Open source"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-16",children:"Action"})]})}),e.jsx("tbody",{children:x.map((y,N)=>{if(y.operation==="delete")return null;const F=$.get(y.task_id),T=v.get(y.dataset_id),Q=D(y.task_id,y.dataset_id,y.metric_name),X=!!(y.task_id&&y.dataset_id)&&p.isFetching;return e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("td",{className:"py-2 px-2",children:e.jsxs("div",{role:"group","aria-label":"Task","aria-describedby":`${f}-${N}-task_id-error`,children:[e.jsx(qt,{value:y.task_id,onChange:B=>Z(N,"task_id",B),placeholder:"Select task",searchPlaceholder:"Search tasks...",emptyMessage:"No tasks found.",selectedOption:F?{value:F.id,label:F.name}:null,queryKey:["eval-edit-task-search"],queryFn:R,enabled:t}),ye(N,"task_id")]})}),e.jsx("td",{className:"py-2 px-2",children:e.jsxs("div",{role:"group","aria-label":"Dataset","aria-describedby":`${f}-${N}-dataset_id-error`,children:[e.jsx(qt,{value:y.dataset_id,onChange:B=>Z(N,"dataset_id",B),placeholder:y.task_id?"Select dataset":"Select task first",searchPlaceholder:"Search datasets...",emptyMessage:y.task_id?"No datasets found for this task.":"Select a task first.",disabled:!y.task_id,selectedOption:T?{value:T.id,label:T.name}:null,queryKey:["eval-edit-dataset-search",y.task_id],queryFn:I(y.task_id),enabled:t&&!!y.task_id}),ye(N,"dataset_id")]})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(W,{type:"text",className:"w-full text-sm",placeholder:"Model name",value:y.model_name,onChange:B=>Z(N,"model_name",B.target.value)})}),c&&e.jsx("td",{className:"py-2 px-2",children:U(y.task_id,y.dataset_id)?e.jsx(W,{type:"text",className:"w-full text-sm",placeholder:"Claude Code, Terminus, ...",value:y.harness,onChange:B=>Z(N,"harness",B.target.value)}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Not supported"})}),e.jsxs("td",{className:"py-2 px-2",children:[!y.task_id||!y.dataset_id?e.jsx("span",{className:"text-xs text-muted-foreground",children:"Select task + dataset"}):X?e.jsxs("span",{className:"inline-flex items-center text-xs text-muted-foreground",children:[e.jsx(le,{className:"mr-1 h-3 w-3 animate-spin"}),"Loading metrics..."]}):Q.length>0?e.jsxs("select",{className:"w-full rounded-md border border-border bg-background px-2 py-1 text-sm",id:`${f}-${N}-metric_name`,"aria-invalid":S.some(B=>B.rowIndex===N&&B.field==="metric_name"),"aria-describedby":`${f}-${N}-metric_name-error`,value:y.metric_name,onChange:B=>Z(N,"metric_name",B.target.value),children:[e.jsx("option",{value:"",children:"Select metric"}),Q.map(B=>e.jsx("option",{value:B.value,children:B.label},B.value))]}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"No configured metrics"}),ye(N,"metric_name")]}),e.jsxs("td",{className:"py-2 px-2",children:[e.jsx(W,{type:"text",className:"w-full text-sm",placeholder:"44.9",id:`${f}-${N}-metric_value`,"aria-invalid":S.some(B=>B.rowIndex===N&&B.field==="metric_value"),"aria-describedby":`${f}-${N}-metric_value-error`,value:y.metric_value,onChange:B=>Z(N,"metric_value",B.target.value)}),ye(N,"metric_value")]}),e.jsxs("td",{className:"py-2 px-2",children:[e.jsx(W,{type:"number",min:0,step:1,className:"w-full text-sm",placeholder:"e.g. 7000000000",id:`${f}-${N}-num_parameters`,"aria-invalid":S.some(B=>B.rowIndex===N&&B.field==="num_parameters"),"aria-describedby":`${f}-${N}-num_parameters-error`,value:y.num_parameters,onChange:B=>Z(N,"num_parameters",B.target.value),title:"Raw model parameter count (e.g. 7000000000 for a 7B model). Leave blank if unknown."}),ye(N,"num_parameters")]}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(W,{type:"url",className:"w-full text-sm",placeholder:"https://huggingface.co/org/model",value:y.hf_model_url,onChange:B=>Z(N,"hf_model_url",B.target.value),title:"Hugging Face model page for this row (must start with https://huggingface.co/). Leave blank if none."})}),e.jsx("td",{className:"py-2 px-2 text-center",children:e.jsx("input",{type:"checkbox",className:"h-4 w-4 align-middle",checked:y.is_open,onChange:B=>Ye(N,B.target.checked),title:"Whether the evaluated model is open-source. Uncheck for closed-source models."})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(L,{variant:"ghost",size:"sm",onClick:()=>J(N),className:"h-8 w-8 p-0 text-destructive hover:text-destructive",title:y.id&&!u?"Only administrators can delete published results":"Remove row",disabled:!!y.id&&!u,children:e.jsx(Te,{className:"w-4 h-4"})})})]},N)})})]})}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Ia,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),e.jsx("p",{children:"No evaluation results yet"}),e.jsx("p",{className:"text-sm mt-2",children:'Click "Add Row" below to add a new evaluation'})]}),e.jsx("div",{className:"mt-4",children:e.jsxs(L,{variant:"outline",size:"sm",onClick:q,className:"flex items-center space-x-2",children:[e.jsx(Ue,{className:"w-4 h-4"}),e.jsx("span",{children:"Add Row"})]})})]}),e.jsxs(de,{children:[e.jsxs("div",{className:"flex flex-wrap gap-2 sm:mr-auto",children:[e.jsx(L,{variant:"ghost",onClick:()=>k("benchmark"),children:"Suggest a new benchmark"}),e.jsx(L,{variant:"ghost",onClick:()=>k("metric"),children:"Suggest a new metric"})]}),e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:De,disabled:H.isPending,children:H.isPending?e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}),i==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(he,{className:"w-4 h-4 mr-2"}),i==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(Et,{open:b!==null,onOpenChange:y=>{y||k(null)},paperId:a,kind:b??"benchmark"})]})}const mt=[{key:"hf_models",label:"Models",placeholder:"https://huggingface.co/org/model"},{key:"hf_datasets",label:"Datasets",placeholder:"https://huggingface.co/datasets/org/data"},{key:"hf_spaces",label:"Spaces",placeholder:"https://huggingface.co/spaces/org/demo"}];function Yt(t){return t.map(s=>s.trim()).filter(Boolean)}function ht(t,s){const a=Yt(t).sort(),r=Yt(s).sort();return a.length!==r.length?!1:a.every((n,l)=>n===r[l])}function vr(t,s){return ht(t.hf_models,s.hf_models)&&ht(t.hf_datasets,s.hf_datasets)&&ht(t.hf_spaces,s.hf_spaces)}function yr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialArtifacts:n,onSuccess:l,submitMode:o="direct",isAuthor:i=!1}){const[u,g]=m.useState(n),[f,c]=m.useState({hf_models:"",hf_datasets:"",hf_spaces:""}),x=ce(),{toast:_}=se(),j=m.useRef(!1);m.useEffect(()=>{if(!t){j.current=!1;return}j.current||(j.current=!0,g(n),c({hf_models:"",hf_datasets:"",hf_spaces:""}))},[t,n]);const C=ee({mutationFn:async({paperId:v,artifacts:d})=>{if(o==="pending"){const h=await pe.submit({paper_id:parseInt(v),edit_type:"hf_artifacts",proposed_payload:d});return ge(h,{toast:_,queryClient:x,paperIds:[v,r],queuedDescription:"Thanks! An admin will review your proposed Hugging Face artifact changes shortly."}),null}return Y.updateHfArtifacts(v,d)},onSuccess:v=>{if(o==="pending"){l==null||l(),s(!1),c({hf_models:"",hf_datasets:"",hf_spaces:""});return}v&&ve(x,v,[a,r]),l==null||l(),s(!1),c({hf_models:"",hf_datasets:"",hf_spaces:""})},onError:v=>{const d=fe(v,o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update Hugging Face artifacts.");_({title:o==="pending"?"Could not submit edit":"Could not save Hugging Face artifacts",description:d,variant:"destructive"})}}),S=()=>{const v={hf_models:[...u.hf_models],hf_datasets:[...u.hf_datasets],hf_spaces:[...u.hf_spaces]};for(const{key:d}of mt){const h=f[d].trim();if(h){if(v[d].some(w=>w.trim()===h))return alert(`This ${d.replace("hf_","")} URL is already added`),null;v[d]=[...v[d],h]}}return v},b=v=>{const d=f[v].trim();if(d){if(u[v].some(h=>h.trim()===d)){alert(`This ${v.replace("hf_","")} URL is already added`);return}g(h=>({...h,[v]:[...h[v],d]})),c(h=>({...h,[v]:""}))}},k=(v,d)=>{g(h=>({...h,[v]:h[v].filter(w=>w!==d)}))},$=()=>{const v=S();if(v===null)return;const d=Object.keys(n).some(h=>n[h].some(w=>!v[h].includes(w)));o==="direct"&&d&&!window.confirm("Remove one or more Hugging Face artifact links?")||C.mutate({paperId:a,artifacts:v})},E=m.useMemo(()=>{const v={hf_models:[...u.hf_models],hf_datasets:[...u.hf_datasets],hf_spaces:[...u.hf_spaces]};for(const{key:d}of mt){const h=f[d].trim();if(h){if(v[d].some(w=>w.trim()===h))return!1;v[d]=[...v[d],h]}}return!vr(v,n)},[u,f,n]);return e.jsx(ae,{open:t,onOpenChange:s,children:e.jsxs(re,{className:"max-w-2xl max-h-[700px]",children:[e.jsxs(ne,{children:[e.jsx(ie,{children:"Edit Hugging Face Artifacts"}),e.jsx(oe,{children:"Add or remove linked Hugging Face models, datasets, and Spaces for this paper."})]}),o==="pending"&&e.jsx(xe,{isAuthor:i}),e.jsx("div",{className:"space-y-6 py-2 overflow-y-auto max-h-[460px]",children:mt.map(({key:v,label:d,placeholder:h})=>e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:d}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(W,{type:"url",placeholder:h,value:f[v],onChange:w=>c(A=>({...A,[v]:w.target.value})),onKeyPress:w=>{w.key==="Enter"&&(w.preventDefault(),b(v))},className:"flex-1"}),e.jsxs(L,{onClick:()=>b(v),size:"sm",disabled:!f[v].trim(),children:[e.jsx(Ue,{className:"w-4 h-4 mr-1"}),"Add"]})]}),u[v].length>0?e.jsx("div",{className:"space-y-2",children:u[v].map(w=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate flex-1",children:w}),e.jsx(L,{variant:"ghost",size:"sm",onClick:()=>k(v,w),className:"h-8 px-2 text-destructive hover:text-destructive",title:`Remove ${d.toLowerCase()} URL`,children:e.jsx(Te,{className:"w-4 h-4"})})]},w))}):e.jsxs("div",{className:"text-xs text-muted-foreground",children:["No ",d.toLowerCase()," linked yet."]})]},v))}),e.jsxs(de,{children:[e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:$,disabled:C.isPending||!E,children:C.isPending?e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(he,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}var Qe="Checkbox",[_r]=Ct(Qe),[wr,Pt]=_r(Qe);function kr(t){const{__scopeCheckbox:s,checked:a,children:r,defaultChecked:n,disabled:l,form:o,name:i,onCheckedChange:u,required:g,value:f="on",internal_do_not_use_render:c}=t,[x,_]=os({prop:a,defaultProp:n??!1,onChange:u,caller:Qe}),[j,C]=m.useState(null),[S,b]=m.useState(null),k=m.useRef(!1),$=j?!!o||!!j.closest("form"):!0,E={checked:x,disabled:l,setChecked:_,control:j,setControl:C,name:i,form:o,value:f,hasConsumerStoppedPropagationRef:k,required:g,defaultChecked:je(n)?!1:n,isFormControl:$,bubbleInput:S,setBubbleInput:b};return e.jsx(wr,{scope:s,...E,children:Nr(c)?c(E):r})}var vs="CheckboxTrigger",ys=m.forwardRef(({__scopeCheckbox:t,onKeyDown:s,onClick:a,...r},n)=>{const{control:l,value:o,disabled:i,checked:u,required:g,setControl:f,setChecked:c,hasConsumerStoppedPropagationRef:x,isFormControl:_,bubbleInput:j}=Pt(vs,t),C=Le(n,f),S=m.useRef(u);return m.useEffect(()=>{const b=l==null?void 0:l.form;if(b){const k=()=>c(S.current);return b.addEventListener("reset",k),()=>b.removeEventListener("reset",k)}},[l,c]),e.jsx(Ne.button,{type:"button",role:"checkbox","aria-checked":je(u)?"mixed":u,"aria-required":g,"data-state":Cs(u),"data-disabled":i?"":void 0,disabled:i,value:o,...r,ref:C,onKeyDown:Ae(s,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:Ae(a,b=>{c(k=>je(k)?!0:!k),j&&_&&(x.current=b.isPropagationStopped(),x.current||b.stopPropagation())})})});ys.displayName=vs;var $t=m.forwardRef((t,s)=>{const{__scopeCheckbox:a,name:r,checked:n,defaultChecked:l,required:o,disabled:i,value:u,onCheckedChange:g,form:f,...c}=t;return e.jsx(kr,{__scopeCheckbox:a,checked:n,defaultChecked:l,disabled:i,required:o,onCheckedChange:g,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:x})=>e.jsxs(e.Fragment,{children:[e.jsx(ys,{...c,ref:s,__scopeCheckbox:a}),x&&e.jsx(Ns,{__scopeCheckbox:a})]})})});$t.displayName=Qe;var _s="CheckboxIndicator",ws=m.forwardRef((t,s)=>{const{__scopeCheckbox:a,forceMount:r,...n}=t,l=Pt(_s,a);return e.jsx(is,{present:r||je(l.checked)||l.checked===!0,children:e.jsx(Ne.span,{"data-state":Cs(l.checked),"data-disabled":l.disabled?"":void 0,...n,ref:s,style:{pointerEvents:"none",...t.style}})})});ws.displayName=_s;var ks="CheckboxBubbleInput",Ns=m.forwardRef(({__scopeCheckbox:t,...s},a)=>{const{control:r,hasConsumerStoppedPropagationRef:n,checked:l,defaultChecked:o,required:i,disabled:u,name:g,value:f,form:c,bubbleInput:x,setBubbleInput:_}=Pt(ks,t),j=Le(a,_),C=ps(l),S=ls(r);m.useEffect(()=>{const k=x;if(!k)return;const $=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor($,"checked").set,d=!n.current;if(C!==l&&v){const h=new Event("click",{bubbles:d});k.indeterminate=je(l),v.call(k,je(l)?!1:l),k.dispatchEvent(h)}},[x,C,l,n]);const b=m.useRef(je(l)?!1:l);return e.jsx(Ne.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??b.current,required:i,disabled:u,name:g,value:f,form:c,...s,tabIndex:-1,ref:j,style:{...s.style,...S,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Ns.displayName=ks;function Nr(t){return typeof t=="function"}function je(t){return t==="indeterminate"}function Cs(t){return je(t)?"indeterminate":t?"checked":"unchecked"}const Ve=m.forwardRef(({className:t,style:s,...a},r)=>e.jsx($t,{ref:r,className:Oe("peer h-4 w-4 shrink-0 rounded-sm ring-offset-background data-[state=checked]:!bg-black data-[state=checked]:!text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),style:{border:"1px solid #000",...s},...a,children:e.jsx(ws,{className:Oe("flex items-center justify-center text-current"),children:e.jsx(he,{className:"h-4 w-4"})})}));Ve.displayName=$t.displayName;const Cr=250,Sr=100;function Er({open:t,onOpenChange:s,paperId:a,arxivId:r,initialMethodIds:n,initialMethods:l,onSuccess:o,submitMode:i="direct",isAuthor:u=!1}){const[g,f]=m.useState(n),[c,x]=m.useState(!1),[_,j]=m.useState(""),[C,S]=m.useState(""),[b,k]=m.useState(new Map),$=ce(),{toast:E}=se(),v=m.useRef(!1);m.useEffect(()=>{if(!t){v.current=!1;return}if(v.current)return;v.current=!0,f(n),j(""),S("");const p=new Map;(l||[]).forEach(R=>{const I=parseInt(R.id);Number.isNaN(I)||p.set(I,R)}),k(p)},[t,n,l]),m.useEffect(()=>{const p=window.setTimeout(()=>{S(_.trim())},Cr);return()=>window.clearTimeout(p)},[_]);const{data:d,isFetching:h}=te({queryKey:["methods-search",C],queryFn:()=>ke.listMethods({page_size:Sr,...C?{q:C}:{}}),enabled:t});m.useEffect(()=>{var p;(p=d==null?void 0:d.results)!=null&&p.length&&k(R=>{const I=new Map(R);return d.results.forEach(U=>{const D=parseInt(U.id);Number.isNaN(D)||I.set(D,U)}),I})},[d]);const w=m.useMemo(()=>{const p=(d==null?void 0:d.results)||[],R=new Set,I=[],U=(q,J)=>{!J||Number.isNaN(q)||R.has(q)||(I.push(J),R.add(q))},D=()=>g.forEach(q=>U(q,b.get(q))),H=()=>p.forEach(q=>U(parseInt(q.id),q));return C?(H(),D()):(D(),H()),I},[d,g,b,C]),A=ee({mutationFn:async({paperId:p,methodIds:R})=>{if(i==="pending"){const I=await pe.submit({paper_id:parseInt(p),edit_type:"methods",proposed_payload:{method_ids:R}});return ge(I,{toast:E,queryClient:$,paperIds:[p,r],queuedDescription:"Thanks! An admin will review your proposed method changes shortly."}),null}return Y.updateMethods(p,R)},onSuccess:p=>{if(i==="pending"){o==null||o(),s(!1);return}p&&ve($,p,[a,r]),E({title:"Methods updated",description:`Saved ${g.length} method${g.length===1?"":"s"} for this paper.`}),o==null||o(),s(!1)},onError:p=>{const R=fe(p,i==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper methods.");E({title:i==="pending"?"Could not submit edit":"Could not save methods",description:R,variant:"destructive"})}}),z=()=>{i==="direct"&&n.some(p=>!g.includes(p))&&!window.confirm("Remove one or more method links from this paper?")||A.mutate({paperId:a,methodIds:g})},M=m.useMemo(()=>{if(g.length!==n.length)return!0;const p=new Set(n);return g.some(R=>!p.has(R))},[g,n]),K=(p,R)=>{f(I=>R?I.includes(p)?I:[...I,p]:I.filter(U=>U!==p))},G=()=>j("");return e.jsxs(ae,{open:t,onOpenChange:s,children:[e.jsxs(re,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ne,{children:[e.jsx(ie,{children:"Edit Paper Methods"}),e.jsx(oe,{children:"Select the methods and techniques used in this paper. You can select multiple methods."})]}),i==="pending"&&e.jsx(xe,{isAuthor:u}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Fe,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(W,{type:"text",placeholder:"Search methods...",value:_,onChange:p=>j(p.target.value),className:"pl-9 pr-9"}),_&&e.jsx("button",{type:"button",onClick:G,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(St,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:w.length>0?e.jsx("div",{className:"space-y-2",children:w.map(p=>{const R=parseInt(p.id),I=g.includes(R);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(Ve,{id:`method-${p.id}`,checked:I,onCheckedChange:U=>K(R,U===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`method-${p.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[p.name,p.full_name&&p.full_name!==p.name&&e.jsx("span",{className:"block text-xs text-muted-foreground font-normal",children:p.full_name}),p.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[p.description.substring(0,100),p.description.length>100?"...":""]})]})]},p.id)})}):h?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(le,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsx("p",{children:"Loading methods..."})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Fe,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:C?`No methods found matching "${C}"`:"No methods available"})]})}),e.jsxs(de,{children:[e.jsx(L,{variant:"ghost",className:"sm:mr-auto",onClick:()=>x(!0),children:"Suggest a new method"}),e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:z,disabled:A.isPending||!M,children:A.isPending?e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}),i==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(he,{className:"w-4 h-4 mr-2"}),i==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(Et,{open:c,onOpenChange:x,paperId:a,kind:"method"})]})}const Ss=["image/jpeg","image/png","image/webp","image/gif"],Pr=2*1024*1024;function $r(t){return Ss.includes(t.type)?t.size>Pr?Promise.reject(new Error("Logo must be 2 MB or smaller.")):new Promise((s,a)=>{const r=new FileReader;r.onload=()=>s({file_name:t.name,mime_type:t.type,data_url:String(r.result)}),r.onerror=()=>a(new Error("Could not read that logo.")),r.readAsDataURL(t)}):Promise.reject(new Error("Choose a JPEG, PNG, WebP, or GIF logo."))}function Rr({paperId:t,initialName:s,onApplied:a,onUnsentChange:r}){const[n,l]=m.useState(s),[o,i]=m.useState(""),[u,g]=m.useState(""),[f,c]=m.useState(null),[x,_]=m.useState(""),j=ee({mutationFn:()=>pe.submit(Pa(Number(t),"new_organization",{name:n.trim(),...o.trim()?{hf_slug:o.trim()}:{},...u.trim()?{website_url:u.trim()}:{},...f?{image:f}:{}})),onSuccess:S=>{S.status==="approved"&&a(n.trim())}}),C=!j.isSuccess&&!!(o.trim()||u.trim()||f);return m.useEffect(()=>r(C),[r,C]),m.useEffect(()=>()=>r(!1),[r]),j.isSuccess?e.jsxs("p",{className:"rounded border p-3 text-sm",children:['Thanks! "',n.trim(),'" was submitted for review. Once an admin approves it, the organization is created and added to this paper.']}):e.jsxs("form",{className:"space-y-2 rounded border p-3",onSubmit:S=>{S.preventDefault(),j.mutate()},children:[e.jsx("p",{className:"text-sm font-medium",children:"Suggest a new organization"}),e.jsx(W,{"aria-label":"Organization name",placeholder:"Name",value:n,maxLength:200,onChange:S=>l(S.target.value)}),e.jsx(W,{"aria-label":"Hugging Face organization",placeholder:"Hugging Face organization (e.g. https://huggingface.co/PrimeIntellect)",value:o,onChange:S=>i(S.target.value)}),e.jsx(W,{"aria-label":"Website",type:"url",placeholder:"Website (e.g. https://www.primeintellect.ai)",value:u,onChange:S=>g(S.target.value)}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:["Logo (optional)",e.jsx("input",{"aria-label":"Logo",type:"file",accept:Ss.join(","),onChange:S=>{var k;const b=(k=S.target.files)==null?void 0:k[0];c(null),_(""),b&&$r(b).then(c,$=>_($.message))}})]}),f&&e.jsx("img",{src:f.data_url,alt:"Selected logo",className:"h-12 w-12 rounded border object-contain"}),x&&e.jsx("p",{className:"text-sm text-destructive",children:x}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"With a Hugging Face organization it is added right away; otherwise an admin reviews it."}),e.jsx(L,{type:"submit",variant:"outline",disabled:!n.trim()||!o.trim()&&!u.trim()||j.isPending,children:j.isPending?"Submitting...":"Submit organization"})]}),j.error&&e.jsx("p",{className:"text-sm text-destructive",children:fe(j.error,"Could not submit this organization.")})]})}const Ir=({open:t,onOpenChange:s,paperId:a,initialOrganizationIds:r,submitMode:n,isAuthor:l})=>{var b;const[o,i]=m.useState(r),[u,g]=m.useState(""),[f,c]=m.useState(!1),x=ce(),{toast:_}=se();m.useEffect(()=>{t&&(i(r),g(""))},[r,t]);const j=te({queryKey:["organizations","curation"],queryFn:()=>ke.organizations(!1),enabled:t}),C=m.useMemo(()=>{var E,v;const k=u.trim().toLocaleLowerCase();if(!k)return((E=j.data)==null?void 0:E.results)??[];const $=d=>d===k?0:d.startsWith(k)?1:d.split(/[^\p{L}\p{N}]+/u).some(h=>h.startsWith(k))?2:3;return(((v=j.data)==null?void 0:v.results)??[]).map(d=>({organization:d,name:d.name.toLocaleLowerCase()})).filter(({name:d})=>d.includes(k)).sort((d,h)=>$(d.name)-$(h.name)).map(({organization:d})=>d)},[(b=j.data)==null?void 0:b.results,u]),S=ee({mutationFn:async()=>{if(!(r.some($=>!o.includes($))&&!window.confirm("Remove one or more organizations from this paper? Destructive edits may require a fresh sign-in.")))if(n==="pending"){const $=await pe.submit({paper_id:Number(a),edit_type:"organizations",proposed_payload:{organization_ids:o}});return ge($,{toast:_,queryClient:x,paperIds:[a],queuedDescription:"Thanks! An admin will review your proposed organization changes shortly."}),null}else return Y.updateOrganizations(a,o)},onSuccess:k=>{k!==void 0&&(k&&ve(x,k,[a]),s(!1))}});return e.jsx(ae,{open:t,onOpenChange:s,children:e.jsxs(re,{children:[e.jsxs(ne,{children:[e.jsx(ie,{children:"Edit organizations"}),e.jsx(oe,{children:"Associate organizations with this paper. If one is missing, search for it and suggest it for review."})]}),n==="pending"&&e.jsx(xe,{isAuthor:l}),e.jsxs("div",{className:"relative",children:[e.jsx(Fe,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(W,{type:"search","aria-label":"Search organizations",placeholder:"Search organizations...",value:u,onChange:k=>g(k.target.value),className:"pl-9 pr-9"}),u&&e.jsx("button",{type:"button",onClick:()=>g(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear organization search",children:e.jsx(St,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"max-h-80 space-y-2 overflow-auto",children:[C.map(k=>{const $=Number(k.id);return e.jsxs("label",{className:"flex items-center gap-2 rounded border p-2",children:[e.jsx("input",{type:"checkbox",checked:o.includes($),onChange:E=>i(v=>E.target.checked?[...v,$]:v.filter(d=>d!==$))}),k.name]},k.id)}),!j.isLoading&&C.length===0&&e.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:u.trim()?`No organizations found matching "${u.trim()}"`:"No organizations available"})]}),!j.isLoading&&C.length===0&&u.trim()&&e.jsx(Rr,{paperId:a,initialName:u.trim(),onApplied:k=>{s(!1),_({title:"Organization added",description:`Added "${k}" to this paper.`}),ms(x,[a]),hs(x),x.invalidateQueries({queryKey:["organizations"]})},onUnsentChange:c},u.trim()),f&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"Submit the organization above, or clear the search, before saving."}),e.jsxs(de,{children:[e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:()=>S.mutate(),disabled:S.isPending||f,children:n==="pending"?"Submit test edit":"Save changes"})]})]})})};function Ar({open:t,onOpenChange:s,paperId:a,arxivId:r,initialProjectPages:n,onSuccess:l,submitMode:o="direct",isAuthor:i=!1}){const[u,g]=m.useState(n),[f,c]=m.useState(""),x=ce(),{toast:_}=se(),j=m.useRef(!1);m.useEffect(()=>{if(!t){j.current=!1;return}j.current||(j.current=!0,g(n),c(""))},[t,n]);const C=ee({mutationFn:async({paperId:d,projectPages:h})=>{if(o==="pending"){const w=await pe.submit({paper_id:parseInt(d),edit_type:"project_pages",proposed_payload:{project_pages:h}});return ge(w,{toast:_,queryClient:x,paperIds:[d,r],queuedDescription:"Thanks! An admin will review your proposed project page changes shortly."}),null}return Y.updateProjectPages(d,h)},onSuccess:d=>{if(o==="pending"){l==null||l(),s(!1),c("");return}d&&ve(x,d,[a,r]),l==null||l(),s(!1),c("")},onError:d=>{const h=fe(d,o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update project pages.");_({title:o==="pending"?"Could not submit edit":"Could not save project pages",description:h,variant:"destructive"})}}),S=()=>{const d=f.trim();return d?u.some(h=>h.url===d)?(alert("This project page URL is already added"),null):[...u,{url:d,is_official:!1}]:u},b=()=>{const d=S();d!==null&&d.length!==u.length&&(g(d),c(""))},k=d=>{g(u.filter(h=>h.url!==d))},$=d=>{g(u.map(h=>h.url===d?{...h,is_official:!h.is_official}:h))},E=()=>{const d=S();d!==null&&(o==="direct"&&n.some(h=>!d.some(w=>w.url===h.url))&&!window.confirm("Remove one or more project pages from this paper?")||C.mutate({paperId:a,projectPages:d}))},v=m.useMemo(()=>{const d=f.trim(),h=d?[...u,{url:d,is_official:!1}]:u;if(h.length!==n.length)return!0;const w=new Map(n.map(A=>[A.url.trim(),!!A.is_official]));return h.some(A=>{const z=w.get(A.url.trim());return z===void 0||z!==!!A.is_official})},[u,f,n]);return e.jsx(ae,{open:t,onOpenChange:s,children:e.jsxs(re,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ne,{children:[e.jsx(ie,{children:"Edit Paper Project Pages"}),e.jsx(oe,{children:"Add or remove project page URLs (e.g. authors' demo or landing pages) associated with this paper. Mark pages as official if they are created by the paper authors."})]}),o==="pending"&&e.jsx(xe,{isAuthor:i}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Add Project Page URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(W,{type:"url",placeholder:"https://example.com/project",value:f,onChange:d=>c(d.target.value),onKeyPress:d=>{d.key==="Enter"&&(d.preventDefault(),b())},className:"flex-1"}),e.jsxs(L,{onClick:b,size:"sm",disabled:!f.trim(),children:[e.jsx(Ue,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:u.length>0?e.jsx("div",{className:"space-y-2",children:u.map((d,h)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(Gt,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:d.url}),d.is_official&&e.jsx(fs,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(L,{variant:d.is_official?"default":"outline",size:"sm",onClick:()=>$(d.url),className:"h-8 px-2 text-xs",title:d.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(gs,{className:`w-3.5 h-3.5 mr-1 ${d.is_official?"fill-current":""}`}),d.is_official?"Official":"Mark official"]}),e.jsx(L,{variant:"ghost",size:"sm",onClick:()=>k(d.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove project page",children:e.jsx(Te,{className:"w-4 h-4"})})]})]},h))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Gt,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No project pages added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a project page URL above to get started"})]})}),e.jsxs(de,{children:[e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:E,disabled:C.isPending||!v,children:C.isPending?e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(he,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function Fr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialRepositories:n,onSuccess:l,submitMode:o="direct",isAuthor:i=!1}){const[u,g]=m.useState(n),[f,c]=m.useState(""),x=ce(),{toast:_}=se(),j=m.useRef(!1);m.useEffect(()=>{if(!t){j.current=!1;return}j.current||(j.current=!0,g(n),c(""))},[t,n]);const C=ee({mutationFn:async({paperId:h,repositories:w})=>{if(o==="pending"){const A=await pe.submit({paper_id:parseInt(h),edit_type:"repositories",proposed_payload:{repositories:w}});return ge(A,{toast:_,queryClient:x,paperIds:[h,r],queuedDescription:"Thanks! An admin will review your proposed repository changes shortly."}),null}return Y.updateRepositories(h,w)},onSuccess:h=>{if(o==="pending"){l==null||l(),s(!1),c("");return}h&&ve(x,h,[a,r]),l==null||l(),s(!1),c("")},onError:h=>{const w=fe(h,o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper repositories.");_({title:o==="pending"?"Could not submit edit":"Could not save repositories",description:w,variant:"destructive"})}}),S=h=>{const w=[];for(const A of h){const z=w.find(M=>Kt(M.url,A.url));if(z)z.is_official=z.is_official||A.is_official;else{const M=et(A.url);w.push({url:M??A.url.trim(),is_official:A.is_official})}}return w},b=()=>{const h=f.trim(),w=h?[...u,{url:h,is_official:!1}]:u;return h&&u.some(A=>Kt(A.url,h))?(alert("This repository URL is already added"),null):S(w)},k=()=>{const h=b();h!==null&&h.length!==u.length&&(g(h),c(""))},$=h=>{g(u.filter(w=>w.url!==h))},E=h=>{g(u.map(w=>w.url===h?{...w,is_official:!w.is_official}:w))},v=()=>{const h=b();h!==null&&(o==="direct"&&n.some(w=>!h.some(A=>A.url===w.url))&&!window.confirm("Remove one or more repositories from this paper?")||C.mutate({paperId:a,repositories:h}))},d=m.useMemo(()=>{const h=f.trim(),w=h?[...u,{url:h,is_official:!1}]:u;if(w.length!==n.length)return!0;const A=S(n),z=S(w);if(z.length!==A.length)return!0;const M=new Map(A.map(K=>[et(K.url)??K.url.trim(),!!K.is_official]));return z.some(K=>{const G=et(K.url)??K.url.trim(),p=M.get(G);return p===void 0||p!==!!K.is_official})},[u,f,n]);return e.jsx(ae,{open:t,onOpenChange:s,children:e.jsxs(re,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ne,{children:[e.jsx(ie,{children:"Edit Paper Repositories"}),e.jsx(oe,{children:"Add or remove GitHub repository URLs associated with this paper. Mark repositories as official if they are created by the paper authors."})]}),o==="pending"&&e.jsx(xe,{isAuthor:i}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Add Repository URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(W,{type:"url",placeholder:"https://github.com/owner/repo",value:f,onChange:h=>c(h.target.value),onKeyPress:h=>{h.key==="Enter"&&(h.preventDefault(),k())},className:"flex-1"}),e.jsxs(L,{onClick:k,size:"sm",disabled:!f.trim(),children:[e.jsx(Ue,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:u.length>0?e.jsx("div",{className:"space-y-2",children:u.map((h,w)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(Xt,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:h.url}),h.is_official&&e.jsx(fs,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(L,{variant:h.is_official?"default":"outline",size:"sm",onClick:()=>E(h.url),className:"h-8 px-2 text-xs",title:h.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(gs,{className:`w-3.5 h-3.5 mr-1 ${h.is_official?"fill-current":""}`}),h.is_official?"Official":"Mark official"]}),e.jsx(L,{variant:"ghost",size:"sm",onClick:()=>$(h.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove repository",children:e.jsx(Te,{className:"w-4 h-4"})})]})]},w))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Xt,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No repositories added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a repository URL above to get started"})]})}),e.jsxs(de,{children:[e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:v,disabled:C.isPending||!d,children:C.isPending?e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(he,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function Lr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialUrl:n,onSuccess:l,submitMode:o="direct",isAuthor:i=!1}){const[u,g]=m.useState(n),f=ce(),{toast:c}=se(),x=m.useRef(!1);m.useEffect(()=>{if(!t){x.current=!1;return}x.current||(x.current=!0,g(n))},[t,n]);const _=ee({mutationFn:async({paperId:k,sourceUrl:$})=>{if(o==="pending"){const E=await pe.submit({paper_id:parseInt(k),edit_type:"source_url",proposed_payload:{source_url:$}});return ge(E,{toast:c,queryClient:f,paperIds:[k,r],queuedDescription:"Thanks! An admin will review your proposed source URL change shortly."}),null}return Y.updateSourceUrl(k,$)},onSuccess:k=>{if(o==="pending"){l==null||l(),s(!1);return}k&&ve(f,k,[a,r]),l==null||l(),s(!1)},onError:k=>{const $=fe(k,o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update source URL.");c({title:o==="pending"?"Could not submit edit":"Could not save source URL",description:$,variant:"destructive"})}}),j=u.trim(),C=/^https?:\/\//i.test(j),S=j!==(n||"").trim(),b=()=>{C&&_.mutate({paperId:a,sourceUrl:j})};return e.jsx(ae,{open:t,onOpenChange:s,children:e.jsxs(re,{className:"max-w-2xl",children:[e.jsxs(ne,{children:[e.jsx(ie,{children:"Edit Source URL"}),e.jsxs(oe,{children:["Update the canonical URL for this external paper. This is the page the ",'"Source page"'," button links to. ArXiv papers cannot edit this field."]})]}),o==="pending"&&e.jsx(xe,{isAuthor:i}),e.jsxs("div",{className:"space-y-2 py-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Source URL"}),e.jsx(W,{type:"url",placeholder:"https://example.com/paper",value:u,onChange:k=>g(k.target.value),onKeyPress:k=>{k.key==="Enter"&&C&&S&&(k.preventDefault(),b())}}),!C&&j.length>0&&e.jsx("p",{className:"text-xs text-destructive",children:"URL must start with http:// or https://"})]}),e.jsxs(de,{children:[e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:b,disabled:_.isPending||!C||!S,children:_.isPending?e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(he,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}const Tr=250,Ur=100;function Dr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialTaskIds:n,initialTasks:l,onSuccess:o,submitMode:i="direct",isAuthor:u=!1}){const[g,f]=m.useState(n),[c,x]=m.useState(!1),[_,j]=m.useState(""),[C,S]=m.useState(""),[b,k]=m.useState(new Map),$=ce(),{toast:E}=se(),v=m.useRef(!1);m.useEffect(()=>{if(!t){v.current=!1;return}if(v.current)return;v.current=!0,f(n),j(""),S("");const p=new Map;(l||[]).forEach(R=>{const I=parseInt(R.id);Number.isNaN(I)||p.set(I,R)}),k(p)},[t,n,l]),m.useEffect(()=>{const p=window.setTimeout(()=>{S(_.trim())},Tr);return()=>window.clearTimeout(p)},[_]);const{data:d,isFetching:h}=te({queryKey:["tasks-search",C],queryFn:()=>ke.listTasks({page_size:Ur,...C?{q:C}:{}}),enabled:t});m.useEffect(()=>{var p;(p=d==null?void 0:d.results)!=null&&p.length&&k(R=>{const I=new Map(R);return d.results.forEach(U=>{const D=parseInt(U.id);Number.isNaN(D)||I.set(D,U)}),I})},[d]);const w=m.useMemo(()=>{const p=(d==null?void 0:d.results)||[],R=new Set,I=[],U=(q,J)=>{!J||Number.isNaN(q)||R.has(q)||(I.push(J),R.add(q))},D=()=>g.forEach(q=>U(q,b.get(q))),H=()=>p.forEach(q=>U(parseInt(q.id),q));return C?(H(),D()):(D(),H()),I},[d,g,b,C]),A=ee({mutationFn:async({paperId:p,taskIds:R})=>{if(i==="pending"){const I=await pe.submit({paper_id:parseInt(p),edit_type:"tasks",proposed_payload:{task_ids:R}});return ge(I,{toast:E,queryClient:$,paperIds:[p,r],queuedDescription:"Thanks! An admin will review your proposed task changes shortly."}),null}return Y.updateTasks(p,R)},onMutate:async({taskIds:p})=>{if(i==="pending")return{snapshots:[]};const R=p.map(D=>b.get(D)).filter(D=>!!D).map(D=>({id:D.id,name:D.name,slug:D.slug})).sort((D,H)=>D.name.localeCompare(H.name)),I=Array.from(new Set([a,r].filter(D=>!!D)));await Promise.all(I.flatMap(D=>[$.cancelQueries({queryKey:_e.detail(D)}),$.cancelQueries({queryKey:_e.arxiv(D)})]));const U=[];return I.forEach(D=>{[_e.detail(D),_e.arxiv(D)].forEach(H=>{const q=$.getQueryData(H);U.push({key:H,data:q}),q&&$.setQueryData(H,{...q,tasks:R})})}),o==null||o(),s(!1),{snapshots:U}},onSuccess:(p,{taskIds:R})=>{if(i==="pending"){o==null||o(),s(!1);return}E({title:"Tasks updated",description:`Saved ${R.length} task${R.length===1?"":"s"} for this paper.`}),p&&ve($,p,[a,r])},onError:(p,R,I)=>{var D;(D=I==null?void 0:I.snapshots)==null||D.forEach(({key:H,data:q})=>{$.setQueryData(H,q)});const U=fe(p,i==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper tasks.");E({title:i==="pending"?"Could not submit edit":"Could not save tasks",description:U,variant:"destructive"})}}),z=()=>{i==="direct"&&n.some(p=>!g.includes(p))&&!window.confirm("Remove one or more task links from this paper?")||A.mutate({paperId:a,taskIds:g})},M=m.useMemo(()=>{if(g.length!==n.length)return!0;const p=new Set(n);return g.some(R=>!p.has(R))},[g,n]),K=(p,R)=>{f(I=>R?I.includes(p)?I:[...I,p]:I.filter(U=>U!==p))},G=()=>j("");return e.jsxs(ae,{open:t,onOpenChange:s,children:[e.jsxs(re,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ne,{children:[e.jsx(ie,{children:"Edit Paper Tasks"}),e.jsx(oe,{children:"Select the tasks that this paper addresses. You can select multiple tasks."})]}),i==="pending"&&e.jsx(xe,{isAuthor:u}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Fe,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(W,{type:"text",placeholder:"Search tasks...",value:_,onChange:p=>j(p.target.value),className:"pl-9 pr-9"}),_&&e.jsx("button",{type:"button",onClick:G,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(St,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:w.length>0?e.jsx("div",{className:"space-y-2",children:w.map(p=>{const R=parseInt(p.id),I=g.includes(R);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(Ve,{id:`task-${p.id}`,checked:I,onCheckedChange:U=>K(R,U===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`task-${p.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[p.name,p.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[p.description.substring(0,100),p.description.length>100?"...":""]})]})]},p.id)})}):h?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(le,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsx("p",{children:"Loading tasks..."})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Fe,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:C?`No tasks found matching "${C}"`:"No tasks available"})]})}),e.jsxs(de,{children:[e.jsx(L,{variant:"ghost",className:"sm:mr-auto",onClick:()=>x(!0),children:"Suggest a new task"}),e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:z,disabled:A.isPending||!M,children:A.isPending?e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}),i==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(he,{className:"w-4 h-4 mr-2"}),i==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(Et,{open:c,onOpenChange:x,paperId:a,kind:"task"})]})}const Jt=10,Br=/^https?:\/\/(?:www\.|mobile\.)?(?:x|twitter)\.com\/(?:[A-Za-z0-9_]{1,15}|i\/web|i)\/status(?:es)?\/(\d{1,25})(?:[/?#].*)?$/;function Ce(t){var s;return((s=Br.exec(t.trim()))==null?void 0:s[1])??null}function zr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialUrls:n,submitMode:l="direct",isAuthor:o=!1}){const[i,u]=m.useState(n),[g,f]=m.useState(""),[c,x]=m.useState(null),_=ce(),{toast:j}=se(),C=m.useRef(!1);m.useEffect(()=>{if(!t){C.current=!1;return}C.current||(C.current=!0,u(n),f(""),x(null))},[t,n]);const S=ee({mutationFn:async d=>{if(l==="pending"){const h=await pe.submit({paper_id:parseInt(a),edit_type:"x_threads",proposed_payload:{x_threads:d}});return ge(h,{toast:j,queryClient:_,paperIds:[a,r],queuedDescription:"Thanks! An admin will review your proposed X threads shortly."}),null}return Y.updateXThreads(a,d)},onSuccess:d=>{l!=="pending"&&d&&ve(_,d,[a,r]),s(!1)},onError:d=>{j({title:l==="pending"?"Could not submit edit":"Could not save X threads",description:fe(d,l==="pending"?"Failed to submit your edit. Please try again.":"Failed to update X threads."),variant:"destructive"})}}),b=()=>{const d=g.trim();if(!d)return i;const h=Ce(d);return h?i.some(w=>Ce(w)===h)?(x("This post is already listed."),null):i.length>=Jt?(x(`A paper can link at most ${Jt} X threads.`),null):[...i,d]:(x("Paste a post URL such as https://x.com/user/status/123…"),null)},k=()=>{const d=b();d!==null&&(u(d),f(""),x(null))},$=(d,h)=>{const w=[...i];[w[d],w[d+h]]=[w[d+h],w[d]],u(w)},E=()=>{const d=b();d!==null&&(l==="direct"&&n.some(h=>!d.some(w=>Ce(w)===Ce(h)))&&!window.confirm("Remove one or more X threads from this paper?")||S.mutate(d))},v=m.useMemo(()=>(g.trim()?[...i,g.trim()]:i).map(Ce).join()!==n.map(Ce).join(),[i,g,n]);return e.jsx(ae,{open:t,onOpenChange:s,children:e.jsxs(re,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ne,{children:[e.jsx(ie,{children:"Edit X threads"}),e.jsx(oe,{children:"Link posts on X (formerly Twitter) in which the authors introduce this paper. A preview of each post is shown on the paper page."})]}),l==="pending"&&e.jsx(xe,{isAuthor:o}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",htmlFor:"x-thread-url",children:"Add X post URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(W,{id:"x-thread-url",type:"url",placeholder:"https://x.com/user/status/1234567890",value:g,onChange:d=>{f(d.target.value),x(null)},onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),k())},"aria-invalid":!!c,className:"flex-1"}),e.jsxs(L,{onClick:k,size:"sm",disabled:!g.trim(),children:[e.jsx(Ue,{className:"w-4 h-4 mr-1"}),"Add"]})]}),c&&e.jsx("p",{className:"text-xs text-destructive",children:c})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:i.length>0?e.jsx("div",{className:"space-y-2",children:i.map((d,h)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg",children:[e.jsx("span",{className:"flex-1 min-w-0 truncate text-sm font-medium",children:d}),e.jsx(L,{variant:"ghost",size:"sm",className:"h-8 px-2",disabled:h===0,onClick:()=>$(h,-1),"aria-label":"Move up",children:e.jsx(Ha,{className:"w-4 h-4"})}),e.jsx(L,{variant:"ghost",size:"sm",className:"h-8 px-2",disabled:h===i.length-1,onClick:()=>$(h,1),"aria-label":"Move down",children:e.jsx(za,{className:"w-4 h-4"})}),e.jsx(L,{variant:"ghost",size:"sm",className:"h-8 px-2 text-destructive hover:text-destructive",onClick:()=>u(i.filter(w=>w!==d)),"aria-label":"Remove X thread",children:e.jsx(Te,{className:"w-4 h-4"})})]},d))}):e.jsx("p",{className:"text-center py-8 text-sm text-muted-foreground",children:"No X threads linked yet"})}),e.jsxs(de,{children:[e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:E,disabled:S.isPending||!v,children:S.isPending?e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"w-4 h-4 mr-2 animate-spin"}),l==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(he,{className:"w-4 h-4 mr-2"}),l==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function Hr({activeEditor:t,arxivId:s,editSubmitMode:a,evaluations:r,isAdmin:n,isLinkedAuthor:l,onOpenChange:o,paper:i}){if(!t)return null;const u={open:!0,paperId:i.id,arxivId:s,submitMode:a,isAuthor:l},g=c=>x=>o(c,x);return{tasks:()=>{var c;return e.jsx(Dr,{...u,onOpenChange:g("tasks"),initialTaskIds:((c=i.tasks)==null?void 0:c.map(x=>Number(x.id)))??[],initialTasks:i.tasks??[]})},methods:()=>{var c;return e.jsx(Er,{...u,onOpenChange:g("methods"),initialMethodIds:((c=i.methods)==null?void 0:c.map(x=>Number(x.id)))??[],initialMethods:i.methods??[]})},repositories:()=>{var c;return e.jsx(Fr,{...u,onOpenChange:g("repositories"),initialRepositories:((c=i.repositories)==null?void 0:c.map(({url:x,is_official:_})=>({url:x,is_official:!!_})))??[]})},"project-pages":()=>{var c;return e.jsx(Ar,{...u,onOpenChange:g("project-pages"),initialProjectPages:((c=i.project_pages)==null?void 0:c.map(({url:x,is_official:_})=>({url:x,is_official:!!_})))??[]})},results:()=>e.jsx(jr,{...u,onOpenChange:g("results"),initialEvaluations:r,paperTasks:i.tasks??[],isAdmin:n}),"source-url":()=>e.jsx(Lr,{...u,onOpenChange:g("source-url"),initialUrl:i.source_url??i.url_abs??""}),"hf-artifacts":()=>e.jsx(yr,{...u,onOpenChange:g("hf-artifacts"),initialArtifacts:{hf_models:i.hf_models??[],hf_datasets:i.hf_datasets??[],hf_spaces:i.hf_spaces??[]}}),"x-threads":()=>{var c;return e.jsx(zr,{...u,onOpenChange:g("x-threads"),initialUrls:((c=i.x_threads)==null?void 0:c.map(({url:x})=>x))??[]})},organizations:()=>e.jsx(Ir,{open:!0,paperId:i.id,onOpenChange:g("organizations"),initialOrganizationIds:(i.organizations??[]).map(({id:c})=>Number(c)),submitMode:a,isAuthor:l})}[t]()}const qr={"add-evals":{trigger:"add evals",running:"adding evals…",complete:"add evals ✓",title:"Add evaluations with Codex",description:t=>e.jsxs(e.Fragment,{children:["Codex will run the repository’s add-evals skill for “",t,"”. It will import only paper-native results onto existing, metric-compatible leaderboards. Accepted rows are written directly to the live database."]}),notice:"Comparator rows, unknown benchmarks, and unconfigured metrics will be skipped. Jobs run one at a time in submission order.",progress:"Codex is researching the paper and validating results against the configured leaderboards.",action:"Run add-evals"},"enrich-paper":{trigger:"enrich paper",running:"enriching…",complete:"enriched ✓",title:"Enrich paper with Codex",description:t=>e.jsxs(e.Fragment,{children:["Codex will run the repository’s enrich-paper skill for “",t,"”. It will validate official code and project links, merge high-confidence taxonomy tags, and check the paper thumbnail. Accepted changes are written directly to the live database."]}),notice:"Uncertain URLs and missing taxonomy concepts will be reported rather than guessed. Jobs run one at a time in submission order.",progress:"Codex is validating artifacts, taxonomy tags, and thumbnail quality for this paper.",action:"Run enrich-paper"}},Zt=new Set(["queued","dispatching","running","awaiting_markdown"]);function Mr({report:t}){return e.jsx("div",{className:"min-w-0 max-h-[50vh] overflow-y-auto overflow-x-hidden rounded-md border bg-muted/40 p-4 text-sm leading-relaxed",children:e.jsx(Fa,{remarkPlugins:[La],components:{a:({children:s,...a})=>e.jsx("a",{...a,className:"break-all underline underline-offset-2",target:"_blank",rel:"noreferrer",children:s}),p:({children:s})=>e.jsx("p",{className:"mb-3 break-words last:mb-0",children:s}),ul:({children:s})=>e.jsx("ul",{className:"mb-3 list-disc space-y-1 pl-5 last:mb-0",children:s}),ol:({children:s})=>e.jsx("ol",{className:"mb-3 list-decimal space-y-1 pl-5 last:mb-0",children:s}),h1:({children:s})=>e.jsx("h3",{className:"mb-2 font-semibold",children:s}),h2:({children:s})=>e.jsx("h3",{className:"mb-2 font-semibold",children:s}),h3:({children:s})=>e.jsx("h3",{className:"mb-2 font-semibold",children:s}),code:({children:s})=>e.jsx("code",{className:"break-all rounded bg-background/80 px-1 py-0.5 font-mono text-xs",children:s}),pre:({children:s})=>e.jsx("pre",{className:"mb-3 max-w-full overflow-x-auto whitespace-pre-wrap break-words rounded bg-background/80 p-3 font-mono text-xs last:mb-0",children:s})},children:t})})}function Es({kind:t,paperId:s,paperTitle:a,triggerClassName:r,onComplete:n}){var h;const l=qr[t],o=ce(),[i,u]=m.useState(!1),[g,f]=m.useState(null),c=m.useRef(null),x=w=>["admin","codexPaperJob",t,w],_=te({queryKey:x(g),queryFn:()=>tt.getPaperJob(t,g),enabled:g!==null,refetchInterval:w=>{var z;const A=(z=w.state.data)==null?void 0:z.status;return A==="awaiting_markdown"?6e4:A&&Zt.has(A)?2e3:!1},retry:!1}),j=w=>{o.setQueryData(x(w.id),w),f(w.id)},C=ee({mutationFn:()=>tt.startPaperJob(t,s),onSuccess:j}),S=ee({mutationFn:w=>tt.cancelPaperJob(t,w),onSuccess:j}),b=g?_.data:void 0,k=(b==null?void 0:b.status)==="awaiting_markdown",$=b?Zt.has(b.status):!1,E=_.errorUpdatedAt>_.dataUpdatedAt?_.error:null,v=(h=C.error??S.error??E)==null?void 0:h.message;m.useEffect(()=>{(b==null?void 0:b.status)!=="completed"||c.current===b.id||(c.current=b.id,n())},[b,n]);const d=()=>{f(null),C.reset(),S.reset(),c.current=null};return e.jsxs(ae,{open:i,onOpenChange:u,children:[e.jsx("button",{type:"button",className:r,onClick:()=>u(!0),children:k?"waiting for Markdown…":$?l.running:(b==null?void 0:b.status)==="completed"?l.complete:l.trigger}),e.jsxs(re,{className:"max-h-[90vh] w-[calc(100vw-2rem)] min-w-0 max-w-2xl overflow-hidden",children:[e.jsxs(ne,{className:"min-w-0",children:[e.jsx(ie,{children:l.title}),e.jsx(oe,{children:l.description(a)})]}),b?e.jsxs("div",{className:"min-w-0 space-y-3 overflow-hidden",children:[e.jsxs("div",{className:"font-mono text-xs uppercase tracking-wide text-muted-foreground",children:["Status: ",b.status.replace("_"," ")]}),b.hf_job_url&&e.jsx("a",{className:"text-sm underline",href:b.hf_job_url,target:"_blank",rel:"noreferrer",children:"View Hugging Face Job"}),k&&e.jsxs("div",{className:"rounded-md border bg-muted/40 p-3 text-sm",children:[Aa," You can close this window and return."]}),$&&!k&&e.jsxs("div",{className:"rounded-md border bg-muted/40 p-3 text-sm",children:[b.status==="queued"?"This job is queued and will start after the current Codex job finishes.":l.progress," ","This can take several minutes; you can close this window and return."]}),b.report&&e.jsx(Mr,{report:b.report}),b.error&&!k&&e.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:b.error})]}):e.jsx("div",{className:"rounded-md border bg-muted/40 p-3 text-sm text-muted-foreground",children:l.notice}),v&&e.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:v}),e.jsxs(de,{children:[e.jsx(L,{variant:"outline",onClick:()=>u(!1),children:$?"Close":"Cancel"}),$&&b&&e.jsx(L,{variant:"outline",onClick:()=>S.mutate(b.id),children:"Cancel job"}),!b&&e.jsx(L,{onClick:()=>C.mutate(),disabled:C.isPending,children:C.isPending?"Starting…":l.action}),b&&!$&&e.jsx(L,{variant:"outline",onClick:d,children:"Run again"})]})]})]})}function Me({accent:t,id:s,label:a}){return e.jsxs("div",{className:"section-rule paper-section-anchor",id:s,children:[e.jsx("span",{children:e.jsx("a",{href:`#${s}`,className:"section-anchor-link",children:a})}),t]})}function Or({canCopyBadge:t,canEdit:s,evaluationsByTask:a,evaluationsLoading:r,isAdmin:n,onCopyBadge:l,onEdit:o,onRefresh:i,paper:u,visibleEvaluationCount:g}){return e.jsxs(e.Fragment,{children:[e.jsx(Me,{id:"results",label:"Results",accent:e.jsxs("span",{className:"accent",children:[g," benchmarks",t&&e.jsxs("button",{type:"button",className:"edit-link results-badge-copy",onClick:l,title:"Copy live leaderboard badges for your repository README",children:[e.jsx(V,{name:"copy",size:10})," Copy PwC badge"]}),n&&Vs()&&e.jsx(Es,{kind:"add-evals",triggerClassName:"edit-link",paperId:Number(u.id),paperTitle:u.title,onComplete:i}),s&&e.jsx("button",{type:"button",onClick:o,className:"edit-link",children:"edit"})]})}),r?e.jsx(Ie,{className:"h-32 w-full"}):a.length>0?a.map(f=>e.jsxs("div",{className:f.taskSlug?"paper-section-anchor":void 0,id:f.taskSlug?bs(f.taskSlug):void 0,children:[e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:f.taskSlug?e.jsxs(e.Fragment,{children:[e.jsx(me,{to:`/tasks/${f.taskSlug}`,children:f.taskName}),e.jsx("a",{href:tr(f.taskSlug),className:"section-anchor-link results-task-permalink","aria-label":`Permalink to ${f.taskName} results on this paper`,title:"Link to this task's results",children:"#"})]}):f.taskName}),e.jsxs("span",{className:"accent",children:[f.rows.length," ",f.rows.length===1?"result":"results"]})]}),e.jsxs("table",{className:"results-table",children:[e.jsxs("colgroup",{children:[e.jsx("col",{style:{width:"28%"}}),e.jsx("col",{style:{width:"28%"}}),e.jsx("col",{style:{width:"14%"}}),e.jsx("col",{style:{width:"12%"}}),e.jsx("col",{style:{width:"8%"}}),e.jsx("col",{style:{width:"10%"}})]}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Benchmark"}),e.jsx("th",{children:"Model"}),e.jsx("th",{children:"Metric"}),e.jsx("th",{children:"Value"}),e.jsx("th",{children:"Rank"}),e.jsx("th",{children:"Compare"})]})}),e.jsx("tbody",{children:f.rows.map(c=>{var x;return e.jsxs("tr",{children:[e.jsx("td",{className:"benchmark",children:c.dataset_slug?e.jsx(me,{to:`/benchmark/${c.dataset_slug}`,children:c.dataset_name||"—"}):c.dataset_name||"—"}),e.jsxs("td",{className:"model",title:c.model_name||void 0,children:[c.hf_model_url?e.jsx("a",{href:c.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"model-hf-link",title:`Open ${c.model_name||"model"} on Hugging Face`,children:c.model_name||"—"}):c.model_name||"—",c.is_open===!1&&e.jsx(ga,{}),(c.external??c.is_external)&&e.jsx(xa,{sourceUrl:c.source_url||c.external_source_url||c.result_url})]}),e.jsx("td",{className:"metric",children:c.best_metric}),e.jsx("td",{className:"value",children:Ws((x=c.metrics)==null?void 0:x[c.best_metric||""])}),e.jsx("td",{className:"rank",children:c.best_rank!=null?`#${c.best_rank}`:"—"}),e.jsx("td",{className:"compare",children:c.dataset_slug&&e.jsx(me,{to:`/benchmark/${c.dataset_slug}?${[c.task_slug?`task=${encodeURIComponent(c.task_slug)}`:"",`eval=${encodeURIComponent(c.id)}`].filter(Boolean).join("&")}`,children:"Compare →"})})]},c.id)})})]})]},f.taskId)):e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:"No benchmark results recorded yet."})]})}var Rt="Radio",[Kr,Ps]=Ct(Rt),[Gr,Xr]=Kr(Rt),$s=m.forwardRef((t,s)=>{const{__scopeRadio:a,name:r,checked:n=!1,required:l,disabled:o,value:i="on",onCheck:u,form:g,...f}=t,[c,x]=m.useState(null),_=Le(s,S=>x(S)),j=m.useRef(!1),C=c?g||!!c.closest("form"):!0;return e.jsxs(Gr,{scope:a,checked:n,disabled:o,children:[e.jsx(Ne.button,{type:"button",role:"radio","aria-checked":n,"data-state":Fs(n),"data-disabled":o?"":void 0,disabled:o,value:i,...f,ref:_,onClick:Ae(t.onClick,S=>{n||u==null||u(),C&&(j.current=S.isPropagationStopped(),j.current||S.stopPropagation())})}),C&&e.jsx(As,{control:c,bubbles:!j.current,name:r,value:i,checked:n,required:l,disabled:o,form:g,style:{transform:"translateX(-100%)"}})]})});$s.displayName=Rt;var Rs="RadioIndicator",Is=m.forwardRef((t,s)=>{const{__scopeRadio:a,forceMount:r,...n}=t,l=Xr(Rs,a);return e.jsx(is,{present:r||l.checked,children:e.jsx(Ne.span,{"data-state":Fs(l.checked),"data-disabled":l.disabled?"":void 0,...n,ref:s})})});Is.displayName=Rs;var Qr="RadioBubbleInput",As=m.forwardRef(({__scopeRadio:t,control:s,checked:a,bubbles:r=!0,...n},l)=>{const o=m.useRef(null),i=Le(o,l),u=ps(a),g=ls(s);return m.useEffect(()=>{const f=o.current;if(!f)return;const c=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(c,"checked").set;if(u!==a&&_){const j=new Event("click",{bubbles:r});_.call(f,a),f.dispatchEvent(j)}},[u,a,r]),e.jsx(Ne.input,{type:"radio","aria-hidden":!0,defaultChecked:a,...n,tabIndex:-1,ref:i,style:{...n.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});As.displayName=Qr;function Fs(t){return t?"checked":"unchecked"}var Vr=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],We="RadioGroup",[Wr]=Ct(We,[cs,Ps]),Ls=cs(),Ts=Ps(),[Yr,Jr]=Wr(We),Us=m.forwardRef((t,s)=>{const{__scopeRadioGroup:a,name:r,defaultValue:n,value:l,required:o=!1,disabled:i=!1,orientation:u,dir:g,loop:f=!0,onValueChange:c,...x}=t,_=Ls(a),j=Ys(g),[C,S]=os({prop:l,defaultProp:n??null,onChange:c,caller:We});return e.jsx(Yr,{scope:a,name:r,required:o,disabled:i,value:C,onValueChange:S,children:e.jsx(Js,{asChild:!0,..._,orientation:u,dir:j,loop:f,children:e.jsx(Ne.div,{role:"radiogroup","aria-required":o,"aria-orientation":u,"data-disabled":i?"":void 0,dir:j,...x,ref:s})})})});Us.displayName=We;var Ds="RadioGroupItem",Bs=m.forwardRef((t,s)=>{const{__scopeRadioGroup:a,disabled:r,...n}=t,l=Jr(Ds,a),o=l.disabled||r,i=Ls(a),u=Ts(a),g=m.useRef(null),f=Le(s,g),c=l.value===n.value,x=m.useRef(!1);return m.useEffect(()=>{const _=C=>{Vr.includes(C.key)&&(x.current=!0)},j=()=>x.current=!1;return document.addEventListener("keydown",_),document.addEventListener("keyup",j),()=>{document.removeEventListener("keydown",_),document.removeEventListener("keyup",j)}},[]),e.jsx(Zs,{asChild:!0,...i,focusable:!o,active:c,children:e.jsx($s,{disabled:o,required:l.required,checked:c,...u,...n,name:l.name,ref:f,onCheck:()=>l.onValueChange(n.value),onKeyDown:Ae(_=>{_.key==="Enter"&&_.preventDefault()}),onFocus:Ae(n.onFocus,()=>{var _;x.current&&((_=g.current)==null||_.click())})})})});Bs.displayName=Ds;var Zr="RadioGroupIndicator",zs=m.forwardRef((t,s)=>{const{__scopeRadioGroup:a,...r}=t,n=Ts(a);return e.jsx(Is,{...n,...r,ref:s})});zs.displayName=Zr;var Hs=Us,qs=Bs,en=zs;const vt=m.forwardRef(({className:t,...s},a)=>e.jsx(Hs,{className:Oe("grid gap-2",t),...s,ref:a}));vt.displayName=Hs.displayName;const Re=m.forwardRef(({className:t,...s},a)=>e.jsx(qs,{ref:a,className:Oe("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...s,children:e.jsx(en,{className:"flex items-center justify-center",children:e.jsx(ea,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Re.displayName=qs.displayName;const tn={pdf:"PDF",model:"Model",dataset:"Dataset",space:"Space",github:"GitHub"},yt=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,sn=/^[A-Za-z0-9][\w.-]*\/[A-Za-z0-9][\w.-]*$/,an=20,_t="copy_to_bucket";function rn(t){const s=t.trim();if(!sn.test(s))return null;const[a,r]=s.split("/");return`https://huggingface.co/buckets/${encodeURIComponent(a)}/${encodeURIComponent(r)}`}function wt(t){return`pwc:bucket-copy:${t}`}function nn(t){if(typeof window>"u"||new URL(window.location.href).searchParams.get(_t)!==t)return null;try{const a=window.sessionStorage.getItem(wt(t));if(!a)return null;const r=JSON.parse(a);return r.paperId!==t||typeof r.bucketId!="string"||!["new","existing"].includes(r.destinationMode)||!["public","private"].includes(r.visibility)||!Array.isArray(r.selectedIds)||r.selectedIds.some(n=>typeof n!="string")?null:r}catch{return null}}function on(t,s=an){if(s<1)throw new Error("Bucket copy batch size must be positive");const a=[];for(let r=0;r!yt.test(u)))return null;const o=l.join("/"),i=s==="model"?"":`${s}s/`;return{id:`${s}:${o}`,kind:s,label:o,url:`https://huggingface.co/${i}${o}`,source:`hf://${i}${o}/`,destination:`${s}s/${o}/`,repoId:o}}catch{return null}}function ln(t){try{const s=new URL(t);if(s.hostname!=="github.com"&&s.hostname!=="www.github.com")return null;const a=s.pathname.split("/").filter(Boolean);if(a.length<2)return null;const r=a[0],n=a[1].replace(/\.git$/,"");if(!yt.test(r)||!yt.test(n))return null;const l=`${r}/${n}`;return{id:`github:${l}`,kind:"github",label:l,url:`https://github.com/${l}`,source:`https://github.com/${l}.git`,destination:`github/${l}/`}}catch{return null}}function cn({githubUrls:t,hfModelUrls:s,hfDatasetUrls:a,hfSpaceUrls:r,paperId:n,pdfName:l,pdfUrl:o}){const i=[o?{id:"pdf",kind:"pdf",label:"Paper PDF",url:o,source:o,destination:`paper/${l||n}.pdf`}:null,...s.map(g=>pt(g,"model")),...a.map(g=>pt(g,"dataset")),...r.map(g=>pt(g,"space")),...t.map(ln)],u=new Set;return i.filter(g=>!g||u.has(g.id)?!1:(u.add(g.id),!0))}function dn(t,s,a){const r=["# Requires the Hugging Face CLI: https://huggingface.co/docs/huggingface_hub/guides/cli",`HF_BUCKET=${He(t.trim())}`];a.create&&r.push(`hf buckets create "$HF_BUCKET" --exist-ok${a.isPrivate?" --private":""}`);for(const o of s.filter(i=>i.kind!=="github"&&i.kind!=="pdf"))r.push(`hf cp ${He(o.source)} "hf://buckets/$HF_BUCKET/${o.destination}"`);const n=s.find(o=>o.kind==="pdf");n&&r.push('PWC_PDF="$(mktemp)"',`trap 'rm -f "$PWC_PDF"' EXIT`,`curl --fail --location ${He(n.source)} --output "$PWC_PDF"`,`hf cp "$PWC_PDF" "hf://buckets/$HF_BUCKET/${n.destination}"`);const l=s.filter(o=>o.kind==="github");if(l.length){r.push('PWC_COPY_DIR="$(mktemp -d)"',`trap 'rm -rf "$PWC_COPY_DIR"' EXIT`);for(const o of l){const i=`$PWC_COPY_DIR/${o.destination.replace(/\/$/,"")}`;r.push(`git clone --depth 1 -- ${He(o.source)} "${i}"`,`hf sync "${i}" "hf://buckets/$HF_BUCKET/${o.destination}" --exclude '.git/**'`)}}return r.join(` +`)}function un(t){return`${(t.split(/[:|–—]/,1)[0]||t).normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48).replace(/-+$/g,"")||"paper"}-artifacts`}function mn(t){const{toast:s}=se(),a=m.useMemo(()=>cn({githubUrls:t.githubUrls,hfDatasetUrls:t.hfDatasetUrls,hfModelUrls:t.hfModelUrls,hfSpaceUrls:t.hfSpaceUrls,paperId:t.paperId,pdfName:t.pdfName,pdfUrl:t.pdfUrl}),[t.githubUrls,t.hfDatasetUrls,t.hfModelUrls,t.hfSpaceUrls,t.paperId,t.pdfName,t.pdfUrl]),r=m.useMemo(()=>nn(t.paperId),[t.paperId]),[n,l]=m.useState(!!r),[o,i]=m.useState((r==null?void 0:r.destinationMode)??"new"),[u,g]=m.useState((r==null?void 0:r.bucketId)??""),[f,c]=m.useState((r==null?void 0:r.visibility)??"public"),[x,_]=m.useState(()=>new Set((r==null?void 0:r.selectedIds)??a.map(p=>p.id))),[j,C]=m.useState(!1),[S,b]=m.useState(null),[k,$]=m.useState(!!r),E=a.filter(p=>x.has(p.id)),v=E.length===a.length,d=rn(u),h=d!==null,w=dn(u,E,{create:o==="new",isPrivate:f==="private"}),A=(p,R)=>{_(I=>{const U=new Set(I);return R?U.add(p):U.delete(p),U})},z=async()=>{try{await navigator.clipboard.writeText(w),s({title:"Bucket copy commands copied",description:"Run them in a terminal where the Hugging Face CLI is signed in."})}catch{s({title:"Copy failed",description:"Could not access the clipboard. Select and copy the commands manually.",variant:"destructive"})}},M=m.useCallback(()=>{const p=new URL(window.location.href);p.searchParams.set(_t,t.paperId),window.sessionStorage.setItem(wt(t.paperId),JSON.stringify({paperId:t.paperId,bucketId:u.trim(),destinationMode:o,visibility:f,selectedIds:Array.from(x)})),window.location.assign(ta(p.toString(),{authorizeBucket:!0,bucketCreate:o==="new"}))},[u,o,t.paperId,x,f]),K=m.useCallback(async()=>{if(!t.isSignedIn){M();return}C(!0);let p=0,R=0;try{const I=E.filter(H=>H.kind!=="pdf"&&H.kind!=="github"&&!!H.repoId).map(H=>({kind:H.kind,repo_id:H.repoId})),U=on(I);U.length||U.push([]);for(const[H,q]of U.entries()){b({current:H+1,total:U.length});const J=await Y.copyToBucket(t.paperId,{bucket_id:u.trim(),create:H===0&&o==="new",private:f==="private",include_pdf:H===0&&E.some(Z=>Z.kind==="pdf"),artifacts:q});p+=J.copied.length,R+=J.errors.length}const D=E.filter(H=>H.kind==="github").length;s({title:R?"Bucket copy partially completed":"Copied to bucket",description:[`${p} item${p===1?"":"s"} copied.`,R?`${R} item${R===1?"":"s"} failed.`:"",D?"Use the generated commands below to copy GitHub repositories.":""].filter(Boolean).join(" "),variant:R?"destructive":void 0,action:d?e.jsx(sa,{altText:"Open destination bucket",asChild:!0,children:e.jsx("a",{href:d,target:"_blank",rel:"noopener noreferrer",children:"Open bucket"})}):void 0}),!R&&!D&&l(!1)}catch(I){if(I instanceof xt&&I.code==="bucket_authorization_required"){M();return}s({title:p?"Bucket copy partially completed":"Bucket copy failed",description:p?`${p} item${p===1?"":"s"} copied before the request failed. You can retry or use the CLI commands below.`:I instanceof xt&&typeof I.detail=="string"?I.detail:"Hugging Face could not complete the copy. You can still use the CLI commands below.",variant:"destructive"})}finally{C(!1),b(null)}},[M,u,d,o,t.isSignedIn,t.paperId,E,s,f]);m.useEffect(()=>{if(!k||!t.isSignedIn)return;$(!1),window.sessionStorage.removeItem(wt(t.paperId));const p=new URL(window.location.href);p.searchParams.delete(_t),window.history.replaceState({},"",`${p.pathname}${p.search}${p.hash}`),K()},[K,t.isSignedIn,t.paperId,k]);const G=()=>{_(new Set(a.map(p=>p.id))),!u&&t.suggestedBucketId&&g(t.suggestedBucketId),l(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"sidebar-card copy-to-bucket-card",children:[e.jsxs("button",{type:"button",className:"copy-to-bucket-trigger",onClick:G,children:[e.jsx("span",{className:"copy-to-bucket-arrow","aria-hidden":"true",children:"→"}),e.jsx("span",{className:"copy-to-bucket-title",children:"Copy to bucket"}),e.jsx("span",{className:"copy-to-bucket-new",children:"New"})]}),e.jsx("div",{className:"copy-to-bucket-meta",children:a.length?`${a.length} linked artifact${a.length===1?"":"s"}`:"No linked artifacts yet"})]}),e.jsx(ae,{open:n,onOpenChange:l,children:e.jsxs(re,{className:"max-h-[90vh] max-w-2xl grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden",children:[e.jsxs(ne,{children:[e.jsxs(ie,{className:"flex items-center gap-2",children:[e.jsx("span",{className:"copy-to-bucket-dialog-arrow","aria-hidden":"true",children:"→"}),"Copy to bucket"]}),e.jsx(oe,{children:"Keep your own copy of this paper's PDF, linked code, and Hugging Face artifacts. Hub repositories use Xet's server-side copy; GitHub repositories use the generated CLI fallback."})]}),e.jsx("div",{className:"-mx-6 min-h-0 overflow-y-auto px-6",children:a.length?e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ue,{children:"Choose your destination"}),e.jsxs(vt,{value:o,onValueChange:p=>i(p),className:"grid grid-cols-2 gap-2",children:[e.jsxs(ue,{className:"bucket-choice",children:[e.jsx(Re,{value:"new"}),"New bucket"]}),e.jsxs(ue,{className:"bucket-choice",children:[e.jsx(Re,{value:"existing"}),"Existing bucket"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ue,{htmlFor:"bucket-id",children:"Bucket name"}),e.jsx(W,{id:"bucket-id",value:u,onChange:p=>g(p.target.value),placeholder:t.suggestedBucketId||"username/paper-artifacts","aria-invalid":u.length>0&&!h}),e.jsxs("div",{className:"flex items-center justify-between gap-3 text-xs",children:[e.jsx("p",{className:"text-muted-foreground",children:"Use the full Hugging Face bucket ID: namespace/name."}),d&&e.jsxs("a",{href:d,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-1 underline underline-offset-4",children:["View bucket",e.jsx(V,{name:"external",size:10})]})]})]}),o==="new"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(ue,{children:"Bucket visibility"}),e.jsxs(vt,{value:f,onValueChange:p=>c(p),className:"flex gap-5",children:[e.jsxs(ue,{className:"flex items-center gap-2 font-normal",children:[e.jsx(Re,{value:"public"}),"Public"]}),e.jsxs(ue,{className:"flex items-center gap-2 font-normal",children:[e.jsx(Re,{value:"private"}),"Private"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(ue,{children:"Artifacts"}),e.jsx(L,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>_(v?new Set:new Set(a.map(p=>p.id))),children:v?"Deselect all":"Select all"})]}),e.jsx("div",{className:"bucket-artifact-list",children:a.map(p=>e.jsxs("div",{className:"bucket-artifact-row",children:[e.jsx(Ve,{id:`bucket-artifact-${p.id}`,checked:x.has(p.id),onCheckedChange:R=>A(p.id,R===!0)}),e.jsxs(ue,{htmlFor:`bucket-artifact-${p.id}`,className:"min-w-0 flex-1 cursor-pointer font-normal",children:[e.jsx("span",{className:"bucket-artifact-kind",children:tn[p.kind]}),e.jsx("span",{className:"bucket-artifact-name",children:p.label})]}),e.jsxs("a",{href:we(p.url)??void 0,target:"_blank",rel:"noopener noreferrer",className:"bucket-artifact-open",children:["Open",e.jsx(V,{name:"external",size:10})]})]},p.id))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The PDF and Hugging Face artifacts can be copied directly. GitHub repositories require the CLI workflow below."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ue,{htmlFor:"bucket-copy-commands",children:"CLI fallback"}),e.jsx("pre",{id:"bucket-copy-commands",className:"bucket-copy-commands h-[190px]",children:h?w:"Enter a bucket name above to prepare the copy commands."})]})]}):e.jsx("p",{className:"py-5 text-sm text-muted-foreground",children:"This paper does not have a linked GitHub repository or Hugging Face artifact to copy yet."})}),e.jsxs(de,{children:[e.jsx("a",{href:"https://huggingface.co/docs/huggingface_hub/en/guides/buckets",target:"_blank",rel:"noopener noreferrer",className:"mr-auto text-sm text-muted-foreground underline underline-offset-4",children:"About Hugging Face Buckets"}),e.jsxs(L,{type:"button",onClick:z,variant:"outline",disabled:!h||E.length===0,children:[e.jsx(V,{name:"copy",size:12}),"Copy commands"]}),e.jsx(L,{type:"button",onClick:K,disabled:j||t.isSignedIn&&(!h||!E.some(p=>p.kind!=="github")),children:j?S&&S.total>1?`Copying ${S.current}/${S.total}…`:"Copying…":t.isSignedIn?"Copy now":"Sign in & copy"})]})]})})]})}function hn({isLoading:t,papers:s}){return t?e.jsxs("div",{className:"sidebar-card","aria-busy":"true",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),e.jsx("div",{className:"related-meta",children:"Finding related work…"})]}):s!=null&&s.length?e.jsxs("div",{className:"sidebar-card",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),s.map(a=>e.jsxs(me,{to:`/paper/${a.arxiv_id||a.id}`,target:"_blank",rel:"noopener noreferrer",className:"related-paper",style:{textDecoration:"none",color:"inherit"},children:[e.jsx("div",{className:"related-title",children:e.jsx(qe,{title:a.title})}),e.jsxs("div",{className:"related-meta",children:[e.jsx("span",{children:a.arxiv_id?`arXiv:${a.arxiv_id}`:"External resource"}),a.citation_count!=null&&e.jsxs("span",{children:[a.citation_count.toLocaleString()," cites"]})]})]},a.id))]}):null}const pn=/(https?:\/\/[^\s]+)/g;function fn({size:t=12}){return e.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:e.jsx("path",{fill:"currentColor",d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})}function es(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function gn(t){return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function xn({text:t}){return e.jsx("p",{className:"x-thread-text",children:t.split(pn).map((s,a)=>a%2===1?e.jsx("span",{className:"x-thread-link",children:s.replace(/^https?:\/\/(www\.)?/,"").replace(/\/$/,"")},a):e.jsx(m.Fragment,{children:s},a))})}function bn({thread:t}){const[s,a]=m.useState(!1);return!t.author_avatar_url||s?e.jsx("span",{className:"x-thread-avatar x-thread-avatar--fallback","aria-hidden":"true",children:t.author_name.charAt(0).toUpperCase()}):e.jsx("img",{className:"x-thread-avatar",src:t.author_avatar_url,alt:"",loading:"lazy",referrerPolicy:"no-referrer",onError:()=>a(!0)})}function jn(){var t;return((t=window.matchMedia)==null?void 0:t.call(window,"(prefers-reduced-motion: reduce)").matches)??!1}function vn({thread:t}){const[s,a]=m.useState(!1),[r,n]=m.useState(null),[l,o]=m.useState(!1),i=m.useRef(null),{targetRef:u,isIntersecting:g}=Ta({rootMargin:"200px"}),f=t.video_url;if(m.useEffect(()=>{if(!f||r||l||!g||jn())return;const x=new AbortController;return fetch(f,{referrerPolicy:"no-referrer",signal:x.signal}).then(_=>{if(!_.ok)throw new Error(`HTTP ${_.status}`);return _.blob()}).then(_=>n(URL.createObjectURL(_))).catch(()=>{x.signal.aborted||o(!0)}),()=>x.abort()},[f,r,l,g]),m.useEffect(()=>()=>{r&&URL.revokeObjectURL(r)},[r]),m.useEffect(()=>{const x=i.current;x&&(g?x.play().catch(()=>{}):x.pause())},[g,r]),!t.media_url||s)return null;const c=r&&!l;return e.jsx("div",{className:"x-thread-media",ref:u,children:c?e.jsx("video",{ref:i,src:r,poster:t.media_url,muted:!0,loop:!0,playsInline:!0,autoPlay:!0,"aria-label":"Video",onError:()=>o(!0)}):e.jsxs(e.Fragment,{children:[e.jsx("img",{src:t.media_url,alt:"",loading:"lazy",referrerPolicy:"no-referrer",onError:()=>a(!0)}),t.media_type==="video"&&e.jsx("span",{className:"x-thread-play","aria-label":"Video",children:"▶"})]})})}function yn({thread:t}){const s=we(t.url);return s?e.jsxs("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"x-thread",children:[e.jsxs("div",{className:"x-thread-header",children:[e.jsx(bn,{thread:t}),e.jsxs("span",{className:"x-thread-author",children:[e.jsx("span",{className:"x-thread-name",children:t.author_name}),e.jsxs("span",{className:"x-thread-handle",children:["@",t.author_handle]})]}),e.jsx("span",{className:"x-thread-logo",children:e.jsx(fn,{})})]}),e.jsx(xn,{text:t.text}),e.jsx(vn,{thread:t}),e.jsxs("div",{className:"x-thread-meta",children:[t.posted_at&&e.jsx("time",{dateTime:t.posted_at,children:gn(t.posted_at)}),t.like_count!=null&&e.jsxs("span",{children:["♥ ",es(t.like_count)]}),t.reply_count!=null&&t.reply_count>0&&e.jsxs("span",{children:[es(t.reply_count)," ",t.reply_count===1?"reply":"replies"]}),e.jsx("span",{className:"x-thread-read",children:"Read on X →"})]})]}):null}function _n({onEdit:t,threads:s}){return e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"X threads"}),e.jsxs("span",{className:"badge",children:[s.length," post",s.length===1?"":"s",e.jsx("button",{type:"button",onClick:t,className:"edit-link",children:"edit"})]})]}),s.length>0?e.jsx("div",{className:"x-thread-list",children:s.map(a=>e.jsx(yn,{thread:a},a.tweet_id))}):e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",padding:"6px 0"},children:"No author threads linked yet."})]})}const ft=3,ts=3;function wn(t){return t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function kn({allHfArtifactUrls:t,citationCopied:s,citationDisplay:a,hfArtifactViewer:r,onCopyCitation:n,onEditHfArtifacts:l,onEditRepositories:o,onEditXThreads:i,paper:u,relatedIsLoading:g,relatedPapers:f,user:c}){var S;const[x,_]=m.useState(!1),j=[...u.repositories??[]].sort((b,k)=>Number(k.is_official)-Number(b.is_official)||(k.num_stars||0)-(b.num_stars||0)),C=(x?j:j.slice(0,ft)).map(b=>({...b,safeHref:we(b.url)}));return e.jsxs("aside",{className:"detail-sidebar",children:[e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"GitHub"}),e.jsxs("span",{className:"badge",children:[j.length," repo",j.length===1?"":"s",e.jsx("button",{type:"button",onClick:o,className:"edit-link",children:"edit"})]})]}),C.filter(({safeHref:b})=>b).map(b=>e.jsxs("a",{href:b.safeHref??void 0,target:"_blank",rel:"noopener noreferrer",className:"code-line",style:{textDecoration:"none"},children:[e.jsxs("span",{className:"code-line-repo",children:[e.jsx(V,{name:"github",size:12}),e.jsxs("span",{className:"code-line-repo-name",children:[b.owner,"/",b.name]}),b.is_official&&e.jsx("span",{className:"code-line-official",children:"· Official"})]}),e.jsxs("span",{className:"code-line-stars",children:["★ ",wn(b.num_stars)]})]},b.id)),j.length===0&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",padding:"6px 0"},children:"No GitHub repositories linked yet."}),j.length>ft&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>_(b=>!b),children:x?"− show top 3":`+ show ${j.length-ft} more repos`})]}),e.jsx(Nn,{viewer:r,onEdit:l}),e.jsx(_n,{threads:u.x_threads??[],onEdit:i}),e.jsx(mn,{githubUrls:j.map(({url:b})=>b),hfModelUrls:t.models,hfDatasetUrls:t.datasets,hfSpaceUrls:t.spaces,paperId:u.id,pdfName:((S=u.arxiv_id)==null?void 0:S.replace("/","-"))||u.id,pdfUrl:u.url_pdf,isSignedIn:!!c,suggestedBucketId:c?`${c.username}/${un(u.title)}`:void 0}),e.jsx(hn,{isLoading:g,papers:f}),e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"Citation"}),e.jsxs("button",{type:"button",className:"citation-copy-btn",onClick:n,"aria-label":"Copy citation to clipboard",title:"Copy citation to clipboard",children:[e.jsx(V,{name:"copy",size:11}),s?"Copied":"Copy"]})]}),e.jsx("pre",{style:{fontFamily:"var(--mono)",fontSize:10.5,lineHeight:1.5,color:"var(--ink-soft)",whiteSpace:"pre-wrap",wordBreak:"break-word",margin:0},children:a})]})]})}function Nn({onEdit:t,viewer:s}){return e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[s.paperHref?e.jsx("a",{href:s.paperHref,target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"none"},children:"🤗 Hugging Face"}):e.jsx("span",{children:"🤗 Hugging Face"}),e.jsx("button",{type:"button",onClick:t,className:"edit-link",children:"edit"})]}),s.isLoading?e.jsx(Ie,{className:"h-16 w-full"}):e.jsxs(e.Fragment,{children:[s.rows.map(a=>e.jsx(Cn,{...a},a.label)),s.footer&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:10,color:"var(--ink-faint)",marginTop:12},children:s.footer})]})]})}function Cn({count:t,href:s,isLimited:a,label:r,links:n}){const[l,o]=m.useState(!1),i=((n==null?void 0:n.length)??0)>ts,u=l?n:n==null?void 0:n.slice(0,ts),g=t!=null?`${t}${a?"+":""}`:"—";return e.jsxs("div",{className:"hf-artifact-row",children:[e.jsxs("div",{className:"hf-artifact-row-header",children:[e.jsx("span",{children:r}),t?e.jsx("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"hf-artifact-count",children:g}):e.jsx("span",{className:"hf-artifact-count hf-artifact-count--empty",children:g})]}),u!=null&&u.length?e.jsxs("div",{className:"hf-artifact-links",children:[u.map(f=>e.jsx("a",{href:f.href,target:"_blank",rel:"noopener noreferrer",children:f.label},f.href)),i&&e.jsx("button",{type:"button",className:"hf-artifact-toggle","aria-expanded":l,onClick:()=>o(f=>!f),children:l?"Show fewer":`View all ${n.length}`})]}):null]})}function Sn({abstract:t,mentions:s}){const a=[];let r=0;for(const n of[...s].sort((l,o)=>l.start-o.start))n.startt.length||t.slice(n.start,n.end)===n.surface&&(a.push(e.jsx(jt,{text:t.slice(r,n.start)},`t${r}`)),a.push(e.jsx(Ra,{entity:{kind:n.entity_type,slug:n.slug},className:"abstract-entity-link",newTab:!1,initialPreview:n.preview?{name:n.preview.name,description:n.preview.description??null,imageUrl:n.preview.image_url??null,count:n.preview.count??null,detail:n.preview.detail??null}:void 0,children:n.surface},`m${n.start}`)),r=n.end);return a.push(e.jsx(jt,{text:t.slice(r)},`t${r}`)),e.jsx(e.Fragment,{children:a})}function En(t,s){const a=t.arxiv_id?` (arXiv:${t.arxiv_id.replace(/v\d+$/i,"")})`:"";return`About the paper "${t.title}"${a}: ${s}`}function Pn({paper:t,readerChatRoute:s}){const a=aa()&&!!(t.id&&t.abstract),r=t.suggested_questions,{data:n}=te({queryKey:["paper-suggested-questions",t.id],queryFn:()=>Y.suggestedQuestions(String(t.id)),enabled:a&&Array.isArray(r)&&r.length===0,staleTime:o=>{var i;return(i=o.state.data)!=null&&i.questions.length?1/0:0},retry:!1}),l=r!=null&&r.length?r:(n==null?void 0:n.questions)??[];return!a||l.length===0?null:e.jsx("ul",{className:"suggested-questions","aria-label":"Ask about this paper",children:l.map(o=>{const i=s?`${s}?q=${encodeURIComponent(o)}`:`/chat?q=${encodeURIComponent(En(t,o))}`;return e.jsx("li",{children:e.jsxs(me,{className:"suggested-question",to:i,onClick:s?()=>us(s):void 0,children:[e.jsx(V,{name:"chat",size:12}),e.jsx("span",{children:o})]})},o)})})}function $n({canEdit:t,onEditMethods:s,onEditTasks:a,paper:r,readerChatRoute:n}){var i,u,g;const l=r.abstract||"",[o]=m.useState(()=>window.location.hash==="#tldr");return e.jsxs(e.Fragment,{children:[e.jsx(Me,{id:"abstract",label:"Abstract"}),e.jsx("p",{className:"abstract-text",children:(i=r.abstract_mentions)!=null&&i.length?e.jsx(Sn,{abstract:l,mentions:r.abstract_mentions}):e.jsx(jt,{text:l})}),r.tldr&&e.jsxs("details",{className:"tldr-details paper-section-anchor",id:"tldr",open:o,children:[e.jsxs("summary",{children:[e.jsx("span",{className:"tldr-toggle-show",children:"Show TL;DR"}),e.jsx("span",{className:"tldr-toggle-hide",children:"Hide TL;DR"}),e.jsx("span",{className:"tldr-toggle-hint",children:"short summary"})]}),e.jsx("div",{className:"tldr-box",children:r.tldr})]}),e.jsx(Pn,{paper:r,readerChatRoute:n}),e.jsx(Me,{id:"tasks",label:"Tasks",accent:e.jsxs("span",{className:"accent",children:[((u=r.tasks)==null?void 0:u.length)||0," tagged",t&&e.jsx("button",{type:"button",onClick:a,className:"edit-link",children:"edit"})]})}),e.jsx("div",{className:"paper-tags",style:{marginBottom:8},children:(r.tasks??[]).map(f=>e.jsx(ma,{slug:f.slug||"",label:f.name},f.id))}),e.jsx(Me,{id:"methods",label:"Methods",accent:e.jsxs("span",{className:"accent",children:[((g=r.methods)==null?void 0:g.length)||0," used",t&&e.jsx("button",{type:"button",onClick:s,className:"edit-link",children:"edit"})]})}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:8},children:(r.methods??[]).map(f=>e.jsx(ha,{method:f},f.id))})]})}const Se=["my-bookmark-ids"],kt="pwc:pending-bookmark";function ss(t){window.sessionStorage.setItem(kt,JSON.stringify(t)),window.location.assign(Ua(!0))}function Rn(){var r,n;const{user:t}=Ge(),s=te({queryKey:Se,queryFn:()=>bt.getBookmarkIds(),enabled:!!t,staleTime:60*1e3,refetchOnWindowFocus:!1}),a=Ke.useMemo(()=>{var l;return new Set(((l=s.data)==null?void 0:l.paper_ids)??[])},[(r=s.data)==null?void 0:r.paper_ids]);return{ids:((n=s.data)==null?void 0:n.paper_ids)??[],idSet:a,isLoading:s.isLoading,isError:s.isError}}function In(){const{user:t}=Ge(),s=ce(),a=ee({mutationFn:async({paperId:n,isBookmarked:l})=>{l?await bt.removeBookmark(n):await bt.addBookmark(n)},onMutate:async({paperId:n,isBookmarked:l})=>{await s.cancelQueries({queryKey:Se});const o=s.getQueryData(Se),i=typeof n=="string"?Number(n):n,u=(o==null?void 0:o.paper_ids)??[],g=l?u.filter(f=>f!==i):[i,...u.filter(f=>f!==i)];return s.setQueryData(Se,{paper_ids:g}),{previous:o}},onError:(n,l,o)=>{o!=null&&o.previous&&s.setQueryData(Se,o.previous),n instanceof xt&&n.code==="saved_papers_bucket_authorization_required"&&ss(l)},onSettled:()=>{s.invalidateQueries({queryKey:Se}),s.invalidateQueries({queryKey:[..._e.feeds.saved]})}});return Ke.useEffect(()=>{if(!t||a.isPending)return;const n=new URL(window.location.href);if(n.searchParams.get(Qt)!=="1")return;n.searchParams.delete(Qt),window.history.replaceState({},"",`${n.pathname}${n.search}${n.hash}`);const l=window.sessionStorage.getItem(kt);if(l){window.sessionStorage.removeItem(kt);try{const o=JSON.parse(l);(typeof o.paperId=="number"||typeof o.paperId=="string")&&typeof o.isBookmarked=="boolean"&&a.mutate(o)}catch{}}},[a,t]),{toggle:Ke.useCallback((n,l)=>{if(!t){if(ds())return;ss({paperId:n,isBookmarked:l});return}a.mutate({paperId:n,isBookmarked:l})},[a,t]),isPending:a.isPending}}const An=({paperId:t})=>{const{user:s}=Ge(),{idSet:a}=Rn(),{toggle:r,isPending:n}=In();if(ds())return null;const l=Number(t),o=!!s&&a.has(l),i=()=>{Number.isFinite(l)&&r(l,o)},u=s&&o?"Saved":"Save",g=s?o?"Remove from saved papers":"Save this paper":"Sign in with Hugging Face to save this paper";return e.jsxs("button",{type:"button",className:`action-btn${o?" is-saved":""}`,onClick:i,disabled:n,"aria-pressed":o,"aria-label":g,title:g,children:[e.jsx(V,{name:"bookmark",size:12}),u]})};function gt({children:t,showEdit:s=!1,onEdit:a,editAriaLabel:r}){return s?e.jsxs("span",{className:"action-btn-composite",children:[t,e.jsx("button",{type:"button",className:"action-btn-segment action-btn-edit",onClick:a,"aria-label":r,children:"edit"})]}):t}const Fn={tasks:"tasks",methods:"methods",results:"evaluation results",repositories:"GitHub repositories","project-pages":"project pages","hf-artifacts":"Hugging Face artifacts",organizations:"organizations","source-url":"source URL","x-threads":"X threads"};function as(t){if(!t)return"—";try{return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function rs(t,s){try{const a=new URL(t),n=a.pathname.replace(/\/$/,"").split("/").filter(Boolean).at(-1);return n?n.replace(/[-_]+/g," "):a.hostname.replace(/^www\./,"")}catch{return s}}const Ci=()=>{const{arxivId:t}=ra(),s=ns(),{toast:a}=se(),{user:r}=Ge(),n=(r==null?void 0:r.is_admin)??!1,l=!!r,o=qa(r),{arxivId:i,evaluations:u,evaluationsByTask:g,evaluationsLoading:f,paper:c,paperError:x,paperLoading:_,presentation:j,refetchEvaluations:C,refetchPaper:S,relatedQuery:b,versions:k,visibleEvaluations:$}=rr(t,o),[E,v]=m.useState(!1),{activeEditor:d,openEditor:h,setEditorOpen:w}=or();m.useEffect(()=>{o!=="direct"||!(c!=null&&c.id)||(d&&d!=="results"&&Y.primeCurationState(c.id).catch(()=>{}),d==="results"&&Xe.primeCurationState(c.id).catch(()=>{}))},[d,o,c==null?void 0:c.id]);const[A,z]=m.useState(null),M=m.useRef(!1);m.useEffect(()=>{if(!r||!c||M.current)return;const P=sessionStorage.getItem("pwc:fresh-auth-edit");if(!P)return;M.current=!0;const O=ir(P);if(!Y.freshAuthMutationDraft()){sessionStorage.removeItem("pwc:fresh-auth-edit"),O&&h(O);return}if(!window.confirm("You signed in again. Apply the saved destructive catalog edit now? The server will recheck the current catalog version before changing anything.")){a({title:"Edit kept locally",description:"Nothing was changed. Reload this paper when you are ready to confirm the saved edit."});return}Y.resumeFreshAuthMutation().then(()=>{a({title:"Edit applied",description:"The restored catalog edit was applied."}),window.location.reload()}).catch($e=>{a({variant:"destructive",title:"Could not apply the saved edit",description:$e instanceof Error?$e.message:"Please reload and review the edit again."})})},[h,c,a,r]);const K=m.useMemo(()=>{if(!r||!(c!=null&&c.author_links))return!1;const P=r.username.toLowerCase();return c.author_links.some(O=>!!O.hf_username&&O.hf_username.toLowerCase()===P)},[r,c==null?void 0:c.author_links]),G=P=>{if(!l){z(P);return}h(P)},[p,R]=m.useState("idle"),[I,U]=m.useState(null),[D,H]=m.useState(null),q=async()=>{if(i){R("indexing"),U(null),H(null);try{await Y.indexFromArxiv(i),a({title:"Indexed",description:"Paper added to database."}),setTimeout(()=>S(),1200),R("idle")}catch(P){const O=P;let be=O.message||"Failed to index paper";if(O.response)try{be=JSON.parse(O.response).detail||be}catch{be=O.response}U(be),(O.status===429||O.status===503)&&H("Try again later after arXiv has lifted the temporary limit."),R("idle")}}},J=(j==null?void 0:j.citationCopy)??"",Z=(j==null?void 0:j.copyableRanks)??[],[Ye,De]=m.useState(!1),ye=async()=>{if(J)try{await navigator.clipboard.writeText(J),De(!0),a({title:"Citation copied",description:"BibTeX entry copied to clipboard."}),window.setTimeout(()=>De(!1),1500)}catch{a({title:"Copy failed",description:"Could not access the clipboard. Please copy manually.",variant:"destructive"})}},y=async()=>{if(!c)return;const P=c.arxiv_id||c.id,O=Oa(P,Z);if(O)try{await navigator.clipboard.writeText(O),a({title:"PwC badges copied",description:"Each badge follows its current leaderboard result."})}catch{a({title:"Copy failed",description:"Could not access the clipboard. Please try again.",variant:"destructive"})}};if(_)return e.jsxs("div",{className:"page",children:[e.jsx(Ie,{className:"h-12 w-3/4 mb-4"}),e.jsx(Ie,{className:"h-6 w-1/3 mb-8"}),e.jsx(Ie,{className:"h-64 w-full"})]});if(x||!c)return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(me,{to:"/papers",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsxs("span",{style:{color:"var(--ink)"},children:["arXiv:",i]})]}),e.jsx("h1",{className:"detail-title",children:"Paper not indexed yet"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:16,maxWidth:640},children:["We don't have ",e.jsxs("span",{style:{fontFamily:"var(--mono)"},children:["arXiv:",i]})," in the database. You can index it from arXiv right now."]}),I&&e.jsx(ka,{variant:"destructive",className:"mt-4 max-w-xl",children:e.jsxs(Na,{children:[e.jsx("div",{children:I}),D&&e.jsx("div",{className:"mt-2",children:D})]})}),e.jsxs("div",{className:"action-row",children:[n&&e.jsxs("button",{className:"action-btn",onClick:q,disabled:p==="indexing",children:[e.jsx(V,{name:"sparkle",size:12}),p==="indexing"?"Indexing…":"Index from arXiv"]}),e.jsx(L,{variant:"outline",onClick:()=>s("/papers"),children:"Browse Papers"})]})]});if(!j)return null;const{allHfArtifactUrls:N,authorEntries:F,citationDisplay:T,hasIntroducedItems:Q,hasLineageItems:X,hfArtifactViewer:B,introducedBenchmarks:Ms,introducedFrameworks:It,introducedMethods:Os,introducedSummary:Ks,numPages:At,paperSourceLabel:Ft,predecessorPapers:Je,projectPages:Ee,safeAbstractUrl:Be,safeConferenceUrl:Lt,safePdfUrl:Tt,successorPapers:Ze}=j,ze=12,Pe=va(c,i),Gs=Pe&&zt()&&na()&&(!Ht()||n)?Pe:null,Ut=c.organizations||[],Dt=P=>{const O=Da(P)??P.name;return e.jsx(me,{to:`/orgs/${P.slug}`,className:`detail-title-org${P.logo_url?" detail-title-org--logo":""}`,title:P.name,"aria-label":P.name,children:P.logo_url?e.jsx("img",{src:P.logo_url,alt:"",onError:be=>{var $e;($e=be.currentTarget.parentElement)==null||$e.classList.remove("detail-title-org--logo"),be.currentTarget.replaceWith(O)}}):O},P.id)},Bt=E||F.length<=ze?F:F.slice(0,ze);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(me,{to:"/",children:"Trending"}),e.jsx("span",{className:"sep",children:"/"}),c.arxiv_id&&Be?e.jsxs("a",{className:"breadcrumb-external",href:Be,target:"_blank",rel:"noopener noreferrer",title:"Open on arXiv",children:[Ft,e.jsx("span",{"aria-hidden":"true",children:"↗"})]}):e.jsx("span",{children:Ft})]}),e.jsxs("div",{className:"detail-grid",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"detail-hero",children:[e.jsxs("div",{className:"detail-hero-main",children:[e.jsxs("h1",{className:"detail-title",children:[e.jsx(qe,{title:c.title}),Ut.slice(0,-1).map(Dt),e.jsxs("span",{className:"detail-title-tail",children:[Ut.slice(-1).map(Dt),e.jsx("button",{type:"button",className:"detail-title-edit",onClick:()=>G("organizations"),title:"Edit organizations","aria-label":"Edit organizations",children:e.jsx(V,{name:"pencil",size:11})})]})]}),e.jsxs("div",{className:"detail-meta",children:[e.jsxs("span",{children:["Submitted ",as(c.published)]}),At&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[At," pages"]})]}),c.citation_count!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[c.citation_count.toLocaleString()," citations"]})]}),(c.proceeding||c.conference_slug)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),c.conference_slug?e.jsx("a",{href:`/conferences/${c.conference_slug}`,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:(c.proceeding||c.conference_name||"").replace(/\s+\d{1,2}$/,"")}):e.jsx("span",{children:c.proceeding.replace(/\s+\d{1,2}$/,"")})]}),k.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("select",{className:"version-select",value:c.version,onChange:P=>{const O=P.target.value;c.arxiv_id&&s(`/paper/${c.arxiv_id.replace(/v\d+$/,"")}${O?`?version=${O}`:""}`)},children:k.map(P=>e.jsxs("option",{value:P.version,children:[P.version," — ",as(P.published)]},P.version))})]})]}),e.jsxs("div",{className:"detail-authors",children:[Bt.map((P,O)=>e.jsxs(Ke.Fragment,{children:[P.hf_username&&e.jsx(Ba,{className:"detail-author-avatar",url:P.hf_avatar_url}),P.id?e.jsx(me,{to:`/authors/${P.id}`,children:P.name}):P.hf_username?e.jsx("a",{href:`https://huggingface.co/${P.hf_username}`,target:"_blank",rel:"noopener noreferrer",title:`@${P.hf_username} on Hugging Face`,children:P.name}):e.jsx("a",{children:P.name}),Oze&&e.jsx("button",{className:"show-more-authors",onClick:()=>v(P=>!P),style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",fontFamily:"var(--mono)",fontSize:12},children:E?"show fewer":`+${c.authors.length-ze} more`})]}),e.jsxs("div",{className:"action-row",children:[Pe&&zt()&&(!Ht()||r!=null&&r.is_admin)?e.jsxs(me,{className:"action-btn",to:Pe,onClick:()=>us(Pe),children:[e.jsx(V,{name:"pdf",size:12})," Read paper",e.jsx("span",{className:"nav-new-badge","aria-hidden":"true",children:"New"})]}):Tt?e.jsxs("a",{className:"action-btn",href:Tt,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(V,{name:"pdf",size:12})," View PDF"]}):null,Be&&c.source==="external"&&e.jsx(gt,{showEdit:!0,onEdit:()=>G("source-url"),editAriaLabel:"Edit source URL",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:Be,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(V,{name:"external",size:12})," Source page"]})}),Ee.length===1?e.jsx(gt,{showEdit:!0,onEdit:()=>G("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:Ee[0].safeHref??void 0,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(V,{name:"globe",size:12})," Project page"]})}):null,Ee.length>1?e.jsx(gt,{showEdit:!0,onEdit:()=>G("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs(ia,{children:[e.jsx(oa,{asChild:!0,children:e.jsxs("button",{type:"button",className:"action-btn-segment action-btn-main",children:[e.jsx(V,{name:"globe",size:12})," Project page"]})}),e.jsx(la,{align:"start",className:"project-page-menu",children:Ee.map((P,O)=>e.jsx(ca,{asChild:!0,children:P.safeHref?e.jsx("a",{href:P.safeHref,target:"_blank",rel:"noopener noreferrer",children:rs(P.url,`Project page ${O+1}`)}):e.jsx("span",{children:rs(P.url,`Project page ${O+1}`)})},P.url))})]})}):null,Ee.length===0&&l?e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>G("project-pages"),title:"Add project page",children:[e.jsx(V,{name:"globe",size:12})," Add project page"]}):null,Lt&&e.jsxs("a",{className:"action-btn",href:Lt,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(V,{name:"external",size:12})," Conference"]}),e.jsx(lr,{paperId:Number(c.id)}),n&&da()&&e.jsx(Es,{kind:"enrich-paper",triggerClassName:"action-btn",paperId:Number(c.id),paperTitle:c.title,onComplete:()=>void S()}),e.jsx(An,{paperId:c.id})]}),c.leaderboard_ranks&&c.leaderboard_ranks.length>0&&e.jsx(pa,{wrap:!0,paperHref:`/paper/${c.arxiv_id||c.id}`,ranks:ja(c.leaderboard_ranks)})]}),e.jsx("div",{className:"detail-hero-thumb detail-thumb-wrap",children:e.jsx(fa,{paperId:c.arxiv_id||c.id,title:c.title,thumbnailUrl:ua(c.thumbnail_url),priority:!0})})]}),Q&&e.jsxs("div",{className:`introduced-banner${It.length>0?" introduced-banner--framework":""}`,children:[e.jsx("span",{className:"introduced-label",children:"Introduced"}),e.jsxs("div",{className:"introduced-methods",children:[Os.map(P=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>s(`/methods/${P.slug||P.id}`),children:[P.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`method-${P.id}`)),Ms.map(P=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>s(`/benchmark/${P.slug||P.id}`),children:[P.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`benchmark-${P.id}`)),It.map(P=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>s(`/frameworks#framework-${P.slug}`),children:[P.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`framework-${P.slug}`))]}),e.jsxs("span",{className:"introduced-note",children:["This paper is the canonical source for ",Ks,"."]})]}),X&&e.jsxs("div",{className:"introduced-banner lineage-banner",children:[Ze.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:Ze.length===1?"Follow-up paper":"Follow-up papers"}),e.jsx("div",{className:"introduced-methods",children:Ze.map(P=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>s(`/paper/${P.route_identifier}`),children:[e.jsx(qe,{title:P.title}),e.jsx("span",{className:"introduced-arrow",children:"→"})]},`successor-${P.id}`))})]}),Je.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:Je.length===1?"Predecessor paper":"Predecessor papers"}),e.jsx("div",{className:"introduced-methods",children:Je.map(P=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>s(`/paper/${P.route_identifier}`),children:[e.jsx("span",{className:"introduced-arrow lineage-arrow-back",children:"←"}),e.jsx(qe,{title:P.title})]},`predecessor-${P.id}`))})]})]}),e.jsx($n,{canEdit:!0,onEditMethods:()=>G("methods"),onEditTasks:()=>G("tasks"),paper:c,readerChatRoute:Gs}),e.jsx(Or,{canCopyBadge:Z.length>0,canEdit:!0,evaluationsByTask:g,evaluationsLoading:f,isAdmin:n,onCopyBadge:y,onEdit:()=>G("results"),onRefresh:()=>void C(),paper:c,visibleEvaluationCount:($==null?void 0:$.length)??0})]}),e.jsx(kn,{allHfArtifactUrls:N,citationCopied:Ye,citationDisplay:T,hfArtifactViewer:B,onCopyCitation:ye,onEditHfArtifacts:()=>G("hf-artifacts"),onEditRepositories:()=>G("repositories"),onEditXThreads:()=>G("x-threads"),paper:c,relatedIsLoading:b.isLoading,relatedPapers:b.data,user:r})]}),e.jsx(Hr,{activeEditor:d,arxivId:i,editSubmitMode:o,evaluations:u??[],isAdmin:n,isLinkedAuthor:K,onOpenChange:w,paper:c}),e.jsx($a,{open:A!==null,onOpenChange:P=>{P||z(null)},sectionLabel:A?Fn[A]:"this paper",returnTo:typeof window<"u"?window.location.pathname:"/"})]})};export{Ci as default}; diff --git a/assets/PaperDetailView-rFgkO-hW.js b/assets/PaperDetailView-rFgkO-hW.js deleted file mode 100644 index a5744235bf8ca23c527564dd906d8ed062c083c9..0000000000000000000000000000000000000000 --- a/assets/PaperDetailView-rFgkO-hW.js +++ /dev/null @@ -1,29 +0,0 @@ -import{n as kt,o as Ks,c as as,p as ee,q as Gs,r as m,j as e,C as me,f as he,s as fe,P as rs,t as Ne,v as ns,w as Le,x as Ae,y as is,z as Nt,B as Oe,X as Ct,L as ue,D as Xs,E as Qs,R as Vs,I as Ws,F as os,G as Ys,J as Js,T as Zs,A as gt,g as ea,a as Ge,K as Ke,M as xt,i as ls,u as ta,N as Bt,O as sa,m as zt,Q as aa,S as ra,U as na,V as ia,W as oa}from"./index-CqKcHUvZ.js";import{I as V,T as la,M as ca,S as da,a as ua}from"./components-Dmnn5Z5p.js";import{L as Me,a as bt}from"./LatexTitle-BI9yl-Fo.js";import{e as Xe,C as ma,E as ha}from"./ExternalSourceEvalBadge-TyFEU7vd.js";import{p as _e,a as Y}from"./papers-bE3C_Qzl.js";import{s as pa,a as fa}from"./colors-_scCXfCe.js";import{r as cs,p as ga}from"./paperReader-BIpQD5HO.js";import{u as ie}from"./useQuery-Cngk7eL9.js";import{b as xa}from"./usePapers-By3yMmMn.js";import{f as ba,D as ja}from"./latexPlainText-DI8YEXVe.js";import{s as we}from"./safeExternalHref-CkBrsh84.js";import{S as Ie}from"./skeleton-DleNhBYA.js";import{A as va,a as ya}from"./alert-Z2yFUcyL.js";import{B as L}from"./button-BYn4yUH_.js";import{D as te,a as se,c as ae,b as re,d as ne,e as le}from"./dialog-B-oqHDuH.js";import{A as _a,a as wa}from"./AgentLogos-ClqC1BaK.js";import{C as ka}from"./copy-D9WKw0Bi.js";import{I as W}from"./input-sw0Ix0Sa.js";import{S as Ht}from"./searchable-select-DY1KXMvg.js";import{u as ce}from"./useMutation-BItMAQ7s.js";import{c as ke}from"./catalog-D26nGNnK.js";import{s as pe,p as Na}from"./submissions-1aHdBaSr.js";import{i as ds,a as us,r as ve}from"./queryInvalidation-fI4V8eHx.js";import{r as Mt,e as qt}from"./evaluationQueryInvalidation-B16EDNu-.js";import{S as Et,L as de,a as Ca}from"./SignInToEditDialog-B4COuqpY.js";import{L as oe}from"./loader-circle-CZgakNH7.js";import{T as Te,n as et,g as Ot,C as Ea}from"./CatalogEntityPreviewLink-BWMEEf81.js";import{D as Sa}from"./database-DrVmdfNa.js";import{P as De}from"./plus-DZF-NxR0.js";import{u as ms}from"./index-C8IgDsSE.js";import{S as Fe}from"./search-9n8Usynh.js";import{B as hs}from"./badge-D-oq0Pkj.js";import{G as Kt}from"./globe-6Eu_W8am.js";import{G as Gt}from"./github-sUmGdHig.js";import{c as Pa,g as $a,s as Ra,a as Ia,b as Aa,d as Fa,A as La,i as Ta,e as Da}from"./codexAddEvals-BaTB12JK.js";import{M as Ua}from"./index-CqELxJb0.js";import{r as Ba}from"./index-DBHj7UWg.js";import{u as za}from"./useIntersectionObserver-CiBk_Oug.js";import{S as Xt,s as Ha}from"./savedPapersAuth-BzEAZw7z.js";import{o as Ma}from"./organizationNames-BVKzYEBp.js";import{A as qa}from"./AuthorAvatar-CWCqOa0h.js";import"./hover-card-BTsA69o8.js";import"./useInfiniteQuery-lxaMAHEu.js";import"./popover-BcoS9Jmp.js";import"./textarea-CQToxq8k.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 Oa=kt("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ka=kt("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** - * @license lucide-react v0.462.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ps=kt("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);function Ga(t){return t!=null&&t.can_directly_edit_catalog?"direct":"pending"}function Xa(t){return(t??[]).filter(s=>!!(s.dataset_slug&&s.task_slug))}function Qa(t,s,a="https://paperswithcode.co"){return s.map(r=>{const n=encodeURIComponent(r.evaluation_id),c=`${a}/api/v1/papers/${encodeURIComponent(t)}/leaderboard-badge.svg?eval=${n}&live=1`,o=`${a}/api/v1/papers/${encodeURIComponent(t)}/leaderboard-badge-link?eval=${n}`;return`[![${`Papers with Code: ${r.best_rank===1?"SOTA":`#${r.best_rank}`} on ${r.dataset_name}`}](${c})](${o})`}).join(` -`)}function Va(t,s=!0){return ie({queryKey:["evaluations","paper",t],queryFn:()=>{if(!t)throw new Error("Paper ID is required");return Xe.byPaper(t)},enabled:s&&!!t,staleTime:0,refetchOnMount:"always"})}const fs=t=>t.replace(/v\d+$/,""),Wa={models:"https://huggingface.co/",datasets:"https://huggingface.co/datasets/",spaces:"https://huggingface.co/spaces/"},tt=(t,s)=>{const a=(t[s]||[]).length;return a<100?{count:a,isLimited:!1}:{count:a,isLimited:!0}},st=(t,s)=>{const a=t[s];return Array.isArray(a)?a.map(r=>{if(typeof r=="string")return r;if(r&&typeof r=="object"){const n=r;return n.id||n.repoId||null}return null}).filter(r=>!!r).map(r=>`${Wa[s]}${r}`):[]},Ya=async t=>{try{return(await fetch(`https://huggingface.co/api/papers/${fs(t)}`)).ok}catch{return!1}},Ja=async t=>{const s=fs(t),[a,r]=await Promise.all([fetch(`https://huggingface.co/api/arxiv/${s}/repos`).then(async i=>i.ok?i.json():(console.warn(`Failed to fetch repos for arXiv:${s}, status: ${i.status}`),null)).catch(i=>(console.warn(`Failed to fetch repos for arXiv:${s}:`,i),null)),Ya(s)]);if(!a)return{models:0,datasets:0,spaces:0,modelUrls:[],datasetUrls:[],spaceUrls:[],isLimited:!1,paperExists:r};const n=tt(a,"models"),c=tt(a,"datasets"),o=tt(a,"spaces");return{models:n.count,datasets:c.count,spaces:o.count,modelUrls:st(a,"models"),datasetUrls:st(a,"datasets"),spaceUrls:st(a,"spaces"),isLimited:n.isLimited||c.isLimited||o.isLimited,paperExists:r}},Za=t=>ie({queryKey:["huggingface-repos",t],queryFn:()=>Ja(t),enabled:!!t,staleTime:10*60*1e3,retry:1});function er(t,s){try{const a=new URL(t),r=a.pathname.split("/").filter(Boolean);return(r[0]==="datasets"||r[0]==="spaces")&&r.shift(),r.slice(0,2).join("/")||a.hostname.replace(/^www\./,"")}catch{return s}}function at(t,s,a){return[...new Set([...t,...s??[]])].map(r=>({href:r,label:er(r,a)}))}function rt(t,s,a){if(a==null&&t.length===0&&!(s!=null&&s.length))return;const r=new Set([...t,...s??[]]);return Math.max(r.size,a??0)}function nt(t,s){if(!(t==null&&s==null))return Math.max(t??0,s??0)}function it(t){return t[0]??"https://huggingface.co"}function ot(t,s){return s[0]??t}function tr(t){const s=`${t.title.slice(0,60)}${t.title.length>60?"…":""}`,a=`${t.authors[0]||""}${t.authors.length>1?" et al.":""}`,r=t.authors.join(" and "),n=(t.published||"").slice(0,4)||"—",c=(o,i)=>t.arxiv_id?`@article{${t.arxiv_id.replace(".","")}, - title={{${o}}}, - author=${i}, - year={{${n}}}, - eprint={{${t.arxiv_id}}}, - archivePrefix={{arXiv}} -}`:`@misc{paper${t.id}, - title={{${o}}}, - author=${i}, - year={{${n}}}, - url={{${t.source_url||t.url_abs||""}}} -}`;return{citationDisplay:c(s,`{{${a}}}`),citationCopy:c(t.title,`{${r}}`)}}function sr(t,s,a){var _,S,w,R;const r={models:t.hf_models??[],datasets:t.hf_datasets??[],spaces:t.hf_spaces??[]},n=t.linked_hf_artifacts,c=t.hf_artifact_summary,o={models:[...(s==null?void 0:s.modelUrls)??[],...(n==null?void 0:n.models)??[]],datasets:[...(s==null?void 0:s.datasetUrls)??[],...(n==null?void 0:n.datasets)??[]],spaces:[...(s==null?void 0:s.spaceUrls)??[],...(n==null?void 0:n.spaces)??[]]},i={models:nt(s==null?void 0:s.models,c==null?void 0:c.model_count),datasets:nt(s==null?void 0:s.datasets,c==null?void 0:c.dataset_count),spaces:nt(s==null?void 0:s.spaces,c==null?void 0:c.space_count)},l={models:at(r.models,o.models,"Model"),datasets:at(r.datasets,o.datasets,"Dataset"),spaces:at(r.spaces,o.spaces,"Space")},g={models:l.models.map(({href:C})=>C),datasets:l.datasets.map(({href:C})=>C),spaces:l.spaces.map(({href:C})=>C)},f=((_=t.arxiv_id)==null?void 0:_.replace(/v\d+$/,""))??null,d=t.arxiv_id?{isLoading:a,paperHref:`https://huggingface.co/papers/${f}`,rows:[{label:"Models",href:ot(`https://huggingface.co/models?other=arxiv:${t.arxiv_id}`,r.models),count:rt(r.models,o.models,i.models),isLimited:s==null?void 0:s.isLimited,links:l.models},{label:"Datasets",href:ot(`https://huggingface.co/datasets?other=arxiv:${t.arxiv_id}`,r.datasets),count:rt(r.datasets,o.datasets,i.datasets),isLimited:s==null?void 0:s.isLimited,links:l.datasets},{label:"Spaces",href:ot(`https://huggingface.co/papers/${f}`,r.spaces),count:rt(r.spaces,o.spaces,i.spaces),isLimited:s==null?void 0:s.isLimited,links:l.spaces}],footer:`Cite arxiv.org/abs/${f} in a HF README to link it here.`}:{isLoading:!1,paperHref:null,rows:[{label:"Models",href:it(r.models),count:r.models.length,links:l.models},{label:"Datasets",href:it(r.datasets),count:r.datasets.length,links:l.datasets},{label:"Spaces",href:it(r.spaces),count:r.spaces.length,links:l.spaces}],footer:null},x=(t.methods??[]).filter(({source_paper_id:C})=>C===t.id),v=t.introduced_benchmarks??[],j=t.introduced_frameworks??[],k=[x.length&&(x.length===1?"this method":"these methods"),v.length&&(v.length===1?"this benchmark":"these benchmarks"),j.length&&(j.length===1?"this framework":"these frameworks")].filter(C=>!!C);return{...tr(t),allHfArtifactUrls:g,authorEntries:t.authors.map((C,b)=>{var u,h,E,F,z,q;return{name:C,id:((h=(u=t.author_links)==null?void 0:u[b])==null?void 0:h.id)??null,hf_username:((F=(E=t.author_links)==null?void 0:E[b])==null?void 0:F.hf_username)??null,hf_avatar_url:((q=(z=t.author_links)==null?void 0:z[b])==null?void 0:q.hf_avatar_url)??null}}),copyableRanks:Xa(t.leaderboard_ranks),hasIntroducedItems:k.length>0,hasLineageItems:!!((S=t.predecessor_papers)!=null&&S.length||(w=t.successor_papers)!=null&&w.length),hfArtifactViewer:d,hfPaperExists:!!(s!=null&&s.paperExists),introducedBenchmarks:v,introducedFrameworks:j,introducedMethods:x,introducedSummary:k.join(" and "),numPages:t.num_pages||null,paperSourceLabel:t.arxiv_id?`arXiv:${t.arxiv_id}`:"External resource",predecessorPapers:t.predecessor_papers??[],projectPages:((R=t.project_pages)==null?void 0:R.filter(({url:C})=>C).map(C=>({...C,safeHref:we(C.url)})))??[],repoSummary:pa(t.repositories),safeAbstractUrl:we(t.url_abs),safeConferenceUrl:we(t.conference_url_abs),safePdfUrl:we(t.url_pdf),successorPapers:t.successor_papers??[]}}const ar=["tldr","abstract","tasks","methods","results"];function rr(t){if(!t)return{section:null,resultsTaskSlug:null};const[s,a]=t.split("?",2);if(!ar.includes(s))return{section:null,resultsTaskSlug:null};const r=s;return r!=="results"||!a?{section:r,resultsTaskSlug:null}:{section:r,resultsTaskSlug:new URLSearchParams(a).get("task")}}const gs=t=>`results-task-${t}`,nr=t=>`#results?task=${encodeURIComponent(t)}`;function ir(t,s){return t&&!!s}function or({direct:t,paperId:s,refetchEvaluations:a,refetchPaper:r}){r(),a(),!(!t||!s)&&(Y.primeCurationState(s,!0).catch(()=>{}),Xe.primeCurationState(s,!0).catch(()=>{}))}function lr(t,s){const a=t?Ks(t):"",r=as(),{toast:n}=ee(),{preferences:c}=Gs(),o=xa(a,!!a),i=o.data,[l,g]=m.useState(!1);m.useEffect(()=>{!t||t===a||r(`/paper/${a}${window.location.search}${window.location.hash}`,{replace:!0})},[a,r,t]),m.useEffect(()=>{if(i!=null&&i.title)return document.title=i.page_title||ba(i.title),()=>{document.title=ja}},[i==null?void 0:i.page_title,i==null?void 0:i.title]),m.useEffect(()=>{if(g(!1),!(i!=null&&i.id))return;const C=window.setTimeout(()=>g(!0),0);return()=>window.clearTimeout(C)},[i==null?void 0:i.id]);const f=ir(l,i==null?void 0:i.id),d=Za(l?i==null?void 0:i.arxiv_id:void 0),x=Va(i==null?void 0:i.id,f),v=ie({queryKey:[..._e.feeds.versions,i==null?void 0:i.arxiv_id],queryFn:()=>Y.versions(i.arxiv_id.replace(/v\d+$/,"")),enabled:f&&!!(i!=null&&i.arxiv_id),staleTime:10*60*1e3}),j=ie({queryKey:[..._e.feeds.related,i==null?void 0:i.id],queryFn:()=>Y.related(i.arxiv_id||i.id,4),enabled:f,staleTime:10*60*1e3});m.useEffect(()=>{const C=()=>{or({direct:s==="direct",paperId:i==null?void 0:i.id,refetchEvaluations:x.refetch,refetchPaper:o.refetch}),n({title:"This section changed",description:"The latest state has been reloaded. Review your changes before submitting again.",variant:"destructive"})};return window.addEventListener("pwc:catalog-conflict",C),()=>window.removeEventListener("pwc:catalog-conflict",C)},[s,x.refetch,i==null?void 0:i.id,o.refetch,n]);const k=m.useMemo(()=>{const C=x.data;return!C||!c.hide_closed_source_evals?C:C.filter(b=>b.is_open!==!1)},[x.data,c.hide_closed_source_evals]),_=m.useMemo(()=>{if(!k)return[];const C=new Map;for(const b of k){const u=C.get(b.task_id);u?u.rows.push(b):C.set(b.task_id,{taskId:b.task_id,taskName:b.task_name||"—",taskSlug:b.task_slug,rows:[b]})}return[...C.values()]},[k]),S=m.useMemo(()=>_.map(({taskSlug:C})=>C??"").join("|"),[_]),w=m.useMemo(()=>i?sr(i,d.data,d.isLoading):null,[d.data,d.isLoading,i]),R=m.useRef(!1);return m.useEffect(()=>{R.current=!1},[a]),m.useEffect(()=>{let C=0;const b=(h=!1,E=!1)=>{const{section:F,resultsTaskSlug:z}=rr(window.location.hash.slice(1));if(!F||!i||F==="tldr"&&!i.tldr||F==="results"&&(!f||x.isLoading)||!h&&R.current)return;let q=F==="results"&&z?document.getElementById(gs(z)):document.getElementById(F);if(!q&&F==="results"&&z){if(_.some(({taskSlug:K})=>K===z))return;q=document.getElementById("results")}q&&(C=window.requestAnimationFrame(()=>{R.current=!0,q.scrollIntoView({block:"start",behavior:E?"smooth":"auto"})}))};b();const u=()=>{R.current=!1,b(!0,!0)};return window.addEventListener("hashchange",u),()=>{window.removeEventListener("hashchange",u),C&&window.cancelAnimationFrame(C)}},[_,x.isLoading,i,S,f]),{arxivId:a,evaluations:x.data,evaluationsByTask:_,evaluationsLoading:x.isLoading,hfLoading:d.isLoading,hfRepos:d.data,paper:i,paperError:o.error,paperLoading:o.isLoading,presentation:w,refetchEvaluations:x.refetch,refetchPaper:o.refetch,relatedQuery:j,versions:v.data??[],visibleEvaluations:k}}const cr={tasks:"tasks",methods:"methods",evaluations:"results",repositories:"repositories",project_pages:"project-pages",hf_artifacts:"hf-artifacts",organizations:"organizations",source_url:"source-url",x_threads:"x-threads"};function dr(t){return cr[t]??null}function ur(){const[t,s]=m.useState(null),a=m.useCallback(n=>{s(n)},[]),r=m.useCallback((n,c)=>{s(o=>c?n:o===n?null:o)},[]);return{activeEditor:t,openEditor:a,setEditorOpen:r}}function mr({paperId:t}){const[s,a]=m.useState(!1),[r,n]=m.useState(!1),[c,o]=m.useState(!1),i=`Help me edit https://paperswithcode.co/paper/${t} using the public pwc CLI from https://github.com/huggingface/pwc-cli. Install or update the CLI following its README, then run pwc skills add to load its instructions. Run pwc auth login --paper ${t}; I will authorize this paper in my browser. Export with pwc paper edit export ${t} --output edits.json, make explicit operations for the corrections I request, and preview before submitting. For organization changes, use an organizations operation with payload {"organization_ids": [existing organization IDs]}; this replaces the paper’s organization links and publishes directly. Use existing organizations, benchmark and metric definitions, preserve unrelated entries, and cite source URLs where available. Never print or copy credentials. Ask me what to change if I have not specified it.`;return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"action-btn",title:"Edit this paper page with Claude, Codex, Cursor, or OpenCode",onClick:()=>{a(!1),n(!1),o(!0)},children:["Edit with your agent",e.jsx(_a,{})]}),e.jsx(te,{open:c,onOpenChange:o,children:e.jsxs(se,{className:"max-w-2xl",children:[e.jsxs(ae,{children:[e.jsx(re,{children:"Edit this paper with your agent"}),e.jsx(ne,{children:"Spotted a missing code link, a wrong task, or a missing benchmark result? Your favorite coding agent can fix it for you."})]}),e.jsx(wa,{}),e.jsxs("ol",{className:"list-decimal space-y-1 pl-5 text-sm text-muted-foreground",children:[e.jsx("li",{children:"Copy the prompt below."}),e.jsx("li",{children:"Paste it into Claude Code, Codex, Cursor, OpenCode, or another coding agent, and tell it what to change."}),e.jsxs("li",{children:["The agent installs the ",e.jsx("a",{className:"underline",href:"https://github.com/huggingface/pwc-cli",target:"_blank",rel:"noreferrer",children:"pwc CLI"}),", asks you to authorize this paper with your Hugging Face account, and previews the edits before submitting them."]})]}),e.jsx("textarea",{"aria-label":"Paper edit prompt",readOnly:!0,value:i,className:"h-48 w-full resize-none rounded border bg-muted/40 p-3 font-mono text-xs",onFocus:l=>l.currentTarget.select()}),r&&e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:"Could not copy automatically. Select the prompt above and copy it manually."}),e.jsxs(L,{className:"justify-self-end",onClick:async()=>{try{await navigator.clipboard.writeText(i),a(!0),n(!1)}catch{n(!0)}},children:[s?e.jsx(me,{size:14}):e.jsx(ka,{size:14}),s?"Prompt copied":"Copy prompt"]})]})})]})}function ge(t,{toast:s,queryClient:a,paperIds:r,queuedDescription:n}){if(t.status==="approved"){ds(a,r),us(a),s({title:"Edit applied",description:"Your change is now live on this paper."});return}s({title:"Edit submitted for review",description:n})}function hr(t){return t.map(s=>{const a=s.best_metric||Object.keys(s.metrics)[0]||"";return{id:s.id,task_id:s.task_id,dataset_id:s.dataset_id,model_name:s.model_name||"",harness:s.harness||"",metric_name:a,metric_value:String(s.metrics[a]??""),original_metrics:{...s.metrics},original_metric_name:a,best_rank:s.best_rank!=null?String(s.best_rank):"",num_parameters:s.num_parameters!=null?String(s.num_parameters):"",hf_model_url:s.hf_model_url||"",is_open:s.is_open!==!1,operation:"unchanged"}})}function pr(t,s){const a={...t.original_metrics},r=a[t.original_metric_name];return t.original_metric_name!==s&&delete a[t.original_metric_name],a[s]=r!=null&&t.metric_value===String(r)?r:t.metric_value,a}function fr(t){const s=t==null?void 0:t.trim();return s?Number(s):void 0}function Qt(t){const s=t.trim();return s?Number(s):null}function lt(t){return t.trim()||null}function ct(t){return!!(t&&/^\d+$/.test(t.trim())&&Number.isSafeInteger(Number(t))&&Number(t)>0)}function xs(t){const s=[];return t.forEach((a,r)=>{var o;if(!a.operation||a.operation==="unchanged")return;const n=(i,l)=>{s.push({rowIndex:r,field:i,message:l})};if(a.operation!=="create"&&!ct(a.id)&&n("id","This result has no valid evaluation ID. Reload the paper before editing it."),a.operation==="delete")return;ct(a.task_id)||n("task_id","Select a valid task."),ct(a.dataset_id)||n("dataset_id","Select a valid dataset.");const c=a.metric_name.trim();c?c!==a.original_metric_name&&Object.prototype.hasOwnProperty.call(a.original_metrics,c)&&n("metric_name",`Cannot rename a metric to "${c}": this evaluation already has that score.`):n("metric_name","Select a metric."),(o=a.best_rank)!=null&&o.trim()&&!Number.isSafeInteger(Number(a.best_rank))&&n("best_rank","Enter a whole-number rank."),a.num_parameters.trim()&&(!Number.isSafeInteger(Number(a.num_parameters))||Number(a.num_parameters)<0)&&n("num_parameters","Enter a non-negative whole-number parameter count."),a.metric_value.trim()||n("metric_value","Enter a metric value.")}),s}function gr(t,s){const a=xs(t);return a.length?{valid:!1,errors:a}:{valid:!0,operations:xr(t,s)}}function xr(t,s){const a=[];for(const r of t){if(r.operation==="delete"){a.push({kind:"delete",evaluationId:Number(r.id)});continue}if(r.operation!=="create"&&r.operation!=="update")continue;const n=r.metric_name.trim(),c=s(r.task_id,r.dataset_id),o={task_id:Number(r.task_id),dataset_id:Number(r.dataset_id),metrics:pr(r,n),best_metric:n,is_open:r.is_open},i=r.model_name.trim(),l=fr(r.best_rank);if(r.operation==="create"){const g=Qt(r.num_parameters),f=lt(r.hf_model_url);a.push({kind:"create",data:{...o,...i?{model_name:i}:{},...c&&r.harness.trim()?{harness:r.harness.trim()}:{},...l!==void 0?{best_rank:l}:{},...g!==null?{num_parameters:g}:{},...f!==null?{hf_model_url:f}:{}}});continue}a.push({kind:"update",evaluationId:Number(r.id),data:{...o,...i?{model_name:i}:{},harness:c?lt(r.harness):null,...l!==void 0?{best_rank:l}:{},num_parameters:Qt(r.num_parameters),hf_model_url:lt(r.hf_model_url)}})}return a}function br(t,s){return s.map(a=>a.kind==="delete"?{operation:"delete",evaluation_id:a.evaluationId}:{operation:a.kind,...a.kind==="update"?{evaluation_id:a.evaluationId}:{},payload:a.kind==="create"?{paper_id:t,...a.data}:a.data})}function jr(t){return t.map(s=>s.kind==="delete"?{op:"delete",evaluation_id:s.evaluationId}:s.kind==="update"?{op:"update",evaluation_id:s.evaluationId,data:s.data}:{op:"create",data:s.data})}function xe(t){const s=typeof window<"u"&&window.location.hostname==="staging.paperswithcode.co";return e.jsxs("div",{className:"rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-100",children:[e.jsx("p",{className:"font-medium",children:s?"Test-only: this change stays on staging.":"Your changes go live right away."}),e.jsx("p",{className:"mt-1 leading-snug",children:s?"This exercises staging-local pending behavior and is not queued for production review.":"Edits are applied immediately and reviewed afterwards. A few, such as links to unfamiliar sites, are held for an admin first."})]})}const dt=100;function vr(t){return(t??[]).some(s=>s.slug==="coding-agents"||s.name.trim().toLowerCase()==="coding agents")}function yr(t){const s=new Map;return t.forEach(a=>{a.task_id&&a.task_name&&s.set(a.task_id,{id:a.task_id,name:a.task_name,slug:a.task_slug,level:0})}),s}function _r(t){const s=new Map;return t.forEach(a=>{a.dataset_id&&a.dataset_name&&s.set(a.dataset_id,{id:a.dataset_id,name:a.dataset_name,slug:a.dataset_slug})}),s}function Vt(t,s){return`${t}:${s}`}function wr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialEvaluations:n,paperTasks:c,onSuccess:o,submitMode:i="direct",isAdmin:l=!1,isAuthor:g=!1}){const f=m.useId(),d=vr(c),[x,v]=m.useState([]),[j,k]=m.useState(!1),_=j?xs(x):[],[S,w]=m.useState(null),[R,C]=m.useState(new Map),[b,u]=m.useState(new Map),h=he(),{toast:E}=ee(),F=m.useRef(!1),z=m.useRef(!1);m.useEffect(()=>{if(!t){k(!1),F.current=!1,z.current=!1;return}F.current||z.current||n.length!==0&&(F.current=!0,v(hr(n)),C(yr(n)),u(_r(n)))},[t,n]);const q=m.useMemo(()=>Array.from(new Set(x.map(y=>y.task_id).filter(y=>y&&y!==""))),[x]),K=m.useMemo(()=>{const y=new Set;return x.forEach(N=>{N.task_id&&N.dataset_id&&y.add(Vt(N.task_id,N.dataset_id))}),Array.from(y)},[x]),G=ie({queryKey:["datasets-by-tasks-for-eval-edit",q,t],queryFn:async()=>{const y={};return await Promise.all(q.map(async N=>{try{const A=await ke.listDatasets({task_id:parseInt(N),page_size:dt});y[N]=A.results}catch(A){console.error(`Error fetching datasets for task ${N}:`,A),y[N]=[]}})),y},enabled:t&&q.length>0});m.useEffect(()=>{G.data&&u(y=>{const N=new Map(y);return Object.values(G.data).forEach(A=>{A.forEach(T=>{N.set(T.id,T)})}),N})},[G.data]);const p=ie({queryKey:["leaderboard-metrics-for-eval-edit",K,t],queryFn:async()=>{const y={};return await Promise.all(K.map(async N=>{const[A,T]=N.split(":");try{y[N]=await ke.leaderboardMetrics(T,A)}catch(Q){console.error(`Error fetching metrics for leaderboard ${N}:`,Q),y[N]=[]}})),y},enabled:t&&K.length>0}),$=async y=>{const N=await ke.listTasks({page_size:dt,...y?{q:y}:{}});return C(A=>{const T=new Map(A);return N.results.forEach(Q=>T.set(Q.id,Q)),T}),N.results.map(A=>{var T;return{value:A.id,label:A.name,description:(T=A.description)==null?void 0:T.slice(0,100)}})},I=y=>async N=>{const A=await ke.listDatasets({task_id:parseInt(y),page_size:dt,...N?{q:N}:{}});return u(T=>{const Q=new Map(T);return A.results.forEach(X=>Q.set(X.id,X)),Q}),A.results.map(T=>({value:T.id,label:T.name,description:T.full_name}))},D=(y,N)=>{if(!y||!N)return!1;const A=b.get(N);return!!(A!=null&&A.supports_harness)},U=(y,N,A)=>{var X;if(!y||!N)return[];const Q=(((X=p.data)==null?void 0:X[Vt(y,N)])||[]).map(B=>({value:B.metric_name,label:B.metric_name,description:B.metric_direction==="higher_is_better"?"Higher is better":"Lower is better"}));return A&&!Q.some(B=>B.value===A)&&Q.unshift({value:A,label:`${A} (legacy)`}),Q},H=ce({mutationFn:async({paperId:y,canonical:N})=>{if(!l&&i==="direct"&&N.length>50)throw new Error("Contributor evaluation batches are limited to 50 operations; contact an admin.");const A=Number.parseInt(y,10);if(i==="pending"){const T=await pe.submit({paper_id:A,edit_type:"evaluations",proposed_payload:{operations:jr(N)}});T.status==="approved"&&Mt(h,qt(y,n,N,r)),ge(T,{toast:E,queryClient:h,paperIds:[y,r],queuedDescription:"Thanks! An admin will review your proposed evaluation changes shortly."})}else{const T=qt(y,n,N,r);await Xe.batch(A,br(A,N)),Mt(h,T)}},onSuccess:()=>{o==null||o(),s(!1)},onError:y=>{const N=fe(y,i==="pending"?"Failed to submit your edit. Please try again.":"Failed to update evaluations.");E({title:i==="pending"?"Could not submit edit":"Could not save evaluations",description:N,variant:"destructive"})}}),M=()=>{z.current=!0,v([...x,{task_id:"",dataset_id:"",model_name:"",harness:"",metric_name:"",metric_value:"",original_metrics:{},original_metric_name:"",best_rank:"",num_parameters:"",hf_model_url:"",is_open:!0,operation:"create"}])},J=y=>{if(z.current=!0,x[y].id){if(!window.confirm("Delete this evaluation? You will be asked to sign in again if your session is older than 15 minutes."))return;v(x.map((A,T)=>T===y?{...A,operation:"delete"}:A))}else v(x.filter((A,T)=>T!==y))},Z=(y,N,A)=>{z.current=!0,v(x.map((T,Q)=>{if(Q!==y||T[N]===A)return T;const X={...T,[N]:A};return(N==="task_id"||N==="dataset_id")&&(X.original_metrics={},X.original_metric_name="",X.metric_value="",X.best_rank=""),N==="task_id"&&(X.dataset_id="",X.metric_name="",X.harness=""),N==="dataset_id"&&(X.metric_name="",A&&!D(X.task_id,A)&&(X.harness="")),T.operation==="unchanged"&&(X.operation="update"),X}))},Ye=(y,N)=>{z.current=!0,v(x.map((A,T)=>{if(T!==y)return A;const Q={...A,is_open:N};return A.operation==="unchanged"&&(Q.operation="update"),Q}))},Ue=()=>{k(!0);const y=gr(x,D);if(y.valid){if(y.operations.length===0){E({title:"No changes to submit",description:"Your evaluation list matches the existing data."});return}H.mutate({paperId:a,canonical:y.operations})}},ye=(y,N)=>{const A=_.find(T=>T.rowIndex===y&&T.field===N);return A?e.jsx("p",{id:`${f}-${y}-${N}-error`,className:"text-xs text-destructive",children:A.message}):null};return e.jsxs(te,{open:t,onOpenChange:s,children:[e.jsxs(se,{className:"max-w-6xl max-h-[800px]",children:[e.jsxs(ae,{children:[e.jsx(re,{children:"Edit Evaluation Results"}),e.jsx(ne,{children:"Add, edit, or remove evaluation results for this paper. Each row represents a benchmark result."})]}),i==="pending"&&e.jsx(xe,{isAuthor:g}),_.length>0&&e.jsxs("div",{role:"alert",className:"text-sm text-destructive",children:["Fix the following errors before saving. No changes have been submitted.",e.jsx("ul",{children:_.map(y=>e.jsxs("li",{children:["Row ",x.slice(0,y.rowIndex+1).filter(N=>N.operation!=="delete").length,": ",y.message]},`${y.rowIndex}-${y.field}`))})]}),e.jsxs("div",{className:"py-4 overflow-y-auto max-h-[600px]",children:[x.filter(y=>y.operation!=="delete").length>0?e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[180px]",children:"Task"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[180px]",children:"Dataset"}),e.jsx("th",{className:`text-left py-2 px-2 font-medium text-sm ${d?"min-w-[140px]":"min-w-[240px]"}`,children:"Model"}),d&&e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[140px]",children:"Harness"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[140px]",children:"Metric"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Value"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm",children:"Parameters"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm min-w-[200px]",children:"HF model URL"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-20",children:"Open source"}),e.jsx("th",{className:"text-left py-2 px-2 font-medium text-sm w-16",children:"Action"})]})}),e.jsx("tbody",{children:x.map((y,N)=>{if(y.operation==="delete")return null;const A=R.get(y.task_id),T=b.get(y.dataset_id),Q=U(y.task_id,y.dataset_id,y.metric_name),X=!!(y.task_id&&y.dataset_id)&&p.isFetching;return e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("td",{className:"py-2 px-2",children:e.jsxs("div",{role:"group","aria-label":"Task","aria-describedby":`${f}-${N}-task_id-error`,children:[e.jsx(Ht,{value:y.task_id,onChange:B=>Z(N,"task_id",B),placeholder:"Select task",searchPlaceholder:"Search tasks...",emptyMessage:"No tasks found.",selectedOption:A?{value:A.id,label:A.name}:null,queryKey:["eval-edit-task-search"],queryFn:$,enabled:t}),ye(N,"task_id")]})}),e.jsx("td",{className:"py-2 px-2",children:e.jsxs("div",{role:"group","aria-label":"Dataset","aria-describedby":`${f}-${N}-dataset_id-error`,children:[e.jsx(Ht,{value:y.dataset_id,onChange:B=>Z(N,"dataset_id",B),placeholder:y.task_id?"Select dataset":"Select task first",searchPlaceholder:"Search datasets...",emptyMessage:y.task_id?"No datasets found for this task.":"Select a task first.",disabled:!y.task_id,selectedOption:T?{value:T.id,label:T.name}:null,queryKey:["eval-edit-dataset-search",y.task_id],queryFn:I(y.task_id),enabled:t&&!!y.task_id}),ye(N,"dataset_id")]})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(W,{type:"text",className:"w-full text-sm",placeholder:"Model name",value:y.model_name,onChange:B=>Z(N,"model_name",B.target.value)})}),d&&e.jsx("td",{className:"py-2 px-2",children:D(y.task_id,y.dataset_id)?e.jsx(W,{type:"text",className:"w-full text-sm",placeholder:"Claude Code, Terminus, ...",value:y.harness,onChange:B=>Z(N,"harness",B.target.value)}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Not supported"})}),e.jsxs("td",{className:"py-2 px-2",children:[!y.task_id||!y.dataset_id?e.jsx("span",{className:"text-xs text-muted-foreground",children:"Select task + dataset"}):X?e.jsxs("span",{className:"inline-flex items-center text-xs text-muted-foreground",children:[e.jsx(oe,{className:"mr-1 h-3 w-3 animate-spin"}),"Loading metrics..."]}):Q.length>0?e.jsxs("select",{className:"w-full rounded-md border border-border bg-background px-2 py-1 text-sm",id:`${f}-${N}-metric_name`,"aria-invalid":_.some(B=>B.rowIndex===N&&B.field==="metric_name"),"aria-describedby":`${f}-${N}-metric_name-error`,value:y.metric_name,onChange:B=>Z(N,"metric_name",B.target.value),children:[e.jsx("option",{value:"",children:"Select metric"}),Q.map(B=>e.jsx("option",{value:B.value,children:B.label},B.value))]}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"No configured metrics"}),ye(N,"metric_name")]}),e.jsxs("td",{className:"py-2 px-2",children:[e.jsx(W,{type:"text",className:"w-full text-sm",placeholder:"44.9",id:`${f}-${N}-metric_value`,"aria-invalid":_.some(B=>B.rowIndex===N&&B.field==="metric_value"),"aria-describedby":`${f}-${N}-metric_value-error`,value:y.metric_value,onChange:B=>Z(N,"metric_value",B.target.value)}),ye(N,"metric_value")]}),e.jsxs("td",{className:"py-2 px-2",children:[e.jsx(W,{type:"number",min:0,step:1,className:"w-full text-sm",placeholder:"e.g. 7000000000",id:`${f}-${N}-num_parameters`,"aria-invalid":_.some(B=>B.rowIndex===N&&B.field==="num_parameters"),"aria-describedby":`${f}-${N}-num_parameters-error`,value:y.num_parameters,onChange:B=>Z(N,"num_parameters",B.target.value),title:"Raw model parameter count (e.g. 7000000000 for a 7B model). Leave blank if unknown."}),ye(N,"num_parameters")]}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(W,{type:"url",className:"w-full text-sm",placeholder:"https://huggingface.co/org/model",value:y.hf_model_url,onChange:B=>Z(N,"hf_model_url",B.target.value),title:"Hugging Face model page for this row (must start with https://huggingface.co/). Leave blank if none."})}),e.jsx("td",{className:"py-2 px-2 text-center",children:e.jsx("input",{type:"checkbox",className:"h-4 w-4 align-middle",checked:y.is_open,onChange:B=>Ye(N,B.target.checked),title:"Whether the evaluated model is open-source. Uncheck for closed-source models."})}),e.jsx("td",{className:"py-2 px-2",children:e.jsx(L,{variant:"ghost",size:"sm",onClick:()=>J(N),className:"h-8 w-8 p-0 text-destructive hover:text-destructive",title:y.id&&!l?"Only administrators can delete published results":"Remove row",disabled:!!y.id&&!l,children:e.jsx(Te,{className:"w-4 h-4"})})})]},N)})})]})}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Sa,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),e.jsx("p",{children:"No evaluation results yet"}),e.jsx("p",{className:"text-sm mt-2",children:'Click "Add Row" below to add a new evaluation'})]}),e.jsx("div",{className:"mt-4",children:e.jsxs(L,{variant:"outline",size:"sm",onClick:M,className:"flex items-center space-x-2",children:[e.jsx(De,{className:"w-4 h-4"}),e.jsx("span",{children:"Add Row"})]})})]}),e.jsxs(le,{children:[e.jsxs("div",{className:"flex flex-wrap gap-2 sm:mr-auto",children:[e.jsx(L,{variant:"ghost",onClick:()=>w("benchmark"),children:"Suggest a new benchmark"}),e.jsx(L,{variant:"ghost",onClick:()=>w("metric"),children:"Suggest a new metric"})]}),e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:Ue,disabled:H.isPending,children:H.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),i==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),i==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(Et,{open:S!==null,onOpenChange:y=>{y||w(null)},paperId:a,kind:S??"benchmark"})]})}const ut=[{key:"hf_models",label:"Models",placeholder:"https://huggingface.co/org/model"},{key:"hf_datasets",label:"Datasets",placeholder:"https://huggingface.co/datasets/org/data"},{key:"hf_spaces",label:"Spaces",placeholder:"https://huggingface.co/spaces/org/demo"}];function Wt(t){return t.map(s=>s.trim()).filter(Boolean)}function mt(t,s){const a=Wt(t).sort(),r=Wt(s).sort();return a.length!==r.length?!1:a.every((n,c)=>n===r[c])}function kr(t,s){return mt(t.hf_models,s.hf_models)&&mt(t.hf_datasets,s.hf_datasets)&&mt(t.hf_spaces,s.hf_spaces)}function Nr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialArtifacts:n,onSuccess:c,submitMode:o="direct",isAuthor:i=!1}){const[l,g]=m.useState(n),[f,d]=m.useState({hf_models:"",hf_datasets:"",hf_spaces:""}),x=he(),{toast:v}=ee(),j=m.useRef(!1);m.useEffect(()=>{if(!t){j.current=!1;return}j.current||(j.current=!0,g(n),d({hf_models:"",hf_datasets:"",hf_spaces:""}))},[t,n]);const k=ce({mutationFn:async({paperId:b,artifacts:u})=>{if(o==="pending"){const h=await pe.submit({paper_id:parseInt(b),edit_type:"hf_artifacts",proposed_payload:u});return ge(h,{toast:v,queryClient:x,paperIds:[b,r],queuedDescription:"Thanks! An admin will review your proposed Hugging Face artifact changes shortly."}),null}return Y.updateHfArtifacts(b,u)},onSuccess:b=>{if(o==="pending"){c==null||c(),s(!1),d({hf_models:"",hf_datasets:"",hf_spaces:""});return}b&&ve(x,b,[a,r]),c==null||c(),s(!1),d({hf_models:"",hf_datasets:"",hf_spaces:""})},onError:b=>{const u=fe(b,o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update Hugging Face artifacts.");v({title:o==="pending"?"Could not submit edit":"Could not save Hugging Face artifacts",description:u,variant:"destructive"})}}),_=()=>{const b={hf_models:[...l.hf_models],hf_datasets:[...l.hf_datasets],hf_spaces:[...l.hf_spaces]};for(const{key:u}of ut){const h=f[u].trim();if(h){if(b[u].some(E=>E.trim()===h))return alert(`This ${u.replace("hf_","")} URL is already added`),null;b[u]=[...b[u],h]}}return b},S=b=>{const u=f[b].trim();if(u){if(l[b].some(h=>h.trim()===u)){alert(`This ${b.replace("hf_","")} URL is already added`);return}g(h=>({...h,[b]:[...h[b],u]})),d(h=>({...h,[b]:""}))}},w=(b,u)=>{g(h=>({...h,[b]:h[b].filter(E=>E!==u)}))},R=()=>{const b=_();if(b===null)return;const u=Object.keys(n).some(h=>n[h].some(E=>!b[h].includes(E)));o==="direct"&&u&&!window.confirm("Remove one or more Hugging Face artifact links?")||k.mutate({paperId:a,artifacts:b})},C=m.useMemo(()=>{const b={hf_models:[...l.hf_models],hf_datasets:[...l.hf_datasets],hf_spaces:[...l.hf_spaces]};for(const{key:u}of ut){const h=f[u].trim();if(h){if(b[u].some(E=>E.trim()===h))return!1;b[u]=[...b[u],h]}}return!kr(b,n)},[l,f,n]);return e.jsx(te,{open:t,onOpenChange:s,children:e.jsxs(se,{className:"max-w-2xl max-h-[700px]",children:[e.jsxs(ae,{children:[e.jsx(re,{children:"Edit Hugging Face Artifacts"}),e.jsx(ne,{children:"Add or remove linked Hugging Face models, datasets, and Spaces for this paper."})]}),o==="pending"&&e.jsx(xe,{isAuthor:i}),e.jsx("div",{className:"space-y-6 py-2 overflow-y-auto max-h-[460px]",children:ut.map(({key:b,label:u,placeholder:h})=>e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:u}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(W,{type:"url",placeholder:h,value:f[b],onChange:E=>d(F=>({...F,[b]:E.target.value})),onKeyPress:E=>{E.key==="Enter"&&(E.preventDefault(),S(b))},className:"flex-1"}),e.jsxs(L,{onClick:()=>S(b),size:"sm",disabled:!f[b].trim(),children:[e.jsx(De,{className:"w-4 h-4 mr-1"}),"Add"]})]}),l[b].length>0?e.jsx("div",{className:"space-y-2",children:l[b].map(E=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate flex-1",children:E}),e.jsx(L,{variant:"ghost",size:"sm",onClick:()=>w(b,E),className:"h-8 px-2 text-destructive hover:text-destructive",title:`Remove ${u.toLowerCase()} URL`,children:e.jsx(Te,{className:"w-4 h-4"})})]},E))}):e.jsxs("div",{className:"text-xs text-muted-foreground",children:["No ",u.toLowerCase()," linked yet."]})]},b))}),e.jsxs(le,{children:[e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:R,disabled:k.isPending||!C,children:k.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}var Qe="Checkbox",[Cr]=Nt(Qe),[Er,St]=Cr(Qe);function Sr(t){const{__scopeCheckbox:s,checked:a,children:r,defaultChecked:n,disabled:c,form:o,name:i,onCheckedChange:l,required:g,value:f="on",internal_do_not_use_render:d}=t,[x,v]=ns({prop:a,defaultProp:n??!1,onChange:l,caller:Qe}),[j,k]=m.useState(null),[_,S]=m.useState(null),w=m.useRef(!1),R=j?!!o||!!j.closest("form"):!0,C={checked:x,disabled:c,setChecked:v,control:j,setControl:k,name:i,form:o,value:f,hasConsumerStoppedPropagationRef:w,required:g,defaultChecked:je(n)?!1:n,isFormControl:R,bubbleInput:_,setBubbleInput:S};return e.jsx(Er,{scope:s,...C,children:Pr(d)?d(C):r})}var bs="CheckboxTrigger",js=m.forwardRef(({__scopeCheckbox:t,onKeyDown:s,onClick:a,...r},n)=>{const{control:c,value:o,disabled:i,checked:l,required:g,setControl:f,setChecked:d,hasConsumerStoppedPropagationRef:x,isFormControl:v,bubbleInput:j}=St(bs,t),k=Le(n,f),_=m.useRef(l);return m.useEffect(()=>{const S=c==null?void 0:c.form;if(S){const w=()=>d(_.current);return S.addEventListener("reset",w),()=>S.removeEventListener("reset",w)}},[c,d]),e.jsx(Ne.button,{type:"button",role:"checkbox","aria-checked":je(l)?"mixed":l,"aria-required":g,"data-state":ks(l),"data-disabled":i?"":void 0,disabled:i,value:o,...r,ref:k,onKeyDown:Ae(s,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:Ae(a,S=>{d(w=>je(w)?!0:!w),j&&v&&(x.current=S.isPropagationStopped(),x.current||S.stopPropagation())})})});js.displayName=bs;var Pt=m.forwardRef((t,s)=>{const{__scopeCheckbox:a,name:r,checked:n,defaultChecked:c,required:o,disabled:i,value:l,onCheckedChange:g,form:f,...d}=t;return e.jsx(Sr,{__scopeCheckbox:a,checked:n,defaultChecked:c,disabled:i,required:o,onCheckedChange:g,name:r,form:f,value:l,internal_do_not_use_render:({isFormControl:x})=>e.jsxs(e.Fragment,{children:[e.jsx(js,{...d,ref:s,__scopeCheckbox:a}),x&&e.jsx(ws,{__scopeCheckbox:a})]})})});Pt.displayName=Qe;var vs="CheckboxIndicator",ys=m.forwardRef((t,s)=>{const{__scopeCheckbox:a,forceMount:r,...n}=t,c=St(vs,a);return e.jsx(rs,{present:r||je(c.checked)||c.checked===!0,children:e.jsx(Ne.span,{"data-state":ks(c.checked),"data-disabled":c.disabled?"":void 0,...n,ref:s,style:{pointerEvents:"none",...t.style}})})});ys.displayName=vs;var _s="CheckboxBubbleInput",ws=m.forwardRef(({__scopeCheckbox:t,...s},a)=>{const{control:r,hasConsumerStoppedPropagationRef:n,checked:c,defaultChecked:o,required:i,disabled:l,name:g,value:f,form:d,bubbleInput:x,setBubbleInput:v}=St(_s,t),j=Le(a,v),k=ms(c),_=is(r);m.useEffect(()=>{const w=x;if(!w)return;const R=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(R,"checked").set,u=!n.current;if(k!==c&&b){const h=new Event("click",{bubbles:u});w.indeterminate=je(c),b.call(w,je(c)?!1:c),w.dispatchEvent(h)}},[x,k,c,n]);const S=m.useRef(je(c)?!1:c);return e.jsx(Ne.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??S.current,required:i,disabled:l,name:g,value:f,form:d,...s,tabIndex:-1,ref:j,style:{...s.style,..._,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});ws.displayName=_s;function Pr(t){return typeof t=="function"}function je(t){return t==="indeterminate"}function ks(t){return je(t)?"indeterminate":t?"checked":"unchecked"}const Ve=m.forwardRef(({className:t,style:s,...a},r)=>e.jsx(Pt,{ref:r,className:Oe("peer h-4 w-4 shrink-0 rounded-sm ring-offset-background data-[state=checked]:!bg-black data-[state=checked]:!text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),style:{border:"1px solid #000",...s},...a,children:e.jsx(ys,{className:Oe("flex items-center justify-center text-current"),children:e.jsx(me,{className:"h-4 w-4"})})}));Ve.displayName=Pt.displayName;const $r=250,Rr=100;function Ir({open:t,onOpenChange:s,paperId:a,arxivId:r,initialMethodIds:n,initialMethods:c,onSuccess:o,submitMode:i="direct",isAuthor:l=!1}){const[g,f]=m.useState(n),[d,x]=m.useState(!1),[v,j]=m.useState(""),[k,_]=m.useState(""),[S,w]=m.useState(new Map),R=he(),{toast:C}=ee(),b=m.useRef(!1);m.useEffect(()=>{if(!t){b.current=!1;return}if(b.current)return;b.current=!0,f(n),j(""),_("");const p=new Map;(c||[]).forEach($=>{const I=parseInt($.id);Number.isNaN(I)||p.set(I,$)}),w(p)},[t,n,c]),m.useEffect(()=>{const p=window.setTimeout(()=>{_(v.trim())},$r);return()=>window.clearTimeout(p)},[v]);const{data:u,isFetching:h}=ie({queryKey:["methods-search",k],queryFn:()=>ke.listMethods({page_size:Rr,...k?{q:k}:{}}),enabled:t});m.useEffect(()=>{var p;(p=u==null?void 0:u.results)!=null&&p.length&&w($=>{const I=new Map($);return u.results.forEach(D=>{const U=parseInt(D.id);Number.isNaN(U)||I.set(U,D)}),I})},[u]);const E=m.useMemo(()=>{const p=(u==null?void 0:u.results)||[],$=new Set,I=[],D=(M,J)=>{!J||Number.isNaN(M)||$.has(M)||(I.push(J),$.add(M))},U=()=>g.forEach(M=>D(M,S.get(M))),H=()=>p.forEach(M=>D(parseInt(M.id),M));return k?(H(),U()):(U(),H()),I},[u,g,S,k]),F=ce({mutationFn:async({paperId:p,methodIds:$})=>{if(i==="pending"){const I=await pe.submit({paper_id:parseInt(p),edit_type:"methods",proposed_payload:{method_ids:$}});return ge(I,{toast:C,queryClient:R,paperIds:[p,r],queuedDescription:"Thanks! An admin will review your proposed method changes shortly."}),null}return Y.updateMethods(p,$)},onSuccess:p=>{if(i==="pending"){o==null||o(),s(!1);return}p&&ve(R,p,[a,r]),C({title:"Methods updated",description:`Saved ${g.length} method${g.length===1?"":"s"} for this paper.`}),o==null||o(),s(!1)},onError:p=>{const $=fe(p,i==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper methods.");C({title:i==="pending"?"Could not submit edit":"Could not save methods",description:$,variant:"destructive"})}}),z=()=>{i==="direct"&&n.some(p=>!g.includes(p))&&!window.confirm("Remove one or more method links from this paper?")||F.mutate({paperId:a,methodIds:g})},q=m.useMemo(()=>{if(g.length!==n.length)return!0;const p=new Set(n);return g.some($=>!p.has($))},[g,n]),K=(p,$)=>{f(I=>$?I.includes(p)?I:[...I,p]:I.filter(D=>D!==p))},G=()=>j("");return e.jsxs(te,{open:t,onOpenChange:s,children:[e.jsxs(se,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ae,{children:[e.jsx(re,{children:"Edit Paper Methods"}),e.jsx(ne,{children:"Select the methods and techniques used in this paper. You can select multiple methods."})]}),i==="pending"&&e.jsx(xe,{isAuthor:l}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Fe,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(W,{type:"text",placeholder:"Search methods...",value:v,onChange:p=>j(p.target.value),className:"pl-9 pr-9"}),v&&e.jsx("button",{type:"button",onClick:G,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(Ct,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:E.length>0?e.jsx("div",{className:"space-y-2",children:E.map(p=>{const $=parseInt(p.id),I=g.includes($);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(Ve,{id:`method-${p.id}`,checked:I,onCheckedChange:D=>K($,D===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`method-${p.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[p.name,p.full_name&&p.full_name!==p.name&&e.jsx("span",{className:"block text-xs text-muted-foreground font-normal",children:p.full_name}),p.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[p.description.substring(0,100),p.description.length>100?"...":""]})]})]},p.id)})}):h?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(oe,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsx("p",{children:"Loading methods..."})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Fe,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:k?`No methods found matching "${k}"`:"No methods available"})]})}),e.jsxs(le,{children:[e.jsx(L,{variant:"ghost",className:"sm:mr-auto",onClick:()=>x(!0),children:"Suggest a new method"}),e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:z,disabled:F.isPending||!q,children:F.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),i==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),i==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(Et,{open:d,onOpenChange:x,paperId:a,kind:"method"})]})}const Ns=["image/jpeg","image/png","image/webp","image/gif"],Ar=2*1024*1024;function Fr(t){return Ns.includes(t.type)?t.size>Ar?Promise.reject(new Error("Logo must be 2 MB or smaller.")):new Promise((s,a)=>{const r=new FileReader;r.onload=()=>s({file_name:t.name,mime_type:t.type,data_url:String(r.result)}),r.onerror=()=>a(new Error("Could not read that logo.")),r.readAsDataURL(t)}):Promise.reject(new Error("Choose a JPEG, PNG, WebP, or GIF logo."))}function Lr({paperId:t,initialName:s,onApplied:a,onUnsentChange:r}){const[n,c]=m.useState(s),[o,i]=m.useState(""),[l,g]=m.useState(""),[f,d]=m.useState(null),[x,v]=m.useState(""),j=ce({mutationFn:()=>pe.submit(Na(Number(t),"new_organization",{name:n.trim(),...o.trim()?{hf_slug:o.trim()}:{},...l.trim()?{website_url:l.trim()}:{},...f?{image:f}:{}})),onSuccess:_=>{_.status==="approved"&&a(n.trim())}}),k=!j.isSuccess&&!!(o.trim()||l.trim()||f);return m.useEffect(()=>r(k),[r,k]),m.useEffect(()=>()=>r(!1),[r]),j.isSuccess?e.jsxs("p",{className:"rounded border p-3 text-sm",children:['Thanks! "',n.trim(),'" was submitted for review. Once an admin approves it, the organization is created and added to this paper.']}):e.jsxs("form",{className:"space-y-2 rounded border p-3",onSubmit:_=>{_.preventDefault(),j.mutate()},children:[e.jsx("p",{className:"text-sm font-medium",children:"Suggest a new organization"}),e.jsx(W,{"aria-label":"Organization name",placeholder:"Name",value:n,maxLength:200,onChange:_=>c(_.target.value)}),e.jsx(W,{"aria-label":"Hugging Face organization",placeholder:"Hugging Face organization (e.g. https://huggingface.co/PrimeIntellect)",value:o,onChange:_=>i(_.target.value)}),e.jsx(W,{"aria-label":"Website",type:"url",placeholder:"Website (e.g. https://www.primeintellect.ai)",value:l,onChange:_=>g(_.target.value)}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:["Logo (optional)",e.jsx("input",{"aria-label":"Logo",type:"file",accept:Ns.join(","),onChange:_=>{var w;const S=(w=_.target.files)==null?void 0:w[0];d(null),v(""),S&&Fr(S).then(d,R=>v(R.message))}})]}),f&&e.jsx("img",{src:f.data_url,alt:"Selected logo",className:"h-12 w-12 rounded border object-contain"}),x&&e.jsx("p",{className:"text-sm text-destructive",children:x}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"With a Hugging Face organization it is added right away; otherwise an admin reviews it."}),e.jsx(L,{type:"submit",variant:"outline",disabled:!n.trim()||!o.trim()&&!l.trim()||j.isPending,children:j.isPending?"Submitting...":"Submit organization"})]}),j.error&&e.jsx("p",{className:"text-sm text-destructive",children:fe(j.error,"Could not submit this organization.")})]})}const Tr=({open:t,onOpenChange:s,paperId:a,initialOrganizationIds:r,submitMode:n,isAuthor:c})=>{var S;const[o,i]=m.useState(r),[l,g]=m.useState(""),[f,d]=m.useState(!1),x=he(),{toast:v}=ee();m.useEffect(()=>{t&&(i(r),g(""))},[r,t]);const j=ie({queryKey:["organizations","curation"],queryFn:()=>ke.organizations(!1),enabled:t}),k=m.useMemo(()=>{var C,b;const w=l.trim().toLocaleLowerCase();if(!w)return((C=j.data)==null?void 0:C.results)??[];const R=u=>u===w?0:u.startsWith(w)?1:u.split(/[^\p{L}\p{N}]+/u).some(h=>h.startsWith(w))?2:3;return(((b=j.data)==null?void 0:b.results)??[]).map(u=>({organization:u,name:u.name.toLocaleLowerCase()})).filter(({name:u})=>u.includes(w)).sort((u,h)=>R(u.name)-R(h.name)).map(({organization:u})=>u)},[(S=j.data)==null?void 0:S.results,l]),_=ce({mutationFn:async()=>{if(!(r.some(R=>!o.includes(R))&&!window.confirm("Remove one or more organizations from this paper? Destructive edits may require a fresh sign-in.")))if(n==="pending"){const R=await pe.submit({paper_id:Number(a),edit_type:"organizations",proposed_payload:{organization_ids:o}});return ge(R,{toast:v,queryClient:x,paperIds:[a],queuedDescription:"Thanks! An admin will review your proposed organization changes shortly."}),null}else return Y.updateOrganizations(a,o)},onSuccess:w=>{w!==void 0&&(w&&ve(x,w,[a]),s(!1))}});return e.jsx(te,{open:t,onOpenChange:s,children:e.jsxs(se,{children:[e.jsxs(ae,{children:[e.jsx(re,{children:"Edit organizations"}),e.jsx(ne,{children:"Associate organizations with this paper. If one is missing, search for it and suggest it for review."})]}),n==="pending"&&e.jsx(xe,{isAuthor:c}),e.jsxs("div",{className:"relative",children:[e.jsx(Fe,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(W,{type:"search","aria-label":"Search organizations",placeholder:"Search organizations...",value:l,onChange:w=>g(w.target.value),className:"pl-9 pr-9"}),l&&e.jsx("button",{type:"button",onClick:()=>g(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear organization search",children:e.jsx(Ct,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"max-h-80 space-y-2 overflow-auto",children:[k.map(w=>{const R=Number(w.id);return e.jsxs("label",{className:"flex items-center gap-2 rounded border p-2",children:[e.jsx("input",{type:"checkbox",checked:o.includes(R),onChange:C=>i(b=>C.target.checked?[...b,R]:b.filter(u=>u!==R))}),w.name]},w.id)}),!j.isLoading&&k.length===0&&e.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:l.trim()?`No organizations found matching "${l.trim()}"`:"No organizations available"})]}),!j.isLoading&&k.length===0&&l.trim()&&e.jsx(Lr,{paperId:a,initialName:l.trim(),onApplied:w=>{s(!1),v({title:"Organization added",description:`Added "${w}" to this paper.`}),ds(x,[a]),us(x),x.invalidateQueries({queryKey:["organizations"]})},onUnsentChange:d},l.trim()),f&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"Submit the organization above, or clear the search, before saving."}),e.jsxs(le,{children:[e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:()=>_.mutate(),disabled:_.isPending||f,children:n==="pending"?"Submit test edit":"Save changes"})]})]})})};function Dr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialProjectPages:n,onSuccess:c,submitMode:o="direct",isAuthor:i=!1}){const[l,g]=m.useState(n),[f,d]=m.useState(""),x=he(),{toast:v}=ee(),j=m.useRef(!1);m.useEffect(()=>{if(!t){j.current=!1;return}j.current||(j.current=!0,g(n),d(""))},[t,n]);const k=ce({mutationFn:async({paperId:u,projectPages:h})=>{if(o==="pending"){const E=await pe.submit({paper_id:parseInt(u),edit_type:"project_pages",proposed_payload:{project_pages:h}});return ge(E,{toast:v,queryClient:x,paperIds:[u,r],queuedDescription:"Thanks! An admin will review your proposed project page changes shortly."}),null}return Y.updateProjectPages(u,h)},onSuccess:u=>{if(o==="pending"){c==null||c(),s(!1),d("");return}u&&ve(x,u,[a,r]),c==null||c(),s(!1),d("")},onError:u=>{const h=fe(u,o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update project pages.");v({title:o==="pending"?"Could not submit edit":"Could not save project pages",description:h,variant:"destructive"})}}),_=()=>{const u=f.trim();return u?l.some(h=>h.url===u)?(alert("This project page URL is already added"),null):[...l,{url:u,is_official:!1}]:l},S=()=>{const u=_();u!==null&&u.length!==l.length&&(g(u),d(""))},w=u=>{g(l.filter(h=>h.url!==u))},R=u=>{g(l.map(h=>h.url===u?{...h,is_official:!h.is_official}:h))},C=()=>{const u=_();u!==null&&(o==="direct"&&n.some(h=>!u.some(E=>E.url===h.url))&&!window.confirm("Remove one or more project pages from this paper?")||k.mutate({paperId:a,projectPages:u}))},b=m.useMemo(()=>{const u=f.trim(),h=u?[...l,{url:u,is_official:!1}]:l;if(h.length!==n.length)return!0;const E=new Map(n.map(F=>[F.url.trim(),!!F.is_official]));return h.some(F=>{const z=E.get(F.url.trim());return z===void 0||z!==!!F.is_official})},[l,f,n]);return e.jsx(te,{open:t,onOpenChange:s,children:e.jsxs(se,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ae,{children:[e.jsx(re,{children:"Edit Paper Project Pages"}),e.jsx(ne,{children:"Add or remove project page URLs (e.g. authors' demo or landing pages) associated with this paper. Mark pages as official if they are created by the paper authors."})]}),o==="pending"&&e.jsx(xe,{isAuthor:i}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Add Project Page URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(W,{type:"url",placeholder:"https://example.com/project",value:f,onChange:u=>d(u.target.value),onKeyPress:u=>{u.key==="Enter"&&(u.preventDefault(),S())},className:"flex-1"}),e.jsxs(L,{onClick:S,size:"sm",disabled:!f.trim(),children:[e.jsx(De,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:l.length>0?e.jsx("div",{className:"space-y-2",children:l.map((u,h)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(Kt,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:u.url}),u.is_official&&e.jsx(hs,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(L,{variant:u.is_official?"default":"outline",size:"sm",onClick:()=>R(u.url),className:"h-8 px-2 text-xs",title:u.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(ps,{className:`w-3.5 h-3.5 mr-1 ${u.is_official?"fill-current":""}`}),u.is_official?"Official":"Mark official"]}),e.jsx(L,{variant:"ghost",size:"sm",onClick:()=>w(u.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove project page",children:e.jsx(Te,{className:"w-4 h-4"})})]})]},h))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Kt,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No project pages added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a project page URL above to get started"})]})}),e.jsxs(le,{children:[e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:C,disabled:k.isPending||!b,children:k.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function Ur({open:t,onOpenChange:s,paperId:a,arxivId:r,initialRepositories:n,onSuccess:c,submitMode:o="direct",isAuthor:i=!1}){const[l,g]=m.useState(n),[f,d]=m.useState(""),x=he(),{toast:v}=ee(),j=m.useRef(!1);m.useEffect(()=>{if(!t){j.current=!1;return}j.current||(j.current=!0,g(n),d(""))},[t,n]);const k=ce({mutationFn:async({paperId:h,repositories:E})=>{if(o==="pending"){const F=await pe.submit({paper_id:parseInt(h),edit_type:"repositories",proposed_payload:{repositories:E}});return ge(F,{toast:v,queryClient:x,paperIds:[h,r],queuedDescription:"Thanks! An admin will review your proposed repository changes shortly."}),null}return Y.updateRepositories(h,E)},onSuccess:h=>{if(o==="pending"){c==null||c(),s(!1),d("");return}h&&ve(x,h,[a,r]),c==null||c(),s(!1),d("")},onError:h=>{const E=fe(h,o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper repositories.");v({title:o==="pending"?"Could not submit edit":"Could not save repositories",description:E,variant:"destructive"})}}),_=h=>{const E=[];for(const F of h){const z=E.find(q=>Ot(q.url,F.url));if(z)z.is_official=z.is_official||F.is_official;else{const q=et(F.url);E.push({url:q??F.url.trim(),is_official:F.is_official})}}return E},S=()=>{const h=f.trim(),E=h?[...l,{url:h,is_official:!1}]:l;return h&&l.some(F=>Ot(F.url,h))?(alert("This repository URL is already added"),null):_(E)},w=()=>{const h=S();h!==null&&h.length!==l.length&&(g(h),d(""))},R=h=>{g(l.filter(E=>E.url!==h))},C=h=>{g(l.map(E=>E.url===h?{...E,is_official:!E.is_official}:E))},b=()=>{const h=S();h!==null&&(o==="direct"&&n.some(E=>!h.some(F=>F.url===E.url))&&!window.confirm("Remove one or more repositories from this paper?")||k.mutate({paperId:a,repositories:h}))},u=m.useMemo(()=>{const h=f.trim(),E=h?[...l,{url:h,is_official:!1}]:l;if(E.length!==n.length)return!0;const F=_(n),z=_(E);if(z.length!==F.length)return!0;const q=new Map(F.map(K=>[et(K.url)??K.url.trim(),!!K.is_official]));return z.some(K=>{const G=et(K.url)??K.url.trim(),p=q.get(G);return p===void 0||p!==!!K.is_official})},[l,f,n]);return e.jsx(te,{open:t,onOpenChange:s,children:e.jsxs(se,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ae,{children:[e.jsx(re,{children:"Edit Paper Repositories"}),e.jsx(ne,{children:"Add or remove GitHub repository URLs associated with this paper. Mark repositories as official if they are created by the paper authors."})]}),o==="pending"&&e.jsx(xe,{isAuthor:i}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Add Repository URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(W,{type:"url",placeholder:"https://github.com/owner/repo",value:f,onChange:h=>d(h.target.value),onKeyPress:h=>{h.key==="Enter"&&(h.preventDefault(),w())},className:"flex-1"}),e.jsxs(L,{onClick:w,size:"sm",disabled:!f.trim(),children:[e.jsx(De,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:l.length>0?e.jsx("div",{className:"space-y-2",children:l.map((h,E)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg hover:bg-muted/50 transition-colors",children:[e.jsx(Gt,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-sm font-medium text-paper-blue truncate",children:h.url}),h.is_official&&e.jsx(hs,{variant:"secondary",className:"text-xs",children:"Official"})]})}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs(L,{variant:h.is_official?"default":"outline",size:"sm",onClick:()=>C(h.url),className:"h-8 px-2 text-xs",title:h.is_official?"Click to unmark as official (created by paper authors)":"Click to mark as official (created by paper authors)",children:[e.jsx(ps,{className:`w-3.5 h-3.5 mr-1 ${h.is_official?"fill-current":""}`}),h.is_official?"Official":"Mark official"]}),e.jsx(L,{variant:"ghost",size:"sm",onClick:()=>R(h.url),className:"h-8 px-2 text-destructive hover:text-destructive",title:"Remove repository",children:e.jsx(Te,{className:"w-4 h-4"})})]})]},E))}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Gt,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No repositories added yet"}),e.jsx("p",{className:"text-xs mt-1",children:"Add a repository URL above to get started"})]})}),e.jsxs(le,{children:[e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:b,disabled:k.isPending||!u,children:k.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function Br({open:t,onOpenChange:s,paperId:a,arxivId:r,initialUrl:n,onSuccess:c,submitMode:o="direct",isAuthor:i=!1}){const[l,g]=m.useState(n),f=he(),{toast:d}=ee(),x=m.useRef(!1);m.useEffect(()=>{if(!t){x.current=!1;return}x.current||(x.current=!0,g(n))},[t,n]);const v=ce({mutationFn:async({paperId:w,sourceUrl:R})=>{if(o==="pending"){const C=await pe.submit({paper_id:parseInt(w),edit_type:"source_url",proposed_payload:{source_url:R}});return ge(C,{toast:d,queryClient:f,paperIds:[w,r],queuedDescription:"Thanks! An admin will review your proposed source URL change shortly."}),null}return Y.updateSourceUrl(w,R)},onSuccess:w=>{if(o==="pending"){c==null||c(),s(!1);return}w&&ve(f,w,[a,r]),c==null||c(),s(!1)},onError:w=>{const R=fe(w,o==="pending"?"Failed to submit your edit. Please try again.":"Failed to update source URL.");d({title:o==="pending"?"Could not submit edit":"Could not save source URL",description:R,variant:"destructive"})}}),j=l.trim(),k=/^https?:\/\//i.test(j),_=j!==(n||"").trim(),S=()=>{k&&v.mutate({paperId:a,sourceUrl:j})};return e.jsx(te,{open:t,onOpenChange:s,children:e.jsxs(se,{className:"max-w-2xl",children:[e.jsxs(ae,{children:[e.jsx(re,{children:"Edit Source URL"}),e.jsxs(ne,{children:["Update the canonical URL for this external paper. This is the page the ",'"Source page"'," button links to. ArXiv papers cannot edit this field."]})]}),o==="pending"&&e.jsx(xe,{isAuthor:i}),e.jsxs("div",{className:"space-y-2 py-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Source URL"}),e.jsx(W,{type:"url",placeholder:"https://example.com/paper",value:l,onChange:w=>g(w.target.value),onKeyPress:w=>{w.key==="Enter"&&k&&_&&(w.preventDefault(),S())}}),!k&&j.length>0&&e.jsx("p",{className:"text-xs text-destructive",children:"URL must start with http:// or https://"})]}),e.jsxs(le,{children:[e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:S,disabled:v.isPending||!k||!_,children:v.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),o==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),o==="pending"?"Submit for review":"Save Changes"]})})]})]})})}const zr=250,Hr=100;function Mr({open:t,onOpenChange:s,paperId:a,arxivId:r,initialTaskIds:n,initialTasks:c,onSuccess:o,submitMode:i="direct",isAuthor:l=!1}){const[g,f]=m.useState(n),[d,x]=m.useState(!1),[v,j]=m.useState(""),[k,_]=m.useState(""),[S,w]=m.useState(new Map),R=he(),{toast:C}=ee(),b=m.useRef(!1);m.useEffect(()=>{if(!t){b.current=!1;return}if(b.current)return;b.current=!0,f(n),j(""),_("");const p=new Map;(c||[]).forEach($=>{const I=parseInt($.id);Number.isNaN(I)||p.set(I,$)}),w(p)},[t,n,c]),m.useEffect(()=>{const p=window.setTimeout(()=>{_(v.trim())},zr);return()=>window.clearTimeout(p)},[v]);const{data:u,isFetching:h}=ie({queryKey:["tasks-search",k],queryFn:()=>ke.listTasks({page_size:Hr,...k?{q:k}:{}}),enabled:t});m.useEffect(()=>{var p;(p=u==null?void 0:u.results)!=null&&p.length&&w($=>{const I=new Map($);return u.results.forEach(D=>{const U=parseInt(D.id);Number.isNaN(U)||I.set(U,D)}),I})},[u]);const E=m.useMemo(()=>{const p=(u==null?void 0:u.results)||[],$=new Set,I=[],D=(M,J)=>{!J||Number.isNaN(M)||$.has(M)||(I.push(J),$.add(M))},U=()=>g.forEach(M=>D(M,S.get(M))),H=()=>p.forEach(M=>D(parseInt(M.id),M));return k?(H(),U()):(U(),H()),I},[u,g,S,k]),F=ce({mutationFn:async({paperId:p,taskIds:$})=>{if(i==="pending"){const I=await pe.submit({paper_id:parseInt(p),edit_type:"tasks",proposed_payload:{task_ids:$}});return ge(I,{toast:C,queryClient:R,paperIds:[p,r],queuedDescription:"Thanks! An admin will review your proposed task changes shortly."}),null}return Y.updateTasks(p,$)},onMutate:async({taskIds:p})=>{if(i==="pending")return{snapshots:[]};const $=p.map(U=>S.get(U)).filter(U=>!!U).map(U=>({id:U.id,name:U.name,slug:U.slug})).sort((U,H)=>U.name.localeCompare(H.name)),I=Array.from(new Set([a,r].filter(U=>!!U)));await Promise.all(I.flatMap(U=>[R.cancelQueries({queryKey:_e.detail(U)}),R.cancelQueries({queryKey:_e.arxiv(U)})]));const D=[];return I.forEach(U=>{[_e.detail(U),_e.arxiv(U)].forEach(H=>{const M=R.getQueryData(H);D.push({key:H,data:M}),M&&R.setQueryData(H,{...M,tasks:$})})}),o==null||o(),s(!1),{snapshots:D}},onSuccess:(p,{taskIds:$})=>{if(i==="pending"){o==null||o(),s(!1);return}C({title:"Tasks updated",description:`Saved ${$.length} task${$.length===1?"":"s"} for this paper.`}),p&&ve(R,p,[a,r])},onError:(p,$,I)=>{var U;(U=I==null?void 0:I.snapshots)==null||U.forEach(({key:H,data:M})=>{R.setQueryData(H,M)});const D=fe(p,i==="pending"?"Failed to submit your edit. Please try again.":"Failed to update paper tasks.");C({title:i==="pending"?"Could not submit edit":"Could not save tasks",description:D,variant:"destructive"})}}),z=()=>{i==="direct"&&n.some(p=>!g.includes(p))&&!window.confirm("Remove one or more task links from this paper?")||F.mutate({paperId:a,taskIds:g})},q=m.useMemo(()=>{if(g.length!==n.length)return!0;const p=new Set(n);return g.some($=>!p.has($))},[g,n]),K=(p,$)=>{f(I=>$?I.includes(p)?I:[...I,p]:I.filter(D=>D!==p))},G=()=>j("");return e.jsxs(te,{open:t,onOpenChange:s,children:[e.jsxs(se,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ae,{children:[e.jsx(re,{children:"Edit Paper Tasks"}),e.jsx(ne,{children:"Select the tasks that this paper addresses. You can select multiple tasks."})]}),i==="pending"&&e.jsx(xe,{isAuthor:l}),e.jsxs("div",{className:"relative mb-4",children:[e.jsx(Fe,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(W,{type:"text",placeholder:"Search tasks...",value:v,onChange:p=>j(p.target.value),className:"pl-9 pr-9"}),v&&e.jsx("button",{type:"button",onClick:G,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:e.jsx(Ct,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[400px]",children:E.length>0?e.jsx("div",{className:"space-y-2",children:E.map(p=>{const $=parseInt(p.id),I=g.includes($);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted/50 rounded-md",children:[e.jsx(Ve,{id:`task-${p.id}`,checked:I,onCheckedChange:D=>K($,D===!0),className:"!border !border-black data-[state=checked]:!bg-black data-[state=checked]:!text-white"}),e.jsxs("label",{htmlFor:`task-${p.id}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[p.name,p.description&&e.jsxs("span",{className:"block text-xs text-muted-foreground font-normal mt-1",children:[p.description.substring(0,100),p.description.length>100?"...":""]})]})]},p.id)})}):h?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(oe,{className:"w-8 h-8 mx-auto mb-2 animate-spin"}),e.jsx("p",{children:"Loading tasks..."})]}):e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(Fe,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:k?`No tasks found matching "${k}"`:"No tasks available"})]})}),e.jsxs(le,{children:[e.jsx(L,{variant:"ghost",className:"sm:mr-auto",onClick:()=>x(!0),children:"Suggest a new task"}),e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:z,disabled:F.isPending||!q,children:F.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),i==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),i==="pending"?"Submit for review":"Save Changes"]})})]})]}),e.jsx(Et,{open:d,onOpenChange:x,paperId:a,kind:"task"})]})}const Yt=10,qr=/^https?:\/\/(?:www\.|mobile\.)?(?:x|twitter)\.com\/(?:[A-Za-z0-9_]{1,15}|i\/web|i)\/status(?:es)?\/(\d{1,25})(?:[/?#].*)?$/;function Ce(t){var s;return((s=qr.exec(t.trim()))==null?void 0:s[1])??null}function Or({open:t,onOpenChange:s,paperId:a,arxivId:r,initialUrls:n,submitMode:c="direct",isAuthor:o=!1}){const[i,l]=m.useState(n),[g,f]=m.useState(""),[d,x]=m.useState(null),v=he(),{toast:j}=ee(),k=m.useRef(!1);m.useEffect(()=>{if(!t){k.current=!1;return}k.current||(k.current=!0,l(n),f(""),x(null))},[t,n]);const _=ce({mutationFn:async u=>{if(c==="pending"){const h=await pe.submit({paper_id:parseInt(a),edit_type:"x_threads",proposed_payload:{x_threads:u}});return ge(h,{toast:j,queryClient:v,paperIds:[a,r],queuedDescription:"Thanks! An admin will review your proposed X threads shortly."}),null}return Y.updateXThreads(a,u)},onSuccess:u=>{c!=="pending"&&u&&ve(v,u,[a,r]),s(!1)},onError:u=>{j({title:c==="pending"?"Could not submit edit":"Could not save X threads",description:fe(u,c==="pending"?"Failed to submit your edit. Please try again.":"Failed to update X threads."),variant:"destructive"})}}),S=()=>{const u=g.trim();if(!u)return i;const h=Ce(u);return h?i.some(E=>Ce(E)===h)?(x("This post is already listed."),null):i.length>=Yt?(x(`A paper can link at most ${Yt} X threads.`),null):[...i,u]:(x("Paste a post URL such as https://x.com/user/status/123…"),null)},w=()=>{const u=S();u!==null&&(l(u),f(""),x(null))},R=(u,h)=>{const E=[...i];[E[u],E[u+h]]=[E[u+h],E[u]],l(E)},C=()=>{const u=S();u!==null&&(c==="direct"&&n.some(h=>!u.some(E=>Ce(E)===Ce(h)))&&!window.confirm("Remove one or more X threads from this paper?")||_.mutate(u))},b=m.useMemo(()=>(g.trim()?[...i,g.trim()]:i).map(Ce).join()!==n.map(Ce).join(),[i,g,n]);return e.jsx(te,{open:t,onOpenChange:s,children:e.jsxs(se,{className:"max-w-2xl max-h-[600px]",children:[e.jsxs(ae,{children:[e.jsx(re,{children:"Edit X threads"}),e.jsx(ne,{children:"Link posts on X (formerly Twitter) in which the authors introduce this paper. A preview of each post is shown on the paper page."})]}),c==="pending"&&e.jsx(xe,{isAuthor:o}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",htmlFor:"x-thread-url",children:"Add X post URL"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(W,{id:"x-thread-url",type:"url",placeholder:"https://x.com/user/status/1234567890",value:g,onChange:u=>{f(u.target.value),x(null)},onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),w())},"aria-invalid":!!d,className:"flex-1"}),e.jsxs(L,{onClick:w,size:"sm",disabled:!g.trim(),children:[e.jsx(De,{className:"w-4 h-4 mr-1"}),"Add"]})]}),d&&e.jsx("p",{className:"text-xs text-destructive",children:d})]}),e.jsx("div",{className:"py-4 overflow-y-auto max-h-[350px]",children:i.length>0?e.jsx("div",{className:"space-y-2",children:i.map((u,h)=>e.jsxs("div",{className:"flex items-center space-x-2 p-3 bg-muted/30 rounded-lg",children:[e.jsx("span",{className:"flex-1 min-w-0 truncate text-sm font-medium",children:u}),e.jsx(L,{variant:"ghost",size:"sm",className:"h-8 px-2",disabled:h===0,onClick:()=>R(h,-1),"aria-label":"Move up",children:e.jsx(Ka,{className:"w-4 h-4"})}),e.jsx(L,{variant:"ghost",size:"sm",className:"h-8 px-2",disabled:h===i.length-1,onClick:()=>R(h,1),"aria-label":"Move down",children:e.jsx(Oa,{className:"w-4 h-4"})}),e.jsx(L,{variant:"ghost",size:"sm",className:"h-8 px-2 text-destructive hover:text-destructive",onClick:()=>l(i.filter(E=>E!==u)),"aria-label":"Remove X thread",children:e.jsx(Te,{className:"w-4 h-4"})})]},u))}):e.jsx("p",{className:"text-center py-8 text-sm text-muted-foreground",children:"No X threads linked yet"})}),e.jsxs(le,{children:[e.jsx(L,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),e.jsx(L,{onClick:C,disabled:_.isPending||!b,children:_.isPending?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2 animate-spin"}),c==="pending"?"Submitting...":"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-4 h-4 mr-2"}),c==="pending"?"Submit for review":"Save Changes"]})})]})]})})}function Kr({activeEditor:t,arxivId:s,editSubmitMode:a,evaluations:r,isAdmin:n,isLinkedAuthor:c,onOpenChange:o,paper:i}){if(!t)return null;const l={open:!0,paperId:i.id,arxivId:s,submitMode:a,isAuthor:c},g=d=>x=>o(d,x);return{tasks:()=>{var d;return e.jsx(Mr,{...l,onOpenChange:g("tasks"),initialTaskIds:((d=i.tasks)==null?void 0:d.map(x=>Number(x.id)))??[],initialTasks:i.tasks??[]})},methods:()=>{var d;return e.jsx(Ir,{...l,onOpenChange:g("methods"),initialMethodIds:((d=i.methods)==null?void 0:d.map(x=>Number(x.id)))??[],initialMethods:i.methods??[]})},repositories:()=>{var d;return e.jsx(Ur,{...l,onOpenChange:g("repositories"),initialRepositories:((d=i.repositories)==null?void 0:d.map(({url:x,is_official:v})=>({url:x,is_official:!!v})))??[]})},"project-pages":()=>{var d;return e.jsx(Dr,{...l,onOpenChange:g("project-pages"),initialProjectPages:((d=i.project_pages)==null?void 0:d.map(({url:x,is_official:v})=>({url:x,is_official:!!v})))??[]})},results:()=>e.jsx(wr,{...l,onOpenChange:g("results"),initialEvaluations:r,paperTasks:i.tasks??[],isAdmin:n}),"source-url":()=>e.jsx(Br,{...l,onOpenChange:g("source-url"),initialUrl:i.source_url??i.url_abs??""}),"hf-artifacts":()=>e.jsx(Nr,{...l,onOpenChange:g("hf-artifacts"),initialArtifacts:{hf_models:i.hf_models??[],hf_datasets:i.hf_datasets??[],hf_spaces:i.hf_spaces??[]}}),"x-threads":()=>{var d;return e.jsx(Or,{...l,onOpenChange:g("x-threads"),initialUrls:((d=i.x_threads)==null?void 0:d.map(({url:x})=>x))??[]})},organizations:()=>e.jsx(Tr,{open:!0,paperId:i.id,onOpenChange:g("organizations"),initialOrganizationIds:(i.organizations??[]).map(({id:d})=>Number(d)),submitMode:a,isAuthor:c})}[t]()}const Gr={"add-evals":{trigger:"add evals",running:"adding evals…",complete:"add evals ✓",title:"Add evaluations with Codex",description:t=>e.jsxs(e.Fragment,{children:["Codex will run the repository’s add-evals skill for “",t,"”. It will import only paper-native results onto existing, metric-compatible leaderboards. Accepted rows are written directly to the live database."]}),notice:"Comparator rows, unknown benchmarks, and unconfigured metrics will be skipped. Jobs run one at a time in submission order.",progress:"Codex is researching the paper and validating results against the configured leaderboards.",action:"Run add-evals",start:Fa,get:Aa,cancel:Ia},"enrich-paper":{trigger:"enrich paper",running:"enriching…",complete:"enriched ✓",title:"Enrich paper with Codex",description:t=>e.jsxs(e.Fragment,{children:["Codex will run the repository’s enrich-paper skill for “",t,"”. It will validate official code and project links, merge high-confidence taxonomy tags, and check the paper thumbnail. Accepted changes are written directly to the live database."]}),notice:"Uncertain URLs and missing taxonomy concepts will be reported rather than guessed. Jobs run one at a time in submission order.",progress:"Codex is validating artifacts, taxonomy tags, and thumbnail quality for this paper.",action:"Run enrich-paper",start:Ra,get:$a,cancel:Pa}};function Xr({report:t}){return e.jsx("div",{className:"min-w-0 max-h-[50vh] overflow-y-auto overflow-x-hidden rounded-md border bg-muted/40 p-4 text-sm leading-relaxed",children:e.jsx(Ua,{remarkPlugins:[Ba],components:{a:({children:s,...a})=>e.jsx("a",{...a,className:"break-all underline underline-offset-2",target:"_blank",rel:"noreferrer",children:s}),p:({children:s})=>e.jsx("p",{className:"mb-3 break-words last:mb-0",children:s}),ul:({children:s})=>e.jsx("ul",{className:"mb-3 list-disc space-y-1 pl-5 last:mb-0",children:s}),ol:({children:s})=>e.jsx("ol",{className:"mb-3 list-decimal space-y-1 pl-5 last:mb-0",children:s}),h1:({children:s})=>e.jsx("h3",{className:"mb-2 font-semibold",children:s}),h2:({children:s})=>e.jsx("h3",{className:"mb-2 font-semibold",children:s}),h3:({children:s})=>e.jsx("h3",{className:"mb-2 font-semibold",children:s}),code:({children:s})=>e.jsx("code",{className:"break-all rounded bg-background/80 px-1 py-0.5 font-mono text-xs",children:s}),pre:({children:s})=>e.jsx("pre",{className:"mb-3 max-w-full overflow-x-auto whitespace-pre-wrap break-words rounded bg-background/80 p-3 font-mono text-xs last:mb-0",children:s})},children:t})})}function Cs({kind:t,paperId:s,paperTitle:a,triggerClassName:r,onComplete:n}){const c=Gr[t],[o,i]=m.useState(!1),[l,g]=m.useState(null),[f,d]=m.useState(!1),[x,v]=m.useState(null),j=m.useRef(null),k=(l==null?void 0:l.status)==="awaiting_markdown",_=k||(l==null?void 0:l.status)==="queued"||(l==null?void 0:l.status)==="dispatching"||(l==null?void 0:l.status)==="running",S=l==null?void 0:l.id;m.useEffect(()=>{if(!_||!S)return;let b=!1;const u=window.setInterval(async()=>{try{const h=await c.get(S);b||(g(h),v(null))}catch(h){b||v(h instanceof Error?h.message:"Could not check job status.")}},k?6e4:2e3);return()=>{b=!0,window.clearInterval(u)}},[_,k,c,S]),m.useEffect(()=>{(l==null?void 0:l.status)!=="completed"||j.current===l.id||(j.current=l.id,n())},[l,n]);const w=async()=>{d(!0),v(null);try{g(await c.start(s))}catch(b){v(b instanceof Error?b.message:"Could not start Codex.")}finally{d(!1)}},R=()=>{g(null),v(null),j.current=null},C=async()=>{if(l){v(null);try{g(await c.cancel(l.id))}catch(b){v(b instanceof Error?b.message:"Could not cancel Codex.")}}};return e.jsxs(te,{open:o,onOpenChange:i,children:[e.jsx("button",{type:"button",className:r,onClick:()=>i(!0),children:k?"waiting for Markdown…":_?c.running:(l==null?void 0:l.status)==="completed"?c.complete:c.trigger}),e.jsxs(se,{className:"max-h-[90vh] w-[calc(100vw-2rem)] min-w-0 max-w-2xl overflow-hidden",children:[e.jsxs(ae,{className:"min-w-0",children:[e.jsx(re,{children:c.title}),e.jsx(ne,{children:c.description(a)})]}),l?e.jsxs("div",{className:"min-w-0 space-y-3 overflow-hidden",children:[e.jsxs("div",{className:"font-mono text-xs uppercase tracking-wide text-muted-foreground",children:["Status: ",l.status.replace("_"," ")]}),l.hf_job_url&&e.jsx("a",{className:"text-sm underline",href:l.hf_job_url,target:"_blank",rel:"noreferrer",children:"View Hugging Face Job"}),k&&e.jsxs("div",{className:"rounded-md border bg-muted/40 p-3 text-sm",children:[La," You can close this window and return."]}),_&&!k&&e.jsxs("div",{className:"rounded-md border bg-muted/40 p-3 text-sm",children:[l.status==="queued"?"This job is queued and will start after the current Codex job finishes.":c.progress," ","This can take several minutes; you can close this window and return."]}),l.report&&e.jsx(Xr,{report:l.report}),l.error&&!k&&e.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:l.error})]}):e.jsx("div",{className:"rounded-md border bg-muted/40 p-3 text-sm text-muted-foreground",children:c.notice}),x&&e.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:x}),e.jsxs(le,{children:[e.jsx(L,{variant:"outline",onClick:()=>i(!1),children:_?"Close":"Cancel"}),_&&e.jsx(L,{variant:"outline",onClick:()=>void C(),children:"Cancel job"}),!l&&e.jsx(L,{onClick:w,disabled:f,children:f?"Starting…":c.action}),l&&!_&&e.jsx(L,{variant:"outline",onClick:R,children:"Run again"})]})]})]})}function Qr(t){return e.jsx(Cs,{...t,kind:"add-evals",triggerClassName:"edit-link"})}function qe({accent:t,id:s,label:a}){return e.jsxs("div",{className:"section-rule paper-section-anchor",id:s,children:[e.jsx("span",{children:e.jsx("a",{href:`#${s}`,className:"section-anchor-link",children:a})}),t]})}function Vr({canCopyBadge:t,canEdit:s,evaluationsByTask:a,evaluationsLoading:r,isAdmin:n,onCopyBadge:c,onEdit:o,onRefresh:i,paper:l,visibleEvaluationCount:g}){return e.jsxs(e.Fragment,{children:[e.jsx(qe,{id:"results",label:"Results",accent:e.jsxs("span",{className:"accent",children:[g," benchmarks",t&&e.jsxs("button",{type:"button",className:"edit-link results-badge-copy",onClick:c,title:"Copy live leaderboard badges for your repository README",children:[e.jsx(V,{name:"copy",size:10})," Copy PwC badge"]}),n&&Ta()&&e.jsx(Qr,{paperId:Number(l.id),paperTitle:l.title,onComplete:i}),s&&e.jsx("button",{type:"button",onClick:o,className:"edit-link",children:"edit"})]})}),r?e.jsx(Ie,{className:"h-32 w-full"}):a.length>0?a.map(f=>e.jsxs("div",{className:f.taskSlug?"paper-section-anchor":void 0,id:f.taskSlug?gs(f.taskSlug):void 0,children:[e.jsxs("div",{className:"section-rule",children:[e.jsx("span",{children:f.taskSlug?e.jsxs(e.Fragment,{children:[e.jsx(ue,{to:`/tasks/${f.taskSlug}`,children:f.taskName}),e.jsx("a",{href:nr(f.taskSlug),className:"section-anchor-link results-task-permalink","aria-label":`Permalink to ${f.taskName} results on this paper`,title:"Link to this task's results",children:"#"})]}):f.taskName}),e.jsxs("span",{className:"accent",children:[f.rows.length," ",f.rows.length===1?"result":"results"]})]}),e.jsxs("table",{className:"results-table",children:[e.jsxs("colgroup",{children:[e.jsx("col",{style:{width:"28%"}}),e.jsx("col",{style:{width:"28%"}}),e.jsx("col",{style:{width:"14%"}}),e.jsx("col",{style:{width:"12%"}}),e.jsx("col",{style:{width:"8%"}}),e.jsx("col",{style:{width:"10%"}})]}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Benchmark"}),e.jsx("th",{children:"Model"}),e.jsx("th",{children:"Metric"}),e.jsx("th",{children:"Value"}),e.jsx("th",{children:"Rank"}),e.jsx("th",{children:"Compare"})]})}),e.jsx("tbody",{children:f.rows.map(d=>{var x;return e.jsxs("tr",{children:[e.jsx("td",{className:"benchmark",children:d.dataset_slug?e.jsx(ue,{to:`/benchmark/${d.dataset_slug}`,children:d.dataset_name||"—"}):d.dataset_name||"—"}),e.jsxs("td",{className:"model",title:d.model_name||void 0,children:[d.hf_model_url?e.jsx("a",{href:d.hf_model_url,target:"_blank",rel:"noopener noreferrer",className:"model-hf-link",title:`Open ${d.model_name||"model"} on Hugging Face`,children:d.model_name||"—"}):d.model_name||"—",d.is_open===!1&&e.jsx(ma,{}),(d.external??d.is_external)&&e.jsx(ha,{sourceUrl:d.source_url||d.external_source_url||d.result_url})]}),e.jsx("td",{className:"metric",children:d.best_metric}),e.jsx("td",{className:"value",children:Xs((x=d.metrics)==null?void 0:x[d.best_metric||""])}),e.jsx("td",{className:"rank",children:d.best_rank!=null?`#${d.best_rank}`:"—"}),e.jsx("td",{className:"compare",children:d.dataset_slug&&e.jsx(ue,{to:`/benchmark/${d.dataset_slug}?${[d.task_slug?`task=${encodeURIComponent(d.task_slug)}`:"",`eval=${encodeURIComponent(d.id)}`].filter(Boolean).join("&")}`,children:"Compare →"})})]},d.id)})})]})]},f.taskId)):e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-faint)"},children:"No benchmark results recorded yet."})]})}var $t="Radio",[Wr,Es]=Nt($t),[Yr,Jr]=Wr($t),Ss=m.forwardRef((t,s)=>{const{__scopeRadio:a,name:r,checked:n=!1,required:c,disabled:o,value:i="on",onCheck:l,form:g,...f}=t,[d,x]=m.useState(null),v=Le(s,_=>x(_)),j=m.useRef(!1),k=d?g||!!d.closest("form"):!0;return e.jsxs(Yr,{scope:a,checked:n,disabled:o,children:[e.jsx(Ne.button,{type:"button",role:"radio","aria-checked":n,"data-state":Is(n),"data-disabled":o?"":void 0,disabled:o,value:i,...f,ref:v,onClick:Ae(t.onClick,_=>{n||l==null||l(),k&&(j.current=_.isPropagationStopped(),j.current||_.stopPropagation())})}),k&&e.jsx(Rs,{control:d,bubbles:!j.current,name:r,value:i,checked:n,required:c,disabled:o,form:g,style:{transform:"translateX(-100%)"}})]})});Ss.displayName=$t;var Ps="RadioIndicator",$s=m.forwardRef((t,s)=>{const{__scopeRadio:a,forceMount:r,...n}=t,c=Jr(Ps,a);return e.jsx(rs,{present:r||c.checked,children:e.jsx(Ne.span,{"data-state":Is(c.checked),"data-disabled":c.disabled?"":void 0,...n,ref:s})})});$s.displayName=Ps;var Zr="RadioBubbleInput",Rs=m.forwardRef(({__scopeRadio:t,control:s,checked:a,bubbles:r=!0,...n},c)=>{const o=m.useRef(null),i=Le(o,c),l=ms(a),g=is(s);return m.useEffect(()=>{const f=o.current;if(!f)return;const d=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==a&&v){const j=new Event("click",{bubbles:r});v.call(f,a),f.dispatchEvent(j)}},[l,a,r]),e.jsx(Ne.input,{type:"radio","aria-hidden":!0,defaultChecked:a,...n,tabIndex:-1,ref:i,style:{...n.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Rs.displayName=Zr;function Is(t){return t?"checked":"unchecked"}var en=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],We="RadioGroup",[tn]=Nt(We,[os,Es]),As=os(),Fs=Es(),[sn,an]=tn(We),Ls=m.forwardRef((t,s)=>{const{__scopeRadioGroup:a,name:r,defaultValue:n,value:c,required:o=!1,disabled:i=!1,orientation:l,dir:g,loop:f=!0,onValueChange:d,...x}=t,v=As(a),j=Qs(g),[k,_]=ns({prop:c,defaultProp:n??null,onChange:d,caller:We});return e.jsx(sn,{scope:a,name:r,required:o,disabled:i,value:k,onValueChange:_,children:e.jsx(Vs,{asChild:!0,...v,orientation:l,dir:j,loop:f,children:e.jsx(Ne.div,{role:"radiogroup","aria-required":o,"aria-orientation":l,"data-disabled":i?"":void 0,dir:j,...x,ref:s})})})});Ls.displayName=We;var Ts="RadioGroupItem",Ds=m.forwardRef((t,s)=>{const{__scopeRadioGroup:a,disabled:r,...n}=t,c=an(Ts,a),o=c.disabled||r,i=As(a),l=Fs(a),g=m.useRef(null),f=Le(s,g),d=c.value===n.value,x=m.useRef(!1);return m.useEffect(()=>{const v=k=>{en.includes(k.key)&&(x.current=!0)},j=()=>x.current=!1;return document.addEventListener("keydown",v),document.addEventListener("keyup",j),()=>{document.removeEventListener("keydown",v),document.removeEventListener("keyup",j)}},[]),e.jsx(Ws,{asChild:!0,...i,focusable:!o,active:d,children:e.jsx(Ss,{disabled:o,required:c.required,checked:d,...l,...n,name:c.name,ref:f,onCheck:()=>c.onValueChange(n.value),onKeyDown:Ae(v=>{v.key==="Enter"&&v.preventDefault()}),onFocus:Ae(n.onFocus,()=>{var v;x.current&&((v=g.current)==null||v.click())})})})});Ds.displayName=Ts;var rn="RadioGroupIndicator",Us=m.forwardRef((t,s)=>{const{__scopeRadioGroup:a,...r}=t,n=Fs(a);return e.jsx($s,{...n,...r,ref:s})});Us.displayName=rn;var Bs=Ls,zs=Ds,nn=Us;const jt=m.forwardRef(({className:t,...s},a)=>e.jsx(Bs,{className:Oe("grid gap-2",t),...s,ref:a}));jt.displayName=Bs.displayName;const Re=m.forwardRef(({className:t,...s},a)=>e.jsx(zs,{ref:a,className:Oe("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...s,children:e.jsx(nn,{className:"flex items-center justify-center",children:e.jsx(Ys,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Re.displayName=zs.displayName;const on={pdf:"PDF",model:"Model",dataset:"Dataset",space:"Space",github:"GitHub"},vt=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,ln=/^[A-Za-z0-9][\w.-]*\/[A-Za-z0-9][\w.-]*$/,cn=20,yt="copy_to_bucket";function dn(t){const s=t.trim();if(!ln.test(s))return null;const[a,r]=s.split("/");return`https://huggingface.co/buckets/${encodeURIComponent(a)}/${encodeURIComponent(r)}`}function _t(t){return`pwc:bucket-copy:${t}`}function un(t){if(typeof window>"u"||new URL(window.location.href).searchParams.get(yt)!==t)return null;try{const a=window.sessionStorage.getItem(_t(t));if(!a)return null;const r=JSON.parse(a);return r.paperId!==t||typeof r.bucketId!="string"||!["new","existing"].includes(r.destinationMode)||!["public","private"].includes(r.visibility)||!Array.isArray(r.selectedIds)||r.selectedIds.some(n=>typeof n!="string")?null:r}catch{return null}}function mn(t,s=cn){if(s<1)throw new Error("Bucket copy batch size must be positive");const a=[];for(let r=0;r!vt.test(l)))return null;const o=c.join("/"),i=s==="model"?"":`${s}s/`;return{id:`${s}:${o}`,kind:s,label:o,url:`https://huggingface.co/${i}${o}`,source:`hf://${i}${o}/`,destination:`${s}s/${o}/`,repoId:o}}catch{return null}}function hn(t){try{const s=new URL(t);if(s.hostname!=="github.com"&&s.hostname!=="www.github.com")return null;const a=s.pathname.split("/").filter(Boolean);if(a.length<2)return null;const r=a[0],n=a[1].replace(/\.git$/,"");if(!vt.test(r)||!vt.test(n))return null;const c=`${r}/${n}`;return{id:`github:${c}`,kind:"github",label:c,url:`https://github.com/${c}`,source:`https://github.com/${c}.git`,destination:`github/${c}/`}}catch{return null}}function pn({githubUrls:t,hfModelUrls:s,hfDatasetUrls:a,hfSpaceUrls:r,paperId:n,pdfName:c,pdfUrl:o}){const i=[o?{id:"pdf",kind:"pdf",label:"Paper PDF",url:o,source:o,destination:`paper/${c||n}.pdf`}:null,...s.map(g=>ht(g,"model")),...a.map(g=>ht(g,"dataset")),...r.map(g=>ht(g,"space")),...t.map(hn)],l=new Set;return i.filter(g=>!g||l.has(g.id)?!1:(l.add(g.id),!0))}function fn(t,s,a){const r=["# Requires the Hugging Face CLI: https://huggingface.co/docs/huggingface_hub/guides/cli",`HF_BUCKET=${He(t.trim())}`];a.create&&r.push(`hf buckets create "$HF_BUCKET" --exist-ok${a.isPrivate?" --private":""}`);for(const o of s.filter(i=>i.kind!=="github"&&i.kind!=="pdf"))r.push(`hf cp ${He(o.source)} "hf://buckets/$HF_BUCKET/${o.destination}"`);const n=s.find(o=>o.kind==="pdf");n&&r.push('PWC_PDF="$(mktemp)"',`trap 'rm -f "$PWC_PDF"' EXIT`,`curl --fail --location ${He(n.source)} --output "$PWC_PDF"`,`hf cp "$PWC_PDF" "hf://buckets/$HF_BUCKET/${n.destination}"`);const c=s.filter(o=>o.kind==="github");if(c.length){r.push('PWC_COPY_DIR="$(mktemp -d)"',`trap 'rm -rf "$PWC_COPY_DIR"' EXIT`);for(const o of c){const i=`$PWC_COPY_DIR/${o.destination.replace(/\/$/,"")}`;r.push(`git clone --depth 1 -- ${He(o.source)} "${i}"`,`hf sync "${i}" "hf://buckets/$HF_BUCKET/${o.destination}" --exclude '.git/**'`)}}return r.join(` -`)}function gn(t){return`${(t.split(/[:|–—]/,1)[0]||t).normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48).replace(/-+$/g,"")||"paper"}-artifacts`}function xn(t){const{toast:s}=ee(),a=m.useMemo(()=>pn({githubUrls:t.githubUrls,hfDatasetUrls:t.hfDatasetUrls,hfModelUrls:t.hfModelUrls,hfSpaceUrls:t.hfSpaceUrls,paperId:t.paperId,pdfName:t.pdfName,pdfUrl:t.pdfUrl}),[t.githubUrls,t.hfDatasetUrls,t.hfModelUrls,t.hfSpaceUrls,t.paperId,t.pdfName,t.pdfUrl]),r=m.useMemo(()=>un(t.paperId),[t.paperId]),[n,c]=m.useState(!!r),[o,i]=m.useState((r==null?void 0:r.destinationMode)??"new"),[l,g]=m.useState((r==null?void 0:r.bucketId)??""),[f,d]=m.useState((r==null?void 0:r.visibility)??"public"),[x,v]=m.useState(()=>new Set((r==null?void 0:r.selectedIds)??a.map(p=>p.id))),[j,k]=m.useState(!1),[_,S]=m.useState(null),[w,R]=m.useState(!!r),C=a.filter(p=>x.has(p.id)),b=C.length===a.length,u=dn(l),h=u!==null,E=fn(l,C,{create:o==="new",isPrivate:f==="private"}),F=(p,$)=>{v(I=>{const D=new Set(I);return $?D.add(p):D.delete(p),D})},z=async()=>{try{await navigator.clipboard.writeText(E),s({title:"Bucket copy commands copied",description:"Run them in a terminal where the Hugging Face CLI is signed in."})}catch{s({title:"Copy failed",description:"Could not access the clipboard. Select and copy the commands manually.",variant:"destructive"})}},q=m.useCallback(()=>{const p=Js("/api/v1/auth/hf/login"),$=new URL(window.location.href);$.searchParams.set(yt,t.paperId),window.sessionStorage.setItem(_t(t.paperId),JSON.stringify({paperId:t.paperId,bucketId:l.trim(),destinationMode:o,visibility:f,selectedIds:Array.from(x)}));const I=new URLSearchParams({return_to:$.toString(),authorize_bucket:"true"});o==="new"&&I.set("bucket_create","true"),window.location.assign(`${p}?${I.toString()}`)},[l,o,t.paperId,x,f]),K=m.useCallback(async()=>{if(!t.isSignedIn){q();return}k(!0);let p=0,$=0;try{const I=C.filter(H=>H.kind!=="pdf"&&H.kind!=="github"&&!!H.repoId).map(H=>({kind:H.kind,repo_id:H.repoId})),D=mn(I);D.length||D.push([]);for(const[H,M]of D.entries()){S({current:H+1,total:D.length});const J=await Y.copyToBucket(t.paperId,{bucket_id:l.trim(),create:H===0&&o==="new",private:f==="private",include_pdf:H===0&&C.some(Z=>Z.kind==="pdf"),artifacts:M});p+=J.copied.length,$+=J.errors.length}const U=C.filter(H=>H.kind==="github").length;s({title:$?"Bucket copy partially completed":"Copied to bucket",description:[`${p} item${p===1?"":"s"} copied.`,$?`${$} item${$===1?"":"s"} failed.`:"",U?"Use the generated commands below to copy GitHub repositories.":""].filter(Boolean).join(" "),variant:$?"destructive":void 0,action:u?e.jsx(Zs,{altText:"Open destination bucket",asChild:!0,children:e.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",children:"Open bucket"})}):void 0}),!$&&!U&&c(!1)}catch(I){if(I instanceof gt&&I.code==="bucket_authorization_required"){q();return}s({title:p?"Bucket copy partially completed":"Bucket copy failed",description:p?`${p} item${p===1?"":"s"} copied before the request failed. You can retry or use the CLI commands below.`:I instanceof gt&&typeof I.detail=="string"?I.detail:"Hugging Face could not complete the copy. You can still use the CLI commands below.",variant:"destructive"})}finally{k(!1),S(null)}},[q,l,u,o,t.isSignedIn,t.paperId,C,s,f]);m.useEffect(()=>{if(!w||!t.isSignedIn)return;R(!1),window.sessionStorage.removeItem(_t(t.paperId));const p=new URL(window.location.href);p.searchParams.delete(yt),window.history.replaceState({},"",`${p.pathname}${p.search}${p.hash}`),K()},[K,t.isSignedIn,t.paperId,w]);const G=()=>{v(new Set(a.map(p=>p.id))),!l&&t.suggestedBucketId&&g(t.suggestedBucketId),c(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"sidebar-card copy-to-bucket-card",children:[e.jsxs("button",{type:"button",className:"copy-to-bucket-trigger",onClick:G,children:[e.jsx("span",{className:"copy-to-bucket-arrow","aria-hidden":"true",children:"→"}),e.jsx("span",{className:"copy-to-bucket-title",children:"Copy to bucket"}),e.jsx("span",{className:"copy-to-bucket-new",children:"New"})]}),e.jsx("div",{className:"copy-to-bucket-meta",children:a.length?`${a.length} linked artifact${a.length===1?"":"s"}`:"No linked artifacts yet"})]}),e.jsx(te,{open:n,onOpenChange:c,children:e.jsxs(se,{className:"max-h-[90vh] max-w-2xl grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden",children:[e.jsxs(ae,{children:[e.jsxs(re,{className:"flex items-center gap-2",children:[e.jsx("span",{className:"copy-to-bucket-dialog-arrow","aria-hidden":"true",children:"→"}),"Copy to bucket"]}),e.jsx(ne,{children:"Keep your own copy of this paper's PDF, linked code, and Hugging Face artifacts. Hub repositories use Xet's server-side copy; GitHub repositories use the generated CLI fallback."})]}),e.jsx("div",{className:"-mx-6 min-h-0 overflow-y-auto px-6",children:a.length?e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(de,{children:"Choose your destination"}),e.jsxs(jt,{value:o,onValueChange:p=>i(p),className:"grid grid-cols-2 gap-2",children:[e.jsxs(de,{className:"bucket-choice",children:[e.jsx(Re,{value:"new"}),"New bucket"]}),e.jsxs(de,{className:"bucket-choice",children:[e.jsx(Re,{value:"existing"}),"Existing bucket"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(de,{htmlFor:"bucket-id",children:"Bucket name"}),e.jsx(W,{id:"bucket-id",value:l,onChange:p=>g(p.target.value),placeholder:t.suggestedBucketId||"username/paper-artifacts","aria-invalid":l.length>0&&!h}),e.jsxs("div",{className:"flex items-center justify-between gap-3 text-xs",children:[e.jsx("p",{className:"text-muted-foreground",children:"Use the full Hugging Face bucket ID: namespace/name."}),u&&e.jsxs("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-1 underline underline-offset-4",children:["View bucket",e.jsx(V,{name:"external",size:10})]})]})]}),o==="new"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(de,{children:"Bucket visibility"}),e.jsxs(jt,{value:f,onValueChange:p=>d(p),className:"flex gap-5",children:[e.jsxs(de,{className:"flex items-center gap-2 font-normal",children:[e.jsx(Re,{value:"public"}),"Public"]}),e.jsxs(de,{className:"flex items-center gap-2 font-normal",children:[e.jsx(Re,{value:"private"}),"Private"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(de,{children:"Artifacts"}),e.jsx(L,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>v(b?new Set:new Set(a.map(p=>p.id))),children:b?"Deselect all":"Select all"})]}),e.jsx("div",{className:"bucket-artifact-list",children:a.map(p=>e.jsxs("div",{className:"bucket-artifact-row",children:[e.jsx(Ve,{id:`bucket-artifact-${p.id}`,checked:x.has(p.id),onCheckedChange:$=>F(p.id,$===!0)}),e.jsxs(de,{htmlFor:`bucket-artifact-${p.id}`,className:"min-w-0 flex-1 cursor-pointer font-normal",children:[e.jsx("span",{className:"bucket-artifact-kind",children:on[p.kind]}),e.jsx("span",{className:"bucket-artifact-name",children:p.label})]}),e.jsxs("a",{href:we(p.url)??void 0,target:"_blank",rel:"noopener noreferrer",className:"bucket-artifact-open",children:["Open",e.jsx(V,{name:"external",size:10})]})]},p.id))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The PDF and Hugging Face artifacts can be copied directly. GitHub repositories require the CLI workflow below."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(de,{htmlFor:"bucket-copy-commands",children:"CLI fallback"}),e.jsx("pre",{id:"bucket-copy-commands",className:"bucket-copy-commands h-[190px]",children:h?E:"Enter a bucket name above to prepare the copy commands."})]})]}):e.jsx("p",{className:"py-5 text-sm text-muted-foreground",children:"This paper does not have a linked GitHub repository or Hugging Face artifact to copy yet."})}),e.jsxs(le,{children:[e.jsx("a",{href:"https://huggingface.co/docs/huggingface_hub/en/guides/buckets",target:"_blank",rel:"noopener noreferrer",className:"mr-auto text-sm text-muted-foreground underline underline-offset-4",children:"About Hugging Face Buckets"}),e.jsxs(L,{type:"button",onClick:z,variant:"outline",disabled:!h||C.length===0,children:[e.jsx(V,{name:"copy",size:12}),"Copy commands"]}),e.jsx(L,{type:"button",onClick:K,disabled:j||t.isSignedIn&&(!h||!C.some(p=>p.kind!=="github")),children:j?_&&_.total>1?`Copying ${_.current}/${_.total}…`:"Copying…":t.isSignedIn?"Copy now":"Sign in & copy"})]})]})})]})}function bn({isLoading:t,papers:s}){return t?e.jsxs("div",{className:"sidebar-card","aria-busy":"true",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),e.jsx("div",{className:"related-meta",children:"Finding related work…"})]}):s!=null&&s.length?e.jsxs("div",{className:"sidebar-card",children:[e.jsx("div",{className:"sidebar-card-title",children:"Related papers"}),s.map(a=>e.jsxs(ue,{to:`/paper/${a.arxiv_id||a.id}`,target:"_blank",rel:"noopener noreferrer",className:"related-paper",style:{textDecoration:"none",color:"inherit"},children:[e.jsx("div",{className:"related-title",children:e.jsx(Me,{title:a.title})}),e.jsxs("div",{className:"related-meta",children:[e.jsx("span",{children:a.arxiv_id?`arXiv:${a.arxiv_id}`:"External resource"}),a.citation_count!=null&&e.jsxs("span",{children:[a.citation_count.toLocaleString()," cites"]})]})]},a.id))]}):null}const jn=/(https?:\/\/[^\s]+)/g;function vn({size:t=12}){return e.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:e.jsx("path",{fill:"currentColor",d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})}function Jt(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function yn(t){return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function _n({text:t}){return e.jsx("p",{className:"x-thread-text",children:t.split(jn).map((s,a)=>a%2===1?e.jsx("span",{className:"x-thread-link",children:s.replace(/^https?:\/\/(www\.)?/,"").replace(/\/$/,"")},a):e.jsx(m.Fragment,{children:s},a))})}function wn({thread:t}){const[s,a]=m.useState(!1);return!t.author_avatar_url||s?e.jsx("span",{className:"x-thread-avatar x-thread-avatar--fallback","aria-hidden":"true",children:t.author_name.charAt(0).toUpperCase()}):e.jsx("img",{className:"x-thread-avatar",src:t.author_avatar_url,alt:"",loading:"lazy",referrerPolicy:"no-referrer",onError:()=>a(!0)})}function kn(){var t;return((t=window.matchMedia)==null?void 0:t.call(window,"(prefers-reduced-motion: reduce)").matches)??!1}function Nn({thread:t}){const[s,a]=m.useState(!1),[r,n]=m.useState(null),[c,o]=m.useState(!1),i=m.useRef(null),{targetRef:l,isIntersecting:g}=za({rootMargin:"200px"}),f=t.video_url;if(m.useEffect(()=>{if(!f||r||c||!g||kn())return;const x=new AbortController;return fetch(f,{referrerPolicy:"no-referrer",signal:x.signal}).then(v=>{if(!v.ok)throw new Error(`HTTP ${v.status}`);return v.blob()}).then(v=>n(URL.createObjectURL(v))).catch(()=>{x.signal.aborted||o(!0)}),()=>x.abort()},[f,r,c,g]),m.useEffect(()=>()=>{r&&URL.revokeObjectURL(r)},[r]),m.useEffect(()=>{const x=i.current;x&&(g?x.play().catch(()=>{}):x.pause())},[g,r]),!t.media_url||s)return null;const d=r&&!c;return e.jsx("div",{className:"x-thread-media",ref:l,children:d?e.jsx("video",{ref:i,src:r,poster:t.media_url,muted:!0,loop:!0,playsInline:!0,autoPlay:!0,"aria-label":"Video",onError:()=>o(!0)}):e.jsxs(e.Fragment,{children:[e.jsx("img",{src:t.media_url,alt:"",loading:"lazy",referrerPolicy:"no-referrer",onError:()=>a(!0)}),t.media_type==="video"&&e.jsx("span",{className:"x-thread-play","aria-label":"Video",children:"▶"})]})})}function Cn({thread:t}){const s=we(t.url);return s?e.jsxs("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"x-thread",children:[e.jsxs("div",{className:"x-thread-header",children:[e.jsx(wn,{thread:t}),e.jsxs("span",{className:"x-thread-author",children:[e.jsx("span",{className:"x-thread-name",children:t.author_name}),e.jsxs("span",{className:"x-thread-handle",children:["@",t.author_handle]})]}),e.jsx("span",{className:"x-thread-logo",children:e.jsx(vn,{})})]}),e.jsx(_n,{text:t.text}),e.jsx(Nn,{thread:t}),e.jsxs("div",{className:"x-thread-meta",children:[t.posted_at&&e.jsx("time",{dateTime:t.posted_at,children:yn(t.posted_at)}),t.like_count!=null&&e.jsxs("span",{children:["♥ ",Jt(t.like_count)]}),t.reply_count!=null&&t.reply_count>0&&e.jsxs("span",{children:[Jt(t.reply_count)," ",t.reply_count===1?"reply":"replies"]}),e.jsx("span",{className:"x-thread-read",children:"Read on X →"})]})]}):null}function En({onEdit:t,threads:s}){return e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"X threads"}),e.jsxs("span",{className:"badge",children:[s.length," post",s.length===1?"":"s",e.jsx("button",{type:"button",onClick:t,className:"edit-link",children:"edit"})]})]}),s.length>0?e.jsx("div",{className:"x-thread-list",children:s.map(a=>e.jsx(Cn,{thread:a},a.tweet_id))}):e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",padding:"6px 0"},children:"No author threads linked yet."})]})}const pt=3,Zt=3;function Sn(t){return t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function Pn({allHfArtifactUrls:t,citationCopied:s,citationDisplay:a,hfArtifactViewer:r,onCopyCitation:n,onEditHfArtifacts:c,onEditRepositories:o,onEditXThreads:i,paper:l,relatedIsLoading:g,relatedPapers:f,user:d}){var _;const[x,v]=m.useState(!1),j=[...l.repositories??[]].sort((S,w)=>Number(w.is_official)-Number(S.is_official)||(w.num_stars||0)-(S.num_stars||0)),k=(x?j:j.slice(0,pt)).map(S=>({...S,safeHref:we(S.url)}));return e.jsxs("aside",{className:"detail-sidebar",children:[e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"GitHub"}),e.jsxs("span",{className:"badge",children:[j.length," repo",j.length===1?"":"s",e.jsx("button",{type:"button",onClick:o,className:"edit-link",children:"edit"})]})]}),k.filter(({safeHref:S})=>S).map(S=>e.jsxs("a",{href:S.safeHref??void 0,target:"_blank",rel:"noopener noreferrer",className:"code-line",style:{textDecoration:"none"},children:[e.jsxs("span",{className:"code-line-repo",children:[e.jsx(V,{name:"github",size:12}),e.jsxs("span",{className:"code-line-repo-name",children:[S.owner,"/",S.name]}),S.is_official&&e.jsx("span",{className:"code-line-official",children:"· Official"})]}),e.jsxs("span",{className:"code-line-stars",children:["★ ",Sn(S.num_stars)]})]},S.id)),j.length===0&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--ink-faint)",padding:"6px 0"},children:"No GitHub repositories linked yet."}),j.length>pt&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>v(S=>!S),children:x?"− show top 3":`+ show ${j.length-pt} more repos`})]}),e.jsx($n,{viewer:r,onEdit:c}),e.jsx(En,{threads:l.x_threads??[],onEdit:i}),e.jsx(xn,{githubUrls:j.map(({url:S})=>S),hfModelUrls:t.models,hfDatasetUrls:t.datasets,hfSpaceUrls:t.spaces,paperId:l.id,pdfName:((_=l.arxiv_id)==null?void 0:_.replace("/","-"))||l.id,pdfUrl:l.url_pdf,isSignedIn:!!d,suggestedBucketId:d?`${d.username}/${gn(l.title)}`:void 0}),e.jsx(bn,{isLoading:g,papers:f}),e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[e.jsx("span",{children:"Citation"}),e.jsxs("button",{type:"button",className:"citation-copy-btn",onClick:n,"aria-label":"Copy citation to clipboard",title:"Copy citation to clipboard",children:[e.jsx(V,{name:"copy",size:11}),s?"Copied":"Copy"]})]}),e.jsx("pre",{style:{fontFamily:"var(--mono)",fontSize:10.5,lineHeight:1.5,color:"var(--ink-soft)",whiteSpace:"pre-wrap",wordBreak:"break-word",margin:0},children:a})]})]})}function $n({onEdit:t,viewer:s}){return e.jsxs("div",{className:"sidebar-card",children:[e.jsxs("div",{className:"sidebar-card-title",children:[s.paperHref?e.jsx("a",{href:s.paperHref,target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"none"},children:"🤗 Hugging Face"}):e.jsx("span",{children:"🤗 Hugging Face"}),e.jsx("button",{type:"button",onClick:t,className:"edit-link",children:"edit"})]}),s.isLoading?e.jsx(Ie,{className:"h-16 w-full"}):e.jsxs(e.Fragment,{children:[s.rows.map(a=>e.jsx(Rn,{...a},a.label)),s.footer&&e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:10,color:"var(--ink-faint)",marginTop:12},children:s.footer})]})]})}function Rn({count:t,href:s,isLimited:a,label:r,links:n}){const[c,o]=m.useState(!1),i=((n==null?void 0:n.length)??0)>Zt,l=c?n:n==null?void 0:n.slice(0,Zt),g=t!=null?`${t}${a?"+":""}`:"—";return e.jsxs("div",{className:"hf-artifact-row",children:[e.jsxs("div",{className:"hf-artifact-row-header",children:[e.jsx("span",{children:r}),t?e.jsx("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"hf-artifact-count",children:g}):e.jsx("span",{className:"hf-artifact-count hf-artifact-count--empty",children:g})]}),l!=null&&l.length?e.jsxs("div",{className:"hf-artifact-links",children:[l.map(f=>e.jsx("a",{href:f.href,target:"_blank",rel:"noopener noreferrer",children:f.label},f.href)),i&&e.jsx("button",{type:"button",className:"hf-artifact-toggle","aria-expanded":c,onClick:()=>o(f=>!f),children:c?"Show fewer":`View all ${n.length}`})]}):null]})}function In({abstract:t,mentions:s}){const a=[];let r=0;for(const n of[...s].sort((c,o)=>c.start-o.start))n.startt.length||t.slice(n.start,n.end)===n.surface&&(a.push(e.jsx(bt,{text:t.slice(r,n.start)},`t${r}`)),a.push(e.jsx(Ea,{entity:{kind:n.entity_type,slug:n.slug},className:"abstract-entity-link",newTab:!1,initialPreview:n.preview?{name:n.preview.name,description:n.preview.description??null,imageUrl:n.preview.image_url??null,count:n.preview.count??null,detail:n.preview.detail??null}:void 0,children:n.surface},`m${n.start}`)),r=n.end);return a.push(e.jsx(bt,{text:t.slice(r)},`t${r}`)),e.jsx(e.Fragment,{children:a})}function An(t,s){const a=t.arxiv_id?` (arXiv:${t.arxiv_id.replace(/v\d+$/i,"")})`:"";return`About the paper "${t.title}"${a}: ${s}`}function Fn({paper:t,readerChatRoute:s}){const a=ea()&&!!(t.id&&t.abstract),r=t.suggested_questions,{data:n}=ie({queryKey:["paper-suggested-questions",t.id],queryFn:()=>Y.suggestedQuestions(String(t.id)),enabled:a&&Array.isArray(r)&&r.length===0,staleTime:o=>{var i;return(i=o.state.data)!=null&&i.questions.length?1/0:0},retry:!1}),c=r!=null&&r.length?r:(n==null?void 0:n.questions)??[];return!a||c.length===0?null:e.jsx("ul",{className:"suggested-questions","aria-label":"Ask about this paper",children:c.map(o=>{const i=s?`${s}?q=${encodeURIComponent(o)}`:`/chat?q=${encodeURIComponent(An(t,o))}`;return e.jsx("li",{children:e.jsxs(ue,{className:"suggested-question",to:i,onClick:s?()=>cs(s):void 0,children:[e.jsx(V,{name:"chat",size:12}),e.jsx("span",{children:o})]})},o)})})}function Ln({canEdit:t,onEditMethods:s,onEditTasks:a,paper:r,readerChatRoute:n}){var i,l,g;const c=r.abstract||"",[o]=m.useState(()=>window.location.hash==="#tldr");return e.jsxs(e.Fragment,{children:[e.jsx(qe,{id:"abstract",label:"Abstract"}),e.jsx("p",{className:"abstract-text",children:(i=r.abstract_mentions)!=null&&i.length?e.jsx(In,{abstract:c,mentions:r.abstract_mentions}):e.jsx(bt,{text:c})}),r.tldr&&e.jsxs("details",{className:"tldr-details paper-section-anchor",id:"tldr",open:o,children:[e.jsxs("summary",{children:[e.jsx("span",{className:"tldr-toggle-show",children:"Show TL;DR"}),e.jsx("span",{className:"tldr-toggle-hide",children:"Hide TL;DR"}),e.jsx("span",{className:"tldr-toggle-hint",children:"short summary"})]}),e.jsx("div",{className:"tldr-box",children:r.tldr})]}),e.jsx(Fn,{paper:r,readerChatRoute:n}),e.jsx(qe,{id:"tasks",label:"Tasks",accent:e.jsxs("span",{className:"accent",children:[((l=r.tasks)==null?void 0:l.length)||0," tagged",t&&e.jsx("button",{type:"button",onClick:a,className:"edit-link",children:"edit"})]})}),e.jsx("div",{className:"paper-tags",style:{marginBottom:8},children:(r.tasks??[]).map(f=>e.jsx(la,{slug:f.slug||"",label:f.name},f.id))}),e.jsx(qe,{id:"methods",label:"Methods",accent:e.jsxs("span",{className:"accent",children:[((g=r.methods)==null?void 0:g.length)||0," used",t&&e.jsx("button",{type:"button",onClick:s,className:"edit-link",children:"edit"})]})}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:8},children:(r.methods??[]).map(f=>e.jsx(ca,{method:f},f.id))})]})}const Ee=["my-bookmark-ids"],wt="pwc:pending-bookmark";function es(t){window.sessionStorage.setItem(wt,JSON.stringify(t)),window.location.assign(Ha(!0))}function Tn(){var r,n;const{user:t}=Ge(),s=ie({queryKey:Ee,queryFn:()=>xt.getBookmarkIds(),enabled:!!t,staleTime:60*1e3,refetchOnWindowFocus:!1}),a=Ke.useMemo(()=>{var c;return new Set(((c=s.data)==null?void 0:c.paper_ids)??[])},[(r=s.data)==null?void 0:r.paper_ids]);return{ids:((n=s.data)==null?void 0:n.paper_ids)??[],idSet:a,isLoading:s.isLoading,isError:s.isError}}function Dn(){const{user:t}=Ge(),s=he(),a=ce({mutationFn:async({paperId:n,isBookmarked:c})=>{c?await xt.removeBookmark(n):await xt.addBookmark(n)},onMutate:async({paperId:n,isBookmarked:c})=>{await s.cancelQueries({queryKey:Ee});const o=s.getQueryData(Ee),i=typeof n=="string"?Number(n):n,l=(o==null?void 0:o.paper_ids)??[],g=c?l.filter(f=>f!==i):[i,...l.filter(f=>f!==i)];return s.setQueryData(Ee,{paper_ids:g}),{previous:o}},onError:(n,c,o)=>{o!=null&&o.previous&&s.setQueryData(Ee,o.previous),n instanceof gt&&n.code==="saved_papers_bucket_authorization_required"&&es(c)},onSettled:()=>{s.invalidateQueries({queryKey:Ee}),s.invalidateQueries({queryKey:[..._e.feeds.saved]})}});return Ke.useEffect(()=>{if(!t||a.isPending)return;const n=new URL(window.location.href);if(n.searchParams.get(Xt)!=="1")return;n.searchParams.delete(Xt),window.history.replaceState({},"",`${n.pathname}${n.search}${n.hash}`);const c=window.sessionStorage.getItem(wt);if(c){window.sessionStorage.removeItem(wt);try{const o=JSON.parse(c);(typeof o.paperId=="number"||typeof o.paperId=="string")&&typeof o.isBookmarked=="boolean"&&a.mutate(o)}catch{}}},[a,t]),{toggle:Ke.useCallback((n,c)=>{if(!t){if(ls())return;es({paperId:n,isBookmarked:c});return}a.mutate({paperId:n,isBookmarked:c})},[a,t]),isPending:a.isPending}}const Un=({paperId:t})=>{const{user:s}=Ge(),{idSet:a}=Tn(),{toggle:r,isPending:n}=Dn();if(ls())return null;const c=Number(t),o=!!s&&a.has(c),i=()=>{Number.isFinite(c)&&r(c,o)},l=s&&o?"Saved":"Save",g=s?o?"Remove from saved papers":"Save this paper":"Sign in with Hugging Face to save this paper";return e.jsxs("button",{type:"button",className:`action-btn${o?" is-saved":""}`,onClick:i,disabled:n,"aria-pressed":o,"aria-label":g,title:g,children:[e.jsx(V,{name:"bookmark",size:12}),l]})};function ft({children:t,showEdit:s=!1,onEdit:a,editAriaLabel:r}){return s?e.jsxs("span",{className:"action-btn-composite",children:[t,e.jsx("button",{type:"button",className:"action-btn-segment action-btn-edit",onClick:a,"aria-label":r,children:"edit"})]}):t}function Bn(t){return e.jsx(Cs,{...t,kind:"enrich-paper",triggerClassName:"action-btn"})}const zn={tasks:"tasks",methods:"methods",results:"evaluation results",repositories:"GitHub repositories","project-pages":"project pages","hf-artifacts":"Hugging Face artifacts",organizations:"organizations","source-url":"source URL","x-threads":"X threads"};function ts(t){if(!t)return"—";try{return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function ss(t,s){try{const a=new URL(t),n=a.pathname.replace(/\/$/,"").split("/").filter(Boolean).at(-1);return n?n.replace(/[-_]+/g," "):a.hostname.replace(/^www\./,"")}catch{return s}}const Ii=()=>{const{arxivId:t}=ta(),s=as(),{toast:a}=ee(),{user:r}=Ge(),n=(r==null?void 0:r.is_admin)??!1,c=!!r,o=Ga(r),{arxivId:i,evaluations:l,evaluationsByTask:g,evaluationsLoading:f,paper:d,paperError:x,paperLoading:v,presentation:j,refetchEvaluations:k,refetchPaper:_,relatedQuery:S,versions:w,visibleEvaluations:R}=lr(t,o),[C,b]=m.useState(!1),{activeEditor:u,openEditor:h,setEditorOpen:E}=ur();m.useEffect(()=>{o!=="direct"||!(d!=null&&d.id)||(u&&u!=="results"&&Y.primeCurationState(d.id).catch(()=>{}),u==="results"&&Xe.primeCurationState(d.id).catch(()=>{}))},[u,o,d==null?void 0:d.id]);const[F,z]=m.useState(null),q=m.useRef(!1);m.useEffect(()=>{if(!r||!d||q.current)return;const P=sessionStorage.getItem("pwc:fresh-auth-edit");if(!P)return;q.current=!0;const O=dr(P);if(!Y.freshAuthMutationDraft()){sessionStorage.removeItem("pwc:fresh-auth-edit"),O&&h(O);return}if(!window.confirm("You signed in again. Apply the saved destructive catalog edit now? The server will recheck the current catalog version before changing anything.")){a({title:"Edit kept locally",description:"Nothing was changed. Reload this paper when you are ready to confirm the saved edit."});return}Y.resumeFreshAuthMutation().then(()=>{a({title:"Edit applied",description:"The restored catalog edit was applied."}),window.location.reload()}).catch($e=>{a({variant:"destructive",title:"Could not apply the saved edit",description:$e instanceof Error?$e.message:"Please reload and review the edit again."})})},[h,d,a,r]);const K=m.useMemo(()=>{if(!r||!(d!=null&&d.author_links))return!1;const P=r.username.toLowerCase();return d.author_links.some(O=>!!O.hf_username&&O.hf_username.toLowerCase()===P)},[r,d==null?void 0:d.author_links]),G=P=>{if(!c){z(P);return}h(P)},[p,$]=m.useState("idle"),[I,D]=m.useState(null),[U,H]=m.useState(null),M=async()=>{if(i){$("indexing"),D(null),H(null);try{await Y.indexFromArxiv(i),a({title:"Indexed",description:"Paper added to database."}),setTimeout(()=>_(),1200),$("idle")}catch(P){const O=P;let be=O.message||"Failed to index paper";if(O.response)try{be=JSON.parse(O.response).detail||be}catch{be=O.response}D(be),(O.status===429||O.status===503)&&H("Try again later after arXiv has lifted the temporary limit."),$("idle")}}},J=(j==null?void 0:j.citationCopy)??"",Z=(j==null?void 0:j.copyableRanks)??[],[Ye,Ue]=m.useState(!1),ye=async()=>{if(J)try{await navigator.clipboard.writeText(J),Ue(!0),a({title:"Citation copied",description:"BibTeX entry copied to clipboard."}),window.setTimeout(()=>Ue(!1),1500)}catch{a({title:"Copy failed",description:"Could not access the clipboard. Please copy manually.",variant:"destructive"})}},y=async()=>{if(!d)return;const P=d.arxiv_id||d.id,O=Qa(P,Z);if(O)try{await navigator.clipboard.writeText(O),a({title:"PwC badges copied",description:"Each badge follows its current leaderboard result."})}catch{a({title:"Copy failed",description:"Could not access the clipboard. Please try again.",variant:"destructive"})}};if(v)return e.jsxs("div",{className:"page",children:[e.jsx(Ie,{className:"h-12 w-3/4 mb-4"}),e.jsx(Ie,{className:"h-6 w-1/3 mb-8"}),e.jsx(Ie,{className:"h-64 w-full"})]});if(x||!d)return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(ue,{to:"/papers",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsxs("span",{style:{color:"var(--ink)"},children:["arXiv:",i]})]}),e.jsx("h1",{className:"detail-title",children:"Paper not indexed yet"}),e.jsxs("p",{style:{fontFamily:"var(--serif)",color:"var(--ink-soft)",marginTop:16,maxWidth:640},children:["We don't have ",e.jsxs("span",{style:{fontFamily:"var(--mono)"},children:["arXiv:",i]})," in the database. You can index it from arXiv right now."]}),I&&e.jsx(va,{variant:"destructive",className:"mt-4 max-w-xl",children:e.jsxs(ya,{children:[e.jsx("div",{children:I}),U&&e.jsx("div",{className:"mt-2",children:U})]})}),e.jsxs("div",{className:"action-row",children:[n&&e.jsxs("button",{className:"action-btn",onClick:M,disabled:p==="indexing",children:[e.jsx(V,{name:"sparkle",size:12}),p==="indexing"?"Indexing…":"Index from arXiv"]}),e.jsx(L,{variant:"outline",onClick:()=>s("/papers"),children:"Browse Papers"})]})]});if(!j)return null;const{allHfArtifactUrls:N,authorEntries:A,citationDisplay:T,hasIntroducedItems:Q,hasLineageItems:X,hfArtifactViewer:B,introducedBenchmarks:Hs,introducedFrameworks:Rt,introducedMethods:Ms,introducedSummary:qs,numPages:It,paperSourceLabel:At,predecessorPapers:Je,projectPages:Se,safeAbstractUrl:Be,safeConferenceUrl:Ft,safePdfUrl:Lt,successorPapers:Ze}=j,ze=12,Pe=ga(d,i),Os=Pe&&Bt()&&sa()&&(!zt()||n)?Pe:null,Tt=d.organizations||[],Dt=P=>{const O=Ma(P)??P.name;return e.jsx(ue,{to:`/orgs/${P.slug}`,className:`detail-title-org${P.logo_url?" detail-title-org--logo":""}`,title:P.name,"aria-label":P.name,children:P.logo_url?e.jsx("img",{src:P.logo_url,alt:"",onError:be=>{var $e;($e=be.currentTarget.parentElement)==null||$e.classList.remove("detail-title-org--logo"),be.currentTarget.replaceWith(O)}}):O},P.id)},Ut=C||A.length<=ze?A:A.slice(0,ze);return e.jsxs("div",{className:"page",children:[e.jsxs("div",{className:"breadcrumb",children:[e.jsx(ue,{to:"/",children:"Trending"}),e.jsx("span",{className:"sep",children:"/"}),d.arxiv_id&&Be?e.jsxs("a",{className:"breadcrumb-external",href:Be,target:"_blank",rel:"noopener noreferrer",title:"Open on arXiv",children:[At,e.jsx("span",{"aria-hidden":"true",children:"↗"})]}):e.jsx("span",{children:At})]}),e.jsxs("div",{className:"detail-grid",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"detail-hero",children:[e.jsxs("div",{className:"detail-hero-main",children:[e.jsxs("h1",{className:"detail-title",children:[e.jsx(Me,{title:d.title}),Tt.slice(0,-1).map(Dt),e.jsxs("span",{className:"detail-title-tail",children:[Tt.slice(-1).map(Dt),e.jsx("button",{type:"button",className:"detail-title-edit",onClick:()=>G("organizations"),title:"Edit organizations","aria-label":"Edit organizations",children:e.jsx(V,{name:"pencil",size:11})})]})]}),e.jsxs("div",{className:"detail-meta",children:[e.jsxs("span",{children:["Submitted ",ts(d.published)]}),It&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[It," pages"]})]}),d.citation_count!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[d.citation_count.toLocaleString()," citations"]})]}),(d.proceeding||d.conference_slug)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),d.conference_slug?e.jsx("a",{href:`/conferences/${d.conference_slug}`,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-text)"},children:(d.proceeding||d.conference_name||"").replace(/\s+\d{1,2}$/,"")}):e.jsx("span",{children:d.proceeding.replace(/\s+\d{1,2}$/,"")})]}),w.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("select",{className:"version-select",value:d.version,onChange:P=>{const O=P.target.value;d.arxiv_id&&s(`/paper/${d.arxiv_id.replace(/v\d+$/,"")}${O?`?version=${O}`:""}`)},children:w.map(P=>e.jsxs("option",{value:P.version,children:[P.version," — ",ts(P.published)]},P.version))})]})]}),e.jsxs("div",{className:"detail-authors",children:[Ut.map((P,O)=>e.jsxs(Ke.Fragment,{children:[P.hf_username&&e.jsx(qa,{className:"detail-author-avatar",url:P.hf_avatar_url}),P.id?e.jsx(ue,{to:`/authors/${P.id}`,children:P.name}):P.hf_username?e.jsx("a",{href:`https://huggingface.co/${P.hf_username}`,target:"_blank",rel:"noopener noreferrer",title:`@${P.hf_username} on Hugging Face`,children:P.name}):e.jsx("a",{children:P.name}),Oze&&e.jsx("button",{className:"show-more-authors",onClick:()=>b(P=>!P),style:{marginLeft:8,background:"none",border:"none",cursor:"pointer",color:"var(--accent-text)",fontFamily:"var(--mono)",fontSize:12},children:C?"show fewer":`+${d.authors.length-ze} more`})]}),e.jsxs("div",{className:"action-row",children:[Pe&&Bt()&&(!zt()||r!=null&&r.is_admin)?e.jsxs(ue,{className:"action-btn",to:Pe,onClick:()=>cs(Pe),children:[e.jsx(V,{name:"pdf",size:12})," Read paper",e.jsx("span",{className:"nav-new-badge","aria-hidden":"true",children:"New"})]}):Lt?e.jsxs("a",{className:"action-btn",href:Lt,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(V,{name:"pdf",size:12})," View PDF"]}):null,Be&&d.source==="external"&&e.jsx(ft,{showEdit:!0,onEdit:()=>G("source-url"),editAriaLabel:"Edit source URL",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:Be,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(V,{name:"external",size:12})," Source page"]})}),Se.length===1?e.jsx(ft,{showEdit:!0,onEdit:()=>G("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs("a",{className:"action-btn-segment action-btn-main",href:Se[0].safeHref??void 0,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(V,{name:"globe",size:12})," Project page"]})}):null,Se.length>1?e.jsx(ft,{showEdit:!0,onEdit:()=>G("project-pages"),editAriaLabel:"Edit project pages",children:e.jsxs(aa,{children:[e.jsx(ra,{asChild:!0,children:e.jsxs("button",{type:"button",className:"action-btn-segment action-btn-main",children:[e.jsx(V,{name:"globe",size:12})," Project page"]})}),e.jsx(na,{align:"start",className:"project-page-menu",children:Se.map((P,O)=>e.jsx(ia,{asChild:!0,children:P.safeHref?e.jsx("a",{href:P.safeHref,target:"_blank",rel:"noopener noreferrer",children:ss(P.url,`Project page ${O+1}`)}):e.jsx("span",{children:ss(P.url,`Project page ${O+1}`)})},P.url))})]})}):null,Se.length===0&&c?e.jsxs("button",{type:"button",className:"action-btn",onClick:()=>G("project-pages"),title:"Add project page",children:[e.jsx(V,{name:"globe",size:12})," Add project page"]}):null,Ft&&e.jsxs("a",{className:"action-btn",href:Ft,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(V,{name:"external",size:12})," Conference"]}),e.jsx(mr,{paperId:Number(d.id)}),n&&Da()&&e.jsx(Bn,{paperId:Number(d.id),paperTitle:d.title,onComplete:()=>void _()}),e.jsx(Un,{paperId:d.id})]}),d.leaderboard_ranks&&d.leaderboard_ranks.length>0&&e.jsx(da,{wrap:!0,paperHref:`/paper/${d.arxiv_id||d.id}`,ranks:fa(d.leaderboard_ranks)})]}),e.jsx("div",{className:"detail-hero-thumb detail-thumb-wrap",children:e.jsx(ua,{paperId:d.arxiv_id||d.id,title:d.title,thumbnailUrl:oa(d.thumbnail_url),priority:!0})})]}),Q&&e.jsxs("div",{className:`introduced-banner${Rt.length>0?" introduced-banner--framework":""}`,children:[e.jsx("span",{className:"introduced-label",children:"Introduced"}),e.jsxs("div",{className:"introduced-methods",children:[Ms.map(P=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>s(`/methods/${P.slug||P.id}`),children:[P.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`method-${P.id}`)),Hs.map(P=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>s(`/benchmark/${P.slug||P.id}`),children:[P.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`benchmark-${P.id}`)),Rt.map(P=>e.jsxs("button",{type:"button",className:"introduced-pill",onClick:()=>s(`/frameworks#framework-${P.slug}`),children:[P.name,e.jsx("span",{className:"introduced-arrow",children:"→"})]},`framework-${P.slug}`))]}),e.jsxs("span",{className:"introduced-note",children:["This paper is the canonical source for ",qs,"."]})]}),X&&e.jsxs("div",{className:"introduced-banner lineage-banner",children:[Ze.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:Ze.length===1?"Follow-up paper":"Follow-up papers"}),e.jsx("div",{className:"introduced-methods",children:Ze.map(P=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>s(`/paper/${P.route_identifier}`),children:[e.jsx(Me,{title:P.title}),e.jsx("span",{className:"introduced-arrow",children:"→"})]},`successor-${P.id}`))})]}),Je.length>0&&e.jsxs("div",{className:"lineage-row",children:[e.jsx("span",{className:"introduced-label lineage-label",children:Je.length===1?"Predecessor paper":"Predecessor papers"}),e.jsx("div",{className:"introduced-methods",children:Je.map(P=>e.jsxs("button",{type:"button",className:"introduced-pill lineage-pill",onClick:()=>s(`/paper/${P.route_identifier}`),children:[e.jsx("span",{className:"introduced-arrow lineage-arrow-back",children:"←"}),e.jsx(Me,{title:P.title})]},`predecessor-${P.id}`))})]})]}),e.jsx(Ln,{canEdit:!0,onEditMethods:()=>G("methods"),onEditTasks:()=>G("tasks"),paper:d,readerChatRoute:Os}),e.jsx(Vr,{canCopyBadge:Z.length>0,canEdit:!0,evaluationsByTask:g,evaluationsLoading:f,isAdmin:n,onCopyBadge:y,onEdit:()=>G("results"),onRefresh:()=>void k(),paper:d,visibleEvaluationCount:(R==null?void 0:R.length)??0})]}),e.jsx(Pn,{allHfArtifactUrls:N,citationCopied:Ye,citationDisplay:T,hfArtifactViewer:B,onCopyCitation:ye,onEditHfArtifacts:()=>G("hf-artifacts"),onEditRepositories:()=>G("repositories"),onEditXThreads:()=>G("x-threads"),paper:d,relatedIsLoading:S.isLoading,relatedPapers:S.data,user:r})]}),e.jsx(Kr,{activeEditor:u,arxivId:i,editSubmitMode:o,evaluations:l??[],isAdmin:n,isLinkedAuthor:K,onOpenChange:E,paper:d}),e.jsx(Ca,{open:F!==null,onOpenChange:P=>{P||z(null)},sectionLabel:F?zn[F]:"this paper",returnTo:typeof window<"u"?window.location.pathname:"/"})]})};export{Ii as default}; diff --git a/assets/PaperFeedFilters-SOqb93ez.js b/assets/PaperFeedFilters-DNebHp4l.js similarity index 90% rename from assets/PaperFeedFilters-SOqb93ez.js rename to assets/PaperFeedFilters-DNebHp4l.js index b73fd85d74d8c44d1bbc1a1fa27894f666d621f4..cef6e7d45c2bb8534ef1a5329a678d204ba362ee 100644 --- a/assets/PaperFeedFilters-SOqb93ez.js +++ b/assets/PaperFeedFilters-DNebHp4l.js @@ -1 +1 @@ -import{j as e}from"./index-CqKcHUvZ.js";import{I as n}from"./components-Dmnn5Z5p.js";const t=()=>e.jsxs("span",{className:"hf-resource-logo",children:[e.jsx("img",{className:"hf-resource-logo-black",src:"/hf-logo-monochrome-black.svg?v=20260729",alt:""}),e.jsx("img",{className:"hf-resource-logo-white",src:"/hf-logo-monochrome-white.svg?v=20260729",alt:""})]}),l=({checked:s,icon:a,label:r,onChange:o})=>e.jsxs("button",{type:"button",className:`paper-feed-filter ${s?"active":""}`,"aria-pressed":s,onClick:()=>o(!s),children:[e.jsxs("span",{className:"paper-feed-filter-content",children:[e.jsx("span",{className:"paper-feed-filter-icon","aria-hidden":"true",children:a}),r]}),s&&e.jsx("span",{className:"paper-feed-filter-check","aria-hidden":"true",children:"✓"})]}),h=({hasCode:s,hasHfArtifacts:a,onHasCodeChange:r,onHasHfArtifactsChange:o,showDivider:c=!0,showHasCode:i=!0})=>e.jsxs("div",{className:"paper-feed-resource-controls",role:"group","aria-label":"Resource filters",children:[c&&e.jsx("span",{className:"paper-feed-resource-divider","aria-hidden":"true"}),e.jsxs("div",{className:"paper-feed-filter-options",children:[i&&e.jsx(l,{checked:s,icon:e.jsx(n,{name:"github",size:14}),label:"Has code",onChange:r}),e.jsx(l,{checked:a,icon:e.jsx(t,{}),label:"Has artifacts",onChange:o})]})]});export{h as P}; +import{j as e}from"./index-D6jcIRWs.js";import{I as n}from"./components-DO1X940E.js";const t=()=>e.jsxs("span",{className:"hf-resource-logo",children:[e.jsx("img",{className:"hf-resource-logo-black",src:"/hf-logo-monochrome-black.svg?v=20260729",alt:""}),e.jsx("img",{className:"hf-resource-logo-white",src:"/hf-logo-monochrome-white.svg?v=20260729",alt:""})]}),l=({checked:s,icon:a,label:r,onChange:o})=>e.jsxs("button",{type:"button",className:`paper-feed-filter ${s?"active":""}`,"aria-pressed":s,onClick:()=>o(!s),children:[e.jsxs("span",{className:"paper-feed-filter-content",children:[e.jsx("span",{className:"paper-feed-filter-icon","aria-hidden":"true",children:a}),r]}),s&&e.jsx("span",{className:"paper-feed-filter-check","aria-hidden":"true",children:"✓"})]}),h=({hasCode:s,hasHfArtifacts:a,onHasCodeChange:r,onHasHfArtifactsChange:o,showDivider:c=!0,showHasCode:i=!0})=>e.jsxs("div",{className:"paper-feed-resource-controls",role:"group","aria-label":"Resource filters",children:[c&&e.jsx("span",{className:"paper-feed-resource-divider","aria-hidden":"true"}),e.jsxs("div",{className:"paper-feed-filter-options",children:[i&&e.jsx(l,{checked:s,icon:e.jsx(n,{name:"github",size:14}),label:"Has code",onChange:r}),e.jsx(l,{checked:a,icon:e.jsx(t,{}),label:"Has artifacts",onChange:o})]})]});export{h as P}; diff --git a/assets/PaperPreviewLink-C6khj_iZ.js b/assets/PaperPreviewLink-fcJyP9H0.js similarity index 97% rename from assets/PaperPreviewLink-C6khj_iZ.js rename to assets/PaperPreviewLink-fcJyP9H0.js index 161d2e2e3611a0742e7098d26555d6fb993f7d29..d3c6bb5e427dda2ef9662c6636f12ad459960e28 100644 --- a/assets/PaperPreviewLink-C6khj_iZ.js +++ b/assets/PaperPreviewLink-fcJyP9H0.js @@ -1,4 +1,4 @@ -import{o as F,f as j,m as b,a as le,p as O,b as z,n as D,h as ce,s as ue,c as he,v as pe,S as me}from"./index-CqELxJb0.js";import{l as fe}from"./index-DBHj7UWg.js";import R from"./katex-DkKDou_j.js";import{j as p,K as A,W as de,o as C,d as xe,f as ge,L as T,A as ye}from"./index-CqKcHUvZ.js";import{u as we}from"./useQuery-Cngk7eL9.js";import{H as be,a as Ne,b as ve}from"./hover-card-BTsA69o8.js";import{a as I,p as ke}from"./papers-bE3C_Qzl.js";import{u as Fe}from"./useMutation-BItMAQ7s.js";function je(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:s},exit:{mathFlow:i,mathFlowFence:n,mathFlowFenceMeta:r,mathFlowValue:l,mathText:o,mathTextData:l}};function e(a){const c={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[c]}},a)}function t(){this.buffer()}function r(){const a=this.resume(),c=this.stack[this.stack.length-1];F(c.type==="math"),c.meta=a}function n(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(a){const c=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),m=this.stack[this.stack.length-1];F(m.type==="math"),this.exit(a),m.value=c;const f=m.data.hChildren[0];F(f.type==="element"),F(f.tagName==="code"),f.children.push({type:"text",value:c}),this.data.mathFlowInside=void 0}function s(a){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},a),this.buffer()}function o(a){const c=this.resume(),m=this.stack[this.stack.length-1];F(m.type==="inlineMath"),this.exit(a),m.value=c,m.data.hChildren.push({type:"text",value:c})}function l(a){this.config.enter.data.call(this,a),this.config.exit.data.call(this,a)}}function Ce(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),n.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` +import{o as F,f as j,m as b,a as le,p as O,b as z,n as D,h as ce,s as ue,c as he,v as pe,S as me}from"./index-uFGyKu5N.js";import{l as fe}from"./index-yduEvk9Z.js";import R from"./katex-DkKDou_j.js";import{j as p,K as A,Y as de,o as C,d as xe,f as ge,L as T,A as ye}from"./index-D6jcIRWs.js";import{u as we}from"./useQuery-CUJUm4FY.js";import{H as be,a as Ne,b as ve}from"./hover-card-DPpv0l_x.js";import{a as I,p as ke}from"./papers-DIIIPDpj.js";import{u as Fe}from"./useMutation-p6mN4h17.js";function je(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:s},exit:{mathFlow:i,mathFlowFence:n,mathFlowFenceMeta:r,mathFlowValue:l,mathText:o,mathTextData:l}};function e(a){const c={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[c]}},a)}function t(){this.buffer()}function r(){const a=this.resume(),c=this.stack[this.stack.length-1];F(c.type==="math"),c.meta=a}function n(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(a){const c=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),m=this.stack[this.stack.length-1];F(m.type==="math"),this.exit(a),m.value=c;const f=m.data.hChildren[0];F(f.type==="element"),F(f.tagName==="code"),f.children.push({type:"text",value:c}),this.data.mathFlowInside=void 0}function s(a){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},a),this.buffer()}function o(a){const c=this.resume(),m=this.stack[this.stack.length-1];F(m.type==="inlineMath"),this.exit(a),m.value=c,m.data.hChildren.push({type:"text",value:c})}function l(a){this.config.enter.data.call(this,a),this.config.exit.data.call(this,a)}}function Ce(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),n.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` `,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:r,inlineMath:n}};function r(s,o,l,a){const c=s.value||"",m=l.createTracker(a),f="$".repeat(Math.max(fe(c,"$")+1,2)),g=l.enter("mathFlow");let d=m.move(f);if(s.meta){const x=l.enter("mathFlowMeta");d+=m.move(l.safe(s.meta,{after:` `,before:d,encode:["$"],...m.current()})),x()}return d+=m.move(` `),c&&(d+=m.move(c+` diff --git a/assets/PaperReaderView-Dwb0MEz-.js b/assets/PaperReaderView-CTxDY9uR.js similarity index 89% rename from assets/PaperReaderView-Dwb0MEz-.js rename to assets/PaperReaderView-CTxDY9uR.js index 9065979a8083e052ebb957730500730c8ed32207..f85c7dfb8fed61ca6cefc87b84bc2736a97156d4 100644 --- a/assets/PaperReaderView-Dwb0MEz-.js +++ b/assets/PaperReaderView-CTxDY9uR.js @@ -1 +1 @@ -import{r as s,j as a,A as J,u as Se,c as Ue,o as De,W as je,O as Oe,L as Y}from"./index-CqKcHUvZ.js";import{u as ee}from"./useQuery-Cngk7eL9.js";import{u as Ve,R as Qe,A as Xe,c as Ye,d as Ze,a as Ge,P as Je,e as et}from"./ArtifactWorkspace-DZXFAFpE.js";import{M as tt}from"./MarkdownText-CJQADo_f.js";import{g as rt,b as at}from"./papers-bE3C_Qzl.js";import{w as st,e as nt}from"./paperReader-BIpQD5HO.js";import{b as ot}from"./usePapers-By3yMmMn.js";import{c as it}from"./chat-DGBJkcmd.js";import{s as te}from"./safeExternalHref-CkBrsh84.js";import{ChatExperience as ct}from"./ChatView-DZCqXX3T.js";import"./chatSessions-D75G2_U7.js";/* empty css */import"./hover-card-BTsA69o8.js";import"./CatalogEntityPreviewLink-BWMEEf81.js";import"./catalog-D26nGNnK.js";import"./github-sUmGdHig.js";import"./file-text-DnNBEwSF.js";import"./PaperPreviewLink-C6khj_iZ.js";import"./index-CqELxJb0.js";import"./index-DBHj7UWg.js";import"./katex-DkKDou_j.js";import"./useMutation-BItMAQ7s.js";import"./copy-D9WKw0Bi.js";import"./thumbs-up-C19-ALYv.js";import"./arrow-left-D_tIkkPW.js";import"./external-link-CrrdDZf6.js";import"./plus-DZF-NxR0.js";import"./search-9n8Usynh.js";import"./chevron-up-CZWX0SDx.js";import"./AuthorAvatar-CWCqOa0h.js";import"./useInfiniteQuery-lxaMAHEu.js";import"./McpShowcase-oHgWM9FI.js";import"./AgentLogos-ClqC1BaK.js";import"./share-2-Ma7ZrYBX.js";import"./openrouter-BNf4jDuS.js";import"./queryOptions-C9woPjwX.js";function lt(r){return r instanceof J&&r.status===422?"This page could not be turned into a readable paper.":r instanceof J&&r.status===503?"Paper content is still being prepared. Please try again later.":"The paper could not be loaded."}function dt({paperId:r,paperKey:i,paperTitle:o,paperHref:b,sourceUrl:d,resources:t,paperVersion:f="",selectionEnabled:v=!1,onReady:h,onPaperSelection:I,onPaperSelectionError:B}){const c=s.useRef(null),g=ee({queryKey:["paperWebMarkdown",r],queryFn:()=>rt(r),staleTime:5*6e4,retry:(w,j)=>w<2&&!(j instanceof J&&j.status<500),retryDelay:3e3}),x=g.isSuccess;s.useEffect(()=>{x&&(h==null||h())},[h,x]),Ve({enabled:v&&!!f&&x,pagesRoot:c,routeId:i,paperVersion:f,numPages:1,onSelect:I,onError:B});const S=g.data?st(g.data):"";return a.jsxs("div",{className:"pdf-viewer",children:[a.jsx(Qe,{paperTitle:o,paperHref:b,resources:t,label:"Paper controls",children:a.jsx("div",{className:"pdf-toolbar-controls",children:a.jsx("a",{href:d,target:"_blank",rel:"noopener noreferrer",children:"Open original"})})}),a.jsx("div",{className:"pdf-scroll-frame",children:a.jsx("div",{className:"pdf-scroll",role:"region","aria-label":"Paper web page",children:g.isPending?a.jsx("div",{className:"pdf-loading",role:"status",children:"Preparing a readable version of this page…"}):g.isError?a.jsxs("div",{className:"pdf-error",role:"alert",children:[a.jsx("p",{children:lt(g.error)}),a.jsxs("div",{children:[a.jsx("button",{type:"button",onClick:()=>void g.refetch(),children:"Retry"})," ",a.jsx("a",{href:d,target:"_blank",rel:"noopener noreferrer",children:"Open original"})]})]}):a.jsxs("article",{ref:c,className:"reader-web-document","data-page":"1",children:[!S.startsWith("# ")&&a.jsx("h1",{children:o}),a.jsx(tt,{text:S})]})})})]})}const _e=66,ut=240,re="pwc:reader:split-ratio",L=r=>`pwc:reader:session:${r}`,Z=r=>`pwc:reader:assistant-collapsed:${r}`,Ce=r=>`pwc:reader:page:${r}`;function G(r){const i=Number(sessionStorage.getItem(Ce(r)));return Number.isInteger(i)&&i>0?i:1}function pt(){const r=Number(localStorage.getItem(re));return Number.isFinite(r)&&r>=45&&r<=75?r:_e}function ft(r){const i=te(r);if(!i)return null;const o=new URL(i);return(o.hostname==="arxiv.org"||o.hostname==="www.arxiv.org")&&o.pathname.startsWith("/pdf/")&&o.pathname.endsWith(".pdf")&&(o.pathname=o.pathname.slice(0,-4)),o.href}const mt=/^\/pdf\/(\d{4}\.\d{4,5}(?:v\d{1,3})?|[a-z]+(?:-[a-z]+)*(?:\.[A-Z]{2})?\/\d{7}(?:v\d{1,3})?)$/;function ht(r){const i=new URL(r),o=i.pathname.match(mt);return(i.hostname==="arxiv.org"||i.hostname==="www.arxiv.org")&&o&&!i.search?je(`/paper-assets/arxiv-pdf/${o[1]}`)??r:r}function gt(r){return new URL(r).hostname.replace(/^www\./,"")}function bt(r){if(!r)return{};const i={};for(const d of r.repositories??[]){if(!d.is_official)continue;const t=te(d.url);if(!t)continue;const f=new URL(t),v=f.pathname.split("/").filter(Boolean);if((f.hostname==="github.com"||f.hostname==="www.github.com")&&v.length>=2){i.repository={href:t,stars:d.num_stars||0};break}}const o=[...r.project_pages??[]].sort((d,t)=>Number(t.is_official)-Number(d.is_official));for(const d of o){const t=te(d.url);if(t){i.projectPage={href:t,label:gt(t)};break}}const b=r.hf_artifact_summary?r.hf_artifact_summary.model_count+r.hf_artifact_summary.dataset_count+r.hf_artifact_summary.space_count:new Set([...r.hf_models??[],...r.hf_datasets??[],...r.hf_spaces??[]]).size;return b>0&&r.arxiv_id&&(i.huggingFace={href:`https://huggingface.co/papers/${r.arxiv_id.replace(/v\d+$/i,"")}`,count:b}),i}function vt(){var xe,Pe,we,ye,Re;const r=Ue(),{paperId:i}=Se(),o=De(i??"").replace(/v\d+$/i,""),b=ot(o,!!o),d=ee({queryKey:["chatAvailability"],queryFn:()=>it.getAvailability(),refetchInterval:3e4,retry:!1}),t=b.data,f=t?nt(t):null,v=f?null:(t==null?void 0:t.source)==="external"?je(`/paper-assets/external/${t.id}/paper.pdf`):ft(t==null?void 0:t.url_pdf),h=v&&(t==null?void 0:t.source)!=="external"?ht(v):v,I=bt(t),B=s.useMemo(()=>{var e;return(e=t==null?void 0:t.author_links)==null?void 0:e.flatMap(n=>n.id?[{id:n.id,name:n.name,avatarUrl:n.hf_avatar_url}]:[])},[t==null?void 0:t.author_links]),c=((xe=t==null?void 0:t.arxiv_id)==null?void 0:xe.replace(/v\d+$/i,""))||o,g=s.useCallback(()=>r(`/paper/${c}`),[c,r]),[x,S]=s.useState(()=>sessionStorage.getItem(L(o))||void 0),[w,j]=s.useState(pt),[u,ae]=s.useState(()=>sessionStorage.getItem(Z(o))==="1"),[P,_]=s.useState("paper"),[H,C]=s.useState(),[ke,se]=s.useState(),[Ae,ne]=s.useState(!1),Ie=s.useCallback(()=>ne(!0),[]),[$e,y]=s.useState(""),[Ne,Ee]=s.useState(()=>G(o)),[k,Te]=s.useState(0),[oe,ie]=s.useState(!1),[Me,F]=s.useState(!1),$=s.useRef(null),q=s.useRef(null),N=s.useRef(null),ce=s.useRef(null),le=s.useRef(null),K=s.useRef(!1),E=s.useRef(!1),T=s.useRef(0),R=s.useRef(0),U=s.useRef(0),A=s.useRef(w),D=s.useRef(G(o)),O=s.useRef(t==null?void 0:t.version),de=Ye().reset,ue=s.useRef(`${o}:${x??"new"}`),p=k>=840;s.useEffect(()=>{const e=`${o}:${x??"new"}`;ue.current!==e&&(ue.current=e,de())},[x,de,o]),s.useEffect(()=>{t!=null&&t.version&&O.current&&t.version!==O.current&&(C(void 0),y("")),O.current=t==null?void 0:t.version},[t==null?void 0:t.version]),s.useEffect(()=>{window.clearTimeout(T.current),F(!1);const e=sessionStorage.getItem(L(o));S(e||void 0),ae(sessionStorage.getItem(Z(o))==="1"),_("paper"),ne(!1),C(void 0),se(void 0),y("");const n=G(o);D.current=n,Ee(n)},[o]),s.useEffect(()=>()=>{window.clearTimeout(T.current),cancelAnimationFrame(R.current)},[]),s.useLayoutEffect(()=>{const e=$.current;if(!e)return;const n=()=>Te(e.clientWidth);n();const l=new ResizeObserver(n);return l.observe(e),()=>l.disconnect()},[t]),s.useEffect(()=>{if(!t)return;document.title=`${t.title} — Papers With Code reader`;let e=document.querySelector('meta[name="robots"]');const n=!e;e||(e=document.createElement("meta"),e.name="robots",document.head.appendChild(e));const l=e.content;e.content="noindex, nofollow";let m=document.querySelector('link[rel="canonical"]');const qe=!m;m||(m=document.createElement("link"),m.rel="canonical",document.head.appendChild(m));const Ke=m.href;return m.href=`${window.location.origin}/paper/${c}`,()=>{document.title="Papers With Code",n?e==null||e.remove():e&&(e.content=l),qe?m==null||m.remove():m&&(m.href=Ke)}},[c,t]);const M=s.useCallback(e=>{if(!k)return Math.max(45,Math.min(75,e));const n=480/k*100,l=100-360/k*100;return Math.max(n,Math.min(l,e))},[k]);s.useEffect(()=>j(e=>{const n=M(e);return A.current=n,n}),[M]);const W=e=>{const n=M(e);A.current=n,j(n),localStorage.setItem(re,String(n))},pe=e=>{var l;const n=M(e);A.current=n,q.current&&(q.current.style.width=`${n}%`),N.current&&(N.current.style.width=`${100-n}%`),(l=ce.current)==null||l.setAttribute("aria-valuenow",String(Math.round(n)))},fe=e=>{U.current=e,!R.current&&(R.current=requestAnimationFrame(()=>{var l;R.current=0;const n=(l=$.current)==null?void 0:l.getBoundingClientRect();n!=null&&n.width&&pe((U.current-n.left)/n.width*100)}))},We=e=>{E.current=!0,ie(!0),e.currentTarget.setPointerCapture(e.pointerId),fe(e.clientX)},V=()=>{var e;if(E.current){if(R.current){cancelAnimationFrame(R.current),R.current=0;const n=(e=$.current)==null?void 0:e.getBoundingClientRect();n!=null&&n.width&&pe((U.current-n.left)/n.width*100)}E.current=!1,j(A.current),localStorage.setItem(re,String(A.current)),ie(!1)}},me=e=>{window.clearTimeout(T.current),F(!0),ae(e),sessionStorage.setItem(Z(o),e?"1":"0"),T.current=window.setTimeout(()=>F(!1),ut+40)},he=e=>{K.current=!0,me(e)};s.useEffect(()=>{var e;K.current&&(K.current=!1,(e=u?le.current:N.current)==null||e.focus())},[u]);const ze=e=>{S(e),sessionStorage.setItem(L(o),e)},Le=()=>{S(void 0),sessionStorage.removeItem(L(o)),C(void 0),y("")},ge=((Pe=d.data)==null?void 0:Pe.paper_reader_selection_enabled)===!0,be=e=>{C(e),y(`Selection from page ${e.page} added to chat`),p&&u&&me(!1)},Be=s.useCallback(e=>{C(e),e||y("")},[]),Q=((we=d.data)==null?void 0:we.paper_reader_citations_enabled)===!0&&!!h,z=ee({queryKey:["paper-layout",c],queryFn:()=>at(c),enabled:Q&&!!c,staleTime:5*6e4}).data,He=s.useMemo(()=>Q?{layout:z,open:e=>{const n=z?Ze(z,e):[];n.length&&(se(l=>({boxes:n,nonce:((l==null?void 0:l.nonce)??0)+1})),_("paper"))}}:null,[Q,z]),ve=Oe()&&((ye=d.data)==null?void 0:ye.paper_reader_chat_enabled)!==!1,X=!!(t&&ve&&!(f&&!Ae)),Fe=t&&ve&&!X?a.jsx("div",{className:"reader-chat-unavailable",role:"status",children:"Chat opens once the paper is ready."}):t&&X?a.jsx(ct,{mode:"paper",routeSessionId:x,primaryPaper:{id:t.id,routeId:c,title:t.title},currentPage:()=>D.current,paperSelection:H,onPaperSelectionChange:Be,onSessionId:ze,onReaderSubmit:()=>_("assistant"),onReaderNewChat:Le,onReaderClose:p?()=>he(!0):void 0}):a.jsx("div",{className:"reader-chat-unavailable",children:"Chat is not enabled for this preview."});return b.isLoading?a.jsx("div",{className:"reader-status",role:"status",children:"Loading paper…"}):b.error||!t?a.jsxs("div",{className:"reader-status",role:"alert",children:[a.jsx("p",{children:"Paper not found."}),a.jsx(Y,{to:"/papers",children:"Browse papers"})]}):((Re=d.data)==null?void 0:Re.native_pdf_reader_enabled)===!1?a.jsxs("div",{className:"reader-status",role:"alert",children:[a.jsx("p",{children:"The native reader is currently unavailable."}),a.jsx(Y,{to:`/paper/${c}`,children:"Back to paper"})]}):!h&&!f?a.jsxs("div",{className:"reader-status",role:"alert",children:[a.jsx("p",{children:"Native reading is unavailable for this resource."}),a.jsx(Y,{to:`/paper/${c}`,children:"Back to paper"})]}):a.jsxs("div",{className:"paper-reader-shell",children:[!p&&a.jsxs("div",{className:"reader-tabs",role:"tablist","aria-label":"Reader panels",children:[a.jsx("button",{type:"button",role:"tab","aria-selected":P==="paper",onClick:()=>_("paper"),children:"Paper"}),a.jsxs("button",{type:"button",role:"tab","aria-selected":P==="assistant","aria-label":H&&P!=="assistant"?"Chat, selection attached":"Chat",onClick:()=>_("assistant"),children:["Chat",H&&P!=="assistant"&&a.jsx("span",{className:"reader-tab-pending","aria-hidden":"true"})]})]}),a.jsx(Ge,{variant:"reader",children:a.jsxs("div",{ref:$,className:`reader-workspace${p?" is-desktop":" is-tabs"}${u?" is-assistant-collapsed":""}${oe?" is-resizing":""}`,"data-testid":"paper-chat-workspace",children:[a.jsx("section",{ref:q,className:`reader-paper-pane${!p&&P!=="paper"?" is-hidden":""}`,style:p?{width:u?"100%":`${w}%`}:void 0,role:"tabpanel","aria-label":"Paper","aria-hidden":!p&&P!=="paper",children:f?a.jsx(dt,{paperId:t.id,paperKey:c,paperTitle:t.title,paperHref:`/paper/${c}`,sourceUrl:f,resources:I,paperVersion:t.version,selectionEnabled:ge,onReady:Ie,onPaperSelection:be,onPaperSelectionError:y}):h&&a.jsx(Je,{url:h,downloadUrl:v??h,paperKey:c,paperTitle:t.title,paperHref:`/paper/${c}`,onClose:g,resources:I,initialPage:Ne,resizeActive:oe||Me,selectionEnabled:ge,paperVersion:t.version,authors:B,loadErrorMessage:t.source==="external"?"Paper content is still being prepared. Please try again later.":void 0,onPaperSelection:be,onPaperSelectionError:y,highlight:ke,onPageChange:e=>{D.current=e,sessionStorage.setItem(Ce(o),String(e))}})}),p&&!u&&a.jsx("div",{ref:ce,className:"reader-resize-handle",role:"separator","aria-label":"Resize paper and Chat panels","aria-orientation":"vertical","aria-valuemin":45,"aria-valuemax":75,"aria-valuenow":Math.round(w),tabIndex:0,onPointerDown:We,onPointerMove:e=>{E.current&&fe(e.clientX)},onPointerUp:V,onPointerCancel:V,onLostPointerCapture:V,onDoubleClick:()=>W(_e),onKeyDown:e=>{(e.key==="ArrowLeft"||e.key==="ArrowRight")&&(e.preventDefault(),W(w+(e.key==="ArrowRight"?2:-2))),e.key==="Home"&&W(45),e.key==="End"&&W(75)}}),a.jsx("aside",{ref:N,id:"reader-chat-panel",className:`reader-assistant-pane${!p&&P!=="assistant"?" is-hidden":""}${p&&u?" is-collapsed":""}`,style:p?{width:u?0:`${100-w}%`}:void 0,role:"tabpanel","aria-label":"Chat","aria-hidden":!p&&P!=="assistant"||u,tabIndex:-1,children:a.jsx(et.Provider,{value:He,children:Fe})}),a.jsx("div",{className:"sr-only","aria-live":"polite",children:$e}),p&&(u||!X)&&a.jsx("button",{ref:le,type:"button",className:"reader-collapse-assistant","aria-controls":"reader-chat-panel","aria-expanded":!u,onClick:()=>he(!u),children:u?"Open chat":"Hide chat"})]})})]})}function ar(){const{paperId:r=""}=Se();return a.jsx(Xe,{workspaceKey:`reader:${r}`,children:a.jsx(vt,{})})}export{ar as default,bt as readerToolbarResources}; +import{r as s,j as a,A as J,u as Se,c as Ue,o as De,Y as je,O as Oe,L as Y}from"./index-D6jcIRWs.js";import{u as ee}from"./useQuery-CUJUm4FY.js";import{u as Ve,R as Qe,A as Xe,c as Ye,d as Ze,a as Ge,P as Je,e as et}from"./ArtifactWorkspace-CUZCugRS.js";import{M as tt}from"./MarkdownText-B_D3IE_p.js";import{g as rt,b as at}from"./papers-DIIIPDpj.js";import{w as st,e as nt}from"./paperReader-BIpQD5HO.js";import{b as ot}from"./usePapers-BbCSwcVk.js";import{c as it}from"./chat-ChnK8XDU.js";import{s as te}from"./safeExternalHref-CkBrsh84.js";import{ChatExperience as ct}from"./ChatView-wJIPZ39W.js";import"./chatSessions-DByIWBno.js";/* empty css */import"./hover-card-DPpv0l_x.js";import"./CatalogEntityPreviewLink-BhTSUN-X.js";import"./catalog-PYrB8_bm.js";import"./github-B7D_19Qm.js";import"./file-text-4G2I5_Zo.js";import"./PaperPreviewLink-fcJyP9H0.js";import"./index-uFGyKu5N.js";import"./index-yduEvk9Z.js";import"./katex-DkKDou_j.js";import"./useMutation-p6mN4h17.js";import"./copy-BmzqMihw.js";import"./thumbs-up-BqRlVdvF.js";import"./arrow-left-IzGlownM.js";import"./external-link-C_yz2sXa.js";import"./plus-C4UQ62Q1.js";import"./search-CfTufeR7.js";import"./chevron-up-CQKUhZ0S.js";import"./AuthorAvatar-UMHOVOr9.js";import"./useInfiniteQuery-FXco4P1n.js";import"./McpShowcase-CS9LZY9p.js";import"./AgentLogos-CFt_vIO2.js";import"./share-2-DPo2j-OC.js";import"./openrouter-DrXWVMlM.js";import"./queryOptions-C9woPjwX.js";function lt(r){return r instanceof J&&r.status===422?"This page could not be turned into a readable paper.":r instanceof J&&r.status===503?"Paper content is still being prepared. Please try again later.":"The paper could not be loaded."}function dt({paperId:r,paperKey:i,paperTitle:o,paperHref:b,sourceUrl:d,resources:t,paperVersion:f="",selectionEnabled:v=!1,onReady:h,onPaperSelection:I,onPaperSelectionError:B}){const c=s.useRef(null),g=ee({queryKey:["paperWebMarkdown",r],queryFn:()=>rt(r),staleTime:5*6e4,retry:(w,j)=>w<2&&!(j instanceof J&&j.status<500),retryDelay:3e3}),x=g.isSuccess;s.useEffect(()=>{x&&(h==null||h())},[h,x]),Ve({enabled:v&&!!f&&x,pagesRoot:c,routeId:i,paperVersion:f,numPages:1,onSelect:I,onError:B});const S=g.data?st(g.data):"";return a.jsxs("div",{className:"pdf-viewer",children:[a.jsx(Qe,{paperTitle:o,paperHref:b,resources:t,label:"Paper controls",children:a.jsx("div",{className:"pdf-toolbar-controls",children:a.jsx("a",{href:d,target:"_blank",rel:"noopener noreferrer",children:"Open original"})})}),a.jsx("div",{className:"pdf-scroll-frame",children:a.jsx("div",{className:"pdf-scroll",role:"region","aria-label":"Paper web page",children:g.isPending?a.jsx("div",{className:"pdf-loading",role:"status",children:"Preparing a readable version of this page…"}):g.isError?a.jsxs("div",{className:"pdf-error",role:"alert",children:[a.jsx("p",{children:lt(g.error)}),a.jsxs("div",{children:[a.jsx("button",{type:"button",onClick:()=>void g.refetch(),children:"Retry"})," ",a.jsx("a",{href:d,target:"_blank",rel:"noopener noreferrer",children:"Open original"})]})]}):a.jsxs("article",{ref:c,className:"reader-web-document","data-page":"1",children:[!S.startsWith("# ")&&a.jsx("h1",{children:o}),a.jsx(tt,{text:S})]})})})]})}const _e=66,ut=240,re="pwc:reader:split-ratio",L=r=>`pwc:reader:session:${r}`,Z=r=>`pwc:reader:assistant-collapsed:${r}`,Ce=r=>`pwc:reader:page:${r}`;function G(r){const i=Number(sessionStorage.getItem(Ce(r)));return Number.isInteger(i)&&i>0?i:1}function pt(){const r=Number(localStorage.getItem(re));return Number.isFinite(r)&&r>=45&&r<=75?r:_e}function ft(r){const i=te(r);if(!i)return null;const o=new URL(i);return(o.hostname==="arxiv.org"||o.hostname==="www.arxiv.org")&&o.pathname.startsWith("/pdf/")&&o.pathname.endsWith(".pdf")&&(o.pathname=o.pathname.slice(0,-4)),o.href}const mt=/^\/pdf\/(\d{4}\.\d{4,5}(?:v\d{1,3})?|[a-z]+(?:-[a-z]+)*(?:\.[A-Z]{2})?\/\d{7}(?:v\d{1,3})?)$/;function ht(r){const i=new URL(r),o=i.pathname.match(mt);return(i.hostname==="arxiv.org"||i.hostname==="www.arxiv.org")&&o&&!i.search?je(`/paper-assets/arxiv-pdf/${o[1]}`)??r:r}function gt(r){return new URL(r).hostname.replace(/^www\./,"")}function bt(r){if(!r)return{};const i={};for(const d of r.repositories??[]){if(!d.is_official)continue;const t=te(d.url);if(!t)continue;const f=new URL(t),v=f.pathname.split("/").filter(Boolean);if((f.hostname==="github.com"||f.hostname==="www.github.com")&&v.length>=2){i.repository={href:t,stars:d.num_stars||0};break}}const o=[...r.project_pages??[]].sort((d,t)=>Number(t.is_official)-Number(d.is_official));for(const d of o){const t=te(d.url);if(t){i.projectPage={href:t,label:gt(t)};break}}const b=r.hf_artifact_summary?r.hf_artifact_summary.model_count+r.hf_artifact_summary.dataset_count+r.hf_artifact_summary.space_count:new Set([...r.hf_models??[],...r.hf_datasets??[],...r.hf_spaces??[]]).size;return b>0&&r.arxiv_id&&(i.huggingFace={href:`https://huggingface.co/papers/${r.arxiv_id.replace(/v\d+$/i,"")}`,count:b}),i}function vt(){var xe,Pe,we,ye,Re;const r=Ue(),{paperId:i}=Se(),o=De(i??"").replace(/v\d+$/i,""),b=ot(o,!!o),d=ee({queryKey:["chatAvailability"],queryFn:()=>it.getAvailability(),refetchInterval:3e4,retry:!1}),t=b.data,f=t?nt(t):null,v=f?null:(t==null?void 0:t.source)==="external"?je(`/paper-assets/external/${t.id}/paper.pdf`):ft(t==null?void 0:t.url_pdf),h=v&&(t==null?void 0:t.source)!=="external"?ht(v):v,I=bt(t),B=s.useMemo(()=>{var e;return(e=t==null?void 0:t.author_links)==null?void 0:e.flatMap(n=>n.id?[{id:n.id,name:n.name,avatarUrl:n.hf_avatar_url}]:[])},[t==null?void 0:t.author_links]),c=((xe=t==null?void 0:t.arxiv_id)==null?void 0:xe.replace(/v\d+$/i,""))||o,g=s.useCallback(()=>r(`/paper/${c}`),[c,r]),[x,S]=s.useState(()=>sessionStorage.getItem(L(o))||void 0),[w,j]=s.useState(pt),[u,ae]=s.useState(()=>sessionStorage.getItem(Z(o))==="1"),[P,_]=s.useState("paper"),[H,C]=s.useState(),[ke,se]=s.useState(),[Ae,ne]=s.useState(!1),Ie=s.useCallback(()=>ne(!0),[]),[$e,y]=s.useState(""),[Ne,Ee]=s.useState(()=>G(o)),[k,Te]=s.useState(0),[oe,ie]=s.useState(!1),[Me,F]=s.useState(!1),$=s.useRef(null),q=s.useRef(null),N=s.useRef(null),ce=s.useRef(null),le=s.useRef(null),K=s.useRef(!1),E=s.useRef(!1),T=s.useRef(0),R=s.useRef(0),U=s.useRef(0),A=s.useRef(w),D=s.useRef(G(o)),O=s.useRef(t==null?void 0:t.version),de=Ye().reset,ue=s.useRef(`${o}:${x??"new"}`),p=k>=840;s.useEffect(()=>{const e=`${o}:${x??"new"}`;ue.current!==e&&(ue.current=e,de())},[x,de,o]),s.useEffect(()=>{t!=null&&t.version&&O.current&&t.version!==O.current&&(C(void 0),y("")),O.current=t==null?void 0:t.version},[t==null?void 0:t.version]),s.useEffect(()=>{window.clearTimeout(T.current),F(!1);const e=sessionStorage.getItem(L(o));S(e||void 0),ae(sessionStorage.getItem(Z(o))==="1"),_("paper"),ne(!1),C(void 0),se(void 0),y("");const n=G(o);D.current=n,Ee(n)},[o]),s.useEffect(()=>()=>{window.clearTimeout(T.current),cancelAnimationFrame(R.current)},[]),s.useLayoutEffect(()=>{const e=$.current;if(!e)return;const n=()=>Te(e.clientWidth);n();const l=new ResizeObserver(n);return l.observe(e),()=>l.disconnect()},[t]),s.useEffect(()=>{if(!t)return;document.title=`${t.title} — Papers With Code reader`;let e=document.querySelector('meta[name="robots"]');const n=!e;e||(e=document.createElement("meta"),e.name="robots",document.head.appendChild(e));const l=e.content;e.content="noindex, nofollow";let m=document.querySelector('link[rel="canonical"]');const qe=!m;m||(m=document.createElement("link"),m.rel="canonical",document.head.appendChild(m));const Ke=m.href;return m.href=`${window.location.origin}/paper/${c}`,()=>{document.title="Papers With Code",n?e==null||e.remove():e&&(e.content=l),qe?m==null||m.remove():m&&(m.href=Ke)}},[c,t]);const M=s.useCallback(e=>{if(!k)return Math.max(45,Math.min(75,e));const n=480/k*100,l=100-360/k*100;return Math.max(n,Math.min(l,e))},[k]);s.useEffect(()=>j(e=>{const n=M(e);return A.current=n,n}),[M]);const W=e=>{const n=M(e);A.current=n,j(n),localStorage.setItem(re,String(n))},pe=e=>{var l;const n=M(e);A.current=n,q.current&&(q.current.style.width=`${n}%`),N.current&&(N.current.style.width=`${100-n}%`),(l=ce.current)==null||l.setAttribute("aria-valuenow",String(Math.round(n)))},fe=e=>{U.current=e,!R.current&&(R.current=requestAnimationFrame(()=>{var l;R.current=0;const n=(l=$.current)==null?void 0:l.getBoundingClientRect();n!=null&&n.width&&pe((U.current-n.left)/n.width*100)}))},We=e=>{E.current=!0,ie(!0),e.currentTarget.setPointerCapture(e.pointerId),fe(e.clientX)},V=()=>{var e;if(E.current){if(R.current){cancelAnimationFrame(R.current),R.current=0;const n=(e=$.current)==null?void 0:e.getBoundingClientRect();n!=null&&n.width&&pe((U.current-n.left)/n.width*100)}E.current=!1,j(A.current),localStorage.setItem(re,String(A.current)),ie(!1)}},me=e=>{window.clearTimeout(T.current),F(!0),ae(e),sessionStorage.setItem(Z(o),e?"1":"0"),T.current=window.setTimeout(()=>F(!1),ut+40)},he=e=>{K.current=!0,me(e)};s.useEffect(()=>{var e;K.current&&(K.current=!1,(e=u?le.current:N.current)==null||e.focus())},[u]);const ze=e=>{S(e),sessionStorage.setItem(L(o),e)},Le=()=>{S(void 0),sessionStorage.removeItem(L(o)),C(void 0),y("")},ge=((Pe=d.data)==null?void 0:Pe.paper_reader_selection_enabled)===!0,be=e=>{C(e),y(`Selection from page ${e.page} added to chat`),p&&u&&me(!1)},Be=s.useCallback(e=>{C(e),e||y("")},[]),Q=((we=d.data)==null?void 0:we.paper_reader_citations_enabled)===!0&&!!h,z=ee({queryKey:["paper-layout",c],queryFn:()=>at(c),enabled:Q&&!!c,staleTime:5*6e4}).data,He=s.useMemo(()=>Q?{layout:z,open:e=>{const n=z?Ze(z,e):[];n.length&&(se(l=>({boxes:n,nonce:((l==null?void 0:l.nonce)??0)+1})),_("paper"))}}:null,[Q,z]),ve=Oe()&&((ye=d.data)==null?void 0:ye.paper_reader_chat_enabled)!==!1,X=!!(t&&ve&&!(f&&!Ae)),Fe=t&&ve&&!X?a.jsx("div",{className:"reader-chat-unavailable",role:"status",children:"Chat opens once the paper is ready."}):t&&X?a.jsx(ct,{mode:"paper",routeSessionId:x,primaryPaper:{id:t.id,routeId:c,title:t.title},currentPage:()=>D.current,paperSelection:H,onPaperSelectionChange:Be,onSessionId:ze,onReaderSubmit:()=>_("assistant"),onReaderNewChat:Le,onReaderClose:p?()=>he(!0):void 0}):a.jsx("div",{className:"reader-chat-unavailable",children:"Chat is not enabled for this preview."});return b.isLoading?a.jsx("div",{className:"reader-status",role:"status",children:"Loading paper…"}):b.error||!t?a.jsxs("div",{className:"reader-status",role:"alert",children:[a.jsx("p",{children:"Paper not found."}),a.jsx(Y,{to:"/papers",children:"Browse papers"})]}):((Re=d.data)==null?void 0:Re.native_pdf_reader_enabled)===!1?a.jsxs("div",{className:"reader-status",role:"alert",children:[a.jsx("p",{children:"The native reader is currently unavailable."}),a.jsx(Y,{to:`/paper/${c}`,children:"Back to paper"})]}):!h&&!f?a.jsxs("div",{className:"reader-status",role:"alert",children:[a.jsx("p",{children:"Native reading is unavailable for this resource."}),a.jsx(Y,{to:`/paper/${c}`,children:"Back to paper"})]}):a.jsxs("div",{className:"paper-reader-shell",children:[!p&&a.jsxs("div",{className:"reader-tabs",role:"tablist","aria-label":"Reader panels",children:[a.jsx("button",{type:"button",role:"tab","aria-selected":P==="paper",onClick:()=>_("paper"),children:"Paper"}),a.jsxs("button",{type:"button",role:"tab","aria-selected":P==="assistant","aria-label":H&&P!=="assistant"?"Chat, selection attached":"Chat",onClick:()=>_("assistant"),children:["Chat",H&&P!=="assistant"&&a.jsx("span",{className:"reader-tab-pending","aria-hidden":"true"})]})]}),a.jsx(Ge,{variant:"reader",children:a.jsxs("div",{ref:$,className:`reader-workspace${p?" is-desktop":" is-tabs"}${u?" is-assistant-collapsed":""}${oe?" is-resizing":""}`,"data-testid":"paper-chat-workspace",children:[a.jsx("section",{ref:q,className:`reader-paper-pane${!p&&P!=="paper"?" is-hidden":""}`,style:p?{width:u?"100%":`${w}%`}:void 0,role:"tabpanel","aria-label":"Paper","aria-hidden":!p&&P!=="paper",children:f?a.jsx(dt,{paperId:t.id,paperKey:c,paperTitle:t.title,paperHref:`/paper/${c}`,sourceUrl:f,resources:I,paperVersion:t.version,selectionEnabled:ge,onReady:Ie,onPaperSelection:be,onPaperSelectionError:y}):h&&a.jsx(Je,{url:h,downloadUrl:v??h,paperKey:c,paperTitle:t.title,paperHref:`/paper/${c}`,onClose:g,resources:I,initialPage:Ne,resizeActive:oe||Me,selectionEnabled:ge,paperVersion:t.version,authors:B,loadErrorMessage:t.source==="external"?"Paper content is still being prepared. Please try again later.":void 0,onPaperSelection:be,onPaperSelectionError:y,highlight:ke,onPageChange:e=>{D.current=e,sessionStorage.setItem(Ce(o),String(e))}})}),p&&!u&&a.jsx("div",{ref:ce,className:"reader-resize-handle",role:"separator","aria-label":"Resize paper and Chat panels","aria-orientation":"vertical","aria-valuemin":45,"aria-valuemax":75,"aria-valuenow":Math.round(w),tabIndex:0,onPointerDown:We,onPointerMove:e=>{E.current&&fe(e.clientX)},onPointerUp:V,onPointerCancel:V,onLostPointerCapture:V,onDoubleClick:()=>W(_e),onKeyDown:e=>{(e.key==="ArrowLeft"||e.key==="ArrowRight")&&(e.preventDefault(),W(w+(e.key==="ArrowRight"?2:-2))),e.key==="Home"&&W(45),e.key==="End"&&W(75)}}),a.jsx("aside",{ref:N,id:"reader-chat-panel",className:`reader-assistant-pane${!p&&P!=="assistant"?" is-hidden":""}${p&&u?" is-collapsed":""}`,style:p?{width:u?0:`${100-w}%`}:void 0,role:"tabpanel","aria-label":"Chat","aria-hidden":!p&&P!=="assistant"||u,tabIndex:-1,children:a.jsx(et.Provider,{value:He,children:Fe})}),a.jsx("div",{className:"sr-only","aria-live":"polite",children:$e}),p&&(u||!X)&&a.jsx("button",{ref:le,type:"button",className:"reader-collapse-assistant","aria-controls":"reader-chat-panel","aria-expanded":!u,onClick:()=>he(!u),children:u?"Open chat":"Hide chat"})]})})]})}function ar(){const{paperId:r=""}=Se();return a.jsx(Xe,{workspaceKey:`reader:${r}`,children:a.jsx(vt,{})})}export{ar as default,bt as readerToolbarResources}; diff --git a/assets/PapersListView-DYcakh08.js b/assets/PapersListView-BNcDd1lQ.js similarity index 89% rename from assets/PapersListView-DYcakh08.js rename to assets/PapersListView-BNcDd1lQ.js index 930c45fb2acacca586547636d3fa079730f1210c..95b8a23c8da803a13b0f125afe82fd521ae6dacf 100644 --- a/assets/PapersListView-DYcakh08.js +++ b/assets/PapersListView-BNcDd1lQ.js @@ -1 +1 @@ -import{e as V,r as g,A as X,j as e,L as j,g as J}from"./index-CqKcHUvZ.js";import{I as G,T as W,P as Y}from"./components-Dmnn5Z5p.js";import{c as Z}from"./catalog-D26nGNnK.js";import{t as ee,d as se}from"./colors-_scCXfCe.js";import{u as re,a as ae}from"./usePapers-By3yMmMn.js";import{u as te}from"./useDebounce-D8I8hw4T.js";import{u as ne}from"./useInfiniteScroll-DVF-b-LX.js";import{S as _}from"./skeleton-DleNhBYA.js";import{A as ie,a as oe}from"./alert-Z2yFUcyL.js";import{u as ce}from"./useQuery-Cngk7eL9.js";import{P as le}from"./PaperFeedFilters-SOqb93ez.js";import{a as de,P as me,b as he}from"./PaperDateFilter-zHw5tq6B.js";import"./papers-bE3C_Qzl.js";import"./AuthorAvatar-CWCqOa0h.js";import"./LatexTitle-BI9yl-Fo.js";import"./safeExternalHref-CkBrsh84.js";import"./useInfiniteQuery-lxaMAHEu.js";import"./useIntersectionObserver-CiBk_Oug.js";import"./popover-BcoS9Jmp.js";const N=360;function pe(r,o){const d=r.toLocaleLowerCase();return o.trim().split(/\s+/).filter(Boolean).reduce((c,t)=>{const l=d.indexOf(t.toLocaleLowerCase());return l>=0&&(c<0||l=0?t+1:o}function ue(r,o){if(r.length<=N)return r;const d=pe(r,o);if(d<0||d0?"…":""}${r.slice(c,t).trim()}${tnew Intl.NumberFormat("en",{notation:r>=1e3?"compact":"standard",maximumFractionDigits:1}).format(r),Be=()=>{var E,I,$,T,B,H,O,q,M;const[r,o]=V(),d=r.get("framework")||void 0,c=r.get("repository")||void 0,t=!!(d||c),l=r.get("search")||"",[F,C]=g.useState(l),p=te(F,300),n=!t&&l.trim().length>0;g.useEffect(()=>C(l),[l]),g.useEffect(()=>{if(p===l)return;const s=new URLSearchParams(r);p?s.set("search",p):s.delete("search"),o(s,{replace:!0})},[p]),g.useEffect(()=>{const s=r.get("order_by"),i=new URLSearchParams(r);n&&!["relevance","date_published","citation_count"].includes(s||"")?(i.set("order_by","relevance"),o(i,{replace:!0})):!n&&s==="relevance"&&(i.delete("order_by"),o(i,{replace:!0}))},[n,r,o]);const L=r.get("order_by"),x=L==="citation_count"?"cited":L==="date_published"?"new":n?"relevance":"trending",u=de(r),w=r.get("has_hf_artifacts")==="true",k=!t&&r.get("has_code")==="true",y=(s,i)=>{const h=new URLSearchParams(r);i?h.set(s,i):h.delete(s),o(h)},z=s=>{y("order_by",s==="cited"?"citation_count":s==="new"?"date_published":s)},b=re({page_size:20,order_by:x==="trending"?"trending":x==="cited"?"citation_count":"date_published",order_dir:"desc",search:t&&p||void 0,start_date:u.startDate,end_date:u.endDate,include_resources:!0,conference:r.get("conference")||void 0,latest_only:r.get("latest_only")!=="false",has_code:k,has_hf_artifacts:w,framework:d,repository:c,enabled:!n}),A=ae({q:p.trim(),order_by:x==="cited"?"citation_count":x==="new"?"date_published":"relevance",start_date:u.startDate,end_date:u.endDate,has_code:k,has_hf_artifacts:w,enabled:n}),m=n?A:b,D=ce({queryKey:["top-tasks-sidebar"],queryFn:()=>Z.topTasks(8),enabled:!t&&!n,staleTime:10*60*1e3}),v=g.useMemo(()=>{var i;return(((i=m.data)==null?void 0:i.pages.flatMap(h=>h.results))||[]).map(h=>{const S=ee(h);return n?{...S,abstract:ue(S.abstract,l)}:S})},[m.data,n,l]),Q=ne(m),f=(($=(I=(E=b.data)==null?void 0:E.pages)==null?void 0:I[0])==null?void 0:$.count)??0,a=(H=(B=(T=b.data)==null?void 0:T.pages)==null?void 0:B[0])==null?void 0:H.scope,P=(q=(O=A.data)==null?void 0:O.pages)==null?void 0:q.at(-1),R=d&&m.error instanceof X&&m.error.status===404,K=(a==null?void 0:a.kind)==="framework"?a.framework_name:a==null?void 0:a.repository;return e.jsxs("div",{className:"page",children:[(a==null?void 0:a.kind)==="framework"&&e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(j,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(j,{to:"/frameworks",children:"Frameworks"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.framework_name})]}),e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:t?e.jsxs(e.Fragment,{children:["Papers implemented by ",e.jsx("em",{children:K||d||c})]}):n?e.jsxs(e.Fragment,{children:["Search results for ",e.jsxs("em",{children:["“",l,"”"]})]}):e.jsxs(e.Fragment,{children:["All ",e.jsx("em",{children:"Papers"})]})}),e.jsx("div",{className:"feed-subtitle",children:t?(a==null?void 0:a.kind)==="framework"?f>0&&`${f.toLocaleString()} papers.`:a!=null&&a.repository?e.jsxs(e.Fragment,{children:["GitHub repository ",e.jsx("strong",{children:a.repository}),". ",f>0&&`${f.toLocaleString()} papers.`]}):"Repository-scoped paper feed.":n?`${v.length} loaded from the most relevant results.`:e.jsxs(e.Fragment,{children:["Search the full corpus. ",f>0&&`${f.toLocaleString()} papers indexed.`]})}),t&&a&&e.jsxs("div",{className:"paper-feed-scope-links",children:[e.jsxs("div",{className:"paper-feed-primary-links",children:[a.github_url&&e.jsxs("a",{href:a.github_url,target:"_blank",rel:"noopener noreferrer",className:a.kind==="framework"?"task-framework-link":"framework-link",children:[e.jsx(G,{name:"github",size:13}),a.kind==="framework"?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:a.repository||"GitHub"}),a.num_stars!=null&&e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",ge(a.num_stars)]})]}):"GitHub"]}),a.kind==="framework"&&a.introducing_paper_arxiv_id&&e.jsx(j,{to:`/paper/${a.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"})]}),a.kind==="framework"&&a.recommended_tasks&&a.recommended_tasks.length>0&&e.jsx("div",{className:"paper-feed-task-tags",children:a.recommended_tasks.map(s=>s.slug?e.jsx(W,{slug:s.slug,label:s.name},s.id):null)})]})]}),e.jsx(me,{startDate:u.startDate,endDate:u.endDate,onChange:s=>o(he(r,s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(G,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:F,onChange:s=>C(s.target.value)})]})}),e.jsxs("div",{className:t||n?"papers-feed-layout-scoped":"layout-with-sidebar",children:[!t&&!n&&e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),D.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,i)=>e.jsx(_,{className:"h-5 w-full"},i))}),e.jsx("div",{className:"sidebar-links",children:(M=D.data)==null?void 0:M.map(s=>e.jsxs(j,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[se(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id))})]})}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:(n?xe:fe).map(([s,i])=>e.jsx("button",{className:`sort-btn ${x===s?"active":""}`,onClick:()=>z(s),children:i},s))}),e.jsx(le,{hasCode:k,hasHfArtifacts:w,onHasCodeChange:s=>y("has_code",s?"true":void 0),onHasHfArtifactsChange:s=>y("has_hf_artifacts",s?"true":void 0),showHasCode:!t})]}),e.jsxs("div",{className:"results-count",children:[v.length," loaded"]})]}),R?e.jsx("div",{className:"no-results",children:"Framework not found."}):m.error&&e.jsx(ie,{variant:"destructive",className:"mb-4",children:e.jsx(oe,{children:"Failed to load papers. Please try again."})}),!R&&(m.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,i)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(_,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(_,{className:"h-6 w-3/4"}),e.jsx(_,{className:"h-4 w-1/2"}),e.jsx(_,{className:"h-12 w-full"})]})]},i))}):v.length===0?e.jsxs("div",{className:"no-results",children:[e.jsx("p",{children:"No matching papers."}),n&&J()&&e.jsx(j,{to:`/chat?q=${encodeURIComponent(l.trim())}`,children:"Ask the assistant instead"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:v.map((s,i)=>e.jsx(Y,{paper:s,rank:i+1,highlightQuery:n?l:void 0},s.id))}),e.jsx("div",{ref:Q,style:{height:1}}),m.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"}),!m.hasNextPage&&!m.isFetchingNextPage&&n&&e.jsx("div",{className:"search-results-end",children:P!=null&&P.cap_reached?"End of the top 100 results":"End of results"})]}))]})]})]})};export{Be as default}; +import{e as V,r as g,A as X,j as e,L as j,g as J}from"./index-D6jcIRWs.js";import{I as G,T as W,P as Y}from"./components-DO1X940E.js";import{c as Z}from"./catalog-PYrB8_bm.js";import{t as ee,d as se}from"./colors-CLwl8a2d.js";import{u as re,a as ae}from"./usePapers-BbCSwcVk.js";import{u as te}from"./useDebounce-DLPbKAkz.js";import{u as ne}from"./useInfiniteScroll-Dm7JY_X4.js";import{S as _}from"./skeleton-BqkYFmXl.js";import{A as ie,a as oe}from"./alert-2MbxVzGL.js";import{u as ce}from"./useQuery-CUJUm4FY.js";import{P as le}from"./PaperFeedFilters-DNebHp4l.js";import{a as de,P as me,b as he}from"./PaperDateFilter-CPIqaHaq.js";import"./papers-DIIIPDpj.js";import"./AuthorAvatar-UMHOVOr9.js";import"./LatexTitle-D_92Jowu.js";import"./safeExternalHref-CkBrsh84.js";import"./useInfiniteQuery-FXco4P1n.js";import"./useIntersectionObserver-3LTuEaFW.js";import"./popover-DCjqGpW0.js";const N=360;function pe(r,o){const d=r.toLocaleLowerCase();return o.trim().split(/\s+/).filter(Boolean).reduce((c,t)=>{const l=d.indexOf(t.toLocaleLowerCase());return l>=0&&(c<0||l=0?t+1:o}function ue(r,o){if(r.length<=N)return r;const d=pe(r,o);if(d<0||d0?"…":""}${r.slice(c,t).trim()}${tnew Intl.NumberFormat("en",{notation:r>=1e3?"compact":"standard",maximumFractionDigits:1}).format(r),Be=()=>{var E,I,$,T,B,H,O,q,M;const[r,o]=V(),d=r.get("framework")||void 0,c=r.get("repository")||void 0,t=!!(d||c),l=r.get("search")||"",[F,C]=g.useState(l),p=te(F,300),n=!t&&l.trim().length>0;g.useEffect(()=>C(l),[l]),g.useEffect(()=>{if(p===l)return;const s=new URLSearchParams(r);p?s.set("search",p):s.delete("search"),o(s,{replace:!0})},[p]),g.useEffect(()=>{const s=r.get("order_by"),i=new URLSearchParams(r);n&&!["relevance","date_published","citation_count"].includes(s||"")?(i.set("order_by","relevance"),o(i,{replace:!0})):!n&&s==="relevance"&&(i.delete("order_by"),o(i,{replace:!0}))},[n,r,o]);const L=r.get("order_by"),x=L==="citation_count"?"cited":L==="date_published"?"new":n?"relevance":"trending",u=de(r),w=r.get("has_hf_artifacts")==="true",k=!t&&r.get("has_code")==="true",y=(s,i)=>{const h=new URLSearchParams(r);i?h.set(s,i):h.delete(s),o(h)},z=s=>{y("order_by",s==="cited"?"citation_count":s==="new"?"date_published":s)},b=re({page_size:20,order_by:x==="trending"?"trending":x==="cited"?"citation_count":"date_published",order_dir:"desc",search:t&&p||void 0,start_date:u.startDate,end_date:u.endDate,include_resources:!0,conference:r.get("conference")||void 0,latest_only:r.get("latest_only")!=="false",has_code:k,has_hf_artifacts:w,framework:d,repository:c,enabled:!n}),A=ae({q:p.trim(),order_by:x==="cited"?"citation_count":x==="new"?"date_published":"relevance",start_date:u.startDate,end_date:u.endDate,has_code:k,has_hf_artifacts:w,enabled:n}),m=n?A:b,D=ce({queryKey:["top-tasks-sidebar"],queryFn:()=>Z.topTasks(8),enabled:!t&&!n,staleTime:10*60*1e3}),v=g.useMemo(()=>{var i;return(((i=m.data)==null?void 0:i.pages.flatMap(h=>h.results))||[]).map(h=>{const S=ee(h);return n?{...S,abstract:ue(S.abstract,l)}:S})},[m.data,n,l]),Q=ne(m),f=(($=(I=(E=b.data)==null?void 0:E.pages)==null?void 0:I[0])==null?void 0:$.count)??0,a=(H=(B=(T=b.data)==null?void 0:T.pages)==null?void 0:B[0])==null?void 0:H.scope,P=(q=(O=A.data)==null?void 0:O.pages)==null?void 0:q.at(-1),R=d&&m.error instanceof X&&m.error.status===404,K=(a==null?void 0:a.kind)==="framework"?a.framework_name:a==null?void 0:a.repository;return e.jsxs("div",{className:"page",children:[(a==null?void 0:a.kind)==="framework"&&e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(j,{to:"/",children:"Papers"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx(j,{to:"/frameworks",children:"Frameworks"}),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--ink)"},children:a.framework_name})]}),e.jsxs("div",{className:"feed-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:t?e.jsxs(e.Fragment,{children:["Papers implemented by ",e.jsx("em",{children:K||d||c})]}):n?e.jsxs(e.Fragment,{children:["Search results for ",e.jsxs("em",{children:["“",l,"”"]})]}):e.jsxs(e.Fragment,{children:["All ",e.jsx("em",{children:"Papers"})]})}),e.jsx("div",{className:"feed-subtitle",children:t?(a==null?void 0:a.kind)==="framework"?f>0&&`${f.toLocaleString()} papers.`:a!=null&&a.repository?e.jsxs(e.Fragment,{children:["GitHub repository ",e.jsx("strong",{children:a.repository}),". ",f>0&&`${f.toLocaleString()} papers.`]}):"Repository-scoped paper feed.":n?`${v.length} loaded from the most relevant results.`:e.jsxs(e.Fragment,{children:["Search the full corpus. ",f>0&&`${f.toLocaleString()} papers indexed.`]})}),t&&a&&e.jsxs("div",{className:"paper-feed-scope-links",children:[e.jsxs("div",{className:"paper-feed-primary-links",children:[a.github_url&&e.jsxs("a",{href:a.github_url,target:"_blank",rel:"noopener noreferrer",className:a.kind==="framework"?"task-framework-link":"framework-link",children:[e.jsx(G,{name:"github",size:13}),a.kind==="framework"?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:a.repository||"GitHub"}),a.num_stars!=null&&e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",ge(a.num_stars)]})]}):"GitHub"]}),a.kind==="framework"&&a.introducing_paper_arxiv_id&&e.jsx(j,{to:`/paper/${a.introducing_paper_arxiv_id}`,className:"framework-link",children:"Introducing paper"})]}),a.kind==="framework"&&a.recommended_tasks&&a.recommended_tasks.length>0&&e.jsx("div",{className:"paper-feed-task-tags",children:a.recommended_tasks.map(s=>s.slug?e.jsx(W,{slug:s.slug,label:s.name},s.id):null)})]})]}),e.jsx(me,{startDate:u.startDate,endDate:u.endDate,onChange:s=>o(he(r,s))})]}),e.jsx("div",{className:"papers-search-row",children:e.jsxs("div",{className:"papers-search-input-wrap",children:[e.jsx(G,{name:"search",size:14}),e.jsx("input",{className:"papers-search-input",placeholder:"Search title or abstract…",value:F,onChange:s=>C(s.target.value)})]})}),e.jsxs("div",{className:t||n?"papers-feed-layout-scoped":"layout-with-sidebar",children:[!t&&!n&&e.jsx("aside",{className:"sidebar",children:e.jsxs("div",{className:"sidebar-section",children:[e.jsx("div",{className:"sidebar-label",children:"Top Domains"}),D.isLoading&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:6}).map((s,i)=>e.jsx(_,{className:"h-5 w-full"},i))}),e.jsx("div",{className:"sidebar-links",children:(M=D.data)==null?void 0:M.map(s=>e.jsxs(j,{to:`/tasks/${s.slug}`,className:"sidebar-link",children:[se(s.name,s.slug),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count})]},s.id))})]})}),e.jsxs("div",{children:[e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:(n?xe:fe).map(([s,i])=>e.jsx("button",{className:`sort-btn ${x===s?"active":""}`,onClick:()=>z(s),children:i},s))}),e.jsx(le,{hasCode:k,hasHfArtifacts:w,onHasCodeChange:s=>y("has_code",s?"true":void 0),onHasHfArtifactsChange:s=>y("has_hf_artifacts",s?"true":void 0),showHasCode:!t})]}),e.jsxs("div",{className:"results-count",children:[v.length," loaded"]})]}),R?e.jsx("div",{className:"no-results",children:"Framework not found."}):m.error&&e.jsx(ie,{variant:"destructive",className:"mb-4",children:e.jsx(oe,{children:"Failed to load papers. Please try again."})}),!R&&(m.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:6}).map((s,i)=>e.jsxs("div",{className:"paper-card",children:[e.jsx(_,{className:"h-[220px] w-[160px]"}),e.jsxs("div",{className:"paper-body",style:{flex:1,gap:12},children:[e.jsx(_,{className:"h-6 w-3/4"}),e.jsx(_,{className:"h-4 w-1/2"}),e.jsx(_,{className:"h-12 w-full"})]})]},i))}):v.length===0?e.jsxs("div",{className:"no-results",children:[e.jsx("p",{children:"No matching papers."}),n&&J()&&e.jsx(j,{to:`/chat?q=${encodeURIComponent(l.trim())}`,children:"Ask the assistant instead"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:v.map((s,i)=>e.jsx(Y,{paper:s,rank:i+1,highlightQuery:n?l:void 0},s.id))}),e.jsx("div",{ref:Q,style:{height:1}}),m.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"}),!m.hasNextPage&&!m.isFetchingNextPage&&n&&e.jsx("div",{className:"search-results-end",children:P!=null&&P.cap_reached?"End of the top 100 results":"End of results"})]}))]})]})]})};export{Be as default}; diff --git a/assets/PrivacyView-CH2fzy9w.js b/assets/PrivacyView-CwO81wLZ.js similarity index 99% rename from assets/PrivacyView-CH2fzy9w.js rename to assets/PrivacyView-CwO81wLZ.js index 6cafc265a9d8eb3bdceefce497342dee4d97fe0c..4660cbc0e5c0a76e9e8c000bdc3e56c1c2c51b02 100644 --- a/assets/PrivacyView-CH2fzy9w.js +++ b/assets/PrivacyView-CwO81wLZ.js @@ -1 +1 @@ -import{K as s,j as e}from"./index-CqKcHUvZ.js";import{f as i,D as r}from"./latexPlainText-DI8YEXVe.js";const n=()=>(s.useEffect(()=>(document.title=i("Privacy Policy"),()=>{document.title=r}),[]),e.jsxs("article",{className:"page legal-page",children:[e.jsxs("header",{className:"legal-header",children:[e.jsx("p",{className:"legal-kicker",children:"Legal"}),e.jsx("h1",{children:"Privacy Policy"}),e.jsx("p",{className:"legal-effective-date",children:"Effective August 11, 2026"})]}),e.jsx("p",{children:"This Privacy Policy explains how Hugging Face, Inc. (“Hugging Face,” “we,” or “us”) collects, uses, and shares information when you use Papers With Code, including its website, research assistant, APIs, and related services (the “Service”)."}),e.jsxs("section",{children:[e.jsx("h2",{children:"1. Information we collect"}),e.jsx("h3",{children:"Information you provide"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Account information."})," If you sign in with Hugging Face, we receive account identifiers and profile details needed to authenticate you, such as your user ID, username, and avatar. If you request contributor access, we also receive and retain the verified email address associated with your Hugging Face account so we can review and communicate about your request."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Contributions and preferences."})," We collect information you submit or save, such as paper submissions and edits, bookmarks, display preferences, feedback, and communications with us. Material you submit to a public research page may be publicly visible."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Research assistant content."})," We collect your questions, conversation history, generated answers, citations, tool calls and results, and feedback about answers. Chats are private to your account unless you choose to create a share link; anyone with that link may be able to view the shared chat."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Provider and billing information."})," If you enable a model provider, we process the authorization or API credentials needed to make requests on your behalf. Hugging Face or another provider processes its own billing information under its terms. Papers With Code does not collect your payment-card details."]})]}),e.jsx("h3",{children:"Information collected automatically"}),e.jsx("p",{children:"We collect technical and usage information such as IP address, browser and device type, operating system, pages or features used, dates and times, referring pages, request identifiers, cookies, logs, and diagnostic data. For research-assistant requests, this may include the selected model, token and cost details, latency, errors, and other operational metadata."}),e.jsx("h3",{children:"Research assistant tracing"}),e.jsxs("p",{children:["To evaluate, debug, secure, and improve the research assistant, we use Langfuse to record traces. A trace may contain the complete text of your question and the assistant's answer, as well as tool inputs, tool outputs, retrieved research material, model details, usage data, and related operational metadata.",e.jsx("strong",{children:" This trace content is not redacted before it is sent to Langfuse."})]}),e.jsx("p",{children:"Papers With Code is designed for questions about research literature. Do not put passwords, API keys, confidential information, health or financial data, or other sensitive personal information in research-assistant prompts."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"2. How we use information"}),e.jsx("p",{children:"We use information to:"}),e.jsxs("ul",{children:[e.jsx("li",{children:"provide, personalize, maintain, and operate the Service;"}),e.jsx("li",{children:"authenticate users and keep accounts and the Service secure;"}),e.jsx("li",{children:"run research-assistant requests and preserve conversation history;"}),e.jsx("li",{children:"measure performance, troubleshoot failures, and improve quality;"}),e.jsx("li",{children:"review contributions, prevent abuse, and enforce applicable terms;"}),e.jsx("li",{children:"communicate with you and respond to requests; and"}),e.jsx("li",{children:"comply with law and protect users, Hugging Face, and the public."})]})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"3. How we share information"}),e.jsx("p",{children:"We may share information in these circumstances:"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Service providers."})," Vendors process information for hosting, authentication, analytics, observability, security, and support. These include Hugging Face services, Langfuse for research-assistant tracing, Plausible for website analytics, and infrastructure providers."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Model providers."})," Research-assistant content is sent to the model provider you use, such as Hugging Face Inference Providers or OpenRouter, so it can generate a response. That provider's privacy terms also apply to its processing."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Public and shared content."})," Contributions intended for public pages are public. A chat is disclosed through the Service when you create and distribute a share link."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Legal, safety, and corporate events."})," We may disclose information when reasonably necessary to comply with law, protect rights and safety, investigate abuse, or complete a merger, acquisition, financing, or transfer of assets."]})]}),e.jsx("p",{children:"We do not sell your personal information."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"4. Cookies and analytics"}),e.jsx("p",{children:"We use cookies and similar storage when needed for sign-in, security, preferences, and operation of the Service. We also use Plausible to understand aggregate website usage. You can control cookies through your browser, but disabling necessary cookies may prevent account features from working."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"5. Legal bases"}),e.jsx("p",{children:"Where applicable law requires a legal basis, we process information as needed to perform our agreement with you, with your consent, to comply with legal obligations, and for legitimate interests such as operating, securing, and improving the Service. You may withdraw consent where consent is the basis for processing, without affecting earlier processing."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"6. Retention and deletion"}),e.jsx("p",{children:"Private chats are retained until you delete them, subject to limits of 500 active chats and 100 MB of chat data per user. Archiving hides a chat and frees active-chat quota but does not delete it. You may deliberately share an unlisted snapshot; deleting its private chat removes the durable transcript, workspace reference, and share link after deletion is verified. No dedicated private-chat export format is currently offered."}),e.jsx("p",{children:"We keep information for as long as reasonably needed for the purposes described here, including providing the Service, maintaining security and audit records, resolving disputes, and meeting legal obligations. Retention periods vary by data type and service provider. You can delete individual chats in the Service. Deletion may not immediately remove information from backups, security logs, or third-party systems where limited retention is required."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"7. Security and international transfers"}),e.jsx("p",{children:"We use reasonable administrative, technical, and organizational safeguards, but no internet service can guarantee absolute security. We and our service providers may process information in the United States and other countries, which may have different data-protection laws from your country. Where required, we use appropriate safeguards for international transfers."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"8. Your privacy rights"}),e.jsx("p",{children:"Depending on where you live, you may have rights to access, correct, delete, or receive a copy of your personal information; object to or restrict processing; withdraw consent; or appeal a decision about a request. You may also have the right to complain to a data-protection authority. We may need to verify your identity before fulfilling a request."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"9. Children"}),e.jsx("p",{children:"The Service is not directed to children under 13, and we do not knowingly collect personal information from children under 13. If you believe a child has provided personal information, please contact us."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"10. Changes to this policy"}),e.jsx("p",{children:"We may update this policy as the Service changes. We will post the revised policy here and update its effective date. If a change is material, we will provide additional notice when appropriate."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"11. Contact us"}),e.jsxs("p",{children:["For questions or privacy requests, contact"," ",e.jsx("a",{href:"mailto:privacy@huggingface.co",children:"privacy@huggingface.co"}),". Please do not include passwords, API keys, or other sensitive credentials in your message."]})]})]}));export{n as default}; +import{K as s,j as e}from"./index-D6jcIRWs.js";import{f as i,D as r}from"./latexPlainText-DI8YEXVe.js";const n=()=>(s.useEffect(()=>(document.title=i("Privacy Policy"),()=>{document.title=r}),[]),e.jsxs("article",{className:"page legal-page",children:[e.jsxs("header",{className:"legal-header",children:[e.jsx("p",{className:"legal-kicker",children:"Legal"}),e.jsx("h1",{children:"Privacy Policy"}),e.jsx("p",{className:"legal-effective-date",children:"Effective August 11, 2026"})]}),e.jsx("p",{children:"This Privacy Policy explains how Hugging Face, Inc. (“Hugging Face,” “we,” or “us”) collects, uses, and shares information when you use Papers With Code, including its website, research assistant, APIs, and related services (the “Service”)."}),e.jsxs("section",{children:[e.jsx("h2",{children:"1. Information we collect"}),e.jsx("h3",{children:"Information you provide"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Account information."})," If you sign in with Hugging Face, we receive account identifiers and profile details needed to authenticate you, such as your user ID, username, and avatar. If you request contributor access, we also receive and retain the verified email address associated with your Hugging Face account so we can review and communicate about your request."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Contributions and preferences."})," We collect information you submit or save, such as paper submissions and edits, bookmarks, display preferences, feedback, and communications with us. Material you submit to a public research page may be publicly visible."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Research assistant content."})," We collect your questions, conversation history, generated answers, citations, tool calls and results, and feedback about answers. Chats are private to your account unless you choose to create a share link; anyone with that link may be able to view the shared chat."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Provider and billing information."})," If you enable a model provider, we process the authorization or API credentials needed to make requests on your behalf. Hugging Face or another provider processes its own billing information under its terms. Papers With Code does not collect your payment-card details."]})]}),e.jsx("h3",{children:"Information collected automatically"}),e.jsx("p",{children:"We collect technical and usage information such as IP address, browser and device type, operating system, pages or features used, dates and times, referring pages, request identifiers, cookies, logs, and diagnostic data. For research-assistant requests, this may include the selected model, token and cost details, latency, errors, and other operational metadata."}),e.jsx("h3",{children:"Research assistant tracing"}),e.jsxs("p",{children:["To evaluate, debug, secure, and improve the research assistant, we use Langfuse to record traces. A trace may contain the complete text of your question and the assistant's answer, as well as tool inputs, tool outputs, retrieved research material, model details, usage data, and related operational metadata.",e.jsx("strong",{children:" This trace content is not redacted before it is sent to Langfuse."})]}),e.jsx("p",{children:"Papers With Code is designed for questions about research literature. Do not put passwords, API keys, confidential information, health or financial data, or other sensitive personal information in research-assistant prompts."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"2. How we use information"}),e.jsx("p",{children:"We use information to:"}),e.jsxs("ul",{children:[e.jsx("li",{children:"provide, personalize, maintain, and operate the Service;"}),e.jsx("li",{children:"authenticate users and keep accounts and the Service secure;"}),e.jsx("li",{children:"run research-assistant requests and preserve conversation history;"}),e.jsx("li",{children:"measure performance, troubleshoot failures, and improve quality;"}),e.jsx("li",{children:"review contributions, prevent abuse, and enforce applicable terms;"}),e.jsx("li",{children:"communicate with you and respond to requests; and"}),e.jsx("li",{children:"comply with law and protect users, Hugging Face, and the public."})]})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"3. How we share information"}),e.jsx("p",{children:"We may share information in these circumstances:"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Service providers."})," Vendors process information for hosting, authentication, analytics, observability, security, and support. These include Hugging Face services, Langfuse for research-assistant tracing, Plausible for website analytics, and infrastructure providers."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Model providers."})," Research-assistant content is sent to the model provider you use, such as Hugging Face Inference Providers or OpenRouter, so it can generate a response. That provider's privacy terms also apply to its processing."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Public and shared content."})," Contributions intended for public pages are public. A chat is disclosed through the Service when you create and distribute a share link."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Legal, safety, and corporate events."})," We may disclose information when reasonably necessary to comply with law, protect rights and safety, investigate abuse, or complete a merger, acquisition, financing, or transfer of assets."]})]}),e.jsx("p",{children:"We do not sell your personal information."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"4. Cookies and analytics"}),e.jsx("p",{children:"We use cookies and similar storage when needed for sign-in, security, preferences, and operation of the Service. We also use Plausible to understand aggregate website usage. You can control cookies through your browser, but disabling necessary cookies may prevent account features from working."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"5. Legal bases"}),e.jsx("p",{children:"Where applicable law requires a legal basis, we process information as needed to perform our agreement with you, with your consent, to comply with legal obligations, and for legitimate interests such as operating, securing, and improving the Service. You may withdraw consent where consent is the basis for processing, without affecting earlier processing."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"6. Retention and deletion"}),e.jsx("p",{children:"Private chats are retained until you delete them, subject to limits of 500 active chats and 100 MB of chat data per user. Archiving hides a chat and frees active-chat quota but does not delete it. You may deliberately share an unlisted snapshot; deleting its private chat removes the durable transcript, workspace reference, and share link after deletion is verified. No dedicated private-chat export format is currently offered."}),e.jsx("p",{children:"We keep information for as long as reasonably needed for the purposes described here, including providing the Service, maintaining security and audit records, resolving disputes, and meeting legal obligations. Retention periods vary by data type and service provider. You can delete individual chats in the Service. Deletion may not immediately remove information from backups, security logs, or third-party systems where limited retention is required."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"7. Security and international transfers"}),e.jsx("p",{children:"We use reasonable administrative, technical, and organizational safeguards, but no internet service can guarantee absolute security. We and our service providers may process information in the United States and other countries, which may have different data-protection laws from your country. Where required, we use appropriate safeguards for international transfers."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"8. Your privacy rights"}),e.jsx("p",{children:"Depending on where you live, you may have rights to access, correct, delete, or receive a copy of your personal information; object to or restrict processing; withdraw consent; or appeal a decision about a request. You may also have the right to complain to a data-protection authority. We may need to verify your identity before fulfilling a request."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"9. Children"}),e.jsx("p",{children:"The Service is not directed to children under 13, and we do not knowingly collect personal information from children under 13. If you believe a child has provided personal information, please contact us."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"10. Changes to this policy"}),e.jsx("p",{children:"We may update this policy as the Service changes. We will post the revised policy here and update its effective date. If a change is material, we will provide additional notice when appropriate."})]}),e.jsxs("section",{children:[e.jsx("h2",{children:"11. Contact us"}),e.jsxs("p",{children:["For questions or privacy requests, contact"," ",e.jsx("a",{href:"mailto:privacy@huggingface.co",children:"privacy@huggingface.co"}),". Please do not include passwords, API keys, or other sensitive credentials in your message."]})]})]}));export{n as default}; diff --git a/assets/RateLimitsView-46i_Guh7.js b/assets/RateLimitsView-ChUFO8Hr.js similarity index 87% rename from assets/RateLimitsView-46i_Guh7.js rename to assets/RateLimitsView-ChUFO8Hr.js index b835de91412a959c609b5559ef47000b72f156ea..7ac9f7f5a1da35379aa47cb90a9d8a0cf906aa7b 100644 --- a/assets/RateLimitsView-46i_Guh7.js +++ b/assets/RateLimitsView-ChUFO8Hr.js @@ -1 +1 @@ -import{j as e,M as t}from"./index-CqKcHUvZ.js";import{u as s}from"./useQuery-Cngk7eL9.js";const n=()=>{const i=s({queryKey:["submission-rate-limit-policy"],queryFn:()=>t.getRateLimitPolicy()}).data;return e.jsxs("div",{className:"page",style:{maxWidth:760},children:[e.jsx("h1",{children:"Submission and rate-limit policy"}),i?e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Each account may have up to ",i.active_pending," active submissions."]}),e.jsxs("p",{children:["New submissions are limited to ",i.subject_per_hour," per account and ",i.ip_per_hour," per source network in a rolling hour."]})]}):e.jsx("p",{children:"Loading current limits…"}),e.jsx("p",{children:"Duplicate, no-op, and idempotently replayed requests do not consume creation quota."}),e.jsx("p",{children:"Rate-limited responses use HTTP 429 with Retry-After, RateLimit, and RateLimit-Policy headers."}),e.jsx("p",{children:"Good-faith contributors who are blocked should contact the Papers with Code maintainers with their Hugging Face username."})]})};export{n as default}; +import{j as e,M as t}from"./index-D6jcIRWs.js";import{u as s}from"./useQuery-CUJUm4FY.js";const n=()=>{const i=s({queryKey:["submission-rate-limit-policy"],queryFn:()=>t.getRateLimitPolicy()}).data;return e.jsxs("div",{className:"page",style:{maxWidth:760},children:[e.jsx("h1",{children:"Submission and rate-limit policy"}),i?e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Each account may have up to ",i.active_pending," active submissions."]}),e.jsxs("p",{children:["New submissions are limited to ",i.subject_per_hour," per account and ",i.ip_per_hour," per source network in a rolling hour."]})]}):e.jsx("p",{children:"Loading current limits…"}),e.jsx("p",{children:"Duplicate, no-op, and idempotently replayed requests do not consume creation quota."}),e.jsx("p",{children:"Rate-limited responses use HTTP 429 with Retry-After, RateLimit, and RateLimit-Policy headers."}),e.jsx("p",{children:"Good-faith contributors who are blocked should contact the Papers with Code maintainers with their Hugging Face username."})]})};export{n as default}; diff --git a/assets/ResearchFollowButton-CrCIwiok.js b/assets/ResearchFollowButton-C2Bfd9dP.js similarity index 89% rename from assets/ResearchFollowButton-CrCIwiok.js rename to assets/ResearchFollowButton-C2Bfd9dP.js index 0e386539b4ccdcebf595bf45c1e769f8644f0b39..3302f599e2deaabddf1c5a4ed71d22cd4374312d 100644 --- a/assets/ResearchFollowButton-CrCIwiok.js +++ b/assets/ResearchFollowButton-C2Bfd9dP.js @@ -1 +1 @@ -import{d as y,b as F,f as N,r as S,i as v,j as e,h as C,C as L,L as c}from"./index-CqKcHUvZ.js";import{u as G}from"./useQuery-Cngk7eL9.js";import{u as Q}from"./useMutation-BItMAQ7s.js";import{r as m}from"./research-Dt0MUW0x.js";import{P as p}from"./plus-DZF-NxR0.js";const j={task:"Get new papers on this task",method:"Get new papers using this method",benchmark:"Get new results on this benchmark",author:"Get new papers by this author",organization:"Get new papers from this organization"};function _({kind:a,entityId:t}){var f;const l=y(),s=l==null?void 0:l.user,h=F(),n=N(),[x,g]=S.useState(null),u=`${a}:${t}`,d=["research-follows",s==null?void 0:s.hf_subject],r=G({queryKey:d,queryFn:m.follows,enabled:!!s}),o=((f=r.data)==null?void 0:f.some(w=>w.kind===a&&String(w.entity_id)===String(t)))??!1,i=Q({mutationFn:()=>m.setFollow(a,t,!o),onSuccess:async()=>{g(o?null:u),await n.invalidateQueries({queryKey:d}),await n.invalidateQueries({queryKey:["research-feed",s==null?void 0:s.hf_subject]}),await n.invalidateQueries({queryKey:["research-email",s==null?void 0:s.hf_subject]})}});if(!l||!s&&v())return null;if(!s)return e.jsxs("div",{className:"research-follow",children:[e.jsxs("a",{className:"research-follow-btn",href:C(h.pathname+h.search),children:[e.jsx(p,{"aria-hidden":"true"}),"Follow"]}),e.jsxs("span",{className:"research-follow-hint",children:["Sign in to ",j[a].toLowerCase(),"."]})]});const b=i.error||r.error;return e.jsxs("div",{className:"research-follow",children:[e.jsx("button",{type:"button",className:o?"research-follow-btn is-following":"research-follow-btn",disabled:r.isLoading||!!r.error||i.isPending,"aria-pressed":o,"aria-label":o?"Unfollow":"Follow",onClick:()=>i.mutate(),children:o?e.jsxs(e.Fragment,{children:[e.jsx(L,{"aria-hidden":"true"}),e.jsx("span",{className:"research-follow-label",children:"Following"}),e.jsx("span",{className:"research-follow-label-hover",children:"Unfollow"})]}):e.jsxs(e.Fragment,{children:[e.jsx(p,{"aria-hidden":"true"}),"Follow"]})}),b?e.jsx("span",{className:"research-follow-hint is-error",role:"alert",children:"Could not update follows. Please try again."}):o?x===u&&e.jsxs("span",{className:"research-follow-hint",role:"status",children:["Added to ",e.jsx(c,{to:"/following",children:"your Following feed"})," · ",e.jsx(c,{to:"/settings",children:"Manage in Settings"})]}):e.jsxs("span",{className:"research-follow-hint",children:[j[a]," in ",e.jsx(c,{to:"/following",children:"your Following feed"}),"."]})]})}export{_ as R}; +import{d as y,b as F,f as N,r as S,i as v,j as e,h as C,C as L,L as c}from"./index-D6jcIRWs.js";import{u as G}from"./useQuery-CUJUm4FY.js";import{u as Q}from"./useMutation-p6mN4h17.js";import{r as m}from"./research-BggtGgC2.js";import{P as p}from"./plus-C4UQ62Q1.js";const j={task:"Get new papers on this task",method:"Get new papers using this method",benchmark:"Get new results on this benchmark",author:"Get new papers by this author",organization:"Get new papers from this organization"};function _({kind:a,entityId:t}){var f;const l=y(),s=l==null?void 0:l.user,h=F(),n=N(),[x,g]=S.useState(null),u=`${a}:${t}`,d=["research-follows",s==null?void 0:s.hf_subject],r=G({queryKey:d,queryFn:m.follows,enabled:!!s}),o=((f=r.data)==null?void 0:f.some(w=>w.kind===a&&String(w.entity_id)===String(t)))??!1,i=Q({mutationFn:()=>m.setFollow(a,t,!o),onSuccess:async()=>{g(o?null:u),await n.invalidateQueries({queryKey:d}),await n.invalidateQueries({queryKey:["research-feed",s==null?void 0:s.hf_subject]}),await n.invalidateQueries({queryKey:["research-email",s==null?void 0:s.hf_subject]})}});if(!l||!s&&v())return null;if(!s)return e.jsxs("div",{className:"research-follow",children:[e.jsxs("a",{className:"research-follow-btn",href:C(h.pathname+h.search),children:[e.jsx(p,{"aria-hidden":"true"}),"Follow"]}),e.jsxs("span",{className:"research-follow-hint",children:["Sign in to ",j[a].toLowerCase(),"."]})]});const b=i.error||r.error;return e.jsxs("div",{className:"research-follow",children:[e.jsx("button",{type:"button",className:o?"research-follow-btn is-following":"research-follow-btn",disabled:r.isLoading||!!r.error||i.isPending,"aria-pressed":o,"aria-label":o?"Unfollow":"Follow",onClick:()=>i.mutate(),children:o?e.jsxs(e.Fragment,{children:[e.jsx(L,{"aria-hidden":"true"}),e.jsx("span",{className:"research-follow-label",children:"Following"}),e.jsx("span",{className:"research-follow-label-hover",children:"Unfollow"})]}):e.jsxs(e.Fragment,{children:[e.jsx(p,{"aria-hidden":"true"}),"Follow"]})}),b?e.jsx("span",{className:"research-follow-hint is-error",role:"alert",children:"Could not update follows. Please try again."}):o?x===u&&e.jsxs("span",{className:"research-follow-hint",role:"status",children:["Added to ",e.jsx(c,{to:"/following",children:"your Following feed"})," · ",e.jsx(c,{to:"/settings",children:"Manage in Settings"})]}):e.jsxs("span",{className:"research-follow-hint",children:[j[a]," in ",e.jsx(c,{to:"/following",children:"your Following feed"}),"."]})]})}export{_ as R}; diff --git a/assets/SavedPapersView-wbzqnUzp.js b/assets/SavedPapersView-79-FOny-.js similarity index 89% rename from assets/SavedPapersView-wbzqnUzp.js rename to assets/SavedPapersView-79-FOny-.js index 31a0a9a0ebc3940df01f8fb701ae327106bf8f76..13fd32b0ca8b9bb61eb05c4f6e0d21058b60910f 100644 --- a/assets/SavedPapersView-wbzqnUzp.js +++ b/assets/SavedPapersView-79-FOny-.js @@ -1 +1 @@ -import{a as g,A as v,j as e,H as x,L as j,M as b}from"./index-CqKcHUvZ.js";import{p as f}from"./papers-bE3C_Qzl.js";import{u as N}from"./useQuery-Cngk7eL9.js";import{T as k,P as y}from"./components-Dmnn5Z5p.js";import{S as r}from"./skeleton-DleNhBYA.js";import{A as w,a as A}from"./alert-Z2yFUcyL.js";import{t as B}from"./colors-_scCXfCe.js";import{s as F}from"./savedPapersAuth-BzEAZw7z.js";import"./AuthorAvatar-CWCqOa0h.js";import"./LatexTitle-BI9yl-Fo.js";import"./safeExternalHref-CkBrsh84.js";const Y=()=>{var o,l;const{user:i,isLoading:m}=g(),a=N({queryKey:[...f.feeds.saved],queryFn:()=>b.getBookmarks(),enabled:!!i,staleTime:30*1e3,refetchOnWindowFocus:!1}),c=a.error instanceof v&&a.error.code==="saved_papers_bucket_authorization_required",d=!!a.data&&!a.data.bucket_connected,n=()=>{window.location.assign(F())};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(!i)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(x,{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/${i.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(w,{variant:"destructive",className:"mb-4",children:e.jsx(A,{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((t,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(j,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(t=>e.jsxs("section",{className:"saved-area-section",children:[e.jsx("h2",{className:"saved-area-heading",children:t.name}),t.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(y,{paper:B(u),rank:++h},u.id))})]},`task-${t.id??"other"}-${s.id??"untagged"}`)})]},`area-${t.id??"other"}`))]})};export{Y as default}; +import{a as g,A as v,j as e,H as x,L as j,M as b}from"./index-D6jcIRWs.js";import{p as f}from"./papers-DIIIPDpj.js";import{u as N}from"./useQuery-CUJUm4FY.js";import{T as k,P as y}from"./components-DO1X940E.js";import{S as r}from"./skeleton-BqkYFmXl.js";import{A as w,a as A}from"./alert-2MbxVzGL.js";import{t as B}from"./colors-CLwl8a2d.js";import{s as F}from"./savedPapersAuth-aA59XSW3.js";import"./AuthorAvatar-UMHOVOr9.js";import"./LatexTitle-D_92Jowu.js";import"./safeExternalHref-CkBrsh84.js";const Y=()=>{var o,l;const{user:i,isLoading:m}=g(),a=N({queryKey:[...f.feeds.saved],queryFn:()=>b.getBookmarks(),enabled:!!i,staleTime:30*1e3,refetchOnWindowFocus:!1}),c=a.error instanceof v&&a.error.code==="saved_papers_bucket_authorization_required",d=!!a.data&&!a.data.bucket_connected,n=()=>{window.location.assign(F())};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(!i)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(x,{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/${i.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(w,{variant:"destructive",className:"mb-4",children:e.jsx(A,{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((t,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(j,{to:"/papers",className:"sidebar-link",style:{display:"inline"},children:"Browse papers →"})]}):a.data.areas.map(t=>e.jsxs("section",{className:"saved-area-section",children:[e.jsx("h2",{className:"saved-area-heading",children:t.name}),t.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(y,{paper:B(u),rank:++h},u.id))})]},`task-${t.id??"other"}-${s.id??"untagged"}`)})]},`area-${t.id??"other"}`))]})};export{Y as default}; diff --git a/assets/SearchOverlay-CN_xcP2S.js b/assets/SearchOverlay-BMTrmO5f.js similarity index 93% rename from assets/SearchOverlay-CN_xcP2S.js rename to assets/SearchOverlay-BMTrmO5f.js index 2924cb01077a53c04e339c466796323590e93af3..fe49bd592430d87267cfb09db77d3423fb42d464 100644 --- a/assets/SearchOverlay-CN_xcP2S.js +++ b/assets/SearchOverlay-BMTrmO5f.js @@ -1 +1 @@ -import{r as z,c as O,K as M,g as B,j as e}from"./index-CqKcHUvZ.js";import{p as H,a as R}from"./papers-bE3C_Qzl.js";import{u as i}from"./useQuery-Cngk7eL9.js";import{L as U}from"./LatexTitle-BI9yl-Fo.js";import{c as x}from"./catalog-D26nGNnK.js";import{u as Y}from"./useDebounce-D8I8hw4T.js";import{c as G,h as X,d as Z}from"./colors-_scCXfCe.js";const V=10,S=6,W=350,v=3,cs=({open:t,onClose:h})=>{var A,C,w,K,P,Q;const f=z.useRef(null),$=O(),[c,D]=M.useState(""),a=Y(c,W),j=c.trim(),r=a.trim().length>=v,y=B();z.useEffect(()=>{var l;if(!t)return;(l=f.current)==null||l.focus();const s=N=>{N.key==="Escape"&&(N.preventDefault(),N.stopPropagation(),h())};return window.addEventListener("keydown",s,!0),()=>window.removeEventListener("keydown",s,!0)},[t,h]);const k=i({queryKey:[...H.feeds.searchOverlay,a],queryFn:()=>R.search(a,1,V),enabled:t&&r,staleTime:6e4,retry:!1}),_=i({queryKey:["search-tasks",a],queryFn:()=>x.listTasks({q:a,page_size:6}),enabled:t&&r,staleTime:6e4,retry:!1}),b=i({queryKey:["search-methods",a],queryFn:()=>x.listMethods({q:a,page_size:6}),enabled:t&&r,staleTime:6e4,retry:!1}),E=i({queryKey:["search-benchmarks",a],queryFn:()=>x.listDatasets({q:a,page_size:6}),enabled:t&&r,staleTime:6e4,retry:!1}),F=i({queryKey:["search-authors",a],queryFn:()=>R.searchAuthors(a,S),enabled:t&&r,staleTime:6e4,retry:!1}),q=i({queryKey:["search-organizations",a],queryFn:()=>x.searchOrganizations(a,S),enabled:t&&r,staleTime:6e4,retry:!1});if(!t)return null;const o=((A=_.data)==null?void 0:A.results)||[],d=((C=b.data)==null?void 0:C.results)||[],u=((w=E.data)==null?void 0:w.results)||[],m=((K=F.data)==null?void 0:K.results)||[],p=((P=q.data)==null?void 0:P.results)||[],g=((Q=k.data)==null?void 0:Q.results)||[],I=k.isFetching||_.isFetching||b.isFetching||E.isFetching||F.isFetching||q.isFetching,L=o.length||g.length||d.length||u.length||m.length||p.length,n=s=>{h(),$(s)},T=()=>{const s=c.trim();s&&n(`/chat?q=${encodeURIComponent(s)}`)};return e.jsx("div",{className:"search-overlay",onClick:h,children:e.jsxs("div",{className:"search-modal",onClick:s=>s.stopPropagation(),children:[e.jsx("input",{ref:f,className:"search-modal-input",placeholder:"Search papers, tasks, methods, benchmarks, authors, or organizations…",value:c,onChange:s=>D(s.target.value),onKeyDown:s=>{y&&s.key==="Enter"&&(s.preventDefault(),T())}}),e.jsxs("div",{className:"search-results",children:[y&&c.trim()&&e.jsxs("button",{type:"button",className:"search-ask-row",onClick:T,children:[e.jsx("span",{className:"search-ask-chip",children:"assistant"}),e.jsxs("span",{className:"search-ask-text",children:["Ask: “",c.trim(),"”"]}),e.jsx("kbd",{children:"↵"})]}),!a&&e.jsxs("div",{className:"search-empty",children:["Try “diffusion”, “object detection”, or an arXiv id.",y&&e.jsx("span",{className:"search-empty-sub",children:"Press Enter to ask the assistant"})]}),a&&!r&&e.jsxs("div",{className:"search-empty",children:["Keep typing: results appear from ",v," characters."]}),r&&!I&&!L&&e.jsxs("div",{className:"search-empty",children:['No matches for "',c,'"']}),o.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Tasks · ",o.length]}),o.map(s=>{const l=G(X(s.slug||""));return e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/tasks/${s.slug}`),children:[e.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:l.dot}}),e.jsx("span",{className:"name",children:Z(s.name,s.slug)}),s.paper_count!=null&&e.jsxs("span",{className:"count",children:[s.paper_count," papers"]})]},s.id)})]}),d.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Methods · ",d.length]}),d.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/methods/${s.slug||s.id}`),children:[e.jsx("span",{style:{fontFamily:"var(--mono)",fontWeight:600},children:s.name}),s.paper_count!=null&&e.jsxs("span",{className:"count",children:[s.paper_count," papers"]})]},s.id))]}),u.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",u.length]}),u.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/benchmark/${s.slug||s.id}`),children:[e.jsx("span",{className:"name",children:s.name}),s.paper_count!=null&&s.paper_count>0&&e.jsxs("span",{className:"count",children:[s.paper_count," entries"]})]},s.id))]}),m.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Authors · ",m.length]}),m.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/authors/${s.id}`),children:[e.jsx("span",{className:"name",children:s.full_name}),s.hf_username&&e.jsxs("span",{className:"handle",children:["@",s.hf_username]}),s.paper_count>0&&e.jsxs("span",{className:"count",children:[s.paper_count," papers"]})]},s.id))]}),p.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Organizations · ",p.length]}),p.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/orgs/${s.slug}`),children:[s.logo_url&&e.jsx("img",{className:"logo",src:s.logo_url,alt:"",loading:"lazy"}),e.jsx("span",{className:"name",children:s.name}),s.paper_count!=null&&s.paper_count>0&&e.jsxs("span",{className:"count",children:[s.paper_count," papers"]})]},s.id))]}),g.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Papers · ",g.length]}),g.map(s=>{var l;return e.jsxs("div",{className:"search-result",onClick:()=>n(`/paper/${s.arxiv_id||s.id}`),children:[e.jsx("div",{className:"search-result-title",children:e.jsx(U,{title:s.title})}),e.jsxs("div",{className:"search-result-meta",children:[e.jsx("span",{children:s.arxiv_id?`arXiv:${s.arxiv_id}`:"External resource"}),((l=s.authors)==null?void 0:l[0])&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[s.authors[0],s.authors.length>1?" et al.":""]})]}),s.citation_count!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:["↑ ",s.citation_count.toLocaleString()]})]})]})]},s.id)})]}),j.length>=v&&e.jsxs("button",{type:"button",className:"search-view-all-row",onClick:()=>n(`/papers?search=${encodeURIComponent(j)}`),children:["View all paper results for “",j,"”"]})]})]})})};export{cs as default}; +import{r as z,c as O,K as M,g as B,j as e}from"./index-D6jcIRWs.js";import{p as H,a as R}from"./papers-DIIIPDpj.js";import{u as i}from"./useQuery-CUJUm4FY.js";import{L as U}from"./LatexTitle-D_92Jowu.js";import{c as x}from"./catalog-PYrB8_bm.js";import{u as Y}from"./useDebounce-DLPbKAkz.js";import{c as G,h as X,d as Z}from"./colors-CLwl8a2d.js";const V=10,S=6,W=350,v=3,cs=({open:t,onClose:h})=>{var A,C,w,K,P,Q;const f=z.useRef(null),$=O(),[c,D]=M.useState(""),a=Y(c,W),j=c.trim(),r=a.trim().length>=v,y=B();z.useEffect(()=>{var l;if(!t)return;(l=f.current)==null||l.focus();const s=N=>{N.key==="Escape"&&(N.preventDefault(),N.stopPropagation(),h())};return window.addEventListener("keydown",s,!0),()=>window.removeEventListener("keydown",s,!0)},[t,h]);const k=i({queryKey:[...H.feeds.searchOverlay,a],queryFn:()=>R.search(a,1,V),enabled:t&&r,staleTime:6e4,retry:!1}),_=i({queryKey:["search-tasks",a],queryFn:()=>x.listTasks({q:a,page_size:6}),enabled:t&&r,staleTime:6e4,retry:!1}),b=i({queryKey:["search-methods",a],queryFn:()=>x.listMethods({q:a,page_size:6}),enabled:t&&r,staleTime:6e4,retry:!1}),E=i({queryKey:["search-benchmarks",a],queryFn:()=>x.listDatasets({q:a,page_size:6}),enabled:t&&r,staleTime:6e4,retry:!1}),F=i({queryKey:["search-authors",a],queryFn:()=>R.searchAuthors(a,S),enabled:t&&r,staleTime:6e4,retry:!1}),q=i({queryKey:["search-organizations",a],queryFn:()=>x.searchOrganizations(a,S),enabled:t&&r,staleTime:6e4,retry:!1});if(!t)return null;const o=((A=_.data)==null?void 0:A.results)||[],d=((C=b.data)==null?void 0:C.results)||[],u=((w=E.data)==null?void 0:w.results)||[],m=((K=F.data)==null?void 0:K.results)||[],p=((P=q.data)==null?void 0:P.results)||[],g=((Q=k.data)==null?void 0:Q.results)||[],I=k.isFetching||_.isFetching||b.isFetching||E.isFetching||F.isFetching||q.isFetching,L=o.length||g.length||d.length||u.length||m.length||p.length,n=s=>{h(),$(s)},T=()=>{const s=c.trim();s&&n(`/chat?q=${encodeURIComponent(s)}`)};return e.jsx("div",{className:"search-overlay",onClick:h,children:e.jsxs("div",{className:"search-modal",onClick:s=>s.stopPropagation(),children:[e.jsx("input",{ref:f,className:"search-modal-input",placeholder:"Search papers, tasks, methods, benchmarks, authors, or organizations…",value:c,onChange:s=>D(s.target.value),onKeyDown:s=>{y&&s.key==="Enter"&&(s.preventDefault(),T())}}),e.jsxs("div",{className:"search-results",children:[y&&c.trim()&&e.jsxs("button",{type:"button",className:"search-ask-row",onClick:T,children:[e.jsx("span",{className:"search-ask-chip",children:"assistant"}),e.jsxs("span",{className:"search-ask-text",children:["Ask: “",c.trim(),"”"]}),e.jsx("kbd",{children:"↵"})]}),!a&&e.jsxs("div",{className:"search-empty",children:["Try “diffusion”, “object detection”, or an arXiv id.",y&&e.jsx("span",{className:"search-empty-sub",children:"Press Enter to ask the assistant"})]}),a&&!r&&e.jsxs("div",{className:"search-empty",children:["Keep typing: results appear from ",v," characters."]}),r&&!I&&!L&&e.jsxs("div",{className:"search-empty",children:['No matches for "',c,'"']}),o.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Tasks · ",o.length]}),o.map(s=>{const l=G(X(s.slug||""));return e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/tasks/${s.slug}`),children:[e.jsx("span",{className:"dot",style:{width:6,height:6,borderRadius:"50%",background:l.dot}}),e.jsx("span",{className:"name",children:Z(s.name,s.slug)}),s.paper_count!=null&&e.jsxs("span",{className:"count",children:[s.paper_count," papers"]})]},s.id)})]}),d.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Methods · ",d.length]}),d.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/methods/${s.slug||s.id}`),children:[e.jsx("span",{style:{fontFamily:"var(--mono)",fontWeight:600},children:s.name}),s.paper_count!=null&&e.jsxs("span",{className:"count",children:[s.paper_count," papers"]})]},s.id))]}),u.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Benchmarks · ",u.length]}),u.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/benchmark/${s.slug||s.id}`),children:[e.jsx("span",{className:"name",children:s.name}),s.paper_count!=null&&s.paper_count>0&&e.jsxs("span",{className:"count",children:[s.paper_count," entries"]})]},s.id))]}),m.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Authors · ",m.length]}),m.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/authors/${s.id}`),children:[e.jsx("span",{className:"name",children:s.full_name}),s.hf_username&&e.jsxs("span",{className:"handle",children:["@",s.hf_username]}),s.paper_count>0&&e.jsxs("span",{className:"count",children:[s.paper_count," papers"]})]},s.id))]}),p.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Organizations · ",p.length]}),p.map(s=>e.jsxs("div",{className:"search-result-tag",onClick:()=>n(`/orgs/${s.slug}`),children:[s.logo_url&&e.jsx("img",{className:"logo",src:s.logo_url,alt:"",loading:"lazy"}),e.jsx("span",{className:"name",children:s.name}),s.paper_count!=null&&s.paper_count>0&&e.jsxs("span",{className:"count",children:[s.paper_count," papers"]})]},s.id))]}),g.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"search-section-label",children:["Papers · ",g.length]}),g.map(s=>{var l;return e.jsxs("div",{className:"search-result",onClick:()=>n(`/paper/${s.arxiv_id||s.id}`),children:[e.jsx("div",{className:"search-result-title",children:e.jsx(U,{title:s.title})}),e.jsxs("div",{className:"search-result-meta",children:[e.jsx("span",{children:s.arxiv_id?`arXiv:${s.arxiv_id}`:"External resource"}),((l=s.authors)==null?void 0:l[0])&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:[s.authors[0],s.authors.length>1?" et al.":""]})]}),s.citation_count!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("span",{children:["↑ ",s.citation_count.toLocaleString()]})]})]})]},s.id)})]}),j.length>=v&&e.jsxs("button",{type:"button",className:"search-view-all-row",onClick:()=>n(`/papers?search=${encodeURIComponent(j)}`),children:["View all paper results for “",j,"”"]})]})]})})};export{cs as default}; diff --git a/assets/SettingsView-BhE0cUUD.js b/assets/SettingsView-BhE0cUUD.js deleted file mode 100644 index 05e855963c3b3d325b7be9de391842322763b0ca..0000000000000000000000000000000000000000 --- a/assets/SettingsView-BhE0cUUD.js +++ /dev/null @@ -1,36 +0,0 @@ -import{n as C,a as T,b as le,r as A,j as e,L as q,f as Q,H as R,h as ce,q as de,as as he,g as ue,K as S,A as ne}from"./index-CqKcHUvZ.js";import{u as O}from"./useQuery-Cngk7eL9.js";import{u as _}from"./useMutation-BItMAQ7s.js";import{T as ee,r as M}from"./research-Dt0MUW0x.js";import{S as z}from"./switch-BvSgzfJM.js";import{u as ge}from"./researchTopic-k4qgoW39.js";import{S as me}from"./sparkles-BKRdZneA.js";import{A as pe}from"./arrow-right-DCfHXCdw.js";import{T as fe}from"./trophy-CwHzFBlu.js";import{c as F}from"./chat-DGBJkcmd.js";import{f as ye,D as xe}from"./latexPlainText-DI8YEXVe.js";import{a as je,u as be,r as ve,O as Y}from"./openrouter-BNf4jDuS.js";import{E as se}from"./external-link-CrrdDZf6.js";import{M as we}from"./moon-DgDMXTmG.js";import"./index-C8IgDsSE.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 ke=C("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 Ne=C("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/** - * @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 Ce=C("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/** - * @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 Fe=C("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/** - * @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 Re=C("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/** - * @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=C("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** - * @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 Ee=C("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"}]]),Se={task:"task",method:"method",benchmark:"benchmark",author:"author",organization:"organization"};function Me(s){return s.status==="failed"?"We could not finish finding papers for this topic. Save it again to retry.":s.status==="done"?"Matching papers appear in your Following feed, and new ones are added every hour.":s.total?`Your feed shows the closest papers now. Refining matches: ${s.judged.toLocaleString()} of ${s.total.toLocaleString()} checked…`:"Your feed shows the closest papers now. Refining matches…"}function Oe(){var E,w,k;const{user:s}=T(),l=le(),h=A.useRef(null),j=["research-topic",s==null?void 0:s.hf_subject],d=O({queryKey:j,queryFn:M.topic,enabled:!!s,refetchInterval:i=>i.state.data&&["pending","running"].includes(i.state.data.status)?5e3:!1}),[f,y]=A.useState(null),a=ge(()=>y(null));if(A.useEffect(()=>{var i,N;l.hash==="#topic"&&d.isSuccess&&((i=h.current)==null||i.scrollIntoView({block:"center"}),(N=h.current)==null||N.focus())},[l.hash,d.isSuccess]),!s)return null;const c=((E=d.data)==null?void 0:E.text)??"",t=f??c,u=t.trim().replace(/\s+/g," "),g=((w=d.data)==null?void 0:w.status)==="failed"&&u===c,r=u.length>=3&&(u!==c||g),o=()=>{r&&!a.isPending&&a.mutate(u)};return e.jsxs("div",{className:"research-topic",id:"topic",children:[e.jsxs("h3",{className:"research-follow-group-title",children:[e.jsx(me,{"aria-hidden":"true"}),"Topic"]}),e.jsxs("p",{className:"settings-row-desc",children:["Describe the research you want to follow in your own words, for example"," ",e.jsx("em",{children:"real-time video generation"})," or ",e.jsx("em",{children:"speculative decoding for LLM inference"}),". A model reads every new paper and adds the ones that match to your Following feed."]}),d.isLoading?e.jsx("p",{className:"settings-billing-loading",children:"Loading your topic…"}):d.error?e.jsx("p",{className:"settings-token-error",role:"alert",children:"Could not load your topic."}):e.jsxs("form",{className:"research-topic-form",onSubmit:i=>{i.preventDefault(),o()},children:[e.jsx("textarea",{ref:h,className:"research-topic-input",rows:4,maxLength:ee,"aria-label":"Research topic",placeholder:"e.g. diffusion policies for robot manipulation",value:t,onChange:i=>y(i.target.value),onKeyDown:i=>{i.key==="Enter"&&!i.shiftKey&&!i.nativeEvent.isComposing&&(i.preventDefault(),o())}}),e.jsxs("div",{className:"research-topic-actions",children:[e.jsxs("span",{className:"research-topic-count",children:[t.length,"/",ee]}),c&&e.jsx("button",{type:"button",className:"research-follow-action",disabled:a.isPending,onClick:()=>a.mutate(null),children:"Remove"}),e.jsx("button",{type:"submit",className:"research-topic-save",disabled:a.isPending||!r,children:g?"Retry":c?"Update topic":"Follow topic"})]})]}),d.data&&e.jsx("p",{className:"research-email-status",role:"status",children:Me(d.data)}),(k=d.data)==null?void 0:k.suggestions.map(i=>e.jsxs("p",{className:"research-topic-suggestion",children:[e.jsx(q,{to:i.url,children:i.name})," is a ",Se[i.kind]," in the catalog. Following it as well adds every paper tagged with it."]},`${i.kind}:${i.entity_id}`)),a.error&&e.jsx("p",{className:"settings-token-error",role:"alert",children:"Could not save your topic. Please try again."})]})}const ae=[{kind:"task",label:"Tasks",icon:Ce,browse:"/tasks"},{kind:"method",label:"Methods",icon:Ne,browse:"/methods"},{kind:"benchmark",label:"Benchmarks",icon:fe},{kind:"author",label:"Authors",icon:Ee},{kind:"organization",label:"Organizations",icon:ke,browse:"/organizations"}],v=s=>`${s.kind}:${s.entity_id}`,Le=s=>new Date(s).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"});function Pe({follows:s}){const{user:l}=T(),h=Q(),[j,d]=A.useState([]),f=_({mutationFn:({follow:c,enabled:t})=>M.setFollow(c.kind,c.entity_id,t),onSuccess:(c,{follow:t,enabled:u})=>{const g=["research-follows",l==null?void 0:l.hf_subject];h.setQueryData(g,r=>u?[...r??[],t]:(r??[]).filter(o=>v(o)!==v(t))),d(r=>[...r.filter(o=>v(o)!==v(t)),...u?[]:[t]]),h.invalidateQueries({queryKey:g}),h.invalidateQueries({queryKey:["research-feed",l==null?void 0:l.hf_subject]})}}),y=new Set(s.map(v)),a=[...s,...j.filter(c=>!y.has(v(c)))];return a.length?e.jsxs(e.Fragment,{children:[ae.map(({kind:c,label:t,icon:u})=>{const g=a.filter(r=>r.kind===c).sort((r,o)=>r.name.localeCompare(o.name));return g.length?e.jsxs("div",{className:"research-follow-group",children:[e.jsxs("h3",{className:"research-follow-group-title",children:[e.jsx(u,{"aria-hidden":"true"}),t]}),e.jsx("ul",{className:"research-follow-list",children:g.map(r=>{const o=y.has(v(r));return e.jsxs("li",{className:o?"research-follow-row":"research-follow-row is-unfollowed",children:[e.jsxs("div",{className:"research-follow-text",children:[e.jsx(q,{to:r.url,children:r.name}),e.jsx("span",{children:o?`Following since ${Le(r.created_at)}`:"Unfollowed"})]}),e.jsx("button",{type:"button",className:o?"research-follow-action":"research-follow-action is-refollow",disabled:f.isPending,"aria-label":`${o?"Unfollow":"Follow"} ${r.name}`,onClick:()=>f.mutate({follow:r,enabled:!o}),children:o?"Unfollow":"Follow again"})]},v(r))})})]},c):null}),f.error&&e.jsx("p",{className:"settings-token-error",role:"alert",children:"Could not update follows. Please try again."})]}):e.jsx(Ie,{})}function Ie(){return e.jsxs("div",{className:"research-follow-empty",children:[e.jsx("p",{children:e.jsx("strong",{children:"You are not following any tasks, methods, benchmarks, authors, or organizations yet."})}),e.jsx("p",{children:"Use the Follow button on any task, method, benchmark, author, or organization page."}),e.jsx("div",{className:"research-follow-browse",children:ae.filter(s=>s.browse).map(({kind:s,label:l,icon:h,browse:j})=>e.jsxs(q,{to:j,children:[e.jsx(h,{"aria-hidden":"true"}),"Browse ",l.toLowerCase()]},s))})]})}function Ae(){var t;const{user:s}=T(),l=Q(),h=O({queryKey:["research-follows",s==null?void 0:s.hf_subject],queryFn:M.follows,enabled:!!s}),j=["research-email",s==null?void 0:s.hf_subject],d=O({queryKey:j,queryFn:M.email,enabled:!!s}),f=_({mutationFn:M.setEmail,onSuccess:u=>l.setQueryData(j,u)}),y=((t=h.data)==null?void 0:t.length)??0,a=d.data,c=!!(a!=null&&a.email)&&!a.suppressed;return e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"settings-section","aria-labelledby":"research-following-heading",children:[e.jsxs("div",{className:"research-section-heading",children:[e.jsxs("h2",{className:"settings-section-title",id:"research-following-heading",children:["Following",y>0&&e.jsx("span",{className:"research-follow-count",children:y})]}),s&&e.jsxs(q,{className:"research-feed-link",to:"/following",children:["Open Following feed ",e.jsx(pe,{"aria-hidden":"true"})]})]}),e.jsx("p",{className:"settings-row-desc research-section-intro",children:"New papers and benchmark results from your topic and what you follow appear in your Following feed. Your topic and follows are private."}),s?h.isLoading?e.jsx("p",{className:"settings-billing-loading",children:"Loading follows…"}):h.error?e.jsx("p",{className:"settings-token-error",role:"alert",children:"Could not load your follows."}):e.jsxs(e.Fragment,{children:[e.jsx(Oe,{}),e.jsx(Pe,{follows:h.data??[]})]}):e.jsxs("div",{className:"settings-note",children:[e.jsx("span",{children:"Sign in to follow research and build your personal feed."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(R,{returnTo:"/settings"})})]})]}),s&&e.jsxs("section",{className:"settings-section","aria-labelledby":"research-email-heading",children:[e.jsx("h2",{className:"settings-section-title",id:"research-email-heading",children:"Weekly research email"}),d.isLoading?e.jsx("p",{className:"settings-billing-loading",children:"Loading email preferences…"}):d.error||!a?e.jsx("p",{className:"settings-token-error",role:"alert",children:"Could not load email preferences."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"settings-row",children:[e.jsxs("label",{className:"settings-row-text",htmlFor:"research-weekly-email",children:[e.jsx("span",{className:"settings-row-label",children:"Email me a weekly digest"}),e.jsx("span",{className:"settings-row-desc",children:"Up to 20 new papers and benchmark results matching your follows, sent Mondays at 08:00 UTC. No email is sent in weeks without new matches. On by default once you follow something; turn it off here or from any email."})]}),e.jsx(z,{id:"research-weekly-email",checked:a.enabled,disabled:f.isPending||!a.enabled&&!c,onCheckedChange:u=>f.mutate(u)})]}),e.jsxs("div",{className:"research-email-destination",children:[e.jsx(Fe,{"aria-hidden":"true"}),a.email?e.jsxs(e.Fragment,{children:[e.jsxs("span",{children:["Sending to ",e.jsx("strong",{children:a.email})]}),e.jsx("a",{href:ce("/settings",!1,!0),children:"Refresh from Hugging Face"})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"To receive it, allow access to the verified email on your Hugging Face account."}),e.jsx(R,{returnTo:"/settings",collectEmail:!0,label:"Allow email access"})]})]}),a.suppressed&&e.jsx("p",{className:"research-email-status is-warning",role:"status",children:"Delivery to this address is paused after a bounce or spam complaint."}),!a.delivery_ready&&e.jsx("p",{className:"research-email-status",role:"status",children:"Weekly emails have not launched yet. Your preference is saved and applies from launch."}),f.error&&e.jsx("p",{className:"settings-token-error",role:"alert",children:"Could not save your preference. Refresh your email from Hugging Face and try again."})]})]})]})}const Te="https://openrouter.ai/settings/keys";function qe(s,l){if(s instanceof ne){if(typeof s.detail=="string")return s.detail;if(typeof s.detail=="object"&&s.detail!==null&&"message"in s.detail&&typeof s.detail.message=="string")return s.detail.message}return s instanceof Error&&!s.message.startsWith("API request failed:")?s.message:l}const es=()=>{var Z;const{user:s,isLoading:l}=T(),{preferences:h,setHideClosedSourceEvals:j,canPersist:d,isLoading:f}=de(),{theme:y,setTheme:a}=he(),c=y??"system",t=ue(),[u,g]=S.useState(""),[r,o]=S.useState(""),[E,w]=S.useState(""),[k,i]=S.useState(""),N=Q(),L=O({queryKey:["chat","models","settings"],enabled:t&&!!s,queryFn:()=>F.getModels()}),D=new Set((((Z=L.data)==null?void 0:Z.items)??[]).map(n=>n.provider)),H=D.has("huggingface"),P=D.has("openrouter"),te=D.has("openai"),I=O({queryKey:["inference-billing",s==null?void 0:s.hf_subject],enabled:t&&!!s&&H,queryFn:()=>F.getInferenceBilling()}),x=I.data??null,U=je(t&&!!s&&P),W=be(t&&!!s&&P),m=U.data,b=W.data,p=m?ve(m.resets_at):null,ie=t&&!!s&&(L.isLoading||!L.isError&&(H&&I.isLoading||P&&(U.isLoading||W.isLoading))),re=l||f||y===void 0||ie,V=_({mutationFn:n=>F.selectInferenceBillingAccount(n),onSuccess:n=>{N.setQueryData(["inference-billing",s==null?void 0:s.hf_subject],n),g("")},onError:n=>{g(n instanceof Error?n.message:"Could not change the billing account.")}}),oe=I.isLoading||V.isPending,K=(n,B)=>{o(qe(n,B)),w(n instanceof ne?n.code??"":"")},$=_({mutationFn:n=>F.connectOpenRouterCredential(n),onSuccess:n=>{N.setQueryData(Y,n),i(""),o(""),w("")},onError:n=>K(n,"Could not connect the OpenRouter key.")}),G=_({mutationFn:n=>F.setOpenRouterFallback(n),onSuccess:n=>{N.setQueryData(Y,n),o(""),w("")},onError:n=>K(n,"Could not change paid fallback.")}),X=_({mutationFn:()=>F.disconnectOpenRouterCredential(),onSuccess:()=>{N.setQueryData(Y,{connected:!1,verified_at:null,fallback_enabled:!1}),o(""),w("")},onError:n=>K(n,"Could not disconnect the OpenRouter key.")});return S.useEffect(()=>(document.title=ye("Settings"),()=>{document.title=xe}),[]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:e.jsx("em",{children:"Settings"})}),e.jsx("div",{className:"feed-subtitle",children:"Manage what you follow, your weekly email, and how papers are displayed."})]})}),re?e.jsx("div",{className:"settings-page-loading",role:"status","aria-live":"polite",children:e.jsx("span",{className:"sr-only",children:"Loading settings…"})}):e.jsxs("div",{className:"settings-page-content",children:[e.jsx(Ae,{}),s&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Catalog access"}),e.jsx("div",{className:"settings-note settings-note-flush",children:e.jsxs("span",{children:["Role: ",e.jsx("strong",{children:s.role??"community member"}),"."," ",s.can_directly_edit_catalog?"You can apply catalog edits directly. Destructive changes require a recent sign-in.":"Your catalog suggestions are sent to the submissions queue for review.",s.is_admin?" You can also review submissions and use administrative maintenance tools.":" Submission review and maintenance tools remain admin-only."]})})]}),t&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat usage & billing"}),s?L.isError?e.jsx("div",{className:"settings-billing-loading",role:"alert",children:"Could not load the enabled chat providers."}):e.jsxs("div",{className:"settings-provider-grid",children:[H&&e.jsxs("section",{className:"settings-provider-card","aria-labelledby":"inference-providers-heading",children:[e.jsxs("div",{className:"settings-provider-heading",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"inference-providers-heading",children:"Inference Providers"}),e.jsx("p",{children:"Hugging Face-billed model usage"})]}),(x==null?void 0:x.connected)&&e.jsx("span",{className:"settings-connected-badge",children:"Connected"})]}),I.isError?e.jsx("div",{className:"settings-billing-loading",role:"alert",children:"Hugging Face billing is currently unavailable."}):x!=null&&x.connected?e.jsxs("div",{className:"settings-billing",children:[e.jsx("div",{className:"settings-row-label",children:x.bill_to?`Organization · ${x.bill_to}`:`Personal account · @${s.username}`}),e.jsx("p",{className:"settings-row-desc",children:"Usage for Hugging Face Inference Providers is billed by Hugging Face to your selected account. Included Hugging Face usage is applied first; pay-as-you-go billing follows your Hugging Face plan and billing settings. Papers With Code does not fund, meter, or reset these credits."}),e.jsx("label",{className:"settings-token-label",htmlFor:"hf-billing-account",children:"Bill chat usage to"}),e.jsxs("select",{id:"hf-billing-account",className:"settings-billing-select",value:x.bill_to??"",onChange:n=>{g(""),V.mutate(n.target.value||null)},disabled:oe,children:[e.jsxs("option",{value:"",children:["Personal account (@",s.username,")"]}),x.organizations.map(n=>e.jsxs("option",{value:n.name,children:[n.display_name," (",n.name,")"]},n.name))]}),u&&e.jsx("div",{className:"settings-token-error",children:u}),e.jsx("div",{className:"settings-billing-actions",children:e.jsxs("a",{className:"button button-primary",href:x.usage_url,target:"_blank",rel:"noreferrer",children:["View Hugging Face usage & billing ",e.jsx(se,{"aria-hidden":"true"})]})})]}):e.jsxs("div",{className:"settings-billing-connect",children:[e.jsx("p",{className:"settings-row-desc",children:"Reconnect with Hugging Face to authorize Inference Providers. Hugging Face bills your personal account or the organization you select."}),e.jsx("div",{className:"settings-billing-actions",children:e.jsx(R,{returnTo:"/settings",label:"Re-sign in with Hugging Face",authorizeInference:!0})})]})]}),P&&e.jsxs("section",{className:"settings-provider-card",id:"openrouter-byok","aria-labelledby":"openrouter-heading",children:[e.jsxs("div",{className:"settings-provider-heading",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"openrouter-heading",children:"OpenRouter"}),e.jsx("p",{children:"Papers With Code-funded allowance and optional fallback"})]}),(b==null?void 0:b.connected)&&e.jsx("span",{className:"settings-connected-badge",children:"Key connected"})]}),e.jsx("p",{className:"settings-row-desc",children:"Papers With Code pays for these OpenRouter requests and provides free but limited monthly usage. Your own key is available as an optional fallback."}),m?e.jsxs("div",{className:"settings-usage-row",children:[e.jsxs("div",{className:"settings-usage-heading",children:[e.jsxs("div",{children:[e.jsx("div",{className:"settings-row-label",children:"Monthly OpenRouter usage"}),e.jsxs("div",{className:"settings-row-desc",children:["Resets ",p==null?void 0:p.local," ",e.jsxs("span",{"aria-label":"UTC reset time",children:["(",p==null?void 0:p.utc,")"]})]})]}),e.jsx("strong",{children:m.available?`${m.remaining_percent}% left`:"Unavailable"})]}),e.jsx("div",{className:"settings-usage-track",role:"progressbar","aria-label":`${m.remaining_percent}% remaining; resets ${p==null?void 0:p.local}; ${p==null?void 0:p.utc}`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":m.remaining_percent,children:e.jsx("span",{style:{width:`${m.remaining_percent}%`}})}),!m.available&&e.jsxs("p",{className:"settings-limit-note",children:[m.unavailable_reason==="personal_allowance_exhausted"?"Your free monthly allowance is depleted.":`The shared OpenRouter credits are currently unavailable. ${m.remaining_percent}% of your personal allowance remains.`," DeepSeek V4 Flash is temporarily unavailable unless you enable your own key below."]})]}):e.jsx("div",{className:"settings-billing-loading",children:U.isError||m?"OpenRouter usage is currently unavailable.":"Checking OpenRouter usage…"}),e.jsxs("div",{className:"settings-byok-controls",children:[e.jsx("div",{className:"settings-row-label",children:"Provide your own OpenRouter API key"}),b!=null&&b.connected?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"settings-row-desc",children:["Connected",b.verified_at?` · Last verified ${new Date(b.verified_at).toLocaleString()}`:"",". Your API key is stored securely using AES-256 encryption. It is never shown again."]}),e.jsxs("label",{className:"settings-fallback-control",children:[e.jsx(z,{checked:b.fallback_enabled,disabled:G.isPending,onCheckedChange:n=>G.mutate(!!n)}),e.jsxs("span",{children:[e.jsx("strong",{children:"Use my OpenRouter key when Papers With Code-funded OpenRouter access is unavailable"}),e.jsx("small",{children:"OpenRouter bills this usage to your own account. It is not covered by Papers With Code."})]})]}),e.jsx("p",{className:"settings-billing-help",children:"Disconnecting prevents new requests but cannot cancel a request already sent to OpenRouter."}),e.jsxs("div",{className:"settings-billing-actions",children:[e.jsx("button",{className:"button",type:"button",disabled:X.isPending,onClick:()=>X.mutate(),children:"Disconnect"}),e.jsxs("a",{className:"button",href:Te,target:"_blank",rel:"noreferrer",children:["Revoke or rotate at OpenRouter ",e.jsx(se,{"aria-hidden":"true"})]})]})]}):e.jsxs("form",{onSubmit:n=>{n.preventDefault(),k.trim()&&$.mutate(k.trim())},children:[e.jsx("label",{className:"settings-token-label",htmlFor:"openrouter-api-key",children:"OpenRouter API key"}),e.jsx("input",{id:"openrouter-api-key",type:"password",autoComplete:"off",value:k,onChange:n=>i(n.target.value),placeholder:"sk-or-…"}),e.jsx("p",{className:"settings-billing-help",children:"Connecting stores the key but does not authorize paid fallback. Enable billing separately after it is verified."}),e.jsx("div",{className:"settings-billing-actions",children:e.jsx("button",{className:"button button-primary",type:"submit",disabled:!k.trim()||$.isPending,children:$.isPending?"Verifying…":"Connect key"})})]}),r&&e.jsxs("div",{className:"settings-token-error",children:[e.jsx("p",{children:E==="fresh_auth_required"?"Your account is signed in, but adding or enabling an API key requires a Hugging Face sign-in from the last 15 minutes.":r}),E==="fresh_auth_required"&&e.jsx("div",{className:"settings-billing-actions",children:e.jsx(R,{returnTo:"/settings#openrouter-byok",label:"Re-authenticate with Hugging Face"})})]})]})]}),te&&e.jsx("div",{className:"settings-note settings-note-flush",role:"note",children:"Direct OpenAI usage is provided by Papers With Code. No OpenAI API key or billing account is required from you."})]}):e.jsxs("div",{className:"settings-note settings-note-flush",children:[e.jsx("span",{children:"Sign in to manage billing and credentials for the enabled chat providers."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(R,{returnTo:"/settings",authorizeInference:!0})})]})]}),t&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat privacy & retention"}),e.jsx("div",{className:"settings-note settings-note-flush",children:e.jsx("span",{children:"Chats are private and retained until you delete them. You can keep up to 500 active chats and 100 MB of chat data. Archiving removes chats from the active list and frees active-chat quota, but does not delete them. Deleting a chat permanently removes its durable transcript, workspace reference, and any public share link after deletion is verified. You can deliberately share an unlisted snapshot, but no dedicated private-chat export format is currently offered."})})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Appearance"}),e.jsx("div",{className:"theme-options","aria-label":"Color theme",children:[{value:"system",label:"System",description:"Match your device",icon:Re},{value:"light",label:"Light",description:"Always use light mode",icon:_e},{value:"dark",label:"Dark",description:"Always use dark mode",icon:we}].map(n=>{const B=n.icon,J=c===n.value;return e.jsxs("button",{type:"button",className:`theme-option ${J?"is-selected":""}`,"aria-pressed":J,onClick:()=>a(n.value),children:[e.jsx(B,{"aria-hidden":"true"}),e.jsxs("span",{className:"theme-option-copy",children:[e.jsx("span",{className:"theme-option-label",children:n.label}),e.jsx("span",{className:"theme-option-desc",children:n.description})]})]},n.value)})})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Evaluations"}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("label",{className:"settings-row-text",htmlFor:"hide-closed-source-evals",children:[e.jsx("span",{className:"settings-row-label",children:"Hide closed-source models"}),e.jsx("span",{className:"settings-row-desc",children:"When enabled, evaluations of closed-source models (proprietary APIs and unreleased flagship models) are hidden from benchmark leaderboards and paper result tables."})]}),e.jsx(z,{id:"hide-closed-source-evals",checked:h.hide_closed_source_evals,onCheckedChange:n=>{j(!!n)}})]}),!l&&!d&&!s&&e.jsxs("div",{className:"settings-note",children:[e.jsx("span",{children:"You are browsing as a guest, so this choice only applies to the current session. Sign in to save it to your account."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(R,{returnTo:"/settings"})})]})]})]})]})};export{es as default}; diff --git a/assets/SettingsView-BnRQHHDW.js b/assets/SettingsView-BnRQHHDW.js new file mode 100644 index 0000000000000000000000000000000000000000..67eb62008ab12d19f057c3c70c38c382b2e1c89e --- /dev/null +++ b/assets/SettingsView-BnRQHHDW.js @@ -0,0 +1,36 @@ +import{n as C,a as T,b as le,r as A,j as e,L as q,f as Q,H as R,h as ce,q as de,au as he,g as ue,K as S,A as ne}from"./index-D6jcIRWs.js";import{u as O}from"./useQuery-CUJUm4FY.js";import{u as _}from"./useMutation-p6mN4h17.js";import{T as ee,r as M}from"./research-BggtGgC2.js";import{S as z}from"./switch-D_MyRbto.js";import{u as ge}from"./researchTopic-NFMcqCcs.js";import{S as me}from"./sparkles-r8uPx2-0.js";import{A as pe}from"./arrow-right-CFRHnFt4.js";import{T as fe}from"./trophy-CqWfBPLd.js";import{c as F}from"./chat-ChnK8XDU.js";import{f as ye,D as xe}from"./latexPlainText-DI8YEXVe.js";import{a as je,u as be,r as ve,O as Y}from"./openrouter-DrXWVMlM.js";import{E as se}from"./external-link-C_yz2sXa.js";import{M as we}from"./moon--2wi3KtT.js";import"./index-DIg7XGE2.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 ke=C("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 Ne=C("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/** + * @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 Ce=C("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/** + * @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 Fe=C("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/** + * @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 Re=C("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/** + * @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=C("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** + * @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 Ee=C("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"}]]),Se={task:"task",method:"method",benchmark:"benchmark",author:"author",organization:"organization"};function Me(s){return s.status==="failed"?"We could not finish finding papers for this topic. Save it again to retry.":s.status==="done"?"Matching papers appear in your Following feed, and new ones are added every hour.":s.total?`Your feed shows the closest papers now. Refining matches: ${s.judged.toLocaleString()} of ${s.total.toLocaleString()} checked…`:"Your feed shows the closest papers now. Refining matches…"}function Oe(){var E,w,k;const{user:s}=T(),l=le(),h=A.useRef(null),j=["research-topic",s==null?void 0:s.hf_subject],d=O({queryKey:j,queryFn:M.topic,enabled:!!s,refetchInterval:i=>i.state.data&&["pending","running"].includes(i.state.data.status)?5e3:!1}),[f,y]=A.useState(null),a=ge(()=>y(null));if(A.useEffect(()=>{var i,N;l.hash==="#topic"&&d.isSuccess&&((i=h.current)==null||i.scrollIntoView({block:"center"}),(N=h.current)==null||N.focus())},[l.hash,d.isSuccess]),!s)return null;const c=((E=d.data)==null?void 0:E.text)??"",t=f??c,u=t.trim().replace(/\s+/g," "),g=((w=d.data)==null?void 0:w.status)==="failed"&&u===c,o=u.length>=3&&(u!==c||g),r=()=>{o&&!a.isPending&&a.mutate(u)};return e.jsxs("div",{className:"research-topic",id:"topic",children:[e.jsxs("h3",{className:"research-follow-group-title",children:[e.jsx(me,{"aria-hidden":"true"}),"Topic"]}),e.jsxs("p",{className:"settings-row-desc",children:["Describe the research you want to follow in your own words, for example"," ",e.jsx("em",{children:"real-time video generation"})," or ",e.jsx("em",{children:"speculative decoding for LLM inference"}),". A model reads every new paper and adds the ones that match to your Following feed."]}),d.isLoading?e.jsx("p",{className:"settings-billing-loading",children:"Loading your topic…"}):d.error?e.jsx("p",{className:"settings-token-error",role:"alert",children:"Could not load your topic."}):e.jsxs("form",{className:"research-topic-form",onSubmit:i=>{i.preventDefault(),r()},children:[e.jsx("textarea",{ref:h,className:"research-topic-input",rows:4,maxLength:ee,"aria-label":"Research topic",placeholder:"e.g. diffusion policies for robot manipulation",value:t,onChange:i=>y(i.target.value),onKeyDown:i=>{i.key==="Enter"&&!i.shiftKey&&!i.nativeEvent.isComposing&&(i.preventDefault(),r())}}),e.jsxs("div",{className:"research-topic-actions",children:[e.jsxs("span",{className:"research-topic-count",children:[t.length,"/",ee]}),c&&e.jsx("button",{type:"button",className:"research-follow-action",disabled:a.isPending,onClick:()=>a.mutate(null),children:"Remove"}),e.jsx("button",{type:"submit",className:"research-topic-save",disabled:a.isPending||!o,children:g?"Retry":c?"Update topic":"Follow topic"})]})]}),d.data&&e.jsx("p",{className:"research-email-status",role:"status",children:Me(d.data)}),(k=d.data)==null?void 0:k.suggestions.map(i=>e.jsxs("p",{className:"research-topic-suggestion",children:[e.jsx(q,{to:i.url,children:i.name})," is a ",Se[i.kind]," in the catalog. Following it as well adds every paper tagged with it."]},`${i.kind}:${i.entity_id}`)),a.error&&e.jsx("p",{className:"settings-token-error",role:"alert",children:"Could not save your topic. Please try again."})]})}const ae=[{kind:"task",label:"Tasks",icon:Ce,browse:"/tasks"},{kind:"method",label:"Methods",icon:Ne,browse:"/methods"},{kind:"benchmark",label:"Benchmarks",icon:fe},{kind:"author",label:"Authors",icon:Ee},{kind:"organization",label:"Organizations",icon:ke,browse:"/organizations"}],v=s=>`${s.kind}:${s.entity_id}`,Le=s=>new Date(s).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"});function Pe({follows:s}){const{user:l}=T(),h=Q(),[j,d]=A.useState([]),f=_({mutationFn:({follow:c,enabled:t})=>M.setFollow(c.kind,c.entity_id,t),onSuccess:(c,{follow:t,enabled:u})=>{const g=["research-follows",l==null?void 0:l.hf_subject];h.setQueryData(g,o=>u?[...o??[],t]:(o??[]).filter(r=>v(r)!==v(t))),d(o=>[...o.filter(r=>v(r)!==v(t)),...u?[]:[t]]),h.invalidateQueries({queryKey:g}),h.invalidateQueries({queryKey:["research-feed",l==null?void 0:l.hf_subject]})}}),y=new Set(s.map(v)),a=[...s,...j.filter(c=>!y.has(v(c)))];return a.length?e.jsxs(e.Fragment,{children:[ae.map(({kind:c,label:t,icon:u})=>{const g=a.filter(o=>o.kind===c).sort((o,r)=>o.name.localeCompare(r.name));return g.length?e.jsxs("div",{className:"research-follow-group",children:[e.jsxs("h3",{className:"research-follow-group-title",children:[e.jsx(u,{"aria-hidden":"true"}),t]}),e.jsx("ul",{className:"research-follow-list",children:g.map(o=>{const r=y.has(v(o));return e.jsxs("li",{className:r?"research-follow-row":"research-follow-row is-unfollowed",children:[e.jsxs("div",{className:"research-follow-text",children:[e.jsx(q,{to:o.url,children:o.name}),e.jsx("span",{children:r?`Following since ${Le(o.created_at)}`:"Unfollowed"})]}),e.jsx("button",{type:"button",className:r?"research-follow-action":"research-follow-action is-refollow",disabled:f.isPending,"aria-label":`${r?"Unfollow":"Follow"} ${o.name}`,onClick:()=>f.mutate({follow:o,enabled:!r}),children:r?"Unfollow":"Follow again"})]},v(o))})})]},c):null}),f.error&&e.jsx("p",{className:"settings-token-error",role:"alert",children:"Could not update follows. Please try again."})]}):e.jsx(Ie,{})}function Ie(){return e.jsxs("div",{className:"research-follow-empty",children:[e.jsx("p",{children:e.jsx("strong",{children:"You are not following any tasks, methods, benchmarks, authors, or organizations yet."})}),e.jsx("p",{children:"Use the Follow button on any task, method, benchmark, author, or organization page."}),e.jsx("div",{className:"research-follow-browse",children:ae.filter(s=>s.browse).map(({kind:s,label:l,icon:h,browse:j})=>e.jsxs(q,{to:j,children:[e.jsx(h,{"aria-hidden":"true"}),"Browse ",l.toLowerCase()]},s))})]})}function Ae(){var t;const{user:s}=T(),l=Q(),h=O({queryKey:["research-follows",s==null?void 0:s.hf_subject],queryFn:M.follows,enabled:!!s}),j=["research-email",s==null?void 0:s.hf_subject],d=O({queryKey:j,queryFn:M.email,enabled:!!s}),f=_({mutationFn:M.setEmail,onSuccess:u=>l.setQueryData(j,u)}),y=((t=h.data)==null?void 0:t.length)??0,a=d.data,c=!!(a!=null&&a.email)&&!a.suppressed;return e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"settings-section","aria-labelledby":"research-following-heading",children:[e.jsxs("div",{className:"research-section-heading",children:[e.jsxs("h2",{className:"settings-section-title",id:"research-following-heading",children:["Following",y>0&&e.jsx("span",{className:"research-follow-count",children:y})]}),s&&e.jsxs(q,{className:"research-feed-link",to:"/following",children:["Open Following feed ",e.jsx(pe,{"aria-hidden":"true"})]})]}),e.jsx("p",{className:"settings-row-desc research-section-intro",children:"New papers and benchmark results from your topic and what you follow appear in your Following feed. Your topic and follows are private."}),s?h.isLoading?e.jsx("p",{className:"settings-billing-loading",children:"Loading follows…"}):h.error?e.jsx("p",{className:"settings-token-error",role:"alert",children:"Could not load your follows."}):e.jsxs(e.Fragment,{children:[e.jsx(Oe,{}),e.jsx(Pe,{follows:h.data??[]})]}):e.jsxs("div",{className:"settings-note",children:[e.jsx("span",{children:"Sign in to follow research and build your personal feed."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(R,{returnTo:"/settings"})})]})]}),s&&e.jsxs("section",{className:"settings-section","aria-labelledby":"research-email-heading",children:[e.jsx("h2",{className:"settings-section-title",id:"research-email-heading",children:"Weekly research email"}),d.isLoading?e.jsx("p",{className:"settings-billing-loading",children:"Loading email preferences…"}):d.error||!a?e.jsx("p",{className:"settings-token-error",role:"alert",children:"Could not load email preferences."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"settings-row",children:[e.jsxs("label",{className:"settings-row-text",htmlFor:"research-weekly-email",children:[e.jsx("span",{className:"settings-row-label",children:"Email me a weekly digest"}),e.jsx("span",{className:"settings-row-desc",children:"Up to 20 new papers and benchmark results matching your follows, sent Mondays at 08:00 UTC. No email is sent in weeks without new matches. On by default once you follow something; turn it off here or from any email."})]}),e.jsx(z,{id:"research-weekly-email",checked:a.enabled,disabled:f.isPending||!a.enabled&&!c,onCheckedChange:u=>f.mutate(u)})]}),e.jsxs("div",{className:"research-email-destination",children:[e.jsx(Fe,{"aria-hidden":"true"}),a.email?e.jsxs(e.Fragment,{children:[e.jsxs("span",{children:["Sending to ",e.jsx("strong",{children:a.email})]}),e.jsx("a",{href:ce("/settings",{collectEmail:!0}),children:"Refresh from Hugging Face"})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"To receive it, allow access to the verified email on your Hugging Face account."}),e.jsx(R,{returnTo:"/settings",collectEmail:!0,label:"Allow email access"})]})]}),a.suppressed&&e.jsx("p",{className:"research-email-status is-warning",role:"status",children:"Delivery to this address is paused after a bounce or spam complaint."}),!a.delivery_ready&&e.jsx("p",{className:"research-email-status",role:"status",children:"Weekly emails have not launched yet. Your preference is saved and applies from launch."}),f.error&&e.jsx("p",{className:"settings-token-error",role:"alert",children:"Could not save your preference. Refresh your email from Hugging Face and try again."})]})]})]})}const Te="https://openrouter.ai/settings/keys";function qe(s,l){if(s instanceof ne){if(typeof s.detail=="string")return s.detail;if(typeof s.detail=="object"&&s.detail!==null&&"message"in s.detail&&typeof s.detail.message=="string")return s.detail.message}return s instanceof Error&&!s.message.startsWith("API request failed:")?s.message:l}const es=()=>{var Z;const{user:s,isLoading:l}=T(),{preferences:h,setHideClosedSourceEvals:j,canPersist:d,isLoading:f}=de(),{theme:y,setTheme:a}=he(),c=y??"system",t=ue(),[u,g]=S.useState(""),[o,r]=S.useState(""),[E,w]=S.useState(""),[k,i]=S.useState(""),N=Q(),L=O({queryKey:["chat","models","settings"],enabled:t&&!!s,queryFn:()=>F.getModels()}),D=new Set((((Z=L.data)==null?void 0:Z.items)??[]).map(n=>n.provider)),H=D.has("huggingface"),P=D.has("openrouter"),te=D.has("openai"),I=O({queryKey:["inference-billing",s==null?void 0:s.hf_subject],enabled:t&&!!s&&H,queryFn:()=>F.getInferenceBilling()}),x=I.data??null,U=je(t&&!!s&&P),W=be(t&&!!s&&P),m=U.data,b=W.data,p=m?ve(m.resets_at):null,ie=t&&!!s&&(L.isLoading||!L.isError&&(H&&I.isLoading||P&&(U.isLoading||W.isLoading))),oe=l||f||y===void 0||ie,V=_({mutationFn:n=>F.selectInferenceBillingAccount(n),onSuccess:n=>{N.setQueryData(["inference-billing",s==null?void 0:s.hf_subject],n),g("")},onError:n=>{g(n instanceof Error?n.message:"Could not change the billing account.")}}),re=I.isLoading||V.isPending,K=(n,B)=>{r(qe(n,B)),w(n instanceof ne?n.code??"":"")},$=_({mutationFn:n=>F.connectOpenRouterCredential(n),onSuccess:n=>{N.setQueryData(Y,n),i(""),r(""),w("")},onError:n=>K(n,"Could not connect the OpenRouter key.")}),G=_({mutationFn:n=>F.setOpenRouterFallback(n),onSuccess:n=>{N.setQueryData(Y,n),r(""),w("")},onError:n=>K(n,"Could not change paid fallback.")}),X=_({mutationFn:()=>F.disconnectOpenRouterCredential(),onSuccess:()=>{N.setQueryData(Y,{connected:!1,verified_at:null,fallback_enabled:!1}),r(""),w("")},onError:n=>K(n,"Could not disconnect the OpenRouter key.")});return S.useEffect(()=>(document.title=ye("Settings"),()=>{document.title=xe}),[]),e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsx("h1",{className:"feed-title",children:e.jsx("em",{children:"Settings"})}),e.jsx("div",{className:"feed-subtitle",children:"Manage what you follow, your weekly email, and how papers are displayed."})]})}),oe?e.jsx("div",{className:"settings-page-loading",role:"status","aria-live":"polite",children:e.jsx("span",{className:"sr-only",children:"Loading settings…"})}):e.jsxs("div",{className:"settings-page-content",children:[e.jsx(Ae,{}),s&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Catalog access"}),e.jsx("div",{className:"settings-note settings-note-flush",children:e.jsxs("span",{children:["Role: ",e.jsx("strong",{children:s.role??"community member"}),"."," ",s.can_directly_edit_catalog?"You can apply catalog edits directly. Destructive changes require a recent sign-in.":"Your catalog suggestions are sent to the submissions queue for review.",s.is_admin?" You can also review submissions and use administrative maintenance tools.":" Submission review and maintenance tools remain admin-only."]})})]}),t&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat usage & billing"}),s?L.isError?e.jsx("div",{className:"settings-billing-loading",role:"alert",children:"Could not load the enabled chat providers."}):e.jsxs("div",{className:"settings-provider-grid",children:[H&&e.jsxs("section",{className:"settings-provider-card","aria-labelledby":"inference-providers-heading",children:[e.jsxs("div",{className:"settings-provider-heading",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"inference-providers-heading",children:"Inference Providers"}),e.jsx("p",{children:"Hugging Face-billed model usage"})]}),(x==null?void 0:x.connected)&&e.jsx("span",{className:"settings-connected-badge",children:"Connected"})]}),I.isError?e.jsx("div",{className:"settings-billing-loading",role:"alert",children:"Hugging Face billing is currently unavailable."}):x!=null&&x.connected?e.jsxs("div",{className:"settings-billing",children:[e.jsx("div",{className:"settings-row-label",children:x.bill_to?`Organization · ${x.bill_to}`:`Personal account · @${s.username}`}),e.jsx("p",{className:"settings-row-desc",children:"Usage for Hugging Face Inference Providers is billed by Hugging Face to your selected account. Included Hugging Face usage is applied first; pay-as-you-go billing follows your Hugging Face plan and billing settings. Papers With Code does not fund, meter, or reset these credits."}),e.jsx("label",{className:"settings-token-label",htmlFor:"hf-billing-account",children:"Bill chat usage to"}),e.jsxs("select",{id:"hf-billing-account",className:"settings-billing-select",value:x.bill_to??"",onChange:n=>{g(""),V.mutate(n.target.value||null)},disabled:re,children:[e.jsxs("option",{value:"",children:["Personal account (@",s.username,")"]}),x.organizations.map(n=>e.jsxs("option",{value:n.name,children:[n.display_name," (",n.name,")"]},n.name))]}),u&&e.jsx("div",{className:"settings-token-error",children:u}),e.jsx("div",{className:"settings-billing-actions",children:e.jsxs("a",{className:"button button-primary",href:x.usage_url,target:"_blank",rel:"noreferrer",children:["View Hugging Face usage & billing ",e.jsx(se,{"aria-hidden":"true"})]})})]}):e.jsxs("div",{className:"settings-billing-connect",children:[e.jsx("p",{className:"settings-row-desc",children:"Reconnect with Hugging Face to authorize Inference Providers. Hugging Face bills your personal account or the organization you select."}),e.jsx("div",{className:"settings-billing-actions",children:e.jsx(R,{returnTo:"/settings",label:"Re-sign in with Hugging Face",authorizeInference:!0})})]})]}),P&&e.jsxs("section",{className:"settings-provider-card",id:"openrouter-byok","aria-labelledby":"openrouter-heading",children:[e.jsxs("div",{className:"settings-provider-heading",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"openrouter-heading",children:"OpenRouter"}),e.jsx("p",{children:"Papers With Code-funded allowance and optional fallback"})]}),(b==null?void 0:b.connected)&&e.jsx("span",{className:"settings-connected-badge",children:"Key connected"})]}),e.jsx("p",{className:"settings-row-desc",children:"Papers With Code pays for these OpenRouter requests and provides free but limited monthly usage. Your own key is available as an optional fallback."}),m?e.jsxs("div",{className:"settings-usage-row",children:[e.jsxs("div",{className:"settings-usage-heading",children:[e.jsxs("div",{children:[e.jsx("div",{className:"settings-row-label",children:"Monthly OpenRouter usage"}),e.jsxs("div",{className:"settings-row-desc",children:["Resets ",p==null?void 0:p.local," ",e.jsxs("span",{"aria-label":"UTC reset time",children:["(",p==null?void 0:p.utc,")"]})]})]}),e.jsx("strong",{children:m.available?`${m.remaining_percent}% left`:"Unavailable"})]}),e.jsx("div",{className:"settings-usage-track",role:"progressbar","aria-label":`${m.remaining_percent}% remaining; resets ${p==null?void 0:p.local}; ${p==null?void 0:p.utc}`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":m.remaining_percent,children:e.jsx("span",{style:{width:`${m.remaining_percent}%`}})}),!m.available&&e.jsxs("p",{className:"settings-limit-note",children:[m.unavailable_reason==="personal_allowance_exhausted"?"Your free monthly allowance is depleted.":`The shared OpenRouter credits are currently unavailable. ${m.remaining_percent}% of your personal allowance remains.`," DeepSeek V4 Flash is temporarily unavailable unless you enable your own key below."]})]}):e.jsx("div",{className:"settings-billing-loading",children:U.isError||m?"OpenRouter usage is currently unavailable.":"Checking OpenRouter usage…"}),e.jsxs("div",{className:"settings-byok-controls",children:[e.jsx("div",{className:"settings-row-label",children:"Provide your own OpenRouter API key"}),b!=null&&b.connected?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"settings-row-desc",children:["Connected",b.verified_at?` · Last verified ${new Date(b.verified_at).toLocaleString()}`:"",". Your API key is stored securely using AES-256 encryption. It is never shown again."]}),e.jsxs("label",{className:"settings-fallback-control",children:[e.jsx(z,{checked:b.fallback_enabled,disabled:G.isPending,onCheckedChange:n=>G.mutate(!!n)}),e.jsxs("span",{children:[e.jsx("strong",{children:"Use my OpenRouter key when Papers With Code-funded OpenRouter access is unavailable"}),e.jsx("small",{children:"OpenRouter bills this usage to your own account. It is not covered by Papers With Code."})]})]}),e.jsx("p",{className:"settings-billing-help",children:"Disconnecting prevents new requests but cannot cancel a request already sent to OpenRouter."}),e.jsxs("div",{className:"settings-billing-actions",children:[e.jsx("button",{className:"button",type:"button",disabled:X.isPending,onClick:()=>X.mutate(),children:"Disconnect"}),e.jsxs("a",{className:"button",href:Te,target:"_blank",rel:"noreferrer",children:["Revoke or rotate at OpenRouter ",e.jsx(se,{"aria-hidden":"true"})]})]})]}):e.jsxs("form",{onSubmit:n=>{n.preventDefault(),k.trim()&&$.mutate(k.trim())},children:[e.jsx("label",{className:"settings-token-label",htmlFor:"openrouter-api-key",children:"OpenRouter API key"}),e.jsx("input",{id:"openrouter-api-key",type:"password",autoComplete:"off",value:k,onChange:n=>i(n.target.value),placeholder:"sk-or-…"}),e.jsx("p",{className:"settings-billing-help",children:"Connecting stores the key but does not authorize paid fallback. Enable billing separately after it is verified."}),e.jsx("div",{className:"settings-billing-actions",children:e.jsx("button",{className:"button button-primary",type:"submit",disabled:!k.trim()||$.isPending,children:$.isPending?"Verifying…":"Connect key"})})]}),o&&e.jsxs("div",{className:"settings-token-error",children:[e.jsx("p",{children:E==="fresh_auth_required"?"Your account is signed in, but adding or enabling an API key requires a Hugging Face sign-in from the last 15 minutes.":o}),E==="fresh_auth_required"&&e.jsx("div",{className:"settings-billing-actions",children:e.jsx(R,{returnTo:"/settings#openrouter-byok",label:"Re-authenticate with Hugging Face"})})]})]})]}),te&&e.jsx("div",{className:"settings-note settings-note-flush",role:"note",children:"Direct OpenAI usage is provided by Papers With Code. No OpenAI API key or billing account is required from you."})]}):e.jsxs("div",{className:"settings-note settings-note-flush",children:[e.jsx("span",{children:"Sign in to manage billing and credentials for the enabled chat providers."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(R,{returnTo:"/settings",authorizeInference:!0})})]})]}),t&&e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Chat privacy & retention"}),e.jsx("div",{className:"settings-note settings-note-flush",children:e.jsx("span",{children:"Chats are private and retained until you delete them. You can keep up to 500 active chats and 100 MB of chat data. Archiving removes chats from the active list and frees active-chat quota, but does not delete them. Deleting a chat permanently removes its durable transcript, workspace reference, and any public share link after deletion is verified. You can deliberately share an unlisted snapshot, but no dedicated private-chat export format is currently offered."})})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Appearance"}),e.jsx("div",{className:"theme-options","aria-label":"Color theme",children:[{value:"system",label:"System",description:"Match your device",icon:Re},{value:"light",label:"Light",description:"Always use light mode",icon:_e},{value:"dark",label:"Dark",description:"Always use dark mode",icon:we}].map(n=>{const B=n.icon,J=c===n.value;return e.jsxs("button",{type:"button",className:`theme-option ${J?"is-selected":""}`,"aria-pressed":J,onClick:()=>a(n.value),children:[e.jsx(B,{"aria-hidden":"true"}),e.jsxs("span",{className:"theme-option-copy",children:[e.jsx("span",{className:"theme-option-label",children:n.label}),e.jsx("span",{className:"theme-option-desc",children:n.description})]})]},n.value)})})]}),e.jsxs("section",{className:"settings-section",children:[e.jsx("h2",{className:"settings-section-title",children:"Evaluations"}),e.jsxs("div",{className:"settings-row",children:[e.jsxs("label",{className:"settings-row-text",htmlFor:"hide-closed-source-evals",children:[e.jsx("span",{className:"settings-row-label",children:"Hide closed-source models"}),e.jsx("span",{className:"settings-row-desc",children:"When enabled, evaluations of closed-source models (proprietary APIs and unreleased flagship models) are hidden from benchmark leaderboards and paper result tables."})]}),e.jsx(z,{id:"hide-closed-source-evals",checked:h.hide_closed_source_evals,onCheckedChange:n=>{j(!!n)}})]}),!l&&!d&&!s&&e.jsxs("div",{className:"settings-note",children:[e.jsx("span",{children:"You are browsing as a guest, so this choice only applies to the current session. Sign in to save it to your account."}),e.jsx("div",{className:"settings-note-action",children:e.jsx(R,{returnTo:"/settings"})})]})]})]})]})};export{es as default}; diff --git a/assets/SharedChatView-BBge3zF7.js b/assets/SharedChatView-DVE3k-Oa.js similarity index 79% rename from assets/SharedChatView-BBge3zF7.js rename to assets/SharedChatView-DVE3k-Oa.js index 88bed789713fe5adb2cbd88edf99e1fd1c082cbe..15b15db3c46108f005ce67c0f319cf5b1315292b 100644 --- a/assets/SharedChatView-BBge3zF7.js +++ b/assets/SharedChatView-DVE3k-Oa.js @@ -1 +1 @@ -import{u as f,c as x,r as h,j as e,m as g}from"./index-CqKcHUvZ.js";import{u as v}from"./useQuery-Cngk7eL9.js";import{A as j,a as b,C as y,U as S,b as k}from"./ArtifactWorkspace-DZXFAFpE.js";import{C as m,e as w,p as N,q as C,g as q}from"./chatSessions-D75G2_U7.js";/* empty css */import"./hover-card-BTsA69o8.js";import"./CatalogEntityPreviewLink-BWMEEf81.js";import"./catalog-D26nGNnK.js";import"./github-sUmGdHig.js";import"./file-text-DnNBEwSF.js";import"./PaperPreviewLink-C6khj_iZ.js";import"./index-CqELxJb0.js";import"./index-DBHj7UWg.js";import"./katex-DkKDou_j.js";import"./papers-bE3C_Qzl.js";import"./useMutation-BItMAQ7s.js";import"./chat-DGBJkcmd.js";import"./copy-D9WKw0Bi.js";import"./thumbs-up-C19-ALYv.js";import"./arrow-left-D_tIkkPW.js";import"./external-link-CrrdDZf6.js";import"./plus-DZF-NxR0.js";import"./search-9n8Usynh.js";import"./chevron-up-CZWX0SDx.js";import"./AuthorAvatar-CWCqOa0h.js";const _=({detail:i})=>{const[d,l]=h.useState(()=>N(i)),p=h.useMemo(()=>{const t={};for(const c of d)for(const n of c.blocks??[])if(n.kind==="tool")for(const r of n.results??[])t[r.route_id]=r;return t},[d]),u=(t,c)=>{l(n=>n.map(r=>{var a;return r.id!==t?r:{...r,blocks:(a=r.blocks)==null?void 0:a.map((s,o)=>o===c&&(s.kind==="reasoning"||s.kind==="tool")?{...s,open:!s.open}:s)}}))};return e.jsx("div",{className:"shared-chat-transcript",children:d.map(t=>t.role==="user"?e.jsx(S,{id:t.id,text:t.text??"",paperMentions:t.paperMentions??[],paperSelection:t.paperSelection},t.id):e.jsx(k,{msg:t,papers:p,onToggleBlock:u},t.id))})},ee=()=>{const{shareId:i=""}=f(),d=x(),l=g(),[p,u]=h.useState(60),t=v({queryKey:["shared-chat",i],queryFn:()=>q(i),retry:(r,a)=>!(a instanceof m&&a.status===404)&&r<1});h.useEffect(()=>{const r=document.title,a=document.head.querySelector('meta[name="robots"]'),s=a==null?void 0:a.content,o=a??document.createElement("meta");return o.name="robots",o.content="noindex,nofollow",a||document.head.appendChild(o),document.title="Shared conversation",()=>{document.title=r,a?a.content=s??"":o.remove()}},[]),h.useLayoutEffect(()=>{const r=document.querySelector(".app-header");if(!r)return;const a=()=>u(r.offsetHeight);a();const s=new ResizeObserver(a);return s.observe(r),()=>s.disconnect()},[]);const c=r=>{C(r,void 0,{autoSend:!1}),d("/chat")},n=t.error instanceof m&&t.error.status===404;return t.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(w,{})," Loading shared conversation…"]}):n?e.jsxs("div",{className:"shared-chat-state shared-chat-not-found",children:[e.jsx("h1",{children:"Shared conversation not found"}),e.jsx("p",{children:"This link is invalid or is no longer available."})]}):t.isError||!t.data?e.jsxs("div",{className:"shared-chat-state",role:"alert",children:[e.jsx("h1",{children:"Couldn’t load this conversation"}),e.jsx("p",{children:"Please check your connection and try again."}),e.jsx("button",{type:"button",onClick:()=>void t.refetch(),children:"Try again"})]}):e.jsx(j,{workspaceKey:`share:${i}:${t.data.updated_at}`,autoOpenOnMount:!0,children:e.jsxs("div",{className:"shared-chat-page",style:{height:`calc(100dvh - ${p}px)`},children:[e.jsxs("div",{className:"shared-chat-heading",children:[e.jsx("h1",{children:"Shared conversation"}),l&&e.jsx("span",{className:"chat-staging-badge",children:"Staging"})]}),e.jsx(b,{variant:"shared",children:e.jsxs("div",{className:"shared-chat-content","data-testid":"shared-conversation-pane",children:[e.jsx(_,{detail:t.data},t.data.updated_at),t.data.model_label&&e.jsxs("div",{className:"shared-chat-attribution",children:[e.jsxs("span",{children:["Generated with ",t.data.model_label]}),t.data.model_provider==="huggingface"&&e.jsxs("span",{children:["Powered by ",e.jsx("span",{"aria-hidden":"true",children:"🤗"})," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]}),t.data.model_provider==="openrouter"&&e.jsxs("span",{children:["Powered by ",e.jsx("a",{href:"https://openrouter.ai",target:"_blank",rel:"noreferrer",children:"OpenRouter"})]}),t.data.model_provider==="openai"&&e.jsx("span",{children:"Powered by OpenAI"})]}),e.jsxs("section",{className:"shared-chat-fresh","aria-labelledby":"shared-chat-fresh-title",children:[e.jsx("h2",{id:"shared-chat-fresh-title",children:"Start a new conversation"}),e.jsx("p",{children:"Your new question starts with an empty context."}),l&&e.jsxs("div",{className:"shared-chat-access-note",role:"note",children:[e.jsx("strong",{children:"Limited staging preview."})," Starting a chat is available only to approved Hugging Face users."]}),e.jsx(y,{onSend:r=>c(r.text),placeholder:"Ask a new research question…"})]})]})})]})})};export{ee as default}; +import{u as f,c as x,r as h,j as e,m as g}from"./index-D6jcIRWs.js";import{u as v}from"./useQuery-CUJUm4FY.js";import{A as j,a as b,C as y,U as S,b as k}from"./ArtifactWorkspace-CUZCugRS.js";import{C as m,e as w,p as N,q as C,g as q}from"./chatSessions-DByIWBno.js";/* empty css */import"./hover-card-DPpv0l_x.js";import"./CatalogEntityPreviewLink-BhTSUN-X.js";import"./catalog-PYrB8_bm.js";import"./github-B7D_19Qm.js";import"./file-text-4G2I5_Zo.js";import"./PaperPreviewLink-fcJyP9H0.js";import"./index-uFGyKu5N.js";import"./index-yduEvk9Z.js";import"./katex-DkKDou_j.js";import"./papers-DIIIPDpj.js";import"./useMutation-p6mN4h17.js";import"./chat-ChnK8XDU.js";import"./copy-BmzqMihw.js";import"./thumbs-up-BqRlVdvF.js";import"./arrow-left-IzGlownM.js";import"./external-link-C_yz2sXa.js";import"./plus-C4UQ62Q1.js";import"./search-CfTufeR7.js";import"./chevron-up-CQKUhZ0S.js";import"./AuthorAvatar-UMHOVOr9.js";const _=({detail:i})=>{const[d,l]=h.useState(()=>N(i)),p=h.useMemo(()=>{const t={};for(const c of d)for(const n of c.blocks??[])if(n.kind==="tool")for(const r of n.results??[])t[r.route_id]=r;return t},[d]),u=(t,c)=>{l(n=>n.map(r=>{var a;return r.id!==t?r:{...r,blocks:(a=r.blocks)==null?void 0:a.map((s,o)=>o===c&&(s.kind==="reasoning"||s.kind==="tool")?{...s,open:!s.open}:s)}}))};return e.jsx("div",{className:"shared-chat-transcript",children:d.map(t=>t.role==="user"?e.jsx(S,{id:t.id,text:t.text??"",paperMentions:t.paperMentions??[],paperSelection:t.paperSelection},t.id):e.jsx(k,{msg:t,papers:p,onToggleBlock:u},t.id))})},ee=()=>{const{shareId:i=""}=f(),d=x(),l=g(),[p,u]=h.useState(60),t=v({queryKey:["shared-chat",i],queryFn:()=>q(i),retry:(r,a)=>!(a instanceof m&&a.status===404)&&r<1});h.useEffect(()=>{const r=document.title,a=document.head.querySelector('meta[name="robots"]'),s=a==null?void 0:a.content,o=a??document.createElement("meta");return o.name="robots",o.content="noindex,nofollow",a||document.head.appendChild(o),document.title="Shared conversation",()=>{document.title=r,a?a.content=s??"":o.remove()}},[]),h.useLayoutEffect(()=>{const r=document.querySelector(".app-header");if(!r)return;const a=()=>u(r.offsetHeight);a();const s=new ResizeObserver(a);return s.observe(r),()=>s.disconnect()},[]);const c=r=>{C(r,void 0,{autoSend:!1}),d("/chat")},n=t.error instanceof m&&t.error.status===404;return t.isLoading?e.jsxs("div",{className:"shared-chat-state",role:"status",children:[e.jsx(w,{})," Loading shared conversation…"]}):n?e.jsxs("div",{className:"shared-chat-state shared-chat-not-found",children:[e.jsx("h1",{children:"Shared conversation not found"}),e.jsx("p",{children:"This link is invalid or is no longer available."})]}):t.isError||!t.data?e.jsxs("div",{className:"shared-chat-state",role:"alert",children:[e.jsx("h1",{children:"Couldn’t load this conversation"}),e.jsx("p",{children:"Please check your connection and try again."}),e.jsx("button",{type:"button",onClick:()=>void t.refetch(),children:"Try again"})]}):e.jsx(j,{workspaceKey:`share:${i}:${t.data.updated_at}`,autoOpenOnMount:!0,children:e.jsxs("div",{className:"shared-chat-page",style:{height:`calc(100dvh - ${p}px)`},children:[e.jsxs("div",{className:"shared-chat-heading",children:[e.jsx("h1",{children:"Shared conversation"}),l&&e.jsx("span",{className:"chat-staging-badge",children:"Staging"})]}),e.jsx(b,{variant:"shared",children:e.jsxs("div",{className:"shared-chat-content","data-testid":"shared-conversation-pane",children:[e.jsx(_,{detail:t.data},t.data.updated_at),t.data.model_label&&e.jsxs("div",{className:"shared-chat-attribution",children:[e.jsxs("span",{children:["Generated with ",t.data.model_label]}),t.data.model_provider==="huggingface"&&e.jsxs("span",{children:["Powered by ",e.jsx("span",{"aria-hidden":"true",children:"🤗"})," ",e.jsx("a",{href:"https://huggingface.co/docs/inference-providers/en/index",target:"_blank",rel:"noreferrer",children:"Inference Providers"})]}),t.data.model_provider==="openrouter"&&e.jsxs("span",{children:["Powered by ",e.jsx("a",{href:"https://openrouter.ai",target:"_blank",rel:"noreferrer",children:"OpenRouter"})]}),t.data.model_provider==="openai"&&e.jsx("span",{children:"Powered by OpenAI"})]}),e.jsxs("section",{className:"shared-chat-fresh","aria-labelledby":"shared-chat-fresh-title",children:[e.jsx("h2",{id:"shared-chat-fresh-title",children:"Start a new conversation"}),e.jsx("p",{children:"Your new question starts with an empty context."}),l&&e.jsxs("div",{className:"shared-chat-access-note",role:"note",children:[e.jsx("strong",{children:"Limited staging preview."})," Starting a chat is available only to approved Hugging Face users."]}),e.jsx(y,{onSend:r=>c(r.text),placeholder:"Ask a new research question…"})]})]})})]})})};export{ee as default}; diff --git a/assets/SignInToEditDialog-B4COuqpY.js b/assets/SignInToEditDialog-RzK54RAM.js similarity index 95% rename from assets/SignInToEditDialog-B4COuqpY.js rename to assets/SignInToEditDialog-RzK54RAM.js index 6f8593335a8ea205ca816526af26f07782ef3139..8cad9a30511aa994e8d2ad6d9dddfc76f1eff442 100644 --- a/assets/SignInToEditDialog-B4COuqpY.js +++ b/assets/SignInToEditDialog-RzK54RAM.js @@ -1,4 +1,4 @@ -import{n as be,r as a,j as e,a4 as je,B as fe,a5 as ye,p as Ne,s as we,X as Se,C as _e,H as ke}from"./index-CqKcHUvZ.js";import{B as P}from"./button-BYn4yUH_.js";import{I as u}from"./input-sw0Ix0Sa.js";import{T as Ce}from"./textarea-CQToxq8k.js";import{S as se}from"./searchable-select-DY1KXMvg.js";import{D as ie,a as oe,c as le,b as ce,d as de,e as De}from"./dialog-B-oqHDuH.js";import{u as Ie}from"./useMutation-BItMAQ7s.js";import{s as b,p as j}from"./submissions-1aHdBaSr.js";import{c as te}from"./catalog-D26nGNnK.js";import{L as Ee}from"./loader-circle-CZgakNH7.js";/** +import{n as be,r as a,j as e,a6 as je,B as fe,a7 as ye,p as Ne,s as we,X as Se,C as _e,H as ke}from"./index-D6jcIRWs.js";import{B as P}from"./button-Bzx0ccHH.js";import{I as u}from"./input-CCN-4hy4.js";import{T as Ce}from"./textarea-sXKODM3W.js";import{S as se}from"./searchable-select-B7z6Fcrr.js";import{D as ie,a as oe,c as le,b as ce,d as de,e as De}from"./dialog-vGFIbcd-.js";import{u as Ie}from"./useMutation-p6mN4h17.js";import{s as b,p as j}from"./submissions-DNa3tQdo.js";import{c as te}from"./catalog-PYrB8_bm.js";import{L as Ee}from"./loader-circle-BuDrH29B.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/StagingAccessRequestView-DeIOzPRB.js b/assets/StagingAccessRequestView-BV2q1V1S.js similarity index 95% rename from assets/StagingAccessRequestView-DeIOzPRB.js rename to assets/StagingAccessRequestView-BV2q1V1S.js index 2460964da6cca7686a39b3188c8c79cedf2af79b..e2846a7b055dc8bd28219a734bbb2b63e62a2c9a 100644 --- a/assets/StagingAccessRequestView-DeIOzPRB.js +++ b/assets/StagingAccessRequestView-BV2q1V1S.js @@ -1 +1 @@ -import{a as m,K as a,j as e,H as g,aT as p}from"./index-CqKcHUvZ.js";import{C as j}from"./circle-check-BYRHMG9x.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,K as a,j as e,H as g,aY as p}from"./index-D6jcIRWs.js";import{C as j}from"./circle-check-BZn9Lr76.js";const f=()=>{const{user:s,isLoading:u}=m(),[l,d]=a.useState(!1),[r,t]=a.useState(!1),[c,i]=a.useState(null),o=async h=>{h.preventDefault(),t(!0),i(null);try{await p.requestStagingAccess(),d(!0)}catch(n){i(n instanceof Error?n.message:"Could not submit your request.")}finally{t(!1)}};return e.jsx("main",{className:"access-request-page",children:e.jsxs("section",{className:"access-request-card","aria-labelledby":"access-request-title",children:[e.jsxs("a",{className:"access-request-brand",href:"https://paperswithcode.co",children:[e.jsx("span",{className:"brand-mark","aria-hidden":"true"}),e.jsxs("span",{className:"brand-name",children:["Papers ",e.jsx("em",{children:"with"})," Code"]})]}),l?e.jsxs("div",{className:"access-request-success",role:"status",children:[e.jsx(j,{size:34,strokeWidth:1.6,"aria-hidden":"true"}),e.jsx("h1",{id:"access-request-title",children:"Request received"}),e.jsxs("p",{children:["Thanks, @",s==null?void 0:s.username,". We’ll review your contributor access request."]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"access-request-heading",children:[e.jsx("p",{className:"access-request-eyebrow",children:"Staging preview"}),e.jsx("h1",{id:"access-request-title",children:"Request access"}),e.jsx("p",{children:"This preview is limited to project contributors. Send us your verified Hugging Face username and email address to request access."})]}),u?e.jsx("p",{className:"access-request-status",role:"status",children:"Checking your Hugging Face account…"}):s?e.jsxs("form",{className:"access-request-form",onSubmit:o,children:[e.jsx("label",{htmlFor:"hf-username",children:"Hugging Face username"}),e.jsxs("div",{className:"access-request-input-wrap",children:[e.jsx("span",{"aria-hidden":"true",children:"@"}),e.jsx("input",{id:"hf-username",name:"hf_username",value:s.username,readOnly:!0,autoComplete:"username"})]}),e.jsxs("p",{className:"access-request-verified",children:["Username and email verified through Hugging Face sign-in. See our"," ",e.jsx("a",{href:"https://paperswithcode.co/privacy",children:"Privacy Policy"}),"."]}),c&&e.jsx("p",{className:"access-request-error",role:"alert",children:c}),e.jsx("button",{className:"access-request-submit",type:"submit",disabled:r,children:r?"Sending…":"Request access"})]}):e.jsxs("div",{className:"access-request-signin",children:[e.jsx("p",{children:"Sign in first so we can verify the account you’re requesting access for."}),e.jsx(g,{returnTo:"/request-access",label:"Sign in with Hugging Face",collectEmail:!0})]})]})]})})};export{f as default}; diff --git a/assets/SubmissionsDashboard-CfJfn_Cp.js b/assets/SubmissionsDashboard-CfJfn_Cp.js new file mode 100644 index 0000000000000000000000000000000000000000..b1e1a99541a3583f72e605acbd452bee6b09ccde --- /dev/null +++ b/assets/SubmissionsDashboard-CfJfn_Cp.js @@ -0,0 +1,11 @@ +var xe=s=>{throw TypeError(s)};var re=(s,t,n)=>t.has(s)||xe("Cannot "+n);var b=(s,t,n)=>(re(s,t,"read from private field"),n?n.call(s):t.get(s)),C=(s,t,n)=>t.has(s)?xe("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,n),k=(s,t,n,i)=>(re(s,t,"write to private field"),i?i.call(s,n):t.set(s,n),n),O=(s,t,n)=>(re(s,t,"access private method"),n);import{ay as Fe,aL as le,aB as Ae,aU as Ue,f as Ee,r as H,aD as Qe,n as Re,j as e,Y as Ce,B as I,K as w,p as Oe,s as z,aV as $e,aW as qe,aX as De}from"./index-D6jcIRWs.js";import{r as Le,e as ze}from"./evaluationQueryInvalidation-D5wBpmlA.js";import{a as Pe,p as Be}from"./papers-DIIIPDpj.js";import{i as je,a as ae}from"./queryInvalidation-BxCpTdQe.js";import{Q as Me,b as He,c as Ke,e as Je,d as We,f as Ge,s as ve,g as Ye,h as Ve,u as Te}from"./useQuery-CUJUm4FY.js";import{u as se}from"./useMutation-p6mN4h17.js";import{u as Xe}from"./useInfiniteQuery-FXco4P1n.js";import{c as U}from"./catalog-PYrB8_bm.js";import{s as D}from"./safeExternalHref-CkBrsh84.js";import{s as W}from"./submissions-DNa3tQdo.js";import{R as Ze,C as es}from"./refresh-cw-Qmu3JZxd.js";import{L as G}from"./loader-circle-BuDrH29B.js";import{C as ss}from"./circle-check-BZn9Lr76.js";function _e(s,t){const n=new Set(t);return s.filter(i=>!n.has(i))}function ts(s,t,n){const i=s.slice(0);return i[t]=n,i}var P,E,B,q,R,A,Y,V,X,Z,N,ce,de,Ie,ue,pe,he,Se,is=(Se=class extends Fe{constructor(t,n,i){super();C(this,N);C(this,P);C(this,E);C(this,B);C(this,q);C(this,R);C(this,A);C(this,Y);C(this,V);C(this,X);C(this,Z,[]);k(this,P,t),k(this,q,i),k(this,B,[]),k(this,R,[]),k(this,E,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&b(this,R).forEach(t=>{t.subscribe(n=>{O(this,N,pe).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,b(this,R).forEach(t=>{t.destroy()})}setQueries(t,n){k(this,B,t),k(this,q,n),le.batch(()=>{const i=b(this,R),r=O(this,N,ue).call(this,b(this,B));r.forEach(l=>l.observer.setOptions(l.defaultedQueryOptions));const o=r.map(l=>l.observer),a=o.map(l=>l.getCurrentResult()),u=i.length!==o.length,d=o.some((l,m)=>l!==i[m]),p=u||d,v=p?!0:a.some((l,m)=>{const c=b(this,E)[m];return!c||!Ae(l,c)});!p&&!v||(p&&(k(this,Z,r),k(this,R,o)),k(this,E,a),this.hasListeners()&&(p&&(_e(i,o).forEach(l=>{l.destroy()}),_e(o,i).forEach(l=>{l.subscribe(m=>{O(this,N,pe).call(this,l,m)})})),O(this,N,he).call(this)))})}getCurrentResult(){return b(this,E)}getQueries(){return b(this,R).map(t=>t.getCurrentQuery())}getObservers(){return b(this,R)}getOptimisticResult(t,n){const i=O(this,N,ue).call(this,t),r=i.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),o=i.map(a=>a.defaultedQueryOptions.queryHash);return[r,a=>O(this,N,de).call(this,a??r,n,o),()=>O(this,N,ce).call(this,r,i)]}},P=new WeakMap,E=new WeakMap,B=new WeakMap,q=new WeakMap,R=new WeakMap,A=new WeakMap,Y=new WeakMap,V=new WeakMap,X=new WeakMap,Z=new WeakMap,N=new WeakSet,ce=function(t,n){return n.map((i,r)=>{const o=t[r];return i.defaultedQueryOptions.notifyOnChangeProps?o:i.observer.trackResult(o,a=>{n.forEach(u=>{u.observer.trackProp(a)})})})},de=function(t,n,i){if(n){const r=b(this,X),o=i!==void 0&&r!==void 0&&(r.length!==i.length||i.some((a,u)=>a!==r[u]));return(!b(this,A)||b(this,E)!==b(this,V)||o||n!==b(this,Y))&&(k(this,Y,n),k(this,V,b(this,E)),i!==void 0&&k(this,X,i),k(this,A,Ue(b(this,A),n(t)))),b(this,A)}return t},Ie=function(){var t;return((t=b(this,q))==null?void 0:t.combine)!==void 0&&b(this,R).some((n,i)=>{var r;return n.options.suspense&&((r=b(this,E)[i])==null?void 0:r.data)===void 0})},ue=function(t){const n=new Map;b(this,R).forEach(r=>{const o=r.options.queryHash;if(!o)return;const a=n.get(o);a?a.push(r):n.set(o,[r])});const i=[];return t.forEach(r=>{var d;const o=b(this,P).defaultQueryOptions(r),u=((d=n.get(o.queryHash))==null?void 0:d.shift())??new Me(b(this,P),o);i.push({defaultedQueryOptions:o,observer:u})}),i},pe=function(t,n){const i=b(this,R).indexOf(t);i!==-1&&(k(this,E,ts(b(this,E),i,n)),O(this,N,he).call(this))},he=function(){var t;if(this.hasListeners()){const n=O(this,N,ce).call(this,b(this,E),b(this,Z)),i=O(this,N,Ie).call(this),r=b(this,A),o=i?r:O(this,N,de).call(this,n,(t=b(this,q))==null?void 0:t.combine);(i||r!==o)&&le.batch(()=>{this.listeners.forEach(a=>{a(b(this,E))})})}},Se);function ie({queries:s,...t},n){const i=Ee(),r=He(),o=Ke(),a=H.useMemo(()=>s.map(x=>{const _=i.defaultQueryOptions(x);return _._optimisticResults=r?"isRestoring":"optimistic",_}),[s,i,r]);a.forEach(x=>{Je(x);const _=i.getQueryCache().get(x.queryHash);We(x,o,_)}),Ge(o);const[u]=H.useState(()=>new is(i,a,t)),[d,p,v]=u.getOptimisticResult(a,t.combine),l=!r&&t.subscribed!==!1;H.useSyncExternalStore(H.useCallback(x=>l?u.subscribe(le.batchCalls(x)):Qe,[u,l]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),H.useEffect(()=>{u.setQueries(a,t)},[a,t,u]);const c=d.some((x,_)=>ve(a[_],x))?d.flatMap((x,_)=>{const S=a[_];if(S&&ve(S,x)){const Q=new Me(i,S);return Ye(S,Q,o)}return[]}):[];if(c.length>0)throw Promise.all(c);const f=d.find((x,_)=>{const S=a[_];return S&&Ve({result:x,errorResetBoundary:o,throwOnError:S.throwOnError,query:i.getQueryCache().get(S.queryHash),suspense:S.suspense})});if(f!=null&&f.error)throw f.error;return p(v())}/** + * @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 ye=Re("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/** + * @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=Re("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 rs({currentPayload:s,proposedPayload:t}){const[n,i]=w.useState(!1);return e.jsxs("div",{className:"submission-raw-toggle",children:[e.jsx("button",{type:"button",className:"raw-json-btn",onClick:()=>i(r=>!r),children:n?"Hide raw JSON":"Show raw JSON"}),n&&e.jsxs("div",{className:"submission-json-grid",children:[e.jsx(me,{title:"Current payload",value:s??{}}),e.jsx(me,{title:"Proposed payload",value:t})]})]})}function me({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 fe({currentItems:s,proposedIds:t,queryPrefix:n,fetchEntity:i,knownNames:r}){const o=w.useMemo(()=>Array.from(new Set([...s.map(c=>c.id),...t])).sort((c,f)=>c-f),[s,t]),a=ie({queries:i?o.map(c=>({queryKey:[n,String(c)],queryFn:()=>i(String(c)),staleTime:5*60*1e3})):[]}),u=w.useMemo(()=>{const c=new Map;return s.forEach(f=>c.set(f.id,f.name)),r==null||r.forEach((f,x)=>c.set(x,f)),a.forEach(f=>{const x=f.data;if(!x)return;const _=Number(x.id);Number.isFinite(_)&&c.set(_,x.name)}),c},[s,a,r]),d=new Set(s.map(c=>c.id)),p=new Set(t),v=o.filter(c=>d.has(c)&&!p.has(c)),l=o.filter(c=>!d.has(c)&&p.has(c)),m=(c,f)=>{const x=f==="current"&&v.includes(c),_=f==="proposed"&&l.includes(c);return e.jsx("span",{className:I("submission-diff-pill",x&&"removed",_&&"added"),children:u.get(c)??`#${c}`},c)};return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(j,{title:"Currently tagged",children:s.length>0?s.map(c=>m(c.id,"current")):e.jsx(y,{children:"No current tags"})}),e.jsx(j,{title:"Will be tagged",children:t.length>0?t.map(c=>m(c,"proposed")):e.jsx(y,{children:"No proposed tags"})})]})}function as({currentItems:s,proposedIds:t}){var o;const n=Te({queryKey:["organizations","submission-diff"],queryFn:()=>U.organizations(),staleTime:3e5}),i=new Map(s.map(a=>[a.id,a.name]));(o=n.data)==null||o.results.forEach(a=>{const u=Number(a.id);Number.isFinite(u)&&i.set(u,a.name)});const r=s.map(a=>({...a,name:i.get(a.id)??a.name}));return e.jsx(fe,{currentItems:r,proposedIds:t,queryPrefix:"organization",knownNames:i})}function te({label:s,currentItems:t,proposedItems:n}){const i=new Map(t.map(a=>[a.url,a])),r=new Map(n.map(a=>[a.url,a])),o=Array.from(new Set([...i.keys(),...r.keys()])).sort();return o.length===0?e.jsxs(y,{children:["No ",s," in this submission."]}):e.jsx("div",{className:"submission-url-list",children:o.map(a=>{var m;const u=i.get(a),d=r.get(a),p=!u&&d,v=u&&!d,l=u&&d&&u.is_official!==d.is_official;return e.jsx("div",{className:I("submission-url-row",p&&"added",v&&"removed",l&&"changed"),children:e.jsxs("div",{className:"submission-url-content",children:[e.jsx("a",{href:D(a)??void 0,target:"_blank",rel:"noopener noreferrer",className:I("submission-url-link",v&&"removed"),children:a}),p&&e.jsx("span",{className:"submission-pill status approved",children:"Added"}),v&&e.jsx("span",{className:"submission-pill status rejected",children:"Removed"}),l&&e.jsxs("span",{className:"submission-pill changed",children:["Official: ",String(u.is_official)," ","->"," ",String(d.is_official)]}),((m=d??u)==null?void 0:m.is_official)&&e.jsx("span",{className:"submission-pill",children:"Official"})]})},a)})})}function os({currentPayload:s,proposedPayload:t}){const n=w.useMemo(()=>(s==null?void 0:s.evaluations)??[],[s]),i=t.operations,r=w.useMemo(()=>{const l=new Set;return n.forEach(m=>{m.task_id&&l.add(Number(m.task_id))}),i.forEach(m=>{const c=m.data;c!=null&&c.task_id&&l.add(Number(c.task_id))}),Array.from(l).filter(m=>Number.isFinite(m))},[n,i]),o=w.useMemo(()=>{const l=new Set;return n.forEach(m=>{m.dataset_id&&l.add(Number(m.dataset_id))}),i.forEach(m=>{const c=m.data;c!=null&&c.dataset_id&&l.add(Number(c.dataset_id))}),Array.from(l).filter(m=>Number.isFinite(m))},[n,i]),a=ie({queries:r.map(l=>({queryKey:["task",String(l)],queryFn:()=>U.getTask(String(l)),staleTime:5*60*1e3}))}),u=ie({queries:o.map(l=>({queryKey:["dataset",String(l)],queryFn:()=>U.getDataset(String(l)),staleTime:5*60*1e3}))}),d=w.useMemo(()=>{const l=new Map;return a.forEach(m=>{const c=m.data;if(!c)return;const f=Number(c.id);Number.isFinite(f)&&l.set(f,c.name)}),l},[a]),p=w.useMemo(()=>{const l=new Map;return u.forEach(m=>{const c=m.data;if(!c)return;const f=Number(c.id);Number.isFinite(f)&&l.set(f,c.name)}),l},[u]),v=new Map(n.filter(l=>l.id!=null).map(l=>[Number(l.id),l]));return i.length===0?e.jsx(y,{children:"No evaluation operations in this payload."}):e.jsx("div",{className:"submission-eval-list",children:i.map((l,m)=>{const c=l.evaluation_id?v.get(l.evaluation_id):void 0,x=(l.op==="update"?{...c,...l.data}:l.data??c)??{};return e.jsxs("div",{className:"submission-eval-op",children:[e.jsxs("div",{className:"submission-eval-op-header",children:[e.jsx("span",{className:I("submission-pill status",l.op==="create"&&"approved",l.op==="update"&&"changed",l.op==="delete"&&"rejected"),children:l.op??"unknown"}),l.evaluation_id&&e.jsxs("span",{className:"submission-meta",children:["Evaluation #",l.evaluation_id]})]}),l.op&&["create","update","delete"].includes(l.op)?e.jsx(ls,{evaluation:x,taskNames:d,datasetNames:p}):e.jsx(me,{title:"Unsupported operation",value:l})]},`${l.op}-${l.evaluation_id??m}`)})})}function ls({evaluation:s,taskNames:t,datasetNames:n}){const i=s.task_id?Number(s.task_id):void 0,r=s.dataset_id?Number(s.dataset_id):void 0,o=s.metrics??{};return e.jsxs("div",{className:"submission-eval-fields",children:[e.jsx(F,{label:"Task",value:i?t.get(i)??`#${i}`:null}),e.jsx(F,{label:"Dataset",value:r?n.get(r)??`#${r}`:null}),e.jsx(F,{label:"Model",value:s.model_name||null}),e.jsx(F,{label:"Harness",value:s.harness||null}),e.jsx(F,{label:"Best rank",value:s.best_rank??null}),e.jsx(F,{label:"Parameters",value:s.num_parameters??null}),e.jsx(F,{label:"HF model URL",value:s.hf_model_url||null}),e.jsx(F,{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(([a,u])=>e.jsxs("span",{className:"submission-metric-pill",children:[a,": ",String(u)]},a))}):e.jsx(y,{children:"No metrics"})]})]})}function F({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 cs({currentPayload:s,proposedPayload:t}){const n=s==null?void 0:s.source_url,i=t.source_url;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(j,{title:"Current source URL",children:typeof n=="string"&&n?e.jsx("a",{className:"submission-url-link",href:D(n)??void 0,target:"_blank",rel:"noopener noreferrer",children:n}):e.jsx(y,{children:"No current URL"})}),e.jsx(j,{title:"Proposed source URL",children:typeof i=="string"&&i?e.jsx("a",{className:"submission-url-link",href:D(i)??void 0,target:"_blank",rel:"noopener noreferrer",children:i}):e.jsx(y,{children:"No proposed URL"})})]})}function Ne({url:s,empty:t}){return s?e.jsx("a",{className:"submission-url-link",href:D(s)??void 0,target:"_blank",rel:"noopener noreferrer",children:s}):e.jsx(y,{children:t})}function ds({proposedPayload:s}){var a;const{name:t,hf_slug:n,website_url:i,image:r}=s,o=r!=null&&r.url?Ce(r.url):(a=r==null?void 0:r.data_url)!=null&&a.startsWith("data:image/")?r.data_url:void 0;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(j,{title:"Suggested organization name",children:e.jsx("span",{className:"submission-diff-pill added",children:t})}),e.jsx(j,{title:"Hugging Face organization",children:e.jsx(Ne,{url:n?`https://huggingface.co/${n}`:void 0,empty:"No Hugging Face organization provided"})}),e.jsx(j,{title:"Website",children:e.jsx(Ne,{url:i,empty:"No website provided"})}),e.jsx(j,{title:"Logo",children:o?e.jsx("img",{src:o,alt:(r==null?void 0:r.file_name)??"Suggested logo",className:"max-h-32 max-w-full rounded-md border border-border object-contain"}):e.jsx(y,{children:"No logo provided"})})]})}function us({proposedPayload:s}){const{title:t,source_url:n,abstract:i="",date_published:r,authors:o}=s;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(j,{title:"Title",children:t?e.jsx("span",{className:"submission-field-value",children:t}):e.jsx(y,{children:"No title provided"})}),e.jsx(j,{title:"Publication date",children:r||e.jsx(y,{children:"No publication date provided"})}),e.jsx(j,{title:"Authors",children:o.length>0?o.map((a,u)=>e.jsx("span",{className:"submission-diff-pill added",children:a},`${a}-${u}`)):e.jsx(y,{children:"No authors provided"})}),e.jsx(j,{title:"Source URL",children:n?e.jsx("a",{className:"submission-url-link",href:D(n)??void 0,target:"_blank",rel:"noopener noreferrer",children:n}):e.jsx(y,{children:"No source URL provided"})}),e.jsx(j,{title:"Abstract",children:i?e.jsx("span",{className:"submission-field-value",children:i}):e.jsx(y,{children:"No abstract provided"})})]})}function K({kind:s,proposedPayload:t}){const n=typeof t.benchmark=="string"?t.benchmark:typeof t.name=="string"?t.name:"",i=typeof t.description=="string"?t.description:"",r=typeof t.year=="number"?t.year:null,o=typeof t.start_date=="string"?t.start_date:"",a=typeof t.end_date=="string"?t.end_date:"",u=typeof t.venue=="string"?t.venue:"",d=typeof t.url=="string"?t.url:"",p=t.image??{},v=typeof p.data_url=="string"&&p.data_url.startsWith("data:image/")?p.data_url:"",l=typeof p.url=="string"?Ce(p.url)??"":v,m=typeof p.file_name=="string"?p.file_name:"Suggested image",c=typeof t.image_credit=="string"?t.image_credit:"",f=typeof t.source_url=="string"?t.source_url:"";return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(j,{title:`Suggested ${s} name`,children:n?e.jsx("span",{className:"submission-diff-pill added",children:n}):e.jsx(y,{children:"No name provided"})}),e.jsx(j,{title:"Description",children:i?e.jsx("span",{className:"submission-field-value",children:i}):e.jsx(y,{children:"No description provided"})}),(s==="task"||s==="method")&&e.jsxs(e.Fragment,{children:[e.jsx(j,{title:"Image",children:l?e.jsx("img",{src:l,alt:m,className:"max-h-64 max-w-full rounded-md border border-border object-contain"}):e.jsx(y,{children:"No image provided"})}),e.jsx(j,{title:"Image source",children:c||e.jsx(y,{children:"No image source provided"})})]}),s==="task"&&e.jsx(j,{title:"Placement and keywords",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify({parent_id:t.parent_id??null,area_id:t.area_id??null,keywords:t.keywords??null})})}),s==="benchmark"&&e.jsx(j,{title:"Task",children:e.jsx("span",{className:"submission-field-value",children:typeof t.task=="string"?t.task:JSON.stringify(t.task_ids??[])})}),s==="metric"&&e.jsx(j,{title:"Metric and leaderboard definition",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify({direction:t.direction,scale:t.scale,task_id:t.task_id,dataset_id:t.dataset_id})})}),s==="method"&&e.jsx(j,{title:"Source",children:f?f.startsWith("http://")||f.startsWith("https://")?e.jsx("a",{className:"submission-url-link",href:D(f)??void 0,target:"_blank",rel:"noopener noreferrer",children:f}):e.jsx("span",{className:"submission-field-value",children:f}):e.jsx(y,{children:"No source provided"})}),s==="conference"&&e.jsxs(e.Fragment,{children:[e.jsx(j,{title:"Edition and dates",children:r?`${r}${o?` · ${o}${a?` – ${a}`:""}`:""}`:e.jsx(y,{children:"No edition provided"})}),e.jsx(j,{title:"Venue",children:u||e.jsx(y,{children:"No venue provided"})}),e.jsx(j,{title:"URL",children:d?e.jsx("a",{className:"submission-url-link",href:D(d)??void 0,target:"_blank",rel:"noopener noreferrer",children:d}):e.jsx(y,{children:"No URL provided"})})]})]})}function j({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 y({children:s}){return e.jsx("span",{className:"submission-muted",children:s})}function ps({currentPayload:s,proposedPayload:t}){const n=s,i=[{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:i.map(({key:r,label:o})=>{const a=(n==null?void 0:n[r])??[],u=t[r];return e.jsxs("div",{className:"submission-hf-artifacts-section",children:[e.jsx("div",{className:"submission-diff-label",children:o}),e.jsx(te,{label:o.toLowerCase(),currentItems:a.map(d=>({url:d,is_official:!1})),proposedItems:u.map(d=>({url:d,is_official:!1}))})]},r)})})}function hs(s){throw new Error(`Unhandled pending edit: ${JSON.stringify(s)}`)}function ms({edit:s}){var n,i,r,o,a,u;let t;switch(s.edit_type){case"tasks":t=e.jsx(fe,{currentItems:((n=s.current_payload)==null?void 0:n.tasks)??[],proposedIds:s.proposed_payload.task_ids,queryPrefix:"task",fetchEntity:U.getTask.bind(U)});break;case"methods":t=e.jsx(fe,{currentItems:((i=s.current_payload)==null?void 0:i.methods)??[],proposedIds:s.proposed_payload.method_ids,queryPrefix:"method",fetchEntity:U.getMethod.bind(U)});break;case"organizations":t=e.jsx(as,{currentItems:((r=s.current_payload)==null?void 0:r.organizations)??[],proposedIds:s.proposed_payload.organization_ids});break;case"repositories":t=e.jsx(te,{label:"repositories",currentItems:((o=s.current_payload)==null?void 0:o.repositories)??[],proposedItems:s.proposed_payload.repositories});break;case"project_pages":t=e.jsx(te,{label:"project pages",currentItems:((a=s.current_payload)==null?void 0:a.project_pages)??[],proposedItems:s.proposed_payload.project_pages});break;case"evaluations":t=e.jsx(os,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload});break;case"source_url":t=e.jsx(cs,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload});break;case"hf_artifacts":t=e.jsx(ps,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload});break;case"x_threads":t=e.jsx(te,{label:"X threads",currentItems:(((u=s.current_payload)==null?void 0:u.x_threads)??[]).map(({url:d})=>({url:d,is_official:!1})),proposedItems:s.proposed_payload.x_threads.map(d=>({url:d,is_official:!1}))});break;case"new_task":t=e.jsx(K,{kind:"task",proposedPayload:s.proposed_payload});break;case"new_method":t=e.jsx(K,{kind:"method",proposedPayload:s.proposed_payload});break;case"new_benchmark":t=e.jsx(K,{kind:"benchmark",proposedPayload:s.proposed_payload});break;case"new_metric":t=e.jsx(K,{kind:"metric",proposedPayload:s.proposed_payload});break;case"new_conference":t=e.jsx(K,{kind:"conference",proposedPayload:s.proposed_payload});break;case"new_organization":t=e.jsx(ds,{proposedPayload:s.proposed_payload});break;case"new_external_paper":t=e.jsx(us,{proposedPayload:s.proposed_payload});break;default:hs(s)}return e.jsxs("div",{className:"submission-diff-body",children:[t,e.jsx(rs,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload})]})}const ke=25,fs=["pending","approved","rejected","all"],gs=["all","tasks","methods","evaluations","repositories","project_pages","source_url","x_threads","hf_artifacts","organizations","new_task","new_method","new_benchmark","new_metric","new_conference","new_organization","new_external_paper"],oe=["pending","approved","rejected"],bs=new Set(["new_task","new_method","new_benchmark","new_metric","new_conference"]);function xs(s){return s.slice(0,2).toUpperCase()}function J(s){return s.replace(/_/g," ")}function js(s){return s==="new_external_paper"?"external paper":J(s)}const vs={new_task:{title:"New task",subtitle:"Task suggestion"},new_method:{title:"New method",subtitle:"Method suggestion"},new_benchmark:{title:"New benchmark",subtitle:"Benchmark suggestion"},new_metric:{title:"New metric",subtitle:"Metric suggestion"},new_conference:{title:"New conference",subtitle:"Conference suggestion"},new_organization:{title:"New organization",subtitle:"Organization suggestion"},new_external_paper:{title:"External paper",subtitle:"External paper submission"}};function we(s){if(!s)return"unknown time";const t=new Date(s);if(Number.isNaN(t.getTime()))return s;const n=Date.now()-t.getTime(),i=Math.floor(n/6e4),r=Math.floor(n/36e5),o=Math.floor(n/864e5);return i<1?"just now":i<60?`${i}m ago`:r<24?`${r}h ago`:o<14?`${o}d ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function _s(s){return s==="approved"?"approved":s==="rejected"?"rejected":"pending"}function ys(s,t){return(s==null?void 0:s.arxiv_id)||(s==null?void 0:s.id)||String(t)}function Ns(s){return[...s].sort((t,n)=>new Date(n.created_at).getTime()-new Date(t.created_at).getTime())}async function ks(s,t,n,i){const r=await Promise.all(s.map(p=>W.list({status:p,edit_type:t==="all"?void 0:t,reviewed_by_kind:n?"auto":void 0,limit:ke,offset:i[p]??0}))),o=Ns(r.flatMap(p=>p.results)).slice(0,ke),a={};s.forEach((p,v)=>{const l=o.filter(m=>r[v].results.includes(m)).length;a[p]=(i[p]??0)+l});const u=r.reduce((p,v)=>p+v.count,0),d=s.reduce((p,v)=>p+(a[v]??0),0);return{count:u,results:o,nextOffsets:o.length>0&&d{n.invalidateQueries({queryKey:["pendingPaperEdits"]}),n.invalidateQueries({queryKey:["pendingPaperEdit",g.id]}),g.paper_id!=null&&g.edit_type!=="evaluations"&&je(n,[String(g.paper_id),t==null?void 0:t.arxiv_id])},[t==null?void 0:t.arxiv_id,n]),f=se({mutationFn:()=>W.approve(s.id),onSuccess:g=>{var ee;c(g),g.edit_type==="evaluations"&&g.paper_id!=null?Le(n,ze(String(g.paper_id),((ee=g.current_payload)==null?void 0:ee.evaluations)??[],g.proposed_payload.operations.map(L=>L.op==="create"?{kind:"create",data:L.data}:L.op==="update"?{kind:"update",evaluationId:L.evaluation_id,data:L.data}:{kind:"delete",evaluationId:L.evaluation_id}),(t==null?void 0:t.arxiv_id)??void 0)):g.paper_id!=null&&!a&&ae(n),i({title:"Submission approved",description:a?`Marked ${J(s.edit_type)} suggestion as approved. No catalog changes were applied.`:`Applied ${J(s.edit_type)} changes for ${p}.`})},onError:g=>{i({title:"Could not approve submission",description:z(g,"Approval failed. Please try again."),variant:"destructive"})}}),x=se({mutationFn:()=>W.reject(s.id),onSuccess:g=>{c(g),i({title:"Submission rejected",description:`Rejected ${J(s.edit_type)} changes for ${p}.`})},onError:g=>{i({title:"Could not reject submission",description:z(g,"Rejection failed. Please try again."),variant:"destructive"})}}),_=se({mutationFn:()=>U.rollbackEvent(s.catalog_event_id),onSuccess:()=>{n.invalidateQueries({queryKey:["pendingPaperEdits"]}),s.paper_id!=null&&(je(n,[String(s.paper_id),t==null?void 0:t.arxiv_id]),ae(n)),i({title:"Edit reverted",description:`Restored ${p} to its previous state.`})},onError:g=>{i({title:"Could not revert edit",description:z(g,"The paper changed after this edit, or it was already reverted."),variant:"destructive"})}}),S=se({mutationFn:g=>W.revertAutoApproved(s.hf_subject,{suspend:g}),onSuccess:g=>{n.invalidateQueries({queryKey:["pendingPaperEdits"]}),ae(n),i({title:`Reverted ${g.reverted} edits by @${s.hf_username}`,description:g.skipped.length?`${g.skipped.length} were skipped because the paper changed since.`:void 0})},onError:g=>{i({title:"Could not revert edits",description:z(g,"Bulk revert failed. Please try again."),variant:"destructive"})}}),Q=g=>{const ee=`Revert every edit @${s.hf_username} had auto-applied in the last 7 days${g?" and suspend the account":""}?`;window.confirm(ee)&&S.mutate(g)},h=s.reviewed_by_kind==="auto",T=h&&!!s.catalog_event_id,M=f.isPending,$=x.isPending,ge=M||$,ne=_.isPending||S.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:[d?e.jsx("a",{href:`/paper/${encodeURIComponent(d)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-title",children:p}):e.jsx("div",{className:"submission-title",children:p}),e.jsxs("div",{className:"submission-meta",children:[e.jsxs("span",{children:["#",s.id]}),e.jsx("span",{children:o?u.subtitle:`Paper #${s.paper_id}`}),e.jsx("span",{children:we(s.created_at)})]})]}),e.jsxs("div",{className:"submission-badges",children:[e.jsx("span",{className:"submission-pill",children:J(s.edit_type)}),h&&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:I("submission-pill status",_s(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($e,{className:"h-6 w-6",children:[e.jsx(qe,{src:v,alt:s.hf_username}),e.jsx(De,{className:"text-[10px]",children:xs(s.hf_username)})]}),e.jsxs("span",{children:["@",s.hf_username]})]})]}),e.jsx("div",{className:"submission-diff",children:e.jsx(ms,{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:l?e.jsx(e.Fragment,{children:e.jsxs("div",{className:"submission-action-buttons",children:[e.jsxs("button",{type:"button",onClick:()=>x.mutate(),disabled:ge,className:"submission-action-btn reject",children:[$?e.jsx(G,{className:"spin",size:14}):e.jsx(es,{size:14}),"Reject"]}),e.jsxs("button",{type:"button",onClick:()=>f.mutate(),disabled:ge,className:"submission-action-btn approve",children:[M?e.jsx(G,{className:"spin",size:14}):e.jsx(ss,{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?` ${we(s.reviewed_at)}`:""]}),s.admin_note&&e.jsxs("span",{children:["Admin note: ",e.jsx("strong",{children:s.admin_note})]}),m&&e.jsxs("span",{children:["Submitter-visible reason: ",e.jsx("strong",{children:s.user_review_reason})]}),T&&e.jsxs("div",{className:"submission-action-buttons",children:[e.jsxs("button",{type:"button",onClick:()=>_.mutate(),disabled:ne,className:"submission-action-btn reject",children:[_.isPending?e.jsx(G,{className:"spin",size:14}):e.jsx(ns,{size:14}),"Revert this edit"]}),s.hf_subject&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:()=>Q(!1),disabled:ne,className:"submission-action-btn reject",children:["Revert all by @",s.hf_username]}),e.jsx("button",{type:"button",onClick:()=>Q(!0),disabled:ne,className:"submission-action-btn reject",children:"Revert all and suspend"})]})]}),s.applied_payload&&e.jsxs("details",{children:[e.jsx("summary",{children:a?"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 Ds(){var S,Q;const{toast:s}=Oe(),[t,n]=w.useState("pending"),[i,r]=w.useState("all"),[o,a]=w.useState(!1),u=Te({queryKey:["pendingPaperEdits","counts",i,o],queryFn:async()=>{const h=i==="all"?void 0:i,T=await Promise.all(oe.map(M=>W.list({status:M,edit_type:h,reviewed_by_kind:o?"auto":void 0,limit:1,offset:0})));return Object.fromEntries(T.map((M,$)=>[oe[$],M.count]))},staleTime:30*1e3}),d=Xe({queryKey:["pendingPaperEdits",{status:t,editType:i,autoOnly:o}],queryFn:({pageParam:h})=>ks(t==="all"?oe:[t],i,o,h),initialPageParam:{},getNextPageParam:h=>h.nextOffsets??void 0,retry:!1}),p=w.useMemo(()=>{var h;return((h=d.data)==null?void 0:h.pages.flatMap(T=>T.results))??[]},[d.data]),v=w.useMemo(()=>Array.from(new Set(p.map(h=>h.paper_id).filter(h=>h!=null))).sort((h,T)=>h-T),[p]),l=ie({queries:v.map(h=>({queryKey:Be.summary(String(h)),queryFn:()=>Pe.get(String(h),!1),staleTime:5*60*1e3}))}),m=w.useMemo(()=>{const h=new Map;return l.forEach(T=>{const M=T.data;if(!M)return;const $=Number(M.id);Number.isFinite($)&&h.set($,M)}),h},[l]);w.useEffect(()=>{d.error&&s({title:"Could not load submissions",description:z(d.error,"Failed to load pending paper edits."),variant:"destructive"})},[d.error,s]);const c=u.data,f=c?c.pending+c.approved+c.rejected:void 0,x={pending:c==null?void 0:c.pending,approved:c==null?void 0:c.approved,rejected:c==null?void 0:c.rejected,all:f},_=((Q=(S=d.data)==null?void 0:S.pages[0])==null?void 0:Q.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:()=>{u.refetch(),d.refetch()},disabled:d.isFetching||u.isFetching,children:[e.jsx(Ze,{className:I((d.isFetching||u.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:[fs.map(h=>e.jsxs("button",{type:"button",className:I("period-btn",t===h&&"active"),onClick:()=>n(h),children:[h,x[h]!=null&&e.jsx("span",{className:"submission-count",children:x[h]})]},h)),e.jsx("button",{type:"button",className:I("period-btn",o&&"active"),onClick:()=>{a(h=>!h),o||n("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:gs.map(h=>e.jsx("button",{type:"button",className:I("sort-btn",i===h&&"active"),onClick:()=>r(h),children:js(h)},h))})]})]}),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:d.isFetching?"refreshing":`${_} submissions`})})})}),d.isLoading?e.jsxs("div",{className:"submission-loading",children:[e.jsx(G,{className:"spin",size:18}),e.jsx("span",{children:"Loading submissions..."})]}):d.isError?e.jsxs("div",{className:"submission-empty submission-empty-warn",role:"alert",children:[e.jsx(ye,{size:28}),e.jsx("h2",{children:"Could not display submissions."}),e.jsx("p",{children:z(d.error,"The submissions response was invalid.")})]}):p.length===0?e.jsxs("div",{className:"submission-empty",children:[e.jsx(ye,{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:p.map(h=>e.jsx(ws,{submission:h,paper:h.paper_id==null?void 0:m.get(h.paper_id)},h.id))}),p.length>0&&e.jsxs("div",{className:"submission-pagination",children:[e.jsxs("p",{children:["Showing ",p.length," of ",_," submissions"]}),d.hasNextPage&&e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>d.fetchNextPage(),disabled:d.isFetching,children:[d.isFetchingNextPage&&e.jsx(G,{className:"spin",size:14}),"Load more"]})]})]})]})}export{Ds as default}; diff --git a/assets/SubmissionsDashboard-DZ_zzNWm.js b/assets/SubmissionsDashboard-DZ_zzNWm.js deleted file mode 100644 index 47fc99a232113cf347067e183d66154191280915..0000000000000000000000000000000000000000 --- a/assets/SubmissionsDashboard-DZ_zzNWm.js +++ /dev/null @@ -1,11 +0,0 @@ -var xe=s=>{throw TypeError(s)};var oe=(s,t,i)=>t.has(s)||xe("Cannot "+i);var x=(s,t,i)=>(oe(s,t,"read from private field"),i?i.call(s):t.get(s)),C=(s,t,i)=>t.has(s)?xe("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,i),k=(s,t,i,n)=>(oe(s,t,"write to private field"),n?n.call(s,i):t.set(s,i),i),O=(s,t,i)=>(oe(s,t,"access private method"),i);import{aw as Fe,aJ as de,az as Ie,aP as Ue,f as Ee,r as W,aB as Qe,n as Re,j as e,W as Ce,B as T,K as w,a as $e,p as Oe,aQ as Le,aR as qe,aS as ze}from"./index-CqKcHUvZ.js";import{r as De,e as Pe}from"./evaluationQueryInvalidation-B16EDNu-.js";import{a as Be,p as He}from"./papers-bE3C_Qzl.js";import{i as je,a as le}from"./queryInvalidation-fI4V8eHx.js";import{Q as Me,b as Je,c as Ke,e as We,d as Ge,f as Ye,s as ve,g as Ve,h as Xe,u as Ae}from"./useQuery-Cngk7eL9.js";import{u as ne}from"./useMutation-BItMAQ7s.js";import{u as Ze}from"./useInfiniteQuery-lxaMAHEu.js";import{c as U}from"./catalog-D26nGNnK.js";import{s as q}from"./safeExternalHref-CkBrsh84.js";import{s as V}from"./submissions-1aHdBaSr.js";import{R as es,C as ss}from"./refresh-cw-gVdSyglp.js";import{L as P}from"./loader-circle-CZgakNH7.js";import{S as ts}from"./shield-alert-B0VZio-w.js";import{C as is}from"./circle-check-BYRHMG9x.js";function _e(s,t){const i=new Set(t);return s.filter(n=>!i.has(n))}function ns(s,t,i){const n=s.slice(0);return n[t]=i,n}var B,E,H,L,R,I,X,Z,ee,se,N,ue,pe,Te,he,me,fe,Se,rs=(Se=class extends Fe{constructor(t,i,n){super();C(this,N);C(this,B);C(this,E);C(this,H);C(this,L);C(this,R);C(this,I);C(this,X);C(this,Z);C(this,ee);C(this,se,[]);k(this,B,t),k(this,L,n),k(this,H,[]),k(this,R,[]),k(this,E,[]),this.setQueries(i)}onSubscribe(){this.listeners.size===1&&x(this,R).forEach(t=>{t.subscribe(i=>{O(this,N,me).call(this,t,i)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,x(this,R).forEach(t=>{t.destroy()})}setQueries(t,i){k(this,H,t),k(this,L,i),de.batch(()=>{const n=x(this,R),r=O(this,N,he).call(this,x(this,H));r.forEach(a=>a.observer.setOptions(a.defaultedQueryOptions));const l=r.map(a=>a.observer),o=l.map(a=>a.getCurrentResult()),d=n.length!==l.length,m=l.some((a,p)=>a!==n[p]),u=d||m,v=u?!0:o.some((a,p)=>{const c=x(this,E)[p];return!c||!Ie(a,c)});!u&&!v||(u&&(k(this,se,r),k(this,R,l)),k(this,E,o),this.hasListeners()&&(u&&(_e(n,l).forEach(a=>{a.destroy()}),_e(l,n).forEach(a=>{a.subscribe(p=>{O(this,N,me).call(this,a,p)})})),O(this,N,fe).call(this)))})}getCurrentResult(){return x(this,E)}getQueries(){return x(this,R).map(t=>t.getCurrentQuery())}getObservers(){return x(this,R)}getOptimisticResult(t,i){const n=O(this,N,he).call(this,t),r=n.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),l=n.map(o=>o.defaultedQueryOptions.queryHash);return[r,o=>O(this,N,pe).call(this,o??r,i,l),()=>O(this,N,ue).call(this,r,n)]}},B=new WeakMap,E=new WeakMap,H=new WeakMap,L=new WeakMap,R=new WeakMap,I=new WeakMap,X=new WeakMap,Z=new WeakMap,ee=new WeakMap,se=new WeakMap,N=new WeakSet,ue=function(t,i){return i.map((n,r)=>{const l=t[r];return n.defaultedQueryOptions.notifyOnChangeProps?l:n.observer.trackResult(l,o=>{i.forEach(d=>{d.observer.trackProp(o)})})})},pe=function(t,i,n){if(i){const r=x(this,ee),l=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((o,d)=>o!==r[d]));return(!x(this,I)||x(this,E)!==x(this,Z)||l||i!==x(this,X))&&(k(this,X,i),k(this,Z,x(this,E)),n!==void 0&&k(this,ee,n),k(this,I,Ue(x(this,I),i(t)))),x(this,I)}return t},Te=function(){var t;return((t=x(this,L))==null?void 0:t.combine)!==void 0&&x(this,R).some((i,n)=>{var r;return i.options.suspense&&((r=x(this,E)[n])==null?void 0:r.data)===void 0})},he=function(t){const i=new Map;x(this,R).forEach(r=>{const l=r.options.queryHash;if(!l)return;const o=i.get(l);o?o.push(r):i.set(l,[r])});const n=[];return t.forEach(r=>{var m;const l=x(this,B).defaultQueryOptions(r),d=((m=i.get(l.queryHash))==null?void 0:m.shift())??new Me(x(this,B),l);n.push({defaultedQueryOptions:l,observer:d})}),n},me=function(t,i){const n=x(this,R).indexOf(t);n!==-1&&(k(this,E,ns(x(this,E),n,i)),O(this,N,fe).call(this))},fe=function(){var t;if(this.hasListeners()){const i=O(this,N,ue).call(this,x(this,E),x(this,se)),n=O(this,N,Te).call(this),r=x(this,I),l=n?r:O(this,N,pe).call(this,i,(t=x(this,L))==null?void 0:t.combine);(n||r!==l)&&de.batch(()=>{this.listeners.forEach(o=>{o(x(this,E))})})}},Se);function ae({queries:s,...t},i){const n=Ee(),r=Je(),l=Ke(),o=W.useMemo(()=>s.map(j=>{const g=n.defaultQueryOptions(j);return g._optimisticResults=r?"isRestoring":"optimistic",g}),[s,n,r]);o.forEach(j=>{We(j);const g=n.getQueryCache().get(j.queryHash);Ge(j,l,g)}),Ye(l);const[d]=W.useState(()=>new rs(n,o,t)),[m,u,v]=d.getOptimisticResult(o,t.combine),a=!r&&t.subscribed!==!1;W.useSyncExternalStore(W.useCallback(j=>a?d.subscribe(de.batchCalls(j)):Qe,[d,a]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),W.useEffect(()=>{d.setQueries(o,t)},[o,t,d]);const c=m.some((j,g)=>ve(o[g],j))?m.flatMap((j,g)=>{const S=o[g];if(S&&ve(S,j)){const Q=new Me(n,S);return Ve(S,Q,l)}return[]}):[];if(c.length>0)throw Promise.all(c);const f=m.find((j,g)=>{const S=o[g];return S&&Xe({result:j,errorResetBoundary:l,throwOnError:S.throwOnError,query:n.getQueryCache().get(S.queryHash),suspense:S.suspense})});if(f!=null&&f.error)throw f.error;return u(v())}/** - * @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 ye=Re("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/** - * @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 as=Re("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 os({currentPayload:s,proposedPayload:t}){const[i,n]=w.useState(!1);return e.jsxs("div",{className:"submission-raw-toggle",children:[e.jsx("button",{type:"button",className:"raw-json-btn",onClick:()=>n(r=>!r),children:i?"Hide raw JSON":"Show raw JSON"}),i&&e.jsxs("div",{className:"submission-json-grid",children:[e.jsx(ge,{title:"Current payload",value:s??{}}),e.jsx(ge,{title:"Proposed payload",value:t})]})]})}function ge({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 be({currentItems:s,proposedIds:t,queryPrefix:i,fetchEntity:n,knownNames:r}){const l=w.useMemo(()=>Array.from(new Set([...s.map(c=>c.id),...t])).sort((c,f)=>c-f),[s,t]),o=ae({queries:n?l.map(c=>({queryKey:[i,String(c)],queryFn:()=>n(String(c)),staleTime:5*60*1e3})):[]}),d=w.useMemo(()=>{const c=new Map;return s.forEach(f=>c.set(f.id,f.name)),r==null||r.forEach((f,j)=>c.set(j,f)),o.forEach(f=>{const j=f.data;if(!j)return;const g=Number(j.id);Number.isFinite(g)&&c.set(g,j.name)}),c},[s,o,r]),m=new Set(s.map(c=>c.id)),u=new Set(t),v=l.filter(c=>m.has(c)&&!u.has(c)),a=l.filter(c=>!m.has(c)&&u.has(c)),p=(c,f)=>{const j=f==="current"&&v.includes(c),g=f==="proposed"&&a.includes(c);return e.jsx("span",{className:T("submission-diff-pill",j&&"removed",g&&"added"),children:d.get(c)??`#${c}`},c)};return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(_,{title:"Currently tagged",children:s.length>0?s.map(c=>p(c.id,"current")):e.jsx(y,{children:"No current tags"})}),e.jsx(_,{title:"Will be tagged",children:t.length>0?t.map(c=>p(c,"proposed")):e.jsx(y,{children:"No proposed tags"})})]})}function ls({currentItems:s,proposedIds:t}){var l;const i=Ae({queryKey:["organizations","submission-diff"],queryFn:()=>U.organizations(),staleTime:3e5}),n=new Map(s.map(o=>[o.id,o.name]));(l=i.data)==null||l.results.forEach(o=>{const d=Number(o.id);Number.isFinite(d)&&n.set(d,o.name)});const r=s.map(o=>({...o,name:n.get(o.id)??o.name}));return e.jsx(be,{currentItems:r,proposedIds:t,queryPrefix:"organization",knownNames:n})}function re({label:s,currentItems:t,proposedItems:i}){const n=new Map(t.map(o=>[o.url,o])),r=new Map(i.map(o=>[o.url,o])),l=Array.from(new Set([...n.keys(),...r.keys()])).sort();return l.length===0?e.jsxs(y,{children:["No ",s," in this submission."]}):e.jsx("div",{className:"submission-url-list",children:l.map(o=>{var p;const d=n.get(o),m=r.get(o),u=!d&&m,v=d&&!m,a=d&&m&&d.is_official!==m.is_official;return e.jsx("div",{className:T("submission-url-row",u&&"added",v&&"removed",a&&"changed"),children:e.jsxs("div",{className:"submission-url-content",children:[e.jsx("a",{href:q(o)??void 0,target:"_blank",rel:"noopener noreferrer",className:T("submission-url-link",v&&"removed"),children:o}),u&&e.jsx("span",{className:"submission-pill status approved",children:"Added"}),v&&e.jsx("span",{className:"submission-pill status rejected",children:"Removed"}),a&&e.jsxs("span",{className:"submission-pill changed",children:["Official: ",String(d.is_official)," ","->"," ",String(m.is_official)]}),((p=m??d)==null?void 0:p.is_official)&&e.jsx("span",{className:"submission-pill",children:"Official"})]})},o)})})}function cs({currentPayload:s,proposedPayload:t}){const i=w.useMemo(()=>(s==null?void 0:s.evaluations)??[],[s]),n=t.operations,r=w.useMemo(()=>{const a=new Set;return i.forEach(p=>{p.task_id&&a.add(Number(p.task_id))}),n.forEach(p=>{const c=p.data;c!=null&&c.task_id&&a.add(Number(c.task_id))}),Array.from(a).filter(p=>Number.isFinite(p))},[i,n]),l=w.useMemo(()=>{const a=new Set;return i.forEach(p=>{p.dataset_id&&a.add(Number(p.dataset_id))}),n.forEach(p=>{const c=p.data;c!=null&&c.dataset_id&&a.add(Number(c.dataset_id))}),Array.from(a).filter(p=>Number.isFinite(p))},[i,n]),o=ae({queries:r.map(a=>({queryKey:["task",String(a)],queryFn:()=>U.getTask(String(a)),staleTime:5*60*1e3}))}),d=ae({queries:l.map(a=>({queryKey:["dataset",String(a)],queryFn:()=>U.getDataset(String(a)),staleTime:5*60*1e3}))}),m=w.useMemo(()=>{const a=new Map;return o.forEach(p=>{const c=p.data;if(!c)return;const f=Number(c.id);Number.isFinite(f)&&a.set(f,c.name)}),a},[o]),u=w.useMemo(()=>{const a=new Map;return d.forEach(p=>{const c=p.data;if(!c)return;const f=Number(c.id);Number.isFinite(f)&&a.set(f,c.name)}),a},[d]),v=new Map(i.filter(a=>a.id!=null).map(a=>[Number(a.id),a]));return n.length===0?e.jsx(y,{children:"No evaluation operations in this payload."}):e.jsx("div",{className:"submission-eval-list",children:n.map((a,p)=>{const c=a.evaluation_id?v.get(a.evaluation_id):void 0,j=(a.op==="update"?{...c,...a.data}:a.data??c)??{};return e.jsxs("div",{className:"submission-eval-op",children:[e.jsxs("div",{className:"submission-eval-op-header",children:[e.jsx("span",{className:T("submission-pill status",a.op==="create"&&"approved",a.op==="update"&&"changed",a.op==="delete"&&"rejected"),children:a.op??"unknown"}),a.evaluation_id&&e.jsxs("span",{className:"submission-meta",children:["Evaluation #",a.evaluation_id]})]}),a.op&&["create","update","delete"].includes(a.op)?e.jsx(ds,{evaluation:j,taskNames:m,datasetNames:u}):e.jsx(ge,{title:"Unsupported operation",value:a})]},`${a.op}-${a.evaluation_id??p}`)})})}function ds({evaluation:s,taskNames:t,datasetNames:i}){const n=s.task_id?Number(s.task_id):void 0,r=s.dataset_id?Number(s.dataset_id):void 0,l=s.metrics??{};return e.jsxs("div",{className:"submission-eval-fields",children:[e.jsx(F,{label:"Task",value:n?t.get(n)??`#${n}`:null}),e.jsx(F,{label:"Dataset",value:r?i.get(r)??`#${r}`:null}),e.jsx(F,{label:"Model",value:s.model_name||null}),e.jsx(F,{label:"Harness",value:s.harness||null}),e.jsx(F,{label:"Best rank",value:s.best_rank??null}),e.jsx(F,{label:"Parameters",value:s.num_parameters??null}),e.jsx(F,{label:"HF model URL",value:s.hf_model_url||null}),e.jsx(F,{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(l).length>0?e.jsx("div",{className:"submission-metric-list",children:Object.entries(l).map(([o,d])=>e.jsxs("span",{className:"submission-metric-pill",children:[o,": ",String(d)]},o))}):e.jsx(y,{children:"No metrics"})]})]})}function F({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 us({currentPayload:s,proposedPayload:t}){const i=s==null?void 0:s.source_url,n=t.source_url;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(_,{title:"Current source URL",children:typeof i=="string"&&i?e.jsx("a",{className:"submission-url-link",href:q(i)??void 0,target:"_blank",rel:"noopener noreferrer",children:i}):e.jsx(y,{children:"No current URL"})}),e.jsx(_,{title:"Proposed source URL",children:typeof n=="string"&&n?e.jsx("a",{className:"submission-url-link",href:q(n)??void 0,target:"_blank",rel:"noopener noreferrer",children:n}):e.jsx(y,{children:"No proposed URL"})})]})}function Ne({url:s,empty:t}){return s?e.jsx("a",{className:"submission-url-link",href:q(s)??void 0,target:"_blank",rel:"noopener noreferrer",children:s}):e.jsx(y,{children:t})}function ps({proposedPayload:s}){var o;const{name:t,hf_slug:i,website_url:n,image:r}=s,l=r!=null&&r.url?Ce(r.url):(o=r==null?void 0:r.data_url)!=null&&o.startsWith("data:image/")?r.data_url:void 0;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(_,{title:"Suggested organization name",children:e.jsx("span",{className:"submission-diff-pill added",children:t})}),e.jsx(_,{title:"Hugging Face organization",children:e.jsx(Ne,{url:i?`https://huggingface.co/${i}`:void 0,empty:"No Hugging Face organization provided"})}),e.jsx(_,{title:"Website",children:e.jsx(Ne,{url:n,empty:"No website provided"})}),e.jsx(_,{title:"Logo",children:l?e.jsx("img",{src:l,alt:(r==null?void 0:r.file_name)??"Suggested logo",className:"max-h-32 max-w-full rounded-md border border-border object-contain"}):e.jsx(y,{children:"No logo provided"})})]})}function hs({proposedPayload:s}){const{title:t,source_url:i,abstract:n="",date_published:r,authors:l}=s;return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(_,{title:"Title",children:t?e.jsx("span",{className:"submission-field-value",children:t}):e.jsx(y,{children:"No title provided"})}),e.jsx(_,{title:"Publication date",children:r||e.jsx(y,{children:"No publication date provided"})}),e.jsx(_,{title:"Authors",children:l.length>0?l.map((o,d)=>e.jsx("span",{className:"submission-diff-pill added",children:o},`${o}-${d}`)):e.jsx(y,{children:"No authors provided"})}),e.jsx(_,{title:"Source URL",children:i?e.jsx("a",{className:"submission-url-link",href:q(i)??void 0,target:"_blank",rel:"noopener noreferrer",children:i}):e.jsx(y,{children:"No source URL provided"})}),e.jsx(_,{title:"Abstract",children:n?e.jsx("span",{className:"submission-field-value",children:n}):e.jsx(y,{children:"No abstract provided"})})]})}function G({kind:s,proposedPayload:t}){const i=typeof t.benchmark=="string"?t.benchmark:typeof t.name=="string"?t.name:"",n=typeof t.description=="string"?t.description:"",r=typeof t.year=="number"?t.year:null,l=typeof t.start_date=="string"?t.start_date:"",o=typeof t.end_date=="string"?t.end_date:"",d=typeof t.venue=="string"?t.venue:"",m=typeof t.url=="string"?t.url:"",u=t.image??{},v=typeof u.data_url=="string"&&u.data_url.startsWith("data:image/")?u.data_url:"",a=typeof u.url=="string"?Ce(u.url)??"":v,p=typeof u.file_name=="string"?u.file_name:"Suggested image",c=typeof t.image_credit=="string"?t.image_credit:"",f=typeof t.source_url=="string"?t.source_url:"";return e.jsxs("div",{className:"submission-diff-columns",children:[e.jsx(_,{title:`Suggested ${s} name`,children:i?e.jsx("span",{className:"submission-diff-pill added",children:i}):e.jsx(y,{children:"No name provided"})}),e.jsx(_,{title:"Description",children:n?e.jsx("span",{className:"submission-field-value",children:n}):e.jsx(y,{children:"No description provided"})}),(s==="task"||s==="method")&&e.jsxs(e.Fragment,{children:[e.jsx(_,{title:"Image",children:a?e.jsx("img",{src:a,alt:p,className:"max-h-64 max-w-full rounded-md border border-border object-contain"}):e.jsx(y,{children:"No image provided"})}),e.jsx(_,{title:"Image source",children:c||e.jsx(y,{children:"No image source provided"})})]}),s==="task"&&e.jsx(_,{title:"Placement and keywords",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify({parent_id:t.parent_id??null,area_id:t.area_id??null,keywords:t.keywords??null})})}),s==="benchmark"&&e.jsx(_,{title:"Task",children:e.jsx("span",{className:"submission-field-value",children:typeof t.task=="string"?t.task:JSON.stringify(t.task_ids??[])})}),s==="metric"&&e.jsx(_,{title:"Metric and leaderboard definition",children:e.jsx("span",{className:"submission-field-value",children:JSON.stringify({direction:t.direction,scale:t.scale,task_id:t.task_id,dataset_id:t.dataset_id})})}),s==="method"&&e.jsx(_,{title:"Source",children:f?f.startsWith("http://")||f.startsWith("https://")?e.jsx("a",{className:"submission-url-link",href:q(f)??void 0,target:"_blank",rel:"noopener noreferrer",children:f}):e.jsx("span",{className:"submission-field-value",children:f}):e.jsx(y,{children:"No source provided"})}),s==="conference"&&e.jsxs(e.Fragment,{children:[e.jsx(_,{title:"Edition and dates",children:r?`${r}${l?` · ${l}${o?` – ${o}`:""}`:""}`:e.jsx(y,{children:"No edition provided"})}),e.jsx(_,{title:"Venue",children:d||e.jsx(y,{children:"No venue provided"})}),e.jsx(_,{title:"URL",children:m?e.jsx("a",{className:"submission-url-link",href:q(m)??void 0,target:"_blank",rel:"noopener noreferrer",children:m}):e.jsx(y,{children:"No URL provided"})})]})]})}function _({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 y({children:s}){return e.jsx("span",{className:"submission-muted",children:s})}function ms({currentPayload:s,proposedPayload:t}){const i=s,n=[{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:n.map(({key:r,label:l})=>{const o=(i==null?void 0:i[r])??[],d=t[r];return e.jsxs("div",{className:"submission-hf-artifacts-section",children:[e.jsx("div",{className:"submission-diff-label",children:l}),e.jsx(re,{label:l.toLowerCase(),currentItems:o.map(m=>({url:m,is_official:!1})),proposedItems:d.map(m=>({url:m,is_official:!1}))})]},r)})})}function fs(s){throw new Error(`Unhandled pending edit: ${JSON.stringify(s)}`)}function gs({edit:s}){var i,n,r,l,o,d;let t;switch(s.edit_type){case"tasks":t=e.jsx(be,{currentItems:((i=s.current_payload)==null?void 0:i.tasks)??[],proposedIds:s.proposed_payload.task_ids,queryPrefix:"task",fetchEntity:U.getTask.bind(U)});break;case"methods":t=e.jsx(be,{currentItems:((n=s.current_payload)==null?void 0:n.methods)??[],proposedIds:s.proposed_payload.method_ids,queryPrefix:"method",fetchEntity:U.getMethod.bind(U)});break;case"organizations":t=e.jsx(ls,{currentItems:((r=s.current_payload)==null?void 0:r.organizations)??[],proposedIds:s.proposed_payload.organization_ids});break;case"repositories":t=e.jsx(re,{label:"repositories",currentItems:((l=s.current_payload)==null?void 0:l.repositories)??[],proposedItems:s.proposed_payload.repositories});break;case"project_pages":t=e.jsx(re,{label:"project pages",currentItems:((o=s.current_payload)==null?void 0:o.project_pages)??[],proposedItems:s.proposed_payload.project_pages});break;case"evaluations":t=e.jsx(cs,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload});break;case"source_url":t=e.jsx(us,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload});break;case"hf_artifacts":t=e.jsx(ms,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload});break;case"x_threads":t=e.jsx(re,{label:"X threads",currentItems:(((d=s.current_payload)==null?void 0:d.x_threads)??[]).map(({url:m})=>({url:m,is_official:!1})),proposedItems:s.proposed_payload.x_threads.map(m=>({url:m,is_official:!1}))});break;case"new_task":t=e.jsx(G,{kind:"task",proposedPayload:s.proposed_payload});break;case"new_method":t=e.jsx(G,{kind:"method",proposedPayload:s.proposed_payload});break;case"new_benchmark":t=e.jsx(G,{kind:"benchmark",proposedPayload:s.proposed_payload});break;case"new_metric":t=e.jsx(G,{kind:"metric",proposedPayload:s.proposed_payload});break;case"new_conference":t=e.jsx(G,{kind:"conference",proposedPayload:s.proposed_payload});break;case"new_organization":t=e.jsx(ps,{proposedPayload:s.proposed_payload});break;case"new_external_paper":t=e.jsx(hs,{proposedPayload:s.proposed_payload});break;default:fs(s)}return e.jsxs("div",{className:"submission-diff-body",children:[t,e.jsx(os,{currentPayload:s.current_payload,proposedPayload:s.proposed_payload})]})}const ke=25,bs=["pending","approved","rejected","all"],xs=["all","tasks","methods","evaluations","repositories","project_pages","source_url","x_threads","hf_artifacts","organizations","new_task","new_method","new_benchmark","new_metric","new_conference","new_organization","new_external_paper"],ce=["pending","approved","rejected"],js=new Set(["new_task","new_method","new_benchmark","new_metric","new_conference"]);function vs(s){return s.slice(0,2).toUpperCase()}function Y(s){return s.replace(/_/g," ")}function _s(s){return s==="new_external_paper"?"external paper":Y(s)}const ys={new_task:{title:"New task",subtitle:"Task suggestion"},new_method:{title:"New method",subtitle:"Method suggestion"},new_benchmark:{title:"New benchmark",subtitle:"Benchmark suggestion"},new_metric:{title:"New metric",subtitle:"Metric suggestion"},new_conference:{title:"New conference",subtitle:"Conference suggestion"},new_organization:{title:"New organization",subtitle:"Organization suggestion"},new_external_paper:{title:"External paper",subtitle:"External paper submission"}};function we(s){if(!s)return"unknown time";const t=new Date(s);if(Number.isNaN(t.getTime()))return s;const i=Date.now()-t.getTime(),n=Math.floor(i/6e4),r=Math.floor(i/36e5),l=Math.floor(i/864e5);return n<1?"just now":n<60?`${n}m ago`:r<24?`${r}h ago`:l<14?`${l}d ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function D(s,t){var n;const i=s;if(i.response)try{const r=JSON.parse(i.response);if(typeof(r==null?void 0:r.detail)=="string")return r.detail;if(Array.isArray(r==null?void 0:r.detail)&&((n=r.detail[0])!=null&&n.msg))return r.detail[0].msg}catch{return i.response}return i.message||t}function Ns(s){return s==="approved"?"approved":s==="rejected"?"rejected":"pending"}function ks(s,t){return(s==null?void 0:s.arxiv_id)||(s==null?void 0:s.id)||String(t)}function ws(s){return[...s].sort((t,i)=>new Date(i.created_at).getTime()-new Date(t.created_at).getTime())}async function Ss(s,t,i,n){const r=await Promise.all(s.map(u=>V.list({status:u,edit_type:t==="all"?void 0:t,reviewed_by_kind:i?"auto":void 0,limit:ke,offset:n[u]??0}))),l=ws(r.flatMap(u=>u.results)).slice(0,ke),o={};s.forEach((u,v)=>{const a=l.filter(p=>r[v].results.includes(p)).length;o[u]=(n[u]??0)+a});const d=r.reduce((u,v)=>u+v.count,0),m=s.reduce((u,v)=>u+(o[v]??0),0);return{count:d,results:l,nextOffsets:l.length>0&&m{i.invalidateQueries({queryKey:["pendingPaperEdits"]}),i.invalidateQueries({queryKey:["pendingPaperEdit",b.id]}),b.paper_id!=null&&b.edit_type!=="evaluations"&&je(i,[String(b.paper_id),t==null?void 0:t.arxiv_id])},[t==null?void 0:t.arxiv_id,i]),f=ne({mutationFn:()=>V.approve(s.id),onSuccess:b=>{var ie;c(b),b.edit_type==="evaluations"&&b.paper_id!=null?De(i,Pe(String(b.paper_id),((ie=b.current_payload)==null?void 0:ie.evaluations)??[],b.proposed_payload.operations.map(z=>z.op==="create"?{kind:"create",data:z.data}:z.op==="update"?{kind:"update",evaluationId:z.evaluation_id,data:z.data}:{kind:"delete",evaluationId:z.evaluation_id}),(t==null?void 0:t.arxiv_id)??void 0)):b.paper_id!=null&&!o&&le(i),n({title:"Submission approved",description:o?`Marked ${Y(s.edit_type)} suggestion as approved. No catalog changes were applied.`:`Applied ${Y(s.edit_type)} changes for ${u}.`})},onError:b=>{n({title:"Could not approve submission",description:D(b,"Approval failed. Please try again."),variant:"destructive"})}}),j=ne({mutationFn:()=>V.reject(s.id),onSuccess:b=>{c(b),n({title:"Submission rejected",description:`Rejected ${Y(s.edit_type)} changes for ${u}.`})},onError:b=>{n({title:"Could not reject submission",description:D(b,"Rejection failed. Please try again."),variant:"destructive"})}}),g=ne({mutationFn:()=>U.rollbackEvent(s.catalog_event_id),onSuccess:()=>{i.invalidateQueries({queryKey:["pendingPaperEdits"]}),s.paper_id!=null&&(je(i,[String(s.paper_id),t==null?void 0:t.arxiv_id]),le(i)),n({title:"Edit reverted",description:`Restored ${u} to its previous state.`})},onError:b=>{n({title:"Could not revert edit",description:D(b,"The paper changed after this edit, or it was already reverted."),variant:"destructive"})}}),S=ne({mutationFn:b=>V.revertAutoApproved(s.hf_subject,{suspend:b}),onSuccess:b=>{i.invalidateQueries({queryKey:["pendingPaperEdits"]}),le(i),n({title:`Reverted ${b.reverted} edits by @${s.hf_username}`,description:b.skipped.length?`${b.skipped.length} were skipped because the paper changed since.`:void 0})},onError:b=>{n({title:"Could not revert edits",description:D(b,"Bulk revert failed. Please try again."),variant:"destructive"})}}),Q=b=>{const ie=`Revert every edit @${s.hf_username} had auto-applied in the last 7 days${b?" and suspend the account":""}?`;window.confirm(ie)&&S.mutate(b)},J=s.reviewed_by_kind==="auto",te=J&&!!s.catalog_event_id,K=f.isPending,h=j.isPending,A=K||h,M=g.isPending||S.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:[m?e.jsx("a",{href:`/paper/${encodeURIComponent(m)}`,target:"_blank",rel:"noopener noreferrer",className:"submission-title",children:u}):e.jsx("div",{className:"submission-title",children:u}),e.jsxs("div",{className:"submission-meta",children:[e.jsxs("span",{children:["#",s.id]}),e.jsx("span",{children:l?d.subtitle:`Paper #${s.paper_id}`}),e.jsx("span",{children:we(s.created_at)})]})]}),e.jsxs("div",{className:"submission-badges",children:[e.jsx("span",{className:"submission-pill",children:Y(s.edit_type)}),J&&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:T("submission-pill status",Ns(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(Le,{className:"h-6 w-6",children:[e.jsx(qe,{src:v,alt:s.hf_username}),e.jsx(ze,{className:"text-[10px]",children:vs(s.hf_username)})]}),e.jsxs("span",{children:["@",s.hf_username]})]})]}),e.jsx("div",{className:"submission-diff",children:e.jsx(gs,{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:a?e.jsx(e.Fragment,{children:e.jsxs("div",{className:"submission-action-buttons",children:[e.jsxs("button",{type:"button",onClick:()=>j.mutate(),disabled:A,className:"submission-action-btn reject",children:[h?e.jsx(P,{className:"spin",size:14}):e.jsx(ss,{size:14}),"Reject"]}),e.jsxs("button",{type:"button",onClick:()=>f.mutate(),disabled:A,className:"submission-action-btn approve",children:[K?e.jsx(P,{className:"spin",size:14}):e.jsx(is,{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?` ${we(s.reviewed_at)}`:""]}),s.admin_note&&e.jsxs("span",{children:["Admin note: ",e.jsx("strong",{children:s.admin_note})]}),p&&e.jsxs("span",{children:["Submitter-visible reason: ",e.jsx("strong",{children:s.user_review_reason})]}),te&&e.jsxs("div",{className:"submission-action-buttons",children:[e.jsxs("button",{type:"button",onClick:()=>g.mutate(),disabled:M,className:"submission-action-btn reject",children:[g.isPending?e.jsx(P,{className:"spin",size:14}):e.jsx(as,{size:14}),"Revert this edit"]}),s.hf_subject&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:()=>Q(!1),disabled:M,className:"submission-action-btn reject",children:["Revert all by @",s.hf_username]}),e.jsx("button",{type:"button",onClick:()=>Q(!0),disabled:M,className:"submission-action-btn reject",children:"Revert all and suspend"})]})]}),s.applied_payload&&e.jsxs("details",{children:[e.jsx("summary",{children:o?"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 Hs(){var te,K;const{user:s,isLoading:t}=$e(),{toast:i}=Oe(),[n,r]=w.useState("pending"),[l,o]=w.useState("all"),[d,m]=w.useState(!1),u=!!(s!=null&&s.is_admin),v=Ae({queryKey:["pendingPaperEdits","counts",l,d],queryFn:async()=>{const h=l==="all"?void 0:l,A=await Promise.all(ce.map(M=>V.list({status:M,edit_type:h,reviewed_by_kind:d?"auto":void 0,limit:1,offset:0})));return Object.fromEntries(A.map((M,$)=>[ce[$],M.count]))},enabled:u,staleTime:30*1e3}),a=Ze({queryKey:["pendingPaperEdits",{status:n,editType:l,autoOnly:d}],queryFn:({pageParam:h})=>Ss(n==="all"?ce:[n],l,d,h),initialPageParam:{},getNextPageParam:h=>h.nextOffsets??void 0,enabled:u,retry:!1}),p=w.useMemo(()=>{var h;return((h=a.data)==null?void 0:h.pages.flatMap(A=>A.results))??[]},[a.data]),c=w.useMemo(()=>Array.from(new Set(p.map(h=>h.paper_id).filter(h=>h!=null))).sort((h,A)=>h-A),[p]),f=ae({queries:c.map(h=>({queryKey:He.summary(String(h)),queryFn:()=>Be.get(String(h),!1),enabled:u,staleTime:5*60*1e3}))}),j=w.useMemo(()=>{const h=new Map;return f.forEach(A=>{const M=A.data;if(!M)return;const $=Number(M.id);Number.isFinite($)&&h.set($,M)}),h},[f]);if(w.useEffect(()=>{a.error&&i({title:"Could not load submissions",description:D(a.error,"Failed to load pending paper edits."),variant:"destructive"})},[a.error,i]),t)return e.jsx(Rs,{});if(!u)return e.jsx(Es,{});const g=v.data,S=g?g.pending+g.approved+g.rejected:void 0,Q={pending:g==null?void 0:g.pending,approved:g==null?void 0:g.approved,rejected:g==null?void 0:g.rejected,all:S},J=((K=(te=a.data)==null?void 0:te.pages[0])==null?void 0:K.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:()=>{v.refetch(),a.refetch()},disabled:a.isFetching||v.isFetching,children:[e.jsx(es,{className:T((a.isFetching||v.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:[bs.map(h=>e.jsxs("button",{type:"button",className:T("period-btn",n===h&&"active"),onClick:()=>r(h),children:[h,Q[h]!=null&&e.jsx("span",{className:"submission-count",children:Q[h]})]},h)),e.jsx("button",{type:"button",className:T("period-btn",d&&"active"),onClick:()=>{m(h=>!h),d||r("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:xs.map(h=>e.jsx("button",{type:"button",className:T("sort-btn",l===h&&"active"),onClick:()=>o(h),children:_s(h)},h))})]})]}),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:a.isFetching?"refreshing":`${J} submissions`})})})}),a.isLoading?e.jsxs("div",{className:"submission-loading",children:[e.jsx(P,{className:"spin",size:18}),e.jsx("span",{children:"Loading submissions..."})]}):a.isError?e.jsxs("div",{className:"submission-empty submission-empty-warn",role:"alert",children:[e.jsx(ye,{size:28}),e.jsx("h2",{children:"Could not display submissions."}),e.jsx("p",{children:D(a.error,"The submissions response was invalid.")})]}):p.length===0?e.jsxs("div",{className:"submission-empty",children:[e.jsx(ye,{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:p.map(h=>e.jsx(Cs,{submission:h,paper:h.paper_id==null?void 0:j.get(h.paper_id)},h.id))}),p.length>0&&e.jsxs("div",{className:"submission-pagination",children:[e.jsxs("p",{children:["Showing ",p.length," of ",J," submissions"]}),a.hasNextPage&&e.jsxs("button",{type:"button",className:"feedback-link",onClick:()=>a.fetchNextPage(),disabled:a.isFetching,children:[a.isFetchingNextPage&&e.jsx(P,{className:"spin",size:14}),"Load more"]})]})]})]})}export{Hs as default}; diff --git a/assets/SubmitView-CQFDy941.js b/assets/SubmitView-CQFDy941.js new file mode 100644 index 0000000000000000000000000000000000000000..e3d86d8ac1b52a5c61202197cff1325a5db9f659 --- /dev/null +++ b/assets/SubmitView-CQFDy941.js @@ -0,0 +1 @@ +import{c as D,f as E,p as C,a as F,e as N,K as o,s as X,j as e,h as z}from"./index-D6jcIRWs.js";import{u as U}from"./useMutation-p6mN4h17.js";import{A as O,a as q}from"./alert-2MbxVzGL.js";import{B as P}from"./button-Bzx0ccHH.js";import{I as h}from"./input-CCN-4hy4.js";import{T as B}from"./textarea-sXKODM3W.js";import{a as H}from"./papers-DIIIPDpj.js";import{a as M}from"./queryInvalidation-BxCpTdQe.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 ae=()=>{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=>H.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(z(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(B,{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(O,{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{ae as default}; diff --git a/assets/SubmitView-CSI8FjeO.js b/assets/SubmitView-CSI8FjeO.js deleted file mode 100644 index 7cdf19f33c58dcab5d6a99781c6080f5959e7a46..0000000000000000000000000000000000000000 --- a/assets/SubmitView-CSI8FjeO.js +++ /dev/null @@ -1 +0,0 @@ -import{c as E,f as L,p as F,a as N,e as X,K as d,j as e,J as z}from"./index-CqKcHUvZ.js";import{u as U}from"./useMutation-BItMAQ7s.js";import{A as O,a as $}from"./alert-Z2yFUcyL.js";import{B as P}from"./button-BYn4yUH_.js";import{I as g}from"./input-sw0Ix0Sa.js";import{T as J}from"./textarea-CQToxq8k.js";import{a as q}from"./papers-bE3C_Qzl.js";import{a as B}from"./queryInvalidation-fI4V8eHx.js";const S="pwc:paper-submit-draft",R={color:"var(--accent-text)",fontWeight:600,textDecoration:"underline",textUnderlineOffset:2},H=/^\d{4}\.\d{4,5}(v\d+)?$/i,V=/^[a-z-]+(\.[A-Z]{2})?\/\d{7}$/,M=/^https?:\/\/(?:www\.)?arxiv\.org\//i;function k(n){const i=n.trim();return i?H.test(i)||V.test(i)||M.test(i)?"arxiv":/^https?:\/\//i.test(i)?"external":"arxiv":"empty"}function W(n,i){const a=n.trim();if(k(a)==="arxiv")return/^https?:\/\//i.test(a)?{source_url:a}:{arxiv_id:a};const o={source_url:a},c=i.title.trim();c&&(o.title=c);const u=i.abstract.trim();u&&(o.abstract=u);const l=i.authors.split(/[,\n]/).map(m=>m.trim()).filter(Boolean);return l.length>0&&(o.authors=l),i.datePublished&&(o.date_published=i.datePublished),o}function K(n){var a;const i=n;if(!i)return"Submission failed";if(i.response)try{const s=JSON.parse(i.response);if(typeof s.detail=="string")return s.detail;if((a=s.detail)!=null&&a.message)return`${s.detail.message} See ${s.detail.help||"/rate-limits"} for help.`}catch{return i.response}return i.message||"Submission failed"}const re=()=>{const n=E(),i=L(),{toast:a}=F(),{user:s,isLoading:o}=N(),[c]=X(),u=c.get("arxiv_id")??"",[l,m]=d.useState(u),[f,j]=d.useState(""),[x,w]=d.useState(""),[b,I]=d.useState(""),[v,_]=d.useState(""),[A,y]=d.useState(null);d.useEffect(()=>{if(u)return;const t=sessionStorage.getItem(S);if(t){sessionStorage.removeItem(S);try{const r=JSON.parse(t);m(r.input??""),j(r.title??""),w(r.abstract??""),I(r.authors??""),_(r.datePublished??"")}catch{}}},[u]);const h=k(l),D=h==="external",p=U({mutationFn:t=>q.submit(t),onSuccess:t=>{if(t.pending_review){a({title:"Submission queued for review",description:"No source page was fetched and no catalog row was changed."}),p.reset();return}B(i);const r=t.refreshed&&t.created&&t.latest_version;a({title:r?`Paper updated to ${t.latest_version}`:t.created?"Paper submitted":"Paper already indexed",description:r?"Opening the updated paper page…":t.created?"Opening the paper page…":"Opening the existing paper page…"}),t.route_identifier&&n(`/paper/${t.route_identifier}`)},onError:t=>{y(K(t))}}),T=t=>{if(t.preventDefault(),y(null),h==="empty"){y("Enter an arXiv ID or a paper URL to submit.");return}if(!s){sessionStorage.setItem(S,JSON.stringify({input:l,title:f,abstract:x,authors:b,datePublished:v}));const C=z("/api/v1/auth/hf/login");window.location.assign(`${C}?return_to=${encodeURIComponent(window.location.href)}`);return}const r=W(l,{title:f,abstract:x,authors:b,datePublished:v});p.mutate(r)};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(g,{id:"submit-input",value:l,onChange:t=>m(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:h==="arxiv"?"Detected: arXiv paper — metadata will be fetched automatically.":h==="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."})]}),D&&e.jsxs("fieldset",{style:{border:"1px solid var(--rule)",borderRadius:8,padding:"16px 20px 20px",display:"grid",gap:16},children:[e.jsx("legend",{style:{padding:"0 8px",fontSize:12,color:"var(--ink-soft)",textTransform:"uppercase",letterSpacing:.5},children:"External paper details (optional)"}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-title",style:{fontSize:13},children:"Title"}),e.jsx(g,{id:"submit-title",value:f,onChange:t=>j(t.target.value),placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-abstract",style:{fontSize:13},children:"Abstract or summary"}),e.jsx(J,{id:"submit-abstract",value:x,onChange:t=>w(t.target.value),rows:4,placeholder:"Leave blank to extract automatically"})]}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("label",{htmlFor:"submit-authors",style:{fontSize:13},children:"Authors (comma-separated)"}),e.jsx(g,{id:"submit-authors",value: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(g,{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(O,{variant:"destructive",children:e.jsx($,{children:A})}),e.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[e.jsx(P,{type:"submit",disabled:p.isPending||o,children:o?"Checking sign-in…":p.isPending?"Submitting…":s?"Submit paper":"Sign in to submit"}),e.jsx(P,{type:"button",variant:"outline",onClick:()=>n(-1),disabled:p.isPending,children:"Cancel"})]})]})]})};export{re as default}; diff --git a/assets/TagBrowseView-Cz-rtfuq.js b/assets/TagBrowseView-bMr8w4y6.js similarity index 91% rename from assets/TagBrowseView-Cz-rtfuq.js rename to assets/TagBrowseView-bMr8w4y6.js index 3e6d93b279cfc8b980fb607d245d5b61a8fc69a7..976f04000998d3175fdc037613125ff782ee7a73 100644 --- a/assets/TagBrowseView-Cz-rtfuq.js +++ b/assets/TagBrowseView-bMr8w4y6.js @@ -1 +1 @@ -import{j as e,L as g,K as ge,u as be,c as xe,e as je,r as k,q as ke,W as _e}from"./index-CqKcHUvZ.js";import{R as fe}from"./ResearchFollowButton-CrCIwiok.js";import{u as K}from"./useQuery-Cngk7eL9.js";import{P as Ne,M as we}from"./components-Dmnn5Z5p.js";import{A as L}from"./arrow-right-DCfHXCdw.js";import{B as ve}from"./BenchmarkTrendSparkline-BrvDBmsS.js";import{P as ye}from"./PaperFeedFilters-SOqb93ez.js";import{a as Se,P as Ce,b as Ee}from"./PaperDateFilter-zHw5tq6B.js";import{M as W}from"./MarkdownText-CJQADo_f.js";import{c as J}from"./catalog-D26nGNnK.js";import{s as Te}from"./slug-BpH-Nkvz.js";import{d as N,t as Be}from"./colors-_scCXfCe.js";import{c as Pe}from"./usePapers-By3yMmMn.js";import{u as $e}from"./useInfiniteScroll-DVF-b-LX.js";import{S as E}from"./skeleton-DleNhBYA.js";import{A as Ae,a as Re}from"./alert-Z2yFUcyL.js";import{T as Fe}from"./trophy-CwHzFBlu.js";import{G as Me}from"./github-sUmGdHig.js";import"./useMutation-BItMAQ7s.js";import"./research-Dt0MUW0x.js";import"./plus-DZF-NxR0.js";import"./papers-bE3C_Qzl.js";import"./AuthorAvatar-CWCqOa0h.js";import"./LatexTitle-BI9yl-Fo.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-BcoS9Jmp.js";/* empty css */import"./PaperPreviewLink-C6khj_iZ.js";import"./index-CqELxJb0.js";import"./index-DBHj7UWg.js";import"./katex-DkKDou_j.js";import"./hover-card-BTsA69o8.js";import"./useInfiniteQuery-lxaMAHEu.js";import"./useIntersectionObserver-CiBk_Oug.js";const Le=()=>e.jsxs(g,{to:"/astra-for-robotics",className:"task-featured-collection","aria-label":"Featured collection: GPT-6 Astra for Robotics",children:[e.jsx("span",{className:"task-featured-collection-eyebrow",children:"Featured collection"}),e.jsx("strong",{children:"GPT-6 Astra for Robotics"}),e.jsx("span",{className:"task-featured-collection-description",children:"Papers and demos that put GPT-6 Astra in control of real and simulated robots, as the policy itself or as an agent orchestrating the stack."}),e.jsxs("span",{className:"task-featured-collection-meta",children:["Explore the collection",e.jsx(L,{size:14,"aria-hidden":"true"})]})]}),X=r=>{const c=r.match(/\(([^()]*)\)\s*$/);return c?c[1].split(",").map(l=>l.trim()).filter(Boolean):[]};function Ie(r,c){const l=X(r);if(c===void 0)return"standard";const i=new Set(X(c).map(o=>o.toLowerCase())),m=l.filter(o=>!i.has(o.toLowerCase()));return m.length?m.join(", "):r}function De(r,c){const l=new Map(r.map(o=>[o.id,o])),i=o=>{const b=new Set([o.id]);let x=o;for(;;){const w=c(x),f=w?l.get(w):void 0;if(!f)return x.id;if(b.has(f.id))return o.id;b.add(f.id),x=f}},m=new Map;return r.forEach(o=>{const b=i(o);m.set(b,[...m.get(b)||[],o])}),[...m].map(([o,b])=>({key:o,members:[l.get(o),...b.filter(x=>x.id!==o)]}))}const He=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],qe=r=>r==="trending"||r==="date_published"||r==="citation_count"?r:"trending",M=3,Oe=[{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"}],Ue=r=>new Intl.NumberFormat("en",{notation:r>=1e3?"compact":"standard",maximumFractionDigits:1}).format(r),ze=({frameworks:r})=>r.length===0?null:e.jsxs("div",{className:"task-framework-links",children:[e.jsx("span",{className:"task-framework-links-label",children:"Recommended frameworks"}),r.map(c=>e.jsxs(g,{to:`/papers?framework=${encodeURIComponent(c.framework_slug)}`,className:"task-framework-link",children:[e.jsx("span",{children:c.framework_name}),e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",Ue(c.num_stars)]})]},c.framework_id))]}),Ve=({task:r,area:c,parents:l})=>e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(g,{to:"/tasks",children:"Tasks"}),c&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(g,{to:`/tasks#area-${Te(c.name)}`,children:c.name})]}),[...l].reverse().map(i=>e.jsxs(ge.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(g,{to:`/tasks/${i.slug||i.id}`,children:N(i.name,i.slug)})]},i.id)),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--accent-text)"},children:N(r.name,r.slug)})]}),Ge=({task:r,relatedTasks:c})=>{const l=new Map([r,...c].map(i=>[i.slug,i]));return e.jsxs("section",{className:"medical-ai-hub","aria-labelledby":"medical-ai-hub-title",children:[e.jsxs("div",{className:"medical-ai-hub-heading",children:[e.jsx("span",{children:"Medical AI directory"}),e.jsx("h2",{id:"medical-ai-hub-title",children:"Explore Healthcare & Medical AI"}),e.jsx("p",{children:"Browse the field by clinical application, language, vision, or multimodal reasoning."})]}),e.jsx("div",{className:"medical-ai-hub-grid",children:Oe.map(i=>{const m=l.get(i.slug),o=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"medical-ai-hub-card-eyebrow",children:i.eyebrow}),e.jsx("strong",{children:i.title}),e.jsx("span",{className:"medical-ai-hub-card-description",children:i.description}),e.jsxs("span",{className:"medical-ai-hub-card-meta",children:[(m==null?void 0:m.paper_count)!=null?`${m.paper_count.toLocaleString()} papers`:"Explore task",e.jsx(L,{size:14,"aria-hidden":"true"})]})]});return i.slug==="healthcare"?e.jsx("a",{href:i.href,className:"medical-ai-hub-card",children:o},i.slug):e.jsx(g,{to:i.href,className:"medical-ai-hub-card",children:o},i.slug)})})]})},Qe=r=>[...r].sort((c,l)=>{const i=c.slug==="classic-language-modeling",m=l.slug==="classic-language-modeling";return i!==m?i?1:-1:0}),Es=()=>{var V,G,Q;const{taskSlug:r}=be(),c=xe(),[l,i]=je(),m=qe(l.get("order_by")),o=l.get("has_code")==="true",b=l.get("has_hf_artifacts")==="true",x=Se(l),w=s=>{const a=new URLSearchParams(l);a.set("order_by",s),i(a)},f=s=>{const a=new URLSearchParams(l);s?a.set("has_code","true"):a.delete("has_code"),i(a)},Y=s=>{const a=new URLSearchParams(l);s?a.set("has_hf_artifacts","true"):a.delete("has_hf_artifacts"),i(a)},[I,Z]=k.useState(!1),[ee,se]=k.useState({}),[ae,re]=k.useState(()=>new Set),{preferences:te}=ke(),T=(s,a)=>{const n=s||"";return a?`/benchmark/${n}?task=${encodeURIComponent(a)}`:`/benchmark/${n}`},v=te.hide_closed_source_evals?!0:void 0,h=K({queryKey:["task-page",r,v],queryFn:()=>J.taskPage(r,{is_open:v}),enabled:!!r,staleTime:10*60*1e3});k.useEffect(()=>{var n;const s=(n=h.data)==null?void 0:n.task.slug;if(!r||!s||s===r)return;const a=l.toString();c(`/tasks/${s}${a?`?${a}`:""}`,{replace:!0})},[c,(V=h.data)==null?void 0:V.task.slug,l,r]);const D=K({queryKey:["task-benchmark-trends",r,v],queryFn:()=>J.trendingBenchmarks(r,{limit:100,min_recent_papers:0,is_open:v}),enabled:!!r,staleTime:10*60*1e3}),y=k.useMemo(()=>{var s;return Qe(((s=h.data)==null?void 0:s.children)||[])},[h.data]),B=k.useMemo(()=>{var a;const s=new Map;return(((a=h.data)==null?void 0:a.subtask_benchmarks)||[]).forEach(n=>{s.set(n.subtask_id,n.benchmarks||[])}),s},[h.data]),_=Pe({taskId:r||"",page_size:20,order_by:m,order_dir:"desc",include_resources:!0,has_code:o,has_hf_artifacts:b,start_date:x.startDate,end_date:x.endDate,enabled:!!r}),H=k.useMemo(()=>{var a;return(((a=_.data)==null?void 0:a.pages.flatMap(n=>n.results))||[]).map(Be)},[_.data]),P=k.useMemo(()=>{var a;const s={};return(a=_.data)==null||a.pages.forEach(n=>n.results.forEach(j=>(j.methods||[]).forEach(u=>{const t=u.slug||u.id;s[t]||(s[t]={id:u.id,name:u.name,slug:u.slug||"",count:0}),s[t].count++}))),Object.values(s).sort((n,j)=>j.count-n.count).slice(0,8)},[_.data]),ne=$e(_);if(h.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(E,{className:"h-12 w-1/2 mb-4"}),e.jsx(E,{className:"h-6 w-1/3 mb-8"}),e.jsx(E,{className:"h-64 w-full"})]});if(h.error||!h.data)return e.jsx("div",{className:"page",children:e.jsx(Ae,{variant:"destructive",children:e.jsx(Re,{children:"Task not found."})})});const d=h.data.task,ie=h.data.parents||[],$=N(d.name,d.slug),A=(h.data.sisters||[]).filter(s=>s.id!==d.id),ce=h.data.recommended_frameworks||[],S=h.data.benchmarks||[],q=new Map(S.map(s=>[s.id,s])),le=new Set(S.map(s=>s.id)),O=(((G=D.data)==null?void 0:G.results)||[]).filter(s=>le.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}}),R=O.length?O: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:[]})),C=De(R,s=>{var a;return(a=q.get(s.id))==null?void 0:a.parent_dataset_id}),oe=I?C:C.slice(0,5),de=C.slice(5).reduce((s,a)=>s+a.members.length,0),U=((Q=D.data)==null?void 0:Q.recent_days)||90,me=y.some(s=>(B.get(s.id)||[]).length>0),he=y.length>0,z=R.length>0,pe=(()=>{const s=new Set;return S.forEach(a=>s.add(a.id)),B.forEach(a=>a.forEach(n=>s.add(n.id))),s.size})(),ue=s=>{re(a=>{const n=new Set(a);return n.has(s)?n.delete(s):n.add(s),n})};return e.jsxs("div",{className:"page",children:[e.jsx(Ve,{task:d,area:h.data.area,parents:ie}),e.jsxs("div",{className:d.image_url?`task-hero-grid${d.slug==="auto-research"?" task-hero-grid--wide":""}`:void 0,children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:$}),e.jsx(fe,{kind:"task",entityId:d.id}),d.description&&e.jsx(W,{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:pe}),"BENCHMARKS"]}),e.jsxs("span",{children:[e.jsxs("span",{className:"num",children:[P.length,"+"]}),"METHODS USED"]})]}),e.jsx(ze,{frameworks:ce})]}),d.image_url&&e.jsxs("figure",{className:`task-figure-card${d.slug==="omni-models"?" task-figure-card--compact":""}`,children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:_e(d.image_url)??void 0,alt:`${$} schematic`,onError:s=>{var a,n;(n=(a=s.currentTarget.parentElement)==null?void 0:a.parentElement)==null||n.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",$,d.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(W,{className:"task-image-credit",text:d.image_credit})]})]})]})]}),d.slug==="healthcare"&&e.jsx(Ge,{task:d,relatedTasks:A}),d.slug==="robotics"&&e.jsx(Le,{}),e.jsxs("div",{className:"task-page-grid",style:{marginTop:28},children:[e.jsxs("div",{children:[z&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",id:"benchmarks",children:[e.jsxs("div",{className:"task-section-eyebrow",children:[U,"-day reporting activity · select a benchmark"]}),e.jsxs("div",{className:"task-section-title",children:["Benchmarks ",e.jsxs("span",{className:"meta",children:["[",R.length,"]"]})]})]}),e.jsxs("div",{className:"benchmark-trend-table",role:"table","aria-label":"Trending benchmarks",children:[e.jsxs("div",{className:"benchmark-trend-head",role:"row",children:[e.jsx("span",{role:"columnheader",children:"Trend"}),e.jsx("span",{role:"columnheader",children:"Benchmark"}),e.jsx("span",{role:"columnheader",children:"Best model"}),e.jsx("span",{role:"columnheader",children:"Paper title"}),e.jsx("span",{role:"columnheader",children:"Code"}),e.jsx("span",{role:"columnheader",children:"Compare"})]}),oe.map(({key:s,members:a})=>{const n=a[0],j=p=>p===n?"standard":Ie(p.name,n.name),u=[n,...a.slice(1).sort((p,F)=>j(p).localeCompare(j(F),void 0,{sensitivity:"base"}))],t=u.find(p=>p.id===ee[s])??n;return e.jsxs("div",{className:"benchmark-trend-row",role:"row",children:[e.jsxs("div",{className:"benchmark-trend-cell",role:"cell",children:[e.jsx(ve,{history:t.history,benchmarkName:t.name}),e.jsxs("div",{className:"benchmark-trend-meta",children:[e.jsxs("span",{children:[e.jsx("strong",{children:t.recent_paper_count})," ",t.recent_paper_count===1?"paper":"papers"," /"," ",U,"d"]}),t.rate_change==null?t.recent_paper_count>0&&e.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):e.jsxs("span",{className:`benchmark-trend-change ${t.rate_change>=1?"is-up":"is-down"}`,children:[t.rate_change>=1?"↑":"↓"," ",t.rate_change.toFixed(1),"×"]})]})]}),e.jsxs("div",{className:"benchmark-trend-benchmark",role:"cell",children:[e.jsx(g,{className:"bench-row-name",to:T(t.slug||t.id,r),children:t.name}),u.length>1&&e.jsx("div",{className:"bench-row-variants",role:"group","aria-label":`Evaluation protocols for ${n.name}`,children:u.map(p=>e.jsx("button",{type:"button",className:"bench-row-variant","aria-pressed":p.id===t.id,title:p.name,onClick:()=>se(F=>({...F,[s]:p.id})),children:j(p)},p.id))}),e.jsx("div",{className:"bench-row-sub",children:e.jsxs("span",{children:[e.jsx("strong",{children:t.all_time_paper_count})," reporting papers"]})})]}),e.jsx("div",{className:"bench-row-best",role:"cell",children:t.best_model_name?e.jsxs(e.Fragment,{children:[e.jsx(Fe,{size:13,className:"bench-row-best-icon"}),e.jsx("span",{className:"bench-row-best-name",children:t.best_model_name})]}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-paper",role:"cell",children:t.best_paper_route&&t.best_paper_title?e.jsx(g,{to:`/paper/${encodeURIComponent(t.best_paper_route)}`,children:t.best_paper_title}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-code",role:"cell",children:t.best_code_url?e.jsx("a",{href:t.best_code_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Code for ${t.best_paper_title||t.best_model_name}`,children:e.jsx(Me,{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:T(t.slug||t.id,r),"aria-label":`Compare ${t.best_model_name||"the best model"} with all results on ${t.name}`,children:[e.jsx("span",{children:"See all"}),e.jsx(L,{size:11,strokeWidth:2,"aria-hidden":"true"})]})})]},s)})]}),C.length>5&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>Z(s=>!s),children:I?"− show top 5":`+ show ${de} more benchmarks`})]}),he&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",style:z?{marginTop:36}:void 0,children:[e.jsx("div",{className:"task-section-eyebrow",children:me?"Benchmarks by capability":"Task hierarchy"}),e.jsxs("div",{className:"task-section-title",children:["Subtasks ",e.jsxs("span",{className:"meta",children:["[",y.length,"]"]})]})]}),e.jsx("div",{className:"subtask-grid",children:y.map(s=>{const a=B.get(s.id)||[],n=ae.has(s.id),j=n?a:a.slice(0,M),u=a.length-M;return e.jsxs("div",{className:"subtask-section",children:[e.jsxs("div",{className:"subtask-head",children:[e.jsx(g,{to:`/tasks/${s.slug||s.id}`,className:"subtask-head-name",children:N(s.name,s.slug)}),e.jsx("span",{className:"subtask-head-meta",children:a.length>0?`[${a.length} benchmark${a.length===1?"":"s"}]`:`[${(s.paper_count??0).toLocaleString()} papers]`})]}),j.length>0?j.map((t,p)=>e.jsxs("div",{className:"bench-row",onClick:()=>c(T(t.slug||t.id,s.slug||s.id)),children:[e.jsx("div",{className:"bench-row-num",children:String(p+1).padStart(2,"0")}),e.jsxs("div",{className:"bench-row-main",children:[e.jsx("div",{className:"bench-row-name",children:t.name}),e.jsx("div",{className:"bench-row-sub",children:t.paper_count!=null&&e.jsxs("span",{children:[e.jsx("strong",{children:t.paper_count})," ENTRIES"]})})]}),e.jsx("div",{className:"bench-row-arrow",children:"→"})]},t.id)):e.jsxs(g,{to:`/tasks/${s.slug||s.id}`,className:"subtask-summary",children:[e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]}),s.description&&e.jsx("span",{className:"subtask-summary-desc",children:s.description})]}),u>0&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>ue(s.id),children:n?`− show top ${M}`:`+ show ${u} more benchmark${u===1?"":"s"}`})]},s.id)})})]}),e.jsxs("div",{className:"task-section-head",style:{marginTop:36},children:[e.jsx("div",{className:"task-section-eyebrow",children:"Top trending · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",(d.paper_count??0).toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:He.map(([s,a])=>e.jsx("button",{className:`sort-btn ${m===s?"active":""}`,onClick:()=>w(s),children:a},s))}),e.jsx(ye,{hasCode:o,hasHfArtifacts:b,onHasCodeChange:f,onHasHfArtifactsChange:Y})]}),e.jsx(Ce,{startDate:x.startDate,endDate:x.endDate,onChange:s=>i(Ee(l,s))})]}),_.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((s,a)=>e.jsx(E,{className:"h-40 w-full"},a))}):H.length===0?e.jsx("div",{className:"no-results",children:"No papers in this task yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:H.map((s,a)=>e.jsx(Ne,{paper:s,rank:a+1},s.id))}),e.jsx("div",{ref:ne,style:{height:1}}),_.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]}),e.jsxs("aside",{className:"task-side",children:[A.length>0&&d.slug!=="healthcare"&&e.jsxs("div",{className:"side-block",children:[e.jsx("div",{className:"side-block-num",children:"01/"}),e.jsx("div",{className:"side-block-label",children:"Sister Tasks"}),A.slice(0,8).map(s=>e.jsxs(g,{to:`/tasks/${s.slug||s.id}`,className:"side-link-row",children:[e.jsx("span",{children:N(s.name,s.slug)}),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count.toLocaleString()})]},s.id))]}),P.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"}),P.map(s=>e.jsxs("div",{className:"side-method-row",children:[e.jsx(we,{method:{slug:s.slug,name:s.name}}),e.jsxs("span",{className:"num",children:["·",s.count]})]},s.id))]})]})]})]})};export{Ge as HealthcareMedicalAiHub,ze as RecommendedFrameworkLinks,Ve as TaskBreadcrumb,Es as default}; +import{j as e,L as g,K as ge,u as be,c as xe,e as je,r as k,q as ke,Y as _e}from"./index-D6jcIRWs.js";import{R as fe}from"./ResearchFollowButton-C2Bfd9dP.js";import{u as K}from"./useQuery-CUJUm4FY.js";import{P as Ne,M as we}from"./components-DO1X940E.js";import{A as L}from"./arrow-right-CFRHnFt4.js";import{B as ve}from"./BenchmarkTrendSparkline-BfAoxAzu.js";import{P as ye}from"./PaperFeedFilters-DNebHp4l.js";import{a as Se,P as Ce,b as Ee}from"./PaperDateFilter-CPIqaHaq.js";import{M as W}from"./MarkdownText-B_D3IE_p.js";import{c as Y}from"./catalog-PYrB8_bm.js";import{s as Te}from"./slug-BpH-Nkvz.js";import{d as N,t as Be}from"./colors-CLwl8a2d.js";import{c as Pe}from"./usePapers-BbCSwcVk.js";import{u as $e}from"./useInfiniteScroll-Dm7JY_X4.js";import{S as E}from"./skeleton-BqkYFmXl.js";import{A as Ae,a as Re}from"./alert-2MbxVzGL.js";import{T as Fe}from"./trophy-CqWfBPLd.js";import{G as Me}from"./github-B7D_19Qm.js";import"./useMutation-p6mN4h17.js";import"./research-BggtGgC2.js";import"./plus-C4UQ62Q1.js";import"./papers-DIIIPDpj.js";import"./AuthorAvatar-UMHOVOr9.js";import"./LatexTitle-D_92Jowu.js";import"./safeExternalHref-CkBrsh84.js";import"./popover-DCjqGpW0.js";/* empty css */import"./PaperPreviewLink-fcJyP9H0.js";import"./index-uFGyKu5N.js";import"./index-yduEvk9Z.js";import"./katex-DkKDou_j.js";import"./hover-card-DPpv0l_x.js";import"./useInfiniteQuery-FXco4P1n.js";import"./useIntersectionObserver-3LTuEaFW.js";const Le=()=>e.jsxs(g,{to:"/astra-for-robotics",className:"task-featured-collection","aria-label":"Featured collection: GPT-6 Astra for Robotics",children:[e.jsx("span",{className:"task-featured-collection-eyebrow",children:"Featured collection"}),e.jsx("strong",{children:"GPT-6 Astra for Robotics"}),e.jsx("span",{className:"task-featured-collection-description",children:"Papers and demos that put GPT-6 Astra in control of real and simulated robots, as the policy itself or as an agent orchestrating the stack."}),e.jsxs("span",{className:"task-featured-collection-meta",children:["Explore the collection",e.jsx(L,{size:14,"aria-hidden":"true"})]})]}),J=r=>{const c=r.match(/\(([^()]*)\)\s*$/);return c?c[1].split(",").map(l=>l.trim()).filter(Boolean):[]};function Ie(r,c){const l=J(r);if(c===void 0)return"standard";const i=new Set(J(c).map(o=>o.toLowerCase())),m=l.filter(o=>!i.has(o.toLowerCase()));return m.length?m.join(", "):r}function De(r,c){const l=new Map(r.map(o=>[o.id,o])),i=o=>{const b=new Set([o.id]);let x=o;for(;;){const w=c(x),f=w?l.get(w):void 0;if(!f)return x.id;if(b.has(f.id))return o.id;b.add(f.id),x=f}},m=new Map;return r.forEach(o=>{const b=i(o);m.set(b,[...m.get(b)||[],o])}),[...m].map(([o,b])=>({key:o,members:[l.get(o),...b.filter(x=>x.id!==o)]}))}const He=[["trending","trending"],["date_published","newest"],["citation_count","most cited"]],qe=r=>r==="trending"||r==="date_published"||r==="citation_count"?r:"trending",M=3,Oe=[{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"}],Ue=r=>new Intl.NumberFormat("en",{notation:r>=1e3?"compact":"standard",maximumFractionDigits:1}).format(r),ze=({frameworks:r})=>r.length===0?null:e.jsxs("div",{className:"task-framework-links",children:[e.jsx("span",{className:"task-framework-links-label",children:"Recommended frameworks"}),r.map(c=>e.jsxs(g,{to:`/papers?framework=${encodeURIComponent(c.framework_slug)}`,className:"task-framework-link",children:[e.jsx("span",{children:c.framework_name}),e.jsxs("span",{className:"task-framework-link-stars",children:["★ ",Ue(c.num_stars)]})]},c.framework_id))]}),Ve=({task:r,area:c,parents:l})=>e.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[e.jsx(g,{to:"/tasks",children:"Tasks"}),c&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(g,{to:`/tasks#area-${Te(c.name)}`,children:c.name})]}),[...l].reverse().map(i=>e.jsxs(ge.Fragment,{children:[e.jsx("span",{className:"sep",children:"/"}),e.jsx(g,{to:`/tasks/${i.slug||i.id}`,children:N(i.name,i.slug)})]},i.id)),e.jsx("span",{className:"sep",children:"/"}),e.jsx("span",{style:{color:"var(--accent-text)"},children:N(r.name,r.slug)})]}),Ge=({task:r,relatedTasks:c})=>{const l=new Map([r,...c].map(i=>[i.slug,i]));return e.jsxs("section",{className:"medical-ai-hub","aria-labelledby":"medical-ai-hub-title",children:[e.jsxs("div",{className:"medical-ai-hub-heading",children:[e.jsx("span",{children:"Medical AI directory"}),e.jsx("h2",{id:"medical-ai-hub-title",children:"Explore Healthcare & Medical AI"}),e.jsx("p",{children:"Browse the field by clinical application, language, vision, or multimodal reasoning."})]}),e.jsx("div",{className:"medical-ai-hub-grid",children:Oe.map(i=>{const m=l.get(i.slug),o=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"medical-ai-hub-card-eyebrow",children:i.eyebrow}),e.jsx("strong",{children:i.title}),e.jsx("span",{className:"medical-ai-hub-card-description",children:i.description}),e.jsxs("span",{className:"medical-ai-hub-card-meta",children:[(m==null?void 0:m.paper_count)!=null?`${m.paper_count.toLocaleString()} papers`:"Explore task",e.jsx(L,{size:14,"aria-hidden":"true"})]})]});return i.slug==="healthcare"?e.jsx("a",{href:i.href,className:"medical-ai-hub-card",children:o},i.slug):e.jsx(g,{to:i.href,className:"medical-ai-hub-card",children:o},i.slug)})})]})},Qe=r=>[...r].sort((c,l)=>{const i=c.slug==="classic-language-modeling",m=l.slug==="classic-language-modeling";return i!==m?i?1:-1:0}),Es=()=>{var V,G,Q;const{taskSlug:r}=be(),c=xe(),[l,i]=je(),m=qe(l.get("order_by")),o=l.get("has_code")==="true",b=l.get("has_hf_artifacts")==="true",x=Se(l),w=s=>{const a=new URLSearchParams(l);a.set("order_by",s),i(a)},f=s=>{const a=new URLSearchParams(l);s?a.set("has_code","true"):a.delete("has_code"),i(a)},X=s=>{const a=new URLSearchParams(l);s?a.set("has_hf_artifacts","true"):a.delete("has_hf_artifacts"),i(a)},[I,Z]=k.useState(!1),[ee,se]=k.useState({}),[ae,re]=k.useState(()=>new Set),{preferences:te}=ke(),T=(s,a)=>{const n=s||"";return a?`/benchmark/${n}?task=${encodeURIComponent(a)}`:`/benchmark/${n}`},v=te.hide_closed_source_evals?!0:void 0,h=K({queryKey:["task-page",r,v],queryFn:()=>Y.taskPage(r,{is_open:v}),enabled:!!r,staleTime:10*60*1e3});k.useEffect(()=>{var n;const s=(n=h.data)==null?void 0:n.task.slug;if(!r||!s||s===r)return;const a=l.toString();c(`/tasks/${s}${a?`?${a}`:""}`,{replace:!0})},[c,(V=h.data)==null?void 0:V.task.slug,l,r]);const D=K({queryKey:["task-benchmark-trends",r,v],queryFn:()=>Y.trendingBenchmarks(r,{limit:100,min_recent_papers:0,is_open:v}),enabled:!!r,staleTime:10*60*1e3}),y=k.useMemo(()=>{var s;return Qe(((s=h.data)==null?void 0:s.children)||[])},[h.data]),B=k.useMemo(()=>{var a;const s=new Map;return(((a=h.data)==null?void 0:a.subtask_benchmarks)||[]).forEach(n=>{s.set(n.subtask_id,n.benchmarks||[])}),s},[h.data]),_=Pe({taskId:r||"",page_size:20,order_by:m,order_dir:"desc",include_resources:!0,has_code:o,has_hf_artifacts:b,start_date:x.startDate,end_date:x.endDate,enabled:!!r}),H=k.useMemo(()=>{var a;return(((a=_.data)==null?void 0:a.pages.flatMap(n=>n.results))||[]).map(Be)},[_.data]),P=k.useMemo(()=>{var a;const s={};return(a=_.data)==null||a.pages.forEach(n=>n.results.forEach(j=>(j.methods||[]).forEach(u=>{const t=u.slug||u.id;s[t]||(s[t]={id:u.id,name:u.name,slug:u.slug||"",count:0}),s[t].count++}))),Object.values(s).sort((n,j)=>j.count-n.count).slice(0,8)},[_.data]),ne=$e(_);if(h.isLoading)return e.jsxs("div",{className:"page",children:[e.jsx(E,{className:"h-12 w-1/2 mb-4"}),e.jsx(E,{className:"h-6 w-1/3 mb-8"}),e.jsx(E,{className:"h-64 w-full"})]});if(h.error||!h.data)return e.jsx("div",{className:"page",children:e.jsx(Ae,{variant:"destructive",children:e.jsx(Re,{children:"Task not found."})})});const d=h.data.task,ie=h.data.parents||[],$=N(d.name,d.slug),A=(h.data.sisters||[]).filter(s=>s.id!==d.id),ce=h.data.recommended_frameworks||[],S=h.data.benchmarks||[],q=new Map(S.map(s=>[s.id,s])),le=new Set(S.map(s=>s.id)),O=(((G=D.data)==null?void 0:G.results)||[]).filter(s=>le.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}}),R=O.length?O: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:[]})),C=De(R,s=>{var a;return(a=q.get(s.id))==null?void 0:a.parent_dataset_id}),oe=I?C:C.slice(0,5),de=C.slice(5).reduce((s,a)=>s+a.members.length,0),U=((Q=D.data)==null?void 0:Q.recent_days)||90,me=y.some(s=>(B.get(s.id)||[]).length>0),he=y.length>0,z=R.length>0,pe=(()=>{const s=new Set;return S.forEach(a=>s.add(a.id)),B.forEach(a=>a.forEach(n=>s.add(n.id))),s.size})(),ue=s=>{re(a=>{const n=new Set(a);return n.has(s)?n.delete(s):n.add(s),n})};return e.jsxs("div",{className:"page",children:[e.jsx(Ve,{task:d,area:h.data.area,parents:ie}),e.jsxs("div",{className:d.image_url?`task-hero-grid${d.slug==="auto-research"?" task-hero-grid--wide":""}`:void 0,children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--mono)",fontSize:11,color:"var(--accent-text)",letterSpacing:"0.1em",marginBottom:8},children:"TASK"}),e.jsx("h1",{className:"domain-mega-title",children:$}),e.jsx(fe,{kind:"task",entityId:d.id}),d.description&&e.jsx(W,{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:pe}),"BENCHMARKS"]}),e.jsxs("span",{children:[e.jsxs("span",{className:"num",children:[P.length,"+"]}),"METHODS USED"]})]}),e.jsx(ze,{frameworks:ce})]}),d.image_url&&e.jsxs("figure",{className:`task-figure-card${d.slug==="omni-models"?" task-figure-card--compact":""}`,children:[e.jsx("div",{className:"task-figure-img-wrap",children:e.jsx("img",{className:"task-figure-img",src:_e(d.image_url)??void 0,alt:`${$} schematic`,onError:s=>{var a,n;(n=(a=s.currentTarget.parentElement)==null?void 0:a.parentElement)==null||n.style.setProperty("display","none")}})}),e.jsxs("figcaption",{children:["Figure · ",$,d.image_credit&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(W,{className:"task-image-credit",text:d.image_credit})]})]})]})]}),d.slug==="healthcare"&&e.jsx(Ge,{task:d,relatedTasks:A}),d.slug==="robotics"&&e.jsx(Le,{}),e.jsxs("div",{className:"task-page-grid",style:{marginTop:28},children:[e.jsxs("div",{children:[z&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",id:"benchmarks",children:[e.jsxs("div",{className:"task-section-eyebrow",children:[U,"-day reporting activity · select a benchmark"]}),e.jsxs("div",{className:"task-section-title",children:["Benchmarks ",e.jsxs("span",{className:"meta",children:["[",R.length,"]"]})]})]}),e.jsxs("div",{className:"benchmark-trend-table",role:"table","aria-label":"Trending benchmarks",children:[e.jsxs("div",{className:"benchmark-trend-head",role:"row",children:[e.jsx("span",{role:"columnheader",children:"Trend"}),e.jsx("span",{role:"columnheader",children:"Benchmark"}),e.jsx("span",{role:"columnheader",children:"Best model"}),e.jsx("span",{role:"columnheader",children:"Paper title"}),e.jsx("span",{role:"columnheader",children:"Code"}),e.jsx("span",{role:"columnheader",children:"Compare"})]}),oe.map(({key:s,members:a})=>{const n=a[0],j=p=>p===n?"standard":Ie(p.name,n.name),u=[n,...a.slice(1).sort((p,F)=>j(p).localeCompare(j(F),void 0,{sensitivity:"base"}))],t=u.find(p=>p.id===ee[s])??n;return e.jsxs("div",{className:"benchmark-trend-row",role:"row",children:[e.jsxs("div",{className:"benchmark-trend-cell",role:"cell",children:[e.jsx(ve,{history:t.history,benchmarkName:t.name}),e.jsxs("div",{className:"benchmark-trend-meta",children:[e.jsxs("span",{children:[e.jsx("strong",{children:t.recent_paper_count})," ",t.recent_paper_count===1?"paper":"papers"," /"," ",U,"d"]}),t.rate_change==null?t.recent_paper_count>0&&e.jsx("span",{className:"benchmark-trend-change is-new",children:"new"}):e.jsxs("span",{className:`benchmark-trend-change ${t.rate_change>=1?"is-up":"is-down"}`,children:[t.rate_change>=1?"↑":"↓"," ",t.rate_change.toFixed(1),"×"]})]})]}),e.jsxs("div",{className:"benchmark-trend-benchmark",role:"cell",children:[e.jsx(g,{className:"bench-row-name",to:T(t.slug||t.id,r),children:t.name}),u.length>1&&e.jsx("div",{className:"bench-row-variants",role:"group","aria-label":`Evaluation protocols for ${n.name}`,children:u.map(p=>e.jsx("button",{type:"button",className:"bench-row-variant","aria-pressed":p.id===t.id,title:p.name,onClick:()=>se(F=>({...F,[s]:p.id})),children:j(p)},p.id))}),e.jsx("div",{className:"bench-row-sub",children:e.jsxs("span",{children:[e.jsx("strong",{children:t.all_time_paper_count})," reporting papers"]})})]}),e.jsx("div",{className:"bench-row-best",role:"cell",children:t.best_model_name?e.jsxs(e.Fragment,{children:[e.jsx(Fe,{size:13,className:"bench-row-best-icon"}),e.jsx("span",{className:"bench-row-best-name",children:t.best_model_name})]}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-paper",role:"cell",children:t.best_paper_route&&t.best_paper_title?e.jsx(g,{to:`/paper/${encodeURIComponent(t.best_paper_route)}`,children:t.best_paper_title}):e.jsx("span",{className:"bench-row-best-empty",children:"—"})}),e.jsx("div",{className:"bench-row-code",role:"cell",children:t.best_code_url?e.jsx("a",{href:t.best_code_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Code for ${t.best_paper_title||t.best_model_name}`,children:e.jsx(Me,{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:T(t.slug||t.id,r),"aria-label":`Compare ${t.best_model_name||"the best model"} with all results on ${t.name}`,children:[e.jsx("span",{children:"See all"}),e.jsx(L,{size:11,strokeWidth:2,"aria-hidden":"true"})]})})]},s)})]}),C.length>5&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>Z(s=>!s),children:I?"− show top 5":`+ show ${de} more benchmarks`})]}),he&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"task-section-head",style:z?{marginTop:36}:void 0,children:[e.jsx("div",{className:"task-section-eyebrow",children:me?"Benchmarks by capability":"Task hierarchy"}),e.jsxs("div",{className:"task-section-title",children:["Subtasks ",e.jsxs("span",{className:"meta",children:["[",y.length,"]"]})]})]}),e.jsx("div",{className:"subtask-grid",children:y.map(s=>{const a=B.get(s.id)||[],n=ae.has(s.id),j=n?a:a.slice(0,M),u=a.length-M;return e.jsxs("div",{className:"subtask-section",children:[e.jsxs("div",{className:"subtask-head",children:[e.jsx(g,{to:`/tasks/${s.slug||s.id}`,className:"subtask-head-name",children:N(s.name,s.slug)}),e.jsx("span",{className:"subtask-head-meta",children:a.length>0?`[${a.length} benchmark${a.length===1?"":"s"}]`:`[${(s.paper_count??0).toLocaleString()} papers]`})]}),j.length>0?j.map((t,p)=>e.jsxs("div",{className:"bench-row",onClick:()=>c(T(t.slug||t.id,s.slug||s.id)),children:[e.jsx("div",{className:"bench-row-num",children:String(p+1).padStart(2,"0")}),e.jsxs("div",{className:"bench-row-main",children:[e.jsx("div",{className:"bench-row-name",children:t.name}),e.jsx("div",{className:"bench-row-sub",children:t.paper_count!=null&&e.jsxs("span",{children:[e.jsx("strong",{children:t.paper_count})," ENTRIES"]})})]}),e.jsx("div",{className:"bench-row-arrow",children:"→"})]},t.id)):e.jsxs(g,{to:`/tasks/${s.slug||s.id}`,className:"subtask-summary",children:[e.jsxs("span",{children:[(s.paper_count??0).toLocaleString()," papers"]}),s.description&&e.jsx("span",{className:"subtask-summary-desc",children:s.description})]}),u>0&&e.jsx("button",{type:"button",className:"bench-show-more",onClick:()=>ue(s.id),children:n?`− show top ${M}`:`+ show ${u} more benchmark${u===1?"":"s"}`})]},s.id)})})]}),e.jsxs("div",{className:"task-section-head",style:{marginTop:36},children:[e.jsx("div",{className:"task-section-eyebrow",children:"Top trending · sort below"}),e.jsxs("div",{className:"task-section-title",children:["Papers ",e.jsxs("span",{className:"meta",children:["[",(d.paper_count??0).toLocaleString(),"]"]})]})]}),e.jsxs("div",{className:"sort-bar",children:[e.jsxs("div",{className:"paper-feed-toolbar-controls",children:[e.jsx("div",{className:"sort-options",children:He.map(([s,a])=>e.jsx("button",{className:`sort-btn ${m===s?"active":""}`,onClick:()=>w(s),children:a},s))}),e.jsx(ye,{hasCode:o,hasHfArtifacts:b,onHasCodeChange:f,onHasHfArtifactsChange:X})]}),e.jsx(Ce,{startDate:x.startDate,endDate:x.endDate,onChange:s=>i(Ee(l,s))})]}),_.isLoading?e.jsx("div",{className:"paper-list",children:Array.from({length:4}).map((s,a)=>e.jsx(E,{className:"h-40 w-full"},a))}):H.length===0?e.jsx("div",{className:"no-results",children:"No papers in this task yet."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"paper-list",children:H.map((s,a)=>e.jsx(Ne,{paper:s,rank:a+1},s.id))}),e.jsx("div",{ref:ne,style:{height:1}}),_.isFetchingNextPage&&e.jsx("div",{style:{padding:"20px 0",textAlign:"center",color:"var(--ink-faint)"},children:"Loading more…"})]})]}),e.jsxs("aside",{className:"task-side",children:[A.length>0&&d.slug!=="healthcare"&&e.jsxs("div",{className:"side-block",children:[e.jsx("div",{className:"side-block-num",children:"01/"}),e.jsx("div",{className:"side-block-label",children:"Sister Tasks"}),A.slice(0,8).map(s=>e.jsxs(g,{to:`/tasks/${s.slug||s.id}`,className:"side-link-row",children:[e.jsx("span",{children:N(s.name,s.slug)}),s.paper_count!=null&&e.jsx("span",{className:"count",children:s.paper_count.toLocaleString()})]},s.id))]}),P.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"}),P.map(s=>e.jsxs("div",{className:"side-method-row",children:[e.jsx(we,{method:{slug:s.slug,name:s.name}}),e.jsxs("span",{className:"num",children:["·",s.count]})]},s.id))]})]})]})]})};export{Ge as HealthcareMedicalAiHub,ze as RecommendedFrameworkLinks,Ve as TaskBreadcrumb,Es as default}; diff --git a/assets/TagsIndexView-CtWAzEjF.js b/assets/TagsIndexView-CHjo-ug4.js similarity index 97% rename from assets/TagsIndexView-CtWAzEjF.js rename to assets/TagsIndexView-CHjo-ug4.js index 372aef6b35204a4371b51a3bb75bdab18ba99bb7..3a98c2ff6846094ee5867f8e226ec7d01660c51c 100644 --- a/assets/TagsIndexView-CtWAzEjF.js +++ b/assets/TagsIndexView-CHjo-ug4.js @@ -1,4 +1,4 @@ -import{n as e,r as p,j as a,L as j}from"./index-CqKcHUvZ.js";import{u as k}from"./useQuery-Cngk7eL9.js";import{c as l}from"./catalog-D26nGNnK.js";import{c as v,h as u,d as f}from"./colors-_scCXfCe.js";import{s as S}from"./slug-BpH-Nkvz.js";import{S as L}from"./search-9n8Usynh.js";import{I as C,T as V}from"./triangle-alert-DM207o24.js";import{S as A}from"./share-2-Ma7ZrYBX.js";import{T as H}from"./trending-up-n0ivZSaN.js";import{M as T}from"./moon-DgDMXTmG.js";import{T as F}from"./thumbs-up-C19-ALYv.js";import{D as Z}from"./database-DrVmdfNa.js";import{T as B}from"./trophy-CwHzFBlu.js";import{F as P}from"./file-text-DnNBEwSF.js";import{A as N}from"./activity-DDb7qU7w.js";import{G as _}from"./globe-6Eu_W8am.js";import{S as E}from"./sparkles-BKRdZneA.js";import{S as w}from"./skeleton-DleNhBYA.js";import{A as I,a as D}from"./alert-Z2yFUcyL.js";import{T as G}from"./TaxonomySuggestionTile-Be7MdvJo.js";import{T as W}from"./TaxonomyTrending-DuJmoxuN.js";import"./SignInToEditDialog-B4COuqpY.js";import"./button-BYn4yUH_.js";import"./input-sw0Ix0Sa.js";import"./textarea-CQToxq8k.js";import"./searchable-select-DY1KXMvg.js";import"./popover-BcoS9Jmp.js";import"./dialog-B-oqHDuH.js";import"./loader-circle-CZgakNH7.js";import"./useMutation-BItMAQ7s.js";import"./submissions-1aHdBaSr.js";import"./plus-DZF-NxR0.js";/** +import{n as e,r as p,j as a,L as j}from"./index-D6jcIRWs.js";import{u as k}from"./useQuery-CUJUm4FY.js";import{c as l}from"./catalog-PYrB8_bm.js";import{c as v,h as u,d as f}from"./colors-CLwl8a2d.js";import{s as S}from"./slug-BpH-Nkvz.js";import{S as L}from"./search-CfTufeR7.js";import{I as C,T as V}from"./triangle-alert-Cypc2KaL.js";import{S as A}from"./share-2-DPo2j-OC.js";import{T as H}from"./trending-up-DqN3HzZ5.js";import{M as T}from"./moon--2wi3KtT.js";import{T as F}from"./thumbs-up-BqRlVdvF.js";import{D as Z}from"./database-DKdKRr_t.js";import{T as B}from"./trophy-CqWfBPLd.js";import{F as P}from"./file-text-4G2I5_Zo.js";import{A as N}from"./activity-5IcAhZoH.js";import{G as _}from"./globe-iw_Y78tU.js";import{S as E}from"./sparkles-r8uPx2-0.js";import{S as w}from"./skeleton-BqkYFmXl.js";import{A as I,a as D}from"./alert-2MbxVzGL.js";import{T as G}from"./TaxonomySuggestionTile-BLk1tYYE.js";import{T as W}from"./TaxonomyTrending-Dqu0dPfc.js";import"./SignInToEditDialog-RzK54RAM.js";import"./button-Bzx0ccHH.js";import"./input-CCN-4hy4.js";import"./textarea-sXKODM3W.js";import"./searchable-select-B7z6Fcrr.js";import"./popover-DCjqGpW0.js";import"./dialog-vGFIbcd-.js";import"./loader-circle-BuDrH29B.js";import"./useMutation-p6mN4h17.js";import"./submissions-DNa3tQdo.js";import"./plus-C4UQ62Q1.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/TaxonomySuggestionTile-Be7MdvJo.js b/assets/TaxonomySuggestionTile-BLk1tYYE.js similarity index 76% rename from assets/TaxonomySuggestionTile-Be7MdvJo.js rename to assets/TaxonomySuggestionTile-BLk1tYYE.js index 035806706264918f75750d7780a4937efbbac83c..ad9e0784d1bf4cc04a49f0b36470be953a53c4df 100644 --- a/assets/TaxonomySuggestionTile-Be7MdvJo.js +++ b/assets/TaxonomySuggestionTile-BLk1tYYE.js @@ -1 +1 @@ -import{a as u,r as t,j as e}from"./index-CqKcHUvZ.js";import{S as c,a as m}from"./SignInToEditDialog-B4COuqpY.js";import{P as p}from"./plus-DZF-NxR0.js";function j({kind:s}){const{user:a}=u(),[i,n]=t.useState(!1),[r,o]=t.useState(!1),l=`Suggest a new ${s}...`,g=()=>{a?n(!0):o(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"tag-cell taxonomy-suggestion-cell",onClick:g,children:[e.jsxs("div",{className:"name",children:[e.jsx(p,{className:"taxonomy-suggestion-icon","aria-hidden":"true"}),l]}),e.jsx("div",{className:"meta",children:e.jsx("span",{children:"Propose an addition"})})]}),e.jsx(c,{open:i,onOpenChange:n,kind:s}),e.jsx(m,{open:r,onOpenChange:o,sectionLabel:`${s}s`,returnTo:typeof window<"u"?window.location.pathname:`/${s}s`,taxonomySuggestion:!0})]})}export{j as T}; +import{a as u,r as t,j as e}from"./index-D6jcIRWs.js";import{S as c,a as m}from"./SignInToEditDialog-RzK54RAM.js";import{P as p}from"./plus-C4UQ62Q1.js";function j({kind:s}){const{user:a}=u(),[i,n]=t.useState(!1),[r,o]=t.useState(!1),l=`Suggest a new ${s}...`,g=()=>{a?n(!0):o(!0)};return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"tag-cell taxonomy-suggestion-cell",onClick:g,children:[e.jsxs("div",{className:"name",children:[e.jsx(p,{className:"taxonomy-suggestion-icon","aria-hidden":"true"}),l]}),e.jsx("div",{className:"meta",children:e.jsx("span",{children:"Propose an addition"})})]}),e.jsx(c,{open:i,onOpenChange:n,kind:s}),e.jsx(m,{open:r,onOpenChange:o,sectionLabel:`${s}s`,returnTo:typeof window<"u"?window.location.pathname:`/${s}s`,taxonomySuggestion:!0})]})}export{j as T}; diff --git a/assets/TaxonomyTrending-DuJmoxuN.js b/assets/TaxonomyTrending-Dqu0dPfc.js similarity index 90% rename from assets/TaxonomyTrending-DuJmoxuN.js rename to assets/TaxonomyTrending-Dqu0dPfc.js index ef976c3e1d1754d1b61b0d7ce22f732b1bf6196b..e8a53490fc83f0125d29509b1fcda5c426850fc7 100644 --- a/assets/TaxonomyTrending-DuJmoxuN.js +++ b/assets/TaxonomyTrending-Dqu0dPfc.js @@ -1 +1 @@ -import{j as a,L as h}from"./index-CqKcHUvZ.js";import{S as x}from"./skeleton-DleNhBYA.js";import{A as p,a as j}from"./alert-Z2yFUcyL.js";import{T as o}from"./trending-up-n0ivZSaN.js";const y=({noun:n,items:e,recentDays:i=30,baselineDays:t=180,isLoading:d,error:l,mono:c})=>!d&&!l&&!(e!=null&&e.length)?null:a.jsxs("section",{id:"trending",className:"taxonomy-trending","aria-label":`Trending ${n}s`,children:[a.jsxs("div",{className:"taxonomy-trending-header",children:[a.jsxs("h2",{children:[a.jsx(o,{size:22,"aria-hidden":"true"}),"Trending"]}),a.jsxs("p",{className:"taxonomy-trending-note",children:[n==="task"?"Tasks":"Methods"," across all areas whose share of papers in the last ",i," days grew the most against the preceding ",t," days."]})]}),l?a.jsx(p,{variant:"destructive",children:a.jsxs(j,{children:["Failed to load trending ",n,"s."]})}):d?a.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((s,r)=>a.jsx(x,{className:"h-20"},r))}):a.jsx("div",{className:"tag-grid",children:e==null?void 0:e.map((s,r)=>a.jsxs(h,{to:s.href,className:"tag-cell",children:[a.jsxs("div",{className:"name",style:c?{fontFamily:"var(--mono)",fontSize:15}:void 0,children:[a.jsx("span",{className:"taxonomy-trending-rank",children:r+1}),s.icon&&a.jsx("span",{className:"task-icon",style:{color:s.iconColor},children:a.jsx(s.icon,{size:16,strokeWidth:2,"aria-hidden":"true"})}),s.name]}),a.jsxs("div",{className:"meta taxonomy-trending-meta",children:[s.areaName&&a.jsxs(a.Fragment,{children:[a.jsx("span",{children:s.areaName}),a.jsx("span",{children:"·"})]}),a.jsxs("span",{children:[s.recentPaperCount.toLocaleString()," papers / ",i,"d"]}),a.jsx("span",{children:"·"}),a.jsxs("span",{className:"method-trend-score taxonomy-trending-lift",title:`Share of recent papers is ${s.shareLift.toFixed(1)}× its baseline share`,children:[a.jsx(o,{size:12,"aria-hidden":"true"}),s.shareLift.toFixed(1),"×"]})]})]},s.id))})]});export{y as T}; +import{j as a,L as h}from"./index-D6jcIRWs.js";import{S as x}from"./skeleton-BqkYFmXl.js";import{A as p,a as j}from"./alert-2MbxVzGL.js";import{T as o}from"./trending-up-DqN3HzZ5.js";const y=({noun:n,items:e,recentDays:i=30,baselineDays:t=180,isLoading:d,error:l,mono:c})=>!d&&!l&&!(e!=null&&e.length)?null:a.jsxs("section",{id:"trending",className:"taxonomy-trending","aria-label":`Trending ${n}s`,children:[a.jsxs("div",{className:"taxonomy-trending-header",children:[a.jsxs("h2",{children:[a.jsx(o,{size:22,"aria-hidden":"true"}),"Trending"]}),a.jsxs("p",{className:"taxonomy-trending-note",children:[n==="task"?"Tasks":"Methods"," across all areas whose share of papers in the last ",i," days grew the most against the preceding ",t," days."]})]}),l?a.jsx(p,{variant:"destructive",children:a.jsxs(j,{children:["Failed to load trending ",n,"s."]})}):d?a.jsx("div",{className:"tag-grid",children:Array.from({length:6}).map((s,r)=>a.jsx(x,{className:"h-20"},r))}):a.jsx("div",{className:"tag-grid",children:e==null?void 0:e.map((s,r)=>a.jsxs(h,{to:s.href,className:"tag-cell",children:[a.jsxs("div",{className:"name",style:c?{fontFamily:"var(--mono)",fontSize:15}:void 0,children:[a.jsx("span",{className:"taxonomy-trending-rank",children:r+1}),s.icon&&a.jsx("span",{className:"task-icon",style:{color:s.iconColor},children:a.jsx(s.icon,{size:16,strokeWidth:2,"aria-hidden":"true"})}),s.name]}),a.jsxs("div",{className:"meta taxonomy-trending-meta",children:[s.areaName&&a.jsxs(a.Fragment,{children:[a.jsx("span",{children:s.areaName}),a.jsx("span",{children:"·"})]}),a.jsxs("span",{children:[s.recentPaperCount.toLocaleString()," papers / ",i,"d"]}),a.jsx("span",{children:"·"}),a.jsxs("span",{className:"method-trend-score taxonomy-trending-lift",title:`Share of recent papers is ${s.shareLift.toFixed(1)}× its baseline share`,children:[a.jsx(o,{size:12,"aria-hidden":"true"}),s.shareLift.toFixed(1),"×"]})]})]},s.id))})]});export{y as T}; diff --git a/assets/TrendsView-DTLJKQiJ.js b/assets/TrendsView-BJILFDZ6.js similarity index 97% rename from assets/TrendsView-DTLJKQiJ.js rename to assets/TrendsView-BJILFDZ6.js index ef51768fb5d27c0f058d420506e072f45b4a05b9..0da7dd2d35343bab418dc174ab6d307f3af51762 100644 --- a/assets/TrendsView-DTLJKQiJ.js +++ b/assets/TrendsView-BJILFDZ6.js @@ -1 +1 @@ -import{a3 as I,K as X,j as e}from"./index-CqKcHUvZ.js";import{u as G}from"./useQuery-Cngk7eL9.js";import{A as J,a as E}from"./alert-Z2yFUcyL.js";import{S as P}from"./skeleton-DleNhBYA.js";class K{constructor(r){this.request=r}trends(){return this.request("/stats/trends")}}const Q=new K(I),m=t=>{const r=/^(\d{4})-(0[1-9]|1[0-2])$/.exec(t);if(!r)return t;const[,s,l]=r;return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][Number(l)-1]} '${s.slice(2)}`},V=()=>Q.trends(),f=980,j=400,x=62,B=26,g=30,Y=58,u=f-x-B,A=j-g-Y,v=g+A,Z=t=>{if(t.length<3)return t.map((s,l)=>`${l?"L":"M"}${s[0]} ${s[1]}`).join(" ");let r=`M${t[0][0]} ${t[0][1]}`;for(let s=0;s{const[a,y]=X.useState(null),i=r.length,b=l[l.length-1],d=n=>x+u*(i===1?0:n/(i-1)),p=n=>g+A*(1-n/b);if(i===0)return null;const R=r.map((n,h)=>[d(h),p(n.percent)]),F=Z(R),_=`${F} L ${d(i-1)} ${v} L ${x} ${v} Z`,w=i<=12?1:Math.ceil(i/8),O=n=>{const h=n.currentTarget.getBoundingClientRect(),S=(n.clientX-h.left)/h.width*f,k=i>1?u/(i-1):u,q=Math.max(0,Math.min(i-1,Math.round((S-x)/k)));y(q)},H=`trend-gradient-${t}`;return e.jsxs("figure",{className:"trend-chart",children:[e.jsxs("div",{className:"trend-chart-visual",children:[e.jsxs("svg",{viewBox:`0 0 ${f} ${j}`,width:"100%",role:"img","aria-label":`${c} by ${o.toLowerCase()}, from ${m(r[0].month)} (${r[0].percent}%) to ${m(r[i-1].month)} (${r[i-1].percent}%)`,style:{display:"block",overflow:"visible",cursor:"crosshair"},onPointerMove:O,onPointerLeave:()=>y(null),children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:H,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",style:{stopColor:s,stopOpacity:.26}}),e.jsx("stop",{offset:"100%",style:{stopColor:s,stopOpacity:.02}})]})}),l.map(n=>e.jsxs("g",{children:[e.jsx("line",{x1:x,x2:f-B,y1:p(n),y2:p(n),stroke:"var(--hairline)",strokeWidth:1}),e.jsxs("text",{x:x-14,y:p(n)+4,textAnchor:"end",style:W,children:[n,"%"]})]},n)),e.jsx("path",{d:_,fill:`url(#${H})`}),e.jsx("path",{d:F,fill:"none",stroke:s,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),r.map((n,h)=>{const S=h===i-1,k=h%w===0&&i-1-h>=w/2;return!S&&!k?null:e.jsx("text",{x:d(h),y:v+24,textAnchor:"middle",style:W,children:m(n.month)},n.month)}),e.jsx("text",{x:x+u/2,y:j-4,textAnchor:"middle",style:z,children:o}),e.jsx("text",{transform:`translate(16 ${g+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:g,y2:v,stroke:s,strokeWidth:1,strokeDasharray:"3 4",opacity:.5}),e.jsx("circle",{cx:d(a),cy:p(r[a].percent),r:5,fill:"var(--bg)",stroke:s,strokeWidth:2})]})]}),a!=null&&e.jsxs("div",{style:{position:"absolute",left:`${d(a)/f*100}%`,top:`${p(r[a].percent)/j*100}%`,transform:"translate(-50%, calc(-100% - 14px))",background:"var(--bg-elevated)",border:"1px solid var(--hairline)",borderRadius:6,boxShadow:"0 8px 26px rgba(0,0,0,.13)",padding:"7px 12px",pointerEvents:"none",whiteSpace:"nowrap",zIndex:3},children:[e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-faint)",fontSize:13,marginBottom:2},children:m(r[a].month)}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:7,fontFamily:"var(--mono)",fontWeight:600,fontSize:15,color:"var(--ink)"},children:[e.jsx("span",{style:{width:8,height:8,borderRadius:2,background:s,display:"inline-block"}}),r[a].percent,"%"]})]})]}),e.jsxs("details",{className:"trend-chart-table",children:[e.jsx("summary",{style:{fontFamily:"var(--mono)",fontSize:11,letterSpacing:"0.04em",color:"var(--ink-faint)",cursor:"pointer"},children:"View data table"}),e.jsxs("table",{style:{marginTop:8,borderCollapse:"collapse",fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{style:{textAlign:"left",padding:"3px 18px 3px 0"},children:o}),e.jsx("th",{style:{textAlign:"right",padding:"3px 0"},children:c})]})}),e.jsx("tbody",{children:r.map(n=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 18px 2px 0"},children:m(n.month)}),e.jsxs("td",{style:{textAlign:"right",padding:"2px 0"},children:[n.percent,"%"]})]},n.month))})]})]})]})},$={maxWidth:960,padding:"48px 0 8px",borderTop:"1px solid var(--hairline)",marginTop:48},T={fontFamily:"var(--serif)",fontSize:34,fontWeight:500,letterSpacing:"-0.02em",margin:"0 0 10px",color:"var(--ink)"},M={fontFamily:"var(--serif)",fontSize:18,lineHeight:1.55,color:"var(--ink-soft)",maxWidth:620,margin:"0 0 8px"},C={fontFamily:"var(--mono)",fontSize:12,fontWeight:600,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--ink-faint)",marginBottom:8},N={fontFamily:"var(--serif)",fontSize:17,lineHeight:1.6,color:"var(--ink-soft)",margin:0},D={height:320,marginTop:26},re=()=>{const t=G({queryKey:["research-trends"],queryFn:V,staleTime:36e5});return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Research ",e.jsx("em",{children:"Trends"})]}),e.jsx("div",{className:"feed-subtitle",children:"How open science is changing across machine learning — tracked over time from arXiv and the Hugging Face Hub."})]})}),t.error&&e.jsx(J,{variant:"destructive",children:e.jsx(E,{children:"Failed to load research trends. Please try again."})}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Code Availability"}),e.jsx("p",{style:M,children:"The percentage of published papers that have at least one official code implementation on GitHub."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(L,{id:"code",data:t.data.code_availability,color:"var(--trend-code)",yTicks:[0,20,40,60,80],yLabel:"Code Availability",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Papers with Hugging Face artifacts"}),e.jsx("p",{style:M,children:"The percentage of published papers linked to at least one Hugging Face artifact — a model, dataset or Space — making the work directly runnable and reusable."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(L,{id:"hf",data:t.data.hf_artifacts,color:"var(--trend-hf)",yTicks:[0,10,20,30,40,50],yLabel:"HF Artifact Coverage",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:{...$,paddingBottom:72},children:[e.jsx("h2",{style:{...T,fontSize:27},children:"How the data is collected"}),e.jsxs("div",{style:{display:"grid",gap:24,maxWidth:680},children:[e.jsxs("div",{children:[e.jsx("div",{style:C,children:"Code Availability"}),e.jsx("p",{style:N,children:"For every open-access machine learning paper, we check whether an official code implementation is linked on GitHub. The date axis is the paper's publication date."})]}),e.jsxs("div",{children:[e.jsx("div",{style:C,children:"Hugging Face artifacts"}),e.jsx("p",{style:N,children:"We resolve links between papers and the Hugging Face Hub, counting a paper as covered when it references at least one model, dataset or Space. The date axis is the paper's publication date."})]}),e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,lineHeight:1.6,color:"var(--ink-faint)",margin:"8px 0 0",letterSpacing:"0.02em"},children:"Figures use complete publication months. Historical Hugging Face coverage reflects artifacts currently linked in the catalog."})]})]})]})};export{re as default}; +import{a5 as I,K as X,j as e}from"./index-D6jcIRWs.js";import{u as G}from"./useQuery-CUJUm4FY.js";import{A as J,a as E}from"./alert-2MbxVzGL.js";import{S as P}from"./skeleton-BqkYFmXl.js";class K{constructor(r){this.request=r}trends(){return this.request("/stats/trends")}}const Q=new K(I),m=t=>{const r=/^(\d{4})-(0[1-9]|1[0-2])$/.exec(t);if(!r)return t;const[,s,l]=r;return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][Number(l)-1]} '${s.slice(2)}`},V=()=>Q.trends(),f=980,j=400,x=62,B=26,g=30,Y=58,u=f-x-B,A=j-g-Y,v=g+A,Z=t=>{if(t.length<3)return t.map((s,l)=>`${l?"L":"M"}${s[0]} ${s[1]}`).join(" ");let r=`M${t[0][0]} ${t[0][1]}`;for(let s=0;s{const[a,y]=X.useState(null),i=r.length,b=l[l.length-1],d=n=>x+u*(i===1?0:n/(i-1)),p=n=>g+A*(1-n/b);if(i===0)return null;const R=r.map((n,h)=>[d(h),p(n.percent)]),F=Z(R),_=`${F} L ${d(i-1)} ${v} L ${x} ${v} Z`,w=i<=12?1:Math.ceil(i/8),O=n=>{const h=n.currentTarget.getBoundingClientRect(),S=(n.clientX-h.left)/h.width*f,k=i>1?u/(i-1):u,q=Math.max(0,Math.min(i-1,Math.round((S-x)/k)));y(q)},H=`trend-gradient-${t}`;return e.jsxs("figure",{className:"trend-chart",children:[e.jsxs("div",{className:"trend-chart-visual",children:[e.jsxs("svg",{viewBox:`0 0 ${f} ${j}`,width:"100%",role:"img","aria-label":`${c} by ${o.toLowerCase()}, from ${m(r[0].month)} (${r[0].percent}%) to ${m(r[i-1].month)} (${r[i-1].percent}%)`,style:{display:"block",overflow:"visible",cursor:"crosshair"},onPointerMove:O,onPointerLeave:()=>y(null),children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:H,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",style:{stopColor:s,stopOpacity:.26}}),e.jsx("stop",{offset:"100%",style:{stopColor:s,stopOpacity:.02}})]})}),l.map(n=>e.jsxs("g",{children:[e.jsx("line",{x1:x,x2:f-B,y1:p(n),y2:p(n),stroke:"var(--hairline)",strokeWidth:1}),e.jsxs("text",{x:x-14,y:p(n)+4,textAnchor:"end",style:W,children:[n,"%"]})]},n)),e.jsx("path",{d:_,fill:`url(#${H})`}),e.jsx("path",{d:F,fill:"none",stroke:s,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),r.map((n,h)=>{const S=h===i-1,k=h%w===0&&i-1-h>=w/2;return!S&&!k?null:e.jsx("text",{x:d(h),y:v+24,textAnchor:"middle",style:W,children:m(n.month)},n.month)}),e.jsx("text",{x:x+u/2,y:j-4,textAnchor:"middle",style:z,children:o}),e.jsx("text",{transform:`translate(16 ${g+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:g,y2:v,stroke:s,strokeWidth:1,strokeDasharray:"3 4",opacity:.5}),e.jsx("circle",{cx:d(a),cy:p(r[a].percent),r:5,fill:"var(--bg)",stroke:s,strokeWidth:2})]})]}),a!=null&&e.jsxs("div",{style:{position:"absolute",left:`${d(a)/f*100}%`,top:`${p(r[a].percent)/j*100}%`,transform:"translate(-50%, calc(-100% - 14px))",background:"var(--bg-elevated)",border:"1px solid var(--hairline)",borderRadius:6,boxShadow:"0 8px 26px rgba(0,0,0,.13)",padding:"7px 12px",pointerEvents:"none",whiteSpace:"nowrap",zIndex:3},children:[e.jsx("div",{style:{fontFamily:"var(--serif)",fontStyle:"italic",color:"var(--ink-faint)",fontSize:13,marginBottom:2},children:m(r[a].month)}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:7,fontFamily:"var(--mono)",fontWeight:600,fontSize:15,color:"var(--ink)"},children:[e.jsx("span",{style:{width:8,height:8,borderRadius:2,background:s,display:"inline-block"}}),r[a].percent,"%"]})]})]}),e.jsxs("details",{className:"trend-chart-table",children:[e.jsx("summary",{style:{fontFamily:"var(--mono)",fontSize:11,letterSpacing:"0.04em",color:"var(--ink-faint)",cursor:"pointer"},children:"View data table"}),e.jsxs("table",{style:{marginTop:8,borderCollapse:"collapse",fontFamily:"var(--mono)",fontSize:12,color:"var(--ink-soft)"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{style:{textAlign:"left",padding:"3px 18px 3px 0"},children:o}),e.jsx("th",{style:{textAlign:"right",padding:"3px 0"},children:c})]})}),e.jsx("tbody",{children:r.map(n=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 18px 2px 0"},children:m(n.month)}),e.jsxs("td",{style:{textAlign:"right",padding:"2px 0"},children:[n.percent,"%"]})]},n.month))})]})]})]})},$={maxWidth:960,padding:"48px 0 8px",borderTop:"1px solid var(--hairline)",marginTop:48},T={fontFamily:"var(--serif)",fontSize:34,fontWeight:500,letterSpacing:"-0.02em",margin:"0 0 10px",color:"var(--ink)"},M={fontFamily:"var(--serif)",fontSize:18,lineHeight:1.55,color:"var(--ink-soft)",maxWidth:620,margin:"0 0 8px"},C={fontFamily:"var(--mono)",fontSize:12,fontWeight:600,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--ink-faint)",marginBottom:8},N={fontFamily:"var(--serif)",fontSize:17,lineHeight:1.6,color:"var(--ink-soft)",margin:0},D={height:320,marginTop:26},re=()=>{const t=G({queryKey:["research-trends"],queryFn:V,staleTime:36e5});return e.jsxs("div",{className:"page",children:[e.jsx("div",{className:"feed-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"feed-title",children:["Research ",e.jsx("em",{children:"Trends"})]}),e.jsx("div",{className:"feed-subtitle",children:"How open science is changing across machine learning — tracked over time from arXiv and the Hugging Face Hub."})]})}),t.error&&e.jsx(J,{variant:"destructive",children:e.jsx(E,{children:"Failed to load research trends. Please try again."})}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Code Availability"}),e.jsx("p",{style:M,children:"The percentage of published papers that have at least one official code implementation on GitHub."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(L,{id:"code",data:t.data.code_availability,color:"var(--trend-code)",yTicks:[0,20,40,60,80],yLabel:"Code Availability",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:$,children:[e.jsx("h2",{style:T,children:"Papers with Hugging Face artifacts"}),e.jsx("p",{style:M,children:"The percentage of published papers linked to at least one Hugging Face artifact — a model, dataset or Space — making the work directly runnable and reusable."}),e.jsx("div",{style:{marginTop:26},children:t.data?e.jsx(L,{id:"hf",data:t.data.hf_artifacts,color:"var(--trend-hf)",yTicks:[0,10,20,30,40,50],yLabel:"HF Artifact Coverage",xLabel:"Paper Publication Date"}):!t.error&&e.jsx(P,{style:D})})]}),e.jsxs("section",{style:{...$,paddingBottom:72},children:[e.jsx("h2",{style:{...T,fontSize:27},children:"How the data is collected"}),e.jsxs("div",{style:{display:"grid",gap:24,maxWidth:680},children:[e.jsxs("div",{children:[e.jsx("div",{style:C,children:"Code Availability"}),e.jsx("p",{style:N,children:"For every open-access machine learning paper, we check whether an official code implementation is linked on GitHub. The date axis is the paper's publication date."})]}),e.jsxs("div",{children:[e.jsx("div",{style:C,children:"Hugging Face artifacts"}),e.jsx("p",{style:N,children:"We resolve links between papers and the Hugging Face Hub, counting a paper as covered when it references at least one model, dataset or Space. The date axis is the paper's publication date."})]}),e.jsx("p",{style:{fontFamily:"var(--mono)",fontSize:12,lineHeight:1.6,color:"var(--ink-faint)",margin:"8px 0 0",letterSpacing:"0.02em"},children:"Figures use complete publication months. Historical Hugging Face coverage reflects artifacts currently linked in the catalog."})]})]})]})};export{re as default}; diff --git a/assets/UserProfileView-COPdCmiq.js b/assets/UserProfileView-COPdCmiq.js deleted file mode 100644 index 9b6c1fc2f515fc717730e0ebca8bec913b187cd9..0000000000000000000000000000000000000000 --- a/assets/UserProfileView-COPdCmiq.js +++ /dev/null @@ -1 +0,0 @@ -import{au as i,A as n,u as o,j as e,af as d}from"./index-CqKcHUvZ.js";import{u as l}from"./useQuery-Cngk7eL9.js";import{C as c}from"./OrganizationContributionGraph-DUBXw9I0.js";import"./skeleton-DleNhBYA.js";import"./catalog-D26nGNnK.js";const p={async get(t){const a=await i(`/profiles/${encodeURIComponent(t)}`);if(!a.ok)throw new n(a,await a.text());const r=await a.json();if(!a.redirected)return r;const s=decodeURIComponent(new URL(a.url).pathname.split("/").pop()||r.username);return{...r,username:s,redirected_from_alias:!0}}},j=()=>{const{username:t=""}=o(),a=l({queryKey:["user-profile",t.toLowerCase()],queryFn:()=>p.get(t)});return a.isLoading?e.jsx("div",{className:"page",children:"Loading profile…"}):a.data?a.data.redirected_from_alias?e.jsx(d,{to:`/${a.data.username}`,replace:!0}):e.jsxs("div",{className:"page",style:{maxWidth:960},children:[e.jsxs("h1",{children:["@",a.data.username]}),e.jsx("p",{children:"Canonical Papers with Code contributions"}),e.jsx(c,{data:a.data.calendar,organizationName:`@${a.data.username}`,title:"Canonical contributions",noun:"contribution"}),a.data.is_owner&&e.jsxs("section",{className:"mt-10",children:[e.jsx("h2",{children:"Your submissions"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Limits and duplicate behavior are documented on ",e.jsx("a",{href:"/rate-limits",children:"the policy page"}),"."]}),e.jsx("div",{className:"mt-4 space-y-3",children:a.data.submissions.map(r=>e.jsxs("article",{className:"rounded-md border p-4",children:[e.jsx("strong",{children:r.edit_type})," · ",r.status,e.jsxs("details",{className:"mt-2 text-xs",children:[e.jsx("summary",{children:"Original and applied payload"}),e.jsx("pre",{children:JSON.stringify({proposed:r.proposed_payload,applied:r.applied_payload},null,2)})]}),r.review_reason&&e.jsx("p",{children:r.review_reason})]},r.id))})]})]}):e.jsx("div",{className:"page",children:e.jsx("h1",{children:"Profile not found"})})};export{j as default}; diff --git a/assets/UserProfileView-CrBLP1Jk.js b/assets/UserProfileView-CrBLP1Jk.js new file mode 100644 index 0000000000000000000000000000000000000000..d2969c5cbd230c83e0b77ae15fc1cc87880ad453 --- /dev/null +++ b/assets/UserProfileView-CrBLP1Jk.js @@ -0,0 +1 @@ +import{aQ as n,u as i,j as e,ah as o}from"./index-D6jcIRWs.js";import{u as d}from"./useQuery-CUJUm4FY.js";import{C as l}from"./OrganizationContributionGraph-DzcTqxNw.js";import"./skeleton-BqkYFmXl.js";import"./catalog-PYrB8_bm.js";const c={async get(s){const a=await n(`/profiles/${encodeURIComponent(s)}`),r=await a.json();if(!a.redirected)return r;const t=decodeURIComponent(new URL(a.url).pathname.split("/").pop()||r.username);return{...r,username:t,redirected_from_alias:!0}}},j=()=>{const{username:s=""}=i(),a=d({queryKey:["user-profile",s.toLowerCase()],queryFn:()=>c.get(s)});return a.isLoading?e.jsx("div",{className:"page",children:"Loading profile…"}):a.data?a.data.redirected_from_alias?e.jsx(o,{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(l,{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{j as default}; diff --git a/assets/activity-DDb7qU7w.js b/assets/activity-5IcAhZoH.js similarity index 89% rename from assets/activity-DDb7qU7w.js rename to assets/activity-5IcAhZoH.js index 95aff44cdf8f129b1ab3d6e98c1e2044619507df..742841b0480693c164c328ed8621cd39daed5ec9 100644 --- a/assets/activity-DDb7qU7w.js +++ b/assets/activity-5IcAhZoH.js @@ -1,4 +1,4 @@ -import{n as t}from"./index-CqKcHUvZ.js";/** +import{n as t}from"./index-D6jcIRWs.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/alert-Z2yFUcyL.js b/assets/alert-2MbxVzGL.js similarity index 92% rename from assets/alert-Z2yFUcyL.js rename to assets/alert-2MbxVzGL.js index d58f58875c7dfc87511bf534a490ec4bdbc8abb2..301dfa849663d31f4471c158c511e93f3e962b52 100644 --- a/assets/alert-Z2yFUcyL.js +++ b/assets/alert-2MbxVzGL.js @@ -1 +1 @@ -import{r as a,j as s,B as l,a5 as i}from"./index-CqKcHUvZ.js";const o=i("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),n=a.forwardRef(({className:e,variant:t,...r},d)=>s.jsx("div",{ref:d,role:"alert",className:l(o({variant:t}),e),...r}));n.displayName="Alert";const v=a.forwardRef(({className:e,...t},r)=>s.jsx("h5",{ref:r,className:l("mb-1 font-medium leading-none tracking-tight",e),...t}));v.displayName="AlertTitle";const c=a.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:l("text-sm [&_p]:leading-relaxed",e),...t}));c.displayName="AlertDescription";export{n as A,c as a}; +import{r as a,j as s,B as l,a7 as i}from"./index-D6jcIRWs.js";const o=i("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),n=a.forwardRef(({className:e,variant:t,...r},d)=>s.jsx("div",{ref:d,role:"alert",className:l(o({variant:t}),e),...r}));n.displayName="Alert";const v=a.forwardRef(({className:e,...t},r)=>s.jsx("h5",{ref:r,className:l("mb-1 font-medium leading-none tracking-tight",e),...t}));v.displayName="AlertTitle";const c=a.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:l("text-sm [&_p]:leading-relaxed",e),...t}));c.displayName="AlertDescription";export{n as A,c as a}; diff --git a/assets/arrow-left-D_tIkkPW.js b/assets/arrow-left-IzGlownM.js similarity index 86% rename from assets/arrow-left-D_tIkkPW.js rename to assets/arrow-left-IzGlownM.js index 6fe810301d2df53ea650191a347d44037d1eaf8e..2764467a06d5608f33c227f0c971168065d214ec 100644 --- a/assets/arrow-left-D_tIkkPW.js +++ b/assets/arrow-left-IzGlownM.js @@ -1,4 +1,4 @@ -import{n as e}from"./index-CqKcHUvZ.js";/** +import{n as e}from"./index-D6jcIRWs.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/arrow-right-DCfHXCdw.js b/assets/arrow-right-CFRHnFt4.js similarity index 86% rename from assets/arrow-right-DCfHXCdw.js rename to assets/arrow-right-CFRHnFt4.js index 3453000df2460bcac74a56154d9bac52f2473937..35f3140d77186f721cb2c0141993bfc843a2d2f9 100644 --- a/assets/arrow-right-DCfHXCdw.js +++ b/assets/arrow-right-CFRHnFt4.js @@ -1,4 +1,4 @@ -import{n as r}from"./index-CqKcHUvZ.js";/** +import{n as r}from"./index-D6jcIRWs.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/badge-D-oq0Pkj.js b/assets/badge-t4oak8yc.js similarity index 90% rename from assets/badge-D-oq0Pkj.js rename to assets/badge-t4oak8yc.js index ee611870862e2f5cc1c033c9e99fdd77f1432e62..d9ae8aa0b1157f4f25648feb74d9e9b10cffeef3 100644 --- a/assets/badge-D-oq0Pkj.js +++ b/assets/badge-t4oak8yc.js @@ -1 +1 @@ -import{j as n,B as o,a5 as a}from"./index-CqKcHUvZ.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,B as o,a7 as a}from"./index-D6jcIRWs.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-BYn4yUH_.js b/assets/button-Bzx0ccHH.js similarity index 89% rename from assets/button-BYn4yUH_.js rename to assets/button-Bzx0ccHH.js index dbf0baa06dc15e46dcd2f8baba47fdd723222f6d..b439e4abf0da1f3bd720161d2a3e160af6bd05e3 100644 --- a/assets/button-BYn4yUH_.js +++ b/assets/button-Bzx0ccHH.js @@ -1 +1 @@ -import{r as a,j as d,av as u,B as c,a5 as f}from"./index-CqKcHUvZ.js";const g=f("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),v=a.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...o},s)=>{const i=n?u:"button";return d.jsx(i,{className:c(g({variant:t,size:r,className:e})),ref:s,...o})});v.displayName="Button";export{v as B}; +import{r as a,j as d,ax as u,B as c,a7 as f}from"./index-D6jcIRWs.js";const g=f("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),v=a.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...o},s)=>{const i=n?u:"button";return d.jsx(i,{className:c(g({variant:t,size:r,className:e})),ref:s,...o})});v.displayName="Button";export{v as B}; diff --git a/assets/catalog-D26nGNnK.js b/assets/catalog-PYrB8_bm.js similarity index 97% rename from assets/catalog-D26nGNnK.js rename to assets/catalog-PYrB8_bm.js index 1111192c37ab6936c09a1a6b1d8f843c2ff7df35..24c1707cd414575a516ddbd6492971f38151980c 100644 --- a/assets/catalog-D26nGNnK.js +++ b/assets/catalog-PYrB8_bm.js @@ -1 +1 @@ -import{a3 as o}from"./index-CqKcHUvZ.js";function s(a,e){const t=new URLSearchParams;for(const[i,n]of Object.entries(e??{}))n!==void 0&&n!==""&&t.set(i,String(n));const r=t.toString();return`${a}${r?`?${r}`:""}`}class u{constructor(e){this.request=e}listAreas(e){return this.request(s("/areas/",e))}getArea(e){return this.request(`/areas/${e}`)}areasWithTasks(){return this.request("/areas/with-tasks/")}listTasks(e){return this.request(s("/tasks/",e))}getTask(e){return this.request(`/tasks/${e}`)}topTasks(e){return this.request(s("/tasks/top",{limit:e}))}trendingTasks(e){return this.request(s("/tasks/trending",e))}taskChildren(e,t){return this.request(s(`/tasks/${e}/children`,t))}taskParents(e){return this.request(`/tasks/${e}/parents`)}taskPage(e,t){return this.request(s(`/tasks/${e}/page`,t))}trendingBenchmarks(e,t){return this.request(s(`/tasks/${encodeURIComponent(e)}/trending-benchmarks`,t))}frameworkCatalog(){return this.request("/frameworks/")}listMethods(e){return this.request(s("/methods/",e))}methodIndex(){return this.request("/methods/index/cards")}trendingMethods(e){return this.request(s("/methods/trending",e))}getMethod(e){return this.request(`/methods/${encodeURIComponent(e)}`)}relatedMethods(e){return this.request(`/methods/${encodeURIComponent(e)}/related`)}methodTrend(e,t){return this.request(s(`/methods/${encodeURIComponent(e)}/trend`,t))}listDatasets(e){const{task_id:t,...r}=e??{};return this.request(s("/datasets/",{...r,task:r.task??t}))}getDataset(e){return this.request(`/datasets/${e}`)}getDatasetBySlug(e,t){return this.request(s(`/datasets/${e}`,t))}async datasetTasks(e){return(await this.request(`/datasets/${e}/tasks/`)).results}async leaderboardMetrics(e,t){return(await this.request(`/datasets/${e}/tasks/${t}/metrics`)).metrics}metricDirections(){return this.request("/metrics/directions")}conferences(){return this.request("/conferences/")}conferenceDeadlines(){return this.request("/conferences/deadlines")}getConference(e){return this.request(`/conferences/${e}`)}conferenceAreasWithTasks(e){return this.request(`/conferences/${e}/areas-with-tasks`)}organizations(e=!1){return this.request(`/organizations/${e?"?featured_only=true":""}`)}searchOrganizations(e,t){return this.request(s("/organizations/",{q:e,limit:t}))}organizationIndex(){return this.request("/organizations/index/cards")}getOrganization(e){return this.request(`/organizations/${e}`)}organizationContributions(e){return this.request(`/organizations/${e}/contributions`)}organizationAreasWithTasks(e){return this.request(`/organizations/${e}/areas-with-tasks`)}audit(e){return this.request(s("/admin/catalog-audit",{cursor:e}))}acknowledgeAudit(){return this.request("/admin/catalog-audit/acknowledge",{method:"POST"})}rollbackEvent(e){return this.request(`/admin/catalog-audit/${e}/rollback`,{method:"POST"})}}const d=new u(o);export{d as c}; +import{a5 as o}from"./index-D6jcIRWs.js";function s(a,e){const t=new URLSearchParams;for(const[i,n]of Object.entries(e??{}))n!==void 0&&n!==""&&t.set(i,String(n));const r=t.toString();return`${a}${r?`?${r}`:""}`}class u{constructor(e){this.request=e}listAreas(e){return this.request(s("/areas/",e))}getArea(e){return this.request(`/areas/${e}`)}areasWithTasks(){return this.request("/areas/with-tasks/")}listTasks(e){return this.request(s("/tasks/",e))}getTask(e){return this.request(`/tasks/${e}`)}topTasks(e){return this.request(s("/tasks/top",{limit:e}))}trendingTasks(e){return this.request(s("/tasks/trending",e))}taskChildren(e,t){return this.request(s(`/tasks/${e}/children`,t))}taskParents(e){return this.request(`/tasks/${e}/parents`)}taskPage(e,t){return this.request(s(`/tasks/${e}/page`,t))}trendingBenchmarks(e,t){return this.request(s(`/tasks/${encodeURIComponent(e)}/trending-benchmarks`,t))}frameworkCatalog(){return this.request("/frameworks/")}listMethods(e){return this.request(s("/methods/",e))}methodIndex(){return this.request("/methods/index/cards")}trendingMethods(e){return this.request(s("/methods/trending",e))}getMethod(e){return this.request(`/methods/${encodeURIComponent(e)}`)}relatedMethods(e){return this.request(`/methods/${encodeURIComponent(e)}/related`)}methodTrend(e,t){return this.request(s(`/methods/${encodeURIComponent(e)}/trend`,t))}listDatasets(e){const{task_id:t,...r}=e??{};return this.request(s("/datasets/",{...r,task:r.task??t}))}getDataset(e){return this.request(`/datasets/${e}`)}getDatasetBySlug(e,t){return this.request(s(`/datasets/${e}`,t))}async datasetTasks(e){return(await this.request(`/datasets/${e}/tasks/`)).results}async leaderboardMetrics(e,t){return(await this.request(`/datasets/${e}/tasks/${t}/metrics`)).metrics}metricDirections(){return this.request("/metrics/directions")}conferences(){return this.request("/conferences/")}conferenceDeadlines(){return this.request("/conferences/deadlines")}getConference(e){return this.request(`/conferences/${e}`)}conferenceAreasWithTasks(e){return this.request(`/conferences/${e}/areas-with-tasks`)}organizations(e=!1){return this.request(`/organizations/${e?"?featured_only=true":""}`)}searchOrganizations(e,t){return this.request(s("/organizations/",{q:e,limit:t}))}organizationIndex(){return this.request("/organizations/index/cards")}getOrganization(e){return this.request(`/organizations/${e}`)}organizationContributions(e){return this.request(`/organizations/${e}/contributions`)}organizationAreasWithTasks(e){return this.request(`/organizations/${e}/areas-with-tasks`)}audit(e){return this.request(s("/admin/catalog-audit",{cursor:e}))}acknowledgeAudit(){return this.request("/admin/catalog-audit/acknowledge",{method:"POST"})}rollbackEvent(e){return this.request(`/admin/catalog-audit/${e}/rollback`,{method:"POST"})}}const d=new u(o);export{d as c}; diff --git a/assets/chat-DGBJkcmd.js b/assets/chat-ChnK8XDU.js similarity index 97% rename from assets/chat-DGBJkcmd.js rename to assets/chat-ChnK8XDU.js index ad8830eab90d63b3039eafd61e0b8c356d05bdeb..1cc748172ed3a53595f75d792d84fb48d288b393 100644 --- a/assets/chat-DGBJkcmd.js +++ b/assets/chat-ChnK8XDU.js @@ -1 +1 @@ -import{a3 as n,au as r}from"./index-CqKcHUvZ.js";class o{constructor(e){this.request=e}listSessions(e){const t=new URLSearchParams({limit:"50"});return e&&t.set("cursor",e),this.request(`/chat/sessions?${t.toString()}`)}createSession(e,t="low"){return this.request("/chat/sessions",{method:"POST",body:JSON.stringify({selected_model:e||null,reasoning_effort:t})})}getSession(e){return this.request(`/chat/sessions/${e}`)}updateSession(e,t){return this.request(`/chat/sessions/${e}`,{method:"PATCH",body:JSON.stringify(t)})}removeSession(e){return this.request(`/chat/sessions/${e}`,{method:"DELETE"})}archiveOldChats(){return this.request("/chat/sessions/archive-old",{method:"POST"})}archiveOldestChats(){return this.request("/chat/sessions/archive-oldest",{method:"POST"})}cancelSession(e){return this.request(`/chat/sessions/${e}/cancel`,{method:"POST"})}createOrRefreshShare(e){return this.request(`/chat/sessions/${e}/share`,{method:"POST"})}getSessionPublicShare(e){return this.request(`/chat/sessions/${encodeURIComponent(e)}/public-share`,{credentials:"omit"})}getSharedChat(e){return this.request(`/chat/shares/${encodeURIComponent(e)}`,{credentials:"omit"})}getModels(){return this.request("/chat/models")}getUsage(){return this.request("/chat/usage",{cache:"no-store"})}getOpenAIUsage(){return this.request("/chat/openai-usage",{cache:"no-store"})}getAvailability(){return this.request("/chat/availability",{cache:"no-store"})}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 r(`/chat/latency/${encodeURIComponent(e)}`,{method:"POST",keepalive:!0,body:JSON.stringify(t)})}reportFeedback(e,t,s){return this.request(`/chat/messages/${encodeURIComponent(e)}/feedback`,{method:"POST",body:JSON.stringify({value:t,...s?{comment:s}:{}})})}stream(e,t){return r("/chat/stream",{method:"POST",headers:{Accept:"text/event-stream"},body:JSON.stringify(e),signal:t})}resumeStream(e,t,s){return r(`/chat/sessions/${encodeURIComponent(e)}/stream`,{method:"GET",headers:{Accept:"text/event-stream",...s&&s>0?{"Last-Event-ID":String(s)}:{}},signal:t})}}const h=new o(n);export{h as c}; +import{a5 as n,aw as r}from"./index-D6jcIRWs.js";class o{constructor(e){this.request=e}listSessions(e){const t=new URLSearchParams({limit:"50"});return e&&t.set("cursor",e),this.request(`/chat/sessions?${t.toString()}`)}createSession(e,t="low"){return this.request("/chat/sessions",{method:"POST",body:JSON.stringify({selected_model:e||null,reasoning_effort:t})})}getSession(e){return this.request(`/chat/sessions/${e}`)}updateSession(e,t){return this.request(`/chat/sessions/${e}`,{method:"PATCH",body:JSON.stringify(t)})}removeSession(e){return this.request(`/chat/sessions/${e}`,{method:"DELETE"})}archiveOldChats(){return this.request("/chat/sessions/archive-old",{method:"POST"})}archiveOldestChats(){return this.request("/chat/sessions/archive-oldest",{method:"POST"})}cancelSession(e){return this.request(`/chat/sessions/${e}/cancel`,{method:"POST"})}createOrRefreshShare(e){return this.request(`/chat/sessions/${e}/share`,{method:"POST"})}getSessionPublicShare(e){return this.request(`/chat/sessions/${encodeURIComponent(e)}/public-share`,{credentials:"omit"})}getSharedChat(e){return this.request(`/chat/shares/${encodeURIComponent(e)}`,{credentials:"omit"})}getModels(){return this.request("/chat/models")}getUsage(){return this.request("/chat/usage",{cache:"no-store"})}getOpenAIUsage(){return this.request("/chat/openai-usage",{cache:"no-store"})}getAvailability(){return this.request("/chat/availability",{cache:"no-store"})}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 r(`/chat/latency/${encodeURIComponent(e)}`,{method:"POST",keepalive:!0,body:JSON.stringify(t)})}reportFeedback(e,t,s){return this.request(`/chat/messages/${encodeURIComponent(e)}/feedback`,{method:"POST",body:JSON.stringify({value:t,...s?{comment:s}:{}})})}stream(e,t){return r("/chat/stream",{method:"POST",headers:{Accept:"text/event-stream"},body:JSON.stringify(e),signal:t})}resumeStream(e,t,s){return r(`/chat/sessions/${encodeURIComponent(e)}/stream`,{method:"GET",headers:{Accept:"text/event-stream",...s&&s>0?{"Last-Event-ID":String(s)}:{}},signal:t})}}const h=new o(n);export{h as c}; diff --git a/assets/chatSessions-D75G2_U7.js b/assets/chatSessions-DByIWBno.js similarity index 99% rename from assets/chatSessions-D75G2_U7.js rename to assets/chatSessions-DByIWBno.js index 9181fc9ac2f396cbb9210e7f7938005c8157ff7e..226b269ec1f2ab573dd99dd4f9ff47254ae673bc 100644 --- a/assets/chatSessions-D75G2_U7.js +++ b/assets/chatSessions-DByIWBno.js @@ -1,4 +1,4 @@ -import{j as h,K as f,A as ee,a2 as Oe}from"./index-CqKcHUvZ.js";import{u as te}from"./useQuery-Cngk7eL9.js";import{c as m}from"./chat-DGBJkcmd.js";import{a as be}from"./papers-bE3C_Qzl.js";const Qe=({light:e})=>h.jsx("span",{className:`chat-spinner${e?" chat-spinner-light":""}`}),Je=({open:e})=>h.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:h.jsx("path",{d:"m6 9 6 6 6-6"})}),Ze=()=>h.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[h.jsx("circle",{cx:"12",cy:"12",r:"9"}),h.jsx("path",{d:"m9 12 2 2 4-4"})]}),et=({size:e=14})=>h.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[h.jsx("circle",{cx:"11",cy:"11",r:"7"}),h.jsx("path",{d:"m21 21-4.3-4.3"})]}),tt=()=>h.jsx("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",children:h.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})}),rt=()=>h.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:h.jsx("path",{d:"M12 5v14M5 12h14"})}),nt=()=>h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[h.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),h.jsx("path",{d:"M9 4v16"})]}),at=()=>h.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:h.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"})}),ot=({text:e,mentions:t,scrollTop:n=0,variant:r="composer",completion:a=""})=>{const i=[];let s=0;for(const o of[...t].sort((u,d)=>u.start-d.start)){const u=e.slice(o.start,o.end),d=u===o.title||u===`@${o.title}`;o.starte.length||!d||(i.push(e.slice(s,o.start)),i.push(h.jsx("span",{className:`chat-paper-inline-highlight${o.unavailable?" is-unavailable":""}`,"data-paper-route-id":o.route_id,children:u},o.key)),s=o.end)}return i.push(e.slice(s)),a&&i.push(h.jsx("span",{className:"chat-prompt-completion",children:a},"completion")),e.endsWith(` +import{j as h,K as f,A as ee,a4 as Oe}from"./index-D6jcIRWs.js";import{u as te}from"./useQuery-CUJUm4FY.js";import{c as m}from"./chat-ChnK8XDU.js";import{a as be}from"./papers-DIIIPDpj.js";const Qe=({light:e})=>h.jsx("span",{className:`chat-spinner${e?" chat-spinner-light":""}`}),Je=({open:e})=>h.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:h.jsx("path",{d:"m6 9 6 6 6-6"})}),Ze=()=>h.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[h.jsx("circle",{cx:"12",cy:"12",r:"9"}),h.jsx("path",{d:"m9 12 2 2 4-4"})]}),et=({size:e=14})=>h.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[h.jsx("circle",{cx:"11",cy:"11",r:"7"}),h.jsx("path",{d:"m21 21-4.3-4.3"})]}),tt=()=>h.jsx("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",children:h.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})}),rt=()=>h.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:h.jsx("path",{d:"M12 5v14M5 12h14"})}),nt=()=>h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[h.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),h.jsx("path",{d:"M9 4v16"})]}),at=()=>h.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:h.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"})}),ot=({text:e,mentions:t,scrollTop:n=0,variant:r="composer",completion:a=""})=>{const i=[];let s=0;for(const o of[...t].sort((u,d)=>u.start-d.start)){const u=e.slice(o.start,o.end),d=u===o.title||u===`@${o.title}`;o.starte.length||!d||(i.push(e.slice(s,o.start)),i.push(h.jsx("span",{className:`chat-paper-inline-highlight${o.unavailable?" is-unavailable":""}`,"data-paper-route-id":o.route_id,children:u},o.key)),s=o.end)}return i.push(e.slice(s)),a&&i.push(h.jsx("span",{className:"chat-prompt-completion",children:a},"completion")),e.endsWith(` `)&&i.push("​"),h.jsx("div",{"aria-hidden":"true",className:`chat-paper-highlight-layer chat-paper-highlight-layer-${r}`,children:h.jsx("div",{style:{transform:`translateY(-${n}px)`},children:i})})},st=({open:e,query:t,results:n,activeIndex:r,loading:a,error:i,onSelect:s,id:o="chat-paper-picker",optionIdPrefix:u="chat-paper-option"})=>{if(!e)return null;const d=t.trim()?a?"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 h.jsxs("div",{className:"chat-paper-picker",id:o,role:"listbox","aria-label":"Paper results",children:[h.jsx("div",{className:"chat-paper-picker-status",role:"status","aria-live":"polite",children:d}),n.map((p,l)=>{const O=p.arxiv_id||p.id,k=p.arxiv_id||(()=>{try{return p.source_url?new URL(p.source_url).hostname:"External resource"}catch{return"External resource"}})();return h.jsxs("button",{type:"button",id:`${u}-${l}`,role:"option","aria-selected":l===r,className:`chat-paper-option${l===r?" is-active":""}`,onMouseDown:P=>{P.preventDefault(),s(p)},children:[h.jsx("span",{className:"chat-paper-option-title",children:p.title}),h.jsx("span",{className:"chat-paper-option-meta",children:k})]},O)})]})},Te=["What are decision models?","Find relevant papers on RLVR","What's the state-of-the-art for real-time object detection?"],Ee=[...Te,"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 "],Ce=3,Re=4,xe=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"]),ke=new RegExp(`(?:^|(?<=[\\s("'“‘]))(?=\\S)`,"g"),Ae=e=>{const t=e.toLowerCase(),n=Ee.find(r=>r.length>e.length&&r.toLowerCase().startsWith(t));return n?n.slice(e.length):""},De=(e,t)=>{const n=[...e.matchAll(ke)].map(r=>r.index??0);for(const r of n.slice(-4)){const a=e.slice(r),i=a.toLowerCase(),s=/\s/.test(a);if(a.length<(s?Ce:Re)||!s&&xe.has(i))continue;const o=t.find(u=>u.length>a.length&&u.toLowerCase().startsWith(i));if(o)return o.slice(a.length)}return""},Le=(e,t)=>!e.trim()||/\s$/.test(e)?"":Ae(e)||De(e,t);function it(e,t=!1){var p;const n=e.text,[r,a]=f.useState(null),i=te({queryKey:["chatAutocompleteVocabulary"],queryFn:()=>m.getAutocompleteVocabulary(),enabled:n.length>0,staleTime:1/0,gcTime:1/0,retry:!1}),s=(r==null?void 0:r.text)===n?r.atEnd:!0,o=e.paperMentions.some(l=>l.end===n.length);return{completion:!t&&s&&!o?Le(n,((p=i.data)==null?void 0:p.names)??[]):"",trackCaret:l=>a({text:l.value,atEnd:l.selectionStart===l.selectionEnd&&l.selectionEnd===l.value.length})}}const ct=e=>e.key==="Tab"&&!e.shiftKey&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.nativeEvent.isComposing,lt=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)},re=8e3,ne=16384,ae=1e4,E={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 oe(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 ut(e){return`${e.routeId}\0${e.paperVersion}\0${e.page}\0${e.text}`}function dt(e){return{route_id:e.routeId,paper_version:e.paperVersion,page:e.page,text:e.text}}function L(e="",t){return t?{text:e,paperMentions:[],paperSelection:t}:{text:e,paperMentions:[]}}function V(e,t,n){return e.paperSelection?{text:t,paperMentions:n,paperSelection:e.paperSelection}:{text:t,paperMentions:n}}function Pe(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>ae||typeof t.text!="string")return;const r=se(t.text);if(r&&!(r.length>re)&&!(oe(r)>ne))return{routeId:t.routeId.trim(),paperVersion:t.paperVersion.trim(),page:n,text:r}}function Ie(e,t){if(typeof e=="string")return L(e);if(!e||typeof e!="object")return t===void 0?null:L(t);const n=e;if(typeof n.text!="string"||!Array.isArray(n.paperMentions))return t===void 0?null:L(t);const r=Pe(n.paperSelection);return r?{text:n.text,paperMentions:n.paperMentions,paperSelection:r}:{text:n.text,paperMentions:n.paperMentions}}function ie(e){return e?e instanceof Element?e:e.parentElement:null}function $(e,t){const n=ie(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 a=Number(r.dataset.page);return!Number.isInteger(a)||a<1||a>ae?null:a}function ht(e){const{selection:t,pagesRoot:n,routeId:r,paperVersion:a,numPages:i}=e;if(!n||!t||t.rangeCount!==1)return t&&t.rangeCount>1?{ok:!1,error:E.crossPage}:{ok:!1,error:null};const s=t.getRangeAt(0);if(s.collapsed)return{ok:!1,error:null};const o=$(s.startContainer,n),u=$(s.endContainer,n),d=ie(s.commonAncestorContainer);if(!d||!n.contains(d))return{ok:!1,error:E.outside};if(o===null||u===null)return{ok:!1,error:E.outside};if(o!==u)return{ok:!1,error:E.crossPage};if(i&&(o<1||o>i))return{ok:!1,error:E.crossPage};const p=t.toString(),l=se(p);return l?l.length>re||oe(l)>ne?{ok:!1,error:E.tooLarge}:{ok:!0,selection:{routeId:r,paperVersion:a,page:o,text:l}}:{ok:!1,error:E.crossPage}}const Ne=10,Me=3;function B(e,t){const r=e.slice(0,t).lastIndexOf("@");if(r<0)return null;const a=r>0?e[r-1]:"";if(a&&/[\p{L}\p{M}\p{N}_@]/u.test(a))return null;const i=e.slice(r+1,t);return/[\n\r@]/.test(i)?null:{start:r,end:t,query:i}}function K(e,t,n){let r=0;for(;ro.end<=r?[o]:o.start>=i?[{...o,start:o.start+s,end:o.end+s}]:[])}function pt({draft:e,onChange:t,enabled:n,textareaRef:r}){var q;const a=`chat-paper-picker-${f.useId().replace(/:/g,"")}`,i=`${a}-option`,[s,o]=f.useState(null),[u,d]=f.useState(""),[p,l]=f.useState(0),[O,k]=f.useState(""),P=f.useRef(new Set);f.useEffect(()=>{n||o(null)},[n]),f.useEffect(()=>{const c=window.setTimeout(()=>d((s==null?void 0:s.query.trim())??""),150);return()=>window.clearTimeout(c)},[s==null?void 0:s.query]);const R=te({queryKey:["chat-paper-mention-search",u.toLowerCase()],queryFn:({signal:c})=>be.search(u,1,10,"hybrid",c),enabled:n&&!!s&&u.length>=1,staleTime:3e4,refetchOnWindowFocus:!1,retry:!1}),_=f.useMemo(()=>{var c;return((c=R.data)==null?void 0:c.results)??[]},[(q=R.data)==null?void 0:q.results]);f.useEffect(()=>l(0),[u]),f.useEffect(()=>{var c;(c=document.getElementById(`${i}-${p}`))==null||c.scrollIntoView({block:"nearest"})},[p,i]);const _e=f.useCallback(c=>{var w;if(!n){o(null);return}const g=c??((w=r.current)==null?void 0:w.selectionStart)??e.text.length;if(e.paperMentions.some(b=>g>b.start&&g<=b.end)){o(null);return}o(B(e.text,g))},[e.paperMentions,e.text,n,r]),we=f.useCallback((c,g)=>{var A;const w=K(e.text,c,e.paperMentions),b=V(e,c,w);t(b);const T=g??((A=r.current)==null?void 0:A.selectionStart)??c.length;n&&!w.some(D=>T>D.start&&T<=D.end)?o(B(c,T)):o(null)},[e,n,t,r]),j=f.useCallback(c=>{if(!s)return!1;const g=c.arxiv_id||c.id,w=new Set(e.paperMentions.map(x=>x.route_id));if(e.paperMentions.length>=Ne)return k("A message can contain at most 10 paper mentions."),!1;if(!w.has(g)&&w.size>=Me)return k("A message can attach at most 3 distinct papers."),!1;const b=c.title,T=e.text.slice(s.end),A=T.length===0,D=e.text.slice(0,s.start)+b+(A?" ":"")+T,Se=K(e.text,D,e.paperMentions),H={key:crypto.randomUUID(),route_id:g,title:c.title,source:c.source==="external"?"external":"arxiv",start:s.start,end:s.start+b.length};return t(V(e,D,[...Se,H].sort((x,I)=>x.start-I.start))),o(null),k(""),window.requestAnimationFrame(()=>{var I,U;const x=H.end+(A||T.startsWith(" ")?1:0);(I=r.current)==null||I.focus(),(U=r.current)==null||U.setSelectionRange(x,x)}),P.current.has(g)||(P.current.add(g),m.prewarmPaperContext(g).catch(()=>{})),!0},[s,e,t,r]),ve=f.useCallback(c=>!s||c.nativeEvent.isComposing?!1:c.key==="Tab"?(o(null),!1):c.key==="Escape"?(c.preventDefault(),o(null),!0):c.key==="ArrowDown"||c.key==="ArrowUp"?(c.preventDefault(),_.length&&l(g=>c.key==="ArrowDown"?(g+1)%_.length:(g-1+_.length)%_.length),!0):c.key==="Home"&&_.length?(c.preventDefault(),l(0),!0):c.key==="End"&&_.length?(c.preventDefault(),l(_.length-1),!0):c.key==="Enter"&&!c.shiftKey?(c.preventDefault(),_[p]?j(_[p]):R.isFetching||o(null),!0):!1,[s,p,_,R.isFetching,j]);return{open:!!s,query:(s==null?void 0:s.query)??"",results:_,activeIndex:p,loading:R.isFetching,error:R.isError,message:O,pickerId:a,optionIdPrefix:i,updateText:we,refresh:_e,select:j,keyDown:ve,close:()=>o(null)}}const y=(e,t)=>new Promise(n=>{const r=setTimeout(a,e);function a(){t==null||t.removeEventListener("abort",a),clearTimeout(r),n()}t==null||t.addEventListener("abort",a)}),v=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}),S={name:"Object Detection",slug:"object-detection"},C={name:"Real-Time Object Detection",slug:"real-time-object-detection"},Ye={"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:v({arxiv_id:"2502.12524",authors:[{name:"Y. Tian"},{name:"Q. Ye"},{name:"D. Doermann"}],published:"2025-02-18",citation_count:412,tasks:[S,C],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:v({arxiv_id:"2407.17140",authors:[{name:"W. Lv"},{name:"Y. Zhao"},{name:"J. Chang"}],published:"2024-07-24",citation_count:268,tasks:[S,C],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:v({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:[S,C],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:v({arxiv_id:"2406.03459",authors:[{name:"Q. Chen"},{name:"X. Su"},{name:"X. Zhang"}],published:"2024-06-05",citation_count:94,tasks:[S,C],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:v({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:[S,C],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:v({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:[S,C],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:v({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"},S],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:v({source:"external",source_url:"https://docs.ultralytics.com/models/",authors:[{name:"Ultralytics"}],published:"2025-01-02",tasks:[S,C],repositories:[{url:"https://github.com/ultralytics/ultralytics",stars:46e3}],project_pages:[{url:"https://docs.ultralytics.com"}]})}},ce=e=>e.map(t=>Ye[t]),G=ce(["2502.12524","2407.17140","2410.13842","2406.03459","2304.08069","2405.14458","2401.17270","158342"]),z=ce(["2410.13842","2502.12524","2407.17140","2405.14458","2304.08069"]),X="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.",Q="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.",J=`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. diff --git a/assets/chevron-up-CZWX0SDx.js b/assets/chevron-up-CQKUhZ0S.js similarity index 91% rename from assets/chevron-up-CZWX0SDx.js rename to assets/chevron-up-CQKUhZ0S.js index 953ff05d1c81715c02e555e0dfe8cca60585bbb7..604d7d6f5bc7036e80753a5444d3bac2ae5c44ca 100644 --- a/assets/chevron-up-CZWX0SDx.js +++ b/assets/chevron-up-CQKUhZ0S.js @@ -1,4 +1,4 @@ -import{n as o}from"./index-CqKcHUvZ.js";/** +import{n as o}from"./index-D6jcIRWs.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/circle-check-BYRHMG9x.js b/assets/circle-check-BZn9Lr76.js similarity index 87% rename from assets/circle-check-BYRHMG9x.js rename to assets/circle-check-BZn9Lr76.js index 71dd361f7c49b348d423b1a4186742438412339c..88b4fd069dab5c1754911da2c3661c052d399188 100644 --- a/assets/circle-check-BYRHMG9x.js +++ b/assets/circle-check-BZn9Lr76.js @@ -1,4 +1,4 @@ -import{n as c}from"./index-CqKcHUvZ.js";/** +import{n as c}from"./index-D6jcIRWs.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/codex-P8vYbo4B.js b/assets/codex-P8vYbo4B.js new file mode 100644 index 0000000000000000000000000000000000000000..44f427e2ae2696073a3343831f0dcc31aa140a6d --- /dev/null +++ b/assets/codex-P8vYbo4B.js @@ -0,0 +1 @@ +import{a5 as i,$ as c}from"./index-D6jcIRWs.js";const u="No paper text was available yet. This job starts again automatically within an hour of the paper's Markdown being extracted.",r="/admin/codex-curation/jobs";class n{constructor(e){this.request=e}startPaperJob(e,t){return this.request(`/admin/codex-${e}/jobs`,{method:"POST",body:JSON.stringify({paper_id:t})})}getPaperJob(e,t){return this.request(`/admin/codex-${e}/jobs/${t}`)}cancelPaperJob(e,t){return this.request(`/admin/codex-${e}/jobs/${t}`,{method:"DELETE"})}listJobs(e=100,t={}){const a=new URLSearchParams({limit:String(e)});return Object.entries(t).forEach(([o,s])=>{s&&a.set(o,s)}),this.request(`${r}?${a}`,{cache:"no-store"})}retryJob(e){return this.request(`${r}/${e}/retry`,{method:"POST"})}cancelJob(e){return this.request(`${r}/${e}`,{method:"DELETE"})}async retryTrace(e){await this.request(`${r}/${e}/retry-trace`,{method:"POST"})}async setScheduler(e){await this.request(`${r}/scheduler/${e}`,{method:"POST"})}async promoteBenchmarkCandidate(e,t){await this.request(`${r}/benchmark-candidates/${e}/promote`,{method:"POST",body:JSON.stringify(t)})}async rollbackBenchmarkCandidate(e){await this.request(`${r}/benchmark-candidates/${e}/rollback`,{method:"POST"})}traceUrl(e){return c(`/api/v1${r}/${e}/trace`)}}const m=new n(i);export{u as A,m as c}; diff --git a/assets/codexAddEvals-BaTB12JK.js b/assets/codexAddEvals-BaTB12JK.js deleted file mode 100644 index 2538aff1a5b94e5403fbbe1cb3644d0024f5cea4..0000000000000000000000000000000000000000 --- a/assets/codexAddEvals-BaTB12JK.js +++ /dev/null @@ -1 +0,0 @@ -import{Z as n}from"./index-CqKcHUvZ.js";const l="No paper text was available yet. This job starts again automatically within an hour of the paper's Markdown being extracted.";async function u(e,a){const t=await fetch(n(`/api/v1/admin/codex-curation/jobs/benchmark-candidates/${e}/promote`),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!t.ok){const o=await t.json().catch(()=>null);throw new Error((o==null?void 0:o.detail)??`Could not promote benchmark candidate (${t.status}).`)}}async function p(e){const a=await fetch(n(`/api/v1/admin/codex-curation/jobs/benchmark-candidates/${e}/rollback`),{method:"POST",credentials:"include"});if(!a.ok){const t=await a.json().catch(()=>null);throw new Error((t==null?void 0:t.detail)??`Could not roll back benchmark candidate (${a.status}).`)}}function h(){const e="0".toLowerCase();return e==="1"||e==="true"||e==="yes"}function f(){const e="0".toLowerCase();return e==="1"||e==="true"||e==="yes"}async function r(e){var o;if(e.ok)return await e.json();const a=await e.json().catch(()=>null),t=((o=a==null?void 0:a.detail)==null?void 0:o.message)??(a==null?void 0:a.detail);throw new Error(typeof t=="string"?t:"Could not run Codex.")}async function m(e){const a=await fetch(n("/api/v1/admin/codex-add-evals/jobs"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({paper_id:e})});return r(a)}async function w(e){const a=await fetch(n(`/api/v1/admin/codex-add-evals/jobs/${e}`),{credentials:"include"});return r(a)}async function b(e){return r(await fetch(n(`/api/v1/admin/codex-add-evals/jobs/${e}`),{method:"DELETE",credentials:"include"}))}async function x(e){const a=await fetch(n("/api/v1/admin/codex-enrich-paper/jobs"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({paper_id:e})});return r(a)}async function y(e){const a=await fetch(n(`/api/v1/admin/codex-enrich-paper/jobs/${e}`),{credentials:"include"});return r(a)}async function C(e){return r(await fetch(n(`/api/v1/admin/codex-enrich-paper/jobs/${e}`),{method:"DELETE",credentials:"include"}))}async function E(e=100,a={}){const t=new URLSearchParams({limit:String(e)});Object.entries(a).forEach(([i,s])=>{s&&t.set(i,s)});const o=await fetch(n(`/api/v1/admin/codex-curation/jobs?${t}`),{credentials:"include",cache:"no-store"});if(o.ok)return await o.json();const c=new Error(`Could not load Codex jobs (${o.status}).`);throw Object.assign(c,{status:o.status}),c}async function j(e){return r(await fetch(n(`/api/v1/admin/codex-curation/jobs/${e}/retry`),{method:"POST",credentials:"include"}))}async function v(e){const a=await fetch(n(`/api/v1/admin/codex-curation/jobs/${e}/retry-trace`),{method:"POST",credentials:"include"});if(!a.ok)throw new Error(`Could not retry trace upload (${a.status}).`)}async function k(e){return r(await fetch(n(`/api/v1/admin/codex-curation/jobs/${e}`),{method:"DELETE",credentials:"include"}))}async function S(e){const a=await fetch(n(`/api/v1/admin/codex-curation/jobs/scheduler/${e}`),{method:"POST",credentials:"include"});if(!a.ok)throw new Error(`Could not ${e} scheduled curation (${a.status}).`)}export{l as A,b as a,w as b,C as c,m as d,f as e,k as f,y as g,v as h,h as i,S as j,p as k,E as l,u as p,j as r,x as s}; diff --git a/assets/colors-_scCXfCe.js b/assets/colors-CLwl8a2d.js similarity index 99% rename from assets/colors-_scCXfCe.js rename to assets/colors-CLwl8a2d.js index 524ead7a3cc8d2556f5c59acb1c9104a5c28b549..97d85e6b4c9474e72279b0116bcd0e79d1250fb4 100644 --- a/assets/colors-_scCXfCe.js +++ b/assets/colors-CLwl8a2d.js @@ -1 +1 @@ -import{W as _}from"./index-CqKcHUvZ.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 C(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const at={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},it={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ot={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},st={date:C({formats:at,defaultWidth:"full"}),time:C({formats:it,defaultWidth:"full"}),dateTime:C({formats:ot,defaultWidth:"full"})},ut={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ct=(t,e,n,r)=>ut[t];function O(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,s=n!=null&&n.width?String(n.width):o;a=t.formattingValues[s]||t.formattingValues[o]}else{const o=t.defaultWidth,s=n!=null&&n.width?String(n.width):t.defaultWidth;a=t.values[s]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(e):e;return a[i]}}const dt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},lt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ft={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ht={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},mt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},gt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},wt=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},yt={ordinalNumber:wt,era:O({values:dt,defaultWidth:"wide"}),quarter:O({values:lt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:O({values:ft,defaultWidth:"wide"}),day:O({values:ht,defaultWidth:"wide"}),dayPeriod:O({values:mt,defaultWidth:"wide",formattingValues:gt,defaultFormattingWidth:"wide"})};function P(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(a);if(!i)return null;const o=i[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?Dt(s,g=>g.test(o)):bt(s,g=>g.test(o));let d;d=t.valueCallback?t.valueCallback(u):u,d=n.valueCallback?n.valueCallback(d):d;const f=e.slice(o.length);return{value:d,rest:f}}}function bt(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Dt(t,e){for(let n=0;n{const r=e.match(t.matchPattern);if(!r)return null;const a=r[0],i=e.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const s=e.slice(a.length);return{value:o,rest:s}}}const kt=/^(\d+)(th|st|nd|rd)?/i,Ot=/\d+/i,Pt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},pt={any:[/^b/i,/^(a|c)/i]},vt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},xt={any:[/1/i,/2/i,/3/i,/4/i]},Tt={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},St={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Wt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Yt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Ct={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Nt={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},_t={ordinalNumber:Mt({matchPattern:kt,parsePattern:Ot,valueCallback:t=>parseInt(t,10)}),era:P({matchPatterns:Pt,defaultMatchWidth:"wide",parsePatterns:pt,defaultParseWidth:"any"}),quarter:P({matchPatterns:vt,defaultMatchWidth:"wide",parsePatterns:xt,defaultParseWidth:"any",valueCallback:t=>t+1}),month:P({matchPatterns:Tt,defaultMatchWidth:"wide",parsePatterns:St,defaultParseWidth:"any"}),day:P({matchPatterns:Wt,defaultMatchWidth:"wide",parsePatterns:Yt,defaultParseWidth:"any"}),dayPeriod:P({matchPatterns:Ct,defaultMatchWidth:"any",parsePatterns:Nt,defaultParseWidth:"any"})},Ft={code:"en-US",formatDistance:rt,formatLong:st,formatRelative:ct,localize:yt,match:_t,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Et(t){const e=w(t);return J(e,et(e))+1}function qt(t){const e=w(t),n=+S(e)-+Z(e);return Math.round(n/A)+1}function Q(t,e){var f,g,l,k;const n=w(t),r=n.getFullYear(),a=W(),i=(e==null?void 0:e.firstWeekContainsDate)??((g=(f=e==null?void 0:e.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??a.firstWeekContainsDate??((k=(l=a.locale)==null?void 0:l.options)==null?void 0:k.firstWeekContainsDate)??1,o=D(t,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const s=v(o,e),u=D(t,0);u.setFullYear(r,0,i),u.setHours(0,0,0,0);const d=v(u,e);return n.getTime()>=s.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function Ut(t,e){var s,u,d,f;const n=W(),r=(e==null?void 0:e.firstWeekContainsDate)??((u=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:u.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,a=Q(t,e),i=D(t,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),v(i,e)}function Lt(t,e){const n=w(t),r=+v(n,e)-+Ut(n,e);return Math.round(r/A)+1}function c(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const y={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return c(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):c(n+1,2)},d(t,e){return c(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return c(t.getHours()%12||12,e.length)},H(t,e){return c(t.getHours(),e.length)},m(t,e){return c(t.getMinutes(),e.length)},s(t,e){return c(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return c(a,e.length)}},M={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},q={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return y.y(t,e)},Y:function(t,e,n,r){const a=Q(t,r),i=a>0?a:1-a;if(e==="YY"){const o=i%100;return c(o,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):c(i,e.length)},R:function(t,e){const n=j(t);return c(n,e.length)},u:function(t,e){const n=t.getFullYear();return c(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return c(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return c(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return y.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return c(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const a=Lt(t,r);return e==="wo"?n.ordinalNumber(a,{unit:"week"}):c(a,e.length)},I:function(t,e,n){const r=qt(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):c(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):y.d(t,e)},D:function(t,e,n){const r=Et(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):c(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return c(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return c(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return c(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(r===12?a=M.noon:r===0?a=M.midnight:a=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(r>=17?a=M.evening:r>=12?a=M.afternoon:r>=4?a=M.morning:a=M.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return y.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):y.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):y.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):y.s(t,e)},S:function(t,e){return y.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return L(r);case"XXXX":case"XX":return b(r);case"XXXXX":case"XXX":default:return b(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return L(r);case"xxxx":case"xx":return b(r);case"xxxxx":case"xxx":default:return b(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+U(r,":");case"OOOO":default:return"GMT"+b(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+U(r,":");case"zzzz":default:return"GMT"+b(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return c(r,e.length)},T:function(t,e,n){const r=t.getTime();return c(r,e.length)}};function U(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+e+c(i,2)}function L(t,e){return t%60===0?(t>0?"-":"+")+c(Math.abs(t)/60,2):b(t,e)}function b(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=c(Math.trunc(r/60),2),i=c(r%60,2);return n+a+e+i}const H=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},X=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},Ht=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return H(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",H(r,e)).replace("{{time}}",X(a,e))},At={p:X,P:Ht},It=/^D+$/,Rt=/^Y+$/,jt=["D","DD","YY","YYYY"];function Qt(t){return It.test(t)}function Xt(t){return Rt.test(t)}function $t(t,e,n){const r=Bt(t,e,n);if(console.warn(r),jt.includes(t))throw new RangeError(r)}function Bt(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Gt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,zt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Vt=/^'([^]*?)'?$/,Jt=/''/g,Zt=/[a-zA-Z]/;function Kt(t,e,n){var f,g,l,k;const r=W(),a=r.locale??Ft,i=r.firstWeekContainsDate??((g=(f=r.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=r.weekStartsOn??((k=(l=r.locale)==null?void 0:l.options)==null?void 0:k.weekStartsOn)??0,s=w(t);if(!tt(s))throw new RangeError("Invalid time value");let u=e.match(zt).map(m=>{const h=m[0];if(h==="p"||h==="P"){const Y=At[h];return Y(m,a.formatLong)}return m}).join("").match(Gt).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const h=m[0];if(h==="'")return{isToken:!1,value:te(m)};if(q[h])return{isToken:!0,value:m};if(h.match(Zt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:m}});a.localize.preprocessor&&(u=a.localize.preprocessor(s,u));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return u.map(m=>{if(!m.isToken)return m.value;const h=m.value;(Xt(h)||Qt(h))&&$t(h,e,String(t));const Y=q[h[0]];return Y(s,h,a.localize,d)}).join("")}function te(t){const e=t.match(Vt);return e?e[1].replace(Jt,"'"):t}function $(t,e){const r=ae(t);let a;if(r.date){const u=ie(r.date,2);a=oe(u.restDateString,u.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);const i=a.getTime();let o=0,s;if(r.time&&(o=se(r.time),isNaN(o)))return new Date(NaN);if(r.timezone){if(s=ue(r.timezone),isNaN(s))return new Date(NaN)}else{const u=new Date(i+o),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return new Date(i+o+s)}const x={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ee=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ne=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,re=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ae(t){const e={},n=t.split(x.dateTimeDelimiter);let r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],x.timeZoneDelimiter.test(e.date)&&(e.date=t.split(x.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){const a=x.timezone.exec(r);a?(e.time=r.replace(a[1],""),e.timezone=a[1]):e.time=r}return e}function ie(t,e){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};const a=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?a:i*100,restDateString:t.slice((r[1]||r[2]).length)}}function oe(t,e){if(e===null)return new Date(NaN);const n=t.match(ee);if(!n)return new Date(NaN);const r=!!n[4],a=p(n[1]),i=p(n[2])-1,o=p(n[3]),s=p(n[4]),u=p(n[5])-1;if(r)return he(e,s,u)?ce(e,s,u):new Date(NaN);{const d=new Date(0);return!le(e,i,o)||!fe(e,a)?new Date(NaN):(d.setUTCFullYear(e,i,Math.max(a,o)),d)}}function p(t){return t?parseInt(t):1}function se(t){const e=t.match(ne);if(!e)return NaN;const n=N(e[1]),r=N(e[2]),a=N(e[3]);return me(n,r,a)?n*R+r*I+a*1e3:NaN}function N(t){return t&&parseFloat(t.replace(",","."))||0}function ue(t){if(t==="Z")return 0;const e=t.match(re);if(!e)return 0;const n=e[1]==="+"?-1:1,r=parseInt(e[2]),a=e[3]&&parseInt(e[3])||0;return ge(r,a)?n*(r*R+a*I):NaN}function ce(t,e,n){const r=new Date(0);r.setUTCFullYear(t,0,4);const a=r.getUTCDay()||7,i=(e-1)*7+n+1-a;return r.setUTCDate(r.getUTCDate()+i),r}const de=[31,null,31,30,31,30,31,31,30,31,30,31];function B(t){return t%400===0||t%4===0&&t%100!==0}function le(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(de[e]||(B(t)?29:28))}function fe(t,e){return e>=1&&e<=(B(t)?366:365)}function he(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function me(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function ge(t,e){return e>=0&&e<=59}const we={model:"models",dataset:"datasets",space:"spaces"};function ye(t){const e=t.hf_artifact_summary;return!e||!e.best_kind||!e.best_url||e.best_count<=0?{hfKind:null,hfCount:0,hfUrl:null}:{hfKind:we[e.best_kind]??null,hfCount:e.best_count,hfUrl:e.best_url}}function be(t){if(!t||t.length===0)return{github:null,githubUrl:null,velocity24h:null};const e=t.filter(a=>a.is_official),r=[...e.length>0?e:t].sort((a,i)=>(i.num_stars||0)-(a.num_stars||0))[0];return{github:r&&r.num_stars>0?r.num_stars:null,githubUrl:(r==null?void 0:r.url)||null,velocity24h:(r==null?void 0:r.trending_score)??null}}function De(t){if(!t)return null;try{const e=typeof t=="string"?$(t):t;return Kt(e,"MMM d, yyyy")}catch{return null}}function Me(t){if(!t)return null;try{return $(t).getFullYear()}catch{return null}}function ke(t){return(t||[]).filter(e=>e.best_rank>=1&&e.best_rank<=3).map(e=>{let n=null;if(e.dataset_slug){const r=new URLSearchParams;e.task_slug&&r.set("task",e.task_slug),r.set("eval",e.evaluation_id),n=`/benchmark/${e.dataset_slug}?${r}`}return{name:e.dataset_name,href:n,rank:e.best_rank}})}function ve(t){var f,g;const{github:e,githubUrl:n,velocity24h:r}=be(t.repositories),{hfKind:a,hfCount:i,hfUrl:o}=ye(t),s=(t.tasks||[]).map(l=>l.slug||"").filter(Boolean),u=(t.methods||[]).map(l=>({id:l.id,name:l.name,slug:l.slug})),d=ke(t.leaderboard_ranks);return{id:t.arxiv_id||t.id,dbId:t.id,title:t.title,abstract:t.abstract||"",authors:t.authors||[],authorIds:(t.author_links||[]).map(l=>l.id??null),authorHfProfiles:(t.author_links||[]).map(l=>l.hf_username?{username:l.hf_username,avatarUrl:l.hf_avatar_url??null}:null),tags:s,methods:u,organizations:(t.organizations||[]).map(l=>({name:l.name,slug:l.slug,logoUrl:_(l.logo_url)||null})),citations:t.citation_count||0,github:e,githubUrl:n,project:((g=(f=t.project_pages)==null?void 0:f[0])==null?void 0:g.url)||null,date:De(t.published),publishedIso:t.published||null,year:Me(t.published),thumbnailUrl:_(t.thumbnail_url)||null,tldr:t.tldr||null,version:t.version||"v1",velocity24h:r,hfKind:a,hfCount:i,hfUrl:o,sotaRanks:d}}function Oe(t){const e=G.get(t.toLowerCase());if(e)return e;const n=t.toUpperCase();return T.has(n)?n:t.replace(/[-_]+/g," ").replace(/\b\w/g,r=>r.toUpperCase())}const T=new Set(["3D","AI","OCR"]),G=new Map([["3d-tracking","3D Tracking"],["point-tracking","2D Point Tracking"],["3d-generation","3D generation"],["3d-understanding","3D understanding"],["3d-semantic-segmentation","3D semantic segmentation"],["3d-instance-segmentation","3D instance segmentation"],["3d-object-detection","3D object detection"],["text-to-sql","Text-to-SQL"]]);function xe(t,e){const n=t||Oe(e||""),r=G.get((e==null?void 0:e.toLowerCase())||Pe(n));if(r)return r;const a=e==null?void 0:e.toUpperCase(),i=n.toUpperCase();return/^[A-Z0-9][A-Z0-9-]{1,}$/.test(n)||a&&T.has(a)||T.has(i)?i:n.replace(/\b[A-Za-z0-9]+\b/g,s=>/^[A-Z0-9]{2,}$/.test(s)||T.has(s.toUpperCase())?s.toUpperCase():s.charAt(0).toUpperCase()+s.slice(1).toLowerCase())}function Pe(t){return t.trim().toLowerCase().replace(/[\s_]+/g,"-")}function Te(t){let e=2166136261;const n=t||"";for(let r=0;r=a.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function F(t){const e=w(t);return e.setHours(0,0,0,0),e}function E(t){const e=w(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function J(t,e){const n=F(t),r=F(e),a=+n-E(n),i=+r-E(r);return Math.round((a-i)/z)}function Z(t){const e=j(t),n=D(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),S(n)}function K(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function tt(t){if(!K(t)&&typeof t!="number")return!1;const e=w(t);return!isNaN(Number(e))}function et(t){const e=w(t),n=D(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}const nt={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},rt=(t,e,n)=>{let r;const a=nt[t];return typeof a=="string"?r=a:e===1?r=a.one:r=a.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function C(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const at={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},it={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ot={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},st={date:C({formats:at,defaultWidth:"full"}),time:C({formats:it,defaultWidth:"full"}),dateTime:C({formats:ot,defaultWidth:"full"})},ut={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ct=(t,e,n,r)=>ut[t];function O(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,s=n!=null&&n.width?String(n.width):o;a=t.formattingValues[s]||t.formattingValues[o]}else{const o=t.defaultWidth,s=n!=null&&n.width?String(n.width):t.defaultWidth;a=t.values[s]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(e):e;return a[i]}}const dt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},lt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ft={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ht={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},mt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},gt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},wt=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},yt={ordinalNumber:wt,era:O({values:dt,defaultWidth:"wide"}),quarter:O({values:lt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:O({values:ft,defaultWidth:"wide"}),day:O({values:ht,defaultWidth:"wide"}),dayPeriod:O({values:mt,defaultWidth:"wide",formattingValues:gt,defaultFormattingWidth:"wide"})};function P(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(a);if(!i)return null;const o=i[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(s)?Dt(s,g=>g.test(o)):bt(s,g=>g.test(o));let d;d=t.valueCallback?t.valueCallback(u):u,d=n.valueCallback?n.valueCallback(d):d;const f=e.slice(o.length);return{value:d,rest:f}}}function bt(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Dt(t,e){for(let n=0;n{const r=e.match(t.matchPattern);if(!r)return null;const a=r[0],i=e.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const s=e.slice(a.length);return{value:o,rest:s}}}const kt=/^(\d+)(th|st|nd|rd)?/i,Ot=/\d+/i,Pt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},pt={any:[/^b/i,/^(a|c)/i]},vt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},xt={any:[/1/i,/2/i,/3/i,/4/i]},Tt={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},St={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Wt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Yt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Ct={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Nt={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},_t={ordinalNumber:Mt({matchPattern:kt,parsePattern:Ot,valueCallback:t=>parseInt(t,10)}),era:P({matchPatterns:Pt,defaultMatchWidth:"wide",parsePatterns:pt,defaultParseWidth:"any"}),quarter:P({matchPatterns:vt,defaultMatchWidth:"wide",parsePatterns:xt,defaultParseWidth:"any",valueCallback:t=>t+1}),month:P({matchPatterns:Tt,defaultMatchWidth:"wide",parsePatterns:St,defaultParseWidth:"any"}),day:P({matchPatterns:Wt,defaultMatchWidth:"wide",parsePatterns:Yt,defaultParseWidth:"any"}),dayPeriod:P({matchPatterns:Ct,defaultMatchWidth:"any",parsePatterns:Nt,defaultParseWidth:"any"})},Ft={code:"en-US",formatDistance:rt,formatLong:st,formatRelative:ct,localize:yt,match:_t,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Et(t){const e=w(t);return J(e,et(e))+1}function qt(t){const e=w(t),n=+S(e)-+Z(e);return Math.round(n/A)+1}function Q(t,e){var f,g,l,k;const n=w(t),r=n.getFullYear(),a=W(),i=(e==null?void 0:e.firstWeekContainsDate)??((g=(f=e==null?void 0:e.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??a.firstWeekContainsDate??((k=(l=a.locale)==null?void 0:l.options)==null?void 0:k.firstWeekContainsDate)??1,o=D(t,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const s=v(o,e),u=D(t,0);u.setFullYear(r,0,i),u.setHours(0,0,0,0);const d=v(u,e);return n.getTime()>=s.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function Ut(t,e){var s,u,d,f;const n=W(),r=(e==null?void 0:e.firstWeekContainsDate)??((u=(s=e==null?void 0:e.locale)==null?void 0:s.options)==null?void 0:u.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,a=Q(t,e),i=D(t,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),v(i,e)}function Lt(t,e){const n=w(t),r=+v(n,e)-+Ut(n,e);return Math.round(r/A)+1}function c(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const y={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return c(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):c(n+1,2)},d(t,e){return c(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return c(t.getHours()%12||12,e.length)},H(t,e){return c(t.getHours(),e.length)},m(t,e){return c(t.getMinutes(),e.length)},s(t,e){return c(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return c(a,e.length)}},M={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},q={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return y.y(t,e)},Y:function(t,e,n,r){const a=Q(t,r),i=a>0?a:1-a;if(e==="YY"){const o=i%100;return c(o,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):c(i,e.length)},R:function(t,e){const n=j(t);return c(n,e.length)},u:function(t,e){const n=t.getFullYear();return c(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return c(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return c(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return y.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return c(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const a=Lt(t,r);return e==="wo"?n.ordinalNumber(a,{unit:"week"}):c(a,e.length)},I:function(t,e,n){const r=qt(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):c(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):y.d(t,e)},D:function(t,e,n){const r=Et(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):c(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return c(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return c(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return c(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(r===12?a=M.noon:r===0?a=M.midnight:a=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(r>=17?a=M.evening:r>=12?a=M.afternoon:r>=4?a=M.morning:a=M.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return y.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):y.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):c(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):y.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):y.s(t,e)},S:function(t,e){return y.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return L(r);case"XXXX":case"XX":return b(r);case"XXXXX":case"XXX":default:return b(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return L(r);case"xxxx":case"xx":return b(r);case"xxxxx":case"xxx":default:return b(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+U(r,":");case"OOOO":default:return"GMT"+b(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+U(r,":");case"zzzz":default:return"GMT"+b(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return c(r,e.length)},T:function(t,e,n){const r=t.getTime();return c(r,e.length)}};function U(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+e+c(i,2)}function L(t,e){return t%60===0?(t>0?"-":"+")+c(Math.abs(t)/60,2):b(t,e)}function b(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=c(Math.trunc(r/60),2),i=c(r%60,2);return n+a+e+i}const H=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},X=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},Ht=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return H(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",H(r,e)).replace("{{time}}",X(a,e))},At={p:X,P:Ht},It=/^D+$/,Rt=/^Y+$/,jt=["D","DD","YY","YYYY"];function Qt(t){return It.test(t)}function Xt(t){return Rt.test(t)}function $t(t,e,n){const r=Bt(t,e,n);if(console.warn(r),jt.includes(t))throw new RangeError(r)}function Bt(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Gt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,zt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Vt=/^'([^]*?)'?$/,Jt=/''/g,Zt=/[a-zA-Z]/;function Kt(t,e,n){var f,g,l,k;const r=W(),a=r.locale??Ft,i=r.firstWeekContainsDate??((g=(f=r.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=r.weekStartsOn??((k=(l=r.locale)==null?void 0:l.options)==null?void 0:k.weekStartsOn)??0,s=w(t);if(!tt(s))throw new RangeError("Invalid time value");let u=e.match(zt).map(m=>{const h=m[0];if(h==="p"||h==="P"){const Y=At[h];return Y(m,a.formatLong)}return m}).join("").match(Gt).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const h=m[0];if(h==="'")return{isToken:!1,value:te(m)};if(q[h])return{isToken:!0,value:m};if(h.match(Zt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:m}});a.localize.preprocessor&&(u=a.localize.preprocessor(s,u));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return u.map(m=>{if(!m.isToken)return m.value;const h=m.value;(Xt(h)||Qt(h))&&$t(h,e,String(t));const Y=q[h[0]];return Y(s,h,a.localize,d)}).join("")}function te(t){const e=t.match(Vt);return e?e[1].replace(Jt,"'"):t}function $(t,e){const r=ae(t);let a;if(r.date){const u=ie(r.date,2);a=oe(u.restDateString,u.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);const i=a.getTime();let o=0,s;if(r.time&&(o=se(r.time),isNaN(o)))return new Date(NaN);if(r.timezone){if(s=ue(r.timezone),isNaN(s))return new Date(NaN)}else{const u=new Date(i+o),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return new Date(i+o+s)}const x={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ee=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ne=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,re=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ae(t){const e={},n=t.split(x.dateTimeDelimiter);let r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],x.timeZoneDelimiter.test(e.date)&&(e.date=t.split(x.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){const a=x.timezone.exec(r);a?(e.time=r.replace(a[1],""),e.timezone=a[1]):e.time=r}return e}function ie(t,e){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};const a=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?a:i*100,restDateString:t.slice((r[1]||r[2]).length)}}function oe(t,e){if(e===null)return new Date(NaN);const n=t.match(ee);if(!n)return new Date(NaN);const r=!!n[4],a=p(n[1]),i=p(n[2])-1,o=p(n[3]),s=p(n[4]),u=p(n[5])-1;if(r)return he(e,s,u)?ce(e,s,u):new Date(NaN);{const d=new Date(0);return!le(e,i,o)||!fe(e,a)?new Date(NaN):(d.setUTCFullYear(e,i,Math.max(a,o)),d)}}function p(t){return t?parseInt(t):1}function se(t){const e=t.match(ne);if(!e)return NaN;const n=N(e[1]),r=N(e[2]),a=N(e[3]);return me(n,r,a)?n*R+r*I+a*1e3:NaN}function N(t){return t&&parseFloat(t.replace(",","."))||0}function ue(t){if(t==="Z")return 0;const e=t.match(re);if(!e)return 0;const n=e[1]==="+"?-1:1,r=parseInt(e[2]),a=e[3]&&parseInt(e[3])||0;return ge(r,a)?n*(r*R+a*I):NaN}function ce(t,e,n){const r=new Date(0);r.setUTCFullYear(t,0,4);const a=r.getUTCDay()||7,i=(e-1)*7+n+1-a;return r.setUTCDate(r.getUTCDate()+i),r}const de=[31,null,31,30,31,30,31,31,30,31,30,31];function B(t){return t%400===0||t%4===0&&t%100!==0}function le(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(de[e]||(B(t)?29:28))}function fe(t,e){return e>=1&&e<=(B(t)?366:365)}function he(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function me(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function ge(t,e){return e>=0&&e<=59}const we={model:"models",dataset:"datasets",space:"spaces"};function ye(t){const e=t.hf_artifact_summary;return!e||!e.best_kind||!e.best_url||e.best_count<=0?{hfKind:null,hfCount:0,hfUrl:null}:{hfKind:we[e.best_kind]??null,hfCount:e.best_count,hfUrl:e.best_url}}function be(t){if(!t||t.length===0)return{github:null,githubUrl:null,velocity24h:null};const e=t.filter(a=>a.is_official),r=[...e.length>0?e:t].sort((a,i)=>(i.num_stars||0)-(a.num_stars||0))[0];return{github:r&&r.num_stars>0?r.num_stars:null,githubUrl:(r==null?void 0:r.url)||null,velocity24h:(r==null?void 0:r.trending_score)??null}}function De(t){if(!t)return null;try{const e=typeof t=="string"?$(t):t;return Kt(e,"MMM d, yyyy")}catch{return null}}function Me(t){if(!t)return null;try{return $(t).getFullYear()}catch{return null}}function ke(t){return(t||[]).filter(e=>e.best_rank>=1&&e.best_rank<=3).map(e=>{let n=null;if(e.dataset_slug){const r=new URLSearchParams;e.task_slug&&r.set("task",e.task_slug),r.set("eval",e.evaluation_id),n=`/benchmark/${e.dataset_slug}?${r}`}return{name:e.dataset_name,href:n,rank:e.best_rank}})}function ve(t){var f,g;const{github:e,githubUrl:n,velocity24h:r}=be(t.repositories),{hfKind:a,hfCount:i,hfUrl:o}=ye(t),s=(t.tasks||[]).map(l=>l.slug||"").filter(Boolean),u=(t.methods||[]).map(l=>({id:l.id,name:l.name,slug:l.slug})),d=ke(t.leaderboard_ranks);return{id:t.arxiv_id||t.id,dbId:t.id,title:t.title,abstract:t.abstract||"",authors:t.authors||[],authorIds:(t.author_links||[]).map(l=>l.id??null),authorHfProfiles:(t.author_links||[]).map(l=>l.hf_username?{username:l.hf_username,avatarUrl:l.hf_avatar_url??null}:null),tags:s,methods:u,organizations:(t.organizations||[]).map(l=>({name:l.name,slug:l.slug,logoUrl:_(l.logo_url)||null})),citations:t.citation_count||0,github:e,githubUrl:n,project:((g=(f=t.project_pages)==null?void 0:f[0])==null?void 0:g.url)||null,date:De(t.published),publishedIso:t.published||null,year:Me(t.published),thumbnailUrl:_(t.thumbnail_url)||null,tldr:t.tldr||null,version:t.version||"v1",velocity24h:r,hfKind:a,hfCount:i,hfUrl:o,sotaRanks:d}}function Oe(t){const e=G.get(t.toLowerCase());if(e)return e;const n=t.toUpperCase();return T.has(n)?n:t.replace(/[-_]+/g," ").replace(/\b\w/g,r=>r.toUpperCase())}const T=new Set(["3D","AI","OCR"]),G=new Map([["3d-tracking","3D Tracking"],["point-tracking","2D Point Tracking"],["3d-generation","3D generation"],["3d-understanding","3D understanding"],["3d-semantic-segmentation","3D semantic segmentation"],["3d-instance-segmentation","3D instance segmentation"],["3d-object-detection","3D object detection"],["text-to-sql","Text-to-SQL"]]);function xe(t,e){const n=t||Oe(e||""),r=G.get((e==null?void 0:e.toLowerCase())||Pe(n));if(r)return r;const a=e==null?void 0:e.toUpperCase(),i=n.toUpperCase();return/^[A-Z0-9][A-Z0-9-]{1,}$/.test(n)||a&&T.has(a)||T.has(i)?i:n.replace(/\b[A-Za-z0-9]+\b/g,s=>/^[A-Z0-9]{2,}$/.test(s)||T.has(s.toUpperCase())?s.toUpperCase():s.charAt(0).toUpperCase()+s.slice(1).toLowerCase())}function Pe(t){return t.trim().toLowerCase().replace(/[\s_]+/g,"-")}function Te(t){let e=2166136261;const n=t||"";for(let r=0;r{const a=S(),g=B(t),l=I(g),f=i=>{if(i.stopPropagation(),r){r(t);return}a(`/tasks/${t}`)};return e.jsxs("span",{className:"tag-chip",style:{background:l.bg,color:l.text},onClick:f,children:[e.jsx("span",{className:"dot",style:{background:l.dot}}),D(s||G(t),t)]})},O=({method:t,onClick:s})=>{const r=S(),a=t.slug||t.id||"";if(!a)return null;const g=l=>{if(l.stopPropagation(),s){s(a);return}r(`/methods/${a}`)};return e.jsx("span",{className:"method-chip",onClick:g,children:t.name})},$={1:"SOTA 🏆",2:"#2",3:"#3"},w=({units:t,paperHref:s})=>{const r=m.useRef(null),a=m.useRef(null),[g,l]=m.useState(t.length);if(m.useLayoutEffect(()=>{const n=r.current,u=a.current;if(!n||!u||t.length===0)return;const x=h=>(u.textContent=h,u.scrollWidth),j=()=>{const h=n.clientWidth;if(h<=0)return;let c=0,d=0;for(const L of t){const p=x(L.measureText);if(c+p<=h)c+=p,d+=1;else break}if(d0&&c+x(` · +${t.length-d} more`)>h;)d-=1,c-=x(t[d].measureText);d===0&&(d=1)}l(d)};j();const o=new ResizeObserver(j);return o.observe(n),()=>o.disconnect()},[t]),t.length===0)return null;const f=t.slice(0,Math.max(1,Math.min(g,t.length))),i=t.length-f.length;return e.jsxs("div",{className:"paper-sota",ref:r,children:[e.jsx("span",{ref:a,className:"paper-sota-measure","aria-hidden":"true"}),f.map((n,u)=>e.jsxs(m.Fragment,{children:[n.isGroupStart?e.jsxs(e.Fragment,{children:[u>0&&e.jsx("span",{className:"paper-sota-sep",children:" · "}),e.jsx("span",{className:`paper-sota-label${n.rank===1?" paper-sota-label--sota":""}`,children:$[n.rank]}),e.jsx("span",{className:"paper-sota-on",children:" on "})]}):e.jsx("span",{className:"paper-sota-sep",children:", "}),n.href?e.jsx(y,{to:n.href,className:"paper-sota-name",onClick:x=>x.stopPropagation(),children:n.name}):e.jsx("span",{className:"paper-sota-name",children:n.name})]},`${n.href||n.name}-${u}`)),i>0&&e.jsxs(y,{to:`${s}#results`,className:"paper-sota-more",onClick:n=>n.stopPropagation(),children:[" · +",i," more"]})]})},U=({ranks:t,paperHref:s,wrap:r=!1})=>{const a=m.useMemo(()=>{const l=[];let f=!0;for(const i of[1,2,3]){const n=t.filter(u=>u.rank===i);n.forEach((u,x)=>{const j=x===0,o=j?`${f?"":" · "}${$[i]} on `:", ";l.push({name:u.name,href:u.href,rank:i,isGroupStart:j,measureText:o+u.name})}),n.length>0&&(f=!1)}return l},[t]),g=m.useMemo(()=>[1,2,3].map(l=>t.filter(i=>i.rank===l).map((i,n)=>({name:i.name,href:i.href,rank:l,isGroupStart:n===0,measureText:(n===0?`${$[l]} on `:", ")+i.name}))).filter(l=>l.length>0),[t]);return r?g.length===0?null:e.jsx("div",{className:"paper-sota-stack",children:g.map(l=>e.jsx(w,{units:l,paperHref:s},l[0].rank))}):a.length===0?null:e.jsx(w,{units:a,paperHref:s})},_=({name:t,size:s=14})=>{const r={search:e.jsx("path",{d:"M11 11l3 3M7 12.5a5.5 5.5 0 110-11 5.5 5.5 0 010 11z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),arrowUp:e.jsx("path",{d:"M8 3l5 6H3l5-6z",fill:"currentColor"}),arrowLeft:e.jsx("path",{d:"M9 3l-4 5 4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),arrowRight:e.jsx("path",{d:"M7 3l4 5-4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),external:e.jsx("path",{d:"M5 3h-2v8h8v-2M9 3h3v3M7 9l5-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),github:e.jsx("path",{d:"M8 1a7 7 0 00-2.21 13.64c.35.06.48-.15.48-.34v-1.2c-1.95.42-2.36-.94-2.36-.94-.32-.81-.78-1.03-.78-1.03-.64-.43.05-.43.05-.43.7.05 1.07.72 1.07.72.62 1.07 1.64.76 2.04.58.06-.45.24-.76.44-.94-1.55-.18-3.18-.78-3.18-3.46 0-.76.27-1.39.72-1.88-.07-.18-.31-.89.07-1.86 0 0 .59-.19 1.92.72.56-.15 1.16-.23 1.75-.24.59 0 1.19.08 1.75.24 1.33-.9 1.92-.72 1.92-.72.38.97.14 1.68.07 1.86.45.49.72 1.12.72 1.88 0 2.69-1.64 3.28-3.19 3.45.25.22.48.65.48 1.32v1.95c0 .19.13.41.49.34A7 7 0 008 1z",fill:"currentColor"}),citation:e.jsx("path",{d:"M3 4h3v3H3zM4 7v1.5a1.5 1.5 0 01-1.5 1.5M9 4h3v3H9zM10 7v1.5a1.5 1.5 0 01-1.5 1.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),bookmark:e.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),chart:e.jsx("path",{d:"M2 13h12M3 11l3-4 3 2 4-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),chat:e.jsx("path",{d:"M3 3h10v7H7l-3 3v-3H3V3z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),pdf:e.jsx("path",{d:"M5 2h5l3 3v9H5V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),copy:e.jsx("path",{d:"M5 5h7v8H5V5zM3 3h7v2M3 3v8h2",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinejoin:"round"}),sparkle:e.jsx("path",{d:"M8 2l1.2 3.8L13 7l-3.8 1.2L8 12l-1.2-3.8L3 7l3.8-1.2L8 2z",fill:"currentColor"}),user:e.jsx("path",{d:"M8 8a3 3 0 100-6 3 3 0 000 6zM2 14c0-3 2.5-5 6-5s6 2 6 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),globe:e.jsx("path",{d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM1.5 8h13M8 1.5c1.7 1.9 2.6 4.2 2.6 6.5s-.9 4.6-2.6 6.5M8 1.5C6.3 3.4 5.4 5.7 5.4 8s.9 4.6 2.6 6.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinecap:"round"}),menu:e.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:e.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),pencil:e.jsx("path",{d:"M10.5 2.5l3 3L6 13H3v-3l7.5-7.5zM9 4l3 3",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})};return e.jsx("svg",{className:s===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:s,height:s,children:r[t]})},V=({size:t=16})=>e.jsxs("svg",{className:"hf-logo",width:t,height:t,viewBox:"0 0 95 88",fill:"none","aria-hidden":"true",focusable:"false",children:[e.jsx("path",{fill:"#FFD21E",d:"M47.21 76.5a34.75 34.75 0 1 0 0-69.5 34.75 34.75 0 0 0 0 69.5Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M81.96 41.75a34.75 34.75 0 1 0-69.5 0 34.75 34.75 0 0 0 69.5 0Zm-73.5 0a38.75 38.75 0 1 1 77.5 0 38.75 38.75 0 0 1-77.5 0Z"}),e.jsx("path",{fill:"#3A3B45",d:"M58.5 32.3c1.28.44 1.78 3.06 3.07 2.38a5 5 0 1 0-6.76-2.07c.61 1.15 2.55-.72 3.7-.32ZM34.95 32.3c-1.28.44-1.79 3.06-3.07 2.38a5 5 0 1 1 6.76-2.07c-.61 1.15-2.56-.72-3.7-.32Z"}),e.jsx("path",{fill:"#FF323D",d:"M46.96 56.29c9.83 0 13-8.76 13-13.26 0-2.34-1.57-1.6-4.09-.36-2.33 1.15-5.46 2.74-8.9 2.74-7.19 0-13-6.88-13-2.38s3.16 13.26 13 13.26Z"}),e.jsx("path",{fill:"#3A3B45",fillRule:"evenodd",clipRule:"evenodd",d:"M39.43 54a8.7 8.7 0 0 1 5.3-4.49c.4-.12.81.57 1.24 1.28.4.68.82 1.37 1.24 1.37.45 0 .9-.68 1.33-1.35.45-.7.89-1.38 1.32-1.25a8.61 8.61 0 0 1 5 4.17c3.73-2.94 5.1-7.74 5.1-10.7 0-2.34-1.57-1.6-4.09-.36l-.14.07c-2.31 1.15-5.39 2.67-8.77 2.67s-6.45-1.52-8.77-2.67c-2.6-1.29-4.23-2.1-4.23.29 0 3.05 1.46 8.06 5.47 10.97Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M70.71 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM24.21 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM17.52 48c-1.62 0-3.06.66-4.07 1.87a5.97 5.97 0 0 0-1.33 3.76 7.1 7.1 0 0 0-1.94-.3c-1.55 0-2.95.59-3.94 1.66a5.8 5.8 0 0 0-.8 7 5.3 5.3 0 0 0-1.79 2.82c-.24.9-.48 2.8.8 4.74a5.22 5.22 0 0 0-.37 5.02c1.02 2.32 3.57 4.14 8.52 6.1 3.07 1.22 5.89 2 5.91 2.01a44.33 44.33 0 0 0 10.93 1.6c5.86 0 10.05-1.8 12.46-5.34 3.88-5.69 3.33-10.9-1.7-15.92-2.77-2.78-4.62-6.87-5-7.77-.78-2.66-2.84-5.62-6.25-5.62a5.7 5.7 0 0 0-4.6 2.46c-1-1.26-1.98-2.25-2.86-2.82A7.4 7.4 0 0 0 17.52 48Zm0 4c.51 0 1.14.22 1.82.65 2.14 1.36 6.25 8.43 7.76 11.18.5.92 1.37 1.31 2.14 1.31 1.55 0 2.75-1.53.15-3.48-3.92-2.93-2.55-7.72-.68-8.01.08-.02.17-.02.24-.02 1.7 0 2.45 2.93 2.45 2.93s2.2 5.52 5.98 9.3c3.77 3.77 3.97 6.8 1.22 10.83-1.88 2.75-5.47 3.58-9.16 3.58-3.81 0-7.73-.9-9.92-1.46-.11-.03-13.45-3.8-11.76-7 .28-.54.75-.76 1.34-.76 2.38 0 6.7 3.54 8.57 3.54.41 0 .7-.17.83-.6.79-2.85-12.06-4.05-10.98-8.17.2-.73.71-1.02 1.44-1.02 3.14 0 10.2 5.53 11.68 5.53.11 0 .2-.03.24-.1.74-1.2.33-2.04-4.9-5.2-5.21-3.16-8.88-5.06-6.8-7.33.24-.26.58-.38 1-.38 3.17 0 10.66 6.82 10.66 6.82s2.02 2.1 3.25 2.1c.28 0 .52-.1.68-.38.86-1.46-8.06-8.22-8.56-11.01-.34-1.9.24-2.85 1.31-2.85Z"}),e.jsx("path",{fill:"#FFD21E",d:"M38.6 76.69c2.75-4.04 2.55-7.07-1.22-10.84-3.78-3.77-5.98-9.3-5.98-9.3s-.82-3.2-2.69-2.9c-1.87.3-3.24 5.08.68 8.01 3.91 2.93-.78 4.92-2.29 2.17-1.5-2.75-5.62-9.82-7.76-11.18-2.13-1.35-3.63-.6-3.13 2.2.5 2.79 9.43 9.55 8.56 11-.87 1.47-3.93-1.71-3.93-1.71s-9.57-8.71-11.66-6.44c-2.08 2.27 1.59 4.17 6.8 7.33 5.23 3.16 5.64 4 4.9 5.2-.75 1.2-12.28-8.53-13.36-4.4-1.08 4.11 11.77 5.3 10.98 8.15-.8 2.85-9.06-5.38-10.74-2.18-1.7 3.21 11.65 6.98 11.76 7.01 4.3 1.12 15.25 3.49 19.08-2.12Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M77.4 48c1.62 0 3.07.66 4.07 1.87a5.97 5.97 0 0 1 1.33 3.76 7.1 7.1 0 0 1 1.95-.3c1.55 0 2.95.59 3.94 1.66a5.8 5.8 0 0 1 .8 7 5.3 5.3 0 0 1 1.78 2.82c.24.9.48 2.8-.8 4.74a5.22 5.22 0 0 1 .37 5.02c-1.02 2.32-3.57 4.14-8.51 6.1-3.08 1.22-5.9 2-5.92 2.01a44.33 44.33 0 0 1-10.93 1.6c-5.86 0-10.05-1.8-12.46-5.34-3.88-5.69-3.33-10.9 1.7-15.92 2.78-2.78 4.63-6.87 5.01-7.77.78-2.66 2.83-5.62 6.24-5.62a5.7 5.7 0 0 1 4.6 2.46c1-1.26 1.98-2.25 2.87-2.82A7.4 7.4 0 0 1 77.4 48Zm0 4c-.51 0-1.13.22-1.82.65-2.13 1.36-6.25 8.43-7.76 11.18a2.43 2.43 0 0 1-2.14 1.31c-1.54 0-2.75-1.53-.14-3.48 3.91-2.93 2.54-7.72.67-8.01a1.54 1.54 0 0 0-.24-.02c-1.7 0-2.45 2.93-2.45 2.93s-2.2 5.52-5.97 9.3c-3.78 3.77-3.98 6.8-1.22 10.83 1.87 2.75 5.47 3.58 9.15 3.58 3.82 0 7.73-.9 9.93-1.46.1-.03 13.45-3.8 11.76-7-.29-.54-.75-.76-1.34-.76-2.38 0-6.71 3.54-8.57 3.54-.42 0-.71-.17-.83-.6-.8-2.85 12.05-4.05 10.97-8.17-.19-.73-.7-1.02-1.44-1.02-3.14 0-10.2 5.53-11.68 5.53-.1 0-.19-.03-.23-.1-.74-1.2-.34-2.04 4.88-5.2 5.23-3.16 8.9-5.06 6.8-7.33-.23-.26-.57-.38-.98-.38-3.18 0-10.67 6.82-10.67 6.82s-2.02 2.1-3.24 2.1a.74.74 0 0 1-.68-.38c-.87-1.46 8.05-8.22 8.55-11.01.34-1.9-.24-2.85-1.31-2.85Z"}),e.jsx("path",{fill:"#FFD21E",d:"M56.33 76.69c-2.75-4.04-2.56-7.07 1.22-10.84 3.77-3.77 5.97-9.3 5.97-9.3s.82-3.2 2.7-2.9c1.86.3 3.23 5.08-.68 8.01-3.92 2.93.78 4.92 2.28 2.17 1.51-2.75 5.63-9.82 7.76-11.18 2.13-1.35 3.64-.6 3.13 2.2-.5 2.79-9.42 9.55-8.55 11 .86 1.47 3.92-1.71 3.92-1.71s9.58-8.71 11.66-6.44c2.08 2.27-1.58 4.17-6.8 7.33-5.23 3.16-5.63 4-4.9 5.2.75 1.2 12.28-8.53 13.36-4.4 1.08 4.11-11.76 5.3-10.97 8.15.8 2.85 9.05-5.38 10.74-2.18 1.69 3.21-11.65 6.98-11.76 7.01-4.31 1.12-15.26 3.49-19.08-2.12Z"})]}),q=t=>{let s=2166136261;for(let r=0;r(s=Math.imul(s^s>>>15,2246822507),s=Math.imul(s^s>>>13,3266489909),s^=s>>>16,(s>>>0)%1e4/1e4)},Y=({paperId:t})=>{const s=q(t),r=160,a=220,g=[.85+s()*.1,.55+s()*.25],l=.45+s()*.3,f=[],i=9+Math.floor(s()*3);for(let M=0;M.3,u=Math.floor(s()*3),x=[],j=6+Math.floor(s()*3);for(let M=0;Me.jsx("rect",{x:c+(r-c*2)*(1-M)/2,y:A+v*2.4,width:(r-c*2)*M,height:1.4,fill:h,rx:.3},`t${v}`)),e.jsx("rect",{x:c+(r-c*2)*(1-l)/2,y:z,width:(r-c*2)*l,height:.9,fill:o,opacity:.7,rx:.2}),e.jsx("rect",{x:c,y:W,width:6,height:1,fill:h,opacity:.6}),f.map((M,v)=>{const C=k+v*2.1;return C>a-c-1?null:e.jsx("rect",{x:L,y:C,width:d*M,height:.8,fill:o,opacity:.55,rx:.2},`l${v}`)}),n&&e.jsxs("g",{children:[e.jsx("rect",{x:p,y:k,width:d,height:14,fill:"#F0EBE0",stroke:o,strokeWidth:.3,opacity:.9}),u===0&&e.jsx("g",{stroke:h,strokeWidth:.4,fill:"none",opacity:.6,children:e.jsx("polyline",{points:`${p+2},${k+11} ${p+6},${k+8} ${p+10},${k+9} ${p+14},${k+5} ${p+18},${k+6} ${p+22},${k+3}`})}),u===1&&e.jsxs("g",{opacity:.55,children:[e.jsx("circle",{cx:p+d/2,cy:k+7,r:3.5,fill:h}),e.jsx("rect",{x:p+2,y:k+11,width:d-4,height:1.5,fill:o})]}),u===2&&e.jsxs("g",{opacity:.55,children:[e.jsx("rect",{x:p+3,y:k+5,width:d-6,height:1,fill:h}),e.jsx("rect",{x:p+6,y:k+8,width:d-12,height:.8,fill:h})]})]}),x.map((M,v)=>{const C=k+(n?16:0)+v*2.1;return C>a-c-1?null:e.jsx("rect",{x:p,y:C,width:d*M,height:.8,fill:o,opacity:.55,rx:.2},`r${v}`)})]})})},Q=({paperId:t,title:s,thumbnailUrl:r,priority:a=!1})=>{const[g,l]=m.useState(!1),[f,i]=m.useState(0),[n,u]=m.useState(a),x=m.useRef(null);m.useEffect(()=>{l(!1),i(0)},[r]);const j=m.useMemo(()=>{if(!r)return null;if(f===0)return r;const o=r.includes("?")?"&":"?";return`${r}${o}retry=${f}`},[r,f]);return m.useEffect(()=>{if(a||n)return;const o=x.current;if(!o)return;const h=new IntersectionObserver(([c])=>{c.isIntersecting&&(u(!0),h.disconnect())},{rootMargin:"250px"});return h.observe(o),()=>h.disconnect()},[a,n]),r&&!g?e.jsx("div",{ref:x,style:{width:160,height:220,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:(a||n)&&j&&e.jsx("img",{src:j,alt:`Thumbnail for ${s}`,loading:a?"eager":"lazy",decoding:"async",fetchPriority:a?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>{if(f<1){i(o=>o+1);return}l(!0)}},j)}):e.jsx(Y,{paperId:t})};function J(t){const s=[...new Set(t.map(a=>a.replace(/ \(subtask\)$/,"")))],r=s.length>3?[...s.slice(0,2),`${s.length-2} more`]:s;return r.length>1?`${r.slice(0,-1).join(", ")} and ${r[r.length-1]}`:r[0]}const X="language-modeling";function F(t){return t?t.toLowerCase().replace(/\(.*?\)/g," ").replace(/[^a-z]+/g," ").replace(/\bllm\b/g," ").replace(/\s+/g," ").trim().replace(/s$/,""):""}function ee(t){return F(t.slug)==="large language model"||F(t.name)==="large language model"}function te(t){return t.tags.includes(X)?t.methods.filter(s=>!ee(s)):t.methods}const se=({name:t,slug:s,logoUrl:r})=>{const[a,g]=m.useState(!1);return!r||a?null:e.jsx(y,{to:`/orgs/${s}`,className:"paper-organization-logo","aria-label":`View ${t} organization`,title:t,children:e.jsx("img",{src:r,alt:"",onError:()=>g(!0)})})},he=({paper:t,rank:s,showInstitution:r=!0,onClickTag:a,highlightQuery:g,followReasons:l})=>{const f=E(),i=`/paper/${t.id}`,n=m.useCallback(()=>{f.prefetchQuery({queryKey:T.detail(t.id),queryFn:()=>R.get(t.id,!0),staleTime:10*60*1e3})},[t.id,f]),u=t.authors.slice(0,3).map((o,h)=>{var L,p;const c=(L=t.authorIds)==null?void 0:L[h],d=(p=t.authorHfProfiles)==null?void 0:p[h];return e.jsxs(m.Fragment,{children:[h>0&&", ",d&&e.jsx(P,{className:"paper-card-author-avatar",url:d.avatarUrl}),c?e.jsx(y,{to:`/authors/${c}`,children:o}):o]},h)}),x=t.authors.length,j=te(t);return e.jsxs("article",{className:"paper-card",children:[s!=null&&e.jsx(y,{to:i,className:"paper-thumb-wrap",onFocus:n,onMouseEnter:n,children:e.jsx(Q,{paperId:t.id,title:t.title,thumbnailUrl:t.thumbnailUrl,priority:s<=3})}),e.jsxs("div",{className:"paper-body",children:[e.jsxs("div",{className:"paper-body-main",children:[l&&l.length>0&&e.jsxs("div",{className:"paper-follow-reason",children:["Because you follow ",J(l)]}),e.jsxs("h3",{className:"paper-title",children:[e.jsx(y,{to:i,onFocus:n,onMouseEnter:n,children:e.jsx(H,{title:t.title,highlight:g})}),r&&t.organizations.length>0&&e.jsx("span",{className:"paper-organization-logos",children:t.organizations.map(o=>e.jsx(se,{...o},o.slug))})]}),e.jsxs("div",{className:"paper-authors",children:[u,x>3&&e.jsxs("span",{children:[", ","+",x-3," authors"]}),t.date&&e.jsxs(e.Fragment,{children:[x>0?" · ":"",e.jsx("span",{children:t.date})]}),t.citations>0&&e.jsxs(e.Fragment,{children:[x>0||t.date?" · ":"",e.jsxs("span",{children:[t.citations.toLocaleString()," citations"]})]})]}),t.abstract&&e.jsx("p",{className:"paper-abstract",children:e.jsx(Z,{text:t.abstract,highlight:g})}),t.sotaRanks.length>0&&e.jsx(U,{ranks:t.sotaRanks,paperHref:i}),(t.tags.length>0||j.length>0)&&e.jsxs("div",{className:"paper-tags paper-tags--clamped",children:[t.tags.map(o=>e.jsx(K,{slug:o,onClick:a},o)),j.map(o=>e.jsx(O,{method:o},o.id||o.slug||o.name))]})]}),(t.githubUrl||t.hfUrl)&&e.jsxs("div",{className:"paper-resources",children:[N(t.githubUrl)&&e.jsxs("a",{className:"paper-resource is-link",href:N(t.githubUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":"Open GitHub repository",onClick:o=>o.stopPropagation(),children:[e.jsx(_,{name:"github",size:20}),t.velocity24h!=null&&t.velocity24h>0&&e.jsxs("span",{className:"resource-stat",children:[e.jsxs("span",{className:"resource-value",children:[e.jsx("span",{className:"gh-rate-arrow",children:"↑"}),re(t.velocity24h)]}),e.jsx("span",{className:"resource-label",children:"stars / hr"})]})]}),N(t.hfUrl)&&t.hfKind&&e.jsxs("a",{className:"paper-resource is-link",href:N(t.hfUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":`Open Hugging Face ${t.hfKind}`,onClick:o=>o.stopPropagation(),children:[e.jsx(V,{size:20}),e.jsxs("span",{className:"resource-stat",children:[e.jsx("span",{className:"resource-value",children:t.hfCount}),e.jsx("span",{className:"resource-label",children:t.hfKind})]})]})]})]})]})};function re(t){return t.toFixed(1)}export{_ as I,O as M,he as P,U as S,K as T,Q as a}; +import{f as E,K as m,j as e,L as y,c as S}from"./index-D6jcIRWs.js";import{a as R,p as T}from"./papers-DIIIPDpj.js";import{A as P}from"./AuthorAvatar-UMHOVOr9.js";import{L as H,a as Z}from"./LatexTitle-D_92Jowu.js";import{h as B,d as D,b as G,c as I}from"./colors-CLwl8a2d.js";import{s as N}from"./safeExternalHref-CkBrsh84.js";const K=({slug:t,label:s,onClick:r})=>{const a=S(),g=B(t),l=I(g),f=i=>{if(i.stopPropagation(),r){r(t);return}a(`/tasks/${t}`)};return e.jsxs("span",{className:"tag-chip",style:{background:l.bg,color:l.text},onClick:f,children:[e.jsx("span",{className:"dot",style:{background:l.dot}}),D(s||G(t),t)]})},O=({method:t,onClick:s})=>{const r=S(),a=t.slug||t.id||"";if(!a)return null;const g=l=>{if(l.stopPropagation(),s){s(a);return}r(`/methods/${a}`)};return e.jsx("span",{className:"method-chip",onClick:g,children:t.name})},$={1:"SOTA 🏆",2:"#2",3:"#3"},w=({units:t,paperHref:s})=>{const r=m.useRef(null),a=m.useRef(null),[g,l]=m.useState(t.length);if(m.useLayoutEffect(()=>{const n=r.current,u=a.current;if(!n||!u||t.length===0)return;const x=h=>(u.textContent=h,u.scrollWidth),j=()=>{const h=n.clientWidth;if(h<=0)return;let c=0,d=0;for(const L of t){const p=x(L.measureText);if(c+p<=h)c+=p,d+=1;else break}if(d0&&c+x(` · +${t.length-d} more`)>h;)d-=1,c-=x(t[d].measureText);d===0&&(d=1)}l(d)};j();const o=new ResizeObserver(j);return o.observe(n),()=>o.disconnect()},[t]),t.length===0)return null;const f=t.slice(0,Math.max(1,Math.min(g,t.length))),i=t.length-f.length;return e.jsxs("div",{className:"paper-sota",ref:r,children:[e.jsx("span",{ref:a,className:"paper-sota-measure","aria-hidden":"true"}),f.map((n,u)=>e.jsxs(m.Fragment,{children:[n.isGroupStart?e.jsxs(e.Fragment,{children:[u>0&&e.jsx("span",{className:"paper-sota-sep",children:" · "}),e.jsx("span",{className:`paper-sota-label${n.rank===1?" paper-sota-label--sota":""}`,children:$[n.rank]}),e.jsx("span",{className:"paper-sota-on",children:" on "})]}):e.jsx("span",{className:"paper-sota-sep",children:", "}),n.href?e.jsx(y,{to:n.href,className:"paper-sota-name",onClick:x=>x.stopPropagation(),children:n.name}):e.jsx("span",{className:"paper-sota-name",children:n.name})]},`${n.href||n.name}-${u}`)),i>0&&e.jsxs(y,{to:`${s}#results`,className:"paper-sota-more",onClick:n=>n.stopPropagation(),children:[" · +",i," more"]})]})},U=({ranks:t,paperHref:s,wrap:r=!1})=>{const a=m.useMemo(()=>{const l=[];let f=!0;for(const i of[1,2,3]){const n=t.filter(u=>u.rank===i);n.forEach((u,x)=>{const j=x===0,o=j?`${f?"":" · "}${$[i]} on `:", ";l.push({name:u.name,href:u.href,rank:i,isGroupStart:j,measureText:o+u.name})}),n.length>0&&(f=!1)}return l},[t]),g=m.useMemo(()=>[1,2,3].map(l=>t.filter(i=>i.rank===l).map((i,n)=>({name:i.name,href:i.href,rank:l,isGroupStart:n===0,measureText:(n===0?`${$[l]} on `:", ")+i.name}))).filter(l=>l.length>0),[t]);return r?g.length===0?null:e.jsx("div",{className:"paper-sota-stack",children:g.map(l=>e.jsx(w,{units:l,paperHref:s},l[0].rank))}):a.length===0?null:e.jsx(w,{units:a,paperHref:s})},_=({name:t,size:s=14})=>{const r={search:e.jsx("path",{d:"M11 11l3 3M7 12.5a5.5 5.5 0 110-11 5.5 5.5 0 010 11z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),arrowUp:e.jsx("path",{d:"M8 3l5 6H3l5-6z",fill:"currentColor"}),arrowLeft:e.jsx("path",{d:"M9 3l-4 5 4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),arrowRight:e.jsx("path",{d:"M7 3l4 5-4 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),external:e.jsx("path",{d:"M5 3h-2v8h8v-2M9 3h3v3M7 9l5-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),github:e.jsx("path",{d:"M8 1a7 7 0 00-2.21 13.64c.35.06.48-.15.48-.34v-1.2c-1.95.42-2.36-.94-2.36-.94-.32-.81-.78-1.03-.78-1.03-.64-.43.05-.43.05-.43.7.05 1.07.72 1.07.72.62 1.07 1.64.76 2.04.58.06-.45.24-.76.44-.94-1.55-.18-3.18-.78-3.18-3.46 0-.76.27-1.39.72-1.88-.07-.18-.31-.89.07-1.86 0 0 .59-.19 1.92.72.56-.15 1.16-.23 1.75-.24.59 0 1.19.08 1.75.24 1.33-.9 1.92-.72 1.92-.72.38.97.14 1.68.07 1.86.45.49.72 1.12.72 1.88 0 2.69-1.64 3.28-3.19 3.45.25.22.48.65.48 1.32v1.95c0 .19.13.41.49.34A7 7 0 008 1z",fill:"currentColor"}),citation:e.jsx("path",{d:"M3 4h3v3H3zM4 7v1.5a1.5 1.5 0 01-1.5 1.5M9 4h3v3H9zM10 7v1.5a1.5 1.5 0 01-1.5 1.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),bookmark:e.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),chart:e.jsx("path",{d:"M2 13h12M3 11l3-4 3 2 4-5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),chat:e.jsx("path",{d:"M3 3h10v7H7l-3 3v-3H3V3z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),pdf:e.jsx("path",{d:"M5 2h5l3 3v9H5V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),copy:e.jsx("path",{d:"M5 5h7v8H5V5zM3 3h7v2M3 3v8h2",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinejoin:"round"}),sparkle:e.jsx("path",{d:"M8 2l1.2 3.8L13 7l-3.8 1.2L8 12l-1.2-3.8L3 7l3.8-1.2L8 2z",fill:"currentColor"}),user:e.jsx("path",{d:"M8 8a3 3 0 100-6 3 3 0 000 6zM2 14c0-3 2.5-5 6-5s6 2 6 5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),globe:e.jsx("path",{d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM1.5 8h13M8 1.5c1.7 1.9 2.6 4.2 2.6 6.5s-.9 4.6-2.6 6.5M8 1.5C6.3 3.4 5.4 5.7 5.4 8s.9 4.6 2.6 6.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none",strokeLinecap:"round"}),menu:e.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:e.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),pencil:e.jsx("path",{d:"M10.5 2.5l3 3L6 13H3v-3l7.5-7.5zM9 4l3 3",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})};return e.jsx("svg",{className:s===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:s,height:s,children:r[t]})},V=({size:t=16})=>e.jsxs("svg",{className:"hf-logo",width:t,height:t,viewBox:"0 0 95 88",fill:"none","aria-hidden":"true",focusable:"false",children:[e.jsx("path",{fill:"#FFD21E",d:"M47.21 76.5a34.75 34.75 0 1 0 0-69.5 34.75 34.75 0 0 0 0 69.5Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M81.96 41.75a34.75 34.75 0 1 0-69.5 0 34.75 34.75 0 0 0 69.5 0Zm-73.5 0a38.75 38.75 0 1 1 77.5 0 38.75 38.75 0 0 1-77.5 0Z"}),e.jsx("path",{fill:"#3A3B45",d:"M58.5 32.3c1.28.44 1.78 3.06 3.07 2.38a5 5 0 1 0-6.76-2.07c.61 1.15 2.55-.72 3.7-.32ZM34.95 32.3c-1.28.44-1.79 3.06-3.07 2.38a5 5 0 1 1 6.76-2.07c-.61 1.15-2.56-.72-3.7-.32Z"}),e.jsx("path",{fill:"#FF323D",d:"M46.96 56.29c9.83 0 13-8.76 13-13.26 0-2.34-1.57-1.6-4.09-.36-2.33 1.15-5.46 2.74-8.9 2.74-7.19 0-13-6.88-13-2.38s3.16 13.26 13 13.26Z"}),e.jsx("path",{fill:"#3A3B45",fillRule:"evenodd",clipRule:"evenodd",d:"M39.43 54a8.7 8.7 0 0 1 5.3-4.49c.4-.12.81.57 1.24 1.28.4.68.82 1.37 1.24 1.37.45 0 .9-.68 1.33-1.35.45-.7.89-1.38 1.32-1.25a8.61 8.61 0 0 1 5 4.17c3.73-2.94 5.1-7.74 5.1-10.7 0-2.34-1.57-1.6-4.09-.36l-.14.07c-2.31 1.15-5.39 2.67-8.77 2.67s-6.45-1.52-8.77-2.67c-2.6-1.29-4.23-2.1-4.23.29 0 3.05 1.46 8.06 5.47 10.97Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M70.71 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM24.21 37a3.25 3.25 0 1 0 0-6.5 3.25 3.25 0 0 0 0 6.5ZM17.52 48c-1.62 0-3.06.66-4.07 1.87a5.97 5.97 0 0 0-1.33 3.76 7.1 7.1 0 0 0-1.94-.3c-1.55 0-2.95.59-3.94 1.66a5.8 5.8 0 0 0-.8 7 5.3 5.3 0 0 0-1.79 2.82c-.24.9-.48 2.8.8 4.74a5.22 5.22 0 0 0-.37 5.02c1.02 2.32 3.57 4.14 8.52 6.1 3.07 1.22 5.89 2 5.91 2.01a44.33 44.33 0 0 0 10.93 1.6c5.86 0 10.05-1.8 12.46-5.34 3.88-5.69 3.33-10.9-1.7-15.92-2.77-2.78-4.62-6.87-5-7.77-.78-2.66-2.84-5.62-6.25-5.62a5.7 5.7 0 0 0-4.6 2.46c-1-1.26-1.98-2.25-2.86-2.82A7.4 7.4 0 0 0 17.52 48Zm0 4c.51 0 1.14.22 1.82.65 2.14 1.36 6.25 8.43 7.76 11.18.5.92 1.37 1.31 2.14 1.31 1.55 0 2.75-1.53.15-3.48-3.92-2.93-2.55-7.72-.68-8.01.08-.02.17-.02.24-.02 1.7 0 2.45 2.93 2.45 2.93s2.2 5.52 5.98 9.3c3.77 3.77 3.97 6.8 1.22 10.83-1.88 2.75-5.47 3.58-9.16 3.58-3.81 0-7.73-.9-9.92-1.46-.11-.03-13.45-3.8-11.76-7 .28-.54.75-.76 1.34-.76 2.38 0 6.7 3.54 8.57 3.54.41 0 .7-.17.83-.6.79-2.85-12.06-4.05-10.98-8.17.2-.73.71-1.02 1.44-1.02 3.14 0 10.2 5.53 11.68 5.53.11 0 .2-.03.24-.1.74-1.2.33-2.04-4.9-5.2-5.21-3.16-8.88-5.06-6.8-7.33.24-.26.58-.38 1-.38 3.17 0 10.66 6.82 10.66 6.82s2.02 2.1 3.25 2.1c.28 0 .52-.1.68-.38.86-1.46-8.06-8.22-8.56-11.01-.34-1.9.24-2.85 1.31-2.85Z"}),e.jsx("path",{fill:"#FFD21E",d:"M38.6 76.69c2.75-4.04 2.55-7.07-1.22-10.84-3.78-3.77-5.98-9.3-5.98-9.3s-.82-3.2-2.69-2.9c-1.87.3-3.24 5.08.68 8.01 3.91 2.93-.78 4.92-2.29 2.17-1.5-2.75-5.62-9.82-7.76-11.18-2.13-1.35-3.63-.6-3.13 2.2.5 2.79 9.43 9.55 8.56 11-.87 1.47-3.93-1.71-3.93-1.71s-9.57-8.71-11.66-6.44c-2.08 2.27 1.59 4.17 6.8 7.33 5.23 3.16 5.64 4 4.9 5.2-.75 1.2-12.28-8.53-13.36-4.4-1.08 4.11 11.77 5.3 10.98 8.15-.8 2.85-9.06-5.38-10.74-2.18-1.7 3.21 11.65 6.98 11.76 7.01 4.3 1.12 15.25 3.49 19.08-2.12Z"}),e.jsx("path",{fill:"#FF9D0B",d:"M77.4 48c1.62 0 3.07.66 4.07 1.87a5.97 5.97 0 0 1 1.33 3.76 7.1 7.1 0 0 1 1.95-.3c1.55 0 2.95.59 3.94 1.66a5.8 5.8 0 0 1 .8 7 5.3 5.3 0 0 1 1.78 2.82c.24.9.48 2.8-.8 4.74a5.22 5.22 0 0 1 .37 5.02c-1.02 2.32-3.57 4.14-8.51 6.1-3.08 1.22-5.9 2-5.92 2.01a44.33 44.33 0 0 1-10.93 1.6c-5.86 0-10.05-1.8-12.46-5.34-3.88-5.69-3.33-10.9 1.7-15.92 2.78-2.78 4.63-6.87 5.01-7.77.78-2.66 2.83-5.62 6.24-5.62a5.7 5.7 0 0 1 4.6 2.46c1-1.26 1.98-2.25 2.87-2.82A7.4 7.4 0 0 1 77.4 48Zm0 4c-.51 0-1.13.22-1.82.65-2.13 1.36-6.25 8.43-7.76 11.18a2.43 2.43 0 0 1-2.14 1.31c-1.54 0-2.75-1.53-.14-3.48 3.91-2.93 2.54-7.72.67-8.01a1.54 1.54 0 0 0-.24-.02c-1.7 0-2.45 2.93-2.45 2.93s-2.2 5.52-5.97 9.3c-3.78 3.77-3.98 6.8-1.22 10.83 1.87 2.75 5.47 3.58 9.15 3.58 3.82 0 7.73-.9 9.93-1.46.1-.03 13.45-3.8 11.76-7-.29-.54-.75-.76-1.34-.76-2.38 0-6.71 3.54-8.57 3.54-.42 0-.71-.17-.83-.6-.8-2.85 12.05-4.05 10.97-8.17-.19-.73-.7-1.02-1.44-1.02-3.14 0-10.2 5.53-11.68 5.53-.1 0-.19-.03-.23-.1-.74-1.2-.34-2.04 4.88-5.2 5.23-3.16 8.9-5.06 6.8-7.33-.23-.26-.57-.38-.98-.38-3.18 0-10.67 6.82-10.67 6.82s-2.02 2.1-3.24 2.1a.74.74 0 0 1-.68-.38c-.87-1.46 8.05-8.22 8.55-11.01.34-1.9-.24-2.85-1.31-2.85Z"}),e.jsx("path",{fill:"#FFD21E",d:"M56.33 76.69c-2.75-4.04-2.56-7.07 1.22-10.84 3.77-3.77 5.97-9.3 5.97-9.3s.82-3.2 2.7-2.9c1.86.3 3.23 5.08-.68 8.01-3.92 2.93.78 4.92 2.28 2.17 1.51-2.75 5.63-9.82 7.76-11.18 2.13-1.35 3.64-.6 3.13 2.2-.5 2.79-9.42 9.55-8.55 11 .86 1.47 3.92-1.71 3.92-1.71s9.58-8.71 11.66-6.44c2.08 2.27-1.58 4.17-6.8 7.33-5.23 3.16-5.63 4-4.9 5.2.75 1.2 12.28-8.53 13.36-4.4 1.08 4.11-11.76 5.3-10.97 8.15.8 2.85 9.05-5.38 10.74-2.18 1.69 3.21-11.65 6.98-11.76 7.01-4.31 1.12-15.26 3.49-19.08-2.12Z"})]}),q=t=>{let s=2166136261;for(let r=0;r(s=Math.imul(s^s>>>15,2246822507),s=Math.imul(s^s>>>13,3266489909),s^=s>>>16,(s>>>0)%1e4/1e4)},Y=({paperId:t})=>{const s=q(t),r=160,a=220,g=[.85+s()*.1,.55+s()*.25],l=.45+s()*.3,f=[],i=9+Math.floor(s()*3);for(let M=0;M.3,u=Math.floor(s()*3),x=[],j=6+Math.floor(s()*3);for(let M=0;Me.jsx("rect",{x:c+(r-c*2)*(1-M)/2,y:A+v*2.4,width:(r-c*2)*M,height:1.4,fill:h,rx:.3},`t${v}`)),e.jsx("rect",{x:c+(r-c*2)*(1-l)/2,y:z,width:(r-c*2)*l,height:.9,fill:o,opacity:.7,rx:.2}),e.jsx("rect",{x:c,y:W,width:6,height:1,fill:h,opacity:.6}),f.map((M,v)=>{const C=k+v*2.1;return C>a-c-1?null:e.jsx("rect",{x:L,y:C,width:d*M,height:.8,fill:o,opacity:.55,rx:.2},`l${v}`)}),n&&e.jsxs("g",{children:[e.jsx("rect",{x:p,y:k,width:d,height:14,fill:"#F0EBE0",stroke:o,strokeWidth:.3,opacity:.9}),u===0&&e.jsx("g",{stroke:h,strokeWidth:.4,fill:"none",opacity:.6,children:e.jsx("polyline",{points:`${p+2},${k+11} ${p+6},${k+8} ${p+10},${k+9} ${p+14},${k+5} ${p+18},${k+6} ${p+22},${k+3}`})}),u===1&&e.jsxs("g",{opacity:.55,children:[e.jsx("circle",{cx:p+d/2,cy:k+7,r:3.5,fill:h}),e.jsx("rect",{x:p+2,y:k+11,width:d-4,height:1.5,fill:o})]}),u===2&&e.jsxs("g",{opacity:.55,children:[e.jsx("rect",{x:p+3,y:k+5,width:d-6,height:1,fill:h}),e.jsx("rect",{x:p+6,y:k+8,width:d-12,height:.8,fill:h})]})]}),x.map((M,v)=>{const C=k+(n?16:0)+v*2.1;return C>a-c-1?null:e.jsx("rect",{x:p,y:C,width:d*M,height:.8,fill:o,opacity:.55,rx:.2},`r${v}`)})]})})},Q=({paperId:t,title:s,thumbnailUrl:r,priority:a=!1})=>{const[g,l]=m.useState(!1),[f,i]=m.useState(0),[n,u]=m.useState(a),x=m.useRef(null);m.useEffect(()=>{l(!1),i(0)},[r]);const j=m.useMemo(()=>{if(!r)return null;if(f===0)return r;const o=r.includes("?")?"&":"?";return`${r}${o}retry=${f}`},[r,f]);return m.useEffect(()=>{if(a||n)return;const o=x.current;if(!o)return;const h=new IntersectionObserver(([c])=>{c.isIntersecting&&(u(!0),h.disconnect())},{rootMargin:"250px"});return h.observe(o),()=>h.disconnect()},[a,n]),r&&!g?e.jsx("div",{ref:x,style:{width:160,height:220,background:"#FDFCF9",border:"1px solid var(--hairline-strong)",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.04), 0 4px 8px -4px rgba(0,0,0,0.08)",flexShrink:0,overflow:"hidden",position:"relative"},children:(a||n)&&j&&e.jsx("img",{src:j,alt:`Thumbnail for ${s}`,loading:a?"eager":"lazy",decoding:"async",fetchPriority:a?"high":"auto",style:{width:"100%",height:"100%",objectFit:"contain",display:"block"},onError:()=>{if(f<1){i(o=>o+1);return}l(!0)}},j)}):e.jsx(Y,{paperId:t})};function J(t){const s=[...new Set(t.map(a=>a.replace(/ \(subtask\)$/,"")))],r=s.length>3?[...s.slice(0,2),`${s.length-2} more`]:s;return r.length>1?`${r.slice(0,-1).join(", ")} and ${r[r.length-1]}`:r[0]}const X="language-modeling";function F(t){return t?t.toLowerCase().replace(/\(.*?\)/g," ").replace(/[^a-z]+/g," ").replace(/\bllm\b/g," ").replace(/\s+/g," ").trim().replace(/s$/,""):""}function ee(t){return F(t.slug)==="large language model"||F(t.name)==="large language model"}function te(t){return t.tags.includes(X)?t.methods.filter(s=>!ee(s)):t.methods}const se=({name:t,slug:s,logoUrl:r})=>{const[a,g]=m.useState(!1);return!r||a?null:e.jsx(y,{to:`/orgs/${s}`,className:"paper-organization-logo","aria-label":`View ${t} organization`,title:t,children:e.jsx("img",{src:r,alt:"",onError:()=>g(!0)})})},he=({paper:t,rank:s,showInstitution:r=!0,onClickTag:a,highlightQuery:g,followReasons:l})=>{const f=E(),i=`/paper/${t.id}`,n=m.useCallback(()=>{f.prefetchQuery({queryKey:T.detail(t.id),queryFn:()=>R.get(t.id,!0),staleTime:10*60*1e3})},[t.id,f]),u=t.authors.slice(0,3).map((o,h)=>{var L,p;const c=(L=t.authorIds)==null?void 0:L[h],d=(p=t.authorHfProfiles)==null?void 0:p[h];return e.jsxs(m.Fragment,{children:[h>0&&", ",d&&e.jsx(P,{className:"paper-card-author-avatar",url:d.avatarUrl}),c?e.jsx(y,{to:`/authors/${c}`,children:o}):o]},h)}),x=t.authors.length,j=te(t);return e.jsxs("article",{className:"paper-card",children:[s!=null&&e.jsx(y,{to:i,className:"paper-thumb-wrap",onFocus:n,onMouseEnter:n,children:e.jsx(Q,{paperId:t.id,title:t.title,thumbnailUrl:t.thumbnailUrl,priority:s<=3})}),e.jsxs("div",{className:"paper-body",children:[e.jsxs("div",{className:"paper-body-main",children:[l&&l.length>0&&e.jsxs("div",{className:"paper-follow-reason",children:["Because you follow ",J(l)]}),e.jsxs("h3",{className:"paper-title",children:[e.jsx(y,{to:i,onFocus:n,onMouseEnter:n,children:e.jsx(H,{title:t.title,highlight:g})}),r&&t.organizations.length>0&&e.jsx("span",{className:"paper-organization-logos",children:t.organizations.map(o=>e.jsx(se,{...o},o.slug))})]}),e.jsxs("div",{className:"paper-authors",children:[u,x>3&&e.jsxs("span",{children:[", ","+",x-3," authors"]}),t.date&&e.jsxs(e.Fragment,{children:[x>0?" · ":"",e.jsx("span",{children:t.date})]}),t.citations>0&&e.jsxs(e.Fragment,{children:[x>0||t.date?" · ":"",e.jsxs("span",{children:[t.citations.toLocaleString()," citations"]})]})]}),t.abstract&&e.jsx("p",{className:"paper-abstract",children:e.jsx(Z,{text:t.abstract,highlight:g})}),t.sotaRanks.length>0&&e.jsx(U,{ranks:t.sotaRanks,paperHref:i}),(t.tags.length>0||j.length>0)&&e.jsxs("div",{className:"paper-tags paper-tags--clamped",children:[t.tags.map(o=>e.jsx(K,{slug:o,onClick:a},o)),j.map(o=>e.jsx(O,{method:o},o.id||o.slug||o.name))]})]}),(t.githubUrl||t.hfUrl)&&e.jsxs("div",{className:"paper-resources",children:[N(t.githubUrl)&&e.jsxs("a",{className:"paper-resource is-link",href:N(t.githubUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":"Open GitHub repository",onClick:o=>o.stopPropagation(),children:[e.jsx(_,{name:"github",size:20}),t.velocity24h!=null&&t.velocity24h>0&&e.jsxs("span",{className:"resource-stat",children:[e.jsxs("span",{className:"resource-value",children:[e.jsx("span",{className:"gh-rate-arrow",children:"↑"}),re(t.velocity24h)]}),e.jsx("span",{className:"resource-label",children:"stars / hr"})]})]}),N(t.hfUrl)&&t.hfKind&&e.jsxs("a",{className:"paper-resource is-link",href:N(t.hfUrl)??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":`Open Hugging Face ${t.hfKind}`,onClick:o=>o.stopPropagation(),children:[e.jsx(V,{size:20}),e.jsxs("span",{className:"resource-stat",children:[e.jsx("span",{className:"resource-value",children:t.hfCount}),e.jsx("span",{className:"resource-label",children:t.hfKind})]})]})]})]})]})};function re(t){return t.toFixed(1)}export{_ as I,O as M,he as P,U as S,K as T,Q as a}; diff --git a/assets/copy-D9WKw0Bi.js b/assets/copy-BmzqMihw.js similarity index 89% rename from assets/copy-D9WKw0Bi.js rename to assets/copy-BmzqMihw.js index 03f2903a84a324855a671209c5ae9c1f741f796c..cb33c97283a3441571155ee1afb769b6b035780a 100644 --- a/assets/copy-D9WKw0Bi.js +++ b/assets/copy-BmzqMihw.js @@ -1,4 +1,4 @@ -import{n as e}from"./index-CqKcHUvZ.js";/** +import{n as e}from"./index-D6jcIRWs.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/database-DrVmdfNa.js b/assets/database-DKdKRr_t.js similarity index 89% rename from assets/database-DrVmdfNa.js rename to assets/database-DKdKRr_t.js index 7b3fd2b8450fbb9c97af77f0f7d0acee6346e718..b2152b11c3fed864a56dc93c5e5305f9863c199b 100644 --- a/assets/database-DrVmdfNa.js +++ b/assets/database-DKdKRr_t.js @@ -1,4 +1,4 @@ -import{n as e}from"./index-CqKcHUvZ.js";/** +import{n as e}from"./index-D6jcIRWs.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/dialog-B-oqHDuH.js b/assets/dialog-vGFIbcd-.js similarity index 93% rename from assets/dialog-B-oqHDuH.js rename to assets/dialog-vGFIbcd-.js index b80d466ec78ab0eea5eb5292f355194e10689421..42a9aa518482f5b95e427714fc4355a6063d66e4 100644 --- a/assets/dialog-B-oqHDuH.js +++ b/assets/dialog-vGFIbcd-.js @@ -1 +1 @@ -import{a7 as f,r as l,j as t,a8 as p,aa as d,ac as g,X as x,B as o,a9 as n,ad as i,ae as r}from"./index-CqKcHUvZ.js";const w=f,u=p,c=l.forwardRef(({className:a,...e},s)=>t.jsx(n,{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=n.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(i,{ref:s,className:o("text-lg font-semibold leading-none tracking-tight",a),...e}));D.displayName=i.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{a9 as f,r as l,j as t,aa as p,ac as d,ae as g,X as x,B as o,ab as n,af as i,ag as r}from"./index-D6jcIRWs.js";const w=f,u=p,c=l.forwardRef(({className:a,...e},s)=>t.jsx(n,{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=n.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(i,{ref:s,className:o("text-lg font-semibold leading-none tracking-tight",a),...e}));D.displayName=i.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/evaluationQueryInvalidation-B16EDNu-.js b/assets/evaluationQueryInvalidation-D5wBpmlA.js similarity index 96% rename from assets/evaluationQueryInvalidation-B16EDNu-.js rename to assets/evaluationQueryInvalidation-D5wBpmlA.js index cac78e1ba712d53cfcd2c32ec81ae224c577d7d4..f7cb3411477bf3d0e5c99a8ed47a9201e25931ec 100644 --- a/assets/evaluationQueryInvalidation-B16EDNu-.js +++ b/assets/evaluationQueryInvalidation-D5wBpmlA.js @@ -1 +1 @@ -import{i as S,a as k}from"./queryInvalidation-fI4V8eHx.js";function h(d,s,i,n){const o=new Set(i.flatMap(t=>t.kind==="create"?[]:[String(t.evaluationId)]));return{paperId:d,arxivId:n,contexts:[...s.filter(t=>t.id!==void 0&&o.has(String(t.id))),...i.flatMap(t=>t.kind==="delete"?[]:[t.data])]}}function _(d,s){const i=new Set(s.contexts.flatMap(a=>a.dataset_id==null?[]:[String(a.dataset_id)])),n=new Set(s.contexts.flatMap(a=>a.task_id==null?[]:[String(a.task_id)])),o=new Set([s.paperId]),t=new Set;s.arxivId&&t.add(s.arxivId);const f=new Set(s.contexts.map(a=>`${a.task_id}:${a.dataset_id}`)),p=d.getQueryCache().findAll({predicate:a=>a.queryKey[0]==="dataset-evals"||a.queryKey[0]==="evaluations"&&a.queryKey[1]==="paper"});for(const a of p)for(const r of a.state.data??[])f.has(`${r.task_id}:${r.dataset_id}`)&&(o.add(String(r.paper_id)),r.paper_arxiv_id&&t.add(r.paper_arxiv_id));S(d,[...o,...t]),k(d),d.invalidateQueries({predicate:a=>a.queryKey[0]==="evaluations"&&a.queryKey[1]==="paper"&&o.has(String(a.queryKey[2]))}),d.invalidateQueries({predicate:a=>{const[r,l]=a.queryKey;switch(r){case"dataset-evals":case"dataset-tasks":return i.has(String(l));case"dataset":{const e=a.state.data;return i.has(String(l))||!!(e&&i.has(String(e.id)))}case"task-page":{const e=a.state.data;return n.has(String(l))||!!(e&&(n.has(String(e.task.id))||e.subtask_benchmarks.some(c=>n.has(String(c.subtask_id)))||e.benchmarks.some(c=>i.has(String(c.id)))||e.subtask_benchmarks.some(c=>c.benchmarks.some(u=>i.has(String(u.id))))))}case"task-benchmark-trends":{const e=a.state.data;return n.has(String(l))||!!(e&&n.has(String(e.task_id)))}default:return!1}}})}export{h as e,_ as r}; +import{i as S,a as k}from"./queryInvalidation-BxCpTdQe.js";function h(d,s,i,n){const o=new Set(i.flatMap(t=>t.kind==="create"?[]:[String(t.evaluationId)]));return{paperId:d,arxivId:n,contexts:[...s.filter(t=>t.id!==void 0&&o.has(String(t.id))),...i.flatMap(t=>t.kind==="delete"?[]:[t.data])]}}function _(d,s){const i=new Set(s.contexts.flatMap(a=>a.dataset_id==null?[]:[String(a.dataset_id)])),n=new Set(s.contexts.flatMap(a=>a.task_id==null?[]:[String(a.task_id)])),o=new Set([s.paperId]),t=new Set;s.arxivId&&t.add(s.arxivId);const f=new Set(s.contexts.map(a=>`${a.task_id}:${a.dataset_id}`)),p=d.getQueryCache().findAll({predicate:a=>a.queryKey[0]==="dataset-evals"||a.queryKey[0]==="evaluations"&&a.queryKey[1]==="paper"});for(const a of p)for(const r of a.state.data??[])f.has(`${r.task_id}:${r.dataset_id}`)&&(o.add(String(r.paper_id)),r.paper_arxiv_id&&t.add(r.paper_arxiv_id));S(d,[...o,...t]),k(d),d.invalidateQueries({predicate:a=>a.queryKey[0]==="evaluations"&&a.queryKey[1]==="paper"&&o.has(String(a.queryKey[2]))}),d.invalidateQueries({predicate:a=>{const[r,l]=a.queryKey;switch(r){case"dataset-evals":case"dataset-tasks":return i.has(String(l));case"dataset":{const e=a.state.data;return i.has(String(l))||!!(e&&i.has(String(e.id)))}case"task-page":{const e=a.state.data;return n.has(String(l))||!!(e&&(n.has(String(e.task.id))||e.subtask_benchmarks.some(c=>n.has(String(c.subtask_id)))||e.benchmarks.some(c=>i.has(String(c.id)))||e.subtask_benchmarks.some(c=>c.benchmarks.some(u=>i.has(String(u.id))))))}case"task-benchmark-trends":{const e=a.state.data;return n.has(String(l))||!!(e&&n.has(String(e.task_id)))}default:return!1}}})}export{h as e,_ as r}; diff --git a/assets/external-link-CrrdDZf6.js b/assets/external-link-C_yz2sXa.js similarity index 89% rename from assets/external-link-CrrdDZf6.js rename to assets/external-link-C_yz2sXa.js index 0d76653607bf5dee3216e7543b25a28741fe7008..17a6b6c7477a8ef347e95fd723c2c29abfd3a607 100644 --- a/assets/external-link-CrrdDZf6.js +++ b/assets/external-link-C_yz2sXa.js @@ -1,4 +1,4 @@ -import{n as a}from"./index-CqKcHUvZ.js";/** +import{n as a}from"./index-D6jcIRWs.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/file-text-DnNBEwSF.js b/assets/file-text-4G2I5_Zo.js similarity index 91% rename from assets/file-text-DnNBEwSF.js rename to assets/file-text-4G2I5_Zo.js index dcdb16cd3e45027ff7d7791a5685fe2abf0fc080..08eec40c0c6ba2e8fd026b58274a89969094b4ca 100644 --- a/assets/file-text-DnNBEwSF.js +++ b/assets/file-text-4G2I5_Zo.js @@ -1,4 +1,4 @@ -import{n as e}from"./index-CqKcHUvZ.js";/** +import{n as e}from"./index-D6jcIRWs.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/github-sUmGdHig.js b/assets/github-B7D_19Qm.js similarity index 92% rename from assets/github-sUmGdHig.js rename to assets/github-B7D_19Qm.js index 081279115df2cd8d71b5fa8fcf34d54ee0a1186a..6ab14880b9e5a92486a128539f833fd6a9b1ebce 100644 --- a/assets/github-sUmGdHig.js +++ b/assets/github-B7D_19Qm.js @@ -1,4 +1,4 @@ -import{n as c}from"./index-CqKcHUvZ.js";/** +import{n as c}from"./index-D6jcIRWs.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/globe-6Eu_W8am.js b/assets/globe-iw_Y78tU.js similarity index 89% rename from assets/globe-6Eu_W8am.js rename to assets/globe-iw_Y78tU.js index f96ef062512ff83ccdf0586231957e7ec2ac8ac5..0c1a0fb117921a85f56dd098cbb128a687ea7675 100644 --- a/assets/globe-6Eu_W8am.js +++ b/assets/globe-iw_Y78tU.js @@ -1,4 +1,4 @@ -import{n as e}from"./index-CqKcHUvZ.js";/** +import{n as e}from"./index-D6jcIRWs.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/hover-card-BTsA69o8.js b/assets/hover-card-DPpv0l_x.js similarity index 68% rename from assets/hover-card-BTsA69o8.js rename to assets/hover-card-DPpv0l_x.js index 1207869f4a3ab5f4a4cec48262d8e285e8807253..09104253dedddd9c4c2da07dee69d33f06086153 100644 --- a/assets/hover-card-BTsA69o8.js +++ b/assets/hover-card-DPpv0l_x.js @@ -1 +1 @@ -import{r as n,v as M,j as i,ah as F,ai as I,t as U,x as l,aj as T,P as O,ak as $,z,w as B,ap as W,aq as G,ar as K,B as q}from"./index-CqKcHUvZ.js";var E,b="HoverCard",[y]=z(b,[T]),g=T(),[V,S]=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]=M({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]),k=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:k,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=S(_,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,w(a.onOpen)),onPointerLeave:l(e.onPointerLeave,w(a.onClose)),onFocus:l(e.onFocus,a.onOpen),onBlur:l(e.onBlur,a.onClose),onTouchStart:l(e.onTouchStart,f=>f.preventDefault())})})});D.displayName=_;var H="HoverCardPortal",[J,Q]=y(H,{forceMount:void 0}),j=e=>{const{__scopeHoverCard:o,forceMount:r,children:s,container:a}=e,c=S(H,o);return i.jsx(J,{scope:o,forceMount:r,children:i.jsx(O,{present:r||c.open,children:i.jsx($,{asChild:!0,container:a,children:s})})})};j.displayName=H;var R="HoverCardContent",A=n.forwardRef((e,o)=>{const r=Q(R,e.__scopeHoverCard),{forceMount:s=r.forceMount,...a}=e,c=S(R,e.__scopeHoverCard);return i.jsx(O,{present:s||c.open,children:i.jsx(X,{"data-state":c.open?"open":"closed",...a,onPointerEnter:l(e.onPointerEnter,w(c.onOpen)),onPointerLeave:l(e.onPointerLeave,w(c.onClose)),ref:o})})});A.displayName=R;var X=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:c,onInteractOutside:f,...v}=e,d=S(R,r),C=g(r),u=n.useRef(null),h=B(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(W,{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)"}})})}),Y="HoverCardArrow",Z=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=g(r);return i.jsx(K,{...a,...s,ref:o})});Z.displayName=Y;function w(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: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{r as n,v as M,j as c,aj as F,ak as I,t as U,x as l,al as T,P as O,am as $,z,w as B,ar as W,as as G,at as K,B as V}from"./index-D6jcIRWs.js";var E,b="HoverCard",[y]=z(b,[T]),g=T(),[q,S]=y(b),N=e=>{const{__scopeHoverCard:o,children:r,open:s,defaultOpen:a,onOpenChange:i,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]=M({prop:s,defaultProp:a??!1,onChange:i,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]),k=n.useCallback(()=>t(!1),[t]);return n.useEffect(()=>()=>{clearTimeout(C.current),clearTimeout(u.current)},[]),c.jsx(q,{scope:o,open:m,onOpenChange:t,onOpen:x,onClose:P,onDismiss:k,hasSelectionRef:h,isPointerDownOnContentRef:p,children:c.jsx(F,{...d,children:r})})};N.displayName=b;var _="HoverCardTrigger",D=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=S(_,r),i=g(r);return c.jsx(I,{asChild:!0,...i,children:c.jsx(U.a,{"data-state":a.open?"open":"closed",...s,ref:o,onPointerEnter:l(e.onPointerEnter,w(a.onOpen)),onPointerLeave:l(e.onPointerLeave,w(a.onClose)),onFocus:l(e.onFocus,a.onOpen),onBlur:l(e.onBlur,a.onClose),onTouchStart:l(e.onTouchStart,f=>f.preventDefault())})})});D.displayName=_;var H="HoverCardPortal",[J,Q]=y(H,{forceMount:void 0}),j=e=>{const{__scopeHoverCard:o,forceMount:r,children:s,container:a}=e,i=S(H,o);return c.jsx(J,{scope:o,forceMount:r,children:c.jsx(O,{present:r||i.open,children:c.jsx($,{asChild:!0,container:a,children:s})})})};j.displayName=H;var R="HoverCardContent",A=n.forwardRef((e,o)=>{const r=Q(R,e.__scopeHoverCard),{forceMount:s=r.forceMount,...a}=e,i=S(R,e.__scopeHoverCard);return c.jsx(O,{present:s||i.open,children:c.jsx(X,{"data-state":i.open?"open":"closed",...a,onPointerEnter:l(e.onPointerEnter,w(i.onOpen)),onPointerLeave:l(e.onPointerLeave,w(i.onClose)),ref:o})})});A.displayName=R;var X=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:f,...v}=e,d=S(R,r),C=g(r),u=n.useRef(null),h=B(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"))}),c.jsx(W,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:f,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:l(i,t=>{t.preventDefault()}),onDismiss:d.onDismiss,children:c.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)"}})})}),Y="HoverCardArrow",Z=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...s}=e,a=g(r);return c.jsx(K,{...a,...s,ref:o})});Z.displayName=Y;function w(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,ce=oe,ne=n.forwardRef(({className:e,align:o="center",sideOffset:r=4,...s},a)=>c.jsx(re,{children:c.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,ce as a,ne as b}; diff --git a/assets/index-BASvg9Ip.css b/assets/index-BASvg9Ip.css deleted file mode 100644 index 02813ecfffbe3b2e10ad6dfcb43d87c944043378..0000000000000000000000000000000000000000 --- a/assets/index-BASvg9Ip.css +++ /dev/null @@ -1 +0,0 @@ -@import"https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;0,6..72,700;1,6..72,400&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap";*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 0 0% 100%;--foreground: 222.2 84% 4.9%;--card: 0 0% 100%;--card-foreground: 222.2 84% 4.9%;--popover: 0 0% 100%;--popover-foreground: 222.2 84% 4.9%;--primary: 222.2 47.4% 11.2%;--primary-foreground: 210 40% 98%;--secondary: 210 40% 96.1%;--secondary-foreground: 222.2 47.4% 11.2%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 46.9%;--accent-tw: 210 40% 96.1%;--accent-foreground: 222.2 47.4% 11.2%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 210 40% 98%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--ring: 222.2 84% 4.9%;--radius: .5rem}.dark{--background: 36 13% 7%;--foreground: 40 27% 93%;--card: 36 12% 10%;--card-foreground: 40 27% 93%;--popover: 36 12% 10%;--popover-foreground: 40 27% 93%;--primary: 40 27% 93%;--primary-foreground: 36 13% 7%;--secondary: 34 11% 15%;--secondary-foreground: 40 27% 93%;--muted: 34 11% 15%;--muted-foreground: 36 10% 64%;--accent-tw: 216 22% 20%;--accent-foreground: 213 38% 79%;--destructive: 0 63% 42%;--destructive-foreground: 40 27% 93%;--border: 35 11% 20%;--input: 35 11% 20%;--ring: 213 38% 67%}[data-shadcn] *{border-color:hsl(var(--border))}.\!container{width:100%!important;margin-right:auto!important;margin-left:auto!important;padding-right:2rem!important;padding-left:2rem!important}.container{width:100%;margin-right:auto;margin-left:auto;padding-right:2rem;padding-left:2rem}@media (min-width: 1400px){.\!container{max-width:1400px!important}.container{max-width:1400px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.\!visible{visibility:visible!important}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.left-2{left:.5rem}.left-3{left:.75rem}.left-\[50\%\]{left:50%}.right-2{right:.5rem}.right-4{right:1rem}.top-0{top:0}.top-1\/2{top:50%}.top-2{top:.5rem}.top-3{top:.75rem}.top-4{top:1rem}.top-\[50\%\]{top:50%}.z-50{z-index:50}.z-\[100\]{z-index:100}.z-\[60\]{z-index:60}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.-mx-6{margin-left:-1.5rem;margin-right:-1.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-3{margin-left:.75rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mr-4{margin-right:1rem}.mr-auto{margin-right:auto}.mt-1{margin-top:.25rem}.mt-10{margin-top:2.5rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.line-clamp-3{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3}.\!block{display:block!important}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.\!table{display:table!important}.table{display:table}.grid{display:grid}.contents{display:contents}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-32{height:8rem}.h-36{height:9rem}.h-4{height:1rem}.h-40{height:10rem}.h-44{height:11rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[18px\]{height:18px}.h-\[190px\]{height:190px}.h-\[220px\]{height:220px}.h-\[38px\]{height:38px}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.max-h-32{max-height:8rem}.max-h-40{max-height:10rem}.max-h-48{max-height:12rem}.max-h-52{max-height:13rem}.max-h-64{max-height:16rem}.max-h-80{max-height:20rem}.max-h-\[300px\]{max-height:300px}.max-h-\[350px\]{max-height:350px}.max-h-\[400px\]{max-height:400px}.max-h-\[460px\]{max-height:460px}.max-h-\[50vh\]{max-height:50vh}.max-h-\[600px\]{max-height:600px}.max-h-\[700px\]{max-height:700px}.max-h-\[800px\]{max-height:800px}.max-h-\[90vh\]{max-height:90vh}.max-h-\[min\(300px\,calc\(var\(--radix-popover-content-available-height\)-2\.75rem\)\)\]{max-height:min(300px,calc(var(--radix-popover-content-available-height) - 2.75rem))}.max-h-\[var\(--radix-popover-content-available-height\)\]{max-height:var(--radix-popover-content-available-height)}.max-h-screen{max-height:100vh}.min-h-0{min-height:0px}.min-h-\[80px\]{min-height:80px}.w-1\/2{width:50%}.w-1\/3{width:33.333333%}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-36{width:9rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-72{width:18rem}.w-8{width:2rem}.w-\[160px\]{width:160px}.w-\[18px\]{width:18px}.w-\[calc\(100vw-2rem\)\]{width:calc(100vw - 2rem)}.w-\[var\(--radix-popover-trigger-width\)\]{width:var(--radix-popover-trigger-width)}.w-auto{width:auto}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[140px\]{min-width:140px}.min-w-\[180px\]{min-width:180px}.min-w-\[200px\]{min-width:200px}.min-w-\[240px\]{min-width:240px}.min-w-\[260px\]{min-width:260px}.min-w-\[8rem\]{min-width:8rem}.max-w-2xl{max-width:42rem}.max-w-6xl{max-width:72rem}.max-w-7xl{max-width:80rem}.max-w-\[260px\]{max-width:260px}.max-w-\[280px\]{max-width:280px}.max-w-\[360px\]{max-width:360px}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-xl{max-width:36rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-rows-\[auto_minmax\(0\,1fr\)_auto\]{grid-template-rows:auto minmax(0,1fr) auto}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-y-1{row-gap:.25rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.justify-self-end{justify-self:end}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overscroll-contain{overscroll-behavior:contain}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.\!border{border-width:1px!important}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.\!border-black{--tw-border-opacity: 1 !important;border-color:rgb(0 0 0 / var(--tw-border-opacity, 1))!important}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-amber-500{--tw-border-opacity: 1;border-color:rgb(245 158 11 / var(--tw-border-opacity, 1))}.border-border{border-color:hsl(var(--border))}.border-destructive{border-color:hsl(var(--destructive))}.border-destructive\/40{border-color:hsl(var(--destructive) / .4)}.border-destructive\/50{border-color:hsl(var(--destructive) / .5)}.border-input{border-color:hsl(var(--input))}.border-primary{border-color:hsl(var(--primary))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.bg-accent{background-color:hsl(var(--accent-tw))}.bg-amber-100{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-background{background-color:hsl(var(--background))}.bg-background\/80{background-color:hsl(var(--background) / .8)}.bg-black\/80{background-color:#000c}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-destructive\/10{background-color:hsl(var(--destructive) / .1)}.bg-muted{background-color:hsl(var(--muted))}.bg-muted\/30{background-color:hsl(var(--muted) / .3)}.bg-muted\/40{background-color:hsl(var(--muted) / .4)}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-red-50\/50{background-color:#fef2f280}.bg-secondary{background-color:hsl(var(--secondary))}.bg-transparent{background-color:transparent}.fill-current{fill:currentColor}.object-contain{-o-object-fit:contain;object-fit:contain}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-2{padding-bottom:.5rem}.pb-4{padding-bottom:1rem}.pl-4{padding-left:1rem}.pl-5{padding-left:1.25rem}.pl-8{padding-left:2rem}.pl-9{padding-left:2.25rem}.pr-16{padding-right:4rem}.pr-2{padding-right:.5rem}.pr-9{padding-right:2.25rem}.pt-0{padding-top:0}.pt-2{padding-top:.5rem}.pt-6{padding-top:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.align-top{vertical-align:top}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[10px\]{font-size:10px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-widest{letter-spacing:.1em}.text-amber-900{--tw-text-opacity: 1;color:rgb(120 53 15 / var(--tw-text-opacity, 1))}.text-blue-900{--tw-text-opacity: 1;color:rgb(30 58 138 / var(--tw-text-opacity, 1))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-current{color:currentColor}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-30{opacity:.3}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-90{opacity:.9}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.drop-shadow{--tw-drop-shadow: drop-shadow(0 1px 2px rgb(0 0 0 / .1)) drop-shadow(0 1px 1px rgb(0 0 0 / .06));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-0{--tw-enter-opacity: 0}.zoom-in-95{--tw-enter-scale: .95}.duration-200{animation-duration:.2s}.\!running{animation-play-state:running!important}.running{animation-play-state:running}.paused{animation-play-state:paused}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.file\:text-foreground::file-selector-button{color:hsl(var(--foreground))}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.last\:mb-0:last-child{margin-bottom:0}.hover\:border-foreground\/50:hover{border-color:hsl(var(--foreground) / .5)}.hover\:bg-accent:hover{background-color:hsl(var(--accent-tw))}.hover\:bg-destructive\/80:hover{background-color:hsl(var(--destructive) / .8)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-muted:hover{background-color:hsl(var(--muted))}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary:hover{background-color:hsl(var(--secondary))}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-destructive:hover{color:hsl(var(--destructive))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.focus\:bg-accent:focus{background-color:hsl(var(--accent-tw))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group.destructive .group-\[\.destructive\]\:border-muted\/40{border-color:hsl(var(--muted) / .4)}.group.toaster .group-\[\.toaster\]\:border-border{border-color:hsl(var(--border))}.group.toast .group-\[\.toast\]\:bg-muted{background-color:hsl(var(--muted))}.group.toast .group-\[\.toast\]\:bg-primary{background-color:hsl(var(--primary))}.group.toaster .group-\[\.toaster\]\:bg-background{background-color:hsl(var(--background))}.group.destructive .group-\[\.destructive\]\:text-destructive-foreground{color:hsl(var(--destructive-foreground))}.group.toast .group-\[\.toast\]\:text-muted-foreground{color:hsl(var(--muted-foreground))}.group.toast .group-\[\.toast\]\:text-primary-foreground{color:hsl(var(--primary-foreground))}.group.toaster .group-\[\.toaster\]\:text-foreground{color:hsl(var(--foreground))}.group.toaster .group-\[\.toaster\]\:shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.group.destructive .group-\[\.destructive\]\:hover\:border-destructive\/30:hover{border-color:hsl(var(--destructive) / .3)}.group.destructive .group-\[\.destructive\]\:hover\:bg-destructive:hover{background-color:hsl(var(--destructive))}.group.destructive .group-\[\.destructive\]\:hover\:bg-destructive-foreground\/10:hover{background-color:hsl(var(--destructive-foreground) / .1)}.group.destructive .group-\[\.destructive\]\:hover\:text-destructive-foreground:hover{color:hsl(var(--destructive-foreground))}.group.destructive .group-\[\.destructive\]\:focus\:ring-destructive:focus{--tw-ring-color: hsl(var(--destructive))}.group.destructive .group-\[\.destructive\]\:focus\:ring-destructive-foreground:focus{--tw-ring-color: hsl(var(--destructive-foreground))}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true],.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[state\=checked\]\:translate-x-5[data-state=checked]{--tw-translate-x: 1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked],.data-\[swipe\=cancel\]\:translate-x-0[data-swipe=cancel]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=end\]\:translate-x-\[var\(--radix-toast-swipe-end-x\)\][data-swipe=end]{--tw-translate-x: var(--radix-toast-swipe-end-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=move\]\:translate-x-\[var\(--radix-toast-swipe-move-x\)\][data-swipe=move]{--tw-translate-x: var(--radix-toast-swipe-move-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes accordion-up{0%{height:var(--radix-accordion-content-height)}to{height:0}}.data-\[state\=closed\]\:animate-accordion-up[data-state=closed]{animation:accordion-up .2s ease-out}@keyframes accordion-down{0%{height:0}to{height:var(--radix-accordion-content-height)}}.data-\[state\=open\]\:animate-accordion-down[data-state=open]{animation:accordion-down .2s ease-out}.data-\[selected\=\'true\'\]\:bg-accent[data-selected=true]{background-color:hsl(var(--accent-tw))}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\[state\=checked\]\:\!bg-black[data-state=checked]{--tw-bg-opacity: 1 !important;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))!important}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent-tw))}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:hsl(var(--accent-foreground))}.data-\[state\=active\]\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\[state\=checked\]\:\!text-white[data-state=checked]{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity, 1))!important}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\=true\]\:opacity-50[data-disabled=true],.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[swipe\=move\]\:transition-none[data-swipe=move]{transition-property:none}.data-\[state\=open\]\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[state\=closed\]\:animate-out[data-state=closed],.data-\[swipe\=end\]\:animate-out[data-swipe=end]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=closed\]\:fade-out-80[data-state=closed]{--tw-exit-opacity: .8}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\[state\=closed\]\:slide-out-to-right-full[data-state=closed]{--tw-exit-translate-x: 100%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-top-full[data-state=open]{--tw-enter-translate-y: -100%}.dark\:block:is(.dark *){display:block}.dark\:hidden:is(.dark *){display:none}.dark\:border-amber-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(120 53 15 / var(--tw-border-opacity, 1))}.dark\:border-destructive:is(.dark *){border-color:hsl(var(--destructive))}.dark\:bg-amber-950\/40:is(.dark *){background-color:#451a0366}.dark\:text-amber-100:is(.dark *){--tw-text-opacity: 1;color:rgb(254 243 199 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.sm\:bottom-0{bottom:0}.sm\:right-0{right:0}.sm\:top-auto{top:auto}.sm\:mr-auto{margin-right:auto}.sm\:w-auto{width:auto}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:flex-col{flex-direction:column}.sm\:justify-end{justify-content:flex-end}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:text-left{text-align:left}.data-\[state\=open\]\:sm\:slide-in-from-bottom-full[data-state=open]{--tw-enter-translate-y: 100%}}@media (min-width: 768px){.md\:col-span-2{grid-column:span 2 / span 2}.md\:max-w-\[420px\]{max-width:420px}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-\[1fr_1fr_auto\]{grid-template-columns:1fr 1fr auto}.md\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width: 1024px){.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.lg\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.lg\:px-8{padding-left:2rem;padding-right:2rem}}@media (min-width: 1280px){.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y: -3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:left-4>svg{left:1rem}.\[\&\>svg\]\:top-4>svg{top:1rem}.\[\&\>svg\]\:text-destructive>svg{color:hsl(var(--destructive))}.\[\&\>svg\]\:text-foreground>svg{color:hsl(var(--foreground))}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:1.75rem}.\[\&\>tr\]\:last\:border-b-0:last-child>tr{border-bottom-width:0px}.\[\&\[data-state\=open\]\>svg\]\:rotate-180[data-state=open]>svg{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-top:.375rem;padding-bottom:.375rem}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{font-weight:500}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:hsl(var(--muted-foreground))}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:3rem}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-top:.75rem;padding-bottom:.75rem}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:1.25rem}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:1.25rem}.\[\&_p\]\:leading-relaxed p{line-height:1.625}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0px}.\[\&_tr\]\:border-b tr{border-bottom-width:1px}:root{--bg: #FAF8F4;--bg-elevated: #FFFFFF;--bg-subtle: #F2EFE8;--ink: #1A1814;--ink-soft: #5A554C;--ink-faint: #8E8678;--hairline: #E4DFD4;--hairline-strong: #C8C2B3;--accent: oklch(.45 .08 250);--accent-soft: oklch(.92 .03 250);--accent-text: oklch(.35 .1 250);--warn: oklch(.55 .12 30);--positive-bg: oklch(.96 .03 145);--positive-text: oklch(.34 .1 145);--positive-border: oklch(.86 .06 145);--negative-bg: oklch(.96 .03 25);--negative-text: oklch(.4 .12 25);--negative-border: oklch(.86 .06 25);--highlight-bg: oklch(.97 .04 70);--highlight-text: oklch(.42 .1 60);--highlight-border: oklch(.85 .07 70);--info-bg: oklch(.97 .04 230);--info-text: oklch(.42 .1 240);--info-border: oklch(.86 .07 230);--trend-code: #33639E;--trend-hf: #AA7D24;--app-leading-column-width: 280px;--serif: "Newsreader", Georgia, serif;--sans: "Inter", -apple-system, sans-serif;--mono: "JetBrains Mono", ui-monospace, monospace;color-scheme:light}.dark{--bg: #11100E;--bg-elevated: #1A1815;--bg-subtle: #24211D;--ink: #F3EFE7;--ink-soft: #B9B2A6;--ink-faint: #989084;--hairline: #332F29;--hairline-strong: #514A40;--accent: oklch(.72 .09 250);--accent-soft: oklch(.28 .04 250);--accent-text: oklch(.8 .08 250);--warn: oklch(.72 .12 30);--positive-bg: oklch(.25 .035 145);--positive-text: oklch(.79 .1 145);--positive-border: oklch(.43 .06 145);--negative-bg: oklch(.25 .04 25);--negative-text: oklch(.79 .1 25);--negative-border: oklch(.43 .06 25);--highlight-bg: oklch(.27 .04 70);--highlight-text: oklch(.82 .1 70);--highlight-border: oklch(.46 .07 70);--info-bg: oklch(.25 .04 230);--info-text: oklch(.8 .08 235);--info-border: oklch(.43 .07 230);--trend-code: #5C8FD6;--trend-hf: #B3831F;color-scheme:dark}*{box-sizing:border-box;margin:0;padding:0}html,body{background:var(--bg);color:var(--ink);font-family:var(--sans);font-size:14px;line-height:1.5;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}a{color:inherit;text-decoration:none}button{font-family:inherit;cursor:pointer;border:none;background:none;color:inherit}.app-header{border-bottom:1px solid var(--hairline);background:var(--bg);position:sticky;top:0;z-index:50}.app-header-inner{max-width:calc(50vw + 640px);margin:0 auto;padding:14px 32px;display:flex;align-items:center;gap:8px;min-width:0}.site-announcement{position:relative;min-height:28px;padding:5px 52px 6px;border-top:1px solid var(--hairline);background:var(--bg-subtle);color:var(--ink-soft);font-size:12px;line-height:16px;text-align:center}.site-announcement a{color:var(--accent-text);font-weight:600;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}.site-announcement a:hover{color:var(--ink)}.site-announcement-close{position:absolute;top:50%;right:20px;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:0;border-radius:4px;background:transparent;color:var(--ink-soft);cursor:pointer;transform:translateY(-50%)}.site-announcement-close:hover{background:var(--hairline);color:var(--ink)}.site-announcement-close:focus-visible{outline:2px solid var(--accent-text);outline-offset:1px}.brand{display:flex;align-items:baseline;gap:10px;font-family:var(--serif);cursor:pointer}.brand-mark{width:22px;height:22px;background:var(--ink);position:relative;align-self:center;flex-shrink:0}.brand-mark:after{content:"";position:absolute;top:4px;left:4px;right:4px;bottom:4px;background:var(--bg)}.brand-mark:before{content:"";position:absolute;top:8px;left:8px;width:6px;height:6px;background:var(--ink);z-index:1}.brand-name{font-size:20px;font-weight:600;letter-spacing:-.02em;white-space:nowrap}.brand-name em{font-style:italic;font-weight:400;color:var(--ink-soft)}.nav{display:flex;gap:24px;margin-left:8px;flex-shrink:0;position:relative}@media (min-width: 901px){.app-header-inner{max-width:none;padding-left:0}.brand{width:var(--app-leading-column-width);flex:none;justify-content:center}.nav{margin-left:0}}.nav{margin-right:16px}@media (max-width: 1440px){.nav-item:nth-last-child(-n+3){display:none}}@media (max-width: 1200px){.nav{gap:18px}.nav-item:nth-child(n+4){display:none}}@media (max-width: 920px){.search-trigger kbd{display:none}}.nav-item{font-size:13px;color:var(--ink-soft);padding:4px 0;transition:color .15s}.nav-indicator{position:absolute;bottom:0;left:0;height:1px;background:var(--ink);pointer-events:none;will-change:transform,width}.nav-indicator-ready{transition:transform .22s cubic-bezier(.4,0,.2,1),width .22s cubic-bezier(.4,0,.2,1),opacity .12s ease}.nav-item-with-badge{display:inline-flex;align-items:center;gap:5px}.nav-new-badge{display:inline-flex;align-items:center;min-height:17px;padding:1px 5px;border-radius:5px;background:#dfe7ff;color:#1458e8;font-size:9px;font-weight:700;line-height:1;letter-spacing:.02em;text-transform:uppercase}.nav-item:hover,.nav-item.active{color:var(--ink)}@media (prefers-reduced-motion: reduce){.nav-indicator-ready{transition:none}}.header-spacer{flex:1}.search-trigger{display:flex;align-items:center;gap:8px;height:32px;margin-right:4px;padding:0 6px 0 11px;border:1px solid var(--hairline);border-radius:8px;background:var(--bg-elevated);font-size:13px;color:var(--ink-faint);width:260px;min-width:32px;flex-shrink:1;transition:border-color .15s,box-shadow .15s;overflow:hidden;container-type:inline-size}@container (max-width: 160px){.search-trigger kbd{display:none}}@container (max-width: 80px){.search-trigger>:not(svg){display:none}.search-trigger>svg{margin-inline:auto;translate:-2.5px 0}}.search-trigger>span:not(:first-child){white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}.search-trigger:hover{border-color:var(--hairline-strong);box-shadow:0 1px 2px #1a18140f}.search-trigger kbd{flex:none;margin-left:auto;font-family:var(--mono);font-size:10.5px;white-space:nowrap;line-height:18px;padding:0 5px;border:1px solid var(--hairline);border-radius:4px;background:var(--bg-subtle);color:var(--ink-faint)}.icon-btn{width:32px;height:32px;display:flex;align-items:center;justify-content:center;border:1px solid var(--hairline);border-radius:6px;background:var(--bg-elevated);transition:border-color .15s}.icon-btn:hover{border-color:var(--hairline-strong)}.app-header .icon-btn,.app-header .header-feedback-link{flex:none;border-color:transparent;background:transparent;color:var(--ink-soft);transition:background .15s,color .15s}.app-header .icon-btn:hover,.app-header .header-feedback-link:hover,.app-header .icon-btn.active{border-color:transparent;background:var(--bg-subtle);color:var(--ink)}.app-header .header-feedback-link{padding:0 10px}.hf-signin-btn{display:inline-flex;align-items:center;gap:8px;max-width:100%;min-height:32px;padding:5px 12px;border:1px solid var(--hairline);border-radius:6px;background:var(--bg-elevated);font-size:13px;color:var(--ink);line-height:20px;white-space:normal;overflow-wrap:anywhere;transition:border-color .15s,background .15s}.hf-signin-btn>img{flex-shrink:0}.app-header .hf-signin-btn{flex-shrink:0;white-space:nowrap;overflow-wrap:normal}.hf-signin-btn:hover{border-color:var(--hairline-strong);background:var(--bg-subtle)}.user-avatar-btn{display:inline-flex;flex:none;align-items:center;justify-content:center;width:32px;height:32px;border:1px solid var(--hairline);border-radius:999px;background:var(--bg-elevated);padding:0;overflow:hidden;transition:border-color .15s}.user-avatar-btn:hover{border-color:var(--hairline-strong)}.user-avatar-btn:focus-visible{outline:2px solid var(--hairline-strong);outline-offset:2px}.page{max-width:calc(50vw + 640px);margin:0 auto;padding:32px}.site-footer{border-top:1px solid var(--hairline);color:var(--ink-faint);font-size:12px}.site-footer-inner{display:flex;flex-wrap:wrap;gap:14px;max-width:calc(50vw + 640px);margin:0 auto;padding:20px 32px 28px}.site-footer a{color:var(--ink-soft)}.site-footer a:hover{color:var(--ink)}.layout-with-sidebar{display:grid;grid-template-columns:220px 1fr;gap:48px;align-items:start}.sidebar{position:sticky;top:100px}.sidebar-section{margin-bottom:28px}.sidebar-label{font-family:var(--mono);font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-faint);margin-bottom:12px}.sidebar-link{display:block;font-size:13px;color:var(--ink-soft);padding:5px 0;border-bottom:1px dotted transparent;transition:color .15s}.sidebar-link:hover{color:var(--ink)}.sidebar-link.active{color:var(--ink);font-weight:500}.sidebar-link .count{font-family:var(--mono);font-size:11px;color:var(--ink-faint);margin-left:6px}.sidebar-link-more{margin-top:8px;font-style:italic}.breadcrumb{display:flex;align-items:center;gap:8px;font-family:var(--mono);font-size:11px;color:var(--ink-faint);margin-bottom:24px}.breadcrumb a{color:var(--ink-soft)}.breadcrumb a:hover{color:var(--ink)}.breadcrumb .sep{color:var(--hairline-strong)}.breadcrumb a.breadcrumb-external{display:inline-flex;gap:3px;color:var(--accent-text);text-decoration:underline;text-decoration-color:color-mix(in srgb,var(--accent-text) 40%,transparent);text-underline-offset:3px}.breadcrumb a.breadcrumb-external:hover{text-decoration-color:currentColor}.detail-title{font-family:var(--serif);font-size:38px;font-weight:500;line-height:1.15;letter-spacing:-.02em;margin-bottom:16px;text-wrap:balance}.detail-title-org{display:inline-block;max-width:24ch;overflow:hidden;margin-left:.6em;font-family:var(--mono);font-size:13px;line-height:1.4;letter-spacing:0;color:var(--accent-text);text-overflow:ellipsis;white-space:nowrap;vertical-align:.3em}.detail-title-org--logo{display:inline-flex;align-items:center;justify-content:center;max-width:none;margin-left:.3em;font-size:inherit;width:.8em;height:.8em;border-radius:4px;overflow:hidden;vertical-align:-.05em}.detail-title-org--logo img{width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.detail-title-tail{white-space:nowrap}.detail-title-edit{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;margin-left:.2em;padding:0;border:0;border-radius:50%;background:transparent;color:var(--ink-faint);vertical-align:baseline;cursor:pointer;transition:color .15s}.detail-title-edit:hover{color:var(--ink)}.detail-title-org--logo+.detail-title-edit{position:relative;width:.42em;height:.42em;margin-left:-.24em;vertical-align:-.1em;border:1px solid var(--hairline);background:var(--bg-elevated)}.detail-title-org--logo+.detail-title-edit .icon-sm{width:65%;height:65%}.action-btn{display:inline-flex;align-items:center;gap:6px;padding:7px 12px;border:1px solid var(--hairline);border-radius:6px;background:var(--bg-elevated);font-size:12px;font-weight:500;color:var(--ink);transition:all .15s}.action-btn:hover{border-color:var(--ink)}.action-btn.primary{background:var(--ink);color:var(--bg);border-color:var(--ink)}.action-btn.primary:hover{background:color-mix(in oklch,var(--ink) 88%,var(--accent))}.no-results{padding:80px 0;text-align:center;font-family:var(--serif);color:var(--ink-faint);font-style:italic}.icon{width:14px;height:14px;flex-shrink:0}.icon-sm{width:11px;height:11px;flex-shrink:0}html{scroll-behavior:smooth}::-moz-selection{background:var(--accent-soft);color:var(--accent-text)}::selection{background:var(--accent-soft);color:var(--accent-text)}.mobile-menu-btn,.mobile-search-btn{display:none;width:36px;height:36px;align-items:center;justify-content:center;border-radius:4px;flex-shrink:0}.mobile-menu-btn:hover,.mobile-search-btn:hover{background:var(--bg-subtle)}.mobile-nav-drawer{position:fixed;top:0;right:0;bottom:0;left:0;background:#1a181466;z-index:100;display:flex;justify-content:flex-end}.mobile-nav-panel{width:min(320px,80vw);background:var(--bg-elevated);border-left:1px solid var(--hairline-strong);padding:16px 24px max(32px,env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:4px;height:100%;min-height:0;overscroll-behavior-y:contain;overflow-y:auto;box-shadow:-8px 0 24px #0000000f}.mobile-nav-close{align-self:flex-end;min-width:44px;min-height:44px}.mobile-nav-link{flex-shrink:0;font-family:var(--serif);font-size:17px;padding:12px 4px;color:var(--ink);border-bottom:1px solid var(--hairline)}.mobile-nav-link-with-badge{display:flex;align-items:center;gap:6px}.mobile-nav-link.active{color:var(--accent-text);font-style:italic}.mobile-nav-search{display:flex;align-items:center;gap:10px;width:100%;font-family:var(--sans);font-size:14px;color:var(--ink-faint);background:var(--bg-subtle);border:1px solid var(--hairline);border-radius:6px;padding:10px 12px;margin-bottom:8px;text-align:left}.mobile-nav-search:hover{border-color:var(--hairline-strong);color:var(--ink)}@media (max-width: 980px){.nav,.search-trigger,.app-header .header-feedback-link{display:none}.mobile-menu-btn,.mobile-search-btn{display:inline-flex}}@media (max-width: 640px){.app-header-inner,.brand{gap:8px}.brand-mark{width:20px;height:20px}.brand-name{font-size:18px}.header-bookmark-btn,.header-github-btn{display:none}.app-header .hf-signin-btn{width:36px;height:36px;padding:0;gap:0;justify-content:center;flex-shrink:0}.app-header .hf-signin-btn>span{display:none}}@media (max-width: 880px){.app-header-inner{padding:14px 16px;gap:12px}.page{padding:24px 16px}.layout-with-sidebar{grid-template-columns:minmax(0,1fr);gap:24px}.layout-with-sidebar .sidebar{position:static;top:auto}.layout-with-sidebar .sidebar-section{min-width:0;margin-bottom:0}.layout-with-sidebar .sidebar-links{display:flex;gap:8px;margin:0 -16px;padding:0 16px 2px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none}.layout-with-sidebar .sidebar-links::-webkit-scrollbar{display:none}.layout-with-sidebar .sidebar-links .sidebar-link{flex:0 0 auto;margin:0;padding:6px 12px;border:1px solid var(--hairline);border-radius:999px;background:var(--bg-elevated);white-space:nowrap}.detail-title{font-size:28px}}@media (max-width: 640px){.app-header-inner{padding:12px 14px;gap:8px}.page{padding:20px 14px}.layout-with-sidebar .sidebar-links{margin:0 -14px;padding:0 14px 2px}.detail-title{font-size:24px}.brand-name{font-size:17px}}.access-request-page{min-height:100vh;min-height:100svh;display:grid;place-items:center;padding:32px 20px;background:radial-gradient(circle at 50% 8%,color-mix(in srgb,var(--accent-soft) 60%,transparent),transparent 42%),var(--bg)}.access-request-card{width:min(100%,470px);padding:38px;border:1px solid var(--hairline);border-radius:12px;background:color-mix(in srgb,var(--bg-elevated) 94%,transparent);box-shadow:0 20px 60px #1a181414}.access-request-brand{display:inline-flex;align-items:center;gap:10px;margin-bottom:42px;font-family:var(--serif)}.access-request-heading h1,.access-request-success h1{margin-bottom:12px;font-family:var(--serif);font-size:clamp(36px,8vw,48px);font-weight:500;line-height:1;letter-spacing:-.035em}.access-request-heading>p:last-child,.access-request-success p,.access-request-signin>p{color:var(--ink-soft);font-size:15px;line-height:1.65}.access-request-eyebrow{margin-bottom:10px;color:var(--accent-text);font-size:11px;font-weight:700;letter-spacing:.12em;text-transform:uppercase}.access-request-form,.access-request-signin{margin-top:30px}.access-request-form label{display:block;margin-bottom:8px;font-size:12px;font-weight:600}.access-request-input-wrap{display:flex;align-items:center;border:1px solid var(--hairline-strong);border-radius:7px;background:var(--bg);color:var(--ink-faint);transition:border-color .15s,box-shadow .15s}.access-request-input-wrap:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}.access-request-input-wrap>span{padding-left:13px;font-size:15px}.access-request-input-wrap input{width:100%;padding:11px 13px 11px 3px;border:0;outline:0;background:transparent;color:var(--ink);font:500 14px var(--sans)}.access-request-verified{margin-top:7px;color:var(--ink-faint);font-size:11px}.access-request-submit{width:100%;margin-top:20px;padding:12px 18px;border-radius:7px;background:var(--ink);color:var(--bg);font-size:13px;font-weight:600;transition:opacity .15s,transform .15s}.access-request-submit:hover:not(:disabled){transform:translateY(-1px)}.access-request-submit:disabled{cursor:wait;opacity:.6}.access-request-error{margin-top:12px;color:var(--negative-text);font-size:12px}.access-request-status{margin-top:30px;color:var(--ink-soft)}.access-request-signin .hf-signin-btn{margin-top:18px}.access-request-success svg{margin-bottom:24px;color:var(--positive-text)}@media (max-width: 520px){.access-request-card{padding:28px 24px}.access-request-brand{margin-bottom:34px}}.legal-page{max-width:880px;padding-bottom:72px;color:var(--ink-soft);font-family:var(--sans);font-size:15px;line-height:1.7}.legal-header{margin-bottom:34px;padding-bottom:24px;border-bottom:1px solid var(--hairline)}.legal-kicker{margin:0 0 6px;color:var(--accent-text);font-size:11px;font-weight:700;letter-spacing:.1em;text-transform:uppercase}.legal-header h1{margin:0;color:var(--ink);font-family:var(--serif);font-size:clamp(38px,6vw,56px);font-weight:500;letter-spacing:-.025em;line-height:1.05}.legal-effective-date{margin:12px 0 0;color:var(--ink-faint)}.legal-page section{margin-top:34px}.legal-page h2{margin:0 0 10px;color:var(--ink);font-family:var(--serif);font-size:25px;font-weight:600;line-height:1.25}.legal-page h3{margin:22px 0 6px;color:var(--ink);font-size:15px;font-weight:700}.legal-page p{margin:0 0 14px}.legal-page ul{margin:8px 0 16px;padding-left:22px}.legal-page li{margin:7px 0}.legal-page a{color:var(--accent-text);text-decoration:underline}.legal-page strong{color:var(--ink)}.feed-header{display:flex;align-items:flex-end;justify-content:space-between;margin-bottom:32px;gap:24px;flex-wrap:wrap}.feed-title{font-family:var(--serif);font-size:44px;font-weight:500;letter-spacing:-.025em;line-height:1}.feed-title em{font-style:italic;font-weight:400;color:var(--accent)}.feed-subtitle{font-size:13px;color:var(--ink-soft);margin-top:8px;font-family:var(--serif);font-style:italic}.conference-deadlines-link{font-size:16px;color:var(--ink-soft);margin-top:12px}.trend-chart{margin:0;width:100%}.trend-chart-visual{position:relative;min-width:0}.trend-chart-table{margin-top:10px}.feedback-link{display:inline-flex;align-items:center;height:32px;padding:0 12px;border:1px solid var(--hairline);border-radius:6px;background:var(--bg-elevated);color:var(--ink-soft);font-size:13px;font-weight:500;white-space:nowrap;transition:border-color .15s,color .15s,background .15s}.feedback-link:hover{border-color:var(--hairline-strong);background:var(--bg-subtle);color:var(--ink)}.period-switch{display:flex;align-items:center;gap:2px;background:var(--bg-elevated);border:1px solid var(--hairline);border-radius:6px;padding:3px}.period-btn{padding:5px 12px;font-size:12px;font-weight:500;color:var(--ink-soft);border-radius:4px;transition:all .15s}.period-btn.active{background:var(--ink);color:var(--bg)}.period-btn:not(.active):hover{background:var(--bg-subtle);color:var(--ink)}.date-nav{display:flex;align-items:center;gap:12px;font-family:var(--mono);font-size:12px;color:var(--ink-soft)}.date-nav button{width:26px;height:26px;border:1px solid var(--hairline);border-radius:4px;display:flex;align-items:center;justify-content:center;background:var(--bg-elevated)}.date-nav button:hover{background:var(--bg-subtle)}.paper-list{display:flex;flex-direction:column}.paper-card{display:grid;grid-template-columns:170px 1fr;gap:28px;padding:24px 0;border-bottom:1px solid var(--hairline);align-items:stretch}.paper-thumb-wrap{transition:transform .15s;display:flex;align-items:flex-end;justify-content:flex-start}.paper-thumb-wrap:hover{transform:translateY(-2px)}.paper-thumb-skeleton{width:160px;height:220px}.paper-card:first-child{padding-top:0}.paper-rank{font-family:var(--serif);font-size:32px;font-weight:500;color:var(--ink-faint);font-feature-settings:"tnum";line-height:.9;font-style:italic}.paper-body{min-width:0;display:flex;align-items:stretch;gap:28px}.paper-body-main{min-width:0;flex:1}.paper-resources{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:18px;flex:0 0 auto;width:92px;border-left:1px solid var(--hairline);padding-left:20px}.paper-resource{display:flex;flex-direction:column;align-items:center;gap:4px;color:inherit}a.paper-resource.is-link{text-decoration:none;cursor:pointer;border-radius:4px;transition:transform .15s}a.paper-resource.is-link:hover{transform:translateY(-1px)}a.paper-resource.is-link:hover .resource-value{text-decoration:underline;text-underline-offset:2px}a.paper-resource.is-link:focus-visible{outline:2px solid var(--ink);outline-offset:2px}.paper-resource .resource-stat{display:flex;flex-direction:column;align-items:center;gap:2px}.paper-resource .resource-value{display:inline-flex;align-items:center;gap:3px;font-family:var(--mono);font-size:14px;color:var(--ink);font-weight:500;font-variant-numeric:tabular-nums;letter-spacing:-.01em}.paper-resource .resource-label{font-family:var(--mono);font-size:10px;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-faint)}.paper-resource .gh-rate-arrow{color:var(--accent-text);font-size:13px;transform:translateY(-.5px)}.paper-meta-line{display:flex;align-items:center;gap:12px;font-family:var(--mono);font-size:11px;color:var(--ink-faint);margin-bottom:6px}.paper-meta-line .sep{color:var(--hairline-strong)}.paper-follow-reason{font-size:12px;color:var(--ink-faint);margin-bottom:4px}.paper-title{font-family:var(--serif);font-size:22px;font-weight:500;line-height:1.2;letter-spacing:-.015em;margin-bottom:6px;color:var(--ink);cursor:pointer;text-wrap:pretty}.paper-title:hover{color:var(--accent-text)}.paper-organization-logos{display:inline-flex;align-items:center;gap:4px;margin-left:7px;vertical-align:-4px}.paper-organization-logo{display:inline-grid;width:24px;height:24px;flex:0 0 24px;place-items:center;overflow:hidden;border:1px solid var(--hairline);border-radius:4px;background:var(--bg)}.paper-organization-logo:hover{border-color:var(--hairline-strong)}.paper-organization-logo img{width:100%;height:100%;padding:2px;-o-object-fit:contain;object-fit:contain}.paper-authors{font-size:13px;color:var(--ink-soft);margin-bottom:10px;font-family:var(--serif)}.paper-card-author-avatar{width:16px;height:16px;margin-right:4px;vertical-align:-3px}.paper-authors a{color:inherit;text-decoration:none}.paper-authors a:hover{color:var(--accent-text);text-decoration:underline;text-underline-offset:2px}.paper-abstract{font-size:13.5px;color:var(--ink-soft);line-height:1.55;max-height:4.65em;margin-bottom:12px;font-family:var(--serif);text-wrap:pretty;display:-webkit-box;line-clamp:3;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.paper-title mark,.paper-abstract mark{background:color-mix(in srgb,var(--accent) 24%,transparent);color:inherit;border-radius:2px;padding:0 1px}.search-results-end{padding:24px 0;text-align:center;color:var(--ink-faint);font:11px var(--mono)}.paper-tags{display:flex;flex-wrap:wrap;gap:6px}.paper-tags--clamped{--tag-row-height: 26px;max-height:calc(var(--tag-row-height) * 2 + 6px);overflow:hidden}.paper-sota{position:relative;white-space:nowrap;overflow:hidden;margin-bottom:12px;font-family:var(--mono);font-size:12px;line-height:1.6}.paper-sota-stack{margin-top:16px;padding-top:16px;border-top:1px solid var(--hairline)}.paper-sota-stack .paper-sota{margin-bottom:4px}.paper-sota-stack .paper-sota:last-child{margin-bottom:0}.paper-sota-measure{position:absolute;left:-9999px;top:0;visibility:hidden;white-space:pre;pointer-events:none}.paper-sota-label{font-weight:500;color:var(--ink-faint)}.paper-sota-label--sota{color:#b8860b}.paper-sota-sep,.paper-sota-on{color:var(--ink-faint)}.paper-sota-name{color:var(--accent-text)}.paper-sota-name:hover{text-decoration:underline}.paper-sota-more{font-size:11px;color:var(--ink-faint);cursor:pointer}.paper-sota-more:hover{color:var(--accent-text);text-decoration:underline}.paper-stats{display:flex;flex-direction:column;align-items:flex-end;gap:8px;font-family:var(--mono);font-size:11px;color:var(--ink-soft)}.upvote-btn{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:8px 14px;border:1px solid var(--hairline);border-radius:6px;background:var(--bg-elevated);font-family:var(--mono);font-size:13px;font-weight:500;min-width:56px;transition:all .15s}.upvote-btn:hover{border-color:var(--ink)}.upvote-btn.upvoted{background:var(--accent-soft);border-color:var(--accent);color:var(--accent-text)}.upvote-btn .arrow{font-size:9px;line-height:1;margin-bottom:2px}.upvote-btn .count{font-feature-settings:"tnum"}.stat-line{display:flex;align-items:center;gap:5px}.sort-bar{display:flex;align-items:center;justify-content:space-between;padding-bottom:16px;border-bottom:1px solid var(--hairline);margin-bottom:16px}.sort-options{display:flex;gap:4px}.sort-btn{padding:4px 10px;font-family:var(--mono);font-size:11px;font-weight:500;letter-spacing:.02em;color:var(--ink-soft);border-radius:4px;transition:all .15s;text-transform:lowercase}.sort-btn.active{background:var(--ink);color:var(--bg)}.sort-btn:not(.active):hover{background:var(--bg-subtle);color:var(--ink)}.paper-feed-toolbar-controls,.paper-feed-resource-controls,.paper-feed-filter-options{display:flex;align-items:center}.paper-feed-toolbar-controls{gap:14px;flex-wrap:wrap}.paper-feed-resource-controls{gap:10px}.paper-feed-resource-divider{width:1px;height:22px;background:var(--hairline)}.paper-feed-filter-options{gap:6px;flex-wrap:wrap}.paper-feed-filter{display:inline-flex;align-items:center;gap:6px;min-height:30px;padding:5px 10px;border:1px solid var(--hairline);border-radius:999px;background:var(--bg);color:var(--ink-soft);font-family:var(--mono);font-size:11px;letter-spacing:.01em;cursor:pointer;transition:border-color .15s,background .15s,color .15s}.paper-feed-filter-content{display:inline-flex;align-items:center;gap:6px}.paper-feed-filter:hover{border-color:var(--ink-faint);color:var(--ink)}.paper-feed-filter.active{border-color:var(--ink);background:var(--ink);color:var(--bg)}.paper-feed-filter:focus-visible{outline:2px solid var(--ink);outline-offset:2px}.paper-feed-filter-icon{display:inline-flex;color:currentColor;filter:grayscale(1)}.hf-resource-logo{position:relative;display:inline-flex;width:15px;height:15px}.hf-resource-logo img{position:absolute;top:0;right:0;bottom:0;left:0;display:block;width:15px;height:15px}.hf-resource-logo-white,.paper-feed-filter.active .hf-resource-logo-black{visibility:hidden}.paper-feed-filter.active .hf-resource-logo-white{visibility:visible}.paper-feed-filter-check{display:inline-flex;align-items:center;justify-content:center;width:17px;height:17px;border-radius:50%;background:color-mix(in srgb,var(--bg) 18%,transparent);color:currentColor;font-size:10px;line-height:1}.home-feed-sort-bar{flex-wrap:wrap;row-gap:10px}.results-count{font-family:var(--mono);font-size:11px;color:var(--ink-faint)}.paper-feed-scope-links{margin-top:12px;display:flex;flex-direction:column;align-items:flex-start;gap:8px}.paper-feed-primary-links,.paper-feed-task-tags{display:flex;flex-wrap:wrap;align-items:center;gap:10px}.papers-feed-layout-scoped{display:block}.paper-thumb{display:none}.papers-search-row{display:flex;margin-top:12px;margin-bottom:24px}.papers-search-input-wrap{display:flex;align-items:center;gap:8px;border:1px solid var(--hairline-strong);background:var(--bg-elevated);padding:10px 14px;border-radius:4px;flex:1;max-width:600px;color:var(--ink-faint)}.papers-search-input-wrap:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}.papers-search-input{flex:1;border:none;outline:none;background:transparent;font-family:var(--sans);font-size:14px;color:var(--ink)}.papers-search-input::-moz-placeholder{color:var(--ink-faint)}.papers-search-input::placeholder{color:var(--ink-faint)}@media (max-width: 880px){.feed-title{font-size:32px}.paper-card{grid-template-columns:120px 1fr;gap:16px;padding:20px 0}.paper-body{flex-direction:column;align-items:stretch;gap:12px}.paper-resources{width:auto;flex-direction:row;align-items:center;justify-content:flex-start;gap:24px;border-left:none;border-top:1px solid var(--hairline);padding-left:0;padding-top:12px}.paper-resource{flex-direction:row;gap:8px}.paper-resource .resource-stat{align-items:flex-start}}@media (min-width: 641px) and (max-width: 880px){.paper-thumb-wrap{min-width:0;align-items:flex-start}.paper-thumb-wrap>div{width:100%!important;max-width:120px;height:auto!important;aspect-ratio:160 / 220}.paper-thumb-wrap>div>img,.paper-thumb-wrap>div>svg{width:100%!important;height:100%!important}.paper-thumb-skeleton{width:100%;max-width:120px;height:auto;aspect-ratio:160 / 220}}@media (max-width: 640px){.feed-header{margin-bottom:24px;gap:16px}.feed-title{font-size:26px}.paper-card{grid-template-columns:1fr;gap:12px}.paper-resources{border-top:none;padding-top:0}.paper-thumb-wrap{align-self:flex-start}.paper-card:has(>.paper-thumb-wrap){grid-template-columns:84px minmax(0,1fr);grid-template-rows:auto auto 1fr;-moz-column-gap:14px;column-gap:14px;row-gap:0}.paper-card:has(>.paper-thumb-wrap)>.paper-body,.paper-card:has(>.paper-thumb-wrap) .paper-body-main{display:contents}.paper-card>.paper-thumb-wrap{grid-column:1;grid-row:1 / 4;margin-bottom:12px}.paper-card>.paper-thumb-wrap>div{width:84px!important;height:auto!important;aspect-ratio:160 / 220}.paper-card>.paper-thumb-wrap>div>img,.paper-card>.paper-thumb-wrap>div>svg{width:100%!important;height:100%!important}.paper-card:has(>.paper-thumb-wrap) .paper-follow-reason,.paper-card:has(>.paper-thumb-wrap) .paper-title,.paper-card:has(>.paper-thumb-wrap) .paper-authors{grid-column:2;align-self:start}.paper-card:has(>.paper-thumb-wrap) .paper-abstract,.paper-card:has(>.paper-thumb-wrap) .paper-sota,.paper-card:has(>.paper-thumb-wrap) .paper-tags,.paper-card:has(>.paper-thumb-wrap) .paper-resources{grid-column:1 / -1}.paper-card:has(>.paper-thumb-wrap) .paper-resources{margin-top:12px}.paper-title{font-size:19px}.paper-abstract{max-height:6.2em;-webkit-line-clamp:4;line-clamp:4}}.sort-options-time{margin-left:auto}.sort-btn-time{text-transform:none}@media (max-width: 900px){.sort-bar{flex-wrap:wrap;gap:8px}.sort-options-time{margin-left:0}}@media (max-width: 560px){.paper-feed-resource-divider{display:none}.paper-feed-resource-controls{gap:0}}.paper-date-filter{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:4px}.paper-date-popover{width:min(760px,calc(100vw - 32px));max-width:760px;padding:14px 18px;max-height:calc(100vh - 24px);overflow-y:auto}.paper-date-popover-header{margin-bottom:8px}.paper-date-popover-header h2{margin:0;font-family:var(--serif);font-size:21px}.paper-date-popover-header p{margin:5px 0 0;color:var(--ink-soft)}.paper-date-navigation{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:36px;margin-bottom:-38px;pointer-events:none;position:relative;z-index:1}.paper-date-navigation-group{display:flex;justify-content:space-between}.paper-date-navigation button{pointer-events:auto}.paper-date-navigation button,.paper-date-actions button{border:1px solid var(--hairline);border-radius:6px;background:var(--bg-elevated);color:var(--ink);padding:7px 11px;font:inherit;cursor:pointer}.paper-date-calendars{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:36px}.paper-date-year{display:flex;align-items:center;justify-content:center;gap:8px;margin-bottom:6px;color:var(--ink-soft);font-size:13px;font-weight:600}.paper-date-year input{width:5.5rem;border:1px solid var(--hairline);border-radius:5px;background:var(--bg-elevated);color:var(--ink);padding:5px 7px;font:inherit}.paper-date-year input:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.paper-date-calendar h3{margin:0 0 10px;text-align:center;font-family:var(--serif);font-size:17px}.paper-date-weekdays,.paper-date-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr))}.paper-date-weekdays span{padding:3px 0 4px;color:var(--ink-faint);text-align:center;font-size:11px;font-weight:600}.paper-date-day{width:28px;height:28px;justify-self:center;border:0;border-radius:999px;background:transparent;color:var(--ink);font:inherit;cursor:pointer}.paper-date-day:hover:not(:disabled),.paper-date-day:focus-visible{background:var(--bg-subtle);outline:2px solid var(--accent);outline-offset:-2px}.paper-date-day.in-range{border-radius:0;background:color-mix(in srgb,var(--accent) 14%,transparent)}.paper-date-day.selected{background:var(--accent);color:#fff;font-weight:700}.paper-date-day.today:not(.selected){box-shadow:inset 0 0 0 1px var(--accent)}.paper-date-day:disabled{color:var(--ink-faint);cursor:not-allowed;opacity:.42}.paper-date-day.outside{visibility:hidden}.paper-date-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-top:10px;border-top:1px solid var(--hairline)}.paper-date-actions>div{display:flex;gap:8px}.paper-date-actions .paper-date-clear{border-color:transparent;color:var(--ink-soft)}.paper-date-actions .paper-date-apply{border-color:var(--accent);background:var(--accent);color:#fff}.paper-date-actions button:disabled{cursor:not-allowed;opacity:.45}.paper-date-filter-single-calendar{justify-content:flex-start}.paper-date-popover-single-calendar{width:calc(100vw - 20px);padding:20px 14px}.paper-date-popover-single-calendar .paper-date-calendars,.paper-date-popover-single-calendar .paper-date-navigation{display:block}.paper-date-popover-single-calendar .paper-date-day{width:36px;height:36px}.organization-hero{display:grid;grid-template-columns:minmax(260px,.34fr) minmax(0,1fr);align-items:center;gap:48px;margin:24px 0 32px}.organization-hero-profile{min-width:0}.organization-hero-title{display:flex;align-items:center;gap:14px}.organization-hero-title img{flex:none;-o-object-fit:contain;object-fit:contain}.feed-title.organization-hero-title--long{font-size:30px;line-height:1.1}.organization-hero-name{min-width:0}.organization-hero-full-name{display:block;margin-top:8px;color:var(--ink-soft);font-size:18px;letter-spacing:-.01em;line-height:1.25}.organization-hero-monogram{display:grid;flex:none;place-items:center;width:58px;height:58px;border:1px solid var(--hairline);border-radius:6px;background:var(--bg-elevated);color:var(--accent-text);font-size:30px;line-height:1}.organization-hero-links{display:flex;flex-wrap:wrap;gap:12px;margin-top:12px}.organization-contributions{width:100%;min-width:0}.organization-contributions-header{margin-bottom:12px}.organization-contributions-title{font-family:var(--serif);font-size:20px;font-weight:600;line-height:1.2}.organization-contributions-summary{margin-top:3px;color:var(--ink-soft);font-size:12px}.organization-contributions-legend{display:flex;align-items:center;justify-content:flex-start;gap:4px;margin-top:8px;color:var(--ink-faint);font-family:var(--mono);font-size:10px;white-space:nowrap}.organization-contributions-legend span:first-child{margin-right:3px}.organization-contributions-legend span:last-child{margin-left:3px}.organization-contributions-scroll{width:calc(100% + 34px);max-width:none;margin-left:-34px;overflow-x:auto;padding:2px 0;scrollbar-width:thin;scrollbar-color:var(--hairline-strong) transparent}.organization-contributions-plot{display:grid;grid-template-columns:25px auto;gap:9px;margin:0}.organization-contributions-weekdays{display:grid;grid-template-rows:repeat(7,12px);gap:3px;padding-top:24px;color:var(--ink-faint);font-family:var(--mono);font-size:9px;line-height:12px;text-align:right}.organization-contributions-months{display:grid;gap:3px;height:20px;color:var(--ink-faint);font-family:var(--mono);font-size:9px;line-height:12px}.organization-contributions-months span{grid-row:1;white-space:nowrap}.organization-contributions-grid{display:grid;grid-template-rows:repeat(7,12px);grid-auto-flow:column;gap:3px}.organization-contribution-cell{display:block;width:12px;height:12px;border:1px solid color-mix(in srgb,var(--hairline) 78%,transparent);border-radius:2px;background:var(--bg-subtle)}.organization-contribution-cell.level-1{border-color:color-mix(in srgb,var(--positive-border) 60%,transparent);background:color-mix(in srgb,var(--positive-bg) 65%,var(--positive-border))}.organization-contribution-cell.level-2{border-color:transparent;background:color-mix(in srgb,var(--positive-text) 35%,var(--positive-bg))}.organization-contribution-cell.level-3{border-color:transparent;background:color-mix(in srgb,var(--positive-text) 60%,var(--positive-bg))}.organization-contribution-cell.level-4{border-color:transparent;background:var(--positive-text)}.organization-contribution-cell.is-outside{visibility:hidden}.organization-contributions-skeleton{width:100%;height:154px;border-radius:6px}@media (max-width: 960px){.organization-hero{grid-template-columns:1fr;align-items:start;gap:28px}.organization-contributions-plot{margin:0 auto}.organization-contributions-scroll{width:100%;max-width:100%;margin-left:0}.organization-contributions-legend{justify-content:center;width:min(100%,826px);margin:8px auto 0}}@media (max-width: 640px){.organization-hero{margin-bottom:28px}.feed-title.organization-hero-title--long{font-size:22px}.organization-hero-full-name{font-size:15px}.organization-contributions{max-width:calc(100vw - 28px)}}.author-hero{margin:8px 0 20px}.author-hero-title{display:flex;align-items:center;gap:20px}.author-avatar{display:block;width:96px;height:96px}@media (max-width: 640px){.author-avatar{width:64px;height:64px}}.author-photo{display:flex;flex:none;flex-direction:column;align-items:center;gap:4px;max-width:120px;margin:0}.author-photo figcaption{color:var(--ink-soft);font-size:10px;line-height:1.3;text-align:center}.author-photo figcaption a{color:inherit}.author-hero .feed-subtitle a{color:var(--accent-text);text-decoration:none}.author-hero .feed-subtitle a:hover{text-decoration:underline;text-underline-offset:2px}.tag-chip{display:inline-flex;align-items:center;gap:5px;padding:3px 9px;font-family:var(--mono);font-size:11px;font-weight:500;border-radius:4px;cursor:pointer;transition:filter .15s,transform .15s;white-space:nowrap;border:1px solid transparent}.tag-chip:hover{filter:brightness(.96);transform:translateY(-1px)}.tag-chip .dot{width:5px;height:5px;border-radius:50%}.paper-tags--clamped .tag-chip{line-height:16px}.tag-hero{padding:48px 0 32px;border-bottom:1px solid var(--hairline);margin-bottom:32px}.tag-hero-eyebrow{font-family:var(--mono);font-size:11px;letter-spacing:.12em;text-transform:uppercase;color:var(--ink-faint);margin-bottom:12px;display:flex;align-items:center;gap:8px}.tag-hero-title{font-family:var(--serif);font-size:56px;font-weight:500;letter-spacing:-.025em;line-height:1;margin-bottom:16px;overflow-wrap:break-word}.tag-hero-meta{display:flex;gap:32px;margin-top:24px;font-family:var(--mono);font-size:12px;color:var(--ink-soft)}.tag-hero-meta .stat{display:flex;flex-direction:column;gap:4px}.tag-hero-meta .stat .label{font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-faint)}.tag-hero-meta .stat .value{font-family:var(--serif);font-size:22px;font-weight:500;color:var(--ink)}.tag-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:0;border-top:1px solid var(--hairline)}.tag-cell{padding:20px 24px;border-bottom:1px solid var(--hairline);border-right:1px solid var(--hairline);cursor:pointer;transition:background .15s;display:flex;flex-direction:column;gap:8px}.tag-cell:nth-child(3n){border-right:none}.tag-cell:hover{background:var(--bg-elevated)}.tag-cell .name{font-family:var(--serif);font-size:18px;font-weight:500;display:flex;align-items:center;gap:8px}.tag-cell .name .dot{width:8px;height:8px;border-radius:50%}.tag-cell .name .task-icon{flex:none;display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:9px;background:color-mix(in oklch,currentColor 14%,transparent);transition:transform .2s ease}.tag-cell:hover .name .task-icon{transform:rotate(-8deg) scale(1.1)}.tag-cell .meta{font-family:var(--mono);font-size:11px;color:var(--ink-faint);display:flex;gap:12px}.taxonomy-trending{margin-bottom:48px;scroll-margin-top:80px}.taxonomy-trending-header{padding-bottom:12px;border-bottom:1px solid var(--hairline-strong)}.taxonomy-trending-header h2{display:flex;align-items:center;gap:10px;margin-bottom:4px;font-family:var(--serif);font-size:26px;font-weight:500;letter-spacing:-.02em}.taxonomy-trending-header h2 svg{color:var(--accent-text)}.taxonomy-trending-note{margin:0;font-family:var(--serif);font-style:italic;font-size:13px;color:var(--ink-soft)}.taxonomy-trending-rank{min-width:1.6em;font-family:var(--mono);font-size:11px;font-style:normal;color:var(--ink-faint)}.taxonomy-trending-meta{flex-wrap:wrap}.taxonomy-trending-lift{display:inline-flex;align-items:center;gap:3px}.tag-hero-meta .stat .value small{margin-left:2px;font-family:var(--mono);font-size:10px;font-weight:500;color:var(--ink-faint)}.framework-category{margin-top:32px}.framework-category-head{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;margin-bottom:16px}.framework-category-blurb{font-family:var(--serif);font-size:14px;line-height:1.55;color:var(--ink-soft);max-width:720px;margin:0}.framework-category-meta{font-family:var(--mono);font-size:11px;color:var(--ink-faint);white-space:nowrap}.framework-guide-link{display:inline-block;margin-top:8px;font-family:var(--mono);font-size:11px;color:var(--accent-text);text-decoration:none}.framework-guide-link:hover{text-decoration:underline}.framework-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}.framework-card{border:1px solid var(--hairline);background:var(--bg-elevated);border-radius:6px;padding:18px 22px;scroll-margin-top:24px;display:flex;flex-direction:column;gap:12px;transition:border-color .15s}.framework-card:hover{border-color:var(--ink)}.framework-card-clickable{cursor:pointer}.framework-card-clickable:focus-visible{border-color:var(--ink);outline:2px solid var(--accent);outline-offset:2px}.framework-card-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}.framework-card-name{font-family:var(--serif);font-size:20px;font-weight:500;letter-spacing:-.01em;margin:0;color:var(--ink)}.framework-card-org{font-family:var(--mono);font-size:11px;color:var(--ink-faint);margin-top:4px}.framework-platform-row{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end}.framework-platform-chip{font-family:var(--mono);font-size:10px;letter-spacing:.03em;text-transform:uppercase;padding:3px 8px;border-radius:3px;white-space:nowrap}.framework-card-desc{font-family:var(--sans);font-size:14px;line-height:1.55;color:var(--ink-soft);margin:0}.framework-card-when{font-family:var(--serif);font-style:italic;font-size:13px;line-height:1.5;color:var(--ink-soft);padding-top:4px;border-top:1px solid var(--hairline)}.framework-card-when-label{display:block;font-family:var(--mono);font-size:10px;font-style:normal;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-faint);margin-bottom:4px}.framework-card-links{display:flex;flex-wrap:wrap;gap:10px;margin-top:auto}.framework-link{display:inline-flex;align-items:center;gap:6px;font-family:var(--mono);font-size:11px;color:var(--accent-text);text-decoration:none;padding:4px 10px;border:1px solid var(--hairline);border-radius:4px;transition:border-color .15s,background .15s}.framework-link:hover{border-color:var(--ink);background:var(--bg-subtle)}.framework-link-disabled,.framework-link-disabled:hover{color:var(--ink-faint);background:transparent;border-color:var(--hairline);cursor:not-allowed}@media (max-width: 880px){.tag-grid{grid-template-columns:repeat(2,1fr)}.tag-cell:nth-child(3n){border-right:1px solid var(--hairline)}.tag-cell:nth-child(2n){border-right:none}.framework-category-head{flex-direction:column;gap:8px}.framework-card-head{flex-direction:column;gap:10px}.framework-platform-row{justify-content:flex-start}.tag-hero-title{font-size:40px}}@media (max-width: 640px){.tag-hero{padding:32px 0 24px;margin-bottom:24px}.tag-hero-title{font-size:30px}.tag-grid{grid-template-columns:1fr}.tag-cell{padding:16px;border-right:none!important}.framework-grid{grid-template-columns:1fr}.tag-hero-meta{gap:20px;flex-wrap:wrap}}.task-hero-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(320px,480px);gap:48px;align-items:start}@media (min-width: 1200px){.task-hero-grid--wide{grid-template-columns:minmax(0,1fr) minmax(320px,720px)}}.task-figure-card{background:var(--bg-elevated);border:1px solid var(--hairline);border-radius:6px;padding:16px 16px 12px;margin:0;box-shadow:0 1px #00000005}.task-figure-img-wrap{width:100%;background:var(--bg);border-radius:4px;overflow:hidden;line-height:0}.task-figure-img{width:100%;height:auto;display:block}.task-figure-card--compact .task-figure-img{width:50%;margin:0 auto}.task-figure-card figcaption{font-family:var(--serif);font-style:italic;font-size:12px;color:var(--ink-faint);text-align:center;margin-top:10px;border-top:1px solid var(--hairline);padding-top:10px}.task-image-credit{color:var(--ink-faint);font-family:var(--mono);font-size:10px;font-style:normal}.task-image-credit p{margin:0}.task-image-credit a{color:inherit;text-decoration:underline;text-underline-offset:2px}.task-image-credit a:hover{color:var(--accent-text)}@media (max-width: 900px){.task-hero-grid{grid-template-columns:1fr;gap:24px}}.taxonomy-suggestion-cell{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:100%;border-top:0;border-left:0;background:transparent;color:var(--ink-soft);text-align:left}.taxonomy-suggestion-cell .name{font-style:italic}.taxonomy-suggestion-icon{width:14px;height:14px}.task-page-grid{display:grid;grid-template-columns:1fr 260px;gap:56px;align-items:start}.task-featured-collection{display:grid;grid-template-columns:1fr auto;gap:4px 24px;align-items:center;margin-top:32px;padding:18px 24px;border:1px solid var(--hairline);border-left:3px solid var(--accent);border-radius:6px;background:var(--bg-elevated);color:var(--ink);text-decoration:none;transition:border-color .15s}.task-featured-collection:hover{border-color:var(--accent)}.task-featured-collection-eyebrow{grid-column:1;font-family:var(--mono);font-size:10px;font-weight:600;letter-spacing:.12em;text-transform:uppercase;color:var(--accent-text)}.task-featured-collection strong{grid-column:1;font-family:var(--serif);font-size:22px;line-height:1.2}.task-featured-collection-description{grid-column:1;color:var(--ink-soft);font-size:14px;line-height:1.45}.task-featured-collection-meta{grid-column:2;grid-row:1 / span 3;display:inline-flex;align-items:center;gap:6px;font-family:var(--mono);font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--accent-text);white-space:nowrap}.medical-ai-hub{margin-top:32px;padding:24px;border:1px solid var(--hairline);border-top:3px solid var(--accent);border-radius:6px;background:var(--bg-elevated)}.medical-ai-hub-heading>span,.medical-ai-hub-card-eyebrow{display:block;font-family:var(--mono);font-size:10px;font-weight:600;letter-spacing:.12em;text-transform:uppercase;color:var(--accent-text)}.medical-ai-hub-heading h2{margin:6px 0 4px;font-family:var(--serif);font-size:26px;line-height:1.2;color:var(--ink)}.medical-ai-hub-heading p{margin:0;color:var(--ink-soft);font-size:14px}.medical-ai-hub-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-top:20px}.medical-ai-hub-card{display:flex;min-width:0;min-height:176px;flex-direction:column;padding:16px;border:1px solid var(--hairline);border-radius:5px;background:var(--bg);color:var(--ink);text-decoration:none;transition:border-color .15s,transform .15s}.medical-ai-hub-card:hover{border-color:var(--accent);transform:translateY(-2px)}.medical-ai-hub-card strong{margin-top:10px;font-family:var(--serif);font-size:18px;line-height:1.2}.medical-ai-hub-card-description{margin-top:8px;color:var(--ink-soft);font-size:13px;line-height:1.45}.medical-ai-hub-card-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:auto;padding-top:16px;font-family:var(--mono);font-size:10px;letter-spacing:.04em;text-transform:uppercase;color:var(--ink-faint)}.task-explainer{font-family:var(--serif);font-size:17px;line-height:1.55;color:var(--ink);max-width:720px;margin-top:16px;margin-bottom:28px;text-wrap:pretty}.task-explainer p{margin:0 0 12px}.task-explainer p:last-child{margin-bottom:0}.task-explainer a{color:var(--accent-text);text-decoration:underline;text-underline-offset:2px;text-decoration-thickness:1px}.task-explainer a:hover{color:var(--accent)}.task-explainer strong{color:var(--ink);font-weight:600}.task-explainer em{font-style:italic}.task-explainer code{font-family:var(--mono);font-size:.9em;background:var(--bg-elevated);padding:1px 5px;border-radius:3px}.task-quickstats{display:flex;gap:28px;font-family:var(--mono);font-size:11px;color:var(--ink-faint);letter-spacing:.05em;padding-bottom:14px;margin-bottom:0;border-bottom:1px solid var(--accent)}.task-quickstats .num{color:var(--ink);font-weight:600;font-size:12px;margin-right:5px;font-feature-settings:"tnum"}.task-framework-links{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin-top:14px}.task-framework-links-label{font-family:var(--mono);font-size:10px;letter-spacing:.12em;text-transform:uppercase;color:var(--ink-faint);font-weight:600}.task-framework-link{display:inline-flex;align-items:center;gap:6px;font-family:var(--mono);font-size:12px;color:var(--ink);text-decoration:none;padding:4px 10px;border:1px solid var(--hairline);border-radius:999px;background:var(--bg-elevated);transition:color .15s,border-color .15s}.task-framework-link:hover{color:var(--accent-text);border-color:var(--accent)}.task-framework-link-stars{color:var(--ink-faint);font-size:11px}.task-side{position:sticky;top:100px;font-size:13px}.side-block{margin-bottom:28px}.side-block-num{font-family:var(--mono);font-size:10px;color:var(--accent-text);letter-spacing:.1em;margin-bottom:4px}.side-block-label{font-family:var(--mono);font-size:12px;letter-spacing:.12em;text-transform:uppercase;color:var(--ink);font-weight:600;padding-bottom:8px;border-bottom:1px solid var(--hairline);margin-bottom:10px}.side-link-row{display:flex;justify-content:space-between;align-items:baseline;padding:5px 0;cursor:pointer;font-family:var(--serif);font-size:14px}.side-link-row:hover{color:var(--accent-text)}.side-link-row .count{font-family:var(--mono);font-size:11px;color:var(--ink-faint)}.side-domain-pill{font-family:var(--mono);font-size:11px;color:var(--accent-text);padding:6px 0}.side-method-row{display:flex;justify-content:space-between;align-items:center;padding:4px 0}.side-method-row .num{font-family:var(--mono);font-size:10.5px;color:var(--ink-faint)}.task-section-head{scroll-margin-top:96px;margin-top:28px;margin-bottom:14px}.task-section-eyebrow{font-family:var(--mono);font-size:10px;letter-spacing:.12em;text-transform:uppercase;color:var(--accent-text);margin-bottom:6px}.task-section-title{font-family:var(--mono);font-size:18px;font-weight:600;color:var(--ink);letter-spacing:.04em;text-transform:uppercase;display:flex;align-items:baseline;gap:10px}.task-section-title .meta{font-family:var(--mono);font-size:11px;color:var(--ink-faint);font-weight:400;letter-spacing:.05em;text-transform:none}.subtask-section{margin-bottom:24px}.subtask-section+.subtask-section{margin-top:8px}.subtask-head{display:flex;align-items:baseline;gap:10px;margin:18px 0 10px}.subtask-head-name{font-family:var(--mono);font-size:14px;font-weight:600;color:var(--ink);letter-spacing:.04em;text-transform:uppercase;text-decoration:none;transition:color .15s}.subtask-head-name:hover{color:var(--accent-text)}.subtask-head-meta{font-family:var(--mono);font-size:11px;color:var(--ink-faint);letter-spacing:.05em}.subtask-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;align-items:start}.subtask-grid .subtask-section{margin-bottom:0;border:1px solid var(--hairline);background:var(--bg-elevated);border-radius:6px;padding:12px 14px 10px}.subtask-grid .subtask-section+.subtask-section{margin-top:0}.subtask-grid .subtask-head{margin:0 0 8px;padding-bottom:8px;border-bottom:1px solid var(--hairline)}.subtask-grid .subtask-head-name{font-size:12px}.subtask-grid .subtask-head-meta{font-size:10px}.subtask-summary{display:flex;flex-direction:column;gap:7px;min-height:86px;color:var(--ink-soft);text-decoration:none;font-family:var(--mono);font-size:10px;line-height:1.4;letter-spacing:.05em;text-transform:uppercase}.subtask-summary:hover{color:var(--ink)}.subtask-summary-desc{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:3;font-family:var(--serif);font-size:13px;line-height:1.35;letter-spacing:0;text-transform:none;color:var(--ink-soft)}.subtask-grid .bench-row{display:grid;grid-template-columns:22px 1fr 16px;gap:10px;align-items:center;border:0;background:transparent;border-radius:0;padding:8px 0;margin-bottom:0;border-bottom:1px dashed var(--hairline);transition:none}.subtask-grid .bench-row:last-of-type{border-bottom:0}.subtask-grid .bench-row:hover{border-color:transparent}.subtask-grid .bench-row:hover .bench-row-name{color:var(--accent-text)}.subtask-grid .bench-row-num{font-size:10px}.subtask-grid .bench-row-name{font-size:13.5px;margin-bottom:2px;line-height:1.2}.subtask-grid .bench-row-sub{font-size:9.5px;letter-spacing:.06em}.subtask-grid .bench-row-arrow{font-size:14px}.subtask-grid .bench-show-more{font-size:10px;padding:6px 0 0;margin-top:2px}.bench-card{border:1px solid var(--hairline);background:var(--bg-elevated);border-radius:6px;padding:18px 22px;margin-bottom:14px;cursor:pointer;transition:border-color .15s}.bench-card:hover{border-color:var(--ink)}.bench-head{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:14px;gap:16px}.bench-name{font-family:var(--mono);font-size:14px;font-weight:600;letter-spacing:.02em;text-transform:uppercase;color:var(--ink)}.bench-sub{font-family:var(--mono);font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-faint);margin-top:4px}.bench-sota-value{font-family:var(--serif);font-size:36px;font-weight:500;color:var(--accent);font-feature-settings:"tnum";line-height:1}.bench-sota-tag{font-family:var(--mono);font-size:10px;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-faint);text-align:right;margin-top:4px}.bench-task-tag{font-family:var(--mono);font-size:10px;letter-spacing:.08em;text-transform:uppercase;color:var(--accent-text)}.domain-mega-title{font-family:var(--mono);font-size:56px;font-weight:600;letter-spacing:-.01em;line-height:1;text-transform:uppercase;margin-bottom:0;color:var(--ink);overflow-wrap:break-word}.benchmark-trend-table{border-top:1px solid var(--hairline)}.benchmark-trend-head,.benchmark-trend-row{display:grid;grid-template-columns:124px minmax(150px,.8fr) minmax(150px,.9fr) minmax(200px,1.3fr) 44px 78px;gap:20px;align-items:center}.benchmark-trend-head{padding:9px 16px;border-bottom:1px solid var(--hairline);font-family:var(--mono);font-size:9.5px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-faint)}.benchmark-trend-row{min-height:92px;padding:12px 16px;border-bottom:1px solid var(--hairline);background:transparent;transition:background .15s,border-color .15s}.benchmark-trend-row:hover{background:var(--bg-elevated);border-color:var(--hairline-strong)}.benchmark-trend-row:hover .bench-row-name{color:var(--accent-text)}.benchmark-trend-cell{min-width:0}.benchmark-trend-sparkline{display:block;width:112px;height:42px;overflow:visible}.benchmark-trend-axis{stroke:var(--hairline-strong);stroke-width:.8;stroke-dasharray:1.5 2.5;vector-effect:non-scaling-stroke}.benchmark-trend-area{fill:var(--accent-soft);opacity:.68}.benchmark-trend-line{fill:none;stroke:var(--accent);stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}.benchmark-trend-dot{fill:var(--bg-elevated);stroke:var(--accent);stroke-width:1.8;vector-effect:non-scaling-stroke}.benchmark-trend-point{cursor:crosshair;outline:none}.benchmark-trend-point-hit{fill:transparent}.benchmark-trend-point-mark{fill:var(--bg-elevated);stroke:var(--accent);stroke-width:1.25;opacity:0;transition:opacity .12s,r .12s;vector-effect:non-scaling-stroke}.benchmark-trend-point:hover .benchmark-trend-point-mark,.benchmark-trend-point:focus .benchmark-trend-point-mark{opacity:1;r:2.3px}.benchmark-trend-tooltip rect{fill:var(--ink);opacity:.94}.benchmark-trend-tooltip text{fill:var(--bg);font-family:var(--mono);font-size:3.2px;letter-spacing:.01em}.benchmark-trend-tooltip .benchmark-trend-tooltip-value{font-weight:700}.benchmark-trend-meta{display:flex;align-items:center;gap:6px;margin-top:3px;font-family:var(--mono);font-size:8.5px;letter-spacing:.035em;color:var(--ink-faint);white-space:nowrap}.benchmark-trend-meta strong{color:var(--ink-soft);font-weight:600}.benchmark-trend-change{padding:1px 4px;border-radius:999px;font-size:8px;font-weight:600}.benchmark-trend-change.is-up,.benchmark-trend-change.is-new{color:var(--positive-text);background:var(--positive-bg)}.benchmark-trend-change.is-down{color:var(--negative-text);background:var(--negative-bg)}.benchmark-trend-benchmark{min-width:0}.benchmark-trend-row .bench-row-name{display:block;margin-bottom:5px}.benchmark-trend-row .bench-row-best{width:100%;justify-content:flex-start;text-align:left}.bench-row-best-empty{color:var(--ink-faint);font-family:var(--mono)}.bench-row-paper{min-width:0;font-family:var(--serif);font-size:14px;line-height:1.35}.bench-row-paper a{color:var(--accent-text)}.bench-row-paper a:hover{text-decoration:underline}.bench-row-code{display:flex;justify-content:center}.bench-row-code a{display:inline-flex;color:var(--ink-soft);transition:color .15s,transform .15s}.bench-row-code a:hover{color:var(--accent-text);transform:translateY(-1px)}.bench-row-compare{display:flex;justify-content:center}.bench-row-compare a{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:30px;padding:0 10px;border:1px solid var(--accent);border-radius:999px;color:var(--accent-text);font-family:var(--mono);font-size:9px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;white-space:nowrap;transition:color .15s,background .15s}.bench-row-compare a svg{transition:transform .15s}.bench-row-compare a:hover{color:var(--bg);background:var(--accent)}.bench-row-compare a:hover svg{transform:translate(2px)}.bench-row-compare a:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.bench-row{display:grid;grid-template-columns:36px 1fr auto 28px;gap:18px;align-items:center;padding:16px 18px;border:1px solid var(--hairline);background:var(--bg-elevated);border-radius:6px;margin-bottom:8px;cursor:pointer;transition:border-color .15s,transform .15s}.bench-row:hover{border-color:var(--ink)}.bench-row:hover .bench-row-arrow{color:var(--accent-text);transform:translate(3px)}.bench-row-num{font-family:var(--mono);font-size:11px;color:var(--ink-faint);letter-spacing:.05em;font-feature-settings:"tnum"}.bench-row-name{font-family:var(--serif);font-size:18px;font-weight:500;color:var(--ink);letter-spacing:-.005em;margin-bottom:4px}.bench-row-sub{display:flex;align-items:center;gap:8px;font-family:var(--mono);font-size:10px;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-faint)}.bench-row-sub strong{color:var(--ink-soft);font-weight:600}.bench-row-variants{display:flex;flex-wrap:wrap;gap:4px;margin:2px 0 6px}.bench-row-variant{font-family:var(--mono);font-size:9.5px;letter-spacing:.02em;white-space:nowrap;padding:1px 5px;border:1px solid var(--hairline);border-radius:3px;background:transparent;color:var(--ink-faint);cursor:pointer;transition:border-color .15s,color .15s}.bench-row-variant:hover{border-color:var(--ink);color:var(--ink)}.bench-row-variant[aria-pressed=true]{border-color:var(--accent);color:var(--accent-text)}.bench-row-variant:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.bench-row-sub .dot-sep{color:var(--hairline-strong)}.bench-row-sota{text-align:right}.bench-row-sota-value{font-family:var(--serif);font-size:22px;font-weight:500;color:var(--accent-text);font-feature-settings:"tnum";line-height:1}.bench-row-sota-tag{font-family:var(--mono);font-size:9.5px;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-faint);margin-top:4px}.bench-row-arrow{font-family:var(--serif);font-size:18px;color:var(--hairline-strong);text-align:center;transition:color .15s,transform .15s}.bench-row-best{display:flex;align-items:center;justify-content:flex-end;gap:6px;max-width:240px;text-align:right}.bench-row-best-icon{color:var(--accent-text);flex:0 0 auto}.bench-row-best-name{font-family:var(--serif);font-size:14px;color:var(--ink-soft);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bench-show-more{font-family:var(--mono);font-size:11px;letter-spacing:.05em;color:var(--ink-faint);background:transparent;border:0;padding:8px 2px 2px;margin-top:4px;cursor:pointer;text-transform:lowercase;transition:color .15s}.bench-show-more:hover{color:var(--accent-text)}.bm-action-btn{display:inline-flex;align-items:center;gap:8px;padding:8px 14px;border:1px solid var(--hairline);border-radius:6px;background:var(--bg-elevated);font-family:var(--sans);font-size:13px;font-style:normal;color:var(--ink);cursor:pointer;transition:border-color .15s}.bm-action-btn:hover{border-color:var(--ink)}.bm-action-btn svg{display:block}@media (max-width: 880px){.task-page-grid{grid-template-columns:1fr;gap:32px}.task-side{position:static;top:auto;order:-1}.subtask-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.medical-ai-hub-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.domain-mega-title{font-size:40px}.bench-row{grid-template-columns:28px 1fr auto;gap:12px;padding:14px}.bench-row>.bench-row-arrow{display:none}.bench-row-best{max-width:130px}.bench-row-best-name{font-size:12.5px}.benchmark-trend-head,.benchmark-trend-row{grid-template-columns:112px minmax(130px,.8fr) minmax(120px,.8fr) minmax(160px,1.2fr) 36px 72px;gap:14px}.benchmark-trend-sparkline{width:104px}}@media (max-width: 640px){.domain-mega-title{font-size:30px}.subtask-grid{grid-template-columns:1fr}.medical-ai-hub{padding:18px}.task-featured-collection{grid-template-columns:1fr;padding:16px 18px}.task-featured-collection-meta{grid-column:1;grid-row:auto;margin-top:8px}.medical-ai-hub-grid{grid-template-columns:1fr}.medical-ai-hub-card{min-height:0}.benchmark-trend-head{display:none}.benchmark-trend-row{grid-template-columns:100px minmax(0,1fr) 28px;grid-template-areas:"trend benchmark code" "trend best code" "trend paper paper" "trend compare compare";gap:4px 12px;min-height:120px;padding:12px 4px}.benchmark-trend-cell{grid-area:trend}.benchmark-trend-benchmark{grid-area:benchmark}.benchmark-trend-row .bench-row-best{grid-area:best;justify-content:flex-start;max-width:none;text-align:left}.benchmark-trend-row .bench-row-paper{grid-area:paper}.benchmark-trend-row .bench-row-code{grid-area:code}.benchmark-trend-row .bench-row-compare{grid-area:compare;justify-content:flex-start;margin-top:4px}.bench-row-compare a{min-height:26px;padding:0 9px;font-size:8.5px}.benchmark-trend-sparkline{width:96px}.benchmark-trend-meta{flex-wrap:wrap;gap:3px;white-space:normal}.task-quickstats{flex-wrap:wrap;gap:16px}}.paper-meta-line .arxiv-id{color:var(--accent-text)}.paper-authors .institution{font-style:italic;color:var(--ink-faint)}.paper-tags--clamped .method-chip{line-height:16px}.method-hero-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(360px,560px);gap:48px;align-items:start}.tag-hero.method-hero-grid{padding:8px 0 28px;margin-bottom:24px}.method-hero-grid .tag-hero-eyebrow{margin-bottom:8px}.method-hero-grid .research-follow{margin:12px 0 10px}.method-hero-grid .tag-hero-meta{margin-top:20px}.method-hero-grid--wide-figure{grid-template-columns:minmax(0,1fr) minmax(480px,640px)}.method-figure-card{background:var(--bg-elevated);border:1px solid var(--hairline);border-radius:6px;padding:16px 16px 12px;margin:0;box-shadow:0 1px #00000005;align-self:start}.method-figure-svg{width:100%;display:block}.method-figure-svg--schematic{aspect-ratio:360 / 420}.method-figure-img{width:100%;height:auto;display:block}.method-figure-svg--compact .method-figure-img{width:50%;margin:0 auto}.method-figure-svg--scaled-80 .method-figure-img{width:80%;margin:0 auto}.method-figure-card figcaption{font-family:var(--serif);font-style:italic;font-size:12px;color:var(--ink-faint);text-align:center;margin-top:10px;border-top:1px solid var(--hairline);padding-top:10px}.method-image-credit{color:var(--ink-faint);font-family:var(--mono);font-size:10px;font-style:normal}.method-image-credit p{margin:0}.method-image-credit a{color:inherit;text-decoration:underline;text-underline-offset:2px}.method-image-credit a:hover{color:var(--accent-text)}.method-description{font-family:var(--serif);font-size:17px;color:var(--ink-soft);max-width:720px;line-height:1.6;margin-top:12px;text-wrap:pretty}.method-description p{margin:0 0 12px}.method-description p:last-child{margin-bottom:0}.method-description a{color:var(--accent-text);text-decoration:underline;text-underline-offset:2px;text-decoration-thickness:1px}.method-description a:hover{color:var(--accent)}.method-description strong{color:var(--ink);font-weight:600}.method-description code{font-family:var(--mono);font-size:.9em;background:var(--bg-elevated);padding:1px 5px;border-radius:3px}.method-description ul,.method-description ol{padding-left:22px;margin:0 0 12px}.method-description ul{list-style-type:disc}.method-description ol{list-style-type:decimal}.method-description li{margin-bottom:4px}.method-description .katex-display{margin:14px 0;overflow-x:auto;overflow-y:hidden;padding:4px 0}.method-description .katex{font-size:1em}.method-source{margin-top:18px;display:flex;flex-direction:column;gap:6px;max-width:720px}.method-source-label{font-family:var(--mono);font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:var(--ink-faint)}.method-source-link{display:flex;flex-direction:column;gap:2px;padding:12px 14px;background:var(--bg-elevated);border:1px solid var(--hairline);border-left:3px solid var(--accent-text);border-radius:3px;cursor:pointer;transition:background .12s,border-color .12s;text-decoration:none}.method-source-link:not(.is-static):hover{background:var(--bg-subtle);border-color:var(--hairline-strong);border-left-color:var(--accent)}.method-source-link.is-static{cursor:default}.method-source-title{font-family:var(--serif);font-size:17px;font-weight:500;color:var(--ink);letter-spacing:-.005em}.method-source-link:not(.is-static):hover .method-source-title{text-decoration:underline;text-underline-offset:3px;text-decoration-thickness:1px}.method-source-meta{font-family:var(--mono);font-size:11px;color:var(--ink-faint)}@media (max-width: 1024px){.method-hero-grid{grid-template-columns:1fr;gap:24px}.method-figure-card{max-width:560px}.method-hero-grid--wide-figure .method-figure-card{max-width:640px}}.method-hero-title{font-family:var(--mono);font-size:40px;margin-bottom:0;letter-spacing:-.01em}.method-trending-icon{flex:0 0 auto;color:var(--accent-text);fill:color-mix(in srgb,var(--accent-text) 18%,transparent)}.method-trend-score{color:var(--accent-text);font-weight:600}.method-trend-panel{margin-top:20px;padding-top:14px;border-top:1px solid var(--hairline-strong)}.method-trend-header{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:4px}.method-trend-eyebrow{margin-bottom:5px;font-family:var(--mono);font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:var(--accent-text)}.method-trend-header p{margin:3px 0 0;font-family:var(--mono);font-size:11px;color:var(--ink-faint)}.method-trend-summary{display:flex;flex-direction:column;align-items:flex-end;flex:0 0 auto;font-family:var(--mono);font-size:10px;color:var(--ink-faint)}.method-trend-summary>strong{font-family:var(--serif);font-size:19px;font-weight:500;line-height:1;color:var(--ink)}.method-usage-chart-wrap{position:relative;width:100%}.method-usage-chart{display:block;width:100%;height:auto;overflow:visible}.method-usage-gridline{stroke:var(--hairline);stroke-width:1}.method-usage-y-label,.method-usage-x-label{fill:var(--ink-faint);font-family:var(--mono);font-size:9px}.method-usage-bar-hit{fill:transparent}.method-usage-bar-mark{fill:color-mix(in srgb,var(--accent-text) 48%,var(--bg));transition:fill .12s}.method-usage-bar.is-current .method-usage-bar-mark{opacity:.55}.method-usage-bar:hover .method-usage-bar-mark,.method-usage-bar:focus .method-usage-bar-mark,.method-usage-bar.is-active .method-usage-bar-mark{fill:var(--accent-text)}.method-usage-bar:focus{outline:none}.method-usage-tooltip{position:absolute;top:4px;right:8px;display:flex;gap:8px;padding:5px 8px;border:1px solid var(--hairline-strong);background:var(--bg);font-family:var(--mono);font-size:10px;color:var(--ink-soft);pointer-events:none}.method-trend-skeleton{margin-top:20px}.method-trend-note{margin:6px 0 0;color:var(--ink-faint);font-family:var(--mono);font-size:10px}@media (max-width: 640px){.method-trend-header{flex-direction:column;gap:12px}.method-trend-summary{align-items:flex-start}}.method-chip{display:inline-flex;align-items:center;padding:4px 10px;font-family:var(--mono);font-size:11px;font-weight:500;color:var(--ink);background:var(--bg-elevated);border:1px solid var(--hairline);border-radius:4px;cursor:pointer;transition:all .15s;white-space:nowrap}.method-chip:hover{border-color:var(--ink);background:var(--bg-subtle)}.side-method-row .method-chip{font-size:10.5px;padding:3px 8px}@media (max-width: 880px){.method-hero-title{font-size:34px}}@media (max-width: 640px){.method-hero-title{font-size:30px}}.filter-row{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-bottom:24px;padding:12px 16px;border:1px solid var(--hairline);border-radius:8px;background:var(--bg-elevated)}.filter-row .label{margin-right:8px;color:var(--ink-faint);font-family:var(--mono);font-size:10px;letter-spacing:.1em;text-transform:uppercase}.search-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#1a181466;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);z-index:100;display:flex;align-items:flex-start;justify-content:center;padding-top:100px}.search-modal{width:640px;max-width:calc(100vw - 32px);background:var(--bg);border:1px solid var(--hairline-strong);border-radius:12px;box-shadow:0 20px 60px #00000026;overflow:hidden}.search-modal-input{width:100%;padding:18px 20px;font-size:16px;font-family:var(--serif);border:none;background:transparent;outline:none;border-bottom:1px solid var(--hairline);color:var(--ink)}.search-modal-input::-moz-placeholder{color:var(--ink-faint);font-style:italic}.search-modal-input::placeholder{color:var(--ink-faint);font-style:italic}.search-results{max-height:480px;overflow-y:auto;padding:8px}.search-empty{padding:32px;text-align:center;color:var(--ink-faint);font-family:var(--serif);font-style:italic}.search-section-label{font-family:var(--mono);font-size:10px;letter-spacing:.12em;text-transform:uppercase;color:var(--ink-faint);padding:10px 12px 6px}.search-result{display:flex;flex-direction:column;padding:10px 12px;border-radius:6px;cursor:pointer;gap:4px}.search-result:hover,.search-result.focused{background:var(--bg-subtle)}.search-result-title{font-family:var(--serif);font-size:14.5px;font-weight:500;line-height:1.3}.search-result-meta{font-family:var(--mono);font-size:10.5px;color:var(--ink-faint);display:flex;gap:10px}.search-result-tag{display:flex;align-items:center;gap:8px;padding:8px 12px;border-radius:6px;cursor:pointer}.search-result-tag:hover,.search-result-tag.focused{background:var(--bg-subtle)}.search-result-tag .name{font-family:var(--mono);font-size:12px}.search-result-tag .handle{font-family:var(--mono);font-size:10px;color:var(--ink-faint)}.search-result-tag .logo{width:16px;height:16px;border-radius:3px;-o-object-fit:contain;object-fit:contain;flex:none}.search-result-tag .count{margin-left:auto;font-family:var(--mono);font-size:10px;color:var(--ink-faint)}.search-view-all-row{width:100%;border:0;border-top:1px solid var(--hairline);background:var(--bg-subtle);color:var(--accent-text);padding:12px;text-align:left;font:600 11px var(--mono);cursor:pointer}.search-view-all-row:hover,.search-view-all-row:focus-visible{background:var(--bg-subtle);outline:2px solid var(--accent);outline-offset:-2px}@media (max-width: 640px){.search-modal-input{font-size:16px;padding:14px 16px}}.search-ask-row{display:flex;align-items:center;gap:10px;width:100%;padding:10px 12px;border-radius:6px;text-align:left;color:var(--ink)}.search-ask-row:hover{background:var(--bg-subtle)}.search-ask-chip{display:inline-flex;align-items:center;font-family:var(--mono);font-size:10.5px;color:var(--accent-text);background:var(--accent-soft);border-radius:5px;padding:2px 7px;flex:none}.search-ask-text{flex:1;min-width:0;font-family:var(--serif);font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.search-ask-row kbd{font-family:var(--sans);font-size:11px;color:var(--ink-faint);border:1px solid var(--hairline);border-radius:5px;padding:1px 6px}.search-empty-sub{display:block;margin-top:10px;font-family:var(--sans);font-style:normal;font-size:12px;color:var(--ink-faint)}.settings-page-content,.settings-page-loading{min-height:min(680px,calc(100vh - 180px))}.settings-section{border:1px solid var(--hairline);border-radius:10px;padding:20px 22px;margin-top:8px;max-width:760px}.settings-section-title{font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--ink-faint);margin:0 0 14px}.settings-note.settings-note-flush{margin-top:0;padding-top:0;border-top:0}.settings-billing-loading{color:var(--ink-soft);font-size:13px}.settings-billing,.settings-billing-connect{display:flex;flex-direction:column;gap:14px}.settings-provider-grid{display:grid;gap:14px}.settings-provider-card{display:flex;flex-direction:column;gap:14px;padding:16px;border:1px solid var(--hairline);border-radius:8px;background:var(--bg-subtle)}.settings-provider-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.settings-provider-heading h3{margin:0;color:var(--ink);font-size:16px;font-weight:650}.settings-provider-heading p{margin:3px 0 0;color:var(--ink-soft);font-size:12px}.settings-usage-row{display:flex;flex-direction:column;gap:9px;padding:13px;border:1px solid var(--hairline);border-radius:7px;background:var(--bg-elevated)}.settings-usage-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.settings-usage-heading strong{flex-shrink:0;color:var(--ink);font-size:14px}.settings-usage-track{height:7px;overflow:hidden;border-radius:999px;background:var(--hairline)}.settings-usage-track>span{display:block;height:100%;border-radius:inherit;background:var(--accent)}.settings-limit-note{margin:0;color:var(--danger, #b42318);font-size:12px;line-height:1.45}.settings-byok-controls{display:flex;flex-direction:column;gap:10px;padding-top:2px}.settings-byok-controls form{display:flex;flex-direction:column;gap:10px}.settings-byok-controls input{width:100%;border:1px solid var(--hairline-strong);border-radius:7px;padding:10px 12px;color:var(--ink);background:var(--bg-elevated);font:inherit}.settings-fallback-control{display:flex;align-items:flex-start;gap:11px;cursor:pointer}.settings-fallback-control>span{display:flex;flex-direction:column;gap:4px}.settings-fallback-control strong{color:var(--ink);font-size:12px;line-height:1.4}.settings-fallback-control small{color:var(--ink-soft);font-size:11px;line-height:1.45}.settings-plan-row{display:flex;justify-content:space-between;align-items:flex-start;gap:20px}.settings-connected-badge{border-radius:999px;padding:4px 9px;color:var(--accent-text);background:var(--accent-soft);font-size:11px;font-weight:600}.settings-billing-help{color:var(--ink-soft);font-size:11px;margin:0;line-height:1.5}.settings-billing-actions{display:flex;flex-wrap:wrap;gap:8px}.settings-billing-actions .button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:34px;padding:7px 11px;border:1px solid var(--hairline-strong);border-radius:7px;color:var(--ink);background:var(--bg-elevated);font-size:12px;font-weight:600;text-decoration:none}.settings-billing-actions .button:hover{background:var(--bg-subtle)}.settings-billing-actions .button-primary{border-color:var(--accent);color:var(--accent-text);background:var(--accent-soft)}.settings-billing-actions .button:disabled{cursor:not-allowed;opacity:.55}.settings-billing-actions svg{width:12px;height:12px}.settings-token-label{color:var(--ink);font-size:12px;font-weight:600;margin-bottom:-8px}.settings-billing-connect input{width:100%;border:1px solid var(--hairline-strong);border-radius:7px;padding:10px 12px;color:var(--ink);background:var(--bg-elevated);font:inherit}.settings-billing-select{width:100%;min-height:42px;padding:9px 34px 9px 12px;border:1px solid var(--border);border-radius:7px;background:var(--bg-elevated);color:var(--ink);font:inherit}.settings-billing-select:focus{outline:2px solid var(--accent);outline-offset:1px}.settings-billing-select:disabled{cursor:wait;opacity:.7}.settings-billing-connect input:focus{border-color:var(--accent);outline:2px solid var(--accent-soft)}.settings-token-error{color:var(--danger, #b42318);font-size:12px}.theme-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.theme-option{display:flex;align-items:flex-start;gap:10px;min-width:0;padding:12px;border:1px solid var(--hairline);border-radius:7px;background:var(--bg-elevated);color:var(--ink-soft);text-align:left;transition:background .15s,border-color .15s,color .15s}.theme-option:hover{border-color:var(--hairline-strong);background:var(--bg-subtle);color:var(--ink)}.theme-option.is-selected{border-color:var(--accent);background:var(--accent-soft);color:var(--accent-text)}.theme-option:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.theme-option>svg{width:16px;height:16px;margin-top:1px;flex-shrink:0}.theme-option-copy{display:flex;flex-direction:column;gap:2px;min-width:0}.theme-option-label{color:var(--ink);font-size:13px;font-weight:600}.theme-option-desc{color:var(--ink-soft);font-size:11px;line-height:1.35}.theme-option.is-selected .theme-option-label,.theme-option.is-selected .theme-option-desc{color:var(--accent-text)}.settings-row{display:flex;align-items:flex-start;justify-content:space-between;gap:24px}.settings-row-text{display:flex;flex-direction:column;gap:4px;cursor:pointer}.settings-row-label{font-size:15px;font-weight:500;color:var(--ink)}.settings-row-desc{font-size:13px;color:var(--ink-soft);line-height:1.5;max-width:460px}.settings-note{margin-top:16px;padding-top:16px;border-top:1px solid var(--hairline);font-size:13px;color:var(--ink-soft);line-height:1.5}.settings-note-action{margin-top:10px}.research-section-heading{display:flex;align-items:baseline;justify-content:space-between;gap:16px}.research-section-heading .settings-section-title{display:inline-flex;align-items:center;gap:8px}.research-follow-count{border-radius:999px;padding:1px 7px;color:var(--ink-soft);background:var(--bg-subtle);font-size:11px;letter-spacing:0}.research-feed-link{display:inline-flex;align-items:center;gap:5px;flex-shrink:0;color:var(--accent-text);font-size:13px;font-weight:600;text-decoration:none}.research-feed-link:hover{text-decoration:underline;text-underline-offset:2px}.research-feed-link svg{width:14px;height:14px}.research-section-intro{margin:-6px 0 6px}.research-follow-group{margin-top:16px}.research-follow-group-title{display:flex;align-items:center;gap:6px;margin:0 0 6px;color:var(--ink-soft);font-size:12px;font-weight:600}.research-follow-group-title svg{width:14px;height:14px}.research-follow-list{margin:0;padding:0;list-style:none;border:1px solid var(--hairline);border-radius:8px;background:var(--bg-elevated)}.research-follow-row{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:52px;padding:8px 8px 8px 14px}.research-follow-row+.research-follow-row{border-top:1px solid var(--hairline)}.research-follow-text{display:flex;flex-direction:column;gap:1px;min-width:0}.research-follow-text a{overflow:hidden;color:var(--ink);font-size:14px;font-weight:500;text-overflow:ellipsis;white-space:nowrap;text-decoration:none}.research-follow-text a:hover{color:var(--accent-text);text-decoration:underline;text-underline-offset:2px}.research-follow-text span{color:var(--ink-faint);font-size:12px}.research-follow-row.is-unfollowed .research-follow-text a{color:var(--ink-faint);text-decoration:line-through}.research-follow-action{flex-shrink:0;min-height:30px;padding:5px 10px;border:1px solid transparent;border-radius:6px;color:var(--ink-soft);background:transparent;font-size:12px;font-weight:600}.research-follow-action:hover{border-color:var(--hairline-strong);color:var(--danger, #b42318);background:var(--bg-subtle)}.research-follow-action.is-refollow{border-color:var(--accent);color:var(--accent-text);background:var(--accent-soft)}.research-follow-action:disabled{cursor:wait;opacity:.55}.research-follow-action:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.research-follow-empty{margin-top:14px;padding:18px;border:1px dashed var(--hairline-strong);border-radius:8px;color:var(--ink-soft);font-size:13px;line-height:1.5}.research-follow-empty p{margin:0}.research-follow-empty strong{color:var(--ink);font-weight:600}.research-follow-browse{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.research-follow-browse a{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border:1px solid var(--hairline-strong);border-radius:7px;color:var(--ink);background:var(--bg-elevated);font-size:12px;font-weight:600;text-decoration:none}.research-follow-browse a:hover{background:var(--bg-subtle)}.research-follow-browse svg{width:13px;height:13px}.research-email-destination{display:flex;flex-wrap:wrap;align-items:center;gap:8px 10px;margin-top:16px;padding:10px 12px;border:1px solid var(--hairline);border-radius:8px;color:var(--ink-soft);background:var(--bg-subtle);font-size:13px}.research-email-destination>svg{width:15px;height:15px;flex-shrink:0}.research-email-destination strong{color:var(--ink);font-weight:600;overflow-wrap:anywhere}.research-email-destination>span{flex:1 1 220px}.research-email-destination a{color:var(--accent-text);font-size:12px;font-weight:600;text-decoration:none}.research-email-destination a:hover{text-decoration:underline;text-underline-offset:2px}.research-email-status{margin:10px 0 0;color:var(--ink-soft);font-size:12px;line-height:1.5}.research-email-status.is-warning{color:var(--danger, #b42318)}.closed-eval-tooltip-link,.external-eval-tooltip-link{font-weight:600;text-decoration:underline;text-underline-offset:2px}@media (max-width: 640px){.theme-options{grid-template-columns:1fr}}.research-follow{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;margin:14px 0 18px}.research-follow-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:112px;min-height:36px;padding:7px 16px 7px 13px;border:1px solid var(--accent);border-radius:999px;color:var(--bg);background:var(--accent);font-family:var(--sans);font-size:14px;font-weight:600;line-height:1;text-decoration:none;cursor:pointer;box-shadow:0 1px 2px #00000014;transition:background .15s,border-color .15s,color .15s,filter .15s}.research-follow-btn:hover{filter:brightness(1.1)}.research-follow-btn:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.research-follow-btn:disabled{cursor:wait;opacity:.6}.research-follow-btn svg{width:16px;height:16px;flex-shrink:0}.research-follow-btn.is-following{border-color:var(--hairline-strong);color:var(--ink);background:var(--bg-elevated);box-shadow:none}.research-follow-btn.is-following svg{color:var(--accent-text)}.research-follow-label-hover{display:none}@media (hover: hover){.research-follow-btn.is-following:hover{filter:none;border-color:var(--danger, #b42318);color:var(--danger, #b42318)}.research-follow-btn.is-following:hover svg,.research-follow-btn.is-following:hover .research-follow-label{display:none}.research-follow-btn.is-following:hover .research-follow-label-hover{display:inline}}.research-follow-hint{color:var(--ink-soft);font-family:var(--sans);font-size:13px;line-height:1.4}.research-follow-hint a{color:var(--accent-text);font-weight:600;text-decoration:none}.research-follow-hint a:hover{text-decoration:underline;text-underline-offset:2px}.research-follow-hint.is-error{color:var(--danger, #b42318)}.following-intro{max-width:720px;margin:8px auto 32px;padding:28px 30px;border:1px solid var(--hairline);border-radius:12px;background:var(--bg-elevated)}.following-intro h2{margin:0;color:var(--ink);font-family:var(--serif);font-size:26px;font-weight:500;line-height:1.2}.following-intro-lead{margin:10px 0 0;color:var(--ink-soft);font-size:15px;line-height:1.55}.following-intro-topic{display:inline-flex;align-items:center;gap:6px;margin:18px 0 0;min-height:36px;padding:7px 16px;font-size:14px}.following-intro-topic svg{width:15px;height:15px}.following-intro-note{margin:10px 0 0;color:var(--ink-faint);font-size:13px}.following-intro-note a{color:var(--accent-text)}@media (max-width: 640px){.following-intro{padding:22px 18px}}.sidebar-follow-link{display:flex;align-items:center;gap:12px;padding:6px 0}.sidebar-follow-kind{flex:0 0 76px;padding:3px 0;border-radius:6px;color:var(--accent-text);background:var(--accent-soft);font-family:var(--mono);font-size:10px;letter-spacing:.1em;text-align:center;text-transform:uppercase}.sidebar-follow-name{min-width:0;overflow:hidden;color:var(--ink);font-size:14px;text-overflow:ellipsis;white-space:nowrap}.sidebar-follow-link:hover .sidebar-follow-name{text-decoration:underline;text-underline-offset:2px}.sidebar-follow-group{display:flex;flex-direction:column;align-items:flex-start;margin-top:10px}.sidebar-follow-group .sidebar-follow-kind{flex:none;width:76px;margin-bottom:2px}@media (max-width: 880px){.sidebar-follow-link{gap:8px}.sidebar-follow-kind{flex:none;padding:1px 6px}.sidebar-follow-group{display:contents}.sidebar-follow-group .sidebar-follow-kind{width:auto;margin:0;align-self:center}}.sidebar-follow-topic{display:flex;align-items:center;gap:8px}.sidebar-follow-topic .sidebar-follow-link{flex:1;min-width:0}@media (min-width: 881px){.sidebar-follow-link{align-items:flex-start}.sidebar-follow-name{overflow:visible;overflow-wrap:anywhere;white-space:normal;line-height:1.4}.sidebar-follow-topic{align-items:flex-start}.sidebar-follow-topic .sidebar-follow-link{flex-wrap:wrap;row-gap:6px}.sidebar-follow-topic .sidebar-follow-name{flex-basis:100%}.sidebar-follow-topic .sidebar-follow-edit{padding-top:7px}}.sidebar-follow-topic.active .sidebar-follow-kind{color:var(--accent-soft);background:var(--accent-text)}.sidebar-follow-topic.active .sidebar-follow-name{font-weight:600}.sidebar-follow-edit,.no-results .link-button{padding:0;font:inherit}.sidebar-follow-edit{margin-left:auto;color:var(--ink-faint);font-size:12px}.sidebar-follow-edit:hover{color:var(--ink)}.sidebar-follow-manage{display:inline-block;margin-top:8px;color:var(--ink-faint);font-size:12px}.sidebar-follow-manage:hover{color:var(--ink)}.research-topic{margin:4px 0 20px}.research-topic .settings-row-desc{margin:4px 0 10px}.research-topic-form{display:flex;flex-direction:column;gap:8px}.research-topic-input{width:100%;padding:10px 12px;border:1px solid var(--hairline-strong, var(--hairline));border-radius:8px;color:var(--ink);background:var(--bg-elevated);font:inherit;font-size:14px;line-height:1.45;resize:vertical}.research-topic-input:focus{outline:2px solid var(--accent-soft);border-color:var(--accent-text)}.research-topic-actions{display:flex;align-items:center;gap:8px}.research-topic-count{margin-right:auto;color:var(--ink-faint);font-family:var(--mono);font-size:11px}.research-topic-save{min-height:30px;padding:5px 12px;border:0;border-radius:6px;color:#fff;background:var(--accent-text);font-size:12px;font-weight:600}.research-topic-save:disabled{opacity:.45;cursor:default}.research-topic-suggestion{margin:6px 0 0;color:var(--ink-soft);font-size:13px}.topic-dialog{max-width:640px;max-height:calc(100vh - 32px);overflow-y:auto}.topic-dialog-form{display:flex;flex-direction:column;gap:18px}.topic-dialog-title{font-family:var(--serif);font-size:24px;font-weight:500;color:var(--ink)}.topic-dialog-group{display:flex;flex-direction:column;gap:8px}.topic-dialog-group h3{margin:0;color:var(--ink-faint);font-family:var(--sans);font-size:12px;font-weight:600;letter-spacing:.06em;text-transform:uppercase}.topic-dialog-hint{margin:0;color:var(--ink-soft);font-size:13px}.topic-dialog .research-topic-input{min-height:112px;font-size:15px}.topic-dialog .research-topic-count{align-self:flex-end;margin:0}.topic-dialog-chips{display:flex;flex-wrap:wrap;gap:8px}.topic-dialog-chips>[hidden]{display:none}.topic-dialog-chip{display:inline-flex;align-items:center;gap:5px;padding:4px 11px 4px 9px;border:1px solid var(--hairline);border-radius:999px;color:var(--ink-soft);background:transparent;font-size:13px}.topic-dialog-chip svg{width:13px;height:13px}.topic-dialog-chip-image{flex:none;width:20px;height:20px;margin:-2px 1px -2px 0;box-sizing:border-box;border:1px solid var(--hairline);background:#fff}.topic-dialog-chip-image.is-author{border-radius:50%;-o-object-fit:cover;object-fit:cover}.topic-dialog-chip-image.is-organization{border-radius:5px;padding:2px;-o-object-fit:contain;object-fit:contain}.topic-dialog-chip-image.is-initials{display:inline-flex;align-items:center;justify-content:center;color:var(--ink-soft);background:var(--hairline);font-size:9px;font-weight:600;letter-spacing:.02em}.topic-dialog-chip[aria-pressed=false]:hover:not(:disabled){border-color:var(--accent-text);color:var(--accent-text)}.topic-dialog-chip[aria-pressed=true]{border-color:var(--accent-text);color:#fff;background:var(--accent-text)}.topic-dialog-chip[aria-pressed=true]:hover:not(:disabled){opacity:.85}.topic-dialog-chip:disabled{cursor:default;opacity:.6}.topic-dialog-browse{display:inline-flex;align-items:center;gap:4px;padding:4px;color:var(--accent-text);font-size:13px;text-decoration:none}.topic-dialog-browse:hover{text-decoration:underline}.topic-dialog-browse svg{width:13px;height:13px}.topic-dialog-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px}.topic-dialog-remove{margin-right:auto}.topic-dialog-actions .research-topic-save{min-height:36px;padding:7px 18px;font-size:14px}.following-topic-note{margin:0 0 16px;padding:10px 14px;border-radius:8px;color:var(--ink-soft);background:var(--accent-soft);font-size:13px}.reader-route-shell{height:100dvh;min-height:0;display:flex;flex-direction:column;overflow:hidden}.reader-route-shell>.app-header{position:static;flex:0 0 auto}.reader-route-content{min-height:0;flex:1}.paper-reader-shell{height:100%;min-height:0;display:flex;flex-direction:column;background:var(--bg);color:var(--ink);overflow:hidden}.reader-workspace{position:relative;min-height:0;flex:1;display:flex;overflow:hidden}.reader-paper-pane,.reader-assistant-pane{min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden}.reader-paper-pane{background:#fff;transition:width .24s cubic-bezier(.22,1,.36,1)}.reader-assistant-pane{visibility:visible;background:var(--bg);opacity:1;transform:translate(0);transition:width .24s cubic-bezier(.22,1,.36,1),opacity .18s ease,transform .24s cubic-bezier(.22,1,.36,1),visibility 0s}.reader-assistant-pane:focus{outline:none}.reader-assistant-pane.is-collapsed{visibility:hidden;opacity:0;transform:translate(28px);pointer-events:none;transition:width .24s cubic-bezier(.22,1,.36,1),opacity .14s ease,transform .24s cubic-bezier(.22,1,.36,1),visibility 0s linear .24s}.reader-workspace.is-resizing{cursor:col-resize;-webkit-user-select:none;-moz-user-select:none;user-select:none}.reader-workspace.is-resizing .reader-paper-pane,.reader-workspace.is-resizing .reader-assistant-pane{transition:none}.reader-resize-handle{position:relative;z-index:5;width:1px;flex:0 0 1px;cursor:col-resize;background:var(--hairline-strong);touch-action:none;outline:none}.reader-resize-handle:before{content:"";position:absolute;top:0;right:-8px;bottom:0;left:0}.reader-resize-handle:focus-visible{box-shadow:0 0 0 2px var(--accent)}.reader-collapse-assistant{position:absolute;z-index:8;top:0;right:16px;height:48px;display:flex;align-items:center;border:0;padding:0;background:transparent;color:var(--ink);font-size:12px;line-height:1.5}.reader-workspace.is-assistant-collapsed .pdf-toolbar{padding-right:96px}.reader-tabs{height:40px;flex:0 0 auto;display:flex;border-bottom:1px solid var(--border);background:var(--surface)}.reader-tabs button{flex:1;border:0;border-bottom:2px solid transparent;background:transparent;color:var(--ink-muted)}.reader-tabs button[aria-selected=true]{border-bottom-color:var(--accent);color:var(--ink);font-weight:600}.reader-tab-pending{display:inline-block;width:7px;height:7px;margin-left:6px;border-radius:50%;background:var(--accent);vertical-align:1px}@media (forced-colors: active){.reader-tab-pending{border:1px solid ButtonText}}.reader-workspace .is-hidden{position:absolute!important;top:0;right:0;bottom:0;left:0;width:100%!important;visibility:hidden;pointer-events:none}.reader-workspace.is-tabs>.reader-paper-pane,.reader-workspace.is-tabs>.reader-assistant-pane{width:100%}.reader-status{min-height:100dvh;display:grid;place-content:center;gap:12px;text-align:center}.reader-chat-unavailable{height:100%;display:grid;place-content:center;color:var(--ink-muted);padding:24px;text-align:center}.pdf-viewer{min-height:0;flex:1;display:flex;flex-direction:column}.pdf-toolbar{position:relative;min-height:48px;flex:0 0 auto;display:flex;align-items:center;gap:16px;padding:7px 10px 7px var(--reader-title-inset, 32px);border-bottom:1px solid var(--hairline);background:var(--bg);color:var(--ink);font-size:12px}.pdf-toolbar-paper{min-width:0;flex:1;display:flex;align-items:center;gap:10px;overflow:hidden}.pdf-toolbar .pdf-toolbar-back{flex:0 0 auto;height:28px;display:inline-flex;align-items:center;gap:4px;margin-left:-8px;border-radius:6px;padding:0 8px 0 6px;color:var(--ink-soft);font-weight:500;text-decoration:none;white-space:nowrap}.pdf-toolbar .pdf-toolbar-back:hover{background:var(--bg-subtle);color:var(--ink);text-decoration:none}.pdf-toolbar-title{min-width:0;overflow:hidden;color:var(--ink);font-size:14px;font-weight:600;letter-spacing:-.005em;text-overflow:ellipsis;white-space:nowrap}.pdf-toolbar-title:hover{color:var(--accent-text);text-decoration:underline;text-underline-offset:3px}.pdf-toolbar .pdf-toolbar-resource{flex:0 0 auto;height:24px;display:inline-flex;align-items:center;gap:5px;border:1px solid var(--hairline);border-radius:999px;padding:0 9px;background:var(--bg-elevated);color:var(--ink-soft);font-size:11px;font-variant-numeric:tabular-nums;text-decoration:none;white-space:nowrap}.pdf-toolbar .pdf-toolbar-resource:hover{border-color:var(--hairline-strong);color:var(--ink);text-decoration:none}.pdf-toolbar-controls{flex:0 0 auto;display:flex;align-items:center;gap:8px}.pdf-toolbar-group{height:30px;display:flex;align-items:center;gap:1px;border:1px solid var(--hairline);border-radius:8px;padding:1px;background:var(--bg-elevated)}.pdf-toolbar button,.pdf-toolbar-controls a{min-height:30px;display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px solid var(--hairline);border-radius:8px;padding:0 10px;background:var(--bg-elevated);color:var(--ink);font-weight:500;text-decoration:none}.pdf-toolbar button:hover:not(:disabled),.pdf-toolbar-controls a:hover{border-color:var(--hairline-strong);background:var(--bg-subtle)}.pdf-toolbar .pdf-toolbar-group button{width:26px;min-height:26px;height:26px;border:0;border-radius:6px;padding:0;background:transparent;color:var(--ink-soft)}.pdf-toolbar .pdf-toolbar-group button:hover:not(:disabled){background:var(--bg-subtle);color:var(--ink)}.pdf-toolbar-search svg{color:var(--ink-soft)}.pdf-toolbar button[aria-expanded=true]{border-color:var(--hairline-strong);background:var(--bg-subtle)}.pdf-toolbar button:focus-visible,.pdf-toolbar a:focus-visible,.pdf-toolbar input:focus-visible,.pdf-search-controls input:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.pdf-toolbar button:disabled{cursor:default;opacity:.35}.pdf-page-form{display:flex;align-items:baseline;gap:3px;padding:0 4px;color:var(--ink-soft);font-variant-numeric:tabular-nums;white-space:nowrap}.pdf-page-form input{width:30px;height:22px;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;border:1px solid transparent;border-radius:5px;padding:0 2px;background:var(--bg-subtle);color:var(--ink);font:inherit;font-weight:500;text-align:center}.pdf-page-form input:hover,.pdf-page-form input:focus{border-color:var(--hairline-strong);background:var(--bg)}.pdf-page-form input::-webkit-inner-spin-button,.pdf-page-form input::-webkit-outer-spin-button{margin:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.pdf-zoom-value{width:46px;height:22px;border:1px solid transparent;border-radius:5px;padding:0 2px;background:transparent;color:var(--ink);text-align:center;font:inherit;font-weight:500;font-variant-numeric:tabular-nums}.pdf-zoom-value:hover,.pdf-zoom-value:focus{border-color:var(--hairline-strong);background:var(--bg)}.pdf-search-controls{position:absolute;z-index:10;right:8px;top:calc(100% + 5px);display:flex;align-items:center;gap:5px;padding:7px;border:1px solid var(--hairline);border-radius:6px;background:var(--bg-elevated);box-shadow:0 5px 20px #0003}.pdf-search-controls input{width:min(260px,45vw);min-height:30px;border:1px solid var(--hairline);border-radius:4px;padding:4px 7px;background:var(--bg);color:var(--ink)}.pdf-search-controls span{min-width:70px;color:var(--ink-soft);text-align:center}.pdf-search-controls button{display:inline-flex;align-items:center;justify-content:center}.pdf-citation-steps{position:absolute;z-index:10;top:8px;left:50%;display:flex;align-items:center;gap:4px;padding:5px 5px 5px 12px;border:1px solid var(--hairline);border-radius:8px;background:var(--bg-elevated);color:var(--ink);box-shadow:0 5px 20px #0003;font-size:13px;transform:translate(-50%);animation:pdf-citation-steps-in .14s ease-out}.pdf-citation-steps span{margin-right:4px;color:var(--ink-soft);font-variant-numeric:tabular-nums;white-space:nowrap}.pdf-citation-steps button{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:0;border-radius:5px;background:transparent;color:var(--ink);cursor:pointer}.pdf-citation-steps button:hover{background:var(--hairline)}.pdf-citation-steps button:focus-visible{outline:2px solid var(--accent);outline-offset:1px}@keyframes pdf-citation-steps-in{0%{opacity:0;transform:translate(-50%,-6px)}}@media (prefers-reduced-motion: reduce){.pdf-citation-steps{animation:none}}.pdf-scroll-frame{position:relative;min-height:0;flex:1;display:flex;flex-direction:column}.pdf-scroll{min-height:0;flex:1;overflow:auto;overscroll-behavior:contain;background:#fff;scrollbar-color:var(--ink-faint) var(--bg-subtle);scrollbar-gutter:stable}.pdf-scroll::-webkit-scrollbar{width:12px;height:12px}.pdf-scroll::-webkit-scrollbar-track{background:var(--bg-subtle)}.pdf-scroll::-webkit-scrollbar-thumb{border:3px solid var(--bg-subtle);border-radius:999px;background:var(--ink-faint)}.pdf-pages{display:flex;width:-moz-max-content;width:max-content;min-width:100%;flex-direction:column;align-items:center;gap:8px;zoom:var(--pdf-live-scale, 1)}.pdf-page{position:relative;background:#fff}.pdf-page-layer{zoom:var(--pdf-layer-scale, 1)}.pdf-page-layer.is-pending{position:absolute;top:0;left:0;visibility:hidden;pointer-events:none}.pdf-page .react-pdf__Page{margin:0}.pdf-page-snapshot{position:absolute;top:0;right:0;bottom:0;left:0;z-index:2;width:100%;height:100%;pointer-events:none}.pdf-page .textLayer ::-moz-selection{background:#2d7dff4d;color:transparent}.pdf-page .textLayer ::selection{background:#2d7dff4d;color:transparent}.pdf-search-highlight{border-radius:1px;background:#2d7dff57;color:inherit;box-shadow:0 0 0 1px #2d7dff2e}.pdf-search-highlight.is-active{background:#1c68ef85;box-shadow:0 0 0 1px #1c68ef57}.pdf-citation-highlight{position:absolute;z-index:3;border-radius:3px;pointer-events:none;background:#ffc40047;box-shadow:0 0 0 2px #ffaa00b3;animation:pdf-citation-flash 4s ease-out forwards}@keyframes pdf-citation-flash{0%,10%{opacity:0}18%,70%{opacity:1}to{opacity:0}}.pdf-citation-highlight.is-brief{animation:pdf-citation-flash-brief 1.8s ease-out forwards}@keyframes pdf-citation-flash-brief{0%{opacity:0}12%,65%{opacity:1}to{opacity:0}}@media (prefers-reduced-motion: reduce){.pdf-citation-highlight{animation:pdf-citation-flash 4s step-end forwards}.pdf-citation-highlight.is-brief{animation:pdf-citation-flash-brief 1.8s step-end forwards}}.pdf-outline{position:absolute;z-index:9;top:0;right:14px;bottom:0;display:flex;align-items:center;pointer-events:none}.pdf-outline-rail{display:flex;flex-direction:column;align-items:flex-end;justify-content:center;gap:5px;max-height:100%;overflow:hidden;border:0;width:56px;padding:12px 6px 12px 0;background:transparent;cursor:pointer;pointer-events:auto;touch-action:none}.pdf-outline-rail:focus-visible{outline:2px solid var(--accent);outline-offset:-2px;border-radius:6px}.pdf-outline-tick{--pop: 0;--tick-width: 18px;display:block;width:calc(var(--tick-width) + var(--pop) * (34px - var(--tick-width)));height:2px;border-radius:1px;background:var(--ink-faint);transform:scaleY(calc(1 + var(--pop)));transition:background .12s ease,width .18s cubic-bezier(.34,1.56,.64,1),transform .18s cubic-bezier(.34,1.56,.64,1)}.pdf-outline-tick.level-1{--tick-width: 10px}.pdf-outline-tick.is-active{--tick-width: 22px;background:var(--accent)}.pdf-outline-tick.is-scrubbed{background:var(--accent)}.pdf-outline-scrub-label{position:absolute;right:calc(100% - 4px);max-width:min(260px,60vw);overflow:hidden;padding:6px 12px;border:1px solid var(--hairline);border-radius:999px;background:var(--bg-elevated);color:var(--ink);box-shadow:0 6px 20px #0003;font-size:13px;font-weight:600;line-height:1.3;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;transform:translateY(-50%);transition:top 90ms ease;animation:pdf-outline-label-in .16s cubic-bezier(.34,1.56,.64,1)}@keyframes pdf-outline-label-in{0%{opacity:0;transform:translate(8px,-50%) scale(.9)}}.pdf-outline-panel{position:absolute;right:100%;top:50%;width:min(320px,60vw);max-height:min(70vh,100%);overflow-y:auto;margin-right:-6px;padding:10px 6px;border:1px solid var(--hairline);border-radius:12px;background:var(--bg-elevated);color:var(--ink);box-shadow:0 8px 28px #0003;font-size:14px;line-height:1.35;opacity:0;visibility:hidden;transform:translate(6px,-50%);transition:opacity .12s ease,transform .12s ease,visibility 0s linear .12s;pointer-events:none}.pdf-outline:hover .pdf-outline-panel,.pdf-outline:focus-within .pdf-outline-panel,.pdf-outline.is-pinned .pdf-outline-panel{opacity:1;visibility:visible;transform:translateY(-50%);transition-delay:0s;pointer-events:auto}.pdf-outline-panel ol{margin:0;padding:0;list-style:none}.pdf-outline-panel li.level-1 a{padding-left:32px;font-size:13px;color:var(--ink-soft)}.pdf-outline-panel a{display:block;padding:7px 16px;border-radius:6px;color:var(--ink-muted);text-decoration:none;overflow-wrap:anywhere}.pdf-outline-panel a:hover{background:var(--bg-subtle);color:var(--ink);text-decoration:none}.pdf-outline-panel a.is-scrubbed{background:var(--bg-subtle);color:var(--ink);box-shadow:inset 3px 0 0 var(--accent)}.pdf-outline-panel a:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}.pdf-outline-panel a[aria-current=location]{color:var(--accent-text);font-weight:600}@media (hover: none){.pdf-outline:hover:not(.is-pinned) .pdf-outline-panel{opacity:0;visibility:hidden;pointer-events:none}}@media (forced-colors: active){.pdf-outline-tick{background:ButtonText}.pdf-outline-tick.is-active{background:Highlight}}@media (prefers-reduced-motion: reduce){.pdf-outline-panel,.pdf-outline-tick,.pdf-outline-scrub-label{transition:none;animation:none}}.pdf-loading,.pdf-error{min-height:50vh;display:grid;place-content:center;color:var(--ink);text-align:center;padding:24px}.pdf-error a,.pdf-error button{color:inherit}.chat-page--reader .chat-main{min-width:0}.chat-page--reader .chat-topbar{min-height:48px;gap:4px;padding:7px 4px 7px 20px}.chat-page--reader .chat-share-button,.chat-page--reader .chat-topbar-title{margin-right:8px}.chat-reader-icon-btn{width:28px;height:28px}.chat-reader-icon-btn svg{width:15px;height:15px}.chat-page--reader .chat-empty-inner{width:min(100%,560px);padding-inline:16px}.chat-page--reader .chat-examples{width:min(100%,300px);margin-inline:auto;flex-direction:column;align-items:stretch}.chat-page--reader .chat-example{width:100%}.chat-reader-action{border:0;background:transparent;color:var(--accent-text);text-decoration:none;font-size:12px;white-space:nowrap}@media (max-width: 880px){.chat-page--reader .chat-topbar{padding-right:16px}.pdf-toolbar{padding-left:16px}}@media (max-width: 640px){.chat-page--reader .chat-topbar{padding-right:14px}.pdf-zoom-value{display:none}.pdf-toolbar{gap:8px;overflow-x:auto;padding-left:14px}.pdf-toolbar-paper{min-width:150px}.pdf-toolbar-search span{display:none}.pdf-toolbar .pdf-toolbar-search{width:30px;padding:0}}@media (forced-colors: active){.reader-resize-handle,.pdf-toolbar button,.pdf-toolbar a{border:1px solid ButtonText}}@media (prefers-reduced-motion: reduce){.paper-reader-shell *{scroll-behavior:auto!important}.reader-paper-pane,.reader-assistant-pane{transition-duration:.01ms!important}}.pdf-page .linkAnnotation>.pdf-paper-preview-link{position:absolute;top:0;right:0;bottom:0;left:0;display:block;width:100%;height:100%}.pdf-bibliography-link{position:absolute;z-index:2;border-radius:3px}.pdf-bibliography-link>.pdf-paper-preview-link{position:absolute;top:0;right:0;bottom:0;left:0;display:block;border-radius:inherit}.pdf-bibliography-link:hover,.pdf-bibliography-link:focus-within{background:#2563eb14}.pdf-author-link{position:absolute;z-index:2;border-radius:3px}.pdf-author-link>a{position:absolute;top:-1px;right:-2px;bottom:-1px;left:-2px;display:block;border-radius:inherit}.pdf-author-link:hover,.pdf-author-link:focus-within{background:#2563eb1a}.pdf-author-card{display:flex;align-items:center;gap:12px;padding:14px;color:inherit;text-decoration:none}.pdf-author-card:hover .paper-preview-title{color:var(--accent)}.pdf-author-card:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}.pdf-author-card-avatar{width:44px;height:44px;flex:none}.pdf-author-card-meta{min-width:0}.pdf-author-card-meta .paper-preview-title{margin-bottom:2px}.paper-preview-card-link{display:block;color:inherit;text-decoration:none}.paper-preview-card-link:hover .paper-preview-title{color:var(--accent)}.paper-preview-card-link:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}.pdf-paper-preview-actions{display:flex;justify-content:space-between;gap:12px;padding:10px 14px;border-top:1px solid var(--hairline);font-size:12px}.pdf-paper-preview-actions a,.pdf-paper-preview-actions button{color:var(--accent)}.pdf-paper-preview-actions button{border:0;background:transparent;cursor:pointer;padding:0;font:inherit}.pdf-paper-preview-actions a:focus-visible,.pdf-paper-preview-actions button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.reader-web-document{max-width:760px;margin:0 auto;padding:32px 28px 64px;color:#1a1a1a;font-size:16px;line-height:1.65;overflow-wrap:anywhere}.reader-web-document h1{margin:0 0 20px;font-size:28px;line-height:1.25}.reader-web-document h2{margin:32px 0 12px;font-size:22px;line-height:1.3}.reader-web-document h3{margin:24px 0 8px;font-size:18px}.reader-web-document img{max-width:100%;height:auto}.reader-web-document pre{overflow-x:auto;padding:12px;border-radius:6px;background:#f4f4f5;font-size:13px}.reader-web-document table{display:block;max-width:100%;overflow-x:auto;border-collapse:collapse;font-size:14px}.reader-web-document th,.reader-web-document td{padding:6px 10px;border:1px solid #e4e4e7}.reader-web-document a{color:#1c68ef}.reader-web-document ::-moz-selection{background:#2d7dff4d}.reader-web-document ::selection{background:#2d7dff4d}@media (max-width: 640px){.reader-web-document{padding:20px 16px 48px;font-size:15px}}.saved-area-section{margin-top:28px}.saved-area-section:first-of-type{margin-top:4px}.saved-area-heading{font-family:var(--serif);font-size:22px;font-weight:500;color:var(--ink);margin:0 0 6px;padding-bottom:6px;border-bottom:1px solid var(--hairline-strong)}.saved-task-block{margin-top:16px}.saved-task-row{display:flex;align-items:center;gap:10px;margin-bottom:6px}.saved-task-count{font-size:12px;color:var(--ink-faint)}.saved-signin-panel{display:flex;justify-content:center;padding:80px 0}.saved-bucket-migration{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:24px;padding:14px 16px;border:1px solid var(--info-border);border-radius:6px;background:var(--info-bg);color:var(--info-text)}.saved-bucket-migration p{max-width:760px;font-size:13px;line-height:1.5}.saved-bucket-migration .hf-signin-btn{flex-shrink:0;max-width:100%;height:auto;min-height:36px;padding:8px 12px;white-space:normal;overflow-wrap:anywhere}@media (max-width: 700px){.saved-bucket-migration{align-items:flex-start;flex-direction:column}}.action-btn.is-saved{background:var(--ink);color:var(--bg);border-color:var(--ink)}.action-btn.is-saved:hover{background:color-mix(in oklch,var(--ink) 88%,var(--accent))}.ask-home-new{max-width:640px;margin:0 auto 6px;padding-left:9px;color:var(--ink-faint);font-size:14px;font-weight:700}.ask-home{position:relative;max-width:640px;margin:0 auto 36px;background:var(--bg-elevated);border:1px solid var(--hairline);border-radius:14px;box-shadow:0 1px 2px #1e1c140a,0 12px 34px -18px #1e1c1447;padding:8px}.ask-home-row{display:flex;align-items:flex-end;gap:8px}.ask-home-row>.chat-send{flex:none;margin:0 2px 2px 0}.ask-home-textarea-wrap{position:relative;flex:1;min-width:0}.ask-home textarea{position:relative;z-index:1;display:block;width:100%;border:0;outline:0;resize:none;background:transparent;font-family:var(--serif);font-size:17px;line-height:1.45;color:transparent;caret-color:var(--ink);padding:8px 12px}.ask-home textarea::-moz-placeholder{color:var(--ink-faint)}.ask-home textarea::placeholder{color:var(--ink-faint)}.feed-sidebar{display:flex;flex-direction:column;min-height:calc(100dvh - 250px)}.feed-sidebar>.sidebar-section-tools{margin-top:auto;margin-bottom:0}@media (max-width: 880px){.layout-with-sidebar>.sidebar,.layout-with-sidebar>.feed-main{display:contents}.feed-chat{order:1}.sidebar-section-top-domains{order:2}.sidebar-section-trending-domains{order:3}.sidebar-section-follows{order:2}.feed-content{order:4}.sidebar-section-tools{order:5}.feed-sidebar>.sidebar-section-tools{margin-top:0}.feed-content:has(>.following-intro){display:contents}.feed-content:has(>.following-intro)>*{order:4}.feed-content:has(>.following-intro)>.following-intro{order:0;margin:0}}.sidebar-tools-mcp{width:100%;justify-content:space-between;padding:10px 14px;font-size:15px;font-weight:600}.sidebar-tools-mcp:hover{border-color:var(--ink-faint)}.sidebar-tools-copy{font-size:12px;line-height:1.5;color:var(--ink-faint);margin:10px 0 0}.sidebar-tools-copy a{color:var(--ink-soft);text-decoration:underline;text-decoration-style:dotted}.sidebar-tools-copy code{font-family:var(--mono);font-size:11px}.submission-loading,.submission-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;min-height:240px;padding:32px;text-align:center;color:var(--ink-faint)}.submission-loading{min-height:160px;flex-direction:row;font-family:var(--mono);font-size:12px}.submission-empty h1,.submission-empty h2{font-family:var(--serif);font-weight:500;color:var(--ink)}.submission-empty p{max-width:460px;color:var(--ink-soft)}.submission-empty a{color:var(--accent-text);text-decoration:underline}.submission-empty-warn{border:1px solid var(--hairline);border-radius:8px;background:var(--bg-elevated)}.chat-page{position:relative;display:flex;overflow:hidden;background:var(--bg)}.chat-main{flex:1;display:flex;flex-direction:column;min-width:0;background:var(--bg)}.chat-topbar{display:flex;align-items:center;gap:14px;padding:10px 24px;border-bottom:1px solid var(--hairline)}.chat-topbar .icon-btn{flex:none;border-color:transparent;background:transparent;color:var(--ink-soft);transition:background .15s,color .15s}.chat-topbar .icon-btn:hover,.chat-topbar .icon-btn[data-state=open]{background:var(--bg-subtle);color:var(--ink)}.chat-topbar-title{flex:1;min-width:0;font-family:var(--serif);font-size:15px;font-weight:500;letter-spacing:-.005em;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-empty{flex:1;display:flex;align-items:flex-start;justify-content:center;padding:40px 24px;overflow-y:auto}.chat-empty-inner{max-width:680px;width:100%;margin-block:auto;text-align:center}.chat-empty-eyebrow{font-family:var(--mono);font-size:11px;letter-spacing:.16em;text-transform:uppercase;color:var(--ink-faint);margin-bottom:18px}.chat-empty-title{font-family:var(--serif);font-weight:500;font-size:44px;line-height:1.05;letter-spacing:-.02em;margin-bottom:14px}.chat-empty-title em{font-style:italic;font-weight:400;color:var(--accent)}.chat-empty-sub{font-family:var(--serif);font-size:16px;line-height:1.5;color:var(--ink-soft);max-width:520px;margin:0 auto 26px;text-wrap:pretty}.chat-staging-access-note{max-width:560px;margin:-12px auto 18px;color:var(--ink-soft);font-size:13px;line-height:1.45}.chat-staging-badge{flex:none;border:1px solid color-mix(in oklch,var(--accent) 36%,var(--hairline));border-radius:999px;padding:3px 7px;color:var(--accent-text);background:color-mix(in oklch,var(--accent) 7%,var(--bg-elevated));font-family:var(--mono);font-size:10px;font-weight:700;letter-spacing:.08em;line-height:1;text-transform:uppercase}.chat-examples{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;margin-top:24px}.chat-example{font-family:var(--serif);font-size:14px;color:var(--ink-soft);background:var(--bg-elevated);border:1px solid var(--hairline);border-radius:999px;padding:8px 16px;transition:border-color .15s,color .15s}.chat-example:hover{border-color:var(--hairline-strong);color:var(--ink)}.chat-paper-inline-highlight{color:var(--accent-text);text-decoration-line:underline;text-decoration-color:color-mix(in oklch,var(--accent) 40%,transparent);text-decoration-thickness:1px;text-underline-offset:2px}.chat-paper-inline-highlight.is-unavailable{color:var(--negative-text);text-decoration-color:var(--negative-border)}@media (max-width: 900px){.chat-empty-title{font-size:34px}}@media (forced-colors: active){.chat-paper-inline-highlight{outline:1px solid CanvasText}}@media (max-width: 560px){.chat-topbar{padding-inline:14px}}.chat-credits-notice{position:relative;display:flex;align-items:center;justify-content:center;min-height:28px;padding:5px 52px 6px;border-bottom:1px solid var(--hairline);background:var(--bg-subtle);color:var(--ink-soft);font-size:12px;line-height:16px;text-align:center}.chat-credits-notice-close{position:absolute;top:50%;right:20px;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:0;border-radius:4px;background:transparent;color:var(--ink-soft);font-size:16px;line-height:1;cursor:pointer;transform:translateY(-50%)}.chat-credits-notice-close:hover{background:var(--hairline);color:var(--ink)}.chat-credits-notice-close:focus-visible{outline:2px solid var(--accent-text);outline-offset:1px}.chat-sidebar{position:relative;width:var(--chat-sidebar-width, var(--app-leading-column-width));flex:none;background:var(--bg-subtle);border-right:1px solid var(--hairline);display:flex;flex-direction:column;transition:margin-left .2s ease}.chat-sidebar-backdrop{display:none}.chat-sidebar-resize-handle{position:absolute;top:0;right:-4px;bottom:0;z-index:2;width:8px;cursor:col-resize;touch-action:none}.chat-sidebar-resize-handle:after{content:"";position:absolute;top:0;right:3px;bottom:0;left:3px;background:var(--hairline-strong);opacity:0;transition:opacity .15s}.chat-sidebar-resize-handle:hover:after,.chat-sidebar-resize-handle:focus-visible:after{opacity:1}.chat-sidebar-resize-handle:focus-visible{outline:2px solid var(--link);outline-offset:-3px}.chat-sidebar-closed{margin-left:calc(-1 * (var(--chat-sidebar-width, var(--app-leading-column-width)) + 1px))}.chat-sidebar-top{display:flex;align-items:center;gap:8px;padding:14px 12px 8px}.chat-sidebar-top .icon-btn{flex:none}.chat-new-chat{flex:1;display:flex;align-items:center;justify-content:center;gap:8px;padding:9px;background:var(--bg-elevated);border:1px solid var(--hairline);border-radius:8px;font-size:13px;font-weight:500;color:var(--ink);transition:border-color .15s}.chat-new-chat:hover{border-color:var(--hairline-strong)}.chat-sessions{flex:1;overflow-y:auto;padding:4px 8px 20px}.chat-sessions-empty{padding:18px 10px;font-family:var(--serif);font-style:italic;font-size:13px;color:var(--ink-faint)}.chat-session-group{margin-top:14px}.chat-sessions-toggle{margin-top:6px;padding:7px 10px;border-radius:7px;font-family:var(--mono);font-size:11px;color:var(--ink-faint)}.chat-sessions-toggle:hover{background:var(--hairline);color:var(--ink)}.chat-sidebar-tools{flex:none;margin:0;padding:14px 16px 16px;border-top:1px solid var(--hairline)}.chat-session-group-label{font-family:var(--mono);font-size:10px;letter-spacing:.12em;text-transform:uppercase;color:var(--ink-faint);padding:6px 10px}.chat-session{display:flex;align-items:center;gap:6px;width:100%;text-align:left;padding:7px 10px;border-radius:7px;font-size:13px;color:var(--ink-soft);transition:background .12s,color .12s}.chat-session:hover{background:var(--hairline);color:var(--ink)}.chat-session-active{background:var(--hairline);color:var(--ink);font-weight:500}.chat-session-title{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-session-delete{display:inline-flex;align-items:center;color:var(--ink-faint);padding:2px;border-radius:4px;flex:none}.chat-session-delete:hover{color:var(--negative-text)}.chat-session-menu{display:inline-flex;border:0;background:transparent;color:inherit;cursor:pointer;padding:0 3px;font-size:17px;line-height:1}@media (hover: hover) and (pointer: fine){.chat-session-delete,.chat-session-menu{display:none}.chat-session:hover .chat-session-delete,.chat-session:hover .chat-session-menu,.chat-session:focus-within .chat-session-delete,.chat-session:focus-within .chat-session-menu{display:inline-flex}}.chat-session-title-input{min-width:0;flex:1;border:1px solid var(--border);border-radius:4px;background:var(--surface);color:var(--ink);font:inherit;padding:2px 4px}.chat-session-context-menu{position:fixed;z-index:1000;width:150px;padding:4px;border:1px solid var(--border);border-radius:7px;background:var(--surface);box-shadow:0 8px 24px #00000029}.chat-session-context-menu button{width:100%;border:0;border-radius:4px;background:transparent;color:var(--ink);padding:7px 9px;text-align:left;cursor:pointer}.chat-session-context-menu button:hover,.chat-session-context-menu button:focus{background:var(--hairline)}.chat-session-loading,.chat-session-load-error{flex:1;display:flex;align-items:center;justify-content:center;gap:10px;color:var(--ink-soft);font-family:var(--serif);font-size:14px}.chat-session-load-error{flex-direction:column}.chat-session-load-error p{margin:0}.chat-session-load-error button{border:1px solid var(--border);border-radius:5px;padding:7px 12px;background:var(--surface);color:var(--ink);cursor:pointer}.chat-session-load-error button:hover{background:var(--bg-subtle)}@media (max-width: 900px){.chat-sidebar{position:absolute;top:0;bottom:0;left:0;z-index:60;box-shadow:0 0 40px #0003;width:var(--app-leading-column-width)}.chat-sidebar-backdrop{display:block;position:absolute;top:0;right:0;bottom:0;left:0;z-index:59}.chat-sidebar-resize-handle{display:none}.chat-sidebar-closed{margin-left:0;transform:translate(-101%);box-shadow:none}}.chat-share-button{flex:none;display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 12px 0 10px;border:1px solid var(--hairline);border-radius:8px;background:var(--bg-elevated);color:var(--ink);font-size:13px;font-weight:500;transition:border-color .15s,box-shadow .15s}.chat-share-button:hover:not(:disabled){border-color:var(--hairline-strong);box-shadow:0 1px 2px #1a18140f}.chat-share-button:disabled{cursor:not-allowed;opacity:.55}.chat-share-button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.chat-share-button svg{width:14px;height:14px;color:var(--ink-soft)}.chat-share-toast{position:fixed;top:18px;left:50%;width:min(420px,calc(100vw - 32px));transform:translate(-50%)}.chat-share-dialog-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:110;display:grid;place-items:center;padding:20px;background:#0000006b}.chat-share-dialog{width:min(520px,100%);padding:22px;border:1px solid var(--hairline-strong);border-radius:12px;background:var(--bg-elevated);box-shadow:0 18px 60px #00000038}.chat-share-dialog h2{margin:0 0 8px;font-family:var(--serif);font-size:21px}.chat-share-dialog p{margin:0 0 14px;color:var(--ink-soft)}.chat-share-dialog input{width:100%;padding:9px 10px;border:1px solid var(--hairline-strong);border-radius:7px;background:var(--bg);color:var(--ink);font-family:var(--mono);font-size:12px}.chat-share-dialog input:focus{outline:2px solid var(--accent);outline-offset:2px}.chat-share-dialog button{display:block;margin:16px 0 0 auto;padding:7px 14px;border-radius:7px;background:var(--accent);color:#fff;font-weight:600}@media (max-width: 560px){.chat-share-button{width:34px;padding:6px;justify-content:center}.chat-share-button span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}}.chat-capacity-dialog-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:120;display:grid;place-items:center;padding:20px;background:#0000007a}.chat-capacity-dialog{width:min(500px,100%);padding:24px;border:1px solid var(--hairline-strong);border-radius:12px;background:var(--bg-elevated);box-shadow:0 18px 60px #0000003d}.chat-capacity-dialog h2{margin:0 0 9px;font-family:var(--serif);font-size:22px}.chat-capacity-dialog p{margin:0;color:var(--ink-soft);line-height:1.5}.chat-capacity-countdown{min-height:24px;padding-top:12px;font-size:13px}.chat-capacity-dialog-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:20px}.chat-capacity-dialog-actions button{padding:8px 14px;border-radius:7px;font-weight:600}.chat-capacity-cancel{border:1px solid var(--hairline-strong);background:var(--bg);color:var(--ink)}.chat-capacity-retry{background:var(--accent);color:#fff}.chat-capacity-retry:disabled{cursor:not-allowed;opacity:.5}.chat-capacity-dialog-actions button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.chat-paused-banner{margin-bottom:.75rem;border:1px solid var(--border);border-radius:.65rem;background:var(--muted);padding:.7rem .85rem;color:var(--muted-foreground);font-size:.875rem;line-height:1.4}.chat-composer-error{margin-bottom:.75rem;border:1px solid color-mix(in oklch,#c33 35%,var(--hairline));border-radius:.65rem;background:color-mix(in oklch,#c33 8%,var(--bg-elevated));padding:.7rem .85rem;color:var(--ink);font-size:.875rem;line-height:1.4}.chat-billing-notice{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;margin:0 0 10px;padding:9px 11px;border:1px solid color-mix(in oklch,var(--accent) 24%,var(--hairline));border-radius:9px;color:var(--ink-soft);background:color-mix(in oklch,var(--accent) 5%,var(--bg-elevated));font-size:12px;line-height:1.4}.chat-billing-notice a{flex:none;color:var(--accent-text);font-weight:600;text-decoration:none}.chat-billing-notice a:hover{text-decoration:underline}.chat-billing-notice-actions{display:flex;align-items:center;gap:10px;flex:none}.chat-billing-notice-dismiss{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;padding:0;border:0;border-radius:6px;color:var(--ink-soft);background:transparent;cursor:pointer}.chat-billing-notice-dismiss:hover{color:var(--ink);background:color-mix(in oklch,var(--ink) 7%,transparent)}.chat-billing-notice-dismiss:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.ask-home>.chat-paper-picker{top:calc(100% + 6px);bottom:auto}.chat-empty .chat-composer{text-align:left}.chat-composer-wrap{border-top:1px solid var(--hairline);background:var(--bg);padding:14px 28px 16px}.chat-composer-inner{max-width:820px;margin:0 auto}.chat-composer{position:relative;background:var(--bg-elevated);border:1px solid var(--hairline);border-radius:14px;box-shadow:0 1px 2px #1e1c140a,0 10px 30px -20px #1e1c144d;padding:6px}.chat-composer-textarea-wrap{position:relative}.chat-paper-highlight-layer{position:absolute;z-index:0;top:0;right:0;bottom:0;left:0;box-sizing:border-box;overflow:hidden;pointer-events:none;color:transparent}.chat-paper-highlight-layer>div{min-height:100%;white-space:pre-wrap;overflow-wrap:break-word;word-break:break-word;color:var(--ink)}.chat-paper-highlight-layer-composer{padding:12px 12px 4px;font-family:var(--serif);font-size:16px;line-height:1.45}.chat-paper-highlight-layer-editor{padding:9px 11px;font-family:var(--serif);font-size:16px;line-height:1.45}.chat-paper-highlight-layer-home{padding:8px 12px;font-family:var(--serif);font-size:17px;line-height:1.45}.chat-prompt-completion{color:var(--ink-faint)}.chat-paper-picker{position:absolute;z-index:50;left:8px;bottom:calc(100% + 6px);width:min(560px,calc(100vw - 48px));max-height:384px;overflow-y:auto;border:1px solid var(--hairline-strong);border-radius:11px;background:var(--bg-elevated);box-shadow:0 16px 38px -16px #1e1c1473}.chat-slash-command{position:absolute;z-index:50;left:8px;bottom:calc(100% + 6px);display:flex;width:min(560px,calc(100vw - 48px));min-height:52px;align-items:center;gap:10px;padding:9px 12px;border:1px solid var(--hairline-strong);border-radius:11px;color:var(--ink);background:var(--bg-elevated);box-shadow:0 16px 38px -16px #1e1c1473;text-align:left}.chat-slash-command:hover{background:var(--accent-soft)}.chat-slash-command span{color:var(--ink-faint);font-size:12px}.chat-paper-picker-status{padding:10px 12px;color:var(--ink-faint);font-size:12px}.chat-paper-option{display:flex;width:100%;min-height:64px;flex-direction:column;justify-content:center;gap:3px;padding:9px 12px;border:0;border-top:1px solid var(--hairline);color:var(--ink);background:transparent;text-align:left}.chat-paper-option.is-active,.chat-paper-option:hover{background:var(--accent-soft)}.chat-paper-option-title{font-family:var(--serif);font-size:14px;line-height:1.25}.chat-paper-option-meta{color:var(--ink-faint);font-family:var(--mono);font-size:10.5px}.chat-paper-mention-message{padding:3px 12px;color:var(--negative-text);font-size:11.5px}.chat-inline-paper-mention{display:inline}.chat-inline-paper-mention svg{display:inline-block;margin-right:3px;color:var(--accent-text);vertical-align:-.12em}.chat-inline-paper-link{color:var(--accent-text);font-weight:600;text-decoration-line:underline;text-decoration-color:color-mix(in oklch,var(--accent) 40%,transparent);text-decoration-thickness:1px;text-underline-offset:2px}.chat-inline-paper-link:hover{text-decoration-color:var(--accent-text)}.chat-user-link{cursor:pointer;color:var(--accent-text);text-decoration-line:underline;text-decoration-color:color-mix(in oklch,var(--accent) 40%,transparent);text-decoration-thickness:1px;text-underline-offset:2px}.chat-user-link:hover{text-decoration-color:var(--accent-text)}.chat-composer textarea{position:relative;z-index:1;width:100%;border:0;outline:0;resize:none;background:transparent;font-family:var(--serif);font-size:16px;line-height:1.45;color:transparent;caret-color:var(--ink);padding:12px 12px 4px}.chat-composer textarea::-moz-placeholder{color:var(--ink-faint)}.chat-composer textarea::placeholder{color:var(--ink-faint)}.chat-composer-row{display:flex;align-items:center;justify-content:space-between;padding:2px 6px 4px}.chat-composer-tools{display:flex;align-items:center;flex-wrap:wrap;gap:12px}.chat-composer-hint{font-size:11.5px;color:var(--ink-faint)}.chat-composer-foot{display:flex;align-items:center;justify-content:center;gap:6px;text-align:center;font-size:11.5px;color:var(--ink-faint);margin-top:9px}.chat-provider-attribution{white-space:nowrap}.chat-send{display:flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:10px;background:var(--hairline);color:var(--bg-elevated);cursor:not-allowed;transition:background .15s;flex:none}.chat-send-on{background:var(--ink);cursor:pointer}.chat-send-on:hover{background:color-mix(in oklch,var(--ink) 88%,var(--accent))}@media (max-width: 900px){.chat-composer-wrap{padding:12px 16px 14px}.chat-composer-foot,.chat-composer-hint{display:none}}@media (prefers-reduced-motion: reduce){.chat-paper-option{scroll-behavior:auto}}@media (forced-colors: active){.chat-paper-option.is-active,.chat-inline-paper-link{outline:1px solid CanvasText}.chat-paper-selection,.chat-paper-selection-remove,.chat-paper-selection-toggle{border:1px solid ButtonText}}.chat-paper-selection{margin:6px 6px 0;padding:8px 10px;border:1px solid var(--hairline);border-radius:10px;background:var(--bg-subtle);text-align:left}.chat-paper-selection-header{display:flex;align-items:center;justify-content:space-between;gap:8px}.chat-paper-selection-label{color:var(--ink-soft);font-size:11px;font-weight:600;letter-spacing:.02em;text-transform:uppercase}.chat-paper-selection-actions{display:flex;align-items:center;gap:6px}.chat-paper-selection-toggle,.chat-paper-selection-remove{border:0;padding:2px 6px;background:transparent;color:var(--accent-text);font-size:11.5px}.chat-paper-selection-quote{display:-webkit-box;max-height:4.35em;margin:6px 0 0;overflow:hidden;color:var(--ink);font-family:var(--serif);font-size:13px;line-height:1.45;white-space:pre-wrap;-webkit-box-orient:vertical;-webkit-line-clamp:3}.chat-paper-selection-quote.is-expanded{display:block;max-height:8.5em;overflow:auto;-webkit-line-clamp:unset}.chat-paper-selection-disabled{padding:4px 12px 0;color:var(--negative-text);font-size:11.5px}.chat-paper-link{color:var(--accent-text);border-bottom:1px solid color-mix(in oklch,var(--accent-text) 35%,transparent);white-space:normal}.chat-paper-link:hover{border-bottom-color:var(--accent-text)}.chat-hf-link:after{content:" 🤗";font-size:.85em;white-space:nowrap}.chat-github-link{color:var(--accent-text);border-bottom:1px solid color-mix(in oklch,var(--accent-text) 35%,transparent)}.chat-github-link:hover{border-bottom-color:var(--accent-text)}.chat-github-link svg{display:inline-block;width:1em;height:1em;margin-right:.3em;vertical-align:-.14em}.chat-external-link{color:var(--accent-text);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}.chat-external-link:hover{text-decoration-thickness:2px}.chat-web-citation{color:var(--accent-text);text-decoration:underline;text-decoration-style:dotted;text-underline-offset:2px}.chat-external-paper-citation{color:var(--chat-link);text-decoration:underline;text-decoration-color:color-mix(in srgb,var(--chat-link) 35%,transparent);text-underline-offset:2px}.external-paper-preview-pop.external-paper-preview-pop{width:min(390px,calc(100vw - 24px));padding:0;overflow:hidden;border-color:var(--chat-border);background:var(--chat-surface);color:var(--chat-text)}.external-paper-preview-card{padding:14px}.external-paper-preview-source{display:flex;gap:6px;margin-bottom:7px;color:var(--chat-muted);font-size:12px}.external-paper-preview-card strong{display:block;color:var(--chat-text);font-size:14px;line-height:1.35}.external-paper-preview-card p{margin:7px 0 0;color:var(--chat-muted);font-size:12px;line-height:1.45;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4;overflow:hidden}.external-paper-preview-authors{-webkit-line-clamp:2!important}.external-paper-preview-citations{display:block;margin-top:9px;color:var(--chat-muted);font-size:11px}.web-preview-pop.web-preview-pop{width:min(360px,calc(100vw - 24px));padding:0;overflow:hidden;border:1px solid var(--hairline);border-radius:12px;background:var(--bg-elevated);color:var(--ink);box-shadow:0 14px 44px -12px #1e1c1466}.web-preview-card{display:flex;flex-direction:column}.web-preview-image{display:block;width:100%;height:174px;-o-object-fit:cover;object-fit:cover;background:var(--bg-subtle);border-bottom:1px solid var(--hairline)}.web-preview-meta{padding:13px 14px 14px;min-width:0}.web-preview-source{display:flex;align-items:center;gap:5px;margin-bottom:6px;color:var(--ink-faint);font-size:11px}.web-preview-source img{width:14px;height:14px;border-radius:3px}.web-preview-meta strong{display:block;font-family:var(--serif);font-size:15px;font-weight:500;line-height:1.3}.web-preview-meta p{display:-webkit-box;overflow:hidden;margin:7px 0 0;color:var(--ink-soft);font-size:12px;line-height:1.4;-webkit-box-orient:vertical;-webkit-line-clamp:3}.paper-preview-pop.paper-preview-pop{width:min(344px,calc(100vw - 24px));padding:0;border:1px solid var(--hairline);border-radius:12px;background:var(--bg-elevated);color:var(--ink);box-shadow:0 14px 44px -12px #1e1c1466;overflow:hidden}.paper-preview-inner{display:flex;gap:14px;padding:14px}.paper-preview-meta{min-width:0;flex:1}.paper-preview-title{font-family:var(--serif);font-weight:500;font-size:15px;line-height:1.25;margin-bottom:5px}.paper-preview-auth{font-size:12px;color:var(--ink-soft);line-height:1.35}.paper-preview-venue{font-size:11.5px;color:var(--ink-faint);margin-top:3px;font-variant-numeric:tabular-nums}.paper-preview-tags{display:flex;flex-wrap:wrap;gap:5px;margin:9px 0}.paper-preview-tag{font-size:10.5px;font-family:var(--mono);background:var(--positive-bg);color:var(--positive-text);border-radius:5px;padding:2px 7px}.paper-preview-status{min-height:48px;padding:14px;display:flex;align-items:center;color:var(--ink-soft);font-size:12px}.paper-preview-index-request{flex-wrap:wrap;gap:6px 12px}.paper-preview-index-request a,.paper-preview-index-request button{color:var(--accent);font:inherit;border:0;background:transparent;padding:0;cursor:pointer}.paper-preview-index-request button:disabled{color:var(--ink-soft);cursor:default}.paper-preview-index-request a:focus-visible,.paper-preview-index-request button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.paper-preview-index-request [role=alert]{flex-basis:100%;color:var(--negative-text, var(--ink-soft))}.paper-preview-thumb{position:relative;width:96px;height:124px;flex:none;background:var(--bg-elevated);border:1px solid var(--hairline);border-radius:3px;box-shadow:0 1px 3px #1e1c1414;overflow:hidden;padding:11px 10px}.paper-preview-thumb-real{padding:0}.paper-preview-thumb-real img{display:block;width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.paper-preview-thumb-title{display:flex;flex-direction:column;align-items:center;gap:3px;margin-bottom:8px}.paper-preview-thumb-title span{height:3px;background:var(--ink);border-radius:2px}.paper-preview-thumb-title span:first-child{width:70%}.paper-preview-thumb-title span:last-child{width:52%}.paper-preview-thumb-auth{height:2px;width:40%;margin:0 auto 9px;background:var(--ink-faint);border-radius:2px}.paper-preview-thumb-cols{display:flex;gap:7px}.paper-preview-thumb-col{flex:1;height:74px;background:repeating-linear-gradient(var(--hairline-strong) 0 2px,transparent 2px 5px);opacity:.7}.paper-preview-thumb-fig{position:absolute;left:14px;right:14px;height:22px;background:var(--bg-subtle);border:1px solid var(--hairline);border-radius:2px}.hf-preview-pop.hf-preview-pop{width:min(172px,calc(100vw - 24px));padding:0;border:1px solid var(--hairline);border-radius:12px;background:var(--bg-elevated);color:var(--ink);box-shadow:0 14px 44px -12px #1e1c1466;overflow:hidden}.hf-preview-card{display:grid}.hf-preview-image,.hf-preview-fallback{display:block;width:100%;aspect-ratio:2 / 1;-o-object-fit:cover;object-fit:cover;background:var(--bg-subtle)}.hf-preview-fallback{display:grid;place-items:center;font-size:48px;background:radial-gradient(circle at 70% 35%,rgba(84,104,255,.4),transparent 45%),linear-gradient(135deg,#0f6d79,#d18a48)}.hf-preview-meta{display:grid;gap:3px;padding:12px 14px 14px}.hf-preview-meta strong{overflow-wrap:anywhere;font-size:14px}.hf-preview-kind,.hf-preview-meta>span:last-child{color:var(--ink-faint);font-size:11.5px}.github-preview-pop.github-preview-pop{width:min(344px,calc(100vw - 24px));padding:0;border:1px solid var(--hairline);border-radius:12px;background:var(--bg-elevated);color:var(--ink);box-shadow:0 14px 44px -12px #1e1c1466;overflow:hidden}.github-preview-card{display:flex;gap:14px;padding:14px}.github-preview-image,.github-preview-fallback{display:block;width:72px;height:72px;flex:none;-o-object-fit:cover;object-fit:cover;border-radius:12px;background:var(--bg-subtle)}.github-preview-fallback{display:grid;place-items:center;color:#fff;background:linear-gradient(135deg,#24292f,#57606a)}.github-preview-fallback svg{width:36px;height:36px}.github-preview-meta{display:grid;gap:3px;min-width:0}.github-preview-meta strong{overflow-wrap:anywhere;font-size:14px}.github-preview-kind,.github-preview-meta>span:last-child{color:var(--ink-faint);font-size:11.5px}.github-preview-description{display:-webkit-box;overflow:hidden;color:var(--ink-soft);font-size:12px;line-height:1.35;-webkit-box-orient:vertical;-webkit-line-clamp:2}.github-preview-stats{font-variant-numeric:tabular-nums}.catalog-preview-pop.catalog-preview-pop{width:min(320px,calc(100vw - 24px));padding:0;border:1px solid var(--hairline);border-radius:12px;background:var(--bg-elevated);color:var(--ink);box-shadow:0 14px 44px -12px #1e1c1466;overflow:hidden}.catalog-preview-card{display:grid}.catalog-preview-image{display:block;width:100%;aspect-ratio:2 / 1;-o-object-fit:cover;object-fit:cover;background:var(--bg-subtle);border-bottom:1px solid var(--hairline)}.catalog-preview-meta{display:grid;gap:3px;padding:12px 14px 14px}.catalog-preview-meta strong{font-family:var(--serif);font-weight:500;font-size:15px;line-height:1.25}.catalog-preview-meta p{display:-webkit-box;overflow:hidden;margin:3px 0 0;color:var(--ink-soft);font-size:12px;line-height:1.4;-webkit-box-orient:vertical;-webkit-line-clamp:3}.catalog-preview-kind,.catalog-preview-stats{color:var(--ink-faint);font-size:11.5px;font-variant-numeric:tabular-nums}.catalog-preview-stats{margin-top:4px}.chat-pdf-citation{position:relative;display:inline-flex;align-items:center;gap:4px;margin:0 1px;padding:1px 8px;border:1px solid color-mix(in oklch,var(--accent-text) 30%,transparent);border-radius:999px;background:color-mix(in oklch,var(--accent-text) 7%,transparent);color:var(--accent-text);font:inherit;font-size:.86em;line-height:1.5;vertical-align:baseline;cursor:pointer}.chat-pdf-citation:hover,.chat-pdf-citation:focus-visible{border-color:var(--accent-text)}.chat-pdf-citation>svg{width:.95em;height:.95em;flex:none}.chat-pdf-citation-preview{position:absolute;bottom:calc(100% + 6px);left:0;z-index:20;display:none;width:min(320px,70vw);padding:8px 10px;border:1px solid var(--hairline);border-radius:8px;background:var(--bg-elevated);color:var(--ink);box-shadow:0 14px 44px -12px #1e1c1466;font-size:.92em;line-height:1.45;text-align:left;white-space:normal}.chat-pdf-citation-preview.is-below{top:calc(100% + 6px);bottom:auto}.chat-pdf-citation-preview strong{display:block;margin-bottom:2px;color:var(--ink-faint);font-weight:600}.chat-pdf-citation:hover .chat-pdf-citation-preview,.chat-pdf-citation:focus-visible .chat-pdf-citation-preview{display:block}.chat-pdf-sources{margin-top:10px;color:var(--ink-faint);font-size:.88em}.chat-pdf-sources summary{cursor:pointer;width:-moz-fit-content;width:fit-content}.chat-pdf-sources ol{margin:6px 0 0;padding-left:1.4em}.chat-pdf-sources li{margin:3px 0}.chat-pdf-sources button{display:flex;gap:8px;width:100%;padding:0;border:0;background:none;color:var(--ink);font:inherit;text-align:left;cursor:pointer}.chat-pdf-sources button:hover>span:last-child{text-decoration:underline}.chat-pdf-sources-page{flex:none;color:var(--accent-text);font-variant-numeric:tabular-nums}.chat-artifact-card{width:min(100%,620px);display:flex;gap:14px;align-items:stretch;padding:0;overflow:hidden;text-align:left;color:var(--chat-text, #182230);background:#fff;border:1px solid #d8dee8;border-radius:14px;box-shadow:0 5px 18px #0f172a12}button.chat-artifact-card{cursor:pointer}.chat-artifact-card.is-selected{border-color:var(--accent);box-shadow:0 0 0 2px color-mix(in oklch,var(--accent) 22%,transparent)}.chat-artifact-card>img{width:190px;aspect-ratio:5 / 3;-o-object-fit:cover;object-fit:cover;background:#eef1f5}.chat-artifact-card-copy{display:flex;min-width:0;flex:1;flex-direction:column;justify-content:center;gap:7px;padding:14px 14px 14px 0}.chat-artifact-card-copy strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-artifact-kicker{display:flex;align-items:center;gap:6px;color:#637083;font-size:12px}.chat-artifact-kicker svg{width:14px;height:14px}.chat-artifact-gate{width:-moz-fit-content;width:fit-content;padding:3px 8px;border-radius:999px;color:#11643b;background:#e7f7ee;font-size:11px;font-weight:650}.chat-artifact-gate-warnings{color:#7a4a00;background:#fff3d6}.chat-artifact-gate-failed{color:#9b2c2c;background:#fee9e7}.chat-artifact-generating,.chat-artifact-error{align-items:center;padding:16px}.chat-artifact-generating span:not(.chat-artifact-pulse),.chat-artifact-error span{display:flex;flex-direction:column;gap:3px}.chat-artifact-generating small,.chat-artifact-error small{color:#687386}.chat-artifact-error{border-color:#efb7b1}.chat-artifact-error>svg{width:24px;color:#b3372d}.chat-artifact-pulse{width:22px;height:22px;border:3px solid #d7dde8;border-top-color:#5367d9;border-radius:50%;animation:chat-artifact-spin .8s linear infinite}@keyframes chat-artifact-spin{to{transform:rotate(360deg)}}.chat-artifact-workspace{position:relative;min-width:0;min-height:0;flex:1;display:flex;overflow:hidden}.chat-artifact-workspace-content{min-width:0;min-height:0;flex:1;display:flex;overflow:hidden}.chat-artifact-workspace-chat>.chat-artifact-workspace-content>.chat-main{width:100%}.chat-artifact-workspace-shared{min-height:0}.chat-artifact-workspace-shared>.chat-artifact-workspace-content{overflow:auto}.chat-artifact-workspace-reader{height:100%}.chat-artifact-workspace-reader>.chat-artifact-workspace-content>.reader-workspace{width:100%}.chat-artifact-workspace-pane{min-width:0;min-height:0;flex:none;display:flex;overflow:hidden}.chat-artifact-resize-handle{position:relative;z-index:7;width:1px;flex:0 0 1px;cursor:col-resize;background:var(--hairline-strong);touch-action:none;outline:none}.chat-artifact-resize-handle:before{content:"";position:absolute;top:0;right:-8px;bottom:0;left:-8px}.chat-artifact-resize-handle:focus-visible{box-shadow:0 0 0 2px var(--accent)}.chat-artifact-panel{width:100%;height:100%;min-width:0;min-height:0;display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;overflow:hidden;color:var(--ink);background:#f6f7f9;border-left:1px solid var(--hairline)}.chat-artifact-panel.is-dialog{position:fixed;z-index:1200;top:0;right:0;bottom:0;left:0;border:0}.chat-artifact-panel.is-reader-fallback{position:absolute}.chat-artifact-panel header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;background:#fff;border-bottom:1px solid #dce1e8}.chat-artifact-panel header span{color:#6d7788;font-size:12px;text-transform:uppercase;letter-spacing:.06em}.chat-artifact-panel h2{margin:2px 0 0;font-size:18px}.chat-artifact-panel header button{display:grid;place-items:center;width:36px;height:36px;border:0;border-radius:8px;background:transparent;cursor:pointer}.chat-paper-status{margin:4px 0 0;color:#687386;font-size:12px}.chat-artifact-header-actions{display:flex;align-items:center;gap:6px}.chat-artifact-header-actions>button:first-child{width:auto;min-height:36px;padding:7px 10px;border:1px solid #cfd6e4;color:#253143;background:#fff;font-size:12px}.chat-artifact-version{display:flex;align-items:center;gap:7px;margin-left:auto;margin-right:8px;color:#687386;font-size:12px}.chat-artifact-version select{padding:6px 8px;border:1px solid #cfd6e4;border-radius:7px;background:#fff}.chat-artifact-panel>nav{position:sticky;z-index:1;top:0;display:flex;gap:4px;padding:8px 18px 0;background:#fff}.chat-artifact-panel nav button{padding:9px 14px;border:0;border-bottom:2px solid transparent;color:#667085;background:transparent;cursor:pointer}.chat-artifact-panel nav button.active{color:#273a91;border-bottom-color:#5367d9;font-weight:650}.chat-artifact-panel button:focus-visible,.chat-artifact-panel a:focus-visible,.chat-artifact-panel input:focus-visible,.latex-source-editor .cm-content:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.chat-artifact-panel-body{min-height:0;display:grid;place-items:center;overflow:auto;padding:20px}.chat-artifact-panel-body>.pdf-viewer{align-self:stretch;justify-self:stretch;width:100%;height:100%}.chat-artifact-panel-body>img{max-width:100%;max-height:100%;-o-object-fit:contain;object-fit:contain;background:#fff;box-shadow:0 4px 22px #0f172a1f}.chat-artifact-panel-body>pre{align-self:stretch;justify-self:stretch;overflow:auto;margin:0;padding:18px;color:#d8dee9;background:#18202c;border-radius:10px;font-size:12px;white-space:pre-wrap}.chat-artifact-source-workspace{width:100%;height:100%;min-height:0;display:flex;overflow:hidden;border-radius:10px;background:#18202c}.chat-artifact-source-workspace>nav{width:min(180px,28%);flex:none;display:flex;flex-direction:column;overflow:auto;padding:10px;border-right:1px solid #ffffff24}.chat-artifact-source-workspace>nav button{overflow:hidden;border:0;padding:7px 8px;color:#aeb8c8;background:transparent;text-align:left;text-overflow:ellipsis;white-space:nowrap}.chat-artifact-source-workspace>nav button[aria-pressed=true]{color:#fff;background:#ffffff14}.chat-artifact-source-workspace>pre{min-width:0;flex:1;overflow:auto;margin:0;padding:18px;color:#d8dee9;font-size:12px;white-space:pre-wrap}.latex-editor-column{min-width:0;flex:1;display:flex;flex-direction:column;color:#d8dee9}.latex-source-editor{min-width:0;min-height:0;flex:1;overflow:auto}.latex-source-editor .cm-editor{height:100%;min-height:320px;font-size:13px}.latex-source-editor .cm-scroller{overflow:auto;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.latex-file-action{display:flex;align-items:center;gap:6px;margin-top:8px}.latex-file-action svg,.latex-file-buttons svg{width:14px;height:14px}.latex-file-buttons{display:flex;gap:8px;padding:8px;border-top:1px solid #ffffff24}.latex-file-buttons button,.chat-artifact-actions button{display:inline-flex;align-items:center;gap:7px;border:0;border-radius:7px;padding:8px 10px;cursor:pointer}.chat-artifact-actions button:disabled{cursor:not-allowed;opacity:.55}.chat-artifact-panel footer{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;padding:14px 20px;background:#fff;border-top:1px solid #dce1e8}.chat-artifact-metadata{display:flex;min-width:0;flex-direction:column;gap:3px;color:#687386;font-size:12px}.chat-artifact-metadata strong{color:#253143}.chat-artifact-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px}.chat-artifact-actions a{display:inline-flex;align-items:center;gap:5px;padding:8px 10px;color:#263b94;border:1px solid #cfd6e4;border-radius:8px;text-decoration:none;font-size:12px;font-weight:600}.chat-artifact-actions svg{width:14px;height:14px}.paper-pdf-toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;width:100%;padding:8px;border-bottom:1px solid #dce1e8;background:#fff}.paper-pdf-toolbar-group{display:flex;align-items:center;gap:6px}.paper-pdf-toolbar button,.paper-pdf-toolbar input,.paper-pdf-toolbar a{min-height:32px;border:1px solid #cfd6e4;border-radius:7px;padding:5px 8px;color:#253143;background:#fff;font-size:12px;text-decoration:none}.paper-pdf-toolbar input{width:56px}.paper-pdf-toolbar button:disabled{cursor:not-allowed;opacity:.55}@media (max-width: 700px){.chat-artifact-card>img{width:120px}.chat-artifact-panel{width:100vw;height:100dvh}.chat-artifact-panel footer{align-items:stretch;flex-direction:column}.chat-artifact-actions{justify-content:flex-start}.chat-artifact-panel header{padding:12px 14px}.chat-artifact-header-actions>button:first-child{padding-inline:8px}.paper-pdf-toolbar{align-items:flex-start;flex-direction:column}}@media (forced-colors: active){.chat-artifact-resize-handle,.chat-artifact-card.is-selected{border:1px solid ButtonText}}@media (prefers-reduced-motion: reduce){.chat-artifact-pulse{animation-duration:.01ms}}.chat-ghost-link{color:var(--ink-soft);font-size:13px;padding:6px 10px;border-radius:6px}.chat-ghost-link:hover{color:var(--ink);background:var(--bg-subtle)}.chat-conversation-viewport{position:relative;display:flex;flex-direction:column;flex:1;min-height:0}.chat-conversation{flex:1;min-height:0;overflow-y:auto}.chat-jump-latest{position:absolute;bottom:12px;left:50%;transform:translate(-50%);border:1px solid var(--border);border-radius:20px;padding:8px 14px;background:var(--bg);color:var(--ink);box-shadow:0 2px 8px #0000001f;white-space:nowrap;cursor:pointer}.chat-conversation-inner{max-width:820px;margin:0 auto;padding:30px 28px 40px}.chat-msg{margin-bottom:26px}.chat-msg-user{display:flex;justify-content:flex-end}.chat-user-message-wrap{display:flex;flex-direction:column;align-items:flex-end;max-width:74%}.chat-bubble{background:var(--accent-soft);color:var(--ink);border:1px solid color-mix(in oklch,var(--accent-soft) 70%,var(--hairline));border-radius:16px 16px 4px;padding:12px 18px;font-family:var(--serif);font-size:16px;line-height:1.45;max-width:100%;white-space:pre-wrap;overflow-wrap:anywhere;-webkit-user-select:text;-moz-user-select:text;user-select:text;cursor:text}.chat-bubble::-moz-selection,.chat-bubble *::-moz-selection{background:var(--accent);color:var(--bg)}.chat-bubble::selection,.chat-bubble *::selection{background:var(--accent);color:var(--bg)}.chat-user-actions{display:flex;justify-content:flex-end;gap:2px;min-height:30px;padding:4px 2px 0;opacity:0;transform:translateY(-2px);transition:opacity .14s ease,transform .14s ease;-webkit-user-select:none;-moz-user-select:none;user-select:none}.chat-msg-user:hover .chat-user-actions,.chat-msg-user:focus-within .chat-user-actions{opacity:1;transform:translateY(0)}.chat-user-action{width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:999px;color:var(--ink-soft);background:transparent}.chat-user-action:hover{color:var(--ink);background:var(--bg-elevated);border-color:var(--hairline)}.chat-user-action:focus-visible{outline:2px solid var(--accent);outline-offset:2px;opacity:1}.chat-user-action svg{width:14px;height:14px}.chat-inline-editor{width:min(620px,74%);min-width:min(360px,100%);padding:12px;border:1px solid color-mix(in oklch,var(--accent) 45%,var(--hairline));border-radius:16px 16px 4px;background:var(--accent-soft);box-shadow:0 8px 28px #00000014}.chat-inline-editor-textarea{position:relative;z-index:1;display:block;width:100%;min-height:72px;padding:8px 10px;resize:none;border:1px solid var(--hairline-strong);border-radius:10px;color:var(--ink);background:transparent;font-family:var(--serif);font-size:16px;line-height:1.45;white-space:pre-wrap}.chat-inline-editor-textarea-wrap{position:relative;background:var(--bg-elevated);border-radius:10px}.chat-inline-editor-textarea-wrap .chat-inline-editor-textarea{color:transparent;caret-color:var(--ink)}.chat-inline-editor-textarea:focus{outline:2px solid var(--accent);outline-offset:1px}.chat-inline-editor-notice{margin:8px 2px 0;color:var(--ink-soft);font-size:12.5px;line-height:1.4}.chat-inline-editor-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:10px}.chat-inline-editor-actions button{min-height:34px;padding:6px 14px;border:1px solid var(--hairline-strong);border-radius:999px;color:var(--ink);background:var(--bg-elevated);font-size:13px;font-weight:600}.chat-inline-editor-actions button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.chat-inline-editor-actions .chat-inline-editor-send{color:#fff;border-color:var(--accent);background:var(--accent)}.chat-inline-editor-actions button:disabled{cursor:not-allowed;opacity:.5}.chat-msg-blocks{display:flex;flex-direction:column;gap:14px}.chat-waiting{min-height:20px;display:flex;align-items:center;font-size:13px;font-weight:600}.chat-thinking{color:transparent;background:linear-gradient(100deg,var(--ink-faint) 30%,var(--accent-text) 50%,var(--ink-faint) 70%);background-size:220% 100%;background-clip:text;-webkit-background-clip:text;animation:chat-thinking-glow 1.8s ease-in-out infinite}@keyframes chat-thinking-glow{0%{background-position:100% 0}to{background-position:-100% 0}}@media (prefers-reduced-motion: reduce){.chat-thinking{color:var(--accent-text);background:none;animation:none}}.chat-reason-live{border:1px solid var(--hairline);border-left:2px solid var(--accent);background:var(--bg-elevated);border-radius:10px;padding:14px 16px}.chat-reason-live-head{display:flex;align-items:center;gap:9px;font-size:12.5px;font-weight:600;color:var(--accent-text)}.chat-reason-live-body{margin-top:9px;font-family:var(--serif);font-size:14.5px;line-height:1.6;color:var(--ink-soft)}.chat-reason-done{border:1px solid var(--hairline);border-radius:10px;background:var(--bg-elevated);overflow:hidden}.chat-reason-done-head{display:flex;align-items:center;gap:9px;width:100%;padding:11px 15px;font-size:13px;color:var(--ink-soft);font-weight:500;text-align:left}.chat-reason-done-head svg:first-child{color:var(--positive-text);flex:none}.chat-reason-done-head .chat-chev{margin-left:auto}.chat-reason-done-head:hover{color:var(--ink)}.chat-reason-done-body{padding:2px 16px 16px 39px;font-family:var(--serif);font-size:14px;line-height:1.65;color:var(--ink-soft)}.chat-answer.chat-reason-markdown{padding-top:0;padding-right:0;padding-bottom:0;font-size:inherit;line-height:inherit;color:inherit;white-space:normal}.chat-answer.chat-reason-live-body{padding-left:23px}.chat-answer.chat-reason-done-body{padding:2px 16px 16px 39px}.chat-tool{border:1px solid var(--hairline);border-radius:10px;background:var(--bg-elevated);overflow:hidden}.chat-tool-running{border-color:color-mix(in oklch,var(--accent) 35%,var(--hairline))}.chat-tool-failed{border-color:color-mix(in oklch,#b42318 55%,var(--hairline))}.chat-tool-failed .chat-tool-status{color:#b42318;font-weight:600}.chat-tool-head{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:11px 15px;text-align:left}.chat-tool-head:disabled{cursor:default}.chat-tool-head-left{display:flex;align-items:center;gap:9px;min-width:0}.chat-tool-head-left>svg{color:var(--accent-text);flex:none}.chat-tool-name{font-family:var(--mono);font-size:12px;font-weight:600;color:var(--ink);background:var(--bg-subtle);border:1px solid var(--hairline);border-radius:5px;padding:2px 7px;flex:none}.chat-tool-query{font-family:var(--serif);font-style:italic;font-size:13.5px;color:var(--ink-soft);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-tool-head-right{display:flex;align-items:center;gap:10px;flex:none}.chat-tool-status{font-size:11.5px;color:var(--ink-soft);font-variant-numeric:tabular-nums}.chat-tool-body{padding:4px 16px 16px;border-top:1px solid var(--hairline)}.chat-tool-args{margin:12px 0 4px}.chat-tool-label{display:block;font-family:var(--mono);font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-faint);margin-bottom:6px}.chat-tool-args pre{margin:0;background:var(--bg-subtle);border:1px solid var(--hairline);border-radius:8px;padding:10px 12px;font-family:var(--mono);font-size:11.5px;line-height:1.5;color:var(--ink-soft);overflow-x:auto}.chat-tool-results-label{margin-top:16px}.chat-tool-output-head{display:flex;align-items:center;justify-content:space-between;margin-top:14px}.chat-tool-output-head .chat-tool-label{margin-bottom:0}.chat-tool-copy{color:var(--accent-text);font-family:var(--mono);font-size:11px}.chat-tool-output{max-height:320px;margin:7px 0 0;overflow:auto;white-space:pre;-moz-tab-size:4;-o-tab-size:4;tab-size:4;border:1px solid var(--hairline);border-radius:8px;background:var(--bg-subtle);padding:11px 12px;color:var(--ink);font-family:var(--mono);font-size:11.5px;line-height:1.5}.chat-tool-truncated{margin-top:7px;color:var(--ink-faint);font-size:11px}.chat-mcp-app{border:1px solid var(--chat-border, #d8d8de);border-radius:12px;overflow:hidden;background:var(--chat-surface, #fff)}.chat-mcp-app>header{display:flex;justify-content:flex-end;padding:8px 10px 0}.chat-mcp-app button{border:0;border-radius:6px;background:#eef1f5;padding:5px 8px;cursor:pointer}.chat-mcp-app iframe{display:block;width:100%;border:0;background:#fff;aspect-ratio:4 / 3}.chat-mcp-loading,.chat-mcp-error{min-height:180px;aspect-ratio:4 / 3;display:grid;place-items:center;padding:18px;color:#52606d;text-align:center}.chat-mcp-error{gap:12px}.chat-mcp-app-fullscreen{position:fixed;top:16px;right:16px;bottom:16px;left:16px;z-index:1000}.chat-mcp-app-fullscreen iframe{height:calc(100vh - 72px)!important;aspect-ratio:auto}.chat-tool-results{list-style:none;margin:0;padding:0}.chat-hit{padding:11px 0;border-top:1px solid var(--hairline)}.chat-hit:first-child{border-top:0}.chat-hit-top{display:flex;align-items:baseline;gap:12px}.chat-hit-title{font-family:var(--serif);font-size:14.5px;font-weight:600;color:var(--accent-text);flex:1;line-height:1.3}.chat-hit-title:hover{text-decoration:underline}.chat-hit-meta{font-size:12px;color:var(--ink-faint);margin-top:2px}.chat-hit-truncated{color:var(--ink-faint);font-style:italic}.chat-hit-snippet{font-family:var(--serif);font-size:13.5px;line-height:1.5;color:var(--ink-soft);margin-top:5px;text-wrap:pretty}.chat-answer{font-family:var(--serif);font-size:16.5px;line-height:1.65;color:var(--ink);text-wrap:pretty;padding:2px}.chat-answer>:first-child{margin-top:0}.chat-answer>:last-child{margin-bottom:0}.chat-answer p{margin:0 0 .9em}.chat-answer h1,.chat-answer h2,.chat-answer h3,.chat-answer h4{font-family:var(--sans);font-weight:600;line-height:1.3;margin:1.35em 0 .5em}.chat-answer h1{font-size:1.45em}.chat-answer h2{font-size:1.25em}.chat-answer h3{font-size:1.08em}.chat-answer h4{font-size:1em}.chat-answer ul,.chat-answer ol{margin:0 0 .9em;padding-left:1.5em}.chat-answer ul{list-style-type:disc}.chat-answer ol{list-style-type:decimal}.chat-answer ul ul{list-style-type:circle}.chat-answer ul ul ul{list-style-type:square}.chat-answer li{margin:.2em 0}.chat-answer li>p{margin:0}.chat-answer blockquote{margin:0 0 .9em;padding-left:1em;border-left:3px solid var(--hairline-strong);color:var(--ink-soft)}.chat-answer code{font-family:var(--mono);font-size:.84em;background:var(--bg-subtle);border:1px solid var(--hairline);border-radius:4px;padding:.1em .3em}.chat-answer pre{margin:0 0 1em;padding:12px 14px;overflow-x:auto;background:var(--bg-subtle);border:1px solid var(--hairline);border-radius:8px;line-height:1.5}.chat-answer pre code{background:none;border:0;padding:0}.chat-answer table{display:block;width:-moz-max-content;width:max-content;max-width:100%;overflow-x:auto;border-collapse:collapse;margin:0 0 1em;font-family:var(--sans);font-size:.88em}.chat-answer th,.chat-answer td{border:1px solid var(--hairline);padding:6px 10px;text-align:left}.chat-answer th{background:var(--bg-subtle);font-weight:600}.chat-answer hr{border:0;border-top:1px solid var(--hairline);margin:1.25em 0}.chat-answer input[type=checkbox]{margin-right:.4em}.chat-answer strong{font-weight:600}.chat-error{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:12px;border:1px solid var(--negative-border);background:var(--negative-bg);color:var(--negative-text);border-radius:10px;padding:12px 16px;font-size:13.5px;overflow-wrap:anywhere}.chat-error>span:first-child{flex:1 1 280px;min-width:0}.chat-finish-note{font-family:var(--serif);font-style:italic;font-size:13px;color:var(--ink-faint)}.chat-feedback{display:flex;align-items:center;gap:4px;min-height:30px;margin-top:8px;color:var(--ink-faint);font-size:12px}.chat-feedback-label{margin-right:2px}.chat-feedback-action{width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:999px;color:var(--ink-soft);background:transparent}.chat-feedback-action:hover:not(:disabled),.chat-feedback-action-selected{color:var(--accent-text);background:var(--accent-soft);border-color:color-mix(in oklch,var(--accent) 35%,var(--hairline))}.chat-feedback-action:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.chat-feedback-action:disabled{cursor:wait}.chat-feedback-action svg{width:14px;height:14px}.chat-feedback-error{color:var(--negative-text);margin-left:4px}.chat-feedback-panel{width:min(460px,100%);margin-top:8px;padding:16px;border:1px solid var(--hairline);border-radius:12px;background:var(--bg-elevated);box-shadow:0 10px 30px #0000001a}.chat-feedback-panel-title{color:var(--ink);font-size:15px;font-weight:600}.chat-feedback-panel-label{display:block;margin-top:4px;color:var(--ink-soft);font-size:13px}.chat-feedback-comment{display:block;width:100%;min-height:92px;margin-top:12px;padding:10px 12px;resize:vertical;border:1px solid var(--hairline-strong);border-radius:8px;color:var(--ink);background:var(--bg);font:14px/1.45 var(--sans)}.chat-feedback-comment:focus{border-color:var(--accent);outline:2px solid color-mix(in oklch,var(--accent) 25%,transparent);outline-offset:1px}.chat-feedback-panel-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}.chat-feedback-panel-actions button{min-width:72px;padding:8px 14px;border-radius:8px;font:600 13px var(--sans)}.chat-feedback-skip{border:1px solid transparent;color:var(--ink-soft);background:transparent}.chat-feedback-submit{border:1px solid var(--ink);color:var(--bg);background:var(--ink)}.chat-feedback-panel-actions button:disabled{cursor:wait;opacity:.65}.chat-error a,.chat-error button{flex:none;max-width:100%;color:var(--accent-text);font-weight:600;text-decoration:none}.chat-error button{border:0;padding:0;background:transparent;cursor:pointer;font:inherit;text-align:left;white-space:normal}.chat-error button:disabled{cursor:wait;opacity:.65}.chat-error-actions{display:flex;flex:0 1 auto;min-width:0;max-width:100%;flex-wrap:wrap;justify-content:flex-start;gap:8px 16px}.chat-error a:hover,.chat-error button:hover:not(:disabled){text-decoration:underline}@media (max-width: 900px){.chat-user-message-wrap{max-width:90%}.chat-inline-editor{width:90%;min-width:0}.chat-conversation-inner{padding:22px 16px 32px}}@media (max-width: 560px){.shared-chat-content .chat-user-message-wrap{max-width:88%}}@media (hover: none),(pointer: coarse){.chat-user-actions{opacity:1;transform:none}}.chat-compaction-status{flex-direction:column;align-items:flex-start}.chat-compaction-explanation{margin-top:4px;color:var(--ink-faint);font-weight:400}.chat-caret{display:inline-block;width:7px;height:1.05em;background:var(--accent);margin-left:1px;vertical-align:text-bottom;animation:chat-blink 1s steps(1) infinite}@keyframes chat-blink{50%{opacity:0}}.chat-chev{transition:transform .18s;color:var(--ink-faint)}.chat-chev-open{transform:rotate(180deg)}.chat-spinner{width:14px;height:14px;border:2px solid color-mix(in oklch,var(--accent) 25%,transparent);border-top-color:var(--accent);border-radius:50%;display:inline-block;animation:chat-spin .7s linear infinite;flex:none}.chat-spinner-light{border-color:#fff6;border-top-color:#fff}@keyframes chat-spin{to{transform:rotate(360deg)}}.shared-chat-page{min-height:0;display:flex;flex-direction:column;overflow:hidden;background:var(--bg)}.shared-chat-heading{flex:none;border-bottom:1px solid var(--hairline);display:flex;align-items:center;gap:10px}.shared-chat-heading h1{max-width:calc(50vw + 640px);margin:0 auto;padding:13px 32px;color:var(--ink);font-family:var(--serif);font-size:20px;font-weight:600;line-height:1.1}.shared-chat-content{width:min(876px,100%);margin:0 auto;padding:34px 28px 64px}.shared-chat-transcript{padding:0 0 26px}.shared-chat-attribution{display:flex;flex-wrap:wrap;justify-content:center;gap:5px 12px;color:var(--ink-faint);font-size:12px;line-height:1.5}.shared-chat-attribution a{color:inherit;font-weight:600;text-decoration:none}.shared-chat-attribution a:hover{color:var(--accent-text);text-decoration:underline}.shared-chat-fresh{margin-top:26px;padding-top:28px;border-top:1px solid var(--hairline)}.shared-chat-fresh h2{margin:0 0 6px;font-family:var(--serif);font-size:21px;font-weight:600}.shared-chat-fresh>p{margin:0 0 16px;color:var(--ink-soft);font-family:var(--serif)}.shared-chat-access-note{margin:-6px 0 16px;padding:10px 12px;border:1px solid color-mix(in oklch,var(--accent) 24%,var(--hairline));border-radius:9px;color:var(--ink-soft);background:color-mix(in oklch,var(--accent) 5%,var(--bg-elevated));font-size:13px;line-height:1.45}.shared-chat-access-note a{color:var(--accent-text);font-weight:600}.shared-chat-state{min-height:55vh;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:48px 24px;text-align:center;color:var(--ink-soft)}.shared-chat-state h1{margin:0;color:var(--ink);font-family:var(--serif);font-size:27px}.shared-chat-state p{margin:0}.shared-chat-state button{margin-top:8px;padding:7px 13px;border:1px solid var(--hairline-strong);border-radius:7px;background:var(--bg-elevated);color:var(--ink)}@media (max-width: 900px){.shared-chat-heading h1{padding-inline:16px}}@media (max-width: 640px){.shared-chat-heading h1{padding-inline:14px}}@media (max-width: 560px){.shared-chat-content{padding:26px 16px 48px}} diff --git a/assets/index-CqKcHUvZ.js b/assets/index-CqKcHUvZ.js deleted file mode 100644 index 76e8074f1830c35e7a4c1f45d1a8d85148cc9369..0000000000000000000000000000000000000000 --- a/assets/index-CqKcHUvZ.js +++ /dev/null @@ -1,163 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AuthorizePaperEditView-D17pnlSs.js","assets/useQuery-Cngk7eL9.js","assets/useMutation-BItMAQ7s.js","assets/button-BYn4yUH_.js","assets/paperEdits-BD6cBS3E.js","assets/FollowingView-CYdAvQ9K.js","assets/FeedView-EM1uL5u1.js","assets/sparkles-BKRdZneA.js","assets/dialog-B-oqHDuH.js","assets/catalog-D26nGNnK.js","assets/research-Dt0MUW0x.js","assets/colors-_scCXfCe.js","assets/researchTopic-k4qgoW39.js","assets/plus-DZF-NxR0.js","assets/arrow-right-DCfHXCdw.js","assets/components-Dmnn5Z5p.js","assets/papers-bE3C_Qzl.js","assets/AuthorAvatar-CWCqOa0h.js","assets/AuthorAvatar-o5W6pl_W.css","assets/LatexTitle-BI9yl-Fo.js","assets/safeExternalHref-CkBrsh84.js","assets/McpShowcase-oHgWM9FI.js","assets/AgentLogos-ClqC1BaK.js","assets/PaperDateFilter-zHw5tq6B.js","assets/popover-BcoS9Jmp.js","assets/chatSessions-D75G2_U7.js","assets/chat-DGBJkcmd.js","assets/usePapers-By3yMmMn.js","assets/useInfiniteQuery-lxaMAHEu.js","assets/useInfiniteScroll-DVF-b-LX.js","assets/useIntersectionObserver-CiBk_Oug.js","assets/skeleton-DleNhBYA.js","assets/alert-Z2yFUcyL.js","assets/ChatView-DZCqXX3T.js","assets/ArtifactWorkspace-DZXFAFpE.js","assets/hover-card-BTsA69o8.js","assets/CatalogEntityPreviewLink-BWMEEf81.js","assets/github-sUmGdHig.js","assets/file-text-DnNBEwSF.js","assets/PaperPreviewLink-C6khj_iZ.js","assets/index-CqELxJb0.js","assets/index-DBHj7UWg.js","assets/katex-DkKDou_j.js","assets/copy-D9WKw0Bi.js","assets/thumbs-up-C19-ALYv.js","assets/arrow-left-D_tIkkPW.js","assets/external-link-CrrdDZf6.js","assets/search-9n8Usynh.js","assets/chevron-up-CZWX0SDx.js","assets/ArtifactWorkspace-Lr_OJaUk.css","assets/katex-wklAmtGL.css","assets/share-2-Ma7ZrYBX.js","assets/openrouter-BNf4jDuS.js","assets/queryOptions-C9woPjwX.js","assets/SharedChatView-BBge3zF7.js","assets/PapersListView-DYcakh08.js","assets/useDebounce-D8I8hw4T.js","assets/PaperFeedFilters-SOqb93ez.js","assets/PaperDetailView-rFgkO-hW.js","assets/ExternalSourceEvalBadge-TyFEU7vd.js","assets/ExternalSourceEvalBadge-CWUQ52cV.css","assets/paperReader-BIpQD5HO.js","assets/latexPlainText-DI8YEXVe.js","assets/input-sw0Ix0Sa.js","assets/searchable-select-DY1KXMvg.js","assets/loader-circle-CZgakNH7.js","assets/submissions-1aHdBaSr.js","assets/queryInvalidation-fI4V8eHx.js","assets/evaluationQueryInvalidation-B16EDNu-.js","assets/SignInToEditDialog-B4COuqpY.js","assets/textarea-CQToxq8k.js","assets/database-DrVmdfNa.js","assets/index-C8IgDsSE.js","assets/badge-D-oq0Pkj.js","assets/globe-6Eu_W8am.js","assets/codexAddEvals-BaTB12JK.js","assets/savedPapersAuth-BzEAZw7z.js","assets/organizationNames-BVKzYEBp.js","assets/PaperDetailView-CUWCgV3F.css","assets/PaperReaderView-Dwb0MEz-.js","assets/MarkdownText-CJQADo_f.js","assets/TagsIndexView-CtWAzEjF.js","assets/slug-BpH-Nkvz.js","assets/triangle-alert-DM207o24.js","assets/trending-up-n0ivZSaN.js","assets/moon-DgDMXTmG.js","assets/trophy-CwHzFBlu.js","assets/activity-DDb7qU7w.js","assets/TaxonomySuggestionTile-Be7MdvJo.js","assets/TaxonomyTrending-DuJmoxuN.js","assets/TagBrowseView-Cz-rtfuq.js","assets/ResearchFollowButton-CrCIwiok.js","assets/BenchmarkTrendSparkline-BrvDBmsS.js","assets/MethodsIndexView-CW-VvDvI.js","assets/FrameworksIndexView-BjBwZMDx.js","assets/TrendsView-DTLJKQiJ.js","assets/ConferencesIndexView-BvdvhrAq.js","assets/AiDeadlinesView-DJBbqNNI.js","assets/switch-BvSgzfJM.js","assets/ConferenceDetailView-BP533WBF.js","assets/ConferenceTaskView-B9U81_-o.js","assets/OrganizationsIndexView-CLXjlm96.js","assets/OrganizationsIndexView-CJnrfIkP.css","assets/OrganizationDetailView-0SsciBmz.js","assets/OrganizationPaperFeed-CF5IpMXI.js","assets/OrganizationContributionGraph-DUBXw9I0.js","assets/NotFound-pWH_hqC2.js","assets/OrganizationTaskView-BXRvLYFu.js","assets/AuthorDetailView-CfDdV5MT.js","assets/MethodDetailView-CFqQPuPA.js","assets/BenchmarkDetailView-HVBhj9Ke.js","assets/BenchmarkDetailView-CXxK75GR.css","assets/SavedPapersView-wbzqnUzp.js","assets/SettingsView-BhE0cUUD.js","assets/PrivacyView-CH2fzy9w.js","assets/ApiDocsView-CydK1pFj.js","assets/ApiDocsView-DPuMdYvY.css","assets/McpView-zJL3QfYL.js","assets/McpView-EGeqkP46.css","assets/SubmitView-CSI8FjeO.js","assets/CronDashboard-DPgNAdQz.js","assets/CronDashboard-Ch03vo4I.js","assets/CronDashboard-DwChfW9h.css","assets/shield-alert-B0VZio-w.js","assets/refresh-cw-gVdSyglp.js","assets/circle-check-BYRHMG9x.js","assets/AutonomousOperations-CYN302r1.js","assets/SubmissionsDashboard-DZ_zzNWm.js","assets/SubmissionsDashboard-BTmvDoLW.css","assets/UserProfileView-COPdCmiq.js","assets/RateLimitsView-46i_Guh7.js","assets/AstraForRoboticsView-U0yBJtLA.js","assets/AstraForRoboticsView-C_lTF_XB.css","assets/SearchOverlay-CN_xcP2S.js","assets/StagingAccessRequestView-DeIOzPRB.js"])))=>i.map(i=>d[i]); -var rP=Object.defineProperty;var vm=t=>{throw TypeError(t)};var sP=(t,e,n)=>e in t?rP(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Fr=(t,e,n)=>sP(t,typeof e!="symbol"?e+"":e,n),jd=(t,e,n)=>e.has(t)||vm("Cannot "+n);var A=(t,e,n)=>(jd(t,e,"read from private field"),n?n.call(t):e.get(t)),fe=(t,e,n)=>e.has(t)?vm("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),ne=(t,e,n,r)=>(jd(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),ut=(t,e,n)=>(jd(t,e,"access private method"),n);var Rl=(t,e,n,r)=>({set _(s){ne(t,e,s,n)},get _(){return A(t,e,r)}});function iP(t,e){for(var n=0;nr[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var Zz=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function aw(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var lw={exports:{}},Wc={},uw={exports:{}},de={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var pl=Symbol.for("react.element"),oP=Symbol.for("react.portal"),aP=Symbol.for("react.fragment"),lP=Symbol.for("react.strict_mode"),uP=Symbol.for("react.profiler"),cP=Symbol.for("react.provider"),dP=Symbol.for("react.context"),fP=Symbol.for("react.forward_ref"),hP=Symbol.for("react.suspense"),pP=Symbol.for("react.memo"),vP=Symbol.for("react.lazy"),gm=Symbol.iterator;function gP(t){return t===null||typeof t!="object"?null:(t=gm&&t[gm]||t["@@iterator"],typeof t=="function"?t:null)}var cw={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},dw=Object.assign,fw={};function No(t,e,n){this.props=t,this.context=e,this.refs=fw,this.updater=n||cw}No.prototype.isReactComponent={};No.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};No.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function hw(){}hw.prototype=No.prototype;function fv(t,e,n){this.props=t,this.context=e,this.refs=fw,this.updater=n||cw}var hv=fv.prototype=new hw;hv.constructor=fv;dw(hv,No.prototype);hv.isPureReactComponent=!0;var mm=Array.isArray,pw=Object.prototype.hasOwnProperty,pv={current:null},vw={key:!0,ref:!0,__self:!0,__source:!0};function gw(t,e,n){var r,s={},i=null,o=null;if(e!=null)for(r in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(i=""+e.key),e)pw.call(e,r)&&!vw.hasOwnProperty(r)&&(s[r]=e[r]);var a=arguments.length-2;if(a===1)s.children=n;else if(1>>1,H=M[K];if(0>>1;Ks(ie,z))pes(se,ie)?(M[K]=se,M[pe]=z,K=pe):(M[K]=ie,M[X]=z,K=X);else if(pes(se,z))M[K]=se,M[pe]=z,K=pe;else break e}}return T}function s(M,T){var z=M.sortIndex-T.sortIndex;return z!==0?z:M.id-T.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var l=[],u=[],c=1,d=null,f=3,h=!1,_=!1,p=!1,y=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(M){for(var T=n(u);T!==null;){if(T.callback===null)r(u);else if(T.startTime<=M)r(u),T.sortIndex=T.expirationTime,e(l,T);else break;T=n(u)}}function b(M){if(p=!1,x(M),!_)if(n(l)!==null)_=!0,q(E);else{var T=n(u);T!==null&&G(b,T.startTime-M)}}function E(M,T){_=!1,p&&(p=!1,v(C),C=-1),h=!0;var z=f;try{for(x(T),d=n(l);d!==null&&(!(d.expirationTime>T)||M&&!$());){var K=d.callback;if(typeof K=="function"){d.callback=null,f=d.priorityLevel;var H=K(d.expirationTime<=T);T=t.unstable_now(),typeof H=="function"?d.callback=H:d===n(l)&&r(l),x(T)}else r(l);d=n(l)}if(d!==null)var Q=!0;else{var X=n(u);X!==null&&G(b,X.startTime-T),Q=!1}return Q}finally{d=null,f=z,h=!1}}var S=!1,k=null,C=-1,I=5,P=-1;function $(){return!(t.unstable_now()-PM||125K?(M.sortIndex=z,e(u,M),n(l)===null&&M===n(u)&&(p?(v(C),C=-1):p=!0,G(b,z-K))):(M.sortIndex=H,e(l,M),_||h||(_=!0,q(E))),M},t.unstable_shouldYield=$,t.unstable_wrapCallback=function(M){var T=f;return function(){var z=f;f=T;try{return M.apply(this,arguments)}finally{f=z}}}})(xw);ww.exports=xw;var PP=ww.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var RP=g,Jt=PP;function V(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),dh=Object.prototype.hasOwnProperty,TP=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,_m={},wm={};function IP(t){return dh.call(wm,t)?!0:dh.call(_m,t)?!1:TP.test(t)?wm[t]=!0:(_m[t]=!0,!1)}function OP(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function MP(t,e,n,r){if(e===null||typeof e>"u"||OP(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Tt(t,e,n,r,s,i,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=i,this.removeEmptyString=o}var ht={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){ht[t]=new Tt(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];ht[e]=new Tt(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){ht[t]=new Tt(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){ht[t]=new Tt(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){ht[t]=new Tt(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){ht[t]=new Tt(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){ht[t]=new Tt(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){ht[t]=new Tt(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){ht[t]=new Tt(t,5,!1,t.toLowerCase(),null,!1,!1)});var gv=/[\-:]([a-z])/g;function mv(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(gv,mv);ht[e]=new Tt(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(gv,mv);ht[e]=new Tt(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(gv,mv);ht[e]=new Tt(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){ht[t]=new Tt(t,1,!1,t.toLowerCase(),null,!1,!1)});ht.xlinkHref=new Tt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){ht[t]=new Tt(t,1,!1,t.toLowerCase(),null,!0,!0)});function yv(t,e,n,r){var s=ht.hasOwnProperty(e)?ht[e]:null;(s!==null?s.type!==0:r||!(2a||s[o]!==i[a]){var l=` -`+s[o].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=o&&0<=a);break}}}finally{zd=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?aa(t):""}function NP(t){switch(t.tag){case 5:return aa(t.type);case 16:return aa("Lazy");case 13:return aa("Suspense");case 19:return aa("SuspenseList");case 0:case 2:case 15:return t=Bd(t.type,!1),t;case 11:return t=Bd(t.type.render,!1),t;case 1:return t=Bd(t.type,!0),t;default:return""}}function vh(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Ti:return"Fragment";case Ri:return"Portal";case fh:return"Profiler";case _v:return"StrictMode";case hh:return"Suspense";case ph:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case Sw:return(t.displayName||"Context")+".Consumer";case Ew:return(t._context.displayName||"Context")+".Provider";case wv:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case xv:return e=t.displayName||null,e!==null?e:vh(t.type)||"Memo";case Gr:e=t._payload,t=t._init;try{return vh(t(e))}catch{}}return null}function AP(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return vh(e);case 8:return e===_v?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function vs(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function kw(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function $P(t){var e=kw(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Ol(t){t._valueTracker||(t._valueTracker=$P(t))}function Pw(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=kw(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function Fu(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function gh(t,e){var n=e.checked;return qe({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function bm(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=vs(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function Rw(t,e){e=e.checked,e!=null&&yv(t,"checked",e,!1)}function mh(t,e){Rw(t,e);var n=vs(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?yh(t,e.type,n):e.hasOwnProperty("defaultValue")&&yh(t,e.type,vs(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function Em(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function yh(t,e,n){(e!=="number"||Fu(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var la=Array.isArray;function Vi(t,e,n,r){if(t=t.options,e){e={};for(var s=0;s"+e.valueOf().toString()+"",e=Ml.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Na(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var ga={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},LP=["Webkit","ms","Moz","O"];Object.keys(ga).forEach(function(t){LP.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),ga[e]=ga[t]})});function Mw(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||ga.hasOwnProperty(t)&&ga[t]?(""+e).trim():e+"px"}function Nw(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=Mw(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,s):t[n]=s}}var jP=qe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function xh(t,e){if(e){if(jP[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(V(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(V(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(V(61))}if(e.style!=null&&typeof e.style!="object")throw Error(V(62))}}function bh(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Eh=null;function bv(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Sh=null,qi=null,Hi=null;function km(t){if(t=ml(t)){if(typeof Sh!="function")throw Error(V(280));var e=t.stateNode;e&&(e=Jc(e),Sh(t.stateNode,t.type,e))}}function Aw(t){qi?Hi?Hi.push(t):Hi=[t]:qi=t}function $w(){if(qi){var t=qi,e=Hi;if(Hi=qi=null,km(t),e)for(t=0;t>>=0,t===0?32:31-(KP(t)/QP|0)|0}var Nl=64,Al=4194304;function ua(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Uu(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,s=t.suspendedLanes,i=t.pingedLanes,o=n&268435455;if(o!==0){var a=o&~s;a!==0?r=ua(a):(i&=o,i!==0&&(r=ua(i)))}else o=n&~s,o!==0?r=ua(o):i!==0&&(r=ua(i));if(r===0)return 0;if(e!==0&&e!==r&&!(e&s)&&(s=r&-r,i=e&-e,s>=i||s===16&&(i&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function vl(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-In(e),t[e]=n}function ZP(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=ya),$m=" ",Lm=!1;function tx(t,e){switch(t){case"keyup":return PR.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nx(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ii=!1;function TR(t,e){switch(t){case"compositionend":return nx(e);case"keypress":return e.which!==32?null:(Lm=!0,$m);case"textInput":return t=e.data,t===$m&&Lm?null:t;default:return null}}function IR(t,e){if(Ii)return t==="compositionend"||!Iv&&tx(t,e)?(t=Zw(),mu=Pv=rs=null,Ii=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=zm(n)}}function ox(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?ox(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function ax(){for(var t=window,e=Fu();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Fu(t.document)}return e}function Ov(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function DR(t){var e=ax(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&ox(n.ownerDocument.documentElement,n)){if(r!==null&&Ov(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!t.extend&&i>r&&(s=r,r=i,i=s),s=Bm(n,i);var o=Bm(n,r);s&&o&&(t.rangeCount!==1||t.anchorNode!==s.node||t.anchorOffset!==s.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(s.node,s.offset),t.removeAllRanges(),i>r?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Oi=null,Ih=null,wa=null,Oh=!1;function Um(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Oh||Oi==null||Oi!==Fu(r)||(r=Oi,"selectionStart"in r&&Ov(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),wa&&Da(wa,r)||(wa=r,r=Hu(Ih,"onSelect"),0Ai||(t.current=jh[Ai],jh[Ai]=null,Ai--)}function Ie(t,e){Ai++,jh[Ai]=t.current,t.current=e}var gs={},xt=bs(gs),Ft=bs(!1),ei=gs;function vo(t,e){var n=t.type.contextTypes;if(!n)return gs;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=e[i];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=s),s}function Dt(t){return t=t.childContextTypes,t!=null}function Gu(){Le(Ft),Le(xt)}function Qm(t,e,n){if(xt.current!==gs)throw Error(V(168));Ie(xt,e),Ie(Ft,n)}function gx(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in e))throw Error(V(108,AP(t)||"Unknown",s));return qe({},n,r)}function Ku(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||gs,ei=xt.current,Ie(xt,t),Ie(Ft,Ft.current),!0}function Ym(t,e,n){var r=t.stateNode;if(!r)throw Error(V(169));n?(t=gx(t,e,ei),r.__reactInternalMemoizedMergedChildContext=t,Le(Ft),Le(xt),Ie(xt,t)):Le(Ft),Ie(Ft,n)}var dr=null,Zc=!1,tf=!1;function mx(t){dr===null?dr=[t]:dr.push(t)}function XR(t){Zc=!0,mx(t)}function Es(){if(!tf&&dr!==null){tf=!0;var t=0,e=Ee;try{var n=dr;for(Ee=1;t>=o,s-=o,mr=1<<32-In(e)+s|n<C?(I=k,k=null):I=k.sibling;var P=f(v,k,x[C],b);if(P===null){k===null&&(k=I);break}t&&k&&P.alternate===null&&e(v,k),m=i(P,m,C),S===null?E=P:S.sibling=P,S=P,k=I}if(C===x.length)return n(v,k),De&&Ms(v,C),E;if(k===null){for(;CC?(I=k,k=null):I=k.sibling;var $=f(v,k,P.value,b);if($===null){k===null&&(k=I);break}t&&k&&$.alternate===null&&e(v,k),m=i($,m,C),S===null?E=$:S.sibling=$,S=$,k=I}if(P.done)return n(v,k),De&&Ms(v,C),E;if(k===null){for(;!P.done;C++,P=x.next())P=d(v,P.value,b),P!==null&&(m=i(P,m,C),S===null?E=P:S.sibling=P,S=P);return De&&Ms(v,C),E}for(k=r(v,k);!P.done;C++,P=x.next())P=h(k,v,C,P.value,b),P!==null&&(t&&P.alternate!==null&&k.delete(P.key===null?C:P.key),m=i(P,m,C),S===null?E=P:S.sibling=P,S=P);return t&&k.forEach(function(N){return e(v,N)}),De&&Ms(v,C),E}function y(v,m,x,b){if(typeof x=="object"&&x!==null&&x.type===Ti&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Il:e:{for(var E=x.key,S=m;S!==null;){if(S.key===E){if(E=x.type,E===Ti){if(S.tag===7){n(v,S.sibling),m=s(S,x.props.children),m.return=v,v=m;break e}}else if(S.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Gr&&Zm(E)===S.type){n(v,S.sibling),m=s(S,x.props),m.ref=Go(v,S,x),m.return=v,v=m;break e}n(v,S);break}else e(v,S);S=S.sibling}x.type===Ti?(m=Xs(x.props.children,v.mode,b,x.key),m.return=v,v=m):(b=Cu(x.type,x.key,x.props,null,v.mode,b),b.ref=Go(v,m,x),b.return=v,v=b)}return o(v);case Ri:e:{for(S=x.key;m!==null;){if(m.key===S)if(m.tag===4&&m.stateNode.containerInfo===x.containerInfo&&m.stateNode.implementation===x.implementation){n(v,m.sibling),m=s(m,x.children||[]),m.return=v,v=m;break e}else{n(v,m);break}else e(v,m);m=m.sibling}m=cf(x,v.mode,b),m.return=v,v=m}return o(v);case Gr:return S=x._init,y(v,m,S(x._payload),b)}if(la(x))return _(v,m,x,b);if(Uo(x))return p(v,m,x,b);Bl(v,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,m!==null&&m.tag===6?(n(v,m.sibling),m=s(m,x),m.return=v,v=m):(n(v,m),m=uf(x,v.mode,b),m.return=v,v=m),o(v)):n(v,m)}return y}var mo=xx(!0),bx=xx(!1),Xu=bs(null),Ju=null,ji=null,$v=null;function Lv(){$v=ji=Ju=null}function jv(t){var e=Xu.current;Le(Xu),t._currentValue=e}function zh(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Gi(t,e){Ju=t,$v=ji=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Lt=!0),t.firstContext=null)}function fn(t){var e=t._currentValue;if($v!==t)if(t={context:t,memoizedValue:e,next:null},ji===null){if(Ju===null)throw Error(V(308));ji=t,Ju.dependencies={lanes:0,firstContext:t}}else ji=ji.next=t;return e}var Ds=null;function Fv(t){Ds===null?Ds=[t]:Ds.push(t)}function Ex(t,e,n,r){var s=e.interleaved;return s===null?(n.next=n,Fv(e)):(n.next=s.next,s.next=n),e.interleaved=n,Er(t,r)}function Er(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Kr=!1;function Dv(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Sx(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function wr(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function cs(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,me&2){var s=r.pending;return s===null?e.next=e:(e.next=s.next,s.next=e),r.pending=e,Er(t,n)}return s=r.interleaved,s===null?(e.next=e,Fv(r)):(e.next=s.next,s.next=e),r.interleaved=e,Er(t,n)}function _u(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Sv(t,n)}}function ey(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?s=i=e:i=i.next=e}else s=i=e;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function Zu(t,e,n,r){var s=t.updateQueue;Kr=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,u=l.next;l.next=null,o===null?i=u:o.next=u,o=l;var c=t.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==o&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(i!==null){var d=s.baseState;o=0,c=u=l=null,a=i;do{var f=a.lane,h=a.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var _=t,p=a;switch(f=e,h=n,p.tag){case 1:if(_=p.payload,typeof _=="function"){d=_.call(h,d,f);break e}d=_;break e;case 3:_.flags=_.flags&-65537|128;case 0:if(_=p.payload,f=typeof _=="function"?_.call(h,d,f):_,f==null)break e;d=qe({},d,f);break e;case 2:Kr=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,f=s.effects,f===null?s.effects=[a]:f.push(a))}else h={eventTime:h,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=h,l=d):c=c.next=h,o|=f;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;f=a,a=f.next,f.next=null,s.lastBaseUpdate=f,s.shared.pending=null}}while(!0);if(c===null&&(l=d),s.baseState=l,s.firstBaseUpdate=u,s.lastBaseUpdate=c,e=s.shared.interleaved,e!==null){s=e;do o|=s.lane,s=s.next;while(s!==e)}else i===null&&(s.shared.lanes=0);ri|=o,t.lanes=o,t.memoizedState=d}}function ty(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=rf.transition;rf.transition={};try{t(!1),e()}finally{Ee=n,rf.transition=r}}function Bx(){return hn().memoizedState}function tT(t,e,n){var r=fs(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Ux(t))Vx(e,n);else if(n=Ex(t,e,n,r),n!==null){var s=Pt();On(n,t,r,s),qx(n,e,r)}}function nT(t,e,n){var r=fs(t),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ux(t))Vx(e,s);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var o=e.lastRenderedState,a=i(o,n);if(s.hasEagerState=!0,s.eagerState=a,Mn(a,o)){var l=e.interleaved;l===null?(s.next=s,Fv(e)):(s.next=l.next,l.next=s),e.interleaved=s;return}}catch{}finally{}n=Ex(t,e,s,r),n!==null&&(s=Pt(),On(n,t,r,s),qx(n,e,r))}}function Ux(t){var e=t.alternate;return t===Ue||e!==null&&e===Ue}function Vx(t,e){xa=tc=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function qx(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Sv(t,n)}}var nc={readContext:fn,useCallback:pt,useContext:pt,useEffect:pt,useImperativeHandle:pt,useInsertionEffect:pt,useLayoutEffect:pt,useMemo:pt,useReducer:pt,useRef:pt,useState:pt,useDebugValue:pt,useDeferredValue:pt,useTransition:pt,useMutableSource:pt,useSyncExternalStore:pt,useId:pt,unstable_isNewReconciler:!1},rT={readContext:fn,useCallback:function(t,e){return Bn().memoizedState=[t,e===void 0?null:e],t},useContext:fn,useEffect:ry,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,xu(4194308,4,Lx.bind(null,e,t),n)},useLayoutEffect:function(t,e){return xu(4194308,4,t,e)},useInsertionEffect:function(t,e){return xu(4,2,t,e)},useMemo:function(t,e){var n=Bn();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Bn();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=tT.bind(null,Ue,t),[r.memoizedState,t]},useRef:function(t){var e=Bn();return t={current:t},e.memoizedState=t},useState:ny,useDebugValue:Gv,useDeferredValue:function(t){return Bn().memoizedState=t},useTransition:function(){var t=ny(!1),e=t[0];return t=eT.bind(null,t[1]),Bn().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Ue,s=Bn();if(De){if(n===void 0)throw Error(V(407));n=n()}else{if(n=e(),ot===null)throw Error(V(349));ni&30||Rx(r,e,n)}s.memoizedState=n;var i={value:n,getSnapshot:e};return s.queue=i,ry(Ix.bind(null,r,i,t),[t]),r.flags|=2048,Ga(9,Tx.bind(null,r,i,n,e),void 0,null),n},useId:function(){var t=Bn(),e=ot.identifierPrefix;if(De){var n=yr,r=mr;n=(r&~(1<<32-In(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Ha++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=o.createElement(n,{is:r.is}):(t=o.createElement(n),n==="select"&&(o=t,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):t=o.createElementNS(t,n),t[Gn]=e,t[Ua]=r,eb(t,e,!1,!1),e.stateNode=t;e:{switch(o=bh(n,r),n){case"dialog":Ne("cancel",t),Ne("close",t),s=r;break;case"iframe":case"object":case"embed":Ne("load",t),s=r;break;case"video":case"audio":for(s=0;swo&&(e.flags|=128,r=!0,Ko(i,!1),e.lanes=4194304)}else{if(!r)if(t=ec(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Ko(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!De)return vt(e),null}else 2*Ye()-i.renderingStartTime>wo&&n!==1073741824&&(e.flags|=128,r=!0,Ko(i,!1),e.lanes=4194304);i.isBackwards?(o.sibling=e.child,e.child=o):(n=i.last,n!==null?n.sibling=o:e.child=o,i.last=o)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Ye(),e.sibling=null,n=Be.current,Ie(Be,r?n&1|2:n&1),e):(vt(e),null);case 22:case 23:return Zv(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Vt&1073741824&&(vt(e),e.subtreeFlags&6&&(e.flags|=8192)):vt(e),null;case 24:return null;case 25:return null}throw Error(V(156,e.tag))}function dT(t,e){switch(Nv(e),e.tag){case 1:return Dt(e.type)&&Gu(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return yo(),Le(Ft),Le(xt),Uv(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Bv(e),null;case 13:if(Le(Be),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(V(340));go()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Le(Be),null;case 4:return yo(),null;case 10:return jv(e.type._context),null;case 22:case 23:return Zv(),null;case 24:return null;default:return null}}var Vl=!1,_t=!1,fT=typeof WeakSet=="function"?WeakSet:Set,Y=null;function Fi(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ge(t,e,r)}else n.current=null}function Qh(t,e,n){try{n()}catch(r){Ge(t,e,r)}}var py=!1;function hT(t,e){if(Mh=Vu,t=ax(),Ov(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,u=0,c=0,d=t,f=null;t:for(;;){for(var h;d!==n||s!==0&&d.nodeType!==3||(a=o+s),d!==i||r!==0&&d.nodeType!==3||(l=o+r),d.nodeType===3&&(o+=d.nodeValue.length),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===t)break t;if(f===n&&++u===s&&(a=o),f===i&&++c===r&&(l=o),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Nh={focusedElem:t,selectionRange:n},Vu=!1,Y=e;Y!==null;)if(e=Y,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Y=t;else for(;Y!==null;){e=Y;try{var _=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(_!==null){var p=_.memoizedProps,y=_.memoizedState,v=e.stateNode,m=v.getSnapshotBeforeUpdate(e.elementType===e.type?p:bn(e.type,p),y);v.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var x=e.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(V(163))}}catch(b){Ge(e,e.return,b)}if(t=e.sibling,t!==null){t.return=e.return,Y=t;break}Y=e.return}return _=py,py=!1,_}function ba(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&t)===t){var i=s.destroy;s.destroy=void 0,i!==void 0&&Qh(e,n,i)}s=s.next}while(s!==r)}}function nd(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function Yh(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function rb(t){var e=t.alternate;e!==null&&(t.alternate=null,rb(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Gn],delete e[Ua],delete e[Lh],delete e[QR],delete e[YR])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function sb(t){return t.tag===5||t.tag===3||t.tag===4}function vy(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||sb(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Xh(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Wu));else if(r!==4&&(t=t.child,t!==null))for(Xh(t,e,n),t=t.sibling;t!==null;)Xh(t,e,n),t=t.sibling}function Jh(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(Jh(t,e,n),t=t.sibling;t!==null;)Jh(t,e,n),t=t.sibling}var ct=null,kn=!1;function Dr(t,e,n){for(n=n.child;n!==null;)ib(t,e,n),n=n.sibling}function ib(t,e,n){if(Xn&&typeof Xn.onCommitFiberUnmount=="function")try{Xn.onCommitFiberUnmount(Kc,n)}catch{}switch(n.tag){case 5:_t||Fi(n,e);case 6:var r=ct,s=kn;ct=null,Dr(t,e,n),ct=r,kn=s,ct!==null&&(kn?(t=ct,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):ct.removeChild(n.stateNode));break;case 18:ct!==null&&(kn?(t=ct,n=n.stateNode,t.nodeType===8?ef(t.parentNode,n):t.nodeType===1&&ef(t,n),ja(t)):ef(ct,n.stateNode));break;case 4:r=ct,s=kn,ct=n.stateNode.containerInfo,kn=!0,Dr(t,e,n),ct=r,kn=s;break;case 0:case 11:case 14:case 15:if(!_t&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Qh(n,e,o),s=s.next}while(s!==r)}Dr(t,e,n);break;case 1:if(!_t&&(Fi(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Ge(n,e,a)}Dr(t,e,n);break;case 21:Dr(t,e,n);break;case 22:n.mode&1?(_t=(r=_t)||n.memoizedState!==null,Dr(t,e,n),_t=r):Dr(t,e,n);break;default:Dr(t,e,n)}}function gy(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new fT),e.forEach(function(r){var s=bT.bind(null,t,r);n.has(r)||(n.add(r),r.then(s,s))})}}function _n(t,e){var n=e.deletions;if(n!==null)for(var r=0;rs&&(s=o),r&=~i}if(r=s,r=Ye()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*vT(r/1960))-r,10t?16:t,ss===null)var r=!1;else{if(t=ss,ss=null,ic=0,me&6)throw Error(V(331));var s=me;for(me|=4,Y=t.current;Y!==null;){var i=Y,o=i.child;if(Y.flags&16){var a=i.deletions;if(a!==null){for(var l=0;lYe()-Xv?Ys(t,0):Yv|=n),zt(t,e)}function hb(t,e){e===0&&(t.mode&1?(e=Al,Al<<=1,!(Al&130023424)&&(Al=4194304)):e=1);var n=Pt();t=Er(t,e),t!==null&&(vl(t,e,n),zt(t,n))}function xT(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),hb(t,n)}function bT(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,s=t.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(V(314))}r!==null&&r.delete(e),hb(t,n)}var pb;pb=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||Ft.current)Lt=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Lt=!1,uT(t,e,n);Lt=!!(t.flags&131072)}else Lt=!1,De&&e.flags&1048576&&yx(e,Yu,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;bu(t,e),t=e.pendingProps;var s=vo(e,xt.current);Gi(e,n),s=qv(null,e,r,t,s,n);var i=Hv();return e.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Dt(r)?(i=!0,Ku(e)):i=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Dv(e),s.updater=td,e.stateNode=s,s._reactInternals=e,Uh(e,r,t,n),e=Hh(null,e,r,!0,i,n)):(e.tag=0,De&&i&&Mv(e),Et(null,e,s,n),e=e.child),e;case 16:r=e.elementType;e:{switch(bu(t,e),t=e.pendingProps,s=r._init,r=s(r._payload),e.type=r,s=e.tag=ST(r),t=bn(r,t),s){case 0:e=qh(null,e,r,t,n);break e;case 1:e=dy(null,e,r,t,n);break e;case 11:e=uy(null,e,r,t,n);break e;case 14:e=cy(null,e,r,bn(r.type,t),n);break e}throw Error(V(306,r,""))}return e;case 0:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:bn(r,s),qh(t,e,r,s,n);case 1:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:bn(r,s),dy(t,e,r,s,n);case 3:e:{if(Xx(e),t===null)throw Error(V(387));r=e.pendingProps,i=e.memoizedState,s=i.element,Sx(t,e),Zu(e,r,null,n);var o=e.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){s=_o(Error(V(423)),e),e=fy(t,e,r,n,s);break e}else if(r!==s){s=_o(Error(V(424)),e),e=fy(t,e,r,n,s);break e}else for(Gt=us(e.stateNode.containerInfo.firstChild),Qt=e,De=!0,Pn=null,n=bx(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(go(),r===s){e=Sr(t,e,n);break e}Et(t,e,r,n)}e=e.child}return e;case 5:return Cx(e),t===null&&Dh(e),r=e.type,s=e.pendingProps,i=t!==null?t.memoizedProps:null,o=s.children,Ah(r,s)?o=null:i!==null&&Ah(r,i)&&(e.flags|=32),Yx(t,e),Et(t,e,o,n),e.child;case 6:return t===null&&Dh(e),null;case 13:return Jx(t,e,n);case 4:return zv(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=mo(e,null,r,n):Et(t,e,r,n),e.child;case 11:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:bn(r,s),uy(t,e,r,s,n);case 7:return Et(t,e,e.pendingProps,n),e.child;case 8:return Et(t,e,e.pendingProps.children,n),e.child;case 12:return Et(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,s=e.pendingProps,i=e.memoizedProps,o=s.value,Ie(Xu,r._currentValue),r._currentValue=o,i!==null)if(Mn(i.value,o)){if(i.children===s.children&&!Ft.current){e=Sr(t,e,n);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=wr(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),zh(i.return,n,e),a.lanes|=n;break}l=l.next}}else if(i.tag===10)o=i.type===e.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(V(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),zh(o,n,e),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===e){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}Et(t,e,s.children,n),e=e.child}return e;case 9:return s=e.type,r=e.pendingProps.children,Gi(e,n),s=fn(s),r=r(s),e.flags|=1,Et(t,e,r,n),e.child;case 14:return r=e.type,s=bn(r,e.pendingProps),s=bn(r.type,s),cy(t,e,r,s,n);case 15:return Kx(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:bn(r,s),bu(t,e),e.tag=1,Dt(r)?(t=!0,Ku(e)):t=!1,Gi(e,n),Hx(e,r,s),Uh(e,r,s,n),Hh(null,e,r,!0,t,n);case 19:return Zx(t,e,n);case 22:return Qx(t,e,n)}throw Error(V(156,e.tag))};function vb(t,e){return Uw(t,e)}function ET(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ln(t,e,n,r){return new ET(t,e,n,r)}function tg(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ST(t){if(typeof t=="function")return tg(t)?1:0;if(t!=null){if(t=t.$$typeof,t===wv)return 11;if(t===xv)return 14}return 2}function hs(t,e){var n=t.alternate;return n===null?(n=ln(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Cu(t,e,n,r,s,i){var o=2;if(r=t,typeof t=="function")tg(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case Ti:return Xs(n.children,s,i,e);case _v:o=8,s|=8;break;case fh:return t=ln(12,n,e,s|2),t.elementType=fh,t.lanes=i,t;case hh:return t=ln(13,n,e,s),t.elementType=hh,t.lanes=i,t;case ph:return t=ln(19,n,e,s),t.elementType=ph,t.lanes=i,t;case Cw:return sd(n,s,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Ew:o=10;break e;case Sw:o=9;break e;case wv:o=11;break e;case xv:o=14;break e;case Gr:o=16,r=null;break e}throw Error(V(130,t==null?t:typeof t,""))}return e=ln(o,n,e,s),e.elementType=t,e.type=r,e.lanes=i,e}function Xs(t,e,n,r){return t=ln(7,t,r,e),t.lanes=n,t}function sd(t,e,n,r){return t=ln(22,t,r,e),t.elementType=Cw,t.lanes=n,t.stateNode={isHidden:!1},t}function uf(t,e,n){return t=ln(6,t,null,e),t.lanes=n,t}function cf(t,e,n){return e=ln(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function CT(t,e,n,r,s){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Vd(0),this.expirationTimes=Vd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vd(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function ng(t,e,n,r,s,i,o,a,l){return t=new CT(t,e,n,a,l),e===1?(e=1,i===!0&&(e|=8)):e=0,i=ln(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Dv(i),t}function kT(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_b)}catch(t){console.error(t)}}_b(),_w.exports=Zt;var _l=_w.exports;const wb=aw(_l);var xb,Sy=_l;xb=Sy.createRoot,Sy.hydrateRoot;var lc=["light","dark"],og="(prefers-color-scheme: dark)",OT=typeof window>"u",ag=g.createContext(void 0),MT={setTheme:t=>{},themes:[]},NT=()=>{var t;return(t=g.useContext(ag))!=null?t:MT},AT=t=>g.useContext(ag)?t.children:g.createElement(LT,{...t}),$T=["light","dark"],LT=({forcedTheme:t,disableTransitionOnChange:e=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:s="theme",themes:i=$T,defaultTheme:o=n?"system":"light",attribute:a="data-theme",value:l,children:u,nonce:c})=>{let[d,f]=g.useState(()=>Cy(s,o)),[h,_]=g.useState(()=>Cy(s)),p=l?Object.values(l):i,y=g.useCallback(b=>{let E=b;if(!E)return;b==="system"&&n&&(E=ky());let S=l?l[E]:E,k=e?FT():null,C=document.documentElement;if(a==="class"?(C.classList.remove(...p),S&&C.classList.add(S)):S?C.setAttribute(a,S):C.removeAttribute(a),r){let I=lc.includes(o)?o:null,P=lc.includes(E)?E:I;C.style.colorScheme=P}k==null||k()},[]),v=g.useCallback(b=>{let E=typeof b=="function"?b(b):b;f(E);try{localStorage.setItem(s,E)}catch{}},[t]),m=g.useCallback(b=>{let E=ky(b);_(E),d==="system"&&n&&!t&&y("system")},[d,t]);g.useEffect(()=>{let b=window.matchMedia(og);return b.addListener(m),m(b),()=>b.removeListener(m)},[m]),g.useEffect(()=>{let b=E=>{if(E.key!==s)return;let S=E.newValue||o;v(S)};return window.addEventListener("storage",b),()=>window.removeEventListener("storage",b)},[v]),g.useEffect(()=>{y(t??d)},[t,d]);let x=g.useMemo(()=>({theme:d,setTheme:v,forcedTheme:t,resolvedTheme:d==="system"?h:d,themes:n?[...i,"system"]:i,systemTheme:n?h:void 0}),[d,v,t,h,n,i]);return g.createElement(ag.Provider,{value:x},g.createElement(jT,{forcedTheme:t,disableTransitionOnChange:e,enableSystem:n,enableColorScheme:r,storageKey:s,themes:i,defaultTheme:o,attribute:a,value:l,children:u,attrs:p,nonce:c}),u)},jT=g.memo(({forcedTheme:t,storageKey:e,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:i,value:o,attrs:a,nonce:l})=>{let u=i==="system",c=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(_=>`'${_}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,d=s?lc.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",f=(_,p=!1,y=!0)=>{let v=o?o[_]:_,m=p?_+"|| ''":`'${v}'`,x="";return s&&y&&!p&&lc.includes(_)&&(x+=`d.style.colorScheme = '${_}';`),n==="class"?p||v?x+=`c.add(${m})`:x+="null":v&&(x+=`d[s](n,${m})`),x},h=t?`!function(){${c}${f(t)}}()`:r?`!function(){try{${c}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${u})){var t='${og}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f("dark")}}else{${f("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}${u?"":"else{"+f(i,!1,!1)+"}"}${d}}catch(e){}}()`:`!function(){try{${c}var e=localStorage.getItem('${e}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}else{${f(i,!1,!1)};}${d}}catch(t){}}();`;return g.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:h}})}),Cy=(t,e)=>{if(OT)return;let n;try{n=localStorage.getItem(t)||void 0}catch{}return n||e},FT=()=>{let t=document.createElement("style");return t.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},ky=t=>(t||(t=window.matchMedia(og)),t.matches?"dark":"light"),O=typeof window<"u"?window:void 0,wt=typeof globalThis<"u"?globalThis:O,kt=wt==null?void 0:wt.navigator,D=wt==null?void 0:wt.document,Ae=wt==null?void 0:wt.location,lg=wt==null?void 0:wt.fetch,rp=wt!=null&&wt.XMLHttpRequest&&"withCredentials"in new wt.XMLHttpRequest?wt.XMLHttpRequest:void 0,Py=wt==null?void 0:wt.AbortController,DT=wt==null?void 0:wt.CompressionStream,Mt=kt==null?void 0:kt.userAgent;function bb(){return!(!O||O.navigator.onLine===!1)}var Yo=typeof globalThis<"u"?globalThis:O;Yo&&typeof self>"u"&&(Yo.self=Yo),Yo&&typeof File>"u"&&(Yo.File=function(){});var J=O??{},Ce={DEBUG:!1,LIB_VERSION:"0.5.1",LIB_NAME:"browser-common"};function Ry(t,e,n,r,s,i,o){try{var a=t[i](o),l=a.value}catch(u){return void n(u)}a.done?e(l):Promise.resolve(l).then(r,s)}function Pe(t){return function(){var e=this,n=arguments;return new Promise(function(r,s){var i=t.apply(e,n);function o(l){Ry(i,r,s,o,a,"next",l)}function a(l){Ry(i,r,s,o,a,"throw",l)}o(void 0)})}}function L(){return L=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},L.apply(null,arguments)}function Eb(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}var Ty=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function Iy(t){return typeof t=="string"||t}function Oy(t){return typeof t=="string"?t:void 0}var Xo,zT=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],cr=function(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.AiCaptureQueue="ai_capture_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.PushRegistered="push_registered",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t}({}),My=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),BT=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],UT=["token"],Sb="NativeGzipValidationError",sp=t=>t.length>=2&&t[0]===31&&t[1]===139,Ny=(t,e)=>t===My.GZipJS||e===My.GZipJS||e==="gzip",Ay=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError",Wl=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=Sb,e},VT=function(){var t=Pe(function*(e,n){18>e.size&&Wl("too-short");var r=new Uint8Array(yield e.slice(0,10).arrayBuffer());sp(r)&&r[2]===8||Wl("invalid-header");var s=new DataView(yield e.slice(e.size-8).arrayBuffer());s.getUint32(0,!0)!==(o=>{for(var a=(()=>{if(Xo)return Xo;Xo=[];for(var c=0;256>c;c++){for(var d=c,f=0;8>f;f++)d=1&d?3988292384^d>>>1:d>>>1;Xo[c]=d>>>0}return Xo})(),l=4294967295,u=0;o.length>u;u++)l=a[255&(l^o[u])]^l>>>8;return(4294967295^l)>>>0})(n)&&Wl("invalid-crc");var i=n.length>>>0;s.getUint32(4,!0)!==i&&Wl("invalid-size")});return function(e,n){return t.apply(this,arguments)}}();function ip(){return ip=Pe(function*(t,e,n){e===void 0&&(e=!0);try{var r=new TextEncoder().encode(t),s=new globalThis.CompressionStream("gzip"),i=s.writable.getWriter(),o=i.write(r).then(()=>i.close()).catch(function(){var u=Pe(function*(c){try{yield i.abort(c)}catch{}throw c});return function(c){return u.apply(this,arguments)}}()),a=new Response(s.readable).blob(),l=(yield Promise.all([a,o]))[0];return yield VT(l,r),l}catch(u){if(n!=null&&n.rethrow)throw u;return e&&console.error("Failed to gzip compress data",u),null}}),ip.apply(this,arguments)}var qT=20,Cb=1e3,HT=1e4,WT="[Circular]",op="[Truncated]",ud="[Unserializable]",GT="[Function]";function Qi(t){for(var e="",n=0;t.length>n;n++){var r=t.charCodeAt(n);if(55296>r||r>56319)e+=56320>r||r>57343?t[n]:"�";else{var s=t.charCodeAt(n+1);56320>s||s>57343?e+="�":(e+=t[n]+t[n+1],n++)}}return e}var KT=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],$y=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return KT.concat(e).some(r=>{var s=r.toLowerCase();return n.indexOf(s)!==-1})};function ee(t,e){return t.indexOf(e)!==-1}var cd=function(t){return t.trim()},ap=function(t){return t.replace(/^\$/,"")};function kb(t){var e,n=[];return(e=JSON.stringify(t,function(r,s){if(typeof s=="bigint")return s.toString();if(typeof s!="function"&&typeof s!="symbol"){if(s instanceof Error)return{name:s.name,message:s.message,stack:s.stack};if(s&&typeof s=="object"){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(s))return"[Circular]";n.push(s)}return s}}))!==null&&e!==void 0?e:"null"}var Pb=Object.prototype,Rb=Pb.hasOwnProperty,dd=Pb.toString,te=Array.isArray||function(t){return dd.call(t)==="[object Array]"},yt=t=>typeof t=="function",ke=t=>t===Object(t)&&!te(t),Tn=t=>{if(ke(t)){for(var e in t)if(Rb.call(t,e))return!1;return!0}return!1},F=t=>t===void 0,he=t=>dd.call(t)=="[object String]",uc=t=>he(t)&&t.trim().length===0,it=t=>t===null,re=t=>F(t)||it(t),Ke=t=>dd.call(t)=="[object Number]"&&t==t,or=t=>Ke(t)&&t>0,$t=t=>dd.call(t)==="[object Boolean]",QT=t=>t instanceof FormData,YT=t=>ee(BT,t),XT=t=>ee(UT,t);function Tb(t){return t===null||typeof t!="object"}function cc(t,e){return{}.toString.call(t)==="[object "+e+"]"}function Ib(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return Ob(t,Error)}}function ug(t){return typeof Event<"u"&&Ob(t,Event)}function Ob(t,e){try{return t instanceof e}catch{return!1}}var JT=[!0,"true",1,"1","yes"],df=t=>ee(JT,t),ZT=[!1,"false",0,"0","no"];function Qn(t,e,n,r,s){return e>n&&(r.warn("min cannot be greater than max."),e=n),Ke(t)?t>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):e>t?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+s),Qn(s||n,e,n,r))}class eI{constructor(e){this.k={},this.S=e.S,this.C=Qn(e.bucketSize,0,100,e.I),this.R=Qn(e.refillRate,0,this.C,e.I),this.A=Qn(e.refillInterval,0,864e5,e.I)}O(e,n){var r=Math.floor((n-e.lastAccess)/this.A);r>0&&(e.tokens=Math.min(e.tokens+r*this.R,this.C),e.lastAccess=e.lastAccess+r*this.A)}consumeRateLimit(e){var n,r=Date.now(),s=String(e),i=this.k[s];return i?this.O(i,r):this.k[s]=i={tokens:this.C,lastAccess:r},i.tokens===0||(i.tokens--,i.tokens===0&&((n=this.S)==null||n.call(this,e)),i.tokens===0)}stop(){this.k={}}}var Yt="Mobile",dc="iOS",_r="Android",xo="Tablet",Mb=_r+" "+xo,Nb="iPad",Ab="Apple",$b=Ab+" Watch",Ca="Safari",bo="BlackBerry",Lb="Samsung",jb=Lb+"Browser",Fb=Lb+" Internet",Js="Chrome",tI=Js+" OS",Db=Js+" "+dc,cg="Internet Explorer",zb=cg+" "+Yt,dg="Opera",nI=dg+" Mini",fg="Edge",Bb="Microsoft "+fg,Yi="Firefox",Ub=Yi+" "+dc,Qa="Nintendo",Ya="PlayStation",Xi="Xbox",Vb=_r+" "+Yt,qb=Yt+" "+Ca,da="Windows",lp=da+" Phone",Ly="Nokia",up="Ouya",Hb="Generic",rI=Hb+" "+Yt.toLowerCase(),Wb=Hb+" "+xo.toLowerCase(),cp="Konqueror",Gb="Oculus Browser",fc="Vivaldi",Kb="Yandex",hc="Whale",dp="DuckDuckGo",Qb="Pale Moon",pc="Waterfox",ka="Brave",Yb="Google Search App",Fe="(\\d+(\\.\\d+)?)",ff=new RegExp("Version/"+Fe),sI=new RegExp(Xi,"i"),iI=new RegExp(Ya+" \\w+","i"),oI=new RegExp(Qa+" \\w+","i"),hg=new RegExp(bo+"|PlayBook|BB10","i"),aI={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},Xb=function(t,e,n,r){e=e||"";var s=function(i){return i!=null&&i.brave?ka:null}(n);return s||(r!=null&&r.detectGoogleSearchApp&&ee(t,"GSA/")?Yb:ee(t," OPR/")&&ee(t,"Mini")?nI:ee(t," OPR/")?dg:hg.test(t)?bo:ee(t,"IE"+Yt)||ee(t,"WPDesktop")?zb:ee(t,"OculusBrowser")?Gb:ee(t,jb)?Fb:ee(t,fg)||ee(t,"Edg/")?Bb:ee(t,fc+"/")?fc:ee(t,"YaBrowser/")?Kb:ee(t,hc+"/")?hc:ee(t,dp+"/")||ee(t,"Ddg/")?dp:ee(t,"FBIOS")?"Facebook "+Yt:ee(t,"UCWEB")||ee(t,"UCBrowser")?"UC Browser":ee(t,"CriOS")?Db:ee(t,"CrMo")||ee(t,Js)?Js:ee(t,_r)&&ee(t,Ca)?Vb:ee(t,"FxiOS")?Ub:ee(t.toLowerCase(),cp.toLowerCase())?cp:ee(t,ka+"/")?ka:((i,o)=>o&&ee(o,Ab)||function(a){return ee(a,Ca)&&!ee(a,Js)&&!ee(a,_r)}(i))(t,e)?ee(t,Yt)?qb:Ca:ee(t,"PaleMoon/")?Qb:ee(t,pc+"/")?pc:ee(t,Yi)?Yi:ee(t,"MSIE")||ee(t,"Trident/")?cg:ee(t,"Gecko")?Yi:"")},lI={[zb]:[new RegExp("rv:"+Fe)],[Bb]:[new RegExp(fg+"?\\/"+Fe)],[Js]:[new RegExp("("+Js+"|CrMo)\\/"+Fe)],[Db]:[new RegExp("CriOS\\/"+Fe)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Fe)],[Ca]:[ff],[qb]:[ff],[dg]:[new RegExp("(Opera|OPR)\\/"+Fe)],[Yi]:[new RegExp(Yi+"\\/"+Fe)],[Ub]:[new RegExp("FxiOS\\/"+Fe)],[cp]:[new RegExp("Konqueror[:/]?"+Fe,"i")],[bo]:[new RegExp(bo+" "+Fe),ff],[Vb]:[new RegExp("android\\s"+Fe,"i")],[Fb]:[new RegExp(jb+"\\/"+Fe)],[Gb]:[new RegExp("OculusBrowser\\/"+Fe)],[fc]:[new RegExp(fc+"\\/"+Fe)],[Kb]:[new RegExp("YaBrowser\\/"+Fe)],[hc]:[new RegExp(hc+"\\/"+Fe)],[ka]:[new RegExp(ka+"\\/"+Fe)],[dp]:[new RegExp("(DuckDuckGo|Ddg)\\/"+Fe)],[Qb]:[new RegExp("PaleMoon\\/"+Fe)],[pc]:[new RegExp(pc+"\\/"+Fe)],[Yb]:[new RegExp("GSA\\/"+Fe)],[cg]:[new RegExp("(rv:|MSIE )"+Fe)],Mozilla:[new RegExp("rv:"+Fe)]},uI=function(t,e,n,r){var s=Xb(t,e,n,r),i=lI[s];if(F(i))return null;for(var o=0;i.length>o;o++){var a=t.match(i[o]);if(a)return parseFloat(a[a.length-2])}return null},jy=[[new RegExp(Xi+"; "+Xi+" (.*?)[);]","i"),t=>[Xi,t&&t[1]||""]],[new RegExp(Qa,"i"),[Qa,""]],[new RegExp(Ya,"i"),[Ya,""]],[hg,[bo,""]],[new RegExp(da,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[lp,""];if(new RegExp(Yt).test(e)&&!/IEMobile\b/.test(e))return[da+" "+Yt,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var r=aI[n[1]]||"";return/arm/i.test(e)&&(r="RT"),[da,r]}return[da,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[dc,[t[3],t[4],t[5]||"0"].join(".")]:[dc,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=F(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+_r+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+_r+")","i"),t=>t&&t[2]?[_r,[t[2],t[3],t[4]||"0"].join(".")]:[_r,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[tI,""]],[/Linux|debian/i,["Linux",""]]],Fy=function(t){return oI.test(t)?Qa:iI.test(t)?Ya:sI.test(t)?Xi:new RegExp(up,"i").test(t)?up:new RegExp("("+lp+"|WPDesktop)","i").test(t)?lp:/iPad/.test(t)?Nb:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?$b:hg.test(t)?bo:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Ly,"i").test(t)?Ly:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(Yt).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?_r:Mb:new RegExp("(pda|"+Yt+")","i").test(t)?rI:new RegExp(xo,"i").test(t)&&!new RegExp(xo+" pc","i").test(t)?Wb:""},cI=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Dy(t,e){return typeof(n=t)=="string"&&cI.test(n)?t:e();var n}function ms(t){return t&&t.split("#")[0]}function pg(t,e){var n=setTimeout(t,e);return n!=null&&n.unref&&(n==null||n.unref()),n}function zy(t,e,n){return Jb.apply(this,arguments)}function Jb(){return(Jb=Pe(function*(t,e,n){var r;try{return yield Promise.race([t,new Promise((s,i)=>{r=pg(()=>{try{n==null||n(),s()}catch(o){i(o)}},e)})])}finally{clearTimeout(r)}})).apply(this,arguments)}var Zb={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},dI=Zb.info,By=9223372036854776e3,fI={}.propertyIsEnumerable;function vc(t,e){try{return eE(t,e,{ancestors:new WeakSet,remainingNodes:HT},0)}catch{return[]}}function vg(t,e,n,r){if(0>=n.remainingNodes)return{stringValue:op};if(n.remainingNodes--,$t(t))return{boolValue:t};if(typeof t=="number"){if(!Number.isFinite(t))return{stringValue:String(t)};if(Number.isInteger(t)){if(Number.isSafeInteger(t))return{intValue:String(t)};if(typeof BigInt>"u")return{stringValue:String(t)};var s=BigInt(t).toString();return t>=By||-By>t?(e==null||e.debug("Attribute "+s+" is outside the int64 range; encoding it as a string"),{stringValue:s}):{intValue:s}}return{doubleValue:t}}if(typeof t=="string")return{stringValue:Qi(t)};if(typeof t=="function")return{stringValue:GT};if(typeof t=="symbol")return{stringValue:String(t)};if(typeof t=="object"&&t!==null){if(n.ancestors.has(t))return{stringValue:WT};if(r>=qT)return{stringValue:op};if(t instanceof Date){var i=t.getTime(),o=Number.isFinite(i)?t.toISOString():String(t);return{stringValue:typeof o=="string"?Qi(o):String(o)}}n.ancestors.add(t);try{try{var a=t.toJSON;if(typeof a=="function")return vg(a.call(t),e,n,r+1)}catch{}return te(t)?{arrayValue:{values:hI(t,e,n,r+1)}}:{kvlistValue:{values:eE(t,e,n,r+1)}}}finally{n.ancestors.delete(t)}}return{stringValue:Qi(String(t))}}function hI(t,e,n,r){for(var s=[],i=Math.min(t.length,Cb),o=0;i>o&&n.remainingNodes>0;o++)try{var a=o in t?t[o]:void 0;if(re(a))continue;s.push(vg(a,e,n,r))}catch{s.push({stringValue:ud})}return t.length>o&&s.push({stringValue:op}),s}function eE(t,e,n,r){var s=[];for(var i in t)if(fI.call(t,i)){if(s.length>=Cb||0>=n.remainingNodes){e==null||e.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{var o=t[i];if(it(o)||F(o))continue;s.push({key:Qi(i),value:vg(o,e,n,r)})}catch{s.push({key:Qi(i),value:{stringValue:ud}})}}return s}function pI(t){try{return Qi(String(t))}catch{return ud}}function vI(t,e,n){var r=Zb[t.level||"info"]||dI,s=r.text,i=r.number,o=String(Date.now())+"000000",a={};e.distinctId&&(a.posthogDistinctId=e.distinctId),e.sessionId&&(a.sessionId=e.sessionId),e.windowId&&(a["window.id"]=e.windowId),re(e.sessionStartTimestamp)||(a.sessionStartTimestamp=String(e.sessionStartTimestamp)),re(e.lastActivityTimestamp)||(a.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(a["url.full"]=e.currentUrl),e.screenName&&(a["screen.name"]=e.screenName),e.appState&&(a["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(a.feature_flags=e.activeFeatureFlags);var l=L({},a),u=t.attributes;if(u){var c=[];try{c=Object.keys(u)}catch{c=[]}for(var d of c){var f=void 0;try{f=u[d]}catch{f=ud}Object.defineProperty(l,d,{value:f,enumerable:!0,writable:!0,configurable:!0})}}var h={timeUnixNano:o,observedTimeUnixNano:o,severityNumber:i,severityText:s,body:{stringValue:pI(t.body)},attributes:vc(l,n)};return t.trace_id&&(h.traceId=t.trace_id),t.span_id&&(h.spanId=t.span_id),F(t.trace_flags)||(h.flags=t.trace_flags),h}function tE(t,e,n){return L({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":n})}function nE(t,e,n,r){return{resourceLogs:[{resource:{attributes:vc(e)},scopeLogs:[{scope:{name:n,version:r},logRecords:t}]}]}}let gI=class{constructor(t,e,n,r,s,i,o){var a;i===void 0&&(i=()=>Promise.resolve()),this._instance=t,this.qi=e,this.I=n,this.rn=r,this.nn=s,this.sn=i,this.an=o,this.ln=null,this.un=0,this.hn=0,this.dn=0,this.vn=0,this.cn=!1,this.fn=e.maxBufferSize,this.pn=Math.max((a=e.maxQueueSize)!==null&&a!==void 0?a:e.maxBufferSize,e.maxBufferSize),this.gn=e.flushIntervalMs,this.mn=e.maxBatchRecordsPerPost,this.yn=e.rateCapWindowMs,this.bn=e.maxLogsPerInterval}reset(){this._n(),this.ln=null,this.dn=0,this.vn=0,this.cn=!1,this.un=0,this.hn=0,this.mn=this.qi.maxBatchRecordsPerPost}onReconnect(){this.hn=0,this.wn()}captureLog(t){if(!this._instance.isDisabled&&!this._instance.optedOut&&t!=null&&t.body){var e=this.kn(t);if(e!==null)if(e.body){if(this.Sn()){var n={record:vI(e,this.rn(),this.I)};this.nn(()=>this.xn(n))}}else this.I.info("Log was rejected in beforeSend function")}}kn(t){var e=this.qi.beforeSend;if(!e)return t;var n=te(e)?e:[e],r=t;for(var s of n)try{var i=s(r);if(!i)return this.I.info("Log was rejected in beforeSend function"),null;r=i}catch(o){return this.I.error("Error in beforeSend function for log:",o),null}return r}Sn(){if(this.bn===void 0)return!0;var t=Date.now(),e=t-this.dn;return this.yn>e&&e>=0||(this.dn=t,this.vn=0,this.cn=!1),this.bn>this.vn?(this.vn++,!0):(this.cn||(this.I.warn("captureLog dropping logs: exceeded "+this.bn+" logs per "+this.yn+"ms"),this.cn=!0),!1)}flush(){var t=this;return Pe(function*(){if(!t._instance.isDisabled)return t.ln||(t.ln=t.Cn().finally(()=>{t.ln=null})),t.ln})()}Cn(){var t=this;return Pe(function*(){var e;t._n();var n=(e=t._instance.getPersistedProperty(cr.LogsQueue))!==null&&e!==void 0?e:[];if(n.length!==0)for(var r=n.length,s=0;n.length>0&&r>s;){var i,o;t.un=0;var a=Math.min(n.length,t.mn),l=n.slice(0,a),u=nE(l.map(d=>d.record),t.Tn(),(i=t.an)!==null&&i!==void 0?i:t._instance.getLibraryId(),t._instance.getLibraryVersion()),c=yield t._instance.Mn(u);if(c.kind==="too-large"&&l.length>1)t.mn=Math.max(1,Math.floor(l.length/2)),t.I.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+t.mn);else if(c.kind==="retry-later"||(c.kind==="too-large"?t.I.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):c.kind==="ok"&&t.qi.maxBatchRecordsPerPost>t.mn&&(t.mn=Math.min(t.qi.maxBatchRecordsPerPost,t.mn+1)),yield t.En(l.length),n=(o=t._instance.getPersistedProperty(cr.LogsQueue))!==null&&o!==void 0?o:[],s+=l.length,c.kind==="fatal"))throw c.error}})()}En(t){var e=this;return Pe(function*(){var n,r=Math.max(0,t-e.un),s=(n=e._instance.getPersistedProperty(cr.LogsQueue))!==null&&n!==void 0?n:[];e._instance.setPersistedProperty(cr.LogsQueue,s.slice(r)),yield e.sn()})()}Tn(){return tE(this.qi,this._instance.getLibraryId(),this._instance.getLibraryVersion())}xn(t){var e;if(!this._instance.optedOut){var n=(e=this._instance.getPersistedProperty(cr.LogsQueue))!==null&&e!==void 0?e:[];this.pn>n.length||(n.shift(),this.un++,this.I.info("Logs queue is full, dropping oldest record.")),n.push(t),this._instance.setPersistedProperty(cr.LogsQueue,n),this.fn>n.length?this.In():this.wn()}}In(t){t===void 0&&(t=this.gn),this.Rn||(this.Rn=pg(()=>{this.Rn=void 0,this.wn()},t))}Pn(){var t=Math.min(Math.max(0,this.hn-1),6);return this.gn*Math.pow(2,t)}An(){var t=this._instance.getPersistedProperty(cr.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return Pe(function*(){e._n();var n=e.flush().catch(()=>{});t!==void 0?yield zy(n,t):yield n})()}flushWithTimeout(t){var e=this;return Pe(function*(){var n=e.flush();yield zy(n,t,()=>{n.catch(()=>{})})})()}wn(){this.flush().then(()=>{this.hn=0},t=>{this.hn++,this.I.error("PostHog logs flush failed:",t)}).finally(()=>{!this._instance.isDisabled&&this.An()&&this.In(this.Pn())})}_n(){this.Rn&&(clearTimeout(this.Rn),this.Rn=void 0)}};var hf=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function Uy(t){return String(t)+"000000"}function Vy(t,e,n,r){var s="";return r&&(s=Object.keys(r).sort().map(i=>JSON.stringify(i)+":"+JSON.stringify(r[i])).join(",")),t+"\0"+e+"\0"+(n??"")+"\0"+s}let mI=class{constructor(t,e,n){this._instance=t,this.qi=e,this.I=n,this.Fn=new Map,this.ln=null,this.On=!1,this.Ln=new Map,this.$n=new Set,this.Dn=0}count(t,e,n){e===void 0&&(e=1),this.Nn({name:t,type:"count",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}gauge(t,e,n){this.Nn({name:t,type:"gauge",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}histogram(t,e,n){this.Nn({name:t,type:"histogram",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}flush(){var t=this,e=this.ln,n=function(){var s=Pe(function*(){e&&(yield e.catch(()=>{})),yield t.qn()});return function(){return s.apply(this,arguments)}}(),r=n().finally(()=>{this.ln===r&&(this.ln=null)});return this.ln=r,r}drainWindow(){if(this.Fn.size===0)return null;var t=this.Fn;return this.Fn=new Map,this.On=!1,this.Ln=new Map,this.$n=new Set,this.jn(t)}reset(){this.Dn++,this._n(),this.Fn=new Map,this.ln=null,this.On=!1,this.Ln=new Map,this.$n=new Set}Nn(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.kn(t);if(e!==null)if(e.name&&typeof e.name=="string")if(typeof e.value=="number"&&Number.isFinite(e.value))if(e.type==="count"&&0>e.value)this.I.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var n,r;try{n=e.attributes?L({},e.attributes):void 0,r=Vy(e.type,e.name,e.unit,n)}catch(o){return void this.I.warn("Dropping metric '"+e.name+"': attributes could not be serialized",o)}var s=this.Fn.get(r);if(!s){if(!this.Bn())return;s={name:e.name,type:e.type,unit:e.unit,attributes:n,windowStartMs:Date.now()},this.Fn.set(r,s)}var i=this.Ln.get(e.name);i===void 0?this.Ln.set(e.name,e.type):i===e.type||this.$n.has(e.name)||(this.$n.add(e.name),this.I.warn("Metric name '"+e.name+"' is already used as a "+i+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name.")),this.Hn(s,e.value),this.In()}else this.I.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.I.warn("Dropping metric with empty name")}}Bn(){return this.qi.maxSeriesPerFlush>this.Fn.size||(this.On||(this.On=!0,this.I.warn("Metric series cap reached ("+this.qi.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Hn(t,e){var n;switch(t.type){case"count":t.total=((n=t.total)!==null&&n!==void 0?n:0)+e;break;case"gauge":t.last=e;break;case"histogram":t.hist||(t.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array(hf.length+1).fill(0)});var r=t.hist;r.count+=1,r.sum+=e,r.min=Math.min(r.min,e),r.max=Math.max(r.max,e),r.bucketCounts[function(s,i){for(var o=0;i.length>o;o++)if(i[o]>=s)return o;return i.length}(e,hf)]+=1}}kn(t){var e=this.qi.beforeSend;if(!e)return t;var n=te(e)?e:[e],r=t;for(var s of n)try{var i=s(r);if(!i)return this.I.info("Metric was rejected in beforeSend function"),null;r=i}catch(o){return this.I.error("Error in beforeSend function for metric:",o),null}return r}In(){this.Rn||(this.Rn=pg(()=>{this.Rn=void 0,this.flush().catch(t=>{this.I.error("Metrics flush failed:",t)})},this.qi.flushIntervalMs))}_n(){this.Rn&&(clearTimeout(this.Rn),this.Rn=void 0)}qn(){var t=this;return Pe(function*(){if(t.Fn.size!==0){var e=t.Fn;t.Fn=new Map,t.On=!1,t.Ln=new Map,t.$n=new Set;var n=t.Dn,r=yield t._instance.Un(t.jn(e));if(n===t.Dn)switch(r.kind){case"ok":return;case"retry-later":return t.zn(e),void t.In();case"too-large":return void t.I.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.I.error("Failed to send metrics batch:",r.error)}}})()}jn(t){return e=this.Wn(t),n=function(i,o,a){return L({},i.resourceAttributes,{"service.name":i.serviceName||"unknown_service"},i.environment&&{"deployment.environment":i.environment},i.serviceVersion&&{"service.version":i.serviceVersion},{"telemetry.sdk.name":o,"telemetry.sdk.version":a})}(this.qi,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:vc(n)},scopeMetrics:[{scope:{name:r,version:s},metrics:e}]}]};var e,n,r,s}Wn(t){var e=Uy(Date.now()),n=new Map;for(var r of t.values()){var s,i=Vy(r.type,r.name,r.unit,void 0),o=n.get(i);o||(o=L({name:r.name},r.unit&&{unit:r.unit}),r.type==="count"?o.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:r.type==="gauge"?o.gauge={dataPoints:[]}:o.histogram={aggregationTemporality:1,dataPoints:[]},n.set(i,o));var a=vc((s=r.attributes)!==null&&s!==void 0?s:{},this.I),l=Uy(r.windowStartMs);if(r.type==="count"){var u,c={attributes:a,startTimeUnixNano:l,timeUnixNano:e,asDouble:(u=r.total)!==null&&u!==void 0?u:0};o.sum.dataPoints.push(c)}else if(r.type==="gauge"){var d,f={attributes:a,timeUnixNano:e,asDouble:(d=r.last)!==null&&d!==void 0?d:0};o.gauge.dataPoints.push(f)}else r.hist&&o.histogram.dataPoints.push({attributes:a,startTimeUnixNano:l,timeUnixNano:e,count:r.hist.count,sum:r.hist.sum,min:r.hist.min,max:r.hist.max,bucketCounts:r.hist.bucketCounts,explicitBounds:hf})}return Array.from(n.values())}zn(t){var e,n;for(var r of t){var s=r[0],i=r[1],o=this.Fn.get(s);if(o)switch(o.windowStartMs=Math.min(o.windowStartMs,i.windowStartMs),o.type){case"count":o.total=((e=o.total)!==null&&e!==void 0?e:0)+((n=i.total)!==null&&n!==void 0?n:0);break;case"gauge":break;case"histogram":if(i.hist)if(o.hist){o.hist.count+=i.hist.count,o.hist.sum+=i.hist.sum,o.hist.min=Math.min(o.hist.min,i.hist.min),o.hist.max=Math.max(o.hist.max,i.hist.max);for(var a=0;o.hist.bucketCounts.length>a;a++)o.hist.bucketCounts[a]+=i.hist.bucketCounts[a]}else o.hist=i.hist}else this.Bn()&&this.Fn.set(s,i)}}};var Gl,qy,pf;function yI(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return pf&&n.length===qy||(qy=n.length,pf=n.reduce((r,s)=>{Gl||(Gl={});var i=Gl[s];if(i)r[i[0]]=i[1];else for(var o=t(s),a=o.length-1;a>=0;a--){var l=o[a],u=l==null?void 0:l.filename,c=e[s];if(u&&c){r[u]=c,Gl[s]=[u,c];break}}return r},{})),pf}}class _I{constructor(e,n,r){r===void 0&&(r=[]),this.coercers=e,this.stackParser=n,this.modifiers=r}buildFromUnknown(e,n){n===void 0&&(n={});var r=n&&n.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(r,n,0).apply(e),i=this.buildParsingContext(n),o=this.parseStacktrace(s,i);return{$exception_list:this.convertToExceptionList(o,r),$exception_level:"error"}}modifyFrames(e){var n=this;return Pe(function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&te(r.stacktrace.frames)&&(r.stacktrace.frames=yield n.applyModifiers(r.stacktrace.frames));return e})()}coerceFallback(e){var n;return{type:"Error",value:"Unknown error",stack:(n=e.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(e,n){var r,s;return e.cause!=null&&(r=this.parseStacktrace(e.cause,n)),e.stack!=""&&e.stack!=null&&(s=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?n.skipFirstLines:0),n.chunkIdMap)),L({},e,{cause:r,stack:s})}applyChunkIds(e,n){return e.map(r=>(r.filename&&n&&(r.chunk_id=n[r.filename]),r))}applyCoercers(e,n){for(var r of this.coercers)if(r.match(e))return r.coerce(e,n);return this.coerceFallback(n)}applyModifiers(e){var n=this;return Pe(function*(){var r=e;for(var s of n.modifiers)r=yield s(r);return r})()}convertToExceptionList(e,n){var r,s,i,o={type:e.type,value:e.value,mechanism:{type:(r=n.type)!==null&&r!==void 0?r:"generic",handled:(s=n.handled)===null||s===void 0||s,synthetic:(i=e.synthetic)!==null&&i!==void 0&&i}};e.stack&&(o.stacktrace={type:"raw",frames:e.stack});var a=[o];return e.cause!=null&&a.push(...this.convertToExceptionList(e.cause,L({},n,{handled:!0}))),a}buildParsingContext(e){var n;return{chunkIdMap:yI(this.stackParser),skipFirstLines:(n=e.skipFirstLines)!==null&&n!==void 0?n:1}}buildCoercingContext(e,n,r){r===void 0&&(r=0);var s=(i,o)=>{if(4>=o){var a=this.buildCoercingContext(e,n,o);return this.applyCoercers(i,a)}};return L({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:e,apply:i=>s(i,r),next:i=>s(i,r+1)})}}var Eo="?";function fp(t,e,n,r,s){var i={platform:t,filename:e,function:n===""?Eo:n,in_app:!(e!=null&&e.startsWith("webkit-masked-url://"))&&e!==""};return F(r)||(i.lineno=r),F(s)||(i.colno=s),i}var rE=(t,e)=>{var n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:Eo,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},wI=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,xI=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,bI=/\((\S*)(?::(\d+))(?::(\d+))\)/,EI=(t,e)=>{var n=wI.exec(t);if(n)return fp(e,n[1],Eo,+n[2],+n[3]);var r=xI.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){var s=bI.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}var i=rE(r[1]||Eo,r[2]);return fp(e,i[1],i[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},SI=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,CI=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,kI=(t,e)=>{var n=SI.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=CI.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var s=n[3],i=n[1]||Eo,o=rE(i,s);return fp(e,s=o[1],i=o[0],n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},Hy=/\(error: (.*)\)/;class PI{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var r=he(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var n=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?n+": "+e.message:n}isDOMException(e){return cc(e,"DOMException")}isDOMError(e){return cc(e,"DOMError")}}class RI{match(e){return Ib(e)}coerce(e,n){var r,s=this.getStack(e),i=s===void 0;return{type:this.getType(e),value:this.getMessage(e,n),stack:s??((r=n.syntheticException)==null?void 0:r.stack),cause:e.cause?n.next(e.cause):void 0,synthetic:i}}getType(e){return e.name||e.constructor.name}getMessage(e,n){var r=e.message;return String(r.error&&typeof r.error.message=="string"?r.error.message:r)}getStack(e){return e.stacktrace||e.stack||void 0}}class TI{constructor(){}match(e){return!!cc(e,"ErrorEvent")&&(e.error!=null||this.fi(e))}coerce(e,n){var r;if(e.error!=null)return n.apply(e.error);var s=n.apply(e.message);return L({},s,{stack:(r=this.pi(e))!==null&&r!==void 0?r:s.stack,synthetic:!0})}fi(e){return he(e.message)&&e.message.length>0}pi(e){var n,r,s=e,i=(n=s.lineno)!==null&&n!==void 0?n:0,o=(r=s.colno)!==null&&r!==void 0?r:0;if(he(s.filename)&&s.filename.length!==0&&i!==0)return`Error - at `+s.filename+":"+i+":"+o}}var II=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class OI{match(e){return typeof e=="string"}coerce(e,n){var r,s=this.getInfos(e),i=s[0],o=s[1];return{type:i??"Error",value:o??e,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(e){var n="Error",r=e,s=e.match(II);return s&&(n=s[1],r=s[2]),[n,r]}}var MI=["fatal","error","warning","log","info","debug"];function sE(t,e){e===void 0&&(e=40);var n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var s=n.slice(0,r).join(", ");if(e>=s.length)return r===n.length?s:s.length>e?s.slice(0,e)+"...":s}return""}class NI{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var r,s,i=this.getErrorPropertyFromObject(e);return i?n.apply(i):{type:this.getType(e),value:this.getValue(e),stack:(r=this.getStack(e))!==null&&r!==void 0?r:(s=n.syntheticException)==null?void 0:s.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){if(ug(e))return e.constructor.name;var n="name"in e?e.name:void 0;return he(n)&&!uc(n)?n:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var n="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(n+=" with message: '"+e.message+"'"),n}if("message"in e&&typeof e.message=="string")return e.message;var r=this.getObjectClassName(e);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+sE(e)}isSeverityLevel(e){return he(e)&&!uc(e)&&MI.indexOf(e)>=0}getStack(e){try{return he(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:he(e.stack)&&e.stack.length>0?e.stack:void 0}catch{return}}getErrorPropertyFromObject(e){for(var n in e)if({}.hasOwnProperty.call(e,n)){var r=e[n];if(Ib(r))return r}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}}class AI{match(e){return ug(e)}coerce(e,n){var r,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+sE(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class $I{match(e){return Tb(e)}coerce(e,n){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class LI{match(e){return cc(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!ug(e))return!1;try{var n=e.detail;return n!=null&&typeof n=="object"&&"reason"in n}catch{return!1}}coerce(e,n){var r,s=this.getUnhandledRejectionReason(e);return Tb(s)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(s),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}:n.apply(s)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&e.detail!=null&&typeof e.detail=="object"&&"reason"in e.detail)return e.detail.reason}catch{}return e}}var gc="$message",mc="$timestamp",jI=new Set([gc,mc]),vf={enabled:!0,max_bytes:32768};function yc(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:vf.enabled,max_bytes:DI(t.max_bytes,vf.max_bytes)}:L({},vf)}class FI{constructor(e){this.Vn=[],this.Gn=0,this.qi=yc(e)}setConfig(e){this.qi=yc(e),this.Zn()}add(e){var n=function(s){var i;try{i=kb(s)}catch{return}try{var o=JSON.parse(i);if(!ke(o))return;var a=o,l=a[gc],u=a[mc];return!he(l)||l.trim().length===0||!he(u)&&!Ke(u)?void 0:{step:a,json:i}}catch{return}}(e);if(n){var r=function(s){if(typeof TextEncoder<"u")return new TextEncoder().encode(s).length;for(var i=encodeURIComponent(s),o=0,a=0;i.length>a;a++)i[a]==="%"?(o+=1,a+=2):o+=1;return o}(n.json);r>this.qi.max_bytes||(this.Vn.push({step:n.step,bytes:r}),this.Gn+=r,this.Zn())}}getAttachable(){return this.Vn.map(e=>e.step)}clear(){this.Vn=[],this.Gn=0}size(){return this.Vn.length}Zn(){for(;this.Gn>this.qi.max_bytes&&this.Vn.length>0;){var e=this.Vn.shift();e&&(this.Gn-=e.bytes)}}}function DI(t,e){if(!Ke(t)||t===1/0||t===-1/0)return e;var n=Math.floor(t);return 0>n?e:n}var iE=function(t,e){var n=(e===void 0?{}:e).debugEnabled,r={F(s){if(O&&(Ce.DEBUG||O.POSTHOG_DEBUG||n)&&!F(O.console)&&O.console){for(var i=("__rrweb_original__"in O.console[s])?O.console[s].__rrweb_original__:O.console[s],o=arguments.length,a=new Array(o>1?o-1:0),l=1;o>l;l++)a[l-1]=arguments[l];i(t,...a)}},debug(){for(var s=arguments.length,i=new Array(s),o=0;s>o;o++)i[o]=arguments[o];r.F("debug",...i)},info(){for(var s=arguments.length,i=new Array(s),o=0;s>o;o++)i[o]=arguments[o];r.F("log",...i)},warn(){for(var s=arguments.length,i=new Array(s),o=0;s>o;o++)i[o]=arguments[o];r.F("warn",...i)},error(){for(var s=arguments.length,i=new Array(s),o=0;s>o;o++)i[o]=arguments[o];r.F("error",...i)},critical(){for(var s=arguments.length,i=new Array(s),o=0;s>o;o++)i[o]=arguments[o];console.error(t,...i)},uninitializedWarning(s){r.error("You must initialize PostHog before calling "+s)},createLogger:(s,i)=>iE(t+" "+s,i)};return r},U=iE("[PostHog.js]"),Oe=U.createLogger,zI=Oe("[ExternalScriptsLoader]"),_c=t=>{var e=D==null?void 0:D.querySelectorAll("script");if(e){for(var n=0;e.length>n;n++)if(e[n].src===t||e[n].getAttribute("src")===t)return e[n]}},As=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return zI.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=_c(e);if(r){if(r.__posthog_loading_callback_fired)return n();var s=r.__posthog_loading_error;return s?n(s):(r.addEventListener("load",o=>{r.__posthog_loading_callback_fired=!0,n(void 0,o)}),void r.addEventListener("error",o=>{r.__posthog_loading_error=o,n(o)}))}var i=()=>{if(!D)return n("document not found");if(_c(e))return As(t,e,n);var o=D.createElement("script");if(o.type="text/javascript",o.crossOrigin="anonymous",o.src=e,o.onload=u=>{o.__posthog_loading_callback_fired=!0,n(void 0,u)},o.onerror=u=>{o.__posthog_loading_error=u,n(u)},t.config.prepare_external_dependency_script&&(o=t.config.prepare_external_dependency_script(o)),!o)return n("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")D.head.appendChild(o);else{var a,l=D.querySelectorAll("body > script");l.length>0?(a=l[0].parentNode)==null||a.insertBefore(o,l[0]):D.body.appendChild(o)}};D!=null&&D.body?i():D==null||D.addEventListener("DOMContentLoaded",i)},gf={},Wy=(t,e)=>{var n="/static/"+e+".js?v="+t.version;if(e==="toolbar"){var r=3e5;n=n+"&t="+Math.floor(Date.now()/r)*r}return t.requestRouter.endpointFor("assets",n)};J.__PosthogExtensions__=J.__PosthogExtensions__||{},J.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{if(e!=="remote-config"){var r=t.config.strict_script_versioning;if(r){var s=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js"),i=gf[s];if(r==="fallback"&&i){if(_c(i))return void As(t,i,n);delete gf[s]}As(t,s,r==="fallback"?(a,l)=>{if(a)if(typeof a=="string")n(a);else{var u,c=Wy(t,e);gf[s]=c;var d=_c(s);d==null||(u=d.parentNode)==null||u.removeChild(d),As(t,c,n)}else n(void 0,l)}:n)}else As(t,Wy(t,e),n)}else{var o=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");As(t,o,n)}},J.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var r=t.requestRouter.endpointFor("api",e);As(t,r,n)};Ce.DEBUG=!1,Ce.LIB_VERSION="1.418.16",Ce.LIB_NAME="web";var oE="$people_distinct_id",bt="distinct_id",Xa="$device_id",mf="$device_model",zi="__alias",fa="__timers",hp="$autocapture_disabled_server_side",pp="$heatmaps_enabled_server_side",vp="$exception_capture_enabled_server_side",gp="$error_tracking_suppression_rules",mp="$error_tracking_capture_extension_exceptions",yp="$web_vitals_enabled_server_side",gg="$dead_clicks_enabled_server_side",mg="$product_tours_enabled_server_side",_p="$web_vitals_allowed_metrics",Bs="$session_recording_remote_config",aE="$replay_sample_rate",lE="$replay_override_sampling",uE="$replay_override_linked_flag",cE="$replay_override_url_trigger",dE="$replay_override_event_trigger",Bi="$sesid",yg="$session_is_sampled",fr="$enabled_feature_flags",Us="$active_feature_flags",ku="$early_access_features",Ja="$feature_flag_details",Vs="$feature_flag_payloads",Ji="$feature_flag_request_id",wc="$minimal_flag_called_events",Dn="$override_feature_flags",$s="$override_feature_flag_payloads",En="$stored_person_properties",Wn="$stored_group_properties",fE="$groups",wp="$surveys",xc="$surveys_loaded_at",xp="$surveys_activated",Pu="$surveys_activated_session",Ru="$surveys_activated_timestamps",ha="ph_product_tours",pr="$flag_call_reported",pa="$flag_call_reported_session_id",Zi="$feature_flag_errors",Zs="$feature_flag_evaluated_at",ue="$user_state",bp="$client_session_props",Ep="$capture_rate_limit",Sp="$initial_campaign_params",Cp="$initial_referrer_info",bc="$initial_person_info",Ec="$epp",mi="$posthog_cookieless",hE="$cookieless_mode",pE="$sdk_debug_extensions_init_method",vE="$sdk_debug_extensions_init_time_ms",kp="$sdk_debug_recording_script_not_loaded",_g="PostHog loadExternalDependency extension not found.",Ls="on_reject",vr="always",We="anonymous",dt="identified",Pp="identified_only",Sc="visibilitychange",Cc="beforeunload",ki="$pageview",yf="$pageleave",_f="$identify",Gy="$groupidentify";function Kl(t,e){te(t)&&t.forEach(e)}function ye(t,e){if(!re(t))if(te(t))t.forEach(e);else if(QT(t))t.forEach((r,s)=>e(r,s));else for(var n in t)Rb.call(t,n)&&e(t[n],n)}var xe=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];for(var s of n)for(var i in s)s[i]!==void 0&&(t[i]=s[i]);return t};function Tu(t){for(var e=Object.keys(t),n=e.length,r=new Array(n);n--;)r[n]=[e[n],t[e[n]]];return r}var Ky=function(t){try{return t()}catch{return}},BI=function(t){return function(){try{for(var e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];return t.apply(this,n)}catch(s){U.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),U.critical(s)}}},wg=function(t){var e={};return ye(t,function(n,r){(he(n)&&n.length>0||Ke(n))&&(e[r]=n)}),e},UI=["herokuapp.com","vercel.app","netlify.app"];function VI(t){var e=t==null?void 0:t.hostname;if(!he(e))return!1;var n=e.split(".").slice(-2).join(".");for(var r of UI)if(n===r)return!1;return!0}function Te(t,e,n,r){var s=r??{},i=s.capture,o=s.passive;t==null||t.addEventListener(e,n,{capture:i!==void 0&&i,passive:o===void 0||o})}function Rp(t){return t.name==="ph_toolbar_internal"}var gE=t=>{if(D){try{for(var e=t+"=",n=D.cookie.split(";").filter(i=>i.length),r=0;n.length>r;r++){for(var s=n[r];s.charAt(0)==" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return decodeURIComponent(s.substring(e.length,s.length))}}catch{}return null}};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return Ke(t)&&isFinite(t)&&Math.floor(t)===t});class kc{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,r,s){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(s)||0>e||0>n||0>r||0>s||e>0xffffffffffff||n>4095||r>1073741823||s>4294967295)throw new RangeError("invalid field value");var i=new Uint8Array(16);return i[0]=e/Math.pow(2,40),i[1]=e/Math.pow(2,32),i[2]=e/Math.pow(2,24),i[3]=e/Math.pow(2,16),i[4]=e/256,i[5]=e,i[6]=112|n>>>8,i[7]=n,i[8]=128|r>>>24,i[9]=r>>>16,i[10]=r>>>8,i[11]=r,i[12]=s>>>24,i[13]=s>>>16,i[14]=s>>>8,i[15]=s,new kc(i)}toString(){for(var e="",n=0;this.bytes.length>n;n++)e=e+(this.bytes[n]>>>4).toString(16)+(15&this.bytes[n]).toString(16),n!==3&&n!==5&&n!==7&&n!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new kc(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var n=0;16>n;n++){var r=this.bytes[n]-e.bytes[n];if(r!==0)return Math.sign(r)}return 0}}class qI{generate(){var e=this.generateOrAbort();if(!F(e))return e;this.Rr=0;var n=this.generateOrAbort();if(F(n))throw new Error("Could not generate UUID after timestamp reset");return n}generateOrAbort(){var e=Date.now();if(e>this.Rr)this.Rr=e,this.Ar();else{if(this.Rr>=e+1e4)return;this.Lr++,this.Lr>4398046511103&&(this.Rr++,this.Ar())}return kc.fromFieldsV7(this.Rr,Math.trunc(this.Lr/Math.pow(2,30)),this.Lr&Math.pow(2,30)-1,this.Or.nextUint32())}Ar(){this.Lr=1024*this.Or.nextUint32()+(1023&this.Or.nextUint32())}constructor(){this.Rr=0,this.Lr=0,this.Or=new HI}}var Qy,mE=t=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};O&&!F(O.crypto)&&crypto.getRandomValues&&(mE=t=>crypto.getRandomValues(t));class HI{nextUint32(){return this.ft.length>this.Fr||(mE(this.ft),this.Fr=0),this.ft[this.Fr++]}constructor(){this.ft=new Uint32Array(8),this.Fr=1/0}}var Un=()=>WI().toString(),WI=()=>(Qy||(Qy=new qI)).generate(),Jo="",GI=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,Qe={Dr:()=>!!D,jr(t){U.error("cookieStore error: "+t)},Pr:gE,Br(t){var e;try{e=JSON.parse(Qe.Pr(t))||{}}catch{}return e},Nr(t,e,n,r,s){if(!D)return!1;try{var i="",o="",a=function(c,d){if(d){var f=function(_,p){if(p===void 0&&(p=D),Jo)return Jo;if(!p||["localhost","127.0.0.1"].includes(_))return"";for(var y=_.split("."),v=Math.min(y.length,8),m="dmn_chk_"+Un();!Jo&&v--;){var x=y.slice(v).join("."),b=m+"=1;domain=."+x+";path=/";p.cookie=b+";max-age=3",p.cookie.includes(m)&&(p.cookie=b+";max-age=0",Jo=x)}return Jo}(c);if(!f){var h=(_=>{var p=_.match(GI);return p?p[0]:""})(c);h!==f&&U.info("Warning: cookie subdomain discovery mismatch",h,f),f=h}return f?"; domain=."+f:""}return""}(D.location.hostname,r);if(n){var l=new Date;l.setTime(l.getTime()+864e5*n),i="; expires="+l.toUTCString()}s&&(o="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+i+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&U.warn("cookieStore warning: large cookie, len="+u.length),D.cookie=u,!0}catch{return!1}},qr(t,e){if(D!=null&&D.cookie)try{Qe.Nr(t,"",-1,e)}catch{return}}},wf=null,we={Dr(){if(!it(wf))return wf;var t=!0;if(F(O))t=!1;else try{var e="__mplssupport__";we.Nr(e,"xyz"),we.Pr(e)!=='"xyz"'&&(t=!1),we.qr(e)}catch{t=!1}return t||U.error("localStorage unsupported; falling back to cookie store"),wf=t,t},jr(t){U.error("localStorage error: "+t)},Pr(t){try{return O==null?void 0:O.localStorage.getItem(t)}catch(e){we.jr(e)}return null},Br(t){try{return JSON.parse(we.Pr(t))||{}}catch{}return null},Nr(t,e){try{return O==null||O.localStorage.setItem(t,JSON.stringify(e)),!0}catch(n){we.jr(n)}return!1},qr(t){try{O==null||O.localStorage.removeItem(t)}catch(e){we.jr(e)}}},xf=[En,Us,fr,Ja,Vs,Ji,Zs,Zi,pr],js=[Xa,bt,Bi,yg,Ec,bc,ue],Pc=t=>t+"_cpm",KI=["__proto__","constructor","prototype"],bf=t=>{if(!ke(t))return{};var e={};return Object.keys(t).forEach(n=>{KI.indexOf(n)===-1&&(e[n]=t[n])}),e},Ef=function(t,e){e===void 0&&(e=[]);var n={};return[...js,...e].forEach(r=>{var s=t[r];F(s)||it(s)||s===""||(n[r]=s)}),n},yE=t=>{for(var e=5381,n=2166136261,r=0;t.length>r;r++){var s=t.charCodeAt(r);e=33*e^s,n=Math.imul(n^s,16777619)}return t.length.toString(36)+"."+(e>>>0).toString(36)+"."+(n>>>0).toString(36)},Yy=(t,e)=>({p:e,f:yE(JSON.stringify(t))}),Xy=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{var n=Qe.Br(Pc(t)),r=(n==null?void 0:n.f)===yE(e)&&te(n.p);return{properties:r?n.p:[],isValid:r}}catch{return{properties:[],isValid:!1}}},Sf=(t,e)=>e+"|"+(Qe.Pr(Pc(t))||""),Ql={},QI={Dr:()=>!0,jr(t){U.error("memoryStorage error: "+t)},Pr:t=>Ql[t]||null,Br:t=>Ql[t]||null,Nr:(t,e)=>(Ql[t]=e,!0),qr(t){delete Ql[t]}},Ps=null,be={Dr(){if(!it(Ps))return Ps;if(Ps=!0,F(O))Ps=!1;else try{var t="__support__";be.Nr(t,"xyz"),be.Pr(t)!=='"xyz"'&&(Ps=!1),be.qr(t)}catch{Ps=!1}return Ps},jr(t){U.error("sessionStorage error: ",t)},Pr(t){try{return O==null?void 0:O.sessionStorage.getItem(t)}catch(e){be.jr(e)}return null},Br(t){try{return JSON.parse(be.Pr(t))||null}catch{}return null},Nr(t,e){try{return O==null||O.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(n){be.jr(n)}return!1},qr(t){try{O==null||O.sessionStorage.removeItem(t)}catch(e){be.jr(e)}}};class YI{constructor(e){this._instance=e}get qi(){return this._instance.config}get consent(){return this.cs()?0:this.fs}isOptedOut(){return this.qi.cookieless_mode===vr||this.isRejected()||this.consent===-1&&this.qi.cookieless_mode===Ls}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.qi.opt_out_capturing_by_default}optInOut(e){this.ps.Nr(this.gs,e?1:0,this.qi.cookie_expiration,this.qi.cross_subdomain_cookie,this.qi.secure_cookie)}reset(){this.ps.qr(this.gs,this.qi.cross_subdomain_cookie)}get gs(){var e=this._instance.config,n=e.token,r=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(r?r+n:"__ph_opt_in_out_"+n)}get fs(){var e=this.ps.Pr(this.gs);return df(e)?1:ee(ZT,e)?0:-1}get ps(){var e=this.qi.opt_out_capturing_persistence_type,n=e==="localStorage"?we:Qe;if(!this.ys||this.ys!==n){this.ys=n;var r=e==="localStorage"?Qe:we;r.Pr(this.gs)&&(this.ys.Pr(this.gs)||this.optInOut(df(r.Pr(this.gs))),r.qr(this.gs,this.qi.cross_subdomain_cookie))}return this.ys}cs(){return!!this.qi.respect_dnt&&[kt==null?void 0:kt.doNotTrack,kt==null?void 0:kt.msDoNotTrack,J.doNotTrack].some(e=>df(e))}}function _E(t,e){var n,r=t==null||(n=t.config)==null?void 0:n.get_current_url;if(!yt(r))return e;try{var s=r(e);return he(s)&&s?s:e}catch(i){return U.error("Error in get_current_url, falling back to window.location.href",i),e}}var wE="__POSTHOG_TOOLBAR__",XI=1,JI=3,ZI=11;function Jy(t){return t instanceof Element&&(t.id===wE||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function ys(t){return!!t&&t.nodeType===XI}function Kt(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function xE(t){return!!t&&t.nodeType===JI}function bE(t){return!!t&&t.nodeType===ZI&&ys(t.host)}var EE=1e3;function xg(t){return t?cd(t).split(/\s+/):[]}function Zy(t,e){var n=function(r){var s,i=O==null||(s=O.location)==null?void 0:s.href;return F(i)?void 0:_E(r,i)}(e);return!!(n&&t&&t.some(r=>n.match(r)))}function Rc(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return xg(e)}function SE(t){return re(t)?null:cd(t).split(/(\s+)/).filter(e=>Pa(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Za(t){var e="";return Op(t)&&!TE(t)&&t.childNodes&&t.childNodes.length&&ye(t.childNodes,function(n){var r;xE(n)&&n.textContent&&(e+=(r=SE(n.textContent))!==null&&r!==void 0?r:"")}),cd(e)}function Tp(t){var e;return F(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var bg=["a","button","form","input","select","textarea","label"];function Ip(t,e){if(F(e))return!0;var n,r=function(i){if(e.some(o=>function(a,l){var u=a.matches||a.matchesSelector||a.msMatchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.oMatchesSelector;try{return!!u&&u.call(a,l)}catch{return!1}}(i,o)))return{v:!0}};for(var s of t)if(n=r(s))return n.v;return!1}function CE(t){var e=t.parentNode;return!(!e||!ys(e))&&e}var eO=[".ph-no-autocapture","[data-ph-no-autocapture]"],kE=["next","previous","prev",">","<"],tO=[...kE,"+","-","−","–"],e_=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,t_=[".ph-no-rageclick",".ph-no-capture"],nO=["","text","search","email","password","url","tel","number"];function PE(t,e){if(!O||Eg(t))return!1;var n,r,s,i,o;if($t(e)?(n=!!e&&t_,r=void 0,s=!1):(n=(i=e==null?void 0:e.css_selector_ignorelist)!==null&&i!==void 0?i:t_,r=e==null?void 0:e.content_ignorelist,s=(o=e==null?void 0:e.ignore_text_selection)!==null&&o!==void 0&&o),n===!1||s&&function(l){return!(!l||!ys(l))&&(!!Kt(l,"textarea")||(Kt(l,"input")?ee(nO,(l.getAttribute("type")||"").toLowerCase()):function(u){if(u.isContentEditable)return!0;var c=u.getAttribute==null?void 0:u.getAttribute("contenteditable");return c==="true"||c===""}(l)))}(t))return!1;var a=RE(t,!1).targetElementList;return!function(l,u){if(l===!1||F(l))return!1;var c;if(l===!0)c=kE;else{if(!te(l))return!1;if(l.length>10)return U.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;c=l.map(d=>d.toLowerCase())}return u.some(d=>{var f=d.safeText,h=d.ariaLabel;return c.some(_=>e_(f,_)||e_(h,_))})}(r,a.map(l=>{var u;return{safeText:Za(l).toLowerCase(),ariaLabel:((u=l.getAttribute("aria-label"))==null?void 0:u.toLowerCase().trim())||""}}))&&!Ip(a,n)}var Eg=t=>!t||Kt(t,"html")||!ys(t),RE=(t,e)=>{if(!O||Eg(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[t],s=t;s.parentNode&&!Kt(s,"body");)if(bE(s.parentNode))r.push(s.parentNode.host),s=s.parentNode.host;else{var i=CE(s);if(!i)break;if(e||bg.indexOf(i.tagName.toLowerCase())>-1)n=!0;else try{var o=O.getComputedStyle(i);o&&o.getPropertyValue("cursor")==="pointer"&&(n=!0)}catch{}r.push(i),s=i}return{parentIsUsefulElement:n,targetElementList:r}};function Op(t){for(var e=new Set,n=0,r=t;r.parentNode&&!Kt(r,"body");r=r.parentNode){if(n++>=EE||e.has(r))return!1;e.add(r);var s=Rc(r);if(ee(s,"ph-sensitive")||ee(s,"ph-no-capture"))return!1}if(ee(Rc(t),"ph-include"))return!0;var i=t.type||"";if(he(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var o=t.name||t.id||"";return!he(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,""))}function TE(t){return!!(Kt(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Kt(t,"select")||Kt(t,"textarea")||t.getAttribute("contenteditable")==="true")}var n_=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),r_=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,rO=[16,15,14,13],sO=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),s_=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),i_=/[0-9A-Za-z_]/;function iO(t){for(var e=0,n=!1,r=t.length-1;r>=0;r--){var s=t.charCodeAt(r)-48;n&&(s*=2)>9&&(s-=9),e+=s,n=!n}return e%10==0}function Pa(t,e){if(e===void 0&&(e=!0),re(t))return!1;if(he(t)){t=cd(t);var n=e?n_.test((t||"").replace(/[- ]/g,"")):function(s){var i;for(r_.lastIndex=0;i=r_.exec(s);){var o=i[2];if(o)for(var a=o.replace(/[- ]/g,""),l=0;a.length>l;l++)for(var u of rO){var c=l+u;if(a.length>=c){var d=a.slice(l,c);if(n_.test(d)&&iO(d))return!0}}}return!1}(t);if(n)return!1;var r=e?sO.test(t):function(s){var i;for(s_.lastIndex=0;i=s_.exec(s);){var o=i[1],a=i[3];if(!(o&&a&&i_.test(o)&&i_.test(a)))return!0}return!1}(t);if(r)return!1}return!0}function o_(t){var e=Za(t);return Pa(e=(e+" "+IE(t)).trim())?e:""}function IE(t){var e="";return t&&t.childNodes&&t.childNodes.length&&ye(t.childNodes,function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var s=Za(n);e=(e+" "+s).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+IE(n)).trim())}catch(i){U.error("[AutoCapture]",i)}}),e}function a_(t){return t.replace(/"|\\"/g,'\\"')}function oO(t){var e=t.attr__class;if(e)return te(e)?e:xg(e)}var Yl=Oe("[Dead Clicks]"),aO=()=>!0,lO=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(gg)),r=t.instance.config.capture_dead_clicks;return $t(r)?r:!!ke(r)||n};class l_{get lazyLoadedDeadClicksAutocapture(){return this.bs}constructor(e,n,r){this.instance=e,this.isEnabled=n,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(e){if(e.ok){var n=e.config;"captureDeadClicks"in n&&(this.instance.persistence&&this.instance.persistence.register({[gg]:n.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this._s(()=>{this.ws()}):this.stop()}_s(e){var n,r;(n=J.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture?e():(r=J.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",s=>{s?Yl.error("failed to load script",s):e()})}ws(){var e;if(D){if(!this.bs&&(e=J.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=ke(this.instance.config.capture_dead_clicks)?L({},this.instance.config.capture_dead_clicks):{};n.__onCapture=this.onCapture,this.onCapture&&(n.capture_dead_swipes=!1),this.bs=J.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.bs.start(D),Yl.info("starting...")}}else Yl.error("`document` not found. Cannot start.")}stop(){this.bs&&(this.bs.stop(),this.bs=void 0,Yl.info("stopping..."))}}var Cf=Oe("[SegmentIntegration]"),OE="posthog-js";function ME(t,e){var n=e===void 0?{}:e,r=n.organization,s=n.projectId,i=n.prefix,o=n.severityAllowList,a=o===void 0?["error"]:o,l=n.sendExceptionsToPostHog,u=l===void 0||l;return c=>{var d,f,h,_,p;if(a!=="*"&&!a.includes(c.level)||!t.__loaded)return c;c.tags||(c.tags={});var y=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());c.tags["PostHog Person URL"]=y,t.sessionRecordingStarted()&&(c.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var v,m=((d=c.exception)==null?void 0:d.values)||[],x=m.map(E=>L({},E,{stacktrace:E.stacktrace?L({},E.stacktrace,{type:"raw",frames:(E.stacktrace.frames||[]).map(S=>L({},S,{platform:"web:javascript"}))}):void 0})),b={$exception_message:((f=m[0])==null?void 0:f.value)||c.message,$exception_type:(h=m[0])==null?void 0:h.type,$exception_level:c.level,$exception_list:x,$sentry_event_id:c.event_id,$sentry_exception:c.exception,$sentry_exception_message:((_=m[0])==null?void 0:_.value)||c.message,$sentry_exception_type:(p=m[0])==null?void 0:p.type,$sentry_tags:c.tags};return r&&s&&(b.$sentry_url=(i||"https://sentry.io/organizations/")+r+"/issues/?project="+s+"&query="+c.event_id),u&&((v=t.exceptions)==null||v.sendExceptionEvent(b)),c}}class uO{constructor(e,n,r,s,i,o){this.name=OE,this.setupOnce=function(a){a(ME(e,{organization:n,projectId:r,prefix:s,severityAllowList:i,sendExceptionsToPostHog:o==null||o}))}}}class u_{constructor(e){this.ks=(n,r,s)=>{s&&(s.noSessionId||s.activityTimeout||s.sessionPastMaximumLength||s.crossTabAdoption)&&(U.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:s}),this.Ss=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.xs()}xs(){var e;this.Cs=(e=this._instance.sessionManager)==null?void 0:e.onSessionId(this.ks)}destroy(){var e;(e=this.Cs)==null||e.call(this),this.Cs=void 0}doPageView(e,n){var r,s=this.Ts(e,n);return this.Ss={pathname:(r=O==null?void 0:O.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var n;return this.Ts(e,(n=this.Ss)==null?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Ss)==null?void 0:e.pageViewId}}Ts(e,n){var r=this.Ss;if(!r)return{$pageview_id:n};var s={$pageview_id:n,$prev_pageview_id:r.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var o=i.maxScrollHeight,a=i.lastScrollY,l=i.maxScrollY,u=i.maxContentHeight,c=i.lastContentY,d=i.maxContentY;if(!(F(o)||F(a)||F(l)||F(u)||F(c)||F(d))){o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c),d=Math.ceil(d);var f=o>1?Qn(a/o,0,1,U):1,h=o>1?Qn(l/o,0,1,U):1,_=u>1?Qn(c/u,0,1,U):1,p=u>1?Qn(d/u,0,1,U):1;s=xe(s,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:f,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:h,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:_,$prev_pageview_max_content:d,$prev_pageview_max_content_percentage:p})}}return r.pathname&&(s.$prev_pageview_pathname=r.pathname),r.timestamp&&(s.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),s}}var kf=["flags","surveys"],cO={[oE]:{exposure:"hidden"},[zi]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[fa]:{exposure:"hidden"},[hp]:{exposure:"event"},[pp]:{exposure:"hidden"},[vp]:{exposure:"event"},[gp]:{exposure:"hidden"},[mp]:{exposure:"event"},[yp]:{exposure:"event"},[gg]:{exposure:"event"},[mg]:{exposure:"hidden"},[_p]:{exposure:"event"},[Bs]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Bi]:{exposure:"hidden"},[yg]:{exposure:"event"},[aE]:{exposure:"event",shouldSkipFromEventProperties:t=>it(t)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[fr]:{exposure:"hidden",storageGroup:"flags"},[Us]:{exposure:"hidden",storageGroup:"flags"},[ku]:{exposure:"hidden"},[Ja]:{exposure:"hidden",storageGroup:"flags"},[Vs]:{exposure:"hidden",storageGroup:"flags"},[Ji]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[wc]:{exposure:"hidden",storageGroup:"flags"},[Dn]:{exposure:"hidden"},[$s]:{exposure:"hidden"},[En]:{exposure:"hidden"},[Wn]:{exposure:"hidden"},[wp]:{exposure:"hidden",storageGroup:"surveys"},[xc]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[xp]:{exposure:"event"},[Pu]:{exposure:"hidden"},[Ru]:{exposure:"hidden"},[ha]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[pr]:{exposure:"hidden"},[pa]:{exposure:"hidden"},[fE]:{exposure:"event"},[Zi]:{exposure:"hidden"},[Zs]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[ue]:{exposure:"hidden"},[bp]:{exposure:"hidden"},[Ep]:{exposure:"hidden"},[Sp]:{exposure:"hidden"},[Cp]:{exposure:"hidden"},[bc]:{exposure:"hidden"},[Ec]:{exposure:"hidden"},[lE]:{exposure:"event"},[uE]:{exposure:"event"},[cE]:{exposure:"event"},[dE]:{exposure:"event"},[pE]:{exposure:"event"},[vE]:{exposure:"event"},[kp]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_pending_trigger_conditions:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},dO=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],zn=t=>{var e=cO[t];if(e)return e;for(var n of dO){var r=n[1];if(t.indexOf(n[0])===0)return r}},Ui=(t,e)=>{try{return JSON.stringify(t,(n,r)=>typeof r=="bigint"?r.toString():r,e)}catch{return kb(t)}},So=t=>{var e=D==null?void 0:D.createElement("a");return F(e)?null:(e.href=t,e)},Co=function(t,e){for(var n,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;r.length>s;s++){var i=r[s].split("=");if(i[0]===e){n=i;break}}if(!te(n)||2>n.length)return"";var o=n[1];try{o=decodeURIComponent(o)}catch{U.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},el=function(t,e,n){if(!t||!e||!e.length)return t;for(var r=t.split("#"),s=r[1],i=(r[0]||"").split("?"),o=i[1],a=i[0],l=(o||"").split("&"),u=[],c=0;l.length>c;c++){var d=l[c].split("=");te(d)&&(e.includes(d[0])?u.push(d[0]+"="+n):u.push(l[c]))}var f=a;return o!=null&&(f+="?"+u.join("&")),s!=null&&(f+="#"+s),f},Tc=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},NE=(t,e)=>t>=e&&bb(),AE=(t,e,n,r)=>{if(t===0){if(bb()){var s=e+1;return s===n&&r(),s}return e}return 0},Xl="https?://(.*)",ko=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],fO=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...ko],tl="",hO=["li_fat_id"];function $E(t,e,n){if(!D)return{};var r,s=e?[...ko,...n||[]]:[],i=LE(el(D.URL,s,tl),t),o=(r={},ye(hO,function(a){var l=gE(a);r[a]=l||null}),r);return xe(o,i)}function LE(t,e){var n=fO.concat(e||[]),r={};return ye(n,function(s){var i=Co(t,s);r[s]=i||null}),r}function jE(t){var e=function(i){return i?i.search(Xl+"google.([^/?]*)")===0?"google":i.search(Xl+"bing.com")===0?"bing":i.search(Xl+"yahoo.com")===0?"yahoo":i.search(Xl+"duckduckgo.com")===0?"duckduckgo":null:null}(t),n=e!="yahoo"?"q":"p",r={};if(!it(e)){r.$search_engine=e;var s=D?Co(D.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function c_(){return navigator.language||navigator.userLanguage}var Ic="$direct";function FE(){return(D==null?void 0:D.referrer)||Ic}function DE(t,e,n){n===void 0&&(n=!1);var r=t?[...ko,...e||[]]:[],s=n?ms(Ae==null?void 0:Ae.href):Ae==null?void 0:Ae.href,i=s==null?void 0:s.substring(0,1e3);return{r:FE().substring(0,1e3),u:i?el(i,r,tl):void 0}}function zE(t,e){var n;e===void 0&&(e=!1);var r=t.r,s=t.u,i=e?ms(s):s,o={$referrer:r,$referring_domain:r==null?void 0:r==Ic?Ic:(n=So(r))==null?void 0:n.host};if(i){o.$current_url=i;var a=So(i);o.$host=a==null?void 0:a.host,o.$pathname=a==null?void 0:a.pathname;var l=LE(i);xe(o,l)}if(r){var u=jE(r);xe(o,u)}return o}function BE(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function pO(){try{return new Date().getTimezoneOffset()}catch{return}}var vO={flags:Zs,surveys:xc},gO=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Jl=t=>t+"_cookie_identity_change_pending",zr="main",d_=(t,e)=>{ye(t,(n,r)=>{var s=zn(r);s&&s.exposure!=="event"||{}.hasOwnProperty.call(e,r)||delete t[r]})};class Pf{constructor(e,n,r){if(r===void 0&&(r=!0),this.Ms={},this.Es=!1,this.Is=!1,this.Rs=!1,this.Ps=!1,this.qi=e,this.As=r,this.props={},this.Fs=void 0,this.Os=(i=>{var o="";return i.token&&(o=i.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),i.persistence_name?"ph_"+i.persistence_name:"ph_"+o+"_posthog"})(e),this.ps=this.Ls(e),this.Is=this.$s(e),this.load(),e.debug&&U.info("Persistence loaded",e.persistence,L({},this.props)),this.update_config(e,e,n),this.save(),O){var s=()=>this.flush();Te(O,"beforeunload",s,{capture:!1}),Te(O,"pagehide",s,{capture:!1})}}Ds(){var e,n=(e=this.qi)==null?void 0:e.persistence_save_debounce_ms;return Ke(n)&&n>0?n:0}Ns(e){if(this.qi.cookieWinsOnConflict&&this.qi.persistence.toLowerCase()==="localstorage+cookie")if(e)try{var n=Ef(e,this.qi.cookie_persisted_properties||[]),r=Yy(n,this.qi.cookie_persisted_properties||[]),s=JSON.stringify(n)+"|"+JSON.stringify(r),i=Qe.Pr(this.Os)||void 0;i&&Sf(this.Os,i)===s&&(this.qs=s,this.js=i)}catch{}else try{var o=Qe.Pr(this.Os)||void 0;this.qs=o?Sf(this.Os,o):void 0,this.js=o}catch{}}syncCookieProperties(){return this.Bs(this.qi)}Bs(e,n){if(n===void 0&&(n=!1),this.Hs&&!n||this.Ps||!e.cookieWinsOnConflict||e.persistence.toLowerCase()!=="localstorage+cookie")return!1;var r;try{r=Qe.Pr(this.Os)||void 0}catch{}if(!r||r===this.js)return!1;var s,i=Sf(this.Os,r);try{s=bf(JSON.parse(r))}catch{return!1}if((Qe.Pr(this.Os)||void 0)!==r)return!1;this.qs=i,this.js=r;var o=Xy(this.Os,r),a=[...js,...o.properties],l={};if(Object.keys(s).forEach(p=>{var y=s[p];(F(y)||it(y)||y===""||p===ue&&y!==We&&y!==dt)&&(l[p]=!0,delete s[p])}),Tn(s))return!1;var u=bt in s||s[ue]===We||s[ue]===dt,c=this.props[bt],d=this.props[ue],f=xe({},this.props);[...js,...e.cookie_persisted_properties||[]].forEach(p=>{if(a.indexOf(p)!==-1&&!(p in s)&&!l[p]&&(u||p!==bt&&p!==ue)){var y=f[p];!o.isValid&&js.indexOf(p)!==-1&&(y===!1||y===0)||delete f[p]}}),this.props=xe(f,s),!u||ue in s||ue in this.props||this.Us(ue,We);var h=this.props[bt],_=this.props[ue];return!u||h===c&&_===d||(this.Rs=!0,be.Nr(Jl(this.Os),!0),this.zs(En),this.zs(Us),this.zs(fr),this.zs(Ja),this.zs(Vs),this.zs(Ji),this.zs(Zs),this.zs(Zi),this.zs(pr),_===We&&(d===dt||s[ue]===We||!F(c)&&h!==c)&&(d_(this.props,s),this.zs(Wn)),_===dt?this.props.$user_id=h:delete this.props.$user_id,this.zs(zi)),!0}consumeCookieIdentityChange(){var e=Jl(this.Os),n=this.Rs||!!be.Pr(e);return this.Rs=!1,n&&be.qr(e),n}Ws(e){return e===void 0&&(e=!1),!(this.Ps||this.Hs&&!e||!this.qi.cookieWinsOnConflict||this.qi.persistence.toLowerCase()!=="localstorage+cookie"||(this.Ps=!0,0))}Vs(){this.Ps&&(F(this.Gs)||(clearTimeout(this.Gs),this.Gs=void 0),delete this.Ms[zr],this.Zs(!0))}Qs(e){if(e===void 0&&(e=!0),this.Ps)try{e?this.Vs():F(this.Gs)||(clearTimeout(this.Gs),this.Gs=void 0)}finally{this.Ps=!1}}isDisabled(){return!!this.Hs}Ls(e){gO.indexOf(e.persistence.toLowerCase())===-1&&(U.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n,r=function(o,a){o===void 0&&(o=[]),a===void 0&&(a=!1);var l=[...js,...o];return L({},we,{Br(u){try{var c,d={};try{c=Qe.Pr(u)||void 0,d=c?bf(JSON.parse(c)):{}}catch{}var f,h=JSON.parse(we.Pr(u)||"{}");if(a){var _=Xy(u,c),p=[...js,..._.properties],y={};Object.keys(d).forEach(E=>{var S=d[E];it(S)||S===""||E===ue&&S!==We&&S!==dt||(y[E]=S)});var v=bt in y||y[ue]===We||y[ue]===dt;if(Object.keys(y).length>0){var m,x=h[bt],b=(m=h[ue])!==null&&m!==void 0?m:We;l.forEach(E=>{if(p.indexOf(E)!==-1&&!(E in d)&&(v||E!==bt&&E!==ue)){var S=h[E];!_.isValid&&js.indexOf(E)!==-1&&(S===!1||S===0)||delete h[E]}}),!v||ue in d||ue in h||(h[ue]=We),!v||(bt in y?y[bt]:h[bt])===x&&(ue in y?y[ue]:h[ue])===b||(xf.forEach(E=>delete h[E]),y[ue]===dt&&bt in y?h.$user_id=y[bt]:delete h.$user_id,y[ue]!==dt&&(delete h[fE],delete h[Wn]),delete h.__alias)}f=xe(h,y)}else f=xe(d,h);return we.Nr(u,f),f}catch{}return null},Nr(u,c,d,f,h,_){var p=we.Nr(u,c,void 0,void 0,_);try{var y=Ef(c,o);if(Object.keys(y).length){if(a){var v=Pc(u),m=Yy(y,o);if(Qe.Nr(v,m,d,f,h,_),Qe.Pr(v)!==JSON.stringify(m)){Qe.qr(v,f);var x=Ef(c);return Qe.Nr(u,x,d,f,h,_),p}}Qe.Nr(u,y,d,f,h,_)}}catch(b){we.jr(b)}return p},qr(u,c){try{O==null||O.localStorage.removeItem(u),Qe.qr(u,c),Qe.qr(Pc(u),c)}catch(d){we.jr(d)}}})}(e.cookie_persisted_properties||[],e.cookieWinsOnConflict),s=!1,i=e.persistence.toLowerCase();return i==="localstorage"&&we.Dr()?(n=we,s=!0):i==="localstorage+cookie"&&r.Dr()?(n=r,s=!0):i==="sessionstorage"&&be.Dr()?n=be:i==="memory"?n=QI:i==="cookie"?n=Qe:r.Dr()?(n=r,s=!0):n=Qe,this.Es=s,n}Js(e){return this.Os+"__"+e}$s(e){return this.Es&&!!e.split_storage}properties(){var e={};return ye(this.props,(n,r)=>{var s=zn(r);if(!s||s.exposure==="event"){if(s!=null&&s.shouldSkipFromEventProperties!=null&&s.shouldSkipFromEventProperties(n))return;e[r]=n}}),e}load(e){if(e===void 0&&(e=!1),!this.Hs||e){var n=this.qi.cookieWinsOnConflict&&this.qi.persistence.toLowerCase()==="localstorage+cookie",r=n?we.Br(this.Os):null,s={};if(n)try{ye(s=bf(Qe.Br(this.Os)),(_,p)=>{(F(_)||it(_)||_==="")&&delete s[p]})}catch{}var i=this.ps.Br(this.Os);if(i&&(this.props=xe({},i)),this.Is&&this.Ks(),n&&i){var o,a,l=r==null?void 0:r[bt],u=(o=r==null?void 0:r[ue])!==null&&o!==void 0?o:We,c=i[bt],d=(a=i[ue])!==null&&a!==void 0?a:We;if(c!==l||d!==u){this.Rs=!0,be.Nr(Jl(this.Os),!0);var f=xe({},this.props);xf.forEach(_=>delete f[_]),d===We&&(u===dt||s[ue]===We||!F(l)&&c!==l)&&(d_(f,s),delete f[Wn]),this.props=f;var h=new Set;xf.forEach(_=>{var p,y=(p=zn(_))==null?void 0:p.storageGroup;y&&h.add(y)}),h.forEach(_=>{var p={};ye(this.props,(y,v)=>{var m;((m=zn(v))==null?void 0:m.storageGroup)===_&&(p[v]=y)}),Tn(p)?(we.qr(this.Js(_)),this.Ms[_]={}):we.Nr(this.Js(_),p)&&(this.Ms[_]={persisted:!0,fingerprint:this.Ys(p,_)})})}}be.Pr(Jl(this.Os))&&(this.Rs=!0)}}Ks(){for(var e of kf){var n=we.Br(this.Js(e));if(n&&!Tn(n)){var r=this.Xs(e);r.persisted=!0,this.ta(e)||(r.fingerprint=this.Ys(n,e)),this.ea(e,n)||xe(this.props,n)}}}ta(e){return Object.keys(this.props).some(n=>{var r;return((r=zn(n))==null?void 0:r.storageGroup)===e})}ea(e,n){var r=vO[e];if(!r)return!1;var s=n[r],i=this.props[r];return Ke(s)&&Ke(i)&&i>s}refreshKey(e){var n;if(!this.Hs){var r=this.Is?(n=zn(e))==null?void 0:n.storageGroup:void 0,s=r?we.Br(this.Js(r)):this.ps.Br(this.Os);if(s&&e in s)this.Us(e,s[e]);else{if(r){var i=this.ps.Br(this.Os);if(i&&e in i)return void this.Us(e,i[e])}this.zs(e)}}}save(){if(!this.Hs){var e=this.Ds();e>0?F(this.Gs)&&(this.Gs=setTimeout(()=>{this.Gs=void 0,this.Zs()},e)):this.Zs()}}flush(){F(this.Gs)||(clearTimeout(this.Gs),this.Gs=void 0,this.Zs())}Zs(e){e===void 0&&(e=!1),this.Hs||this.Ps&&!e||(e||this.syncCookieProperties(),this.Is?this.ia():this.ra(this.ps,this.Os,this.props,zr)&&this.Ns(this.props))}ia(){var e=this.na(),n=e.main,r=e.groups;for(var s of(this.ra(this.ps,this.Os,n,zr)&&this.Ns(n),kf)){var i,o=r[s];(!Tn(o)||(i=this.Ms[s])!=null&&i.persisted)&&this.ra(we,this.Js(s),o,s)}}na(){var e={},n={flags:{},surveys:{}};return ye(this.props,(r,s)=>{var i,o=(i=zn(s))==null?void 0:i.storageGroup;o?n[o][s]=r:e[s]=r}),{main:e,groups:n}}Ys(e,n){if(n===zr)return JSON.stringify(e)+"|"+this.sa+"|"+this.aa+"|"+this.oa;var r={};return ye(e,(s,i)=>{var o;r[i]=(o=zn(i))!=null&&o.volatile?"__volatile__":s}),JSON.stringify(r)}ra(e,n,r,s){var i,o=this.Xs(s);if(s!==zr&&!o.dirty&&!F(o.fingerprint))return!1;try{if((i=this.Ys(r,s))===o.fingerprint)return o.dirty=!1,!1}catch{i=void 0}return e.Nr(n,r,this.sa,this.aa,this.oa,this.qi.debug)?(o.dirty=!1,s!==zr&&(o.persisted=!0),F(i)||(o.fingerprint=i),!0):(this.qi.debug&&U.warn('failed to persist storage entry "'+n+'"; will retry on next save'),!1)}remove(e){var n=(e===void 0?{}:e).keepGroupEntries,r=n!==void 0&&n;if(F(this.Gs)||(clearTimeout(this.Gs),this.Gs=void 0),this.ps.qr(this.Os,!1),this.ps.qr(this.Os,!0),!r&&this.As)for(var s of kf)we.qr(this.Js(s));r?delete this.Ms[zr]:this.Ms={},this.qs=void 0,this.js=void 0}clear(){this.remove(),this.props={}}register_once(e,n,r){if(ke(e)){this.syncCookieProperties(),F(n)&&(n="None"),this.sa=F(r)?this.la:r;var s=!1;if(ye(e,(i,o)=>{this.props.hasOwnProperty(o)&&this.props[o]!==n||(this.Us(o,i),s=!0)}),s)return this.save(),!0}return!1}register(e,n){if(ke(e)){this.syncCookieProperties(),this.sa=F(n)?this.la:n;var r=!1;if(ye(e,(s,i)=>{e.hasOwnProperty(i)&&(this.props[i]!==s||ke(s)||te(s))&&(this.Us(i,s),r=!0)}),r)return this.save(),!0}return!1}unregister(e){this.syncCookieProperties();var n=typeof e=="string"?[e]:e,r=!1;for(var s of n)s in this.props&&(this.zs(s),r=!0);r&&this.save()}update_campaign_params(){var e=D==null?void 0:D.URL;if(e!==this.Fs){var n=$E(this.qi.custom_campaign_params,this.qi.mask_personal_data_properties,this.qi.custom_personal_data_properties);Tn(wg(n))||this.register(n),this.Fs=e}}update_search_keyword(){var e;this.register((e=D==null?void 0:D.referrer)?jE(e):{})}update_referrer_info(){var e;this.register_once({$referrer:FE(),$referring_domain:D!=null&&D.referrer&&((e=So(D.referrer))==null?void 0:e.host)||Ic},void 0)}set_initial_person_info(){this.props[Sp]||this.props[Cp]||this.register_once({[bc]:DE(this.qi.mask_personal_data_properties,this.qi.custom_personal_data_properties,this.qi.disable_capture_url_hashes)},void 0)}get_initial_props(){var e={};ye([Cp,Sp],s=>{var i=this.props[s];i&&ye(i,function(o,a){e["$initial_"+ap(a)]=o})});var n=this.props[bc];if(n){var r=function(s,i){i===void 0&&(i=!1);var o=zE(s,i),a={};return ye(o,function(l,u){a["$initial_"+ap(u)]=l}),a}(n,this.qi.disable_capture_url_hashes);xe(e,r)}return e}safe_merge(e){return ye(this.props,function(n,r){r in e||(e[r]=n)}),e}update_config(e,n,r){var s=e.persistence!==n.persistence,i=!((p,y)=>{if(p.length!==y.length)return!1;var v=[...p].sort(),m=[...y].sort();return v.every((x,b)=>x===m[b])})(e.cookie_persisted_properties||[],n.cookie_persisted_properties||[]),o=s||i,a=e.cookieWinsOnConflict!==n.cookieWinsOnConflict,l=e.disable_persistence||!!r,u=!!this.Hs&&!l;l||this.Bs(n,u),this.qi=e,!l&&(s||i||a)&&(this.qs=void 0,this.js=void 0,this.Bs(L({},e,{cookie_persisted_properties:n.cookie_persisted_properties}),u));var c=o||a?this.Ls(e):this.ps,d=this.$s(e),f=o||d!==this.Is,h=!l&&(f||e.cross_subdomain_cookie!==this.aa||e.secure_cookie!==this.oa)&&this.Ws(u);try{if(this.la=this.sa=e.cookie_expiration,this.set_disabled(l),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),f){var _=this.props;this.clear(),this.ps=c,this.Is=d,this.props=_,this.save()}else a&&(this.ps=c,l||(delete this.Ms[zr],this.Zs()))}finally{h&&this.Qs()}}set_disabled(e){this.Hs=e,this.Hs?this.remove():this.save()}set_cross_subdomain(e){e!==this.aa&&(this.aa=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.oa&&(this.oa=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,n){var r=this.props[fa]||{};r[e]=n,this.Us(fa,r),this.save()}remove_event_timer(e){var n=this.props[fa]||{},r=n[e];return F(r)||(delete n[e],this.Us(fa,n),this.save()),r}get_property(e){return this.props[e]}set_property(e,n){this.Us(e,n),this.save()}Us(e,n){var r;this.props[e]=n,(r=zn(e))!=null&&r.volatile||this.ua(e)}zs(e){delete this.props[e],this.ua(e)}ua(e){var n,r=(n=zn(e))==null?void 0:n.storageGroup;r&&(this.Xs(r).dirty=!0)}Xs(e){return this.Ms[e]||(this.Ms[e]={})}}function Zl(t){var e=!0;return{dispose(){if(e){e=!1;var n=t();n&&yt(n.then)&&n.then(void 0,()=>{})}}}}var St={GZipJS:"gzip-js",Base64:"base64"},Zo={Activation:"events",Cancellation:"cancelEvents"},Rf={Popover:"popover",API:"api",Widget:"widget"},gr={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},Tf={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},Mp={Popover:"popover",Inline:"inline"},mO={SHOWN:"product tour shown"},f_={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},h_=Oe("[RateLimiter]");class yO{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var r=n.text;if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach(s=>{h_.info((s||"events")+" is quota limited."),this.serverLimits[s]=new Date().getTime()+6e4})}catch(s){return void h_.warn('could not rate limit - continuing. Error: "'+(s==null?void 0:s.message)+'"',{text:r})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)==null?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)==null?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var n,r,s;e===void 0&&(e=!1);var i=this.captureEventsBurstLimit,o=this.captureEventsPerSecond,a=new Date().getTime(),l=(n=(r=this.instance.persistence)==null?void 0:r.get_property(Ep))!==null&&n!==void 0?n:{tokens:i,last:a};l.tokens+=(a-l.last)/1e3*o,l.last=a,l.tokens>i&&(l.tokens=i);var u=1>l.tokens;if(u||e||(l.tokens=Math.max(0,l.tokens-1)),u&&!e){var c=(Ke(l.dropped)?l.dropped:0)+1;l.dropped=c,!this.lastEventRateLimited&&this.ha(c)&&(l.dropped=0)}return this.lastEventRateLimited=u,(s=this.instance.persistence)==null||s.set_property(Ep,l),{isRateLimited:u,remainingTokens:l.tokens}}da(e){var n=this.instance.config.property_denylist;return!te(n)||!n.includes(e)}va(){var e;if(this.da("$current_url")&&this.da("$pathname")&&Ae!=null&&Ae.pathname)return""+((e=Ae.origin)!==null&&e!==void 0?e:"")+Ae.pathname}ha(e){var n,r,s=this.captureEventsBurstLimit,i=this.captureEventsPerSecond,o=this.va(),a=this.da("$session_id")?(n=(r=this.instance).get_session_id)==null?void 0:n.call(r):void 0,l=[e+" event(s) dropped since the last warning",o?"triggered on "+o:void 0,a?"session "+a:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+l+". Config is set to "+i+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()e(this.remoteConfig)):e()}fa(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:e})}load(){try{if(this.remoteConfig)return Br.info("Using preloaded remote config",this.remoteConfig),this.pa(this.remoteConfig),void this.ga();if(this._instance.ma())return void Br.warn("Remote config is disabled. Falling back to local config.");this.ca(e=>{if(!e)return Br.info("No config found after loading remote JS config. Falling back to JSON."),void this.fa(n=>{this.pa(n.json,n),this.ga()});this.pa(e),this.ga()})}catch(e){Br.error("Error loading remote config",e),this.pa()}}stop(){this.ya&&(clearInterval(this.ya),this.ya=void 0)}refresh(){!this._instance.ma()&&D&&D.visibilityState!=="hidden"&&this._instance.reloadFeatureFlags()}ga(){var e;if(!this.ya){var n=(e=this._instance.config.remote_config_refresh_interval_ms)!==null&&e!==void 0?e:3e5;n!==0&&(this.ya=setInterval(()=>{this.refresh()},n))}}pa(e,n){!e&&n&&(n.statusCode===0?n.error||Br.warn("Failed to fetch remote config from PostHog."):Br.error("Failed to fetch remote config from PostHog."));try{this._instance.pa(e?{ok:!0,config:e}:{ok:!1})}catch(s){Br.error("Error applying remote config",s)}if((e==null?void 0:e.hasFeatureFlags)!==!1&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var r;(r=this._instance.featureFlags)==null||r.ensureFlagsLoaded()}catch(s){Br.error("Error loading feature flags",s)}}}var cn=Uint8Array,jt=Uint16Array,Po=Uint32Array,Sg=new cn([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Cg=new cn([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),p_=new cn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),VE=function(t,e){for(var n=new jt(31),r=0;31>r;++r)n[r]=e+=1<r;++r)for(var i=n[r];n[r+1]>i;++i)s[i]=i-n[r]<<5|r;return[n,s]},qE=VE(Sg,2),Np=qE[1];qE[0][28]=258,Np[258]=28;for(var v_=VE(Cg,0)[1],HE=new jt(32768),$e=0;32768>$e;++$e){var yi=(43690&$e)>>>1|(21845&$e)<<1;HE[$e]=((65280&(yi=(61680&(yi=(52428&yi)>>>2|(13107&yi)<<2))>>>4|(3855&yi)<<4))>>>8|(255&yi)<<8)>>>1}var Ra=function(t,e,n){for(var r=t.length,s=0,i=new jt(e);r>s;++s)++i[t[s]-1];var o,a=new jt(e);for(s=0;e>s;++s)a[s]=a[s-1]+i[s-1]<<1;for(o=new jt(r),s=0;r>s;++s)o[s]=HE[a[t[s]-1]++]>>>15-t[s];return o},ii=new cn(288);for($e=0;144>$e;++$e)ii[$e]=8;for($e=144;256>$e;++$e)ii[$e]=9;for($e=256;280>$e;++$e)ii[$e]=7;for($e=280;288>$e;++$e)ii[$e]=8;var Oc=new cn(32);for($e=0;32>$e;++$e)Oc[$e]=5;var _O=Ra(ii,9),wO=Ra(Oc,5),WE=function(t){return(t/8>>0)+(7&t&&1)},GE=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof jt?jt:t instanceof Po?Po:cn)(n-e);return r.set(t.subarray(e,n)),r},rr=function(t,e,n){var r=e/8>>0;t[r]|=n<<=7&e,t[r+1]|=n>>>8},ea=function(t,e,n){var r=e/8>>0;t[r]|=n<<=7&e,t[r+1]|=n>>>8,t[r+2]|=n>>>16},If=function(t,e){for(var n=[],r=0;t.length>r;++r)t[r]&&n.push({s:r,f:t[r]});var s=n.length,i=n.slice();if(!s)return[new cn(0),0];if(s==1){var o=new cn(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(E,S){return E.f-S.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],u=0,c=1,d=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=s-1;)a=n[n[d].f>n[u].f?u++:d++],l=n[u!=c&&n[d].f>n[u].f?u++:d++],n[c++]={s:-1,f:a.f+l.f,l:a,r:l};var f=i[0].s;for(r=1;s>r;++r)i[r].s>f&&(f=i[r].s);var h=new jt(f+1),_=Ap(n[c-1],h,0);if(_>e){r=0;var p=0,y=_-e,v=1<r;++r){var m=i[r].s;if(e>=h[m])break;p+=v-(1<<_-h[m]),h[m]=e}for(p>>>=y;p>0;){var x=i[r].s;e>h[x]?p-=1<=0&&p;--r){var b=i[r].s;h[b]==e&&(--h[b],++p)}_=e}return[new cn(h),_]},Ap=function(t,e,n){return t.s==-1?Math.max(Ap(t.l,e,n+1),Ap(t.r,e,n+1)):e[t.s]=n},g_=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new jt(++e),r=0,s=t[0],i=1,o=function(l){n[r++]=l},a=1;e>=a;++a)if(t[a]==s&&a!=e)++i;else{if(!s&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(s),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(s);i=1,s=t[a]}return[n.subarray(0,r),e]},ta=function(t,e){for(var n=0,r=0;e.length>r;++r)n+=t[r]*e[r];return n},$p=function(t,e,n){var r=n.length,s=WE(e+2);t[s]=255&r,t[s+1]=r>>>8,t[s+2]=255^t[s],t[s+3]=255^t[s+1];for(var i=0;r>i;++i)t[s+i+4]=n[i];return 8*(s+4+r)},m_=function(t,e,n,r,s,i,o,a,l,u,c){rr(e,c++,n),++s[256];for(var d=If(s,15),f=d[0],h=d[1],_=If(i,15),p=_[0],y=_[1],v=g_(f),m=v[0],x=v[1],b=g_(p),E=b[0],S=b[1],k=new jt(19),C=0;m.length>C;++C)k[31&m[C]]++;for(C=0;E.length>C;++C)k[31&E[C]]++;for(var I=If(k,7),P=I[0],$=I[1],N=19;N>4&&!P[p_[N-1]];--N);var B,j,W,q,G=u+5<<3,M=ta(s,ii)+ta(i,Oc)+o,T=ta(s,f)+ta(i,p)+o+14+3*N+ta(k,P)+(2*k[16]+3*k[17]+7*k[18]);if(M>=G&&T>=G)return $p(e,c,t.subarray(l,l+u));if(rr(e,c,1+(M>T)),c+=2,M>T){B=Ra(f,h),j=f,W=Ra(p,y),q=p;var z=Ra(P,$);for(rr(e,c,x-257),rr(e,c+5,S-1),rr(e,c+10,N-4),c+=14,C=0;N>C;++C)rr(e,c+3*C,P[p_[C]]);c+=3*N;for(var K=[m,E],H=0;2>H;++H){var Q=K[H];for(C=0;Q.length>C;++C)rr(e,c,z[X=31&Q[C]]),c+=P[X],X>15&&(rr(e,c,Q[C]>>>5&127),c+=Q[C]>>>12)}}else B=_O,j=ii,W=wO,q=Oc;for(C=0;a>C;++C)if(r[C]>255){var X;ea(e,c,B[257+(X=r[C]>>>18&31)]),c+=j[X+257],X>7&&(rr(e,c,r[C]>>>23&31),c+=Sg[X]);var ie=31&r[C];ea(e,c,W[ie]),c+=q[ie],ie>3&&(ea(e,c,r[C]>>>5&8191),c+=Cg[ie])}else ea(e,c,B[r[C]]),c+=j[r[C]];return ea(e,c,B[256]),c+j[256]},xO=new Po([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),bO=function(){for(var t=new Po(256),e=0;256>e;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t}(),Of=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function EO(t,e){e===void 0&&(e={});var n=function(){var d=4294967295;return{p(f){for(var h=d,_=0;f.length>_;++_)h=bO[255&h^f[_]]^h>>>8;d=h},d(){return 4294967295^d}}}(),r=t.length;n.p(t);var s,i,o,a,l,u=(a=10+((s=e).filename&&s.filename.length+1||0),l=8,function(d,f,h,_,p,y){var v=d.length,m=new cn(_+v+5*(1+Math.floor(v/7e3))+p),x=m.subarray(_,m.length-p),b=0;if(!f||8>v)for(var E=0;v>=E;E+=65535){var S=E+65535;v>S?b=$p(x,b,d.subarray(E,S)):(x[E]=!0,b=$p(x,b,d.subarray(E,v)))}else{for(var k=xO[f-1],C=k>>>13,I=8191&k,P=(1<E;++E){var X=W(E),ie=32767&E,pe=N[X];if($[ie]=pe,N[X]=ie,E>=H){var se=v-E;if((T>7e3||K>24576)&&se>423){b=m_(d,x,0,q,G,M,z,K,Q,E-Q,b),K=T=z=0,Q=E;for(var ve=0;286>ve;++ve)G[ve]=0;for(ve=0;30>ve;++ve)M[ve]=0}var _e=2,Ze=0,Ot=I,et=ie-pe&32767;if(se>2&&X==W(E-et))for(var ze=Math.min(C,se)-1,nr=Math.min(32767,E),Or=Math.min(258,se);nr>=et&&--Ot&&ie!=pe;){if(d[E+_e]==d[E+_e-et]){for(var lt=0;Or>lt&&d[E+lt]==d[E+lt-et];++lt);if(lt>_e){if(_e=lt,Ze=et,lt>ze)break;var Mr=Math.min(et,lt-2),tn=0;for(ve=0;Mr>ve;++ve){var Ut=E-et+ve+32768&32767,Nr=Ut-$[Ut]+32768&32767;Nr>tn&&(tn=Nr,pe=Ut)}}}et+=(ie=pe)-(pe=$[ie])+32768&32767}if(Ze){q[K++]=268435456|Np[_e]<<18|v_[Ze];var Ar=31&Np[_e],Bo=31&v_[Ze];z+=Sg[Ar]+Cg[Bo],++G[257+Ar],++M[Bo],H=E+_e,++T}else q[K++]=d[E],++G[d[E]]}}b=m_(d,x,!0,q,G,M,z,K,Q,E-Q,b)}return GE(m,0,_+WE(b)+p)}(i=t,(o=e).level==null?6:o.level,o.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.length)))):12+o.mem,a,l)),c=u.length;return function(d,f){var h=f.filename;if(d[0]=31,d[1]=139,d[2]=8,d[8]=2>f.level?4:f.level==9?2:0,d[9]=3,f.mtime!=0&&Of(d,4,Math.floor(new Date(f.mtime||Date.now())/1e3)),h){d[3]=8;for(var _=0;h.length>=_;++_)d[_+10]=h.charCodeAt(_)}}(u,e),Of(u,c-8,n.d()),Of(u,c-4,r),u}var SO=!!rp||!!lg,KE="text/plain",Iu=!1,QE=(t,e)=>{var n=t.split("#"),r=n[1],s=n[0].split("?"),i=s[0],o=s[1];if(!o)return t;var a=o.split("&").filter(l=>l.split("=")[0]!==e).join("&");return i+(a?"?"+a:"")+(r?"#"+r:"")},wl=function(t,e,n){var r;n===void 0&&(n=!0);var s=t.split("?"),i=s[0],o=s[1],a=L({},e),l=(r=o==null?void 0:o.split("&").map(c=>{var d,f=c.split("="),h=f[0],_=n&&(d=a[h])!==null&&d!==void 0?d:f[1];return delete a[h],h+"="+_}))!==null&&r!==void 0?r:[],u=function(c,d){var f,h;d===void 0&&(d="&");var _=[];return ye(c,function(p,y){F(p)||F(y)||y==="undefined"||(f=encodeURIComponent((v=>v instanceof File)(p)?p.name:p.toString()),h=encodeURIComponent(y),_[_.length]=h+"="+f)}),_.join(d)}(a);return u&&l.push(u),l.length>0?i+"?"+l.join("&"):i},Mf=t=>{if(t.ba)return t.ba;var e=t.data,n=t.compression;if(e){if(n===St.GZipJS){var r=EO(function(a,l){var u=a.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(a);for(var c=new cn(a.length+(a.length>>>1)),d=0,f=function(y){c[d++]=y},h=0;u>h;++h){if(d+5>c.length){var _=new cn(d+8+(u-h<<1));_.set(c),c=_}var p=a.charCodeAt(h);128>p?f(p):2048>p?(f(192|p>>>6),f(128|63&p)):p>55295&&57344>p?(f(240|(p=65536+(1047552&p)|1023&a.charCodeAt(++h))>>>18),f(128|p>>>12&63),f(128|p>>>6&63),f(128|63&p)):(f(224|p>>>12),f(128|p>>>6&63),f(128|63&p))}return GE(c,0,d)}(Ui(e)),{mtime:0});return{contentType:KE,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===St.Base64){var s=function(a){return a&&btoa(encodeURIComponent(a).replace(/%([0-9A-F]{2})/g,(l,u)=>String.fromCharCode(parseInt(u,16))))}(Ui(e)),i=(a=>"data="+encodeURIComponent(typeof a=="string"?a:Ui(a)))(s);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var o=Ui(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},YE=t=>{var e,n,r=()=>t.transport==="sendBeacon"?{url:wl(t.url,{compression:St.Base64}),encodedBody:Mf(L({},t,{compression:St.Base64,ba:void 0}))}:{url:QE(t.url,"compression"),encodedBody:Mf(L({},t,{compression:void 0,ba:void 0}))};try{e=Mf(t)}catch(s){if(Ny(t.compression,Co(t.url,"compression")))return U.error("Failed to gzip request body, sending uncompressed payload",s),r();throw s}return e&&Ny(t.compression,Co(t.url,"compression"))&&!((n=e.body)instanceof ArrayBuffer?sp(new Uint8Array(n)):ArrayBuffer.isView(n)&&sp(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)))?(Iu=!0,r()):{url:t.url,encodedBody:e}},XE=t=>{try{return YE(t)}catch(e){return U.error(e),void(t.callback==null||t.callback({statusCode:0,error:e}))}},CO=function(){var t=Pe(function*(e){var n=Ui(e.data),r=yield function(i,o,a){return ip.apply(this,arguments)}(n,Ce.DEBUG,{rethrow:!0});if(!r)return e;var s=yield r.arrayBuffer();return L({},e,{ba:{contentType:KE,body:s,estimatedSize:s.byteLength}})});return function(e){return t.apply(this,arguments)}}(),kO=/Failed to fetch|NetworkError|Load failed/i,JE=t=>(t==null?void 0:t.name)==="TypeError"&&kO.test((t==null?void 0:t.message)||""),ZE=t=>{var e=XE(t);if(e){var n=e.url,r=e.encodedBody,s=r??{},i=s.contentType,o=s.body,a=s.estimatedSize,l=new Headers;ye(t.headers,function(_,p){l.append(p,_)}),i&&l.append("Content-Type",i);var u=null,c=!1;if(Py){var d=new Py;u={signal:d.signal,timeout:setTimeout(()=>{var _,p;c=!0,d.abort((_=t.timeout,(p=new Error("PostHog request timed out"+(_?" after "+_+"ms":""))).name="AbortError",p))},t.timeout)}}var f=_=>{c&&(_==null?void 0:_.name)==="AbortError"||JE(_)?U.warn(_):U.error(_),t.callback==null||t.callback({statusCode:0,error:_})};try{var h;lg(n,L({method:(t==null?void 0:t.method)||"GET",headers:l,keepalive:t.method==="POST"&&!t._a&&52428.8>(a||0),body:o,signal:(h=u)==null?void 0:h.signal},t.fetchOptions)).then(_=>_.text().then(p=>{var y={statusCode:_.status,text:p};if(_.status===200)try{y.json=JSON.parse(p)}catch(v){U.error(v)}t.callback==null||t.callback(y)})).catch(f).finally(()=>u?clearTimeout(u.timeout):null)}catch(_){u&&clearTimeout(u.timeout),f(_)}}},Lp=t=>{try{var e,n=YE(t),r=n.url,s=n.encodedBody,i=s??{},o=i.body,a=i.estimatedSize;if(!o)return;var l=o instanceof Blob?o:new Blob([o],{type:i.contentType});if(kt.sendBeacon(r,l))return;var u=te(t.data)?t.data:(e=t.data)==null?void 0:e.batch;if(te(u)&&u.length>1&&(a??0)>16384){var c=Math.ceil(u.length/2),d=f=>te(t.data)?f:L({},t.data,{batch:f});return Lp(L({},t,{data:d(u.slice(0,c))})),void Lp(L({},t,{data:d(u.slice(c))}))}U.warn("Beacon of ~"+(a??0)+" bytes was rejected by the browser, falling back to fetch"),ZE(L({},t,{_a:!0}))}catch(f){U.warn("Beacon send failed",f)}},y_=(t,e,n,r)=>{var s=r==="query"?e==="POST"?"sent_at":"_":void 0;return wl(n===St.GZipJS?QE(t,"compression"):t,L({},s?{[s]:Date.now().toString()}:{},n===St.GZipJS?{}:{compression:n}))},Ou=[];lg&&Ou.push({transport:"fetch",method:ZE}),rp&&Ou.push({transport:"XHR",method(t){var e=XE(t);if(e){var n=new rp,r=e.encodedBody;n.open(t.method||"GET",e.url,!0);var s=r??{},i=s.contentType,o=s.body;ye(t.headers,function(a,l){n.setRequestHeader(l,a)}),i&&n.setRequestHeader("Content-Type",i),t.timeout&&(n.timeout=t.timeout),n.onreadystatechange=()=>{if(n.readyState===4){var a={statusCode:n.status,text:n.responseText};if(n.status===200)try{a.json=JSON.parse(n.responseText)}catch{}t.callback==null||t.callback(a)}},n.send(o)}}}),kt!=null&&kt.sendBeacon&&Ou.push({transport:"sendBeacon",method:Lp});var jp=3e3;class PO{constructor(e,n){this.wa=!0,this.ka=[],this.Sa=Qn((n==null?void 0:n.flush_interval_ms)||jp,250,5e3,U.createLogger("flush interval"),jp),this.xa=e}enqueue(e){this.ka.push(e),this.Ca||this.Ta()}unload(){this.Ma();var e=this.ka.length>0?this.Ea():{},n=Object.values(e);[...n.filter(r=>r.url.indexOf("/e")===0),...n.filter(r=>r.url.indexOf("/e")!==0)].map(r=>{this.Ia(L({},r,{transport:"sendBeacon"}))})}enable(){this.wa=!1,this.Ta()}Ta(){var e=this;this.wa||(this.Ca=setTimeout(()=>{if(this.Ma(),this.ka.length>0){var n=this.Ea(),r=function(){var i=n[s],o=new Date().getTime();i.data&&te(i.data)&&ye(i.data,a=>{a.offset=Math.abs(a.timestamp-o),delete a.timestamp}),e.Ia(i)};for(var s in n)r()}},this.Sa))}Ia(e){try{this.xa(e)}catch(n){U.error(n)}}Ma(){clearTimeout(this.Ca),this.Ca=void 0}Ea(){var e={};return ye(this.ka,n=>{var r,s=n,i=(s?s.batchKey:null)||s.url;F(e[i])&&(e[i]=L({},s,{data:[]})),(r=e[i].data)==null||r.push(s.data)}),this.ka=[],e}}var RO=["retriesPerformedSoFar"];class TO{constructor(e){this.Ra=!1,this.Pa=3e3,this.ka=[],this._instance=e,this.ka=[],this.Aa=!0,!F(O)&&"onLine"in O.navigator&&(this.Aa=O.navigator.onLine,this.Fa=()=>{this.Aa=!0,this.Oa()},this.La=()=>{this.Aa=!1},Te(O,"online",this.Fa),Te(O,"offline",this.La))}get length(){return this.ka.length}retriableRequest(e){var n=e.retriesPerformedSoFar,r=Eb(e,RO);or(n)&&(r.url=wl(r.url,{retry_count:n})),this._instance._send_request(L({},r,{callback:s=>{if(s.statusCode!==200&&(400>s.statusCode||s.statusCode>=500)){if((s.statusCode===0?3:10)>(n??0))return void this.xn(L({retriesPerformedSoFar:n},r));s.statusCode===0&&U.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(n??0)+" retries.")}r.callback==null||r.callback(s)}}))}xn(e){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var r=function(o){var a=3e3*Math.pow(2,o),l=a/2,u=Math.min(18e5,a),c=Math.random()-.5;return Math.ceil(u+c*(u-l))}(n),s=Date.now()+r;this.ka.push({retryAt:s,requestOptions:e});var i="Enqueued failed request for retry in "+r;navigator.onLine||(i+=" (Browser is offline)"),U.warn(i),this.Ra||(this.Ra=!0,this.$a())}$a(){if(this.Da&&clearTimeout(this.Da),this.ka.length===0)return this.Ra=!1,void(this.Da=void 0);this.Da=setTimeout(()=>{this.Aa&&this.ka.length>0&&this.Oa(),this.$a()},this.Pa)}Oa(){var e=Date.now(),n=[],r=this.ka.filter(i=>e>i.retryAt||(n.push(i),!1));if(this.ka=n,r.length>0)for(var s of r)this.retriableRequest(s.requestOptions)}unload(){for(var e of(this.Da&&(clearTimeout(this.Da),this.Da=void 0),this.Ra=!1,F(O)||(this.Fa&&(O.removeEventListener("online",this.Fa),this.Fa=void 0),this.La&&(O.removeEventListener("offline",this.La),this.La=void 0)),this.ka)){var n=e.requestOptions;try{this._instance._send_request(L({},n,{transport:"sendBeacon"}))}catch(r){U.error(r)}}this.ka=[]}}class IO{constructor(e){this.Na=()=>{var n,r,s,i;this.qa||(this.qa={});var o=this.scrollElement(),a=this.scrollY(),l=o?Math.max(0,o.scrollHeight-o.clientHeight):0,u=a+((o==null?void 0:o.clientHeight)||0),c=(o==null?void 0:o.scrollHeight)||0;this.qa.lastScrollY=Math.ceil(a),this.qa.maxScrollY=Math.max(a,(n=this.qa.maxScrollY)!==null&&n!==void 0?n:0),this.qa.maxScrollHeight=Math.max(l,(r=this.qa.maxScrollHeight)!==null&&r!==void 0?r:0),this.qa.lastContentY=u,this.qa.maxContentY=Math.max(u,(s=this.qa.maxContentY)!==null&&s!==void 0?s:0),this.qa.maxContentHeight=Math.max(c,(i=this.qa.maxContentHeight)!==null&&i!==void 0?i:0)},this._instance=e}get ja(){return this._instance.config.scroll_root_selector}getContext(){return this.qa}resetContext(){var e=this.qa;return setTimeout(this.Na,0),e}startMeasuringScrollPosition(){Te(O,"scroll",this.Na,{capture:!0}),Te(O,"scrollend",this.Na,{capture:!0}),Te(O,"resize",this.Na)}scrollElement(){if(!this.ja)return O==null?void 0:O.document.documentElement;var e=te(this.ja)?this.ja:[this.ja];for(var n of e){var r=O==null?void 0:O.document.querySelector(n);if(r)return r}}Ba(e){var n=e==="y"?"scrollTop":"scrollLeft";if(this.ja){var r=this.scrollElement();return r&&r[n]||0}return O?e==="y"?O.scrollY||O.pageYOffset||O.document.documentElement.scrollTop||0:O.scrollX||O.pageXOffset||O.document.documentElement.scrollLeft||0:0}scrollY(){return this.Ba("y")}scrollX(){return this.Ba("x")}}var OO=t=>DE(t==null?void 0:t.config.mask_personal_data_properties,t==null?void 0:t.config.custom_personal_data_properties,t==null?void 0:t.config.disable_capture_url_hashes);class __{constructor(e,n,r,s){this.ot=i=>{var o=this.Ha();if(!o||o.sessionId!==i){var a={sessionId:i,props:this.Ua(this._instance)};this.za.register({[bp]:a})}},this._instance=e,this.Wa=n,this.za=r,this.Ua=s||OO,this.Wa.onSessionId(this.ot)}Ha(){return this.za.props[bp]}getSetOnceProps(){var e,n=(e=this.Ha())==null?void 0:e.props;return n?"r"in n?zE(n,this._instance.config.disable_capture_url_hashes):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var e={};return ye(wg(this.getSetOnceProps()),(n,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+ap(r)]=n}),e}}class Mc{on(e,n){return this.Va[e]||(this.Va[e]=[]),this.Va[e].push(n),()=>{this.Va[e]=this.Va[e].filter(r=>r!==n)}}emit(e,n){for(var r of this.Va[e]||[])r(n);for(var s of this.Va["*"]||[])s(e,n)}constructor(){this.Va={}}}var _i=Oe("[SessionId]"),w_=864e5;class x_{on(e,n){return this.Ga.on(e,n)}constructor(e,n,r){var s;if(this.Za=null,this.Qa=null,this.Ja=[],this.Ka=void 0,this.Ya=!1,this.Ga=new Mc,this.Xa=(l,u)=>!(!or(l)||!or(u))&&Math.abs(l-u)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===vr)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.qi=e.config,this.za=e.persistence,this.st=void 0,this._e=void 0,this._sessionStartTimestamp=null,this.eo=void 0,this._sessionActivityTimestamp=null,this.io=n||Un,this.ro=r||Un;var i=this.qi.persistence_name||this.qi.token;if(this._sessionTimeoutMs=1e3*Qn(this.qi.session_idle_timeout_seconds||1800,60,36e3,_i.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.no(),this.so="ph_"+i+"_window_id",this.ao="ph_"+i+"_primary_window_exists",this.oo()){var o=be.Br(this.so),a=be.Br(this.ao);o&&!a?this.st=o:be.qr(this.so),be.Nr(this.ao,!0)}(s=this.qi.bootstrap)!=null&&s.sessionID&&this.setBootstrapSessionId(this.qi.bootstrap.sessionID),this.lo()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return F(this.Ja)&&(this.Ja=[]),this.Ja.push(e),this._e&&e(this._e,this.st),()=>{this.Ja=this.Ja.filter(n=>n!==e)}}oo(){return this.qi.persistence!=="memory"&&!this.za.Hs&&be.Dr()}uo(e){e!==this.st&&(this.st=e,this.oo()&&be.Nr(this.so,e))}ho(){return this.st?this.st:this.oo()?be.Br(this.so):null}do(e){var n=this.Za;return!it(n)&&!it(e)&&5e3>Math.abs(e-n)}vo(e,n,r){var s=n!==this._sessionActivityTimestamp,i=!(e!==this._e||r!==this._sessionStartTimestamp);this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this._e=e,i&&!s||i&&this.do(n)||(this.Za=n,this.za.register({[Bi]:[n,e,r]}))}co(){var e,n=(e=this.qi)==null?void 0:e.persistence_save_debounce_ms;return or(n)&&n>0}fo(){this.co()?this.za.refreshKey(Bi):(this.za.flush(),this.za.load())}po(){var e;if(!it(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Za){this.fo();var n=this.mo();n[1]===this._e&&n[2]===this._sessionStartTimestamp&&(this.Za=this._sessionActivityTimestamp,this.za.register({[Bi]:[this._sessionActivityTimestamp,(e=this._e)!==null&&e!==void 0?e:null,this._sessionStartTimestamp]}),this.za.flush())}}yo(){var e=this.mo()[0],n=or(e)?e:0,r=or(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(n,r)}bo(e){return this.fo(),this.Xa(e,this.yo())}mo(){var e=this.za.props[Bi];return te(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Za=null,this.eo=void 0,clearTimeout(this._o),this._o=void 0,this.vo(null,null,null)}setBootstrapSessionId(e,n){n===void 0&&(n=!1);var r=function(s,i){i===void 0&&(i=new Date().getTime());try{var o=(a=>{var l=a.replace(/-/g,"");if(l.length!==32)throw new Error("Not a valid UUID");if(l[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(l.substring(0,12),16)})(s);return o>i+6e4?void _i.error("Bootstrap sessionID cannot be in the future"):o}catch(a){return void _i.error("Invalid sessionID in bootstrap",a)}}(e);return!F(r)&&(n?this.eo={sessionId:e,sessionStartTimestamp:r}:this.vo(e,new Date().getTime(),r),!0)}destroy(){this.Ya=!0,this.po(),clearTimeout(this._o),this._o=void 0,this.Ka&&O&&(O.removeEventListener(Cc,this.Ka,{capture:!1}),this.Ka=void 0),this.Ja=[]}lo(){this.Ka=()=>{this.po(),this.oo()&&be.qr(this.ao)},Te(O,Cc,this.Ka,{capture:!1})}checkAndGetSessionAndWindowId(e,n,r){if(e===void 0&&(e=!1),n===void 0&&(n=null),r===void 0&&(r=!1),this.qi.cookieless_mode===vr)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var s=n||new Date().getTime(),i=this._e;if(r)this.Qa=s;else if(it(this.Qa)||this.Qa>s||s-this.Qa>=1e3){var o,a;(o=(a=this.za).syncCookieProperties)==null||o.call(a),this.Qa=s}var l=this.mo(),u=l[1],c=l[2],d=!F(i)&&u!==i,f=this.yo(),h=this.ho(),_=this.eo,p=!!_&&(_.sessionStartTimestamp>s+6e4||s-_.sessionStartTimestamp>w_),y=_?p:or(c)&&Math.abs(s-c)>w_,v=!1,m=d,x=!u||!!_,b=u,E=!x&&!e&&this.Xa(s,f);if(E){(E=this.bo(s))||_i.info("cross-tab refresh kept the session alive",{sessionId:u});var S=this.mo();u=S[1],c=S[2]}if(x||E||y){m=!1;var k=_&&!p;u=k?_.sessionId:this.io(),h=this.ro(),_i.info("new session ID assigned",{sessionId:u,windowId:h,bootstrapped:!!k,changeReason:{noSessionId:x,activityTimeout:E,sessionPastMaximumLength:y}}),c=k?_.sessionStartTimestamp:s,this.eo=void 0,v=!0}else h||(h=this.ro(),v=!0),(m=m||u!==b)&&(_i.info("adopted cross-tab session id",{sessionId:u,windowId:h}),v=!0);var C=or(f)&&e&&!y?f:s,I=or(c)?c:new Date().getTime();this.uo(h),this.vo(u,C,I),e||this.no();var P={noSessionId:x,activityTimeout:E,sessionPastMaximumLength:y,crossTabAdoption:m};return v&&this.Ja.forEach($=>$(u,h,P)),{sessionId:u,windowId:h,sessionStartTimestamp:I,changeReason:v?P:void 0,lastActivityTimestamp:f}}no(){this.Ya||(clearTimeout(this._o),this._o=setTimeout(()=>{if(!this.Ya)if(this.bo(new Date().getTime())){var e=this._e;this.resetSessionId(),this.Ga.emit("forcedIdleReset",{idleSessionId:e})}else this.no()},1.1*this.sessionTimeoutMs))}}var e1=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&$y(n,e))return!0;try{var r=t==null?void 0:t.userAgentData;if(r!=null&&r.brands&&r.brands.some(s=>$y(s==null?void 0:s.brand,e)))return!0}catch{}return!!t.webdriver};function t1(){return(t1=Pe(function*(){var t=kt==null?void 0:kt.userAgentData;if(t!=null&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),n=e==null?void 0:e.model;return he(n)&&n.length>0?n:void 0}catch(r){return void U.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",r)}})).apply(this,arguments)}var Nc=function(t,e){if(!function(n){try{new RegExp(n)}catch{return!1}return!0}(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}};function Nf(t,e,n){return Ui({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var n1={exact:(t,e)=>e.some(n=>t.some(r=>n===r)),is_not:(t,e)=>e.every(n=>t.every(r=>n!==r)),regex:(t,e)=>e.some(n=>t.some(r=>Nc(n,r))),not_regex:(t,e)=>e.every(n=>t.every(r=>!Nc(n,r))),icontains:(t,e)=>e.map(eu).some(n=>t.map(eu).some(r=>n.includes(r))),not_icontains:(t,e)=>e.map(eu).every(n=>t.map(eu).every(r=>!n.includes(r))),gt:(t,e)=>e.some(n=>{var r=parseFloat(n);return!isNaN(r)&&t.some(s=>r>parseFloat(s))}),lt:(t,e)=>e.some(n=>{var r=parseFloat(n);return!isNaN(r)&&t.some(s=>rt.toLowerCase();function r1(t,e){return!t||Object.entries(t).every(n=>{var r=n[1],s=e==null?void 0:e[n[0]];if(F(s)||it(s))return!1;var i=[String(s)],o=n1[r.operator];return!!o&&o(r.values,i)})}var Fp="custom",b_="i.posthog.com",MO=/^\/static\//,NO=["/s/","/e/","/i/"];class AO{constructor(e){this.wo={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,n=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+b_,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.wo[this.apiHost]||(this.wo[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":Fp),this.wo[this.apiHost]}ko(e){if(MO.test(e)){var n=this.instance.config.asset_host;if(typeof n=="string")return n.trim().replace(/\/$/,"")||void 0}}So(e){var n=So(e);return n?n.protocol+"//"+n.host+n.pathname:void 0}xo(e,n,r){if(e==="ui")return r;var s=r,i=this.instance.config.rewriteRequestPath;if(i){var o,a=((o=So(r))==null?void 0:o.href)||r;s=i(new URL(a)).toString()}if(i&&e==="api"&&NO.some(f=>n.indexOf(f)===0)){var l=this.So(s);if(l){var u,c=this.apiHost,d=this.Co;((u=d)==null?void 0:u.apiHost)===c&&d.rewriteRequestPath===i||(d={apiHost:c,rewriteRequestPath:i,urls:new Set},this.Co=d),d.urls.add(l)}}return s}isIngestionEndpoint(e){var n=this.Co,r=this.So(e);return(n==null?void 0:n.apiHost)===this.apiHost&&n.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!r&&n.urls.has(r)}endpointFor(e,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),e==="ui")return this.xo(e,n,this.uiHost+n);if(e==="flags")return this.xo(e,n,this.flagsApiHost+n);if(e==="assets"){var r=this.ko(n);if(r)return this.xo(e,n,""+r+n)}if(this.region===Fp)return this.xo(e,n,this.apiHost+n);var s=b_+n;switch(e){case"assets":return this.xo(e,n,"https://"+this.region+"-assets."+s);case"api":return this.xo(e,n,"https://"+this.region+"."+s)}}}function s1(t){var e;return!((e=t.conditions)==null||(e=e.events)==null||(e=e.values)==null||!e.length)}var ge=Oe("[Surveys]"),i1="seenSurvey_",o1=t=>{try{var e=(n=>((r,s)=>""+i1+function(i){return i.current_iteration&&i.current_iteration>0?i.id+"_"+i.current_iteration:i.id}(s))(0,n))(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(n){ge.error("Failed to persist survey seen state",n)}},$O=[Rf.Popover,Rf.Widget,Rf.API],LO={ignoreConditions:!1,ignoreDelay:!1,displayType:Mp.Popover},jO=Oe("[PostHog ExternalIntegrations]"),FO={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class DO{constructor(e){this._instance=e}_s(e,n){var r;(r=J.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,s=>{if(s)return jO.error("failed to load script",s);n()})}startIfEnabledOrStop(){var e=this,n=function(){var i,o,a,l=r[0],u=r[1];!u||(i=J.__PosthogExtensions__)!=null&&(i=i.integrations)!=null&&i[l]||e._s(FO[l],()=>{var c;(c=J.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[l])==null||c.start(e._instance)}),!u&&(o=J.__PosthogExtensions__)!=null&&(o=o.integrations)!=null&&o[l]&&((a=J.__PosthogExtensions__)==null||(a=a.integrations)==null||(a=a[l])==null||a.stop())};for(var r of Object.entries((s=this._instance.config.integrations)!==null&&s!==void 0?s:{})){var s;n()}}}class zO{constructor(e,n){this.I=e,this.ns=n,this.To=new Map,this.Xn=!1}add(e){var n=this;return Pe(function*(){if(n.Xn)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(n.To.has(e.name))throw new Error('Browser extension "'+e.name+'" is already registered');n.To.set(e.name,e);try{var r=e.setup(n.ns);r&&(yield r)}catch(i){var s=n.To.get(e.name)===e;s&&n.To.delete(e.name),n.I.error('Failed to set up browser extension "'+e.name+'"',i),s&&n.Mo(e)}})()}dispose(){if(!this.Xn){this.Xn=!0;var e=Array.from(this.To.values()).reverse();for(var n of(this.To.clear(),e))this.Mo(n)}}Mo(e){try{var n=e.dispose==null?void 0:e.dispose();n&&yt(n.then)&&n.then(void 0,r=>{this.I.error('Failed to dispose browser extension "'+e.name+'"',r)})}catch(r){this.I.error('Failed to dispose browser extension "'+e.name+'"',r)}}}class BO{constructor(e){this._instance=e}initialize(){}get(e){var n=this._instance.persistence;if(typeof e=="string")return n==null?void 0:n.get_property(e);var r={};for(var s of e){var i=n==null?void 0:n.get_property(s);F(i)||(r[s]=i)}return r}set(e,n){var r;(r=this._instance.persistence)==null||r.register(typeof e=="string"?{[e]:n}:e)}remove(e){var n;(n=this._instance.persistence)==null||n.unregister(e)}}var E_="extensionsRemoteConfig";class UO{constructor(e){this.Xn=!1,this.instance=e,this.I=U,this.Eo=e.Io,this.kv=new BO(e),this.onEvent=n=>Zl(this.instance.on("eventCaptured",r=>{try{n({event:r.event,properties:r.properties})}catch(s){this.I.error("Browser extension event listener failed",s)}})),this.onRemoteConfig=n=>{if(this.Xn)return Zl(()=>{});var r=i=>{try{n(i)}catch(o){this.I.error("Browser extension remote config listener failed",o)}},s=this.instance.Ro.on(E_,r);return this.Eo&&r(this.Eo),Zl(s)},this.Po=new zO(U.createLogger("[BrowserExtensions]"),this)}get logger(){return this.I}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var e;return(e=this.instance.get_property(Xa))!==null&&e!==void 0?e:this.distinctId}get deviceId(){var e=this.instance.get_property(Xa);return typeof e=="string"?e:void 0}get library(){return{name:Ce.LIB_NAME,version:Ce.LIB_VERSION}}get initialPersonProperties(){var e,n;return(e=(n=this.instance.persistence)==null?void 0:n.get_initial_props())!==null&&e!==void 0?e:{}}get groups(){return this.instance.getGroups()}get session(){try{var e,n,r,s,i=(e=this.instance.sessionManager)==null?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:(n=i==null?void 0:i.sessionId)!==null&&n!==void 0?n:"",windowId:(r=i==null?void 0:i.windowId)!==null&&r!==void 0?r:"",sessionStartTimestamp:(s=i==null?void 0:i.sessionStartTimestamp)!==null&&s!==void 0?s:0}}catch{return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get projectToken(){return this.instance.config.token}add(e){return this.Po.add(e)}capture(e,n,r){var s=this;return Pe(function*(){r?s.instance.capture(e,n,{timestamp:r.timestamp,uuid:r.uuid,$set:r.set,$set_once:r.setOnce}):s.instance.capture(e,n)})()}registerDynamicEventProperties(e){return Zl(this.instance.Ao(e))}handleRemoteConfig(e){this.Xn||(this.Eo=e,this.instance.Ro.emit(E_,e))}sendRequest(e,n){var r=this;return Pe(function*(){var s;n===void 0&&(n={});var i=r.instance.requestRouter.endpointFor((s=n.target)!==null&&s!==void 0?s:"api",e),o={method:n.method,url:n.query?wl(i,n.query):i,data:n.body,headers:n.headers,timeout:n.timeoutMs,fireCallbackOnDrop:!0,transport:n.transport,compression:n.compression,timestampMode:n.sentAt};return n.transport==="sendBeacon"?(r.instance._send_request(o),{statusCode:202}):new Promise(a=>{o.callback=a,r.instance._send_request(o)})})()}dispose(){this.Xn||(this.Xn=!0,this.Po.dispose())}}var Ta={},Af=0,Ia=()=>{},S_='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',na="Surveys module not available",C_="sanitize_properties is deprecated. Use before_send instead",a1="Invalid value for property_denylist config: ",VO=["token","distinct_id",hE],Pi="posthog",l1=!SO&&(Mt==null?void 0:Mt.indexOf("MSIE"))===-1&&(Mt==null?void 0:Mt.indexOf("Mozilla"))===-1,$f=t=>{var e;return L({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:VI(D==null?void 0:D.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Ia,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:Ae&&he(Ae==null?void 0:Ae.search)&&Ae.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:(O==null||(e=O.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(n){U.error("Bad HTTP status: "+n.statusCode+" "+n.text)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:Pp,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:jp},error_tracking:{},_onCapture:Ia},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:tO,ignore_text_selection:!0}:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:n&&n>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:n&&n>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:n&&n>="2026-05-30"?250:0,split_storage:!(!n||"2026-05-30">n),detect_google_search_app:!(!n||"2026-05-30">n),disable_capture_url_hashes:!(!n||"2026-06-25">n),cookieWinsOnConflict:!(!n||n==="unset"||"2026-08-29">n)}))(t))},qO=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],k_=t=>{var e={};for(var n of qO){var r=n[0],s=n[1];F(t[r])||(e[s]=t[r])}var i=xe({},e,t),o=t.__preview_external_dependency_versioned_paths;return F(o)||(F(t.strict_script_versioning)&&(i.strict_script_versioning=!!o),he(o)&&F(t.asset_host)&&(i.asset_host=o)),te(t.property_blacklist)&&(F(t.property_denylist)?i.property_denylist=t.property_blacklist:te(t.property_denylist)?i.property_denylist=[...t.property_blacklist,...t.property_denylist]:U.error(a1+t.property_denylist)),i};class HO{constructor(){this.__forceAllowLocalhost=!1}get Fo(){return this.__forceAllowLocalhost}set Fo(e){U.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class Ht{Oo(e,n){if(e){var r=this.To.indexOf(e);r!==-1&&this.To.splice(r,1)}return this.To.push(n),n.initialize==null||n.initialize(),n}Lo(){return this.config.cookieless_mode===vr||this.config.cookieless_mode===Ls&&this.consent.isRejected()}$o(){if(!this.Lo()&&this.get_distinct_id()===mi){var e=this.persistence;if(e){this.Do()||e.load(!0);var n=this.get_distinct_id();if(!n||n===mi){var r=this.config.get_device_id(Un());this.register({distinct_id:r,$device_id:r}),e.set_property(ue,We)}this.No()}}}get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){var e;this.webPerformance=new HO,this.qo=!1,this.version=Ce.LIB_VERSION,this.jo=new Set,this.Bo="",this.Ro=new Mc,this.To=[],this.Ho=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=$f(),this.SentryIntegration=uO,this.sentryIntegration=r=>function(s,i){var o=ME(s,i);return{name:OE,processEvent:a=>o(a)}}(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Uo=!1,this.zo=null,this.Wo=null,this.Vo=null,this.scrollManager=new IO(this),this.pageViewManager=new u_(this),this.rateLimiter=new yO(this),this.requestRouter=new AO(this),this.consent=new YI(this),this.externalIntegrations=new DO(this);var n=(e=Ht.__defaultExtensionClasses)!==null&&e!==void 0?e:{};this.featureFlags=n.featureFlags&&new n.featureFlags(this),this.toolbar=n.toolbar&&new n.toolbar(this),this.surveys=n.surveys&&new n.surveys(this),this.conversations=n.conversations&&new n.conversations(this),this.logs=n.logs&&new n.logs(this),this.metrics=n.metrics&&new n.metrics(this),this.experiments=n.experiments&&new n.experiments(this),this.exceptions=n.exceptions&&new n.exceptions(this),this.people={set:(r,s,i)=>{var o=he(r)?{[r]:s}:r;this.setPersonProperties(o),i==null||i({})},set_once:(r,s,i)=>{var o=he(r)?{[r]:s}:r;this.setPersonProperties(void 0,o),i==null||i({})}},this.on("eventCaptured",r=>U.info('send "'+(r==null?void 0:r.event)+'"',r))}init(e,n,r){if(r&&r!==Pi){var s,i=(s=Ta[r])!==null&&s!==void 0?s:new Ht;return i._init(e,n,r),Ta[r]=i,Ta[Pi][r]=i,i}return this._init(e,n,r)}_init(e,n,r){var s,i;n===void 0&&(n={});var o,a=he(e)?e.trim():"";if(!a)return U.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return a!==((o=this.config)==null?void 0:o.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+a+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=$f(n.defaults),n.debug=this.Go(n.debug),this.Zo=n,this.Qo=[],n.person_profiles?this.Wo=n.person_profiles:n.process_person&&(this.Wo=n.process_person);var l=$f(n.defaults),u=k_(n),c=xe({},l,u,{name:r,token:a});ke(l.rageclick)&&ke(u.rageclick)&&(c.rageclick=xe({},l.rageclick,u.rageclick)),ke(l.session_recording)&&ke(u.session_recording)&&(c.session_recording=xe({},l.session_recording,u.session_recording)),this.set_config(c),this.config.on_xhr_error&&U.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:St.GZipJS;var d=this.Do();if(this.persistence=new Pf(this.config,d),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Pf(L({},this.config,{persistence:"sessionStorage"}),d,!1),this.Bo="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties",this.config.persistence!=="memory"&&!d&&be.Dr()){var f=be.Br(this.Bo);te(f)&&f.forEach(S=>{he(S)&&this.jo.add(S)})}else be.qr(this.Bo);var h=L({},this.persistence.props),_=L({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Jo=new PO(S=>this.Ko(S),this.config.request_queue_config),this.Yo=new TO(this),this.__request_queue=[];var p=this.Lo();if(p||(this.sessionManager=new x_(this),this.sessionPropsManager=new __(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((S,k,C)=>{(C!=null&&C.activityTimeout||C!=null&&C.sessionPastMaximumLength||C!=null&&C.crossTabAdoption)&&this.Xo()})),this.tl(),this.config.__preview_deferred_init_extensions?(U.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.el(p)},0)):(U.info("Initializing extensions synchronously"),this.el(p)),Ce.DEBUG=Ce.DEBUG||this.config.debug,Ce.DEBUG&&U.info("Starting in debug mode",{this:this,config:n,thisC:L({},this.config),p:h,s:_}),!this.config.identity_distinct_id||(s=n.bootstrap)!=null&&s.distinctID||(n.bootstrap=L({},n.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),((i=n.bootstrap)==null?void 0:i.distinctID)!==void 0){var y=n.bootstrap.distinctID,v=this.get_distinct_id(),m=this.persistence.get_property(ue);if(n.bootstrap.isIdentifiedID&&v!=null&&v!==y&&m===We)this.identify(y);else if(n.bootstrap.isIdentifiedID&&v!=null&&v!==y&&m===dt)U.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var x=this.config.get_device_id(Un()),b=n.bootstrap.isIdentifiedID?x:y;this.persistence.set_property(ue,n.bootstrap.isIdentifiedID?dt:We),this.register({distinct_id:y,$device_id:b})}}if(p)this.register_once({distinct_id:mi,$device_id:null},"");else if(!this.get_distinct_id()){var E=this.config.get_device_id(Un());this.register_once({distinct_id:E,$device_id:E},""),this.persistence.set_property(ue,We)}return Te(O,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),n.segment?function(S,k){var C=S.config.segment;if(!C)return k();(function(I,P){var $=I.config.segment;if(!$)return P();var N=j=>{var W=()=>j.anonymousId()||Un();I.config.get_device_id=W,j.id()&&(I.register({distinct_id:j.id(),$device_id:W()}),I.persistence.set_property(ue,dt)),P()},B=$.user();"then"in B&&yt(B.then)?B.then(N):N(B)})(S,()=>{C.register((I=>{typeof Promise<"u"&&Promise.resolve||Cf.warn("This browser does not have Promise support, and can not use the segment integration");var P=($,N)=>{if(!N)return $;$.event.userId||$.event.anonymousId===I.get_distinct_id()||(Cf.info("No userId set, resetting PostHog"),I.reset()),$.event.userId&&$.event.userId!==I.get_distinct_id()&&(Cf.info("UserId set, identifying with PostHog"),I.identify($.event.userId));var B=I.calculateEventProperties(N,$.event.properties);return $.event.properties=Object.assign({},B,$.event.properties),$};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:$=>P($,$.event.event),page:$=>P($,ki),identify:$=>P($,_f),screen:$=>P($,"$screen")}})(S)).then(()=>{k()})})}(this,()=>this.il()):this.il(),yt(this.config._onCapture)&&this.config._onCapture!==Ia&&(U.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",S=>this.config._onCapture(S.event,S))),this.config.ip&&U.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||function(){return t1.apply(this,arguments)}().then(S=>{S&&this.register({[mf]:S})}).catch(Ia),this}rl(e){var n=e;return he(n.name)&&yt(n.setup)}nl(e,n){this.rl(e)?n.push(()=>{this.sl().add(e).catch(Ia)}):this.To.push(e)}tl(){var e,n,r,s,i,o,a=(e=(n=this.config.__extensionClasses)==null?void 0:n.featureFlags)!==null&&e!==void 0?e:(r=Ht.__defaultExtensionClasses)==null?void 0:r.featureFlags;a&&(this.featureFlags&&this.featureFlags instanceof a||((s=this.al)==null||s.call(this),this.al=void 0,this.featureFlags=new a(this)),yt(this.featureFlags.onReloading)&&yt(this.featureFlags.setup)?this.al||(this.al=this.featureFlags.onReloading(()=>{this.Ro.emit("featureFlagsReloading",!0)}),this.sl().add(this.featureFlags)):(i=(o=this.featureFlags).initialize)==null||i.call(o))}el(e){var n,r,s,i,o,a,l,u=performance.now(),c=L({},Ht.__defaultExtensionClasses,this.config.__extensionClasses),d=[];c.exceptions&&this.To.push(this.exceptions=(n=this.exceptions)!==null&&n!==void 0?n:new c.exceptions(this)),c.historyAutocapture&&this.To.push(this.historyAutocapture=new c.historyAutocapture(this)),c.tracingHeaders&&this.To.push(this.tracingHeaders=new c.tracingHeaders(this)),c.siteApps&&this.To.push(this.siteApps=new c.siteApps(this)),c.sessionRecording&&!e&&this.To.push(this.sessionRecording=new c.sessionRecording(this)),this.config.disable_scroll_properties||d.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),c.autocapture&&this.nl(this.autocapture=new c.autocapture(this),d),c.surveys&&this.nl(this.surveys=(r=this.surveys)!==null&&r!==void 0?r:new c.surveys(this),d),c.logs&&this.To.push(this.logs=(s=this.logs)!==null&&s!==void 0?s:new c.logs(this)),c.metrics&&this.To.push(this.metrics=(i=this.metrics)!==null&&i!==void 0?i:new c.metrics(this)),c.conversations&&this.To.push(this.conversations=(o=this.conversations)!==null&&o!==void 0?o:new c.conversations(this)),c.productTours&&this.To.push(this.productTours=new c.productTours(this)),c.heatmaps&&this.To.push(this.heatmaps=new c.heatmaps(this)),c.webVitalsAutocapture&&this.To.push(this.webVitalsAutocapture=new c.webVitalsAutocapture(this)),c.exceptionObserver&&this.To.push(this.exceptionObserver=new c.exceptionObserver(this)),c.deadClicksAutocapture&&this.To.push(this.deadClicksAutocapture=new c.deadClicksAutocapture(this,lO)),c.toolbar&&this.To.push(this.toolbar=(a=this.toolbar)!==null&&a!==void 0?a:new c.toolbar(this)),c.experiments&&this.To.push(this.experiments=(l=this.experiments)!==null&&l!==void 0?l:new c.experiments(this)),this.To.forEach(f=>{f.initialize&&d.push(()=>{f.initialize==null||f.initialize()})}),d.push(()=>{if(this.ol){var f=this.ol;this.ol=void 0,this.To.forEach(h=>h.onRemoteConfig==null?void 0:h.onRemoteConfig(f))}}),this.ll(d,u)}ll(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout(()=>{this.ll(e,n)},0);var r=e.shift();if(r)try{r()}catch(i){U.error("Error initializing extension:",i)}}var s=Math.round(performance.now()-n);this.register_for_session({[pE]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[vE]:s}),this.config.__preview_deferred_init_extensions&&U.info("PostHog extensions initialized ("+s+"ms)")}pa(e){var n;if(!D||!D.body)return U.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.pa(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.ol=e),this.Io=e,this.compression=void 0,e.ok){var r,s=e.config;s.supportedCompression&&!this.config.disable_compression&&(this.compression=ee(s.supportedCompression,St.GZipJS)?St.GZipJS:ee(s.supportedCompression,St.Base64)?St.Base64:void 0),(r=s.analytics)!=null&&r.endpoint&&(this.analyticsDefaultEndpoint=s.analytics.endpoint)}this.set_config({person_profiles:this.Wo?this.Wo:Pp}),(n=this.ul)==null||n.handleRemoteConfig(e),this.To.forEach(i=>i.onRemoteConfig==null?void 0:i.onRemoteConfig(e))}il(){try{this.config.loaded(this)}catch(r){U.critical("`loaded` function failed",r)}if(this.hl(),this.config.internal_or_test_user_hostname&&Ae!=null&&Ae.hostname){var e=Ae.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?e===n:n.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.Lo())&&this.dl()},1),this.vl=new UE(this),this.vl.load()}hl(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Jo)==null||e.enable())}_dom_loaded(){this.is_capturing()&&Kl(this.__request_queue,e=>this.Ko(e)),this.__request_queue=[],this.hl()}_handle_unload(){var e,n,r,s,i;(e=this.surveys)==null||e.handlePageUnload==null||e.handlePageUnload(),(n=this.metrics)==null||n.flush("sendBeacon"),this.config.request_batching?(this.cl()&&this.capture(yf),(r=this.logs)==null||r.flushLogs("sendBeacon"),(s=this.Jo)==null||s.unload(),(i=this.Yo)==null||i.unload()):this.cl()&&this.capture(yf,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?l1?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=L({},this.config.request_headers,e.headers),e.compression=e.compression==="best-available"?this.compression:e.compression,(F(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(n=>{var r,s,i,o=L({},n);o.timeout=o.timeout||6e4;var a,l,u,c,d,f=(r=o.transport)!==null&&r!==void 0?r:"fetch";f==="sendBeacon"&&F(o.compression)&&o.data&&(o.compression=St.Base64),o.method==="POST"&&o.data&&(o.timestampMode==="capture-body"?o.data={api_key:(l=(d=(c=(te(a=o.data)?a:[a]).map(y=>L({},y,y.timestamp instanceof Date&&!isNaN(y.timestamp.getTime())?{timestamp:y.timestamp.toISOString()}:{})))[0])==null||(u=d.properties)==null?void 0:u.token)!==null&&l!==void 0?l:d==null?void 0:d.token,batch:c,sent_at:new Date().toISOString()}:o.timestampMode==="body"&&(o.data=function(y,v){return v===void 0&&(v=new Date().toISOString()),te(y)?y.map(m=>L({},m,{sent_at:v})):L({},y,{sent_at:v})}(o.data))),o.url=y_(o.url,o.method,o.compression,o.timestampMode);var h=Ou.filter(y=>!o.disableTransport||!y.transport||!o.disableTransport.includes(y.transport)),_=(s=(i=function(y,v){for(var m=0;y.length>m;m++)if(y[m].transport===f)return y[m]}(h))==null?void 0:i.method)!==null&&s!==void 0?s:h[0].method;if(!_)throw new Error("No available transport method");var p=y=>{try{_(y)}catch(v){JE(v)?U.warn(v):U.error(v),o.callback==null||o.callback({statusCode:0,error:v})}};f!=="sendBeacon"&&o.data&&o.compression===St.GZipJS&&DT&&typeof Promise<"u"&&!Iu?CO(o).then(y=>{p(y)}).catch(y=>{if(Ay(y))return Iu=!0,void p(L({},o,{compression:void 0,url:y_(n.url,n.method,void 0,n.timestampMode)}));(v=>{if(!v||typeof v!="object")return!1;var m="name"in v?String(v.name):"";return Ay(v)||m===Sb})(y)&&(Iu=!0),p(o)}):_(o)})(L({},e,{callback:n=>{var r,s;this.rateLimiter.checkForLimiting(n),400>n.statusCode||(r=(s=this.config).on_request_error)==null||r.call(s,n),e.callback==null||e.callback(n)}}))):e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:0}))}Ko(e){this.Yo?this.Yo.retriableRequest(e):this._send_request(e)}_execute_array(e){Af++;try{var n,r=[],s=[],i=[];Kl(e,a=>{if(a)if(te(n=a[0]))i.push(a);else if(yt(a))try{a.call(this)}catch(l){U.error("Error executing queued PostHog call",a,l)}else te(a)&&n==="alias"?r.push(a):te(a)&&n.indexOf("capture")!==-1&&yt(this[n])?i.push(a):s.push(a)});var o=function(a,l){Kl(a,function(u){try{if(te(u[0])){var c=l;ye(u,function(d){c=c[d[0]].apply(c,d.slice(1))})}else l[u[0]].apply(l,u.slice(1))}catch(d){U.error("Error executing queued PostHog call",u,d)}})};o(r,this),o(s,this),o(i,this)}finally{Af--}}push(e){if(Af>0&&te(e)&&he(e[0])){var n=Ht.prototype[e[0]];yt(n)&&n.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,n,r){var s,i,o,a,l;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Jo){if(this.is_capturing())if(!F(e)&&he(e)){this.$o();var u=!this.config.opt_out_useragent_filter&&this._is_bot();if(!u||this.config.__preview_capture_bot_pageviews){var c=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(c==null||!c.isRateLimited){n!=null&&n.$current_url&&!he(n==null?void 0:n.$current_url)&&(U.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),e!=="$exception"||r!=null&&r.fl||U.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var d=new Date,f=(r==null?void 0:r.timestamp)||d,h=Dy(r==null?void 0:r.uuid,Un),_={uuid:h,event:e,properties:this.calculateEventProperties(e,n||{},f,h)};e===ki&&this.config.__preview_capture_bot_pageviews&&u&&(_.event="$bot_pageview",_.properties.$browser_type="bot"),c&&(_.properties.$lib_rate_limit_remaining_tokens=c.remainingTokens);var p=e==="$feature_flag_called"&&_.properties.$feature_flag_has_experiment===!1&&this.get_property(wc)===!0;r!=null&&r.$set&&!p&&(_.$set=r==null?void 0:r.$set);var y=r==null?void 0:r.$unset;y&&(_.$unset=y);var v,m,x,b=p?void 0:this.pl(r==null?void 0:r.$set_once,e!==Gy,e===_f);if(b&&(_.$set_once=b),r!=null&&r._noTruncate||(i=this.config.properties_string_max_length,o=_,a=N=>he(N)?N.slice(0,i):N,l=new Set,_=function N(B,j){if(B!==Object(B))return a?a(B):B;if(!l.has(B)){var W;if(l.add(B),te(B))W=[],Kl(B,G=>{W.push(N(G))});else{var q={};ye(B,(G,M)=>{l.has(G)||(q[M]=N(G))}),W=q}return W}}(o)),_.timestamp=f,F(r==null?void 0:r.timestamp)||(_.properties.$event_time_override_provided=!0,_.properties.$event_time_override_system_time=d),p&&(_.properties=function(N,B){B===void 0&&(B=[]);var j={},W=q=>{N[q]!==void 0&&(j[q]=N[q])};return zT.forEach(W),B.forEach(W),j}(_.properties,VO)),e===gr.DISMISSED||e===gr.SENT){var E=n==null?void 0:n[Tf.SURVEY_ID],S=n==null?void 0:n[Tf.SURVEY_ITERATION];o1({id:E,current_iteration:S}),_.$set=L({},_.$set,{[(v={id:E,current_iteration:S},m=e===gr.SENT?"responded":"dismissed",x="$survey_"+m+"/"+v.id,v.current_iteration&&v.current_iteration>0&&(x="$survey_"+m+"/"+v.id+"/"+v.current_iteration),x)]:!0})}else e===gr.SHOWN&&(_.$set=L({},_.$set,{[Tf.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===mO.SHOWN){var k=n==null?void 0:n[f_.TOUR_TYPE];k&&(_.$set=L({},_.$set,{[f_.TOUR_LAST_SEEN_DATE+"/"+k]:new Date().toISOString()}))}var C=L({},_.properties.$set,_.$set);if(Tn(C)||this.setPersonPropertiesForFlags(C),!re(this.config.before_send)){var I=this.kn(_);if(!I)return;(_=I).uuid=Dy(_.uuid,Un)}this.Ro.emit("eventCaptured",_);var P=(s=r==null?void 0:r._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),$={method:"POST",url:P,data:_,compression:"best-available",timestampMode:(r==null?void 0:r._batchKey)==="recordings"||/\/s\/(?:\?|$)/.test(P)?"body":"capture-body",batchKey:r==null?void 0:r._batchKey,transport:r==null?void 0:r.transport};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.Ko($):this.Jo.enqueue($),_}U.critical("This capture call is ignored due to client rate limiting.")}}else U.error("No event name provided to posthog.capture")}else U.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",n=>e(n.event,n))}sl(){var e;return(e=this.ul)!==null&&e!==void 0?e:this.ul=new UO(this)}Ao(e){this.Ho.push(e);var n=!0;return()=>{if(n){n=!1;var r=this.Ho.indexOf(e);r!==-1&&this.Ho.splice(r,1)}}}gl(e){var n,r,s;return e===void 0&&(e=!0),!((n=this.persistence)==null||!n.consumeCookieIdentityChange())&&(this.Vo=null,this.persistence.get_property(ue)===We&&((s=this.sessionPersistence)==null||s.clear(),this.jo.clear(),this.ml()),(r=this.featureFlags)==null||r.reset(),e&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,n,r,s,i){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;this.persistence.syncCookieProperties(),this.gl();var o=i?void 0:this.persistence.remove_event_timer(e),a=L({},n);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.Lo()&&(a[hE]=!0),e==="$snapshot"){var l=L({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!he(a.distinct_id)&&!Ke(a.distinct_id)||uc(a.distinct_id))&&U.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,c=function(E,S,k,C){var I,P,$,N;if(C===void 0&&(C=!1),!Mt)return{};var B,j=E?[...ko,...S||[]]:[],W=function(Or){for(var lt=0;jy.length>lt;lt++){var Mr=jy[lt],tn=Mr[1],Ut=Mr[0].exec(Or),Nr=Ut&&(yt(tn)?tn(Ut,Or):tn);if(Nr)return Nr}return["",""]}(Mt),q=W[0],G=W[1],M=(B=typeof navigator<"u"?navigator:void 0)!=null&&B.brave?{brave:!0}:{},T={};F(k)||(T.detectGoogleSearchApp=k);var z={},K=(I=navigator)==null||(I=I.userAgentData)==null?void 0:I.platform,H=(P=navigator)==null?void 0:P.maxTouchPoints,Q=O==null||($=O.screen)==null?void 0:$.width,X=O==null||(N=O.screen)==null?void 0:N.height,ie=O==null?void 0:O.devicePixelRatio;F(K)||(z.userAgentDataPlatform=K),F(H)||(z.maxTouchPoints=H),F(Q)||(z.screenWidth=Q),F(X)||(z.screenHeight=X),F(ie)||(z.devicePixelRatio=ie);var pe,se,ve,_e,Ze,Ot,et,ze,nr=xe(wg({$os:q,$os_version:G,$browser:Xb(Mt,navigator.vendor,M,T),$device:Fy(Mt),$device_type:(se=Mt,ve=z,ze=Fy(se),ze===Nb||ze===Mb||ze==="Kobo"||ze==="Kindle Fire"||ze===Wb?xo:ze===Qa||ze===Xi||ze===Ya||ze===up?"Console":ze===$b?"Wearable":ze?Yt:(ve==null?void 0:ve.userAgentDataPlatform)==="Android"&&((_e=ve==null?void 0:ve.maxTouchPoints)!==null&&_e!==void 0?_e:0)>0?600>Math.min((Ze=ve==null?void 0:ve.screenWidth)!==null&&Ze!==void 0?Ze:0,(Ot=ve==null?void 0:ve.screenHeight)!==null&&Ot!==void 0?Ot:0)/((et=ve==null?void 0:ve.devicePixelRatio)!==null&&et!==void 0?et:1)?Yt:xo:"Desktop"),$timezone:BE(),$timezone_offset:pO()}),{$current_url:el(C?ms(Ae==null?void 0:Ae.href):Ae==null?void 0:Ae.href,j,tl),$host:Ae==null?void 0:Ae.host,$pathname:Ae==null?void 0:Ae.pathname,$raw_user_agent:Mt.length>1e3?Mt.substring(0,997)+"...":Mt,$browser_version:uI(Mt,navigator.vendor,M,T),$browser_language:c_(),$browser_language_prefix:(pe=c_(),typeof pe=="string"?pe.split("-")[0]:void 0),$screen_height:O==null?void 0:O.screen.height,$screen_width:O==null?void 0:O.screen.width,$viewport_height:O==null?void 0:O.innerHeight,$viewport_width:O==null?void 0:O.innerWidth,$lib:Ce.LIB_NAME,$lib_version:Ce.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Ce.SDK_DIST_CHANNEL&&(nr.$sdk_dist_channel=Ce.SDK_DIST_CHANNEL),nr}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var d=this.sessionManager.checkAndGetSessionAndWindowId(i,r.getTime(),!0),f=d.windowId;a.$session_id=d.sessionId,a.$window_id=f}this.sessionPropsManager&&xe(a,this.sessionPropsManager.getSessionProps());try{var h;this.sessionRecording&&xe(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=(h=this.Yo)==null?void 0:h.length}catch(E){a.$sdk_debug_error_capturing_properties=String(E)}if(this.requestRouter.region===Fp&&(a.$lib_custom_api_host=this.config.api_host),u=e!==ki||i?e!==yf||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),a=xe(a,u),e===ki&&D&&(a.title=D.title),!F(o)){var _=r.getTime()-o;a.$duration=parseFloat((_/1e3).toFixed(3))}Mt&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser");var p=this.persistence.properties(),y=this.sessionPersistence.properties();ye(["$referrer","$referring_domain"],E=>{E in p&&delete y[E]});var v={};if(this.Ho.length>0)for(var m of this.Ho.slice())try{xe(v,m())}catch(E){U.error("Failed to produce browser extension event properties",E)}(a=xe({},c,p,y,L({},v,a))).$is_identified=this._isIdentified(),te(this.config.property_denylist)?ye(this.config.property_denylist,function(E){delete a[E]}):U.error(a1+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var x=this.config.sanitize_properties;x&&(U.error(C_),a=x(a,e));var b=this.yl();return a.$process_person_profile=b,b&&!i&&this.bl("_calculate_event_properties"),a}pl(e,n,r){var s;if(n===void 0&&(n=!0),r===void 0&&(r=!1),!this.persistence||!this.yl()||this.qo&&!r)return e;var i=this.persistence.get_initial_props(),o=(s=this.sessionPropsManager)==null?void 0:s.getSetOnceProps(),a=xe({},i,o||{},e||{}),l=this.config.sanitize_properties;return l&&(U.error(C_),a=l(a,"$set_once")),n&&(this.qo=!0),Tn(a)?void 0:a}register(e,n){var r;(r=this.persistence)==null||r.register(e,n)}register_once(e,n,r){var s;(s=this.persistence)==null||s.register_once(e,n,r)}register_for_session(e){var n,r;(n=this.persistence)==null||n.syncCookieProperties(),this.gl(),(r=this.sessionPersistence)==null||r.register(e),Object.keys(e).forEach(s=>this.jo.add(s)),this.ml()}unregister(e){var n;(n=this.persistence)==null||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)==null||n.unregister(e),this.jo.delete(e),this.ml()}_l(e,n){this.register({[e]:n})}Xo(){this.jo.forEach(e=>{var n;(n=this.sessionPersistence)==null||n.unregister(e)}),this.jo.clear(),this.ml()}ml(){var e;if(this.Bo)if(this.config.persistence==="memory"||(e=this.sessionPersistence)!=null&&e.Hs||!be.Dr())be.qr(this.Bo);else{var n=[];this.jo.forEach(r=>n.push(r)),n.length>0?be.Nr(this.Bo,n):be.qr(this.Bo)}}getFeatureFlag(e,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n;return(n=this.featureFlags)==null?void 0:n.getFeatureFlagPayload(e)}getFeatureFlagResult(e,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlagResult(e,n)}getAllFeatureFlags(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.getAllFeatureFlags())!==null&&e!==void 0?e:[]}isFeatureEnabled(e,n){var r,s;return(r=(s=this.featureFlags)==null?void 0:s.isFeatureEnabled(e,n))!==null&&r!==void 0?r:n==null?void 0:n.defaultValue}reloadFeatureFlags(){var e;(e=this.featureFlags)==null||e.reloadFeatureFlags()}updateFlags(e,n,r){var s;(s=this.featureFlags)==null||s.updateFlags(e,n,r)}updateEarlyAccessFeatureEnrollment(e,n,r){var s;(s=this.featureFlags)==null||s.updateEarlyAccessFeatureEnrollment(e,n,r)}getEarlyAccessFeatures(e,n,r){var s;return n===void 0&&(n=!1),(s=this.featureFlags)==null?void 0:s.getEarlyAccessFeatures(e,n,r)}on(e,n){return this.Ro.on(e,n)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:na}),()=>{})}onSessionId(e){var n,r;return(n=(r=this.sessionManager)==null?void 0:r.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n){n===void 0&&(n=!1),this.surveys?this.surveys.getSurveys(e,n):e([],{isLoaded:!1,error:na})}getActiveMatchingSurveys(e,n){n===void 0&&(n=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,n):e([],{isLoaded:!1,error:na})}renderSurvey(e,n){var r;(r=this.surveys)==null||r.renderSurvey(e,n)}displaySurvey(e,n){var r;n===void 0&&(n=LO),(r=this.surveys)==null||r.displaySurvey(e,n)}cancelPendingSurvey(e){var n;(n=this.surveys)==null||n.cancelPendingSurvey(e)}canRenderSurvey(e){var n,r;return(n=(r=this.surveys)==null?void 0:r.canRenderSurvey(e))!==null&&n!==void 0?n:{visible:!1,disabledReason:na}}canRenderSurveyAsync(e,n){var r,s;return n===void 0&&(n=!1),(r=(s=this.surveys)==null?void 0:s.canRenderSurveyAsync(e,n))!==null&&r!==void 0?r:Promise.resolve({visible:!1,disabledReason:na})}wl(e){return!e||uc(e)?(U.critical("Unique user id has not been set in posthog.identify"),!1):e===mi?(U.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(U.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(e,n,r){if(!this.__loaded||!this.persistence)return U.uninitializedWarning("posthog.identify");if(Ke(e)&&(e=e.toString(),U.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.wl(e)&&this.bl("posthog.identify")){this.$o();var s=this.get_distinct_id(),i=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==s,o=this.gl(!1),a=this.persistence.Ws(),l=!1;try{var u=this.get_distinct_id();this.register({$user_id:e}),this.get_property(Xa)||this.register_once({$had_persisted_distinct_id:!0,$device_id:u},""),e!==u&&e!==this.get_property(zi)&&(this.unregister(zi),this.register({distinct_id:e}));var c,d=(this.persistence.get_property(ue)||We)===We,f=e!==u,h=!f&&d;if(f&&d)this.persistence.set_property(ue,dt),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Vs(),this.capture(_f,{distinct_id:e,$anon_distinct_id:u},{$set:n||{},$set_once:r||{}}),this.Vo=Nf(e,n,r),(c=this.featureFlags)==null||c.setAnonymousDistinctId(u);else if(h){this.persistence.set_property(ue,dt);var _=n||{},p=r||{};this.setPersonPropertiesForFlags({$set:_,$set_once:p},!1),this.config.cookieWinsOnConflict&&this.persistence.Vs(),this.capture("$set",{$set:_,$set_once:p}),this.Vo=Nf(e,n,r)}else(n||r)&&this.setPersonProperties(n,r);f||i||o?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(pr)):h&&(n||r)&&this.reloadFeatureFlags(),l=!0}finally{a&&this.persistence.Qs(l)}}}setPersonProperties(e,n){if((e||n)&&this.bl("posthog.setPersonProperties")){var r=Nf(this.get_distinct_id(),e,n);this.Vo!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:n||{}},!0),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.Vo=r):U.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var n,r=(te(e)?e:[e]).filter(s=>he(s)&&s.length>0);r.length!==0&&this.bl("posthog.unsetPersonProperties")&&((n=this.featureFlags)==null||n.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.Vo=null)}group(e,n,r){var s;if(e&&n){(s=this.persistence)==null||s.syncCookieProperties(),this.gl();var i=this.getGroups(),o=i[e]!==n;if(o&&this.resetGroupPropertiesForFlags(e),this.register({$groups:L({},i,{[e]:n})}),o||r){var a={$group_type:e,$group_key:n};r&&(a.$group_set=r),this.capture(Gy,a)}r&&this.setGroupPropertiesForFlags({[e]:r}),o&&!r&&this.reloadFeatureFlags()}else U.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n){var r;n===void 0&&(n=!0),(r=this.featureFlags)==null||r.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(e){var n;e===void 0&&(e=!0),(n=this.featureFlags)==null||n.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,n){var r;n===void 0&&(n=!0),this.bl("posthog.setGroupPropertiesForFlags")&&((r=this.featureFlags)==null||r.setGroupPropertiesForFlags(e,n))}resetGroupPropertiesForFlags(e){var n;(n=this.featureFlags)==null||n.resetGroupPropertiesForFlags(e)}reset(e){var n=$t(e)?e:e==null?void 0:e.resetDeviceID,r=$t(e)||e==null?void 0:e.bootstrap;this.kl(n,!1,r)}kl(e,n,r){var s,i,o;if(n===void 0&&(n=!1),U.info("reset"),!this.__loaded)return U.uninitializedWarning("posthog.reset");var a=r==null?void 0:r.sessionID;this.config.bootstrap=r||((s=this.Zo)==null?void 0:s.bootstrap)||{},(i=this.featureFlags)==null||i.updateConfig==null||i.updateConfig(this.config,this.ma());var l=this.get_property(Xa),u=this.get_property(mf),c=this.get_property(Bs),d=this.is_capturing();this.consent.reset(),n||!d||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");var f=(o=this.persistence)==null||o.Ws==null?void 0:o.Ws(),h=!1;try{var _,p,y,v,m,x,b,E,S,k,C,I,P,$;if((_=this.persistence)==null||_.clear(),(p=this.sessionPersistence)==null||p.clear(),this.jo.clear(),this.ml(),F(c)||(C=this.persistence)==null||C.register({[Bs]:c}),(y=this.surveys)==null||y.reset(),(v=this.vl)==null||v.stop(),(m=this.featureFlags)==null||m.reset(),(x=this.conversations)==null||x.reset(),(b=this.logs)==null||b.reset(),(E=this.metrics)==null||E.reset(),(S=this.persistence)==null||S.set_property(ue,We),(k=this.sessionManager)==null||k.resetSessionId(),this.Vo=null,this.config.cookieless_mode===vr)this.register_once({distinct_id:mi,$device_id:null},"");else{var N=this.config.get_device_id(Un());this.register_once({distinct_id:N,$device_id:e?N:l},""),e||F(u)||this.register({[mf]:u})}if(this.register({$last_posthog_reset:new Date().toISOString()},1),r&&(r.distinctID===void 0||this.Lo()||(($=this.persistence)==null||$.set_property(ue,r.isIdentifiedID?dt:We),this.register({distinct_id:r.distinctID})),(I=this.featureFlags)==null||I.initialize(),!(F(a)||(P=this.sessionManager)!=null&&P.setBootstrapSessionId(a,!0)))){var B=L({},r);delete B.sessionID,this.config.bootstrap=B}delete this.config.identity_distinct_id,delete this.config.identity_hash,h=!0}finally{var j;f&&((j=this.persistence)==null||j.Qs==null||j.Qs(h))}this.reloadFeatureFlags()}shutdown(e){var n=this;return Pe(function*(){var r,s,i,o,a,l;if(n.__loaded){(r=n.vl)==null||r.stop(),n.sl().dispose(),(s=n.sessionRecording)==null||s.dispose(),(i=n.logs)==null||i.flushLogs("sendBeacon"),(o=n.metrics)==null||o.flush("sendBeacon"),(a=n.Jo)==null||a.unload(),(l=n.Yo)==null||l.unload();try{var u;(u=n.featureFlags)==null||u.destroy()}catch(c){U.error("Error while destroying feature flags",c)}}else U.uninitializedWarning("posthog.shutdown")})()}setIdentity(e,n){var r;this.config.identity_distinct_id=e,this.config.identity_hash=n,this.alias(e),(r=this.conversations)==null||r.Sl()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,(e=this.conversations)==null||e.xl()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,n;return(e=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var n=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=n.sessionStartTimestamp,s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n.sessionId);if(e!=null&&e.withTimestamp&&r){var i,o=(i=e.timestampLookBack)!==null&&i!==void 0?i:10;if(!r)return s;s+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-o,0)}return s}alias(e,n){return e===this.get_property(oE)?(U.critical("Attempting to create alias for existing People user - aborting."),-2):this.bl("posthog.alias")?(F(n)&&(n=this.get_distinct_id()),e!==n?(this._l(zi,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(U.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=L({},this.config);if(ke(e)){var r,s,i,o,a,l,u,c,d,f,h,_;xe(this.config,k_(e));var p=this.Do();(r=this.persistence)==null||r.update_config(this.config,n,p),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Pf(L({},this.config,{persistence:"sessionStorage"}),p,!1);var y,v=this.Go(this.config.debug);$t(v)&&(this.config.debug=v),$t(this.config.debug)&&(this.config.debug?(Ce.DEBUG=!0,we.Dr()&&we.Nr("ph_debug",!0),U.info("set_config",{config:e,oldConfig:n,newConfig:L({},this.config)})):(Ce.DEBUG=!1,we.Dr()&&we.qr("ph_debug"))),(s=this.featureFlags)==null||s.updateConfig==null||s.updateConfig(this.config,this.ma()),(i=this.exceptionObserver)==null||i.onConfigChange(),(o=this.exceptions)==null||o.onConfigChange(),(a=this.sessionRecording)==null||a.startIfEnabledOrStop(),(l=this.tracingHeaders)==null||l.startIfEnabledOrStop(),(u=this.autocapture)==null||u.startIfEnabled(),(c=this.heatmaps)==null||c.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&((y=this.historyAutocapture)==null||y.startIfEnabledOrStop()),(d=this.exceptionObserver)==null||d.startIfEnabledOrStop(),(f=this.deadClicksAutocapture)==null||f.startIfEnabledOrStop(),(h=this.surveys)==null||h.loadIfEnabled(),this.No(),(_=this.externalIntegrations)==null||_.startIfEnabledOrStop()}}_overrideSDKInfo(e,n){Ce.LIB_NAME=e,Ce.LIB_VERSION=n}startSessionRecording(e){var n,r,s,i,o,a=e===!0,l={sampling:a||!(e==null||!e.sampling),linked_flag:a||!(e==null||!e.linked_flag),url_trigger:a||!(e==null||!e.url_trigger),event_trigger:a||!(e==null||!e.event_trigger)};Object.values(l).some(Boolean)&&((n=this.sessionManager)==null||n.checkAndGetSessionAndWindowId(),l.sampling&&((r=this.sessionRecording)==null||r.overrideSampling()),l.linked_flag&&((s=this.sessionRecording)==null||s.overrideLinkedFlag()),l.url_trigger&&((i=this.sessionRecording)==null||i.overrideTrigger("url")),l.event_trigger&&((o=this.sessionRecording)==null||o.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,n){if(this.exceptions){var r=new Error("PostHog syntheticException"),s=this.exceptions.buildProperties(e,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(L({},s,n))}}addExceptionStep(e,n){var r;(r=this.exceptions)==null||r.addExceptionStep(e,n)}captureLog(e){var n;(n=this.logs)==null||n.captureLog(e)}get logger(){var e,n;return(e=(n=this.logs)==null?void 0:n.logger)!==null&&e!==void 0?e:Ht.Cl}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var n,r;return(n=(r=this.toolbar)==null?void 0:r.loadToolbar(e))!==null&&n!==void 0&&n}get_property(e){var n;return(n=this.persistence)==null?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)==null?void 0:n.props[e]}toString(){var e,n=(e=this.config.name)!==null&&e!==void 0?e:Pi;return n!==Pi&&(n=Pi+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(ue))===dt||((n=this.sessionPersistence)==null?void 0:n.get_property(ue))===dt}yl(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles===Pp&&!this._isIdentified()&&Tn(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[zi])&&((n=this.persistence)==null||(n=n.props)==null||!n[Ec]))}cl(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&!!this.config.capture_pageview}createPersonProfile(){this.yl()||this.bl("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.bl("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}bl(e){return this.config.person_profiles==="never"?(U.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._l(Ec,!0),!0)}Do(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==Ls)}No(){var e,n,r,s,i=this.Do();return((e=this.persistence)==null?void 0:e.Hs)!==i&&((r=this.persistence)==null||r.set_disabled(i)),((n=this.sessionPersistence)==null?void 0:n.Hs)!==i&&((s=this.sessionPersistence)==null||s.set_disabled(i)),i&&(this.jo.clear(),this.ml()),i}opt_in_capturing(e){var n;if(this.config.cookieless_mode!==vr){if(this.Lo()){var r,s,i,o,a;this.kl(!0,!0),(r=this.sessionManager)==null||r.destroy(),(s=this.pageViewManager)==null||s.destroy(),this.sessionManager=new x_(this),this.pageViewManager=new u_(this),this.persistence&&(this.sessionPropsManager=new __(this,this.sessionManager,this.persistence));var l,u=(i=(o=this.config.__extensionClasses)==null?void 0:o.sessionRecording)!==null&&i!==void 0?i:(a=Ht.__defaultExtensionClasses)==null?void 0:a.sessionRecording;u&&(this.sessionRecording=this.Oo(this.sessionRecording,new u(this)),this.Io&&((l=this.sessionRecording)==null||l.onRemoteConfig==null||l.onRemoteConfig(this.Io)))}var c,d;this.consent.optInOut(!0),this.No(),this.hl(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==Ls&&((c=this.surveys)==null||c.loadIfEnabled()),(F(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((d=e==null?void 0:e.captureEventName)!==null&&d!==void 0?d:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.dl()}else U.warn(S_)}opt_out_capturing(){var e,n,r;this.config.cookieless_mode!==vr?(this.config.cookieless_mode===Ls&&this.consent.isOptedIn()&&this.kl(!0,!0),this.consent.optInOut(!1),this.No(),this.config.cookieless_mode===Ls&&(this.register({distinct_id:mi,$device_id:null}),(e=this.sessionRecording)==null||e.stopRecording(),this.sessionRecording=void 0,(n=this.sessionManager)==null||n.destroy(),(r=this.pageViewManager)==null||r.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.dl(),this.hl())):U.warn(S_)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===1?"granted":e===0?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===vr||(this.config.cookieless_mode===Ls?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.No()}_is_bot(){return kt?e1(kt,this.config.custom_blocked_useragents):void 0}dl(){D&&(D.visibilityState==="visible"?this.Uo||(this.Uo=!0,this.capture(ki,{title:D.title},{send_instantly:!0}),this.zo&&(D.removeEventListener(Sc,this.zo),this.zo=null)):this.zo||(this.zo=this.dl.bind(this),Te(D,Sc,this.zo)))}debug(e){e===!1?(O==null||O.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(O==null||O.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}ma(){var e=this.Zo||{};return"advanced_disable_flags"in e?!!e.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(U.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):function(n,r,s,i,o){var a=r in n&&!re(n[r]),l=s in n&&!re(n[s]);return a?n[r]:!!l&&(o&&o.warn("Config field '"+s+"' is deprecated. Please use '"+r+"' instead. The old field will be removed in a future major version."),n[s])}(e,"advanced_disable_flags","advanced_disable_decide",0,U)}kn(e){var n;if(re(this.config.before_send))return e;var r=Object.keys((n=e.properties)!==null&&n!==void 0?n:{}).filter(XT),s=te(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var o of s)try{if(i=o(i),re(i)){var a="Event '"+e.event+"' was rejected in beforeSend function";return YT(e.event)?U.warn(a+". This can cause unexpected behavior."):U.info(a),null}i.properties&&!Tn(i.properties)||U.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}catch(u){return U.error("Error in beforeSend function for event '"+e.event+"':",u),null}for(var l of r)if(i.properties&&re(i.properties[l]))return U.warn("Event '"+e.event+"' had its '"+l+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return i}getPageViewId(){var e;return(e=this.pageViewManager.Ss)==null?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(r)})}Go(e){var n=$t(e)&&!e,r=we.Dr()&&we.Pr("ph_debug")==="true";return!n&&(!!r||e)}}Ht.__defaultExtensionClasses={},Ht.Cl=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),function(t,e){for(var n=0;e.length>n;n++)t.prototype[e[n]]=BI(t.prototype[e[n]])}(Ht,["identify"]);class u1{constructor(e){this.disabled=e===!1;var n=ke(e)?e:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(e,n,r){if(this.disabled)return!1;var s=this.clicks[this.clicks.length-1];if(s&&Math.abs(e-s.x)+Math.abs(n-s.y)r-s.timestamp){if(this.clicks.push({x:e,y:n,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:n,timestamp:r}];return!1}}var Lf="$copy_autocapture",tu=Oe("[AutoCapture]");function jf(t,e){return e.length>t?e.slice(0,t)+"...":e}function WO(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!ys(e));return e}function GO(t,e){var n,r,s=e.e,i=e.maskAllElementAttributes,o=e.maskAllText,a=e.elementAttributeIgnoreList,l=e.elementsChainAsString,u=e.disableCaptureUrlHashes;if(!ys(t))return{props:{}};for(var c=[t],d=new Set([t]),f=t;f.parentNode&&!Kt(f,"body")&&EE>c.length;)if(bE(f.parentNode)){var h=f.parentNode.host;if(d.has(h))break;d.add(h),c.push(h),f=h}else{if(!ys(f.parentNode)||d.has(f.parentNode))break;d.add(f.parentNode),c.push(f.parentNode),f=f.parentNode}var _,p,y=[],v={},m=!1,x=!1;if(ye(c,C=>{var I=Op(C);if(Kt(C,"a")){var P=C.getAttribute("href");m=!!(I&&P&&Pa(P))&&(u?ms(P):P)}ee(Rc(C),"ph-no-capture")&&(x=!0),y.push(function(N,B,j,W,q){q===void 0&&(q=!1);var G=N.tagName.toLowerCase(),M={tag_name:G};bg.indexOf(G)>-1&&!j&&(M.$el_text=G.toLowerCase()==="a"||G.toLowerCase()==="button"?jf(1024,o_(N)):jf(1024,Za(N)));var T=Rc(N);T.length>0&&(M.classes=T.filter(function(Q){return Q!==""})),ye(N.attributes,function(Q){var X;if((!TE(N)||["name","id","class","aria-label"].indexOf(Q.name)!==-1)&&(W==null||!W.includes(Q.name))&&!B&&Pa(Q.value)&&(!he(X=Q.name)||X.substring(0,10)!=="_ngcontent"&&X.substring(0,7)!=="_nghost")){var ie=Q.value;Q.name==="class"&&(ie=xg(ie).join(" ")),M["attr__"+Q.name]=jf(1024,Q.name==="href"&&q?ms(ie):ie)}});for(var z=1,K=1,H=N;H=WO(H);)z++,H.tagName===N.tagName&&K++;return M.nth_child=z,M.nth_of_type=K,M}(C,i,o,a,u));var $=function(N){if(!Op(N))return{};var B={};return ye(N.attributes,function(j){if(j.name&&j.name.indexOf("data-ph-capture-attribute")===0){var W=j.name.replace("data-ph-capture-attribute-",""),q=j.value;W&&q&&Pa(q)&&(B[W]=q)}}),B}(C);xe(v,$)}),x)return{props:{},explicitNoCapture:x};if(o||(y[0].$el_text=Kt(t,"a")||Kt(t,"button")?o_(t):Za(t)),m){var b,E;y[0].attr__href=m;var S=(b=So(m))==null?void 0:b.host,k=O==null||(E=O.location)==null?void 0:E.host;S&&k&&S!==k&&(_=m)}return{props:xe({$event_type:s.type,$ce_version:1},l?{}:{$elements:y},{$elements_chain:(p=y,function(C){return C.map(I=>{var P,$,N="";if(I.tag_name&&(N+=I.tag_name),I.attr_class)for(var B of(I.attr_class.sort(),I.attr_class))N+="."+B.replace(/"/g,"");var j=L({},I.text?{text:I.text}:{},{"nth-child":(P=I.nth_child)!==null&&P!==void 0?P:0,"nth-of-type":($=I.nth_of_type)!==null&&$!==void 0?$:0},I.href?{href:I.href}:{},I.attr_id?{attr_id:I.attr_id}:{},I.attributes),W={};return Tu(j).sort((q,G)=>q[0].localeCompare(G[0])).forEach(q=>{var G=q[1];return W[a_(q[0].toString())]=a_(G.toString())}),(N+=":")+Tu(W).map(q=>q[0]+'="'+q[1]+'"').join("")}).join(";")}(function(C){return C.map(I=>{var P,$,N={text:(P=I.$el_text)==null?void 0:P.slice(0,400),tag_name:I.tag_name,href:($=I.attr__href)==null?void 0:$.slice(0,2048),attr_class:oO(I),attr_id:I.attr__id,nth_child:I.nth_child,nth_of_type:I.nth_of_type,attributes:{}};return Tu(I).filter(B=>B[0].indexOf("attr__")===0).forEach(B=>N.attributes[B[0]]=B[1]),N})}(p)))},(n=y[0])!=null&&n.$el_text?{$el_text:(r=y[0])==null?void 0:r.$el_text}:{},_&&s.type==="click"?{$external_click_url:_}:{},v)}}class KO{constructor(e){this.name="autocapture",this.Qn=!1,this.Jn=null,this.Kn=!1,this.Yn=!1,this.qi={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.Xn=!1,this.ts=e,this.ts.refresh(this.qi),this.rageclicks=new u1(this.qi.rageclick),this.es=null}setup(e){this.rs(),this.ns=e;var n=e.onRemoteConfig(this.onRemoteConfig.bind(this));this.Xn?n.dispose():(this.ss=n,this.startIfEnabled())}dispose(){var e;this.Xn||(this.Xn=!0,this.ns=void 0,(e=this.ss)==null||e.dispose(),this.ss=void 0,this.os())}ls(){return this.ts.refresh(this.qi),this.qi}rs(){var e,n;return this.ls(),this.qi.url_allowlist=(e=this.qi.url_allowlist)==null?void 0:e.map(r=>new RegExp(r)),this.qi.url_ignorelist=(n=this.qi.url_ignorelist)==null?void 0:n.map(r=>new RegExp(r)),this.qi}us(){if(this.isBrowserSupported()){if(O&&D){var e=this.hs=r=>{r=r||(O==null?void 0:O.event);try{this.ds(r)}catch(s){tu.error("Failed to capture event",s)}};if(Te(D,"submit",e,{capture:!0}),Te(D,"change",e,{capture:!0}),Te(D,"click",e,{capture:!0}),this.ls().capture_copied_text){var n=this.vs=r=>{r=r||(O==null?void 0:O.event);try{this.ds(r,Lf)}catch(s){tu.error("Failed to capture copy/cut event",s)}};Te(D,"copy",n,{capture:!0}),Te(D,"cut",n,{capture:!0})}}}else tu.info("Disabling Automatic Event Collection because this browser is not supported")}os(){this.hs&&(D==null||D.removeEventListener("submit",this.hs,!0),D==null||D.removeEventListener("change",this.hs,!0),D==null||D.removeEventListener("click",this.hs,!0),this.hs=void 0),this.vs&&(D==null||D.removeEventListener("copy",this.vs,!0),D==null||D.removeEventListener("cut",this.vs,!0),this.vs=void 0),this.Qn=!1}startIfEnabled(){!this.Xn&&this.ns&&this.isEnabled&&!this.Qn&&(this.us(),this.Qn=!0)}onRemoteConfig(e){if(!this.Xn)if(this.Kn=!0,e.ok){var n=e.config;n.elementsChainAsString&&(this.Yn=n.elementsChainAsString);var r,s=n.autocapture_opt_out;$t(s)&&((r=this.ns)==null||r.kv.set(hp,s),this.Jn=s),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(e){this.es=e}getElementSelectors(e){var n,r=[];return(n=this.es)==null||n.forEach(s=>{var i=D==null?void 0:D.querySelectorAll(s);i==null||i.forEach(o=>{e===o&&r.push(s)})}),r}get isEnabled(){var e,n;if(this.Xn)return!1;var r=(e=this.ns)==null?void 0:e.kv.get(hp),s=this.Jn,i=this.ls(),o=i.remoteRequestsDisabled&&!this.Kn;if(it(s)&&!$t(r)&&!o)return!1;var a=(n=this.Jn)!==null&&n!==void 0?n:!!r;return!!i.enabled&&!a}ds(e,n){if(n===void 0&&(n="$autocapture"),this.isEnabled){var r=Tp(e);xE(r)&&(r=r.parentNode||null);var s,i=this.rs();n==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&i.rageclick&&(s=this.rageclicks)!=null&&s.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&PE(r,i.rageclick)&&this.ds(e,"$rageclick");var o=n===Lf;if(r&&function(_,p,y,v,m,x){var b;if(!O||Eg(_)||y!=null&&y.url_allowlist&&!Zy(y.url_allowlist,x)||y!=null&&y.url_ignorelist&&Zy(y.url_ignorelist,x))return!1;if(y!=null&&y.dom_event_allowlist){var E=y.dom_event_allowlist;if(E&&!E.some($=>p.type===$))return!1}var S=RE(_,v),k=S.parentIsUsefulElement,C=S.targetElementList;if(!function($,N){var B=N==null?void 0:N.element_allowlist;if(F(B))return!0;var j,W=function(G){if(B.some(M=>G.tagName.toLowerCase()===M))return{v:!0}};for(var q of $)if(j=W(q))return j.v;return!1}(C,y)||!Ip(C,y==null?void 0:y.css_selector_allowlist)||Ip(C,(b=y==null?void 0:y.css_selector_ignorelist)!==null&&b!==void 0?b:eO))return!1;try{var I=O.getComputedStyle(_);if(I&&I.getPropertyValue("cursor")==="pointer"&&p.type==="click")return!0}catch{}var P=_.tagName.toLowerCase();switch(P){case"html":return!1;case"form":return(m||["submit"]).indexOf(p.type)>=0;case"input":case"select":case"textarea":return(m||["change","click"]).indexOf(p.type)>=0;default:return k?(m||["click"]).indexOf(p.type)>=0:(m||["click"]).indexOf(p.type)>=0&&(bg.indexOf(P)>-1||_.getAttribute("contenteditable")==="true")}}(r,e,i,o,o?["copy","cut"]:void 0,{config:{get_current_url:i.getCurrentUrl}})){var a,l=GO(r,{e,maskAllElementAttributes:i.maskAllElementAttributes,maskAllText:i.maskAllText,elementAttributeIgnoreList:i.element_attribute_ignorelist,elementsChainAsString:this.Yn,disableCaptureUrlHashes:i.disableCaptureUrlHashes}),u=l.props;if(l.explicitNoCapture)return!1;var c=this.getElementSelectors(r);if(c&&c.length>0&&(u.$element_selectors=c),n===Lf){var d,f=SE(O==null||(d=O.getSelection())==null?void 0:d.toString()),h=e.type||"clipboard";if(!f)return!1;u.$selected_content=f,u.$copy_type=h}return(a=this.ns)==null||a.capture(n,u).catch(_=>tu.error("Failed to capture event",_)),!0}}}isBrowserSupported(){return yt(D==null?void 0:D.querySelectorAll)}}class QO{constructor(e){this._instance=e}refresh(e){var n=this._instance.config,r=ke(n.autocapture)?n.autocapture:void 0;e.enabled=!!n.autocapture,e.rageclick=n.rageclick,e.maskAllElementAttributes=n.mask_all_element_attributes,e.maskAllText=n.mask_all_text,e.disableCaptureUrlHashes=n.disable_capture_url_hashes,e.getCurrentUrl=n.get_current_url,e.remoteRequestsDisabled=this._instance.ma(),e.url_allowlist=r==null?void 0:r.url_allowlist,e.url_ignorelist=r==null?void 0:r.url_ignorelist,e.dom_event_allowlist=r==null?void 0:r.dom_event_allowlist,e.element_allowlist=r==null?void 0:r.element_allowlist,e.css_selector_allowlist=r==null?void 0:r.css_selector_allowlist,e.css_selector_ignorelist=r==null?void 0:r.css_selector_ignorelist,e.element_attribute_ignorelist=r==null?void 0:r.element_attribute_ignorelist,e.capture_copied_text=r==null?void 0:r.capture_copied_text}}var ra=Oe("[ExceptionAutocapture]"),P_=()=>{},YO=Oe("[TracingHeaders]"),Rs=Oe("[Web Vitals]"),R_=9e5,T_="disabled",I_="lazy_loading",sa="awaiting_config",nu="missing_config";Oe("[SessionRecording]"),Oe("[SessionRecording]");var Dp="[SessionRecording]",sr=Oe(Dp),XO=Oe("[Heatmaps]");function Ff(t){return ke(t)&&"clientX"in t&&"clientY"in t&&Ke(t.clientX)&&Ke(t.clientY)}var ru=Oe("[Product Tours]"),Df=t=>{var e;return!t.config.disable_product_tours&&!((e=t.persistence)==null||!e.get_property(mg))},JO=["$set_once","$set"],Fn=Oe("[SiteApps]"),O_="Error while initializing PostHog app with config id ",c1=(t,e)=>t!=null&&t.then?t.then(e):e(t),wi="SDK is not enabled or survey functionality is not yet loaded",M_="Disabled. Not loading surveys.";class ZO{constructor(e,n){this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Tl=!1,this.Ml=[],this.El=null,this.Il=null,this.Xn=!1,this.Rl=new Set,this.onRemoteConfig=r=>{if(!this.Xn&&!this.qi.disableSurveys){if(!r.ok)return ge.warn("Remote config unavailable. Not loading surveys.");var s=r.config.surveys;if(re(s))return ge.warn("Flags not loaded yet. Not loading surveys.");this.Pl=$t(s)?s:s.length>0,ge.info("flags response received, isSurveysEnabled: "+this.Pl),this.loadIfEnabled()}},this.ts=e,this.Al=n}setup(e){if(!this.Xn)return this.Fl=e,c1(e.kv.initialize(),()=>{if(this.Fl===e&&!this.Xn){this.Fl=void 0,this.ns=e;var n=e.onRemoteConfig(this.onRemoteConfig);this.Xn?n.dispose():(this.ss=n,this.loadIfEnabled())}})}dispose(){var e,n,r;this.Xn||(this.Xn=!0,this.Fl=void 0,this.ns=void 0,(e=this.ss)==null||e.dispose(),this.ss=void 0,(n=this._surveyEventReceiver)==null||n.dispose(),this._surveyEventReceiver=null,(r=this._surveyManager)==null||r.dispose==null||r.dispose(),this._surveyManager=null,this.Ml=[],this.El=null,this.Rl.forEach(s=>clearTimeout(s)),this.Rl.clear())}get qi(){return this.ts.get()}initialize(){this.loadIfEnabled()}reset(){try{var e;(e=this._surveyEventReceiver)==null||e.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var n=[],r=0;rlocalStorage.removeItem(i))}catch{}}loadIfEnabled(){if(!this.Xn&&this.ns){var e=this.qi;if(!this._surveyManager)if(this.Tl)ge.info("Already initializing surveys, skipping...");else if(e.disableSurveys)ge.info(M_);else if(e.cookielessMode&&this.ts.isOptedOut())ge.info("Not loading surveys in cookieless mode without consent.");else{var n=this.ts.getExtensions();if(n){if(!F(this.Pl)||e.advancedEnableSurveys){var r=this.Pl||e.advancedEnableSurveys;this.Tl=!0;try{var s=n.generateSurveys;if(s)return this.Ol(s,r),void(this.Tl=!1);var i=n.loadExternalDependency;if(!i)return this.Ll(_g),void(this.Tl=!1);i(o=>{try{if(this.Xn)return;var a=this.ts.getExtensions();o||a==null||!a.generateSurveys?this.Ll("Could not load surveys script",o):this.Ol(a.generateSurveys,r)}finally{this.Tl=!1}})}catch(o){throw this.Tl=!1,this.Ll("Error initializing surveys",o),o}}}else ge.error("PostHog Extensions not found.")}}}Ol(e,n){this.Xn||(this._surveyManager=e(n),this._surveyEventReceiver=this.ts.createEventReceiver(),ge.info("Surveys loaded successfully"),this.$l({isLoaded:!0}))}Ll(e,n){ge.error(e,n),this.$l({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Ml.push(e),this._surveyManager&&this.$l({isLoaded:!0}),()=>{this.Ml=this.Ml.filter(n=>n!==e)}}getSurveys(e,n){var r;n===void 0&&(n=!1);var s=(r=this.ns)!==null&&r!==void 0?r:this.Al;if(s&&!this.Xn){if(this.qi.disableSurveys)return ge.info(M_),e([]);var i=s.kv.get(wp);if(i&&!n)return e(i,{isLoaded:!0}),void(this.Dl()&&this.getSurveys(()=>{},!0));if(this.El)this.El.then(l=>{this.Xn||e(l.surveys,l.context)}).catch(l=>ge.error("Error in survey callback",l));else{var o=this.Nl("/api/surveys/",{method:"GET",query:{token:s.projectToken},sentAt:"query",timeoutMs:this.qi.requestTimeoutMs}).then(l=>{try{return this.ql(s,l)}catch(u){return ge.error("Error processing surveys response",u),this.ql(s,{statusCode:0,error:u})}},l=>this.ql(s,{statusCode:0,error:l}));this.El=o;var a=()=>{this.El===o&&(this.El=null)};o.then(l=>{a(),this.Xn||e(l.surveys,l.context)},a).catch(l=>ge.error("Error in survey callback",l))}}}Nl(e,n){var r=this.ns;return r?r.sendRequest(e,n):new Promise(s=>s({statusCode:0,error:new Error(wi)}))}ql(e,n){if(this.Xn)return{surveys:[],context:{isLoaded:!1,error:wi}};var r=n.statusCode;if(r!==200||!n.json){var s="Surveys API could not be loaded, status: "+r;return r!==0?ge.error(s):n.error||ge.warn(s),this.Il=Date.now(),{surveys:[],context:{isLoaded:!1,error:s}}}this.Il=null;var i,o=n.json.surveys||[],a=o.filter(l=>function(u){return!(!u.start_date||u.end_date)}(l)&&(s1(l)||function(u){var c;return!((c=u.conditions)==null||(c=c.actions)==null||(c=c.values)==null||!c.length)}(l)));return a.length>0&&((i=this._surveyEventReceiver)==null||i.register(a)),e.kv.set({[wp]:o,[xc]:Date.now()}),{surveys:o,context:{isLoaded:!0}}}Dl(){return this.jl()&&!this.El&&!this.Bl()}jl(){var e,n,r=(e=(n=this.ns)!==null&&n!==void 0?n:this.Al)==null?void 0:e.kv.get(xc);return Ke(r)&&Date.now()-r>3e5}Bl(){return Ke(this.Il)&&3e5>Date.now()-this.Il}markSurveyAsSeen(e,n){var r,s={id:e,current_iteration:(r=n==null?void 0:n.iteration)!==null&&r!==void 0?r:null};o1(s);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}}$l(e){for(var n of this.Ml)try{if(!e.isLoaded)return n([],e);this.getSurveys(n)}catch(r){ge.error("Error in survey callback",r)}}getActiveMatchingSurveys(e,n){if(n===void 0&&(n=!1),!re(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,n);ge.warn("init was not called")}Hl(e){var n=null;return this.getSurveys(r=>{var s;n=(s=r.find(i=>i.id===e))!==null&&s!==void 0?s:null}),n}Ul(e){if(re(this._surveyManager))return{eligible:!1,reason:wi};var n=typeof e=="string"?this.Hl(e):e;return n?this._surveyManager.checkSurveyEligibility(n):{eligible:!1,reason:"Survey not found"}}zl(e){if(re(this._surveyManager))return{eligible:!1,reason:wi};var n=typeof e=="string"?this.Hl(e):e;return n?this._surveyManager.checkSurveyRenderability(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(re(this._surveyManager))return ge.warn("init was not called"),{visible:!1,disabledReason:wi};var n=this.zl(e);return{visible:n.eligible,disabledReason:n.reason}}canRenderSurveyAsync(e,n){return re(this._surveyManager)?(ge.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:wi})):new Promise(r=>{this.getSurveys(s=>{var i,o=(i=s.find(l=>l.id===e))!==null&&i!==void 0?i:null;if(o){var a=this.zl(o);r({visible:a.eligible,disabledReason:a.reason})}else r({visible:!1,disabledReason:"Survey not found"})},n)})}renderSurvey(e,n,r){var s;if(re(this._surveyManager))ge.warn("init was not called");else{var i=typeof e=="string"?this.Hl(e):e;if(i!=null&&i.id)if($O.includes(i.type)){var o=D==null?void 0:D.querySelector(n);if(o)if((s=i.appearance)!=null&&s.surveyPopupDelaySeconds){ge.info("Rendering survey "+i.id+" with delay of "+i.appearance.surveyPopupDelaySeconds+" seconds");var a=setTimeout(()=>{var l,u;this.Rl.delete(a),this.Xn||(ge.info("Rendering survey "+i.id+" with delay of "+((l=i.appearance)==null?void 0:l.surveyPopupDelaySeconds)+" seconds"),(u=this._surveyManager)==null||u.renderSurvey(i,o,r),ge.info("Survey "+i.id+" rendered"))},1e3*i.appearance.surveyPopupDelaySeconds);this.Rl.add(a)}else this._surveyManager.renderSurvey(i,o,r);else ge.warn("Survey element not found")}else ge.warn("Surveys of type "+i.type+" cannot be rendered in the app");else ge.warn("Survey not found")}}displaySurvey(e,n){var r;if(re(this._surveyManager))ge.warn("init was not called");else{var s=this.Hl(e);if(s){var i=s;if((r=s.appearance)!=null&&r.surveyPopupDelaySeconds&&n.ignoreDelay&&(i=L({},s,{appearance:L({},s.appearance,{surveyPopupDelaySeconds:0})})),n.displayType!==Mp.Popover&&n.initialResponses&&ge.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),n.ignoreConditions===!1){var o=this.Ul(s);if(!o.eligible)return void ge.warn("Survey is not eligible to be displayed: ",o.reason)}n.displayType!==Mp.Inline?this._surveyManager.handlePopoverSurvey(i,n):this.renderSurvey(i,n.selector,n.properties)}else ge.warn("Survey not found")}}cancelPendingSurvey(e){re(this._surveyManager)?ge.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;(e=this._surveyManager)==null||e.handlePageUnload==null||e.handlePageUnload()}}function xi(t,e,n){if(re(t))return!1;switch(n){case"exact":return t===e;case"contains":var r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}class eM{constructor(e){this.Wl=new Set,this.Vl=new Set,this.Gl=new Mc,this.Zl=(n,r)=>this.Ql(n,r)&&this.Jl(n,r)&&this.Kl(n,r)&&this.Yl(n,r),this.Ql=(n,r)=>r==null||!r.event||(n==null?void 0:n.event)===(r==null?void 0:r.event),this._instance=e}init(){var e,n;F((e=this._instance)==null?void 0:e._addCaptureHook)||(this.Xl=(n=this._instance)==null?void 0:n._addCaptureHook((r,s)=>{this.on(r,s)}))}dispose(){var e;(e=this.Xl)==null||e.call(this),this.Xl=void 0,this.Gl=new Mc}register(e){var n,r;if(!F((n=this._instance)==null?void 0:n._addCaptureHook)&&(e.forEach(i=>{var o;this.Wl.add(i),(o=i.steps)==null||o.forEach(a=>{this.Vl.add((a==null?void 0:a.event)||"")})}),(r=this._instance)!=null&&r.autocapture)){var s=new Set;this.Wl.forEach(i=>{var o;(o=i.steps)==null||o.forEach(a=>{a!=null&&a.selector&&s.add(a.selector)})}),this._instance.autocapture.setElementSelectors(s)}}replace(e){this.Wl.clear(),this.Vl.clear(),this.register(e)}on(e,n){n!=null&&e.length!=0&&(this.Vl.has(e)||this.Vl.has(n.event))&&this.Wl.forEach(r=>{this.tu(n,r)&&this.Gl.emit("actionCaptured",r.name)})}eu(e){this.onAction("actionCaptured",n=>e(n))}tu(e,n){if((n==null?void 0:n.steps)==null)return!1;for(var r of n.steps)if(this.Zl(e,r))return!0;return!1}onAction(e,n){return this.Gl.on(e,n)}Jl(e,n){if(n!=null&&n.url){var r,s=e==null||(r=e.properties)==null?void 0:r.$current_url;if(!s||typeof s!="string"||!xi(s,n.url,n.url_matching||"contains"))return!1}return!0}Kl(e,n){return!!this.iu(e,n)&&!!this.ru(e,n)&&!!this.nu(e,n)}iu(e,n){var r;if(n==null||!n.href)return!0;var s=this.su(e);if(s.length>0)return s.some(a=>xi(a.href,n.href,n.href_matching||"exact"));var i,o=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!o&&xi((i=o.match(/(?::|")href="(.*?)"/))?i[1]:"",n.href,n.href_matching||"exact")}ru(e,n){var r;if(n==null||!n.text)return!0;var s=this.su(e);if(s.length>0)return s.some(u=>xi(u.text,n.text,n.text_matching||"exact")||xi(u.$el_text,n.text,n.text_matching||"exact"));var i,o,a,l=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!l&&(i=function(u){for(var c,d=[],f=/(?::|")text="(.*?)"/g;!re(c=f.exec(u));)d.includes(c[1])||d.push(c[1]);return d}(l),o=n.text,a=n.text_matching||"exact",i.some(u=>xi(u,o,a)))}nu(e,n){var r,s;if(n==null||!n.selector)return!0;var i=e==null||(r=e.properties)==null?void 0:r.$element_selectors;if(i!=null&&i.includes(n.selector))return!0;var o=(e==null||(s=e.properties)==null?void 0:s.$elements_chain)||"";if(n.selector_regex&&o)try{return new RegExp(n.selector_regex).test(o)}catch{return!1}return!1}su(e){var n;return(e==null||(n=e.properties)==null?void 0:n.$elements)==null?[]:e==null?void 0:e.properties.$elements}Yl(e,n){return n==null||!n.properties||n.properties.length===0||r1(n.properties.reduce((r,s)=>{var i=te(s.value)?s.value.map(String):s.value!=null?[String(s.value)]:[];return r[s.key]={values:i,operator:s.operator||"exact"},r},{}),e==null?void 0:e.properties)}}class tM{constructor(e){var n;this.au=[],this._instance=e,this.ou=new Map,this.lu=new Map,this.uu=new Map,this.hu=(n=this._instance)==null||n.onSessionId==null?void 0:n.onSessionId(r=>this.du(r))}vu(e){return!1}cu(){return null}fu(e){}pu(){}gu(e,n){return!!e&&r1(e.propertyFilters,n==null?void 0:n.properties)}mu(e,n){var r=new Map;return e.forEach(s=>{var i;(i=s.conditions)==null||(i=i[n])==null||(i=i.values)==null||i.forEach(o=>{if(o!=null&&o.name){var a=r.get(o.name)||[];a.push(s.id),r.set(o.name,a)}})}),r}yu(e,n,r){var s=(r===Zo.Activation?this.ou:this.lu).get(e),i=[];return this.bu(o=>{i=o.filter(a=>s==null?void 0:s.includes(a.id))}),i.filter(o=>{var a,l=(a=o.conditions)==null||(a=a[r])==null||(a=a.values)==null?void 0:a.find(u=>u.name===e);return this.gu(l,n)})}register(e){this._u(e,!1)}replace(e){this._u(e,!0)}_u(e,n){var r;F((r=this._instance)==null?void 0:r._addCaptureHook)||(this.wu(e,n),this.ku(e,n))}ku(e,n){var r=e.filter(o=>{var a;return(a=o.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length});if(n&&this.uu.clear(),r.length!==0){this.Su||(this.Su=new eM(this._instance),this.Su.init(),this.Su.eu(o=>this.onAction(o)));var s=[];r.forEach(o=>{var a;(a=o.conditions)==null||(a=a.actions)==null||a.values.forEach(l=>{if(s.push(l),l.name){var u,c=(u=this.uu.get(l.name))!==null&&u!==void 0?u:[];c.includes(o.id)||c.push(o.id),this.uu.set(l.name,c)}})}),n?this.Su.replace(s):this.Su.register(s)}else{var i;n&&((i=this.Su)==null||i.replace([]))}}xu(e,n){n.forEach((r,s)=>{var i,o=(i=e.get(s))!==null&&i!==void 0?i:[];r.forEach(a=>{o.includes(a)||o.push(a)}),e.set(s,o)})}wu(e,n){var r,s,i=e.filter(u=>{var c,d;return((c=u.conditions)==null?void 0:c.events)&&((d=u.conditions)==null||(d=d.events)==null||(d=d.values)==null?void 0:d.length)>0}),o=e.filter(u=>{var c,d;return((c=u.conditions)==null?void 0:c.cancelEvents)&&((d=u.conditions)==null||(d=d.cancelEvents)==null||(d=d.values)==null?void 0:d.length)>0}),a=this.mu(e,Zo.Activation),l=this.mu(e,Zo.Cancellation);n?(this.ou=a,this.lu=l):(this.xu(this.ou,a),this.xu(this.lu,l)),(i.length!==0||o.length!==0)&&((r=this.Xl)!==null&&r!==void 0||(this.Xl=(s=this._instance)==null?void 0:s._addCaptureHook((u,c)=>{this.onEvent(u,c)})))}onEvent(e,n){var r,s,i=this.Cu(),o=(n==null||(r=n.properties)==null?void 0:r.$survey_id)||(n==null||(s=n.properties)==null?void 0:s.$product_tour_id);if(o&&this.getActivatedIds().includes(o)){var a=this.Tu(e,o);if(a==="consume")return i.info("event consumed activated item, removing it",{event:e,itemId:o}),void this.Mu([o]);if(a==="persist")return i.info("shown item promoted to persisted activation",{event:e,itemId:o}),this.Eu(o),void this.Iu([o])}if(this.lu.has(e)){var l=this.yu(e,n,Zo.Cancellation);l.length>0&&(i.info("cancel event matched, cancelling items",{event:e,itemsToCancel:l.map(c=>c.id)}),this.Mu(l.map(c=>c.id)),l.forEach(c=>this.Ru(c.id)))}if(this.ou.has(e)){i.info("event name matched",{event:e,eventPayload:n,items:this.ou.get(e)});var u=this.yu(e,n,Zo.Activation);this.Pu(u.map(c=>c.id))}}onAction(e){this.uu.has(e)&&this.Pu(this.uu.get(e)||[])}Pu(e){var n;if(e.length!==0){var r=!((n=this._instance)==null||n.get_session_id==null||!n.get_session_id()),s=[];for(var i of e)r&&this.vu(i)?this.Eu(i)&&this.Au(i):s.push(i);s.length>0&&(this.au=[...new Set([...this.au,...s])]),this.Cu().info("updating activated items",{activatedItems:this.getActivatedIds()})}}Eu(e){this.au=this.au.filter(r=>r!==e);var n=this.Fu();return!n.includes(e)&&(this.Ou([...n,e]),this.Lu(),!0)}Mu(e){var n=new Set(e);this.au=this.au.filter(i=>!n.has(i));var r=this.$u(),s=r.filter(i=>!n.has(i));s.length!==r.length&&(this.Ou(s),s.length===0&&this.Du()),this.Iu(e)}Nu(){var e,n=this.cu();if(!n)return{};var r=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[n];return r&&typeof r=="object"?r:{}}Au(e){if(this.cu()){var n=this.Nu();this.fu(L({},n,{[e]:Date.now()}))}}Iu(e){if(this.cu()){var n=this.Nu(),r={},s=!1;for(var i of Object.entries(n)){var o=i[0],a=i[1];e.includes(o)?s=!0:r[o]=a}s&&(Tn(r)?this.pu():this.fu(r))}}qu(){this.cu()&&this.pu()}getActivationTimestamp(e){if(this.Fu().includes(e)){var n=this.Nu()[e];return Ke(n)?n:void 0}}$u(){var e,n=this.ju();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[n])||[]}Fu(){var e,n,r=this.$u();if(r.length===0)return[];var s=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[this.Bu()],i=(n=this._instance)==null||n.get_session_id==null?void 0:n.get_session_id();return i&&s===i?r:[]}Lu(){var e,n=(e=this._instance)==null||e.get_session_id==null?void 0:e.get_session_id();n&&this.Hu(n)}Du(){this.Uu()}du(e){var n,r=(n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[this.Bu()];if(r&&r!==e){var s=this.$u(),i=this.Nu();s.length>0&&(this.Ou([]),s.filter(o=>Ke(i[o])).forEach(o=>this.Ru(o))),this.Du(),this.qu()}}getActivatedIds(){return[...new Set([...this.Fu(),...this.au])].filter(e=>!this.zu(e))}dispose(){var e,n,r;(e=this.hu)==null||e.call(this),this.hu=void 0,(n=this.Xl)==null||n.call(this),this.Xl=void 0,(r=this.Su)==null||r.dispose(),this.Su=void 0}reset(){this.au=[],this.$u().length>0&&this.Ou([]),this.Du(),this.qu()}getEventToItemsMap(){return this.ou}Wu(){return this.Su}}class nM extends tM{constructor(e){super(e)}ju(){return xp}Bu(){return Pu}cu(){return Ru}fu(e){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[Ru]:e})}pu(){var e;(e=this._instance)==null||(e=e.persistence)==null||e.unregister(Ru)}vu(e){var n,r;this.bu(i=>{r=i.find(o=>o.id===e)});var s=(n=r)==null||(n=n.appearance)==null?void 0:n.surveyPopupDelaySeconds;return Ke(s)&&s>0}Vu(){return gr.SHOWN}bu(e){var n;(n=this._instance)==null||n.getSurveys(e)}Ru(e){var n;(n=this._instance)==null||n.cancelPendingSurvey(e)}Cu(){return ge}Ou(e){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[xp]:e})}Hu(e){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[Pu]:e})}Uu(){var e;(e=this._instance)==null||(e=e.persistence)==null||e.unregister(Pu)}zu(){return!1}Tu(e,n){var r;this.bu(i=>{r=i.find(o=>o.id===n)});var s=!r||function(i){var o;return s1(i)&&!((o=i.conditions)==null||(o=o.events)==null||!o.repeatedActivation)||i.schedule==="always"}(r);return s?e===gr.SHOWN?"consume":"ignore":e===gr.SHOWN?"persist":e===gr.DISMISSED||e===gr.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class rM{constructor(e){this._instance=e}initialize(){}get(e){if(typeof e=="string")return this._instance.get_property(e);var n={};for(var r of e){var s=this._instance.get_property(r);F(s)||(n[r]=s)}return n}set(e,n){this._instance.register(typeof e=="string"?{[e]:n}:e)}remove(e){typeof e!="string"?e.forEach(n=>this._instance.unregister(n)):this._instance.unregister(e)}}class sM{constructor(e){this._instance=e}get(){var e=this._instance.config;return{disableSurveys:e.disable_surveys,cookielessMode:!!e.cookieless_mode,advancedEnableSurveys:e.advanced_enable_surveys,requestTimeoutMs:e.surveys_request_timeout_ms}}isOptedOut(){return this._instance.consent.isOptedOut()}getExtensions(){var e=J==null?void 0:J.__PosthogExtensions__;if(e){var n=e.generateSurveys,r=e.loadExternalDependency;return{generateSurveys:n?s=>n(this._instance,s):void 0,loadExternalDependency:r?s=>r(this._instance,"surveys",s):void 0}}}createEventReceiver(){return new nM(this._instance)}}var iM=O!=null&&O.location?Tc(O.location.hash,"__posthog")||Tc(location.hash,"state"):null,N_="_postHogToolbarParams",A_=Oe("[Toolbar]"),$_=Oe("[FeatureFlags]");class oM{constructor(e,n){n===void 0&&(n=!1),this.Gu=!1,this.update(e,n)}update(e,n){this.Zu=((r,s)=>{var i,o,a,l;return{bootstrap:{featureFlags:(i=r.bootstrap)==null?void 0:i.featureFlags,featureFlagPayloads:(o=r.bootstrap)==null?void 0:o.featureFlagPayloads},remoteRequestsDisabled:s,featureFlagsDisabled:!!r.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!r.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!r.advanced_feature_flags_dedup_per_session,cacheTtlMs:r.feature_flag_cache_ttl_ms,requestTimeoutMs:r.feature_flag_request_timeout_ms,compression:r.disable_compression?"none":"base64",evaluationContexts:(a=(l=r.evaluation_contexts)!==null&&l!==void 0?l:r.evaluation_environments)!==null&&a!==void 0?a:[],flagKeys:te(r.flag_keys)?r.flag_keys:void 0}})(e,n),!e.evaluation_environments||e.evaluation_contexts||this.Gu||($_.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Gu=!0),F(e.flag_keys)||te(e.flag_keys)||$_.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")}get(){return this.Zu}}var L_=Oe("[FeatureFlags]"),Ts=Oe("[FeatureFlags]",{debugEnabled:!0}),zf=`" failed. Feature flags didn't load in time.`,j_="connection_error",F_=t=>{for(var e={},n=0;t.length>n;n++)e[t[n]]=!0;return e},D_=t=>{var e={};for(var n of Tu(t||{})){var r=n[1];r&&(e[n[0]]=r)}return e},wn=Oe("[Error tracking]"),aM=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:"],lM=["__firefox__","__gCrWeb"],z_="Refusing to render web experiment since the viewer is a likely bot",uM={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>Nc(e,t),not_regex:(t,e)=>!Nc(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class gt{get qi(){return this._instance.config}constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments(s=>{gt.Qu("retrieved web experiments from the server"),n.Ju=new Map,s.forEach(i=>{if(i.feature_flag_key){var o;n.Ju&&(gt.Qu("setting flag key ",i.feature_flag_key," to web experiment ",i),(o=n.Ju)==null||o.set(i.feature_flag_key,i));var a=n._instance.getFeatureFlag(i.feature_flag_key);he(a)&&i.variants[a]&&n.Ku(i.name,a,i.variants[a].transforms)}else if(i.variants)for(var l in i.variants){var u=i.variants[l];gt.Yu(u,n._instance)&&n.Ku(i.name,l,u.transforms)}})},r)},this._instance=e,this._instance.onFeatureFlags(r=>{this.onFeatureFlags(r)})}initialize(){}onFeatureFlags(e){if(this._is_bot())gt.Qu(z_);else if(!this.qi.disable_web_experiments){if(re(this.Ju))return this.Ju=new Map,this.loadIfEnabled(),void this.previewWebExperiment();gt.Qu("applying feature flags",e),e.forEach(n=>{var r;if(this.Ju&&(r=this.Ju)!=null&&r.has(n)){var s,i=this._instance.getFeatureFlag(n),o=(s=this.Ju)==null?void 0:s.get(n);i&&o!=null&&o.variants[i]&&this.Ku(o.name,i,o.variants[i].transforms)}})}}previewWebExperiment(){var e=gt.getWindowLocation();if(e!=null&&e.search){var n=Co(e==null?void 0:e.search,"__experiment_id"),r=Co(e==null?void 0:e.search,"__experiment_variant");n&&r&&(gt.Qu("previewing web experiments "+n+" && "+r),this.getWebExperiments(s=>{this.Xu(parseInt(n),r,s)},!1,!0))}}loadIfEnabled(){this.qi.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,r){if(this.qi.disable_web_experiments&&!r)return e([]);var s=this._instance.get_property("$web_experiments");if(s&&!n)return e(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.qi.token),method:"GET",timestampMode:"query",callback:i=>e(i.statusCode===200&&i.json&&i.json.experiments||[])})}Xu(e,n,r){var s=r.filter(i=>i.id===e);s&&s.length>0&&(gt.Qu("Previewing web experiment ["+s[0].name+"] with variant ["+n+"]"),this.Ku(s[0].name,n,s[0].variants[n].transforms))}static Yu(e,n){return!re(e.conditions)&>.th(e,n)&>.eh(e)}static th(e,n){var r;if(re(e.conditions)||re((r=e.conditions)==null?void 0:r.url))return!0;var s=gt.getWindowLocation();if(s){var i,o,a,l=_E(n,s.href);return(i=e.conditions)==null||!i.url||uM[(o=(a=e.conditions)==null?void 0:a.urlMatchType)!==null&&o!==void 0?o:"icontains"](e.conditions.url,l)}return!1}static getWindowLocation(){return O==null?void 0:O.location}static eh(e){var n;if(re(e.conditions)||re((n=e.conditions)==null?void 0:n.utm))return!0;var r=$E();if(r.utm_source){var s,i,o,a,l,u,c,d,f=(s=e.conditions)==null||(s=s.utm)==null||!s.utm_campaign||((i=e.conditions)==null||(i=i.utm)==null?void 0:i.utm_campaign)==r.utm_campaign,h=(o=e.conditions)==null||(o=o.utm)==null||!o.utm_source||((a=e.conditions)==null||(a=a.utm)==null?void 0:a.utm_source)==r.utm_source,_=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((u=e.conditions)==null||(u=u.utm)==null?void 0:u.utm_medium)==r.utm_medium,p=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_term||((d=e.conditions)==null||(d=d.utm)==null?void 0:d.utm_term)==r.utm_term;return f&&_&&p&&h}return!1}static Qu(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;n>s;s++)r[s-1]=arguments[s];U.info("[WebExperiments] "+e,r)}Ku(e,n,r){this._is_bot()?gt.Qu(z_):n!=="control"?r.forEach(s=>{if(s.selector){var i;gt.Qu("applying transform of variant "+n+" for experiment "+e+" ",s);var o=(i=document)==null?void 0:i.querySelectorAll(s.selector);o==null||o.forEach(a=>{var l=a;s.html&&(l.innerHTML=s.html),s.css&&l.setAttribute("style",s.css)})}}):gt.Qu("Control variants leave the page unmodified.")}_is_bot(){return kt&&this._instance?e1(kt,this.qi.custom_blocked_useragents):void 0}}var rn=Oe("[Conversations]"),Is="Conversations not available yet.",B_="console",d1="__posthogHandledLogsRequestError",Bf=(t,e)=>{var n=t instanceof Error?t:new Error(e);return n[d1]=!0,n},U_=t=>!!t&&typeof t=="object"&&t[d1]===!0,fd={featureFlags:class{constructor(t){this.name="featureFlags",this.ih=!1,this.featureFlagEventHandlers=[],this.I=L_,this.rh={},this.nh={},this.sh=[],this.ah=!1,this.oh=!1,this.lh=0,this.uh=!1,this.hh=!1,this.dh=!1,this.fh=!1,this.ph=0,this.Tt=()=>{var e=this.gh();this.ph=0,e&&this.reloadFeatureFlags()},"get"in t?this.ts=t:(this.mh=new oM(t.config,t.ma()),this.ts=this.mh)}updateConfig(t,e){var n;(n=this.mh)==null||n.update(t,e)}setup(t){return this.Fl=t,this.I=t.logger.createLogger("[FeatureFlags]"),c1(t.kv.initialize(),()=>{this.Fl===t&&(this.Fl=void 0,this.ns=t,this.yh(t))})}yh(t){if(this.ns===t)return O&&Te(O,"online",this.Tt),this.bh=t.registerDynamicEventProperties(()=>this._h()?this.rh:this.nh),this.wh(),this.initialize()}destroy(){O==null||O.removeEventListener("online",this.Tt)}dispose(){var t;this.lh++,this.hh=!1,this.Fl=void 0,this.ns&&(this.kh(),(t=this.bh)==null||t.dispose(),this.bh=void 0,this.sh=[],O==null||O.removeEventListener("online",this.Tt),this.ns=void 0)}get qi(){return this.ts.get()}Sh(t){var e;return(e=this.ns)==null?void 0:e.kv.get(t)}Nr(t){this.xh(()=>{var e;return(e=this.ns)==null?void 0:e.kv.set(t)})}qr(t){this.xh(()=>{var e;return(e=this.ns)==null?void 0:e.kv.remove(t)})}xh(t){try{t()}catch(e){this.I.error("Failed to update feature flag persistence",e)}}wh(){var t={};for(var e of[Us,Vs,Ji,Dn]){var n=this.Sh(e);F(n)||(t[e]=n)}this.rh=t;var r=L({},t),s=this.Sh(fr);if(s)for(var i of Object.entries(s))r["$feature/"+i[0]]=i[1];this.nh=r}_h(){var t=this.qi.cacheTtlMs;if(!t||0>=t)return!1;var e=this.Sh(Zs);return typeof e!="number"||Date.now()-e>t}Ch(){return!!this._h()&&(this.fh||this.oh||(this.fh=!0,this.I.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Th(){var t=this.qi.evaluationContexts;return t!=null&&t.length?t.filter(e=>{var n=e&&typeof e=="string"&&e.trim().length>0;return n||this.I.error("Invalid evaluation context found:",e,"Expected non-empty string"),n}):[]}Mh(){var t=this.qi.flagKeys;if(!F(t))return t.filter(e=>{var n=e&&typeof e=="string"&&e.trim().length>0;return n||this.I.error("Invalid flag key found:",e,"Expected non-empty string"),n})}initialize(){var t,e,n=this.qi,r=(t=(e=n.bootstrap)==null?void 0:e.featureFlags)!==null&&t!==void 0?t:{};if(Object.keys(r).length){var s,i,o=(s=(i=n.bootstrap)==null?void 0:i.featureFlagPayloads)!==null&&s!==void 0?s:{},a=Object.keys(r).filter(u=>!!r[u]).reduce((u,c)=>(u[c]=r[c]||!1,u),{}),l=Object.keys(o).filter(u=>a[u]).reduce((u,c)=>(u[c]=o[c],u),{});return this.Eh({featureFlags:a,featureFlagPayloads:l})}}updateFlags(t,e,n){var r,s,i=n!=null&&n.merge&&(r=this.Sh(fr))!==null&&r!==void 0?r:{},o=n!=null&&n.merge&&(s=this.Sh(Vs))!==null&&s!==void 0?s:{},a=L({},i,t),l=L({},o,e),u={};for(var c of Object.entries(a)){var d=c[0],f=c[1];u[d]={key:d,enabled:Iy(f),variant:Oy(f),reason:void 0,metadata:F(l==null?void 0:l[d])?void 0:{id:0,version:void 0,description:void 0,payload:l[d]}}}this.Eh({flags:u})}get hasLoadedFlags(){return this.ah}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.Sh(Ja),e=this.Sh(Dn),n=this.Sh($s);if(!n&&!e)return t||{};var r=xe({},t||{}),s=[...new Set([...Object.keys(n||{}),...Object.keys(e||{})])];for(var i of s){var o,a,l=r[i],u=e==null?void 0:e[i],c=F(u)?(o=l==null?void 0:l.enabled)!==null&&o!==void 0&&o:!!u,d=F(u)?l==null?void 0:l.variant:typeof u=="string"?u:void 0,f=n==null?void 0:n[i],h=L({},l,{enabled:c,variant:c?d??(l==null?void 0:l.variant):void 0});c!==(l==null?void 0:l.enabled)&&(h.original_enabled=l==null?void 0:l.enabled),d!==(l==null?void 0:l.variant)&&(h.original_variant=l==null?void 0:l.variant),f&&(h.metadata=L({},l==null?void 0:l.metadata,{payload:f,original_payload:l==null||(a=l.metadata)==null?void 0:a.payload})),r[i]=h}return this.ih||(this.I.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:n,finalDetails:r}),this.ih=!0),r}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map(n=>{var r=t[n];return{key:n,enabled:Iy(r),variant:Oy(r),payload:Ty(e[n])}})}getFlagVariants(){var t=this.Sh(fr),e=this.Sh(Dn);if(!e)return t||{};for(var n=xe({},t||{}),r=Object.keys(e),s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.ih||(this.I.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:n}),this.ih=!0),n}getFlagPayloads(){var t=this.Sh(Vs),e=this.Sh($s);if(!e)return t||{};for(var n=xe({},t||{}),r=Object.keys(e),s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.ih||(this.I.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:n}),this.ih=!0),n}reloadFeatureFlags(){this.uh||this.qi.featureFlagsDisabled||this.gh()||this.Ih||(this.sh.slice().forEach(t=>{try{t()}catch(e){this.I.error("Error while running feature flags reloading callback",e)}}),this.Ih=setTimeout(()=>{this.Rh()},5))}kh(){clearTimeout(this.Ih),this.Ih=void 0}onReloading(t){return this.sh.push(t),()=>{this.sh=this.sh.filter(e=>e!==t)}}ensureFlagsLoaded(){this.ah||this.oh||this.Ih||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.uh=t}resetFlagCallReported(){this.qr(pr)}Rh(t){this.kh();var e=this.ns;if(e&&!this.qi.remoteRequestsDisabled&&!this.gh())if(this.oh)this.hh=!0;else{var n={token:e.projectToken,distinct_id:e.distinctId,groups:e.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:L({},e.initialPersonProperties,this.Sh(En)||{},{$lib:e.library.name,$lib_version:e.library.version}),group_properties:this.Sh(Wn),timezone:BE()};F(e.deviceId)||(n.$device_id=e.deviceId),(t!=null&&t.disableFlags||this.qi.featureFlagsDisabled)&&(n.disable_flags=!0);var r=this.Th();r.length&&(n.evaluation_contexts=r);var s=this.Mh();F(s)||(n.flag_keys=s);var i=this.qi.onlyEvaluateSurveyFeatureFlags,o="/flags/?v=2"+(i?"&only_evaluate_survey_feature_flags=true":""),a=this.lh;this.oh=!0;var l=()=>{this.hh&&(this.hh=!1,this.Rh())},u=c=>{this.oh=!1,a===this.lh&&(this.Nr({[Zi]:[j_]}),this.I.error("Feature flag request failed",c)),l()};try{e.sendRequest(o,{target:"flags",method:"POST",body:n,compression:this.qi.compression==="base64"?St.Base64:void 0,sentAt:"body",timeoutMs:this.qi.requestTimeoutMs}).then(c=>{var d,f,h=(d=c.json)!==null&&d!==void 0?d:{},_=c.statusCode!==200;if(this.oh=!1,a===this.lh){if(this.Ph(c.statusCode),_||this.hh||(this.$anon_distinct_id=void 0),!n.disable_flags||this.hh){this.dh=!_;var p=[];c.error?p.push(c.error instanceof Error&&c.error.name==="AbortError"?"timeout":c.error instanceof Error?j_:"unknown_error"):c.statusCode!==200&&p.push("api_error_"+c.statusCode),h.errorsWhileComputingFlags&&p.push("errors_while_computing_flags");var y=!((f=h.quotaLimited)==null||!f.includes("feature_flags"));y&&p.push("quota_limited"),this.Nr({[Zi]:p}),y?this.I.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):n.disable_flags||this.Eh(h,_,{partialResponse:i}),l()}}else l()}).catch(u)}catch(c){u(c)}}}gh(){return NE(this.ph,3)}Ph(t){this.ph=AE(t,this.ph,3,()=>this.I.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes."))}getFeatureFlag(t,e){var n;if(e===void 0&&(e={}),!e.fresh||this.dh)if(this.ah||this.getFlags()&&this.getFlags().length>0){if(!this.Ch()){var r=this.getFeatureFlagResult(t,e);return(n=r==null?void 0:r.variant)!==null&&n!==void 0?n:r==null?void 0:r.enabled}}else this.I.warn('getFeatureFlag for key "'+t+zf)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e=this.getFeatureFlagResult(t,{send_event:!1});return e==null?void 0:e.payload}getFeatureFlagResult(t,e){if(e===void 0&&(e={}),!e.fresh||this.dh)if(this.ah||this.getFlags()&&this.getFlags().length>0){if(!this.Ch()){var n,r=this.getFlagVariants(),s=t in r,i=r[t],o=this.getFlagPayloads()[t],a=String(i),l=this.Sh(Ji)||void 0,u=this.Sh(Zs)||void 0,c=this.Sh(pr)||{};if(this.qi.deduplicateCallsPerSession){var d,f=(d=this.ns)==null?void 0:d.session.sessionId,h=this.Sh(pa);f&&f!==h&&(c={},n=f)}if(e.send_event||!("send_event"in e))if(t in c&&c[t].includes(a))n&&this.Nr({[pr]:c,[pa]:n});else{var _,p,y,v,m,x,b,E,S,k,C,I;te(c[t])?c[t].push(a):c[t]=[a],this.Nr(L({[pr]:c},n?{[pa]:n}:{}));var P=this.getFeatureFlagDetails(t),$=[...(_=this.Sh(Zi))!==null&&_!==void 0?_:[]];F(i)&&$.push("flag_missing");var N={$feature_flag:t,$feature_flag_response:i,$feature_flag_payload:o??null,$feature_flag_request_id:l,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:(p=(y=this.qi.bootstrap)==null||(y=y.featureFlags)==null?void 0:y[t])!==null&&p!==void 0?p:null,$feature_flag_bootstrapped_payload:(v=(m=this.qi.bootstrap)==null||(m=m.featureFlagPayloads)==null?void 0:m[t])!==null&&v!==void 0?v:null,$used_bootstrap_value:!this.dh};F(P==null||(x=P.metadata)==null?void 0:x.has_experiment)||(N.$feature_flag_has_experiment=P.metadata.has_experiment),F(P==null||(b=P.metadata)==null?void 0:b.version)||(N.$feature_flag_version=P.metadata.version);var B,j=(E=P==null||(S=P.reason)==null?void 0:S.description)!==null&&E!==void 0?E:P==null||(k=P.reason)==null?void 0:k.code;j&&(N.$feature_flag_reason=j),P!=null&&(C=P.metadata)!=null&&C.id&&(N.$feature_flag_id=P.metadata.id),F(P==null?void 0:P.original_variant)&&F(P==null?void 0:P.original_enabled)||(N.$feature_flag_original_response=F(P.original_variant)?P.original_enabled:P.original_variant),P!=null&&(I=P.metadata)!=null&&I.original_payload&&(N.$feature_flag_original_payload=P==null||(B=P.metadata)==null?void 0:B.original_payload),$.length&&(N.$feature_flag_error=$.join(",")),this.Ah(N)}else n&&this.Nr({[pr]:c,[pa]:n});if(s)return{key:t,enabled:!!i,variant:typeof i=="string"?i:void 0,payload:Ty(o)}}}else this.I.warn('getFeatureFlagResult for key "'+t+zf)}Ah(t){try{var e;(e=this.ns)==null||e.capture("$feature_flag_called",t).catch(n=>{this.I.error("Failed to capture feature flag call",n)})}catch(n){this.I.error("Failed to capture feature flag call",n)}}getRemoteConfigPayload(t,e){this.Fh(t,e)}Fh(t,e){var n=this;return Pe(function*(){var r=n.ns;if(r){var s={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},i=n.Th();i.length&&(s.evaluation_contexts=i);var o,a=n.Mh();F(a)||(s.flag_keys=a);try{var l,u=(l=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:s,compression:n.qi.compression==="base64"?St.Base64:void 0,sentAt:"body",timeoutMs:n.qi.requestTimeoutMs})).json)==null?void 0:l.featureFlagPayloads;o=(u==null?void 0:u[t])||void 0}catch(c){return void n.I.error("Remote config feature flag request failed",c)}try{e(o)}catch(c){n.I.error("Remote config feature flag callback failed",c)}}})()}isFeatureEnabled(t,e){if(e===void 0&&(e={}),e.fresh&&!this.dh)return e.defaultValue;if(!(this.ah||this.getFlags()&&this.getFlags().length>0))return this.I.warn('isFeatureEnabled for key "'+t+zf),e.defaultValue;var n=this.getFeatureFlag(t,e);return F(n)?e.defaultValue:!!n}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(e=>e!==t)}receivedFeatureFlags(t,e,n){this.Eh(t,e,n)}Eh(t,e,n){if(this.ns){this.ah=!0;var r=function(s,i,o,a,l,u){i===void 0&&(i={}),o===void 0&&(o={}),a===void 0&&(a={}),u===void 0&&(u=L_);var c=((S,k)=>{var C=S.flags;return C?L({},S,{featureFlags:Object.fromEntries(Object.keys(C).map(I=>{var P;return[I,(P=C[I].variant)!==null&&P!==void 0?P:C[I].enabled]})),featureFlagPayloads:Object.fromEntries(Object.keys(C).filter(I=>C[I].enabled).filter(I=>{var P;return(P=C[I].metadata)==null?void 0:P.payload}).map(I=>{var P;return[I,(P=C[I].metadata)==null?void 0:P.payload]}))}):(S.featureFlags&&k.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),S)})(s,u),d=c.flags,f=c.featureFlags,h=c.featureFlagPayloads;if(f){var _=s.requestId,p=s.evaluatedAt;if(te(f)){u.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var y={};if(f)for(var v=0;f.length>v;v++)y[f[v]]=!0;return{[Us]:f,[fr]:y,[wc]:!1}}var m=f,x=h,b=d;if(l!=null&&l.partialResponse)m=L({},i,m),x=L({},o,x),b=L({},a,b);else if(s.errorsWhileComputingFlags)if(d){var E=new Set(Object.keys(d).filter(S=>{var k;return!((k=d[S])!=null&&k.failed)}));m=L({},i,Object.fromEntries(Object.entries(m).filter(S=>E.has(S[0])))),x=L({},o,Object.fromEntries(Object.entries(x||{}).filter(S=>E.has(S[0])))),b=L({},a,Object.fromEntries(Object.entries(b||{}).filter(S=>E.has(S[0]))))}else m=L({},i,m),x=L({},o,x),b=L({},a,b);return L({[Us]:Object.keys(D_(m)),[fr]:m||{},[Vs]:x||{},[Ja]:b||{},[wc]:s.minimalFlagCalledEvents===!0},_?{[Ji]:_}:{},p?{[Zs]:p}:{})}}(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),n,this.I);r&&this.Nr(r),e||(this.fh=!1),this.Oh(e)}}override(t,e){e===void 0&&(e=!1),this.I.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){this.Lh(t)}Lh(t){if(this.ns){if(t===!1)return this.qr([Dn,$s]),this.Oh(),void Ts.info("All overrides cleared");if(te(t))return this.Nr({[Dn]:F_(t)}),this.Oh(),void Ts.info("Flag overrides set",{flags:t});if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var e,n=t;this.ih=!!((e=n.suppressWarning)!==null&&e!==void 0&&e);var r={},s=n.flags,i=n.payloads;return s&&(r[Dn]=te(s)?F_(s):s),i&&(r[$s]=i),Object.keys(r).length&&this.Nr(r),s===!1&&i===!1?this.qr([Dn,$s]):s===!1?this.qr(Dn):i===!1&&this.qr($s),this.Oh(),s===!1?Ts.info("Flag overrides cleared"):s&&Ts.info("Flag overrides set",{flags:s}),void(i===!1?Ts.info("Payload overrides cleared"):i&&Ts.info("Payload overrides set",{payloads:i}))}if(t&&typeof t=="object")return this.Nr({[Dn]:t}),this.Oh(),void Ts.info("Flag overrides set",{flags:t});this.I.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}else this.I.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.ah){var e=this.$h(),n=e.flags,r=e.flagVariants;try{t(n,r)}catch(s){this.I.error("Error while running feature flags callback",s)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,n){var r=(this.Sh(ku)||[]).find(l=>l.flagKey===t),s={["$feature_enrollment/"+t]:e},i={$feature_flag:t,$feature_enrollment:e,$set:s};r&&(i.$early_access_feature_name=r.name),n&&(i.$feature_enrollment_stage=n);var o=L({},this.getFlagVariants(),{[t]:e});this.Nr({[Us]:Object.keys(D_(o)),[fr]:o,[En]:L({},this.Sh(En)||{},s)}),this.Oh();try{var a;(a=this.ns)==null||a.capture("$feature_enrollment_update",i).catch(l=>{this.I.error("Failed to capture early access feature enrollment",l)})}catch(l){this.I.error("Failed to capture early access feature enrollment",l)}}getEarlyAccessFeatures(t,e,n){e===void 0&&(e=!1);var r=this.Sh(ku);!r||e?this.Dh(t,n):t(r)}Dh(t,e){var n=this;return Pe(function*(){var r=n.ns;if(r){var s,i=e?"&"+e.map(a=>"stage="+a).join("&"):"";try{var o=yield r.sendRequest("/api/early_access_features/?token="+r.projectToken+i,{target:"api",method:"GET",sentAt:"query"});if(!o.json)return;n.Nr({[ku]:s=o.json.earlyAccessFeatures})}catch(a){return void n.I.error("Early access feature request failed",a)}try{t(s)}catch(a){n.I.error("Early access feature callback failed",a)}}})()}$h(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter(n=>e[n]),flagVariants:Object.keys(e).filter(n=>e[n]).reduce((n,r)=>(n[r]=e[r],n),{})}}Oh(t){this.wh();var e=this.$h(),n=e.flags,r=e.flagVariants;this.featureFlagEventHandlers.forEach(s=>{try{s(n,r,{errorsLoading:t})}catch(i){this.I.error("Error while running feature flags callback",i)}})}setPersonPropertiesForFlags(t,e){e===void 0&&(e=!0),this.Nh(t,e)}Nh(t,e){e===void 0&&(e=!0);var n=this.Sh(En)||{},r=(t==null?void 0:t.$set)||(t!=null&&t.$set_once?{}:t),s=t==null?void 0:t.$set_once,i={};if(s)for(var o in s)({}).hasOwnProperty.call(s,o)&&(o in n||(i[o]=s[o]));this.Nr({[En]:L({},n,i,r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=L({},this.Sh(En)||{});t.forEach(r=>{delete n[r]}),this.Nr({[En]:n}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){t===void 0&&(t=!0),this.qr(En),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=this.Sh(Wn)||{},r=L({},n);for(var s of Object.keys(t))r[s]=L({},n[s],t[s]);this.Nr({[Wn]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.Sh(Wn)||{};this.Nr({[Wn]:L({},e,{[t]:{}})})}else this.qr(Wn)}reset(){this.lh++,this.hh=!1,this.rh={},this.nh={},this.ah=!1,this.uh=!1,this.dh=!1,this.$anon_distinct_id=void 0,this.kh(),this.ih=!1,this.ph=0}}},cM={sessionRecording:class{get qi(){return this._instance.config}get za(){return this._instance.persistence}get started(){var t;return!((t=this.qh)==null||!t.isStarted)}get status(){var t,e;return this.jh===sa||this.jh===nu?this.jh:(t=(e=this.qh)==null?void 0:e.status)!==null&&t!==void 0?t:this.jh}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.jh=T_,this.Bh=void 0,this.Hh=!1,this.kt=(()=>{var e;if(D==null||!D.visibilityState||D.visibilityState==="visible")return!0;var n=O==null||(e=O.performance)==null||e.getEntriesByType==null?void 0:e.getEntriesByType("visibility-state");return!(n!=null&&n.length)||n.some(r=>r.name==="visible")})(),this.It=()=>{var e;(D==null?void 0:D.visibilityState)==="visible"&&(this.kt=!0,(e=this.qh)==null||e.setDocumentWasEverVisible==null||e.setDocumentWasEverVisible(!0))},this._instance=t,!this._instance.sessionManager)throw sr.error("started without valid sessionManager"),new Error(Dp+" started without valid sessionManager. This is a bug.");if(this.qi.cookieless_mode===vr)throw new Error(Dp+' cannot be used with cookieless_mode="always"');D!=null&&D.addEventListener&&Te(D,"visibilitychange",this.It)}initialize(){this.startIfEnabledOrStop()}dispose(){this.Hh=!0,D==null||D.removeEventListener==null||D.removeEventListener("visibilitychange",this.It),this.stopRecording()}get Uh(){var t,e=!((t=this._instance.get_property(Bs))==null||!t.enabled),n=!this.qi.disable_session_recording,r=this.qi.disable_session_recording||this._instance.consent.isOptedOut();return O&&e&&n&&!r}startIfEnabledOrStop(t){var e;if(!(this.Hh||this.Uh&&(e=this.qh)!=null&&e.isStarted)){var n=!F(Object.assign)&&!F(Array.from);this.Uh&&n?(this.zh(t),sr.info("starting")):(this.jh=T_,this.stopRecording())}}zh(t){var e,n,r;this.Uh&&(this.jh!==sa&&this.jh!==nu&&(this.jh=I_),J!=null&&(e=J.__PosthogExtensions__)!=null&&(e=e.rrweb)!=null&&e.record&&(n=J.__PosthogExtensions__)!=null&&n.initSessionRecording?this.Wh(t):(r=J.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.Vh,s=>{if(s)return this._instance.register_for_session({[kp]:!0}),sr.error("could not load recorder",s);this.Wh(t)}))}stopRecording(){var t,e;(t=this.Bh)==null||t.call(this),this.Bh=void 0,(e=this.qh)==null||e.stop()}Gh(){var t,e;(t=this.Bh)==null||t.call(this),this.Bh=void 0,(e=this.qh)==null||e.discard()}Zh(){var t,e;(t=this.za)==null||t.unregister(yg),(e=this.za)==null||e.unregister(aE)}Qh(t,e){if(re(t))return null;var n,r=Ke(t)?t:parseFloat(t);return typeof(n=r)!="number"||!Number.isFinite(n)||0>n||n>1?(sr.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}Jh(t){if(this.za){var e,n,r=this.za,s=()=>{var i,o=t.sessionRecording===!1?void 0:t.sessionRecording,a=this.Qh((i=this.qi.session_recording)==null?void 0:i.sampleRate,"session_recording.sampleRate"),l=this.Qh(o==null?void 0:o.sampleRate,"remote config sampleRate"),u=a??l;re(u)&&this.Zh();var c=o==null?void 0:o.minimumDurationMilliseconds;r.register({[Bs]:L({cache_timestamp:Date.now(),enabled:!!o},o,{networkPayloadCapture:L({capturePerformance:t.capturePerformance},o==null?void 0:o.networkPayloadCapture),canvasRecording:{enabled:o==null?void 0:o.recordCanvas,fps:o==null?void 0:o.canvasFps,quality:o==null?void 0:o.canvasQuality},sampleRate:u,minimumDurationMilliseconds:F(c)?null:c,endpoint:o==null?void 0:o.endpoint,triggerMatchType:o==null?void 0:o.triggerMatchType,masking:o==null?void 0:o.masking,urlTriggers:o==null?void 0:o.urlTriggers,version:o==null?void 0:o.version,triggerGroups:o==null?void 0:o.triggerGroups})})};s(),(e=this.Bh)==null||e.call(this),this.Bh=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(s)}}onRemoteConfig(t){var e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?e.sessionRecording===!1?(this.Jh(e),void this.Gh()):(this.Jh(e),void this.startIfEnabledOrStop()):(this.jh===sa&&(this.jh=nu,sr.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var n;e===void 0&&(e="log"),(n=this.qh)!=null&&n.log?this.qh.log(t,e):sr.warn("log called before recorder was ready")}get Vh(){var t,e,n=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.get_property(Bs);return(n==null||(e=n.scriptConfig)==null?void 0:e.script)||"lazy-recorder"}Kh(){var t,e=this._instance.get_property(Bs);if(!e)return!1;try{t=typeof e=="object"?e:JSON.parse(e)}catch(n){return sr.warn("persisted remote config for session recording is invalid and will be ignored",n),!1}return!re(t.cache_timestamp)&&36e5>=Date.now()-t.cache_timestamp}Wh(t){var e,n,r;if(!this.Hh){if((e=J.__PosthogExtensions__)==null||!e.initSessionRecording)return sr.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[kp]:!0});var s;if(this.qh||(this.qh=(s=J.__PosthogExtensions__)==null?void 0:s.initSessionRecording(this._instance,this.kt),this.qh._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Kh())return this.jh===nu||this.jh===sa?void 0:(this.jh=sa,sr.info("persisted remote config is stale, requesting fresh config before starting"),void new UE(this._instance).load());this.jh=I_,(n=(r=this.qh).setDocumentWasEverVisible)==null||n.call(r,this.kt),this.qh.start(t)}}onRRwebEmit(t){var e;(e=this.qh)==null||e.onRRwebEmit==null||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.qh||(e=this.za)==null||e.register({[uE]:!0}),(t=this.qh)==null||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.qh||(e=this.za)==null||e.register({[lE]:!0}),(t=this.qh)==null||t.overrideSampling()}overrideTrigger(t){var e,n;this.qh||(n=this.za)==null||n.register({[t==="url"?cE:dE]:!0}),(e=this.qh)==null||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return((t=this.qh)==null?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var n;return!((n=this.qh)==null||!n.tryAddCustomEvent(t,e))}}},dM={autocapture:class extends KO{constructor(t){super(new QO(t)),this.instance=t}},historyAutocapture:class{constructor(t){this._instance=t,this.Yh=this.Xh()}initialize(){this.startIfEnabled()}get isEnabled(){var t=this.td();return!!(t.path||t.search||this.ed(t))}startIfEnabled(){this.isEnabled&&(U.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.Yh=this.Xh(),this.startIfEnabled()}stop(){this.rd&&this.rd(),this.rd=void 0,this.nd&&this.nd(),this.nd=void 0,U.info("History API monitoring stopped")}monitorHistoryChanges(){O&&O.history&&(this.sd("pushState"),this.sd("replaceState"),this.ad(),this.ed()&&this.od())}sd(t){var e;if(O&&((e=O.history[t])==null||!e.__posthog_wrapped__)){var n=this;(function(r,s,i){try{if(!(s in r))return P_;var o={next:r[s]},a=i(function(){for(var l=arguments.length,u=new Array(l),c=0;l>c;c++)u[c]=arguments[c];return o.next.apply(this,u)});return yt(a)&&(a.prototype=a.prototype||{},Object.defineProperties(a,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:o}})),r[s]=a,()=>{if(r[s]!==a)for(var l=r[s];yt(l)&&l.__posthog_layer__;){var u=l.__posthog_layer__;if(u.next===a)return void(u.next=o.next);l=u.next}else r[s]=o.next}}catch{return P_}})(O.history,t,r=>function(s,i,o){r.call(this,s,i,o),n.ld(t)})}}Xh(){var t=O==null?void 0:O.location;if(t!=null&&t.pathname)return{pathname:t.pathname,search:t.search,hash:t.hash}}td(){var t=this._instance.config.capture_pageview;return t==="history_change"?{path:!0}:ke(t)?t:{}}ed(t){return t===void 0&&(t=this.td()),!!t.hash&&!this._instance.config.disable_capture_url_hashes}ud(t){var e=this.td(),n=this.Yh;return!(!n||!(e.path&&t.pathname!==n.pathname||e.search&&t.search!==n.search||this.ed(e)&&t.hash!==n.hash))}ld(t){try{var e=this.Xh();if(!e)return;this.ud(e)&&this._instance.capture(ki,{navigation_type:t}),this.Yh=e}catch(n){U.error("Error capturing "+t+" pageview",n)}}ad(){if(!this.rd){var t=()=>{this.ld("popstate")};Te(O,"popstate",t),this.rd=()=>{O&&O.removeEventListener("popstate",t)}}}od(){if(!this.nd){var t=()=>{this.ld("hashchange")};Te(O,"hashchange",t),this.nd=()=>{O&&O.removeEventListener("hashchange",t)}}}},heatmaps:class{get qi(){return this.instance.config}constructor(t){var e;this.hd=!1,this.Qn=!1,this.dd=null,this.instance=t,this.hd=!((e=this.instance.persistence)==null||!e.props[pp]),this.rageclicks=new u1(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return ke(this.qi.capture_heatmaps)&&this.qi.capture_heatmaps.flush_interval_milliseconds&&(t=this.qi.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return re(this.qi.capture_heatmaps)?re(this.qi.enable_heatmaps)?this.hd:this.qi.enable_heatmaps:this.qi.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.Qn)return;XO.info("starting..."),this.vd(),this.It()}else{var t;clearInterval((t=this.dd)!==null&&t!==void 0?t:void 0),this.fd(),this.getAndClearBuffer()}}onRemoteConfig(t){if(t.ok){var e=t.config;if("heatmaps"in e){var n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[pp]:n}),this.hd=n,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.ft;return this.ft=void 0,t}pd(t){Ff(t.originalEvent)&&this.ki(t.originalEvent,"deadclick")}It(){this.dd&&clearInterval(this.dd),this.dd=(D==null?void 0:D.visibilityState)==="visible"?setInterval(this.Oa.bind(this),this.flushIntervalMilliseconds):null}vd(){O&&D&&(this.gd=this.Oa.bind(this),Te(O,Cc,this.gd),this.md=t=>this.ki(t||(O==null?void 0:O.event)),Te(D,"click",this.md,{capture:!0}),this.yd=t=>this.bd(t||(O==null?void 0:O.event)),Te(D,"mousemove",this.yd,{capture:!0}),this._d=new l_(this.instance,aO,this.pd.bind(this)),this._d.startIfEnabledOrStop(),this.wd=this.It.bind(this),Te(D,Sc,this.wd),this.Qn=!0)}fd(){var t;O&&D&&(this.gd&&O.removeEventListener(Cc,this.gd),this.md&&D.removeEventListener("click",this.md,{capture:!0}),this.yd&&D.removeEventListener("mousemove",this.yd,{capture:!0}),this.wd&&D.removeEventListener(Sc,this.wd),clearTimeout(this.kd),(t=this._d)==null||t.stop(),this.Qn=!1)}Sd(t,e){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),i=function(o,a,l){for(var u=o;u&&ys(u)&&!Kt(u,"body");){if(u===l)return!1;var c=void 0;try{var d,f,h;c=(d=(f=(h=u.ownerDocument)==null?void 0:h.defaultView)!==null&&f!==void 0?f:O)==null?void 0:d.getComputedStyle(u).position}catch{return!1}if(ee(a,c))return!0;u=CE(u)}return!1}(Tp(t),["fixed","sticky"],s);return{x:t.clientX+(i?0:r),y:t.clientY+(i?0:n),target_fixed:i,type:e}}ki(t,e){var n;if(e===void 0&&(e="click"),!Jy(t.target)&&Ff(t)){var r=this.Sd(t,e);(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&PE(Tp(t),this.instance.config.rageclick)&&this.Nn(L({},r,{type:"rageclick"})),this.Nn(r)}}bd(t){!Jy(t.target)&&Ff(t)&&(clearTimeout(this.kd),this.kd=setTimeout(()=>{this.Nn(this.Sd(t,"mousemove"))},500))}Nn(t){if(O){var e=this.qi.disable_capture_url_hashes?ms(O.location.href):O.location.href,n=this.qi.custom_personal_data_properties,r=this.qi.mask_personal_data_properties?[...ko,...n||[]]:[],s=el(e,r,tl);this.ft=this.ft||{},this.ft[s]||(this.ft[s]=[]),this.ft[s].push(t)}}Oa(){this.ft&&!Tn(this.ft)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:l_,webVitalsAutocapture:class{constructor(t){var e;this.hd=!1,this.Qn=!1,this.ft={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.xd=()=>{clearTimeout(this.Cd),this.Cd=void 0,this.ft.metrics.length!==0&&(this._instance.capture("$web_vitals",L({$current_url:this.ft.url},this.ft.metrics.reduce((n,r)=>L({},n,{["$web_vitals_"+r.name+"_event"]:L({},r),["$web_vitals_"+r.name+"_value"]:r.value}),{}))),this.ft={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Td=n=>{var r;if(this.ft=this.ft||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},re(n==null?void 0:n.name)||re(n==null?void 0:n.value))Rs.error("Invalid metric received",n);else{var s=typeof n.navigationURL=="string"?n.navigationURL:void 0,i=this.Md(s);if(!F(i)){var o=Ke(n.navigationId)||typeof n.navigationId=="string"?"navigation:"+n.navigationId:"url:"+i;if(!this.Ed||this.Ed>n.value){this.ft.navigationKey!==o&&(this.xd(),this.Cd=setTimeout(this.xd,this.flushToCaptureTimeoutMs)),F(this.ft.navigationKey)&&(this.ft.navigationKey=o,this.ft.url=i),this.ft.firstMetricTimestamp=F(this.ft.firstMetricTimestamp)?Date.now():this.ft.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0);var a=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0),l=L({},n,s?{navigationURL:i}:{},{$current_url:i,timestamp:Date.now()});F(a)||(l.$session_id=a.sessionId,l.$window_id=a.windowId),this.ft.metrics.push(l),this.ft.metrics.length===this.allowedMetrics.length&&this.xd()}else Rs.error("Ignoring metric with value >= "+this.Ed,n)}}},this.Id=()=>{if(!this.Qn){var n,r,s,i,o=J.__PosthogExtensions__,a=o==null?void 0:o.postHogWebVitalsCallbacksByFlavor,l=(a==null?void 0:a[this.Rd])||(this.Rd==="web-vitals"&&F(a)?o==null?void 0:o.postHogWebVitalsCallbacks:void 0);if(F(l)||(n=l.onLCP,r=l.onCLS,s=l.onFCP,i=l.onINP),n&&r&&s&&i){var u={reportSoftNavs:this.useSoftNavs};this.allowedMetrics.indexOf("LCP")>-1&&n(this.Td.bind(this),u),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Td.bind(this),u),this.allowedMetrics.indexOf("FCP")>-1&&s(this.Td.bind(this),u),this.allowedMetrics.indexOf("INP")>-1&&i(this.Td.bind(this),u),this.Qn=!0}else Rs.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.hd=!((e=this._instance.persistence)==null||!e.props[yp]),this.startIfEnabled()}get Pd(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,n=ke(this.Pd)?(t=this.Pd)==null?void 0:t.web_vitals_allowed_metrics:void 0;return re(n)?((e=this._instance.persistence)==null?void 0:e.props[_p])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(ke(this.Pd)?this.Pd.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=ke(this.Pd)?this.Pd.web_vitals_attribution:void 0;return t!=null&&t}get useSoftNavs(){var t=ke(this.Pd)?this.Pd.__preview_web_vitals_soft_navs:void 0;return t!=null&&t}get Ed(){var t=ke(this.Pd)&&Ke(this.Pd.__web_vitals_max_value)?this.Pd.__web_vitals_max_value:R_;return t>0&&6e4>=t?R_:t}get isEnabled(){var t=Ae==null?void 0:Ae.protocol;if(t!=="http:"&&t!=="https:")return Rs.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=ke(this.Pd)?this.Pd.web_vitals:$t(this.Pd)?this.Pd:void 0;return $t(e)?e:this.hd}startIfEnabled(){this.isEnabled&&!this.Qn&&(Rs.info("enabled, starting..."),this._s(this.Id))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var n=ke(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=ke(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[yp]:n}),this._instance.persistence.register({[_p]:r})),this.hd=n,this.startIfEnabled()}}}get Rd(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}_s(t){var e=J.__PosthogExtensions__,n=this.Rd,r=e==null?void 0:e.postHogWebVitalsCallbacksByFlavor;r!=null&&r[n]||n==="web-vitals"&&F(r)&&e!=null&&e.postHogWebVitalsCallbacks?t():e==null||e.loadExternalDependency==null||e.loadExternalDependency(this._instance,n,s=>{s?Rs.error("failed to load script",s):t()})}Md(t){var e=t||(O==null?void 0:O.location.href);if(e){var n=this._instance.config.disable_capture_url_hashes?ms(e):e,r=this._instance.config.custom_personal_data_properties,s=this._instance.config.mask_personal_data_properties?[...ko,...r||[]]:[];return el(n,s,tl)}Rs.error("Could not determine current URL")}}},fM={exceptionObserver:class{constructor(t){var e;this.Id=()=>{var n;if(O&&this.isEnabled&&(n=J.__PosthogExtensions__)!=null&&n.errorWrappingFunctions){var r=J.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=J.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=J.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Ad&&this.qi.capture_unhandled_errors&&(this.Ad=r(this.captureException.bind(this))),!this.Fd&&this.qi.capture_unhandled_rejections&&(this.Fd=s(this.captureException.bind(this))),!this.Od&&this.qi.capture_console_errors&&(this.Od=i(this.captureException.bind(this)))}catch(o){ra.error("failed to start",o),this.Ld()}}},this._instance=t,this.$d=!((e=this._instance.persistence)==null||!e.props[vp]),this.oe=new eI(L({},function(n){var r,s,i,o;return n===void 0&&(n={}),{refillRate:(r=(s=n.exceptionRateLimiterRefillRate)!==null&&s!==void 0?s:n.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(i=(o=n.exceptionRateLimiterBucketSize)!==null&&o!==void 0?o:n.__exceptionRateLimiterBucketSize)!==null&&i!==void 0?i:10}}(this._instance.config.error_tracking),{refillInterval:1e4,I:ra})),this.qi=this.Dd(),this.startIfEnabledOrStop()}Dd(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return ke(t)?e=L({},e,t):(F(t)?this.$d:t)&&(e=L({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.qi.capture_console_errors||this.qi.capture_unhandled_errors||this.qi.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(ra.info("enabled"),this.Ld(),this._s(this.Id)):this.Ld()}_s(t){var e,n;(e=J.__PosthogExtensions__)!=null&&e.errorWrappingFunctions?t():(n=J.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",r=>{if(r)return ra.error("failed to load script",r);t()})}Ld(){var t,e,n;(t=this.Ad)==null||t.call(this),this.Ad=void 0,(e=this.Fd)==null||e.call(this),this.Fd=void 0,(n=this.Od)==null||n.call(this),this.Od=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.$d=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[vp]:this.$d}),this.qi=this.Dd(),this.startIfEnabledOrStop())}}onConfigChange(){this.qi=this.Dd()}captureException(t){var e,n,r,s=(e=t==null||(n=t.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&e!==void 0?e:"Exception";this.oe.consumeRateLimit(s)?ra.info("Skipping exception capture because of client rate limiting.",{exception:s}):(r=this._instance.exceptions)==null||r.sendExceptionEvent(t)}},exceptions:class{constructor(t){var e,n;this.Nd=[],this.qd=new _I([new PI,new LI,new TI,new RI,new AI,new NI,new OI,new $I],function(r){for(var s=arguments.length,i=new Array(s>1?s-1:0),o=1;s>o;o++)i[o-1]=arguments[o];return function(a,l){l===void 0&&(l=0);for(var u=[],c=a.split(` -`),d=l;c.length>d;d++){var f=c[d];if(1024>=f.length){var h=Hy.test(f)?f.replace(Hy,"$1"):f;if(!h.match(/\S*Error: /)){for(var _ of i){var p=_(h,r);if(p){u.push(p);break}}if(u.length>=50)break}}}return function(y){if(!y.length)return[];var v=Array.from(y);return v.reverse(),v.slice(0,50).map(m=>{return L({},m,{filename:m.filename||(x=v,x[x.length-1]||{}).filename,function:m.function||Eo});var x})}(u)}}("web:javascript",EI,kI)),this._instance=t,this.Nd=(e=(n=this._instance.persistence)==null?void 0:n.get_property(gp))!==null&&e!==void 0?e:[],this.jd=yc(this.Bd()),this.Hd=new FI(this.jd)}onConfigChange(){this.jd=yc(this.Bd()),this.Hd.setConfig(this.jd)}onRemoteConfig(t){var e,n,r;if(t.ok){var s=t.config;if("errorTracking"in s){var i=(e=(n=s.errorTracking)==null?void 0:n.suppressionRules)!==null&&e!==void 0?e:[],o=(r=s.errorTracking)==null?void 0:r.captureExtensionExceptions;this.Nd=i,this._instance.persistence&&this._instance.persistence.register({[gp]:this.Nd,[mp]:o})}}}get Ud(){var t,e=!!this._instance.get_property(mp),n=this._instance.config.error_tracking.captureExtensionExceptions;return(t=n??e)!==null&&t!==void 0&&t}buildProperties(t,e){return this.qd.buildFromUnknown(t,{syntheticException:e==null?void 0:e.syntheticException,mechanism:{handled:e==null?void 0:e.handled}})}addExceptionStep(t,e){if(this.jd.enabled)try{if(!he(t)||t.trim().length===0)return void wn.warn("Ignoring exception step because message must be a non-empty string");var n=function(i){if(!i)return{sanitizedProperties:{},droppedKeys:[]};var o=[];return{sanitizedProperties:Object.keys(i).reduce((a,l)=>jI.has(l)?(o.push(l),a):(a[l]=i[l],a),{}),droppedKeys:o}}(this.zd(e)),r=n.sanitizedProperties,s=n.droppedKeys;s.length>0&&wn.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.Hd.add(L({[gc]:t,[mc]:new Date().toISOString()},r))}catch(i){wn.error("Failed to add exception step. Ignoring breadcrumb.",i)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.Wd(e)){if(this.Vd(e))return this.Gd("Exception dropped: matched a suppression rule"),void wn.info("Skipping exception capture because a suppression rule matched");if(!this.Ud&&this.Zd(e))return this.Gd("Exception dropped: thrown by a browser extension"),void wn.info("Skipping exception capture because it was thrown by an extension");if(!this.Ud&&this.Qd(e))return this.Gd("Exception dropped: thrown by an injected browser script"),void wn.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Jd(e))return this.Gd("Exception dropped: thrown by the PostHog SDK"),void wn.info("Skipping exception capture because it was thrown by the PostHog SDK")}var n=this.jd.enabled&&re(t.$exception_steps)?this.Kd(t):t,r=typeof(i=globalThis._posthogReleaseId)=="string"&&i.length>0?i:void 0;r&&(n.$release_id=r);try{var s=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",fl:!0});return s&&this.Hd.clear(),s}catch(o){return wn.error("Failed to capture exception event. Dropping this exception.",o),void this.Hd.clear()}}catch(o){return void wn.error("Failed to process exception event. Ignoring this exception.",o)}var i}Kd(t){try{var e=this.Hd.getAttachable();return e.length===0?t:L({},t,{$exception_steps:e})}catch(n){return wn.error("Failed to read buffered exception steps. Capturing exception without steps.",n),t}}Gd(t){this.jd.enabled&&this.Hd.add({[gc]:t,[mc]:new Date().toISOString()})}zd(t){return ke(t)?L({},t):{}}Bd(){var t,e;return(t=(e=this._instance.config.error_tracking)==null?void 0:e.exception_steps)!==null&&t!==void 0?t:{}}Vd(t){if(t.length===0)return!1;try{var e=t.reduce((n,r)=>{var s=r.type,i=r.value;return he(s)&&s.length>0&&n.$exception_types.push(s),he(i)&&i.length>0&&n.$exception_values.push(i),n},{$exception_types:[],$exception_values:[]});return this.Nd.some(n=>{var r=n.values.map(s=>{var i=n1[s.operator],o=e[s.key];if(!i||!o)return!1;var a=te(s.value)?s.value:[s.value];return a.length>0&&i(a,o)});return n.type==="OR"?r.some(Boolean):r.every(Boolean)})}catch(n){return wn.warn("Failed to evaluate suppression rules. Capturing the exception.",n),!1}}Zd(t){return t.flatMap(e=>{var n,r;return(n=(r=e.stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[]}).some(e=>{var n=e.filename;return!!n&&aM.some(r=>n.startsWith(r))})}Qd(t){return t.some(e=>{var n=e.value;return he(n)&&lM.some(r=>n.includes(r))})}Jd(t){if(t.length>0){var e,n,r,s,i=(e=(n=t[0].stacktrace)==null?void 0:n.frames)!==null&&e!==void 0?e:[],o=i[i.length-1];return(r=o==null||(s=o.filename)==null?void 0:s.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}Wd(t){return!re(t)&&te(t)}}},hM=L({productTours:class{get za(){return this._instance.persistence}constructor(t){this.Yd=null,this.Xd=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(t.ok){var e=t.config;if("productTours"in e){var n,r;if(this.za&&this.za.register({[mg]:!!e.productTours}),!Df(this._instance))return!this.Yd&&re((n=this.za)==null?void 0:n.props[ha])||ru.info("product tours disabled; stopping and clearing cached tours"),(r=this.Yd)==null||r.stop(),this.Yd=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.Yd&&Df(this._instance)&&this._s(()=>this.tv())}_s(t){var e,n;(e=J.__PosthogExtensions__)!=null&&e.generateProductTours?t():(n=J.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",r=>{r?ru.error("Could not load product tours script",r):t()})}tv(){var t;!this.Yd&&(t=J.__PosthogExtensions__)!=null&&t.generateProductTours&&(this.Yd=J.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(e===void 0&&(e=!1),!te(this.Xd)||e){var n=this.za;if(n){var r=n.props[ha];if(te(r)&&!e)return this.Xd=r,void t(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",timestampMode:"query",callback:s=>{if(Df(this._instance)){var i=s.statusCode;if(i!==200||!s.json){var o="Product Tours API could not be loaded, status: "+i;return i===0?s.error||ru.warn(o):ru.error(o),void t([],{isLoaded:!1,error:o})}var a=te(s.json.product_tours)?s.json.product_tours:[];this.Xd=a,n&&n.register({[ha]:a}),t(a,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.Xd,{isLoaded:!0})}getActiveProductTours(t){re(this.Yd)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.Yd.getActiveProductTours(t)}showProductTour(t){var e;(e=this.Yd)==null||e.showTourById(t)}previewTour(t){this.Yd?this.Yd.previewTour(t):this._s(()=>{var e;this.tv(),(e=this.Yd)==null||e.previewTour(t)})}dismissProductTour(){var t;(t=this.Yd)==null||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.Yd)==null||t.nextStep()}previousStep(){var t;(t=this.Yd)==null||t.previousStep()}clearCache(){var t;this.Xd=null,(t=this.za)==null||t.unregister(ha)}resetTour(t){var e;(e=this.Yd)==null||e.resetTour(t)}resetAllTours(){var t;(t=this.Yd)==null||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.Yd)==null||e.cancelPendingTour(t)}}},fd),pM={siteApps:class{constructor(t){this.ev=0,this._instance=t,this.iv=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}rv(t,e){if(e){var n=this.globalsForEvent(e);this.iv.push(n),this.iv.length>1e3&&(this.iv=this.iv.slice(10))}}get siteAppLoaders(){var t;return(t=J._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.rv.bind(this));this.nv=()=>{t(),this.iv=[],this.nv=void 0}}}globalsForEvent(t){var e,n,r,s,i,o,a;if(!t)throw new Error("Event payload is required");var l={},u=this._instance.get_property("$groups")||[],c=this._instance.get_property("$stored_group_properties")||{};for(var d of Object.entries(c)){var f=d[0];l[f]={id:u[f],type:f,properties:d[1]}}var h=t.$set_once,_=t.$set;return{event:L({},Eb(t,JO),{properties:L({},t.properties,_?{$set:L({},(e=(n=t.properties)==null?void 0:n.$set)!==null&&e!==void 0?e:{},_)}:{},h?{$set_once:L({},(r=(s=t.properties)==null?void 0:s.$set_once)!==null&&r!==void 0?r:{},h)}:{}),elements_chain:(i=(o=t.properties)==null?void 0:o.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(a=t.properties)==null?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}sv(t){var e,n=(e=t.tagName)==null?void 0:e.toLowerCase();return n==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(Fn.error("prepare_external_dependency_stylesheet returned null"),null):n==="script"&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(t)||(Fn.error("prepare_external_dependency_script returned null"),null):t}av(){var t,e,n,r,s,i,o,a;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var l=D==null?void 0:D.defaultView,u=l==null||(t=l.Node)==null?void 0:t.prototype;if(!l||!u)return()=>{};if(this.ev++,this.ov)return this.lv();var c=[],d=this,f=new WeakSet,h=(y,v,m)=>{if(y!=null&&y[v]){var x=y[v];y[v]=m(x),c.push(()=>{y[v]=x})}},_=y=>{if(f.has(y))return y;var v=d.sv(y);return v&&f.add(v),v},p=y=>y.map(v=>typeof v=="string"?v:_(v)).filter(v=>!it(v));return h(u,"appendChild",y=>function(v){var m=_(v);return m?y.call(this,m):v}),h(u,"insertBefore",y=>function(v,m){var x=_(v);return x?y.call(this,x,m):v}),h(u,"replaceChild",y=>function(v,m){var x=_(v);return x?y.call(this,x,m):m}),[(e=l.Element)==null?void 0:e.prototype,(n=l.Document)==null?void 0:n.prototype,(r=l.DocumentFragment)==null?void 0:r.prototype].forEach(y=>{h(y,"append",v=>function(){for(var m=arguments.length,x=new Array(m),b=0;m>b;b++)x[b]=arguments[b];return v.apply(this,p(x))}),h(y,"prepend",v=>function(){for(var m=arguments.length,x=new Array(m),b=0;m>b;b++)x[b]=arguments[b];return v.apply(this,p(x))})}),[(s=l.Element)==null?void 0:s.prototype,(i=l.CharacterData)==null?void 0:i.prototype,(o=l.DocumentType)==null?void 0:o.prototype].forEach(y=>{h(y,"before",v=>function(){for(var m=arguments.length,x=new Array(m),b=0;m>b;b++)x[b]=arguments[b];return v.apply(this,p(x))}),h(y,"after",v=>function(){for(var m=arguments.length,x=new Array(m),b=0;m>b;b++)x[b]=arguments[b];return v.apply(this,p(x))}),h(y,"replaceWith",v=>function(){for(var m=arguments.length,x=new Array(m),b=0;m>b;b++)x[b]=arguments[b];var E=p(x);return x.length&&!E.length?void 0:v.apply(this,E)})}),h((a=l.Element)==null?void 0:a.prototype,"insertAdjacentElement",y=>function(v,m){var x=_(m);return x?y.call(this,v,x):null}),this.ov=()=>{c.forEach(y=>y()),this.ov=void 0},this.lv()}lv(){var t=!1;return()=>{var e;t||(t=!0,this.ev--,this.ev===0&&((e=this.ov)==null||e.call(this)))}}uv(t,e){e===void 0&&(e=!0);var n=this.av();try{var r=t(n);return e&&n(),r}catch(s){throw n(),s}}setupSiteApp(t){var e=this.apps[t.id],n=()=>{var o;!e.errored&&this.iv.length&&(Fn.info("Processing "+this.iv.length+" events for site app with id "+t.id),this.iv.forEach(a=>this.uv(()=>e.processEvent==null?void 0:e.processEvent(a))),e.processedBuffer=!0),Object.values(this.apps).every(a=>a.processedBuffer||a.errored)&&((o=this.nv)==null||o.call(this))},r=!1,s=o=>{e.errored=!o,e.loaded=!0,Fn.info("Site app with id "+t.id+" "+(o?"loaded":"errored")),r&&n()};try{var i=this.uv(o=>t.init({posthog:this._instance,callback(a){o(),s(a)}}),!1).processEvent;i&&(e.processEvent=i),r=!0}catch(o){Fn.error(O_+t.id,o),s(!1)}if(r&&e.loaded)try{n()}catch(o){Fn.error("Error while processing buffered events PostHog app with config id "+t.id,o),e.errored=!0}}hv(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of t)this.setupSiteApp(n)}dv(t){var e=this;if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(t),r=function(i){try{e.uv(()=>i.processEvent==null?void 0:i.processEvent(n))}catch(o){Fn.error("Error while processing event "+t.event+" for site app "+i.id,o)}};for(var s of Object.values(this.apps))r(s)}}onRemoteConfig(t){var e,n,r,s=this;if((e=this.siteAppLoaders)!=null&&e.length)return this.isEnabled?(this.hv(),void this._instance.on("eventCaptured",l=>this.dv(l))):void Fn.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.nv)==null||n.call(this),t.ok){var i=t.config;if((r=i.siteApps)!=null&&r.length)if(this.isEnabled){var o=function(){var l,u=a.id,c=a.url;J["__$$ph_site_app_"+u]=s._instance,(l=J.__PosthogExtensions__)==null||l.loadSiteApp==null||l.loadSiteApp(s._instance,c,d=>{if(d)return Fn.error(O_+u,d)})};for(var a of i.siteApps)o()}else Fn.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},vM={tracingHeaders:class{constructor(t){this.vv=void 0,this.fv=void 0,this.pv=void 0,this.Id=()=>{var e,n,r=this.gv();r?(F(this.vv)&&(this.vv=(e=J.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null?void 0:e._patchXHR(r,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),F(this.fv)&&(this.fv=(n=J.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null?void 0:n._patchFetch(r,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.Ld()},this._instance=t}initialize(){this.startIfEnabledOrStop()}_s(t){var e,n;(e=J.__PosthogExtensions__)!=null&&e.tracingHeadersPatchFns?t():(n=J.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",r=>{if(r)return YO.error("failed to load script",r);t()})}mv(){var t,e;return(t=(e=this._instance.config.tracing_headers)!==null&&e!==void 0?e:this._instance.config.addTracingHeaders)!==null&&t!==void 0?t:this._instance.config.__add_tracing_headers}gv(){var t=this.mv();return te(t)?(te(this.pv)?this.pv.splice(0,this.pv.length,...t):this.pv=[...t],t.length>0?this.pv:void 0):(te(this.pv)&&this.pv.splice(0),this.pv=t||void 0,this.pv)}Ld(){var t,e;(t=this.vv)==null||t.call(this),(e=this.fv)==null||e.call(this),this.vv=void 0,this.fv=void 0}startIfEnabledOrStop(){this.gv()?this._s(this.Id):this.Ld()}}},gM=L({surveys:class extends ZO{constructor(t){var e;super(new sM(t),{get projectToken(){return e.config.token},kv:new rM(e=t)}),this._instance=t}Nl(t,e){var n=e.query?wl(t,e.query):t;return new Promise(r=>{var s;this._instance._send_request({method:e.method,url:this._instance.requestRouter.endpointFor((s=e.target)!==null&&s!==void 0?s:"api",n),data:e.body,headers:e.headers,timeout:e.timeoutMs,fireCallbackOnDrop:!0,transport:e.transport,compression:e.compression,timestampMode:e.sentAt,callback:r})})}}},fd),mM={toolbar:class{constructor(t){this.instance=t}yv(t){J.ph_toolbar_state=t}bv(){var t;return(t=J.ph_toolbar_state)!==null&&t!==void 0?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,e,n){if(t===void 0&&(t=void 0),e===void 0&&(e=void 0),n===void 0&&(n=void 0),Rp(this.instance.config)||!O||!D)return!1;t=t??O.location,n=n??O.history;try{if(!e){try{O.localStorage.setItem("test","test"),O.localStorage.removeItem("test")}catch{return!1}e=O==null?void 0:O.localStorage}var r,s=iM||Tc(t.hash,"__posthog")||Tc(t.hash,"state"),i=s?Ky(()=>JSON.parse(atob(decodeURIComponent(s))))||Ky(()=>JSON.parse(decodeURIComponent(s))):null;return i&&i.action==="ph_authorize"?((r=i).source="url",r&&Object.keys(r).length>0&&(i.desiredHash?t.hash=i.desiredHash:n?n.replaceState(n.state,"",t.pathname+t.search):t.hash="")):((r=JSON.parse(e.getItem(N_)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch{return!1}}_v(t){var e=J.ph_load_toolbar||J.ph_load_editor;!re(e)&&yt(e)?e(t,this.instance):A_.warn("No toolbar load function found")}loadToolbar(t){var e=!(D==null||!D.getElementById(wE));if(!O||e)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=L({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(O.localStorage.setItem(N_,JSON.stringify(L({},r,{source:void 0}))),this.bv()===2)this._v(r);else if(this.bv()===0){var s;this.yv(1),(s=J.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this.instance,"toolbar",i=>{if(i)return A_.error("[Toolbar] Failed to load",i),void this.yv(0);this.yv(2),this._v(r)}),Te(O,"turbolinks:load",()=>{this.yv(0),this.loadToolbar(r)})}return!0}wv(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,n){return t===void 0&&(t=void 0),e===void 0&&(e=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(t,e,n)}}},yM=L({experiments:gt},fd),_M={conversations:class{constructor(t){this.Sv=void 0,this._conversationsManager=null,this.xv=!1,this.Me=null,this.Cv=!1,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&(this.Tv=t.ok,t.ok)){var e=t.config.conversations;re(e)||($t(e)?this.Sv=e:(this.Sv=e.enabled,this.Me=e),this.loadIfEnabled())}}reset(){var t;(t=this._conversationsManager)==null||t.reset(),this._conversationsManager=null,this.Sv=void 0,this.Me=null,this.Tv=void 0,this.Cv=!1}loadIfEnabled(){if(!(this._conversationsManager||this.xv||this._instance.config.disable_conversations||Rp(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=J==null?void 0:J.__PosthogExtensions__;if(t&&!F(this.Sv)&&this.Sv)if(this.Me&&this.Me.token){this.xv=!0;try{var e=t.initConversations;if(e)return this.Mv(e),void(this.xv=!1);var n=t.loadExternalDependency;if(!n)return void this.Ev(_g);n(this._instance,"conversations",r=>{r||!t.initConversations?this.Ev("Could not load conversations script",r):this.Mv(t.initConversations),this.xv=!1})}catch(r){this.Ev("Error initializing conversations",r),this.xv=!1}}else rn.error("Conversations enabled but missing token in remote config.")}}Mv(t){if(this.Me)try{this._conversationsManager=t(this.Me,this._instance),this.Cv=!1,rn.info("Conversations loaded successfully")}catch(e){this.Ev("Error completing conversations initialization",e)}else rn.error("Cannot complete initialization: remote config is null")}Ev(t,e){rn.error(t,e),this._conversationsManager=null,this.xv=!1,this.Cv=!0}show(){this._conversationsManager?this._conversationsManager.show():rn.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Sv===!0&&!it(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":Rp(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":this.Tv===!1?"remote_config_failed":F(this.Sv)?this.Tv?"disabled_in_project":"remote_config_pending":this.Sv?re(this.Me)||!this.Me.token?"missing_token":J!=null&&J.__PosthogExtensions__?this.xv?"initializing":this.Cv?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.isVisible())!==null&&t!==void 0&&t}sendMessage(t,e,n){var r=this;return Pe(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,n):(rn.warn(Is),null)})()}getMessages(t,e){var n=this;return Pe(function*(){return n._conversationsManager?n._conversationsManager.getMessages(t,e):(rn.warn(Is),null)})()}markAsRead(t){var e=this;return Pe(function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(rn.warn(Is),null)})()}getTickets(t){var e=this;return Pe(function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(rn.warn(Is),null)})()}requestRestoreLink(t){var e=this;return Pe(function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(rn.warn(Is),null)})()}restoreFromToken(t){var e=this;return Pe(function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(rn.warn(Is),null)})()}restoreFromUrlToken(){var t=this;return Pe(function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(rn.warn(Is),null)})()}getCurrentTicketId(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.getCurrentTicketId())!==null&&t!==void 0?t:null}getWidgetSessionId(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.getWidgetSessionId())!==null&&t!==void 0?t:null}Sl(){var t;(t=this._conversationsManager)==null||t.setIdentity()}xl(){var t;(t=this._conversationsManager)==null||t.clearIdentity()}}},wM={logs:class{constructor(t){var e,n=this;this.Iv=!1,this.Rv=!1,this.I=Oe("[logs]"),this.Pv=L({},this.I,{error(){for(var r=arguments.length,s=new Array(r),i=0;r>i;i++)s[i]=arguments[i];s.some(U_)||n.I.error(...s)}}),this.ka=[],this.Av=[],this.ph=0,this.Fv=()=>{var r,s;this.ph=0,(r=this.Ov)==null||r.onReconnect(),(s=this.Lv)==null||s.onReconnect()},this._instance=t,this._instance&&(e=this._instance.config.logs)!=null&&e.captureConsoleLogs&&(this.Iv=!0),O&&Te(O,"online",this.Fv)}$v(t,e,n,r){var s,i=function(o,a){var l,u,c,d,f,h,_,p=(l=o==null?void 0:o.flushIntervalMs)!==null&&l!==void 0?l:3e3,y=(u=o==null?void 0:o.maxBufferSize)!==null&&u!==void 0?u:100,v=a!=null&&a.consoleCapture?void 0:(c=o==null?void 0:o.maxLogsPerInterval)!==null&&c!==void 0?c:1e3,m=F(v)?Math.max(y,2048):Math.max(y,v),x=o==null?void 0:o.resourceAttributes;return{serviceName:(d=(f=x==null?void 0:x["service.name"])!==null&&f!==void 0?f:o==null?void 0:o.serviceName)!==null&&d!==void 0?d:a==null?void 0:a.serviceNameDefault,serviceVersion:(h=x==null?void 0:x["service.version"])!==null&&h!==void 0?h:o==null?void 0:o.serviceVersion,environment:(_=x==null?void 0:x["deployment.environment"])!==null&&_!==void 0?_:o==null?void 0:o.environment,resourceAttributes:x,beforeSend:o==null?void 0:o.beforeSend,flushIntervalMs:p,maxBufferSize:y,maxQueueSize:m,maxBatchRecordsPerPost:100,rateCapWindowMs:p,maxLogsPerInterval:v,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}((s=this._instance)==null||(s=s.config)==null?void 0:s.logs,n);return[new gI(this.Dv(t,e),i,this.Pv,()=>this.Nv(),o=>o(),void 0,r),i]}qv(){var t,e=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;if(!this.Ov||this.jv!==e){var n;(n=this.Ov)==null||n.reset(),this.jv=e;var r=this.$v(()=>this.ka,s=>{this.ka=s});this.Ov=r[0],this.Bv=r[1]}return this.Ov}Hv(){var t,e=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;if(!this.Lv||this.Uv!==e){var n;(n=this.Lv)==null||n.reset(),this.Uv=e;var r=this.$v(()=>this.Av,s=>{this.Av=s},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},B_);this.Lv=r[0],this.zv=r[1]}return this.Lv}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e;if(t.ok){var n=(e=t.config.logs)==null?void 0:e.captureConsoleLogs;!re(n)&&n&&(this.Iv=!0,this.loadIfEnabled())}}reset(){var t,e;this.ka=[],(t=this.Ov)==null||t.reset(),this.Av=[],(e=this.Lv)==null||e.reset(),this.ph=0}captureLog(t){this.qv().captureLog(t)}vi(t){this.Hv().captureLog(t)}get logger(){return this.Wv||(this.Wv={trace:(t,e)=>this.captureLog({body:t,level:"trace",attributes:e}),debug:(t,e)=>this.captureLog({body:t,level:"debug",attributes:e}),info:(t,e)=>this.captureLog({body:t,level:"info",attributes:e}),warn:(t,e)=>this.captureLog({body:t,level:"warn",attributes:e}),error:(t,e)=>this.captureLog({body:t,level:"error",attributes:e}),fatal:(t,e)=>this.captureLog({body:t,level:"fatal",attributes:e})}),this.Wv}flushLogs(t){t?this.Vv(t):(this.Ov&&this.Ov.flush().catch(e=>this.Gv(e)),this.Lv&&this.Lv.flush().catch(e=>this.Gv(e)))}Gv(t){U_(t)||this.I.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(this.Iv&&!this.Rv){var t=J==null?void 0:J.__PosthogExtensions__;if(t){var e=t.loadExternalDependency;e?e(this._instance,"logs",n=>{var r;n||(r=t.logs)==null||!r.initializeLogs?this.I.error("Could not load logs script",n):(t.logs.initializeLogs(this._instance),this.Rv=!0)}):this.I.error(_g)}else this.I.error("PostHog Extensions not found.")}}Dv(t,e){var n=this._instance;return{get isDisabled(){return!1},get optedOut(){return!n.is_capturing()},getPersistedProperty:r=>r===cr.LogsQueue?t():void 0,setPersistedProperty(r,s){var i;r===cr.LogsQueue&&e((i=s)!==null&&i!==void 0?i:[])},Mn:r=>this.Mn(r),getLibraryId:()=>Ce.LIB_NAME,getLibraryVersion:()=>Ce.LIB_VERSION}}Mn(t){return new Promise(e=>{if(NE(this.ph,3))e({kind:"fatal",error:Bf(void 0,"logs endpoint is unreachable, dropping batch")});else{var n=!1,r=i=>{n||(n=!0,clearTimeout(s),e(i))},s=setTimeout(()=>{this.I.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:Bf(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.Zv(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:i=>{var o=i.statusCode;if(this.Qv(o),o>=200&&300>o)r({kind:"ok"});else if(o===413)r({kind:"too-large"});else if(o!==0&&o!==408&&o!==429&&500>o)r({kind:"fatal",error:new Error("logs request failed with status "+o)});else{var a;o===0?(i.error||this.I.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:Bf(i.error,"logs request failed before receiving an HTTP response")})):r({kind:"retry-later",error:(a=i.error)!==null&&a!==void 0?a:new Error("logs request failed with status "+o)})}}})}})}Qv(t){(t!==0||this._instance.__loaded)&&(this.ph=AE(t,this.ph,3,()=>this.I.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")))}Vv(t){this.ka.length>0&&this.Jv(t,this.ka,this.Bv,Ce.LIB_NAME,e=>{this.ka=e}),this.Av.length>0&&this.Jv(t,this.Av,this.zv,B_,e=>{this.Av=e})}Jv(t,e,n,r,s){if(e.length!==0){var i=e.map(a=>a.record);s([]);var o=nE(i,tE(n,Ce.LIB_NAME,Ce.LIB_VERSION),r,Ce.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Zv(),data:o,compression:"best-available",batchKey:"logs",transport:t})}}Zv(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}Nv(){var t,e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var n=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),r=n.windowId,s=n.sessionStartTimestamp,i=n.lastActivityTimestamp;e.sessionId=n.sessionId,e.windowId=r,re(s)||(e.sessionStartTimestamp=s),re(i)||(e.lastActivityTimestamp=i)}if(J!=null&&(t=J.location)!=null&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?ms(J.location.href):J.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(e.activeFeatureFlags=o)}return e}}},xM={metrics:class{constructor(t){this.I=Oe("[metrics]"),this._instance=t}initialize(){}qv(){var t,e,n=(t=this._instance)==null||(t=t.config)==null?void 0:t.metrics;return this.Ov&&this.jv===n||((e=this.Ov)==null||e.reset(),this.jv=n,this.Ov=new mI(this.Dv(),function(r){var s,i,o,a,l,u=r==null?void 0:r.resourceAttributes;return{serviceName:(s=u==null?void 0:u["service.name"])!==null&&s!==void 0?s:r==null?void 0:r.serviceName,serviceVersion:(i=u==null?void 0:u["service.version"])!==null&&i!==void 0?i:r==null?void 0:r.serviceVersion,environment:(o=u==null?void 0:u["deployment.environment"])!==null&&o!==void 0?o:r==null?void 0:r.environment,resourceAttributes:u,beforeSend:r==null?void 0:r.beforeSend,flushIntervalMs:(a=r==null?void 0:r.flushIntervalMs)!==null&&a!==void 0?a:1e4,maxSeriesPerFlush:(l=r==null?void 0:r.maxSeriesPerFlush)!==null&&l!==void 0?l:1e3}}(n),this.I)),this.Ov}count(t,e,n){e===void 0&&(e=1),this.qv().count(t,e,n)}gauge(t,e,n){this.qv().gauge(t,e,n)}histogram(t,e,n){this.qv().histogram(t,e,n)}flush(t){if(!this.Ov)return Promise.resolve();if(t){var e=this.Ov.drainWindow();return e&&this.Un(e,t),Promise.resolve()}return this.Ov.flush().catch(n=>this.I.error("PostHog metrics flush failed:",n))}reset(){var t;(t=this.Ov)==null||t.reset()}Dv(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Un:n=>e.Un(n),getLibraryId:()=>Ce.LIB_NAME,getLibraryVersion:()=>Ce.LIB_VERSION}}Un(t,e){return new Promise(n=>{var r=!1,s=o=>{r||(r=!0,clearTimeout(i),n(o))},i=setTimeout(()=>s({kind:"retry-later",error:new Error("metrics request timed out")}),9e4);this._instance._send_request(L({method:"POST",url:this.Kv(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(o){var a=o.statusCode;if(a>=200&&300>a)s({kind:"ok"});else if(a===413)s({kind:"too-large"});else if(a!==0&&a!==408&&a!==429&&500>a)s({kind:"fatal",error:new Error("metrics request failed with status "+a)});else{var l;s({kind:"retry-later",error:(l=o.error)!==null&&l!==void 0?l:new Error("metrics request failed with status "+a)})}}}))})}Kv(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},bM=L({},fd,cM,dM,fM,hM,pM,gM,vM,mM,yM,_M,wM,xM);Ht.__defaultExtensionClasses=L({},bM);var EM=function(){Ce.SDK_DIST_CHANNEL="npm";var t=Ta[Pi]=new Ht;return function(){function e(){e.done||(e.done=!0,l1=!1,ye(Ta,function(n){n._dom_loaded()}))}D!=null&&D.addEventListener?D.readyState==="complete"?e():Te(D,"DOMContentLoaded",e,{capture:!1}):O&&U.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),t}(),f1;function SM(t){f1=t}function CM(){return f1}var kM=g.createContext({get client(){return CM()},bootstrap:void 0}),Uf=function(t){return typeof t=="function"},PM=function(t){return t===void 0},zp=function(t,e){return zp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(n[s]=r[s])},zp(t,e)};function RM(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");zp(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var Mu=function(t){var e=Object.prototype.toString.call(t);return t instanceof Error||e==="[object Error]"||e==="[object Exception]"||e==="[object DOMException]"||e==="[object DOMError]"},TM=function(t,e){for(var n=new WeakSet,r=t;!n.has(r);){if(n.add(r),!Mu(r.cause)){PM(r.cause)||(e.cause=r.cause),r.cause=e;return}r=r.cause}},IM=function(t,e){if(!e)return t;var n=new Error(Mu(t)?t.message:"Primitive value captured as exception: ".concat(String(t)));return n.name="React ErrorBoundary ".concat(Mu(t)?t.name:"Error"),n.stack=e,Mu(t)?(TM(t,n),t):n},OM={componentStack:null,exceptionEvent:null,error:null},MM={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."};(function(t){RM(e,t);function e(n){var r=t.call(this,n)||this;return r.state=OM,r}return e.prototype.componentDidCatch=function(n,r){var s=this.props.additionalProperties,i;Uf(s)?i=s(n,r):typeof s=="object"&&(i=s);var o=this.context.client,a=r.componentStack,l=o.captureException(IM(n,a),i);this.setState({error:n,componentStack:a??null,exceptionEvent:l})},e.prototype.render=function(){var n=this.props,r=n.children,s=n.fallback,i=this.state;if(i.componentStack==null)return Uf(r)?r():r;var o=Uf(s)?R.createElement(s,{error:i.error,componentStack:i.componentStack,exceptionEvent:i.exceptionEvent}):s;return R.isValidElement(o)?o:(console.warn(MM.INVALID_FALLBACK),R.createElement(R.Fragment,null))},e.contextType=kM,e})(R.Component);SM(EM);class NM extends R.Component{constructor(){super(...arguments);Fr(this,"state",{failed:!1})}static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(n){console.error("The application could not render",n)}render(){return this.state.failed?w.jsx("main",{children:w.jsxs("div",{className:"page",role:"alert",children:[w.jsx("h1",{children:"This page could not load"}),w.jsx("p",{children:"The site may have been updated while this tab was open."}),w.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>window.location.reload(),children:"Reload page"})]})}):this.props.children}}const Vf="pwc:chunk-reload-at",h1=6e4;function AM(t,e){if(!t)return!0;const n=Number(t);return!Number.isFinite(n)||e-n>=h1}function $M(){if(typeof window>"u")return()=>{};const t=n=>{const r=Date.now();AM(sessionStorage.getItem(Vf),r)&&(n.preventDefault(),sessionStorage.setItem(Vf,String(r)),window.location.reload())};window.addEventListener("vite:preloadError",t);const e=window.setTimeout(()=>sessionStorage.removeItem(Vf),h1);return()=>{window.removeEventListener("vite:preloadError",t),window.clearTimeout(e)}}const LM="modulepreload",jM=function(t){return"/"+t},V_={},ce=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=Promise.allSettled(n.map(l=>{if(l=jM(l),l in V_)return;V_[l]=!0;const u=l.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${c}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":LM,u||(d.as="script"),d.crossOrigin="",d.href=l,a&&d.setAttribute("nonce",a),document.head.appendChild(d),u)return new Promise((f,h)=>{d.addEventListener("load",f),d.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${l}`)))})}))}function i(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return e().catch(i)})};/** - * @remix-run/router v1.23.2 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function nl(){return nl=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function hd(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function zM(){return Math.random().toString(36).substr(2,8)}function H_(t,e){return{usr:t.state,key:t.key,idx:e}}function Ac(t,e,n,r){return n===void 0&&(n=null),nl({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?ci(e):e,{state:n,key:e&&e.key||r||zM()})}function rl(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function ci(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function p1(t,e,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,o=s.history,a=is.Pop,l=null,u=c();u==null&&(u=0,o.replaceState(nl({},o.state,{idx:u}),""));function c(){return(o.state||{idx:null}).idx}function d(){a=is.Pop;let y=c(),v=y==null?null:y-u;u=y,l&&l({action:a,location:p.location,delta:v})}function f(y,v){a=is.Push;let m=Ac(p.location,y,v);n&&n(m,y),u=c()+1;let x=H_(m,u),b=p.createHref(m);try{o.pushState(x,"",b)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;s.location.assign(b)}i&&l&&l({action:a,location:p.location,delta:1})}function h(y,v){a=is.Replace;let m=Ac(p.location,y,v);n&&n(m,y),u=c();let x=H_(m,u),b=p.createHref(m);o.replaceState(x,"",b),i&&l&&l({action:a,location:p.location,delta:0})}function _(y){let v=s.location.origin!=="null"?s.location.origin:s.location.href,m=typeof y=="string"?y:rl(y);return m=m.replace(/ $/,"%20"),Ve(v,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,v)}let p={get action(){return a},get location(){return t(s,o)},listen(y){if(l)throw new Error("A history only accepts one active listener");return s.addEventListener(q_,d),l=y,()=>{s.removeEventListener(q_,d),l=null}},createHref(y){return e(s,y)},createURL:_,encodeLocation(y){let v=_(y);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:f,replace:h,go(y){return o.go(y)}};return p}var W_;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(W_||(W_={}));function BM(t,e,n){return n===void 0&&(n="/"),UM(t,e,n)}function UM(t,e,n,r){let s=typeof e=="string"?ci(e):e,i=Ro(s.pathname||"/",n);if(i==null)return null;let o=v1(t);VM(o);let a=null;for(let l=0;a==null&&l{let l={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};l.relativePath.startsWith("/")&&(Ve(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=ps([r,l.relativePath]),c=n.concat(l);i.children&&i.children.length>0&&(Ve(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),v1(i.children,e,c,u)),!(i.path==null&&!i.index)&&e.push({path:u,score:YM(u,i.index),routesMeta:c})};return t.forEach((i,o)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))s(i,o);else for(let l of g1(i.path))s(i,o,l)}),e}function g1(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let o=g1(r.join("/")),a=[];return a.push(...o.map(l=>l===""?i:[i,l].join("/"))),s&&a.push(...o),a.map(l=>t.startsWith("/")&&l===""?"/":l)}function VM(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:XM(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const qM=/^:[\w-]+$/,HM=3,WM=2,GM=1,KM=10,QM=-2,G_=t=>t==="*";function YM(t,e){let n=t.split("/"),r=n.length;return n.some(G_)&&(r+=QM),e&&(r+=WM),n.filter(s=>!G_(s)).reduce((s,i)=>s+(qM.test(i)?HM:i===""?GM:KM),r)}function XM(t,e){return t.length===e.length&&t.slice(0,-1).every((r,s)=>r===e[s])?t[t.length-1]-e[e.length-1]:0}function JM(t,e,n){let{routesMeta:r}=t,s={},i="/",o=[];for(let a=0;a{let{paramName:f,isOptional:h}=c;if(f==="*"){let p=a[d]||"";o=i.slice(0,i.length-p.length).replace(/(.)\/+$/,"$1")}const _=a[d];return h&&!_?u[f]=void 0:u[f]=(_||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:t}}function ZM(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),hd(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],s="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),s+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":t!==""&&t!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,e?void 0:"i"),r]}function eN(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return hd(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function Ro(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}const tN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,nN=t=>tN.test(t);function rN(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:s=""}=typeof t=="string"?ci(t):t,i;if(n)if(nN(n))i=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),hd(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?i=K_(n.substring(1),"/"):i=K_(n,e)}else i=e;return{pathname:i,search:oN(r),hash:aN(s)}}function K_(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function qf(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function sN(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function kg(t,e){let n=sN(t);return e?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Pg(t,e,n,r){r===void 0&&(r=!1);let s;typeof t=="string"?s=ci(t):(s=nl({},t),Ve(!s.pathname||!s.pathname.includes("?"),qf("?","pathname","search",s)),Ve(!s.pathname||!s.pathname.includes("#"),qf("#","pathname","hash",s)),Ve(!s.search||!s.search.includes("#"),qf("#","search","hash",s)));let i=t===""||s.pathname==="",o=i?"/":s.pathname,a;if(o==null)a=n;else{let d=e.length-1;if(!r&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),d-=1;s.pathname=f.join("/")}a=d>=0?e[d]:"/"}let l=rN(s,a),u=o&&o!=="/"&&o.endsWith("/"),c=(i||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const ps=t=>t.join("/").replace(/\/\/+/g,"/"),iN=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),oN=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,aN=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function lN(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const m1=["post","put","patch","delete"];new Set(m1);const uN=["get",...m1];new Set(uN);/** - * React Router v6.30.3 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function sl(){return sl=Object.assign?Object.assign.bind():function(t){for(var e=1;e{a.current=!0}),g.useCallback(function(u,c){if(c===void 0&&(c={}),!a.current)return;if(typeof u=="number"){r.go(u);return}let d=Pg(u,JSON.parse(o),i,c.relative==="path");t==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:ps([e,d.pathname])),(c.replace?r.replace:r.push)(d,c.state,c)},[e,r,o,i,t])}function x1(){let{matches:t}=g.useContext(Tr),e=t[t.length-1];return e?e.params:{}}function gd(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=g.useContext(Rr),{matches:s}=g.useContext(Tr),{pathname:i}=$n(),o=JSON.stringify(kg(s,r.v7_relativeSplatPath));return g.useMemo(()=>Pg(t,JSON.parse(o),i,n==="path"),[t,o,i,n])}function fN(t,e){return hN(t,e)}function hN(t,e,n,r){Lo()||Ve(!1);let{navigator:s}=g.useContext(Rr),{matches:i}=g.useContext(Tr),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=$n(),c;if(e){var d;let y=typeof e=="string"?ci(e):e;l==="/"||(d=y.pathname)!=null&&d.startsWith(l)||Ve(!1),c=y}else c=u;let f=c.pathname||"/",h=f;if(l!=="/"){let y=l.replace(/^\//,"").split("/");h="/"+f.replace(/^\//,"").split("/").slice(y.length).join("/")}let _=BM(t,{pathname:h}),p=yN(_&&_.map(y=>Object.assign({},y,{params:Object.assign({},a,y.params),pathname:ps([l,s.encodeLocation?s.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:ps([l,s.encodeLocation?s.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),i,n,r);return e&&p?g.createElement(vd.Provider,{value:{location:sl({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:is.Pop}},p):p}function pN(){let t=bN(),e=lN(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},e),n?g.createElement("pre",{style:s},n):null,null)}const vN=g.createElement(pN,null);class gN extends g.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?g.createElement(Tr.Provider,{value:this.props.routeContext},g.createElement(_1.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function mN(t){let{routeContext:e,match:n,children:r}=t,s=g.useContext(pd);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),g.createElement(Tr.Provider,{value:e},r)}function yN(t,e,n,r){var s;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var i;if(!n)return null;if(n.errors)t=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let o=t,a=(s=n)==null?void 0:s.errors;if(a!=null){let c=o.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);c>=0||Ve(!1),o=o.slice(0,Math.min(o.length,c+1))}let l=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let c=0;c=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((c,d,f)=>{let h,_=!1,p=null,y=null;n&&(h=a&&d.route.id?a[d.route.id]:void 0,p=d.route.errorElement||vN,l&&(u<0&&f===0?(SN("route-fallback"),_=!0,y=null):u===f&&(_=!0,y=d.route.hydrateFallbackElement||null)));let v=e.concat(o.slice(0,f+1)),m=()=>{let x;return h?x=p:_?x=y:d.route.Component?x=g.createElement(d.route.Component,null):d.route.element?x=d.route.element:x=c,g.createElement(mN,{match:d,routeContext:{outlet:c,matches:v,isDataRoute:n!=null},children:x})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?g.createElement(gN,{location:n.location,revalidation:n.revalidation,component:p,error:h,children:m(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):m()},null)}var b1=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(b1||{}),E1=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(E1||{});function _N(t){let e=g.useContext(pd);return e||Ve(!1),e}function wN(t){let e=g.useContext(y1);return e||Ve(!1),e}function xN(t){let e=g.useContext(Tr);return e||Ve(!1),e}function S1(t){let e=xN(),n=e.matches[e.matches.length-1];return n.route.id||Ve(!1),n.route.id}function bN(){var t;let e=g.useContext(_1),n=wN(),r=S1();return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function EN(){let{router:t}=_N(b1.UseNavigateStable),e=S1(E1.UseNavigateStable),n=g.useRef(!1);return w1(()=>{n.current=!0}),g.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?t.navigate(s):t.navigate(s,sl({fromRouteId:e},i)))},[t,e])}const Q_={};function SN(t,e,n){Q_[t]||(Q_[t]=!0)}function C1(t,e){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function To(t){let{to:e,replace:n,state:r,relative:s}=t;Lo()||Ve(!1);let{future:i,static:o}=g.useContext(Rr),{matches:a}=g.useContext(Tr),{pathname:l}=$n(),u=Rg(),c=Pg(e,kg(a,i.v7_relativeSplatPath),l,s==="path"),d=JSON.stringify(c);return g.useEffect(()=>u(JSON.parse(d),{replace:n,state:r,relative:s}),[u,d,s,n,r]),null}function le(t){Ve(!1)}function k1(t){let{basename:e="/",children:n=null,location:r,navigationType:s=is.Pop,navigator:i,static:o=!1,future:a}=t;Lo()&&Ve(!1);let l=e.replace(/^\/*/,"/"),u=g.useMemo(()=>({basename:l,navigator:i,static:o,future:sl({v7_relativeSplatPath:!1},a)}),[l,a,i,o]);typeof r=="string"&&(r=ci(r));let{pathname:c="/",search:d="",hash:f="",state:h=null,key:_="default"}=r,p=g.useMemo(()=>{let y=Ro(c,l);return y==null?null:{location:{pathname:y,search:d,hash:f,state:h,key:_},navigationType:s}},[l,c,d,f,h,_,s]);return p==null?null:g.createElement(Rr.Provider,{value:u},g.createElement(vd.Provider,{children:n,value:p}))}function Y_(t){let{children:e,location:n}=t;return fN(Up(e),n)}new Promise(()=>{});function Up(t,e){e===void 0&&(e=[]);let n=[];return g.Children.forEach(t,(r,s)=>{if(!g.isValidElement(r))return;let i=[...e,s];if(r.type===g.Fragment){n.push.apply(n,Up(r.props.children,i));return}r.type!==le&&Ve(!1),!r.props.index||!r.props.children||Ve(!1);let o={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=Up(r.props.children,i)),n.push(o)}),n}/** - * React Router DOM v6.30.3 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function $c(){return $c=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[s]=t[s]);return n}function CN(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function kN(t,e){return t.button===0&&(!e||e==="_self")&&!CN(t)}function Vp(t){return t===void 0&&(t=""),new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,n)=>{let r=t[n];return e.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function PN(t,e){let n=Vp(t);return e&&e.forEach((r,s)=>{n.has(s)||e.getAll(s).forEach(i=>{n.append(s,i)})}),n}const RN=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],TN=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],IN="6";try{window.__reactRouterVersion=IN}catch{}const ON=g.createContext({isTransitioning:!1}),MN="startTransition",Lc=Gc[MN];function NN(t){let{basename:e,children:n,future:r,window:s}=t,i=g.useRef();i.current==null&&(i.current=FM({window:s,v5Compat:!0}));let o=i.current,[a,l]=g.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},c=g.useCallback(d=>{u&&Lc?Lc(()=>l(d)):l(d)},[l,u]);return g.useLayoutEffect(()=>o.listen(c),[o,c]),g.useEffect(()=>C1(r),[r]),g.createElement(k1,{basename:e,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}function AN(t){let{basename:e,children:n,future:r,window:s}=t,i=g.useRef();i.current==null&&(i.current=DM({window:s,v5Compat:!0}));let o=i.current,[a,l]=g.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},c=g.useCallback(d=>{u&&Lc?Lc(()=>l(d)):l(d)},[l,u]);return g.useLayoutEffect(()=>o.listen(c),[o,c]),g.useEffect(()=>C1(r),[r]),g.createElement(k1,{basename:e,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}const $N=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",LN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Rn=g.forwardRef(function(e,n){let{onClick:r,relative:s,reloadDocument:i,replace:o,state:a,target:l,to:u,preventScrollReset:c,viewTransition:d}=e,f=P1(e,RN),{basename:h}=g.useContext(Rr),_,p=!1;if(typeof u=="string"&&LN.test(u)&&(_=u,$N))try{let x=new URL(window.location.href),b=u.startsWith("//")?new URL(x.protocol+u):new URL(u),E=Ro(b.pathname,h);b.origin===x.origin&&E!=null?u=E+b.search+b.hash:p=!0}catch{}let y=cN(u,{relative:s}),v=FN(u,{replace:o,state:a,target:l,preventScrollReset:c,relative:s,viewTransition:d});function m(x){r&&r(x),x.defaultPrevented||v(x)}return g.createElement("a",$c({},f,{href:_||y,onClick:p||i?r:m,ref:n,target:l}))}),bi=g.forwardRef(function(e,n){let{"aria-current":r="page",caseSensitive:s=!1,className:i="",end:o=!1,style:a,to:l,viewTransition:u,children:c}=e,d=P1(e,TN),f=gd(l,{relative:d.relative}),h=$n(),_=g.useContext(y1),{navigator:p,basename:y}=g.useContext(Rr),v=_!=null&&DN(f)&&u===!0,m=p.encodeLocation?p.encodeLocation(f).pathname:f.pathname,x=h.pathname,b=_&&_.navigation&&_.navigation.location?_.navigation.location.pathname:null;s||(x=x.toLowerCase(),b=b?b.toLowerCase():null,m=m.toLowerCase()),b&&y&&(b=Ro(b,y)||b);const E=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let S=x===m||!o&&x.startsWith(m)&&x.charAt(E)==="/",k=b!=null&&(b===m||!o&&b.startsWith(m)&&b.charAt(m.length)==="/"),C={isActive:S,isPending:k,isTransitioning:v},I=S?r:void 0,P;typeof i=="function"?P=i(C):P=[i,S?"active":null,k?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let $=typeof a=="function"?a(C):a;return g.createElement(Rn,$c({},d,{"aria-current":I,className:P,ref:n,style:$,to:l,viewTransition:u}),typeof c=="function"?c(C):c)});var qp;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(qp||(qp={}));var X_;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(X_||(X_={}));function jN(t){let e=g.useContext(pd);return e||Ve(!1),e}function FN(t,e){let{target:n,replace:r,state:s,preventScrollReset:i,relative:o,viewTransition:a}=e===void 0?{}:e,l=Rg(),u=$n(),c=gd(t,{relative:o});return g.useCallback(d=>{if(kN(d,n)){d.preventDefault();let f=r!==void 0?r:rl(u)===rl(c);l(t,{replace:f,state:s,preventScrollReset:i,relative:o,viewTransition:a})}},[u,l,c,r,s,n,t,i,o,a])}function e5(t){let e=g.useRef(Vp(t)),n=g.useRef(!1),r=$n(),s=g.useMemo(()=>PN(r.search,n.current?null:e.current),[r.search]),i=Rg(),o=g.useCallback((a,l)=>{const u=Vp(typeof a=="function"?a(s):a);n.current=!0,i("?"+u,l)},[i,s]);return[s,o]}function DN(t,e){e===void 0&&(e={});let n=g.useContext(ON);n==null&&Ve(!1);let{basename:r}=jN(qp.useViewTransitionState),s=gd(t,{relative:e.relative});if(!n.isTransitioning)return!1;let i=Ro(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Ro(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Bp(s.pathname,o)!=null||Bp(s.pathname,i)!=null}var md=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(){}},qs,Xr,so,J0,zN=(J0=class extends md{constructor(){super();fe(this,qs);fe(this,Xr);fe(this,so);ne(this,so,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){A(this,Xr)||this.setEventListener(A(this,so))}onUnsubscribe(){var e;this.hasListeners()||((e=A(this,Xr))==null||e.call(this),ne(this,Xr,void 0))}setEventListener(e){var n;ne(this,so,e),(n=A(this,Xr))==null||n.call(this),ne(this,Xr,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){A(this,qs)!==e&&(ne(this,qs,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof A(this,qs)=="boolean"?A(this,qs):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},qs=new WeakMap,Xr=new WeakMap,so=new WeakMap,J0),R1=new zN,BN={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Jr,dv,Z0,UN=(Z0=class{constructor(){fe(this,Jr,BN);fe(this,dv,!1)}setTimeoutProvider(t){ne(this,Jr,t)}setTimeout(t,e){return A(this,Jr).setTimeout(t,e)}clearTimeout(t){A(this,Jr).clearTimeout(t)}setInterval(t,e){return A(this,Jr).setInterval(t,e)}clearInterval(t){A(this,Jr).clearInterval(t)}},Jr=new WeakMap,dv=new WeakMap,Z0),Hp=new UN;function VN(t){setTimeout(t,0)}var qN=typeof window>"u"||"Deno"in globalThis;function Sn(){}function HN(t,e){return typeof t=="function"?t(e):t}function WN(t){return typeof t=="number"&&t>=0&&t!==1/0}function GN(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Wp(t,e){return typeof t=="function"?t(e):t}function KN(t,e){return typeof t=="function"?t(e):t}function J_(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:a}=t;if(o){if(r){if(e.queryHash!==Tg(o,e.options))return!1}else if(!ol(e.queryKey,o))return!1}if(n!=="all"){const l=e.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||s&&s!==e.state.fetchStatus||i&&!i(e))}function Z_(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(il(e.options.mutationKey)!==il(i))return!1}else if(!ol(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function Tg(t,e){return((e==null?void 0:e.queryKeyHashFn)||il)(t)}function il(t){return JSON.stringify(t,(e,n)=>Gp(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function ol(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>ol(t[n],e[n])):!1}var QN=Object.prototype.hasOwnProperty;function T1(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=e0(t)&&e0(e);if(!r&&!(Gp(t)&&Gp(e)))return e;const i=(r?t:Object.keys(t)).length,o=r?e:Object.keys(e),a=o.length,l=r?new Array(a):{};let u=0;for(let c=0;c{Hp.setTimeout(e,t)})}function XN(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?T1(t,e):e}function n5(t){return t}function JN(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function ZN(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var Ig=Symbol();function I1(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Ig?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function r5(t,e){return typeof t=="function"?t(...e):!!t}function eA(t,e,n){let r=!1,s;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(s??(s=e()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),t}var O1=(()=>{let t=()=>qN;return{isServer(){return t()},setIsServer(e){t=e}}})();function tA(){let t,e;const n=new Promise((s,i)=>{t=s,e=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),t(s)},n.reject=s=>{r({status:"rejected",reason:s}),e(s)},n}var nA=VN;function rA(){let t=[],e=0,n=a=>{a()},r=a=>{a()},s=nA;const i=a=>{e?t.push(a):s(()=>{n(a)})},o=()=>{const a=t;t=[],a.length&&s(()=>{r(()=>{a.forEach(l=>{n(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=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{s=a}}}var Ct=rA(),io,Zr,oo,ew,sA=(ew=class extends md{constructor(){super();fe(this,io,!0);fe(this,Zr);fe(this,oo);ne(this,oo,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){A(this,Zr)||this.setEventListener(A(this,oo))}onUnsubscribe(){var e;this.hasListeners()||((e=A(this,Zr))==null||e.call(this),ne(this,Zr,void 0))}setEventListener(e){var n;ne(this,oo,e),(n=A(this,Zr))==null||n.call(this),ne(this,Zr,e(this.setOnline.bind(this)))}setOnline(e){A(this,io)!==e&&(ne(this,io,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return A(this,io)}},io=new WeakMap,Zr=new WeakMap,oo=new WeakMap,ew),jc=new sA;function iA(t){return Math.min(1e3*2**t,3e4)}function M1(t){return(t??"online")==="online"?jc.isOnline():!0}var Kp=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function N1(t){let e=!1,n=0,r;const s=tA(),i=()=>s.status!=="pending",o=p=>{var y;if(!i()){const v=new Kp(p);f(v),(y=t.onCancel)==null||y.call(t,v)}},a=()=>{e=!0},l=()=>{e=!1},u=()=>R1.isFocused()&&(t.networkMode==="always"||jc.isOnline())&&t.canRun(),c=()=>M1(t.networkMode)&&t.canRun(),d=p=>{i()||(r==null||r(),s.resolve(p))},f=p=>{i()||(r==null||r(),s.reject(p))},h=()=>new Promise(p=>{var y;r=v=>{(i()||u())&&p(v)},(y=t.onPause)==null||y.call(t)}).then(()=>{var p;r=void 0,i()||(p=t.onContinue)==null||p.call(t)}),_=()=>{if(i())return;let p;const y=n===0?t.initialPromise:void 0;try{p=y??t.fn()}catch(v){p=Promise.reject(v)}Promise.resolve(p).then(d).catch(v=>{var S;if(i())return;const m=t.retry??(O1.isServer()?0:3),x=t.retryDelay??iA,b=typeof x=="function"?x(n,v):x,E=m===!0||typeof m=="number"&&nu()?void 0:h()).then(()=>{e?f(v):_()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(r==null||r(),s),cancelRetry:a,continueRetry:l,canStart:c,start:()=>(c()?_():h().then(_),s)}}var Hs,tw,A1=(tw=class{constructor(){fe(this,Hs)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),WN(this.gcTime)&&ne(this,Hs,Hp.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(O1.isServer()?1/0:5*60*1e3))}clearGcTimeout(){A(this,Hs)!==void 0&&(Hp.clearTimeout(A(this,Hs)),ne(this,Hs,void 0))}},Hs=new WeakMap,tw);function oA(t){return{onFetch:(e,n)=>{var c,d,f,h,_;const r=e.options,s=(f=(d=(c=e.fetchOptions)==null?void 0:c.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,i=((h=e.state.data)==null?void 0:h.pages)||[],o=((_=e.state.data)==null?void 0:_.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let p=!1;const y=x=>{eA(x,()=>e.signal,()=>p=!0)},v=I1(e.options,e.fetchOptions),m=async(x,b,E)=>{if(p)return Promise.reject(e.signal.reason);if(b==null&&x.pages.length)return Promise.resolve(x);const k=(()=>{const $={client:e.client,queryKey:e.queryKey,pageParam:b,direction:E?"backward":"forward",meta:e.options.meta};return y($),$})(),C=await v(k),{maxPages:I}=e.options,P=E?ZN:JN;return{pages:P(x.pages,C,I),pageParams:P(x.pageParams,b,I)}};if(s&&i.length){const x=s==="backward",b=x?$1:Qp,E={pages:i,pageParams:o},S=b(r,E);a=await m(E,S,x)}else{const x=t??i.length;do{const b=l===0?o[0]??r.initialPageParam:Qp(r,a);if(l>0&&b==null)break;a=await m(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},n)}:e.fetchFn=u}}}function Qp(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function $1(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}function s5(t,e){return e?Qp(t,e)!=null:!1}function i5(t,e){return!e||!t.getPreviousPageParam?!1:$1(t,e)!=null}var ao,Ws,lo,sn,Gs,rt,dl,Ks,qt,L1,ar,nw,aA=(nw=class extends A1{constructor(e){super();fe(this,qt);fe(this,ao);fe(this,Ws);fe(this,lo);fe(this,sn);fe(this,Gs);fe(this,rt);fe(this,dl);fe(this,Ks);ne(this,Ks,!1),ne(this,dl,e.defaultOptions),this.setOptions(e.options),this.observers=[],ne(this,Gs,e.client),ne(this,sn,A(this,Gs).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,ne(this,Ws,r0(this.options)),this.state=e.state??A(this,Ws),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return A(this,ao)}get promise(){var e;return(e=A(this,rt))==null?void 0:e.promise}setOptions(e){if(this.options={...A(this,dl),...e},e!=null&&e._type&&ne(this,ao,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=r0(this.options);n.data!==void 0&&(this.setState(n0(n.data,n.dataUpdatedAt)),ne(this,Ws,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&A(this,sn).remove(this)}setData(e,n){const r=XN(this.state.data,e,this.options);return ut(this,qt,ar).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e){ut(this,qt,ar).call(this,{type:"setState",state:e})}cancel(e){var r,s;const n=(r=A(this,rt))==null?void 0:r.promise;return(s=A(this,rt))==null||s.cancel(e),n?n.then(Sn).catch(Sn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return A(this,Ws)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>KN(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ig||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Wp(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:!GN(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=A(this,rt))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=A(this,rt))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),A(this,sn).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(A(this,rt)&&(A(this,Ks)||ut(this,qt,L1).call(this)?A(this,rt).cancel({revert:!0}):A(this,rt).cancelRetry()),this.scheduleGc()),A(this,sn).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ut(this,qt,ar).call(this,{type:"invalidate"})}async fetch(e,n){var u,c,d,f,h,_,p,y,v,m,x;if(this.state.fetchStatus!=="idle"&&((u=A(this,rt))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(A(this,rt))return A(this,rt).continueRetry(),A(this,rt).promise}if(e&&this.setOptions(e),!this.options.queryFn){const b=this.observers.find(E=>E.options.queryFn);b&&this.setOptions(b.options)}const r=new AbortController,s=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(ne(this,Ks,!0),r.signal)})},i=()=>{const b=I1(this.options,n),S=(()=>{const k={client:A(this,Gs),queryKey:this.queryKey,meta:this.meta};return s(k),k})();return ne(this,Ks,!1),this.options.persister?this.options.persister(b,S,this):b(S)},a=(()=>{const b={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:A(this,Gs),state:this.state,fetchFn:i};return s(b),b})(),l=A(this,ao)==="infinite"?oA(this.options.pages):this.options.behavior;l==null||l.onFetch(a,this),ne(this,lo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=a.fetchOptions)==null?void 0:c.meta))&&ut(this,qt,ar).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta}),ne(this,rt,N1({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,onCancel:b=>{b instanceof Kp&&b.revert&&this.setState({...A(this,lo),fetchStatus:"idle"}),r.abort()},onFail:(b,E)=>{ut(this,qt,ar).call(this,{type:"failed",failureCount:b,error:E})},onPause:()=>{ut(this,qt,ar).call(this,{type:"pause"})},onContinue:()=>{ut(this,qt,ar).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const b=await A(this,rt).start();if(b===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(b),(h=(f=A(this,sn).config).onSuccess)==null||h.call(f,b,this),(p=(_=A(this,sn).config).onSettled)==null||p.call(_,b,this.state.error,this),b}catch(b){if(b instanceof Kp){if(b.silent)return A(this,rt).promise;if(b.revert){if(this.state.data===void 0)throw b;return this.state.data}}throw ut(this,qt,ar).call(this,{type:"error",error:b}),(v=(y=A(this,sn).config).onError)==null||v.call(y,b,this),(x=(m=A(this,sn).config).onSettled)==null||x.call(m,this.state.data,b,this),b}finally{this.scheduleGc()}}},ao=new WeakMap,Ws=new WeakMap,lo=new WeakMap,sn=new WeakMap,Gs=new WeakMap,rt=new WeakMap,dl=new WeakMap,Ks=new WeakMap,qt=new WeakSet,L1=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},ar=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...lA(r.data,this.options),fetchMeta:e.meta??null};case"success":const s={...r,...n0(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ne(this,lo,e.manual?s:void 0),s;case"error":const i=e.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),Ct.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),A(this,sn).notify({query:this,type:"updated",action:e})})},nw);function lA(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:M1(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function n0(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function r0(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var fl,Vn,mt,Qs,qn,Hr,rw,uA=(rw=class extends A1{constructor(e){super();fe(this,qn);fe(this,fl);fe(this,Vn);fe(this,mt);fe(this,Qs);ne(this,fl,e.client),this.mutationId=e.mutationId,ne(this,mt,e.mutationCache),ne(this,Vn,[]),this.state=e.state||cA(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){A(this,Vn).includes(e)||(A(this,Vn).push(e),this.clearGcTimeout(),A(this,mt).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){ne(this,Vn,A(this,Vn).filter(n=>n!==e)),this.scheduleGc(),A(this,mt).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){A(this,Vn).length||(this.state.status==="pending"?this.scheduleGc():A(this,mt).remove(this))}continue(){var e;return((e=A(this,Qs))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var o,a,l,u,c,d,f,h,_,p,y,v,m,x,b,E,S,k;const n=()=>{ut(this,qn,Hr).call(this,{type:"continue"})},r={client:A(this,fl),meta:this.options.meta,mutationKey:this.options.mutationKey};ne(this,Qs,N1({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(C,I)=>{ut(this,qn,Hr).call(this,{type:"failed",failureCount:C,error:I})},onPause:()=>{ut(this,qn,Hr).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>A(this,mt).canRun(this)}));const s=this.state.status==="pending",i=!A(this,Qs).canStart();try{if(s)n();else{ut(this,qn,Hr).call(this,{type:"pending",variables:e,isPaused:i}),A(this,mt).config.onMutate&&await A(this,mt).config.onMutate(e,this,r);const I=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,e,r));I!==this.state.context&&ut(this,qn,Hr).call(this,{type:"pending",context:I,variables:e,isPaused:i})}const C=await A(this,Qs).start();return await((u=(l=A(this,mt).config).onSuccess)==null?void 0:u.call(l,C,e,this.state.context,this,r)),await((d=(c=this.options).onSuccess)==null?void 0:d.call(c,C,e,this.state.context,r)),await((h=(f=A(this,mt).config).onSettled)==null?void 0:h.call(f,C,null,this.state.variables,this.state.context,this,r)),await((p=(_=this.options).onSettled)==null?void 0:p.call(_,C,null,e,this.state.context,r)),ut(this,qn,Hr).call(this,{type:"success",data:C}),C}catch(C){try{await((v=(y=A(this,mt).config).onError)==null?void 0:v.call(y,C,e,this.state.context,this,r))}catch(I){Promise.reject(I)}try{await((x=(m=this.options).onError)==null?void 0:x.call(m,C,e,this.state.context,r))}catch(I){Promise.reject(I)}try{await((E=(b=A(this,mt).config).onSettled)==null?void 0:E.call(b,void 0,C,this.state.variables,this.state.context,this,r))}catch(I){Promise.reject(I)}try{await((k=(S=this.options).onSettled)==null?void 0:k.call(S,void 0,C,e,this.state.context,r))}catch(I){Promise.reject(I)}throw ut(this,qn,Hr).call(this,{type:"error",error:C}),C}finally{A(this,mt).runNext(this)}}},fl=new WeakMap,Vn=new WeakMap,mt=new WeakMap,Qs=new WeakMap,qn=new WeakSet,Hr=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,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{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Ct.batch(()=>{A(this,Vn).forEach(r=>{r.onMutationUpdate(e)}),A(this,mt).notify({mutation:this,type:"updated",action:e})})},rw);function cA(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var hr,Cn,hl,sw,dA=(sw=class extends md{constructor(e={}){super();fe(this,hr);fe(this,Cn);fe(this,hl);this.config=e,ne(this,hr,new Set),ne(this,Cn,new Map),ne(this,hl,0)}build(e,n,r){const s=new uA({client:e,mutationCache:this,mutationId:++Rl(this,hl)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){A(this,hr).add(e);const n=su(e);if(typeof n=="string"){const r=A(this,Cn).get(n);r?r.push(e):A(this,Cn).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(A(this,hr).delete(e)){const n=su(e);if(typeof n=="string"){const r=A(this,Cn).get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&A(this,Cn).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=su(e);if(typeof n=="string"){const r=A(this,Cn).get(n),s=r==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){var r;const n=su(e);if(typeof n=="string"){const s=(r=A(this,Cn).get(n))==null?void 0:r.find(i=>i!==e&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Ct.batch(()=>{A(this,hr).forEach(e=>{this.notify({type:"removed",mutation:e})}),A(this,hr).clear(),A(this,Cn).clear()})}getAll(){return Array.from(A(this,hr))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>Z_(n,r))}findAll(e={}){return this.getAll().filter(n=>Z_(e,n))}notify(e){Ct.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Ct.batch(()=>Promise.all(e.map(n=>n.continue().catch(Sn))))}},hr=new WeakMap,Cn=new WeakMap,hl=new WeakMap,sw);function su(t){var e;return(e=t.options.scope)==null?void 0:e.id}var Hn,iw,fA=(iw=class extends md{constructor(e={}){super();fe(this,Hn);this.config=e,ne(this,Hn,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??Tg(s,n);let o=this.get(i);return o||(o=new aA({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){A(this,Hn).has(e.queryHash)||(A(this,Hn).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=A(this,Hn).get(e.queryHash);n&&(e.destroy(),n===e&&A(this,Hn).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Ct.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return A(this,Hn).get(e)}getAll(){return[...A(this,Hn).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>J_(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>J_(e,r)):n}notify(e){Ct.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Ct.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ct.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Hn=new WeakMap,iw),He,es,ts,uo,co,ns,fo,ho,ow,hA=(ow=class{constructor(t={}){fe(this,He);fe(this,es);fe(this,ts);fe(this,uo);fe(this,co);fe(this,ns);fe(this,fo);fe(this,ho);ne(this,He,t.queryCache||new fA),ne(this,es,t.mutationCache||new dA),ne(this,ts,t.defaultOptions||{}),ne(this,uo,new Map),ne(this,co,new Map),ne(this,ns,0)}mount(){Rl(this,ns)._++,A(this,ns)===1&&(ne(this,fo,R1.subscribe(async t=>{t&&(await this.resumePausedMutations(),A(this,He).onFocus())})),ne(this,ho,jc.subscribe(async t=>{t&&(await this.resumePausedMutations(),A(this,He).onOnline())})))}unmount(){var t,e;Rl(this,ns)._--,A(this,ns)===0&&((t=A(this,fo))==null||t.call(this),ne(this,fo,void 0),(e=A(this,ho))==null||e.call(this),ne(this,ho,void 0))}isFetching(t){return A(this,He).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return A(this,es).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=A(this,He).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=A(this,He).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Wp(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return A(this,He).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),s=A(this,He).get(r.queryHash),i=s==null?void 0:s.state.data,o=HN(e,i);if(o!==void 0)return A(this,He).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(t,e,n){return Ct.batch(()=>A(this,He).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=A(this,He).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=A(this,He);Ct.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=A(this,He);return Ct.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=Ct.batch(()=>A(this,He).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(Sn).catch(Sn)}invalidateQueries(t,e={}){return Ct.batch(()=>(A(this,He).findAll(t).forEach(n=>{n.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 n={...e,cancelRefetch:e.cancelRefetch??!0},r=Ct.batch(()=>A(this,He).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Sn)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Sn)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=A(this,He).build(this,e);return n.isStaleByTime(Wp(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Sn).catch(Sn)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Sn).catch(Sn)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return jc.isOnline()?A(this,es).resumePausedMutations():Promise.resolve()}getQueryCache(){return A(this,He)}getMutationCache(){return A(this,es)}getDefaultOptions(){return A(this,ts)}setDefaultOptions(t){ne(this,ts,t)}setQueryDefaults(t,e){A(this,uo).set(il(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...A(this,uo).values()],n={};return e.forEach(r=>{ol(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){A(this,co).set(il(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...A(this,co).values()],n={};return e.forEach(r=>{ol(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...A(this,ts).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Tg(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===Ig&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...A(this,ts).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){A(this,He).clear(),A(this,es).clear()}},He=new WeakMap,es=new WeakMap,ts=new WeakMap,uo=new WeakMap,co=new WeakMap,ns=new WeakMap,fo=new WeakMap,ho=new WeakMap,ow),j1=g.createContext(void 0),pA=t=>{const e=g.useContext(j1);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},vA=({client:t,children:e})=>(g.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),w.jsx(j1.Provider,{value:t,children:e}));function Z(t,e,{checkForDefaultPrevented:n=!0}={}){return function(s){if(t==null||t(s),n===!1||!s.defaultPrevented)return e==null?void 0:e(s)}}function s0(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Ss(...t){return e=>{let n=!1;const r=t.map(s=>{const i=s0(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s{const{children:o,...a}=i,l=g.useMemo(()=>a,Object.values(a));return w.jsx(n.Provider,{value:l,children:o})};r.displayName=t+"Provider";function s(i){const o=g.useContext(n);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return[r,s]}function Cs(t,e=[]){let n=[];function r(i,o){const a=g.createContext(o),l=n.length;n=[...n,o];const u=d=>{var v;const{scope:f,children:h,..._}=d,p=((v=f==null?void 0:f[t])==null?void 0:v[l])||a,y=g.useMemo(()=>_,Object.values(_));return w.jsx(p.Provider,{value:y,children:h})};u.displayName=i+"Provider";function c(d,f){var p;const h=((p=f==null?void 0:f[t])==null?void 0:p[l])||a,_=g.useContext(h);if(_)return _;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,c]}const s=()=>{const i=n.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,[r,mA(s,...e)]}function mA(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((a,{useScope:l,scopeName:u})=>{const d=l(i)[`__scope${u}`];return{...a,...d}},{});return g.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}var pn=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},yA=Gc[" useId ".trim().toString()]||(()=>{}),_A=0;function eo(t){const[e,n]=g.useState(yA());return pn(()=>{n(r=>r??String(_A++))},[t]),e?`radix-${e}`:""}var wA=Gc[" useInsertionEffect ".trim().toString()]||pn;function yd({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[s,i,o]=xA({defaultProp:e,onChange:n}),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(`${r} 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,r])}const u=g.useCallback(c=>{var d;if(a){const f=bA(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 xA({defaultProp:t,onChange:e}){const[n,r]=g.useState(t),s=g.useRef(n),i=g.useRef(e);return wA(()=>{i.current=e},[e]),g.useEffect(()=>{var o;s.current!==n&&((o=i.current)==null||o.call(i,n),s.current=n)},[n,s]),[n,r,i]}function bA(t){return typeof t=="function"}function EA(t){const e=SA(t),n=g.forwardRef((r,s)=>{const{children:i,...o}=r,a=g.Children.toArray(i),l=a.find(kA);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 n.displayName=`${t}.Slot`,n}function SA(t){const e=g.forwardRef((n,r)=>{const{children:s,...i}=n;if(g.isValidElement(s)){const o=RA(s),a=PA(i,s.props);return s.type!==g.Fragment&&(a.ref=r?Ss(r,o):o),g.cloneElement(s,a)}return g.Children.count(s)>1?g.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var CA=Symbol("radix.slottable");function kA(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===CA}function PA(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...a)=>{const l=i(...a);return s(...a),l}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function RA(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var TA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Re=TA.reduce((t,e)=>{const n=EA(`Primitive.${e}`),r=g.forwardRef((s,i)=>{const{asChild:o,...a}=s,l=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(l,{...a,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function Og(t,e){t&&_l.flushSync(()=>t.dispatchEvent(e))}function Bt(t){const e=g.useRef(t);return g.useEffect(()=>{e.current=t}),g.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function IA(t,e=globalThis==null?void 0:globalThis.document){const n=Bt(t);g.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var OA="DismissableLayer",Yp="dismissableLayer.update",MA="dismissableLayer.pointerDownOutside",NA="dismissableLayer.focusOutside",i0,F1=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),xl=g.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:a,...l}=t,u=g.useContext(F1),[c,d]=g.useState(null),f=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=g.useState({}),_=Xe(e,k=>d(k)),p=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=p.indexOf(y),m=c?p.indexOf(c):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,b=m>=v,E=$A(k=>{const C=k.target,I=[...u.branches].some(P=>P.contains(C));!b||I||(s==null||s(k),o==null||o(k),k.defaultPrevented||a==null||a())},f),S=LA(k=>{const C=k.target;[...u.branches].some(P=>P.contains(C))||(i==null||i(k),o==null||o(k),k.defaultPrevented||a==null||a())},f);return IA(k=>{m===u.layers.size-1&&(r==null||r(k),!k.defaultPrevented&&a&&(k.preventDefault(),a()))},f),g.useEffect(()=>{if(c)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(i0=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),o0(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=i0)}},[c,f,n,u]),g.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),o0())},[c,u]),g.useEffect(()=>{const k=()=>h({});return document.addEventListener(Yp,k),()=>document.removeEventListener(Yp,k)},[]),w.jsx(Re.div,{...l,ref:_,style:{pointerEvents:x?b?"auto":"none":void 0,...t.style},onFocusCapture:Z(t.onFocusCapture,S.onFocusCapture),onBlurCapture:Z(t.onBlurCapture,S.onBlurCapture),onPointerDownCapture:Z(t.onPointerDownCapture,E.onPointerDownCapture)})});xl.displayName=OA;var AA="DismissableLayerBranch",D1=g.forwardRef((t,e)=>{const n=g.useContext(F1),r=g.useRef(null),s=Xe(e,r);return g.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),w.jsx(Re.div,{...t,ref:s})});D1.displayName=AA;function $A(t,e=globalThis==null?void 0:globalThis.document){const n=Bt(t),r=g.useRef(!1),s=g.useRef(()=>{});return g.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){z1(MA,n,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);r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",i),e.removeEventListener("click",s.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function LA(t,e=globalThis==null?void 0:globalThis.document){const n=Bt(t),r=g.useRef(!1);return g.useEffect(()=>{const s=i=>{i.target&&!r.current&&z1(NA,n,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function o0(){const t=new CustomEvent(Yp);document.dispatchEvent(t)}function z1(t,e,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?Og(s,i):s.dispatchEvent(i)}var jA=xl,FA=D1,Hf="focusScope.autoFocusOnMount",Wf="focusScope.autoFocusOnUnmount",a0={bubbles:!1,cancelable:!0},DA="FocusScope",Mg=g.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...o}=t,[a,l]=g.useState(null),u=Bt(s),c=Bt(i),d=g.useRef(null),f=Xe(e,p=>l(p)),h=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let p=function(x){if(h.paused||!a)return;const b=x.target;a.contains(b)?d.current=b:Wr(d.current,{select:!0})},y=function(x){if(h.paused||!a)return;const b=x.relatedTarget;b!==null&&(a.contains(b)||Wr(d.current,{select:!0}))},v=function(x){if(document.activeElement===document.body)for(const E of x)E.removedNodes.length>0&&Wr(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",y);const m=new MutationObserver(v);return a&&m.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",y),m.disconnect()}}},[r,a,h.paused]),g.useEffect(()=>{if(a){u0.add(h);const p=document.activeElement;if(!a.contains(p)){const v=new CustomEvent(Hf,a0);a.addEventListener(Hf,u),a.dispatchEvent(v),v.defaultPrevented||(zA(HA(B1(a)),{select:!0}),document.activeElement===p&&Wr(a))}return()=>{a.removeEventListener(Hf,u),setTimeout(()=>{const v=new CustomEvent(Wf,a0);a.addEventListener(Wf,c),a.dispatchEvent(v),v.defaultPrevented||Wr(p??document.body,{select:!0}),a.removeEventListener(Wf,c),u0.remove(h)},0)}}},[a,u,c,h]);const _=g.useCallback(p=>{if(!n&&!r||h.paused)return;const y=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,v=document.activeElement;if(y&&v){const m=p.currentTarget,[x,b]=BA(m);x&&b?!p.shiftKey&&v===b?(p.preventDefault(),n&&Wr(x,{select:!0})):p.shiftKey&&v===x&&(p.preventDefault(),n&&Wr(b,{select:!0})):v===m&&p.preventDefault()}},[n,r,h.paused]);return w.jsx(Re.div,{tabIndex:-1,...o,ref:f,onKeyDown:_})});Mg.displayName=DA;function zA(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Wr(r,{select:e}),document.activeElement!==n)return}function BA(t){const e=B1(t),n=l0(e,t),r=l0(e.reverse(),t);return[n,r]}function B1(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function l0(t,e){for(const n of t)if(!UA(n,{upTo:e}))return n}function UA(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 VA(t){return t instanceof HTMLInputElement&&"select"in t}function Wr(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&VA(t)&&e&&t.select()}}var u0=qA();function qA(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=c0(t,e),t.unshift(e)},remove(e){var n;t=c0(t,e),(n=t[0])==null||n.resume()}}}function c0(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function HA(t){return t.filter(e=>e.tagName!=="A")}var WA="Portal",_d=g.forwardRef((t,e)=>{var a;const{container:n,...r}=t,[s,i]=g.useState(!1);pn(()=>i(!0),[]);const o=n||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?wb.createPortal(w.jsx(Re.div,{...r,ref:e}),o):null});_d.displayName=WA;function GA(t,e){return g.useReducer((n,r)=>e[n][r]??n,t)}var er=t=>{const{present:e,children:n}=t,r=KA(e),s=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),i=Xe(r.ref,QA(s));return typeof n=="function"||r.isPresent?g.cloneElement(s,{ref:i}):null};er.displayName="Presence";function KA(t){const[e,n]=g.useState(),r=g.useRef(null),s=g.useRef(t),i=g.useRef("none"),o=t?"mounted":"unmounted",[a,l]=GA(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const u=iu(r.current);i.current=a==="mounted"?u:"none"},[a]),pn(()=>{const u=r.current,c=s.current;if(c!==t){const f=i.current,h=iu(u);t?l("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(c&&f!==h?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,l]),pn(()=>{if(e){let u;const c=e.ownerDocument.defaultView??window,d=h=>{const p=iu(r.current).includes(CSS.escape(h.animationName));if(h.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=h=>{h.target===e&&(i.current=iu(r.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=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function iu(t){return(t==null?void 0:t.animationName)||"none"}function QA(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Gf=0;function U1(){g.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??d0()),document.body.insertAdjacentElement("beforeend",t[1]??d0()),Gf++,()=>{Gf===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Gf--}},[])}function d0(){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 Kn=function(){return Kn=Object.assign||function(e){for(var n,r=1,s=arguments.length;r"u")return f$;var e=h$(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},v$=W1(),to="data-scroll-locked",g$=function(t,e,n,r){var s=t.left,i=t.top,o=t.right,a=t.gap;return n===void 0&&(n="margin"),` - .`.concat(XA,` { - overflow: hidden `).concat(r,`; - padding-right: `).concat(a,"px ").concat(r,`; - } - body[`).concat(to,`] { - overflow: hidden `).concat(r,`; - overscroll-behavior: contain; - `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&` - padding-left: `.concat(s,`px; - padding-top: `).concat(i,`px; - padding-right: `).concat(o,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(a,"px ").concat(r,`; - `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),` - } - - .`).concat(Nu,` { - right: `).concat(a,"px ").concat(r,`; - } - - .`).concat(Au,` { - margin-right: `).concat(a,"px ").concat(r,`; - } - - .`).concat(Nu," .").concat(Nu,` { - right: 0 `).concat(r,`; - } - - .`).concat(Au," .").concat(Au,` { - margin-right: 0 `).concat(r,`; - } - - body[`).concat(to,`] { - `).concat(JA,": ").concat(a,`px; - } -`)},h0=function(){var t=parseInt(document.body.getAttribute(to)||"0",10);return isFinite(t)?t:0},m$=function(){g.useEffect(function(){return document.body.setAttribute(to,(h0()+1).toString()),function(){var t=h0()-1;t<=0?document.body.removeAttribute(to):document.body.setAttribute(to,t.toString())}},[])},y$=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;m$();var i=g.useMemo(function(){return p$(s)},[s]);return g.createElement(v$,{styles:g$(i,!e,s,n?"":"!important")})},Xp=!1;if(typeof window<"u")try{var ou=Object.defineProperty({},"passive",{get:function(){return Xp=!0,!0}});window.addEventListener("test",ou,ou),window.removeEventListener("test",ou,ou)}catch{Xp=!1}var Ei=Xp?{passive:!1}:!1,_$=function(t){return t.tagName==="TEXTAREA"},G1=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!_$(t)&&n[e]==="visible")},w$=function(t){return G1(t,"overflowY")},x$=function(t){return G1(t,"overflowX")},p0=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=K1(t,r);if(s){var i=Q1(t,r),o=i[1],a=i[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},b$=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},E$=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},K1=function(t,e){return t==="v"?w$(e):x$(e)},Q1=function(t,e){return t==="v"?b$(e):E$(e)},S$=function(t,e){return t==="h"&&e==="rtl"?-1:1},C$=function(t,e,n,r,s){var i=S$(t,window.getComputedStyle(e).direction),o=i*r,a=n.target,l=e.contains(a),u=!1,c=o>0,d=0,f=0;do{if(!a)break;var h=Q1(t,a),_=h[0],p=h[1],y=h[2],v=p-y-i*_;(_||v)&&K1(t,a)&&(d+=v,f+=_);var m=a.parentNode;a=m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE?m.host:m}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},au=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},v0=function(t){return[t.deltaX,t.deltaY]},g0=function(t){return t&&"current"in t?t.current:t},k$=function(t,e){return t[0]===e[0]&&t[1]===e[1]},P$=function(t){return` - .block-interactivity-`.concat(t,` {pointer-events: none;} - .allow-interactivity-`).concat(t,` {pointer-events: all;} -`)},R$=0,Si=[];function T$(t){var e=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),s=g.useState(R$++)[0],i=g.useState(W1)[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=YA([t.lockRef.current],(t.shards||[]).map(g0),!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 v=au(p),m=n.current,x="deltaX"in p?p.deltaX:m[0]-v[0],b="deltaY"in p?p.deltaY:m[1]-v[1],E,S=p.target,k=Math.abs(x)>Math.abs(b)?"h":"v";if("touches"in p&&k==="h"&&S.type==="range")return!1;var C=window.getSelection(),I=C&&C.anchorNode,P=I?I===S||I.contains(S):!1;if(P)return!1;var $=p0(k,S);if(!$)return!0;if($?E=k:(E=k==="v"?"h":"v",$=p0(k,S)),!$)return!1;if(!r.current&&"changedTouches"in p&&(x||b)&&(r.current=E),!E)return!0;var N=r.current||E;return C$(N,y,p,N==="h"?x:b)},[]),l=g.useCallback(function(p){var y=p;if(!(!Si.length||Si[Si.length-1]!==i)){var v="deltaY"in y?v0(y):au(y),m=e.current.filter(function(E){return E.name===y.type&&(E.target===y.target||y.target===E.shadowParent)&&k$(E.delta,v)})[0];if(m&&m.should){y.cancelable&&y.preventDefault();return}if(!m){var x=(o.current.shards||[]).map(g0).filter(Boolean).filter(function(E){return E.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,v,m){var x={name:p,delta:y,target:v,should:m,shadowParent:I$(v)};e.current.push(x),setTimeout(function(){e.current=e.current.filter(function(b){return b!==x})},1)},[]),c=g.useCallback(function(p){n.current=au(p),r.current=void 0},[]),d=g.useCallback(function(p){u(p.type,v0(p),p.target,a(p,t.lockRef.current))},[]),f=g.useCallback(function(p){u(p.type,au(p),p.target,a(p,t.lockRef.current))},[]);g.useEffect(function(){return Si.push(i),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Ei),document.addEventListener("touchmove",l,Ei),document.addEventListener("touchstart",c,Ei),function(){Si=Si.filter(function(p){return p!==i}),document.removeEventListener("wheel",l,Ei),document.removeEventListener("touchmove",l,Ei),document.removeEventListener("touchstart",c,Ei)}},[]);var h=t.removeScrollBar,_=t.inert;return g.createElement(g.Fragment,null,_?g.createElement(i,{styles:P$(s)}):null,h?g.createElement(y$,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function I$(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const O$=i$(H1,T$);var Ng=g.forwardRef(function(t,e){return g.createElement(wd,Kn({},t,{ref:e,sideCar:O$}))});Ng.classNames=wd.classNames;var M$=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Ci=new WeakMap,lu=new WeakMap,uu={},Xf=0,Y1=function(t){return t&&(t.host||Y1(t.parentNode))},N$=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=Y1(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},A$=function(t,e,n,r){var s=N$(e,Array.isArray(t)?t:[t]);uu[n]||(uu[n]=new WeakMap);var i=uu[n],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 h=f.getAttribute(r),_=h!==null&&h!=="false",p=(Ci.get(f)||0)+1,y=(i.get(f)||0)+1;Ci.set(f,p),i.set(f,y),o.push(f),p===1&&_&&lu.set(f,!0),y===1&&f.setAttribute(n,"true"),_||f.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",f,v)}})};return c(e),a.clear(),Xf++,function(){o.forEach(function(d){var f=Ci.get(d)-1,h=i.get(d)-1;Ci.set(d,f),i.set(d,h),f||(lu.has(d)||d.removeAttribute(r),lu.delete(d)),h||d.removeAttribute(n)}),Xf--,Xf||(Ci=new WeakMap,Ci=new WeakMap,lu=new WeakMap,uu={})}},X1=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=M$(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),A$(r,s,n,"aria-hidden")):function(){return null}};function $$(t){const e=L$(t),n=g.forwardRef((r,s)=>{const{children:i,...o}=r,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 n.displayName=`${t}.Slot`,n}function L$(t){const e=g.forwardRef((n,r)=>{const{children:s,...i}=n;if(g.isValidElement(s)){const o=z$(s),a=D$(i,s.props);return s.type!==g.Fragment&&(a.ref=r?Ss(r,o):o),g.cloneElement(s,a)}return g.Children.count(s)>1?g.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var j$=Symbol("radix.slottable");function F$(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===j$}function D$(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...a)=>{const l=i(...a);return s(...a),l}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function z$(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var xd="Dialog",[J1]=Cs(xd),[B$,Ln]=J1(xd),Z1=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=t,a=g.useRef(null),l=g.useRef(null),[u,c]=yd({prop:r,defaultProp:s??!1,onChange:i,caller:xd});return w.jsx(B$,{scope:e,triggerRef:a,contentRef:l,contentId:eo(),titleId:eo(),descriptionId:eo(),open:u,onOpenChange:c,onOpenToggle:g.useCallback(()=>c(d=>!d),[c]),modal:o,children:n})};Z1.displayName=xd;var eS="DialogTrigger",tS=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Ln(eS,n),i=Xe(e,s.triggerRef);return w.jsx(Re.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Lg(s.open),...r,ref:i,onClick:Z(t.onClick,s.onOpenToggle)})});tS.displayName=eS;var Ag="DialogPortal",[U$,nS]=J1(Ag,{forceMount:void 0}),rS=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=Ln(Ag,e);return w.jsx(U$,{scope:e,forceMount:n,children:g.Children.map(r,o=>w.jsx(er,{present:n||i.open,children:w.jsx(_d,{asChild:!0,container:s,children:o})}))})};rS.displayName=Ag;var Fc="DialogOverlay",sS=g.forwardRef((t,e)=>{const n=nS(Fc,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Ln(Fc,t.__scopeDialog);return i.modal?w.jsx(er,{present:r||i.open,children:w.jsx(q$,{...s,ref:e})}):null});sS.displayName=Fc;var V$=$$("DialogOverlay.RemoveScroll"),q$=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Ln(Fc,n);return w.jsx(Ng,{as:V$,allowPinchZoom:!0,shards:[s.contentRef],children:w.jsx(Re.div,{"data-state":Lg(s.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),oi="DialogContent",iS=g.forwardRef((t,e)=>{const n=nS(oi,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Ln(oi,t.__scopeDialog);return w.jsx(er,{present:r||i.open,children:i.modal?w.jsx(H$,{...s,ref:e}):w.jsx(W$,{...s,ref:e})})});iS.displayName=oi;var H$=g.forwardRef((t,e)=>{const n=Ln(oi,t.__scopeDialog),r=g.useRef(null),s=Xe(e,n.contentRef,r);return g.useEffect(()=>{const i=r.current;if(i)return X1(i)},[]),w.jsx(oS,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Z(t.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Z(t.onPointerDownOutside,i=>{const o=i.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&i.preventDefault()}),onFocusOutside:Z(t.onFocusOutside,i=>i.preventDefault())})}),W$=g.forwardRef((t,e)=>{const n=Ln(oi,t.__scopeDialog),r=g.useRef(!1),s=g.useRef(!1);return w.jsx(oS,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,a;(o=t.onCloseAutoFocus)==null||o.call(t,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var l,u;(l=t.onInteractOutside)==null||l.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),oS=g.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...o}=t,a=Ln(oi,n),l=g.useRef(null),u=Xe(e,l);return U1(),w.jsxs(w.Fragment,{children:[w.jsx(Mg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:w.jsx(xl,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Lg(a.open),...o,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),w.jsxs(w.Fragment,{children:[w.jsx(G$,{titleId:a.titleId}),w.jsx(Q$,{contentRef:l,descriptionId:a.descriptionId})]})]})}),$g="DialogTitle",aS=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Ln($g,n);return w.jsx(Re.h2,{id:s.titleId,...r,ref:e})});aS.displayName=$g;var lS="DialogDescription",uS=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Ln(lS,n);return w.jsx(Re.p,{id:s.descriptionId,...r,ref:e})});uS.displayName=lS;var cS="DialogClose",dS=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Ln(cS,n);return w.jsx(Re.button,{type:"button",...r,ref:e,onClick:Z(t.onClick,()=>s.onOpenChange(!1))})});dS.displayName=cS;function Lg(t){return t?"open":"closed"}var fS="DialogTitleWarning",[o5,hS]=gA(fS,{contentName:oi,titleName:$g,docsSlug:"dialog"}),G$=({titleId:t})=>{const e=hS(fS),n=`\`${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(n))},[n,t]),null},K$="DialogDescriptionWarning",Q$=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${hS(K$).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(r))},[r,t,e]),null},Y$=Z1,X$=tS,J$=rS,Z$=sS,e2=iS,t2=aS,a5=uS,n2=dS;const m0=t=>t.endsWith("/")?t.slice(0,-1):t;function jg(){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 m0(e.origin)}catch{return m0(t)}}function r2(t){const e=t.startsWith("/")?t:`/${t}`,n=jg();return n?`${n}${e}`:e}function Fg(t){const e=t.startsWith("/")?t:`/${t}`;return r2(e)}function s2(){return Fg("/admin-dashboard")}function l5(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=jg();return e?`${e}${t}`:t}return t}function jo(){const e=String("1").trim().toLowerCase();return e==="1"||e==="true"||e==="yes"}function al(){const e=String("0").trim().toLowerCase();return e==="1"||e==="true"||e==="yes"}const i2="https://paperswithcode.co/chat";function o2(){return jo()&&!al()}function pS(t){return["1","true","yes"].includes("".trim().toLowerCase())}function a2(){return pS()}function u5(){return al()&&pS()}function c5(){return typeof window<"u"&&window.location.hostname==="staging.paperswithcode.co"}function l2(){const e=String("1").trim().toLowerCase();return e==="1"||e==="true"||e==="yes"}const u2="/hf-logo.svg?v=20260513b",y0=({size:t=14})=>w.jsx("img",{src:u2,alt:"",width:Math.round(t*95/88),height:t,"aria-hidden":"true",draggable:!1,style:{display:"block"}});function c2(t,e=!1,n=!1){const r=Fg("/api/v1/auth/hf/login"),i=new URL(r,window.location.origin).origin===window.location.origin?t:new URL(t,window.location.origin).toString(),o=new URLSearchParams({return_to:i});return e&&o.set("authorize_inference","true"),n&&o.set("collect_email","true"),`${r}?${o.toString()}`}const vS=({returnTo:t,compact:e=!1,label:n="Sign in",authorizeInference:r=!1,collectEmail:s=!1})=>{if(jo())return null;const i=()=>{window.location.href=c2(t,r,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(y0,{size:16})}):w.jsxs("button",{type:"button",className:"hf-signin-btn",onClick:i,"aria-label":"Sign in with Hugging Face",children:[w.jsx(y0,{size:18}),w.jsx("span",{children:n})]})};function d2(t,e=[]){let n=[];function r(i,o){const a=g.createContext(o);a.displayName=i+"Context";const l=n.length;n=[...n,o];const u=d=>{var v;const{scope:f,children:h,..._}=d,p=((v=f==null?void 0:f[t])==null?void 0:v[l])||a,y=g.useMemo(()=>_,Object.values(_));return w.jsx(p.Provider,{value:y,children:h})};u.displayName=i+"Provider";function c(d,f){var p;const h=((p=f==null?void 0:f[t])==null?void 0:p[l])||a,_=g.useContext(h);if(_)return _;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,c]}const s=()=>{const i=n.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,[r,f2(s,...e)]}function f2(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((a,{useScope:l,scopeName:u})=>{const d=l(i)[`__scope${u}`];return{...a,...d}},{});return g.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}var h2=Symbol.for("react.lazy"),Dc=Gc[" use ".trim().toString()];function p2(t){return typeof t=="object"&&t!==null&&"then"in t}function gS(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===h2&&"_payload"in t&&p2(t._payload)}function mS(t){const e=v2(t),n=g.forwardRef((r,s)=>{let{children:i,...o}=r;gS(i)&&typeof Dc=="function"&&(i=Dc(i._payload));const a=g.Children.toArray(i),l=a.find(m2);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 n.displayName=`${t}.Slot`,n}var d5=mS("Slot");function v2(t){const e=g.forwardRef((n,r)=>{let{children:s,...i}=n;if(gS(s)&&typeof Dc=="function"&&(s=Dc(s._payload)),g.isValidElement(s)){const o=_2(s),a=y2(i,s.props);return s.type!==g.Fragment&&(a.ref=r?Ss(r,o):o),g.cloneElement(s,a)}return g.Children.count(s)>1?g.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var g2=Symbol("radix.slottable");function m2(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===g2}function y2(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...a)=>{const l=i(...a);return s(...a),l}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function _2(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var w2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Dg=w2.reduce((t,e)=>{const n=mS(`Primitive.${e}`),r=g.forwardRef((s,i)=>{const{asChild:o,...a}=s,l=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(l,{...a,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),yS={exports:{}},_S={};/** - * @license React - * use-sync-external-store-shim.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Io=g;function x2(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var b2=typeof Object.is=="function"?Object.is:x2,E2=Io.useState,S2=Io.useEffect,C2=Io.useLayoutEffect,k2=Io.useDebugValue;function P2(t,e){var n=e(),r=E2({inst:{value:n,getSnapshot:e}}),s=r[0].inst,i=r[1];return C2(function(){s.value=n,s.getSnapshot=e,Jf(s)&&i({inst:s})},[t,n,e]),S2(function(){return Jf(s)&&i({inst:s}),t(function(){Jf(s)&&i({inst:s})})},[t]),k2(n),n}function Jf(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!b2(t,n)}catch{return!0}}function R2(t,e){return e()}var T2=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?R2:P2;_S.useSyncExternalStore=Io.useSyncExternalStore!==void 0?Io.useSyncExternalStore:T2;yS.exports=_S;var I2=yS.exports;function O2(){return I2.useSyncExternalStore(M2,()=>!0,()=>!1)}function M2(){return()=>{}}var zg="Avatar",[N2]=d2(zg),[A2,wS]=N2(zg),xS=g.forwardRef((t,e)=>{const{__scopeAvatar:n,...r}=t,[s,i]=g.useState("idle");return w.jsx(A2,{scope:n,imageLoadingStatus:s,onImageLoadingStatusChange:i,children:w.jsx(Dg.span,{...r,ref:e})})});xS.displayName=zg;var bS="AvatarImage",ES=g.forwardRef((t,e)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:s=()=>{},...i}=t,o=wS(bS,n),a=$2(r,i),l=Bt(u=>{s(u),o.onImageLoadingStatusChange(u)});return pn(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?w.jsx(Dg.img,{...i,ref:e,src:r}):null});ES.displayName=bS;var SS="AvatarFallback",CS=g.forwardRef((t,e)=>{const{__scopeAvatar:n,delayMs:r,...s}=t,i=wS(SS,n),[o,a]=g.useState(r===void 0);return g.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),o&&i.imageLoadingStatus!=="loaded"?w.jsx(Dg.span,{...s,ref:e}):null});CS.displayName=SS;function _0(t,e){return t?e?(t.src!==e&&(t.src=e),t.complete&&t.naturalWidth>0?"loaded":"loading"):"error":"idle"}function $2(t,{referrerPolicy:e,crossOrigin:n}){const r=O2(),s=g.useRef(null),i=r?(s.current||(s.current=new window.Image),s.current):null,[o,a]=g.useState(()=>_0(i,t));return pn(()=>{a(_0(i,t))},[i,t]),pn(()=>{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 n=="string"&&(i.crossOrigin=n),()=>{i.removeEventListener("load",u),i.removeEventListener("error",c)}},[i,n,e]),o}var kS=xS,PS=ES,RS=CS;function TS(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e{const e=F2(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{const a=o.split(Bg);return a[0]===""&&a.length!==1&&a.shift(),OS(a,e)||j2(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},OS=(t,e)=>{var o;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),s=r?OS(t.slice(1),r):void 0;if(s)return s;if(e.validators.length===0)return;const i=t.join(Bg);return(o=e.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},w0=/^\[(.+)\]$/,j2=t=>{if(w0.test(t)){const e=w0.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},F2=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return z2(Object.entries(t.classGroups),n).forEach(([i,o])=>{Jp(o,r,i,e)}),r},Jp=(t,e,n,r)=>{t.forEach(s=>{if(typeof s=="string"){const i=s===""?e:x0(e,s);i.classGroupId=n;return}if(typeof s=="function"){if(D2(s)){Jp(s(r),e,n,r);return}e.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{Jp(o,x0(e,i),n,r)})})},x0=(t,e)=>{let n=t;return e.split(Bg).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},D2=t=>t.isThemeGetter,z2=(t,e)=>e?t.map(([n,r])=>{const s=r.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,a])=>[e+o,a])):i);return[n,s]}):t,B2=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const s=(i,o)=>{n.set(i,o),e++,e>t&&(e=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return s(i,o),o},set(i,o){n.has(i)?n.set(i,o):s(i,o)}}},MS="!",U2=t=>{const{separator:e,experimentalParseClassName:n}=t,r=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:h,baseClassName:_,maybePostfixModifierPosition:p}};return n?a=>n({className:a,parseClassName:o}):o},V2=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},q2=t=>({cache:B2(t.cacheSize),parseClassName:U2(t),...L2(t)}),H2=/\s+/,W2=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=e,i=[],o=t.trim().split(H2);let a="";for(let l=o.length-1;l>=0;l-=1){const u=o[l],{modifiers:c,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:h}=n(u);let _=!!h,p=r(_?f.substring(0,h):f);if(!p){if(!_){a=u+(a.length>0?" "+a:a);continue}if(p=r(f),!p){a=u+(a.length>0?" "+a:a);continue}_=!1}const y=V2(c).join(":"),v=d?y+MS:y,m=v+p;if(i.includes(m))continue;i.push(m);const x=s(p,_);for(let b=0;b0?" "+a:a)}return a};function G2(){let t=0,e,n,r="";for(;t{if(typeof t=="string")return t;let e,n="";for(let r=0;rd(c),t());return n=q2(u),r=n.cache.get,s=n.cache.set,i=a,a(l)}function a(l){const u=r(l);if(u)return u;const c=W2(l,n);return s(l,c),c}return function(){return i(G2.apply(null,arguments))}}const Me=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},AS=/^\[(?:([a-z-]+):)?(.+)\]$/i,Q2=/^\d+\/\d+$/,Y2=new Set(["px","full","screen"]),X2=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,J2=/\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$/,Z2=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,eL=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,tL=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ir=t=>no(t)||Y2.has(t)||Q2.test(t),Ur=t=>Fo(t,"length",uL),no=t=>!!t&&!Number.isNaN(Number(t)),Zf=t=>Fo(t,"number",no),ia=t=>!!t&&Number.isInteger(Number(t)),nL=t=>t.endsWith("%")&&no(t.slice(0,-1)),ae=t=>AS.test(t),Vr=t=>X2.test(t),rL=new Set(["length","size","percentage"]),sL=t=>Fo(t,rL,$S),iL=t=>Fo(t,"position",$S),oL=new Set(["image","url"]),aL=t=>Fo(t,oL,dL),lL=t=>Fo(t,"",cL),oa=()=>!0,Fo=(t,e,n)=>{const r=AS.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},uL=t=>J2.test(t)&&!Z2.test(t),$S=()=>!1,cL=t=>eL.test(t),dL=t=>tL.test(t),fL=()=>{const t=Me("colors"),e=Me("spacing"),n=Me("blur"),r=Me("brightness"),s=Me("borderColor"),i=Me("borderRadius"),o=Me("borderSpacing"),a=Me("borderWidth"),l=Me("contrast"),u=Me("grayscale"),c=Me("hueRotate"),d=Me("invert"),f=Me("gap"),h=Me("gradientColorStops"),_=Me("gradientColorStopPositions"),p=Me("inset"),y=Me("margin"),v=Me("opacity"),m=Me("padding"),x=Me("saturate"),b=Me("scale"),E=Me("sepia"),S=Me("skew"),k=Me("space"),C=Me("translate"),I=()=>["auto","contain","none"],P=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto",ae,e],N=()=>[ae,e],B=()=>["",ir,Ur],j=()=>["auto",no,ae],W=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],q=()=>["solid","dashed","dotted","double","none"],G=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>["start","end","center","between","around","evenly","stretch"],T=()=>["","0",ae],z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],K=()=>[no,ae];return{cacheSize:500,separator:":",theme:{colors:[oa],spacing:[ir,Ur],blur:["none","",Vr,ae],brightness:K(),borderColor:[t],borderRadius:["none","","full",Vr,ae],borderSpacing:N(),borderWidth:B(),contrast:K(),grayscale:T(),hueRotate:K(),invert:T(),gap:N(),gradientColorStops:[t],gradientColorStopPositions:[nL,Ur],inset:$(),margin:$(),opacity:K(),padding:N(),saturate:K(),scale:K(),sepia:T(),skew:K(),space:N(),translate:N()},classGroups:{aspect:[{aspect:["auto","square","video",ae]}],container:["container"],columns:[{columns:[Vr]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"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:[...W(),ae]}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],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",ia,ae]}],basis:[{basis:$()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ae]}],grow:[{grow:T()}],shrink:[{shrink:T()}],order:[{order:["first","last","none",ia,ae]}],"grid-cols":[{"grid-cols":[oa]}],"col-start-end":[{col:["auto",{span:["full",ia,ae]},ae]}],"col-start":[{"col-start":j()}],"col-end":[{"col-end":j()}],"grid-rows":[{"grid-rows":[oa]}],"row-start-end":[{row:["auto",{span:[ia,ae]},ae]}],"row-start":[{"row-start":j()}],"row-end":[{"row-end":j()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ae]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ae]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...M()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...M(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...M(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[m]}],px:[{px:[m]}],py:[{py:[m]}],ps:[{ps:[m]}],pe:[{pe:[m]}],pt:[{pt:[m]}],pr:[{pr:[m]}],pb:[{pb:[m]}],pl:[{pl:[m]}],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":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ae,e]}],"min-w":[{"min-w":[ae,e,"min","max","fit"]}],"max-w":[{"max-w":[ae,e,"none","full","min","max","fit","prose",{screen:[Vr]},Vr]}],h:[{h:[ae,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ae,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ae,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ae,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Vr,Ur]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Zf]}],"font-family":[{font:[oa]}],"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",ae]}],"line-clamp":[{"line-clamp":["none",no,Zf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ir,ae]}],"list-image":[{"list-image":["none",ae]}],"list-style-type":[{list:["none","disc","decimal",ae]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ir,Ur]}],"underline-offset":[{"underline-offset":["auto",ir,ae]}],"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:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ae]}],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",ae]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...W(),iL]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",sL]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},aL]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[_]}],"gradient-via-pos":[{via:[_]}],"gradient-to-pos":[{to:[_]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],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":[v]}],"border-style":[{border:[...q(),"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":[v]}],"divide-style":[{divide:q()}],"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:["",...q()]}],"outline-offset":[{"outline-offset":[ir,ae]}],"outline-w":[{outline:[ir,Ur]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:B()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[ir,Ur]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Vr,lL]}],"shadow-color":[{shadow:[oa]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...G(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":G()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Vr,ae]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[x]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"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":[v]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"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",ae]}],duration:[{duration:K()}],ease:[{ease:["linear","in","out","in-out",ae]}],delay:[{delay:K()}],animate:[{animate:["none","spin","ping","pulse","bounce",ae]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[ia,ae]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ae]}],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",ae]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"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",ae]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[ir,Ur,Zf]}],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"]}}},hL=K2(fL);function at(...t){return hL(IS(t))}function f5(t){const e=t.trim(),n=e.match(/^(\d{4})-(\d{4,5})(v\d+)?$/);if(n)return`${n[1]}.${n[2]}`;const r=e.match(/^(\d{4}\.\d{4,5})(v\d+)$/);return r?r[1]:e}function h5(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 n=String(Math.abs(t));if(n.includes("e"))return t.toFixed(e);const r=+`${Math.round(+`${n}e${e}`)}e-${e}`;return(t<0?-r:r).toFixed(e)}const LS=g.forwardRef(({className:t,...e},n)=>w.jsx(kS,{ref:n,className:at("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...e}));LS.displayName=kS.displayName;const jS=g.forwardRef(({className:t,...e},n)=>w.jsx(PS,{ref:n,className:at("aspect-square h-full w-full",t),...e}));jS.displayName=PS.displayName;const FS=g.forwardRef(({className:t,...e},n)=>w.jsx(RS,{ref:n,className:at("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...e}));FS.displayName=RS.displayName;function b0(t){const e=pL(t),n=g.forwardRef((r,s)=>{const{children:i,...o}=r,a=g.Children.toArray(i),l=a.find(gL);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 n.displayName=`${t}.Slot`,n}function pL(t){const e=g.forwardRef((n,r)=>{const{children:s,...i}=n;if(g.isValidElement(s)){const o=yL(s),a=mL(i,s.props);return s.type!==g.Fragment&&(a.ref=r?Ss(r,o):o),g.cloneElement(s,a)}return g.Children.count(s)>1?g.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var vL=Symbol("radix.slottable");function gL(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===vL}function mL(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...a)=>{const l=i(...a);return s(...a),l}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function yL(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function Ug(t){const e=t+"CollectionProvider",[n,r]=Cs(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:y,children:v}=p,m=R.useRef(null),x=R.useRef(new Map).current;return w.jsx(s,{scope:y,itemMap:x,collectionRef:m,children:v})};o.displayName=e;const a=t+"CollectionSlot",l=b0(a),u=R.forwardRef((p,y)=>{const{scope:v,children:m}=p,x=i(a,v),b=Xe(y,x.collectionRef);return w.jsx(l,{ref:b,children:m})});u.displayName=a;const c=t+"CollectionItemSlot",d="data-radix-collection-item",f=b0(c),h=R.forwardRef((p,y)=>{const{scope:v,children:m,...x}=p,b=R.useRef(null),E=Xe(y,b),S=i(c,v);return R.useEffect(()=>(S.itemMap.set(b,{ref:b,...x}),()=>void S.itemMap.delete(b))),w.jsx(f,{[d]:"",ref:E,children:m})});h.displayName=c;function _(p){const y=i(t+"CollectionConsumer",p);return R.useCallback(()=>{const m=y.collectionRef.current;if(!m)return[];const x=Array.from(m.querySelectorAll(`[${d}]`));return Array.from(y.itemMap.values()).sort((S,k)=>x.indexOf(S.ref.current)-x.indexOf(k.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:o,Slot:u,ItemSlot:h},_,r]}var _L=g.createContext(void 0);function DS(t){const e=g.useContext(_L);return t||e||"ltr"}const wL=["top","right","bottom","left"],_s=Math.min,Wt=Math.max,zc=Math.round,du=Math.floor,Zn=t=>({x:t,y:t}),xL={left:"right",right:"left",bottom:"top",top:"bottom"};function Zp(t,e,n){return Wt(t,_s(e,n))}function Cr(t,e){return typeof t=="function"?t(e):t}function kr(t){return t.split("-")[0]}function Do(t){return t.split("-")[1]}function Vg(t){return t==="x"?"y":"x"}function qg(t){return t==="y"?"height":"width"}function Yn(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Hg(t){return Vg(Yn(t))}function bL(t,e,n){n===void 0&&(n=!1);const r=Do(t),s=Hg(t),i=qg(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=Bc(o)),[o,Bc(o)]}function EL(t){const e=Bc(t);return[ev(t),e,ev(e)]}function ev(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const E0=["left","right"],S0=["right","left"],SL=["top","bottom"],CL=["bottom","top"];function kL(t,e,n){switch(t){case"top":case"bottom":return n?e?S0:E0:e?E0:S0;case"left":case"right":return e?SL:CL;default:return[]}}function PL(t,e,n,r){const s=Do(t);let i=kL(kr(t),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),e&&(i=i.concat(i.map(ev)))),i}function Bc(t){const e=kr(t);return xL[e]+t.slice(e.length)}function RL(t){return{top:0,right:0,bottom:0,left:0,...t}}function zS(t){return typeof t!="number"?RL(t):{top:t,right:t,bottom:t,left:t}}function Uc(t){const{x:e,y:n,width:r,height:s}=t;return{width:r,height:s,top:n,left:e,right:e+r,bottom:n+s,x:e,y:n}}function C0(t,e,n){let{reference:r,floating:s}=t;const i=Yn(e),o=Hg(e),a=qg(o),l=kr(e),u=i==="y",c=r.x+r.width/2-s.width/2,d=r.y+r.height/2-s.height/2,f=r[a]/2-s[a]/2;let h;switch(l){case"top":h={x:c,y:r.y-s.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-s.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Do(e)){case"start":h[o]-=f*(n&&u?-1:1);break;case"end":h[o]+=f*(n&&u?-1:1);break}return h}async function TL(t,e){var n;e===void 0&&(e={});const{x:r,y:s,platform:i,rects:o,elements:a,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Cr(e,t),_=zS(h),y=a[f?d==="floating"?"reference":"floating":d],v=Uc(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),m=d==="floating"?{x:r,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},E=Uc(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:m,offsetParent:x,strategy:l}):m);return{top:(v.top-E.top+_.top)/b.y,bottom:(E.bottom-v.bottom+_.bottom)/b.y,left:(v.left-E.left+_.left)/b.x,right:(E.right-v.right+_.right)/b.x}}const IL=50,OL=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:o}=n,a=o.detectOverflow?o:{...o,detectOverflow:TL},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}=C0(u,r,l),f=r,h=0;const _={};for(let p=0;p({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:s,rects:i,platform:o,elements:a,middlewareData:l}=e,{element:u,padding:c=0}=Cr(t,e)||{};if(u==null)return{};const d=zS(c),f={x:n,y:r},h=Hg(s),_=qg(h),p=await o.getDimensions(u),y=h==="y",v=y?"top":"left",m=y?"bottom":"right",x=y?"clientHeight":"clientWidth",b=i.reference[_]+i.reference[h]-f[h]-i.floating[_],E=f[h]-i.reference[h],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let k=S?S[x]:0;(!k||!await(o.isElement==null?void 0:o.isElement(S)))&&(k=a.floating[x]||i.floating[_]);const C=b/2-E/2,I=k/2-p[_]/2-1,P=_s(d[v],I),$=_s(d[m],I),N=P,B=k-p[_]-$,j=k/2-p[_]/2+C,W=Zp(N,j,B),q=!l.arrow&&Do(s)!=null&&j!==W&&i.reference[_]/2-(jj<=0)){var $,N;const j=((($=i.flip)==null?void 0:$.index)||0)+1,W=k[j];if(W&&(!(d==="alignment"?m!==Yn(W):!1)||P.every(M=>Yn(M.placement)===m?M.overflows[0]>0:!0)))return{data:{index:j,overflows:P},reset:{placement:W}};let q=(N=P.filter(G=>G.overflows[0]<=0).sort((G,M)=>G.overflows[1]-M.overflows[1])[0])==null?void 0:N.placement;if(!q)switch(h){case"bestFit":{var B;const G=(B=P.filter(M=>{if(S){const T=Yn(M.placement);return T===m||T==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(T=>T>0).reduce((T,z)=>T+z,0)]).sort((M,T)=>M[1]-T[1])[0])==null?void 0:B[0];G&&(q=G);break}case"initialPlacement":q=a;break}if(s!==q)return{reset:{placement:q}}}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 P0(t){return wL.some(e=>t[e]>=0)}const AL=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:s="referenceHidden",...i}=Cr(t,e);switch(s){case"referenceHidden":{const o=await r.detectOverflow(e,{...i,elementContext:"reference"}),a=k0(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:P0(a)}}}case"escaped":{const o=await r.detectOverflow(e,{...i,altBoundary:!0}),a=k0(o,n.floating);return{data:{escapedOffsets:a,escaped:P0(a)}}}default:return{}}}}},BS=new Set(["left","top"]);async function $L(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=kr(n),a=Do(n),l=Yn(n)==="y",u=BS.has(o)?-1:1,c=i&&l?-1:1,d=Cr(e,t);let{mainAxis:f,crossAxis:h,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"&&(h=a==="end"?_*-1:_),l?{x:h*c,y:f*u}:{x:f*u,y:h*c}}const LL=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:s,y:i,placement:o,middlewareData:a}=e,l=await $L(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:s+l.x,y:i+l.y,data:{...l,placement:o}}}}},jL=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:s,platform:i}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:v=>{let{x:m,y:x}=v;return{x:m,y:x}}},...u}=Cr(t,e),c={x:n,y:r},d=await i.detectOverflow(e,u),f=Yn(kr(s)),h=Vg(f);let _=c[h],p=c[f];if(o){const v=h==="y"?"top":"left",m=h==="y"?"bottom":"right",x=_+d[v],b=_-d[m];_=Zp(x,_,b)}if(a){const v=f==="y"?"top":"left",m=f==="y"?"bottom":"right",x=p+d[v],b=p-d[m];p=Zp(x,p,b)}const y=l.fn({...e,[h]:_,[f]:p});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[h]:o,[f]:a}}}}}},FL=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:s,rects:i,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=Cr(t,e),c={x:n,y:r},d=Yn(s),f=Vg(d);let h=c[f],_=c[d];const p=Cr(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,E=i.reference[f]+i.reference[x]-y.mainAxis;hE&&(h=E)}if(u){var v,m;const x=f==="y"?"width":"height",b=BS.has(kr(s)),E=i.reference[d]-i.floating[x]+(b&&((v=o.offset)==null?void 0:v[d])||0)+(b?0:y.crossAxis),S=i.reference[d]+i.reference[x]+(b?0:((m=o.offset)==null?void 0:m[d])||0)-(b?y.crossAxis:0);_S&&(_=S)}return{[f]:h,[d]:_}}}},DL=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:s,rects:i,platform:o,elements:a}=e,{apply:l=()=>{},...u}=Cr(t,e),c=await o.detectOverflow(e,u),d=kr(s),f=Do(s),h=Yn(s)==="y",{width:_,height:p}=i.floating;let y,v;d==="top"||d==="bottom"?(y=d,v=f===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,y=f==="end"?"top":"bottom");const m=p-c.top-c.bottom,x=_-c.left-c.right,b=_s(p-c[y],m),E=_s(_-c[v],x),S=!e.middlewareData.shift;let k=b,C=E;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(C=x),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(k=m),S&&!f){const P=Wt(c.left,0),$=Wt(c.right,0),N=Wt(c.top,0),B=Wt(c.bottom,0);h?C=_-2*(P!==0||$!==0?P+$:Wt(c.left,c.right)):k=p-2*(N!==0||B!==0?N+B:Wt(c.top,c.bottom))}await l({...e,availableWidth:C,availableHeight:k});const I=await o.getDimensions(a.floating);return _!==I.width||p!==I.height?{reset:{rects:!0}}:{}}}};function bd(){return typeof window<"u"}function zo(t){return US(t)?(t.nodeName||"").toLowerCase():"#document"}function Xt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function tr(t){var e;return(e=(US(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function US(t){return bd()?t instanceof Node||t instanceof Xt(t).Node:!1}function Nn(t){return bd()?t instanceof Element||t instanceof Xt(t).Element:!1}function Ir(t){return bd()?t instanceof HTMLElement||t instanceof Xt(t).HTMLElement:!1}function R0(t){return!bd()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Xt(t).ShadowRoot}function bl(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=An(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&s!=="inline"&&s!=="contents"}function zL(t){return/^(table|td|th)$/.test(zo(t))}function Ed(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const BL=/transform|translate|scale|rotate|perspective|filter/,UL=/paint|layout|strict|content/,Os=t=>!!t&&t!=="none";let eh;function Wg(t){const e=Nn(t)?An(t):t;return Os(e.transform)||Os(e.translate)||Os(e.scale)||Os(e.rotate)||Os(e.perspective)||!Gg()&&(Os(e.backdropFilter)||Os(e.filter))||BL.test(e.willChange||"")||UL.test(e.contain||"")}function VL(t){let e=ws(t);for(;Ir(e)&&!Oo(e);){if(Wg(e))return e;if(Ed(e))return null;e=ws(e)}return null}function Gg(){return eh==null&&(eh=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),eh}function Oo(t){return/^(html|body|#document)$/.test(zo(t))}function An(t){return Xt(t).getComputedStyle(t)}function Sd(t){return Nn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ws(t){if(zo(t)==="html")return t;const e=t.assignedSlot||t.parentNode||R0(t)&&t.host||tr(t);return R0(e)?e.host:e}function VS(t){const e=ws(t);return Oo(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ir(e)&&bl(e)?e:VS(e)}function ll(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=VS(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),o=Xt(s);if(i){const a=tv(o);return e.concat(o,o.visualViewport||[],bl(s)?s:[],a&&n?ll(a):[])}else return e.concat(s,ll(s,[],n))}function tv(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function qS(t){const e=An(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=Ir(t),i=s?t.offsetWidth:n,o=s?t.offsetHeight:r,a=zc(n)!==i||zc(r)!==o;return a&&(n=i,r=o),{width:n,height:r,$:a}}function Kg(t){return Nn(t)?t:t.contextElement}function ro(t){const e=Kg(t);if(!Ir(e))return Zn(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=qS(e);let o=(i?zc(n.width):n.width)/r,a=(i?zc(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const qL=Zn(0);function HS(t){const e=Xt(t);return!Gg()||!e.visualViewport?qL:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function HL(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Xt(t)?!1:e}function ai(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=Kg(t);let o=Zn(1);e&&(r?Nn(r)&&(o=ro(r)):o=ro(t));const a=HL(i,n,r)?HS(i):Zn(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=Xt(i),h=r&&Nn(r)?Xt(r):r;let _=f,p=tv(_);for(;p&&r&&h!==_;){const y=ro(p),v=p.getBoundingClientRect(),m=An(p),x=v.left+(p.clientLeft+parseFloat(m.paddingLeft))*y.x,b=v.top+(p.clientTop+parseFloat(m.paddingTop))*y.y;l*=y.x,u*=y.y,c*=y.x,d*=y.y,l+=x,u+=b,_=Xt(p),p=tv(_)}}return Uc({width:c,height:d,x:l,y:u})}function Cd(t,e){const n=Sd(t).scrollLeft;return e?e.left+n:ai(tr(t)).left+n}function WS(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-Cd(t,n),s=n.top+e.scrollTop;return{x:r,y:s}}function WL(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",o=tr(r),a=e?Ed(e.floating):!1;if(r===o||a&&i)return n;let l={scrollLeft:0,scrollTop:0},u=Zn(1);const c=Zn(0),d=Ir(r);if((d||!d&&!i)&&((zo(r)!=="body"||bl(o))&&(l=Sd(r)),d)){const h=ai(r);u=ro(r),c.x=h.x+r.clientLeft,c.y=h.y+r.clientTop}const f=o&&!d&&!i?WS(o,l):Zn(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:n.y*u.y-l.scrollTop*u.y+c.y+f.y}}function GL(t){return Array.from(t.getClientRects())}function KL(t){const e=tr(t),n=Sd(t),r=t.ownerDocument.body,s=Wt(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),i=Wt(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Cd(t);const a=-n.scrollTop;return An(r).direction==="rtl"&&(o+=Wt(e.clientWidth,r.clientWidth)-s),{width:s,height:i,x:o,y:a}}const T0=25;function QL(t,e){const n=Xt(t),r=tr(t),s=n.visualViewport;let i=r.clientWidth,o=r.clientHeight,a=0,l=0;if(s){i=s.width,o=s.height;const c=Gg();(!c||c&&e==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}const u=Cd(r);if(u<=0){const c=r.ownerDocument,d=c.body,f=getComputedStyle(d),h=c.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,_=Math.abs(r.clientWidth-d.clientWidth-h);_<=T0&&(i-=_)}else u<=T0&&(i+=u);return{width:i,height:o,x:a,y:l}}function YL(t,e){const n=ai(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=Ir(t)?ro(t):Zn(1),o=t.clientWidth*i.x,a=t.clientHeight*i.y,l=s*i.x,u=r*i.y;return{width:o,height:a,x:l,y:u}}function I0(t,e,n){let r;if(e==="viewport")r=QL(t,n);else if(e==="document")r=KL(tr(t));else if(Nn(e))r=YL(e,n);else{const s=HS(t);r={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return Uc(r)}function GS(t,e){const n=ws(t);return n===e||!Nn(n)||Oo(n)?!1:An(n).position==="fixed"||GS(n,e)}function XL(t,e){const n=e.get(t);if(n)return n;let r=ll(t,[],!1).filter(a=>Nn(a)&&zo(a)!=="body"),s=null;const i=An(t).position==="fixed";let o=i?ws(t):t;for(;Nn(o)&&!Oo(o);){const a=An(o),l=Wg(o);!l&&a.position==="fixed"&&(s=null),(i?!l&&!s:!l&&a.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||bl(o)&&!l&&GS(t,o))?r=r.filter(c=>c!==o):s=a,o=ws(o)}return e.set(t,r),r}function JL(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const o=[...n==="clippingAncestors"?Ed(e)?[]:XL(e,this._c):[].concat(n),r],a=I0(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)}k===1&&!QS(u,t.getBoundingClientRect())&&o(),b=!1}try{n=new IntersectionObserver(E,{...x,root:s.ownerDocument})}catch{n=new IntersectionObserver(E,x)}n.observe(t)}return o(!0),i}function ij(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Kg(t),c=s||i?[...u?ll(u):[],...e?ll(e):[]]:[];c.forEach(v=>{s&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=u&&a?sj(u,n):null;let f=-1,h=null;o&&(h=new ResizeObserver(v=>{let[m]=v;m&&m.target===u&&h&&e&&(h.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(e)})),n()}),u&&!l&&h.observe(u),e&&h.observe(e));let _,p=l?ai(t):null;l&&y();function y(){const v=ai(t);p&&!QS(p,v)&&n(),p=v,_=requestAnimationFrame(y)}return n(),()=>{var v;c.forEach(m=>{s&&m.removeEventListener("scroll",n),i&&m.removeEventListener("resize",n)}),d==null||d(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(_)}}const oj=LL,aj=jL,lj=NL,uj=DL,cj=AL,M0=ML,dj=FL,fj=(t,e,n)=>{const r=new Map,s={platform:rj,...n},i={...s.platform,_c:r};return OL(t,e,{...s,platform:i})};var hj=typeof document<"u",pj=function(){},$u=hj?g.useLayoutEffect:pj;function Vc(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 n,r,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Vc(t[r],e[r]))return!1;return!0}if(s=Object.keys(t),n=s.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&t.$$typeof)&&!Vc(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function YS(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function N0(t,e){const n=YS(t);return Math.round(e*n)/n}function nh(t){const e=g.useRef(t);return $u(()=>{e.current=t}),e}function vj(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:o}={},transform:a=!0,whileElementsMounted:l,open:u}=t,[c,d]=g.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[f,h]=g.useState(r);Vc(f,r)||h(r);const[_,p]=g.useState(null),[y,v]=g.useState(null),m=g.useCallback(M=>{M!==S.current&&(S.current=M,p(M))},[]),x=g.useCallback(M=>{M!==k.current&&(k.current=M,v(M))},[]),b=i||_,E=o||y,S=g.useRef(null),k=g.useRef(null),C=g.useRef(c),I=l!=null,P=nh(l),$=nh(s),N=nh(u),B=g.useCallback(()=>{if(!S.current||!k.current)return;const M={placement:e,strategy:n,middleware:f};$.current&&(M.platform=$.current),fj(S.current,k.current,M).then(T=>{const z={...T,isPositioned:N.current!==!1};j.current&&!Vc(C.current,z)&&(C.current=z,_l.flushSync(()=>{d(z)}))})},[f,e,n,$,N]);$u(()=>{u===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,d(M=>({...M,isPositioned:!1})))},[u]);const j=g.useRef(!1);$u(()=>(j.current=!0,()=>{j.current=!1}),[]),$u(()=>{if(b&&(S.current=b),E&&(k.current=E),b&&E){if(P.current)return P.current(b,E,B);B()}},[b,E,B,P,I]);const W=g.useMemo(()=>({reference:S,floating:k,setReference:m,setFloating:x}),[m,x]),q=g.useMemo(()=>({reference:b,floating:E}),[b,E]),G=g.useMemo(()=>{const M={position:n,left:0,top:0};if(!q.floating)return M;const T=N0(q.floating,c.x),z=N0(q.floating,c.y);return a?{...M,transform:"translate("+T+"px, "+z+"px)",...YS(q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:T,top:z}},[n,a,q.floating,c.x,c.y]);return g.useMemo(()=>({...c,update:B,refs:W,elements:q,floatingStyles:G}),[c,B,W,q,G])}const gj=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:s}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?M0({element:r.current,padding:s}).fn(n):{}:r?M0({element:r,padding:s}).fn(n):{}}}},mj=(t,e)=>{const n=oj(t);return{name:n.name,fn:n.fn,options:[t,e]}},yj=(t,e)=>{const n=aj(t);return{name:n.name,fn:n.fn,options:[t,e]}},_j=(t,e)=>({fn:dj(t).fn,options:[t,e]}),wj=(t,e)=>{const n=lj(t);return{name:n.name,fn:n.fn,options:[t,e]}},xj=(t,e)=>{const n=uj(t);return{name:n.name,fn:n.fn,options:[t,e]}},bj=(t,e)=>{const n=cj(t);return{name:n.name,fn:n.fn,options:[t,e]}},Ej=(t,e)=>{const n=gj(t);return{name:n.name,fn:n.fn,options:[t,e]}};var Sj="Arrow",XS=g.forwardRef((t,e)=>{const{children:n,width:r=10,height:s=5,...i}=t;return w.jsx(Re.svg,{...i,ref:e,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:w.jsx("polygon",{points:"0,0 30,0 15,10"})})});XS.displayName=Sj;var Cj=XS;function kj(t){const[e,n]=g.useState(void 0);return pn(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=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;n({width:o,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var Qg="Popper",[JS,kd]=Cs(Qg),[Pj,ZS]=JS(Qg),eC=t=>{const{__scopePopper:e,children:n}=t,[r,s]=g.useState(null);return w.jsx(Pj,{scope:e,anchor:r,onAnchorChange:s,children:n})};eC.displayName=Qg;var tC="PopperAnchor",nC=g.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...s}=t,i=ZS(tC,n),o=g.useRef(null),a=Xe(e,o),l=g.useRef(null);return g.useEffect(()=>{const u=l.current;l.current=(r==null?void 0:r.current)||o.current,u!==l.current&&i.onAnchorChange(l.current)}),r?null:w.jsx(Re.div,{...s,ref:a})});nC.displayName=tC;var Yg="PopperContent",[Rj,Tj]=JS(Yg),rC=g.forwardRef((t,e)=>{var se,ve,_e,Ze,Ot,et;const{__scopePopper:n,side:r="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:h="optimized",onPlaced:_,...p}=t,y=ZS(Yg,n),[v,m]=g.useState(null),x=Xe(e,ze=>m(ze)),[b,E]=g.useState(null),S=kj(b),k=(S==null?void 0:S.width)??0,C=(S==null?void 0:S.height)??0,I=r+(i!=="center"?"-"+i:""),P=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},$=Array.isArray(u)?u:[u],N=$.length>0,B={padding:P,boundary:$.filter(Oj),altBoundary:N},{refs:j,floatingStyles:W,placement:q,isPositioned:G,middlewareData:M}=vj({strategy:"fixed",placement:I,whileElementsMounted:(...ze)=>ij(...ze,{animationFrame:h==="always"}),elements:{reference:y.anchor},middleware:[mj({mainAxis:s+C,alignmentAxis:o}),l&&yj({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?_j():void 0,...B}),l&&wj({...B}),xj({...B,apply:({elements:ze,rects:nr,availableWidth:Or,availableHeight:lt})=>{const{width:Mr,height:tn}=nr.reference,Ut=ze.floating.style;Ut.setProperty("--radix-popper-available-width",`${Or}px`),Ut.setProperty("--radix-popper-available-height",`${lt}px`),Ut.setProperty("--radix-popper-anchor-width",`${Mr}px`),Ut.setProperty("--radix-popper-anchor-height",`${tn}px`)}}),b&&Ej({element:b,padding:a}),Mj({arrowWidth:k,arrowHeight:C}),f&&bj({strategy:"referenceHidden",...B})]}),[T,z]=oC(q),K=Bt(_);pn(()=>{G&&(K==null||K())},[G,K]);const H=(se=M.arrow)==null?void 0:se.x,Q=(ve=M.arrow)==null?void 0:ve.y,X=((_e=M.arrow)==null?void 0:_e.centerOffset)!==0,[ie,pe]=g.useState();return pn(()=>{v&&pe(window.getComputedStyle(v).zIndex)},[v]),w.jsx("div",{ref:j.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:G?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ie,"--radix-popper-transform-origin":[(Ze=M.transformOrigin)==null?void 0:Ze.x,(Ot=M.transformOrigin)==null?void 0:Ot.y].join(" "),...((et=M.hide)==null?void 0:et.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:w.jsx(Rj,{scope:n,placedSide:T,onArrowChange:E,arrowX:H,arrowY:Q,shouldHideArrow:X,children:w.jsx(Re.div,{"data-side":T,"data-align":z,...p,ref:x,style:{...p.style,animation:G?void 0:"none"}})})})});rC.displayName=Yg;var sC="PopperArrow",Ij={top:"bottom",right:"left",bottom:"top",left:"right"},iC=g.forwardRef(function(e,n){const{__scopePopper:r,...s}=e,i=Tj(sC,r),o=Ij[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(Cj,{...s,ref:n,style:{...s.style,display:"block"}})})});iC.displayName=sC;function Oj(t){return t!==null}var Mj=t=>({name:"transformOrigin",options:t,fn(e){var y,v,m;const{placement:n,rects:r,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]=oC(n),d={start:"0%",center:"50%",end:"100%"}[c],f=(((v=s.arrow)==null?void 0:v.x)??0)+a/2,h=(((m=s.arrow)==null?void 0:m.y)??0)+l/2;let _="",p="";return u==="bottom"?(_=o?d:`${f}px`,p=`${-l}px`):u==="top"?(_=o?d:`${f}px`,p=`${r.floating.height+l}px`):u==="right"?(_=`${-l}px`,p=o?d:`${h}px`):u==="left"&&(_=`${r.floating.width+l}px`,p=o?d:`${h}px`),{data:{x:_,y:p}}}});function oC(t){const[e,n="center"]=t.split("-");return[e,n]}var Nj=eC,aC=nC,lC=rC,uC=iC,rh="rovingFocusGroup.onEntryFocus",Aj={bubbles:!1,cancelable:!0},El="RovingFocusGroup",[nv,cC,$j]=Ug(El),[Lj,dC]=Cs(El,[$j]),[jj,Fj]=Lj(El),fC=g.forwardRef((t,e)=>w.jsx(nv.Provider,{scope:t.__scopeRovingFocusGroup,children:w.jsx(nv.Slot,{scope:t.__scopeRovingFocusGroup,children:w.jsx(Dj,{...t,ref:e})})}));fC.displayName=El;var Dj=g.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:c=!1,...d}=t,f=g.useRef(null),h=Xe(e,f),_=DS(i),[p,y]=yd({prop:o,defaultProp:a??null,onChange:l,caller:El}),[v,m]=g.useState(!1),x=Bt(u),b=cC(n),E=g.useRef(!1),[S,k]=g.useState(0);return g.useEffect(()=>{const C=f.current;if(C)return C.addEventListener(rh,x),()=>C.removeEventListener(rh,x)},[x]),w.jsx(jj,{scope:n,orientation:r,dir:_,loop:s,currentTabStopId:p,onItemFocus:g.useCallback(C=>y(C),[y]),onItemShiftTab:g.useCallback(()=>m(!0),[]),onFocusableItemAdd:g.useCallback(()=>k(C=>C+1),[]),onFocusableItemRemove:g.useCallback(()=>k(C=>C-1),[]),children:w.jsx(Re.div,{tabIndex:v||S===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...t.style},onMouseDown:Z(t.onMouseDown,()=>{E.current=!0}),onFocus:Z(t.onFocus,C=>{const I=!E.current;if(C.target===C.currentTarget&&I&&!v){const P=new CustomEvent(rh,Aj);if(C.currentTarget.dispatchEvent(P),!P.defaultPrevented){const $=b().filter(q=>q.focusable),N=$.find(q=>q.active),B=$.find(q=>q.id===p),W=[N,B,...$].filter(Boolean).map(q=>q.ref.current);vC(W,c)}}E.current=!1}),onBlur:Z(t.onBlur,()=>m(!1))})})}),hC="RovingFocusGroupItem",pC=g.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,children:o,...a}=t,l=eo(),u=i||l,c=Fj(hC,n),d=c.currentTabStopId===u,f=cC(n),{onFocusableItemAdd:h,onFocusableItemRemove:_,currentTabStopId:p}=c;return g.useEffect(()=>{if(r)return h(),()=>_()},[r,h,_]),w.jsx(nv.ItemSlot,{scope:n,id:u,focusable:r,active:s,children:w.jsx(Re.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...a,ref:e,onMouseDown:Z(t.onMouseDown,y=>{r?c.onItemFocus(u):y.preventDefault()}),onFocus:Z(t.onFocus,()=>c.onItemFocus(u)),onKeyDown:Z(t.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){c.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const v=Uj(y,c.orientation,c.dir);if(v!==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(v==="last")x.reverse();else if(v==="prev"||v==="next"){v==="prev"&&x.reverse();const b=x.indexOf(y.currentTarget);x=c.loop?Vj(x,b+1):x.slice(b+1)}setTimeout(()=>vC(x))}}),children:typeof o=="function"?o({isCurrentTabStop:d,hasTabStop:p!=null}):o})})});pC.displayName=hC;var zj={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Bj(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function Uj(t,e,n){const r=Bj(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return zj[r]}function vC(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function Vj(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var qj=fC,Hj=pC;function Wj(t){const e=Gj(t),n=g.forwardRef((r,s)=>{const{children:i,...o}=r,a=g.Children.toArray(i),l=a.find(Qj);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 n.displayName=`${t}.Slot`,n}function Gj(t){const e=g.forwardRef((n,r)=>{const{children:s,...i}=n;if(g.isValidElement(s)){const o=Xj(s),a=Yj(i,s.props);return s.type!==g.Fragment&&(a.ref=r?Ss(r,o):o),g.cloneElement(s,a)}return g.Children.count(s)>1?g.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var Kj=Symbol("radix.slottable");function Qj(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Kj}function Yj(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...a)=>{const l=i(...a);return s(...a),l}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function Xj(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var rv=["Enter"," "],Jj=["ArrowDown","PageUp","Home"],gC=["ArrowUp","PageDown","End"],Zj=[...Jj,...gC],eF={ltr:[...rv,"ArrowRight"],rtl:[...rv,"ArrowLeft"]},tF={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Sl="Menu",[ul,nF,rF]=Ug(Sl),[di,mC]=Cs(Sl,[rF,kd,dC]),Pd=kd(),yC=dC(),[sF,fi]=di(Sl),[iF,Cl]=di(Sl),_C=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:s,onOpenChange:i,modal:o=!0}=t,a=Pd(e),[l,u]=g.useState(null),c=g.useRef(!1),d=Bt(i),f=DS(s);return g.useEffect(()=>{const h=()=>{c.current=!0,document.addEventListener("pointerdown",_,{capture:!0,once:!0}),document.addEventListener("pointermove",_,{capture:!0,once:!0})},_=()=>c.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",_,{capture:!0}),document.removeEventListener("pointermove",_,{capture:!0})}},[]),w.jsx(Nj,{...a,children:w.jsx(sF,{scope:e,open:n,onOpenChange:d,content:l,onContentChange:u,children:w.jsx(iF,{scope:e,onClose:g.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:c,dir:f,modal:o,children:r})})})};_C.displayName=Sl;var oF="MenuAnchor",Xg=g.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=Pd(n);return w.jsx(aC,{...s,...r,ref:e})});Xg.displayName=oF;var Jg="MenuPortal",[aF,wC]=di(Jg,{forceMount:void 0}),xC=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:s}=t,i=fi(Jg,e);return w.jsx(aF,{scope:e,forceMount:n,children:w.jsx(er,{present:n||i.open,children:w.jsx(_d,{asChild:!0,container:s,children:r})})})};xC.displayName=Jg;var dn="MenuContent",[lF,Zg]=di(dn),bC=g.forwardRef((t,e)=>{const n=wC(dn,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,i=fi(dn,t.__scopeMenu),o=Cl(dn,t.__scopeMenu);return w.jsx(ul.Provider,{scope:t.__scopeMenu,children:w.jsx(er,{present:r||i.open,children:w.jsx(ul.Slot,{scope:t.__scopeMenu,children:o.modal?w.jsx(uF,{...s,ref:e}):w.jsx(cF,{...s,ref:e})})})})}),uF=g.forwardRef((t,e)=>{const n=fi(dn,t.__scopeMenu),r=g.useRef(null),s=Xe(e,r);return g.useEffect(()=>{const i=r.current;if(i)return X1(i)},[]),w.jsx(em,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Z(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),cF=g.forwardRef((t,e)=>{const n=fi(dn,t.__scopeMenu);return w.jsx(em,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),dF=Wj("MenuContent.ScrollLock"),em=g.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,onDismiss:h,disableOutsideScroll:_,...p}=t,y=fi(dn,n),v=Cl(dn,n),m=Pd(n),x=yC(n),b=nF(n),[E,S]=g.useState(null),k=g.useRef(null),C=Xe(e,k,y.onContentChange),I=g.useRef(0),P=g.useRef(""),$=g.useRef(0),N=g.useRef(null),B=g.useRef("right"),j=g.useRef(0),W=_?Ng:g.Fragment,q=_?{as:dF,allowPinchZoom:!0}:void 0,G=T=>{var se,ve;const z=P.current+T,K=b().filter(_e=>!_e.disabled),H=document.activeElement,Q=(se=K.find(_e=>_e.ref.current===H))==null?void 0:se.textValue,X=K.map(_e=>_e.textValue),ie=EF(X,z,Q),pe=(ve=K.find(_e=>_e.textValue===ie))==null?void 0:ve.ref.current;(function _e(Ze){P.current=Ze,window.clearTimeout(I.current),Ze!==""&&(I.current=window.setTimeout(()=>_e(""),1e3))})(z),pe&&setTimeout(()=>pe.focus())};g.useEffect(()=>()=>window.clearTimeout(I.current),[]),U1();const M=g.useCallback(T=>{var K,H;return B.current===((K=N.current)==null?void 0:K.side)&&CF(T,(H=N.current)==null?void 0:H.area)},[]);return w.jsx(lF,{scope:n,searchRef:P,onItemEnter:g.useCallback(T=>{M(T)&&T.preventDefault()},[M]),onItemLeave:g.useCallback(T=>{var z;M(T)||((z=k.current)==null||z.focus(),S(null))},[M]),onTriggerLeave:g.useCallback(T=>{M(T)&&T.preventDefault()},[M]),pointerGraceTimerRef:$,onPointerGraceIntentChange:g.useCallback(T=>{N.current=T},[]),children:w.jsx(W,{...q,children:w.jsx(Mg,{asChild:!0,trapped:s,onMountAutoFocus:Z(i,T=>{var z;T.preventDefault(),(z=k.current)==null||z.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:w.jsx(xl,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,onDismiss:h,children:w.jsx(qj,{asChild:!0,...x,dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:S,onEntryFocus:Z(l,T=>{v.isUsingKeyboardRef.current||T.preventDefault()}),preventScrollOnEntryFocus:!0,children:w.jsx(lC,{role:"menu","aria-orientation":"vertical","data-state":FC(y.open),"data-radix-menu-content":"",dir:v.dir,...m,...p,ref:C,style:{outline:"none",...p.style},onKeyDown:Z(p.onKeyDown,T=>{const K=T.target.closest("[data-radix-menu-content]")===T.currentTarget,H=T.ctrlKey||T.altKey||T.metaKey,Q=T.key.length===1;K&&(T.key==="Tab"&&T.preventDefault(),!H&&Q&&G(T.key));const X=k.current;if(T.target!==X||!Zj.includes(T.key))return;T.preventDefault();const pe=b().filter(se=>!se.disabled).map(se=>se.ref.current);gC.includes(T.key)&&pe.reverse(),xF(pe)}),onBlur:Z(t.onBlur,T=>{T.currentTarget.contains(T.target)||(window.clearTimeout(I.current),P.current="")}),onPointerMove:Z(t.onPointerMove,cl(T=>{const z=T.target,K=j.current!==T.clientX;if(T.currentTarget.contains(z)&&K){const H=T.clientX>j.current?"right":"left";B.current=H,j.current=T.clientX}}))})})})})})})});bC.displayName=dn;var fF="MenuGroup",tm=g.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return w.jsx(Re.div,{role:"group",...r,ref:e})});tm.displayName=fF;var hF="MenuLabel",EC=g.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return w.jsx(Re.div,{...r,ref:e})});EC.displayName=hF;var qc="MenuItem",A0="menu.itemSelect",Rd=g.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...s}=t,i=g.useRef(null),o=Cl(qc,t.__scopeMenu),a=Zg(qc,t.__scopeMenu),l=Xe(e,i),u=g.useRef(!1),c=()=>{const d=i.current;if(!n&&d){const f=new CustomEvent(A0,{bubbles:!0,cancelable:!0});d.addEventListener(A0,h=>r==null?void 0:r(h),{once:!0}),Og(d,f),f.defaultPrevented?u.current=!1:o.onClose()}};return w.jsx(SC,{...s,ref:l,disabled:n,onClick:Z(t.onClick,c),onPointerDown:d=>{var f;(f=t.onPointerDown)==null||f.call(t,d),u.current=!0},onPointerUp:Z(t.onPointerUp,d=>{var f;u.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:Z(t.onKeyDown,d=>{const f=a.searchRef.current!=="";n||f&&d.key===" "||rv.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Rd.displayName=qc;var SC=g.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=t,o=Zg(qc,n),a=yC(n),l=g.useRef(null),u=Xe(e,l),[c,d]=g.useState(!1),[f,h]=g.useState("");return g.useEffect(()=>{const _=l.current;_&&h((_.textContent??"").trim())},[i.children]),w.jsx(ul.ItemSlot,{scope:n,disabled:r,textValue:s??f,children:w.jsx(Hj,{asChild:!0,...a,focusable:!r,children:w.jsx(Re.div,{role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:u,onPointerMove:Z(t.onPointerMove,cl(_=>{r?o.onItemLeave(_):(o.onItemEnter(_),_.defaultPrevented||_.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Z(t.onPointerLeave,cl(_=>o.onItemLeave(_))),onFocus:Z(t.onFocus,()=>d(!0)),onBlur:Z(t.onBlur,()=>d(!1))})})})}),pF="MenuCheckboxItem",CC=g.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...s}=t;return w.jsx(IC,{scope:t.__scopeMenu,checked:n,children:w.jsx(Rd,{role:"menuitemcheckbox","aria-checked":Hc(n)?"mixed":n,...s,ref:e,"data-state":rm(n),onSelect:Z(s.onSelect,()=>r==null?void 0:r(Hc(n)?!0:!n),{checkForDefaultPrevented:!1})})})});CC.displayName=pF;var kC="MenuRadioGroup",[vF,gF]=di(kC,{value:void 0,onValueChange:()=>{}}),PC=g.forwardRef((t,e)=>{const{value:n,onValueChange:r,...s}=t,i=Bt(r);return w.jsx(vF,{scope:t.__scopeMenu,value:n,onValueChange:i,children:w.jsx(tm,{...s,ref:e})})});PC.displayName=kC;var RC="MenuRadioItem",TC=g.forwardRef((t,e)=>{const{value:n,...r}=t,s=gF(RC,t.__scopeMenu),i=n===s.value;return w.jsx(IC,{scope:t.__scopeMenu,checked:i,children:w.jsx(Rd,{role:"menuitemradio","aria-checked":i,...r,ref:e,"data-state":rm(i),onSelect:Z(r.onSelect,()=>{var o;return(o=s.onValueChange)==null?void 0:o.call(s,n)},{checkForDefaultPrevented:!1})})})});TC.displayName=RC;var nm="MenuItemIndicator",[IC,mF]=di(nm,{checked:!1}),OC=g.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...s}=t,i=mF(nm,n);return w.jsx(er,{present:r||Hc(i.checked)||i.checked===!0,children:w.jsx(Re.span,{...s,ref:e,"data-state":rm(i.checked)})})});OC.displayName=nm;var yF="MenuSeparator",MC=g.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return w.jsx(Re.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});MC.displayName=yF;var _F="MenuArrow",NC=g.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=Pd(n);return w.jsx(uC,{...s,...r,ref:e})});NC.displayName=_F;var wF="MenuSub",[p5,AC]=di(wF),va="MenuSubTrigger",$C=g.forwardRef((t,e)=>{const n=fi(va,t.__scopeMenu),r=Cl(va,t.__scopeMenu),s=AC(va,t.__scopeMenu),i=Zg(va,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(Xg,{asChild:!0,...u,children:w.jsx(SC,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":FC(n.open),...t,ref:Ss(e,s.onTriggerChange),onClick:d=>{var f;(f=t.onClick)==null||f.call(t,d),!(t.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Z(t.onPointerMove,cl(d=>{i.onItemEnter(d),!d.defaultPrevented&&!t.disabled&&!n.open&&!o.current&&(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),c()},100))})),onPointerLeave:Z(t.onPointerLeave,cl(d=>{var h,_;c();const f=(h=n.content)==null?void 0:h.getBoundingClientRect();if(f){const p=(_=n.content)==null?void 0:_.dataset.side,y=p==="right",v=y?-5:5,m=f[y?"left":"right"],x=f[y?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+v,y:d.clientY},{x:m,y:f.top},{x,y:f.top},{x,y:f.bottom},{x:m,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:Z(t.onKeyDown,d=>{var h;const f=i.searchRef.current!=="";t.disabled||f&&d.key===" "||eF[r.dir].includes(d.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),d.preventDefault())})})})});$C.displayName=va;var LC="MenuSubContent",jC=g.forwardRef((t,e)=>{const n=wC(dn,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,i=fi(dn,t.__scopeMenu),o=Cl(dn,t.__scopeMenu),a=AC(LC,t.__scopeMenu),l=g.useRef(null),u=Xe(e,l);return w.jsx(ul.Provider,{scope:t.__scopeMenu,children:w.jsx(er,{present:r||i.open,children:w.jsx(ul.Slot,{scope:t.__scopeMenu,children:w.jsx(em,{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:Z(t.onFocusOutside,c=>{c.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Z(t.onEscapeKeyDown,c=>{o.onClose(),c.preventDefault()}),onKeyDown:Z(t.onKeyDown,c=>{var h;const d=c.currentTarget.contains(c.target),f=tF[o.dir].includes(c.key);d&&f&&(i.onOpenChange(!1),(h=a.trigger)==null||h.focus(),c.preventDefault())})})})})})});jC.displayName=LC;function FC(t){return t?"open":"closed"}function Hc(t){return t==="indeterminate"}function rm(t){return Hc(t)?"indeterminate":t?"checked":"unchecked"}function xF(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function bF(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function EF(t,e,n){const s=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let o=bF(t,Math.max(i,0));s.length===1&&(o=o.filter(u=>u!==n));const l=o.find(u=>u.toLowerCase().startsWith(s.toLowerCase()));return l!==n?l:void 0}function SF(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,o=e.length-1;ir!=f>r&&n<(d-u)*(r-c)/(f-c)+u&&(s=!s)}return s}function CF(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return SF(n,e)}function cl(t){return e=>e.pointerType==="mouse"?t(e):void 0}var kF=_C,PF=Xg,RF=xC,TF=bC,IF=tm,OF=EC,MF=Rd,NF=CC,AF=PC,$F=TC,LF=OC,jF=MC,FF=NC,DF=$C,zF=jC,Td="DropdownMenu",[BF]=Cs(Td,[mC]),It=mC(),[UF,DC]=BF(Td),zC=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:s,defaultOpen:i,onOpenChange:o,modal:a=!0}=t,l=It(e),u=g.useRef(null),[c,d]=yd({prop:s,defaultProp:i??!1,onChange:o,caller:Td});return w.jsx(UF,{scope:e,triggerId:eo(),triggerRef:u,contentId:eo(),open:c,onOpenChange:d,onOpenToggle:g.useCallback(()=>d(f=>!f),[d]),modal:a,children:w.jsx(kF,{...l,open:c,onOpenChange:d,dir:r,modal:a,children:n})})};zC.displayName=Td;var BC="DropdownMenuTrigger",UC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=t,i=DC(BC,n),o=It(n);return w.jsx(PF,{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":r?"":void 0,disabled:r,...s,ref:Ss(e,i.triggerRef),onPointerDown:Z(t.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:Z(t.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});UC.displayName=BC;var VF="DropdownMenuPortal",VC=t=>{const{__scopeDropdownMenu:e,...n}=t,r=It(e);return w.jsx(RF,{...r,...n})};VC.displayName=VF;var qC="DropdownMenuContent",HC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=DC(qC,n),i=It(n),o=g.useRef(!1);return w.jsx(TF,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...r,ref:e,onCloseAutoFocus:Z(t.onCloseAutoFocus,a=>{var l;o.current||(l=s.triggerRef.current)==null||l.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:Z(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)"}})});HC.displayName=qC;var qF="DropdownMenuGroup",HF=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=It(n);return w.jsx(IF,{...s,...r,ref:e})});HF.displayName=qF;var WF="DropdownMenuLabel",WC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=It(n);return w.jsx(OF,{...s,...r,ref:e})});WC.displayName=WF;var GF="DropdownMenuItem",GC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=It(n);return w.jsx(MF,{...s,...r,ref:e})});GC.displayName=GF;var KF="DropdownMenuCheckboxItem",KC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=It(n);return w.jsx(NF,{...s,...r,ref:e})});KC.displayName=KF;var QF="DropdownMenuRadioGroup",YF=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=It(n);return w.jsx(AF,{...s,...r,ref:e})});YF.displayName=QF;var XF="DropdownMenuRadioItem",QC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=It(n);return w.jsx($F,{...s,...r,ref:e})});QC.displayName=XF;var JF="DropdownMenuItemIndicator",YC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=It(n);return w.jsx(LF,{...s,...r,ref:e})});YC.displayName=JF;var ZF="DropdownMenuSeparator",XC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=It(n);return w.jsx(jF,{...s,...r,ref:e})});XC.displayName=ZF;var eD="DropdownMenuArrow",tD=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=It(n);return w.jsx(FF,{...s,...r,ref:e})});tD.displayName=eD;var nD="DropdownMenuSubTrigger",JC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=It(n);return w.jsx(DF,{...s,...r,ref:e})});JC.displayName=nD;var rD="DropdownMenuSubContent",ZC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=It(n);return w.jsx(zF,{...s,...r,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)"}})});ZC.displayName=rD;var sD=zC,iD=UC,oD=VC,ek=HC,tk=WC,nk=GC,rk=KC,sk=QC,ik=YC,ok=XC,ak=JC,lk=ZC;/** - * @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 aD=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),uk=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/** - * @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. - */var lD={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** - * @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 uD=g.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:o,...a},l)=>g.createElement("svg",{ref:l,...lD,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:uk("lucide",s),...a},[...o.map(([u,c])=>g.createElement(u,c)),...Array.isArray(i)?i:[i]]));/** - * @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 Id=(t,e)=>{const n=g.forwardRef(({className:r,...s},i)=>g.createElement(uD,{ref:i,iconNode:e,className:uk(`lucide-${aD(t)}`,r),...s}));return n.displayName=`${t}`,n};/** - * @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 cD=Id("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** - * @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 dD=Id("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** - * @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 fD=Id("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** - * @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 hD=Id("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),pD=sD,vD=iD,gD=g.forwardRef(({className:t,inset:e,children:n,...r},s)=>w.jsxs(ak,{ref:s,className:at("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",e&&"pl-8",t),...r,children:[n,w.jsx(dD,{className:"ml-auto h-4 w-4"})]}));gD.displayName=ak.displayName;const mD=g.forwardRef(({className:t,...e},n)=>w.jsx(lk,{ref:n,className:at("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e}));mD.displayName=lk.displayName;const ck=g.forwardRef(({className:t,sideOffset:e=4,...n},r)=>w.jsx(oD,{children:w.jsx(ek,{ref:r,sideOffset:e,className:at("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n})}));ck.displayName=ek.displayName;const lr=g.forwardRef(({className:t,inset:e,...n},r)=>w.jsx(nk,{ref:r,className:at("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e&&"pl-8",t),...n}));lr.displayName=nk.displayName;const yD=g.forwardRef(({className:t,children:e,checked:n,...r},s)=>w.jsxs(rk,{ref:s,className:at("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t),checked:n,...r,children:[w.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:w.jsx(ik,{children:w.jsx(cD,{className:"h-4 w-4"})})}),e]}));yD.displayName=rk.displayName;const _D=g.forwardRef(({className:t,children:e,...n},r)=>w.jsxs(sk,{ref:r,className:at("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t),...n,children:[w.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:w.jsx(ik,{children:w.jsx(fD,{className:"h-2 w-2 fill-current"})})}),e]}));_D.displayName=sk.displayName;const dk=g.forwardRef(({className:t,inset:e,...n},r)=>w.jsx(tk,{ref:r,className:at("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));dk.displayName=tk.displayName;const sv=g.forwardRef(({className:t,...e},n)=>w.jsx(ok,{ref:n,className:at("-mx-1 my-1 h-px bg-muted",t),...e}));sv.displayName=ok.displayName;function wD(t){const n=(t.name||t.username||"?").trim().split(/\s+/).filter(Boolean);return n.length===0?"?":n.length===1?n[0][0].toUpperCase():(n[0][0]+n[n.length-1][0]).toUpperCase()}const xD=({user:t,onLogout:e})=>w.jsxs(pD,{children:[w.jsx(vD,{asChild:!0,children:w.jsx("button",{type:"button",className:"user-avatar-btn","aria-label":`Account menu for ${t.username}`,children:w.jsxs(LS,{className:"h-8 w-8",children:[t.avatar_url&&w.jsx(jS,{src:t.avatar_url,alt:t.username}),w.jsx(FS,{className:"text-xs",children:wD(t)})]})})}),w.jsxs(ck,{align:"end",className:"w-56",children:[w.jsxs(dk,{className:"flex flex-col gap-0.5 py-2",children:[w.jsx("span",{className:"text-sm font-medium leading-tight",children:t.name||t.username}),w.jsxs("span",{className:"text-xs font-normal text-muted-foreground",children:["@",t.username]}),t.is_admin&&w.jsx("span",{className:"mt-1 inline-flex w-fit items-center rounded-full bg-amber-100 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-amber-900",children:"Admin"}),t.role==="contributor"&&w.jsx("span",{className:"mt-1 inline-flex w-fit items-center rounded-full bg-blue-100 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-blue-900",children:"Contributor"})]}),w.jsx(sv,{}),w.jsx(lr,{asChild:!0,children:w.jsx("a",{href:`https://huggingface.co/${encodeURIComponent(t.username)}`,target:"_blank",rel:"noopener noreferrer",children:"Hugging Face profile"})}),w.jsx(lr,{asChild:!0,children:w.jsx(Rn,{to:"/frameworks",children:"Frameworks"})}),w.jsx(lr,{asChild:!0,children:w.jsx(Rn,{to:"/trends",children:"Trends"})}),t.is_admin&&w.jsxs(w.Fragment,{children:[w.jsx(lr,{asChild:!0,children:w.jsx(Rn,{to:"/admin-dashboard",children:"Admin dashboard"})}),w.jsx(lr,{asChild:!0,children:w.jsx(Rn,{to:"/submissions",children:"Review submissions"})})]}),w.jsx(lr,{asChild:!0,children:w.jsx(Rn,{to:`/${encodeURIComponent(t.username)}`,children:"My contributions"})}),w.jsx(lr,{asChild:!0,children:w.jsx(Rn,{to:"/settings",children:"Settings"})}),w.jsx(sv,{}),w.jsx(lr,{onSelect:n=>{n.preventDefault(),e()},children:"Log out"})]})]}),bD=!1;class sm extends Error{constructor(n,r){var s;super(`API request failed: ${n.status} ${n.statusText}`);Fr(this,"status");Fr(this,"statusText");Fr(this,"response");Fr(this,"detail");Fr(this,"code");Fr(this,"displayMessage");this.name="ApiError",this.status=n.status,this.statusText=n.statusText,this.response=r;try{if(this.detail=(s=JSON.parse(r))==null?void 0:s.detail,typeof this.detail=="string"&&(this.message=this.detail),Array.isArray(this.detail)){const i=this.detail[0];typeof i=="object"&&i!==null&&"msg"in i&&typeof i.msg=="string"&&(this.message=i.msg)}if(typeof this.detail=="object"&&this.detail!==null&&"code"in this.detail&&typeof this.detail.code=="string"&&(this.code=this.detail.code),typeof this.detail=="object"&&this.detail!==null&&"message"in this.detail&&typeof this.detail.message=="string"){const i="help"in this.detail&&typeof this.detail.help=="string"?` See ${this.detail.help} for help.`:"";this.message=`${this.detail.message}${i}`}}catch{this.detail=void 0,this.displayMessage=r||this.message;return}this.displayMessage=this.message}}function v5(t,e){return t instanceof sm?t.displayMessage||e:typeof t=="object"&&t!==null&&"message"in t&&typeof t.message=="string"&&t.message||e}class ED{constructor(e){this.baseUrl=e}async fetch(e,n){const r=`${this.baseUrl}${e}`;try{const{headers:s,...i}=n??{},a=(i.method??"GET").toUpperCase()==="GET"?"default":"no-store",l=new Headers(s);return l.has("Content-Type")||l.set("Content-Type","application/json"),await fetch(r,{...i,cache:i.cache??a,credentials:i.credentials??"include",headers:l})}catch(s){throw console.error(`[API] Request to ${r} failed:`,s),s}}async request(e,n){const r=await this.fetch(e,n);if(!r.ok){const i=new sm(r,await r.text());throw console.error("[API] Error response:",i.response),i}return r.status===204?void 0:await r.json()}}function SD(t){t instanceof sm&&t.status===401&&t.code!=="fresh_auth_required"&&t.code!=="saved_papers_bucket_authorization_required"&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:auth-stale"))}async function CD(t){try{return await t()}catch(e){throw SD(e),e}}const fk=new ED(`${jg()}/api/v1`),kD=(t,e)=>fk.fetch(t,e),iv=(t,e)=>CD(()=>fk.request(t,e)),$0={async getCurrentUser(){if(jo())return null;const t=await kD("/auth/me",{cache:"no-store"});return t.status===401||!t.ok?null:t.json()},async logout(){await iv("/auth/logout",{method:"POST"})},async requestStagingAccess(){await iv("/staging-access-request",{method:"POST"})}},im=R.createContext(null),L0="pwc:auth-stale",PD=({children:t})=>{const[e,n]=R.useState(null),[r,s]=R.useState(!0),i=pA(),o=R.useRef(null),a=R.useCallback(async()=>{s(!0);const c=await $0.getCurrentUser();n(c),s(!1)},[]),l=R.useCallback(async()=>{const c=Fg("/api/v1/auth/logout");if(new URL(c,window.location.origin).origin!==window.location.origin){const d=document.createElement("form");d.method="POST",d.action=`${c}?return_to=${encodeURIComponent(window.location.href)}`,document.body.appendChild(d),d.submit();return}await $0.logout(),n(null)},[]);R.useEffect(()=>{a()},[a]),R.useEffect(()=>{},[e]),R.useEffect(()=>{o.current&&!e&&i.resetQueries(),o.current=e},[i,e]),R.useEffect(()=>{const c=()=>{n(null)};return window.addEventListener(L0,c),()=>window.removeEventListener(L0,c)},[]);const u=R.useMemo(()=>({user:e,isLoading:r,refresh:a,logout:l}),[e,r,a,l]);return w.jsx(im.Provider,{value:u,children:t})};function om(){const t=R.useContext(im);if(!t)throw new Error("useAuth must be used inside an ");return t}function g5(){return R.useContext(im)}const qr=({name:t,size:e=14})=>{const n={search:w.jsx("path",{d:"M11 11l3 3M7 12.5a5.5 5.5 0 110-11 5.5 5.5 0 010 11z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),bookmark:w.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),menu:w.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:w.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),github:w.jsx("path",{fill:"currentColor",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})};return w.jsx("svg",{className:e===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:e,height:e,children:n[t]})},j0="https://github.com/huggingface/paperswithcode-feedback/issues",F0="https://github.com/huggingface/paperswithcode",RD="https://paperswithcode.co/following",D0="pwc:announcement:following-feed:v1:dismissed",sh=[{to:"/",label:"Trending",end:!0},{to:"/tasks",label:"Browse state-of-the-art",end:!1},{to:"/methods",label:"Methods",end:!1},{to:"/conferences",label:"Conferences",end:!1},{to:"/organizations",label:"Organizations",end:!1},{to:"/submit",label:"Submit",end:!1}],TD=()=>{if(typeof navigator>"u")return!1;const t=navigator.userAgentData,e=(t==null?void 0:t.platform)||navigator.platform||navigator.userAgent||"";return/Mac|iPhone|iPad|iPod/i.test(e)},ID=()=>{const[t,e]=R.useState(!1);return R.useEffect(()=>{e(TD())},[]),w.jsx("kbd",{children:t?"⌘K":"Ctrl K"})},z0=({onOpenSearch:t})=>{const[e,n]=R.useState(!1),[r,s]=R.useState(()=>localStorage.getItem(D0)!=="1"),i=R.useRef(null),o=R.useRef(null),a=()=>n(!1),{user:l,logout:u}=om(),c=$n(),d=c.pathname.startsWith("/pdf/"),f=`${c.pathname}${c.search}`||"/",h=jo(),_=al()?{to:"/chat",label:"Chat",end:!1,badge:"New"}:o2()?{to:"/chat",label:"Chat",end:!1,badge:"New",href:i2}:null,p=_?[sh[0],_,...sh.slice(1)]:sh;return R.useLayoutEffect(()=>{var S;const y=i.current,v=o.current;if(!y||!v)return;let m=!1;const x=()=>{if(m)return;const k=y.querySelector(".nav-item.active"),C=(k==null?void 0:k.offsetWidth)??0;v.style.width=`${C}px`,v.style.transform=`translateX(${(k==null?void 0:k.offsetLeft)??0}px)`,v.style.opacity=C>0?"1":"0"};x();const b=window.requestAnimationFrame(()=>{v.classList.add("nav-indicator-ready")}),E=typeof ResizeObserver>"u"?null:new ResizeObserver(x);return E==null||E.observe(y),window.addEventListener("resize",x),(S=document.fonts)==null||S.ready.then(x),()=>{m=!0,window.cancelAnimationFrame(b),E==null||E.disconnect(),window.removeEventListener("resize",x)}},[c.pathname,p.length]),w.jsxs(Y$,{open:e,onOpenChange:n,children:[w.jsxs("header",{className:"app-header",children:[w.jsxs("div",{className:"app-header-inner",children:[w.jsxs(bi,{to:"/",className:"brand",onClick:a,children:[w.jsx("span",{className:"brand-mark"}),w.jsxs("span",{className:"brand-name",children:["Papers ",w.jsx("em",{children:"With Code"})]})]}),w.jsxs("nav",{className:"nav",ref:i,children:[p.map(({to:y,label:v,end:m,badge:x,href:b})=>{const E=w.jsxs(w.Fragment,{children:[w.jsx("span",{children:v}),x&&w.jsx("span",{className:"nav-new-badge","aria-hidden":"true",children:x})]});return b?w.jsx("a",{href:b,target:"_blank",rel:"noreferrer",className:`nav-item${x?" nav-item-with-badge":""}`,children:E},y):w.jsx(bi,{to:y,end:m,className:({isActive:S})=>`nav-item${x?" nav-item-with-badge":""}${S?" active":""}`,children:E},y)}),w.jsx("span",{ref:o,className:"nav-indicator","aria-hidden":"true"})]}),w.jsx("div",{className:"header-spacer"}),w.jsx("a",{className:"feedback-link header-feedback-link",href:j0,target:"_blank",rel:"noreferrer",children:"Submit feedback"}),w.jsx("a",{className:"icon-btn header-github-btn",href:F0,target:"_blank",rel:"noreferrer","aria-label":"GitHub repository",title:"GitHub repository",children:w.jsx(qr,{name:"github",size:14})}),w.jsxs("button",{className:"search-trigger","aria-label":"Search papers, authors, domains",onClick:t,children:[w.jsx(qr,{name:"search",size:13}),w.jsx("span",{children:"Search papers, authors, domains…"}),w.jsx(ID,{})]}),w.jsx("button",{className:"icon-btn mobile-search-btn","aria-label":"Search",onClick:t,children:w.jsx(qr,{name:"search",size:14})}),!h&&w.jsx(bi,{to:"/saved",className:"icon-btn header-bookmark-btn","aria-label":"Saved papers",title:"Saved papers",children:w.jsx(qr,{name:"bookmark",size:13})}),h?null:l?w.jsx(xD,{user:l,onLogout:u}):w.jsx(vS,{returnTo:f}),w.jsx(X$,{asChild:!0,children:w.jsx("button",{className:"icon-btn mobile-menu-btn","aria-label":"Open menu",children:w.jsx(qr,{name:"menu",size:14})})})]}),!d&&r&&w.jsxs("div",{className:"site-announcement",role:"status",children:[w.jsx("span",{children:"New: "}),h?w.jsx("a",{href:RD,target:"_blank",rel:"noreferrer",children:"following feed"}):w.jsx(Rn,{to:"/following",children:"following feed"}),w.jsx("span",{children:", follow your favorite tasks, benchmarks, authors or organizations"}),w.jsx("button",{type:"button",className:"site-announcement-close","aria-label":"Dismiss announcement",onClick:()=>{localStorage.setItem(D0,"1"),s(!1)},children:w.jsx(qr,{name:"close",size:11})})]})]}),w.jsx(J$,{children:w.jsx(Z$,{className:"mobile-nav-drawer",children:w.jsxs(e2,{className:"mobile-nav-panel","aria-describedby":void 0,children:[w.jsx(t2,{className:"sr-only",children:"Navigation menu"}),w.jsx(n2,{className:"icon-btn mobile-nav-close","aria-label":"Close menu",children:w.jsx(qr,{name:"close",size:14})}),w.jsxs("button",{type:"button",className:"mobile-nav-link mobile-nav-search",onClick:()=>{a(),t()},children:[w.jsx(qr,{name:"search",size:14}),w.jsx("span",{children:"Search papers, authors, domains…"})]}),p.map(({to:y,label:v,end:m,badge:x,href:b})=>{const E=`mobile-nav-link${x?" mobile-nav-link-with-badge":""}`,S=w.jsxs(w.Fragment,{children:[w.jsx("span",{children:v}),x&&w.jsx("span",{className:"nav-new-badge","aria-hidden":"true",children:x})]});return b?w.jsx("a",{href:b,target:"_blank",rel:"noreferrer",className:E,onClick:a,children:S},y):w.jsx(bi,{to:y,end:m,className:E,onClick:a,children:S},y)}),w.jsx("a",{className:"mobile-nav-link",href:j0,target:"_blank",rel:"noreferrer",onClick:a,children:"Submit feedback"}),w.jsx("a",{className:"mobile-nav-link",href:F0,target:"_blank",rel:"noreferrer",onClick:a,children:"GitHub"}),!h&&w.jsx(bi,{to:"/saved",className:"mobile-nav-link",onClick:a,children:"Saved papers"}),!h&&(l==null?void 0:l.is_admin)&&w.jsx(bi,{to:"/admin-dashboard",className:"mobile-nav-link",onClick:a,children:"Admin dashboard"})]})})})]})},OD=()=>{const{pathname:t}=$n();return t==="/chat"||t.startsWith("/chat/")||t.startsWith("/pdf/")?null:w.jsx("footer",{className:"site-footer",children:w.jsxs("div",{className:"site-footer-inner",children:[w.jsxs("span",{children:["© ",new Date().getFullYear()," Hugging Face"]}),w.jsx(Rn,{to:"/docs/api",children:"API"}),w.jsx(Rn,{to:"/mcp",children:"MCP"}),w.jsx(Rn,{to:"/privacy",children:"Privacy"}),w.jsx("a",{href:"https://github.com/huggingface/paperswithcode-feedback/issues",target:"_blank",rel:"noreferrer",children:"Feedback"})]})})},MD=1,ND=1e6;let ih=0;function AD(){return ih=(ih+1)%Number.MAX_SAFE_INTEGER,ih.toString()}const oh=new Map,B0=t=>{if(oh.has(t))return;const e=setTimeout(()=>{oh.delete(t),Oa({type:"REMOVE_TOAST",toastId:t})},ND);oh.set(t,e)},$D=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,MD)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?B0(n):t.toasts.forEach(r=>{B0(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},Lu=[];let ju={toasts:[]};function Oa(t){ju=$D(ju,t),Lu.forEach(e=>{e(ju)})}function LD({...t}){const e=AD(),n=s=>Oa({type:"UPDATE_TOAST",toast:{...s,id:e}}),r=()=>Oa({type:"DISMISS_TOAST",toastId:e});return Oa({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:s=>{s||r()}}}),{id:e,dismiss:r,update:n}}function jD(){const[t,e]=g.useState(ju);return g.useEffect(()=>(Lu.push(e),()=>{const n=Lu.indexOf(e);n>-1&&Lu.splice(n,1)}),[t]),{...t,toast:LD,dismiss:n=>Oa({type:"DISMISS_TOAST",toastId:n})}}var FD=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),DD="VisuallyHidden",Od=g.forwardRef((t,e)=>w.jsx(Re.span,{...t,ref:e,style:{...FD,...t.style}}));Od.displayName=DD;var zD=Od,am="ToastProvider",[lm,BD,UD]=Ug("Toast"),[hk]=Cs("Toast",[UD]),[VD,Md]=hk(am),pk=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:o}=t,[a,l]=g.useState(null),[u,c]=g.useState(0),d=g.useRef(!1),f=g.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${am}\`. Expected non-empty \`string\`.`),w.jsx(lm.Provider,{scope:e,children:w.jsx(VD,{scope:e,label:n,duration:r,swipeDirection:s,swipeThreshold:i,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:g.useCallback(()=>c(h=>h+1),[]),onToastRemove:g.useCallback(()=>c(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:o})})};pk.displayName=am;var vk="ToastViewport",qD=["F8"],ov="toast.viewportPause",av="toast.viewportResume",gk=g.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=qD,label:s="Notifications ({hotkey})",...i}=t,o=Md(vk,n),a=BD(n),l=g.useRef(null),u=g.useRef(null),c=g.useRef(null),d=g.useRef(null),f=Xe(e,d,o.onViewportChange),h=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),_=o.toastCount>0;g.useEffect(()=>{const y=v=>{var x;r.length!==0&&r.every(b=>v[b]||v.code===b)&&((x=d.current)==null||x.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),g.useEffect(()=>{const y=l.current,v=d.current;if(_&&y&&v){const m=()=>{if(!o.isClosePausedRef.current){const S=new CustomEvent(ov);v.dispatchEvent(S),o.isClosePausedRef.current=!0}},x=()=>{if(o.isClosePausedRef.current){const S=new CustomEvent(av);v.dispatchEvent(S),o.isClosePausedRef.current=!1}},b=S=>{!y.contains(S.relatedTarget)&&x()},E=()=>{y.contains(document.activeElement)||x()};return y.addEventListener("focusin",m),y.addEventListener("focusout",b),y.addEventListener("pointermove",m),y.addEventListener("pointerleave",E),window.addEventListener("blur",m),window.addEventListener("focus",x),()=>{y.removeEventListener("focusin",m),y.removeEventListener("focusout",b),y.removeEventListener("pointermove",m),y.removeEventListener("pointerleave",E),window.removeEventListener("blur",m),window.removeEventListener("focus",x)}}},[_,o.isClosePausedRef]);const p=g.useCallback(({tabbingDirection:y})=>{const m=a().map(x=>{const b=x.ref.current,E=[b,...r3(b)];return y==="forwards"?E:E.reverse()});return(y==="forwards"?m.reverse():m).flat()},[a]);return g.useEffect(()=>{const y=d.current;if(y){const v=m=>{var E,S,k;const x=m.altKey||m.ctrlKey||m.metaKey;if(m.key==="Tab"&&!x){const C=document.activeElement,I=m.shiftKey;if(m.target===y&&I){(E=u.current)==null||E.focus();return}const N=p({tabbingDirection:I?"backwards":"forwards"}),B=N.findIndex(j=>j===C);ah(N.slice(B+1))?m.preventDefault():I?(S=u.current)==null||S.focus():(k=c.current)==null||k.focus()}};return y.addEventListener("keydown",v),()=>y.removeEventListener("keydown",v)}},[a,p]),w.jsxs(FA,{ref:l,role:"region","aria-label":s.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:_?void 0:"none"},children:[_&&w.jsx(lv,{ref:u,onFocusFromOutsideViewport:()=>{const y=p({tabbingDirection:"forwards"});ah(y)}}),w.jsx(lm.Slot,{scope:n,children:w.jsx(Re.ol,{tabIndex:-1,...i,ref:f})}),_&&w.jsx(lv,{ref:c,onFocusFromOutsideViewport:()=>{const y=p({tabbingDirection:"backwards"});ah(y)}})]})});gk.displayName=vk;var mk="ToastFocusProxy",lv=g.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=t,i=Md(mk,n);return w.jsx(Od,{tabIndex:0,...s,ref:e,style:{position:"fixed"},onFocus:o=>{var u;const a=o.relatedTarget;!((u=i.viewport)!=null&&u.contains(a))&&r()}})});lv.displayName=mk;var kl="Toast",HD="toast.swipeStart",WD="toast.swipeMove",GD="toast.swipeCancel",KD="toast.swipeEnd",yk=g.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:i,...o}=t,[a,l]=yd({prop:r,defaultProp:s??!0,onChange:i,caller:kl});return w.jsx(er,{present:n||a,children:w.jsx(XD,{open:a,...o,ref:e,onClose:()=>l(!1),onPause:Bt(t.onPause),onResume:Bt(t.onResume),onSwipeStart:Z(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Z(t.onSwipeMove,u=>{const{x:c,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:Z(t.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Z(t.onSwipeEnd,u=>{const{x:c,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});yk.displayName=kl;var[QD,YD]=hk(kl,{onClose(){}}),XD=g.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:i,onClose:o,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:c,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:h,..._}=t,p=Md(kl,n),[y,v]=g.useState(null),m=Xe(e,j=>v(j)),x=g.useRef(null),b=g.useRef(null),E=s||p.duration,S=g.useRef(0),k=g.useRef(E),C=g.useRef(0),{onToastAdd:I,onToastRemove:P}=p,$=Bt(()=>{var W;(y==null?void 0:y.contains(document.activeElement))&&((W=p.viewport)==null||W.focus()),o()}),N=g.useCallback(j=>{!j||j===1/0||(window.clearTimeout(C.current),S.current=new Date().getTime(),C.current=window.setTimeout($,j))},[$]);g.useEffect(()=>{const j=p.viewport;if(j){const W=()=>{N(k.current),u==null||u()},q=()=>{const G=new Date().getTime()-S.current;k.current=k.current-G,window.clearTimeout(C.current),l==null||l()};return j.addEventListener(ov,q),j.addEventListener(av,W),()=>{j.removeEventListener(ov,q),j.removeEventListener(av,W)}}},[p.viewport,E,l,u,N]),g.useEffect(()=>{i&&!p.isClosePausedRef.current&&N(E)},[i,E,p.isClosePausedRef,N]),g.useEffect(()=>(I(),()=>P()),[I,P]);const B=g.useMemo(()=>y?Ck(y):null,[y]);return p.viewport?w.jsxs(w.Fragment,{children:[B&&w.jsx(JD,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:B}),w.jsx(QD,{scope:n,onClose:$,children:_l.createPortal(w.jsx(lm.ItemSlot,{scope:n,children:w.jsx(jA,{asChild:!0,onEscapeKeyDown:Z(a,()=>{p.isFocusedToastEscapeKeyDownRef.current||$(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:w.jsx(Re.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":p.swipeDirection,..._,ref:m,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:Z(t.onKeyDown,j=>{j.key==="Escape"&&(a==null||a(j.nativeEvent),j.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,$()))}),onPointerDown:Z(t.onPointerDown,j=>{j.button===0&&(x.current={x:j.clientX,y:j.clientY})}),onPointerMove:Z(t.onPointerMove,j=>{if(!x.current)return;const W=j.clientX-x.current.x,q=j.clientY-x.current.y,G=!!b.current,M=["left","right"].includes(p.swipeDirection),T=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,z=M?T(0,W):0,K=M?0:T(0,q),H=j.pointerType==="touch"?10:2,Q={x:z,y:K},X={originalEvent:j,delta:Q};G?(b.current=Q,fu(WD,d,X,{discrete:!1})):U0(Q,p.swipeDirection,H)?(b.current=Q,fu(HD,c,X,{discrete:!1}),j.target.setPointerCapture(j.pointerId)):(Math.abs(W)>H||Math.abs(q)>H)&&(x.current=null)}),onPointerUp:Z(t.onPointerUp,j=>{const W=b.current,q=j.target;if(q.hasPointerCapture(j.pointerId)&&q.releasePointerCapture(j.pointerId),b.current=null,x.current=null,W){const G=j.currentTarget,M={originalEvent:j,delta:W};U0(W,p.swipeDirection,p.swipeThreshold)?fu(KD,h,M,{discrete:!0}):fu(GD,f,M,{discrete:!0}),G.addEventListener("click",T=>T.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),JD=t=>{const{__scopeToast:e,children:n,...r}=t,s=Md(kl,e),[i,o]=g.useState(!1),[a,l]=g.useState(!1);return t3(()=>o(!0)),g.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:w.jsx(_d,{asChild:!0,children:w.jsx(Od,{...r,children:i&&w.jsxs(w.Fragment,{children:[s.label," ",n]})})})},ZD="ToastTitle",_k=g.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return w.jsx(Re.div,{...r,ref:e})});_k.displayName=ZD;var e3="ToastDescription",wk=g.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return w.jsx(Re.div,{...r,ref:e})});wk.displayName=e3;var xk="ToastAction",bk=g.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?w.jsx(Sk,{altText:n,asChild:!0,children:w.jsx(um,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${xk}\`. Expected non-empty \`string\`.`),null)});bk.displayName=xk;var Ek="ToastClose",um=g.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,s=YD(Ek,n);return w.jsx(Sk,{asChild:!0,children:w.jsx(Re.button,{type:"button",...r,ref:e,onClick:Z(t.onClick,s.onClose)})})});um.displayName=Ek;var Sk=g.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...s}=t;return w.jsx(Re.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:e})});function Ck(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),n3(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const o=r.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...Ck(r))}}),e}function fu(t,e,n,{discrete:r}){const s=n.originalEvent.currentTarget,i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?Og(s,i):s.dispatchEvent(i)}var U0=(t,e,n=0)=>{const r=Math.abs(t.x),s=Math.abs(t.y),i=r>s;return e==="left"||e==="right"?i&&r>n:!i&&s>n};function t3(t=()=>{}){const e=Bt(t);pn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function n3(t){return t.nodeType===t.ELEMENT_NODE}function r3(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function ah(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var s3=pk,kk=gk,Pk=yk,Rk=_k,Tk=wk,Ik=bk,Ok=um;const V0=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,q0=IS,i3=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return q0(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=e,o=Object.keys(s).map(u=>{const c=n==null?void 0:n[u],d=i==null?void 0:i[u];if(c===null)return null;const f=V0(c)||V0(d);return s[u][f]}),a=n&&Object.entries(n).reduce((u,c)=>{let[d,f]=c;return f===void 0||(u[d]=f),u},{}),l=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:d,className:f,...h}=c;return Object.entries(h).every(_=>{let[p,y]=_;return Array.isArray(y)?y.includes({...i,...a}[p]):{...i,...a}[p]===y})?[...u,d,f]:u},[]);return q0(t,o,l,n==null?void 0:n.class,n==null?void 0:n.className)},o3=s3,Mk=g.forwardRef(({className:t,...e},n)=>w.jsx(kk,{ref:n,className:at("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...e}));Mk.displayName=kk.displayName;const a3=i3("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-16 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Nk=g.forwardRef(({className:t,variant:e,...n},r)=>w.jsx(Pk,{ref:r,className:at(a3({variant:e}),t),...n}));Nk.displayName=Pk.displayName;const l3=g.forwardRef(({className:t,...e},n)=>w.jsx(Ik,{ref:n,className:at("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",t),...e}));l3.displayName=Ik.displayName;const Ak=g.forwardRef(({className:t,...e},n)=>w.jsx(Ok,{ref:n,className:at("absolute right-2 top-2 inline-flex h-11 w-11 items-center justify-center rounded-md text-foreground transition-colors hover:bg-muted focus:outline-none focus:ring-2 focus:ring-ring group-[.destructive]:text-destructive-foreground group-[.destructive]:hover:bg-destructive-foreground/10 group-[.destructive]:focus:ring-destructive-foreground",t),"aria-label":"Dismiss notification","toast-close":"",...e,children:w.jsx(hD,{className:"h-4 w-4"})}));Ak.displayName=Ok.displayName;const $k=g.forwardRef(({className:t,...e},n)=>w.jsx(Rk,{ref:n,className:at("text-sm font-semibold",t),...e}));$k.displayName=Rk.displayName;const Lk=g.forwardRef(({className:t,...e},n)=>w.jsx(Tk,{ref:n,className:at("text-sm opacity-90",t),...e}));Lk.displayName=Tk.displayName;function u3(){const{toasts:t}=jD();return w.jsxs(o3,{children:[t.map(function({id:e,title:n,description:r,action:s,...i}){return w.jsxs(Nk,{...i,children:[w.jsxs("div",{className:"grid gap-1",children:[n&&w.jsx($k,{children:n}),r&&w.jsx(Lk,{children:r})]}),s,w.jsx(Ak,{})]},e)}),w.jsx(Mk,{})]})}var c3=t=>{switch(t){case"success":return h3;case"info":return v3;case"warning":return p3;case"error":return g3;default:return null}},d3=Array(12).fill(0),f3=({visible:t,className:e})=>R.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},R.createElement("div",{className:"sonner-spinner"},d3.map((n,r)=>R.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),h3=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},R.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),p3=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},R.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),v3=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},R.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),g3=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},R.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),m3=R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},R.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),R.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),y3=()=>{let[t,e]=R.useState(document.hidden);return R.useEffect(()=>{let n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t},uv=1,_3=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;let{message:n,...r}=t,s=typeof(t==null?void 0:t.id)=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:uv++,i=this.toasts.find(a=>a.id===s),o=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(a=>a.id===s?(this.publish({...a,...t,id:s,title:n}),{...a,...t,id:s,dismissible:o,title:n}):a):this.addToast({title:n,...r,dismissible:o,id:s}),s},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(e=>{this.subscribers.forEach(n=>n({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:t,dismiss:!0})),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{if(!e)return;let n;e.loading!==void 0&&(n=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let r=t instanceof Promise?t:t(),s=n!==void 0,i,o=r.then(async l=>{if(i=["resolve",l],R.isValidElement(l))s=!1,this.create({id:n,type:"default",message:l});else if(x3(l)&&!l.ok){s=!1;let u=typeof e.error=="function"?await e.error(`HTTP error! status: ${l.status}`):e.error,c=typeof e.description=="function"?await e.description(`HTTP error! status: ${l.status}`):e.description;this.create({id:n,type:"error",message:u,description:c})}else if(e.success!==void 0){s=!1;let u=typeof e.success=="function"?await e.success(l):e.success,c=typeof e.description=="function"?await e.description(l):e.description;this.create({id:n,type:"success",message:u,description:c})}}).catch(async l=>{if(i=["reject",l],e.error!==void 0){s=!1;let u=typeof e.error=="function"?await e.error(l):e.error,c=typeof e.description=="function"?await e.description(l):e.description;this.create({id:n,type:"error",message:u,description:c})}}).finally(()=>{var l;s&&(this.dismiss(n),n=void 0),(l=e.finally)==null||l.call(e)}),a=()=>new Promise((l,u)=>o.then(()=>i[0]==="reject"?u(i[1]):l(i[1])).catch(u));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})},this.custom=(t,e)=>{let n=(e==null?void 0:e.id)||uv++;return this.create({jsx:t(n),id:n,...e}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Nt=new _3,w3=(t,e)=>{let n=(e==null?void 0:e.id)||uv++;return Nt.addToast({title:t,...e,id:n}),n},x3=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",b3=w3,E3=()=>Nt.toasts,S3=()=>Nt.getActiveToasts();Object.assign(b3,{success:Nt.success,info:Nt.info,warning:Nt.warning,error:Nt.error,custom:Nt.custom,message:Nt.message,promise:Nt.promise,dismiss:Nt.dismiss,loading:Nt.loading},{getHistory:E3,getToasts:S3});function C3(t,{insertAt:e}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}C3(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} -`);function hu(t){return t.label!==void 0}var k3=3,P3="32px",R3="16px",H0=4e3,T3=356,I3=14,O3=20,M3=200;function xn(...t){return t.filter(Boolean).join(" ")}function N3(t){let[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}var A3=t=>{var e,n,r,s,i,o,a,l,u,c,d;let{invert:f,toast:h,unstyled:_,interacting:p,setHeights:y,visibleToasts:v,heights:m,index:x,toasts:b,expanded:E,removeToast:S,defaultRichColors:k,closeButton:C,style:I,cancelButtonStyle:P,actionButtonStyle:$,className:N="",descriptionClassName:B="",duration:j,position:W,gap:q,loadingIcon:G,expandByDefault:M,classNames:T,icons:z,closeButtonAriaLabel:K="Close toast",pauseWhenPageIsHidden:H}=t,[Q,X]=R.useState(null),[ie,pe]=R.useState(null),[se,ve]=R.useState(!1),[_e,Ze]=R.useState(!1),[Ot,et]=R.useState(!1),[ze,nr]=R.useState(!1),[Or,lt]=R.useState(!1),[Mr,tn]=R.useState(0),[Ut,Nr]=R.useState(0),Ar=R.useRef(h.duration||j||H0),Bo=R.useRef(null),vn=R.useRef(null),Kk=x===0,Qk=x+1<=v,nn=h.type,hi=h.dismissible!==!1,Yk=h.className||"",Xk=h.descriptionClassName||"",Pl=R.useMemo(()=>m.findIndex(oe=>oe.toastId===h.id)||0,[m,h.id]),Jk=R.useMemo(()=>{var oe;return(oe=h.closeButton)!=null?oe:C},[h.closeButton,C]),dm=R.useMemo(()=>h.duration||j||H0,[h.duration,j]),$d=R.useRef(0),pi=R.useRef(0),fm=R.useRef(0),vi=R.useRef(null),[Zk,eP]=W.split("-"),hm=R.useMemo(()=>m.reduce((oe,Se,je)=>je>=Pl?oe:oe+Se.height,0),[m,Pl]),pm=y3(),tP=h.invert||f,Ld=nn==="loading";pi.current=R.useMemo(()=>Pl*q+hm,[Pl,hm]),R.useEffect(()=>{Ar.current=dm},[dm]),R.useEffect(()=>{ve(!0)},[]),R.useEffect(()=>{let oe=vn.current;if(oe){let Se=oe.getBoundingClientRect().height;return Nr(Se),y(je=>[{toastId:h.id,height:Se,position:h.position},...je]),()=>y(je=>je.filter(gn=>gn.toastId!==h.id))}},[y,h.id]),R.useLayoutEffect(()=>{if(!se)return;let oe=vn.current,Se=oe.style.height;oe.style.height="auto";let je=oe.getBoundingClientRect().height;oe.style.height=Se,Nr(je),y(gn=>gn.find(mn=>mn.toastId===h.id)?gn.map(mn=>mn.toastId===h.id?{...mn,height:je}:mn):[{toastId:h.id,height:je,position:h.position},...gn])},[se,h.title,h.description,y,h.id]);let $r=R.useCallback(()=>{Ze(!0),tn(pi.current),y(oe=>oe.filter(Se=>Se.toastId!==h.id)),setTimeout(()=>{S(h)},M3)},[h,S,y,pi]);R.useEffect(()=>{if(h.promise&&nn==="loading"||h.duration===1/0||h.type==="loading")return;let oe;return E||p||H&&pm?(()=>{if(fm.current<$d.current){let Se=new Date().getTime()-$d.current;Ar.current=Ar.current-Se}fm.current=new Date().getTime()})():Ar.current!==1/0&&($d.current=new Date().getTime(),oe=setTimeout(()=>{var Se;(Se=h.onAutoClose)==null||Se.call(h,h),$r()},Ar.current)),()=>clearTimeout(oe)},[E,p,h,nn,H,pm,$r]),R.useEffect(()=>{h.delete&&$r()},[$r,h.delete]);function nP(){var oe,Se,je;return z!=null&&z.loading?R.createElement("div",{className:xn(T==null?void 0:T.loader,(oe=h==null?void 0:h.classNames)==null?void 0:oe.loader,"sonner-loader"),"data-visible":nn==="loading"},z.loading):G?R.createElement("div",{className:xn(T==null?void 0:T.loader,(Se=h==null?void 0:h.classNames)==null?void 0:Se.loader,"sonner-loader"),"data-visible":nn==="loading"},G):R.createElement(f3,{className:xn(T==null?void 0:T.loader,(je=h==null?void 0:h.classNames)==null?void 0:je.loader),visible:nn==="loading"})}return R.createElement("li",{tabIndex:0,ref:vn,className:xn(N,Yk,T==null?void 0:T.toast,(e=h==null?void 0:h.classNames)==null?void 0:e.toast,T==null?void 0:T.default,T==null?void 0:T[nn],(n=h==null?void 0:h.classNames)==null?void 0:n[nn]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:k,"data-styled":!(h.jsx||h.unstyled||_),"data-mounted":se,"data-promise":!!h.promise,"data-swiped":Or,"data-removed":_e,"data-visible":Qk,"data-y-position":Zk,"data-x-position":eP,"data-index":x,"data-front":Kk,"data-swiping":Ot,"data-dismissible":hi,"data-type":nn,"data-invert":tP,"data-swipe-out":ze,"data-swipe-direction":ie,"data-expanded":!!(E||M&&se),style:{"--index":x,"--toasts-before":x,"--z-index":b.length-x,"--offset":`${_e?Mr:pi.current}px`,"--initial-height":M?"auto":`${Ut}px`,...I,...h.style},onDragEnd:()=>{et(!1),X(null),vi.current=null},onPointerDown:oe=>{Ld||!hi||(Bo.current=new Date,tn(pi.current),oe.target.setPointerCapture(oe.pointerId),oe.target.tagName!=="BUTTON"&&(et(!0),vi.current={x:oe.clientX,y:oe.clientY}))},onPointerUp:()=>{var oe,Se,je,gn;if(ze||!hi)return;vi.current=null;let mn=Number(((oe=vn.current)==null?void 0:oe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Lr=Number(((Se=vn.current)==null?void 0:Se.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ks=new Date().getTime()-((je=Bo.current)==null?void 0:je.getTime()),yn=Q==="x"?mn:Lr,jr=Math.abs(yn)/ks;if(Math.abs(yn)>=O3||jr>.11){tn(pi.current),(gn=h.onDismiss)==null||gn.call(h,h),pe(Q==="x"?mn>0?"right":"left":Lr>0?"down":"up"),$r(),nr(!0),lt(!1);return}et(!1),X(null)},onPointerMove:oe=>{var Se,je,gn,mn;if(!vi.current||!hi||((Se=window.getSelection())==null?void 0:Se.toString().length)>0)return;let Lr=oe.clientY-vi.current.y,ks=oe.clientX-vi.current.x,yn=(je=t.swipeDirections)!=null?je:N3(W);!Q&&(Math.abs(ks)>1||Math.abs(Lr)>1)&&X(Math.abs(ks)>Math.abs(Lr)?"x":"y");let jr={x:0,y:0};Q==="y"?(yn.includes("top")||yn.includes("bottom"))&&(yn.includes("top")&&Lr<0||yn.includes("bottom")&&Lr>0)&&(jr.y=Lr):Q==="x"&&(yn.includes("left")||yn.includes("right"))&&(yn.includes("left")&&ks<0||yn.includes("right")&&ks>0)&&(jr.x=ks),(Math.abs(jr.x)>0||Math.abs(jr.y)>0)&<(!0),(gn=vn.current)==null||gn.style.setProperty("--swipe-amount-x",`${jr.x}px`),(mn=vn.current)==null||mn.style.setProperty("--swipe-amount-y",`${jr.y}px`)}},Jk&&!h.jsx?R.createElement("button",{"aria-label":K,"data-disabled":Ld,"data-close-button":!0,onClick:Ld||!hi?()=>{}:()=>{var oe;$r(),(oe=h.onDismiss)==null||oe.call(h,h)},className:xn(T==null?void 0:T.closeButton,(s=h==null?void 0:h.classNames)==null?void 0:s.closeButton)},(i=z==null?void 0:z.close)!=null?i:m3):null,h.jsx||g.isValidElement(h.title)?h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title:R.createElement(R.Fragment,null,nn||h.icon||h.promise?R.createElement("div",{"data-icon":"",className:xn(T==null?void 0:T.icon,(o=h==null?void 0:h.classNames)==null?void 0:o.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||nP():null,h.type!=="loading"?h.icon||(z==null?void 0:z[nn])||c3(nn):null):null,R.createElement("div",{"data-content":"",className:xn(T==null?void 0:T.content,(a=h==null?void 0:h.classNames)==null?void 0:a.content)},R.createElement("div",{"data-title":"",className:xn(T==null?void 0:T.title,(l=h==null?void 0:h.classNames)==null?void 0:l.title)},typeof h.title=="function"?h.title():h.title),h.description?R.createElement("div",{"data-description":"",className:xn(B,Xk,T==null?void 0:T.description,(u=h==null?void 0:h.classNames)==null?void 0:u.description)},typeof h.description=="function"?h.description():h.description):null),g.isValidElement(h.cancel)?h.cancel:h.cancel&&hu(h.cancel)?R.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||P,onClick:oe=>{var Se,je;hu(h.cancel)&&hi&&((je=(Se=h.cancel).onClick)==null||je.call(Se,oe),$r())},className:xn(T==null?void 0:T.cancelButton,(c=h==null?void 0:h.classNames)==null?void 0:c.cancelButton)},h.cancel.label):null,g.isValidElement(h.action)?h.action:h.action&&hu(h.action)?R.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||$,onClick:oe=>{var Se,je;hu(h.action)&&((je=(Se=h.action).onClick)==null||je.call(Se,oe),!oe.defaultPrevented&&$r())},className:xn(T==null?void 0:T.actionButton,(d=h==null?void 0:h.classNames)==null?void 0:d.actionButton)},h.action.label):null))};function W0(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function $3(t,e){let n={};return[t,e].forEach((r,s)=>{let i=s===1,o=i?"--mobile-offset":"--offset",a=i?R3:P3;function l(u){["top","right","bottom","left"].forEach(c=>{n[`${o}-${c}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${o}-${u}`]=a:n[`${o}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):l(a)}),n}var L3=g.forwardRef(function(t,e){let{invert:n,position:r="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:o,className:a,offset:l,mobileOffset:u,theme:c="light",richColors:d,duration:f,style:h,visibleToasts:_=k3,toastOptions:p,dir:y=W0(),gap:v=I3,loadingIcon:m,icons:x,containerAriaLabel:b="Notifications",pauseWhenPageIsHidden:E}=t,[S,k]=R.useState([]),C=R.useMemo(()=>Array.from(new Set([r].concat(S.filter(H=>H.position).map(H=>H.position)))),[S,r]),[I,P]=R.useState([]),[$,N]=R.useState(!1),[B,j]=R.useState(!1),[W,q]=R.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),G=R.useRef(null),M=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),T=R.useRef(null),z=R.useRef(!1),K=R.useCallback(H=>{k(Q=>{var X;return(X=Q.find(ie=>ie.id===H.id))!=null&&X.delete||Nt.dismiss(H.id),Q.filter(({id:ie})=>ie!==H.id)})},[]);return R.useEffect(()=>Nt.subscribe(H=>{if(H.dismiss){k(Q=>Q.map(X=>X.id===H.id?{...X,delete:!0}:X));return}setTimeout(()=>{wb.flushSync(()=>{k(Q=>{let X=Q.findIndex(ie=>ie.id===H.id);return X!==-1?[...Q.slice(0,X),{...Q[X],...H},...Q.slice(X+1)]:[H,...Q]})})})}),[]),R.useEffect(()=>{if(c!=="system"){q(c);return}if(c==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?q("dark"):q("light")),typeof window>"u")return;let H=window.matchMedia("(prefers-color-scheme: dark)");try{H.addEventListener("change",({matches:Q})=>{q(Q?"dark":"light")})}catch{H.addListener(({matches:X})=>{try{q(X?"dark":"light")}catch(ie){console.error(ie)}})}},[c]),R.useEffect(()=>{S.length<=1&&N(!1)},[S]),R.useEffect(()=>{let H=Q=>{var X,ie;s.every(pe=>Q[pe]||Q.code===pe)&&(N(!0),(X=G.current)==null||X.focus()),Q.code==="Escape"&&(document.activeElement===G.current||(ie=G.current)!=null&&ie.contains(document.activeElement))&&N(!1)};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[s]),R.useEffect(()=>{if(G.current)return()=>{T.current&&(T.current.focus({preventScroll:!0}),T.current=null,z.current=!1)}},[G.current]),R.createElement("section",{ref:e,"aria-label":`${b} ${M}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},C.map((H,Q)=>{var X;let[ie,pe]=H.split("-");return S.length?R.createElement("ol",{key:H,dir:y==="auto"?W0():y,tabIndex:-1,ref:G,className:a,"data-sonner-toaster":!0,"data-theme":W,"data-y-position":ie,"data-lifted":$&&S.length>1&&!i,"data-x-position":pe,style:{"--front-toast-height":`${((X=I[0])==null?void 0:X.height)||0}px`,"--width":`${T3}px`,"--gap":`${v}px`,...h,...$3(l,u)},onBlur:se=>{z.current&&!se.currentTarget.contains(se.relatedTarget)&&(z.current=!1,T.current&&(T.current.focus({preventScroll:!0}),T.current=null))},onFocus:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||z.current||(z.current=!0,T.current=se.relatedTarget)},onMouseEnter:()=>N(!0),onMouseMove:()=>N(!0),onMouseLeave:()=>{B||N(!1)},onDragEnd:()=>N(!1),onPointerDown:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||j(!0)},onPointerUp:()=>j(!1)},S.filter(se=>!se.position&&Q===0||se.position===H).map((se,ve)=>{var _e,Ze;return R.createElement(A3,{key:se.id,icons:x,index:ve,toast:se,defaultRichColors:d,duration:(_e=p==null?void 0:p.duration)!=null?_e:f,className:p==null?void 0:p.className,descriptionClassName:p==null?void 0:p.descriptionClassName,invert:n,visibleToasts:_,closeButton:(Ze=p==null?void 0:p.closeButton)!=null?Ze:o,interacting:B,position:H,style:p==null?void 0:p.style,unstyled:p==null?void 0:p.unstyled,classNames:p==null?void 0:p.classNames,cancelButtonStyle:p==null?void 0:p.cancelButtonStyle,actionButtonStyle:p==null?void 0:p.actionButtonStyle,removeToast:K,toasts:S.filter(Ot=>Ot.position==se.position),heights:I.filter(Ot=>Ot.position==se.position),setHeights:P,expandByDefault:i,gap:v,loadingIcon:m,expanded:$,pauseWhenPageIsHidden:E,swipeDirections:t.swipeDirections})})):null}))});const j3=({...t})=>{const{theme:e="system"}=NT();return w.jsx(L3,{theme:e,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...t})};var F3=Symbol("radix.slottable");function D3(t){const e=({children:n})=>w.jsx(w.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=F3,e}var[Nd]=Cs("Tooltip",[kd]),cm=kd(),jk="TooltipProvider",z3=700,G0="tooltip.open",[B3,Fk]=Nd(jk),Dk=t=>{const{__scopeTooltip:e,delayDuration:n=z3,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,o=g.useRef(!0),a=g.useRef(!1),l=g.useRef(0);return g.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),w.jsx(B3,{scope:e,isOpenDelayedRef:o,delayDuration:n,onOpen:g.useCallback(()=>{window.clearTimeout(l.current),o.current=!1},[]),onClose:g.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:g.useCallback(u=>{a.current=u},[]),disableHoverableContent:s,children:i})};Dk.displayName=jk;var zk="Tooltip",[m5,Ad]=Nd(zk),cv="TooltipTrigger",U3=g.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=Ad(cv,n),i=Fk(cv,n),o=cm(n),a=g.useRef(null),l=Xe(e,a,s.onTriggerChange),u=g.useRef(!1),c=g.useRef(!1),d=g.useCallback(()=>u.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),w.jsx(aC,{asChild:!0,...o,children:w.jsx(Re.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:l,onPointerMove:Z(t.onPointerMove,f=>{f.pointerType!=="touch"&&!c.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),c.current=!0)}),onPointerLeave:Z(t.onPointerLeave,()=>{s.onTriggerLeave(),c.current=!1}),onPointerDown:Z(t.onPointerDown,()=>{s.open&&s.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Z(t.onFocus,()=>{u.current||s.onOpen()}),onBlur:Z(t.onBlur,s.onClose),onClick:Z(t.onClick,s.onClose)})})});U3.displayName=cv;var V3="TooltipPortal",[y5,q3]=Nd(V3,{forceMount:void 0}),Mo="TooltipContent",Bk=g.forwardRef((t,e)=>{const n=q3(Mo,t.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=t,o=Ad(Mo,t.__scopeTooltip);return w.jsx(er,{present:r||o.open,children:o.disableHoverableContent?w.jsx(Uk,{side:s,...i,ref:e}):w.jsx(H3,{side:s,...i,ref:e})})}),H3=g.forwardRef((t,e)=>{const n=Ad(Mo,t.__scopeTooltip),r=Fk(Mo,t.__scopeTooltip),s=g.useRef(null),i=Xe(e,s),[o,a]=g.useState(null),{trigger:l,onClose:u}=n,c=s.current,{onPointerInTransitChange:d}=r,f=g.useCallback(()=>{a(null),d(!1)},[d]),h=g.useCallback((_,p)=>{const y=_.currentTarget,v={x:_.clientX,y:_.clientY},m=Y3(v,y.getBoundingClientRect()),x=X3(v,m),b=J3(p.getBoundingClientRect()),E=ez([...x,...b]);a(E),d(!0)},[d]);return g.useEffect(()=>()=>f(),[f]),g.useEffect(()=>{if(l&&c){const _=y=>h(y,c),p=y=>h(y,l);return l.addEventListener("pointerleave",_),c.addEventListener("pointerleave",p),()=>{l.removeEventListener("pointerleave",_),c.removeEventListener("pointerleave",p)}}},[l,c,h,f]),g.useEffect(()=>{if(o){const _=p=>{const y=p.target,v={x:p.clientX,y:p.clientY},m=(l==null?void 0:l.contains(y))||(c==null?void 0:c.contains(y)),x=!Z3(v,o);m?f():x&&(f(),u())};return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[l,c,o,u,f]),w.jsx(Uk,{...t,ref:i})}),[W3,G3]=Nd(zk,{isInside:!1}),K3=D3("TooltipContent"),Uk=g.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:o,...a}=t,l=Ad(Mo,n),u=cm(n),{onClose:c}=l;return g.useEffect(()=>(document.addEventListener(G0,c),()=>document.removeEventListener(G0,c)),[c]),g.useEffect(()=>{if(l.trigger){const d=f=>{const h=f.target;h!=null&&h.contains(l.trigger)&&c()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,c]),w.jsx(xl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:c,children:w.jsxs(lC,{"data-state":l.stateAttribute,...u,...a,ref:e,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[w.jsx(K3,{children:r}),w.jsx(W3,{scope:n,isInside:!0,children:w.jsx(zD,{id:l.contentId,role:"tooltip",children:s||r})})]})})});Bk.displayName=Mo;var Vk="TooltipArrow",Q3=g.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=cm(n);return G3(Vk,n).isInside?null:w.jsx(uC,{...s,...r,ref:e})});Q3.displayName=Vk;function Y3(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function X3(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function J3(t){const{top:e,right:n,bottom:r,left:s}=t;return[{x:s,y:e},{x:n,y:e},{x:n,y:r},{x:s,y:r}]}function Z3(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,o=e.length-1;ir!=f>r&&n<(d-u)*(r-c)/(f-c)+u&&(s=!s)}return s}function ez(t){const e=t.slice();return e.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),tz(e)}function tz(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r=2;){const i=e[e.length-1],o=e[e.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const s=t[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))n.pop();else break}n.push(s)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var nz=Dk,qk=Bk;const rz=nz,sz=g.forwardRef(({className:t,sideOffset:e=4,...n},r)=>w.jsx(qk,{ref:r,sideOffset:e,className:at("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n}));sz.displayName=qk.displayName;function iz(){const{pathname:t,hash:e}=$n();g.useLayoutEffect(()=>{e||window.scrollTo({top:0,left:0,behavior:"instant"})},[t,e])}class oz{constructor(e){this.request=e}getPreferences(){return this.request("/me/preferences")}updatePreferences(e){return this.request("/me/preferences",{method:"PUT",body:JSON.stringify(e)})}getRateLimitPolicy(){return this.request("/rate-limits",{credentials:"omit"})}getBookmarkIds(){return this.request("/me/bookmarks/ids")}getBookmarks(){return this.request("/me/bookmarks")}addBookmark(e){return this.request(`/me/bookmarks/${e}`,{method:"POST"})}removeBookmark(e){return this.request(`/me/bookmarks/${e}`,{method:"DELETE"})}}const K0=new oz(iv),lh={hide_closed_source_evals:!1},Hk=R.createContext(null),az=({children:t})=>{const{user:e}=om(),[n,r]=R.useState(lh),[s,i]=R.useState(!1);R.useEffect(()=>{let l=!1;if(!e){r(lh);return}return i(!0),K0.getPreferences().then(u=>{l||r(u)}).catch(()=>{l||r(lh)}).finally(()=>{l||i(!1)}),()=>{l=!0}},[e]);const o=R.useCallback(async l=>{const u={...n,hide_closed_source_evals:l};if(r(u),!!e)try{const c=await K0.updatePreferences(u);r(c)}catch{r(n)}},[n,e]),a=R.useMemo(()=>({preferences:n,canPersist:!!e,isLoading:s,setHideClosedSourceEvals:o}),[n,e,s,o]);return w.jsx(Hk.Provider,{value:a,children:t})};function _5(){const t=R.useContext(Hk);if(!t)throw new Error("usePreferences must be used inside a ");return t}const Wk=l2(),lz=Wk?AN:NN;if(!Wk&&typeof window<"u"){const t=window.location.hash;t.startsWith("#/")&&!t.startsWith("#//")&&window.history.replaceState(null,"",t.slice(1))}const uz=R.lazy(()=>ce(()=>import("./AuthorizePaperEditView-D17pnlSs.js"),__vite__mapDeps([0,1,2,3,4]))),cz=R.lazy(()=>ce(()=>import("./FollowingView-CYdAvQ9K.js"),__vite__mapDeps([5,6,7,1,8,9,10,11,12,2,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32]))),Q0=R.lazy(()=>ce(()=>import("./FeedView-EM1uL5u1.js"),__vite__mapDeps([6,7,1,8,9,10,11,12,2,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32]))),dz=R.lazy(()=>ce(()=>import("./ChatView-DZCqXX3T.js"),__vite__mapDeps([33,1,34,25,26,16,35,36,9,37,38,39,40,41,42,2,43,44,45,46,13,47,48,17,18,49,50,21,22,51,52,53]))),fz=R.lazy(()=>ce(()=>import("./SharedChatView-BBge3zF7.js"),__vite__mapDeps([54,1,34,25,26,16,35,36,9,37,38,39,40,41,42,2,43,44,45,46,13,47,48,17,18,49,50]))),hz=R.lazy(()=>ce(()=>import("./PapersListView-DYcakh08.js"),__vite__mapDeps([55,15,16,17,18,19,11,20,9,27,1,28,56,29,30,31,32,57,23,24]))),pz=R.lazy(()=>ce(()=>import("./PaperDetailView-rFgkO-hW.js"),__vite__mapDeps([58,15,16,17,18,19,11,20,59,35,60,61,1,27,28,62,31,32,3,8,22,43,63,64,24,47,65,2,9,66,67,68,69,70,36,71,13,72,73,74,37,75,40,41,30,76,77,78]))),vz=R.lazy(()=>ce(()=>import("./PaperReaderView-Dwb0MEz-.js"),__vite__mapDeps([79,1,34,25,26,16,35,36,9,37,38,39,40,41,42,2,43,44,45,46,13,47,48,17,18,49,50,80,61,20,27,28,33,21,22,51,52,53]))),gz=R.lazy(()=>ce(()=>import("./TagsIndexView-CtWAzEjF.js"),__vite__mapDeps([81,1,9,11,82,47,83,51,84,85,44,71,86,38,87,74,7,31,32,88,69,3,63,70,64,24,8,65,2,66,13,89]))),mz=R.lazy(()=>ce(()=>import("./TagBrowseView-Cz-rtfuq.js"),__vite__mapDeps([90,91,1,2,10,13,15,16,17,18,19,11,20,14,92,57,23,24,80,39,40,41,42,35,50,9,82,27,28,29,30,31,32,86,37]))),yz=R.lazy(()=>ce(()=>import("./MethodsIndexView-CW-VvDvI.js"),__vite__mapDeps([93,1,9,82,31,32,88,69,3,63,70,64,24,8,47,65,2,66,13,89,84]))),_z=R.lazy(()=>ce(()=>import("./FrameworksIndexView-BjBwZMDx.js"),__vite__mapDeps([94,1,15,16,17,18,19,11,20,9]))),wz=R.lazy(()=>ce(()=>import("./TrendsView-DTLJKQiJ.js"),__vite__mapDeps([95,1,32,31]))),xz=R.lazy(()=>ce(()=>import("./ConferencesIndexView-BvdvhrAq.js"),__vite__mapDeps([96,1,9,31,32,88,69,3,63,70,64,24,8,47,65,2,66,13]))),bz=R.lazy(()=>ce(()=>import("./AiDeadlinesView-DJBbqNNI.js"),__vite__mapDeps([97,1,9,98,72,31,32,20,8]))),Ez=R.lazy(()=>ce(()=>import("./ConferenceDetailView-BP533WBF.js"),__vite__mapDeps([99,1,80,39,40,41,42,35,16,2,50,9,11,31,32,20]))),Sz=R.lazy(()=>ce(()=>import("./ConferenceTaskView-B9U81_-o.js"),__vite__mapDeps([100,1,15,16,17,18,19,11,20,57,23,24,80,39,40,41,42,35,2,50,9,27,28,29,30,31,32]))),Cz=R.lazy(()=>ce(()=>import("./OrganizationsIndexView-CLXjlm96.js"),__vite__mapDeps([101,1,32,9,102]))),kz=R.lazy(()=>ce(()=>import("./OrganizationDetailView-0SsciBmz.js"),__vite__mapDeps([103,104,91,1,2,10,13,15,16,17,18,19,11,20,80,39,40,41,42,35,50,105,31,9,57,23,24,32,64,3,8,47,65,29,30,27,28,77,106]))),Pz=R.lazy(()=>ce(()=>import("./OrganizationTaskView-BXRvLYFu.js"),__vite__mapDeps([107,104,91,1,2,10,13,15,16,17,18,19,11,20,80,39,40,41,42,35,50,105,31,9,57,23,24,32,64,3,8,47,65,29,30,27,28,77,106]))),Rz=R.lazy(()=>ce(()=>import("./AuthorDetailView-CfDdV5MT.js"),__vite__mapDeps([108,1,15,16,17,18,19,11,20,23,24,57,91,2,10,13,32,31,29,30,27,28,106]))),Tz=R.lazy(()=>ce(()=>import("./MethodDetailView-CFqQPuPA.js"),__vite__mapDeps([109,91,1,2,10,13,16,28,15,17,18,19,11,20,57,23,24,80,39,40,41,42,35,50,9,82,29,30,31,32]))),Iz=R.lazy(()=>ce(()=>import("./BenchmarkDetailView-HVBhj9Ke.js"),__vite__mapDeps([110,91,1,2,10,13,9,59,16,35,20,60,19,98,72,15,17,18,11,31,32,92,82,111]))),Oz=R.lazy(()=>ce(()=>import("./SavedPapersView-wbzqnUzp.js"),__vite__mapDeps([112,16,1,15,17,18,19,11,20,31,32,76]))),Mz=R.lazy(()=>ce(()=>import("./SettingsView-BhE0cUUD.js"),__vite__mapDeps([113,1,2,10,98,72,12,7,14,86,26,62,52,46,85]))),Nz=R.lazy(()=>ce(()=>import("./PrivacyView-CH2fzy9w.js"),__vite__mapDeps([114,62]))),Az=R.lazy(()=>ce(()=>import("./ApiDocsView-CydK1pFj.js"),__vite__mapDeps([115,1,40,116]))),$z=R.lazy(()=>ce(()=>import("./McpView-zJL3QfYL.js"),__vite__mapDeps([117,1,62,53,37,46,43,118]))),Lz=R.lazy(()=>ce(()=>import("./SubmitView-CSI8FjeO.js"),__vite__mapDeps([119,2,32,3,63,70,16,67]))),jz=R.lazy(()=>ce(()=>import("./CronDashboard-DPgNAdQz.js"),__vite__mapDeps([120,1,121,122,73,3,48,71,84,87,38,83,123,46,124,65,125,2,75,28,4,9,26]))),Fz=R.lazy(()=>ce(()=>import("./AutonomousOperations-CYN302r1.js"),__vite__mapDeps([126,1,2,121,122,73,3,63,87,45,123]))),Dz=R.lazy(()=>ce(()=>import("./SubmissionsDashboard-DZ_zzNWm.js"),__vite__mapDeps([127,68,67,16,1,2,28,9,20,66,124,65,123,125,128]))),zz=R.lazy(()=>ce(()=>import("./UserProfileView-COPdCmiq.js"),__vite__mapDeps([129,1,105,31,9]))),Bz=R.lazy(()=>ce(()=>import("./RateLimitsView-46i_Guh7.js"),__vite__mapDeps([130,1]))),Uz=R.lazy(()=>ce(()=>import("./AstraForRoboticsView-U0yBJtLA.js"),__vite__mapDeps([131,15,16,17,18,19,11,20,57,32,31,29,30,27,1,28,62,132]))),uh=R.lazy(()=>ce(()=>import("./NotFound-pWH_hqC2.js"),[])),Y0=R.lazy(()=>ce(()=>import("./SearchOverlay-CN_xcP2S.js"),__vite__mapDeps([133,16,1,19,9,56,11]))),Vz=R.lazy(()=>ce(()=>import("./StagingAccessRequestView-DeIOzPRB.js"),__vite__mapDeps([134,125]))),ch=()=>w.jsxs("div",{className:"page","aria-busy":"true","aria-live":"polite",children:[w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:24,width:"30%",marginBottom:24}}),w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:64,width:"60%",marginBottom:32}}),w.jsxs("div",{className:"paper-list",style:{display:"grid",gap:16},children:[w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}}),w.jsx("div",{className:"animate-pulse rounded-md bg-muted",style:{height:96}})]})]}),qz=new hA({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),Hz=()=>{const{arxivId:t}=x1();return w.jsx(To,{to:t?`/paper/${t}`:"/papers",replace:!0})},Wz=()=>{const{taskSlug:t}=x1();return w.jsx(To,{to:t?`/tasks/${t}`:"/tasks",replace:!0})},X0=({element:t})=>jo()?w.jsx(To,{to:"/",replace:!0}):w.jsx(w.Fragment,{children:t}),Gk=({element:t})=>{const{user:e,isLoading:n}=om();return jo()?w.jsx(To,{to:"/",replace:!0}):n?w.jsx("div",{className:"page",children:w.jsx("div",{className:"submission-loading",children:w.jsx("span",{children:"Checking admin session..."})})}):e?e.is_admin?w.jsx(w.Fragment,{children:t}):w.jsx("div",{className:"page",children:w.jsxs("div",{className:"submission-empty submission-empty-warn",children:[w.jsx("h1",{children:"Admin access required"}),w.jsxs("p",{children:["Signed in as @",e.username,". This dashboard is limited to allowlisted admin accounts."]})]})}):w.jsx("div",{className:"page",children:w.jsxs("div",{className:"submission-empty submission-empty-warn",children:[w.jsx("h1",{children:"Sign in required"}),w.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to view admin operations."}),w.jsx(vS,{returnTo:"/admin-dashboard"})]})})},Gz=()=>{const t=s2(),e=typeof window<"u"&&new URL(t,window.location.origin).origin!==window.location.origin;return R.useEffect(()=>{e&&window.location.replace(t)},[t,e]),e?w.jsx("div",{className:"page",children:w.jsxs("div",{className:"submission-loading",children:[w.jsx("span",{children:"Opening the production admin dashboard..."}),w.jsx("a",{href:t,children:"Continue"})]})}):w.jsx(Gk,{element:w.jsx(jz,{})})},Kz=()=>{const[t,e]=R.useState(!1),n=$n();return iz(),R.useLayoutEffect(()=>{var r;(r=document.getElementById("initial-discovery-footer"))==null||r.remove()},[]),R.useEffect(()=>{const r=s=>{(s.metaKey||s.ctrlKey)&&s.key==="k"&&(s.preventDefault(),e(!0))};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[]),n.pathname==="/request-access"?w.jsx(R.Suspense,{fallback:w.jsx(ch,{}),children:w.jsx(Vz,{})}):n.pathname.startsWith("/pdf/")?w.jsxs("div",{className:"reader-route-shell",children:[w.jsx(z0,{onOpenSearch:()=>e(!0)}),w.jsx("div",{className:"reader-route-content",children:w.jsx(R.Suspense,{fallback:w.jsx(ch,{}),children:w.jsx(Y_,{children:w.jsx(le,{path:"/pdf/:paperId",element:a2()?w.jsx(vz,{}):w.jsx(uh,{})})})})}),t&&w.jsx(R.Suspense,{fallback:null,children:w.jsx(Y0,{open:t,onClose:()=>e(!1)})})]}):w.jsxs(w.Fragment,{children:[w.jsx(z0,{onOpenSearch:()=>e(!0)}),w.jsx("main",{children:w.jsx(R.Suspense,{fallback:w.jsx(ch,{}),children:w.jsxs(Y_,{children:[w.jsx(le,{path:"/",element:w.jsx(Q0,{})}),w.jsx(le,{path:"/following",element:w.jsx(cz,{})}),w.jsx(le,{path:"/x-trending",element:w.jsx(Q0,{xTrending:!0})}),w.jsx(le,{path:"/chat/:sessionId?",element:al()?w.jsx(dz,{}):w.jsx(To,{to:"/",replace:!0})}),w.jsx(le,{path:"/share/:shareId",element:al()?w.jsx(fz,{}):w.jsx(uh,{})}),w.jsx(le,{path:"/papers",element:w.jsx(hz,{})}),w.jsx(le,{path:"/papers/:arxivId",element:w.jsx(Hz,{})}),w.jsx(le,{path:"/paper/:arxivId",element:w.jsx(pz,{})}),w.jsx(le,{path:"/tasks",element:w.jsx(gz,{})}),w.jsx(le,{path:"/tasks/:taskSlug",element:w.jsx(mz,{})}),w.jsx(le,{path:"/task/:taskSlug",element:w.jsx(Wz,{})}),w.jsx(le,{path:"/methods",element:w.jsx(yz,{})}),w.jsx(le,{path:"/methods/:methodSlug",element:w.jsx(Tz,{})}),w.jsx(le,{path:"/frameworks",element:w.jsx(_z,{})}),w.jsx(le,{path:"/trends",element:w.jsx(wz,{})}),w.jsx(le,{path:"/conferences",element:w.jsx(xz,{})}),w.jsx(le,{path:"/ai-deadlines",element:w.jsx(bz,{})}),w.jsx(le,{path:"/conferences/:confSlug",element:w.jsx(Ez,{})}),w.jsx(le,{path:"/conferences/:confSlug/:taskSlug",element:w.jsx(Sz,{})}),w.jsx(le,{path:"/organizations",element:w.jsx(Cz,{})}),w.jsx(le,{path:"/orgs/:orgSlug",element:w.jsx(kz,{})}),w.jsx(le,{path:"/orgs/:orgSlug/:taskSlug",element:w.jsx(Pz,{})}),w.jsx(le,{path:"/authors/:authorId",element:w.jsx(Rz,{})}),w.jsx(le,{path:"/benchmark/:datasetSlug",element:w.jsx(Iz,{})}),w.jsx(le,{path:"/authorize-paper-edit/:authorizationId",element:w.jsx(uz,{})}),w.jsx(le,{path:"/submit",element:w.jsx(Lz,{})}),w.jsx(le,{path:"/saved",element:w.jsx(X0,{element:w.jsx(Oz,{})})}),w.jsx(le,{path:"/settings",element:w.jsx(Mz,{})}),w.jsx(le,{path:"/privacy",element:w.jsx(Nz,{})}),w.jsx(le,{path:"/docs/api",element:w.jsx(Az,{})}),w.jsx(le,{path:"/mcp",element:w.jsx($z,{})}),w.jsx(le,{path:"/admin-dashboard",element:w.jsx(Gz,{})}),w.jsx(le,{path:"/autonomous-operations",element:w.jsx(Gk,{element:w.jsx(Fz,{})})}),w.jsx(le,{path:"/cron-dashboard",element:w.jsx(To,{to:"/admin-dashboard",replace:!0})}),w.jsx(le,{path:"/submissions",element:w.jsx(X0,{element:w.jsx(Dz,{})})}),w.jsx(le,{path:"/rate-limits",element:w.jsx(Bz,{})}),w.jsx(le,{path:"/astra-for-robotics",element:w.jsx(Uz,{})}),w.jsx(le,{path:"/:username",element:w.jsx(zz,{})}),w.jsx(le,{path:"*",element:w.jsx(uh,{})})]})})}),w.jsx(OD,{}),t&&w.jsx(R.Suspense,{fallback:null,children:w.jsx(Y0,{open:t,onClose:()=>e(!1)})})]})},Qz=()=>w.jsx(vA,{client:qz,children:w.jsx(PD,{children:w.jsx(az,{children:w.jsxs(rz,{children:[w.jsx(lz,{children:w.jsx(Kz,{})}),w.jsx(u3,{}),w.jsx(j3,{}),!1]})})})});$M();const Yz=w.jsx(AT,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,storageKey:"pwc-theme",children:w.jsx(NM,{children:w.jsx(Qz,{})})}),Xz=xb(document.getElementById("root"));Xz.render(w.jsx(R.StrictMode,{children:Yz}));export{IS as $,sm as A,at as B,cD as C,h5 as D,DS as E,dC as F,fD as G,vS as H,Hj as I,Fg as J,R as K,Rn as L,K0 as M,a2 as N,u5 as O,er as P,pD as Q,qj as R,vD as S,l3 as T,ck as U,lr as V,l5 as W,hD as X,aw as Y,r2 as Z,ce as _,om as a,dD as a0,_l as a1,SD as a2,iv as a3,mS as a4,i3 as a5,eo as a6,Y$ as a7,J$ as a8,Z$ as a9,Wp as aA,Sn as aB,O1 as aC,WN as aD,GN as aE,Hp as aF,R1 as aG,lA as aH,XN as aI,Ct as aJ,r5 as aK,il as aL,cA as aM,i5 as aN,s5 as aO,T1 as aP,LS as aQ,jS as aR,FS as aS,$0 as aT,e2 as aa,Ss as ab,n2 as ac,t2 as ad,a5 as ae,To as af,n5 as ag,Nj as ah,aC as ai,kd as aj,_d as ak,X1 as al,Ng as am,U1 as an,Mg as ao,xl as ap,lC as aq,uC as ar,NT as as,Zz as at,kD as au,d5 as av,md as aw,tA as ax,KN as ay,t5 as az,$n as b,Rg as c,g5 as d,e5 as e,pA as f,al as g,c2 as h,jo as i,w as j,o2 as k,i2 as l,c5 as m,Id as n,f5 as o,jD as p,_5 as q,g as r,v5 as s,Re as t,x1 as u,yd as v,Xe as w,Z as x,kj as y,Cs as z}; diff --git a/assets/index-D6jcIRWs.js b/assets/index-D6jcIRWs.js new file mode 100644 index 0000000000000000000000000000000000000000..6ea39d803259f14e7b7bdf23c24fced51cf81e98 --- /dev/null +++ b/assets/index-D6jcIRWs.js @@ -0,0 +1,162 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AuthorizePaperEditView-mMhbmAG2.js","assets/useQuery-CUJUm4FY.js","assets/useMutation-p6mN4h17.js","assets/button-Bzx0ccHH.js","assets/paperEdits-DUTCoe5T.js","assets/FollowingView-CVyxNxmM.js","assets/FeedView-L-eiYDg9.js","assets/sparkles-r8uPx2-0.js","assets/dialog-vGFIbcd-.js","assets/catalog-PYrB8_bm.js","assets/research-BggtGgC2.js","assets/colors-CLwl8a2d.js","assets/researchTopic-NFMcqCcs.js","assets/plus-C4UQ62Q1.js","assets/arrow-right-CFRHnFt4.js","assets/components-DO1X940E.js","assets/papers-DIIIPDpj.js","assets/AuthorAvatar-UMHOVOr9.js","assets/AuthorAvatar-o5W6pl_W.css","assets/LatexTitle-D_92Jowu.js","assets/safeExternalHref-CkBrsh84.js","assets/McpShowcase-CS9LZY9p.js","assets/AgentLogos-CFt_vIO2.js","assets/PaperDateFilter-CPIqaHaq.js","assets/popover-DCjqGpW0.js","assets/chatSessions-DByIWBno.js","assets/chat-ChnK8XDU.js","assets/usePapers-BbCSwcVk.js","assets/useInfiniteQuery-FXco4P1n.js","assets/useInfiniteScroll-Dm7JY_X4.js","assets/useIntersectionObserver-3LTuEaFW.js","assets/skeleton-BqkYFmXl.js","assets/alert-2MbxVzGL.js","assets/ChatView-wJIPZ39W.js","assets/ArtifactWorkspace-CUZCugRS.js","assets/hover-card-DPpv0l_x.js","assets/CatalogEntityPreviewLink-BhTSUN-X.js","assets/github-B7D_19Qm.js","assets/file-text-4G2I5_Zo.js","assets/PaperPreviewLink-fcJyP9H0.js","assets/index-uFGyKu5N.js","assets/index-yduEvk9Z.js","assets/katex-DkKDou_j.js","assets/copy-BmzqMihw.js","assets/thumbs-up-BqRlVdvF.js","assets/arrow-left-IzGlownM.js","assets/external-link-C_yz2sXa.js","assets/search-CfTufeR7.js","assets/chevron-up-CQKUhZ0S.js","assets/ArtifactWorkspace-Lr_OJaUk.css","assets/katex-wklAmtGL.css","assets/share-2-DPo2j-OC.js","assets/openrouter-DrXWVMlM.js","assets/queryOptions-C9woPjwX.js","assets/SharedChatView-DVE3k-Oa.js","assets/PapersListView-BNcDd1lQ.js","assets/useDebounce-DLPbKAkz.js","assets/PaperFeedFilters-DNebHp4l.js","assets/PaperDetailView-B-27QVn7.js","assets/ExternalSourceEvalBadge-DfhTt9yv.js","assets/ExternalSourceEvalBadge-CWUQ52cV.css","assets/paperReader-BIpQD5HO.js","assets/latexPlainText-DI8YEXVe.js","assets/input-CCN-4hy4.js","assets/searchable-select-B7z6Fcrr.js","assets/loader-circle-BuDrH29B.js","assets/submissions-DNa3tQdo.js","assets/queryInvalidation-BxCpTdQe.js","assets/evaluationQueryInvalidation-D5wBpmlA.js","assets/SignInToEditDialog-RzK54RAM.js","assets/textarea-sXKODM3W.js","assets/database-DKdKRr_t.js","assets/index-DIg7XGE2.js","assets/badge-t4oak8yc.js","assets/globe-iw_Y78tU.js","assets/codex-P8vYbo4B.js","assets/savedPapersAuth-aA59XSW3.js","assets/organizationNames-BVKzYEBp.js","assets/PaperDetailView-CUWCgV3F.css","assets/PaperReaderView-CTxDY9uR.js","assets/MarkdownText-B_D3IE_p.js","assets/TagsIndexView-CHjo-ug4.js","assets/slug-BpH-Nkvz.js","assets/triangle-alert-Cypc2KaL.js","assets/trending-up-DqN3HzZ5.js","assets/moon--2wi3KtT.js","assets/trophy-CqWfBPLd.js","assets/activity-5IcAhZoH.js","assets/TaxonomySuggestionTile-BLk1tYYE.js","assets/TaxonomyTrending-Dqu0dPfc.js","assets/TagBrowseView-bMr8w4y6.js","assets/ResearchFollowButton-C2Bfd9dP.js","assets/BenchmarkTrendSparkline-BfAoxAzu.js","assets/MethodsIndexView-2d98MRig.js","assets/FrameworksIndexView-BxWPuGhr.js","assets/TrendsView-BJILFDZ6.js","assets/ConferencesIndexView-DF9D85K1.js","assets/AiDeadlinesView-DJLyTAgt.js","assets/switch-D_MyRbto.js","assets/ConferenceDetailView-BNri44qz.js","assets/ConferenceTaskView-BBbbnoRS.js","assets/OrganizationsIndexView-C_uscBZY.js","assets/OrganizationsIndexView-CJnrfIkP.css","assets/OrganizationDetailView-BsHsK07O.js","assets/OrganizationPaperFeed-BsFHy5Y7.js","assets/OrganizationContributionGraph-DzcTqxNw.js","assets/NotFound-BTsJlVc8.js","assets/OrganizationTaskView--dnePIkF.js","assets/AuthorDetailView-BsVP0aHv.js","assets/MethodDetailView-PtjfC1LZ.js","assets/BenchmarkDetailView-DGAxl02Y.js","assets/BenchmarkDetailView-CXxK75GR.css","assets/SavedPapersView-79-FOny-.js","assets/SettingsView-BnRQHHDW.js","assets/PrivacyView-CwO81wLZ.js","assets/ApiDocsView-D3iY1sSs.js","assets/ApiDocsView-DPuMdYvY.css","assets/McpView-Dg_zVuuF.js","assets/McpView-EGeqkP46.css","assets/SubmitView-CQFDy941.js","assets/CronDashboard-DZ_espzl.js","assets/CronDashboard-B0sjsUM_.js","assets/CronDashboard-DwChfW9h.css","assets/refresh-cw-Qmu3JZxd.js","assets/circle-check-BZn9Lr76.js","assets/AutonomousOperations-BNbcighz.js","assets/SubmissionsDashboard-CfJfn_Cp.js","assets/SubmissionsDashboard-BTmvDoLW.css","assets/UserProfileView-CrBLP1Jk.js","assets/RateLimitsView-ChUFO8Hr.js","assets/AstraForRoboticsView-CEJJvKPe.js","assets/AstraForRoboticsView-C_lTF_XB.css","assets/SearchOverlay-BMTrmO5f.js","assets/StagingAccessRequestView-BV2q1V1S.js"])))=>i.map(i=>d[i]); +var rk=Object.defineProperty;var zg=t=>{throw TypeError(t)};var ik=(t,e,n)=>e in t?rk(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var wr=(t,e,n)=>ik(t,typeof e!="symbol"?e+"":e,n),hd=(t,e,n)=>e.has(t)||zg("Cannot "+n);var A=(t,e,n)=>(hd(t,e,"read from private field"),n?n.call(t):e.get(t)),le=(t,e,n)=>e.has(t)?zg("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),ee=(t,e,n,r)=>(hd(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),nt=(t,e,n)=>(hd(t,e,"access private method"),n);var al=(t,e,n,r)=>({set _(i){ee(t,e,i,n)},get _(){return A(t,e,r)}});function sk(t,e){for(var n=0;nr[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var c3=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function k0(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var P0={exports:{}},Cc={},R0={exports:{}},ae={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Qa=Symbol.for("react.element"),ok=Symbol.for("react.portal"),ak=Symbol.for("react.fragment"),lk=Symbol.for("react.strict_mode"),uk=Symbol.for("react.profiler"),ck=Symbol.for("react.provider"),dk=Symbol.for("react.context"),fk=Symbol.for("react.forward_ref"),hk=Symbol.for("react.suspense"),pk=Symbol.for("react.memo"),vk=Symbol.for("react.lazy"),Ug=Symbol.iterator;function gk(t){return t===null||typeof t!="object"?null:(t=Ug&&t[Ug]||t["@@iterator"],typeof t=="function"?t:null)}var T0={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},I0=Object.assign,O0={};function po(t,e,n){this.props=t,this.context=e,this.refs=O0,this.updater=n||T0}po.prototype.isReactComponent={};po.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};po.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function M0(){}M0.prototype=po.prototype;function Dp(t,e,n){this.props=t,this.context=e,this.refs=O0,this.updater=n||T0}var zp=Dp.prototype=new M0;zp.constructor=Dp;I0(zp,po.prototype);zp.isPureReactComponent=!0;var Vg=Array.isArray,A0=Object.prototype.hasOwnProperty,Up={current:null},N0={key:!0,ref:!0,__self:!0,__source:!0};function $0(t,e,n){var r,i={},s=null,o=null;if(e!=null)for(r in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)A0.call(e,r)&&!N0.hasOwnProperty(r)&&(i[r]=e[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1>>1,Z=I[G];if(0>>1;Gi(_e,B))Sei(ze,_e)?(I[G]=ze,I[Se]=B,G=Se):(I[G]=_e,I[ce]=B,G=ce);else if(Sei(ze,B))I[G]=ze,I[Se]=B,G=Se;else break e}}return M}function i(I,M){var B=I.sortIndex-M.sortIndex;return B!==0?B:I.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var l=[],u=[],c=1,d=null,f=3,_=!1,m=!1,p=!1,y=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(I){for(var M=n(u);M!==null;){if(M.callback===null)r(u);else if(M.startTime<=I)r(u),M.sortIndex=M.expirationTime,e(l,M);else break;M=n(u)}}function b(I){if(p=!1,x(I),!m)if(n(l)!==null)m=!0,q(E);else{var M=n(u);M!==null&&K(b,M.startTime-I)}}function E(I,M){m=!1,p&&(p=!1,h(C),C=-1),_=!0;var B=f;try{for(x(M),d=n(l);d!==null&&(!(d.expirationTime>M)||I&&!$());){var G=d.callback;if(typeof G=="function"){d.callback=null,f=d.priorityLevel;var Z=G(d.expirationTime<=M);M=t.unstable_now(),typeof Z=="function"?d.callback=Z:d===n(l)&&r(l),x(M)}else r(l);d=n(l)}if(d!==null)var se=!0;else{var ce=n(u);ce!==null&&K(b,ce.startTime-M),se=!1}return se}finally{d=null,f=B,_=!1}}var S=!1,k=null,C=-1,R=5,P=-1;function $(){return!(t.unstable_now()-PI||125G?(I.sortIndex=B,e(u,I),n(l)===null&&I===n(u)&&(p?(h(C),C=-1):p=!0,K(b,B-G))):(I.sortIndex=Z,e(l,I),m||_||(m=!0,q(E))),I},t.unstable_shouldYield=$,t.unstable_wrapCallback=function(I){var M=f;return function(){var B=f;f=M;try{return I.apply(this,arguments)}finally{f=B}}}})(z0);D0.exports=z0;var Pk=D0.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Rk=g,Wt=Pk;function z(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),zf=Object.prototype.hasOwnProperty,Tk=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,qg={},Hg={};function Ik(t){return zf.call(Hg,t)?!0:zf.call(qg,t)?!1:Tk.test(t)?Hg[t]=!0:(qg[t]=!0,!1)}function Ok(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function Mk(t,e,n,r){if(e===null||typeof e>"u"||Ok(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function St(t,e,n,r,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var ot={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){ot[t]=new St(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];ot[e]=new St(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){ot[t]=new St(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){ot[t]=new St(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){ot[t]=new St(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){ot[t]=new St(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){ot[t]=new St(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){ot[t]=new St(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){ot[t]=new St(t,5,!1,t.toLowerCase(),null,!1,!1)});var Bp=/[\-:]([a-z])/g;function qp(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(Bp,qp);ot[e]=new St(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(Bp,qp);ot[e]=new St(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(Bp,qp);ot[e]=new St(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){ot[t]=new St(t,1,!1,t.toLowerCase(),null,!1,!1)});ot.xlinkHref=new St("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){ot[t]=new St(t,1,!1,t.toLowerCase(),null,!0,!0)});function Hp(t,e,n,r){var i=ot.hasOwnProperty(e)?ot[e]:null;(i!==null?i.type!==0:r||!(2a||i[o]!==s[a]){var l=` +`+i[o].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=o&&0<=a);break}}}finally{gd=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Vo(t):""}function Ak(t){switch(t.tag){case 5:return Vo(t.type);case 16:return Vo("Lazy");case 13:return Vo("Suspense");case 19:return Vo("SuspenseList");case 0:case 2:case 15:return t=md(t.type,!1),t;case 11:return t=md(t.type.render,!1),t;case 1:return t=md(t.type,!0),t;default:return""}}function qf(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case ds:return"Fragment";case cs:return"Portal";case Uf:return"Profiler";case Wp:return"StrictMode";case Vf:return"Suspense";case Bf:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case B0:return(t.displayName||"Context")+".Consumer";case V0:return(t._context.displayName||"Context")+".Provider";case Gp:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Kp:return e=t.displayName||null,e!==null?e:qf(t.type)||"Memo";case Tr:e=t._payload,t=t._init;try{return qf(t(e))}catch{}}return null}function Nk(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return qf(e);case 8:return e===Wp?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Xr(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function H0(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function $k(t){var e=H0(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function cl(t){t._valueTracker||(t._valueTracker=$k(t))}function W0(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=H0(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function gu(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Hf(t,e){var n=e.checked;return De({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function Gg(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Xr(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function G0(t,e){e=e.checked,e!=null&&Hp(t,"checked",e,!1)}function Wf(t,e){G0(t,e);var n=Xr(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?Gf(t,e.type,n):e.hasOwnProperty("defaultValue")&&Gf(t,e.type,Xr(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function Kg(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function Gf(t,e,n){(e!=="number"||gu(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Bo=Array.isArray;function Cs(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=dl.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function pa(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Xo={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Fk=["Webkit","ms","Moz","O"];Object.keys(Xo).forEach(function(t){Fk.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Xo[e]=Xo[t]})});function X0(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||Xo.hasOwnProperty(t)&&Xo[t]?(""+e).trim():e+"px"}function J0(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=X0(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var Lk=De({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Yf(t,e){if(e){if(Lk[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(z(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(z(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(z(61))}if(e.style!=null&&typeof e.style!="object")throw Error(z(62))}}function Xf(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Jf=null;function Qp(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Zf=null,ks=null,Ps=null;function Xg(t){if(t=Ja(t)){if(typeof Zf!="function")throw Error(z(280));var e=t.stateNode;e&&(e=Oc(e),Zf(t.stateNode,t.type,e))}}function Z0(t){ks?Ps?Ps.push(t):Ps=[t]:ks=t}function ew(){if(ks){var t=ks,e=Ps;if(Ps=ks=null,Xg(t),e)for(t=0;t>>=0,t===0?32:31-(Kk(t)/Qk|0)|0}var fl=64,hl=4194304;function qo(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function wu(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,s=t.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=qo(a):(s&=o,s!==0&&(r=qo(s)))}else o=n&~i,o!==0?r=qo(o):s!==0&&(r=qo(s));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function Ya(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-_n(e),t[e]=n}function Zk(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=Zo),om=" ",am=!1;function ww(t,e){switch(t){case"keyup":return PP.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function xw(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var fs=!1;function TP(t,e){switch(t){case"compositionend":return xw(e);case"keypress":return e.which!==32?null:(am=!0,om);case"textInput":return t=e.data,t===om&&am?null:t;default:return null}}function IP(t,e){if(fs)return t==="compositionend"||!rv&&ww(t,e)?(t=yw(),Ql=ev=Dr=null,fs=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=dm(n)}}function Cw(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Cw(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function kw(){for(var t=window,e=gu();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=gu(t.document)}return e}function iv(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function DP(t){var e=kw(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&Cw(n.ownerDocument.documentElement,n)){if(r!==null&&iv(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!t.extend&&s>r&&(i=r,r=s,s=i),i=fm(n,s);var o=fm(n,r);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>r?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,hs=null,sh=null,ta=null,oh=!1;function hm(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;oh||hs==null||hs!==gu(r)||(r=hs,"selectionStart"in r&&iv(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ta&&wa(ta,r)||(ta=r,r=Eu(sh,"onSelect"),0gs||(t.current=fh[gs],fh[gs]=null,gs--)}function ke(t,e){gs++,fh[gs]=t.current,t.current=e}var Jr={},vt=ii(Jr),At=ii(!1),$i=Jr;function Ys(t,e){var n=t.type.contextTypes;if(!n)return Jr;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=e[s];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Nt(t){return t=t.childContextTypes,t!=null}function Cu(){Me(At),Me(vt)}function wm(t,e,n){if(vt.current!==Jr)throw Error(z(168));ke(vt,e),ke(At,n)}function $w(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(z(108,Nk(t)||"Unknown",i));return De({},n,r)}function ku(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Jr,$i=vt.current,ke(vt,t),ke(At,At.current),!0}function xm(t,e,n){var r=t.stateNode;if(!r)throw Error(z(169));n?(t=$w(t,e,$i),r.__reactInternalMemoizedMergedChildContext=t,Me(At),Me(vt),ke(vt,t)):Me(At),ke(At,n)}var Jn=null,Mc=!1,Od=!1;function Fw(t){Jn===null?Jn=[t]:Jn.push(t)}function XP(t){Mc=!0,Fw(t)}function si(){if(!Od&&Jn!==null){Od=!0;var t=0,e=ye;try{var n=Jn;for(ye=1;t>=o,i-=o,ir=1<<32-_n(e)+i|n<C?(R=k,k=null):R=k.sibling;var P=f(h,k,x[C],b);if(P===null){k===null&&(k=R);break}t&&k&&P.alternate===null&&e(h,k),v=s(P,v,C),S===null?E=P:S.sibling=P,S=P,k=R}if(C===x.length)return n(h,k),$e&&hi(h,C),E;if(k===null){for(;CC?(R=k,k=null):R=k.sibling;var $=f(h,k,P.value,b);if($===null){k===null&&(k=R);break}t&&k&&$.alternate===null&&e(h,k),v=s($,v,C),S===null?E=$:S.sibling=$,S=$,k=R}if(P.done)return n(h,k),$e&&hi(h,C),E;if(k===null){for(;!P.done;C++,P=x.next())P=d(h,P.value,b),P!==null&&(v=s(P,v,C),S===null?E=P:S.sibling=P,S=P);return $e&&hi(h,C),E}for(k=r(h,k);!P.done;C++,P=x.next())P=_(k,h,C,P.value,b),P!==null&&(t&&P.alternate!==null&&k.delete(P.key===null?C:P.key),v=s(P,v,C),S===null?E=P:S.sibling=P,S=P);return t&&k.forEach(function(O){return e(h,O)}),$e&&hi(h,C),E}function y(h,v,x,b){if(typeof x=="object"&&x!==null&&x.type===ds&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case ul:e:{for(var E=x.key,S=v;S!==null;){if(S.key===E){if(E=x.type,E===ds){if(S.tag===7){n(h,S.sibling),v=i(S,x.props.children),v.return=h,h=v;break e}}else if(S.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Tr&&Sm(E)===S.type){n(h,S.sibling),v=i(S,x.props),v.ref=Ro(h,S,x),v.return=h,h=v;break e}n(h,S);break}else e(h,S);S=S.sibling}x.type===ds?(v=Mi(x.props.children,h.mode,b,x.key),v.return=h,h=v):(b=ru(x.type,x.key,x.props,null,h.mode,b),b.ref=Ro(h,v,x),b.return=h,h=b)}return o(h);case cs:e:{for(S=x.key;v!==null;){if(v.key===S)if(v.tag===4&&v.stateNode.containerInfo===x.containerInfo&&v.stateNode.implementation===x.implementation){n(h,v.sibling),v=i(v,x.children||[]),v.return=h,h=v;break e}else{n(h,v);break}else e(h,v);v=v.sibling}v=Dd(x,h.mode,b),v.return=h,h=v}return o(h);case Tr:return S=x._init,y(h,v,S(x._payload),b)}if(Bo(x))return m(h,v,x,b);if(Eo(x))return p(h,v,x,b);wl(h,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,v!==null&&v.tag===6?(n(h,v.sibling),v=i(v,x),v.return=h,h=v):(n(h,v),v=jd(x,h.mode,b),v.return=h,h=v),o(h)):n(h,v)}return y}var Js=zw(!0),Uw=zw(!1),Tu=ii(null),Iu=null,_s=null,lv=null;function uv(){lv=_s=Iu=null}function cv(t){var e=Tu.current;Me(Tu),t._currentValue=e}function vh(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Ts(t,e){Iu=t,lv=_s=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Ot=!0),t.firstContext=null)}function rn(t){var e=t._currentValue;if(lv!==t)if(t={context:t,memoizedValue:e,next:null},_s===null){if(Iu===null)throw Error(z(308));_s=t,Iu.dependencies={lanes:0,firstContext:t}}else _s=_s.next=t;return e}var wi=null;function dv(t){wi===null?wi=[t]:wi.push(t)}function Vw(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,dv(e)):(n.next=i.next,i.next=n),e.interleaved=n,cr(t,r)}function cr(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Ir=!1;function fv(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Bw(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function ar(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Wr(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,fe&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,cr(t,n)}return i=r.interleaved,i===null?(e.next=e,dv(r)):(e.next=i.next,i.next=e),r.interleaved=e,cr(t,n)}function Xl(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Xp(t,n)}}function Cm(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=e:s=s.next=e}else i=s=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function Ou(t,e,n,r){var i=t.updateQueue;Ir=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,u=l.next;l.next=null,o===null?s=u:o.next=u,o=l;var c=t.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==o&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(s!==null){var d=i.baseState;o=0,c=u=l=null,a=s;do{var f=a.lane,_=a.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:_,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=t,p=a;switch(f=e,_=n,p.tag){case 1:if(m=p.payload,typeof m=="function"){d=m.call(_,d,f);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=p.payload,f=typeof m=="function"?m.call(_,d,f):m,f==null)break e;d=De({},d,f);break e;case 2:Ir=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,f=i.effects,f===null?i.effects=[a]:f.push(a))}else _={eventTime:_,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=_,l=d):c=c.next=_,o|=f;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;f=a,a=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(c===null&&(l=d),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);ji|=o,t.lanes=o,t.memoizedState=d}}function km(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=Ad.transition;Ad.transition={};try{t(!1),e()}finally{ye=n,Ad.transition=r}}function ox(){return sn().memoizedState}function tR(t,e,n){var r=Kr(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ax(t))lx(e,n);else if(n=Vw(t,e,n,r),n!==null){var i=bt();wn(n,t,r,i),ux(n,e,r)}}function nR(t,e,n){var r=Kr(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ax(t))lx(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,xn(a,o)){var l=e.interleaved;l===null?(i.next=i,dv(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=Vw(t,e,i,r),n!==null&&(i=bt(),wn(n,t,r,i),ux(n,e,r))}}function ax(t){var e=t.alternate;return t===Le||e!==null&&e===Le}function lx(t,e){na=Au=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function ux(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Xp(t,n)}}var Nu={readContext:rn,useCallback:lt,useContext:lt,useEffect:lt,useImperativeHandle:lt,useInsertionEffect:lt,useLayoutEffect:lt,useMemo:lt,useReducer:lt,useRef:lt,useState:lt,useDebugValue:lt,useDeferredValue:lt,useTransition:lt,useMutableSource:lt,useSyncExternalStore:lt,useId:lt,unstable_isNewReconciler:!1},rR={readContext:rn,useCallback:function(t,e){return Tn().memoizedState=[t,e===void 0?null:e],t},useContext:rn,useEffect:Rm,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Zl(4194308,4,tx.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Zl(4194308,4,t,e)},useInsertionEffect:function(t,e){return Zl(4,2,t,e)},useMemo:function(t,e){var n=Tn();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Tn();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=tR.bind(null,Le,t),[r.memoizedState,t]},useRef:function(t){var e=Tn();return t={current:t},e.memoizedState=t},useState:Pm,useDebugValue:wv,useDeferredValue:function(t){return Tn().memoizedState=t},useTransition:function(){var t=Pm(!1),e=t[0];return t=eR.bind(null,t[1]),Tn().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Le,i=Tn();if($e){if(n===void 0)throw Error(z(407));n=n()}else{if(n=e(),tt===null)throw Error(z(349));Li&30||Gw(r,e,n)}i.memoizedState=n;var s={value:n,getSnapshot:e};return i.queue=s,Rm(Qw.bind(null,r,s,t),[t]),r.flags|=2048,Ra(9,Kw.bind(null,r,s,n,e),void 0,null),n},useId:function(){var t=Tn(),e=tt.identifierPrefix;if($e){var n=sr,r=ir;n=(r&~(1<<32-_n(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=ka++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=o.createElement(n,{is:r.is}):(t=o.createElement(n),n==="select"&&(o=t,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):t=o.createElementNS(t,n),t[$n]=e,t[Ea]=r,_x(t,e,!1,!1),e.stateNode=t;e:{switch(o=Xf(n,r),n){case"dialog":Te("cancel",t),Te("close",t),i=r;break;case"iframe":case"object":case"embed":Te("load",t),i=r;break;case"video":case"audio":for(i=0;ito&&(e.flags|=128,r=!0,To(s,!1),e.lanes=4194304)}else{if(!r)if(t=Mu(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),To(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!$e)return ut(e),null}else 2*We()-s.renderingStartTime>to&&n!==1073741824&&(e.flags|=128,r=!0,To(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(n=s.last,n!==null?n.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=We(),e.sibling=null,n=Fe.current,ke(Fe,r?n&1|2:n&1),e):(ut(e),null);case 22:case 23:return kv(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Lt&1073741824&&(ut(e),e.subtreeFlags&6&&(e.flags|=8192)):ut(e),null;case 24:return null;case 25:return null}throw Error(z(156,e.tag))}function dR(t,e){switch(ov(e),e.tag){case 1:return Nt(e.type)&&Cu(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Zs(),Me(At),Me(vt),vv(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return pv(e),null;case 13:if(Me(Fe),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(z(340));Xs()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Me(Fe),null;case 4:return Zs(),null;case 10:return cv(e.type._context),null;case 22:case 23:return kv(),null;case 24:return null;default:return null}}var bl=!1,ht=!1,fR=typeof WeakSet=="function"?WeakSet:Set,W=null;function ws(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Be(t,e,r)}else n.current=null}function Sh(t,e,n){try{n()}catch(r){Be(t,e,r)}}var Dm=!1;function hR(t,e){if(ah=xu,t=kw(),iv(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,u=0,c=0,d=t,f=null;t:for(;;){for(var _;d!==n||i!==0&&d.nodeType!==3||(a=o+i),d!==s||r!==0&&d.nodeType!==3||(l=o+r),d.nodeType===3&&(o+=d.nodeValue.length),(_=d.firstChild)!==null;)f=d,d=_;for(;;){if(d===t)break t;if(f===n&&++u===i&&(a=o),f===s&&++c===r&&(l=o),(_=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=_}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(lh={focusedElem:t,selectionRange:n},xu=!1,W=e;W!==null;)if(e=W,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,W=t;else for(;W!==null;){e=W;try{var m=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var p=m.memoizedProps,y=m.memoizedState,h=e.stateNode,v=h.getSnapshotBeforeUpdate(e.elementType===e.type?p:dn(e.type,p),y);h.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var x=e.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(z(163))}}catch(b){Be(e,e.return,b)}if(t=e.sibling,t!==null){t.return=e.return,W=t;break}W=e.return}return m=Dm,Dm=!1,m}function ra(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&Sh(e,n,s)}i=i.next}while(i!==r)}}function $c(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function Ch(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function bx(t){var e=t.alternate;e!==null&&(t.alternate=null,bx(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[$n],delete e[Ea],delete e[dh],delete e[QP],delete e[YP])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function Ex(t){return t.tag===5||t.tag===3||t.tag===4}function zm(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Ex(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function kh(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Su));else if(r!==4&&(t=t.child,t!==null))for(kh(t,e,n),t=t.sibling;t!==null;)kh(t,e,n),t=t.sibling}function Ph(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(Ph(t,e,n),t=t.sibling;t!==null;)Ph(t,e,n),t=t.sibling}var rt=null,vn=!1;function xr(t,e,n){for(n=n.child;n!==null;)Sx(t,e,n),n=n.sibling}function Sx(t,e,n){if(Dn&&typeof Dn.onCommitFiberUnmount=="function")try{Dn.onCommitFiberUnmount(Pc,n)}catch{}switch(n.tag){case 5:ht||ws(n,e);case 6:var r=rt,i=vn;rt=null,xr(t,e,n),rt=r,vn=i,rt!==null&&(vn?(t=rt,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):rt.removeChild(n.stateNode));break;case 18:rt!==null&&(vn?(t=rt,n=n.stateNode,t.nodeType===8?Id(t.parentNode,n):t.nodeType===1&&Id(t,n),ya(t)):Id(rt,n.stateNode));break;case 4:r=rt,i=vn,rt=n.stateNode.containerInfo,vn=!0,xr(t,e,n),rt=r,vn=i;break;case 0:case 11:case 14:case 15:if(!ht&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Sh(n,e,o),i=i.next}while(i!==r)}xr(t,e,n);break;case 1:if(!ht&&(ws(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Be(n,e,a)}xr(t,e,n);break;case 21:xr(t,e,n);break;case 22:n.mode&1?(ht=(r=ht)||n.memoizedState!==null,xr(t,e,n),ht=r):xr(t,e,n);break;default:xr(t,e,n)}}function Um(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new fR),e.forEach(function(r){var i=bR.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function un(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=o),r&=~s}if(r=i,r=We()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*vR(r/1960))-r,10t?16:t,zr===null)var r=!1;else{if(t=zr,zr=null,Lu=0,fe&6)throw Error(z(331));var i=fe;for(fe|=4,W=t.current;W!==null;){var s=W,o=s.child;if(W.flags&16){var a=s.deletions;if(a!==null){for(var l=0;lWe()-Sv?Oi(t,0):Ev|=n),$t(t,e)}function Mx(t,e){e===0&&(t.mode&1?(e=hl,hl<<=1,!(hl&130023424)&&(hl=4194304)):e=1);var n=bt();t=cr(t,e),t!==null&&(Ya(t,e,n),$t(t,n))}function xR(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),Mx(t,n)}function bR(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(z(314))}r!==null&&r.delete(e),Mx(t,n)}var Ax;Ax=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||At.current)Ot=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Ot=!1,uR(t,e,n);Ot=!!(t.flags&131072)}else Ot=!1,$e&&e.flags&1048576&&Lw(e,Ru,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;eu(t,e),t=e.pendingProps;var i=Ys(e,vt.current);Ts(e,n),i=mv(null,e,r,t,i,n);var s=yv();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Nt(r)?(s=!0,ku(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,fv(e),i.updater=Nc,e.stateNode=i,i._reactInternals=e,mh(e,r,t,n),e=wh(null,e,r,!0,s,n)):(e.tag=0,$e&&s&&sv(e),yt(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(eu(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=SR(r),t=dn(r,t),i){case 0:e=_h(null,e,r,t,n);break e;case 1:e=Fm(null,e,r,t,n);break e;case 11:e=Nm(null,e,r,t,n);break e;case 14:e=$m(null,e,r,dn(r.type,t),n);break e}throw Error(z(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:dn(r,i),_h(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:dn(r,i),Fm(t,e,r,i,n);case 3:e:{if(gx(e),t===null)throw Error(z(387));r=e.pendingProps,s=e.memoizedState,i=s.element,Bw(t,e),Ou(e,r,null,n);var o=e.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=eo(Error(z(423)),e),e=Lm(t,e,r,n,i);break e}else if(r!==i){i=eo(Error(z(424)),e),e=Lm(t,e,r,n,i);break e}else for(Ut=Hr(e.stateNode.containerInfo.firstChild),Bt=e,$e=!0,gn=null,n=Uw(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Xs(),r===i){e=dr(t,e,n);break e}yt(t,e,r,n)}e=e.child}return e;case 5:return qw(e),t===null&&ph(e),r=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,uh(r,i)?o=null:s!==null&&uh(r,s)&&(e.flags|=32),vx(t,e),yt(t,e,o,n),e.child;case 6:return t===null&&ph(e),null;case 13:return mx(t,e,n);case 4:return hv(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Js(e,null,r,n):yt(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:dn(r,i),Nm(t,e,r,i,n);case 7:return yt(t,e,e.pendingProps,n),e.child;case 8:return yt(t,e,e.pendingProps.children,n),e.child;case 12:return yt(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,ke(Tu,r._currentValue),r._currentValue=o,s!==null)if(xn(s.value,o)){if(s.children===i.children&&!At.current){e=dr(t,e,n);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=ar(-1,n&-n),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),vh(s.return,n,e),a.lanes|=n;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(z(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),vh(o,n,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}yt(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,Ts(e,n),i=rn(i),r=r(i),e.flags|=1,yt(t,e,r,n),e.child;case 14:return r=e.type,i=dn(r,e.pendingProps),i=dn(r.type,i),$m(t,e,r,i,n);case 15:return hx(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:dn(r,i),eu(t,e),e.tag=1,Nt(r)?(t=!0,ku(e)):t=!1,Ts(e,n),cx(e,r,i),mh(e,r,i,n),wh(null,e,r,!0,t,n);case 19:return yx(t,e,n);case 22:return px(t,e,n)}throw Error(z(156,e.tag))};function Nx(t,e){return aw(t,e)}function ER(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zt(t,e,n,r){return new ER(t,e,n,r)}function Rv(t){return t=t.prototype,!(!t||!t.isReactComponent)}function SR(t){if(typeof t=="function")return Rv(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Gp)return 11;if(t===Kp)return 14}return 2}function Qr(t,e){var n=t.alternate;return n===null?(n=Zt(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function ru(t,e,n,r,i,s){var o=2;if(r=t,typeof t=="function")Rv(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case ds:return Mi(n.children,i,s,e);case Wp:o=8,i|=8;break;case Uf:return t=Zt(12,n,e,i|2),t.elementType=Uf,t.lanes=s,t;case Vf:return t=Zt(13,n,e,i),t.elementType=Vf,t.lanes=s,t;case Bf:return t=Zt(19,n,e,i),t.elementType=Bf,t.lanes=s,t;case q0:return Lc(n,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case V0:o=10;break e;case B0:o=9;break e;case Gp:o=11;break e;case Kp:o=14;break e;case Tr:o=16,r=null;break e}throw Error(z(130,t==null?t:typeof t,""))}return e=Zt(o,n,e,i),e.elementType=t,e.type=r,e.lanes=s,e}function Mi(t,e,n,r){return t=Zt(7,t,r,e),t.lanes=n,t}function Lc(t,e,n,r){return t=Zt(22,t,r,e),t.elementType=q0,t.lanes=n,t.stateNode={isHidden:!1},t}function jd(t,e,n){return t=Zt(6,t,null,e),t.lanes=n,t}function Dd(t,e,n){return e=Zt(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function CR(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=_d(0),this.expirationTimes=_d(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_d(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Tv(t,e,n,r,i,s,o,a,l){return t=new CR(t,e,n,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Zt(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},fv(s),t}function kR(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(jx)}catch(t){console.error(t)}}jx(),j0.exports=Gt;var el=j0.exports;const OR=k0(el);var Dx,Qm=el;Dx=Qm.createRoot,Qm.hydrateRoot;var zu=["light","dark"],Av="(prefers-color-scheme: dark)",MR=typeof window>"u",Nv=g.createContext(void 0),AR={setTheme:t=>{},themes:[]},d3=()=>{var t;return(t=g.useContext(Nv))!=null?t:AR},NR=t=>g.useContext(Nv)?t.children:g.createElement(FR,{...t}),$R=["light","dark"],FR=({forcedTheme:t,disableTransitionOnChange:e=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:i="theme",themes:s=$R,defaultTheme:o=n?"system":"light",attribute:a="data-theme",value:l,children:u,nonce:c})=>{let[d,f]=g.useState(()=>Ym(i,o)),[_,m]=g.useState(()=>Ym(i)),p=l?Object.values(l):s,y=g.useCallback(b=>{let E=b;if(!E)return;b==="system"&&n&&(E=Xm());let S=l?l[E]:E,k=e?jR():null,C=document.documentElement;if(a==="class"?(C.classList.remove(...p),S&&C.classList.add(S)):S?C.setAttribute(a,S):C.removeAttribute(a),r){let R=zu.includes(o)?o:null,P=zu.includes(E)?E:R;C.style.colorScheme=P}k==null||k()},[]),h=g.useCallback(b=>{let E=typeof b=="function"?b(b):b;f(E);try{localStorage.setItem(i,E)}catch{}},[t]),v=g.useCallback(b=>{let E=Xm(b);m(E),d==="system"&&n&&!t&&y("system")},[d,t]);g.useEffect(()=>{let b=window.matchMedia(Av);return b.addListener(v),v(b),()=>b.removeListener(v)},[v]),g.useEffect(()=>{let b=E=>{if(E.key!==i)return;let S=E.newValue||o;h(S)};return window.addEventListener("storage",b),()=>window.removeEventListener("storage",b)},[h]),g.useEffect(()=>{y(t??d)},[t,d]);let x=g.useMemo(()=>({theme:d,setTheme:h,forcedTheme:t,resolvedTheme:d==="system"?_:d,themes:n?[...s,"system"]:s,systemTheme:n?_:void 0}),[d,h,t,_,n,s]);return g.createElement(Nv.Provider,{value:x},g.createElement(LR,{forcedTheme:t,disableTransitionOnChange:e,enableSystem:n,enableColorScheme:r,storageKey:i,themes:s,defaultTheme:o,attribute:a,value:l,children:u,attrs:p,nonce:c}),u)},LR=g.memo(({forcedTheme:t,storageKey:e,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:s,value:o,attrs:a,nonce:l})=>{let u=s==="system",c=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(m=>`'${m}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,d=i?zu.includes(s)&&s?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${s}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",f=(m,p=!1,y=!0)=>{let h=o?o[m]:m,v=p?m+"|| ''":`'${h}'`,x="";return i&&y&&!p&&zu.includes(m)&&(x+=`d.style.colorScheme = '${m}';`),n==="class"?p||h?x+=`c.add(${v})`:x+="null":h&&(x+=`d[s](n,${v})`),x},_=t?`!function(){${c}${f(t)}}()`:r?`!function(){try{${c}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${u})){var t='${Av}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f("dark")}}else{${f("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}${u?"":"else{"+f(s,!1,!1)+"}"}${d}}catch(e){}}()`:`!function(){try{${c}var e=localStorage.getItem('${e}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}else{${f(s,!1,!1)};}${d}}catch(t){}}();`;return g.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:_}})}),Ym=(t,e)=>{if(MR)return;let n;try{n=localStorage.getItem(t)||void 0}catch{}return n||e},jR=()=>{let t=document.createElement("style");return t.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},Xm=t=>(t||(t=window.matchMedia(Av)),t.matches?"dark":"light"),T=typeof window<"u"?window:void 0,pt=typeof globalThis<"u"?globalThis:T,xt=pt==null?void 0:pt.navigator,j=pt==null?void 0:pt.document,Ie=pt==null?void 0:pt.location,$v=pt==null?void 0:pt.fetch,Mh=pt!=null&&pt.XMLHttpRequest&&"withCredentials"in new pt.XMLHttpRequest?pt.XMLHttpRequest:void 0,Jm=pt==null?void 0:pt.AbortController,DR=pt==null?void 0:pt.CompressionStream,Rt=xt==null?void 0:xt.userAgent;function zx(){return!(!T||T.navigator.onLine===!1)}var Oo=typeof globalThis<"u"?globalThis:T;Oo&&typeof self>"u"&&(Oo.self=Oo),Oo&&typeof File>"u"&&(Oo.File=function(){});var Q=T??{},we={DEBUG:!1,LIB_VERSION:"0.5.1",LIB_NAME:"browser-common"};function Zm(t,e,n,r,i,s,o){try{var a=t[s](o),l=a.value}catch(u){return void n(u)}a.done?e(l):Promise.resolve(l).then(r,i)}function be(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var s=t.apply(e,n);function o(l){Zm(s,r,i,o,a,"next",l)}function a(l){Zm(s,r,i,o,a,"throw",l)}o(void 0)})}}function N(){return N=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},N.apply(null,arguments)}function Ux(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}var ey=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function ty(t){return typeof t=="string"||t}function ny(t){return typeof t=="string"?t:void 0}var Mo,zR=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],Xn=function(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.AiCaptureQueue="ai_capture_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.PushRegistered="push_registered",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t}({}),ry=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),UR=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],VR=["token"],Vx="NativeGzipValidationError",Ah=t=>t.length>=2&&t[0]===31&&t[1]===139,iy=(t,e)=>t===ry.GZipJS||e===ry.GZipJS||e==="gzip",sy=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError",Cl=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=Vx,e},BR=function(){var t=be(function*(e,n){18>e.size&&Cl("too-short");var r=new Uint8Array(yield e.slice(0,10).arrayBuffer());Ah(r)&&r[2]===8||Cl("invalid-header");var i=new DataView(yield e.slice(e.size-8).arrayBuffer());i.getUint32(0,!0)!==(o=>{for(var a=(()=>{if(Mo)return Mo;Mo=[];for(var c=0;256>c;c++){for(var d=c,f=0;8>f;f++)d=1&d?3988292384^d>>>1:d>>>1;Mo[c]=d>>>0}return Mo})(),l=4294967295,u=0;o.length>u;u++)l=a[255&(l^o[u])]^l>>>8;return(4294967295^l)>>>0})(n)&&Cl("invalid-crc");var s=n.length>>>0;i.getUint32(4,!0)!==s&&Cl("invalid-size")});return function(e,n){return t.apply(this,arguments)}}();function Nh(){return Nh=be(function*(t,e,n){e===void 0&&(e=!0);try{var r=new TextEncoder().encode(t),i=new globalThis.CompressionStream("gzip"),s=i.writable.getWriter(),o=s.write(r).then(()=>s.close()).catch(function(){var u=be(function*(c){try{yield s.abort(c)}catch{}throw c});return function(c){return u.apply(this,arguments)}}()),a=new Response(i.readable).blob(),l=(yield Promise.all([a,o]))[0];return yield BR(l,r),l}catch(u){if(n!=null&&n.rethrow)throw u;return e&&console.error("Failed to gzip compress data",u),null}}),Nh.apply(this,arguments)}var qR=20,Bx=1e3,HR=1e4,WR="[Circular]",$h="[Truncated]",Vc="[Unserializable]",GR="[Function]";function Os(t){for(var e="",n=0;t.length>n;n++){var r=t.charCodeAt(n);if(55296>r||r>56319)e+=56320>r||r>57343?t[n]:"�";else{var i=t.charCodeAt(n+1);56320>i||i>57343?e+="�":(e+=t[n]+t[n+1],n++)}}return e}var KR=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],oy=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return KR.concat(e).some(r=>{var i=r.toLowerCase();return n.indexOf(i)!==-1})};function Y(t,e){return t.indexOf(e)!==-1}var Bc=function(t){return t.trim()},Fh=function(t){return t.replace(/^\$/,"")};function qx(t){var e,n=[];return(e=JSON.stringify(t,function(r,i){if(typeof i=="bigint")return i.toString();if(typeof i!="function"&&typeof i!="symbol"){if(i instanceof Error)return{name:i.name,message:i.message,stack:i.stack};if(i&&typeof i=="object"){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(i))return"[Circular]";n.push(i)}return i}}))!==null&&e!==void 0?e:"null"}var Hx=Object.prototype,Wx=Hx.hasOwnProperty,qc=Hx.toString,X=Array.isArray||function(t){return qc.call(t)==="[object Array]"},ft=t=>typeof t=="function",xe=t=>t===Object(t)&&!X(t),yn=t=>{if(xe(t)){for(var e in t)if(Wx.call(t,e))return!1;return!0}return!1},F=t=>t===void 0,ue=t=>qc.call(t)=="[object String]",Uu=t=>ue(t)&&t.trim().length===0,et=t=>t===null,te=t=>F(t)||et(t),qe=t=>qc.call(t)=="[object Number]"&&t==t,Gn=t=>qe(t)&&t>0,It=t=>qc.call(t)==="[object Boolean]",QR=t=>t instanceof FormData,YR=t=>Y(UR,t),XR=t=>Y(VR,t);function Gx(t){return t===null||typeof t!="object"}function Vu(t,e){return{}.toString.call(t)==="[object "+e+"]"}function Kx(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return Qx(t,Error)}}function Fv(t){return typeof Event<"u"&&Qx(t,Event)}function Qx(t,e){try{return t instanceof e}catch{return!1}}var JR=[!0,"true",1,"1","yes"],zd=t=>Y(JR,t),ZR=[!1,"false",0,"0","no"];function Ln(t,e,n,r,i){return e>n&&(r.warn("min cannot be greater than max."),e=n),qe(t)?t>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):e>t?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+i),Ln(i||n,e,n,r))}class eT{constructor(e){this.k={},this.S=e.S,this.C=Ln(e.bucketSize,0,100,e.I),this.R=Ln(e.refillRate,0,this.C,e.I),this.A=Ln(e.refillInterval,0,864e5,e.I)}O(e,n){var r=Math.floor((n-e.lastAccess)/this.A);r>0&&(e.tokens=Math.min(e.tokens+r*this.R,this.C),e.lastAccess=e.lastAccess+r*this.A)}consumeRateLimit(e){var n,r=Date.now(),i=String(e),s=this.k[i];return s?this.O(s,r):this.k[i]=s={tokens:this.C,lastAccess:r},s.tokens===0||(s.tokens--,s.tokens===0&&((n=this.S)==null||n.call(this,e)),s.tokens===0)}stop(){this.k={}}}var qt="Mobile",Bu="iOS",or="Android",no="Tablet",Yx=or+" "+no,Xx="iPad",Jx="Apple",Zx=Jx+" Watch",oa="Safari",ro="BlackBerry",eb="Samsung",tb=eb+"Browser",nb=eb+" Internet",Ai="Chrome",tT=Ai+" OS",rb=Ai+" "+Bu,Lv="Internet Explorer",ib=Lv+" "+qt,jv="Opera",nT=jv+" Mini",Dv="Edge",sb="Microsoft "+Dv,Ms="Firefox",ob=Ms+" "+Bu,Ia="Nintendo",Oa="PlayStation",As="Xbox",ab=or+" "+qt,lb=qt+" "+oa,Wo="Windows",Lh=Wo+" Phone",ay="Nokia",jh="Ouya",ub="Generic",rT=ub+" "+qt.toLowerCase(),cb=ub+" "+no.toLowerCase(),Dh="Konqueror",db="Oculus Browser",qu="Vivaldi",fb="Yandex",Hu="Whale",zh="DuckDuckGo",hb="Pale Moon",Wu="Waterfox",aa="Brave",pb="Google Search App",Ne="(\\d+(\\.\\d+)?)",Ud=new RegExp("Version/"+Ne),iT=new RegExp(As,"i"),sT=new RegExp(Oa+" \\w+","i"),oT=new RegExp(Ia+" \\w+","i"),zv=new RegExp(ro+"|PlayBook|BB10","i"),aT={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},vb=function(t,e,n,r){e=e||"";var i=function(s){return s!=null&&s.brave?aa:null}(n);return i||(r!=null&&r.detectGoogleSearchApp&&Y(t,"GSA/")?pb:Y(t," OPR/")&&Y(t,"Mini")?nT:Y(t," OPR/")?jv:zv.test(t)?ro:Y(t,"IE"+qt)||Y(t,"WPDesktop")?ib:Y(t,"OculusBrowser")?db:Y(t,tb)?nb:Y(t,Dv)||Y(t,"Edg/")?sb:Y(t,qu+"/")?qu:Y(t,"YaBrowser/")?fb:Y(t,Hu+"/")?Hu:Y(t,zh+"/")||Y(t,"Ddg/")?zh:Y(t,"FBIOS")?"Facebook "+qt:Y(t,"UCWEB")||Y(t,"UCBrowser")?"UC Browser":Y(t,"CriOS")?rb:Y(t,"CrMo")||Y(t,Ai)?Ai:Y(t,or)&&Y(t,oa)?ab:Y(t,"FxiOS")?ob:Y(t.toLowerCase(),Dh.toLowerCase())?Dh:Y(t,aa+"/")?aa:((s,o)=>o&&Y(o,Jx)||function(a){return Y(a,oa)&&!Y(a,Ai)&&!Y(a,or)}(s))(t,e)?Y(t,qt)?lb:oa:Y(t,"PaleMoon/")?hb:Y(t,Wu+"/")?Wu:Y(t,Ms)?Ms:Y(t,"MSIE")||Y(t,"Trident/")?Lv:Y(t,"Gecko")?Ms:"")},lT={[ib]:[new RegExp("rv:"+Ne)],[sb]:[new RegExp(Dv+"?\\/"+Ne)],[Ai]:[new RegExp("("+Ai+"|CrMo)\\/"+Ne)],[rb]:[new RegExp("CriOS\\/"+Ne)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Ne)],[oa]:[Ud],[lb]:[Ud],[jv]:[new RegExp("(Opera|OPR)\\/"+Ne)],[Ms]:[new RegExp(Ms+"\\/"+Ne)],[ob]:[new RegExp("FxiOS\\/"+Ne)],[Dh]:[new RegExp("Konqueror[:/]?"+Ne,"i")],[ro]:[new RegExp(ro+" "+Ne),Ud],[ab]:[new RegExp("android\\s"+Ne,"i")],[nb]:[new RegExp(tb+"\\/"+Ne)],[db]:[new RegExp("OculusBrowser\\/"+Ne)],[qu]:[new RegExp(qu+"\\/"+Ne)],[fb]:[new RegExp("YaBrowser\\/"+Ne)],[Hu]:[new RegExp(Hu+"\\/"+Ne)],[aa]:[new RegExp(aa+"\\/"+Ne)],[zh]:[new RegExp("(DuckDuckGo|Ddg)\\/"+Ne)],[hb]:[new RegExp("PaleMoon\\/"+Ne)],[Wu]:[new RegExp(Wu+"\\/"+Ne)],[pb]:[new RegExp("GSA\\/"+Ne)],[Lv]:[new RegExp("(rv:|MSIE )"+Ne)],Mozilla:[new RegExp("rv:"+Ne)]},uT=function(t,e,n,r){var i=vb(t,e,n,r),s=lT[i];if(F(s))return null;for(var o=0;s.length>o;o++){var a=t.match(s[o]);if(a)return parseFloat(a[a.length-2])}return null},ly=[[new RegExp(As+"; "+As+" (.*?)[);]","i"),t=>[As,t&&t[1]||""]],[new RegExp(Ia,"i"),[Ia,""]],[new RegExp(Oa,"i"),[Oa,""]],[zv,[ro,""]],[new RegExp(Wo,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Lh,""];if(new RegExp(qt).test(e)&&!/IEMobile\b/.test(e))return[Wo+" "+qt,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var r=aT[n[1]]||"";return/arm/i.test(e)&&(r="RT"),[Wo,r]}return[Wo,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[Bu,[t[3],t[4],t[5]||"0"].join(".")]:[Bu,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=F(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+or+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+or+")","i"),t=>t&&t[2]?[or,[t[2],t[3],t[4]||"0"].join(".")]:[or,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[tT,""]],[/Linux|debian/i,["Linux",""]]],uy=function(t){return oT.test(t)?Ia:sT.test(t)?Oa:iT.test(t)?As:new RegExp(jh,"i").test(t)?jh:new RegExp("("+Lh+"|WPDesktop)","i").test(t)?Lh:/iPad/.test(t)?Xx:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Zx:zv.test(t)?ro:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(ay,"i").test(t)?ay:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(qt).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?or:Yx:new RegExp("(pda|"+qt+")","i").test(t)?rT:new RegExp(no,"i").test(t)&&!new RegExp(no+" pc","i").test(t)?cb:""},cT=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function cy(t,e){return typeof(n=t)=="string"&&cT.test(n)?t:e();var n}function Zr(t){return t&&t.split("#")[0]}function Uv(t,e){var n=setTimeout(t,e);return n!=null&&n.unref&&(n==null||n.unref()),n}function dy(t,e,n){return gb.apply(this,arguments)}function gb(){return(gb=be(function*(t,e,n){var r;try{return yield Promise.race([t,new Promise((i,s)=>{r=Uv(()=>{try{n==null||n(),i()}catch(o){s(o)}},e)})])}finally{clearTimeout(r)}})).apply(this,arguments)}var mb={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},dT=mb.info,fy=9223372036854776e3,fT={}.propertyIsEnumerable;function Gu(t,e){try{return yb(t,e,{ancestors:new WeakSet,remainingNodes:HR},0)}catch{return[]}}function Vv(t,e,n,r){if(0>=n.remainingNodes)return{stringValue:$h};if(n.remainingNodes--,It(t))return{boolValue:t};if(typeof t=="number"){if(!Number.isFinite(t))return{stringValue:String(t)};if(Number.isInteger(t)){if(Number.isSafeInteger(t))return{intValue:String(t)};if(typeof BigInt>"u")return{stringValue:String(t)};var i=BigInt(t).toString();return t>=fy||-fy>t?(e==null||e.debug("Attribute "+i+" is outside the int64 range; encoding it as a string"),{stringValue:i}):{intValue:i}}return{doubleValue:t}}if(typeof t=="string")return{stringValue:Os(t)};if(typeof t=="function")return{stringValue:GR};if(typeof t=="symbol")return{stringValue:String(t)};if(typeof t=="object"&&t!==null){if(n.ancestors.has(t))return{stringValue:WR};if(r>=qR)return{stringValue:$h};if(t instanceof Date){var s=t.getTime(),o=Number.isFinite(s)?t.toISOString():String(t);return{stringValue:typeof o=="string"?Os(o):String(o)}}n.ancestors.add(t);try{try{var a=t.toJSON;if(typeof a=="function")return Vv(a.call(t),e,n,r+1)}catch{}return X(t)?{arrayValue:{values:hT(t,e,n,r+1)}}:{kvlistValue:{values:yb(t,e,n,r+1)}}}finally{n.ancestors.delete(t)}}return{stringValue:Os(String(t))}}function hT(t,e,n,r){for(var i=[],s=Math.min(t.length,Bx),o=0;s>o&&n.remainingNodes>0;o++)try{var a=o in t?t[o]:void 0;if(te(a))continue;i.push(Vv(a,e,n,r))}catch{i.push({stringValue:Vc})}return t.length>o&&i.push({stringValue:$h}),i}function yb(t,e,n,r){var i=[];for(var s in t)if(fT.call(t,s)){if(i.length>=Bx||0>=n.remainingNodes){e==null||e.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{var o=t[s];if(et(o)||F(o))continue;i.push({key:Os(s),value:Vv(o,e,n,r)})}catch{i.push({key:Os(s),value:{stringValue:Vc}})}}return i}function pT(t){try{return Os(String(t))}catch{return Vc}}function vT(t,e,n){var r=mb[t.level||"info"]||dT,i=r.text,s=r.number,o=String(Date.now())+"000000",a={};e.distinctId&&(a.posthogDistinctId=e.distinctId),e.sessionId&&(a.sessionId=e.sessionId),e.windowId&&(a["window.id"]=e.windowId),te(e.sessionStartTimestamp)||(a.sessionStartTimestamp=String(e.sessionStartTimestamp)),te(e.lastActivityTimestamp)||(a.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(a["url.full"]=e.currentUrl),e.screenName&&(a["screen.name"]=e.screenName),e.appState&&(a["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(a.feature_flags=e.activeFeatureFlags);var l=N({},a),u=t.attributes;if(u){var c=[];try{c=Object.keys(u)}catch{c=[]}for(var d of c){var f=void 0;try{f=u[d]}catch{f=Vc}Object.defineProperty(l,d,{value:f,enumerable:!0,writable:!0,configurable:!0})}}var _={timeUnixNano:o,observedTimeUnixNano:o,severityNumber:s,severityText:i,body:{stringValue:pT(t.body)},attributes:Gu(l,n)};return t.trace_id&&(_.traceId=t.trace_id),t.span_id&&(_.spanId=t.span_id),F(t.trace_flags)||(_.flags=t.trace_flags),_}function _b(t,e,n){return N({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":n})}function wb(t,e,n,r){return{resourceLogs:[{resource:{attributes:Gu(e)},scopeLogs:[{scope:{name:n,version:r},logRecords:t}]}]}}let gT=class{constructor(t,e,n,r,i,s,o){var a;s===void 0&&(s=()=>Promise.resolve()),this._instance=t,this.qi=e,this.I=n,this.rn=r,this.nn=i,this.sn=s,this.an=o,this.ln=null,this.un=0,this.hn=0,this.dn=0,this.vn=0,this.cn=!1,this.fn=e.maxBufferSize,this.pn=Math.max((a=e.maxQueueSize)!==null&&a!==void 0?a:e.maxBufferSize,e.maxBufferSize),this.gn=e.flushIntervalMs,this.mn=e.maxBatchRecordsPerPost,this.yn=e.rateCapWindowMs,this.bn=e.maxLogsPerInterval}reset(){this._n(),this.ln=null,this.dn=0,this.vn=0,this.cn=!1,this.un=0,this.hn=0,this.mn=this.qi.maxBatchRecordsPerPost}onReconnect(){this.hn=0,this.wn()}captureLog(t){if(!this._instance.isDisabled&&!this._instance.optedOut&&t!=null&&t.body){var e=this.kn(t);if(e!==null)if(e.body){if(this.Sn()){var n={record:vT(e,this.rn(),this.I)};this.nn(()=>this.xn(n))}}else this.I.info("Log was rejected in beforeSend function")}}kn(t){var e=this.qi.beforeSend;if(!e)return t;var n=X(e)?e:[e],r=t;for(var i of n)try{var s=i(r);if(!s)return this.I.info("Log was rejected in beforeSend function"),null;r=s}catch(o){return this.I.error("Error in beforeSend function for log:",o),null}return r}Sn(){if(this.bn===void 0)return!0;var t=Date.now(),e=t-this.dn;return this.yn>e&&e>=0||(this.dn=t,this.vn=0,this.cn=!1),this.bn>this.vn?(this.vn++,!0):(this.cn||(this.I.warn("captureLog dropping logs: exceeded "+this.bn+" logs per "+this.yn+"ms"),this.cn=!0),!1)}flush(){var t=this;return be(function*(){if(!t._instance.isDisabled)return t.ln||(t.ln=t.Cn().finally(()=>{t.ln=null})),t.ln})()}Cn(){var t=this;return be(function*(){var e;t._n();var n=(e=t._instance.getPersistedProperty(Xn.LogsQueue))!==null&&e!==void 0?e:[];if(n.length!==0)for(var r=n.length,i=0;n.length>0&&r>i;){var s,o;t.un=0;var a=Math.min(n.length,t.mn),l=n.slice(0,a),u=wb(l.map(d=>d.record),t.Tn(),(s=t.an)!==null&&s!==void 0?s:t._instance.getLibraryId(),t._instance.getLibraryVersion()),c=yield t._instance.Mn(u);if(c.kind==="too-large"&&l.length>1)t.mn=Math.max(1,Math.floor(l.length/2)),t.I.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+t.mn);else if(c.kind==="retry-later"||(c.kind==="too-large"?t.I.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):c.kind==="ok"&&t.qi.maxBatchRecordsPerPost>t.mn&&(t.mn=Math.min(t.qi.maxBatchRecordsPerPost,t.mn+1)),yield t.En(l.length),n=(o=t._instance.getPersistedProperty(Xn.LogsQueue))!==null&&o!==void 0?o:[],i+=l.length,c.kind==="fatal"))throw c.error}})()}En(t){var e=this;return be(function*(){var n,r=Math.max(0,t-e.un),i=(n=e._instance.getPersistedProperty(Xn.LogsQueue))!==null&&n!==void 0?n:[];e._instance.setPersistedProperty(Xn.LogsQueue,i.slice(r)),yield e.sn()})()}Tn(){return _b(this.qi,this._instance.getLibraryId(),this._instance.getLibraryVersion())}xn(t){var e;if(!this._instance.optedOut){var n=(e=this._instance.getPersistedProperty(Xn.LogsQueue))!==null&&e!==void 0?e:[];this.pn>n.length||(n.shift(),this.un++,this.I.info("Logs queue is full, dropping oldest record.")),n.push(t),this._instance.setPersistedProperty(Xn.LogsQueue,n),this.fn>n.length?this.In():this.wn()}}In(t){t===void 0&&(t=this.gn),this.Rn||(this.Rn=Uv(()=>{this.Rn=void 0,this.wn()},t))}Pn(){var t=Math.min(Math.max(0,this.hn-1),6);return this.gn*Math.pow(2,t)}An(){var t=this._instance.getPersistedProperty(Xn.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return be(function*(){e._n();var n=e.flush().catch(()=>{});t!==void 0?yield dy(n,t):yield n})()}flushWithTimeout(t){var e=this;return be(function*(){var n=e.flush();yield dy(n,t,()=>{n.catch(()=>{})})})()}wn(){this.flush().then(()=>{this.hn=0},t=>{this.hn++,this.I.error("PostHog logs flush failed:",t)}).finally(()=>{!this._instance.isDisabled&&this.An()&&this.In(this.Pn())})}_n(){this.Rn&&(clearTimeout(this.Rn),this.Rn=void 0)}};var Vd=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function hy(t){return String(t)+"000000"}function py(t,e,n,r){var i="";return r&&(i=Object.keys(r).sort().map(s=>JSON.stringify(s)+":"+JSON.stringify(r[s])).join(",")),t+"\0"+e+"\0"+(n??"")+"\0"+i}let mT=class{constructor(t,e,n){this._instance=t,this.qi=e,this.I=n,this.Fn=new Map,this.ln=null,this.On=!1,this.Ln=new Map,this.$n=new Set,this.Dn=0}count(t,e,n){e===void 0&&(e=1),this.Nn({name:t,type:"count",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}gauge(t,e,n){this.Nn({name:t,type:"gauge",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}histogram(t,e,n){this.Nn({name:t,type:"histogram",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}flush(){var t=this,e=this.ln,n=function(){var i=be(function*(){e&&(yield e.catch(()=>{})),yield t.qn()});return function(){return i.apply(this,arguments)}}(),r=n().finally(()=>{this.ln===r&&(this.ln=null)});return this.ln=r,r}drainWindow(){if(this.Fn.size===0)return null;var t=this.Fn;return this.Fn=new Map,this.On=!1,this.Ln=new Map,this.$n=new Set,this.jn(t)}reset(){this.Dn++,this._n(),this.Fn=new Map,this.ln=null,this.On=!1,this.Ln=new Map,this.$n=new Set}Nn(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.kn(t);if(e!==null)if(e.name&&typeof e.name=="string")if(typeof e.value=="number"&&Number.isFinite(e.value))if(e.type==="count"&&0>e.value)this.I.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var n,r;try{n=e.attributes?N({},e.attributes):void 0,r=py(e.type,e.name,e.unit,n)}catch(o){return void this.I.warn("Dropping metric '"+e.name+"': attributes could not be serialized",o)}var i=this.Fn.get(r);if(!i){if(!this.Bn())return;i={name:e.name,type:e.type,unit:e.unit,attributes:n,windowStartMs:Date.now()},this.Fn.set(r,i)}var s=this.Ln.get(e.name);s===void 0?this.Ln.set(e.name,e.type):s===e.type||this.$n.has(e.name)||(this.$n.add(e.name),this.I.warn("Metric name '"+e.name+"' is already used as a "+s+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name.")),this.Hn(i,e.value),this.In()}else this.I.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.I.warn("Dropping metric with empty name")}}Bn(){return this.qi.maxSeriesPerFlush>this.Fn.size||(this.On||(this.On=!0,this.I.warn("Metric series cap reached ("+this.qi.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Hn(t,e){var n;switch(t.type){case"count":t.total=((n=t.total)!==null&&n!==void 0?n:0)+e;break;case"gauge":t.last=e;break;case"histogram":t.hist||(t.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array(Vd.length+1).fill(0)});var r=t.hist;r.count+=1,r.sum+=e,r.min=Math.min(r.min,e),r.max=Math.max(r.max,e),r.bucketCounts[function(i,s){for(var o=0;s.length>o;o++)if(s[o]>=i)return o;return s.length}(e,Vd)]+=1}}kn(t){var e=this.qi.beforeSend;if(!e)return t;var n=X(e)?e:[e],r=t;for(var i of n)try{var s=i(r);if(!s)return this.I.info("Metric was rejected in beforeSend function"),null;r=s}catch(o){return this.I.error("Error in beforeSend function for metric:",o),null}return r}In(){this.Rn||(this.Rn=Uv(()=>{this.Rn=void 0,this.flush().catch(t=>{this.I.error("Metrics flush failed:",t)})},this.qi.flushIntervalMs))}_n(){this.Rn&&(clearTimeout(this.Rn),this.Rn=void 0)}qn(){var t=this;return be(function*(){if(t.Fn.size!==0){var e=t.Fn;t.Fn=new Map,t.On=!1,t.Ln=new Map,t.$n=new Set;var n=t.Dn,r=yield t._instance.Un(t.jn(e));if(n===t.Dn)switch(r.kind){case"ok":return;case"retry-later":return t.zn(e),void t.In();case"too-large":return void t.I.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.I.error("Failed to send metrics batch:",r.error)}}})()}jn(t){return e=this.Wn(t),n=function(s,o,a){return N({},s.resourceAttributes,{"service.name":s.serviceName||"unknown_service"},s.environment&&{"deployment.environment":s.environment},s.serviceVersion&&{"service.version":s.serviceVersion},{"telemetry.sdk.name":o,"telemetry.sdk.version":a})}(this.qi,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),i=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:Gu(n)},scopeMetrics:[{scope:{name:r,version:i},metrics:e}]}]};var e,n,r,i}Wn(t){var e=hy(Date.now()),n=new Map;for(var r of t.values()){var i,s=py(r.type,r.name,r.unit,void 0),o=n.get(s);o||(o=N({name:r.name},r.unit&&{unit:r.unit}),r.type==="count"?o.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:r.type==="gauge"?o.gauge={dataPoints:[]}:o.histogram={aggregationTemporality:1,dataPoints:[]},n.set(s,o));var a=Gu((i=r.attributes)!==null&&i!==void 0?i:{},this.I),l=hy(r.windowStartMs);if(r.type==="count"){var u,c={attributes:a,startTimeUnixNano:l,timeUnixNano:e,asDouble:(u=r.total)!==null&&u!==void 0?u:0};o.sum.dataPoints.push(c)}else if(r.type==="gauge"){var d,f={attributes:a,timeUnixNano:e,asDouble:(d=r.last)!==null&&d!==void 0?d:0};o.gauge.dataPoints.push(f)}else r.hist&&o.histogram.dataPoints.push({attributes:a,startTimeUnixNano:l,timeUnixNano:e,count:r.hist.count,sum:r.hist.sum,min:r.hist.min,max:r.hist.max,bucketCounts:r.hist.bucketCounts,explicitBounds:Vd})}return Array.from(n.values())}zn(t){var e,n;for(var r of t){var i=r[0],s=r[1],o=this.Fn.get(i);if(o)switch(o.windowStartMs=Math.min(o.windowStartMs,s.windowStartMs),o.type){case"count":o.total=((e=o.total)!==null&&e!==void 0?e:0)+((n=s.total)!==null&&n!==void 0?n:0);break;case"gauge":break;case"histogram":if(s.hist)if(o.hist){o.hist.count+=s.hist.count,o.hist.sum+=s.hist.sum,o.hist.min=Math.min(o.hist.min,s.hist.min),o.hist.max=Math.max(o.hist.max,s.hist.max);for(var a=0;o.hist.bucketCounts.length>a;a++)o.hist.bucketCounts[a]+=s.hist.bucketCounts[a]}else o.hist=s.hist}else this.Bn()&&this.Fn.set(i,s)}}};var kl,vy,Bd;function yT(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return Bd&&n.length===vy||(vy=n.length,Bd=n.reduce((r,i)=>{kl||(kl={});var s=kl[i];if(s)r[s[0]]=s[1];else for(var o=t(i),a=o.length-1;a>=0;a--){var l=o[a],u=l==null?void 0:l.filename,c=e[i];if(u&&c){r[u]=c,kl[i]=[u,c];break}}return r},{})),Bd}}class _T{constructor(e,n,r){r===void 0&&(r=[]),this.coercers=e,this.stackParser=n,this.modifiers=r}buildFromUnknown(e,n){n===void 0&&(n={});var r=n&&n.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,n,0).apply(e),s=this.buildParsingContext(n),o=this.parseStacktrace(i,s);return{$exception_list:this.convertToExceptionList(o,r),$exception_level:"error"}}modifyFrames(e){var n=this;return be(function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&X(r.stacktrace.frames)&&(r.stacktrace.frames=yield n.applyModifiers(r.stacktrace.frames));return e})()}coerceFallback(e){var n;return{type:"Error",value:"Unknown error",stack:(n=e.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(e,n){var r,i;return e.cause!=null&&(r=this.parseStacktrace(e.cause,n)),e.stack!=""&&e.stack!=null&&(i=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?n.skipFirstLines:0),n.chunkIdMap)),N({},e,{cause:r,stack:i})}applyChunkIds(e,n){return e.map(r=>(r.filename&&n&&(r.chunk_id=n[r.filename]),r))}applyCoercers(e,n){for(var r of this.coercers)if(r.match(e))return r.coerce(e,n);return this.coerceFallback(n)}applyModifiers(e){var n=this;return be(function*(){var r=e;for(var i of n.modifiers)r=yield i(r);return r})()}convertToExceptionList(e,n){var r,i,s,o={type:e.type,value:e.value,mechanism:{type:(r=n.type)!==null&&r!==void 0?r:"generic",handled:(i=n.handled)===null||i===void 0||i,synthetic:(s=e.synthetic)!==null&&s!==void 0&&s}};e.stack&&(o.stacktrace={type:"raw",frames:e.stack});var a=[o];return e.cause!=null&&a.push(...this.convertToExceptionList(e.cause,N({},n,{handled:!0}))),a}buildParsingContext(e){var n;return{chunkIdMap:yT(this.stackParser),skipFirstLines:(n=e.skipFirstLines)!==null&&n!==void 0?n:1}}buildCoercingContext(e,n,r){r===void 0&&(r=0);var i=(s,o)=>{if(4>=o){var a=this.buildCoercingContext(e,n,o);return this.applyCoercers(s,a)}};return N({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:e,apply:s=>i(s,r),next:s=>i(s,r+1)})}}var io="?";function Uh(t,e,n,r,i){var s={platform:t,filename:e,function:n===""?io:n,in_app:!(e!=null&&e.startsWith("webkit-masked-url://"))&&e!==""};return F(r)||(s.lineno=r),F(i)||(s.colno=i),s}var xb=(t,e)=>{var n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:io,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},wT=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,xT=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,bT=/\((\S*)(?::(\d+))(?::(\d+))\)/,ET=(t,e)=>{var n=wT.exec(t);if(n)return Uh(e,n[1],io,+n[2],+n[3]);var r=xT.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){var i=bT.exec(r[2]);i&&(r[2]=i[1],r[3]=i[2],r[4]=i[3])}var s=xb(r[1]||io,r[2]);return Uh(e,s[1],s[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},ST=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,CT=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,kT=(t,e)=>{var n=ST.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=CT.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var i=n[3],s=n[1]||io,o=xb(s,i);return Uh(e,i=o[1],s=o[0],n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},gy=/\(error: (.*)\)/;class PT{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var r=ue(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var n=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?n+": "+e.message:n}isDOMException(e){return Vu(e,"DOMException")}isDOMError(e){return Vu(e,"DOMError")}}class RT{match(e){return Kx(e)}coerce(e,n){var r,i=this.getStack(e),s=i===void 0;return{type:this.getType(e),value:this.getMessage(e,n),stack:i??((r=n.syntheticException)==null?void 0:r.stack),cause:e.cause?n.next(e.cause):void 0,synthetic:s}}getType(e){return e.name||e.constructor.name}getMessage(e,n){var r=e.message;return String(r.error&&typeof r.error.message=="string"?r.error.message:r)}getStack(e){return e.stacktrace||e.stack||void 0}}class TT{constructor(){}match(e){return!!Vu(e,"ErrorEvent")&&(e.error!=null||this.fi(e))}coerce(e,n){var r;if(e.error!=null)return n.apply(e.error);var i=n.apply(e.message);return N({},i,{stack:(r=this.pi(e))!==null&&r!==void 0?r:i.stack,synthetic:!0})}fi(e){return ue(e.message)&&e.message.length>0}pi(e){var n,r,i=e,s=(n=i.lineno)!==null&&n!==void 0?n:0,o=(r=i.colno)!==null&&r!==void 0?r:0;if(ue(i.filename)&&i.filename.length!==0&&s!==0)return`Error + at `+i.filename+":"+s+":"+o}}var IT=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class OT{match(e){return typeof e=="string"}coerce(e,n){var r,i=this.getInfos(e),s=i[0],o=i[1];return{type:s??"Error",value:o??e,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(e){var n="Error",r=e,i=e.match(IT);return i&&(n=i[1],r=i[2]),[n,r]}}var MT=["fatal","error","warning","log","info","debug"];function bb(t,e){e===void 0&&(e=40);var n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(", ");if(e>=i.length)return r===n.length?i:i.length>e?i.slice(0,e)+"...":i}return""}class AT{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var r,i,s=this.getErrorPropertyFromObject(e);return s?n.apply(s):{type:this.getType(e),value:this.getValue(e),stack:(r=this.getStack(e))!==null&&r!==void 0?r:(i=n.syntheticException)==null?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){if(Fv(e))return e.constructor.name;var n="name"in e?e.name:void 0;return ue(n)&&!Uu(n)?n:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var n="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(n+=" with message: '"+e.message+"'"),n}if("message"in e&&typeof e.message=="string")return e.message;var r=this.getObjectClassName(e);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+bb(e)}isSeverityLevel(e){return ue(e)&&!Uu(e)&&MT.indexOf(e)>=0}getStack(e){try{return ue(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:ue(e.stack)&&e.stack.length>0?e.stack:void 0}catch{return}}getErrorPropertyFromObject(e){for(var n in e)if({}.hasOwnProperty.call(e,n)){var r=e[n];if(Kx(r))return r}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}}class NT{match(e){return Fv(e)}coerce(e,n){var r,i=e.constructor.name;return{type:i,value:i+" captured as exception with keys: "+bb(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class $T{match(e){return Gx(e)}coerce(e,n){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class FT{match(e){return Vu(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!Fv(e))return!1;try{var n=e.detail;return n!=null&&typeof n=="object"&&"reason"in n}catch{return!1}}coerce(e,n){var r,i=this.getUnhandledRejectionReason(e);return Gx(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}:n.apply(i)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&e.detail!=null&&typeof e.detail=="object"&&"reason"in e.detail)return e.detail.reason}catch{}return e}}var Ku="$message",Qu="$timestamp",LT=new Set([Ku,Qu]),qd={enabled:!0,max_bytes:32768};function Yu(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:qd.enabled,max_bytes:DT(t.max_bytes,qd.max_bytes)}:N({},qd)}class jT{constructor(e){this.Vn=[],this.Gn=0,this.qi=Yu(e)}setConfig(e){this.qi=Yu(e),this.Zn()}add(e){var n=function(i){var s;try{s=qx(i)}catch{return}try{var o=JSON.parse(s);if(!xe(o))return;var a=o,l=a[Ku],u=a[Qu];return!ue(l)||l.trim().length===0||!ue(u)&&!qe(u)?void 0:{step:a,json:s}}catch{return}}(e);if(n){var r=function(i){if(typeof TextEncoder<"u")return new TextEncoder().encode(i).length;for(var s=encodeURIComponent(i),o=0,a=0;s.length>a;a++)s[a]==="%"?(o+=1,a+=2):o+=1;return o}(n.json);r>this.qi.max_bytes||(this.Vn.push({step:n.step,bytes:r}),this.Gn+=r,this.Zn())}}getAttachable(){return this.Vn.map(e=>e.step)}clear(){this.Vn=[],this.Gn=0}size(){return this.Vn.length}Zn(){for(;this.Gn>this.qi.max_bytes&&this.Vn.length>0;){var e=this.Vn.shift();e&&(this.Gn-=e.bytes)}}}function DT(t,e){if(!qe(t)||t===1/0||t===-1/0)return e;var n=Math.floor(t);return 0>n?e:n}var Eb=function(t,e){var n=(e===void 0?{}:e).debugEnabled,r={F(i){if(T&&(we.DEBUG||T.POSTHOG_DEBUG||n)&&!F(T.console)&&T.console){for(var s=("__rrweb_original__"in T.console[i])?T.console[i].__rrweb_original__:T.console[i],o=arguments.length,a=new Array(o>1?o-1:0),l=1;o>l;l++)a[l-1]=arguments[l];s(t,...a)}},debug(){for(var i=arguments.length,s=new Array(i),o=0;i>o;o++)s[o]=arguments[o];r.F("debug",...s)},info(){for(var i=arguments.length,s=new Array(i),o=0;i>o;o++)s[o]=arguments[o];r.F("log",...s)},warn(){for(var i=arguments.length,s=new Array(i),o=0;i>o;o++)s[o]=arguments[o];r.F("warn",...s)},error(){for(var i=arguments.length,s=new Array(i),o=0;i>o;o++)s[o]=arguments[o];r.F("error",...s)},critical(){for(var i=arguments.length,s=new Array(i),o=0;i>o;o++)s[o]=arguments[o];console.error(t,...s)},uninitializedWarning(i){r.error("You must initialize PostHog before calling "+i)},createLogger:(i,s)=>Eb(t+" "+i,s)};return r},D=Eb("[PostHog.js]"),Pe=D.createLogger,zT=Pe("[ExternalScriptsLoader]"),Xu=t=>{var e=j==null?void 0:j.querySelectorAll("script");if(e){for(var n=0;e.length>n;n++)if(e[n].src===t||e[n].getAttribute("src")===t)return e[n]}},vi=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return zT.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=Xu(e);if(r){if(r.__posthog_loading_callback_fired)return n();var i=r.__posthog_loading_error;return i?n(i):(r.addEventListener("load",o=>{r.__posthog_loading_callback_fired=!0,n(void 0,o)}),void r.addEventListener("error",o=>{r.__posthog_loading_error=o,n(o)}))}var s=()=>{if(!j)return n("document not found");if(Xu(e))return vi(t,e,n);var o=j.createElement("script");if(o.type="text/javascript",o.crossOrigin="anonymous",o.src=e,o.onload=u=>{o.__posthog_loading_callback_fired=!0,n(void 0,u)},o.onerror=u=>{o.__posthog_loading_error=u,n(u)},t.config.prepare_external_dependency_script&&(o=t.config.prepare_external_dependency_script(o)),!o)return n("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")j.head.appendChild(o);else{var a,l=j.querySelectorAll("body > script");l.length>0?(a=l[0].parentNode)==null||a.insertBefore(o,l[0]):j.body.appendChild(o)}};j!=null&&j.body?s():j==null||j.addEventListener("DOMContentLoaded",s)},Hd={},my=(t,e)=>{var n="/static/"+e+".js?v="+t.version;if(e==="toolbar"){var r=3e5;n=n+"&t="+Math.floor(Date.now()/r)*r}return t.requestRouter.endpointFor("assets",n)};Q.__PosthogExtensions__=Q.__PosthogExtensions__||{},Q.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{if(e!=="remote-config"){var r=t.config.strict_script_versioning;if(r){var i=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js"),s=Hd[i];if(r==="fallback"&&s){if(Xu(s))return void vi(t,s,n);delete Hd[i]}vi(t,i,r==="fallback"?(a,l)=>{if(a)if(typeof a=="string")n(a);else{var u,c=my(t,e);Hd[i]=c;var d=Xu(i);d==null||(u=d.parentNode)==null||u.removeChild(d),vi(t,c,n)}else n(void 0,l)}:n)}else vi(t,my(t,e),n)}else{var o=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");vi(t,o,n)}},Q.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var r=t.requestRouter.endpointFor("api",e);vi(t,r,n)};we.DEBUG=!1,we.LIB_VERSION="1.418.16",we.LIB_NAME="web";var Sb="$people_distinct_id",mt="distinct_id",Ma="$device_id",Wd="$device_model",bs="__alias",Go="__timers",Vh="$autocapture_disabled_server_side",Bh="$heatmaps_enabled_server_side",qh="$exception_capture_enabled_server_side",Hh="$error_tracking_suppression_rules",Wh="$error_tracking_capture_extension_exceptions",Gh="$web_vitals_enabled_server_side",Bv="$dead_clicks_enabled_server_side",qv="$product_tours_enabled_server_side",Kh="$web_vitals_allowed_metrics",bi="$session_recording_remote_config",Cb="$replay_sample_rate",kb="$replay_override_sampling",Pb="$replay_override_linked_flag",Rb="$replay_override_url_trigger",Tb="$replay_override_event_trigger",Es="$sesid",Hv="$session_is_sampled",Zn="$enabled_feature_flags",Ei="$active_feature_flags",iu="$early_access_features",Aa="$feature_flag_details",Si="$feature_flag_payloads",Ns="$feature_flag_request_id",Ju="$minimal_flag_called_events",Pn="$override_feature_flags",gi="$override_feature_flag_payloads",fn="$stored_person_properties",Nn="$stored_group_properties",Ib="$groups",Qh="$surveys",Zu="$surveys_loaded_at",Yh="$surveys_activated",su="$surveys_activated_session",ou="$surveys_activated_timestamps",Ko="ph_product_tours",tr="$flag_call_reported",Qo="$flag_call_reported_session_id",$s="$feature_flag_errors",Ni="$feature_flag_evaluated_at",ie="$user_state",Xh="$client_session_props",Jh="$capture_rate_limit",Zh="$initial_campaign_params",ep="$initial_referrer_info",ec="$initial_person_info",tc="$epp",Zi="$posthog_cookieless",Ob="$cookieless_mode",Mb="$sdk_debug_extensions_init_method",Ab="$sdk_debug_extensions_init_time_ms",tp="$sdk_debug_recording_script_not_loaded",Wv="PostHog loadExternalDependency extension not found.",mi="on_reject",nr="always",Ve="anonymous",it="identified",np="identified_only",nc="visibilitychange",rc="beforeunload",ls="$pageview",Gd="$pageleave",Kd="$identify",yy="$groupidentify";function Pl(t,e){X(t)&&t.forEach(e)}function he(t,e){if(!te(t))if(X(t))t.forEach(e);else if(QR(t))t.forEach((r,i)=>e(r,i));else for(var n in t)Wx.call(t,n)&&e(t[n],n)}var ge=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];for(var i of n)for(var s in i)i[s]!==void 0&&(t[s]=i[s]);return t};function au(t){for(var e=Object.keys(t),n=e.length,r=new Array(n);n--;)r[n]=[e[n],t[e[n]]];return r}var _y=function(t){try{return t()}catch{return}},UT=function(t){return function(){try{for(var e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];return t.apply(this,n)}catch(i){D.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),D.critical(i)}}},Gv=function(t){var e={};return he(t,function(n,r){(ue(n)&&n.length>0||qe(n))&&(e[r]=n)}),e},VT=["herokuapp.com","vercel.app","netlify.app"];function BT(t){var e=t==null?void 0:t.hostname;if(!ue(e))return!1;var n=e.split(".").slice(-2).join(".");for(var r of VT)if(n===r)return!1;return!0}function Ce(t,e,n,r){var i=r??{},s=i.capture,o=i.passive;t==null||t.addEventListener(e,n,{capture:s!==void 0&&s,passive:o===void 0||o})}function rp(t){return t.name==="ph_toolbar_internal"}var Nb=t=>{if(j){try{for(var e=t+"=",n=j.cookie.split(";").filter(s=>s.length),r=0;n.length>r;r++){for(var i=n[r];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return decodeURIComponent(i.substring(e.length,i.length))}}catch{}return null}};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return qe(t)&&isFinite(t)&&Math.floor(t)===t});class ic{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,r,i){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||0>e||0>n||0>r||0>i||e>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/Math.pow(2,40),s[1]=e/Math.pow(2,32),s[2]=e/Math.pow(2,24),s[3]=e/Math.pow(2,16),s[4]=e/256,s[5]=e,s[6]=112|n>>>8,s[7]=n,s[8]=128|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=i>>>24,s[13]=i>>>16,s[14]=i>>>8,s[15]=i,new ic(s)}toString(){for(var e="",n=0;this.bytes.length>n;n++)e=e+(this.bytes[n]>>>4).toString(16)+(15&this.bytes[n]).toString(16),n!==3&&n!==5&&n!==7&&n!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new ic(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var n=0;16>n;n++){var r=this.bytes[n]-e.bytes[n];if(r!==0)return Math.sign(r)}return 0}}class qT{generate(){var e=this.generateOrAbort();if(!F(e))return e;this.Rr=0;var n=this.generateOrAbort();if(F(n))throw new Error("Could not generate UUID after timestamp reset");return n}generateOrAbort(){var e=Date.now();if(e>this.Rr)this.Rr=e,this.Ar();else{if(this.Rr>=e+1e4)return;this.Lr++,this.Lr>4398046511103&&(this.Rr++,this.Ar())}return ic.fromFieldsV7(this.Rr,Math.trunc(this.Lr/Math.pow(2,30)),this.Lr&Math.pow(2,30)-1,this.Or.nextUint32())}Ar(){this.Lr=1024*this.Or.nextUint32()+(1023&this.Or.nextUint32())}constructor(){this.Rr=0,this.Lr=0,this.Or=new HT}}var wy,$b=t=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};T&&!F(T.crypto)&&crypto.getRandomValues&&($b=t=>crypto.getRandomValues(t));class HT{nextUint32(){return this.ft.length>this.Fr||($b(this.ft),this.Fr=0),this.ft[this.Fr++]}constructor(){this.ft=new Uint32Array(8),this.Fr=1/0}}var In=()=>WT().toString(),WT=()=>(wy||(wy=new qT)).generate(),Ao="",GT=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,He={Dr:()=>!!j,jr(t){D.error("cookieStore error: "+t)},Pr:Nb,Br(t){var e;try{e=JSON.parse(He.Pr(t))||{}}catch{}return e},Nr(t,e,n,r,i){if(!j)return!1;try{var s="",o="",a=function(c,d){if(d){var f=function(m,p){if(p===void 0&&(p=j),Ao)return Ao;if(!p||["localhost","127.0.0.1"].includes(m))return"";for(var y=m.split("."),h=Math.min(y.length,8),v="dmn_chk_"+In();!Ao&&h--;){var x=y.slice(h).join("."),b=v+"=1;domain=."+x+";path=/";p.cookie=b+";max-age=3",p.cookie.includes(v)&&(p.cookie=b+";max-age=0",Ao=x)}return Ao}(c);if(!f){var _=(m=>{var p=m.match(GT);return p?p[0]:""})(c);_!==f&&D.info("Warning: cookie subdomain discovery mismatch",_,f),f=_}return f?"; domain=."+f:""}return""}(j.location.hostname,r);if(n){var l=new Date;l.setTime(l.getTime()+864e5*n),s="; expires="+l.toUTCString()}i&&(o="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&D.warn("cookieStore warning: large cookie, len="+u.length),j.cookie=u,!0}catch{return!1}},qr(t,e){if(j!=null&&j.cookie)try{He.Nr(t,"",-1,e)}catch{return}}},Qd=null,pe={Dr(){if(!et(Qd))return Qd;var t=!0;if(F(T))t=!1;else try{var e="__mplssupport__";pe.Nr(e,"xyz"),pe.Pr(e)!=='"xyz"'&&(t=!1),pe.qr(e)}catch{t=!1}return t||D.error("localStorage unsupported; falling back to cookie store"),Qd=t,t},jr(t){D.error("localStorage error: "+t)},Pr(t){try{return T==null?void 0:T.localStorage.getItem(t)}catch(e){pe.jr(e)}return null},Br(t){try{return JSON.parse(pe.Pr(t))||{}}catch{}return null},Nr(t,e){try{return T==null||T.localStorage.setItem(t,JSON.stringify(e)),!0}catch(n){pe.jr(n)}return!1},qr(t){try{T==null||T.localStorage.removeItem(t)}catch(e){pe.jr(e)}}},Yd=[fn,Ei,Zn,Aa,Si,Ns,Ni,$s,tr],yi=[Ma,mt,Es,Hv,tc,ec,ie],sc=t=>t+"_cpm",KT=["__proto__","constructor","prototype"],Xd=t=>{if(!xe(t))return{};var e={};return Object.keys(t).forEach(n=>{KT.indexOf(n)===-1&&(e[n]=t[n])}),e},Jd=function(t,e){e===void 0&&(e=[]);var n={};return[...yi,...e].forEach(r=>{var i=t[r];F(i)||et(i)||i===""||(n[r]=i)}),n},Fb=t=>{for(var e=5381,n=2166136261,r=0;t.length>r;r++){var i=t.charCodeAt(r);e=33*e^i,n=Math.imul(n^i,16777619)}return t.length.toString(36)+"."+(e>>>0).toString(36)+"."+(n>>>0).toString(36)},xy=(t,e)=>({p:e,f:Fb(JSON.stringify(t))}),by=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{var n=He.Br(sc(t)),r=(n==null?void 0:n.f)===Fb(e)&&X(n.p);return{properties:r?n.p:[],isValid:r}}catch{return{properties:[],isValid:!1}}},Zd=(t,e)=>e+"|"+(He.Pr(sc(t))||""),Rl={},QT={Dr:()=>!0,jr(t){D.error("memoryStorage error: "+t)},Pr:t=>Rl[t]||null,Br:t=>Rl[t]||null,Nr:(t,e)=>(Rl[t]=e,!0),qr(t){delete Rl[t]}},li=null,me={Dr(){if(!et(li))return li;if(li=!0,F(T))li=!1;else try{var t="__support__";me.Nr(t,"xyz"),me.Pr(t)!=='"xyz"'&&(li=!1),me.qr(t)}catch{li=!1}return li},jr(t){D.error("sessionStorage error: ",t)},Pr(t){try{return T==null?void 0:T.sessionStorage.getItem(t)}catch(e){me.jr(e)}return null},Br(t){try{return JSON.parse(me.Pr(t))||null}catch{}return null},Nr(t,e){try{return T==null||T.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(n){me.jr(n)}return!1},qr(t){try{T==null||T.sessionStorage.removeItem(t)}catch(e){me.jr(e)}}};class YT{constructor(e){this._instance=e}get qi(){return this._instance.config}get consent(){return this.cs()?0:this.fs}isOptedOut(){return this.qi.cookieless_mode===nr||this.isRejected()||this.consent===-1&&this.qi.cookieless_mode===mi}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.qi.opt_out_capturing_by_default}optInOut(e){this.ps.Nr(this.gs,e?1:0,this.qi.cookie_expiration,this.qi.cross_subdomain_cookie,this.qi.secure_cookie)}reset(){this.ps.qr(this.gs,this.qi.cross_subdomain_cookie)}get gs(){var e=this._instance.config,n=e.token,r=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(r?r+n:"__ph_opt_in_out_"+n)}get fs(){var e=this.ps.Pr(this.gs);return zd(e)?1:Y(ZR,e)?0:-1}get ps(){var e=this.qi.opt_out_capturing_persistence_type,n=e==="localStorage"?pe:He;if(!this.ys||this.ys!==n){this.ys=n;var r=e==="localStorage"?He:pe;r.Pr(this.gs)&&(this.ys.Pr(this.gs)||this.optInOut(zd(r.Pr(this.gs))),r.qr(this.gs,this.qi.cross_subdomain_cookie))}return this.ys}cs(){return!!this.qi.respect_dnt&&[xt==null?void 0:xt.doNotTrack,xt==null?void 0:xt.msDoNotTrack,Q.doNotTrack].some(e=>zd(e))}}function Lb(t,e){var n,r=t==null||(n=t.config)==null?void 0:n.get_current_url;if(!ft(r))return e;try{var i=r(e);return ue(i)&&i?i:e}catch(s){return D.error("Error in get_current_url, falling back to window.location.href",s),e}}var jb="__POSTHOG_TOOLBAR__",XT=1,JT=3,ZT=11;function Ey(t){return t instanceof Element&&(t.id===jb||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function ei(t){return!!t&&t.nodeType===XT}function Vt(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function Db(t){return!!t&&t.nodeType===JT}function zb(t){return!!t&&t.nodeType===ZT&&ei(t.host)}var Ub=1e3;function Kv(t){return t?Bc(t).split(/\s+/):[]}function Sy(t,e){var n=function(r){var i,s=T==null||(i=T.location)==null?void 0:i.href;return F(s)?void 0:Lb(r,s)}(e);return!!(n&&t&&t.some(r=>n.match(r)))}function oc(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return Kv(e)}function Vb(t){return te(t)?null:Bc(t).split(/(\s+)/).filter(e=>la(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Na(t){var e="";return op(t)&&!Gb(t)&&t.childNodes&&t.childNodes.length&&he(t.childNodes,function(n){var r;Db(n)&&n.textContent&&(e+=(r=Vb(n.textContent))!==null&&r!==void 0?r:"")}),Bc(e)}function ip(t){var e;return F(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var Qv=["a","button","form","input","select","textarea","label"];function sp(t,e){if(F(e))return!0;var n,r=function(s){if(e.some(o=>function(a,l){var u=a.matches||a.matchesSelector||a.msMatchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.oMatchesSelector;try{return!!u&&u.call(a,l)}catch{return!1}}(s,o)))return{v:!0}};for(var i of t)if(n=r(i))return n.v;return!1}function Bb(t){var e=t.parentNode;return!(!e||!ei(e))&&e}var eI=[".ph-no-autocapture","[data-ph-no-autocapture]"],qb=["next","previous","prev",">","<"],tI=[...qb,"+","-","−","–"],Cy=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,ky=[".ph-no-rageclick",".ph-no-capture"],nI=["","text","search","email","password","url","tel","number"];function Hb(t,e){if(!T||Yv(t))return!1;var n,r,i,s,o;if(It(e)?(n=!!e&&ky,r=void 0,i=!1):(n=(s=e==null?void 0:e.css_selector_ignorelist)!==null&&s!==void 0?s:ky,r=e==null?void 0:e.content_ignorelist,i=(o=e==null?void 0:e.ignore_text_selection)!==null&&o!==void 0&&o),n===!1||i&&function(l){return!(!l||!ei(l))&&(!!Vt(l,"textarea")||(Vt(l,"input")?Y(nI,(l.getAttribute("type")||"").toLowerCase()):function(u){if(u.isContentEditable)return!0;var c=u.getAttribute==null?void 0:u.getAttribute("contenteditable");return c==="true"||c===""}(l)))}(t))return!1;var a=Wb(t,!1).targetElementList;return!function(l,u){if(l===!1||F(l))return!1;var c;if(l===!0)c=qb;else{if(!X(l))return!1;if(l.length>10)return D.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;c=l.map(d=>d.toLowerCase())}return u.some(d=>{var f=d.safeText,_=d.ariaLabel;return c.some(m=>Cy(f,m)||Cy(_,m))})}(r,a.map(l=>{var u;return{safeText:Na(l).toLowerCase(),ariaLabel:((u=l.getAttribute("aria-label"))==null?void 0:u.toLowerCase().trim())||""}}))&&!sp(a,n)}var Yv=t=>!t||Vt(t,"html")||!ei(t),Wb=(t,e)=>{if(!T||Yv(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[t],i=t;i.parentNode&&!Vt(i,"body");)if(zb(i.parentNode))r.push(i.parentNode.host),i=i.parentNode.host;else{var s=Bb(i);if(!s)break;if(e||Qv.indexOf(s.tagName.toLowerCase())>-1)n=!0;else try{var o=T.getComputedStyle(s);o&&o.getPropertyValue("cursor")==="pointer"&&(n=!0)}catch{}r.push(s),i=s}return{parentIsUsefulElement:n,targetElementList:r}};function op(t){for(var e=new Set,n=0,r=t;r.parentNode&&!Vt(r,"body");r=r.parentNode){if(n++>=Ub||e.has(r))return!1;e.add(r);var i=oc(r);if(Y(i,"ph-sensitive")||Y(i,"ph-no-capture"))return!1}if(Y(oc(t),"ph-include"))return!0;var s=t.type||"";if(ue(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var o=t.name||t.id||"";return!ue(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,""))}function Gb(t){return!!(Vt(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Vt(t,"select")||Vt(t,"textarea")||t.getAttribute("contenteditable")==="true")}var Py=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),Ry=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,rI=[16,15,14,13],iI=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Ty=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),Iy=/[0-9A-Za-z_]/;function sI(t){for(var e=0,n=!1,r=t.length-1;r>=0;r--){var i=t.charCodeAt(r)-48;n&&(i*=2)>9&&(i-=9),e+=i,n=!n}return e%10==0}function la(t,e){if(e===void 0&&(e=!0),te(t))return!1;if(ue(t)){t=Bc(t);var n=e?Py.test((t||"").replace(/[- ]/g,"")):function(i){var s;for(Ry.lastIndex=0;s=Ry.exec(i);){var o=s[2];if(o)for(var a=o.replace(/[- ]/g,""),l=0;a.length>l;l++)for(var u of rI){var c=l+u;if(a.length>=c){var d=a.slice(l,c);if(Py.test(d)&&sI(d))return!0}}}return!1}(t);if(n)return!1;var r=e?iI.test(t):function(i){var s;for(Ty.lastIndex=0;s=Ty.exec(i);){var o=s[1],a=s[3];if(!(o&&a&&Iy.test(o)&&Iy.test(a)))return!0}return!1}(t);if(r)return!1}return!0}function Oy(t){var e=Na(t);return la(e=(e+" "+Kb(t)).trim())?e:""}function Kb(t){var e="";return t&&t.childNodes&&t.childNodes.length&&he(t.childNodes,function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var i=Na(n);e=(e+" "+i).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+Kb(n)).trim())}catch(s){D.error("[AutoCapture]",s)}}),e}function My(t){return t.replace(/"|\\"/g,'\\"')}function oI(t){var e=t.attr__class;if(e)return X(e)?e:Kv(e)}var Tl=Pe("[Dead Clicks]"),aI=()=>!0,lI=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(Bv)),r=t.instance.config.capture_dead_clicks;return It(r)?r:!!xe(r)||n};class Ay{get lazyLoadedDeadClicksAutocapture(){return this.bs}constructor(e,n,r){this.instance=e,this.isEnabled=n,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(e){if(e.ok){var n=e.config;"captureDeadClicks"in n&&(this.instance.persistence&&this.instance.persistence.register({[Bv]:n.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this._s(()=>{this.ws()}):this.stop()}_s(e){var n,r;(n=Q.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture?e():(r=Q.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",i=>{i?Tl.error("failed to load script",i):e()})}ws(){var e;if(j){if(!this.bs&&(e=Q.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=xe(this.instance.config.capture_dead_clicks)?N({},this.instance.config.capture_dead_clicks):{};n.__onCapture=this.onCapture,this.onCapture&&(n.capture_dead_swipes=!1),this.bs=Q.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.bs.start(j),Tl.info("starting...")}}else Tl.error("`document` not found. Cannot start.")}stop(){this.bs&&(this.bs.stop(),this.bs=void 0,Tl.info("stopping..."))}}var ef=Pe("[SegmentIntegration]"),Qb="posthog-js";function Yb(t,e){var n=e===void 0?{}:e,r=n.organization,i=n.projectId,s=n.prefix,o=n.severityAllowList,a=o===void 0?["error"]:o,l=n.sendExceptionsToPostHog,u=l===void 0||l;return c=>{var d,f,_,m,p;if(a!=="*"&&!a.includes(c.level)||!t.__loaded)return c;c.tags||(c.tags={});var y=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());c.tags["PostHog Person URL"]=y,t.sessionRecordingStarted()&&(c.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var h,v=((d=c.exception)==null?void 0:d.values)||[],x=v.map(E=>N({},E,{stacktrace:E.stacktrace?N({},E.stacktrace,{type:"raw",frames:(E.stacktrace.frames||[]).map(S=>N({},S,{platform:"web:javascript"}))}):void 0})),b={$exception_message:((f=v[0])==null?void 0:f.value)||c.message,$exception_type:(_=v[0])==null?void 0:_.type,$exception_level:c.level,$exception_list:x,$sentry_event_id:c.event_id,$sentry_exception:c.exception,$sentry_exception_message:((m=v[0])==null?void 0:m.value)||c.message,$sentry_exception_type:(p=v[0])==null?void 0:p.type,$sentry_tags:c.tags};return r&&i&&(b.$sentry_url=(s||"https://sentry.io/organizations/")+r+"/issues/?project="+i+"&query="+c.event_id),u&&((h=t.exceptions)==null||h.sendExceptionEvent(b)),c}}class uI{constructor(e,n,r,i,s,o){this.name=Qb,this.setupOnce=function(a){a(Yb(e,{organization:n,projectId:r,prefix:i,severityAllowList:s,sendExceptionsToPostHog:o==null||o}))}}}class Ny{constructor(e){this.ks=(n,r,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(D.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:i}),this.Ss=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.xs()}xs(){var e;this.Cs=(e=this._instance.sessionManager)==null?void 0:e.onSessionId(this.ks)}destroy(){var e;(e=this.Cs)==null||e.call(this),this.Cs=void 0}doPageView(e,n){var r,i=this.Ts(e,n);return this.Ss={pathname:(r=T==null?void 0:T.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),i}doPageLeave(e){var n;return this.Ts(e,(n=this.Ss)==null?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Ss)==null?void 0:e.pageViewId}}Ts(e,n){var r=this.Ss;if(!r)return{$pageview_id:n};var i={$pageview_id:n,$prev_pageview_id:r.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var o=s.maxScrollHeight,a=s.lastScrollY,l=s.maxScrollY,u=s.maxContentHeight,c=s.lastContentY,d=s.maxContentY;if(!(F(o)||F(a)||F(l)||F(u)||F(c)||F(d))){o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c),d=Math.ceil(d);var f=o>1?Ln(a/o,0,1,D):1,_=o>1?Ln(l/o,0,1,D):1,m=u>1?Ln(c/u,0,1,D):1,p=u>1?Ln(d/u,0,1,D):1;i=ge(i,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:f,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:_,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:m,$prev_pageview_max_content:d,$prev_pageview_max_content_percentage:p})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),i}}var tf=["flags","surveys"],cI={[Sb]:{exposure:"hidden"},[bs]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[Go]:{exposure:"hidden"},[Vh]:{exposure:"event"},[Bh]:{exposure:"hidden"},[qh]:{exposure:"event"},[Hh]:{exposure:"hidden"},[Wh]:{exposure:"event"},[Gh]:{exposure:"event"},[Bv]:{exposure:"event"},[qv]:{exposure:"hidden"},[Kh]:{exposure:"event"},[bi]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Es]:{exposure:"hidden"},[Hv]:{exposure:"event"},[Cb]:{exposure:"event",shouldSkipFromEventProperties:t=>et(t)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[Zn]:{exposure:"hidden",storageGroup:"flags"},[Ei]:{exposure:"hidden",storageGroup:"flags"},[iu]:{exposure:"hidden"},[Aa]:{exposure:"hidden",storageGroup:"flags"},[Si]:{exposure:"hidden",storageGroup:"flags"},[Ns]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Ju]:{exposure:"hidden",storageGroup:"flags"},[Pn]:{exposure:"hidden"},[gi]:{exposure:"hidden"},[fn]:{exposure:"hidden"},[Nn]:{exposure:"hidden"},[Qh]:{exposure:"hidden",storageGroup:"surveys"},[Zu]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[Yh]:{exposure:"event"},[su]:{exposure:"hidden"},[ou]:{exposure:"hidden"},[Ko]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[tr]:{exposure:"hidden"},[Qo]:{exposure:"hidden"},[Ib]:{exposure:"event"},[$s]:{exposure:"hidden"},[Ni]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[ie]:{exposure:"hidden"},[Xh]:{exposure:"hidden"},[Jh]:{exposure:"hidden"},[Zh]:{exposure:"hidden"},[ep]:{exposure:"hidden"},[ec]:{exposure:"hidden"},[tc]:{exposure:"hidden"},[kb]:{exposure:"event"},[Pb]:{exposure:"event"},[Rb]:{exposure:"event"},[Tb]:{exposure:"event"},[Mb]:{exposure:"event"},[Ab]:{exposure:"event"},[tp]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_pending_trigger_conditions:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},dI=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Rn=t=>{var e=cI[t];if(e)return e;for(var n of dI){var r=n[1];if(t.indexOf(n[0])===0)return r}},Ss=(t,e)=>{try{return JSON.stringify(t,(n,r)=>typeof r=="bigint"?r.toString():r,e)}catch{return qx(t)}},so=t=>{var e=j==null?void 0:j.createElement("a");return F(e)?null:(e.href=t,e)},oo=function(t,e){for(var n,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;r.length>i;i++){var s=r[i].split("=");if(s[0]===e){n=s;break}}if(!X(n)||2>n.length)return"";var o=n[1];try{o=decodeURIComponent(o)}catch{D.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},$a=function(t,e,n){if(!t||!e||!e.length)return t;for(var r=t.split("#"),i=r[1],s=(r[0]||"").split("?"),o=s[1],a=s[0],l=(o||"").split("&"),u=[],c=0;l.length>c;c++){var d=l[c].split("=");X(d)&&(e.includes(d[0])?u.push(d[0]+"="+n):u.push(l[c]))}var f=a;return o!=null&&(f+="?"+u.join("&")),i!=null&&(f+="#"+i),f},ac=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},Xb=(t,e)=>t>=e&&zx(),Jb=(t,e,n,r)=>{if(t===0){if(zx()){var i=e+1;return i===n&&r(),i}return e}return 0},Il="https?://(.*)",ao=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],fI=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...ao],Fa="",hI=["li_fat_id"];function Zb(t,e,n){if(!j)return{};var r,i=e?[...ao,...n||[]]:[],s=eE($a(j.URL,i,Fa),t),o=(r={},he(hI,function(a){var l=Nb(a);r[a]=l||null}),r);return ge(o,s)}function eE(t,e){var n=fI.concat(e||[]),r={};return he(n,function(i){var s=oo(t,i);r[i]=s||null}),r}function tE(t){var e=function(s){return s?s.search(Il+"google.([^/?]*)")===0?"google":s.search(Il+"bing.com")===0?"bing":s.search(Il+"yahoo.com")===0?"yahoo":s.search(Il+"duckduckgo.com")===0?"duckduckgo":null:null}(t),n=e!="yahoo"?"q":"p",r={};if(!et(e)){r.$search_engine=e;var i=j?oo(j.referrer,n):"";i.length&&(r.ph_keyword=i)}return r}function $y(){return navigator.language||navigator.userLanguage}var lc="$direct";function nE(){return(j==null?void 0:j.referrer)||lc}function rE(t,e,n){n===void 0&&(n=!1);var r=t?[...ao,...e||[]]:[],i=n?Zr(Ie==null?void 0:Ie.href):Ie==null?void 0:Ie.href,s=i==null?void 0:i.substring(0,1e3);return{r:nE().substring(0,1e3),u:s?$a(s,r,Fa):void 0}}function iE(t,e){var n;e===void 0&&(e=!1);var r=t.r,i=t.u,s=e?Zr(i):i,o={$referrer:r,$referring_domain:r==null?void 0:r==lc?lc:(n=so(r))==null?void 0:n.host};if(s){o.$current_url=s;var a=so(s);o.$host=a==null?void 0:a.host,o.$pathname=a==null?void 0:a.pathname;var l=eE(s);ge(o,l)}if(r){var u=tE(r);ge(o,u)}return o}function sE(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function pI(){try{return new Date().getTimezoneOffset()}catch{return}}var vI={flags:Ni,surveys:Zu},gI=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Ol=t=>t+"_cookie_identity_change_pending",br="main",Fy=(t,e)=>{he(t,(n,r)=>{var i=Rn(r);i&&i.exposure!=="event"||{}.hasOwnProperty.call(e,r)||delete t[r]})};class nf{constructor(e,n,r){if(r===void 0&&(r=!0),this.Ms={},this.Es=!1,this.Is=!1,this.Rs=!1,this.Ps=!1,this.qi=e,this.As=r,this.props={},this.Fs=void 0,this.Os=(s=>{var o="";return s.token&&(o=s.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),s.persistence_name?"ph_"+s.persistence_name:"ph_"+o+"_posthog"})(e),this.ps=this.Ls(e),this.Is=this.$s(e),this.load(),e.debug&&D.info("Persistence loaded",e.persistence,N({},this.props)),this.update_config(e,e,n),this.save(),T){var i=()=>this.flush();Ce(T,"beforeunload",i,{capture:!1}),Ce(T,"pagehide",i,{capture:!1})}}Ds(){var e,n=(e=this.qi)==null?void 0:e.persistence_save_debounce_ms;return qe(n)&&n>0?n:0}Ns(e){if(this.qi.cookieWinsOnConflict&&this.qi.persistence.toLowerCase()==="localstorage+cookie")if(e)try{var n=Jd(e,this.qi.cookie_persisted_properties||[]),r=xy(n,this.qi.cookie_persisted_properties||[]),i=JSON.stringify(n)+"|"+JSON.stringify(r),s=He.Pr(this.Os)||void 0;s&&Zd(this.Os,s)===i&&(this.qs=i,this.js=s)}catch{}else try{var o=He.Pr(this.Os)||void 0;this.qs=o?Zd(this.Os,o):void 0,this.js=o}catch{}}syncCookieProperties(){return this.Bs(this.qi)}Bs(e,n){if(n===void 0&&(n=!1),this.Hs&&!n||this.Ps||!e.cookieWinsOnConflict||e.persistence.toLowerCase()!=="localstorage+cookie")return!1;var r;try{r=He.Pr(this.Os)||void 0}catch{}if(!r||r===this.js)return!1;var i,s=Zd(this.Os,r);try{i=Xd(JSON.parse(r))}catch{return!1}if((He.Pr(this.Os)||void 0)!==r)return!1;this.qs=s,this.js=r;var o=by(this.Os,r),a=[...yi,...o.properties],l={};if(Object.keys(i).forEach(p=>{var y=i[p];(F(y)||et(y)||y===""||p===ie&&y!==Ve&&y!==it)&&(l[p]=!0,delete i[p])}),yn(i))return!1;var u=mt in i||i[ie]===Ve||i[ie]===it,c=this.props[mt],d=this.props[ie],f=ge({},this.props);[...yi,...e.cookie_persisted_properties||[]].forEach(p=>{if(a.indexOf(p)!==-1&&!(p in i)&&!l[p]&&(u||p!==mt&&p!==ie)){var y=f[p];!o.isValid&&yi.indexOf(p)!==-1&&(y===!1||y===0)||delete f[p]}}),this.props=ge(f,i),!u||ie in i||ie in this.props||this.Us(ie,Ve);var _=this.props[mt],m=this.props[ie];return!u||_===c&&m===d||(this.Rs=!0,me.Nr(Ol(this.Os),!0),this.zs(fn),this.zs(Ei),this.zs(Zn),this.zs(Aa),this.zs(Si),this.zs(Ns),this.zs(Ni),this.zs($s),this.zs(tr),m===Ve&&(d===it||i[ie]===Ve||!F(c)&&_!==c)&&(Fy(this.props,i),this.zs(Nn)),m===it?this.props.$user_id=_:delete this.props.$user_id,this.zs(bs)),!0}consumeCookieIdentityChange(){var e=Ol(this.Os),n=this.Rs||!!me.Pr(e);return this.Rs=!1,n&&me.qr(e),n}Ws(e){return e===void 0&&(e=!1),!(this.Ps||this.Hs&&!e||!this.qi.cookieWinsOnConflict||this.qi.persistence.toLowerCase()!=="localstorage+cookie"||(this.Ps=!0,0))}Vs(){this.Ps&&(F(this.Gs)||(clearTimeout(this.Gs),this.Gs=void 0),delete this.Ms[br],this.Zs(!0))}Qs(e){if(e===void 0&&(e=!0),this.Ps)try{e?this.Vs():F(this.Gs)||(clearTimeout(this.Gs),this.Gs=void 0)}finally{this.Ps=!1}}isDisabled(){return!!this.Hs}Ls(e){gI.indexOf(e.persistence.toLowerCase())===-1&&(D.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n,r=function(o,a){o===void 0&&(o=[]),a===void 0&&(a=!1);var l=[...yi,...o];return N({},pe,{Br(u){try{var c,d={};try{c=He.Pr(u)||void 0,d=c?Xd(JSON.parse(c)):{}}catch{}var f,_=JSON.parse(pe.Pr(u)||"{}");if(a){var m=by(u,c),p=[...yi,...m.properties],y={};Object.keys(d).forEach(E=>{var S=d[E];et(S)||S===""||E===ie&&S!==Ve&&S!==it||(y[E]=S)});var h=mt in y||y[ie]===Ve||y[ie]===it;if(Object.keys(y).length>0){var v,x=_[mt],b=(v=_[ie])!==null&&v!==void 0?v:Ve;l.forEach(E=>{if(p.indexOf(E)!==-1&&!(E in d)&&(h||E!==mt&&E!==ie)){var S=_[E];!m.isValid&&yi.indexOf(E)!==-1&&(S===!1||S===0)||delete _[E]}}),!h||ie in d||ie in _||(_[ie]=Ve),!h||(mt in y?y[mt]:_[mt])===x&&(ie in y?y[ie]:_[ie])===b||(Yd.forEach(E=>delete _[E]),y[ie]===it&&mt in y?_.$user_id=y[mt]:delete _.$user_id,y[ie]!==it&&(delete _[Ib],delete _[Nn]),delete _.__alias)}f=ge(_,y)}else f=ge(d,_);return pe.Nr(u,f),f}catch{}return null},Nr(u,c,d,f,_,m){var p=pe.Nr(u,c,void 0,void 0,m);try{var y=Jd(c,o);if(Object.keys(y).length){if(a){var h=sc(u),v=xy(y,o);if(He.Nr(h,v,d,f,_,m),He.Pr(h)!==JSON.stringify(v)){He.qr(h,f);var x=Jd(c);return He.Nr(u,x,d,f,_,m),p}}He.Nr(u,y,d,f,_,m)}}catch(b){pe.jr(b)}return p},qr(u,c){try{T==null||T.localStorage.removeItem(u),He.qr(u,c),He.qr(sc(u),c)}catch(d){pe.jr(d)}}})}(e.cookie_persisted_properties||[],e.cookieWinsOnConflict),i=!1,s=e.persistence.toLowerCase();return s==="localstorage"&&pe.Dr()?(n=pe,i=!0):s==="localstorage+cookie"&&r.Dr()?(n=r,i=!0):s==="sessionstorage"&&me.Dr()?n=me:s==="memory"?n=QT:s==="cookie"?n=He:r.Dr()?(n=r,i=!0):n=He,this.Es=i,n}Js(e){return this.Os+"__"+e}$s(e){return this.Es&&!!e.split_storage}properties(){var e={};return he(this.props,(n,r)=>{var i=Rn(r);if(!i||i.exposure==="event"){if(i!=null&&i.shouldSkipFromEventProperties!=null&&i.shouldSkipFromEventProperties(n))return;e[r]=n}}),e}load(e){if(e===void 0&&(e=!1),!this.Hs||e){var n=this.qi.cookieWinsOnConflict&&this.qi.persistence.toLowerCase()==="localstorage+cookie",r=n?pe.Br(this.Os):null,i={};if(n)try{he(i=Xd(He.Br(this.Os)),(m,p)=>{(F(m)||et(m)||m==="")&&delete i[p]})}catch{}var s=this.ps.Br(this.Os);if(s&&(this.props=ge({},s)),this.Is&&this.Ks(),n&&s){var o,a,l=r==null?void 0:r[mt],u=(o=r==null?void 0:r[ie])!==null&&o!==void 0?o:Ve,c=s[mt],d=(a=s[ie])!==null&&a!==void 0?a:Ve;if(c!==l||d!==u){this.Rs=!0,me.Nr(Ol(this.Os),!0);var f=ge({},this.props);Yd.forEach(m=>delete f[m]),d===Ve&&(u===it||i[ie]===Ve||!F(l)&&c!==l)&&(Fy(f,i),delete f[Nn]),this.props=f;var _=new Set;Yd.forEach(m=>{var p,y=(p=Rn(m))==null?void 0:p.storageGroup;y&&_.add(y)}),_.forEach(m=>{var p={};he(this.props,(y,h)=>{var v;((v=Rn(h))==null?void 0:v.storageGroup)===m&&(p[h]=y)}),yn(p)?(pe.qr(this.Js(m)),this.Ms[m]={}):pe.Nr(this.Js(m),p)&&(this.Ms[m]={persisted:!0,fingerprint:this.Ys(p,m)})})}}me.Pr(Ol(this.Os))&&(this.Rs=!0)}}Ks(){for(var e of tf){var n=pe.Br(this.Js(e));if(n&&!yn(n)){var r=this.Xs(e);r.persisted=!0,this.ta(e)||(r.fingerprint=this.Ys(n,e)),this.ea(e,n)||ge(this.props,n)}}}ta(e){return Object.keys(this.props).some(n=>{var r;return((r=Rn(n))==null?void 0:r.storageGroup)===e})}ea(e,n){var r=vI[e];if(!r)return!1;var i=n[r],s=this.props[r];return qe(i)&&qe(s)&&s>i}refreshKey(e){var n;if(!this.Hs){var r=this.Is?(n=Rn(e))==null?void 0:n.storageGroup:void 0,i=r?pe.Br(this.Js(r)):this.ps.Br(this.Os);if(i&&e in i)this.Us(e,i[e]);else{if(r){var s=this.ps.Br(this.Os);if(s&&e in s)return void this.Us(e,s[e])}this.zs(e)}}}save(){if(!this.Hs){var e=this.Ds();e>0?F(this.Gs)&&(this.Gs=setTimeout(()=>{this.Gs=void 0,this.Zs()},e)):this.Zs()}}flush(){F(this.Gs)||(clearTimeout(this.Gs),this.Gs=void 0,this.Zs())}Zs(e){e===void 0&&(e=!1),this.Hs||this.Ps&&!e||(e||this.syncCookieProperties(),this.Is?this.ia():this.ra(this.ps,this.Os,this.props,br)&&this.Ns(this.props))}ia(){var e=this.na(),n=e.main,r=e.groups;for(var i of(this.ra(this.ps,this.Os,n,br)&&this.Ns(n),tf)){var s,o=r[i];(!yn(o)||(s=this.Ms[i])!=null&&s.persisted)&&this.ra(pe,this.Js(i),o,i)}}na(){var e={},n={flags:{},surveys:{}};return he(this.props,(r,i)=>{var s,o=(s=Rn(i))==null?void 0:s.storageGroup;o?n[o][i]=r:e[i]=r}),{main:e,groups:n}}Ys(e,n){if(n===br)return JSON.stringify(e)+"|"+this.sa+"|"+this.aa+"|"+this.oa;var r={};return he(e,(i,s)=>{var o;r[s]=(o=Rn(s))!=null&&o.volatile?"__volatile__":i}),JSON.stringify(r)}ra(e,n,r,i){var s,o=this.Xs(i);if(i!==br&&!o.dirty&&!F(o.fingerprint))return!1;try{if((s=this.Ys(r,i))===o.fingerprint)return o.dirty=!1,!1}catch{s=void 0}return e.Nr(n,r,this.sa,this.aa,this.oa,this.qi.debug)?(o.dirty=!1,i!==br&&(o.persisted=!0),F(s)||(o.fingerprint=s),!0):(this.qi.debug&&D.warn('failed to persist storage entry "'+n+'"; will retry on next save'),!1)}remove(e){var n=(e===void 0?{}:e).keepGroupEntries,r=n!==void 0&&n;if(F(this.Gs)||(clearTimeout(this.Gs),this.Gs=void 0),this.ps.qr(this.Os,!1),this.ps.qr(this.Os,!0),!r&&this.As)for(var i of tf)pe.qr(this.Js(i));r?delete this.Ms[br]:this.Ms={},this.qs=void 0,this.js=void 0}clear(){this.remove(),this.props={}}register_once(e,n,r){if(xe(e)){this.syncCookieProperties(),F(n)&&(n="None"),this.sa=F(r)?this.la:r;var i=!1;if(he(e,(s,o)=>{this.props.hasOwnProperty(o)&&this.props[o]!==n||(this.Us(o,s),i=!0)}),i)return this.save(),!0}return!1}register(e,n){if(xe(e)){this.syncCookieProperties(),this.sa=F(n)?this.la:n;var r=!1;if(he(e,(i,s)=>{e.hasOwnProperty(s)&&(this.props[s]!==i||xe(i)||X(i))&&(this.Us(s,i),r=!0)}),r)return this.save(),!0}return!1}unregister(e){this.syncCookieProperties();var n=typeof e=="string"?[e]:e,r=!1;for(var i of n)i in this.props&&(this.zs(i),r=!0);r&&this.save()}update_campaign_params(){var e=j==null?void 0:j.URL;if(e!==this.Fs){var n=Zb(this.qi.custom_campaign_params,this.qi.mask_personal_data_properties,this.qi.custom_personal_data_properties);yn(Gv(n))||this.register(n),this.Fs=e}}update_search_keyword(){var e;this.register((e=j==null?void 0:j.referrer)?tE(e):{})}update_referrer_info(){var e;this.register_once({$referrer:nE(),$referring_domain:j!=null&&j.referrer&&((e=so(j.referrer))==null?void 0:e.host)||lc},void 0)}set_initial_person_info(){this.props[Zh]||this.props[ep]||this.register_once({[ec]:rE(this.qi.mask_personal_data_properties,this.qi.custom_personal_data_properties,this.qi.disable_capture_url_hashes)},void 0)}get_initial_props(){var e={};he([ep,Zh],i=>{var s=this.props[i];s&&he(s,function(o,a){e["$initial_"+Fh(a)]=o})});var n=this.props[ec];if(n){var r=function(i,s){s===void 0&&(s=!1);var o=iE(i,s),a={};return he(o,function(l,u){a["$initial_"+Fh(u)]=l}),a}(n,this.qi.disable_capture_url_hashes);ge(e,r)}return e}safe_merge(e){return he(this.props,function(n,r){r in e||(e[r]=n)}),e}update_config(e,n,r){var i=e.persistence!==n.persistence,s=!((p,y)=>{if(p.length!==y.length)return!1;var h=[...p].sort(),v=[...y].sort();return h.every((x,b)=>x===v[b])})(e.cookie_persisted_properties||[],n.cookie_persisted_properties||[]),o=i||s,a=e.cookieWinsOnConflict!==n.cookieWinsOnConflict,l=e.disable_persistence||!!r,u=!!this.Hs&&!l;l||this.Bs(n,u),this.qi=e,!l&&(i||s||a)&&(this.qs=void 0,this.js=void 0,this.Bs(N({},e,{cookie_persisted_properties:n.cookie_persisted_properties}),u));var c=o||a?this.Ls(e):this.ps,d=this.$s(e),f=o||d!==this.Is,_=!l&&(f||e.cross_subdomain_cookie!==this.aa||e.secure_cookie!==this.oa)&&this.Ws(u);try{if(this.la=this.sa=e.cookie_expiration,this.set_disabled(l),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),f){var m=this.props;this.clear(),this.ps=c,this.Is=d,this.props=m,this.save()}else a&&(this.ps=c,l||(delete this.Ms[br],this.Zs()))}finally{_&&this.Qs()}}set_disabled(e){this.Hs=e,this.Hs?this.remove():this.save()}set_cross_subdomain(e){e!==this.aa&&(this.aa=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.oa&&(this.oa=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,n){var r=this.props[Go]||{};r[e]=n,this.Us(Go,r),this.save()}remove_event_timer(e){var n=this.props[Go]||{},r=n[e];return F(r)||(delete n[e],this.Us(Go,n),this.save()),r}get_property(e){return this.props[e]}set_property(e,n){this.Us(e,n),this.save()}Us(e,n){var r;this.props[e]=n,(r=Rn(e))!=null&&r.volatile||this.ua(e)}zs(e){delete this.props[e],this.ua(e)}ua(e){var n,r=(n=Rn(e))==null?void 0:n.storageGroup;r&&(this.Xs(r).dirty=!0)}Xs(e){return this.Ms[e]||(this.Ms[e]={})}}function Ml(t){var e=!0;return{dispose(){if(e){e=!1;var n=t();n&&ft(n.then)&&n.then(void 0,()=>{})}}}}var _t={GZipJS:"gzip-js",Base64:"base64"},No={Activation:"events",Cancellation:"cancelEvents"},rf={Popover:"popover",API:"api",Widget:"widget"},rr={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},sf={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},ap={Popover:"popover",Inline:"inline"},mI={SHOWN:"product tour shown"},Ly={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},jy=Pe("[RateLimiter]");class yI{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var r=n.text;if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach(i=>{jy.info((i||"events")+" is quota limited."),this.serverLimits[i]=new Date().getTime()+6e4})}catch(i){return void jy.warn('could not rate limit - continuing. Error: "'+(i==null?void 0:i.message)+'"',{text:r})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)==null?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)==null?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var n,r,i;e===void 0&&(e=!1);var s=this.captureEventsBurstLimit,o=this.captureEventsPerSecond,a=new Date().getTime(),l=(n=(r=this.instance.persistence)==null?void 0:r.get_property(Jh))!==null&&n!==void 0?n:{tokens:s,last:a};l.tokens+=(a-l.last)/1e3*o,l.last=a,l.tokens>s&&(l.tokens=s);var u=1>l.tokens;if(u||e||(l.tokens=Math.max(0,l.tokens-1)),u&&!e){var c=(qe(l.dropped)?l.dropped:0)+1;l.dropped=c,!this.lastEventRateLimited&&this.ha(c)&&(l.dropped=0)}return this.lastEventRateLimited=u,(i=this.instance.persistence)==null||i.set_property(Jh,l),{isRateLimited:u,remainingTokens:l.tokens}}da(e){var n=this.instance.config.property_denylist;return!X(n)||!n.includes(e)}va(){var e;if(this.da("$current_url")&&this.da("$pathname")&&Ie!=null&&Ie.pathname)return""+((e=Ie.origin)!==null&&e!==void 0?e:"")+Ie.pathname}ha(e){var n,r,i=this.captureEventsBurstLimit,s=this.captureEventsPerSecond,o=this.va(),a=this.da("$session_id")?(n=(r=this.instance).get_session_id)==null?void 0:n.call(r):void 0,l=[e+" event(s) dropped since the last warning",o?"triggered on "+o:void 0,a?"session "+a:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+l+". Config is set to "+s+" events per second and "+i+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()e(this.remoteConfig)):e()}fa(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:e})}load(){try{if(this.remoteConfig)return Er.info("Using preloaded remote config",this.remoteConfig),this.pa(this.remoteConfig),void this.ga();if(this._instance.ma())return void Er.warn("Remote config is disabled. Falling back to local config.");this.ca(e=>{if(!e)return Er.info("No config found after loading remote JS config. Falling back to JSON."),void this.fa(n=>{this.pa(n.json,n),this.ga()});this.pa(e),this.ga()})}catch(e){Er.error("Error loading remote config",e),this.pa()}}stop(){this.ya&&(clearInterval(this.ya),this.ya=void 0)}refresh(){!this._instance.ma()&&j&&j.visibilityState!=="hidden"&&this._instance.reloadFeatureFlags()}ga(){var e;if(!this.ya){var n=(e=this._instance.config.remote_config_refresh_interval_ms)!==null&&e!==void 0?e:3e5;n!==0&&(this.ya=setInterval(()=>{this.refresh()},n))}}pa(e,n){!e&&n&&(n.statusCode===0?n.error||Er.warn("Failed to fetch remote config from PostHog."):Er.error("Failed to fetch remote config from PostHog."));try{this._instance.pa(e?{ok:!0,config:e}:{ok:!1})}catch(i){Er.error("Error applying remote config",i)}if((e==null?void 0:e.hasFeatureFlags)!==!1&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var r;(r=this._instance.featureFlags)==null||r.ensureFlagsLoaded()}catch(i){Er.error("Error loading feature flags",i)}}}var tn=Uint8Array,Mt=Uint16Array,lo=Uint32Array,Xv=new tn([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Jv=new tn([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Dy=new tn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),aE=function(t,e){for(var n=new Mt(31),r=0;31>r;++r)n[r]=e+=1<r;++r)for(var s=n[r];n[r+1]>s;++s)i[s]=s-n[r]<<5|r;return[n,i]},lE=aE(Xv,2),lp=lE[1];lE[0][28]=258,lp[258]=28;for(var zy=aE(Jv,0)[1],uE=new Mt(32768),Oe=0;32768>Oe;++Oe){var es=(43690&Oe)>>>1|(21845&Oe)<<1;uE[Oe]=((65280&(es=(61680&(es=(52428&es)>>>2|(13107&es)<<2))>>>4|(3855&es)<<4))>>>8|(255&es)<<8)>>>1}var ua=function(t,e,n){for(var r=t.length,i=0,s=new Mt(e);r>i;++i)++s[t[i]-1];var o,a=new Mt(e);for(i=0;e>i;++i)a[i]=a[i-1]+s[i-1]<<1;for(o=new Mt(r),i=0;r>i;++i)o[i]=uE[a[t[i]-1]++]>>>15-t[i];return o},zi=new tn(288);for(Oe=0;144>Oe;++Oe)zi[Oe]=8;for(Oe=144;256>Oe;++Oe)zi[Oe]=9;for(Oe=256;280>Oe;++Oe)zi[Oe]=7;for(Oe=280;288>Oe;++Oe)zi[Oe]=8;var uc=new tn(32);for(Oe=0;32>Oe;++Oe)uc[Oe]=5;var _I=ua(zi,9),wI=ua(uc,5),cE=function(t){return(t/8>>0)+(7&t&&1)},dE=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof Mt?Mt:t instanceof lo?lo:tn)(n-e);return r.set(t.subarray(e,n)),r},qn=function(t,e,n){var r=e/8>>0;t[r]|=n<<=7&e,t[r+1]|=n>>>8},$o=function(t,e,n){var r=e/8>>0;t[r]|=n<<=7&e,t[r+1]|=n>>>8,t[r+2]|=n>>>16},of=function(t,e){for(var n=[],r=0;t.length>r;++r)t[r]&&n.push({s:r,f:t[r]});var i=n.length,s=n.slice();if(!i)return[new tn(0),0];if(i==1){var o=new tn(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(E,S){return E.f-S.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],u=0,c=1,d=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=i-1;)a=n[n[d].f>n[u].f?u++:d++],l=n[u!=c&&n[d].f>n[u].f?u++:d++],n[c++]={s:-1,f:a.f+l.f,l:a,r:l};var f=s[0].s;for(r=1;i>r;++r)s[r].s>f&&(f=s[r].s);var _=new Mt(f+1),m=up(n[c-1],_,0);if(m>e){r=0;var p=0,y=m-e,h=1<r;++r){var v=s[r].s;if(e>=_[v])break;p+=h-(1<>>=y;p>0;){var x=s[r].s;e>_[x]?p-=1<=0&&p;--r){var b=s[r].s;_[b]==e&&(--_[b],++p)}m=e}return[new tn(_),m]},up=function(t,e,n){return t.s==-1?Math.max(up(t.l,e,n+1),up(t.r,e,n+1)):e[t.s]=n},Uy=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Mt(++e),r=0,i=t[0],s=1,o=function(l){n[r++]=l},a=1;e>=a;++a)if(t[a]==i&&a!=e)++s;else{if(!i&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(i),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(i);s=1,i=t[a]}return[n.subarray(0,r),e]},Fo=function(t,e){for(var n=0,r=0;e.length>r;++r)n+=t[r]*e[r];return n},cp=function(t,e,n){var r=n.length,i=cE(e+2);t[i]=255&r,t[i+1]=r>>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var s=0;r>s;++s)t[i+s+4]=n[s];return 8*(i+4+r)},Vy=function(t,e,n,r,i,s,o,a,l,u,c){qn(e,c++,n),++i[256];for(var d=of(i,15),f=d[0],_=d[1],m=of(s,15),p=m[0],y=m[1],h=Uy(f),v=h[0],x=h[1],b=Uy(p),E=b[0],S=b[1],k=new Mt(19),C=0;v.length>C;++C)k[31&v[C]]++;for(C=0;E.length>C;++C)k[31&E[C]]++;for(var R=of(k,7),P=R[0],$=R[1],O=19;O>4&&!P[Dy[O-1]];--O);var U,L,H,q,K=u+5<<3,I=Fo(i,zi)+Fo(s,uc)+o,M=Fo(i,f)+Fo(s,p)+o+14+3*O+Fo(k,P)+(2*k[16]+3*k[17]+7*k[18]);if(I>=K&&M>=K)return cp(e,c,t.subarray(l,l+u));if(qn(e,c,1+(I>M)),c+=2,I>M){U=ua(f,_),L=f,H=ua(p,y),q=p;var B=ua(P,$);for(qn(e,c,x-257),qn(e,c+5,S-1),qn(e,c+10,O-4),c+=14,C=0;O>C;++C)qn(e,c+3*C,P[Dy[C]]);c+=3*O;for(var G=[v,E],Z=0;2>Z;++Z){var se=G[Z];for(C=0;se.length>C;++C)qn(e,c,B[ce=31&se[C]]),c+=P[ce],ce>15&&(qn(e,c,se[C]>>>5&127),c+=se[C]>>>12)}}else U=_I,L=zi,H=wI,q=uc;for(C=0;a>C;++C)if(r[C]>255){var ce;$o(e,c,U[257+(ce=r[C]>>>18&31)]),c+=L[ce+257],ce>7&&(qn(e,c,r[C]>>>23&31),c+=Xv[ce]);var _e=31&r[C];$o(e,c,H[_e]),c+=q[_e],_e>3&&($o(e,c,r[C]>>>5&8191),c+=Jv[_e])}else $o(e,c,U[r[C]]),c+=L[r[C]];return $o(e,c,U[256]),c+L[256]},xI=new lo([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),bI=function(){for(var t=new lo(256),e=0;256>e;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t}(),af=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function EI(t,e){e===void 0&&(e={});var n=function(){var d=4294967295;return{p(f){for(var _=d,m=0;f.length>m;++m)_=bI[255&_^f[m]]^_>>>8;d=_},d(){return 4294967295^d}}}(),r=t.length;n.p(t);var i,s,o,a,l,u=(a=10+((i=e).filename&&i.filename.length+1||0),l=8,function(d,f,_,m,p,y){var h=d.length,v=new tn(m+h+5*(1+Math.floor(h/7e3))+p),x=v.subarray(m,v.length-p),b=0;if(!f||8>h)for(var E=0;h>=E;E+=65535){var S=E+65535;h>S?b=cp(x,b,d.subarray(E,S)):(x[E]=!0,b=cp(x,b,d.subarray(E,h)))}else{for(var k=xI[f-1],C=k>>>13,R=8191&k,P=(1<<_)-1,$=new Mt(32768),O=new Mt(P+1),U=Math.ceil(_/3),L=2*U,H=function(fd){return(d[fd]^d[fd+1]<E;++E){var ce=H(E),_e=32767&E,Se=O[ce];if($[_e]=Se,O[ce]=_e,E>=Z){var ze=h-E;if((M>7e3||G>24576)&&ze>423){b=Vy(d,x,0,q,K,I,B,G,se,E-se,b),G=M=B=0,se=E;for(var ve=0;286>ve;++ve)K[ve]=0;for(ve=0;30>ve;++ve)I[ve]=0}var Ae=2,kt=0,yr=R,gt=_e-Se&32767;if(ze>2&&ce==H(E-gt))for(var Ge=Math.min(C,ze)-1,ai=Math.min(32767,E),Yi=Math.min(258,ze);ai>=gt&&--yr&&_e!=Se;){if(d[E+Ae]==d[E+Ae-gt]){for(var Pt=0;Yi>Pt&&d[E+Pt]==d[E+Pt-gt];++Pt);if(Pt>Ae){if(Ae=Pt,kt=gt,Pt>Ge)break;var Xi=Math.min(gt,Pt-2),_r=0;for(ve=0;Xi>ve;++ve){var ln=E-gt+ve+32768&32767,bo=ln-$[ln]+32768&32767;bo>_r&&(_r=bo,Se=ln)}}}gt+=(_e=Se)-(Se=$[_e])+32768&32767}if(kt){q[G++]=268435456|lp[Ae]<<18|zy[kt];var jg=31&lp[Ae],Dg=31&zy[kt];B+=Xv[jg]+Jv[Dg],++K[257+jg],++I[Dg],Z=E+Ae,++M}else q[G++]=d[E],++K[d[E]]}}b=Vy(d,x,!0,q,K,I,B,G,se,E-se,b)}return dE(v,0,m+cE(b)+p)}(s=t,(o=e).level==null?6:o.level,o.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):12+o.mem,a,l)),c=u.length;return function(d,f){var _=f.filename;if(d[0]=31,d[1]=139,d[2]=8,d[8]=2>f.level?4:f.level==9?2:0,d[9]=3,f.mtime!=0&&af(d,4,Math.floor(new Date(f.mtime||Date.now())/1e3)),_){d[3]=8;for(var m=0;_.length>=m;++m)d[m+10]=_.charCodeAt(m)}}(u,e),af(u,c-8,n.d()),af(u,c-4,r),u}var SI=!!Mh||!!$v,fE="text/plain",lu=!1,hE=(t,e)=>{var n=t.split("#"),r=n[1],i=n[0].split("?"),s=i[0],o=i[1];if(!o)return t;var a=o.split("&").filter(l=>l.split("=")[0]!==e).join("&");return s+(a?"?"+a:"")+(r?"#"+r:"")},tl=function(t,e,n){var r;n===void 0&&(n=!0);var i=t.split("?"),s=i[0],o=i[1],a=N({},e),l=(r=o==null?void 0:o.split("&").map(c=>{var d,f=c.split("="),_=f[0],m=n&&(d=a[_])!==null&&d!==void 0?d:f[1];return delete a[_],_+"="+m}))!==null&&r!==void 0?r:[],u=function(c,d){var f,_;d===void 0&&(d="&");var m=[];return he(c,function(p,y){F(p)||F(y)||y==="undefined"||(f=encodeURIComponent((h=>h instanceof File)(p)?p.name:p.toString()),_=encodeURIComponent(y),m[m.length]=_+"="+f)}),m.join(d)}(a);return u&&l.push(u),l.length>0?s+"?"+l.join("&"):s},lf=t=>{if(t.ba)return t.ba;var e=t.data,n=t.compression;if(e){if(n===_t.GZipJS){var r=EI(function(a,l){var u=a.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(a);for(var c=new tn(a.length+(a.length>>>1)),d=0,f=function(y){c[d++]=y},_=0;u>_;++_){if(d+5>c.length){var m=new tn(d+8+(u-_<<1));m.set(c),c=m}var p=a.charCodeAt(_);128>p?f(p):2048>p?(f(192|p>>>6),f(128|63&p)):p>55295&&57344>p?(f(240|(p=65536+(1047552&p)|1023&a.charCodeAt(++_))>>>18),f(128|p>>>12&63),f(128|p>>>6&63),f(128|63&p)):(f(224|p>>>12),f(128|p>>>6&63),f(128|63&p))}return dE(c,0,d)}(Ss(e)),{mtime:0});return{contentType:fE,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===_t.Base64){var i=function(a){return a&&btoa(encodeURIComponent(a).replace(/%([0-9A-F]{2})/g,(l,u)=>String.fromCharCode(parseInt(u,16))))}(Ss(e)),s=(a=>"data="+encodeURIComponent(typeof a=="string"?a:Ss(a)))(i);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var o=Ss(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},pE=t=>{var e,n,r=()=>t.transport==="sendBeacon"?{url:tl(t.url,{compression:_t.Base64}),encodedBody:lf(N({},t,{compression:_t.Base64,ba:void 0}))}:{url:hE(t.url,"compression"),encodedBody:lf(N({},t,{compression:void 0,ba:void 0}))};try{e=lf(t)}catch(i){if(iy(t.compression,oo(t.url,"compression")))return D.error("Failed to gzip request body, sending uncompressed payload",i),r();throw i}return e&&iy(t.compression,oo(t.url,"compression"))&&!((n=e.body)instanceof ArrayBuffer?Ah(new Uint8Array(n)):ArrayBuffer.isView(n)&&Ah(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)))?(lu=!0,r()):{url:t.url,encodedBody:e}},vE=t=>{try{return pE(t)}catch(e){return D.error(e),void(t.callback==null||t.callback({statusCode:0,error:e}))}},CI=function(){var t=be(function*(e){var n=Ss(e.data),r=yield function(s,o,a){return Nh.apply(this,arguments)}(n,we.DEBUG,{rethrow:!0});if(!r)return e;var i=yield r.arrayBuffer();return N({},e,{ba:{contentType:fE,body:i,estimatedSize:i.byteLength}})});return function(e){return t.apply(this,arguments)}}(),kI=/Failed to fetch|NetworkError|Load failed/i,gE=t=>(t==null?void 0:t.name)==="TypeError"&&kI.test((t==null?void 0:t.message)||""),mE=t=>{var e=vE(t);if(e){var n=e.url,r=e.encodedBody,i=r??{},s=i.contentType,o=i.body,a=i.estimatedSize,l=new Headers;he(t.headers,function(m,p){l.append(p,m)}),s&&l.append("Content-Type",s);var u=null,c=!1;if(Jm){var d=new Jm;u={signal:d.signal,timeout:setTimeout(()=>{var m,p;c=!0,d.abort((m=t.timeout,(p=new Error("PostHog request timed out"+(m?" after "+m+"ms":""))).name="AbortError",p))},t.timeout)}}var f=m=>{c&&(m==null?void 0:m.name)==="AbortError"||gE(m)?D.warn(m):D.error(m),t.callback==null||t.callback({statusCode:0,error:m})};try{var _;$v(n,N({method:(t==null?void 0:t.method)||"GET",headers:l,keepalive:t.method==="POST"&&!t._a&&52428.8>(a||0),body:o,signal:(_=u)==null?void 0:_.signal},t.fetchOptions)).then(m=>m.text().then(p=>{var y={statusCode:m.status,text:p};if(m.status===200)try{y.json=JSON.parse(p)}catch(h){D.error(h)}t.callback==null||t.callback(y)})).catch(f).finally(()=>u?clearTimeout(u.timeout):null)}catch(m){u&&clearTimeout(u.timeout),f(m)}}},dp=t=>{try{var e,n=pE(t),r=n.url,i=n.encodedBody,s=i??{},o=s.body,a=s.estimatedSize;if(!o)return;var l=o instanceof Blob?o:new Blob([o],{type:s.contentType});if(xt.sendBeacon(r,l))return;var u=X(t.data)?t.data:(e=t.data)==null?void 0:e.batch;if(X(u)&&u.length>1&&(a??0)>16384){var c=Math.ceil(u.length/2),d=f=>X(t.data)?f:N({},t.data,{batch:f});return dp(N({},t,{data:d(u.slice(0,c))})),void dp(N({},t,{data:d(u.slice(c))}))}D.warn("Beacon of ~"+(a??0)+" bytes was rejected by the browser, falling back to fetch"),mE(N({},t,{_a:!0}))}catch(f){D.warn("Beacon send failed",f)}},By=(t,e,n,r)=>{var i=r==="query"?e==="POST"?"sent_at":"_":void 0;return tl(n===_t.GZipJS?hE(t,"compression"):t,N({},i?{[i]:Date.now().toString()}:{},n===_t.GZipJS?{}:{compression:n}))},uu=[];$v&&uu.push({transport:"fetch",method:mE}),Mh&&uu.push({transport:"XHR",method(t){var e=vE(t);if(e){var n=new Mh,r=e.encodedBody;n.open(t.method||"GET",e.url,!0);var i=r??{},s=i.contentType,o=i.body;he(t.headers,function(a,l){n.setRequestHeader(l,a)}),s&&n.setRequestHeader("Content-Type",s),t.timeout&&(n.timeout=t.timeout),n.onreadystatechange=()=>{if(n.readyState===4){var a={statusCode:n.status,text:n.responseText};if(n.status===200)try{a.json=JSON.parse(n.responseText)}catch{}t.callback==null||t.callback(a)}},n.send(o)}}}),xt!=null&&xt.sendBeacon&&uu.push({transport:"sendBeacon",method:dp});var fp=3e3;class PI{constructor(e,n){this.wa=!0,this.ka=[],this.Sa=Ln((n==null?void 0:n.flush_interval_ms)||fp,250,5e3,D.createLogger("flush interval"),fp),this.xa=e}enqueue(e){this.ka.push(e),this.Ca||this.Ta()}unload(){this.Ma();var e=this.ka.length>0?this.Ea():{},n=Object.values(e);[...n.filter(r=>r.url.indexOf("/e")===0),...n.filter(r=>r.url.indexOf("/e")!==0)].map(r=>{this.Ia(N({},r,{transport:"sendBeacon"}))})}enable(){this.wa=!1,this.Ta()}Ta(){var e=this;this.wa||(this.Ca=setTimeout(()=>{if(this.Ma(),this.ka.length>0){var n=this.Ea(),r=function(){var s=n[i],o=new Date().getTime();s.data&&X(s.data)&&he(s.data,a=>{a.offset=Math.abs(a.timestamp-o),delete a.timestamp}),e.Ia(s)};for(var i in n)r()}},this.Sa))}Ia(e){try{this.xa(e)}catch(n){D.error(n)}}Ma(){clearTimeout(this.Ca),this.Ca=void 0}Ea(){var e={};return he(this.ka,n=>{var r,i=n,s=(i?i.batchKey:null)||i.url;F(e[s])&&(e[s]=N({},i,{data:[]})),(r=e[s].data)==null||r.push(i.data)}),this.ka=[],e}}var RI=["retriesPerformedSoFar"];class TI{constructor(e){this.Ra=!1,this.Pa=3e3,this.ka=[],this._instance=e,this.ka=[],this.Aa=!0,!F(T)&&"onLine"in T.navigator&&(this.Aa=T.navigator.onLine,this.Fa=()=>{this.Aa=!0,this.Oa()},this.La=()=>{this.Aa=!1},Ce(T,"online",this.Fa),Ce(T,"offline",this.La))}get length(){return this.ka.length}retriableRequest(e){var n=e.retriesPerformedSoFar,r=Ux(e,RI);Gn(n)&&(r.url=tl(r.url,{retry_count:n})),this._instance._send_request(N({},r,{callback:i=>{if(i.statusCode!==200&&(400>i.statusCode||i.statusCode>=500)){if((i.statusCode===0?3:10)>(n??0))return void this.xn(N({retriesPerformedSoFar:n},r));i.statusCode===0&&D.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(n??0)+" retries.")}r.callback==null||r.callback(i)}}))}xn(e){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var r=function(o){var a=3e3*Math.pow(2,o),l=a/2,u=Math.min(18e5,a),c=Math.random()-.5;return Math.ceil(u+c*(u-l))}(n),i=Date.now()+r;this.ka.push({retryAt:i,requestOptions:e});var s="Enqueued failed request for retry in "+r;navigator.onLine||(s+=" (Browser is offline)"),D.warn(s),this.Ra||(this.Ra=!0,this.$a())}$a(){if(this.Da&&clearTimeout(this.Da),this.ka.length===0)return this.Ra=!1,void(this.Da=void 0);this.Da=setTimeout(()=>{this.Aa&&this.ka.length>0&&this.Oa(),this.$a()},this.Pa)}Oa(){var e=Date.now(),n=[],r=this.ka.filter(s=>e>s.retryAt||(n.push(s),!1));if(this.ka=n,r.length>0)for(var i of r)this.retriableRequest(i.requestOptions)}unload(){for(var e of(this.Da&&(clearTimeout(this.Da),this.Da=void 0),this.Ra=!1,F(T)||(this.Fa&&(T.removeEventListener("online",this.Fa),this.Fa=void 0),this.La&&(T.removeEventListener("offline",this.La),this.La=void 0)),this.ka)){var n=e.requestOptions;try{this._instance._send_request(N({},n,{transport:"sendBeacon"}))}catch(r){D.error(r)}}this.ka=[]}}class II{constructor(e){this.Na=()=>{var n,r,i,s;this.qa||(this.qa={});var o=this.scrollElement(),a=this.scrollY(),l=o?Math.max(0,o.scrollHeight-o.clientHeight):0,u=a+((o==null?void 0:o.clientHeight)||0),c=(o==null?void 0:o.scrollHeight)||0;this.qa.lastScrollY=Math.ceil(a),this.qa.maxScrollY=Math.max(a,(n=this.qa.maxScrollY)!==null&&n!==void 0?n:0),this.qa.maxScrollHeight=Math.max(l,(r=this.qa.maxScrollHeight)!==null&&r!==void 0?r:0),this.qa.lastContentY=u,this.qa.maxContentY=Math.max(u,(i=this.qa.maxContentY)!==null&&i!==void 0?i:0),this.qa.maxContentHeight=Math.max(c,(s=this.qa.maxContentHeight)!==null&&s!==void 0?s:0)},this._instance=e}get ja(){return this._instance.config.scroll_root_selector}getContext(){return this.qa}resetContext(){var e=this.qa;return setTimeout(this.Na,0),e}startMeasuringScrollPosition(){Ce(T,"scroll",this.Na,{capture:!0}),Ce(T,"scrollend",this.Na,{capture:!0}),Ce(T,"resize",this.Na)}scrollElement(){if(!this.ja)return T==null?void 0:T.document.documentElement;var e=X(this.ja)?this.ja:[this.ja];for(var n of e){var r=T==null?void 0:T.document.querySelector(n);if(r)return r}}Ba(e){var n=e==="y"?"scrollTop":"scrollLeft";if(this.ja){var r=this.scrollElement();return r&&r[n]||0}return T?e==="y"?T.scrollY||T.pageYOffset||T.document.documentElement.scrollTop||0:T.scrollX||T.pageXOffset||T.document.documentElement.scrollLeft||0:0}scrollY(){return this.Ba("y")}scrollX(){return this.Ba("x")}}var OI=t=>rE(t==null?void 0:t.config.mask_personal_data_properties,t==null?void 0:t.config.custom_personal_data_properties,t==null?void 0:t.config.disable_capture_url_hashes);class qy{constructor(e,n,r,i){this.ot=s=>{var o=this.Ha();if(!o||o.sessionId!==s){var a={sessionId:s,props:this.Ua(this._instance)};this.za.register({[Xh]:a})}},this._instance=e,this.Wa=n,this.za=r,this.Ua=i||OI,this.Wa.onSessionId(this.ot)}Ha(){return this.za.props[Xh]}getSetOnceProps(){var e,n=(e=this.Ha())==null?void 0:e.props;return n?"r"in n?iE(n,this._instance.config.disable_capture_url_hashes):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var e={};return he(Gv(this.getSetOnceProps()),(n,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+Fh(r)]=n}),e}}class cc{on(e,n){return this.Va[e]||(this.Va[e]=[]),this.Va[e].push(n),()=>{this.Va[e]=this.Va[e].filter(r=>r!==n)}}emit(e,n){for(var r of this.Va[e]||[])r(n);for(var i of this.Va["*"]||[])i(e,n)}constructor(){this.Va={}}}var ts=Pe("[SessionId]"),Hy=864e5;class Wy{on(e,n){return this.Ga.on(e,n)}constructor(e,n,r){var i;if(this.Za=null,this.Qa=null,this.Ja=[],this.Ka=void 0,this.Ya=!1,this.Ga=new cc,this.Xa=(l,u)=>!(!Gn(l)||!Gn(u))&&Math.abs(l-u)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===nr)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.qi=e.config,this.za=e.persistence,this.st=void 0,this._e=void 0,this._sessionStartTimestamp=null,this.eo=void 0,this._sessionActivityTimestamp=null,this.io=n||In,this.ro=r||In;var s=this.qi.persistence_name||this.qi.token;if(this._sessionTimeoutMs=1e3*Ln(this.qi.session_idle_timeout_seconds||1800,60,36e3,ts.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.no(),this.so="ph_"+s+"_window_id",this.ao="ph_"+s+"_primary_window_exists",this.oo()){var o=me.Br(this.so),a=me.Br(this.ao);o&&!a?this.st=o:me.qr(this.so),me.Nr(this.ao,!0)}(i=this.qi.bootstrap)!=null&&i.sessionID&&this.setBootstrapSessionId(this.qi.bootstrap.sessionID),this.lo()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return F(this.Ja)&&(this.Ja=[]),this.Ja.push(e),this._e&&e(this._e,this.st),()=>{this.Ja=this.Ja.filter(n=>n!==e)}}oo(){return this.qi.persistence!=="memory"&&!this.za.Hs&&me.Dr()}uo(e){e!==this.st&&(this.st=e,this.oo()&&me.Nr(this.so,e))}ho(){return this.st?this.st:this.oo()?me.Br(this.so):null}do(e){var n=this.Za;return!et(n)&&!et(e)&&5e3>Math.abs(e-n)}vo(e,n,r){var i=n!==this._sessionActivityTimestamp,s=!(e!==this._e||r!==this._sessionStartTimestamp);this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this._e=e,s&&!i||s&&this.do(n)||(this.Za=n,this.za.register({[Es]:[n,e,r]}))}co(){var e,n=(e=this.qi)==null?void 0:e.persistence_save_debounce_ms;return Gn(n)&&n>0}fo(){this.co()?this.za.refreshKey(Es):(this.za.flush(),this.za.load())}po(){var e;if(!et(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Za){this.fo();var n=this.mo();n[1]===this._e&&n[2]===this._sessionStartTimestamp&&(this.Za=this._sessionActivityTimestamp,this.za.register({[Es]:[this._sessionActivityTimestamp,(e=this._e)!==null&&e!==void 0?e:null,this._sessionStartTimestamp]}),this.za.flush())}}yo(){var e=this.mo()[0],n=Gn(e)?e:0,r=Gn(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(n,r)}bo(e){return this.fo(),this.Xa(e,this.yo())}mo(){var e=this.za.props[Es];return X(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Za=null,this.eo=void 0,clearTimeout(this._o),this._o=void 0,this.vo(null,null,null)}setBootstrapSessionId(e,n){n===void 0&&(n=!1);var r=function(i,s){s===void 0&&(s=new Date().getTime());try{var o=(a=>{var l=a.replace(/-/g,"");if(l.length!==32)throw new Error("Not a valid UUID");if(l[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(l.substring(0,12),16)})(i);return o>s+6e4?void ts.error("Bootstrap sessionID cannot be in the future"):o}catch(a){return void ts.error("Invalid sessionID in bootstrap",a)}}(e);return!F(r)&&(n?this.eo={sessionId:e,sessionStartTimestamp:r}:this.vo(e,new Date().getTime(),r),!0)}destroy(){this.Ya=!0,this.po(),clearTimeout(this._o),this._o=void 0,this.Ka&&T&&(T.removeEventListener(rc,this.Ka,{capture:!1}),this.Ka=void 0),this.Ja=[]}lo(){this.Ka=()=>{this.po(),this.oo()&&me.qr(this.ao)},Ce(T,rc,this.Ka,{capture:!1})}checkAndGetSessionAndWindowId(e,n,r){if(e===void 0&&(e=!1),n===void 0&&(n=null),r===void 0&&(r=!1),this.qi.cookieless_mode===nr)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=n||new Date().getTime(),s=this._e;if(r)this.Qa=i;else if(et(this.Qa)||this.Qa>i||i-this.Qa>=1e3){var o,a;(o=(a=this.za).syncCookieProperties)==null||o.call(a),this.Qa=i}var l=this.mo(),u=l[1],c=l[2],d=!F(s)&&u!==s,f=this.yo(),_=this.ho(),m=this.eo,p=!!m&&(m.sessionStartTimestamp>i+6e4||i-m.sessionStartTimestamp>Hy),y=m?p:Gn(c)&&Math.abs(i-c)>Hy,h=!1,v=d,x=!u||!!m,b=u,E=!x&&!e&&this.Xa(i,f);if(E){(E=this.bo(i))||ts.info("cross-tab refresh kept the session alive",{sessionId:u});var S=this.mo();u=S[1],c=S[2]}if(x||E||y){v=!1;var k=m&&!p;u=k?m.sessionId:this.io(),_=this.ro(),ts.info("new session ID assigned",{sessionId:u,windowId:_,bootstrapped:!!k,changeReason:{noSessionId:x,activityTimeout:E,sessionPastMaximumLength:y}}),c=k?m.sessionStartTimestamp:i,this.eo=void 0,h=!0}else _||(_=this.ro(),h=!0),(v=v||u!==b)&&(ts.info("adopted cross-tab session id",{sessionId:u,windowId:_}),h=!0);var C=Gn(f)&&e&&!y?f:i,R=Gn(c)?c:new Date().getTime();this.uo(_),this.vo(u,C,R),e||this.no();var P={noSessionId:x,activityTimeout:E,sessionPastMaximumLength:y,crossTabAdoption:v};return h&&this.Ja.forEach($=>$(u,_,P)),{sessionId:u,windowId:_,sessionStartTimestamp:R,changeReason:h?P:void 0,lastActivityTimestamp:f}}no(){this.Ya||(clearTimeout(this._o),this._o=setTimeout(()=>{if(!this.Ya)if(this.bo(new Date().getTime())){var e=this._e;this.resetSessionId(),this.Ga.emit("forcedIdleReset",{idleSessionId:e})}else this.no()},1.1*this.sessionTimeoutMs))}}var yE=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&oy(n,e))return!0;try{var r=t==null?void 0:t.userAgentData;if(r!=null&&r.brands&&r.brands.some(i=>oy(i==null?void 0:i.brand,e)))return!0}catch{}return!!t.webdriver};function _E(){return(_E=be(function*(){var t=xt==null?void 0:xt.userAgentData;if(t!=null&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),n=e==null?void 0:e.model;return ue(n)&&n.length>0?n:void 0}catch(r){return void D.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",r)}})).apply(this,arguments)}var dc=function(t,e){if(!function(n){try{new RegExp(n)}catch{return!1}return!0}(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}};function uf(t,e,n){return Ss({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var wE={exact:(t,e)=>e.some(n=>t.some(r=>n===r)),is_not:(t,e)=>e.every(n=>t.every(r=>n!==r)),regex:(t,e)=>e.some(n=>t.some(r=>dc(n,r))),not_regex:(t,e)=>e.every(n=>t.every(r=>!dc(n,r))),icontains:(t,e)=>e.map(Al).some(n=>t.map(Al).some(r=>n.includes(r))),not_icontains:(t,e)=>e.map(Al).every(n=>t.map(Al).every(r=>!n.includes(r))),gt:(t,e)=>e.some(n=>{var r=parseFloat(n);return!isNaN(r)&&t.some(i=>r>parseFloat(i))}),lt:(t,e)=>e.some(n=>{var r=parseFloat(n);return!isNaN(r)&&t.some(i=>rt.toLowerCase();function xE(t,e){return!t||Object.entries(t).every(n=>{var r=n[1],i=e==null?void 0:e[n[0]];if(F(i)||et(i))return!1;var s=[String(i)],o=wE[r.operator];return!!o&&o(r.values,s)})}var hp="custom",Gy="i.posthog.com",MI=/^\/static\//,AI=["/s/","/e/","/i/"];class NI{constructor(e){this.wo={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,n=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+Gy,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.wo[this.apiHost]||(this.wo[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":hp),this.wo[this.apiHost]}ko(e){if(MI.test(e)){var n=this.instance.config.asset_host;if(typeof n=="string")return n.trim().replace(/\/$/,"")||void 0}}So(e){var n=so(e);return n?n.protocol+"//"+n.host+n.pathname:void 0}xo(e,n,r){if(e==="ui")return r;var i=r,s=this.instance.config.rewriteRequestPath;if(s){var o,a=((o=so(r))==null?void 0:o.href)||r;i=s(new URL(a)).toString()}if(s&&e==="api"&&AI.some(f=>n.indexOf(f)===0)){var l=this.So(i);if(l){var u,c=this.apiHost,d=this.Co;((u=d)==null?void 0:u.apiHost)===c&&d.rewriteRequestPath===s||(d={apiHost:c,rewriteRequestPath:s,urls:new Set},this.Co=d),d.urls.add(l)}}return i}isIngestionEndpoint(e){var n=this.Co,r=this.So(e);return(n==null?void 0:n.apiHost)===this.apiHost&&n.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!r&&n.urls.has(r)}endpointFor(e,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),e==="ui")return this.xo(e,n,this.uiHost+n);if(e==="flags")return this.xo(e,n,this.flagsApiHost+n);if(e==="assets"){var r=this.ko(n);if(r)return this.xo(e,n,""+r+n)}if(this.region===hp)return this.xo(e,n,this.apiHost+n);var i=Gy+n;switch(e){case"assets":return this.xo(e,n,"https://"+this.region+"-assets."+i);case"api":return this.xo(e,n,"https://"+this.region+"."+i)}}}function bE(t){var e;return!((e=t.conditions)==null||(e=e.events)==null||(e=e.values)==null||!e.length)}var de=Pe("[Surveys]"),EE="seenSurvey_",SE=t=>{try{var e=(n=>((r,i)=>""+EE+function(s){return s.current_iteration&&s.current_iteration>0?s.id+"_"+s.current_iteration:s.id}(i))(0,n))(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(n){de.error("Failed to persist survey seen state",n)}},$I=[rf.Popover,rf.Widget,rf.API],FI={ignoreConditions:!1,ignoreDelay:!1,displayType:ap.Popover},LI=Pe("[PostHog ExternalIntegrations]"),jI={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class DI{constructor(e){this._instance=e}_s(e,n){var r;(r=Q.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,i=>{if(i)return LI.error("failed to load script",i);n()})}startIfEnabledOrStop(){var e=this,n=function(){var s,o,a,l=r[0],u=r[1];!u||(s=Q.__PosthogExtensions__)!=null&&(s=s.integrations)!=null&&s[l]||e._s(jI[l],()=>{var c;(c=Q.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[l])==null||c.start(e._instance)}),!u&&(o=Q.__PosthogExtensions__)!=null&&(o=o.integrations)!=null&&o[l]&&((a=Q.__PosthogExtensions__)==null||(a=a.integrations)==null||(a=a[l])==null||a.stop())};for(var r of Object.entries((i=this._instance.config.integrations)!==null&&i!==void 0?i:{})){var i;n()}}}class zI{constructor(e,n){this.I=e,this.ns=n,this.To=new Map,this.Xn=!1}add(e){var n=this;return be(function*(){if(n.Xn)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(n.To.has(e.name))throw new Error('Browser extension "'+e.name+'" is already registered');n.To.set(e.name,e);try{var r=e.setup(n.ns);r&&(yield r)}catch(s){var i=n.To.get(e.name)===e;i&&n.To.delete(e.name),n.I.error('Failed to set up browser extension "'+e.name+'"',s),i&&n.Mo(e)}})()}dispose(){if(!this.Xn){this.Xn=!0;var e=Array.from(this.To.values()).reverse();for(var n of(this.To.clear(),e))this.Mo(n)}}Mo(e){try{var n=e.dispose==null?void 0:e.dispose();n&&ft(n.then)&&n.then(void 0,r=>{this.I.error('Failed to dispose browser extension "'+e.name+'"',r)})}catch(r){this.I.error('Failed to dispose browser extension "'+e.name+'"',r)}}}class UI{constructor(e){this._instance=e}initialize(){}get(e){var n=this._instance.persistence;if(typeof e=="string")return n==null?void 0:n.get_property(e);var r={};for(var i of e){var s=n==null?void 0:n.get_property(i);F(s)||(r[i]=s)}return r}set(e,n){var r;(r=this._instance.persistence)==null||r.register(typeof e=="string"?{[e]:n}:e)}remove(e){var n;(n=this._instance.persistence)==null||n.unregister(e)}}var Ky="extensionsRemoteConfig";class VI{constructor(e){this.Xn=!1,this.instance=e,this.I=D,this.Eo=e.Io,this.kv=new UI(e),this.onEvent=n=>Ml(this.instance.on("eventCaptured",r=>{try{n({event:r.event,properties:r.properties})}catch(i){this.I.error("Browser extension event listener failed",i)}})),this.onRemoteConfig=n=>{if(this.Xn)return Ml(()=>{});var r=s=>{try{n(s)}catch(o){this.I.error("Browser extension remote config listener failed",o)}},i=this.instance.Ro.on(Ky,r);return this.Eo&&r(this.Eo),Ml(i)},this.Po=new zI(D.createLogger("[BrowserExtensions]"),this)}get logger(){return this.I}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var e;return(e=this.instance.get_property(Ma))!==null&&e!==void 0?e:this.distinctId}get deviceId(){var e=this.instance.get_property(Ma);return typeof e=="string"?e:void 0}get library(){return{name:we.LIB_NAME,version:we.LIB_VERSION}}get initialPersonProperties(){var e,n;return(e=(n=this.instance.persistence)==null?void 0:n.get_initial_props())!==null&&e!==void 0?e:{}}get groups(){return this.instance.getGroups()}get session(){try{var e,n,r,i,s=(e=this.instance.sessionManager)==null?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:(n=s==null?void 0:s.sessionId)!==null&&n!==void 0?n:"",windowId:(r=s==null?void 0:s.windowId)!==null&&r!==void 0?r:"",sessionStartTimestamp:(i=s==null?void 0:s.sessionStartTimestamp)!==null&&i!==void 0?i:0}}catch{return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get projectToken(){return this.instance.config.token}add(e){return this.Po.add(e)}capture(e,n,r){var i=this;return be(function*(){r?i.instance.capture(e,n,{timestamp:r.timestamp,uuid:r.uuid,$set:r.set,$set_once:r.setOnce}):i.instance.capture(e,n)})()}registerDynamicEventProperties(e){return Ml(this.instance.Ao(e))}handleRemoteConfig(e){this.Xn||(this.Eo=e,this.instance.Ro.emit(Ky,e))}sendRequest(e,n){var r=this;return be(function*(){var i;n===void 0&&(n={});var s=r.instance.requestRouter.endpointFor((i=n.target)!==null&&i!==void 0?i:"api",e),o={method:n.method,url:n.query?tl(s,n.query):s,data:n.body,headers:n.headers,timeout:n.timeoutMs,fireCallbackOnDrop:!0,transport:n.transport,compression:n.compression,timestampMode:n.sentAt};return n.transport==="sendBeacon"?(r.instance._send_request(o),{statusCode:202}):new Promise(a=>{o.callback=a,r.instance._send_request(o)})})()}dispose(){this.Xn||(this.Xn=!0,this.Po.dispose())}}var ca={},cf=0,da=()=>{},Qy='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Lo="Surveys module not available",Yy="sanitize_properties is deprecated. Use before_send instead",CE="Invalid value for property_denylist config: ",BI=["token","distinct_id",Ob],us="posthog",kE=!SI&&(Rt==null?void 0:Rt.indexOf("MSIE"))===-1&&(Rt==null?void 0:Rt.indexOf("Mozilla"))===-1,df=t=>{var e;return N({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:BT(j==null?void 0:j.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:da,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:Ie&&ue(Ie==null?void 0:Ie.search)&&Ie.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:(T==null||(e=T.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(n){D.error("Bad HTTP status: "+n.statusCode+" "+n.text)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:np,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:fp},error_tracking:{},_onCapture:da},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:tI,ignore_text_selection:!0}:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:n&&n>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:n&&n>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:n&&n>="2026-05-30"?250:0,split_storage:!(!n||"2026-05-30">n),detect_google_search_app:!(!n||"2026-05-30">n),disable_capture_url_hashes:!(!n||"2026-06-25">n),cookieWinsOnConflict:!(!n||n==="unset"||"2026-08-29">n)}))(t))},qI=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],Xy=t=>{var e={};for(var n of qI){var r=n[0],i=n[1];F(t[r])||(e[i]=t[r])}var s=ge({},e,t),o=t.__preview_external_dependency_versioned_paths;return F(o)||(F(t.strict_script_versioning)&&(s.strict_script_versioning=!!o),ue(o)&&F(t.asset_host)&&(s.asset_host=o)),X(t.property_blacklist)&&(F(t.property_denylist)?s.property_denylist=t.property_blacklist:X(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:D.error(CE+t.property_denylist)),s};class HI{constructor(){this.__forceAllowLocalhost=!1}get Fo(){return this.__forceAllowLocalhost}set Fo(e){D.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class Dt{Oo(e,n){if(e){var r=this.To.indexOf(e);r!==-1&&this.To.splice(r,1)}return this.To.push(n),n.initialize==null||n.initialize(),n}Lo(){return this.config.cookieless_mode===nr||this.config.cookieless_mode===mi&&this.consent.isRejected()}$o(){if(!this.Lo()&&this.get_distinct_id()===Zi){var e=this.persistence;if(e){this.Do()||e.load(!0);var n=this.get_distinct_id();if(!n||n===Zi){var r=this.config.get_device_id(In());this.register({distinct_id:r,$device_id:r}),e.set_property(ie,Ve)}this.No()}}}get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){var e;this.webPerformance=new HI,this.qo=!1,this.version=we.LIB_VERSION,this.jo=new Set,this.Bo="",this.Ro=new cc,this.To=[],this.Ho=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=df(),this.SentryIntegration=uI,this.sentryIntegration=r=>function(i,s){var o=Yb(i,s);return{name:Qb,processEvent:a=>o(a)}}(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Uo=!1,this.zo=null,this.Wo=null,this.Vo=null,this.scrollManager=new II(this),this.pageViewManager=new Ny(this),this.rateLimiter=new yI(this),this.requestRouter=new NI(this),this.consent=new YT(this),this.externalIntegrations=new DI(this);var n=(e=Dt.__defaultExtensionClasses)!==null&&e!==void 0?e:{};this.featureFlags=n.featureFlags&&new n.featureFlags(this),this.toolbar=n.toolbar&&new n.toolbar(this),this.surveys=n.surveys&&new n.surveys(this),this.conversations=n.conversations&&new n.conversations(this),this.logs=n.logs&&new n.logs(this),this.metrics=n.metrics&&new n.metrics(this),this.experiments=n.experiments&&new n.experiments(this),this.exceptions=n.exceptions&&new n.exceptions(this),this.people={set:(r,i,s)=>{var o=ue(r)?{[r]:i}:r;this.setPersonProperties(o),s==null||s({})},set_once:(r,i,s)=>{var o=ue(r)?{[r]:i}:r;this.setPersonProperties(void 0,o),s==null||s({})}},this.on("eventCaptured",r=>D.info('send "'+(r==null?void 0:r.event)+'"',r))}init(e,n,r){if(r&&r!==us){var i,s=(i=ca[r])!==null&&i!==void 0?i:new Dt;return s._init(e,n,r),ca[r]=s,ca[us][r]=s,s}return this._init(e,n,r)}_init(e,n,r){var i,s;n===void 0&&(n={});var o,a=ue(e)?e.trim():"";if(!a)return D.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return a!==((o=this.config)==null?void 0:o.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+a+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=df(n.defaults),n.debug=this.Go(n.debug),this.Zo=n,this.Qo=[],n.person_profiles?this.Wo=n.person_profiles:n.process_person&&(this.Wo=n.process_person);var l=df(n.defaults),u=Xy(n),c=ge({},l,u,{name:r,token:a});xe(l.rageclick)&&xe(u.rageclick)&&(c.rageclick=ge({},l.rageclick,u.rageclick)),xe(l.session_recording)&&xe(u.session_recording)&&(c.session_recording=ge({},l.session_recording,u.session_recording)),this.set_config(c),this.config.on_xhr_error&&D.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:_t.GZipJS;var d=this.Do();if(this.persistence=new nf(this.config,d),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new nf(N({},this.config,{persistence:"sessionStorage"}),d,!1),this.Bo="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties",this.config.persistence!=="memory"&&!d&&me.Dr()){var f=me.Br(this.Bo);X(f)&&f.forEach(S=>{ue(S)&&this.jo.add(S)})}else me.qr(this.Bo);var _=N({},this.persistence.props),m=N({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Jo=new PI(S=>this.Ko(S),this.config.request_queue_config),this.Yo=new TI(this),this.__request_queue=[];var p=this.Lo();if(p||(this.sessionManager=new Wy(this),this.sessionPropsManager=new qy(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((S,k,C)=>{(C!=null&&C.activityTimeout||C!=null&&C.sessionPastMaximumLength||C!=null&&C.crossTabAdoption)&&this.Xo()})),this.tl(),this.config.__preview_deferred_init_extensions?(D.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.el(p)},0)):(D.info("Initializing extensions synchronously"),this.el(p)),we.DEBUG=we.DEBUG||this.config.debug,we.DEBUG&&D.info("Starting in debug mode",{this:this,config:n,thisC:N({},this.config),p:_,s:m}),!this.config.identity_distinct_id||(i=n.bootstrap)!=null&&i.distinctID||(n.bootstrap=N({},n.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),((s=n.bootstrap)==null?void 0:s.distinctID)!==void 0){var y=n.bootstrap.distinctID,h=this.get_distinct_id(),v=this.persistence.get_property(ie);if(n.bootstrap.isIdentifiedID&&h!=null&&h!==y&&v===Ve)this.identify(y);else if(n.bootstrap.isIdentifiedID&&h!=null&&h!==y&&v===it)D.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var x=this.config.get_device_id(In()),b=n.bootstrap.isIdentifiedID?x:y;this.persistence.set_property(ie,n.bootstrap.isIdentifiedID?it:Ve),this.register({distinct_id:y,$device_id:b})}}if(p)this.register_once({distinct_id:Zi,$device_id:null},"");else if(!this.get_distinct_id()){var E=this.config.get_device_id(In());this.register_once({distinct_id:E,$device_id:E},""),this.persistence.set_property(ie,Ve)}return Ce(T,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),n.segment?function(S,k){var C=S.config.segment;if(!C)return k();(function(R,P){var $=R.config.segment;if(!$)return P();var O=L=>{var H=()=>L.anonymousId()||In();R.config.get_device_id=H,L.id()&&(R.register({distinct_id:L.id(),$device_id:H()}),R.persistence.set_property(ie,it)),P()},U=$.user();"then"in U&&ft(U.then)?U.then(O):O(U)})(S,()=>{C.register((R=>{typeof Promise<"u"&&Promise.resolve||ef.warn("This browser does not have Promise support, and can not use the segment integration");var P=($,O)=>{if(!O)return $;$.event.userId||$.event.anonymousId===R.get_distinct_id()||(ef.info("No userId set, resetting PostHog"),R.reset()),$.event.userId&&$.event.userId!==R.get_distinct_id()&&(ef.info("UserId set, identifying with PostHog"),R.identify($.event.userId));var U=R.calculateEventProperties(O,$.event.properties);return $.event.properties=Object.assign({},U,$.event.properties),$};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:$=>P($,$.event.event),page:$=>P($,ls),identify:$=>P($,Kd),screen:$=>P($,"$screen")}})(S)).then(()=>{k()})})}(this,()=>this.il()):this.il(),ft(this.config._onCapture)&&this.config._onCapture!==da&&(D.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",S=>this.config._onCapture(S.event,S))),this.config.ip&&D.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||function(){return _E.apply(this,arguments)}().then(S=>{S&&this.register({[Wd]:S})}).catch(da),this}rl(e){var n=e;return ue(n.name)&&ft(n.setup)}nl(e,n){this.rl(e)?n.push(()=>{this.sl().add(e).catch(da)}):this.To.push(e)}tl(){var e,n,r,i,s,o,a=(e=(n=this.config.__extensionClasses)==null?void 0:n.featureFlags)!==null&&e!==void 0?e:(r=Dt.__defaultExtensionClasses)==null?void 0:r.featureFlags;a&&(this.featureFlags&&this.featureFlags instanceof a||((i=this.al)==null||i.call(this),this.al=void 0,this.featureFlags=new a(this)),ft(this.featureFlags.onReloading)&&ft(this.featureFlags.setup)?this.al||(this.al=this.featureFlags.onReloading(()=>{this.Ro.emit("featureFlagsReloading",!0)}),this.sl().add(this.featureFlags)):(s=(o=this.featureFlags).initialize)==null||s.call(o))}el(e){var n,r,i,s,o,a,l,u=performance.now(),c=N({},Dt.__defaultExtensionClasses,this.config.__extensionClasses),d=[];c.exceptions&&this.To.push(this.exceptions=(n=this.exceptions)!==null&&n!==void 0?n:new c.exceptions(this)),c.historyAutocapture&&this.To.push(this.historyAutocapture=new c.historyAutocapture(this)),c.tracingHeaders&&this.To.push(this.tracingHeaders=new c.tracingHeaders(this)),c.siteApps&&this.To.push(this.siteApps=new c.siteApps(this)),c.sessionRecording&&!e&&this.To.push(this.sessionRecording=new c.sessionRecording(this)),this.config.disable_scroll_properties||d.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),c.autocapture&&this.nl(this.autocapture=new c.autocapture(this),d),c.surveys&&this.nl(this.surveys=(r=this.surveys)!==null&&r!==void 0?r:new c.surveys(this),d),c.logs&&this.To.push(this.logs=(i=this.logs)!==null&&i!==void 0?i:new c.logs(this)),c.metrics&&this.To.push(this.metrics=(s=this.metrics)!==null&&s!==void 0?s:new c.metrics(this)),c.conversations&&this.To.push(this.conversations=(o=this.conversations)!==null&&o!==void 0?o:new c.conversations(this)),c.productTours&&this.To.push(this.productTours=new c.productTours(this)),c.heatmaps&&this.To.push(this.heatmaps=new c.heatmaps(this)),c.webVitalsAutocapture&&this.To.push(this.webVitalsAutocapture=new c.webVitalsAutocapture(this)),c.exceptionObserver&&this.To.push(this.exceptionObserver=new c.exceptionObserver(this)),c.deadClicksAutocapture&&this.To.push(this.deadClicksAutocapture=new c.deadClicksAutocapture(this,lI)),c.toolbar&&this.To.push(this.toolbar=(a=this.toolbar)!==null&&a!==void 0?a:new c.toolbar(this)),c.experiments&&this.To.push(this.experiments=(l=this.experiments)!==null&&l!==void 0?l:new c.experiments(this)),this.To.forEach(f=>{f.initialize&&d.push(()=>{f.initialize==null||f.initialize()})}),d.push(()=>{if(this.ol){var f=this.ol;this.ol=void 0,this.To.forEach(_=>_.onRemoteConfig==null?void 0:_.onRemoteConfig(f))}}),this.ll(d,u)}ll(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout(()=>{this.ll(e,n)},0);var r=e.shift();if(r)try{r()}catch(s){D.error("Error initializing extension:",s)}}var i=Math.round(performance.now()-n);this.register_for_session({[Mb]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Ab]:i}),this.config.__preview_deferred_init_extensions&&D.info("PostHog extensions initialized ("+i+"ms)")}pa(e){var n;if(!j||!j.body)return D.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.pa(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.ol=e),this.Io=e,this.compression=void 0,e.ok){var r,i=e.config;i.supportedCompression&&!this.config.disable_compression&&(this.compression=Y(i.supportedCompression,_t.GZipJS)?_t.GZipJS:Y(i.supportedCompression,_t.Base64)?_t.Base64:void 0),(r=i.analytics)!=null&&r.endpoint&&(this.analyticsDefaultEndpoint=i.analytics.endpoint)}this.set_config({person_profiles:this.Wo?this.Wo:np}),(n=this.ul)==null||n.handleRemoteConfig(e),this.To.forEach(s=>s.onRemoteConfig==null?void 0:s.onRemoteConfig(e))}il(){try{this.config.loaded(this)}catch(r){D.critical("`loaded` function failed",r)}if(this.hl(),this.config.internal_or_test_user_hostname&&Ie!=null&&Ie.hostname){var e=Ie.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?e===n:n.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.Lo())&&this.dl()},1),this.vl=new oE(this),this.vl.load()}hl(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Jo)==null||e.enable())}_dom_loaded(){this.is_capturing()&&Pl(this.__request_queue,e=>this.Ko(e)),this.__request_queue=[],this.hl()}_handle_unload(){var e,n,r,i,s;(e=this.surveys)==null||e.handlePageUnload==null||e.handlePageUnload(),(n=this.metrics)==null||n.flush("sendBeacon"),this.config.request_batching?(this.cl()&&this.capture(Gd),(r=this.logs)==null||r.flushLogs("sendBeacon"),(i=this.Jo)==null||i.unload(),(s=this.Yo)==null||s.unload()):this.cl()&&this.capture(Gd,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?kE?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=N({},this.config.request_headers,e.headers),e.compression=e.compression==="best-available"?this.compression:e.compression,(F(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(n=>{var r,i,s,o=N({},n);o.timeout=o.timeout||6e4;var a,l,u,c,d,f=(r=o.transport)!==null&&r!==void 0?r:"fetch";f==="sendBeacon"&&F(o.compression)&&o.data&&(o.compression=_t.Base64),o.method==="POST"&&o.data&&(o.timestampMode==="capture-body"?o.data={api_key:(l=(d=(c=(X(a=o.data)?a:[a]).map(y=>N({},y,y.timestamp instanceof Date&&!isNaN(y.timestamp.getTime())?{timestamp:y.timestamp.toISOString()}:{})))[0])==null||(u=d.properties)==null?void 0:u.token)!==null&&l!==void 0?l:d==null?void 0:d.token,batch:c,sent_at:new Date().toISOString()}:o.timestampMode==="body"&&(o.data=function(y,h){return h===void 0&&(h=new Date().toISOString()),X(y)?y.map(v=>N({},v,{sent_at:h})):N({},y,{sent_at:h})}(o.data))),o.url=By(o.url,o.method,o.compression,o.timestampMode);var _=uu.filter(y=>!o.disableTransport||!y.transport||!o.disableTransport.includes(y.transport)),m=(i=(s=function(y,h){for(var v=0;y.length>v;v++)if(y[v].transport===f)return y[v]}(_))==null?void 0:s.method)!==null&&i!==void 0?i:_[0].method;if(!m)throw new Error("No available transport method");var p=y=>{try{m(y)}catch(h){gE(h)?D.warn(h):D.error(h),o.callback==null||o.callback({statusCode:0,error:h})}};f!=="sendBeacon"&&o.data&&o.compression===_t.GZipJS&&DR&&typeof Promise<"u"&&!lu?CI(o).then(y=>{p(y)}).catch(y=>{if(sy(y))return lu=!0,void p(N({},o,{compression:void 0,url:By(n.url,n.method,void 0,n.timestampMode)}));(h=>{if(!h||typeof h!="object")return!1;var v="name"in h?String(h.name):"";return sy(h)||v===Vx})(y)&&(lu=!0),p(o)}):m(o)})(N({},e,{callback:n=>{var r,i;this.rateLimiter.checkForLimiting(n),400>n.statusCode||(r=(i=this.config).on_request_error)==null||r.call(i,n),e.callback==null||e.callback(n)}}))):e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:0}))}Ko(e){this.Yo?this.Yo.retriableRequest(e):this._send_request(e)}_execute_array(e){cf++;try{var n,r=[],i=[],s=[];Pl(e,a=>{if(a)if(X(n=a[0]))s.push(a);else if(ft(a))try{a.call(this)}catch(l){D.error("Error executing queued PostHog call",a,l)}else X(a)&&n==="alias"?r.push(a):X(a)&&n.indexOf("capture")!==-1&&ft(this[n])?s.push(a):i.push(a)});var o=function(a,l){Pl(a,function(u){try{if(X(u[0])){var c=l;he(u,function(d){c=c[d[0]].apply(c,d.slice(1))})}else l[u[0]].apply(l,u.slice(1))}catch(d){D.error("Error executing queued PostHog call",u,d)}})};o(r,this),o(i,this),o(s,this)}finally{cf--}}push(e){if(cf>0&&X(e)&&ue(e[0])){var n=Dt.prototype[e[0]];ft(n)&&n.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,n,r){var i,s,o,a,l;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Jo){if(this.is_capturing())if(!F(e)&&ue(e)){this.$o();var u=!this.config.opt_out_useragent_filter&&this._is_bot();if(!u||this.config.__preview_capture_bot_pageviews){var c=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(c==null||!c.isRateLimited){n!=null&&n.$current_url&&!ue(n==null?void 0:n.$current_url)&&(D.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),e!=="$exception"||r!=null&&r.fl||D.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var d=new Date,f=(r==null?void 0:r.timestamp)||d,_=cy(r==null?void 0:r.uuid,In),m={uuid:_,event:e,properties:this.calculateEventProperties(e,n||{},f,_)};e===ls&&this.config.__preview_capture_bot_pageviews&&u&&(m.event="$bot_pageview",m.properties.$browser_type="bot"),c&&(m.properties.$lib_rate_limit_remaining_tokens=c.remainingTokens);var p=e==="$feature_flag_called"&&m.properties.$feature_flag_has_experiment===!1&&this.get_property(Ju)===!0;r!=null&&r.$set&&!p&&(m.$set=r==null?void 0:r.$set);var y=r==null?void 0:r.$unset;y&&(m.$unset=y);var h,v,x,b=p?void 0:this.pl(r==null?void 0:r.$set_once,e!==yy,e===Kd);if(b&&(m.$set_once=b),r!=null&&r._noTruncate||(s=this.config.properties_string_max_length,o=m,a=O=>ue(O)?O.slice(0,s):O,l=new Set,m=function O(U,L){if(U!==Object(U))return a?a(U):U;if(!l.has(U)){var H;if(l.add(U),X(U))H=[],Pl(U,K=>{H.push(O(K))});else{var q={};he(U,(K,I)=>{l.has(K)||(q[I]=O(K))}),H=q}return H}}(o)),m.timestamp=f,F(r==null?void 0:r.timestamp)||(m.properties.$event_time_override_provided=!0,m.properties.$event_time_override_system_time=d),p&&(m.properties=function(O,U){U===void 0&&(U=[]);var L={},H=q=>{O[q]!==void 0&&(L[q]=O[q])};return zR.forEach(H),U.forEach(H),L}(m.properties,BI)),e===rr.DISMISSED||e===rr.SENT){var E=n==null?void 0:n[sf.SURVEY_ID],S=n==null?void 0:n[sf.SURVEY_ITERATION];SE({id:E,current_iteration:S}),m.$set=N({},m.$set,{[(h={id:E,current_iteration:S},v=e===rr.SENT?"responded":"dismissed",x="$survey_"+v+"/"+h.id,h.current_iteration&&h.current_iteration>0&&(x="$survey_"+v+"/"+h.id+"/"+h.current_iteration),x)]:!0})}else e===rr.SHOWN&&(m.$set=N({},m.$set,{[sf.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===mI.SHOWN){var k=n==null?void 0:n[Ly.TOUR_TYPE];k&&(m.$set=N({},m.$set,{[Ly.TOUR_LAST_SEEN_DATE+"/"+k]:new Date().toISOString()}))}var C=N({},m.properties.$set,m.$set);if(yn(C)||this.setPersonPropertiesForFlags(C),!te(this.config.before_send)){var R=this.kn(m);if(!R)return;(m=R).uuid=cy(m.uuid,In)}this.Ro.emit("eventCaptured",m);var P=(i=r==null?void 0:r._url)!==null&&i!==void 0?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),$={method:"POST",url:P,data:m,compression:"best-available",timestampMode:(r==null?void 0:r._batchKey)==="recordings"||/\/s\/(?:\?|$)/.test(P)?"body":"capture-body",batchKey:r==null?void 0:r._batchKey,transport:r==null?void 0:r.transport};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.Ko($):this.Jo.enqueue($),m}D.critical("This capture call is ignored due to client rate limiting.")}}else D.error("No event name provided to posthog.capture")}else D.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",n=>e(n.event,n))}sl(){var e;return(e=this.ul)!==null&&e!==void 0?e:this.ul=new VI(this)}Ao(e){this.Ho.push(e);var n=!0;return()=>{if(n){n=!1;var r=this.Ho.indexOf(e);r!==-1&&this.Ho.splice(r,1)}}}gl(e){var n,r,i;return e===void 0&&(e=!0),!((n=this.persistence)==null||!n.consumeCookieIdentityChange())&&(this.Vo=null,this.persistence.get_property(ie)===Ve&&((i=this.sessionPersistence)==null||i.clear(),this.jo.clear(),this.ml()),(r=this.featureFlags)==null||r.reset(),e&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,n,r,i,s){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;this.persistence.syncCookieProperties(),this.gl();var o=s?void 0:this.persistence.remove_event_timer(e),a=N({},n);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.Lo()&&(a[Ob]=!0),e==="$snapshot"){var l=N({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!ue(a.distinct_id)&&!qe(a.distinct_id)||Uu(a.distinct_id))&&D.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,c=function(E,S,k,C){var R,P,$,O;if(C===void 0&&(C=!1),!Rt)return{};var U,L=E?[...ao,...S||[]]:[],H=function(Yi){for(var Pt=0;ly.length>Pt;Pt++){var Xi=ly[Pt],_r=Xi[1],ln=Xi[0].exec(Yi),bo=ln&&(ft(_r)?_r(ln,Yi):_r);if(bo)return bo}return["",""]}(Rt),q=H[0],K=H[1],I=(U=typeof navigator<"u"?navigator:void 0)!=null&&U.brave?{brave:!0}:{},M={};F(k)||(M.detectGoogleSearchApp=k);var B={},G=(R=navigator)==null||(R=R.userAgentData)==null?void 0:R.platform,Z=(P=navigator)==null?void 0:P.maxTouchPoints,se=T==null||($=T.screen)==null?void 0:$.width,ce=T==null||(O=T.screen)==null?void 0:O.height,_e=T==null?void 0:T.devicePixelRatio;F(G)||(B.userAgentDataPlatform=G),F(Z)||(B.maxTouchPoints=Z),F(se)||(B.screenWidth=se),F(ce)||(B.screenHeight=ce),F(_e)||(B.devicePixelRatio=_e);var Se,ze,ve,Ae,kt,yr,gt,Ge,ai=ge(Gv({$os:q,$os_version:K,$browser:vb(Rt,navigator.vendor,I,M),$device:uy(Rt),$device_type:(ze=Rt,ve=B,Ge=uy(ze),Ge===Xx||Ge===Yx||Ge==="Kobo"||Ge==="Kindle Fire"||Ge===cb?no:Ge===Ia||Ge===As||Ge===Oa||Ge===jh?"Console":Ge===Zx?"Wearable":Ge?qt:(ve==null?void 0:ve.userAgentDataPlatform)==="Android"&&((Ae=ve==null?void 0:ve.maxTouchPoints)!==null&&Ae!==void 0?Ae:0)>0?600>Math.min((kt=ve==null?void 0:ve.screenWidth)!==null&&kt!==void 0?kt:0,(yr=ve==null?void 0:ve.screenHeight)!==null&&yr!==void 0?yr:0)/((gt=ve==null?void 0:ve.devicePixelRatio)!==null&>!==void 0?gt:1)?qt:no:"Desktop"),$timezone:sE(),$timezone_offset:pI()}),{$current_url:$a(C?Zr(Ie==null?void 0:Ie.href):Ie==null?void 0:Ie.href,L,Fa),$host:Ie==null?void 0:Ie.host,$pathname:Ie==null?void 0:Ie.pathname,$raw_user_agent:Rt.length>1e3?Rt.substring(0,997)+"...":Rt,$browser_version:uT(Rt,navigator.vendor,I,M),$browser_language:$y(),$browser_language_prefix:(Se=$y(),typeof Se=="string"?Se.split("-")[0]:void 0),$screen_height:T==null?void 0:T.screen.height,$screen_width:T==null?void 0:T.screen.width,$viewport_height:T==null?void 0:T.innerHeight,$viewport_width:T==null?void 0:T.innerWidth,$lib:we.LIB_NAME,$lib_version:we.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return we.SDK_DIST_CHANNEL&&(ai.$sdk_dist_channel=we.SDK_DIST_CHANNEL),ai}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var d=this.sessionManager.checkAndGetSessionAndWindowId(s,r.getTime(),!0),f=d.windowId;a.$session_id=d.sessionId,a.$window_id=f}this.sessionPropsManager&&ge(a,this.sessionPropsManager.getSessionProps());try{var _;this.sessionRecording&&ge(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=(_=this.Yo)==null?void 0:_.length}catch(E){a.$sdk_debug_error_capturing_properties=String(E)}if(this.requestRouter.region===hp&&(a.$lib_custom_api_host=this.config.api_host),u=e!==ls||s?e!==Gd||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,i),a=ge(a,u),e===ls&&j&&(a.title=j.title),!F(o)){var m=r.getTime()-o;a.$duration=parseFloat((m/1e3).toFixed(3))}Rt&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser");var p=this.persistence.properties(),y=this.sessionPersistence.properties();he(["$referrer","$referring_domain"],E=>{E in p&&delete y[E]});var h={};if(this.Ho.length>0)for(var v of this.Ho.slice())try{ge(h,v())}catch(E){D.error("Failed to produce browser extension event properties",E)}(a=ge({},c,p,y,N({},h,a))).$is_identified=this._isIdentified(),X(this.config.property_denylist)?he(this.config.property_denylist,function(E){delete a[E]}):D.error(CE+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var x=this.config.sanitize_properties;x&&(D.error(Yy),a=x(a,e));var b=this.yl();return a.$process_person_profile=b,b&&!s&&this.bl("_calculate_event_properties"),a}pl(e,n,r){var i;if(n===void 0&&(n=!0),r===void 0&&(r=!1),!this.persistence||!this.yl()||this.qo&&!r)return e;var s=this.persistence.get_initial_props(),o=(i=this.sessionPropsManager)==null?void 0:i.getSetOnceProps(),a=ge({},s,o||{},e||{}),l=this.config.sanitize_properties;return l&&(D.error(Yy),a=l(a,"$set_once")),n&&(this.qo=!0),yn(a)?void 0:a}register(e,n){var r;(r=this.persistence)==null||r.register(e,n)}register_once(e,n,r){var i;(i=this.persistence)==null||i.register_once(e,n,r)}register_for_session(e){var n,r;(n=this.persistence)==null||n.syncCookieProperties(),this.gl(),(r=this.sessionPersistence)==null||r.register(e),Object.keys(e).forEach(i=>this.jo.add(i)),this.ml()}unregister(e){var n;(n=this.persistence)==null||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)==null||n.unregister(e),this.jo.delete(e),this.ml()}_l(e,n){this.register({[e]:n})}Xo(){this.jo.forEach(e=>{var n;(n=this.sessionPersistence)==null||n.unregister(e)}),this.jo.clear(),this.ml()}ml(){var e;if(this.Bo)if(this.config.persistence==="memory"||(e=this.sessionPersistence)!=null&&e.Hs||!me.Dr())me.qr(this.Bo);else{var n=[];this.jo.forEach(r=>n.push(r)),n.length>0?me.Nr(this.Bo,n):me.qr(this.Bo)}}getFeatureFlag(e,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n;return(n=this.featureFlags)==null?void 0:n.getFeatureFlagPayload(e)}getFeatureFlagResult(e,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlagResult(e,n)}getAllFeatureFlags(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.getAllFeatureFlags())!==null&&e!==void 0?e:[]}isFeatureEnabled(e,n){var r,i;return(r=(i=this.featureFlags)==null?void 0:i.isFeatureEnabled(e,n))!==null&&r!==void 0?r:n==null?void 0:n.defaultValue}reloadFeatureFlags(){var e;(e=this.featureFlags)==null||e.reloadFeatureFlags()}updateFlags(e,n,r){var i;(i=this.featureFlags)==null||i.updateFlags(e,n,r)}updateEarlyAccessFeatureEnrollment(e,n,r){var i;(i=this.featureFlags)==null||i.updateEarlyAccessFeatureEnrollment(e,n,r)}getEarlyAccessFeatures(e,n,r){var i;return n===void 0&&(n=!1),(i=this.featureFlags)==null?void 0:i.getEarlyAccessFeatures(e,n,r)}on(e,n){return this.Ro.on(e,n)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:Lo}),()=>{})}onSessionId(e){var n,r;return(n=(r=this.sessionManager)==null?void 0:r.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n){n===void 0&&(n=!1),this.surveys?this.surveys.getSurveys(e,n):e([],{isLoaded:!1,error:Lo})}getActiveMatchingSurveys(e,n){n===void 0&&(n=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,n):e([],{isLoaded:!1,error:Lo})}renderSurvey(e,n){var r;(r=this.surveys)==null||r.renderSurvey(e,n)}displaySurvey(e,n){var r;n===void 0&&(n=FI),(r=this.surveys)==null||r.displaySurvey(e,n)}cancelPendingSurvey(e){var n;(n=this.surveys)==null||n.cancelPendingSurvey(e)}canRenderSurvey(e){var n,r;return(n=(r=this.surveys)==null?void 0:r.canRenderSurvey(e))!==null&&n!==void 0?n:{visible:!1,disabledReason:Lo}}canRenderSurveyAsync(e,n){var r,i;return n===void 0&&(n=!1),(r=(i=this.surveys)==null?void 0:i.canRenderSurveyAsync(e,n))!==null&&r!==void 0?r:Promise.resolve({visible:!1,disabledReason:Lo})}wl(e){return!e||Uu(e)?(D.critical("Unique user id has not been set in posthog.identify"),!1):e===Zi?(D.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(D.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(e,n,r){if(!this.__loaded||!this.persistence)return D.uninitializedWarning("posthog.identify");if(qe(e)&&(e=e.toString(),D.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.wl(e)&&this.bl("posthog.identify")){this.$o();var i=this.get_distinct_id(),s=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==i,o=this.gl(!1),a=this.persistence.Ws(),l=!1;try{var u=this.get_distinct_id();this.register({$user_id:e}),this.get_property(Ma)||this.register_once({$had_persisted_distinct_id:!0,$device_id:u},""),e!==u&&e!==this.get_property(bs)&&(this.unregister(bs),this.register({distinct_id:e}));var c,d=(this.persistence.get_property(ie)||Ve)===Ve,f=e!==u,_=!f&&d;if(f&&d)this.persistence.set_property(ie,it),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Vs(),this.capture(Kd,{distinct_id:e,$anon_distinct_id:u},{$set:n||{},$set_once:r||{}}),this.Vo=uf(e,n,r),(c=this.featureFlags)==null||c.setAnonymousDistinctId(u);else if(_){this.persistence.set_property(ie,it);var m=n||{},p=r||{};this.setPersonPropertiesForFlags({$set:m,$set_once:p},!1),this.config.cookieWinsOnConflict&&this.persistence.Vs(),this.capture("$set",{$set:m,$set_once:p}),this.Vo=uf(e,n,r)}else(n||r)&&this.setPersonProperties(n,r);f||s||o?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(tr)):_&&(n||r)&&this.reloadFeatureFlags(),l=!0}finally{a&&this.persistence.Qs(l)}}}setPersonProperties(e,n){if((e||n)&&this.bl("posthog.setPersonProperties")){var r=uf(this.get_distinct_id(),e,n);this.Vo!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:n||{}},!0),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.Vo=r):D.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var n,r=(X(e)?e:[e]).filter(i=>ue(i)&&i.length>0);r.length!==0&&this.bl("posthog.unsetPersonProperties")&&((n=this.featureFlags)==null||n.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.Vo=null)}group(e,n,r){var i;if(e&&n){(i=this.persistence)==null||i.syncCookieProperties(),this.gl();var s=this.getGroups(),o=s[e]!==n;if(o&&this.resetGroupPropertiesForFlags(e),this.register({$groups:N({},s,{[e]:n})}),o||r){var a={$group_type:e,$group_key:n};r&&(a.$group_set=r),this.capture(yy,a)}r&&this.setGroupPropertiesForFlags({[e]:r}),o&&!r&&this.reloadFeatureFlags()}else D.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n){var r;n===void 0&&(n=!0),(r=this.featureFlags)==null||r.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(e){var n;e===void 0&&(e=!0),(n=this.featureFlags)==null||n.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,n){var r;n===void 0&&(n=!0),this.bl("posthog.setGroupPropertiesForFlags")&&((r=this.featureFlags)==null||r.setGroupPropertiesForFlags(e,n))}resetGroupPropertiesForFlags(e){var n;(n=this.featureFlags)==null||n.resetGroupPropertiesForFlags(e)}reset(e){var n=It(e)?e:e==null?void 0:e.resetDeviceID,r=It(e)||e==null?void 0:e.bootstrap;this.kl(n,!1,r)}kl(e,n,r){var i,s,o;if(n===void 0&&(n=!1),D.info("reset"),!this.__loaded)return D.uninitializedWarning("posthog.reset");var a=r==null?void 0:r.sessionID;this.config.bootstrap=r||((i=this.Zo)==null?void 0:i.bootstrap)||{},(s=this.featureFlags)==null||s.updateConfig==null||s.updateConfig(this.config,this.ma());var l=this.get_property(Ma),u=this.get_property(Wd),c=this.get_property(bi),d=this.is_capturing();this.consent.reset(),n||!d||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");var f=(o=this.persistence)==null||o.Ws==null?void 0:o.Ws(),_=!1;try{var m,p,y,h,v,x,b,E,S,k,C,R,P,$;if((m=this.persistence)==null||m.clear(),(p=this.sessionPersistence)==null||p.clear(),this.jo.clear(),this.ml(),F(c)||(C=this.persistence)==null||C.register({[bi]:c}),(y=this.surveys)==null||y.reset(),(h=this.vl)==null||h.stop(),(v=this.featureFlags)==null||v.reset(),(x=this.conversations)==null||x.reset(),(b=this.logs)==null||b.reset(),(E=this.metrics)==null||E.reset(),(S=this.persistence)==null||S.set_property(ie,Ve),(k=this.sessionManager)==null||k.resetSessionId(),this.Vo=null,this.config.cookieless_mode===nr)this.register_once({distinct_id:Zi,$device_id:null},"");else{var O=this.config.get_device_id(In());this.register_once({distinct_id:O,$device_id:e?O:l},""),e||F(u)||this.register({[Wd]:u})}if(this.register({$last_posthog_reset:new Date().toISOString()},1),r&&(r.distinctID===void 0||this.Lo()||(($=this.persistence)==null||$.set_property(ie,r.isIdentifiedID?it:Ve),this.register({distinct_id:r.distinctID})),(R=this.featureFlags)==null||R.initialize(),!(F(a)||(P=this.sessionManager)!=null&&P.setBootstrapSessionId(a,!0)))){var U=N({},r);delete U.sessionID,this.config.bootstrap=U}delete this.config.identity_distinct_id,delete this.config.identity_hash,_=!0}finally{var L;f&&((L=this.persistence)==null||L.Qs==null||L.Qs(_))}this.reloadFeatureFlags()}shutdown(e){var n=this;return be(function*(){var r,i,s,o,a,l;if(n.__loaded){(r=n.vl)==null||r.stop(),n.sl().dispose(),(i=n.sessionRecording)==null||i.dispose(),(s=n.logs)==null||s.flushLogs("sendBeacon"),(o=n.metrics)==null||o.flush("sendBeacon"),(a=n.Jo)==null||a.unload(),(l=n.Yo)==null||l.unload();try{var u;(u=n.featureFlags)==null||u.destroy()}catch(c){D.error("Error while destroying feature flags",c)}}else D.uninitializedWarning("posthog.shutdown")})()}setIdentity(e,n){var r;this.config.identity_distinct_id=e,this.config.identity_hash=n,this.alias(e),(r=this.conversations)==null||r.Sl()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,(e=this.conversations)==null||e.xl()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,n;return(e=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var n=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=n.sessionStartTimestamp,i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n.sessionId);if(e!=null&&e.withTimestamp&&r){var s,o=(s=e.timestampLookBack)!==null&&s!==void 0?s:10;if(!r)return i;i+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-o,0)}return i}alias(e,n){return e===this.get_property(Sb)?(D.critical("Attempting to create alias for existing People user - aborting."),-2):this.bl("posthog.alias")?(F(n)&&(n=this.get_distinct_id()),e!==n?(this._l(bs,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(D.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=N({},this.config);if(xe(e)){var r,i,s,o,a,l,u,c,d,f,_,m;ge(this.config,Xy(e));var p=this.Do();(r=this.persistence)==null||r.update_config(this.config,n,p),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new nf(N({},this.config,{persistence:"sessionStorage"}),p,!1);var y,h=this.Go(this.config.debug);It(h)&&(this.config.debug=h),It(this.config.debug)&&(this.config.debug?(we.DEBUG=!0,pe.Dr()&&pe.Nr("ph_debug",!0),D.info("set_config",{config:e,oldConfig:n,newConfig:N({},this.config)})):(we.DEBUG=!1,pe.Dr()&&pe.qr("ph_debug"))),(i=this.featureFlags)==null||i.updateConfig==null||i.updateConfig(this.config,this.ma()),(s=this.exceptionObserver)==null||s.onConfigChange(),(o=this.exceptions)==null||o.onConfigChange(),(a=this.sessionRecording)==null||a.startIfEnabledOrStop(),(l=this.tracingHeaders)==null||l.startIfEnabledOrStop(),(u=this.autocapture)==null||u.startIfEnabled(),(c=this.heatmaps)==null||c.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&((y=this.historyAutocapture)==null||y.startIfEnabledOrStop()),(d=this.exceptionObserver)==null||d.startIfEnabledOrStop(),(f=this.deadClicksAutocapture)==null||f.startIfEnabledOrStop(),(_=this.surveys)==null||_.loadIfEnabled(),this.No(),(m=this.externalIntegrations)==null||m.startIfEnabledOrStop()}}_overrideSDKInfo(e,n){we.LIB_NAME=e,we.LIB_VERSION=n}startSessionRecording(e){var n,r,i,s,o,a=e===!0,l={sampling:a||!(e==null||!e.sampling),linked_flag:a||!(e==null||!e.linked_flag),url_trigger:a||!(e==null||!e.url_trigger),event_trigger:a||!(e==null||!e.event_trigger)};Object.values(l).some(Boolean)&&((n=this.sessionManager)==null||n.checkAndGetSessionAndWindowId(),l.sampling&&((r=this.sessionRecording)==null||r.overrideSampling()),l.linked_flag&&((i=this.sessionRecording)==null||i.overrideLinkedFlag()),l.url_trigger&&((s=this.sessionRecording)==null||s.overrideTrigger("url")),l.event_trigger&&((o=this.sessionRecording)==null||o.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,n){if(this.exceptions){var r=new Error("PostHog syntheticException"),i=this.exceptions.buildProperties(e,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(N({},i,n))}}addExceptionStep(e,n){var r;(r=this.exceptions)==null||r.addExceptionStep(e,n)}captureLog(e){var n;(n=this.logs)==null||n.captureLog(e)}get logger(){var e,n;return(e=(n=this.logs)==null?void 0:n.logger)!==null&&e!==void 0?e:Dt.Cl}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var n,r;return(n=(r=this.toolbar)==null?void 0:r.loadToolbar(e))!==null&&n!==void 0&&n}get_property(e){var n;return(n=this.persistence)==null?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)==null?void 0:n.props[e]}toString(){var e,n=(e=this.config.name)!==null&&e!==void 0?e:us;return n!==us&&(n=us+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(ie))===it||((n=this.sessionPersistence)==null?void 0:n.get_property(ie))===it}yl(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles===np&&!this._isIdentified()&&yn(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[bs])&&((n=this.persistence)==null||(n=n.props)==null||!n[tc]))}cl(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&!!this.config.capture_pageview}createPersonProfile(){this.yl()||this.bl("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.bl("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}bl(e){return this.config.person_profiles==="never"?(D.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._l(tc,!0),!0)}Do(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==mi)}No(){var e,n,r,i,s=this.Do();return((e=this.persistence)==null?void 0:e.Hs)!==s&&((r=this.persistence)==null||r.set_disabled(s)),((n=this.sessionPersistence)==null?void 0:n.Hs)!==s&&((i=this.sessionPersistence)==null||i.set_disabled(s)),s&&(this.jo.clear(),this.ml()),s}opt_in_capturing(e){var n;if(this.config.cookieless_mode!==nr){if(this.Lo()){var r,i,s,o,a;this.kl(!0,!0),(r=this.sessionManager)==null||r.destroy(),(i=this.pageViewManager)==null||i.destroy(),this.sessionManager=new Wy(this),this.pageViewManager=new Ny(this),this.persistence&&(this.sessionPropsManager=new qy(this,this.sessionManager,this.persistence));var l,u=(s=(o=this.config.__extensionClasses)==null?void 0:o.sessionRecording)!==null&&s!==void 0?s:(a=Dt.__defaultExtensionClasses)==null?void 0:a.sessionRecording;u&&(this.sessionRecording=this.Oo(this.sessionRecording,new u(this)),this.Io&&((l=this.sessionRecording)==null||l.onRemoteConfig==null||l.onRemoteConfig(this.Io)))}var c,d;this.consent.optInOut(!0),this.No(),this.hl(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==mi&&((c=this.surveys)==null||c.loadIfEnabled()),(F(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((d=e==null?void 0:e.captureEventName)!==null&&d!==void 0?d:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.dl()}else D.warn(Qy)}opt_out_capturing(){var e,n,r;this.config.cookieless_mode!==nr?(this.config.cookieless_mode===mi&&this.consent.isOptedIn()&&this.kl(!0,!0),this.consent.optInOut(!1),this.No(),this.config.cookieless_mode===mi&&(this.register({distinct_id:Zi,$device_id:null}),(e=this.sessionRecording)==null||e.stopRecording(),this.sessionRecording=void 0,(n=this.sessionManager)==null||n.destroy(),(r=this.pageViewManager)==null||r.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.dl(),this.hl())):D.warn(Qy)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===1?"granted":e===0?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===nr||(this.config.cookieless_mode===mi?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.No()}_is_bot(){return xt?yE(xt,this.config.custom_blocked_useragents):void 0}dl(){j&&(j.visibilityState==="visible"?this.Uo||(this.Uo=!0,this.capture(ls,{title:j.title},{send_instantly:!0}),this.zo&&(j.removeEventListener(nc,this.zo),this.zo=null)):this.zo||(this.zo=this.dl.bind(this),Ce(j,nc,this.zo)))}debug(e){e===!1?(T==null||T.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(T==null||T.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}ma(){var e=this.Zo||{};return"advanced_disable_flags"in e?!!e.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(D.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):function(n,r,i,s,o){var a=r in n&&!te(n[r]),l=i in n&&!te(n[i]);return a?n[r]:!!l&&(o&&o.warn("Config field '"+i+"' is deprecated. Please use '"+r+"' instead. The old field will be removed in a future major version."),n[i])}(e,"advanced_disable_flags","advanced_disable_decide",0,D)}kn(e){var n;if(te(this.config.before_send))return e;var r=Object.keys((n=e.properties)!==null&&n!==void 0?n:{}).filter(XR),i=X(this.config.before_send)?this.config.before_send:[this.config.before_send],s=e;for(var o of i)try{if(s=o(s),te(s)){var a="Event '"+e.event+"' was rejected in beforeSend function";return YR(e.event)?D.warn(a+". This can cause unexpected behavior."):D.info(a),null}s.properties&&!yn(s.properties)||D.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}catch(u){return D.error("Error in beforeSend function for event '"+e.event+"':",u),null}for(var l of r)if(s.properties&&te(s.properties[l]))return D.warn("Event '"+e.event+"' had its '"+l+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return s}getPageViewId(){var e;return(e=this.pageViewManager.Ss)==null?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(r)})}Go(e){var n=It(e)&&!e,r=pe.Dr()&&pe.Pr("ph_debug")==="true";return!n&&(!!r||e)}}Dt.__defaultExtensionClasses={},Dt.Cl=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),function(t,e){for(var n=0;e.length>n;n++)t.prototype[e[n]]=UT(t.prototype[e[n]])}(Dt,["identify"]);class PE{constructor(e){this.disabled=e===!1;var n=xe(e)?e:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(e,n,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(n-i.y)r-i.timestamp){if(this.clicks.push({x:e,y:n,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:n,timestamp:r}];return!1}}var ff="$copy_autocapture",Nl=Pe("[AutoCapture]");function hf(t,e){return e.length>t?e.slice(0,t)+"...":e}function WI(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!ei(e));return e}function GI(t,e){var n,r,i=e.e,s=e.maskAllElementAttributes,o=e.maskAllText,a=e.elementAttributeIgnoreList,l=e.elementsChainAsString,u=e.disableCaptureUrlHashes;if(!ei(t))return{props:{}};for(var c=[t],d=new Set([t]),f=t;f.parentNode&&!Vt(f,"body")&&Ub>c.length;)if(zb(f.parentNode)){var _=f.parentNode.host;if(d.has(_))break;d.add(_),c.push(_),f=_}else{if(!ei(f.parentNode)||d.has(f.parentNode))break;d.add(f.parentNode),c.push(f.parentNode),f=f.parentNode}var m,p,y=[],h={},v=!1,x=!1;if(he(c,C=>{var R=op(C);if(Vt(C,"a")){var P=C.getAttribute("href");v=!!(R&&P&&la(P))&&(u?Zr(P):P)}Y(oc(C),"ph-no-capture")&&(x=!0),y.push(function(O,U,L,H,q){q===void 0&&(q=!1);var K=O.tagName.toLowerCase(),I={tag_name:K};Qv.indexOf(K)>-1&&!L&&(I.$el_text=K.toLowerCase()==="a"||K.toLowerCase()==="button"?hf(1024,Oy(O)):hf(1024,Na(O)));var M=oc(O);M.length>0&&(I.classes=M.filter(function(se){return se!==""})),he(O.attributes,function(se){var ce;if((!Gb(O)||["name","id","class","aria-label"].indexOf(se.name)!==-1)&&(H==null||!H.includes(se.name))&&!U&&la(se.value)&&(!ue(ce=se.name)||ce.substring(0,10)!=="_ngcontent"&&ce.substring(0,7)!=="_nghost")){var _e=se.value;se.name==="class"&&(_e=Kv(_e).join(" ")),I["attr__"+se.name]=hf(1024,se.name==="href"&&q?Zr(_e):_e)}});for(var B=1,G=1,Z=O;Z=WI(Z);)B++,Z.tagName===O.tagName&&G++;return I.nth_child=B,I.nth_of_type=G,I}(C,s,o,a,u));var $=function(O){if(!op(O))return{};var U={};return he(O.attributes,function(L){if(L.name&&L.name.indexOf("data-ph-capture-attribute")===0){var H=L.name.replace("data-ph-capture-attribute-",""),q=L.value;H&&q&&la(q)&&(U[H]=q)}}),U}(C);ge(h,$)}),x)return{props:{},explicitNoCapture:x};if(o||(y[0].$el_text=Vt(t,"a")||Vt(t,"button")?Oy(t):Na(t)),v){var b,E;y[0].attr__href=v;var S=(b=so(v))==null?void 0:b.host,k=T==null||(E=T.location)==null?void 0:E.host;S&&k&&S!==k&&(m=v)}return{props:ge({$event_type:i.type,$ce_version:1},l?{}:{$elements:y},{$elements_chain:(p=y,function(C){return C.map(R=>{var P,$,O="";if(R.tag_name&&(O+=R.tag_name),R.attr_class)for(var U of(R.attr_class.sort(),R.attr_class))O+="."+U.replace(/"/g,"");var L=N({},R.text?{text:R.text}:{},{"nth-child":(P=R.nth_child)!==null&&P!==void 0?P:0,"nth-of-type":($=R.nth_of_type)!==null&&$!==void 0?$:0},R.href?{href:R.href}:{},R.attr_id?{attr_id:R.attr_id}:{},R.attributes),H={};return au(L).sort((q,K)=>q[0].localeCompare(K[0])).forEach(q=>{var K=q[1];return H[My(q[0].toString())]=My(K.toString())}),(O+=":")+au(H).map(q=>q[0]+'="'+q[1]+'"').join("")}).join(";")}(function(C){return C.map(R=>{var P,$,O={text:(P=R.$el_text)==null?void 0:P.slice(0,400),tag_name:R.tag_name,href:($=R.attr__href)==null?void 0:$.slice(0,2048),attr_class:oI(R),attr_id:R.attr__id,nth_child:R.nth_child,nth_of_type:R.nth_of_type,attributes:{}};return au(R).filter(U=>U[0].indexOf("attr__")===0).forEach(U=>O.attributes[U[0]]=U[1]),O})}(p)))},(n=y[0])!=null&&n.$el_text?{$el_text:(r=y[0])==null?void 0:r.$el_text}:{},m&&i.type==="click"?{$external_click_url:m}:{},h)}}class KI{constructor(e){this.name="autocapture",this.Qn=!1,this.Jn=null,this.Kn=!1,this.Yn=!1,this.qi={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.Xn=!1,this.ts=e,this.ts.refresh(this.qi),this.rageclicks=new PE(this.qi.rageclick),this.es=null}setup(e){this.rs(),this.ns=e;var n=e.onRemoteConfig(this.onRemoteConfig.bind(this));this.Xn?n.dispose():(this.ss=n,this.startIfEnabled())}dispose(){var e;this.Xn||(this.Xn=!0,this.ns=void 0,(e=this.ss)==null||e.dispose(),this.ss=void 0,this.os())}ls(){return this.ts.refresh(this.qi),this.qi}rs(){var e,n;return this.ls(),this.qi.url_allowlist=(e=this.qi.url_allowlist)==null?void 0:e.map(r=>new RegExp(r)),this.qi.url_ignorelist=(n=this.qi.url_ignorelist)==null?void 0:n.map(r=>new RegExp(r)),this.qi}us(){if(this.isBrowserSupported()){if(T&&j){var e=this.hs=r=>{r=r||(T==null?void 0:T.event);try{this.ds(r)}catch(i){Nl.error("Failed to capture event",i)}};if(Ce(j,"submit",e,{capture:!0}),Ce(j,"change",e,{capture:!0}),Ce(j,"click",e,{capture:!0}),this.ls().capture_copied_text){var n=this.vs=r=>{r=r||(T==null?void 0:T.event);try{this.ds(r,ff)}catch(i){Nl.error("Failed to capture copy/cut event",i)}};Ce(j,"copy",n,{capture:!0}),Ce(j,"cut",n,{capture:!0})}}}else Nl.info("Disabling Automatic Event Collection because this browser is not supported")}os(){this.hs&&(j==null||j.removeEventListener("submit",this.hs,!0),j==null||j.removeEventListener("change",this.hs,!0),j==null||j.removeEventListener("click",this.hs,!0),this.hs=void 0),this.vs&&(j==null||j.removeEventListener("copy",this.vs,!0),j==null||j.removeEventListener("cut",this.vs,!0),this.vs=void 0),this.Qn=!1}startIfEnabled(){!this.Xn&&this.ns&&this.isEnabled&&!this.Qn&&(this.us(),this.Qn=!0)}onRemoteConfig(e){if(!this.Xn)if(this.Kn=!0,e.ok){var n=e.config;n.elementsChainAsString&&(this.Yn=n.elementsChainAsString);var r,i=n.autocapture_opt_out;It(i)&&((r=this.ns)==null||r.kv.set(Vh,i),this.Jn=i),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(e){this.es=e}getElementSelectors(e){var n,r=[];return(n=this.es)==null||n.forEach(i=>{var s=j==null?void 0:j.querySelectorAll(i);s==null||s.forEach(o=>{e===o&&r.push(i)})}),r}get isEnabled(){var e,n;if(this.Xn)return!1;var r=(e=this.ns)==null?void 0:e.kv.get(Vh),i=this.Jn,s=this.ls(),o=s.remoteRequestsDisabled&&!this.Kn;if(et(i)&&!It(r)&&!o)return!1;var a=(n=this.Jn)!==null&&n!==void 0?n:!!r;return!!s.enabled&&!a}ds(e,n){if(n===void 0&&(n="$autocapture"),this.isEnabled){var r=ip(e);Db(r)&&(r=r.parentNode||null);var i,s=this.rs();n==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&s.rageclick&&(i=this.rageclicks)!=null&&i.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&Hb(r,s.rageclick)&&this.ds(e,"$rageclick");var o=n===ff;if(r&&function(m,p,y,h,v,x){var b;if(!T||Yv(m)||y!=null&&y.url_allowlist&&!Sy(y.url_allowlist,x)||y!=null&&y.url_ignorelist&&Sy(y.url_ignorelist,x))return!1;if(y!=null&&y.dom_event_allowlist){var E=y.dom_event_allowlist;if(E&&!E.some($=>p.type===$))return!1}var S=Wb(m,h),k=S.parentIsUsefulElement,C=S.targetElementList;if(!function($,O){var U=O==null?void 0:O.element_allowlist;if(F(U))return!0;var L,H=function(K){if(U.some(I=>K.tagName.toLowerCase()===I))return{v:!0}};for(var q of $)if(L=H(q))return L.v;return!1}(C,y)||!sp(C,y==null?void 0:y.css_selector_allowlist)||sp(C,(b=y==null?void 0:y.css_selector_ignorelist)!==null&&b!==void 0?b:eI))return!1;try{var R=T.getComputedStyle(m);if(R&&R.getPropertyValue("cursor")==="pointer"&&p.type==="click")return!0}catch{}var P=m.tagName.toLowerCase();switch(P){case"html":return!1;case"form":return(v||["submit"]).indexOf(p.type)>=0;case"input":case"select":case"textarea":return(v||["change","click"]).indexOf(p.type)>=0;default:return k?(v||["click"]).indexOf(p.type)>=0:(v||["click"]).indexOf(p.type)>=0&&(Qv.indexOf(P)>-1||m.getAttribute("contenteditable")==="true")}}(r,e,s,o,o?["copy","cut"]:void 0,{config:{get_current_url:s.getCurrentUrl}})){var a,l=GI(r,{e,maskAllElementAttributes:s.maskAllElementAttributes,maskAllText:s.maskAllText,elementAttributeIgnoreList:s.element_attribute_ignorelist,elementsChainAsString:this.Yn,disableCaptureUrlHashes:s.disableCaptureUrlHashes}),u=l.props;if(l.explicitNoCapture)return!1;var c=this.getElementSelectors(r);if(c&&c.length>0&&(u.$element_selectors=c),n===ff){var d,f=Vb(T==null||(d=T.getSelection())==null?void 0:d.toString()),_=e.type||"clipboard";if(!f)return!1;u.$selected_content=f,u.$copy_type=_}return(a=this.ns)==null||a.capture(n,u).catch(m=>Nl.error("Failed to capture event",m)),!0}}}isBrowserSupported(){return ft(j==null?void 0:j.querySelectorAll)}}class QI{constructor(e){this._instance=e}refresh(e){var n=this._instance.config,r=xe(n.autocapture)?n.autocapture:void 0;e.enabled=!!n.autocapture,e.rageclick=n.rageclick,e.maskAllElementAttributes=n.mask_all_element_attributes,e.maskAllText=n.mask_all_text,e.disableCaptureUrlHashes=n.disable_capture_url_hashes,e.getCurrentUrl=n.get_current_url,e.remoteRequestsDisabled=this._instance.ma(),e.url_allowlist=r==null?void 0:r.url_allowlist,e.url_ignorelist=r==null?void 0:r.url_ignorelist,e.dom_event_allowlist=r==null?void 0:r.dom_event_allowlist,e.element_allowlist=r==null?void 0:r.element_allowlist,e.css_selector_allowlist=r==null?void 0:r.css_selector_allowlist,e.css_selector_ignorelist=r==null?void 0:r.css_selector_ignorelist,e.element_attribute_ignorelist=r==null?void 0:r.element_attribute_ignorelist,e.capture_copied_text=r==null?void 0:r.capture_copied_text}}var jo=Pe("[ExceptionAutocapture]"),Jy=()=>{},YI=Pe("[TracingHeaders]"),ui=Pe("[Web Vitals]"),Zy=9e5,e_="disabled",t_="lazy_loading",Do="awaiting_config",$l="missing_config";Pe("[SessionRecording]"),Pe("[SessionRecording]");var pp="[SessionRecording]",Hn=Pe(pp),XI=Pe("[Heatmaps]");function pf(t){return xe(t)&&"clientX"in t&&"clientY"in t&&qe(t.clientX)&&qe(t.clientY)}var Fl=Pe("[Product Tours]"),vf=t=>{var e;return!t.config.disable_product_tours&&!((e=t.persistence)==null||!e.get_property(qv))},JI=["$set_once","$set"],kn=Pe("[SiteApps]"),n_="Error while initializing PostHog app with config id ",RE=(t,e)=>t!=null&&t.then?t.then(e):e(t),ns="SDK is not enabled or survey functionality is not yet loaded",r_="Disabled. Not loading surveys.";class ZI{constructor(e,n){this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Tl=!1,this.Ml=[],this.El=null,this.Il=null,this.Xn=!1,this.Rl=new Set,this.onRemoteConfig=r=>{if(!this.Xn&&!this.qi.disableSurveys){if(!r.ok)return de.warn("Remote config unavailable. Not loading surveys.");var i=r.config.surveys;if(te(i))return de.warn("Flags not loaded yet. Not loading surveys.");this.Pl=It(i)?i:i.length>0,de.info("flags response received, isSurveysEnabled: "+this.Pl),this.loadIfEnabled()}},this.ts=e,this.Al=n}setup(e){if(!this.Xn)return this.Fl=e,RE(e.kv.initialize(),()=>{if(this.Fl===e&&!this.Xn){this.Fl=void 0,this.ns=e;var n=e.onRemoteConfig(this.onRemoteConfig);this.Xn?n.dispose():(this.ss=n,this.loadIfEnabled())}})}dispose(){var e,n,r;this.Xn||(this.Xn=!0,this.Fl=void 0,this.ns=void 0,(e=this.ss)==null||e.dispose(),this.ss=void 0,(n=this._surveyEventReceiver)==null||n.dispose(),this._surveyEventReceiver=null,(r=this._surveyManager)==null||r.dispose==null||r.dispose(),this._surveyManager=null,this.Ml=[],this.El=null,this.Rl.forEach(i=>clearTimeout(i)),this.Rl.clear())}get qi(){return this.ts.get()}initialize(){this.loadIfEnabled()}reset(){try{var e;(e=this._surveyEventReceiver)==null||e.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var n=[],r=0;rlocalStorage.removeItem(s))}catch{}}loadIfEnabled(){if(!this.Xn&&this.ns){var e=this.qi;if(!this._surveyManager)if(this.Tl)de.info("Already initializing surveys, skipping...");else if(e.disableSurveys)de.info(r_);else if(e.cookielessMode&&this.ts.isOptedOut())de.info("Not loading surveys in cookieless mode without consent.");else{var n=this.ts.getExtensions();if(n){if(!F(this.Pl)||e.advancedEnableSurveys){var r=this.Pl||e.advancedEnableSurveys;this.Tl=!0;try{var i=n.generateSurveys;if(i)return this.Ol(i,r),void(this.Tl=!1);var s=n.loadExternalDependency;if(!s)return this.Ll(Wv),void(this.Tl=!1);s(o=>{try{if(this.Xn)return;var a=this.ts.getExtensions();o||a==null||!a.generateSurveys?this.Ll("Could not load surveys script",o):this.Ol(a.generateSurveys,r)}finally{this.Tl=!1}})}catch(o){throw this.Tl=!1,this.Ll("Error initializing surveys",o),o}}}else de.error("PostHog Extensions not found.")}}}Ol(e,n){this.Xn||(this._surveyManager=e(n),this._surveyEventReceiver=this.ts.createEventReceiver(),de.info("Surveys loaded successfully"),this.$l({isLoaded:!0}))}Ll(e,n){de.error(e,n),this.$l({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Ml.push(e),this._surveyManager&&this.$l({isLoaded:!0}),()=>{this.Ml=this.Ml.filter(n=>n!==e)}}getSurveys(e,n){var r;n===void 0&&(n=!1);var i=(r=this.ns)!==null&&r!==void 0?r:this.Al;if(i&&!this.Xn){if(this.qi.disableSurveys)return de.info(r_),e([]);var s=i.kv.get(Qh);if(s&&!n)return e(s,{isLoaded:!0}),void(this.Dl()&&this.getSurveys(()=>{},!0));if(this.El)this.El.then(l=>{this.Xn||e(l.surveys,l.context)}).catch(l=>de.error("Error in survey callback",l));else{var o=this.Nl("/api/surveys/",{method:"GET",query:{token:i.projectToken},sentAt:"query",timeoutMs:this.qi.requestTimeoutMs}).then(l=>{try{return this.ql(i,l)}catch(u){return de.error("Error processing surveys response",u),this.ql(i,{statusCode:0,error:u})}},l=>this.ql(i,{statusCode:0,error:l}));this.El=o;var a=()=>{this.El===o&&(this.El=null)};o.then(l=>{a(),this.Xn||e(l.surveys,l.context)},a).catch(l=>de.error("Error in survey callback",l))}}}Nl(e,n){var r=this.ns;return r?r.sendRequest(e,n):new Promise(i=>i({statusCode:0,error:new Error(ns)}))}ql(e,n){if(this.Xn)return{surveys:[],context:{isLoaded:!1,error:ns}};var r=n.statusCode;if(r!==200||!n.json){var i="Surveys API could not be loaded, status: "+r;return r!==0?de.error(i):n.error||de.warn(i),this.Il=Date.now(),{surveys:[],context:{isLoaded:!1,error:i}}}this.Il=null;var s,o=n.json.surveys||[],a=o.filter(l=>function(u){return!(!u.start_date||u.end_date)}(l)&&(bE(l)||function(u){var c;return!((c=u.conditions)==null||(c=c.actions)==null||(c=c.values)==null||!c.length)}(l)));return a.length>0&&((s=this._surveyEventReceiver)==null||s.register(a)),e.kv.set({[Qh]:o,[Zu]:Date.now()}),{surveys:o,context:{isLoaded:!0}}}Dl(){return this.jl()&&!this.El&&!this.Bl()}jl(){var e,n,r=(e=(n=this.ns)!==null&&n!==void 0?n:this.Al)==null?void 0:e.kv.get(Zu);return qe(r)&&Date.now()-r>3e5}Bl(){return qe(this.Il)&&3e5>Date.now()-this.Il}markSurveyAsSeen(e,n){var r,i={id:e,current_iteration:(r=n==null?void 0:n.iteration)!==null&&r!==void 0?r:null};SE(i);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}}$l(e){for(var n of this.Ml)try{if(!e.isLoaded)return n([],e);this.getSurveys(n)}catch(r){de.error("Error in survey callback",r)}}getActiveMatchingSurveys(e,n){if(n===void 0&&(n=!1),!te(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,n);de.warn("init was not called")}Hl(e){var n=null;return this.getSurveys(r=>{var i;n=(i=r.find(s=>s.id===e))!==null&&i!==void 0?i:null}),n}Ul(e){if(te(this._surveyManager))return{eligible:!1,reason:ns};var n=typeof e=="string"?this.Hl(e):e;return n?this._surveyManager.checkSurveyEligibility(n):{eligible:!1,reason:"Survey not found"}}zl(e){if(te(this._surveyManager))return{eligible:!1,reason:ns};var n=typeof e=="string"?this.Hl(e):e;return n?this._surveyManager.checkSurveyRenderability(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(te(this._surveyManager))return de.warn("init was not called"),{visible:!1,disabledReason:ns};var n=this.zl(e);return{visible:n.eligible,disabledReason:n.reason}}canRenderSurveyAsync(e,n){return te(this._surveyManager)?(de.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:ns})):new Promise(r=>{this.getSurveys(i=>{var s,o=(s=i.find(l=>l.id===e))!==null&&s!==void 0?s:null;if(o){var a=this.zl(o);r({visible:a.eligible,disabledReason:a.reason})}else r({visible:!1,disabledReason:"Survey not found"})},n)})}renderSurvey(e,n,r){var i;if(te(this._surveyManager))de.warn("init was not called");else{var s=typeof e=="string"?this.Hl(e):e;if(s!=null&&s.id)if($I.includes(s.type)){var o=j==null?void 0:j.querySelector(n);if(o)if((i=s.appearance)!=null&&i.surveyPopupDelaySeconds){de.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds");var a=setTimeout(()=>{var l,u;this.Rl.delete(a),this.Xn||(de.info("Rendering survey "+s.id+" with delay of "+((l=s.appearance)==null?void 0:l.surveyPopupDelaySeconds)+" seconds"),(u=this._surveyManager)==null||u.renderSurvey(s,o,r),de.info("Survey "+s.id+" rendered"))},1e3*s.appearance.surveyPopupDelaySeconds);this.Rl.add(a)}else this._surveyManager.renderSurvey(s,o,r);else de.warn("Survey element not found")}else de.warn("Surveys of type "+s.type+" cannot be rendered in the app");else de.warn("Survey not found")}}displaySurvey(e,n){var r;if(te(this._surveyManager))de.warn("init was not called");else{var i=this.Hl(e);if(i){var s=i;if((r=i.appearance)!=null&&r.surveyPopupDelaySeconds&&n.ignoreDelay&&(s=N({},i,{appearance:N({},i.appearance,{surveyPopupDelaySeconds:0})})),n.displayType!==ap.Popover&&n.initialResponses&&de.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),n.ignoreConditions===!1){var o=this.Ul(i);if(!o.eligible)return void de.warn("Survey is not eligible to be displayed: ",o.reason)}n.displayType!==ap.Inline?this._surveyManager.handlePopoverSurvey(s,n):this.renderSurvey(s,n.selector,n.properties)}else de.warn("Survey not found")}}cancelPendingSurvey(e){te(this._surveyManager)?de.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;(e=this._surveyManager)==null||e.handlePageUnload==null||e.handlePageUnload()}}function rs(t,e,n){if(te(t))return!1;switch(n){case"exact":return t===e;case"contains":var r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}class eO{constructor(e){this.Wl=new Set,this.Vl=new Set,this.Gl=new cc,this.Zl=(n,r)=>this.Ql(n,r)&&this.Jl(n,r)&&this.Kl(n,r)&&this.Yl(n,r),this.Ql=(n,r)=>r==null||!r.event||(n==null?void 0:n.event)===(r==null?void 0:r.event),this._instance=e}init(){var e,n;F((e=this._instance)==null?void 0:e._addCaptureHook)||(this.Xl=(n=this._instance)==null?void 0:n._addCaptureHook((r,i)=>{this.on(r,i)}))}dispose(){var e;(e=this.Xl)==null||e.call(this),this.Xl=void 0,this.Gl=new cc}register(e){var n,r;if(!F((n=this._instance)==null?void 0:n._addCaptureHook)&&(e.forEach(s=>{var o;this.Wl.add(s),(o=s.steps)==null||o.forEach(a=>{this.Vl.add((a==null?void 0:a.event)||"")})}),(r=this._instance)!=null&&r.autocapture)){var i=new Set;this.Wl.forEach(s=>{var o;(o=s.steps)==null||o.forEach(a=>{a!=null&&a.selector&&i.add(a.selector)})}),this._instance.autocapture.setElementSelectors(i)}}replace(e){this.Wl.clear(),this.Vl.clear(),this.register(e)}on(e,n){n!=null&&e.length!=0&&(this.Vl.has(e)||this.Vl.has(n.event))&&this.Wl.forEach(r=>{this.tu(n,r)&&this.Gl.emit("actionCaptured",r.name)})}eu(e){this.onAction("actionCaptured",n=>e(n))}tu(e,n){if((n==null?void 0:n.steps)==null)return!1;for(var r of n.steps)if(this.Zl(e,r))return!0;return!1}onAction(e,n){return this.Gl.on(e,n)}Jl(e,n){if(n!=null&&n.url){var r,i=e==null||(r=e.properties)==null?void 0:r.$current_url;if(!i||typeof i!="string"||!rs(i,n.url,n.url_matching||"contains"))return!1}return!0}Kl(e,n){return!!this.iu(e,n)&&!!this.ru(e,n)&&!!this.nu(e,n)}iu(e,n){var r;if(n==null||!n.href)return!0;var i=this.su(e);if(i.length>0)return i.some(a=>rs(a.href,n.href,n.href_matching||"exact"));var s,o=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!o&&rs((s=o.match(/(?::|")href="(.*?)"/))?s[1]:"",n.href,n.href_matching||"exact")}ru(e,n){var r;if(n==null||!n.text)return!0;var i=this.su(e);if(i.length>0)return i.some(u=>rs(u.text,n.text,n.text_matching||"exact")||rs(u.$el_text,n.text,n.text_matching||"exact"));var s,o,a,l=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!l&&(s=function(u){for(var c,d=[],f=/(?::|")text="(.*?)"/g;!te(c=f.exec(u));)d.includes(c[1])||d.push(c[1]);return d}(l),o=n.text,a=n.text_matching||"exact",s.some(u=>rs(u,o,a)))}nu(e,n){var r,i;if(n==null||!n.selector)return!0;var s=e==null||(r=e.properties)==null?void 0:r.$element_selectors;if(s!=null&&s.includes(n.selector))return!0;var o=(e==null||(i=e.properties)==null?void 0:i.$elements_chain)||"";if(n.selector_regex&&o)try{return new RegExp(n.selector_regex).test(o)}catch{return!1}return!1}su(e){var n;return(e==null||(n=e.properties)==null?void 0:n.$elements)==null?[]:e==null?void 0:e.properties.$elements}Yl(e,n){return n==null||!n.properties||n.properties.length===0||xE(n.properties.reduce((r,i)=>{var s=X(i.value)?i.value.map(String):i.value!=null?[String(i.value)]:[];return r[i.key]={values:s,operator:i.operator||"exact"},r},{}),e==null?void 0:e.properties)}}class tO{constructor(e){var n;this.au=[],this._instance=e,this.ou=new Map,this.lu=new Map,this.uu=new Map,this.hu=(n=this._instance)==null||n.onSessionId==null?void 0:n.onSessionId(r=>this.du(r))}vu(e){return!1}cu(){return null}fu(e){}pu(){}gu(e,n){return!!e&&xE(e.propertyFilters,n==null?void 0:n.properties)}mu(e,n){var r=new Map;return e.forEach(i=>{var s;(s=i.conditions)==null||(s=s[n])==null||(s=s.values)==null||s.forEach(o=>{if(o!=null&&o.name){var a=r.get(o.name)||[];a.push(i.id),r.set(o.name,a)}})}),r}yu(e,n,r){var i=(r===No.Activation?this.ou:this.lu).get(e),s=[];return this.bu(o=>{s=o.filter(a=>i==null?void 0:i.includes(a.id))}),s.filter(o=>{var a,l=(a=o.conditions)==null||(a=a[r])==null||(a=a.values)==null?void 0:a.find(u=>u.name===e);return this.gu(l,n)})}register(e){this._u(e,!1)}replace(e){this._u(e,!0)}_u(e,n){var r;F((r=this._instance)==null?void 0:r._addCaptureHook)||(this.wu(e,n),this.ku(e,n))}ku(e,n){var r=e.filter(o=>{var a;return(a=o.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length});if(n&&this.uu.clear(),r.length!==0){this.Su||(this.Su=new eO(this._instance),this.Su.init(),this.Su.eu(o=>this.onAction(o)));var i=[];r.forEach(o=>{var a;(a=o.conditions)==null||(a=a.actions)==null||a.values.forEach(l=>{if(i.push(l),l.name){var u,c=(u=this.uu.get(l.name))!==null&&u!==void 0?u:[];c.includes(o.id)||c.push(o.id),this.uu.set(l.name,c)}})}),n?this.Su.replace(i):this.Su.register(i)}else{var s;n&&((s=this.Su)==null||s.replace([]))}}xu(e,n){n.forEach((r,i)=>{var s,o=(s=e.get(i))!==null&&s!==void 0?s:[];r.forEach(a=>{o.includes(a)||o.push(a)}),e.set(i,o)})}wu(e,n){var r,i,s=e.filter(u=>{var c,d;return((c=u.conditions)==null?void 0:c.events)&&((d=u.conditions)==null||(d=d.events)==null||(d=d.values)==null?void 0:d.length)>0}),o=e.filter(u=>{var c,d;return((c=u.conditions)==null?void 0:c.cancelEvents)&&((d=u.conditions)==null||(d=d.cancelEvents)==null||(d=d.values)==null?void 0:d.length)>0}),a=this.mu(e,No.Activation),l=this.mu(e,No.Cancellation);n?(this.ou=a,this.lu=l):(this.xu(this.ou,a),this.xu(this.lu,l)),(s.length!==0||o.length!==0)&&((r=this.Xl)!==null&&r!==void 0||(this.Xl=(i=this._instance)==null?void 0:i._addCaptureHook((u,c)=>{this.onEvent(u,c)})))}onEvent(e,n){var r,i,s=this.Cu(),o=(n==null||(r=n.properties)==null?void 0:r.$survey_id)||(n==null||(i=n.properties)==null?void 0:i.$product_tour_id);if(o&&this.getActivatedIds().includes(o)){var a=this.Tu(e,o);if(a==="consume")return s.info("event consumed activated item, removing it",{event:e,itemId:o}),void this.Mu([o]);if(a==="persist")return s.info("shown item promoted to persisted activation",{event:e,itemId:o}),this.Eu(o),void this.Iu([o])}if(this.lu.has(e)){var l=this.yu(e,n,No.Cancellation);l.length>0&&(s.info("cancel event matched, cancelling items",{event:e,itemsToCancel:l.map(c=>c.id)}),this.Mu(l.map(c=>c.id)),l.forEach(c=>this.Ru(c.id)))}if(this.ou.has(e)){s.info("event name matched",{event:e,eventPayload:n,items:this.ou.get(e)});var u=this.yu(e,n,No.Activation);this.Pu(u.map(c=>c.id))}}onAction(e){this.uu.has(e)&&this.Pu(this.uu.get(e)||[])}Pu(e){var n;if(e.length!==0){var r=!((n=this._instance)==null||n.get_session_id==null||!n.get_session_id()),i=[];for(var s of e)r&&this.vu(s)?this.Eu(s)&&this.Au(s):i.push(s);i.length>0&&(this.au=[...new Set([...this.au,...i])]),this.Cu().info("updating activated items",{activatedItems:this.getActivatedIds()})}}Eu(e){this.au=this.au.filter(r=>r!==e);var n=this.Fu();return!n.includes(e)&&(this.Ou([...n,e]),this.Lu(),!0)}Mu(e){var n=new Set(e);this.au=this.au.filter(s=>!n.has(s));var r=this.$u(),i=r.filter(s=>!n.has(s));i.length!==r.length&&(this.Ou(i),i.length===0&&this.Du()),this.Iu(e)}Nu(){var e,n=this.cu();if(!n)return{};var r=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[n];return r&&typeof r=="object"?r:{}}Au(e){if(this.cu()){var n=this.Nu();this.fu(N({},n,{[e]:Date.now()}))}}Iu(e){if(this.cu()){var n=this.Nu(),r={},i=!1;for(var s of Object.entries(n)){var o=s[0],a=s[1];e.includes(o)?i=!0:r[o]=a}i&&(yn(r)?this.pu():this.fu(r))}}qu(){this.cu()&&this.pu()}getActivationTimestamp(e){if(this.Fu().includes(e)){var n=this.Nu()[e];return qe(n)?n:void 0}}$u(){var e,n=this.ju();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[n])||[]}Fu(){var e,n,r=this.$u();if(r.length===0)return[];var i=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[this.Bu()],s=(n=this._instance)==null||n.get_session_id==null?void 0:n.get_session_id();return s&&i===s?r:[]}Lu(){var e,n=(e=this._instance)==null||e.get_session_id==null?void 0:e.get_session_id();n&&this.Hu(n)}Du(){this.Uu()}du(e){var n,r=(n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[this.Bu()];if(r&&r!==e){var i=this.$u(),s=this.Nu();i.length>0&&(this.Ou([]),i.filter(o=>qe(s[o])).forEach(o=>this.Ru(o))),this.Du(),this.qu()}}getActivatedIds(){return[...new Set([...this.Fu(),...this.au])].filter(e=>!this.zu(e))}dispose(){var e,n,r;(e=this.hu)==null||e.call(this),this.hu=void 0,(n=this.Xl)==null||n.call(this),this.Xl=void 0,(r=this.Su)==null||r.dispose(),this.Su=void 0}reset(){this.au=[],this.$u().length>0&&this.Ou([]),this.Du(),this.qu()}getEventToItemsMap(){return this.ou}Wu(){return this.Su}}class nO extends tO{constructor(e){super(e)}ju(){return Yh}Bu(){return su}cu(){return ou}fu(e){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[ou]:e})}pu(){var e;(e=this._instance)==null||(e=e.persistence)==null||e.unregister(ou)}vu(e){var n,r;this.bu(s=>{r=s.find(o=>o.id===e)});var i=(n=r)==null||(n=n.appearance)==null?void 0:n.surveyPopupDelaySeconds;return qe(i)&&i>0}Vu(){return rr.SHOWN}bu(e){var n;(n=this._instance)==null||n.getSurveys(e)}Ru(e){var n;(n=this._instance)==null||n.cancelPendingSurvey(e)}Cu(){return de}Ou(e){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[Yh]:e})}Hu(e){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[su]:e})}Uu(){var e;(e=this._instance)==null||(e=e.persistence)==null||e.unregister(su)}zu(){return!1}Tu(e,n){var r;this.bu(s=>{r=s.find(o=>o.id===n)});var i=!r||function(s){var o;return bE(s)&&!((o=s.conditions)==null||(o=o.events)==null||!o.repeatedActivation)||s.schedule==="always"}(r);return i?e===rr.SHOWN?"consume":"ignore":e===rr.SHOWN?"persist":e===rr.DISMISSED||e===rr.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class rO{constructor(e){this._instance=e}initialize(){}get(e){if(typeof e=="string")return this._instance.get_property(e);var n={};for(var r of e){var i=this._instance.get_property(r);F(i)||(n[r]=i)}return n}set(e,n){this._instance.register(typeof e=="string"?{[e]:n}:e)}remove(e){typeof e!="string"?e.forEach(n=>this._instance.unregister(n)):this._instance.unregister(e)}}class iO{constructor(e){this._instance=e}get(){var e=this._instance.config;return{disableSurveys:e.disable_surveys,cookielessMode:!!e.cookieless_mode,advancedEnableSurveys:e.advanced_enable_surveys,requestTimeoutMs:e.surveys_request_timeout_ms}}isOptedOut(){return this._instance.consent.isOptedOut()}getExtensions(){var e=Q==null?void 0:Q.__PosthogExtensions__;if(e){var n=e.generateSurveys,r=e.loadExternalDependency;return{generateSurveys:n?i=>n(this._instance,i):void 0,loadExternalDependency:r?i=>r(this._instance,"surveys",i):void 0}}}createEventReceiver(){return new nO(this._instance)}}var sO=T!=null&&T.location?ac(T.location.hash,"__posthog")||ac(location.hash,"state"):null,i_="_postHogToolbarParams",s_=Pe("[Toolbar]"),o_=Pe("[FeatureFlags]");class oO{constructor(e,n){n===void 0&&(n=!1),this.Gu=!1,this.update(e,n)}update(e,n){this.Zu=((r,i)=>{var s,o,a,l;return{bootstrap:{featureFlags:(s=r.bootstrap)==null?void 0:s.featureFlags,featureFlagPayloads:(o=r.bootstrap)==null?void 0:o.featureFlagPayloads},remoteRequestsDisabled:i,featureFlagsDisabled:!!r.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!r.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!r.advanced_feature_flags_dedup_per_session,cacheTtlMs:r.feature_flag_cache_ttl_ms,requestTimeoutMs:r.feature_flag_request_timeout_ms,compression:r.disable_compression?"none":"base64",evaluationContexts:(a=(l=r.evaluation_contexts)!==null&&l!==void 0?l:r.evaluation_environments)!==null&&a!==void 0?a:[],flagKeys:X(r.flag_keys)?r.flag_keys:void 0}})(e,n),!e.evaluation_environments||e.evaluation_contexts||this.Gu||(o_.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Gu=!0),F(e.flag_keys)||X(e.flag_keys)||o_.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")}get(){return this.Zu}}var a_=Pe("[FeatureFlags]"),ci=Pe("[FeatureFlags]",{debugEnabled:!0}),gf=`" failed. Feature flags didn't load in time.`,l_="connection_error",u_=t=>{for(var e={},n=0;t.length>n;n++)e[t[n]]=!0;return e},c_=t=>{var e={};for(var n of au(t||{})){var r=n[1];r&&(e[n[0]]=r)}return e},cn=Pe("[Error tracking]"),aO=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:"],lO=["__firefox__","__gCrWeb"],d_="Refusing to render web experiment since the viewer is a likely bot",uO={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>dc(e,t),not_regex:(t,e)=>!dc(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class ct{get qi(){return this._instance.config}constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments(i=>{ct.Qu("retrieved web experiments from the server"),n.Ju=new Map,i.forEach(s=>{if(s.feature_flag_key){var o;n.Ju&&(ct.Qu("setting flag key ",s.feature_flag_key," to web experiment ",s),(o=n.Ju)==null||o.set(s.feature_flag_key,s));var a=n._instance.getFeatureFlag(s.feature_flag_key);ue(a)&&s.variants[a]&&n.Ku(s.name,a,s.variants[a].transforms)}else if(s.variants)for(var l in s.variants){var u=s.variants[l];ct.Yu(u,n._instance)&&n.Ku(s.name,l,u.transforms)}})},r)},this._instance=e,this._instance.onFeatureFlags(r=>{this.onFeatureFlags(r)})}initialize(){}onFeatureFlags(e){if(this._is_bot())ct.Qu(d_);else if(!this.qi.disable_web_experiments){if(te(this.Ju))return this.Ju=new Map,this.loadIfEnabled(),void this.previewWebExperiment();ct.Qu("applying feature flags",e),e.forEach(n=>{var r;if(this.Ju&&(r=this.Ju)!=null&&r.has(n)){var i,s=this._instance.getFeatureFlag(n),o=(i=this.Ju)==null?void 0:i.get(n);s&&o!=null&&o.variants[s]&&this.Ku(o.name,s,o.variants[s].transforms)}})}}previewWebExperiment(){var e=ct.getWindowLocation();if(e!=null&&e.search){var n=oo(e==null?void 0:e.search,"__experiment_id"),r=oo(e==null?void 0:e.search,"__experiment_variant");n&&r&&(ct.Qu("previewing web experiments "+n+" && "+r),this.getWebExperiments(i=>{this.Xu(parseInt(n),r,i)},!1,!0))}}loadIfEnabled(){this.qi.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,r){if(this.qi.disable_web_experiments&&!r)return e([]);var i=this._instance.get_property("$web_experiments");if(i&&!n)return e(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.qi.token),method:"GET",timestampMode:"query",callback:s=>e(s.statusCode===200&&s.json&&s.json.experiments||[])})}Xu(e,n,r){var i=r.filter(s=>s.id===e);i&&i.length>0&&(ct.Qu("Previewing web experiment ["+i[0].name+"] with variant ["+n+"]"),this.Ku(i[0].name,n,i[0].variants[n].transforms))}static Yu(e,n){return!te(e.conditions)&&ct.th(e,n)&&ct.eh(e)}static th(e,n){var r;if(te(e.conditions)||te((r=e.conditions)==null?void 0:r.url))return!0;var i=ct.getWindowLocation();if(i){var s,o,a,l=Lb(n,i.href);return(s=e.conditions)==null||!s.url||uO[(o=(a=e.conditions)==null?void 0:a.urlMatchType)!==null&&o!==void 0?o:"icontains"](e.conditions.url,l)}return!1}static getWindowLocation(){return T==null?void 0:T.location}static eh(e){var n;if(te(e.conditions)||te((n=e.conditions)==null?void 0:n.utm))return!0;var r=Zb();if(r.utm_source){var i,s,o,a,l,u,c,d,f=(i=e.conditions)==null||(i=i.utm)==null||!i.utm_campaign||((s=e.conditions)==null||(s=s.utm)==null?void 0:s.utm_campaign)==r.utm_campaign,_=(o=e.conditions)==null||(o=o.utm)==null||!o.utm_source||((a=e.conditions)==null||(a=a.utm)==null?void 0:a.utm_source)==r.utm_source,m=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((u=e.conditions)==null||(u=u.utm)==null?void 0:u.utm_medium)==r.utm_medium,p=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_term||((d=e.conditions)==null||(d=d.utm)==null?void 0:d.utm_term)==r.utm_term;return f&&m&&p&&_}return!1}static Qu(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;n>i;i++)r[i-1]=arguments[i];D.info("[WebExperiments] "+e,r)}Ku(e,n,r){this._is_bot()?ct.Qu(d_):n!=="control"?r.forEach(i=>{if(i.selector){var s;ct.Qu("applying transform of variant "+n+" for experiment "+e+" ",i);var o=(s=document)==null?void 0:s.querySelectorAll(i.selector);o==null||o.forEach(a=>{var l=a;i.html&&(l.innerHTML=i.html),i.css&&l.setAttribute("style",i.css)})}}):ct.Qu("Control variants leave the page unmodified.")}_is_bot(){return xt&&this._instance?yE(xt,this.qi.custom_blocked_useragents):void 0}}var Qt=Pe("[Conversations]"),di="Conversations not available yet.",f_="console",TE="__posthogHandledLogsRequestError",mf=(t,e)=>{var n=t instanceof Error?t:new Error(e);return n[TE]=!0,n},h_=t=>!!t&&typeof t=="object"&&t[TE]===!0,Hc={featureFlags:class{constructor(t){this.name="featureFlags",this.ih=!1,this.featureFlagEventHandlers=[],this.I=a_,this.rh={},this.nh={},this.sh=[],this.ah=!1,this.oh=!1,this.lh=0,this.uh=!1,this.hh=!1,this.dh=!1,this.fh=!1,this.ph=0,this.Tt=()=>{var e=this.gh();this.ph=0,e&&this.reloadFeatureFlags()},"get"in t?this.ts=t:(this.mh=new oO(t.config,t.ma()),this.ts=this.mh)}updateConfig(t,e){var n;(n=this.mh)==null||n.update(t,e)}setup(t){return this.Fl=t,this.I=t.logger.createLogger("[FeatureFlags]"),RE(t.kv.initialize(),()=>{this.Fl===t&&(this.Fl=void 0,this.ns=t,this.yh(t))})}yh(t){if(this.ns===t)return T&&Ce(T,"online",this.Tt),this.bh=t.registerDynamicEventProperties(()=>this._h()?this.rh:this.nh),this.wh(),this.initialize()}destroy(){T==null||T.removeEventListener("online",this.Tt)}dispose(){var t;this.lh++,this.hh=!1,this.Fl=void 0,this.ns&&(this.kh(),(t=this.bh)==null||t.dispose(),this.bh=void 0,this.sh=[],T==null||T.removeEventListener("online",this.Tt),this.ns=void 0)}get qi(){return this.ts.get()}Sh(t){var e;return(e=this.ns)==null?void 0:e.kv.get(t)}Nr(t){this.xh(()=>{var e;return(e=this.ns)==null?void 0:e.kv.set(t)})}qr(t){this.xh(()=>{var e;return(e=this.ns)==null?void 0:e.kv.remove(t)})}xh(t){try{t()}catch(e){this.I.error("Failed to update feature flag persistence",e)}}wh(){var t={};for(var e of[Ei,Si,Ns,Pn]){var n=this.Sh(e);F(n)||(t[e]=n)}this.rh=t;var r=N({},t),i=this.Sh(Zn);if(i)for(var s of Object.entries(i))r["$feature/"+s[0]]=s[1];this.nh=r}_h(){var t=this.qi.cacheTtlMs;if(!t||0>=t)return!1;var e=this.Sh(Ni);return typeof e!="number"||Date.now()-e>t}Ch(){return!!this._h()&&(this.fh||this.oh||(this.fh=!0,this.I.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Th(){var t=this.qi.evaluationContexts;return t!=null&&t.length?t.filter(e=>{var n=e&&typeof e=="string"&&e.trim().length>0;return n||this.I.error("Invalid evaluation context found:",e,"Expected non-empty string"),n}):[]}Mh(){var t=this.qi.flagKeys;if(!F(t))return t.filter(e=>{var n=e&&typeof e=="string"&&e.trim().length>0;return n||this.I.error("Invalid flag key found:",e,"Expected non-empty string"),n})}initialize(){var t,e,n=this.qi,r=(t=(e=n.bootstrap)==null?void 0:e.featureFlags)!==null&&t!==void 0?t:{};if(Object.keys(r).length){var i,s,o=(i=(s=n.bootstrap)==null?void 0:s.featureFlagPayloads)!==null&&i!==void 0?i:{},a=Object.keys(r).filter(u=>!!r[u]).reduce((u,c)=>(u[c]=r[c]||!1,u),{}),l=Object.keys(o).filter(u=>a[u]).reduce((u,c)=>(u[c]=o[c],u),{});return this.Eh({featureFlags:a,featureFlagPayloads:l})}}updateFlags(t,e,n){var r,i,s=n!=null&&n.merge&&(r=this.Sh(Zn))!==null&&r!==void 0?r:{},o=n!=null&&n.merge&&(i=this.Sh(Si))!==null&&i!==void 0?i:{},a=N({},s,t),l=N({},o,e),u={};for(var c of Object.entries(a)){var d=c[0],f=c[1];u[d]={key:d,enabled:ty(f),variant:ny(f),reason:void 0,metadata:F(l==null?void 0:l[d])?void 0:{id:0,version:void 0,description:void 0,payload:l[d]}}}this.Eh({flags:u})}get hasLoadedFlags(){return this.ah}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.Sh(Aa),e=this.Sh(Pn),n=this.Sh(gi);if(!n&&!e)return t||{};var r=ge({},t||{}),i=[...new Set([...Object.keys(n||{}),...Object.keys(e||{})])];for(var s of i){var o,a,l=r[s],u=e==null?void 0:e[s],c=F(u)?(o=l==null?void 0:l.enabled)!==null&&o!==void 0&&o:!!u,d=F(u)?l==null?void 0:l.variant:typeof u=="string"?u:void 0,f=n==null?void 0:n[s],_=N({},l,{enabled:c,variant:c?d??(l==null?void 0:l.variant):void 0});c!==(l==null?void 0:l.enabled)&&(_.original_enabled=l==null?void 0:l.enabled),d!==(l==null?void 0:l.variant)&&(_.original_variant=l==null?void 0:l.variant),f&&(_.metadata=N({},l==null?void 0:l.metadata,{payload:f,original_payload:l==null||(a=l.metadata)==null?void 0:a.payload})),r[s]=_}return this.ih||(this.I.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:n,finalDetails:r}),this.ih=!0),r}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map(n=>{var r=t[n];return{key:n,enabled:ty(r),variant:ny(r),payload:ey(e[n])}})}getFlagVariants(){var t=this.Sh(Zn),e=this.Sh(Pn);if(!e)return t||{};for(var n=ge({},t||{}),r=Object.keys(e),i=0;r.length>i;i++)n[r[i]]=e[r[i]];return this.ih||(this.I.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:n}),this.ih=!0),n}getFlagPayloads(){var t=this.Sh(Si),e=this.Sh(gi);if(!e)return t||{};for(var n=ge({},t||{}),r=Object.keys(e),i=0;r.length>i;i++)n[r[i]]=e[r[i]];return this.ih||(this.I.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:n}),this.ih=!0),n}reloadFeatureFlags(){this.uh||this.qi.featureFlagsDisabled||this.gh()||this.Ih||(this.sh.slice().forEach(t=>{try{t()}catch(e){this.I.error("Error while running feature flags reloading callback",e)}}),this.Ih=setTimeout(()=>{this.Rh()},5))}kh(){clearTimeout(this.Ih),this.Ih=void 0}onReloading(t){return this.sh.push(t),()=>{this.sh=this.sh.filter(e=>e!==t)}}ensureFlagsLoaded(){this.ah||this.oh||this.Ih||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.uh=t}resetFlagCallReported(){this.qr(tr)}Rh(t){this.kh();var e=this.ns;if(e&&!this.qi.remoteRequestsDisabled&&!this.gh())if(this.oh)this.hh=!0;else{var n={token:e.projectToken,distinct_id:e.distinctId,groups:e.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:N({},e.initialPersonProperties,this.Sh(fn)||{},{$lib:e.library.name,$lib_version:e.library.version}),group_properties:this.Sh(Nn),timezone:sE()};F(e.deviceId)||(n.$device_id=e.deviceId),(t!=null&&t.disableFlags||this.qi.featureFlagsDisabled)&&(n.disable_flags=!0);var r=this.Th();r.length&&(n.evaluation_contexts=r);var i=this.Mh();F(i)||(n.flag_keys=i);var s=this.qi.onlyEvaluateSurveyFeatureFlags,o="/flags/?v=2"+(s?"&only_evaluate_survey_feature_flags=true":""),a=this.lh;this.oh=!0;var l=()=>{this.hh&&(this.hh=!1,this.Rh())},u=c=>{this.oh=!1,a===this.lh&&(this.Nr({[$s]:[l_]}),this.I.error("Feature flag request failed",c)),l()};try{e.sendRequest(o,{target:"flags",method:"POST",body:n,compression:this.qi.compression==="base64"?_t.Base64:void 0,sentAt:"body",timeoutMs:this.qi.requestTimeoutMs}).then(c=>{var d,f,_=(d=c.json)!==null&&d!==void 0?d:{},m=c.statusCode!==200;if(this.oh=!1,a===this.lh){if(this.Ph(c.statusCode),m||this.hh||(this.$anon_distinct_id=void 0),!n.disable_flags||this.hh){this.dh=!m;var p=[];c.error?p.push(c.error instanceof Error&&c.error.name==="AbortError"?"timeout":c.error instanceof Error?l_:"unknown_error"):c.statusCode!==200&&p.push("api_error_"+c.statusCode),_.errorsWhileComputingFlags&&p.push("errors_while_computing_flags");var y=!((f=_.quotaLimited)==null||!f.includes("feature_flags"));y&&p.push("quota_limited"),this.Nr({[$s]:p}),y?this.I.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):n.disable_flags||this.Eh(_,m,{partialResponse:s}),l()}}else l()}).catch(u)}catch(c){u(c)}}}gh(){return Xb(this.ph,3)}Ph(t){this.ph=Jb(t,this.ph,3,()=>this.I.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes."))}getFeatureFlag(t,e){var n;if(e===void 0&&(e={}),!e.fresh||this.dh)if(this.ah||this.getFlags()&&this.getFlags().length>0){if(!this.Ch()){var r=this.getFeatureFlagResult(t,e);return(n=r==null?void 0:r.variant)!==null&&n!==void 0?n:r==null?void 0:r.enabled}}else this.I.warn('getFeatureFlag for key "'+t+gf)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e=this.getFeatureFlagResult(t,{send_event:!1});return e==null?void 0:e.payload}getFeatureFlagResult(t,e){if(e===void 0&&(e={}),!e.fresh||this.dh)if(this.ah||this.getFlags()&&this.getFlags().length>0){if(!this.Ch()){var n,r=this.getFlagVariants(),i=t in r,s=r[t],o=this.getFlagPayloads()[t],a=String(s),l=this.Sh(Ns)||void 0,u=this.Sh(Ni)||void 0,c=this.Sh(tr)||{};if(this.qi.deduplicateCallsPerSession){var d,f=(d=this.ns)==null?void 0:d.session.sessionId,_=this.Sh(Qo);f&&f!==_&&(c={},n=f)}if(e.send_event||!("send_event"in e))if(t in c&&c[t].includes(a))n&&this.Nr({[tr]:c,[Qo]:n});else{var m,p,y,h,v,x,b,E,S,k,C,R;X(c[t])?c[t].push(a):c[t]=[a],this.Nr(N({[tr]:c},n?{[Qo]:n}:{}));var P=this.getFeatureFlagDetails(t),$=[...(m=this.Sh($s))!==null&&m!==void 0?m:[]];F(s)&&$.push("flag_missing");var O={$feature_flag:t,$feature_flag_response:s,$feature_flag_payload:o??null,$feature_flag_request_id:l,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:(p=(y=this.qi.bootstrap)==null||(y=y.featureFlags)==null?void 0:y[t])!==null&&p!==void 0?p:null,$feature_flag_bootstrapped_payload:(h=(v=this.qi.bootstrap)==null||(v=v.featureFlagPayloads)==null?void 0:v[t])!==null&&h!==void 0?h:null,$used_bootstrap_value:!this.dh};F(P==null||(x=P.metadata)==null?void 0:x.has_experiment)||(O.$feature_flag_has_experiment=P.metadata.has_experiment),F(P==null||(b=P.metadata)==null?void 0:b.version)||(O.$feature_flag_version=P.metadata.version);var U,L=(E=P==null||(S=P.reason)==null?void 0:S.description)!==null&&E!==void 0?E:P==null||(k=P.reason)==null?void 0:k.code;L&&(O.$feature_flag_reason=L),P!=null&&(C=P.metadata)!=null&&C.id&&(O.$feature_flag_id=P.metadata.id),F(P==null?void 0:P.original_variant)&&F(P==null?void 0:P.original_enabled)||(O.$feature_flag_original_response=F(P.original_variant)?P.original_enabled:P.original_variant),P!=null&&(R=P.metadata)!=null&&R.original_payload&&(O.$feature_flag_original_payload=P==null||(U=P.metadata)==null?void 0:U.original_payload),$.length&&(O.$feature_flag_error=$.join(",")),this.Ah(O)}else n&&this.Nr({[tr]:c,[Qo]:n});if(i)return{key:t,enabled:!!s,variant:typeof s=="string"?s:void 0,payload:ey(o)}}}else this.I.warn('getFeatureFlagResult for key "'+t+gf)}Ah(t){try{var e;(e=this.ns)==null||e.capture("$feature_flag_called",t).catch(n=>{this.I.error("Failed to capture feature flag call",n)})}catch(n){this.I.error("Failed to capture feature flag call",n)}}getRemoteConfigPayload(t,e){this.Fh(t,e)}Fh(t,e){var n=this;return be(function*(){var r=n.ns;if(r){var i={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},s=n.Th();s.length&&(i.evaluation_contexts=s);var o,a=n.Mh();F(a)||(i.flag_keys=a);try{var l,u=(l=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:i,compression:n.qi.compression==="base64"?_t.Base64:void 0,sentAt:"body",timeoutMs:n.qi.requestTimeoutMs})).json)==null?void 0:l.featureFlagPayloads;o=(u==null?void 0:u[t])||void 0}catch(c){return void n.I.error("Remote config feature flag request failed",c)}try{e(o)}catch(c){n.I.error("Remote config feature flag callback failed",c)}}})()}isFeatureEnabled(t,e){if(e===void 0&&(e={}),e.fresh&&!this.dh)return e.defaultValue;if(!(this.ah||this.getFlags()&&this.getFlags().length>0))return this.I.warn('isFeatureEnabled for key "'+t+gf),e.defaultValue;var n=this.getFeatureFlag(t,e);return F(n)?e.defaultValue:!!n}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(e=>e!==t)}receivedFeatureFlags(t,e,n){this.Eh(t,e,n)}Eh(t,e,n){if(this.ns){this.ah=!0;var r=function(i,s,o,a,l,u){s===void 0&&(s={}),o===void 0&&(o={}),a===void 0&&(a={}),u===void 0&&(u=a_);var c=((S,k)=>{var C=S.flags;return C?N({},S,{featureFlags:Object.fromEntries(Object.keys(C).map(R=>{var P;return[R,(P=C[R].variant)!==null&&P!==void 0?P:C[R].enabled]})),featureFlagPayloads:Object.fromEntries(Object.keys(C).filter(R=>C[R].enabled).filter(R=>{var P;return(P=C[R].metadata)==null?void 0:P.payload}).map(R=>{var P;return[R,(P=C[R].metadata)==null?void 0:P.payload]}))}):(S.featureFlags&&k.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),S)})(i,u),d=c.flags,f=c.featureFlags,_=c.featureFlagPayloads;if(f){var m=i.requestId,p=i.evaluatedAt;if(X(f)){u.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var y={};if(f)for(var h=0;f.length>h;h++)y[f[h]]=!0;return{[Ei]:f,[Zn]:y,[Ju]:!1}}var v=f,x=_,b=d;if(l!=null&&l.partialResponse)v=N({},s,v),x=N({},o,x),b=N({},a,b);else if(i.errorsWhileComputingFlags)if(d){var E=new Set(Object.keys(d).filter(S=>{var k;return!((k=d[S])!=null&&k.failed)}));v=N({},s,Object.fromEntries(Object.entries(v).filter(S=>E.has(S[0])))),x=N({},o,Object.fromEntries(Object.entries(x||{}).filter(S=>E.has(S[0])))),b=N({},a,Object.fromEntries(Object.entries(b||{}).filter(S=>E.has(S[0]))))}else v=N({},s,v),x=N({},o,x),b=N({},a,b);return N({[Ei]:Object.keys(c_(v)),[Zn]:v||{},[Si]:x||{},[Aa]:b||{},[Ju]:i.minimalFlagCalledEvents===!0},m?{[Ns]:m}:{},p?{[Ni]:p}:{})}}(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),n,this.I);r&&this.Nr(r),e||(this.fh=!1),this.Oh(e)}}override(t,e){e===void 0&&(e=!1),this.I.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){this.Lh(t)}Lh(t){if(this.ns){if(t===!1)return this.qr([Pn,gi]),this.Oh(),void ci.info("All overrides cleared");if(X(t))return this.Nr({[Pn]:u_(t)}),this.Oh(),void ci.info("Flag overrides set",{flags:t});if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var e,n=t;this.ih=!!((e=n.suppressWarning)!==null&&e!==void 0&&e);var r={},i=n.flags,s=n.payloads;return i&&(r[Pn]=X(i)?u_(i):i),s&&(r[gi]=s),Object.keys(r).length&&this.Nr(r),i===!1&&s===!1?this.qr([Pn,gi]):i===!1?this.qr(Pn):s===!1&&this.qr(gi),this.Oh(),i===!1?ci.info("Flag overrides cleared"):i&&ci.info("Flag overrides set",{flags:i}),void(s===!1?ci.info("Payload overrides cleared"):s&&ci.info("Payload overrides set",{payloads:s}))}if(t&&typeof t=="object")return this.Nr({[Pn]:t}),this.Oh(),void ci.info("Flag overrides set",{flags:t});this.I.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}else this.I.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.ah){var e=this.$h(),n=e.flags,r=e.flagVariants;try{t(n,r)}catch(i){this.I.error("Error while running feature flags callback",i)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,n){var r=(this.Sh(iu)||[]).find(l=>l.flagKey===t),i={["$feature_enrollment/"+t]:e},s={$feature_flag:t,$feature_enrollment:e,$set:i};r&&(s.$early_access_feature_name=r.name),n&&(s.$feature_enrollment_stage=n);var o=N({},this.getFlagVariants(),{[t]:e});this.Nr({[Ei]:Object.keys(c_(o)),[Zn]:o,[fn]:N({},this.Sh(fn)||{},i)}),this.Oh();try{var a;(a=this.ns)==null||a.capture("$feature_enrollment_update",s).catch(l=>{this.I.error("Failed to capture early access feature enrollment",l)})}catch(l){this.I.error("Failed to capture early access feature enrollment",l)}}getEarlyAccessFeatures(t,e,n){e===void 0&&(e=!1);var r=this.Sh(iu);!r||e?this.Dh(t,n):t(r)}Dh(t,e){var n=this;return be(function*(){var r=n.ns;if(r){var i,s=e?"&"+e.map(a=>"stage="+a).join("&"):"";try{var o=yield r.sendRequest("/api/early_access_features/?token="+r.projectToken+s,{target:"api",method:"GET",sentAt:"query"});if(!o.json)return;n.Nr({[iu]:i=o.json.earlyAccessFeatures})}catch(a){return void n.I.error("Early access feature request failed",a)}try{t(i)}catch(a){n.I.error("Early access feature callback failed",a)}}})()}$h(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter(n=>e[n]),flagVariants:Object.keys(e).filter(n=>e[n]).reduce((n,r)=>(n[r]=e[r],n),{})}}Oh(t){this.wh();var e=this.$h(),n=e.flags,r=e.flagVariants;this.featureFlagEventHandlers.forEach(i=>{try{i(n,r,{errorsLoading:t})}catch(s){this.I.error("Error while running feature flags callback",s)}})}setPersonPropertiesForFlags(t,e){e===void 0&&(e=!0),this.Nh(t,e)}Nh(t,e){e===void 0&&(e=!0);var n=this.Sh(fn)||{},r=(t==null?void 0:t.$set)||(t!=null&&t.$set_once?{}:t),i=t==null?void 0:t.$set_once,s={};if(i)for(var o in i)({}).hasOwnProperty.call(i,o)&&(o in n||(s[o]=i[o]));this.Nr({[fn]:N({},n,s,r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=N({},this.Sh(fn)||{});t.forEach(r=>{delete n[r]}),this.Nr({[fn]:n}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){t===void 0&&(t=!0),this.qr(fn),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=this.Sh(Nn)||{},r=N({},n);for(var i of Object.keys(t))r[i]=N({},n[i],t[i]);this.Nr({[Nn]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.Sh(Nn)||{};this.Nr({[Nn]:N({},e,{[t]:{}})})}else this.qr(Nn)}reset(){this.lh++,this.hh=!1,this.rh={},this.nh={},this.ah=!1,this.uh=!1,this.dh=!1,this.$anon_distinct_id=void 0,this.kh(),this.ih=!1,this.ph=0}}},cO={sessionRecording:class{get qi(){return this._instance.config}get za(){return this._instance.persistence}get started(){var t;return!((t=this.qh)==null||!t.isStarted)}get status(){var t,e;return this.jh===Do||this.jh===$l?this.jh:(t=(e=this.qh)==null?void 0:e.status)!==null&&t!==void 0?t:this.jh}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.jh=e_,this.Bh=void 0,this.Hh=!1,this.kt=(()=>{var e;if(j==null||!j.visibilityState||j.visibilityState==="visible")return!0;var n=T==null||(e=T.performance)==null||e.getEntriesByType==null?void 0:e.getEntriesByType("visibility-state");return!(n!=null&&n.length)||n.some(r=>r.name==="visible")})(),this.It=()=>{var e;(j==null?void 0:j.visibilityState)==="visible"&&(this.kt=!0,(e=this.qh)==null||e.setDocumentWasEverVisible==null||e.setDocumentWasEverVisible(!0))},this._instance=t,!this._instance.sessionManager)throw Hn.error("started without valid sessionManager"),new Error(pp+" started without valid sessionManager. This is a bug.");if(this.qi.cookieless_mode===nr)throw new Error(pp+' cannot be used with cookieless_mode="always"');j!=null&&j.addEventListener&&Ce(j,"visibilitychange",this.It)}initialize(){this.startIfEnabledOrStop()}dispose(){this.Hh=!0,j==null||j.removeEventListener==null||j.removeEventListener("visibilitychange",this.It),this.stopRecording()}get Uh(){var t,e=!((t=this._instance.get_property(bi))==null||!t.enabled),n=!this.qi.disable_session_recording,r=this.qi.disable_session_recording||this._instance.consent.isOptedOut();return T&&e&&n&&!r}startIfEnabledOrStop(t){var e;if(!(this.Hh||this.Uh&&(e=this.qh)!=null&&e.isStarted)){var n=!F(Object.assign)&&!F(Array.from);this.Uh&&n?(this.zh(t),Hn.info("starting")):(this.jh=e_,this.stopRecording())}}zh(t){var e,n,r;this.Uh&&(this.jh!==Do&&this.jh!==$l&&(this.jh=t_),Q!=null&&(e=Q.__PosthogExtensions__)!=null&&(e=e.rrweb)!=null&&e.record&&(n=Q.__PosthogExtensions__)!=null&&n.initSessionRecording?this.Wh(t):(r=Q.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.Vh,i=>{if(i)return this._instance.register_for_session({[tp]:!0}),Hn.error("could not load recorder",i);this.Wh(t)}))}stopRecording(){var t,e;(t=this.Bh)==null||t.call(this),this.Bh=void 0,(e=this.qh)==null||e.stop()}Gh(){var t,e;(t=this.Bh)==null||t.call(this),this.Bh=void 0,(e=this.qh)==null||e.discard()}Zh(){var t,e;(t=this.za)==null||t.unregister(Hv),(e=this.za)==null||e.unregister(Cb)}Qh(t,e){if(te(t))return null;var n,r=qe(t)?t:parseFloat(t);return typeof(n=r)!="number"||!Number.isFinite(n)||0>n||n>1?(Hn.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}Jh(t){if(this.za){var e,n,r=this.za,i=()=>{var s,o=t.sessionRecording===!1?void 0:t.sessionRecording,a=this.Qh((s=this.qi.session_recording)==null?void 0:s.sampleRate,"session_recording.sampleRate"),l=this.Qh(o==null?void 0:o.sampleRate,"remote config sampleRate"),u=a??l;te(u)&&this.Zh();var c=o==null?void 0:o.minimumDurationMilliseconds;r.register({[bi]:N({cache_timestamp:Date.now(),enabled:!!o},o,{networkPayloadCapture:N({capturePerformance:t.capturePerformance},o==null?void 0:o.networkPayloadCapture),canvasRecording:{enabled:o==null?void 0:o.recordCanvas,fps:o==null?void 0:o.canvasFps,quality:o==null?void 0:o.canvasQuality},sampleRate:u,minimumDurationMilliseconds:F(c)?null:c,endpoint:o==null?void 0:o.endpoint,triggerMatchType:o==null?void 0:o.triggerMatchType,masking:o==null?void 0:o.masking,urlTriggers:o==null?void 0:o.urlTriggers,version:o==null?void 0:o.version,triggerGroups:o==null?void 0:o.triggerGroups})})};i(),(e=this.Bh)==null||e.call(this),this.Bh=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(i)}}onRemoteConfig(t){var e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?e.sessionRecording===!1?(this.Jh(e),void this.Gh()):(this.Jh(e),void this.startIfEnabledOrStop()):(this.jh===Do&&(this.jh=$l,Hn.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var n;e===void 0&&(e="log"),(n=this.qh)!=null&&n.log?this.qh.log(t,e):Hn.warn("log called before recorder was ready")}get Vh(){var t,e,n=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.get_property(bi);return(n==null||(e=n.scriptConfig)==null?void 0:e.script)||"lazy-recorder"}Kh(){var t,e=this._instance.get_property(bi);if(!e)return!1;try{t=typeof e=="object"?e:JSON.parse(e)}catch(n){return Hn.warn("persisted remote config for session recording is invalid and will be ignored",n),!1}return!te(t.cache_timestamp)&&36e5>=Date.now()-t.cache_timestamp}Wh(t){var e,n,r;if(!this.Hh){if((e=Q.__PosthogExtensions__)==null||!e.initSessionRecording)return Hn.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[tp]:!0});var i;if(this.qh||(this.qh=(i=Q.__PosthogExtensions__)==null?void 0:i.initSessionRecording(this._instance,this.kt),this.qh._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Kh())return this.jh===$l||this.jh===Do?void 0:(this.jh=Do,Hn.info("persisted remote config is stale, requesting fresh config before starting"),void new oE(this._instance).load());this.jh=t_,(n=(r=this.qh).setDocumentWasEverVisible)==null||n.call(r,this.kt),this.qh.start(t)}}onRRwebEmit(t){var e;(e=this.qh)==null||e.onRRwebEmit==null||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.qh||(e=this.za)==null||e.register({[Pb]:!0}),(t=this.qh)==null||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.qh||(e=this.za)==null||e.register({[kb]:!0}),(t=this.qh)==null||t.overrideSampling()}overrideTrigger(t){var e,n;this.qh||(n=this.za)==null||n.register({[t==="url"?Rb:Tb]:!0}),(e=this.qh)==null||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return((t=this.qh)==null?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var n;return!((n=this.qh)==null||!n.tryAddCustomEvent(t,e))}}},dO={autocapture:class extends KI{constructor(t){super(new QI(t)),this.instance=t}},historyAutocapture:class{constructor(t){this._instance=t,this.Yh=this.Xh()}initialize(){this.startIfEnabled()}get isEnabled(){var t=this.td();return!!(t.path||t.search||this.ed(t))}startIfEnabled(){this.isEnabled&&(D.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.Yh=this.Xh(),this.startIfEnabled()}stop(){this.rd&&this.rd(),this.rd=void 0,this.nd&&this.nd(),this.nd=void 0,D.info("History API monitoring stopped")}monitorHistoryChanges(){T&&T.history&&(this.sd("pushState"),this.sd("replaceState"),this.ad(),this.ed()&&this.od())}sd(t){var e;if(T&&((e=T.history[t])==null||!e.__posthog_wrapped__)){var n=this;(function(r,i,s){try{if(!(i in r))return Jy;var o={next:r[i]},a=s(function(){for(var l=arguments.length,u=new Array(l),c=0;l>c;c++)u[c]=arguments[c];return o.next.apply(this,u)});return ft(a)&&(a.prototype=a.prototype||{},Object.defineProperties(a,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:o}})),r[i]=a,()=>{if(r[i]!==a)for(var l=r[i];ft(l)&&l.__posthog_layer__;){var u=l.__posthog_layer__;if(u.next===a)return void(u.next=o.next);l=u.next}else r[i]=o.next}}catch{return Jy}})(T.history,t,r=>function(i,s,o){r.call(this,i,s,o),n.ld(t)})}}Xh(){var t=T==null?void 0:T.location;if(t!=null&&t.pathname)return{pathname:t.pathname,search:t.search,hash:t.hash}}td(){var t=this._instance.config.capture_pageview;return t==="history_change"?{path:!0}:xe(t)?t:{}}ed(t){return t===void 0&&(t=this.td()),!!t.hash&&!this._instance.config.disable_capture_url_hashes}ud(t){var e=this.td(),n=this.Yh;return!(!n||!(e.path&&t.pathname!==n.pathname||e.search&&t.search!==n.search||this.ed(e)&&t.hash!==n.hash))}ld(t){try{var e=this.Xh();if(!e)return;this.ud(e)&&this._instance.capture(ls,{navigation_type:t}),this.Yh=e}catch(n){D.error("Error capturing "+t+" pageview",n)}}ad(){if(!this.rd){var t=()=>{this.ld("popstate")};Ce(T,"popstate",t),this.rd=()=>{T&&T.removeEventListener("popstate",t)}}}od(){if(!this.nd){var t=()=>{this.ld("hashchange")};Ce(T,"hashchange",t),this.nd=()=>{T&&T.removeEventListener("hashchange",t)}}}},heatmaps:class{get qi(){return this.instance.config}constructor(t){var e;this.hd=!1,this.Qn=!1,this.dd=null,this.instance=t,this.hd=!((e=this.instance.persistence)==null||!e.props[Bh]),this.rageclicks=new PE(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return xe(this.qi.capture_heatmaps)&&this.qi.capture_heatmaps.flush_interval_milliseconds&&(t=this.qi.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return te(this.qi.capture_heatmaps)?te(this.qi.enable_heatmaps)?this.hd:this.qi.enable_heatmaps:this.qi.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.Qn)return;XI.info("starting..."),this.vd(),this.It()}else{var t;clearInterval((t=this.dd)!==null&&t!==void 0?t:void 0),this.fd(),this.getAndClearBuffer()}}onRemoteConfig(t){if(t.ok){var e=t.config;if("heatmaps"in e){var n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Bh]:n}),this.hd=n,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.ft;return this.ft=void 0,t}pd(t){pf(t.originalEvent)&&this.ki(t.originalEvent,"deadclick")}It(){this.dd&&clearInterval(this.dd),this.dd=(j==null?void 0:j.visibilityState)==="visible"?setInterval(this.Oa.bind(this),this.flushIntervalMilliseconds):null}vd(){T&&j&&(this.gd=this.Oa.bind(this),Ce(T,rc,this.gd),this.md=t=>this.ki(t||(T==null?void 0:T.event)),Ce(j,"click",this.md,{capture:!0}),this.yd=t=>this.bd(t||(T==null?void 0:T.event)),Ce(j,"mousemove",this.yd,{capture:!0}),this._d=new Ay(this.instance,aI,this.pd.bind(this)),this._d.startIfEnabledOrStop(),this.wd=this.It.bind(this),Ce(j,nc,this.wd),this.Qn=!0)}fd(){var t;T&&j&&(this.gd&&T.removeEventListener(rc,this.gd),this.md&&j.removeEventListener("click",this.md,{capture:!0}),this.yd&&j.removeEventListener("mousemove",this.yd,{capture:!0}),this.wd&&j.removeEventListener(nc,this.wd),clearTimeout(this.kd),(t=this._d)==null||t.stop(),this.Qn=!1)}Sd(t,e){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),i=this.instance.scrollManager.scrollElement(),s=function(o,a,l){for(var u=o;u&&ei(u)&&!Vt(u,"body");){if(u===l)return!1;var c=void 0;try{var d,f,_;c=(d=(f=(_=u.ownerDocument)==null?void 0:_.defaultView)!==null&&f!==void 0?f:T)==null?void 0:d.getComputedStyle(u).position}catch{return!1}if(Y(a,c))return!0;u=Bb(u)}return!1}(ip(t),["fixed","sticky"],i);return{x:t.clientX+(s?0:r),y:t.clientY+(s?0:n),target_fixed:s,type:e}}ki(t,e){var n;if(e===void 0&&(e="click"),!Ey(t.target)&&pf(t)){var r=this.Sd(t,e);(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&Hb(ip(t),this.instance.config.rageclick)&&this.Nn(N({},r,{type:"rageclick"})),this.Nn(r)}}bd(t){!Ey(t.target)&&pf(t)&&(clearTimeout(this.kd),this.kd=setTimeout(()=>{this.Nn(this.Sd(t,"mousemove"))},500))}Nn(t){if(T){var e=this.qi.disable_capture_url_hashes?Zr(T.location.href):T.location.href,n=this.qi.custom_personal_data_properties,r=this.qi.mask_personal_data_properties?[...ao,...n||[]]:[],i=$a(e,r,Fa);this.ft=this.ft||{},this.ft[i]||(this.ft[i]=[]),this.ft[i].push(t)}}Oa(){this.ft&&!yn(this.ft)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Ay,webVitalsAutocapture:class{constructor(t){var e;this.hd=!1,this.Qn=!1,this.ft={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.xd=()=>{clearTimeout(this.Cd),this.Cd=void 0,this.ft.metrics.length!==0&&(this._instance.capture("$web_vitals",N({$current_url:this.ft.url},this.ft.metrics.reduce((n,r)=>N({},n,{["$web_vitals_"+r.name+"_event"]:N({},r),["$web_vitals_"+r.name+"_value"]:r.value}),{}))),this.ft={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Td=n=>{var r;if(this.ft=this.ft||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},te(n==null?void 0:n.name)||te(n==null?void 0:n.value))ui.error("Invalid metric received",n);else{var i=typeof n.navigationURL=="string"?n.navigationURL:void 0,s=this.Md(i);if(!F(s)){var o=qe(n.navigationId)||typeof n.navigationId=="string"?"navigation:"+n.navigationId:"url:"+s;if(!this.Ed||this.Ed>n.value){this.ft.navigationKey!==o&&(this.xd(),this.Cd=setTimeout(this.xd,this.flushToCaptureTimeoutMs)),F(this.ft.navigationKey)&&(this.ft.navigationKey=o,this.ft.url=s),this.ft.firstMetricTimestamp=F(this.ft.firstMetricTimestamp)?Date.now():this.ft.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0);var a=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0),l=N({},n,i?{navigationURL:s}:{},{$current_url:s,timestamp:Date.now()});F(a)||(l.$session_id=a.sessionId,l.$window_id=a.windowId),this.ft.metrics.push(l),this.ft.metrics.length===this.allowedMetrics.length&&this.xd()}else ui.error("Ignoring metric with value >= "+this.Ed,n)}}},this.Id=()=>{if(!this.Qn){var n,r,i,s,o=Q.__PosthogExtensions__,a=o==null?void 0:o.postHogWebVitalsCallbacksByFlavor,l=(a==null?void 0:a[this.Rd])||(this.Rd==="web-vitals"&&F(a)?o==null?void 0:o.postHogWebVitalsCallbacks:void 0);if(F(l)||(n=l.onLCP,r=l.onCLS,i=l.onFCP,s=l.onINP),n&&r&&i&&s){var u={reportSoftNavs:this.useSoftNavs};this.allowedMetrics.indexOf("LCP")>-1&&n(this.Td.bind(this),u),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Td.bind(this),u),this.allowedMetrics.indexOf("FCP")>-1&&i(this.Td.bind(this),u),this.allowedMetrics.indexOf("INP")>-1&&s(this.Td.bind(this),u),this.Qn=!0}else ui.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.hd=!((e=this._instance.persistence)==null||!e.props[Gh]),this.startIfEnabled()}get Pd(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,n=xe(this.Pd)?(t=this.Pd)==null?void 0:t.web_vitals_allowed_metrics:void 0;return te(n)?((e=this._instance.persistence)==null?void 0:e.props[Kh])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(xe(this.Pd)?this.Pd.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=xe(this.Pd)?this.Pd.web_vitals_attribution:void 0;return t!=null&&t}get useSoftNavs(){var t=xe(this.Pd)?this.Pd.__preview_web_vitals_soft_navs:void 0;return t!=null&&t}get Ed(){var t=xe(this.Pd)&&qe(this.Pd.__web_vitals_max_value)?this.Pd.__web_vitals_max_value:Zy;return t>0&&6e4>=t?Zy:t}get isEnabled(){var t=Ie==null?void 0:Ie.protocol;if(t!=="http:"&&t!=="https:")return ui.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=xe(this.Pd)?this.Pd.web_vitals:It(this.Pd)?this.Pd:void 0;return It(e)?e:this.hd}startIfEnabled(){this.isEnabled&&!this.Qn&&(ui.info("enabled, starting..."),this._s(this.Id))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var n=xe(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=xe(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Gh]:n}),this._instance.persistence.register({[Kh]:r})),this.hd=n,this.startIfEnabled()}}}get Rd(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}_s(t){var e=Q.__PosthogExtensions__,n=this.Rd,r=e==null?void 0:e.postHogWebVitalsCallbacksByFlavor;r!=null&&r[n]||n==="web-vitals"&&F(r)&&e!=null&&e.postHogWebVitalsCallbacks?t():e==null||e.loadExternalDependency==null||e.loadExternalDependency(this._instance,n,i=>{i?ui.error("failed to load script",i):t()})}Md(t){var e=t||(T==null?void 0:T.location.href);if(e){var n=this._instance.config.disable_capture_url_hashes?Zr(e):e,r=this._instance.config.custom_personal_data_properties,i=this._instance.config.mask_personal_data_properties?[...ao,...r||[]]:[];return $a(n,i,Fa)}ui.error("Could not determine current URL")}}},fO={exceptionObserver:class{constructor(t){var e;this.Id=()=>{var n;if(T&&this.isEnabled&&(n=Q.__PosthogExtensions__)!=null&&n.errorWrappingFunctions){var r=Q.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=Q.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,s=Q.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Ad&&this.qi.capture_unhandled_errors&&(this.Ad=r(this.captureException.bind(this))),!this.Fd&&this.qi.capture_unhandled_rejections&&(this.Fd=i(this.captureException.bind(this))),!this.Od&&this.qi.capture_console_errors&&(this.Od=s(this.captureException.bind(this)))}catch(o){jo.error("failed to start",o),this.Ld()}}},this._instance=t,this.$d=!((e=this._instance.persistence)==null||!e.props[qh]),this.oe=new eT(N({},function(n){var r,i,s,o;return n===void 0&&(n={}),{refillRate:(r=(i=n.exceptionRateLimiterRefillRate)!==null&&i!==void 0?i:n.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(s=(o=n.exceptionRateLimiterBucketSize)!==null&&o!==void 0?o:n.__exceptionRateLimiterBucketSize)!==null&&s!==void 0?s:10}}(this._instance.config.error_tracking),{refillInterval:1e4,I:jo})),this.qi=this.Dd(),this.startIfEnabledOrStop()}Dd(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return xe(t)?e=N({},e,t):(F(t)?this.$d:t)&&(e=N({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.qi.capture_console_errors||this.qi.capture_unhandled_errors||this.qi.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(jo.info("enabled"),this.Ld(),this._s(this.Id)):this.Ld()}_s(t){var e,n;(e=Q.__PosthogExtensions__)!=null&&e.errorWrappingFunctions?t():(n=Q.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",r=>{if(r)return jo.error("failed to load script",r);t()})}Ld(){var t,e,n;(t=this.Ad)==null||t.call(this),this.Ad=void 0,(e=this.Fd)==null||e.call(this),this.Fd=void 0,(n=this.Od)==null||n.call(this),this.Od=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.$d=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[qh]:this.$d}),this.qi=this.Dd(),this.startIfEnabledOrStop())}}onConfigChange(){this.qi=this.Dd()}captureException(t){var e,n,r,i=(e=t==null||(n=t.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&e!==void 0?e:"Exception";this.oe.consumeRateLimit(i)?jo.info("Skipping exception capture because of client rate limiting.",{exception:i}):(r=this._instance.exceptions)==null||r.sendExceptionEvent(t)}},exceptions:class{constructor(t){var e,n;this.Nd=[],this.qd=new _T([new PT,new FT,new TT,new RT,new NT,new AT,new OT,new $T],function(r){for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;i>o;o++)s[o-1]=arguments[o];return function(a,l){l===void 0&&(l=0);for(var u=[],c=a.split(` +`),d=l;c.length>d;d++){var f=c[d];if(1024>=f.length){var _=gy.test(f)?f.replace(gy,"$1"):f;if(!_.match(/\S*Error: /)){for(var m of s){var p=m(_,r);if(p){u.push(p);break}}if(u.length>=50)break}}}return function(y){if(!y.length)return[];var h=Array.from(y);return h.reverse(),h.slice(0,50).map(v=>{return N({},v,{filename:v.filename||(x=h,x[x.length-1]||{}).filename,function:v.function||io});var x})}(u)}}("web:javascript",ET,kT)),this._instance=t,this.Nd=(e=(n=this._instance.persistence)==null?void 0:n.get_property(Hh))!==null&&e!==void 0?e:[],this.jd=Yu(this.Bd()),this.Hd=new jT(this.jd)}onConfigChange(){this.jd=Yu(this.Bd()),this.Hd.setConfig(this.jd)}onRemoteConfig(t){var e,n,r;if(t.ok){var i=t.config;if("errorTracking"in i){var s=(e=(n=i.errorTracking)==null?void 0:n.suppressionRules)!==null&&e!==void 0?e:[],o=(r=i.errorTracking)==null?void 0:r.captureExtensionExceptions;this.Nd=s,this._instance.persistence&&this._instance.persistence.register({[Hh]:this.Nd,[Wh]:o})}}}get Ud(){var t,e=!!this._instance.get_property(Wh),n=this._instance.config.error_tracking.captureExtensionExceptions;return(t=n??e)!==null&&t!==void 0&&t}buildProperties(t,e){return this.qd.buildFromUnknown(t,{syntheticException:e==null?void 0:e.syntheticException,mechanism:{handled:e==null?void 0:e.handled}})}addExceptionStep(t,e){if(this.jd.enabled)try{if(!ue(t)||t.trim().length===0)return void cn.warn("Ignoring exception step because message must be a non-empty string");var n=function(s){if(!s)return{sanitizedProperties:{},droppedKeys:[]};var o=[];return{sanitizedProperties:Object.keys(s).reduce((a,l)=>LT.has(l)?(o.push(l),a):(a[l]=s[l],a),{}),droppedKeys:o}}(this.zd(e)),r=n.sanitizedProperties,i=n.droppedKeys;i.length>0&&cn.warn("Ignoring reserved exception step fields",{droppedKeys:i}),this.Hd.add(N({[Ku]:t,[Qu]:new Date().toISOString()},r))}catch(s){cn.error("Failed to add exception step. Ignoring breadcrumb.",s)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.Wd(e)){if(this.Vd(e))return this.Gd("Exception dropped: matched a suppression rule"),void cn.info("Skipping exception capture because a suppression rule matched");if(!this.Ud&&this.Zd(e))return this.Gd("Exception dropped: thrown by a browser extension"),void cn.info("Skipping exception capture because it was thrown by an extension");if(!this.Ud&&this.Qd(e))return this.Gd("Exception dropped: thrown by an injected browser script"),void cn.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Jd(e))return this.Gd("Exception dropped: thrown by the PostHog SDK"),void cn.info("Skipping exception capture because it was thrown by the PostHog SDK")}var n=this.jd.enabled&&te(t.$exception_steps)?this.Kd(t):t,r=typeof(s=globalThis._posthogReleaseId)=="string"&&s.length>0?s:void 0;r&&(n.$release_id=r);try{var i=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",fl:!0});return i&&this.Hd.clear(),i}catch(o){return cn.error("Failed to capture exception event. Dropping this exception.",o),void this.Hd.clear()}}catch(o){return void cn.error("Failed to process exception event. Ignoring this exception.",o)}var s}Kd(t){try{var e=this.Hd.getAttachable();return e.length===0?t:N({},t,{$exception_steps:e})}catch(n){return cn.error("Failed to read buffered exception steps. Capturing exception without steps.",n),t}}Gd(t){this.jd.enabled&&this.Hd.add({[Ku]:t,[Qu]:new Date().toISOString()})}zd(t){return xe(t)?N({},t):{}}Bd(){var t,e;return(t=(e=this._instance.config.error_tracking)==null?void 0:e.exception_steps)!==null&&t!==void 0?t:{}}Vd(t){if(t.length===0)return!1;try{var e=t.reduce((n,r)=>{var i=r.type,s=r.value;return ue(i)&&i.length>0&&n.$exception_types.push(i),ue(s)&&s.length>0&&n.$exception_values.push(s),n},{$exception_types:[],$exception_values:[]});return this.Nd.some(n=>{var r=n.values.map(i=>{var s=wE[i.operator],o=e[i.key];if(!s||!o)return!1;var a=X(i.value)?i.value:[i.value];return a.length>0&&s(a,o)});return n.type==="OR"?r.some(Boolean):r.every(Boolean)})}catch(n){return cn.warn("Failed to evaluate suppression rules. Capturing the exception.",n),!1}}Zd(t){return t.flatMap(e=>{var n,r;return(n=(r=e.stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[]}).some(e=>{var n=e.filename;return!!n&&aO.some(r=>n.startsWith(r))})}Qd(t){return t.some(e=>{var n=e.value;return ue(n)&&lO.some(r=>n.includes(r))})}Jd(t){if(t.length>0){var e,n,r,i,s=(e=(n=t[0].stacktrace)==null?void 0:n.frames)!==null&&e!==void 0?e:[],o=s[s.length-1];return(r=o==null||(i=o.filename)==null?void 0:i.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}Wd(t){return!te(t)&&X(t)}}},hO=N({productTours:class{get za(){return this._instance.persistence}constructor(t){this.Yd=null,this.Xd=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(t.ok){var e=t.config;if("productTours"in e){var n,r;if(this.za&&this.za.register({[qv]:!!e.productTours}),!vf(this._instance))return!this.Yd&&te((n=this.za)==null?void 0:n.props[Ko])||Fl.info("product tours disabled; stopping and clearing cached tours"),(r=this.Yd)==null||r.stop(),this.Yd=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.Yd&&vf(this._instance)&&this._s(()=>this.tv())}_s(t){var e,n;(e=Q.__PosthogExtensions__)!=null&&e.generateProductTours?t():(n=Q.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",r=>{r?Fl.error("Could not load product tours script",r):t()})}tv(){var t;!this.Yd&&(t=Q.__PosthogExtensions__)!=null&&t.generateProductTours&&(this.Yd=Q.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(e===void 0&&(e=!1),!X(this.Xd)||e){var n=this.za;if(n){var r=n.props[Ko];if(X(r)&&!e)return this.Xd=r,void t(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",timestampMode:"query",callback:i=>{if(vf(this._instance)){var s=i.statusCode;if(s!==200||!i.json){var o="Product Tours API could not be loaded, status: "+s;return s===0?i.error||Fl.warn(o):Fl.error(o),void t([],{isLoaded:!1,error:o})}var a=X(i.json.product_tours)?i.json.product_tours:[];this.Xd=a,n&&n.register({[Ko]:a}),t(a,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.Xd,{isLoaded:!0})}getActiveProductTours(t){te(this.Yd)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.Yd.getActiveProductTours(t)}showProductTour(t){var e;(e=this.Yd)==null||e.showTourById(t)}previewTour(t){this.Yd?this.Yd.previewTour(t):this._s(()=>{var e;this.tv(),(e=this.Yd)==null||e.previewTour(t)})}dismissProductTour(){var t;(t=this.Yd)==null||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.Yd)==null||t.nextStep()}previousStep(){var t;(t=this.Yd)==null||t.previousStep()}clearCache(){var t;this.Xd=null,(t=this.za)==null||t.unregister(Ko)}resetTour(t){var e;(e=this.Yd)==null||e.resetTour(t)}resetAllTours(){var t;(t=this.Yd)==null||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.Yd)==null||e.cancelPendingTour(t)}}},Hc),pO={siteApps:class{constructor(t){this.ev=0,this._instance=t,this.iv=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}rv(t,e){if(e){var n=this.globalsForEvent(e);this.iv.push(n),this.iv.length>1e3&&(this.iv=this.iv.slice(10))}}get siteAppLoaders(){var t;return(t=Q._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.rv.bind(this));this.nv=()=>{t(),this.iv=[],this.nv=void 0}}}globalsForEvent(t){var e,n,r,i,s,o,a;if(!t)throw new Error("Event payload is required");var l={},u=this._instance.get_property("$groups")||[],c=this._instance.get_property("$stored_group_properties")||{};for(var d of Object.entries(c)){var f=d[0];l[f]={id:u[f],type:f,properties:d[1]}}var _=t.$set_once,m=t.$set;return{event:N({},Ux(t,JI),{properties:N({},t.properties,m?{$set:N({},(e=(n=t.properties)==null?void 0:n.$set)!==null&&e!==void 0?e:{},m)}:{},_?{$set_once:N({},(r=(i=t.properties)==null?void 0:i.$set_once)!==null&&r!==void 0?r:{},_)}:{}),elements_chain:(s=(o=t.properties)==null?void 0:o.$elements_chain)!==null&&s!==void 0?s:"",distinct_id:(a=t.properties)==null?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}sv(t){var e,n=(e=t.tagName)==null?void 0:e.toLowerCase();return n==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(kn.error("prepare_external_dependency_stylesheet returned null"),null):n==="script"&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(t)||(kn.error("prepare_external_dependency_script returned null"),null):t}av(){var t,e,n,r,i,s,o,a;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var l=j==null?void 0:j.defaultView,u=l==null||(t=l.Node)==null?void 0:t.prototype;if(!l||!u)return()=>{};if(this.ev++,this.ov)return this.lv();var c=[],d=this,f=new WeakSet,_=(y,h,v)=>{if(y!=null&&y[h]){var x=y[h];y[h]=v(x),c.push(()=>{y[h]=x})}},m=y=>{if(f.has(y))return y;var h=d.sv(y);return h&&f.add(h),h},p=y=>y.map(h=>typeof h=="string"?h:m(h)).filter(h=>!et(h));return _(u,"appendChild",y=>function(h){var v=m(h);return v?y.call(this,v):h}),_(u,"insertBefore",y=>function(h,v){var x=m(h);return x?y.call(this,x,v):h}),_(u,"replaceChild",y=>function(h,v){var x=m(h);return x?y.call(this,x,v):v}),[(e=l.Element)==null?void 0:e.prototype,(n=l.Document)==null?void 0:n.prototype,(r=l.DocumentFragment)==null?void 0:r.prototype].forEach(y=>{_(y,"append",h=>function(){for(var v=arguments.length,x=new Array(v),b=0;v>b;b++)x[b]=arguments[b];return h.apply(this,p(x))}),_(y,"prepend",h=>function(){for(var v=arguments.length,x=new Array(v),b=0;v>b;b++)x[b]=arguments[b];return h.apply(this,p(x))})}),[(i=l.Element)==null?void 0:i.prototype,(s=l.CharacterData)==null?void 0:s.prototype,(o=l.DocumentType)==null?void 0:o.prototype].forEach(y=>{_(y,"before",h=>function(){for(var v=arguments.length,x=new Array(v),b=0;v>b;b++)x[b]=arguments[b];return h.apply(this,p(x))}),_(y,"after",h=>function(){for(var v=arguments.length,x=new Array(v),b=0;v>b;b++)x[b]=arguments[b];return h.apply(this,p(x))}),_(y,"replaceWith",h=>function(){for(var v=arguments.length,x=new Array(v),b=0;v>b;b++)x[b]=arguments[b];var E=p(x);return x.length&&!E.length?void 0:h.apply(this,E)})}),_((a=l.Element)==null?void 0:a.prototype,"insertAdjacentElement",y=>function(h,v){var x=m(v);return x?y.call(this,h,x):null}),this.ov=()=>{c.forEach(y=>y()),this.ov=void 0},this.lv()}lv(){var t=!1;return()=>{var e;t||(t=!0,this.ev--,this.ev===0&&((e=this.ov)==null||e.call(this)))}}uv(t,e){e===void 0&&(e=!0);var n=this.av();try{var r=t(n);return e&&n(),r}catch(i){throw n(),i}}setupSiteApp(t){var e=this.apps[t.id],n=()=>{var o;!e.errored&&this.iv.length&&(kn.info("Processing "+this.iv.length+" events for site app with id "+t.id),this.iv.forEach(a=>this.uv(()=>e.processEvent==null?void 0:e.processEvent(a))),e.processedBuffer=!0),Object.values(this.apps).every(a=>a.processedBuffer||a.errored)&&((o=this.nv)==null||o.call(this))},r=!1,i=o=>{e.errored=!o,e.loaded=!0,kn.info("Site app with id "+t.id+" "+(o?"loaded":"errored")),r&&n()};try{var s=this.uv(o=>t.init({posthog:this._instance,callback(a){o(),i(a)}}),!1).processEvent;s&&(e.processEvent=s),r=!0}catch(o){kn.error(n_+t.id,o),i(!1)}if(r&&e.loaded)try{n()}catch(o){kn.error("Error while processing buffered events PostHog app with config id "+t.id,o),e.errored=!0}}hv(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of t)this.setupSiteApp(n)}dv(t){var e=this;if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(t),r=function(s){try{e.uv(()=>s.processEvent==null?void 0:s.processEvent(n))}catch(o){kn.error("Error while processing event "+t.event+" for site app "+s.id,o)}};for(var i of Object.values(this.apps))r(i)}}onRemoteConfig(t){var e,n,r,i=this;if((e=this.siteAppLoaders)!=null&&e.length)return this.isEnabled?(this.hv(),void this._instance.on("eventCaptured",l=>this.dv(l))):void kn.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.nv)==null||n.call(this),t.ok){var s=t.config;if((r=s.siteApps)!=null&&r.length)if(this.isEnabled){var o=function(){var l,u=a.id,c=a.url;Q["__$$ph_site_app_"+u]=i._instance,(l=Q.__PosthogExtensions__)==null||l.loadSiteApp==null||l.loadSiteApp(i._instance,c,d=>{if(d)return kn.error(n_+u,d)})};for(var a of s.siteApps)o()}else kn.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},vO={tracingHeaders:class{constructor(t){this.vv=void 0,this.fv=void 0,this.pv=void 0,this.Id=()=>{var e,n,r=this.gv();r?(F(this.vv)&&(this.vv=(e=Q.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null?void 0:e._patchXHR(r,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),F(this.fv)&&(this.fv=(n=Q.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null?void 0:n._patchFetch(r,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.Ld()},this._instance=t}initialize(){this.startIfEnabledOrStop()}_s(t){var e,n;(e=Q.__PosthogExtensions__)!=null&&e.tracingHeadersPatchFns?t():(n=Q.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",r=>{if(r)return YI.error("failed to load script",r);t()})}mv(){var t,e;return(t=(e=this._instance.config.tracing_headers)!==null&&e!==void 0?e:this._instance.config.addTracingHeaders)!==null&&t!==void 0?t:this._instance.config.__add_tracing_headers}gv(){var t=this.mv();return X(t)?(X(this.pv)?this.pv.splice(0,this.pv.length,...t):this.pv=[...t],t.length>0?this.pv:void 0):(X(this.pv)&&this.pv.splice(0),this.pv=t||void 0,this.pv)}Ld(){var t,e;(t=this.vv)==null||t.call(this),(e=this.fv)==null||e.call(this),this.vv=void 0,this.fv=void 0}startIfEnabledOrStop(){this.gv()?this._s(this.Id):this.Ld()}}},gO=N({surveys:class extends ZI{constructor(t){var e;super(new iO(t),{get projectToken(){return e.config.token},kv:new rO(e=t)}),this._instance=t}Nl(t,e){var n=e.query?tl(t,e.query):t;return new Promise(r=>{var i;this._instance._send_request({method:e.method,url:this._instance.requestRouter.endpointFor((i=e.target)!==null&&i!==void 0?i:"api",n),data:e.body,headers:e.headers,timeout:e.timeoutMs,fireCallbackOnDrop:!0,transport:e.transport,compression:e.compression,timestampMode:e.sentAt,callback:r})})}}},Hc),mO={toolbar:class{constructor(t){this.instance=t}yv(t){Q.ph_toolbar_state=t}bv(){var t;return(t=Q.ph_toolbar_state)!==null&&t!==void 0?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,e,n){if(t===void 0&&(t=void 0),e===void 0&&(e=void 0),n===void 0&&(n=void 0),rp(this.instance.config)||!T||!j)return!1;t=t??T.location,n=n??T.history;try{if(!e){try{T.localStorage.setItem("test","test"),T.localStorage.removeItem("test")}catch{return!1}e=T==null?void 0:T.localStorage}var r,i=sO||ac(t.hash,"__posthog")||ac(t.hash,"state"),s=i?_y(()=>JSON.parse(atob(decodeURIComponent(i))))||_y(()=>JSON.parse(decodeURIComponent(i))):null;return s&&s.action==="ph_authorize"?((r=s).source="url",r&&Object.keys(r).length>0&&(s.desiredHash?t.hash=s.desiredHash:n?n.replaceState(n.state,"",t.pathname+t.search):t.hash="")):((r=JSON.parse(e.getItem(i_)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch{return!1}}_v(t){var e=Q.ph_load_toolbar||Q.ph_load_editor;!te(e)&&ft(e)?e(t,this.instance):s_.warn("No toolbar load function found")}loadToolbar(t){var e=!(j==null||!j.getElementById(jb));if(!T||e)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=N({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(T.localStorage.setItem(i_,JSON.stringify(N({},r,{source:void 0}))),this.bv()===2)this._v(r);else if(this.bv()===0){var i;this.yv(1),(i=Q.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this.instance,"toolbar",s=>{if(s)return s_.error("[Toolbar] Failed to load",s),void this.yv(0);this.yv(2),this._v(r)}),Ce(T,"turbolinks:load",()=>{this.yv(0),this.loadToolbar(r)})}return!0}wv(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,n){return t===void 0&&(t=void 0),e===void 0&&(e=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(t,e,n)}}},yO=N({experiments:ct},Hc),_O={conversations:class{constructor(t){this.Sv=void 0,this._conversationsManager=null,this.xv=!1,this.Me=null,this.Cv=!1,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&(this.Tv=t.ok,t.ok)){var e=t.config.conversations;te(e)||(It(e)?this.Sv=e:(this.Sv=e.enabled,this.Me=e),this.loadIfEnabled())}}reset(){var t;(t=this._conversationsManager)==null||t.reset(),this._conversationsManager=null,this.Sv=void 0,this.Me=null,this.Tv=void 0,this.Cv=!1}loadIfEnabled(){if(!(this._conversationsManager||this.xv||this._instance.config.disable_conversations||rp(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=Q==null?void 0:Q.__PosthogExtensions__;if(t&&!F(this.Sv)&&this.Sv)if(this.Me&&this.Me.token){this.xv=!0;try{var e=t.initConversations;if(e)return this.Mv(e),void(this.xv=!1);var n=t.loadExternalDependency;if(!n)return void this.Ev(Wv);n(this._instance,"conversations",r=>{r||!t.initConversations?this.Ev("Could not load conversations script",r):this.Mv(t.initConversations),this.xv=!1})}catch(r){this.Ev("Error initializing conversations",r),this.xv=!1}}else Qt.error("Conversations enabled but missing token in remote config.")}}Mv(t){if(this.Me)try{this._conversationsManager=t(this.Me,this._instance),this.Cv=!1,Qt.info("Conversations loaded successfully")}catch(e){this.Ev("Error completing conversations initialization",e)}else Qt.error("Cannot complete initialization: remote config is null")}Ev(t,e){Qt.error(t,e),this._conversationsManager=null,this.xv=!1,this.Cv=!0}show(){this._conversationsManager?this._conversationsManager.show():Qt.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Sv===!0&&!et(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":rp(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":this.Tv===!1?"remote_config_failed":F(this.Sv)?this.Tv?"disabled_in_project":"remote_config_pending":this.Sv?te(this.Me)||!this.Me.token?"missing_token":Q!=null&&Q.__PosthogExtensions__?this.xv?"initializing":this.Cv?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.isVisible())!==null&&t!==void 0&&t}sendMessage(t,e,n){var r=this;return be(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,n):(Qt.warn(di),null)})()}getMessages(t,e){var n=this;return be(function*(){return n._conversationsManager?n._conversationsManager.getMessages(t,e):(Qt.warn(di),null)})()}markAsRead(t){var e=this;return be(function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(Qt.warn(di),null)})()}getTickets(t){var e=this;return be(function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(Qt.warn(di),null)})()}requestRestoreLink(t){var e=this;return be(function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(Qt.warn(di),null)})()}restoreFromToken(t){var e=this;return be(function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(Qt.warn(di),null)})()}restoreFromUrlToken(){var t=this;return be(function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Qt.warn(di),null)})()}getCurrentTicketId(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.getCurrentTicketId())!==null&&t!==void 0?t:null}getWidgetSessionId(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.getWidgetSessionId())!==null&&t!==void 0?t:null}Sl(){var t;(t=this._conversationsManager)==null||t.setIdentity()}xl(){var t;(t=this._conversationsManager)==null||t.clearIdentity()}}},wO={logs:class{constructor(t){var e,n=this;this.Iv=!1,this.Rv=!1,this.I=Pe("[logs]"),this.Pv=N({},this.I,{error(){for(var r=arguments.length,i=new Array(r),s=0;r>s;s++)i[s]=arguments[s];i.some(h_)||n.I.error(...i)}}),this.ka=[],this.Av=[],this.ph=0,this.Fv=()=>{var r,i;this.ph=0,(r=this.Ov)==null||r.onReconnect(),(i=this.Lv)==null||i.onReconnect()},this._instance=t,this._instance&&(e=this._instance.config.logs)!=null&&e.captureConsoleLogs&&(this.Iv=!0),T&&Ce(T,"online",this.Fv)}$v(t,e,n,r){var i,s=function(o,a){var l,u,c,d,f,_,m,p=(l=o==null?void 0:o.flushIntervalMs)!==null&&l!==void 0?l:3e3,y=(u=o==null?void 0:o.maxBufferSize)!==null&&u!==void 0?u:100,h=a!=null&&a.consoleCapture?void 0:(c=o==null?void 0:o.maxLogsPerInterval)!==null&&c!==void 0?c:1e3,v=F(h)?Math.max(y,2048):Math.max(y,h),x=o==null?void 0:o.resourceAttributes;return{serviceName:(d=(f=x==null?void 0:x["service.name"])!==null&&f!==void 0?f:o==null?void 0:o.serviceName)!==null&&d!==void 0?d:a==null?void 0:a.serviceNameDefault,serviceVersion:(_=x==null?void 0:x["service.version"])!==null&&_!==void 0?_:o==null?void 0:o.serviceVersion,environment:(m=x==null?void 0:x["deployment.environment"])!==null&&m!==void 0?m:o==null?void 0:o.environment,resourceAttributes:x,beforeSend:o==null?void 0:o.beforeSend,flushIntervalMs:p,maxBufferSize:y,maxQueueSize:v,maxBatchRecordsPerPost:100,rateCapWindowMs:p,maxLogsPerInterval:h,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}((i=this._instance)==null||(i=i.config)==null?void 0:i.logs,n);return[new gT(this.Dv(t,e),s,this.Pv,()=>this.Nv(),o=>o(),void 0,r),s]}qv(){var t,e=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;if(!this.Ov||this.jv!==e){var n;(n=this.Ov)==null||n.reset(),this.jv=e;var r=this.$v(()=>this.ka,i=>{this.ka=i});this.Ov=r[0],this.Bv=r[1]}return this.Ov}Hv(){var t,e=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;if(!this.Lv||this.Uv!==e){var n;(n=this.Lv)==null||n.reset(),this.Uv=e;var r=this.$v(()=>this.Av,i=>{this.Av=i},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},f_);this.Lv=r[0],this.zv=r[1]}return this.Lv}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e;if(t.ok){var n=(e=t.config.logs)==null?void 0:e.captureConsoleLogs;!te(n)&&n&&(this.Iv=!0,this.loadIfEnabled())}}reset(){var t,e;this.ka=[],(t=this.Ov)==null||t.reset(),this.Av=[],(e=this.Lv)==null||e.reset(),this.ph=0}captureLog(t){this.qv().captureLog(t)}vi(t){this.Hv().captureLog(t)}get logger(){return this.Wv||(this.Wv={trace:(t,e)=>this.captureLog({body:t,level:"trace",attributes:e}),debug:(t,e)=>this.captureLog({body:t,level:"debug",attributes:e}),info:(t,e)=>this.captureLog({body:t,level:"info",attributes:e}),warn:(t,e)=>this.captureLog({body:t,level:"warn",attributes:e}),error:(t,e)=>this.captureLog({body:t,level:"error",attributes:e}),fatal:(t,e)=>this.captureLog({body:t,level:"fatal",attributes:e})}),this.Wv}flushLogs(t){t?this.Vv(t):(this.Ov&&this.Ov.flush().catch(e=>this.Gv(e)),this.Lv&&this.Lv.flush().catch(e=>this.Gv(e)))}Gv(t){h_(t)||this.I.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(this.Iv&&!this.Rv){var t=Q==null?void 0:Q.__PosthogExtensions__;if(t){var e=t.loadExternalDependency;e?e(this._instance,"logs",n=>{var r;n||(r=t.logs)==null||!r.initializeLogs?this.I.error("Could not load logs script",n):(t.logs.initializeLogs(this._instance),this.Rv=!0)}):this.I.error(Wv)}else this.I.error("PostHog Extensions not found.")}}Dv(t,e){var n=this._instance;return{get isDisabled(){return!1},get optedOut(){return!n.is_capturing()},getPersistedProperty:r=>r===Xn.LogsQueue?t():void 0,setPersistedProperty(r,i){var s;r===Xn.LogsQueue&&e((s=i)!==null&&s!==void 0?s:[])},Mn:r=>this.Mn(r),getLibraryId:()=>we.LIB_NAME,getLibraryVersion:()=>we.LIB_VERSION}}Mn(t){return new Promise(e=>{if(Xb(this.ph,3))e({kind:"fatal",error:mf(void 0,"logs endpoint is unreachable, dropping batch")});else{var n=!1,r=s=>{n||(n=!0,clearTimeout(i),e(s))},i=setTimeout(()=>{this.I.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:mf(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.Zv(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:s=>{var o=s.statusCode;if(this.Qv(o),o>=200&&300>o)r({kind:"ok"});else if(o===413)r({kind:"too-large"});else if(o!==0&&o!==408&&o!==429&&500>o)r({kind:"fatal",error:new Error("logs request failed with status "+o)});else{var a;o===0?(s.error||this.I.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:mf(s.error,"logs request failed before receiving an HTTP response")})):r({kind:"retry-later",error:(a=s.error)!==null&&a!==void 0?a:new Error("logs request failed with status "+o)})}}})}})}Qv(t){(t!==0||this._instance.__loaded)&&(this.ph=Jb(t,this.ph,3,()=>this.I.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")))}Vv(t){this.ka.length>0&&this.Jv(t,this.ka,this.Bv,we.LIB_NAME,e=>{this.ka=e}),this.Av.length>0&&this.Jv(t,this.Av,this.zv,f_,e=>{this.Av=e})}Jv(t,e,n,r,i){if(e.length!==0){var s=e.map(a=>a.record);i([]);var o=wb(s,_b(n,we.LIB_NAME,we.LIB_VERSION),r,we.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Zv(),data:o,compression:"best-available",batchKey:"logs",transport:t})}}Zv(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}Nv(){var t,e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var n=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),r=n.windowId,i=n.sessionStartTimestamp,s=n.lastActivityTimestamp;e.sessionId=n.sessionId,e.windowId=r,te(i)||(e.sessionStartTimestamp=i),te(s)||(e.lastActivityTimestamp=s)}if(Q!=null&&(t=Q.location)!=null&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?Zr(Q.location.href):Q.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(e.activeFeatureFlags=o)}return e}}},xO={metrics:class{constructor(t){this.I=Pe("[metrics]"),this._instance=t}initialize(){}qv(){var t,e,n=(t=this._instance)==null||(t=t.config)==null?void 0:t.metrics;return this.Ov&&this.jv===n||((e=this.Ov)==null||e.reset(),this.jv=n,this.Ov=new mT(this.Dv(),function(r){var i,s,o,a,l,u=r==null?void 0:r.resourceAttributes;return{serviceName:(i=u==null?void 0:u["service.name"])!==null&&i!==void 0?i:r==null?void 0:r.serviceName,serviceVersion:(s=u==null?void 0:u["service.version"])!==null&&s!==void 0?s:r==null?void 0:r.serviceVersion,environment:(o=u==null?void 0:u["deployment.environment"])!==null&&o!==void 0?o:r==null?void 0:r.environment,resourceAttributes:u,beforeSend:r==null?void 0:r.beforeSend,flushIntervalMs:(a=r==null?void 0:r.flushIntervalMs)!==null&&a!==void 0?a:1e4,maxSeriesPerFlush:(l=r==null?void 0:r.maxSeriesPerFlush)!==null&&l!==void 0?l:1e3}}(n),this.I)),this.Ov}count(t,e,n){e===void 0&&(e=1),this.qv().count(t,e,n)}gauge(t,e,n){this.qv().gauge(t,e,n)}histogram(t,e,n){this.qv().histogram(t,e,n)}flush(t){if(!this.Ov)return Promise.resolve();if(t){var e=this.Ov.drainWindow();return e&&this.Un(e,t),Promise.resolve()}return this.Ov.flush().catch(n=>this.I.error("PostHog metrics flush failed:",n))}reset(){var t;(t=this.Ov)==null||t.reset()}Dv(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Un:n=>e.Un(n),getLibraryId:()=>we.LIB_NAME,getLibraryVersion:()=>we.LIB_VERSION}}Un(t,e){return new Promise(n=>{var r=!1,i=o=>{r||(r=!0,clearTimeout(s),n(o))},s=setTimeout(()=>i({kind:"retry-later",error:new Error("metrics request timed out")}),9e4);this._instance._send_request(N({method:"POST",url:this.Kv(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(o){var a=o.statusCode;if(a>=200&&300>a)i({kind:"ok"});else if(a===413)i({kind:"too-large"});else if(a!==0&&a!==408&&a!==429&&500>a)i({kind:"fatal",error:new Error("metrics request failed with status "+a)});else{var l;i({kind:"retry-later",error:(l=o.error)!==null&&l!==void 0?l:new Error("metrics request failed with status "+a)})}}}))})}Kv(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},bO=N({},Hc,cO,dO,fO,hO,pO,gO,vO,mO,yO,_O,wO,xO);Dt.__defaultExtensionClasses=N({},bO);var EO=function(){we.SDK_DIST_CHANNEL="npm";var t=ca[us]=new Dt;return function(){function e(){e.done||(e.done=!0,kE=!1,he(ca,function(n){n._dom_loaded()}))}j!=null&&j.addEventListener?j.readyState==="complete"?e():Ce(j,"DOMContentLoaded",e,{capture:!1}):T&&D.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),t}(),IE;function SO(t){IE=t}function CO(){return IE}var kO=g.createContext({get client(){return CO()},bootstrap:void 0}),yf=function(t){return typeof t=="function"},PO=function(t){return t===void 0},vp=function(t,e){return vp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},vp(t,e)};function RO(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");vp(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var cu=function(t){var e=Object.prototype.toString.call(t);return t instanceof Error||e==="[object Error]"||e==="[object Exception]"||e==="[object DOMException]"||e==="[object DOMError]"},TO=function(t,e){for(var n=new WeakSet,r=t;!n.has(r);){if(n.add(r),!cu(r.cause)){PO(r.cause)||(e.cause=r.cause),r.cause=e;return}r=r.cause}},IO=function(t,e){if(!e)return t;var n=new Error(cu(t)?t.message:"Primitive value captured as exception: ".concat(String(t)));return n.name="React ErrorBoundary ".concat(cu(t)?t.name:"Error"),n.stack=e,cu(t)?(TO(t,n),t):n},OO={componentStack:null,exceptionEvent:null,error:null},MO={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."};(function(t){RO(e,t);function e(n){var r=t.call(this,n)||this;return r.state=OO,r}return e.prototype.componentDidCatch=function(n,r){var i=this.props.additionalProperties,s;yf(i)?s=i(n,r):typeof i=="object"&&(s=i);var o=this.context.client,a=r.componentStack,l=o.captureException(IO(n,a),s);this.setState({error:n,componentStack:a??null,exceptionEvent:l})},e.prototype.render=function(){var n=this.props,r=n.children,i=n.fallback,s=this.state;if(s.componentStack==null)return yf(r)?r():r;var o=yf(i)?V.createElement(i,{error:s.error,componentStack:s.componentStack,exceptionEvent:s.exceptionEvent}):i;return V.isValidElement(o)?o:(console.warn(MO.INVALID_FALLBACK),V.createElement(V.Fragment,null))},e.contextType=kO,e})(V.Component);SO(EO);class OE extends V.Component{constructor(){super(...arguments);wr(this,"state",{failed:!1,resetKey:this.props.resetKey})}static getDerivedStateFromError(){return{failed:!0}}static getDerivedStateFromProps(n,r){return n.resetKey===r.resetKey?null:{failed:!1,resetKey:n.resetKey}}componentDidCatch(n){console.error("The application could not render",n)}render(){if(!this.state.failed)return this.props.children;const n=w.jsxs("div",{className:"page",role:"alert",children:[w.jsx("h1",{children:"This page could not load"}),w.jsx("p",{children:"The site may have been updated while this tab was open."}),w.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>window.location.reload(),children:"Reload page"})]});return this.props.resetKey===void 0?w.jsx("main",{children:n}):n}}const _f="pwc:chunk-reload-at",ME=6e4;function AO(t,e){if(!t)return!0;const n=Number(t);return!Number.isFinite(n)||e-n>=ME}function NO(){if(typeof window>"u")return()=>{};const t=n=>{const r=Date.now();AO(sessionStorage.getItem(_f),r)&&(n.preventDefault(),sessionStorage.setItem(_f,String(r)),window.location.reload())};window.addEventListener("vite:preloadError",t);const e=window.setTimeout(()=>sessionStorage.removeItem(_f),ME);return()=>{window.removeEventListener("vite:preloadError",t),window.clearTimeout(e)}}const $O="modulepreload",FO=function(t){return"/"+t},p_={},oe=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(n.map(l=>{if(l=FO(l),l in p_)return;p_[l]=!0;const u=l.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${c}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":$O,u||(d.as="script"),d.crossOrigin="",d.href=l,a&&d.setAttribute("nonce",a),document.head.appendChild(d),u)return new Promise((f,_)=>{d.addEventListener("load",f),d.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${l}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return e().catch(s)})};/** + * @remix-run/router v1.23.2 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function La(){return La=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function Wc(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function DO(){return Math.random().toString(36).substr(2,8)}function g_(t,e){return{usr:t.state,key:t.key,idx:e}}function fc(t,e,n,r){return n===void 0&&(n=null),La({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Hi(e):e,{state:n,key:e&&e.key||r||DO()})}function ja(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Hi(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function AE(t,e,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,o=i.history,a=Ur.Pop,l=null,u=c();u==null&&(u=0,o.replaceState(La({},o.state,{idx:u}),""));function c(){return(o.state||{idx:null}).idx}function d(){a=Ur.Pop;let y=c(),h=y==null?null:y-u;u=y,l&&l({action:a,location:p.location,delta:h})}function f(y,h){a=Ur.Push;let v=fc(p.location,y,h);n&&n(v,y),u=c()+1;let x=g_(v,u),b=p.createHref(v);try{o.pushState(x,"",b)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;i.location.assign(b)}s&&l&&l({action:a,location:p.location,delta:1})}function _(y,h){a=Ur.Replace;let v=fc(p.location,y,h);n&&n(v,y),u=c();let x=g_(v,u),b=p.createHref(v);o.replaceState(x,"",b),s&&l&&l({action:a,location:p.location,delta:0})}function m(y){let h=i.location.origin!=="null"?i.location.origin:i.location.href,v=typeof y=="string"?y:ja(y);return v=v.replace(/ $/,"%20"),je(h,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,h)}let p={get action(){return a},get location(){return t(i,o)},listen(y){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(v_,d),l=y,()=>{i.removeEventListener(v_,d),l=null}},createHref(y){return e(i,y)},createURL:m,encodeLocation(y){let h=m(y);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:f,replace:_,go(y){return o.go(y)}};return p}var m_;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(m_||(m_={}));function zO(t,e,n){return n===void 0&&(n="/"),UO(t,e,n)}function UO(t,e,n,r){let i=typeof e=="string"?Hi(e):e,s=uo(i.pathname||"/",n);if(s==null)return null;let o=NE(t);VO(o);let a=null;for(let l=0;a==null&&l{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&(je(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=Yr([r,l.relativePath]),c=n.concat(l);s.children&&s.children.length>0&&(je(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),NE(s.children,e,c,u)),!(s.path==null&&!s.index)&&e.push({path:u,score:QO(u,s.index),routesMeta:c})};return t.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let l of $E(s.path))i(s,o,l)}),e}function $E(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=$E(r.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),i&&a.push(...o),a.map(l=>t.startsWith("/")&&l===""?"/":l)}function VO(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:YO(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const BO=/^:[\w-]+$/,qO=3,HO=2,WO=1,GO=10,KO=-2,y_=t=>t==="*";function QO(t,e){let n=t.split("/"),r=n.length;return n.some(y_)&&(r+=KO),e&&(r+=HO),n.filter(i=>!y_(i)).reduce((i,s)=>i+(BO.test(s)?qO:s===""?WO:GO),r)}function YO(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function XO(t,e,n){let{routesMeta:r}=t,i={},s="/",o=[];for(let a=0;a{let{paramName:f,isOptional:_}=c;if(f==="*"){let p=a[d]||"";o=s.slice(0,s.length-p.length).replace(/(.)\/+$/,"$1")}const m=a[d];return _&&!m?u[f]=void 0:u[f]=(m||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:o,pattern:t}}function JO(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),Wc(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function ZO(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Wc(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function uo(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}const eM=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,tM=t=>eM.test(t);function nM(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?Hi(t):t,s;if(n)if(tM(n))s=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),Wc(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?s=__(n.substring(1),"/"):s=__(n,e)}else s=e;return{pathname:s,search:sM(r),hash:oM(i)}}function __(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function wf(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function rM(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function Zv(t,e){let n=rM(t);return e?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function eg(t,e,n,r){r===void 0&&(r=!1);let i;typeof t=="string"?i=Hi(t):(i=La({},t),je(!i.pathname||!i.pathname.includes("?"),wf("?","pathname","search",i)),je(!i.pathname||!i.pathname.includes("#"),wf("#","pathname","hash",i)),je(!i.search||!i.search.includes("#"),wf("#","search","hash",i)));let s=t===""||i.pathname==="",o=s?"/":i.pathname,a;if(o==null)a=n;else{let d=e.length-1;if(!r&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),d-=1;i.pathname=f.join("/")}a=d>=0?e[d]:"/"}let l=nM(i,a),u=o&&o!=="/"&&o.endsWith("/"),c=(s||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const Yr=t=>t.join("/").replace(/\/\/+/g,"/"),iM=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),sM=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,oM=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function aM(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const FE=["post","put","patch","delete"];new Set(FE);const lM=["get",...FE];new Set(lM);/** + * React Router v6.30.3 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Da(){return Da=Object.assign?Object.assign.bind():function(t){for(var e=1;e{a.current=!0}),g.useCallback(function(u,c){if(c===void 0&&(c={}),!a.current)return;if(typeof u=="number"){r.go(u);return}let d=eg(u,JSON.parse(o),s,c.relative==="path");t==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:Yr([e,d.pathname])),(c.replace?r.replace:r.push)(d,c.state,c)},[e,r,o,s,t])}const dM=g.createContext(null);function fM(t){let e=g.useContext(Vn).outlet;return e&&g.createElement(dM.Provider,{value:t},e)}function zE(){let{matches:t}=g.useContext(Vn),e=t[t.length-1];return e?e.params:{}}function Qc(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=g.useContext(vr),{matches:i}=g.useContext(Vn),{pathname:s}=an(),o=JSON.stringify(Zv(i,r.v7_relativeSplatPath));return g.useMemo(()=>eg(t,JSON.parse(o),s,n==="path"),[t,o,s,n])}function hM(t,e){return pM(t,e)}function pM(t,e,n,r){mo()||je(!1);let{navigator:i}=g.useContext(vr),{matches:s}=g.useContext(Vn),o=s[s.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=an(),c;if(e){var d;let y=typeof e=="string"?Hi(e):e;l==="/"||(d=y.pathname)!=null&&d.startsWith(l)||je(!1),c=y}else c=u;let f=c.pathname||"/",_=f;if(l!=="/"){let y=l.replace(/^\//,"").split("/");_="/"+f.replace(/^\//,"").split("/").slice(y.length).join("/")}let m=zO(t,{pathname:_}),p=_M(m&&m.map(y=>Object.assign({},y,{params:Object.assign({},a,y.params),pathname:Yr([l,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:Yr([l,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),s,n,r);return e&&p?g.createElement(Kc.Provider,{value:{location:Da({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:Ur.Pop}},p):p}function vM(){let t=EM(),e=aM(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},e),n?g.createElement("pre",{style:i},n):null,null)}const gM=g.createElement(vM,null);class mM extends g.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?g.createElement(Vn.Provider,{value:this.props.routeContext},g.createElement(jE.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function yM(t){let{routeContext:e,match:n,children:r}=t,i=g.useContext(Gc);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),g.createElement(Vn.Provider,{value:e},r)}function _M(t,e,n,r){var i;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var s;if(!n)return null;if(n.errors)t=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let o=t,a=(i=n)==null?void 0:i.errors;if(a!=null){let c=o.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);c>=0||je(!1),o=o.slice(0,Math.min(o.length,c+1))}let l=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let c=0;c=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((c,d,f)=>{let _,m=!1,p=null,y=null;n&&(_=a&&d.route.id?a[d.route.id]:void 0,p=d.route.errorElement||gM,l&&(u<0&&f===0?(CM("route-fallback"),m=!0,y=null):u===f&&(m=!0,y=d.route.hydrateFallbackElement||null)));let h=e.concat(o.slice(0,f+1)),v=()=>{let x;return _?x=p:m?x=y:d.route.Component?x=g.createElement(d.route.Component,null):d.route.element?x=d.route.element:x=c,g.createElement(yM,{match:d,routeContext:{outlet:c,matches:h,isDataRoute:n!=null},children:x})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?g.createElement(mM,{location:n.location,revalidation:n.revalidation,component:p,error:_,children:v(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):v()},null)}var UE=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(UE||{}),VE=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(VE||{});function wM(t){let e=g.useContext(Gc);return e||je(!1),e}function xM(t){let e=g.useContext(LE);return e||je(!1),e}function bM(t){let e=g.useContext(Vn);return e||je(!1),e}function BE(t){let e=bM(),n=e.matches[e.matches.length-1];return n.route.id||je(!1),n.route.id}function EM(){var t;let e=g.useContext(jE),n=xM(),r=BE();return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function SM(){let{router:t}=wM(UE.UseNavigateStable),e=BE(VE.UseNavigateStable),n=g.useRef(!1);return DE(()=>{n.current=!0}),g.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,Da({fromRouteId:e},s)))},[t,e])}const w_={};function CM(t,e,n){w_[t]||(w_[t]=!0)}function qE(t,e){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function co(t){let{to:e,replace:n,state:r,relative:i}=t;mo()||je(!1);let{future:s,static:o}=g.useContext(vr),{matches:a}=g.useContext(Vn),{pathname:l}=an(),u=tg(),c=eg(e,Zv(a,s.v7_relativeSplatPath),l,i==="path"),d=JSON.stringify(c);return g.useEffect(()=>u(JSON.parse(d),{replace:n,state:r,relative:i}),[u,d,i,n,r]),null}function kM(t){return fM(t.context)}function ne(t){je(!1)}function HE(t){let{basename:e="/",children:n=null,location:r,navigationType:i=Ur.Pop,navigator:s,static:o=!1,future:a}=t;mo()&&je(!1);let l=e.replace(/^\/*/,"/"),u=g.useMemo(()=>({basename:l,navigator:s,static:o,future:Da({v7_relativeSplatPath:!1},a)}),[l,a,s,o]);typeof r=="string"&&(r=Hi(r));let{pathname:c="/",search:d="",hash:f="",state:_=null,key:m="default"}=r,p=g.useMemo(()=>{let y=uo(c,l);return y==null?null:{location:{pathname:y,search:d,hash:f,state:_,key:m},navigationType:i}},[l,c,d,f,_,m,i]);return p==null?null:g.createElement(vr.Provider,{value:u},g.createElement(Kc.Provider,{children:n,value:p}))}function PM(t){let{children:e,location:n}=t;return hM(mp(e),n)}new Promise(()=>{});function mp(t,e){e===void 0&&(e=[]);let n=[];return g.Children.forEach(t,(r,i)=>{if(!g.isValidElement(r))return;let s=[...e,i];if(r.type===g.Fragment){n.push.apply(n,mp(r.props.children,s));return}r.type!==ne&&je(!1),!r.props.index||!r.props.children||je(!1);let o={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=mp(r.props.children,s)),n.push(o)}),n}/** + * React Router DOM v6.30.3 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function hc(){return hc=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function RM(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function TM(t,e){return t.button===0&&(!e||e==="_self")&&!RM(t)}function yp(t){return t===void 0&&(t=""),new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,n)=>{let r=t[n];return e.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function IM(t,e){let n=yp(t);return e&&e.forEach((r,i)=>{n.has(i)||e.getAll(i).forEach(s=>{n.append(i,s)})}),n}const OM=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],MM=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],AM="6";try{window.__reactRouterVersion=AM}catch{}const NM=g.createContext({isTransitioning:!1}),$M="startTransition",pc=kc[$M];function FM(t){let{basename:e,children:n,future:r,window:i}=t,s=g.useRef();s.current==null&&(s.current=LO({window:i,v5Compat:!0}));let o=s.current,[a,l]=g.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},c=g.useCallback(d=>{u&&pc?pc(()=>l(d)):l(d)},[l,u]);return g.useLayoutEffect(()=>o.listen(c),[o,c]),g.useEffect(()=>qE(r),[r]),g.createElement(HE,{basename:e,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}function LM(t){let{basename:e,children:n,future:r,window:i}=t,s=g.useRef();s.current==null&&(s.current=jO({window:i,v5Compat:!0}));let o=s.current,[a,l]=g.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},c=g.useCallback(d=>{u&&pc?pc(()=>l(d)):l(d)},[l,u]);return g.useLayoutEffect(()=>o.listen(c),[o,c]),g.useEffect(()=>qE(r),[r]),g.createElement(HE,{basename:e,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}const jM=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",DM=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,mn=g.forwardRef(function(e,n){let{onClick:r,relative:i,reloadDocument:s,replace:o,state:a,target:l,to:u,preventScrollReset:c,viewTransition:d}=e,f=WE(e,OM),{basename:_}=g.useContext(vr),m,p=!1;if(typeof u=="string"&&DM.test(u)&&(m=u,jM))try{let x=new URL(window.location.href),b=u.startsWith("//")?new URL(x.protocol+u):new URL(u),E=uo(b.pathname,_);b.origin===x.origin&&E!=null?u=E+b.search+b.hash:p=!0}catch{}let y=uM(u,{relative:i}),h=UM(u,{replace:o,state:a,target:l,preventScrollReset:c,relative:i,viewTransition:d});function v(x){r&&r(x),x.defaultPrevented||h(x)}return g.createElement("a",hc({},f,{href:m||y,onClick:p||s?r:v,ref:n,target:l}))}),is=g.forwardRef(function(e,n){let{"aria-current":r="page",caseSensitive:i=!1,className:s="",end:o=!1,style:a,to:l,viewTransition:u,children:c}=e,d=WE(e,MM),f=Qc(l,{relative:d.relative}),_=an(),m=g.useContext(LE),{navigator:p,basename:y}=g.useContext(vr),h=m!=null&&VM(f)&&u===!0,v=p.encodeLocation?p.encodeLocation(f).pathname:f.pathname,x=_.pathname,b=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;i||(x=x.toLowerCase(),b=b?b.toLowerCase():null,v=v.toLowerCase()),b&&y&&(b=uo(b,y)||b);const E=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let S=x===v||!o&&x.startsWith(v)&&x.charAt(E)==="/",k=b!=null&&(b===v||!o&&b.startsWith(v)&&b.charAt(v.length)==="/"),C={isActive:S,isPending:k,isTransitioning:h},R=S?r:void 0,P;typeof s=="function"?P=s(C):P=[s,S?"active":null,k?"pending":null,h?"transitioning":null].filter(Boolean).join(" ");let $=typeof a=="function"?a(C):a;return g.createElement(mn,hc({},d,{"aria-current":R,className:P,ref:n,style:$,to:l,viewTransition:u}),typeof c=="function"?c(C):c)});var _p;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(_p||(_p={}));var x_;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(x_||(x_={}));function zM(t){let e=g.useContext(Gc);return e||je(!1),e}function UM(t,e){let{target:n,replace:r,state:i,preventScrollReset:s,relative:o,viewTransition:a}=e===void 0?{}:e,l=tg(),u=an(),c=Qc(t,{relative:o});return g.useCallback(d=>{if(TM(d,n)){d.preventDefault();let f=r!==void 0?r:ja(u)===ja(c);l(t,{replace:f,state:i,preventScrollReset:s,relative:o,viewTransition:a})}},[u,l,c,r,i,n,t,s,o,a])}function f3(t){let e=g.useRef(yp(t)),n=g.useRef(!1),r=an(),i=g.useMemo(()=>IM(r.search,n.current?null:e.current),[r.search]),s=tg(),o=g.useCallback((a,l)=>{const u=yp(typeof a=="function"?a(i):a);n.current=!0,s("?"+u,l)},[s,i]);return[i,o]}function VM(t,e){e===void 0&&(e={});let n=g.useContext(NM);n==null&&je(!1);let{basename:r}=zM(_p.useViewTransitionState),i=Qc(t,{relative:e.relative});if(!n.isTransitioning)return!1;let s=uo(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=uo(n.nextLocation.pathname,r)||n.nextLocation.pathname;return gp(i.pathname,o)!=null||gp(i.pathname,s)!=null}var Yc=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(){}},Ci,Ar,zs,m0,BM=(m0=class extends Yc{constructor(){super();le(this,Ci);le(this,Ar);le(this,zs);ee(this,zs,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){A(this,Ar)||this.setEventListener(A(this,zs))}onUnsubscribe(){var e;this.hasListeners()||((e=A(this,Ar))==null||e.call(this),ee(this,Ar,void 0))}setEventListener(e){var n;ee(this,zs,e),(n=A(this,Ar))==null||n.call(this),ee(this,Ar,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){A(this,Ci)!==e&&(ee(this,Ci,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof A(this,Ci)=="boolean"?A(this,Ci):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Ci=new WeakMap,Ar=new WeakMap,zs=new WeakMap,m0),GE=new BM,qM={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Nr,jp,y0,HM=(y0=class{constructor(){le(this,Nr,qM);le(this,jp,!1)}setTimeoutProvider(t){ee(this,Nr,t)}setTimeout(t,e){return A(this,Nr).setTimeout(t,e)}clearTimeout(t){A(this,Nr).clearTimeout(t)}setInterval(t,e){return A(this,Nr).setInterval(t,e)}clearInterval(t){A(this,Nr).clearInterval(t)}},Nr=new WeakMap,jp=new WeakMap,y0),wp=new HM;function WM(t){setTimeout(t,0)}var GM=typeof window>"u"||"Deno"in globalThis;function hn(){}function KM(t,e){return typeof t=="function"?t(e):t}function QM(t){return typeof t=="number"&&t>=0&&t!==1/0}function YM(t,e){return Math.max(t+(e||0)-Date.now(),0)}function xp(t,e){return typeof t=="function"?t(e):t}function XM(t,e){return typeof t=="function"?t(e):t}function b_(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=t;if(o){if(r){if(e.queryHash!==ng(o,e.options))return!1}else if(!Ua(e.queryKey,o))return!1}if(n!=="all"){const l=e.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||i&&i!==e.state.fetchStatus||s&&!s(e))}function E_(t,e){const{exact:n,status:r,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(n){if(za(e.options.mutationKey)!==za(s))return!1}else if(!Ua(e.options.mutationKey,s))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function ng(t,e){return((e==null?void 0:e.queryKeyHashFn)||za)(t)}function za(t){return JSON.stringify(t,(e,n)=>bp(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Ua(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>Ua(t[n],e[n])):!1}var JM=Object.prototype.hasOwnProperty;function KE(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=S_(t)&&S_(e);if(!r&&!(bp(t)&&bp(e)))return e;const s=(r?t:Object.keys(t)).length,o=r?e:Object.keys(e),a=o.length,l=r?new Array(a):{};let u=0;for(let c=0;c{wp.setTimeout(e,t)})}function eA(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?KE(t,e):e}function p3(t){return t}function tA(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function nA(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var rg=Symbol();function QE(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===rg?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function v3(t,e){return typeof t=="function"?t(...e):!!t}function rA(t,e,n){let r=!1,i;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(i??(i=e()),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),t}var YE=(()=>{let t=()=>GM;return{isServer(){return t()},setIsServer(e){t=e}}})();function iA(){let t,e;const n=new Promise((i,s)=>{t=i,e=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),t(i)},n.reject=i=>{r({status:"rejected",reason:i}),e(i)},n}var sA=WM;function oA(){let t=[],e=0,n=a=>{a()},r=a=>{a()},i=sA;const s=a=>{e?t.push(a):i(()=>{n(a)})},o=()=>{const a=t;t=[],a.length&&i(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;e++;try{l=a()}finally{e--,e||o()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var wt=oA(),Us,$r,Vs,_0,aA=(_0=class extends Yc{constructor(){super();le(this,Us,!0);le(this,$r);le(this,Vs);ee(this,Vs,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){A(this,$r)||this.setEventListener(A(this,Vs))}onUnsubscribe(){var e;this.hasListeners()||((e=A(this,$r))==null||e.call(this),ee(this,$r,void 0))}setEventListener(e){var n;ee(this,Vs,e),(n=A(this,$r))==null||n.call(this),ee(this,$r,e(this.setOnline.bind(this)))}setOnline(e){A(this,Us)!==e&&(ee(this,Us,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return A(this,Us)}},Us=new WeakMap,$r=new WeakMap,Vs=new WeakMap,_0),vc=new aA;function lA(t){return Math.min(1e3*2**t,3e4)}function XE(t){return(t??"online")==="online"?vc.isOnline():!0}var Ep=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function JE(t){let e=!1,n=0,r;const i=iA(),s=()=>i.status!=="pending",o=p=>{var y;if(!s()){const h=new Ep(p);f(h),(y=t.onCancel)==null||y.call(t,h)}},a=()=>{e=!0},l=()=>{e=!1},u=()=>GE.isFocused()&&(t.networkMode==="always"||vc.isOnline())&&t.canRun(),c=()=>XE(t.networkMode)&&t.canRun(),d=p=>{s()||(r==null||r(),i.resolve(p))},f=p=>{s()||(r==null||r(),i.reject(p))},_=()=>new Promise(p=>{var y;r=h=>{(s()||u())&&p(h)},(y=t.onPause)==null||y.call(t)}).then(()=>{var p;r=void 0,s()||(p=t.onContinue)==null||p.call(t)}),m=()=>{if(s())return;let p;const y=n===0?t.initialPromise:void 0;try{p=y??t.fn()}catch(h){p=Promise.reject(h)}Promise.resolve(p).then(d).catch(h=>{var S;if(s())return;const v=t.retry??(YE.isServer()?0:3),x=t.retryDelay??lA,b=typeof x=="function"?x(n,h):x,E=v===!0||typeof v=="number"&&nu()?void 0:_()).then(()=>{e?f(h):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r==null||r(),i),cancelRetry:a,continueRetry:l,canStart:c,start:()=>(c()?m():_().then(m),i)}}var ki,w0,ZE=(w0=class{constructor(){le(this,ki)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),QM(this.gcTime)&&ee(this,ki,wp.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(YE.isServer()?1/0:5*60*1e3))}clearGcTimeout(){A(this,ki)!==void 0&&(wp.clearTimeout(A(this,ki)),ee(this,ki,void 0))}},ki=new WeakMap,w0);function uA(t){return{onFetch:(e,n)=>{var c,d,f,_,m;const r=e.options,i=(f=(d=(c=e.fetchOptions)==null?void 0:c.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,s=((_=e.state.data)==null?void 0:_.pages)||[],o=((m=e.state.data)==null?void 0:m.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let p=!1;const y=x=>{rA(x,()=>e.signal,()=>p=!0)},h=QE(e.options,e.fetchOptions),v=async(x,b,E)=>{if(p)return Promise.reject(e.signal.reason);if(b==null&&x.pages.length)return Promise.resolve(x);const k=(()=>{const $={client:e.client,queryKey:e.queryKey,pageParam:b,direction:E?"backward":"forward",meta:e.options.meta};return y($),$})(),C=await h(k),{maxPages:R}=e.options,P=E?nA:tA;return{pages:P(x.pages,C,R),pageParams:P(x.pageParams,b,R)}};if(i&&s.length){const x=i==="backward",b=x?eS:Sp,E={pages:s,pageParams:o},S=b(r,E);a=await v(E,S,x)}else{const x=t??s.length;do{const b=l===0?o[0]??r.initialPageParam:Sp(r,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},n)}:e.fetchFn=u}}}function Sp(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function eS(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}function g3(t,e){return e?Sp(t,e)!=null:!1}function m3(t,e){return!e||!t.getPreviousPageParam?!1:eS(t,e)!=null}var Bs,Pi,qs,Yt,Ri,Je,Wa,Ti,jt,tS,Kn,x0,cA=(x0=class extends ZE{constructor(e){super();le(this,jt);le(this,Bs);le(this,Pi);le(this,qs);le(this,Yt);le(this,Ri);le(this,Je);le(this,Wa);le(this,Ti);ee(this,Ti,!1),ee(this,Wa,e.defaultOptions),this.setOptions(e.options),this.observers=[],ee(this,Ri,e.client),ee(this,Yt,A(this,Ri).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,ee(this,Pi,P_(this.options)),this.state=e.state??A(this,Pi),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return A(this,Bs)}get promise(){var e;return(e=A(this,Je))==null?void 0:e.promise}setOptions(e){if(this.options={...A(this,Wa),...e},e!=null&&e._type&&ee(this,Bs,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=P_(this.options);n.data!==void 0&&(this.setState(k_(n.data,n.dataUpdatedAt)),ee(this,Pi,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&A(this,Yt).remove(this)}setData(e,n){const r=eA(this.state.data,e,this.options);return nt(this,jt,Kn).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e){nt(this,jt,Kn).call(this,{type:"setState",state:e})}cancel(e){var r,i;const n=(r=A(this,Je))==null?void 0:r.promise;return(i=A(this,Je))==null||i.cancel(e),n?n.then(hn).catch(hn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return A(this,Pi)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>XM(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===rg||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>xp(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:!YM(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=A(this,Je))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=A(this,Je))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),A(this,Yt).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(A(this,Je)&&(A(this,Ti)||nt(this,jt,tS).call(this)?A(this,Je).cancel({revert:!0}):A(this,Je).cancelRetry()),this.scheduleGc()),A(this,Yt).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||nt(this,jt,Kn).call(this,{type:"invalidate"})}async fetch(e,n){var u,c,d,f,_,m,p,y,h,v,x;if(this.state.fetchStatus!=="idle"&&((u=A(this,Je))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(A(this,Je))return A(this,Je).continueRetry(),A(this,Je).promise}if(e&&this.setOptions(e),!this.options.queryFn){const b=this.observers.find(E=>E.options.queryFn);b&&this.setOptions(b.options)}const r=new AbortController,i=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(ee(this,Ti,!0),r.signal)})},s=()=>{const b=QE(this.options,n),S=(()=>{const k={client:A(this,Ri),queryKey:this.queryKey,meta:this.meta};return i(k),k})();return ee(this,Ti,!1),this.options.persister?this.options.persister(b,S,this):b(S)},a=(()=>{const b={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:A(this,Ri),state:this.state,fetchFn:s};return i(b),b})(),l=A(this,Bs)==="infinite"?uA(this.options.pages):this.options.behavior;l==null||l.onFetch(a,this),ee(this,qs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=a.fetchOptions)==null?void 0:c.meta))&&nt(this,jt,Kn).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta}),ee(this,Je,JE({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,onCancel:b=>{b instanceof Ep&&b.revert&&this.setState({...A(this,qs),fetchStatus:"idle"}),r.abort()},onFail:(b,E)=>{nt(this,jt,Kn).call(this,{type:"failed",failureCount:b,error:E})},onPause:()=>{nt(this,jt,Kn).call(this,{type:"pause"})},onContinue:()=>{nt(this,jt,Kn).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const b=await A(this,Je).start();if(b===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(b),(_=(f=A(this,Yt).config).onSuccess)==null||_.call(f,b,this),(p=(m=A(this,Yt).config).onSettled)==null||p.call(m,b,this.state.error,this),b}catch(b){if(b instanceof Ep){if(b.silent)return A(this,Je).promise;if(b.revert){if(this.state.data===void 0)throw b;return this.state.data}}throw nt(this,jt,Kn).call(this,{type:"error",error:b}),(h=(y=A(this,Yt).config).onError)==null||h.call(y,b,this),(x=(v=A(this,Yt).config).onSettled)==null||x.call(v,this.state.data,b,this),b}finally{this.scheduleGc()}}},Bs=new WeakMap,Pi=new WeakMap,qs=new WeakMap,Yt=new WeakMap,Ri=new WeakMap,Je=new WeakMap,Wa=new WeakMap,Ti=new WeakMap,jt=new WeakSet,tS=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Kn=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...dA(r.data,this.options),fetchMeta:e.meta??null};case"success":const i={...r,...k_(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ee(this,qs,e.manual?i:void 0),i;case"error":const s=e.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),wt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),A(this,Yt).notify({query:this,type:"updated",action:e})})},x0);function dA(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:XE(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function k_(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function P_(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Ga,On,dt,Ii,Mn,Pr,b0,fA=(b0=class extends ZE{constructor(e){super();le(this,Mn);le(this,Ga);le(this,On);le(this,dt);le(this,Ii);ee(this,Ga,e.client),this.mutationId=e.mutationId,ee(this,dt,e.mutationCache),ee(this,On,[]),this.state=e.state||hA(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){A(this,On).includes(e)||(A(this,On).push(e),this.clearGcTimeout(),A(this,dt).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){ee(this,On,A(this,On).filter(n=>n!==e)),this.scheduleGc(),A(this,dt).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){A(this,On).length||(this.state.status==="pending"?this.scheduleGc():A(this,dt).remove(this))}continue(){var e;return((e=A(this,Ii))==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,E,S,k;const n=()=>{nt(this,Mn,Pr).call(this,{type:"continue"})},r={client:A(this,Ga),meta:this.options.meta,mutationKey:this.options.mutationKey};ee(this,Ii,JE({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(C,R)=>{nt(this,Mn,Pr).call(this,{type:"failed",failureCount:C,error:R})},onPause:()=>{nt(this,Mn,Pr).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>A(this,dt).canRun(this)}));const i=this.state.status==="pending",s=!A(this,Ii).canStart();try{if(i)n();else{nt(this,Mn,Pr).call(this,{type:"pending",variables:e,isPaused:s}),A(this,dt).config.onMutate&&await A(this,dt).config.onMutate(e,this,r);const R=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,e,r));R!==this.state.context&&nt(this,Mn,Pr).call(this,{type:"pending",context:R,variables:e,isPaused:s})}const C=await A(this,Ii).start();return await((u=(l=A(this,dt).config).onSuccess)==null?void 0:u.call(l,C,e,this.state.context,this,r)),await((d=(c=this.options).onSuccess)==null?void 0:d.call(c,C,e,this.state.context,r)),await((_=(f=A(this,dt).config).onSettled)==null?void 0:_.call(f,C,null,this.state.variables,this.state.context,this,r)),await((p=(m=this.options).onSettled)==null?void 0:p.call(m,C,null,e,this.state.context,r)),nt(this,Mn,Pr).call(this,{type:"success",data:C}),C}catch(C){try{await((h=(y=A(this,dt).config).onError)==null?void 0:h.call(y,C,e,this.state.context,this,r))}catch(R){Promise.reject(R)}try{await((x=(v=this.options).onError)==null?void 0:x.call(v,C,e,this.state.context,r))}catch(R){Promise.reject(R)}try{await((E=(b=A(this,dt).config).onSettled)==null?void 0:E.call(b,void 0,C,this.state.variables,this.state.context,this,r))}catch(R){Promise.reject(R)}try{await((k=(S=this.options).onSettled)==null?void 0:k.call(S,void 0,C,e,this.state.context,r))}catch(R){Promise.reject(R)}throw nt(this,Mn,Pr).call(this,{type:"error",error:C}),C}finally{A(this,dt).runNext(this)}}},Ga=new WeakMap,On=new WeakMap,dt=new WeakMap,Ii=new WeakMap,Mn=new WeakSet,Pr=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,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{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),wt.batch(()=>{A(this,On).forEach(r=>{r.onMutationUpdate(e)}),A(this,dt).notify({mutation:this,type:"updated",action:e})})},b0);function hA(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var er,pn,Ka,E0,pA=(E0=class extends Yc{constructor(e={}){super();le(this,er);le(this,pn);le(this,Ka);this.config=e,ee(this,er,new Set),ee(this,pn,new Map),ee(this,Ka,0)}build(e,n,r){const i=new fA({client:e,mutationCache:this,mutationId:++al(this,Ka)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){A(this,er).add(e);const n=Ll(e);if(typeof n=="string"){const r=A(this,pn).get(n);r?r.push(e):A(this,pn).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(A(this,er).delete(e)){const n=Ll(e);if(typeof n=="string"){const r=A(this,pn).get(n);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&A(this,pn).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Ll(e);if(typeof n=="string"){const r=A(this,pn).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===e}else return!0}runNext(e){var r;const n=Ll(e);if(typeof n=="string"){const i=(r=A(this,pn).get(n))==null?void 0:r.find(s=>s!==e&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){wt.batch(()=>{A(this,er).forEach(e=>{this.notify({type:"removed",mutation:e})}),A(this,er).clear(),A(this,pn).clear()})}getAll(){return Array.from(A(this,er))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>E_(n,r))}findAll(e={}){return this.getAll().filter(n=>E_(e,n))}notify(e){wt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return wt.batch(()=>Promise.all(e.map(n=>n.continue().catch(hn))))}},er=new WeakMap,pn=new WeakMap,Ka=new WeakMap,E0);function Ll(t){var e;return(e=t.options.scope)==null?void 0:e.id}var An,S0,vA=(S0=class extends Yc{constructor(e={}){super();le(this,An);this.config=e,ee(this,An,new Map)}build(e,n,r){const i=n.queryKey,s=n.queryHash??ng(i,n);let o=this.get(s);return o||(o=new cA({client:e,queryKey:i,queryHash:s,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){A(this,An).has(e.queryHash)||(A(this,An).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=A(this,An).get(e.queryHash);n&&(e.destroy(),n===e&&A(this,An).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){wt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return A(this,An).get(e)}getAll(){return[...A(this,An).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>b_(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>b_(e,r)):n}notify(e){wt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){wt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){wt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},An=new WeakMap,S0),Ue,Fr,Lr,Hs,Ws,jr,Gs,Ks,C0,gA=(C0=class{constructor(t={}){le(this,Ue);le(this,Fr);le(this,Lr);le(this,Hs);le(this,Ws);le(this,jr);le(this,Gs);le(this,Ks);ee(this,Ue,t.queryCache||new vA),ee(this,Fr,t.mutationCache||new pA),ee(this,Lr,t.defaultOptions||{}),ee(this,Hs,new Map),ee(this,Ws,new Map),ee(this,jr,0)}mount(){al(this,jr)._++,A(this,jr)===1&&(ee(this,Gs,GE.subscribe(async t=>{t&&(await this.resumePausedMutations(),A(this,Ue).onFocus())})),ee(this,Ks,vc.subscribe(async t=>{t&&(await this.resumePausedMutations(),A(this,Ue).onOnline())})))}unmount(){var t,e;al(this,jr)._--,A(this,jr)===0&&((t=A(this,Gs))==null||t.call(this),ee(this,Gs,void 0),(e=A(this,Ks))==null||e.call(this),ee(this,Ks,void 0))}isFetching(t){return A(this,Ue).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return A(this,Fr).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=A(this,Ue).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=A(this,Ue).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(xp(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return A(this,Ue).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),i=A(this,Ue).get(r.queryHash),s=i==null?void 0:i.state.data,o=KM(e,s);if(o!==void 0)return A(this,Ue).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(t,e,n){return wt.batch(()=>A(this,Ue).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=A(this,Ue).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=A(this,Ue);wt.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=A(this,Ue);return wt.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=wt.batch(()=>A(this,Ue).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(hn).catch(hn)}invalidateQueries(t,e={}){return wt.batch(()=>(A(this,Ue).findAll(t).forEach(n=>{n.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 n={...e,cancelRefetch:e.cancelRefetch??!0},r=wt.batch(()=>A(this,Ue).findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(hn)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(hn)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=A(this,Ue).build(this,e);return n.isStaleByTime(xp(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(hn).catch(hn)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(hn).catch(hn)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return vc.isOnline()?A(this,Fr).resumePausedMutations():Promise.resolve()}getQueryCache(){return A(this,Ue)}getMutationCache(){return A(this,Fr)}getDefaultOptions(){return A(this,Lr)}setDefaultOptions(t){ee(this,Lr,t)}setQueryDefaults(t,e){A(this,Hs).set(za(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...A(this,Hs).values()],n={};return e.forEach(r=>{Ua(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){A(this,Ws).set(za(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...A(this,Ws).values()],n={};return e.forEach(r=>{Ua(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...A(this,Lr).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=ng(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===rg&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...A(this,Lr).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){A(this,Ue).clear(),A(this,Fr).clear()}},Ue=new WeakMap,Fr=new WeakMap,Lr=new WeakMap,Hs=new WeakMap,Ws=new WeakMap,jr=new WeakMap,Gs=new WeakMap,Ks=new WeakMap,C0),nS=g.createContext(void 0),mA=t=>{const e=g.useContext(nS);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},yA=({client:t,children:e})=>(g.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),w.jsx(nS.Provider,{value:t,children:e}));function J(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function R_(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function oi(...t){return e=>{let n=!1;const r=t.map(i=>{const s=R_(i,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i{const{children:o,...a}=s,l=g.useMemo(()=>a,Object.values(a));return w.jsx(n.Provider,{value:l,children:o})};r.displayName=t+"Provider";function i(s){const o=g.useContext(n);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${s}\` must be used within \`${t}\``)}return[r,i]}function Wi(t,e=[]){let n=[];function r(s,o){const a=g.createContext(o),l=n.length;n=[...n,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(()=>m,Object.values(m));return w.jsx(p.Provider,{value:y,children:_})};u.displayName=s+"Provider";function c(d,f){var p;const _=((p=f==null?void 0:f[t])==null?void 0:p[l])||a,m=g.useContext(_);if(m)return m;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[u,c]}const i=()=>{const s=n.map(o=>g.createContext(o));return function(a){const l=(a==null?void 0:a[t])||s;return g.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return i.scopeName=t,[r,wA(i,...e)]}function wA(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:l,scopeName:u})=>{const d=l(s)[`__scope${u}`];return{...a,...d}},{});return g.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}var on=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},xA=kc[" useId ".trim().toString()]||(()=>{}),bA=0;function Fs(t){const[e,n]=g.useState(xA());return on(()=>{n(r=>r??String(bA++))},[t]),e?`radix-${e}`:""}var EA=kc[" useInsertionEffect ".trim().toString()]||on;function Xc({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[i,s,o]=SA({defaultProp:e,onChange:n}),a=t!==void 0,l=a?t:i;{const c=g.useRef(t!==void 0);g.useEffect(()=>{const d=c.current;d!==a&&console.warn(`${r} 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,r])}const u=g.useCallback(c=>{var d;if(a){const f=CA(c)?c(t):c;f!==t&&((d=o.current)==null||d.call(o,f))}else s(c)},[a,t,s,o]);return[l,u]}function SA({defaultProp:t,onChange:e}){const[n,r]=g.useState(t),i=g.useRef(n),s=g.useRef(e);return EA(()=>{s.current=e},[e]),g.useEffect(()=>{var o;i.current!==n&&((o=s.current)==null||o.call(s,n),i.current=n)},[n,i]),[n,r,s]}function CA(t){return typeof t=="function"}function kA(t){const e=PA(t),n=g.forwardRef((r,i)=>{const{children:s,...o}=r,a=g.Children.toArray(s),l=a.find(TA);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:i,children:g.isValidElement(u)?g.cloneElement(u,void 0,c):null})}return w.jsx(e,{...o,ref:i,children:s})});return n.displayName=`${t}.Slot`,n}function PA(t){const e=g.forwardRef((n,r)=>{const{children:i,...s}=n;if(g.isValidElement(i)){const o=OA(i),a=IA(s,i.props);return i.type!==g.Fragment&&(a.ref=r?oi(r,o):o),g.cloneElement(i,a)}return g.Children.count(i)>1?g.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var RA=Symbol("radix.slottable");function TA(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===RA}function IA(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function OA(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var MA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ee=MA.reduce((t,e)=>{const n=kA(`Primitive.${e}`),r=g.forwardRef((i,s)=>{const{asChild:o,...a}=i,l=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function ig(t,e){t&&el.flushSync(()=>t.dispatchEvent(e))}function Ft(t){const e=g.useRef(t);return g.useEffect(()=>{e.current=t}),g.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function AA(t,e=globalThis==null?void 0:globalThis.document){const n=Ft(t);g.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var NA="DismissableLayer",Cp="dismissableLayer.update",$A="dismissableLayer.pointerDownOutside",FA="dismissableLayer.focusOutside",T_,rS=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Jc=g.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:a,...l}=t,u=g.useContext(rS),[c,d]=g.useState(null),f=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,_]=g.useState({}),m=Xe(e,k=>d(k)),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,E=jA(k=>{const C=k.target,R=[...u.branches].some(P=>P.contains(C));!b||R||(i==null||i(k),o==null||o(k),k.defaultPrevented||a==null||a())},f),S=DA(k=>{const C=k.target;[...u.branches].some(P=>P.contains(C))||(s==null||s(k),o==null||o(k),k.defaultPrevented||a==null||a())},f);return AA(k=>{v===u.layers.size-1&&(r==null||r(k),!k.defaultPrevented&&a&&(k.preventDefault(),a()))},f),g.useEffect(()=>{if(c)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(T_=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),I_(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=T_)}},[c,f,n,u]),g.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),I_())},[c,u]),g.useEffect(()=>{const k=()=>_({});return document.addEventListener(Cp,k),()=>document.removeEventListener(Cp,k)},[]),w.jsx(Ee.div,{...l,ref:m,style:{pointerEvents:x?b?"auto":"none":void 0,...t.style},onFocusCapture:J(t.onFocusCapture,S.onFocusCapture),onBlurCapture:J(t.onBlurCapture,S.onBlurCapture),onPointerDownCapture:J(t.onPointerDownCapture,E.onPointerDownCapture)})});Jc.displayName=NA;var LA="DismissableLayerBranch",iS=g.forwardRef((t,e)=>{const n=g.useContext(rS),r=g.useRef(null),i=Xe(e,r);return g.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),w.jsx(Ee.div,{...t,ref:i})});iS.displayName=LA;function jA(t,e=globalThis==null?void 0:globalThis.document){const n=Ft(t),r=g.useRef(!1),i=g.useRef(()=>{});return g.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let l=function(){sS($A,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=l,e.addEventListener("click",i.current,{once:!0})):l()}else e.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function DA(t,e=globalThis==null?void 0:globalThis.document){const n=Ft(t),r=g.useRef(!1);return g.useEffect(()=>{const i=s=>{s.target&&!r.current&&sS(FA,n,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function I_(){const t=new CustomEvent(Cp);document.dispatchEvent(t)}function sS(t,e,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?ig(i,s):i.dispatchEvent(s)}var zA=Jc,UA=iS,xf="focusScope.autoFocusOnMount",bf="focusScope.autoFocusOnUnmount",O_={bubbles:!1,cancelable:!0},VA="FocusScope",sg=g.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=t,[a,l]=g.useState(null),u=Ft(i),c=Ft(s),d=g.useRef(null),f=Xe(e,p=>l(p)),_=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let p=function(x){if(_.paused||!a)return;const b=x.target;a.contains(b)?d.current=b:Rr(d.current,{select:!0})},y=function(x){if(_.paused||!a)return;const b=x.relatedTarget;b!==null&&(a.contains(b)||Rr(d.current,{select:!0}))},h=function(x){if(document.activeElement===document.body)for(const E of x)E.removedNodes.length>0&&Rr(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()}}},[r,a,_.paused]),g.useEffect(()=>{if(a){A_.add(_);const p=document.activeElement;if(!a.contains(p)){const h=new CustomEvent(xf,O_);a.addEventListener(xf,u),a.dispatchEvent(h),h.defaultPrevented||(BA(KA(oS(a)),{select:!0}),document.activeElement===p&&Rr(a))}return()=>{a.removeEventListener(xf,u),setTimeout(()=>{const h=new CustomEvent(bf,O_);a.addEventListener(bf,c),a.dispatchEvent(h),h.defaultPrevented||Rr(p??document.body,{select:!0}),a.removeEventListener(bf,c),A_.remove(_)},0)}}},[a,u,c,_]);const m=g.useCallback(p=>{if(!n&&!r||_.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]=qA(v);x&&b?!p.shiftKey&&h===b?(p.preventDefault(),n&&Rr(x,{select:!0})):p.shiftKey&&h===x&&(p.preventDefault(),n&&Rr(b,{select:!0})):h===v&&p.preventDefault()}},[n,r,_.paused]);return w.jsx(Ee.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});sg.displayName=VA;function BA(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Rr(r,{select:e}),document.activeElement!==n)return}function qA(t){const e=oS(t),n=M_(e,t),r=M_(e.reverse(),t);return[n,r]}function oS(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function M_(t,e){for(const n of t)if(!HA(n,{upTo:e}))return n}function HA(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 WA(t){return t instanceof HTMLInputElement&&"select"in t}function Rr(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&WA(t)&&e&&t.select()}}var A_=GA();function GA(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=N_(t,e),t.unshift(e)},remove(e){var n;t=N_(t,e),(n=t[0])==null||n.resume()}}}function N_(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function KA(t){return t.filter(e=>e.tagName!=="A")}var QA="Portal",Zc=g.forwardRef((t,e)=>{var a;const{container:n,...r}=t,[i,s]=g.useState(!1);on(()=>s(!0),[]);const o=n||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?OR.createPortal(w.jsx(Ee.div,{...r,ref:e}),o):null});Zc.displayName=QA;function YA(t,e){return g.useReducer((n,r)=>e[n][r]??n,t)}var gr=t=>{const{present:e,children:n}=t,r=XA(e),i=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),s=Xe(r.ref,JA(i));return typeof n=="function"||r.isPresent?g.cloneElement(i,{ref:s}):null};gr.displayName="Presence";function XA(t){const[e,n]=g.useState(),r=g.useRef(null),i=g.useRef(t),s=g.useRef("none"),o=t?"mounted":"unmounted",[a,l]=YA(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const u=jl(r.current);s.current=a==="mounted"?u:"none"},[a]),on(()=>{const u=r.current,c=i.current;if(c!==t){const f=s.current,_=jl(u);t?l("MOUNT"):_==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(c&&f!==_?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,l]),on(()=>{if(e){let u;const c=e.ownerDocument.defaultView??window,d=_=>{const p=jl(r.current).includes(CSS.escape(_.animationName));if(_.target===e&&p&&(l("ANIMATION_END"),!i.current)){const y=e.style.animationFillMode;e.style.animationFillMode="forwards",u=c.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=y)})}},f=_=>{_.target===e&&(s.current=jl(r.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=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function jl(t){return(t==null?void 0:t.animationName)||"none"}function JA(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Ef=0;function aS(){g.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??$_()),document.body.insertAdjacentElement("beforeend",t[1]??$_()),Ef++,()=>{Ef===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Ef--}},[])}function $_(){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 Fn=function(){return Fn=Object.assign||function(e){for(var n,r=1,i=arguments.length;r"u")return vN;var e=gN(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},yN=dS(),Ls="data-scroll-locked",_N=function(t,e,n,r){var i=t.left,s=t.top,o=t.right,a=t.gap;return n===void 0&&(n="margin"),` + .`.concat(eN,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(a,"px ").concat(r,`; + } + body[`).concat(Ls,`] { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(i,`px; + padding-top: `).concat(s,`px; + padding-right: `).concat(o,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(a,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(du,` { + right: `).concat(a,"px ").concat(r,`; + } + + .`).concat(fu,` { + margin-right: `).concat(a,"px ").concat(r,`; + } + + .`).concat(du," .").concat(du,` { + right: 0 `).concat(r,`; + } + + .`).concat(fu," .").concat(fu,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(Ls,`] { + `).concat(tN,": ").concat(a,`px; + } +`)},L_=function(){var t=parseInt(document.body.getAttribute(Ls)||"0",10);return isFinite(t)?t:0},wN=function(){g.useEffect(function(){return document.body.setAttribute(Ls,(L_()+1).toString()),function(){var t=L_()-1;t<=0?document.body.removeAttribute(Ls):document.body.setAttribute(Ls,t.toString())}},[])},xN=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r;wN();var s=g.useMemo(function(){return mN(i)},[i]);return g.createElement(yN,{styles:_N(s,!e,i,n?"":"!important")})},kp=!1;if(typeof window<"u")try{var Dl=Object.defineProperty({},"passive",{get:function(){return kp=!0,!0}});window.addEventListener("test",Dl,Dl),window.removeEventListener("test",Dl,Dl)}catch{kp=!1}var ss=kp?{passive:!1}:!1,bN=function(t){return t.tagName==="TEXTAREA"},fS=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!bN(t)&&n[e]==="visible")},EN=function(t){return fS(t,"overflowY")},SN=function(t){return fS(t,"overflowX")},j_=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=hS(t,r);if(i){var s=pS(t,r),o=s[1],a=s[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},CN=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},kN=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},hS=function(t,e){return t==="v"?EN(e):SN(e)},pS=function(t,e){return t==="v"?CN(e):kN(e)},PN=function(t,e){return t==="h"&&e==="rtl"?-1:1},RN=function(t,e,n,r,i){var s=PN(t,window.getComputedStyle(e).direction),o=s*r,a=n.target,l=e.contains(a),u=!1,c=o>0,d=0,f=0;do{if(!a)break;var _=pS(t,a),m=_[0],p=_[1],y=_[2],h=p-y-s*m;(m||h)&&hS(t,a)&&(d+=h,f+=m);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},zl=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},D_=function(t){return[t.deltaX,t.deltaY]},z_=function(t){return t&&"current"in t?t.current:t},TN=function(t,e){return t[0]===e[0]&&t[1]===e[1]},IN=function(t){return` + .block-interactivity-`.concat(t,` {pointer-events: none;} + .allow-interactivity-`).concat(t,` {pointer-events: all;} +`)},ON=0,os=[];function MN(t){var e=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),i=g.useState(ON++)[0],s=g.useState(dS)[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(i));var p=ZA([t.lockRef.current],(t.shards||[]).map(z_),!0).filter(Boolean);return p.forEach(function(y){return y.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),p.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(i))})}}},[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=zl(p),v=n.current,x="deltaX"in p?p.deltaX:v[0]-h[0],b="deltaY"in p?p.deltaY:v[1]-h[1],E,S=p.target,k=Math.abs(x)>Math.abs(b)?"h":"v";if("touches"in p&&k==="h"&&S.type==="range")return!1;var C=window.getSelection(),R=C&&C.anchorNode,P=R?R===S||R.contains(S):!1;if(P)return!1;var $=j_(k,S);if(!$)return!0;if($?E=k:(E=k==="v"?"h":"v",$=j_(k,S)),!$)return!1;if(!r.current&&"changedTouches"in p&&(x||b)&&(r.current=E),!E)return!0;var O=r.current||E;return RN(O,y,p,O==="h"?x:b)},[]),l=g.useCallback(function(p){var y=p;if(!(!os.length||os[os.length-1]!==s)){var h="deltaY"in y?D_(y):zl(y),v=e.current.filter(function(E){return E.name===y.type&&(E.target===y.target||y.target===E.shadowParent)&&TN(E.delta,h)})[0];if(v&&v.should){y.cancelable&&y.preventDefault();return}if(!v){var x=(o.current.shards||[]).map(z_).filter(Boolean).filter(function(E){return E.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:AN(h)};e.current.push(x),setTimeout(function(){e.current=e.current.filter(function(b){return b!==x})},1)},[]),c=g.useCallback(function(p){n.current=zl(p),r.current=void 0},[]),d=g.useCallback(function(p){u(p.type,D_(p),p.target,a(p,t.lockRef.current))},[]),f=g.useCallback(function(p){u(p.type,zl(p),p.target,a(p,t.lockRef.current))},[]);g.useEffect(function(){return os.push(s),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,ss),document.addEventListener("touchmove",l,ss),document.addEventListener("touchstart",c,ss),function(){os=os.filter(function(p){return p!==s}),document.removeEventListener("wheel",l,ss),document.removeEventListener("touchmove",l,ss),document.removeEventListener("touchstart",c,ss)}},[]);var _=t.removeScrollBar,m=t.inert;return g.createElement(g.Fragment,null,m?g.createElement(s,{styles:IN(i)}):null,_?g.createElement(xN,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function AN(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const NN=lN(cS,MN);var og=g.forwardRef(function(t,e){return g.createElement(ed,Fn({},t,{ref:e,sideCar:NN}))});og.classNames=ed.classNames;var $N=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},as=new WeakMap,Ul=new WeakMap,Vl={},Pf=0,vS=function(t){return t&&(t.host||vS(t.parentNode))},FN=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=vS(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},LN=function(t,e,n,r){var i=FN(e,Array.isArray(t)?t:[t]);Vl[n]||(Vl[n]=new WeakMap);var s=Vl[n],o=[],a=new Set,l=new Set(i),u=function(d){!d||a.has(d)||(a.add(d),u(d.parentNode))};i.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 _=f.getAttribute(r),m=_!==null&&_!=="false",p=(as.get(f)||0)+1,y=(s.get(f)||0)+1;as.set(f,p),s.set(f,y),o.push(f),p===1&&m&&Ul.set(f,!0),y===1&&f.setAttribute(n,"true"),m||f.setAttribute(r,"true")}catch(h){console.error("aria-hidden: cannot operate on ",f,h)}})};return c(e),a.clear(),Pf++,function(){o.forEach(function(d){var f=as.get(d)-1,_=s.get(d)-1;as.set(d,f),s.set(d,_),f||(Ul.has(d)||d.removeAttribute(r),Ul.delete(d)),_||d.removeAttribute(n)}),Pf--,Pf||(as=new WeakMap,as=new WeakMap,Ul=new WeakMap,Vl={})}},gS=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=$N(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),LN(r,i,n,"aria-hidden")):function(){return null}};function jN(t){const e=DN(t),n=g.forwardRef((r,i)=>{const{children:s,...o}=r,a=g.Children.toArray(s),l=a.find(UN);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:i,children:g.isValidElement(u)?g.cloneElement(u,void 0,c):null})}return w.jsx(e,{...o,ref:i,children:s})});return n.displayName=`${t}.Slot`,n}function DN(t){const e=g.forwardRef((n,r)=>{const{children:i,...s}=n;if(g.isValidElement(i)){const o=BN(i),a=VN(s,i.props);return i.type!==g.Fragment&&(a.ref=r?oi(r,o):o),g.cloneElement(i,a)}return g.Children.count(i)>1?g.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var zN=Symbol("radix.slottable");function UN(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===zN}function VN(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function BN(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var td="Dialog",[mS]=Wi(td),[qN,Sn]=mS(td),yS=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!0}=t,a=g.useRef(null),l=g.useRef(null),[u,c]=Xc({prop:r,defaultProp:i??!1,onChange:s,caller:td});return w.jsx(qN,{scope:e,triggerRef:a,contentRef:l,contentId:Fs(),titleId:Fs(),descriptionId:Fs(),open:u,onOpenChange:c,onOpenToggle:g.useCallback(()=>c(d=>!d),[c]),modal:o,children:n})};yS.displayName=td;var _S="DialogTrigger",wS=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Sn(_S,n),s=Xe(e,i.triggerRef);return w.jsx(Ee.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":ug(i.open),...r,ref:s,onClick:J(t.onClick,i.onOpenToggle)})});wS.displayName=_S;var ag="DialogPortal",[HN,xS]=mS(ag,{forceMount:void 0}),bS=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:i}=t,s=Sn(ag,e);return w.jsx(HN,{scope:e,forceMount:n,children:g.Children.map(r,o=>w.jsx(gr,{present:n||s.open,children:w.jsx(Zc,{asChild:!0,container:i,children:o})}))})};bS.displayName=ag;var gc="DialogOverlay",ES=g.forwardRef((t,e)=>{const n=xS(gc,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,s=Sn(gc,t.__scopeDialog);return s.modal?w.jsx(gr,{present:r||s.open,children:w.jsx(GN,{...i,ref:e})}):null});ES.displayName=gc;var WN=jN("DialogOverlay.RemoveScroll"),GN=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Sn(gc,n);return w.jsx(og,{as:WN,allowPinchZoom:!0,shards:[i.contentRef],children:w.jsx(Ee.div,{"data-state":ug(i.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Ui="DialogContent",SS=g.forwardRef((t,e)=>{const n=xS(Ui,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,s=Sn(Ui,t.__scopeDialog);return w.jsx(gr,{present:r||s.open,children:s.modal?w.jsx(KN,{...i,ref:e}):w.jsx(QN,{...i,ref:e})})});SS.displayName=Ui;var KN=g.forwardRef((t,e)=>{const n=Sn(Ui,t.__scopeDialog),r=g.useRef(null),i=Xe(e,n.contentRef,r);return g.useEffect(()=>{const s=r.current;if(s)return gS(s)},[]),w.jsx(CS,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:J(t.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:J(t.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:J(t.onFocusOutside,s=>s.preventDefault())})}),QN=g.forwardRef((t,e)=>{const n=Sn(Ui,t.__scopeDialog),r=g.useRef(!1),i=g.useRef(!1);return w.jsx(CS,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,a;(o=t.onCloseAutoFocus)==null||o.call(t,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var l,u;(l=t.onInteractOutside)==null||l.call(t,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),CS=g.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=t,a=Sn(Ui,n),l=g.useRef(null),u=Xe(e,l);return aS(),w.jsxs(w.Fragment,{children:[w.jsx(sg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:w.jsx(Jc,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":ug(a.open),...o,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),w.jsxs(w.Fragment,{children:[w.jsx(YN,{titleId:a.titleId}),w.jsx(JN,{contentRef:l,descriptionId:a.descriptionId})]})]})}),lg="DialogTitle",kS=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Sn(lg,n);return w.jsx(Ee.h2,{id:i.titleId,...r,ref:e})});kS.displayName=lg;var PS="DialogDescription",RS=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Sn(PS,n);return w.jsx(Ee.p,{id:i.descriptionId,...r,ref:e})});RS.displayName=PS;var TS="DialogClose",IS=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Sn(TS,n);return w.jsx(Ee.button,{type:"button",...r,ref:e,onClick:J(t.onClick,()=>i.onOpenChange(!1))})});IS.displayName=TS;function ug(t){return t?"open":"closed"}var OS="DialogTitleWarning",[y3,MS]=_A(OS,{contentName:Ui,titleName:lg,docsSlug:"dialog"}),YN=({titleId:t})=>{const e=MS(OS),n=`\`${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(n))},[n,t]),null},XN="DialogDescriptionWarning",JN=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${MS(XN).contentName}}.`;return g.useEffect(()=>{var s;const i=(s=t.current)==null?void 0:s.getAttribute("aria-describedby");e&&i&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},ZN=yS,e$=wS,t$=bS,n$=ES,r$=SS,i$=kS,_3=RS,s$=IS;const U_=t=>t.endsWith("/")?t.slice(0,-1):t;function Gi(t){return["1","true","yes"].includes(String(t??"").trim().toLowerCase())}function cg(){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 U_(e.origin)}catch{return U_(t)}}function o$(t){const e=t.startsWith("/")?t:`/${t}`,n=cg();return n?`${n}${e}`:e}function dg(t){const e=t.startsWith("/")?t:`/${t}`;return o$(e)}function AS(t,e={}){const n=dg("/api/v1/auth/hf/login"),i=new URL(n,window.location.origin).origin===window.location.origin?t:new URL(t,window.location.origin).toString(),s=new URLSearchParams({return_to:i});return e.authorizeInference&&s.set("authorize_inference","true"),e.collectEmail&&s.set("collect_email","true"),e.authorizeBucket&&s.set("authorize_bucket","true"),e.bucketCreate&&s.set("bucket_create","true"),`${n}?${s.toString()}`}function a$(){return dg("/admin-dashboard")}function w3(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=cg();return e?`${e}${t}`:t}return t}function yo(){return Gi("1")}function Va(){return Gi("0")}const l$="https://paperswithcode.co/chat";function u$(){return yo()&&!Va()}function c$(){return Gi(void 0)}function x3(){return Va()&&Gi(void 0)}function b3(){return Gi("0")}function E3(){return Gi("0")}function S3(){return typeof window<"u"&&window.location.hostname==="staging.paperswithcode.co"}function d$(){return Gi("1")}const f$="/hf-logo.svg?v=20260513b",V_=({size:t=14})=>w.jsx("img",{src:f$,alt:"",width:Math.round(t*95/88),height:t,"aria-hidden":"true",draggable:!1,style:{display:"block"}});function C3(t,e=!1){return AS(t,{authorizeInference:e})}const NS=({returnTo:t,compact:e=!1,label:n="Sign in",authorizeInference:r=!1,collectEmail:i=!1})=>{if(yo())return null;const s=()=>{window.location.href=AS(t,{authorizeInference:r,collectEmail:i})};return e?w.jsx("button",{type:"button",className:"icon-btn","aria-label":"Sign in with Hugging Face",title:"Sign in with Hugging Face",onClick:s,children:w.jsx(V_,{size:16})}):w.jsxs("button",{type:"button",className:"hf-signin-btn",onClick:s,"aria-label":"Sign in with Hugging Face",children:[w.jsx(V_,{size:18}),w.jsx("span",{children:n})]})};function h$(t,e=[]){let n=[];function r(s,o){const a=g.createContext(o);a.displayName=s+"Context";const l=n.length;n=[...n,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(()=>m,Object.values(m));return w.jsx(p.Provider,{value:y,children:_})};u.displayName=s+"Provider";function c(d,f){var p;const _=((p=f==null?void 0:f[t])==null?void 0:p[l])||a,m=g.useContext(_);if(m)return m;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[u,c]}const i=()=>{const s=n.map(o=>g.createContext(o));return function(a){const l=(a==null?void 0:a[t])||s;return g.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return i.scopeName=t,[r,p$(i,...e)]}function p$(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:l,scopeName:u})=>{const d=l(s)[`__scope${u}`];return{...a,...d}},{});return g.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}var v$=Symbol.for("react.lazy"),mc=kc[" use ".trim().toString()];function g$(t){return typeof t=="object"&&t!==null&&"then"in t}function $S(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===v$&&"_payload"in t&&g$(t._payload)}function FS(t){const e=m$(t),n=g.forwardRef((r,i)=>{let{children:s,...o}=r;$S(s)&&typeof mc=="function"&&(s=mc(s._payload));const a=g.Children.toArray(s),l=a.find(_$);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:i,children:g.isValidElement(u)?g.cloneElement(u,void 0,c):null})}return w.jsx(e,{...o,ref:i,children:s})});return n.displayName=`${t}.Slot`,n}var k3=FS("Slot");function m$(t){const e=g.forwardRef((n,r)=>{let{children:i,...s}=n;if($S(i)&&typeof mc=="function"&&(i=mc(i._payload)),g.isValidElement(i)){const o=x$(i),a=w$(s,i.props);return i.type!==g.Fragment&&(a.ref=r?oi(r,o):o),g.cloneElement(i,a)}return g.Children.count(i)>1?g.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var y$=Symbol("radix.slottable");function _$(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===y$}function w$(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function x$(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var b$=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],fg=b$.reduce((t,e)=>{const n=FS(`Primitive.${e}`),r=g.forwardRef((i,s)=>{const{asChild:o,...a}=i,l=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),LS={exports:{}},jS={};/** + * @license React + * use-sync-external-store-shim.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var fo=g;function E$(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var S$=typeof Object.is=="function"?Object.is:E$,C$=fo.useState,k$=fo.useEffect,P$=fo.useLayoutEffect,R$=fo.useDebugValue;function T$(t,e){var n=e(),r=C$({inst:{value:n,getSnapshot:e}}),i=r[0].inst,s=r[1];return P$(function(){i.value=n,i.getSnapshot=e,Rf(i)&&s({inst:i})},[t,n,e]),k$(function(){return Rf(i)&&s({inst:i}),t(function(){Rf(i)&&s({inst:i})})},[t]),R$(n),n}function Rf(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!S$(t,n)}catch{return!0}}function I$(t,e){return e()}var O$=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?I$:T$;jS.useSyncExternalStore=fo.useSyncExternalStore!==void 0?fo.useSyncExternalStore:O$;LS.exports=jS;var M$=LS.exports;function A$(){return M$.useSyncExternalStore(N$,()=>!0,()=>!1)}function N$(){return()=>{}}var hg="Avatar",[$$]=h$(hg),[F$,DS]=$$(hg),zS=g.forwardRef((t,e)=>{const{__scopeAvatar:n,...r}=t,[i,s]=g.useState("idle");return w.jsx(F$,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:s,children:w.jsx(fg.span,{...r,ref:e})})});zS.displayName=hg;var US="AvatarImage",VS=g.forwardRef((t,e)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...s}=t,o=DS(US,n),a=L$(r,s),l=Ft(u=>{i(u),o.onImageLoadingStatusChange(u)});return on(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?w.jsx(fg.img,{...s,ref:e,src:r}):null});VS.displayName=US;var BS="AvatarFallback",qS=g.forwardRef((t,e)=>{const{__scopeAvatar:n,delayMs:r,...i}=t,s=DS(BS,n),[o,a]=g.useState(r===void 0);return g.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),o&&s.imageLoadingStatus!=="loaded"?w.jsx(fg.span,{...i,ref:e}):null});qS.displayName=BS;function B_(t,e){return t?e?(t.src!==e&&(t.src=e),t.complete&&t.naturalWidth>0?"loaded":"loading"):"error":"idle"}function L$(t,{referrerPolicy:e,crossOrigin:n}){const r=A$(),i=g.useRef(null),s=r?(i.current||(i.current=new window.Image),i.current):null,[o,a]=g.useState(()=>B_(s,t));return on(()=>{a(B_(s,t))},[s,t]),on(()=>{const l=d=>()=>{a(d)};if(!s)return;const u=l("loaded"),c=l("error");return s.addEventListener("load",u),s.addEventListener("error",c),e&&(s.referrerPolicy=e),typeof n=="string"&&(s.crossOrigin=n),()=>{s.removeEventListener("load",u),s.removeEventListener("error",c)}},[s,n,e]),o}var HS=zS,WS=VS,GS=qS;function KS(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e{const e=z$(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{const a=o.split(pg);return a[0]===""&&a.length!==1&&a.shift(),YS(a,e)||D$(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},YS=(t,e)=>{var o;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),i=r?YS(t.slice(1),r):void 0;if(i)return i;if(e.validators.length===0)return;const s=t.join(pg);return(o=e.validators.find(({validator:a})=>a(s)))==null?void 0:o.classGroupId},q_=/^\[(.+)\]$/,D$=t=>{if(q_.test(t)){const e=q_.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},z$=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return V$(Object.entries(t.classGroups),n).forEach(([s,o])=>{Pp(o,r,s,e)}),r},Pp=(t,e,n,r)=>{t.forEach(i=>{if(typeof i=="string"){const s=i===""?e:H_(e,i);s.classGroupId=n;return}if(typeof i=="function"){if(U$(i)){Pp(i(r),e,n,r);return}e.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,o])=>{Pp(o,H_(e,s),n,r)})})},H_=(t,e)=>{let n=t;return e.split(pg).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},U$=t=>t.isThemeGetter,V$=(t,e)=>e?t.map(([n,r])=>{const i=r.map(s=>typeof s=="string"?e+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([o,a])=>[e+o,a])):s);return[n,i]}):t,B$=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const i=(s,o)=>{n.set(s,o),e++,e>t&&(e=0,r=n,n=new Map)};return{get(s){let o=n.get(s);if(o!==void 0)return o;if((o=r.get(s))!==void 0)return i(s,o),o},set(s,o){n.has(s)?n.set(s,o):i(s,o)}}},XS="!",q$=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,i=e[0],s=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:_,baseClassName:m,maybePostfixModifierPosition:p}};return n?a=>n({className:a,parseClassName:o}):o},H$=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},W$=t=>({cache:B$(t.cacheSize),parseClassName:q$(t),...j$(t)}),G$=/\s+/,K$=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=e,s=[],o=t.trim().split(G$);let a="";for(let l=o.length-1;l>=0;l-=1){const u=o[l],{modifiers:c,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:_}=n(u);let m=!!_,p=r(m?f.substring(0,_):f);if(!p){if(!m){a=u+(a.length>0?" "+a:a);continue}if(p=r(f),!p){a=u+(a.length>0?" "+a:a);continue}m=!1}const y=H$(c).join(":"),h=d?y+XS:y,v=h+p;if(s.includes(v))continue;s.push(v);const x=i(p,m);for(let b=0;b0?" "+a:a)}return a};function Q$(){let t=0,e,n,r="";for(;t{if(typeof t=="string")return t;let e,n="";for(let r=0;rd(c),t());return n=W$(u),r=n.cache.get,i=n.cache.set,s=a,a(l)}function a(l){const u=r(l);if(u)return u;const c=K$(l,n);return i(l,c),c}return function(){return s(Q$.apply(null,arguments))}}const Re=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},ZS=/^\[(?:([a-z-]+):)?(.+)\]$/i,X$=/^\d+\/\d+$/,J$=new Set(["px","full","screen"]),Z$=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,eF=/\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$/,tF=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,nF=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,rF=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Wn=t=>js(t)||J$.has(t)||X$.test(t),Sr=t=>_o(t,"length",dF),js=t=>!!t&&!Number.isNaN(Number(t)),Tf=t=>_o(t,"number",js),zo=t=>!!t&&Number.isInteger(Number(t)),iF=t=>t.endsWith("%")&&js(t.slice(0,-1)),re=t=>ZS.test(t),Cr=t=>Z$.test(t),sF=new Set(["length","size","percentage"]),oF=t=>_o(t,sF,e1),aF=t=>_o(t,"position",e1),lF=new Set(["image","url"]),uF=t=>_o(t,lF,hF),cF=t=>_o(t,"",fF),Uo=()=>!0,_o=(t,e,n)=>{const r=ZS.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},dF=t=>eF.test(t)&&!tF.test(t),e1=()=>!1,fF=t=>nF.test(t),hF=t=>rF.test(t),pF=()=>{const t=Re("colors"),e=Re("spacing"),n=Re("blur"),r=Re("brightness"),i=Re("borderColor"),s=Re("borderRadius"),o=Re("borderSpacing"),a=Re("borderWidth"),l=Re("contrast"),u=Re("grayscale"),c=Re("hueRotate"),d=Re("invert"),f=Re("gap"),_=Re("gradientColorStops"),m=Re("gradientColorStopPositions"),p=Re("inset"),y=Re("margin"),h=Re("opacity"),v=Re("padding"),x=Re("saturate"),b=Re("scale"),E=Re("sepia"),S=Re("skew"),k=Re("space"),C=Re("translate"),R=()=>["auto","contain","none"],P=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto",re,e],O=()=>[re,e],U=()=>["",Wn,Sr],L=()=>["auto",js,re],H=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],q=()=>["solid","dashed","dotted","double","none"],K=()=>["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"],M=()=>["","0",re],B=()=>["auto","avoid","all","avoid-page","page","left","right","column"],G=()=>[js,re];return{cacheSize:500,separator:":",theme:{colors:[Uo],spacing:[Wn,Sr],blur:["none","",Cr,re],brightness:G(),borderColor:[t],borderRadius:["none","","full",Cr,re],borderSpacing:O(),borderWidth:U(),contrast:G(),grayscale:M(),hueRotate:G(),invert:M(),gap:O(),gradientColorStops:[t],gradientColorStopPositions:[iF,Sr],inset:$(),margin:$(),opacity:G(),padding:O(),saturate:G(),scale:G(),sepia:M(),skew:G(),space:O(),translate:O()},classGroups:{aspect:[{aspect:["auto","square","video",re]}],container:["container"],columns:[{columns:[Cr]}],"break-after":[{"break-after":B()}],"break-before":[{"break-before":B()}],"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(),re]}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],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",zo,re]}],basis:[{basis:$()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",re]}],grow:[{grow:M()}],shrink:[{shrink:M()}],order:[{order:["first","last","none",zo,re]}],"grid-cols":[{"grid-cols":[Uo]}],"col-start-end":[{col:["auto",{span:["full",zo,re]},re]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[Uo]}],"row-start-end":[{row:["auto",{span:[zo,re]},re]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",re]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",re]}],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":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",re,e]}],"min-w":[{"min-w":[re,e,"min","max","fit"]}],"max-w":[{"max-w":[re,e,"none","full","min","max","fit","prose",{screen:[Cr]},Cr]}],h:[{h:[re,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[re,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[re,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[re,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Cr,Sr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Tf]}],"font-family":[{font:[Uo]}],"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",re]}],"line-clamp":[{"line-clamp":["none",js,Tf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Wn,re]}],"list-image":[{"list-image":["none",re]}],"list-style-type":[{list:["none","disc","decimal",re]}],"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:[...q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Wn,Sr]}],"underline-offset":[{"underline-offset":["auto",Wn,re]}],"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:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",re]}],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",re]}],"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(),aF]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",oF]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},uF]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[_]}],"gradient-via":[{via:[_]}],"gradient-to":[{to:[_]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"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:[...q(),"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:q()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...q()]}],"outline-offset":[{"outline-offset":[Wn,re]}],"outline-w":[{outline:[Wn,Sr]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[h]}],"ring-offset-w":[{"ring-offset":[Wn,Sr]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Cr,cF]}],"shadow-color":[{shadow:[Uo]}],opacity:[{opacity:[h]}],"mix-blend":[{"mix-blend":[...K(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":K()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Cr,re]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[x]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"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":[E]}],"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",re]}],duration:[{duration:G()}],ease:[{ease:["linear","in","out","in-out",re]}],delay:[{delay:G()}],animate:[{animate:["none","spin","ping","pulse","bounce",re]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[zo,re]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",re]}],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",re]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"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",re]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Wn,Sr,Tf]}],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"]}}},vF=Y$(pF);function at(...t){return vF(QS(t))}function P3(t){const e=t.trim(),n=e.match(/^(\d{4})-(\d{4,5})(v\d+)?$/);if(n)return`${n[1]}.${n[2]}`;const r=e.match(/^(\d{4}\.\d{4,5})(v\d+)$/);return r?r[1]:e}function R3(t){if(t==null||t==="")return"—";const e=typeof t=="string"?parseFloat(t):t;return Number.isFinite(e)?Math.abs(e)>=100?Bl(e,0):Math.abs(e)>=10?Bl(e,1):Math.abs(e)<1?Bl(e,3):Bl(e,2):String(t)}function Bl(t,e){const n=String(Math.abs(t));if(n.includes("e"))return t.toFixed(e);const r=+`${Math.round(+`${n}e${e}`)}e-${e}`;return(t<0?-r:r).toFixed(e)}const t1=g.forwardRef(({className:t,...e},n)=>w.jsx(HS,{ref:n,className:at("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...e}));t1.displayName=HS.displayName;const n1=g.forwardRef(({className:t,...e},n)=>w.jsx(WS,{ref:n,className:at("aspect-square h-full w-full",t),...e}));n1.displayName=WS.displayName;const r1=g.forwardRef(({className:t,...e},n)=>w.jsx(GS,{ref:n,className:at("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...e}));r1.displayName=GS.displayName;function W_(t){const e=gF(t),n=g.forwardRef((r,i)=>{const{children:s,...o}=r,a=g.Children.toArray(s),l=a.find(yF);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:i,children:g.isValidElement(u)?g.cloneElement(u,void 0,c):null})}return w.jsx(e,{...o,ref:i,children:s})});return n.displayName=`${t}.Slot`,n}function gF(t){const e=g.forwardRef((n,r)=>{const{children:i,...s}=n;if(g.isValidElement(i)){const o=wF(i),a=_F(s,i.props);return i.type!==g.Fragment&&(a.ref=r?oi(r,o):o),g.cloneElement(i,a)}return g.Children.count(i)>1?g.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var mF=Symbol("radix.slottable");function yF(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===mF}function _F(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function wF(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function vg(t){const e=t+"CollectionProvider",[n,r]=Wi(e),[i,s]=n(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(i,{scope:y,itemMap:x,collectionRef:v,children:h})};o.displayName=e;const a=t+"CollectionSlot",l=W_(a),u=V.forwardRef((p,y)=>{const{scope:h,children:v}=p,x=s(a,h),b=Xe(y,x.collectionRef);return w.jsx(l,{ref:b,children:v})});u.displayName=a;const c=t+"CollectionItemSlot",d="data-radix-collection-item",f=W_(c),_=V.forwardRef((p,y)=>{const{scope:h,children:v,...x}=p,b=V.useRef(null),E=Xe(y,b),S=s(c,h);return V.useEffect(()=>(S.itemMap.set(b,{ref:b,...x}),()=>void S.itemMap.delete(b))),w.jsx(f,{[d]:"",ref:E,children:v})});_.displayName=c;function m(p){const y=s(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((S,k)=>x.indexOf(S.ref.current)-x.indexOf(k.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:o,Slot:u,ItemSlot:_},m,r]}var xF=g.createContext(void 0);function i1(t){const e=g.useContext(xF);return t||e||"ltr"}const bF=["top","right","bottom","left"],ti=Math.min,zt=Math.max,yc=Math.round,ql=Math.floor,Un=t=>({x:t,y:t}),EF={left:"right",right:"left",bottom:"top",top:"bottom"};function Rp(t,e,n){return zt(t,ti(e,n))}function fr(t,e){return typeof t=="function"?t(e):t}function hr(t){return t.split("-")[0]}function wo(t){return t.split("-")[1]}function gg(t){return t==="x"?"y":"x"}function mg(t){return t==="y"?"height":"width"}function jn(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function yg(t){return gg(jn(t))}function SF(t,e,n){n===void 0&&(n=!1);const r=wo(t),i=yg(t),s=mg(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=_c(o)),[o,_c(o)]}function CF(t){const e=_c(t);return[Tp(t),e,Tp(e)]}function Tp(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const G_=["left","right"],K_=["right","left"],kF=["top","bottom"],PF=["bottom","top"];function RF(t,e,n){switch(t){case"top":case"bottom":return n?e?K_:G_:e?G_:K_;case"left":case"right":return e?kF:PF;default:return[]}}function TF(t,e,n,r){const i=wo(t);let s=RF(hr(t),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(Tp)))),s}function _c(t){const e=hr(t);return EF[e]+t.slice(e.length)}function IF(t){return{top:0,right:0,bottom:0,left:0,...t}}function s1(t){return typeof t!="number"?IF(t):{top:t,right:t,bottom:t,left:t}}function wc(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function Q_(t,e,n){let{reference:r,floating:i}=t;const s=jn(e),o=yg(e),a=mg(o),l=hr(e),u=s==="y",c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[a]/2-i[a]/2;let _;switch(l){case"top":_={x:c,y:r.y-i.height};break;case"bottom":_={x:c,y:r.y+r.height};break;case"right":_={x:r.x+r.width,y:d};break;case"left":_={x:r.x-i.width,y:d};break;default:_={x:r.x,y:r.y}}switch(wo(e)){case"start":_[o]-=f*(n&&u?-1:1);break;case"end":_[o]+=f*(n&&u?-1:1);break}return _}async function OF(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:_=0}=fr(e,t),m=s1(_),y=a[f?d==="floating"?"reference":"floating":d],h=wc(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),v=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),b=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},E=wc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:x,strategy:l}):v);return{top:(h.top-E.top+m.top)/b.y,bottom:(E.bottom-h.bottom+m.bottom)/b.y,left:(h.left-E.left+m.left)/b.x,right:(E.right-h.right+m.right)/b.x}}const MF=50,AF=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=o.detectOverflow?o:{...o,detectOverflow:OF},l=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:c,y:d}=Q_(u,r,l),f=r,_=0;const m={};for(let p=0;p({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=e,{element:u,padding:c=0}=fr(t,e)||{};if(u==null)return{};const d=s1(c),f={x:n,y:r},_=yg(i),m=mg(_),p=await o.getDimensions(u),y=_==="y",h=y?"top":"left",v=y?"bottom":"right",x=y?"clientHeight":"clientWidth",b=s.reference[m]+s.reference[_]-f[_]-s.floating[m],E=f[_]-s.reference[_],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let k=S?S[x]:0;(!k||!await(o.isElement==null?void 0:o.isElement(S)))&&(k=a.floating[x]||s.floating[m]);const C=b/2-E/2,R=k/2-p[m]/2-1,P=ti(d[h],R),$=ti(d[v],R),O=P,U=k-p[m]-$,L=k/2-p[m]/2+C,H=Rp(O,L,U),q=!l.arrow&&wo(i)!=null&&L!==H&&s.reference[m]/2-(LL<=0)){var $,O;const L=((($=s.flip)==null?void 0:$.index)||0)+1,H=k[L];if(H&&(!(d==="alignment"?v!==jn(H):!1)||P.every(I=>jn(I.placement)===v?I.overflows[0]>0:!0)))return{data:{index:L,overflows:P},reset:{placement:H}};let q=(O=P.filter(K=>K.overflows[0]<=0).sort((K,I)=>K.overflows[1]-I.overflows[1])[0])==null?void 0:O.placement;if(!q)switch(_){case"bestFit":{var U;const K=(U=P.filter(I=>{if(S){const M=jn(I.placement);return M===v||M==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(M=>M>0).reduce((M,B)=>M+B,0)]).sort((I,M)=>I[1]-M[1])[0])==null?void 0:U[0];K&&(q=K);break}case"initialPlacement":q=a;break}if(i!==q)return{reset:{placement:q}}}return{}}}};function Y_(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function X_(t){return bF.some(e=>t[e]>=0)}const FF=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:i="referenceHidden",...s}=fr(t,e);switch(i){case"referenceHidden":{const o=await r.detectOverflow(e,{...s,elementContext:"reference"}),a=Y_(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:X_(a)}}}case"escaped":{const o=await r.detectOverflow(e,{...s,altBoundary:!0}),a=Y_(o,n.floating);return{data:{escapedOffsets:a,escaped:X_(a)}}}default:return{}}}}},o1=new Set(["left","top"]);async function LF(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=hr(n),a=wo(n),l=jn(n)==="y",u=o1.has(o)?-1:1,c=s&&l?-1:1,d=fr(e,t);let{mainAxis:f,crossAxis:_,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof m=="number"&&(_=a==="end"?m*-1:m),l?{x:_*c,y:f*u}:{x:f*u,y:_*c}}const jF=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=e,l=await LF(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},DF=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i,platform:s}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:h=>{let{x:v,y:x}=h;return{x:v,y:x}}},...u}=fr(t,e),c={x:n,y:r},d=await s.detectOverflow(e,u),f=jn(hr(i)),_=gg(f);let m=c[_],p=c[f];if(o){const h=_==="y"?"top":"left",v=_==="y"?"bottom":"right",x=m+d[h],b=m-d[v];m=Rp(x,m,b)}if(a){const h=f==="y"?"top":"left",v=f==="y"?"bottom":"right",x=p+d[h],b=p-d[v];p=Rp(x,p,b)}const y=l.fn({...e,[_]:m,[f]:p});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[_]:o,[f]:a}}}}}},zF=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=fr(t,e),c={x:n,y:r},d=jn(i),f=gg(d);let _=c[f],m=c[d];const p=fr(a,e),y=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const x=f==="y"?"height":"width",b=s.reference[f]-s.floating[x]+y.mainAxis,E=s.reference[f]+s.reference[x]-y.mainAxis;_E&&(_=E)}if(u){var h,v;const x=f==="y"?"width":"height",b=o1.has(hr(i)),E=s.reference[d]-s.floating[x]+(b&&((h=o.offset)==null?void 0:h[d])||0)+(b?0:y.crossAxis),S=s.reference[d]+s.reference[x]+(b?0:((v=o.offset)==null?void 0:v[d])||0)-(b?y.crossAxis:0);mS&&(m=S)}return{[f]:_,[d]:m}}}},UF=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:s,platform:o,elements:a}=e,{apply:l=()=>{},...u}=fr(t,e),c=await o.detectOverflow(e,u),d=hr(i),f=wo(i),_=jn(i)==="y",{width:m,height:p}=s.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=m-c.left-c.right,b=ti(p-c[y],v),E=ti(m-c[h],x),S=!e.middlewareData.shift;let k=b,C=E;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(C=x),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(k=v),S&&!f){const P=zt(c.left,0),$=zt(c.right,0),O=zt(c.top,0),U=zt(c.bottom,0);_?C=m-2*(P!==0||$!==0?P+$:zt(c.left,c.right)):k=p-2*(O!==0||U!==0?O+U:zt(c.top,c.bottom))}await l({...e,availableWidth:C,availableHeight:k});const R=await o.getDimensions(a.floating);return m!==R.width||p!==R.height?{reset:{rects:!0}}:{}}}};function nd(){return typeof window<"u"}function xo(t){return a1(t)?(t.nodeName||"").toLowerCase():"#document"}function Ht(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Bn(t){var e;return(e=(a1(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function a1(t){return nd()?t instanceof Node||t instanceof Ht(t).Node:!1}function bn(t){return nd()?t instanceof Element||t instanceof Ht(t).Element:!1}function mr(t){return nd()?t instanceof HTMLElement||t instanceof Ht(t).HTMLElement:!1}function J_(t){return!nd()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Ht(t).ShadowRoot}function nl(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=En(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&i!=="inline"&&i!=="contents"}function VF(t){return/^(table|td|th)$/.test(xo(t))}function rd(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const BF=/transform|translate|scale|rotate|perspective|filter/,qF=/paint|layout|strict|content/,fi=t=>!!t&&t!=="none";let If;function _g(t){const e=bn(t)?En(t):t;return fi(e.transform)||fi(e.translate)||fi(e.scale)||fi(e.rotate)||fi(e.perspective)||!wg()&&(fi(e.backdropFilter)||fi(e.filter))||BF.test(e.willChange||"")||qF.test(e.contain||"")}function HF(t){let e=ni(t);for(;mr(e)&&!ho(e);){if(_g(e))return e;if(rd(e))return null;e=ni(e)}return null}function wg(){return If==null&&(If=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),If}function ho(t){return/^(html|body|#document)$/.test(xo(t))}function En(t){return Ht(t).getComputedStyle(t)}function id(t){return bn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ni(t){if(xo(t)==="html")return t;const e=t.assignedSlot||t.parentNode||J_(t)&&t.host||Bn(t);return J_(e)?e.host:e}function l1(t){const e=ni(t);return ho(e)?t.ownerDocument?t.ownerDocument.body:t.body:mr(e)&&nl(e)?e:l1(e)}function Ba(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=l1(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),o=Ht(i);if(s){const a=Ip(o);return e.concat(o,o.visualViewport||[],nl(i)?i:[],a&&n?Ba(a):[])}else return e.concat(i,Ba(i,[],n))}function Ip(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function u1(t){const e=En(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=mr(t),s=i?t.offsetWidth:n,o=i?t.offsetHeight:r,a=yc(n)!==s||yc(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function xg(t){return bn(t)?t:t.contextElement}function Ds(t){const e=xg(t);if(!mr(e))return Un(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=u1(e);let o=(s?yc(n.width):n.width)/r,a=(s?yc(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const WF=Un(0);function c1(t){const e=Ht(t);return!wg()||!e.visualViewport?WF:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function GF(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Ht(t)?!1:e}function Vi(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=xg(t);let o=Un(1);e&&(r?bn(r)&&(o=Ds(r)):o=Ds(t));const a=GF(s,n,r)?c1(s):Un(0);let l=(i.left+a.x)/o.x,u=(i.top+a.y)/o.y,c=i.width/o.x,d=i.height/o.y;if(s){const f=Ht(s),_=r&&bn(r)?Ht(r):r;let m=f,p=Ip(m);for(;p&&r&&_!==m;){const y=Ds(p),h=p.getBoundingClientRect(),v=En(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,m=Ht(p),p=Ip(m)}}return wc({width:c,height:d,x:l,y:u})}function sd(t,e){const n=id(t).scrollLeft;return e?e.left+n:Vi(Bn(t)).left+n}function d1(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-sd(t,n),i=n.top+e.scrollTop;return{x:r,y:i}}function KF(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",o=Bn(r),a=e?rd(e.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=Un(1);const c=Un(0),d=mr(r);if((d||!d&&!s)&&((xo(r)!=="body"||nl(o))&&(l=id(r)),d)){const _=Vi(r);u=Ds(r),c.x=_.x+r.clientLeft,c.y=_.y+r.clientTop}const f=o&&!d&&!s?d1(o,l):Un(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:n.y*u.y-l.scrollTop*u.y+c.y+f.y}}function QF(t){return Array.from(t.getClientRects())}function YF(t){const e=Bn(t),n=id(t),r=t.ownerDocument.body,i=zt(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=zt(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+sd(t);const a=-n.scrollTop;return En(r).direction==="rtl"&&(o+=zt(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}const Z_=25;function XF(t,e){const n=Ht(t),r=Bn(t),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const c=wg();(!c||c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const u=sd(r);if(u<=0){const c=r.ownerDocument,d=c.body,f=getComputedStyle(d),_=c.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,m=Math.abs(r.clientWidth-d.clientWidth-_);m<=Z_&&(s-=m)}else u<=Z_&&(s+=u);return{width:s,height:o,x:a,y:l}}function JF(t,e){const n=Vi(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=mr(t)?Ds(t):Un(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,l=i*s.x,u=r*s.y;return{width:o,height:a,x:l,y:u}}function e0(t,e,n){let r;if(e==="viewport")r=XF(t,n);else if(e==="document")r=YF(Bn(t));else if(bn(e))r=JF(e,n);else{const i=c1(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return wc(r)}function f1(t,e){const n=ni(t);return n===e||!bn(n)||ho(n)?!1:En(n).position==="fixed"||f1(n,e)}function ZF(t,e){const n=e.get(t);if(n)return n;let r=Ba(t,[],!1).filter(a=>bn(a)&&xo(a)!=="body"),i=null;const s=En(t).position==="fixed";let o=s?ni(t):t;for(;bn(o)&&!ho(o);){const a=En(o),l=_g(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||nl(o)&&!l&&f1(t,o))?r=r.filter(c=>c!==o):i=a,o=ni(o)}return e.set(t,r),r}function eL(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const o=[...n==="clippingAncestors"?rd(e)?[]:ZF(e,this._c):[].concat(n),r],a=e0(e,o[0],i);let l=a.top,u=a.right,c=a.bottom,d=a.left;for(let f=1;f{o(!1,1e-7)},1e3)}k===1&&!p1(u,t.getBoundingClientRect())&&o(),b=!1}try{n=new IntersectionObserver(E,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(E,x)}n.observe(t)}return o(!0),s}function aL(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=xg(t),c=i||s?[...u?Ba(u):[],...e?Ba(e):[]]:[];c.forEach(h=>{i&&h.addEventListener("scroll",n,{passive:!0}),s&&h.addEventListener("resize",n)});const d=u&&a?oL(u,n):null;let f=-1,_=null;o&&(_=new ResizeObserver(h=>{let[v]=h;v&&v.target===u&&_&&e&&(_.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=_)==null||x.observe(e)})),n()}),u&&!l&&_.observe(u),e&&_.observe(e));let m,p=l?Vi(t):null;l&&y();function y(){const h=Vi(t);p&&!p1(p,h)&&n(),p=h,m=requestAnimationFrame(y)}return n(),()=>{var h;c.forEach(v=>{i&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),d==null||d(),(h=_)==null||h.disconnect(),_=null,l&&cancelAnimationFrame(m)}}const lL=jF,uL=DF,cL=$F,dL=UF,fL=FF,n0=NF,hL=zF,pL=(t,e,n)=>{const r=new Map,i={platform:sL,...n},s={...i.platform,_c:r};return AF(t,e,{...i,platform:s})};var vL=typeof document<"u",gL=function(){},hu=vL?g.useLayoutEffect:gL;function xc(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 n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!xc(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&t.$$typeof)&&!xc(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function v1(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function r0(t,e){const n=v1(t);return Math.round(e*n)/n}function Mf(t){const e=g.useRef(t);return hu(()=>{e.current=t}),e}function mL(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:l,open:u}=t,[c,d]=g.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[f,_]=g.useState(r);xc(f,r)||_(r);const[m,p]=g.useState(null),[y,h]=g.useState(null),v=g.useCallback(I=>{I!==S.current&&(S.current=I,p(I))},[]),x=g.useCallback(I=>{I!==k.current&&(k.current=I,h(I))},[]),b=s||m,E=o||y,S=g.useRef(null),k=g.useRef(null),C=g.useRef(c),R=l!=null,P=Mf(l),$=Mf(i),O=Mf(u),U=g.useCallback(()=>{if(!S.current||!k.current)return;const I={placement:e,strategy:n,middleware:f};$.current&&(I.platform=$.current),pL(S.current,k.current,I).then(M=>{const B={...M,isPositioned:O.current!==!1};L.current&&!xc(C.current,B)&&(C.current=B,el.flushSync(()=>{d(B)}))})},[f,e,n,$,O]);hu(()=>{u===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,d(I=>({...I,isPositioned:!1})))},[u]);const L=g.useRef(!1);hu(()=>(L.current=!0,()=>{L.current=!1}),[]),hu(()=>{if(b&&(S.current=b),E&&(k.current=E),b&&E){if(P.current)return P.current(b,E,U);U()}},[b,E,U,P,R]);const H=g.useMemo(()=>({reference:S,floating:k,setReference:v,setFloating:x}),[v,x]),q=g.useMemo(()=>({reference:b,floating:E}),[b,E]),K=g.useMemo(()=>{const I={position:n,left:0,top:0};if(!q.floating)return I;const M=r0(q.floating,c.x),B=r0(q.floating,c.y);return a?{...I,transform:"translate("+M+"px, "+B+"px)",...v1(q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:B}},[n,a,q.floating,c.x,c.y]);return g.useMemo(()=>({...c,update:U,refs:H,elements:q,floatingStyles:K}),[c,U,H,q,K])}const yL=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?n0({element:r.current,padding:i}).fn(n):{}:r?n0({element:r,padding:i}).fn(n):{}}}},_L=(t,e)=>{const n=lL(t);return{name:n.name,fn:n.fn,options:[t,e]}},wL=(t,e)=>{const n=uL(t);return{name:n.name,fn:n.fn,options:[t,e]}},xL=(t,e)=>({fn:hL(t).fn,options:[t,e]}),bL=(t,e)=>{const n=cL(t);return{name:n.name,fn:n.fn,options:[t,e]}},EL=(t,e)=>{const n=dL(t);return{name:n.name,fn:n.fn,options:[t,e]}},SL=(t,e)=>{const n=fL(t);return{name:n.name,fn:n.fn,options:[t,e]}},CL=(t,e)=>{const n=yL(t);return{name:n.name,fn:n.fn,options:[t,e]}};var kL="Arrow",g1=g.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...s}=t;return w.jsx(Ee.svg,{...s,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:w.jsx("polygon",{points:"0,0 30,0 15,10"})})});g1.displayName=kL;var PL=g1;function RL(t){const[e,n]=g.useState(void 0);return on(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;o=u.inlineSize,a=u.blockSize}else o=t.offsetWidth,a=t.offsetHeight;n({width:o,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var bg="Popper",[m1,y1]=Wi(bg),[TL,_1]=m1(bg),w1=t=>{const{__scopePopper:e,children:n}=t,[r,i]=g.useState(null);return w.jsx(TL,{scope:e,anchor:r,onAnchorChange:i,children:n})};w1.displayName=bg;var x1="PopperAnchor",b1=g.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,s=_1(x1,n),o=g.useRef(null),a=Xe(e,o),l=g.useRef(null);return g.useEffect(()=>{const u=l.current;l.current=(r==null?void 0:r.current)||o.current,u!==l.current&&s.onAnchorChange(l.current)}),r?null:w.jsx(Ee.div,{...i,ref:a})});b1.displayName=x1;var Eg="PopperContent",[IL,OL]=m1(Eg),E1=g.forwardRef((t,e)=>{var ze,ve,Ae,kt,yr,gt;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:_="optimized",onPlaced:m,...p}=t,y=_1(Eg,n),[h,v]=g.useState(null),x=Xe(e,Ge=>v(Ge)),[b,E]=g.useState(null),S=RL(b),k=(S==null?void 0:S.width)??0,C=(S==null?void 0:S.height)??0,R=r+(s!=="center"?"-"+s:""),P=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},$=Array.isArray(u)?u:[u],O=$.length>0,U={padding:P,boundary:$.filter(AL),altBoundary:O},{refs:L,floatingStyles:H,placement:q,isPositioned:K,middlewareData:I}=mL({strategy:"fixed",placement:R,whileElementsMounted:(...Ge)=>aL(...Ge,{animationFrame:_==="always"}),elements:{reference:y.anchor},middleware:[_L({mainAxis:i+C,alignmentAxis:o}),l&&wL({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?xL():void 0,...U}),l&&bL({...U}),EL({...U,apply:({elements:Ge,rects:ai,availableWidth:Yi,availableHeight:Pt})=>{const{width:Xi,height:_r}=ai.reference,ln=Ge.floating.style;ln.setProperty("--radix-popper-available-width",`${Yi}px`),ln.setProperty("--radix-popper-available-height",`${Pt}px`),ln.setProperty("--radix-popper-anchor-width",`${Xi}px`),ln.setProperty("--radix-popper-anchor-height",`${_r}px`)}}),b&&CL({element:b,padding:a}),NL({arrowWidth:k,arrowHeight:C}),f&&SL({strategy:"referenceHidden",...U})]}),[M,B]=k1(q),G=Ft(m);on(()=>{K&&(G==null||G())},[K,G]);const Z=(ze=I.arrow)==null?void 0:ze.x,se=(ve=I.arrow)==null?void 0:ve.y,ce=((Ae=I.arrow)==null?void 0:Ae.centerOffset)!==0,[_e,Se]=g.useState();return on(()=>{h&&Se(window.getComputedStyle(h).zIndex)},[h]),w.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:K?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:_e,"--radix-popper-transform-origin":[(kt=I.transformOrigin)==null?void 0:kt.x,(yr=I.transformOrigin)==null?void 0:yr.y].join(" "),...((gt=I.hide)==null?void 0:gt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:w.jsx(IL,{scope:n,placedSide:M,onArrowChange:E,arrowX:Z,arrowY:se,shouldHideArrow:ce,children:w.jsx(Ee.div,{"data-side":M,"data-align":B,...p,ref:x,style:{...p.style,animation:K?void 0:"none"}})})})});E1.displayName=Eg;var S1="PopperArrow",ML={top:"bottom",right:"left",bottom:"top",left:"right"},C1=g.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,s=OL(S1,r),o=ML[s.placedSide];return w.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:w.jsx(PL,{...i,ref:n,style:{...i.style,display:"block"}})})});C1.displayName=S1;function AL(t){return t!==null}var NL=t=>({name:"transformOrigin",options:t,fn(e){var y,h,v;const{placement:n,rects:r,middlewareData:i}=e,o=((y=i.arrow)==null?void 0:y.centerOffset)!==0,a=o?0:t.arrowWidth,l=o?0:t.arrowHeight,[u,c]=k1(n),d={start:"0%",center:"50%",end:"100%"}[c],f=(((h=i.arrow)==null?void 0:h.x)??0)+a/2,_=(((v=i.arrow)==null?void 0:v.y)??0)+l/2;let m="",p="";return u==="bottom"?(m=o?d:`${f}px`,p=`${-l}px`):u==="top"?(m=o?d:`${f}px`,p=`${r.floating.height+l}px`):u==="right"?(m=`${-l}px`,p=o?d:`${_}px`):u==="left"&&(m=`${r.floating.width+l}px`,p=o?d:`${_}px`),{data:{x:m,y:p}}}});function k1(t){const[e,n="center"]=t.split("-");return[e,n]}var $L=w1,FL=b1,LL=E1,jL=C1,Af="rovingFocusGroup.onEntryFocus",DL={bubbles:!1,cancelable:!0},rl="RovingFocusGroup",[Op,P1,zL]=vg(rl),[UL,R1]=Wi(rl,[zL]),[VL,BL]=UL(rl),T1=g.forwardRef((t,e)=>w.jsx(Op.Provider,{scope:t.__scopeRovingFocusGroup,children:w.jsx(Op.Slot,{scope:t.__scopeRovingFocusGroup,children:w.jsx(qL,{...t,ref:e})})}));T1.displayName=rl;var qL=g.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:c=!1,...d}=t,f=g.useRef(null),_=Xe(e,f),m=i1(s),[p,y]=Xc({prop:o,defaultProp:a??null,onChange:l,caller:rl}),[h,v]=g.useState(!1),x=Ft(u),b=P1(n),E=g.useRef(!1),[S,k]=g.useState(0);return g.useEffect(()=>{const C=f.current;if(C)return C.addEventListener(Af,x),()=>C.removeEventListener(Af,x)},[x]),w.jsx(VL,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:p,onItemFocus:g.useCallback(C=>y(C),[y]),onItemShiftTab:g.useCallback(()=>v(!0),[]),onFocusableItemAdd:g.useCallback(()=>k(C=>C+1),[]),onFocusableItemRemove:g.useCallback(()=>k(C=>C-1),[]),children:w.jsx(Ee.div,{tabIndex:h||S===0?-1:0,"data-orientation":r,...d,ref:_,style:{outline:"none",...t.style},onMouseDown:J(t.onMouseDown,()=>{E.current=!0}),onFocus:J(t.onFocus,C=>{const R=!E.current;if(C.target===C.currentTarget&&R&&!h){const P=new CustomEvent(Af,DL);if(C.currentTarget.dispatchEvent(P),!P.defaultPrevented){const $=b().filter(q=>q.focusable),O=$.find(q=>q.active),U=$.find(q=>q.id===p),H=[O,U,...$].filter(Boolean).map(q=>q.ref.current);M1(H,c)}}E.current=!1}),onBlur:J(t.onBlur,()=>v(!1))})})}),I1="RovingFocusGroupItem",O1=g.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:s,children:o,...a}=t,l=Fs(),u=s||l,c=BL(I1,n),d=c.currentTabStopId===u,f=P1(n),{onFocusableItemAdd:_,onFocusableItemRemove:m,currentTabStopId:p}=c;return g.useEffect(()=>{if(r)return _(),()=>m()},[r,_,m]),w.jsx(Op.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:w.jsx(Ee.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...a,ref:e,onMouseDown:J(t.onMouseDown,y=>{r?c.onItemFocus(u):y.preventDefault()}),onFocus:J(t.onFocus,()=>c.onItemFocus(u)),onKeyDown:J(t.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){c.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const h=GL(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?KL(x,b+1):x.slice(b+1)}setTimeout(()=>M1(x))}}),children:typeof o=="function"?o({isCurrentTabStop:d,hasTabStop:p!=null}):o})})});O1.displayName=I1;var HL={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function WL(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function GL(t,e,n){const r=WL(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return HL[r]}function M1(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function KL(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var QL=T1,YL=O1;function XL(t){const e=JL(t),n=g.forwardRef((r,i)=>{const{children:s,...o}=r,a=g.Children.toArray(s),l=a.find(ej);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:i,children:g.isValidElement(u)?g.cloneElement(u,void 0,c):null})}return w.jsx(e,{...o,ref:i,children:s})});return n.displayName=`${t}.Slot`,n}function JL(t){const e=g.forwardRef((n,r)=>{const{children:i,...s}=n;if(g.isValidElement(i)){const o=nj(i),a=tj(s,i.props);return i.type!==g.Fragment&&(a.ref=r?oi(r,o):o),g.cloneElement(i,a)}return g.Children.count(i)>1?g.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var ZL=Symbol("radix.slottable");function ej(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===ZL}function tj(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function nj(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Mp=["Enter"," "],rj=["ArrowDown","PageUp","Home"],A1=["ArrowUp","PageDown","End"],ij=[...rj,...A1],sj={ltr:[...Mp,"ArrowRight"],rtl:[...Mp,"ArrowLeft"]},oj={ltr:["ArrowLeft"],rtl:["ArrowRight"]},il="Menu",[qa,aj,lj]=vg(il),[Ki,N1]=Wi(il,[lj,y1,R1]),od=y1(),$1=R1(),[uj,Qi]=Ki(il),[cj,sl]=Ki(il),F1=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:i,onOpenChange:s,modal:o=!0}=t,a=od(e),[l,u]=g.useState(null),c=g.useRef(!1),d=Ft(s),f=i1(i);return g.useEffect(()=>{const _=()=>{c.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>c.current=!1;return document.addEventListener("keydown",_,{capture:!0}),()=>{document.removeEventListener("keydown",_,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),w.jsx($L,{...a,children:w.jsx(uj,{scope:e,open:n,onOpenChange:d,content:l,onContentChange:u,children:w.jsx(cj,{scope:e,onClose:g.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:c,dir:f,modal:o,children:r})})})};F1.displayName=il;var dj="MenuAnchor",Sg=g.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=od(n);return w.jsx(FL,{...i,...r,ref:e})});Sg.displayName=dj;var Cg="MenuPortal",[fj,L1]=Ki(Cg,{forceMount:void 0}),j1=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:i}=t,s=Qi(Cg,e);return w.jsx(fj,{scope:e,forceMount:n,children:w.jsx(gr,{present:n||s.open,children:w.jsx(Zc,{asChild:!0,container:i,children:r})})})};j1.displayName=Cg;var nn="MenuContent",[hj,kg]=Ki(nn),D1=g.forwardRef((t,e)=>{const n=L1(nn,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,s=Qi(nn,t.__scopeMenu),o=sl(nn,t.__scopeMenu);return w.jsx(qa.Provider,{scope:t.__scopeMenu,children:w.jsx(gr,{present:r||s.open,children:w.jsx(qa.Slot,{scope:t.__scopeMenu,children:o.modal?w.jsx(pj,{...i,ref:e}):w.jsx(vj,{...i,ref:e})})})})}),pj=g.forwardRef((t,e)=>{const n=Qi(nn,t.__scopeMenu),r=g.useRef(null),i=Xe(e,r);return g.useEffect(()=>{const s=r.current;if(s)return gS(s)},[]),w.jsx(Pg,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:J(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),vj=g.forwardRef((t,e)=>{const n=Qi(nn,t.__scopeMenu);return w.jsx(Pg,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),gj=XL("MenuContent.ScrollLock"),Pg=g.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,onDismiss:_,disableOutsideScroll:m,...p}=t,y=Qi(nn,n),h=sl(nn,n),v=od(n),x=$1(n),b=aj(n),[E,S]=g.useState(null),k=g.useRef(null),C=Xe(e,k,y.onContentChange),R=g.useRef(0),P=g.useRef(""),$=g.useRef(0),O=g.useRef(null),U=g.useRef("right"),L=g.useRef(0),H=m?og:g.Fragment,q=m?{as:gj,allowPinchZoom:!0}:void 0,K=M=>{var ze,ve;const B=P.current+M,G=b().filter(Ae=>!Ae.disabled),Z=document.activeElement,se=(ze=G.find(Ae=>Ae.ref.current===Z))==null?void 0:ze.textValue,ce=G.map(Ae=>Ae.textValue),_e=Rj(ce,B,se),Se=(ve=G.find(Ae=>Ae.textValue===_e))==null?void 0:ve.ref.current;(function Ae(kt){P.current=kt,window.clearTimeout(R.current),kt!==""&&(R.current=window.setTimeout(()=>Ae(""),1e3))})(B),Se&&setTimeout(()=>Se.focus())};g.useEffect(()=>()=>window.clearTimeout(R.current),[]),aS();const I=g.useCallback(M=>{var G,Z;return U.current===((G=O.current)==null?void 0:G.side)&&Ij(M,(Z=O.current)==null?void 0:Z.area)},[]);return w.jsx(hj,{scope:n,searchRef:P,onItemEnter:g.useCallback(M=>{I(M)&&M.preventDefault()},[I]),onItemLeave:g.useCallback(M=>{var B;I(M)||((B=k.current)==null||B.focus(),S(null))},[I]),onTriggerLeave:g.useCallback(M=>{I(M)&&M.preventDefault()},[I]),pointerGraceTimerRef:$,onPointerGraceIntentChange:g.useCallback(M=>{O.current=M},[]),children:w.jsx(H,{...q,children:w.jsx(sg,{asChild:!0,trapped:i,onMountAutoFocus:J(s,M=>{var B;M.preventDefault(),(B=k.current)==null||B.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:w.jsx(Jc,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,onDismiss:_,children:w.jsx(QL,{asChild:!0,...x,dir:h.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:S,onEntryFocus:J(l,M=>{h.isUsingKeyboardRef.current||M.preventDefault()}),preventScrollOnEntryFocus:!0,children:w.jsx(LL,{role:"menu","aria-orientation":"vertical","data-state":tC(y.open),"data-radix-menu-content":"",dir:h.dir,...v,...p,ref:C,style:{outline:"none",...p.style},onKeyDown:J(p.onKeyDown,M=>{const G=M.target.closest("[data-radix-menu-content]")===M.currentTarget,Z=M.ctrlKey||M.altKey||M.metaKey,se=M.key.length===1;G&&(M.key==="Tab"&&M.preventDefault(),!Z&&se&&K(M.key));const ce=k.current;if(M.target!==ce||!ij.includes(M.key))return;M.preventDefault();const Se=b().filter(ze=>!ze.disabled).map(ze=>ze.ref.current);A1.includes(M.key)&&Se.reverse(),kj(Se)}),onBlur:J(t.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout(R.current),P.current="")}),onPointerMove:J(t.onPointerMove,Ha(M=>{const B=M.target,G=L.current!==M.clientX;if(M.currentTarget.contains(B)&&G){const Z=M.clientX>L.current?"right":"left";U.current=Z,L.current=M.clientX}}))})})})})})})});D1.displayName=nn;var mj="MenuGroup",Rg=g.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return w.jsx(Ee.div,{role:"group",...r,ref:e})});Rg.displayName=mj;var yj="MenuLabel",z1=g.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return w.jsx(Ee.div,{...r,ref:e})});z1.displayName=yj;var bc="MenuItem",i0="menu.itemSelect",ad=g.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...i}=t,s=g.useRef(null),o=sl(bc,t.__scopeMenu),a=kg(bc,t.__scopeMenu),l=Xe(e,s),u=g.useRef(!1),c=()=>{const d=s.current;if(!n&&d){const f=new CustomEvent(i0,{bubbles:!0,cancelable:!0});d.addEventListener(i0,_=>r==null?void 0:r(_),{once:!0}),ig(d,f),f.defaultPrevented?u.current=!1:o.onClose()}};return w.jsx(U1,{...i,ref:l,disabled:n,onClick:J(t.onClick,c),onPointerDown:d=>{var f;(f=t.onPointerDown)==null||f.call(t,d),u.current=!0},onPointerUp:J(t.onPointerUp,d=>{var f;u.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:J(t.onKeyDown,d=>{const f=a.searchRef.current!=="";n||f&&d.key===" "||Mp.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});ad.displayName=bc;var U1=g.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...s}=t,o=kg(bc,n),a=$1(n),l=g.useRef(null),u=Xe(e,l),[c,d]=g.useState(!1),[f,_]=g.useState("");return g.useEffect(()=>{const m=l.current;m&&_((m.textContent??"").trim())},[s.children]),w.jsx(qa.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:w.jsx(YL,{asChild:!0,...a,focusable:!r,children:w.jsx(Ee.div,{role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:u,onPointerMove:J(t.onPointerMove,Ha(m=>{r?o.onItemLeave(m):(o.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:J(t.onPointerLeave,Ha(m=>o.onItemLeave(m))),onFocus:J(t.onFocus,()=>d(!0)),onBlur:J(t.onBlur,()=>d(!1))})})})}),_j="MenuCheckboxItem",V1=g.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...i}=t;return w.jsx(G1,{scope:t.__scopeMenu,checked:n,children:w.jsx(ad,{role:"menuitemcheckbox","aria-checked":Ec(n)?"mixed":n,...i,ref:e,"data-state":Ig(n),onSelect:J(i.onSelect,()=>r==null?void 0:r(Ec(n)?!0:!n),{checkForDefaultPrevented:!1})})})});V1.displayName=_j;var B1="MenuRadioGroup",[wj,xj]=Ki(B1,{value:void 0,onValueChange:()=>{}}),q1=g.forwardRef((t,e)=>{const{value:n,onValueChange:r,...i}=t,s=Ft(r);return w.jsx(wj,{scope:t.__scopeMenu,value:n,onValueChange:s,children:w.jsx(Rg,{...i,ref:e})})});q1.displayName=B1;var H1="MenuRadioItem",W1=g.forwardRef((t,e)=>{const{value:n,...r}=t,i=xj(H1,t.__scopeMenu),s=n===i.value;return w.jsx(G1,{scope:t.__scopeMenu,checked:s,children:w.jsx(ad,{role:"menuitemradio","aria-checked":s,...r,ref:e,"data-state":Ig(s),onSelect:J(r.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,n)},{checkForDefaultPrevented:!1})})})});W1.displayName=H1;var Tg="MenuItemIndicator",[G1,bj]=Ki(Tg,{checked:!1}),K1=g.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...i}=t,s=bj(Tg,n);return w.jsx(gr,{present:r||Ec(s.checked)||s.checked===!0,children:w.jsx(Ee.span,{...i,ref:e,"data-state":Ig(s.checked)})})});K1.displayName=Tg;var Ej="MenuSeparator",Q1=g.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return w.jsx(Ee.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});Q1.displayName=Ej;var Sj="MenuArrow",Y1=g.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=od(n);return w.jsx(jL,{...i,...r,ref:e})});Y1.displayName=Sj;var Cj="MenuSub",[T3,X1]=Ki(Cj),Yo="MenuSubTrigger",J1=g.forwardRef((t,e)=>{const n=Qi(Yo,t.__scopeMenu),r=sl(Yo,t.__scopeMenu),i=X1(Yo,t.__scopeMenu),s=kg(Yo,t.__scopeMenu),o=g.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=s,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(Sg,{asChild:!0,...u,children:w.jsx(U1,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":tC(n.open),...t,ref:oi(e,i.onTriggerChange),onClick:d=>{var f;(f=t.onClick)==null||f.call(t,d),!(t.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:J(t.onPointerMove,Ha(d=>{s.onItemEnter(d),!d.defaultPrevented&&!t.disabled&&!n.open&&!o.current&&(s.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),c()},100))})),onPointerLeave:J(t.onPointerLeave,Ha(d=>{var _,m;c();const f=(_=n.content)==null?void 0:_.getBoundingClientRect();if(f){const p=(m=n.content)==null?void 0:m.dataset.side,y=p==="right",h=y?-5:5,v=f[y?"left":"right"],x=f[y?"right":"left"];s.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(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:J(t.onKeyDown,d=>{var _;const f=s.searchRef.current!=="";t.disabled||f&&d.key===" "||sj[r.dir].includes(d.key)&&(n.onOpenChange(!0),(_=n.content)==null||_.focus(),d.preventDefault())})})})});J1.displayName=Yo;var Z1="MenuSubContent",eC=g.forwardRef((t,e)=>{const n=L1(nn,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,s=Qi(nn,t.__scopeMenu),o=sl(nn,t.__scopeMenu),a=X1(Z1,t.__scopeMenu),l=g.useRef(null),u=Xe(e,l);return w.jsx(qa.Provider,{scope:t.__scopeMenu,children:w.jsx(gr,{present:r||s.open,children:w.jsx(qa.Slot,{scope:t.__scopeMenu,children:w.jsx(Pg,{id:a.contentId,"aria-labelledby":a.triggerId,...i,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:J(t.onFocusOutside,c=>{c.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:J(t.onEscapeKeyDown,c=>{o.onClose(),c.preventDefault()}),onKeyDown:J(t.onKeyDown,c=>{var _;const d=c.currentTarget.contains(c.target),f=oj[o.dir].includes(c.key);d&&f&&(s.onOpenChange(!1),(_=a.trigger)==null||_.focus(),c.preventDefault())})})})})})});eC.displayName=Z1;function tC(t){return t?"open":"closed"}function Ec(t){return t==="indeterminate"}function Ig(t){return Ec(t)?"indeterminate":t?"checked":"unchecked"}function kj(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function Pj(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function Rj(t,e,n){const i=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let o=Pj(t,Math.max(s,0));i.length===1&&(o=o.filter(u=>u!==n));const l=o.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function Tj(t,e){const{x:n,y:r}=t;let i=!1;for(let s=0,o=e.length-1;sr!=f>r&&n<(d-u)*(r-c)/(f-c)+u&&(i=!i)}return i}function Ij(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return Tj(n,e)}function Ha(t){return e=>e.pointerType==="mouse"?t(e):void 0}var Oj=F1,Mj=Sg,Aj=j1,Nj=D1,$j=Rg,Fj=z1,Lj=ad,jj=V1,Dj=q1,zj=W1,Uj=K1,Vj=Q1,Bj=Y1,qj=J1,Hj=eC,ld="DropdownMenu",[Wj]=Wi(ld,[N1]),Ct=N1(),[Gj,nC]=Wj(ld),rC=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:i,defaultOpen:s,onOpenChange:o,modal:a=!0}=t,l=Ct(e),u=g.useRef(null),[c,d]=Xc({prop:i,defaultProp:s??!1,onChange:o,caller:ld});return w.jsx(Gj,{scope:e,triggerId:Fs(),triggerRef:u,contentId:Fs(),open:c,onOpenChange:d,onOpenToggle:g.useCallback(()=>d(f=>!f),[d]),modal:a,children:w.jsx(Oj,{...l,open:c,onOpenChange:d,dir:r,modal:a,children:n})})};rC.displayName=ld;var iC="DropdownMenuTrigger",sC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=t,s=nC(iC,n),o=Ct(n);return w.jsx(Mj,{asChild:!0,...o,children:w.jsx(Ee.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:oi(e,s.triggerRef),onPointerDown:J(t.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:J(t.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});sC.displayName=iC;var Kj="DropdownMenuPortal",oC=t=>{const{__scopeDropdownMenu:e,...n}=t,r=Ct(e);return w.jsx(Aj,{...r,...n})};oC.displayName=Kj;var aC="DropdownMenuContent",lC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=nC(aC,n),s=Ct(n),o=g.useRef(!1);return w.jsx(Nj,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...r,ref:e,onCloseAutoFocus:J(t.onCloseAutoFocus,a=>{var l;o.current||(l=i.triggerRef.current)==null||l.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:J(t.onInteractOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,c=l.button===2||u;(!i.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)"}})});lC.displayName=aC;var Qj="DropdownMenuGroup",Yj=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ct(n);return w.jsx($j,{...i,...r,ref:e})});Yj.displayName=Qj;var Xj="DropdownMenuLabel",uC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ct(n);return w.jsx(Fj,{...i,...r,ref:e})});uC.displayName=Xj;var Jj="DropdownMenuItem",cC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ct(n);return w.jsx(Lj,{...i,...r,ref:e})});cC.displayName=Jj;var Zj="DropdownMenuCheckboxItem",dC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ct(n);return w.jsx(jj,{...i,...r,ref:e})});dC.displayName=Zj;var eD="DropdownMenuRadioGroup",tD=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ct(n);return w.jsx(Dj,{...i,...r,ref:e})});tD.displayName=eD;var nD="DropdownMenuRadioItem",fC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ct(n);return w.jsx(zj,{...i,...r,ref:e})});fC.displayName=nD;var rD="DropdownMenuItemIndicator",hC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ct(n);return w.jsx(Uj,{...i,...r,ref:e})});hC.displayName=rD;var iD="DropdownMenuSeparator",pC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ct(n);return w.jsx(Vj,{...i,...r,ref:e})});pC.displayName=iD;var sD="DropdownMenuArrow",oD=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ct(n);return w.jsx(Bj,{...i,...r,ref:e})});oD.displayName=sD;var aD="DropdownMenuSubTrigger",vC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ct(n);return w.jsx(qj,{...i,...r,ref:e})});vC.displayName=aD;var lD="DropdownMenuSubContent",gC=g.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ct(n);return w.jsx(Hj,{...i,...r,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)"}})});gC.displayName=lD;var uD=rC,cD=sC,dD=oC,mC=lC,yC=uC,_C=cC,wC=dC,xC=fC,bC=hC,EC=pC,SC=vC,CC=gC;/** + * @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 fD=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),kC=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/** + * @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. + */var hD={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @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 pD=g.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:o,...a},l)=>g.createElement("svg",{ref:l,...hD,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:kC("lucide",i),...a},[...o.map(([u,c])=>g.createElement(u,c)),...Array.isArray(s)?s:[s]]));/** + * @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 ud=(t,e)=>{const n=g.forwardRef(({className:r,...i},s)=>g.createElement(pD,{ref:s,iconNode:e,className:kC(`lucide-${fD(t)}`,r),...i}));return n.displayName=`${t}`,n};/** + * @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 vD=ud("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + * @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 gD=ud("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + * @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 mD=ud("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** + * @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 yD=ud("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),_D=uD,wD=cD,xD=g.forwardRef(({className:t,inset:e,children:n,...r},i)=>w.jsxs(SC,{ref:i,className:at("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",e&&"pl-8",t),...r,children:[n,w.jsx(gD,{className:"ml-auto h-4 w-4"})]}));xD.displayName=SC.displayName;const bD=g.forwardRef(({className:t,...e},n)=>w.jsx(CC,{ref:n,className:at("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e}));bD.displayName=CC.displayName;const PC=g.forwardRef(({className:t,sideOffset:e=4,...n},r)=>w.jsx(dD,{children:w.jsx(mC,{ref:r,sideOffset:e,className:at("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n})}));PC.displayName=mC.displayName;const Qn=g.forwardRef(({className:t,inset:e,...n},r)=>w.jsx(_C,{ref:r,className:at("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e&&"pl-8",t),...n}));Qn.displayName=_C.displayName;const ED=g.forwardRef(({className:t,children:e,checked:n,...r},i)=>w.jsxs(wC,{ref:i,className:at("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t),checked:n,...r,children:[w.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:w.jsx(bC,{children:w.jsx(vD,{className:"h-4 w-4"})})}),e]}));ED.displayName=wC.displayName;const SD=g.forwardRef(({className:t,children:e,...n},r)=>w.jsxs(xC,{ref:r,className:at("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t),...n,children:[w.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:w.jsx(bC,{children:w.jsx(mD,{className:"h-2 w-2 fill-current"})})}),e]}));SD.displayName=xC.displayName;const RC=g.forwardRef(({className:t,inset:e,...n},r)=>w.jsx(yC,{ref:r,className:at("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));RC.displayName=yC.displayName;const Ap=g.forwardRef(({className:t,...e},n)=>w.jsx(EC,{ref:n,className:at("-mx-1 my-1 h-px bg-muted",t),...e}));Ap.displayName=EC.displayName;function CD(t){const n=(t.name||t.username||"?").trim().split(/\s+/).filter(Boolean);return n.length===0?"?":n.length===1?n[0][0].toUpperCase():(n[0][0]+n[n.length-1][0]).toUpperCase()}const kD=({user:t,onLogout:e})=>w.jsxs(_D,{children:[w.jsx(wD,{asChild:!0,children:w.jsx("button",{type:"button",className:"user-avatar-btn","aria-label":`Account menu for ${t.username}`,children:w.jsxs(t1,{className:"h-8 w-8",children:[t.avatar_url&&w.jsx(n1,{src:t.avatar_url,alt:t.username}),w.jsx(r1,{className:"text-xs",children:CD(t)})]})})}),w.jsxs(PC,{align:"end",className:"w-56",children:[w.jsxs(RC,{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(Ap,{}),w.jsx(Qn,{asChild:!0,children:w.jsx("a",{href:`https://huggingface.co/${encodeURIComponent(t.username)}`,target:"_blank",rel:"noopener noreferrer",children:"Hugging Face profile"})}),w.jsx(Qn,{asChild:!0,children:w.jsx(mn,{to:"/frameworks",children:"Frameworks"})}),w.jsx(Qn,{asChild:!0,children:w.jsx(mn,{to:"/trends",children:"Trends"})}),t.is_admin&&w.jsxs(w.Fragment,{children:[w.jsx(Qn,{asChild:!0,children:w.jsx(mn,{to:"/admin-dashboard",children:"Admin dashboard"})}),w.jsx(Qn,{asChild:!0,children:w.jsx(mn,{to:"/submissions",children:"Review submissions"})})]}),w.jsx(Qn,{asChild:!0,children:w.jsx(mn,{to:`/${encodeURIComponent(t.username)}`,children:"My contributions"})}),w.jsx(Qn,{asChild:!0,children:w.jsx(mn,{to:"/settings",children:"Settings"})}),w.jsx(Ap,{}),w.jsx(Qn,{onSelect:n=>{n.preventDefault(),e()},children:"Log out"})]})]}),PD=!1;class cd extends Error{constructor(n,r){var i;super(`API request failed: ${n.status} ${n.statusText}`);wr(this,"status");wr(this,"statusText");wr(this,"response");wr(this,"detail");wr(this,"code");wr(this,"displayMessage");this.name="ApiError",this.status=n.status,this.statusText=n.statusText,this.response=r;try{if(this.detail=(i=JSON.parse(r))==null?void 0:i.detail,typeof this.detail=="string"&&(this.message=this.detail),Array.isArray(this.detail)){const s=this.detail[0];typeof s=="object"&&s!==null&&"msg"in s&&typeof s.msg=="string"&&(this.message=s.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 s="help"in this.detail&&typeof this.detail.help=="string"?` See ${this.detail.help} for help.`:"";this.message=`${this.detail.message}${s}`}}catch{this.detail=void 0,this.displayMessage=r||this.message;return}this.displayMessage=this.message}}function I3(t,e){return t instanceof cd?t.displayMessage||e:typeof t=="object"&&t!==null&&"message"in t&&typeof t.message=="string"&&t.message||e}class RD{constructor(e){this.baseUrl=e}async fetch(e,n){const r=`${this.baseUrl}${e}`;try{const{headers:i,...s}=n??{},a=(s.method??"GET").toUpperCase()==="GET"?"default":"no-store",l=new Headers(i);return typeof s.body=="string"&&!l.has("Content-Type")&&l.set("Content-Type","application/json"),await fetch(r,{...s,cache:s.cache??a,credentials:s.credentials??"include",headers:l})}catch(i){throw console.error(`[API] Request to ${r} failed:`,i),i}}async fetchOk(e,n){const r=await this.fetch(e,n);if(!r.ok){const i=new cd(r,await r.text());throw console.error("[API] Error response:",i.response),i}return r}async request(e,n){const r=await this.fetchOk(e,n);return r.status===204?void 0:await r.json()}}function TD(t){t instanceof cd&&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 TC(t){try{return await t()}catch(e){throw TD(e),e}}const Og=new RD(`${cg()}/api/v1`),ID=(t,e)=>Og.fetch(t,e),O3=(t,e)=>TC(()=>Og.fetchOk(t,e)),Sc=(t,e)=>TC(()=>Og.request(t,e));async function M3(t,e){try{return await Sc(t,e)}catch(n){if(n instanceof cd&&n.status===404)return null;throw n}}const s0={async getCurrentUser(){if(yo())return null;const t=await ID("/auth/me",{cache:"no-store"});return t.status===401||!t.ok?null:t.json()},async logout(){await Sc("/auth/logout",{method:"POST"})},async requestStagingAccess(){await Sc("/staging-access-request",{method:"POST"})}},Mg=V.createContext(null),o0="pwc:auth-stale",OD=({children:t})=>{const[e,n]=V.useState(null),[r,i]=V.useState(!0),s=mA(),o=V.useRef(null),a=V.useCallback(async()=>{i(!0);const c=await s0.getCurrentUser();n(c),i(!1)},[]),l=V.useCallback(async()=>{const c=dg("/api/v1/auth/logout");if(new URL(c,window.location.origin).origin!==window.location.origin){const d=document.createElement("form");d.method="POST",d.action=`${c}?return_to=${encodeURIComponent(window.location.href)}`,document.body.appendChild(d),d.submit();return}await s0.logout(),n(null)},[]);V.useEffect(()=>{a()},[a]),V.useEffect(()=>{},[e]),V.useEffect(()=>{o.current&&!e&&s.resetQueries(),o.current=e},[s,e]),V.useEffect(()=>{const c=()=>{n(null)};return window.addEventListener(o0,c),()=>window.removeEventListener(o0,c)},[]);const u=V.useMemo(()=>({user:e,isLoading:r,refresh:a,logout:l}),[e,r,a,l]);return w.jsx(Mg.Provider,{value:u,children:t})};function Ag(){const t=V.useContext(Mg);if(!t)throw new Error("useAuth must be used inside an ");return t}function A3(){return V.useContext(Mg)}const kr=({name:t,size:e=14})=>{const n={search:w.jsx("path",{d:"M11 11l3 3M7 12.5a5.5 5.5 0 110-11 5.5 5.5 0 010 11z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round"}),bookmark:w.jsx("path",{d:"M4 2h8v12l-4-3-4 3V2z",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinejoin:"round"}),menu:w.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),close:w.jsx("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),github:w.jsx("path",{fill:"currentColor",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})};return w.jsx("svg",{className:e===11?"icon-sm":"icon",viewBox:"0 0 16 16",width:e,height:e,children:n[t]})},a0="https://github.com/huggingface/paperswithcode-feedback/issues",l0="https://github.com/huggingface/paperswithcode",MD="https://paperswithcode.co/following",u0="pwc:announcement:following-feed:v1:dismissed",Nf=[{to:"/",label:"Trending",end:!0},{to:"/tasks",label:"Browse state-of-the-art",end:!1},{to:"/methods",label:"Methods",end:!1},{to:"/conferences",label:"Conferences",end:!1},{to:"/organizations",label:"Organizations",end:!1},{to:"/submit",label:"Submit",end:!1}],AD=()=>{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)},ND=()=>{const[t,e]=V.useState(!1);return V.useEffect(()=>{e(AD())},[]),w.jsx("kbd",{children:t?"⌘K":"Ctrl K"})},$D=({onOpenSearch:t})=>{const[e,n]=V.useState(!1),[r,i]=V.useState(()=>localStorage.getItem(u0)!=="1"),s=V.useRef(null),o=V.useRef(null),a=()=>n(!1),{user:l,logout:u}=Ag(),c=an(),d=c.pathname.startsWith("/pdf/"),f=`${c.pathname}${c.search}`||"/",_=yo(),m=Va()?{to:"/chat",label:"Chat",end:!1,badge:"New"}:u$()?{to:"/chat",label:"Chat",end:!1,badge:"New",href:l$}:null,p=m?[Nf[0],m,...Nf.slice(1)]:Nf;return V.useLayoutEffect(()=>{var S;const y=s.current,h=o.current;if(!y||!h)return;let v=!1;const x=()=>{if(v)return;const k=y.querySelector(".nav-item.active"),C=(k==null?void 0:k.offsetWidth)??0;h.style.width=`${C}px`,h.style.transform=`translateX(${(k==null?void 0:k.offsetLeft)??0}px)`,h.style.opacity=C>0?"1":"0"};x();const b=window.requestAnimationFrame(()=>{h.classList.add("nav-indicator-ready")}),E=typeof ResizeObserver>"u"?null:new ResizeObserver(x);return E==null||E.observe(y),window.addEventListener("resize",x),(S=document.fonts)==null||S.ready.then(x),()=>{v=!0,window.cancelAnimationFrame(b),E==null||E.disconnect(),window.removeEventListener("resize",x)}},[c.pathname,p.length]),w.jsxs(ZN,{open:e,onOpenChange:n,children:[w.jsxs("header",{className:"app-header",children:[w.jsxs("div",{className:"app-header-inner",children:[w.jsxs(is,{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:s,children:[p.map(({to:y,label:h,end:v,badge:x,href:b})=>{const 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:`nav-item${x?" nav-item-with-badge":""}`,children:E},y):w.jsx(is,{to:y,end:v,className:({isActive:S})=>`nav-item${x?" nav-item-with-badge":""}${S?" active":""}`,children:E},y)}),w.jsx("span",{ref:o,className:"nav-indicator","aria-hidden":"true"})]}),w.jsx("div",{className:"header-spacer"}),w.jsx("a",{className:"feedback-link header-feedback-link",href:a0,target:"_blank",rel:"noreferrer",children:"Submit feedback"}),w.jsx("a",{className:"icon-btn header-github-btn",href:l0,target:"_blank",rel:"noreferrer","aria-label":"GitHub repository",title:"GitHub repository",children:w.jsx(kr,{name:"github",size:14})}),w.jsxs("button",{className:"search-trigger","aria-label":"Search papers, authors, domains",onClick:t,children:[w.jsx(kr,{name:"search",size:13}),w.jsx("span",{children:"Search papers, authors, domains…"}),w.jsx(ND,{})]}),w.jsx("button",{className:"icon-btn mobile-search-btn","aria-label":"Search",onClick:t,children:w.jsx(kr,{name:"search",size:14})}),!_&&w.jsx(is,{to:"/saved",className:"icon-btn header-bookmark-btn","aria-label":"Saved papers",title:"Saved papers",children:w.jsx(kr,{name:"bookmark",size:13})}),_?null:l?w.jsx(kD,{user:l,onLogout:u}):w.jsx(NS,{returnTo:f}),w.jsx(e$,{asChild:!0,children:w.jsx("button",{className:"icon-btn mobile-menu-btn","aria-label":"Open menu",children:w.jsx(kr,{name:"menu",size:14})})})]}),!d&&r&&w.jsxs("div",{className:"site-announcement",role:"status",children:[w.jsx("span",{children:"New: "}),_?w.jsx("a",{href:MD,target:"_blank",rel:"noreferrer",children:"following feed"}):w.jsx(mn,{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(u0,"1"),i(!1)},children:w.jsx(kr,{name:"close",size:11})})]})]}),w.jsx(t$,{children:w.jsx(n$,{className:"mobile-nav-drawer",children:w.jsxs(r$,{className:"mobile-nav-panel","aria-describedby":void 0,children:[w.jsx(i$,{className:"sr-only",children:"Navigation menu"}),w.jsx(s$,{className:"icon-btn mobile-nav-close","aria-label":"Close menu",children:w.jsx(kr,{name:"close",size:14})}),w.jsxs("button",{type:"button",className:"mobile-nav-link mobile-nav-search",onClick:()=>{a(),t()},children:[w.jsx(kr,{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 E=`mobile-nav-link${x?" mobile-nav-link-with-badge":""}`,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:E,onClick:a,children:S},y):w.jsx(is,{to:y,end:v,className:E,onClick:a,children:S},y)}),w.jsx("a",{className:"mobile-nav-link",href:a0,target:"_blank",rel:"noreferrer",onClick:a,children:"Submit feedback"}),w.jsx("a",{className:"mobile-nav-link",href:l0,target:"_blank",rel:"noreferrer",onClick:a,children:"GitHub"}),!_&&w.jsx(is,{to:"/saved",className:"mobile-nav-link",onClick:a,children:"Saved papers"}),!_&&(l==null?void 0:l.is_admin)&&w.jsx(is,{to:"/admin-dashboard",className:"mobile-nav-link",onClick:a,children:"Admin dashboard"})]})})})]})},FD=()=>{const{pathname:t}=an();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(mn,{to:"/docs/api",children:"API"}),w.jsx(mn,{to:"/mcp",children:"MCP"}),w.jsx(mn,{to:"/privacy",children:"Privacy"}),w.jsx("a",{href:"https://github.com/huggingface/paperswithcode-feedback/issues",target:"_blank",rel:"noreferrer",children:"Feedback"})]})})},LD=1,jD=1e6;let $f=0;function DD(){return $f=($f+1)%Number.MAX_SAFE_INTEGER,$f.toString()}const Ff=new Map,c0=t=>{if(Ff.has(t))return;const e=setTimeout(()=>{Ff.delete(t),fa({type:"REMOVE_TOAST",toastId:t})},jD);Ff.set(t,e)},zD=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,LD)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?c0(n):t.toasts.forEach(r=>{c0(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},pu=[];let vu={toasts:[]};function fa(t){vu=zD(vu,t),pu.forEach(e=>{e(vu)})}function UD({...t}){const e=DD(),n=i=>fa({type:"UPDATE_TOAST",toast:{...i,id:e}}),r=()=>fa({type:"DISMISS_TOAST",toastId:e});return fa({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:i=>{i||r()}}}),{id:e,dismiss:r,update:n}}function VD(){const[t,e]=g.useState(vu);return g.useEffect(()=>(pu.push(e),()=>{const n=pu.indexOf(e);n>-1&&pu.splice(n,1)}),[t]),{...t,toast:UD,dismiss:n=>fa({type:"DISMISS_TOAST",toastId:n})}}var BD=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"}),qD="VisuallyHidden",Ng=g.forwardRef((t,e)=>w.jsx(Ee.span,{...t,ref:e,style:{...BD,...t.style}}));Ng.displayName=qD;var $g="ToastProvider",[Fg,HD,WD]=vg("Toast"),[IC]=Wi("Toast",[WD]),[GD,dd]=IC($g),OC=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:s=50,children:o}=t,[a,l]=g.useState(null),[u,c]=g.useState(0),d=g.useRef(!1),f=g.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${$g}\`. Expected non-empty \`string\`.`),w.jsx(Fg.Provider,{scope:e,children:w.jsx(GD,{scope:e,label:n,duration:r,swipeDirection:i,swipeThreshold:s,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:g.useCallback(()=>c(_=>_+1),[]),onToastRemove:g.useCallback(()=>c(_=>_-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:o})})};OC.displayName=$g;var MC="ToastViewport",KD=["F8"],Np="toast.viewportPause",$p="toast.viewportResume",AC=g.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=KD,label:i="Notifications ({hotkey})",...s}=t,o=dd(MC,n),a=HD(n),l=g.useRef(null),u=g.useRef(null),c=g.useRef(null),d=g.useRef(null),f=Xe(e,d,o.onViewportChange),_=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),m=o.toastCount>0;g.useEffect(()=>{const y=h=>{var x;r.length!==0&&r.every(b=>h[b]||h.code===b)&&((x=d.current)==null||x.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),g.useEffect(()=>{const y=l.current,h=d.current;if(m&&y&&h){const v=()=>{if(!o.isClosePausedRef.current){const S=new CustomEvent(Np);h.dispatchEvent(S),o.isClosePausedRef.current=!0}},x=()=>{if(o.isClosePausedRef.current){const S=new CustomEvent($p);h.dispatchEvent(S),o.isClosePausedRef.current=!1}},b=S=>{!y.contains(S.relatedTarget)&&x()},E=()=>{y.contains(document.activeElement)||x()};return y.addEventListener("focusin",v),y.addEventListener("focusout",b),y.addEventListener("pointermove",v),y.addEventListener("pointerleave",E),window.addEventListener("blur",v),window.addEventListener("focus",x),()=>{y.removeEventListener("focusin",v),y.removeEventListener("focusout",b),y.removeEventListener("pointermove",v),y.removeEventListener("pointerleave",E),window.removeEventListener("blur",v),window.removeEventListener("focus",x)}}},[m,o.isClosePausedRef]);const p=g.useCallback(({tabbingDirection:y})=>{const v=a().map(x=>{const b=x.ref.current,E=[b,...a2(b)];return y==="forwards"?E:E.reverse()});return(y==="forwards"?v.reverse():v).flat()},[a]);return g.useEffect(()=>{const y=d.current;if(y){const h=v=>{var E,S,k;const x=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!x){const C=document.activeElement,R=v.shiftKey;if(v.target===y&&R){(E=u.current)==null||E.focus();return}const O=p({tabbingDirection:R?"backwards":"forwards"}),U=O.findIndex(L=>L===C);Lf(O.slice(U+1))?v.preventDefault():R?(S=u.current)==null||S.focus():(k=c.current)==null||k.focus()}};return y.addEventListener("keydown",h),()=>y.removeEventListener("keydown",h)}},[a,p]),w.jsxs(UA,{ref:l,role:"region","aria-label":i.replace("{hotkey}",_),tabIndex:-1,style:{pointerEvents:m?void 0:"none"},children:[m&&w.jsx(Fp,{ref:u,onFocusFromOutsideViewport:()=>{const y=p({tabbingDirection:"forwards"});Lf(y)}}),w.jsx(Fg.Slot,{scope:n,children:w.jsx(Ee.ol,{tabIndex:-1,...s,ref:f})}),m&&w.jsx(Fp,{ref:c,onFocusFromOutsideViewport:()=>{const y=p({tabbingDirection:"backwards"});Lf(y)}})]})});AC.displayName=MC;var NC="ToastFocusProxy",Fp=g.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=t,s=dd(NC,n);return w.jsx(Ng,{tabIndex:0,...i,ref:e,style:{position:"fixed"},onFocus:o=>{var u;const a=o.relatedTarget;!((u=s.viewport)!=null&&u.contains(a))&&r()}})});Fp.displayName=NC;var ol="Toast",QD="toast.swipeStart",YD="toast.swipeMove",XD="toast.swipeCancel",JD="toast.swipeEnd",$C=g.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:i,onOpenChange:s,...o}=t,[a,l]=Xc({prop:r,defaultProp:i??!0,onChange:s,caller:ol});return w.jsx(gr,{present:n||a,children:w.jsx(t2,{open:a,...o,ref:e,onClose:()=>l(!1),onPause:Ft(t.onPause),onResume:Ft(t.onResume),onSwipeStart:J(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:J(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:J(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:J(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)})})})});$C.displayName=ol;var[ZD,e2]=IC(ol,{onClose(){}}),t2=g.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:i,open:s,onClose:o,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:c,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:_,...m}=t,p=dd(ol,n),[y,h]=g.useState(null),v=Xe(e,L=>h(L)),x=g.useRef(null),b=g.useRef(null),E=i||p.duration,S=g.useRef(0),k=g.useRef(E),C=g.useRef(0),{onToastAdd:R,onToastRemove:P}=p,$=Ft(()=>{var H;(y==null?void 0:y.contains(document.activeElement))&&((H=p.viewport)==null||H.focus()),o()}),O=g.useCallback(L=>{!L||L===1/0||(window.clearTimeout(C.current),S.current=new Date().getTime(),C.current=window.setTimeout($,L))},[$]);g.useEffect(()=>{const L=p.viewport;if(L){const H=()=>{O(k.current),u==null||u()},q=()=>{const K=new Date().getTime()-S.current;k.current=k.current-K,window.clearTimeout(C.current),l==null||l()};return L.addEventListener(Np,q),L.addEventListener($p,H),()=>{L.removeEventListener(Np,q),L.removeEventListener($p,H)}}},[p.viewport,E,l,u,O]),g.useEffect(()=>{s&&!p.isClosePausedRef.current&&O(E)},[s,E,p.isClosePausedRef,O]),g.useEffect(()=>(R(),()=>P()),[R,P]);const U=g.useMemo(()=>y?VC(y):null,[y]);return p.viewport?w.jsxs(w.Fragment,{children:[U&&w.jsx(n2,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:U}),w.jsx(ZD,{scope:n,onClose:$,children:el.createPortal(w.jsx(Fg.ItemSlot,{scope:n,children:w.jsx(zA,{asChild:!0,onEscapeKeyDown:J(a,()=>{p.isFocusedToastEscapeKeyDownRef.current||$(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:w.jsx(Ee.li,{tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":p.swipeDirection,...m,ref:v,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:J(t.onKeyDown,L=>{L.key==="Escape"&&(a==null||a(L.nativeEvent),L.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,$()))}),onPointerDown:J(t.onPointerDown,L=>{L.button===0&&(x.current={x:L.clientX,y:L.clientY})}),onPointerMove:J(t.onPointerMove,L=>{if(!x.current)return;const H=L.clientX-x.current.x,q=L.clientY-x.current.y,K=!!b.current,I=["left","right"].includes(p.swipeDirection),M=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,B=I?M(0,H):0,G=I?0:M(0,q),Z=L.pointerType==="touch"?10:2,se={x:B,y:G},ce={originalEvent:L,delta:se};K?(b.current=se,Hl(YD,d,ce,{discrete:!1})):d0(se,p.swipeDirection,Z)?(b.current=se,Hl(QD,c,ce,{discrete:!1}),L.target.setPointerCapture(L.pointerId)):(Math.abs(H)>Z||Math.abs(q)>Z)&&(x.current=null)}),onPointerUp:J(t.onPointerUp,L=>{const H=b.current,q=L.target;if(q.hasPointerCapture(L.pointerId)&&q.releasePointerCapture(L.pointerId),b.current=null,x.current=null,H){const K=L.currentTarget,I={originalEvent:L,delta:H};d0(H,p.swipeDirection,p.swipeThreshold)?Hl(JD,_,I,{discrete:!0}):Hl(XD,f,I,{discrete:!0}),K.addEventListener("click",M=>M.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),n2=t=>{const{__scopeToast:e,children:n,...r}=t,i=dd(ol,e),[s,o]=g.useState(!1),[a,l]=g.useState(!1);return s2(()=>o(!0)),g.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:w.jsx(Zc,{asChild:!0,children:w.jsx(Ng,{...r,children:s&&w.jsxs(w.Fragment,{children:[i.label," ",n]})})})},r2="ToastTitle",FC=g.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return w.jsx(Ee.div,{...r,ref:e})});FC.displayName=r2;var i2="ToastDescription",LC=g.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return w.jsx(Ee.div,{...r,ref:e})});LC.displayName=i2;var jC="ToastAction",DC=g.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?w.jsx(UC,{altText:n,asChild:!0,children:w.jsx(Lg,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${jC}\`. Expected non-empty \`string\`.`),null)});DC.displayName=jC;var zC="ToastClose",Lg=g.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,i=e2(zC,n);return w.jsx(UC,{asChild:!0,children:w.jsx(Ee.button,{type:"button",...r,ref:e,onClick:J(t.onClick,i.onClose)})})});Lg.displayName=zC;var UC=g.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...i}=t;return w.jsx(Ee.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...i,ref:e})});function VC(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),o2(r)){const i=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const o=r.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...VC(r))}}),e}function Hl(t,e,n,{discrete:r}){const i=n.originalEvent.currentTarget,s=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?ig(i,s):i.dispatchEvent(s)}var d0=(t,e,n=0)=>{const r=Math.abs(t.x),i=Math.abs(t.y),s=r>i;return e==="left"||e==="right"?s&&r>n:!s&&i>n};function s2(t=()=>{}){const e=Ft(t);on(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function o2(t){return t.nodeType===t.ELEMENT_NODE}function a2(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Lf(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var l2=OC,BC=AC,qC=$C,HC=FC,WC=LC,GC=DC,KC=Lg;const f0=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,h0=QS,u2=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return h0(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:s}=e,o=Object.keys(i).map(u=>{const c=n==null?void 0:n[u],d=s==null?void 0:s[u];if(c===null)return null;const f=f0(c)||f0(d);return i[u][f]}),a=n&&Object.entries(n).reduce((u,c)=>{let[d,f]=c;return f===void 0||(u[d]=f),u},{}),l=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:d,className:f,..._}=c;return Object.entries(_).every(m=>{let[p,y]=m;return Array.isArray(y)?y.includes({...s,...a}[p]):{...s,...a}[p]===y})?[...u,d,f]:u},[]);return h0(t,o,l,n==null?void 0:n.class,n==null?void 0:n.className)},c2=l2,QC=g.forwardRef(({className:t,...e},n)=>w.jsx(BC,{ref:n,className:at("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...e}));QC.displayName=BC.displayName;const d2=u2("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"}}),YC=g.forwardRef(({className:t,variant:e,...n},r)=>w.jsx(qC,{ref:r,className:at(d2({variant:e}),t),...n}));YC.displayName=qC.displayName;const f2=g.forwardRef(({className:t,...e},n)=>w.jsx(GC,{ref:n,className:at("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",t),...e}));f2.displayName=GC.displayName;const XC=g.forwardRef(({className:t,...e},n)=>w.jsx(KC,{ref:n,className:at("absolute right-2 top-2 inline-flex h-11 w-11 items-center justify-center rounded-md text-foreground transition-colors hover:bg-muted focus:outline-none focus:ring-2 focus:ring-ring group-[.destructive]:text-destructive-foreground group-[.destructive]:hover:bg-destructive-foreground/10 group-[.destructive]:focus:ring-destructive-foreground",t),"aria-label":"Dismiss notification","toast-close":"",...e,children:w.jsx(yD,{className:"h-4 w-4"})}));XC.displayName=KC.displayName;const JC=g.forwardRef(({className:t,...e},n)=>w.jsx(HC,{ref:n,className:at("text-sm font-semibold",t),...e}));JC.displayName=HC.displayName;const ZC=g.forwardRef(({className:t,...e},n)=>w.jsx(WC,{ref:n,className:at("text-sm opacity-90",t),...e}));ZC.displayName=WC.displayName;function h2(){const{toasts:t}=VD();return w.jsxs(c2,{children:[t.map(function({id:e,title:n,description:r,action:i,...s}){return w.jsxs(YC,{...s,children:[w.jsxs("div",{className:"grid gap-1",children:[n&&w.jsx(JC,{children:n}),r&&w.jsx(ZC,{children:r})]}),i,w.jsx(XC,{})]},e)}),w.jsx(QC,{})]})}function p2(){const{pathname:t,hash:e}=an();g.useLayoutEffect(()=>{e||window.scrollTo({top:0,left:0,behavior:"instant"})},[t,e])}class v2{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 p0=new v2(Sc),jf={hide_closed_source_evals:!1},ek=V.createContext(null),g2=({children:t})=>{const{user:e}=Ag(),[n,r]=V.useState(jf),[i,s]=V.useState(!1);V.useEffect(()=>{let l=!1;if(!e){r(jf);return}return s(!0),p0.getPreferences().then(u=>{l||r(u)}).catch(()=>{l||r(jf)}).finally(()=>{l||s(!1)}),()=>{l=!0}},[e]);const o=V.useCallback(async l=>{const u={...n,hide_closed_source_evals:l};if(r(u),!!e)try{const c=await p0.updatePreferences(u);r(c)}catch{r(n)}},[n,e]),a=V.useMemo(()=>({preferences:n,canPersist:!!e,isLoading:i,setHideClosedSourceEvals:o}),[n,e,i,o]);return w.jsx(ek.Provider,{value:a,children:t})};function N3(){const t=V.useContext(ek);if(!t)throw new Error("usePreferences must be used inside a ");return t}const tk=d$(),m2=tk?LM:FM;if(!tk&&typeof window<"u"){const t=window.location.hash;t.startsWith("#/")&&!t.startsWith("#//")&&window.history.replaceState(null,"",t.slice(1))}const y2=V.lazy(()=>oe(()=>import("./AuthorizePaperEditView-mMhbmAG2.js"),__vite__mapDeps([0,1,2,3,4]))),_2=V.lazy(()=>oe(()=>import("./FollowingView-CVyxNxmM.js"),__vite__mapDeps([5,6,7,1,8,9,10,11,12,2,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32]))),v0=V.lazy(()=>oe(()=>import("./FeedView-L-eiYDg9.js"),__vite__mapDeps([6,7,1,8,9,10,11,12,2,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32]))),w2=V.lazy(()=>oe(()=>import("./ChatView-wJIPZ39W.js"),__vite__mapDeps([33,1,34,25,26,16,35,36,9,37,38,39,40,41,42,2,43,44,45,46,13,47,48,17,18,49,50,21,22,51,52,53]))),x2=V.lazy(()=>oe(()=>import("./SharedChatView-DVE3k-Oa.js"),__vite__mapDeps([54,1,34,25,26,16,35,36,9,37,38,39,40,41,42,2,43,44,45,46,13,47,48,17,18,49,50]))),b2=V.lazy(()=>oe(()=>import("./PapersListView-BNcDd1lQ.js"),__vite__mapDeps([55,15,16,17,18,19,11,20,9,27,1,28,56,29,30,31,32,57,23,24]))),E2=V.lazy(()=>oe(()=>import("./PaperDetailView-B-27QVn7.js"),__vite__mapDeps([58,15,16,17,18,19,11,20,59,35,60,61,1,27,28,62,31,32,3,8,22,43,63,64,24,47,65,2,9,66,67,68,69,70,36,71,13,72,73,74,37,75,40,41,30,76,77,78]))),S2=V.lazy(()=>oe(()=>import("./PaperReaderView-CTxDY9uR.js"),__vite__mapDeps([79,1,34,25,26,16,35,36,9,37,38,39,40,41,42,2,43,44,45,46,13,47,48,17,18,49,50,80,61,20,27,28,33,21,22,51,52,53]))),C2=V.lazy(()=>oe(()=>import("./TagsIndexView-CHjo-ug4.js"),__vite__mapDeps([81,1,9,11,82,47,83,51,84,85,44,71,86,38,87,74,7,31,32,88,69,3,63,70,64,24,8,65,2,66,13,89]))),k2=V.lazy(()=>oe(()=>import("./TagBrowseView-bMr8w4y6.js"),__vite__mapDeps([90,91,1,2,10,13,15,16,17,18,19,11,20,14,92,57,23,24,80,39,40,41,42,35,50,9,82,27,28,29,30,31,32,86,37]))),P2=V.lazy(()=>oe(()=>import("./MethodsIndexView-2d98MRig.js"),__vite__mapDeps([93,1,9,82,31,32,88,69,3,63,70,64,24,8,47,65,2,66,13,89,84]))),R2=V.lazy(()=>oe(()=>import("./FrameworksIndexView-BxWPuGhr.js"),__vite__mapDeps([94,1,15,16,17,18,19,11,20,9]))),T2=V.lazy(()=>oe(()=>import("./TrendsView-BJILFDZ6.js"),__vite__mapDeps([95,1,32,31]))),I2=V.lazy(()=>oe(()=>import("./ConferencesIndexView-DF9D85K1.js"),__vite__mapDeps([96,1,9,31,32,88,69,3,63,70,64,24,8,47,65,2,66,13]))),O2=V.lazy(()=>oe(()=>import("./AiDeadlinesView-DJLyTAgt.js"),__vite__mapDeps([97,1,9,98,72,31,32,20,8]))),M2=V.lazy(()=>oe(()=>import("./ConferenceDetailView-BNri44qz.js"),__vite__mapDeps([99,1,80,39,40,41,42,35,16,2,50,9,11,31,32,20]))),A2=V.lazy(()=>oe(()=>import("./ConferenceTaskView-BBbbnoRS.js"),__vite__mapDeps([100,1,15,16,17,18,19,11,20,57,23,24,80,39,40,41,42,35,2,50,9,27,28,29,30,31,32]))),N2=V.lazy(()=>oe(()=>import("./OrganizationsIndexView-C_uscBZY.js"),__vite__mapDeps([101,1,32,9,102]))),$2=V.lazy(()=>oe(()=>import("./OrganizationDetailView-BsHsK07O.js"),__vite__mapDeps([103,104,91,1,2,10,13,15,16,17,18,19,11,20,80,39,40,41,42,35,50,105,31,9,57,23,24,32,64,3,8,47,65,29,30,27,28,77,106]))),F2=V.lazy(()=>oe(()=>import("./OrganizationTaskView--dnePIkF.js"),__vite__mapDeps([107,104,91,1,2,10,13,15,16,17,18,19,11,20,80,39,40,41,42,35,50,105,31,9,57,23,24,32,64,3,8,47,65,29,30,27,28,77,106]))),L2=V.lazy(()=>oe(()=>import("./AuthorDetailView-BsVP0aHv.js"),__vite__mapDeps([108,1,15,16,17,18,19,11,20,23,24,57,91,2,10,13,32,31,29,30,27,28,106]))),j2=V.lazy(()=>oe(()=>import("./MethodDetailView-PtjfC1LZ.js"),__vite__mapDeps([109,91,1,2,10,13,16,28,15,17,18,19,11,20,57,23,24,80,39,40,41,42,35,50,9,82,29,30,31,32]))),D2=V.lazy(()=>oe(()=>import("./BenchmarkDetailView-DGAxl02Y.js"),__vite__mapDeps([110,91,1,2,10,13,9,59,16,35,20,60,19,98,72,15,17,18,11,31,32,92,82,111]))),z2=V.lazy(()=>oe(()=>import("./SavedPapersView-79-FOny-.js"),__vite__mapDeps([112,16,1,15,17,18,19,11,20,31,32,76]))),U2=V.lazy(()=>oe(()=>import("./SettingsView-BnRQHHDW.js"),__vite__mapDeps([113,1,2,10,98,72,12,7,14,86,26,62,52,46,85]))),V2=V.lazy(()=>oe(()=>import("./PrivacyView-CwO81wLZ.js"),__vite__mapDeps([114,62]))),B2=V.lazy(()=>oe(()=>import("./ApiDocsView-D3iY1sSs.js"),__vite__mapDeps([115,1,40,116]))),q2=V.lazy(()=>oe(()=>import("./McpView-Dg_zVuuF.js"),__vite__mapDeps([117,1,62,53,37,46,43,118]))),H2=V.lazy(()=>oe(()=>import("./SubmitView-CQFDy941.js"),__vite__mapDeps([119,2,32,3,63,70,16,67]))),W2=V.lazy(()=>oe(()=>import("./CronDashboard-DZ_espzl.js"),__vite__mapDeps([120,1,2,121,122,73,3,48,71,84,87,38,83,46,123,65,124,75,28,4,9,26]))),G2=V.lazy(()=>oe(()=>import("./AutonomousOperations-BNbcighz.js"),__vite__mapDeps([125,1,2,121,122,73,3,63,87,45]))),K2=V.lazy(()=>oe(()=>import("./SubmissionsDashboard-CfJfn_Cp.js"),__vite__mapDeps([126,68,67,16,1,2,28,9,20,66,123,65,124,127]))),Q2=V.lazy(()=>oe(()=>import("./UserProfileView-CrBLP1Jk.js"),__vite__mapDeps([128,1,105,31,9]))),Y2=V.lazy(()=>oe(()=>import("./RateLimitsView-ChUFO8Hr.js"),__vite__mapDeps([129,1]))),X2=V.lazy(()=>oe(()=>import("./AstraForRoboticsView-CEJJvKPe.js"),__vite__mapDeps([130,15,16,17,18,19,11,20,57,32,31,29,30,27,1,28,62,131]))),Df=V.lazy(()=>oe(()=>import("./NotFound-BTsJlVc8.js"),[])),J2=V.lazy(()=>oe(()=>import("./SearchOverlay-BMTrmO5f.js"),__vite__mapDeps([132,16,1,19,9,56,11]))),Z2=V.lazy(()=>oe(()=>import("./StagingAccessRequestView-BV2q1V1S.js"),__vite__mapDeps([133,124]))),nk=()=>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}})]})]}),e3=new gA({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),t3=()=>{const{arxivId:t}=zE();return w.jsx(co,{to:t?`/paper/${t}`:"/papers",replace:!0})},n3=()=>{const{taskSlug:t}=zE();return w.jsx(co,{to:t?`/tasks/${t}`:"/tasks",replace:!0})},r3=({element:t})=>yo()?w.jsx(co,{to:"/",replace:!0}):w.jsx(w.Fragment,{children:t}),Lp=({element:t})=>{const{user:e,isLoading:n}=Ag(),r=an();return yo()?w.jsx(co,{to:"/",replace:!0}):n?w.jsx("div",{className:"page",children:w.jsx("div",{className:"submission-loading",children:w.jsx("span",{children:"Checking admin session..."})})}):e?e.is_admin?w.jsx(w.Fragment,{children:t}):w.jsx("div",{className:"page",children:w.jsxs("div",{className:"submission-empty submission-empty-warn",children:[w.jsx("h1",{children:"Admin access required"}),w.jsxs("p",{children:["Signed in as @",e.username,". This dashboard is limited to allowlisted admin accounts."]})]})}):w.jsx("div",{className:"page",children:w.jsxs("div",{className:"submission-empty submission-empty-warn",children:[w.jsx("h1",{children:"Sign in required"}),w.jsx("p",{children:"Sign in with an allowlisted Hugging Face admin account to view admin operations."}),w.jsx(NS,{returnTo:`${r.pathname}${r.search}`})]})})},i3=()=>{const t=a$(),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(Lp,{element:w.jsx(W2,{})})},g0=({reader:t=!1})=>{const[e,n]=V.useState(!1),{pathname:r}=an();V.useEffect(()=>{const a=l=>{(l.metaKey||l.ctrlKey)&&l.key==="k"&&(l.preventDefault(),n(!0))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[]);const i=w.jsx($D,{onOpenSearch:()=>n(!0)}),s=w.jsx(OE,{resetKey:r,children:w.jsx(V.Suspense,{fallback:w.jsx(nk,{}),children:w.jsx(kM,{})})}),o=e&&w.jsx(V.Suspense,{fallback:null,children:w.jsx(J2,{open:e,onClose:()=>n(!1)})});return t?w.jsxs("div",{className:"reader-route-shell",children:[i,w.jsx("div",{className:"reader-route-content",children:s}),o]}):w.jsxs(w.Fragment,{children:[i,w.jsx("main",{children:s}),w.jsx(FD,{}),o]})},s3=()=>(p2(),V.useLayoutEffect(()=>{var t;(t=document.getElementById("initial-discovery-footer"))==null||t.remove()},[]),w.jsxs(PM,{children:[w.jsx(ne,{path:"/request-access",element:w.jsx(V.Suspense,{fallback:w.jsx(nk,{}),children:w.jsx(Z2,{})})}),w.jsx(ne,{element:w.jsx(g0,{reader:!0}),children:w.jsx(ne,{path:"/pdf/:paperId",element:c$()?w.jsx(S2,{}):w.jsx(Df,{})})}),w.jsxs(ne,{element:w.jsx(g0,{}),children:[w.jsx(ne,{path:"/",element:w.jsx(v0,{})}),w.jsx(ne,{path:"/following",element:w.jsx(_2,{})}),w.jsx(ne,{path:"/x-trending",element:w.jsx(v0,{xTrending:!0})}),w.jsx(ne,{path:"/chat/:sessionId?",element:Va()?w.jsx(w2,{}):w.jsx(co,{to:"/",replace:!0})}),w.jsx(ne,{path:"/share/:shareId",element:Va()?w.jsx(x2,{}):w.jsx(Df,{})}),w.jsx(ne,{path:"/papers",element:w.jsx(b2,{})}),w.jsx(ne,{path:"/papers/:arxivId",element:w.jsx(t3,{})}),w.jsx(ne,{path:"/paper/:arxivId",element:w.jsx(E2,{})}),w.jsx(ne,{path:"/tasks",element:w.jsx(C2,{})}),w.jsx(ne,{path:"/tasks/:taskSlug",element:w.jsx(k2,{})}),w.jsx(ne,{path:"/task/:taskSlug",element:w.jsx(n3,{})}),w.jsx(ne,{path:"/methods",element:w.jsx(P2,{})}),w.jsx(ne,{path:"/methods/:methodSlug",element:w.jsx(j2,{})}),w.jsx(ne,{path:"/frameworks",element:w.jsx(R2,{})}),w.jsx(ne,{path:"/trends",element:w.jsx(T2,{})}),w.jsx(ne,{path:"/conferences",element:w.jsx(I2,{})}),w.jsx(ne,{path:"/ai-deadlines",element:w.jsx(O2,{})}),w.jsx(ne,{path:"/conferences/:confSlug",element:w.jsx(M2,{})}),w.jsx(ne,{path:"/conferences/:confSlug/:taskSlug",element:w.jsx(A2,{})}),w.jsx(ne,{path:"/organizations",element:w.jsx(N2,{})}),w.jsx(ne,{path:"/orgs/:orgSlug",element:w.jsx($2,{})}),w.jsx(ne,{path:"/orgs/:orgSlug/:taskSlug",element:w.jsx(F2,{})}),w.jsx(ne,{path:"/authors/:authorId",element:w.jsx(L2,{})}),w.jsx(ne,{path:"/benchmark/:datasetSlug",element:w.jsx(D2,{})}),w.jsx(ne,{path:"/authorize-paper-edit/:authorizationId",element:w.jsx(y2,{})}),w.jsx(ne,{path:"/submit",element:w.jsx(H2,{})}),w.jsx(ne,{path:"/saved",element:w.jsx(r3,{element:w.jsx(z2,{})})}),w.jsx(ne,{path:"/settings",element:w.jsx(U2,{})}),w.jsx(ne,{path:"/privacy",element:w.jsx(V2,{})}),w.jsx(ne,{path:"/docs/api",element:w.jsx(B2,{})}),w.jsx(ne,{path:"/mcp",element:w.jsx(q2,{})}),w.jsx(ne,{path:"/admin-dashboard",element:w.jsx(i3,{})}),w.jsx(ne,{path:"/autonomous-operations",element:w.jsx(Lp,{element:w.jsx(G2,{})})}),w.jsx(ne,{path:"/cron-dashboard",element:w.jsx(co,{to:"/admin-dashboard",replace:!0})}),w.jsx(ne,{path:"/submissions",element:w.jsx(Lp,{element:w.jsx(K2,{})})}),w.jsx(ne,{path:"/rate-limits",element:w.jsx(Y2,{})}),w.jsx(ne,{path:"/astra-for-robotics",element:w.jsx(X2,{})}),w.jsx(ne,{path:"/:username",element:w.jsx(Q2,{})}),w.jsx(ne,{path:"*",element:w.jsx(Df,{})})]})]})),o3=()=>w.jsx(yA,{client:e3,children:w.jsx(OD,{children:w.jsxs(g2,{children:[w.jsx(m2,{children:w.jsx(s3,{})}),w.jsx(h2,{}),!1]})})});NO();const a3=w.jsx(NR,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,storageKey:"pwc-theme",children:w.jsx(OE,{children:w.jsx(o3,{})})}),l3=Dx(document.getElementById("root"));l3.render(w.jsx(V.StrictMode,{children:a3}));export{o$ as $,cd as A,at as B,vD as C,b3 as D,R3 as E,i1 as F,R1 as G,NS as H,YL as I,mD as J,V as K,mn as L,p0 as M,c$ as N,x3 as O,gr as P,_D as Q,QL as R,wD as S,f2 as T,PC as U,Qn as V,E3 as W,yD as X,w3 as Y,C3 as Z,k0 as _,Ag as a,oe as a0,QS as a1,gD as a2,el as a3,TD as a4,Sc as a5,FS as a6,u2 as a7,Fs as a8,ZN as a9,XM as aA,h3 as aB,xp as aC,hn as aD,YE as aE,QM as aF,YM as aG,wp as aH,GE as aI,dA as aJ,eA as aK,wt as aL,v3 as aM,za as aN,hA as aO,dg as aP,O3 as aQ,M3 as aR,m3 as aS,g3 as aT,KE as aU,t1 as aV,n1 as aW,r1 as aX,s0 as aY,t$ as aa,n$ as ab,r$ as ac,oi as ad,s$ as ae,i$ as af,_3 as ag,co as ah,p3 as ai,$L as aj,FL as ak,y1 as al,Zc as am,gS as an,og as ao,aS as ap,sg as aq,Jc as ar,LL as as,jL as at,d3 as au,c3 as av,ID as aw,k3 as ax,Yc as ay,iA as az,an as b,tg as c,A3 as d,f3 as e,mA as f,Va as g,AS as h,yo as i,w as j,u$ as k,l$ as l,S3 as m,ud as n,P3 as o,VD as p,N3 as q,g as r,I3 as s,Ee as t,zE as u,Xc as v,Xe as w,J as x,RL as y,Wi as z}; diff --git a/assets/index-C8IgDsSE.js b/assets/index-DIg7XGE2.js similarity index 72% rename from assets/index-C8IgDsSE.js rename to assets/index-DIg7XGE2.js index 5f0951d8447f0d8c5b7e2eaaf189ea42c57cbfb8..512d5ccd59340e3f1c6ca391dd4106adbb4f8a29 100644 --- a/assets/index-C8IgDsSE.js +++ b/assets/index-DIg7XGE2.js @@ -1 +1 @@ -import{r as u}from"./index-CqKcHUvZ.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}; +import{r as u}from"./index-D6jcIRWs.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-cqXA1kVH.css b/assets/index-cqXA1kVH.css new file mode 100644 index 0000000000000000000000000000000000000000..225fbeaef5e1034fdb79ed9b1e9471c832471d98 --- /dev/null +++ b/assets/index-cqXA1kVH.css @@ -0,0 +1 @@ +@import"https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;0,6..72,700;1,6..72,400&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap";*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 0 0% 100%;--foreground: 222.2 84% 4.9%;--card: 0 0% 100%;--card-foreground: 222.2 84% 4.9%;--popover: 0 0% 100%;--popover-foreground: 222.2 84% 4.9%;--primary: 222.2 47.4% 11.2%;--primary-foreground: 210 40% 98%;--secondary: 210 40% 96.1%;--secondary-foreground: 222.2 47.4% 11.2%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 46.9%;--accent-tw: 210 40% 96.1%;--accent-foreground: 222.2 47.4% 11.2%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 210 40% 98%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--ring: 222.2 84% 4.9%;--radius: .5rem}.dark{--background: 36 13% 7%;--foreground: 40 27% 93%;--card: 36 12% 10%;--card-foreground: 40 27% 93%;--popover: 36 12% 10%;--popover-foreground: 40 27% 93%;--primary: 40 27% 93%;--primary-foreground: 36 13% 7%;--secondary: 34 11% 15%;--secondary-foreground: 40 27% 93%;--muted: 34 11% 15%;--muted-foreground: 36 10% 64%;--accent-tw: 216 22% 20%;--accent-foreground: 213 38% 79%;--destructive: 0 63% 42%;--destructive-foreground: 40 27% 93%;--border: 35 11% 20%;--input: 35 11% 20%;--ring: 213 38% 67%}[data-shadcn] *{border-color:hsl(var(--border))}.\!container{width:100%!important;margin-right:auto!important;margin-left:auto!important;padding-right:2rem!important;padding-left:2rem!important}.container{width:100%;margin-right:auto;margin-left:auto;padding-right:2rem;padding-left:2rem}@media (min-width: 1400px){.\!container{max-width:1400px!important}.container{max-width:1400px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.\!visible{visibility:visible!important}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.left-2{left:.5rem}.left-3{left:.75rem}.left-\[50\%\]{left:50%}.right-2{right:.5rem}.right-4{right:1rem}.top-0{top:0}.top-1\/2{top:50%}.top-2{top:.5rem}.top-3{top:.75rem}.top-4{top:1rem}.top-\[50\%\]{top:50%}.z-50{z-index:50}.z-\[100\]{z-index:100}.z-\[60\]{z-index:60}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.-mx-6{margin-left:-1.5rem;margin-right:-1.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-3{margin-left:.75rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mr-4{margin-right:1rem}.mr-auto{margin-right:auto}.mt-1{margin-top:.25rem}.mt-10{margin-top:2.5rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.line-clamp-3{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3}.\!block{display:block!important}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.\!table{display:table!important}.table{display:table}.grid{display:grid}.contents{display:contents}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-32{height:8rem}.h-36{height:9rem}.h-4{height:1rem}.h-40{height:10rem}.h-44{height:11rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[18px\]{height:18px}.h-\[190px\]{height:190px}.h-\[220px\]{height:220px}.h-\[38px\]{height:38px}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.max-h-32{max-height:8rem}.max-h-40{max-height:10rem}.max-h-48{max-height:12rem}.max-h-52{max-height:13rem}.max-h-64{max-height:16rem}.max-h-80{max-height:20rem}.max-h-\[300px\]{max-height:300px}.max-h-\[350px\]{max-height:350px}.max-h-\[400px\]{max-height:400px}.max-h-\[460px\]{max-height:460px}.max-h-\[50vh\]{max-height:50vh}.max-h-\[600px\]{max-height:600px}.max-h-\[700px\]{max-height:700px}.max-h-\[800px\]{max-height:800px}.max-h-\[90vh\]{max-height:90vh}.max-h-\[min\(300px\,calc\(var\(--radix-popover-content-available-height\)-2\.75rem\)\)\]{max-height:min(300px,calc(var(--radix-popover-content-available-height) - 2.75rem))}.max-h-\[var\(--radix-popover-content-available-height\)\]{max-height:var(--radix-popover-content-available-height)}.max-h-screen{max-height:100vh}.min-h-0{min-height:0px}.min-h-\[80px\]{min-height:80px}.w-1\/2{width:50%}.w-1\/3{width:33.333333%}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-36{width:9rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-72{width:18rem}.w-8{width:2rem}.w-\[160px\]{width:160px}.w-\[18px\]{width:18px}.w-\[calc\(100vw-2rem\)\]{width:calc(100vw - 2rem)}.w-\[var\(--radix-popover-trigger-width\)\]{width:var(--radix-popover-trigger-width)}.w-auto{width:auto}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[140px\]{min-width:140px}.min-w-\[180px\]{min-width:180px}.min-w-\[200px\]{min-width:200px}.min-w-\[240px\]{min-width:240px}.min-w-\[260px\]{min-width:260px}.min-w-\[8rem\]{min-width:8rem}.max-w-2xl{max-width:42rem}.max-w-6xl{max-width:72rem}.max-w-7xl{max-width:80rem}.max-w-\[260px\]{max-width:260px}.max-w-\[280px\]{max-width:280px}.max-w-\[360px\]{max-width:360px}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-xl{max-width:36rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-rows-\[auto_minmax\(0\,1fr\)_auto\]{grid-template-rows:auto minmax(0,1fr) auto}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-y-1{row-gap:.25rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.justify-self-end{justify-self:end}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overscroll-contain{overscroll-behavior:contain}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.\!border{border-width:1px!important}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.\!border-black{--tw-border-opacity: 1 !important;border-color:rgb(0 0 0 / var(--tw-border-opacity, 1))!important}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-amber-500{--tw-border-opacity: 1;border-color:rgb(245 158 11 / var(--tw-border-opacity, 1))}.border-border{border-color:hsl(var(--border))}.border-destructive{border-color:hsl(var(--destructive))}.border-destructive\/40{border-color:hsl(var(--destructive) / .4)}.border-destructive\/50{border-color:hsl(var(--destructive) / .5)}.border-input{border-color:hsl(var(--input))}.border-primary{border-color:hsl(var(--primary))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.bg-accent{background-color:hsl(var(--accent-tw))}.bg-amber-100{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-background{background-color:hsl(var(--background))}.bg-background\/80{background-color:hsl(var(--background) / .8)}.bg-black\/80{background-color:#000c}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-destructive\/10{background-color:hsl(var(--destructive) / .1)}.bg-muted{background-color:hsl(var(--muted))}.bg-muted\/30{background-color:hsl(var(--muted) / .3)}.bg-muted\/40{background-color:hsl(var(--muted) / .4)}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-red-50\/50{background-color:#fef2f280}.bg-secondary{background-color:hsl(var(--secondary))}.bg-transparent{background-color:transparent}.fill-current{fill:currentColor}.object-contain{-o-object-fit:contain;object-fit:contain}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-2{padding-bottom:.5rem}.pl-4{padding-left:1rem}.pl-5{padding-left:1.25rem}.pl-8{padding-left:2rem}.pl-9{padding-left:2.25rem}.pr-16{padding-right:4rem}.pr-2{padding-right:.5rem}.pr-9{padding-right:2.25rem}.pt-0{padding-top:0}.pt-2{padding-top:.5rem}.pt-6{padding-top:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.align-top{vertical-align:top}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[10px\]{font-size:10px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-widest{letter-spacing:.1em}.text-amber-900{--tw-text-opacity: 1;color:rgb(120 53 15 / var(--tw-text-opacity, 1))}.text-blue-900{--tw-text-opacity: 1;color:rgb(30 58 138 / var(--tw-text-opacity, 1))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-current{color:currentColor}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-30{opacity:.3}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-90{opacity:.9}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.drop-shadow{--tw-drop-shadow: drop-shadow(0 1px 2px rgb(0 0 0 / .1)) drop-shadow(0 1px 1px rgb(0 0 0 / .06));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.duration-200{animation-duration:.2s}.\!running{animation-play-state:running!important}.running{animation-play-state:running}.paused{animation-play-state:paused}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.file\:text-foreground::file-selector-button{color:hsl(var(--foreground))}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.last\:mb-0:last-child{margin-bottom:0}.hover\:border-foreground\/50:hover{border-color:hsl(var(--foreground) / .5)}.hover\:bg-accent:hover{background-color:hsl(var(--accent-tw))}.hover\:bg-destructive\/80:hover{background-color:hsl(var(--destructive) / .8)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-muted:hover{background-color:hsl(var(--muted))}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary:hover{background-color:hsl(var(--secondary))}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-destructive:hover{color:hsl(var(--destructive))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.focus\:bg-accent:focus{background-color:hsl(var(--accent-tw))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group.destructive .group-\[\.destructive\]\:border-muted\/40{border-color:hsl(var(--muted) / .4)}.group.destructive .group-\[\.destructive\]\:text-destructive-foreground{color:hsl(var(--destructive-foreground))}.group.destructive .group-\[\.destructive\]\:hover\:border-destructive\/30:hover{border-color:hsl(var(--destructive) / .3)}.group.destructive .group-\[\.destructive\]\:hover\:bg-destructive:hover{background-color:hsl(var(--destructive))}.group.destructive .group-\[\.destructive\]\:hover\:bg-destructive-foreground\/10:hover{background-color:hsl(var(--destructive-foreground) / .1)}.group.destructive .group-\[\.destructive\]\:hover\:text-destructive-foreground:hover{color:hsl(var(--destructive-foreground))}.group.destructive .group-\[\.destructive\]\:focus\:ring-destructive:focus{--tw-ring-color: hsl(var(--destructive))}.group.destructive .group-\[\.destructive\]\:focus\:ring-destructive-foreground:focus{--tw-ring-color: hsl(var(--destructive-foreground))}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true],.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[state\=checked\]\:translate-x-5[data-state=checked]{--tw-translate-x: 1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked],.data-\[swipe\=cancel\]\:translate-x-0[data-swipe=cancel]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=end\]\:translate-x-\[var\(--radix-toast-swipe-end-x\)\][data-swipe=end]{--tw-translate-x: var(--radix-toast-swipe-end-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=move\]\:translate-x-\[var\(--radix-toast-swipe-move-x\)\][data-swipe=move]{--tw-translate-x: var(--radix-toast-swipe-move-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[selected\=\'true\'\]\:bg-accent[data-selected=true]{background-color:hsl(var(--accent-tw))}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\[state\=checked\]\:\!bg-black[data-state=checked]{--tw-bg-opacity: 1 !important;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))!important}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent-tw))}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:hsl(var(--accent-foreground))}.data-\[state\=active\]\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\[state\=checked\]\:\!text-white[data-state=checked]{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity, 1))!important}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\=true\]\:opacity-50[data-disabled=true],.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[swipe\=move\]\:transition-none[data-swipe=move]{transition-property:none}.data-\[state\=open\]\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[state\=closed\]\:animate-out[data-state=closed],.data-\[swipe\=end\]\:animate-out[data-swipe=end]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=closed\]\:fade-out-80[data-state=closed]{--tw-exit-opacity: .8}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\[state\=closed\]\:slide-out-to-right-full[data-state=closed]{--tw-exit-translate-x: 100%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-top-full[data-state=open]{--tw-enter-translate-y: -100%}.dark\:block:is(.dark *){display:block}.dark\:hidden:is(.dark *){display:none}.dark\:border-amber-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(120 53 15 / var(--tw-border-opacity, 1))}.dark\:border-destructive:is(.dark *){border-color:hsl(var(--destructive))}.dark\:bg-amber-950\/40:is(.dark *){background-color:#451a0366}.dark\:text-amber-100:is(.dark *){--tw-text-opacity: 1;color:rgb(254 243 199 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.sm\:bottom-0{bottom:0}.sm\:right-0{right:0}.sm\:top-auto{top:auto}.sm\:mr-auto{margin-right:auto}.sm\:w-auto{width:auto}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:flex-col{flex-direction:column}.sm\:justify-end{justify-content:flex-end}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:text-left{text-align:left}.data-\[state\=open\]\:sm\:slide-in-from-bottom-full[data-state=open]{--tw-enter-translate-y: 100%}}@media (min-width: 768px){.md\:col-span-2{grid-column:span 2 / span 2}.md\:max-w-\[420px\]{max-width:420px}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-\[1fr_1fr_auto\]{grid-template-columns:1fr 1fr auto}.md\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width: 1024px){.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.lg\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.lg\:px-8{padding-left:2rem;padding-right:2rem}}@media (min-width: 1280px){.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y: -3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:left-4>svg{left:1rem}.\[\&\>svg\]\:top-4>svg{top:1rem}.\[\&\>svg\]\:text-destructive>svg{color:hsl(var(--destructive))}.\[\&\>svg\]\:text-foreground>svg{color:hsl(var(--foreground))}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:1.75rem}.\[\&\>tr\]\:last\:border-b-0:last-child>tr{border-bottom-width:0px}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-top:.375rem;padding-bottom:.375rem}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{font-weight:500}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:hsl(var(--muted-foreground))}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:3rem}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-top:.75rem;padding-bottom:.75rem}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:1.25rem}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:1.25rem}.\[\&_p\]\:leading-relaxed p{line-height:1.625}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0px}.\[\&_tr\]\:border-b tr{border-bottom-width:1px}:root{--bg: #FAF8F4;--bg-elevated: #FFFFFF;--bg-subtle: #F2EFE8;--ink: #1A1814;--ink-soft: #5A554C;--ink-faint: #8E8678;--hairline: #E4DFD4;--hairline-strong: #C8C2B3;--accent: oklch(.45 .08 250);--accent-soft: oklch(.92 .03 250);--accent-text: oklch(.35 .1 250);--warn: oklch(.55 .12 30);--positive-bg: oklch(.96 .03 145);--positive-text: oklch(.34 .1 145);--positive-border: oklch(.86 .06 145);--negative-bg: oklch(.96 .03 25);--negative-text: oklch(.4 .12 25);--negative-border: oklch(.86 .06 25);--highlight-bg: oklch(.97 .04 70);--highlight-text: oklch(.42 .1 60);--highlight-border: oklch(.85 .07 70);--info-bg: oklch(.97 .04 230);--info-text: oklch(.42 .1 240);--info-border: oklch(.86 .07 230);--trend-code: #33639E;--trend-hf: #AA7D24;--app-leading-column-width: 280px;--serif: "Newsreader", Georgia, serif;--sans: "Inter", -apple-system, sans-serif;--mono: "JetBrains Mono", ui-monospace, monospace;color-scheme:light}.dark{--bg: #11100E;--bg-elevated: #1A1815;--bg-subtle: #24211D;--ink: #F3EFE7;--ink-soft: #B9B2A6;--ink-faint: #989084;--hairline: #332F29;--hairline-strong: #514A40;--accent: oklch(.72 .09 250);--accent-soft: oklch(.28 .04 250);--accent-text: oklch(.8 .08 250);--warn: oklch(.72 .12 30);--positive-bg: oklch(.25 .035 145);--positive-text: oklch(.79 .1 145);--positive-border: oklch(.43 .06 145);--negative-bg: oklch(.25 .04 25);--negative-text: oklch(.79 .1 25);--negative-border: oklch(.43 .06 25);--highlight-bg: oklch(.27 .04 70);--highlight-text: oklch(.82 .1 70);--highlight-border: oklch(.46 .07 70);--info-bg: oklch(.25 .04 230);--info-text: oklch(.8 .08 235);--info-border: oklch(.43 .07 230);--trend-code: #5C8FD6;--trend-hf: #B3831F;color-scheme:dark}*{box-sizing:border-box;margin:0;padding:0}html,body{background:var(--bg);color:var(--ink);font-family:var(--sans);font-size:14px;line-height:1.5;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}a{color:inherit;text-decoration:none}button{font-family:inherit;cursor:pointer;border:none;background:none;color:inherit}.app-header{border-bottom:1px solid var(--hairline);background:var(--bg);position:sticky;top:0;z-index:50}.app-header-inner{max-width:calc(50vw + 640px);margin:0 auto;padding:14px 32px;display:flex;align-items:center;gap:8px;min-width:0}.site-announcement{position:relative;min-height:28px;padding:5px 52px 6px;border-top:1px solid var(--hairline);background:var(--bg-subtle);color:var(--ink-soft);font-size:12px;line-height:16px;text-align:center}.site-announcement a{color:var(--accent-text);font-weight:600;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}.site-announcement a:hover{color:var(--ink)}.site-announcement-close{position:absolute;top:50%;right:20px;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:0;border-radius:4px;background:transparent;color:var(--ink-soft);cursor:pointer;transform:translateY(-50%)}.site-announcement-close:hover{background:var(--hairline);color:var(--ink)}.site-announcement-close:focus-visible{outline:2px solid var(--accent-text);outline-offset:1px}.brand{display:flex;align-items:baseline;gap:10px;font-family:var(--serif);cursor:pointer}.brand-mark{width:22px;height:22px;background:var(--ink);position:relative;align-self:center;flex-shrink:0}.brand-mark:after{content:"";position:absolute;top:4px;left:4px;right:4px;bottom:4px;background:var(--bg)}.brand-mark:before{content:"";position:absolute;top:8px;left:8px;width:6px;height:6px;background:var(--ink);z-index:1}.brand-name{font-size:20px;font-weight:600;letter-spacing:-.02em;white-space:nowrap}.brand-name em{font-style:italic;font-weight:400;color:var(--ink-soft)}.nav{display:flex;gap:24px;margin-left:8px;flex-shrink:0;position:relative}@media (min-width: 901px){.app-header-inner{max-width:none;padding-left:0}.brand{width:var(--app-leading-column-width);flex:none;justify-content:center}.nav{margin-left:0}}.nav{margin-right:16px}@media (max-width: 1440px){.nav-item:nth-last-child(-n+3){display:none}}@media (max-width: 1200px){.nav{gap:18px}.nav-item:nth-child(n+4){display:none}}@media (max-width: 920px){.search-trigger kbd{display:none}}.nav-item{font-size:13px;color:var(--ink-soft);padding:4px 0;transition:color .15s}.nav-indicator{position:absolute;bottom:0;left:0;height:1px;background:var(--ink);pointer-events:none;will-change:transform,width}.nav-indicator-ready{transition:transform .22s cubic-bezier(.4,0,.2,1),width .22s cubic-bezier(.4,0,.2,1),opacity .12s ease}.nav-item-with-badge{display:inline-flex;align-items:center;gap:5px}.nav-new-badge{display:inline-flex;align-items:center;min-height:17px;padding:1px 5px;border-radius:5px;background:#dfe7ff;color:#1458e8;font-size:9px;font-weight:700;line-height:1;letter-spacing:.02em;text-transform:uppercase}.nav-item:hover,.nav-item.active{color:var(--ink)}@media (prefers-reduced-motion: reduce){.nav-indicator-ready{transition:none}}.header-spacer{flex:1}.search-trigger{display:flex;align-items:center;gap:8px;height:32px;margin-right:4px;padding:0 6px 0 11px;border:1px solid var(--hairline);border-radius:8px;background:var(--bg-elevated);font-size:13px;color:var(--ink-faint);width:260px;min-width:32px;flex-shrink:1;transition:border-color .15s,box-shadow .15s;overflow:hidden;container-type:inline-size}@container (max-width: 160px){.search-trigger kbd{display:none}}@container (max-width: 80px){.search-trigger>:not(svg){display:none}.search-trigger>svg{margin-inline:auto;translate:-2.5px 0}}.search-trigger>span:not(:first-child){white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}.search-trigger:hover{border-color:var(--hairline-strong);box-shadow:0 1px 2px #1a18140f}.search-trigger kbd{flex:none;margin-left:auto;font-family:var(--mono);font-size:10.5px;white-space:nowrap;line-height:18px;padding:0 5px;border:1px solid var(--hairline);border-radius:4px;background:var(--bg-subtle);color:var(--ink-faint)}.icon-btn{width:32px;height:32px;display:flex;align-items:center;justify-content:center;border:1px solid var(--hairline);border-radius:6px;background:var(--bg-elevated);transition:border-color .15s}.icon-btn:hover{border-color:var(--hairline-strong)}.app-header .icon-btn,.app-header .header-feedback-link{flex:none;border-color:transparent;background:transparent;color:var(--ink-soft);transition:background .15s,color .15s}.app-header .icon-btn:hover,.app-header .header-feedback-link:hover,.app-header .icon-btn.active{border-color:transparent;background:var(--bg-subtle);color:var(--ink)}.app-header .header-feedback-link{padding:0 10px}.hf-signin-btn{display:inline-flex;align-items:center;gap:8px;max-width:100%;min-height:32px;padding:5px 12px;border:1px solid var(--hairline);border-radius:6px;background:var(--bg-elevated);font-size:13px;color:var(--ink);line-height:20px;white-space:normal;overflow-wrap:anywhere;transition:border-color .15s,background .15s}.hf-signin-btn>img{flex-shrink:0}.app-header .hf-signin-btn{flex-shrink:0;white-space:nowrap;overflow-wrap:normal}.hf-signin-btn:hover{border-color:var(--hairline-strong);background:var(--bg-subtle)}.user-avatar-btn{display:inline-flex;flex:none;align-items:center;justify-content:center;width:32px;height:32px;border:1px solid var(--hairline);border-radius:999px;background:var(--bg-elevated);padding:0;overflow:hidden;transition:border-color .15s}.user-avatar-btn:hover{border-color:var(--hairline-strong)}.user-avatar-btn:focus-visible{outline:2px solid var(--hairline-strong);outline-offset:2px}.page{max-width:calc(50vw + 640px);margin:0 auto;padding:32px}.site-footer{border-top:1px solid var(--hairline);color:var(--ink-faint);font-size:12px}.site-footer-inner{display:flex;flex-wrap:wrap;gap:14px;max-width:calc(50vw + 640px);margin:0 auto;padding:20px 32px 28px}.site-footer a{color:var(--ink-soft)}.site-footer a:hover{color:var(--ink)}.layout-with-sidebar{display:grid;grid-template-columns:220px 1fr;gap:48px;align-items:start}.sidebar{position:sticky;top:100px}.sidebar-section{margin-bottom:28px}.sidebar-label{font-family:var(--mono);font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-faint);margin-bottom:12px}.sidebar-link{display:block;font-size:13px;color:var(--ink-soft);padding:5px 0;border-bottom:1px dotted transparent;transition:color .15s}.sidebar-link:hover{color:var(--ink)}.sidebar-link.active{color:var(--ink);font-weight:500}.sidebar-link .count{font-family:var(--mono);font-size:11px;color:var(--ink-faint);margin-left:6px}.sidebar-link-more{margin-top:8px;font-style:italic}.breadcrumb{display:flex;align-items:center;gap:8px;font-family:var(--mono);font-size:11px;color:var(--ink-faint);margin-bottom:24px}.breadcrumb a{color:var(--ink-soft)}.breadcrumb a:hover{color:var(--ink)}.breadcrumb .sep{color:var(--hairline-strong)}.breadcrumb a.breadcrumb-external{display:inline-flex;gap:3px;color:var(--accent-text);text-decoration:underline;text-decoration-color:color-mix(in srgb,var(--accent-text) 40%,transparent);text-underline-offset:3px}.breadcrumb a.breadcrumb-external:hover{text-decoration-color:currentColor}.detail-title{font-family:var(--serif);font-size:38px;font-weight:500;line-height:1.15;letter-spacing:-.02em;margin-bottom:16px;text-wrap:balance}.detail-title-org{display:inline-block;max-width:24ch;overflow:hidden;margin-left:.6em;font-family:var(--mono);font-size:13px;line-height:1.4;letter-spacing:0;color:var(--accent-text);text-overflow:ellipsis;white-space:nowrap;vertical-align:.3em}.detail-title-org--logo{display:inline-flex;align-items:center;justify-content:center;max-width:none;margin-left:.3em;font-size:inherit;width:.8em;height:.8em;border-radius:4px;overflow:hidden;vertical-align:-.05em}.detail-title-org--logo img{width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.detail-title-tail{white-space:nowrap}.detail-title-edit{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;margin-left:.2em;padding:0;border:0;border-radius:50%;background:transparent;color:var(--ink-faint);vertical-align:baseline;cursor:pointer;transition:color .15s}.detail-title-edit:hover{color:var(--ink)}.detail-title-org--logo+.detail-title-edit{position:relative;width:.42em;height:.42em;margin-left:-.24em;vertical-align:-.1em;border:1px solid var(--hairline);background:var(--bg-elevated)}.detail-title-org--logo+.detail-title-edit .icon-sm{width:65%;height:65%}.action-btn{display:inline-flex;align-items:center;gap:6px;padding:7px 12px;border:1px solid var(--hairline);border-radius:6px;background:var(--bg-elevated);font-size:12px;font-weight:500;color:var(--ink);transition:all .15s}.action-btn:hover{border-color:var(--ink)}.action-btn.primary{background:var(--ink);color:var(--bg);border-color:var(--ink)}.action-btn.primary:hover{background:color-mix(in oklch,var(--ink) 88%,var(--accent))}.no-results{padding:80px 0;text-align:center;font-family:var(--serif);color:var(--ink-faint);font-style:italic}.icon{width:14px;height:14px;flex-shrink:0}.icon-sm{width:11px;height:11px;flex-shrink:0}html{scroll-behavior:smooth}::-moz-selection{background:var(--accent-soft);color:var(--accent-text)}::selection{background:var(--accent-soft);color:var(--accent-text)}.mobile-menu-btn,.mobile-search-btn{display:none;width:36px;height:36px;align-items:center;justify-content:center;border-radius:4px;flex-shrink:0}.mobile-menu-btn:hover,.mobile-search-btn:hover{background:var(--bg-subtle)}.mobile-nav-drawer{position:fixed;top:0;right:0;bottom:0;left:0;background:#1a181466;z-index:100;display:flex;justify-content:flex-end}.mobile-nav-panel{width:min(320px,80vw);background:var(--bg-elevated);border-left:1px solid var(--hairline-strong);padding:16px 24px max(32px,env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:4px;height:100%;min-height:0;overscroll-behavior-y:contain;overflow-y:auto;box-shadow:-8px 0 24px #0000000f}.mobile-nav-close{align-self:flex-end;min-width:44px;min-height:44px}.mobile-nav-link{flex-shrink:0;font-family:var(--serif);font-size:17px;padding:12px 4px;color:var(--ink);border-bottom:1px solid var(--hairline)}.mobile-nav-link-with-badge{display:flex;align-items:center;gap:6px}.mobile-nav-link.active{color:var(--accent-text);font-style:italic}.mobile-nav-search{display:flex;align-items:center;gap:10px;width:100%;font-family:var(--sans);font-size:14px;color:var(--ink-faint);background:var(--bg-subtle);border:1px solid var(--hairline);border-radius:6px;padding:10px 12px;margin-bottom:8px;text-align:left}.mobile-nav-search:hover{border-color:var(--hairline-strong);color:var(--ink)}@media (max-width: 980px){.nav,.search-trigger,.app-header .header-feedback-link{display:none}.mobile-menu-btn,.mobile-search-btn{display:inline-flex}}@media (max-width: 640px){.app-header-inner,.brand{gap:8px}.brand-mark{width:20px;height:20px}.brand-name{font-size:18px}.header-bookmark-btn,.header-github-btn{display:none}.app-header .hf-signin-btn{width:36px;height:36px;padding:0;gap:0;justify-content:center;flex-shrink:0}.app-header .hf-signin-btn>span{display:none}}@media (max-width: 880px){.app-header-inner{padding:14px 16px;gap:12px}.page{padding:24px 16px}.layout-with-sidebar{grid-template-columns:minmax(0,1fr);gap:24px}.layout-with-sidebar .sidebar{position:static;top:auto}.layout-with-sidebar .sidebar-section{min-width:0;margin-bottom:0}.layout-with-sidebar .sidebar-links{display:flex;gap:8px;margin:0 -16px;padding:0 16px 2px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none}.layout-with-sidebar .sidebar-links::-webkit-scrollbar{display:none}.layout-with-sidebar .sidebar-links .sidebar-link{flex:0 0 auto;margin:0;padding:6px 12px;border:1px solid var(--hairline);border-radius:999px;background:var(--bg-elevated);white-space:nowrap}.detail-title{font-size:28px}}@media (max-width: 640px){.app-header-inner{padding:12px 14px;gap:8px}.page{padding:20px 14px}.layout-with-sidebar .sidebar-links{margin:0 -14px;padding:0 14px 2px}.detail-title{font-size:24px}.brand-name{font-size:17px}}.access-request-page{min-height:100vh;min-height:100svh;display:grid;place-items:center;padding:32px 20px;background:radial-gradient(circle at 50% 8%,color-mix(in srgb,var(--accent-soft) 60%,transparent),transparent 42%),var(--bg)}.access-request-card{width:min(100%,470px);padding:38px;border:1px solid var(--hairline);border-radius:12px;background:color-mix(in srgb,var(--bg-elevated) 94%,transparent);box-shadow:0 20px 60px #1a181414}.access-request-brand{display:inline-flex;align-items:center;gap:10px;margin-bottom:42px;font-family:var(--serif)}.access-request-heading h1,.access-request-success h1{margin-bottom:12px;font-family:var(--serif);font-size:clamp(36px,8vw,48px);font-weight:500;line-height:1;letter-spacing:-.035em}.access-request-heading>p:last-child,.access-request-success p,.access-request-signin>p{color:var(--ink-soft);font-size:15px;line-height:1.65}.access-request-eyebrow{margin-bottom:10px;color:var(--accent-text);font-size:11px;font-weight:700;letter-spacing:.12em;text-transform:uppercase}.access-request-form,.access-request-signin{margin-top:30px}.access-request-form label{display:block;margin-bottom:8px;font-size:12px;font-weight:600}.access-request-input-wrap{display:flex;align-items:center;border:1px solid var(--hairline-strong);border-radius:7px;background:var(--bg);color:var(--ink-faint);transition:border-color .15s,box-shadow .15s}.access-request-input-wrap:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}.access-request-input-wrap>span{padding-left:13px;font-size:15px}.access-request-input-wrap input{width:100%;padding:11px 13px 11px 3px;border:0;outline:0;background:transparent;color:var(--ink);font:500 14px var(--sans)}.access-request-verified{margin-top:7px;color:var(--ink-faint);font-size:11px}.access-request-submit{width:100%;margin-top:20px;padding:12px 18px;border-radius:7px;background:var(--ink);color:var(--bg);font-size:13px;font-weight:600;transition:opacity .15s,transform .15s}.access-request-submit:hover:not(:disabled){transform:translateY(-1px)}.access-request-submit:disabled{cursor:wait;opacity:.6}.access-request-error{margin-top:12px;color:var(--negative-text);font-size:12px}.access-request-status{margin-top:30px;color:var(--ink-soft)}.access-request-signin .hf-signin-btn{margin-top:18px}.access-request-success svg{margin-bottom:24px;color:var(--positive-text)}@media (max-width: 520px){.access-request-card{padding:28px 24px}.access-request-brand{margin-bottom:34px}}.legal-page{max-width:880px;padding-bottom:72px;color:var(--ink-soft);font-family:var(--sans);font-size:15px;line-height:1.7}.legal-header{margin-bottom:34px;padding-bottom:24px;border-bottom:1px solid var(--hairline)}.legal-kicker{margin:0 0 6px;color:var(--accent-text);font-size:11px;font-weight:700;letter-spacing:.1em;text-transform:uppercase}.legal-header h1{margin:0;color:var(--ink);font-family:var(--serif);font-size:clamp(38px,6vw,56px);font-weight:500;letter-spacing:-.025em;line-height:1.05}.legal-effective-date{margin:12px 0 0;color:var(--ink-faint)}.legal-page section{margin-top:34px}.legal-page h2{margin:0 0 10px;color:var(--ink);font-family:var(--serif);font-size:25px;font-weight:600;line-height:1.25}.legal-page h3{margin:22px 0 6px;color:var(--ink);font-size:15px;font-weight:700}.legal-page p{margin:0 0 14px}.legal-page ul{margin:8px 0 16px;padding-left:22px}.legal-page li{margin:7px 0}.legal-page a{color:var(--accent-text);text-decoration:underline}.legal-page strong{color:var(--ink)}.feed-header{display:flex;align-items:flex-end;justify-content:space-between;margin-bottom:32px;gap:24px;flex-wrap:wrap}.feed-title{font-family:var(--serif);font-size:44px;font-weight:500;letter-spacing:-.025em;line-height:1}.feed-title em{font-style:italic;font-weight:400;color:var(--accent)}.feed-subtitle{font-size:13px;color:var(--ink-soft);margin-top:8px;font-family:var(--serif);font-style:italic}.conference-deadlines-link{font-size:16px;color:var(--ink-soft);margin-top:12px}.trend-chart{margin:0;width:100%}.trend-chart-visual{position:relative;min-width:0}.trend-chart-table{margin-top:10px}.feedback-link{display:inline-flex;align-items:center;height:32px;padding:0 12px;border:1px solid var(--hairline);border-radius:6px;background:var(--bg-elevated);color:var(--ink-soft);font-size:13px;font-weight:500;white-space:nowrap;transition:border-color .15s,color .15s,background .15s}.feedback-link:hover{border-color:var(--hairline-strong);background:var(--bg-subtle);color:var(--ink)}.period-switch{display:flex;align-items:center;gap:2px;background:var(--bg-elevated);border:1px solid var(--hairline);border-radius:6px;padding:3px}.period-btn{padding:5px 12px;font-size:12px;font-weight:500;color:var(--ink-soft);border-radius:4px;transition:all .15s}.period-btn.active{background:var(--ink);color:var(--bg)}.period-btn:not(.active):hover{background:var(--bg-subtle);color:var(--ink)}.date-nav{display:flex;align-items:center;gap:12px;font-family:var(--mono);font-size:12px;color:var(--ink-soft)}.date-nav button{width:26px;height:26px;border:1px solid var(--hairline);border-radius:4px;display:flex;align-items:center;justify-content:center;background:var(--bg-elevated)}.date-nav button:hover{background:var(--bg-subtle)}.paper-list{display:flex;flex-direction:column}.paper-card{display:grid;grid-template-columns:170px 1fr;gap:28px;padding:24px 0;border-bottom:1px solid var(--hairline);align-items:stretch}.paper-thumb-wrap{transition:transform .15s;display:flex;align-items:flex-end;justify-content:flex-start}.paper-thumb-wrap:hover{transform:translateY(-2px)}.paper-thumb-skeleton{width:160px;height:220px}.paper-card:first-child{padding-top:0}.paper-rank{font-family:var(--serif);font-size:32px;font-weight:500;color:var(--ink-faint);font-feature-settings:"tnum";line-height:.9;font-style:italic}.paper-body{min-width:0;display:flex;align-items:stretch;gap:28px}.paper-body-main{min-width:0;flex:1}.paper-resources{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:18px;flex:0 0 auto;width:92px;border-left:1px solid var(--hairline);padding-left:20px}.paper-resource{display:flex;flex-direction:column;align-items:center;gap:4px;color:inherit}a.paper-resource.is-link{text-decoration:none;cursor:pointer;border-radius:4px;transition:transform .15s}a.paper-resource.is-link:hover{transform:translateY(-1px)}a.paper-resource.is-link:hover .resource-value{text-decoration:underline;text-underline-offset:2px}a.paper-resource.is-link:focus-visible{outline:2px solid var(--ink);outline-offset:2px}.paper-resource .resource-stat{display:flex;flex-direction:column;align-items:center;gap:2px}.paper-resource .resource-value{display:inline-flex;align-items:center;gap:3px;font-family:var(--mono);font-size:14px;color:var(--ink);font-weight:500;font-variant-numeric:tabular-nums;letter-spacing:-.01em}.paper-resource .resource-label{font-family:var(--mono);font-size:10px;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-faint)}.paper-resource .gh-rate-arrow{color:var(--accent-text);font-size:13px;transform:translateY(-.5px)}.paper-meta-line{display:flex;align-items:center;gap:12px;font-family:var(--mono);font-size:11px;color:var(--ink-faint);margin-bottom:6px}.paper-meta-line .sep{color:var(--hairline-strong)}.paper-follow-reason{font-size:12px;color:var(--ink-faint);margin-bottom:4px}.paper-title{font-family:var(--serif);font-size:22px;font-weight:500;line-height:1.2;letter-spacing:-.015em;margin-bottom:6px;color:var(--ink);cursor:pointer;text-wrap:pretty}.paper-title:hover{color:var(--accent-text)}.paper-organization-logos{display:inline-flex;align-items:center;gap:4px;margin-left:7px;vertical-align:-4px}.paper-organization-logo{display:inline-grid;width:24px;height:24px;flex:0 0 24px;place-items:center;overflow:hidden;border:1px solid var(--hairline);border-radius:4px;background:var(--bg)}.paper-organization-logo:hover{border-color:var(--hairline-strong)}.paper-organization-logo img{width:100%;height:100%;padding:2px;-o-object-fit:contain;object-fit:contain}.paper-authors{font-size:13px;color:var(--ink-soft);margin-bottom:10px;font-family:var(--serif)}.paper-card-author-avatar{width:16px;height:16px;margin-right:4px;vertical-align:-3px}.paper-authors a{color:inherit;text-decoration:none}.paper-authors a:hover{color:var(--accent-text);text-decoration:underline;text-underline-offset:2px}.paper-abstract{font-size:13.5px;color:var(--ink-soft);line-height:1.55;max-height:4.65em;margin-bottom:12px;font-family:var(--serif);text-wrap:pretty;display:-webkit-box;line-clamp:3;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.paper-title mark,.paper-abstract mark{background:color-mix(in srgb,var(--accent) 24%,transparent);color:inherit;border-radius:2px;padding:0 1px}.search-results-end{padding:24px 0;text-align:center;color:var(--ink-faint);font:11px var(--mono)}.paper-tags{display:flex;flex-wrap:wrap;gap:6px}.paper-tags--clamped{--tag-row-height: 26px;max-height:calc(var(--tag-row-height) * 2 + 6px);overflow:hidden}.paper-sota{position:relative;white-space:nowrap;overflow:hidden;margin-bottom:12px;font-family:var(--mono);font-size:12px;line-height:1.6}.paper-sota-stack{margin-top:16px;padding-top:16px;border-top:1px solid var(--hairline)}.paper-sota-stack .paper-sota{margin-bottom:4px}.paper-sota-stack .paper-sota:last-child{margin-bottom:0}.paper-sota-measure{position:absolute;left:-9999px;top:0;visibility:hidden;white-space:pre;pointer-events:none}.paper-sota-label{font-weight:500;color:var(--ink-faint)}.paper-sota-label--sota{color:#b8860b}.paper-sota-sep,.paper-sota-on{color:var(--ink-faint)}.paper-sota-name{color:var(--accent-text)}.paper-sota-name:hover{text-decoration:underline}.paper-sota-more{font-size:11px;color:var(--ink-faint);cursor:pointer}.paper-sota-more:hover{color:var(--accent-text);text-decoration:underline}.paper-stats{display:flex;flex-direction:column;align-items:flex-end;gap:8px;font-family:var(--mono);font-size:11px;color:var(--ink-soft)}.upvote-btn{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:8px 14px;border:1px solid var(--hairline);border-radius:6px;background:var(--bg-elevated);font-family:var(--mono);font-size:13px;font-weight:500;min-width:56px;transition:all .15s}.upvote-btn:hover{border-color:var(--ink)}.upvote-btn.upvoted{background:var(--accent-soft);border-color:var(--accent);color:var(--accent-text)}.upvote-btn .arrow{font-size:9px;line-height:1;margin-bottom:2px}.upvote-btn .count{font-feature-settings:"tnum"}.stat-line{display:flex;align-items:center;gap:5px}.sort-bar{display:flex;align-items:center;justify-content:space-between;padding-bottom:16px;border-bottom:1px solid var(--hairline);margin-bottom:16px}.sort-options{display:flex;gap:4px}.sort-btn{padding:4px 10px;font-family:var(--mono);font-size:11px;font-weight:500;letter-spacing:.02em;color:var(--ink-soft);border-radius:4px;transition:all .15s;text-transform:lowercase}.sort-btn.active{background:var(--ink);color:var(--bg)}.sort-btn:not(.active):hover{background:var(--bg-subtle);color:var(--ink)}.paper-feed-toolbar-controls,.paper-feed-resource-controls,.paper-feed-filter-options{display:flex;align-items:center}.paper-feed-toolbar-controls{gap:14px;flex-wrap:wrap}.paper-feed-resource-controls{gap:10px}.paper-feed-resource-divider{width:1px;height:22px;background:var(--hairline)}.paper-feed-filter-options{gap:6px;flex-wrap:wrap}.paper-feed-filter{display:inline-flex;align-items:center;gap:6px;min-height:30px;padding:5px 10px;border:1px solid var(--hairline);border-radius:999px;background:var(--bg);color:var(--ink-soft);font-family:var(--mono);font-size:11px;letter-spacing:.01em;cursor:pointer;transition:border-color .15s,background .15s,color .15s}.paper-feed-filter-content{display:inline-flex;align-items:center;gap:6px}.paper-feed-filter:hover{border-color:var(--ink-faint);color:var(--ink)}.paper-feed-filter.active{border-color:var(--ink);background:var(--ink);color:var(--bg)}.paper-feed-filter:focus-visible{outline:2px solid var(--ink);outline-offset:2px}.paper-feed-filter-icon{display:inline-flex;color:currentColor;filter:grayscale(1)}.hf-resource-logo{position:relative;display:inline-flex;width:15px;height:15px}.hf-resource-logo img{position:absolute;top:0;right:0;bottom:0;left:0;display:block;width:15px;height:15px}.hf-resource-logo-white,.paper-feed-filter.active .hf-resource-logo-black{visibility:hidden}.paper-feed-filter.active .hf-resource-logo-white{visibility:visible}.paper-feed-filter-check{display:inline-flex;align-items:center;justify-content:center;width:17px;height:17px;border-radius:50%;background:color-mix(in srgb,var(--bg) 18%,transparent);color:currentColor;font-size:10px;line-height:1}.home-feed-sort-bar{flex-wrap:wrap;row-gap:10px}.results-count{font-family:var(--mono);font-size:11px;color:var(--ink-faint)}.paper-feed-scope-links{margin-top:12px;display:flex;flex-direction:column;align-items:flex-start;gap:8px}.paper-feed-primary-links,.paper-feed-task-tags{display:flex;flex-wrap:wrap;align-items:center;gap:10px}.papers-feed-layout-scoped{display:block}.paper-thumb{display:none}.papers-search-row{display:flex;margin-top:12px;margin-bottom:24px}.papers-search-input-wrap{display:flex;align-items:center;gap:8px;border:1px solid var(--hairline-strong);background:var(--bg-elevated);padding:10px 14px;border-radius:4px;flex:1;max-width:600px;color:var(--ink-faint)}.papers-search-input-wrap:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}.papers-search-input{flex:1;border:none;outline:none;background:transparent;font-family:var(--sans);font-size:14px;color:var(--ink)}.papers-search-input::-moz-placeholder{color:var(--ink-faint)}.papers-search-input::placeholder{color:var(--ink-faint)}@media (max-width: 880px){.feed-title{font-size:32px}.paper-card{grid-template-columns:120px 1fr;gap:16px;padding:20px 0}.paper-body{flex-direction:column;align-items:stretch;gap:12px}.paper-resources{width:auto;flex-direction:row;align-items:center;justify-content:flex-start;gap:24px;border-left:none;border-top:1px solid var(--hairline);padding-left:0;padding-top:12px}.paper-resource{flex-direction:row;gap:8px}.paper-resource .resource-stat{align-items:flex-start}}@media (min-width: 641px) and (max-width: 880px){.paper-thumb-wrap{min-width:0;align-items:flex-start}.paper-thumb-wrap>div{width:100%!important;max-width:120px;height:auto!important;aspect-ratio:160 / 220}.paper-thumb-wrap>div>img,.paper-thumb-wrap>div>svg{width:100%!important;height:100%!important}.paper-thumb-skeleton{width:100%;max-width:120px;height:auto;aspect-ratio:160 / 220}}@media (max-width: 640px){.feed-header{margin-bottom:24px;gap:16px}.feed-title{font-size:26px}.paper-card{grid-template-columns:1fr;gap:12px}.paper-resources{border-top:none;padding-top:0}.paper-thumb-wrap{align-self:flex-start}.paper-card:has(>.paper-thumb-wrap){grid-template-columns:84px minmax(0,1fr);grid-template-rows:auto auto 1fr;-moz-column-gap:14px;column-gap:14px;row-gap:0}.paper-card:has(>.paper-thumb-wrap)>.paper-body,.paper-card:has(>.paper-thumb-wrap) .paper-body-main{display:contents}.paper-card>.paper-thumb-wrap{grid-column:1;grid-row:1 / 4;margin-bottom:12px}.paper-card>.paper-thumb-wrap>div{width:84px!important;height:auto!important;aspect-ratio:160 / 220}.paper-card>.paper-thumb-wrap>div>img,.paper-card>.paper-thumb-wrap>div>svg{width:100%!important;height:100%!important}.paper-card:has(>.paper-thumb-wrap) .paper-follow-reason,.paper-card:has(>.paper-thumb-wrap) .paper-title,.paper-card:has(>.paper-thumb-wrap) .paper-authors{grid-column:2;align-self:start}.paper-card:has(>.paper-thumb-wrap) .paper-abstract,.paper-card:has(>.paper-thumb-wrap) .paper-sota,.paper-card:has(>.paper-thumb-wrap) .paper-tags,.paper-card:has(>.paper-thumb-wrap) .paper-resources{grid-column:1 / -1}.paper-card:has(>.paper-thumb-wrap) .paper-resources{margin-top:12px}.paper-title{font-size:19px}.paper-abstract{max-height:6.2em;-webkit-line-clamp:4;line-clamp:4}}.sort-options-time{margin-left:auto}.sort-btn-time{text-transform:none}@media (max-width: 900px){.sort-bar{flex-wrap:wrap;gap:8px}.sort-options-time{margin-left:0}}@media (max-width: 560px){.paper-feed-resource-divider{display:none}.paper-feed-resource-controls{gap:0}}.paper-date-filter{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:4px}.paper-date-popover{width:min(760px,calc(100vw - 32px));max-width:760px;padding:14px 18px;max-height:calc(100vh - 24px);overflow-y:auto}.paper-date-popover-header{margin-bottom:8px}.paper-date-popover-header h2{margin:0;font-family:var(--serif);font-size:21px}.paper-date-popover-header p{margin:5px 0 0;color:var(--ink-soft)}.paper-date-navigation{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:36px;margin-bottom:-38px;pointer-events:none;position:relative;z-index:1}.paper-date-navigation-group{display:flex;justify-content:space-between}.paper-date-navigation button{pointer-events:auto}.paper-date-navigation button,.paper-date-actions button{border:1px solid var(--hairline);border-radius:6px;background:var(--bg-elevated);color:var(--ink);padding:7px 11px;font:inherit;cursor:pointer}.paper-date-calendars{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:36px}.paper-date-year{display:flex;align-items:center;justify-content:center;gap:8px;margin-bottom:6px;color:var(--ink-soft);font-size:13px;font-weight:600}.paper-date-year input{width:5.5rem;border:1px solid var(--hairline);border-radius:5px;background:var(--bg-elevated);color:var(--ink);padding:5px 7px;font:inherit}.paper-date-year input:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.paper-date-calendar h3{margin:0 0 10px;text-align:center;font-family:var(--serif);font-size:17px}.paper-date-weekdays,.paper-date-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr))}.paper-date-weekdays span{padding:3px 0 4px;color:var(--ink-faint);text-align:center;font-size:11px;font-weight:600}.paper-date-day{width:28px;height:28px;justify-self:center;border:0;border-radius:999px;background:transparent;color:var(--ink);font:inherit;cursor:pointer}.paper-date-day:hover:not(:disabled),.paper-date-day:focus-visible{background:var(--bg-subtle);outline:2px solid var(--accent);outline-offset:-2px}.paper-date-day.in-range{border-radius:0;background:color-mix(in srgb,var(--accent) 14%,transparent)}.paper-date-day.selected{background:var(--accent);color:#fff;font-weight:700}.paper-date-day.today:not(.selected){box-shadow:inset 0 0 0 1px var(--accent)}.paper-date-day:disabled{color:var(--ink-faint);cursor:not-allowed;opacity:.42}.paper-date-day.outside{visibility:hidden}.paper-date-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-top:10px;border-top:1px solid var(--hairline)}.paper-date-actions>div{display:flex;gap:8px}.paper-date-actions .paper-date-clear{border-color:transparent;color:var(--ink-soft)}.paper-date-actions .paper-date-apply{border-color:var(--accent);background:var(--accent);color:#fff}.paper-date-actions button:disabled{cursor:not-allowed;opacity:.45}.paper-date-filter-single-calendar{justify-content:flex-start}.paper-date-popover-single-calendar{width:calc(100vw - 20px);padding:20px 14px}.paper-date-popover-single-calendar .paper-date-calendars,.paper-date-popover-single-calendar .paper-date-navigation{display:block}.paper-date-popover-single-calendar .paper-date-day{width:36px;height:36px}.organization-hero{display:grid;grid-template-columns:minmax(260px,.34fr) minmax(0,1fr);align-items:center;gap:48px;margin:24px 0 32px}.organization-hero-profile{min-width:0}.organization-hero-title{display:flex;align-items:center;gap:14px}.organization-hero-title img{flex:none;-o-object-fit:contain;object-fit:contain}.feed-title.organization-hero-title--long{font-size:30px;line-height:1.1}.organization-hero-name{min-width:0}.organization-hero-full-name{display:block;margin-top:8px;color:var(--ink-soft);font-size:18px;letter-spacing:-.01em;line-height:1.25}.organization-hero-monogram{display:grid;flex:none;place-items:center;width:58px;height:58px;border:1px solid var(--hairline);border-radius:6px;background:var(--bg-elevated);color:var(--accent-text);font-size:30px;line-height:1}.organization-hero-links{display:flex;flex-wrap:wrap;gap:12px;margin-top:12px}.organization-contributions{width:100%;min-width:0}.organization-contributions-header{margin-bottom:12px}.organization-contributions-title{font-family:var(--serif);font-size:20px;font-weight:600;line-height:1.2}.organization-contributions-summary{margin-top:3px;color:var(--ink-soft);font-size:12px}.organization-contributions-legend{display:flex;align-items:center;justify-content:flex-start;gap:4px;margin-top:8px;color:var(--ink-faint);font-family:var(--mono);font-size:10px;white-space:nowrap}.organization-contributions-legend span:first-child{margin-right:3px}.organization-contributions-legend span:last-child{margin-left:3px}.organization-contributions-scroll{width:calc(100% + 34px);max-width:none;margin-left:-34px;overflow-x:auto;padding:2px 0;scrollbar-width:thin;scrollbar-color:var(--hairline-strong) transparent}.organization-contributions-plot{display:grid;grid-template-columns:25px auto;gap:9px;margin:0}.organization-contributions-weekdays{display:grid;grid-template-rows:repeat(7,12px);gap:3px;padding-top:24px;color:var(--ink-faint);font-family:var(--mono);font-size:9px;line-height:12px;text-align:right}.organization-contributions-months{display:grid;gap:3px;height:20px;color:var(--ink-faint);font-family:var(--mono);font-size:9px;line-height:12px}.organization-contributions-months span{grid-row:1;white-space:nowrap}.organization-contributions-grid{display:grid;grid-template-rows:repeat(7,12px);grid-auto-flow:column;gap:3px}.organization-contribution-cell{display:block;width:12px;height:12px;border:1px solid color-mix(in srgb,var(--hairline) 78%,transparent);border-radius:2px;background:var(--bg-subtle)}.organization-contribution-cell.level-1{border-color:color-mix(in srgb,var(--positive-border) 60%,transparent);background:color-mix(in srgb,var(--positive-bg) 65%,var(--positive-border))}.organization-contribution-cell.level-2{border-color:transparent;background:color-mix(in srgb,var(--positive-text) 35%,var(--positive-bg))}.organization-contribution-cell.level-3{border-color:transparent;background:color-mix(in srgb,var(--positive-text) 60%,var(--positive-bg))}.organization-contribution-cell.level-4{border-color:transparent;background:var(--positive-text)}.organization-contribution-cell.is-outside{visibility:hidden}.organization-contributions-skeleton{width:100%;height:154px;border-radius:6px}@media (max-width: 960px){.organization-hero{grid-template-columns:1fr;align-items:start;gap:28px}.organization-contributions-plot{margin:0 auto}.organization-contributions-scroll{width:100%;max-width:100%;margin-left:0}.organization-contributions-legend{justify-content:center;width:min(100%,826px);margin:8px auto 0}}@media (max-width: 640px){.organization-hero{margin-bottom:28px}.feed-title.organization-hero-title--long{font-size:22px}.organization-hero-full-name{font-size:15px}.organization-contributions{max-width:calc(100vw - 28px)}}.author-hero{margin:8px 0 20px}.author-hero-title{display:flex;align-items:center;gap:20px}.author-avatar{display:block;width:96px;height:96px}@media (max-width: 640px){.author-avatar{width:64px;height:64px}}.author-photo{display:flex;flex:none;flex-direction:column;align-items:center;gap:4px;max-width:120px;margin:0}.author-photo figcaption{color:var(--ink-soft);font-size:10px;line-height:1.3;text-align:center}.author-photo figcaption a{color:inherit}.author-hero .feed-subtitle a{color:var(--accent-text);text-decoration:none}.author-hero .feed-subtitle a:hover{text-decoration:underline;text-underline-offset:2px}.tag-chip{display:inline-flex;align-items:center;gap:5px;padding:3px 9px;font-family:var(--mono);font-size:11px;font-weight:500;border-radius:4px;cursor:pointer;transition:filter .15s,transform .15s;white-space:nowrap;border:1px solid transparent}.tag-chip:hover{filter:brightness(.96);transform:translateY(-1px)}.tag-chip .dot{width:5px;height:5px;border-radius:50%}.paper-tags--clamped .tag-chip{line-height:16px}.tag-hero{padding:48px 0 32px;border-bottom:1px solid var(--hairline);margin-bottom:32px}.tag-hero-eyebrow{font-family:var(--mono);font-size:11px;letter-spacing:.12em;text-transform:uppercase;color:var(--ink-faint);margin-bottom:12px;display:flex;align-items:center;gap:8px}.tag-hero-title{font-family:var(--serif);font-size:56px;font-weight:500;letter-spacing:-.025em;line-height:1;margin-bottom:16px;overflow-wrap:break-word}.tag-hero-meta{display:flex;gap:32px;margin-top:24px;font-family:var(--mono);font-size:12px;color:var(--ink-soft)}.tag-hero-meta .stat{display:flex;flex-direction:column;gap:4px}.tag-hero-meta .stat .label{font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-faint)}.tag-hero-meta .stat .value{font-family:var(--serif);font-size:22px;font-weight:500;color:var(--ink)}.tag-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:0;border-top:1px solid var(--hairline)}.tag-cell{padding:20px 24px;border-bottom:1px solid var(--hairline);border-right:1px solid var(--hairline);cursor:pointer;transition:background .15s;display:flex;flex-direction:column;gap:8px}.tag-cell:nth-child(3n){border-right:none}.tag-cell:hover{background:var(--bg-elevated)}.tag-cell .name{font-family:var(--serif);font-size:18px;font-weight:500;display:flex;align-items:center;gap:8px}.tag-cell .name .dot{width:8px;height:8px;border-radius:50%}.tag-cell .name .task-icon{flex:none;display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:9px;background:color-mix(in oklch,currentColor 14%,transparent);transition:transform .2s ease}.tag-cell:hover .name .task-icon{transform:rotate(-8deg) scale(1.1)}.tag-cell .meta{font-family:var(--mono);font-size:11px;color:var(--ink-faint);display:flex;gap:12px}.taxonomy-trending{margin-bottom:48px;scroll-margin-top:80px}.taxonomy-trending-header{padding-bottom:12px;border-bottom:1px solid var(--hairline-strong)}.taxonomy-trending-header h2{display:flex;align-items:center;gap:10px;margin-bottom:4px;font-family:var(--serif);font-size:26px;font-weight:500;letter-spacing:-.02em}.taxonomy-trending-header h2 svg{color:var(--accent-text)}.taxonomy-trending-note{margin:0;font-family:var(--serif);font-style:italic;font-size:13px;color:var(--ink-soft)}.taxonomy-trending-rank{min-width:1.6em;font-family:var(--mono);font-size:11px;font-style:normal;color:var(--ink-faint)}.taxonomy-trending-meta{flex-wrap:wrap}.taxonomy-trending-lift{display:inline-flex;align-items:center;gap:3px}.tag-hero-meta .stat .value small{margin-left:2px;font-family:var(--mono);font-size:10px;font-weight:500;color:var(--ink-faint)}.framework-category{margin-top:32px}.framework-category-head{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;margin-bottom:16px}.framework-category-blurb{font-family:var(--serif);font-size:14px;line-height:1.55;color:var(--ink-soft);max-width:720px;margin:0}.framework-category-meta{font-family:var(--mono);font-size:11px;color:var(--ink-faint);white-space:nowrap}.framework-guide-link{display:inline-block;margin-top:8px;font-family:var(--mono);font-size:11px;color:var(--accent-text);text-decoration:none}.framework-guide-link:hover{text-decoration:underline}.framework-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}.framework-card{border:1px solid var(--hairline);background:var(--bg-elevated);border-radius:6px;padding:18px 22px;scroll-margin-top:24px;display:flex;flex-direction:column;gap:12px;transition:border-color .15s}.framework-card:hover{border-color:var(--ink)}.framework-card-clickable{cursor:pointer}.framework-card-clickable:focus-visible{border-color:var(--ink);outline:2px solid var(--accent);outline-offset:2px}.framework-card-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}.framework-card-name{font-family:var(--serif);font-size:20px;font-weight:500;letter-spacing:-.01em;margin:0;color:var(--ink)}.framework-card-org{font-family:var(--mono);font-size:11px;color:var(--ink-faint);margin-top:4px}.framework-platform-row{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end}.framework-platform-chip{font-family:var(--mono);font-size:10px;letter-spacing:.03em;text-transform:uppercase;padding:3px 8px;border-radius:3px;white-space:nowrap}.framework-card-desc{font-family:var(--sans);font-size:14px;line-height:1.55;color:var(--ink-soft);margin:0}.framework-card-when{font-family:var(--serif);font-style:italic;font-size:13px;line-height:1.5;color:var(--ink-soft);padding-top:4px;border-top:1px solid var(--hairline)}.framework-card-when-label{display:block;font-family:var(--mono);font-size:10px;font-style:normal;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-faint);margin-bottom:4px}.framework-card-links{display:flex;flex-wrap:wrap;gap:10px;margin-top:auto}.framework-link{display:inline-flex;align-items:center;gap:6px;font-family:var(--mono);font-size:11px;color:var(--accent-text);text-decoration:none;padding:4px 10px;border:1px solid var(--hairline);border-radius:4px;transition:border-color .15s,background .15s}.framework-link:hover{border-color:var(--ink);background:var(--bg-subtle)}.framework-link-disabled,.framework-link-disabled:hover{color:var(--ink-faint);background:transparent;border-color:var(--hairline);cursor:not-allowed}@media (max-width: 880px){.tag-grid{grid-template-columns:repeat(2,1fr)}.tag-cell:nth-child(3n){border-right:1px solid var(--hairline)}.tag-cell:nth-child(2n){border-right:none}.framework-category-head{flex-direction:column;gap:8px}.framework-card-head{flex-direction:column;gap:10px}.framework-platform-row{justify-content:flex-start}.tag-hero-title{font-size:40px}}@media (max-width: 640px){.tag-hero{padding:32px 0 24px;margin-bottom:24px}.tag-hero-title{font-size:30px}.tag-grid{grid-template-columns:1fr}.tag-cell{padding:16px;border-right:none!important}.framework-grid{grid-template-columns:1fr}.tag-hero-meta{gap:20px;flex-wrap:wrap}}.task-hero-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(320px,480px);gap:48px;align-items:start}@media (min-width: 1200px){.task-hero-grid--wide{grid-template-columns:minmax(0,1fr) minmax(320px,720px)}}.task-figure-card{background:var(--bg-elevated);border:1px solid var(--hairline);border-radius:6px;padding:16px 16px 12px;margin:0;box-shadow:0 1px #00000005}.task-figure-img-wrap{width:100%;background:var(--bg);border-radius:4px;overflow:hidden;line-height:0}.task-figure-img{width:100%;height:auto;display:block}.task-figure-card--compact .task-figure-img{width:50%;margin:0 auto}.task-figure-card figcaption{font-family:var(--serif);font-style:italic;font-size:12px;color:var(--ink-faint);text-align:center;margin-top:10px;border-top:1px solid var(--hairline);padding-top:10px}.task-image-credit{color:var(--ink-faint);font-family:var(--mono);font-size:10px;font-style:normal}.task-image-credit p{margin:0}.task-image-credit a{color:inherit;text-decoration:underline;text-underline-offset:2px}.task-image-credit a:hover{color:var(--accent-text)}@media (max-width: 900px){.task-hero-grid{grid-template-columns:1fr;gap:24px}}.taxonomy-suggestion-cell{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:100%;border-top:0;border-left:0;background:transparent;color:var(--ink-soft);text-align:left}.taxonomy-suggestion-cell .name{font-style:italic}.taxonomy-suggestion-icon{width:14px;height:14px}.task-page-grid{display:grid;grid-template-columns:1fr 260px;gap:56px;align-items:start}.task-featured-collection{display:grid;grid-template-columns:1fr auto;gap:4px 24px;align-items:center;margin-top:32px;padding:18px 24px;border:1px solid var(--hairline);border-left:3px solid var(--accent);border-radius:6px;background:var(--bg-elevated);color:var(--ink);text-decoration:none;transition:border-color .15s}.task-featured-collection:hover{border-color:var(--accent)}.task-featured-collection-eyebrow{grid-column:1;font-family:var(--mono);font-size:10px;font-weight:600;letter-spacing:.12em;text-transform:uppercase;color:var(--accent-text)}.task-featured-collection strong{grid-column:1;font-family:var(--serif);font-size:22px;line-height:1.2}.task-featured-collection-description{grid-column:1;color:var(--ink-soft);font-size:14px;line-height:1.45}.task-featured-collection-meta{grid-column:2;grid-row:1 / span 3;display:inline-flex;align-items:center;gap:6px;font-family:var(--mono);font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--accent-text);white-space:nowrap}.medical-ai-hub{margin-top:32px;padding:24px;border:1px solid var(--hairline);border-top:3px solid var(--accent);border-radius:6px;background:var(--bg-elevated)}.medical-ai-hub-heading>span,.medical-ai-hub-card-eyebrow{display:block;font-family:var(--mono);font-size:10px;font-weight:600;letter-spacing:.12em;text-transform:uppercase;color:var(--accent-text)}.medical-ai-hub-heading h2{margin:6px 0 4px;font-family:var(--serif);font-size:26px;line-height:1.2;color:var(--ink)}.medical-ai-hub-heading p{margin:0;color:var(--ink-soft);font-size:14px}.medical-ai-hub-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-top:20px}.medical-ai-hub-card{display:flex;min-width:0;min-height:176px;flex-direction:column;padding:16px;border:1px solid var(--hairline);border-radius:5px;background:var(--bg);color:var(--ink);text-decoration:none;transition:border-color .15s,transform .15s}.medical-ai-hub-card:hover{border-color:var(--accent);transform:translateY(-2px)}.medical-ai-hub-card strong{margin-top:10px;font-family:var(--serif);font-size:18px;line-height:1.2}.medical-ai-hub-card-description{margin-top:8px;color:var(--ink-soft);font-size:13px;line-height:1.45}.medical-ai-hub-card-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:auto;padding-top:16px;font-family:var(--mono);font-size:10px;letter-spacing:.04em;text-transform:uppercase;color:var(--ink-faint)}.task-explainer{font-family:var(--serif);font-size:17px;line-height:1.55;color:var(--ink);max-width:720px;margin-top:16px;margin-bottom:28px;text-wrap:pretty}.task-explainer p{margin:0 0 12px}.task-explainer p:last-child{margin-bottom:0}.task-explainer a{color:var(--accent-text);text-decoration:underline;text-underline-offset:2px;text-decoration-thickness:1px}.task-explainer a:hover{color:var(--accent)}.task-explainer strong{color:var(--ink);font-weight:600}.task-explainer em{font-style:italic}.task-explainer code{font-family:var(--mono);font-size:.9em;background:var(--bg-elevated);padding:1px 5px;border-radius:3px}.task-quickstats{display:flex;gap:28px;font-family:var(--mono);font-size:11px;color:var(--ink-faint);letter-spacing:.05em;padding-bottom:14px;margin-bottom:0;border-bottom:1px solid var(--accent)}.task-quickstats .num{color:var(--ink);font-weight:600;font-size:12px;margin-right:5px;font-feature-settings:"tnum"}.task-framework-links{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin-top:14px}.task-framework-links-label{font-family:var(--mono);font-size:10px;letter-spacing:.12em;text-transform:uppercase;color:var(--ink-faint);font-weight:600}.task-framework-link{display:inline-flex;align-items:center;gap:6px;font-family:var(--mono);font-size:12px;color:var(--ink);text-decoration:none;padding:4px 10px;border:1px solid var(--hairline);border-radius:999px;background:var(--bg-elevated);transition:color .15s,border-color .15s}.task-framework-link:hover{color:var(--accent-text);border-color:var(--accent)}.task-framework-link-stars{color:var(--ink-faint);font-size:11px}.task-side{position:sticky;top:100px;font-size:13px}.side-block{margin-bottom:28px}.side-block-num{font-family:var(--mono);font-size:10px;color:var(--accent-text);letter-spacing:.1em;margin-bottom:4px}.side-block-label{font-family:var(--mono);font-size:12px;letter-spacing:.12em;text-transform:uppercase;color:var(--ink);font-weight:600;padding-bottom:8px;border-bottom:1px solid var(--hairline);margin-bottom:10px}.side-link-row{display:flex;justify-content:space-between;align-items:baseline;padding:5px 0;cursor:pointer;font-family:var(--serif);font-size:14px}.side-link-row:hover{color:var(--accent-text)}.side-link-row .count{font-family:var(--mono);font-size:11px;color:var(--ink-faint)}.side-domain-pill{font-family:var(--mono);font-size:11px;color:var(--accent-text);padding:6px 0}.side-method-row{display:flex;justify-content:space-between;align-items:center;padding:4px 0}.side-method-row .num{font-family:var(--mono);font-size:10.5px;color:var(--ink-faint)}.task-section-head{scroll-margin-top:96px;margin-top:28px;margin-bottom:14px}.task-section-eyebrow{font-family:var(--mono);font-size:10px;letter-spacing:.12em;text-transform:uppercase;color:var(--accent-text);margin-bottom:6px}.task-section-title{font-family:var(--mono);font-size:18px;font-weight:600;color:var(--ink);letter-spacing:.04em;text-transform:uppercase;display:flex;align-items:baseline;gap:10px}.task-section-title .meta{font-family:var(--mono);font-size:11px;color:var(--ink-faint);font-weight:400;letter-spacing:.05em;text-transform:none}.subtask-section{margin-bottom:24px}.subtask-section+.subtask-section{margin-top:8px}.subtask-head{display:flex;align-items:baseline;gap:10px;margin:18px 0 10px}.subtask-head-name{font-family:var(--mono);font-size:14px;font-weight:600;color:var(--ink);letter-spacing:.04em;text-transform:uppercase;text-decoration:none;transition:color .15s}.subtask-head-name:hover{color:var(--accent-text)}.subtask-head-meta{font-family:var(--mono);font-size:11px;color:var(--ink-faint);letter-spacing:.05em}.subtask-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;align-items:start}.subtask-grid .subtask-section{margin-bottom:0;border:1px solid var(--hairline);background:var(--bg-elevated);border-radius:6px;padding:12px 14px 10px}.subtask-grid .subtask-section+.subtask-section{margin-top:0}.subtask-grid .subtask-head{margin:0 0 8px;padding-bottom:8px;border-bottom:1px solid var(--hairline)}.subtask-grid .subtask-head-name{font-size:12px}.subtask-grid .subtask-head-meta{font-size:10px}.subtask-summary{display:flex;flex-direction:column;gap:7px;min-height:86px;color:var(--ink-soft);text-decoration:none;font-family:var(--mono);font-size:10px;line-height:1.4;letter-spacing:.05em;text-transform:uppercase}.subtask-summary:hover{color:var(--ink)}.subtask-summary-desc{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:3;font-family:var(--serif);font-size:13px;line-height:1.35;letter-spacing:0;text-transform:none;color:var(--ink-soft)}.subtask-grid .bench-row{display:grid;grid-template-columns:22px 1fr 16px;gap:10px;align-items:center;border:0;background:transparent;border-radius:0;padding:8px 0;margin-bottom:0;border-bottom:1px dashed var(--hairline);transition:none}.subtask-grid .bench-row:last-of-type{border-bottom:0}.subtask-grid .bench-row:hover{border-color:transparent}.subtask-grid .bench-row:hover .bench-row-name{color:var(--accent-text)}.subtask-grid .bench-row-num{font-size:10px}.subtask-grid .bench-row-name{font-size:13.5px;margin-bottom:2px;line-height:1.2}.subtask-grid .bench-row-sub{font-size:9.5px;letter-spacing:.06em}.subtask-grid .bench-row-arrow{font-size:14px}.subtask-grid .bench-show-more{font-size:10px;padding:6px 0 0;margin-top:2px}.bench-card{border:1px solid var(--hairline);background:var(--bg-elevated);border-radius:6px;padding:18px 22px;margin-bottom:14px;cursor:pointer;transition:border-color .15s}.bench-card:hover{border-color:var(--ink)}.bench-head{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:14px;gap:16px}.bench-name{font-family:var(--mono);font-size:14px;font-weight:600;letter-spacing:.02em;text-transform:uppercase;color:var(--ink)}.bench-sub{font-family:var(--mono);font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-faint);margin-top:4px}.bench-sota-value{font-family:var(--serif);font-size:36px;font-weight:500;color:var(--accent);font-feature-settings:"tnum";line-height:1}.bench-sota-tag{font-family:var(--mono);font-size:10px;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-faint);text-align:right;margin-top:4px}.bench-task-tag{font-family:var(--mono);font-size:10px;letter-spacing:.08em;text-transform:uppercase;color:var(--accent-text)}.domain-mega-title{font-family:var(--mono);font-size:56px;font-weight:600;letter-spacing:-.01em;line-height:1;text-transform:uppercase;margin-bottom:0;color:var(--ink);overflow-wrap:break-word}.benchmark-trend-table{border-top:1px solid var(--hairline)}.benchmark-trend-head,.benchmark-trend-row{display:grid;grid-template-columns:124px minmax(150px,.8fr) minmax(150px,.9fr) minmax(200px,1.3fr) 44px 78px;gap:20px;align-items:center}.benchmark-trend-head{padding:9px 16px;border-bottom:1px solid var(--hairline);font-family:var(--mono);font-size:9.5px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-faint)}.benchmark-trend-row{min-height:92px;padding:12px 16px;border-bottom:1px solid var(--hairline);background:transparent;transition:background .15s,border-color .15s}.benchmark-trend-row:hover{background:var(--bg-elevated);border-color:var(--hairline-strong)}.benchmark-trend-row:hover .bench-row-name{color:var(--accent-text)}.benchmark-trend-cell{min-width:0}.benchmark-trend-sparkline{display:block;width:112px;height:42px;overflow:visible}.benchmark-trend-axis{stroke:var(--hairline-strong);stroke-width:.8;stroke-dasharray:1.5 2.5;vector-effect:non-scaling-stroke}.benchmark-trend-area{fill:var(--accent-soft);opacity:.68}.benchmark-trend-line{fill:none;stroke:var(--accent);stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}.benchmark-trend-dot{fill:var(--bg-elevated);stroke:var(--accent);stroke-width:1.8;vector-effect:non-scaling-stroke}.benchmark-trend-point{cursor:crosshair;outline:none}.benchmark-trend-point-hit{fill:transparent}.benchmark-trend-point-mark{fill:var(--bg-elevated);stroke:var(--accent);stroke-width:1.25;opacity:0;transition:opacity .12s,r .12s;vector-effect:non-scaling-stroke}.benchmark-trend-point:hover .benchmark-trend-point-mark,.benchmark-trend-point:focus .benchmark-trend-point-mark{opacity:1;r:2.3px}.benchmark-trend-tooltip rect{fill:var(--ink);opacity:.94}.benchmark-trend-tooltip text{fill:var(--bg);font-family:var(--mono);font-size:3.2px;letter-spacing:.01em}.benchmark-trend-tooltip .benchmark-trend-tooltip-value{font-weight:700}.benchmark-trend-meta{display:flex;align-items:center;gap:6px;margin-top:3px;font-family:var(--mono);font-size:8.5px;letter-spacing:.035em;color:var(--ink-faint);white-space:nowrap}.benchmark-trend-meta strong{color:var(--ink-soft);font-weight:600}.benchmark-trend-change{padding:1px 4px;border-radius:999px;font-size:8px;font-weight:600}.benchmark-trend-change.is-up,.benchmark-trend-change.is-new{color:var(--positive-text);background:var(--positive-bg)}.benchmark-trend-change.is-down{color:var(--negative-text);background:var(--negative-bg)}.benchmark-trend-benchmark{min-width:0}.benchmark-trend-row .bench-row-name{display:block;margin-bottom:5px}.benchmark-trend-row .bench-row-best{width:100%;justify-content:flex-start;text-align:left}.bench-row-best-empty{color:var(--ink-faint);font-family:var(--mono)}.bench-row-paper{min-width:0;font-family:var(--serif);font-size:14px;line-height:1.35}.bench-row-paper a{color:var(--accent-text)}.bench-row-paper a:hover{text-decoration:underline}.bench-row-code{display:flex;justify-content:center}.bench-row-code a{display:inline-flex;color:var(--ink-soft);transition:color .15s,transform .15s}.bench-row-code a:hover{color:var(--accent-text);transform:translateY(-1px)}.bench-row-compare{display:flex;justify-content:center}.bench-row-compare a{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:30px;padding:0 10px;border:1px solid var(--accent);border-radius:999px;color:var(--accent-text);font-family:var(--mono);font-size:9px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;white-space:nowrap;transition:color .15s,background .15s}.bench-row-compare a svg{transition:transform .15s}.bench-row-compare a:hover{color:var(--bg);background:var(--accent)}.bench-row-compare a:hover svg{transform:translate(2px)}.bench-row-compare a:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.bench-row{display:grid;grid-template-columns:36px 1fr auto 28px;gap:18px;align-items:center;padding:16px 18px;border:1px solid var(--hairline);background:var(--bg-elevated);border-radius:6px;margin-bottom:8px;cursor:pointer;transition:border-color .15s,transform .15s}.bench-row:hover{border-color:var(--ink)}.bench-row:hover .bench-row-arrow{color:var(--accent-text);transform:translate(3px)}.bench-row-num{font-family:var(--mono);font-size:11px;color:var(--ink-faint);letter-spacing:.05em;font-feature-settings:"tnum"}.bench-row-name{font-family:var(--serif);font-size:18px;font-weight:500;color:var(--ink);letter-spacing:-.005em;margin-bottom:4px}.bench-row-sub{display:flex;align-items:center;gap:8px;font-family:var(--mono);font-size:10px;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-faint)}.bench-row-sub strong{color:var(--ink-soft);font-weight:600}.bench-row-variants{display:flex;flex-wrap:wrap;gap:4px;margin:2px 0 6px}.bench-row-variant{font-family:var(--mono);font-size:9.5px;letter-spacing:.02em;white-space:nowrap;padding:1px 5px;border:1px solid var(--hairline);border-radius:3px;background:transparent;color:var(--ink-faint);cursor:pointer;transition:border-color .15s,color .15s}.bench-row-variant:hover{border-color:var(--ink);color:var(--ink)}.bench-row-variant[aria-pressed=true]{border-color:var(--accent);color:var(--accent-text)}.bench-row-variant:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.bench-row-sub .dot-sep{color:var(--hairline-strong)}.bench-row-sota{text-align:right}.bench-row-sota-value{font-family:var(--serif);font-size:22px;font-weight:500;color:var(--accent-text);font-feature-settings:"tnum";line-height:1}.bench-row-sota-tag{font-family:var(--mono);font-size:9.5px;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-faint);margin-top:4px}.bench-row-arrow{font-family:var(--serif);font-size:18px;color:var(--hairline-strong);text-align:center;transition:color .15s,transform .15s}.bench-row-best{display:flex;align-items:center;justify-content:flex-end;gap:6px;max-width:240px;text-align:right}.bench-row-best-icon{color:var(--accent-text);flex:0 0 auto}.bench-row-best-name{font-family:var(--serif);font-size:14px;color:var(--ink-soft);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bench-show-more{font-family:var(--mono);font-size:11px;letter-spacing:.05em;color:var(--ink-faint);background:transparent;border:0;padding:8px 2px 2px;margin-top:4px;cursor:pointer;text-transform:lowercase;transition:color .15s}.bench-show-more:hover{color:var(--accent-text)}.bm-action-btn{display:inline-flex;align-items:center;gap:8px;padding:8px 14px;border:1px solid var(--hairline);border-radius:6px;background:var(--bg-elevated);font-family:var(--sans);font-size:13px;font-style:normal;color:var(--ink);cursor:pointer;transition:border-color .15s}.bm-action-btn:hover{border-color:var(--ink)}.bm-action-btn svg{display:block}@media (max-width: 880px){.task-page-grid{grid-template-columns:1fr;gap:32px}.task-side{position:static;top:auto;order:-1}.subtask-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.medical-ai-hub-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.domain-mega-title{font-size:40px}.bench-row{grid-template-columns:28px 1fr auto;gap:12px;padding:14px}.bench-row>.bench-row-arrow{display:none}.bench-row-best{max-width:130px}.bench-row-best-name{font-size:12.5px}.benchmark-trend-head,.benchmark-trend-row{grid-template-columns:112px minmax(130px,.8fr) minmax(120px,.8fr) minmax(160px,1.2fr) 36px 72px;gap:14px}.benchmark-trend-sparkline{width:104px}}@media (max-width: 640px){.domain-mega-title{font-size:30px}.subtask-grid{grid-template-columns:1fr}.medical-ai-hub{padding:18px}.task-featured-collection{grid-template-columns:1fr;padding:16px 18px}.task-featured-collection-meta{grid-column:1;grid-row:auto;margin-top:8px}.medical-ai-hub-grid{grid-template-columns:1fr}.medical-ai-hub-card{min-height:0}.benchmark-trend-head{display:none}.benchmark-trend-row{grid-template-columns:100px minmax(0,1fr) 28px;grid-template-areas:"trend benchmark code" "trend best code" "trend paper paper" "trend compare compare";gap:4px 12px;min-height:120px;padding:12px 4px}.benchmark-trend-cell{grid-area:trend}.benchmark-trend-benchmark{grid-area:benchmark}.benchmark-trend-row .bench-row-best{grid-area:best;justify-content:flex-start;max-width:none;text-align:left}.benchmark-trend-row .bench-row-paper{grid-area:paper}.benchmark-trend-row .bench-row-code{grid-area:code}.benchmark-trend-row .bench-row-compare{grid-area:compare;justify-content:flex-start;margin-top:4px}.bench-row-compare a{min-height:26px;padding:0 9px;font-size:8.5px}.benchmark-trend-sparkline{width:96px}.benchmark-trend-meta{flex-wrap:wrap;gap:3px;white-space:normal}.task-quickstats{flex-wrap:wrap;gap:16px}}.paper-meta-line .arxiv-id{color:var(--accent-text)}.paper-authors .institution{font-style:italic;color:var(--ink-faint)}.paper-tags--clamped .method-chip{line-height:16px}.method-hero-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(360px,560px);gap:48px;align-items:start}.tag-hero.method-hero-grid{padding:8px 0 28px;margin-bottom:24px}.method-hero-grid .tag-hero-eyebrow{margin-bottom:8px}.method-hero-grid .research-follow{margin:12px 0 10px}.method-hero-grid .tag-hero-meta{margin-top:20px}.method-hero-grid--wide-figure{grid-template-columns:minmax(0,1fr) minmax(480px,640px)}.method-figure-card{background:var(--bg-elevated);border:1px solid var(--hairline);border-radius:6px;padding:16px 16px 12px;margin:0;box-shadow:0 1px #00000005;align-self:start}.method-figure-svg{width:100%;display:block}.method-figure-svg--schematic{aspect-ratio:360 / 420}.method-figure-img{width:100%;height:auto;display:block}.method-figure-svg--compact .method-figure-img{width:50%;margin:0 auto}.method-figure-svg--scaled-80 .method-figure-img{width:80%;margin:0 auto}.method-figure-card figcaption{font-family:var(--serif);font-style:italic;font-size:12px;color:var(--ink-faint);text-align:center;margin-top:10px;border-top:1px solid var(--hairline);padding-top:10px}.method-image-credit{color:var(--ink-faint);font-family:var(--mono);font-size:10px;font-style:normal}.method-image-credit p{margin:0}.method-image-credit a{color:inherit;text-decoration:underline;text-underline-offset:2px}.method-image-credit a:hover{color:var(--accent-text)}.method-description{font-family:var(--serif);font-size:17px;color:var(--ink-soft);max-width:720px;line-height:1.6;margin-top:12px;text-wrap:pretty}.method-description p{margin:0 0 12px}.method-description p:last-child{margin-bottom:0}.method-description a{color:var(--accent-text);text-decoration:underline;text-underline-offset:2px;text-decoration-thickness:1px}.method-description a:hover{color:var(--accent)}.method-description strong{color:var(--ink);font-weight:600}.method-description code{font-family:var(--mono);font-size:.9em;background:var(--bg-elevated);padding:1px 5px;border-radius:3px}.method-description ul,.method-description ol{padding-left:22px;margin:0 0 12px}.method-description ul{list-style-type:disc}.method-description ol{list-style-type:decimal}.method-description li{margin-bottom:4px}.method-description .katex-display{margin:14px 0;overflow-x:auto;overflow-y:hidden;padding:4px 0}.method-description .katex{font-size:1em}.method-source{margin-top:18px;display:flex;flex-direction:column;gap:6px;max-width:720px}.method-source-label{font-family:var(--mono);font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:var(--ink-faint)}.method-source-link{display:flex;flex-direction:column;gap:2px;padding:12px 14px;background:var(--bg-elevated);border:1px solid var(--hairline);border-left:3px solid var(--accent-text);border-radius:3px;cursor:pointer;transition:background .12s,border-color .12s;text-decoration:none}.method-source-link:not(.is-static):hover{background:var(--bg-subtle);border-color:var(--hairline-strong);border-left-color:var(--accent)}.method-source-link.is-static{cursor:default}.method-source-title{font-family:var(--serif);font-size:17px;font-weight:500;color:var(--ink);letter-spacing:-.005em}.method-source-link:not(.is-static):hover .method-source-title{text-decoration:underline;text-underline-offset:3px;text-decoration-thickness:1px}.method-source-meta{font-family:var(--mono);font-size:11px;color:var(--ink-faint)}@media (max-width: 1024px){.method-hero-grid{grid-template-columns:1fr;gap:24px}.method-figure-card{max-width:560px}.method-hero-grid--wide-figure .method-figure-card{max-width:640px}}.method-hero-title{font-family:var(--mono);font-size:40px;margin-bottom:0;letter-spacing:-.01em}.method-trending-icon{flex:0 0 auto;color:var(--accent-text);fill:color-mix(in srgb,var(--accent-text) 18%,transparent)}.method-trend-score{color:var(--accent-text);font-weight:600}.method-trend-panel{margin-top:20px;padding-top:14px;border-top:1px solid var(--hairline-strong)}.method-trend-header{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:4px}.method-trend-eyebrow{margin-bottom:5px;font-family:var(--mono);font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:var(--accent-text)}.method-trend-header p{margin:3px 0 0;font-family:var(--mono);font-size:11px;color:var(--ink-faint)}.method-trend-summary{display:flex;flex-direction:column;align-items:flex-end;flex:0 0 auto;font-family:var(--mono);font-size:10px;color:var(--ink-faint)}.method-trend-summary>strong{font-family:var(--serif);font-size:19px;font-weight:500;line-height:1;color:var(--ink)}.method-usage-chart-wrap{position:relative;width:100%}.method-usage-chart{display:block;width:100%;height:auto;overflow:visible}.method-usage-gridline{stroke:var(--hairline);stroke-width:1}.method-usage-y-label,.method-usage-x-label{fill:var(--ink-faint);font-family:var(--mono);font-size:9px}.method-usage-bar-hit{fill:transparent}.method-usage-bar-mark{fill:color-mix(in srgb,var(--accent-text) 48%,var(--bg));transition:fill .12s}.method-usage-bar.is-current .method-usage-bar-mark{opacity:.55}.method-usage-bar:hover .method-usage-bar-mark,.method-usage-bar:focus .method-usage-bar-mark,.method-usage-bar.is-active .method-usage-bar-mark{fill:var(--accent-text)}.method-usage-bar:focus{outline:none}.method-usage-tooltip{position:absolute;top:4px;right:8px;display:flex;gap:8px;padding:5px 8px;border:1px solid var(--hairline-strong);background:var(--bg);font-family:var(--mono);font-size:10px;color:var(--ink-soft);pointer-events:none}.method-trend-skeleton{margin-top:20px}.method-trend-note{margin:6px 0 0;color:var(--ink-faint);font-family:var(--mono);font-size:10px}@media (max-width: 640px){.method-trend-header{flex-direction:column;gap:12px}.method-trend-summary{align-items:flex-start}}.method-chip{display:inline-flex;align-items:center;padding:4px 10px;font-family:var(--mono);font-size:11px;font-weight:500;color:var(--ink);background:var(--bg-elevated);border:1px solid var(--hairline);border-radius:4px;cursor:pointer;transition:all .15s;white-space:nowrap}.method-chip:hover{border-color:var(--ink);background:var(--bg-subtle)}.side-method-row .method-chip{font-size:10.5px;padding:3px 8px}@media (max-width: 880px){.method-hero-title{font-size:34px}}@media (max-width: 640px){.method-hero-title{font-size:30px}}.filter-row{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-bottom:24px;padding:12px 16px;border:1px solid var(--hairline);border-radius:8px;background:var(--bg-elevated)}.filter-row .label{margin-right:8px;color:var(--ink-faint);font-family:var(--mono);font-size:10px;letter-spacing:.1em;text-transform:uppercase}.search-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#1a181466;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);z-index:100;display:flex;align-items:flex-start;justify-content:center;padding-top:100px}.search-modal{width:640px;max-width:calc(100vw - 32px);background:var(--bg);border:1px solid var(--hairline-strong);border-radius:12px;box-shadow:0 20px 60px #00000026;overflow:hidden}.search-modal-input{width:100%;padding:18px 20px;font-size:16px;font-family:var(--serif);border:none;background:transparent;outline:none;border-bottom:1px solid var(--hairline);color:var(--ink)}.search-modal-input::-moz-placeholder{color:var(--ink-faint);font-style:italic}.search-modal-input::placeholder{color:var(--ink-faint);font-style:italic}.search-results{max-height:480px;overflow-y:auto;padding:8px}.search-empty{padding:32px;text-align:center;color:var(--ink-faint);font-family:var(--serif);font-style:italic}.search-section-label{font-family:var(--mono);font-size:10px;letter-spacing:.12em;text-transform:uppercase;color:var(--ink-faint);padding:10px 12px 6px}.search-result{display:flex;flex-direction:column;padding:10px 12px;border-radius:6px;cursor:pointer;gap:4px}.search-result:hover,.search-result.focused{background:var(--bg-subtle)}.search-result-title{font-family:var(--serif);font-size:14.5px;font-weight:500;line-height:1.3}.search-result-meta{font-family:var(--mono);font-size:10.5px;color:var(--ink-faint);display:flex;gap:10px}.search-result-tag{display:flex;align-items:center;gap:8px;padding:8px 12px;border-radius:6px;cursor:pointer}.search-result-tag:hover,.search-result-tag.focused{background:var(--bg-subtle)}.search-result-tag .name{font-family:var(--mono);font-size:12px}.search-result-tag .handle{font-family:var(--mono);font-size:10px;color:var(--ink-faint)}.search-result-tag .logo{width:16px;height:16px;border-radius:3px;-o-object-fit:contain;object-fit:contain;flex:none}.search-result-tag .count{margin-left:auto;font-family:var(--mono);font-size:10px;color:var(--ink-faint)}.search-view-all-row{width:100%;border:0;border-top:1px solid var(--hairline);background:var(--bg-subtle);color:var(--accent-text);padding:12px;text-align:left;font:600 11px var(--mono);cursor:pointer}.search-view-all-row:hover,.search-view-all-row:focus-visible{background:var(--bg-subtle);outline:2px solid var(--accent);outline-offset:-2px}@media (max-width: 640px){.search-modal-input{font-size:16px;padding:14px 16px}}.search-ask-row{display:flex;align-items:center;gap:10px;width:100%;padding:10px 12px;border-radius:6px;text-align:left;color:var(--ink)}.search-ask-row:hover{background:var(--bg-subtle)}.search-ask-chip{display:inline-flex;align-items:center;font-family:var(--mono);font-size:10.5px;color:var(--accent-text);background:var(--accent-soft);border-radius:5px;padding:2px 7px;flex:none}.search-ask-text{flex:1;min-width:0;font-family:var(--serif);font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.search-ask-row kbd{font-family:var(--sans);font-size:11px;color:var(--ink-faint);border:1px solid var(--hairline);border-radius:5px;padding:1px 6px}.search-empty-sub{display:block;margin-top:10px;font-family:var(--sans);font-style:normal;font-size:12px;color:var(--ink-faint)}.settings-page-content,.settings-page-loading{min-height:min(680px,calc(100vh - 180px))}.settings-section{border:1px solid var(--hairline);border-radius:10px;padding:20px 22px;margin-top:8px;max-width:760px}.settings-section-title{font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--ink-faint);margin:0 0 14px}.settings-note.settings-note-flush{margin-top:0;padding-top:0;border-top:0}.settings-billing-loading{color:var(--ink-soft);font-size:13px}.settings-billing,.settings-billing-connect{display:flex;flex-direction:column;gap:14px}.settings-provider-grid{display:grid;gap:14px}.settings-provider-card{display:flex;flex-direction:column;gap:14px;padding:16px;border:1px solid var(--hairline);border-radius:8px;background:var(--bg-subtle)}.settings-provider-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.settings-provider-heading h3{margin:0;color:var(--ink);font-size:16px;font-weight:650}.settings-provider-heading p{margin:3px 0 0;color:var(--ink-soft);font-size:12px}.settings-usage-row{display:flex;flex-direction:column;gap:9px;padding:13px;border:1px solid var(--hairline);border-radius:7px;background:var(--bg-elevated)}.settings-usage-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.settings-usage-heading strong{flex-shrink:0;color:var(--ink);font-size:14px}.settings-usage-track{height:7px;overflow:hidden;border-radius:999px;background:var(--hairline)}.settings-usage-track>span{display:block;height:100%;border-radius:inherit;background:var(--accent)}.settings-limit-note{margin:0;color:var(--danger, #b42318);font-size:12px;line-height:1.45}.settings-byok-controls{display:flex;flex-direction:column;gap:10px;padding-top:2px}.settings-byok-controls form{display:flex;flex-direction:column;gap:10px}.settings-byok-controls input{width:100%;border:1px solid var(--hairline-strong);border-radius:7px;padding:10px 12px;color:var(--ink);background:var(--bg-elevated);font:inherit}.settings-fallback-control{display:flex;align-items:flex-start;gap:11px;cursor:pointer}.settings-fallback-control>span{display:flex;flex-direction:column;gap:4px}.settings-fallback-control strong{color:var(--ink);font-size:12px;line-height:1.4}.settings-fallback-control small{color:var(--ink-soft);font-size:11px;line-height:1.45}.settings-plan-row{display:flex;justify-content:space-between;align-items:flex-start;gap:20px}.settings-connected-badge{border-radius:999px;padding:4px 9px;color:var(--accent-text);background:var(--accent-soft);font-size:11px;font-weight:600}.settings-billing-help{color:var(--ink-soft);font-size:11px;margin:0;line-height:1.5}.settings-billing-actions{display:flex;flex-wrap:wrap;gap:8px}.settings-billing-actions .button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:34px;padding:7px 11px;border:1px solid var(--hairline-strong);border-radius:7px;color:var(--ink);background:var(--bg-elevated);font-size:12px;font-weight:600;text-decoration:none}.settings-billing-actions .button:hover{background:var(--bg-subtle)}.settings-billing-actions .button-primary{border-color:var(--accent);color:var(--accent-text);background:var(--accent-soft)}.settings-billing-actions .button:disabled{cursor:not-allowed;opacity:.55}.settings-billing-actions svg{width:12px;height:12px}.settings-token-label{color:var(--ink);font-size:12px;font-weight:600;margin-bottom:-8px}.settings-billing-connect input{width:100%;border:1px solid var(--hairline-strong);border-radius:7px;padding:10px 12px;color:var(--ink);background:var(--bg-elevated);font:inherit}.settings-billing-select{width:100%;min-height:42px;padding:9px 34px 9px 12px;border:1px solid var(--border);border-radius:7px;background:var(--bg-elevated);color:var(--ink);font:inherit}.settings-billing-select:focus{outline:2px solid var(--accent);outline-offset:1px}.settings-billing-select:disabled{cursor:wait;opacity:.7}.settings-billing-connect input:focus{border-color:var(--accent);outline:2px solid var(--accent-soft)}.settings-token-error{color:var(--danger, #b42318);font-size:12px}.theme-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.theme-option{display:flex;align-items:flex-start;gap:10px;min-width:0;padding:12px;border:1px solid var(--hairline);border-radius:7px;background:var(--bg-elevated);color:var(--ink-soft);text-align:left;transition:background .15s,border-color .15s,color .15s}.theme-option:hover{border-color:var(--hairline-strong);background:var(--bg-subtle);color:var(--ink)}.theme-option.is-selected{border-color:var(--accent);background:var(--accent-soft);color:var(--accent-text)}.theme-option:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.theme-option>svg{width:16px;height:16px;margin-top:1px;flex-shrink:0}.theme-option-copy{display:flex;flex-direction:column;gap:2px;min-width:0}.theme-option-label{color:var(--ink);font-size:13px;font-weight:600}.theme-option-desc{color:var(--ink-soft);font-size:11px;line-height:1.35}.theme-option.is-selected .theme-option-label,.theme-option.is-selected .theme-option-desc{color:var(--accent-text)}.settings-row{display:flex;align-items:flex-start;justify-content:space-between;gap:24px}.settings-row-text{display:flex;flex-direction:column;gap:4px;cursor:pointer}.settings-row-label{font-size:15px;font-weight:500;color:var(--ink)}.settings-row-desc{font-size:13px;color:var(--ink-soft);line-height:1.5;max-width:460px}.settings-note{margin-top:16px;padding-top:16px;border-top:1px solid var(--hairline);font-size:13px;color:var(--ink-soft);line-height:1.5}.settings-note-action{margin-top:10px}.research-section-heading{display:flex;align-items:baseline;justify-content:space-between;gap:16px}.research-section-heading .settings-section-title{display:inline-flex;align-items:center;gap:8px}.research-follow-count{border-radius:999px;padding:1px 7px;color:var(--ink-soft);background:var(--bg-subtle);font-size:11px;letter-spacing:0}.research-feed-link{display:inline-flex;align-items:center;gap:5px;flex-shrink:0;color:var(--accent-text);font-size:13px;font-weight:600;text-decoration:none}.research-feed-link:hover{text-decoration:underline;text-underline-offset:2px}.research-feed-link svg{width:14px;height:14px}.research-section-intro{margin:-6px 0 6px}.research-follow-group{margin-top:16px}.research-follow-group-title{display:flex;align-items:center;gap:6px;margin:0 0 6px;color:var(--ink-soft);font-size:12px;font-weight:600}.research-follow-group-title svg{width:14px;height:14px}.research-follow-list{margin:0;padding:0;list-style:none;border:1px solid var(--hairline);border-radius:8px;background:var(--bg-elevated)}.research-follow-row{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:52px;padding:8px 8px 8px 14px}.research-follow-row+.research-follow-row{border-top:1px solid var(--hairline)}.research-follow-text{display:flex;flex-direction:column;gap:1px;min-width:0}.research-follow-text a{overflow:hidden;color:var(--ink);font-size:14px;font-weight:500;text-overflow:ellipsis;white-space:nowrap;text-decoration:none}.research-follow-text a:hover{color:var(--accent-text);text-decoration:underline;text-underline-offset:2px}.research-follow-text span{color:var(--ink-faint);font-size:12px}.research-follow-row.is-unfollowed .research-follow-text a{color:var(--ink-faint);text-decoration:line-through}.research-follow-action{flex-shrink:0;min-height:30px;padding:5px 10px;border:1px solid transparent;border-radius:6px;color:var(--ink-soft);background:transparent;font-size:12px;font-weight:600}.research-follow-action:hover{border-color:var(--hairline-strong);color:var(--danger, #b42318);background:var(--bg-subtle)}.research-follow-action.is-refollow{border-color:var(--accent);color:var(--accent-text);background:var(--accent-soft)}.research-follow-action:disabled{cursor:wait;opacity:.55}.research-follow-action:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.research-follow-empty{margin-top:14px;padding:18px;border:1px dashed var(--hairline-strong);border-radius:8px;color:var(--ink-soft);font-size:13px;line-height:1.5}.research-follow-empty p{margin:0}.research-follow-empty strong{color:var(--ink);font-weight:600}.research-follow-browse{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.research-follow-browse a{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border:1px solid var(--hairline-strong);border-radius:7px;color:var(--ink);background:var(--bg-elevated);font-size:12px;font-weight:600;text-decoration:none}.research-follow-browse a:hover{background:var(--bg-subtle)}.research-follow-browse svg{width:13px;height:13px}.research-email-destination{display:flex;flex-wrap:wrap;align-items:center;gap:8px 10px;margin-top:16px;padding:10px 12px;border:1px solid var(--hairline);border-radius:8px;color:var(--ink-soft);background:var(--bg-subtle);font-size:13px}.research-email-destination>svg{width:15px;height:15px;flex-shrink:0}.research-email-destination strong{color:var(--ink);font-weight:600;overflow-wrap:anywhere}.research-email-destination>span{flex:1 1 220px}.research-email-destination a{color:var(--accent-text);font-size:12px;font-weight:600;text-decoration:none}.research-email-destination a:hover{text-decoration:underline;text-underline-offset:2px}.research-email-status{margin:10px 0 0;color:var(--ink-soft);font-size:12px;line-height:1.5}.research-email-status.is-warning{color:var(--danger, #b42318)}.closed-eval-tooltip-link,.external-eval-tooltip-link{font-weight:600;text-decoration:underline;text-underline-offset:2px}@media (max-width: 640px){.theme-options{grid-template-columns:1fr}}.research-follow{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;margin:14px 0 18px}.research-follow-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:112px;min-height:36px;padding:7px 16px 7px 13px;border:1px solid var(--accent);border-radius:999px;color:var(--bg);background:var(--accent);font-family:var(--sans);font-size:14px;font-weight:600;line-height:1;text-decoration:none;cursor:pointer;box-shadow:0 1px 2px #00000014;transition:background .15s,border-color .15s,color .15s,filter .15s}.research-follow-btn:hover{filter:brightness(1.1)}.research-follow-btn:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.research-follow-btn:disabled{cursor:wait;opacity:.6}.research-follow-btn svg{width:16px;height:16px;flex-shrink:0}.research-follow-btn.is-following{border-color:var(--hairline-strong);color:var(--ink);background:var(--bg-elevated);box-shadow:none}.research-follow-btn.is-following svg{color:var(--accent-text)}.research-follow-label-hover{display:none}@media (hover: hover){.research-follow-btn.is-following:hover{filter:none;border-color:var(--danger, #b42318);color:var(--danger, #b42318)}.research-follow-btn.is-following:hover svg,.research-follow-btn.is-following:hover .research-follow-label{display:none}.research-follow-btn.is-following:hover .research-follow-label-hover{display:inline}}.research-follow-hint{color:var(--ink-soft);font-family:var(--sans);font-size:13px;line-height:1.4}.research-follow-hint a{color:var(--accent-text);font-weight:600;text-decoration:none}.research-follow-hint a:hover{text-decoration:underline;text-underline-offset:2px}.research-follow-hint.is-error{color:var(--danger, #b42318)}.following-intro{max-width:720px;margin:8px auto 32px;padding:28px 30px;border:1px solid var(--hairline);border-radius:12px;background:var(--bg-elevated)}.following-intro h2{margin:0;color:var(--ink);font-family:var(--serif);font-size:26px;font-weight:500;line-height:1.2}.following-intro-lead{margin:10px 0 0;color:var(--ink-soft);font-size:15px;line-height:1.55}.following-intro-topic{display:inline-flex;align-items:center;gap:6px;margin:18px 0 0;min-height:36px;padding:7px 16px;font-size:14px}.following-intro-topic svg{width:15px;height:15px}.following-intro-note{margin:10px 0 0;color:var(--ink-faint);font-size:13px}.following-intro-note a{color:var(--accent-text)}@media (max-width: 640px){.following-intro{padding:22px 18px}}.sidebar-follow-link{display:flex;align-items:center;gap:12px;padding:6px 0}.sidebar-follow-kind{flex:0 0 76px;padding:3px 0;border-radius:6px;color:var(--accent-text);background:var(--accent-soft);font-family:var(--mono);font-size:10px;letter-spacing:.1em;text-align:center;text-transform:uppercase}.sidebar-follow-name{min-width:0;overflow:hidden;color:var(--ink);font-size:14px;text-overflow:ellipsis;white-space:nowrap}.sidebar-follow-link:hover .sidebar-follow-name{text-decoration:underline;text-underline-offset:2px}.sidebar-follow-group{display:flex;flex-direction:column;align-items:flex-start;margin-top:10px}.sidebar-follow-group .sidebar-follow-kind{flex:none;width:76px;margin-bottom:2px}@media (max-width: 880px){.sidebar-follow-link{gap:8px}.sidebar-follow-kind{flex:none;padding:1px 6px}.sidebar-follow-group{display:contents}.sidebar-follow-group .sidebar-follow-kind{width:auto;margin:0;align-self:center}}.sidebar-follow-topic{display:flex;align-items:center;gap:8px}.sidebar-follow-topic .sidebar-follow-link{flex:1;min-width:0}@media (min-width: 881px){.sidebar-follow-link{align-items:flex-start}.sidebar-follow-name{overflow:visible;overflow-wrap:anywhere;white-space:normal;line-height:1.4}.sidebar-follow-topic{align-items:flex-start}.sidebar-follow-topic .sidebar-follow-link{flex-wrap:wrap;row-gap:6px}.sidebar-follow-topic .sidebar-follow-name{flex-basis:100%}.sidebar-follow-topic .sidebar-follow-edit{padding-top:7px}}.sidebar-follow-topic.active .sidebar-follow-kind{color:var(--accent-soft);background:var(--accent-text)}.sidebar-follow-topic.active .sidebar-follow-name{font-weight:600}.sidebar-follow-edit,.no-results .link-button{padding:0;font:inherit}.sidebar-follow-edit{margin-left:auto;color:var(--ink-faint);font-size:12px}.sidebar-follow-edit:hover{color:var(--ink)}.sidebar-follow-manage{display:inline-block;margin-top:8px;color:var(--ink-faint);font-size:12px}.sidebar-follow-manage:hover{color:var(--ink)}.research-topic{margin:4px 0 20px}.research-topic .settings-row-desc{margin:4px 0 10px}.research-topic-form{display:flex;flex-direction:column;gap:8px}.research-topic-input{width:100%;padding:10px 12px;border:1px solid var(--hairline-strong, var(--hairline));border-radius:8px;color:var(--ink);background:var(--bg-elevated);font:inherit;font-size:14px;line-height:1.45;resize:vertical}.research-topic-input:focus{outline:2px solid var(--accent-soft);border-color:var(--accent-text)}.research-topic-actions{display:flex;align-items:center;gap:8px}.research-topic-count{margin-right:auto;color:var(--ink-faint);font-family:var(--mono);font-size:11px}.research-topic-save{min-height:30px;padding:5px 12px;border:0;border-radius:6px;color:#fff;background:var(--accent-text);font-size:12px;font-weight:600}.research-topic-save:disabled{opacity:.45;cursor:default}.research-topic-suggestion{margin:6px 0 0;color:var(--ink-soft);font-size:13px}.topic-dialog{max-width:640px;max-height:calc(100vh - 32px);overflow-y:auto}.topic-dialog-form{display:flex;flex-direction:column;gap:18px}.topic-dialog-title{font-family:var(--serif);font-size:24px;font-weight:500;color:var(--ink)}.topic-dialog-group{display:flex;flex-direction:column;gap:8px}.topic-dialog-group h3{margin:0;color:var(--ink-faint);font-family:var(--sans);font-size:12px;font-weight:600;letter-spacing:.06em;text-transform:uppercase}.topic-dialog-hint{margin:0;color:var(--ink-soft);font-size:13px}.topic-dialog .research-topic-input{min-height:112px;font-size:15px}.topic-dialog .research-topic-count{align-self:flex-end;margin:0}.topic-dialog-chips{display:flex;flex-wrap:wrap;gap:8px}.topic-dialog-chips>[hidden]{display:none}.topic-dialog-chip{display:inline-flex;align-items:center;gap:5px;padding:4px 11px 4px 9px;border:1px solid var(--hairline);border-radius:999px;color:var(--ink-soft);background:transparent;font-size:13px}.topic-dialog-chip svg{width:13px;height:13px}.topic-dialog-chip-image{flex:none;width:20px;height:20px;margin:-2px 1px -2px 0;box-sizing:border-box;border:1px solid var(--hairline);background:#fff}.topic-dialog-chip-image.is-author{border-radius:50%;-o-object-fit:cover;object-fit:cover}.topic-dialog-chip-image.is-organization{border-radius:5px;padding:2px;-o-object-fit:contain;object-fit:contain}.topic-dialog-chip-image.is-initials{display:inline-flex;align-items:center;justify-content:center;color:var(--ink-soft);background:var(--hairline);font-size:9px;font-weight:600;letter-spacing:.02em}.topic-dialog-chip[aria-pressed=false]:hover:not(:disabled){border-color:var(--accent-text);color:var(--accent-text)}.topic-dialog-chip[aria-pressed=true]{border-color:var(--accent-text);color:#fff;background:var(--accent-text)}.topic-dialog-chip[aria-pressed=true]:hover:not(:disabled){opacity:.85}.topic-dialog-chip:disabled{cursor:default;opacity:.6}.topic-dialog-browse{display:inline-flex;align-items:center;gap:4px;padding:4px;color:var(--accent-text);font-size:13px;text-decoration:none}.topic-dialog-browse:hover{text-decoration:underline}.topic-dialog-browse svg{width:13px;height:13px}.topic-dialog-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px}.topic-dialog-remove{margin-right:auto}.topic-dialog-actions .research-topic-save{min-height:36px;padding:7px 18px;font-size:14px}.following-topic-note{margin:0 0 16px;padding:10px 14px;border-radius:8px;color:var(--ink-soft);background:var(--accent-soft);font-size:13px}.reader-route-shell{height:100dvh;min-height:0;display:flex;flex-direction:column;overflow:hidden}.reader-route-shell>.app-header{position:static;flex:0 0 auto}.reader-route-content{min-height:0;flex:1}.paper-reader-shell{height:100%;min-height:0;display:flex;flex-direction:column;background:var(--bg);color:var(--ink);overflow:hidden}.reader-workspace{position:relative;min-height:0;flex:1;display:flex;overflow:hidden}.reader-paper-pane,.reader-assistant-pane{min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden}.reader-paper-pane{background:#fff;transition:width .24s cubic-bezier(.22,1,.36,1)}.reader-assistant-pane{visibility:visible;background:var(--bg);opacity:1;transform:translate(0);transition:width .24s cubic-bezier(.22,1,.36,1),opacity .18s ease,transform .24s cubic-bezier(.22,1,.36,1),visibility 0s}.reader-assistant-pane:focus{outline:none}.reader-assistant-pane.is-collapsed{visibility:hidden;opacity:0;transform:translate(28px);pointer-events:none;transition:width .24s cubic-bezier(.22,1,.36,1),opacity .14s ease,transform .24s cubic-bezier(.22,1,.36,1),visibility 0s linear .24s}.reader-workspace.is-resizing{cursor:col-resize;-webkit-user-select:none;-moz-user-select:none;user-select:none}.reader-workspace.is-resizing .reader-paper-pane,.reader-workspace.is-resizing .reader-assistant-pane{transition:none}.reader-resize-handle{position:relative;z-index:5;width:1px;flex:0 0 1px;cursor:col-resize;background:var(--hairline-strong);touch-action:none;outline:none}.reader-resize-handle:before{content:"";position:absolute;top:0;right:-8px;bottom:0;left:0}.reader-resize-handle:focus-visible{box-shadow:0 0 0 2px var(--accent)}.reader-collapse-assistant{position:absolute;z-index:8;top:0;right:16px;height:48px;display:flex;align-items:center;border:0;padding:0;background:transparent;color:var(--ink);font-size:12px;line-height:1.5}.reader-workspace.is-assistant-collapsed .pdf-toolbar{padding-right:96px}.reader-tabs{height:40px;flex:0 0 auto;display:flex;border-bottom:1px solid var(--border);background:var(--surface)}.reader-tabs button{flex:1;border:0;border-bottom:2px solid transparent;background:transparent;color:var(--ink-muted)}.reader-tabs button[aria-selected=true]{border-bottom-color:var(--accent);color:var(--ink);font-weight:600}.reader-tab-pending{display:inline-block;width:7px;height:7px;margin-left:6px;border-radius:50%;background:var(--accent);vertical-align:1px}@media (forced-colors: active){.reader-tab-pending{border:1px solid ButtonText}}.reader-workspace .is-hidden{position:absolute!important;top:0;right:0;bottom:0;left:0;width:100%!important;visibility:hidden;pointer-events:none}.reader-workspace.is-tabs>.reader-paper-pane,.reader-workspace.is-tabs>.reader-assistant-pane{width:100%}.reader-status{min-height:100dvh;display:grid;place-content:center;gap:12px;text-align:center}.reader-chat-unavailable{height:100%;display:grid;place-content:center;color:var(--ink-muted);padding:24px;text-align:center}.pdf-viewer{min-height:0;flex:1;display:flex;flex-direction:column}.pdf-toolbar{position:relative;min-height:48px;flex:0 0 auto;display:flex;align-items:center;gap:16px;padding:7px 10px 7px var(--reader-title-inset, 32px);border-bottom:1px solid var(--hairline);background:var(--bg);color:var(--ink);font-size:12px}.pdf-toolbar-paper{min-width:0;flex:1;display:flex;align-items:center;gap:10px;overflow:hidden}.pdf-toolbar .pdf-toolbar-back{flex:0 0 auto;height:28px;display:inline-flex;align-items:center;gap:4px;margin-left:-8px;border-radius:6px;padding:0 8px 0 6px;color:var(--ink-soft);font-weight:500;text-decoration:none;white-space:nowrap}.pdf-toolbar .pdf-toolbar-back:hover{background:var(--bg-subtle);color:var(--ink);text-decoration:none}.pdf-toolbar-title{min-width:0;overflow:hidden;color:var(--ink);font-size:14px;font-weight:600;letter-spacing:-.005em;text-overflow:ellipsis;white-space:nowrap}.pdf-toolbar-title:hover{color:var(--accent-text);text-decoration:underline;text-underline-offset:3px}.pdf-toolbar .pdf-toolbar-resource{flex:0 0 auto;height:24px;display:inline-flex;align-items:center;gap:5px;border:1px solid var(--hairline);border-radius:999px;padding:0 9px;background:var(--bg-elevated);color:var(--ink-soft);font-size:11px;font-variant-numeric:tabular-nums;text-decoration:none;white-space:nowrap}.pdf-toolbar .pdf-toolbar-resource:hover{border-color:var(--hairline-strong);color:var(--ink);text-decoration:none}.pdf-toolbar-controls{flex:0 0 auto;display:flex;align-items:center;gap:8px}.pdf-toolbar-group{height:30px;display:flex;align-items:center;gap:1px;border:1px solid var(--hairline);border-radius:8px;padding:1px;background:var(--bg-elevated)}.pdf-toolbar button,.pdf-toolbar-controls a{min-height:30px;display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px solid var(--hairline);border-radius:8px;padding:0 10px;background:var(--bg-elevated);color:var(--ink);font-weight:500;text-decoration:none}.pdf-toolbar button:hover:not(:disabled),.pdf-toolbar-controls a:hover{border-color:var(--hairline-strong);background:var(--bg-subtle)}.pdf-toolbar .pdf-toolbar-group button{width:26px;min-height:26px;height:26px;border:0;border-radius:6px;padding:0;background:transparent;color:var(--ink-soft)}.pdf-toolbar .pdf-toolbar-group button:hover:not(:disabled){background:var(--bg-subtle);color:var(--ink)}.pdf-toolbar-search svg{color:var(--ink-soft)}.pdf-toolbar button[aria-expanded=true]{border-color:var(--hairline-strong);background:var(--bg-subtle)}.pdf-toolbar button:focus-visible,.pdf-toolbar a:focus-visible,.pdf-toolbar input:focus-visible,.pdf-search-controls input:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.pdf-toolbar button:disabled{cursor:default;opacity:.35}.pdf-page-form{display:flex;align-items:baseline;gap:3px;padding:0 4px;color:var(--ink-soft);font-variant-numeric:tabular-nums;white-space:nowrap}.pdf-page-form input{width:30px;height:22px;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;border:1px solid transparent;border-radius:5px;padding:0 2px;background:var(--bg-subtle);color:var(--ink);font:inherit;font-weight:500;text-align:center}.pdf-page-form input:hover,.pdf-page-form input:focus{border-color:var(--hairline-strong);background:var(--bg)}.pdf-page-form input::-webkit-inner-spin-button,.pdf-page-form input::-webkit-outer-spin-button{margin:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.pdf-zoom-value{width:46px;height:22px;border:1px solid transparent;border-radius:5px;padding:0 2px;background:transparent;color:var(--ink);text-align:center;font:inherit;font-weight:500;font-variant-numeric:tabular-nums}.pdf-zoom-value:hover,.pdf-zoom-value:focus{border-color:var(--hairline-strong);background:var(--bg)}.pdf-search-controls{position:absolute;z-index:10;right:8px;top:calc(100% + 5px);display:flex;align-items:center;gap:5px;padding:7px;border:1px solid var(--hairline);border-radius:6px;background:var(--bg-elevated);box-shadow:0 5px 20px #0003}.pdf-search-controls input{width:min(260px,45vw);min-height:30px;border:1px solid var(--hairline);border-radius:4px;padding:4px 7px;background:var(--bg);color:var(--ink)}.pdf-search-controls span{min-width:70px;color:var(--ink-soft);text-align:center}.pdf-search-controls button{display:inline-flex;align-items:center;justify-content:center}.pdf-citation-steps{position:absolute;z-index:10;top:8px;left:50%;display:flex;align-items:center;gap:4px;padding:5px 5px 5px 12px;border:1px solid var(--hairline);border-radius:8px;background:var(--bg-elevated);color:var(--ink);box-shadow:0 5px 20px #0003;font-size:13px;transform:translate(-50%);animation:pdf-citation-steps-in .14s ease-out}.pdf-citation-steps span{margin-right:4px;color:var(--ink-soft);font-variant-numeric:tabular-nums;white-space:nowrap}.pdf-citation-steps button{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:0;border-radius:5px;background:transparent;color:var(--ink);cursor:pointer}.pdf-citation-steps button:hover{background:var(--hairline)}.pdf-citation-steps button:focus-visible{outline:2px solid var(--accent);outline-offset:1px}@keyframes pdf-citation-steps-in{0%{opacity:0;transform:translate(-50%,-6px)}}@media (prefers-reduced-motion: reduce){.pdf-citation-steps{animation:none}}.pdf-scroll-frame{position:relative;min-height:0;flex:1;display:flex;flex-direction:column}.pdf-scroll{min-height:0;flex:1;overflow:auto;overscroll-behavior:contain;background:#fff;scrollbar-color:var(--ink-faint) var(--bg-subtle);scrollbar-gutter:stable}.pdf-scroll::-webkit-scrollbar{width:12px;height:12px}.pdf-scroll::-webkit-scrollbar-track{background:var(--bg-subtle)}.pdf-scroll::-webkit-scrollbar-thumb{border:3px solid var(--bg-subtle);border-radius:999px;background:var(--ink-faint)}.pdf-pages{display:flex;width:-moz-max-content;width:max-content;min-width:100%;flex-direction:column;align-items:center;gap:8px;zoom:var(--pdf-live-scale, 1)}.pdf-page{position:relative;background:#fff}.pdf-page-layer{zoom:var(--pdf-layer-scale, 1)}.pdf-page-layer.is-pending{position:absolute;top:0;left:0;visibility:hidden;pointer-events:none}.pdf-page .react-pdf__Page{margin:0}.pdf-page-snapshot{position:absolute;top:0;right:0;bottom:0;left:0;z-index:2;width:100%;height:100%;pointer-events:none}.pdf-page .textLayer ::-moz-selection{background:#2d7dff4d;color:transparent}.pdf-page .textLayer ::selection{background:#2d7dff4d;color:transparent}.pdf-search-highlight{border-radius:1px;background:#2d7dff57;color:inherit;box-shadow:0 0 0 1px #2d7dff2e}.pdf-search-highlight.is-active{background:#1c68ef85;box-shadow:0 0 0 1px #1c68ef57}.pdf-citation-highlight{position:absolute;z-index:3;border-radius:3px;pointer-events:none;background:#ffc40047;box-shadow:0 0 0 2px #ffaa00b3;animation:pdf-citation-flash 4s ease-out forwards}@keyframes pdf-citation-flash{0%,10%{opacity:0}18%,70%{opacity:1}to{opacity:0}}.pdf-citation-highlight.is-brief{animation:pdf-citation-flash-brief 1.8s ease-out forwards}@keyframes pdf-citation-flash-brief{0%{opacity:0}12%,65%{opacity:1}to{opacity:0}}@media (prefers-reduced-motion: reduce){.pdf-citation-highlight{animation:pdf-citation-flash 4s step-end forwards}.pdf-citation-highlight.is-brief{animation:pdf-citation-flash-brief 1.8s step-end forwards}}.pdf-outline{position:absolute;z-index:9;top:0;right:14px;bottom:0;display:flex;align-items:center;pointer-events:none}.pdf-outline-rail{display:flex;flex-direction:column;align-items:flex-end;justify-content:center;gap:5px;max-height:100%;overflow:hidden;border:0;width:56px;padding:12px 6px 12px 0;background:transparent;cursor:pointer;pointer-events:auto;touch-action:none}.pdf-outline-rail:focus-visible{outline:2px solid var(--accent);outline-offset:-2px;border-radius:6px}.pdf-outline-tick{--pop: 0;--tick-width: 18px;display:block;width:calc(var(--tick-width) + var(--pop) * (34px - var(--tick-width)));height:2px;border-radius:1px;background:var(--ink-faint);transform:scaleY(calc(1 + var(--pop)));transition:background .12s ease,width .18s cubic-bezier(.34,1.56,.64,1),transform .18s cubic-bezier(.34,1.56,.64,1)}.pdf-outline-tick.level-1{--tick-width: 10px}.pdf-outline-tick.is-active{--tick-width: 22px;background:var(--accent)}.pdf-outline-tick.is-scrubbed{background:var(--accent)}.pdf-outline-scrub-label{position:absolute;right:calc(100% - 4px);max-width:min(260px,60vw);overflow:hidden;padding:6px 12px;border:1px solid var(--hairline);border-radius:999px;background:var(--bg-elevated);color:var(--ink);box-shadow:0 6px 20px #0003;font-size:13px;font-weight:600;line-height:1.3;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;transform:translateY(-50%);transition:top 90ms ease;animation:pdf-outline-label-in .16s cubic-bezier(.34,1.56,.64,1)}@keyframes pdf-outline-label-in{0%{opacity:0;transform:translate(8px,-50%) scale(.9)}}.pdf-outline-panel{position:absolute;right:100%;top:50%;width:min(320px,60vw);max-height:min(70vh,100%);overflow-y:auto;margin-right:-6px;padding:10px 6px;border:1px solid var(--hairline);border-radius:12px;background:var(--bg-elevated);color:var(--ink);box-shadow:0 8px 28px #0003;font-size:14px;line-height:1.35;opacity:0;visibility:hidden;transform:translate(6px,-50%);transition:opacity .12s ease,transform .12s ease,visibility 0s linear .12s;pointer-events:none}.pdf-outline:hover .pdf-outline-panel,.pdf-outline:focus-within .pdf-outline-panel,.pdf-outline.is-pinned .pdf-outline-panel{opacity:1;visibility:visible;transform:translateY(-50%);transition-delay:0s;pointer-events:auto}.pdf-outline-panel ol{margin:0;padding:0;list-style:none}.pdf-outline-panel li.level-1 a{padding-left:32px;font-size:13px;color:var(--ink-soft)}.pdf-outline-panel a{display:block;padding:7px 16px;border-radius:6px;color:var(--ink-muted);text-decoration:none;overflow-wrap:anywhere}.pdf-outline-panel a:hover{background:var(--bg-subtle);color:var(--ink);text-decoration:none}.pdf-outline-panel a.is-scrubbed{background:var(--bg-subtle);color:var(--ink);box-shadow:inset 3px 0 0 var(--accent)}.pdf-outline-panel a:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}.pdf-outline-panel a[aria-current=location]{color:var(--accent-text);font-weight:600}@media (hover: none){.pdf-outline:hover:not(.is-pinned) .pdf-outline-panel{opacity:0;visibility:hidden;pointer-events:none}}@media (forced-colors: active){.pdf-outline-tick{background:ButtonText}.pdf-outline-tick.is-active{background:Highlight}}@media (prefers-reduced-motion: reduce){.pdf-outline-panel,.pdf-outline-tick,.pdf-outline-scrub-label{transition:none;animation:none}}.pdf-loading,.pdf-error{min-height:50vh;display:grid;place-content:center;color:var(--ink);text-align:center;padding:24px}.pdf-error a,.pdf-error button{color:inherit}.chat-page--reader .chat-main{min-width:0}.chat-page--reader .chat-topbar{min-height:48px;gap:4px;padding:7px 4px 7px 20px}.chat-page--reader .chat-share-button,.chat-page--reader .chat-topbar-title{margin-right:8px}.chat-reader-icon-btn{width:28px;height:28px}.chat-reader-icon-btn svg{width:15px;height:15px}.chat-page--reader .chat-empty-inner{width:min(100%,560px);padding-inline:16px}.chat-page--reader .chat-examples{width:min(100%,300px);margin-inline:auto;flex-direction:column;align-items:stretch}.chat-page--reader .chat-example{width:100%}.chat-reader-action{border:0;background:transparent;color:var(--accent-text);text-decoration:none;font-size:12px;white-space:nowrap}@media (max-width: 880px){.chat-page--reader .chat-topbar{padding-right:16px}.pdf-toolbar{padding-left:16px}}@media (max-width: 640px){.chat-page--reader .chat-topbar{padding-right:14px}.pdf-zoom-value{display:none}.pdf-toolbar{gap:8px;overflow-x:auto;padding-left:14px}.pdf-toolbar-paper{min-width:150px}.pdf-toolbar-search span{display:none}.pdf-toolbar .pdf-toolbar-search{width:30px;padding:0}}@media (forced-colors: active){.reader-resize-handle,.pdf-toolbar button,.pdf-toolbar a{border:1px solid ButtonText}}@media (prefers-reduced-motion: reduce){.paper-reader-shell *{scroll-behavior:auto!important}.reader-paper-pane,.reader-assistant-pane{transition-duration:.01ms!important}}.pdf-page .linkAnnotation>.pdf-paper-preview-link{position:absolute;top:0;right:0;bottom:0;left:0;display:block;width:100%;height:100%}.pdf-bibliography-link{position:absolute;z-index:2;border-radius:3px}.pdf-bibliography-link>.pdf-paper-preview-link{position:absolute;top:0;right:0;bottom:0;left:0;display:block;border-radius:inherit}.pdf-bibliography-link:hover,.pdf-bibliography-link:focus-within{background:#2563eb14}.pdf-author-link{position:absolute;z-index:2;border-radius:3px}.pdf-author-link>a{position:absolute;top:-1px;right:-2px;bottom:-1px;left:-2px;display:block;border-radius:inherit}.pdf-author-link:hover,.pdf-author-link:focus-within{background:#2563eb1a}.pdf-author-card{display:flex;align-items:center;gap:12px;padding:14px;color:inherit;text-decoration:none}.pdf-author-card:hover .paper-preview-title{color:var(--accent)}.pdf-author-card:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}.pdf-author-card-avatar{width:44px;height:44px;flex:none}.pdf-author-card-meta{min-width:0}.pdf-author-card-meta .paper-preview-title{margin-bottom:2px}.paper-preview-card-link{display:block;color:inherit;text-decoration:none}.paper-preview-card-link:hover .paper-preview-title{color:var(--accent)}.paper-preview-card-link:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}.pdf-paper-preview-actions{display:flex;justify-content:space-between;gap:12px;padding:10px 14px;border-top:1px solid var(--hairline);font-size:12px}.pdf-paper-preview-actions a,.pdf-paper-preview-actions button{color:var(--accent)}.pdf-paper-preview-actions button{border:0;background:transparent;cursor:pointer;padding:0;font:inherit}.pdf-paper-preview-actions a:focus-visible,.pdf-paper-preview-actions button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.reader-web-document{max-width:760px;margin:0 auto;padding:32px 28px 64px;color:#1a1a1a;font-size:16px;line-height:1.65;overflow-wrap:anywhere}.reader-web-document h1{margin:0 0 20px;font-size:28px;line-height:1.25}.reader-web-document h2{margin:32px 0 12px;font-size:22px;line-height:1.3}.reader-web-document h3{margin:24px 0 8px;font-size:18px}.reader-web-document img{max-width:100%;height:auto}.reader-web-document pre{overflow-x:auto;padding:12px;border-radius:6px;background:#f4f4f5;font-size:13px}.reader-web-document table{display:block;max-width:100%;overflow-x:auto;border-collapse:collapse;font-size:14px}.reader-web-document th,.reader-web-document td{padding:6px 10px;border:1px solid #e4e4e7}.reader-web-document a{color:#1c68ef}.reader-web-document ::-moz-selection{background:#2d7dff4d}.reader-web-document ::selection{background:#2d7dff4d}@media (max-width: 640px){.reader-web-document{padding:20px 16px 48px;font-size:15px}}.saved-area-section{margin-top:28px}.saved-area-section:first-of-type{margin-top:4px}.saved-area-heading{font-family:var(--serif);font-size:22px;font-weight:500;color:var(--ink);margin:0 0 6px;padding-bottom:6px;border-bottom:1px solid var(--hairline-strong)}.saved-task-block{margin-top:16px}.saved-task-row{display:flex;align-items:center;gap:10px;margin-bottom:6px}.saved-task-count{font-size:12px;color:var(--ink-faint)}.saved-signin-panel{display:flex;justify-content:center;padding:80px 0}.saved-bucket-migration{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:24px;padding:14px 16px;border:1px solid var(--info-border);border-radius:6px;background:var(--info-bg);color:var(--info-text)}.saved-bucket-migration p{max-width:760px;font-size:13px;line-height:1.5}.saved-bucket-migration .hf-signin-btn{flex-shrink:0;max-width:100%;height:auto;min-height:36px;padding:8px 12px;white-space:normal;overflow-wrap:anywhere}@media (max-width: 700px){.saved-bucket-migration{align-items:flex-start;flex-direction:column}}.action-btn.is-saved{background:var(--ink);color:var(--bg);border-color:var(--ink)}.action-btn.is-saved:hover{background:color-mix(in oklch,var(--ink) 88%,var(--accent))}.ask-home-new{max-width:640px;margin:0 auto 6px;padding-left:9px;color:var(--ink-faint);font-size:14px;font-weight:700}.ask-home{position:relative;max-width:640px;margin:0 auto 36px;background:var(--bg-elevated);border:1px solid var(--hairline);border-radius:14px;box-shadow:0 1px 2px #1e1c140a,0 12px 34px -18px #1e1c1447;padding:8px}.ask-home-row{display:flex;align-items:flex-end;gap:8px}.ask-home-row>.chat-send{flex:none;margin:0 2px 2px 0}.ask-home-textarea-wrap{position:relative;flex:1;min-width:0}.ask-home textarea{position:relative;z-index:1;display:block;width:100%;border:0;outline:0;resize:none;background:transparent;font-family:var(--serif);font-size:17px;line-height:1.45;color:transparent;caret-color:var(--ink);padding:8px 12px}.ask-home textarea::-moz-placeholder{color:var(--ink-faint)}.ask-home textarea::placeholder{color:var(--ink-faint)}.feed-sidebar{display:flex;flex-direction:column;min-height:calc(100dvh - 250px)}.feed-sidebar>.sidebar-section-tools{margin-top:auto;margin-bottom:0}@media (max-width: 880px){.layout-with-sidebar>.sidebar,.layout-with-sidebar>.feed-main{display:contents}.feed-chat{order:1}.sidebar-section-top-domains{order:2}.sidebar-section-trending-domains{order:3}.sidebar-section-follows{order:2}.feed-content{order:4}.sidebar-section-tools{order:5}.feed-sidebar>.sidebar-section-tools{margin-top:0}.feed-content:has(>.following-intro){display:contents}.feed-content:has(>.following-intro)>*{order:4}.feed-content:has(>.following-intro)>.following-intro{order:0;margin:0}}.sidebar-tools-mcp{width:100%;justify-content:space-between;padding:10px 14px;font-size:15px;font-weight:600}.sidebar-tools-mcp:hover{border-color:var(--ink-faint)}.sidebar-tools-copy{font-size:12px;line-height:1.5;color:var(--ink-faint);margin:10px 0 0}.sidebar-tools-copy a{color:var(--ink-soft);text-decoration:underline;text-decoration-style:dotted}.sidebar-tools-copy code{font-family:var(--mono);font-size:11px}.submission-loading,.submission-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;min-height:240px;padding:32px;text-align:center;color:var(--ink-faint)}.submission-loading{min-height:160px;flex-direction:row;font-family:var(--mono);font-size:12px}.submission-empty h1,.submission-empty h2{font-family:var(--serif);font-weight:500;color:var(--ink)}.submission-empty p{max-width:460px;color:var(--ink-soft)}.submission-empty a{color:var(--accent-text);text-decoration:underline}.submission-empty-warn{border:1px solid var(--hairline);border-radius:8px;background:var(--bg-elevated)}.chat-page{position:relative;display:flex;overflow:hidden;background:var(--bg)}.chat-main{flex:1;display:flex;flex-direction:column;min-width:0;background:var(--bg)}.chat-topbar{display:flex;align-items:center;gap:14px;padding:10px 24px;border-bottom:1px solid var(--hairline)}.chat-topbar .icon-btn{flex:none;border-color:transparent;background:transparent;color:var(--ink-soft);transition:background .15s,color .15s}.chat-topbar .icon-btn:hover,.chat-topbar .icon-btn[data-state=open]{background:var(--bg-subtle);color:var(--ink)}.chat-topbar-title{flex:1;min-width:0;font-family:var(--serif);font-size:15px;font-weight:500;letter-spacing:-.005em;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-empty{flex:1;display:flex;align-items:flex-start;justify-content:center;padding:40px 24px;overflow-y:auto}.chat-empty-inner{max-width:680px;width:100%;margin-block:auto;text-align:center}.chat-empty-eyebrow{font-family:var(--mono);font-size:11px;letter-spacing:.16em;text-transform:uppercase;color:var(--ink-faint);margin-bottom:18px}.chat-empty-title{font-family:var(--serif);font-weight:500;font-size:44px;line-height:1.05;letter-spacing:-.02em;margin-bottom:14px}.chat-empty-title em{font-style:italic;font-weight:400;color:var(--accent)}.chat-empty-sub{font-family:var(--serif);font-size:16px;line-height:1.5;color:var(--ink-soft);max-width:520px;margin:0 auto 26px;text-wrap:pretty}.chat-staging-access-note{max-width:560px;margin:-12px auto 18px;color:var(--ink-soft);font-size:13px;line-height:1.45}.chat-staging-badge{flex:none;border:1px solid color-mix(in oklch,var(--accent) 36%,var(--hairline));border-radius:999px;padding:3px 7px;color:var(--accent-text);background:color-mix(in oklch,var(--accent) 7%,var(--bg-elevated));font-family:var(--mono);font-size:10px;font-weight:700;letter-spacing:.08em;line-height:1;text-transform:uppercase}.chat-examples{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;margin-top:24px}.chat-example{font-family:var(--serif);font-size:14px;color:var(--ink-soft);background:var(--bg-elevated);border:1px solid var(--hairline);border-radius:999px;padding:8px 16px;transition:border-color .15s,color .15s}.chat-example:hover{border-color:var(--hairline-strong);color:var(--ink)}.chat-paper-inline-highlight{color:var(--accent-text);text-decoration-line:underline;text-decoration-color:color-mix(in oklch,var(--accent) 40%,transparent);text-decoration-thickness:1px;text-underline-offset:2px}.chat-paper-inline-highlight.is-unavailable{color:var(--negative-text);text-decoration-color:var(--negative-border)}@media (max-width: 900px){.chat-empty-title{font-size:34px}}@media (forced-colors: active){.chat-paper-inline-highlight{outline:1px solid CanvasText}}@media (max-width: 560px){.chat-topbar{padding-inline:14px}}.chat-credits-notice{position:relative;display:flex;align-items:center;justify-content:center;min-height:28px;padding:5px 52px 6px;border-bottom:1px solid var(--hairline);background:var(--bg-subtle);color:var(--ink-soft);font-size:12px;line-height:16px;text-align:center}.chat-credits-notice-close{position:absolute;top:50%;right:20px;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:0;border-radius:4px;background:transparent;color:var(--ink-soft);font-size:16px;line-height:1;cursor:pointer;transform:translateY(-50%)}.chat-credits-notice-close:hover{background:var(--hairline);color:var(--ink)}.chat-credits-notice-close:focus-visible{outline:2px solid var(--accent-text);outline-offset:1px}.chat-sidebar{position:relative;width:var(--chat-sidebar-width, var(--app-leading-column-width));flex:none;background:var(--bg-subtle);border-right:1px solid var(--hairline);display:flex;flex-direction:column;transition:margin-left .2s ease}.chat-sidebar-backdrop{display:none}.chat-sidebar-resize-handle{position:absolute;top:0;right:-4px;bottom:0;z-index:2;width:8px;cursor:col-resize;touch-action:none}.chat-sidebar-resize-handle:after{content:"";position:absolute;top:0;right:3px;bottom:0;left:3px;background:var(--hairline-strong);opacity:0;transition:opacity .15s}.chat-sidebar-resize-handle:hover:after,.chat-sidebar-resize-handle:focus-visible:after{opacity:1}.chat-sidebar-resize-handle:focus-visible{outline:2px solid var(--link);outline-offset:-3px}.chat-sidebar-closed{margin-left:calc(-1 * (var(--chat-sidebar-width, var(--app-leading-column-width)) + 1px))}.chat-sidebar-top{display:flex;align-items:center;gap:8px;padding:14px 12px 8px}.chat-sidebar-top .icon-btn{flex:none}.chat-new-chat{flex:1;display:flex;align-items:center;justify-content:center;gap:8px;padding:9px;background:var(--bg-elevated);border:1px solid var(--hairline);border-radius:8px;font-size:13px;font-weight:500;color:var(--ink);transition:border-color .15s}.chat-new-chat:hover{border-color:var(--hairline-strong)}.chat-sessions{flex:1;overflow-y:auto;padding:4px 8px 20px}.chat-sessions-empty{padding:18px 10px;font-family:var(--serif);font-style:italic;font-size:13px;color:var(--ink-faint)}.chat-session-group{margin-top:14px}.chat-sessions-toggle{margin-top:6px;padding:7px 10px;border-radius:7px;font-family:var(--mono);font-size:11px;color:var(--ink-faint)}.chat-sessions-toggle:hover{background:var(--hairline);color:var(--ink)}.chat-sidebar-tools{flex:none;margin:0;padding:14px 16px 16px;border-top:1px solid var(--hairline)}.chat-session-group-label{font-family:var(--mono);font-size:10px;letter-spacing:.12em;text-transform:uppercase;color:var(--ink-faint);padding:6px 10px}.chat-session{display:flex;align-items:center;gap:6px;width:100%;text-align:left;padding:7px 10px;border-radius:7px;font-size:13px;color:var(--ink-soft);transition:background .12s,color .12s}.chat-session:hover{background:var(--hairline);color:var(--ink)}.chat-session-active{background:var(--hairline);color:var(--ink);font-weight:500}.chat-session-title{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-session-delete{display:inline-flex;align-items:center;color:var(--ink-faint);padding:2px;border-radius:4px;flex:none}.chat-session-delete:hover{color:var(--negative-text)}.chat-session-menu{display:inline-flex;border:0;background:transparent;color:inherit;cursor:pointer;padding:0 3px;font-size:17px;line-height:1}@media (hover: hover) and (pointer: fine){.chat-session-delete,.chat-session-menu{display:none}.chat-session:hover .chat-session-delete,.chat-session:hover .chat-session-menu,.chat-session:focus-within .chat-session-delete,.chat-session:focus-within .chat-session-menu{display:inline-flex}}.chat-session-title-input{min-width:0;flex:1;border:1px solid var(--border);border-radius:4px;background:var(--surface);color:var(--ink);font:inherit;padding:2px 4px}.chat-session-context-menu{position:fixed;z-index:1000;width:150px;padding:4px;border:1px solid var(--border);border-radius:7px;background:var(--surface);box-shadow:0 8px 24px #00000029}.chat-session-context-menu button{width:100%;border:0;border-radius:4px;background:transparent;color:var(--ink);padding:7px 9px;text-align:left;cursor:pointer}.chat-session-context-menu button:hover,.chat-session-context-menu button:focus{background:var(--hairline)}.chat-session-loading,.chat-session-load-error{flex:1;display:flex;align-items:center;justify-content:center;gap:10px;color:var(--ink-soft);font-family:var(--serif);font-size:14px}.chat-session-load-error{flex-direction:column}.chat-session-load-error p{margin:0}.chat-session-load-error button{border:1px solid var(--border);border-radius:5px;padding:7px 12px;background:var(--surface);color:var(--ink);cursor:pointer}.chat-session-load-error button:hover{background:var(--bg-subtle)}@media (max-width: 900px){.chat-sidebar{position:absolute;top:0;bottom:0;left:0;z-index:60;box-shadow:0 0 40px #0003;width:var(--app-leading-column-width)}.chat-sidebar-backdrop{display:block;position:absolute;top:0;right:0;bottom:0;left:0;z-index:59}.chat-sidebar-resize-handle{display:none}.chat-sidebar-closed{margin-left:0;transform:translate(-101%);box-shadow:none}}.chat-share-button{flex:none;display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 12px 0 10px;border:1px solid var(--hairline);border-radius:8px;background:var(--bg-elevated);color:var(--ink);font-size:13px;font-weight:500;transition:border-color .15s,box-shadow .15s}.chat-share-button:hover:not(:disabled){border-color:var(--hairline-strong);box-shadow:0 1px 2px #1a18140f}.chat-share-button:disabled{cursor:not-allowed;opacity:.55}.chat-share-button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.chat-share-button svg{width:14px;height:14px;color:var(--ink-soft)}.chat-share-toast{position:fixed;top:18px;left:50%;width:min(420px,calc(100vw - 32px));transform:translate(-50%)}.chat-share-dialog-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:110;display:grid;place-items:center;padding:20px;background:#0000006b}.chat-share-dialog{width:min(520px,100%);padding:22px;border:1px solid var(--hairline-strong);border-radius:12px;background:var(--bg-elevated);box-shadow:0 18px 60px #00000038}.chat-share-dialog h2{margin:0 0 8px;font-family:var(--serif);font-size:21px}.chat-share-dialog p{margin:0 0 14px;color:var(--ink-soft)}.chat-share-dialog input{width:100%;padding:9px 10px;border:1px solid var(--hairline-strong);border-radius:7px;background:var(--bg);color:var(--ink);font-family:var(--mono);font-size:12px}.chat-share-dialog input:focus{outline:2px solid var(--accent);outline-offset:2px}.chat-share-dialog button{display:block;margin:16px 0 0 auto;padding:7px 14px;border-radius:7px;background:var(--accent);color:#fff;font-weight:600}@media (max-width: 560px){.chat-share-button{width:34px;padding:6px;justify-content:center}.chat-share-button span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}}.chat-capacity-dialog-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:120;display:grid;place-items:center;padding:20px;background:#0000007a}.chat-capacity-dialog{width:min(500px,100%);padding:24px;border:1px solid var(--hairline-strong);border-radius:12px;background:var(--bg-elevated);box-shadow:0 18px 60px #0000003d}.chat-capacity-dialog h2{margin:0 0 9px;font-family:var(--serif);font-size:22px}.chat-capacity-dialog p{margin:0;color:var(--ink-soft);line-height:1.5}.chat-capacity-countdown{min-height:24px;padding-top:12px;font-size:13px}.chat-capacity-dialog-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:20px}.chat-capacity-dialog-actions button{padding:8px 14px;border-radius:7px;font-weight:600}.chat-capacity-cancel{border:1px solid var(--hairline-strong);background:var(--bg);color:var(--ink)}.chat-capacity-retry{background:var(--accent);color:#fff}.chat-capacity-retry:disabled{cursor:not-allowed;opacity:.5}.chat-capacity-dialog-actions button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.chat-paused-banner{margin-bottom:.75rem;border:1px solid var(--border);border-radius:.65rem;background:var(--muted);padding:.7rem .85rem;color:var(--muted-foreground);font-size:.875rem;line-height:1.4}.chat-composer-error{margin-bottom:.75rem;border:1px solid color-mix(in oklch,#c33 35%,var(--hairline));border-radius:.65rem;background:color-mix(in oklch,#c33 8%,var(--bg-elevated));padding:.7rem .85rem;color:var(--ink);font-size:.875rem;line-height:1.4}.chat-billing-notice{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;margin:0 0 10px;padding:9px 11px;border:1px solid color-mix(in oklch,var(--accent) 24%,var(--hairline));border-radius:9px;color:var(--ink-soft);background:color-mix(in oklch,var(--accent) 5%,var(--bg-elevated));font-size:12px;line-height:1.4}.chat-billing-notice a{flex:none;color:var(--accent-text);font-weight:600;text-decoration:none}.chat-billing-notice a:hover{text-decoration:underline}.chat-billing-notice-actions{display:flex;align-items:center;gap:10px;flex:none}.chat-billing-notice-dismiss{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;padding:0;border:0;border-radius:6px;color:var(--ink-soft);background:transparent;cursor:pointer}.chat-billing-notice-dismiss:hover{color:var(--ink);background:color-mix(in oklch,var(--ink) 7%,transparent)}.chat-billing-notice-dismiss:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.ask-home>.chat-paper-picker{top:calc(100% + 6px);bottom:auto}.chat-empty .chat-composer{text-align:left}.chat-composer-wrap{border-top:1px solid var(--hairline);background:var(--bg);padding:14px 28px 16px}.chat-composer-inner{max-width:820px;margin:0 auto}.chat-composer{position:relative;background:var(--bg-elevated);border:1px solid var(--hairline);border-radius:14px;box-shadow:0 1px 2px #1e1c140a,0 10px 30px -20px #1e1c144d;padding:6px}.chat-composer-textarea-wrap{position:relative}.chat-paper-highlight-layer{position:absolute;z-index:0;top:0;right:0;bottom:0;left:0;box-sizing:border-box;overflow:hidden;pointer-events:none;color:transparent}.chat-paper-highlight-layer>div{min-height:100%;white-space:pre-wrap;overflow-wrap:break-word;word-break:break-word;color:var(--ink)}.chat-paper-highlight-layer-composer{padding:12px 12px 4px;font-family:var(--serif);font-size:16px;line-height:1.45}.chat-paper-highlight-layer-editor{padding:9px 11px;font-family:var(--serif);font-size:16px;line-height:1.45}.chat-paper-highlight-layer-home{padding:8px 12px;font-family:var(--serif);font-size:17px;line-height:1.45}.chat-prompt-completion{color:var(--ink-faint)}.chat-paper-picker{position:absolute;z-index:50;left:8px;bottom:calc(100% + 6px);width:min(560px,calc(100vw - 48px));max-height:384px;overflow-y:auto;border:1px solid var(--hairline-strong);border-radius:11px;background:var(--bg-elevated);box-shadow:0 16px 38px -16px #1e1c1473}.chat-slash-command{position:absolute;z-index:50;left:8px;bottom:calc(100% + 6px);display:flex;width:min(560px,calc(100vw - 48px));min-height:52px;align-items:center;gap:10px;padding:9px 12px;border:1px solid var(--hairline-strong);border-radius:11px;color:var(--ink);background:var(--bg-elevated);box-shadow:0 16px 38px -16px #1e1c1473;text-align:left}.chat-slash-command:hover{background:var(--accent-soft)}.chat-slash-command span{color:var(--ink-faint);font-size:12px}.chat-paper-picker-status{padding:10px 12px;color:var(--ink-faint);font-size:12px}.chat-paper-option{display:flex;width:100%;min-height:64px;flex-direction:column;justify-content:center;gap:3px;padding:9px 12px;border:0;border-top:1px solid var(--hairline);color:var(--ink);background:transparent;text-align:left}.chat-paper-option.is-active,.chat-paper-option:hover{background:var(--accent-soft)}.chat-paper-option-title{font-family:var(--serif);font-size:14px;line-height:1.25}.chat-paper-option-meta{color:var(--ink-faint);font-family:var(--mono);font-size:10.5px}.chat-paper-mention-message{padding:3px 12px;color:var(--negative-text);font-size:11.5px}.chat-inline-paper-mention{display:inline}.chat-inline-paper-mention svg{display:inline-block;margin-right:3px;color:var(--accent-text);vertical-align:-.12em}.chat-inline-paper-link{color:var(--accent-text);font-weight:600;text-decoration-line:underline;text-decoration-color:color-mix(in oklch,var(--accent) 40%,transparent);text-decoration-thickness:1px;text-underline-offset:2px}.chat-inline-paper-link:hover{text-decoration-color:var(--accent-text)}.chat-user-link{cursor:pointer;color:var(--accent-text);text-decoration-line:underline;text-decoration-color:color-mix(in oklch,var(--accent) 40%,transparent);text-decoration-thickness:1px;text-underline-offset:2px}.chat-user-link:hover{text-decoration-color:var(--accent-text)}.chat-composer textarea{position:relative;z-index:1;width:100%;border:0;outline:0;resize:none;background:transparent;font-family:var(--serif);font-size:16px;line-height:1.45;color:transparent;caret-color:var(--ink);padding:12px 12px 4px}.chat-composer textarea::-moz-placeholder{color:var(--ink-faint)}.chat-composer textarea::placeholder{color:var(--ink-faint)}.chat-composer-row{display:flex;align-items:center;justify-content:space-between;padding:2px 6px 4px}.chat-composer-tools{display:flex;align-items:center;flex-wrap:wrap;gap:12px}.chat-composer-hint{font-size:11.5px;color:var(--ink-faint)}.chat-composer-foot{display:flex;align-items:center;justify-content:center;gap:6px;text-align:center;font-size:11.5px;color:var(--ink-faint);margin-top:9px}.chat-provider-attribution{white-space:nowrap}.chat-send{display:flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:10px;background:var(--hairline);color:var(--bg-elevated);cursor:not-allowed;transition:background .15s;flex:none}.chat-send-on{background:var(--ink);cursor:pointer}.chat-send-on:hover{background:color-mix(in oklch,var(--ink) 88%,var(--accent))}@media (max-width: 900px){.chat-composer-wrap{padding:12px 16px 14px}.chat-composer-foot,.chat-composer-hint{display:none}}@media (prefers-reduced-motion: reduce){.chat-paper-option{scroll-behavior:auto}}@media (forced-colors: active){.chat-paper-option.is-active,.chat-inline-paper-link{outline:1px solid CanvasText}.chat-paper-selection,.chat-paper-selection-remove,.chat-paper-selection-toggle{border:1px solid ButtonText}}.chat-paper-selection{margin:6px 6px 0;padding:8px 10px;border:1px solid var(--hairline);border-radius:10px;background:var(--bg-subtle);text-align:left}.chat-paper-selection-header{display:flex;align-items:center;justify-content:space-between;gap:8px}.chat-paper-selection-label{color:var(--ink-soft);font-size:11px;font-weight:600;letter-spacing:.02em;text-transform:uppercase}.chat-paper-selection-actions{display:flex;align-items:center;gap:6px}.chat-paper-selection-toggle,.chat-paper-selection-remove{border:0;padding:2px 6px;background:transparent;color:var(--accent-text);font-size:11.5px}.chat-paper-selection-quote{display:-webkit-box;max-height:4.35em;margin:6px 0 0;overflow:hidden;color:var(--ink);font-family:var(--serif);font-size:13px;line-height:1.45;white-space:pre-wrap;-webkit-box-orient:vertical;-webkit-line-clamp:3}.chat-paper-selection-quote.is-expanded{display:block;max-height:8.5em;overflow:auto;-webkit-line-clamp:unset}.chat-paper-selection-disabled{padding:4px 12px 0;color:var(--negative-text);font-size:11.5px}.chat-paper-link{color:var(--accent-text);border-bottom:1px solid color-mix(in oklch,var(--accent-text) 35%,transparent);white-space:normal}.chat-paper-link:hover{border-bottom-color:var(--accent-text)}.chat-hf-link:after{content:" 🤗";font-size:.85em;white-space:nowrap}.chat-github-link{color:var(--accent-text);border-bottom:1px solid color-mix(in oklch,var(--accent-text) 35%,transparent)}.chat-github-link:hover{border-bottom-color:var(--accent-text)}.chat-github-link svg{display:inline-block;width:1em;height:1em;margin-right:.3em;vertical-align:-.14em}.chat-external-link{color:var(--accent-text);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}.chat-external-link:hover{text-decoration-thickness:2px}.chat-web-citation{color:var(--accent-text);text-decoration:underline;text-decoration-style:dotted;text-underline-offset:2px}.chat-external-paper-citation{color:var(--chat-link);text-decoration:underline;text-decoration-color:color-mix(in srgb,var(--chat-link) 35%,transparent);text-underline-offset:2px}.external-paper-preview-pop.external-paper-preview-pop{width:min(390px,calc(100vw - 24px));padding:0;overflow:hidden;border-color:var(--chat-border);background:var(--chat-surface);color:var(--chat-text)}.external-paper-preview-card{padding:14px}.external-paper-preview-source{display:flex;gap:6px;margin-bottom:7px;color:var(--chat-muted);font-size:12px}.external-paper-preview-card strong{display:block;color:var(--chat-text);font-size:14px;line-height:1.35}.external-paper-preview-card p{margin:7px 0 0;color:var(--chat-muted);font-size:12px;line-height:1.45;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4;overflow:hidden}.external-paper-preview-authors{-webkit-line-clamp:2!important}.external-paper-preview-citations{display:block;margin-top:9px;color:var(--chat-muted);font-size:11px}.web-preview-pop.web-preview-pop{width:min(360px,calc(100vw - 24px));padding:0;overflow:hidden;border:1px solid var(--hairline);border-radius:12px;background:var(--bg-elevated);color:var(--ink);box-shadow:0 14px 44px -12px #1e1c1466}.web-preview-card{display:flex;flex-direction:column}.web-preview-image{display:block;width:100%;height:174px;-o-object-fit:cover;object-fit:cover;background:var(--bg-subtle);border-bottom:1px solid var(--hairline)}.web-preview-meta{padding:13px 14px 14px;min-width:0}.web-preview-source{display:flex;align-items:center;gap:5px;margin-bottom:6px;color:var(--ink-faint);font-size:11px}.web-preview-source img{width:14px;height:14px;border-radius:3px}.web-preview-meta strong{display:block;font-family:var(--serif);font-size:15px;font-weight:500;line-height:1.3}.web-preview-meta p{display:-webkit-box;overflow:hidden;margin:7px 0 0;color:var(--ink-soft);font-size:12px;line-height:1.4;-webkit-box-orient:vertical;-webkit-line-clamp:3}.paper-preview-pop.paper-preview-pop{width:min(344px,calc(100vw - 24px));padding:0;border:1px solid var(--hairline);border-radius:12px;background:var(--bg-elevated);color:var(--ink);box-shadow:0 14px 44px -12px #1e1c1466;overflow:hidden}.paper-preview-inner{display:flex;gap:14px;padding:14px}.paper-preview-meta{min-width:0;flex:1}.paper-preview-title{font-family:var(--serif);font-weight:500;font-size:15px;line-height:1.25;margin-bottom:5px}.paper-preview-auth{font-size:12px;color:var(--ink-soft);line-height:1.35}.paper-preview-venue{font-size:11.5px;color:var(--ink-faint);margin-top:3px;font-variant-numeric:tabular-nums}.paper-preview-tags{display:flex;flex-wrap:wrap;gap:5px;margin:9px 0}.paper-preview-tag{font-size:10.5px;font-family:var(--mono);background:var(--positive-bg);color:var(--positive-text);border-radius:5px;padding:2px 7px}.paper-preview-status{min-height:48px;padding:14px;display:flex;align-items:center;color:var(--ink-soft);font-size:12px}.paper-preview-index-request{flex-wrap:wrap;gap:6px 12px}.paper-preview-index-request a,.paper-preview-index-request button{color:var(--accent);font:inherit;border:0;background:transparent;padding:0;cursor:pointer}.paper-preview-index-request button:disabled{color:var(--ink-soft);cursor:default}.paper-preview-index-request a:focus-visible,.paper-preview-index-request button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.paper-preview-index-request [role=alert]{flex-basis:100%;color:var(--negative-text, var(--ink-soft))}.paper-preview-thumb{position:relative;width:96px;height:124px;flex:none;background:var(--bg-elevated);border:1px solid var(--hairline);border-radius:3px;box-shadow:0 1px 3px #1e1c1414;overflow:hidden;padding:11px 10px}.paper-preview-thumb-real{padding:0}.paper-preview-thumb-real img{display:block;width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.paper-preview-thumb-title{display:flex;flex-direction:column;align-items:center;gap:3px;margin-bottom:8px}.paper-preview-thumb-title span{height:3px;background:var(--ink);border-radius:2px}.paper-preview-thumb-title span:first-child{width:70%}.paper-preview-thumb-title span:last-child{width:52%}.paper-preview-thumb-auth{height:2px;width:40%;margin:0 auto 9px;background:var(--ink-faint);border-radius:2px}.paper-preview-thumb-cols{display:flex;gap:7px}.paper-preview-thumb-col{flex:1;height:74px;background:repeating-linear-gradient(var(--hairline-strong) 0 2px,transparent 2px 5px);opacity:.7}.paper-preview-thumb-fig{position:absolute;left:14px;right:14px;height:22px;background:var(--bg-subtle);border:1px solid var(--hairline);border-radius:2px}.hf-preview-pop.hf-preview-pop{width:min(172px,calc(100vw - 24px));padding:0;border:1px solid var(--hairline);border-radius:12px;background:var(--bg-elevated);color:var(--ink);box-shadow:0 14px 44px -12px #1e1c1466;overflow:hidden}.hf-preview-card{display:grid}.hf-preview-image,.hf-preview-fallback{display:block;width:100%;aspect-ratio:2 / 1;-o-object-fit:cover;object-fit:cover;background:var(--bg-subtle)}.hf-preview-fallback{display:grid;place-items:center;font-size:48px;background:radial-gradient(circle at 70% 35%,rgba(84,104,255,.4),transparent 45%),linear-gradient(135deg,#0f6d79,#d18a48)}.hf-preview-meta{display:grid;gap:3px;padding:12px 14px 14px}.hf-preview-meta strong{overflow-wrap:anywhere;font-size:14px}.hf-preview-kind,.hf-preview-meta>span:last-child{color:var(--ink-faint);font-size:11.5px}.github-preview-pop.github-preview-pop{width:min(344px,calc(100vw - 24px));padding:0;border:1px solid var(--hairline);border-radius:12px;background:var(--bg-elevated);color:var(--ink);box-shadow:0 14px 44px -12px #1e1c1466;overflow:hidden}.github-preview-card{display:flex;gap:14px;padding:14px}.github-preview-image,.github-preview-fallback{display:block;width:72px;height:72px;flex:none;-o-object-fit:cover;object-fit:cover;border-radius:12px;background:var(--bg-subtle)}.github-preview-fallback{display:grid;place-items:center;color:#fff;background:linear-gradient(135deg,#24292f,#57606a)}.github-preview-fallback svg{width:36px;height:36px}.github-preview-meta{display:grid;gap:3px;min-width:0}.github-preview-meta strong{overflow-wrap:anywhere;font-size:14px}.github-preview-kind,.github-preview-meta>span:last-child{color:var(--ink-faint);font-size:11.5px}.github-preview-description{display:-webkit-box;overflow:hidden;color:var(--ink-soft);font-size:12px;line-height:1.35;-webkit-box-orient:vertical;-webkit-line-clamp:2}.github-preview-stats{font-variant-numeric:tabular-nums}.catalog-preview-pop.catalog-preview-pop{width:min(320px,calc(100vw - 24px));padding:0;border:1px solid var(--hairline);border-radius:12px;background:var(--bg-elevated);color:var(--ink);box-shadow:0 14px 44px -12px #1e1c1466;overflow:hidden}.catalog-preview-card{display:grid}.catalog-preview-image{display:block;width:100%;aspect-ratio:2 / 1;-o-object-fit:cover;object-fit:cover;background:var(--bg-subtle);border-bottom:1px solid var(--hairline)}.catalog-preview-meta{display:grid;gap:3px;padding:12px 14px 14px}.catalog-preview-meta strong{font-family:var(--serif);font-weight:500;font-size:15px;line-height:1.25}.catalog-preview-meta p{display:-webkit-box;overflow:hidden;margin:3px 0 0;color:var(--ink-soft);font-size:12px;line-height:1.4;-webkit-box-orient:vertical;-webkit-line-clamp:3}.catalog-preview-kind,.catalog-preview-stats{color:var(--ink-faint);font-size:11.5px;font-variant-numeric:tabular-nums}.catalog-preview-stats{margin-top:4px}.chat-pdf-citation{position:relative;display:inline-flex;align-items:center;gap:4px;margin:0 1px;padding:1px 8px;border:1px solid color-mix(in oklch,var(--accent-text) 30%,transparent);border-radius:999px;background:color-mix(in oklch,var(--accent-text) 7%,transparent);color:var(--accent-text);font:inherit;font-size:.86em;line-height:1.5;vertical-align:baseline;cursor:pointer}.chat-pdf-citation:hover,.chat-pdf-citation:focus-visible{border-color:var(--accent-text)}.chat-pdf-citation>svg{width:.95em;height:.95em;flex:none}.chat-pdf-citation-preview{position:absolute;bottom:calc(100% + 6px);left:0;z-index:20;display:none;width:min(320px,70vw);padding:8px 10px;border:1px solid var(--hairline);border-radius:8px;background:var(--bg-elevated);color:var(--ink);box-shadow:0 14px 44px -12px #1e1c1466;font-size:.92em;line-height:1.45;text-align:left;white-space:normal}.chat-pdf-citation-preview.is-below{top:calc(100% + 6px);bottom:auto}.chat-pdf-citation-preview strong{display:block;margin-bottom:2px;color:var(--ink-faint);font-weight:600}.chat-pdf-citation:hover .chat-pdf-citation-preview,.chat-pdf-citation:focus-visible .chat-pdf-citation-preview{display:block}.chat-pdf-sources{margin-top:10px;color:var(--ink-faint);font-size:.88em}.chat-pdf-sources summary{cursor:pointer;width:-moz-fit-content;width:fit-content}.chat-pdf-sources ol{margin:6px 0 0;padding-left:1.4em}.chat-pdf-sources li{margin:3px 0}.chat-pdf-sources button{display:flex;gap:8px;width:100%;padding:0;border:0;background:none;color:var(--ink);font:inherit;text-align:left;cursor:pointer}.chat-pdf-sources button:hover>span:last-child{text-decoration:underline}.chat-pdf-sources-page{flex:none;color:var(--accent-text);font-variant-numeric:tabular-nums}.chat-artifact-card{width:min(100%,620px);display:flex;gap:14px;align-items:stretch;padding:0;overflow:hidden;text-align:left;color:var(--chat-text, #182230);background:#fff;border:1px solid #d8dee8;border-radius:14px;box-shadow:0 5px 18px #0f172a12}button.chat-artifact-card{cursor:pointer}.chat-artifact-card.is-selected{border-color:var(--accent);box-shadow:0 0 0 2px color-mix(in oklch,var(--accent) 22%,transparent)}.chat-artifact-card>img{width:190px;aspect-ratio:5 / 3;-o-object-fit:cover;object-fit:cover;background:#eef1f5}.chat-artifact-card-copy{display:flex;min-width:0;flex:1;flex-direction:column;justify-content:center;gap:7px;padding:14px 14px 14px 0}.chat-artifact-card-copy strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-artifact-kicker{display:flex;align-items:center;gap:6px;color:#637083;font-size:12px}.chat-artifact-kicker svg{width:14px;height:14px}.chat-artifact-gate{width:-moz-fit-content;width:fit-content;padding:3px 8px;border-radius:999px;color:#11643b;background:#e7f7ee;font-size:11px;font-weight:650}.chat-artifact-gate-warnings{color:#7a4a00;background:#fff3d6}.chat-artifact-gate-failed{color:#9b2c2c;background:#fee9e7}.chat-artifact-generating,.chat-artifact-error{align-items:center;padding:16px}.chat-artifact-generating span:not(.chat-artifact-pulse),.chat-artifact-error span{display:flex;flex-direction:column;gap:3px}.chat-artifact-generating small,.chat-artifact-error small{color:#687386}.chat-artifact-error{border-color:#efb7b1}.chat-artifact-error>svg{width:24px;color:#b3372d}.chat-artifact-pulse{width:22px;height:22px;border:3px solid #d7dde8;border-top-color:#5367d9;border-radius:50%;animation:chat-artifact-spin .8s linear infinite}@keyframes chat-artifact-spin{to{transform:rotate(360deg)}}.chat-artifact-workspace{position:relative;min-width:0;min-height:0;flex:1;display:flex;overflow:hidden}.chat-artifact-workspace-content{min-width:0;min-height:0;flex:1;display:flex;overflow:hidden}.chat-artifact-workspace-chat>.chat-artifact-workspace-content>.chat-main{width:100%}.chat-artifact-workspace-shared{min-height:0}.chat-artifact-workspace-shared>.chat-artifact-workspace-content{overflow:auto}.chat-artifact-workspace-reader{height:100%}.chat-artifact-workspace-reader>.chat-artifact-workspace-content>.reader-workspace{width:100%}.chat-artifact-workspace-pane{min-width:0;min-height:0;flex:none;display:flex;overflow:hidden}.chat-artifact-resize-handle{position:relative;z-index:7;width:1px;flex:0 0 1px;cursor:col-resize;background:var(--hairline-strong);touch-action:none;outline:none}.chat-artifact-resize-handle:before{content:"";position:absolute;top:0;right:-8px;bottom:0;left:-8px}.chat-artifact-resize-handle:focus-visible{box-shadow:0 0 0 2px var(--accent)}.chat-artifact-panel{width:100%;height:100%;min-width:0;min-height:0;display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;overflow:hidden;color:var(--ink);background:#f6f7f9;border-left:1px solid var(--hairline)}.chat-artifact-panel.is-dialog{position:fixed;z-index:1200;top:0;right:0;bottom:0;left:0;border:0}.chat-artifact-panel.is-reader-fallback{position:absolute}.chat-artifact-panel header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;background:#fff;border-bottom:1px solid #dce1e8}.chat-artifact-panel header span{color:#6d7788;font-size:12px;text-transform:uppercase;letter-spacing:.06em}.chat-artifact-panel h2{margin:2px 0 0;font-size:18px}.chat-artifact-panel header button{display:grid;place-items:center;width:36px;height:36px;border:0;border-radius:8px;background:transparent;cursor:pointer}.chat-paper-status{margin:4px 0 0;color:#687386;font-size:12px}.chat-artifact-header-actions{display:flex;align-items:center;gap:6px}.chat-artifact-header-actions>button:first-child{width:auto;min-height:36px;padding:7px 10px;border:1px solid #cfd6e4;color:#253143;background:#fff;font-size:12px}.chat-artifact-version{display:flex;align-items:center;gap:7px;margin-left:auto;margin-right:8px;color:#687386;font-size:12px}.chat-artifact-version select{padding:6px 8px;border:1px solid #cfd6e4;border-radius:7px;background:#fff}.chat-artifact-panel>nav{position:sticky;z-index:1;top:0;display:flex;gap:4px;padding:8px 18px 0;background:#fff}.chat-artifact-panel nav button{padding:9px 14px;border:0;border-bottom:2px solid transparent;color:#667085;background:transparent;cursor:pointer}.chat-artifact-panel nav button.active{color:#273a91;border-bottom-color:#5367d9;font-weight:650}.chat-artifact-panel button:focus-visible,.chat-artifact-panel a:focus-visible,.chat-artifact-panel input:focus-visible,.latex-source-editor .cm-content:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.chat-artifact-panel-body{min-height:0;display:grid;place-items:center;overflow:auto;padding:20px}.chat-artifact-panel-body>.pdf-viewer{align-self:stretch;justify-self:stretch;width:100%;height:100%}.chat-artifact-panel-body>img{max-width:100%;max-height:100%;-o-object-fit:contain;object-fit:contain;background:#fff;box-shadow:0 4px 22px #0f172a1f}.chat-artifact-panel-body>pre{align-self:stretch;justify-self:stretch;overflow:auto;margin:0;padding:18px;color:#d8dee9;background:#18202c;border-radius:10px;font-size:12px;white-space:pre-wrap}.chat-artifact-source-workspace{width:100%;height:100%;min-height:0;display:flex;overflow:hidden;border-radius:10px;background:#18202c}.chat-artifact-source-workspace>nav{width:min(180px,28%);flex:none;display:flex;flex-direction:column;overflow:auto;padding:10px;border-right:1px solid #ffffff24}.chat-artifact-source-workspace>nav button{overflow:hidden;border:0;padding:7px 8px;color:#aeb8c8;background:transparent;text-align:left;text-overflow:ellipsis;white-space:nowrap}.chat-artifact-source-workspace>nav button[aria-pressed=true]{color:#fff;background:#ffffff14}.chat-artifact-source-workspace>pre{min-width:0;flex:1;overflow:auto;margin:0;padding:18px;color:#d8dee9;font-size:12px;white-space:pre-wrap}.latex-editor-column{min-width:0;flex:1;display:flex;flex-direction:column;color:#d8dee9}.latex-source-editor{min-width:0;min-height:0;flex:1;overflow:auto}.latex-source-editor .cm-editor{height:100%;min-height:320px;font-size:13px}.latex-source-editor .cm-scroller{overflow:auto;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.latex-file-action{display:flex;align-items:center;gap:6px;margin-top:8px}.latex-file-action svg,.latex-file-buttons svg{width:14px;height:14px}.latex-file-buttons{display:flex;gap:8px;padding:8px;border-top:1px solid #ffffff24}.latex-file-buttons button,.chat-artifact-actions button{display:inline-flex;align-items:center;gap:7px;border:0;border-radius:7px;padding:8px 10px;cursor:pointer}.chat-artifact-actions button:disabled{cursor:not-allowed;opacity:.55}.chat-artifact-panel footer{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;padding:14px 20px;background:#fff;border-top:1px solid #dce1e8}.chat-artifact-metadata{display:flex;min-width:0;flex-direction:column;gap:3px;color:#687386;font-size:12px}.chat-artifact-metadata strong{color:#253143}.chat-artifact-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px}.chat-artifact-actions a{display:inline-flex;align-items:center;gap:5px;padding:8px 10px;color:#263b94;border:1px solid #cfd6e4;border-radius:8px;text-decoration:none;font-size:12px;font-weight:600}.chat-artifact-actions svg{width:14px;height:14px}.paper-pdf-toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;width:100%;padding:8px;border-bottom:1px solid #dce1e8;background:#fff}.paper-pdf-toolbar-group{display:flex;align-items:center;gap:6px}.paper-pdf-toolbar button,.paper-pdf-toolbar input,.paper-pdf-toolbar a{min-height:32px;border:1px solid #cfd6e4;border-radius:7px;padding:5px 8px;color:#253143;background:#fff;font-size:12px;text-decoration:none}.paper-pdf-toolbar input{width:56px}.paper-pdf-toolbar button:disabled{cursor:not-allowed;opacity:.55}@media (max-width: 700px){.chat-artifact-card>img{width:120px}.chat-artifact-panel{width:100vw;height:100dvh}.chat-artifact-panel footer{align-items:stretch;flex-direction:column}.chat-artifact-actions{justify-content:flex-start}.chat-artifact-panel header{padding:12px 14px}.chat-artifact-header-actions>button:first-child{padding-inline:8px}.paper-pdf-toolbar{align-items:flex-start;flex-direction:column}}@media (forced-colors: active){.chat-artifact-resize-handle,.chat-artifact-card.is-selected{border:1px solid ButtonText}}@media (prefers-reduced-motion: reduce){.chat-artifact-pulse{animation-duration:.01ms}}.chat-ghost-link{color:var(--ink-soft);font-size:13px;padding:6px 10px;border-radius:6px}.chat-ghost-link:hover{color:var(--ink);background:var(--bg-subtle)}.chat-conversation-viewport{position:relative;display:flex;flex-direction:column;flex:1;min-height:0}.chat-conversation{flex:1;min-height:0;overflow-y:auto}.chat-jump-latest{position:absolute;bottom:12px;left:50%;transform:translate(-50%);border:1px solid var(--border);border-radius:20px;padding:8px 14px;background:var(--bg);color:var(--ink);box-shadow:0 2px 8px #0000001f;white-space:nowrap;cursor:pointer}.chat-conversation-inner{max-width:820px;margin:0 auto;padding:30px 28px 40px}.chat-msg{margin-bottom:26px}.chat-msg-user{display:flex;justify-content:flex-end}.chat-user-message-wrap{display:flex;flex-direction:column;align-items:flex-end;max-width:74%}.chat-bubble{background:var(--accent-soft);color:var(--ink);border:1px solid color-mix(in oklch,var(--accent-soft) 70%,var(--hairline));border-radius:16px 16px 4px;padding:12px 18px;font-family:var(--serif);font-size:16px;line-height:1.45;max-width:100%;white-space:pre-wrap;overflow-wrap:anywhere;-webkit-user-select:text;-moz-user-select:text;user-select:text;cursor:text}.chat-bubble::-moz-selection,.chat-bubble *::-moz-selection{background:var(--accent);color:var(--bg)}.chat-bubble::selection,.chat-bubble *::selection{background:var(--accent);color:var(--bg)}.chat-user-actions{display:flex;justify-content:flex-end;gap:2px;min-height:30px;padding:4px 2px 0;opacity:0;transform:translateY(-2px);transition:opacity .14s ease,transform .14s ease;-webkit-user-select:none;-moz-user-select:none;user-select:none}.chat-msg-user:hover .chat-user-actions,.chat-msg-user:focus-within .chat-user-actions{opacity:1;transform:translateY(0)}.chat-user-action{width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:999px;color:var(--ink-soft);background:transparent}.chat-user-action:hover{color:var(--ink);background:var(--bg-elevated);border-color:var(--hairline)}.chat-user-action:focus-visible{outline:2px solid var(--accent);outline-offset:2px;opacity:1}.chat-user-action svg{width:14px;height:14px}.chat-inline-editor{width:min(620px,74%);min-width:min(360px,100%);padding:12px;border:1px solid color-mix(in oklch,var(--accent) 45%,var(--hairline));border-radius:16px 16px 4px;background:var(--accent-soft);box-shadow:0 8px 28px #00000014}.chat-inline-editor-textarea{position:relative;z-index:1;display:block;width:100%;min-height:72px;padding:8px 10px;resize:none;border:1px solid var(--hairline-strong);border-radius:10px;color:var(--ink);background:transparent;font-family:var(--serif);font-size:16px;line-height:1.45;white-space:pre-wrap}.chat-inline-editor-textarea-wrap{position:relative;background:var(--bg-elevated);border-radius:10px}.chat-inline-editor-textarea-wrap .chat-inline-editor-textarea{color:transparent;caret-color:var(--ink)}.chat-inline-editor-textarea:focus{outline:2px solid var(--accent);outline-offset:1px}.chat-inline-editor-notice{margin:8px 2px 0;color:var(--ink-soft);font-size:12.5px;line-height:1.4}.chat-inline-editor-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:10px}.chat-inline-editor-actions button{min-height:34px;padding:6px 14px;border:1px solid var(--hairline-strong);border-radius:999px;color:var(--ink);background:var(--bg-elevated);font-size:13px;font-weight:600}.chat-inline-editor-actions button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.chat-inline-editor-actions .chat-inline-editor-send{color:#fff;border-color:var(--accent);background:var(--accent)}.chat-inline-editor-actions button:disabled{cursor:not-allowed;opacity:.5}.chat-msg-blocks{display:flex;flex-direction:column;gap:14px}.chat-waiting{min-height:20px;display:flex;align-items:center;font-size:13px;font-weight:600}.chat-thinking{color:transparent;background:linear-gradient(100deg,var(--ink-faint) 30%,var(--accent-text) 50%,var(--ink-faint) 70%);background-size:220% 100%;background-clip:text;-webkit-background-clip:text;animation:chat-thinking-glow 1.8s ease-in-out infinite}@keyframes chat-thinking-glow{0%{background-position:100% 0}to{background-position:-100% 0}}@media (prefers-reduced-motion: reduce){.chat-thinking{color:var(--accent-text);background:none;animation:none}}.chat-reason-live{border:1px solid var(--hairline);border-left:2px solid var(--accent);background:var(--bg-elevated);border-radius:10px;padding:14px 16px}.chat-reason-live-head{display:flex;align-items:center;gap:9px;font-size:12.5px;font-weight:600;color:var(--accent-text)}.chat-reason-live-body{margin-top:9px;font-family:var(--serif);font-size:14.5px;line-height:1.6;color:var(--ink-soft)}.chat-reason-done{border:1px solid var(--hairline);border-radius:10px;background:var(--bg-elevated);overflow:hidden}.chat-reason-done-head{display:flex;align-items:center;gap:9px;width:100%;padding:11px 15px;font-size:13px;color:var(--ink-soft);font-weight:500;text-align:left}.chat-reason-done-head svg:first-child{color:var(--positive-text);flex:none}.chat-reason-done-head .chat-chev{margin-left:auto}.chat-reason-done-head:hover{color:var(--ink)}.chat-reason-done-body{padding:2px 16px 16px 39px;font-family:var(--serif);font-size:14px;line-height:1.65;color:var(--ink-soft)}.chat-answer.chat-reason-markdown{padding-top:0;padding-right:0;padding-bottom:0;font-size:inherit;line-height:inherit;color:inherit;white-space:normal}.chat-answer.chat-reason-live-body{padding-left:23px}.chat-answer.chat-reason-done-body{padding:2px 16px 16px 39px}.chat-tool{border:1px solid var(--hairline);border-radius:10px;background:var(--bg-elevated);overflow:hidden}.chat-tool-running{border-color:color-mix(in oklch,var(--accent) 35%,var(--hairline))}.chat-tool-failed{border-color:color-mix(in oklch,#b42318 55%,var(--hairline))}.chat-tool-failed .chat-tool-status{color:#b42318;font-weight:600}.chat-tool-head{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:11px 15px;text-align:left}.chat-tool-head:disabled{cursor:default}.chat-tool-head-left{display:flex;align-items:center;gap:9px;min-width:0}.chat-tool-head-left>svg{color:var(--accent-text);flex:none}.chat-tool-name{font-family:var(--mono);font-size:12px;font-weight:600;color:var(--ink);background:var(--bg-subtle);border:1px solid var(--hairline);border-radius:5px;padding:2px 7px;flex:none}.chat-tool-query{font-family:var(--serif);font-style:italic;font-size:13.5px;color:var(--ink-soft);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-tool-head-right{display:flex;align-items:center;gap:10px;flex:none}.chat-tool-status{font-size:11.5px;color:var(--ink-soft);font-variant-numeric:tabular-nums}.chat-tool-body{padding:4px 16px 16px;border-top:1px solid var(--hairline)}.chat-tool-args{margin:12px 0 4px}.chat-tool-label{display:block;font-family:var(--mono);font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-faint);margin-bottom:6px}.chat-tool-args pre{margin:0;background:var(--bg-subtle);border:1px solid var(--hairline);border-radius:8px;padding:10px 12px;font-family:var(--mono);font-size:11.5px;line-height:1.5;color:var(--ink-soft);overflow-x:auto}.chat-tool-results-label{margin-top:16px}.chat-tool-output-head{display:flex;align-items:center;justify-content:space-between;margin-top:14px}.chat-tool-output-head .chat-tool-label{margin-bottom:0}.chat-tool-copy{color:var(--accent-text);font-family:var(--mono);font-size:11px}.chat-tool-output{max-height:320px;margin:7px 0 0;overflow:auto;white-space:pre;-moz-tab-size:4;-o-tab-size:4;tab-size:4;border:1px solid var(--hairline);border-radius:8px;background:var(--bg-subtle);padding:11px 12px;color:var(--ink);font-family:var(--mono);font-size:11.5px;line-height:1.5}.chat-tool-truncated{margin-top:7px;color:var(--ink-faint);font-size:11px}.chat-mcp-app{border:1px solid var(--chat-border, #d8d8de);border-radius:12px;overflow:hidden;background:var(--chat-surface, #fff)}.chat-mcp-app>header{display:flex;justify-content:flex-end;padding:8px 10px 0}.chat-mcp-app button{border:0;border-radius:6px;background:#eef1f5;padding:5px 8px;cursor:pointer}.chat-mcp-app iframe{display:block;width:100%;border:0;background:#fff;aspect-ratio:4 / 3}.chat-mcp-loading,.chat-mcp-error{min-height:180px;aspect-ratio:4 / 3;display:grid;place-items:center;padding:18px;color:#52606d;text-align:center}.chat-mcp-error{gap:12px}.chat-mcp-app-fullscreen{position:fixed;top:16px;right:16px;bottom:16px;left:16px;z-index:1000}.chat-mcp-app-fullscreen iframe{height:calc(100vh - 72px)!important;aspect-ratio:auto}.chat-tool-results{list-style:none;margin:0;padding:0}.chat-hit{padding:11px 0;border-top:1px solid var(--hairline)}.chat-hit:first-child{border-top:0}.chat-hit-top{display:flex;align-items:baseline;gap:12px}.chat-hit-title{font-family:var(--serif);font-size:14.5px;font-weight:600;color:var(--accent-text);flex:1;line-height:1.3}.chat-hit-title:hover{text-decoration:underline}.chat-hit-meta{font-size:12px;color:var(--ink-faint);margin-top:2px}.chat-hit-truncated{color:var(--ink-faint);font-style:italic}.chat-hit-snippet{font-family:var(--serif);font-size:13.5px;line-height:1.5;color:var(--ink-soft);margin-top:5px;text-wrap:pretty}.chat-answer{font-family:var(--serif);font-size:16.5px;line-height:1.65;color:var(--ink);text-wrap:pretty;padding:2px}.chat-answer>:first-child{margin-top:0}.chat-answer>:last-child{margin-bottom:0}.chat-answer p{margin:0 0 .9em}.chat-answer h1,.chat-answer h2,.chat-answer h3,.chat-answer h4{font-family:var(--sans);font-weight:600;line-height:1.3;margin:1.35em 0 .5em}.chat-answer h1{font-size:1.45em}.chat-answer h2{font-size:1.25em}.chat-answer h3{font-size:1.08em}.chat-answer h4{font-size:1em}.chat-answer ul,.chat-answer ol{margin:0 0 .9em;padding-left:1.5em}.chat-answer ul{list-style-type:disc}.chat-answer ol{list-style-type:decimal}.chat-answer ul ul{list-style-type:circle}.chat-answer ul ul ul{list-style-type:square}.chat-answer li{margin:.2em 0}.chat-answer li>p{margin:0}.chat-answer blockquote{margin:0 0 .9em;padding-left:1em;border-left:3px solid var(--hairline-strong);color:var(--ink-soft)}.chat-answer code{font-family:var(--mono);font-size:.84em;background:var(--bg-subtle);border:1px solid var(--hairline);border-radius:4px;padding:.1em .3em}.chat-answer pre{margin:0 0 1em;padding:12px 14px;overflow-x:auto;background:var(--bg-subtle);border:1px solid var(--hairline);border-radius:8px;line-height:1.5}.chat-answer pre code{background:none;border:0;padding:0}.chat-answer table{display:block;width:-moz-max-content;width:max-content;max-width:100%;overflow-x:auto;border-collapse:collapse;margin:0 0 1em;font-family:var(--sans);font-size:.88em}.chat-answer th,.chat-answer td{border:1px solid var(--hairline);padding:6px 10px;text-align:left}.chat-answer th{background:var(--bg-subtle);font-weight:600}.chat-answer hr{border:0;border-top:1px solid var(--hairline);margin:1.25em 0}.chat-answer input[type=checkbox]{margin-right:.4em}.chat-answer strong{font-weight:600}.chat-error{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:12px;border:1px solid var(--negative-border);background:var(--negative-bg);color:var(--negative-text);border-radius:10px;padding:12px 16px;font-size:13.5px;overflow-wrap:anywhere}.chat-error>span:first-child{flex:1 1 280px;min-width:0}.chat-finish-note{font-family:var(--serif);font-style:italic;font-size:13px;color:var(--ink-faint)}.chat-feedback{display:flex;align-items:center;gap:4px;min-height:30px;margin-top:8px;color:var(--ink-faint);font-size:12px}.chat-feedback-label{margin-right:2px}.chat-feedback-action{width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:999px;color:var(--ink-soft);background:transparent}.chat-feedback-action:hover:not(:disabled),.chat-feedback-action-selected{color:var(--accent-text);background:var(--accent-soft);border-color:color-mix(in oklch,var(--accent) 35%,var(--hairline))}.chat-feedback-action:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.chat-feedback-action:disabled{cursor:wait}.chat-feedback-action svg{width:14px;height:14px}.chat-feedback-error{color:var(--negative-text);margin-left:4px}.chat-feedback-panel{width:min(460px,100%);margin-top:8px;padding:16px;border:1px solid var(--hairline);border-radius:12px;background:var(--bg-elevated);box-shadow:0 10px 30px #0000001a}.chat-feedback-panel-title{color:var(--ink);font-size:15px;font-weight:600}.chat-feedback-panel-label{display:block;margin-top:4px;color:var(--ink-soft);font-size:13px}.chat-feedback-comment{display:block;width:100%;min-height:92px;margin-top:12px;padding:10px 12px;resize:vertical;border:1px solid var(--hairline-strong);border-radius:8px;color:var(--ink);background:var(--bg);font:14px/1.45 var(--sans)}.chat-feedback-comment:focus{border-color:var(--accent);outline:2px solid color-mix(in oklch,var(--accent) 25%,transparent);outline-offset:1px}.chat-feedback-panel-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}.chat-feedback-panel-actions button{min-width:72px;padding:8px 14px;border-radius:8px;font:600 13px var(--sans)}.chat-feedback-skip{border:1px solid transparent;color:var(--ink-soft);background:transparent}.chat-feedback-submit{border:1px solid var(--ink);color:var(--bg);background:var(--ink)}.chat-feedback-panel-actions button:disabled{cursor:wait;opacity:.65}.chat-error a,.chat-error button{flex:none;max-width:100%;color:var(--accent-text);font-weight:600;text-decoration:none}.chat-error button{border:0;padding:0;background:transparent;cursor:pointer;font:inherit;text-align:left;white-space:normal}.chat-error button:disabled{cursor:wait;opacity:.65}.chat-error-actions{display:flex;flex:0 1 auto;min-width:0;max-width:100%;flex-wrap:wrap;justify-content:flex-start;gap:8px 16px}.chat-error a:hover,.chat-error button:hover:not(:disabled){text-decoration:underline}@media (max-width: 900px){.chat-user-message-wrap{max-width:90%}.chat-inline-editor{width:90%;min-width:0}.chat-conversation-inner{padding:22px 16px 32px}}@media (max-width: 560px){.shared-chat-content .chat-user-message-wrap{max-width:88%}}@media (hover: none),(pointer: coarse){.chat-user-actions{opacity:1;transform:none}}.chat-compaction-status{flex-direction:column;align-items:flex-start}.chat-compaction-explanation{margin-top:4px;color:var(--ink-faint);font-weight:400}.chat-caret{display:inline-block;width:7px;height:1.05em;background:var(--accent);margin-left:1px;vertical-align:text-bottom;animation:chat-blink 1s steps(1) infinite}@keyframes chat-blink{50%{opacity:0}}.chat-chev{transition:transform .18s;color:var(--ink-faint)}.chat-chev-open{transform:rotate(180deg)}.chat-spinner{width:14px;height:14px;border:2px solid color-mix(in oklch,var(--accent) 25%,transparent);border-top-color:var(--accent);border-radius:50%;display:inline-block;animation:chat-spin .7s linear infinite;flex:none}.chat-spinner-light{border-color:#fff6;border-top-color:#fff}@keyframes chat-spin{to{transform:rotate(360deg)}}.shared-chat-page{min-height:0;display:flex;flex-direction:column;overflow:hidden;background:var(--bg)}.shared-chat-heading{flex:none;border-bottom:1px solid var(--hairline);display:flex;align-items:center;gap:10px}.shared-chat-heading h1{max-width:calc(50vw + 640px);margin:0 auto;padding:13px 32px;color:var(--ink);font-family:var(--serif);font-size:20px;font-weight:600;line-height:1.1}.shared-chat-content{width:min(876px,100%);margin:0 auto;padding:34px 28px 64px}.shared-chat-transcript{padding:0 0 26px}.shared-chat-attribution{display:flex;flex-wrap:wrap;justify-content:center;gap:5px 12px;color:var(--ink-faint);font-size:12px;line-height:1.5}.shared-chat-attribution a{color:inherit;font-weight:600;text-decoration:none}.shared-chat-attribution a:hover{color:var(--accent-text);text-decoration:underline}.shared-chat-fresh{margin-top:26px;padding-top:28px;border-top:1px solid var(--hairline)}.shared-chat-fresh h2{margin:0 0 6px;font-family:var(--serif);font-size:21px;font-weight:600}.shared-chat-fresh>p{margin:0 0 16px;color:var(--ink-soft);font-family:var(--serif)}.shared-chat-access-note{margin:-6px 0 16px;padding:10px 12px;border:1px solid color-mix(in oklch,var(--accent) 24%,var(--hairline));border-radius:9px;color:var(--ink-soft);background:color-mix(in oklch,var(--accent) 5%,var(--bg-elevated));font-size:13px;line-height:1.45}.shared-chat-access-note a{color:var(--accent-text);font-weight:600}.shared-chat-state{min-height:55vh;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:48px 24px;text-align:center;color:var(--ink-soft)}.shared-chat-state h1{margin:0;color:var(--ink);font-family:var(--serif);font-size:27px}.shared-chat-state p{margin:0}.shared-chat-state button{margin-top:8px;padding:7px 13px;border:1px solid var(--hairline-strong);border-radius:7px;background:var(--bg-elevated);color:var(--ink)}@media (max-width: 900px){.shared-chat-heading h1{padding-inline:16px}}@media (max-width: 640px){.shared-chat-heading h1{padding-inline:14px}}@media (max-width: 560px){.shared-chat-content{padding:26px 16px 48px}} diff --git a/assets/index-CqELxJb0.js b/assets/index-uFGyKu5N.js similarity index 96% rename from assets/index-CqELxJb0.js rename to assets/index-uFGyKu5N.js index 5cac4035eac7fd229660b0dad8d192557e26c7b8..4252cadcd7300477a5c2f575a7e91e43c6fd01b9 100644 --- a/assets/index-CqELxJb0.js +++ b/assets/index-uFGyKu5N.js @@ -1,14 +1,14 @@ -import{at as Ye,Y as Ot,j as Ze}from"./index-CqKcHUvZ.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(Yn,Br);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=n.slice(4);if(!Yn.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={},Wn=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Ur=/\n/g,Vr=/^\s*/,qr=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,$r=/^:\s*/,Yr=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Wr=/^[;\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(Yr),w=y({type:Kr,property:Gn(b[0].replace(Wn,ke)),value:T?Gn(T[0].replace(Wn,ke)):ke});return u(Wr),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=Ye&&Ye.__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=Ye&&Ye.__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=Yt(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:Yt(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 Yi=ge(new RegExp("\\p{P}|\\p{S}","u")),Wi=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)||Wi(e))return 1;if(Yi(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),Y):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 Y(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,Y(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,Y(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,Y(h)):(e.consume(h),L)}function E(h){return h===null?t(h):h===63?(e.consume(h),j):A(h)?(o=E,Y(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=_,Y(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,Y(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,Y(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,Y(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,Y(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 Y(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:Wl,resolveTo:Xl,tokenize:Ql},ql={tokenize:Gl},$l={tokenize:Kl},Yl={tokenize:Jl};function Wl(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(;++t4&&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;++F0&&(r.className=["language-"+i[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return n.meta&&(l.data={meta:n.meta}),e.patch(n,l),l=e.applyData(n,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(n,l),l}function Wo(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Xo(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Qo(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),i=Pe(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let o,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=l+1,a+=1,e.footnoteCounts.set(r,a);const u={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+i,id:t+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(n,u);const c={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(n,c),e.applyData(n,c)}function Go(e,n){const t={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Ko(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function or(e,n){const t=n.referenceType;let r="]";if(t==="collapsed"?r+="[]":t==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const i=e.all(n),l=i[0];l&&l.type==="text"?l.value="["+l.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function Jo(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return or(e,n);const i={src:Pe(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"img",properties:i,children:[]};return e.patch(n,l),e.applyData(n,l)}function Zo(e,n){const t={src:Pe(n.url)};n.alt!==null&&n.alt!==void 0&&(t.alt=n.alt),n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"img",properties:t,children:[]};return e.patch(n,r),e.applyData(n,r)}function ea(e,n){const t={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,t);const r={type:"element",tagName:"code",properties:{},children:[t]};return e.patch(n,r),e.applyData(n,r)}function na(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return or(e,n);const i={href:Pe(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"a",properties:i,children:e.all(n)};return e.patch(n,l),e.applyData(n,l)}function ta(e,n){const t={href:Pe(n.url)};n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"a",properties:t,children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function ra(e,n,t){const r=e.all(n),i=t?ia(t):ar(n),l={},o=[];if(typeof n.checked=="boolean"){const s=r[0];let f;s&&s.type==="element"&&s.tagName==="p"?f=s:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let a=-1;for(;++a0){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;++F0&&(r.className=["language-"+i[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return n.meta&&(l.data={meta:n.meta}),e.patch(n,l),l=e.applyData(n,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(n,l),l}function Yo(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Xo(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Qo(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),i=Pe(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let o,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=l+1,a+=1,e.footnoteCounts.set(r,a);const u={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+i,id:t+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(n,u);const c={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(n,c),e.applyData(n,c)}function Go(e,n){const t={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Ko(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function or(e,n){const t=n.referenceType;let r="]";if(t==="collapsed"?r+="[]":t==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const i=e.all(n),l=i[0];l&&l.type==="text"?l.value="["+l.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function Jo(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return or(e,n);const i={src:Pe(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"img",properties:i,children:[]};return e.patch(n,l),e.applyData(n,l)}function Zo(e,n){const t={src:Pe(n.url)};n.alt!==null&&n.alt!==void 0&&(t.alt=n.alt),n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"img",properties:t,children:[]};return e.patch(n,r),e.applyData(n,r)}function ea(e,n){const t={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,t);const r={type:"element",tagName:"code",properties:{},children:[t]};return e.patch(n,r),e.applyData(n,r)}function na(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return or(e,n);const i={href:Pe(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"a",properties:i,children:e.all(n)};return e.patch(n,l),e.applyData(n,l)}function ta(e,n){const t={href:Pe(n.url)};n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"a",properties:t,children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function ra(e,n,t){const r=e.all(n),i=t?ia(t):ar(n),l={},o=[];if(typeof n.checked=="boolean"){const s=r[0];let f;s&&s.type==="element"&&s.tagName==="p"?f=s:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let a=-1;for(;++a1}function la(e,n){const t={},r=e.all(n);let i=-1;for(typeof n.start=="number"&&n.start!==1&&(t.start=n.start);++i0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},a=Tn(n.children[1]),u=Ht(n.children[n.children.length-1]);a&&u&&(o.position={start:a,end:u}),i.push(o)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(n,l),e.applyData(n,l)}function ca(e,n,t){const r=t?t.children:void 0,l=(r?r.indexOf(n):1)===0?"th":"td",o=t&&t.type==="table"?t.align:void 0,a=o?o.length:n.children.length;let u=-1;const c=[];for(;++u0,!0),r[0]),i=r.index+r[0].length,r=t.exec(n);return l.push(mt(n.slice(i),i>0,!1)),l.join("")}function mt(e,n,t){let r=0,i=e.length;if(n){let l=e.codePointAt(r);for(;l===ft||l===ht;)r++,l=e.codePointAt(r)}if(t){let l=e.codePointAt(i-1);for(;l===ft||l===ht;)i--,l=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function ha(e,n){const t={type:"text",value:fa(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function ma(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const da={blockquote:qo,break:$o,code:Yo,delete:Wo,emphasis:Xo,footnoteReference:Qo,heading:Go,html:Ko,imageReference:Jo,image:Zo,inlineCode:ea,linkReference:na,link:ta,listItem:ra,list:la,paragraph:oa,root:aa,strong:ua,table:sa,tableCell:pa,tableRow:ca,text:ha,thematicBreak:ma,toml:He,yaml:He,definition:He,footnoteDefinition:He};function He(){}const ur=-1,Ke=0,Fe=1,We=2,On=3,_n=4,Nn=5,Fn=6,sr=7,cr=8,dt=typeof self=="object"?self:globalThis,ga=(e,n)=>{const t=(i,l)=>(e.set(l,i),i),r=i=>{if(e.has(i))return e.get(i);const[l,o]=n[i];switch(l){case Ke:case ur:return t(o,i);case Fe:{const a=t([],i);for(const u of o)a.push(r(u));return a}case We:{const a=t({},i);for(const[u,c]of o)a[r(u)]=r(c);return a}case On:return t(new Date(o),i);case _n:{const{source:a,flags:u}=o;return t(new RegExp(a,u),i)}case Nn:{const a=t(new Map,i);for(const[u,c]of o)a.set(r(u),r(c));return a}case Fn:{const a=t(new Set,i);for(const u of o)a.add(r(u));return a}case sr:{const{name:a,message:u}=o;return t(new dt[a](u),i)}case cr:return t(BigInt(o),i);case"BigInt":return t(Object(BigInt(o)),i);case"ArrayBuffer":return t(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:a}=new Uint8Array(o);return t(new DataView(a),o)}}return t(new dt[l](o),i)};return r},gt=e=>ga(new Map,e)(0),Ce="",{toString:ya}={},{keys:xa}=Object,Oe=e=>{const n=typeof e;if(n!=="object"||!e)return[Ke,n];const t=ya.call(e).slice(8,-1);switch(t){case"Array":return[Fe,Ce];case"Object":return[We,Ce];case"Date":return[On,Ce];case"RegExp":return[_n,Ce];case"Map":return[Nn,Ce];case"Set":return[Fn,Ce];case"DataView":return[Fe,t]}return t.includes("Array")?[Fe,t]:t.includes("Error")?[sr,t]:[We,t]},Ue=([e,n])=>e===Ke&&(n==="function"||n==="symbol"),ka=(e,n,t,r)=>{const i=(o,a)=>{const u=r.push(o)-1;return t.set(a,u),u},l=o=>{if(t.has(o))return t.get(o);let[a,u]=Oe(o);switch(a){case Ke:{let s=o;switch(u){case"bigint":a=cr,s=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);s=null;break;case"undefined":return i([ur],o)}return i([a,s],o)}case Fe:{if(u){let d=o;return u==="DataView"?d=new Uint8Array(o.buffer):u==="ArrayBuffer"&&(d=new Uint8Array(o)),i([u,[...d]],o)}const s=[],f=i([a,s],o);for(const d of o)s.push(l(d));return f}case We:{if(u)switch(u){case"BigInt":return i([u,o.toString()],o);case"Boolean":case"Number":case"String":return i([u,o.valueOf()],o)}if(n&&"toJSON"in o)return l(o.toJSON());const s=[],f=i([a,s],o);for(const d of xa(o))(e||!Ue(Oe(o[d])))&&s.push([l(d),l(o[d])]);return f}case On:return i([a,o.toISOString()],o);case _n:{const{source:s,flags:f}=o;return i([a,{source:s,flags:f}],o)}case Nn:{const s=[],f=i([a,s],o);for(const[d,p]of o)(e||!(Ue(Oe(d))||Ue(Oe(p))))&&s.push([l(d),l(p)]);return f}case Fn:{const s=[],f=i([a,s],o);for(const d of o)(e||!Ue(Oe(d)))&&s.push(l(d));return f}}const{message:c}=o;return i([a,{name:u,message:c}],o)};return l},yt=(e,{json:n,lossy:t}={})=>{const r=[];return ka(!(n||t),!!n,new Map,r)(e),r},Xe=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?gt(yt(e,n)):structuredClone(e):(e,n)=>gt(yt(e,n));function ba(e,n){const t=[{type:"text",value:"↩"}];return n>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),t}function wa(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function Sa(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||ba,r=e.options.footnoteBackLabel||wa,i=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let u=-1;for(;++u0&&y.push({type:"text",value:" "});let L=typeof t=="string"?t:t(u,p);typeof L=="string"&&(L={type:"text",value:L}),y.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+d+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,p),className:["data-footnote-backref"]},children:Array.isArray(L)?L:[L]})}const T=s[s.length-1];if(T&&T.type==="element"&&T.tagName==="p"){const L=T.children[T.children.length-1];L&&L.type==="text"?L.value+=" ":T.children.push({type:"text",value:" "}),T.children.push(...y)}else s.push(...y);const w={type:"element",tagName:"li",properties:{id:n+"fn-"+d},children:e.wrap(s,!0)};e.patch(c,w),a.push(w)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...Xe(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` +`});const c={type:"element",tagName:"li",properties:l,children:o};return e.patch(n,c),e.applyData(n,c)}function ia(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const t=e.children;let r=-1;for(;!n&&++r1}function la(e,n){const t={},r=e.all(n);let i=-1;for(typeof n.start=="number"&&n.start!==1&&(t.start=n.start);++i0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},a=Tn(n.children[1]),u=Ht(n.children[n.children.length-1]);a&&u&&(o.position={start:a,end:u}),i.push(o)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(n,l),e.applyData(n,l)}function ca(e,n,t){const r=t?t.children:void 0,l=(r?r.indexOf(n):1)===0?"th":"td",o=t&&t.type==="table"?t.align:void 0,a=o?o.length:n.children.length;let u=-1;const c=[];for(;++u0,!0),r[0]),i=r.index+r[0].length,r=t.exec(n);return l.push(mt(n.slice(i),i>0,!1)),l.join("")}function mt(e,n,t){let r=0,i=e.length;if(n){let l=e.codePointAt(r);for(;l===ft||l===ht;)r++,l=e.codePointAt(r)}if(t){let l=e.codePointAt(i-1);for(;l===ft||l===ht;)i--,l=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function ha(e,n){const t={type:"text",value:fa(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function ma(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const da={blockquote:qo,break:$o,code:Wo,delete:Yo,emphasis:Xo,footnoteReference:Qo,heading:Go,html:Ko,imageReference:Jo,image:Zo,inlineCode:ea,linkReference:na,link:ta,listItem:ra,list:la,paragraph:oa,root:aa,strong:ua,table:sa,tableCell:pa,tableRow:ca,text:ha,thematicBreak:ma,toml:He,yaml:He,definition:He,footnoteDefinition:He};function He(){}const ur=-1,Ke=0,Fe=1,Ye=2,On=3,_n=4,Nn=5,Fn=6,sr=7,cr=8,dt=typeof self=="object"?self:globalThis,ga=(e,n)=>{const t=(i,l)=>(e.set(l,i),i),r=i=>{if(e.has(i))return e.get(i);const[l,o]=n[i];switch(l){case Ke:case ur:return t(o,i);case Fe:{const a=t([],i);for(const u of o)a.push(r(u));return a}case Ye:{const a=t({},i);for(const[u,c]of o)a[r(u)]=r(c);return a}case On:return t(new Date(o),i);case _n:{const{source:a,flags:u}=o;return t(new RegExp(a,u),i)}case Nn:{const a=t(new Map,i);for(const[u,c]of o)a.set(r(u),r(c));return a}case Fn:{const a=t(new Set,i);for(const u of o)a.add(r(u));return a}case sr:{const{name:a,message:u}=o;return t(new dt[a](u),i)}case cr:return t(BigInt(o),i);case"BigInt":return t(Object(BigInt(o)),i);case"ArrayBuffer":return t(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:a}=new Uint8Array(o);return t(new DataView(a),o)}}return t(new dt[l](o),i)};return r},gt=e=>ga(new Map,e)(0),Ce="",{toString:ya}={},{keys:xa}=Object,Oe=e=>{const n=typeof e;if(n!=="object"||!e)return[Ke,n];const t=ya.call(e).slice(8,-1);switch(t){case"Array":return[Fe,Ce];case"Object":return[Ye,Ce];case"Date":return[On,Ce];case"RegExp":return[_n,Ce];case"Map":return[Nn,Ce];case"Set":return[Fn,Ce];case"DataView":return[Fe,t]}return t.includes("Array")?[Fe,t]:t.includes("Error")?[sr,t]:[Ye,t]},Ue=([e,n])=>e===Ke&&(n==="function"||n==="symbol"),ka=(e,n,t,r)=>{const i=(o,a)=>{const u=r.push(o)-1;return t.set(a,u),u},l=o=>{if(t.has(o))return t.get(o);let[a,u]=Oe(o);switch(a){case Ke:{let s=o;switch(u){case"bigint":a=cr,s=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);s=null;break;case"undefined":return i([ur],o)}return i([a,s],o)}case Fe:{if(u){let d=o;return u==="DataView"?d=new Uint8Array(o.buffer):u==="ArrayBuffer"&&(d=new Uint8Array(o)),i([u,[...d]],o)}const s=[],f=i([a,s],o);for(const d of o)s.push(l(d));return f}case Ye:{if(u)switch(u){case"BigInt":return i([u,o.toString()],o);case"Boolean":case"Number":case"String":return i([u,o.valueOf()],o)}if(n&&"toJSON"in o)return l(o.toJSON());const s=[],f=i([a,s],o);for(const d of xa(o))(e||!Ue(Oe(o[d])))&&s.push([l(d),l(o[d])]);return f}case On:return i([a,o.toISOString()],o);case _n:{const{source:s,flags:f}=o;return i([a,{source:s,flags:f}],o)}case Nn:{const s=[],f=i([a,s],o);for(const[d,p]of o)(e||!(Ue(Oe(d))||Ue(Oe(p))))&&s.push([l(d),l(p)]);return f}case Fn:{const s=[],f=i([a,s],o);for(const d of o)(e||!Ue(Oe(d)))&&s.push(l(d));return f}}const{message:c}=o;return i([a,{name:u,message:c}],o)};return l},yt=(e,{json:n,lossy:t}={})=>{const r=[];return ka(!(n||t),!!n,new Map,r)(e),r},Xe=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?gt(yt(e,n)):structuredClone(e):(e,n)=>gt(yt(e,n));function ba(e,n){const t=[{type:"text",value:"↩"}];return n>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),t}function wa(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function Sa(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||ba,r=e.options.footnoteBackLabel||wa,i=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let u=-1;for(;++u0&&y.push({type:"text",value:" "});let L=typeof t=="string"?t:t(u,p);typeof L=="string"&&(L={type:"text",value:L}),y.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+d+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,p),className:["data-footnote-backref"]},children:Array.isArray(L)?L:[L]})}const T=s[s.length-1];if(T&&T.type==="element"&&T.tagName==="p"){const L=T.children[T.children.length-1];L&&L.type==="text"?L.value+=" ":T.children.push({type:"text",value:" "}),T.children.push(...y)}else s.push(...y);const w={type:"element",tagName:"li",properties:{id:n+"fn-"+d},children:e.wrap(s,!0)};e.patch(c,w),a.push(w)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...Xe(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:` `}]}}const pr=function(e){if(e==null)return Ta;if(typeof e=="function")return Je(e);if(typeof e=="object")return Array.isArray(e)?Ea(e):Ca(e);if(typeof e=="string")return Ia(e);throw new Error("Expected function, string, or object as test")};function Ea(e){const n=[];let t=-1;for(;++t":""))+")"})}return d;function d(){let p=fr,y,b,T;if((!n||l(u,c,s[s.length-1]||void 0))&&(p=va(t(u,s)),p[0]===xt))return p;if("children"in u&&u.children){const w=u;if(w.children&&p[0]!==za)for(b=(r?w.children.length:-1)+o,T=s.concat(w);b>-1&&b0&&t.push({type:"text",value:` `}),t}function kt(e){let n=0,t=e.charCodeAt(n);for(;t===9||t===32;)n++,t=e.charCodeAt(n);return e.slice(n)}function bt(e,n){const t=Oa(e,n),r=t.one(e,void 0),i=Sa(t),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&l.children.push({type:"text",value:` -`},i),l}function Ma(e,n){return e&&"run"in e?async function(t,r){const i=bt(t,{file:r,...n});await e.run(i,r)}:function(t,r){return bt(t,{file:r,...e||n})}}function wt(e){if(e)throw e}var $e=Object.prototype.hasOwnProperty,mr=Object.prototype.toString,St=Object.defineProperty,Et=Object.getOwnPropertyDescriptor,Ct=function(n){return typeof Array.isArray=="function"?Array.isArray(n):mr.call(n)==="[object Array]"},It=function(n){if(!n||mr.call(n)!=="[object Object]")return!1;var t=$e.call(n,"constructor"),r=n.constructor&&n.constructor.prototype&&$e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!t&&!r)return!1;var i;for(i in n);return typeof i>"u"||$e.call(n,i)},Tt=function(n,t){St&&t.name==="__proto__"?St(n,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):n[t.name]=t.newValue},At=function(n,t){if(t==="__proto__")if($e.call(n,t)){if(Et)return Et(n,t).value}else return;return n[t]},Ba=function e(){var n,t,r,i,l,o,a=arguments[0],u=1,c=arguments.length,s=!1;for(typeof a=="boolean"&&(s=a,a=arguments[1]||{},u=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});uo.length;let u;a&&o.push(i);try{u=e.apply(this,o)}catch(c){const s=c;if(a&&t)throw s;return i(s)}a||(u&&u.then&&typeof u.then=="function"?u.then(l,i):u instanceof Error?i(u):l(u))}function i(o,...a){t||(t=!0,n(o,...a))}function l(o){i(null,o)}}const ae={basename:Ua,dirname:Va,extname:qa,join:$a,sep:"/"};function Ua(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');Be(e);let t=0,r=-1,i=e.length,l;if(n===void 0||n.length===0||n.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(l){t=i+1;break}}else r<0&&(l=!0,r=i+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let o=-1,a=n.length-1;for(;i--;)if(e.codePointAt(i)===47){if(l){t=i+1;break}}else o<0&&(l=!0,o=i+1),a>-1&&(e.codePointAt(i)===n.codePointAt(a--)?a<0&&(r=i):(a=-1,r=o));return t===r?r=o:r<0&&(r=e.length),e.slice(t,r)}function Va(e){if(Be(e),e.length===0)return".";let n=-1,t=e.length,r;for(;--t;)if(e.codePointAt(t)===47){if(r){n=t;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function qa(e){Be(e);let n=e.length,t=-1,r=0,i=-1,l=0,o;for(;n--;){const a=e.codePointAt(n);if(a===47){if(o){r=n+1;break}continue}t<0&&(o=!0,t=n+1),a===46?i<0?i=n:l!==1&&(l=1):i>-1&&(l=-1)}return i<0||t<0||l===0||l===1&&i===t-1&&i===r+1?"":e.slice(i,t)}function $a(...e){let n=-1,t;for(;++n0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function Wa(e,n){let t="",r=0,i=-1,l=0,o=-1,a,u;for(;++o<=e.length;){if(o2){if(u=t.lastIndexOf("/"),u!==t.length-1){u<0?(t="",r=0):(t=t.slice(0,u),r=t.length-1-t.lastIndexOf("/")),i=o,l=0;continue}}else if(t.length>0){t="",r=0,i=o,l=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(i+1,o):t=e.slice(i+1,o),r=o-i-1;i=o,l=0}else a===46&&l>-1?l++:l=-1}return t}function Be(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Xa={cwd:Qa};function Qa(){return"/"}function Sn(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Ga(e){if(typeof e=="string")e=new URL(e);else if(!Sn(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return Ka(e)}function Ka(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const n=e.pathname;let t=-1;for(;++t0){let[p,...y]=s;const b=r[d][1];wn(b)&&wn(p)&&(p=ln(!0,b,p)),r[d]=[c,p,...y]}}}}const nu=new Rn().freeze();function sn(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function cn(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function pn(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function zt(e){if(!wn(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Lt(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function Ve(e){return tu(e)?e:new dr(e)}function tu(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function ru(e){return typeof e=="string"||iu(e)}function iu(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const lu="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",vt=[],Dt={allowDangerousHtml:!0},ou=/^(https?|ircs?|mailto|xmpp)$/i,au=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function gu(e){const n=uu(e),t=su(e);return cu(n.runSync(n.parse(t),t),e)}function uu(e){const n=e.rehypePlugins||vt,t=e.remarkPlugins||vt,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Dt}:Dt;return nu().use(Vo).use(t).use(Ma,r).use(n)}function su(e){const n=e.children||"",t=new dr;return typeof n=="string"&&(t.value=n),t}function cu(e,n){const t=n.allowedElements,r=n.allowElement,i=n.components,l=n.disallowedElements,o=n.skipHtml,a=n.unwrapDisallowed,u=n.urlTransform||pu;for(const s of au)Object.hasOwn(n,s.from)&&(""+s.from+(s.to?"use `"+s.to+"` instead":"remove it")+lu+s.id,void 0);return hr(e,c),wi(e,{Fragment:Ze.Fragment,components:i,ignoreInvalidStyle:!0,jsx:Ze.jsx,jsxs:Ze.jsxs,passKeys:!0,passNode:!0});function c(s,f,d){if(s.type==="raw"&&d&&typeof f=="number")return o?d.children.splice(f,1):d.children[f]={type:"text",value:s.value},f;if(s.type==="element"){let p;for(p in nn)if(Object.hasOwn(nn,p)&&Object.hasOwn(s.properties,p)){const y=s.properties[p],b=nn[p];(b===null||b.includes(s.tagName))&&(s.properties[p]=u(String(y||""),p,s))}}if(s.type==="element"){let p=t?!t.includes(s.tagName):l?l.includes(s.tagName):!1;if(!p&&r&&typeof f=="number"&&(p=!r(s,f,d)),p&&d&&typeof f=="number")return a&&s.children?d.children.splice(f,1,...s.children):d.children.splice(f,1),f}}}function pu(e){const n=e.indexOf(":"),t=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return n===-1||i!==-1&&n>i||t!==-1&&n>t||r!==-1&&n>r||ou.test(e.slice(0,n))?e:""}export{ji as A,xt as E,gu as M,za as S,Rr as a,mu as b,pr as c,pu as d,Yi as e,M as f,Te as g,jr as h,it as i,hr as j,ne as k,ue as l,A as m,fn as n,hu as o,du as p,K as q,yn as r,Cn as s,Mi as t,Wi as u,La as v,Ge as w,se as x,vn as y,O as z}; +`},i),l}function Ma(e,n){return e&&"run"in e?async function(t,r){const i=bt(t,{file:r,...n});await e.run(i,r)}:function(t,r){return bt(t,{file:r,...e||n})}}function wt(e){if(e)throw e}var $e=Object.prototype.hasOwnProperty,mr=Object.prototype.toString,St=Object.defineProperty,Et=Object.getOwnPropertyDescriptor,Ct=function(n){return typeof Array.isArray=="function"?Array.isArray(n):mr.call(n)==="[object Array]"},It=function(n){if(!n||mr.call(n)!=="[object Object]")return!1;var t=$e.call(n,"constructor"),r=n.constructor&&n.constructor.prototype&&$e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!t&&!r)return!1;var i;for(i in n);return typeof i>"u"||$e.call(n,i)},Tt=function(n,t){St&&t.name==="__proto__"?St(n,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):n[t.name]=t.newValue},At=function(n,t){if(t==="__proto__")if($e.call(n,t)){if(Et)return Et(n,t).value}else return;return n[t]},Ba=function e(){var n,t,r,i,l,o,a=arguments[0],u=1,c=arguments.length,s=!1;for(typeof a=="boolean"&&(s=a,a=arguments[1]||{},u=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});uo.length;let u;a&&o.push(i);try{u=e.apply(this,o)}catch(c){const s=c;if(a&&t)throw s;return i(s)}a||(u&&u.then&&typeof u.then=="function"?u.then(l,i):u instanceof Error?i(u):l(u))}function i(o,...a){t||(t=!0,n(o,...a))}function l(o){i(null,o)}}const ae={basename:Ua,dirname:Va,extname:qa,join:$a,sep:"/"};function Ua(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');Be(e);let t=0,r=-1,i=e.length,l;if(n===void 0||n.length===0||n.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(l){t=i+1;break}}else r<0&&(l=!0,r=i+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let o=-1,a=n.length-1;for(;i--;)if(e.codePointAt(i)===47){if(l){t=i+1;break}}else o<0&&(l=!0,o=i+1),a>-1&&(e.codePointAt(i)===n.codePointAt(a--)?a<0&&(r=i):(a=-1,r=o));return t===r?r=o:r<0&&(r=e.length),e.slice(t,r)}function Va(e){if(Be(e),e.length===0)return".";let n=-1,t=e.length,r;for(;--t;)if(e.codePointAt(t)===47){if(r){n=t;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function qa(e){Be(e);let n=e.length,t=-1,r=0,i=-1,l=0,o;for(;n--;){const a=e.codePointAt(n);if(a===47){if(o){r=n+1;break}continue}t<0&&(o=!0,t=n+1),a===46?i<0?i=n:l!==1&&(l=1):i>-1&&(l=-1)}return i<0||t<0||l===0||l===1&&i===t-1&&i===r+1?"":e.slice(i,t)}function $a(...e){let n=-1,t;for(;++n0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function Ya(e,n){let t="",r=0,i=-1,l=0,o=-1,a,u;for(;++o<=e.length;){if(o2){if(u=t.lastIndexOf("/"),u!==t.length-1){u<0?(t="",r=0):(t=t.slice(0,u),r=t.length-1-t.lastIndexOf("/")),i=o,l=0;continue}}else if(t.length>0){t="",r=0,i=o,l=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(i+1,o):t=e.slice(i+1,o),r=o-i-1;i=o,l=0}else a===46&&l>-1?l++:l=-1}return t}function Be(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Xa={cwd:Qa};function Qa(){return"/"}function Sn(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Ga(e){if(typeof e=="string")e=new URL(e);else if(!Sn(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return Ka(e)}function Ka(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const n=e.pathname;let t=-1;for(;++t0){let[p,...y]=s;const b=r[d][1];wn(b)&&wn(p)&&(p=ln(!0,b,p)),r[d]=[c,p,...y]}}}}const nu=new Rn().freeze();function sn(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function cn(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function pn(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function zt(e){if(!wn(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Lt(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function Ve(e){return tu(e)?e:new dr(e)}function tu(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function ru(e){return typeof e=="string"||iu(e)}function iu(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const lu="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",vt=[],Dt={allowDangerousHtml:!0},ou=/^(https?|ircs?|mailto|xmpp)$/i,au=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function gu(e){const n=uu(e),t=su(e);return cu(n.runSync(n.parse(t),t),e)}function uu(e){const n=e.rehypePlugins||vt,t=e.remarkPlugins||vt,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Dt}:Dt;return nu().use(Vo).use(t).use(Ma,r).use(n)}function su(e){const n=e.children||"",t=new dr;return typeof n=="string"&&(t.value=n),t}function cu(e,n){const t=n.allowedElements,r=n.allowElement,i=n.components,l=n.disallowedElements,o=n.skipHtml,a=n.unwrapDisallowed,u=n.urlTransform||pu;for(const s of au)Object.hasOwn(n,s.from)&&(""+s.from+(s.to?"use `"+s.to+"` instead":"remove it")+lu+s.id,void 0);return hr(e,c),wi(e,{Fragment:Ze.Fragment,components:i,ignoreInvalidStyle:!0,jsx:Ze.jsx,jsxs:Ze.jsxs,passKeys:!0,passNode:!0});function c(s,f,d){if(s.type==="raw"&&d&&typeof f=="number")return o?d.children.splice(f,1):d.children[f]={type:"text",value:s.value},f;if(s.type==="element"){let p;for(p in nn)if(Object.hasOwn(nn,p)&&Object.hasOwn(s.properties,p)){const y=s.properties[p],b=nn[p];(b===null||b.includes(s.tagName))&&(s.properties[p]=u(String(y||""),p,s))}}if(s.type==="element"){let p=t?!t.includes(s.tagName):l?l.includes(s.tagName):!1;if(!p&&r&&typeof f=="number"&&(p=!r(s,f,d)),p&&d&&typeof f=="number")return a&&s.children?d.children.splice(f,1,...s.children):d.children.splice(f,1),f}}}function pu(e){const n=e.indexOf(":"),t=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return n===-1||i!==-1&&n>i||t!==-1&&n>t||r!==-1&&n>r||ou.test(e.slice(0,n))?e:""}export{ji as A,xt as E,gu as M,za as S,Rr as a,mu as b,pr as c,pu as d,Wi as e,M as f,Te as g,jr as h,it as i,hr as j,ne as k,ue as l,A as m,fn as n,hu as o,du as p,K as q,yn as r,Cn as s,Mi as t,Yi as u,La as v,Ge as w,se as x,vn as y,O as z}; diff --git a/assets/index-DBHj7UWg.js b/assets/index-yduEvk9Z.js similarity index 99% rename from assets/index-DBHj7UWg.js rename to assets/index-yduEvk9Z.js index d79a2436fd9c1140b22c8f048941bee976b54670..89848550797030f98804caeb67263a39b30ad1b2 100644 --- a/assets/index-DBHj7UWg.js +++ b/assets/index-yduEvk9Z.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-CqELxJb0.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-uFGyKu5N.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(;++ii.jsx("input",{type:r,className:n("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:t,...o}));d.displayName="Input";export{d as I}; +import{r as s,j as i,B as n}from"./index-D6jcIRWs.js";const d=s.forwardRef(({className:e,type:r,...o},t)=>i.jsx("input",{type:r,className:n("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:t,...o}));d.displayName="Input";export{d as I}; diff --git a/assets/loader-circle-CZgakNH7.js b/assets/loader-circle-BuDrH29B.js similarity index 85% rename from assets/loader-circle-CZgakNH7.js rename to assets/loader-circle-BuDrH29B.js index 4701141ddfbfaa427f3da0d5751469aecad6927e..82ce1c7a85e164712357ee00e84592f7e023636e 100644 --- a/assets/loader-circle-CZgakNH7.js +++ b/assets/loader-circle-BuDrH29B.js @@ -1,4 +1,4 @@ -import{n as e}from"./index-CqKcHUvZ.js";/** +import{n as e}from"./index-D6jcIRWs.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/moon-DgDMXTmG.js b/assets/moon--2wi3KtT.js similarity index 85% rename from assets/moon-DgDMXTmG.js rename to assets/moon--2wi3KtT.js index 0b452d6d1d6a7df1ca8544b9a394ee6cbe74fcdd..b27372d1a9e48ecaff85c38c464bf7f5068e725a 100644 --- a/assets/moon-DgDMXTmG.js +++ b/assets/moon--2wi3KtT.js @@ -1,4 +1,4 @@ -import{n as o}from"./index-CqKcHUvZ.js";/** +import{n as o}from"./index-D6jcIRWs.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/openrouter-BNf4jDuS.js b/assets/openrouter-DrXWVMlM.js similarity index 82% rename from assets/openrouter-BNf4jDuS.js rename to assets/openrouter-DrXWVMlM.js index 8625eafc240ea4a997bf59509a2604dea05aae0d..dcc24d1604a8080330d4b6c32482fd028fc606e8 100644 --- a/assets/openrouter-BNf4jDuS.js +++ b/assets/openrouter-DrXWVMlM.js @@ -1 +1 @@ -import{u as r}from"./useQuery-Cngk7eL9.js";import{c as n}from"./chat-DGBJkcmd.js";const u=["chat","openrouter","usage"],o=["chat","openrouter","credential"];function s(e=!0){return r({queryKey:u,queryFn:()=>n.getUsage(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0})}function c(e=!0){return r({queryKey:o,queryFn:()=>n.getOpenRouterCredential(),enabled:e,refetchOnWindowFocus:!0})}function m(e){const t=new Date(e);return{local:new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t),utc:`${t.toLocaleString("en-GB",{timeZone:"UTC",year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})} UTC`}}export{o as O,s as a,m as r,c as u}; +import{u as r}from"./useQuery-CUJUm4FY.js";import{c as n}from"./chat-ChnK8XDU.js";const u=["chat","openrouter","usage"],o=["chat","openrouter","credential"];function s(e=!0){return r({queryKey:u,queryFn:()=>n.getUsage(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0})}function c(e=!0){return r({queryKey:o,queryFn:()=>n.getOpenRouterCredential(),enabled:e,refetchOnWindowFocus:!0})}function m(e){const t=new Date(e);return{local:new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t),utc:`${t.toLocaleString("en-GB",{timeZone:"UTC",year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})} UTC`}}export{o as O,s as a,m as r,c as u}; diff --git a/assets/paperEdits-BD6cBS3E.js b/assets/paperEdits-DUTCoe5T.js similarity index 84% rename from assets/paperEdits-BD6cBS3E.js rename to assets/paperEdits-DUTCoe5T.js index 5dcdea755309e0bd36fc2b1b37e3d4ee09cb39d1..e5af1f7766e6fff1d2938ee808fec399dca635ce 100644 --- a/assets/paperEdits-BD6cBS3E.js +++ b/assets/paperEdits-DUTCoe5T.js @@ -1 +1 @@ -import{a3 as p}from"./index-CqKcHUvZ.js";const a={authorization:e=>p(`/paper-edit-authorizations/${encodeURIComponent(e)}`),approve:e=>p(`/paper-edit-authorizations/${encodeURIComponent(e)}/approve`,{method:"POST"}),digest:(e,t)=>p(`/admin/paper-edit-digest?day=${e}&page=${t}`),suspend:(e,t)=>p("/admin/paper-edit-suspension",{method:"POST",body:JSON.stringify({hf_subject:e,suspended:t})})};export{a as p}; +import{a5 as p}from"./index-D6jcIRWs.js";const a={authorization:e=>p(`/paper-edit-authorizations/${encodeURIComponent(e)}`),approve:e=>p(`/paper-edit-authorizations/${encodeURIComponent(e)}/approve`,{method:"POST"}),digest:(e,t)=>p(`/admin/paper-edit-digest?day=${e}&page=${t}`),suspend:(e,t)=>p("/admin/paper-edit-suspension",{method:"POST",body:JSON.stringify({hf_subject:e,suspended:t})})};export{a as p}; diff --git a/assets/papers-DIIIPDpj.js b/assets/papers-DIIIPDpj.js new file mode 100644 index 0000000000000000000000000000000000000000..036fcd779415daed415a08c1bafd64fd017cf43a --- /dev/null +++ b/assets/papers-DIIIPDpj.js @@ -0,0 +1 @@ +var y=Object.defineProperty;var w=(a,e,t)=>e in a?y(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var m=(a,e,t)=>w(a,typeof e!="symbol"?e+"":e,t);import{A as f,aP as v,a5 as l,aQ as S,aR as $}from"./index-D6jcIRWs.js";const T={detail:a=>["paper",a],arxiv:a=>["paper-arxiv",a],preview:a=>["paper-preview",a],summary:a=>["paper-summary",a],feeds:{list:["papers"],infinite:["papers-infinite"],xTrending:["x-trending-papers-infinite"],search:["paper-search-feed"],task:["task-papers-infinite"],conference:["conference-papers-infinite"],organization:["organization-papers-infinite"],method:["method-papers-infinite"],saved:["my-bookmarks"],related:["related-papers"],versions:["paper-versions"],searchOverlay:["search-papers"],mentions:["chat-paper-mention-search"],trending:["trending-papers"]}},d="pwc:fresh-auth-mutation";function P(a){if(typeof window>"u")return;sessionStorage.setItem("pwc:fresh-auth-edit",a);const e=v("/api/v1/auth/hf/login");window.location.assign(`${e}?return_to=${encodeURIComponent(window.location.href)}`)}class q{constructor(e,t=P){m(this,"paperLoads",new Map);m(this,"evaluationLoads",new Map);this.request=e,this.recoverFreshAuth=t}primePaper(e,t=!1){t&&this.paperLoads.delete(e);let r=this.paperLoads.get(e);return r||(r=this.request(`/papers/${e}/curation-state`).catch(s=>{throw this.paperLoads.delete(e),s}),this.paperLoads.set(e,r)),r}primeEvaluations(e,t=!1){t&&this.evaluationLoads.delete(e);let r=this.evaluationLoads.get(e);return r||(r=this.request(`/evaluations/curation-state?paper_id=${e}`).catch(s=>{throw this.evaluationLoads.delete(e),s}),this.evaluationLoads.set(e,r)),r}async mutatePaper(e,t,r,s,o){const n=this.paperLoads.get(e);if(!n)throw new Error("The catalog version was not loaded when this editor opened. Close and reopen the editor.");const i=(await n).sections[t];if(!i)throw new Error(`Missing curation version for ${t}`);return this.mutate(t,s,r,i,o,`paper:${e}:${t}`)}async mutateEvaluations(e,t,r,s){const o=this.evaluationLoads.get(String(e));if(!o)throw new Error("The evaluation version was not loaded when this editor opened. Close and reopen the editor.");const n=(await o).version;return this.mutate("evaluations",r,t,n,s,`paper:${e}:evaluations`)}async mutate(e,t,r,s,o,n){const i=new Headers(o.headers);Object.entries(this.idempotencyHeaders(n,r,s)).forEach(([p,g])=>i.set(p,g));const c={...o,headers:i};try{const p=await this.request(t,c);return this.clearAttempt(c),p}catch(p){throw p instanceof f&&p.status===401&&p.code==="fresh_auth_required"?(this.saveFreshAuthMutation(e,t,r,c),this.recoverFreshAuth(e)):p instanceof f&&p.status===409&&(this.clearAttempt(c),typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:catalog-conflict",{detail:{endpoint:t}}))),p}}freshAuthMutationDraft(){const e=sessionStorage.getItem(d);if(!e)return null;try{const t=JSON.parse(e);if(!t.endpoint.startsWith("/")||t.endpoint.startsWith("//")||!["POST","PUT","PATCH","DELETE"].includes(t.options.method))throw new Error("Invalid saved mutation draft");return t}catch{return sessionStorage.removeItem(d),null}}async resumeFreshAuthMutation(){const e=this.freshAuthMutationDraft();if(!e)throw new Error("No saved catalog edit is available.");const t=await this.request(e.endpoint,{method:e.options.method,body:e.options.body,headers:e.options.headers});return this.clearAttempt({headers:e.options.headers}),sessionStorage.removeItem(d),sessionStorage.removeItem("pwc:fresh-auth-edit"),t}saveFreshAuthMutation(e,t,r,s){const o=Object.fromEntries(new Headers(s.headers).entries()),n=typeof s.body=="string"?s.body:void 0;sessionStorage.setItem(d,JSON.stringify({section:e,endpoint:t,payload:r,options:{method:(s.method??"POST").toUpperCase(),body:n,headers:o}}))}idempotencyHeaders(e,t,r){const s=`pwc:mutation:${e}:${JSON.stringify(t)}`,o=sessionStorage.getItem(s);if(o){const i=JSON.parse(o);return{"Idempotency-Key":i.key,"If-Match":i.version}}const n=crypto.randomUUID();return sessionStorage.setItem(s,JSON.stringify({key:n,version:r})),sessionStorage.setItem(`pwc:mutation-key:${n}`,s),{"Idempotency-Key":n,"If-Match":r}}clearAttempt(e){const t=new Headers(e.headers).get("Idempotency-Key");if(!t)return;const r=sessionStorage.getItem(`pwc:mutation-key:${t}`);r&&sessionStorage.removeItem(r),sessionStorage.removeItem(`pwc:mutation-key:${t}`),this.paperLoads.clear(),this.evaluationLoads.clear()}}const u=new q(l);function h(a){const e=new URLSearchParams;for(const[r,s]of Object.entries(a??{}))s!==void 0&&s!==""&&e.set(r,String(s));const t=e.toString();return t?`?${t}`:""}class O{constructor(e){this.request=e}list(e){const t=new URLSearchParams;for(const[s,o]of Object.entries(e??{}))o!==void 0&&o!==""&&t.set(s,String(o));const r=t.toString();return this.request(`/papers/${r?`?${r}`:""}`,{cache:"no-cache"})}search(e,t=1,r=10,s,o,n){const i=new URLSearchParams({q:e,page:t.toString(),page_size:r.toString()});return s&&i.set("mode",s),n!=null&&n.start_date&&i.set("start_date",n.start_date),n!=null&&n.end_date&&i.set("end_date",n.end_date),this.request(`/papers/search?${i.toString()}`,{signal:o})}searchFeed(e){return this.request(`/papers/search/feed${h(e)}`,{cache:"no-cache"})}get(e,t=!0){const r=t?"?include_resources=true":"";return this.request(`/papers/${e}${r}`)}getByArxivId(e,t=!0){const r=t?"?include_resources=true":"";return this.request(`/papers/arxiv/${e}${r}`)}lookup(e){return this.request("/papers/lookup",{method:"POST",body:JSON.stringify({references:e})})}related(e,t=4){return this.request(`/papers/${encodeURIComponent(e)}/related?limit=${t}`)}suggestedQuestions(e){return this.request(`/papers/${encodeURIComponent(e)}/suggested-questions`)}versions(e){return this.request(`/papers/arxiv/${e}/versions`)}indexFromArxiv(e){return this.request(`/papers/index/${e}`,{method:"POST"})}submit(e){return this.request("/papers/submit",{method:"POST",body:JSON.stringify(e)})}copyToBucket(e,t){return this.request(`/papers/${encodeURIComponent(e)}/copy-to-bucket`,{method:"POST",body:JSON.stringify(t)})}trending(e){const t=new URLSearchParams;for(const[s,o]of Object.entries(e??{}))o!==void 0&&t.set(s,String(o));const r=t.toString();return this.request(`/papers/trending${r?`?${r}`:""}`,{cache:"no-store"})}xTrending(e){return this.request(`/papers/x-trending${h(e)}`)}forTask(e,t){return this.request(`/tasks/${e}/papers${h(t)}`)}forMethod(e,t){return this.request(`/methods/${encodeURIComponent(e)}/papers${h(t)}`)}forConference(e,t){return this.request(`/conferences/${e}/papers${h(t)}`)}forOrganization(e,t){return this.request(`/organizations/${e}/papers${h(t)}`)}getAuthor(e){return this.request(`/authors/${e}`)}searchAuthors(e,t){return this.request(`/authors/${h({search:e,page_size:t})}`)}primeCurationState(e,t=!1){return u.primePaper(e,t)}freshAuthMutationDraft(){return u.freshAuthMutationDraft()}resumeFreshAuthMutation(){return u.resumeFreshAuthMutation()}updateTasks(e,t){const r=new URLSearchParams(t.map(s=>["task_ids",String(s)])).toString();return u.mutatePaper(e,"tasks",t,`/papers/${e}/tasks?${r}`,{method:"PUT"})}updateMethods(e,t){const r=new URLSearchParams(t.map(s=>["method_ids",String(s)])).toString();return u.mutatePaper(e,"methods",t,`/papers/${e}/methods?${r}`,{method:"PUT"})}updateOrganizations(e,t){const r=new URLSearchParams(t.map(s=>["organization_ids",String(s)])).toString();return u.mutatePaper(e,"organizations",t,`/papers/${e}/organizations?${r}`,{method:"PUT"})}updateRepositories(e,t){return u.mutatePaper(e,"repositories",t,`/papers/${e}/repositories`,{method:"PUT",body:JSON.stringify({repositories:t})})}updateProjectPages(e,t){return u.mutatePaper(e,"project_pages",t,`/papers/${e}/project-pages`,{method:"PUT",body:JSON.stringify({project_pages:t})})}updateXThreads(e,t){return u.mutatePaper(e,"x_threads",t,`/papers/${e}/x-threads`,{method:"PUT",body:JSON.stringify({x_threads:t})})}updateSourceUrl(e,t){return u.mutatePaper(e,"source_url",t,`/papers/${e}/source-url`,{method:"PUT",body:JSON.stringify({source_url:t})})}updateHfArtifacts(e,t){return u.mutatePaper(e,"hf_artifacts",t,`/papers/${e}/hf-artifacts`,{method:"PUT",body:JSON.stringify(t)})}}const _=new O(l);async function b(a){return(await S(`/papers/${encodeURIComponent(a)}/web-markdown`)).text()}function k(a){return $(`/papers/${encodeURIComponent(a)}/layout`)}export{_ as a,k as b,u as c,b as g,T as p}; diff --git a/assets/papers-bE3C_Qzl.js b/assets/papers-bE3C_Qzl.js deleted file mode 100644 index f1d71ef5ca4c7d7b961eb6378a9063480508cff5..0000000000000000000000000000000000000000 --- a/assets/papers-bE3C_Qzl.js +++ /dev/null @@ -1 +0,0 @@ -var w=Object.defineProperty;var v=(a,e,t)=>e in a?w(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var f=(a,e,t)=>v(a,typeof e!="symbol"?e+"":e,t);import{A as m,J as S,a3 as l,au as g}from"./index-CqKcHUvZ.js";const A={detail:a=>["paper",a],arxiv:a=>["paper-arxiv",a],preview:a=>["paper-preview",a],summary:a=>["paper-summary",a],feeds:{list:["papers"],infinite:["papers-infinite"],xTrending:["x-trending-papers-infinite"],search:["paper-search-feed"],task:["task-papers-infinite"],conference:["conference-papers-infinite"],organization:["organization-papers-infinite"],method:["method-papers-infinite"],saved:["my-bookmarks"],related:["related-papers"],versions:["paper-versions"],searchOverlay:["search-papers"],mentions:["chat-paper-mention-search"],trending:["trending-papers"]}},d="pwc:fresh-auth-mutation";function $(a){if(typeof window>"u")return;sessionStorage.setItem("pwc:fresh-auth-edit",a);const e=S("/api/v1/auth/hf/login");window.location.assign(`${e}?return_to=${encodeURIComponent(window.location.href)}`)}class P{constructor(e,t=$){f(this,"paperLoads",new Map);f(this,"evaluationLoads",new Map);this.request=e,this.recoverFreshAuth=t}primePaper(e,t=!1){t&&this.paperLoads.delete(e);let r=this.paperLoads.get(e);return r||(r=this.request(`/papers/${e}/curation-state`).catch(s=>{throw this.paperLoads.delete(e),s}),this.paperLoads.set(e,r)),r}primeEvaluations(e,t=!1){t&&this.evaluationLoads.delete(e);let r=this.evaluationLoads.get(e);return r||(r=this.request(`/evaluations/curation-state?paper_id=${e}`).catch(s=>{throw this.evaluationLoads.delete(e),s}),this.evaluationLoads.set(e,r)),r}async mutatePaper(e,t,r,s,o){const n=this.paperLoads.get(e);if(!n)throw new Error("The catalog version was not loaded when this editor opened. Close and reopen the editor.");const i=(await n).sections[t];if(!i)throw new Error(`Missing curation version for ${t}`);return this.mutate(t,s,r,i,o,`paper:${e}:${t}`)}async mutateEvaluations(e,t,r,s){const o=this.evaluationLoads.get(String(e));if(!o)throw new Error("The evaluation version was not loaded when this editor opened. Close and reopen the editor.");const n=(await o).version;return this.mutate("evaluations",r,t,n,s,`paper:${e}:evaluations`)}async mutate(e,t,r,s,o,n){const i=new Headers(o.headers);Object.entries(this.idempotencyHeaders(n,r,s)).forEach(([h,y])=>i.set(h,y));const c={...o,headers:i};try{const h=await this.request(t,c);return this.clearAttempt(c),h}catch(h){throw h instanceof m&&h.status===401&&h.code==="fresh_auth_required"?(this.saveFreshAuthMutation(e,t,r,c),this.recoverFreshAuth(e)):h instanceof m&&h.status===409&&(this.clearAttempt(c),typeof window<"u"&&window.dispatchEvent(new CustomEvent("pwc:catalog-conflict",{detail:{endpoint:t}}))),h}}freshAuthMutationDraft(){const e=sessionStorage.getItem(d);if(!e)return null;try{const t=JSON.parse(e);if(!t.endpoint.startsWith("/")||t.endpoint.startsWith("//")||!["POST","PUT","PATCH","DELETE"].includes(t.options.method))throw new Error("Invalid saved mutation draft");return t}catch{return sessionStorage.removeItem(d),null}}async resumeFreshAuthMutation(){const e=this.freshAuthMutationDraft();if(!e)throw new Error("No saved catalog edit is available.");const t=await this.request(e.endpoint,{method:e.options.method,body:e.options.body,headers:e.options.headers});return this.clearAttempt({headers:e.options.headers}),sessionStorage.removeItem(d),sessionStorage.removeItem("pwc:fresh-auth-edit"),t}saveFreshAuthMutation(e,t,r,s){const o=Object.fromEntries(new Headers(s.headers).entries()),n=typeof s.body=="string"?s.body:void 0;sessionStorage.setItem(d,JSON.stringify({section:e,endpoint:t,payload:r,options:{method:(s.method??"POST").toUpperCase(),body:n,headers:o}}))}idempotencyHeaders(e,t,r){const s=`pwc:mutation:${e}:${JSON.stringify(t)}`,o=sessionStorage.getItem(s);if(o){const i=JSON.parse(o);return{"Idempotency-Key":i.key,"If-Match":i.version}}const n=crypto.randomUUID();return sessionStorage.setItem(s,JSON.stringify({key:n,version:r})),sessionStorage.setItem(`pwc:mutation-key:${n}`,s),{"Idempotency-Key":n,"If-Match":r}}clearAttempt(e){const t=new Headers(e.headers).get("Idempotency-Key");if(!t)return;const r=sessionStorage.getItem(`pwc:mutation-key:${t}`);r&&sessionStorage.removeItem(r),sessionStorage.removeItem(`pwc:mutation-key:${t}`),this.paperLoads.clear(),this.evaluationLoads.clear()}}const u=new P(l);function p(a){const e=new URLSearchParams;for(const[r,s]of Object.entries(a??{}))s!==void 0&&s!==""&&e.set(r,String(s));const t=e.toString();return t?`?${t}`:""}class q{constructor(e){this.request=e}list(e){const t=new URLSearchParams;for(const[s,o]of Object.entries(e??{}))o!==void 0&&o!==""&&t.set(s,String(o));const r=t.toString();return this.request(`/papers/${r?`?${r}`:""}`,{cache:"no-cache"})}search(e,t=1,r=10,s,o,n){const i=new URLSearchParams({q:e,page:t.toString(),page_size:r.toString()});return s&&i.set("mode",s),n!=null&&n.start_date&&i.set("start_date",n.start_date),n!=null&&n.end_date&&i.set("end_date",n.end_date),this.request(`/papers/search?${i.toString()}`,{signal:o})}searchFeed(e){return this.request(`/papers/search/feed${p(e)}`,{cache:"no-cache"})}get(e,t=!0){const r=t?"?include_resources=true":"";return this.request(`/papers/${e}${r}`)}getByArxivId(e,t=!0){const r=t?"?include_resources=true":"";return this.request(`/papers/arxiv/${e}${r}`)}lookup(e){return this.request("/papers/lookup",{method:"POST",body:JSON.stringify({references:e})})}related(e,t=4){return this.request(`/papers/${encodeURIComponent(e)}/related?limit=${t}`)}suggestedQuestions(e){return this.request(`/papers/${encodeURIComponent(e)}/suggested-questions`)}versions(e){return this.request(`/papers/arxiv/${e}/versions`)}indexFromArxiv(e){return this.request(`/papers/index/${e}`,{method:"POST"})}submit(e){return this.request("/papers/submit",{method:"POST",body:JSON.stringify(e)})}copyToBucket(e,t){return this.request(`/papers/${encodeURIComponent(e)}/copy-to-bucket`,{method:"POST",body:JSON.stringify(t)})}trending(e){const t=new URLSearchParams;for(const[s,o]of Object.entries(e??{}))o!==void 0&&t.set(s,String(o));const r=t.toString();return this.request(`/papers/trending${r?`?${r}`:""}`,{cache:"no-store"})}xTrending(e){return this.request(`/papers/x-trending${p(e)}`)}forTask(e,t){return this.request(`/tasks/${e}/papers${p(t)}`)}forMethod(e,t){return this.request(`/methods/${encodeURIComponent(e)}/papers${p(t)}`)}forConference(e,t){return this.request(`/conferences/${e}/papers${p(t)}`)}forOrganization(e,t){return this.request(`/organizations/${e}/papers${p(t)}`)}getAuthor(e){return this.request(`/authors/${e}`)}searchAuthors(e,t){return this.request(`/authors/${p({search:e,page_size:t})}`)}primeCurationState(e,t=!1){return u.primePaper(e,t)}freshAuthMutationDraft(){return u.freshAuthMutationDraft()}resumeFreshAuthMutation(){return u.resumeFreshAuthMutation()}updateTasks(e,t){const r=new URLSearchParams(t.map(s=>["task_ids",String(s)])).toString();return u.mutatePaper(e,"tasks",t,`/papers/${e}/tasks?${r}`,{method:"PUT"})}updateMethods(e,t){const r=new URLSearchParams(t.map(s=>["method_ids",String(s)])).toString();return u.mutatePaper(e,"methods",t,`/papers/${e}/methods?${r}`,{method:"PUT"})}updateOrganizations(e,t){const r=new URLSearchParams(t.map(s=>["organization_ids",String(s)])).toString();return u.mutatePaper(e,"organizations",t,`/papers/${e}/organizations?${r}`,{method:"PUT"})}updateRepositories(e,t){return u.mutatePaper(e,"repositories",t,`/papers/${e}/repositories`,{method:"PUT",body:JSON.stringify({repositories:t})})}updateProjectPages(e,t){return u.mutatePaper(e,"project_pages",t,`/papers/${e}/project-pages`,{method:"PUT",body:JSON.stringify({project_pages:t})})}updateXThreads(e,t){return u.mutatePaper(e,"x_threads",t,`/papers/${e}/x-threads`,{method:"PUT",body:JSON.stringify({x_threads:t})})}updateSourceUrl(e,t){return u.mutatePaper(e,"source_url",t,`/papers/${e}/source-url`,{method:"PUT",body:JSON.stringify({source_url:t})})}updateHfArtifacts(e,t){return u.mutatePaper(e,"hf_artifacts",t,`/papers/${e}/hf-artifacts`,{method:"PUT",body:JSON.stringify(t)})}}const T=new q(l);async function _(a){const e=await g(`/papers/${encodeURIComponent(a)}/web-markdown`);if(!e.ok)throw new m(e,await e.text());return e.text()}async function b(a){const e=await g(`/papers/${encodeURIComponent(a)}/layout`);if(e.status===404)return null;if(!e.ok)throw new m(e,await e.text());return e.json()}export{T as a,b,u as c,_ as g,A as p}; diff --git a/assets/plus-DZF-NxR0.js b/assets/plus-C4UQ62Q1.js similarity index 86% rename from assets/plus-DZF-NxR0.js rename to assets/plus-C4UQ62Q1.js index 1bb362e953cddd868eb73c55e8634286912c027a..142b2da6bd21da3f0e0c1b40857ce477e18dc9e1 100644 --- a/assets/plus-DZF-NxR0.js +++ b/assets/plus-C4UQ62Q1.js @@ -1,4 +1,4 @@ -import{n as e}from"./index-CqKcHUvZ.js";/** +import{n as e}from"./index-D6jcIRWs.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/popover-BcoS9Jmp.js b/assets/popover-DCjqGpW0.js similarity index 97% rename from assets/popover-BcoS9Jmp.js rename to assets/popover-DCjqGpW0.js index 118ee6c1f0ac12fd71b72b00589b133cd27365b6..742465fa2dc4937f83c07b2e0b1b6fb8dd5ff819 100644 --- a/assets/popover-BcoS9Jmp.js +++ b/assets/popover-DCjqGpW0.js @@ -1 +1 @@ -import{r as s,j as l,ab as V,v as $,ah as L,a6 as W,w as A,t as O,x as h,ai as E,aj as y,P as _,ak as H,z,al as B,am as G,an as K,ao as Z,ap as q,aq as U,ar as J,B as Q}from"./index-CqKcHUvZ.js";function X(e){const t=Y(e),r=s.forwardRef((n,o)=>{const{children:a,...c}=n,i=s.Children.toArray(a),p=i.find(oe);if(p){const u=p.props.children,P=i.map(f=>f===p?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return l.jsx(t,{...c,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,P):null})}return l.jsx(t,{...c,ref:o,children:a})});return r.displayName=`${e}.Slot`,r}function Y(e){const t=s.forwardRef((r,n)=>{const{children:o,...a}=r;if(s.isValidElement(o)){const c=re(o),i=te(a,o.props);return o.type!==s.Fragment&&(i.ref=n?V(n,c):c),s.cloneElement(o,i)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ee=Symbol("radix.slottable");function oe(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ee}function te(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...i)=>{const p=a(...i);return o(...i),p}:o&&(r[n]=o):n==="style"?r[n]={...o,...a}:n==="className"&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}function re(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var C="Popover",[b]=z(C,[y]),m=y(),[ne,d]=b(C),j=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:a,modal:c=!1}=e,i=m(t),p=s.useRef(null),[u,P]=s.useState(!1),[f,v]=$({prop:n,defaultProp:o??!1,onChange:a,caller:C});return l.jsx(L,{...i,children:l.jsx(ne,{scope:t,contentId:W(),triggerRef:p,open:f,onOpenChange:v,onOpenToggle:s.useCallback(()=>v(x=>!x),[v]),hasCustomAnchor:u,onCustomAnchorAdd:s.useCallback(()=>P(!0),[]),onCustomAnchorRemove:s.useCallback(()=>P(!1),[]),modal:c,children:r})})};j.displayName=C;var w="PopoverAnchor",ae=s.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(w,r),a=m(r),{onCustomAnchorAdd:c,onCustomAnchorRemove:i}=o;return s.useEffect(()=>(c(),()=>i()),[c,i]),l.jsx(E,{...a,...n,ref:t})});ae.displayName=w;var S="PopoverTrigger",N=s.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(S,r),a=m(r),c=A(t,o.triggerRef),i=l.jsx(O.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":M(o.open),...n,ref:c,onClick:h(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?i:l.jsx(E,{asChild:!0,...a,children:i})});N.displayName=S;var R="PopoverPortal",[se,ce]=b(R,{forceMount:void 0}),F=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,a=d(R,t);return l.jsx(se,{scope:t,forceMount:r,children:l.jsx(_,{present:r||a.open,children:l.jsx(H,{asChild:!0,container:o,children:n})})})};F.displayName=R;var g="PopoverContent",D=s.forwardRef((e,t)=>{const r=ce(g,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,a=d(g,e.__scopePopover);return l.jsx(_,{present:n||a.open,children:a.modal?l.jsx(le,{...o,ref:t}):l.jsx(pe,{...o,ref:t})})});D.displayName=g;var ie=X("PopoverContent.RemoveScroll"),le=s.forwardRef((e,t)=>{const r=d(g,e.__scopePopover),n=s.useRef(null),o=A(t,n),a=s.useRef(!1);return s.useEffect(()=>{const c=n.current;if(c)return B(c)},[]),l.jsx(G,{as:ie,allowPinchZoom:!0,children:l.jsx(I,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:h(e.onCloseAutoFocus,c=>{var i;c.preventDefault(),a.current||(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:h(e.onPointerDownOutside,c=>{const i=c.detail.originalEvent,p=i.button===0&&i.ctrlKey===!0,u=i.button===2||p;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:h(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),pe=s.forwardRef((e,t)=>{const r=d(g,e.__scopePopover),n=s.useRef(!1),o=s.useRef(!1);return l.jsx(I,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var c,i;(c=e.onCloseAutoFocus)==null||c.call(e,a),a.defaultPrevented||(n.current||(i=r.triggerRef.current)==null||i.focus(),a.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:a=>{var p,u;(p=e.onInteractOutside)==null||p.call(e,a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=a.target;((u=r.triggerRef.current)==null?void 0:u.contains(c))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),I=s.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEscapeKeyDown:i,onPointerDownOutside:p,onFocusOutside:u,onInteractOutside:P,...f}=e,v=d(g,r),x=m(r);return K(),l.jsx(Z,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:a,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=s.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(T,r);return l.jsx(O.button,{type:"button",...n,ref:t,onClick:h(e.onClick,()=>o.onOpenChange(!1))})});ue.displayName=T;var de="PopoverArrow",fe=s.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=m(r);return l.jsx(J,{...o,...n,ref:t})});fe.displayName=de;function M(e){return e?"open":"closed"}var ve=j,Pe=N,ge=F,k=D;const Ce=ve,xe=Pe,he=s.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},o)=>l.jsx(ge,{children:l.jsx(k,{ref:o,align:t,sideOffset:r,className:Q("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));he.displayName=k.displayName;export{Ce as P,xe as a,he as b}; +import{r as s,j as l,ad as V,v as $,aj as L,a8 as W,w as A,t as O,x as h,ak as E,al as y,P as _,am as H,z,an as B,ao as G,ap as K,aq as Z,ar as q,as as U,at as J,B as Q}from"./index-D6jcIRWs.js";function X(e){const t=Y(e),r=s.forwardRef((n,o)=>{const{children:a,...c}=n,i=s.Children.toArray(a),p=i.find(oe);if(p){const u=p.props.children,P=i.map(f=>f===p?s.Children.count(u)>1?s.Children.only(null):s.isValidElement(u)?u.props.children:null:f);return l.jsx(t,{...c,ref:o,children:s.isValidElement(u)?s.cloneElement(u,void 0,P):null})}return l.jsx(t,{...c,ref:o,children:a})});return r.displayName=`${e}.Slot`,r}function Y(e){const t=s.forwardRef((r,n)=>{const{children:o,...a}=r;if(s.isValidElement(o)){const c=re(o),i=te(a,o.props);return o.type!==s.Fragment&&(i.ref=n?V(n,c):c),s.cloneElement(o,i)}return s.Children.count(o)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ee=Symbol("radix.slottable");function oe(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ee}function te(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...i)=>{const p=a(...i);return o(...i),p}:o&&(r[n]=o):n==="style"?r[n]={...o,...a}:n==="className"&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}function re(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var C="Popover",[b]=z(C,[y]),m=y(),[ne,d]=b(C),j=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:a,modal:c=!1}=e,i=m(t),p=s.useRef(null),[u,P]=s.useState(!1),[f,v]=$({prop:n,defaultProp:o??!1,onChange:a,caller:C});return l.jsx(L,{...i,children:l.jsx(ne,{scope:t,contentId:W(),triggerRef:p,open:f,onOpenChange:v,onOpenToggle:s.useCallback(()=>v(x=>!x),[v]),hasCustomAnchor:u,onCustomAnchorAdd:s.useCallback(()=>P(!0),[]),onCustomAnchorRemove:s.useCallback(()=>P(!1),[]),modal:c,children:r})})};j.displayName=C;var w="PopoverAnchor",ae=s.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(w,r),a=m(r),{onCustomAnchorAdd:c,onCustomAnchorRemove:i}=o;return s.useEffect(()=>(c(),()=>i()),[c,i]),l.jsx(E,{...a,...n,ref:t})});ae.displayName=w;var S="PopoverTrigger",N=s.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(S,r),a=m(r),c=A(t,o.triggerRef),i=l.jsx(O.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":M(o.open),...n,ref:c,onClick:h(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?i:l.jsx(E,{asChild:!0,...a,children:i})});N.displayName=S;var R="PopoverPortal",[se,ce]=b(R,{forceMount:void 0}),F=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,a=d(R,t);return l.jsx(se,{scope:t,forceMount:r,children:l.jsx(_,{present:r||a.open,children:l.jsx(H,{asChild:!0,container:o,children:n})})})};F.displayName=R;var g="PopoverContent",D=s.forwardRef((e,t)=>{const r=ce(g,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,a=d(g,e.__scopePopover);return l.jsx(_,{present:n||a.open,children:a.modal?l.jsx(le,{...o,ref:t}):l.jsx(pe,{...o,ref:t})})});D.displayName=g;var ie=X("PopoverContent.RemoveScroll"),le=s.forwardRef((e,t)=>{const r=d(g,e.__scopePopover),n=s.useRef(null),o=A(t,n),a=s.useRef(!1);return s.useEffect(()=>{const c=n.current;if(c)return B(c)},[]),l.jsx(G,{as:ie,allowPinchZoom:!0,children:l.jsx(I,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:h(e.onCloseAutoFocus,c=>{var i;c.preventDefault(),a.current||(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:h(e.onPointerDownOutside,c=>{const i=c.detail.originalEvent,p=i.button===0&&i.ctrlKey===!0,u=i.button===2||p;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:h(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),pe=s.forwardRef((e,t)=>{const r=d(g,e.__scopePopover),n=s.useRef(!1),o=s.useRef(!1);return l.jsx(I,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var c,i;(c=e.onCloseAutoFocus)==null||c.call(e,a),a.defaultPrevented||(n.current||(i=r.triggerRef.current)==null||i.focus(),a.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:a=>{var p,u;(p=e.onInteractOutside)==null||p.call(e,a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=a.target;((u=r.triggerRef.current)==null?void 0:u.contains(c))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),I=s.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEscapeKeyDown:i,onPointerDownOutside:p,onFocusOutside:u,onInteractOutside:P,...f}=e,v=d(g,r),x=m(r);return K(),l.jsx(Z,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:a,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=s.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=d(T,r);return l.jsx(O.button,{type:"button",...n,ref:t,onClick:h(e.onClick,()=>o.onOpenChange(!1))})});ue.displayName=T;var de="PopoverArrow",fe=s.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=m(r);return l.jsx(J,{...o,...n,ref:t})});fe.displayName=de;function M(e){return e?"open":"closed"}var ve=j,Pe=N,ge=F,k=D;const Ce=ve,xe=Pe,he=s.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},o)=>l.jsx(ge,{children:l.jsx(k,{ref:o,align:t,sideOffset:r,className:Q("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));he.displayName=k.displayName;export{Ce as P,xe as a,he as b}; diff --git a/assets/queryInvalidation-fI4V8eHx.js b/assets/queryInvalidation-BxCpTdQe.js similarity index 94% rename from assets/queryInvalidation-fI4V8eHx.js rename to assets/queryInvalidation-BxCpTdQe.js index 785bbf7cc78e1428cff5690baa7d6921e8fb50e6..12b24f246437e33905f907f58bd197d9b712b7ee 100644 --- a/assets/queryInvalidation-fI4V8eHx.js +++ b/assets/queryInvalidation-BxCpTdQe.js @@ -1 +1 @@ -import{p as a}from"./papers-bE3C_Qzl.js";function o(e,s,n){if(!e)return e;const i=r=>r.paper_id!==s||r.paper_title===n?r:{...r,paper_title:n};if(Array.isArray(e)){const r=e.map(i);return r.some((t,u)=>t!==e[u])?r:e}if(Array.isArray(e.results)){const r=e.results.map(i);return r.some((t,u)=>t!==e.results[u])?{...e,results:r}:e}return e}function v(e,s){const n=new Set(s.filter(i=>!!i));for(const i of n)for(const r of[a.detail(i),a.arxiv(i),a.preview(i),a.summary(i)])e.invalidateQueries({queryKey:r,exact:!0})}function f(e){for(const s of Object.values(a.feeds))e.invalidateQueries({queryKey:s,refetchType:"none"})}function p(e,s,n){new Set([...n,s.id,s.arxiv_id].filter(t=>!!t)).forEach(t=>{e.setQueryData(a.detail(t),s),e.setQueryData(a.arxiv(t),s),e.setQueriesData({queryKey:a.preview(t),exact:!0},s),e.setQueriesData({queryKey:a.summary(t),exact:!0},s)}),f(e);const r=String(s.id),c=t=>o(t,r,s.title);e.setQueriesData({queryKey:["evaluations"]},c),e.setQueriesData({queryKey:["dataset-evals"]},c),e.invalidateQueries({queryKey:["evaluations"],refetchType:"none"}),e.invalidateQueries({queryKey:["dataset-evals"],refetchType:"none"})}export{f as a,v as i,p as r}; +import{p as a}from"./papers-DIIIPDpj.js";function o(e,s,n){if(!e)return e;const i=r=>r.paper_id!==s||r.paper_title===n?r:{...r,paper_title:n};if(Array.isArray(e)){const r=e.map(i);return r.some((t,u)=>t!==e[u])?r:e}if(Array.isArray(e.results)){const r=e.results.map(i);return r.some((t,u)=>t!==e.results[u])?{...e,results:r}:e}return e}function v(e,s){const n=new Set(s.filter(i=>!!i));for(const i of n)for(const r of[a.detail(i),a.arxiv(i),a.preview(i),a.summary(i)])e.invalidateQueries({queryKey:r,exact:!0})}function f(e){for(const s of Object.values(a.feeds))e.invalidateQueries({queryKey:s,refetchType:"none"})}function p(e,s,n){new Set([...n,s.id,s.arxiv_id].filter(t=>!!t)).forEach(t=>{e.setQueryData(a.detail(t),s),e.setQueryData(a.arxiv(t),s),e.setQueriesData({queryKey:a.preview(t),exact:!0},s),e.setQueriesData({queryKey:a.summary(t),exact:!0},s)}),f(e);const r=String(s.id),c=t=>o(t,r,s.title);e.setQueriesData({queryKey:["evaluations"]},c),e.setQueriesData({queryKey:["dataset-evals"]},c),e.invalidateQueries({queryKey:["evaluations"],refetchType:"none"}),e.invalidateQueries({queryKey:["dataset-evals"],refetchType:"none"})}export{f as a,v as i,p as r}; diff --git a/assets/refresh-cw-gVdSyglp.js b/assets/refresh-cw-Qmu3JZxd.js similarity index 94% rename from assets/refresh-cw-gVdSyglp.js rename to assets/refresh-cw-Qmu3JZxd.js index 7a76b5f1163935ba65fac6856149f1ce934dfdf9..ef5b71fccd203ede87ad65adfd458ad979036135 100644 --- a/assets/refresh-cw-gVdSyglp.js +++ b/assets/refresh-cw-Qmu3JZxd.js @@ -1,4 +1,4 @@ -import{n as e}from"./index-CqKcHUvZ.js";/** +import{n as e}from"./index-D6jcIRWs.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/research-Dt0MUW0x.js b/assets/research-BggtGgC2.js similarity index 91% rename from assets/research-Dt0MUW0x.js rename to assets/research-BggtGgC2.js index af1e363916e74f954866c05fb1cdc76f7fff4023..62d6f55ed8b63a380bc15a876f0bedc6ce70d9fb 100644 --- a/assets/research-Dt0MUW0x.js +++ b/assets/research-BggtGgC2.js @@ -1 +1 @@ -import{a3 as t}from"./index-CqKcHUvZ.js";const i=300,m={follows:()=>t("/me/follows"),followSuggestions:()=>t("/research/follow-suggestions"),setFollow:(o,e,a)=>t(`/me/follows/${o}/${e}`,{method:a?"PUT":"DELETE"}),following:(o=0,e={})=>{const a=new URLSearchParams({offset:String(o),limit:"40"});return e.startDate&&a.set("start_date",e.startDate),e.endDate&&a.set("end_date",e.endDate),!e.startDate&&!e.endDate&&a.set("all_time","true"),e.topicOnly&&a.set("topic_only","true"),t(`/me/following?${a}`)},topic:()=>t("/me/topic"),setTopic:o=>t("/me/topic",{method:"PUT",body:JSON.stringify({text:o})}),clearTopic:()=>t("/me/topic",{method:"DELETE"}),email:()=>t("/me/research-email"),setEmail:o=>t("/me/research-email",{method:"PUT",body:JSON.stringify({enabled:o})})};export{i as T,m as r}; +import{a5 as t}from"./index-D6jcIRWs.js";const i=300,m={follows:()=>t("/me/follows"),followSuggestions:()=>t("/research/follow-suggestions"),setFollow:(o,e,a)=>t(`/me/follows/${o}/${e}`,{method:a?"PUT":"DELETE"}),following:(o=0,e={})=>{const a=new URLSearchParams({offset:String(o),limit:"40"});return e.startDate&&a.set("start_date",e.startDate),e.endDate&&a.set("end_date",e.endDate),!e.startDate&&!e.endDate&&a.set("all_time","true"),e.topicOnly&&a.set("topic_only","true"),t(`/me/following?${a}`)},topic:()=>t("/me/topic"),setTopic:o=>t("/me/topic",{method:"PUT",body:JSON.stringify({text:o})}),clearTopic:()=>t("/me/topic",{method:"DELETE"}),email:()=>t("/me/research-email"),setEmail:o=>t("/me/research-email",{method:"PUT",body:JSON.stringify({enabled:o})})};export{i as T,m as r}; diff --git a/assets/researchTopic-k4qgoW39.js b/assets/researchTopic-NFMcqCcs.js similarity index 91% rename from assets/researchTopic-k4qgoW39.js rename to assets/researchTopic-NFMcqCcs.js index 289df6f024dbdc62b872ab468bb6d04a31c25848..42d618ccaa9b5a7bc8cd4f8faa88b93ac18ffd8e 100644 --- a/assets/researchTopic-k4qgoW39.js +++ b/assets/researchTopic-NFMcqCcs.js @@ -1 +1 @@ -import{d as u,f}from"./index-CqKcHUvZ.js";import{u as d}from"./useMutation-BItMAQ7s.js";import{r as a}from"./research-Dt0MUW0x.js";function y(e){var n;const s=(n=u())==null?void 0:n.user,t=f();return d({mutationFn:async o=>o===null?(await a.clearTopic(),null):a.setTopic(o),onSuccess:o=>{t.setQueryData(["research-topic",s==null?void 0:s.hf_subject],o),m(),e==null||e(),t.invalidateQueries({queryKey:["research-feed",s==null?void 0:s.hf_subject]}),t.invalidateQueries({queryKey:["research-email",s==null?void 0:s.hf_subject]})}})}const r="pwc:following-pending-topic";function S(e){sessionStorage.setItem(r,e)}function v(){return sessionStorage.getItem(r)}function m(){sessionStorage.removeItem(r)}function P(){var t;const e=(t=u())==null?void 0:t.user,s=f();return d({mutationFn:async n=>{const l=(await Promise.allSettled(n.map(i=>a.setFollow(i.kind,i.id,i.follow??!0)))).find(i=>i.status==="rejected");if(l)throw l.reason},onSuccess:()=>g(),onSettled:()=>{s.invalidateQueries({queryKey:["research-follows",e==null?void 0:e.hf_subject]}),s.invalidateQueries({queryKey:["research-feed",e==null?void 0:e.hf_subject]}),s.invalidateQueries({queryKey:["research-email",e==null?void 0:e.hf_subject]})}})}const c="pwc:following-pending-follows";function _(e){sessionStorage.setItem(c,JSON.stringify(e))}function I(){return JSON.parse(sessionStorage.getItem(c)??"[]")}function g(){sessionStorage.removeItem(c)}export{P as a,_ as b,I as c,m as d,v as r,S as s,y as u}; +import{d as u,f}from"./index-D6jcIRWs.js";import{u as d}from"./useMutation-p6mN4h17.js";import{r as a}from"./research-BggtGgC2.js";function y(e){var n;const s=(n=u())==null?void 0:n.user,t=f();return d({mutationFn:async o=>o===null?(await a.clearTopic(),null):a.setTopic(o),onSuccess:o=>{t.setQueryData(["research-topic",s==null?void 0:s.hf_subject],o),m(),e==null||e(),t.invalidateQueries({queryKey:["research-feed",s==null?void 0:s.hf_subject]}),t.invalidateQueries({queryKey:["research-email",s==null?void 0:s.hf_subject]})}})}const r="pwc:following-pending-topic";function S(e){sessionStorage.setItem(r,e)}function v(){return sessionStorage.getItem(r)}function m(){sessionStorage.removeItem(r)}function P(){var t;const e=(t=u())==null?void 0:t.user,s=f();return d({mutationFn:async n=>{const l=(await Promise.allSettled(n.map(i=>a.setFollow(i.kind,i.id,i.follow??!0)))).find(i=>i.status==="rejected");if(l)throw l.reason},onSuccess:()=>g(),onSettled:()=>{s.invalidateQueries({queryKey:["research-follows",e==null?void 0:e.hf_subject]}),s.invalidateQueries({queryKey:["research-feed",e==null?void 0:e.hf_subject]}),s.invalidateQueries({queryKey:["research-email",e==null?void 0:e.hf_subject]})}})}const c="pwc:following-pending-follows";function _(e){sessionStorage.setItem(c,JSON.stringify(e))}function I(){return JSON.parse(sessionStorage.getItem(c)??"[]")}function g(){sessionStorage.removeItem(c)}export{P as a,_ as b,I as c,m as d,v as r,S as s,y as u}; diff --git a/assets/savedPapersAuth-BzEAZw7z.js b/assets/savedPapersAuth-BzEAZw7z.js deleted file mode 100644 index 56b5d548a0f1e940a1ecc6ea3a30caea2d4bb7be..0000000000000000000000000000000000000000 --- a/assets/savedPapersAuth-BzEAZw7z.js +++ /dev/null @@ -1 +0,0 @@ -import{J as i}from"./index-CqKcHUvZ.js";const s="saved_papers_authorized";function u(n=!1){const r=i("/api/v1/auth/hf/login"),o=new URL(r,window.location.origin).origin,t=new URL(window.location.href);n&&t.searchParams.set(s,"1");const a=o===window.location.origin?`${t.pathname}${t.search}${t.hash}`:t.toString(),e=new URLSearchParams({return_to:a,authorize_bucket:"true",bucket_create:"true"});return`${r}?${e.toString()}`}export{s as S,u as s}; diff --git a/assets/savedPapersAuth-aA59XSW3.js b/assets/savedPapersAuth-aA59XSW3.js new file mode 100644 index 0000000000000000000000000000000000000000..2cf0dbaee0c2bf11b26454878063886e511ef8d6 --- /dev/null +++ b/assets/savedPapersAuth-aA59XSW3.js @@ -0,0 +1 @@ +import{h as a}from"./index-D6jcIRWs.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-9n8Usynh.js b/assets/search-CfTufeR7.js similarity index 87% rename from assets/search-9n8Usynh.js rename to assets/search-CfTufeR7.js index 2bc2037283c1e6565fcec48743d7df07587c2fdb..20588f1c7241194136f71cd2e6782bbac8999e48 100644 --- a/assets/search-9n8Usynh.js +++ b/assets/search-CfTufeR7.js @@ -1,4 +1,4 @@ -import{n as e}from"./index-CqKcHUvZ.js";/** +import{n as e}from"./index-D6jcIRWs.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/searchable-select-DY1KXMvg.js b/assets/searchable-select-B7z6Fcrr.js similarity index 97% rename from assets/searchable-select-DY1KXMvg.js rename to assets/searchable-select-B7z6Fcrr.js index b115c4ad0e42af2c96f833721a6d5c42e4ba0cf6..4f1bef99212063c731c70cd70bd272cb856cee59 100644 --- a/assets/searchable-select-DY1KXMvg.js +++ b/assets/searchable-select-B7z6Fcrr.js @@ -1,4 +1,4 @@ -import{n as Ae,r as a,a6 as Q,t as L,a7 as Me,a8 as De,a9 as $e,aa as Le,ab as H,j as p,B as D,C as Pe}from"./index-CqKcHUvZ.js";import{u as Fe}from"./useQuery-Cngk7eL9.js";import{B as Ke}from"./button-BYn4yUH_.js";import{P as qe,a as Be,b as Ve}from"./popover-BcoS9Jmp.js";import"./dialog-B-oqHDuH.js";import{S as Ue}from"./search-9n8Usynh.js";import{L as Qe}from"./loader-circle-CZgakNH7.js";/** +import{n as Ae,r as a,a8 as Q,t as L,a9 as Me,aa as De,ab as $e,ac as Le,ad as H,j as p,B as D,C as Pe}from"./index-D6jcIRWs.js";import{u as Fe}from"./useQuery-CUJUm4FY.js";import{B as Ke}from"./button-Bzx0ccHH.js";import{P as qe,a as Be,b as Ve}from"./popover-DCjqGpW0.js";import"./dialog-vGFIbcd-.js";import{S as Ue}from"./search-CfTufeR7.js";import{L as Qe}from"./loader-circle-BuDrH29B.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/share-2-Ma7ZrYBX.js b/assets/share-2-DPo2j-OC.js similarity index 91% rename from assets/share-2-Ma7ZrYBX.js rename to assets/share-2-DPo2j-OC.js index 1f52459619d06dfd79b94b1be3722036053b163e..64e944947c245c541379554820eb2714d165cca8 100644 --- a/assets/share-2-Ma7ZrYBX.js +++ b/assets/share-2-DPo2j-OC.js @@ -1,4 +1,4 @@ -import{n as c}from"./index-CqKcHUvZ.js";/** +import{n as c}from"./index-D6jcIRWs.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/shield-alert-B0VZio-w.js b/assets/shield-alert-B0VZio-w.js deleted file mode 100644 index 5e443f9490455f5eed69599a2612d9c1ddce5a65..0000000000000000000000000000000000000000 --- a/assets/shield-alert-B0VZio-w.js +++ /dev/null @@ -1,6 +0,0 @@ -import{n as e}from"./index-CqKcHUvZ.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 t=e("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);export{t as S}; diff --git a/assets/skeleton-DleNhBYA.js b/assets/skeleton-BqkYFmXl.js similarity index 62% rename from assets/skeleton-DleNhBYA.js rename to assets/skeleton-BqkYFmXl.js index 499407f7048321cc5170ab420d9282929e599f7d..de9b38a6f1ad0cc135abd1b40e313b4f2a1bba2b 100644 --- a/assets/skeleton-DleNhBYA.js +++ b/assets/skeleton-BqkYFmXl.js @@ -1 +1 @@ -import{j as t,B as n}from"./index-CqKcHUvZ.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,B as n}from"./index-D6jcIRWs.js";function m({className:e,...s}){return t.jsx("div",{className:n("animate-pulse rounded-md bg-muted",e),...s})}export{m as S}; diff --git a/assets/sparkles-BKRdZneA.js b/assets/sparkles-r8uPx2-0.js similarity index 93% rename from assets/sparkles-BKRdZneA.js rename to assets/sparkles-r8uPx2-0.js index ff920ae67d489f5084a70d3dd0189a95bbc54697..9bf5a73564d99031397fbd8585b84b44dad7b9f1 100644 --- a/assets/sparkles-BKRdZneA.js +++ b/assets/sparkles-r8uPx2-0.js @@ -1,4 +1,4 @@ -import{n as a}from"./index-CqKcHUvZ.js";/** +import{n as a}from"./index-D6jcIRWs.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/submissions-1aHdBaSr.js b/assets/submissions-DNa3tQdo.js similarity index 99% rename from assets/submissions-1aHdBaSr.js rename to assets/submissions-DNa3tQdo.js index df636f3a909f7e7f1e0c5ece9d6e288b522da364..9b93f60881125e26f1bcf7a873af331c077e0748 100644 --- a/assets/submissions-1aHdBaSr.js +++ b/assets/submissions-DNa3tQdo.js @@ -1 +1 @@ -import{a3 as qe}from"./index-CqKcHUvZ.js";var v;(function(s){s.assertEqual=n=>{};function e(n){}s.assertIs=e;function t(n){throw new Error}s.assertNever=t,s.arrayToEnum=n=>{const a={};for(const i of n)a[i]=i;return a},s.getValidEnumValues=n=>{const a=s.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(const o of a)i[o]=n[o];return s.objectValues(i)},s.objectValues=n=>s.objectKeys(n).map(function(a){return n[a]}),s.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const a=[];for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&a.push(i);return a},s.find=(n,a)=>{for(const i of n)if(a(i))return i},s.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function r(n,a=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}s.joinValues=r,s.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(v||(v={}));var Te;(function(s){s.mergeShapes=(e,t)=>({...e,...t})})(Te||(Te={}));const u=v.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$=s=>{switch(typeof s){case"undefined":return u.undefined;case"string":return u.string;case"number":return Number.isNaN(s)?u.nan:u.number;case"boolean":return u.boolean;case"function":return u.function;case"bigint":return u.bigint;case"symbol":return u.symbol;case"object":return Array.isArray(s)?u.array:s===null?u.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?u.promise:typeof Map<"u"&&s instanceof Map?u.map:typeof Set<"u"&&s instanceof Set?u.set:typeof Date<"u"&&s instanceof Date?u.date:u.object;default:return u.unknown}},d=v.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class I extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(a){return a.message},r={_errors:[]},n=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)r._errors.push(t(i));else{let o=r,f=0;for(;ft.message){const t={},r=[];for(const n of this.issues)if(n.path.length>0){const a=n.path[0];t[a]=t[a]||[],t[a].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}I.create=s=>new I(s);const ue=(s,e)=>{let t;switch(s.code){case d.invalid_type:s.received===u.undefined?t="Required":t=`Expected ${s.expected}, received ${s.received}`;break;case d.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(s.expected,v.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:t=`Unrecognized key(s) in object: ${v.joinValues(s.keys,", ")}`;break;case d.invalid_union:t="Invalid input";break;case d.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${v.joinValues(s.options)}`;break;case d.invalid_enum_value:t=`Invalid enum value. Expected ${v.joinValues(s.options)}, received '${s.received}'`;break;case d.invalid_arguments:t="Invalid function arguments";break;case d.invalid_return_type:t="Invalid function return type";break;case d.invalid_date:t="Invalid date";break;case d.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(t=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?t=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?t=`Invalid input: must end with "${s.validation.endsWith}"`:v.assertNever(s.validation):s.validation!=="regex"?t=`Invalid ${s.validation}`:t="Invalid";break;case d.too_small:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="bigint"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(s.minimum))}`:t="Invalid input";break;case d.too_big:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="bigint"?t=`BigInt must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(s.maximum))}`:t="Invalid input";break;case d.custom:t="Invalid input";break;case d.invalid_intersection_types:t="Intersection results could not be merged";break;case d.not_multiple_of:t=`Number must be a multiple of ${s.multipleOf}`;break;case d.not_finite:t="Number must be finite";break;default:t=e.defaultError,v.assertNever(s)}return{message:t}};let Fe=ue;function We(){return Fe}const Je=s=>{const{data:e,path:t,errorMaps:r,issueData:n}=s,a=[...t,...n.path||[]],i={...n,path:a};if(n.message!==void 0)return{...n,path:a,message:n.message};let o="";const f=r.filter(p=>!!p).slice().reverse();for(const p of f)o=p(i,{data:e,defaultError:o}).message;return{...n,path:a,message:o}};function c(s,e){const t=We(),r=Je({issueData:e,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,t,t===ue?void 0:ue].filter(n=>!!n)});s.common.issues.push(r)}class C{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const n of t){if(n.status==="aborted")return m;n.status==="dirty"&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const n of t){const a=await n.key,i=await n.value;r.push({key:a,value:i})}return C.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const n of t){const{key:a,value:i}=n;if(a.status==="aborted"||i.status==="aborted")return m;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(r[a.value]=i.value)}return{status:e.value,value:r}}}const m=Object.freeze({status:"aborted"}),W=s=>({status:"dirty",value:s}),O=s=>({status:"valid",value:s}),Se=s=>s.status==="aborted",Ce=s=>s.status==="dirty",U=s=>s.status==="valid",Q=s=>typeof Promise<"u"&&s instanceof Promise;var h;(function(s){s.errToObj=e=>typeof e=="string"?{message:e}:e||{},s.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(h||(h={}));class Z{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Oe=(s,e)=>{if(U(e))return{success:!0,data:e.value};if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new I(s.common.issues);return this._error=t,this._error}}};function y(s){if(!s)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:n}=s;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,o)=>{const{message:f}=s;return i.code==="invalid_enum_value"?{message:f??o.defaultError}:typeof o.data>"u"?{message:f??r??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:f??t??o.defaultError}},description:n}}class g{get description(){return this._def.description}_getType(e){return $(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:$(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new C,ctx:{common:e.parent.common,data:e.data,parsedType:$(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Q(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)},n=this._parseSync({data:e,path:r.path,parent:r});return Oe(r,n)}"~validate"(e){var r,n;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:t});return U(a)?{value:a.value}:{issues:t.common.issues}}catch(a){(n=(r=a==null?void 0:a.message)==null?void 0:r.toLowerCase())!=null&&n.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(a=>U(a)?{value:a.value}:{issues:t.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)},n=this._parse({data:e,path:r.path,parent:r}),a=await(Q(n)?n:Promise.resolve(n));return Oe(r,a)}refine(e,t){const r=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,a)=>{const i=e(n),o=()=>a.addIssue({code:d.custom,...r(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(f=>f?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((r,n)=>e(r)?!0:(n.addIssue(typeof t=="function"?t(r,n):t),!1))}_refinement(e){return new z({schema:this,typeName:_.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return j.create(this,this._def)}nullable(){return L.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return A.create(this)}promise(){return re.create(this,this._def)}or(e){return K.create([this,e],this._def)}and(e){return ee.create(this,e,this._def)}transform(e){return new z({...y(this._def),schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new ne({...y(this._def),innerType:this,defaultValue:t,typeName:_.ZodDefault})}brand(){return new Me({typeName:_.ZodBranded,type:this,...y(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ae({...y(this._def),innerType:this,catchValue:t,typeName:_.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return ke.create(this,e)}readonly(){return ie.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Ye=/^c[^\s-]{8,}$/i,He=/^[0-9a-z]+$/,Ge=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Qe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Xe=/^[a-z0-9_-]{21}$/i,Ke=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,et=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,tt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,st="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ce;const rt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,nt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,at=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,it=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ot=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ie="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ct=new RegExp(`^${Ie}$`);function $e(s){let e="[0-5]\\d";s.precision?e=`${e}\\.\\d{${s.precision}}`:s.precision==null&&(e=`${e}(\\.\\d+)?`);const t=s.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function ut(s){return new RegExp(`^${$e(s)}$`)}function lt(s){let e=`${Ie}T${$e(s)}`;const t=[];return t.push(s.local?"Z?":"Z"),s.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function ht(s,e){return!!((e==="v4"||!e)&&rt.test(s)||(e==="v6"||!e)&&at.test(s))}function ft(s,e){if(!Ke.test(s))return!1;try{const[t]=s.split(".");if(!t)return!1;const r=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(r));return!(typeof n!="object"||n===null||"typ"in n&&(n==null?void 0:n.typ)!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function pt(s,e){return!!((e==="v4"||!e)&&nt.test(s)||(e==="v6"||!e)&&it.test(s))}class E extends g{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==u.string){const a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_type,expected:u.string,received:a.parsedType}),m}const r=new C;let n;for(const a of this._def.checks)if(a.kind==="min")e.data.lengtha.value&&(n=this._getOrReturnCtx(e,n),c(n,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.lengthe.test(n),{validation:t,code:d.invalid_string,...h.errToObj(r)})}_addCheck(e){return new E({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...h.errToObj(e)})}url(e){return this._addCheck({kind:"url",...h.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...h.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...h.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...h.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...h.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...h.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...h.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...h.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...h.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...h.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...h.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...h.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...h.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...h.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...h.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...h.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...h.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...h.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...h.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...h.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...h.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...h.errToObj(t)})}nonempty(e){return this.min(1,h.errToObj(e))}trim(){return new E({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new E({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new E({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew E({checks:[],typeName:_.ZodString,coerce:(s==null?void 0:s.coerce)??!1,...y(s)});function mt(s,e){const t=(s.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,n=t>r?t:r,a=Number.parseInt(s.toFixed(n).replace(".","")),i=Number.parseInt(e.toFixed(n).replace(".",""));return a%i/10**n}class B extends g{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==u.number){const a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_type,expected:u.number,received:a.parsedType}),m}let r;const n=new C;for(const a of this._def.checks)a.kind==="int"?v.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),c(r,{code:d.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?mt(e.data,a.value)!==0&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_finite,message:a.message}),n.dirty()):v.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,r,n){return new B({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:h.toString(n)}]})}_addCheck(e){return new B({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:h.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:h.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:h.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:h.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuee.kind==="int"||e.kind==="multipleOf"&&v.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.valuenew B({checks:[],typeName:_.ZodNumber,coerce:(s==null?void 0:s.coerce)||!1,...y(s)});class J extends g{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==u.bigint)return this._getInvalidInput(e);let r;const n=new C;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):v.assertNever(a);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return c(t,{code:d.invalid_type,expected:u.bigint,received:t.parsedType}),m}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,r,n){return new J({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:h.toString(n)}]})}_addCheck(e){return new J({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew J({checks:[],typeName:_.ZodBigInt,coerce:(s==null?void 0:s.coerce)??!1,...y(s)});class le extends g{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==u.boolean){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.boolean,received:r.parsedType}),m}return O(e.data)}}le.create=s=>new le({typeName:_.ZodBoolean,coerce:(s==null?void 0:s.coerce)||!1,...y(s)});class X extends g{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==u.date){const a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_type,expected:u.date,received:a.parsedType}),m}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_date}),m}const r=new C;let n;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()a.value&&(n=this._getOrReturnCtx(e,n),c(n,{code:d.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):v.assertNever(a);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new X({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:h.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:h.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew X({checks:[],coerce:(s==null?void 0:s.coerce)||!1,typeName:_.ZodDate,...y(s)});class Ae extends g{_parse(e){if(this._getType(e)!==u.symbol){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.symbol,received:r.parsedType}),m}return O(e.data)}}Ae.create=s=>new Ae({typeName:_.ZodSymbol,...y(s)});class he extends g{_parse(e){if(this._getType(e)!==u.undefined){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.undefined,received:r.parsedType}),m}return O(e.data)}}he.create=s=>new he({typeName:_.ZodUndefined,...y(s)});class fe extends g{_parse(e){if(this._getType(e)!==u.null){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.null,received:r.parsedType}),m}return O(e.data)}}fe.create=s=>new fe({typeName:_.ZodNull,...y(s)});class Ne extends g{constructor(){super(...arguments),this._any=!0}_parse(e){return O(e.data)}}Ne.create=s=>new Ne({typeName:_.ZodAny,...y(s)});class pe extends g{constructor(){super(...arguments),this._unknown=!0}_parse(e){return O(e.data)}}pe.create=s=>new pe({typeName:_.ZodUnknown,...y(s)});class P extends g{_parse(e){const t=this._getOrReturnCtx(e);return c(t,{code:d.invalid_type,expected:u.never,received:t.parsedType}),m}}P.create=s=>new P({typeName:_.ZodNever,...y(s)});class Ze extends g{_parse(e){if(this._getType(e)!==u.undefined){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.void,received:r.parsedType}),m}return O(e.data)}}Ze.create=s=>new Ze({typeName:_.ZodVoid,...y(s)});class A extends g{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==u.array)return c(t,{code:d.invalid_type,expected:u.array,received:t.parsedType}),m;if(n.exactLength!==null){const i=t.data.length>n.exactLength.value,o=t.data.lengthn.maxLength.value&&(c(t,{code:d.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>n.type._parseAsync(new Z(t,i,t.path,o)))).then(i=>C.mergeArray(r,i));const a=[...t.data].map((i,o)=>n.type._parseSync(new Z(t,i,t.path,o)));return C.mergeArray(r,a)}get element(){return this._def.type}min(e,t){return new A({...this._def,minLength:{value:e,message:h.toString(t)}})}max(e,t){return new A({...this._def,maxLength:{value:e,message:h.toString(t)}})}length(e,t){return new A({...this._def,exactLength:{value:e,message:h.toString(t)}})}nonempty(e){return this.min(1,e)}}A.create=(s,e)=>new A({type:s,minLength:null,maxLength:null,exactLength:null,typeName:_.ZodArray,...y(e)});function D(s){if(s instanceof w){const e={};for(const t in s.shape){const r=s.shape[t];e[t]=j.create(D(r))}return new w({...s._def,shape:()=>e})}else return s instanceof A?new A({...s._def,type:D(s.element)}):s instanceof j?j.create(D(s.unwrap())):s instanceof L?L.create(D(s.unwrap())):s instanceof M?M.create(s.items.map(e=>D(e))):s}class w extends g{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=v.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==u.object){const p=this._getOrReturnCtx(e);return c(p,{code:d.invalid_type,expected:u.object,received:p.parsedType}),m}const{status:r,ctx:n}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof P&&this._def.unknownKeys==="strip"))for(const p in n.data)i.includes(p)||o.push(p);const f=[];for(const p of i){const x=a[p],F=n.data[p];f.push({key:{status:"valid",value:p},value:x._parse(new Z(n,F,n.path,p)),alwaysSet:p in n.data})}if(this._def.catchall instanceof P){const p=this._def.unknownKeys;if(p==="passthrough")for(const x of o)f.push({key:{status:"valid",value:x},value:{status:"valid",value:n.data[x]}});else if(p==="strict")o.length>0&&(c(n,{code:d.unrecognized_keys,keys:o}),r.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const p=this._def.catchall;for(const x of o){const F=n.data[x];f.push({key:{status:"valid",value:x},value:p._parse(new Z(n,F,n.path,x)),alwaysSet:x in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const p=[];for(const x of f){const F=await x.key,Be=await x.value;p.push({key:F,value:Be,alwaysSet:x.alwaysSet})}return p}).then(p=>C.mergeObjectSync(r,p)):C.mergeObjectSync(r,f)}get shape(){return this._def.shape()}strict(e){return h.errToObj,new w({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var a,i;const n=((i=(a=this._def).errorMap)==null?void 0:i.call(a,t,r).message)??r.defaultError;return t.code==="unrecognized_keys"?{message:h.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new w({...this._def,unknownKeys:"strip"})}passthrough(){return new w({...this._def,unknownKeys:"passthrough"})}extend(e){return new w({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new w({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new w({...this._def,catchall:e})}pick(e){const t={};for(const r of v.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new w({...this._def,shape:()=>t})}omit(e){const t={};for(const r of v.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new w({...this._def,shape:()=>t})}deepPartial(){return D(this)}partial(e){const t={};for(const r of v.objectKeys(this.shape)){const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}return new w({...this._def,shape:()=>t})}required(e){const t={};for(const r of v.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof j;)a=a._def.innerType;t[r]=a}return new w({...this._def,shape:()=>t})}keyof(){return Pe(v.objectKeys(this.shape))}}w.create=(s,e)=>new w({shape:()=>s,unknownKeys:"strip",catchall:P.create(),typeName:_.ZodObject,...y(e)});w.strictCreate=(s,e)=>new w({shape:()=>s,unknownKeys:"strict",catchall:P.create(),typeName:_.ZodObject,...y(e)});w.lazycreate=(s,e)=>new w({shape:s,unknownKeys:"strip",catchall:P.create(),typeName:_.ZodObject,...y(e)});class K extends g{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function n(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new I(o.ctx.common.issues));return c(t,{code:d.invalid_union,unionErrors:i}),m}if(t.common.async)return Promise.all(r.map(async a=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let a;const i=[];for(const f of r){const p={...t,common:{...t.common,issues:[]},parent:null},x=f._parseSync({data:t.data,path:t.path,parent:p});if(x.status==="valid")return x;x.status==="dirty"&&!a&&(a={result:x,ctx:p}),p.common.issues.length&&i.push(p.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(f=>new I(f));return c(t,{code:d.invalid_union,unionErrors:o}),m}}get options(){return this._def.options}}K.create=(s,e)=>new K({options:s,typeName:_.ZodUnion,...y(e)});const R=s=>s instanceof _e?R(s.schema):s instanceof z?R(s.innerType()):s instanceof se?[s.value]:s instanceof V?s.options:s instanceof ye?v.objectValues(s.enum):s instanceof ne?R(s._def.innerType):s instanceof he?[void 0]:s instanceof fe?[null]:s instanceof j?[void 0,...R(s.unwrap())]:s instanceof L?[null,...R(s.unwrap())]:s instanceof Me||s instanceof ie?R(s.unwrap()):s instanceof ae?R(s._def.innerType):[];class xe extends g{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.object)return c(t,{code:d.invalid_type,expected:u.object,received:t.parsedType}),m;const r=this.discriminator,n=t.data[r],a=this.optionsMap.get(n);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(c(t,{code:d.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),m)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const n=new Map;for(const a of t){const i=R(a.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of i){if(n.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,a)}}return new xe({typeName:_.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...y(r)})}}function me(s,e){const t=$(s),r=$(e);if(s===e)return{valid:!0,data:s};if(t===u.object&&r===u.object){const n=v.objectKeys(e),a=v.objectKeys(s).filter(o=>n.indexOf(o)!==-1),i={...s,...e};for(const o of a){const f=me(s[o],e[o]);if(!f.valid)return{valid:!1};i[o]=f.data}return{valid:!0,data:i}}else if(t===u.array&&r===u.array){if(s.length!==e.length)return{valid:!1};const n=[];for(let a=0;a{if(Se(a)||Se(i))return m;const o=me(a.value,i.value);return o.valid?((Ce(a)||Ce(i))&&t.dirty(),{status:t.value,value:o.data}):(c(r,{code:d.invalid_intersection_types}),m)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ee.create=(s,e,t)=>new ee({left:s,right:e,typeName:_.ZodIntersection,...y(t)});class M extends g{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.array)return c(r,{code:d.invalid_type,expected:u.array,received:r.parsedType}),m;if(r.data.lengththis._def.items.length&&(c(r,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...r.data].map((i,o)=>{const f=this._def.items[o]||this._def.rest;return f?f._parse(new Z(r,i,r.path,o)):null}).filter(i=>!!i);return r.common.async?Promise.all(a).then(i=>C.mergeArray(t,i)):C.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new M({...this._def,rest:e})}}M.create=(s,e)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new M({items:s,typeName:_.ZodTuple,rest:null,...y(e)})};class te extends g{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.object)return c(r,{code:d.invalid_type,expected:u.object,received:r.parsedType}),m;const n=[],a=this._def.keyType,i=this._def.valueType;for(const o in r.data)n.push({key:a._parse(new Z(r,o,r.path,o)),value:i._parse(new Z(r,r.data[o],r.path,o)),alwaysSet:o in r.data});return r.common.async?C.mergeObjectAsync(t,n):C.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof g?new te({keyType:e,valueType:t,typeName:_.ZodRecord,...y(r)}):new te({keyType:E.create(),valueType:e,typeName:_.ZodRecord,...y(t)})}}class Re extends g{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.map)return c(r,{code:d.invalid_type,expected:u.map,received:r.parsedType}),m;const n=this._def.keyType,a=this._def.valueType,i=[...r.data.entries()].map(([o,f],p)=>({key:n._parse(new Z(r,o,r.path,[p,"key"])),value:a._parse(new Z(r,f,r.path,[p,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const f of i){const p=await f.key,x=await f.value;if(p.status==="aborted"||x.status==="aborted")return m;(p.status==="dirty"||x.status==="dirty")&&t.dirty(),o.set(p.value,x.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const f of i){const p=f.key,x=f.value;if(p.status==="aborted"||x.status==="aborted")return m;(p.status==="dirty"||x.status==="dirty")&&t.dirty(),o.set(p.value,x.value)}return{status:t.value,value:o}}}}Re.create=(s,e,t)=>new Re({valueType:e,keyType:s,typeName:_.ZodMap,...y(t)});class Y extends g{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.set)return c(r,{code:d.invalid_type,expected:u.set,received:r.parsedType}),m;const n=this._def;n.minSize!==null&&r.data.sizen.maxSize.value&&(c(r,{code:d.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const a=this._def.valueType;function i(f){const p=new Set;for(const x of f){if(x.status==="aborted")return m;x.status==="dirty"&&t.dirty(),p.add(x.value)}return{status:t.value,value:p}}const o=[...r.data.values()].map((f,p)=>a._parse(new Z(r,f,r.path,p)));return r.common.async?Promise.all(o).then(f=>i(f)):i(o)}min(e,t){return new Y({...this._def,minSize:{value:e,message:h.toString(t)}})}max(e,t){return new Y({...this._def,maxSize:{value:e,message:h.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Y.create=(s,e)=>new Y({valueType:s,minSize:null,maxSize:null,typeName:_.ZodSet,...y(e)});class _e extends g{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}_e.create=(s,e)=>new _e({getter:s,typeName:_.ZodLazy,...y(e)});class se extends g{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return c(t,{received:t.data,code:d.invalid_literal,expected:this._def.value}),m}return{status:"valid",value:e.data}}get value(){return this._def.value}}se.create=(s,e)=>new se({value:s,typeName:_.ZodLiteral,...y(e)});function Pe(s,e){return new V({values:s,typeName:_.ZodEnum,...y(e)})}class V extends g{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return c(t,{expected:v.joinValues(r),received:t.parsedType,code:d.invalid_type}),m}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return c(t,{received:t.data,code:d.invalid_enum_value,options:r}),m}return O(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return V.create(e,{...this._def,...t})}exclude(e,t=this._def){return V.create(this.options.filter(r=>!e.includes(r)),{...this._def,...t})}}V.create=Pe;class ye extends g{_parse(e){const t=v.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==u.string&&r.parsedType!==u.number){const n=v.objectValues(t);return c(r,{expected:v.joinValues(n),received:r.parsedType,code:d.invalid_type}),m}if(this._cache||(this._cache=new Set(v.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const n=v.objectValues(t);return c(r,{received:r.data,code:d.invalid_enum_value,options:n}),m}return O(e.data)}get enum(){return this._def.values}}ye.create=(s,e)=>new ye({values:s,typeName:_.ZodNativeEnum,...y(e)});class re extends g{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.promise&&t.common.async===!1)return c(t,{code:d.invalid_type,expected:u.promise,received:t.parsedType}),m;const r=t.parsedType===u.promise?t.data:Promise.resolve(t.data);return O(r.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}}re.create=(s,e)=>new re({type:s,typeName:_.ZodPromise,...y(e)});class z extends g{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:i=>{c(r,i),i.fatal?t.abort():t.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){const i=n.transform(r.data,a);if(r.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return m;const f=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return f.status==="aborted"?m:f.status==="dirty"||t.value==="dirty"?W(f.value):f});{if(t.value==="aborted")return m;const o=this._def.schema._parseSync({data:i,path:r.path,parent:r});return o.status==="aborted"?m:o.status==="dirty"||t.value==="dirty"?W(o.value):o}}if(n.type==="refinement"){const i=o=>{const f=n.refinement(o,a);if(r.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?m:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?m:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!U(i))return m;const o=n.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>U(i)?Promise.resolve(n.transform(i.value,a)).then(o=>({status:t.value,value:o})):m);v.assertNever(n)}}z.create=(s,e,t)=>new z({schema:s,typeName:_.ZodEffects,effect:e,...y(t)});z.createWithPreprocess=(s,e,t)=>new z({schema:e,effect:{type:"preprocess",transform:s},typeName:_.ZodEffects,...y(t)});class j extends g{_parse(e){return this._getType(e)===u.undefined?O(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}j.create=(s,e)=>new j({innerType:s,typeName:_.ZodOptional,...y(e)});class L extends g{_parse(e){return this._getType(e)===u.null?O(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}L.create=(s,e)=>new L({innerType:s,typeName:_.ZodNullable,...y(e)});class ne extends g{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===u.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ne.create=(s,e)=>new ne({innerType:s,typeName:_.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...y(e)});class ae extends g{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Q(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new I(r.common.issues)},input:r.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new I(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ae.create=(s,e)=>new ae({innerType:s,typeName:_.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...y(e)});class Ee extends g{_parse(e){if(this._getType(e)!==u.nan){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.nan,received:r.parsedType}),m}return{status:"valid",value:e.data}}}Ee.create=s=>new Ee({typeName:_.ZodNaN,...y(s)});class Me extends g{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class ke extends g{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?m:a.status==="dirty"?(t.dirty(),W(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const n=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return n.status==="aborted"?m:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:r.path,parent:r})}}static create(e,t){return new ke({in:e,out:t,typeName:_.ZodPipeline})}}class ie extends g{_parse(e){const t=this._def.innerType._parse(e),r=n=>(U(n)&&(n.value=Object.freeze(n.value)),n);return Q(t)?t.then(n=>r(n)):r(t)}unwrap(){return this._def.innerType}}ie.create=(s,e)=>new ie({innerType:s,typeName:_.ZodReadonly,...y(e)});var _;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly"})(_||(_={}));const l=E.create,b=B.create,oe=le.create,_t=pe.create;P.create;const T=A.create,k=w.create,Ve=K.create,ze=xe.create;ee.create;M.create;const Le=te.create,G=se.create,ge=V.create;re.create;j.create;L.create;const N=Le(_t()),be=k({id:b(),name:l(),slug:l().optional()}).passthrough(),de=k({url:l(),is_official:oe()}),ve=k({task_id:b(),dataset_id:b(),model_name:l().nullish(),harness:l().nullish(),methodology:l().nullish(),metrics:Le(Ve([l(),b()])),uses_additional_data:oe().optional(),is_open:oe().optional(),best_rank:b().nullish(),best_metric:l().nullish(),evaluated_on:l().nullish(),external_source_url:l().nullish(),num_parameters:b().nullish(),hf_model_url:l().nullish()}).passthrough(),yt=ve.partial().extend({id:b().optional()}),gt=ze("op",[k({op:G("create"),data:ve}),k({op:G("update"),evaluation_id:b(),data:ve}),k({op:G("delete"),evaluation_id:b()})]),je=k({hf_models:T(l()),hf_datasets:T(l()),hf_spaces:T(l())}),we=k({file_name:l(),mime_type:l(),data_url:l().optional(),url:l().optional()}),q=k({name:l(),description:l().optional()}),vt=q.extend({image:we.optional(),image_credit:l().optional(),parent_id:b().optional(),area_id:b().optional(),keywords:l().optional()}),xt=q.extend({image:we.optional(),image_credit:l().optional(),source_paper_id:b().optional(),source_url:l().optional(),source_title:l().optional()}),kt=Ve([k({benchmark:l(),task:l(),description:l()}),q.extend({description:l(),task_ids:T(b()),full_name:l().optional(),url:l().optional(),hf_url:l().optional(),paper_url:l().optional(),license_name:l().optional(),license_url:l().optional()})]),bt=q.extend({description:l(),direction:ge(["higher_is_better","lower_is_better"]),full_name:l().optional(),scale:l().optional(),task_id:b(),dataset_id:b()}),wt=q.extend({short_name:l().optional(),venue:l().optional(),location:l().optional(),url:l(),year:b(),start_date:l().optional(),end_date:l().optional()}),Tt=q.extend({hf_slug:l().optional(),website_url:l().optional(),image:we.optional()}),St=k({id:b(),paper_id:b().nullable(),hf_username:l(),hf_subject:l().nullish(),is_author:oe(),status:ge(["pending","approved","rejected"]),applied_payload:N.nullish(),conflict_payload:N.nullish(),result_entity_type:l().nullish(),result_entity_id:l().nullish(),admin_note:l().nullish(),user_review_reason:l().nullish(),reviewed_by:l().nullish(),reviewed_by_kind:ge(["human","codex","auto"]).nullish(),catalog_event_id:l().nullish(),review_evidence:N.nullish(),created_at:l(),updated_at:l(),reviewed_at:l().nullish()});function S(s,e,t){return St.extend({edit_type:G(s),proposed_payload:e,current_payload:t.nullish()})}const Ct=S("tasks",k({task_ids:T(b())}),k({tasks:T(be)})),Ot=S("methods",k({method_ids:T(b())}),k({methods:T(be)})),At=S("evaluations",k({operations:T(gt)}),k({evaluations:T(yt)})),Nt=S("repositories",k({repositories:T(de)}),k({repositories:T(de)})),Zt=S("project_pages",k({project_pages:T(de)}),k({project_pages:T(de)})),Rt=S("source_url",k({source_url:l()}),k({source_url:l().nullish()})),Et=S("hf_artifacts",je,je),jt=S("x_threads",k({x_threads:T(l())}),k({x_threads:T(k({url:l()}))})),It=S("organizations",k({organization_ids:T(b())}),k({organizations:T(be)})),$t=S("new_task",vt,N),Pt=S("new_method",xt,N),Mt=S("new_benchmark",kt,N),Vt=S("new_metric",bt,N),zt=S("new_conference",wt,N),Lt=S("new_organization",Tt,N),Dt=S("new_external_paper",k({title:l().optional(),source_url:l(),authors:T(l()),date_published:l().optional(),abstract:l().optional()}),N),De=ze("edit_type",[Ct,Ot,At,Nt,Zt,Rt,Et,jt,It,$t,Pt,Mt,Vt,zt,Lt,Dt]);function Jt(s,e,t){return{paper_id:s,edit_type:e,proposed_payload:t}}const Ut=k({count:b(),results:T(De)});class Bt extends Error{constructor(e){super(`Malformed pending-edit payload: ${e}`),this.name="PendingEditPayloadError"}}function Ue(s,e){const t=s.safeParse(e);if(t.success)return t.data;const r=t.error.issues[0];throw new Bt(`${(r==null?void 0:r.path.join("."))||"response"}: ${(r==null?void 0:r.message)||"invalid value"}`)}const H=s=>Ue(De,s),qt=s=>Ue(Ut,s);class Ft{constructor(e){this.request=e}async submit(e){return H(await this.request("/me/paper-edits",{method:"POST",body:JSON.stringify(e)}))}list(e){const t=new URLSearchParams;for(const[n,a]of Object.entries(e??{}))a!==void 0&&t.set(n,String(a));const r=t.toString();return this.request(`/admin/paper-edits${r?`?${r}`:""}`).then(qt)}revertAutoApproved(e,t={}){return this.request(`/admin/submitters/${encodeURIComponent(e)}/revert-auto-approved`,{method:"POST",body:JSON.stringify(t)})}async get(e){return H(await this.request(`/admin/paper-edits/${e}`))}async approve(e,t={}){return H(await this.request(`/admin/paper-edits/${e}/approve`,{method:"POST",body:JSON.stringify(t)}))}async reject(e,t={}){return H(await this.request(`/admin/paper-edits/${e}/reject`,{method:"POST",body:JSON.stringify(t)}))}}const Yt=new Ft(qe);export{Jt as p,Yt as s}; +import{a5 as qe}from"./index-D6jcIRWs.js";var v;(function(s){s.assertEqual=n=>{};function e(n){}s.assertIs=e;function t(n){throw new Error}s.assertNever=t,s.arrayToEnum=n=>{const a={};for(const i of n)a[i]=i;return a},s.getValidEnumValues=n=>{const a=s.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(const o of a)i[o]=n[o];return s.objectValues(i)},s.objectValues=n=>s.objectKeys(n).map(function(a){return n[a]}),s.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const a=[];for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&a.push(i);return a},s.find=(n,a)=>{for(const i of n)if(a(i))return i},s.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function r(n,a=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}s.joinValues=r,s.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(v||(v={}));var Te;(function(s){s.mergeShapes=(e,t)=>({...e,...t})})(Te||(Te={}));const u=v.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$=s=>{switch(typeof s){case"undefined":return u.undefined;case"string":return u.string;case"number":return Number.isNaN(s)?u.nan:u.number;case"boolean":return u.boolean;case"function":return u.function;case"bigint":return u.bigint;case"symbol":return u.symbol;case"object":return Array.isArray(s)?u.array:s===null?u.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?u.promise:typeof Map<"u"&&s instanceof Map?u.map:typeof Set<"u"&&s instanceof Set?u.set:typeof Date<"u"&&s instanceof Date?u.date:u.object;default:return u.unknown}},d=v.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class I extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(a){return a.message},r={_errors:[]},n=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)r._errors.push(t(i));else{let o=r,f=0;for(;ft.message){const t={},r=[];for(const n of this.issues)if(n.path.length>0){const a=n.path[0];t[a]=t[a]||[],t[a].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}I.create=s=>new I(s);const ue=(s,e)=>{let t;switch(s.code){case d.invalid_type:s.received===u.undefined?t="Required":t=`Expected ${s.expected}, received ${s.received}`;break;case d.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(s.expected,v.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:t=`Unrecognized key(s) in object: ${v.joinValues(s.keys,", ")}`;break;case d.invalid_union:t="Invalid input";break;case d.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${v.joinValues(s.options)}`;break;case d.invalid_enum_value:t=`Invalid enum value. Expected ${v.joinValues(s.options)}, received '${s.received}'`;break;case d.invalid_arguments:t="Invalid function arguments";break;case d.invalid_return_type:t="Invalid function return type";break;case d.invalid_date:t="Invalid date";break;case d.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(t=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?t=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?t=`Invalid input: must end with "${s.validation.endsWith}"`:v.assertNever(s.validation):s.validation!=="regex"?t=`Invalid ${s.validation}`:t="Invalid";break;case d.too_small:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="bigint"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(s.minimum))}`:t="Invalid input";break;case d.too_big:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="bigint"?t=`BigInt must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(s.maximum))}`:t="Invalid input";break;case d.custom:t="Invalid input";break;case d.invalid_intersection_types:t="Intersection results could not be merged";break;case d.not_multiple_of:t=`Number must be a multiple of ${s.multipleOf}`;break;case d.not_finite:t="Number must be finite";break;default:t=e.defaultError,v.assertNever(s)}return{message:t}};let Fe=ue;function We(){return Fe}const Je=s=>{const{data:e,path:t,errorMaps:r,issueData:n}=s,a=[...t,...n.path||[]],i={...n,path:a};if(n.message!==void 0)return{...n,path:a,message:n.message};let o="";const f=r.filter(p=>!!p).slice().reverse();for(const p of f)o=p(i,{data:e,defaultError:o}).message;return{...n,path:a,message:o}};function c(s,e){const t=We(),r=Je({issueData:e,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,t,t===ue?void 0:ue].filter(n=>!!n)});s.common.issues.push(r)}class C{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const n of t){if(n.status==="aborted")return m;n.status==="dirty"&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const n of t){const a=await n.key,i=await n.value;r.push({key:a,value:i})}return C.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const n of t){const{key:a,value:i}=n;if(a.status==="aborted"||i.status==="aborted")return m;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(r[a.value]=i.value)}return{status:e.value,value:r}}}const m=Object.freeze({status:"aborted"}),W=s=>({status:"dirty",value:s}),O=s=>({status:"valid",value:s}),Se=s=>s.status==="aborted",Ce=s=>s.status==="dirty",U=s=>s.status==="valid",Q=s=>typeof Promise<"u"&&s instanceof Promise;var h;(function(s){s.errToObj=e=>typeof e=="string"?{message:e}:e||{},s.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(h||(h={}));class Z{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Oe=(s,e)=>{if(U(e))return{success:!0,data:e.value};if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new I(s.common.issues);return this._error=t,this._error}}};function y(s){if(!s)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:n}=s;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,o)=>{const{message:f}=s;return i.code==="invalid_enum_value"?{message:f??o.defaultError}:typeof o.data>"u"?{message:f??r??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:f??t??o.defaultError}},description:n}}class g{get description(){return this._def.description}_getType(e){return $(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:$(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new C,ctx:{common:e.parent.common,data:e.data,parsedType:$(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Q(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)},n=this._parseSync({data:e,path:r.path,parent:r});return Oe(r,n)}"~validate"(e){var r,n;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:t});return U(a)?{value:a.value}:{issues:t.common.issues}}catch(a){(n=(r=a==null?void 0:a.message)==null?void 0:r.toLowerCase())!=null&&n.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(a=>U(a)?{value:a.value}:{issues:t.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)},n=this._parse({data:e,path:r.path,parent:r}),a=await(Q(n)?n:Promise.resolve(n));return Oe(r,a)}refine(e,t){const r=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,a)=>{const i=e(n),o=()=>a.addIssue({code:d.custom,...r(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(f=>f?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((r,n)=>e(r)?!0:(n.addIssue(typeof t=="function"?t(r,n):t),!1))}_refinement(e){return new z({schema:this,typeName:_.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return j.create(this,this._def)}nullable(){return L.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return A.create(this)}promise(){return re.create(this,this._def)}or(e){return K.create([this,e],this._def)}and(e){return ee.create(this,e,this._def)}transform(e){return new z({...y(this._def),schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new ne({...y(this._def),innerType:this,defaultValue:t,typeName:_.ZodDefault})}brand(){return new Me({typeName:_.ZodBranded,type:this,...y(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ae({...y(this._def),innerType:this,catchValue:t,typeName:_.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return ke.create(this,e)}readonly(){return ie.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Ye=/^c[^\s-]{8,}$/i,He=/^[0-9a-z]+$/,Ge=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Qe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Xe=/^[a-z0-9_-]{21}$/i,Ke=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,et=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,tt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,st="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ce;const rt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,nt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,at=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,it=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ot=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ie="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ct=new RegExp(`^${Ie}$`);function $e(s){let e="[0-5]\\d";s.precision?e=`${e}\\.\\d{${s.precision}}`:s.precision==null&&(e=`${e}(\\.\\d+)?`);const t=s.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function ut(s){return new RegExp(`^${$e(s)}$`)}function lt(s){let e=`${Ie}T${$e(s)}`;const t=[];return t.push(s.local?"Z?":"Z"),s.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function ht(s,e){return!!((e==="v4"||!e)&&rt.test(s)||(e==="v6"||!e)&&at.test(s))}function ft(s,e){if(!Ke.test(s))return!1;try{const[t]=s.split(".");if(!t)return!1;const r=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(r));return!(typeof n!="object"||n===null||"typ"in n&&(n==null?void 0:n.typ)!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function pt(s,e){return!!((e==="v4"||!e)&&nt.test(s)||(e==="v6"||!e)&&it.test(s))}class E extends g{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==u.string){const a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_type,expected:u.string,received:a.parsedType}),m}const r=new C;let n;for(const a of this._def.checks)if(a.kind==="min")e.data.lengtha.value&&(n=this._getOrReturnCtx(e,n),c(n,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.lengthe.test(n),{validation:t,code:d.invalid_string,...h.errToObj(r)})}_addCheck(e){return new E({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...h.errToObj(e)})}url(e){return this._addCheck({kind:"url",...h.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...h.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...h.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...h.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...h.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...h.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...h.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...h.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...h.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...h.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...h.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...h.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...h.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...h.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...h.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...h.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...h.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...h.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...h.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...h.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...h.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...h.errToObj(t)})}nonempty(e){return this.min(1,h.errToObj(e))}trim(){return new E({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new E({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new E({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew E({checks:[],typeName:_.ZodString,coerce:(s==null?void 0:s.coerce)??!1,...y(s)});function mt(s,e){const t=(s.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,n=t>r?t:r,a=Number.parseInt(s.toFixed(n).replace(".","")),i=Number.parseInt(e.toFixed(n).replace(".",""));return a%i/10**n}class B extends g{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==u.number){const a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_type,expected:u.number,received:a.parsedType}),m}let r;const n=new C;for(const a of this._def.checks)a.kind==="int"?v.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),c(r,{code:d.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?mt(e.data,a.value)!==0&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_finite,message:a.message}),n.dirty()):v.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,r,n){return new B({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:h.toString(n)}]})}_addCheck(e){return new B({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:h.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:h.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:h.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:h.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuee.kind==="int"||e.kind==="multipleOf"&&v.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.valuenew B({checks:[],typeName:_.ZodNumber,coerce:(s==null?void 0:s.coerce)||!1,...y(s)});class J extends g{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==u.bigint)return this._getInvalidInput(e);let r;const n=new C;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):v.assertNever(a);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return c(t,{code:d.invalid_type,expected:u.bigint,received:t.parsedType}),m}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,r,n){return new J({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:h.toString(n)}]})}_addCheck(e){return new J({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew J({checks:[],typeName:_.ZodBigInt,coerce:(s==null?void 0:s.coerce)??!1,...y(s)});class le extends g{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==u.boolean){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.boolean,received:r.parsedType}),m}return O(e.data)}}le.create=s=>new le({typeName:_.ZodBoolean,coerce:(s==null?void 0:s.coerce)||!1,...y(s)});class X extends g{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==u.date){const a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_type,expected:u.date,received:a.parsedType}),m}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_date}),m}const r=new C;let n;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()a.value&&(n=this._getOrReturnCtx(e,n),c(n,{code:d.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):v.assertNever(a);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new X({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:h.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:h.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew X({checks:[],coerce:(s==null?void 0:s.coerce)||!1,typeName:_.ZodDate,...y(s)});class Ae extends g{_parse(e){if(this._getType(e)!==u.symbol){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.symbol,received:r.parsedType}),m}return O(e.data)}}Ae.create=s=>new Ae({typeName:_.ZodSymbol,...y(s)});class he extends g{_parse(e){if(this._getType(e)!==u.undefined){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.undefined,received:r.parsedType}),m}return O(e.data)}}he.create=s=>new he({typeName:_.ZodUndefined,...y(s)});class fe extends g{_parse(e){if(this._getType(e)!==u.null){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.null,received:r.parsedType}),m}return O(e.data)}}fe.create=s=>new fe({typeName:_.ZodNull,...y(s)});class Ne extends g{constructor(){super(...arguments),this._any=!0}_parse(e){return O(e.data)}}Ne.create=s=>new Ne({typeName:_.ZodAny,...y(s)});class pe extends g{constructor(){super(...arguments),this._unknown=!0}_parse(e){return O(e.data)}}pe.create=s=>new pe({typeName:_.ZodUnknown,...y(s)});class P extends g{_parse(e){const t=this._getOrReturnCtx(e);return c(t,{code:d.invalid_type,expected:u.never,received:t.parsedType}),m}}P.create=s=>new P({typeName:_.ZodNever,...y(s)});class Ze extends g{_parse(e){if(this._getType(e)!==u.undefined){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.void,received:r.parsedType}),m}return O(e.data)}}Ze.create=s=>new Ze({typeName:_.ZodVoid,...y(s)});class A extends g{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==u.array)return c(t,{code:d.invalid_type,expected:u.array,received:t.parsedType}),m;if(n.exactLength!==null){const i=t.data.length>n.exactLength.value,o=t.data.lengthn.maxLength.value&&(c(t,{code:d.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>n.type._parseAsync(new Z(t,i,t.path,o)))).then(i=>C.mergeArray(r,i));const a=[...t.data].map((i,o)=>n.type._parseSync(new Z(t,i,t.path,o)));return C.mergeArray(r,a)}get element(){return this._def.type}min(e,t){return new A({...this._def,minLength:{value:e,message:h.toString(t)}})}max(e,t){return new A({...this._def,maxLength:{value:e,message:h.toString(t)}})}length(e,t){return new A({...this._def,exactLength:{value:e,message:h.toString(t)}})}nonempty(e){return this.min(1,e)}}A.create=(s,e)=>new A({type:s,minLength:null,maxLength:null,exactLength:null,typeName:_.ZodArray,...y(e)});function D(s){if(s instanceof w){const e={};for(const t in s.shape){const r=s.shape[t];e[t]=j.create(D(r))}return new w({...s._def,shape:()=>e})}else return s instanceof A?new A({...s._def,type:D(s.element)}):s instanceof j?j.create(D(s.unwrap())):s instanceof L?L.create(D(s.unwrap())):s instanceof M?M.create(s.items.map(e=>D(e))):s}class w extends g{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=v.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==u.object){const p=this._getOrReturnCtx(e);return c(p,{code:d.invalid_type,expected:u.object,received:p.parsedType}),m}const{status:r,ctx:n}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof P&&this._def.unknownKeys==="strip"))for(const p in n.data)i.includes(p)||o.push(p);const f=[];for(const p of i){const x=a[p],F=n.data[p];f.push({key:{status:"valid",value:p},value:x._parse(new Z(n,F,n.path,p)),alwaysSet:p in n.data})}if(this._def.catchall instanceof P){const p=this._def.unknownKeys;if(p==="passthrough")for(const x of o)f.push({key:{status:"valid",value:x},value:{status:"valid",value:n.data[x]}});else if(p==="strict")o.length>0&&(c(n,{code:d.unrecognized_keys,keys:o}),r.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const p=this._def.catchall;for(const x of o){const F=n.data[x];f.push({key:{status:"valid",value:x},value:p._parse(new Z(n,F,n.path,x)),alwaysSet:x in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const p=[];for(const x of f){const F=await x.key,Be=await x.value;p.push({key:F,value:Be,alwaysSet:x.alwaysSet})}return p}).then(p=>C.mergeObjectSync(r,p)):C.mergeObjectSync(r,f)}get shape(){return this._def.shape()}strict(e){return h.errToObj,new w({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var a,i;const n=((i=(a=this._def).errorMap)==null?void 0:i.call(a,t,r).message)??r.defaultError;return t.code==="unrecognized_keys"?{message:h.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new w({...this._def,unknownKeys:"strip"})}passthrough(){return new w({...this._def,unknownKeys:"passthrough"})}extend(e){return new w({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new w({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new w({...this._def,catchall:e})}pick(e){const t={};for(const r of v.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new w({...this._def,shape:()=>t})}omit(e){const t={};for(const r of v.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new w({...this._def,shape:()=>t})}deepPartial(){return D(this)}partial(e){const t={};for(const r of v.objectKeys(this.shape)){const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}return new w({...this._def,shape:()=>t})}required(e){const t={};for(const r of v.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof j;)a=a._def.innerType;t[r]=a}return new w({...this._def,shape:()=>t})}keyof(){return Pe(v.objectKeys(this.shape))}}w.create=(s,e)=>new w({shape:()=>s,unknownKeys:"strip",catchall:P.create(),typeName:_.ZodObject,...y(e)});w.strictCreate=(s,e)=>new w({shape:()=>s,unknownKeys:"strict",catchall:P.create(),typeName:_.ZodObject,...y(e)});w.lazycreate=(s,e)=>new w({shape:s,unknownKeys:"strip",catchall:P.create(),typeName:_.ZodObject,...y(e)});class K extends g{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function n(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new I(o.ctx.common.issues));return c(t,{code:d.invalid_union,unionErrors:i}),m}if(t.common.async)return Promise.all(r.map(async a=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let a;const i=[];for(const f of r){const p={...t,common:{...t.common,issues:[]},parent:null},x=f._parseSync({data:t.data,path:t.path,parent:p});if(x.status==="valid")return x;x.status==="dirty"&&!a&&(a={result:x,ctx:p}),p.common.issues.length&&i.push(p.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(f=>new I(f));return c(t,{code:d.invalid_union,unionErrors:o}),m}}get options(){return this._def.options}}K.create=(s,e)=>new K({options:s,typeName:_.ZodUnion,...y(e)});const R=s=>s instanceof _e?R(s.schema):s instanceof z?R(s.innerType()):s instanceof se?[s.value]:s instanceof V?s.options:s instanceof ye?v.objectValues(s.enum):s instanceof ne?R(s._def.innerType):s instanceof he?[void 0]:s instanceof fe?[null]:s instanceof j?[void 0,...R(s.unwrap())]:s instanceof L?[null,...R(s.unwrap())]:s instanceof Me||s instanceof ie?R(s.unwrap()):s instanceof ae?R(s._def.innerType):[];class xe extends g{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.object)return c(t,{code:d.invalid_type,expected:u.object,received:t.parsedType}),m;const r=this.discriminator,n=t.data[r],a=this.optionsMap.get(n);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(c(t,{code:d.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),m)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const n=new Map;for(const a of t){const i=R(a.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of i){if(n.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,a)}}return new xe({typeName:_.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...y(r)})}}function me(s,e){const t=$(s),r=$(e);if(s===e)return{valid:!0,data:s};if(t===u.object&&r===u.object){const n=v.objectKeys(e),a=v.objectKeys(s).filter(o=>n.indexOf(o)!==-1),i={...s,...e};for(const o of a){const f=me(s[o],e[o]);if(!f.valid)return{valid:!1};i[o]=f.data}return{valid:!0,data:i}}else if(t===u.array&&r===u.array){if(s.length!==e.length)return{valid:!1};const n=[];for(let a=0;a{if(Se(a)||Se(i))return m;const o=me(a.value,i.value);return o.valid?((Ce(a)||Ce(i))&&t.dirty(),{status:t.value,value:o.data}):(c(r,{code:d.invalid_intersection_types}),m)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ee.create=(s,e,t)=>new ee({left:s,right:e,typeName:_.ZodIntersection,...y(t)});class M extends g{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.array)return c(r,{code:d.invalid_type,expected:u.array,received:r.parsedType}),m;if(r.data.lengththis._def.items.length&&(c(r,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...r.data].map((i,o)=>{const f=this._def.items[o]||this._def.rest;return f?f._parse(new Z(r,i,r.path,o)):null}).filter(i=>!!i);return r.common.async?Promise.all(a).then(i=>C.mergeArray(t,i)):C.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new M({...this._def,rest:e})}}M.create=(s,e)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new M({items:s,typeName:_.ZodTuple,rest:null,...y(e)})};class te extends g{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.object)return c(r,{code:d.invalid_type,expected:u.object,received:r.parsedType}),m;const n=[],a=this._def.keyType,i=this._def.valueType;for(const o in r.data)n.push({key:a._parse(new Z(r,o,r.path,o)),value:i._parse(new Z(r,r.data[o],r.path,o)),alwaysSet:o in r.data});return r.common.async?C.mergeObjectAsync(t,n):C.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof g?new te({keyType:e,valueType:t,typeName:_.ZodRecord,...y(r)}):new te({keyType:E.create(),valueType:e,typeName:_.ZodRecord,...y(t)})}}class Re extends g{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.map)return c(r,{code:d.invalid_type,expected:u.map,received:r.parsedType}),m;const n=this._def.keyType,a=this._def.valueType,i=[...r.data.entries()].map(([o,f],p)=>({key:n._parse(new Z(r,o,r.path,[p,"key"])),value:a._parse(new Z(r,f,r.path,[p,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const f of i){const p=await f.key,x=await f.value;if(p.status==="aborted"||x.status==="aborted")return m;(p.status==="dirty"||x.status==="dirty")&&t.dirty(),o.set(p.value,x.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const f of i){const p=f.key,x=f.value;if(p.status==="aborted"||x.status==="aborted")return m;(p.status==="dirty"||x.status==="dirty")&&t.dirty(),o.set(p.value,x.value)}return{status:t.value,value:o}}}}Re.create=(s,e,t)=>new Re({valueType:e,keyType:s,typeName:_.ZodMap,...y(t)});class Y extends g{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.set)return c(r,{code:d.invalid_type,expected:u.set,received:r.parsedType}),m;const n=this._def;n.minSize!==null&&r.data.sizen.maxSize.value&&(c(r,{code:d.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const a=this._def.valueType;function i(f){const p=new Set;for(const x of f){if(x.status==="aborted")return m;x.status==="dirty"&&t.dirty(),p.add(x.value)}return{status:t.value,value:p}}const o=[...r.data.values()].map((f,p)=>a._parse(new Z(r,f,r.path,p)));return r.common.async?Promise.all(o).then(f=>i(f)):i(o)}min(e,t){return new Y({...this._def,minSize:{value:e,message:h.toString(t)}})}max(e,t){return new Y({...this._def,maxSize:{value:e,message:h.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Y.create=(s,e)=>new Y({valueType:s,minSize:null,maxSize:null,typeName:_.ZodSet,...y(e)});class _e extends g{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}_e.create=(s,e)=>new _e({getter:s,typeName:_.ZodLazy,...y(e)});class se extends g{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return c(t,{received:t.data,code:d.invalid_literal,expected:this._def.value}),m}return{status:"valid",value:e.data}}get value(){return this._def.value}}se.create=(s,e)=>new se({value:s,typeName:_.ZodLiteral,...y(e)});function Pe(s,e){return new V({values:s,typeName:_.ZodEnum,...y(e)})}class V extends g{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return c(t,{expected:v.joinValues(r),received:t.parsedType,code:d.invalid_type}),m}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return c(t,{received:t.data,code:d.invalid_enum_value,options:r}),m}return O(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return V.create(e,{...this._def,...t})}exclude(e,t=this._def){return V.create(this.options.filter(r=>!e.includes(r)),{...this._def,...t})}}V.create=Pe;class ye extends g{_parse(e){const t=v.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==u.string&&r.parsedType!==u.number){const n=v.objectValues(t);return c(r,{expected:v.joinValues(n),received:r.parsedType,code:d.invalid_type}),m}if(this._cache||(this._cache=new Set(v.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const n=v.objectValues(t);return c(r,{received:r.data,code:d.invalid_enum_value,options:n}),m}return O(e.data)}get enum(){return this._def.values}}ye.create=(s,e)=>new ye({values:s,typeName:_.ZodNativeEnum,...y(e)});class re extends g{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.promise&&t.common.async===!1)return c(t,{code:d.invalid_type,expected:u.promise,received:t.parsedType}),m;const r=t.parsedType===u.promise?t.data:Promise.resolve(t.data);return O(r.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}}re.create=(s,e)=>new re({type:s,typeName:_.ZodPromise,...y(e)});class z extends g{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:i=>{c(r,i),i.fatal?t.abort():t.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){const i=n.transform(r.data,a);if(r.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return m;const f=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return f.status==="aborted"?m:f.status==="dirty"||t.value==="dirty"?W(f.value):f});{if(t.value==="aborted")return m;const o=this._def.schema._parseSync({data:i,path:r.path,parent:r});return o.status==="aborted"?m:o.status==="dirty"||t.value==="dirty"?W(o.value):o}}if(n.type==="refinement"){const i=o=>{const f=n.refinement(o,a);if(r.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?m:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?m:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!U(i))return m;const o=n.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>U(i)?Promise.resolve(n.transform(i.value,a)).then(o=>({status:t.value,value:o})):m);v.assertNever(n)}}z.create=(s,e,t)=>new z({schema:s,typeName:_.ZodEffects,effect:e,...y(t)});z.createWithPreprocess=(s,e,t)=>new z({schema:e,effect:{type:"preprocess",transform:s},typeName:_.ZodEffects,...y(t)});class j extends g{_parse(e){return this._getType(e)===u.undefined?O(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}j.create=(s,e)=>new j({innerType:s,typeName:_.ZodOptional,...y(e)});class L extends g{_parse(e){return this._getType(e)===u.null?O(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}L.create=(s,e)=>new L({innerType:s,typeName:_.ZodNullable,...y(e)});class ne extends g{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===u.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ne.create=(s,e)=>new ne({innerType:s,typeName:_.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...y(e)});class ae extends g{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Q(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new I(r.common.issues)},input:r.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new I(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ae.create=(s,e)=>new ae({innerType:s,typeName:_.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...y(e)});class Ee extends g{_parse(e){if(this._getType(e)!==u.nan){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.nan,received:r.parsedType}),m}return{status:"valid",value:e.data}}}Ee.create=s=>new Ee({typeName:_.ZodNaN,...y(s)});class Me extends g{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class ke extends g{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?m:a.status==="dirty"?(t.dirty(),W(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const n=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return n.status==="aborted"?m:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:r.path,parent:r})}}static create(e,t){return new ke({in:e,out:t,typeName:_.ZodPipeline})}}class ie extends g{_parse(e){const t=this._def.innerType._parse(e),r=n=>(U(n)&&(n.value=Object.freeze(n.value)),n);return Q(t)?t.then(n=>r(n)):r(t)}unwrap(){return this._def.innerType}}ie.create=(s,e)=>new ie({innerType:s,typeName:_.ZodReadonly,...y(e)});var _;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly"})(_||(_={}));const l=E.create,b=B.create,oe=le.create,_t=pe.create;P.create;const T=A.create,k=w.create,Ve=K.create,ze=xe.create;ee.create;M.create;const Le=te.create,G=se.create,ge=V.create;re.create;j.create;L.create;const N=Le(_t()),be=k({id:b(),name:l(),slug:l().optional()}).passthrough(),de=k({url:l(),is_official:oe()}),ve=k({task_id:b(),dataset_id:b(),model_name:l().nullish(),harness:l().nullish(),methodology:l().nullish(),metrics:Le(Ve([l(),b()])),uses_additional_data:oe().optional(),is_open:oe().optional(),best_rank:b().nullish(),best_metric:l().nullish(),evaluated_on:l().nullish(),external_source_url:l().nullish(),num_parameters:b().nullish(),hf_model_url:l().nullish()}).passthrough(),yt=ve.partial().extend({id:b().optional()}),gt=ze("op",[k({op:G("create"),data:ve}),k({op:G("update"),evaluation_id:b(),data:ve}),k({op:G("delete"),evaluation_id:b()})]),je=k({hf_models:T(l()),hf_datasets:T(l()),hf_spaces:T(l())}),we=k({file_name:l(),mime_type:l(),data_url:l().optional(),url:l().optional()}),q=k({name:l(),description:l().optional()}),vt=q.extend({image:we.optional(),image_credit:l().optional(),parent_id:b().optional(),area_id:b().optional(),keywords:l().optional()}),xt=q.extend({image:we.optional(),image_credit:l().optional(),source_paper_id:b().optional(),source_url:l().optional(),source_title:l().optional()}),kt=Ve([k({benchmark:l(),task:l(),description:l()}),q.extend({description:l(),task_ids:T(b()),full_name:l().optional(),url:l().optional(),hf_url:l().optional(),paper_url:l().optional(),license_name:l().optional(),license_url:l().optional()})]),bt=q.extend({description:l(),direction:ge(["higher_is_better","lower_is_better"]),full_name:l().optional(),scale:l().optional(),task_id:b(),dataset_id:b()}),wt=q.extend({short_name:l().optional(),venue:l().optional(),location:l().optional(),url:l(),year:b(),start_date:l().optional(),end_date:l().optional()}),Tt=q.extend({hf_slug:l().optional(),website_url:l().optional(),image:we.optional()}),St=k({id:b(),paper_id:b().nullable(),hf_username:l(),hf_subject:l().nullish(),is_author:oe(),status:ge(["pending","approved","rejected"]),applied_payload:N.nullish(),conflict_payload:N.nullish(),result_entity_type:l().nullish(),result_entity_id:l().nullish(),admin_note:l().nullish(),user_review_reason:l().nullish(),reviewed_by:l().nullish(),reviewed_by_kind:ge(["human","codex","auto"]).nullish(),catalog_event_id:l().nullish(),review_evidence:N.nullish(),created_at:l(),updated_at:l(),reviewed_at:l().nullish()});function S(s,e,t){return St.extend({edit_type:G(s),proposed_payload:e,current_payload:t.nullish()})}const Ct=S("tasks",k({task_ids:T(b())}),k({tasks:T(be)})),Ot=S("methods",k({method_ids:T(b())}),k({methods:T(be)})),At=S("evaluations",k({operations:T(gt)}),k({evaluations:T(yt)})),Nt=S("repositories",k({repositories:T(de)}),k({repositories:T(de)})),Zt=S("project_pages",k({project_pages:T(de)}),k({project_pages:T(de)})),Rt=S("source_url",k({source_url:l()}),k({source_url:l().nullish()})),Et=S("hf_artifacts",je,je),jt=S("x_threads",k({x_threads:T(l())}),k({x_threads:T(k({url:l()}))})),It=S("organizations",k({organization_ids:T(b())}),k({organizations:T(be)})),$t=S("new_task",vt,N),Pt=S("new_method",xt,N),Mt=S("new_benchmark",kt,N),Vt=S("new_metric",bt,N),zt=S("new_conference",wt,N),Lt=S("new_organization",Tt,N),Dt=S("new_external_paper",k({title:l().optional(),source_url:l(),authors:T(l()),date_published:l().optional(),abstract:l().optional()}),N),De=ze("edit_type",[Ct,Ot,At,Nt,Zt,Rt,Et,jt,It,$t,Pt,Mt,Vt,zt,Lt,Dt]);function Jt(s,e,t){return{paper_id:s,edit_type:e,proposed_payload:t}}const Ut=k({count:b(),results:T(De)});class Bt extends Error{constructor(e){super(`Malformed pending-edit payload: ${e}`),this.name="PendingEditPayloadError"}}function Ue(s,e){const t=s.safeParse(e);if(t.success)return t.data;const r=t.error.issues[0];throw new Bt(`${(r==null?void 0:r.path.join("."))||"response"}: ${(r==null?void 0:r.message)||"invalid value"}`)}const H=s=>Ue(De,s),qt=s=>Ue(Ut,s);class Ft{constructor(e){this.request=e}async submit(e){return H(await this.request("/me/paper-edits",{method:"POST",body:JSON.stringify(e)}))}list(e){const t=new URLSearchParams;for(const[n,a]of Object.entries(e??{}))a!==void 0&&t.set(n,String(a));const r=t.toString();return this.request(`/admin/paper-edits${r?`?${r}`:""}`).then(qt)}revertAutoApproved(e,t={}){return this.request(`/admin/submitters/${encodeURIComponent(e)}/revert-auto-approved`,{method:"POST",body:JSON.stringify(t)})}async get(e){return H(await this.request(`/admin/paper-edits/${e}`))}async approve(e,t={}){return H(await this.request(`/admin/paper-edits/${e}/approve`,{method:"POST",body:JSON.stringify(t)}))}async reject(e,t={}){return H(await this.request(`/admin/paper-edits/${e}/reject`,{method:"POST",body:JSON.stringify(t)}))}}const Yt=new Ft(qe);export{Jt as p,Yt as s}; diff --git a/assets/switch-BvSgzfJM.js b/assets/switch-D_MyRbto.js similarity index 97% rename from assets/switch-BvSgzfJM.js rename to assets/switch-D_MyRbto.js index 9759f76a2eb5e55cbd29e9852dd45f9ab7a6dadd..c62b4c17c33fe609b355c22d788491120c442a72 100644 --- a/assets/switch-BvSgzfJM.js +++ b/assets/switch-D_MyRbto.js @@ -1 +1 @@ -import{r as s,w as C,v as I,j as a,t as y,x as M,y as H,z,B as g}from"./index-CqKcHUvZ.js";import{u as A}from"./index-C8IgDsSE.js";var b="Switch",[U]=z(b),[q,L]=U(b),P=s.forwardRef((t,o)=>{const{__scopeSwitch:e,name:n,checked:r,defaultChecked:m,required:d,disabled:c,value:u="on",onCheckedChange:v,form:i,...w}=t,[l,p]=s.useState(null),S=C(o,h=>p(h)),k=s.useRef(!1),x=l?i||!!l.closest("form"):!0,[f,B]=I({prop:r,defaultProp:m??!1,onChange:v,caller:b});return a.jsxs(q,{scope:e,checked:f,disabled:c,children:[a.jsx(y.button,{type:"button",role:"switch","aria-checked":f,"aria-required":d,"data-state":j(f),"data-disabled":c?"":void 0,disabled:c,value:u,...w,ref:S,onClick:M(t.onClick,h=>{B(T=>!T),x&&(k.current=h.isPropagationStopped(),k.current||h.stopPropagation())})}),x&&a.jsx(N,{control:l,bubbles:!k.current,name:n,value:u,checked:f,required:d,disabled:c,form:i,style:{transform:"translateX(-100%)"}})]})});P.displayName=b;var E="SwitchThumb",R=s.forwardRef((t,o)=>{const{__scopeSwitch:e,...n}=t,r=L(E,e);return a.jsx(y.span,{"data-state":j(r.checked),"data-disabled":r.disabled?"":void 0,...n,ref:o})});R.displayName=E;var O="SwitchBubbleInput",N=s.forwardRef(({__scopeSwitch:t,control:o,checked:e,bubbles:n=!0,...r},m)=>{const d=s.useRef(null),c=C(d,m),u=A(e),v=H(o);return s.useEffect(()=>{const i=d.current;if(!i)return;const w=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(w,"checked").set;if(u!==e&&p){const S=new Event("click",{bubbles:n});p.call(i,e),i.dispatchEvent(S)}},[u,e,n]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:e,...r,tabIndex:-1,ref:c,style:{...r.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});N.displayName=O;function j(t){return t?"checked":"unchecked"}var _=P,D=R;const F=s.forwardRef(({className:t,...o},e)=>a.jsx(_,{className:g("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",t),...o,ref:e,children:a.jsx(D,{className:g("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));F.displayName=_.displayName;export{F as S}; +import{r as s,w as C,v as I,j as a,t as y,x as M,y as H,z,B as g}from"./index-D6jcIRWs.js";import{u as A}from"./index-DIg7XGE2.js";var b="Switch",[U]=z(b),[q,L]=U(b),P=s.forwardRef((t,o)=>{const{__scopeSwitch:e,name:n,checked:r,defaultChecked:m,required:d,disabled:c,value:u="on",onCheckedChange:v,form:i,...w}=t,[l,p]=s.useState(null),S=C(o,h=>p(h)),k=s.useRef(!1),x=l?i||!!l.closest("form"):!0,[f,B]=I({prop:r,defaultProp:m??!1,onChange:v,caller:b});return a.jsxs(q,{scope:e,checked:f,disabled:c,children:[a.jsx(y.button,{type:"button",role:"switch","aria-checked":f,"aria-required":d,"data-state":j(f),"data-disabled":c?"":void 0,disabled:c,value:u,...w,ref:S,onClick:M(t.onClick,h=>{B(T=>!T),x&&(k.current=h.isPropagationStopped(),k.current||h.stopPropagation())})}),x&&a.jsx(N,{control:l,bubbles:!k.current,name:n,value:u,checked:f,required:d,disabled:c,form:i,style:{transform:"translateX(-100%)"}})]})});P.displayName=b;var E="SwitchThumb",R=s.forwardRef((t,o)=>{const{__scopeSwitch:e,...n}=t,r=L(E,e);return a.jsx(y.span,{"data-state":j(r.checked),"data-disabled":r.disabled?"":void 0,...n,ref:o})});R.displayName=E;var O="SwitchBubbleInput",N=s.forwardRef(({__scopeSwitch:t,control:o,checked:e,bubbles:n=!0,...r},m)=>{const d=s.useRef(null),c=C(d,m),u=A(e),v=H(o);return s.useEffect(()=>{const i=d.current;if(!i)return;const w=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(w,"checked").set;if(u!==e&&p){const S=new Event("click",{bubbles:n});p.call(i,e),i.dispatchEvent(S)}},[u,e,n]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:e,...r,tabIndex:-1,ref:c,style:{...r.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});N.displayName=O;function j(t){return t?"checked":"unchecked"}var _=P,D=R;const F=s.forwardRef(({className:t,...o},e)=>a.jsx(_,{className:g("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",t),...o,ref:e,children:a.jsx(D,{className:g("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));F.displayName=_.displayName;export{F as S}; diff --git a/assets/textarea-CQToxq8k.js b/assets/textarea-sXKODM3W.js similarity index 86% rename from assets/textarea-CQToxq8k.js rename to assets/textarea-sXKODM3W.js index 432f8f8f7a0b96baf6bb7bba14d232d798e7c674..b6107b5c59dd2169e003ee8631cbffcb973169c2 100644 --- a/assets/textarea-CQToxq8k.js +++ b/assets/textarea-sXKODM3W.js @@ -1 +1 @@ -import{r as s,j as a,B as t}from"./index-CqKcHUvZ.js";const i=s.forwardRef(({className:e,...r},o)=>a.jsx("textarea",{className:t("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...r}));i.displayName="Textarea";export{i as T}; +import{r as s,j as a,B as t}from"./index-D6jcIRWs.js";const i=s.forwardRef(({className:e,...r},o)=>a.jsx("textarea",{className:t("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...r}));i.displayName="Textarea";export{i as T}; diff --git a/assets/thumbs-up-C19-ALYv.js b/assets/thumbs-up-BqRlVdvF.js similarity index 90% rename from assets/thumbs-up-C19-ALYv.js rename to assets/thumbs-up-BqRlVdvF.js index 7f2477f2559c568f079738782011e5e3f4e33eac..1f9e4791e8638beed6b2a9473feebecbabe3dc84 100644 --- a/assets/thumbs-up-C19-ALYv.js +++ b/assets/thumbs-up-BqRlVdvF.js @@ -1,4 +1,4 @@ -import{n as a}from"./index-CqKcHUvZ.js";/** +import{n as a}from"./index-D6jcIRWs.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/trending-up-n0ivZSaN.js b/assets/trending-up-DqN3HzZ5.js similarity index 89% rename from assets/trending-up-n0ivZSaN.js rename to assets/trending-up-DqN3HzZ5.js index a11a3fbac50f18317c8c080d8ac9ef97f623589d..1bd69814dce7a42276d0db92f32bf82847b36fed 100644 --- a/assets/trending-up-n0ivZSaN.js +++ b/assets/trending-up-DqN3HzZ5.js @@ -1,4 +1,4 @@ -import{n}from"./index-CqKcHUvZ.js";/** +import{n}from"./index-D6jcIRWs.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/triangle-alert-DM207o24.js b/assets/triangle-alert-Cypc2KaL.js similarity index 94% rename from assets/triangle-alert-DM207o24.js rename to assets/triangle-alert-Cypc2KaL.js index 973bf368ccb45ca83d31613498fec4199161a6e0..f62683c30123009b19687940c6f6e0ff410db995 100644 --- a/assets/triangle-alert-DM207o24.js +++ b/assets/triangle-alert-Cypc2KaL.js @@ -1,4 +1,4 @@ -import{n as e}from"./index-CqKcHUvZ.js";/** +import{n as e}from"./index-D6jcIRWs.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/trophy-CwHzFBlu.js b/assets/trophy-CqWfBPLd.js similarity index 93% rename from assets/trophy-CwHzFBlu.js rename to assets/trophy-CqWfBPLd.js index 0458d67c9c4d60a7d5e412eafc4dc30e71e7c035..d61d0793d750e52518f761a03641ac3c31270850 100644 --- a/assets/trophy-CwHzFBlu.js +++ b/assets/trophy-CqWfBPLd.js @@ -1,4 +1,4 @@ -import{n as a}from"./index-CqKcHUvZ.js";/** +import{n as a}from"./index-D6jcIRWs.js";/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. diff --git a/assets/useDebounce-D8I8hw4T.js b/assets/useDebounce-DLPbKAkz.js similarity index 66% rename from assets/useDebounce-D8I8hw4T.js rename to assets/useDebounce-DLPbKAkz.js index fa41c0458f7a845b902a2d0925a7dbfcf2dce6be..77e0424731ae21f26868b9bd06ce02cb26807f95 100644 --- a/assets/useDebounce-D8I8hw4T.js +++ b/assets/useDebounce-DLPbKAkz.js @@ -1 +1 @@ -import{r as o}from"./index-CqKcHUvZ.js";function s(e,t=300){const[r,u]=o.useState(e);return o.useEffect(()=>{const c=setTimeout(()=>u(e),t);return()=>clearTimeout(c)},[e,t]),r}export{s as u}; +import{r as o}from"./index-D6jcIRWs.js";function s(e,t=300){const[r,u]=o.useState(e);return o.useEffect(()=>{const c=setTimeout(()=>u(e),t);return()=>clearTimeout(c)},[e,t]),r}export{s as u}; diff --git a/assets/useInfiniteQuery-lxaMAHEu.js b/assets/useInfiniteQuery-FXco4P1n.js similarity index 80% rename from assets/useInfiniteQuery-lxaMAHEu.js rename to assets/useInfiniteQuery-FXco4P1n.js index 057745ccbf2fd0110af9ca913eda081b39d8f1f6..290167fbeaae60b481db3e0e5b5005c849c214ba 100644 --- a/assets/useInfiniteQuery-lxaMAHEu.js +++ b/assets/useInfiniteQuery-FXco4P1n.js @@ -1 +1 @@ -import{Q as v,a as p}from"./useQuery-Cngk7eL9.js";import{aN as x,aO as N}from"./index-CqKcHUvZ.js";var b=class extends v{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var f,P;const{state:s}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:g,isError:c,isRefetchError:d}=i,r=(P=(f=s.fetchMeta)==null?void 0:f.fetchMore)==null?void 0:P.direction,h=c&&r==="forward",n=a&&r==="forward",o=c&&r==="backward",u=a&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:N(t,s.data),hasPreviousPage:x(t,s.data),isFetchNextPageError:h,isFetchingNextPage:n,isFetchPreviousPageError:o,isFetchingPreviousPage:u,isRefetchError:d&&!h&&!o,isRefetching:g&&!n&&!u}}};function O(e,t){return p(e,b)}export{O as u}; +import{Q as v,a as p}from"./useQuery-CUJUm4FY.js";import{aS as x,aT as b}from"./index-D6jcIRWs.js";var l=class extends v{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var f,P;const{state:s}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:g,isError:c,isRefetchError:d}=i,r=(P=(f=s.fetchMeta)==null?void 0:f.fetchMore)==null?void 0:P.direction,h=c&&r==="forward",n=a&&r==="forward",o=c&&r==="backward",u=a&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:b(t,s.data),hasPreviousPage:x(t,s.data),isFetchNextPageError:h,isFetchingNextPage:n,isFetchPreviousPageError:o,isFetchingPreviousPage:u,isRefetchError:d&&!h&&!o,isRefetching:g&&!n&&!u}}};function w(e,t){return p(e,l)}export{w as u}; diff --git a/assets/useInfiniteScroll-DVF-b-LX.js b/assets/useInfiniteScroll-Dm7JY_X4.js similarity index 58% rename from assets/useInfiniteScroll-DVF-b-LX.js rename to assets/useInfiniteScroll-Dm7JY_X4.js index 021ee0e9f4605450bf6cf2ea511fca930f849416..aef65d5957c46ecb51512271c2172deaa0a08da6 100644 --- a/assets/useInfiniteScroll-DVF-b-LX.js +++ b/assets/useInfiniteScroll-Dm7JY_X4.js @@ -1 +1 @@ -import{r as c}from"./index-CqKcHUvZ.js";import{u as f}from"./useIntersectionObserver-CiBk_Oug.js";function x(i,n="200px"){const{targetRef:o,isIntersecting:e}=f({rootMargin:n}),{data:a,hasNextPage:t,isFetchingNextPage:r,fetchNextPage:s}=i;return c.useEffect(()=>{e&&t&&!r&&s()},[e,t,r,s,a]),o}export{x as u}; +import{r as c}from"./index-D6jcIRWs.js";import{u as f}from"./useIntersectionObserver-3LTuEaFW.js";function x(i,n="200px"){const{targetRef:o,isIntersecting:e}=f({rootMargin:n}),{data:a,hasNextPage:t,isFetchingNextPage:r,fetchNextPage:s}=i;return c.useEffect(()=>{e&&t&&!r&&s()},[e,t,r,s,a]),o}export{x as u}; diff --git a/assets/useIntersectionObserver-CiBk_Oug.js b/assets/useIntersectionObserver-3LTuEaFW.js similarity index 86% rename from assets/useIntersectionObserver-CiBk_Oug.js rename to assets/useIntersectionObserver-3LTuEaFW.js index 8741a5c7c49c61f885a3ec7e69f9918e9898c761..4acd92195e509ac9460db666956ede43c1382fd6 100644 --- a/assets/useIntersectionObserver-CiBk_Oug.js +++ b/assets/useIntersectionObserver-3LTuEaFW.js @@ -1 +1 @@ -import{r}from"./index-CqKcHUvZ.js";function b(u={}){const{threshold:t=0,rootMargin:n="0px"}=u,[i,s]=r.useState(!1),e=r.useRef(null),f=r.useCallback(c=>{if(e.current&&(e.current.disconnect(),e.current=null),!c){s(!1);return}const o=new IntersectionObserver(([l])=>s(l.isIntersecting),{threshold:t,rootMargin:n});o.observe(c),e.current=o},[t,n]);return r.useEffect(()=>()=>{e.current&&(e.current.disconnect(),e.current=null)},[]),{targetRef:f,isIntersecting:i}}export{b as u}; +import{r}from"./index-D6jcIRWs.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-BItMAQ7s.js b/assets/useMutation-p6mN4h17.js similarity index 76% rename from assets/useMutation-BItMAQ7s.js rename to assets/useMutation-p6mN4h17.js index 5c4d10a86b22af65a5c77754a4461d6d7cdf804b..5aa181714083625f0cc691e2a8bce61a131fd56e 100644 --- a/assets/useMutation-BItMAQ7s.js +++ b/assets/useMutation-p6mN4h17.js @@ -1 +1 @@ -var w=i=>{throw TypeError(i)};var E=(i,t,s)=>t.has(i)||w("Cannot "+s);var e=(i,t,s)=>(E(i,t,"read from private field"),s?s.call(i):t.get(i)),b=(i,t,s)=>t.has(i)?w("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,s),p=(i,t,s,r)=>(E(i,t,"write to private field"),r?r.call(i,s):t.set(i,s),s),y=(i,t,s)=>(E(i,t,"access private method"),s);import{aw as L,az as U,aL as R,aM as k,aJ as P,f as q,r as v,aB as z,aK as A}from"./index-CqKcHUvZ.js";var a,c,o,h,n,C,S,j,B=(j=class extends L{constructor(t,s){super();b(this,n);b(this,a);b(this,c);b(this,o);b(this,h);p(this,a,t),this.setOptions(s),this.bindMethods(),y(this,n,C).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const s=this.options;this.options=e(this,a).defaultMutationOptions(t),U(this.options,s)||e(this,a).getMutationCache().notify({type:"observerOptionsUpdated",mutation:e(this,o),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&R(s.mutationKey)!==R(this.options.mutationKey)?this.reset():((r=e(this,o))==null?void 0:r.state.status)==="pending"&&e(this,o).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=e(this,o))==null||t.removeObserver(this)}onMutationUpdate(t){y(this,n,C).call(this),y(this,n,S).call(this,t)}getCurrentResult(){return e(this,c)}reset(){var t;(t=e(this,o))==null||t.removeObserver(this),p(this,o,void 0),y(this,n,C).call(this),y(this,n,S).call(this)}mutate(t,s){var r;return p(this,h,s),(r=e(this,o))==null||r.removeObserver(this),p(this,o,e(this,a).getMutationCache().build(e(this,a),this.options)),e(this,o).addObserver(this),e(this,o).execute(t)}},a=new WeakMap,c=new WeakMap,o=new WeakMap,h=new WeakMap,n=new WeakSet,C=function(){var s;const t=((s=e(this,o))==null?void 0:s.state)??k();p(this,c,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},S=function(t){P.batch(()=>{var s,r,u,f,d,O,K,x;if(e(this,h)&&this.hasListeners()){const m=e(this,c).variables,M=e(this,c).context,g={client:e(this,a),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(r=(s=e(this,h)).onSuccess)==null||r.call(s,t.data,m,M,g)}catch(l){Promise.reject(l)}try{(f=(u=e(this,h)).onSettled)==null||f.call(u,t.data,null,m,M,g)}catch(l){Promise.reject(l)}}else if((t==null?void 0:t.type)==="error"){try{(O=(d=e(this,h)).onError)==null||O.call(d,t.error,m,M,g)}catch(l){Promise.reject(l)}try{(x=(K=e(this,h)).onSettled)==null||x.call(K,void 0,t.error,m,M,g)}catch(l){Promise.reject(l)}}}this.listeners.forEach(m=>{m(e(this,c))})})},j);function J(i,t){const s=q(),[r]=v.useState(()=>new B(s,i));v.useEffect(()=>{r.setOptions(i)},[r,i]);const u=v.useSyncExternalStore(v.useCallback(d=>r.subscribe(P.batchCalls(d)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),f=v.useCallback((d,O)=>{r.mutate(d,O).catch(z)},[r]);if(u.error&&A(r.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:f,mutateAsync:u.mutate}}export{J as u}; +var R=i=>{throw TypeError(i)};var E=(i,t,s)=>t.has(i)||R("Cannot "+s);var e=(i,t,s)=>(E(i,t,"read from private field"),s?s.call(i):t.get(i)),b=(i,t,s)=>t.has(i)?R("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,s),p=(i,t,s,r)=>(E(i,t,"write to private field"),r?r.call(i,s):t.set(i,s),s),y=(i,t,s)=>(E(i,t,"access private method"),s);import{ay as L,aB as U,aN as j,aO as k,aL as P,f as q,r as v,aD as D,aM as A}from"./index-D6jcIRWs.js";var a,c,o,h,n,C,S,w,B=(w=class extends L{constructor(t,s){super();b(this,n);b(this,a);b(this,c);b(this,o);b(this,h);p(this,a,t),this.setOptions(s),this.bindMethods(),y(this,n,C).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const s=this.options;this.options=e(this,a).defaultMutationOptions(t),U(this.options,s)||e(this,a).getMutationCache().notify({type:"observerOptionsUpdated",mutation:e(this,o),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&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,h,s),(r=e(this,o))==null||r.removeObserver(this),p(this,o,e(this,a).getMutationCache().build(e(this,a),this.options)),e(this,o).addObserver(this),e(this,o).execute(t)}},a=new WeakMap,c=new WeakMap,o=new WeakMap,h=new WeakMap,n=new WeakSet,C=function(){var s;const t=((s=e(this,o))==null?void 0:s.state)??k();p(this,c,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},S=function(t){P.batch(()=>{var s,r,u,f,d,O,x,K;if(e(this,h)&&this.hasListeners()){const m=e(this,c).variables,M=e(this,c).context,g={client:e(this,a),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(r=(s=e(this,h)).onSuccess)==null||r.call(s,t.data,m,M,g)}catch(l){Promise.reject(l)}try{(f=(u=e(this,h)).onSettled)==null||f.call(u,t.data,null,m,M,g)}catch(l){Promise.reject(l)}}else if((t==null?void 0:t.type)==="error"){try{(O=(d=e(this,h)).onError)==null||O.call(d,t.error,m,M,g)}catch(l){Promise.reject(l)}try{(K=(x=e(this,h)).onSettled)==null||K.call(x,void 0,t.error,m,M,g)}catch(l){Promise.reject(l)}}}this.listeners.forEach(m=>{m(e(this,c))})})},w);function Q(i,t){const s=q(),[r]=v.useState(()=>new B(s,i));v.useEffect(()=>{r.setOptions(i)},[r,i]);const u=v.useSyncExternalStore(v.useCallback(d=>r.subscribe(P.batchCalls(d)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),f=v.useCallback((d,O)=>{r.mutate(d,O).catch(D)},[r]);if(u.error&&A(r.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:f,mutateAsync:u.mutate}}export{Q as u}; diff --git a/assets/usePapers-By3yMmMn.js b/assets/usePapers-BbCSwcVk.js similarity index 95% rename from assets/usePapers-By3yMmMn.js rename to assets/usePapers-BbCSwcVk.js index 9d9e6627ceb05c4c9914a19d8a4e72a40eff5b8c..de15c4851c295e82dfb9d1ce22d75e0b84ede18b 100644 --- a/assets/usePapers-By3yMmMn.js +++ b/assets/usePapers-BbCSwcVk.js @@ -1 +1 @@ -import{a as g,p as h}from"./papers-bE3C_Qzl.js";import{ag as y}from"./index-CqKcHUvZ.js";import{u as x}from"./useQuery-Cngk7eL9.js";import{u as m}from"./useInfiniteQuery-lxaMAHEu.js";function w(a,e=!0){return x({queryKey:h.detail(a),queryFn:()=>g.get(a),enabled:e&&!!a,staleTime:10*60*1e3,refetchOnWindowFocus:!1})}function I(a={}){const{page_size:e=20,search:t,order_by:s="date_published",order_dir:n="desc",start_date:i,end_date:o,conference:r,task:u,method:l,latest_only:d=!0,include_resources:c=!1,has_code:f=!1,has_hf_artifacts:p=!1,framework:_,repository:b,author:F,enabled:k=!0}=a;return m({queryKey:[...h.feeds.infinite,{page_size:e,search:t,order_by:s,order_dir:n,start_date:i,end_date:o,conference:r,task:u,method:l,latest_only:d,include_resources:c,has_code:f,has_hf_artifacts:p,framework:_,repository:b,author:F}],queryFn:({pageParam:P=1})=>g.list({page:P,page_size:e,search:t,order_by:s,order_dir:n,start_date:i,end_date:o,conference:r,task:u,method:l,latest_only:d,include_resources:c,has_code:f,has_hf_artifacts:p,framework:_,repository:b,author:F}),getNextPageParam:P=>P.next_page,initialPageParam:1,enabled:k,staleTime:5*60*1e3,placeholderData:y,refetchOnWindowFocus:!1})}function K({q:a,order_by:e="relevance",start_date:t,end_date:s,has_code:n=!1,has_hf_artifacts:i=!1,enabled:o=!0}){return m({queryKey:[...h.feeds.search,{q:a,order_by:e,start_date:t,end_date:s,has_code:n,has_hf_artifacts:i}],queryFn:({pageParam:r=1})=>g.searchFeed({q:a,page:r,page_size:20,order_by:e,start_date:t,end_date:s,has_code:n,has_hf_artifacts:i,mode:"hybrid"}),getNextPageParam:r=>r.next_page,initialPageParam:1,enabled:o&&a.trim().length>0,staleTime:5*60*1e3,placeholderData:y,refetchOnWindowFocus:!1})}function D(a){const{taskId:e,page_size:t=20,order_by:s="date_published",order_dir:n="desc",latest_only:i=!0,include_resources:o=!0,has_code:r=!1,has_hf_artifacts:u=!1,start_date:l,end_date:d,enabled:c=!0}=a;return m({queryKey:[...h.feeds.task,e,{page_size:t,order_by:s,order_dir:n,latest_only:i,include_resources:o,has_code:r,has_hf_artifacts:u,start_date:l,end_date:d}],queryFn:({pageParam:f=1})=>g.forTask(e,{page:f,page_size:t,order_by:s,order_dir:n,latest_only:i,include_resources:o,repository_limit:1,has_code:r,has_hf_artifacts:u,start_date:l,end_date:d}),getNextPageParam:f=>f.next_page,initialPageParam:1,enabled:c&&!!e,staleTime:5*60*1e3,placeholderData:y,refetchOnWindowFocus:!1})}function W(a){const{conferenceSlug:e,taskSlug:t,presentation:s,page_size:n=20,order_by:i="date_published",order_dir:o="desc",latest_only:r=!0,include_resources:u=!0,has_code:l=!1,has_hf_artifacts:d=!1,start_date:c,end_date:f,enabled:p=!0}=a;return m({queryKey:[...h.feeds.conference,e,t,s,{page_size:n,order_by:i,order_dir:o,latest_only:r,include_resources:u,has_code:l,has_hf_artifacts:d,start_date:c,end_date:f}],queryFn:({pageParam:_=1})=>g.forConference(e,{task:t,presentation:s,page:_,page_size:n,order_by:i,order_dir:o,latest_only:r,include_resources:u,has_code:l,has_hf_artifacts:d,start_date:c,end_date:f}),getNextPageParam:_=>_.next_page,initialPageParam:1,enabled:p&&!!e,staleTime:5*60*1e3,placeholderData:y,refetchOnWindowFocus:!1})}function N(a){const{organizationSlug:e,taskSlug:t,page_size:s=20,order_by:n="date_published",order_dir:i="desc",latest_only:o=!0,include_resources:r=!0,has_code:u=!1,has_hf_artifacts:l=!1,start_date:d,end_date:c,enabled:f=!0}=a;return m({queryKey:[...h.feeds.organization,e,t,{page_size:s,order_by:n,order_dir:i,latest_only:o,include_resources:r,has_code:u,has_hf_artifacts:l,start_date:d,end_date:c}],queryFn:({pageParam:p=1})=>g.forOrganization(e,{task:t,page:p,page_size:s,order_by:n,order_dir:i,latest_only:o,include_resources:r,has_code:u,has_hf_artifacts:l,start_date:d,end_date:c}),getNextPageParam:p=>p.next_page,initialPageParam:1,enabled:f&&!!e,staleTime:5*60*1e3,placeholderData:y,refetchOnWindowFocus:!1})}export{K as a,w as b,D as c,W as d,N as e,I as u}; +import{a as g,p as h}from"./papers-DIIIPDpj.js";import{ai as y}from"./index-D6jcIRWs.js";import{u as x}from"./useQuery-CUJUm4FY.js";import{u as m}from"./useInfiniteQuery-FXco4P1n.js";function w(a,e=!0){return x({queryKey:h.detail(a),queryFn:()=>g.get(a),enabled:e&&!!a,staleTime:10*60*1e3,refetchOnWindowFocus:!1})}function I(a={}){const{page_size:e=20,search:t,order_by:s="date_published",order_dir:n="desc",start_date:i,end_date:o,conference:r,task:u,method:l,latest_only:d=!0,include_resources:c=!1,has_code:f=!1,has_hf_artifacts:p=!1,framework:_,repository:b,author:F,enabled:k=!0}=a;return m({queryKey:[...h.feeds.infinite,{page_size:e,search:t,order_by:s,order_dir:n,start_date:i,end_date:o,conference:r,task:u,method:l,latest_only:d,include_resources:c,has_code:f,has_hf_artifacts:p,framework:_,repository:b,author:F}],queryFn:({pageParam:P=1})=>g.list({page:P,page_size:e,search:t,order_by:s,order_dir:n,start_date:i,end_date:o,conference:r,task:u,method:l,latest_only:d,include_resources:c,has_code:f,has_hf_artifacts:p,framework:_,repository:b,author:F}),getNextPageParam:P=>P.next_page,initialPageParam:1,enabled:k,staleTime:5*60*1e3,placeholderData:y,refetchOnWindowFocus:!1})}function K({q:a,order_by:e="relevance",start_date:t,end_date:s,has_code:n=!1,has_hf_artifacts:i=!1,enabled:o=!0}){return m({queryKey:[...h.feeds.search,{q:a,order_by:e,start_date:t,end_date:s,has_code:n,has_hf_artifacts:i}],queryFn:({pageParam:r=1})=>g.searchFeed({q:a,page:r,page_size:20,order_by:e,start_date:t,end_date:s,has_code:n,has_hf_artifacts:i,mode:"hybrid"}),getNextPageParam:r=>r.next_page,initialPageParam:1,enabled:o&&a.trim().length>0,staleTime:5*60*1e3,placeholderData:y,refetchOnWindowFocus:!1})}function D(a){const{taskId:e,page_size:t=20,order_by:s="date_published",order_dir:n="desc",latest_only:i=!0,include_resources:o=!0,has_code:r=!1,has_hf_artifacts:u=!1,start_date:l,end_date:d,enabled:c=!0}=a;return m({queryKey:[...h.feeds.task,e,{page_size:t,order_by:s,order_dir:n,latest_only:i,include_resources:o,has_code:r,has_hf_artifacts:u,start_date:l,end_date:d}],queryFn:({pageParam:f=1})=>g.forTask(e,{page:f,page_size:t,order_by:s,order_dir:n,latest_only:i,include_resources:o,repository_limit:1,has_code:r,has_hf_artifacts:u,start_date:l,end_date:d}),getNextPageParam:f=>f.next_page,initialPageParam:1,enabled:c&&!!e,staleTime:5*60*1e3,placeholderData:y,refetchOnWindowFocus:!1})}function W(a){const{conferenceSlug:e,taskSlug:t,presentation:s,page_size:n=20,order_by:i="date_published",order_dir:o="desc",latest_only:r=!0,include_resources:u=!0,has_code:l=!1,has_hf_artifacts:d=!1,start_date:c,end_date:f,enabled:p=!0}=a;return m({queryKey:[...h.feeds.conference,e,t,s,{page_size:n,order_by:i,order_dir:o,latest_only:r,include_resources:u,has_code:l,has_hf_artifacts:d,start_date:c,end_date:f}],queryFn:({pageParam:_=1})=>g.forConference(e,{task:t,presentation:s,page:_,page_size:n,order_by:i,order_dir:o,latest_only:r,include_resources:u,has_code:l,has_hf_artifacts:d,start_date:c,end_date:f}),getNextPageParam:_=>_.next_page,initialPageParam:1,enabled:p&&!!e,staleTime:5*60*1e3,placeholderData:y,refetchOnWindowFocus:!1})}function N(a){const{organizationSlug:e,taskSlug:t,page_size:s=20,order_by:n="date_published",order_dir:i="desc",latest_only:o=!0,include_resources:r=!0,has_code:u=!1,has_hf_artifacts:l=!1,start_date:d,end_date:c,enabled:f=!0}=a;return m({queryKey:[...h.feeds.organization,e,t,{page_size:s,order_by:n,order_dir:i,latest_only:o,include_resources:r,has_code:u,has_hf_artifacts:l,start_date:d,end_date:c}],queryFn:({pageParam:p=1})=>g.forOrganization(e,{task:t,page:p,page_size:s,order_by:n,order_dir:i,latest_only:o,include_resources:r,has_code:u,has_hf_artifacts:l,start_date:d,end_date:c}),getNextPageParam:p=>p.next_page,initialPageParam:1,enabled:f&&!!e,staleTime:5*60*1e3,placeholderData:y,refetchOnWindowFocus:!1})}export{K as a,w as b,D as c,W as d,N as e,I as u}; diff --git a/assets/useQuery-Cngk7eL9.js b/assets/useQuery-CUJUm4FY.js similarity index 89% rename from assets/useQuery-Cngk7eL9.js rename to assets/useQuery-CUJUm4FY.js index f6a357ed7ee56c21fd62c9b4337aa15c89141a54..277bf7706b738648ba873a4068f4fb0e55e727f5 100644 --- a/assets/useQuery-Cngk7eL9.js +++ b/assets/useQuery-CUJUm4FY.js @@ -1 +1 @@ -var bt=s=>{throw TypeError(s)};var $=(s,t,e)=>t.has(s)||bt("Cannot "+e);var i=(s,t,e)=>($(s,t,"read from private field"),e?e.call(s):t.get(s)),p=(s,t,e)=>t.has(s)?bt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),u=(s,t,e,r)=>($(s,t,"write to private field"),r?r.call(s,e):t.set(s,e),e),l=(s,t,e)=>($(s,t,"access private method"),e);import{aw as Tt,ax as gt,ay as S,az as q,aA as H,aB as tt,aC as et,aD as vt,aE as Mt,aF as J,aG as Qt,aH as xt,aI as mt,aJ as Ct,r as O,aK as Ot,f as _t}from"./index-CqKcHUvZ.js";var v,a,j,g,x,U,C,w,z,P,L,_,F,T,N,n,A,st,it,rt,at,nt,ht,ot,It,Et,Ft=(Et=class extends Tt{constructor(t,e){super();p(this,n);p(this,v);p(this,a);p(this,j);p(this,g);p(this,x);p(this,U);p(this,C);p(this,w);p(this,z);p(this,P);p(this,L);p(this,_);p(this,F);p(this,T);p(this,N,new Set);this.options=e,u(this,v,t),u(this,w,null),u(this,C,gt()),this.bindMethods(),this.setOptions(e)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(i(this,a).addObserver(this),Rt(i(this,a),this.options)?l(this,n,A).call(this):this.updateResult(),l(this,n,at).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ct(i(this,a),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ct(i(this,a),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,l(this,n,nt).call(this),l(this,n,ht).call(this),i(this,a).removeObserver(this)}setOptions(t){const e=this.options,r=i(this,a);if(this.options=i(this,v).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof S(this.options.enabled,i(this,a))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");l(this,n,ot).call(this),i(this,a).setOptions(this.options),e._defaulted&&!q(this.options,e)&&i(this,v).getQueryCache().notify({type:"observerOptionsUpdated",query:i(this,a),observer:this});const h=this.hasListeners();h&&St(i(this,a),r,this.options,e)&&l(this,n,A).call(this),this.updateResult(),h&&(i(this,a)!==r||S(this.options.enabled,i(this,a))!==S(e.enabled,i(this,a))||H(this.options.staleTime,i(this,a))!==H(e.staleTime,i(this,a)))&&l(this,n,st).call(this);const o=l(this,n,it).call(this);h&&(i(this,a)!==r||S(this.options.enabled,i(this,a))!==S(e.enabled,i(this,a))||o!==i(this,T))&&l(this,n,rt).call(this,o)}getOptimisticResult(t){const e=i(this,v).getQueryCache().build(i(this,v),t),r=this.createResult(e,t);return Ut(this,r)&&(u(this,g,r),u(this,U,this.options),u(this,x,i(this,a).state)),r}getCurrentResult(){return i(this,g)}trackResult(t,e){return new Proxy(t,{get:(r,h)=>(this.trackProp(h),e==null||e(h),h==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&i(this,C).status==="pending"&&i(this,C).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,h))})}trackProp(t){i(this,N).add(t)}getCurrentQuery(){return i(this,a)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=i(this,v).defaultQueryOptions(t),r=i(this,v).getQueryCache().build(i(this,v),e);return r.fetch().then(()=>this.createResult(r,e))}fetch(t){return l(this,n,A).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),i(this,g)))}createResult(t,e){var ft;const r=i(this,a),h=this.options,o=i(this,g),c=i(this,x),y=i(this,U),b=t!==r?t.state:i(this,j),{state:E}=t;let d={...E},M=!1,f;if(e._optimisticResults){const R=this.hasListeners(),k=!R&&Rt(t,e),V=R&&St(t,r,e,h);(k||V)&&(d={...d,...xt(E.data,t.options)}),e._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:Q,errorUpdatedAt:B,status:m}=d;f=d.data;let W=!1;if(e.placeholderData!==void 0&&f===void 0&&m==="pending"){let R;o!=null&&o.isPlaceholderData&&e.placeholderData===(y==null?void 0:y.placeholderData)?(R=o.data,W=!0):R=typeof e.placeholderData=="function"?e.placeholderData((ft=i(this,L))==null?void 0:ft.state.data,i(this,L)):e.placeholderData,R!==void 0&&(m="success",f=mt(o==null?void 0:o.data,R,e),M=!0)}if(e.select&&f!==void 0&&!W)if(o&&f===(c==null?void 0:c.data)&&e.select===i(this,z))f=i(this,P);else try{u(this,z,e.select),f=e.select(f),f=mt(o==null?void 0:o.data,f,e),u(this,P,f),u(this,w,null)}catch(R){u(this,w,R)}i(this,w)&&(Q=i(this,w),f=i(this,P),B=Date.now(),m="error");const X=d.fetchStatus==="fetching",Y=m==="pending",Z=m==="error",lt=Y&&X,dt=f!==void 0,I={status:m,fetchStatus:d.fetchStatus,isPending:Y,isSuccess:m==="success",isError:Z,isInitialLoading:lt,isLoading:lt,data:f,dataUpdatedAt:d.dataUpdatedAt,error:Q,errorUpdatedAt:B,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>b.dataUpdateCount||d.errorUpdateCount>b.errorUpdateCount,isFetching:X,isRefetching:X&&!Y,isLoadingError:Z&&!dt,isPaused:d.fetchStatus==="paused",isPlaceholderData:M,isRefetchError:Z&&dt,isStale:ut(t,e),refetch:this.refetch,promise:i(this,C),isEnabled:S(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const R=I.data!==void 0,k=I.status==="error"&&!R,V=G=>{k?G.reject(I.error):R&&G.resolve(I.data)},pt=()=>{const G=u(this,C,I.promise=gt());V(G)},K=i(this,C);switch(K.status){case"pending":t.queryHash===r.queryHash&&V(K);break;case"fulfilled":(k||I.data!==K.value)&&pt();break;case"rejected":(!k||I.error!==K.reason)&&pt();break}}return I}updateResult(){const t=i(this,g),e=this.createResult(i(this,a),this.options);if(u(this,x,i(this,a).state),u(this,U,this.options),i(this,x).data!==void 0&&u(this,L,i(this,a)),q(e,t))return;u(this,g,e);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:h}=this.options,o=typeof h=="function"?h():h;if(o==="all"||!o&&!i(this,N).size)return!0;const c=new Set(o??i(this,N));return this.options.throwOnError&&c.add("error"),Object.keys(i(this,g)).some(y=>{const D=y;return i(this,g)[D]!==t[D]&&c.has(D)})};l(this,n,It).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&l(this,n,at).call(this)}},v=new WeakMap,a=new WeakMap,j=new WeakMap,g=new WeakMap,x=new WeakMap,U=new WeakMap,C=new WeakMap,w=new WeakMap,z=new WeakMap,P=new WeakMap,L=new WeakMap,_=new WeakMap,F=new WeakMap,T=new WeakMap,N=new WeakMap,n=new WeakSet,A=function(t){l(this,n,ot).call(this);let e=i(this,a).fetch(this.options,t);return t!=null&&t.throwOnError||(e=e.catch(tt)),e},st=function(){l(this,n,nt).call(this);const t=H(this.options.staleTime,i(this,a));if(et.isServer()||i(this,g).isStale||!vt(t))return;const r=Mt(i(this,g).dataUpdatedAt,t)+1;u(this,_,J.setTimeout(()=>{i(this,g).isStale||this.updateResult()},r))},it=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(i(this,a)):this.options.refetchInterval)??!1},rt=function(t){l(this,n,ht).call(this),u(this,T,t),!(et.isServer()||S(this.options.enabled,i(this,a))===!1||!vt(i(this,T))||i(this,T)===0)&&u(this,F,J.setInterval(()=>{(this.options.refetchIntervalInBackground||Qt.isFocused())&&l(this,n,A).call(this)},i(this,T)))},at=function(){l(this,n,st).call(this),l(this,n,rt).call(this,l(this,n,it).call(this))},nt=function(){i(this,_)!==void 0&&(J.clearTimeout(i(this,_)),u(this,_,void 0))},ht=function(){i(this,F)!==void 0&&(J.clearInterval(i(this,F)),u(this,F,void 0))},ot=function(){const t=i(this,v).getQueryCache().build(i(this,v),this.options);if(t===i(this,a))return;const e=i(this,a);u(this,a,t),u(this,j,t.state),this.hasListeners()&&(e==null||e.removeObserver(this),t.addObserver(this))},It=function(t){Ct.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(i(this,g))}),i(this,v).getQueryCache().notify({query:i(this,a),type:"observerResultsUpdated"})})},Et);function Dt(s,t){return S(t.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&S(t.retryOnMount,s)===!1)}function Rt(s,t){return Dt(s,t)||s.state.data!==void 0&&ct(s,t,t.refetchOnMount)}function ct(s,t,e){if(S(t.enabled,s)!==!1&&H(t.staleTime,s)!=="static"){const r=typeof e=="function"?e(s):e;return r==="always"||r!==!1&&ut(s,t)}return!1}function St(s,t,e,r){return(s!==t||S(r.enabled,s)===!1)&&(!e.suspense||s.state.status!=="error")&&ut(s,e)}function ut(s,t){return S(t.enabled,s)!==!1&&s.isStaleByTime(H(t.staleTime,s))}function Ut(s,t){return!q(s.getCurrentResult(),t)}var wt=O.createContext(!1),Pt=()=>O.useContext(wt);wt.Provider;function Lt(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}var Nt=O.createContext(Lt()),Bt=()=>O.useContext(Nt),kt=(s,t,e)=>{const r=e!=null&&e.state.error&&typeof s.throwOnError=="function"?Ot(s.throwOnError,[e.state.error,e]):s.throwOnError;(s.suspense||s.experimental_prefetchInRender||r)&&(t.isReset()||(s.retryOnMount=!1))},At=s=>{O.useEffect(()=>{s.clearReset()},[s])},Ht=({result:s,errorResetBoundary:t,throwOnError:e,query:r,suspense:h})=>s.isError&&!t.isReset()&&!s.isFetching&&r&&(h&&s.data===void 0||Ot(e,[s.error,r])),jt=s=>{if(s.suspense){const e=h=>h==="static"?h:Math.max(h??1e3,1e3),r=s.staleTime;s.staleTime=typeof r=="function"?(...h)=>e(r(...h)):e(r),typeof s.gcTime=="number"&&(s.gcTime=Math.max(s.gcTime,1e3))}},zt=(s,t)=>s.isLoading&&s.isFetching&&!t,Wt=(s,t)=>(s==null?void 0:s.suspense)&&t.isPending,yt=(s,t,e)=>t.fetchOptimistic(s).catch(()=>{e.clearReset()});function Vt(s,t,e){var M,f,Q,B;const r=Pt(),h=Bt(),o=_t(),c=o.defaultQueryOptions(s);(f=(M=o.getDefaultOptions().queries)==null?void 0:M._experimental_beforeQuery)==null||f.call(M,c);const y=o.getQueryCache().get(c.queryHash);c._optimisticResults=r?"isRestoring":"optimistic",jt(c),kt(c,h,y),At(h);const D=!o.getQueryCache().get(c.queryHash),[b]=O.useState(()=>new t(o,c)),E=b.getOptimisticResult(c),d=!r&&s.subscribed!==!1;if(O.useSyncExternalStore(O.useCallback(m=>{const W=d?b.subscribe(Ct.batchCalls(m)):tt;return b.updateResult(),W},[b,d]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),O.useEffect(()=>{b.setOptions(c)},[c,b]),Wt(c,E))throw yt(c,b,h);if(Ht({result:E,errorResetBoundary:h,throwOnError:c.throwOnError,query:y,suspense:c.suspense}))throw E.error;if((B=(Q=o.getDefaultOptions().queries)==null?void 0:Q._experimental_afterQuery)==null||B.call(Q,c,E),c.experimental_prefetchInRender&&!et.isServer()&&zt(E,r)){const m=D?yt(c,b,h):y==null?void 0:y.promise;m==null||m.catch(tt).finally(()=>{b.updateResult()})}return c.notifyOnChangeProps?E:b.trackResult(E)}function Xt(s,t){return Vt(s,Ft)}export{Ft as Q,Vt as a,Pt as b,Bt as c,kt as d,jt as e,At as f,yt as g,Ht as h,Wt as s,Xt as u}; +var bt=s=>{throw TypeError(s)};var $=(s,t,e)=>t.has(s)||bt("Cannot "+e);var i=(s,t,e)=>($(s,t,"read from private field"),e?e.call(s):t.get(s)),p=(s,t,e)=>t.has(s)?bt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),u=(s,t,e,r)=>($(s,t,"write to private field"),r?r.call(s,e):t.set(s,e),e),l=(s,t,e)=>($(s,t,"access private method"),e);import{ay as Mt,az as gt,aA as S,aB as q,aC as H,aD as tt,aE as et,aF as vt,aG as Tt,aH as J,aI as Qt,aJ as xt,aK as mt,aL as Ct,r as O,aM as Ot,f as _t}from"./index-D6jcIRWs.js";var v,a,j,g,x,U,C,w,z,P,L,_,F,M,N,n,A,st,it,rt,at,nt,ht,ot,It,Et,Ft=(Et=class extends Mt{constructor(t,e){super();p(this,n);p(this,v);p(this,a);p(this,j);p(this,g);p(this,x);p(this,U);p(this,C);p(this,w);p(this,z);p(this,P);p(this,L);p(this,_);p(this,F);p(this,M);p(this,N,new Set);this.options=e,u(this,v,t),u(this,w,null),u(this,C,gt()),this.bindMethods(),this.setOptions(e)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(i(this,a).addObserver(this),Rt(i(this,a),this.options)?l(this,n,A).call(this):this.updateResult(),l(this,n,at).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ct(i(this,a),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ct(i(this,a),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,l(this,n,nt).call(this),l(this,n,ht).call(this),i(this,a).removeObserver(this)}setOptions(t){const e=this.options,r=i(this,a);if(this.options=i(this,v).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof S(this.options.enabled,i(this,a))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");l(this,n,ot).call(this),i(this,a).setOptions(this.options),e._defaulted&&!q(this.options,e)&&i(this,v).getQueryCache().notify({type:"observerOptionsUpdated",query:i(this,a),observer:this});const h=this.hasListeners();h&&St(i(this,a),r,this.options,e)&&l(this,n,A).call(this),this.updateResult(),h&&(i(this,a)!==r||S(this.options.enabled,i(this,a))!==S(e.enabled,i(this,a))||H(this.options.staleTime,i(this,a))!==H(e.staleTime,i(this,a)))&&l(this,n,st).call(this);const o=l(this,n,it).call(this);h&&(i(this,a)!==r||S(this.options.enabled,i(this,a))!==S(e.enabled,i(this,a))||o!==i(this,M))&&l(this,n,rt).call(this,o)}getOptimisticResult(t){const e=i(this,v).getQueryCache().build(i(this,v),t),r=this.createResult(e,t);return Ut(this,r)&&(u(this,g,r),u(this,U,this.options),u(this,x,i(this,a).state)),r}getCurrentResult(){return i(this,g)}trackResult(t,e){return new Proxy(t,{get:(r,h)=>(this.trackProp(h),e==null||e(h),h==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&i(this,C).status==="pending"&&i(this,C).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,h))})}trackProp(t){i(this,N).add(t)}getCurrentQuery(){return i(this,a)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=i(this,v).defaultQueryOptions(t),r=i(this,v).getQueryCache().build(i(this,v),e);return r.fetch().then(()=>this.createResult(r,e))}fetch(t){return l(this,n,A).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),i(this,g)))}createResult(t,e){var ft;const r=i(this,a),h=this.options,o=i(this,g),c=i(this,x),y=i(this,U),b=t!==r?t.state:i(this,j),{state:E}=t;let d={...E},T=!1,f;if(e._optimisticResults){const R=this.hasListeners(),k=!R&&Rt(t,e),V=R&&St(t,r,e,h);(k||V)&&(d={...d,...xt(E.data,t.options)}),e._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:Q,errorUpdatedAt:B,status:m}=d;f=d.data;let W=!1;if(e.placeholderData!==void 0&&f===void 0&&m==="pending"){let R;o!=null&&o.isPlaceholderData&&e.placeholderData===(y==null?void 0:y.placeholderData)?(R=o.data,W=!0):R=typeof e.placeholderData=="function"?e.placeholderData((ft=i(this,L))==null?void 0:ft.state.data,i(this,L)):e.placeholderData,R!==void 0&&(m="success",f=mt(o==null?void 0:o.data,R,e),T=!0)}if(e.select&&f!==void 0&&!W)if(o&&f===(c==null?void 0:c.data)&&e.select===i(this,z))f=i(this,P);else try{u(this,z,e.select),f=e.select(f),f=mt(o==null?void 0:o.data,f,e),u(this,P,f),u(this,w,null)}catch(R){u(this,w,R)}i(this,w)&&(Q=i(this,w),f=i(this,P),B=Date.now(),m="error");const X=d.fetchStatus==="fetching",Y=m==="pending",Z=m==="error",lt=Y&&X,dt=f!==void 0,I={status:m,fetchStatus:d.fetchStatus,isPending:Y,isSuccess:m==="success",isError:Z,isInitialLoading:lt,isLoading:lt,data:f,dataUpdatedAt:d.dataUpdatedAt,error:Q,errorUpdatedAt:B,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>b.dataUpdateCount||d.errorUpdateCount>b.errorUpdateCount,isFetching:X,isRefetching:X&&!Y,isLoadingError:Z&&!dt,isPaused:d.fetchStatus==="paused",isPlaceholderData:T,isRefetchError:Z&&dt,isStale:ut(t,e),refetch:this.refetch,promise:i(this,C),isEnabled:S(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const R=I.data!==void 0,k=I.status==="error"&&!R,V=G=>{k?G.reject(I.error):R&&G.resolve(I.data)},pt=()=>{const G=u(this,C,I.promise=gt());V(G)},K=i(this,C);switch(K.status){case"pending":t.queryHash===r.queryHash&&V(K);break;case"fulfilled":(k||I.data!==K.value)&&pt();break;case"rejected":(!k||I.error!==K.reason)&&pt();break}}return I}updateResult(){const t=i(this,g),e=this.createResult(i(this,a),this.options);if(u(this,x,i(this,a).state),u(this,U,this.options),i(this,x).data!==void 0&&u(this,L,i(this,a)),q(e,t))return;u(this,g,e);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:h}=this.options,o=typeof h=="function"?h():h;if(o==="all"||!o&&!i(this,N).size)return!0;const c=new Set(o??i(this,N));return this.options.throwOnError&&c.add("error"),Object.keys(i(this,g)).some(y=>{const D=y;return i(this,g)[D]!==t[D]&&c.has(D)})};l(this,n,It).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&l(this,n,at).call(this)}},v=new WeakMap,a=new WeakMap,j=new WeakMap,g=new WeakMap,x=new WeakMap,U=new WeakMap,C=new WeakMap,w=new WeakMap,z=new WeakMap,P=new WeakMap,L=new WeakMap,_=new WeakMap,F=new WeakMap,M=new WeakMap,N=new WeakMap,n=new WeakSet,A=function(t){l(this,n,ot).call(this);let e=i(this,a).fetch(this.options,t);return t!=null&&t.throwOnError||(e=e.catch(tt)),e},st=function(){l(this,n,nt).call(this);const t=H(this.options.staleTime,i(this,a));if(et.isServer()||i(this,g).isStale||!vt(t))return;const r=Tt(i(this,g).dataUpdatedAt,t)+1;u(this,_,J.setTimeout(()=>{i(this,g).isStale||this.updateResult()},r))},it=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(i(this,a)):this.options.refetchInterval)??!1},rt=function(t){l(this,n,ht).call(this),u(this,M,t),!(et.isServer()||S(this.options.enabled,i(this,a))===!1||!vt(i(this,M))||i(this,M)===0)&&u(this,F,J.setInterval(()=>{(this.options.refetchIntervalInBackground||Qt.isFocused())&&l(this,n,A).call(this)},i(this,M)))},at=function(){l(this,n,st).call(this),l(this,n,rt).call(this,l(this,n,it).call(this))},nt=function(){i(this,_)!==void 0&&(J.clearTimeout(i(this,_)),u(this,_,void 0))},ht=function(){i(this,F)!==void 0&&(J.clearInterval(i(this,F)),u(this,F,void 0))},ot=function(){const t=i(this,v).getQueryCache().build(i(this,v),this.options);if(t===i(this,a))return;const e=i(this,a);u(this,a,t),u(this,j,t.state),this.hasListeners()&&(e==null||e.removeObserver(this),t.addObserver(this))},It=function(t){Ct.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(i(this,g))}),i(this,v).getQueryCache().notify({query:i(this,a),type:"observerResultsUpdated"})})},Et);function Dt(s,t){return S(t.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&S(t.retryOnMount,s)===!1)}function Rt(s,t){return Dt(s,t)||s.state.data!==void 0&&ct(s,t,t.refetchOnMount)}function ct(s,t,e){if(S(t.enabled,s)!==!1&&H(t.staleTime,s)!=="static"){const r=typeof e=="function"?e(s):e;return r==="always"||r!==!1&&ut(s,t)}return!1}function St(s,t,e,r){return(s!==t||S(r.enabled,s)===!1)&&(!e.suspense||s.state.status!=="error")&&ut(s,e)}function ut(s,t){return S(t.enabled,s)!==!1&&s.isStaleByTime(H(t.staleTime,s))}function Ut(s,t){return!q(s.getCurrentResult(),t)}var wt=O.createContext(!1),Pt=()=>O.useContext(wt);wt.Provider;function Lt(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}var Nt=O.createContext(Lt()),Bt=()=>O.useContext(Nt),kt=(s,t,e)=>{const r=e!=null&&e.state.error&&typeof s.throwOnError=="function"?Ot(s.throwOnError,[e.state.error,e]):s.throwOnError;(s.suspense||s.experimental_prefetchInRender||r)&&(t.isReset()||(s.retryOnMount=!1))},At=s=>{O.useEffect(()=>{s.clearReset()},[s])},Ht=({result:s,errorResetBoundary:t,throwOnError:e,query:r,suspense:h})=>s.isError&&!t.isReset()&&!s.isFetching&&r&&(h&&s.data===void 0||Ot(e,[s.error,r])),jt=s=>{if(s.suspense){const e=h=>h==="static"?h:Math.max(h??1e3,1e3),r=s.staleTime;s.staleTime=typeof r=="function"?(...h)=>e(r(...h)):e(r),typeof s.gcTime=="number"&&(s.gcTime=Math.max(s.gcTime,1e3))}},zt=(s,t)=>s.isLoading&&s.isFetching&&!t,Wt=(s,t)=>(s==null?void 0:s.suspense)&&t.isPending,yt=(s,t,e)=>t.fetchOptimistic(s).catch(()=>{e.clearReset()});function Vt(s,t,e){var T,f,Q,B;const r=Pt(),h=Bt(),o=_t(),c=o.defaultQueryOptions(s);(f=(T=o.getDefaultOptions().queries)==null?void 0:T._experimental_beforeQuery)==null||f.call(T,c);const y=o.getQueryCache().get(c.queryHash);c._optimisticResults=r?"isRestoring":"optimistic",jt(c),kt(c,h,y),At(h);const D=!o.getQueryCache().get(c.queryHash),[b]=O.useState(()=>new t(o,c)),E=b.getOptimisticResult(c),d=!r&&s.subscribed!==!1;if(O.useSyncExternalStore(O.useCallback(m=>{const W=d?b.subscribe(Ct.batchCalls(m)):tt;return b.updateResult(),W},[b,d]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),O.useEffect(()=>{b.setOptions(c)},[c,b]),Wt(c,E))throw yt(c,b,h);if(Ht({result:E,errorResetBoundary:h,throwOnError:c.throwOnError,query:y,suspense:c.suspense}))throw E.error;if((B=(Q=o.getDefaultOptions().queries)==null?void 0:Q._experimental_afterQuery)==null||B.call(Q,c,E),c.experimental_prefetchInRender&&!et.isServer()&&zt(E,r)){const m=D?yt(c,b,h):y==null?void 0:y.promise;m==null||m.catch(tt).finally(()=>{b.updateResult()})}return c.notifyOnChangeProps?E:b.trackResult(E)}function Xt(s,t){return Vt(s,Ft)}export{Ft as Q,Vt as a,Pt as b,Bt as c,kt as d,jt as e,At as f,yt as g,Ht as h,Wt as s,Xt as u}; diff --git a/index.html b/index.html index cbde38b3a4b260e634b576b40cd1498d6be26508..2c5febd58002a0bda2b8473f086f85af326442ef 100644 --- a/index.html +++ b/index.html @@ -72,8 +72,8 @@ plausible.init(); })(); - - + +