@a-t-h-i/bot-lobby 0.6.61 → 0.6.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/README.md +8 -8
  2. package/package.json +2 -1
  3. package/prompts/designer.md +25 -15
  4. package/prompts/master.md +284 -491
  5. package/prompts/panel.md +7 -0
  6. package/prompts/planner.md +15 -4
  7. package/prompts/qa.md +5 -1
  8. package/prompts/worker.md +0 -7
  9. package/scripts/builtin/affected_packages.mjs +106 -0
  10. package/scripts/builtin/check_changed.mjs +51 -0
  11. package/scripts/builtin/check_contract_breakage.mjs +118 -0
  12. package/scripts/builtin/circular_dependency_check.mjs +79 -0
  13. package/scripts/builtin/code_duplication_check.mjs +86 -0
  14. package/scripts/builtin/diff_summary.mjs +62 -0
  15. package/scripts/builtin/failure_digest.mjs +107 -0
  16. package/scripts/builtin/find_generated_files.mjs +79 -0
  17. package/scripts/builtin/find_symbol.mjs +81 -0
  18. package/scripts/builtin/find_test_fixtures.mjs +73 -0
  19. package/scripts/builtin/find_tests_for.mjs +12 -0
  20. package/scripts/builtin/lib/common.mjs +267 -0
  21. package/scripts/builtin/outline_file.mjs +77 -0
  22. package/scripts/builtin/project_commands.mjs +49 -0
  23. package/scripts/builtin/recent_changes.mjs +14 -0
  24. package/scripts/builtin/repo_map.mjs +65 -0
  25. package/scripts/builtin/run_changed_tests.mjs +48 -0
  26. package/src/delivery/transport.ts +1 -1
  27. package/src/desk/client-extension.ts +1 -31
  28. package/src/desk/ipc.ts +1 -11
  29. package/src/desk/session.ts +4 -101
  30. package/src/execution/agent-runner.ts +50 -8
  31. package/src/execution/assigned-session.ts +263 -0
  32. package/src/execution/assignment-discovery.ts +128 -0
  33. package/src/execution/assignment-policy.ts +46 -0
  34. package/src/execution/assignment.ts +175 -0
  35. package/src/execution/delegation.ts +9 -94
  36. package/src/execution/pi-runner.ts +99 -9
  37. package/src/harness/instructions.ts +1 -1
  38. package/src/index.ts +3 -0
  39. package/src/knowledge/design-record.ts +394 -0
  40. package/src/knowledge/file-notes.ts +36 -8
  41. package/src/lobby/ask.ts +6 -0
  42. package/src/lobby/exec.ts +28 -0
  43. package/src/lobby/host.ts +2 -11
  44. package/src/lobby/pi-commands.ts +83 -0
  45. package/src/lobby/planner.ts +50 -124
  46. package/src/lobby/prompts.ts +1 -7
  47. package/src/lobby/runtime.ts +2 -26
  48. package/src/lobby/service.ts +28 -27
  49. package/src/lobby/topics.ts +0 -2
  50. package/src/master/evidence-freshness.ts +96 -0
  51. package/src/master/master.ts +248 -74
  52. package/src/master/scout-cache.ts +1 -1
  53. package/src/master/scout-lock.ts +44 -0
  54. package/src/master/scout-prefetch.ts +78 -0
  55. package/src/pi/activity.ts +2 -0
  56. package/src/pi/assignment-guard.ts +157 -0
  57. package/src/pi/delegation.ts +2 -21
  58. package/src/pi/model-support.ts +0 -6
  59. package/src/pi/start-task.ts +18 -7
  60. package/src/pi/tools.ts +41 -8
  61. package/src/roles/scout.ts +3 -1
  62. package/src/roles/worker.ts +107 -5
  63. package/src/schemas/configuration.ts +11 -45
  64. package/src/schemas/findings.ts +3 -0
  65. package/src/schemas/task.ts +30 -12
  66. package/src/scripts/library.ts +31 -1
  67. package/src/scripts/pick.ts +31 -15
  68. package/src/state/archive.ts +10 -0
  69. package/src/state/checkpoint.ts +0 -1
  70. package/src/state/gitignore.ts +39 -0
  71. package/src/state/persistence.ts +56 -0
  72. package/src/state/recovery.ts +33 -1
  73. package/src/webui/api/index.ts +6 -35
  74. package/src/webui/api/retention.ts +44 -0
  75. package/src/webui/api/status.ts +5 -6
  76. package/src/webui/dev/fake-service.ts +8 -117
  77. package/src/webui/dev/fixtures.ts +2 -16
  78. package/src/webui/protocol.ts +3 -142
  79. package/src/workflow/draft-assignments.ts +118 -0
  80. package/src/workflow/workflow.ts +271 -214
  81. package/webui/dist/assets/{CodeSurface-BtzJOVyH.js → CodeSurface-CdyiJTYa.js} +1 -1
  82. package/webui/dist/assets/{TerminalView-Cz-KNWsq.js → TerminalView-D2nbR2J1.js} +1 -1
  83. package/webui/dist/assets/index-BTyu99rI.css +2 -0
  84. package/webui/dist/assets/index-BUGK22Z6.js +112 -0
  85. package/webui/dist/build.json +32 -68
  86. package/webui/dist/index.html +2 -2
  87. package/prompts/expert.md +0 -17
  88. package/prompts/goal-check.md +0 -44
  89. package/prompts/pr-review.md +0 -62
  90. package/prompts/splitter.md +0 -58
  91. package/src/execution/worker-trees.ts +0 -396
  92. package/src/lobby/issues.ts +0 -219
  93. package/src/lobby/pr-review.ts +0 -366
  94. package/src/lobby/pulls.ts +0 -250
  95. package/src/lobby/split.ts +0 -262
  96. package/src/master/goal-check.ts +0 -115
  97. package/src/webui/api/gh-error.ts +0 -17
  98. package/src/webui/api/git.ts +0 -98
  99. package/src/webui/api/issues.ts +0 -50
  100. package/webui/dist/assets/index-D5fvY8f8.js +0 -112
  101. package/webui/dist/assets/index-DFvk8ADr.css +0 -2
@@ -1,112 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/TerminalView-Cz-KNWsq.js","assets/rolldown-runtime-hePW80VL.js","assets/ccount-DQxSH8e6.js","assets/TerminalView-BrP-ENHg.css","assets/CodeSurface-BtzJOVyH.js"])))=>i.map(i=>d[i]);
2
- import{n as e,r as t,t as n}from"./rolldown-runtime-hePW80VL.js";import{a as r,c as i,i as a,l as o,n as s,o as c,r as l,s as u,t as d}from"./ccount-DQxSH8e6.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var f=document.querySelector(`meta[property="csp-nonce"]`),p=f?.nonce||f?.content;p&&(window.__webpack_nonce__=p);var m=t(o(),1),h,g=new Set;function _(){for(let e of[...g])e()}typeof window<`u`&&(window.addEventListener(`beforeinstallprompt`,e=>{e.preventDefault(),h=e,_()}),window.addEventListener(`appinstalled`,()=>{h=void 0,_()}));function v(e){return g.add(e),()=>{g.delete(e)}}function y(){return{available:(0,m.useSyncExternalStore)(v,()=>h!==void 0,()=>!1),install:async()=>{let e=h;e&&(await e.prompt().catch(()=>void 0),await e.userChoice?.catch(()=>void 0),h=void 0,_())}}}function b(){let e=`(display-mode: fullscreen), (display-mode: standalone), (display-mode: minimal-ui)`,[t,n]=(0,m.useState)(()=>typeof window<`u`&&window.matchMedia(e).matches);return(0,m.useEffect)(()=>{let t=window.matchMedia(e),r=()=>n(t.matches);return t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[]),t}function x(){let e=typeof document<`u`&&typeof document.documentElement.requestFullscreen==`function`,[t,n]=(0,m.useState)(()=>typeof document<`u`&&document.fullscreenElement!==null);return(0,m.useEffect)(()=>{let e=()=>n(document.fullscreenElement!==null);return document.addEventListener(`fullscreenchange`,e),()=>document.removeEventListener(`fullscreenchange`,e)},[]),{supported:e,on:t,toggle:async()=>{document.fullscreenElement?await document.exitFullscreen().catch(()=>void 0):await document.documentElement.requestFullscreen().catch(()=>void 0)}}}var S=[`background`,`foreground`,`card`,`card-foreground`,`popover`,`popover-foreground`,`primary`,`primary-foreground`,`secondary`,`secondary-foreground`,`muted`,`muted-foreground`,`accent`,`accent-foreground`,`destructive`,`border`,`input`,`ring`,`chart-1`,`chart-2`,`chart-3`,`chart-4`,`chart-5`],C=[`font-sans`,`font-mono`],w=new Set([...S,...C]),T=/^[\w\s#%.,()/+*'"-]{1,300}$/,E=/url\s*\(|expression|import|javascript|\\|<|>/i;function D(e){let t=e.replace(/!important/gi,``).trim();if(t&&T.test(t)&&!E.test(t))return t}function O(e,t,n){let r=e.replace(/^--/,``).toLowerCase();if(!w.has(r))return;let i=D(t);i&&(n[r]=i)}function k(e){let t={};for(let n of e.matchAll(/--([a-z0-9-]+)\s*:\s*([^;}]+)/gi))O(n[1],n[2],t);return t}function A(e){if(!e||typeof e!=`object`)return;let t={};for(let[n,r]of Object.entries(e))typeof r==`string`&&O(n,r,t);return Object.keys(t).length>0?t:void 0}function ee(e){let t=e.trim();if(!t)return{error:`Paste a theme first.`};if(t.length>2e5)return{error:`That file is too large to be a theme.`};let n={},r={},i;if(t.startsWith(`{`)){let e;try{e=JSON.parse(t)}catch{return{error:`That is not valid JSON or CSS.`}}let a=e,o=a.cssVars;if(!o||typeof o!=`object`)return{error:`That JSON has no cssVars. Copy the theme's CSS from tweakcn instead.`};let s=e=>{let t={};for(let[n,r]of Object.entries(e??{}))typeof r==`string`&&O(n,r,t);return t};n={...s(o.theme),...s(o.light)},r={...s(o.theme),...s(o.dark)},i=typeof a.title==`string`?a.title:typeof a.name==`string`?a.name:void 0}else for(let e of t.matchAll(/(?<=^|[}\s])((?::root|html|\.dark|:root\.dark|html\.dark)(?:\s*,\s*[^{]+)?)\s*\{([^}]*)\}/g)){let t=e[1].trim(),i=k(e[2]);/\.dark/.test(t)?r={...r,...i}:n={...n,...i}}let a=e=>Object.keys(e).filter(e=>S.includes(e)).length;return a(n)<5&&a(r)<5?{error:`No theme colours found. Copy the code from tweakcn's Code panel (the :root and .dark blocks).`}:{...a(n)>=5?{light:n}:{},...a(r)>=5?{dark:r}:{},...i?{name:i}:{}}}var j={"glass-border":`var(--border)`,typing:`var(--ring)`,"tab-active":`color-mix(in oklab, var(--primary) 14%, var(--background))`,you:`color-mix(in oklab, var(--primary) 9%, var(--card))`,heading:`var(--foreground)`,link:`var(--primary)`,bullet:`var(--primary)`},M=`"Inter Variable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif`,N=`ui-monospace, "JetBrains Mono", "Cascadia Mono", "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace`;function P(e,t){let n=[];for(let[e,r]of Object.entries(t))e===`font-sans`?n.push(`--app-font-sans:${r},${M};`):e===`font-mono`?n.push(`--app-font-mono:${r},${N};`):n.push(`--${e}:${r};`);for(let[e,r]of Object.entries(j))e in t||n.push(`--${e}:${r};`);return`${e}{${n.join(``)}}`}function F(e){let t=[];return e.light&&t.push(P(`:root`,e.light)),e.dark&&t.push(P(`.dark`,e.dark)),t.join(`
3
- `)}var te=`mist`,ne=[{id:te,name:`Default`},{id:`blossom`,name:`Blossom`,light:{background:`oklch(0.982446 0.010114 325.653)`,foreground:`oklch(0.325698 0.116116 325.037)`,card:`oklch(0.971835 0.012884 321.894)`,"card-foreground":`oklch(0.325698 0.116116 325.037)`,popover:`oklch(1 0 0)`,"popover-foreground":`oklch(0.325698 0.116116 325.037)`,primary:`oklch(0.591646 0.217985 0.584)`,"primary-foreground":`oklch(1 0 0)`,secondary:`oklch(0.869588 0.06751 334.899)`,"secondary-foreground":`oklch(0.444777 0.134061 324.799)`,muted:`oklch(0.802407 0.090963 345.892)`,"muted-foreground":`oklch(0.428932 0.163929 354.332)`,accent:`oklch(0.939552 0.024286 321.664)`,"accent-foreground":`oklch(0.396296 0.025134 285.196)`,destructive:`oklch(0.627117 0.248974 7.734)`,border:`oklch(0.923531 0.021247 328.096)`,input:`oklch(0.851713 0.055822 336.6)`,ring:`oklch(0.591646 0.217985 0.584)`,"chart-1":`oklch(0.591646 0.217985 0.584)`},dark:{background:`oklch(0.22813 0.020366 307.469)`,foreground:`oklch(0.980735 0.004092 301.426)`,card:`oklch(0.267101 0.02016 311.799)`,"card-foreground":`oklch(0.980735 0.004092 301.426)`,popover:`oklch(0.154761 0.01316 338.901)`,"popover-foreground":`oklch(0.980735 0.004092 301.426)`,primary:`oklch(0.460685 0.185347 4.099)`,"primary-foreground":`oklch(0.901233 0.057189 343.694)`,secondary:`oklch(0.313674 0.030572 310.061)`,"secondary-foreground":`oklch(0.848252 0.038248 307.961)`,muted:`oklch(0.360924 0.021469 316.83)`,"muted-foreground":`oklch(0.880303 0.03077 342.696)`,accent:`oklch(0.364912 0.050794 308.491)`,"accent-foreground":`oklch(0.964695 0.009139 341.803)`,destructive:`oklch(0.458704 0.169677 3.815)`,border:`oklch(0.266943 0.015262 302.425)`,input:`oklch(0.266817 0.02897 344.461)`,ring:`oklch(0.591646 0.217985 0.584)`,"chart-1":`oklch(0.460685 0.185347 4.099)`}},{id:`grove`,name:`Grove`,light:{background:`oklch(0.972369 0.005497 157.15)`,foreground:`oklch(0.222003 0.03479 328.979)`,card:`oklch(0.972369 0.005497 157.15)`,"card-foreground":`oklch(0.222003 0.03479 328.979)`,popover:`oklch(0.932695 0.003778 160.944)`,"popover-foreground":`oklch(0.222003 0.03479 328.979)`,primary:`oklch(0.523295 0.112292 158.089)`,"primary-foreground":`oklch(0.990339 0.008411 325.64)`,secondary:`oklch(0.936464 0.014601 163.554)`,"secondary-foreground":`oklch(0.222003 0.03479 328.979)`,muted:`oklch(0.945455 0.012308 162.879)`,"muted-foreground":`oklch(0.527266 0.012309 320.683)`,accent:`oklch(0.909438 0.021521 164.612)`,"accent-foreground":`oklch(0.222003 0.03479 328.979)`,destructive:`oklch(0.637823 0.237287 25.436)`,border:`oklch(0.864831 0.01312 167.255)`,input:`oklch(0.829746 0.016084 168.234)`,ring:`oklch(0.523295 0.112292 158.089)`,"chart-1":`oklch(0.523295 0.112292 158.089)`},dark:{background:`oklch(0.260865 0.02152 162.75)`,foreground:`oklch(0.990339 0.008411 325.64)`,card:`oklch(0.260865 0.02152 162.75)`,"card-foreground":`oklch(0.990339 0.008411 325.64)`,popover:`oklch(0.411828 0.014378 166.627)`,"popover-foreground":`oklch(0.990339 0.008411 325.64)`,primary:`oklch(0.796228 0.133058 157.319)`,"primary-foreground":`oklch(0.222003 0.03479 328.979)`,secondary:`oklch(0.380487 0.048313 159.608)`,"secondary-foreground":`oklch(0.990339 0.008411 325.64)`,muted:`oklch(0.339728 0.039456 160.274)`,"muted-foreground":`oklch(0.715427 0.010896 171.428)`,accent:`oklch(0.437021 0.060312 158.962)`,"accent-foreground":`oklch(0.990339 0.008411 325.64)`,destructive:`oklch(0.655108 0.221148 23.473)`,border:`oklch(0.457475 0.044046 160.971)`,input:`oklch(0.519849 0.049896 160.863)`,ring:`oklch(0.796228 0.133058 157.319)`,"chart-1":`oklch(0.796228 0.133058 157.319)`}},{id:`ocean`,name:`Ocean`,light:{background:`oklch(0.974199 0.002856 241.597)`,foreground:`oklch(0.222003 0.03479 328.979)`,card:`oklch(0.974199 0.002856 241.597)`,"card-foreground":`oklch(0.222003 0.03479 328.979)`,popover:`oklch(0.934442 0.003181 269.1)`,"popover-foreground":`oklch(0.222003 0.03479 328.979)`,primary:`oklch(0.536684 0.120219 247.01)`,"primary-foreground":`oklch(0.990339 0.008411 325.64)`,secondary:`oklch(0.939254 0.01193 241.729)`,"secondary-foreground":`oklch(0.222003 0.03479 328.979)`,muted:`oklch(0.948004 0.009649 241.695)`,"muted-foreground":`oklch(0.528741 0.01828 313.823)`,accent:`oklch(0.91295 0.018827 241.836)`,"accent-foreground":`oklch(0.222003 0.03479 328.979)`,destructive:`oklch(0.637823 0.237287 25.436)`,border:`oklch(0.867646 0.013482 252.362)`,input:`oklch(0.832939 0.017389 252.598)`,ring:`oklch(0.536684 0.120219 247.01)`,"chart-1":`oklch(0.536684 0.120219 247.01)`},dark:{background:`oklch(0.242641 0.024125 250.573)`,foreground:`oklch(0.990339 0.008411 325.64)`,card:`oklch(0.242641 0.024125 250.573)`,"card-foreground":`oklch(0.990339 0.008411 325.64)`,popover:`oklch(0.398517 0.018232 255.72)`,"popover-foreground":`oklch(0.990339 0.008411 325.64)`,primary:`oklch(0.758933 0.105833 241.548)`,"primary-foreground":`oklch(0.222003 0.03479 328.979)`,secondary:`oklch(0.358725 0.043145 244.911)`,"secondary-foreground":`oklch(0.990339 0.008411 325.64)`,muted:`oklch(0.319287 0.036766 246.065)`,"muted-foreground":`oklch(0.691936 0.016294 261.588)`,accent:`oklch(0.413315 0.051874 243.855)`,"accent-foreground":`oklch(0.990339 0.008411 325.64)`,destructive:`oklch(0.655108 0.221148 23.473)`,border:`oklch(0.438653 0.039496 245.44)`,input:`oklch(0.500905 0.043574 244.781)`,ring:`oklch(0.758933 0.105833 241.548)`,"chart-1":`oklch(0.758933 0.105833 241.548)`}},{id:`ember`,name:`Ember`,light:{background:`oklch(0.976527 0.002685 60.725)`,foreground:`oklch(0.222003 0.03479 328.979)`,card:`oklch(0.976527 0.002685 60.725)`,"card-foreground":`oklch(0.222003 0.03479 328.979)`,popover:`oklch(0.936659 0.002879 29.96)`,"popover-foreground":`oklch(0.222003 0.03479 328.979)`,primary:`oklch(0.552831 0.129438 44.656)`,"primary-foreground":`oklch(0.990339 0.008411 325.64)`,secondary:`oklch(0.942267 0.01151 50.785)`,"secondary-foreground":`oklch(0.222003 0.03479 328.979)`,muted:`oklch(0.950842 0.009273 51.528)`,"muted-foreground":`oklch(0.530413 0.018453 341.181)`,accent:`oklch(0.916502 0.01832 49.597)`,"accent-foreground":`oklch(0.222003 0.03479 328.979)`,destructive:`oklch(0.637823 0.237287 25.436)`,border:`oklch(0.870631 0.013204 39.431)`,input:`oklch(0.836213 0.017153 38.661)`,ring:`oklch(0.552831 0.129438 44.656)`,"chart-1":`oklch(0.552831 0.129438 44.656)`},dark:{background:`oklch(0.245899 0.019144 42.044)`,foreground:`oklch(0.990339 0.008411 325.64)`,card:`oklch(0.245899 0.019144 42.044)`,"card-foreground":`oklch(0.990339 0.008411 325.64)`,popover:`oklch(0.401111 0.014308 34.896)`,"popover-foreground":`oklch(0.990339 0.008411 325.64)`,primary:`oklch(0.762174 0.124117 52.082)`,"primary-foreground":`oklch(0.222003 0.03479 328.979)`,secondary:`oklch(0.361499 0.044052 49.515)`,"secondary-foreground":`oklch(0.990339 0.008411 325.64)`,muted:`oklch(0.322144 0.03574 48.309)`,"muted-foreground":`oklch(0.692479 0.015227 30.963)`,accent:`oklch(0.416048 0.055354 50.484)`,"accent-foreground":`oklch(0.990339 0.008411 325.64)`,destructive:`oklch(0.655108 0.221148 23.473)`,border:`oklch(0.44099 0.040202 48.807)`,input:`oklch(0.503003 0.045721 49.44)`,ring:`oklch(0.762174 0.124117 52.082)`,"chart-1":`oklch(0.762174 0.124117 52.082)`}},{id:`iris`,name:`Iris`,light:{background:`oklch(0.976531 0.003855 303.226)`,foreground:`oklch(0.222003 0.03479 328.979)`,card:`oklch(0.976531 0.003855 303.226)`,"card-foreground":`oklch(0.222003 0.03479 328.979)`,popover:`oklch(0.936665 0.005041 310.132)`,"popover-foreground":`oklch(0.222003 0.03479 328.979)`,primary:`oklch(0.525348 0.15373 294.176)`,"primary-foreground":`oklch(0.990339 0.008411 325.64)`,secondary:`oklch(0.941387 0.014687 300.474)`,"secondary-foreground":`oklch(0.222003 0.03479 328.979)`,muted:`oklch(0.950194 0.011956 300.733)`,"muted-foreground":`oklch(0.529955 0.022319 321.556)`,accent:`oklch(0.914882 0.022965 299.986)`,"accent-foreground":`oklch(0.222003 0.03479 328.979)`,destructive:`oklch(0.637823 0.237287 25.436)`,border:`oklch(0.869608 0.018226 303.859)`,input:`oklch(0.834773 0.023405 303.676)`,ring:`oklch(0.525348 0.15373 294.176)`,"chart-1":`oklch(0.525348 0.15373 294.176)`},dark:{background:`oklch(0.225975 0.031062 293.741)`,foreground:`oklch(0.990339 0.008411 325.64)`,card:`oklch(0.225975 0.031062 293.741)`,"card-foreground":`oklch(0.990339 0.008411 325.64)`,popover:`oklch(0.386739 0.024023 297.509)`,"popover-foreground":`oklch(0.990339 0.008411 325.64)`,primary:`oklch(0.671712 0.169136 293.929)`,"primary-foreground":`oklch(0.222003 0.03479 328.979)`,secondary:`oklch(0.325405 0.063614 294.23)`,"secondary-foreground":`oklch(0.990339 0.008411 325.64)`,muted:`oklch(0.291515 0.05276 294.209)`,"muted-foreground":`oklch(0.663321 0.025932 301.862)`,accent:`oklch(0.372436 0.07841 294.204)`,"accent-foreground":`oklch(0.990339 0.008411 325.64)`,destructive:`oklch(0.655108 0.221148 23.473)`,border:`oklch(0.40874 0.058536 295.893)`,input:`oklch(0.46756 0.065775 296.265)`,ring:`oklch(0.671712 0.169136 293.929)`,"chart-1":`oklch(0.671712 0.169136 293.929)`}},{id:`slate`,name:`Slate`,light:{background:`#f5f7fa`,foreground:`#202b3b`,card:`#ffffff`,"card-foreground":`#202b3b`,popover:`#ffffff`,"popover-foreground":`#202b3b`,primary:`#465b78`,"primary-foreground":`#ffffff`,secondary:`#e7ecf2`,"secondary-foreground":`#202b3b`,muted:`#edf1f6`,"muted-foreground":`#526177`,accent:`#e0e7ef`,"accent-foreground":`#202b3b`,destructive:`#a52a34`,border:`#cad3df`,input:`#b9c5d4`,ring:`#465b78`,"chart-1":`#465b78`},dark:{background:`#141b26`,foreground:`#e8edf5`,card:`#1c2533`,"card-foreground":`#e8edf5`,popover:`#202b3b`,"popover-foreground":`#e8edf5`,primary:`#adc0dc`,"primary-foreground":`#141b26`,secondary:`#2a3648`,"secondary-foreground":`#e8edf5`,muted:`#243043`,"muted-foreground":`#afbdd0`,accent:`#33445d`,"accent-foreground":`#e8edf5`,destructive:`#fb8990`,border:`#43536a`,input:`#53647d`,ring:`#adc0dc`,"chart-1":`#adc0dc`}},{id:`sand`,name:`Sand`,light:{background:`#faf7f1`,foreground:`#352b22`,card:`#fffdf8`,"card-foreground":`#352b22`,popover:`#fffdf8`,"popover-foreground":`#352b22`,primary:`#765536`,"primary-foreground":`#ffffff`,secondary:`#eee6da`,"secondary-foreground":`#352b22`,muted:`#f2ece2`,"muted-foreground":`#6c5b49`,accent:`#e9ddcb`,"accent-foreground":`#352b22`,destructive:`#a52a34`,border:`#d9cbb8`,input:`#c9b79e`,ring:`#765536`,"chart-1":`#765536`},dark:{background:`#211c17`,foreground:`#f4ece0`,card:`#2c251e`,"card-foreground":`#f4ece0`,popover:`#352c23`,"popover-foreground":`#f4ece0`,primary:`#dcbc92`,"primary-foreground":`#211c17`,secondary:`#3c3227`,"secondary-foreground":`#f4ece0`,muted:`#352d24`,"muted-foreground":`#c9b9a5`,accent:`#4a3b2b`,"accent-foreground":`#f4ece0`,destructive:`#fb8990`,border:`#64503e`,input:`#79614b`,ring:`#dcbc92`,"chart-1":`#dcbc92`}},{id:`rosewood`,name:`Rosewood`,light:{background:`#fbf6f5`,foreground:`#3b262c`,card:`#fffafa`,"card-foreground":`#3b262c`,popover:`#fffafa`,"popover-foreground":`#3b262c`,primary:`#854252`,"primary-foreground":`#ffffff`,secondary:`#f0e2e5`,"secondary-foreground":`#3b262c`,muted:`#f5eaec`,"muted-foreground":`#76525d`,accent:`#edd6dd`,"accent-foreground":`#3b262c`,destructive:`#a52a34`,border:`#dfc5cc`,input:`#d0afb9`,ring:`#854252`,"chart-1":`#854252`},dark:{background:`#241a20`,foreground:`#f6e8ed`,card:`#30222a`,"card-foreground":`#f6e8ed`,popover:`#3a2932`,"popover-foreground":`#f6e8ed`,primary:`#e3a5b7`,"primary-foreground":`#241a20`,secondary:`#442e38`,"secondary-foreground":`#f6e8ed`,muted:`#3a2932`,"muted-foreground":`#d2b4c0`,accent:`#553441`,"accent-foreground":`#f6e8ed`,destructive:`#fb8990`,border:`#70505d`,input:`#856170`,ring:`#e3a5b7`,"chart-1":`#e3a5b7`}},{id:`aurora`,name:`Aurora`,light:{background:`#f2faf8`,foreground:`#193a37`,card:`#fafffe`,"card-foreground":`#193a37`,popover:`#fafffe`,"popover-foreground":`#193a37`,primary:`#216c63`,"primary-foreground":`#ffffff`,secondary:`#def0eb`,"secondary-foreground":`#193a37`,muted:`#e6f2ef`,"muted-foreground":`#456c66`,accent:`#eee5f6`,"accent-foreground":`#193a37`,destructive:`#a52a34`,border:`#bbd7d1`,input:`#a7c8c0`,ring:`#216c63`,"chart-1":`#216c63`},dark:{background:`#142321`,foreground:`#e1f5ef`,card:`#1d302d`,"card-foreground":`#e1f5ef`,popover:`#253d38`,"popover-foreground":`#e1f5ef`,primary:`#87d5c1`,"primary-foreground":`#142321`,secondary:`#29443e`,"secondary-foreground":`#e1f5ef`,muted:`#243c36`,"muted-foreground":`#a9cfc3`,accent:`#3d3352`,"accent-foreground":`#e1f5ef`,destructive:`#fb8990`,border:`#466b60`,input:`#568172`,ring:`#87d5c1`,"chart-1":`#87d5c1`}},{id:`midnight`,name:`Midnight`,light:{background:`#f5f6fb`,foreground:`#282e48`,card:`#fcfcff`,"card-foreground":`#282e48`,popover:`#fcfcff`,"popover-foreground":`#282e48`,primary:`#4f5f96`,"primary-foreground":`#ffffff`,secondary:`#e5e8f4`,"secondary-foreground":`#282e48`,muted:`#eceef7`,"muted-foreground":`#565f7d`,accent:`#dfe4f6`,"accent-foreground":`#282e48`,destructive:`#a52a34`,border:`#c7cee5`,input:`#b4bfdc`,ring:`#4f5f96`,"chart-1":`#4f5f96`},dark:{background:`#151a2b`,foreground:`#e8ecfa`,card:`#1f263b`,"card-foreground":`#e8ecfa`,popover:`#29314a`,"popover-foreground":`#e8ecfa`,primary:`#acbbed`,"primary-foreground":`#151a2b`,secondary:`#303954`,"secondary-foreground":`#e8ecfa`,muted:`#28314b`,"muted-foreground":`#b1bedf`,accent:`#3a466a`,"accent-foreground":`#e8ecfa`,destructive:`#fb8990`,border:`#48577d`,input:`#596990`,ring:`#acbbed`,"chart-1":`#acbbed`}},{id:`graphite`,name:`Graphite`,light:{background:`#fafafa`,foreground:`#222222`,card:`#fefefe`,"card-foreground":`#222222`,popover:`#fefefe`,"popover-foreground":`#222222`,primary:`#333333`,"primary-foreground":`#fcfcfc`,secondary:`#ebebeb`,"secondary-foreground":`#222222`,muted:`#f0f0f0`,"muted-foreground":`#5d5d5d`,accent:`#e8e8e8`,"accent-foreground":`#222222`,destructive:`#d02b31`,border:`#dedede`,input:`#cecece`,ring:`#333333`,"chart-1":`#333333`},dark:{background:`#121212`,foreground:`#eeeeee`,card:`#191919`,"card-foreground":`#eeeeee`,popover:`#202020`,"popover-foreground":`#eeeeee`,primary:`#e4e4e4`,"primary-foreground":`#121212`,secondary:`#292929`,"secondary-foreground":`#eeeeee`,muted:`#242424`,"muted-foreground":`#ababab`,accent:`#333333`,"accent-foreground":`#eeeeee`,destructive:`#f66c6d`,border:`#333333`,input:`#424242`,ring:`#e4e4e4`,"chart-1":`#e4e4e4`}},{id:`lagoon`,name:`Lagoon`,light:{background:`#f3fcfd`,foreground:`#0e2627`,card:`#fbffff`,"card-foreground":`#0e2627`,popover:`#fbffff`,"popover-foreground":`#0e2627`,primary:`#007780`,"primary-foreground":`#fcfcfc`,secondary:`#d5f2f3`,"secondary-foreground":`#0e2627`,muted:`#e3f4f5`,"muted-foreground":`#456466`,accent:`#c3f2f4`,"accent-foreground":`#0e2627`,destructive:`#d02b31`,border:`#cde3e4`,input:`#b8d4d5`,ring:`#007780`,"chart-1":`#007780`},dark:{background:`#041516`,foreground:`#e8f1f1`,card:`#091d1e`,"card-foreground":`#e8f1f1`,popover:`#102425`,"popover-foreground":`#e8f1f1`,primary:`#53c5cb`,"primary-foreground":`#041516`,secondary:`#162d2f`,"secondary-foreground":`#e8f1f1`,muted:`#152829`,"muted-foreground":`#9cafb0`,accent:`#0c3a3c`,"accent-foreground":`#e8f1f1`,destructive:`#f66c6d`,border:`#203839`,input:`#2f4749`,ring:`#53c5cb`,"chart-1":`#53c5cb`}},{id:`dune`,name:`Dune`,light:{background:`#fef9f3`,foreground:`#2b1f11`,card:`#fffefb`,"card-foreground":`#2b1f11`,popover:`#fffefb`,"popover-foreground":`#2b1f11`,primary:`#9d6300`,"primary-foreground":`#fcfcfc`,secondary:`#f9e8d6`,"secondary-foreground":`#2b1f11`,muted:`#f8eee4`,"muted-foreground":`#6b5a48`,accent:`#fde3c6`,"accent-foreground":`#2b1f11`,destructive:`#d02b31`,border:`#e9dccd`,input:`#dbcbb9`,ring:`#9d6300`,"chart-1":`#9d6300`},dark:{background:`#181006`,foreground:`#f3ede8`,card:`#21170c`,"card-foreground":`#f3ede8`,popover:`#291e12`,"popover-foreground":`#f3ede8`,primary:`#dba666`,"primary-foreground":`#181006`,secondary:`#322618`,"secondary-foreground":`#f3ede8`,muted:`#2c2217`,"muted-foreground":`#b4a99d`,accent:`#422e16`,"accent-foreground":`#f3ede8`,destructive:`#f66c6d`,border:`#3d3022`,input:`#4d4031`,ring:`#dba666`,"chart-1":`#dba666`}},{id:`plum`,name:`Plum`,light:{background:`#fef8ff`,foreground:`#291c2c`,card:`#fffdff`,"card-foreground":`#291c2c`,popover:`#fffdff`,"popover-foreground":`#291c2c`,primary:`#9553a4`,"primary-foreground":`#fcfcfc`,secondary:`#f6e4fa`,"secondary-foreground":`#291c2c`,muted:`#f7ecf9`,"muted-foreground":`#68566d`,accent:`#f9dcff`,"accent-foreground":`#291c2c`,destructive:`#d02b31`,border:`#e7d8ea`,input:`#d8c7dc`,ring:`#9553a4`,"chart-1":`#9553a4`},dark:{background:`#170d19`,foreground:`#f2ecf3`,card:`#201522`,"card-foreground":`#f2ecf3`,popover:`#271c2a`,"popover-foreground":`#f2ecf3`,primary:`#d398e0`,"primary-foreground":`#170d19`,secondary:`#312334`,"secondary-foreground":`#f2ecf3`,muted:`#2a202d`,"muted-foreground":`#b2a6b5`,accent:`#3f2945`,"accent-foreground":`#f2ecf3`,destructive:`#f66c6d`,border:`#3b2d3e`,input:`#4b3c4e`,ring:`#d398e0`,"chart-1":`#d398e0`}},{id:`moss`,name:`Moss`,light:{background:`#f8fcf6`,foreground:`#1c2517`,card:`#fdfffc`,"card-foreground":`#1c2517`,popover:`#fdfffc`,"popover-foreground":`#1c2517`,primary:`#4a7333`,"primary-foreground":`#fcfcfc`,secondary:`#e3f0dd`,"secondary-foreground":`#1c2517`,muted:`#ebf3e8`,"muted-foreground":`#56624f`,accent:`#dcefd2`,"accent-foreground":`#1c2517`,destructive:`#d02b31`,border:`#d8e2d3`,input:`#c6d2c0`,ring:`#4a7333`,"chart-1":`#4a7333`},dark:{background:`#0d140a`,foreground:`#ecf0ea`,card:`#151c11`,"card-foreground":`#ecf0ea`,popover:`#1b2317`,"popover-foreground":`#ecf0ea`,primary:`#97bf82`,"primary-foreground":`#0d140a`,secondary:`#232c1e`,"secondary-foreground":`#ecf0ea`,muted:`#1f271c`,"muted-foreground":`#a6aea1`,accent:`#293821`,"accent-foreground":`#ecf0ea`,destructive:`#f66c6d`,border:`#2d3628`,input:`#3c4637`,ring:`#97bf82`,"chart-1":`#97bf82`}},{id:`crimson`,name:`Crimson`,light:{background:`#fff7f6`,foreground:`#331919`,card:`#fffcfc`,"card-foreground":`#331919`,popover:`#fffcfc`,"popover-foreground":`#331919`,primary:`#c13a46`,"primary-foreground":`#fcfcfc`,secondary:`#ffe1df`,"secondary-foreground":`#331919`,muted:`#ffeae9`,"muted-foreground":`#785252`,accent:`#ffd7d5`,"accent-foreground":`#331919`,destructive:`#d02b31`,border:`#f4d6d5`,input:`#e9c3c2`,ring:`#c13a46`,"chart-1":`#c13a46`},dark:{background:`#1e0b0b`,foreground:`#f8ebeb`,card:`#281212`,"card-foreground":`#f8ebeb`,popover:`#301919`,"popover-foreground":`#f8ebeb`,primary:`#ff898b`,"primary-foreground":`#1e0b0b`,secondary:`#3b2020`,"secondary-foreground":`#f8ebeb`,muted:`#331d1d`,"muted-foreground":`#bea4a3`,accent:`#502324`,"accent-foreground":`#f8ebeb`,destructive:`#f66c6d`,border:`#462a2a`,input:`#573939`,ring:`#ff898b`,"chart-1":`#ff898b`}}],re={light:{background:`#fcfcfc`,card:`#ffffff`,primary:`#1b4ed8`,accent:`#f4f4f5`},dark:{background:`#0a0a0a`,card:`#111111`,primary:`#346bf1`,accent:`#141414`}};function ie(e,t){let n=t?e.dark:e.light,r=re[t?`dark`:`light`];return n?{background:n.background??r.background,card:n.card??r.card,primary:n.primary??r.primary,accent:n.primary?`color-mix(in oklab, ${n.primary} 18%, ${n.background??r.background})`:r.accent}:{...r}}var ae={activity:400,thoughts:40,chat:100};function oe(e,t,n){let r=e??[],i=new Set(r.map(e=>e.id)),a=t.filter(e=>typeof e?.id==`number`&&!i.has(e.id));return[...r,...a].slice(-n)}var se=class{records=new Map;listeners=new Set;reads=new Map;used=new Set;reader;currentStatus={connection:`connecting`,signedOut:!1};get(e){let t=this.records.get(e);if(t)return t;let n={version:0,data:void 0,loading:!1,error:void 0,stale:!1};return this.records.set(e,n),n}status(){return{...this.currentStatus}}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}markUsed(e,t){this.reader=t;let n=e.filter(e=>!this.used.has(e));this.used=new Set(e);for(let e of n)this.read(e)}onHello(e){for(let t of this.used){let n=e[t];n!==void 0&&(this.get(t).version=n),this.read(t)}}onChanged(e,t){let n=this.get(e);n.version=t,this.used.has(e)?this.read(e):n.stale=!0,this.notify()}onFeedDelta(e){let t=this.get(`lobby`).data;t&&(this.get(`lobby`).data={...t,activity:oe(t.activity,e.activity??[],ae.activity),thoughts:oe(t.thoughts,e.thoughts??[],ae.thoughts),chat:oe(t.chat,e.chat??[],ae.chat)},this.notify())}onReplyDelta(e){let t=this.get(`lobby`),n=t.data;n&&(t.data={...n,reply:e},this.notify())}onStatus(e){this.currentStatus={...this.currentStatus,...e},this.notify()}async read(e){let t=this.reader;if(!t)return;let n=(this.reads.get(e)??0)+1;this.reads.set(e,n);let r=this.get(e);r.loading=!0,r.error=void 0,this.notify();try{let i=await t(e);if(this.reads.get(e)!==n)return;this.apply(r,i)}catch(t){if(this.reads.get(e)!==n)return;r.loading=!1,r.error=t instanceof Error?t.message:String(t)}this.notify()}apply(e,t){e.data=t,e.loading=!1,e.stale=!1,e.error=void 0}notify(){for(let e of[...this.listeners])e()}};function ce(){return new se}var I=ce(),le=/^[a-f0-9]{32}$/;function ue(){return globalThis.location}function de(){let e=ue()?.search??``,t=new URLSearchParams(e).getAll(`project`);if(t.length){if(t.length!==1||!le.test(t[0]))throw Error(`Invalid project ID. Choose a running project below.`);return t[0]}}function L(e){if(!e.startsWith(`/api/`)&&!e.startsWith(`/files/preview/`))return e;let t=de();return t?`/projects/${t}${e}`:e}function R(e,t){if(!le.test(e))throw Error(`Invalid project ID.`);let n=ue();if(!n)throw Error(`Project switching requires a browser.`);let r=new URL(n.origin);r.pathname=n.pathname,r.searchParams.set(`project`,e),r.hash=`/${t}`,n.assign(r.href)}var fe=`bot-lobby.projectFolders`,pe=new Map;function me(){try{return globalThis.sessionStorage}catch{return}}function he(){try{let e=JSON.parse(me()?.getItem(fe)??`{}`);for(let[t,n]of Object.entries(e))le.test(t)&&typeof n==`string`&&pe.set(t,n)}catch{}}function ge(e){he();for(let t of e)le.test(t.id)&&pe.set(t.id,t.cwd);try{me()?.setItem(fe,JSON.stringify(Object.fromEntries([...pe].slice(-64))))}catch{}}function _e(e){return pe.has(e)||he(),pe.get(e)}async function ve(e){let t;try{t=de()}catch{return!1}if(!t)return!1;let n=_e(t);if(!n)return!1;let{projects:r}=await e();if(ge(r),r.some(e=>e.id===t))return!1;let i=r.find(e=>e.cwd===n),a=ue(),o=globalThis.history;if(!i||!a||!o)return!1;let s=new URL(a.origin);return s.pathname=a.pathname,s.search=a.search,s.searchParams.set(`project`,i.id),s.hash=globalThis.location?.hash??``,o.replaceState(null,``,s.href),!0}var ye=class extends Error{code;status;constructor(e,t,n){super(e),this.name=`ApiError`,this.code=t,this.status=n}},be={"Content-Type":`application/json`};async function z(e,t={}){let n=await fetch(e===`auth.login`||e.startsWith(`projects.`)?`/api/${e}`:L(`/api/${e}`),{method:`POST`,headers:be,body:JSON.stringify(t),credentials:`same-origin`}),r=await n.json().catch(()=>void 0);if(!r)throw new ye(`the lobby answered ${n.status}`,`failed`,n.status);if(!r.ok)throw r.code===`unauthorized`&&I.onStatus({signedOut:!0}),new ye(r.error,r.code,n.status);return r.result}function xe(){return globalThis.location}async function Se(){let e=xe(),t=e?new URLSearchParams(e.hash.replace(/^#/,``)).get(`token`):null;if(!t||!(await fetch(`/api/auth.login`,{method:`POST`,headers:be,body:JSON.stringify({token:t}),credentials:`same-origin`}).catch(()=>void 0))?.ok)return!1;let n=globalThis.history;return n&&n.replaceState(null,``,e.pathname+e.search),I.onStatus({signedOut:!1}),!0}var Ce=`bot-lobby.palette`,we=`bot-lobby-palette`,Te=`custom`,Ee=new Set,De=ke();function Oe(e){let t=e;if(!t||typeof t.id!=`string`||typeof t.name!=`string`)return;let n=A(t.light),r=A(t.dark);if(n||r)return{id:t.id,name:t.name.slice(0,40),...n?{light:n}:{},...r?{dark:r}:{}}}function ke(){try{let e=localStorage.getItem(Ce);if(!e)return{id:te,saved:[]};let t=JSON.parse(e),n=(t.saved??[]).map(Oe).filter(e=>!!e),r=Oe(t.legacy??(t.custom?{...t.custom,id:Te}:void 0)),i=new Set([...ne.map(e=>e.id),...n.map(e=>e.id),...r?[Te]:[]]);return{id:t.id&&i.has(t.id)?t.id:te,saved:n,...r?{legacy:r}:{}}}catch{return{id:te,saved:[]}}}function Ae(e){return[...ne,...e.saved,...e.legacy?[e.legacy]:[]]}function je(e){return Ae(e).find(t=>t.id===e.id)??ne[0]}function Me(){if(typeof document>`u`)return;let e=F(je(De)),t=document.getElementById(we);if(!e){t?.remove();return}t||(t=document.createElement(`style`),t.id=we,document.head.appendChild(t)),t.textContent=e}function Ne(e){De=e;try{localStorage.setItem(Ce,JSON.stringify(e))}catch{}Me();for(let e of[...Ee])e()}function Pe(e){let t=e.themes.map(e=>Oe(e)).filter(e=>!!e),{legacy:n}=De;Ne({id:e.active??(De.id===Te&&n?Te:`mist`),saved:t,...n?{legacy:n}:{}})}var Fe;function Ie(e=!1){return Fe&&!e||(Fe=(async()=>{let e=await z(`themes.get`,{}),t=De.legacy;if(t){let n=e.active??(De.id===Te?void 0:De.id);e=await z(`themes.save`,{name:t.name,...t.light?{light:t.light}:{},...t.dark?{dark:t.dark}:{}}),n&&(e=await z(`themes.choose`,{id:n}));let{legacy:r,...i}=De;De=i}Pe(e)})().catch(()=>{Fe=void 0})),Fe}typeof window<`u`&&(Me(),window.addEventListener(`storage`,e=>{if(e.key===Ce){De=ke(),Me();for(let e of[...Ee])e()}}),window.addEventListener(`focus`,()=>void Ie(!0)));function Le(e){return Ee.add(e),()=>{Ee.delete(e)}}function Re(){let e=(0,m.useSyncExternalStore)(Le,()=>De,()=>De),t=(0,m.useCallback)(e=>{Ne({...De,id:e}),e!==Te&&z(`themes.choose`,{id:e}).then(Pe,()=>{})},[]),n=(0,m.useCallback)(async(e,t)=>(Pe(await z(`themes.save`,{name:t,...e.light?{light:e.light}:{},...e.dark?{dark:e.dark}:{}})),je(De)),[]),r=(0,m.useCallback)(async(e,t)=>Pe(await z(`themes.rename`,{id:e,name:t})),[]),i=(0,m.useCallback)(async e=>Pe(await z(`themes.remove`,{id:e})),[]),a=e.legacy?[...e.saved,e.legacy]:e.saved;return{active:je(e),saved:a,all:Ae(e),isSaved:e=>a.some(t=>t.id===e),choose:t,adopt:n,rename:r,remove:i}}var ze=[{id:`theme`,label:`System`,help:`The system's own (or the colour theme's)`},{id:`inter`,label:`Inter`,help:`Neutral and very legible`},{id:`geist`,label:`Geist`,help:`Crisp and modern`},{id:`plex`,label:`IBM Plex Sans`,help:`Technical, with character`},{id:`manrope`,label:`Manrope`,help:`Round and friendly`},{id:`dm-sans`,label:`DM Sans`,help:`Geometric, low contrast`},{id:`jakarta`,label:`Plus Jakarta Sans`,help:`Polished product sans`},{id:`figtree`,label:`Figtree`,help:`Clean and approachable`},{id:`outfit`,label:`Outfit`,help:`Geometric display feel`},{id:`nunito`,label:`Nunito`,help:`Soft rounded terminals`},{id:`space-grotesk`,label:`Space Grotesk`,help:`Quirky, technical`},{id:`source-sans`,label:`Source Sans 3`,help:`Classic UI workhorse`}],Be=[{id:`theme`,label:`System mono`,help:`The system's own (or the colour theme's)`},{id:`jetbrains`,label:`JetBrains Mono`,help:`Tall, made for code`},{id:`geist-mono`,label:`Geist Mono`,help:`Pairs with Geist`},{id:`fira-code`,label:`Fira Code`,help:`Ligatures for operators`},{id:`roboto-mono`,label:`Roboto Mono`,help:`Even and compact`},{id:`source-code`,label:`Source Code Pro`,help:`Open and readable`}],Ve={font:`bot-lobby.typeface`,mono:`bot-lobby.typeface-code`},He={font:ze,mono:Be},Ue={font:`theme`,mono:`theme`},We=new Set;function Ge(e){let t=null;try{t=localStorage.getItem(Ve[e])}catch{t=Ue[e]}return He[e].some(e=>e.id===t)?t:`theme`}function Ke(e,t){let n=document.documentElement;t===`theme`?delete n.dataset[e]:n.dataset[e]=t}function qe(e,t){Ue[e]=t;try{localStorage.setItem(Ve[e],t)}catch{}Ke(e,t);for(let e of We)e()}function Je(e){return We.add(e),()=>We.delete(e)}function Ye(e){return(0,m.useSyncExternalStore)(Je,()=>Ge(e),()=>`theme`)}typeof document<`u`&&(Ke(`font`,Ge(`font`)),Ke(`mono`,Ge(`mono`)));var Xe={inter:`"Inter Variable", system-ui, sans-serif`,geist:`"Geist Variable", system-ui, sans-serif`,plex:`"IBM Plex Sans Variable", system-ui, sans-serif`,manrope:`"Manrope Variable", system-ui, sans-serif`,jetbrains:`"JetBrains Mono Variable", ui-monospace, monospace`,"geist-mono":`"Geist Mono Variable", ui-monospace, monospace`,"dm-sans":`"DM Sans Variable", system-ui, sans-serif`,jakarta:`"Plus Jakarta Sans Variable", system-ui, sans-serif`,figtree:`"Figtree Variable", system-ui, sans-serif`,outfit:`"Outfit Variable", system-ui, sans-serif`,nunito:`"Nunito Variable", system-ui, sans-serif`,"space-grotesk":`"Space Grotesk Variable", system-ui, sans-serif`,"source-sans":`"Source Sans 3 Variable", system-ui, sans-serif`,"fira-code":`"Fira Code Variable", ui-monospace, monospace`,"roboto-mono":`"Roboto Mono Variable", ui-monospace, monospace`,"source-code":`"Source Code Pro Variable", ui-monospace, monospace`},Ze=(0,m.createContext)({});function Qe(e){let t=(0,m.useRef)(null);return t.current===null&&(t.current=e()),t.current}var $e=typeof window<`u`?m.useLayoutEffect:m.useEffect,et=(0,m.createContext)(null);function tt(e,t){e.indexOf(t)===-1&&e.push(t)}function nt(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var rt=(e,t,n)=>n>t?t:n<e?e:n,it={},at=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),ot=e=>typeof e==`object`&&!!e,st=e=>/^0[^.\s]+$/u.test(e);function ct(e){let t;return()=>(t===void 0&&(t=e()),t)}var lt=e=>e,ut=(...e)=>e.reduce((e,t)=>n=>t(e(n))),dt=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},ft=class{constructor(){this.subscriptions=[]}add(e){return tt(this.subscriptions,e),()=>this.remove(e)}remove(e){nt(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},pt=e=>e*1e3,mt=e=>e/1e3,ht=(e,t)=>t?1e3/t*e:0,gt=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e},_t=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,vt=1e-7,yt=12;function bt(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=_t(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>vt&&++s<yt);return o}function xt(e,t,n,r){if(e===t&&n===r)return lt;let i=t=>bt(t,0,1,e,n);return e=>e===0||e===1?e:_t(i(e),t,r)}var St=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Ct=e=>t=>1-e(1-t),wt=xt(.33,1.53,.69,.99),Tt=Ct(wt),Et=St(Tt),Dt=e=>e>=1?1:(e*=2)<1?.5*Tt(e):.5*(2-2**(-10*(e-1))),Ot=e=>1-Math.sin(Math.acos(e)),kt=Ct(Ot),At=St(Ot),jt=xt(.42,0,1,1),Mt=xt(0,0,.58,1),Nt=xt(.42,0,.58,1),Pt=e=>Array.isArray(e)&&typeof e[0]!=`number`;function Ft(e,t){return Pt(e)?e[gt(0,e.length,t)]:e}var It=e=>Array.isArray(e)&&typeof e[0]==`number`,Lt={linear:lt,easeIn:jt,easeInOut:Nt,easeOut:Mt,circIn:Ot,circInOut:At,circOut:kt,backIn:Tt,backInOut:Et,backOut:wt,anticipate:Dt},Rt=e=>typeof e==`string`,zt=e=>{if(It(e)){e.length;let[t,n,r,i]=e;return xt(t,n,r,i)}return Rt(e)?(Lt[e],`${e}`,Lt[e]):e},Bt={delta:0,timestamp:0,isProcessing:!1},Vt;function Ht(){Vt=void 0}var B={now:()=>(Vt===void 0&&B.set(Bt.isProcessing||it.useManualTiming?Bt.timestamp:performance.now()),Vt),set:e=>{Vt=e,queueMicrotask(Ht)}},Ut=e=>Math.round(e*1e5)/1e5,Wt=e=>t=>typeof t==`string`&&t.startsWith(e),Gt=Wt(`--`),Kt=Wt(`var(--`),qt=e=>Kt(e)?Jt.test(e.split(`/*`)[0].trim()):!1,Jt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Yt(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var Xt={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},Zt={...Xt,transform:e=>rt(0,1,e)},Qt={...Xt,default:1},$t=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function en(e){return e==null}var tn=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,nn=(e,t)=>n=>!!(typeof n==`string`&&tn.test(n)&&n.startsWith(e)||t&&!en(n)&&Object.prototype.hasOwnProperty.call(n,t)),rn=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match($t);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},an=e=>rt(0,255,e),on={...Xt,transform:e=>Math.round(an(e))},sn={test:nn(`rgb`,`red`),parse:rn(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+on.transform(e)+`, `+on.transform(t)+`, `+on.transform(n)+`, `+Ut(Zt.transform(r))+`)`};function cn(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var ln={test:nn(`#`),parse:cn,transform:sn.transform},un=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),dn=un(`deg`),fn=un(`%`),V=un(`px`),pn=un(`vh`),mn=un(`vw`),hn={...fn,parse:e=>fn.parse(e)/100,transform:e=>fn.transform(e*100)},gn={test:nn(`hsl`,`hue`),parse:rn(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+fn.transform(Ut(t))+`, `+fn.transform(Ut(n))+`, `+Ut(Zt.transform(r))+`)`},_n={test:e=>sn.test(e)||ln.test(e)||gn.test(e),parse:e=>sn.test(e)?sn.parse(e):gn.test(e)?gn.parse(e):ln.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?sn.transform(e):gn.transform(e),getAnimatableNone:e=>{let t=_n.parse(e);return t.alpha=0,_n.transform(t)}},vn=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,yn=new RegExp($t.source),bn=new RegExp(vn.source,`i`);function xn(e){return isNaN(e)&&typeof e==`string`&&(yn.test(e)||bn.test(e))}var Sn=`number`,Cn=`color`,wn=`var`,Tn=`var(`,En="${}",Dn=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function On(e){let t=e.toString();return yn.test(t)||bn.test(t)}function kn(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Dn,e=>(_n.test(e)?(r.color.push(a),i.push(Cn),n.push(_n.parse(e))):e.startsWith(Tn)?(r.var.push(a),i.push(wn),n.push(e)):(r.number.push(a),i.push(Sn),n.push(parseFloat(e))),++a,En)).split(En),indexes:r,types:i}}function An(e){return kn(e).values}function jn({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===Sn?Ut(r[a]):e===Cn?_n.transform(r[a]):r[a]}return i}}function Mn(e){return jn(kn(e))}var Nn=e=>typeof e==`number`?0:_n.test(e)?_n.getAnimatableNone(e):e,Pn=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Nn(e);function Fn(e){let t=kn(e);return jn(t)(t.values.map((e,n)=>Pn(e,t.split[n])))}var In={test:xn,parse:An,createTransformer:Mn,getAnimatableNone:Fn};function Ln(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Rn({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=Ln(s,r,e+1/3),a=Ln(s,r,e),o=Ln(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function zn(e,t){return n=>n>0?t:e}var Bn=(e,t,n)=>e+(t-e)*n,Vn=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Hn=[ln,sn,gn],Un=e=>Hn.find(t=>t.test(e));function Wn(e){let t=Un(e);if(!t)return`${e}`,!1;let n=t.parse(e);return t===gn&&(n=Rn(n)),n}var Gn=(e,t)=>{let n=Wn(e),r=Wn(t);if(!n||!r)return zn(e,t);let i={...n};return e=>(i.red=Vn(n.red,r.red,e),i.green=Vn(n.green,r.green,e),i.blue=Vn(n.blue,r.blue,e),i.alpha=Bn(n.alpha,r.alpha,e),sn.transform(i))},Kn=new Set([`none`,`hidden`]);function qn(e,t){return Kn.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Jn(e,t){return n=>Bn(e,t,n)}function Yn(e){return typeof e==`number`?Jn:typeof e==`string`?qt(e)?zn:_n.test(e)?Gn:$n:Array.isArray(e)?Xn:typeof e==`object`?_n.test(e)?Gn:Zn:zn}function Xn(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>Yn(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function Zn(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Yn(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function Qn(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var $n=(e,t)=>{let n=In.createTransformer(t),r=kn(e),i=kn(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Kn.has(e)&&!i.values.length||Kn.has(t)&&!r.values.length?qn(e,t):ut(Xn(Qn(r,i),i.values),n):(`${e}${t}`,zn(e,t))},er=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function tr(e,t){let n=er.exec(e);if(!n)return;let r=er.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>Ut(Bn(a,o,e))+i}function nr(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return Bn(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=tr(e,t);if(n)return n}return Yn(e)(e,t)}var rr=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function ir(e){let t=new Set,n=new Set,r=!1,i=!1,a=new Set,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(n.add(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var ar=40;function or(e,t,n={delta:0,timestamp:0,isProcessing:!1}){let r=!1,i=!0,a=()=>r=!0,o=rr.reduce((e,t)=>(e[t]=ir(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=it.useManualTiming,o=a?n.timestamp:performance.now();r=!1,a||(n.delta=i?1e3/60:Math.max(Math.min(o-n.timestamp,ar),1)),n.timestamp=o,n.isProcessing=!0,s.process(n),c.process(n),l.process(n),u.process(n),d.process(n),f.process(n),p.process(n),m.process(n),n.isProcessing=!1,r&&t&&(i=!1,e(h))},g=()=>{r=!0,i=!0,n.isProcessing||e(h)};return{schedule:rr.reduce((e,t)=>{let n=o[t];return e[t]=(e,t=!1,i=!1)=>(r||g(),n.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<rr.length;t++)o[rr[t]].cancel(e)},state:n,steps:o}}var{schedule:sr,cancel:cr,steps:lr}=or(typeof requestAnimationFrame<`u`?requestAnimationFrame:lt,!0,Bt),ur=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>sr.update(t,e),stop:()=>cr(t),now:()=>Bt.isProcessing?Bt.timestamp:B.now()}},dr=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},fr=2e4;function pr(e,t=50,n=fr,r){let i=0,a=e.next(i);for(r?.push(a.value);!a.done&&i<n;)i+=t,a=e.next(i),r?.push(a.value);return i>=n?1/0:i}function mr(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(pr(r),fr);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:mt(i)}}var hr={stiffness:100,damping:10,mass:1,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05},gr=e=>e<0?1/Math.max(1+e,hr.minDamping):Math.max(1-e,hr.minDamping);function _r(e,t){if(!(e>1))return 1;let n=Math.sqrt(e*e-1),r=e-n,i=e+n,a=2*n*Math.exp(-t)*(1+t);return br(e=>i*Math.exp(-r*e)-r*Math.exp(-i*e)-a,e=>Math.exp(-i*e)-Math.exp(-r*e),t)/t}function vr(e,t){return e*Math.sqrt(1-t*t)}var yr=12;function br(e,t,n){let r=n;for(let n=1;n<yr;n++)r-=e(r)/t(r);return r}var xr=.001;function Sr({duration:e=hr.duration,bounce:t=hr.bounce}){let n,r;hr.maxDuration;let i=gr(t);e=rt(hr.minDuration,hr.maxDuration,mt(e)),i<1?(n=t=>{let n=t*i,r=n*e,a=vr(t,i),o=Math.exp(-r);return xr-n/a*o},r=t=>{let r=t*i*e,a=i*i*t*t*e,o=Math.exp(-r),s=vr(t*t,i);return(-n(t)+xr>0?-1:1)*-a*o/s}):(n=t=>-.001+Math.exp(-t*e)*(t*e+1),r=t=>Math.exp(-t*e)*(-t*(e*e)));let a=5/e,o=br(n,r,a),s=o*_r(i,o*e),c=s*s;return{stiffness:c,damping:i*2*Math.sqrt(c),duration:pt(e)}}var Cr=(e,t)=>(t?e>=0:e>0)&&e<1/0;function wr(e,t){if(Cr(e,t))return e}function Tr(e){let t=wr(e.stiffness),n=wr(e.damping,!0),r=wr(e.mass),i={...e,stiffness:t??hr.stiffness,damping:n??hr.damping,mass:r??hr.mass,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(i.isTimeDefined){if(e.visualDuration){let t=gr(e.bounce||0),n=2*Math.PI/(e.visualDuration*1.2)*_r(t,2*Math.PI/1.2);i.stiffness=n*n,i.damping=2*t*Math.sqrt(i.stiffness)}else Object.assign(i,Sr(i)),i.isResolvedFromDuration=!0;(!Cr(i.stiffness)||!Cr(i.damping,!0))&&(i.stiffness=hr.stiffness,i.damping=hr.damping)}return i}function Er(e=hr.visualDuration,t=hr.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:o,damping:s,mass:c,duration:l,isResolvedFromDuration:u,isTimeDefined:d}=Tr({...n}),f=e=>d?0:-mt(e),p=s/(2*Math.sqrt(o*c)),m=mt(Math.sqrt(o/c)),h=p*m,g={target:i,delta:i-r,velocity:f(n.velocity||0)||0,restSpeed:0,restDelta:0},_=()=>{let e=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(e?hr.restSpeed.granular:hr.restSpeed.default),g.restDelta=n.restDelta||(e?hr.restDelta.granular:hr.restDelta.default)};_();let v,y,b;if(p<1){let e=vr(m,p),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};b=()=>{t.A=(g.velocity+h*g.delta)/e,t.sinC=h*t.A+g.delta*e,t.cosC=h*g.delta-t.A*e};let n=n=>{n!==t.t&&(t.t=n,t.env=Math.exp(-h*n),t.sin=Math.sin(e*n),t.cos=Math.cos(e*n))};v=e=>(n(e),g.target-t.env*(t.A*t.sin+g.delta*t.cos)),y=e=>(n(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(p===1){v=e=>g.target-Math.exp(-m*e)*(g.delta+(g.velocity+m*g.delta)*e);let e={C:0};b=()=>{e.C=g.velocity+m*g.delta},y=t=>Math.exp(-m*t)*(m*e.C*t-g.velocity)}else{let e=m*Math.sqrt(p*p-1),t=h-e,n=h+e,r=d?1/0:300/e,i=(e,t)=>Math.exp(t>r?-e*r-h*(t-r):-e*t),a={S:0,F:0};b=()=>{let t=(g.velocity+h*g.delta)/e;a.S=(g.delta+t)/2,a.F=(g.delta-t)/2},v=e=>g.target-a.S*i(t,e)-a.F*i(n,e),y=e=>t*a.S*i(t,e)+n*a.F*i(n,e)}b();let x=u&&l||null,S={calculatedDuration:x,retarget:(e,t)=>{g.target=e[e.length-1],g.delta=g.target-e[0],g.velocity=f(t),n.restSpeed&&n.restDelta||_(),S.calculatedDuration=x,a.done=!1,b()},velocity:e=>pt(y(e)),next:e=>{let t=v(e);if(u)a.done=e>=l;else{let n=pt(y(e));a.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-t)<=g.restDelta}return a.value=a.done?g.target:t,a},toString:()=>{let e=Math.min(pr(S),fr),t=dr(t=>S.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return S}Er.applyToOptions=e=>{let t=mr(e,100,Er);return e.ease=t.ease,e.duration=pt(t.duration),e.type=`keyframes`,e};function Dr({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>e<s||e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:_+t},b,x,S=e=>{p(f.value)&&(b=e,x=Er({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function Or(e,t,n){let r=[],i=n||it.mix||nr,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=ut(Array.isArray(t)?t[n]||lt:t,a)),r.push(a)}return r}function kr(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Or(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=dt(e[r],e[r+1],n);return s[r](i)};return n?t=>l(rt(e[0],e[a-1],t)):l}function Ar(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=dt(0,t,r);e.push(Bn(n,1,i))}}function jr(e){let t=[0];return Ar(t,e.length-1),t}function Mr(e,t){return e.map(e=>e*t)}function Nr(e,t){return e.map(()=>t||Nt).splice(0,e.length-1)}function Pr({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=Pt(r)?r.map(zt):zt(r)||Nt,a={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(i)&&(!n||n.length!==2||n[0]===0&&n[1]===1)){let[n,r]=t,o=n===r?void 0:(it.mix||nr)(n,r);return{calculatedDuration:e,next:t=>(a.value=o?o(i(e>0?rt(0,1,t/e):1)):r,a.done=t>=e,a)}}let o=kr(Mr(n&&n.length===t.length?n:jr(t),e),t,{ease:Array.isArray(i)?i:Nr(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var Fr=5;function Ir(e,t,n){let r=Math.max(t-Fr,0);return ht(n-e(r),t-r)}function Lr(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):Ir(t=>e.next(t).value,t,e.next(t).value)}var Rr=e=>e!==null;function zr(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Rr),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var Br={decay:Dr,inertia:Dr,tween:Pr,keyframes:Pr,spring:Er};function Vr(e){typeof e.type==`string`&&(e.type=Br[e.type])}function Hr(e,t){return{kind:e,animation:t,timestamp:B.now(),frameTimestamp:Bt.timestamp,frameIsProcessing:Bt.isProcessing}}function Ur(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...Hr(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function Wr(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...Hr(`layout-animation-start`,e),node:t})}catch{}}var Gr=class{constructor(){this.isResolved=!1}get finished(){return this._finished||=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e}),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}},Kr=e=>e/100,qr=class extends Gr{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==B.now()&&this.tick(B.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),Ur(this,this.options)}initAnimation(){let{options:e}=this;Vr(e);let{type:t=Pr,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Pr;s!==Pr&&typeof o[0]!=`number`&&(this.mixKeyframes=ut(Kr,nr(o[0],o[1])),o=[0,100]);let c=s(o===e.keyframes?e:{...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=pr(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=rt(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==Dr&&(b.value=zr(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return mt(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+mt(e)}get time(){return mt(this.currentTime)}set time(e){e=pt(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){return Lr(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(B.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=mt(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=ur,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(B.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}},Jr=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Yr(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match($t)||[];if(!r)return e;let i=n.replace(r,``),a=+!!Jr.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var Xr=/\b([a-z-]*)\(.*?\)/gu,Zr={...In,getAnimatableNone:e=>{let t=e.match(Xr);return t?t.map(Yr).join(` `):e}},Qr={...In,getAnimatableNone:e=>{let t=In.parse(e);return In.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},$r={...Xt,transform:Math.round},ei={rotate:dn,pathRotation:dn,rotateX:dn,rotateY:dn,rotateZ:dn,scale:Qt,scaleX:Qt,scaleY:Qt,scaleZ:Qt,skew:dn,skewX:dn,skewY:dn,distance:V,translateX:V,translateY:V,translateZ:V,x:V,y:V,z:V,perspective:V,transformPerspective:V,opacity:Zt,originX:hn,originY:hn,originZ:V},ti={borderWidth:V,borderTopWidth:V,borderRightWidth:V,borderBottomWidth:V,borderLeftWidth:V,borderRadius:V,borderTopLeftRadius:V,borderTopRightRadius:V,borderBottomRightRadius:V,borderBottomLeftRadius:V,width:V,maxWidth:V,height:V,maxHeight:V,top:V,right:V,bottom:V,left:V,inset:V,insetBlock:V,insetBlockStart:V,insetBlockEnd:V,insetInline:V,insetInlineStart:V,insetInlineEnd:V,padding:V,paddingTop:V,paddingRight:V,paddingBottom:V,paddingLeft:V,paddingBlock:V,paddingBlockStart:V,paddingBlockEnd:V,paddingInline:V,paddingInlineStart:V,paddingInlineEnd:V,margin:V,marginTop:V,marginRight:V,marginBottom:V,marginLeft:V,marginBlock:V,marginBlockStart:V,marginBlockEnd:V,marginInline:V,marginInlineStart:V,marginInlineEnd:V,fontSize:V,backgroundPositionX:V,backgroundPositionY:V,...ei,zIndex:$r,fillOpacity:Zt,strokeOpacity:Zt,numOctaves:$r},ni={...ti,color:_n,backgroundColor:_n,outlineColor:_n,fill:_n,stroke:_n,borderColor:_n,borderTopColor:_n,borderRightColor:_n,borderBottomColor:_n,borderLeftColor:_n,filter:Zr,WebkitFilter:Zr,mask:Qr,WebkitMask:Qr},ri=e=>ni[e],ii=new Set([Zr,Qr]);function ai(e,t){let n=ri(e);return ii.has(n)||(n=In),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function oi(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var si=e=>e*180/Math.PI,ci=e=>ui(si(Math.atan2(e[1],e[0]))),li={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:ci,rotateZ:ci,skewX:e=>si(Math.atan(e[1])),skewY:e=>si(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},ui=e=>(e%=360,e<0&&(e+=360),e),di=ci,fi=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),pi=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),mi={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:fi,scaleY:pi,scale:e=>(fi(e)+pi(e))/2,rotateX:e=>ui(si(Math.atan2(e[6],e[5]))),rotateY:e=>ui(si(Math.atan2(-e[2],e[0]))),rotateZ:di,rotate:di,skewX:e=>si(Math.atan(e[4])),skewY:e=>si(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function hi(e){return+!!e.includes(`scale`)}function gi(e,t){if(!e||e===`none`)return hi(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=mi,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=li,i=t}if(!i)return hi(t);let a=r[t],o=i[1].split(`,`).map(vi);return typeof a==`function`?a(o):o[a]}var _i=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return gi(n,t)};function vi(e){return parseFloat(e.trim())}var yi=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],bi=new Set([...yi,`pathRotation`]),xi=e=>e===Xt||e===V,Si=new Set([`x`,`y`,`z`]),Ci=yi.filter(e=>!Si.has(e));function wi(e){let t=[];return Ci.forEach(n=>{let r=e.getValue(n);if(r!==void 0){let e=r.get(),i=+!!n.startsWith(`scale`);if(e===i)return;t.push([n,e]),r.set(i)}}),t}var Ti=new Set([`bottom`,`right`]);function Ei(e,t,n,r,i,a){let o=parseFloat(e);if(!isNaN(o))return o;let{min:s,max:c}=t()[n],l=c-s;return a===`border-box`?l:l-parseFloat(r)-parseFloat(i)}var Di={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>Ei(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>Ei(e,i,`y`,t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{let{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{let{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:({transform:e})=>gi(e,`x`),y:({transform:e})=>gi(e,`y`)};Di.translateX=Di.x,Di.translateY=Di.y;var Oi=new Set,ki=!1,Ai=!1,ji=!1;function Mi(){if(Ai){let e=[],t=new Set,n=new Set;Oi.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),Ti.has(r.name)&&n.add(r.element))});let r=new Map;n.forEach(e=>{let t=wi(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}Ai=!1,ki=!1,Oi.forEach(e=>e.complete(ji)),Oi.clear()}function Ni(){Oi.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Ai=!0)})}function Pi(){ji=!0,Ni(),Mi(),ji=!1}function Fi(e,t,n){if(typeof e==`string`){if(at(e)||st(e))return parseFloat(e);if(!In.test(e)&&In.test(n))return ai(t,n)}return e??void 0}var Ii=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(Oi.add(this),ki||(ki=!0,sr.read(Ni),sr.resolveKeyframes(Mi))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=Fi(n.readValue(t,a),t,a);r!==void 0&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}oi(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Oi.delete(this)}cancel(){this.state===`scheduled`&&(Oi.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},Li=e=>e.startsWith(`--`);function Ri(e,t,n){Li(t)?e.style.setProperty(t,n):e.style[t]=n}var zi={};function Bi(e,t){let n=ct(e);return()=>zi[t]??n()}var Vi=Bi(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),Hi=Bi(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),Ui=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Wi={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:Ui([0,.65,.55,1]),circOut:Ui([.55,0,1,.45]),backIn:Ui([.31,.01,.66,-.59]),backOut:Ui([.33,1.53,.69,.99])};function Gi(e,t){if(e)return typeof e==`function`?Hi()?dr(e,t):`ease-out`:It(e)?Ui(e):Array.isArray(e)?e.map(e=>Gi(e,t)||Wi.easeOut):Wi[e]}function Ki(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=Gi(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function qi(e){return typeof e==`function`&&`applyToOptions`in e}function Ji({type:e,...t}){return qi(e)&&Hi()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var Yi=class extends Gr{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=Ji(e);this.animation=Ki(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=zr(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),Ri(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},Ur(this,e,c)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return mt(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+mt(e)}get time(){return mt(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=pt(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,onAttach:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&Vi()?(this.animation.timeline=e,t?.(this.animation),lt):n(this)}},Xi={anticipate:Dt,backInOut:Et,circInOut:At};function Zi(e){return e in Xi}function Qi(e){typeof e.ease==`string`&&Zi(e.ease)&&(e.ease=Xi[e.ease])}var $i=10,ea=class extends Yi{constructor(e){Qi(e),Vr(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new qr({...a,autoplay:!1}),s=Math.max($i,B.now()-this.startTime),c=rt(0,$i,s-$i),l=o.sample(s).value,{name:u}=this.options;i&&u&&Ri(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},H=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(In.test(e)||e===`0`)&&!e.startsWith(`url(`));function ta(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function na(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=H(i,t),s=H(a,t);return!o||!s?(o!==s&&`${t}${i}${a}${o?a:i}`,!1):ta(e)||(n===`spring`||qi(n))&&r}function ra(e){e.duration=0,e.type=`keyframes`}var ia=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),aa=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function oa(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&aa.test(e[t]))return!0;return!1}var sa=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),ca=ct(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function la(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(ia.has(n)||sa.has(n)))return!1;let c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return ca()&&(ia.has(n)||sa.has(n)&&oa(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var ua=40,da=class extends Gr{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=B.now();let{keyframes:t,name:n,motionValue:r,element:i}=e,a=e;a.autoplay??=!0,a.delay??=0,a.type??=`keyframes`,a.repeat??=0,a.repeatDelay??=0,a.repeatType??=`loop`;let o=i?.KeyframeResolver||Ii;this.keyframeResolver=new o(t,(e,t,n)=>this.onKeyframesResolved(e,t,a,!n),n,r,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=B.now();let u=!0;na(e,i,a,o)||(u=!1,(it.instantAnimations||!s)&&l?.(zr(e,n,t)),e[0]=e[e.length-1],ra(n),n.repeat=0);let d=r?this.resolvedAt&&this.resolvedAt-this.createdAt>ua?this.resolvedAt:this.createdAt:void 0,{onComplete:f}=n;n.startTime??=d,n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{f?.(),this.notifyFinished()};let p=u&&!c&&la(n),m;if(p){n.element=n.motionValue?.owner?.current;try{m=new ea(n)}catch{m=new qr(n)}}else m=new qr(n);this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Pi()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}},fa=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return pa(this.animations,`duration`)}get iterationDuration(){return pa(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function pa(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var ma=class extends fa{then(e,t){return this.finished.finally(e).then(()=>{})}};function ha(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var ga=30,_a=e=>!isNaN(parseFloat(e)),va={current:void 0},ya=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=B.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.notifyChange(),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=B.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=_a(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){var n;return e===`change`?this.onChangeSubscribe(t):((n=this.events)[e]||(n[e]=new ft)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new ft,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0),t.change.add(e)),()=>{this.changeSubscriber===e?this.changeSubscriber=void 0:t.change?.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){sr.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.notifyChange()}notifyChange(){let{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return va.current&&va.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=B.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>ga)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,ga);return ht(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0;let n=!1,r;r=e(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===r&&this.clearAnimation(),t()}),n||(this.animation=r),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function ba(e,t){return new ya(e,t)}function xa(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function Sa(e,t){let n=e?.[t]??e?.default??e;return n===e?n:xa(n,e)}var Ca={type:`spring`,stiffness:500,damping:25,restSpeed:10},wa=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Ta={type:`keyframes`,duration:.8},Ea={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Da=(e,{keyframes:t})=>t.length>2?Ta:bi.has(e)?e.startsWith(`scale`)?wa(t[1]):Ca:Ea,Oa=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function ka(e){for(let t in e)if(!Oa.has(t))return!0;return!1}var Aa=(e,t,n,r={},i,a)=>o=>{let s=Sa(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=pt(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};ka(s)||Object.assign(u,Da(e,u)),u.duration&&=pt(u.duration),u.repeatDelay&&=pt(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(ra(u),u.delay===0&&(d=!0)),(it.instantAnimations||it.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,ra(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=zr(u.keyframes,s);if(e!==void 0){sr.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new qr(u):new da(u)},ja=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ma(e){let t=ja.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Na(e,t,n=1){`${e}`;let[r,i]=Ma(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return at(e)?parseFloat(e):e}return qt(i)?Na(i,t,n+1):i}function Pa(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Fa(e,t,n,r){let i=t=>typeof t==`function`?t(n===void 0?e.custom:n,...Pa(r)):t;return t=i(t),typeof t==`string`&&(t=e.variants&&e.variants[t]),i(t)}function Ia(e,t,n){return Fa(e.getProps(),t,n,e)}var La=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,Ra=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...yi]),za=e=>Array.isArray(e);function Ba(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,ba(n))}function Va(e){return za(e)?e[e.length-1]||0:e}function Ha(e,t){let{transitionEnd:n={},transition:r={},...i}=Ia(e,t)||{};i={...i,...n};for(let t in i)Ba(e,t,Va(i[t]))}var Ua=e=>!!(e&&e.getVelocity);function Wa(e){return!!(Ua(e)&&e.add)}function Ga(e,t){let n=e.getValue(`willChange`);if(Wa(n))return n.add(t);if(!n&&it.WillChange){let n=new it.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function Ka(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var qa=`data-`+Ka(`framerAppearId`);function Ja(e){return e.props[qa]}var Ya=typeof window<`u`;function Xa({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function Za(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?xa(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState?.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&Xa(f,t))continue;let o={delay:n,...Sa(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){sr.update(()=>r.set(i));continue}let p=!1;if(Ya&&window.MotionHandoffAnimation){let n=Ja(e);if(n){let e=window.MotionHandoffAnimation(n,t,sr);e!==null&&(o.startTime=e,p=!0)}}Ga(e,t);let m=l??e.shouldReduceMotion;r.start(Aa(t,r,i,m&&Ra.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>sr.update(()=>{o&&Ha(e,o)});d.length?Promise.all(d).then(t):t()}return d}function Qa(e,t,n={}){let r=Ia(e,t,La(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?Za(e,r,n):[]),o=(r=0)=>{let{variantChildren:a}=e,{delayChildren:o=0,staggerChildren:s,staggerDirection:c}=i,l=[];return a?.forEach(e=>{e.notify(`AnimationStart`,t),l.push(Qa(e,t,{...n,delay:r+(typeof o==`function`?0:o)+ha(a,e,o,s,c)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(l)},{when:s}=i;return s?s===`beforeChildren`?a().then(()=>o()):o().then(a):Promise.all([a(),o(n.delay)])}function $a(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>Qa(e,t,n))):typeof t==`string`?Qa(e,t,n):Promise.all(Za(e,Ia(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}var eo={test:e=>e===`auto`,parse:e=>e},to=e=>t=>t.test(e),no=[Xt,V,fn,dn,mn,pn,eo],ro=e=>no.find(to(e));function io(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||st(e)}var ao=new Set([`auto`,`none`,`0`]);function oo(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!ao.has(t)&&On(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=ai(n,i))}var so=class extends Ii{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),qt(r))){let i=Na(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Ra.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=ro(r),o=ro(i);if(Yt(r)!==Yt(i)&&Di[n]){this.needsMeasurement=!0;return}if(a!==o){if(xi(a)&&xi(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else Di[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||io(e[t]))&&n.push(t);n.length&&oo(e,n,t)}measure(){let{element:e,name:t}=this;return Di[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e||!e.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},co=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`],lo=[];function uo(e){typeof e.test==`function`&&e.read,fo(e),lo.unshift(e)}function fo(e){nt(lo,e)}function po(e){return lo.find(t=>t.test(e))}function mo(e,t,n={},r){let i=[],{velocity:a}=n,o=n.reduceMotion??r?.shouldReduceMotion;for(let s in t){if(s===`transition`||s===`transitionEnd`)continue;let c=t[s];if(c===void 0)continue;let l=e(s),u=l.get();if(u!==void 0&&!l.isAnimating()&&!Array.isArray(c)&&c===u&&!a){sr.update(()=>l.set(c));continue}l.start(Aa(s,l,c,o&&Ra.has(s)?{type:!1}:n,r)),l.animation&&i.push(l.animation)}let{transitionEnd:s}=t;if(s){let t=()=>sr.update(()=>{for(let t in s)e(t).set(s[t])});i.length?Promise.all(i).then(t):t()}return i}function ho(e,t,n,r,i){return mo(r=>{let a=e.get(t,r);if(!a){let o;if(!i){let i=n[r];o=go(i)??e.read(t,r,i),`${r}`}a=ba(o,{owner:i}),e(t,{[r]:a})}return a},n,r,i)}function go(e){let t=Array.isArray(e)?e[0]:void 0;return t===null?void 0:t}function _o(e){return ot(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function vo(e){return ot(e)&&`ownerSVGElement`in e}var yo=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function bo(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var xo=class{constructor(e=sr.render){this.step=e,this.values=new Map,this.pending=[],this.numPending=0,this.flush=()=>{let{pending:e,numPending:t}=this;this.numPending=0;for(let n=0;n<t;n++)e[n]()}}set(e,t,n,r){if(this.values.get(e)?.onRemove(),r)for(let e of this.values.values())e.value===r&&(n=e.render);let i=()=>n&&this.schedule(n);t.get()!==void 0&&i();let a=t.on(`change`,i),o=()=>{a(),n&&!r&&this.cancel(n),this.values.get(e)?.onRemove===o&&this.values.delete(e)};return this.values.set(e,{value:t,render:r?void 0:n,onRemove:o}),o}get(e){return this.values.get(e)?.value}release(){let e=new Map;return this.values.forEach((t,n)=>{e.set(n,t.value),t.onRemove()}),this.transformKeys=this.transformValues=void 0,e}schedule(e){let{pending:t,numPending:n}=this;for(let r=0;r<n;r++)if(t[r]===e)return;n||this.step(this.flush),t[this.numPending++]=e}cancel(e){let{pending:t}=this;for(let n=0;n<this.numPending;n++)if(t[n]===e){t[n]=t[--this.numPending];return}}};function So(e,{step:t,...n}={}){let r=new WeakMap;return Object.assign((n,i)=>{let a=r.get(n)??new xo(t);r.set(n,a);let o=[];for(let t in i){let r=i[t],s=e(n,a,t,r);o.push(s)}return()=>{for(let e of o)e()}},n,{get:(e,t)=>r.get(e)?.get(t),flush:e=>r.get(e)?.flush(),state:e=>r.get(e)})}var Co={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},wo={};function To(e){let t=``,{transformKeys:n=[],transformValues:r={}}=e;for(let e=0;e<n.length;e++){let i=n[e],a=r[i].get();a!==void 0&&(typeof a==`number`?a:parseFloat(a))!==+!!i.startsWith(`scale`)&&(t+=(t&&` `)+(wo[i]||(wo[i]=(Co[i]||i)+`(`))+yo(a,ei[i])+`)`)}let i=e.get(`pathRotation`)?.get();return i&&(t+=(t&&` `)+`rotate(`+yo(i,ei.pathRotation)+`)`),t||`none`}var Eo=new Set([`originX`,`originY`,`originZ`]),Do=(e,t)=>yo(e.get(t)?.get(),ti[t]),Oo=(e,t,n,r)=>{let i,a;if(bi.has(n)){if(n!==`pathRotation`){let e=t.transformKeys??=[];(t.transformValues??={})[n]=r,e.includes(n)||(e.push(n),e.sort((e,t)=>yi.indexOf(e)-yi.indexOf(t)))}t.get(`transform`)||(!_o(e)&&!t.get(`transformBox`)&&Oo(e,t,`transformBox`,new ya(`fill-box`)),t.set(`transform`,new ya(`none`),()=>{e.style.transform=To(t)})),a=t.get(`transform`)}else Eo.has(n)?(t.get(`transformOrigin`)||t.set(`transformOrigin`,new ya(``),()=>{let n=Do(t,`originX`)??`50%`,r=Do(t,`originY`)??`50%`,i=Do(t,`originZ`)??0;e.style.transformOrigin=`${n} ${r} ${i}`}),a=t.get(`transformOrigin`)):i=Li(n)?()=>{e.style.setProperty(n,r.get())}:()=>{e.style[n]=yo(r.get(),ti[n])};return t.set(n,r,i,a)},ko=e=>_o(e)||vo(e),Ao=(e,t)=>{if(bi.has(t))return _i(e,t);let n=getComputedStyle(e),r=Li(t)?n.getPropertyValue(t):n[t];return typeof r==`string`&&r.trim()||0},jo=So(Oo,{test:ko,read:Ao}),Mo={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},No=yi.length;function Po(e,t,n){let r=``,i=!0;for(let a=0;a<No;a++){let o=yi[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=yo(s,ti[o]);if(!c){i=!1;let t=Mo[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${yo(a,ti.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function Fo(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(bi.has(e)){o=!0;continue}if(Gt(e)){i[e]=n;continue}{let t=yo(n,ti[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=Po(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var Io={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Lo={offset:`strokeDashoffset`,array:`strokeDasharray`};function Ro(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Io:Lo;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var U=[`transform`,`opacity`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function zo(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Fo(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;for(let e of U)d[e]!==void 0&&(f[e]=d[e],delete d[e]);(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&Ro(d,i,a,o,!1)}function Bo(e,t){if(!(t in e))return!1;let n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),t)||Object.getOwnPropertyDescriptor(e,t);return n&&typeof n.set==`function`}var Vo=(e,t,n,r,i=n)=>{let a=Bo(e,i);!a&&(i.startsWith(`data`)||i.startsWith(`aria`))&&(i=Ka(i));let o=ti[n]||ti[i],s=a?()=>{e[i]=yo(r.get(),ti[n])}:()=>{let t=yo(r.get(),o);t==null?e.removeAttribute(i):e.setAttribute(i,String(t))};return t.set(n,r,s)};function Ho(e,t,n,r){return sr.render(()=>e.setAttribute(`pathLength`,`1`)),n===`pathOffset`?t.set(n,r,()=>{let t=r.get();e.setAttribute(`stroke-dashoffset`,`${-t}`)}):(t.get(`stroke-dasharray`)||t.set(`stroke-dasharray`,new ya(`1 1`),()=>{let n=t.get(`pathLength`)?.get()??1,r=t.get(`pathSpacing`)?.get();e.setAttribute(`stroke-dasharray`,`${n} ${r??1-Number(n)}`)}),t.set(n,r,void 0,t.get(`stroke-dasharray`)))}var Uo=So((e,t,n,r)=>n.startsWith(`path`)?Ho(e,t,n,r):n.startsWith(`attr`)?Vo(e,t,n,r,Wo(n)):(bi.has(n)||Eo.has(n)||Li(n)||n in e.style?Oo:Vo)(e,t,n,r),{test:vo,read:(e,t)=>bi.has(t)?ti[t]?.default||0:Li(t)||U.includes(t)?Ao(e,t)||e.getAttribute(Ka(t))||0:(t=Wo(t),e.getAttribute(Ka(t))??e.getAttribute(t)??void 0)});function Wo(e){return e.replace(/^attr([A-Z])/,(e,t)=>t.toLowerCase())}function Go({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Ko({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function qo(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Jo(e){return e===void 0||e===1}function Yo({scale:e,scaleX:t,scaleY:n}){return!Jo(e)||!Jo(t)||!Jo(n)}function Xo(e){return Yo(e)||Zo(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Zo(e){return Qo(e.x)||Qo(e.y)}function Qo(e){return e&&e!==`0%`}function $o(e,t,n){return n+t*(e-n)}function es(e,t,n,r,i){return i!==void 0&&(e=$o(e,i,r)),$o(e,n,r)+t}function ts(e,t=0,n=1,r,i){e.min=es(e.min,t,n,r,i),e.max=es(e.max,t,n,r,i)}function ns(e,{x:t,y:n}){ts(e.x,t.translate,t.scale,t.originPoint),ts(e.y,n.translate,n.scale,n.originPoint)}var rs=.999999999999,is=1.0000000000001;function as(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(os(e.x,-a.scroll.offset.x),os(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,ns(e,o)),r&&Xo(a.latestValues)&&ls(e,a.latestValues,a.layout?.layoutBox))}t.x<is&&t.x>rs&&(t.x=1),t.y<is&&t.y>rs&&(t.y=1)}function os(e,t){e.min+=t,e.max+=t}function ss(e,t,n,r,i=.5){ts(e,t,n,Bn(e.min,e.max,i),r)}function cs(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function ls(e,t,n){let r=n??e;ss(e.x,cs(t.x,r.x),t.scaleX,t.scale,t.originX),ss(e.y,cs(t.y,r.y),t.scaleY,t.scale,t.originY)}function us(e,t){return Go(qo(e.getBoundingClientRect(),t))}function ds(e,t,n){let r=us(e,n),{scroll:i}=t;return i&&(os(r.x,i.offset.x),os(r.y,i.offset.y)),r}var fs={},ps=e=>vo(e)?Uo:jo,ms=class{constructor(e,t){this.effect=e,this.current=t,this.KeyframeResolver=so}getValue(e){return this.effect.get(this.current,e)}readValue(e,t){return this.effect.read(this.current,e,t)}render(){this.effect.flush(this.current)}measureViewportBox(){return us(this.current)}getProps(){return fs}};function hs(e,t,n,r){if(r)return mo(e=>r.getValue(e,null),t,n,r);let i=ps(e);return ho(i,e,t,n,new ms(i,e))}var gs=So((e,t,n,r)=>t.set(n,r,()=>{e[n]=r.get()}),{test:e=>ot(e),read:(e,t)=>{let n=e[t];return typeof n==`string`||typeof n==`number`?n:void 0}}),{schedule:_s,cancel:vs}=or(queueMicrotask,!1),ys={x:!1,y:!1};function bs(){return ys.x||ys.y}function xs(e){return e===`x`||e===`y`?ys[e]?null:(ys[e]=!0,()=>{ys[e]=!1}):ys.x||ys.y?null:(ys.x=ys.y=!0,()=>{ys.x=ys.y=!1})}function Ss(e,t){let n=bo(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function Cs(e){return!(e.pointerType===`touch`||bs())}function ws(e,t,n={}){let[r,i,a]=Ss(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!Cs(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var Ts=(e,t)=>t?e===t||Ts(e,t.parentElement):!1,Es=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,Ds=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Os(e){return Ds.has(e.tagName)||e.isContentEditable===!0}var ks=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function As(e){return ks.has(e.tagName)||e.isContentEditable===!0}var js=new WeakSet;function Ms(e){return t=>{t.key===`Enter`&&e(t)}}function Ns(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var Ps=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=Ms(()=>{if(js.has(n))return;Ns(n,`down`);let e=Ms(()=>{Ns(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>Ns(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function Fs(e){return Es(e)&&!bs()}var Is=new WeakSet;function Ls(e,t,n={}){let[r,i,a]=Ss(e,n),o=e=>{let r=e.currentTarget;if(!Fs(e)||Is.has(e))return;js.add(r),n.stopPropagation&&Is.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),js.has(r)&&js.delete(r),Fs(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||Ts(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),_o(e)&&(e.addEventListener(`focus`,e=>Ps(e,i)),!Os(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}var Rs=new WeakMap,zs,Bs=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:vo(r)&&`getBBox`in r?r.getBBox()[t]:r[n],Vs=Bs(`inline`,`width`,`offsetWidth`),Hs=Bs(`block`,`height`,`offsetHeight`);function Us({target:e,borderBoxSize:t}){Rs.get(e)?.forEach(n=>{n(e,{get width(){return Vs(e,t)},get height(){return Hs(e,t)}})})}function Ws(e){e.forEach(Us)}function Gs(){typeof ResizeObserver<`u`&&(zs=new ResizeObserver(Ws))}function Ks(e,t){zs||Gs();let n=bo(e);return n.forEach(e=>{let n=Rs.get(e);n||(n=new Set,Rs.set(e,n)),n.add(t),zs?.observe(e)}),()=>{n.forEach(e=>{let n=Rs.get(e);n?.delete(t),n?.size||zs?.unobserve(e)})}}var qs=new Set,Js;function Ys(){Js=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};qs.forEach(t=>t(e))},window.addEventListener(`resize`,Js)}function Xs(e){return qs.add(e),Js||Ys(),()=>{qs.delete(e),!qs.size&&typeof Js==`function`&&(window.removeEventListener(`resize`,Js),Js=void 0)}}function Zs(e,t){return typeof e==`function`?Xs(e):Ks(e,t)}var Qs={value:null,addProjectionMetrics:null};function $s(e){return vo(e)&&e.tagName===`svg`}var ec=e=>typeof e==`number`?e:parseFloat(e),tc=()=>({translate:0,scale:1,origin:0,originPoint:0}),nc=()=>({x:tc(),y:tc()}),rc=()=>({min:0,max:0}),ic=()=>({x:rc(),y:rc()}),ac=new WeakMap;function oc(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function sc(e){return typeof e==`string`||Array.isArray(e)}var cc=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],lc=[`initial`,...cc];function uc(e){if(oc(e.animate))return!0;for(let t=0;t<lc.length;t++)if(sc(e[lc[t]]))return!0;return!1}function dc(e){return!!(uc(e)||e.variants)}function fc(e,t,n){for(let r in t){let i=t[r],a=n[r];if(Ua(i))e.addValue(r,i);else if(Ua(a))e.addValue(r,ba(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,ba(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var pc={current:null},mc={current:!1},hc=typeof window<`u`;function gc(){if(mc.current=!0,hc){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>pc.current=e.matches;e.addEventListener(`change`,t),t()}else pc.current=!1}}var _c=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],vc={};function yc(e){vc=e}function bc(){return vc}var xc=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Ii,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=B.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,sr.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=uc(t),this.isVariantNode=dc(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&Ua(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];if(this.current=e,ac.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.isVariantNode&&!this.isControllingVariants){let e=this;do e=e.props.inherit!==!1&&e.parent;while(e&&!e.isVariantNode);if(e){let{variantChildren:t}=e;t.add(this),this.removeFromVariantTree=()=>t.delete(this)}}this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(mc.current||gc(),this.shouldReduceMotion=pc.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),cr(this.notifyUpdate),cr(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&ia.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new Yi({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:pt(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=bi.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&sr.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!e.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in vc){let t=vc[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ic()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<_c.length;t++){let n=_c[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=fc(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(e,t){let n=this.values.get(e);if(t!==n){n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t);let r=t.get();r!==void 0&&(this.latestValues[e]=r)}}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=ba(t??this.getDefaultValue?.(e),{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(at(n)||st(n))?n=parseFloat(n):typeof n!=`number`&&!In.test(n)&&In.test(t)&&(n=ai(e,t)),this.setBaseTarget(e,Ua(n)?n.get():n)),Ua(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}on(e,t){return this.events[e]||(this.events[e]=new ft),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){_s.render(this.render)}},Sc=class extends xc{constructor(){super(...arguments),this.KeyframeResolver=so}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;Ua(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},Cc=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function wc(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}var Tc={};function Ec(e,{layout:t,layoutId:n}){return bi.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Tc[e]||e===`opacity`)}function Dc(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(Ua(r[t])||i&&Ua(i[t])||Ec(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function Oc(e){return window.getComputedStyle(e)}var kc=class extends Sc{constructor(){super(...arguments),this.type=`html`,this.renderInstance=wc}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(bi.has(t))return this.projection?.isProjecting?hi(t):_i(e,t);{let n=Oc(e),r=(Gt(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return us(e,t)}build(e,t,n){Fo(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Dc(e,t,n)}},Ac=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),jc=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function Mc(e,t,n,r){wc(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(Ac.has(n)?n:Ka(n),t.attrs[n])}function Nc(e,t,n){let r=Dc(e,t,n);for(let n in e)if(Ua(e[n])||Ua(t[n])){let t=yi.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var Pc=class extends Sc{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=ic}getBaseTargetFromProps(e,t){return bi.has(t)?super.getBaseTargetFromProps(e,t)??hi(t):e[t]}getDefaultValue(e){return bi.has(e)?this.latestValues[e]??hi(e):void 0}readValueFromInstance(e,t){if(bi.has(t)){let e=ri(t);return e&&e.default||0}if(U.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=Ac.has(t)?t:Ka(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Nc(e,t,n)}build(e,t,n){zo(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){Mc(e,t,n,r)}mount(e){this.isSVGTag=jc(e.tagName),super.mount(e)}};function Fc(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var Ic=[...cc].reverse();function Lc(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>$a(e,t,n))),n=zc(),r=!0,i=!1;function a(a){let{props:o,parent:s,manuallyAnimateOnMount:c}=e,l=r||i,u=[],d=new Set,f={},p=1/0,m=e;do m=m.props.inherit!==!1&&m.parent;while(m&&!m.isControllingVariants);if(Ic.forEach((t,r)=>{let i=n[t],h=o[t],g=m&&m.props[t],_=h===void 0?sc(g)||g===!1?g:void 0:h,v=sc(_),y=t===a?i.isActive:null;y===!1&&(p=r);let b=v&&h===void 0&&!(l&&c);if(i.protectedKeys={...f},!i.isActive&&y===null||!_&&!i.prevProp||oc(_)||typeof _==`boolean`)return;if(t===`exit`&&i.isActive&&y!==!0){f={...f,...i.prevResolvedValues};return}let x=Rc(i.prevProp,_),S=x||v&&(y&&!b||r>p),C=!1,w=Array.isArray(_)?_:[_],T={};if(y!==!1)for(let n of w){let{transition:r,transitionEnd:i,...a}=Ia(e,n,La(e,t))||{};T={...T,...a,...i}}let{prevResolvedValues:E}=i;for(let t in{...E,...T}){if(t in f)continue;let n=T[t],r=E[t],a=Array.isArray(n)&&Array.isArray(r)?!Fc(n,r)||x:n!==r;if(a&&n==null)d.add(t);else if(a||n!==void 0&&d.has(t)){S=!0,d.delete(t)&&(C=!0),i.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)}else i.protectedKeys[t]=!0}if(i.prevProp=_,i.prevResolvedValues=T,i.isActive&&(f={...f,...T}),S&&(!(b&&x)||C))for(let n of w){let r={type:t};if(typeof n==`string`&&l&&c&&s?.enteringChildren){let t=Ia(s,n)?.transition?.delayChildren;r.delay=ha(s.enteringChildren,e,t)}u.push({animation:n,options:r})}}),d.size){let{initial:t}=o,n={},r=typeof t!=`boolean`&&Ia(e,Array.isArray(t)?t[0]:t,e.presenceContext?.custom);r&&r.transition&&(n.transition=r.transition),d.forEach(i=>{let a=e.getValue(i);a&&(a.liveStyle=!0);let s=r&&!Array.isArray(t)?r[i]:void 0,c=e.getBaseTargetFromProps(o,i);n[i]=(s===void 0?c!==void 0&&!Ua(c)?c:e.initialValues[i]===void 0?e.baseTarget[i]:void 0:s)??null}),u.push({animation:n})}let h=l&&e.blockInitialAnimation||r&&!c&&(o.initial===!1||o.initial===o.animate);return r=i=!1,!h&&u.length?t(u):Promise.resolve()}function o(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=a(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:a,setActive:o,setAnimateFunction:n=>{t=n(e)},getState:()=>n,reset:()=>{n=zc(),i=!0}}}function Rc(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!Fc(t,e):!1}function zc(){let e={};for(let t of cc)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}};return e}function Bc(e,t){e.min=t.min,e.max=t.max}function Vc(e,t){Bc(e.x,t.x),Bc(e.y,t.y)}function Hc(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var Uc=.9999,Wc=1.0001,Gc=-.01,Kc=.01;function qc(e){return e.max-e.min}function Jc(e,t,n){return Math.abs(e-t)<=n}function Yc(e,t,n,r=.5){e.origin=r,e.originPoint=Bn(t.min,t.max,e.origin),e.scale=qc(n)/qc(t),e.translate=Bn(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Uc&&e.scale<=Wc||isNaN(e.scale))&&(e.scale=1),(e.translate>=Gc&&e.translate<=Kc||isNaN(e.translate))&&(e.translate=0)}function Xc(e,t,n,r){Yc(e.x,t.x,n.x,r?r.originX:void 0),Yc(e.y,t.y,n.y,r?r.originY:void 0)}function Zc(e,t,n,r=0){e.min=(r?Bn(n.min,n.max,r):n.min)+t.min,e.max=e.min+qc(t)}function Qc(e,t,n,r){Zc(e.x,t.x,n.x,r?.x),Zc(e.y,t.y,n.y,r?.y)}function $c(e,t,n,r=0){let i=r?Bn(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+qc(t)}function el(e,t,n,r){$c(e.x,t.x,n.x,r?.x),$c(e.y,t.y,n.y,r?.y)}function tl(e,t,n,r,i){return e-=t,e=$o(e,1/n,r),i!==void 0&&(e=$o(e,1/i,r)),e}function nl(e,t=0,n=1,r=.5,i,a=e,o=e){if(fn.test(t)&&(t=parseFloat(t),t=Bn(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=Bn(a.min,a.max,r);e===a&&(s-=t),e.min=tl(e.min,t,n,s,i),e.max=tl(e.max,t,n,s,i)}function rl(e,t,[n,r,i],a,o){nl(e,t[n],t[r],t[i],t.scale,a,o)}var il=[`x`,`scaleX`,`originX`],al=[`y`,`scaleY`,`originY`];function ol(e,t,n,r){rl(e.x,t,il,n?n.x:void 0,r?r.x:void 0),rl(e.y,t,al,n?n.y:void 0,r?r.y:void 0)}function sl(e){return e.translate===0&&e.scale===1}function cl(e){return sl(e.x)&&sl(e.y)}function ll(e,t){return e.min===t.min&&e.max===t.max}function ul(e,t){return ll(e.x,t.x)&&ll(e.y,t.y)}function dl(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function fl(e,t){return dl(e.x,t.x)&&dl(e.y,t.y)}function pl(e){return qc(e.x)/qc(e.y)}function ml(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function hl(e){return[e(`x`),e(`y`)]}function gl(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var _l={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(V.test(e))e=parseFloat(e);else return e}return`${gl(e,t.target.x)}% ${gl(e,t.target.y)}%`}},vl={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=In.parse(e);if(i.length>5)return r;let a=In.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=Bn(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}};function yl(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var bl=co.length,xl=e=>typeof e==`number`||V.test(e);function Sl(e,t,n,r,i,a){i?(e.opacity=Bn(0,n.opacity??1,wl(r)),e.opacityExit=Bn(t.opacity??1,0,Tl(r))):a&&(e.opacity=Bn(t.opacity??1,n.opacity??1,r));for(let i=0;i<bl;i++){let a=co[i],o=Cl(t,a),s=Cl(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||xl(o)===xl(s)?(e[a]=Math.max(Bn(ec(o),ec(s),r),0),(fn.test(s)||fn.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=Bn(t.rotate||0,n.rotate||0,r))}function Cl(e,t){return e[t]===void 0?e.borderRadius:e[t]}var wl=El(0,.5,kt),Tl=El(.5,.95,lt);function El(e,t,n){return r=>r<e?0:r>t?1:n(dt(e,t,r))}function Dl(e,t,n){let r=Ua(e)?e:ba(e);return r.start(Aa(``,r,t,n)),r.animation}function Ol(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var kl=(e,t)=>e.depth-t.depth,Al=class{constructor(){this.children=[],this.isDirty=!1}add(e){tt(this.children,e),this.isDirty=!0}remove(e){nt(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(kl),this.isDirty=!1,this.children.forEach(e)}};function jl(e,t){let n=B.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(cr(r),e(a-t))};return sr.setup(r,!0),()=>cr(r)}function Ml(e){return Ua(e)?e.get():e}var Nl=class{constructor(){this.members=[]}add(e){tt(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(nt(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(nt(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},Pl={borderRadius:{..._l,applyTo:[...co]},borderTopLeftRadius:_l,borderTopRightRadius:_l,borderBottomLeftRadius:_l,borderBottomRightRadius:_l,boxShadow:vl},Fl={hasAnimatedSinceResize:!0,hasEverUpdated:!1};Object.assign(Tc,{...Pl,...Tc});var Il={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Ll=[``,`X`,`Y`,`Z`],Rl=1e3,zl=0;function Bl(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Vl(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=Ja(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,sr,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Vl(r)}function Hl({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=zl++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Qs.value&&(Il.nodes=Il.calculatedTargetDeltas=Il.calculatedProjections=0),this.nodes.forEach(Gl),this.nodes.forEach(tu),this.nodes.forEach(nu),this.nodes.forEach(Kl),Qs.addProjectionMetrics&&Qs.addProjectionMetrics(Il)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new Al)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new ft),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=vo(t)&&!$s(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;sr.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=jl(i,250),Fl.hasAnimatedSinceResize&&(Fl.hasAnimatedSinceResize=!1,this.nodes.forEach(eu)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||lu,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!fl(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...Sa(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||eu(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),cr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(ru),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Vl(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(Yl),this.nodes.forEach(Jl);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Xl);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Zl),this.nodes.forEach(Ql),this.nodes.forEach($l),this.nodes.forEach(Ul),this.nodes.forEach(Wl)):this.nodes.forEach(Xl),this.clearAllSnapshots();let e=B.now();Bt.delta=rt(0,1e3/60,e-Bt.timestamp),Bt.timestamp=e,Bt.isProcessing=!0,lr.update.process(Bt),lr.preRender.process(Bt),lr.render.process(Bt),Bt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,_s.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ql),this.sharedNodes.forEach(iu)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,sr.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){sr.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!qc(this.snapshot.measuredBox.x)&&!qc(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected||=ic(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!cl(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Xo(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),pu(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return ic();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(hu))){let{scroll:e}=this.root;e&&(os(t.x,e.offset.x),os(t.y,e.offset.y))}return t}removeElementScroll(e){let t=ic();if(Vc(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&Vc(t,e),os(t.x,i.offset.x),os(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||ic();Vc(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(os(r.x,-n.scroll.offset.x),os(r.y,-n.scroll.offset.y)),Xo(n.latestValues)&&ls(r,n.latestValues,n.layout?.layoutBox)}return Xo(this.latestValues)&&ls(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=ic();Vc(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!Xo(n.latestValues))continue;let r;n.instance&&(Yo(n.latestValues)&&n.updateSnapshot(),r=ic(),Vc(r,n.measurePageBox())),ol(t,n.latestValues,n.snapshot?.layoutBox,r)}return Xo(this.latestValues)&&ol(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Bt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=Bt.timestamp;let a=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target=ic(),this.targetWithTransforms=ic()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Qc(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Vc(this.target,this.layout.layoutBox),ns(this.target,this.targetDelta)):Vc(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),Qs.value&&Il.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||Yo(this.parent.latestValues)||Zo(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ic(),this.relativeTargetOrigin=ic(),el(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),Vc(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===Bt.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;Vc(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;as(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=ic());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Hc(this.prevProjectionDelta.x,this.projectionDelta.x),Hc(this.prevProjectionDelta.y,this.projectionDelta.y)),Xc(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!ml(this.projectionDelta.x,this.prevProjectionDelta.x)||!ml(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),Qs.value&&Il.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=nc(),this.projectionDelta=nc(),this.projectionDeltaWithTransform=nc()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=nc();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=ic(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some(cu));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=Bn(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=Bn(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(au(o.x,e.x,n),au(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(el(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),su(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&ul(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=ic(),Vc(f,this.relativeTarget)),c&&(this.animationValues=a,Sl(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(cr(this.pendingAnimation),void 0),this.pendingAnimation=sr.update(()=>{Fl.hasAnimatedSinceResize=!0,this.motionValue||=ba(0),this.motionValue.jump(0,!1),this.currentAnimation=Dl(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),Wr(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Rl),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&mu(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||ic();let t=qc(this.layout.layoutBox.x);i.x.min=e.target.x.min,i.x.max=i.x.min+t;let n=qc(this.layout.layoutBox.y);i.y.min=e.target.y.min,i.y.max=i.y.min+n}Vc(t,i),ls(t,r),Xc(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Nl),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&Bl(`z`,e,r,this.animationValues);for(let t=0;t<Ll.length;t++)Bl(`rotate${Ll[t]}`,e,r,this.animationValues),Bl(`skew${Ll[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=Ml(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=Ml(t?.pointerEvents)||``),this.hasProjected&&!Xo(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=yl(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in Tc){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=Tc[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?Ml(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(Jl),this.root.sharedNodes.clear()}}}function Ul(e){e.updateLayout()}function Wl(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)hl(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=qc(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;Bc(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else mu(i,t.layoutBox,n)&&hl(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=qc(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=nc();Xc(o,n,t.layoutBox);let s=nc();a?Xc(s,e.applyTransform(r,!0),t.measuredBox):Xc(s,n,t.layoutBox);let c=!cl(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=ic();el(s,t.layoutBox,i.layoutBox,o);let c=ic();el(c,n,a.layoutBox,o),fl(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Gl(e){Qs.value&&Il.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Kl(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ql(e){e.clearSnapshot()}function Jl(e){e.clearMeasurements()}function Yl(e){e.isLayoutDirty=!0,e.updateLayout()}function Xl(e){e.isLayoutDirty=!1}function Zl(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Ql(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function $l(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function eu(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function tu(e){e.resolveTargetDelta()}function nu(e){e.calcProjection()}function ru(e){e.resetSkewAndRotation()}function iu(e){e.removeLeadSnapshot()}function au(e,t,n){e.translate=Bn(t.translate,0,n),e.scale=Bn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function ou(e,t,n,r){e.min=Bn(t.min,n.min,r),e.max=Bn(t.max,n.max,r)}function su(e,t,n,r){ou(e.x,t.x,n.x,r),ou(e.y,t.y,n.y,r)}function cu(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var lu={duration:.45,ease:[.4,0,.1,1]},uu=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),du=uu(`applewebkit/`)&&!uu(`chrome/`)?Math.round:lt;function fu(e){e.min=du(e.min),e.max=du(e.max)}function pu(e){fu(e.x),fu(e.y)}function mu(e,t,n){return e===`position`||e===`preserve-aspect`&&!Jc(pl(t),pl(n),.2)}function hu(e){return e!==e.root&&e.scroll?.wasRoot}var gu=Hl({attachResizeListener:(e,t)=>Ol(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),_u={current:void 0},vu=Hl({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!_u.current){let e=new gu({});e.mount(window),e.setOptions({layoutScroll:!0}),_u.current=e}return _u.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),yu=(0,m.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function bu(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function xu(...e){return t=>{let n=!1,r=e.map(e=>{let r=bu(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():bu(e[t],null)}}}}function Su(...e){return m.useCallback(xu(...e),e)}var W=i(),Cu=class extends m.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(_o(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=_o(e)&&e.offsetWidth||0,r=_o(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction}return null}componentDidUpdate(){}render(){return this.props.children}};function wu({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){let o=(0,m.useId)(),s=(0,m.useRef)(null),c=(0,m.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:l}=(0,m.useContext)(yu),u=Su(s,a===!1?void 0:e.props?.ref??e?.ref);return(0,m.useInsertionEffect)(()=>{let{width:e,height:u,top:d,left:f,right:p,bottom:m,direction:h}=c.current;if(t||a===!1||!s.current||!e||!u)return;let g=h===`rtl`,_=n===`left`?g?`right: ${p}`:`left: ${f}`:g?`left: ${f}`:`right: ${p}`,v=r===`bottom`?`bottom: ${m}`:`top: ${d}`;s.current.dataset.motionPopId=o;let y=document.createElement(`style`);l&&(y.nonce=l);let b=i??document.head;return b.appendChild(y),y.sheet&&y.sheet.insertRule(`
4
- [data-motion-pop-id="${o}"] {
5
- position: absolute !important;
6
- width: ${e}px !important;
7
- height: ${u}px !important;
8
- ${_}px !important;
9
- ${v}px !important;
10
- }
11
- `),()=>{s.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[t]),(0,W.jsx)(Cu,{isPresent:t,childRef:s,sizeRef:c,pop:a,children:a===!1?e:m.cloneElement(e,{ref:u})})}var Tu=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=Qe(Eu),d=(0,m.useId)(),f=(0,m.useRef)(n),p=(0,m.useRef)(r);$e(()=>{f.current=n,p.current=r});let h=!0,g=(0,m.useMemo)(()=>(h=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:e=>(u.set(e,!1),()=>{u.delete(e),!f.current&&!u.size&&p.current?.()})}),[n,u,r]);return a&&h&&(g={...g}),(0,m.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),m.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,W.jsx)(wu,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,children:e}),(0,W.jsx)(et.Provider,{value:g,children:e})};function Eu(){return new Map}function Du(e=!0){let t=(0,m.useContext)(et);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,m.useId)();(0,m.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,m.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var Ou=e=>e.key||``;function ku(e){let t=[];return m.Children.forEach(e,e=>{(0,m.isValidElement)(e)&&t.push(e)}),t}var Au=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=Du(o),f=(0,m.useMemo)(()=>ku(e),[e]),p=o&&!u?[]:f.map(Ou),h=(0,m.useRef)(!0),g=Qe(()=>new Map),_=(0,m.useRef)(new Set),[v,y]=(0,m.useState)(f),[b,x]=(0,m.useState)(f);$e(()=>{o&&!u&&!b.length&&d?.()},[u,o,b.length,d]),$e(()=>{h.current=!1;for(let e=0;e<b.length;e++){let t=Ou(b[e]);p.includes(t)?(g.delete(t),_.current.delete(t)):g.get(t)!==!0&&g.set(t,!1)}},[b,p.length,p.join(`-`)]);let S=[];if(f!==v){let e=[...f],t=0;for(let n of b){let r=p.indexOf(Ou(n));r===-1?(e.splice(t++,0,n),S.push(n)):t=r+S.length+1}return S.every(e=>g.get(Ou(e)))?e=f:a===`wait`&&(e=S),x(ku(e)),y(f),null}let{forceRender:C}=(0,m.useContext)(Ze);return(0,W.jsx)(W.Fragment,{children:b.map(e=>{let m=Ou(e),v=o&&!u?!1:f===b||p.includes(m);return(0,W.jsx)(Tu,{isPresent:v,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:v?void 0:()=>{if(_.current.has(m))return;if(g.has(m))_.current.add(m),g.set(m,!0);else return;let e=!0;g.forEach(t=>{t||(e=!1)}),e&&(C?.(),y([]),o&&d?.(),r&&r())},anchorX:s,anchorY:c,children:e},m)})})},ju=(0,m.createContext)({strict:!1}),Mu={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},Nu=!1;function Pu(){if(Nu)return;let e={};for(let t in Mu)e[t]={isEnabled:e=>Mu[t].some(t=>!!e[t])};yc(e),Nu=!0}function Fu(){return Pu(),bc()}function Iu(e){let t=Fu();for(let n in e)t[n]={...t[n],...e[n]};yc(t)}function Lu({children:e,...t}){let n=(0,m.useContext)(yu);t={...n,...t},t.transition=xa(t.transition,n.transition),t.isStatic=Qe(()=>t.isStatic);let r=(0,m.useMemo)(()=>t,[JSON.stringify(t.transition),t.transformPagePoint,t.reducedMotion,t.skipAnimations,t.isValidProp]);return(0,W.jsx)(yu.Provider,{value:r,children:e})}var Ru=(0,m.createContext)({});function zu(e,t){if(uc(e)){let{initial:t,animate:n}=e;return{initial:t===!1||sc(t)?t:void 0,animate:sc(n)?n:void 0}}return e.inherit===!1?{}:t}function Bu(e){let{initial:t,animate:n}=zu(e,(0,m.useContext)(Ru));return(0,m.useMemo)(()=>({initial:t,animate:n}),[Vu(t),Vu(n)])}function Vu(e){return Array.isArray(e)?e.join(` `):e}var Hu=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Uu(e,t,n){for(let r in t)!Ua(t[r])&&!Ec(r,n)&&(e[r]=t[r])}function Wu({transformTemplate:e},t){return(0,m.useMemo)(()=>{let n=Hu();return Fo(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Gu(e,t){let n=e.style||{},r={};return Uu(r,n,e),Object.assign(r,Wu(e,t)),r}function Ku(e,t){let n={},r=Gu(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var qu=()=>({...Hu(),attrs:{}});function Ju(e,t,n,r){let i=(0,m.useMemo)(()=>{let n=qu();return zo(n,t,jc(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};Uu(t,e.style,e),i.style={...t,...i.style}}return i}var Yu=new Set(`animate.exit.variants.initial.style.values.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function Xu(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||Yu.has(e)}function Zu(e,t){return e.startsWith(`on`)?!Xu(e):t?.(e)??!Xu(e)}function Qu(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(Ua(e[a])||(Zu(a,r)||n===!0&&Xu(a)||!t&&!Xu(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]));return i}var $u=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function ed(e){return typeof e!=`string`||e.includes(`-`)?!1:!!($u.indexOf(e)>-1||/[A-Z]/u.test(e))}function td(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??ed(e)?Ju:Ku)(t,r,i,e),l=Qu(t,typeof e==`string`,a,s),u=e===m.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,m.useMemo)(()=>Ua(d)?d.get():d,[d]);return(0,m.createElement)(e,{...u,children:f})}function nd({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:rd(n,r,i,e),renderState:t()}}function rd(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=Ml(a[e]);let{initial:o,animate:s}=e,c=uc(e),l=dc(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!oc(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=Fa(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var id=e=>(t,n)=>{let r=(0,m.useContext)(Ru),i=(0,m.useContext)(et),a=()=>nd(e,t,r,i);return n?a():Qe(a)},ad=id({scrapeMotionValuesFromProps:Dc,createRenderState:Hu}),od=id({scrapeMotionValuesFromProps:Nc,createRenderState:qu}),sd=Symbol.for(`motionComponentSymbol`);function cd(e,t,n){let r=(0,m.useRef)(n);(0,m.useInsertionEffect)(()=>{r.current=n});let i=(0,m.useRef)(null);return(0,m.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var ld=(0,m.createContext)({});function ud(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function dd(e,t,n,r,i,a){let{visualElement:o}=(0,m.useContext)(Ru),s=(0,m.useContext)(ju),c=(0,m.useContext)(et),l=(0,m.useContext)(yu),u=l.reducedMotion,d=l.skipAnimations,f=(0,m.useRef)(null),p=(0,m.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let h=f.current,g=(0,m.useContext)(ld);h&&!h.projection&&i&&(h.type===`html`||h.type===`svg`)&&fd(f.current,n,i,g);let _=(0,m.useRef)(!1);(0,m.useInsertionEffect)(()=>{h&&_.current&&h.update(n,c)});let v=n[qa],y=(0,m.useRef)(!!v&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(v)&&window.MotionHasOptimisedAnimation?.(v));return $e(()=>{p.current&&h&&(h.animationState?.animateChanges(),h.enteringChildren=void 0)},[]),$e(()=>{p.current=!0,h&&(_.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),y.current&&h.animationState&&h.animationState.animateChanges())}),(0,m.useEffect)(()=>{h&&(!y.current&&h.animationState&&h.animationState.animateChanges(),y.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(v)}),!1),h.enteringChildren=void 0)}),h}function fd(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:pd(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&ud(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function pd(e){if(e)return e.options.allowProjection===!1?pd(e.parent):e.projection}function md(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&Iu(r);let a=n?n===`svg`:ed(e),o=a?od:ad;function s(n,s){let c,l={...(0,m.useContext)(yu),...n,layoutId:hd(n)},{isStatic:u,isValidProp:d}=l,f=Bu(n),p=o(n,u);if(!u&&typeof window<`u`){gd(l,r);let t=_d(l);c=t.MeasureLayout,f.visualElement=dd(e,p,l,i,t.ProjectionNode,a)}return(0,W.jsxs)(Ru.Provider,{value:f,children:[c&&f.visualElement?(0,W.jsx)(c,{visualElement:f.visualElement,...l}):null,td(e,n,cd(p,f.visualElement,s),p,u,t,a,d)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,m.forwardRef)(s);return c[sd]=e,c}function hd({layoutId:e}){let t=(0,m.useContext)(Ze).id;return t&&e!==void 0?t+`-`+e:e}function gd(e,t){(0,m.useContext)(ju).strict}function _d(e){let{drag:t,layout:n}=Fu();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function vd(e,t){if(typeof Proxy>`u`)return md;let n=new Map,r=(n,r)=>md(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,md(a,void 0,e,t)),n.get(a))})}var yd=(e,t)=>t.isSVG??ed(e)?new Pc(t):new kc(t,{allowProjection:e!==m.Fragment}),bd=class extends Cc{constructor(e){super(e),e.animationState||=Lc(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();oc(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},xd=0,Sd={animation:{Feature:bd},exit:{Feature:class extends Cc{constructor(){super(...arguments),this.id=xd++}update(){let{presenceContext:e,prevPresenceContext:t,animationState:n}=this.node;if(!e||!n)return;let{isPresent:r,onExitComplete:i}=e,a=t?.isPresent;if(r===a)return;if(r&&a===!1){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=Ia(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive(`exit`,!1);this.exit=void 0;return}let o=this.exit=n.setActive(`exit`,!r);i&&!r&&o.then(()=>{this.exit===o&&(this.exit=!0,i(this.id))})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function Cd(e){return{point:{x:e.pageX,y:e.pageY}}}var wd=e=>t=>Es(t)&&e(t,Cd(t));function Td(e,t,n,r){return Ol(e,t,wd(n),r)}var Ed=({current:e})=>e?e.ownerDocument.defaultView:null,Dd=(e,t)=>Math.abs(e-t);function Od(e,t){let n=Dd(e.x,t.x),r=Dd(e.y,t.y);return Math.sqrt(n**2+r**2)}var kd=new Set([`auto`,`scroll`]),Ad=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=jd(this.lastRawMoveEventInfo,this.transformPagePoint));let e=Nd(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=Od(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:B.now()});let{onStart:i,onMove:a}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a&&a(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=jd(t,this.transformPagePoint),this.hasPendingMove=!0,sr.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=Nd(e.type===`pointercancel`?this.lastMoveEventInfo:jd(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Es(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=jd(Cd(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=Bt;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,Nd(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=ut(Td(this.contextWindow,`pointermove`,this.handlePointerMove,d),Td(this.contextWindow,`pointerup`,this.handlePointerUp,d),Td(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(kd.has(e.overflowX)||kd.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),sr.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),cr(this.updatePoint)}};function jd(e,t){return t?{point:t(e.point)}:e}function Md(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Nd({point:e},t){return{point:e,delta:Md(e,Fd(t)),offset:Md(e,Pd(t)),velocity:Id(t,.1)}}function Pd(e){return e[0]}function Fd(e){return e[e.length-1]}function Id(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=Fd(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>pt(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>pt(t)*2&&(r=e[1]);let a=mt(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Ld(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Bn(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Bn(n,e,r.max):Math.min(e,n)),e}function Rd(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function zd(e,{top:t,left:n,bottom:r,right:i}){return{x:Rd(e.x,n,i),y:Rd(e.y,t,r)}}function Bd(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Vd(e,t){return{x:Bd(e.x,t.x),y:Bd(e.y,t.y)}}function Hd(e,t){let n=.5,r=qc(e),i=qc(t);return i>r?n=dt(t.min,t.max-r,e.min):r>i&&(n=dt(e.min,e.max-i,t.min)),rt(0,1,n)}function Ud(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var Wd=.35;function Gd(e=Wd){return e===!1?e=0:e===!0&&(e=Wd),{x:Kd(e,`left`,`right`),y:Kd(e,`top`,`bottom`)}}function Kd(e,t,n){return{min:qd(e,t),max:qd(e,n)}}function qd(e,t){return typeof e==`number`?e:e[t]||0}var Jd=new WeakMap,Yd=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ic(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(e),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=xs(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),hl(e=>{let t=this.getAxisMotionValue(e).get()||0;if(fn.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=qc(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&sr.update(()=>i(e,t),!1,!0),Ga(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=$d(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&sr.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new Ad(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:Ed(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&sr.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!Qd(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=Ld(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&ud(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?zd(n.layoutBox,e):!1,this.elastic=Gd(t),r!==this.constraints&&!ud(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&hl(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Ud(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!ud(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=ds(n,r.root,this.visualElement.getTransformPagePoint()),a=Vd(r.layout.layoutBox,i);if(t){let e=t(Ko(a));this.hasMutatedConstraints=!!e,e&&(a=Go(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=hl(o=>{if(!Qd(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return Ga(this.visualElement,e),n.start(Aa(e,n,0,t,this.visualElement,!1))}stopAnimation(){hl(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();hl(e=>{if(!Qd(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-Bn(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!ud(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};hl(e=>{let t=this.getAxisMotionValue(e).get();i[e]=Hd({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),hl(t=>{let n=this.getAxisMotionValue(t);if(!Qd(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(Bn(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Jd.set(this.visualElement,this);let e=this.visualElement.current,t=Td(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&As(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();ud(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=Zd(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),sr.read(r);let o=Ol(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(hl(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=Wd,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function Xd(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Zd(e,t,n){let r=Zs(e,Xd(n)),i=Zs(t,Xd(n));return()=>{r(),i()}}function Qd(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function $d(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var ef=class extends Cc{constructor(e){super(e),this.removeGroupControls=lt,this.removeListeners=lt,this.controls=new Yd(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||lt}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},tf=e=>(t,n)=>{e&&sr.update(()=>e(t,n),!1,!0)},nf=class extends Cc{constructor(){super(...arguments),this.removePointerDownListener=lt}onPointerDown(e){this.session=new Ad(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Ed(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:tf(e),onStart:tf(t),onMove:tf(n),onEnd:(e,t)=>{delete this.session,r&&sr.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=Td(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},rf=!1,af=class extends m.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),rf&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Fl.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),rf=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||sr.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),_s.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;rf=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function of(e){let[t,n]=Du(),r=(0,m.useContext)(Ze);return(0,W.jsx)(af,{...e,layoutGroup:r,switchLayoutGroup:(0,m.useContext)(ld),isPresent:t,safeToRemove:n})}var sf={pan:{Feature:nf},drag:{Feature:ef,ProjectionNode:vu,MeasureLayout:of}};function cf(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&sr.postRender(()=>i(t,Cd(t)))}var lf=class extends Cc{mount(){let{current:e}=this.node;e&&(this.unmount=ws(e,(e,t)=>(cf(this.node,t,`Start`),e=>cf(this.node,e,`End`))))}unmount(){}},uf=class extends Cc{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=ut(Ol(this.node.current,`focus`,()=>this.onFocus()),Ol(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function df(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&sr.postRender(()=>i(t,Cd(t)))}var ff=class extends Cc{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=Ls(e,(e,t)=>(df(this.node,t,`Start`),(e,{success:t})=>df(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},pf=new WeakMap,mf=new WeakMap,hf=e=>{let t=pf.get(e.target);t&&t(e)},gf=e=>{e.forEach(hf)};function _f({root:e,...t}){let n=e||document;mf.has(n)||mf.set(n,{});let r=mf.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(gf,{root:e,...t})),r[i]}function vf(e,t,n){let r=_f(t);return pf.set(e,n),r.observe(e),()=>{pf.delete(e),r.unobserve(e)}}var yf={some:0,all:1},bf=class extends Cc{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:yf[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=vf(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(xf(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function xf({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var Sf={inView:{Feature:bf},tap:{Feature:ff},focus:{Feature:uf},hover:{Feature:lf}},Cf={layout:{ProjectionNode:vu,MeasureLayout:of}},wf=vd({...Sd,...Sf,...sf,...Cf},yd);function Tf(){!mc.current&&gc();let[e]=(0,m.useState)(pc.current);return e}function Ef(e){return typeof e==`object`&&!Array.isArray(e)}function Df(e,t,n,r){return e==null?[]:typeof e==`string`&&Ef(t)?bo(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function Of(e,t,n){return e*(t+1)+n*t}function kf(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function Af(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(nt(e,i),r--)}}function jf(e,t,n,r,i,a){Af(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:Bn(i,a,r[o]),easing:Ft(n,o)})}function Mf(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function Nf(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var Pf=`easeInOut`,Ff=20;function If(e,{defaultTransition:t={},...n}={},r,i){let a=t.duration||.3,o=new Map,s=new Map,c={},l=new Map,u=0,d=0,f=0;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o==`string`){l.set(o,d);continue}if(!Array.isArray(o)){l.set(o.name,kf(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=kf(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=zf(e),{delay:l=0,times:u=jr(c),type:p=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:_=0,...v}=n,{ease:y=t.ease||`easeOut`,duration:b}=n,x=typeof l==`function`?l(o,s):l,S=c.length,C=qi(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&Hf(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=pt(b));let r=mr(n,e,C);y=r.ease,b=r.duration}b??=a;let w=d+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&Ar(u,T),c.length===1&&c.unshift(null),m&&`${m}${Ff}`,m&&m<Ff){let e=b>0?_/b:0;b=Of(b,m,_);let t=[...c],n=[...u];y=Array.isArray(y)?[...y]:[y];let r=[...y],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?Ct(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),y.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),y.push(e===0?`linear`:Ft(f,e-1))}Mf(u,m,e)}let E=w+b;jf(r,c,y,u,w,E),g=Math.max(x+b,g),f=Math.max(E,f)};if(Ua(p)){let e=Lf(p,s);_(m,h,Rf(`default`,e))}else{let e=Df(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=Lf(r,s);for(let e in m)_(m[e],Bf(h,e),Rf(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(Nf);let s=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];s.push(n),c.push(dt(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(Pf)),c[c.length-1]!==1&&(c.push(1),s.push(null)),o.has(r)||o.set(r,{keyframes:{},transition:{}});let u=o.get(r);u.keyframes[i]=s;let{type:d,...p}=t;u.transition[i]={...p,duration:f,ease:l,times:c,...n}}}),o}function Lf(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function Rf(e,t){return t[e]||(t[e]=[]),t[e]}function zf(e){return Array.isArray(e)?e:[e]}function Bf(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var Vf=e=>typeof e==`number`,Hf=e=>e.every(Vf);function Uf(e,t){return Ua(e)||typeof e==`number`||typeof e==`string`&&!Ef(t)}function Wf(e,t,n,r){let i=[];if(Uf(e,t))i.push(Dl(e,Ef(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=Df(e,t,r),o=a.length;for(let e=0;e<o;e++){let r=a[e],s={...n};`delay`in s&&typeof s.delay==`function`&&(s.delay=s.delay(e,o)),r instanceof Element?i.push(...hs(r,t,s,ac.get(r))):i.push(...ho(po(r)??gs,r,t,s))}}return i}function Gf(e,t,n){let r=[];return If(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=ba(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:Er}).forEach(({keyframes:e,transition:t},n)=>{r.push(...Wf(n,e,t))}),r}function Kf(e){return Array.isArray(e)&&e.some(Array.isArray)}function qf(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=[],s,c={};if(n!==void 0&&(c.reduceMotion=n),r!==void 0&&(c.skipAnimations=r),Kf(e)){let{onComplete:n,...r}=i||{};typeof n==`function`&&(s=n),o=Gf(e,{...c,...r},t)}else{let{onComplete:n,...r}=a||{};typeof n==`function`&&(s=n),o=Wf(e,i,{...c,...r},t)}let l=new ma(o);return s&&l.finished.then(s),t&&(t.animations.push(l),l.finished.then(()=>{nt(t.animations,l)})),l}return i}var Jf=Object.assign(qf(),{addEffect:uo,removeEffect:fo}),Yf=wf,Xf=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&ee(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ee(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function ee(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ee(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Zf=n(((e,t)=>{t.exports=Xf()})),Qf=n((e=>{var t=o();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),s=Symbol.for(`react.recoverable`),c=Symbol.for(`react.optimistic_key`);function l(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===c?c:``+r,children:e,containerInfo:t,implementation:n}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:s,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return l(e,t,null,r)},e.flushSync=function(e){var t=u.T,n=i.p;try{if(u.T=null,i.p=2,e)return e()}finally{u.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return u.H.useFormState(e,t,n)},e.useFormStatus=function(){return u.H.useHostTransitionStatus()},e.version=`19.3.0`})),$f=n(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Qf()})),ep=n((e=>{var t=Zf(),n=o(),r=$f();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(s(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var o=a.alternate;if(o===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return u(a),e;if(o===r)return u(a),t;o=o.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=o;else{for(var c=!1,l=a.child;l;){if(l===n){c=!0,n=a,r=o;break}if(l===r){c=!0,r=a,n=o;break}l=l.sibling}if(!c){for(l=o.child;l;){if(l===n){c=!0,n=o,r=a;break}if(l===r){c=!0,r=o,n=a;break}l=l.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}function p(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&p(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function m(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function h(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function g(e){var t=[null,null],n=m(e);return n===null||_(t,e,n.child,{foundSelf:!1}),t}function _(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&_(e,t,n.child,r))return!0;n=n.sibling}return!1}function v(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var y=null,b=null;function x(e,t,n){return e===n||e===t&&(y=e,!0)}function S(e,t,n){return e===n?(b=e,!1):e===t&&(b!==null&&(y=e),!0)}function C(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function w(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var T=Object.assign,E=Symbol.for(`react.element`),D=Symbol.for(`react.transitional.element`),O=Symbol.for(`react.portal`),k=Symbol.for(`react.fragment`),A=Symbol.for(`react.strict_mode`),ee=Symbol.for(`react.profiler`),j=Symbol.for(`react.consumer`),M=Symbol.for(`react.context`),N=Symbol.for(`react.forward_ref`),P=Symbol.for(`react.suspense`),F=Symbol.for(`react.suspense_list`),te=Symbol.for(`react.memo`),ne=Symbol.for(`react.lazy`),re=Symbol.for(`react.activity`),ie=Symbol.for(`react.legacy_hidden`),ae=Symbol.for(`react.memo_cache_sentinel`),oe=Symbol.for(`react.view_transition`),se=Symbol.for(`react.recoverable`),ce=Symbol.iterator;function I(e){return typeof e!=`object`||!e?null:(e=ce&&e[ce]||e[`@@iterator`],typeof e==`function`?e:null)}var le=Symbol.for(`react.client.reference`);function ue(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===le?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case k:return`Fragment`;case ee:return`Profiler`;case A:return`StrictMode`;case P:return`Suspense`;case F:return`SuspenseList`;case re:return`Activity`;case oe:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case O:return`Portal`;case M:return e.displayName||`Context`;case j:return(e._context.displayName||`Context`)+`.Consumer`;case N:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case te:return t=e.displayName||null,t===null?ue(e.type)||`Memo`:t;case ne:t=e._payload,e=e._init;try{return ue(e(t))}catch{}}return null}var de=Array.isArray,L=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fe={pending:!1,data:null,method:null,action:null},pe=[],me=-1;function he(e){return{current:e}}function ge(e){0>me||(e.current=pe[me],pe[me]=null,me--)}function _e(e,t){me++,pe[me]=e.current,e.current=t}var ve=he(null),ye=he(null),be=he(null),z=he(null);function xe(e,t){switch(_e(be,t),_e(ye,e),_e(ve,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?_p(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=_p(t),e=vp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ge(ve),_e(ve,e)}function Se(){ge(ve),ge(ye),ge(be)}function Ce(e){var t=e.memoizedState;t!==null&&(ph._currentValue=t.memoizedState,_e(z,e)),t=ve.current;var n=vp(t,e.type);t!==n&&(_e(ye,e),_e(ve,n))}function we(e){ye.current===e&&(ge(ve),ge(ye)),z.current===e&&(ge(z),ph._currentValue=fe)}var Te,Ee;function De(e){if(Te===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Te=t&&t[1]||``,Ee=-1<e.stack.indexOf(`
12
- at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
13
- `+Te+e+Ee}var Oe=!1;function ke(e,t){if(!e||Oe)return``;Oe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
14
- `),l=s.split(`
15
- `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
16
- `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Oe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?De(n):``}function Ae(e,t){switch(e.tag){case 26:case 27:case 5:return De(e.type);case 16:return De(`Lazy`);case 13:return e.child!==t&&t!==null?De(`Suspense Fallback`):De(`Suspense`);case 19:return De(`SuspenseList`);case 0:case 15:return ke(e.type,!1);case 11:return ke(e.type.render,!1);case 1:return ke(e.type,!0);case 31:return De(`Activity`);case 30:return De(`ViewTransition`);default:return``}}function je(e){try{var t=``,n=null;do t+=Ae(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
17
- Error generating stack: `+e.message+`
18
- `+e.stack}}var Me=Object.prototype.hasOwnProperty,Ne=t.unstable_scheduleCallback,Pe=t.unstable_cancelCallback,Fe=t.unstable_shouldYield,Ie=t.unstable_requestPaint,Le=t.unstable_now,Re=t.unstable_getCurrentPriorityLevel,ze=t.unstable_ImmediatePriority,Be=t.unstable_UserBlockingPriority,Ve=t.unstable_NormalPriority,He=t.unstable_LowPriority,Ue=t.unstable_IdlePriority,We=t.log,Ge=t.unstable_setDisableYieldValue,Ke=null,qe=null;function Je(e){if(typeof We==`function`&&Ge(e),qe&&typeof qe.setStrictMode==`function`)try{qe.setStrictMode(Ke,e)}catch{}}var Ye=Math.clz32?Math.clz32:Qe,Xe=Math.log,Ze=Math.LN2;function Qe(e){return e>>>=0,e===0?32:31-(Xe(e)/Ze|0)|0}var $e=256,et=262144,tt=4194304;function nt(e){var t=e&42;if(t!==0)return t;switch(e&-e){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function rt(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=nt(n))):i=nt(o):i=nt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=nt(n))):i=nt(o)):i=nt(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function it(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function at(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Ye(n),i=1<<r;t|=e[r],n&=~i}return t}function ot(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function st(){var e=tt;return tt<<=1,!(tt&62914560)&&(tt=4194304),e}function ct(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function lt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ut(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ye(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&dt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function dt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ye(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ft(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ye(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function pt(e,t){var n=t&-t;return n=n&42?1:mt(n),(n&(e.suspendedLanes|t))===0?n:0}function mt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ht(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function gt(){var e=R.p;return e===0?(e=window.event,e===void 0?32:kh(e.type)):e}function _t(e,t){var n=R.p;try{return R.p=e,t()}finally{R.p=n}}var vt=Math.random().toString(36).slice(2),yt=`__reactFiber$`+vt,bt=`__reactProps$`+vt,xt=`__reactContainer$`+vt,St=`__reactEvents$`+vt,Ct=`__reactListeners$`+vt,wt=`__reactHandles$`+vt,Tt=`__reactResources$`+vt,Et=`__reactMarker$`+vt,Dt=`__reactLoad$`+vt;function Ot(e){delete e[yt],delete e[bt],delete e[Ct],delete e[wt]}function kt(e){var t;if(t=e[yt])return t;for(var n=e.parentNode;n;){if(t=n[xt]||n[yt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=vm(e);e!==null;){if(n=e[yt])return n;e=vm(e)}return t}e=n,n=e.parentNode}return null}function At(e){if(e=e[yt]||e[xt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function jt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Mt(e){var t=e[Tt];return t||=e[Tt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Nt(e){e[Et]=!0}function Pt(e){e[Dt]=void 0}var Ft=new Set,It={};function Lt(e,t){Rt(e,t),Rt(e+`Capture`,t)}function Rt(e,t){for(It[e]=t,e=0;e<t.length;e++)Ft.add(t[e])}var zt=RegExp(`^[: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]*$`),Bt={},Vt={};function Ht(e){return Me.call(Vt,e)?!0:Me.call(Bt,e)?!1:zt.test(e)?Vt[e]=!0:(Bt[e]=!0,!1)}var B=!1;function Ut(){var e=B;return B=!1,e}function Wt(e,t,n){if(Ht(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Gt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Kt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function qt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Jt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Yt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Xt(e){if(!e._valueTracker){var t=Jt(e)?`checked`:`value`;e._valueTracker=Yt(e,t,``+e[t])}}function Zt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Jt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var Qt=/[\n"\\]/g;function $t(e){return e.replace(Qt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function en(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+qt(t)):e.value!==``+qt(t)&&(e.value=``+qt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):nn(e,qt(n)):o===`number`&&e.value==t?nn(e,qt(e.value)):nn(e,qt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+qt(s):e.removeAttribute(`name`)}function tn(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Xt(e);return}n=n==null?``:``+qt(n),t=t==null?n:``+qt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Xt(e)}function nn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function rn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+qt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function an(e,t,n){if(t!=null&&(t=``+qt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+qt(n)}function on(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(de(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=qt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Xt(e)}function sn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var cn=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function ln(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||cn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function un(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,B=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(ln(e,a,r),B=!0)}else for(var o in t)t.hasOwnProperty(o)&&ln(e,o,t[o])}function dn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){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 fn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),V=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function pn(e){return V.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function mn(){}var hn=null;function gn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var _n=null,vn=null;function yn(e){var t=At(e);if(t&&(e=t.stateNode)){var n=e[bt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(en(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+$t(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[bt]||null;if(!a)throw Error(i(90));en(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Zt(r)}break a;case`textarea`:an(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&rn(e,!!n.multiple,t,!1)}}}var bn=!1;function xn(e,t,n){if(bn)return e(t,n);bn=!0;try{return e(t)}finally{if(bn=!1,(_n!==null||vn!==null)&&(Ud(),_n&&(t=_n,e=vn,vn=_n=null,yn(t),e)))for(t=0;t<e.length;t++)yn(e[t])}}function Sn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[bt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var Cn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,wn=!1;if(Cn)try{var Tn={};Object.defineProperty(Tn,"passive",{get:function(){wn=!0}}),window.addEventListener(`test`,Tn,Tn),window.removeEventListener(`test`,Tn,Tn)}catch{wn=!1}var En=null,Dn=null,On=null;function kn(){if(On)return On;var e,t=Dn,n=t.length,r,i=`value`in En?En.value:En.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return On=i.slice(e,1<r?1-r:void 0)}function An(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function jn(){return!0}function Mn(){return!1}function Nn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?jn:Mn,this.isPropagationStopped=Mn,this}return T(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=jn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=jn)},persist:function(){},isPersistent:jn}),t}var Pn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fn=Nn(Pn),In=T({},Pn,{view:0,detail:0}),Ln=Nn(In),Rn,zn,Bn,Vn=T({},In,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Qn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Bn&&(Bn&&e.type===`mousemove`?(Rn=e.screenX-Bn.screenX,zn=e.screenY-Bn.screenY):zn=Rn=0,Bn=e),Rn)},movementY:function(e){return`movementY`in e?e.movementY:zn}}),Hn=Nn(Vn),Un=Nn(T({},Vn,{dataTransfer:0})),Wn=Nn(T({},In,{relatedTarget:0})),Gn=Nn(T({},Pn,{animationName:0,elapsedTime:0,pseudoElement:0})),Kn=Nn(T({},Pn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),qn=Nn(T({},Pn,{data:0})),Jn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Yn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Xn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Zn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Xn[e])?!!t[e]:!1}function Qn(){return Zn}var $n=Nn(T({},In,{key:function(e){if(e.key){var t=Jn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=An(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Yn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Qn,charCode:function(e){return e.type===`keypress`?An(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?An(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),er=Nn(T({},Vn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),tr=Nn(T({},Pn,{submitter:0})),nr=Nn(T({},In,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Qn})),rr=Nn(T({},Pn,{propertyName:0,elapsedTime:0,pseudoElement:0})),ir=Nn(T({},Vn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),ar=Nn(T({},Pn,{newState:0,oldState:0,source:0})),or=[9,13,27,32],sr=Cn&&`CompositionEvent`in window,cr=null;Cn&&`documentMode`in document&&(cr=document.documentMode);var lr=Cn&&`TextEvent`in window&&!cr,ur=Cn&&(!sr||cr&&8<cr&&11>=cr),dr=` `,fr=!1;function pr(e,t){switch(e){case`keyup`:return or.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function mr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var hr=!1;function gr(e,t){switch(e){case`compositionend`:return mr(t);case`keypress`:return t.which===32?(fr=!0,dr):null;case`textInput`:return e=t.data,e===dr&&fr?null:e;default:return null}}function _r(e,t){if(hr)return e===`compositionend`||!sr&&pr(e,t)?(e=kn(),On=Dn=En=null,hr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return ur&&t.locale!==`ko`?null:t.data;default:return null}}var vr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function yr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!vr[e.type]:t===`textarea`}function br(e,t,n,r){_n?vn?vn.push(r):vn=[r]:_n=r,t=np(t,`onChange`),0<t.length&&(n=new Fn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var xr=null,Sr=null;function Cr(e){Kf(e,0)}function wr(e){if(Zt(jt(e)))return e}function Tr(e,t){if(e===`change`)return t}var Er=!1;if(Cn){var Dr;if(Cn){var Or=`oninput`in document;if(!Or){var kr=document.createElement(`div`);kr.setAttribute(`oninput`,`return;`),Or=typeof kr.oninput==`function`}Dr=Or}else Dr=!1;Er=Dr&&(!document.documentMode||9<document.documentMode)}function Ar(){xr&&(xr.detachEvent(`onpropertychange`,jr),Sr=xr=null)}function jr(e){if(e.propertyName===`value`&&wr(Sr)){var t=[];br(t,Sr,e,gn(e)),xn(Cr,t)}}function Mr(e,t,n){e===`focusin`?(Ar(),xr=t,Sr=n,xr.attachEvent(`onpropertychange`,jr)):e===`focusout`&&Ar()}function Nr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return wr(Sr)}function Pr(e,t){if(e===`click`)return wr(t)}function Fr(e,t){if(e===`input`||e===`change`)return wr(t)}function Ir(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Lr=typeof Object.is==`function`?Object.is:Ir;function Rr(e,t){if(Lr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Me.call(t,i)||!Lr(e[i],t[i]))return!1}return!0}function zr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Br(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Vr(e,t){var n=Br(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Br(n)}}function Hr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Hr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ur(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=zr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=zr(e.document)}return t}function Wr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Gr=Cn&&`documentMode`in document&&11>=document.documentMode,Kr=null,qr=null,Jr=null,Yr=!1;function Xr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Yr||Kr==null||Kr!==zr(r)||(r=Kr,`selectionStart`in r&&Wr(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}),Jr&&Rr(Jr,r)||(Jr=r,r=np(qr,`onSelect`),0<r.length&&(t=new Fn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Kr)))}function Zr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Qr={animationend:Zr(`Animation`,`AnimationEnd`),animationiteration:Zr(`Animation`,`AnimationIteration`),animationstart:Zr(`Animation`,`AnimationStart`),transitionrun:Zr(`Transition`,`TransitionRun`),transitionstart:Zr(`Transition`,`TransitionStart`),transitioncancel:Zr(`Transition`,`TransitionCancel`),transitionend:Zr(`Transition`,`TransitionEnd`)},$r={},ei={};Cn&&(ei=document.createElement(`div`).style,`AnimationEvent`in window||(delete Qr.animationend.animation,delete Qr.animationiteration.animation,delete Qr.animationstart.animation),`TransitionEvent`in window||delete Qr.transitionend.transition);function ti(e){if($r[e])return $r[e];if(!Qr[e])return e;var t=Qr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ei)return $r[e]=t[n];return e}var ni=ti(`animationend`),ri=ti(`animationiteration`),ii=ti(`animationstart`),ai=ti(`transitionrun`),oi=ti(`transitionstart`),si=ti(`transitioncancel`),ci=ti(`transitionend`),li=new Map,ui=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);ui.push(`scrollEnd`);function di(e,t){li.set(e,t),Lt(t,[e])}var fi=0;function pi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=wd.identifierPrefix;var n=fi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function mi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Md;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function hi(e,t){return e=mi(e),t=mi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var gi=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},_i=[],vi=0,yi=0;function bi(){for(var e=vi,t=yi=vi=0;t<e;){var n=_i[t];_i[t++]=null;var r=_i[t];_i[t++]=null;var i=_i[t];_i[t++]=null;var a=_i[t];if(_i[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&wi(n,i,a)}}function xi(e,t,n,r){_i[vi++]=e,_i[vi++]=t,_i[vi++]=n,_i[vi++]=r,yi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Si(e,t,n,r){return xi(e,t,n,r),Ti(e)}function Ci(e,t){return xi(e,null,null,t),Ti(e)}function wi(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ye(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ti(e){if(50<Nd)throw Nd=0,Pd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ei={};function Di(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,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 Oi(e,t,n,r){return new Di(e,t,n,r)}function ki(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ai(e,t){var n=e.alternate;return n===null?(n=Oi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ji(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Mi(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)ki(r)&&(s=1);else if(typeof r==`string`)s=$m(e,n,ve.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case re:return e=Oi(31,n,t,a),e.elementType=re,e.lanes=o,e;case k:return Ni(n.children,a,o,t);case A:s=8,a|=24;break;case ee:return e=Oi(12,n,t,a|2),e.elementType=ee,e.lanes=o,e;case P:return e=Oi(13,n,t,a),e.elementType=P,e.lanes=o,e;case F:return e=Oi(19,n,t,a),e.elementType=F,e.lanes=o,e;case ie:case oe:return e=a|32,e=Oi(30,n,t,e),e.elementType=oe,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case M:s=10;break a;case j:s=9;break a;case N:s=11;break a;case te:s=14;break a;case ne:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Oi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Ni(e,t,n,r){return e=Oi(7,e,r,t),e.lanes=n,e}function Pi(e,t,n){return e=Oi(6,e,null,t),e.lanes=n,e}function Fi(e){var t=Oi(18,null,null,0);return t.stateNode=e,t}function Ii(e,t,n){return t=Oi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Li=new WeakMap;function Ri(e,t){if(typeof e==`object`&&e){var n=Li.get(e);return n===void 0?(t={value:e,source:t,stack:je(t)},Li.set(e,t),t):n}return{value:e,source:t,stack:je(t)}}var zi=[],Bi=0,Vi=null,Hi=0,Ui=[],Wi=0,Gi=null,Ki=1,qi=``;function Ji(e,t){zi[Bi++]=Hi,zi[Bi++]=Vi,Vi=e,Hi=t}function Yi(e,t,n){Ui[Wi++]=Ki,Ui[Wi++]=qi,Ui[Wi++]=Gi,Gi=e;var r=Ki;e=qi;var i=32-Ye(r)-1;r&=~(1<<i),n+=1;var a=32-Ye(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ki=1<<32-Ye(t)+i|n<<i|r,qi=a+e}else Ki=1<<a|n<<i|r,qi=e}function Xi(e){e.return!==null&&(Ji(e,1),Yi(e,1,0))}function Zi(e){for(;e===Vi;)Vi=zi[--Bi],zi[Bi]=null,Hi=zi[--Bi],zi[Bi]=null;for(;e===Gi;)Gi=Ui[--Wi],Ui[Wi]=null,qi=Ui[--Wi],Ui[Wi]=null,Ki=Ui[--Wi],Ui[Wi]=null}function Qi(e,t){Ui[Wi++]=Ki,Ui[Wi++]=qi,Ui[Wi++]=Gi,Ki=t.id,qi=t.overflow,Gi=e}var $i=null,ea=null,H=!1,ta=null,na=!1,ra=Error(i(519));function ia(e){throw ua(Ri(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ra}function aa(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[yt]=e,t[bt]=r,n){case`dialog`:qf(`cancel`,t),qf(`close`,t);break;case`iframe`:case`object`:case`embed`:qf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Wf.length;n++)qf(Wf[n],t);break;case`source`:qf(`error`,t);break;case`img`:case`image`:case`link`:qf(`error`,t),qf(`load`,t);break;case`details`:qf(`toggle`,t);break;case`input`:qf(`invalid`,t),tn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:qf(`invalid`,t);break;case`textarea`:qf(`invalid`,t),on(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||cp(t.textContent,n)?(r.popover!=null&&(qf(`beforetoggle`,t),qf(`toggle`,t)),r.onScroll!=null&&qf(`scroll`,t),r.onScrollEnd!=null&&qf(`scrollend`,t),r.onClick!=null&&(t.onclick=mn),t=!0):t=!1,t||ia(e,!0)}function oa(e){for($i=e.return;$i;)switch($i.tag){case 5:case 31:case 13:na=!1;return;case 27:case 3:na=!0;return;default:$i=$i.return}}function sa(e){if(e!==$i)return!1;if(!H)return oa(e),H=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||bp(e.type,e.memoizedProps)),n=!n),n&&ea&&ia(e),oa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ea=_m(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ea=_m(e)}else t===27?(t=ea,Op(e.type)?(e=gm,gm=null,ea=e):ea=t):ea=$i?hm(e.stateNode.nextSibling):null;return!0}function ca(){ea=$i=null,H=!1}function la(){var e=ta;return e!==null&&(gd===null?gd=e:gd.push.apply(gd,e),ta=null),e}function ua(e){ta===null?ta=[e]:ta.push(e)}var da=he(null),fa=null,pa=null;function ma(e,t,n){_e(da,t._currentValue),t._currentValue=n}function ha(e){e._currentValue=da.current,ge(da)}function ga(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function _a(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),ga(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),ga(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),ga(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function va(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Lr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===z.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ph]:e.push(ph))}a=a.return}return e!==null&&_a(t,e,n,r),t.flags|=262144,e!==null}function ya(e){for(e=e.firstContext;e!==null;){if(!Lr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ba(e){fa=e,pa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function xa(e){return Ca(fa,e)}function Sa(e,t){return fa===null&&ba(e),Ca(e,t)}function Ca(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},pa===null){if(e===null)throw Error(i(308));pa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else pa=pa.next=t;return n}var wa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Ta=t.unstable_scheduleCallback,Ea=t.unstable_NormalPriority,Da={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Oa(){return{controller:new wa,data:new Map,refCount:0}}function ka(e){e.refCount--,e.refCount===0&&Ta(Ea,function(){e.controller.abort()})}function Aa(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var ja=null;function Ma(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Na=null,Pa=0,Fa=0,Ia=null;function La(e,t){if(Na===null){var n=Na=[];Pa=0,Fa=zf(),Ia={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Pa++,t.then(Ra,Ra),t}function Ra(){if(--Pa===0&&(ja=null,Na!==null)){Ia!==null&&(Ia.status=`fulfilled`);var e=Na;Na=null,Fa=0,Ia=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function za(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Ba=L.S;L.S=function(e,t){if(yd=Le(),typeof t==`object`&&t&&typeof t.then==`function`&&La(e,t),ja!==null)for(var n=Tf;n!==null;)Aa(n,ja),n=n.next;if(n=e.types,n!==null){for(var r=Tf;r!==null;)Aa(r,n),r=r.next;if(Fa!==0){r=ja,r===null&&(r=ja=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ba!==null&&Ba(e,t)};var Va=he(null);function Ha(){var e=Va.current;return e===null?ed.pooledCache:e}function Ua(e,t){t===null?_e(Va,Va.current):_e(Va,t.pool)}function Wa(){var e=Ha();return e===null?null:{parent:Da._currentValue,pool:e}}var Ga=Error(i(460)),Ka=Error(i(474)),qa=Error(i(542)),Ja={then:function(){}};function Ya(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Xa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(mn,mn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,eo(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(mn,mn);else{if(e=ed,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,eo(e),e}throw Qa=t,Ga}}function Za(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Qa=e,Ga):e}}var Qa=null;function $a(){if(Qa===null)throw Error(i(459));var e=Qa;return Qa=null,e}function eo(e){if(e===Ga||e===qa)throw Error(i(483))}var to=null,no=0;function ro(e){var t=no;return no+=1,to===null&&(to=[]),Xa(to,e,t)}function io(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function ao(e,t){throw t.$$typeof===E?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function oo(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Ai(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Pi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===k?(e=d(e,t,n.props.children,r,n.key),io(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===ne&&Za(i)===t.type)?(t=a(t,n.props),io(t,n),t.return=e,t):(t=Mi(n.type,n.key,n.props,null,e.mode,r),io(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Ii(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Ni(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Pi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case D:return n=Mi(t.type,t.key,t.props,null,e.mode,n),io(n,t),n.return=e,n;case O:return t=Ii(t,e.mode,n),t.return=e,t;case ne:return t=Za(t),f(e,t,n)}if(de(t)||I(t))return t=Ni(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,ro(t),n);if(t.$$typeof===M)return f(e,Sa(e,t),n);ao(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case D:return n.key===i?l(e,t,n,r):null;case O:return n.key===i?u(e,t,n,r):null;case ne:return n=Za(n),p(e,t,n,r)}if(de(n)||I(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,ro(n),r);if(n.$$typeof===M)return p(e,t,Sa(e,n),r);ao(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case D:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case O:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case ne:return r=Za(r),m(e,t,n,r,i)}if(de(r)||I(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,ro(r),i);if(r.$$typeof===M)return m(e,t,n,Sa(t,r),i);ao(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),H&&Ji(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return H&&Ji(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),H&&Ji(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),H&&Ji(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return H&&Ji(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),H&&Ji(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===k&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case D:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===k){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),io(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ne&&Za(l)===r.type){n(e,r.sibling),c=a(r,o.props),io(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===k?(c=Ni(o.props.children,e.mode,c,o.key),io(c,o),c.return=e,e=c):(c=Mi(o.type,o.key,o.props,null,e.mode,c),io(c,o),c.return=e,e=c)}return s(e);case O:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Ii(o,e.mode,c),c.return=e,e=c}return s(e);case ne:return o=Za(o),_(e,r,o,c)}if(de(o))return h(e,r,o,c);if(I(o)){if(l=I(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,ro(o),c);if(o.$$typeof===M)return _(e,r,Sa(e,o),c);ao(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Pi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{no=0;var i=_(e,t,n,r);return to=null,i}catch(t){if(t===Ga||t===qa)throw t;var a=Oi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var so=oo(!0),co=oo(!1),lo=!1;function uo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function po(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function mo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,$u&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ti(e),wi(e,null,n),t}return xi(e,r,t,n),Ti(e)}function ho(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ft(e,n)}}function go(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var _o=!1;function vo(){if(_o){var e=Ia;if(e!==null)throw e}}function yo(e,t,n,r){_o=!1;var i=e.updateQueue;lo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(nd&f)===f:(r&f)===f){f!==0&&f===Fa&&(_o=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=T({},d,f);break a;case 2:lo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),ud|=o,e.lanes=o,e.memoizedState=d}}function bo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function xo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)bo(n[e],t)}var So=he(null),Co=he(0);function wo(e,t){e=cd,_e(Co,e),_e(So,t),cd=e|t.baseLanes}function To(){_e(Co,cd),_e(So,So.current)}function Eo(){cd=Co.current,ge(So),ge(Co)}var Do=he(null),Oo=null;function ko(e){var t=e.alternate;_e(Po,Po.current&1),_e(Do,e),Oo===null&&(t===null||So.current!==null||t.memoizedState!==null)&&(Oo=e)}function Ao(e){_e(Po,Po.current),_e(Do,e),Oo===null&&(Oo=e)}function jo(e){e.tag===22?(_e(Po,Po.current),_e(Do,e),Oo===null&&(Oo=e)):Mo()}function Mo(){_e(Po,Po.current),_e(Do,Do.current)}function No(e){ge(Do),Oo===e&&(Oo=null),ge(Po)}var Po=he(0);function Fo(e,t){_e(Do,Do.current),_e(Po,t)}function Io(e){ge(Po),ge(Do),Oo===e&&(Oo=null)}function Lo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||fm(n)||pm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ro=0,U=null,zo=null,Bo=null,Vo=!1,Ho=!1,Uo=!1,Wo=0,Go=0,Ko=null,qo=0;function Jo(){throw Error(i(321))}function Yo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Lr(e[n],t[n]))return!1;return!0}function Xo(e,t,n,r,i,a){return Ro=a,U=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,L.H=e===null||e.memoizedState===null?pc:mc,Uo=!1,a=n(r,i),Uo=!1,Ho&&(a=Qo(t,n,r,i)),Zo(e),a}function Zo(e){L.H=fc;var t=zo!==null&&zo.next!==null;if(Ro=0,Bo=zo=U=null,Vo=!1,Go=0,Ko=null,t)throw Error(i(300));e===null||jc||(e=e.dependencies,e!==null&&ya(e)&&(jc=!0))}function Qo(e,t,n,r){U=e;var a=0;do{if(Ho&&(Ko=null),Go=0,Ho=!1,25<=a)throw Error(i(301));if(a+=1,Bo=zo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}L.H=hc,o=t(n,r)}while(Ho);return o}function $o(){var e=L.H,t=e.useState()[0];return t=typeof t.then==`function`?os(t):t,e=e.useState()[0],(zo===null?null:zo.memoizedState)!==e&&(U.flags|=1024),t}function es(){var e=Wo!==0;return Wo=0,e}function ts(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ns(e){if(Vo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Vo=!1}Ro=0,Bo=zo=U=null,Ho=!1,Go=Wo=0,Ko=null}function rs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bo===null?U.memoizedState=Bo=e:Bo=Bo.next=e,Bo}function is(){if(zo===null){var e=U.alternate;e=e===null?null:e.memoizedState}else e=zo.next;var t=Bo===null?U.memoizedState:Bo.next;if(t!==null)Bo=t,zo=e;else{if(e===null)throw U.alternate===null?Error(i(467)):Error(i(310));zo=e,e={memoizedState:zo.memoizedState,baseState:zo.baseState,baseQueue:zo.baseQueue,queue:zo.queue,next:null},Bo===null?U.memoizedState=Bo=e:Bo=Bo.next=e}return Bo}function as(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function os(e){var t=Go;return Go+=1,Ko===null&&(Ko=[]),e=Xa(Ko,e,t),t=U,(Bo===null?t.memoizedState:Bo.next)===null&&(t=t.alternate,L.H=t===null||t.memoizedState===null?pc:mc),e}function ss(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return os(e);if(e.$$typeof===se)return;if(e.$$typeof===M)return xa(e)}throw Error(i(438,String(e)))}function cs(e){var t=null,n=U.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=U.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=as(),U.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ae;return t.index++,n}function ls(e,t){return typeof t==`function`?t(e):t}function us(e){return ds(is(),zo,e)}function ds(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Ro&f)===f:(nd&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Fa&&(d=!0);else if((Ro&p)===p){u=u.next,p===Fa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,U.lanes|=p,ud|=p;f=u.action,Uo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,U.lanes|=f,ud|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Lr(o,e.memoizedState)&&(jc=!0,d&&(n=Ia,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function fs(e){var t=is(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Lr(o,t.memoizedState)||(jc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ps(e,t,n){var r=U,a=is(),o=H;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Lr((zo||a).memoizedState,n);if(s&&(a.memoizedState=n,jc=!0),a=a.queue,Rs(gs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Bo!==null&&!!(Bo.memoizedState.tag&1),Ns(e?9:8,{destroy:void 0},hs.bind(null,r,a,n,t),null),e){if(r.flags|=2048,ed===null)throw Error(i(349));o||Ro&127||ms(r,t,n)}return n}function ms(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=U.updateQueue,t===null?(t=as(),U.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function hs(e,t,n,r){t.value=n,t.getSnapshot=r,_s(t)&&vs(e)}function gs(e,t,n){return n(function(){_s(t)&&vs(e)})}function _s(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Lr(e,n)}catch{return!0}}function vs(e){var t=Ci(e,2);t!==null&&Rd(t,e,2)}function ys(e){var t=rs();if(typeof e==`function`){var n=e;if(e=n(),Uo){Je(!0);try{n()}finally{Je(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:e},t}function bs(e,t,n,r){return e.baseState=n,ds(e,zo,typeof r==`function`?r:ls)}function xs(e,t,n,r,a){if(lc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};L.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ss(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ss(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=L.T,o={};o.types=a===null?null:a.types,L.T=o;try{var s=n(i,r),c=L.S;c!==null&&c(o,s),Cs(e,t,s)}catch(n){Ts(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),L.T=a}}else try{a=n(i,r),Cs(e,t,a)}catch(n){Ts(e,t,n)}}function Cs(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){ws(e,t,n)},function(n){return Ts(e,t,n)}):ws(e,t,n)}function ws(e,t,n){t.status=`fulfilled`,t.value=n,Es(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ss(e,n)))}function Ts(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Es(t),t=t.next;while(t!==r)}e.action=null}function Es(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ds(e,t){return t}function Os(e,t){if(H){var n=ed.formState;if(n!==null){a:{var r=U;if(H){if(ea){b:{for(var i=ea,a=na;i.nodeType!==8;){if(!a){i=null;break b}if(i=hm(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ea=hm(i.nextSibling),r=i.data===`F!`;break a}}ia(r)}r=!1}r&&(t=n[0])}}return n=rs(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ds,lastRenderedState:t},n.queue=r,n=oc.bind(null,U,r),r.dispatch=n,r=ys(!1),a=cc.bind(null,U,!1,r.queue),r=rs(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=xs.bind(null,U,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ks(e){return As(is(),zo,e)}function As(e,t,n){if(t=ds(e,t,Ds)[0],e=us(ls)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=os(t)}catch(e){throw e===Ga?qa:e}else r=t;t=is();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(U.flags|=2048,Ns(9,{destroy:void 0},js.bind(null,i,n),null)),[r,a,e]}function js(e,t){e.action=t}function Ms(e){var t=is(),n=zo;if(n!==null)return As(t,n,e);is(),t=t.memoizedState,n=is();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ns(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=U.updateQueue,t===null&&(t=as(),U.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Ps(){return is().memoizedState}function Fs(e,t,n,r){var i=rs();U.flags|=e,i.memoizedState=Ns(1|t,{destroy:void 0},n,r===void 0?null:r)}function Is(e,t,n,r){var i=is();r=r===void 0?null:r;var a=i.memoizedState.inst;zo!==null&&r!==null&&Yo(r,zo.memoizedState.deps)?i.memoizedState=Ns(t,a,n,r):(U.flags|=e,i.memoizedState=Ns(1|t,a,n,r))}function Ls(e,t){Fs(8390656,8,e,t)}function Rs(e,t){Is(2048,8,e,t)}function zs(e){U.flags|=4;var t=U.updateQueue;if(t===null)t=as(),U.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Bs(e){var t=is().memoizedState;return zs({ref:t,nextImpl:e}),function(){if($u&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Vs(e,t){return Is(4,2,e,t)}function Hs(e,t){return Is(4,4,e,t)}function Us(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ws(e,t,n){n=n==null?null:n.concat([e]),Is(4,4,Us.bind(null,t,e),n)}function Gs(){}function Ks(e,t){var n=is();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Yo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function qs(e,t){var n=is();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Yo(t,r[1]))return r[0];if(r=e(),Uo){Je(!0);try{e()}finally{Je(!1)}}return n.memoizedState=[r,t],r}function Js(e,t,n){return n===void 0||Ro&1073741824&&!(nd&261930)?e.memoizedState=t:(e.memoizedState=n,e=Id(),U.lanes|=e,ud|=e,n)}function Ys(e,t,n,r){return Lr(n,t)?n:So.current===null?!(Ro&106)||Ro&1073741824&&!(nd&261930)?(jc=!0,e.memoizedState=n):(e=Id(),U.lanes|=e,ud|=e,t):(e=Js(e,n,r),Lr(e,t)||(jc=!0),e)}function Xs(e,t,n,r,i){var a=R.p;R.p=a!==0&&8>a?a:8;var o=L.T,s={};s.types=o===null?null:o.types,L.T=s,cc(e,!1,t,n);try{var c=i(),l=L.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?sc(e,t,za(c,r),Fd(e)):sc(e,t,r,Fd(e))}catch(n){sc(e,t,{then:function(){},status:`rejected`,reason:n},Fd())}finally{R.p=a,o!==null&&s.types!==null&&(o.types=s.types),L.T=o}}function Zs(){}function Qs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=$s(e).queue;Xs(e,a,t,fe,n===null?Zs:function(){return ec(e),n(r)})}function $s(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:fe,baseState:fe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:fe},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ec(e){var t=$s(e);t.next===null&&(t=e.alternate.memoizedState),sc(e,t.next.queue,{},Fd())}function tc(){return xa(ph)}function nc(){return is().memoizedState}function rc(){return is().memoizedState}function ic(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Fd();e=po(n);var r=mo(t,e,n);r!==null&&(Rd(r,t,n),ho(r,t,n)),t={cache:Oa()},e.payload=t;return}t=t.return}}function ac(e,t,n){var r=Fd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},lc(e)?uc(t,n):(n=Si(e,t,n,r),n!==null&&(Rd(n,e,r),dc(n,t,r)))}function oc(e,t,n){sc(e,t,n,Fd())}function sc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(lc(e))uc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Lr(s,o))return xi(e,t,i,0),ed===null&&bi(),!1}catch{}if(n=Si(e,t,i,r),n!==null)return Rd(n,e,r),dc(n,t,r),!0}return!1}function cc(e,t,n,r){if(r={lane:2,revertLane:zf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},lc(e)){if(t)throw Error(i(479))}else t=Si(e,n,r,2),t!==null&&Rd(t,e,2)}function lc(e){var t=e.alternate;return e===U||t!==null&&t===U}function uc(e,t){Ho=Vo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function dc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ft(e,n)}}var fc={readContext:xa,use:ss,useCallback:Jo,useContext:Jo,useEffect:Jo,useImperativeHandle:Jo,useLayoutEffect:Jo,useInsertionEffect:Jo,useMemo:Jo,useReducer:Jo,useRef:Jo,useState:Jo,useDebugValue:Jo,useDeferredValue:Jo,useTransition:Jo,useSyncExternalStore:Jo,useId:Jo,useHostTransitionStatus:Jo,useFormState:Jo,useActionState:Jo,useOptimistic:Jo,useMemoCache:Jo,useCacheRefresh:Jo,useEffectEvent:Jo},pc={readContext:xa,use:ss,useCallback:function(e,t){return rs().memoizedState=[e,t===void 0?null:t],e},useContext:xa,useEffect:Ls,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Fs(4194308,4,Us.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Fs(4194308,4,e,t)},useInsertionEffect:function(e,t){Fs(4,2,e,t)},useMemo:function(e,t){var n=rs();t=t===void 0?null:t;var r=e();if(Uo){Je(!0);try{e()}finally{Je(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=rs();if(n!==void 0){var i=n(t);if(Uo){Je(!0);try{n(t)}finally{Je(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ac.bind(null,U,e),[r.memoizedState,e]},useRef:function(e){var t=rs();return e={current:e},t.memoizedState=e},useState:function(e){e=ys(e);var t=e.queue,n=oc.bind(null,U,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Gs,useDeferredValue:function(e,t){return Js(rs(),e,t)},useTransition:function(){var e=ys(!1);return e=Xs.bind(null,U,e.queue,!0,!1),rs().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=U,a=rs();if(H){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),ed===null)throw Error(i(349));nd&127||ms(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Ls(gs.bind(null,r,o,e),[e]),r.flags|=2048,Ns(9,{destroy:void 0},hs.bind(null,r,o,n,t),null),n},useId:function(){var e=rs(),t=ed.identifierPrefix;if(H){var n=qi,r=Ki;n=(r&~(1<<32-Ye(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Wo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=qo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:tc,useFormState:Os,useActionState:Os,useOptimistic:function(e){var t=rs();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=cc.bind(null,U,!0,n),n.dispatch=t,[e,t]},useMemoCache:cs,useCacheRefresh:function(){return rs().memoizedState=ic.bind(null,U)},useEffectEvent:function(e){var t=rs(),n={impl:e};return t.memoizedState=n,function(){if($u&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},mc={readContext:xa,use:ss,useCallback:Ks,useContext:xa,useEffect:Rs,useImperativeHandle:Ws,useInsertionEffect:Vs,useLayoutEffect:Hs,useMemo:qs,useReducer:us,useRef:Ps,useState:function(){return us(ls)},useDebugValue:Gs,useDeferredValue:function(e,t){return Ys(is(),zo.memoizedState,e,t)},useTransition:function(){var e=us(ls)[0],t=is().memoizedState;return[typeof e==`boolean`?e:os(e),t]},useSyncExternalStore:ps,useId:nc,useHostTransitionStatus:tc,useFormState:ks,useActionState:ks,useOptimistic:function(e,t){return bs(is(),zo,e,t)},useMemoCache:cs,useCacheRefresh:rc,useEffectEvent:Bs},hc={readContext:xa,use:ss,useCallback:Ks,useContext:xa,useEffect:Rs,useImperativeHandle:Ws,useInsertionEffect:Vs,useLayoutEffect:Hs,useMemo:qs,useReducer:fs,useRef:Ps,useState:function(){return fs(ls)},useDebugValue:Gs,useDeferredValue:function(e,t){var n=is();return zo===null?Js(n,e,t):Ys(n,zo.memoizedState,e,t)},useTransition:function(){var e=fs(ls)[0],t=is().memoizedState;return[typeof e==`boolean`?e:os(e),t]},useSyncExternalStore:ps,useId:nc,useHostTransitionStatus:tc,useFormState:Ms,useActionState:Ms,useOptimistic:function(e,t){var n=is();return zo===null?(n.baseState=e,[e,n.queue.dispatch]):bs(n,zo,e,t)},useMemoCache:cs,useCacheRefresh:rc,useEffectEvent:Bs};function gc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:T({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var _c={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Fd(),i=po(r);i.payload=t,n!=null&&(i.callback=n),t=mo(e,i,r),t!==null&&(Rd(t,e,r),ho(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Fd(),i=po(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=mo(e,i,r),t!==null&&(Rd(t,e,r),ho(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Fd(),r=po(n);r.tag=2,t!=null&&(r.callback=t),t=mo(e,r,n),t!==null&&(Rd(t,e,n),ho(t,e,n))}};function vc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Rr(n,r)||!Rr(i,a):!0}function yc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&_c.enqueueReplaceState(t,t.state,null)}function bc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=T({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function xc(e){gi(e)}function Sc(e){console.error(e)}function Cc(e){gi(e)}function wc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Tc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Ec(e,t,n){return n=po(n),n.tag=3,n.payload={element:null},n.callback=function(){wc(e,t)},n}function Dc(e){return e=po(e),e.tag=3,e}function Oc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Tc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Tc(t,n,r),typeof i!=`function`&&(Sd===null?Sd=new Set([this]):Sd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function kc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&va(t,n,a,!0),n=Do.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Oo===null?Xd():n.alternate===null&&ld===0&&(ld=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ja?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),yf(e,r,a)),!1;case 22:return n.flags|=65536,r===Ja?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),yf(e,r,a)),!1}throw Error(i(435,n.tag))}return yf(e,r,a),Xd(),!1}if(H)return t=Do.current,t===null?(r!==ra&&(t=Error(i(423),{cause:r}),ua(Ri(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Ri(r,n),a=Ec(e.stateNode,r,a),go(e,a),ld!==4&&(ld=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ra&&(e=Error(i(422),{cause:r}),ua(Ri(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Ri(o,n),hd===null?hd=[o]:hd.push(o),ld!==4&&(ld=2),t===null)return!0;r=Ri(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ec(n.stateNode,r,e),go(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(Sd===null||!Sd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Dc(a),Oc(a,e,n,r),go(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Ac=Error(i(461)),jc=!1;function Mc(e,t,n,r){t.child=e===null?co(t,null,n,r):so(t,e.child,n,r)}function Nc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ba(t),r=Xo(e,t,n,o,a,i),s=es(),e!==null&&!jc?(ts(e,t,i),sl(e,t,i)):(H&&s&&Xi(t),t.flags|=1,Mc(e,t,r,i),t.child)}function Pc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ki(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Fc(e,t,a,r,i)):(e=Mi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!cl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Rr:n,n(o,r)&&e.ref===t.ref)return sl(e,t,i)}return t.flags|=1,e=Ai(a,r),e.ref=t.ref,e.return=t,t.child=e}function Fc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Rr(a,r)&&e.ref===t.ref){if(jc=!1,t.pendingProps=r=a,cl(e,i))e.flags&131072&&(jc=!0);else return t.lanes=e.lanes,sl(e,t,i)}}return Uc(e,t,n,r,i)}function Ic(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Rc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ua(t,a===null?null:a.cachePool),a===null?To():wo(t,a),jo(t);else return r=t.lanes=536870912,Rc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ua(t,null),To(),Mo()):(Ua(t,a.cachePool),wo(t,a),Mo(),t.memoizedState=null);return Mc(e,t,i,n),t.child}function Lc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Rc(e,t,n,r,i){var a=Ha();return a=a===null?null:{parent:Da._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ua(t,null),To(),jo(t),e!==null&&va(e,t,r,!0),t.childLanes=i,null}function zc(e,t){return t=Qc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Bc(e,t,n){return so(t,e.child,null,n),e=zc(t,t.pendingProps),e.flags|=2,No(t),t.memoizedState=null,e}function Vc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(H){if(r.mode===`hidden`)return e=zc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Lc(null,e);if(Ao(t),(e=ea)?(e=dm(e,na),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Gi===null?null:{id:Ki,overflow:qi},retryLane:536870912,hydrationErrors:null},n=Fi(e),n.return=t,t.child=n,$i=t,ea=null)):e=null,e===null)throw ia(t);return t.lanes=536870912,null}return zc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Ao(t),a){if(t.flags&256)t.flags&=-257,t=Bc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(jc||va(e,t,n,!1),a=(n&e.childLanes)!==0,jc||a){if(So.current===null){if(r=ed,r!==null&&(s=pt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Ci(e,s),Rd(r,e,s),Ac;Xd()}t=Bc(e,t,n)}else e=o.treeContext,ea=hm(s.nextSibling),$i=t,H=!0,ta=null,na=!1,e!==null&&Qi(t,e),t=zc(t,r),t.flags|=134221824;return t}return e=Ai(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Hc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Uc(e,t,n,r,i){return ba(t),n=Xo(e,t,n,r,void 0,i),r=es(),e!==null&&!jc?(ts(e,t,i),sl(e,t,i)):(H&&r&&Xi(t),t.flags|=1,Mc(e,t,n,i),t.child)}function Wc(e,t,n,r,i,a){return ba(t),t.updateQueue=null,n=Qo(t,r,n,i),Zo(e),r=es(),e!==null&&!jc?(ts(e,t,a),sl(e,t,a)):(H&&r&&Xi(t),t.flags|=1,Mc(e,t,n,a),t.child)}function Gc(e,t,n,r,i){if(ba(t),t.stateNode===null){var a=Ei,o=n.contextType;typeof o==`object`&&o&&(a=xa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=_c,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},uo(t),o=n.contextType,a.context=typeof o==`object`&&o?xa(o):Ei,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(gc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&_c.enqueueReplaceState(a,a.state,null),yo(t,r,a,i),vo(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=bc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ei,typeof u==`object`&&u&&(o=xa(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&yc(t,a,r,o),lo=!1;var f=t.memoizedState;a.state=f,yo(t,r,a,i),vo(),l=t.memoizedState,s||f!==l||lo?(typeof d==`function`&&(gc(t,n,d,r),l=t.memoizedState),(c=lo||vc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,fo(e,t),o=t.memoizedProps,u=bc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ei,typeof l==`object`&&l&&(c=xa(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&yc(t,a,r,c),lo=!1,f=t.memoizedState,a.state=f,yo(t,r,a,i),vo();var p=t.memoizedState;o!==d||f!==p||lo||e!==null&&e.dependencies!==null&&ya(e.dependencies)?(typeof s==`function`&&(gc(t,n,s,r),p=t.memoizedState),(u=lo||vc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ya(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Hc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=so(t,e.child,null,i),t.child=so(t,null,n,i)):Mc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=sl(e,t,i),e}function Kc(e,t,n,r){return ca(),t.flags|=256,Mc(e,t,n,r),t.child}var qc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Jc(e){return{baseLanes:e,cachePool:Wa()}}function Yc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=pd),e}function Xc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Po.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(H){if(i?ko(t):Mo(),(e=ea)?(e=dm(e,na),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Gi===null?null:{id:Ki,overflow:qi},retryLane:536870912,hydrationErrors:null},n=Fi(e),n.return=t,t.child=n,$i=t,ea=null)):e=null,e===null)throw ia(t);return t.lanes=pm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Mo(),i=t.mode,a=Qc({mode:`hidden`,children:a},i),r=Ni(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Jc(n),r.childLanes=Yc(e,o,n),t.memoizedState=qc,Lc(null,r)):(ko(t),Zc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return el(e,t,a,o,r,c,s,n)}return i?(Mo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Ai(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ni(i,a,n,null),i.flags|=2):i=Ai(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Lc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Jc(n):(a=i.cachePool,a===null?a=Wa():(s=Da._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Yc(e,o,n),t.memoizedState=qc,Lc(e.child,r)):(ko(t),n=e.child,e=n.sibling,n=Ai(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Zc(e,t){return t=Qc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Qc(e,t){return e=Oi(22,e,null,t),e.lanes=0,e}function $c(e,t,n){return so(t,e.child,null,n),e=Zc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function el(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(ko(t),t.flags&=-257,$c(e,t,c)):t.memoizedState===null?(Mo(),o=a.fallback,s=t.mode,a=Qc({mode:`visible`,children:a.children},s),o=Ni(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,so(t,e.child,null,c),a=t.child,a.memoizedState=Jc(c),a.childLanes=Yc(e,r,c),t.memoizedState=qc,Lc(null,a)):(Mo(),t.child=e.child,t.flags|=128,null);if(ko(t),pm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,ua({value:a,source:null,stack:null})),$c(e,t,c)}if(jc||va(e,t,c,!1),r=(c&e.childLanes)!==0,jc||r){if(So.current!==null)return $c(e,t,c);if(r=ed,r!==null&&(a=pt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Ci(e,a),Rd(r,e,a),Ac;return fm(o)||Xd(),$c(e,t,c)}return fm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,ea=hm(o.nextSibling),$i=t,H=!0,ta=null,na=!1,e!==null&&Qi(t,e),t=Zc(t,a.children),t.flags|=134221824,t)}function tl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ga(e.return,t,n)}function nl(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Lo(n)===null&&(t=e),e=e.sibling}return t}function rl(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function il(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function al(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Po.current;if(t.flags&128)return Fo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Fo(t,o),i===`backwards`&&e!==null?(il(e),Mc(e,t,r,n),il(e)):Mc(e,t,r,n),r=H?Hi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&tl(e,n,t);else if(e.tag===19)tl(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=nl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,il(t)),rl(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Lo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}rl(t,!0,n,null,a,r);break;case`together`:rl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=nl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),rl(t,!1,i,n,a,r)}return t.child}function ol(e,t,n){var r=t.pendingProps;return ma(t,t.type,r.value),Mc(e,t,r.children,n),t.child}function sl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ud|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(va(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Ai(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ai(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function cl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ya(e)))}function ll(e,t,n){switch(t.tag){case 3:xe(t,t.stateNode.containerInfo),ma(t,Da,e.memoizedState.cache),ca();break;case 27:case 5:Ce(t);break;case 4:xe(t,t.stateNode.containerInfo);break;case 10:ma(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ao(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return ko(t),t.flags|=128,null;r=va(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Xc(e,t,n):(ko(t),e=sl(e,t,n),e===null?null:e.sibling)}ko(t);break;case 19:if(t.flags&128)return al(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(va(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return al(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Fo(t,Po.current),r)break;return null;case 22:return t.lanes=0,Ic(e,t,n,t.pendingProps);case 24:ma(t,Da,e.memoizedState.cache)}return sl(e,t,n)}function ul(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)jc=!0;else{if(!cl(e,n)&&!(t.flags&128))return jc=!1,ll(e,t,n);jc=!!(e.flags&131072)}}else jc=!1,H&&t.flags&1048576&&Yi(t,Hi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Za(t.elementType),t.type=e,typeof e==`function`)ki(e)?(r=bc(e,r),t.tag=1,t=Gc(null,t,e,r,n)):(t.tag=0,t=Uc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===N){t.tag=11,t=Nc(null,t,e,r,n);break a}if(a===te){t.tag=14,t=Pc(null,t,e,r,n);break a}if(a===M){t.tag=10,t.type=e,t=ol(null,t,n);break a}}throw t=ue(e)||e,Error(i(306,t,``))}}return t;case 0:return Uc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=bc(r,t.pendingProps),Gc(e,t,r,a,n);case 3:a:{if(xe(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,fo(e,t),yo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ma(t,Da,r),r!==o.cache&&_a(t,[Da],n,!0),vo(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Kc(e,t,r,n);break a}if(r!==a){a=Ri(Error(i(424)),t),ua(a),t=Kc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ea=hm(e.firstChild),$i=t,H=!0,ta=null,na=!0,n=co(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ca(),r===a){t=sl(e,t,n);break a}Mc(e,t,r,n)}t=t.child}return t;case 26:return Hc(e,t),e===null?(n=zm(t.type,null,t.pendingProps,null))?t.memoizedState=n:H||(t.stateNode=yp(t.type,t.pendingProps,be.current,t)):t.memoizedState=zm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ce(t),e===null&&H&&(r=t.stateNode=xm(t.type,t.pendingProps,be.current),$i=t,na=!0,a=ea,Op(t.type)?(gm=a,ea=hm(r.firstChild)):ea=a),Mc(e,t,t.pendingProps.children,n),Hc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&H&&((a=r=ea)&&(r=lm(r,t.type,t.pendingProps,na),r===null?a=!1:(t.stateNode=r,$i=t,ea=hm(r.firstChild),na=!1,a=!0)),a||ia(t)),Ce(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,bp(a,o)?r=null:s!==null&&bp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Xo(e,t,$o,null,null,n),ph._currentValue=a),Hc(e,t),Mc(e,t,r,n),t.child;case 6:return e===null&&H&&((e=n=ea)&&(n=um(n,t.pendingProps,na),n===null?e=!1:(t.stateNode=n,$i=t,ea=null,e=!0)),e||ia(t)),null;case 13:return Xc(e,t,n);case 4:return xe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=so(t,null,r,n):Mc(e,t,r,n),t.child;case 11:return Nc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Hc(e,t),Mc(e,t,r,n),t.child;case 8:return Mc(e,t,t.pendingProps.children,n),t.child;case 12:return Mc(e,t,t.pendingProps.children,n),t.child;case 10:return ol(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,ba(t),a=xa(a),r=r(a),t.flags|=1,Mc(e,t,r,n),t.child;case 14:return Pc(e,t,t.type,t.pendingProps,n);case 15:return Fc(e,t,t.type,t.pendingProps,n);case 19:return al(e,t,n);case 31:return Vc(e,t,n);case 22:return Ic(e,t,n,t.pendingProps);case 24:return ba(t),r=xa(Da),e===null?(a=Ha(),a===null&&(a=ed,o=Oa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},uo(t),ma(t,Da,a)):((e.lanes&n)!==0&&(fo(e,t),yo(t,null,null,n),vo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ma(t,Da,r),r!==a.cache&&_a(t,[Da],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ma(t,Da,r))),Mc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:H&&Xi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Hc(e,t),Mc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function dl(e){e.flags|=4}function fl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?eh(t,r):eh(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(qd())e.flags|=8192;else throw Qa=Ja,Ka}}else e.flags&=-16777217}function pl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!th(t)){if(qd())e.flags|=8192;else throw Qa=Ja,Ka}}function ml(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:st(),e.lanes|=t,md|=t)}function hl(e,t){if(!H)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function gl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function _l(e,t,n){var r=t.pendingProps;switch(Zi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return gl(t),null;case 1:return gl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ha(Da),Se(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(sa(t)?dl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,la())),gl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(dl(t),o===null?(gl(t),fl(t,a,null,r,n)):(gl(t),pl(t,o))):o?o===e.memoizedState?(gl(t),t.flags&=-16777217):(dl(t),gl(t),pl(t,o)):(e=e.memoizedProps,e!==r&&dl(t),gl(t),fl(t,a,e,r,n)),null;case 27:if(we(t),n=be.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&dl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return gl(t),t.subtreeFlags&=-33554433,null}e=ve.current,sa(t)?aa(t,e):(e=xm(a,r,n),t.stateNode=e,dl(t))}return gl(t),t.subtreeFlags&=-33554433,null;case 5:if(we(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&dl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return gl(t),t.subtreeFlags&=-33554433,null}if(o=ve.current,sa(t))aa(t,o);else{var s=gp(be.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[yt]=t,o[bt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(up(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&dl(t)}}return gl(t),t.subtreeFlags&=-33554433,fl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&dl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=be.current,sa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=$i,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[yt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||cp(e.nodeValue,n)),e||ia(t,!0)}else e=gp(e).createTextNode(r),e[yt]=t,t.stateNode=e}return gl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=sa(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[yt]=t}else ca(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;gl(t),e=!1}else n=la(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(No(t),t):(No(t),null);if(t.flags&128)throw Error(i(558))}return gl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=sa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[yt]=t}else ca(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;gl(t),a=!1}else a=la(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(No(t),t):(No(t),null)}return No(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ml(t,t.updateQueue),gl(t),null);case 4:return Se(),e===null&&Xf(t.stateNode.containerInfo),t.flags|=67108864,gl(t),null;case 10:return ha(t.type),gl(t),null;case 19:if(Io(t),r=t.memoizedState,r===null)return gl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)hl(r,!1);else{if(ld!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Lo(e),o!==null){for(t.flags|=128,hl(r,!1),e=o.updateQueue,t.updateQueue=e,ml(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ji(n,e),n=n.sibling;return Fo(t,Po.current&1|2),H&&Ji(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Le()>bd&&(t.flags|=128,a=!0,hl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Lo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,ml(t,e),hl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!H)return gl(t),null}else 2*Le()-r.renderingStartTime>bd&&n!==536870912&&(t.flags|=128,a=!0,hl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Le(),e.sibling=null,o=Po.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||H?Fo(t,o):(n=o,_e(Do,t),_e(Po,n),Oo===null&&(Oo=t)),H&&Ji(t,r.treeForkCount),e}return gl(t),null;case 22:case 23:return No(t),Eo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(gl(t),t.subtreeFlags&6&&(t.flags|=8192)):gl(t),n=t.updateQueue,n!==null&&ml(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ge(Va),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ha(Da),gl(t),null;case 25:return null;case 30:return t.flags|=33554432,gl(t),null}throw Error(i(156,t.tag))}function vl(e,t){switch(Zi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ha(Da),Se(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return we(t),null;case 31:if(t.memoizedState!==null){if(No(t),t.alternate===null)throw Error(i(340));ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(No(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Io(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Se(),null;case 10:return ha(t.type),null;case 22:case 23:return No(t),Eo(),e!==null&&ge(Va),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ha(Da),null;case 25:return null;default:return null}}function yl(e,t){switch(Zi(t),t.tag){case 3:ha(Da),Se();break;case 26:case 27:case 5:we(t);break;case 4:Se();break;case 31:t.memoizedState!==null&&No(t);break;case 13:No(t);break;case 19:Io(t);break;case 10:ha(t.type);break;case 22:case 23:No(t),Eo(),e!==null&&ge(Va);break;case 24:ha(Da)}}function bl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){vf(t,t.return,e)}}function xl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){vf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){vf(t,t.return,e)}}function Sl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{xo(t,n)}catch(t){vf(e,e.return,t)}}}function Cl(e,t,n){n.props=bc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){vf(e,t,n)}}function wl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=pi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Bp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Vp(e);p(e.child,!1,im,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){vf(e,t,n)}}function Tl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){vf(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){vf(e,t,n)}else n.current=null}}function El(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)om(e.stateNode,t[n])}function Dl(e){for(var t=e.return;t!==null&&(Al(t)&&om(e.stateNode,t.stateNode),!kl(t));)t=t.return}function Ol(e){for(var t=e.return;t!==null&&(Al(t)&&sm(e.stateNode,t.stateNode),!kl(t));)t=t.return}function kl(e){return e.tag===5||e.tag===3||e.tag===27}function Al(e){return e&&e.tag===7&&e.stateNode!==null}function jl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){vf(e,e.return,t)}}function Ml(e,t,n){try{var r=e.stateNode;fp(r,e.type,n,t),r[bt]=t}catch(t){vf(e,e.return,t)}}function Nl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Op(e.type)||e.tag===4}function Pl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Nl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Op(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Fl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=mn)),El(e,r),B=!0;else if(i!==4&&(i===27&&(El(e,r),r=null,Op(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Fl(e,t,n,r),e=e.sibling;e!==null;)Fl(e,t,n,r),e=e.sibling}function Il(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),El(e,r),B=!0;else if(i!==4&&(i===27&&(El(e,r),r=null,Op(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Il(e,t,n,r),e=e.sibling;e!==null;)Il(e,t,n,r),e=e.sibling}function Ll(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);up(t,r,n),t[yt]=e,t[bt]=n}catch(t){vf(e,e.return,t)}}var Rl=!1,zl=null;function Bl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Rl=!0)}var Vl=null;function Hl(){var e=Vl;return Vl=null,e}var Ul=0;function Wl(e,t,n,r,i){return Ul=0,Gl(e.child,t,n,r,i)}function Gl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Pp(o);r.push(s),s.view&&(a=!0)}else a||Pp(o).view&&(a=!0);Rl=!0,jp(o,Ul===0?t:t+`_`+Ul,n),Ul++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Gl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Kl(e,t){for(;e!==null;)e.tag===5?Mp(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Kl(e.child,t)),e=e.sibling}function ql(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(ql(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=hi(t.default,t.share),t!==`none`&&(Wl(e,n,t,null,!1)||Kl(e.child,!1))}e=e.sibling}}function Jl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=pi(r,n),a=hi(r.default,n.paired?r.share:r.enter);a===`none`?ql(e):Wl(e,i,a,null,!1)?(ql(e),n.paired||t||Ld(e,r.onEnter)):Kl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Jl(e,t),e=e.sibling;else ql(e)}function Yl(e){if(zl!==null&&zl.size!==0){var t=zl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=hi(n.default,n.share);if(a!==`none`&&(Wl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Ld(e,n.onShare)):Kl(e.child,!1)),t.delete(r),t.size===0)break}}}Yl(e)}e=e.sibling}}}function Xl(e){if(e.tag===30){var t=e.memoizedProps,n=pi(t,e.stateNode),r=zl===null?void 0:zl.get(n),i=hi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Wl(e,n,i,null,!1)?r===void 0?Ld(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,zl.delete(n),Ld(e,t.onShare)):Kl(e.child,!1)),zl!==null&&Yl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Xl(e),e=e.sibling;else zl!==null&&Yl(e)}function Zl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=pi(t,e.stateNode);t=hi(t.default,t.update),e.flags&=-5,t!==`none`&&Wl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Zl(e);e=e.sibling}}function Ql(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Kl(e.child,!1))}Ql(e)}e=e.sibling}}function $l(e){if(e.tag===30)e.stateNode.paired=null,Kl(e.child,!1),Ql(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)$l(e),e=e.sibling;else Ql(e)}function eu(e){for(e=e.child;e!==null;)e.tag===30?Kl(e.child,!1):e.subtreeFlags&33554432&&eu(e),e=e.sibling}function tu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Ul<a.length){var l=a[Ul],u=Pp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&jp(c,Ul===0?n:n+`_`+Ul,i),s&&e.flags&4||(Vl===null&&(Vl=[]),Vl.push(c,Ul===0?r:r+`_`+Ul,t.memoizedProps)),Ul++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:tu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function nu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=pi(n,r),a=hi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Fp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Ul=0,i=tu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Ld(e,n.onUpdate))}else e.subtreeFlags&33554432&&nu(e,t);e=e.sibling}}var ru=!1,iu=!1,au=!1,ou=!1,su=typeof WeakSet==`function`?WeakSet:Set,cu=null,lu=!1,uu=!1,du=!1,fu=!1;function pu(e,t,n){if(e=e.containerInfo,mp=Sh,e=Ur(e),Wr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(hp={focusedElem:e,selectionRange:r},Sh=!1,n=(n&335544064)===n,cu=t,t=n?9270:1024;cu!==null;){if(e=cu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Xl(r[a]);if(e.alternate===null&&e.flags&2)n&&Bl(e),mu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Xl(r),mu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Bl(e),mu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,cu=r):(n&&Zl(e),mu(n))}}zl=null}function mu(e){for(;cu!==null;){var t=cu,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=bc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){vf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)cm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:cm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=pi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=hi(a.default,a.update),a!==`none`&&Wl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,cu=r;break}cu=t.return}}function hu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Pu(e,n),r&4&&bl(5,n);break;case 1:if(Pu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){vf(n,n.return,e)}else{var i=bc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){vf(n,n.return,e)}}}r&64&&Sl(n),r&512&&wl(n,n.return);break;case 3:if(Pu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{xo(e,t)}catch(e){vf(n,n.return,e)}}break;case 27:t===null&&r&4&&Ll(n);case 26:case 5:Pu(e,n),t===null&&r&4&&jl(n),r&512&&wl(n,n.return);break;case 12:Pu(e,n);break;case 31:Pu(e,n),r&4&&Cu(e,n);break;case 13:Pu(e,n),r&4&&wu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Sf.bind(null,n),mm(e,n))));break;case 22:if(r=n.memoizedState!==null||ru,!r){var a=t!==null&&t.memoizedState!==null||iu;t=ru,i=iu,ru=r,(iu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Iu(e,n,r)):Pu(e,n),ru=t,iu=i}break;case 30:Pu(e,n),r&512&&wl(n,n.return);break;case 7:r&512&&wl(n,n.return);default:Pu(e,n)}}function gu(e,t){for(e=e.child;e!==null;)_u(e,t),e=e.sibling}function _u(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){vf(e,e.return,t)}vu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,B=!0}catch(t){vf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Ap(s,!0):Ap(e.stateNode,!1)}catch(t){vf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&gu(e,t);break;default:gu(e,t)}}function vu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:_u(n,r);break a;case 22:n.memoizedState===null&&vu(n,r);break a;default:vu(n,r)}}e=e.sibling}}function yu(e){var t=e.alternate;t!==null&&(e.alternate=null,yu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ot(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var bu=null,xu=!1;function Su(e,t,n){for(n=n.child;n!==null;)W(e,t,n),n=n.sibling}function W(e,t,n){if(qe&&typeof qe.onCommitFiberUnmount==`function`)try{qe.onCommitFiberUnmount(Ke,n)}catch{}switch(n.tag){case 26:iu||Tl(n,t),Su(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!iu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:iu||Tl(n,t),Ol(n);var r=bu,i=xu;Op(n.type)&&(bu=n.stateNode,xu=!1),Su(e,t,n),Sm(n.stateNode,n.type,n.memoizedProps),bu=r,xu=i;break;case 5:iu||Tl(n,t),Ol(n);case 6:if(n.tag===6&&Ol(n),r=bu,i=xu,bu=null,Su(e,t,n),bu=r,xu=i,bu!==null){if(xu)try{(bu.nodeType===9?bu.body:bu.nodeName===`HTML`?bu.ownerDocument.body:bu).removeChild(n.stateNode),B=!0}catch(e){vf(n,t,e)}else try{bu.removeChild(n.stateNode),B=!0}catch(e){vf(n,t,e)}}break;case 18:bu!==null&&(xu?(e=bu,kp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Jh(e)):kp(bu,n.stateNode));break;case 4:r=bu,i=xu,bu=n.stateNode.containerInfo,xu=!0,Su(e,t,n),bu=r,xu=i;break;case 0:case 11:case 14:case 15:xl(2,n,t),iu||xl(4,n,t),Su(e,t,n);break;case 1:iu||(Tl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Cl(n,t,r)),Su(e,t,n);break;case 21:Su(e,t,n);break;case 22:iu=(r=iu)||n.memoizedState!==null,Su(e,t,n),iu=r;break;case 30:Tl(n,t),Su(e,t,n);break;case 7:iu||Tl(n,t),Su(e,t,n);break;default:Su(e,t,n)}}function Cu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Jh(e)}catch(e){vf(t,t.return,e)}}}function wu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Jh(e)}catch(e){vf(t,t.return,e)}}function Tu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new su),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new su),t;default:throw Error(i(435,e.tag))}}function Eu(e,t){var n=Tu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Cf.bind(null,e,t);t.then(r,r)}})}function Du(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Op(l.type)){bu=l.stateNode,xu=!1;break a}break;case 5:bu=l.stateNode,xu=!1;break a;case 3:case 4:bu=l.stateNode.containerInfo,xu=!0;break a}l=l.return}if(bu===null)throw Error(i(160));W(s,c,o),bu=null,xu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ku(t,e,n),t=t.sibling}var Ou=null;function ku(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Du(t,e,n),Au(e),a&4&&(xl(3,e,e.return),bl(3,e),xl(5,e,e.return));break;case 1:Du(t,e,n),Au(e),a&512&&(iu||r===null||Tl(r,r.return)),a&64&&ru&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Ou,Du(t,e,n),Au(e),a&512&&(iu||r===null||Tl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(ru)e.stateNode=yp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[Et]||r[yt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),up(r,t,n),r[yt]=e,Nt(r),t=r;break a;case`link`:if(o=Zm(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),up(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Zm(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),up(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[yt]=e,Nt(r),t=r}e.stateNode=t}}else ru||Qm(o,e.type,e.stateNode)}else e.stateNode=Km(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Ml(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||iu||t.parentNode.removeChild(t)):a.count--,n===null?ru||Qm(o,e.type,e.stateNode):Km(o,n,e.memoizedProps))}break;case 27:Du(t,e,n),Au(e),a&512&&(iu||r===null||Tl(r,r.return)),r!==null&&a&4&&Ml(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=au,au=!1,Du(t,e,n),au=o,Au(e),a&512&&(iu||r===null||Tl(r,r.return)),e.flags&32){t=e.stateNode;try{sn(t,``),B=!0}catch(t){vf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Ml(e,t,r===null?t:r.memoizedProps)),a&1024&&(ou=!0);break;case 6:if(Du(t,e,n),Au(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,B=!0}catch(t){vf(e,e.return,t)}}break;case 3:if(B=!1,Xm=null,o=Ou,Ou=Em(t.containerInfo),Du(t,e,n),Ou=o,Au(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Jh(t.containerInfo)}catch(t){vf(e,e.return,t)}ou&&(ou=!1,ju(e)),B=!1;break;case 4:a=au,au=ru,r=Ut(),o=Ou,Ou=Em(e.stateNode.containerInfo),Du(t,e,n),Au(e),Ou=o,B&&uu&&(du=!0),B=r,au=a;break;case 12:Du(t,e,n),Au(e);break;case 31:Du(t,e,n),Au(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Eu(e,t)));break;case 13:Du(t,e,n),Au(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(vd=Le()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Eu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=ru,l=iu,u=au;ru=c||o,au=u||o,iu=l||s,Du(t,e,n),iu=l,au=u,ru=c,Au(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||ru||iu||(t=s||iu,n=ru,r=iu,ru=o||ru,iu=t,Fu(e,2),ru=n,iu=r),!o&&au||gu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Eu(e,n))));break;case 19:Du(t,e,n),Au(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Eu(e,t)));break;case 30:a&512&&(iu||r===null||Tl(r,r.return)),a=Ut(),o=uu,s=(n&335544064)===n,c=e.memoizedProps,uu=s&&hi(c.default,c.update)!==`none`,Du(t,e,n),Au(e),s&&r!==null&&B&&(e.flags|=4),uu=o,B=a;break;case 21:break;case 7:a&512&&(iu||r===null||Tl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Du(t,e,n),Au(e)}}function Au(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Nl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Al(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(kl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Il(e,Pl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(sn(l,``),n.flags&=-33),Il(e,Pl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Fl(e,Pl(e),u,s);break;default:throw Error(i(161))}}catch(t){vf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ju(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ju(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Sh=!0,t.reset(),Sh=!1),e=e.sibling}}function Mu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Nu(t,e),t=t.sibling;else nu(t,!1)}function Nu(e,t){var n=e.alternate;if(n===null)Jl(e,!1);else switch(e.tag){case 3:if(fu=lu=!1,Hl(),Mu(t,e),!lu&&!du){if(e=Vl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Mp(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),fu=!0}Vl=null;break;case 5:Mu(t,e);break;case 4:r=lu,lu=!1,Mu(t,e),lu&&(du=!0),lu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Mu(t,e):Jl(e,!1));break;case 30:r=lu,i=Hl(),lu=!1,Mu(t,e),lu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=pi(a,o),o=pi(n.memoizedProps,o);var s=hi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Ul=0,t=tu(e,n,t,o,s,a,!0),Ul!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Ld(e,e.memoizedProps.onUpdate),Vl=i):i!==null&&(i.push.apply(i,Vl),Vl=i),lu=e.flags&32?!0:r;break;default:Mu(t,e)}}function Pu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)hu(e,t.alternate,t),t=t.sibling}function Fu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:xl(4,n,n.return),Fu(n,r);break;case 1:Tl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Cl(n,n.return,i),Fu(n,r);break;case 27:r&2&&Sm(n.stateNode,n.type,n.memoizedProps);case 5:Tl(n,n.return),n.tag!==5&&n.tag!==27||Ol(n),Fu(n,r);break;case 6:Ol(n);break;case 26:Tl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||iu||i.parentNode.removeChild(i),Fu(n,r);break;case 22:n.memoizedState===null&&Fu(n,r);break;case 30:Tl(n,n.return),Fu(n,r);break;case 7:Tl(n,n.return);default:Fu(n,r)}e=e.sibling}}function Iu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Iu(i,a,n),bl(4,a);break;case 1:if(Iu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){vf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)bo(l[i],c)}catch(e){vf(r,r.return,e)}}s&&o&64&&Sl(a),wl(a,a.return);break;case 27:n&2&&Ll(a);case 5:a.tag!==5&&a.tag!==27||Dl(a),Iu(i,a,n),s&&r===null&&o&4&&jl(a),wl(a,a.return);break;case 6:Dl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||ru||Qm(Em(c.ownerDocument),a.type,c),Iu(i,a,n),s&&r===null&&o&4&&jl(a),wl(a,a.return);break;case 12:Iu(i,a,n);break;case 31:Iu(i,a,n),s&&o&4&&Cu(i,a);break;case 13:Iu(i,a,n),s&&o&4&&wu(i,a);break;case 22:a.memoizedState===null&&Iu(i,a,n),wl(a,a.return);break;case 30:Iu(i,a,n),wl(a,a.return);break;case 7:wl(a,a.return);default:Iu(i,a,n)}t=t.sibling}}function Lu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ka(n))}function Ru(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ka(e))}function zu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Bu(e,t,n,r),t=t.sibling;else i&&eu(t)}function Bu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&$l(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:zu(e,t,n,r),a&2048&&bl(9,t);break;case 1:zu(e,t,n,r);break;case 3:zu(e,t,n,r),i&&fu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&ka(a)));break;case 12:if(a&2048){zu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){vf(t,t.return,e)}}else zu(e,t,n,r);break;case 31:zu(e,t,n,r);break;case 13:zu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&$l(t),o._visibility&2?zu(e,t,n,r):(o._visibility|=2,Vu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&$l(s),o._visibility&2?zu(e,t,n,r):Hu(e,t)),a&2048&&Lu(s,t);break;case 24:zu(e,t,n,r),a&2048&&Ru(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Kl(a.child,!0),Kl(t.child,!0))),zu(e,t,n,r);break;default:zu(e,t,n,r)}}function Vu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Vu(a,o,s,c,i),bl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Vu(a,o,s,c,i)):u._visibility&2?Vu(a,o,s,c,i):Hu(a,o),i&&l&2048&&Lu(o.alternate,o);break;case 24:Vu(a,o,s,c,i),i&&l&2048&&Ru(o.alternate,o);break;default:Vu(a,o,s,c,i)}t=t.sibling}}function Hu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Hu(n,r),i&2048&&Lu(r.alternate,r);break;case 24:Hu(n,r),i&2048&&Ru(r.alternate,r);break;default:Hu(n,r)}t=t.sibling}}var Uu=8192;function Wu(e,t,n){if(e.subtreeFlags&Uu)for(e=e.child;e!==null;)Gu(e,t,n),e=e.sibling}function Gu(e,t,n){switch(e.tag){case 26:Wu(e,t,n),e.flags&Uu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&rh(n,e)):ih(n,Ou,e.memoizedState,e.memoizedProps));break;case 5:Wu(e,t,n),e.flags&Uu&&(e=e.stateNode,(t&335544128)===t&&rh(n,e));break;case 3:case 4:var r=Ou;Ou=Em(e.stateNode.containerInfo),Wu(e,t,n),Ou=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Uu,Uu=16777216,Wu(e,t,n),Uu=r):Wu(e,t,n));break;case 30:if((e.flags&Uu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,zl===null&&(zl=new Map),zl.set(r,i)}Wu(e,t,n);break;default:Wu(e,t,n)}}function Ku(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function qu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];cu=r,Xu(r,e)}Ku(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ju(e),e=e.sibling}function Ju(e){switch(e.tag){case 0:case 11:case 15:qu(e),e.flags&2048&&xl(9,e,e.return);break;case 3:qu(e);break;case 12:qu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Yu(e)):qu(e);break;default:qu(e)}}function Yu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];cu=r,Xu(r,e)}Ku(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:xl(8,t,t.return),Yu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Yu(t));break;default:Yu(t)}e=e.sibling}}function Xu(e,t){for(;cu!==null;){var n=cu;switch(n.tag){case 0:case 11:case 15:xl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ka(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,cu=r;else a:for(n=e;cu!==null;){r=cu;var i=r.sibling,a=r.return;if(yu(r),r===n){cu=null;break a}if(i!==null){i.return=a,cu=i;break a}cu=a}}}var Zu={getCacheForType:function(e){var t=xa(Da),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return xa(Da).controller.signal}},Qu=typeof WeakMap==`function`?WeakMap:Map,$u=0,ed=null,td=null,nd=0,rd=0,id=null,ad=!1,od=!1,sd=!1,cd=0,ld=0,ud=0,dd=0,fd=0,pd=0,md=0,hd=null,gd=null,_d=!1,vd=0,yd=0,bd=1/0,xd=null,Sd=null,Cd=0,wd=null,Td=null,Ed=0,Dd=0,Od=null,kd=null,Ad=null,jd=null,Md=null,Nd=0,Pd=null;function Fd(){return $u&2&&nd!==0?nd&-nd:L.T===null?gt():zf()}function Id(){if(pd===0){if(!(nd&536870912)||H){var e=et;et<<=1,!(et&3932160)&&(et=262144),pd=e}else pd=536870912}return e=Do.current,e!==null&&(e.flags|=32),pd}function Ld(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Bp(pi(e.memoizedProps,n))),jd===null&&(jd=[]),jd.push(t.bind(null,r))}}function Rd(e,t,n){(e===ed&&(rd===2||rd===9)||e.cancelPendingCommit!==null)&&(Gd(e,0),Hd(e,nd,pd,!1)),lt(e,n),(!($u&2)||e!==ed)&&(e===ed&&(!($u&2)&&(dd|=n),ld===4&&Hd(e,nd,pd,!1)),jf(e))}function zd(e,t,n){if($u&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||it(e,t),a=r?$d(e,t):Zd(e,t,!0),o=r;do{if(a===0){od&&!r&&Hd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Vd(n)){a=Zd(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=hd;var l=c.current.memoizedState.isDehydrated;if(l&&(Gd(c,s).flags|=256),s=Zd(c,s,!1),s!==2&&s!==6){if(sd&&!l){c.errorRecoveryDisabledLanes|=o,dd|=o,a=4;break a}o=gd,gd=a,o!==null&&(gd===null?gd=o:gd.push.apply(gd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Gd(e,0),Hd(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Hd(r,t,pd,!ad);break a;case 2:gd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=vd+300-Le(),10<a)){if(Hd(r,t,pd,!ad),rt(r,0,!0)!==0)break a;Ed=t,r.timeoutHandle=Cp(Bd.bind(null,r,n,gd,xd,_d,t,pd,dd,md,ad,o,`Throttled`,-0,0),a);break a}Bd(r,n,gd,xd,_d,t,pd,dd,md,ad,o,null,-0,0)}break}while(1);jf(e)}function Bd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;if(d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:mn},zl=null,Gu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=ch.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?vd-Le():(a&4194048)===a?yd-Le():0,m=oh(d,m),m!==null)){Ed=a,e.cancelPendingCommit=m(sf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Hd(e,a,o,!l);return}sf(e,t,a,n,r,i,o,s,c,l,u,d)}function Vd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Lr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Hd(e,t,n,r){t=at(e,t),t&=~fd,t&=~dd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ye(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&dt(e,n,t)}function Ud(){return $u&6?!0:(Mf(0,!1),!1)}function Wd(){if(td!==null){if(rd===0)var e=td.return;else e=td,pa=fa=null,ns(e),to=null,no=0,e=td;for(;e!==null;)yl(e.alternate,e),e=e.return;td=null}}function Gd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,wp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ed=0,Wd(),ed=e,td=n=Ai(e.current,null),nd=t,rd=0,id=null,ad=!1,od=it(e,t),sd=!1,md=pd=fd=dd=ud=ld=0,gd=hd=null,_d=!1,cd=at(e,t),bi(),n}function Kd(e,t){U=null,L.H=fc,t===Ga||t===qa?(t=$a(),rd=3):t===Ka?(t=$a(),rd=4):rd=t===Ac?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,id=t,td===null&&(ld=1,wc(e,Ri(t,e.current)))}function qd(){var e=Do.current;return e===null?!0:(nd&4194048)===nd?Oo===null:(nd&62914560)===nd||nd&536870912?e===Oo:!1}function Jd(){var e=L.H;return L.H=fc,e===null?fc:e}function Yd(){var e=L.A;return L.A=Zu,e}function Xd(){ld=4,ad||(nd&4194048)!==nd&&Do.current!==null||(od=!0),!(ud&134217727)&&!(dd&134217727)||ed===null||Hd(ed,nd,pd,!1)}function Zd(e,t,n){var r=$u;$u|=2;var i=Jd(),a=Yd();(ed!==e||nd!==t)&&(xd=null,Gd(e,t)),t=!1;var o=ld;a:do try{if(rd!==0&&td!==null){var s=td,c=id;switch(rd){case 8:Wd(),o=6;break a;case 3:case 2:case 9:case 6:Do.current===null&&(t=!0);var l=rd;if(rd=0,id=null,rf(e,s,c,l),n&&od){o=0;break a}break;default:l=rd,rd=0,id=null,rf(e,s,c,l)}}Qd(),o=ld;break}catch(t){Kd(e,t)}while(1);return t&&e.shellSuspendCounter++,pa=fa=null,$u=r,L.H=i,L.A=a,td===null&&(ed=null,nd=0,bi()),o}function Qd(){for(;td!==null;)tf(td)}function $d(e,t){var n=$u;$u|=2;var r=Jd(),a=Yd();ed!==e||nd!==t?(xd=null,bd=Le()+500,Gd(e,t)):od=it(e,t);a:do try{if(rd!==0&&td!==null){t=td;var o=id;b:switch(rd){case 1:rd=0,id=null,rf(e,t,o,1);break;case 2:case 9:if(Ya(o)){rd=0,id=null,nf(t);break}t=function(){rd!==2&&rd!==9||ed!==e||(rd=7),jf(e)},o.then(t,t);break a;case 3:rd=7;break a;case 4:rd=5;break a;case 7:Ya(o)?(rd=0,id=null,nf(t)):(rd=0,id=null,rf(e,t,o,7));break;case 5:var s=null;switch(td.tag){case 26:s=td.memoizedState;case 5:case 27:var c=td;if(s?th(s):c.stateNode.complete){rd=0,id=null;var l=c.sibling;if(l!==null)td=l;else{var u=c.return;u===null?td=null:(td=u,af(u))}break b}}rd=0,id=null,rf(e,t,o,5);break;case 6:rd=0,id=null,rf(e,t,o,6);break;case 8:Wd(),ld=6;break a;default:throw Error(i(462))}}ef();break}catch(t){Kd(e,t)}while(1);return pa=fa=null,L.H=r,L.A=a,$u=n,td===null?(ed=null,nd=0,bi(),ld):0}function ef(){for(;td!==null&&!Fe();)tf(td)}function tf(e){var t=ul(e.alternate,e,cd);e.memoizedProps=e.pendingProps,t===null?af(e):td=t}function nf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Wc(n,t,t.pendingProps,t.type,void 0,nd);break;case 11:t=Wc(n,t,t.pendingProps,t.type.render,t.ref,nd);break;case 5:ns(t);var r=t;r===$i&&(H?(oa(r),r.tag===5&&r.stateNode!=null&&(ea=r.stateNode)):(oa(r),H=!0));default:yl(n,t),t=td=ji(t,cd),t=ul(n,t,cd)}e.memoizedProps=e.pendingProps,t===null?af(e):td=t}function rf(e,t,n,r){pa=fa=null,ns(t),to=null,no=0;var i=t.return;try{if(kc(e,i,t,n,nd)){ld=1,wc(e,Ri(n,e.current)),td=null;return}}catch(t){if(i!==null)throw td=i,t;ld=1,wc(e,Ri(n,e.current)),td=null;return}t.flags&32768?(H||r===1?e=!0:od||nd&536870912?e=!1:(ad=e=!0,(r===2||r===9||r===3||r===6)&&(r=Do.current,r!==null&&r.tag===13&&(r.flags|=16384))),of(t,e)):af(t)}function af(e){var t=e;do{if(t.flags&32768){of(t,ad);return}e=t.return;var n=_l(t.alternate,t,cd);if(n!==null){td=n;return}if(t=t.sibling,t!==null){td=t;return}td=t=e}while(t!==null);ld===0&&(ld=5)}function of(e,t){do{var n=vl(e.alternate,e);if(n!==null){n.flags&=32767,td=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){td=e;return}td=e=n}while(e!==null);ld=6,td=null}function sf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do hf();while(Cd!==0);if($u&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===ed&&(td=ed=null,nd=0),Td=t,wd=e,Ed=n,Od=a,kd=r,cf(e,t,n,s,c,l,f)}}function cf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Dd=s,s|=yi,ut(e,n,s,r,i,a),jd=null,(n&335544064)===n?(Md=Ma(e),r=10262):(Md=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,wf(Ve,function(){return gf(),null})):(e.callbackNode=null,e.callbackPriority=0),Rl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=L.T,L.T=null,i=R.p,R.p=2,a=$u,$u|=4;try{pu(e,t,n)}finally{$u=a,R.p=i,L.T=r}}Cd=1,Rl?Ad=Rp(o,e.containerInfo,Md,df,ff,uf,pf,gf,lf,null,null):(df(),ff(),pf())}function lf(e){if(Cd!==0){var t=wd.onRecoverableError;t(e,{componentStack:null})}}function uf(){Cd===3&&(Cd=0,Nu(Td,wd),Cd=4)}function df(){if(Cd===1){Cd=0;var e=wd,t=Td,n=Ed,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=L.T,L.T=null;var i=R.p;R.p=2;var a=$u;$u|=4;try{uu=du=!1,ku(t,e,n),n=hp;var o=Ur(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Hr(s.ownerDocument.documentElement,s)){if(c!==null&&Wr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Vr(s,h),v=Vr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}Sh=!!mp,hp=mp=null}finally{$u=a,R.p=i,L.T=r}}e.current=t,Cd=2}}function ff(){if(Cd===2){Cd=0;var e=wd,t=Td,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=L.T,L.T=null;var r=R.p;R.p=2;var i=$u;$u|=4;try{hu(e,t.alternate,t)}finally{$u=i,R.p=r,L.T=n}}Cd=3}}function pf(){if(Cd===4||Cd===3){Cd=0;var e=Ad;Ad=null,Ie();var t=wd,n=Td,r=Ed,i=kd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Cd=5:(Cd=0,Td=wd=null,mf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Sd=null),ht(r),n=n.stateNode,qe&&typeof qe.onCommitFiberRoot==`function`)try{qe.onCommitFiberRoot(Ke,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=L.T,a=R.p,R.p=2,L.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{L.T=n,R.p=a}}if(i=jd,o=Md,Md=null,i!==null&&(jd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Ed&3&&hf(),jf(t),a=t.pendingLanes,r&261930&&a&42?t===Pd?Nd++:(Nd=0,Pd=t):(Nd=0,Pd=null),Mf(0,!1)}}function mf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ka(t)))}function hf(){return Ad!==null&&(Ad.skipTransition(),Ad=null),df(),ff(),pf(),gf()}function gf(){if(Cd!==5)return!1;var e=wd,t=Dd;Dd=0;var n=ht(Ed),r=L.T,a=R.p;try{R.p=32>n?32:n,L.T=null,n=Od,Od=null;var o=wd,s=Ed;if(Cd=0,Td=wd=null,Ed=0,$u&6)throw Error(i(331));var c=$u;if($u|=4,Ju(o.current),Bu(o,o.current,s,n),$u=c,Mf(0,!1),qe&&typeof qe.onPostCommitFiberRoot==`function`)try{qe.onPostCommitFiberRoot(Ke,o)}catch{}return!0}finally{R.p=a,L.T=r,mf(e,t)}}function _f(e,t,n){t=Ri(n,t),t=Ec(e.stateNode,t,2),e=mo(e,t,2),e!==null&&(lt(e,2),jf(e))}function vf(e,t,n){if(e.tag===3)_f(e,e,n);else for(;t!==null;){if(t.tag===3){_f(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Sd===null||!Sd.has(r))){e=Ri(n,e),n=Dc(2),r=mo(t,n,2),r!==null&&(Oc(n,r,t,e),lt(r,2),jf(r));break}}t=t.return}}function yf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Qu;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(sd=!0,i.add(n),e=bf.bind(null,e,t,n),t.then(e,e))}function bf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ed===e&&(nd&n)===n&&(ld===4||ld===3&&(nd&62914560)===nd&&300>Le()-vd?$u&2?fd|=n:Gd(e,0):fd|=n,md===nd&&(md=0)),jf(e)}function xf(e,t){t===0&&(t=st()),e=Ci(e,t),e!==null&&(lt(e,t),jf(e))}function Sf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),xf(e,n)}function Cf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),xf(e,n)}function wf(e,t){return Ne(e,t)}var Tf=null,Ef=null,Df=!1,Of=!1,kf=!1,Af=0;function jf(e){e!==Ef&&e.next===null&&(Ef===null?Tf=Ef=e:Ef=Ef.next=e),Of=!0,Df||(Df=!0,Rf())}function Mf(e,t){if(!kf&&Of){kf=!0;do for(var n=!1,r=Tf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ye(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Lf(r,a))}else a=nd,a=rt(r,r===ed?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||it(r,a)||(n=!0,Lf(r,a))}r=r.next}while(n);kf=!1}}function Nf(){Pf()}function Pf(){Of=Df=!1;var e=0;Af!==0&&Sp()&&(e=Af);for(var t=Le(),n=null,r=Tf;r!==null;){var i=r.next,a=Ff(r,t);a===0?(r.next=null,n===null?Tf=i:n.next=i,i===null&&(Ef=n)):(n=r,(e!==0||a&3)&&(Of=!0)),r=i}Cd!==0&&Cd!==5||Mf(e,!1),Af!==0&&(Af=0)}function Ff(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ye(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=ot(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=ed,n=nd,n=rt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(rd===2||rd===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Pe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||it(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Pe(r),ht(n)){case 2:case 8:n=Be;break;case 32:n=Ve;break;case 268435456:n=Ue;break;default:n=Ve}return r=If.bind(null,e),n=Ne(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Pe(r),e.callbackPriority=2,e.callbackNode=null,2}function If(e,t){if(Cd!==0&&Cd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(hf()&&e.callbackNode!==n)return null;var r=nd;return r=rt(e,e===ed?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(zd(e,r,t),Ff(e,Le()),e.callbackNode!=null&&e.callbackNode===n?If.bind(null,e):null)}function Lf(e,t){if(hf())return null;zd(e,t,!0)}function Rf(){Ep(function(){$u&6?Ne(ze,Nf):Pf()})}function zf(){if(Af===0){var e=Fa;e===0&&(e=$e,$e<<=1,!($e&261888)&&($e=256)),Af=e}return Af}function Bf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:pn(e)}function Vf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Bf((i[bt]||null).action),o=r.submitter;o&&(t=(t=o[bt]||null)?Bf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Fn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Af!==0){var e=new FormData(i,o);Qs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Qs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Hf=0;Hf<ui.length;Hf++){var Uf=ui[Hf];di(Uf.toLowerCase(),`on`+(Uf[0].toUpperCase()+Uf.slice(1)))}di(ni,`onAnimationEnd`),di(ri,`onAnimationIteration`),di(ii,`onAnimationStart`),di(`dblclick`,`onDoubleClick`),di(`focusin`,`onFocus`),di(`focusout`,`onBlur`),di(ai,`onTransitionRun`),di(oi,`onTransitionStart`),di(si,`onTransitionCancel`),di(ci,`onTransitionEnd`),Rt(`onMouseEnter`,[`mouseout`,`mouseover`]),Rt(`onMouseLeave`,[`mouseout`,`mouseover`]),Rt(`onPointerEnter`,[`pointerout`,`pointerover`]),Rt(`onPointerLeave`,[`pointerout`,`pointerover`]),Lt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Lt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Lt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Lt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Lt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Lt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Wf=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),Gf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Wf));function Kf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){gi(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){gi(e)}i.currentTarget=null,a=c}}}}function qf(e,t){var n=t[St];n===void 0&&(n=t[St]=new Set);var r=e+`__bubble`;n.has(r)||(Qf(t,e,2,!1),n.add(r))}function Jf(e,t,n){var r=0;t&&(r|=4),Qf(n,e,r,t)}var Yf=`_reactListening`+Math.random().toString(36).slice(2);function Xf(e){if(!e[Yf]){e[Yf]=!0,Ft.forEach(function(t){t!==`selectionchange`&&(Gf.has(t)||Jf(t,!1,e),Jf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Yf]||(t[Yf]=!0,Jf(`selectionchange`,!1,t))}}function Qf(e,t,n,r){switch(kh(t)){case 2:var i=Ch;break;case 8:i=wh;break;default:i=Th}n=i.bind(null,t,n,e),i=void 0,!wn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function ep(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var c=r.stateNode.containerInfo;if(c===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;c!==null;){if(o=kt(c),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue a}c=c.parentNode}}r=r.return}xn(function(){var r=a,i=gn(n),o=[];a:{var c=li.get(e);if(c!==void 0){var l=Fn,u=e;switch(e){case`keypress`:if(An(n)===0)break a;case`keydown`:case`keyup`:l=$n;break;case`focusin`:u=`focus`,l=Wn;break;case`focusout`:u=`blur`,l=Wn;break;case`beforeblur`:case`afterblur`:l=Wn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Hn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Un;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=nr;break;case ni:case ri:case ii:l=Gn;break;case ci:l=rr;break;case`scroll`:case`scrollend`:l=Ln;break;case`wheel`:l=ir;break;case`copy`:case`cut`:case`paste`:l=Kn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=er;break;case`submit`:l=tr;break;case`toggle`:case`beforetoggle`:l=ar}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=Sn(m,p),g!=null&&d.push(tp(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),o.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==hn&&(u=n.relatedTarget||n.fromElement)&&(kt(u)||u[xt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?kt(l):null,l!==null&&(f=s(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Hn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=er,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:jt(c),h=l==null?u:jt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,kt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?w(c,l,rp):null,c!==null&&ip(o,u,c,d,!1),l!==null&&f!==null&&ip(o,f,l,d,!0)))}a:{if(c=r?jt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Tr;else if(yr(c)){if(Er)_=Fr;else{_=Nr;var v=Mr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&dn(r.elementType)&&(_=Tr):_=Pr;if(_&&=_(e,r)){br(o,_,n,i);break a}v&&v(e,c,r)}switch(v=r?jt(r):window,e){case`focusin`:(yr(v)||v.contentEditable===`true`)&&(Kr=v,qr=r,Jr=null);break;case`focusout`:Jr=qr=Kr=null;break;case`mousedown`:Yr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Yr=!1,Xr(o,n,i);break;case`selectionchange`:if(Gr)break;case`keydown`:case`keyup`:Xr(o,n,i)}var y;if(sr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else hr?pr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(ur&&n.locale!==`ko`&&(hr||b!==`onCompositionStart`?b===`onCompositionEnd`&&hr&&(y=kn()):(En=i,Dn=`value`in En?En.value:En.textContent,hr=!0)),v=np(r,b),0<v.length&&(b=new qn(b,e,null,n,i),o.push({event:b,listeners:v}),y?b.data=y:(y=mr(n),y!==null&&(b.data=y)))),(y=lr?gr(e,n):_r(e,n))&&(b=np(r,`onBeforeInput`),0<b.length&&(v=new qn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:v,listeners:b}),v.data=y)),Vf(o,e,r,n,i)}Kf(o,t)})}function tp(e,t,n){return{instance:e,listener:t,currentTarget:n}}function np(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Sn(e,n),i!=null&&r.unshift(tp(e,i,a)),i=Sn(e,t),i!=null&&r.push(tp(e,i,a))),e.tag===3)return r;e=e.return}return[]}function rp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ip(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=Sn(n,a),l!=null&&o.unshift(tp(n,l,c))):i||(l=Sn(n,a),l!=null&&o.push(tp(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var ap=/\r\n?/g,op=/\u0000|\uFFFD/g;function sp(e){return(typeof e==`string`?e:``+e).replace(ap,`
19
- `).replace(op,``)}function cp(e,t){return t=sp(t),sp(e)===t}function lp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||sn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&sn(e,``+r);else return;break;case`className`:Gt(e,`class`,r);break;case`tabIndex`:Gt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Gt(e,n,r);break;case`style`:un(e,r,o);return;case`data`:if(t!==`object`){Gt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=pn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&lp(e,t,`name`,a.name,a,null),lp(e,t,`formEncType`,a.formEncType,a,null),lp(e,t,`formMethod`,a.formMethod,a,null),lp(e,t,`formTarget`,a.formTarget,a,null)):(lp(e,t,`encType`,a.encType,a,null),lp(e,t,`method`,a.method,a,null),lp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=pn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=mn);return;case`onScroll`:r!=null&&qf(`scroll`,e);return;case`onScrollEnd`:r!=null&&qf(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=pn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:qf(`beforetoggle`,e),qf(`toggle`,e),Wt(e,`popover`,r);break;case`xlinkActuate`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Wt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=fn.get(n)||n,Wt(e,n,r);else return}B=!0}function G(e,t,n,r,a,o){switch(n){case`style`:un(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)sn(e,r);else if(typeof r==`number`||typeof r==`bigint`)sn(e,``+r);else return;break;case`onScroll`:r!=null&&qf(`scroll`,e);return;case`onScrollEnd`:r!=null&&qf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=mn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!It.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[bt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}B=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Wt(e,n,r)}return}B=!0}function up(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:qf(`error`,e),qf(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:lp(e,t,o,s,n,null)}}a&&lp(e,t,`srcSet`,n.srcSet,n,null),r&&lp(e,t,`src`,n.src,n,null);return;case`input`:qf(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:lp(e,t,r,d,n,null)}}tn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in qf(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:lp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&rn(e,!!r,n,!0):rn(e,!!r,t,!1);return;case`textarea`:for(s in qf(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:lp(e,t,s,c,n,null)}on(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:lp(e,t,l,r,n,null)}return;case`dialog`:qf(`beforetoggle`,e),qf(`toggle`,e),qf(`cancel`,e),qf(`close`,e);break;case`iframe`:case`object`:qf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Wf.length;r++)qf(Wf[r],e);break;case`image`:qf(`error`,e),qf(`load`,e);break;case`details`:qf(`toggle`,e);break;case`embed`:case`source`:case`link`:qf(`error`,e),qf(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:lp(e,t,u,r,n,null)}return;default:if(dn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&G(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&lp(e,t,c,r,n,null))}var dp={};function fp(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||lp(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(B=!0),o=m;break;case`name`:m!==f&&(B=!0),a=m;break;case`checked`:m!==f&&(B=!0),u=m;break;case`defaultChecked`:m!==f&&(B=!0),d=m;break;case`value`:m!==f&&(B=!0),s=m;break;case`defaultValue`:m!==f&&(B=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&lp(e,t,p,m,r,f)}}en(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||lp(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(B=!0),p=o;break;case`defaultValue`:o!==l&&(B=!0),c=o;break;case`multiple`:o!==l&&(B=!0),s=o;default:o!==l&&lp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?rn(e,!!n,n?[]:``,!1):rn(e,!!n,t,!0)):rn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:lp(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(B=!0),p=a;break;case`defaultValue`:a!==o&&(B=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&lp(e,t,s,a,r,o)}an(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:lp(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(B=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:lp(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&lp(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:lp(e,t,u,p,r,m)}return;default:if(dn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&G(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||G(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&lp(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||lp(e,t,f,p,r,m)}function K(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function pp(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&K(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&K(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var mp=null,hp=null;function gp(e){return e.nodeType===9?e:e.ownerDocument}function _p(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function vp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function yp(e,t,n,r){return n=gp(n).createElement(e),n[yt]=r,n[bt]=t,up(n,e,t),Nt(n),n}function bp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var xp=null;function Sp(){var e=window.event;return e&&e.type===`popstate`?e!==xp&&(xp=e,!0):(xp=null,!1)}var Cp=typeof setTimeout==`function`?setTimeout:void 0,wp=typeof clearTimeout==`function`?clearTimeout:void 0,Tp=typeof Promise==`function`?Promise:void 0,q=typeof requestAnimationFrame==`function`?requestAnimationFrame:Cp,Ep=typeof queueMicrotask==`function`?queueMicrotask:Tp===void 0?Cp:function(e){return Tp.resolve(null).then(e).catch(Dp)};function Dp(e){setTimeout(function(){throw e})}function Op(e){return e===`head`}function kp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Jh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Cm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Cm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Et]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Cm(e.ownerDocument.body)}n=i}while(n);Jh(t)}function Ap(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function jp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Mp(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Np(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Pp(e){return Np(e.getBoundingClientRect(),getComputedStyle(e),e)}function Fp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Np(t,n,e)}function Ip(e){return e.documentElement.clientHeight}function Lp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Rp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ip(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=nh(f),u>ah){s.length=o;break}f=new Promise(Lp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function zp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}zp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:T({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},zp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},zp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Bp(e){return{name:e,group:new zp(`group`,e),imagePair:new zp(`image-pair`,e),old:new zp(`old`,e),new:new zp(`new`,e)}}function Vp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Vp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Kp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Wp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),p(this._fragmentFiber.child,!1,Hp,e,s,r)}this._eventListeners=a}};function Hp(e,t,n,r){return v(e).addEventListener(t,n,r),!1}Vp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Kp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Wp(i.optionsOrUseCapture),p(this._fragmentFiber.child,!1,Up,e,n,i),r.splice(t,1),a!==null&&a()}};function Up(e,t,n,r){return v(e).removeEventListener(t,n,r),!1}function Wp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Gp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Kp(e,t,n,r){if(e.length===0)return-1;r=Gp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Gp(a.optionsOrUseCapture)===r)return i}return-1}Vp.prototype.dispatchEvent=function(e){var t=m(this._fragmentFiber);if(t===null)return!0;t=v(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Wp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Wp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Vp.prototype.focus=function(e){p(this._fragmentFiber.child,!0,qp,e,void 0,void 0)};function qp(e,t){return e.tag!==6&&(e=v(e),ym(e,t))}Vp.prototype.focusLast=function(e){var t=[];p(this._fragmentFiber.child,!0,Jp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!qp(t[n],e);n--);};function Jp(e,t){return t.push(e),!1}Vp.prototype.blur=function(){var e=m(this._fragmentFiber);e!==null&&(e=v(e),e=gp(e).activeElement,e!==null&&p(this._fragmentFiber.child,!1,Yp,e,void 0,void 0))};function Yp(e,t){return e.tag!==6&&(e=v(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Vp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),p(this._fragmentFiber.child,!1,Xp,e,void 0,void 0)};function Xp(e,t){return e.tag!==6&&(e=v(e),t.observe(e),!1)}Vp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),p(this._fragmentFiber.child,!1,Zp,e,void 0,void 0);for(var n=t=0;n<Qp.length;n++){var r=Qp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Qp[t++]=r}Qp.length=t}};function Zp(e,t){return e.tag!==6&&(e=v(e),t.unobserve(e),!1)}var Qp=[],$p=!1;function em(e,t,n){Qp.push({fragmentInstance:e,observer:t,instance:n}),$p||($p=!0,bm(function(){$p=!1;var e=Qp;Qp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Vp.prototype.getClientRects=function(){var e=[];return p(this._fragmentFiber.child,!1,tm,e,void 0,void 0),e};function tm(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=v(e),t.push.apply(t,e.getClientRects());return!1}Vp.prototype.getRootNode=function(e){var t=m(this._fragmentFiber);return t===null?this:v(t).getRootNode(e)},Vp.prototype.compareDocumentPosition=function(e){var t=m(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];p(this._fragmentFiber.child,!1,Jp,n,void 0,void 0);var r=v(t);if(n.length===0){if(n=r,h(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=g(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=v(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=v(n[0]),i=v(n[n.length-1]);var a=h(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||nm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function nm(e,t,n,r,i){var a=kt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=m(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=w(n,a,C),t===null?t=!1:(p(t,!0,x,a,n),a=y,y=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=w(r,a,C),t===null?t=!1:(p(t,!0,S,a,r),a=y,b=y=null,t=a!==null)),t):!1}function rm(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Vp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];p(this._fragmentFiber.child,!1,Jp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=g(this._fragmentFiber);if(r=n?r[1]||r[0]||m(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=v(r),rm(e,n);return}if(r=v(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=v(a),rm(a,n)):v(a).scrollIntoView(e),r+=n?-1:1}};function im(e,t){return e=v(e),am(e,t),!1}function am(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function om(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Wp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Qp.length;i++){var a=Qp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Qp[r++]=a)}Qp.length=r,n.observe(e)}),am(e,t))}function sm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Wp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?em(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function cm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:cm(n),Ot(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function lm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[Et])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=hm(e.nextSibling),e===null)break}return null}function um(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=hm(e.nextSibling),e===null))return null;return e}function dm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=hm(e.nextSibling),e===null))return null;return e}function fm(e){return e.data===`$?`||e.data===`$~`}function pm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function mm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function hm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var gm=null;function _m(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return hm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function vm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ym(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function bm(e){q(function(){q(function(t){return e(t)})})}function xm(e,t,n){switch(t=gp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Sm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&lp(e,t,r,null,dp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===mn&&(e.onclick=null),Ot(e)}function Cm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ot(e)}var wm=new Map,Tm=new Set;function Em(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Dm=R.d;R.d={f:Om,r:km,D:Mm,C:Nm,L:Pm,m:Fm,X:Lm,S:Im,M:Rm};function Om(){var e=Dm.f(),t=Ud();return e||t}function km(e){var t=At(e);t!==null&&t.tag===5&&t.type===`form`?ec(t):Dm.r(e)}var Am=typeof document>`u`?null:document;function jm(e,t,n){var r=Am;if(r&&typeof t==`string`&&t){var i=$t(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Tm.has(i)||(Tm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),up(t,`link`,e),Nt(t),r.head.appendChild(t)))}}function Mm(e){Dm.D(e),jm(`dns-prefetch`,e,null)}function Nm(e,t){Dm.C(e,t),jm(`preconnect`,e,t)}function Pm(e,t,n){Dm.L(e,t,n);var r=Am;if(r&&e&&t){var i=`link[rel="preload"][as="`+$t(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+$t(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+$t(n.imageSizes)+`"]`)):i+=`[href="`+$t(e)+`"]`;var a=i;switch(t){case`style`:a=Bm(e);break;case`script`:a=Wm(e)}if(!(wm.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),wm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Vm(a))||t===`script`&&r.querySelector(Gm(a))))){var o=r.createElement(`link`);up(o,`link`,e),t===`style`&&(o[Dt]=!0,o.onload=o.onerror=function(){Pt(o)}),Nt(o),r.head.appendChild(o)}}}function Fm(e,t){Dm.m(e,t);var n=Am;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+$t(r)+`"][href="`+$t(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Wm(e)}if(!wm.has(a)&&(e=T({rel:`modulepreload`,href:e},t),wm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Gm(a)))return}r=n.createElement(`link`),up(r,`link`,e),Nt(r),n.head.appendChild(r)}}}function Im(e,t,n){Dm.S(e,t,n);var r=Am;if(r&&e){var i=Mt(r).hoistableStyles,a=Bm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Vm(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=wm.get(a))&&Jm(e,n);var c=o=r.createElement(`link`);Nt(c),up(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,qm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Lm(e,t){Dm.X(e,t);var n=Am;if(n&&e){var r=Mt(n).hoistableScripts,i=Wm(e),a=r.get(i);a||(a=n.querySelector(Gm(i)),a||(e=T({src:e,async:!0},t),(t=wm.get(i))&&Ym(e,t),a=n.createElement(`script`),Nt(a),up(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Rm(e,t){Dm.M(e,t);var n=Am;if(n&&e){var r=Mt(n).hoistableScripts,i=Wm(e),a=r.get(i);a||(a=n.querySelector(Gm(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=wm.get(i))&&Ym(e,t),a=n.createElement(`script`),Nt(a),up(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function zm(e,t,n,r){var a=(a=be.current)?Em(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Bm(n.href),t=Mt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Bm(n.href);var o=Mt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Vm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=wm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},wm.set(e,o)),Um(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Wm(n),t=Mt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Bm(e){return`href="`+$t(e)+`"`}function Vm(e){return`link[rel="stylesheet"][`+e+`]`}function Hm(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function Um(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Dt]){r.loading=1;return}}else t=e.createElement(`link`),t[Dt]=!0,t.onload=t.onerror=Pt.bind(null,t),up(t,`link`,n),Nt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Wm(e){return`[src="`+$t(e)+`"]`}function Gm(e){return`script[async]`+e}function Km(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+$t(n.href)+`"]`);if(r)return t.instance=r,Nt(r),r;var a=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Nt(r),up(r,`style`,a),qm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Bm(n.href);var o=e.querySelector(Vm(a));if(o)return t.state.loading|=4,t.instance=o,Nt(o),o;r=Hm(n),(a=wm.get(a))&&Jm(r,a),o=(e.ownerDocument||e).createElement(`link`),Nt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),up(o,`link`,r),t.state.loading|=4,qm(o,n.precedence,e),t.instance=o;case`script`:return o=Wm(n.src),(a=e.querySelector(Gm(o)))?(t.instance=a,Nt(a),a):(r=n,(a=wm.get(o))&&(r=T({},n),Ym(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Nt(a),up(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,qm(r,n.precedence,e));return t.instance}function qm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Jm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Ym(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Xm=null;function Zm(e,t,n){if(Xm===null){var r=new Map,i=Xm=new Map;i.set(n,r)}else i=Xm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Et]||a[yt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Qm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function $m(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function eh(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function th(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function nh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function rh(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=nh(t),e.suspenseyImages.push(t)),e=lh.bind(e),t.decode().then(e,e))}function ih(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Bm(r.href),a=t.querySelector(Vm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ch.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Nt(a);return}a=t.ownerDocument||t,r=Hm(r),(i=wm.get(i))&&Jm(r,i),a=a.createElement(`link`),Nt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),up(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=ch.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ah=0;function oh(e,t){return e.stylesheets&&e.count===0&&dh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&dh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ah===0&&(ah=62500*pp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&dh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ah?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function sh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)dh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function ch(){this.count--,sh(this)}function lh(){this.imgCount--,sh(this)}var uh=null;function dh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,uh=new Map,t.forEach(fh,e),uh=null,ch.call(e))}function fh(e,t){if(!(t.state.loading&4)){var n=uh.get(e);if(n)var r=n.get(null);else{n=new Map,uh.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=ch.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var ph={$$typeof:M,Provider:null,Consumer:null,_currentValue:fe,_currentValue2:fe,_threadCount:0};function mh(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ct(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ct(0),this.hiddenUpdates=ct(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function hh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new mh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Oi(3,null,null,t),e.current=a,a.stateNode=e,t=Oa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},uo(a),e}function gh(e){return e?(e=Ei,e):Ei}function _h(e,t,n,r,i,a){i=gh(i),r.context===null?r.context=i:r.pendingContext=i,r=po(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=mo(e,r,t),n!==null&&(Rd(n,e,t),ho(n,e,t))}function vh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function yh(e,t){vh(e,t),(e=e.alternate)&&vh(e,t)}function bh(e){if(e.tag===13||e.tag===31){var t=Ci(e,67108864);t!==null&&Rd(t,e,67108864),yh(e,67108864)}}function xh(e){if(e.tag===13||e.tag===31){var t=Fd();t=mt(t);var n=Ci(e,t);n!==null&&Rd(n,e,t),yh(e,t)}}var Sh=!0;function Ch(e,t,n,r){var i=L.T;L.T=null;var a=R.p;try{R.p=2,Th(e,t,n,r)}finally{R.p=a,L.T=i}}function wh(e,t,n,r){var i=L.T;L.T=null;var a=R.p;try{R.p=8,Th(e,t,n,r)}finally{R.p=a,L.T=i}}function Th(e,t,n,r){if(Sh){var i=Eh(r);if(i===null)ep(e,t,r,Dh,n),Rh(e,r);else if(Bh(i,e,t,n,r))r.stopPropagation();else if(Rh(e,r),t&4&&-1<Lh.indexOf(e)){for(;i!==null;){var a=At(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=nt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ye(o);s.entanglements[1]|=c,o&=~c}jf(a),!($u&6)&&(bd=Le()+500,Mf(0,!1))}}break;case 31:case 13:s=Ci(a,2),s!==null&&Rd(s,a,2),Ud(),yh(a,2)}if(a=Eh(r),a===null&&ep(e,t,r,Dh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else ep(e,t,r,null,n)}}function Eh(e){return e=gn(e),Oh(e)}var Dh=null;function Oh(e){if(Dh=null,e=kt(e),e!==null){var t=s(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=c(t),e!==null)return e;e=null}else if(n===31){if(e=l(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Dh=e,null}function kh(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Re()){case ze:return 2;case Be:return 8;case Ve:case He:return 32;case Ue:return 268435456;default:return 32}default:return 32}}var Ah=!1,jh=null,Mh=null,Nh=null,Ph=new Map,Fh=new Map,Ih=[],Lh=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Rh(e,t){switch(e){case`focusin`:case`focusout`:jh=null;break;case`dragenter`:case`dragleave`:Mh=null;break;case`mouseover`:case`mouseout`:Nh=null;break;case`pointerover`:case`pointerout`:Ph.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Fh.delete(t.pointerId)}}function zh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=At(t),t!==null&&bh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Bh(e,t,n,r,i){switch(t){case`focusin`:return jh=zh(jh,e,t,n,r,i),!0;case`dragenter`:return Mh=zh(Mh,e,t,n,r,i),!0;case`mouseover`:return Nh=zh(Nh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Ph.set(a,zh(Ph.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Fh.set(a,zh(Fh.get(a)||null,e,t,n,r,i)),!0}return!1}function Vh(e){var t=kt(e.target);if(t!==null){var n=s(t);if(n!==null){if(t=n.tag,t===13){if(t=c(n),t!==null){e.blockedOn=t,_t(e.priority,function(){xh(n)});return}}else if(t===31){if(t=l(n),t!==null){e.blockedOn=t,_t(e.priority,function(){xh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Hh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Eh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);hn=r,n.target.dispatchEvent(r),hn=null}else return t=At(n),t!==null&&bh(t),e.blockedOn=n,!1;t.shift()}return!0}function Uh(e,t,n){Hh(e)&&n.delete(t)}function Wh(){Ah=!1,jh!==null&&Hh(jh)&&(jh=null),Mh!==null&&Hh(Mh)&&(Mh=null),Nh!==null&&Hh(Nh)&&(Nh=null),Ph.forEach(Uh),Fh.forEach(Uh)}function Gh(e,n){e.blockedOn===n&&(e.blockedOn=null,Ah||(Ah=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Wh)))}var Kh=null;function qh(e){Kh!==e&&(Kh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Kh===e&&(Kh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Oh(r||n)===null)continue;break}var a=At(n);a!==null&&(e.splice(t,3),t-=3,Qs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Jh(e){function t(t){return Gh(t,e)}jh!==null&&Gh(jh,e),Mh!==null&&Gh(Mh,e),Nh!==null&&Gh(Nh,e),Ph.forEach(t),Fh.forEach(t);for(var n=0;n<Ih.length;n++){var r=Ih[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ih.length&&(n=Ih[0],n.blockedOn===null);)Vh(n),n.blockedOn===null&&Ih.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[bt]||null;if(typeof a==`function`)o||qh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[bt]||null)s=o.formAction;else if(Oh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),qh(n)}}}function Yh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Xh(e){this._internalRoot=e}Zh.prototype.render=Xh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;_h(n,Fd(),e,t,null,null)},Zh.prototype.unmount=Xh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;_h(e.current,2,null,e,null,null),Ud(),t[xt]=null}};function Zh(e){this._internalRoot=e}Zh.prototype.unstable_scheduleHydration=function(e){if(e){var t=gt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ih.length&&t!==0&&t<Ih[n].priority;n++);Ih.splice(n,0,e),n===0&&Vh(e)}};var Qh=n.version;if(Qh!==`19.3.0`)throw Error(i(527,Qh,`19.3.0`));R.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var $h={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:L,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var eg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!eg.isDisabled&&eg.supportsFiber)try{Ke=eg.inject($h),qe=eg}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=xc,s=Sc,c=Cc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=hh(e,1,!1,null,null,n,r,null,o,s,c,Yh),e[xt]=t.current,Xf(e),new Xh(t)}})),tp=n(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=ep()}))(),np={info:3600,success:3e3,warning:5e3,error:6e3},rp,ip=[],ap=0,op=new Set;function sp(){for(let e of[...op])e()}function cp(e,t,n){let r=t.trim();if(!r)return;let i=rp?.message===r?rp:ip.find(e=>e.message===r);if(i){if(n?.action&&!i.action){let e={...i,action:n.action};i===rp?rp=e:ip=ip.map(t=>t===i?e:t),sp()}return}let a={id:++ap,kind:e,message:r,duration:n?.duration??np[e],...n?.action?{action:n.action}:{}};rp?ip=[...ip,a].slice(-3):rp=a,sp()}function lp(e){rp?.id===e&&(rp=ip[0],ip=ip.slice(1),sp())}var G=Object.assign((e,t)=>cp(`info`,e,t),{success:(e,t)=>cp(`success`,e,t),error:(e,t)=>cp(`error`,e,t),warning:(e,t)=>cp(`warning`,e,t),info:(e,t)=>cp(`info`,e,t)});function up(e){return op.add(e),()=>{op.delete(e)}}function dp(){return{item:(0,m.useSyncExternalStore)(up,()=>rp,()=>void 0),waiting:(0,m.useSyncExternalStore)(up,()=>ip.length,()=>0)}}function fp(e){return e instanceof Error?e.message:`That did not work. Try again.`}async function K(e,t,n={}){try{let r=await z(e,t),i=r.notice;return i&&G(i,n.undo?{action:{label:`Undo`,onClick:n.undo}}:void 0),r}catch(e){G.error(fp(e));return}}var pp=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function mp(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:pp(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var hp=e=>{let t=``,n=!1;for(let r of e){if(r===`-`||r===`_`||r<=` `){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t},gp=e=>{let t=hp(e);return t.charAt(0).toUpperCase()+t.slice(1)},_p=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),vp={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function yp(e){return e!=null}function bp(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??vp.width,a=e.size??e.height??vp.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?_p(...c):_p(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??vp[`stroke-width`])*Number(e.size??e.width??vp.width)/Number(t.size??t.width??vp.width):t.strokeWidth??vp[`stroke-width`];return[`svg`,{...Object.entries(vp).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&yp(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&yp(t.width)&&{[r(`width`)]:t.width},...`height`in t&&yp(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function xp(e,t={}){return bp(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var Sp=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Cp=(0,m.createContext)({}),wp=()=>(0,m.useContext)(Cp),Tp=(0,m.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:h=2,absoluteStrokeWidth:g=!1,nonScalingStroke:_=!1,color:v=`currentColor`,className:y=``}=wp()??{},b=!!c||Sp(d),[x,S,C=[]]=xp(u,{color:e??v,width:n??t??p,height:r??t??p,strokeWidth:i??h,absoluteStrokeWidth:a??g,nonScalingStroke:o??_,className:_p(y,s),hasA11yProp:b,attributes:d});return(0,m.createElement)(x,{ref:f,...S},[...C.map(([e,t])=>(0,m.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function q(e,t=[],n=[]){let r=typeof e==`string`?mp(e,t,n):e,i=(0,m.forwardRef)(({className:e,...t},n)=>(0,m.createElement)(Tp,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=gp(r.name)),i}var Ep={name:`archive-restore`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]};Ep.node;var Dp=q(Ep),Op={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};Op.node;var kp=q(Op),Ap={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};Ap.node;var jp=q(Ap),Mp={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};Mp.node;var Np=q(Mp),Pp={name:`arrow-right-to-line`,size:24,node:[[`path`,{d:`M17 12H3`,key:`8awo09`}],[`path`,{d:`m11 18 6-6-6-6`,key:`8c2y43`}],[`path`,{d:`M21 5v14`,key:`nzette`}]]};Pp.node;var Fp=q(Pp),Ip={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};Ip.node;var Lp=q(Ip),Rp={name:`bell-off`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]};Rp.node;var zp=q(Rp),Bp={name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]};Bp.node;var Vp=q(Bp),Hp={name:`bold`,size:24,node:[[`path`,{d:`M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8`,key:`mg9rjx`}]]};Hp.node;var Up=q(Hp),Wp={name:`book-open`,size:24,node:[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]};Wp.node;var Gp=q(Wp),Kp={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};Kp.node;var qp=q(Kp),Jp={name:`brain`,size:24,node:[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]};Jp.node;var Yp=q(Jp),Xp={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Xp.node;var Zp=q(Xp),Qp={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};Qp.node;var $p=q(Qp),em={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};em.node;var tm=q(em),nm={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};nm.node;var rm=q(nm),im={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};im.node;var am=q(im),om={name:`circle-alert`,size:24,node:[[`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`}]],aliases:[`alert-circle`]};om.node;var sm=q(om),cm={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};cm.node;var lm=q(cm),um={name:`circle-dashed`,size:24,node:[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]};um.node;var dm=q(um),fm={name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};fm.node;var pm=q(fm),mm={name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`help-circle`,`circle-help`]};mm.node;var hm=q(mm),gm={name:`circle-slash`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]};gm.node;var _m=q(gm),vm={name:`circle-stop`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,key:`1ssd4o`}]],aliases:[`stop-circle`]};vm.node;var ym=q(vm),bm={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]};bm.node;var xm=q(bm),Sm={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Sm.node;var Cm=q(Sm),wm={name:`code-xml`,size:24,node:[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]],aliases:[`code-2`]};wm.node;var Tm=q(wm),Em={name:`code`,size:24,node:[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]};Em.node;var Dm=q(Em),Om={name:`columns-2`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]],aliases:[`columns`]};Om.node;var km=q(Om),Am={name:`compass`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]};Am.node;var jm=q(Am),Mm={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};Mm.node;var Nm=q(Mm),Pm={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};Pm.node;var Fm=q(Pm),Im={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};Im.node;var Lm=q(Im),Rm={name:`file-code`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]};Rm.node;var zm=q(Rm),Bm={name:`file-code-corner`,size:24,node:[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]],aliases:[`file-code-2`]};Bm.node;var Vm=q(Bm),Hm={name:`file-pen`,size:24,node:[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]],aliases:[`file-edit`]};Hm.node;var Um=q(Hm),Wm={name:`file-plus-corner`,size:24,node:[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`,key:`17jvcc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 19h6`,key:`bvotb8`}],[`path`,{d:`M17 16v6`,key:`18yu1i`}]],aliases:[`file-plus-2`]};Wm.node;var Gm=q(Wm),Km={name:`file-plus`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]};Km.node;var qm=q(Km),Jm={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};Jm.node;var Ym=q(Jm),Xm={name:`file-x-corner`,size:24,node:[[`path`,{d:`M11 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5`,key:`1jo35a`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m15 17 5 5`,key:`36xl1x`}],[`path`,{d:`m20 17-5 5`,key:`vdz27y`}]],aliases:[`file-x-2`]};Xm.node;var Zm=q(Xm),Qm={name:`file`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]};Qm.node;var $m=q(Qm),eh={name:`folder-open`,size:24,node:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]};eh.node;var th=q(eh),nh={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};nh.node;var rh=q(nh),ih={name:`git-pull-request`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]};ih.node;var ah=q(ih),oh={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};oh.node;var sh=q(oh),ch={name:`italic`,size:24,node:[[`line`,{x1:`19`,x2:`10`,y1:`4`,y2:`4`,key:`15jd3p`}],[`line`,{x1:`14`,x2:`5`,y1:`20`,y2:`20`,key:`bu0au3`}],[`line`,{x1:`15`,x2:`9`,y1:`4`,y2:`20`,key:`uljnxc`}]]};ch.node;var lh=q(ch),uh={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};uh.node;var dh=q(uh),fh={name:`keyboard`,size:24,node:[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]};fh.node;var ph=q(fh),mh={name:`library`,size:24,node:[[`path`,{d:`m16 6 4 14`,key:`ji33uf`}],[`path`,{d:`M12 6v14`,key:`1n7gus`}],[`path`,{d:`M8 8v12`,key:`1gg7y9`}],[`path`,{d:`M4 4v16`,key:`6qkkli`}]]};mh.node;var hh=q(mh),gh={name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]};gh.node;var _h=q(gh),vh={name:`list-ordered`,size:24,node:[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]};vh.node;var yh=q(vh),bh={name:`list`,size:24,node:[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]};bh.node;var xh=q(bh),Sh={name:`loader`,size:24,node:[[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m16.2 7.8 2.9-2.9`,key:`r700ao`}],[`path`,{d:`M18 12h4`,key:`wj9ykh`}],[`path`,{d:`m16.2 16.2 2.9 2.9`,key:`1bxg5t`}],[`path`,{d:`M12 18v4`,key:`jadmvz`}],[`path`,{d:`m4.9 19.1 2.9-2.9`,key:`bwix9q`}],[`path`,{d:`M2 12h4`,key:`j09sii`}],[`path`,{d:`m4.9 4.9 2.9 2.9`,key:`giyufr`}]]};Sh.node;var Ch=q(Sh),wh={name:`maximize-2`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]};wh.node;var Th=q(wh),Eh={name:`maximize`,size:24,node:[[`path`,{d:`M8 3H5a2 2 0 0 0-2 2v3`,key:`1dcmit`}],[`path`,{d:`M21 8V5a2 2 0 0 0-2-2h-3`,key:`1e4gt3`}],[`path`,{d:`M3 16v3a2 2 0 0 0 2 2h3`,key:`wsl5sc`}],[`path`,{d:`M16 21h3a2 2 0 0 0 2-2v-3`,key:`18trek`}]]};Eh.node;var Dh=q(Eh),Oh={name:`message-circle-question-mark`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`message-circle-question`]};Oh.node;var kh=q(Oh),Ah={name:`message-square-plus`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]};Ah.node;var jh=q(Ah),Mh={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]};Mh.node;var Nh=q(Mh),Ph={name:`messages-square`,size:24,node:[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]};Ph.node;var Fh=q(Ph),Ih={name:`minimize-2`,size:24,node:[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]};Ih.node;var Lh=q(Ih),Rh={name:`minimize`,size:24,node:[[`path`,{d:`M8 3v3a2 2 0 0 1-2 2H3`,key:`hohbtr`}],[`path`,{d:`M21 8h-3a2 2 0 0 1-2-2V3`,key:`5jw1f3`}],[`path`,{d:`M3 16h3a2 2 0 0 1 2 2v3`,key:`198tvr`}],[`path`,{d:`M16 21v-3a2 2 0 0 1 2-2h3`,key:`ph8mxp`}]]};Rh.node;var zh=q(Rh),Bh={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};Bh.node;var Vh=q(Bh),Hh={name:`palette`,size:24,node:[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]};Hh.node;var Uh=q(Hh),Wh={name:`panel-left-close`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]],aliases:[`sidebar-close`]};Wh.node;var Gh=q(Wh),Kh={name:`panel-left`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]],aliases:[`sidebar`]};Kh.node;var qh=q(Kh),Jh={name:`panel-right`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]};Jh.node;var Yh=q(Jh),Xh={name:`paperclip`,size:24,node:[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]};Xh.node;var Zh=q(Xh),Qh={name:`pen-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]],aliases:[`edit-3`]};Qh.node;var $h=q(Qh),eg={name:`pencil-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]};eg.node;var tg=q(eg),ng={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};ng.node;var rg=q(ng),ig={name:`picture-in-picture-2`,size:24,node:[[`path`,{d:`M21 9V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h4`,key:`daa4of`}],[`rect`,{width:`10`,height:`7`,x:`12`,y:`13`,rx:`2`,key:`1nb8gs`}]]};ig.node;var ag=q(ig),og={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};og.node;var sg=q(og),cg={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};cg.node;var lg=q(cg),ug={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};ug.node;var dg=q(ug),fg={name:`rotate-ccw-clock`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],aliases:[`history`]};fg.node;var pg=q(fg),mg={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};mg.node;var hg=q(mg),gg={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};gg.node;var _g=q(gg),vg={name:`route`,size:24,node:[[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,key:`1d8sl`}],[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}]]};vg.node;var yg=q(vg),bg={name:`rows-3`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]],aliases:[`panels-top-bottom`]};bg.node;var xg=q(bg),Sg={name:`save`,size:24,node:[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]};Sg.node;var Cg=q(Sg),wg={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};wg.node;var Tg=q(wg),Eg={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};Eg.node;var Dg=q(Eg),Og={name:`shield-check`,size:24,node:[[`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:`m9 12 2 2 4-4`,key:`dzmm74`}]]};Og.node;var kg=q(Og),Ag={name:`skip-forward`,size:24,node:[[`path`,{d:`M21 4v16`,key:`7j8fe9`}],[`path`,{d:`M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z`,key:`zs4d6`}]]};Ag.node;var jg=q(Ag),Mg={name:`square-arrow-out-up-right`,size:24,node:[[`path`,{d:`M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6`,key:`y09zxi`}],[`path`,{d:`m21 3-9 9`,key:`mpx6sq`}],[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}]],aliases:[`arrow-up-right-from-square`]};Mg.node;var Ng=q(Mg),Pg={name:`square-pen`,size:24,node:[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]],aliases:[`pen-box`,`edit`,`pen-square`]};Pg.node;var Fg=q(Pg),Ig={name:`square-terminal`,size:24,node:[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]],aliases:[`terminal-square`]};Ig.node;var Lg=q(Ig),Rg={name:`sun`,size:24,node:[[`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`}]]};Rg.node;var zg=q(Rg),Bg={name:`tags`,size:24,node:[[`path`,{d:`M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z`,key:`16rjxf`}],[`path`,{d:`M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193`,key:`178nd4`}],[`circle`,{cx:`10.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`12ikhr`}]]};Bg.node;var Vg=q(Bg),Hg={name:`telescope`,size:24,node:[[`path`,{d:`m10.065 12.493-6.18 1.318a.934.934 0 0 1-1.108-.702l-.537-2.15a1.07 1.07 0 0 1 .691-1.265l13.504-4.44`,key:`k4qptu`}],[`path`,{d:`m13.56 11.747 4.332-.924`,key:`19l80z`}],[`path`,{d:`m16 21-3.105-6.21`,key:`7oh9d`}],[`path`,{d:`M16.485 5.94a2 2 0 0 1 1.455-2.425l1.09-.272a1 1 0 0 1 1.212.727l1.515 6.06a1 1 0 0 1-.727 1.213l-1.09.272a2 2 0 0 1-2.425-1.455z`,key:`m7xp4m`}],[`path`,{d:`m6.158 8.633 1.114 4.456`,key:`74o979`}],[`path`,{d:`m8 21 3.105-6.21`,key:`1fvxut`}],[`circle`,{cx:`12`,cy:`13`,r:`2`,key:`1c1ljs`}]]};Hg.node;var Ug=q(Hg),Wg={name:`text-wrap`,size:24,node:[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]],aliases:[`wrap-text`]};Wg.node;var Gg=q(Wg),Kg={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};Kg.node;var qg=q(Kg),Jg={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};Jg.node;var Yg=q(Jg),Xg={name:`undo-2`,size:24,node:[[`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`}]]};Xg.node;var Zg=q(Xg),Qg={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]};Qg.node;var $g=q(Qg),e_={name:`volume-2`,size:24,node:[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]};e_.node;var t_=q(e_),n_={name:`volume-x`,size:24,node:[[`path`,{d:`M11 4.702a.7.7 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.7.7 0 0 0 11 19.298z`,key:`1p7khw`}],[`path`,{d:`m16.5 14.5 5-5`,key:`cul3yw`}],[`path`,{d:`m16.5 9.5 5 5`,key:`1akey5`}]]};n_.node;var r_=q(n_),i_={name:`wifi-off`,size:24,node:[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};i_.node;var a_=q(i_),o_={name:`workflow`,size:24,node:[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]};o_.node;var s_=q(o_),c_={name:`wrench`,size:24,node:[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]};c_.node;var l_=q(c_),u_={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};u_.node;var d_=q(u_);function f_(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=f_(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function p_(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=f_(e))&&(r&&(r+=` `),r+=t);return r}var m_=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},h_=(e,t)=>({classGroupId:e,validator:t}),g_=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),__=`-`,v_=[],y_=`arbitrary..`,b_=e=>{let t=C_(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return S_(e);let n=e.split(__);return x_(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?m_(i,t):t:i||v_}return n[e]||v_}}},x_=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=x_(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(__):e.slice(t).join(__),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},S_=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?y_+r:void 0})(),C_=e=>{let{theme:t,classGroups:n}=e;return w_(n,t)},w_=(e,t)=>{let n=g_();for(let r in e){let i=e[r];T_(i,n,r,t)}return n},T_=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];E_(i,t,n,r)}},E_=(e,t,n,r)=>{if(typeof e==`string`){D_(e,t,n);return}if(typeof e==`function`){O_(e,t,n,r);return}k_(e,t,n,r)},D_=(e,t,n)=>{let r=e===``?t:A_(t,e);r.classGroupId=n},O_=(e,t,n,r)=>{if(j_(e)){T_(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(h_(n,e))},k_=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];T_(o,A_(t,a),n,r)}},A_=(e,t)=>{let n=e,r=t.split(__),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=g_(),n.nextPart.set(t,i)),n=i}return n},j_=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,M_=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},N_=`!`,P_=`:`,F_=[],I_=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),L_=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===P_){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(N_)?(c=s.slice(0,-1),l=!0):s.startsWith(N_)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return I_(t,l,c,u)};if(t){let e=t+P_,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):I_(F_,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},R_=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},z_=e=>({cache:M_(e.cacheSize),parseClassName:L_(e),sortModifiers:R_(e),postfixLookupClassGroupIds:B_(e),...b_(e)}),B_=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},V_=/\s+/,H_=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(V_),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+N_:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},U_=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=W_(n))&&(i&&(i+=` `),i+=r);return i},W_=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=W_(e[r]))&&(n&&(n+=` `),n+=t);return n},G_=(e,...t)=>{let n,r,i,a,o=o=>(n=z_(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=H_(e,n);return i(e,a),a};return a=o,(...e)=>a(U_(...e))},K_=[],q_=e=>{let t=t=>t[e]||K_;return t.isThemeGetter=!0,t.themeKey=e,t},J_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Y_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,X_=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Z_=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Q_=/\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$/,$_=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,ev=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,tv=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,nv=e=>X_.test(e),rv=e=>!!e&&!Number.isNaN(Number(e)),iv=e=>!!e&&Number.isInteger(Number(e)),av=e=>e.endsWith(`%`)&&rv(e.slice(0,-1)),ov=e=>Z_.test(e),sv=()=>!0,cv=e=>Q_.test(e)&&!$_.test(e),lv=()=>!1,uv=e=>ev.test(e),dv=e=>tv.test(e),fv=e=>!J(e)&&!Y(e),pv=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),mv=e=>kv(e,Nv,lv),J=e=>J_.test(e),hv=e=>kv(e,Pv,cv),gv=e=>kv(e,Fv,rv),_v=e=>kv(e,Lv,sv),vv=e=>kv(e,Iv,lv),yv=e=>kv(e,jv,lv),bv=e=>kv(e,Mv,dv),xv=e=>kv(e,Rv,uv),Y=e=>Y_.test(e),Sv=e=>Av(e,Pv),Cv=e=>Av(e,Iv),wv=e=>Av(e,jv),Tv=e=>Av(e,Nv),Ev=e=>Av(e,Mv),Dv=e=>Av(e,Rv,!0),Ov=e=>Av(e,Lv,!0),kv=(e,t,n)=>{let r=J_.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Av=(e,t,n=!1)=>{let r=Y_.exec(e);return r?r[1]?t(r[1]):n:!1},jv=e=>e===`position`||e===`percentage`,Mv=e=>e===`image`||e===`url`,Nv=e=>e===`length`||e===`size`||e===`bg-size`,Pv=e=>e===`length`,Fv=e=>e===`number`,Iv=e=>e===`family-name`,Lv=e=>e===`number`||e===`weight`,Rv=e=>e===`shadow`,zv=G_(()=>{let e=q_(`color`),t=q_(`font`),n=q_(`text`),r=q_(`font-weight`),i=q_(`tracking`),a=q_(`leading`),o=q_(`breakpoint`),s=q_(`container`),c=q_(`spacing`),l=q_(`radius`),u=q_(`shadow`),d=q_(`inset-shadow`),f=q_(`text-shadow`),p=q_(`drop-shadow`),m=q_(`blur`),h=q_(`perspective`),g=q_(`aspect`),_=q_(`ease`),v=q_(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Y,J],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Y,J,c],T=()=>[nv,`full`,`auto`,...w()],E=()=>[iv,`none`,`subgrid`,Y,J],D=()=>[`auto`,{span:[`full`,iv,Y,J]},iv,Y,J],O=()=>[iv,`auto`,Y,J],k=()=>[`auto`,`min`,`max`,`fr`,Y,J],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],ee=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],j=()=>[`auto`,...w()],M=()=>[nv,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],N=()=>[s,nv,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],P=()=>[nv,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],F=()=>[e,Y,J],te=()=>[...b(),wv,yv,{position:[Y,J]}],ne=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],re=()=>[`auto`,`cover`,`contain`,Tv,mv,{size:[Y,J]}],ie=()=>[av,Sv,hv],ae=()=>[``,`none`,`full`,l,Y,J],oe=()=>[``,rv,Sv,hv],se=()=>[`solid`,`dashed`,`dotted`,`double`],ce=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],I=()=>[rv,av,wv,yv],le=()=>[``,`none`,m,Y,J],ue=()=>[`none`,rv,Y,J],de=()=>[`none`,rv,Y,J],L=()=>[rv,Y,J],R=()=>[nv,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[ov],breakpoint:[ov],color:[sv],container:[ov],"drop-shadow":[ov],ease:[`in`,`out`,`in-out`],font:[fv],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[ov],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[ov],shadow:[ov],spacing:[`px`,rv],text:[ov],"text-shadow":[ov],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,nv,J,Y,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Y,J]}],"container-named":[pv],columns:[{columns:[rv,`auto`,J,Y,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"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`],sr:[`sr-only`,`not-sr-only`],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:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[iv,`auto`,Y,J]}],basis:[{basis:[nv,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[rv,nv,`auto`,`initial`,`none`,J]}],grow:[{grow:[``,rv,Y,J]}],shrink:[{shrink:[``,rv,Y,J]}],order:[{order:[iv,`first`,`last`,`none`,Y,J]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...ee(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...ee()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...ee(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...ee(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...ee(),`baseline`]}],"place-self":[{"place-self":[`auto`,...ee()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mbs:[{mbs:j()}],mbe:[{mbe:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:M()}],"inline-size":[{inline:[`auto`,...N()]}],"min-inline-size":[{"min-inline":[`auto`,...N()]}],"max-inline-size":[{"max-inline":[`none`,...N()]}],"block-size":[{block:[`auto`,...P()]}],"min-block-size":[{"min-block":[`auto`,...P()]}],"max-block-size":[{"max-block":[`none`,...P()]}],w:[{w:[s,`screen`,...M()]}],"min-w":[{"min-w":[s,`screen`,`none`,...M()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...M()]}],h:[{h:[`screen`,`lh`,...M()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...M()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...M()]}],"font-size":[{text:[`base`,n,Sv,hv]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Ov,_v]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,av,J]}],"font-family":[{font:[Cv,vv,t]}],"font-features":[{"font-features":[J]}],"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:[i,Y,J]}],"line-clamp":[{"line-clamp":[rv,`none`,Y,gv]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,Y,J]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Y,J]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:F()}],"text-color":[{text:F()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...se(),`wavy`]}],"text-decoration-thickness":[{decoration:[rv,`from-font`,`auto`,Y,hv]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[rv,`auto`,Y,J]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[iv,Y,J]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Y,J]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Y,J]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:te()}],"bg-repeat":[{bg:ne()}],"bg-size":[{bg:re()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},iv,Y,J],radial:[``,Y,J],conic:[``,iv,Y,J]},Ev,bv]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:ie()}],"gradient-via-pos":[{via:ie()}],"gradient-to-pos":[{to:ie()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:ae()}],"rounded-s":[{"rounded-s":ae()}],"rounded-e":[{"rounded-e":ae()}],"rounded-t":[{"rounded-t":ae()}],"rounded-r":[{"rounded-r":ae()}],"rounded-b":[{"rounded-b":ae()}],"rounded-l":[{"rounded-l":ae()}],"rounded-ss":[{"rounded-ss":ae()}],"rounded-se":[{"rounded-se":ae()}],"rounded-ee":[{"rounded-ee":ae()}],"rounded-es":[{"rounded-es":ae()}],"rounded-tl":[{"rounded-tl":ae()}],"rounded-tr":[{"rounded-tr":ae()}],"rounded-br":[{"rounded-br":ae()}],"rounded-bl":[{"rounded-bl":ae()}],"border-w":[{border:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-bs":[{"border-bs":oe()}],"border-w-be":[{"border-be":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...se(),`hidden`,`none`]}],"divide-style":[{divide:[...se(),`hidden`,`none`]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-bs":[{"border-bs":F()}],"border-color-be":[{"border-be":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...se(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[rv,Y,J]}],"outline-w":[{outline:[``,rv,Sv,hv]}],"outline-color":[{outline:F()}],shadow:[{shadow:[``,`inner`,`none`,u,Dv,xv]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":[`none`,d,Dv,xv]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:oe()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[rv,hv]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":[`none`,f,Dv,xv]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[rv,Y,J]}],"mix-blend":[{"mix-blend":[...ce(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ce()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[rv]}],"mask-image-linear-from-pos":[{"mask-linear-from":I()}],"mask-image-linear-to-pos":[{"mask-linear-to":I()}],"mask-image-linear-from-color":[{"mask-linear-from":F()}],"mask-image-linear-to-color":[{"mask-linear-to":F()}],"mask-image-t-from-pos":[{"mask-t-from":I()}],"mask-image-t-to-pos":[{"mask-t-to":I()}],"mask-image-t-from-color":[{"mask-t-from":F()}],"mask-image-t-to-color":[{"mask-t-to":F()}],"mask-image-r-from-pos":[{"mask-r-from":I()}],"mask-image-r-to-pos":[{"mask-r-to":I()}],"mask-image-r-from-color":[{"mask-r-from":F()}],"mask-image-r-to-color":[{"mask-r-to":F()}],"mask-image-b-from-pos":[{"mask-b-from":I()}],"mask-image-b-to-pos":[{"mask-b-to":I()}],"mask-image-b-from-color":[{"mask-b-from":F()}],"mask-image-b-to-color":[{"mask-b-to":F()}],"mask-image-l-from-pos":[{"mask-l-from":I()}],"mask-image-l-to-pos":[{"mask-l-to":I()}],"mask-image-l-from-color":[{"mask-l-from":F()}],"mask-image-l-to-color":[{"mask-l-to":F()}],"mask-image-x-from-pos":[{"mask-x-from":I()}],"mask-image-x-to-pos":[{"mask-x-to":I()}],"mask-image-x-from-color":[{"mask-x-from":F()}],"mask-image-x-to-color":[{"mask-x-to":F()}],"mask-image-y-from-pos":[{"mask-y-from":I()}],"mask-image-y-to-pos":[{"mask-y-to":I()}],"mask-image-y-from-color":[{"mask-y-from":F()}],"mask-image-y-to-color":[{"mask-y-to":F()}],"mask-image-radial":[{"mask-radial":[Y,J]}],"mask-image-radial-from-pos":[{"mask-radial-from":I()}],"mask-image-radial-to-pos":[{"mask-radial-to":I()}],"mask-image-radial-from-color":[{"mask-radial-from":F()}],"mask-image-radial-to-color":[{"mask-radial-to":F()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[rv]}],"mask-image-conic-from-pos":[{"mask-conic-from":I()}],"mask-image-conic-to-pos":[{"mask-conic-to":I()}],"mask-image-conic-from-color":[{"mask-conic-from":F()}],"mask-image-conic-to-color":[{"mask-conic-to":F()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:te()}],"mask-repeat":[{mask:ne()}],"mask-size":[{mask:re()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Y,J]}],filter:[{filter:[``,`none`,Y,J]}],blur:[{blur:le()}],brightness:[{brightness:[rv,Y,J]}],contrast:[{contrast:[rv,Y,J]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Dv,xv]}],"drop-shadow-color":[{"drop-shadow":F()}],grayscale:[{grayscale:[``,rv,Y,J]}],"hue-rotate":[{"hue-rotate":[rv,Y,J]}],invert:[{invert:[``,rv,Y,J]}],saturate:[{saturate:[rv,Y,J]}],sepia:[{sepia:[``,rv,Y,J]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Y,J]}],"backdrop-blur":[{"backdrop-blur":le()}],"backdrop-brightness":[{"backdrop-brightness":[rv,Y,J]}],"backdrop-contrast":[{"backdrop-contrast":[rv,Y,J]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,rv,Y,J]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[rv,Y,J]}],"backdrop-invert":[{"backdrop-invert":[``,rv,Y,J]}],"backdrop-opacity":[{"backdrop-opacity":[rv,Y,J]}],"backdrop-saturate":[{"backdrop-saturate":[rv,Y,J]}],"backdrop-sepia":[{"backdrop-sepia":[``,rv,Y,J]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Y,J]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[rv,`initial`,Y,J]}],ease:[{ease:[`linear`,`initial`,_,Y,J]}],delay:[{delay:[rv,Y,J]}],animate:[{animate:[`none`,v,Y,J]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Y,J]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ue()}],"rotate-x":[{"rotate-x":ue()}],"rotate-y":[{"rotate-y":ue()}],"rotate-z":[{"rotate-z":ue()}],scale:[{scale:de()}],"scale-x":[{"scale-x":de()}],"scale-y":[{"scale-y":de()}],"scale-z":[{"scale-z":de()}],"scale-3d":[`scale-3d`],skew:[{skew:L()}],"skew-x":[{"skew-x":L()}],"skew-y":[{"skew-y":L()}],transform:[{transform:[Y,J,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:R()}],"translate-x":[{"translate-x":R()}],"translate-y":[{"translate-y":R()}],"translate-z":[{"translate-z":R()}],"translate-none":[`translate-none`],zoom:[{zoom:[iv,Y,J]}],accent:[{accent:F()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:F()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],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`,Y,J]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":F()}],"scrollbar-track-color":[{"scrollbar-track":F()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"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`,Y,J]}],fill:[{fill:[`none`,...F()]}],"stroke-w":[{stroke:[rv,Sv,hv,gv]}],stroke:[{stroke:[`none`,...F()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`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-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function X(...e){return zv(p_(e))}var Bv=4,Vv=320,Hv=.9;function Uv(e,t){let n=e.scrollTop>Bv,r=e.scrollTop+e.clientHeight<e.scrollHeight-Bv;if(!t)return{up:n,down:r,top:0,right:0};let i=e.getBoundingClientRect(),a=t.getBoundingClientRect();return{up:n,down:r,top:i.top-a.top+i.height/2,right:a.right-i.right+8}}function Wv(e,t){return e.up===t.up&&e.down===t.down&&Math.abs(e.top-t.top)<.5&&Math.abs(e.right-t.right)<.5}function Gv({target:e,up:t=!0,down:n=!0,className:r}){let i=(0,m.useRef)(null),[a,o]=(0,m.useState)({up:!1,down:!1,top:0,right:0}),s=(0,m.useRef)(null);(0,m.useEffect)(()=>{let t=e.current;if(!t)return;t.setAttribute(`data-scroll-hints`,``);let n=0,r=()=>{n=0;let e=Uv(t,i.current?.offsetParent);o(t=>Wv(t,e)?t:e)},a=()=>{n||=requestAnimationFrame(r)};r(),t.addEventListener(`scroll`,a,{passive:!0}),window.addEventListener(`resize`,a);let s=new ResizeObserver(a);s.observe(t);for(let e of t.children)s.observe(e);let c=new MutationObserver(()=>{for(let e of t.children)s.observe(e);a()});return c.observe(t,{childList:!0,subtree:!0}),()=>{cancelAnimationFrame(n),t.removeEventListener(`scroll`,a),window.removeEventListener(`resize`,a),s.disconnect(),c.disconnect(),t.removeAttribute(`data-scroll-hints`)}},[e]),(0,m.useEffect)(()=>()=>c(),[]);function c(){s.current&&=(clearTimeout(s.current.timer),cancelAnimationFrame(s.current.frame),null)}function l(){return window.matchMedia(`(prefers-reduced-motion: no-preference)`).matches?`smooth`:`auto`}function u(t){let n=e.current;n&&n.scrollBy({top:t*Math.max(80,n.clientHeight*.8),behavior:l()})}function d(t){c();let n={timer:0,frame:0,held:!1};n.timer=window.setTimeout(()=>{n.held=!0;let r=performance.now(),i=a=>{e.current?.scrollBy({top:t*(a-r)*Hv}),r=a,n.frame=requestAnimationFrame(i)};n.frame=requestAnimationFrame(i)},Vv),s.current=n}function f(e,t){return(0,W.jsx)(`button`,{type:`button`,tabIndex:-1,"data-shown":t||void 0,"data-direction":e===1?`down`:`up`,title:e===1?`Scroll down · hold to keep going`:`Scroll up · hold to keep going`,onPointerDown:t=>{t.button===0&&(t.preventDefault(),d(e))},onPointerUp:()=>{let t=s.current?.held;c(),t===!1&&u(e)},onPointerLeave:c,onPointerCancel:c,className:`scroll-hint grid size-7 place-items-center rounded-md border bg-card/85 text-muted-foreground shadow-card hover:text-foreground`,children:(0,W.jsx)(e===1?$p:am,{"aria-hidden":`true`,className:`size-4`})})}let p=t&&a.up,h=n&&a.down;return(0,W.jsxs)(`div`,{ref:i,"aria-hidden":`true`,"data-slot":`scroll-hints`,"data-active":p||h||void 0,style:{top:a.top,right:a.right},className:X(`scroll-hints pointer-events-none absolute z-20 flex -translate-y-1/2 flex-col gap-1.5`,r),children:[t?f(-1,p):null,n?f(1,h):null]})}var Kv=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,qv=p_,Jv=(e,t)=>n=>{if(t?.variants==null)return qv(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Kv(t)||Kv(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return qv(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Yv=Object.defineProperty,Xv=(e,t)=>Yv(e,`name`,{value:t,configurable:!0});function Zv(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Xv(Zv,`setRef`);function Qv(...e){return t=>{let n=!1,r=e.map(e=>{let r=Zv(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Zv(e[t],null)}}}}Xv(Qv,`composeRefs`);function $v(...e){return m.useCallback(Qv(...e),e)}Xv($v,`useComposedRefs`);var ey=Object.defineProperty,ty=(e,t)=>ey(e,`name`,{value:t,configurable:!0});function ny(e){let t=m.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];dy(r)&&typeof hy==`function`&&(r=hy(r._payload)),m.Children.forEach(r,e=>{if(ly(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;dy(n)&&typeof hy==`function`&&(n=hy(n._payload)),a=oy(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=m.cloneElement(a,void 0,s):!o&&m.Children.count(r)===1&&m.isValidElement(r)&&(a=r);let c=a?cy(a):void 0,l=$v(n,c);if(!a){if(r||r===0)throw Error(o?my(e):py(e));return r}let u=sy(i,a.props??{});return a.type!==m.Fragment&&(u.ref=n?l:c),m.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}ty(ny,`createSlot`);var ry=ny(`Slot`),iy=Symbol.for(`radix.slottable`);function ay(e){let t=ty(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=iy,t}ty(ay,`createSlottable`);var oy=ty((e,t)=>{if(`child`in e.props){let t=e.props.child;return m.isValidElement(t)?m.cloneElement(t,void 0,e.props.children(t.props.children)):null}return m.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function sy(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}ty(sy,`mergeProps`);function cy(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}ty(cy,`getElementRef`);function ly(e){return m.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===iy}ty(ly,`isSlottable`);var uy=Symbol.for(`react.lazy`);function dy(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===uy&&`_payload`in e&&fy(e._payload)}ty(dy,`isLazyComponent`);function fy(e){return typeof e==`object`&&!!e&&`then`in e}ty(fy,`isPromiseLike`);var py=ty(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),my=ty(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),hy=m.use,gy=t($f(),1),_y=Object.defineProperty,vy=(e,t)=>_y(e,`name`,{value:t,configurable:!0}),yy=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=ny(`Primitive.${t}`),r=m.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,W.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function by(e,t){e&&gy.flushSync(()=>e.dispatchEvent(t))}vy(by,`dispatchDiscreteCustomEvent`);var xy=Object.defineProperty,Sy=(e,t)=>xy(e,`name`,{value:t,configurable:!0}),Cy=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`}),wy=m.forwardRef(Sy(function(e,t){return(0,W.jsx)(yy.span,{...e,ref:t,style:{...Cy,...e.style}})},`VisuallyHidden`)),Ty=Object.defineProperty,Ey=(e,t)=>Ty(e,`name`,{value:t,configurable:!0});function Dy(e,t){let n=m.createContext(t);n.displayName=e+`Context`;let r=Ey(e=>{let{children:t,...r}=e,i=m.useMemo(()=>r,Object.values(r));return(0,W.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=m.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return Ey(i,`useContext`),[r,i]}Ey(Dy,`createContext`);function Oy(e,t=[]){let n=[];function r(t,r){let i=m.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=Ey(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=m.useMemo(()=>o,Object.values(o));return(0,W.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=m.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return Ey(s,`useContext`),[o,s]}Ey(r,`createContext`);let i=Ey(()=>{let t=n.map(e=>m.createContext(e));return Ey(function(n){let r=n?.[e]||t;return m.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,ky(i,...t)]}Ey(Oy,`createContextScope`);function ky(...e){let t=e[0];if(e.length===1)return t;let n=Ey(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return Ey(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Ey(ky,`composeContextScopes`);var Ay=Object.defineProperty,jy=(e,t)=>Ay(e,`name`,{value:t,configurable:!0}),My=!!(typeof window<`u`&&window.document&&window.document.createElement);function Ny(e,t,{checkForDefaultPrevented:n=!0}={}){return jy(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}jy(Ny,`composeEventHandlers`);function Py(e){if(!My)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}jy(Py,`getOwnerWindow`);function Fy(e){if(!My)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}jy(Fy,`getOwnerDocument`);function Iy(e,t=!1){let{activeElement:n}=Fy(e);if(!n?.nodeName)return null;if(Ly(n)&&n.contentDocument)return Iy(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Fy(n).getElementById(e);if(t)return t}}return n}jy(Iy,`getActiveElement`);function Ly(e){return e.tagName===`IFRAME`}jy(Ly,`isFrame`);var Ry=globalThis?.document?m.useLayoutEffect:()=>{},zy=Object.defineProperty,By=(e,t)=>zy(e,`name`,{value:t,configurable:!0}),Vy=m.useEffectEvent,Hy=m.useInsertionEffect;function Uy(e){if(typeof Vy==`function`)return Vy(e);let t=m.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Hy==`function`?Hy(()=>{t.current=e}):Ry(()=>{t.current=e}),m.useMemo(()=>((...e)=>t.current?.(...e)),[])}By(Uy,`useEffectEvent`);var Wy=Object.defineProperty,Gy=(e,t)=>Wy(e,`name`,{value:t,configurable:!0}),Ky=m.useInsertionEffect||Ry;function qy({prop:e,defaultProp:t,onChange:n=Gy(()=>{},`onChange`),caller:r}){let[i,a,o]=Jy({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,m.useCallback(t=>{if(s){let n=Yy(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Gy(qy,`useControllableState`);function Jy({defaultProp:e,onChange:t}){let[n,r]=m.useState(e),i=m.useRef(n),a=m.useRef(t);return Ky(()=>{a.current=t},[t]),m.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Gy(Jy,`useUncontrolledState`);function Yy(e){return typeof e==`function`}Gy(Yy,`isFunction`);var Xy=Symbol(`RADIX:SYNC_STATE`);function Zy(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Uy(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=m.useReducer((t,n)=>{if(n.type===Xy)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,h=m.useRef(p);m.useEffect(()=>{h.current!==p&&(h.current=p,c||l(p))},[p,h,c]);let g=m.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return m.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Xy,state:i})},[i,d.state,c]),[g,f]}Gy(Zy,`useControllableStateReducer`);var Qy=Object.defineProperty,$y=(e,t)=>Qy(e,`name`,{value:t,configurable:!0});function eb(e,t){return m.useReducer((e,n)=>t[e][n]??e,e)}$y(eb,`useStateMachine`);var tb=$y(e=>{let{present:t,children:n}=e,r=nb(t),i=typeof n==`function`?n({present:r.isPresent}):m.Children.only(n),a=ib(r.ref,ob(i));return typeof n==`function`||r.isPresent?m.cloneElement(i,{ref:a}):null},`Presence`);function nb(e){let[t,n]=m.useState(),r=m.useRef(null),i=m.useRef(e),a=m.useRef(`none`),o=m.useRef(void 0),[s,c]=eb(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return m.useEffect(()=>{s===`mounted`?(a.current=o.current??ab(r.current),o.current=void 0):a.current=`none`},[s]),Ry(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=ab(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),Ry(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=$y(a=>{let o=ab(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=$y(e=>{e.target===t&&(a.current=ab(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:m.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=ab(t)}else r.current=null;n(e)},[])}}$y(nb,`usePresence`);function rb(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}$y(rb,`setRef`);function ib(...e){let t=m.useRef(e);return t.current=e,m.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=rb(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():rb(n[e],null)}}},[])}$y(ib,`useStableComposedRefs`);function ab(e){return e?.animationName||`none`}$y(ab,`getAnimationName`);function ob(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}$y(ob,`getElementRef`);var sb=Object.defineProperty,cb=(e,t)=>sb(e,`name`,{value:t,configurable:!0}),lb=m.useId||(()=>void 0),ub=0;function db(e){let[t,n]=m.useState(lb());return Ry(()=>{e||n(e=>e??String(ub++))},[e]),e||(t?`radix-${t}`:``)}cb(db,`useId`);var fb=Object.defineProperty,pb=(e,t)=>fb(e,`name`,{value:t,configurable:!0});function mb(e){let t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>((...e)=>t.current?.(...e)),[])}pb(mb,`useCallbackRef`);var hb=Object.defineProperty,gb=(e,t)=>hb(e,`name`,{value:t,configurable:!0}),_b=`dismissableLayer.update`,vb=`dismissableLayer.pointerDownOutside`,yb=`dismissableLayer.focusOutside`,bb,xb=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Sb=m.forwardRef(gb(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=m.useContext(xb),[d,f]=m.useState(null),p=d?.ownerDocument??globalThis?.document,[,h]=m.useState({}),g=$v(t,f),_=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?_.indexOf(v):-1,b=d?_.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=m.useRef(!1),w=Tb(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:m.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=Eb(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?b===_.length-1:!1,D=mb(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return m.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E,D]),m.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(bb=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Db(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=bb))}},[d,p,n,u]),m.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Db())},[d,u]),m.useEffect(()=>{let e=gb(()=>h({}),`handleUpdate`);return document.addEventListener(_b,e),()=>document.removeEventListener(_b,e)},[]),(0,W.jsx)(yy.div,{...l,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:Ny(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Ny(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Ny(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function Cb(){let e=m.useContext(xb),[t,n]=m.useState(null);return m.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}gb(Cb,`useDismissableLayerSurface`);var wb=gb(()=>!0,`IS_TRUE`);function Tb(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=wb}=t,s=mb(e),c=m.useRef(!1),l=m.useRef(!1),u=m.useRef(new Map),d=m.useRef(()=>{});return m.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}gb(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}gb(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}gb(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}gb(p,`handleInteractionBubble`);let m=gb(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||Ob(vb,s,p,{discrete:!0})};if(gb(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:gb(()=>c.current=!0,`onPointerDownCapture`)}}gb(Tb,`usePointerDownOutside`);function Eb(e,t=globalThis?.document){let n=mb(e),r=m.useRef(!1);return m.useEffect(()=>{let e=gb(e=>{e.target&&!r.current&&Ob(yb,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:gb(()=>r.current=!0,`onFocusCapture`),onBlurCapture:gb(()=>r.current=!1,`onBlurCapture`)}}gb(Eb,`useFocusOutside`);function Db(){let e=new CustomEvent(_b);document.dispatchEvent(e)}gb(Db,`dispatchUpdate`);function Ob(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?by(i,a):i.dispatchEvent(a)}gb(Ob,`handleAndDispatchCustomEvent`);var kb=Object.defineProperty,Ab=(e,t)=>kb(e,`name`,{value:t,configurable:!0}),jb=`focusScope.autoFocusOnMount`,Mb=`focusScope.autoFocusOnUnmount`,Nb={bubbles:!1,cancelable:!0},Pb=m.forwardRef(Ab(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=m.useState(null),l=mb(i),u=mb(a),d=m.useRef(null),f=$v(t,c),p=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Vb(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Vb(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Vb(s)};Ab(e,`handleFocusIn`),Ab(t,`handleFocusOut`),Ab(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),m.useEffect(()=>{if(s){Hb.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(jb,Nb);s.addEventListener(jb,l),s.dispatchEvent(t),t.defaultPrevented||(Fb(Gb(Lb(s)),{select:!0}),document.activeElement===e&&Vb(s))}return()=>{s.removeEventListener(jb,l),setTimeout(()=>{let t=new CustomEvent(Mb,Nb);s.addEventListener(Mb,u),s.dispatchEvent(t),t.defaultPrevented||Vb(e??document.body,{select:!0}),s.removeEventListener(Mb,u),Hb.remove(p)},0)}}},[s,l,u,p]);let h=m.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Ib(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Vb(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Vb(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,W.jsx)(yy.div,{tabIndex:-1,...o,ref:f,onKeyDown:h})},`FocusScope`));function Fb(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Vb(r,{select:t}),document.activeElement!==n)return}Ab(Fb,`focusFirst`);function Ib(e){let t=Lb(e);return[Rb(t,e),Rb(t.reverse(),e)]}Ab(Ib,`getTabbableEdges`);function Lb(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Ab(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}Ab(Lb,`getTabbableCandidates`);function Rb(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):zb(r,{upTo:t})))return r}Ab(Rb,`findVisible`);function zb(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}Ab(zb,`isHidden`);function Bb(e){return e instanceof HTMLInputElement&&`select`in e}Ab(Bb,`isSelectableInput`);function Vb(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Bb(e)&&t&&e.select()}}Ab(Vb,`focus`);var Hb=Ub();function Ub(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Wb(e,t),e.unshift(t)},remove(t){e=Wb(e,t),e[0]?.resume()}}}Ab(Ub,`createFocusScopesStack`);function Wb(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Ab(Wb,`arrayRemove`);function Gb(e){return e.filter(e=>e.tagName!==`A`)}Ab(Gb,`removeLinks`);var Kb=Object.defineProperty,qb=m.forwardRef(((e,t)=>Kb(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=m.useState(!1);Ry(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?gy.createPortal((0,W.jsx)(yy.div,{...r,ref:t}),o):null},`Portal`)),Jb=Object.defineProperty,Yb=(e,t)=>Jb(e,`name`,{value:t,configurable:!0}),Xb=0,Zb=null;function Qb(e){return $b(),e.children}Yb(Qb,`FocusGuards`);function $b(){m.useEffect(()=>{Zb||={start:ex(),end:ex()};let{start:e,end:t}=Zb;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Xb++,()=>{Xb===1&&(Zb?.start.remove(),Zb?.end.remove(),Zb=null),Xb=Math.max(0,Xb-1)}},[])}Yb($b,`useFocusGuards`);function ex(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Yb(ex,`createFocusGuard`);var tx=function(){return tx=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},tx.apply(this,arguments)};function nx(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function rx(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var ix=`right-scroll-bar-position`,ax=`width-before-scroll-bar`,ox=`with-scroll-bars-hidden`,sx=`--removed-body-scroll-bar-size`;function cx(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function lx(e,t){var n=(0,m.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var ux=typeof window<`u`?m.useLayoutEffect:m.useEffect,dx=new WeakMap;function fx(e,t){var n=lx(t||null,function(t){return e.forEach(function(e){return cx(e,t)})});return ux(function(){var t=dx.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||cx(e,null)}),i.forEach(function(e){r.has(e)||cx(e,a)})}dx.set(n,e)},[e]),n}function px(e){return e}function mx(e,t){t===void 0&&(t=px);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function hx(e){e===void 0&&(e={});var t=mx(null);return t.options=tx({async:!0,ssr:!1},e),t}var gx=function(e){var t=e.sideCar,n=nx(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return m.createElement(r,tx({},n))};gx.isSideCarExport=!0;function _x(e,t){return e.useMedium(t),gx}var vx=hx(),yx=function(){},bx=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:yx,onWheelCapture:yx,onTouchMoveCapture:yx}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=nx(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=fx([n,t]),w=tx(tx({},x),i);return m.createElement(m.Fragment,null,u&&m.createElement(S,{sideCar:vx,removeScrollBar:l,shards:d,noRelative:p,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?m.cloneElement(m.Children.only(s),tx(tx({},w),{ref:C})):m.createElement(y,tx({},w,{className:c,ref:C}),s))});bx.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},bx.classNames={fullWidth:ax,zeroRight:ix};var xx=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Sx(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=xx();return t&&e.setAttribute(`nonce`,t),e}function Cx(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function wx(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Tx=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Sx())&&(Cx(t,n),wx(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ex=function(){var e=Tx();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Dx=function(){var e=Ex();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Ox={left:0,top:0,right:0,gap:0},kx=function(e){return parseInt(e||``,10)||0},Ax=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[kx(n),kx(r),kx(i)]},jx=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Ox;var t=Ax(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Mx=Dx(),Nx=`data-scroll-locked`,Px=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
20
- .${ox} {
21
- overflow: hidden ${r};
22
- padding-right: ${s}px ${r};
23
- }
24
- body[${Nx}] {
25
- overflow: hidden ${r};
26
- overscroll-behavior: contain;
27
- ${[t&&`position: relative ${r};`,n===`margin`&&`
28
- padding-left: ${i}px;
29
- padding-top: ${a}px;
30
- padding-right: ${o}px;
31
- margin-left:0;
32
- margin-top:0;
33
- margin-right: ${s}px ${r};
34
- `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
35
- }
36
-
37
- .${ix} {
38
- right: ${s}px ${r};
39
- }
40
-
41
- .${ax} {
42
- margin-right: ${s}px ${r};
43
- }
44
-
45
- .${ix} .${ix} {
46
- right: 0 ${r};
47
- }
48
-
49
- .${ax} .${ax} {
50
- margin-right: 0 ${r};
51
- }
52
-
53
- body[${Nx}] {
54
- ${sx}: ${s}px;
55
- }
56
- `},Fx=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Ix=function(){m.useEffect(function(){return document.body.setAttribute(Nx,(Fx()+1).toString()),function(){var e=Fx()-1;e<=0?document.body.removeAttribute(Nx):document.body.setAttribute(Nx,e.toString())}},[])},Lx=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Ix();var a=m.useMemo(function(){return jx(i)},[i]);return m.createElement(Mx,{styles:Px(a,!t,i,n?``:`!important`)})},Rx=!1;if(typeof window<`u`)try{var zx=Object.defineProperty({},"passive",{get:function(){return Rx=!0,!0}});window.addEventListener(`test`,zx,zx),window.removeEventListener(`test`,zx,zx)}catch{Rx=!1}var Bx=Rx?{passive:!1}:!1,Vx=function(e){return e.tagName===`TEXTAREA`},Hx=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Vx(e)&&n[t]===`visible`)},Ux=function(e){return Hx(e,`overflowY`)},Wx=function(e){return Hx(e,`overflowX`)},Gx=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Jx(e,r)){var i=Yx(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Kx=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},qx=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Jx=function(e,t){return e===`v`?Ux(t):Wx(t)},Yx=function(e,t){return e===`v`?Kx(t):qx(t)},Xx=function(e,t){return e===`h`&&t===`rtl`?-1:1},Zx=function(e,t,n,r,i){var a=Xx(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Yx(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Jx(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Qx=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},$x=function(e){return[e.deltaX,e.deltaY]},eS=function(e){return e&&`current`in e?e.current:e},tS=function(e,t){return e[0]===t[0]&&e[1]===t[1]},nS=function(e){return`
57
- .block-interactivity-${e} {pointer-events: none;}
58
- .allow-interactivity-${e} {pointer-events: all;}
59
- `},rS=0,iS=[];function aS(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),i=m.useState(rS++)[0],a=m.useState(Dx)[0],o=m.useRef(e);m.useEffect(function(){o.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=rx([e.lockRef.current],(e.shards||[]).map(eS),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=m.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Qx(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Gx(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Gx(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Zx(h,t,e,h===`h`?s:c,!0)},[]),c=m.useCallback(function(e){var n=e;if(iS.length&&iS[iS.length-1]===a){var r=`deltaY`in n?$x(n):Qx(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&tS(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(eS).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=m.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:oS(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=m.useCallback(function(e){n.current=Qx(e),r.current=void 0},[]),d=m.useCallback(function(t){l(t.type,$x(t),t.target,s(t,e.lockRef.current))},[]),f=m.useCallback(function(t){l(t.type,Qx(t),t.target,s(t,e.lockRef.current))},[]);m.useEffect(function(){return iS.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Bx),document.addEventListener(`touchmove`,c,Bx),document.addEventListener(`touchstart`,u,Bx),function(){iS=iS.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Bx),document.removeEventListener(`touchmove`,c,Bx),document.removeEventListener(`touchstart`,u,Bx)}},[]);var p=e.removeScrollBar,h=e.inert;return m.createElement(m.Fragment,null,h?m.createElement(a,{styles:nS(i)}):null,p?m.createElement(Lx,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function oS(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var sS=_x(vx,aS),cS=m.forwardRef(function(e,t){return m.createElement(bx,tx({},e,{ref:t,sideCar:sS}))});cS.classNames=bx.classNames;var lS=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},uS=new WeakMap,dS=new WeakMap,fS={},pS=0,mS=function(e){return e&&(e.host||mS(e.parentNode))},hS=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=mS(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},gS=function(e,t,n,r){var i=hS(t,Array.isArray(e)?e:[e]);fS[n]||(fS[n]=new WeakMap);var a=fS[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(uS.get(e)||0)+1,l=(a.get(e)||0)+1;uS.set(e,c),a.set(e,l),o.push(e),c===1&&i&&dS.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),pS++,function(){o.forEach(function(e){var t=uS.get(e)-1,i=a.get(e)-1;uS.set(e,t),a.set(e,i),t||(dS.has(e)||e.removeAttribute(r),dS.delete(e)),i||e.removeAttribute(n)}),pS--,pS||(uS=new WeakMap,uS=new WeakMap,dS=new WeakMap,fS={})}},_S=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||lS(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),gS(r,i,n,`aria-hidden`)):function(){return null}},vS=Object.defineProperty,yS=(e,t)=>vS(e,`name`,{value:t,configurable:!0}),bS=`Dialog`,[xS,SS]=Oy(bS),[CS,wS]=xS(bS),TS=yS(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=m.useRef(null),c=m.useRef(null),[l,u]=qy({prop:r,defaultProp:i??!1,onChange:a,caller:bS}),[d,f]=m.useState(0),[p,h]=m.useState(0);return(0,W.jsx)(CS,{scope:t,triggerRef:s,contentRef:c,contentId:db(),titleId:db(),descriptionId:db(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:h,open:l,onOpenChange:u,onOpenToggle:m.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),ES=`DialogTrigger`,DS=m.forwardRef(yS(function(e,t){let{__scopeDialog:n,...r}=e,i=wS(ES,n),a=$v(t,i.triggerRef);return(0,W.jsx)(yy.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":qS(i.open),...r,ref:a,onClick:Ny(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),OS=`DialogPortal`,[kS,AS]=xS(OS,{forceMount:void 0}),jS=yS(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=wS(OS,t);return(0,W.jsx)(kS,{scope:t,forceMount:n,children:m.Children.map(r,e=>(0,W.jsx)(tb,{present:n||a.open,children:(0,W.jsx)(qb,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),MS=`DialogOverlay`,NS=m.forwardRef(yS(function(e,t){let n=AS(MS,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=wS(MS,e.__scopeDialog);return a.modal?(0,W.jsx)(tb,{present:r||a.open,children:(0,W.jsx)(FS,{...i,ref:t})}):null},`DialogOverlay`)),PS=ny(`DialogOverlay.RemoveScroll`),FS=m.forwardRef(yS(function(e,t){let{__scopeDialog:n,...r}=e,i=wS(MS,n),a=$v(t,Cb());return(0,W.jsx)(cS,{as:PS,allowPinchZoom:!0,shards:[i.contentRef],children:(0,W.jsx)(yy.div,{"data-state":qS(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),IS=`DialogContent`,LS=m.forwardRef(yS(function(e,t){let n=AS(IS,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=wS(IS,e.__scopeDialog);return(0,W.jsx)(tb,{present:r||a.open,children:a.modal?(0,W.jsx)(RS,{...i,ref:t}):(0,W.jsx)(zS,{...i,ref:t})})},`DialogContent`)),RS=m.forwardRef(yS(function(e,t){let n=wS(IS,e.__scopeDialog),r=m.useRef(null),i=$v(t,n.contentRef,r);return m.useEffect(()=>{let e=r.current;if(e)return _S(e)},[]),(0,W.jsx)(BS,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Ny(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Ny(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Ny(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),zS=m.forwardRef(yS(function(e,t){let n=wS(IS,e.__scopeDialog),r=m.useRef(!1),i=m.useRef(!1);return(0,W.jsx)(BS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),BS=m.forwardRef(yS(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=wS(IS,n);return $b(),(0,W.jsx)(W.Fragment,{children:(0,W.jsx)(Pb,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,W.jsx)(Sb,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":qS(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),VS=`DialogTitle`,HS=m.forwardRef(yS(function(e,t){let{__scopeDialog:n,...r}=e,i=wS(VS,n),{setTitleCount:a}=i;return Ry(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,W.jsx)(yy.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),US=`DialogDescription`,WS=m.forwardRef(yS(function(e,t){let{__scopeDialog:n,...r}=e,i=wS(US,n),{setDescriptionCount:a}=i;return Ry(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,W.jsx)(yy.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),GS=`DialogClose`,KS=m.forwardRef(yS(function(e,t){let{__scopeDialog:n,...r}=e,i=wS(GS,n);return(0,W.jsx)(yy.button,{type:`button`,...r,ref:t,onClick:Ny(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function qS(e){return e?`open`:`closed`}yS(qS,`getState`);var JS=Object.defineProperty,YS=(e,t)=>JS(e,`name`,{value:t,configurable:!0}),[XS,ZS]=Oy(`AlertDialog`,[SS]),QS=SS(),$S=YS(e=>{let{__scopeAlertDialog:t,...n}=e,r=QS(t);return(0,W.jsx)(TS,{...r,...n,modal:!0})},`AlertDialog`);m.forwardRef(YS(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=QS(n);return(0,W.jsx)(DS,{...i,...r,ref:t})},`AlertDialogTrigger`));var eC=YS(e=>{let{__scopeAlertDialog:t,...n}=e,r=QS(t);return(0,W.jsx)(jS,{...r,...n})},`AlertDialogPortal`),tC=m.forwardRef(YS(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=QS(n);return(0,W.jsx)(NS,{...i,...r,ref:t})},`AlertDialogOverlay`)),[nC,rC]=XS(`AlertDialogContent`),iC=m.forwardRef(YS(function(e,t){let{__scopeAlertDialog:n,children:r,...i}=e,a=QS(n),o=$v(t,m.useRef(null)),s=m.useRef(null);return(0,W.jsx)(nC,{scope:n,cancelRef:s,children:(0,W.jsx)(LS,{role:`alertdialog`,...a,...i,ref:o,onOpenAutoFocus:Ny(i.onOpenAutoFocus,e=>{e.preventDefault(),s.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:r})})},`AlertDialogContent`)),aC=m.forwardRef(YS(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=QS(n);return(0,W.jsx)(HS,{...i,...r,ref:t})},`AlertDialogTitle`)),oC=m.forwardRef(YS(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=QS(n);return(0,W.jsx)(WS,{...i,...r,ref:t})},`AlertDialogDescription`)),sC=m.forwardRef(YS(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=QS(n);return(0,W.jsx)(KS,{...i,...r,ref:t})},`AlertDialogAction`)),cC=`AlertDialogCancel`,lC=m.forwardRef(YS(function(e,t){let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=rC(cC,n),a=QS(n),o=$v(t,i);return(0,W.jsx)(KS,{...a,...r,ref:o})},`AlertDialogCancel`)),uC=$S,dC=eC,fC=tC,pC=iC,mC=sC,hC=lC,gC=aC,_C=oC,vC=Object.defineProperty,yC=(e,t)=>vC(e,`name`,{value:t,configurable:!0});function bC(e){let[t,n]=m.useState(void 0);return Ry(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}yC(bC,`useSize`);var xC=Object.defineProperty,SC=(e,t)=>xC(e,`name`,{value:t,configurable:!0}),CC=`Checkbox`,[wC,TC]=Oy(CC),[EC,DC]=wC(CC);function OC(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=qy({prop:n,defaultProp:i??!1,onChange:c,caller:CC}),[h,g]=m.useState(null),[_,v]=m.useState(null),y=m.useRef(!1),[b,x]=m.useReducer(e=>e+1,0),S=!h||!!o||!!h.closest(`form`),C={checked:f,disabled:a,setChecked:p,control:h,setControl:g,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:y,userInteractionCount:b,onUserInteraction:x,required:l,defaultChecked:!LC(i)&&i,isFormControl:S,bubbleInput:_,setBubbleInput:v};return(0,W.jsx)(EC,{scope:t,...C,children:IC(d)?d(C):r})}SC(OC,`CheckboxProvider`);var kC=`CheckboxTrigger`,AC=m.forwardRef(SC(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i){let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:h,bubbleInput:g}=DC(kC,e),_=$v(i,u),v=m.useRef(c);return m.useEffect(()=>{let e=a?.form;if(e){let t=SC(()=>d(v.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,W.jsx)(yy.button,{type:`button`,role:`checkbox`,"aria-checked":LC(c)?`mixed`:c,"aria-required":l,"data-state":RC(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:_,onKeyDown:Ny(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:Ny(n,e=>{p(),d(e=>LC(e)?!0:!e),g&&h&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`CheckboxTrigger`)),jC=m.forwardRef(SC(function(e,t){let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,W.jsx)(OC,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(AC,{...d,ref:t,__scopeCheckbox:n}),e&&(0,W.jsx)(FC,{__scopeCheckbox:n})]})})},`Checkbox`)),MC=`CheckboxIndicator`,NC=m.forwardRef(SC(function(e,t){let{__scopeCheckbox:n,forceMount:r,...i}=e,a=DC(MC,n);return(0,W.jsx)(tb,{present:r||LC(a.checked)||a.checked===!0,children:(0,W.jsx)(yy.span,{"data-state":RC(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),PC=`CheckboxBubbleInput`,FC=m.forwardRef(SC(function({__scopeCheckbox:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:s,defaultChecked:c,required:l,disabled:u,name:d,value:f,form:p,bubbleInput:h,setBubbleInput:g}=DC(PC,e),_=$v(r,g),v=bC(i),y=m.useRef(!1),b=m.useRef(s),x=m.useRef(o);m.useEffect(()=>{let e=h;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==x.current;x.current=o;let i=b.current!==s;b.current=s;let c=!(r&&a.current);if(i&&n){y.current=!r;let t=new Event(`click`,{bubbles:c});e.indeterminate=LC(s),n.call(e,!LC(s)&&s),e.dispatchEvent(t),y.current=!1}},[h,s,a,o]);let S=m.useRef(!LC(s)&&s);return(0,W.jsx)(yy.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??S.current,required:l,disabled:u,name:d,value:f,form:p,...n,tabIndex:-1,ref:_,onClick:Ny(t,e=>{y.current&&e.stopPropagation()}),style:{...n.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function IC(e){return typeof e==`function`}SC(IC,`isFunction`);function LC(e){return e===`indeterminate`}SC(LC,`isIndeterminate`);function RC(e){return LC(e)?`indeterminate`:e?`checked`:`unchecked`}SC(RC,`getState`);var zC=[`top`,`right`,`bottom`,`left`],BC=Math.min,VC=Math.max,HC=Math.round,UC=Math.floor,WC=e=>({x:e,y:e}),GC={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function KC(e,t,n){return VC(e,BC(t,n))}function qC(e,t){return typeof e==`function`?e(t):e}function JC(e){return e.split(`-`)[0]}function YC(e){return e.split(`-`)[1]}function XC(e){return e===`x`?`y`:`x`}function ZC(e){return e===`y`?`height`:`width`}function QC(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function $C(e){return XC(QC(e))}function ew(e,t,n){n===void 0&&(n=!1);let r=YC(e),i=$C(e),a=ZC(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=lw(o)),[o,lw(o)]}function tw(e){let t=lw(e);return[nw(e),t,nw(t)]}function nw(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var rw=[`left`,`right`],iw=[`right`,`left`],aw=[`top`,`bottom`],ow=[`bottom`,`top`];function sw(e,t,n){switch(e){case`top`:case`bottom`:return n?t?iw:rw:t?rw:iw;case`left`:case`right`:return t?aw:ow;default:return[]}}function cw(e,t,n,r){let i=YC(e),a=sw(JC(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(nw)))),a}function lw(e){let t=JC(e);return GC[t]+e.slice(t.length)}function uw(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function dw(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:uw(e)}function fw(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function pw(e,t,n){let{reference:r,floating:i}=e,a=QC(t),o=$C(t),s=ZC(o),c=JC(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=YC(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function mw(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=qC(t,e),p=dw(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=fw(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=fw(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var hw=50,gw=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:mw},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=pw(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<hw&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=pw(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},_w=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=qC(e,t)||{};if(l==null)return{};let d=dw(u),f={x:n,y:r},p=$C(i),m=ZC(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=BC(d[_],T),D=BC(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=KC(E,k,O),ee=!c.arrow&&YC(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,j=ee?k<E?k-E:k-O:0;return{[p]:f[p]+j,data:{[p]:A,centerOffset:k-A-j,...ee&&{alignmentOffset:j}},reset:ee}}}),vw=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=qC(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=JC(r),_=QC(o),v=JC(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[lw(o)]:tw(o)),x=p!==`none`;!d&&x&&b.push(...cw(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=ew(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===QC(t)||T.every(e=>QC(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=QC(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function yw(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bw(e){return zC.some(t=>e[t]>=0)}var xw=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=qC(e,t);switch(i){case`referenceHidden`:{let e=yw(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:bw(e)}}}case`escaped`:{let e=yw(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:bw(e)}}}default:return{}}}}},Sw=new Set([`left`,`top`]);async function Cw(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=JC(n),s=YC(n),c=QC(n)===`y`,l=Sw.has(o)?-1:1,u=a&&c?-1:1,d=qC(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var ww=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Cw(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Tw=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=qC(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=QC(i),p=XC(f),m=u[p],h=u[f],g=(e,t)=>KC(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Ew=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=qC(e,t),u={x:n,y:r},d=QC(i),f=XC(d),p=u[f],m=u[d],h=qC(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Sw.has(JC(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Dw=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=qC(e,t),c=await i.detectOverflow(t,s),l=JC(n),u=YC(n),d=QC(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=BC(p-c[m],g),y=BC(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*VC(c.left,c.right):S=p-2*VC(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Ow(){return typeof window<`u`}function kw(e){return Mw(e)?(e.nodeName||``).toLowerCase():`#document`}function Aw(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function jw(e){return((Mw(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Mw(e){return Ow()?e instanceof Node||e instanceof Aw(e).Node:!1}function Nw(e){return Ow()?e instanceof Element||e instanceof Aw(e).Element:!1}function Pw(e){return Ow()?e instanceof HTMLElement||e instanceof Aw(e).HTMLElement:!1}function Fw(e){return!Ow()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Aw(e).ShadowRoot}function Iw(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=qw(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Lw(e){return/^(table|td|th)$/.test(kw(e))}function Rw(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var zw=/transform|translate|scale|rotate|perspective|filter/,Bw=/paint|layout|strict|content/,Vw=e=>!!e&&e!==`none`,Hw;function Uw(e){let t=Nw(e)?qw(e):e;return Vw(t.transform)||Vw(t.translate)||Vw(t.scale)||Vw(t.rotate)||Vw(t.perspective)||!Gw()&&(Vw(t.backdropFilter)||Vw(t.filter))||zw.test(t.willChange||``)||Bw.test(t.contain||``)}function Ww(e){let t=Yw(e);for(;Pw(t)&&!Kw(t);){if(Uw(t))return t;if(Rw(t))return null;t=Yw(t)}return null}function Gw(){return Hw??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Hw}function Kw(e){return/^(html|body|#document)$/.test(kw(e))}function qw(e){return Aw(e).getComputedStyle(e)}function Jw(e){return Nw(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Yw(e){if(kw(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Fw(e)&&e.host||jw(e);return Fw(t)?t.host:t}function Xw(e){let t=Yw(e);return Kw(t)?(e.ownerDocument||e).body:Pw(t)&&Iw(t)?t:Xw(t)}function Zw(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Xw(e),i=r===e.ownerDocument?.body,a=Aw(r);if(i){let e=Qw(a);return t.concat(a,a.visualViewport||[],Iw(r)?r:[],e&&n?Zw(e):[])}return t.concat(r,Zw(r,[],n))}function Qw(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function $w(e){let t=qw(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Pw(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=HC(n)!==a||HC(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function eT(e){return Nw(e)?e:e.contextElement}function tT(e){let t=eT(e);if(!Pw(t))return WC(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=$w(t),o=(a?HC(n.width):n.width)/r,s=(a?HC(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var nT=WC(0);function rT(e){let t=Aw(e);return!Gw()||!t.visualViewport?nT:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function iT(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Aw(e)}function aT(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=eT(e),o=WC(1);t&&(r?Nw(r)&&(o=tT(r)):o=tT(e));let s=iT(a,n,r)?rT(a):WC(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Aw(a),t=Nw(r)?Aw(r):r,n=e,i=Qw(n);for(;i&&t!==n;){let e=tT(i),t=i.getBoundingClientRect(),r=qw(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Aw(i),i=Qw(n)}}return fw({width:u,height:d,x:c,y:l})}function oT(e,t){let n=Jw(e).scrollLeft;return t?t.left+n:aT(jw(e)).left+n}function sT(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-oT(e,n),y:n.top+t.scrollTop}}function cT(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=jw(r),s=t?Rw(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=WC(1),u=WC(0),d=Pw(r);if((d||!a)&&((kw(r)!==`body`||Iw(o))&&(c=Jw(r)),d)){let e=aT(r);l=tT(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?sT(o,c):WC(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function lT(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function uT(e){let t=Jw(e),n=e.ownerDocument.body,r=VC(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=VC(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+oT(e),o=-t.scrollTop;return qw(n).direction===`rtl`&&(a+=VC(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var dT=25;function fT(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Aw(e),a=jw(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Gw()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(oT(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=dT&&(s-=o)}return{width:s,height:c,x:l,y:u}}function pT(e,t){let n=aT(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=tT(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function mT(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=fT(e,n,t);else if(t===`document`)r=uT(jw(e));else if(Nw(t))r=pT(t,n);else{let n=rT(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return fw(r)}function hT(e,t){let n=t.get(e);if(n)return n;let r=Zw(e,[],!1).filter(e=>Nw(e)&&kw(e)!==`body`),i=null,a=qw(e).position===`fixed`,o=a?Yw(e):e;for(;Nw(o)&&!Kw(o);){let e=qw(o),t=Uw(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Yw(o)}return t.set(e,r),r}function gT(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Rw(t)?[]:hT(t,this._c):[].concat(n),r],o=mT(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=mT(t,a[e],i);s=VC(n.top,s),c=BC(n.right,c),l=BC(n.bottom,l),u=VC(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function _T(e){let{width:t,height:n}=$w(e);return{width:t,height:n}}function vT(e,t,n){let r=Pw(t),i=jw(t),a=n===`fixed`,o=aT(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=WC(0);if((r||!a)&&((kw(t)!==`body`||Iw(i))&&(s=Jw(t)),r)){let e=aT(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=oT(i));let l=i&&!r&&!a?sT(i,s):WC(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function yT(e){return qw(e).position===`static`}function bT(e,t){if(!Pw(e)||qw(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return jw(e)===n&&(n=n.ownerDocument.body),n}function xT(e,t){let n=Aw(e);if(Rw(e))return n;if(!Pw(e)){let t=Yw(e);for(;t&&!Kw(t);){if(Nw(t)&&!yT(t))return t;t=Yw(t)}return n}let r=bT(e,t);for(;r&&Lw(r)&&yT(r);)r=bT(r,t);return r&&Kw(r)&&yT(r)&&!Uw(r)?n:r||Ww(e)||n}var ST=async function(e){let t=this.getOffsetParent||xT,n=this.getDimensions,r=await n(e.floating);return{reference:vT(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function CT(e){return qw(e).direction===`rtl`}var wT={convertOffsetParentRelativeRectToViewportRelativeRect:cT,getDocumentElement:jw,getClippingRect:gT,getOffsetParent:xT,getElementRects:ST,getClientRects:lT,getDimensions:_T,getScale:tT,isElement:Nw,isRTL:CT};function TT(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ET(e,t,n){let r=null,i,a=jw(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=UC(d),h=UC(a.clientWidth-(u+f)),g=UC(a.clientHeight-(d+p)),_=UC(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:VC(0,BC(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!TT(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Aw(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function DT(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=eT(e),u=i||a?[...l?Zw(l):[],...t?Zw(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?ET(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?aT(e):null;c&&g();function g(){let t=aT(e);h&&!TT(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var OT=ww,kT=Tw,AT=vw,jT=Dw,MT=xw,NT=_w,PT=Ew,FT=(e,t,n)=>{let r=new Map,i=n??{},a={...wT,...i.platform,_c:r};return gw(e,t,{...i,platform:a})},IT=typeof document<`u`?m.useLayoutEffect:function(){};function LT(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!LT(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!LT(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function RT(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zT(e,t){let n=RT(e);return Math.round(t*n)/n}function BT(e){let t=m.useRef(e);return IT(()=>{t.current=e}),t}function VT(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=m.useState(r);LT(f,r)||p(r);let[h,g]=m.useState(null),[_,v]=m.useState(null),y=m.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=m.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=m.useRef(null),w=m.useRef(null),T=m.useRef(u),E=c!=null,D=BT(c),O=BT(i),k=BT(l),A=m.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),FT(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};ee.current&&!LT(T.current,t)&&(T.current=t,gy.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);IT(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let ee=m.useRef(!1);IT(()=>(ee.current=!0,()=>{ee.current=!1}),[]),IT(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let j=m.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),M=m.useMemo(()=>({reference:x,floating:S}),[x,S]),N=m.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=zT(M.floating,u.x),r=zT(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...RT(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:A,refs:j,elements:M,floatingStyles:N}),[u,A,j,M,N])}var HT=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:NT({element:r.current,padding:i}).fn(n):r?NT({element:r,padding:i}).fn(n):{}}}},UT=(e,t)=>{let n=OT(e);return{name:n.name,fn:n.fn,options:[e,t]}},WT=(e,t)=>{let n=kT(e);return{name:n.name,fn:n.fn,options:[e,t]}},GT=(e,t)=>({fn:PT(e).fn,options:[e,t]}),KT=(e,t)=>{let n=AT(e);return{name:n.name,fn:n.fn,options:[e,t]}},qT=(e,t)=>{let n=jT(e);return{name:n.name,fn:n.fn,options:[e,t]}},JT=(e,t)=>{let n=MT(e);return{name:n.name,fn:n.fn,options:[e,t]}},YT=(e,t)=>{let n=HT(e);return{name:n.name,fn:n.fn,options:[e,t]}},XT=Object.defineProperty,ZT=(e,t)=>XT(e,`name`,{value:t,configurable:!0}),QT=`Popper`,[$T,eE]=Oy(QT),[tE,nE]=$T(QT),rE=ZT(e=>{let{__scopePopper:t,children:n}=e,[r,i]=m.useState(null),[a,o]=m.useState(void 0);return(0,W.jsx)(tE,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),iE=`PopperAnchor`,aE=m.forwardRef(ZT(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=nE(iE,n),o=m.useRef(null),s=a.onAnchorChange,c=$v(t,m.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=m.useRef(null);m.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&fE(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,W.jsx)(yy.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),oE=`PopperContent`,[sE,cE]=$T(oE),lE=m.forwardRef(ZT(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:h,...g}=e,_=nE(oE,n),[v,y]=m.useState(null),b=$v(t,y),[x,S]=m.useState(null),C=bC(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(uE),altBoundary:k},{refs:ee,floatingStyles:j,placement:M,isPositioned:N,middlewareData:P}=VT({strategy:`fixed`,placement:E,whileElementsMounted:ZT((...e)=>DT(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:_.anchor},middleware:[UT({mainAxis:i+T,alignmentAxis:o}),c&&WT({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?GT():void 0,...A}),c&&KT({...A}),qT({...A,apply:ZT(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&YT({element:x,padding:s}),dE({arrowWidth:w,arrowHeight:T}),f&&JT({strategy:`referenceHidden`,...A,boundary:k?A.boundary:void 0})]}),F=_.setPlacementState;Ry(()=>(F(M),()=>{F(void 0)}),[M,F]);let[te,ne]=fE(M),re=mb(h);Ry(()=>{N&&re?.()},[N,re]);let ie=P.arrow?.x,ae=P.arrow?.y,oe=P.arrow?.centerOffset!==0,[se,ce]=m.useState();return Ry(()=>{v&&ce(window.getComputedStyle(v).zIndex)},[v]),(0,W.jsx)(`div`,{ref:ee.setFloating,"data-radix-popper-content-wrapper":``,style:{...j,transform:N?j.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:se,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(` `),...P.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,W.jsx)(sE,{scope:n,placedSide:te,placedAlign:ne,onArrowChange:S,arrowX:ie,arrowY:ae,shouldHideArrow:oe,children:(0,W.jsx)(yy.div,{"data-side":te,"data-align":ne,...g,ref:b,style:{...g.style,animation:N?g.style?.animation:`none`}})})})},`PopperContent`));function uE(e){return e!==null}ZT(uE,`isNotNull`);var dE=ZT(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=fE(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function fE(e){let[t,n=`center`]=e.split(`-`);return[t,n]}ZT(fE,`getSideAndAlignFromPlacement`);var pE=rE,mE=aE,hE=lE,gE=Object.defineProperty,_E=(e,t)=>gE(e,`name`,{value:t,configurable:!0}),vE=`Popover`,[yE,bE]=Oy(vE,[eE]),xE=eE(),[SE,CE]=yE(vE),wE=_E(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=xE(t),c=m.useRef(null),[l,u]=m.useState(!1),[d,f]=qy({prop:r,defaultProp:i??!1,onChange:a,caller:vE});return(0,W.jsx)(pE,{...s,children:(0,W.jsx)(SE,{scope:t,contentId:db(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:m.useCallback(()=>u(!0),[]),onCustomAnchorRemove:m.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),TE=`PopoverTrigger`,EE=m.forwardRef(_E(function(e,t){let{__scopePopover:n,...r}=e,i=CE(TE,n),a=xE(n),o=$v(t,i.triggerRef),s=(0,W.jsx)(yy.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":LE(i.open),...r,ref:o,onClick:Ny(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,W.jsx)(mE,{asChild:!0,...a,children:s})},`PopoverTrigger`)),DE=`PopoverPortal`,[OE,kE]=yE(DE,{forceMount:void 0}),AE=_E(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=CE(DE,t);return(0,W.jsx)(OE,{scope:t,forceMount:n,children:(0,W.jsx)(tb,{present:n||a.open,children:(0,W.jsx)(qb,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),jE=`PopoverContent`,ME=m.forwardRef(_E(function(e,t){let n=kE(jE,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=CE(jE,e.__scopePopover);return(0,W.jsx)(tb,{present:r||a.open,children:a.modal?(0,W.jsx)(PE,{...i,ref:t}):(0,W.jsx)(FE,{...i,ref:t})})},`PopoverContent`)),NE=ny(`PopoverContent.RemoveScroll`),PE=m.forwardRef(_E(function(e,t){let n=CE(jE,e.__scopePopover),r=m.useRef(null),i=$v(t,r),a=m.useRef(!1);return m.useEffect(()=>{let e=r.current;if(e)return _S(e)},[]),(0,W.jsx)(cS,{as:NE,allowPinchZoom:!0,children:(0,W.jsx)(IE,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ny(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Ny(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:Ny(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),FE=m.forwardRef(_E(function(e,t){let n=CE(jE,e.__scopePopover),r=m.useRef(!1),i=m.useRef(!1);return(0,W.jsx)(IE,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),IE=m.forwardRef(_E(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=CE(jE,n),p=xE(n);return $b(),(0,W.jsx)(Pb,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,W.jsx)(Sb,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,W.jsx)(hE,{"data-state":LE(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.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)`}})})})},`PopoverContentImpl`));function LE(e){return e?`open`:`closed`}_E(LE,`getState`);var RE=wE,zE=EE,BE=AE,VE=ME,HE=Object.defineProperty,UE=(e,t)=>HE(e,`name`,{value:t,configurable:!0}),WE=`Switch`,[GE,KE]=Oy(WE),[qE,JE]=GE(WE);function YE(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=qy({prop:n,defaultProp:i??!1,onChange:c,caller:WE}),[h,g]=m.useState(null),[_,v]=m.useState(null),y=m.useRef(!1),[b,x]=m.useReducer(e=>e+1,0),S={checked:f,setChecked:p,disabled:a,control:h,setControl:g,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:y,userInteractionCount:b,onUserInteraction:x,required:l,defaultChecked:i,isFormControl:!h||!!o||!!h.closest(`form`),bubbleInput:_,setBubbleInput:v};return(0,W.jsx)(qE,{scope:t,...S,children:rD(d)?d(S):r})}UE(YE,`SwitchProvider`);var XE=`SwitchTrigger`,ZE=m.forwardRef(UE(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,form:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:h,bubbleInput:g}=JE(XE,e),_=$v(r,u),v=m.useRef(c);return m.useEffect(()=>{let e=a?i?.ownerDocument.getElementById(a):i?.form;if(e instanceof HTMLFormElement){let t=UE(()=>d(v.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[i,a,d]),(0,W.jsx)(yy.button,{type:`button`,role:`switch`,"aria-checked":c,"aria-required":l,"data-state":iD(c),"data-disabled":s?``:void 0,disabled:s,value:o,...n,ref:_,onClick:Ny(t,e=>{p(),d(e=>!e),g&&h&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`SwitchTrigger`)),QE=m.forwardRef(UE(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,W.jsx)(YE,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(ZE,{...d,ref:t,__scopeSwitch:n}),e&&(0,W.jsx)(nD,{__scopeSwitch:n})]})})},`Switch`)),$E=`SwitchThumb`,eD=m.forwardRef(UE(function(e,t){let{__scopeSwitch:n,...r}=e,i=JE($E,n);return(0,W.jsx)(yy.span,{"data-state":iD(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})},`SwitchThumb`)),tD=`SwitchBubbleInput`,nD=m.forwardRef(UE(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:s,defaultChecked:c,required:l,disabled:u,name:d,value:f,form:p,bubbleInput:h,setBubbleInput:g}=JE(tD,e),_=$v(r,g),v=bC(i),y=m.useRef(!1),b=m.useRef(s),x=m.useRef(o);m.useEffect(()=>{let e=h;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==x.current;x.current=o;let i=b.current!==s;b.current=s;let c=!(r&&a.current);if(i&&n){y.current=!r;let t=new Event(`click`,{bubbles:c});n.call(e,s),e.dispatchEvent(t),y.current=!1}},[h,s,a,o]);let S=m.useRef(s);return(0,W.jsx)(yy.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??S.current,required:l,disabled:u,name:d,value:f,form:p,...n,tabIndex:-1,ref:_,onClick:Ny(t,e=>{y.current&&e.stopPropagation()}),style:{...n.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function rD(e){return typeof e==`function`}UE(rD,`isFunction`);function iD(e){return e?`checked`:`unchecked`}UE(iD,`getState`);var aD=Object.defineProperty,oD=(e,t)=>aD(e,`name`,{value:t,configurable:!0}),[sD,cD]=Oy(`Tooltip`,[eE]),lD=eE(),uD=`TooltipProvider`,dD=700,fD=`tooltip.open`,[pD,mD]=sD(uD),hD=oD(e=>{let{__scopeTooltip:t,delayDuration:n=dD,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=m.useRef(!0),s=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,W.jsx)(pD,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:m.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:m.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:m.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),gD=`Tooltip`,[_D,vD]=sD(gD),yD=oD(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=mD(gD,e.__scopeTooltip),l=lD(t),[u,d]=m.useState(null),[f,p]=m.useState(void 0),h=db(),g=m.useRef(0),_=o??c.disableHoverableContent,v=s??c.delayDuration,y=m.useRef(!1),[b,x]=qy({prop:r,defaultProp:i??!1,onChange:oD(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(fD))):c.onClose(),a?.(e)},`onChange`),caller:gD}),S=m.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),C=m.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y.current=!1,x(!0)},[x]),w=m.useCallback(()=>{window.clearTimeout(g.current),g.current=0,x(!1)},[x]),T=m.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{y.current=!0,x(!0),g.current=0},v)},[v,x]);m.useEffect(()=>()=>{g.current&&=(window.clearTimeout(g.current),0)},[]);let E=f??h;return(0,W.jsx)(pE,{...l,children:(0,W.jsx)(_D,{scope:t,contentId:E,setContentId:p,open:b,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:m.useCallback(()=>{c.isOpenDelayedRef.current?T():C()},[c.isOpenDelayedRef,T,C]),onTriggerLeave:m.useCallback(()=>{_?w():(window.clearTimeout(g.current),g.current=0)},[w,_]),onOpen:C,onClose:w,disableHoverableContent:_,children:n})})},`Tooltip`),bD=`TooltipTrigger`,xD=m.forwardRef(oD(function(e,t){let{__scopeTooltip:n,...r}=e,i=vD(bD,n),a=mD(bD,n),o=lD(n),s=$v(t,m.useRef(null),i.onTriggerChange),c=m.useRef(!1),l=m.useRef(!1),u=m.useCallback(()=>c.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,W.jsx)(mE,{asChild:!0,...o,children:(0,W.jsx)(yy.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:Ny(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:Ny(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:Ny(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:Ny(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:Ny(e.onBlur,i.onClose),onClick:Ny(e.onClick,i.onClose)})})},`TooltipTrigger`)),SD=`TooltipPortal`,[CD,wD]=sD(SD,{forceMount:void 0}),TD=oD(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=vD(SD,t);return(0,W.jsx)(CD,{scope:t,forceMount:n,children:(0,W.jsx)(tb,{present:n||a.open,children:(0,W.jsx)(qb,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),ED=`TooltipContent`,DD=m.forwardRef(oD(function(e,t){let n=wD(ED,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=vD(ED,e.__scopeTooltip);return(0,W.jsx)(tb,{present:r||o.open,children:o.disableHoverableContent?(0,W.jsx)(AD,{side:i,...a,ref:t}):(0,W.jsx)(OD,{side:i,...a,ref:t})})},`TooltipContent`)),OD=m.forwardRef(oD(function(e,t){let n=vD(ED,e.__scopeTooltip),r=mD(ED,e.__scopeTooltip),i=m.useRef(null),a=$v(t,i),[o,s]=m.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=m.useCallback(()=>{s(null),d(!1)},[d]),p=m.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=MD(r,jD(r,n.getBoundingClientRect())),a=ND(t.getBoundingClientRect()),o=FD([...i,...a]);s(o),d(!0)},[d]);return m.useEffect(()=>()=>f(),[f]),m.useEffect(()=>{if(c&&u){let e=oD(e=>p(e,u),`handleTriggerLeave`),t=oD(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),m.useEffect(()=>{if(o){let e=oD(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!PD(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,W.jsx)(AD,{...e,ref:a})},`TooltipContentHoverable`)),kD=ay(`TooltipContent`),AD=m.forwardRef(oD(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=vD(ED,n),u=lD(n),{onClose:d}=l;m.useEffect(()=>(document.addEventListener(fD,d),()=>document.removeEventListener(fD,d)),[d]),m.useEffect(()=>{if(l.trigger){let e=oD(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:f}=l;return Ry(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,W.jsx)(Sb,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,W.jsxs)(hE,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.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:[(0,W.jsx)(kD,{children:r}),i?(0,W.jsx)(wy,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`));function jD(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}oD(jD,`getExitSideFromRect`);function MD(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}oD(MD,`getPaddedExitPoints`);function ND(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}oD(ND,`getPointsFromRect`);function PD(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}oD(PD,`isPointInPolygon`);function FD(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),ID(t)}oD(FD,`getHull`);function ID(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}oD(ID,`getHullPresorted`);var LD=hD,RD=yD,zD=xD,BD=TD,VD=DD,HD=Jv(`group/button motion-reduce:transition-none motion-reduce:active:scale-100 inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-[scale,background-color,box-shadow,color,border-color] duration-150 active:not-aria-[haspopup]:scale-[0.97] ease-snap outline-none select-none focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-offset-2 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`btn-tint text-primary-foreground [--tint:var(--primary)] disabled:text-muted-foreground`,soft:`btn-soft text-foreground`,outline:`btn-outline text-foreground [&_svg]:text-muted-foreground`,secondary:`btn-soft text-secondary-foreground`,ghost:`btn-ghost text-foreground [&_svg]:text-muted-foreground hover:[&_svg]:text-foreground`,destructive:`btn-tint text-white [--tint:var(--destructive)] focus-visible:outline-destructive disabled:text-muted-foreground dark:text-background`,link:`text-link underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-3`,xs:`h-7 gap-1 px-2.5 text-xs [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1.5 px-2.5 text-xs [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-2 px-4`,icon:`size-8`,"icon-xs":`size-7 [&_svg:not([class*='size-'])]:size-3.5`,"icon-sm":`size-7`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function Z({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){let a=r?ry:`button`;return(0,W.jsx)(a,{"aria-keyshortcuts":r?void 0:`Enter Space`,"aria-description":r?`When focused, press Enter to activate.`:`When focused, press Enter or Space to activate.`,"aria-describedby":`focused-action-help`,"data-slot":`button`,"data-variant":t,"data-size":n,className:X(HD({variant:t,size:n,className:e})),...i})}var UD=X(`pointer-events-none inline-flex h-[1.125rem] min-w-[1.125rem] w-fit items-center justify-center gap-1 rounded-[4px] bg-accent px-1 font-sans text-2xs leading-none font-medium text-muted-foreground select-none`,`in-data-[slot=tooltip-content]:bg-accent in-data-[slot=tooltip-content]:text-muted-foreground`,`in-data-[variant=default]:bg-primary-foreground/16 in-data-[variant=default]:text-primary-foreground`,`in-data-[variant=destructive]:bg-white/16 in-data-[variant=destructive]:text-current`,`[&_svg:not([class*='size-'])]:size-3`);function WD({className:e,...t}){return(0,W.jsx)(`kbd`,{"data-slot":`kbd`,className:X(UD,e),...t})}function GD({className:e,...t}){return(0,W.jsx)(`kbd`,{"data-slot":`kbd-group`,className:X(`inline-flex items-center gap-0.5`,e),...t})}var KD=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),qD={alt:`⌥`,ctrl:`⌃`,shift:`⇧`,meta:`⌘`,cmd:`⌘`},JD={enter:`↵`,esc:`Esc`,escape:`Esc`,arrowleft:`←`,arrowright:`→`,arrowup:`↑`,arrowdown:`↓`,space:`Space`,delete:`Del`,backspace:`⌫`};function YD(e){return e.split(`+`).map(e=>{let t=e.toLowerCase();return KD&&qD[t]?qD[t]:JD[t]??(e.length===1?e.toUpperCase():e[0].toUpperCase()+e.slice(1))})}function XD({chord:e,className:t}){let n=YD(e);return(0,W.jsx)(GD,{className:t,children:n.map((e,t)=>(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[t>0?(0,W.jsx)(`span`,{className:`sr-only`,children:`plus`}):null,(0,W.jsx)(WD,{children:e})]},t))})}function ZD({chord:e,children:t,className:n}){return(0,W.jsxs)(`span`,{className:X(`kbd-hint inline-flex shrink-0 items-center gap-1.5 text-xs whitespace-nowrap text-muted-foreground`,n),children:[(0,W.jsx)(XD,{chord:e}),t]})}function QD({open:e,onOpenChange:t,label:n,description:r,dismissOnBackdrop:i=!0,className:a,style:o,onCloseAutoFocus:s,onEscapeKeyDown:c,children:l}){let u=Tf();return(0,W.jsx)(TS,{open:e,onOpenChange:t,children:(0,W.jsx)(Au,{children:e?(0,W.jsxs)(jS,{forceMount:!0,children:[(0,W.jsx)(NS,{asChild:!0,forceMount:!0,children:(0,W.jsx)(Yf.div,{className:`fixed inset-0 z-50 bg-scrim backdrop-blur-sm`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16,ease:`easeOut`}})}),(0,W.jsx)(`div`,{className:`pointer-events-none fixed inset-0 z-50 grid place-items-center p-4`,children:(0,W.jsx)(LS,{asChild:!0,forceMount:!0,onCloseAutoFocus:s,...c?{onEscapeKeyDown:c}:{},onInteractOutside:e=>{i||e.preventDefault()},onOpenAutoFocus:e=>{let t=e.currentTarget?.querySelector(`[data-nav], [data-autofocus], textarea`);t&&(e.preventDefault(),t.focus())},...r?{}:{"aria-describedby":void 0},children:(0,W.jsxs)(Yf.div,{className:X(`glass-pop pointer-events-auto flex max-h-[min(86svh,48rem)] w-full max-w-2xl flex-col overflow-hidden rounded-2xl outline-none`,a),style:o,initial:{opacity:0,scale:u?1:.98,y:u?0:6},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:u?1:.98,transition:{duration:.15,ease:`easeIn`}},transition:{duration:.2,ease:[.32,.72,0,1]},children:[(0,W.jsx)(HS,{className:`sr-only`,children:n}),r?(0,W.jsx)(WS,{className:`sr-only`,children:r}):null,l]})})})]}):null})})}var $D=[],eO=0,tO=new Set;function nO(){for(let e of[...tO])e()}function rO(e){return tO.add(e),()=>{tO.delete(e)}}function iO(){let e;for(let t of $D)(!e||t.priority>e.priority||t.priority===e.priority&&t.order<e.order)&&(e=t);return e?.id}var aO={question:30,confirm:20,help:10,sheet:5};function oO(e,t){let n=(0,m.useId)();(0,m.useEffect)(()=>{if(e)return $D=[...$D,{id:n,priority:t,order:++eO}],nO(),()=>{$D=$D.filter(e=>e.id!==n),nO()}},[e,t,n]);let r=(0,m.useSyncExternalStore)(rO,iO,()=>void 0);return e&&r===n}function sO(){return $D.length>0}function cO(){return(0,m.useSyncExternalStore)(rO,()=>$D.length>0,()=>!1)}var lO=[`lobby`,`tasks`,`plan`,`git`,`knowledge`],uO=`already answered in another window`,dO=`Attached files:`,fO={master:`MASTER`,designer:`DESIGN`,backend:`DEV`,qa:`QA`,researcher:`RESEARCH`,scout:`SCOUT`},pO=[{name:`master`,agent:`master`,hint:`The oracle: anything, and changes across the project`},{name:`design`,agent:`designer`,hint:`Frontend: pages, components, styling and UX`},{name:`dev`,agent:`backend`,hint:`Backend: APIs, data and server code`},{name:`qa`,agent:`qa`,hint:`Tests, and how to check a change`},{name:`research`,agent:`researcher`,hint:`Facts from the web: libraries, versions, docs`},{name:`scout`,agent:`scout`,hint:`Reads the code and explains how something works`}],mO=[{name:`plan`,args:`what to plan`,hint:`Plan it with the panel on the Plan tab`},{name:`task`,args:`what to do`,hint:`Start it as a task for the team`}],hO=new Set(lO);function gO(e){let t=e.replace(/^#\/?/,``).split(`/`).filter(Boolean);if(t[0]===`issues`)return[`#/git/issues`,...t.slice(1,2)].join(`/`);if(t[0]===`sessions`||t[0]===`excalidraw`||t[0]===`metrics`)return`#/lobby`;if(t[0]===`tasks`&&t[1]===`board`)return[`#/tasks`,...t.slice(2,3)].join(`/`)}function _O(e){let t=e.replace(/^#\/?/,``).split(`/`).filter(Boolean),n=t[0];if(!n||n===`lobby`)return{kind:`tab`,tab:`lobby`,rest:t.slice(1)};if(n===`settings`)return{kind:`settings`};if(hO.has(n))return{kind:`tab`,tab:n,rest:t.slice(1)}}function vO(e,...t){return`#/${e}${t.filter(Boolean).map(e=>`/${encodeURIComponent(e)}`).join(``)}`}function yO(e){window.location.hash!==e&&(window.location.hash=e)}function bO(){let[e,t]=(0,m.useState)(()=>_O(gO(window.location.hash)??window.location.hash)??{kind:`tab`,tab:`lobby`,rest:[]});return(0,m.useEffect)(()=>{let e=()=>{let e=gO(window.location.hash),n=_O(e||window.location.hash);(e||!n)&&window.history.replaceState(null,``,e??`#/lobby`),t(n??{kind:`tab`,tab:`lobby`,rest:[]})};return e(),window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]),e}function xO({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`empty`,className:X(`flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 p-6 text-center text-balance`,e),...t})}function SO({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`empty-header`,className:X(`flex max-w-sm flex-col items-center gap-2`,e),...t})}var CO=Jv(`mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,icon:`relative flex size-9 shrink-0 items-center justify-center rounded-md border bg-card text-foreground shadow-sm/5 [&_svg:not([class*='size-'])]:size-4.5`}},defaultVariants:{variant:`default`}});function wO({className:e,variant:t=`default`,...n}){return(0,W.jsx)(`div`,{"data-slot":`empty-icon`,"data-variant":t,className:X(CO({variant:t,className:e})),...n})}function TO({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`empty-title`,className:X(`text-[1.0625rem] leading-6 font-medium`,e),...t})}function EO({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`empty-description`,className:X(`text-[0.8125rem] leading-[1.125rem] text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}function DO({className:e,...t}){return(0,W.jsx)(`span`,{"data-slot":`spinner`,role:`status`,"aria-label":`Loading`,className:X(`inline-flex size-4 shrink-0 items-end justify-between text-primary`,e),...t,children:[0,1,2].map(e=>(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`block aspect-square h-[28%] shrink-0 rounded-full bg-current motion-safe:animate-[hop_0.9s_ease-in-out_infinite]`,style:{animationDelay:`${e*.14}s`}},e))})}var OO=Jv([`relative w-full text-sm border has-[>svg]:grid-cols-[calc(var(--spacing)*3)_1fr] grid-cols-[0_1fr] grid gap-y-0.5 items-center [&>svg:not([class*=size-])]:size-4`,`has-[>[data-slot=alert-title]+[data-slot=alert-description]]:[&_[data-slot=alert-action]]:sm:row-end-3`,`has-[>[data-slot=alert-title]+[data-slot=alert-description]]:items-start`,`has-[>[data-slot=alert-title]+[data-slot=alert-description]]:[&_svg]:translate-y-0.5`,`rounded-lg`,`px-3`,`py-2.5`,`has-[>svg]:gap-x-2.5`],{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`border-destructive/30 bg-destructive/4 [&>svg]:text-destructive`,info:`border-info/30 bg-info/4 [&>svg]:text-info`,success:`border-success/30 bg-success/4 [&>svg]:text-success`,warning:`border-warning/30 bg-warning/4 [&>svg]:text-warning`,invert:`border-invert bg-invert text-invert-foreground [&_[data-slot=alert-description]]:text-invert-foreground/70`}},defaultVariants:{variant:`default`}});function kO({className:e,variant:t,...n}){return(0,W.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:X(OO({variant:t}),e),...n})}function AO({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`alert-description`,className:X(`text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed`,e),...t})}function jO({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`alert-action`,className:X(`flex gap-1.5 max-sm:col-start-2 max-sm:mt-2 max-sm:justify-start sm:col-start-3 sm:row-start-1 sm:justify-end sm:self-center`,e),...t})}function MO({label:e=`Connecting…`}){return(0,W.jsxs)(`div`,{className:`flex min-h-48 min-w-0 w-full max-w-full flex-1 items-center justify-center gap-2 overflow-y-auto px-4 py-8 text-sm text-muted-foreground`,children:[(0,W.jsx)(DO,{}),(0,W.jsx)(`span`,{children:e})]})}function NO({message:e,onRetry:t}){return(0,W.jsxs)(xO,{className:`m-4 min-h-0 min-w-0 flex-1 overflow-y-auto`,children:[(0,W.jsxs)(SO,{children:[(0,W.jsxs)(TO,{className:`flex items-center gap-2`,children:[(0,W.jsx)(Yg,{className:`size-4 text-destructive`,"aria-hidden":`true`}),`Could not load this view`]}),(0,W.jsx)(EO,{children:e??`The request failed. Try again.`})]}),t?(0,W.jsxs)(Z,{variant:`outline`,onClick:t,children:[(0,W.jsx)(_g,{"aria-hidden":`true`}),`Try again`]}):null]})}function PO({onRetry:e}){return(0,W.jsxs)(kO,{variant:`destructive`,role:`status`,className:`mx-3 mb-1 max-h-32 w-auto min-w-0 overflow-y-auto max-sm:mx-2`,children:[(0,W.jsx)(a_,{className:`size-4`,"aria-hidden":`true`}),(0,W.jsx)(AO,{children:`Lost pi — reconnecting every 2 s. Your planning session and tasks carry on when it is back.`}),e?(0,W.jsx)(jO,{children:(0,W.jsx)(Z,{variant:`link`,className:`h-8 px-1 text-destructive`,onClick:e,children:`Retry now`})}):null]})}function FO(){let[e,t]=(0,m.useReducer)(e=>e+1,0);return(0,m.useEffect)(()=>I.subscribe(t),[]),e}function IO(){return FO(),I.status()}function LO(e){return FO(),I.get(e)}function RO(e){let t=(0,m.useCallback)(t=>{let n=window.matchMedia(e);return n.addEventListener(`change`,t),()=>n.removeEventListener(`change`,t)},[e]),n=(0,m.useCallback)(()=>window.matchMedia(e).matches,[e]);return(0,m.useSyncExternalStore)(t,n)}function zO(e,t,n,r=!0){FO();let[i,a]=(0,m.useState)({loading:!0,at:0}),[o,s]=(0,m.useState)(0),c=[I.status().connection,...n.map(e=>I.get(e).version)].join(`,`),l=JSON.stringify(t);(0,m.useEffect)(()=>{if(!r)return;let t=!0,n=performance.now();return a(e=>({...e,loading:!0})),z(e,JSON.parse(l)).then(e=>t&&a({data:e,loading:!1,at:n}),e=>t&&a(t=>({...t,error:e instanceof Error?e.message:String(e),loading:!1}))),()=>{t=!1}},[e,l,c,o,r]);let u=(0,m.useCallback)(()=>s(e=>e+1),[]);return{data:i.data,error:i.error,loading:i.loading,requestedAt:i.at,reload:u}}function BO({delayDuration:e=400,...t}){return(0,W.jsx)(LD,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function VO({...e}){return(0,W.jsx)(RD,{"data-slot":`tooltip`,...e})}function HO({...e}){return(0,W.jsx)(zD,{"data-slot":`tooltip-trigger`,...e})}function UO({className:e,sideOffset:t=6,children:n,...r}){return(0,W.jsx)(BD,{children:(0,W.jsx)(VD,{"data-slot":`tooltip-content`,sideOffset:t,className:X(`z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md border bg-popover px-2 py-1 text-xs leading-snug text-popover-foreground shadow-md/5 has-data-[slot=kbd]:pr-1 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 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-lg data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:n})})}function WO(e){return[...e.querySelectorAll(`[data-nav]`)].filter(e=>!e.hasAttribute(`disabled`)&&e.getAttribute(`aria-hidden`)!==`true`)}function GO(e,t,n){let r=WO(e);if(r.length===0)return!1;let i=t?r.findIndex(e=>e===t||e.contains(t)):-1,a=r[n===`first`?0:n===`last`?r.length-1:Math.max(0,Math.min(r.length-1,(i<0?n>0?-1:r.length:i)+n))];return!a||a===t?!1:(a.focus({preventScroll:!1}),!0)}function KO(e){let t=e;for(;t instanceof HTMLElement&&t.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&![`checkbox`,`radio`,`button`].includes(t.type)||t instanceof HTMLElement&&t.isContentEditable}function qO(e,t=!0){return e===`ArrowDown`||t&&e===`j`?1:e===`ArrowUp`||t&&e===`k`?-1:0}function JO(e,t=!0){return e===`ArrowRight`||t&&e===`l`?1:e===`ArrowLeft`||t&&e===`h`?-1:0}var YO=`button:not([disabled]), a[href], [role='button']:not([aria-disabled='true'])`;function XO(e){return[...e.querySelectorAll(YO)].filter(e=>e.offsetParent!==null)}function ZO(e,t,n){let r=XO(e);if(r.length===0)return;let i=t?r.findIndex(e=>e===t||e.contains(t)):-1;r[n===`first`?0:n===`last`?r.length-1:Math.max(0,Math.min(r.length-1,(i<0?n>0?-1:r.length:i)+n))]?.focus()}function QO(e,t=document.querySelector(`[data-pane='list']`)){if(!t)return;let n=[...t.querySelectorAll(`button[data-row]`)].filter(e=>e.offsetParent!==null),r=n.findIndex(e=>e.getAttribute(`aria-current`)===`true`),i=Math.max(0,Math.min(n.length-1,r<0?e>0?0:n.length-1:r+e));n[i]?.click(),n[i]?.focus({preventScroll:!0}),n[i]?.scrollIntoView({block:`nearest`})}function $O(e){return e.querySelector(`[aria-current='true']`)??XO(e)[0]}function ek(){let e=document.getElementById(`main`);if(!e)return!1;let t=e.querySelector(`[data-pane='list']`);return((t?$O(t):void 0)??XO(e)[0]??e).focus(),!0}function tk(){let e=document.querySelector(`[role='tab'][aria-selected='true']`);if(e)return e.focus({preventScroll:!0}),!0;let t=document.getElementById(`main`);return t?.focus({preventScroll:!0}),!!t}var nk={active:!1},rk=new Set([`g`,`j`,`k`,`h`,`l`,`d`,`p`,`/`,`?`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`]);function ik(e){if(!e)return!1;let t=e.toLowerCase();return t===`delete`||/^[a-z]$/.test(t)&&!rk.has(t)}function ak(e,t){return t.toLowerCase()===`delete`?e.key===`Delete`||e.key===`Backspace`:e.key.toLowerCase()===t.toLowerCase()}function ok(){return sO()||!!document.querySelector(`[role='dialog'], [role='alertdialog'], [role='menu'], [role='listbox']`)}function sk(e,t,{enabled:n=!0,inDialog:r=!1}={}){let i=(0,m.useRef)(t);i.current=t,(0,m.useEffect)(()=>{if(!n||!e)return;let t=t=>{t.defaultPrevented||t.isComposing||t.repeat||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||ak(t,e)&&(KO(t.target)||(r||!ok())&&(t.preventDefault(),i.current()))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,n,r])}var ck={neutral:`text-foreground`,primary:``,danger:`text-destructive hover:text-destructive`};function lk({label:e,icon:t,tone:n=`neutral`,shortcut:r,href:i,pressed:a,text:o,iconOnly:s,className:c,disabled:l,...u}){let d=(0,m.useRef)(null),f=ik(r);sk(f?r:void 0,()=>d.current?.click(),{enabled:f&&!l});let p=(0,W.jsx)(t,{"aria-hidden":`true`}),h=n===`primary`?`default`:s?`ghost`:`outline`,g=X(!s&&`px-2.5`,ck[n],c),_=s?`icon`:`default`,v=s?p:(0,W.jsxs)(W.Fragment,{children:[p,(0,W.jsx)(`span`,{children:o??e}),r?(0,W.jsx)(XD,{chord:r,className:`kbd-hint ml-1`}):null]}),y=i?(0,W.jsx)(Z,{asChild:!0,ref:d,variant:h,size:_,"data-tone":n,className:g,children:(0,W.jsx)(`a`,{href:i,target:`_blank`,rel:`noreferrer noopener`,"aria-label":e,"aria-keyshortcuts":f?r:void 0,children:v})}):(0,W.jsx)(Z,{ref:d,type:`button`,variant:h,size:_,"data-tone":n,"aria-label":e,"aria-pressed":a,"aria-keyshortcuts":f?r:void 0,disabled:l,className:g,...u,children:v});return s?(0,W.jsxs)(VO,{children:[(0,W.jsx)(HO,{asChild:!0,children:y}),(0,W.jsxs)(UO,{children:[e,(0,W.jsx)(XD,{chord:r??(i?`Enter`:`Enter / Space`)})]})]}):y}function uk({children:e,className:t}){function n(e){let t=e.key===`ArrowRight`?1:e.key===`ArrowLeft`?-1:0;if(!t)return;let n=[...e.currentTarget.querySelectorAll(`button:not([disabled]), a[href]`)],r=n.indexOf(e.target);r<0||(e.preventDefault(),e.stopPropagation(),n[Math.max(0,Math.min(n.length-1,r+t))]?.focus())}return(0,W.jsx)(`div`,{role:`toolbar`,"aria-label":`Actions`,onKeyDown:n,className:X(`sticky -top-5 z-10 -mx-5 -mt-5 flex min-h-12 flex-wrap items-center gap-1 border-b border-[var(--glass-edge)] sticky-glass px-4 py-2 [&>[data-tone=danger]:not(:first-child)]:ml-auto`,t),children:e})}var dk={type:`spring`,stiffness:520,damping:34,mass:.8};function fk({items:e,value:t,onChange:n,label:r,as:i=`radio`,size:a=`sm`,className:o,idPrefix:s}){let c=(0,m.useId)(),l=Tf()??!1,u=s??c;function d(r){let i=Math.max(0,e.findIndex(e=>e.id===t)),a=r.key===`ArrowRight`||r.key===`ArrowDown`?1:r.key===`ArrowLeft`||r.key===`ArrowUp`?-1:0,o=a?(i+a+e.length)%e.length:r.key===`Home`?0:r.key===`End`?e.length-1:-1;if(o<0)return;r.preventDefault(),r.stopPropagation();let s=e[o];n(s.id);let c=0,l=()=>{let e=document.getElementById(`${u}-${s.id}`);e&&e.tabIndex===0?e.focus():c++<20&&requestAnimationFrame(l)};requestAnimationFrame(l)}return(0,W.jsx)(`div`,{role:i===`tab`?`tablist`:i===`radio`?`radiogroup`:void 0,"aria-label":i===`nav`?void 0:r,onKeyDown:d,"data-slot":`segmented`,className:X(`segmented relative inline-flex max-w-full min-w-0 items-center gap-0.5 overflow-x-auto rounded-[10px] p-0.5 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,o),children:e.map(e=>{let r=e.id===t;return(0,W.jsxs)(`button`,{id:`${u}-${e.id}`,type:`button`,"data-segment":e.id,role:i===`nav`?void 0:i,...i===`tab`?{"aria-selected":r,"aria-controls":e.controls}:i===`radio`?{"aria-checked":r}:{"aria-current":r?`page`:void 0,"aria-controls":e.controls},"aria-label":e.name,tabIndex:r||i===`nav`?0:-1,onClick:()=>n(e.id),className:X(`relative isolate inline-flex shrink-0 items-center justify-center gap-1.5 rounded-lg px-3 font-medium whitespace-nowrap outline-none transition-colors duration-200 ease-snap focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,a===`sm`?`h-7 text-[0.8125rem]`:`h-8 text-sm`,r?`text-foreground`:`text-muted-foreground hover:text-foreground`),children:[r?(0,W.jsx)(Yf.span,{"aria-hidden":`true`,layoutId:`segment-thumb-${c}`,className:`segmented-thumb absolute inset-0 -z-10 rounded-lg`,transition:l?{duration:0}:dk}):null,e.label]},e.id)})})}function pk({...e}){return(0,W.jsx)(TS,{"data-slot":`sheet`,...e})}function mk({...e}){return(0,W.jsx)(KS,{"data-slot":`sheet-close`,...e})}function hk({...e}){return(0,W.jsx)(jS,{"data-slot":`sheet-portal`,...e})}function gk({className:e,...t}){return(0,W.jsx)(NS,{"data-slot":`sheet-overlay`,className:X(`fixed inset-0 z-50 bg-scrim backdrop-blur-sm duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function _k({className:e,children:t,side:n=`right`,showCloseButton:r=!0,forceMount:i,hidden:a,...o}){return(0,W.jsxs)(hk,{forceMount:i,children:[a?null:(0,W.jsx)(gk,{}),(0,W.jsxs)(LS,{forceMount:i,hidden:a,"data-slot":`sheet-content`,"data-side":n,className:X(`glass-pop fixed z-50 flex flex-col gap-4 bg-clip-padding text-sm shadow-lg/5 transition duration-200 ease-calm data-[side=bottom]:rounded-t-2xl data-[side=top]:rounded-b-2xl data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-8 data-[side=left]:data-open:slide-in-from-left-8 data-[side=right]:data-open:slide-in-from-right-8 data-[side=top]:data-open:slide-in-from-top-8 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-8 data-[side=left]:data-closed:slide-out-to-left-8 data-[side=right]:data-closed:slide-out-to-right-8 data-[side=top]:data-closed:slide-out-to-top-8`,e),...o,children:[t,r&&(0,W.jsx)(KS,{"data-slot":`sheet-close`,asChild:!0,children:(0,W.jsxs)(Z,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`,children:[(0,W.jsx)(d_,{}),(0,W.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})]})}function vk({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`sheet-header`,className:X(`flex flex-col gap-0.5 p-4`,e),...t})}function yk({className:e,...t}){return(0,W.jsx)(HS,{"data-slot":`sheet-title`,className:X(`text-base font-medium text-foreground`,e),...t})}function bk({className:e,...t}){return(0,W.jsx)(WS,{"data-slot":`sheet-description`,className:X(`text-sm text-muted-foreground`,e),...t})}var xk=Jv(`bg-muted-foreground/15 motion-safe:animate-skeleton`,{variants:{shape:{block:`rounded-sm`,card:`rounded-lg`,pill:`rounded-full`}},defaultVariants:{shape:`block`}});function Sk({className:e,shape:t,...n}){return(0,W.jsx)(`div`,{"aria-hidden":`true`,className:X(xk({shape:t}),e),"data-slot":`skeleton`,...n})}function Ck(){return RO(`(min-width: 1024px)`)}function wk({className:e,...t}){return(0,W.jsx)(`section`,{className:X(`min-h-0 min-w-0`,e),...t})}function Tk({open:e,onClose:t,describe:n,children:r}){let i=oO(e,aO.sheet),a=(0,m.useRef)(!1),o=(0,m.useRef)(null);return i&&(a.current=!0),e||(a.current=!1),(0,W.jsx)(pk,{open:e&&i,onOpenChange:e=>!e&&t(),children:(0,W.jsxs)(_k,{forceMount:e&&a.current?!0:void 0,hidden:!i,showCloseButton:!1,side:`right`,className:X(`gap-0 data-[side=right]:w-[92%] data-[side=right]:sm:max-w-3xl`,!i&&`!hidden`),children:[(0,W.jsxs)(vk,{className:`flex-row items-center justify-between border-b px-4 py-2`,children:[(0,W.jsx)(yk,{className:`text-sm`,children:`Detail`}),(0,W.jsx)(bk,{className:`sr-only`,children:n}),(0,W.jsx)(mk,{asChild:!0,children:(0,W.jsxs)(Z,{variant:`ghost`,size:`sm`,"aria-label":`Close detail`,title:`Close · Esc`,className:`gap-2`,children:[(0,W.jsx)(d_,{"aria-hidden":`true`}),`Close`,(0,W.jsx)(XD,{chord:`Esc`,className:`kbd-hint`})]})})]}),(0,W.jsx)(`div`,{ref:o,className:`min-h-0 flex-1 overflow-y-auto p-5`,children:r}),(0,W.jsx)(Gv,{target:o})]})})}function Ek({list:e,detail:t,open:n,detailClassName:r,listPane:i,detailPane:a,onListKey:o,onDetailKey:s}){let c=n&&t!==null;return(0,W.jsxs)(`div`,{className:X(`relative grid min-h-0 min-w-0 flex-1`,c?`grid-rows-[minmax(0,1fr)_minmax(0,2fr)]`:`grid-rows-1`),children:[(0,W.jsx)(wk,{"data-pane":`list`,ref:i,onKeyDown:o,className:X(`min-w-0 overflow-x-hidden overflow-y-auto`,c?`border-b border-border`:`pb-dock`),children:e}),c?(0,W.jsx)(wk,{"data-pane":`detail`,ref:a,"aria-label":`Detail`,tabIndex:0,onKeyDown:s,className:X(`min-w-0 overflow-x-hidden overflow-y-auto px-5 pt-5 pb-dock`,r),children:t}):null,(0,W.jsx)(Gv,{target:i}),c?(0,W.jsx)(Gv,{target:a}):null]})}function Dk({wide:e,list:t,detail:n,open:r,onClose:i,hint:a,describe:o,inlineDetail:s,detailClassName:c}){let l=(0,m.useRef)(null),u=(0,m.useRef)(null),d=(0,m.useRef)(null);function f(t){let n=l.current;if(!n||t.defaultPrevented||t.nativeEvent.isComposing||sO()||t.altKey||t.ctrlKey||t.metaKey||KO(t.target)||t.target instanceof HTMLInputElement)return;let r=qO(t.key,!1);r?(t.preventDefault(),ZO(n,t.target,r)):t.key===`Home`||t.key===`End`?(t.preventDefault(),ZO(n,t.target,t.key===`Home`?`first`:`last`)):(e||s)&&JO(t.key)===1&&u.current&&(t.preventDefault(),u.current.focus())}function p(e){e.defaultPrevented||e.nativeEvent.isComposing||sO()||e.altKey||e.ctrlKey||e.metaKey||KO(e.target)||JO(e.key)===-1&&l.current&&(e.preventDefault(),$O(l.current)?.focus())}return!e&&s?(0,W.jsx)(Ek,{list:t,detail:n,open:r,detailClassName:c,listPane:l,detailPane:u,onListKey:f,onDetailKey:p}):e?(0,W.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-[clamp(17rem,28%,23rem)_minmax(0,1fr)] gap-3 p-3`,children:[(0,W.jsxs)(`div`,{className:`workspace-pane min-h-0 min-w-0 overflow-hidden rounded-xl border shadow-xs`,children:[(0,W.jsx)(wk,{"data-pane":`list`,ref:l,onKeyDown:f,className:`h-full overflow-y-auto pb-dock`,children:t}),(0,W.jsx)(Gv,{target:l})]}),(0,W.jsxs)(`div`,{className:`workspace-pane min-h-0 min-w-0 overflow-hidden rounded-xl border shadow-xs`,children:[(0,W.jsx)(wk,{"data-pane":`detail`,ref:u,tabIndex:0,"aria-label":`Detail`,onKeyDown:p,className:X(`h-full overflow-y-auto px-5 pt-5 pb-dock outline-none focus-visible:bg-muted/30`,c),children:n??(0,W.jsx)(`div`,{className:`grid h-full min-h-48 place-items-center`,children:(0,W.jsxs)(`div`,{className:`flex max-w-xs flex-col items-center gap-3 text-center`,children:[(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground`,children:(0,W.jsx)(Yh,{className:`size-5`})}),(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:a}),(0,W.jsxs)(`p`,{className:`kbd-hint flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,W.jsx)(XD,{chord:`ArrowUp`}),(0,W.jsx)(XD,{chord:`ArrowDown`}),`move`]}),(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,W.jsx)(XD,{chord:`ArrowRight`}),`open`]})]})]})})}),(0,W.jsx)(Gv,{target:u})]})]}):(0,W.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:[(0,W.jsxs)(`div`,{ref:d,className:`flex min-h-0 flex-1 flex-col overflow-y-auto pb-dock`,children:[(0,W.jsx)(wk,{"data-pane":`list`,ref:l,onKeyDown:f,children:t}),(0,W.jsx)(Tk,{open:r&&n!==null,onClose:i,describe:o,children:n})]}),(0,W.jsx)(Gv,{target:d})]})}function Ok({title:e,count:t,lead:n,children:r}){return(0,W.jsxs)(`div`,{className:`sticky top-0 z-10 flex min-h-12 flex-wrap items-center gap-x-3 gap-y-1 border-b border-[var(--glass-edge)] sticky-glass px-4 py-2`,children:[(0,W.jsx)(`h2`,{className:n?`sr-only`:`text-sm font-medium`,children:e}),n,(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`min-w-2 flex-1`}),t?(0,W.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:t}):null,r?(0,W.jsx)(`div`,{className:`flex items-center gap-1.5`,children:r}):null]})}function kk(){return(0,W.jsx)(`div`,{className:`flex flex-col gap-1.5 p-3`,role:`status`,"aria-label":`Loading`,children:[0,1,2,3].map(e=>(0,W.jsx)(Sk,{shape:`card`,className:`h-11`},e))})}function Ak({className:e,...t}){return(0,W.jsx)(`textarea`,{"data-slot":`textarea`,className:X(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-background bg-clip-padding px-3 py-2 text-sm shadow-control transition-[border-color,box-shadow] duration-150 outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/24 focus-visible:shadow-none disabled:cursor-not-allowed disabled:opacity-64 aria-invalid:border-destructive/36 aria-invalid:focus-visible:border-destructive/64 aria-invalid:focus-visible:ring-destructive/16 dark:bg-input/32`,e),...t})}function jk(e){return e<10?`0${e}`:String(e)}function Mk(e){if(!Number.isFinite(e))return`0`;let t=new Date(e);return`${jk(t.getHours())}:${jk(t.getMinutes())}`}function Nk(e){if(!Number.isFinite(e)||e<5e3)return`now`;let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);if(n<60)return`${n}m`;let r=Math.floor(n/60);return r<48?`${r}h`:`${Math.floor(r/24)}d`}function Pk(e){let t=Nk(e);return t===`now`?`just now`:`${t} ago`}function Fk({...e}){return(0,W.jsx)(uC,{"data-slot":`alert-dialog`,...e})}function Ik({...e}){return(0,W.jsx)(dC,{"data-slot":`alert-dialog-portal`,...e})}function Lk({className:e,...t}){return(0,W.jsx)(fC,{"data-slot":`alert-dialog-overlay`,className:X(`fixed inset-0 z-50 bg-scrim backdrop-blur-sm duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function Rk({className:e,...t}){return(0,W.jsxs)(Ik,{children:[(0,W.jsx)(Lk,{}),(0,W.jsx)(pC,{"data-slot":`alert-dialog-content`,className:X(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 glass-pop rounded-2xl p-4 text-sm duration-200 data-open:zoom-in-[0.98] data-closed:zoom-out-[0.98] outline-none sm:max-w-md data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})]})}function zk({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:X(`flex flex-col gap-1.5`,e),...t})}function Bk({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:X(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function Vk({className:e,...t}){return(0,W.jsx)(gC,{"data-slot":`alert-dialog-title`,className:X(`text-base font-medium text-foreground`,e),...t})}function Hk({className:e,...t}){return(0,W.jsx)(_C,{"data-slot":`alert-dialog-description`,className:X(`text-sm text-muted-foreground`,e),...t})}function Uk({className:e,variant:t=`default`,...n}){return(0,W.jsx)(Z,{variant:t,size:`sm`,className:X(`h-7 gap-1 px-2.5`,e),asChild:!0,children:(0,W.jsx)(mC,{"data-slot":`alert-dialog-action`,...n})})}function Wk({className:e,...t}){return(0,W.jsx)(Z,{variant:`outline`,size:`sm`,className:X(`h-7 gap-1 px-2.5`,e),asChild:!0,children:(0,W.jsx)(hC,{"data-slot":`alert-dialog-cancel`,...t})})}function Gk({label:e,text:t,shortcut:n,title:r,description:i,confirmLabel:a,onConfirm:o,icon:s,disabled:c,variant:l=`outline`,iconOnly:u,compact:d}){let[f,p]=(0,m.useState)(!1),h=oO(f,aO.confirm),g=l===`destructive`;return sk(`y`,()=>{p(!1),o()},{enabled:f&&h,inDialog:!0}),(0,W.jsxs)(Fk,{open:f&&h,onOpenChange:p,children:[(0,W.jsx)(lk,{label:e,icon:s,tone:g?`danger`:`neutral`,disabled:c,shortcut:n,iconOnly:u,...d?{"data-compact":!0,className:`size-8`}:{},...t?{text:t}:{},onClick:()=>p(!0)}),(0,W.jsxs)(Rk,{children:[(0,W.jsxs)(zk,{children:[(0,W.jsx)(Vk,{children:r}),(0,W.jsx)(Hk,{children:i})]}),(0,W.jsxs)(Bk,{children:[(0,W.jsxs)(Wk,{children:[`Keep it`,(0,W.jsx)(XD,{chord:`Esc`,className:`kbd-hint ml-1`})]}),(0,W.jsxs)(Uk,{variant:g?`destructive`:`default`,onClick:o,children:[a,(0,W.jsx)(XD,{chord:`Y`,className:`kbd-hint ml-1`})]})]})]})]})}var Kk=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,qk=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Jk={};function Yk(e,t){return((t||Jk).jsx?qk:Kk).test(e)}var Xk={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},Zk=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
60
- `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),Qk=n((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(Zk());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),$k=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),eA=n(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Qk()),r=$k();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),tA=rA(`end`),nA=rA(`start`);function rA(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function iA(e){let t=nA(e),n=tA(e);if(t&&n)return{start:t,end:n}}function aA(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?sA(e.position):`start`in e||`end`in e?sA(e):`line`in e||`column`in e?oA(e):``}function oA(e){return cA(e&&e.line)+`:`+cA(e&&e.column)}function sA(e){return oA(e&&e.start)+`-`+oA(e&&e.end)}function cA(e){return e&&typeof e==`number`?e:1}var lA=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=aA(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};lA.prototype.file=``,lA.prototype.name=``,lA.prototype.reason=``,lA.prototype.message=``,lA.prototype.stack=``,lA.prototype.column=void 0,lA.prototype.line=void 0,lA.prototype.ancestors=void 0,lA.prototype.cause=void 0,lA.prototype.fatal=void 0,lA.prototype.place=void 0,lA.prototype.ruleId=void 0,lA.prototype.source=void 0;var uA=t(eA(),1),dA={}.hasOwnProperty,fA=new Map,pA=/[A-Z]/g,mA=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),hA=new Set([`td`,`th`]),gA=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function _A(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=OA(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=DA(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?a:l,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=vA(i,e,void 0);return o&&typeof o!=`string`?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function vA(e,t,n){if(t.type===`element`)return yA(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return bA(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return SA(e,t,n);if(t.type===`mdxjsEsm`)return xA(e,t);if(t.type===`root`)return CA(e,t,n);if(t.type===`text`)return wA(e,t)}function yA(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=a,e.schema=i),e.ancestors.push(t);let o=PA(e,t.tagName,!1),s=kA(e,t),l=jA(e,t);return mA.has(t.tagName)&&(l=l.filter(function(e){return typeof e!=`string`||!c(e)})),TA(e,s,o,t),EA(s,l),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function bA(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}FA(e,t.position)}function xA(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);FA(e,t.position)}function SA(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=a,e.schema=i),e.ancestors.push(t);let o=t.name===null?e.Fragment:PA(e,t.name,!0),s=AA(e,t),c=jA(e,t);return TA(e,s,o,t),EA(s,c),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function CA(e,t,n){let r={};return EA(r,jA(e,t)),e.create(t,e.Fragment,r,n)}function wA(e,t){return t.value}function TA(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function EA(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function DA(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function OA(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=nA(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function kA(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&dA.call(t.properties,i)){let a=MA(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&hA.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function AA(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else FA(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else FA(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function jA(e,t){let n=[],r=-1,i=e.passKeys?new Map:fA;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=vA(e,a,o);s!==void 0&&n.push(s)}return n}function MA(e,t,n){let i=r(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?u(n):s(n)),i.property===`style`){let t=typeof n==`object`?n:NA(e,String(n));return e.stylePropertyNameCase===`css`&&(t=IA(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&i.space?Xk[i.property]||i.property:i.attribute,n]}}function NA(e,t){try{return(0,uA.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new lA("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=gA+`#cannot-parse-style-attribute`,r}}function PA(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=Yk(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=Yk(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return dA.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);FA(e)}function FA(e,t){let n=new lA("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=gA+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function IA(e){let t={},n;for(n in e)dA.call(e,n)&&(t[LA(n)]=e[n]);return t}function LA(e){let t=e.replace(pA,RA);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function RA(e){return`-`+e.toLowerCase()}var zA={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},BA={};function VA(e,t){let n=t||BA;return HA(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function HA(e,t,n){if(WA(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return UA(e.children,t,n)}return Array.isArray(e)?UA(e,t,n):``}function UA(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=HA(e[i],t,n);return r.join(``)}function WA(e){return!!(e&&typeof e==`object`)}var GA=document.createElement(`i`);function KA(e){let t=`&`+e+`;`;GA.innerHTML=t;let n=GA.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function qA(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function JA(e,t){return e.length>0?(qA(e,e.length,0,t),e):t}var YA={}.hasOwnProperty;function XA(e){let t={},n=-1;for(;++n<e.length;)ZA(t,e[n]);return t}function ZA(e,t){let n;for(n in t){let r=(YA.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){YA.call(r,a)||(r[a]=[]);let e=i[a];QA(r[a],Array.isArray(e)?e:e?[e]:[])}}}function QA(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);qA(e,0,0,r)}function $A(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function ej(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var tj=fj(/[A-Za-z]/),nj=fj(/[\dA-Za-z]/),rj=fj(/[#-'*+\--9=?A-Z^-~]/);function ij(e){return e!==null&&(e<32||e===127)}var aj=fj(/\d/),oj=fj(/[\dA-Fa-f]/),sj=fj(/[!-/:-@[-`{-~]/);function Q(e){return e!==null&&e<-2}function cj(e){return e!==null&&(e<0||e===32)}function lj(e){return e===-2||e===-1||e===32}var uj=fj(/\p{P}|\p{S}/u),dj=fj(/\s/);function fj(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function pj(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&nj(e.charCodeAt(n+1))&&nj(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function mj(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return lj(r)?(e.enter(n),s(r)):t(r)}function s(r){return lj(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function hj(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&lj(t)?(e.enter(r),c(t)):l(t)}function c(t){return lj(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var gj={tokenize:_j};function _j(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),mj(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return Q(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var vj=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){yj(this,e,t,n,!1)}addBefore(e,t,n){yj(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function yj(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var bj={tokenize:Sj},xj={tokenize:Cj};function Sj(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;let c=new vj;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(xj,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(xj,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return Q(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;let l=new vj;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Cj(e,t,n){return mj(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function wj(e){if(e===null||cj(e)||dj(e))return 1;if(uj(e))return 2}function Tj(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var Ej={name:`attention`,resolveAll:Dj,tokenize:Oj};function Dj(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};kj(o,-a),kj(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=JA(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=JA(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=JA(r,Tj(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=JA(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=JA(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),qA(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Oj(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=wj(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=wj(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function kj(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Aj={name:`autolink`,tokenize:jj};function jj(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return tj(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||nj(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||nj(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||ij(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):rj(t)?(e.consume(t),l):n(t)}function u(e){return nj(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||nj(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var Mj={partial:!0,tokenize:Nj};function Nj(e,t,n){return r;function r(t){return lj(t)?mj(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Q(e)?t(e):n(e)}}var Pj={continuation:{tokenize:Ij},exit:Lj,name:`blockQuote`,tokenize:Fj};function Fj(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return lj(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function Ij(e,t,n){let r=this;return i;function i(t){return lj(t)?mj(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Pj,t,n)(r)}}function Lj(e){e.exit(`blockQuote`)}var Rj={name:`characterEscape`,tokenize:zj};function zj(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return sj(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var Bj={name:`characterReference`,tokenize:Vj};function Vj(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=nj,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=oj,u):(e.enter(`characterReferenceValue`),a=7,o=aj,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===nj&&!KA(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var Hj={partial:!0,tokenize:Uj};function Uj(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var Wj={concrete:!0,name:`codeFenced`,tokenize:Gj};function Gj(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),lj(t)?mj(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Q(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Hj,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):lj(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),mj(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Q(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&lj(t)?mj(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Q(t)?e.check(Hj,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Q(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),lj(t)?mj(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),lj(t)?mj(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Q(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var Kj={name:`codeIndented`,tokenize:Jj},qj={partial:!0,tokenize:Yj};function Jj(e,t,n){return r;function r(t){return e.enter(`codeIndented`),hj(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):Q(t)?e.attempt(qj,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||Q(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function Yj(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Q(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):hj(e,t,a,`linePrefix`,4,4)(o)}function a(e){return Q(e)?i(e):n(e)}}var Xj={name:`codeText`,previous:Qj,resolve:Zj,tokenize:$j};function Zj(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Qj(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function $j(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):Q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||Q(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var eM=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&tM(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),tM(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),tM(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);tM(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);tM(this.left,t.reverse())}}}};function tM(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function nM(e){let t={},n=-1,r,i,a,o,s,c,l,u=new eM(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,rM(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return qA(e,0,1/0,u.slice(0)),!l}function rM(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var iM={resolve:oM,tokenize:sM},aM={partial:!0,tokenize:cM};function oM(e){return nM(e),e}function sM(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):Q(t)?e.check(aM,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function cM(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),mj(e,a,`linePrefix`)}function a(i){if(i===null||Q(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function lM(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||ij(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||Q(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||cj(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||ij(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function uM(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):Q(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||Q(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!lj(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function dM(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):Q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),mj(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Q(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function fM(e,t){let n;return r;function r(i){return Q(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):lj(i)?mj(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var pM={name:`definition`,tokenize:hM},mM={partial:!0,tokenize:gM};function hM(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return uM.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=ej(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return cj(t)?fM(e,l)(t):l(t)}function l(t){return lM(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(mM,d,d)(t)}function d(t){return lj(t)?mj(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Q(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function gM(e,t,n){return r;function r(t){return cj(t)?fM(e,i)(t):n(t)}function i(t){return dM(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return lj(t)?mj(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Q(e)?t(e):n(e)}}var _M={name:`hardBreakEscape`,tokenize:vM};function vM(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Q(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var yM={name:`headingAtx`,resolve:bM,tokenize:xM};function bM(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};qA(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function xM(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||cj(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Q(n)?(e.exit(`atxHeading`),t(n)):lj(n)?mj(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||cj(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var SM=`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`.split(`.`),CM=[`pre`,`script`,`style`,`textarea`],wM={concrete:!0,name:`htmlFlow`,resolveTo:EM,tokenize:DM},TM={partial:!0,tokenize:OM};function EM(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function DM(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:F):tj(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):tj(a)?(e.consume(a),i=4,r.interrupt?t:F):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:F):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return tj(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||cj(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&CM.includes(l)?(i=1,r.interrupt?t(s):O(s)):SM.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||nj(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return lj(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||tj(t)?(e.consume(t),b):lj(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||nj(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):lj(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):lj(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Q(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||cj(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||lj(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||Q(t)?O(t):lj(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),j):t===60&&i===1?(e.consume(t),M):t===62&&i===4?(e.consume(t),te):t===63&&i===3?(e.consume(t),F):t===93&&i===5?(e.consume(t),P):Q(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(TM,ne,k)(t)):t===null||Q(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(Hj,A,ne)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee}function ee(t){return t===null||Q(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function j(t){return t===45?(e.consume(t),F):O(t)}function M(t){return t===47?(e.consume(t),o=``,N):O(t)}function N(t){if(t===62){let n=o.toLowerCase();return CM.includes(n)?(e.consume(t),te):O(t)}return tj(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),N):O(t)}function P(t){return t===93?(e.consume(t),F):O(t)}function F(t){return t===62?(e.consume(t),te):t===45&&i===2?(e.consume(t),F):O(t)}function te(t){return t===null||Q(t)?(e.exit(`htmlFlowData`),ne(t)):(e.consume(t),te)}function ne(n){return e.exit(`htmlFlow`),t(n)}}function OM(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Mj,t,n)}}var kM={name:`htmlText`,tokenize:AM};function AM(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):tj(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):tj(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):Q(t)?(o=d,M(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?j(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):Q(t)?(o=h,M(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?j(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?j(t):Q(t)?(o=v,M(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Q(t)?(o=y,M(t)):(e.consume(t),y)}function b(e){return e===62?j(e):y(e)}function x(t){return tj(t)?(e.consume(t),S):n(t)}function S(t){return t===45||nj(t)?(e.consume(t),S):C(t)}function C(t){return Q(t)?(o=C,M(t)):lj(t)?(e.consume(t),C):j(t)}function w(t){return t===45||nj(t)?(e.consume(t),w):t===47||t===62||cj(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),j):t===58||t===95||tj(t)?(e.consume(t),E):Q(t)?(o=T,M(t)):lj(t)?(e.consume(t),T):j(t)}function E(t){return t===45||t===46||t===58||t===95||nj(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):Q(t)?(o=D,M(t)):lj(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):Q(t)?(o=O,M(t)):lj(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,ee):t===null?n(t):Q(t)?(o=k,M(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||cj(t)?T(t):(e.consume(t),A)}function ee(e){return e===47||e===62||cj(e)?T(e):n(e)}function j(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function M(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),N}function N(t){return lj(t)?mj(e,P,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):P(t)}function P(t){return e.enter(`htmlTextData`),o(t)}}var jM={name:`labelEnd`,resolveAll:FM,resolveTo:IM,tokenize:LM},MM={tokenize:RM},NM={tokenize:zM},PM={tokenize:BM};function FM(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&qA(e,0,e.length,n),e}function IM(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=JA(o,e.slice(i+1,i+r+3)),o=JA(o,[[`enter`,l,t]]),o=JA(o,Tj(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=JA(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=JA(o,e.slice(a+1)),o=JA(o,[[`exit`,s,t]]),qA(e,i,e.length,o),e}function LM(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(ej(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(MM,u,o?u:d)(t):t===91?e.attempt(NM,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(PM,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function RM(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return cj(t)?fM(e,a)(t):a(t)}function a(t){return t===41?u(t):lM(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return cj(t)?fM(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?dM(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return cj(t)?fM(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function zM(e,t,n){let r=this;return i;function i(t){return uM.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(ej(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function BM(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var VM={name:`labelStartImage`,resolveAll:jM.resolveAll,tokenize:HM};function HM(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var UM={name:`labelStartLink`,resolveAll:jM.resolveAll,tokenize:WM};function WM(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var GM={name:`lineEnding`,tokenize:KM};function KM(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),mj(e,t,`linePrefix`)}}var qM={name:`thematicBreak`,tokenize:JM};function JM(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||Q(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),lj(t)?mj(e,s,`whitespace`)(t):s(t))}}var YM={continuation:{tokenize:$M},exit:tN,name:`list`,tokenize:QM},XM={partial:!0,tokenize:nN},ZM={partial:!0,tokenize:eN};function QM(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:aj(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(qM,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return aj(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(Mj,r.interrupt?n:u,e.attempt(XM,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return lj(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function $M(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Mj,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,mj(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!lj(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(ZM,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,mj(e,e.attempt(YM,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function eN(e,t,n){let r=this;return mj(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function tN(e){e.exit(this.containerState.type)}function nN(e,t,n){let r=this;return mj(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!lj(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var rN={name:`setextUnderline`,resolveTo:iN,tokenize:aN};function iN(e,t){let n=new vj,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function aN(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),lj(t)?mj(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Q(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var oN={tokenize:sN};function sN(e){let t=this,n=e.attempt(Mj,r,e.attempt(this.parser.constructs.flowInitial,i,mj(e,e.attempt(this.parser.constructs.flow,i,e.attempt(iM,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var cN={resolveAll:fN()},lN=dN(`string`),uN=dN(`text`);function dN(e){return{resolveAll:fN(e===`text`?pN:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function fN(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function pN(e,t){let n=new vj,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var mN=e({attentionMarkers:()=>SN,contentInitial:()=>gN,disable:()=>CN,document:()=>hN,flow:()=>vN,flowInitial:()=>_N,insideSpan:()=>xN,string:()=>yN,text:()=>bN}),hN={42:YM,43:YM,45:YM,48:YM,49:YM,50:YM,51:YM,52:YM,53:YM,54:YM,55:YM,56:YM,57:YM,62:Pj},gN={91:pM},_N={[-2]:Kj,[-1]:Kj,32:Kj},vN={35:yM,42:qM,45:[rN,qM],60:wM,61:rN,95:qM,96:Wj,126:Wj},yN={38:Bj,92:Rj},bN={[-5]:GM,[-4]:GM,[-3]:GM,33:VM,38:Bj,42:Ej,60:[Aj,kM],91:UM,92:[_M,Rj],93:jM,95:Ej,96:Xj},xN={null:[Ej,cN]},SN={null:[42,95]},CN={null:[]};function wN(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=JA(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Tj(a,l.events,l),l.events):[]}function f(e,t){return EN(p(e),t)}function p(e){return TN(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){Q(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&qA(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function TN(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function EN(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
61
- `;break;case-3:o=`\r
62
- `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function DN(e){let t={constructs:XA([mN,...(e||{}).extensions||[]]),content:n(gj),defined:[],document:n(bj),flow:n(oN),lazy:{},string:n(lN),text:n(uN)};return t;function n(e){return n;function n(n){return wN(t,e,n)}}}function ON(e){for(;!nM(e););return e}var kN=/[\0\t\n\r]/g;function AN(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i));let s=[],c=0;for(t=``,n&&=(i.charCodeAt(0)===65279&&c++,void 0);c<i.length;){kN.lastIndex=c;let n=kN.exec(i),a=n&&n.index!==void 0?n.index:i.length,o=i.charCodeAt(a);if(!n){t=i.slice(c);break}if(o===10&&c===a&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),c<a&&(s.push(i.slice(c,a)),e+=a-c),o){case 0:s.push(65533),e++;break;case 9:{let t=Math.ceil(e/4)*4;for(s.push(-2);e++<t;)s.push(-1);break}case 10:s.push(-4),e=1;break;default:r=!0,e=1}c=a+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var jN=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function MN(e){return e.replace(jN,NN)}function NN(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return $A(n.slice(t?2:1),t?16:10)}return KA(n)||e}var PN={}.hasOwnProperty;function FN(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),IN(n)(ON(DN(n).document().write(AN()(e,t,!0))))}function IN(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(ge),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(fe),blockQuote:a(le),characterEscape:T,characterReference:T,codeFenced:a(ue),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ue,o),codeText:a(de,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(L),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(R),hardBreakEscape:a(pe),hardBreakTrailing:a(pe),htmlFlow:a(me,o),htmlFlowData:T,htmlText:a(me,o),htmlTextData:T,image:a(he),label:o,link:a(ge),listItem:a(ve),listItemValue:f,listOrdered:a(_e,d),listUnordered:a(_e),paragraph:a(ye),reference:re,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(fe),strong:a(be),thematicBreak:a(xe)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:I,autolinkProtocol:ce,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:ae,characterReferenceMarkerNumeric:ae,characterReferenceValue:oe,characterReference:se,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(ee),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(M),label:P,labelText:N,lineEnding:D,link:c(j),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ie,resourceDestinationString:F,resourceTitleString:te,resource:ne,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};RN(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];PN.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||BN).call(a,void 0,e[0])}for(r.position={start:LN(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:LN(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:LN(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||BN).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+aA({start:e.start,end:e.end})+`): it’s not open`);n.position.end=LN(e.end)}function u(){return VA(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=ej(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=z(),n.position={start:LN(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=LN(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=LN(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=MN(t),n.identifier=ej(t).toLowerCase()}function P(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function F(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ne(){this.data.inReference=void 0}function re(){this.data.referenceType=`collapsed`}function ie(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=ej(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ae(e){this.data.characterReferenceType=e.type}function oe(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=$A(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=KA(t);let i=this.stack[this.stack.length-1];i.value+=r}function se(e){let t=this.stack.pop();t.position.end=LN(e.end)}function ce(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function I(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function le(){return{type:`blockquote`,children:[]}}function ue(){return{type:`code`,lang:null,meta:null,value:``}}function de(){return{type:`inlineCode`,value:``}}function L(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function R(){return{type:`emphasis`,children:[]}}function fe(){return{type:`heading`,depth:0,children:[]}}function pe(){return{type:`break`}}function me(){return{type:`html`,value:``}}function he(){return{type:`image`,title:null,url:``,alt:null}}function ge(){return{type:`link`,title:null,url:``,children:[]}}function _e(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function ve(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function ye(){return{type:`paragraph`,children:[]}}function be(){return{type:`strong`,children:[]}}function z(){return{type:`text`,value:``}}function xe(){return{type:`thematicBreak`}}}function LN(e){return{line:e.line,column:e.column,offset:e.offset}}function RN(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?RN(e,r):zN(e,r)}}function zN(e,t){let n;for(n in t)if(PN.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function BN(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+aA({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+aA({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+aA({start:t.start,end:t.end})+`) is still open`)}function VN(e){let t=this;t.parser=n;function n(n){return FN(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function HN(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function UN(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
63
- `}]}function WN(e,t){let n=t.value?t.value+`
64
- `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function GN(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function KN(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function qN(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=pj(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function JN(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function YN(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function XN(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function ZN(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return XN(e,t);let i={src:pj(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function QN(e,t){let n={src:pj(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function $N(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function eP(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return XN(e,t);let i={href:pj(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function tP(e,t){let n={href:pj(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function nP(e,t,n){let r=e.all(t),i=n?rP(n):iP(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
65
- `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
66
- `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function rP(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=iP(n[r])}return t}function iP(e){return e.spread??e.children.length>1}function aP(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function oP(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function sP(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function cP(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function lP(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=nA(t.children[1]),o=tA(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function uP(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function dP(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var fP=9,pP=32;function mP(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(hP(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(hP(t.slice(i),i>0,!1)),a.join(``)}function hP(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===fP||t===pP;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===fP||t===pP;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function gP(e,t){let n={type:`text`,value:mP(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function _P(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var vP={blockquote:HN,break:UN,code:WN,delete:GN,emphasis:KN,footnoteReference:qN,heading:JN,html:YN,imageReference:ZN,image:QN,inlineCode:$N,linkReference:eP,link:tP,listItem:nP,list:aP,paragraph:oP,root:sP,strong:cP,table:lP,tableCell:dP,tableRow:uP,text:gP,thematicBreak:_P,toml:yP,yaml:yP,definition:yP,footnoteDefinition:yP};function yP(){}var{defineProperty:bP}=Object,xP=typeof self==`object`?self:globalThis,SP=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new xP[e](t)},CP=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?bP(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof xP[e]==`function`?SP(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(SP(a,o),i)};return r},wP=e=>CP(new Map,e)(0),TP=``,{toString:EP}={},{keys:DP,is:OP}=Object,kP=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=EP.call(e).slice(8,-1);switch(n){case`Array`:return[1,TP];case`Object`:return[2,TP];case`Date`:return[3,TP];case`RegExp`:return[4,TP];case`Map`:return[5,TP];case`Set`:return[6,TP];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},AP=([e,t])=>e===0&&(t===`function`||t===`symbol`),jP=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=kP(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&OP(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of DP(o))(e||!AP(kP(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?TP:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(AP(kP(n))||AP(kP(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!AP(kP(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},MP=(e,{json:t,lossy:n}={})=>{let r=[];return jP(!(t||n),!!t,new Map,r)(e),r},NP=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?wP(MP(e,t)):structuredClone(e):(e,t)=>wP(MP(e,t));function PP(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function FP(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function IP(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||PP,r=e.options.footnoteBackLabel||FP,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=pj(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...NP(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
67
- `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
68
- `}]}}var LP=(function(e){if(e==null)return HP;if(typeof e==`function`)return VP(e);if(typeof e==`object`)return Array.isArray(e)?RP(e):zP(e);if(typeof e==`string`)return BP(e);throw Error(`Expected function, string, or object as test`)});function RP(e){let t=[],n=-1;for(;++n<e.length;)t[n]=LP(e[n]);return VP(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function zP(e){let t=e;return VP(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function BP(e){return VP(t);function t(t){return t&&t.type===e}}function VP(e){return t;function t(t,n,r){return!!(UP(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function HP(){return!0}function UP(e){return typeof e==`object`&&!!e&&`type`in e}function WP(e){return e}var GP=[];function KP(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=LP(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+WP(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=GP,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=qP(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function qP(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?GP:[e]}function JP(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),KP(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var YP={}.hasOwnProperty,XP={};function ZP(e,t){let n=t||XP,r=new Map,i=new Map,a={all:s,applyData:$P,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...vP,...n.handlers},one:o,options:n,patch:QP,wrap:tF};return JP(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(YP.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=NP(n);return r.children=a.all(e),r}return NP(e)}return(a.options.unknownHandler||eF)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=nF(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=nF(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function QP(e,t){e.position&&(t.position=iA(e))}function $P(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,NP(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function eF(e,t){let n=t.data||{},r=`value`in t&&!(YP.call(n,`hProperties`)||YP.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function tF(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
69
- `});++r<e.length;)r&&n.push({type:`text`,value:`
70
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
71
- `}),n}function nF(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function rF(e,t){let n=ZP(e,t),r=n.one(e,void 0),i=IP(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
72
- `},i)),a}function iF(e,t){return e&&`run`in e?async function(n,r){let i=rF(n,{file:r,...t});await e.run(i,r)}:function(n,r){return rF(n,{file:r,...e||t})}}function aF(e){if(e)throw e}var oF=n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function sF(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function cF(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?lF(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function lF(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var uF={basename:dF,dirname:fF,extname:pF,join:mF,sep:`/`};function dF(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);_F(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function fF(e){if(_F(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function pF(e){_F(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function mF(...e){let t=-1,n;for(;++t<e.length;)_F(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:hF(n)}function hF(e){_F(e);let t=e.codePointAt(0)===47,n=gF(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function gF(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function _F(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var vF={cwd:yF};function yF(){return`/`}function bF(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function xF(e){if(typeof e==`string`)e=new URL(e);else if(!bF(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return SF(e)}function SF(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var CF=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],wF=class{constructor(e){let t;t=e?bF(e)?{path:e}:typeof e==`string`||OF(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:vF.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<CF.length;){let e=CF[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)CF.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?uF.basename(this.path):void 0}set basename(e){EF(e,`basename`),TF(e,`basename`),this.path=uF.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?uF.dirname(this.path):void 0}set dirname(e){DF(this.basename,`dirname`),this.path=uF.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?uF.extname(this.path):void 0}set extname(e){if(TF(e,`extname`),DF(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=uF.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){bF(e)&&(e=xF(e)),EF(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?uF.basename(this.path,this.extname):void 0}set stem(e){EF(e,`stem`),TF(e,`stem`),this.path=uF.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new lA(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function TF(e,t){if(e&&e.includes(uF.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+uF.sep+"`")}function EF(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function DF(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function OF(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var kF=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),AF=t(oF(),1),jF={}.hasOwnProperty,MF=new class e extends kF{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=cF()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,AF.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(FF(`data`,this.frozen),this.namespace[e]=t,this):jF.call(this.namespace,e)&&this.namespace[e]||void 0:e?(FF(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=RF(e),n=this.parser||this.Parser;return NF(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),NF(`process`,this.parser||this.Parser),PF(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=RF(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);BF(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),NF(`processSync`,this.parser||this.Parser),PF(`processSync`,this.compiler||this.Compiler),this.process(e,r),LF(`processSync`,`process`,t),n;function r(e,r){t=!0,aF(e),n=r}}run(e,t,n){IF(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=RF(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),LF(`runSync`,`run`,n),r;function i(e,t){aF(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=RF(t),r=this.compiler||this.Compiler;return PF(`stringify`,r),IF(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(FF(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,AF.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];sF(o)&&sF(r)&&(r=(0,AF.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function NF(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function PF(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function FF(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function IF(e){if(!sF(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function LF(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function RF(e){return zF(e)?e:new wF(e)}function zF(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function BF(e){return typeof e==`string`||VF(e)}function VF(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var HF=[],UF={allowDangerousHtml:!0},WF=/^(https?|ircs?|mailto|xmpp)$/i,GF=[{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 KF(e){let t=qF(e),n=JF(e);return YF(t.runSync(t.parse(n),n),e)}function qF(e){let t=e.rehypePlugins||HF,n=e.remarkPlugins||HF,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...UF}:UF;return MF().use(VN).use(n).use(iF,r).use(t)}function JF(e){let t=e.children||``,n=new wF;return typeof t==`string`?n.value=t:``+t,n}function YF(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||XF;for(let e of GF)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return JP(e,l),_A(e,{Fragment:W.Fragment,components:i,ignoreInvalidStyle:!0,jsx:W.jsx,jsxs:W.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in zA)if(Object.hasOwn(zA,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=zA[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function XF(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||WF.test(e.slice(0,t))?e:``}function ZF(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function QF(e,t,n){let r=LP((n||{}).ignore||[]),i=$F(t),a=-1;for(;++a<i.length;)KP(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function $F(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([eI(e[0]),tI(e[1])])}return t}function eI(e){return typeof e==`string`?new RegExp(ZF(e),`g`):e}function tI(e){return typeof e==`function`?e:function(){return e}}var nI=`phrasing`,rI=[`autolink`,`link`,`image`,`label`];function iI(){return{transforms:[fI],enter:{literalAutolink:oI,literalAutolinkEmail:sI,literalAutolinkHttp:sI,literalAutolinkWww:sI},exit:{literalAutolink:dI,literalAutolinkEmail:uI,literalAutolinkHttp:cI,literalAutolinkWww:lI}}}function aI(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:nI,notInConstruct:rI},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:nI,notInConstruct:rI},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:nI,notInConstruct:rI}]}}function oI(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function sI(e){this.config.enter.autolinkProtocol.call(this,e)}function cI(e){this.config.exit.autolinkProtocol.call(this,e)}function lI(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function uI(e){this.config.exit.autolinkEmail.call(this,e)}function dI(e){this.exit(e)}function fI(e){QF(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,pI],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,mI]],{ignore:[`link`,`linkReference`]})}function pI(e,t,n,r,i){let a=``;if(!_I(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!hI(n)))return!1;let o=gI(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function mI(e,t,n,r){return!_I(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function hI(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function gI(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=d(e,`(`),a=d(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function _I(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||dj(n)||uj(n))&&(!t||n!==47)}DI.peek=EI;function vI(){this.buffer()}function yI(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function bI(){this.buffer()}function xI(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function SI(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ej(this.sliceSerialize(e)).toLowerCase(),n.label=t}function CI(e){this.exit(e)}function wI(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ej(this.sliceSerialize(e)).toLowerCase(),n.label=t}function TI(e){this.exit(e)}function EI(){return`[`}function DI(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function OI(){return{enter:{gfmFootnoteCallString:vI,gfmFootnoteCall:yI,gfmFootnoteDefinitionLabelString:bI,gfmFootnoteDefinition:xI},exit:{gfmFootnoteCallString:SI,gfmFootnoteCall:CI,gfmFootnoteDefinitionLabelString:wI,gfmFootnoteDefinition:TI}}}function kI(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:DI},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
73
- `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?jI:AI))),s(),o}}function AI(e,t,n){return t===0?e:jI(e,t,n)}function jI(e,t,n){return(n?``:` `)+e}var MI=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];LI.attention=RI,LI.peek=zI;function NI(){return{canContainEols:[`delete`],enter:{strikethrough:FI},exit:{strikethrough:II}}}function PI(){return{handlers:{delete:LI},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:MI}]}}function FI(e){this.enter({type:`delete`,children:[],position:void 0},e)}function II(e){this.exit(e)}function LI(e,t,n,r){let i=n.createTracker(r),a=n.stack.includes(`strikethrough`)?`~`:`~~`,o=n.enter(`strikethrough`),s=i.move(a);return s+=n.containerPhrasing(e,{...i.current(),before:s,after:`~`}),s+=i.move(a),o(),s}function RI(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function zI(){return`~`}function BI(e){return e.length}function VI(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||BI,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=HI(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=UI(r[d]);else{let e=UI(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
74
- `)}function HI(e){return e==null?``:String(e)}function UI(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}var WI=LP([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function GI(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),KI);return i(),o}function KI(e,t,n){return`>`+(n?``:` `)+e}function qI(e,t){return JI(e,t.inConstruct,!0)&&!JI(e,t.notInConstruct,!1)}function JI(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function YI(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){let e=n.unsafe[i];if(e.character===`
75
- `&&!e.before&&!e.after&&qI(n.stack,e))return/[\t ]/.test(r.before)?``:` `}return`\\
76
- `}function XI(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function ZI(e,t){return!(t.options.fences!==!1||!e.value||e.lang||!/[^\n\r ]/.test(e.value)||/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function QI(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function $I(e,t,n,r){let i=QI(n),a=e.value||``;if(ZI(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,eL);return e(),t}let o=n.createTracker(r),s=i.repeat(Math.max(XI(a,i)+1,3)),c=n.enter(`codeFenced`),l=i==="`"?`GraveAccent`:`Tilde`,u=o.move(s);if(e.lang){let t=n.enter(`codeFencedLang${l}`);u+=o.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...o.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${l}`);u+=o.move(` `),u+=o.move(n.safe(e.meta,{before:u,after:`
77
- `,encode:["`"],...o.current()})),t()}return u+=o.move(`
78
- `),a&&(u+=o.move(a+`
79
- `)),u+=o.move(s),c(),u}function eL(e,t,n){return(n?``:` `)+e}function tL(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function nL(e,t,n,r){let i=tL(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
80
- `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function rL(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}iL.attention=aL,iL.peek=oL;function iL(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function aL(e,t){return{construct:`emphasis`,markers:rL(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[1]}}function oL(e,t,n){return n.options.emphasis||`*`}function sL(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function cL(e,t){let n=!1;return JP(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&VA(e)&&(t.options.setext||n))}function lL(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(cL(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
81
- `,after:`
82
- `});return r(),t(),o+`
83
- `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
84
- `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
85
- `,...a.current()}),u=l.charCodeAt(0);return(u===9||u===32)&&(l=sL(u)+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}uL.peek=dL;function uL(e){return e.value||``}function dL(){return`<`}fL.peek=pL;function fL(e,t,n,r){let i=tL(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function pL(){return`!`}mL.peek=hL;function mL(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function hL(){return`!`}gL.peek=_L;function gL(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e);if(!e.atBreak)continue;let i;for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function _L(){return"`"}function vL(e,t){let n=VA(e);return!(t.options.resourceLink||!e.url||e.title||!e.children||e.children.length!==1||e.children[0].type!==`text`||n!==e.url&&`mailto:`+n!==e.url||!/^[a-z][+\-.a-z]+:/i.test(e.url)||/[\0- <>\u007F]/.test(e.url))}yL.peek=bL;function yL(e,t,n,r){let i=tL(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r);if(vL(e,n)){let t=n.stack;n.stack=t.filter(function(e){return e!==`phrasing`});let r=n.enter(`autolink`),i=o.move(`<`);return i+=o.move(n.containerPhrasing(e,{before:i,after:`>`,...o.current()})),i+=o.move(`>`),r(),n.stack=t,i}let s=n.enter(`link`),c=n.enter(`label`),l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function bL(e,t,n){return vL(e,n)?`<`:`[`}xL.peek=SL;function xL(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function SL(){return`[`}function CL(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function wL(e){let t=CL(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function TL(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function EL(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function DL(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?TL(n):CL(n),s=e.ordered?o===`.`?`)`:`.`:wL(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),EL(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function OL(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function kL(e,t,n,r){let i=OL(n),a=n.bulletCurrent||CL(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function AL(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function jL(e,t,n,r){if(!e.children.some(function(e){return WI(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function ML(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}NL.attention=PL,NL.peek=FL;function NL(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function PL(e,t){return{construct:`strong`,markers:ML(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function FL(e,t,n){return n.options.strong||`*`}function IL(e,t,n,r){return n.safe(e.value,r)}function LL(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function RL(e,t,n){let r=(EL(n)+(n.options.ruleSpaces?` `:``)).repeat(LL(n));return n.options.ruleSpaces?r.slice(0,-1):r}var zL={blockquote:GI,break:YI,code:$I,definition:nL,emphasis:iL,hardBreak:YI,heading:lL,html:uL,image:fL,imageReference:mL,inlineCode:gL,link:yL,linkReference:xL,list:DL,listItem:kL,paragraph:AL,root:jL,strong:NL,text:IL,thematicBreak:RL};function BL(){return{enter:{table:VL,tableData:GL,tableHeader:GL,tableRow:UL},exit:{codeText:KL,table:HL,tableData:WL,tableHeader:WL,tableRow:WL}}}function VL(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function HL(e){this.exit(e),this.data.inTable=void 0}function UL(e){this.enter({type:`tableRow`,children:[]},e)}function WL(e){this.exit(e)}function GL(e){this.enter({type:`tableCell`,children:[]},e)}function KL(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,qL));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function qL(e,t){return t===`|`?t:e}function JL(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
86
- `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
87
- `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return VI(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=zL.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function YL(){return{exit:{taskListCheckValueChecked:ZL,taskListCheckValueUnchecked:ZL,paragraph:QL}}}function XL(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:$L}}}function ZL(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function QL(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function $L(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=zL.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function eR(){return[iI(),OI(),NI(),BL(),YL()]}function tR(e){return{extensions:[aI(),kI(e),PI(),JL(e),XL()]}}var nR={tokenize:gR,partial:!0},rR={tokenize:_R,partial:!0},iR={tokenize:vR,partial:!0},aR={tokenize:yR,partial:!0},oR={tokenize:bR,partial:!0},sR={name:`wwwAutolink`,tokenize:mR,previous:xR},cR={name:`protocolAutolink`,tokenize:hR,previous:SR},lR={name:`emailAutolink`,tokenize:pR,previous:CR},uR={};function dR(){return{text:uR}}for(var fR=48;fR<123;)uR[fR]=lR,fR++,fR===58?fR=65:fR===91&&(fR=97);uR[43]=lR,uR[45]=lR,uR[46]=lR,uR[95]=lR,uR[72]=[lR,cR],uR[104]=[lR,cR],uR[87]=[lR,sR],uR[119]=[lR,sR];function pR(e,t,n){let r=this,i,a;return o;function o(t){return!wR(t)||!CR.call(r,r.previous)||TR(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return wR(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(oR,u,l)(t):t===45||t===95||nj(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&tj(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function mR(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!xR.call(r,r.previous)||TR(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(nR,e.attempt(rR,e.attempt(iR,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function hR(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&SR.call(r,r.previous)&&!TR(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(tj(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||ij(t)||cj(t)||dj(t)||uj(t)?n(t):e.attempt(rR,e.attempt(iR,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function gR(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function _R(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(aR,c,s)(t):t===null||cj(t)||dj(t)||t!==45&&uj(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function vR(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(aR,t,a)(o):o===null||cj(o)||dj(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function yR(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||cj(o)||dj(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||cj(e)||dj(e)?t(e):r(e)}function a(e){return tj(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):tj(t)?(e.consume(t),o):n(t)}}function bR(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return nj(e)?n(e):t(e)}}function xR(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||cj(e)}function SR(e){return!tj(e)}function CR(e){return!(e===47||wR(e))}function wR(e){return e===43||e===45||e===46||e===95||nj(e)}function TR(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var ER={tokenize:PR,partial:!0};function DR(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:jR,continuation:{tokenize:MR},exit:NR}},text:{91:{name:`gfmFootnoteCall`,tokenize:AR},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:OR,resolveTo:kR}}}}function OR(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=ej(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function kR(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function AR(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||cj(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(ej(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return cj(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function jR(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||cj(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=ej(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return cj(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),mj(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function MR(e,t,n){return e.check(Mj,t,e.attempt(ER,t,n))}function NR(e){e.exit(`gfmFootnoteDefinition`)}function PR(e,t,n){let r=this;return mj(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function FR(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&qA(o,o.length,0,Tj(s,e.slice(r+1,n),t)),qA(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),qA(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=wj(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=wj(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var IR=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){LR(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function LR(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function RR(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function zR(){return{flow:{null:{name:`table`,tokenize:BR,resolveAll:VR}}}}function BR(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):Q(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):lj(t)?mj(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||cj(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,lj(t)?mj(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return lj(t)?mj(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Q(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return lj(t)?mj(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Q(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Q(n)?(e.exit(`tableRow`),t(n)):lj(n)?mj(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||cj(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function VR(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new IR;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(UR(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=HR(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=HR(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=HR(f,t,o,i,n,d)):(o[0]=o[1],d=HR(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&UR(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=RR(t.events,n))}return e}function HR(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},WR(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=WR(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=WR(t.events,n[2]),a=WR(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},WR(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function UR(e,t,n,r,i){let a=[],o=WR(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function WR(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var GR={name:`tasklistCheck`,tokenize:qR};function KR(){return{text:{91:GR}}}function qR(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return cj(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Q(r)?t(r):lj(r)?e.check({tokenize:JR},t,n)(r):n(r)}}function JR(e,t,n){return mj(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function YR(e){return XA([dR(),DR(),FR(e),zR(),KR()])}var XR={};function ZR(e){let t=this,n=e||XR,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(YR(n)),a.push(eR()),o.push(tR(n))}var QR=new Set([`http:`,`https:`,`mailto:`,`tel:`]);function $R(e){let t=(e??``).trim();if(t===``)return``;if(/^[#/.]/.test(t))return t;try{let e=new URL(t,`https://example.invalid`);return QR.has(e.protocol)?t:``}catch{return``}}var ez=4e3,tz=/^\s*(?:```|~~~)/,nz=/^#{1,6}\s/,rz=/^\s{0,3}\[[^\]]+\]:\s*\S|\[\^[^\]]+\]/m;function iz(e){if(e.length<=ez||rz.test(e))return[e];let t=[],n=[],r=!1;for(let i of e.split(`
88
- `))tz.test(i)?r=!r:!r&&nz.test(i)&&n.some(e=>e.trim())&&(t.push(n.join(`
89
- `)),n=[]),n.push(i);return t.push(n.join(`
90
- `)),t}function az(e,t,n=!1){let r=t?.start?.offset,i=t?.end?.offset;if(r===void 0||i===void 0)return;let a=e.slice(r,i);if(!n){let e=a.match(/^`+/)?.[0];return e&&a.endsWith(e)?a.slice(e.length,-e.length):a}let o=a.match(/^ {0,3}(`{3,}|~{3,})[^\r\n]*(?:\r\n|\n|\r)/);if(!o)return a;let s=a.slice(o[0].length),c=RegExp(`^ {0,3}${o[1][0]}{${o[1].length},}[ \\t]*$`,`m`).exec(s);return c?s.slice(0,c.index):s}function oz(e,t){return!e&&!t}async function sz(e,t){if(!t)throw Error(`Clipboard is unavailable. Select the code and copy it manually.`);await t.writeText(e)}var cz=/^-\s+(.+?)\s+\(([^()\s]+\/[^()\s]+)\)\s*$/;function lz(e){let t=e.lastIndexOf(`${dO}\n`);if(t<0||t>0&&e[t-1]!==`
91
- `)return{body:e,files:[]};let n=e.slice(t+dO.length+1).split(`
92
- `).filter(Boolean),r=[];for(let t of n){let n=cz.exec(t);if(!n)return{body:e,files:[]};let i=n[1].split(/[\\/]/).pop()??``;if(!/^[\w.-]+$/.test(i))return{body:e,files:[]};r.push({id:i,name:i.replace(/^[a-z0-9]+-/,``),mime:n[2]})}return r.length>0?{body:e.slice(0,t).trimEnd(),files:r}:{body:e,files:[]}}var uz=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]);function dz({files:e}){return e.length===0?null:(0,W.jsx)(`ul`,{className:`mt-2 flex min-w-0 max-w-full flex-wrap gap-2`,"aria-label":`Attached files`,children:e.map(e=>(0,W.jsx)(`li`,{children:uz.has(e.mime)?(0,W.jsx)(`a`,{href:L(`/files/preview/attachments/${e.id}`),target:`_blank`,rel:`noopener noreferrer`,className:`block max-w-full overflow-hidden rounded-lg border border-border bg-muted/40 transition-transform duration-150 ease-snap hover:scale-[1.02] focus-visible:outline-2 focus-visible:outline-ring`,children:(0,W.jsx)(`img`,{src:L(`/files/preview/attachments/${e.id}`),alt:e.name,loading:`lazy`,className:`max-h-40 max-w-[min(14rem,100%)] object-cover`})}):(0,W.jsxs)(`span`,{className:`inline-flex max-w-[min(16rem,100%)] min-w-0 items-center gap-2 rounded-lg border border-border bg-muted/40 px-3 py-2 text-xs text-muted-foreground`,children:[e.mime===`application/pdf`?(0,W.jsx)(Ym,{"aria-hidden":`true`,className:`size-4 shrink-0`}):(0,W.jsx)(Zh,{"aria-hidden":`true`,className:`size-4 shrink-0`}),(0,W.jsx)(`span`,{className:`truncate`,children:e.name})]})},e.id))})}var fz=!1,pz=[],mz=0,hz=900;function gz(){fz=!0,window.clearTimeout(mz),mz=window.setTimeout(_z,hz)}function _z(){fz=!1,window.clearTimeout(mz);let e=pz;pz=[];for(let t of e)t()}function vz(e){if(!fz)return e(),()=>{};let t=()=>e();return pz.push(t),()=>{pz=pz.filter(e=>e!==t)}}var yz=8;function bz(e,t=24){let[n,r]=(0,m.useState)(t),i=(0,m.useRef)(8),a=n<e;return(0,m.useEffect)(()=>{if(!a)return;let e=0,t=vz(()=>{e=requestAnimationFrame(()=>{let e=performance.now();(0,gy.flushSync)(()=>r(e=>e+i.current));let t=Math.max(1,performance.now()-e);i.current=Math.max(2,Math.min(400,Math.round(i.current*yz/t)))})});return()=>{t(),cancelAnimationFrame(e)}},[a,n]),Math.min(n,e)}var xz=`bot-lobby.code.wrap`,Sz=`bot-lobby.code.layout`,Cz=new Set,wz={open:!1,request:0};function Tz(){for(let e of[...Cz])e()}function Ez(e){return Cz.add(e),()=>{Cz.delete(e)}}function Dz(e,t){wz={open:!0,...e?{path:e}:wz.path?{path:wz.path}:{},...t?{mode:t}:{},request:wz.request+1},Tz()}function Oz(){wz.open&&(wz={...wz,open:!1},Tz())}function kz(){wz.open?Oz():Dz()}function Az(){return(0,m.useSyncExternalStore)(Ez,()=>wz)}function jz(e){try{return localStorage.getItem(e)}catch{return null}}function Mz(e,t){try{localStorage.setItem(e,t)}catch{}}var Nz=jz(xz)===`1`,Pz=jz(Sz)===`split`?`split`:`unified`;function Fz(e){Nz=e,Mz(xz,e?`1`:`0`),Tz()}function Iz(e){Pz=e,Mz(Sz,e),Tz()}function Lz(){return(0,m.useSyncExternalStore)(Ez,()=>Nz)}function Rz(){return(0,m.useSyncExternalStore)(Ez,()=>Pz)}var zz=new Set(`ts tsx mts cts js jsx mjs cjs json jsonc json5 jsonl md mdx css scss sass less html htm vue svelte astro py rb go rs java kt kts swift c h cc cpp hpp cs php lua sh bash zsh fish ps1 sql graphql gql yml yaml toml ini cfg conf env xml svg txt lock prisma proto dockerfile mk gradle`.split(` `));function Bz(e){let t=e.trim();if(!t||t.length>300||/\s/.test(t)||/^[a-z][\w+.-]*:\/\//i.test(t))return;let n=t.replace(/:\d+(?::\d+)?$/,``).replace(/^\.\//,``);if(!/^[\w@~./-]+$/.test(n)||n.endsWith(`/`)||n.includes(`..`))return;let r=n.split(`/`).at(-1)??``,i=/^[\w@.-]*[A-Za-z_][\w@-]*\.[A-Za-z][\w]{0,9}$/.test(r)||/^\.[A-Za-z][\w.-]*$/.test(r),a=/^(Dockerfile|Makefile|LICENSE|Procfile|Gemfile|Rakefile)$/.test(r)&&n.includes(`/`);if((i||a)&&!/^v?\d+(\.\d+)+$/.test(r)&&(n.includes(`/`)||r.startsWith(`.`)||zz.has(r.slice(r.lastIndexOf(`.`)+1).toLowerCase())))return n}function Vz({path:e,children:t,className:n}){return(0,W.jsx)(`button`,{type:`button`,"data-file-link":e,title:`Open ${e} in the code viewer`,onClick:t=>{t.stopPropagation(),Dz(e)},className:X(`file-link`,n),children:t})}function Hz(e){return e.split(/(\s+)/).map((e,t)=>{let n=e.replace(/^[("'`[]+|[)"'`\],.;:!?]+$/g,``),r=n?Bz(n):void 0;if(!r)return e;let i=e.indexOf(n);return(0,W.jsxs)(`span`,{children:[e.slice(0,i),(0,W.jsx)(Vz,{path:r,children:n}),e.slice(i+n.length)]},t)})}function Uz(e){return e?.type===`text`?e.value??``:(e?.children??[]).map(Uz).join(``)}function Wz(e,t=!1){let n=t||e.tagName===`a`;e.tagName===`code`&&(e.properties={...e.properties,copyBlocked:n,blockCode:t===!1&&e.properties?.blockCode});for(let t of e.children??[])e.tagName===`pre`&&(t.properties={...t.properties,blockCode:!0}),Wz(t,n)}function Gz(){return e=>Wz(e)}var Kz=/(?<![\w/@.:-])((?:\.{1,2}\/)?(?:[\w@.-]+\/)+[\w@.-]*[A-Za-z_][\w@-]*\.[A-Za-z]\w{0,9})(:\d+)?(?![\w/])/g;function qz(e){if(e.tagName===`code`||e.tagName===`pre`||e.tagName===`a`)return;let t=e.children;if(!t)return;let n=[];for(let e of t){if(e.type!==`text`||!e.value||!e.value.includes(`/`)){qz(e),n.push(e);continue}let t=0;for(let r of e.value.matchAll(Kz)){let i=Bz(r[1]);i&&(r.index>t&&n.push({type:`text`,value:e.value.slice(t,r.index)}),n.push({type:`element`,tagName:`span`,properties:{dataFilePath:i},children:[{type:`text`,value:r[0]}]}),t=r.index+r[0].length)}t===0?n.push(e):t<e.value.length&&n.push({type:`text`,value:e.value.slice(t)})}e.children=n}function Jz(){return e=>qz(e)}function Yz(e){let[t,n]=(0,m.useState)(!1);async function r(){try{await sz(e,navigator.clipboard),n(!0),G.success(`Code copied.`)}catch{G.error(`Could not copy code. Select it and copy manually, or allow clipboard access.`)}}return{copied:t,copy:r}}function Xz({text:e,children:t,block:n=!1}){let{copy:r}=Yz(e),i=(0,m.useRef)(void 0);return(0,W.jsxs)(`code`,{role:`button`,tabIndex:0,"aria-label":`Copy code`,"aria-keyshortcuts":`Enter Space`,title:`Copy code · Enter / Space`,className:`cursor-copy focus-visible:outline-2 focus-visible:outline-ring`,onPointerDown:e=>{i.current={x:e.clientX,y:e.clientY,moved:!1}},onPointerMove:e=>{let t=i.current;t&&Math.hypot(e.clientX-t.x,e.clientY-t.y)>4&&(t.moved=!0)},onClick:e=>{e.stopPropagation(),oz(window.getSelection()?.toString()??``,i.current?.moved??!1)&&r(),i.current=void 0},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),oz(window.getSelection()?.toString()??``,!1)&&r())},children:[t,n?null:(0,W.jsx)(`span`,{className:`sr-only`,children:` (activate to copy)`})]})}function Zz({node:e,children:t,source:n}){let r=e,{copied:i,copy:a}=Yz(az(n,r?.position,!0)??Uz(r)),o=r?.children?.find(e=>e.tagName===`code`)?.properties?.className,s=(Array.isArray(o)?o:[]).map(String).find(e=>e.startsWith(`language-`))?.slice(9);return(0,W.jsxs)(`div`,{className:`relative my-3 rounded-lg bg-muted`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between pl-3`,children:[(0,W.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[s&&/^[\w+#.-]{1,20}$/.test(s)?s:`code`,` · tap to copy`]}),(0,W.jsx)(lk,{label:i?`Copied`:`Copy the code`,icon:i?Zp:Nm,iconOnly:!0,onClick:()=>void a()})]}),(0,W.jsx)(`pre`,{className:`!my-0 overflow-x-auto !rounded-t-none !bg-transparent px-3 pb-3 text-sm leading-relaxed [&>code]:block`,children:t})]})}function Qz(e){return{pre:t=>(0,W.jsx)(Zz,{...t,source:e}),code:({node:t,children:n})=>{let r=t;if(r?.properties?.copyBlocked)return(0,W.jsx)(`code`,{children:n});let i=!!r?.properties?.blockCode,a=i?void 0:Bz(Uz(r));return a?(0,W.jsx)(Vz,{path:a,children:(0,W.jsx)(`code`,{children:n})}):(0,W.jsx)(Xz,{text:az(e,r?.position,i)??Uz(r),block:i,children:n})},span:({node:e,children:t,...n})=>{let r=e?.properties?.dataFilePath;return typeof r==`string`?(0,W.jsx)(Vz,{path:r,children:t}):(0,W.jsx)(`span`,{...n,children:t})},a:({href:e,children:t})=>(0,W.jsx)(`a`,{href:e?L(e):void 0,target:`_blank`,rel:`noopener noreferrer nofollow`,children:t}),img:({src:e,alt:t})=>(0,W.jsx)(`img`,{src:e?L(e):void 0,alt:t??``,loading:`lazy`}),table:({children:e})=>(0,W.jsx)(`div`,{className:`my-3 w-full overflow-x-auto`,children:(0,W.jsx)(`table`,{className:`w-full border-collapse text-sm`,children:e})})}}var $z=(0,m.memo)(function({text:e}){return(0,W.jsx)(KF,{remarkPlugins:[ZR],rehypePlugins:[Gz,Jz],urlTransform:$R,components:Qz(e),children:e})}),eB=(0,m.memo)(function({text:e,className:t}){let{body:n,files:r}=lz(e),i=n?iz(n):[],a=bz(i.length,3);return(0,W.jsxs)(`div`,{className:X(`md-body`,t),children:[i.slice(0,a).map((e,t)=>(0,W.jsx)($z,{text:e},t)),(0,W.jsx)(dz,{files:r})]})});function tB({title:e,note:t,className:n,children:r,collapsed:i,onToggle:a,shortcut:o,...s}){let c=typeof e==`string`?e:`pane`;return(0,W.jsxs)(`section`,{className:X(`workspace-frame group/frame relative flex min-h-0 min-w-0 flex-col rounded-xl border shadow-xs`,i&&`flex-none`,n),...s,children:[e||t||a?(0,W.jsxs)(`div`,{className:X(`flex min-h-12 shrink-0 items-center justify-between gap-3 px-4`,!i&&`border-b border-border`),children:[e?(0,W.jsx)(`h2`,{className:`min-w-0 truncate text-sm font-medium`,children:e}):(0,W.jsx)(`span`,{}),(0,W.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2`,children:[t?(0,W.jsx)(`span`,{className:`flex items-center gap-2 truncate text-xs text-muted-foreground`,children:t}):null,a?(0,W.jsxs)(`button`,{type:`button`,"aria-expanded":!i,"aria-label":i?`Expand ${c}`:`Minimize ${c}`,title:`${i?`Expand`:`Minimize`}${o?` · ${o}`:``}`,"aria-keyshortcuts":o?`${o} Enter Space`:`Enter Space`,"aria-describedby":`focused-action-help`,onClick:a,className:`btn-ghost -mr-1.5 inline-flex h-8 items-center gap-1.5 rounded-lg border border-transparent px-2 text-muted-foreground transition-[box-shadow,color,scale] duration-150 ease-snap outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring active:scale-[0.97] motion-reduce:active:scale-100`,children:[o?(0,W.jsx)(XD,{chord:o,className:`kbd-hint`}):null,(0,W.jsx)($p,{"aria-hidden":`true`,className:X(`size-4 transition-transform duration-200 ease-snap`,i&&`-rotate-90`)})]}):null]})]}):null,i?null:r]})}function nB({title:e,right:t,className:n}){return(0,W.jsxs)(`span`,{className:X(`flex min-w-0 items-center gap-3`,n),children:[(0,W.jsx)(`span`,{className:`truncate font-medium`,children:e}),(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`min-w-4 flex-1`}),t?(0,W.jsx)(`span`,{className:`shrink-0 text-xs font-normal text-muted-foreground`,children:t}):null]})}function rB({title:e,right:t,prominent:n,children:r}){return(0,W.jsxs)(`section`,{className:X(`flex min-w-0 flex-col`,n?`gap-4`:`workspace-section gap-3 rounded-xl border p-4 shadow-xs`),children:[(0,W.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:(0,W.jsx)(nB,{title:e,right:t,className:n?`[&>span:first-child]:font-semibold`:void 0})}),r]})}var iB=`Pull requests`,aB=`An agent reviews it, optionally with a focus you type; Jev's quick read sizes it up first.`,oB=`nothing is posted to GitHub`,sB=`Refresh to load open pull requests with the GitHub CLI (gh).`,cB=`No open pull requests.`,lB=`loading pull requests from GitHub…`,uB=`reading the diff…`,dB=`the pull request has new commits since this review — review it again`,fB=`(no description)`,pB=`Review with a focus (optional)`,mB=`Leave it empty for a full review.`;function hB(e){return e===`passing`?`✓`:e===`failing`?`✗`:e===`pending`?`…`:``}function gB(e){return e===`passing`?`text-success`:e===`failing`?`text-destructive`:`text-muted-foreground`}function _B(e,t){return`+${e} −${t}`}function vB(e){return e===`APPROVED`?`approved`:e===`CHANGES_REQUESTED`?`changes requested`:e===`REVIEW_REQUIRED`?`review required`:``}function yB(e){return e?e.status===`running`?`reviewing`:e.status!==`done`||!e.verdict?``:e.verdict===`approve`?`approved`:e.verdict===`changes`?`changes found`:`commented`:``}function bB(e){return e===`approve`?`approve`:e===`changes`?`request changes`:e===`comment`?`comment`:``}function xB(e,t){if(e.status===`running`)return SB(e,t);if(e.status===`cancelled`)return`stopped`;let n=e.status===`done`?SB(e,t):e.status;return[bB(e.verdict),n].filter(Boolean).join(` · `)}function SB(e,t){let n=Math.max(0,Math.round(((e.finishedAt??t)-e.startedAt)/1e3));return n<60?`${n}s`:`${Math.floor(n/60)}m ${String(n%60).padStart(2,`0`)}s`}function CB(e,t){return[e.state?e.draft?`draft`:e.state.toLowerCase():e.draft?`draft`:``,e.author?`by ${e.author}`:``,e.updatedAt?`updated ${Pk(t-Date.parse(e.updatedAt))}`:``].filter(Boolean).join(` · `)}function wB(e){let t=`${e.changedFiles} file${e.changedFiles===1?``:`s`}`;return`${e.headRef||`?`} → ${e.baseRef||`?`} · ${_B(e.additions,e.deletions)} · ${t}`}function TB(e){let t=e.mergeable===`CONFLICTING`?`conflicts`:e.mergeable===`MERGEABLE`?`mergeable`:``;return[e.checks?`checks ${e.checks} (${e.checkCount})`:``,vB(e.decision),t,e.labels.join(`, `)].filter(Boolean).join(` · `)}function EB(e){return[`${e.changedFiles} file${e.changedFiles===1?``:`s`}`,e.labels.join(`, `),e.review?.stale?`stale`:``].filter(Boolean).join(` · `)}function DB(e){return e.read?`${e.read.model} · ${e.read.ms} ms`:``}function OB(e){let[t,n]=(0,m.useState)(()=>Date.now());return(0,m.useEffect)(()=>{if(!e)return;let t=window.setInterval(()=>n(Date.now()),1e3);return()=>window.clearInterval(t)},[e]),e?t:Date.now()}function kB({pull:e,now:t}){return(0,W.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,W.jsxs)(`h2`,{className:`text-lg font-semibold tracking-tight break-words`,children:[(0,W.jsxs)(`span`,{className:`font-normal text-muted-foreground tabular-nums`,children:[`#`,e.number]}),` `,e.title]}),(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:CB(e,t)}),(0,W.jsx)(`p`,{className:`text-sm tabular-nums`,children:wB(e)}),TB(e)?(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:TB(e)}):null,e.url?(0,W.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer nofollow`,className:`inline-flex max-w-full break-all text-xs text-primary underline underline-offset-4`,children:e.url}):null]})}function AB({read:e}){return(0,W.jsxs)(rB,{title:`Jev's read`,right:DB(e),children:[e.status===`running`?(0,W.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,W.jsx)(DO,{className:`size-3.5`}),uB]}):null,e.status===`failed`?(0,W.jsx)(`p`,{className:`text-sm text-foreground`,children:e.error??`Jev could not read it`}):null,e.status===`done`&&e.line?(0,W.jsx)(eB,{text:e.line}):null]})}function jB({review:e,now:t}){return(0,W.jsxs)(W.Fragment,{children:[e.model?(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:[e.model,e.thinking].filter(Boolean).join(` · `)}):null,e.focus?(0,W.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`focus: `,e.focus]}):null,e.saved?(0,W.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`kept from `,Pk(t-e.startedAt)]}):null,e.stale?(0,W.jsx)(`p`,{className:`text-sm text-foreground`,children:dB}):null,e.status===`running`?(0,W.jsx)(MB,{steps:e.steps}):null,e.status===`cancelled`?(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`stopped`}):null,e.status===`failed`||e.status===`timeout`?(0,W.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`✗ `,e.error??e.status]}):null,e.text?(0,W.jsx)(eB,{text:e.text}):null]})}function MB({steps:e}){return(0,W.jsx)(`ul`,{className:`flex flex-col gap-1 text-sm text-muted-foreground`,children:e.slice(-6).map((e,t)=>(0,W.jsxs)(`li`,{className:`break-words`,children:[`· `,e]},t))})}function NB({number:e,focus:t,onChange:n}){return(0,W.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,W.jsx)(`label`,{htmlFor:`focus-${e}`,className:`text-[0.8125rem] font-medium text-foreground`,children:pB}),(0,W.jsx)(Ak,{id:`focus-${e}`,value:t,rows:2,maxLength:2e3,onChange:e=>n(e.target.value)}),(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:mB})]})}function PB({number:e,review:t,now:n,focus:r,onFocus:i}){return(0,W.jsxs)(rB,{title:`Review`,right:t?xB(t,n):void 0,children:[t?(0,W.jsx)(jB,{review:t,now:n}):null,(0,W.jsx)(NB,{number:e,focus:r,onChange:i}),(0,W.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`A read-only agent reviews it — `,oB,`.`]})]})}function FB({files:e}){return(0,W.jsx)(rB,{title:`Files`,right:String(e.length),children:(0,W.jsx)(`div`,{className:`overflow-x-auto rounded-lg border border-border`,children:(0,W.jsx)(`table`,{className:`w-full border-collapse text-sm tabular-nums`,children:(0,W.jsx)(`tbody`,{children:e.map(e=>(0,W.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,W.jsx)(`td`,{className:`max-w-0 px-3 py-1.5 break-all`,children:e.path}),(0,W.jsx)(`td`,{className:`px-3 py-1.5 text-right text-xs whitespace-nowrap text-muted-foreground`,children:_B(e.additions,e.deletions)})]},e.path))})})})})}function IB({note:e,now:t}){let n=[e.state&&e.state!==`COMMENTED`?e.state.toLowerCase().replace(/_/g,` `):``,e.at?Pk(t-Date.parse(e.at)):``].filter(Boolean).join(` · `);return(0,W.jsxs)(`article`,{className:`card-flat flex flex-col gap-1.5 rounded-lg border px-3.5 py-2.5`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,W.jsx)(`span`,{className:`font-medium text-foreground`,children:e.author??`comment`}),n?(0,W.jsx)(`span`,{children:n}):null]}),e.body.trim()?(0,W.jsx)(eB,{text:e.body.trim()}):null]})}function LB({notes:e,now:t}){return e.length===0?null:(0,W.jsx)(rB,{title:`Discussion`,right:String(e.length),children:(0,W.jsx)(`div`,{className:`flex flex-col gap-3`,children:e.map((e,n)=>(0,W.jsx)(IB,{note:e,now:t},n))})})}function RB({number:e,error:t}){return t?(0,W.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not load #`,e,`. `,t]}):(0,W.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,W.jsx)(DO,{className:`size-3.5`}),`loading #`,e,`…`]})}function zB({number:e,onChanged:t}){let n=zO(`git.pull`,{number:e},[`git`]),[r,i]=(0,m.useState)(``),a=n.data?.review?.status===`running`,o=OB(a);if(!n.data)return(0,W.jsx)(RB,{number:e,error:n.error});let{pull:s,review:c,read:l}=n.data,u=()=>{n.reload(),t?.()},d=async()=>{let t=r.trim();i(``),await K(`git.review`,{number:e,...t?{focus:t}:{}}),u()},f=async()=>{await K(`git.jev`,{number:e}),u()},p=async()=>{await K(`git.cancelReview`,{number:e}),u()};return(0,W.jsxs)(`article`,{className:`flex flex-col gap-4`,"aria-label":`Pull request #${e}`,children:[(0,W.jsxs)(uk,{children:[(0,W.jsx)(lk,{label:`Review`,icon:sg,tone:`primary`,shortcut:`V`,disabled:a,onClick:()=>void d()}),(0,W.jsx)(lk,{label:`Jev's read`,icon:Gp,shortcut:`Q`,disabled:a,onClick:()=>void f()}),a?(0,W.jsx)(Gk,{icon:ym,label:`Stop the review`,text:`Stop`,shortcut:`X`,title:`Stop this review?`,description:`The agent stops reading the pull request. Nothing is posted to GitHub.`,confirmLabel:`Stop review`,variant:`destructive`,onConfirm:()=>void p()}):null]}),(0,W.jsx)(kB,{pull:s,now:o}),(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:aB}),l?(0,W.jsx)(AB,{read:l}):null,(0,W.jsx)(PB,{number:e,review:c,now:o,focus:r,onFocus:i}),s.files.length>0?(0,W.jsx)(FB,{files:s.files}):null,(0,W.jsx)(rB,{title:`Description`,children:s.body.trim()?(0,W.jsx)(eB,{text:s.body.trim()}):(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:fB})}),(0,W.jsx)(LB,{notes:s.notes,now:o})]})}var BB=Jv([`relative inline-flex w-fit shrink-0 items-center justify-center border border-transparent font-medium whitespace-nowrap outline-none transition-shadow`,`focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-64`,`[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-3 [&_svg:not([class*=opacity-])]:opacity-80`],{variants:{variant:{default:`bg-primary text-primary-foreground`,secondary:`bg-accent text-secondary-foreground`,outline:`border-input bg-background text-foreground dark:bg-input/32`,info:`bg-info/8 text-info dark:bg-info/16`,success:`bg-success/8 text-success dark:bg-success/16`,warning:`bg-warning/8 text-warning dark:bg-warning/16`,destructive:`bg-destructive/8 text-destructive dark:bg-destructive/16`},size:{sm:`h-4 min-w-4 gap-1 px-1 text-3xs leading-none`,default:`h-[1.125rem] min-w-[1.125rem] gap-1 px-1 text-xs`,lg:`h-5 min-w-5 gap-1 px-1.5 text-xs`},radius:{default:`rounded-sm`,full:`rounded-full`}},defaultVariants:{variant:`default`,size:`default`,radius:`default`}});function VB({className:e,variant:t,size:n,radius:r,asChild:i=!1,...a}){let o=i?ry:`span`;return(0,W.jsx)(o,{"data-slot":`badge`,className:X(BB({variant:t,size:n,radius:r,className:e})),...a})}var HB=`flex min-h-10 w-full flex-col gap-1 rounded-lg border border-transparent px-3 py-2.5 text-left outline-none transition-colors duration-150 hover:bg-accent/60 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring aria-[current=true]:bg-accent`,UB=`flex flex-col gap-1 px-2 pb-3`,WB=`px-4 pt-4 pb-1 text-xs font-medium text-muted-foreground`;function GB({checks:e}){let t=hB(e);return t?(0,W.jsx)(`span`,{className:X(`w-4 shrink-0 text-center`,gB(e)),"aria-hidden":`true`,children:t}):(0,W.jsx)(`span`,{className:`w-4 shrink-0`,"aria-hidden":`true`})}function KB({pull:e,selected:t,onSelect:n}){let r=yB(e.review);return(0,W.jsx)(`li`,{children:(0,W.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,onClick:()=>n(e.number),className:HB,children:[(0,W.jsxs)(`span`,{className:`flex items-start gap-2 text-sm`,children:[(0,W.jsxs)(`span`,{className:`shrink-0 text-muted-foreground tabular-nums`,children:[`#`,e.number]}),(0,W.jsx)(GB,{checks:e.checks}),e.draft?(0,W.jsx)(VB,{variant:`secondary`,children:`draft`}):null,(0,W.jsx)(`span`,{className:X(`min-w-0 flex-1 break-words text-foreground`,t&&`font-medium`),children:e.title})]}),(0,W.jsxs)(`span`,{className:`flex flex-wrap items-baseline justify-between gap-x-3 text-xs text-muted-foreground`,children:[(0,W.jsx)(`span`,{children:EB(e)}),(0,W.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[r?(0,W.jsx)(`span`,{children:r}):null,(0,W.jsx)(`span`,{className:`tabular-nums`,children:_B(e.additions,e.deletions)})]})]})]})})}function qB({pulls:e,selectedId:t,onSelect:n}){return(0,W.jsx)(`ul`,{className:UB,children:e.map(e=>(0,W.jsx)(KB,{pull:e,selected:e.number===t,onSelect:n},e.number))})}function JB(e){return e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing}function YB({label:e,hint:t,buttonLabel:n=`Send`,onSend:r}){let i=(0,m.useId)(),[a,o]=(0,m.useState)(``),[s,c]=(0,m.useState)(!1),l=async()=>{a.trim()&&!s&&(c(!0),await r(a)&&o(``),c(!1))};return(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsx)(`label`,{htmlFor:i,className:`text-sm font-medium text-foreground`,children:e}),(0,W.jsx)(Ak,{id:i,value:a,rows:2,"aria-describedby":t?`${i}-hint`:void 0,onChange:e=>o(e.target.value),onKeyDown:e=>{JB(e)&&(e.preventDefault(),l())}}),t?(0,W.jsx)(`p`,{id:`${i}-hint`,className:`text-xs text-muted-foreground`,children:t}):null,(0,W.jsx)(`div`,{className:`flex self-end`,children:(0,W.jsx)(lk,{label:n,icon:s?Ch:Lp,tone:`primary`,shortcut:`Enter`,className:s?`[&_svg]:animate-spin`:void 0,onClick:()=>void l(),disabled:!a.trim()||s})})]})}var XB=`Issues`,ZB=`Issue`,QB=`Plan it opens a planning session on this issue; save the plan as a task once the panel agrees it.`,$B=`Refresh to load open issues with the GitHub CLI (gh).`,eV=`No open issues. File one with New issue.`,tV=`loading issues from GitHub…`,nV=`issues are off (lobby.issues)`,rV=`(no description)`;function iV(e,t){return[e.state?e.state.toLowerCase():``,e.author?`by ${e.author}`:``,e.updatedAt?`updated ${Pk(t-Date.parse(e.updatedAt))}`:``,e.labels.join(`, `)].filter(Boolean).join(` · `)}function aV(e,t){return[e.author?`by ${e.author}`:``,e.updatedAt?Pk(t-Date.parse(e.updatedAt)):``].filter(Boolean).join(` · `)}function oV(e){return e.length>0?`[${e.slice(0,2).join(`, `)}]`:``}function sV({issue:e,now:t}){return(0,W.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,W.jsxs)(`h2`,{className:`text-lg font-semibold tracking-tight break-words`,children:[(0,W.jsxs)(`span`,{className:`font-normal text-muted-foreground tabular-nums`,children:[`#`,e.number]}),` `,e.title]}),(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:iV(e,t)}),e.url?(0,W.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer nofollow`,className:`inline-flex max-w-full break-all text-xs text-primary underline underline-offset-4`,children:e.url}):null]})}function cV({comment:e,now:t}){return(0,W.jsxs)(`article`,{className:`card-flat flex flex-col gap-1.5 rounded-lg border px-3.5 py-2.5`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,W.jsx)(`span`,{className:`font-medium text-foreground`,children:e.author??`comment`}),e.createdAt?(0,W.jsx)(`span`,{children:Pk(t-Date.parse(e.createdAt))}):null]}),(0,W.jsx)(eB,{text:e.body.trim()})]})}function lV({comments:e,now:t}){return e.length===0?null:(0,W.jsx)(rB,{title:`Comments`,right:String(e.length),children:(0,W.jsx)(`div`,{className:`flex flex-col gap-3`,children:e.map((e,n)=>(0,W.jsx)(cV,{comment:e,now:t},n))})})}function uV({issue:e}){let t=async()=>{await K(`planner.new`,{seed:{issue:{number:e.number,title:e.title,...e.url?{url:e.url}:{}},body:e.body}})&&yO(vO(`plan`))};return(0,W.jsx)(Gk,{icon:s_,label:`Plan #${e.number} with the panel`,text:`Plan it`,shortcut:`N`,title:`Plan #${e.number} with the panel?`,description:`A new planning session starts from this issue. A plan already under way waits under Plan → Previous.`,confirmLabel:`Plan it`,onConfirm:()=>void t()})}function dV({number:e}){let t=zO(`issues.get`,{number:e},[`issues`]),n=Date.now();if(!t.data)return t.error?(0,W.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not load #`,e,`. `,t.error]}):(0,W.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,W.jsx)(DO,{className:`size-3.5`}),`loading #`,e,`…`]});let r=t.data.issue;return(0,W.jsxs)(`article`,{className:`flex flex-col gap-4`,"aria-label":`${ZB} #${e}`,children:[(0,W.jsx)(uk,{children:(0,W.jsx)(uV,{issue:r})}),(0,W.jsx)(sV,{issue:r,now:n}),(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:QB}),(0,W.jsx)(rB,{title:`Description`,children:r.body.trim()?(0,W.jsx)(eB,{text:r.body.trim()}):(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:rV})}),(0,W.jsx)(lV,{comments:r.comments,now:n})]})}function fV({issue:e,selected:t,now:n,onSelect:r}){let i=oV(e.labels);return(0,W.jsx)(`li`,{children:(0,W.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,onClick:()=>r(e.number),className:HB,children:[(0,W.jsxs)(`span`,{className:`flex flex-wrap items-start gap-2 text-sm`,children:[(0,W.jsxs)(`span`,{className:`shrink-0 text-muted-foreground tabular-nums`,children:[`#`,e.number]}),(0,W.jsx)(`span`,{className:X(`min-w-0 flex-1 break-words text-foreground`,t&&`font-medium`),children:e.title}),i?(0,W.jsx)(`span`,{className:`max-w-full break-words text-xs text-muted-foreground`,children:i}):null]}),(0,W.jsx)(`span`,{className:`pl-9 text-xs text-muted-foreground`,children:aV(e,n)})]})})}function pV({issues:e,selectedId:t,now:n,onSelect:r}){return(0,W.jsx)(`ul`,{className:UB,children:e.map(e=>(0,W.jsx)(fV,{issue:e,selected:e.number===t,now:n,onSelect:r},e.number))})}var mV=()=>yO(vO(`git`,`issues`)),hV=e=>yO(vO(`git`,`issues`,String(e)));function gV(e){let t=Number(e[0]);return Number.isInteger(t)&&t>0?t:void 0}function _V(){return(0,W.jsx)(xO,{className:`m-4 flex-1`,children:(0,W.jsxs)(SO,{children:[(0,W.jsx)(wO,{variant:`icon`,children:(0,W.jsx)(pm,{"aria-hidden":`true`})}),(0,W.jsx)(TO,{children:`Issues are off`}),(0,W.jsx)(EO,{className:`font-mono`,children:nV})]})})}function vV({loading:e,loaded:t,error:n,onRetry:r}){let i=n?`✗ ${n}`:t?eV:e?tV:$B;return(0,W.jsxs)(xO,{className:`m-4 flex-1`,children:[(0,W.jsxs)(SO,{children:[(0,W.jsx)(wO,{variant:`icon`,children:(0,W.jsx)(pm,{"aria-hidden":`true`})}),(0,W.jsx)(EO,{className:n?`text-destructive`:void 0,children:i})]}),n?(0,W.jsx)(Z,{variant:`outline`,onClick:r,children:`Retry`}):null]})}function yV({onCreate:e}){return(0,W.jsx)(wk,{className:`shrink-0 border-t border-border p-4`,children:(0,W.jsx)(YB,{label:`New issue`,hint:`The first line becomes the title; the rest is the body. Enter files it.`,buttonLabel:`File issue`,onSend:e})})}function bV(){let e=LO(`status`).data?.issuesEnabled??!0;return{enabled:e,read:zO(`issues.list`,{},[`issues`],e)}}function xV({enabled:e,read:t}){return!e||t.error?.includes(`issues are off`)?(0,W.jsx)(_V,{}):!t.data&&t.error?(0,W.jsx)(NO,{message:`Could not load issues. ${t.error}`,onRetry:t.reload}):null}function SV({issues:e,rest:t,top:n}){let r=Ck(),{read:i}=e,a=gV(t),o=i.data?.issues??[],s=async e=>await K(`issues.create`,{text:e})?(i.reload(),!0):!1,c=xV(e);if(c)return(0,W.jsxs)(W.Fragment,{children:[n,c]});if(i.data&&o.length===0)return(0,W.jsxs)(W.Fragment,{children:[n,(0,W.jsx)(vV,{loading:i.data.loading,loaded:i.data.loaded,error:i.data.error,onRetry:i.reload}),(0,W.jsx)(`div`,{className:`shrink-0 pb-dock`,children:(0,W.jsx)(yV,{onCreate:s})})]});let l=(0,W.jsxs)(W.Fragment,{children:[n,i.data?.error?(0,W.jsxs)(`p`,{className:`px-3 pt-2 text-sm text-destructive`,children:[`✗ `,i.data.error]}):null,i.data?(0,W.jsx)(pV,{issues:o,selectedId:a,now:Date.now(),onSelect:hV}):(0,W.jsx)(kk,{}),(0,W.jsx)(yV,{onCreate:s})]});return(0,W.jsx)(Dk,{wide:r,list:l,detail:a===void 0?null:(0,W.jsx)(dV,{number:a},a),open:a!==void 0,onClose:mV,hint:`Select an issue to read it.`,describe:`Issue detail`})}var CV=()=>yO(vO(`git`)),wV=e=>yO(vO(`git`,String(e)));function TV(e){let t=Number(e[0]);return Number.isInteger(t)&&t>0?t:void 0}function EV({loading:e,loaded:t,error:n,onRetry:r}){let i=n?`✗ ${n}`:t?cB:e?lB:sB;return(0,W.jsxs)(xO,{className:`m-4 flex-1`,children:[(0,W.jsxs)(SO,{children:[(0,W.jsx)(wO,{variant:`icon`,children:(0,W.jsx)(ah,{"aria-hidden":`true`})}),(0,W.jsx)(EO,{className:n?`text-destructive`:void 0,children:i})]}),n?(0,W.jsx)(Z,{variant:`outline`,onClick:r,children:`Retry`}):null]})}var DV=[{id:`pulls`,label:iB,hash:vO(`git`)},{id:`issues`,label:XB,hash:vO(`git`,`issues`)}];function OV({view:e}){return(0,W.jsx)(fk,{label:`Show`,items:DV,value:e,idPrefix:`git-view`,onChange:e=>yO(DV.find(t=>t.id===e).hash)})}function kV(e,t){return(0,m.useCallback)(()=>{K(`git.pulls`,{refresh:!0}).then(()=>e.reload()),t.enabled&&K(`issues.list`,{refresh:!0}).then(()=>t.read.reload())},[e,t])}function AV({view:e,count:t,busy:n,refresh:r}){return(0,W.jsx)(Ok,{title:e===`issues`?XB:iB,count:t,lead:(0,W.jsx)(OV,{view:e}),children:(0,W.jsx)(lk,{label:`Refresh`,icon:dg,iconOnly:!0,shortcut:`R`,disabled:n,className:X(`size-7`,n&&`[&_svg]:animate-spin`),onClick:r})})}function jV({read:e,rest:t,top:n}){let r=Ck(),i=TV(t),a=e.data?.pulls??[];if(!e.data&&e.error)return(0,W.jsxs)(W.Fragment,{children:[n,(0,W.jsx)(NO,{message:`Could not load pull requests. ${e.error}`,onRetry:e.reload})]});if(e.data&&a.length===0)return(0,W.jsxs)(W.Fragment,{children:[n,(0,W.jsx)(EV,{loading:e.data.loading,loaded:e.data.loaded,error:e.data.error,onRetry:e.reload})]});let o=(0,W.jsxs)(W.Fragment,{children:[n,e.data?.error?(0,W.jsxs)(`p`,{className:`px-3 pt-2 text-sm text-destructive`,children:[`✗ `,e.data.error]}):null,e.data?(0,W.jsx)(qB,{pulls:a,selectedId:i,onSelect:wV}):(0,W.jsx)(kk,{})]}),s=i===void 0?null:(0,W.jsx)(zB,{number:i,onChanged:e.reload},i);return(0,W.jsx)(Dk,{wide:r,list:o,detail:s,open:i!==void 0,onClose:CV,hint:`Select a pull request to see its detail.`,describe:`Pull request detail`})}var MV=()=>zO(`git.pulls`,{},[`git`]);function NV(e,t,n){let r=e===`issues`?n.read:t,i=e===`issues`?n.read.data?.issues:t.data?.pulls,a=t.loading||!!t.data?.loading||n.enabled&&(n.read.loading||!!n.read.data?.loading),o=i&&(e===`pulls`||n.enabled)?`${i.length} open`:void 0;return{busy:a||r.loading,count:o}}function PV({rest:e}){let t=MV(),n=bV(),r=kV(t,n),i=e[0]===`issues`?`issues`:`pulls`,{busy:a,count:o}=NV(i,t,n),s=(0,W.jsx)(AV,{view:i,count:o,busy:a,refresh:r}),c=i===`issues`?(0,W.jsx)(SV,{issues:n,rest:e.slice(1),top:s}):(0,W.jsx)(jV,{read:t,rest:e,top:s});return(0,W.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:c})}function FV(e){let t=(0,m.useRef)(null),n=(0,m.useRef)(!0),[r,i]=(0,m.useState)(!0),a=(0,m.useRef)(void 0),o=(0,m.useRef)(null),s=(0,m.useCallback)(()=>{n.current=!0,i(!0);let e=t.current;e&&(e.scrollTop=e.scrollHeight)},[]);return(0,m.useLayoutEffect)(()=>{n.current&&s()},[e,s]),(0,m.useLayoutEffect)(()=>{let e=t.current;if(!e||typeof ResizeObserver>`u`)return;let r=new ResizeObserver(()=>{n.current&&(e.scrollTop=e.scrollHeight)});return r.observe(e),a.current=r,()=>{r.disconnect(),a.current=void 0,o.current=null}},[]),(0,m.useLayoutEffect)(()=>{let e=a.current,n=t.current?.firstElementChild??null;e&&n!==o.current&&(o.current&&e.unobserve(o.current),n&&e.observe(n),o.current=n)},[e]),{ref:t,atBottom:r,stick:s,onScroll:(0,m.useCallback)(()=>{let e=t.current;e&&(n.current=e.scrollHeight-e.scrollTop-e.clientHeight<48,i(n.current))},[])}}var IV={DEV:Tm,DESIGN:Uh,QA:kg,RESEARCH:Ug,SCOUT:jm,PLANNER:yg,CLASSIFIER:Vg,LOBBY:Fh,LINT:_h};function LV(e){return e?IV[e.toUpperCase()]??qp:Yp}function RV({className:e,strokeWidth:t=2,source:n}){return(0,W.jsxs)(`svg`,{"aria-hidden":`true`,"data-agent-icon":n,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:t,strokeLinecap:`round`,strokeLinejoin:`round`,className:X(`agent-oracle shrink-0`,e),children:[(0,W.jsx)(`circle`,{cx:`12`,cy:`10`,r:`7`}),(0,W.jsx)(`path`,{d:`M8.5 7.5a4 4 0 0 1 3-2`}),(0,W.jsx)(`path`,{d:`M8 16.2 6.5 20h11L16 16.2`}),(0,W.jsx)(`path`,{d:`M5 20h14`})]})}function zV(e){let t=e?.toUpperCase();return t===`ORACLE`||t===`MASTER`}function BV({source:e,className:t,strokeWidth:n}){if(zV(e))return(0,W.jsx)(RV,{source:e,className:t,strokeWidth:n});let r=LV(e);return(0,W.jsx)(r,{"aria-hidden":`true`,"data-agent-icon":e??`thinking`,strokeWidth:n,className:X(`shrink-0`,t)})}function VV(e){return e.role===`you`||e.role===`note`?e.role:e.role===`panel`?`PLANNER`:e.agent??`MASTER`}var HV={MASTER:`text-primary`,DEV:`text-source-dev`,DESIGN:`text-source-design`,QA:`text-source-qa`,RESEARCH:`text-source-research`,SCOUT:`text-source-scout`,ORACLE:`text-primary`,LOBBY:`text-muted-foreground`};function UV(e){return e.length<=2?e:e.charAt(0)+e.slice(1).toLowerCase()}function WV(e){return HV[e]??`text-muted-foreground`}var GV={MASTER:`var(--primary)`,DEV:`var(--source-dev)`,DESIGN:`var(--source-design)`,QA:`var(--source-qa)`,RESEARCH:`var(--source-research)`,SCOUT:`var(--source-scout)`,ORACLE:`var(--primary)`,LOBBY:`var(--muted-foreground)`};function KV(e){return GV[e]??`var(--muted-foreground)`}function qV(e){if(e.role===`researcher`)return`RESEARCH`;let t=e.domain??e.role;return t===`backend`||t===`dev`?`DEV`:t===`designer`||t===`design`?`DESIGN`:t===`researcher`||t===`research`?`RESEARCH`:t===`qa`?`QA`:t?String(t).toUpperCase():`AGENT`}function JV(e){return e?.runs??[]}function YV(e,t=40){let n=new Map;for(let t of e)n.set(t.source,t);return[...n.values()].sort((e,t)=>e.at-t.at).slice(-t)}function XV({source:e,name:t,time:n,head:r,live:i,children:a,aside:o,named:s,waiting:c}){let l=c||r&&(s||!zV(e));return(0,W.jsxs)(`div`,{className:`chat-agent group/msg`,"data-live":i||void 0,style:i?{"--orb":KV(e)}:void 0,children:[l||o?(0,W.jsxs)(`p`,{className:`chat-speaker`,children:[l?(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 font-medium text-foreground`,style:{"--orb":KV(e)},children:[(0,W.jsx)(BV,{source:e,strokeWidth:2.25,className:`size-3.5 text-[color-mix(in_oklab,var(--orb)_85%,var(--foreground))]`}),c?(0,W.jsx)($V,{text:t}):t]}):null,l&&n?(0,W.jsx)(`time`,{className:`text-xs text-muted-foreground tabular-nums`,children:n}):null,o?(0,W.jsx)(`span`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:o}):null]}):null,c?null:(0,W.jsx)(`div`,{className:`chat-prose`,children:a}),n&&!l?(0,W.jsx)(`time`,{className:`chat-meta`,children:n}):null]})}function ZV({time:e,head:t,note:n,children:r,below:i,actions:a}){return(0,W.jsxs)(`div`,{className:`group/msg flex flex-col items-end gap-1`,children:[(0,W.jsx)(`div`,{className:`chat-bubble`,children:r}),e||n||a?(0,W.jsxs)(`div`,{className:`chat-meta flex items-center gap-2`,"data-note":n?``:void 0,children:[a,n?(0,W.jsx)(`span`,{children:n}):null,e?(0,W.jsx)(`time`,{className:`tabular-nums`,children:e}):null]}):null,i]})}function QV({failed:e,auto:t,children:n}){return(0,W.jsx)(`div`,{role:`note`,className:X(`chat-note`,e&&`text-destructive`,t&&`chat-note-auto`),children:(0,W.jsx)(`span`,{children:n})})}function $V({text:e}){return(0,W.jsxs)(`span`,{className:`activity-shimmer`,children:[(0,W.jsx)(`span`,{className:`sr-only`,children:e}),[...e].map((e,t)=>(0,W.jsx)(`span`,{"aria-hidden":`true`,style:{"--i":t},children:e},t))]})}function eH({onClick:e,className:t}){return(0,W.jsx)(`button`,{type:`button`,"aria-label":`Jump to latest`,title:`Jump to latest`,onClick:e,className:X(`jump-latest btn-outline grid size-9 place-items-center rounded-full border bg-card text-foreground shadow-card outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,t),children:(0,W.jsx)(jp,{"aria-hidden":`true`,className:`size-4`})})}var tH=8;function nH(e){return e?e.path===`fast`?`fast track (${e.size})`:`full workflow (${e.size})`:``}function rH(e,t){let n=Math.min(t,tH);if(n<=0)return[];let r=Math.min(n,Math.round(Math.max(0,e)/t*n));return Array.from({length:n},(e,t)=>t<r)}function iH({done:e,total:t}){return(0,W.jsx)(`span`,{className:`inline-flex items-center gap-0.5`,"aria-hidden":`true`,children:rH(e,t).map((e,t)=>(0,W.jsx)(`span`,{className:X(`h-1.5 w-3 rounded-full`,e?`bg-primary`:`bg-muted-foreground/25`)},t))})}function aH({check:e,className:t}){return(0,W.jsx)(e===`done`?lm:e===`dropped`?xm:Cm,{"aria-hidden":`true`,className:X(`size-4 shrink-0`,e===`done`?`text-success`:`text-muted-foreground`,t)})}var oH=`auto mode`;function sH(){return(0,W.jsx)(`span`,{className:`auto-mode-text`,children:oH})}var cH=`(max-width: 1023.98px)`;function lH(e,t){if(e===`app.sidebar`&&t==null){let e=globalThis.matchMedia;return typeof e==`function`&&e(`(max-width: 1023.98px)`).matches}return e===`lobby.thinking`||t===`1`}var uH=`bot-lobby.collapsed.`,dH=new Set,fH=new Map;function pH(e){if(fH.has(e))return fH.get(e);if(e===`lobby.thinking`)return lH(e);try{return lH(e,localStorage.getItem(uH+e))}catch{return!1}}function mH(e,t){fH.set(e,t);try{e!==`lobby.thinking`&&localStorage.setItem(uH+e,t?`1`:`0`)}catch{}for(let e of[...dH])e()}function hH(e){return dH.add(e),()=>{dH.delete(e)}}function gH(e){mH(e,!pH(e))}function _H(e){return[(0,m.useSyncExternalStore)(hH,()=>pH(e),()=>lH(e)),(0,m.useCallback)(()=>mH(e,!pH(e)),[e])]}function vH({className:e}){return(0,W.jsx)(`span`,{"aria-hidden":`true`,"data-slot":`working-mark`,className:X(`working-mark`,e)})}var yH=`lobby.activity.open`;function bH({entry:e}){return e.pending?(0,W.jsx)(vH,{className:`size-3`}):e.kind===`error`?(0,W.jsx)(d_,{"aria-hidden":`true`,className:`size-3.5 text-destructive`}):e.kind===`warning`?(0,W.jsx)(Yg,{"aria-hidden":`true`,className:`size-3.5 text-warning`}):e.kind===`success`?(0,W.jsx)(Zp,{"aria-hidden":`true`,className:`size-3.5 text-success`}):(0,W.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`})}function xH({entry:e}){return(0,W.jsxs)(`li`,{className:`activity-step`,title:Mk(e.at),style:e.pending?{"--orb":KV(e.source)}:void 0,children:[(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`flex h-5 w-6 items-center justify-center`,children:(0,W.jsx)(bH,{entry:e})}),(0,W.jsx)(`span`,{className:`sr-only`,children:e.pending?`pending`:e.kind}),(0,W.jsxs)(`span`,{className:`min-w-0 break-words`,children:[(0,W.jsx)(`span`,{className:X(`font-medium`,WV(e.source)),children:UV(e.source)}),` `,(0,W.jsxs)(`span`,{className:e.kind===`error`?`text-destructive`:e.pending?`text-foreground`:void 0,children:[Hz(e.text),e.pending?`…`:``]})]})]})}function SH(e){let t=Math.max(0,Math.round(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m ${t%60}s`:`${Math.floor(n/60)}h ${String(n%60).padStart(2,`0`)}m`}function CH(e){let t=[...e].reverse().find(e=>e.pending),n=[...new Set(e.map(e=>UV(e.source)))];return{...t?{live:t}:{},took:(e.at(-1)?.at??0)-(e[0]?.at??0),count:`${e.length} ${e.length===1?`step`:`steps`}`,sources:n.length>3?`${n.slice(0,3).join(`, `)} +${n.length-3}`:n.join(`, `),errors:e.filter(e=>e.kind===`error`).length,warnings:e.filter(e=>e.kind===`warning`).length}}function wH(e){let[t,n]=(0,m.useState)(()=>Date.now());return(0,m.useEffect)(()=>{if(!e)return;n(Date.now());let t=window.setInterval(()=>n(Date.now()),1e3);return()=>window.clearInterval(t)},[e]),t}function TH({entries:e}){let[t]=_H(yH),[n,r]=(0,m.useState)();(0,m.useEffect)(()=>r(void 0),[t]);let i=n??t,a=(0,m.useId)(),{live:o,took:s,count:c,sources:l,errors:u,warnings:d}=CH(e),f=wH(!!o),p=o?{"--orb":KV(o.source)}:void 0;return(0,W.jsxs)(`div`,{className:`activity-run`,"data-live":o?!0:void 0,"data-open":i||void 0,style:p,children:[(0,W.jsxs)(`button`,{type:`button`,"aria-expanded":i,"aria-controls":a,onClick:()=>r(!i),className:`activity-toggle`,children:[o?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(vH,{}),(0,W.jsxs)(`span`,{className:`min-w-0 truncate`,children:[(0,W.jsx)($V,{text:`Working`}),(0,W.jsx)(`span`,{className:`text-muted-foreground`,children:` · `}),(0,W.jsxs)(`span`,{className:`activity-live-step`,children:[(0,W.jsx)(`span`,{className:X(`font-medium`,WV(o.source)),children:UV(o.source)}),` `,(0,W.jsxs)(`span`,{className:`text-foreground`,children:[o.text,`…`]})]},o.id)]}),(0,W.jsxs)(`span`,{className:`shrink-0 tabular-nums`,children:[c,e[0]&&f-e[0].at>=1e3?` · ${SH(f-e[0].at)}`:``]})]}):(0,W.jsxs)(`span`,{className:`min-w-0 truncate`,children:[(0,W.jsx)(`span`,{className:`font-medium`,children:s>=1e3?`Worked for ${SH(s)}`:`Worked`}),(0,W.jsxs)(`span`,{children:[` · `,c,l?` · ${l}`:``]})]}),u?(0,W.jsxs)(`span`,{className:`shrink-0 text-destructive`,children:[u,` `,u===1?`error`:`errors`]}):null,d?(0,W.jsxs)(`span`,{className:`shrink-0 text-warning`,children:[d,` `,d===1?`warning`:`warnings`]}):null,(0,W.jsx)($p,{"aria-hidden":`true`,className:`activity-chevron size-3.5 shrink-0`})]}),i?(0,W.jsx)(`ol`,{id:a,"aria-label":`Activity`,className:`activity-steps`,children:e.map(e=>(0,W.jsx)(xH,{entry:e},e.id))}):null]})}function EH(e,t){let n=[...t].sort((e,t)=>e.at-t.at||e.id-t.id),r=[],i=0,a=e=>{let t=[];for(;i<n.length&&n[i].at<e;)t.push(n[i++]);t.length&&r.push({kind:`activity`,key:`steps-${t[0].id}`,entries:t})};for(let t of e)a(t.at),r.push({kind:`message`,entry:t});return a(1/0),r}var DH=3e5,OH=`Talk to the team.`,kH=`Ask a question or ask for a change below: the right agent answers and does it here.`,AH=`Nothing said yet. Type below to talk to the oracle about this task.`;function jH({entry:e}){return e.text===`auto mode`?(0,W.jsx)(QV,{auto:!0,children:oH}):(0,W.jsxs)(QV,{failed:e.text.startsWith(`✗`),children:[e.text,e.at?` · ${Mk(e.at)}`:``]})}function MH({entry:e,head:t}){if(e.role===`you`)return(0,W.jsx)(ZV,{time:Mk(e.at),head:t,...e.to?{note:`to ${UV(e.to)}`}:{},children:(0,W.jsx)(eB,{text:e.text})});let n=VV(e);return(0,W.jsx)(XV,{source:n,name:n===`PLANNER`?`Panel`:UV(n),time:Mk(e.at),head:t,named:!0,children:(0,W.jsx)(eB,{text:e.text})})}var NH=(0,m.memo)(function({entry:e,head:t,fresh:n}){return(0,W.jsx)(Yf.div,{initial:n?{opacity:0,y:10}:!1,animate:{opacity:1,y:0},transition:{type:`spring`,stiffness:420,damping:32},children:e.role===`note`?(0,W.jsx)(jH,{entry:e}):(0,W.jsx)(MH,{entry:e,head:t})})},(e,t)=>e.head===t.head&&e.entry.id===t.entry.id&&e.entry.text===t.entry.text&&e.entry.at===t.entry.at&&e.entry.to===t.entry.to);function PH({text:e,busy:t,working:n,answering:r}){let i=!!e?.trim();if(!i&&(!t||n))return null;let a=i?`MASTER`:r??`MASTER`;return(0,W.jsx)(XV,{source:a,name:UV(a),head:!0,named:!0,live:t,waiting:!i,aside:t&&i?`writing…`:void 0,children:i?(0,W.jsx)(eB,{text:e??``}):null})}function FH({hasTask:e}){return(0,W.jsxs)(xO,{className:`h-full border-0`,children:[(0,W.jsxs)(SO,{children:[(0,W.jsx)(wO,{variant:`icon`,children:(0,W.jsx)(Nh,{"aria-hidden":`true`})}),e?null:(0,W.jsx)(TO,{children:OH}),(0,W.jsx)(EO,{children:e?AH:kH})]}),e?null:(0,W.jsxs)(`ul`,{className:`flex flex-col gap-2 text-sm text-muted-foreground`,children:[(0,W.jsxs)(`li`,{className:`flex items-center justify-center gap-2`,children:[(0,W.jsx)(XD,{chord:`@`}),` names who answers: @design, @dev, @qa, @research, @scout`]}),(0,W.jsxs)(`li`,{className:`flex items-center justify-center gap-2`,children:[(0,W.jsx)(XD,{chord:`/`}),` /plan plans it with the panel, /task starts it as a task`]})]})]})}async function IH(e){let t=await z(`lobby.history`,{before:e});return{entries:t.entries,hasOlder:t.hasOlder}}function LH(e,t,n){let[r,i]=(0,m.useState)([]),[a,o]=(0,m.useState)(t),[s,c]=(0,m.useState)(!1),l=(0,m.useMemo)(()=>{let t=new Set(e.map(e=>e.id));return[...r.filter(e=>!t.has(e.id)),...e]},[r,e]);return{merged:l,more:a,loading:s,load:(0,m.useCallback)(async()=>{let e=l[0]?.id;if(e===void 0||s||!a)return;c(!0);let t=n.current,r=t?.scrollHeight??0,u=t?.scrollTop??0;try{let t=await IH(e);i(e=>[...t.entries,...e]),o(t.hasOlder),window.requestAnimationFrame(()=>{let e=n.current;e&&(e.scrollTop=e.scrollHeight-r+u)})}catch{o(!1)}finally{c(!1)}},[l,s,a,n])}}var RH=[];function zH({chat:e,activity:t=RH,reply:n,busy:r,answering:i,hasOlder:a,hasTask:o}){let s=(0,m.useMemo)(()=>t.slice(-400),[t]),{ref:c,atBottom:l,stick:u,onScroll:d}=FV(`${e.length}:${n?.length??0}:${s.length}:${s.at(-1)?.pending??``}:${i??``}`),{merged:f,more:p,loading:h,load:g}=LH(e,a,c),_=(0,m.useCallback)(()=>{d();let e=c.current;e&&e.scrollTop<80&&p&&!h&&g()},[d,c,p,h,g]),v=(0,m.useMemo)(()=>EH(f,s),[f,s]),y=f.length===0&&s.length===0&&!n?.trim()&&!r,b=v.at(-1),x=b?.kind===`activity`&&!!CH(b.entries).live,[S,C]=(0,m.useState)(!1);return(0,m.useEffect)(()=>C(!0),[]),(0,W.jsxs)(tB,{"aria-label":`Conversation`,"data-bare":!0,className:`flex-1 rounded-none border-0 shadow-none`,children:[(0,W.jsx)(`div`,{ref:c,onScroll:_,className:`min-h-0 flex-1 overflow-y-auto overscroll-y-contain px-5 pt-4 pb-dock outline-none focus-visible:bg-muted/30`,role:`log`,"aria-label":`Conversation`,tabIndex:0,children:y?(0,W.jsx)(FH,{hasTask:o}):(0,W.jsxs)(`div`,{className:`chat-column`,children:[p?(0,W.jsx)(`p`,{className:`mb-4 text-center text-xs text-muted-foreground`,children:`Earlier messages load as you scroll up.`}):null,v.map((e,t)=>{if(e.kind===`activity`)return(0,W.jsx)(TH,{entries:e.entries},e.key);let n=v[t-1],r=n?.kind===`message`?n.entry:void 0,i=!r||VV(r)!==VV(e.entry)||e.entry.at-r.at>DH;return(0,W.jsx)(NH,{entry:e.entry,head:i,fresh:S},e.entry.id)}),(0,W.jsx)(PH,{text:n,busy:r,working:x,...i?{answering:i}:{}})]})}),(0,W.jsx)(Gv,{target:c,down:!1}),l?null:(0,W.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-dock z-10 flex justify-center [&>*]:pointer-events-auto`,children:(0,W.jsx)(eH,{onClick:u})})]})}function BH(e){let t=e[0]===`ask`,[n,r]=t?e.slice(1):e;return{chat:t,agent:n,file:r}}function VH(e,t){let{agent:n,file:r}=BH(e);return vO(`knowledge`,...t?[`ask`]:[],n??``,r??``)}var HH=[`master`,`designer`,`backend`,`qa`],UH={master:`Master (oracle)`,designer:`Designer`,backend:`Backend`,qa:`QA`},WH={master:`Master`,designer:`Designer`,backend:`Backend`,qa:`QA`},GH=`Every write archives the version before it.`;function KH(e){if(e<1e3)return String(e);let t=e/1e3;return`${t>=10?Math.round(t):t.toFixed(1)}k`}function qH(e){return`over the compaction threshold — ask the oracle to compact ${e}`}function JH(e){return{text:e.text,occurrence:e.occurrence}}function YH(e){return HH.map(t=>{let n=e.filter(e=>e.agent===t);return{agent:t,files:n,notes:n.reduce((e,t)=>e+t.notes,0)}}).filter(e=>e.files.length>0)}function XH(e){return e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing}function ZH({initial:e,busy:t,onSave:n,onCancel:r}){let[i,a]=(0,m.useState)(e),o=()=>{!t&&i.trim()&&n(i)};return(0,W.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-lg border border-input p-3`,children:[(0,W.jsx)(`label`,{htmlFor:`knowledge-entry`,className:`text-sm font-medium text-foreground`,children:`Edit entry`}),(0,W.jsx)(Ak,{id:`knowledge-entry`,value:i,rows:4,autoFocus:!0,onChange:e=>a(e.target.value),onKeyDown:e=>{XH(e)&&(e.preventDefault(),o())}}),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,W.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:GH}),(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsx)(Z,{variant:`outline`,onClick:r,disabled:t,children:`Cancel`}),(0,W.jsxs)(Z,{onClick:o,disabled:t||!i.trim(),children:[t?(0,W.jsx)(DO,{}):null,`Save`]})]})]})]})}function QH({open:e,file:t,initial:n,busy:r,onClose:i,onSave:a}){let[o,s]=(0,m.useState)(n),c=oO(e,aO.confirm);return(0,W.jsx)(QD,{open:e&&c,onOpenChange:e=>!e&&i(),label:`Edit ${t}`,description:GH,dismissOnBackdrop:!1,className:`max-w-3xl`,children:(0,W.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 p-4`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`h2`,{className:`text-base font-medium`,children:[`Edit `,t]}),(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:GH})]}),(0,W.jsx)(Ak,{value:o,rows:14,className:`min-h-0 flex-1 font-mono text-sm`,onChange:e=>s(e.target.value)}),(0,W.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,W.jsx)(Z,{variant:`outline`,onClick:i,disabled:r,children:`Cancel`}),(0,W.jsxs)(Z,{onClick:()=>a(o),disabled:r,children:[r?(0,W.jsx)(DO,{}):null,`Save file`]})]})]})})}function $H({note:e,about:t,onTakeBack:n,busy:r}){let i=t?`about "${t.replace(/\s+/g,` `).trim().slice(0,50)}": ${e.text}`:e.text;return(0,W.jsxs)(`li`,{className:`flex items-start gap-2 text-sm text-muted-foreground`,children:[(0,W.jsx)(tg,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-primary`}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1 break-words`,children:i}),(0,W.jsx)(lk,{label:`Take the note back`,icon:Zg,iconOnly:!0,className:`-my-1 size-7`,disabled:r,onClick:()=>n(e.id)})]})}function eU({entry:e,index:t,selected:n,notes:r,onPick:i,onTakeBack:a,busy:o}){let s=()=>i(t);return(0,W.jsxs)(`li`,{role:`button`,tabIndex:0,"aria-pressed":n,onClick:s,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),s())},className:n?`flex min-h-9 cursor-pointer flex-col gap-1 rounded-lg border border-primary/30 bg-accent px-3 py-2.5 outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`:`flex min-h-9 cursor-pointer flex-col gap-1 rounded-lg border border-border px-3 py-2.5 outline-none transition-colors hover:bg-muted focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,children:[(0,W.jsx)(`div`,{className:`flex gap-2`,children:(0,W.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,W.jsx)(eB,{text:e.text})})}),r.length>0?(0,W.jsx)(`ul`,{className:`flex flex-col gap-1 pl-1`,children:r.map(e=>(0,W.jsx)($H,{note:e,onTakeBack:a,busy:o},e.id))}):null]})}function tU({notes:e,onTakeBack:t,busy:n}){return e.length===0?null:(0,W.jsx)(rB,{title:`Notes on entries that changed`,right:String(e.length),children:(0,W.jsx)(`ul`,{className:`flex flex-col gap-1`,children:e.map(e=>(0,W.jsx)($H,{note:e,about:e.entry,onTakeBack:t,busy:n},e.id))})})}function nU({view:e}){let t=e.entries.length;return(0,W.jsxs)(`header`,{className:`flex flex-col gap-1.5`,children:[(0,W.jsxs)(`h2`,{className:`min-w-0 break-words text-lg font-semibold tracking-tight`,children:[WH[e.agent],` `,(0,W.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[`· `,e.file]})]}),(0,W.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[t,` `,t===1?`entry`:`entries`,` · `,KH(e.chars),` chars`]}),e.over?(0,W.jsx)(`p`,{className:`text-sm text-foreground`,children:qH(e.file)}):null]})}function rU({draft:e,picked:t,setDraft:n,onEditFile:r,onDelete:i}){let a=!!e;return(0,W.jsxs)(uk,{children:[(0,W.jsx)(lk,{label:`Edit the entry`,text:`Edit`,icon:rg,shortcut:`E`,disabled:a||!t,onClick:()=>n({kind:`edit`,entry:t})}),(0,W.jsx)(lk,{label:t?`Add an entry after it`:`Add an entry`,text:`Add`,icon:lg,shortcut:`A`,disabled:a,onClick:()=>n({kind:`add`,entry:t})}),(0,W.jsx)(lk,{label:`Comment on the entry`,text:`Comment`,icon:jh,shortcut:`C`,disabled:a||!t,onClick:()=>n({kind:`comment`,entry:t})}),(0,W.jsx)(lk,{label:`Edit the whole file`,text:`Edit file`,icon:Um,shortcut:`F`,disabled:a,onClick:r}),(0,W.jsx)(Gk,{icon:qg,label:`Delete the entry`,text:`Delete`,shortcut:`Delete`,title:`Delete this entry?`,description:`The entry and its notes are removed. The version before is archived.`,confirmLabel:`Delete entry`,variant:`destructive`,disabled:a||!t,onConfirm:i})]})}function iU({agent:e,file:t,onChanged:n}){let r=zO(`knowledge.open`,{agent:e,file:t},[`knowledge`]),[i,a]=(0,m.useState)(0),[o,s]=(0,m.useState)(),[c,l]=(0,m.useState)(!1),[u,d]=(0,m.useState)(!1),f=r.data?.view,p=f?.entries??[],h=p[Math.min(i,Math.max(0,p.length-1))],g=async e=>{d(!0),await e(),s(void 0),r.reload(),n(),d(!1)},_=e=>void g(()=>K(`knowledge.unnote`,{id:e})),v=()=>{h&&g(()=>K(`knowledge.remove`,{agent:e,file:t,ref:JH(h)}))},y=n=>{let r=o?.entry;if(o?.kind===`edit`&&r)return void g(()=>K(`knowledge.edit`,{agent:e,file:t,ref:JH(r),text:n}));if(o?.kind===`comment`&&r)return void g(()=>K(`knowledge.comment`,{agent:e,file:t,ref:JH(r),text:n}));g(()=>K(`knowledge.add`,{agent:e,file:t,...h?{ref:JH(h)}:{},text:n}))};return f?(0,W.jsxs)(`article`,{className:`flex flex-col gap-4`,"aria-label":`${WH[e]} ${t}`,children:[(0,W.jsx)(rU,{draft:o,picked:h,setDraft:s,onEditFile:()=>l(!0),onDelete:v}),(0,W.jsx)(nU,{view:f}),p.length===0?(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Nothing here yet. Add the first entry below.`}):null,(0,W.jsx)(`ul`,{className:`workspace-section flex flex-col gap-2 rounded-xl border p-3 shadow-xs`,children:p.map((e,t)=>(0,W.jsx)(eU,{entry:e,index:t,selected:t===i,notes:f.attached.filter(t=>t.entry===e.text),onPick:a,onTakeBack:_,busy:u},`${t}-${e.text}`))}),o?.kind===`edit`?(0,W.jsx)(ZH,{initial:o.entry.text,busy:u,onSave:y,onCancel:()=>s(void 0)}):null,o?.kind===`comment`?(0,W.jsx)(YB,{label:`Comment on this entry`,hint:GH,buttonLabel:`Add note`,onSend:async e=>(y(e),!0)}):null,o?.kind===`add`?(0,W.jsx)(YB,{label:`Add an entry`,hint:GH,buttonLabel:`Add entry`,onSend:async e=>(y(e),!0)}):null,u&&!o?(0,W.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,W.jsx)(DO,{}),` saving…`]}):null,(0,W.jsx)(tU,{notes:f.detached,onTakeBack:_,busy:u}),(0,W.jsx)(QH,{open:c,file:t,initial:f.content,busy:u,onClose:()=>l(!1),onSave:n=>{l(!1),g(()=>K(`knowledge.replaceFile`,{agent:e,file:t,text:n}))}})]}):r.error?(0,W.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not read the file. `,r.error]}):(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`reading…`})}function aU(e){return`${e.agent}/${e.file}`}var oU=(e,t)=>`${e} ${t}${e===1?``:`s`}`;function sU({info:e}){return(0,W.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2 text-xs text-muted-foreground tabular-nums`,children:[(0,W.jsx)(`span`,{children:KH(e.chars)}),e.over?(0,W.jsx)(`span`,{className:`text-foreground`,children:`· over`}):null,e.notes>0?(0,W.jsx)(`span`,{className:`text-primary`,children:oU(e.notes,`note`)}):null]})}function cU({name:e}){let t=e.split(`.`).pop()?.toLowerCase();return t===`md`||t===`mdx`||t===`txt`?(0,W.jsx)(Ym,{"aria-hidden":`true`,className:`ktree-icon`,"data-ext":`md`}):t===`json`||t===`yaml`||t===`yml`||t===`toml`?(0,W.jsx)(zm,{"aria-hidden":`true`,className:`ktree-icon`,"data-ext":`data`}):(0,W.jsx)($m,{"aria-hidden":`true`,className:`ktree-icon`})}function lU({info:e,selected:t,onSelect:n}){return(0,W.jsx)(`li`,{className:`ktree-leaf`,children:(0,W.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,onClick:()=>n(aU(e)),title:e.label,className:`ktree-row ktree-file`,children:[(0,W.jsx)(cU,{name:e.file}),(0,W.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[(0,W.jsxs)(`span`,{className:`sr-only`,children:[e.label,`, `]}),(0,W.jsx)(`span`,{"aria-hidden":`true`,children:e.file})]}),(0,W.jsx)(sU,{info:e})]})})}var uU=`bot-lobby.knowledge.folded`;function dU(){try{let e=JSON.parse(window.localStorage.getItem(uU)??`[]`);return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}catch{return[]}}function fU({files:e,models:t={},selectedKey:n,onSelect:r}){let[i,a]=(0,m.useState)(dU),o=YH(e),s=e.reduce((e,t)=>e+t.notes,0);function c(e,t){a(n=>{let r=t?n.filter(t=>t!==e):[...new Set([...n,e])];try{window.localStorage.setItem(uU,JSON.stringify(r))}catch{}return r})}return(0,W.jsxs)(`div`,{className:`ktree px-2 pt-2 pb-3`,children:[(0,W.jsxs)(`p`,{className:`ktree-row ktree-root`,children:[(0,W.jsx)(hh,{"aria-hidden":`true`,className:`ktree-icon`}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:`Project knowledge`}),(0,W.jsxs)(`span`,{className:`shrink-0 text-xs text-muted-foreground tabular-nums`,children:[oU(e.length,`file`),` · `,oU(o.length,`agent`),s>0?` · ${oU(s,`note`)}`:``]})]}),(0,W.jsx)(`ul`,{className:`ktree-branches`,"aria-label":`Agents and their knowledge`,children:o.map(e=>{let a=!i.includes(e.agent),o=`knowledge-${e.agent}`,s=t[e.agent];return(0,W.jsxs)(`li`,{className:`ktree-branch`,children:[(0,W.jsx)(`h3`,{className:`font-normal`,children:(0,W.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space ArrowLeft ArrowRight`,"aria-describedby":`focused-action-help`,type:`button`,"aria-expanded":a,"aria-controls":o,onClick:()=>c(e.agent,!a),onKeyDown:t=>{t.key===`ArrowLeft`||t.key===`h`?(t.preventDefault(),t.stopPropagation(),c(e.agent,!1)):(t.key===`ArrowRight`||t.key===`l`)&&(t.preventDefault(),t.stopPropagation(),a||c(e.agent,!0))},className:`ktree-row ktree-node`,children:[(0,W.jsx)(rm,{"aria-hidden":`true`,className:X(`ktree-chevron`,a&&`rotate-90`)}),a?(0,W.jsx)(th,{"aria-hidden":`true`,className:`ktree-icon ktree-folder`}):(0,W.jsx)(rh,{"aria-hidden":`true`,className:`ktree-icon ktree-folder`}),(0,W.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[(0,W.jsx)(`span`,{className:`text-foreground`,children:UH[e.agent]}),s?(0,W.jsxs)(`span`,{className:`ms-2 text-xs text-muted-foreground`,children:[(0,W.jsx)(`span`,{className:`sr-only`,children:`runs on `}),s]}):null]}),(0,W.jsxs)(`span`,{className:`shrink-0 text-xs text-muted-foreground tabular-nums`,children:[e.notes>0?(0,W.jsxs)(`span`,{className:`text-primary`,children:[oU(e.notes,`note`),` · `]}):null,oU(e.files.length,`file`)]})]})}),(0,W.jsx)(Au,{initial:!1,children:a?(0,W.jsx)(Yf.ul,{id:o,"aria-label":`${UH[e.agent]}'s knowledge`,initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{type:`spring`,stiffness:520,damping:42},className:`ktree-leaves`,children:e.files.map(e=>(0,W.jsx)(lU,{info:e,selected:aU(e)===n,onSelect:r},aU(e)))},`files`):null})]},e.agent)})})]})}var pU=()=>yO(vO(`knowledge`)),mU=e=>{let[t,n]=e.split(`/`);yO(vO(`knowledge`,t??``,n??``))};function hU(){return(0,W.jsx)(xO,{className:`m-4 flex-1`,children:(0,W.jsxs)(SO,{children:[(0,W.jsx)(wO,{variant:`icon`,children:(0,W.jsx)(Gp,{"aria-hidden":`true`})}),(0,W.jsx)(EO,{children:`No knowledge files yet.`})]})})}function gU(e,t,n,r){let i=e.find(e=>e.agent===t&&e.file===n);return i?(0,W.jsx)(iU,{agent:i.agent,file:i.file,onChanged:r},aU(i)):t&&n?(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`That file is not on the list any more.`}):null}function _U(){let e=LO(`lobby`),t=LO(`status`),n=e.data,r=t.data?.busy??!1;return!n?.chat.length&&!n?.reply&&!r?(0,W.jsx)(`p`,{className:`m-auto max-w-md px-5 pb-dock text-center text-sm text-muted-foreground`,children:`Ask about this project below. The oracle checks saved knowledge, searches the codebase for missing information, and saves verified findings.`}):(0,W.jsx)(zH,{chat:n?.chat??[],reply:n?.reply,busy:r,hasOlder:n?.hasOlderChat??!1,hasTask:!!n?.task})}function vU({read:e,selected:t}){let n=e.data?.files.reduce((e,t)=>e+t.notes,0)??0;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Ok,{title:`Knowledge`,count:n>0?`${n} note${n===1?``:`s`}`:void 0}),(0,W.jsx)(yU,{read:e,selected:t})]})}function yU({read:e,selected:t}){return!e.data&&e.error?(0,W.jsx)(NO,{message:`Could not load the knowledge files. ${e.error}`,onRetry:e.reload}):e.data?e.data.files.length?(0,W.jsx)(fU,{files:e.data.files,models:e.data.models??{},selectedKey:t,onSelect:mU}):(0,W.jsx)(hU,{}):(0,W.jsx)(kk,{})}function bU({rest:e}){let{chat:t,agent:n,file:r}=BH(e),i=Ck(),a=zO(`knowledge.files`,{},[`knowledge`]),o=a.data?.files??[],s=o.find(e=>e.agent===n&&e.file===r);return(0,W.jsx)(Dk,{wide:i,inlineDetail:!0,list:(0,W.jsx)(vU,{read:a,selected:s?aU(s):void 0}),detail:t?(0,W.jsx)(_U,{}):gU(o,n,r,a.reload),detailClassName:t?`flex flex-col overflow-hidden p-0`:void 0,open:t||!!(n&&r),onClose:pU,hint:`Select a file to read its entries, or ask about the project below.`,describe:t?`Knowledge chat`:`Knowledge file`})}function xU(e){let t=e[0];try{return{id:t?decodeURIComponent(t):void 0}}catch{return{id:t}}}var SU=e=>e?.panels??{conversation:!0,activity:!0,thinking:!0};function CU({data:e,status:t}){let n=SU(t);if(!n.conversation)return null;let r=n.activity?e?.activity:void 0;return(0,W.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:(0,W.jsx)(zH,{chat:e?.chat??[],...r?{activity:r}:{},reply:e?.reply,busy:t?.busy??!1,...e?.answering?{answering:e.answering}:{},hasOlder:e?.hasOlderChat??!1,hasTask:!!e?.task})})}function wU(){let e=LO(`lobby`),t=LO(`status`);return!e.data&&e.loading?(0,W.jsxs)(`div`,{className:`flex flex-1 items-center justify-center gap-2 text-sm text-muted-foreground`,children:[(0,W.jsx)(DO,{}),(0,W.jsx)(`span`,{children:`Connecting…`})]}):!e.data&&e.error?(0,W.jsx)(NO,{message:e.error,onRetry:()=>I.onHello({})}):(0,W.jsx)(CU,{data:e.data,status:t.data})}var TU=class{seen=new Set;initialized=new Set;storage;constructor(e){this.storage=e;try{let t=JSON.parse(e?.getItem(`bot-lobby.prompt-seen`)??`[]`);Array.isArray(t)&&(this.seen=new Set(t.filter(e=>typeof e==`string`)))}catch{}}observe(e,t,n=!1){let r=this.initialized.has(e)&&!n?t.filter(e=>!this.seen.has(e)):[];this.initialized.add(e);for(let e of t)this.seen.add(e);try{this.storage?.setItem(`bot-lobby.prompt-seen`,JSON.stringify([...this.seen]))}catch{}return r}};function EU(e,t){return JSON.stringify([e,`prompt`,t])}function DU(e,t,n){return JSON.stringify([e,`dialog`,t,n])}function OU(e,t,n){return JSON.stringify([e,`delivery`,t,n])}var kU=`bot-lobby.prompt-sound-muted`,AU=new Set,jU,MU=!1;function NU(){try{return localStorage.getItem(kU)===`on`}catch{return MU}}function PU(e){MU=e;try{localStorage.setItem(kU,e?`on`:`off`)}catch{}for(let e of AU)e()}function FU(e){return AU.add(e),()=>{AU.delete(e)}}function IU(){return(0,m.useSyncExternalStore)(FU,NU,()=>!1)}function LU(){(0,m.useEffect)(()=>{let e=()=>{try{jU??=new AudioContext,jU.resume().catch(()=>void 0)}catch{}};return window.addEventListener(`pointerdown`,e),window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`pointerdown`,e),window.removeEventListener(`keydown`,e)}},[])}function RU(){if(!NU()&&jU&&jU.state===`running`)try{let e=jU.currentTime,t=jU.createOscillator(),n=jU.createGain();t.frequency.setValueAtTime(960,e),t.frequency.exponentialRampToValueAtTime(360,e+.16),n.gain.setValueAtTime(1e-4,e),n.gain.exponentialRampToValueAtTime(.12,e+.012),n.gain.exponentialRampToValueAtTime(1e-4,e+.22),t.connect(n),n.connect(jU.destination),t.start(e),t.stop(e+.24),t.onended=()=>{t.disconnect(),n.disconnect()}}catch{}}var zU=`bot-lobby.notifications`,BU=`/icon-192.png`,VU=new Set;function HU(){for(let e of[...VU])e()}function UU(){try{return localStorage.getItem(zU)===`on`}catch{return!1}}function WU(e){return VU.add(e),()=>{VU.delete(e)}}function GU(e){try{localStorage.setItem(zU,e?`on`:`off`)}catch{}HU()}function KU(){return(0,m.useSyncExternalStore)(WU,UU,()=>!1)}async function qU(){return typeof Notification>`u`?`unsupported`:(Notification.permission==="default"&&await Notification.requestPermission().catch(()=>void 0),Notification.permission===`granted`?(GU(!0),`granted`):`denied`)}function JU(){GU(!1)}function YU(e){if(e===`completed`)return`finished`;if(e===`abandoned`)return`dropped`}function XU(){return typeof Notification<`u`&&Notification.permission===`granted`&&document.hidden}function ZU(e){try{new Notification(`bot-lobby`,{body:e,icon:BU,tag:`bot-lobby`})}catch{}}function QU(){try{return new TU(sessionStorage)}catch{return new TU}}function $U(e,t){let n=t.payload;return t.kind===`sessionDialog`&&n?.dialog?.id?DU(e,t.sessionId??n.key??t.from,n.dialog.id):EU(e,t.id)}function eW(){let e=KU();LU(),FO();let t=zO(`tasks.list`,{},[`tasks`]),n=zO(`sessions.list`,{},[`sessions`]),r=I.get(`prompts`),i=I.get(`lobby`).data,a=(0,m.useRef)(QU()),o=(0,m.useRef)(new Set([`prompts`,`sessions`,`delivery`])),s=(0,m.useRef)(void 0),c=de()??`current`,l=I.status().connection;return{enabled:e,tasks:t,sessions:n,prompts:r,lobby:i,seen:a,quiet:o,previousState:s,project:c,connection:l,lastConnection:(0,m.useRef)(l)}}function tW(e,t,n,r,i){if(!i)return;let{seen:a,project:o,quiet:s,enabled:c}=e,l=a.current.observe(`${o}:${t}`,n,s.current.has(t));s.current.delete(t),l.length&&(l.forEach(()=>RU()),c&&XU()&&ZU(r),t===`delivery`&&G.info(r,{action:{label:`Review tasks`,onClick:()=>yO(`#/tasks`)}}))}function nW(e){let{prompts:t,sessions:n,tasks:r,project:i}=e,a=t.data?.prompts;tW(e,`prompts`,(a??[]).map(e=>$U(i,e)),`A question is waiting for you.`,!!a&&!t.loading),tW(e,`sessions`,n.data?.background.flatMap(e=>e.dialogs.map(t=>DU(i,e.sessionId??e.key,t.id)))??[],`A background session is asking something.`,!!n.data&&!n.loading),tW(e,`delivery`,r.data?.rows.filter(e=>e.delivery&&(e.delivery.status===`pending_approval`||e.delivery.status===`deferred`||e.delivery.status===`recoverable_failure`)).map(e=>OU(i,e.id,e.delivery.reviewId))??[],`Completed work is ready for delivery review in Tasks.`,!!r.data&&!r.loading)}function rW(e){let{lastConnection:t,connection:n,quiet:r,previousState:i,lobby:a,enabled:o}=e;if(t.current!==n||n!==`live`){t.current=n,r.current=new Set([`prompts`,`sessions`,`delivery`]),i.current=void 0;return}nW(e);let s=a?.task?.state??``,c=YU(s);i.current&&c&&s!==i.current&&o&&XU()&&ZU(`${a?.task?.title??`The task`} ${c}.`),i.current=s}function iW(){let e=eW(),{connection:t,enabled:n,project:r,prompts:i,sessions:a,tasks:o,lobby:s}=e;(0,m.useEffect)(()=>rW(e),[t,n,r,i.data,i.loading,a.data,a.loading,o.data,o.loading,s])}function aW({className:e,type:t,...n}){return(0,W.jsx)(`input`,{type:t,"data-slot":`input`,className:X(`flex h-8 w-full rounded-lg border border-input bg-background bg-clip-padding px-3 py-1 text-sm shadow-control transition-[border-color,box-shadow] duration-150 outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/24 focus-visible:shadow-none disabled:cursor-not-allowed disabled:opacity-64 aria-invalid:border-destructive/36 aria-invalid:focus-visible:border-destructive/64 aria-invalid:focus-visible:ring-destructive/16 dark:bg-input/32`,e),...n})}function oW({className:e,thumbClassName:t,...n}){return(0,W.jsx)(QE,{"aria-keyshortcuts":`Enter Space`,"aria-description":`When focused, press Enter or Space to toggle.`,"data-slot":`switch`,className:X(`peer relative inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-transparent outline-none before:absolute before:-inset-x-2 before:-inset-y-3 before:content-[''] transition-[background-color,box-shadow] duration-200 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-64 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input`,e),...n,children:(0,W.jsx)(eD,{"data-slot":`switch-thumb`,className:X(`pointer-events-none block size-4 rounded-full bg-background shadow-sm/5 ring-0 [transition:translate_.15s,scale_.1s_.1s] origin-left in-[[role=switch]:active]:scale-x-110 data-[state=checked]:origin-right data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0 dark:bg-white`,t)})})}function sW(e,t,n){let r=-1;for(let i=0;i<e.length;i+=1)t.includes(e[i])&&(r<0||Math.abs(i-n)<Math.abs(r-n))&&(r=i);return r}function cW(e,t,n,r){for(let i=n+r;i>=0&&i<e.length;i+=r)if(t.includes(e[i]))return i;return n}var lW={off:`No extra reasoning: the quickest, cheapest answer.`,minimal:`A moment of reasoning, barely.`,low:`Light reasoning for simple work.`,medium:`Balanced reasoning for most work.`,high:`Careful reasoning: slower, better on hard problems.`,xhigh:`Very deep reasoning: slow and costly.`,max:`As deep as the model goes.`};function uW(e,t,n,r){let i=Math.max(t.length-1,1);if(e===`ArrowRight`||e===`ArrowUp`)return cW(t,n,r,1);if(e===`ArrowLeft`||e===`ArrowDown`)return cW(t,n,r,-1);if(e===`Home`)return sW(t,n,0);if(e===`End`)return sW(t,n,i)}function dW(e,t,n,r,i){let a=e.current?.getBoundingClientRect();if(!a||a.width===0)return i;let o=Math.min(1,Math.max(0,(t-a.left)/a.width));return sW(n,r,Math.round(o*Math.max(n.length-1,1)))}function fW(e){let[t,n]=(0,m.useState)(),r=(0,m.useRef)(void 0),i=(0,m.useRef)(0),a=(0,m.useCallback)(()=>{r.current=void 0,i.current=0,n(void 0)},[]);return(0,m.useEffect)(()=>{if(t===void 0)return;let e=window.setTimeout(a,1e4);return()=>window.clearTimeout(e)},[t,a]),{chosenByKey:t,intended:r,choose:(t,o)=>{r.current=t,n(t),i.current+=1,Promise.resolve(e(o)).catch(()=>void 0).then(()=>{--i.current,i.current<=0&&a()})}}}function pW({levels:e,supported:t,value:n,disabled:r,onChange:i}){let a=(0,m.useRef)(null),[o,s]=(0,m.useState)(),c=fW(i),l=sW(e,t,Math.max(0,e.indexOf(n))),u=o??c.chosenByKey??l,d=n=>dW(a,n,e,t,l);function f(e){r||t.length===0||(e.currentTarget.setPointerCapture(e.pointerId),s(d(e.clientX)))}function p(e){if(o===void 0)return;let t=d(e.clientX);t!==o&&s(t)}function h(){if(o===void 0)return;let t=e[o];s(void 0),t&&t!==n&&i(t)}function g(n){if(r||u<0)return;let i=c.intended.current??u,a=uW(n.key,e,t,i);if(a===void 0)return;n.preventDefault();let o=e[a];o&&a!==i&&c.choose(a,o)}function _(n){let i=e[n];!r&&i&&t.includes(i)&&n!==(c.intended.current??u)&&c.choose(n,i)}return{track:a,shown:u,dragging:o!==void 0,jump:_,handlers:{onPointerDown:f,onPointerMove:p,onPointerUp:h,onPointerCancel:()=>s(void 0),onKeyDown:g}}}var mW={xhigh:`Extra high`},hW=e=>mW[e]??`${e.charAt(0).toUpperCase()}${e.slice(1)}`,gW={type:`spring`,stiffness:520,damping:36},_W={xhigh:{type:`spring`,stiffness:120,damping:20,mass:1.4},max:{type:`spring`,stiffness:46,damping:13,mass:2.2}},vW={xhigh:1100,max:2e3},yW=3;function bW(e,t){let[n,r]=(0,m.useState)(),i=(0,m.useRef)(e);return(0,m.useEffect)(()=>{let n=i.current;if(i.current=e,t||n===e||e!==`xhigh`&&e!==`max`||e===`xhigh`&&n===`max`)return;r(e);let a=window.setTimeout(()=>r(void 0),vW[e]);return()=>window.clearTimeout(a)},[e,t]),n}var xW=`1.625rem`,SW=`1.25rem`;function CW({value:e,levels:t,supported:n,recommended:r,model:i,label:a,disabled:o,onChange:s}){let c=Tf()??!1,l=pW({levels:t,supported:n,value:e,disabled:o,onChange:s}),{shown:u,dragging:d}=l,f=Math.max(t.length-1,1),p=Math.max(u,0),m=t[u]??e,h=p===t.length-1&&t.length>1,g=u>=0&&!d&&m!==e,_=r?sW(t,n,Math.max(0,t.indexOf(r))):-1,v=i??`this model`,y=bW(m,c),b=d||c?{duration:0}:y?_W[y]:gW,x=[`high`,`xhigh`,`max`].includes(m),S=e=>`calc(${xW} + (100% - 2 * ${xW}) * ${e/f})`,C=`${a.replace(/\W+/g,`-`)}-hint`;return(0,W.jsxs)(`div`,{className:X(`effort grid min-w-0 gap-1`,o&&`opacity-64`),"data-off":m===`off`||void 0,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,W.jsxs)(`p`,{className:`text-sm text-muted-foreground`,"aria-hidden":`true`,children:[`Effort`,` `,(0,W.jsx)(`span`,{"data-slot":`effort-value`,className:`font-semibold text-foreground`,children:hW(m)})]}),(0,W.jsxs)(VO,{children:[(0,W.jsx)(HO,{asChild:!0,children:(0,W.jsx)(`button`,{type:`button`,"aria-label":`About effort`,"aria-describedby":C,"data-compact":!0,className:`effort-help inline-flex size-6 shrink-0 items-center justify-center rounded-md text-xs font-semibold text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,children:`?`})}),(0,W.jsxs)(UO,{className:`max-w-64`,children:[lW[m]??``,` More effort means more reasoning before each answer: slower and costlier, better on hard problems.`]})]})]}),(0,W.jsxs)(`div`,{role:`slider`,tabIndex:o?-1:0,"aria-label":a,"aria-valuemin":0,"aria-valuemax":t.length-1,"aria-valuenow":p,"aria-valuetext":m,"aria-describedby":C,"aria-disabled":o||void 0,...l.handlers,"data-slot":`effort-track`,"data-level":m,"data-top":h||void 0,"data-dragging":d||void 0,"data-charge":y,className:`effort-track relative h-10 cursor-pointer touch-none rounded-md outline-none select-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background`,children:[m===`max`?(0,W.jsx)(`span`,{"aria-hidden":`true`,"data-slot":`effort-aura`,className:`effort-aura pointer-events-none absolute -inset-1 rounded-lg`}):null,(0,W.jsx)(`span`,{"aria-hidden":`true`,"data-slot":`effort-rail`,className:`effort-rail absolute inset-0 overflow-hidden rounded-md`,children:(0,W.jsxs)(Yf.span,{"data-slot":`effort-fill`,className:`effort-fill absolute inset-y-0 left-0 rounded-md`,initial:!1,animate:{width:`calc(${S(p)} + ${SW})`},transition:b,children:[(0,W.jsx)(`span`,{className:`effort-flow absolute inset-y-0 left-0`}),x&&m!==`max`?(0,W.jsx)(`span`,{"data-slot":`effort-embers`,className:`effort-embers absolute inset-0`}):null,m===`max`?(0,W.jsxs)(`span`,{"data-slot":`effort-warp`,className:`effort-warp absolute inset-0`,children:[Array.from({length:yW},(e,t)=>(0,W.jsx)(`span`,{className:`effort-stars absolute inset-y-0 left-0`,"data-layer":t},t)),(0,W.jsx)(`span`,{className:`effort-streaks absolute inset-y-0 left-0`}),(0,W.jsx)(`span`,{className:`effort-tunnel absolute inset-0`})]}):null,h?(0,W.jsx)(`span`,{"data-slot":`effort-sheen`,className:`effort-sheen absolute inset-0`}):null]})}),(0,W.jsx)(`div`,{ref:l.track,"aria-hidden":`true`,className:`absolute inset-y-0`,style:{left:xW,right:xW}}),t.map((e,t)=>{let r=n.includes(e);return(0,W.jsx)(`span`,{"aria-hidden":`true`,"data-stop":e,"data-supported":r,title:r?hW(e):`Not supported by ${v}`,className:X(`absolute top-1/2 size-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full transition-colors duration-200`,r?t<=p?`effort-dot-lit`:`effort-dot`:`ring-1 ring-muted-foreground/50`),style:{left:S(t)}},e)}),_>=0&&_!==p?(0,W.jsx)(`span`,{"aria-hidden":`true`,"data-slot":`effort-recommended-mark`,className:`effort-mark absolute top-1/2 size-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full`,style:{left:S(_)}}):null,(0,W.jsx)(Yf.span,{"aria-hidden":`true`,"data-slot":`effort-thumb`,className:`absolute top-1/2 z-10`,initial:!1,animate:{left:S(p)},transition:b,children:(0,W.jsx)(Yf.span,{className:`effort-thumb block h-8 w-10 -translate-x-1/2 -translate-y-1/2 rounded-md`,initial:!1,animate:{scale:d===void 0?1:1.08,scaleX:d===void 0?1:1.12},transition:c?{duration:0}:{type:`spring`,stiffness:600,damping:20}})})]}),(0,W.jsxs)(`div`,{"aria-hidden":`true`,className:`relative flex h-4 justify-between px-1 text-xs text-muted-foreground`,children:[(0,W.jsx)(`span`,{className:X(_>=0&&_/f<.3&&`invisible`),children:`Faster`}),(0,W.jsx)(`span`,{className:X(_>=0&&_/f>.7&&`invisible`),children:`Smarter`}),_>=0?(0,W.jsx)(`span`,{"data-slot":`effort-recommended`,className:X(`absolute top-0 -translate-x-1/2 whitespace-nowrap transition-colors`,p===_?`font-medium text-foreground`:`text-muted-foreground`),style:{left:`clamp(2.75rem, ${S(_)}, calc(100% - 2.75rem))`},children:`Recommended`}):null]}),(0,W.jsx)(`p`,{id:C,"data-slot":`effort-hint`,className:`sr-only`,"aria-live":`polite`,children:lW[m]??``}),g?(0,W.jsxs)(`p`,{className:`text-xs text-warning`,children:[e,` is not supported by `,v,`, so it runs at `,m,`.`]}):null]})}function wW(e){return(0,W.jsx)(RE,{...e})}function TW(e){return(0,W.jsx)(zE,{"data-slot":`popover-trigger`,...e})}function EW({className:e,align:t=`center`,sideOffset:n=4,...r}){return(0,W.jsx)(BE,{children:(0,W.jsx)(VE,{"data-slot":`popover-content`,align:t,sideOffset:n,className:X(`reui-menu z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-lg border p-1 outline-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-[0.98] data-closed:animate-out data-closed:fade-out-0 motion-reduce:animate-none`,e),...r})})}var DW=`reui-select inline-flex h-8 min-w-36 cursor-pointer items-center justify-between gap-2 rounded-lg border px-[calc(--spacing(3)-1px)] text-left text-sm text-foreground outline-none select-none transition-[color,box-shadow,background-color,border-color] duration-150 focus-visible:ring-[3px] focus-visible:ring-inset focus-visible:ring-ring/24 disabled:pointer-events-none disabled:opacity-64 [&_svg]:pointer-events-none [&_svg]:shrink-0`,OW=`-me-1 size-3 shrink-0 opacity-50`;function kW(e,t){let n=`${e.label} ${e.hint??``} ${e.value}`.toLowerCase();return t.toLowerCase().split(/\s+/).filter(Boolean).every(e=>n.includes(e))}function AW({value:e,options:t,onChange:n,label:r,className:i,disabled:a}){let[o,s]=(0,m.useState)(!1),[c,l]=(0,m.useState)(``),[u,d]=(0,m.useState)(0),f=(0,m.useRef)(null),p=(0,m.useId)(),h=(0,m.useMemo)(()=>t.filter(e=>kW(e,c)),[t,c]),g=t.find(t=>t.value===e);(0,m.useEffect)(()=>{o&&(l(``),d(Math.max(0,t.findIndex(t=>t.value===e))))},[o]),(0,m.useEffect)(()=>{c&&d(0)},[c]),(0,m.useEffect)(()=>{f.current?.querySelector(`[data-index="${u}"]`)?.scrollIntoView({block:`nearest`})},[u,o,h.length]);function _(t){t&&(s(!1),t.value!==e&&n(t.value))}function v(e){e.key===`ArrowDown`?(e.preventDefault(),d(e=>Math.min(h.length-1,e+1))):e.key===`ArrowUp`?(e.preventDefault(),d(e=>Math.max(0,e-1))):e.key===`Home`&&!c?(e.preventDefault(),d(0)):e.key===`End`&&!c?(e.preventDefault(),d(Math.max(0,h.length-1))):e.key===`Tab`?s(!1):e.key===`Enter`&&!e.nativeEvent.isComposing&&(e.preventDefault(),_(h[u]))}return(0,W.jsxs)(wW,{open:o,onOpenChange:s,children:[(0,W.jsxs)(TW,{type:`button`,role:`combobox`,"aria-label":r,"aria-keyshortcuts":`Enter Space ArrowDown ArrowUp`,"aria-description":`When focused, press Enter, Space or an arrow key to choose. Type to search.`,"aria-expanded":o,"aria-haspopup":`listbox`,"aria-controls":o?p:void 0,disabled:a,onKeyDown:e=>{(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),s(!0))},"data-slot":`select-trigger`,className:X(DW,`w-full min-w-0 overflow-hidden whitespace-nowrap`,i),children:[(0,W.jsx)(`span`,{className:`min-w-0 truncate`,children:g?.label??e}),(0,W.jsx)($p,{"aria-hidden":`true`,strokeWidth:2.25,className:OW})]}),(0,W.jsxs)(EW,{align:`start`,sideOffset:4,collisionPadding:8,onOpenAutoFocus:e=>{e.preventDefault(),e.currentTarget.querySelector(`input`)?.focus()},className:`p-0 flex max-h-[min(20rem,var(--radix-popover-content-available-height))] w-[max(var(--radix-popover-trigger-width),17rem)] max-w-(--radix-popover-content-available-width) flex-col overflow-hidden rounded-lg outline-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-[0.98] data-closed:animate-out data-closed:fade-out-0`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-2.5`,children:[(0,W.jsx)(Tg,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,W.jsx)(`input`,{value:c,onChange:e=>l(e.target.value),onKeyDown:v,role:`searchbox`,"aria-label":`Search ${r}`,"aria-controls":p,"aria-activedescendant":h[u]?`${p}-${u}`:void 0,placeholder:`Search…`,autoComplete:`off`,spellCheck:!1,className:`h-8 min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground`})]}),(0,W.jsxs)(`div`,{ref:f,id:p,role:`listbox`,"aria-label":r,className:`min-h-0 flex-1 overflow-y-auto p-1`,children:[h.length===0?(0,W.jsxs)(`p`,{className:`px-2.5 py-2 text-xs text-muted-foreground`,children:[`Nothing matches “`,c,`”.`]}):null,h.map((t,n)=>(0,W.jsx)(`div`,{id:`${p}-${n}`,role:`option`,"aria-selected":t.value===e,"data-index":n,onPointerMove:()=>d(n),onClick:()=>_(t),className:X(`flex min-h-8 cursor-pointer items-center gap-2 rounded-sm px-2 py-1 text-sm select-none sm:min-h-7`,t.value===e&&`bg-foreground/[0.08]`,n===u&&`bg-accent text-accent-foreground`),children:(0,W.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,W.jsx)(`span`,{className:`truncate`,children:t.label}),t.hint?(0,W.jsx)(`span`,{className:`line-clamp-2 text-pretty text-xs text-muted-foreground/80`,children:t.hint}):null]})},t.value))]})]})]})}var jW=Jv([`relative flex flex-col overflow-hidden bg-card text-card-foreground rounded-(--frame-radius)`,`[--frame-radius:var(--radius-xl)]`,`[--frame-gap:0px] [--frame-px:0px] [--frame-py:0px] [--frame-panel-header-gap:0rem] [--frame-panel-footer-gap:--spacing(1)]`,`[--frame-panel-px-adjust:0px] [--frame-panel-py-adjust:0px] [--frame-panel-header-px-adjust:0px] [--frame-panel-header-py-adjust:0px] [--frame-panel-footer-px-adjust:0px] [--frame-panel-footer-py-adjust:0px]`,`[--frame-panel-px:calc(var(--frame-panel-px-base)+var(--frame-panel-px-adjust))] [--frame-panel-py:calc(var(--frame-panel-py-base)+var(--frame-panel-py-adjust))] [--frame-panel-header-px:calc(var(--frame-panel-header-px-base)+var(--frame-panel-header-px-adjust))] [--frame-panel-header-py:calc(var(--frame-panel-header-py-base)+var(--frame-panel-header-py-adjust))] [--frame-panel-footer-px:calc(var(--frame-panel-footer-px-base)+var(--frame-panel-footer-px-adjust))] [--frame-panel-footer-py:calc(var(--frame-panel-footer-py-base)+var(--frame-panel-footer-py-adjust))]`,``,`[--frame-panel-bg:var(--workspace-card)] [--frame-panel-border-color:var(--workspace-border)] [--frame-border-color:var(--workspace-border)]`,`[--frame-panel-radius:calc(var(--frame-radius)-var(--frame-px)-1px)]`],{variants:{variant:{default:`border border-[var(--frame-border-color)] bg-clip-padding`,inverse:`[--frame-panel-bg:color-mix(in_oklch,var(--color-muted)_40%,transparent)] border border-[var(--frame-border-color)] bg-background bg-clip-padding`,ghost:`[--frame-panel-radius:calc(var(--frame-radius)-var(--frame-px))]`},spacing:{xs:`[--frame-panel-px-base:--spacing(2)] [--frame-panel-py-base:--spacing(2)] [--frame-panel-header-px-base:--spacing(2)] [--frame-panel-header-py-base:--spacing(0.5)] [--frame-panel-footer-px-base:--spacing(2)] [--frame-panel-footer-py-base:--spacing(0.5)]`,sm:`[--frame-panel-px-base:--spacing(3)] [--frame-panel-py-base:--spacing(3.5)] [--frame-panel-header-px-base:--spacing(3)] [--frame-panel-header-py-base:--spacing(1.5)] [--frame-panel-footer-px-base:--spacing(3)] [--frame-panel-footer-py-base:--spacing(1.5)]`,default:`[--frame-panel-px-base:--spacing(4)] [--frame-panel-py-base:--spacing(4)] [--frame-panel-header-px-base:--spacing(4)] [--frame-panel-header-py-base:--spacing(2)] [--frame-panel-footer-px-base:--spacing(4)] [--frame-panel-footer-py-base:--spacing(2)]`,lg:`[--frame-panel-px-base:--spacing(5)] [--frame-panel-py-base:--spacing(5)] [--frame-panel-header-px-base:--spacing(5)] [--frame-panel-header-py-base:--spacing(2.5)] [--frame-panel-footer-px-base:--spacing(5)] [--frame-panel-footer-py-base:--spacing(2.5)]`},stacked:{true:``,false:``},dense:{true:`p-0 gap-0 border-[var(--frame-border-color)] [--frame-panel-radius:var(--frame-radius)] [&_[data-slot=frame-panel]]:-mx-px [&_[data-slot=frame-panel]]:before:hidden [&_[data-slot=frame-panel]:last-child]:-mb-px [&:not(:has([data-slot=frame-panel-header]))_[data-slot=frame-panel]:is(:first-child)]:-mt-px`,false:``}},defaultVariants:{variant:`default`,spacing:`default`,stacked:!1,dense:!1}});function MW({className:e,variant:t,spacing:n,stacked:r,dense:i,...a}){return(0,W.jsx)(`div`,{className:X(jW({variant:t,spacing:n,stacked:r,dense:i}),e),"data-slot":`frame`,"data-spacing":n,...a})}function NW({className:e,fit:t,...n}){return(0,W.jsx)(`div`,{className:X(`relative min-w-0 [[data-slot=frame-panel-header]+&]:border-t [[data-slot=frame-panel]+&]:border-t border-(--frame-panel-border-color)`,!t&&`grow`,`px-(--frame-panel-px) py-(--frame-panel-py)`,e),"data-slot":`frame-panel`,...n})}function PW({className:e,...t}){return(0,W.jsx)(`header`,{className:X(`flex flex-col gap-(--frame-panel-header-gap) px-(--frame-panel-header-px) py-(--frame-panel-header-py)`,e),"data-slot":`frame-panel-header`,...t})}function FW({label:e,help:t,children:n,stacked:r}){return(0,W.jsxs)(`div`,{className:r?`grid gap-1`:`grid grid-cols-[minmax(0,1fr)_minmax(0,18rem)] items-center gap-4`,children:[(0,W.jsxs)(`div`,{className:`min-w-0 break-words`,children:[(0,W.jsx)(`div`,{className:`break-words text-[0.8125rem] font-medium`,children:e}),t?(0,W.jsx)(`p`,{className:`break-words text-xs text-muted-foreground`,children:t}):null]}),(0,W.jsx)(`div`,{className:`min-w-0`,children:n})]})}function IW({children:e}){return(0,W.jsx)(MW,{dense:!0,children:(0,W.jsx)(NW,{className:`flex flex-col divide-y divide-border py-0 [&>*]:py-2`,children:e})})}function LW({value:e,items:t,label:n,onChange:r}){return(0,W.jsx)(AW,{value:e,options:t.map(e=>({value:e.value,label:e.label,...e.help?{hint:e.help}:{}})),label:n,onChange:r})}var RW=`(prefers-color-scheme: dark)`,zW=[`dark`,`light`,`system`],BW=m.createContext(void 0);function VW(e){return e!==null&&zW.includes(e)}function HW(){return window.matchMedia(RW).matches?`dark`:`light`}function UW(){let e=document.createElement(`style`);return e.appendChild(document.createTextNode(`*,*::before,*::after{-webkit-transition:none!important;transition:none!important}`)),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.remove()})})}}function WW(e){let t=e;for(;t instanceof HTMLElement&&t.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t instanceof HTMLElement&&!!(t.isContentEditable||t.closest(`input, textarea, select, [contenteditable='true']`))}function GW({children:e,defaultTheme:t=`system`,storageKey:n=`theme`,disableTransitionOnChange:r=!0,...i}){let[a,o]=m.useState(()=>{let e=localStorage.getItem(n);return VW(e)?e:t}),s=m.useCallback(e=>{localStorage.setItem(n,e),o(e)},[n]),c=m.useCallback(e=>{let t=document.documentElement,n=e===`system`?HW():e,i=r?UW():null;t.classList.remove(`light`,`dark`),t.classList.add(n),i&&i()},[r]);m.useEffect(()=>{if(c(a),a!==`system`)return;let e=window.matchMedia(RW),t=()=>{c(`system`)};return e.addEventListener(`change`,t),()=>{e.removeEventListener(`change`,t)}},[a,c]),m.useEffect(()=>{let e=e=>{e.repeat||e.metaKey||e.ctrlKey||e.altKey||WW(e.target)||e.key.toLowerCase()===`d`&&o(e=>{let t=e===`dark`?`light`:e===`light`?`dark`:HW()===`dark`?`light`:`dark`;return localStorage.setItem(n,t),t})};return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e)}},[n]),m.useEffect(()=>{let e=e=>{if(e.storageArea===localStorage&&e.key===n){if(VW(e.newValue)){o(e.newValue);return}o(t)}};return window.addEventListener(`storage`,e),()=>{window.removeEventListener(`storage`,e)}},[t,n]);let l=m.useMemo(()=>({theme:a,setTheme:s}),[a,s]);return(0,W.jsx)(BW.Provider,{...i,value:l,children:e})}var KW=()=>{let e=m.useContext(BW);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e};function qW({kind:e,dense:t=!1}){let n=e===`font`?ze:Be,r=Ye(e),i=(0,m.useRef)(null);function a(t){let a=t.key===`ArrowRight`||t.key===`ArrowDown`?1:t.key===`ArrowLeft`||t.key===`ArrowUp`?-1:0;if(!a)return;t.preventDefault(),t.stopPropagation();let o=Math.max(0,n.findIndex(e=>e.id===r)),s=n[(o+a+n.length)%n.length];qe(e,s.id),requestAnimationFrame(()=>i.current?.querySelector(`[data-face="${s.id}"]`)?.focus())}return(0,W.jsx)(`div`,{ref:i,role:`radiogroup`,"aria-label":e===`font`?`Typeface`:`Code typeface`,onKeyDown:a,className:t?`grid grid-cols-2 gap-0.5`:`grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4`,children:n.map(n=>{let i=n.id===r,a=Xe[n.id];return(0,W.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":i,"data-face":n.id,tabIndex:i?0:-1,onClick:()=>qe(e,n.id),className:X(`outline-none transition-[background-color,border-color,box-shadow] duration-150 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,t?`flex min-h-8 items-center gap-2 rounded-lg px-2 text-left text-sm hover:bg-accent`:X(`grid gap-1 rounded-xl border p-2.5 text-left`,i?`border-primary bg-accent shadow-[0_0_0_1px_var(--primary)]`:`border-[var(--glass-edge)] hover:bg-accent/50`)),children:[(0,W.jsx)(`span`,{"aria-hidden":`true`,className:X(`leading-none`,t?`w-7 text-base`:`text-2xl`),style:a?{fontFamily:a}:e===`mono`?{fontFamily:`var(--app-font-mono, ui-monospace, monospace)`}:void 0,children:e===`font`?`Aa`:`{ }`}),(0,W.jsxs)(`span`,{className:X(`flex min-w-0 items-center justify-between gap-2`,t&&`flex-1`),children:[(0,W.jsxs)(`span`,{className:`min-w-0`,children:[(0,W.jsx)(`span`,{className:`block truncate text-[0.8125rem] font-medium`,children:n.label}),t?null:(0,W.jsx)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:n.help})]}),i?(0,W.jsx)(Zp,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}):null]})]},n.id)})})}var JW=[`master`,`designer`,`backend`,`qa`,`scout`,`researcher`,`planner`],YW={master:`Master`,designer:`Designer`,backend:`Backend`,qa:`QA`,scout:`Scout`,researcher:`Researcher`,planner:`Planner`},XW=`inherit`,ZW=`inherit`,QW=`Use the session's current model`,$W=`__custom__`,eG=`custom…`,tG=`Type a provider/model id`,nG={master:`high`,designer:`medium`,backend:`medium`,qa:`medium`,scout:`low`,researcher:`low`,planner:`high`},rG=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`],iG={agents:`Agents`,grants:`Tools & skills`,workflow:`Workflow`,lint:`Linting`,lobby:`Lobby`,classifier:`Classifier`,harnesses:`Harnesses`,appearance:`Appearance`,notifications:`Notifications`,install:`Install as app`},aG=new Set([`scout`,`researcher`,`planner`]),oG={label:`Compact at`,help:`Empty: built-in 64K.`,placeholder:`64000`,min:4e3,max:2e6,bad:e=>`"${e}" is not a whole number of tokens from 4000 to 2000000.`},$={intro:`Every agent picks up the MCP tools of the servers pi has connected and the skills pi finds, including ones you add later. Narrow an agent here when it should use fewer. Children an agent delegates to get the same grants. Every change saves at once.`,agents:`Agents`,cardLabel:`tools and skills`,tools:`MCP tools`,toolsHelp:`Granted tools are the only MCP tools this agent can call, directly or from codemode.`,everyTool:`Every MCP tool pi connects`,everyToolHelp:`New servers and tools are picked up on the next run. Off: only the tools ticked below.`,everyToolReadOnlyHelp:`Every read-only tool, picked up on the next run as servers connect. Off: only the tools ticked below.`,allTools:`all MCP tools`,noToolsWarning:`This agent gets no MCP tools at all.`,readOnlyHelp:`This agent only reads, so it can call only tools their server marks read-only.`,qaHelp:`QA's tests may use any granted tool; the QA gate, which only reads, calls only the read-only ones.`,blockedHelp:`This agent only reads; the server does not mark this tool read-only.`,filter:`Filter tools`,looking:`Asking pi…`,noServers:`pi has no MCP servers connected. Add one, then reopen Settings:`,unknownServer:`other`,readOnly:`read-only`,writes:`writes`,notConnected:`not connected`,notConnectedHelp:`Granted, but its server is not connected now. It works again once the server is back.`,addLabel:`Grant a tool by its exact name`,add:`Grant`,badName:`A tool name reads mcp__server__tool, such as mcp__github__get_issue.`,noTools:`no MCP tools`,skills:`Skills`,skillsHelp:`An agent sees each granted skill's name and description, and reads its instructions when the work calls for them.`,sessionSkills:`this session's`,masterSkills:`The oracle is this pi session, so it uses the skills pi loads for it (pi's own skill settings).`,everySkill:`Every skill pi finds`,everySkillHelp:`Off: only the skills ticked below.`,allSkills:`all skills`,noSkills:`no skills`,noSkillsFound:`pi finds no skills. Put one in ~/.pi/agent/skills/ or the project's .pi/skills/ or .agents/skills/.`,notFound:`not found`,skillMissingHelp:`Granted, but pi no longer finds this skill.`,noneWarning:`This agent gets no skills at all.`,edit:`Tools & skills`},sG=[{id:`startOn`,label:`On when pi starts`,help:`off: pi starts as plain pi, and ctrl+shift+m or /bot-lobby on turns bot-lobby on (a session that owns a task under way always starts on)`},{id:`issues`,label:`Issues`,help:`GitHub issues under Git`}],cG=[{id:`conversation`,label:`Conversation pane`},{id:`activity`,label:`Activity steps in the conversation`},{id:`thinking`,label:`Thinking bubble`}],lG=`shown on the Lobby tab`,uG=`Planning rounds`,dG=`how many rounds the panel gets before the oracle settles the rest alone`,fG=[2,3,5,8,0],pG=`Split long plans`,mG=`saving a plan with more steps offers to split it into up to 5 tasks`,hG=[6,8,10,12,0],gG=`Port`,_G=`the base port (then the next free up to +20); 0 means any free port; applies the next time pi starts`,vG=`Open browser`,yG=`open this page in the browser when pi starts`,bG=[{id:`off`,label:`off`,help:`tasks work in the folder you started them in`},{id:`branch`,label:`branch`,help:`each new task gets a git branch named after it, checked out in the working folder`},{id:`worktree`,label:`worktree`,help:`each new task gets its own worktree and branch, named after it: every agent runs there, apart from your checkout`}],xG=`Git isolation`,SG=[{id:`off`,label:`off`,help:`agents' work is never linted`},{id:`advise`,label:`advise`,help:`the oracle and QA are told what the project's linter finds on the lines a task changed; nothing is held`},{id:`block`,label:`block`,help:`new lint errors also hold a task's completion until they are fixed, or you accept the work as it is`}],CG={intro:`After every worker step, before QA and at completion, bot-lobby lints only the files the task's agents touched. Problems on the lines the task changed are the task's; anything already there is shown but never holds it. Suppressions and lint-config changes the task adds go to QA to judge.`,mode:`Lint gate`,command:`Command`,commandHelp:`empty runs the linters the project configures (ESLint, Biome, Oxlint, Ruff), each from its own folder; a command runs without a shell from the repository's top, with {files} standing for the touched files`,commandPlaceholder:`found from the project`,extensions:`File types`,extensionsHelp:`which touched files the command is given, such as .ts .tsx .py`,extensionsPlaceholder:`every touched file`,timeout:`Time limit`,timeoutHelp:`for one linter run; one that runs over reads as could not run, and holds nothing`,found:`Found in this project`,foundHelp:`config files in the project and the folders a few levels below it`,foundNone:`No linter config found. Add one to the project, or set a command above.`,foundReplaced:`The command replaces these.`,installed:`installed`,missing:`not installed`,missingHelp:`install the project's dependencies there, or lint cannot run`,top:`project root`},wG=[{id:`auto`,label:`Auto (OpenCode's free Jev, else TypeSafe)`},{id:`opencode`,label:`OpenCode Zen`},{id:`typesafe`,label:`TypeSafe`},{id:`openrouter`,label:`OpenRouter`},{id:`vercel`,label:`Vercel AI Gateway`}],TG=[{id:`seats`,label:`Planning seats`,help:`each round, only the seats your idea or latest answers touch sit; 1-4 in the Plan tab pins one`},{id:`answers`,label:`Obvious answers`,help:`a panel question whose recommended option the conversation already makes clearly right is answered for you (listed under Assumptions)`},{id:`lobby`,label:`Lobby replies`,help:`each lobby message goes to the agent whose area it is: a frontend question to Design, a library question to Research, "how does this work" to a scout; when it is unsure, or off, the Master answers. Naming an agent with @ always decides`},{id:`triage`,label:`Task triage`,help:`a new task's size, domains and research need reach the Master as hints`},{id:`effort`,label:`Effort routing`,help:`a simple step runs one thinking level lower, a trivial one on the cheaper model below; a routed run that falls short runs again on your settings`},{id:`qa`,label:`QA risk`,help:`once a task's work is in, the classifier reads the diff and sizes QA to it: no QA agent for a change with nothing that runs, a light check for a small one, deep review where a defect would spread; with it off the engine's rules decide`},{id:`review`,label:`Pull request read`,help:`the Git tab's quick read of a pull request: its size, and how likely it is risky, security-relevant, breaking or untested, before an agent reviews it`},{id:`knowledge`,label:`Relevant knowledge`,help:`when an agent's knowledge, standards or decisions file is too long for its prompt, the classifier picks the sections that bear on the step, and the agent is told where the rest is`},{id:`scripts`,label:`Shared scripts`,help:`the classifier matches each step to the shared scripts that do part of it, and the agent is told to run them instead of redoing the work`},{id:`files`,label:`File hints`,help:`scouts, workers, chat agents and the planning panel start with the files most likely needed, and can look more up with find_relevant_files`}],EG={enabled:`Classifier`,enabledHelp:`a fast model makes the obvious decisions so large models spend fewer tokens on them`,engine:`Answered by`,engineHelp:`Jev, another classifier model, or any chat model your pi logins offer (OpenAI, Anthropic, Google, …); a small, fast one works best`,engineJev:`Jev on a host`,engineJevHelp:`TypeSafe's classifier, on the host below`,engineClassifier:`classifier model`,engineChat:`chat model, answers as JSON`,host:`Host`,model:`Model`,modelHelp:`empty uses the host's default`,key:`API key`,keyNote:`the key pi already holds for this host; it is never read by this page`,cheap:`Cheaper model`,cheapNone:`none: trivial steps keep their model and drop a thinking level`,cheapHelp:`what effort routing runs trivial steps on`},DG={title:`Settings`,intro:`Each agent's model and effort, the workflow and its lint gate, the lobby and the classifier. Changes save as you make them.`,loading:`Loading settings…`,loadFailed:`Could not load settings.`,saved:`Settings saved`,saving:`Saving…`,appearanceHelp:`Light, dark, or follow your system. Kept in this browser only.`,themeLabel:`Mode`,themeItems:[{id:`light`,label:`Light`},{id:`dark`,label:`Dark`},{id:`system`,label:`System`}],notificationsLabel:`Browser notifications`,notificationsHelp:`While this page is hidden, tell me when a question waits, a task finishes or a background session asks something.`,notificationsBlocked:`Notifications are blocked in your browser. Allow them for this site and try again.`,notificationsUnsupported:`This browser does not offer notifications.`,notificationsOn:`Browser notifications are on.`,notificationsOff:`Browser notifications are off.`,installLabel:`Install bot-lobby`,installHelp:`Opens in its own fullscreen window, with the shell cached so it starts when Pi is not running.`,installButton:`Install as fullscreen app`,installUnavailable:`Your browser has not offered to install it. Use its menu: “Install app” (Chrome, Edge) or Share, then “Add to Home Screen” (Safari).`,installDone:`bot-lobby is installed.`,installedNow:`Running as an installed app.`,fullscreenLabel:`Fullscreen`,fullscreenHelp:`Hide the browser's own bars for this tab (F11 does the same).`,fullscreenOn:`Exit fullscreen`,fullscreenOff:`Go fullscreen`},OG=new Set([`designer`,`backend`,`qa`,`scout`,`researcher`]),kG={label:`Harness`,piLabel:`pi`,piHelp:`Bot Lobby's own agent, with your pi logins`,missing:`not found`,model:`Model`,defaultModel:`Harness default`,defaultModelHelp:`Whatever the harness is set to use`,older:`older`,effortNote:`Applied when the agent offers effort levels in its session.`,agentNote:`Runs in this harness with Bot Lobby's prompts. It cannot ask you questions or use Bot Lobby's own tools (desk, board, ask_expert).`,intro:`Run any agent but the oracle and the planner on another coding agent. The oracle stays on pi and hands each step over: the harness gets the agent's role prompt, and its own login and models. Pick the harness per agent under Agents.`,installed:`Installed`,notFound:`Not found`,usedBy:`Used by`,unused:`No agent uses it yet`,binary:`Command`,binaryHelp:`The executable to start; empty uses the usual command on PATH.`,args:`Launch arguments`,argsHelp:`Added to every run, quoted as in a shell.`,argsAcpHelp:`The arguments that start the agent in ACP mode.`,home:`Home folder`,homeHelp:e=>`Sets ${e} for its config and login; empty keeps its own.`,provider:`Model provider`,providerHelp:`Who serves the models.`,compact:`Compact after`,compactHelp:`Tokens before it compacts an agent's context (10,000 to 2,000,000); empty keeps the harness's own. An agent with Auto-compact off never compacts.`,inject:`Inject Bot Lobby's prompts`,injectHelp:`Give it the agent's role prompt, knowledge and standards. Off sends the task and the report format only.`,custom:`Extra models`,customHelp:`Model ids it should also offer, separated by spaces.`,harnessPath:`Harness path`,harnessPathHelp:`Antigravity's localharness_external, when its ACP server does not find it itself.`},AG=`https://tweakcn.com/editor/theme`;function jG(){let{theme:e}=KW();return e===`dark`||e===`system`&&typeof window<`u`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches}function MG({palette:e,dark:t}){let n=ie(e,t);return(0,W.jsxs)(`span`,{"aria-hidden":`true`,className:`flex h-9 items-center gap-1.5 rounded-lg border border-border px-2`,style:{background:n.background},children:[(0,W.jsx)(`span`,{className:`size-4 rounded-full border border-black/10`,style:{background:n.card}}),(0,W.jsx)(`span`,{className:`size-4 rounded-full`,style:{background:n.primary}}),(0,W.jsx)(`span`,{className:`h-2 flex-1 rounded-full`,style:{background:n.accent}})]})}function NG(){let e=Re(),t=jG(),n=(0,m.useRef)(null);function r(t){let r=t.key===`ArrowRight`||t.key===`ArrowDown`?1:t.key===`ArrowLeft`||t.key===`ArrowUp`?-1:0;if(!r)return;t.preventDefault(),t.stopPropagation();let i=Math.max(0,e.all.findIndex(t=>t.id===e.active.id)),a=e.all[(i+r+e.all.length)%e.all.length];e.choose(a.id),window.requestAnimationFrame(()=>n.current?.querySelector(`[data-theme-id="${a.id}"]`)?.focus())}return(0,W.jsx)(`div`,{ref:n,role:`radiogroup`,"aria-label":`Colour theme`,onKeyDown:r,className:`grid grid-cols-3 gap-2 lg:grid-cols-4`,children:e.all.map(n=>{let r=n.id===e.active.id;return(0,W.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space ArrowLeft ArrowRight`,"aria-describedby":`focused-action-help`,type:`button`,role:`radio`,"aria-checked":r,"data-theme-id":n.id,tabIndex:r?0:-1,onClick:()=>e.choose(n.id),className:X(`grid gap-1.5 rounded-lg border p-2 text-left outline-none transition-[border-color,box-shadow,background-color] duration-150 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,r?`border-primary bg-accent shadow-[0_0_0_1px_var(--primary)]`:`border-border hover:bg-accent/50`),children:[(0,W.jsx)(MG,{palette:n,dark:t}),(0,W.jsxs)(`span`,{className:`flex min-w-0 items-center justify-between gap-2 px-0.5 text-[0.8125rem] font-medium`,children:[(0,W.jsxs)(`span`,{className:`truncate`,children:[n.name,e.isSaved(n.id)?(0,W.jsx)(`span`,{className:`ml-1.5 text-xs font-normal text-muted-foreground`,children:`saved`}):null]}),r?(0,W.jsx)(Zp,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}):null]})]},n.id)})})}function PG({entry:e}){let t=Re(),[n,r]=(0,m.useState)(!1),[i,a]=(0,m.useState)(e.name),[o,s]=(0,m.useState)();async function c(){let n=i.trim();if(!n||n===e.name)return r(!1);try{await t.rename(e.id,n),r(!1),s(void 0),G.success(`Renamed to ${n}.`)}catch(e){s(e.message)}}return(0,W.jsxs)(`li`,{className:`flex min-h-10 flex-wrap items-center gap-2 py-1.5`,children:[n?(0,W.jsxs)(`form`,{className:`flex min-w-0 flex-1 items-center gap-1`,onSubmit:e=>{e.preventDefault(),c()},children:[(0,W.jsx)(aW,{autoFocus:!0,value:i,maxLength:40,"aria-label":`New name for ${e.name}`,"aria-invalid":o?!0:void 0,onChange:e=>a(e.target.value),onKeyDown:t=>{t.key===`Escape`&&(t.preventDefault(),t.stopPropagation(),a(e.name),r(!1))},className:`h-8 max-w-64`}),(0,W.jsx)(lk,{label:`Save the name`,text:`Save`,icon:Zp,tone:`primary`,type:`submit`,disabled:!i.trim()}),(0,W.jsx)(lk,{label:`Keep the old name`,icon:d_,iconOnly:!0,onClick:()=>{a(e.name),r(!1)}})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,children:e.name}),(0,W.jsx)(lk,{label:`Rename ${e.name}`,text:`Rename`,icon:rg,onClick:()=>{a(e.name),r(!0)}}),(0,W.jsx)(Gk,{label:`Remove ${e.name}`,text:`Remove`,title:`Remove ${e.name}?`,description:`It is removed for every pi session. Keep a copy of its CSS if you want to use it again.`,confirmLabel:`Remove theme`,icon:qg,variant:`destructive`,onConfirm:()=>void t.remove(e.id).catch(e=>G.error(e.message))})]}),o?(0,W.jsx)(`p`,{role:`alert`,className:`w-full text-xs text-destructive`,children:o}):null]})}function FG(){let e=Re();return e.saved.length===0?(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No saved themes yet. Import one below and give it a name.`}):(0,W.jsx)(`ul`,{"aria-label":`Saved themes`,className:`divide-y divide-border`,children:e.saved.map(e=>(0,W.jsx)(PG,{entry:e},e.id))})}function IG(){let e=Re(),[t,n]=(0,m.useState)(``),[r,i]=(0,m.useState)(``),[a,o]=(0,m.useState)(),[s,c]=(0,m.useState)(!1),l=(0,m.useRef)(null);async function u(t,a){let s=ee(t);if(`error`in s){o(s.error);return}o(void 0),c(!0);try{let t=await e.adopt(s,r.trim()||s.name||a);n(``),i(``);let o=s.light?s.dark?void 0:`dark`:`light`;G.success(o?`${t.name} saved and applied. It has no ${o} colours, so ${o} mode keeps the default ones.`:`${t.name} saved and applied.`)}catch(e){o(e.message)}finally{c(!1)}}async function d(e){if(e){if(e.size>2e5){o(`That file is too large to be a theme.`);return}await u(await e.text(),e.name.replace(/\.[^.]+$/,``)||`Custom theme`)}}return(0,W.jsxs)(`div`,{className:`grid gap-2`,children:[(0,W.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Pick or build a theme in the`,` `,(0,W.jsxs)(`a`,{href:AG,target:`_blank`,rel:`noreferrer noopener`,className:`inline-flex items-center gap-0.5 text-link underline-offset-2 hover:underline`,children:[`tweakcn editor `,(0,W.jsx)(Lm,{"aria-hidden":`true`,className:`size-3`})]}),`, press Code, copy it, and paste it here, or save it as a file and upload that. Colours and fonts are used; corners stay the page's own.`]}),(0,W.jsxs)(`label`,{className:`grid gap-1 text-xs text-muted-foreground`,children:[`Name`,(0,W.jsx)(aW,{value:r,maxLength:40,placeholder:`the theme's own name, or the file's`,onChange:e=>i(e.target.value),className:`h-8 max-w-80 text-foreground`})]}),(0,W.jsx)(Ak,{value:t,onChange:e=>{n(e.target.value),o(void 0)},rows:4,spellCheck:!1,"aria-label":`Theme CSS from tweakcn`,"aria-invalid":a?!0:void 0,placeholder:`:root {
93
- --background: oklch(0.98 0 0);
94
- --primary: oklch(0.55 0.2 260);
95
- …
96
- }
97
- .dark { … }`,className:`max-h-56 font-mono text-xs`}),(0,W.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,W.jsx)(`input`,{ref:l,type:`file`,accept:`.css,.json,text/css,application/json`,hidden:!0,tabIndex:-1,"aria-label":`Upload a theme file`,onChange:e=>{d(e.target.files?.[0]),e.target.value=``}}),(0,W.jsx)(lk,{label:`Save and apply the pasted theme`,text:`Save theme`,icon:Zp,tone:`primary`,disabled:!t.trim()||s,onClick:()=>void u(t,`Custom theme`)}),(0,W.jsx)(lk,{label:`Upload a .css or .json theme file`,text:`Upload file`,icon:$g,disabled:s,onClick:()=>l.current?.click()}),a?(0,W.jsx)(`p`,{role:`alert`,className:`ml-2 min-w-0 text-xs text-destructive`,children:a}):null]})]})}function LG(){let{theme:e,setTheme:t}=KW(),n=IU();return(0,W.jsx)(rB,{prominent:!0,title:iG.appearance,children:(0,W.jsxs)(IW,{children:[(0,W.jsx)(FW,{label:`Prompt sounds`,help:`A droplet for each new actionable prompt or delivery review. Kept in this browser; sound starts after interaction. Desktop notifications remain separate.`,children:(0,W.jsx)(oW,{checked:!n,onCheckedChange:e=>PU(!e),"aria-label":`Prompt sounds`})}),(0,W.jsx)(FW,{label:DG.themeLabel,help:DG.appearanceHelp,children:(0,W.jsx)(LW,{value:e,items:DG.themeItems.map(e=>({value:e.id,label:e.label})),label:DG.themeLabel,onChange:e=>t(e)})}),(0,W.jsx)(FW,{label:`Colour theme`,help:`The page's colours, the same in every pi session.`,stacked:!0,children:(0,W.jsx)(NG,{})}),(0,W.jsx)(FW,{label:`Typeface`,help:`The face for the page's text, kept in this browser.`,stacked:!0,children:(0,W.jsx)(qW,{kind:`font`})}),(0,W.jsx)(FW,{label:`Code typeface`,help:`The face for code, paths and commands.`,stacked:!0,children:(0,W.jsx)(qW,{kind:`mono`})}),(0,W.jsx)(FW,{label:`Saved themes`,help:`Themes you imported, kept with pi for every session and project.`,stacked:!0,children:(0,W.jsx)(FG,{})}),(0,W.jsx)(FW,{label:`Import a theme`,stacked:!0,children:(0,W.jsx)(IG,{})})]})})}function RG({className:e,...t}){return(0,W.jsx)(jC,{"aria-keyshortcuts":`Space`,"aria-description":`When focused, press Space to toggle.`,"data-slot":`checkbox`,className:X(`peer relative flex size-[1.125rem] shrink-0 items-center justify-center rounded-[.25rem] border border-input bg-background bg-clip-padding text-primary-foreground shadow-control transition-[background-color,border-color,box-shadow] duration-150 outline-none before:absolute before:-inset-3 before:content-[''] focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring disabled:cursor-not-allowed disabled:opacity-64 data-[state=checked]:shadow-none dark:bg-input/32 data-[state=checked]:border-primary data-[state=checked]:bg-primary`,e),...t,children:(0,W.jsx)(NC,{"data-slot":`checkbox-indicator`,className:`flex items-center justify-center`,children:(0,W.jsx)(Zp,{"aria-hidden":`true`,className:`size-3`,strokeWidth:3})})})}var zG={master:[`master`],designer:[`agents`,`designer`],backend:[`agents`,`backend`],qa:[`agents`,`qa`],scout:[`scout`],researcher:[`researcher`],planner:[`planner`]};function BG(e,t){let n=zG[t].reduce((e,t)=>e[t],e);return{...n.mcpTools?{mcpTools:n.mcpTools}:{},...n.skills?{skills:n.skills}:{}}}function VG(e,t){return zG[e].reduceRight((e,t)=>({[t]:e}),t)}function HG(e,t){let n=e.mcpTools?e.mcpTools.length===0?$.noTools:`${e.mcpTools.length} MCP tool${e.mcpTools.length===1?``:`s`}`:$.allTools;return t===`master`?n:`${n} · ${e.skills?e.skills.length===0?$.noSkills:`${e.skills.length} skill${e.skills.length===1?``:`s`}`:$.allSkills}`}var UG=/^mcp__[A-Za-z0-9_]+__[A-Za-z0-9_]+$/;function WG(e,t){let n=`mcp__${t}__`;return e.startsWith(n)?e.slice(n.length):e}function GG(e){return/^mcp__([A-Za-z0-9_]+?)__/.exec(e)?.[1]??``}function KG({config:e,save:t,agent:n,onAgent:r}){let i=zO(`settings.grants`,{},[]),a=i.data;return(0,W.jsxs)(rB,{prominent:!0,title:iG.grants,children:[(0,W.jsx)(`p`,{className:`max-w-3xl text-sm text-muted-foreground`,children:$.intro}),(0,W.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[minmax(0,13rem)_minmax(0,1fr)] items-start gap-4`,children:[(0,W.jsx)(`nav`,{"aria-label":$.agents,className:`flex flex-col gap-0.5`,children:JW.map(t=>(0,W.jsxs)(`button`,{type:`button`,"aria-current":t===n,onClick:()=>r(t),className:X(HB,`min-h-0 gap-0.5 py-2`),children:[(0,W.jsxs)(`span`,{className:`flex items-center gap-2 text-[0.8125rem] font-medium`,children:[(0,W.jsx)(BV,{source:t,className:`size-4 shrink-0 text-muted-foreground`}),YW[t]]}),(0,W.jsx)(`span`,{className:`pl-6 text-xs text-muted-foreground`,children:HG(BG(e,t),t)})]},t))}),(0,W.jsxs)(MW,{dense:!0,"aria-label":`${YW[n]} ${$.cardLabel}`,children:[(0,W.jsx)(YG,{kind:n,grants:BG(e,n),offered:a?.mcpTools,error:i.error,save:t},`tools-${n}`),(0,W.jsx)(XG,{kind:n,grants:BG(e,n),offered:a?.skills,error:i.error,save:t},`skills-${n}`)]})]})]})}function qG({title:e,note:t}){return(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-baseline justify-between gap-x-3 gap-y-1`,children:[(0,W.jsx)(`h4`,{className:`text-sm font-semibold`,children:e}),(0,W.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t})]})}function JG({id:e,name:t,help:n,tag:r,tagTone:i,checked:a,disabled:o,title:s,onChange:c}){return(0,W.jsxs)(`label`,{htmlFor:e,title:s,className:X(`flex min-w-0 cursor-pointer items-start gap-3 rounded-lg px-2 py-1.5 transition-colors hover:bg-accent/60`,o&&`cursor-not-allowed opacity-60 hover:bg-transparent`),children:[(0,W.jsx)(RG,{id:e,checked:a,disabled:o,onCheckedChange:e=>c(e===!0),className:`mt-0.5`}),(0,W.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,W.jsx)(`span`,{className:`break-all font-mono text-[0.8125rem]`,children:t}),n?(0,W.jsx)(`span`,{className:`break-words text-xs text-muted-foreground`,children:n}):null]}),r?(0,W.jsx)(`span`,{className:X(`shrink-0 rounded-md px-1.5 py-0.5 text-[0.6875rem] font-medium`,i===`warning`?`bg-warning/12 text-warning`:`bg-accent text-muted-foreground`),children:r}):null]})}function YG({kind:e,grants:t,offered:n,error:r,save:i}){let[a,o]=(0,m.useState)(``),[s,c]=(0,m.useState)(``),l=!t.mcpTools,u=t.mcpTools??[],d=new Set(u),f=aG.has(e),p=t=>i(VG(e,{mcpTools:t?[...new Set(t)]:null})),h=(e,t)=>void p(t?[...u,...e]:u.filter(t=>!e.includes(t))),g=new Set((n??[]).map(e=>e.name)),_=u.filter(e=>!g.has(e)).map(e=>({name:e,server:GG(e),description:``,readOnly:!1})),v=a.trim().toLowerCase(),y=[...n??[],..._].filter(e=>!v||e.name.toLowerCase().includes(v)||e.description.toLowerCase().includes(v)),b=[...new Set(y.map(e=>e.server))],x=e=>!f||e.readOnly||!g.has(e.name),S=e=>void p(e?null:(n??[]).filter(x).map(e=>e.name)),C=()=>{let e=s.trim();if(!UG.test(e)){G.error($.badName);return}c(``),d.has(e)||p([...u,e])};return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(PW,{className:`gap-1 border-b border-(--frame-panel-border-color) py-2.5`,children:[(0,W.jsx)(qG,{title:$.tools,note:l?$.allTools:`${u.length} granted`}),(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:f?$.readOnlyHelp:e===`qa`?$.qaHelp:$.toolsHelp})]}),(0,W.jsxs)(NW,{fit:!0,className:`flex flex-col gap-3 py-3`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-4 px-2`,children:[(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsx)(`div`,{className:`text-[0.8125rem] font-medium`,children:$.everyTool}),(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:f?$.everyToolReadOnlyHelp:$.everyToolHelp})]}),(0,W.jsx)(oW,{checked:l,onCheckedChange:S,"aria-label":`${YW[e]} ${$.everyTool.toLowerCase()}`})]}),(n?.length??0)>8?(0,W.jsxs)(`div`,{className:`relative`,children:[(0,W.jsx)(Tg,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted-foreground`}),(0,W.jsx)(aW,{value:a,placeholder:$.filter,"aria-label":$.filter,className:`pl-8`,onChange:e=>o(e.target.value)})]}):null,!n&&!r?(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:$.looking}):null,r&&!n?(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r}):null,n&&n.length===0&&_.length===0?(0,W.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[$.noServers,` `,(0,W.jsx)(`code`,{className:`rounded bg-accent px-1 py-0.5 font-mono text-xs`,children:`pi mcp add <name> -- <command>`})]}):null,b.map(t=>{let n=y.filter(e=>e.server===t),r=n.filter(x).map(e=>e.name),i=l?r.length:r.filter(e=>d.has(e)).length;return(0,W.jsxs)(`div`,{role:`group`,"aria-label":`${t} tools`,className:X(`flex flex-col gap-0.5`,l&&`opacity-60`),children:[(0,W.jsxs)(`label`,{className:`flex items-center gap-3 px-2 py-1 text-xs font-medium text-muted-foreground`,children:[(0,W.jsx)(RG,{checked:i===0?!1:i===r.length||`indeterminate`,disabled:l||r.length===0,"aria-label":`Every ${t} tool`,onCheckedChange:e=>h(r,e===!0)}),(0,W.jsx)(`span`,{className:`font-mono`,children:t||$.unknownServer}),(0,W.jsxs)(`span`,{children:[i,` of `,n.length]})]}),n.map(t=>{let n=g.has(t.name),r=!x(t);return(0,W.jsx)(JG,{id:`grant-${e}-${t.name}`,name:WG(t.name,t.server),help:n?t.description||void 0:$.notConnectedHelp,tag:n?t.readOnly?$.readOnly:$.writes:$.notConnected,tagTone:n?`muted`:`warning`,checked:l?!r:d.has(t.name),disabled:l||r&&!d.has(t.name),...r?{title:$.blockedHelp}:{},onChange:e=>h([t.name],e)},t.name)})]},t)}),!l&&u.length===0?(0,W.jsxs)(`p`,{className:`flex items-center gap-1.5 px-2 text-xs text-warning`,children:[(0,W.jsx)(sm,{"aria-hidden":`true`,className:`size-3.5`}),$.noToolsWarning]}):null,(0,W.jsxs)(`div`,{hidden:l,className:`flex min-w-0 items-center gap-2 border-t border-(--frame-panel-border-color) pt-3`,children:[(0,W.jsx)(aW,{value:s,placeholder:`mcp__server__tool`,"aria-label":$.addLabel,className:`min-w-0 flex-1 font-mono`,onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),C())}}),(0,W.jsx)(lk,{label:$.add,icon:lg,onClick:C})]})]})]})}function XG({kind:e,grants:t,offered:n,error:r,save:i}){if(e===`master`)return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(PW,{className:`gap-1 border-y border-(--frame-panel-border-color) py-2.5`,children:(0,W.jsx)(qG,{title:$.skills,note:$.sessionSkills})}),(0,W.jsx)(NW,{fit:!0,className:`py-3`,children:(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:$.masterSkills})})]});let a=!t.skills,o=new Set(t.skills??[]),s=t=>i(VG(e,{skills:t?[...new Set(t)]:null})),c=new Set((n??[]).map(e=>e.name)),l=(t.skills??[]).filter(e=>!c.has(e));return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(PW,{className:`gap-1 border-y border-(--frame-panel-border-color) py-2.5`,children:[(0,W.jsx)(qG,{title:$.skills,note:a?$.allSkills:`${o.size} granted`}),(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:$.skillsHelp})]}),(0,W.jsxs)(NW,{fit:!0,className:`flex flex-col gap-3 py-3`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-4 px-2`,children:[(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsx)(`div`,{className:`text-[0.8125rem] font-medium`,children:$.everySkill}),(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:$.everySkillHelp})]}),(0,W.jsx)(oW,{checked:a,onCheckedChange:e=>void s(e?null:(n??[]).map(e=>e.name)),"aria-label":`${YW[e]} ${$.everySkill.toLowerCase()}`})]}),!n&&!r?(0,W.jsx)(`p`,{className:`px-2 text-sm text-muted-foreground`,children:$.looking}):null,r&&!n?(0,W.jsx)(`p`,{className:`px-2 text-sm text-muted-foreground`,children:r}):null,n&&n.length===0&&l.length===0?(0,W.jsx)(`p`,{className:`px-2 text-sm text-muted-foreground`,children:$.noSkillsFound}):null,(0,W.jsxs)(`div`,{role:`group`,"aria-label":`${YW[e]} skills`,className:X(`flex flex-col gap-0.5`,a&&`opacity-60`),children:[(n??[]).map(t=>(0,W.jsx)(JG,{id:`skill-${e}-${t.name}`,name:t.name,help:t.description,checked:a||o.has(t.name),disabled:a,title:t.path,onChange:e=>void s(e?[...o,t.name]:[...o].filter(e=>e!==t.name))},t.name)),l.map(t=>(0,W.jsx)(JG,{id:`skill-${e}-${t}`,name:t,help:$.skillMissingHelp,tag:$.notFound,tagTone:`warning`,checked:!0,onChange:()=>void s([...o].filter(e=>e!==t))},t))]}),!a&&o.size===0?(0,W.jsxs)(`p`,{className:`flex items-center gap-1.5 px-2 text-xs text-warning`,children:[(0,W.jsx)(sm,{"aria-hidden":`true`,className:`size-3.5`}),$.noneWarning]}):null]})]})}function ZG(e){let t=[[`designer`,e.agents.designer],[`backend`,e.agents.backend],[`qa`,e.agents.qa],[`scout`,e.scout],[`researcher`,e.researcher]],n={};for(let[e,r]of t)r.harness&&OG.has(e)&&(n[r.harness]??=[]).push(e);return n}function QG({value:e,label:t,placeholder:n,onSave:r}){let[i,a]=(0,m.useState)(e);(0,m.useEffect)(()=>a(e),[e]);let o=()=>{let t=i.trim();t!==e&&r(t)};return(0,W.jsx)(aW,{value:i,placeholder:n,"aria-label":t,spellCheck:!1,onChange:e=>a(e.target.value),onBlur:o,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o())}})}function $G({value:e,label:t,onSave:n}){let r=e>0?String(e):``,[i,a]=(0,m.useState)(r);(0,m.useEffect)(()=>a(r),[r]);let o=()=>{let e=i.trim().replace(/[,_\s]/g,``);if(e===r)return;if(e===``)return n(0);let t=Number(e);if(!Number.isFinite(t)||t<1e4||t>2e6){G.error(`"${i}" is not between 10,000 and 2,000,000 tokens.`),a(r);return}n(Math.round(t))};return(0,W.jsxs)(`div`,{className:`relative`,children:[(0,W.jsx)(aW,{type:`number`,inputMode:`numeric`,min:1e4,max:2e6,step:1e4,value:i,placeholder:`harness default`,"aria-label":t,className:`pr-14`,onChange:e=>a(e.target.value),onBlur:o,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o())}}),(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-y-0 right-2.5 flex items-center text-xs text-muted-foreground`,children:`tokens`})]})}function eK({status:e}){let t=!!e.path;return(0,W.jsxs)(`span`,{title:e.path??`${e.command||`No command`} is not on PATH`,className:X(`inline-flex shrink-0 items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium`,t?`bg-success/8 text-success dark:bg-success/16`:`bg-warning/8 text-warning dark:bg-warning/16`),children:[t?(0,W.jsx)(lm,{"aria-hidden":`true`,className:`size-3.5`}):(0,W.jsx)(sm,{"aria-hidden":`true`,className:`size-3.5`}),t?`${kG.installed}${e.version?` · ${e.version}`:``}`:kG.notFound]})}function tK({status:e,config:t,users:n,save:r}){let i=e.id,a=t.harnesses[i],o=e=>void r({harnesses:{[i]:e}}),s=e.protocol===`acp`,c=i===`codex`?`CODEX_HOME`:i===`claude`?`CLAUDE_CONFIG_DIR`:void 0,l=e.providers.some(e=>e.value===a.modelProvider)||!a.modelProvider?e.providers:[...e.providers,{value:a.modelProvider,label:a.modelProvider}];return(0,W.jsxs)(`section`,{"data-slot":`harness-card`,"aria-label":e.label,className:`glass flex min-w-0 flex-col gap-3 rounded-xl border px-3.5 pt-3 pb-3.5`,children:[(0,W.jsxs)(`header`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-between gap-2`,children:[(0,W.jsx)(`h3`,{className:`min-w-0 break-words text-sm font-semibold`,children:e.label}),(0,W.jsx)(eK,{status:e})]}),(0,W.jsx)(`p`,{className:`break-words text-xs text-muted-foreground`,children:e.blurb}),(0,W.jsxs)(`p`,{className:`break-words text-xs`,children:[(0,W.jsxs)(`span`,{className:`text-muted-foreground`,children:[kG.usedBy,`: `]}),n.length>0?n.map(e=>YW[e]).join(`, `):(0,W.jsx)(`span`,{className:`text-muted-foreground`,children:kG.unused.toLowerCase()})]})]}),(0,W.jsxs)(`div`,{className:`flex flex-col divide-y divide-border border-t border-border [&>*]:py-2.5 [&>*:last-child]:pb-0`,children:[(0,W.jsx)(FW,{stacked:!0,label:kG.binary,help:kG.binaryHelp,children:(0,W.jsx)(QG,{value:a.binaryPath,label:`${e.label} ${kG.binary.toLowerCase()}`,placeholder:e.command||`/path/to/agent`,onSave:e=>o({binaryPath:e})})}),(0,W.jsx)(FW,{stacked:!0,label:kG.args,help:i===`acp`?kG.argsAcpHelp:kG.argsHelp,children:(0,W.jsx)(QG,{value:a.launchArgs,label:`${e.label} ${kG.args.toLowerCase()}`,placeholder:i===`acp`?`--acp`:`none`,onSave:e=>o({launchArgs:e})})}),c?(0,W.jsx)(FW,{stacked:!0,label:kG.home,help:kG.homeHelp(c),children:(0,W.jsx)(QG,{value:a.homePath,label:`${e.label} ${kG.home.toLowerCase()}`,placeholder:i===`codex`?`~/.codex`:`~/.claude`,onSave:e=>o({homePath:e})})}):null,l.length>0?(0,W.jsx)(FW,{stacked:!0,label:kG.provider,help:kG.providerHelp,children:(0,W.jsx)(LW,{value:a.modelProvider,items:l.map(e=>({value:e.value,label:e.label})),label:`${e.label} ${kG.provider.toLowerCase()}`,onChange:e=>o({modelProvider:e})})}):null,s?null:(0,W.jsx)(FW,{stacked:!0,label:kG.compact,help:kG.compactHelp,children:(0,W.jsx)($G,{value:a.compactAt,label:`${e.label} ${kG.compact.toLowerCase()}`,onSave:e=>o({compactAt:e})})}),i===`antigravity`?(0,W.jsx)(FW,{stacked:!0,label:kG.harnessPath,help:kG.harnessPathHelp,children:(0,W.jsx)(QG,{value:a.harnessPath,label:`${e.label} ${kG.harnessPath.toLowerCase()}`,placeholder:`localharness_external`,onSave:e=>o({harnessPath:e})})}):null,(0,W.jsx)(FW,{stacked:!0,label:kG.custom,help:kG.customHelp,children:(0,W.jsx)(QG,{value:a.customModels.join(` `),label:`${e.label} ${kG.custom.toLowerCase()}`,placeholder:i===`opencode`?`anthropic/claude-sonnet-5-5`:`model-id`,onSave:e=>o({customModels:e.split(/[\s,]+/).filter(Boolean)})})}),(0,W.jsxs)(`div`,{className:`flex min-h-0 items-center justify-between gap-4`,children:[(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsx)(`div`,{className:`break-words text-[0.8125rem] font-medium`,children:kG.inject}),(0,W.jsx)(`p`,{className:`break-words text-xs text-muted-foreground`,children:kG.injectHelp})]}),(0,W.jsx)(oW,{checked:a.injectPrompts,onCheckedChange:e=>o({injectPrompts:e}),"aria-label":`${e.label}: ${kG.inject}`})]})]})]})}function nK({config:e,statuses:t,error:n,save:r}){let i=ZG(e);return(0,W.jsxs)(rB,{prominent:!0,title:iG.harnesses,children:[(0,W.jsx)(`p`,{className:`max-w-3xl text-sm text-muted-foreground`,children:kG.intro}),t?(0,W.jsx)(`div`,{className:`grid grid-cols-2 items-start gap-3 xl:grid-cols-3`,children:t.map(t=>(0,W.jsx)(tK,{status:t,config:e,users:i[t.id]??[],save:r},t.id))}):(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n??`Looking for installed harnesses…`})]})}var rK={master:[`master`],designer:[`agents`,`designer`],backend:[`agents`,`backend`],qa:[`agents`,`qa`],scout:[`scout`],researcher:[`researcher`],planner:[`planner`]},iK=[...sG,...cG.map(e=>({id:`panel:${e.id}`,label:e.label,help:lG}))];function aK(e,t){switch(t){case`master`:return e.master;case`scout`:return{model:e.scout.model,thinking:`low`,mcpTools:e.scout.mcpTools,...e.scout.skills?{skills:e.scout.skills}:{},...e.scout.autoCompact===!1?{autoCompact:!1}:{},...e.scout.compactAt?{compactAt:e.scout.compactAt}:{},...e.scout.harness?{harness:e.scout.harness}:{},...e.scout.harnessModel?{harnessModel:e.scout.harnessModel}:{}};case`researcher`:return e.researcher;case`planner`:return e.planner;default:return e.agents[t]}}function oK(e,t){return rK[e].reduceRight((e,t)=>({[t]:e}),t)}function sK(e,t){return e.find(e=>e.id===t)?.thinkingLevels??rG}function cK(e,t){return rG[sW(rG,e,Math.max(0,rG.indexOf(t)))]??t}var lK=e=>e>0?`${e} round${e===1?``:`s`}`:`unlimited`,uK=e=>e>0?`over ${e} steps`:`never`;function dK(e){let[t,n]=(0,m.useState)(!1),[r,i]=(0,m.useState)(``),a=e.models.some(t=>t.id===e.value),o=[...e.inherit?[{value:XW,label:ZW,help:QW}]:[],...e.none?[{value:XW,label:`none`,help:`Use the primary model`}]:[],...!e.inherit&&!e.none&&e.value===`inherit`?[{value:XW,label:ZW,help:QW}]:[],...e.models.map(e=>({value:e.id,label:e.id,...e.label&&e.label!==e.id?{help:e.label}:{}})),...!a&&e.value!==`inherit`?[{value:e.value,label:e.value,help:tG}]:[],{value:$W,label:eG,help:tG}],s=t=>{if(t!==`__custom__`)return e.onChange(t);i(a?``:e.value),n(!0)},c=()=>{let t=r.trim();n(!1),t&&t!==e.value&&e.onChange(t)};return(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsx)(LW,{value:e.value,items:o,label:e.label,onChange:s}),t?(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-start gap-2`,children:[(0,W.jsx)(aW,{autoFocus:!0,value:r,placeholder:`provider/model`,"aria-label":`Model id`,className:`min-w-0 flex-1`,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),c())}}),(0,W.jsx)(lk,{label:`Use this model`,icon:Zp,tone:`primary`,onClick:c})]}):null]})}function fK({label:e,help:t,checked:n,onChange:r,name:i}){return(0,W.jsxs)(`div`,{className:`flex min-h-0 items-center justify-between gap-4`,children:[(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsx)(`div`,{className:`break-words text-[0.8125rem] font-medium`,children:e}),t?(0,W.jsx)(`p`,{className:`break-words text-xs text-muted-foreground`,children:t}):null]}),(0,W.jsx)(oW,{checked:n,onCheckedChange:r,"aria-label":i??e})]})}function pK({value:e,onSave:t,placeholder:n,label:r}){let[i,a]=(0,m.useState)(e);(0,m.useEffect)(()=>a(e),[e]);let o=()=>{let n=i.trim();n!==e&&t(n)};return(0,W.jsx)(aW,{value:i,placeholder:n,"aria-label":r,onChange:e=>a(e.target.value),onBlur:o,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o())}})}function mK({value:e,label:t,onSave:n}){let r=Math.round(e/6e4);return(0,W.jsx)(_K,{label:t,value:String(r),min:1,suffix:`min`,onSave:e=>{let t=Number(e);return!Number.isFinite(t)||t<=0?(G.error(`"${e}" is not a positive number of minutes.`),!1):(n(Math.round(t*6e4)),!0)}})}function hK({value:e,label:t,onSave:n}){return(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-between gap-x-4 gap-y-1.5`,children:[(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsx)(`div`,{className:`text-[0.8125rem] font-medium`,children:oG.label}),(0,W.jsx)(`p`,{className:`break-words text-xs text-muted-foreground`,children:oG.help})]}),(0,W.jsx)(`div`,{className:`w-36 shrink-0`,children:(0,W.jsx)(_K,{label:t,value:e?String(e):``,min:oG.min,max:oG.max,step:1e3,placeholder:oG.placeholder,suffix:`tokens`,onSave:e=>{if(e===``)return n(null),!0;let t=Number(e);return!Number.isInteger(t)||t<oG.min||t>oG.max?(G.error(oG.bad(e)),!1):(n(t),!0)}})})]})}function gK({value:e,onSave:t}){return(0,W.jsx)(_K,{label:gG,value:String(e),min:0,max:65535,onSave:e=>!/^\d+$/.test(e)||Number(e)>65535?(G.error(`"${e}" is not a port (0, or 1-65535).`),!1):(t(Number(e)),!0)})}function _K({label:e,value:t,min:n,max:r,step:i,placeholder:a,suffix:o,onSave:s}){let[c,l]=(0,m.useState)(t);(0,m.useEffect)(()=>l(t),[t]);let u=()=>{c!==t&&(s(c.trim())||l(t))};return(0,W.jsxs)(`div`,{className:`relative`,children:[(0,W.jsx)(aW,{type:`number`,inputMode:`numeric`,min:n,max:r,step:i,placeholder:a,value:c,"aria-label":e,className:o?o.length>3?`pr-14`:`pr-10`:void 0,onChange:e=>l(e.target.value),onBlur:u,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),u())}}),o?(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-y-0 right-2.5 flex items-center text-xs text-muted-foreground`,children:o}):null]})}function vK({value:e,label:t,onSave:n}){let[r,i]=(0,m.useState)(e);return(0,m.useEffect)(()=>i(e),[e]),(0,W.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,W.jsx)(Ak,{rows:2,value:r,"aria-label":t,onChange:e=>i(e.target.value),onBlur:()=>{r.trim()!==e&&n(r.trim())}}),(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Saved when you leave the field.`})]})}function yK({value:e,statuses:t,label:n,onChange:r}){let i=[{value:`pi`,label:kG.piLabel,help:kG.piHelp},...t.map(e=>({value:e.id,label:e.label,help:e.path?e.version?`v${e.version}`:kG.installed:kG.missing}))];return i.some(t=>t.value===e)||i.push({value:e,label:e}),(0,W.jsx)(LW,{value:e,items:i,label:n,onChange:r})}function bK({value:e,models:t,label:n,onChange:r}){let[i,a]=(0,m.useState)(!1),[o,s]=(0,m.useState)(``),c=e===``||t.some(t=>t.id===e),l=[{value:``,label:kG.defaultModel,help:kG.defaultModelHelp},...t.map(e=>({value:e.id,label:e.label,help:e.custom?tG:e.current?e.id:`${e.id} · ${kG.older}`})),...c?[]:[{value:e,label:e,help:tG}],{value:$W,label:eG,help:tG}],u=t=>{if(t!==`__custom__`)return r(t);s(c?``:e),a(!0)},d=()=>{let t=o.trim();a(!1),t&&t!==e&&r(t)};return(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsx)(LW,{value:e,items:l,label:n,onChange:u}),i?(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-start gap-2`,children:[(0,W.jsx)(aW,{autoFocus:!0,value:o,placeholder:`model id`,"aria-label":`Harness model id`,className:`min-w-0 flex-1`,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),d())}}),(0,W.jsx)(lk,{label:`Use this model`,icon:Zp,tone:`primary`,onClick:d})]}):null]})}function xK(e,t){let n=e?.models.find(e=>e.id===t);if(n&&n.efforts.length>0)return n.efforts;if(e?.effort===`session`)return rG;let r=e?.models.find(e=>e.efforts.length>0)?.efforts;return r&&r.length>0?r:rG}function SK({kind:e,config:t,models:n,harnesses:r,save:i,onGrants:a}){let o=aK(t,e),s=t=>i(oK(e,t)),c=YW[e],l=o.harness?r.find(e=>e.id===o.harness):void 0,u=!!o.harness,d=o.harnessModel??``,f=u?xK(l,d):sK(n,o.model),p=t=>{if(t===(o.harness??`pi`))return;if(t===`pi`)return void s({harness:`pi`});let n=xK(r.find(e=>e.id===t),``),i={harness:t,harnessModel:``};e!==`scout`&&!n.includes(o.thinking)&&(i.thinking=cK(n,o.thinking)),s(i)},h=t=>{let n=xK(l,t),r={harnessModel:t};e!==`scout`&&!n.includes(o.thinking)&&(r.thinking=cK(n,o.thinking)),s(r)},g=t=>{let r={model:t};e!==`scout`&&!sK(n,t).includes(o.thinking)&&(r.thinking=cK(sK(n,t),o.thinking)),s(r)},_=e!==`scout`&&e!==`researcher`,[v,y]=(0,m.useState)(!1),b=CK(o,e);return(0,W.jsxs)(`section`,{"data-slot":`agent-row`,className:`glass flex min-w-0 flex-col gap-2.5 rounded-xl border px-3.5 pt-2.5 pb-3`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-2`,children:[(0,W.jsxs)(`h3`,{className:`flex min-w-0 items-center gap-2 break-words text-sm font-semibold`,children:[(0,W.jsx)(BV,{source:e,className:`size-4 shrink-0 text-muted-foreground`}),c]}),(0,W.jsx)(TK,{open:v,custom:b,onToggle:()=>y(e=>!e)})]}),OG.has(e)?(0,W.jsx)(yK,{value:o.harness??`pi`,statuses:r,label:`${c} ${kG.label.toLowerCase()}`,onChange:p}):null,u?(0,W.jsx)(bK,{value:d,models:l?.models??[],label:`${c} model`,onChange:h}):(0,W.jsx)(dK,{value:o.model,models:n,label:`${c} model`,inherit:e===`master`,onChange:g}),e===`scout`?(0,W.jsx)(wK,{}):(0,W.jsx)(CW,{value:o.thinking,levels:rG,supported:f,recommended:nG[e],model:u?d||`${l?.label??o.harness}'s default model`:o.model===`inherit`?`the session model`:o.model,label:`${c} effort`,onChange:e=>s({thinking:e})}),u&&l?.effort===`session`&&e!==`scout`?(0,W.jsx)(`p`,{className:`-mt-1 text-xs text-muted-foreground`,children:kG.effortNote}):null,(0,W.jsx)(fK,{label:`Auto-compact`,help:e===`master`?`Compacts the oracle's context as it fills, and files what it learned into the knowledge base, shared with the agents it concerns.`:u?l?.protocol===`acp`?`${l.label} compacts on its own; this switch applies to pi, Codex and Claude Code.`:`Lets ${l?.label??`the harness`} compact this agent's context, at the threshold under Harnesses.`:`Compacts this agent's context as it fills.`,checked:o.autoCompact!==!1,onChange:e=>s({autoCompact:e}),name:`${c} auto-compact`}),o.autoCompact!==!1&&!u?(0,W.jsx)(hK,{value:o.compactAt,label:`${c} compact at`,onSave:e=>s({compactAt:e})}):null,(0,W.jsxs)(`div`,{hidden:!v,className:`grid gap-2 border-t border-border pt-2`,children:[u?(0,W.jsx)(`p`,{className:`break-words text-xs text-muted-foreground`,children:kG.agentNote}):null,_?(0,W.jsx)(vK,{value:o.instructions??``,label:`${c} instructions`,onSave:e=>s({instructions:e})}):null,(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-between gap-2`,children:[(0,W.jsx)(`p`,{className:`min-w-[7rem] flex-1 break-words text-xs text-muted-foreground`,children:HG(BG(t,e),e)}),(0,W.jsx)(lk,{label:$.edit,icon:l_,onClick:a})]})]})]})}function CK(e,t){return[t!==`scout`&&t!==`researcher`&&!!e.instructions,e.mcpTools!==void 0,t!==`master`&&e.skills!==void 0].filter(Boolean).length}function wK(){return(0,W.jsxs)(`p`,{className:`flex min-h-[4.5rem] items-center gap-2 text-sm text-muted-foreground`,children:[(0,W.jsx)(Yp,{"aria-hidden":`true`,className:`size-4`}),`Effort `,(0,W.jsx)(`span`,{className:`capitalize`,children:`low`}),` (fixed for scouts)`]})}function TK({open:e,custom:t,onToggle:n}){return(0,W.jsxs)(`button`,{type:`button`,"aria-expanded":e,onClick:n,className:`-mr-1.5 flex min-h-8 shrink-0 items-center gap-1 rounded-md px-1.5 text-xs text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,children:[(0,W.jsx)(rm,{"aria-hidden":`true`,className:X(`size-3.5 transition-transform duration-200 ease-snap`,e&&`rotate-90`)}),`More`,t>0?(0,W.jsxs)(`span`,{className:`text-primary`,children:[`· `,t,` customised`]}):null]})}function EK(e,t){return t.startsWith(`panel:`)?e.lobby.panels[t.slice(6)]:e.lobby[t]}function DK({config:e,item:t,save:n}){let r=t.id.startsWith(`panel:`);return(0,W.jsx)(fK,{label:t.label,help:t.help,checked:EK(e,t.id),onChange:e=>{n(r?{lobby:{panels:{[t.id.slice(6)]:e}}}:{lobby:{[t.id]:e}})}})}function OK({config:e,save:t}){let n=e.workflow.gitIsolation;return(0,W.jsx)(rB,{prominent:!0,title:iG.workflow,children:(0,W.jsx)(IW,{children:(0,W.jsx)(FW,{label:xG,help:bG.find(e=>e.id===n)?.help??`enter cycles off, branch, worktree`,children:(0,W.jsx)(LW,{value:n,items:bG.map(e=>({value:e.id,label:e.label})),label:xG,onChange:e=>void t({workflow:{gitIsolation:e}})})})})})}var kK=e=>e?`${e}/`:CG.top;function AK(e){return e.split(/[\s,]+/).map(e=>e.trim()).filter(Boolean)}function jK({replaced:e}){let t=zO(`settings.linters`,{},[]),n=t.data?.linters;return(0,W.jsx)(FW,{label:CG.found,help:e?CG.foundReplaced:CG.foundHelp,children:n?n.length===0?(0,W.jsx)(`p`,{className:`break-words text-sm text-muted-foreground text-right`,children:CG.foundNone}):(0,W.jsx)(`ul`,{"aria-label":CG.found,className:X(`flex flex-col items-end gap-1.5`,e&&`opacity-60`),children:n.map(e=>(0,W.jsxs)(`li`,{className:`flex min-w-0 flex-wrap items-center gap-2 text-sm`,children:[(0,W.jsx)(`span`,{className:`min-w-0 break-words font-medium`,children:e.tool}),(0,W.jsx)(`span`,{className:`min-w-0 break-words text-xs text-muted-foreground`,children:kK(e.folder)}),(0,W.jsxs)(`span`,{title:e.installed?void 0:CG.missingHelp,className:X(`inline-flex shrink-0 items-center gap-1 text-xs`,e.installed?`text-success`:`text-warning`),children:[e.installed?(0,W.jsx)(lm,{"aria-hidden":`true`,className:`size-3.5`}):(0,W.jsx)(sm,{"aria-hidden":`true`,className:`size-3.5`}),e.installed?CG.installed:CG.missing]})]},`${e.tool}:${e.folder}`))}):(0,W.jsx)(`p`,{className:`break-words text-sm text-muted-foreground text-right`,children:t.error?t.error:`Looking…`})})}function MK({config:e,save:t}){let n=e.lint,r=n.mode===`off`,i=n.command.trim().length>0;return(0,W.jsxs)(rB,{prominent:!0,title:iG.lint,children:[(0,W.jsx)(`p`,{className:`max-w-3xl text-sm text-muted-foreground`,children:CG.intro}),(0,W.jsxs)(IW,{children:[(0,W.jsx)(FW,{label:CG.mode,help:SG.find(e=>e.id===n.mode)?.help,children:(0,W.jsx)(LW,{value:n.mode,items:SG.map(e=>({value:e.id,label:e.label})),label:CG.mode,onChange:e=>void t({lint:{mode:e}})})}),(0,W.jsxs)(`div`,{className:X(`flex flex-col divide-y divide-border [&>*]:py-3 [&>*:first-child]:pt-0 [&>*:last-child]:pb-0`,r&&`opacity-60`),"aria-disabled":r||void 0,children:[(0,W.jsx)(FW,{label:CG.command,help:CG.commandHelp,children:(0,W.jsx)(pK,{value:n.command,label:CG.command,placeholder:CG.commandPlaceholder,onSave:e=>void t({lint:{command:e}})})}),i?(0,W.jsx)(FW,{label:CG.extensions,help:CG.extensionsHelp,children:(0,W.jsx)(pK,{value:n.extensions.join(` `),label:CG.extensions,placeholder:CG.extensionsPlaceholder,onSave:e=>void t({lint:{extensions:AK(e)}})})}):null,(0,W.jsx)(FW,{label:CG.timeout,help:CG.timeoutHelp,children:(0,W.jsx)(mK,{value:n.timeoutMs,label:`Lint ${CG.timeout.toLowerCase()}`,onSave:e=>void t({lint:{timeoutMs:e}})})}),(0,W.jsx)(jK,{replaced:i})]})]})]})}function NK({config:e,save:t}){let n=e.lobby.web;return(0,W.jsx)(rB,{prominent:!0,title:iG.lobby,children:(0,W.jsxs)(IW,{children:[iK.map(n=>(0,W.jsx)(DK,{config:e,item:n,save:t},n.id)),(0,W.jsx)(FW,{label:uG,help:dG,children:(0,W.jsx)(LW,{value:String(e.lobby.maxPlanningRounds),items:fG.map(e=>({value:String(e),label:lK(e)})),label:uG,onChange:e=>void t({lobby:{maxPlanningRounds:Number(e)}})})}),(0,W.jsx)(FW,{label:pG,help:mG,children:(0,W.jsx)(LW,{value:String(e.lobby.splitPlanAbove),items:hG.map(e=>({value:String(e),label:uK(e)})),label:pG,onChange:e=>void t({lobby:{splitPlanAbove:Number(e)}})})}),(0,W.jsx)(FW,{label:gG,help:_G,children:(0,W.jsx)(gK,{value:n.port,onSave:e=>void t({lobby:{web:{port:e}}})})}),(0,W.jsx)(fK,{label:vG,help:yG,checked:n.openBrowser,onChange:e=>void t({lobby:{web:{openBrowser:e}}})})]})})}function PK({value:e,models:t,classifiers:n,onChange:r}){let[i,a]=(0,m.useState)(!1),[o,s]=(0,m.useState)(``),c=new Set([...n.map(e=>e.id),...t.map(e=>e.id)]),l=[{value:``,label:EG.engineJev,help:EG.engineJevHelp},...n.map(e=>({value:e.id,label:e.id,help:`${EG.engineClassifier}${e.label===e.id?``:` · ${e.label}`}`})),...t.map(e=>({value:e.id,label:e.id,help:`${EG.engineChat}${e.label&&e.label!==e.id?` · ${e.label}`:``}`})),...e&&!c.has(e)?[{value:e,label:e,help:tG}]:[],{value:$W,label:eG,help:tG}],u=t=>{if(t!==`__custom__`)return r(t);s(c.has(e)?``:e),a(!0)},d=()=>{let t=o.trim();a(!1),t!==e&&r(t)};return(0,W.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,W.jsx)(LW,{value:e,items:l,label:EG.engine,onChange:u}),i?(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-start gap-2`,children:[(0,W.jsx)(aW,{autoFocus:!0,value:o,placeholder:`provider/model`,"aria-label":`Classifier model id`,className:`min-w-0 flex-1`,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),d())}}),(0,W.jsx)(lk,{label:`Use this model`,icon:Zp,tone:`primary`,onClick:d})]}):null]})}function FK({config:e,models:t,classifiers:n,save:r}){let i=e.classifier,a=wG.find(e=>e.id===i.provider)?.label,o=!i.engine;return(0,W.jsx)(rB,{prominent:!0,title:iG.classifier,children:(0,W.jsxs)(IW,{children:[(0,W.jsx)(fK,{label:EG.enabled,help:EG.enabledHelp,checked:i.enabled,onChange:e=>void r({classifier:{enabled:e}})}),(0,W.jsx)(FW,{label:EG.engine,help:EG.engineHelp,children:(0,W.jsx)(PK,{value:i.engine,models:t,classifiers:n,onChange:e=>void r({classifier:{engine:e}})})}),o?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(FW,{label:EG.host,children:(0,W.jsx)(LW,{value:i.provider,items:wG.map(e=>({value:e.id,label:e.label})),label:EG.host,onChange:e=>void r({classifier:{provider:e}})})}),(0,W.jsx)(FW,{label:EG.model,help:EG.modelHelp,children:(0,W.jsx)(pK,{value:i.model,label:EG.model,placeholder:`the host's default`,onSave:e=>void r({classifier:{model:e}})})}),(0,W.jsx)(FW,{label:EG.key,help:EG.keyNote,children:(0,W.jsx)(`p`,{className:`break-words text-sm text-muted-foreground text-right`,children:a??i.provider})})]}):null,TG.map(e=>(0,W.jsx)(fK,{label:e.label,help:e.help,checked:i.features[e.id],onChange:t=>void r({classifier:{features:{[e.id]:t}}})},e.id)),(0,W.jsx)(FW,{label:EG.cheap,help:EG.cheapHelp,children:(0,W.jsx)(dK,{value:i.effort.cheapModel,models:t,label:EG.cheap,none:!0,onChange:e=>void r({classifier:{effort:{cheapModel:e}}})})})]})})}function IK(){let e=KU(),t=async e=>{if(!e)return JU();let t=await qU();t===`granted`?G.success(DG.notificationsOn):G.error(t===`unsupported`?DG.notificationsUnsupported:DG.notificationsBlocked)};return(0,W.jsx)(rB,{prominent:!0,title:iG.notifications,children:(0,W.jsx)(IW,{children:(0,W.jsx)(fK,{label:DG.notificationsLabel,help:DG.notificationsHelp,checked:e,onChange:e=>void t(e)})})})}function LK(){let{available:e,install:t}=y(),n=b(),r=x();return(0,W.jsx)(rB,{prominent:!0,title:iG.install,children:(0,W.jsxs)(IW,{children:[(0,W.jsx)(FW,{label:DG.installLabel,help:n?DG.installedNow:DG.installHelp,children:n?null:(0,W.jsx)(`div`,{className:`flex justify-end`,children:(0,W.jsx)(lk,{label:DG.installButton,icon:Fm,tone:`primary`,onClick:()=>e?void t().then(()=>G.success(DG.installDone)):G.warning(DG.installUnavailable)})})}),r.supported?(0,W.jsx)(FW,{label:DG.fullscreenLabel,help:DG.fullscreenHelp,children:(0,W.jsx)(`div`,{className:`flex justify-end`,children:(0,W.jsx)(lk,{label:r.on?DG.fullscreenOn:DG.fullscreenOff,icon:r.on?zh:Dh,pressed:r.on,onClick:()=>void r.toggle()})})}):null]})})}var RK=[`Agents`,`Harnesses`,`Tools & skills`,`Workflow`,`Lobby`,`Classifier`,`Appearance & notifications`],zK=e=>`settings-${e.split(` `)[0]}`;function BK({config:e,models:t,classifierModels:n=[],onConfig:r}){let[i,a]=(0,m.useState)(`Agents`),[o,s]=(0,m.useState)(`master`),c=e=>{s(e),a(`Tools & skills`)},l=zO(`settings.harnesses`,{},[]),u=JSON.stringify(e.harnesses),d=l.reload,f=(0,m.useRef)(u);(0,m.useEffect)(()=>{f.current!==u&&(f.current=u,d())},[u,d]);let p=l.data?.harnesses??[],h=(0,m.useRef)(Promise.resolve()),g=e=>{let t=async()=>{try{return r((await z(`settings.set`,{patch:e})).config),G.success(DG.saved),!0}catch(e){return G.error(e instanceof Error?e.message:`That did not work. Try again.`),!1}},n=h.current.then(t,t);return h.current=n,n};return(0,W.jsxs)(`div`,{className:`mx-auto flex w-full max-w-5xl flex-col gap-4 px-6 pt-6 pb-dock`,children:[(0,W.jsxs)(`header`,{className:`flex flex-wrap items-end justify-between gap-x-6 gap-y-3`,children:[(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight`,children:DG.title}),(0,W.jsx)(`p`,{className:`max-w-xl text-xs text-muted-foreground`,children:DG.intro})]}),(0,W.jsx)(`nav`,{"aria-label":`Settings sections`,className:`min-w-0 max-w-full`,children:(0,W.jsx)(fk,{as:`nav`,label:`Settings sections`,items:RK.map(e=>({id:e,label:e,controls:zK(e)})),value:i,onChange:a})})]}),(0,W.jsxs)(`div`,{id:zK(`Agents`),hidden:i!==`Agents`,"aria-hidden":i!==`Agents`,children:[(0,W.jsx)(`h2`,{className:`sr-only`,children:iG.agents}),(0,W.jsx)(`div`,{className:`grid grid-cols-2 items-start gap-3 lg:grid-cols-3`,children:JW.map(n=>(0,W.jsx)(SK,{kind:n,config:e,models:t,harnesses:p,save:g,onGrants:()=>c(n)},n))})]}),(0,W.jsx)(`div`,{id:zK(`Harnesses`),hidden:i!==`Harnesses`,"aria-hidden":i!==`Harnesses`,children:(0,W.jsx)(nK,{config:e,statuses:l.data?.harnesses,...l.error?{error:l.error}:{},save:g})}),(0,W.jsx)(`div`,{id:zK(`Tools & skills`),hidden:i!==`Tools & skills`,"aria-hidden":i!==`Tools & skills`,children:(0,W.jsx)(KG,{config:e,save:g,agent:o,onAgent:s})}),(0,W.jsx)(`div`,{id:zK(`Workflow`),hidden:i!==`Workflow`,"aria-hidden":i!==`Workflow`,children:(0,W.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,W.jsx)(OK,{config:e,save:g}),(0,W.jsx)(MK,{config:e,save:g})]})}),(0,W.jsx)(`div`,{id:zK(`Lobby`),hidden:i!==`Lobby`,"aria-hidden":i!==`Lobby`,children:(0,W.jsx)(NK,{config:e,save:g})}),(0,W.jsx)(`div`,{id:zK(`Classifier`),hidden:i!==`Classifier`,"aria-hidden":i!==`Classifier`,children:(0,W.jsx)(FK,{config:e,models:t,classifiers:n,save:g})}),(0,W.jsx)(`div`,{id:zK(`Appearance & notifications`),hidden:i!==`Appearance & notifications`,"aria-hidden":i!==`Appearance & notifications`,children:(0,W.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,W.jsx)(LG,{}),(0,W.jsx)(IK,{}),(0,W.jsx)(LK,{})]})})]})}function VK(){return(0,W.jsx)(`div`,{className:`mx-auto flex w-full max-w-5xl flex-col gap-4 px-8 pt-8 pb-dock`,role:`status`,"aria-label":DG.loading,children:[0,1,2,3].map(e=>(0,W.jsx)(Sk,{shape:`card`,className:`h-48`},e))})}function HK(){let e=zO(`settings.get`,{},[`status`]),[t,n]=(0,m.useState)(),r=(0,m.useRef)(0),i=(0,m.useCallback)(e=>{r.current=performance.now(),n(e)},[]);return(0,m.useEffect)(()=>{e.data&&e.requestedAt>r.current&&n(e.data.config)},[e.data,e.requestedAt]),!t&&e.error?(0,W.jsx)(NO,{message:`${DG.loadFailed} ${e.error}`,onRetry:e.reload}):t?(0,W.jsx)(BK,{config:t,models:e.data?.models??[],classifierModels:e.data?.classifierModels??[],onConfig:i}):(0,W.jsx)(VK,{})}function UK(){let e=globalThis.DOMParser;if(!e)throw Error(`DOMParser is unavailable`);return new e}var WK=`default-src 'none'; script-src 'none'; style-src 'unsafe-inline'; img-src 'none'; font-src 'none'; connect-src 'none'; media-src 'none'; frame-src 'none'; object-src 'none'; form-action 'none'; base-uri 'none'`,GK=new Set(`div span p br hr h1 h2 h3 h4 h5 h6 section article header footer main aside nav ul ol li dl dt dd strong em b i u s small sub sup blockquote pre code table thead tbody tfoot tr th td caption colgroup col figure figcaption style button input label select option optgroup textarea details summary fieldset legend progress meter output kbd mark`.split(` `)),KK=new Set(`class id title role aria-label aria-hidden aria-expanded aria-selected aria-checked aria-pressed aria-current colspan rowspan scope type name value placeholder for checked selected disabled readonly open min max step rows cols tabindex`.split(` `)),qK=new Set(`text search email tel url number password checkbox radio range color date time month week button reset submit`.split(` `)),JK=`button,input,select,textarea,summary,label,[role=button],[role=tab]{transition:background-color .18s ease,color .18s ease,border-color .18s ease,box-shadow .18s ease,transform .18s ease,opacity .18s ease}button,summary,label,select,[role=button],[role=tab],input[type=checkbox],input[type=radio],input[type=range]{cursor:pointer}button:active,[role=button]:active{transform:scale(.97)}details[open]>:not(summary){animation:mockup-in .22s ease-out}@keyframes mockup-in{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}`;function YK(e){if(!e||typeof e!=`object`)return;let t=e;if(!(typeof t.html!=`string`||t.html.length>1e5)&&!(t.css!==void 0&&(typeof t.css!=`string`||t.css.length>12e4)))return{html:t.html,...typeof t.css==`string`?{css:t.css}:{}}}function XK(e){let t=e.replace(/\/\*[\s\S]*?\*\//g,``);return/\\|@import|url\s*\(|image-set\s*\(|expression\s*\(|behavior\s*:|-moz-binding/i.test(t)?``:t.replace(/<\/?style/gi,``)}function ZK(e){if(!GK.has(e.localName)||e.namespaceURI!==`http://www.w3.org/1999/xhtml`){e.remove();return}for(let t of[...e.attributes])t.name===`style`?e.setAttribute(`style`,XK(t.value)):KK.has(t.name)||e.removeAttribute(t.name);if(e.localName===`input`){let t=[...e.attributes].find(e=>e.name===`type`)?.value.toLowerCase();t!==void 0&&!qK.has(t)&&e.setAttribute(`type`,`text`)}e.localName===`style`&&(e.textContent=XK(e.textContent??``));for(let t of[...e.children])ZK(t)}function QK(e,t){try{return $K(e,t??UK())}catch{return`<!doctype html><html><head><meta http-equiv="Content-Security-Policy" content="${WK}"><meta name="referrer" content="no-referrer"></head><body><p role="status">Static mockup unavailable. The preview could not be safely rendered.</p></body></html>`}}function $K(e,t){let n=t.parseFromString(e.html,`text/html`);for(let e of[...n.head.children,...n.body.children])ZK(e);let r=[...n.head.querySelectorAll(`style`)].map(e=>e.outerHTML).join(``);return`<!doctype html><html><head><meta http-equiv="Content-Security-Policy" content="${WK}"><meta name="referrer" content="no-referrer"><style>body{margin:16px;overflow-wrap:anywhere}*{box-sizing:border-box}${JK}${XK(e.css??``).replace(/</g,`\\3c `)}</style>${r}</head><body>${n.body.innerHTML}</body></html>`}function eq({preview:e,label:t,className:n,frameWidth:r,minWidth:i,onOpen:a}){let o=(0,m.useMemo)(()=>QK(e),[e]),s=(0,m.useRef)(null),[c,l]=(0,m.useState)();if((0,m.useLayoutEffect)(()=>{let e=s.current;if(!r&&!i||!e)return;let t=()=>l({width:e.clientWidth,height:e.clientHeight});if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[r,i]),!r&&!i)return(0,W.jsx)(`iframe`,{title:`Static mockup: ${t}`,sandbox:``,referrerPolicy:`no-referrer`,srcDoc:o,className:X(`h-80 w-full rounded-lg border bg-background`,n)});let u=r??Math.max(c?.width??0,i??0),d=c&&c.width>0&&u>0?Math.min(1,c.width/u):1;return(0,W.jsxs)(`div`,{ref:s,className:X(`group/mock relative h-80 w-full max-w-full overflow-hidden rounded-lg border bg-background`,n),children:[(0,W.jsx)(`iframe`,{title:`Static mockup: ${t}`,sandbox:``,referrerPolicy:`no-referrer`,srcDoc:o,className:`absolute top-0 left-0 origin-top-left border-0`,style:{width:u||`100%`,height:c?c.height/d:`100%`,transform:`scale(${d})`}}),a?(0,W.jsx)(`button`,{type:`button`,"data-compact":``,onClick:a,"aria-label":`Expand the mockup: ${t}`,className:`group/open absolute right-2 bottom-2 rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-md border border-border bg-card/90 px-1.5 py-0.5 text-[0.6875rem] font-medium text-muted-foreground opacity-60 shadow-sm backdrop-blur-sm transition-opacity group-hover/mock:opacity-100 group-focus-visible/open:opacity-100`,children:[(0,W.jsx)(Th,{"aria-hidden":`true`,className:`size-3`}),`Expand`]})}):null]})}var tq=/\s*\(recommended\)\s*$/i,nq=1024,rq=e=>e.replace(tq,``);function iq(e){return!!(e&&(e.htmlPreview||e.image||e.preview))}function aq({option:e}){let t=rq(e.label);return iq(e)?(0,W.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-3`,children:[e.htmlPreview?(0,W.jsx)(eq,{preview:e.htmlPreview,label:t,minWidth:nq,className:`h-auto min-h-[18rem] flex-1`}):null,e.image?(0,W.jsx)(`img`,{src:L(e.image),alt:`Mockup: ${t}`,className:`min-h-0 w-full flex-1 rounded-lg border bg-background object-contain`}):null,e.preview?(0,W.jsx)(eB,{text:e.preview,className:X(`overflow-auto rounded-lg border bg-background p-4 text-sm`,!e.htmlPreview&&!e.image&&`flex-1`)}):null]}):(0,W.jsx)(`p`,{className:`grid h-full place-items-center p-6 text-sm text-muted-foreground`,children:`No mockup for this option.`})}function oq({options:e,start:t,title:n,picked:r=[],multi:i=!1,onChoose:a,onClose:o,onIndex:s}){let c=Tf(),l=(0,m.useRef)(null),u=(0,m.useRef)(null),[d,f]=(0,m.useState)(()=>Math.min(Math.max(0,t),e.length-1)),p=e[d],h=e.length-1;(0,m.useEffect)(()=>s?.(d),[d,s]),(0,m.useLayoutEffect)(()=>{let e=l.current;e&&(e.scrollLeft=d*e.clientWidth),u.current?.focus()},[]);let g=(0,m.useCallback)(e=>{let t=Math.min(Math.max(0,e),h),n=l.current;f(t),n?.scrollTo({left:t*n.clientWidth,behavior:c?`auto`:`smooth`})},[h,c]);(0,m.useEffect)(()=>{let e=l.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>{e.scrollLeft=d*e.clientWidth});return t.observe(e),()=>t.disconnect()},[d]);function _(){let e=l.current;if(!e||e.clientWidth===0)return;let t=Math.round(e.scrollLeft/e.clientWidth);t!==d&&t>=0&&t<=h&&f(t)}function v(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let n=t.target;if(n.closest(`input, textarea, [contenteditable='true']`))return;let r={ArrowLeft:-1,ArrowRight:1,PageUp:-1,PageDown:1}[t.key];if(r){t.preventDefault(),g(d+r);return}if(t.key===`Home`||t.key===`End`){t.preventDefault(),g(t.key===`Home`?0:h);return}let i=Number(t.key);if(Number.isInteger(i)&&i>=1&&i<=e.length){t.preventDefault(),g(i-1);return}t.key===`Enter`&&a&&!(n instanceof HTMLButtonElement)&&(t.preventDefault(),a(d))}let y=r.includes(d);return(0,W.jsxs)(`div`,{ref:u,tabIndex:-1,"data-autofocus":``,onKeyDown:v,className:`mockup-viewer flex h-full min-h-0 flex-col outline-none`,role:`region`,"aria-label":`Mockups: ${n}`,"aria-roledescription":`carousel`,children:[(0,W.jsxs)(`header`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2 border-b border-border px-4 py-3`,children:[(0,W.jsx)(Z,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Back to the question`,title:`Back · Esc`,onClick:()=>o(d),children:(0,W.jsx)(Lh,{"aria-hidden":`true`})}),(0,W.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,children:n}),(0,W.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,"aria-live":`polite`,children:[d+1,` of `,e.length]}),(0,W.jsx)(`div`,{role:`tablist`,"aria-label":`Options`,className:`flex w-full flex-wrap gap-1.5 sm:w-auto`,children:e.map((e,t)=>(0,W.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":t===d,"aria-controls":`mockup-slide-${t}`,"data-compact":``,onClick:()=>g(t),className:X(`inline-flex h-7 max-w-48 items-center gap-1 rounded-lg border px-2.5 text-xs font-medium transition-colors outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,t===d?`border-primary/50 bg-accent text-foreground`:`border-border text-muted-foreground hover:bg-muted hover:text-foreground`),children:[(0,W.jsx)(`span`,{className:`tabular-nums text-muted-foreground`,children:t+1}),(0,W.jsx)(`span`,{className:`truncate`,children:rq(e.label)}),r.includes(t)?(0,W.jsx)(Zp,{"aria-label":`picked`,className:`size-3 text-primary`}):null]},t))})]}),(0,W.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[(0,W.jsx)(`div`,{ref:l,onScroll:_,className:`mockup-track flex h-full snap-x snap-mandatory overflow-x-auto overflow-y-hidden overscroll-x-contain`,children:e.map((t,n)=>(0,W.jsxs)(`section`,{id:`mockup-slide-${n}`,role:`tabpanel`,"aria-roledescription":`slide`,"aria-label":`${n+1} of ${e.length}: ${rq(t.label)}`,"aria-hidden":n!==d,className:`flex h-full w-full shrink-0 snap-center snap-always flex-col gap-2 overflow-y-hidden px-4 py-4 sm:px-14`,children:[(0,W.jsxs)(`div`,{className:`flex items-baseline gap-2 text-sm`,children:[(0,W.jsxs)(`span`,{className:`text-muted-foreground tabular-nums`,children:[n+1,`.`]}),(0,W.jsx)(`span`,{className:`font-medium`,children:rq(t.label)}),tq.test(t.label)?(0,W.jsx)(`span`,{className:`text-xs font-medium text-primary`,children:`Recommended`}):null,r.includes(n)?(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs text-primary`,children:[(0,W.jsx)(Zp,{"aria-hidden":`true`,className:`size-3`}),`picked`]}):null]}),t.description?(0,W.jsx)(eB,{text:t.description,className:`text-sm text-muted-foreground`}):null,(0,W.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,W.jsx)(aq,{option:t})})]},n))}),d>0?(0,W.jsx)(Z,{type:`button`,variant:`outline`,size:`icon`,"aria-label":`Previous option`,title:`Previous · ←`,onClick:()=>g(d-1),className:`absolute top-1/2 left-2 -translate-y-1/2 rounded-full`,children:(0,W.jsx)(tm,{"aria-hidden":`true`})}):null,d<h?(0,W.jsx)(Z,{type:`button`,variant:`outline`,size:`icon`,"aria-label":`Next option`,title:`Next · →`,onClick:()=>g(d+1),className:`absolute top-1/2 right-2 -translate-y-1/2 rounded-full`,children:(0,W.jsx)(rm,{"aria-hidden":`true`})}):null]}),(0,W.jsxs)(`footer`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-2 border-t border-border px-4 py-3`,children:[(0,W.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs text-muted-foreground`,children:[(0,W.jsx)(ZD,{chord:`←→`,children:`option`}),a?(0,W.jsx)(ZD,{chord:`Enter`,children:i?y?`unpick`:`pick`:`choose`}):null,(0,W.jsx)(ZD,{chord:`Esc`,children:`back`})]}),a&&p?(0,W.jsxs)(Z,{type:`button`,onClick:()=>a(d),className:`max-w-full`,children:[i&&y?`Unpick`:i?`Pick`:`Choose`,(0,W.jsx)(`span`,{className:`truncate`,children:rq(p.label)})]}):null]})]})}function sq(e,t,n){e.nativeEvent.isComposing||(e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),n()),e.key===`Enter`&&e.ctrlKey&&(e.preventDefault(),e.stopPropagation(),t()))}function cq({text:e,disabled:t=!1,onSave:n,onCancel:r}){let[i,a]=(0,m.useState)(e),[o,s]=(0,m.useState)(!1),[c,l]=(0,m.useState)(``),u=(0,m.useRef)(null);(0,m.useEffect)(()=>{u.current?.focus({preventScroll:!0}),u.current?.select()},[]);let d=async()=>{if(!(t||o||!i.trim())){s(!0),l(``);try{await n(i.trim()),r()}catch(e){l(e instanceof Error?e.message:String(e)),s(!1)}}};return(0,W.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,onKeyDown:e=>sq(e,()=>void d(),()=>{o||r()}),children:[(0,W.jsxs)(`label`,{className:`text-sm`,children:[`Edit message`,(0,W.jsx)(Ak,{ref:u,value:i,onChange:e=>a(e.target.value),disabled:o,className:`mt-2 max-h-[40vh] min-h-24`})]}),c?(0,W.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:[`Could not save. `,c]}):null,(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,W.jsx)(Z,{size:`sm`,onClick:()=>void d(),disabled:t||o||!i.trim(),children:o?`Saving…`:`Save`}),(0,W.jsx)(Z,{size:`sm`,variant:`ghost`,disabled:o,onClick:r,children:`Cancel`})]})]})}var lq=1200;function uq({question:e}){let[t,n]=(0,m.useState)(),r=oO(t!==void 0,aO.sheet),i=e.options.flatMap((e,t)=>e.mockup?[{option:e,index:t,mockup:e.mockup}]:[]);if(i.length===0)return null;let a=e.options.map(e=>({label:e.label,description:e.description,...e.mockup?{htmlPreview:e.mockup}:{}}));return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`ul`,{"aria-label":`Mockups`,className:`grid grid-cols-3 gap-2`,children:i.map(({option:e,index:t,mockup:r})=>(0,W.jsxs)(`li`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,W.jsx)(eq,{preview:r,label:rq(e.label),frameWidth:lq,onOpen:()=>n(t),className:`aspect-[3/2] h-auto`}),(0,W.jsxs)(`span`,{className:`truncate text-xs text-muted-foreground`,children:[(0,W.jsxs)(`span`,{className:`tabular-nums`,children:[t+1,`.`]}),` `,rq(e.label)]})]},t))}),(0,W.jsx)(QD,{open:t!==void 0&&r,onOpenChange:e=>{e||n(void 0)},label:`Mockups: ${e.text}`,className:`h-[min(92svh,60rem)] max-h-[min(92svh,60rem)] max-w-6xl`,children:t===void 0?null:(0,W.jsx)(oq,{options:a,start:t,title:e.text,onClose:()=>n(void 0)})})]})}function dq({questions:e}){return(0,W.jsx)(`ol`,{className:`mt-1 flex flex-col gap-2`,children:e.map((e,t)=>(0,W.jsxs)(`li`,{className:`card-flat flex min-w-0 flex-col gap-2 rounded-xl border p-3 text-sm`,style:{"--orb":KV(e.from)},children:[(0,W.jsxs)(`p`,{className:`flex items-start gap-2`,children:[(0,W.jsxs)(`span`,{className:`mt-px inline-flex shrink-0 items-center gap-1 rounded-full bg-[color-mix(in_oklab,var(--orb)_12%,transparent)] px-2 py-0.5 text-xs font-medium text-[color-mix(in_oklab,var(--orb)_85%,var(--foreground))]`,children:[(0,W.jsx)(BV,{source:e.from,className:`size-3`}),UV(e.from)]}),(0,W.jsxs)(`span`,{className:`min-w-0`,children:[(0,W.jsxs)(`span`,{className:`sr-only`,children:[`Question `,t+1,`: `]}),e.text]})]}),e.options.length?(0,W.jsx)(`ul`,{"aria-label":`Options`,className:`flex flex-wrap gap-1.5`,children:e.options.map(e=>(0,W.jsxs)(`li`,{className:`rounded-lg border border-border bg-muted/60 px-2 py-1 text-xs text-muted-foreground`,children:[(0,W.jsx)(`span`,{className:`font-medium text-foreground`,children:e.label}),e.description?` — ${e.description}`:``]},e.label))}):null,(0,W.jsx)(uq,{question:e})]},t))})}function fq({message:e}){let t=e.decided??[];return t.length?(0,W.jsx)(`ul`,{"aria-label":`Settled for you`,className:`mt-1 flex flex-col gap-1`,children:t.map((e,t)=>(0,W.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2 text-sm`,title:`Settled by the classifier, ${Math.round(e.probability*100)}% sure. Comment on the plan to overrule it.`,children:[(0,W.jsx)(Zp,{"aria-hidden":`true`,className:`mt-[0.1875rem] size-3.5 shrink-0 text-success`}),(0,W.jsxs)(`span`,{className:`min-w-0`,children:[(0,W.jsx)(`span`,{className:X(`font-medium`,WV(e.from)),children:UV(e.from)}),` `,(0,W.jsx)(`span`,{className:`text-muted-foreground`,children:e.question}),` `,(0,W.jsx)(`span`,{className:`font-medium`,children:e.answer}),(0,W.jsxs)(`span`,{className:`decided-hint`,children:[`auto · `,Math.round(e.probability*100),`% · comment to overrule`]})]})]},t))}):null}function pq({message:e,index:t,busy:n,readOnly:r}){let[i,a]=(0,m.useState)(!1),[o,s]=(0,m.useState)(),c=o&&(o.editedAt??0)>(e.editedAt??0)?o:e,l=n||c!==e,u=async n=>{let r=await z(`planner.editMessage`,{messageIndex:t,at:e.at,text:n});s(r.message)},d=!r&&!e.settled?.length&&!i?(0,W.jsxs)(`button`,{type:`button`,disabled:l,onClick:()=>a(!0),className:`chat-action`,children:[(0,W.jsx)(rg,{"aria-hidden":`true`,className:`size-3`}),`Edit`]}):null;return(0,W.jsx)(ZV,{time:e.at>0?Mk(e.at):void 0,head:!0,note:c.editedAt?`(edited)`:void 0,actions:d,children:i?(0,W.jsx)(cq,{text:c.text,disabled:n,onSave:u,onCancel:()=>a(!1)}):(0,W.jsx)(eB,{text:c.text})})}function mq({message:e,index:t,busy:n,readOnly:r}){if(e.role===`you`)return(0,W.jsx)(pq,{message:e,index:t,busy:n,readOnly:r});let i=e.questions??[];return(0,W.jsxs)(XV,{source:`PLANNER`,name:`Panel`,time:e.at>0?Mk(e.at):void 0,head:!0,bubble:i.length===0,aside:i.length?`${i.length} question${i.length===1?``:`s`}`:void 0,children:[i.length>0?(0,W.jsx)(dq,{questions:i}):(0,W.jsx)(eB,{text:e.text}),(0,W.jsx)(fq,{message:e})]})}function hq({messages:e,seed:t,busy:n=!1,readOnly:r=!1}){return(0,W.jsxs)(`div`,{className:`chat-column`,role:`log`,"aria-label":`Panel conversation`,children:[t?(0,W.jsx)(QV,{children:t}):null,e.map((e,t)=>(0,W.jsx)(mq,{message:e,index:t,busy:n,readOnly:r},`${e.at}-${t}`)),n?(0,W.jsx)(XV,{source:`PLANNER`,name:`Panel`,head:!0,live:!0,waiting:!0,aside:`the panel is thinking`}):null]})}var gq=`ORACLE`,_q=`No draft yet.`,vq=`The draft appears after the panel's first round.`,yq=`What each seat needs`,bq=[`backend`,`designer`,`qa`,`researcher`],xq={backend:`DEV`,designer:`DESIGN`,qa:`QA`,researcher:`RESEARCH`},Sq=`Describe a task in the box below. The panel asks what it needs to know, round by round, until the plan is clear.`,Cq={ORACLE:`Chairs the panel, and settles the last round alone.`,DEV:`Code, data and the APIs it touches.`,DESIGN:`Screens, flows and the words on them.`,QA:`Tests, edge cases and what could break.`,RESEARCH:`Prior art, docs and sources.`},wq=[{title:`Describe it`,text:`Say what you want in the box below.`},{title:`The panel asks`,text:`Each seat asks what it needs to know.`},{title:`A draft forms`,text:`Answer, comment on lines, go another round.`},{title:`Save the plan`,text:`Keep it, or start it as a task.`}];function Tq(e){let t=e.filter(e=>e.member);return`${t.filter(e=>e.seated).length} of ${t.length} seated`}function Eq(e,t=0){return t<=0?`round ${e}`:e>t?`round ${e} · past the limit, revising`:e===t?`final round ${e}/${t}`:`round ${e}/${t}`}function Dq(e,t){return`${e} ${t}${e===1?``:`s`}`}function Oq(e){return e.round===0&&e.messages.length===0&&!e.busy}function kq(e){let t=e.members.find(e=>e.status===`failed`);if(t)return(t.error??`${xq[t.member]} failed`).split(`
98
- `)[0]}function Aq(e){let t=[],n=kq(e);return e.busy?t.push(Eq(e.round,e.limit)):n?t.push(`${n} — Retry runs the round again`):e.questions.length>0&&t.push(`${Dq(e.questions.length,`question`)} waiting`),!e.busy&&e.round>0&&t.push(Eq(e.round,e.limit)),!e.busy&&e.limit>0&&e.round+1===e.limit&&t.push(`the next round is the last: the oracle settles the rest`),t}function jq(e,t){let n=xq[e],r=t.seats.includes(e),i=t.members.find(t=>t.member===e),a={member:e,label:n,seated:r,working:!1};if(!r)return{...a,text:`off`};if(i?.status===`thinking`)return{...a,working:!0,text:i.step??`thinking`};if(i?.status===`failed`)return{...a,text:`failed — Retry`};if(!i)return{...a,text:`·`};if(i.reply?.status===`ready`)return{...a,text:`ready`};let o=t.questions.filter(e=>e.from===n).length;return{...a,text:o===0?`done`:Dq(o,`question`)}}function Mq(e){let t=e.questions.filter(e=>e.from===gq).length;return[{label:gq,seated:!0,working:e.busy,text:e.busy?`chairing`:t?Dq(t,`question`):`·`},...bq.map(t=>jq(t,e))]}function Nq({cell:e,intro:t}){let n=t?e.member?e.seated?`seated`:`not seated`:`chairs`:e.text;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`span`,{className:X(`inline-flex items-center gap-1 font-medium`,e.seated?WV(e.label):`text-muted-foreground`),children:[(0,W.jsx)(BV,{source:e.label,className:`size-3`}),UV(e.label)]}),e.working&&!t?(0,W.jsx)(DO,{className:`size-3`,"aria-hidden":`true`}):null,n===`·`?null:(0,W.jsx)(`span`,{className:`text-muted-foreground`,children:n})]})}function Pq({cell:e,intro:t,onToggled:n}){let{member:r}=e,i=`roster-chip inline-flex h-7 items-center gap-1.5 rounded-full border px-2.5 text-xs whitespace-nowrap`;if(!r)return(0,W.jsx)(`li`,{className:X(i,`border-transparent bg-muted`),children:(0,W.jsx)(Nq,{cell:e,intro:t})});let a=async()=>{await K(`planner.toggleSeat`,{member:r})&&n()};return(0,W.jsx)(`li`,{children:(0,W.jsxs)(`label`,{className:X(i,`cursor-pointer pl-1.5 transition-colors`,e.seated?`border-border bg-card hover:bg-muted`:`border-dashed border-border text-muted-foreground hover:bg-muted`),children:[(0,W.jsx)(RG,{checked:e.seated,onCheckedChange:()=>void a(),"aria-label":`${UV(e.label)} sits on the panel`,className:`size-3.5 rounded-[4px] [&_svg]:size-2.5`}),(0,W.jsx)(Nq,{cell:e,intro:t})]})})}function Fq({cells:e,intro:t,onToggled:n,className:r}){return(0,W.jsx)(`ul`,{"aria-label":`Panel`,className:X(`flex flex-wrap items-center gap-1.5`,r),children:e.map(e=>(0,W.jsx)(Pq,{cell:e,intro:t,onToggled:n},e.label))})}function Iq({cell:e,onToggled:t}){let{member:n}=e,r=UV(e.label),i=X(`flex h-full flex-col gap-2 rounded-xl border p-3.5 transition-[background-color,border-color,box-shadow]`,e.seated?`border-[color-mix(in_oklab,var(--orb)_26%,var(--border))] bg-[color-mix(in_oklab,var(--orb)_5%,var(--card))] shadow-card`:`border-dashed border-input bg-transparent`),a=(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,W.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,W.jsx)(`span`,{"aria-hidden":`true`,className:X(`grid size-6 place-items-center rounded-lg bg-[color-mix(in_oklab,var(--orb)_14%,transparent)] text-[color-mix(in_oklab,var(--orb)_85%,var(--foreground))]`,!e.seated&&`opacity-50 grayscale`),children:(0,W.jsx)(BV,{source:e.label,className:`size-3.5`})}),(0,W.jsx)(`span`,{className:X(`truncate text-sm font-semibold`,e.seated?WV(e.label):`text-muted-foreground`),children:r})]}),n?(0,W.jsx)(RG,{checked:e.seated,onCheckedChange:()=>void Lq(n,t),"aria-label":`${r} sits on the panel`}):null]}),(0,W.jsx)(`span`,{className:`text-xs leading-relaxed text-muted-foreground`,children:Cq[e.label]}),(0,W.jsx)(`span`,{className:X(`mt-auto text-xs font-medium`,e.seated?`text-foreground`:`text-muted-foreground`),children:n?e.seated?`seated`:`sits this one out`:`always chairs`})]}),o={"--orb":KV(e.label)};return n?(0,W.jsx)(`li`,{style:o,children:(0,W.jsx)(`label`,{className:X(i,`cursor-pointer`,e.seated?`hover:shadow-[0_0_0_3px_color-mix(in_oklab,var(--orb)_10%,transparent)]`:`hover:bg-muted`),children:a})}):(0,W.jsx)(`li`,{style:o,children:(0,W.jsx)(`div`,{className:i,children:a})})}async function Lq(e,t){await K(`planner.toggleSeat`,{member:e})&&t()}function Rq({cells:e,onToggled:t}){return(0,W.jsx)(`ul`,{"aria-label":`Panel`,className:`grid grid-cols-1 gap-3 @lg:grid-cols-2 @4xl:grid-cols-5`,children:e.map(e=>(0,W.jsx)(Iq,{cell:e,onToggled:t},e.label))})}function zq({snap:e}){let t=Aq(e),n=!e.busy&&kq(e)!==void 0;return(0,W.jsxs)(`p`,{role:`status`,className:n?`inline-flex items-center gap-2 text-sm text-destructive`:`inline-flex items-center gap-2 text-sm text-muted-foreground`,children:[e.busy?(0,W.jsx)(DO,{className:`size-3.5`,"aria-hidden":`true`}):null,t.join(` · `)]})}function Bq({onOpen:e}){let t=(0,m.useRef)(null);return sk(`v`,()=>t.current?.click()),(0,W.jsxs)(`button`,{ref:t,type:`button`,"aria-haspopup":`dialog`,"aria-keyshortcuts":`V`,onClick:e,className:`plan-link group`,children:[`View plan`,(0,W.jsx)(rm,{"aria-hidden":`true`,className:`size-3.5 transition-transform duration-150 group-hover:translate-x-0.5 motion-reduce:transition-none`}),(0,W.jsx)(XD,{chord:`V`,className:`kbd-hint ml-1`})]})}function Vq({iconOnly:e}){return(0,W.jsx)(lk,{label:`Previous plans`,text:`Previous`,icon:pg,shortcut:`H`,iconOnly:e,onClick:()=>yO(vO(`plan`,`previous`))})}function Hq({snap:e,onDone:t}){let n=LO(`status`).data?.keys.find(e=>e.action===`savePlan`)?.label,r=e=>async()=>{await K(e,{})&&t()};return(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1 @min-[68rem]:shrink-0`,children:[e.questions.length>0&&!e.busy?(0,W.jsx)(lk,{label:`Answer questions`,icon:kh,tone:`primary`,shortcut:`A`,onClick:()=>void r(`planner.answer`)()}):null,e.retryable?(0,W.jsx)(lk,{label:`Retry`,icon:_g,shortcut:`R`,onClick:()=>void r(`planner.retry`)()}):null,(0,W.jsx)(Vq,{}),(0,W.jsx)(lk,{"data-plan-save":!0,label:`Save the plan`,text:`Save`,icon:Cg,shortcut:n??`Ctrl+S`,disabled:!e.draft||e.busy,onClick:()=>void r(`planner.save`)()}),(0,W.jsx)(Gk,{icon:qm,label:`New plan`,shortcut:`N`,title:`Start a new plan?`,description:`The conversation and the draft are left behind. Saved plans are not touched.`,confirmLabel:`New plan`,onConfirm:()=>void K(`planner.new`,{}).then(t)})]})}function Uq({snap:e,onDone:t,onViewPlan:n}){return(0,W.jsxs)(`header`,{className:`@container flex shrink-0 flex-col gap-2.5 border-b border-border px-5 pt-3 pb-3`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-baseline gap-x-3 gap-y-1`,children:[(0,W.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight`,children:`Planning`}),(0,W.jsx)(zq,{snap:e}),e.draft?(0,W.jsx)(Bq,{onOpen:n}):null]}),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-2.5 @min-[68rem]:flex-nowrap`,children:[(0,W.jsx)(Fq,{cells:Mq(e),intro:!1,onToggled:t,className:`order-last basis-full @min-[68rem]:order-none @min-[68rem]:min-w-0 @min-[68rem]:basis-auto`}),(0,W.jsx)(Hq,{snap:e,onDone:t})]})]})}function Wq(e){let t=!1;return e.split(`
99
- `).map(e=>{let n=e.trimStart().startsWith("```");return n&&(t=!t),{text:e,fenced:t||n}})}function Gq({notes:e}){return(0,W.jsx)(W.Fragment,{children:e.map((e,t)=>(0,W.jsx)(`p`,{className:`ml-6 rounded-lg border border-primary/15 bg-accent px-3 py-1.5 text-sm text-foreground italic`,children:e},t))})}var Kq=[],qq=(0,m.memo)(function({row:e,index:t,notes:n,form:r,onComment:i}){let a=e.text.trim(),o=()=>i(t);return(0,W.jsxs)(`li`,{"data-line":t,className:X(`group/line`,!r&&`[contain-intrinsic-size:auto_2.75rem] [content-visibility:auto]`),children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 items-start gap-1`,children:[(0,W.jsx)(`span`,{className:`flex w-4 shrink-0 justify-center pt-3.5`,"aria-hidden":`true`,children:n.length>0?(0,W.jsx)(`span`,{className:`size-2 rounded-full bg-primary`}):null}),(0,W.jsx)(`div`,{className:X(`min-w-0 flex-1 cursor-pointer rounded-lg px-2 py-1.5 transition-colors hover:bg-muted`,r&&`bg-muted`,e.fenced&&`font-mono text-sm whitespace-pre-wrap break-words`),onClick:e=>!e.target.closest(`a`)&&o(),children:e.fenced?e.text:(0,W.jsx)(eB,{text:e.text})}),(0,W.jsx)(Z,{type:`button`,variant:`ghost`,size:`icon`,className:`shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover/line:opacity-100 focus-visible:opacity-100 [@media(hover:none)]:opacity-100`,"aria-label":`Comment on this line: ${a}`,onClick:o,children:(0,W.jsx)(jh,{"aria-hidden":`true`})})]}),(0,W.jsx)(Gq,{notes:n}),r]})});function Jq({draft:e,comments:t,commenting:n,form:r,onComment:i}){let a=(0,m.useMemo)(()=>Wq(e),[e]),o=bz(a.length);return(0,W.jsx)(`ul`,{className:`flex flex-col`,"aria-label":`Draft plan lines`,children:a.slice(0,o).map((e,a)=>e.text.trim()?(0,W.jsx)(qq,{row:e,index:a,notes:t.get(e.text.trim())??Kq,form:a===n?r:void 0,onComment:i},a):(0,W.jsx)(`li`,{"aria-hidden":`true`,className:`h-2`},a))})}function Yq({notes:e}){return e.length===0?null:(0,W.jsx)(rB,{title:yq,children:(0,W.jsx)(`dl`,{className:`flex flex-col gap-2 text-sm`,children:e.map((e,t)=>(0,W.jsxs)(`div`,{className:`flex min-w-0 gap-3`,children:[(0,W.jsx)(`dt`,{className:X(`w-20 shrink-0 font-medium`,WV(e.from)),children:UV(e.from)}),(0,W.jsx)(`dd`,{className:`min-w-0 flex-1`,children:(0,W.jsx)(eB,{text:e.text})})]},t))})})}function Xq({line:e,onCancel:t,onSent:n}){let r=(0,m.useRef)(null);return(0,m.useEffect)(()=>{let e=r.current?.querySelector(`textarea`);e?.focus(),e?.scrollIntoView({block:`nearest`})},[]),(0,W.jsxs)(`div`,{ref:r,role:`group`,"aria-label":`Comment on this line`,className:`line-comment relative mt-1 mb-2 ml-6 rounded-xl border p-3`,children:[(0,W.jsx)(Z,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Cancel the comment`,title:`Cancel · Esc`,onClick:t,className:`absolute top-1.5 right-1.5 size-7 text-muted-foreground`,children:(0,W.jsx)(d_,{"aria-hidden":`true`})}),(0,W.jsx)(YB,{label:`Your comment`,hint:`Enter adds the comment · Esc cancels`,buttonLabel:`Add comment`,onSend:async t=>await K(`planner.commentLine`,{line:e,text:t.trim()})?(n(t.trim()),!0):!1})]})}function Zq({open:e,onClose:t,snap:n,comments:r,onSent:i}){let a=oO(e,aO.sheet),o=(0,m.useRef)(null),[s,c]=(0,m.useState)(),l=(0,m.useMemo)(()=>n.draft?Wq(n.draft):[],[n.draft]),u=s===void 0?void 0:l[s]?.text.trim(),d=()=>{let e=s;c(void 0),requestAnimationFrame(()=>o.current?.querySelector(`[data-line="${e}"] button[aria-label^="Comment on this line"]`)?.focus())};return(0,W.jsx)(pk,{open:e&&a,onOpenChange:e=>!e&&t(),children:(0,W.jsxs)(_k,{showCloseButton:!1,side:`right`,"aria-label":`Draft plan`,onEscapeKeyDown:e=>{u!==void 0&&(e.preventDefault(),d())},onCloseAutoFocus:()=>c(void 0),className:`plan-sheet gap-0 data-[side=right]:w-[min(44rem,92vw)] data-[side=right]:sm:max-w-none`,children:[(0,W.jsxs)(vk,{className:`flex-row items-center justify-between gap-3 border-b px-5 py-3`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,W.jsx)(yk,{className:`text-base font-semibold tracking-tight`,children:`Draft plan`}),(0,W.jsxs)(bk,{className:`text-xs text-muted-foreground`,children:[n.round>0?`${Eq(n.round,n.limit)} · `:``,`choose a line to comment on it`]})]}),(0,W.jsx)(mk,{asChild:!0,children:(0,W.jsxs)(Z,{variant:`ghost`,size:`sm`,"aria-label":`Close the plan`,title:`Close · Esc`,className:`gap-2 text-muted-foreground`,children:[(0,W.jsx)(d_,{"aria-hidden":`true`}),`Close`,(0,W.jsx)(XD,{chord:`Esc`,className:`kbd-hint`})]})})]}),(0,W.jsxs)(`div`,{ref:o,className:`flex min-h-0 flex-1 flex-col gap-5 overflow-y-auto overscroll-contain px-5 pt-4 pb-8`,children:[n.draft?(0,W.jsx)(Jq,{draft:n.draft,comments:r,commenting:u===void 0?void 0:s,form:u===void 0?void 0:(0,W.jsx)(Xq,{line:u,onCancel:d,onSent:e=>(i(u,e),d())},s),onComment:c}):(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n.busy?vq:_q}),(0,W.jsx)(Yq,{notes:n.notes})]}),(0,W.jsx)(Gv,{target:o})]})})}var Qq=()=>yO(vO(`plan`,`previous`)),$q=e=>yO(vO(`plan`,`previous`,e));function eJ(e){let t=Date.now()-Date.parse(e);return Number.isFinite(t)?Pk(Math.max(0,t)):``}function tJ(e,t){return[`${t} message${t===1?``:`s`}`,`round ${e.rounds}`,eJ(e.updatedAt)].filter(Boolean).join(` · `)}function nJ({plan:e,selected:t}){return(0,W.jsx)(`li`,{children:(0,W.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,onClick:()=>$q(e.id),className:HB,children:[(0,W.jsxs)(`span`,{className:`flex items-center gap-2 text-sm`,children:[(0,W.jsx)(`span`,{className:X(`min-w-0 flex-1 break-words text-foreground`,t&&`font-medium`),children:e.title}),e.hasDraft?(0,W.jsx)(VB,{variant:`secondary`,children:`draft`}):null]}),(0,W.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:tJ(e,e.messages)})]})})}function rJ({id:e,onGone:t}){let n=zO(`planner.previousGet`,{id:e},[`planner`]),r=n.data;if(!r)return n.error?(0,W.jsx)(NO,{message:`Could not load that plan. ${n.error}`,onRetry:n.reload}):null;let i=!!r.archivedAt,a=async()=>{await K(`planner.previousOpen`,{id:e})&&yO(vO(`plan`))},o=async()=>{await K(`planner.previousArchive`,{id:e,archived:!i})&&t()},s=async()=>{await K(`planner.previousDelete`,{id:e})&&t()};return(0,W.jsxs)(`article`,{className:`flex flex-col gap-5`,"aria-label":r.title,children:[(0,W.jsxs)(uk,{children:[(0,W.jsx)(lk,{label:`Carry on planning`,text:`Carry on`,icon:sg,tone:`primary`,shortcut:`C`,onClick:()=>void a()}),(0,W.jsx)(lk,{label:i?`Bring it back from the archive`:`Archive`,text:i?`Unarchive`:`Archive`,icon:i?Dp:kp,shortcut:`E`,onClick:()=>void o()}),(0,W.jsx)(Gk,{icon:qg,label:`Delete`,shortcut:`Delete`,title:`Delete "${r.title}"?`,description:`The conversation and the draft are removed for good.`,confirmLabel:`Delete plan`,variant:`destructive`,onConfirm:()=>void s()})]}),(0,W.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,W.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight`,children:r.title}),(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:[i?`archived`:``,tJ(r,r.messages.length),r.seed??``].filter(Boolean).join(` · `)})]}),(0,W.jsxs)(rB,{title:`Draft plan`,children:[r.draft?(0,W.jsx)(eB,{text:r.draft}):(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`The panel had not written a draft yet.`}),(0,W.jsx)(Yq,{notes:r.notes})]}),(0,W.jsx)(rB,{title:`Conversation`,children:(0,W.jsx)(hq,{messages:r.messages,readOnly:!0})})]})}function iJ({id:e}){let t=Ck(),[n,r]=(0,m.useState)(!1),i=zO(`planner.previous`,n?{archived:!0}:{},[`planner`]),a=i.data?.plans??[];if(!i.data&&i.error)return(0,W.jsx)(NO,{message:`Could not load the previous plans. ${i.error}`,onRetry:i.reload});let o=(0,W.jsxs)(Ok,{title:n?`Archived plans`:`Previous plans`,count:i.data?String(a.length):void 0,children:[(0,W.jsx)(lk,{label:`Back to the current plan`,icon:Np,iconOnly:!0,onClick:()=>yO(vO(`plan`))}),(0,W.jsx)(lk,{label:n?`Show the previous plans`:`Show the archived plans`,text:n?`Previous`:`Archived`,icon:n?pg:kp,pressed:n,onClick:()=>{r(e=>!e),Qq()}})]}),s=i.data?a.length===0?(0,W.jsx)(`p`,{className:`px-4 py-6 text-sm text-muted-foreground`,children:n?`No archived plans.`:`No previous plans. A plan you leave without saving it as a task waits here; one saved as a task is in the Tasks tab.`}):(0,W.jsx)(`ul`,{className:X(UB,`pt-2`),"aria-label":n?`Archived plans`:`Previous plans`,children:a.map(t=>(0,W.jsx)(nJ,{plan:t,selected:t.id===e},t.id))}):(0,W.jsx)(kk,{});return(0,W.jsx)(Dk,{wide:t,list:(0,W.jsxs)(W.Fragment,{children:[o,s]}),detail:e?(0,W.jsx)(rJ,{id:e,onGone:()=>{i.reload(),Qq()}},e):null,open:e!==void 0,onClose:Qq,hint:`Pick a plan to read it, carry it on, archive it or delete it.`,describe:`A previous plan`})}function aJ({limit:e}){return e<=0?null:(0,W.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`flex gap-1`,children:Array.from({length:e},(t,n)=>(0,W.jsx)(`span`,{className:X(`h-1.5 w-4 rounded-full`,n===e-1?`bg-primary`:`bg-border`)},n))}),(0,W.jsxs)(`span`,{children:[`up to `,e,` rounds, the last the oracle's`]})]})}function oJ({snap:e,onDone:t}){let n=Mq(e),r=(0,m.useRef)(null);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{ref:r,className:`@container flex-1 overflow-y-auto px-8 pt-10 pb-dock`,children:(0,W.jsxs)(`div`,{className:`mx-auto flex w-full max-w-5xl flex-col gap-8`,children:[(0,W.jsxs)(`header`,{className:`flex flex-col gap-4 @3xl:flex-row @3xl:items-end @3xl:justify-between`,children:[(0,W.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`card-flat grid size-11 shrink-0 place-items-center rounded-xl border text-primary`,children:(0,W.jsx)(yg,{className:`size-5`})}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,W.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`Plan with the panel`}),(0,W.jsx)(`p`,{className:`max-w-xl text-sm leading-relaxed text-muted-foreground`,children:Sq})]})]}),(0,W.jsxs)(`div`,{className:`flex flex-col items-start gap-2 @3xl:items-end`,children:[(0,W.jsx)(Vq,{}),(0,W.jsx)(aJ,{limit:e.limit})]})]}),(0,W.jsxs)(`section`,{"aria-labelledby":`plan-panel`,className:`flex flex-col gap-3`,children:[(0,W.jsx)(`h3`,{id:`plan-panel`,className:`text-xs text-muted-foreground`,children:(0,W.jsx)(nB,{title:`The panel`,right:Tq(n)})}),(0,W.jsx)(Rq,{cells:n,onToggled:t})]}),(0,W.jsxs)(`section`,{"aria-labelledby":`plan-steps`,className:`flex flex-col gap-3`,children:[(0,W.jsx)(`h3`,{id:`plan-steps`,className:`text-xs text-muted-foreground`,children:(0,W.jsx)(nB,{title:`How a plan comes together`})}),(0,W.jsx)(`ol`,{className:`grid gap-3 @2xl:grid-cols-2 @4xl:grid-cols-4`,children:wq.map((e,t)=>(0,W.jsxs)(`li`,{className:`card-flat relative flex gap-3 rounded-xl border p-3.5`,children:[(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`grid size-6 shrink-0 place-items-center rounded-full bg-accent text-xs font-semibold text-primary tabular-nums`,children:t+1}),(0,W.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,W.jsx)(`span`,{className:`text-sm font-medium`,children:e.title}),(0,W.jsx)(`span`,{className:`text-xs leading-relaxed text-muted-foreground`,children:e.text})]})]},e.title))})]}),(0,W.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2 text-sm text-muted-foreground`,children:[(0,W.jsx)(jp,{"aria-hidden":`true`,className:`size-4 text-primary motion-safe:animate-bounce`}),`Start in the box below.`,(0,W.jsx)(ZD,{chord:`/`,children:`write`}),(0,W.jsx)(ZD,{chord:`Enter`,children:`send to the panel`})]})]})}),(0,W.jsx)(Gv,{target:r})]})}function sJ({snap:e,onOpen:t}){return e.draft?(0,W.jsx)(`div`,{className:`pointer-events-none sticky top-0 z-10 -mt-2 mb-3 flex justify-center`,children:(0,W.jsxs)(`button`,{type:`button`,"aria-haspopup":`dialog`,onClick:t,className:`plan-pill pointer-events-auto inline-flex items-center gap-2 rounded-full border py-1.5 ps-2.5 pe-3 text-sm font-medium shadow-card backdrop-blur-sm`,children:[(0,W.jsx)(Ym,{"aria-hidden":`true`,className:`size-4 text-primary`}),`View plan`,e.round>0?(0,W.jsx)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:Eq(e.round,e.limit)}):null]})}):null}function cJ({snap:e,reload:t}){let[n,r]=(0,m.useState)(!1),[i,a]=(0,m.useState)(new Map),o=(e,t)=>a(n=>new Map(n).set(e,[...n.get(e)??[],t])),{ref:s,onScroll:c}=FV(`${JSON.stringify(e.messages)}${e.busy}`);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Uq,{snap:e,onDone:t,onViewPlan:()=>r(!0)}),(0,W.jsxs)(`div`,{ref:s,onScroll:c,className:`min-h-0 flex-1 overflow-y-auto overscroll-y-contain px-5 pt-5 pb-dock`,children:[(0,W.jsx)(sJ,{snap:e,onOpen:()=>r(!0)}),(0,W.jsx)(hq,{messages:e.messages,busy:e.busy})]}),(0,W.jsx)(Gv,{target:s}),(0,W.jsx)(Zq,{open:n,onClose:()=>r(!1),snap:e,comments:i,onSent:o})]})}function lJ({rest:e=[]}){return e[0]===`previous`?(0,W.jsx)(iJ,{id:e[1]}):(0,W.jsx)(uJ,{})}function uJ(){let e=zO(`planner.get`,{},[`planner`]),t=e.data;if(!t&&e.error)return(0,W.jsx)(NO,{message:`Could not load the plan. ${e.error}`,onRetry:e.reload});if(!t)return(0,W.jsx)(`p`,{role:`status`,className:`p-5 text-sm text-muted-foreground`,children:`Loading the plan…`});let n=Oq(t);return(0,W.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:n?(0,W.jsx)(oJ,{snap:t,onDone:e.reload}):(0,W.jsx)(cJ,{snap:t,reload:e.reload})})}var dJ={},fJ=new Set;function pJ(e){dJ=e;for(let e of[...fJ])e()}function mJ(e){dJ.taskId!==e&&pJ({...dJ,taskId:e})}function hJ(e){return fJ.add(e),()=>{fJ.delete(e)}}function gJ(){return(0,m.useSyncExternalStore)(hJ,()=>dJ,()=>dJ)}function _J(e,t=0,n=!1){let r=!n&&!e.waiting&&!!e.runningSince,i=r?Date.parse(e.serverNow)-Date.parse(e.runningSince):0;return Math.max(0,e.elapsedMs)+(Number.isFinite(i)?Math.max(0,i):0)+(r?Math.max(0,t):0)}function vJ(e){let t=Math.floor(e/1e3);return t<60?`${t}s`:t<3600?`${Math.floor(t/60)}m ${t%60}s`:`${Math.floor(t/3600)}h ${Math.floor(t%3600/60)}m`}function yJ(e,t){let[n,r]=(0,m.useState)(0);return(0,m.useEffect)(()=>{if(r(0),!e)return;let t=performance.now(),n=window.setInterval(()=>r(performance.now()-t),1e3);return()=>window.clearInterval(n)},[e,t]),e?n:0}function bJ({timing:e,stopped:t}){let[n,r]=(0,m.useState)(0);return(0,m.useEffect)(()=>{if(r(0),t||e.waiting||!e.runningSince)return;let n=performance.now(),i=window.setInterval(()=>r(performance.now()-n),1e3);return()=>window.clearInterval(i)},[e,t]),(0,W.jsxs)(`span`,{className:`tabular-nums break-words`,children:[e.waiting?`Waiting for you · `:``,e.phase.replaceAll(`_`,` `),` · `,vJ(_J(e,n,t)),` execution`]})}function xJ({work:e,timing:t,stopped:n}){let r=e.running&&!n&&!t?.waiting,i=yJ(r,e);return(0,W.jsxs)(`span`,{className:`tabular-nums break-words`,"data-work-clock":r?`running`:`stopped`,children:[t?.waiting?`Waiting for you · `:``,t?`${t.phase.replaceAll(`_`,` `)} · `:``,`worked `,vJ(e.workedMs+i)]})}function SJ({timing:e,work:t,stopped:n=!1}){return t?(0,W.jsx)(xJ,{work:t,...e?{timing:e}:{},stopped:n}):e?(0,W.jsx)(bJ,{timing:e,stopped:n},JSON.stringify(e)):(0,W.jsx)(`span`,{children:`Timing unavailable`})}var CJ=`This merges the reviewed commit into main and pushes main, then removes the task worktree after verifying the merge. The task branch is kept.`,wJ={pending_approval:`Ready for your review`,deferred:`Saved for later`,in_progress:`Delivery in progress`,successful:`Delivered`,recoverable_failure:`Delivery needs attention`};function TJ({delivery:e,title:t}){return(0,W.jsxs)(`div`,{className:`grid gap-2 text-sm`,children:[(0,W.jsx)(`p`,{className:`font-medium break-words`,children:t}),(0,W.jsxs)(`dl`,{className:`grid gap-1 break-all text-muted-foreground`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`dt`,{className:`inline`,children:`Project: `}),(0,W.jsx)(`dd`,{className:`inline`,children:e.project})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`dt`,{className:`inline`,children:`Repository: `}),(0,W.jsx)(`dd`,{className:`inline`,children:e.repository??`Unavailable — refresh review`})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`dt`,{className:`inline`,children:`Source: `}),(0,W.jsxs)(`dd`,{className:`inline`,children:[e.sourceBranch,` · `,e.sourceCommit??`Commit unavailable`]})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`dt`,{className:`inline`,children:`Target: `}),(0,W.jsxs)(`dd`,{className:`inline`,children:[`main`,e.targetCommit?` · ${e.targetCommit}`:``]})]})]}),(0,W.jsxs)(`p`,{children:[`Checks: `,e.verification?.checks??`unavailable`]}),(0,W.jsx)(`p`,{children:e.verification?.summary??`Verification unavailable. Refresh the review before delivery.`}),e.verification?(0,W.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Local completion/QA: `,e.verification.localVerified?`passed`:`not verified`,` · Repository rules: `,e.verification.rulesKnown?`known`:`unavailable`,e.verification.requiredChecks.length?` · Required: ${e.verification.requiredChecks.join(`, `)}`:``]}):null]})}function EJ({action:e,delivery:t,busy:n,onAction:r}){let i=t.blocked[e],a=e===`merge_main`&&t.status===`successful`&&!!t.cleanupError,o=n||t.status===`in_progress`||t.status===`successful`&&!a||!!i;return(0,W.jsxs)(`div`,{className:`grid min-w-0 gap-1`,children:[(0,W.jsx)(Z,{variant:`outline`,disabled:o,onClick:()=>r(e),children:e===`create_pr`?`Create PR`:a?`Retry worktree cleanup`:`Merge to main`}),(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e===`create_pr`?`Pushes the task branch and opens a PR targeting main. Does not merge.`:a?`Main was delivered. Removes the retained worktree after confirmation.`:`Updates and pushes main, then removes the task worktree. Requires confirmation.`}),i?(0,W.jsxs)(`p`,{className:`text-sm text-destructive`,children:[i,` Refresh review after resolving this restriction, then choose the action again.`]}):null]})}async function DJ(e,t,n){let r={taskId:t,reviewId:n};return e===`refresh`?z(`tasks.deliveryReview`,{taskId:t}):e===`defer`?z(`tasks.deliveryDefer`,r):z(`tasks.deliver`,{...r,action:e,...e===`merge_main`?{confirmMain:!0}:{}})}function OJ({taskId:e,delivery:t}){let[n,r]=(0,m.useState)(t),[i,a]=(0,m.useState)(!1),[o,s]=(0,m.useState)(),[c,l]=(0,m.useState)(!1),u=(0,m.useRef)(null),d=de(),f=`${d}:${e}`,p=(0,m.useRef)(f);return p.current=f,(0,m.useEffect)(()=>(p.current=f,()=>{p.current=``}),[f]),(0,m.useEffect)(()=>{r(t),l(!1)},[t,e]),{current:n,setCurrent:r,busy:i,setBusy:a,error:o,setError:s,confirm:c,setConfirm:l,trigger:u,project:d,identity:f,scope:p}}function kJ(e){return e.scope.current===e.identity&&e.project===de()}function AJ(e,t){let n=(0,m.useRef)(!1);async function r(r){if(!(n.current||r===`merge_main`&&!e.confirm)){n.current=!0,e.setBusy(!0),e.setError(void 0),e.setConfirm(!1);try{let n=await DJ(r,t.taskId,e.current.reviewId);kJ(e)&&(e.setCurrent(n.delivery),t.onChanged())}catch(t){kJ(e)&&e.setError(t instanceof Error?t.message:String(t))}finally{n.current=!1,e.scope.current&&e.setBusy(!1)}}}return r}function jJ(e){let t=OJ(e),n=AJ(t,e),r=oO(t.confirm,aO.confirm),i=t.current.status===`successful`||t.current.status===`in_progress`;function a(){t.trigger.current=document.activeElement,t.setConfirm(!0)}return{...t,request:n,slot:r,terminal:i,reviewMerge:a}}function MJ({review:e}){return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`Task completion is recorded separately. Nothing is published without your approval.`}),(0,W.jsx)(`p`,{role:`status`,className:`text-sm`,children:e.busy?`Updating delivery…`:e.current.operation?`Operation: ${e.current.operation.stage}`:wJ[e.current.status]}),e.current.error||e.error?(0,W.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:[e.error??e.current.error,` Completed work is retained. Refresh review to reconcile the result before retrying.`]}):null,e.current.cleanupError?(0,W.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:[e.current.cleanupError,` Retry cleanup after resolving it.`]}):null,e.current.operation?.worktreeRemoved?(0,W.jsx)(`p`,{className:`text-sm`,children:`Task worktree removed.`}):null,e.current.result?(0,W.jsxs)(`p`,{className:`text-sm break-all`,children:[e.current.result.action===`create_pr`?`PR #${e.current.result.pullNumber??``} created`:`main pushed · ${e.current.result.commit??``}`,e.current.result.pullUrl?(0,W.jsxs)(`span`,{children:[` · `,e.current.result.pullUrl]}):null]}):null]})}function NJ({review:e}){return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`mt-3 grid grid-cols-2 gap-3`,children:[(0,W.jsx)(EJ,{action:`create_pr`,delivery:e.current,busy:e.busy,onAction:()=>void e.request(`create_pr`)}),(0,W.jsx)(EJ,{action:`merge_main`,delivery:e.current,busy:e.busy,onAction:e.reviewMerge})]}),(0,W.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,W.jsx)(Z,{variant:`ghost`,disabled:e.busy,onClick:()=>void e.request(`refresh`),children:`Refresh review`}),(0,W.jsx)(Z,{variant:`ghost`,disabled:e.busy||e.terminal,onClick:()=>void e.request(`defer`),children:`Not now`})]})]})}function PJ({review:e}){let t=e.current.status===`successful`&&!!e.current.cleanupError,n=t?`Main was already delivered. Remove the task worktree if it still contains only the reviewed commit. The task branch is kept.`:CJ;return(0,W.jsx)(QD,{open:e.slot,onOpenChange:e.setConfirm,label:t?`Confirm worktree removal`:`Confirm merge to main`,description:n,onCloseAutoFocus:t=>{t.preventDefault(),requestAnimationFrame(()=>e.trigger.current?.focus())},children:(0,W.jsxs)(`div`,{className:`grid gap-3 p-4`,children:[(0,W.jsx)(`h3`,{className:`font-medium`,children:t?`Remove task worktree?`:`Merge to main?`}),(0,W.jsx)(`p`,{className:`text-sm`,children:n}),(0,W.jsxs)(`p`,{className:`break-all text-sm text-muted-foreground`,children:[e.current.repository,` · `,e.current.sourceCommit,` → main`]}),(0,W.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,W.jsx)(Z,{variant:`outline`,onClick:()=>e.setConfirm(!1),children:`Cancel`}),(0,W.jsx)(Z,{disabled:e.busy||!!e.current.blocked.merge_main||e.terminal&&!t,onClick:()=>void e.request(`merge_main`),children:t?`Confirm worktree removal`:`Confirm merge and push main`})]})]})})}function FJ({title:e,review:t}){return(0,W.jsxs)(rB,{title:`Completed work · delivery review`,right:wJ[t.current.status],children:[(0,W.jsx)(TJ,{delivery:t.current,title:e}),(0,W.jsx)(MJ,{review:t}),(0,W.jsx)(NJ,{review:t}),(0,W.jsx)(PJ,{review:t})]})}function IJ(e){let t=jJ(e);return(0,W.jsx)(FJ,{title:e.title,review:t})}var LJ={open:Cm,delivered:pm,addressed:lm},RJ={open:`waiting for the owning session`,delivered:`sent to the oracle`,addressed:`plan amended`};function zJ({comment:e}){let t=Pk(Date.now()-Date.parse(e.createdAt)),n=LJ[e.status];return(0,W.jsxs)(`p`,{className:`mt-1 flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,W.jsx)(n,{"aria-hidden":`true`,className:e.status===`addressed`?`size-3.5 text-success`:`size-3.5`}),RJ[e.status],`, `,t,e.editedAt?` (edited)`:``]})}function BJ({comment:e,taskId:t,own:n}){let[r,i]=(0,m.useState)(!1),[a,o]=(0,m.useState)(),s=a&&(a.editedAt??``)>(e.editedAt??``)?a:e;return(0,W.jsxs)(`li`,{className:`card-flat min-w-0 rounded-lg border px-3.5 py-2.5`,children:[r?(0,W.jsx)(cq,{text:s.text,onSave:async n=>{let r=await z(`tasks.editComment`,{taskId:t,commentId:e.id,text:n});o(r.comment)},onCancel:()=>i(!1)}):(0,W.jsx)(eB,{text:s.text}),(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,W.jsx)(zJ,{comment:s}),n&&!r?(0,W.jsx)(Z,{size:`sm`,variant:`ghost`,onClick:()=>i(!0),children:`Edit`}):null]})]})}function VJ({taskId:e,finished:t,canComment:n}){let r=zO(`tasks.comments`,{taskId:e},[`tasks`]),i=LO(`status`),a=r.data?.comments??[],o=a.filter(e=>e.status!==`addressed`).length;return(0,W.jsxs)(`section`,{"aria-labelledby":`comments-${e}`,className:`flex flex-col gap-3`,children:[(0,W.jsx)(`h3`,{id:`comments-${e}`,className:`text-sm`,children:(0,W.jsx)(nB,{title:`Comments`,right:o>0?`${o} open`:void 0})}),a.length===0?(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t?`No comments.`:n?`No comments yet. Comment on the plan in the box below (Markdown and images work); the oracle amends it.`:`No comments yet.`}):(0,W.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:a.map(t=>(0,W.jsx)(BJ,{taskId:e,comment:t,own:!!(t.by&&t.by===i.data?.sessionId)},`${e}-${t.id}`))})]})}var HJ={mine:`This session`,others:`Other sessions`,pending:`Pending`,recent:`Finished`,archived:`Archived`},UJ={open:`open`,done:`done`,dropped:`abandoned`},WJ={none:{label:`None`,depth:`nothing that runs changed: the engine's checks decide, no QA agent`,tone:`bg-accent text-muted-foreground`},low:{label:`Low`,depth:`a light check: the diff, the nearest tests, done once confident`,tone:`bg-success/10 text-success`},medium:{label:`Medium`,depth:`a standard check: the acceptance criteria and realistic regressions`,tone:`bg-warning/10 text-warning`},high:{label:`High`,depth:`a deep, adversarial review: invariants, recovery and everything the change reaches`,tone:`bg-destructive/10 text-destructive`}};function GJ(e){let t=e.source===`classifier`?`Jev`:`rules`;if(!e.qaRequired)return`${t} · no QA agent`;let{min:n,max:r}=e.testBudget;return`${t} · ${n===r?r:`${n}-${r}`} new tests at most`}var KJ=`No tasks yet. Start one from the Lobby tab, or plan one in the Plan tab.`;function qJ(e,t){return`${e.replace(/_/g,` `)}${t?` · paused`:``}`}function JJ(e){return e===`now`?`just now`:`${e} ago`}function YJ(e){if(e.kind===`plan`)return[`planned`,e.age?e.age===`now`?`saved just now`:`saved ${e.age} ago`:``,e.issue?`#${e.issue}`:``].filter(Boolean).join(` · `);let t=e.owner??(e.section===`mine`?`this session`:``);return[qJ(e.status,e.paused),t].filter(Boolean).join(` · `)}function XJ(e){let t=[];for(let n of e){let e=t.at(-1);e&&e.section===n.section?e.rows.push(n):t.push({section:n.section,rows:[n]})}return t}function ZJ(e){let t=e.filter(e=>e.kind!==`archived`),n=t.filter(e=>e.check===`open`).length,r=t.length-n,i=e.length-t.length;return[n?`${n} open`:``,r?`${r} finished`:``,i?`${i} archived`:``].filter(Boolean).join(` · `)||`0`}var QJ=1e3;function $J({taskId:e,index:t,text:n,onSkipped:r}){let[i,a]=(0,m.useState)(!1),[o,s]=(0,m.useState)(``),[c,l]=(0,m.useState)(!1),[u,d]=(0,m.useState)(``),f=oO(i,aO.confirm),p=(0,m.useId)(),h=(0,m.useId)(),g=o.trim(),_=e=>{c||(a(e),s(``),d(``))},v=async()=>{if(g&&!c){l(!0),d(``);try{G((await z(`tasks.skipStep`,{taskId:e,step:t,text:n,reason:g})).notice),a(!1),s(``),r()}catch(e){d(e instanceof Error?e.message:`That did not work. Try again.`)}finally{l(!1)}}};return(0,W.jsxs)(Fk,{open:i&&f,onOpenChange:_,children:[(0,W.jsxs)(`button`,{type:`button`,"aria-label":`Skip step ${t+1}`,onClick:()=>_(!0),className:X(`step-skip -my-0.5 ml-auto inline-flex h-6 shrink-0 items-center gap-1 rounded-md px-1.5 text-xs text-muted-foreground outline-none`,`transition-[opacity,background-color,color,scale] duration-150 hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring active:scale-[0.96] motion-reduce:active:scale-100`),children:[(0,W.jsx)(jg,{"aria-hidden":`true`,className:`size-3.5`}),`Skip`]}),(0,W.jsxs)(Rk,{children:[(0,W.jsxs)(zk,{children:[(0,W.jsxs)(Vk,{children:[`Skip step `,t+1,`?`]}),(0,W.jsx)(Hk,{children:`The oracle is told to carry on without it, and your reason stays with the step in the task's history.`})]}),(0,W.jsx)(`p`,{className:`rounded-md bg-muted px-2.5 py-1.5 text-sm break-words`,children:n}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,W.jsx)(`label`,{htmlFor:p,className:`text-sm font-medium`,children:`Why skip it?`}),(0,W.jsx)(Ak,{id:p,value:o,autoFocus:!0,required:!0,maxLength:QJ,disabled:c,"aria-describedby":h,"aria-invalid":u?!0:void 0,placeholder:`Already done by hand, not needed any more, out of scope…`,className:`max-h-48 min-h-20`,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),v())}}),(0,W.jsx)(`p`,{id:h,className:`text-xs text-muted-foreground`,children:`A reason is required.`})]}),u?(0,W.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:u}):null,(0,W.jsxs)(Bk,{children:[(0,W.jsx)(Wk,{disabled:c,children:`Cancel`}),(0,W.jsx)(Z,{disabled:!g||c,"aria-busy":c,onClick:()=>void v(),children:c?`Skipping…`:`Skip step`})]})]})]})}function eY({step:e,stopped:t}){let n=yJ(!t,e);return(0,W.jsx)(`span`,{className:`tabular-nums`,children:vJ((e.workedMs??0)+n)})}function tY(){return(0,W.jsxs)(`span`,{"aria-hidden":`true`,className:`relative mt-[0.3125rem] grid size-4 shrink-0 place-items-center`,children:[(0,W.jsx)(`span`,{className:`absolute size-2.5 rounded-full bg-primary/30 motion-safe:animate-status-ping`}),(0,W.jsx)(`span`,{className:`size-2 rounded-full bg-primary`})]})}function nY(e){return(e.split(`
100
- `).find(e=>e.trim())?.trim()??``).replace(/^steps?\s+\d+(?:\s*[-–]\s*\d+)?\s*[:.\-–]\s*/i,``).replace(/^\*\*?goal\*\*?\s*[:\-–]\s*/i,``)}function rY({name:e,className:t}){return(0,W.jsx)(`span`,{"aria-hidden":`true`,className:X(`grid size-5 shrink-0 place-items-center rounded-md border border-border bg-card`,WV(e),t),children:(0,W.jsx)(BV,{source:e,className:`size-3`})})}function iY({id:e,agents:t,stepText:n}){let[r,i]=(0,m.useState)(Date.now);(0,m.useEffect)(()=>{let e=window.setInterval(()=>i(Date.now()),1e3);return()=>window.clearInterval(e)},[]);let a=t.filter(e=>!e.parentRunId||!t.some(t=>t.runId===e.parentRunId)).flatMap(e=>[e,...t.filter(t=>t.parentRunId===e.runId)]);return(0,W.jsx)(`ul`,{id:e,"aria-label":`Agents on this step`,className:`mt-2 flex flex-col overflow-hidden rounded-lg border border-border bg-card`,children:a.map(e=>{let i=qV({domain:e.domain}),a=!!e.parentRunId&&t.some(t=>t.runId===e.parentRunId),o=Date.parse(e.startedAt),s=nY(e.instruction),c=s&&s.toLowerCase()!==n.trim().toLowerCase()?s:``;return(0,W.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2.5 border-b border-border px-3 py-2 text-xs last:border-b-0`,children:[a?(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`ml-1.5 h-4 w-3 shrink-0 rounded-bl-md border-b border-l border-border`}):null,(0,W.jsx)(rY,{name:i}),(0,W.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,W.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,W.jsx)(`span`,{className:X(`font-medium`,WV(i)),children:UV(i)}),a?(0,W.jsx)(`span`,{className:`text-muted-foreground`,children:`child`}):null,(0,W.jsx)(vH,{className:`size-3 text-muted-foreground`}),(0,W.jsx)(`span`,{className:`text-muted-foreground`,children:`working`})]}),c?(0,W.jsx)(`span`,{className:`truncate text-muted-foreground`,title:e.instruction,children:c}):null]}),Number.isFinite(o)?(0,W.jsx)(`span`,{className:`shrink-0 tabular-nums text-muted-foreground`,children:vJ(Math.max(0,r-o))}):null]},e.runId)})})}function aY({agents:e,count:t,step:n,stopped:r}){let i=[...new Set(e.map(e=>qV({domain:e.domain})))].slice(0,3);return(0,W.jsxs)(W.Fragment,{children:[i.length>0?(0,W.jsx)(`span`,{className:`flex -space-x-1.5`,children:i.map(e=>(0,W.jsx)(rY,{name:e,className:`size-[1.125rem] ring-2 ring-card`},e))}):null,(0,W.jsxs)(`span`,{children:[t,` `,t===1?`agent`:`agents`,(0,W.jsx)(`span`,{className:`sr-only`,children:` working`})]}),(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`text-muted-foreground/60`,children:`·`}),(0,W.jsx)(eY,{step:n,stopped:r})]})}var oY=`inline-flex h-6 shrink-0 items-center gap-1.5 rounded-full border border-primary/20 bg-primary/5 pr-2 pl-1 text-xs font-medium text-primary`;function sY(e){let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleString(void 0,{day:`numeric`,month:`short`,hour:`2-digit`,minute:`2-digit`})}function cY({step:e,index:t}){let n=e.skip?sY(e.skip.at):``;return(0,W.jsxs)(`li`,{className:`flex min-w-0 flex-col`,"data-step":`skipped`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2.5 text-sm`,children:[(0,W.jsx)(_m,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),(0,W.jsxs)(`span`,{className:`shrink-0 text-xs leading-5 text-muted-foreground tabular-nums`,children:[t+1,`.`]}),(0,W.jsx)(`span`,{className:`min-w-0 break-words text-muted-foreground line-through decoration-muted-foreground/50`,children:e.text}),(0,W.jsx)(`span`,{className:`shrink-0 rounded-md bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground`,children:`skipped`})]}),e.skip?(0,W.jsxs)(`p`,{className:`step-skip-reason mt-1 ml-[3.25rem] border-l-2 border-border pl-2.5 text-xs break-words text-muted-foreground`,children:[(0,W.jsx)(`span`,{className:`font-medium text-foreground/80`,children:`Why: `}),e.skip.reason,n?(0,W.jsxs)(`span`,{className:`text-muted-foreground/70`,children:[` · `,n]}):null]}):null]})}function lY({step:e,index:t,stopped:n,skip:r}){let i=!!e.active&&!n,a=i?e.agents??[]:[],o=a.length||(e.activeAgentCount??1),[s,c]=(0,m.useState)(!1),l=(0,m.useId)(),u=e.status===`done`,d=u?`text-success`:e.status===`current`?`text-primary`:`text-muted-foreground`,f=u?lm:Cm;return e.status===`skipped`?(0,W.jsx)(cY,{step:e,index:t}):(0,W.jsxs)(`li`,{className:`group/step flex min-w-0 flex-col`,"data-step":i?`active`:e.status,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2.5 text-sm`,children:[i?(0,W.jsx)(tY,{}):(0,W.jsx)(f,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 ${d}`}),(0,W.jsxs)(`span`,{className:`shrink-0 text-xs leading-5 text-muted-foreground tabular-nums`,children:[t+1,`.`]}),(0,W.jsx)(`span`,{className:X(`min-w-0 break-words`,i||e.status===`current`?`text-foreground`:`text-muted-foreground`),children:e.text}),i&&a.length>0?(0,W.jsxs)(`button`,{type:`button`,"aria-expanded":s,"aria-controls":l,onClick:()=>c(e=>!e),className:X(oY,`-my-0.5 transition-colors outline-none hover:bg-primary/10 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`),children:[(0,W.jsx)(aY,{agents:a,count:o,step:e,stopped:n}),(0,W.jsx)($p,{"aria-hidden":`true`,className:X(`size-3 transition-transform duration-200`,s&&`rotate-180`)}),(0,W.jsx)(`span`,{className:`sr-only`,children:` (being worked on now)`})]}):i?(0,W.jsxs)(`span`,{className:X(oY,`-my-0.5`),children:[(0,W.jsx)(aY,{agents:a,count:o,step:e,stopped:n}),(0,W.jsx)(`span`,{className:`sr-only`,children:` (being worked on now)`})]}):e.status===`current`&&!n?(0,W.jsxs)(`span`,{className:`shrink-0 rounded-md bg-accent px-2 py-0.5 text-xs font-medium`,children:[`next`,(0,W.jsx)(`span`,{className:`sr-only`,children:` (the step up next)`})]}):null,r&&!u&&!n?(0,W.jsx)($J,{taskId:r.taskId,index:t,text:e.text,onSkipped:r.onSkipped}):null]}),s&&a.length>0?(0,W.jsx)(`div`,{className:`pl-[3.25rem]`,children:(0,W.jsx)(iY,{id:l,agents:a,stepText:e.text})}):null]})}function uY({steps:e,stopped:t,skip:n}){let r=e.filter(e=>e.status===`done`).length,i=e.filter(e=>e.status===`skipped`).length;return(0,W.jsx)(rB,{title:`Steps`,right:`${r}/${e.length} done${i?` · ${i} skipped`:``}`,children:(0,W.jsx)(`ol`,{className:`flex flex-col gap-2`,"aria-label":`Steps`,children:e.map((e,r)=>(0,W.jsx)(lY,{step:e,index:r,stopped:t,skip:n},`${r}-${e.text}`))})})}function dY({text:e}){let[t,n]=(0,m.useState)(!1),r=(0,m.useId)();return(0,W.jsxs)(rB,{title:`Full plan`,children:[(0,W.jsxs)(`button`,{type:`button`,"aria-expanded":t,"aria-controls":r,onClick:()=>n(e=>!e),className:`inline-flex min-h-11 w-fit items-center gap-1.5 rounded-md text-sm text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,children:[(0,W.jsx)(rm,{"aria-hidden":`true`,className:X(`size-4 transition-transform duration-200 ease-snap`,t&&`rotate-90`)}),t?`Hide the details`:`Read the details of each step`]}),t?(0,W.jsx)(`div`,{id:r,children:(0,W.jsx)(eB,{text:e})}):null]})}function fY({detail:e,finished:t}){return e.plan&&e.planDetails?(0,W.jsx)(dY,{text:e.planDetails}):e.plan?(0,W.jsx)(rB,{title:`Approved plan`,children:(0,W.jsx)(eB,{text:e.plan})}):e.proposal?(0,W.jsx)(rB,{title:t?`Proposal`:`Proposal (no plan yet)`,children:(0,W.jsx)(eB,{text:e.proposal})}):(0,W.jsx)(rB,{title:`Plan`,children:(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t?`It ended before a plan was made.`:`No proposal or plan yet — the oracle is still clarifying or scouting.`})})}function pY({amendments:e}){return e.length===0?null:(0,W.jsx)(rB,{title:`Amendments`,children:(0,W.jsx)(`ul`,{className:`flex list-disc flex-col gap-1 pl-5 text-sm text-muted-foreground`,children:e.map(e=>(0,W.jsx)(`li`,{className:`break-words`,children:e},e))})})}function mY({risk:e}){let t=WJ[e.risk];return(0,W.jsxs)(rB,{title:`QA risk`,right:GJ(e),children:[(0,W.jsxs)(`p`,{className:`flex flex-wrap items-baseline gap-x-2 gap-y-1 text-sm`,"data-qa-risk":e.risk,children:[(0,W.jsx)(`span`,{className:X(`rounded-md px-2 py-0.5 text-xs font-medium`,t.tone),children:t.label}),(0,W.jsx)(`span`,{className:`text-muted-foreground`,children:t.depth})]}),e.focusAreas.length>0?(0,W.jsx)(`ul`,{className:`flex list-disc flex-col gap-1 pl-5 text-sm text-muted-foreground`,"aria-label":`What QA looks at first`,children:e.focusAreas.map(e=>(0,W.jsx)(`li`,{className:`break-words`,children:e},e))}):null,(0,W.jsxs)(`p`,{className:`text-xs break-words text-muted-foreground`,children:[e.riskFactors.join(` · `),e.qaRequired?` · existing tests ${e.existingTestsLikelySufficient?`likely enough`:`likely not enough`}`:``]})]})}function hY({runs:e}){return e.length===0?null:(0,W.jsx)(rB,{title:`Recent runs`,children:(0,W.jsx)(`ul`,{className:`flex flex-col gap-1 text-sm text-muted-foreground`,children:e.map((e,t)=>(0,W.jsx)(`li`,{className:`break-words`,children:e},`${t}-${e}`))})})}function gY({detail:e,finished:t,skip:n}){return(0,W.jsxs)(W.Fragment,{children:[e.steps.length>0?(0,W.jsx)(uY,{steps:e.steps,stopped:t,skip:n}):null,e.request?(0,W.jsx)(rB,{title:`Request`,children:(0,W.jsx)(eB,{text:e.request})}):null,(0,W.jsx)(fY,{detail:e,finished:t})]})}function _Y({detail:e}){return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(pY,{amendments:e.amendments}),e.qaRisk?(0,W.jsx)(mY,{risk:e.qaRisk}):null,(0,W.jsx)(hY,{runs:e.runs})]})}function vY({row:e,quiet:t=!1}){let n=(0,m.useRef)(!0);(0,m.useEffect)(()=>(n.current=!0,()=>{n.current=!1}),[]);async function r(){if(e.section===`mine`)return yO(`#/lobby`);let t=de(),r=()=>n.current&&de()===t;try{let t=await z(`tasks.open`,{taskId:e.id});if(!r())return;let n=await z(`status.get`,{});if(!r())return;if(t.sessionId&&t.sessionId===n.sessionId)return yO(`#/lobby`);if(t.sessionId&&!t.key)return G.info(`This task runs in another terminal. Switch to that terminal to work on it.`);if(n.busy)return G.info(`The oracle is working in this window. Stop it first, then open the task in its session.`);await K(`sessions.switch`,t.key?{key:t.key}:{claimTaskId:e.id})&&r()&&yO(`#/lobby`)}catch(e){r()&&G.error(e instanceof Error?e.message:String(e))}}let i=e.section===`mine`;return(0,W.jsx)(lk,{label:i?`Open in its session: this window`:`Open in its session`,text:`Open in session`,icon:Fp,tone:t?`neutral`:`primary`,shortcut:`S`,onClick:()=>void r()})}function yY({split:e}){let t=e.after.length>0?`, after ${e.after.map(e=>`part ${e}`).join(` and `)}`:``;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[(0,W.jsxs)(`span`,{className:`font-medium text-primary`,children:[`part `,e.part,` of `,e.of]}),` of one plan that was split into tasks`,t?(0,W.jsx)(`span`,{className:`text-foreground`,children:t}):null]}),(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.titles.map((t,n)=>(0,W.jsxs)(`span`,{children:[n>0?(0,W.jsx)(`span`,{className:`text-muted-foreground/60`,children:` · `}):null,(0,W.jsxs)(`span`,{className:n+1===e.part?`font-medium text-foreground`:void 0,children:[n+1,`. `,t]})]},`${n}-${t}`))})]})}function bY({planId:e}){let t=zO(`plans.get`,{planId:e},[`plans`]),n=t.data;return n?(0,W.jsxs)(W.Fragment,{children:[n.issue?(0,W.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`from issue #`,n.issue.number,` — `,n.issue.title,n.issue.url?(0,W.jsxs)(`span`,{className:`break-all`,children:[` `,n.issue.url]}):null]}):null,n.split?(0,W.jsx)(yY,{split:n.split}):null,(0,W.jsx)(rB,{title:`Agreed plan`,children:(0,W.jsx)(eB,{text:n.brief})})]}):t.error?(0,W.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not load the agreed plan. `,t.error]}):null}function xY({row:e,onGone:t}){let n=async n=>{await K(`plans.start`,{planId:e.id,where:n})&&t()},r=async()=>{await K(`plans.discard`,{planId:e.id})&&t()};return(0,W.jsxs)(`article`,{className:`flex min-w-0 flex-col gap-4`,"aria-label":e.title,children:[(0,W.jsxs)(uk,{children:[(0,W.jsx)(lk,{label:`Start here`,icon:sg,tone:`primary`,shortcut:`S`,onClick:()=>void n(`here`)}),(0,W.jsx)(lk,{label:`Start in a new session`,text:`New session`,icon:Ng,shortcut:`N`,onClick:()=>void n(`session`)}),(0,W.jsx)(Gk,{icon:qg,label:`Discard`,shortcut:`Delete`,title:`Discard "${e.title}"?`,description:`The saved plan is removed from the list. This cannot be undone.`,confirmLabel:`Discard`,variant:`destructive`,onConfirm:()=>void r()})]}),(0,W.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,W.jsxs)(`h2`,{className:`flex items-start gap-2.5 text-lg font-medium`,children:[(0,W.jsx)(aH,{check:`open`,className:`mt-1.5`}),(0,W.jsx)(`span`,{className:`min-w-0 break-words`,children:e.title})]}),(0,W.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`pending`,e.age?` · saved ${JJ(e.age)}`:``]}),(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground break-all`,children:e.id})]}),(0,W.jsx)(bY,{planId:e.id})]})}function SY({row:e,onResumed:t}){let[n,r]=(0,m.useState)(!1),i=(0,m.useRef)(!0);(0,m.useEffect)(()=>(i.current=!0,()=>{i.current=!1}),[]);async function a(){let n=de();r(!0);try{let r=await z(`tasks.resume`,{taskId:e.id});if(de()!==n)return;G(r.notice,{action:{label:`View task`,onClick:()=>yO(vO(`tasks`,e.id))}}),t()}catch(e){de()===n&&G.error(e instanceof Error?e.message:String(e))}finally{i.current&&r(!1)}}let o=e.owner===`not running`;return(0,W.jsx)(lk,{label:o?`Resume: carry it on in a background session`:`Resume: unpause it where it runs`,text:`Resume`,icon:sg,tone:`primary`,shortcut:`R`,disabled:n,onClick:()=>void a()})}function CY(e){return e instanceof Error?e.message:`That did not work. Try again.`}function wY({run:e,onDone:t}){let[n,r]=(0,m.useState)(!1),[i,a]=(0,m.useState)(``),[o,s]=(0,m.useState)(!1),[c,l]=(0,m.useState)(``);return{open:n,change:e=>{o||(r(e),a(``),l(``))},typed:i,setTyped:a,busy:o,error:c,submit:async()=>{s(!0),l(``);try{G((await e(i)).notice),r(!1),t()}catch(e){l(CY(e))}finally{s(!1)}}}}function TY({expected:e,value:t,onChange:n,disabled:r}){let i=(0,m.useId)();return(0,W.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,W.jsx)(`label`,{htmlFor:i,className:`text-sm font-medium`,children:`Type the task's title to confirm`}),(0,W.jsx)(`p`,{className:`break-words rounded-md bg-muted px-2 py-1 font-mono text-xs select-all`,children:e}),(0,W.jsx)(aW,{id:i,value:t,disabled:r,autoComplete:`off`,spellCheck:!1,onChange:e=>n(e.target.value)})]})}function EY(e){let t=wY(e),n=oO(t.open,aO.confirm),r=e.typeToConfirm!==void 0&&t.typed!==e.typeToConfirm,i=e.tone??`neutral`;return(0,W.jsxs)(Fk,{open:t.open&&n,onOpenChange:t.change,children:[(0,W.jsx)(lk,{label:e.label,icon:e.icon,tone:i,onClick:()=>t.change(!0)}),(0,W.jsxs)(Rk,{children:[(0,W.jsxs)(zk,{children:[(0,W.jsx)(Vk,{children:e.title}),(0,W.jsx)(Hk,{children:e.description})]}),e.typeToConfirm===void 0?null:(0,W.jsx)(TY,{expected:e.typeToConfirm,value:t.typed,onChange:t.setTyped,disabled:t.busy}),t.error?(0,W.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:t.error}):null,(0,W.jsxs)(Bk,{children:[(0,W.jsx)(Wk,{disabled:t.busy,children:`Cancel`}),(0,W.jsx)(Z,{variant:i===`danger`?`destructive`:`default`,disabled:r||t.busy,"aria-busy":t.busy,onClick:()=>void t.submit(),children:t.busy?`Working…`:e.confirmLabel})]})]})]})}function DY({taskId:e,item:t,onDone:n}){let r=n=>()=>z(`tasks.resolveApproval`,{taskId:e,approvalId:t.id,decision:n}),i=`${t.kind}${t.domain?` for ${t.domain}`:``}`;return(0,W.jsxs)(`span`,{className:`flex flex-wrap gap-2`,children:[(0,W.jsx)(EY,{label:`Approve`,icon:Zp,title:`Approve the ${i}?`,description:`${t.detail} The task's oracle is told and carries on with it.`,confirmLabel:`Approve`,run:r(`approved`),onDone:n}),(0,W.jsx)(EY,{label:`Reject`,icon:d_,tone:`danger`,title:`Reject the ${i}?`,description:`${t.detail} The task's oracle is told and works without it.`,confirmLabel:`Reject`,run:r(`rejected`),onDone:n})]})}function OY({taskId:e,item:t,live:n,onDone:r}){return(0,W.jsxs)(`li`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,W.jsxs)(`span`,{className:`flex min-w-0 flex-1 basis-60 gap-2`,children:[(0,W.jsx)(sm,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-warning`}),(0,W.jsxs)(`span`,{className:`min-w-0 break-words text-muted-foreground`,children:[t.kind,` `,t.detail]})]}),n&&t.id?(0,W.jsx)(DY,{taskId:e,item:t,onDone:r}):null]})}function kY({blockers:e}){return e.map((e,t)=>(0,W.jsxs)(`li`,{className:`flex gap-2`,children:[(0,W.jsx)(xm,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-destructive`}),(0,W.jsxs)(`span`,{className:`min-w-0 break-words text-muted-foreground`,children:[e.reason,` (needs: `,e.need,`)`]})]},`${t}-${e.reason}`))}function AY({row:e,detail:t,onChanged:n}){let r=e.id;return(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[e.resumable?(0,W.jsx)(SY,{row:e,onResumed:n}):null,t.canAccept?(0,W.jsx)(EY,{label:`Accept as is`,icon:kg,title:`Accept "${e.title}" as is?`,description:`You accept the work unverified: missing QA and lint checks are waived on your word. The task's oracle is asked to complete it; nothing is merged.`,confirmLabel:`Accept as is`,run:()=>z(`tasks.accept`,{taskId:r}),onDone:n}):null,t.canForceClose?(0,W.jsx)(EY,{label:`Force close`,icon:_m,tone:`danger`,title:`Force close "${e.title}"?`,description:`The task is abandoned and its running work cancelled. Its code, worktree and history are kept; it is not marked complete.`,confirmLabel:`Force close`,typeToConfirm:e.title,run:e=>z(`tasks.forceClose`,{taskId:r,title:e}),onDone:n}):null]})}function jY({row:e,detail:t,onChanged:n}){let r=e.kind===`task`&&e.check===`open`,i=r&&!!(e.resumable||t.canAccept||t.canForceClose),a=t.waiting;return a.length===0&&t.blockers.length===0&&!i?null:(0,W.jsxs)(rB,{title:`Waiting on`,children:[(0,W.jsxs)(`ul`,{className:`flex flex-col gap-2 text-sm`,children:[a.map((t,i)=>(0,W.jsx)(OY,{taskId:e.id,item:t,live:r,onDone:n},`${i}-${t.id||t.kind}`)),(0,W.jsx)(kY,{blockers:t.blockers})]}),i?(0,W.jsx)(AY,{row:e,detail:t,onChanged:n}):null]})}function MY(e){if(e.kind===`archived`)return{state:`archived`,rest:JJ(e.age??`now`)};let t=e.check!==`open`,n=e.owner??(e.section===`mine`?`this session`:``),r=t&&e.age?`${e.check===`dropped`?`dropped`:`done`} ${JJ(e.age)}`:``;return{state:qJ(e.status,e.paused),rest:[t?``:n,r].filter(Boolean).join(` · `)}}function NY(e){return e?[nH(e.track),e.domains.join(`, `)].filter(Boolean).join(` · `):``}function PY({row:e}){return e.progress?(0,W.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground`,children:[(0,W.jsx)(iH,{done:e.progress.done,total:e.progress.total}),(0,W.jsxs)(`span`,{children:[e.progress.done,` of `,e.progress.total,` steps`]})]}):null}function FY({row:e,task:t}){let n=t?.git?`branch ${t.git.branch}${t.git.from?` · from ${t.git.from}`:``}`:``,{state:r,rest:i}=MY(e);return(0,W.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,W.jsxs)(`h2`,{className:`flex items-start gap-2.5 text-lg font-semibold tracking-tight`,children:[(0,W.jsx)(aH,{check:e.check,className:`mt-1.5`}),(0,W.jsxs)(`span`,{className:`sr-only`,children:[UJ[e.check],`:`]}),(0,W.jsx)(`span`,{className:e.check===`dropped`?`min-w-0 break-words line-through`:`min-w-0 break-words`,children:e.title})]}),(0,W.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground`,children:[(0,W.jsx)(`span`,{className:`rounded-md bg-accent px-2 py-0.5 text-xs font-medium text-foreground`,children:r}),i?(0,W.jsx)(`span`,{children:i}):null]}),(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground break-all`,children:[e.id,NY(t),n].filter(Boolean).join(` · `)}),(0,W.jsx)(PY,{row:e})]})}function IY({row:e,onGone:t,onChanged:n}){let r=e.id;return{restore:async()=>{await K(`tasks.restore`,{taskId:r},{undo:()=>void K(`tasks.archive`,{taskId:r})})&&t()},archive:async()=>{await K(`tasks.archive`,{taskId:r},{undo:()=>void K(`tasks.restore`,{taskId:r})})&&t()},remove:async()=>{await K(`tasks.delete`,{taskId:r,where:e.kind===`archived`?`archive`:`list`})&&t()},toggleAuto:()=>void K(`tasks.auto`,{taskId:r,on:!e.auto}).then(n)}}function LY({row:e,archive:t}){return e.check===`open`?(0,W.jsx)(Gk,{label:`Archive`,icon:kp,shortcut:`E`,title:`Archive "${e.title}"?`,description:`A task still under way is abandoned first, then moved to the archive. Restore brings it back.`,confirmLabel:`Archive`,onConfirm:()=>void t()}):(0,W.jsx)(lk,{label:`Archive`,icon:kp,shortcut:`E`,onClick:()=>void t()})}function RY({on:e,toggle:t}){return sk(`a`,t),(0,W.jsxs)(VO,{children:[(0,W.jsx)(HO,{asChild:!0,children:(0,W.jsxs)(`label`,{className:`flex h-8 cursor-pointer items-center gap-2 rounded-lg px-2.5 text-[0.8125rem] font-medium transition-colors hover:bg-accent`,children:[(0,W.jsx)(dg,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}),(0,W.jsx)(`span`,{children:`Auto`}),(0,W.jsx)(oW,{checked:e,onCheckedChange:t,"aria-label":`Auto mode`,"aria-keyshortcuts":`A`}),(0,W.jsx)(XD,{chord:`A`,className:`kbd-hint`})]})}),(0,W.jsx)(UO,{children:`Auto mode: the oracle decides without asking`})]})}function zY(e){let{row:t}=e,{restore:n,archive:r,remove:i,toggleAuto:a}=IY(e),o=t.kind===`archived`,s=t.kind===`task`&&t.check===`open`&&!!t.resumable;return(0,W.jsxs)(uk,{children:[t.kind===`task`&&t.check===`open`?(0,W.jsx)(vY,{row:t,quiet:s}):null,o?(0,W.jsx)(lk,{label:`Restore`,icon:hg,shortcut:`R`,onClick:()=>void n()}):null,t.check===`open`&&!o?(0,W.jsx)(RY,{on:!!t.auto,toggle:a}):null,o?null:(0,W.jsx)(LY,{row:t,archive:r}),(0,W.jsx)(Gk,{icon:qg,label:o?`Delete for good`:`Delete`,text:`Delete`,shortcut:`Delete`,title:`Delete "${t.title}" for good?`,description:`This cannot be undone.`,confirmLabel:`Delete`,variant:`destructive`,onConfirm:()=>void i()})]})}function BY(e){let{row:t}=e,n=t.kind===`plan`,r=zO(`tasks.get`,{taskId:t.id},[`tasks`],!n),i=LO(`lobby`).data?.task,a=i?.id===t.id?i:void 0;if(n)return(0,W.jsx)(xY,{row:t,onGone:e.onGone});let o=t.check===`open`&&t.kind===`task`,s=r.data?r.data.work:t.work;return(0,W.jsxs)(`article`,{className:`flex min-w-0 flex-col gap-5`,"aria-label":t.title,children:[(0,W.jsx)(zY,{...e}),(0,W.jsx)(FY,{row:t,task:a}),r.data?(0,W.jsx)(jY,{row:t,detail:r.data,onChanged:()=>{r.reload(),e.onChanged()}}):null,(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,W.jsx)(SJ,{timing:r.data?.timing??t.timing,...s?{work:s}:{},stopped:t.check!==`open`})}),r.data?.delivery?(0,W.jsx)(IJ,{taskId:t.id,title:t.title,delivery:r.data.delivery,onChanged:r.reload},t.id):null,r.data?(0,W.jsx)(gY,{detail:r.data,finished:!o,...o&&r.data.canSkip?{skip:{taskId:t.id,onSkipped:()=>{r.reload(),e.onChanged()}}}:{}}):null,(0,W.jsx)(VJ,{taskId:t.id,finished:!o,canComment:o}),r.data?(0,W.jsx)(_Y,{detail:r.data}):null,r.error&&!r.data?(0,W.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not load the plan detail. `,r.error]}):null]})}function VY({row:e}){return e.check===`open`&&e.progress?(0,W.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground tabular-nums`,children:[(0,W.jsx)(iH,{done:e.progress.done,total:e.progress.total}),(0,W.jsxs)(`span`,{children:[e.progress.done,`/`,e.progress.total]})]}):e.age&&e.check!==`open`?(0,W.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:e.age}):null}function HY(e){return e.check===`dropped`?`text-muted-foreground line-through`:e.kind===`archived`||e.check===`done`?`text-muted-foreground`:`text-foreground`}function UY({row:e}){return(0,W.jsxs)(W.Fragment,{children:[e.check===`open`?(0,W.jsxs)(`span`,{className:`pl-6 text-xs text-muted-foreground`,children:[YJ(e),e.auto?(0,W.jsxs)(W.Fragment,{children:[` · `,(0,W.jsx)(sH,{})]}):null]}):null,e.kind===`plan`?null:(0,W.jsx)(`span`,{className:`pl-6 text-xs text-muted-foreground`,children:(0,W.jsx)(SJ,{timing:e.timing,...e.work?{work:e.work}:{},stopped:e.check!==`open`})}),e.delivery?(0,W.jsxs)(`span`,{className:`pl-6 text-xs text-foreground`,children:[`Delivery: `,e.delivery.status.replaceAll(`_`,` `),` · open task to review`]}):null]})}function WY({row:e,selected:t,onSelect:n}){return(0,W.jsx)(`li`,{children:(0,W.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,onClick:()=>n(e.id),className:HB,children:[(0,W.jsxs)(`span`,{className:`flex items-start gap-2 text-sm`,children:[(0,W.jsx)(aH,{check:e.check,className:`mt-0.5`}),(0,W.jsxs)(`span`,{className:`sr-only`,children:[UJ[e.check],`:`]}),(0,W.jsx)(`span`,{className:X(`min-w-0 flex-1 break-words`,HY(e),t&&`font-medium text-foreground`),children:e.title}),(0,W.jsx)(VY,{row:e})]}),(0,W.jsx)(UY,{row:e})]})})}function GY({rows:e,selectedId:t,onSelect:n}){return(0,W.jsx)(`div`,{className:`flex flex-col pb-2`,children:XJ(e).map(({section:e,rows:r})=>(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h3`,{className:WB,children:(0,W.jsx)(nB,{title:HJ[e],right:String(r.length),className:`[&>span:first-child]:font-medium [&>span:first-child]:text-muted-foreground`})}),(0,W.jsx)(`ul`,{className:UB,children:r.map(e=>(0,W.jsx)(WY,{row:e,selected:e.id===t,onSelect:n},`${e.kind}-${e.id}`))})]},e))})}var KY=()=>yO(vO(`tasks`)),qY=e=>yO(vO(`tasks`,e));function JY(){return(0,W.jsxs)(xO,{className:`m-4 flex-1`,children:[(0,W.jsxs)(SO,{children:[(0,W.jsx)(wO,{variant:`icon`,children:(0,W.jsx)(_h,{"aria-hidden":`true`})}),(0,W.jsx)(EO,{children:KJ})]}),(0,W.jsx)(Z,{onClick:()=>yO(vO(`plan`)),children:`Plan a task`})]})}function YY({shown:e,count:t,onToggle:n}){return(0,W.jsxs)(`label`,{className:`btn-outline flex h-7 min-w-0 cursor-pointer items-center gap-2 rounded-lg border bg-card px-2 text-xs font-medium transition-[box-shadow]`,children:[(0,W.jsx)(RG,{checked:e,onCheckedChange:n,"aria-label":`Show archived tasks`,className:`size-4`}),`Archived`,(0,W.jsx)(VB,{variant:`secondary`,className:`h-5 px-1.5`,children:t})]})}function XY({id:e}){let t=Ck(),[n,r]=(0,m.useState)(!1),i=zO(`tasks.list`,{},[`tasks`,`plans`]),a=zO(`tasks.archived`,{},[`tasks`]),o=i.data?.rows??[],s=a.data?.rows??[],c=n?[...o,...s]:o,l=e??(t?c[0]?.id:void 0),u=[...c,...s].find(e=>e.id===l&&e.kind===`task`)?.id;if((0,m.useEffect)(()=>(mJ(u),()=>mJ(void 0)),[u]),!i.data&&i.error)return(0,W.jsx)(NO,{message:`Could not load tasks. ${i.error}`,onRetry:i.reload});if(i.data&&o.length===0&&s.length===0)return(0,W.jsx)(JY,{});let d=[...c,...s].find(e=>e.id===l),f=(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Ok,{title:`Tasks`,count:ZJ(c),children:(0,W.jsx)(YY,{shown:n,count:s.length,onToggle:()=>r(e=>!e)})}),i.data?c.length===0?(0,W.jsx)(`p`,{className:`p-4 text-sm text-muted-foreground`,children:KJ}):(0,W.jsx)(GY,{rows:c,selectedId:l,onSelect:qY}):(0,W.jsx)(kk,{})]}),p=d?(0,W.jsx)(BY,{row:d,onGone:KY,onChanged:i.reload},d.id):e?(0,W.jsx)(ZY,{}):null;return(0,W.jsx)(Dk,{wide:t,list:f,detail:p,open:!!e,onClose:KY,hint:`Select a task to see its detail.`,describe:`Task detail`})}function ZY(){return(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`That task is not on the list any more.`})}var QY={l:`lobby`,p:`plan`,t:`tasks`,u:`git`,n:`knowledge`,e:`settings`};function $Y(e){if(e.kind===`settings`)return(0,W.jsx)(HK,{});switch(e.tab){case`lobby`:return(0,W.jsx)(wU,{});case`tasks`:return(0,W.jsx)(XY,{...xU(e.rest)});case`plan`:return(0,W.jsx)(lJ,{rest:e.rest});case`git`:return(0,W.jsx)(PV,{rest:e.rest});case`knowledge`:return(0,W.jsx)(bU,{rest:e.rest})}}function eX(e,t){return t.overlay?!0:e===`savePlan`&&!t.saveAvailable}var tX={tab:`Tab`,esc:`Escape`,escape:`Escape`,enter:`Enter`,space:`Space`,pageup:`PageUp`,pagedown:`PageDown`,home:`Home`,end:`End`,"`":`Backquote`,"]":`BracketRight`,"[":`BracketLeft`,"/":`Slash`,"?":`Slash`,",":`Comma`,".":`Period`};function nX(e){return e.length===1&&/[a-z]/i.test(e)?`Key${e.toUpperCase()}`:e.length===1&&/[0-9]/.test(e)?`Digit${e}`:tX[e]}function rX(e){let t={alt:!1,ctrl:!1,shift:!1,meta:!1,code:``};for(let n of e.toLowerCase().split(`+`))if(n===`alt`)t.alt=!0;else if(n===`ctrl`||n===`control`)t.ctrl=!0;else if(n===`shift`)t.shift=!0;else if(n===`meta`||n===`cmd`)t.meta=!0;else{let e=nX(n);if(!e)return;t.code=e}return t.code?t:void 0}function iX(e,t){return e.code===t.code&&e.altKey===t.alt&&e.ctrlKey===t.ctrl&&e.shiftKey===t.shift&&e.metaKey===t.meta}function aX(e,t){let n=rX(t);return n?iX(e,n):!1}function oX(e,t){for(let n of t)if(aX(e,n.key))return n.action}function sX(e,t){for(let n of t)if(aX(e,n.key))return n.id}function cX(e){return KO(e.target)||e.target instanceof HTMLInputElement||e.target instanceof HTMLSelectElement||sO()||!!document.querySelector(`[role='dialog'], [role='menu'], [role='listbox']`)}function lX(e,t,n,r){let i=!e.shiftKey&&/^[1-9]$/.test(e.key)?t[Number(e.key)-1]:void 0;if(i)r(i.id);else if(e.key===`/`)n(`search`);else if(e.key===`?`)n(`help`);else if(e.key===`j`||e.key===`k`)QO(e.key===`j`?1:-1);else return!1;return!0}function uX(e,t){let n=sX(e,t.tabs),r=oX(e,t.keys);return!n&&!r?!1:eX(r,{overlay:!!document.querySelector(`[role='dialog']:not([data-state='closed']), [role='menu']:not([data-state='closed']), [role='listbox']`)||sO(),typing:KO(e.target)||e.target instanceof HTMLInputElement,saveAvailable:!!document.querySelector(`[data-plan-save]:not([disabled])`)})||(r===`search`||r===`savePlan`)&&!t.insideApp()?!0:(e.preventDefault(),n?t.onTab(n):r&&t.onAction(r),!0)}function dX(e,t,n){if(e.key===`Escape`)return Date.now()<n&&e.preventDefault(),0;if(Date.now()<n){let n=QY[e.key];return n&&(e.preventDefault(),t.onTab(n)),0}return e.key===`g`?Date.now()+1500:(lX(e,t.tabs,t.onAction,t.onTab)&&e.preventDefault(),0)}function fX(e){(0,m.useEffect)(()=>{if(!e.enabled)return;let t=0,n=n=>{if(n.defaultPrevented||n.isComposing)return;if(n.target instanceof Element&&n.target.closest(`.xterm`)){oX(n,e.keys)===`terminal`&&(n.preventDefault(),e.onAction(`terminal`));return}if(!e.insideApp()){oX(n,e.keys)===`help`&&(n.preventDefault(),e.onAction(`help`));return}let r=!n.altKey&&!n.ctrlKey&&!n.metaKey;if(r&&cX(n)){t=0;return}if(uX(n,e)){t=0;return}t=r?dX(n,e,t):0};return window.addEventListener(`keydown`,n,!0),()=>window.removeEventListener(`keydown`,n,!0)},[e.enabled,e.keys,e.tabs,e.insideApp,e.onAction,e.onTab])}var pX=[{id:`focus`,caps:[`/`],help:`focus search, or the message box`},{id:`send`,label:`Enter`,help:`send the message`},{id:`newline`,label:`Shift+Enter`,help:`a new line (lists carry on)`},{id:`format`,label:`Ctrl+B`,help:`bold; Ctrl+I italic, Ctrl+E code, Ctrl+K link`},{id:`leave`,label:`Esc`,help:`leave the box for the tab bar`}],mX=[{id:`digits`,caps:[`1`,`…`,`9`],help:`jump to a tab in current order`},{id:`help`,caps:[`?`],help:`keyboard shortcuts`},...Object.entries(QY).map(([e,t])=>({id:`go.${t}`,caps:[`g`,e],help:`jump to ${t}`})),{id:`project`,caps:[`P`],help:`open the project switcher`},{id:`theme`,caps:[`D`],help:`switch between light and dark`},{id:`edit`,label:`Ctrl+Enter`,help:`save an edited message; Esc cancels`}],hX=[{id:`tasks`,page:`Tasks`,keys:[[`E`,`archive`],[`R`,`restore`],[`A`,`auto mode`],[`Delete`,`delete`]]},{id:`saved`,page:`Saved plan`,keys:[[`S`,`start here`],[`N`,`new session`],[`Delete`,`discard`]]},{id:`plan`,page:`Plan`,keys:[[`A`,`answer`],[`R`,`retry`],[`Ctrl+S`,`save`],[`N`,`new plan`]]},{id:`git`,page:`Git`,keys:[[`R`,`refresh both lists`],[`V`,`review`],[`Q`,`Jev's read`],[`X`,`stop`],[`N`,`plan an issue`]]},{id:`knowledge`,page:`Knowledge`,keys:[[`E`,`edit`],[`A`,`add`],[`C`,`comment`],[`F`,`edit file`],[`Delete`,`delete`]]},{id:`confirm`,page:`Asked to confirm`,keys:[[`Y`,`yes, do it`],[`Esc`,`keep it`]]}],gX=[{id:`enter`,caps:[`↓`],help:`from the tab bar, into the page`},{id:`rows`,caps:[`↑`,`↓`],help:`move through a list (j and k work too)`},{id:`pane`,caps:[`←`,`→`],help:`between a list and its detail (h and l)`},{id:`ends`,caps:[`Home`,`End`],help:`first and last row`},{id:`open`,caps:[`Enter`,`Space`],help:`activate the focused button or row (links: Enter; checkboxes: Space)`},{id:`back`,label:`Esc`,help:`back up to the tab bar`}],_X=[{id:`qmove`,caps:[`↑`,`↓`],help:`move between the options`},{id:`qpick`,label:`Space`,help:`pick an option (several when allowed)`},{id:`qchoose`,label:`Enter`,help:`choose and go on; in your own answer, send it`},{id:`qacross`,caps:[`←`,`→`],help:`previous and next question`},{id:`qdigit`,caps:[`1`,`2`,`…`],help:`pick that option`},{id:`qesc`,label:`Esc`,help:`put the question away for later`}];function vX({line:e}){return(0,W.jsxs)(`div`,{className:`flex items-center gap-3 py-1`,children:[(0,W.jsx)(`span`,{className:`flex w-28 shrink-0 items-center`,children:e.caps?(0,W.jsx)(`span`,{className:`inline-flex items-center gap-1`,children:e.caps.map(e=>(0,W.jsx)(WD,{children:e},e))}):(0,W.jsx)(XD,{chord:e.label??``})}),(0,W.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:e.help})]})}function yX(){return(0,W.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,W.jsx)(`h3`,{className:`mb-1 text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:`Buttons on a page`}),hX.map(e=>(0,W.jsxs)(`div`,{className:`flex items-start gap-3 py-1`,children:[(0,W.jsx)(`span`,{className:`w-28 shrink-0 pt-0.5 text-sm font-medium`,children:e.page}),(0,W.jsx)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1.5 text-sm text-muted-foreground`,children:e.keys.map(([e,t])=>(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,W.jsx)(XD,{chord:e}),t]},e))})]},e.id))]})}function bX({title:e,lines:t}){return(0,W.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,W.jsx)(`h3`,{className:`mb-1 text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:e}),t.map(e=>(0,W.jsx)(vX,{line:e},e.id))]})}function xX(e){return e.map(e=>({id:e.action,label:e.label,help:e.help}))}function SX(e){return e.map(e=>({id:`tab.${e.id}`,label:e.key,help:`jump to the ${e.label} tab`}))}function CX({open:e,onOpenChange:t,keys:n,tabs:r}){let i=e,a=oO(i,aO.help),o=(0,m.useRef)(null);return(0,m.useEffect)(()=>{if(!i||!a)return;let e=e=>{let r=n.find(e=>e.action===`help`)?.key;(e.key===`Escape`||r&&aX(e,r))&&(e.preventDefault(),t(!1))};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[n,t,a,i]),(0,W.jsxs)(QD,{open:i&&a,onOpenChange:t,label:`Keys`,className:`max-w-4xl`,children:[(0,W.jsxs)(`header`,{className:`flex items-center justify-between gap-3 border-b border-border px-4 py-3`,children:[(0,W.jsx)(`h2`,{"aria-hidden":`true`,className:`text-base font-semibold tracking-tight`,children:`Keyboard shortcuts`}),(0,W.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(XD,{chord:`Esc`}),(0,W.jsx)(Z,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Close`,onClick:()=>t(!1),children:(0,W.jsx)(d_,{"aria-hidden":`true`})})]})]}),(0,W.jsxs)(`div`,{ref:o,className:`grid min-h-0 flex-1 grid-cols-2 gap-x-10 gap-y-6 overflow-y-auto p-4`,children:[(0,W.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,W.jsx)(bX,{title:`Everywhere`,lines:xX(n)}),(0,W.jsx)(bX,{title:`Jump to a tab`,lines:SX(r)}),(0,W.jsx)(bX,{title:`Navigation and editing`,lines:mX}),(0,W.jsx)(bX,{title:`Message box`,lines:pX})]}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,W.jsx)(bX,{title:`Lists and panes`,lines:gX}),(0,W.jsx)(yX,{}),(0,W.jsx)(bX,{title:`Questions`,lines:_X})]})]}),(0,W.jsx)(Gv,{target:o})]})}var wX=`size-[1.05rem]`;function TX({hint:e,onHelp:t,className:n,side:r=`top`}){return(0,W.jsxs)(VO,{children:[(0,W.jsx)(HO,{asChild:!0,children:(0,W.jsx)(`button`,{type:`button`,"aria-label":`Keyboard shortcuts`,"aria-haspopup":`dialog`,"aria-keyshortcuts":e,"aria-describedby":`focused-action-help`,onClick:t,className:n,children:(0,W.jsx)(ph,{"aria-hidden":`true`,className:wX})})}),(0,W.jsxs)(UO,{side:r,children:[`Keyboard shortcuts `,(0,W.jsx)(XD,{chord:e})]})]})}function EX({className:e,side:t=`top`}){let n=IU(),r=n?`Unmute prompt sounds`:`Mute prompt sounds`;return(0,W.jsx)(W.Fragment,{children:(0,W.jsxs)(VO,{children:[(0,W.jsx)(HO,{asChild:!0,children:(0,W.jsx)(`button`,{type:`button`,"aria-label":r,"aria-pressed":n,"aria-describedby":`focused-action-help`,className:e,onClick:()=>PU(!n),children:n?(0,W.jsx)(r_,{"aria-hidden":`true`,className:wX}):(0,W.jsx)(t_,{"aria-hidden":`true`,className:wX})})}),(0,W.jsx)(UO,{side:t,children:r})]})})}function DX({className:e,side:t=`top`}){let{theme:n,setTheme:r}=KW(),i=n===`dark`||n===`system`&&typeof window<`u`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches;return(0,W.jsxs)(VO,{children:[(0,W.jsx)(HO,{asChild:!0,children:(0,W.jsx)(`button`,{type:`button`,"aria-label":i?`Switch to light mode`:`Switch to dark mode`,"aria-keyshortcuts":`D`,"aria-describedby":`focused-action-help`,onClick:()=>r(i?`light`:`dark`),className:e,children:i?(0,W.jsx)(zg,{"aria-hidden":`true`,className:wX}):(0,W.jsx)(Vh,{"aria-hidden":`true`,className:wX})})}),(0,W.jsxs)(UO,{side:t,children:[i?`Light mode`:`Dark mode`,` `,(0,W.jsx)(XD,{chord:`D`})]})]})}var OX=[{id:`light`,label:`Light`},{id:`dark`,label:`Dark`},{id:`system`,label:`System`}];function kX({className:e,side:t=`top`}){let{theme:n,setTheme:r}=KW();return(0,W.jsxs)(wW,{children:[(0,W.jsxs)(VO,{children:[(0,W.jsx)(HO,{asChild:!0,children:(0,W.jsx)(TW,{asChild:!0,children:(0,W.jsx)(`button`,{type:`button`,"aria-label":`Appearance`,className:e,children:(0,W.jsx)(Uh,{"aria-hidden":`true`,className:wX})})})}),(0,W.jsx)(UO,{side:t,children:`Appearance`})]}),(0,W.jsxs)(EW,{side:t===`right`?`right`:`top`,align:t===`right`?`start`:`center`,sideOffset:10,collisionPadding:12,"aria-label":`Appearance`,onOpenAutoFocus:e=>{e.preventDefault(),e.currentTarget.focus({preventScroll:!0})},tabIndex:-1,className:`glass-pop flex max-h-[85svh] w-[26rem] max-w-[calc(100vw-1.5rem)] flex-col gap-3 overflow-y-auto rounded-2xl p-3`,children:[(0,W.jsx)(fk,{label:`Mode`,items:OX,value:n,onChange:e=>r(e),className:`w-full [&>button]:flex-1`}),(0,W.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,W.jsx)(`p`,{className:`px-0.5 text-xs font-medium text-muted-foreground`,children:`Colour theme`}),(0,W.jsx)(`div`,{className:`[&_[role=radiogroup]]:!grid-cols-3 [&_[role=radiogroup]]:gap-1.5`,children:(0,W.jsx)(NG,{})})]}),(0,W.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,W.jsx)(`p`,{className:`px-0.5 text-xs font-medium text-muted-foreground`,children:`Typeface`}),(0,W.jsx)(qW,{kind:`font`,dense:!0})]}),(0,W.jsx)(`a`,{href:`#/settings`,className:`px-0.5 text-xs text-link underline-offset-2 hover:underline`,children:`More in Settings`})]})]})}function AX({className:e,side:t=`top`}){let n=KU(),r=n?`Turn off desktop notifications`:`Turn on desktop notifications`,i=async()=>{if(n)return JU();let e=await qU();e===`granted`?G.success(`Desktop notifications are on.`):G.error(e===`unsupported`?`This browser cannot show notifications.`:`Notifications are blocked for this page in the browser's settings.`)};return(0,W.jsxs)(VO,{children:[(0,W.jsx)(HO,{asChild:!0,children:(0,W.jsx)(`button`,{type:`button`,"aria-label":r,"aria-pressed":n,className:e,onClick:()=>void i(),children:n?(0,W.jsx)(Vp,{"aria-hidden":`true`,className:wX}):(0,W.jsx)(zp,{"aria-hidden":`true`,className:wX})})}),(0,W.jsx)(UO,{side:t,children:r})]})}function jX({className:e,side:t=`top`}){let n=x();if(!n.supported)return null;let r=n.on?`Leave full screen`:`Full screen`;return(0,W.jsxs)(VO,{children:[(0,W.jsx)(HO,{asChild:!0,children:(0,W.jsx)(`button`,{type:`button`,"aria-label":r,"aria-pressed":n.on,className:e,onClick:()=>void n.toggle(),children:n.on?(0,W.jsx)(zh,{"aria-hidden":`true`,className:wX}):(0,W.jsx)(Dh,{"aria-hidden":`true`,className:wX})})}),(0,W.jsx)(UO,{side:t,children:r})]})}function MX(e){return e>=1048576?`${(e/1024/1024).toFixed(1)} MB`:e>=1024?`${Math.round(e/1024)} KB`:`${e} B`}async function NX(e){if(e.size===0)throw Error(`${e.name||`That file`} is empty.`);if(e.size>20971520)throw Error(`${e.name||`That file`} is larger than 20 MB.`);let t=new URLSearchParams({name:e.name||`pasted-file`,type:e.type}),n=await fetch(L(`/api/files.upload?${t}`),{method:`POST`,headers:{"Content-Type":`application/octet-stream`},body:e,credentials:`same-origin`}),r=await n.json().catch(()=>void 0);if(!r)throw new ye(`the lobby answered ${n.status}`,`failed`,n.status);if(!r.ok)throw new ye(r.error,r.code,n.status);return r.result}function PX(e,t,n,r){let i=e.slice(0,t),a=e.slice(t,n),o=e.slice(n);if(a.length>=r.length*2&&a.startsWith(r)&&a.endsWith(r)){let e=a.slice(r.length,a.length-r.length);return{value:i+e+o,start:t,end:t+e.length}}return i.endsWith(r)&&o.startsWith(r)?{value:i.slice(0,i.length-r.length)+a+o.slice(r.length),start:t-r.length,end:n-r.length}:{value:i+r+a+r+o,start:t+r.length,end:n+r.length}}function FX(e,t,n){let r=e.slice(t,n)||`text`,i=`[${r}](url)`,a=t+r.length+3;return{value:e.slice(0,t)+i+e.slice(n),start:a,end:a+3}}var IX=/^(\s*)(?:([-*+])|(\d+)([.)]))\s+(\[[ xX]\]\s+)?/;function LX(e,t){let n=e.lastIndexOf(`
101
- `,t-1)+1,r=e.indexOf(`
102
- `,t),i=e.slice(n,r<0?e.length:r),a=IX.exec(i);if(!a||t-n<a[0].length)return;let[o,s=``,c,l,u=`.`,d]=a;if(i.slice(o.length).trim()===``)return{value:e.slice(0,n)+e.slice(r<0?e.length:r),start:n,end:n};let f=`\n${s}${c??`${Number(l)+1}${u}`} ${d?`[ ] `:``}`;return{value:e.slice(0,t)+f+e.slice(t),start:t+f.length,end:t+f.length}}function RX({rest:e}){let{chat:t}=BH(e);return(0,W.jsx)(`div`,{role:`group`,"aria-label":`Knowledge pane`,className:`flex items-center gap-0.5 rounded-lg bg-muted p-0.5`,children:[`Chat`,`Docs`].map(n=>(0,W.jsx)(`button`,{type:`button`,"aria-pressed":t===(n===`Chat`),onClick:()=>yO(VH(e,n===`Chat`)),className:X(`h-6 rounded-md border px-2.5 text-xs font-medium outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,t===(n===`Chat`)?`btn-outline btn-soft bg-card text-foreground`:`btn-ghost text-muted-foreground hover:text-foreground`),children:n},n))})}function zX(e,t){return X(`relative inline-flex shrink-0 cursor-pointer items-center justify-center whitespace-nowrap rounded-(--control-radius) border border-transparent text-base outline-none hover:bg-accent data-pressed:bg-accent data-[state=open]:bg-accent aria-expanded:bg-accent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 data-disabled:pointer-events-none data-disabled:opacity-64 pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 [&:active:not([aria-haspopup])]:scale-[0.97] motion-reduce:[&:active:not([aria-haspopup])]:scale-100 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:-mx-0.5 [&_svg[data-composer-control-icon]]:mx-0`,e===`xs`?`h-7 gap-1 px-1.75 font-normal text-muted-foreground/70 text-sm hover:text-foreground/80 sm:h-[1.625rem] sm:text-xs [&_svg:not([class*='size-'])]:size-4 sm:[&_svg:not([class*='size-'])]:size-3.5 [&_svg[data-composer-control-chevron]]:ms-0 [&_svg[data-composer-control-chevron]]:-me-1`:`h-7 gap-1.5 px-2.5 font-medium text-secondary-label [&_svg:not([class*='text-'])]:text-muted-foreground hover:text-foreground sm:text-sm [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4`,`aria-pressed:bg-accent aria-pressed:text-accent-foreground aria-pressed:hover:bg-accent/80`,t)}function BX({className:e,size:t=`sm`,asChild:n=!1,...r}){let i=n?ry:`button`;return(0,W.jsx)(i,{type:n?void 0:`button`,className:zX(t,e),...r})}function VX(e){let[t,n]=(0,m.useState)(!1),[r,i]=(0,m.useState)();async function a(r){if(!t){n(!0),i(void 0);try{let{project:t}=await z(`projects.open`,{path:r});ge([t]),R(t.id,e)}catch(e){i(e.message)}finally{n(!1)}}}return{opening:t,error:r,open:a}}function HX({path:e,parent:t,busy:n,browse:r}){let[i,a]=(0,m.useState)(e);return(0,m.useEffect)(()=>a(e),[e]),(0,W.jsxs)(`form`,{className:`flex h-9 min-w-0 items-center rounded-md border border-input bg-background shadow-xs transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/20`,onSubmit:e=>{e.preventDefault(),r(i)},children:[(0,W.jsx)(`button`,{type:`button`,"aria-label":`Parent folder`,title:`Parent folder (Backspace)`,disabled:n||!t,onClick:()=>t&&r(t),className:`grid h-full w-9 shrink-0 place-items-center border-r border-input text-muted-foreground transition-colors outline-none hover:bg-muted hover:text-foreground focus-visible:bg-muted disabled:pointer-events-none disabled:opacity-40`,children:(0,W.jsx)(Lp,{"aria-hidden":`true`,className:`size-4`})}),(0,W.jsx)(`input`,{"aria-label":`Folder path`,value:i,disabled:n,spellCheck:!1,autoComplete:`off`,onChange:e=>a(e.target.value),className:`h-full min-w-0 flex-1 bg-transparent px-3 font-mono text-[0.8125rem] text-foreground outline-none placeholder:text-muted-foreground disabled:opacity-60`}),(0,W.jsx)(`button`,{type:`submit`,disabled:n||!i.trim(),className:`h-full shrink-0 border-l border-input px-3 text-xs font-medium text-muted-foreground transition-colors outline-none hover:bg-muted hover:text-foreground focus-visible:bg-muted disabled:pointer-events-none disabled:opacity-40`,children:`Go`})]})}function UX(e,t,n){let r=[...e.currentTarget.querySelectorAll(`button[data-folder]:not(:disabled)`)],i=r.indexOf(document.activeElement),a={ArrowDown:Math.min(r.length-1,i+1),ArrowUp:Math.max(0,i-1),Home:0,End:r.length-1}[e.key];a!==void 0&&r.length>0?(e.preventDefault(),r[a]?.focus()):e.key===`Backspace`&&t&&(e.preventDefault(),n(t))}function WX({data:e,loading:t,busy:n,browse:r}){let i=e?.folders.length??0;return(0,W.jsxs)(`div`,{className:`flex min-h-0 flex-col overflow-hidden rounded-md border border-border`,children:[(0,W.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center justify-between border-b border-border bg-muted/50 px-3 text-[0.7rem] font-medium tracking-wide text-muted-foreground uppercase`,children:[(0,W.jsx)(`span`,{children:`Name`}),(0,W.jsx)(`span`,{className:`normal-case tracking-normal`,children:t?`Loading…`:`${i.toLocaleString()} ${i===1?`folder`:`folders`}${e?.truncated?` (first 2,000)`:``}`})]}),(0,W.jsxs)(`div`,{"aria-label":`Folders`,role:`group`,onKeyDown:t=>UX(t,e?.parent,r),className:`h-64 overflow-y-auto overscroll-contain py-1`,children:[e?.folders.map(e=>{let t=e.name.startsWith(`.`);return(0,W.jsxs)(`button`,{type:`button`,"data-folder":!0,disabled:n,onClick:()=>r(e.path),title:e.path,className:`group/row flex h-8 w-full min-w-0 items-center gap-2.5 px-3 text-left text-[0.8125rem] transition-colors outline-none hover:bg-muted focus-visible:bg-accent focus-visible:text-accent-foreground disabled:opacity-60`,children:[(0,W.jsx)(rh,{"aria-hidden":`true`,className:X(`size-4 shrink-0`,t?`text-muted-foreground/60`:`text-muted-foreground`)}),(0,W.jsx)(`span`,{className:X(`min-w-0 flex-1 truncate`,t&&`text-muted-foreground`),children:e.name}),(0,W.jsx)(rm,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground/0 transition-colors group-hover/row:text-muted-foreground group-focus-visible/row:text-muted-foreground`})]},e.path)}),e&&!i?(0,W.jsx)(`p`,{className:`px-3 py-6 text-center text-xs text-muted-foreground`,children:`No subfolders. You can open this folder.`}):null,e?.truncated?(0,W.jsx)(`p`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:`Only the first 2,000 entries are listed. Enter a path to go further.`}):null]})]})}function GX({tab:e,close:t,busyChanged:n}){let[r,i]=(0,m.useState)(),a=zO(`projects.browse`,r===void 0?{}:{path:r},[]),o=VX(e);return(0,m.useEffect)(()=>n(o.opening),[o.opening,n]),(0,W.jsxs)(`div`,{className:`flex min-h-0 max-h-full w-full flex-col overflow-y-auto`,children:[(0,W.jsxs)(`div`,{className:`flex flex-col gap-1 border-b border-border px-4 py-3`,children:[(0,W.jsx)(`h2`,{className:`text-[0.9375rem] font-semibold`,children:`Open project folder`}),(0,W.jsx)(`p`,{className:`break-words text-xs text-muted-foreground`,children:`Folders on the machine running bot-lobby. The project opens in a session of its own; this one keeps running, and its project-local extensions stay off until you enable them.`})]}),(0,W.jsxs)(`div`,{className:`flex min-h-0 flex-col gap-3 p-4`,children:[(0,W.jsx)(HX,{path:a.data?.path??r??``,parent:a.data?.parent,busy:o.opening,browse:i}),(0,W.jsx)(WX,{data:a.data,loading:a.loading,busy:a.loading||o.opening,browse:i}),a.loading?(0,W.jsx)(`p`,{role:`status`,className:`sr-only`,children:`Loading folders…`}):null,a.error||o.error?(0,W.jsx)(`p`,{role:`alert`,className:`break-words text-xs text-destructive`,children:a.error??o.error}):null]}),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2 border-t border-border bg-muted/30 px-4 py-3`,children:[a.error?(0,W.jsx)(Z,{variant:`outline`,onClick:a.reload,disabled:a.loading,children:`Retry`}):null,(0,W.jsx)(Z,{variant:`outline`,onClick:t,disabled:o.opening,children:`Cancel`}),(0,W.jsx)(Z,{disabled:!a.data||a.loading||!!a.error||o.opening,onClick:()=>void o.open(a.data.path),children:o.opening?`Opening project…`:`Open this folder`})]})]})}function KX({open:e,onClose:t,tab:n}){let r=oO(e,aO.help),[i,a]=(0,m.useState)(!1);return(0,W.jsx)(QD,{open:r,label:`Open project folder`,className:`max-w-[40rem]`,onOpenChange:e=>{!e&&!i&&t()},dismissOnBackdrop:!i,onCloseAutoFocus:e=>{e.preventDefault(),document.querySelector(`[role="combobox"][aria-label="Project"]`)?.focus()},children:e?(0,W.jsx)(GX,{tab:n,close:t,busyChanged:a}):null})}function qX(){try{return{id:de()}}catch(e){return{error:e.message}}}function JX(e,t){if(e){if(t&&!e.projects.some(e=>e.id===t))return`Selected project is unknown or offline. Refresh or choose a running project.`;if(!e.projects.length)return`No authorized running projects found. Open a folder from the Project menu, or refresh.`}}function YX(){let[e,t]=(0,m.useState)(),[n,r]=(0,m.useState)(),[i,a]=(0,m.useState)(!1),o=(0,m.useRef)(0);async function s(){let e=++o.current;a(!0),r(void 0);try{let n=await z(`projects.list`,{});ge(n.projects),e===o.current&&t(n)}catch(t){e===o.current&&r(t.message)}finally{e===o.current&&a(!1)}}(0,m.useEffect)(()=>(s(),()=>{o.current++}),[]);let[c,l]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{if(!i)return l(!1);let e=setTimeout(()=>l(!0),300);return()=>clearTimeout(e)},[i]),{data:e,error:n,busy:i,slow:c,refresh:s}}function XX({data:e,error:t}){let n=qX();return n.error??t??JX(e,n.id)}function ZX({projects:e}){let t=XX(e);return t?(0,W.jsxs)(`p`,{role:`alert`,className:`notice flex min-w-0 items-start gap-2 pt-1 pb-0.5 text-xs break-words text-destructive`,children:[(0,W.jsx)(Yg,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:t})]}):null}function QX(e){let t=e.key===`ArrowDown`?1:e.key===`ArrowUp`?-1:0,n=e.key===`Home`?`first`:e.key===`End`?`last`:void 0;if(!t&&!n)return;let r=[...e.currentTarget.querySelectorAll(`[role='option']`)];if(r.length===0)return;e.preventDefault();let i=r.indexOf(document.activeElement);r[n===`first`?0:n===`last`?r.length-1:Math.max(0,Math.min(r.length-1,(i<0?t>0?-1:r.length:i)+t))]?.focus()}var $X=`bot-lobby:open-projects`;function eZ({projects:e,tab:t,name:n,branch:r}){let{data:i,busy:a,slow:o,refresh:s}=e,[c,l]=(0,m.useState)(!1),[u,d]=(0,m.useState)(!1),f=qX(),p=XX(e),h=f.error?`invalid`:f.id??i?.currentId??``;sk(`p`,()=>l(!0)),(0,m.useEffect)(()=>{let e=()=>l(!0);return window.addEventListener($X,e),()=>window.removeEventListener($X,e)},[]),sk(`r`,()=>void s(),{enabled:c,inDialog:!0});function g(e){l(!1),e!==h&&R(e,t)}return(0,W.jsxs)(`div`,{"aria-busy":a,className:`flex min-w-0 items-center gap-1`,children:[(0,W.jsxs)(wW,{open:c,onOpenChange:l,children:[(0,W.jsxs)(TW,{type:`button`,role:`combobox`,"aria-label":`Project`,"aria-description":`${n}${r?`, branch ${r}`:``}`,"aria-haspopup":`listbox`,"aria-expanded":c,"aria-keyshortcuts":`P ArrowDown`,onKeyDown:e=>{e.key!==`ArrowDown`||e.altKey||e.metaKey||e.ctrlKey||(e.preventDefault(),l(!0))},title:r?`${n} · ${r}`:n,className:X(`group flex min-w-0 items-center outline-none transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring disabled:pointer-events-none`,zX(`xs`,`min-w-0 justify-start`)),children:[(0,W.jsx)(rh,{"aria-hidden":`true`,className:X(`size-3 shrink-0`,p&&`text-destructive`)}),(0,W.jsx)(`span`,{className:`truncate`,children:n}),(0,W.jsx)($p,{"aria-hidden":`true`,className:`size-3 shrink-0 opacity-50`})]}),(0,W.jsxs)(EW,{align:`start`,side:`top`,sideOffset:8,"aria-label":`Projects`,onKeyDown:QX,onOpenAutoFocus:e=>{let t=e.currentTarget?.querySelector(`[role='option'][aria-selected='true']`)??e.currentTarget?.querySelector(`[role='option']`);t&&(e.preventDefault(),t.focus())},className:`p-0 flex max-h-[calc(100svh-2rem)] w-[min(26rem,calc(100vw-1.5rem))] origin-(--radix-popover-content-transform-origin) flex-col overflow-hidden rounded-xl outline-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border px-3 py-2`,children:[(0,W.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:`Running projects`}),(0,W.jsxs)(`button`,{type:`button`,onClick:()=>void s(),disabled:a,"aria-label":`Refresh list`,"aria-keyshortcuts":`R`,className:`inline-flex h-7 items-center gap-1.5 rounded-lg px-2 text-xs text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring disabled:opacity-60`,children:[a?(0,W.jsx)(DO,{"aria-hidden":`true`,role:`presentation`,className:`size-3`}):(0,W.jsx)(dg,{"aria-hidden":`true`,className:`size-3`}),`Refresh`,(0,W.jsx)(XD,{chord:`R`,className:`kbd-hint`})]})]}),(0,W.jsx)(`div`,{role:`listbox`,"aria-label":`Projects`,className:`flex max-h-72 flex-col overflow-y-auto overscroll-contain p-1`,children:i?.projects.map(e=>{let t=e.id===h;return(0,W.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t,onClick:()=>g(e.id),className:X(`flex min-h-10 w-full items-start gap-2.5 rounded-lg px-2.5 py-2 text-left outline-none transition-colors hover:bg-muted focus-visible:bg-muted focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,t&&`bg-accent`),children:[(0,W.jsx)(`span`,{className:`flex h-5 w-4 shrink-0 items-center justify-center`,children:t?(0,W.jsx)(Zp,{"aria-hidden":`true`,className:`size-3.5 text-primary`}):null}),(0,W.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,W.jsx)(`span`,{className:`block whitespace-normal break-words text-sm font-medium`,children:e.name}),(0,W.jsxs)(`span`,{className:`block whitespace-normal break-all text-xs text-muted-foreground`,children:[e.cwd,` · :`,e.port]})]})]},e.id)})}),(0,W.jsxs)(`button`,{type:`button`,className:`flex min-h-11 items-center gap-2 border-t border-border px-3 py-3 text-sm font-medium outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,onClick:()=>{l(!1),d(!0)},children:[(0,W.jsx)(th,{"aria-hidden":`true`,className:`size-4`}),`Open folder…`]})]})]}),(0,W.jsx)(KX,{open:u,onClose:()=>d(!1),tab:t}),o||p?(0,W.jsxs)(VO,{children:[(0,W.jsx)(HO,{asChild:!0,children:(0,W.jsx)(`button`,{type:`button`,"aria-label":`Refresh projects`,disabled:a,onClick:()=>void s(),className:X(`inline-flex shrink-0 items-center justify-center text-muted-foreground outline-none transition-[background-color,color,scale] hover:text-foreground focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring active:scale-[0.97] disabled:opacity-60 motion-reduce:active:scale-100`,zX(`xs`,`w-7 px-0 sm:w-[1.625rem]`)),children:a?(0,W.jsx)(DO,{"aria-hidden":`true`,role:`presentation`,className:`size-3.5`}):(0,W.jsx)(dg,{"aria-hidden":`true`,className:`size-3.5`})})}),(0,W.jsx)(UO,{side:`top`,children:`Refresh projects`})]}):null]})}function tZ({contextStrip:e=!1,className:t,...n}){return(0,W.jsx)(`div`,{"data-slot":`composer-shell`,"data-with-context":e||void 0,className:X(`@container/composer-surface group/composer-surface relative isolate mx-auto w-full max-w-(--chat-content-max-width)`,`[--chat-composer-drawer-inset:1.375rem] [--chat-composer-glass-surface:var(--card)] [--chat-composer-outline:rgb(0_0_0/8%)]`,`dark:[--chat-composer-glass-surface:var(--surface-raised)] dark:[--chat-composer-highlight:rgb(255_255_255/3%)] dark:[--chat-composer-outline:color-mix(in_srgb,var(--color-white)_5%,transparent)]`,`before:pointer-events-none before:absolute before:inset-0 before:z-0 before:rounded-3xl before:bg-(--chat-composer-glass-surface)/(--glass-opacity) before:backdrop-blur-(--glass-blur) before:backdrop-saturate-(--glass-saturation)`,`not-supports-[((backdrop-filter:blur(1px))_or_(-webkit-backdrop-filter:blur(1px)))]:before:bg-(--chat-composer-glass-surface)`,`has-data-[composer-banner-surface=attached]:before:hidden data-model-strip-transition:before:hidden`,e&&[`[--chat-composer-context-extension:2.25rem] sm:[--chat-composer-context-extension:2rem]`,`before:[clip-path:shape(from_0_22px,curve_to_22px_0_with_0_9.85px/9.85px_0,line_to_calc(100%-22px)_0,curve_to_100%_22px_with_calc(100%-9.85px)_0/100%_9.85px,line_to_100%_calc(100%-var(--chat-composer-context-extension)-var(--chat-composer-drawer-inset)),curve_to_calc(100%-var(--chat-composer-drawer-inset))_calc(100%-var(--chat-composer-context-extension))_with_100%_calc(100%-var(--chat-composer-context-extension)-var(--chat-composer-drawer-inset)*0.4477)/calc(100%-var(--chat-composer-drawer-inset)*0.4477)_calc(100%-var(--chat-composer-context-extension)),line_to_calc(100%-var(--chat-composer-drawer-inset))_calc(100%-16px),curve_to_calc(100%-var(--chat-composer-drawer-inset)-16px)_100%_with_calc(100%-var(--chat-composer-drawer-inset))_calc(100%-7.16px)/calc(100%-var(--chat-composer-drawer-inset)-7.16px)_100%,line_to_calc(var(--chat-composer-drawer-inset)+16px)_100%,curve_to_var(--chat-composer-drawer-inset)_calc(100%-16px)_with_calc(var(--chat-composer-drawer-inset)+7.16px)_100%/var(--chat-composer-drawer-inset)_calc(100%-7.16px),line_to_var(--chat-composer-drawer-inset)_calc(100%-var(--chat-composer-context-extension)),curve_to_0_calc(100%-var(--chat-composer-context-extension)-var(--chat-composer-drawer-inset))_with_calc(var(--chat-composer-drawer-inset)*0.4477)_calc(100%-var(--chat-composer-context-extension))/0_calc(100%-var(--chat-composer-context-extension)-var(--chat-composer-drawer-inset)*0.4477),line_to_0_22px,close)]`,`not-supports-[clip-path:shape(from_0_0,line_to_1px_1px)]:before:bottom-(--chat-composer-context-extension)`],t),...n})}var nZ=`after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:border after:border-(--chat-composer-outline) dark:after:inset-shadow-2xs dark:after:inset-shadow-(color:--chat-composer-highlight)`,rZ=`group-data-with-context/composer-surface:after:[clip-path:polygon(0_0,100%_0,100%_100%,calc(100%-22px)_100%,calc(100%-22px)_calc(100%-2px),22px_calc(100%-2px),22px_100%,0_100%)]`;function iZ({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`composer-host`,className:X(`relative z-10 w-full rounded-3xl shadow-composer after:z-1 dark:shadow-none`,nZ,rZ,`group-has-data-[composer-banner-surface=attached]/composer-surface:shadow-none group-has-data-[composer-banner-surface=attached]/composer-surface:after:hidden`,e),...t})}function aZ({className:e,...t}){return(0,W.jsx)(`div`,{"data-chat-composer-main-surface":`true`,className:X(`group relative z-10 rounded-3xl p-px`,`group-data-model-strip-transition/composer-surface:bg-(--chat-composer-glass-surface)/(--glass-opacity) group-data-model-strip-transition/composer-surface:backdrop-blur-(--glass-blur) group-data-model-strip-transition/composer-surface:backdrop-saturate-(--glass-saturation)`,nZ,rZ,`after:z-20 after:hidden group-has-data-[composer-banner-surface=attached]/composer-surface:after:block group-data-model-strip-transition/composer-surface:after:block`,`group-has-data-[composer-banner-surface=attached]/composer-surface:bg-(--chat-composer-glass-surface)/(--glass-opacity) group-has-data-[composer-banner-surface=attached]/composer-surface:backdrop-blur-(--glass-blur) group-has-data-[composer-banner-surface=attached]/composer-surface:backdrop-saturate-(--glass-saturation)`,`group-has-data-[composer-banner-surface=attached]/composer-surface:shadow-composer dark:group-has-data-[composer-banner-surface=attached]/composer-surface:shadow-none`,`not-supports-[((backdrop-filter:blur(1px))_or_(-webkit-backdrop-filter:blur(1px)))]:group-has-data-[composer-banner-surface=attached]/composer-surface:bg-(--chat-composer-glass-surface)`,`group-has-data-[composer-banner-surface=attached]/composer-surface:**:data-[chat-composer-mobile-collapsed=true]:min-h-[calc(1rem+1px)]`,e),...t})}function oZ({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`composer-context-strip`,className:X(`group/composer-context relative isolate mx-auto -mt-4 flex w-[calc(100%-2*var(--chat-composer-drawer-inset))] items-center gap-2 overflow-x-clip overflow-y-visible px-2 pt-5 pb-1`,`before:absolute before:inset-0 before:-z-1 before:rounded-b-2xl before:border before:border-(--chat-composer-outline) before:mask-b-from-transparent before:mask-b-from-4 before:mask-b-to-black before:mask-b-to-4 before:shadow-composer`,`dark:before:border-white/7 dark:before:bg-composer-seam-below dark:before:shadow-composer-dark`,`group-has-data-[composer-banner-surface=attached]/composer-surface:before:bg-(--chat-composer-glass-surface)/(--glass-opacity) group-has-data-[composer-banner-surface=attached]/composer-surface:before:backdrop-blur-(--glass-blur) group-has-data-[composer-banner-surface=attached]/composer-surface:before:backdrop-saturate-(--glass-saturation)`,`not-supports-[clip-path:shape(from_0_0,line_to_1px_1px)]:before:bg-(--chat-composer-glass-surface)/(--glass-opacity) not-supports-[clip-path:shape(from_0_0,line_to_1px_1px)]:before:backdrop-blur-(--glass-blur) not-supports-[clip-path:shape(from_0_0,line_to_1px_1px)]:before:backdrop-saturate-(--glass-saturation)`,e),...t})}var sZ={Shell:tZ,Host:iZ,Main:aZ,ContextStrip:oZ},cZ=e=>e.preventDefault();function lZ({onStop:e}){let[t,n]=(0,m.useState)(!1),r=oO(t,aO.confirm),i=()=>{n(!1),e()};return sk(`y`,i,{enabled:t&&r,inDialog:!0}),(0,W.jsxs)(Fk,{open:t&&r,onOpenChange:n,children:[(0,W.jsxs)(VO,{children:[(0,W.jsx)(HO,{asChild:!0,children:(0,W.jsx)(`button`,{type:`button`,className:`flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-full bg-stop-action text-white shadow-xs shadow-stop-action/24 inset-shadow-control-highlight transition-colors duration-150 outline-none hover:bg-stop-action-hover focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background active:inset-shadow-control-pressed active:shadow-none pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 [&_svg]:pointer-events-none`,onPointerDown:cZ,onClick:()=>n(!0),"aria-label":`Stop`,"aria-haspopup":`dialog`,children:(0,W.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,fill:`currentColor`,"aria-hidden":`true`,children:(0,W.jsx)(`rect`,{x:`2`,y:`2`,width:`8`,height:`8`,rx:`1.5`})})})}),(0,W.jsx)(UO,{side:`top`,children:`Interrupt`})]}),(0,W.jsxs)(Rk,{children:[(0,W.jsxs)(zk,{children:[(0,W.jsx)(Vk,{children:`Stop the oracle?`}),(0,W.jsx)(Hk,{children:`The current response stops. Work already recorded is kept.`})]}),(0,W.jsxs)(Bk,{children:[(0,W.jsxs)(Wk,{children:[`Keep it`,(0,W.jsx)(XD,{chord:`Esc`,className:`kbd-hint ml-1`})]}),(0,W.jsxs)(Uk,{variant:`destructive`,onClick:i,children:[`Stop`,(0,W.jsx)(XD,{chord:`Y`,className:`kbd-hint ml-1`})]})]})]})]})}function uZ({sending:e,disabled:t,steering:n,onSend:r}){let i=n?`Steer message`:`Send`;return(0,W.jsxs)(VO,{children:[(0,W.jsx)(HO,{asChild:!0,children:(0,W.jsx)(`span`,{className:`inline-flex`,children:(0,W.jsx)(`button`,{type:`button`,className:X(`relative isolate flex h-9 w-9 items-center justify-center overflow-hidden rounded-full shadow-xs outline-none transition-all duration-150 enabled:cursor-pointer enabled:inset-shadow-control-highlight hover:scale-105 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background active:inset-shadow-control-pressed active:shadow-none disabled:pointer-events-none disabled:opacity-64 disabled:shadow-none disabled:hover:scale-100 motion-reduce:hover:scale-100 sm:h-8 sm:w-8 [&_svg]:pointer-events-none`,`bg-message-action text-message-action-foreground enabled:shadow-message-action/24 hover:bg-message-action-hover`),onPointerDown:cZ,onClick:r,disabled:t,"aria-label":`Send`,"aria-keyshortcuts":`Enter`,children:e?(0,W.jsx)(DO,{"aria-hidden":`true`,role:`presentation`,className:`size-3.5`}):(0,W.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 14 14`,fill:`none`,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:`M7 11.5V2.5M7 2.5L3 6.5M7 2.5L11 6.5`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})})})})}),(0,W.jsxs)(UO,{side:`top`,children:[i,` `,(0,W.jsx)(XD,{chord:`Enter`})]})]})}function dZ(e,t){let n=/^\s*([/@])([a-z]*)$/i.exec(e.slice(0,t));if(n&&!/\S/.test(e.slice(t,t+1)))return{kind:n[1]===`/`?`slash-command`:`mention`,query:n[2].toLowerCase()}}function fZ(e){let t=e.kind===`slash-command`?mO.map(e=>({id:`/${e.name}`,insert:`/${e.name}`,label:`/${e.name}`,description:`${e.hint} · /${e.name} ${e.args}`})):pO.map(e=>({id:`@${e.name}`,insert:`@${e.name}`,label:`@${e.name}`,description:e.hint,agent:e.agent})),n=t.filter(t=>t.label.slice(1).startsWith(e.query)),r=t.filter(t=>!n.includes(t)&&t.label.slice(1).includes(e.query));return[...n,...r]}function pZ(e,t){return`${e}-${encodeURIComponent(t)}`}var mZ={"slash-command":`Commands`,mention:`Agents`};function hZ({item:e}){if(e.agent)return(0,W.jsx)(BV,{source:fO[e.agent],strokeWidth:2,className:`size-4 shrink-0 text-muted-foreground`});let t=e.id===`/plan`?yg:_h;return(0,W.jsx)(t,{"aria-hidden":`true`,strokeWidth:2,className:`size-4 shrink-0 text-muted-foreground`})}var gZ=(0,m.memo)(function(e){let t=(0,m.useRef)(null);return(0,m.useLayoutEffect)(()=>{e.activeItemId&&t.current&&t.current.querySelector(`[data-composer-item-id="${CSS.escape(e.activeItemId)}"]`)?.scrollIntoView({block:`nearest`})},[e.activeItemId]),(0,W.jsx)(`div`,{ref:t,"data-composer-command-drawer":`true`,className:X(`composer-command-drawer relative isolate flex min-h-0 w-full flex-col overflow-hidden pb-[calc(1rem+1px)]`,`before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-t-2xl before:border before:border-(--chat-composer-outline)`,`before:bg-(--chat-composer-glass-surface)/(--glass-opacity) before:backdrop-blur-(--glass-blur) before:backdrop-saturate-(--glass-saturation)`,`before:mask-t-from-transparent before:mask-t-from-4 before:mask-t-to-black before:mask-t-to-4 before:shadow-composer dark:before:shadow-none`,`not-supports-[((backdrop-filter:blur(1px))_or_(-webkit-backdrop-filter:blur(1px)))]:before:bg-(--chat-composer-glass-surface)`),children:(0,W.jsx)(`div`,{id:e.listId,role:`listbox`,"aria-label":mZ[e.triggerKind],className:`max-h-72 min-h-0 overflow-y-auto p-2`,children:e.items.map(t=>{let n=e.activeItemId===t.id;return(0,W.jsxs)(`div`,{id:pZ(e.listId,t.id),role:`option`,"aria-selected":n,"data-composer-item-id":t.id,"data-active":n||void 0,onMouseMove:()=>{n||e.onHighlightedItemChange(t.id)},onMouseDown:e=>e.preventDefault(),onClick:()=>e.onSelect(t),className:X(`flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-none select-none`,n&&`bg-accent text-accent-foreground`),children:[(0,W.jsx)(hZ,{item:t}),(0,W.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`min-w-0 max-w-[45%] shrink-0 truncate font-sans text-xs font-medium`,children:t.label}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-left text-xs text-muted-foreground`,children:t.description})]})]},t.id)})})})}),_Z={id:`oracle`,label:`Message the team`,placeholder:`Message the team… @ picks who answers, / for /plan and /task`},vZ=new Set([`lobby`,`tasks`,`plan`,`knowledge`]);function yZ(e){return e.kind===`tab`&&vZ.has(e.tab)}function bZ(e,t){if(e.kind!==`tab`)return _Z;if(e.tab===`knowledge`)return{id:`knowledge`,label:`Ask the oracle about this project`,placeholder:`Ask about this project — the oracle searches the code and learns what is missing…`};if(e.tab===`plan`)return{id:`panel`,label:`Message the panel`,placeholder:`Describe a task, or answer the panel…`};let n=e.tab===`tasks`?xU(e.rest).id??t:void 0;return n?{id:`comment`,label:`Comment on ${n}`,placeholder:`Comment on ${n}'s plan…`,taskId:n}:_Z}var xZ=0;function SZ(e){return e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing}var CZ={duration:.16,ease:`easeOut`};function wZ({file:e,onRemove:t}){let n=(0,W.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e.name}`,"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,onClick:t,className:X(`flex shrink-0 items-center justify-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,e.image?`absolute top-1 right-1 size-[1.625rem] rounded-full bg-background/85 text-foreground shadow-xs hover:bg-background`:`size-7`),children:(0,W.jsx)(d_,{"aria-hidden":`true`,className:`size-3.5`})});return e.image?(0,W.jsxs)(Yf.li,{layout:!0,initial:{opacity:0,scale:.96},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.96},transition:CZ,title:`${e.name} · ${MX(e.size)}`,className:`relative size-16 shrink-0 overflow-hidden rounded-lg border border-border/80 bg-background`,children:[(0,W.jsx)(`img`,{src:L(e.image),alt:e.name,className:`size-full object-cover`}),e.state===`uploading`?(0,W.jsxs)(`span`,{className:`pointer-events-none absolute inset-x-0 bottom-0 flex items-center justify-center gap-1 bg-background/85 px-1 text-[0.625rem] text-foreground`,children:[(0,W.jsx)(DO,{className:`size-2.5`,"aria-hidden":`true`,role:`presentation`}),`uploading`]}):null,n]}):(0,W.jsxs)(Yf.li,{layout:!0,initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:CZ,className:`flex min-w-0 basis-full items-center gap-2 text-sm text-foreground`,children:[(0,W.jsx)(Ym,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),(0,W.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1 text-xs text-muted-foreground`,children:[e.state===`uploading`?(0,W.jsx)(DO,{className:`size-2.5`,"aria-hidden":`true`,role:`presentation`}):null,e.state===`uploading`?`uploading…`:MX(e.size)]}),n]})}function TZ(e,t,n){let[r,i]=(0,m.useState)(!1),a=n.kind===`tab`?n.tab:n.kind;return(0,m.useEffect)(()=>i(!1),[a]),(0,m.useEffect)(()=>{if(!t)return;let n=0,r=t=>{e.current?.contains(t.target)||(n=performance.now())},a=t=>{[`PageDown`,`PageUp`,`ArrowDown`,`ArrowUp`,`Home`,`End`,` `].includes(t.key)&&!e.current?.contains(t.target)&&(n=performance.now())},o=t=>{let r=e.current;!r||performance.now()-n>400||r.contains(document.activeElement)||r.contains(t.target)||i(!0)};return document.addEventListener(`wheel`,r,{capture:!0,passive:!0}),document.addEventListener(`touchmove`,r,{capture:!0,passive:!0}),document.addEventListener(`keydown`,a,{capture:!0}),document.addEventListener(`scroll`,o,{capture:!0,passive:!0}),()=>{document.removeEventListener(`wheel`,r,{capture:!0}),document.removeEventListener(`touchmove`,r,{capture:!0}),document.removeEventListener(`keydown`,a,{capture:!0}),document.removeEventListener(`scroll`,o,{capture:!0})}},[t,e]),{shrunk:r,expand:(0,m.useCallback)(()=>i(!1),[])}}function EZ({route:e,keys:t,projects:n,onHelp:r}){let[i,a]=(0,m.useState)(``),[o,s]=(0,m.useState)([]),[c,l]=(0,m.useState)(!1),[u,d]=(0,m.useState)(!1),f=LO(`status`),p=LO(`lobby`),h=cO(),g=(f.data?.busy??!1)||!!p.data?.reply?.trim(),_=yZ(e),v=(0,m.useRef)(_);v.current=_;let{taskId:y}=gJ(),b=(0,m.useMemo)(()=>bZ(e,y),[e,y]),x=(0,m.useRef)(null),{shrunk:S,expand:C}=TZ(x,_&&!h,e),w=(0,m.useRef)(null),T=(0,m.useRef)(null),E=(0,m.useRef)(o);E.current=o;let D=(0,m.useRef)(void 0),[O,k]=(0,m.useState)(0),[A,ee]=(0,m.useState)(null),[j,M]=(0,m.useState)(void 0),N=b.id===`oracle`?dZ(i,O):void 0,P=(0,m.useMemo)(()=>N?fZ(N):[],[N?.kind,N?.query]),F=!!N&&P.length>0&&j!==i&&_&&!h,te=F?P.find(e=>e.id===A)??P[0]:void 0,ne=`composer-suggestions`,re=(0,m.useCallback)(e=>{let t=i.replace(/^\s*[/@][a-z]*\s*/i,``),n=`${e.insert} ${t}`,r=e.insert.length+1;D.current={start:r,end:r},k(r),a(n),ee(null),w.current?.focus()},[i]);(0,m.useLayoutEffect)(()=>{let e=D.current,t=w.current;e&&t&&(D.current=void 0,t.setSelectionRange(e.start,e.end))},[i]);let ie=(0,m.useCallback)(e=>{D.current={start:e.start,end:e.end},k(e.end),a(e.value)},[]);(0,m.useEffect)(()=>{let e=x.current;if(!e)return;let t=document.documentElement,n=()=>{let n=e.getBoundingClientRect();if(t.style.setProperty(`--composer-h`,h||!_?`0px`:`${Math.ceil(n.height)}px`),!_||n.width===0){t.style.removeProperty(`--composer-x`),t.style.removeProperty(`--composer-w`);return}t.style.setProperty(`--composer-x`,`${Math.round(n.left)}px`),t.style.setProperty(`--composer-w`,`${Math.round(n.width)}px`)};n();let r=new ResizeObserver(n);return r.observe(e),window.addEventListener(`resize`,n),()=>{r.disconnect(),window.removeEventListener(`resize`,n),t.style.setProperty(`--composer-h`,`0px`),t.style.removeProperty(`--composer-x`),t.style.removeProperty(`--composer-w`)}},[h,_]);let ae=(0,m.useCallback)(e=>{if(!v.current)return;let t=[...e],n=8-E.current.length;t.length>n&&G.warning(`At most 8 files go with one message.`);for(let e of t.slice(0,Math.max(0,n))){let t=`f${++xZ}`,n=e.type.startsWith(`image/`)?URL.createObjectURL(e):void 0;s(r=>[...r,{key:t,name:e.name||(n?`image.png`:`file`),size:e.size,...n?{image:n}:{},state:`uploading`}]),NX(e).then(e=>s(n=>n.map(n=>n.key===t?{...n,state:`ready`,info:e}:n))).catch(e=>{G.error(e instanceof Error?e.message:`That file did not upload.`),s(e=>e.filter(e=>e.key!==t))})}},[]),oe=(0,m.useCallback)(e=>{s(t=>{let n=t.find(t=>t.key===e);return n?.image&&URL.revokeObjectURL(n.image),t.filter(t=>t.key!==e)})},[]),se=o.some(e=>e.state===`uploading`),ce=o.flatMap(e=>e.info?[e.info.id]:[]),I=(i.trim().length>0||ce.length>0)&&!se&&!c,le=(0,m.useCallback)(async()=>{if(!I||!v.current)return;l(!0);let e=ce.length>0?ce:void 0,t={text:i,...e?{attachments:e}:{}};try{let e=!0;if(b.id===`oracle`){let e=await z(`lobby.send`,t);e.notice&&G(e.notice),e.open===`plan`&&yO(vO(`plan`))}else if(b.id===`knowledge`){e=await K(`knowledge.ask`,t)!==void 0;let n=_O(window.location.hash);e&&n?.kind===`tab`&&n.tab===`knowledge`&&yO(VH(n.rest,!0))}else e=b.id===`panel`?await K(`planner.send`,t)!==void 0:await K(`tasks.comment`,{taskId:b.taskId,...t})!==void 0;if(e){a(``);for(let e of E.current)e.image&&URL.revokeObjectURL(e.image);s([])}}catch(e){G.error(e instanceof Error?e.message:`Could not send`)}finally{l(!1)}},[I,ce,b,i,e]),ue=(0,m.useCallback)(async()=>{try{await z(`lobby.abort`,{})}catch(e){G.error(e instanceof Error?e.message:`Could not stop`)}},[]),de=e=>{if(F&&te&&!e.nativeEvent.isComposing){let t=P.indexOf(te);if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let n=(t+(e.key===`ArrowDown`?1:-1)+P.length)%P.length;ee(P[n].id);return}if(e.key===`Enter`&&!e.shiftKey||e.key===`Tab`){e.preventDefault(),re(te);return}if(e.key===`Escape`){e.preventDefault(),M(i);return}}if(e.key===`Escape`&&!e.nativeEvent.isComposing){e.preventDefault(),tk();return}let t=e.currentTarget,n=e.key.toLowerCase();if((e.ctrlKey||e.metaKey)&&!e.altKey&&!e.shiftKey&&[`b`,`i`,`e`,`k`].includes(n)){e.preventDefault();let{selectionStart:r,selectionEnd:i,value:a}=t;ie(n===`k`?FX(a,r,i):PX(a,r,i,n===`b`?`**`:n===`i`?`_`:"`"));return}if(e.key===`Enter`&&e.shiftKey&&!e.nativeEvent.isComposing&&t.selectionStart===t.selectionEnd){let n=LX(t.value,t.selectionStart);n&&(e.preventDefault(),ie(n));return}if(e.key===`Backspace`&&t.value===``&&E.current.length>0){e.preventDefault(),oe(E.current.at(-1).key);return}(SZ(e)||e.key===`Enter`&&(e.metaKey||e.ctrlKey))&&(e.preventDefault(),le())},L=e=>{let t=[...e.clipboardData.files];t.length!==0&&(e.preventDefault(),ae(t))},R=e=>{e.preventDefault(),d(!1),e.dataTransfer.files.length>0&&ae(e.dataTransfer.files)},fe=e.kind===`tab`&&e.tab===`knowledge`,pe=f.data?.workspace.name??`bot-lobby`,me=f.data?.branch??f.data?.workspace.branch,he=(0,W.jsx)(`div`,{className:`min-h-0`,children:(0,W.jsx)(`div`,{className:`relative z-0`,children:(0,W.jsxs)(sZ.ContextStrip,{role:`group`,"aria-label":`Message context`,className:`composer-strip gap-1 text-xs font-normal text-muted-foreground/70`,children:[(0,W.jsx)(eZ,{projects:n,tab:e.kind===`tab`?e.tab:e.kind,name:pe,branch:me}),(0,W.jsxs)(`div`,{className:`@container ml-auto flex min-w-0 flex-1 items-center justify-end gap-3 overflow-hidden pe-1`,children:[e.kind===`tab`&&e.tab===`plan`?(0,W.jsx)(ZD,{chord:t.savePlan??`Ctrl+S`,className:`hidden @[24rem]:inline-flex`,children:`save plan`}):null,(0,W.jsx)(ZD,{chord:`Shift+Enter`,className:`hidden @[14rem]:inline-flex`,children:`new line`}),(0,W.jsxs)(BX,{size:`xs`,"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,"aria-label":`Keyboard shortcuts`,"aria-haspopup":`dialog`,"data-compact":!0,onClick:r,className:`kbd-hint`,children:[(0,W.jsx)(XD,{chord:t.help??`Alt+H`,className:`kbd-hint`}),(0,W.jsx)(`span`,{className:`hidden @[8rem]:inline`,children:`shortcuts`})]})]})]})})});return(0,W.jsx)(`div`,{id:`app-dock`,ref:x,"data-shrunk":S||void 0,onFocus:C,className:X(`dock pointer-events-none absolute inset-x-0 bottom-0 z-30 px-6 pb-[max(1rem,env(safe-area-inset-bottom))] transition-opacity duration-200 ease-snap`,h&&`opacity-0`),hidden:!_,"aria-hidden":!_||void 0,inert:h||!_,children:(0,W.jsxs)(sZ.Shell,{contextStrip:!0,className:`composer-shell pointer-events-auto`,children:[(0,W.jsx)(Au,{initial:!1,children:F&&N&&te?(0,W.jsx)(Yf.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:6},transition:CZ,"data-composer-drawer-layer":`true`,className:`absolute inset-x-(--chat-composer-drawer-inset) bottom-full z-0 -mb-[calc(1rem+1px)] flex flex-col`,children:(0,W.jsx)(gZ,{listId:ne,items:P,triggerKind:N.kind,activeItemId:te.id,onHighlightedItemChange:ee,onSelect:re})},`commands`):null}),(0,W.jsx)(sZ.Host,{onPointerDown:C,children:(0,W.jsx)(`div`,{className:`relative z-10`,children:(0,W.jsxs)(sZ.Main,{className:`group/composer composer-box`,onDragOver:e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),d(!0))},onDragLeave:()=>d(!1),onDrop:R,children:[(0,W.jsxs)(`div`,{"data-chat-composer-surface":`true`,className:X(`rounded-3xl transition-[background-color] duration-200`,u&&`bg-accent/45 ring-1 ring-inset ring-primary/70`),children:[(0,W.jsxs)(`div`,{"data-chat-composer-body":`true`,className:X(`composer-text relative px-3 pb-2 sm:px-4`,`pt-3.5 sm:pt-4`),children:[(0,W.jsx)(Au,{initial:!1,children:o.length>0?(0,W.jsx)(Yf.ul,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{duration:.18,ease:`easeOut`},"aria-label":`Attachments`,className:`composer-files mb-3 flex max-w-full flex-wrap gap-2 overflow-hidden`,children:o.map(e=>(0,W.jsx)(wZ,{file:e,onRemove:()=>oe(e.key)},e.key))},`files`):null}),(0,W.jsx)(`div`,{className:`relative flow-root font-sans text-sm max-sm:pointer-coarse:text-base`,children:(0,W.jsx)(`textarea`,{ref:w,id:`composer-text`,"aria-label":b.label,...b.id===`oracle`?{role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":F,"aria-controls":F?ne:void 0}:{},...te?{"aria-activedescendant":pZ(ne,te.id)}:{},value:i,onChange:e=>{a(e.target.value),k(e.target.selectionStart)},onSelect:e=>k(e.currentTarget.selectionStart),onKeyDown:de,onPaste:L,placeholder:g&&b.id===`oracle`?`The oracle is working. Enter steers it…`:b.placeholder,rows:1,className:X(`-m-1 block field-sizing-content max-h-52 min-h-19.5 w-[calc(100%+0.5rem)] resize-none overflow-y-auto bg-transparent p-1 leading-relaxed whitespace-pre-wrap text-foreground caret-primary outline-none placeholder:text-placeholder/75`)})})]}),(0,W.jsxs)(`div`,{"data-chat-composer-footer":`true`,className:X(`composer-tools flex min-w-0 flex-nowrap items-center justify-between gap-2 overflow-visible px-3 pb-3 sm:gap-0 sm:px-4 sm:pb-4`),children:[(0,W.jsx)(`div`,{"data-chat-composer-controls":`left`,className:`composer-controls relative -m-1 -ms-3.5 flex min-w-0 flex-1 items-center gap-1 overflow-x-auto p-1 ps-3.5 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,children:fe?(0,W.jsx)(RX,{rest:e.kind===`tab`?e.rest:[]}):null}),(0,W.jsxs)(`div`,{"data-chat-composer-actions":`right`,className:`flex shrink-0 flex-nowrap items-center justify-end gap-2`,children:[(0,W.jsx)(`input`,{ref:T,type:`file`,multiple:!0,hidden:!0,tabIndex:-1,"aria-label":`Attach files`,onChange:e=>{ae(e.target.files??[]),e.target.value=``}}),(0,W.jsxs)(VO,{children:[(0,W.jsx)(HO,{asChild:!0,children:(0,W.jsx)(Z,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Attach images, PDFs or files`,"data-compact":!0,onPointerDown:e=>e.preventDefault(),onClick:()=>T.current?.click(),className:`pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11`,children:(0,W.jsx)(Zh,{"aria-hidden":`true`})})}),(0,W.jsx)(UO,{side:`top`,children:`Attach files`})]}),g&&b.id===`oracle`?(0,W.jsx)(lZ,{onStop:()=>void ue()}):null,(0,W.jsx)(uZ,{sending:c,disabled:!I,steering:g&&b.id===`oracle`,onSend:()=>void le()})]})]})]}),u?(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 z-30 flex items-center justify-center rounded-[inherit] text-sm font-medium text-primary`,children:`Drop to attach`}):null]})})}),he]})})}function DZ({state:e}){return e===`live`?(0,W.jsxs)(VO,{children:[(0,W.jsx)(HO,{asChild:!0,children:(0,W.jsx)(`span`,{role:`img`,"aria-label":`Connected`,className:`grid size-6 place-items-center`,children:(0,W.jsx)(`span`,{className:`size-2 rounded-full bg-success`})})}),(0,W.jsx)(UO,{children:`Connected`})]}):e===`connecting`?(0,W.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 rounded-full bg-warning motion-safe:animate-status-pulse`}),`reconnecting…`]}):(0,W.jsx)(`span`,{className:`text-xs font-medium text-destructive`,children:`Connection lost`})}function OZ(e){if(!e)return 0;let t=[...e.children].filter(e=>e instanceof HTMLElement&&e.offsetParent!==null&&getComputedStyle(e).position!==`absolute`);if(!t.length)return 0;let n=Math.min(...t.map(e=>e.getBoundingClientRect().left)),r=Math.max(...t.map(e=>e.getBoundingClientRect().right)),i=0;for(let t of e.querySelectorAll(`*`))t.clientWidth<=1||t.offsetParent===null||t.scrollWidth<=t.clientWidth+1||getComputedStyle(t).textOverflow===`ellipsis`&&(i+=t.scrollWidth-t.clientWidth);return r-n+i}var kZ=24;function AZ(){let e=(0,m.useRef)(null),[t,n]=(0,m.useState)(!1),r=(0,m.useRef)(()=>{});return r.current=()=>{let t=e.current;if(!t)return;let r=t.querySelector(`[role="tablist"]`),i=getComputedStyle(t),a=parseFloat(i.columnGap)||0,o=t.clientWidth-(parseFloat(i.paddingLeft)||0)-(parseFloat(i.paddingRight)||0),s=OZ(t.querySelector(`.where`))+(r?.offsetWidth??0)+OZ(t.querySelector(`.tools`))+a*2;n(s+kZ<=o)},(0,m.useLayoutEffect)(()=>r.current()),(0,m.useLayoutEffect)(()=>{let t=e.current;if(!t||typeof ResizeObserver>`u`)return;let n=new ResizeObserver(()=>r.current());n.observe(t);for(let e of t.querySelectorAll(`[role="tablist"], .where, .tools`))n.observe(e);return()=>n.disconnect()},[]),{header:e,one:t}}function jZ({connection:e,projects:t,lead:n,tabs:r,extra:i,tools:a}){let{header:o,one:s}=AZ();return(0,W.jsxs)(`header`,{ref:o,className:`app-header shrink-0`,"data-one-row":s||void 0,children:[(0,W.jsx)(`div`,{className:`where flex min-w-0 items-center gap-2`,children:n}),(0,W.jsx)(`div`,{className:`tabs min-w-0`,children:r}),(0,W.jsxs)(`div`,{className:`tools flex min-w-0 items-center justify-end gap-2`,children:[i,(0,W.jsx)(DZ,{state:e}),a,(0,W.jsx)(`span`,{id:`focused-action-help`,className:`sr-only`,children:`Focused buttons: Enter or Space. Links: Enter. Checkboxes: Space.`})]}),(0,W.jsx)(ZX,{projects:t})]})}function MZ({open:e,onOpenChange:t}){let n=oO(e,aO.help),[r,i]=(0,m.useState)(``),[a,o]=(0,m.useState)(!1),[s,c]=(0,m.useState)(``),l=(0,m.useId)(),u=()=>{a||(t(!1),i(``),c(``))},d=async()=>{let e=r.trim();if(e&&!a){o(!0),c(``);try{G((await z(`sessions.start`,{request:e})).notice),t(!1),i(``)}catch(e){c(e instanceof Error?e.message:`That did not work. Try again.`)}finally{o(!1)}}};return(0,W.jsx)(QD,{open:n,label:`New session`,description:`Starts a task in a session of its own, in the background.`,onOpenChange:e=>{e||u()},dismissOnBackdrop:!a,children:(0,W.jsxs)(`div`,{className:`flex w-[min(32rem,calc(100vw-2rem))] flex-col`,children:[(0,W.jsxs)(`div`,{className:`flex flex-col gap-1 border-b border-border px-4 py-3`,children:[(0,W.jsx)(`h2`,{className:`text-[0.9375rem] font-semibold`,children:`New session`}),(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`It runs in the background and shows up in the sidebar; this window carries on with what it is doing.`})]}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-1.5 p-4`,children:[(0,W.jsx)(`label`,{htmlFor:l,className:`text-sm font-medium`,children:`What should it do?`}),(0,W.jsx)(Ak,{id:l,value:r,autoFocus:!0,disabled:a,"aria-invalid":s?!0:void 0,placeholder:`Fix the flaky login test, add dark mode to Settings…`,className:`max-h-60 min-h-24`,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),d())}}),s?(0,W.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:s}):null]}),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2 border-t border-border bg-muted/30 px-4 py-3`,children:[(0,W.jsx)(Z,{variant:`outline`,onClick:u,disabled:a,children:`Cancel`}),(0,W.jsx)(Z,{onClick:()=>void d(),disabled:!r.trim()||a,"aria-busy":a,children:a?`Starting…`:`Start session`})]})]})})}function NZ(e){return e.waiting>0&&e.alive?`asking`:e.status===`exited`||!e.alive?`exited`:e.busy||e.status===`working`?`working`:e.status===`starting`?`starting`:`idle`}function PZ(e,t){let n=e?.sessionId,r={id:`here`,name:e?.sessionName?.trim()||`This window`,where:`here`,state:e?.busy?`working`:`idle`,waiting:0,...n?{sessionId:n}:{}},i=(t?.background??[]).filter(e=>!n||e.sessionId!==n).map(e=>({id:`bg:${e.key}`,name:e.name,where:`background`,state:NZ(e),waiting:e.alive?e.waiting:0,key:e.key,...e.sessionId?{sessionId:e.sessionId}:{}})),a=new Set([n,...i.map(e=>e.sessionId)].filter(Boolean)),o=(t?.live??[]).filter(e=>!a.has(e.sessionId)).map(e=>({id:`live:${e.sessionId}`,name:e.name?.trim()||`Unnamed session`,where:`elsewhere`,state:`idle`,waiting:0,sessionId:e.sessionId}));return i.sort((e,t)=>Number(e.state===`exited`)-Number(t.state===`exited`)),[r,...i,...o]}var FZ=`app.sidebar`,IZ={start:16,min:13,max:24},LZ=`bot-lobby.sidebar.width`,RZ=`inline-flex size-7 shrink-0 items-center justify-center rounded-md text-[var(--sidebar-icon)] outline-none transition-[background-color,color,scale] duration-150 hover:bg-sidebar-accent hover:text-sidebar-foreground focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring active:scale-[0.96] aria-pressed:text-sidebar-foreground aria-[current=page]:bg-[var(--sidebar-selected)] aria-[current=page]:text-sidebar-foreground motion-reduce:active:scale-100`,zZ=`session-row flex h-8 w-full min-w-0 items-center gap-2 rounded-lg px-2.5 text-left text-sm outline-none transition-colors duration-150 hover:bg-sidebar-accent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring aria-[current=true]:bg-[var(--sidebar-selected)]`;function BZ({label:e,hint:t,side:n=`bottom`,children:r}){return(0,W.jsxs)(VO,{children:[(0,W.jsx)(HO,{asChild:!0,children:r}),(0,W.jsxs)(UO,{side:n,children:[e,` `,t?(0,W.jsx)(XD,{chord:t}):null]})]})}function VZ(){let e=LO(`status`).data;return{entries:PZ(e,zO(`sessions.list`,{},[`sessions`]).data),branch:e?.branch??e?.workspace.branch}}function HZ(){return(0,m.useCallback)(async e=>{if(e.where===`here`)return yO(`#/lobby`);if(e.where===`elsewhere`)return void G.info(`${e.name} runs in another terminal. Switch to that terminal to work in it.`);await K(`sessions.switch`,e.key?{key:e.key}:{sessionId:e.sessionId})&&yO(`#/lobby`)},[])}function UZ({entry:e}){return(0,W.jsx)(`span`,{"aria-hidden":`true`,"data-state":e.where===`elsewhere`?`elsewhere`:e.state,className:`session-dot relative`})}function WZ({entry:e}){return e.where===`elsewhere`?(0,W.jsx)(UZ,{entry:e}):e.state===`asking`?(0,W.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 text-xs text-warning tabular-nums`,children:[(0,W.jsx)(kh,{"aria-hidden":`true`,className:`size-3.5`}),e.waiting,(0,W.jsxs)(`span`,{className:`sr-only`,children:[e.waiting===1?` question`:` questions`,`, Waiting`]})]}):e.state===`working`||e.state===`starting`?(0,W.jsxs)(`span`,{className:X(`inline-flex shrink-0`,e.state===`working`?`text-primary`:`text-muted-foreground`),children:[(0,W.jsx)(dm,{"aria-hidden":`true`,className:`session-spin size-3.5`}),(0,W.jsx)(`span`,{className:`sr-only`,children:e.state===`working`?`Working`:`Starting`})]}):(0,W.jsxs)(`span`,{className:`inline-flex shrink-0`,children:[(0,W.jsx)(UZ,{entry:e}),(0,W.jsx)(`span`,{className:`sr-only`,children:e.state===`exited`?`Ended`:`Idle`})]})}var GZ={here:`This window`,background:`Background`,elsewhere:`Other terminal`};function KZ(e){let t=e.key;return K(`sessions.archive`,{key:t},{undo:()=>void K(`sessions.archive`,{key:t,archived:!1})})}function qZ({entry:e,onDone:t}){let[n,r]=(0,m.useState)(e.name),i=(0,m.useRef)(!1),a=async()=>{if(i.current)return;i.current=!0;let r=n.replace(/\s+/g,` `).trim();r&&r!==e.name&&await K(`sessions.rename`,{...e.where===`here`?{}:{key:e.key},name:r}),t()};return(0,W.jsx)(`input`,{value:n,autoFocus:!0,maxLength:120,"aria-label":`New name for ${e.name}`,onFocus:e=>e.currentTarget.select(),onChange:e=>r(e.target.value),onBlur:()=>void a(),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),a()):e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),i.current=!0,t())},className:`-mx-1 h-6 w-[calc(100%+0.5rem)] min-w-0 rounded-sm bg-background px-1 text-sm leading-5 text-sidebar-foreground outline-none ring-2 ring-ring`})}var JZ=`inline-flex size-[1.625rem] items-center justify-center rounded-md text-muted-foreground outline-none transition-[background-color,color] duration-150 hover:bg-[var(--sidebar-selected)] hover:text-sidebar-foreground focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`;function YZ({entry:e}){let t=HZ(),[n,r]=(0,m.useState)(!1),i=e.state===`exited`||e.where===`elsewhere`,a=X(`min-w-0 flex-1 truncate`,e.where===`here`?`font-medium text-sidebar-foreground`:i?`text-muted-foreground`:`text-sidebar-foreground`),o=e.where!==`elsewhere`,s=e.where===`background`&&e.state===`exited`&&!!e.key,c=o||s;return(0,W.jsxs)(`li`,{className:`session-enter session-item relative`,children:[n?(0,W.jsx)(`div`,{"aria-current":e.where===`here`?`true`:void 0,className:X(zZ,`hover:bg-transparent`),children:(0,W.jsx)(qZ,{entry:e,onDone:()=>r(!1)})}):(0,W.jsxs)(`button`,{type:`button`,"aria-current":e.where===`here`?`true`:void 0,"aria-label":e.where===`here`?`${e.name}, this window`:e.where===`elsewhere`?`${e.name}, in another terminal`:`Switch to ${e.name}`,title:e.name,"data-where":e.where,"data-state":e.state,onClick:()=>void t(e),onDoubleClick:e=>{o&&(e.preventDefault(),r(!0))},className:zZ,children:[(0,W.jsx)(`span`,{className:a,children:e.name}),(0,W.jsx)(`span`,{className:X(`flex shrink-0 items-center`,c&&`session-state`),children:(0,W.jsx)(WZ,{entry:e})})]}),!n&&c?(0,W.jsxs)(`span`,{className:`session-actions absolute top-1/2 right-1 flex -translate-y-1/2 items-center gap-0.5`,children:[o?(0,W.jsx)(BZ,{label:`Rename`,children:(0,W.jsx)(`button`,{type:`button`,"aria-label":`Rename ${e.name}`,onClick:()=>r(!0),className:JZ,children:(0,W.jsx)(rg,{"aria-hidden":`true`,className:`size-3.5`})})}):null,s?(0,W.jsx)(BZ,{label:`Archive`,children:(0,W.jsx)(`button`,{type:`button`,"aria-label":`Archive ${e.name}`,onClick:()=>void KZ(e),className:JZ,children:(0,W.jsx)(kp,{"aria-hidden":`true`,className:`size-3.5`})})}):null]}):null]})}var XZ=`flex h-7 items-center px-2.5 pt-2 text-xs font-medium text-muted-foreground`;function ZZ({id:e,label:t,entries:n,archivable:r=!1}){let[i,a]=_H(`app.sidebar.${e}`),o=(0,m.useId)();return n.length===0?null:(0,W.jsxs)(`section`,{"aria-label":t,className:`group/shelf flex flex-col`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-1 pt-2`,children:[(0,W.jsxs)(`button`,{type:`button`,"aria-expanded":!i,"aria-controls":o,onClick:a,className:`flex h-7 min-w-0 flex-1 items-center gap-1.5 rounded-md px-2.5 text-xs font-medium text-muted-foreground outline-none transition-colors duration-150 hover:text-sidebar-foreground focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,children:[(0,W.jsx)(`span`,{children:t}),i?(0,W.jsx)(`span`,{className:`tabular-nums`,children:n.length}):null,(0,W.jsx)($p,{"aria-hidden":`true`,className:X(`size-3 opacity-0 transition-[opacity,rotate] duration-150 group-hover/shelf:opacity-100 group-focus-within/shelf:opacity-100 motion-reduce:transition-none`,i&&`-rotate-90 opacity-100`)})]}),r?(0,W.jsx)(`button`,{type:`button`,onClick:()=>void(async()=>{for(let e of n)e.key&&await K(`sessions.archive`,{key:e.key})})(),className:`h-[1.625rem] shrink-0 rounded-md px-1.5 text-xs text-muted-foreground outline-none transition-colors duration-150 hover:bg-sidebar-accent hover:text-sidebar-foreground focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,children:`Archive all`}):null]}),i?null:(0,W.jsx)(`ul`,{id:o,className:`flex flex-col gap-px`,children:n.map(e=>(0,W.jsx)(YZ,{entry:e},e.id))})]})}function QZ(e,t){let n=t.trim().toLowerCase().split(/\s+/).filter(Boolean),r=`${e.name} ${GZ[e.where]}`.toLowerCase();return n.every(e=>r.includes(e))}function $Z({query:e,onQuery:t,onNew:n}){return(0,W.jsxs)(`div`,{className:`flex items-center gap-1 px-1 pb-2`,children:[(0,W.jsxs)(`label`,{className:`flex h-8 min-w-0 flex-1 items-center gap-2 rounded-md px-2 text-sm text-muted-foreground transition-colors duration-150 hover:bg-sidebar-accent focus-within:bg-sidebar-accent focus-within:ring-2 focus-within:ring-inset focus-within:ring-ring`,children:[(0,W.jsx)(Tg,{"aria-hidden":`true`,className:`size-4 shrink-0`}),(0,W.jsx)(`input`,{type:`search`,value:e,"aria-label":`Search sessions`,placeholder:`Search`,onChange:e=>t(e.target.value),onKeyDown:n=>{n.key===`Escape`&&e&&(n.preventDefault(),n.stopPropagation(),t(``))},className:`min-w-0 flex-1 bg-transparent text-sidebar-foreground outline-none placeholder:text-muted-foreground [&::-webkit-search-cancel-button]:hidden`})]}),(0,W.jsx)(BZ,{label:`New session`,children:(0,W.jsx)(`button`,{type:`button`,"aria-label":`New session`,"aria-haspopup":`dialog`,onClick:n,className:RZ,children:(0,W.jsx)(Fg,{"aria-hidden":`true`,className:`size-4`})})})]})}function eQ({query:e}){let{entries:t}=VZ(),n=t.filter(t=>QZ(t,e)),r=n.filter(e=>e.where===`here`&&e.state!==`exited`),i=n.filter(e=>e.where===`background`&&e.state!==`exited`),a=n.filter(e=>e.where===`elsewhere`),o=n.filter(e=>e.where!==`elsewhere`&&e.state===`exited`),s=(0,m.useRef)(null);return(0,W.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:[(0,W.jsxs)(`nav`,{ref:s,"aria-label":`Sessions list`,className:`flex min-h-0 flex-1 flex-col overflow-y-auto px-1 pb-2`,children:[n.length===0?(0,W.jsxs)(`p`,{className:`px-2.5 py-1.5 text-xs text-muted-foreground`,children:[`No sessions match “`,e.trim(),`”.`]}):null,r.length>0?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`p`,{className:XZ,children:`This window`}),(0,W.jsx)(`ul`,{className:`flex flex-col gap-px`,children:r.map(e=>(0,W.jsx)(YZ,{entry:e},e.id))})]}):null,i.length>0?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`p`,{className:X(XZ,`mt-2`),children:`Background`}),(0,W.jsx)(`ul`,{className:`flex flex-col gap-px`,children:i.map(e=>(0,W.jsx)(YZ,{entry:e},e.id))})]}):!e.trim()&&t.length===1?(0,W.jsx)(`p`,{className:`px-2.5 pt-2 text-xs text-muted-foreground`,children:`No other sessions are running.`}):null,(0,W.jsxs)(`div`,{className:`mt-auto flex flex-col pt-2`,children:[(0,W.jsx)(ZZ,{id:`elsewhere`,label:`Other terminals`,entries:a}),(0,W.jsx)(ZZ,{id:`ended`,label:`Ended`,entries:o,archivable:!0})]})]}),(0,W.jsx)(Gv,{target:s})]})}function tQ(){let e=LO(`status`).data?.workspace.name;return(0,W.jsx)(`span`,{"data-slot":`sidebar-title`,title:e,className:`min-w-0 flex-1 truncate text-sm font-semibold tracking-tight text-sidebar-foreground`,children:e??`Bot Lobby`})}function nQ({route:e,keys:t,onHelp:n}){let r=t.settings??`Alt+S`;return(0,W.jsxs)(`div`,{className:`sidebar-foot flex flex-col gap-1 border-t border-[var(--sidebar-border)] px-1 py-2`,children:[(0,W.jsxs)(`a`,{href:`#/settings`,"aria-label":`Settings`,"aria-current":e.kind===`settings`?`page`:void 0,"aria-keyshortcuts":r,className:`flex h-8 items-center gap-2 rounded-md px-2 text-sm text-sidebar-foreground outline-none transition-colors duration-150 hover:bg-sidebar-accent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring aria-[current=page]:bg-[var(--sidebar-selected)] aria-[current=page]:font-medium [&>svg]:text-[var(--sidebar-icon)]`,children:[(0,W.jsx)(Dg,{"aria-hidden":`true`,className:`size-4 shrink-0`}),(0,W.jsx)(`span`,{className:`flex-1`,children:`Settings`}),(0,W.jsx)(XD,{chord:r})]}),(0,W.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,W.jsx)(TX,{hint:t.help??`Alt+H`,onHelp:n,className:RZ}),(0,W.jsx)(DX,{className:RZ}),(0,W.jsx)(EX,{className:RZ}),(0,W.jsx)(kX,{className:RZ}),(0,W.jsx)(AX,{className:RZ}),(0,W.jsx)(jX,{className:RZ})]})]})}function rQ(){try{let e=Number(localStorage.getItem(LZ));if(e>=IZ.min&&e<=IZ.max)return e}catch{}return IZ.start}function iQ(e){try{e===IZ.start?localStorage.removeItem(LZ):localStorage.setItem(LZ,String(e))}catch{}}var aQ=e=>Math.min(IZ.max,Math.max(IZ.min,Math.round(e*4)/4));function oQ({width:e,onWidth:t,onResizing:n,onFold:r}){let i=(0,m.useRef)(null),a=(0,m.useRef)(!1),o=(0,m.useRef)(void 0);(0,m.useEffect)(()=>()=>window.clearTimeout(o.current),[]);let s=()=>parseFloat(getComputedStyle(document.documentElement).fontSize)||16;return(0,W.jsx)(`div`,{role:`separator`,tabIndex:0,"aria-label":`Resize sidebar`,"aria-orientation":`vertical`,"aria-controls":`app-sidebar`,"aria-valuemin":IZ.min,"aria-valuemax":IZ.max,"aria-valuenow":e,title:`Drag to resize, click to fold, double-click to reset`,className:`sidebar-edge`,onPointerDown:t=>{t.button===0&&(t.currentTarget.setPointerCapture?.(t.pointerId),i.current={x:t.clientX,width:e,moved:!1})},onPointerMove:e=>{let r=i.current;if(!r)return;let a=e.clientX-r.x;!r.moved&&Math.abs(a)<3||(r.moved||n(!0),r.moved=!0,t(aQ(r.width+a/s())))},onPointerUp:()=>{let e=i.current;i.current=null,e&&(a.current=e.moved,n(!1))},onClick:e=>{a.current||e.detail!==1||(o.current=window.setTimeout(r,240))},onPointerCancel:()=>{i.current=null,n(!1)},onDoubleClick:()=>{window.clearTimeout(o.current),t(IZ.start)},onKeyDown:n=>{n.key===`ArrowLeft`||n.key===`ArrowRight`?(n.preventDefault(),t(aQ(e+(n.key===`ArrowRight`?1:-1)))):n.key===`Home`||n.key===`End`?(n.preventDefault(),t(n.key===`Home`?IZ.min:IZ.max)):n.key===`Enter`&&(n.preventDefault(),r())}})}function sQ(e){RO(cH);let[t,n]=_H(FZ),[r,i]=(0,m.useState)(rQ),[a,o]=(0,m.useState)(!1),[s,c]=(0,m.useState)(``),[l,u]=(0,m.useState)(!1),d=(0,m.useCallback)(e=>{i(e),iQ(e)},[]);return(0,W.jsxs)(`aside`,{id:`app-sidebar`,"aria-label":`Sidebar`,"data-folded":t?``:void 0,"data-resizing":a?``:void 0,inert:t,style:{width:t?0:`${r}rem`},className:`app-sidebar`,children:[(0,W.jsxs)(`div`,{className:`sidebar-panel flex min-h-0 flex-1 flex-col`,style:{width:`${r}rem`},children:[(0,W.jsxs)(`div`,{className:`flex min-h-12 items-center gap-2 pr-1 pl-3`,children:[(0,W.jsx)(tQ,{}),(0,W.jsx)(BZ,{label:`Collapse sidebar`,hint:e.keys.sidebar,children:(0,W.jsx)(`button`,{type:`button`,"aria-label":`Collapse sidebar`,"aria-expanded":!0,"aria-controls":`app-sidebar`,"aria-keyshortcuts":e.keys.sidebar,onClick:n,className:RZ,children:(0,W.jsx)(Gh,{"aria-hidden":`true`,className:`size-4`})})})]}),(0,W.jsx)($Z,{query:s,onQuery:c,onNew:()=>u(!0)}),(0,W.jsx)(eQ,{query:s}),(0,W.jsx)(nQ,{...e})]}),(0,W.jsx)(oQ,{width:r,onWidth:d,onResizing:o,onFold:n}),(0,W.jsx)(MZ,{open:l,onOpenChange:u})]})}function cQ({hint:e}){RO(cH);let[t,n]=_H(FZ);return t?(0,W.jsx)(BZ,{label:`Expand sidebar`,hint:e,children:(0,W.jsx)(`button`,{type:`button`,"aria-label":`Expand sidebar`,"aria-expanded":!1,"aria-controls":`app-sidebar`,"aria-keyshortcuts":e,onClick:n,className:X(RZ,`sidebar-open size-8 text-foreground`),children:(0,W.jsx)(qh,{"aria-hidden":`true`,className:`size-4`})})}):null}var lQ=`bot-lobby.terminal.open`,uQ=`bot-lobby.terminal.height`,dQ=`bot-lobby.terminal.popup`,fQ={start:280,min:140},pQ=new Set,mQ,hQ,gQ;function _Q(e){try{return localStorage.getItem(e)}catch{return null}}function vQ(e,t){try{localStorage.setItem(e,t)}catch{}}function yQ(){for(let e of[...pQ])e()}function bQ(e){return pQ.add(e),()=>{pQ.delete(e)}}function xQ(){return mQ??=_Q(lQ)===`1`,mQ}function SQ(){if(hQ===void 0){let e=Number(_Q(uQ));hQ=e>=fQ.min?e:fQ.start}return hQ}function CQ(e){mQ=e,vQ(lQ,e?`1`:`0`),yQ()}function wQ(){CQ(!xQ())}function TQ(e){hQ=Math.max(fQ.min,Math.round(e)),vQ(uQ,String(hQ)),yQ()}function EQ(){return(0,m.useSyncExternalStore)(bQ,xQ,()=>!1)}function DQ(){return(0,m.useSyncExternalStore)(bQ,SQ,()=>fQ.start)}function OQ(){return gQ??=_Q(dQ)===`1`,gQ}function kQ(e){gQ=e,vQ(dQ,e?`1`:`0`),yQ()}function AQ(){return(0,m.useSyncExternalStore)(bQ,OQ,()=>!1)}var jQ=`modulepreload`,MQ=function(e){return`/`+e},NQ={},PQ=function(e){return e.pathname.endsWith(`.css`)},FQ=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=MQ(t,n);let r=s(t);if(r.href in NQ)return;NQ[r.href]=!0;let i=PQ(r);if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let o=document.createElement(`link`);if(o.rel=i?`stylesheet`:jQ,i||(o.as=`script`),o.crossOrigin=``,o.href=r.href,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),i)return new Promise((e,t)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>t(Error(`Unable to preload CSS for ${r}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},IQ=(0,m.lazy)(()=>FQ(()=>import(`./TerminalView-Cz-KNWsq.js`),__vite__mapDeps([0,1,2,3]))),LQ=`inline-flex size-6 items-center justify-center text-foreground/80 outline-none transition-colors duration-150 hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-40 aria-pressed:bg-accent aria-pressed:text-foreground`;function RQ({label:e,hint:t,children:n}){return(0,W.jsxs)(VO,{children:[(0,W.jsx)(HO,{asChild:!0,children:n}),(0,W.jsxs)(UO,{side:`top`,children:[e,` `,t?(0,W.jsx)(XD,{chord:t}):null]})]})}function zQ({hint:e,className:t}){let n=EQ();return(0,W.jsx)(RQ,{label:n?`Hide terminal`:`Terminal`,hint:e,children:(0,W.jsx)(`button`,{type:`button`,"aria-label":`Terminal`,"aria-pressed":n,"aria-controls":n?`terminal-drawer`:void 0,"aria-keyshortcuts":e,onClick:wQ,className:t,children:(0,W.jsx)(Lg,{"aria-hidden":`true`,className:`size-4`})})})}function BQ(e){let[t,n]=(0,m.useState)(),[r,i]=(0,m.useState)(``),a=(0,m.useCallback)(async()=>{try{n(await z(`terminal.list`,{})),i(``)}catch(e){i(e instanceof Error?e.message:`The terminals could not be read.`)}},[]);return(0,m.useEffect)(()=>{e&&a()},[e,a]),{list:t,error:r,reload:a}}function VQ({height:e,max:t}){let n=(0,m.useRef)(null);return(0,W.jsx)(`div`,{role:`separator`,tabIndex:0,"aria-label":`Resize terminal`,"aria-orientation":`horizontal`,"aria-valuenow":e,"aria-valuemin":fQ.min,"aria-valuemax":t,className:`terminal-edge`,onPointerDown:t=>{t.button===0&&(t.currentTarget.setPointerCapture?.(t.pointerId),n.current={y:t.clientY,height:e},document.documentElement.dataset.resizing=`row`)},onPointerMove:e=>{n.current&&TQ(Math.min(t,n.current.height+n.current.y-e.clientY))},onPointerUp:()=>{n.current=null,delete document.documentElement.dataset.resizing},onPointerCancel:()=>{n.current=null,delete document.documentElement.dataset.resizing},onDoubleClick:()=>TQ(fQ.start),onKeyDown:n=>{(n.key===`ArrowUp`||n.key===`ArrowDown`)&&(n.preventDefault(),TQ(Math.min(t,e+(n.key===`ArrowUp`?24:-24))))}})}function HQ({toggleKey:e}){let t=EQ(),n=AQ(),r=DQ(),i=oO(t&&n,aO.sheet),{list:a,error:o,reload:s}=BQ(t),[c,l]=(0,m.useState)(),[u,d]=(0,m.useState)(!1),[f,p]=(0,m.useState)(()=>Math.round(window.innerHeight*.7)),h=a?.terminals??[],g=h.find(e=>e.id===c)??h.at(-1);(0,m.useEffect)(()=>{let e=()=>p(Math.round(window.innerHeight*.7));return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let _=(0,m.useCallback)(async()=>{d(!0);try{let e=await z(`terminal.open`,{cols:100,rows:24});l(e.id),await s()}catch(e){G.error(e instanceof Error?e.message:`The terminal did not start.`)}finally{d(!1)}},[s]),v=(0,m.useCallback)(async e=>{try{await z(`terminal.close`,{id:e})}catch{}await s()},[s]),y=(0,m.useRef)(!1);(0,m.useEffect)(()=>{if(!t){y.current=!1;return}!a||!a.available||a.terminals.length>0||y.current||u||(y.current=!0,_())},[t,a,u,_]);let b=t&&!n?Math.min(r,f):0;if((0,m.useEffect)(()=>{let e=document.documentElement;return b?e.style.setProperty(`--terminal-h`,`${b}px`):e.style.removeProperty(`--terminal-h`),()=>{e.style.removeProperty(`--terminal-h`)}},[b]),!t)return null;let x=(0,W.jsx)(UQ,{list:a,error:o,terminals:h,shown:g,busy:u,popup:n,toggleKey:e,onPick:l,onStart:()=>void _(),onEnd:e=>void v(e),onReload:()=>void s()});return n?(0,W.jsx)(QD,{open:i,onOpenChange:e=>{e||CQ(!1)},label:`Terminal`,className:`terminal-pop h-[min(72svh,40rem)] max-h-none max-w-5xl`,onEscapeKeyDown:e=>{e.target?.closest?.(`.xterm`)&&e.preventDefault()},children:(0,W.jsx)(`div`,{id:`terminal-drawer`,className:`flex min-h-0 flex-1`,children:x})}):(0,W.jsxs)(`section`,{id:`terminal-drawer`,"aria-label":`Terminal`,className:`terminal-drawer relative flex shrink-0 border-t border-border`,style:{height:Math.min(r,f)},children:[(0,W.jsx)(VQ,{height:Math.min(r,f),max:f}),x]})}function UQ({list:e,error:t,terminals:n,shown:r,busy:i,popup:a,toggleKey:o,onPick:s,onStart:c,onEnd:l,onReload:u}){let d=(0,W.jsxs)(`div`,{className:`terminal-tools pointer-events-auto inline-flex items-center overflow-hidden rounded-md border border-border/80 bg-background shadow-xs`,children:[(0,W.jsx)(RQ,{label:`New terminal`,children:(0,W.jsx)(`button`,{type:`button`,"aria-label":`New terminal`,disabled:i||e?.available===!1,onClick:c,className:LQ,children:(0,W.jsx)(lg,{"aria-hidden":`true`,className:`size-3.5`})})}),(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`h-4 w-px bg-border/80`}),(0,W.jsx)(RQ,{label:`End this terminal`,children:(0,W.jsx)(`button`,{type:`button`,"aria-label":`End this terminal`,disabled:!r,onClick:()=>r&&l(r.id),className:LQ,children:(0,W.jsx)(qg,{"aria-hidden":`true`,className:`size-3.5`})})}),(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`h-4 w-px bg-border/80`}),(0,W.jsx)(RQ,{label:a?`Back to the drawer`:`Open in a pop-up`,children:(0,W.jsx)(`button`,{type:`button`,"aria-label":`Pop out terminal`,"aria-pressed":a,onClick:()=>kQ(!a),className:LQ,children:(0,W.jsx)(ag,{"aria-hidden":`true`,className:`size-3.5`})})}),(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`h-4 w-px bg-border/80`}),(0,W.jsx)(RQ,{label:`Hide terminal`,hint:o,children:(0,W.jsx)(`button`,{type:`button`,"aria-label":`Hide terminal`,onClick:()=>CQ(!1),className:LQ,children:a?(0,W.jsx)(d_,{"aria-hidden":`true`,className:`size-3.5`}):(0,W.jsx)($p,{"aria-hidden":`true`,className:`size-3.5`})})})]}),f=(0,W.jsx)(W.Fragment,{children:e&&!e.available?(0,W.jsx)(`p`,{className:`flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground`,children:e.reason}):t?(0,W.jsx)(`p`,{role:`alert`,className:`flex h-full items-center justify-center px-6 text-center text-sm text-destructive`,children:t}):(0,W.jsxs)(m.Suspense,{fallback:(0,W.jsx)(`p`,{className:`p-3 text-xs text-muted-foreground`,children:`Loading the terminal…`}),children:[e&&n.length===0&&!i?(0,W.jsx)(`p`,{className:`p-3 text-xs text-muted-foreground`,children:`No terminal is running. Start one with New terminal.`}):null,n.map(e=>(0,W.jsx)(IQ,{id:e.id,active:e.id===r?.id,toggleKey:o,onExit:u},e.id))]})}),p=n.length>1?(0,W.jsx)(`nav`,{"aria-label":`Terminals`,className:X(`flex w-36 shrink-0 flex-col gap-0.5 overflow-y-auto border-l border-border px-1 pb-1`,a?`pt-2`:`pt-10`),children:n.map(e=>(0,W.jsxs)(`button`,{type:`button`,"aria-current":e.id===r?.id?`true`:void 0,onClick:()=>s(e.id),className:X(`flex h-6 min-w-0 items-center gap-1.5 rounded px-1.5 text-left text-xs text-muted-foreground outline-none transition-colors duration-150 hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring aria-[current=true]:bg-accent aria-[current=true]:text-foreground`,!e.alive&&`opacity-60`),children:[(0,W.jsx)(Lg,{"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,W.jsx)(`span`,{className:`truncate`,children:e.title}),e.alive?null:(0,W.jsx)(`span`,{className:`sr-only`,children:`, ended`})]},e.id))}):null;return a?(0,W.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,W.jsxs)(`header`,{className:`flex h-11 shrink-0 items-center gap-2 border-b border-border/70 pr-2 pl-4`,children:[(0,W.jsx)(Lg,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}),(0,W.jsx)(`span`,{className:`flex-1 text-sm font-medium`,children:`Terminal`}),d]}),(0,W.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,W.jsx)(`div`,{className:`min-w-0 flex-1 py-2 pl-2`,children:(0,W.jsx)(`div`,{className:`relative h-full`,children:f})}),p]})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[f,(0,W.jsx)(`div`,{className:`pointer-events-none absolute top-2 right-2 z-20`,children:d})]}),p]})}var WQ=(0,m.lazy)(()=>FQ(()=>import(`./CodeSurface-BtzJOVyH.js`),__vite__mapDeps([4,1,2]))),GQ=`inline-flex size-7 items-center justify-center rounded-md text-muted-foreground outline-none transition-colors duration-150 hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-40 aria-pressed:bg-accent aria-pressed:text-foreground`;function KQ({label:e,hint:t,children:n}){return(0,W.jsxs)(VO,{children:[(0,W.jsx)(HO,{asChild:!0,children:n}),(0,W.jsxs)(UO,{side:`bottom`,children:[e,` `,t?(0,W.jsx)(XD,{chord:t}):null]})]})}function qQ({hint:e,className:t}){let{open:n}=Az();return(0,W.jsx)(KQ,{label:`Code and changes`,hint:e,children:(0,W.jsx)(`button`,{type:`button`,"aria-label":`Code`,"aria-pressed":n,"aria-keyshortcuts":e,onClick:()=>n?Oz():Dz(),className:t,children:(0,W.jsx)(Vm,{"aria-hidden":`true`,className:`size-4`})})})}var JQ={modified:{letter:`M`,word:`Modified`,tone:`text-warning`},added:{letter:`A`,word:`Added`,tone:`text-success`},untracked:{letter:`U`,word:`New, not committed`,tone:`text-success`},deleted:{letter:`D`,word:`Deleted`,tone:`text-destructive`},renamed:{letter:`R`,word:`Renamed`,tone:`text-primary`}};function YQ(e){let t=e.lastIndexOf(`/`);return t<0?{dir:``,name:e}:{dir:e.slice(0,t),name:e.slice(t+1)}}function XQ({change:e,className:t}){return e.additions===void 0&&e.deletions===void 0?null:(0,W.jsxs)(`span`,{className:X(`shrink-0 font-mono text-[0.6875rem] tabular-nums`,t),children:[(0,W.jsxs)(`span`,{className:`text-success`,children:[`+`,e.additions??0]}),` `,(0,W.jsxs)(`span`,{className:`text-destructive`,children:[`−`,e.deletions??0]})]})}function ZQ(){let[e,t]=(0,m.useState)(()=>document.documentElement.classList.contains(`dark`));return(0,m.useEffect)(()=>{let e=document.documentElement,n=new MutationObserver(()=>t(e.classList.contains(`dark`)));return n.observe(e,{attributes:!0,attributeFilter:[`class`]}),()=>n.disconnect()},[]),e}function QQ({changes:e,loading:t,error:n,current:r,onPick:i,onRefresh:a}){let[o,s]=(0,m.useState)(``),c=e?.files??[],l=c.reduce((e,t)=>({additions:e.additions+(t.additions??0),deletions:e.deletions+(t.deletions??0)}),{additions:0,deletions:0});function u(e){e.preventDefault();let t=o.trim();t&&(i(t),s(``))}return(0,W.jsxs)(`nav`,{"aria-label":`Changed files`,className:`code-rail flex w-64 shrink-0 flex-col border-r border-border max-md:w-52`,children:[(0,W.jsx)(`form`,{onSubmit:u,className:`border-b border-border p-2`,children:(0,W.jsxs)(`label`,{className:`flex h-8 items-center gap-2 rounded-md border border-input bg-background px-2 transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/20`,children:[(0,W.jsx)(Tg,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,W.jsx)(`input`,{value:o,onChange:e=>s(e.target.value),"aria-label":`Open a file by path`,placeholder:`Open a file by path…`,spellCheck:!1,autoComplete:`off`,className:`h-full min-w-0 flex-1 bg-transparent font-mono text-xs outline-none placeholder:font-sans placeholder:text-muted-foreground`})]})}),(0,W.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center gap-2 px-3 text-xs`,children:[(0,W.jsx)(`span`,{className:`font-medium text-foreground`,children:`Changes`}),(0,W.jsxs)(`span`,{className:`text-muted-foreground tabular-nums`,children:[c.length,e?.truncated?`+`:``]}),(0,W.jsx)(XQ,{change:l,className:`ml-auto`}),(0,W.jsx)(KQ,{label:`Read the changes again`,children:(0,W.jsx)(`button`,{type:`button`,"aria-label":`Refresh changes`,onClick:a,disabled:t,className:X(GQ,`-mr-1.5 size-6`,c.length?``:`ml-auto`),children:(0,W.jsx)(dg,{"aria-hidden":`true`,className:X(`size-3.5`,t&&`animate-spin motion-reduce:animate-none`)})})})]}),(0,W.jsxs)(`ul`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-1.5 pb-2`,children:[c.map(e=>{let{dir:t,name:n}=YQ(e.path),a=JQ[e.status];return(0,W.jsx)(`li`,{children:(0,W.jsxs)(`button`,{type:`button`,onClick:()=>i(e.path),"aria-current":e.path===r?`true`:void 0,title:e.from?`${e.from} → ${e.path}`:e.path,className:`group/row flex h-7 w-full min-w-0 items-center gap-2 rounded-md px-1.5 text-left text-[0.8125rem] outline-none transition-colors duration-150 hover:bg-accent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring aria-[current=true]:bg-accent`,children:[(0,W.jsx)(`span`,{"aria-label":a.word,className:X(`w-3 shrink-0 text-center font-mono text-[0.6875rem] font-semibold`,a.tone),children:a.letter}),(0,W.jsxs)(`span`,{className:X(`min-w-0 flex-1 truncate`,e.status===`deleted`&&`text-muted-foreground line-through decoration-muted-foreground/50`),children:[n,t?(0,W.jsx)(`span`,{className:`ml-1.5 text-xs text-muted-foreground`,children:t}):null]}),(0,W.jsx)(XQ,{change:e})]})},e.path)}),e&&!e.git?(0,W.jsx)(`li`,{className:`px-2 py-6 text-center text-xs text-muted-foreground`,children:`This folder is not a git repository, so there are no changes to show. Open a file by its path above.`}):null,e?.git&&c.length===0?(0,W.jsx)(`li`,{className:`px-2 py-6 text-center text-xs text-muted-foreground`,children:`No changes since the last commit.`}):null,n?(0,W.jsx)(`li`,{role:`alert`,className:`px-2 py-3 text-xs text-destructive`,children:n}):null]})]})}function $Q(e){let[t,n]=(0,m.useState)(),[r,i]=(0,m.useState)(),[a,o]=(0,m.useState)(!1),s=(0,m.useRef)(0),c=(0,m.useCallback)(async e=>{let t=++s.current;o(!0),i(void 0);try{let r=await z(`code.read`,{path:e});t===s.current&&n(e=>({file:r,version:(e?.version??0)+1}))}catch(e){t===s.current&&(n(void 0),i(e instanceof Error?e.message:String(e)))}finally{t===s.current&&o(!1)}},[]);return(0,m.useEffect)(()=>{e?c(e):(s.current++,n(void 0),i(void 0))},[e,c]),{loaded:t,setLoaded:n,error:r,loading:a,reload:()=>e&&c(e)}}function e$({requested:e,requestedMode:t,request:n,codeKey:r,onClose:i,onDirtyChange:a,closeAsked:o}){let s=zO(`code.changes`,{},[`lobby`,`tasks`]),[c,l]=(0,m.useState)(e),[u,d]=(0,m.useState)(t??`code`),{loaded:f,setLoaded:p,error:h,loading:g,reload:_}=$Q(c),[v,y]=(0,m.useState)(),[b,x]=(0,m.useState)(!1),[S,C]=(0,m.useState)(!1),[w,T]=(0,m.useState)(),E=Lz(),D=Rz(),O=ZQ(),k=f?.file,A=v!==void 0&&v!==k?.contents;(0,m.useEffect)(()=>a(A),[A,a]),(0,m.useEffect)(()=>{if(!e||e===c){t&&d(t);return}j({kind:`open`,path:e})},[n]),(0,m.useEffect)(()=>{if(!c&&s.data?.files[0]){let e=s.data.files.find(e=>e.status!==`deleted`)??s.data.files[0];l(e.path),t||d(`diff`)}},[s.data]),(0,m.useEffect)(()=>{k&&k.path!==c&&l(k.path)},[k?.path]),(0,m.useEffect)(()=>{o&&j({kind:`close`})},[o]);function ee(e){if(T(void 0),C(!1),e.kind===`close`){i();return}y(void 0),l(e.path)}function j(e){(e.kind!==`open`||e.path!==c)&&(A?T(e):ee(e))}async function M(e=!1){if(k&&v!==void 0&&!b){x(!0);try{let t=await z(`code.save`,{path:k.path,contents:v,mtimeMs:k.mtimeMs,...e?{force:!0}:{}});return p(e=>e&&{...e,file:{...e.file,contents:v,mtimeMs:t.mtimeMs,size:v.length}}),y(void 0),C(!1),s.reload(),w&&ee(w),!0}catch(e){return e instanceof ye&&e.code===`conflict`?C(!0):G.error(e instanceof Error?e.message:`The file could not be saved.`),!1}finally{x(!1)}}}function N(e){(e.ctrlKey||e.metaKey)&&!e.altKey&&e.key.toLowerCase()===`s`?(e.preventDefault(),e.stopPropagation(),M()):r&&aX(e.nativeEvent,r)&&(e.preventDefault(),j({kind:`close`}))}let P=k?.change,F=!!P||k?.original!==void 0,te=F?u:`code`,{dir:ne,name:re}=YQ(k?.path??c??``),ie=!!(k?.exists&&k.contents!==void 0),ae=P?JQ[P.status]:void 0;return(0,W.jsxs)(`div`,{className:`flex min-h-0 flex-1`,onKeyDown:N,children:[(0,W.jsx)(QQ,{changes:s.data,loading:s.loading,error:s.error,current:k?.path??c,onPick:e=>j({kind:`open`,path:e}),onRefresh:()=>{s.reload(),A||_()}}),(0,W.jsxs)(`section`,{"aria-label":`File`,className:`flex min-w-0 flex-1 flex-col`,children:[(0,W.jsxs)(`header`,{className:`flex h-11 shrink-0 items-center gap-2 border-b border-border pr-2 pl-3`,children:[c?(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[ae?(0,W.jsx)(`span`,{title:ae.word,className:X(`font-mono text-xs font-semibold`,ae.tone),children:ae.letter}):(0,W.jsx)(Vm,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`}),(0,W.jsxs)(`h2`,{className:`min-w-0 truncate text-[0.8125rem]`,title:k?.path??c,children:[ne?(0,W.jsxs)(`span`,{className:`text-muted-foreground`,children:[ne,`/`]}):null,(0,W.jsx)(`span`,{className:`font-medium text-foreground`,children:re}),A?(0,W.jsx)(`span`,{"aria-label":`unsaved`,title:`Unsaved edits`,className:`ml-1.5 inline-block size-1.5 -translate-y-0.5 rounded-full bg-foreground/70`}):null]}),P?(0,W.jsx)(XQ,{change:P}):null]}):(0,W.jsx)(`h2`,{className:`min-w-0 flex-1 truncate text-[0.8125rem] text-muted-foreground`,children:`Code`}),F?(0,W.jsx)(fk,{label:`View`,value:te,onChange:d,items:[{id:`code`,label:`Code`},{id:`diff`,label:`Diff`}]}):null,te===`diff`?(0,W.jsx)(KQ,{label:D===`split`?`Unified diff`:`Side by side`,children:(0,W.jsx)(`button`,{type:`button`,"aria-label":`Side by side`,"aria-pressed":D===`split`,onClick:()=>Iz(D===`split`?`unified`:`split`),className:GQ,children:D===`split`?(0,W.jsx)(xg,{"aria-hidden":`true`,className:`size-4`}):(0,W.jsx)(km,{"aria-hidden":`true`,className:`size-4`})})}):null,(0,W.jsx)(KQ,{label:E?`Do not wrap lines`:`Wrap long lines`,children:(0,W.jsx)(`button`,{type:`button`,"aria-label":`Wrap lines`,"aria-pressed":E,onClick:()=>Fz(!E),className:GQ,children:(0,W.jsx)(Gg,{"aria-hidden":`true`,className:`size-4`})})}),(0,W.jsx)(KQ,{label:`Save`,hint:`Ctrl+S`,children:(0,W.jsxs)(Z,{size:`sm`,variant:A?`default`:`outline`,disabled:!A||b,onClick:()=>void M(),"aria-keyshortcuts":`Control+S Meta+S`,children:[(0,W.jsx)(Cg,{"aria-hidden":`true`}),b?`Saving…`:`Save`]})}),(0,W.jsx)(KQ,{label:`Close`,hint:r,children:(0,W.jsx)(`button`,{type:`button`,"aria-label":`Close code viewer`,onClick:()=>j({kind:`close`}),className:GQ,children:(0,W.jsx)(d_,{"aria-hidden":`true`,className:`size-4`})})})]}),w?(0,W.jsxs)(`div`,{role:`alert`,className:`flex shrink-0 flex-wrap items-center gap-2 border-b border-border bg-muted/40 px-3 py-2 text-xs`,children:[(0,W.jsx)($h,{"aria-hidden":`true`,className:`size-3.5 text-muted-foreground`}),(0,W.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[re,` has unsaved edits.`]}),(0,W.jsx)(Z,{size:`xs`,variant:`ghost`,onClick:()=>T(void 0),children:`Keep editing`}),(0,W.jsx)(Z,{size:`xs`,variant:`outline`,onClick:()=>ee(w),children:`Discard`}),(0,W.jsx)(Z,{size:`xs`,onClick:()=>void M(),disabled:b,children:`Save`})]}):null,S?(0,W.jsxs)(`div`,{role:`alert`,className:`flex shrink-0 flex-wrap items-center gap-2 border-b border-border bg-muted/40 px-3 py-2 text-xs`,children:[(0,W.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[re,` changed on disk since you opened it, maybe by an agent.`]}),(0,W.jsx)(Z,{size:`xs`,variant:`outline`,onClick:()=>{y(void 0),C(!1),_()},children:`Load theirs`}),(0,W.jsx)(Z,{size:`xs`,onClick:()=>void M(!0),disabled:b,children:`Overwrite with mine`})]}):null,(0,W.jsx)(`div`,{className:`code-pane relative flex min-h-0 flex-1 flex-col`,children:h?(0,W.jsx)(`p`,{role:`alert`,className:`m-auto max-w-sm px-6 text-center text-sm text-muted-foreground`,children:h}):c?k?k.binary||k.tooLarge?(0,W.jsx)(`p`,{className:`m-auto max-w-sm px-6 text-center text-sm text-muted-foreground`,children:k.binary?`This is a binary file, so it is not shown.`:`This file is too large to show here.`}):!k.exists&&te===`code`?(0,W.jsxs)(`p`,{className:`m-auto flex max-w-sm flex-col items-center gap-2 px-6 text-center text-sm text-muted-foreground`,children:[(0,W.jsx)(Zm,{"aria-hidden":`true`,className:`size-5`}),`This file was deleted. Switch to Diff to see what it held.`]}):(0,W.jsx)(m.Suspense,{fallback:(0,W.jsx)(`p`,{role:`status`,className:`m-auto text-xs text-muted-foreground`,children:`Loading code…`}),children:(0,W.jsx)(WQ,{path:k.path,version:`${f.version}`,contents:k.contents??``,draft:v,original:k.original,mode:te,layout:D,wrap:E,dark:O,readOnly:!ie,onDraft:y})}):(0,W.jsx)(`p`,{role:`status`,className:`m-auto text-xs text-muted-foreground`,children:g?`Opening…`:``}):(0,W.jsx)(t$,{loading:s.loading})})]})]})}function t$({loading:e}){return(0,W.jsxs)(`div`,{className:`m-auto flex max-w-xs flex-col items-center gap-2 px-6 text-center`,children:[(0,W.jsx)(Gm,{"aria-hidden":`true`,className:`size-5 text-muted-foreground`}),(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e?`Reading the changes…`:`Pick a changed file, open one by its path, or click a file name in the Lobby chat.`})]})}function n$({codeKey:e}){let{open:t,path:n,mode:r,request:i}=Az(),a=oO(t,aO.help),[o,s]=(0,m.useState)(!1),[c,l]=(0,m.useState)(0),u=()=>l(e=>e+1);return(0,W.jsx)(QD,{open:a,onOpenChange:e=>{e||(o?u():Oz())},label:`Code viewer`,className:`code-pop h-[min(86svh,52rem)] max-h-none max-w-6xl`,onEscapeKeyDown:e=>{o&&(e.preventDefault(),u())},children:t?(0,W.jsx)(e$,{requested:n,requestedMode:r,request:i,codeKey:e,onClose:Oz,onDirtyChange:s,closeAsked:c}):null})}function r$(e){let t=e.match(/[#&?]?token=([^&\s#]+)/i);if(t?.[1])return decodeURIComponent(t[1]);let n=e.trim();return n&&!n.includes(`/`)&&!n.includes(` `)?n:void 0}function i$(){let[e,t]=(0,m.useState)(``),[n,r]=(0,m.useState)(),[i,a]=(0,m.useState)(!1);async function o(e){a(!0),r(void 0),e&&(window.location.hash=`token=${encodeURIComponent(e)}`),await Se()?window.location.reload():(r(e?`That link did not sign in. Copy the link from Pi and try again.`:`Paste the link from Pi below.`),a(!1))}function s(t){t.preventDefault(),o(r$(e))}return(0,W.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-y-auto p-6`,children:(0,W.jsxs)(`form`,{onSubmit:s,className:`glass flex min-h-0 w-full max-w-md flex-col gap-4 rounded-xl p-6`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(dh,{className:`size-5`,"aria-hidden":`true`}),(0,W.jsx)(`h1`,{className:`text-base font-medium`,children:`Sign in to bot-lobby`})]}),(0,W.jsxs)(`p`,{className:`break-words text-sm text-muted-foreground`,children:[`Pi printed a link when it started (or run `,(0,W.jsx)(`code`,{className:`rounded-lg bg-muted px-1.5 py-0.5 font-mono text-xs`,children:`/bot-lobby web`}),`to see it again). Paste it here.`]}),(0,W.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm`,children:[(0,W.jsx)(`span`,{className:`font-medium`,children:`Lobby link or token`}),(0,W.jsx)(`input`,{value:e,onChange:e=>t(e.target.value),autoComplete:`off`,spellCheck:!1,placeholder:`http://127.0.0.1:7347/#token=…`,className:`h-8 min-w-0 rounded-lg border border-input bg-background px-3.5 text-sm outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30`})]}),n?(0,W.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:n}):null,(0,W.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,W.jsx)(Z,{type:`button`,variant:`ghost`,disabled:i,onClick:()=>void o(void 0),children:`Retry`}),(0,W.jsx)(Z,{type:`submit`,disabled:i||!e.trim(),children:`Sign in`})]})]})})}var a$=.6;function o$(e,t,n={}){return{initial:e?void 0:!1,animate:t,transition:{duration:a$,...n}}}var s$=(e,t)=>[0,Math.max(e,.001),Math.min(Math.max(t,e+.01),.999),1];function c$(e,t=0,n=1){return o$(e,{pathLength:[0,0,1,1],strokeOpacity:[0,0,1,1]},{pathLength:{duration:a$,times:s$(t,n),ease:`easeInOut`},strokeOpacity:{duration:a$,times:s$(t,t+.02)}})}function l$(e,t){return o$(e,{scale:[0,0,1.3,1]},{times:s$(t,t+.18),ease:`easeOut`})}function u$(e,t,n=1.3){return o$(e,{scale:[1,1,n,1,1]},{times:[0,Math.max(t,.001),Math.min(t+.15,.9),Math.min(t+.35,.99),1],ease:`easeInOut`})}var d$=(e=.5,t=.5)=>({transformBox:`fill-box`,originX:e,originY:t});function f$({play:e}){return(0,W.jsxs)(Yf.g,{style:d$(.1,.9),...o$(e,{rotate:[0,-12,8,-4,0],scale:[1,1.12,.96,1.02,1]},{ease:`easeInOut`}),children:[(0,W.jsx)(`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`}),[8,12,16].map((t,n)=>(0,W.jsx)(Yf.circle,{cx:t,cy:11,r:1.15,fill:`currentColor`,stroke:`none`,...o$(e,{fillOpacity:[0,0,1,1,0],y:[0,0,-1.5,0,0]},{times:[0,.12+n*.12,.24+n*.12,.72,1]})},t))]})}function p$({play:e}){return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Yf.path,{d:`M13 5h8`,...c$(e,.15,.45)}),(0,W.jsx)(Yf.path,{d:`M13 12h8`,...c$(e,.3,.6)}),(0,W.jsx)(Yf.path,{d:`M13 19h8`,...c$(e,.45,.75)}),(0,W.jsx)(Yf.path,{d:`m3 17 2 2 4-4`,...c$(e,.35,.7)}),(0,W.jsx)(Yf.path,{d:`m3 7 2 2 4-4`,...c$(e,0,.35)})]})}function m$({play:e}){return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Yf.circle,{cx:6,cy:19,r:3,style:d$(),...u$(e,0)}),(0,W.jsx)(Yf.path,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,...c$(e,.1,.7)}),(0,W.jsx)(Yf.circle,{cx:18,cy:5,r:3,style:d$(),...l$(e,.62)})]})}function h$({play:e}){return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Yf.circle,{cx:12,cy:12,r:10,style:d$(),...o$(e,{scale:[1,1,1.4],strokeOpacity:[0,.5,0]},{times:[0,.25,1],ease:`easeOut`})}),(0,W.jsx)(Yf.circle,{cx:12,cy:12,r:10,style:d$(),...o$(e,{scale:[1,.86,1.06,1]},{times:[0,.25,.55,1],ease:`easeInOut`})}),(0,W.jsx)(Yf.circle,{cx:12,cy:12,r:1,fill:`currentColor`,style:d$(),...o$(e,{scale:[1,2.4,.8,1]},{times:[0,.3,.6,1],ease:`easeInOut`})})]})}function g$({play:e}){return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Yf.circle,{cx:6,cy:6,r:3,style:d$(),...u$(e,0)}),(0,W.jsx)(Yf.line,{x1:6,x2:6,y1:9,y2:21,...c$(e,.05,.45)}),(0,W.jsx)(Yf.path,{d:`M13 6h3a2 2 0 0 1 2 2v7`,...c$(e,.2,.62)}),(0,W.jsx)(Yf.circle,{cx:18,cy:18,r:3,style:d$(),...l$(e,.58)})]})}function _$({play:e}){return(0,W.jsxs)(Yf.g,{style:d$(),...o$(e,{scaleX:[1,.55,1.08,1],y:[0,-1,0,0]},{times:[0,.35,.65,1],ease:`easeInOut`}),children:[(0,W.jsx)(Yf.path,{d:`M12 5v16`,style:d$(),...o$(e,{scaleY:[1,1.12,1,1]},{times:[0,.35,.65,1]})}),(0,W.jsx)(`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`})]})}var v$={lobby:f$,tasks:p$,plan:m$,issues:h$,git:g$,knowledge:_$};function y$({id:e,play:t,className:n}){let r=v$[e];return r?(0,W.jsx)(`svg`,{"aria-hidden":`true`,"data-tab-icon":e,"data-play":t,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,className:X(`overflow-visible`,n),children:(0,W.jsx)(r,{play:t})},t):null}function b$(e){return/(\d)$/.exec(e)?.[1]}var x$=160;function S$(e){let t=Tf(),[n,r]=(0,m.useState)(0),i=(0,m.useRef)(0),a=(0,m.useCallback)(()=>{t||performance.now()<i.current||(i.current=performance.now()+a$*1e3,r(e=>e+1))},[t]),o=(0,m.useRef)(e);return(0,m.useEffect)(()=>{let t=e&&!o.current;if(o.current=e,!t)return;let n=window.setTimeout(a,x$);return()=>window.clearTimeout(n)},[e,a]),{play:n,onPointerEnter:(0,m.useCallback)(e=>{e.pointerType!==`touch`&&a()},[a])}}var C$=(0,m.forwardRef)(function({tab:e,active:t},n){let r=b$(e.key),{play:i,onPointerEnter:a}=S$(t);return(0,W.jsxs)(VO,{children:[(0,W.jsx)(HO,{asChild:!0,children:(0,W.jsxs)(`a`,{ref:n,role:`tab`,id:`tab-${e.id}`,href:`#/${e.id}`,"aria-selected":t,"aria-keyshortcuts":e.key,tabIndex:t?0:-1,onPointerEnter:a,className:X(`relative z-10 inline-flex h-7 shrink-0 items-center gap-1.5 rounded-lg border border-[var(--tab-outline)] px-2.5 text-[0.8125rem] leading-none font-medium whitespace-nowrap outline-none`,`transition-colors duration-200 ease-snap focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,t?`text-foreground`:`bg-[var(--tab-idle)] text-muted-foreground hover:bg-accent hover:text-foreground`),children:[(0,W.jsx)(y$,{id:e.id,play:i,className:X(`size-3.5 shrink-0 transition-colors duration-200`,t&&`text-primary`)}),r?(0,W.jsx)(`span`,{"aria-hidden":`true`,className:X(`text-[0.72rem] font-semibold tabular-nums transition-colors duration-200`,t?`text-primary`:`text-muted-foreground/75`),children:r}):null,(0,W.jsx)(`span`,{children:e.label})]})}),(0,W.jsxs)(UO,{children:[e.label,` `,(0,W.jsx)(XD,{chord:e.key})]})]})}),w$=1.5;function T$(e,t,n=t?.left??0,r=t?.right??0,i=1){if(e){if(!t||r-n<.5){e.style.opacity=`0`;return}e.style.opacity=String(Math.min(1,(r-n)/14)),e.style.top=`${t.top}px`,e.style.height=`${t.height}px`,e.style.width=`${r-n}px`,e.style.transform=`translateX(${n}px)`,e.style.scale=i===1?``:`1 ${i}`}}function E$(e,t){let n=e.right-e.left,{height:r}=e,i=w$/2,a=Math.max(0,Math.min(e.radius-i,r/2-i,n/2-i)),o=r/2,s=e=>+(t===`left`?e:n-e).toFixed(2),c=+(t===`left`),l=1-c,u=i,d=n-i,f=r-i;return[`M${s(u)} ${o}L${s(u)} ${i+a}A${a} ${a} 0 0 ${c} ${s(u+a)} ${i}L${s(d-a)} ${i}A${a} ${a} 0 0 ${c} ${s(d)} ${i+a}L${s(d)} ${o}`,`M${s(u)} ${o}L${s(u)} ${f-a}A${a} ${a} 0 0 ${l} ${s(u+a)} ${f}L${s(d-a)} ${f}A${a} ${a} 0 0 ${l} ${s(d)} ${f-a}L${s(d)} ${o}`]}function D$(e,t,n,r){if(!e)return;if(!t||r<=.002){e.style.opacity=`0`;return}let i=t.right-t.left,a=`${i}x${t.height}r${t.radius}${n}`;e.dataset.shape!==a&&(e.dataset.shape=a,e.dataset.port=n,e.setAttribute(`viewBox`,`0 0 ${i} ${t.height}`),E$(t,n).forEach((t,n)=>e.children[n]?.setAttribute(`d`,t))),e.style.opacity=String(Math.min(1,r*12)),e.style.top=`${t.top}px`,e.style.height=`${t.height}px`,e.style.width=`${i}px`,e.style.transform=`translateX(${t.left}px)`;let o=`${Math.min(1,r)} 2`;for(let t of e.children)t.style.strokeDasharray=o}var O$={type:`spring`,visualDuration:.12,bounce:0},k$={type:`spring`,visualDuration:.17,bounce:.15,delay:.015},A$={type:`spring`,visualDuration:.17,bounce:.05,delay:.07},j$={type:`spring`,visualDuration:.22,bounce:.25},M$={type:`spring`,visualDuration:.2,bounce:0},N$={type:`spring`,stiffness:900,damping:18,velocity:45,restDelta:.02,restSpeed:1},P$=(()=>{let e=Er({keyframes:[0,1],visualDuration:j$.visualDuration,bounce:j$.bounce}),t=0;for(;t<1e3&&e.next(t).value<.97;)t+=4;return t/1e3})(),F$={type:`spring`,visualDuration:.28,bounce:.6};function I$(e,t){let n=(0,m.useRef)(null),r=(0,m.useRef)(null),i=(0,m.useRef)(null),a=(0,m.useRef)(null),o=(0,m.useRef)(null),s=(0,m.useRef)({}),c=(0,m.useRef)([]),l=(0,m.useRef)(void 0),u=(0,m.useRef)([]),d=(0,m.useRef)(1),f=(0,m.useRef)(1),p=(0,m.useCallback)(e=>{let t=e?s.current[e]:void 0;if(!t)return;let n=parseFloat(getComputedStyle(t).borderTopLeftRadius)||0;return{left:t.offsetLeft,right:t.offsetLeft+t.offsetWidth,top:t.offsetTop,height:t.offsetHeight,radius:n}},[]),h=(0,m.useCallback)(()=>{for(let e of u.current)e.stop();u.current=[];for(let e of Object.values(s.current))e?.style.translate&&(e.style.translate=``)},[]),g=(0,m.useCallback)(e=>{h(),l.current=e,d.current=1,f.current=1;let t=p(e);T$(r.current,t),T$(i.current,void 0),D$(a.current,t,`left`,1),D$(o.current,void 0,`left`,0);for(let e of c.current)e&&(e.style.width=`0px`);_z()},[p,h]),_=(0,m.useCallback)((e,t)=>{let n=p(e),m=p(t);if(!n||!m)return g(t);h(),gz(),l.current=t;let _=m.left>n.left?1:-1,v=_>0?n.right:n.left,y=_>0?m.left:m.right,b=Math.abs(y-v),x=_>0?`right`:`left`,S=_>0?`left`:`right`,C=c.current.map(e=>{let t=e?.parentElement;return t?{liquid:e,from:t.offsetLeft,to:t.offsetLeft+t.offsetWidth}:void 0}),w=b>4?1-4/b:0,T={drained:1-Math.min(1,d.current),unrung:1-Math.min(1,f.current),head:0,tail:0,filled:0,rung:0,squash:1,budge:0},E=s.current[t];d.current=0,f.current=0;let D=()=>{let e=(n.right-n.left)*Math.min(1,T.drained);T$(i.current,n,_>0?n.left+e:n.left,_>0?n.right:n.right-e),D$(o.current,n,x,1-T.unrung);let t=v+_*b*T.head,s=v+_*b*T.tail,c=Math.min(t,s),l=Math.max(t,s);for(let e of C){if(!e?.liquid)continue;let t=Math.max(c,e.from),n=Math.min(l,e.to);e.liquid.style.width=`${Math.max(0,n-t)}px`,e.liquid.style.transform=`translateX(${Math.max(0,t-e.from)}px)`}let u=_*T.budge,d=u?{...m,left:m.left+u,right:m.right+u}:m;E&&(E.style.translate=Math.abs(u)>.01?`${u.toFixed(2)}px`:``);let f=(d.right-d.left)*Math.min(1,Math.max(0,T.filled));T$(r.current,d,_>0?d.left:d.right-f,_>0?d.left+f:d.right,Math.min(1,T.squash)),D$(a.current,d,S,T.rung)},O=(e,t,n,r,i=1)=>{let a=Jf(t,i,{...n,onUpdate:t=>{T[e]=t,r?.(t),D()}});return u.current.push(a),a},k=!1,A=()=>{if(k)return;k=!0;let e=O(`filled`,0,j$,e=>{d.current=e});e.then(()=>{l.current===t&&_z()}),O(`squash`,.8,F$),O(`rung`,0,M$,e=>{f.current=e}),O(`budge`,0,{...N$,delay:P$},void 0,0),Promise.all([e,...u.current]).then(()=>{l.current===t&&u.current.includes(e)&&g(t)})};O(`drained`,T.drained,O$),O(`unrung`,T.unrung,O$),O(`head`,0,k$,e=>{e>=w&&A()}),O(`tail`,0,A$),D()},[p,g,h]);(0,m.useLayoutEffect)(()=>{let t=l.current,n=typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;!t||!e||t===e||n?g(e):_(t,e)},[e,t,_,g]);let v=(0,m.useRef)(e);return v.current=e,(0,m.useEffect)(()=>{let e=n.current;if(!e||typeof ResizeObserver>`u`)return;let t=!0,r=new ResizeObserver(()=>{if(t){t=!1;return}g(v.current)});return r.observe(e),()=>{r.disconnect(),h()}},[g,h]),{track:n,fill:r,drain:i,ring:a,unring:o,cells:s,liquids:c}}var L$=(0,m.forwardRef)(function({which:e},t){return(0,W.jsxs)(`svg`,{ref:t,"aria-hidden":`true`,[`data-tab-${e}`]:``,className:`pointer-events-none absolute left-0 z-20 overflow-visible opacity-0 will-change-transform`,fill:`none`,children:[(0,W.jsx)(`path`,{pathLength:1,strokeWidth:w$,strokeLinecap:`round`,className:`stroke-tab-rim`}),(0,W.jsx)(`path`,{pathLength:1,strokeWidth:w$,strokeLinecap:`round`,className:`stroke-tab-rim`})]})});function R$(e){if(e.left||e.right)return`linear-gradient(to right, ${e.left?`transparent 0, black 28px`:`black 0`}, ${e.right?`black calc(100% - 28px), transparent 100%`:`black 100%`})`}function z$({tabs:e,activeId:t,onSelect:n}){let{track:r,fill:i,drain:a,ring:o,unring:s,cells:c,liquids:l}=I$(t,e.length),u=(0,m.useRef)(null),[d,f]=(0,m.useState)({left:!1,right:!1}),p=(0,m.useCallback)(()=>{let e=u.current;if(!e)return;let t=e.scrollLeft>2,n=e.scrollLeft+e.clientWidth<e.scrollWidth-2;f(e=>e.left===t&&e.right===n?e:{left:t,right:n})},[]);(0,m.useEffect)(()=>{let e=u.current;if(!e||typeof ResizeObserver>`u`)return;p();let t=new ResizeObserver(p);return t.observe(e),e.firstElementChild&&t.observe(e.firstElementChild),()=>t.disconnect()},[p,e.length]),(0,m.useEffect)(()=>{let e=u.current,n=t?c.current[t]:void 0;e&&n&&(n.offsetLeft<e.scrollLeft?e.scrollLeft=n.offsetLeft-8:n.offsetLeft+n.offsetWidth>e.scrollLeft+e.clientWidth&&(e.scrollLeft=n.offsetLeft+n.offsetWidth-e.clientWidth+8))},[t,c]);function h(r){if(r.key===`ArrowDown`&&!r.altKey){ek()&&r.preventDefault();return}let i=r.key===`ArrowRight`?1:r.key===`ArrowLeft`?-1:0;if(!i||e.length===0)return;r.preventDefault();let a=r.target.closest(`[role='tab']`)?.id.replace(/^tab-/,``)??t,o=e[(Math.max(0,e.findIndex(e=>e.id===a))+i+e.length)%e.length];nk.active=!0,nk.to=o.id,window.setTimeout(()=>{nk.active=!1,nk.to=void 0},3e3),n(o.id),c.current[o.id]?.focus({preventScroll:!0})}return(0,W.jsx)(`div`,{ref:u,onScroll:p,style:{maskImage:R$(d),WebkitMaskImage:R$(d)},className:`min-w-0 max-w-full overflow-x-auto [scrollbar-width:none] pointer-coarse:-my-1.5 pointer-coarse:py-1.5 [&::-webkit-scrollbar]:hidden`,children:(0,W.jsxs)(`div`,{ref:r,role:`tablist`,"aria-label":`Lobby tabs`,onKeyDown:h,className:`relative mx-auto flex w-max items-center py-0.5`,children:[(0,W.jsx)(`span`,{ref:a,"aria-hidden":`true`,"data-tab-drain":!0,className:`pointer-events-none absolute left-0 z-0 rounded-lg bg-tab-fill opacity-0 will-change-transform`}),(0,W.jsx)(`span`,{ref:i,"aria-hidden":`true`,"data-tab-fill":!0,className:`pointer-events-none absolute left-0 z-0 rounded-lg bg-tab-fill opacity-0 will-change-transform`}),(0,W.jsx)(L$,{ref:s,which:`unring`}),(0,W.jsx)(L$,{ref:o,which:`ring`}),e.map((e,n)=>(0,W.jsxs)(m.Fragment,{children:[n>0?(0,W.jsxs)(`span`,{"aria-hidden":`true`,"data-tab-link":!0,className:`relative h-[2px] w-3.5 shrink-0 sm:w-4`,children:[(0,W.jsx)(`span`,{className:`absolute inset-0 border-t-2 border-dotted border-input`}),(0,W.jsx)(`span`,{ref:e=>{l.current[n-1]=e},"data-tab-liquid":!0,className:`absolute top-0 left-0 h-[2px] w-0 rounded-full bg-tab-liquid shadow-[0_0_6px_var(--tab-liquid)] will-change-transform`})]}):null,(0,W.jsx)(C$,{ref:t=>{c.current[e.id]=t},tab:e,active:e.id===t})]},e.id))]})})}function B$({oracleBusy:e,runs:t,activity:n,background:r}){let i=new Set;e&&i.add(`Oracle`);for(let e of t)e.status===`running`&&i.add(UV(qV(e)));for(let e of n)e.pending&&e.source!==`LOBBY`&&i.add(e.source===`MASTER`?`Oracle`:UV(e.source));let a=r.filter(e=>e.alive&&e.busy).length;return a&&i.add(a===1?`1 in the background`:`${a} in the background`),[...i]}function V$(e){return e.length<=2?e.join(`, `):`${e.slice(0,2).join(`, `)} +${e.length-2}`}var H$=6,U$=`bot-lobby.orb`,W$=e=>typeof e==`number`&&Number.isFinite(e)&&e>=0&&e<=1;function G$(e,t,n,r){let i=e=>e+H$,a=(e,t)=>Math.max(e+H$,e+t-r-H$);return{x:Math.min(a(n.left,n.width),Math.max(i(n.left),e)),y:Math.min(a(n.top,n.height),Math.max(i(n.top),t))}}function K$(e,t,n,r){let i=e=>Math.max(1,e-r),a=G$(e,t,n,r);return{fx:Math.min(1,Math.max(0,(a.x-n.left)/i(n.width))),fy:Math.min(1,Math.max(0,(a.y-n.top)/i(n.height)))}}function q$(e,t,n){return G$(t.left+e.fx*Math.max(0,t.width-n),t.top+e.fy*Math.max(0,t.height-n),t,n)}function J$(e){if(e)try{let t=JSON.parse(e);return W$(t.fx)&&W$(t.fy)?{fx:t.fx,fy:t.fy}:void 0}catch{return}}function Y$(){try{return J$(localStorage.getItem(U$))}catch{return}}function X$(e){try{localStorage.setItem(U$,JSON.stringify(e))}catch{}}var Z$=5,Q$=16;function $$(e){return{left:e.left,top:e.top,width:e.width,height:e.height}}function e1(){let e=document.getElementById(`main`)?.getBoundingClientRect();return e?$$(e):void 0}function t1(e,t){return!e||!t?e===t:e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function n1(){let[e,t]=(0,m.useState)(()=>e1());return(0,m.useEffect)(()=>{let e=()=>{let e=e1();t(t=>t1(t,e)?t:e)},n=document.getElementById(`main`),r=document.getElementById(`app-dock`),i=typeof ResizeObserver>`u`?void 0:new ResizeObserver(e);n&&i?.observe(n),r&&i?.observe(r);let a=window.visualViewport;return window.addEventListener(`resize`,e),window.addEventListener(`orientationchange`,e),a?.addEventListener(`resize`,e),a?.addEventListener(`scroll`,e),e(),()=>{i?.disconnect(),window.removeEventListener(`resize`,e),window.removeEventListener(`orientationchange`,e),a?.removeEventListener(`resize`,e),a?.removeEventListener(`scroll`,e)}},[]),e}var r1=(0,m.forwardRef)(function({spotlight:e,thinking:t,busy:n=[],tone:r,expanded:i,hidden:a,shortcut:o,onOpen:s},c){let l=n1(),[u,d]=(0,m.useState)(Y$),[f,p]=(0,m.useState)(),[h,g]=(0,m.useState)(!1),_=(0,m.useRef)(void 0),v=(0,m.useRef)(!1),y=(0,m.useRef)(44),b=f??(u&&l?q$(u,l,y.current):void 0),x=(0,m.useCallback)((e,t)=>{let n=e1();if(!n)return;let r=K$(e,t,n,y.current);d(r),X$(r)},[]);(0,m.useEffect)(()=>{l&&p(e=>e&&G$(e.x,e.y,l,y.current))},[l]);function S(e){if(e.button!==0)return;let t=e.currentTarget.getBoundingClientRect();y.current=t.width,_.current={id:e.pointerId,sx:e.clientX,sy:e.clientY,ox:t.left,oy:t.top,moved:!1},e.currentTarget.setPointerCapture?.(e.pointerId)}function C(e){let t=_.current;if(!t||t.id!==e.pointerId)return;let n=e.clientX-t.sx,r=e.clientY-t.sy;if(!t.moved&&Math.hypot(n,r)<Z$)return;t.moved=!0;let i=e1();i&&p(G$(t.ox+n,t.oy+r,i,y.current))}function w(e){let t=_.current;_.current=void 0,t?.moved&&(v.current=!0,x(t.ox+e.clientX-t.sx,t.oy+e.clientY-t.sy),p(void 0))}function T(e){let t=e.shiftKey?64:Q$,n={ArrowLeft:[-t,0],ArrowRight:[t,0],ArrowUp:[0,-t],ArrowDown:[0,t]}[e.key];if(!n||e.altKey||e.ctrlKey||e.metaKey)return;e.preventDefault();let r=e.currentTarget.getBoundingClientRect();y.current=r.width,x(r.left+n[0],r.top+n[1])}let E=!e&&n.length>0,D=e?UV(e):E?V$(n):void 0,O=n.length===1&&!n[0].includes(`background`)?n[0]:void 0,k=e??(E?O:void 0),A=e?`${t.map(UV).join(`, `)} thinking. `:E?`${n.join(`, `)} at work. `:``,ee=b&&l?b.x-l.left<140:!1,j={"--orb":r,...b?{left:b.x,top:b.y,right:`auto`,bottom:`auto`}:{}};return(0,W.jsxs)(VO,{open:h&&!f,onOpenChange:g,children:[(0,W.jsx)(HO,{asChild:!0,children:(0,W.jsxs)(`button`,{ref:c,type:`button`,"aria-label":`Open Thinking`,"aria-description":`${A}Drag, or use the arrow keys, to move it.`,"aria-haspopup":`dialog`,"aria-expanded":i,"aria-keyshortcuts":o?`${o} Enter Space`:`Enter Space`,onClick:e=>{if(v.current){v.current=!1,e.preventDefault();return}s()},onPointerDown:S,onPointerMove:C,onPointerUp:w,onPointerCancel:()=>{_.current=void 0,p(void 0)},onKeyDown:T,style:j,"data-thinking":e?``:void 0,"data-busy":E?``:void 0,"data-dragging":f?``:void 0,"data-placed":b?``:void 0,"data-flip":ee||void 0,className:X(`thinking-bubble fixed z-20 touch-none rounded-full outline-none select-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,a&&`invisible`),children:[(0,W.jsx)(Au,{initial:!1,children:D?(0,W.jsx)(Yf.span,{className:`orb-label`,initial:{opacity:0,x:ee?-8:8,scale:.9},animate:{opacity:1,x:0,scale:1},exit:{opacity:0,x:ee?-8:8,scale:.9},transition:{type:`spring`,visualDuration:.3,bounce:.35},children:(0,W.jsx)(Au,{mode:`popLayout`,initial:!1,children:(0,W.jsx)(Yf.span,{className:`inline-flex items-center gap-1`,initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{type:`spring`,visualDuration:.28,bounce:.3},children:D},D)})},`label`):null}),(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`orb orb-float`,children:(0,W.jsx)(`span`,{className:`orb-icon`,children:(0,W.jsx)(BV,{source:k,strokeWidth:2.25,className:`size-3.5`})})})]})}),(0,W.jsxs)(UO,{side:`top`,children:[`Thinking `,o?(0,W.jsx)(XD,{chord:o}):null,(0,W.jsx)(`span`,{className:`text-background/70`,children:` · drag to move`})]})]})}),i1=/^\s*(?:#{1,6}\s+(.+?)\s*#*|\*\*([^*\n]{2,90}?):?\*\*:?|__([^_\n]{2,90}?):?__:?)\s*$/,a1=260,o1=200,s1=/^\s*(?:[-*+]\s|\d+[.)]\s|>|```|~~~|\|)/m;function c1(e){let t=[],n=[],r=!1;for(let i of e){if(/^\s*(```|~~~)/.test(i)&&(r=!r),!r&&!i.trim()){n.length&&t.push(n.join(`
103
- `).trim()),n=[];continue}n.push(i)}return n.length&&t.push(n.join(`
104
- `).trim()),t.filter(Boolean)}function l1(e){let t=e.split(/(?<=[.!?…])\s+(?=[A-Z"'“‘`(\[])/),n=[];for(let e of t){let t=n.at(-1);t!==void 0&&(t.split("`").length-1)%2==1?n[n.length-1]=`${t} ${e}`:n.push(e)}return n}function u1(e){if(e.length<=a1||s1.test(e))return[e];let t=[],n=``;for(let r of l1(e.replace(/\s*\n\s*/g,` `)))n&&n.length+r.length+1>o1?(t.push(n),n=r):n=n?`${n} ${r}`:r;return n&&t.push(n),t}function d1(e){let t=e.replace(/\r\n?/g,`
105
- `).trim().split(`
106
- `),n=[{lines:[]}],r=!1;for(let e of t){/^\s*(```|~~~)/.test(e)&&(r=!r);let t=r?null:i1.exec(e),i=t?(t[1]??t[2]??t[3])?.trim():void 0;i?n.push({title:i,lines:[]}):n.at(-1).lines.push(e)}let i=[];for(let e of n){let t=c1(e.lines);if(e.title)i.push({title:e.title,text:t.join(`
107
-
108
- `)});else for(let e of t)for(let t of u1(e))i.push({text:t})}return i}var f1=4,p1=1800,m1=e=>({"--orb":e});function h1(e){let[t,n]=(0,m.useState)(0),r=e.join(`|`);return(0,m.useEffect)(()=>{if(n(0),e.length<2)return;let t=window.setInterval(()=>n(e=>e+1),p1);return()=>window.clearInterval(t)},[r,e.length]),e.length?e[t%e.length]:void 0}function g1({thought:e}){let t=(0,m.useMemo)(()=>d1(e.text),[e.text]),[n,r]=(0,m.useState)(!1),i=n?0:Math.max(0,t.length-f1),a=t.slice(i),o=UV(e.source);return(0,W.jsxs)(`li`,{className:`thought`,style:m1(KV(e.source)),"data-live":e.live||void 0,"aria-label":`${o}${e.live?`, thinking`:``}`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsxs)(`span`,{className:`thought-label`,children:[(0,W.jsx)(BV,{source:e.source,strokeWidth:2.25,className:`size-3.5`}),o]}),(0,W.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.live?(0,W.jsxs)(`span`,{className:`thought-live`,children:[`thinking`,(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`thought-ellipsis`})]}):Pk(Date.now()-e.at)}),t.length>1?(0,W.jsxs)(`span`,{className:`ml-auto text-xs text-muted-foreground tabular-nums`,children:[t.length,` steps`]}):null]}),i?(0,W.jsxs)(`button`,{type:`button`,"data-compact":!0,className:`thought-more`,onClick:()=>r(!0),children:[i,` earlier `,i===1?`step`:`steps`]}):null,(0,W.jsx)(`ol`,{className:`thought-steps`,"data-single":a.length===1||void 0,children:a.map((t,n)=>(0,W.jsxs)(`li`,{"data-current":e.live&&n===a.length-1||void 0,children:[t.title?(0,W.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:t.title}):null,t.text?(0,W.jsx)(eB,{text:t.text,className:`thought-text`}):null]},i+n))})]})}function _1(e,t,n){(0,m.useEffect)(()=>{if(!e||!t)return;let r=e=>{e.defaultPrevented||e.isComposing||!aX(e,t)||e.target?.closest(`input, textarea, [contenteditable='true']`)||(e.preventDefault(),n())};return window.addEventListener(`keydown`,r),()=>window.removeEventListener(`keydown`,r)},[e,t,n])}function v1(e){return[...e].sort((e,t)=>Number(t.live)-Number(e.live)||t.at-e.at||t.id-e.id)}function y1({thoughts:e,collapsed:t,onToggle:n,shortcut:r,busy:i=[]}){let a=v1(YV(e)),o=a.filter(e=>e.live).map(e=>e.source),s=h1(o),c=s?KV(s):i.length?`var(--primary)`:`var(--orb-idle)`,l=s?`thinking`:i.length?`busy`:void 0,u=(0,m.useRef)(null),d=(0,m.useRef)(null),f=(0,m.useRef)(t);f.current=t,(0,m.useEffect)(()=>()=>{f.current||n()},[n]);let p=oO(!t,aO.sheet),h=cO();_1(p,r,n);let g=a.length>0||i.length>0;return(0,W.jsxs)(W.Fragment,{children:[g&&(0,gy.createPortal)((0,W.jsx)(r1,{ref:u,spotlight:s,thinking:o,busy:i,tone:c,expanded:!t,hidden:h,shortcut:r,onOpen:n}),document.body),(0,W.jsxs)(QD,{open:p,onOpenChange:e=>{!e&&!t&&n()},label:`Thinking`,className:X(`thought-pane max-w-xl`,l&&`thought-pane-live`),style:m1(c),onCloseAutoFocus:e=>{e.preventDefault(),requestAnimationFrame(()=>{document.querySelector(`[role='dialog']`)||u.current?.focus()})},children:[(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`thought-aura`,"data-working":l}),(0,W.jsx)(`div`,{ref:d,className:`relative min-h-0 overflow-y-auto p-4 outline-none`,role:`log`,"aria-label":`Latest thoughts`,tabIndex:0,children:a.length?(0,W.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:a.map(e=>(0,W.jsx)(g1,{thought:e},e.id))}):(0,W.jsx)(`p`,{className:`px-2 py-6 text-center text-sm text-muted-foreground`,children:`Thoughts from the oracle and every agent appear here, and only here.`})}),(0,W.jsx)(Gv,{target:d})]})]})}function b1({status:e,lobby:t}){let[n,r]=_H(`lobby.thinking`),i=zO(`sessions.list`,{},[`sessions`]);if(!e||e.panels?.thinking===!1)return null;let a=B$({oracleBusy:e.busy,runs:JV(t),activity:t?.activity??[],background:i.data?.background??[]}),o=e.keys.find(e=>e.action===`thinking`)?.label;return(0,W.jsx)(y1,{thoughts:t?.thoughts??[],collapsed:n,onToggle:r,shortcut:o,busy:a})}var x1=/​/g;function S1(e){let t=[],n=e=>{if(e.nodeType===Node.TEXT_NODE)return(e.textContent??``).replace(x1,``);if(!(e instanceof HTMLElement))return``;let t=[...e.childNodes].map(n).join(``),i=e.tagName;return i===`BR`?`
109
- `:t.trim()?i===`B`||i===`STRONG`?`**${t}**`:i===`I`||i===`EM`?`_${t}_`:i===`CODE`?`\`${t}\``:i===`UL`||i===`OL`?`\n${r(e)}\n`:i===`DIV`||i===`P`||i===`LI`?`\n${t}\n`:t:t},r=e=>[...e.children].filter(e=>e.tagName===`LI`).map((t,r)=>`${e.tagName===`OL`?`${r+1}.`:`-`} ${[...t.childNodes].map(n).join(``).trim()}`).join(`
110
- `);return t.push([...e.childNodes].map(n).join(``)),t.join(``).replace(/\n{3,}/g,`
111
-
112
- `).trim()}function C1(e){let t=window.getSelection();if(!t||t.rangeCount===0||!t.isCollapsed)return!1;let n=document.createRange();return n.selectNodeContents(e),n.setEnd(t.getRangeAt(0).startContainer,t.getRangeAt(0).startOffset),n.toString().replace(x1,``)===``}function w1(e){let t=window.getSelection()?.anchorNode,n=t instanceof HTMLElement?t:t?.parentElement;return!!(n?.closest(`li`)&&e.contains(n))}function T1(e){return e.replace(/[&<>"]/g,e=>({"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`})[e]??e)}function E1(e){if(e!==`code`){document.execCommand(e);return}let t=window.getSelection()?.toString()??``;document.execCommand(`insertHTML`,!1,t?`<code>${T1(t)}</code>`:`<code>​</code>`)}var D1=[{format:`bold`,label:`Bold`,keys:`Ctrl+B`,icon:Up},{format:`italic`,label:`Italic`,keys:`Ctrl+I`,icon:lh},{format:`code`,label:`Code`,keys:`Ctrl+E`,icon:Dm},{format:`insertUnorderedList`,label:`Bulleted list`,icon:xh},{format:`insertOrderedList`,label:`Numbered list`,icon:yh}],O1=(0,m.forwardRef)(function({html:e,placeholder:t,label:n,landed:r,onChange:i,onFocusChange:a,onSubmit:o,onUp:s},c){let l=(0,m.useRef)(null),[u,d]=(0,m.useState)(!1),[f,p]=(0,m.useState)(!e),[h,g]=(0,m.useState)({});(0,m.useImperativeHandle)(c,()=>({element:l.current}),[]),(0,m.useEffect)(()=>{let t=l.current;t&&(e===``&&t.innerHTML!==``?(t.innerHTML=``,p(!0)):e&&t.innerHTML===``&&(t.innerHTML=e,p(!1)))},[e]);let _=(0,m.useCallback)(()=>{let e=l.current;if(!e)return;let t=S1(e);p(t===``&&!e.querySelector(`li`)),i(t,t?e.innerHTML:``)},[i]);(0,m.useEffect)(()=>{if(!u)return;let e=()=>g(Object.fromEntries(D1.filter(e=>e.format!==`code`).map(e=>[e.format,document.queryCommandState(e.format)])));return document.addEventListener(`selectionchange`,e),e(),()=>document.removeEventListener(`selectionchange`,e)},[u]);function v(e){l.current?.focus(),E1(e),_()}function y(e){let t=l.current;if(!t)return;let n=e.ctrlKey||e.metaKey;if(n&&!e.altKey&&[`b`,`i`,`e`].includes(e.key.toLowerCase())){e.preventDefault(),e.stopPropagation(),v(e.key.toLowerCase()===`b`?`bold`:e.key.toLowerCase()===`i`?`italic`:`code`);return}if(e.key===`Enter`&&!e.shiftKey&&!n&&!e.nativeEvent.isComposing){if(w1(t))return;e.preventDefault(),o();return}e.key===`ArrowUp`&&C1(t)&&(e.preventDefault(),s())}return(0,W.jsxs)(`div`,{"data-own":``,"data-open":u||!f||void 0,"data-landed":r||void 0,className:`q-own group/own relative flex w-full min-w-0 flex-col overflow-hidden border`,children:[(0,W.jsx)(`div`,{ref:l,role:`textbox`,"aria-multiline":`true`,"aria-label":n,"aria-placeholder":t,contentEditable:!0,suppressContentEditableWarning:!0,"data-nav":``,"data-empty":f||void 0,"data-placeholder":t,tabIndex:0,onInput:_,onKeyDown:y,onPaste:e=>{e.preventDefault(),document.execCommand(`insertText`,!1,e.clipboardData.getData(`text/plain`))},onFocus:()=>{d(!0),a(!0)},onBlur:()=>{d(!1),a(!1)},className:`q-own-text min-h-9 w-full min-w-0 px-4 py-2 text-sm break-words outline-none [&_code]:rounded [&_code]:bg-muted [&_code]:px-1 [&_code]:font-mono [&_code]:text-[0.8125rem] [&_ol]:list-decimal [&_ol]:ps-5 [&_ul]:list-disc [&_ul]:ps-5`}),(0,W.jsxs)(`div`,{role:`toolbar`,"aria-label":`Formatting`,"aria-hidden":!u,className:X(`q-own-bar flex items-center gap-0.5 px-2 pb-1.5`,!u&&`pointer-events-none`),children:[D1.map(({format:e,label:t,keys:n,icon:r})=>(0,W.jsx)(`button`,{type:`button`,tabIndex:-1,"aria-label":t,"aria-pressed":h[e]??!1,title:n?`${t} · ${n}`:t,onMouseDown:e=>e.preventDefault(),onClick:()=>v(e),className:`inline-flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground aria-pressed:bg-primary/12 aria-pressed:text-primary`,children:(0,W.jsx)(r,{"aria-hidden":`true`,className:`size-3.5`})},e)),(0,W.jsx)(`span`,{className:`ms-auto pe-1 text-2xs text-muted-foreground`,children:`Enter answers · Shift+Enter new line`})]})]})});function k1(e){return e?e.options.some(iq)?`xl`:e.question.length+e.options.reduce((e,t)=>e+t.label.length+(t.description?.length??0),0)>700||e.options.length>6?`lg`:`md`:`md`}var A1=/\s*\(recommended\)\s*$/i,j1=1200,M1=`Type something.`;function N1(e){return{text:e.replace(A1,``),recommended:A1.test(e)}}function P1({label:e}){let{text:t,recommended:n}=N1(e);return(0,W.jsxs)(`span`,{className:`leading-snug break-words`,children:[t,n?(0,W.jsx)(`span`,{className:`ms-1 font-medium text-primary`,children:`(Recommended)`}):null]})}function F1({multi:e,on:t}){return(0,W.jsxs)(`span`,{"aria-hidden":`true`,className:X(`relative mt-0.5 flex size-4 shrink-0 items-center justify-center border`,e?`rounded-lg`:`rounded-full`,t?`border-primary bg-primary text-primary-foreground`:`border-input`),children:[t?(0,W.jsx)(Zp,{className:X(e?`size-3`:`hidden`)}):null,t&&!e?(0,W.jsx)(`span`,{className:`size-2 rounded-full bg-primary-foreground`}):null]})}function I1({option:e,index:t,multi:n,name:r,selected:i,onToggle:a,onFocusOption:o}){return(0,W.jsxs)(`div`,{className:`grid gap-1`,children:[(0,W.jsxs)(`label`,{className:X(`flex min-h-9 cursor-pointer items-start gap-2.5 rounded-lg border px-3 py-2 text-start text-sm transition-[background-color,border-color,transform] duration-150 ease-snap active:scale-[0.99]`,i?`border-primary/50 bg-accent`:`border-input bg-background hover:bg-accent/60`,`has-[:focus-visible]:border-ring has-[:focus-visible]:ring-3 has-[:focus-visible]:ring-ring/30`),children:[(0,W.jsx)(`input`,{type:n?`checkbox`:`radio`,name:r,"data-nav":``,"data-option":t,className:`sr-only`,checked:i,onChange:a,onFocus:o}),(0,W.jsx)(F1,{multi:n,on:i}),(0,W.jsx)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:(0,W.jsxs)(`span`,{className:`flex gap-1.5`,children:[(0,W.jsxs)(`span`,{"aria-hidden":`true`,className:`text-muted-foreground tabular-nums`,children:[t+1,`.`]}),(0,W.jsx)(P1,{label:e.label})]})})]}),e.description?(0,W.jsx)(eB,{text:e.description,className:`px-3 text-muted-foreground`}):null]})}function L1({option:e,onExpand:t}){return!e||!iq(e)?null:(0,W.jsxs)(`div`,{className:`card-flat flex min-w-0 max-w-full flex-col gap-2 rounded-lg border p-3`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,W.jsxs)(`p`,{className:`min-w-0 truncate text-xs font-medium text-muted-foreground`,children:[`Preview · `,N1(e.label).text]}),(0,W.jsxs)(Z,{type:`button`,variant:`ghost`,size:`xs`,onClick:t,"aria-keyshortcuts":`E`,title:`Expand · E`,className:`-my-1 shrink-0`,children:[(0,W.jsx)(Th,{"aria-hidden":`true`}),`Expand`]})]}),e.image?(0,W.jsx)(`img`,{src:L(e.image),alt:``,loading:`lazy`,className:`max-h-64 w-full rounded-lg border object-contain`}):null,e.htmlPreview?(0,W.jsx)(eq,{preview:e.htmlPreview,label:N1(e.label).text,frameWidth:j1,onOpen:t,className:`h-auto aspect-[3/2]`}):null,e.preview?(0,W.jsx)(eB,{text:e.preview,className:`text-xs`}):null]})}function R1({option:e,index:t,multi:n,name:r,selected:i,active:a,onToggle:o,onFocusOption:s}){let{text:c,recommended:l}=N1(e.label),u=l?`${c} (Recommended)`:c;return(0,W.jsxs)(`label`,{"data-active":a||void 0,"data-picked":i||void 0,className:`q-dot group relative flex h-11 w-full shrink-0 cursor-pointer items-center justify-center outline-none`,children:[(0,W.jsx)(`input`,{type:n?`checkbox`:`radio`,name:r,"data-nav":``,"data-option":t,"aria-label":u,className:`sr-only`,checked:i,onChange:o,onFocus:s}),(0,W.jsx)(`span`,{"aria-hidden":`true`,className:X(`q-dot-mark relative z-10 flex size-5 items-center justify-center rounded-full text-[0.625rem] font-semibold tabular-nums transition-[background-color,color,scale] duration-200 ease-snap group-hover:scale-110`,l&&`q-dot-star`),children:t+1}),(0,W.jsxs)(`span`,{"aria-hidden":`true`,className:`q-dot-tag pointer-events-none absolute top-1/2 left-[calc(100%+0.5rem)] z-30 -translate-y-1/2 rounded-full px-2.5 py-1 text-xs font-medium whitespace-nowrap opacity-0 transition-[opacity,translate] duration-150 ease-snap group-hover:opacity-100 group-has-[:focus-visible]:opacity-100 group-data-[active]:!opacity-0`,children:[t+1,`. `,u]})]})}var z1={type:`spring`,visualDuration:.2,bounce:.12},B1={type:`spring`,visualDuration:.2,bounce:.04,delay:.06},V1={type:`spring`,visualDuration:.28,bounce:.55},H1={type:`spring`,visualDuration:.2,bounce:0},U1={type:`spring`,stiffness:900,damping:18,velocity:50,restDelta:.02,restSpeed:1},W1=-1;function G1(e,t,n,r,i,a){let o=(0,m.useRef)(null),s=(0,m.useRef)(null),c=(0,m.useRef)(null),l=(0,m.useRef)(null),u=(0,m.useRef)(void 0),d=(0,m.useRef)([]),f=(0,m.useRef)(a);f.current=a;let p=(0,m.useCallback)(t=>{if(t===W1){let t=n.current?.element,r=e.current;return t&&r?t.getBoundingClientRect().top-r.getBoundingClientRect().top+6:void 0}let r=e.current?.querySelectorAll(`.q-dot`)[t];return r?r.offsetTop+r.offsetHeight/2:void 0},[e,n]),h=(0,m.useCallback)(()=>{let t=o.current,n=e.current?.querySelectorAll(`.q-dot`);if(!t||!n||n.length===0)return;let r=n[0],i=n[n.length-1],a=r.offsetTop+r.offsetHeight/2;t.style.top=`${a}px`,t.style.height=`${Math.max(0,i.offsetTop+i.offsetHeight/2-a)}px`},[e]),g=(0,m.useCallback)((e,t=1,n=1)=>{let r=s.current,i=c.current;if(r&&i){if(e===void 0){r.style.opacity=`0`,i.style.opacity=`0`;return}r.style.opacity=String(Math.min(1,t*3)),r.style.transform=`translate(-50%, ${e}px) translateY(-50%) scale(${Math.max(0,t)})`,i.style.opacity=n>.02?`1`:`0`,i.style.transform=`translateY(${e}px) scaleX(${Math.max(0,Math.min(1,n))})`}},[]),_=(0,m.useRef)(i);return(0,m.useLayoutEffect)(()=>{_.current!==i&&(_.current=i,u.current=void 0),h();for(let e of d.current)e.stop();d.current=[],t.current&&(t.current.style.translate=``);let e=u.current;u.current=r;let n=p(r),a=e===void 0?void 0:p(e),o=typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,s=l.current;if(s&&(s.style.opacity=`0`),n===void 0||a===void 0||e===r||o||!s){g(r===W1?void 0:n),r===W1&&e!==r&&e!==void 0&&f.current();return}let c=n>a?1:-1,m={head:0,tail:0},v=!1,y=(e,t,n,r)=>{let i=Jf(e,t,{...n,onUpdate:r});return d.current.push(i),i},b=()=>{let e=a+(n-a)*m.head,t=a+(n-a)*m.tail;s.style.opacity=Math.abs(e-t)>1?`1`:`0`,s.style.transform=`translateY(${Math.min(e,t)}px)`,s.style.height=`${Math.abs(e-t)}px`},x=()=>{if(v)return;if(v=!0,r===W1){g(void 0),f.current();return}let e={open:0,reach:0},i=()=>p(r)??n;y(0,1,V1,t=>{e.open=t,g(i(),e.open,e.reach)}),y(0,1,{...H1,delay:.05},t=>{e.reach=t,g(i(),e.open,e.reach)});let a=t.current;a&&y(0,0,{...U1,delay:.1},e=>{a.style.translate=Math.abs(e)>.01?`0 ${(c*e).toFixed(2)}px`:``})};return y(1,0,{type:`spring`,visualDuration:.12,bounce:0},t=>{v||g(e===W1?void 0:a,t,t)}),y(0,1,z1,e=>{m.head=e,b(),e>.85&&x()}),y(0,1,B1,e=>{m.tail=e,b()}),()=>{for(let e of d.current)e.stop()}},[r,i,p,t,g,h]),(0,m.useEffect)(()=>{let r=e.current;if(!r||typeof ResizeObserver>`u`)return;let i=0,a=()=>{i=0,h(),d.current.some(e=>e.state===`running`)||g(u.current===W1?void 0:p(u.current??0))},o=new ResizeObserver(()=>{i||=requestAnimationFrame(a)});o.observe(r),t.current&&o.observe(t.current);let s=n.current?.element;return s&&o.observe(s),()=>{cancelAnimationFrame(i),o.disconnect()}},[e,t,n,p,g,h]),{track:o,ring:s,line:c,drop:l}}function K1({option:e,position:t,count:n,chosen:r,onExpand:i,panel:a,dim:o}){if(!e)return null;let{text:s,recommended:c}=N1(e.label),l=iq(e);return(0,W.jsx)(`div`,{ref:a,"data-dim":o||void 0,"data-chosen":r||void 0,className:`q-panel min-w-0 rounded-2xl p-4 transition-opacity duration-300 data-[dim]:opacity-55`,children:(0,W.jsxs)(`div`,{"aria-live":`polite`,className:X(`q-panel-body grid min-w-0 gap-4`,l?`grid-cols-[minmax(0,1fr)_minmax(0,1.25fr)]`:``),children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2.5 py-0.5`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2.5`,children:[(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`q-panel-number mt-px flex size-6 shrink-0 items-center justify-center rounded-md text-xs font-semibold tabular-nums`,children:t+1}),(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,W.jsxs)(`p`,{className:`text-2xs font-medium tracking-wide text-muted-foreground uppercase`,children:[`Option `,t+1,` of `,n]}),(0,W.jsxs)(`p`,{className:`text-base font-semibold break-words`,children:[s,c?(0,W.jsx)(`span`,{className:`q-recommended ms-2 inline-flex translate-y-[-1px] items-center rounded-md px-1.5 py-0.5 align-middle text-2xs font-medium`,children:`Recommended`}):null]})]}),r?(0,W.jsxs)(`span`,{className:`q-chosen inline-flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium`,children:[(0,W.jsx)(Zp,{"aria-hidden":`true`,className:`size-3.5`}),`Chosen`]}):null]}),e.description?(0,W.jsx)(eB,{text:e.description,className:`q-panel-text min-w-0 text-sm leading-relaxed`}):(0,W.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`No further detail.`})]}),l?(0,W.jsx)(L1,{option:e,onExpand:i}):null]},t)})}function q1({primary:e,primaryLabel:t,disabled:n,submitting:r,onCancel:i,intent:a}){return(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,W.jsx)(Z,{type:`button`,variant:`ghost`,onClick:i,children:`Cancel`}),a?(0,W.jsx)(`p`,{role:`status`,"aria-live":`polite`,"data-empty":a.empty||void 0,className:`q-intent flex min-w-0 flex-1 items-center justify-end gap-1.5 text-sm`,children:(0,W.jsxs)(`span`,{className:`q-intent-text flex min-w-0 items-center gap-1.5`,children:[(0,W.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:a.lead}),a.empty?null:(0,W.jsx)(`span`,{className:`truncate font-medium`,children:a.text})]},`${a.lead}${a.text}`)}):null,(0,W.jsx)(Z,{type:e,disabled:n||r,children:r?`Sending…`:t})]})}function J1(e){if(!e?.answer)return{lead:`Nothing chosen yet`,text:``,empty:!0};if(e.kind===`custom`){let t=e.answer.replace(/[*_`#>]/g,``).replace(/\s+/g,` `).trim();return{lead:`You answer:`,text:`“${t.length>80?`${t.slice(0,79)}…`:t}”`}}return{lead:`You choose:`,text:(e.selected??[e.answer]).map(e=>N1(e).text).join(`, `)}}function Y1(e,t,n,r){let i=e[r];if(!i)return;let a=n[r]?.trim();if(a)return{questionIndex:r,question:i.question,kind:`custom`,answer:a};let o=(t[r]??[]).map(e=>i.options[e]?.label).filter(e=>!!e);if(o.length!==0)return i.multiSelect?{questionIndex:r,question:i.question,kind:`multi`,answer:o.join(`, `),selected:o}:{questionIndex:r,question:i.question,kind:`option`,answer:o[0]??null}}function X1({questions:e,picks:t,own:n,index:r,onGo:i}){return e.length===1?(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e[0]?.header}):(0,W.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:e.map((e,a)=>{let o=!!n[a]?.trim()||(t[a]?.length??0)>0;return(0,W.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-description":`When focused, press Enter or Space to open this question.`,type:`button`,onClick:()=>i(a),"aria-current":a===r,className:X(`inline-flex min-h-8 min-w-0 items-center gap-1 rounded-lg border px-3 text-xs font-medium transition-colors`,a===r?`border-primary bg-primary/10 text-primary`:`border-border text-muted-foreground hover:bg-muted`),children:[(0,W.jsxs)(`span`,{className:`min-w-0 break-words text-start`,children:[a+1,` `,e.header]}),o?(0,W.jsx)(Zp,{className:`size-3 shrink-0`,"aria-hidden":`true`}):null]},a)})})}function Z1({questions:e,submitting:t,onAnswer:n,onCancel:r,expanded:i,onExpand:a,onSize:o}){let[s,c]=(0,m.useState)(0),[l,u]=(0,m.useState)(!1),d=i??l,f=e=>a?a(e):u(e),[p,h]=(0,m.useState)(0),g=(0,m.useRef)(0),_=(0,m.useRef)(!1),[v,y]=(0,m.useState)({}),[b,x]=(0,m.useState)({}),[S,C]=(0,m.useState)({}),[w,T]=(0,m.useState)(!1),[E,D]=(0,m.useState)(!1),O=(0,m.useRef)(null),[k,A]=(0,m.useState)({}),ee=(0,m.useRef)(null),j=(0,m.useRef)(null),M=(0,m.useRef)(null),N=e[s],P=v[s]??[],F=b[s]??``,te=N?.options[k[s]??P[0]??0],ne=Y1(e,v,b,s),re=N?.multiSelect===!0,ie=Math.max(0,N?.options.indexOf(te)??0),ae=w||F.trim()!==``,oe=ae?W1:ie,se=G1(j,M,O,oe,`${s}:${d}`,()=>D(!0));if((0,m.useEffect)(()=>{if(!E)return;let e=window.setTimeout(()=>D(!1),700);return()=>window.clearTimeout(e)},[E]),(0,m.useEffect)(()=>o?.(k1(N)),[N,o]),(0,m.useEffect)(()=>{let e=ee.current;e&&(e.querySelector(`[data-option="${v[s]?.[0]??0}"]`)??e.querySelector(`[data-nav]`))?.focus()},[s]),(0,m.useEffect)(()=>{let e=_.current&&!d;_.current=d,e&&(A(e=>({...e,[s]:g.current})),ee.current?.querySelector(`[data-option="${g.current}"]`)?.focus())},[d]),!N)return null;let ce=N.options.some(iq);function I(e){h(Math.max(0,e)),g.current=Math.max(0,e),f(!0)}function le(e){g.current=e,f(!1)}if(d&&ce)return(0,W.jsx)(oq,{options:N.options,start:p,title:N.header||N.question,picked:P,multi:re,onChoose:e=>{ue(e),re||le(e)},onClose:le,onIndex:e=>{g.current=e}},s);function ue(e){let t=re?P.includes(e)?P.filter(t=>t!==e):[...P,e]:[e];y({...v,[s]:t}),re||(x({...b,[s]:``}),C({...S,[s]:``})),A({...k,[s]:e})}function de(e){let t=e instanceof HTMLInputElement&&e.dataset.option!==void 0?Number(e.dataset.option):-1;t>=0&&!re&&ue(t)}function L(t,r){if(Y1(e,t,r,s)){if(s<e.length-1){c(s+1);return}n({answers:e.map((n,i)=>Y1(e,t,r,i)).filter(e=>!!e),cancelled:!1})}}function R(e){e.preventDefault(),t||L(v,b)}function fe(t){t>=0&&t<e.length&&c(t)}function pe(e){let n=e.target,r=ee.current;if(!r||e.altKey)return;if(e.key===`Enter`&&(e.ctrlKey||e.metaKey)){e.preventDefault(),t||L(v,b);return}if(KO(n))return;let i=qO(e.key);if(i||e.key===`Home`||e.key===`End`){e.preventDefault(),GO(r,n,i||(e.key===`Home`?`first`:`last`)),de(document.activeElement);return}let a=JO(e.key);if(a&&!(n instanceof HTMLButtonElement)){e.preventDefault(),fe(s+a);return}let o=n instanceof HTMLInputElement&&n.dataset.option!==void 0?Number(n.dataset.option):-1;if(e.key===`Enter`&&o>=0){if(e.preventDefault(),re)P.length>0&&P.includes(o)?L(v,b):ue(o);else{let e={...v,[s]:[o]},t={...b,[s]:``};y(e),x(t),C({...S,[s]:``}),L(e,t)}return}if(e.key===` `&&o>=0){e.preventDefault(),ue(o);return}let c=Number(e.key);if(Number.isInteger(c)&&c>=1&&c<=N.options.length){e.preventDefault(),ue(c-1),r.querySelector(`[data-option="${c-1}"]`)?.focus();return}e.key.toLowerCase()===`e`&&ce&&!e.ctrlKey&&!e.metaKey&&(e.preventDefault(),I(o>=0?o:k[s]??P[0]??0))}return(0,W.jsxs)(`form`,{ref:ee,className:`flex min-w-0 flex-col gap-3`,onSubmit:R,onKeyDown:pe,children:[(0,W.jsx)(X1,{questions:e,picks:v,own:b,index:s,onGo:c}),(0,W.jsxs)(`div`,{className:`text-center`,children:[(0,W.jsx)(`p`,{className:`text-2xs font-medium tracking-wide text-muted-foreground uppercase`,children:e.length>1?`Question ${s+1} of ${e.length}`:`Question`}),(0,W.jsx)(eB,{text:N.question,className:`mt-1 text-base font-medium`})]}),(0,W.jsxs)(`div`,{className:`relative grid min-w-0 grid-cols-[2.25rem_minmax(0,1fr)] gap-x-3`,children:[(0,W.jsxs)(`div`,{ref:j,role:re?`group`:`radiogroup`,"aria-label":`Options`,className:`q-rail relative flex min-w-0 flex-col justify-evenly py-2`,children:[(0,W.jsx)(`span`,{ref:se.track,"aria-hidden":`true`,className:`q-rail-line pointer-events-none absolute top-0 left-1/2 h-0 -translate-x-1/2`}),(0,W.jsx)(`span`,{ref:se.drop,"aria-hidden":`true`,className:`q-drop pointer-events-none absolute top-0 left-1/2 w-[3px] -translate-x-1/2 rounded-full opacity-0`}),(0,W.jsx)(`span`,{ref:se.ring,"aria-hidden":`true`,className:`q-ring pointer-events-none absolute top-0 left-1/2 z-20 size-7 rounded-full opacity-0`}),(0,W.jsx)(`span`,{ref:se.line,"aria-hidden":`true`,className:`q-line pointer-events-none absolute top-0 left-[calc(50%+0.875rem)] z-10 h-px w-[calc(50%-0.875rem+0.75rem)] origin-left opacity-0`}),N.options.map((e,t)=>(0,W.jsx)(R1,{option:e,index:t,multi:re,name:`question-${s}`,selected:P.includes(t),active:oe===t,onToggle:()=>ue(t),onFocusOption:()=>A({...k,[s]:t})},t))]}),(0,W.jsx)(K1,{panel:M,option:te,position:ie,count:N.options.length,chosen:!ae&&P.includes(ie),dim:ae,onExpand:()=>I(ie)})]}),(0,W.jsx)(`div`,{className:`q-own-wrap mx-auto w-full`,children:(0,W.jsx)(O1,{ref:O,html:S[s]??``,placeholder:`Type something else…`,label:`Your own answer`,landed:E,onChange:(e,t)=>{x(t=>({...t,[s]:e})),C(e=>({...e,[s]:t})),e&&y(e=>({...e,[s]:[]}))},onFocusChange:T,onSubmit:()=>{t||L(v,b)},onUp:()=>{let e=ee.current;e&&GO(e,O.current?.element??null,-1)}},s)}),(0,W.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs text-muted-foreground`,children:[(0,W.jsx)(`span`,{children:re?`Pick several`:`Pick one`}),(0,W.jsx)(ZD,{chord:`↑↓`,children:`move`}),(0,W.jsx)(ZD,{chord:re?`Space`:`Enter`,children:re?`pick`:`choose`}),re?(0,W.jsx)(ZD,{chord:`Enter`,children:`next`}):null,e.length>1?(0,W.jsx)(ZD,{chord:`←→`,children:`question`}):null,ce?(0,W.jsx)(ZD,{chord:`E`,children:`expand mockups`}):null,(0,W.jsx)(ZD,{chord:`Esc`,children:`later`})]}),(0,W.jsx)(q1,{primary:`submit`,primaryLabel:s<e.length-1?`Next`:`Answer`,disabled:!ne,submitting:t,onCancel:r,intent:J1(ne)})]})}function Q1(e,t,n){let r=e.currentTarget,i=e.target;if(e.altKey||KO(i))return;let a=qO(e.key);if(a){e.preventDefault(),GO(r,i,a);return}let o=i instanceof HTMLInputElement&&i.dataset.option!==void 0?Number(i.dataset.option):-1;if((e.key===`Enter`||e.key===` `)&&o>=0){e.preventDefault(),n(o,e.key===`Enter`);return}let s=Number(e.key);Number.isInteger(s)&&s>=1&&s<=t&&(e.preventDefault(),n(s-1,!1),r.querySelector(`[data-option="${s-1}"]`)?.focus())}function $1({view:e,submitting:t,onAnswer:n,onCancel:r}){let[i,a]=(0,m.useState)(``),o=(0,m.useRef)(null);return(0,m.useEffect)(()=>{o.current?.querySelector(`[data-nav]`)?.focus()},[]),(0,W.jsxs)(`form`,{ref:o,className:`flex min-w-0 flex-col gap-3`,onSubmit:e=>{e.preventDefault(),i&&n(i)},onKeyDown:r=>Q1(r,e.options.length,(r,i)=>{let o=e.options[r];o!==void 0&&(a(o),i&&!t&&n(o))}),children:[(0,W.jsx)(eB,{text:e.title,className:`text-base`}),(0,W.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.options.map((e,t)=>(0,W.jsx)(I1,{option:{label:e},index:t,multi:!1,name:`choice`,selected:i===e,onToggle:()=>a(e)},e))}),(0,W.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs text-muted-foreground`,children:[(0,W.jsx)(ZD,{chord:`↑↓`,children:`move`}),(0,W.jsx)(ZD,{chord:`Enter`,children:`choose`}),(0,W.jsx)(ZD,{chord:`Esc`,children:`later`})]}),(0,W.jsx)(q1,{primary:`submit`,primaryLabel:`Choose`,disabled:!i,submitting:t,onCancel:r})]})}function e0({view:e,submitting:t,onAnswer:n}){let r=(0,m.useRef)(null);(0,m.useEffect)(()=>r.current?.focus(),[]);function i(e){if(e.altKey||e.ctrlKey||e.metaKey||t)return;let r=e.key.toLowerCase();r===`y`?n(!0):r===`n`&&n(!1)}return(0,W.jsxs)(`div`,{ref:r,tabIndex:-1,"data-autofocus":``,onKeyDown:i,className:`flex min-w-0 flex-col gap-3 outline-none`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(eB,{text:e.question,className:`text-base`}),e.detail?(0,W.jsx)(eB,{text:e.detail,className:`mt-1 text-muted-foreground`}):null]}),(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,W.jsxs)(`p`,{className:`flex items-center gap-x-4 text-xs text-muted-foreground`,children:[(0,W.jsx)(ZD,{chord:`Y`,children:`yes`}),(0,W.jsx)(ZD,{chord:`N`,children:`no`}),(0,W.jsx)(ZD,{chord:`Esc`,children:`later`})]}),(0,W.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(Z,{type:`button`,variant:`outline`,disabled:t,onClick:()=>n(!1),children:`No`}),(0,W.jsx)(Z,{type:`button`,disabled:t,onClick:()=>n(!0),children:t?`Sending…`:`Yes`})]})]})]})}function t0({view:e,submitting:t,onAnswer:n,onCancel:r}){let[i,a]=(0,m.useState)(``);return(0,W.jsxs)(`form`,{className:`flex min-w-0 flex-col gap-3`,onSubmit:e=>{e.preventDefault(),i.trim()&&n(i.trim())},children:[(0,W.jsx)(eB,{text:e.question,className:`text-base`}),(0,W.jsx)(Ak,{autoFocus:!0,onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())},value:i,onChange:e=>a(e.target.value),placeholder:e.placeholder??M1,"aria-label":e.question,rows:3,className:`min-h-9 resize-none text-sm`}),(0,W.jsxs)(`p`,{className:`flex items-center gap-x-4 text-xs text-muted-foreground`,children:[(0,W.jsx)(ZD,{chord:`Enter`,children:`answer`}),(0,W.jsx)(ZD,{chord:`Shift+Enter`,children:`new line`}),(0,W.jsx)(ZD,{chord:`Esc`,children:`later`})]}),(0,W.jsx)(q1,{primary:`submit`,primaryLabel:`Answer`,disabled:!i.trim(),submitting:t,onCancel:r})]})}function n0({dialog:e,submitting:t,onAnswer:n}){let[r,i]=(0,m.useState)(e.method===`editor`?e.prefill??``:``),[a,o]=(0,m.useState)(``),s=e.options??[],c=e.method===`select`?a!==``:r.trim()!==``,l=(0,m.useRef)(null);(0,m.useEffect)(()=>{l.current?.querySelector(`[data-nav], textarea`)?.focus()},[]);function u(t){t.preventDefault(),e.method===`select`?n({value:a}):e.method===`confirm`?n({confirmed:!0}):(e.method===`input`||e.method===`editor`)&&n({value:r.trim()})}return(0,W.jsxs)(`form`,{ref:l,className:`flex min-w-0 flex-col gap-3`,onSubmit:u,onKeyDown:r=>{e.method===`select`&&Q1(r,s.length,(e,r)=>{let i=s[e];i!==void 0&&(o(i),r&&!t&&n({value:i}))})},children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.title}),e.message?(0,W.jsx)(eB,{text:e.message,className:`mt-1 text-base`}):null]}),e.method===`select`?(0,W.jsx)(`div`,{className:`flex flex-col gap-2`,children:s.map((e,t)=>(0,W.jsx)(I1,{option:{label:e},index:t,multi:!1,name:`dialog`,selected:a===e,onToggle:()=>o(e)},e))}):null,e.method===`input`||e.method===`editor`?(0,W.jsx)(Ak,{value:r,onChange:e=>i(e.target.value),placeholder:e.placeholder??M1,"aria-label":e.title,rows:e.method===`editor`?4:2,className:`min-h-9 resize-none text-sm`}):null,(0,W.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,W.jsx)(Z,{type:`button`,variant:`outline`,disabled:t,onClick:()=>n({cancelled:!0}),children:`Cancel`}),e.method===`confirm`?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Z,{type:`button`,variant:`outline`,disabled:t,onClick:()=>n({confirmed:!1}),children:`No`}),(0,W.jsx)(Z,{type:`button`,disabled:t,onClick:()=>n({confirmed:!0}),children:t?`Sending…`:`Yes`})]}):(0,W.jsx)(Z,{type:`submit`,disabled:!c||t,children:t?`Sending…`:`Answer`})]})]})}function r0(e){let{view:t}=e;return t.kind===`questionnaire`?(0,W.jsx)(Z1,{questions:t.questions,submitting:e.submitting,onAnswer:e.onAnswer,onCancel:e.onCancel,onSize:e.onSize,...e.onExpand?{expanded:e.expanded??!1,onExpand:e.onExpand}:{}}):t.kind===`choose`?(0,W.jsx)($1,{...e,view:t}):t.kind===`confirm`?(0,W.jsx)(e0,{...e,view:t}):t.kind===`text`?(0,W.jsx)(t0,{...e,view:t}):(0,W.jsx)(n0,{...e,dialog:t.dialog})}function i0(e){return typeof e==`object`&&e?e:{}}function a0(e){return typeof e==`string`?e.trim():``}function o0(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function s0(e){let t=i0(e),n=a0(t.label);if(!n)return;let r=a0(t.description),i=a0(t.preview),a=a0(t.image),o=YK(t.htmlPreview);return{label:n,...r?{description:r}:{},...i?{preview:i}:{},...a?{image:a}:{},...o?{htmlPreview:o}:{}}}function c0(e){let t=i0(e),n=a0(t.question);if(!n)return;let r=(Array.isArray(t.options)?t.options:[]).map(s0).filter(e=>!!e);return{question:n,header:a0(t.header)||`Question`,options:r,...t.multiSelect===!0?{multiSelect:!0}:{}}}function l0(e){let t=i0(e),n=a0(t.method);if(n!==`select`&&n!==`confirm`&&n!==`input`&&n!==`editor`)return;let r=a0(t.message),i=o0(t.options),a=a0(t.placeholder),o=a0(t.prefill);return{id:a0(t.id),method:n,title:a0(t.title)||`Answer`,...r?{message:r}:{},...i.length>0?{options:i}:{},...a?{placeholder:a}:{},...o?{prefill:o}:{}}}function u0(e){let t=(Array.isArray(e.questions)?e.questions:[]).map(c0).filter(e=>!!e);return t.length>0?{kind:`questionnaire`,questions:t}:void 0}function d0(e){return{kind:`choose`,title:a0(e.title)||`Choose an option`,options:o0(e.options)}}function f0(e){let t=a0(e.question)||a0(e.title)||`Continue?`,n=a0(e.detail)||a0(e.message);return{kind:`confirm`,question:t,...n?{detail:n}:{}}}function p0(e){let t=a0(e.question)||a0(e.title)||`Type an answer`,n=a0(e.placeholder);return{kind:`text`,question:t,...n?{placeholder:n}:{}}}function m0(e){let t=i0(e.payload);if(e.kind===`questionnaire`)return u0(t);if(e.kind===`choose`)return d0(t);if(e.kind===`confirm`)return f0(t);if(e.kind===`text`)return p0(t);let n=l0(t.dialog);return n?{kind:`sessionDialog`,dialog:n}:void 0}var h0={md:`max-w-3xl`,lg:`max-w-4xl max-h-[min(88svh,52rem)]`,xl:`max-w-5xl max-h-[min(90svh,58rem)]`};function g0({submitting:e,onKeep:t,onLeave:n}){return(0,W.jsxs)(`div`,{className:`flex flex-col gap-3`,role:`alert`,children:[(0,W.jsx)(`p`,{className:`text-sm`,children:`Leave without answering? The oracle will not guess for you.`}),(0,W.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,W.jsx)(Z,{type:`button`,variant:`outline`,onClick:t,children:`Keep answering`}),(0,W.jsx)(Z,{type:`button`,disabled:e,onClick:n,children:e?`Leaving…`:`Leave`})]})]})}function _0({count:e,onOpen:t}){return(0,W.jsxs)(Z,{type:`button`,variant:`soft`,onClick:t,"aria-label":`${e} question${e===1?``:`s`} waiting — open`,className:`gap-1.5 text-warning`,children:[(0,W.jsx)(hm,{"aria-hidden":`true`}),(0,W.jsx)(`span`,{className:`tabular-nums`,children:e}),(0,W.jsx)(`span`,{children:`waiting`})]})}function v0({prompts:e,answer:t,dismiss:n,minimized:r,onMinimize:i}){let[a,o]=(0,m.useState)(!1),[s,c]=(0,m.useState)(!1),[l,u]=(0,m.useState)(!1),d=(0,m.useRef)(null),[f,p]=(0,m.useState)(`md`),h=e.length,g=e[0],_=g?m0(g):void 0,v=h>0&&!r,y=oO(v,aO.question);(0,m.useEffect)(()=>{h===0&&(o(!1),i(!1))},[h,i]);let b=g?.id;(0,m.useEffect)(()=>u(!1),[b]);async function x(e,t){c(!0);try{await e,o(!1)}catch(e){e instanceof ye&&e.code===`question_withdrawn`?G(uO):G.error(e instanceof Error?e.message:t)}finally{c(!1)}}let S=g?.from?`${g.from} asks`:`A question`;return(0,W.jsx)(QD,{open:v&&y&&!!g,label:`Question from the lobby`,dismissOnBackdrop:!1,onOpenChange:e=>{e||(l?u(!1):a?o(!1):i(!0))},className:X(`transition-[max-width] duration-300 ease-snap`,l?`h-[min(92svh,60rem)] max-h-[min(92svh,60rem)] max-w-7xl`:h0[_?.kind===`questionnaire`?f:`md`]),children:g?(0,W.jsxs)(`section`,{"aria-label":`Question from the lobby`,className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,W.jsxs)(`header`,{className:X(`flex items-center gap-3 px-4 pt-4 pb-2`,l&&`hidden`),children:[(0,W.jsxs)(`p`,{className:`min-w-0 flex-1 truncate text-sm font-medium text-muted-foreground first-letter:uppercase`,children:[S,h>1?` · 1 of ${h}`:``]}),(0,W.jsx)(Z,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Later: put the question away`,title:`Later · Esc`,onClick:()=>i(!0),children:(0,W.jsx)(d_,{"aria-hidden":`true`})})]}),(0,W.jsx)(`div`,{ref:d,className:l?`flex min-h-0 min-w-0 flex-1 flex-col`:`min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain px-4 pb-4`,children:_?a?(0,W.jsx)(g0,{submitting:s,onKeep:()=>o(!1),onLeave:()=>void x(n(g.id),`Could not leave the question`)}):(0,W.jsx)(r0,{view:_,submitting:s,onAnswer:e=>void x(t(g.id,e),`Could not send the answer`),onCancel:()=>o(!0),expanded:l,onExpand:u,onSize:p},g.id):(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,W.jsx)(`p`,{className:` text-sm text-muted-foreground`,children:`This question cannot be shown here.`}),(0,W.jsx)(Z,{type:`button`,disabled:s,onClick:()=>void x(n(g.id),`Could not dismiss the question`),children:`Dismiss`})]})}),l?null:(0,W.jsx)(Gv,{target:d})]}):null})}var y0=2;function b0(e){let t=globalThis.EventSource;if(!t)throw Error(`EventSource is not available in this environment`);return new t(e)}function x0(e){try{return JSON.parse(e)}catch{return}}function S0(e,t){switch(e.type){case`hello`:t.onHello?.(e.versions);return;case`changed`:t.onChanged?.(e.topic,e.version);return;case`feed`:t.onFeed?.({activity:e.activity,thoughts:e.thoughts,chat:e.chat});return;case`reply`:t.onReply?.(e.text);return;case`notice`:t.onNotice?.(e.text,e.level)}}function C0(e,t=b0){let n=t(L(`/api/events`));return e.onConnection?.(`connecting`),n.onopen=()=>e.onConnection?.(`live`),n.onerror=()=>e.onConnection?.(n.readyState===y0?`offline`:`connecting`),n.onmessage=t=>{let n=x0(t.data);n&&S0(n,e)},()=>n.close()}var w0=2e3,T0=()=>z(`projects.list`,{});async function E0(){let e;try{e=de()}catch{return}if(e&&!_e(e))try{ge((await T0()).projects)}catch{}}function D0(){let e=(0,m.useRef)(void 0),t=(0,m.useRef)(void 0),n=(0,m.useCallback)(()=>{clearTimeout(t.current),e.current?.();try{de()}catch{I.onStatus({connection:`offline`});return}e.current=C0({onHello:e=>{I.onHello(e),E0()},onChanged:(e,t)=>I.onChanged(e,t),onFeed:e=>I.onFeedDelta(e),onReply:e=>I.onReplyDelta(e),onNotice:(e,t)=>G[t](e),onConnection:e=>{I.onStatus({connection:e}),e===`offline`&&(clearTimeout(t.current),t.current=setTimeout(()=>{ve(T0).catch(()=>!1).finally(n)},w0))}})},[]);return(0,m.useEffect)(()=>(n(),()=>{clearTimeout(t.current),e.current?.()}),[n]),n}var O0=`bot-lobby.recoveredAt`,k0;function A0(e,t=j0()){try{k0===void 0&&(k0=Number(t?.getItem(O0)??0))}catch{k0??=0}if(k0!==void 0&&e<=k0)return!1;k0=e;try{t?.setItem(O0,String(e))}catch{}return!0}function j0(){try{return globalThis.sessionStorage}catch{return}}function M0(e){let t=e?.recovered?.at,n=e?.recovered?.text;(0,m.useEffect)(()=>{t!==void 0&&n&&A0(t)&&G.success(n)},[t,n])}function N0(){let e=LO(`prompts`),t=(0,m.useCallback)(async(e,t)=>{await z(`prompts.answer`,{id:e,answer:t})},[]),n=(0,m.useCallback)(async e=>{await z(`prompts.dismiss`,{id:e})},[]);return{prompts:e.data?.prompts??[],loading:e.loading,error:e.error,answer:t,dismiss:n}}function P0(e,t,n,r,i){e===`search`?(document.querySelector(`#main input[type='search']`)??document.getElementById(`composer-text`))?.focus():e===`help`?n():e===`settings`?yO(`#/settings`):e===`thinking`?gH(`lobby.thinking`):e===`sidebar`?i():e===`terminal`?wQ():e===`code`?kz():e===`activity`?t.kind===`tab`&&t.tab===`lobby`?gH(yH):yO(vO(`lobby`)):e===`nextTab`?r(1):e===`prevTab`?r(-1):e===`savePlan`&&t.kind===`tab`&&t.tab===`plan`&&K(`planner.save`,{})}var F0=`toolbar-button inline-flex size-8 shrink-0 items-center justify-center rounded-lg border text-foreground transition-[background-color,border-color,scale] duration-150 ease-snap outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring active:scale-[0.97] motion-reduce:active:scale-100`,I0=`inline-flex size-8 shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-[background-color,color,scale] duration-150 ease-snap outline-none hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring active:scale-[0.97] aria-pressed:bg-accent aria-pressed:text-foreground motion-reduce:active:scale-100`,L0=2500;function R0(e){let[t,n]=(0,m.useState)(!1),r=(0,m.useRef)(!1);return e===`live`&&(r.current=!0),(0,m.useEffect)(()=>{if(e!==`connecting`||!r.current)return n(!1);let t=setTimeout(()=>n(!0),L0);return()=>clearTimeout(t)},[e]),e===`offline`||e===`connecting`&&t}function z0({connection:e,onRetry:t}){return R0(e)?(0,W.jsx)(PO,{onRetry:t}):null}var B0={tick:0,route:0,focus:0};window.addEventListener(`hashchange`,()=>{B0.route=++B0.tick}),document.addEventListener(`focusin`,()=>{B0.focus=++B0.tick});var V0=()=>B0.focus>B0.route;function H0(e){return e.kind===`tab`?e.tab:e.kind}function U0(){let e=bO(),t=LO(`status`),n=LO(`lobby`),{prompts:r,answer:i,dismiss:a}=N0(),{connection:o,signedOut:s}=IO(),[c,l]=(0,m.useState)(!1),[u,d]=(0,m.useState)(!1),f=(0,m.useRef)(null),p=D0();iW();let h=t.data;M0(h);let g=!!h&&!s;(0,m.useEffect)(()=>{g&&Ie()},[g]);let _=h?.tabs??[],v=h?.keys??[],y=e.kind===`tab`?e.tab:void 0,b=(0,m.useCallback)(e=>yO(vO(e)),[]),x=(0,W.jsx)(z$,{tabs:_,activeId:y,onSelect:b}),S=(0,m.useCallback)(e=>{if(_.length===0)return;let t=Math.max(0,_.findIndex(e=>e.id===y)),n=_[(t+e+_.length)%_.length];n&&yO(vO(n.id))},[_,y]),C=(0,m.useCallback)(()=>l(e=>!e),[]),w=YX();RO(cH);let[T]=_H(FZ),E=(0,m.useCallback)(()=>gH(FZ),[]),D=(0,m.useCallback)(t=>{(t!==`thinking`&&t!==`activity`||h?.panels?.[t]!==!1)&&P0(t,_O(window.location.hash)??e,C,S,E)},[e,C,S,E,h?.panels]),O=(0,m.useCallback)(()=>{let e=document.activeElement;return!e||e===document.body||f.current?.contains(e)===!0||e.closest(`.thinking-bubble, .terminal-pop`)?!0:e.closest(`[data-state='closed']`)!==null},[]);fX({enabled:!!h,keys:v,tabs:_,insideApp:O,onAction:D,onTab:b});let k=(0,m.useCallback)(()=>I.onHello({}),[]),A=e.kind===`tab`?e.tab:e.kind,ee=!!h;(0,m.useEffect)(()=>{if(!ee)return;let e=nk.active&&nk.to===A;if(nk.active=!1,nk.to=void 0,e)return;let t=requestAnimationFrame(()=>{if(V0()||document.querySelector(`[role='dialog']:not([data-state='closed'])`))return;let e=document.getElementById(`composer-text`);!window.matchMedia(`(pointer: coarse)`).matches&&e&&!e.disabled&&!e.closest(`[inert]`)?e.focus({preventScroll:!0}):document.activeElement?.id!==`composer-text`&&document.getElementById(`main`)?.focus({preventScroll:!0})});return()=>cancelAnimationFrame(t)},[A,ee]);let j=Object.fromEntries(v.map(e=>[e.action,e.label])),M=!!h&&!s,N=M?(0,W.jsx)(cQ,{hint:j.sidebar}):null,P=(0,W.jsx)(jZ,{connection:o,projects:w,lead:N,tabs:x,extra:u&&r.length>0?(0,W.jsx)(_0,{count:r.length,onOpen:()=>d(!1)}):null,tools:M?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(qQ,{hint:j.code,className:I0}),(0,W.jsx)(zQ,{hint:j.terminal,className:I0})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(DX,{className:F0,side:`bottom`}),(0,W.jsx)(EX,{className:F0,side:`bottom`})]})});return s||!h?(0,W.jsxs)(`div`,{ref:f,className:`fixed inset-0 flex flex-col`,children:[P,(0,W.jsx)(`main`,{className:`surface flex min-h-0 flex-1 flex-col overflow-y-auto`,children:s?(0,W.jsx)(i$,{}):t.error?(0,W.jsx)(NO,{message:t.error,onRetry:k}):(0,W.jsx)(MO,{})})]}):(0,W.jsxs)(`div`,{ref:f,className:`app-chrome fixed inset-0 flex`,"data-sidebar":T?`folded`:`open`,children:[(0,W.jsx)(sQ,{route:e,keys:j,onHelp:C}),(0,W.jsxs)(`div`,{className:`relative flex min-w-0 flex-1 flex-col`,children:[P,(0,W.jsxs)(`div`,{className:`app-page relative flex min-h-0 flex-1 flex-col`,children:[(0,W.jsx)(z0,{connection:o,onRetry:p}),(0,W.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:[(0,W.jsx)(`main`,{id:`main`,tabIndex:-1,onKeyDown:e=>{e.key!==`Escape`||e.defaultPrevented||KO(e.target)||e.target.closest(`[role='dialog'], [role='menu'], [role='listbox']`)||tk()&&e.preventDefault()},role:y?`tabpanel`:void 0,"aria-labelledby":y?`tab-${y}`:void 0,className:`surface flex min-h-0 flex-1 flex-col overflow-y-auto outline-none`,children:(0,W.jsx)(Yf.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.18,ease:[.2,.8,.2,1]},className:`flex min-h-0 flex-1 flex-col`,children:$Y(e)},H0(e))}),(0,W.jsx)(EZ,{route:e,keys:j,projects:w,onHelp:C})]}),(0,W.jsx)(HQ,{toggleKey:j.terminal??"Ctrl+`"})]})]}),(0,W.jsx)(b1,{status:h,lobby:n.data}),(0,W.jsx)(n$,{codeKey:v.find(e=>e.action===`code`)?.key}),(0,W.jsx)(v0,{prompts:r,answer:i,dismiss:a,minimized:u,onMinimize:d}),(0,W.jsx)(CX,{open:c,onOpenChange:l,keys:v,tabs:_})]})}async function W0(e){switch(e){case`status`:return z(`status.get`,{});case`lobby`:return z(`lobby.snapshot`,{});case`prompts`:return z(`prompts.list`,{});default:return}}var G0=[`status`,`lobby`,`prompts`];function K0(){let[e,t]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{let e=!0;return(async()=>{await Se(),e&&(I.markUsed(G0,W0),t(!0))})(),()=>{e=!1}},[]),e}function q0(){return K0()?(0,W.jsx)(U0,{}):(0,W.jsx)(`div`,{className:`fixed inset-0 flex`,children:(0,W.jsx)(MO,{})})}var J0={info:sh,success:lm,warning:Yg,error:xm},Y0={info:`Note:`,success:`Done:`,warning:`Warning:`,error:`Error:`},X0={info:`text-info`,success:`text-success`,warning:`text-warning`,error:`text-destructive`};function Z0(){let{item:e,waiting:t}=dp(),n=cO(),r=e&&!n;return(0,m.useEffect)(()=>{if(!e||n)return;let r=window.setTimeout(()=>lp(e.id),t>0?Math.min(e.duration,1600):e.duration);return()=>window.clearTimeout(r)},[e,n,t]),(0,W.jsx)(`div`,{role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`pointer-events-none fixed z-40 flex justify-center px-4`,style:{bottom:`calc(var(--composer-h, 0px) + var(--terminal-h, 0px) + 0.25rem)`,left:`var(--composer-x, 0px)`,width:`var(--composer-w, 100%)`},children:(0,W.jsx)(Au,{mode:`wait`,children:r?(0,W.jsxs)(Yf.div,{initial:{opacity:0,scale:.55,y:18},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.92,y:6,transition:{duration:.14,ease:`easeIn`}},transition:{type:`spring`,stiffness:560,damping:15,mass:.8},className:`pointer-events-auto flex max-w-[min(32rem,100%)] items-center gap-2.5 glass-toast rounded-lg px-3.5 py-2.5 text-sm`,children:[(0,W.jsx)(Q0,{kind:e.kind}),(0,W.jsxs)(`span`,{className:`min-w-0 break-words`,children:[(0,W.jsxs)(`span`,{className:`sr-only`,children:[Y0[e.kind],` `]}),e.message]}),e.action?(0,W.jsx)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,className:`btn-outline -my-1.5 -mr-1 h-7 shrink-0 rounded-lg border px-2.5 text-xs font-medium text-foreground transition-[box-shadow,scale] active:scale-[0.97] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,onClick:()=>{e.action?.onClick(),lp(e.id)},children:e.action.label}):null]},e.id):null})})}function Q0({kind:e}){let t=J0[e];return(0,W.jsx)(t,{"aria-hidden":`true`,className:X(`size-4 shrink-0`,X0[e])})}(0,tp.createRoot)(document.getElementById(`root`)).render((0,W.jsx)(m.StrictMode,{children:(0,W.jsx)(GW,{children:(0,W.jsx)(Lu,{reducedMotion:`user`,children:(0,W.jsxs)(BO,{children:[(0,W.jsx)(q0,{}),(0,W.jsx)(Z0,{})]})})})})),`serviceWorker`in navigator&&window.addEventListener(`load`,()=>{navigator.serviceWorker.register(`/sw.js`,{updateViaCache:`none`}).catch(()=>void 0)});export{L as i,aX as n,z as r,FQ as t};