moi-computer 0.12.1-next.0 → 0.12.1-next.2

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 (354) hide show
  1. package/README.md +26 -26
  2. package/bin/moi.mjs +2 -2
  3. package/client/AGENTS.md +7 -3
  4. package/client/api/app-config.ts +5 -10
  5. package/client/api/workspace-keys.ts +3 -2
  6. package/client/app/app-provider.tsx +25 -0
  7. package/client/app/{AppRouter.tsx → app-router.tsx} +4 -4
  8. package/client/app/routes/{HomeRoute.tsx → home-route.tsx} +2 -2
  9. package/client/app/routes/{WorkspaceRoute.tsx → workspace-route.tsx} +22 -23
  10. package/client/app/shell/{SidebarLayout.tsx → sidebar-layout.tsx} +29 -23
  11. package/client/dev/index.html +43 -0
  12. package/client/dev/index.ts +15 -0
  13. package/client/features/applets/api.ts +1 -1
  14. package/client/features/applets/{AppletContainer.tsx → applet-container.tsx} +1 -1
  15. package/client/features/applets/applet-thumbnail.ts +1 -1
  16. package/client/features/applets/{useApplet.ts → use-applet.ts} +2 -2
  17. package/client/features/applets/{WidgetShell.tsx → widget-shell.tsx} +4 -4
  18. package/client/features/chat/applet-chat-intents.ts +4 -4
  19. package/client/features/chat/{ChatPanel.tsx → chat-panel.tsx} +11 -11
  20. package/client/features/chat/{ChatPopup.tsx → chat-popup.tsx} +1 -1
  21. package/client/features/chat/composer/attachments/{DrawingAttachmentChip.tsx → drawing-attachment-chip.tsx} +1 -1
  22. package/client/features/chat/composer/attachments/{FileAttachmentChip.tsx → file-attachment-chip.tsx} +1 -1
  23. package/client/features/chat/composer/attachments/{TextAttachmentChip.tsx → text-attachment-chip.tsx} +1 -1
  24. package/client/features/chat/composer/banners/{ComposerBanner.tsx → composer-banner.tsx} +0 -14
  25. package/client/features/chat/composer/banners/{ErrorBanner.tsx → error-banner.tsx} +1 -1
  26. package/client/features/chat/composer/banners/{SkillUpdateBanner.tsx → skill-update-banner.tsx} +3 -3
  27. package/client/features/chat/composer/{ChatComposer.tsx → chat-composer.tsx} +8 -7
  28. package/client/features/chat/composer/{ModelPicker.tsx → model-picker.tsx} +1 -1
  29. package/client/features/chat/composer/{useWorkspaceComposerState.tsx → use-workspace-composer-state.tsx} +12 -28
  30. package/client/features/chat/composer/{useWorkspaceSkillUpdates.ts → use-workspace-skill-updates.ts} +1 -1
  31. package/client/features/chat/connection/chat-frames.ts +3 -3
  32. package/client/features/chat/messages/{ChatEmptyState.tsx → chat-empty-state.tsx} +4 -4
  33. package/client/features/chat/messages/{MarkdownContent.tsx → markdown-content.tsx} +1 -1
  34. package/client/features/chat/messages/tool-group/index.ts +1 -1
  35. package/client/features/chat/messages/tool-group/{ReadImagePreview.tsx → read-image-preview.tsx} +2 -2
  36. package/client/features/chat/messages/tool-group/{SubagentCard.tsx → subagent-card.tsx} +3 -3
  37. package/client/features/chat/messages/tool-group/{TimelineRow.tsx → timeline-row.tsx} +1 -1
  38. package/client/features/chat/messages/tool-group/{ToolCallGroup.tsx → tool-call-group.tsx} +8 -8
  39. package/client/features/chat/messages/tool-group/{ToolOutput.tsx → tool-output.tsx} +1 -1
  40. package/client/features/chat/messages/{TurnView.tsx → turn-view.tsx} +4 -4
  41. package/client/features/chat/sessions/api.ts +3 -3
  42. package/client/features/chat/sessions/{ChatSelector.tsx → chat-selector.tsx} +2 -2
  43. package/client/features/chat/sessions/{useSelectedSession.ts → use-selected-session.ts} +2 -2
  44. package/client/features/chat/{useChat.ts → use-chat.ts} +4 -4
  45. package/client/features/collab/host-state.ts +24 -7
  46. package/client/features/collab/local-user.ts +1 -1
  47. package/client/features/collab/proxy-user.ts +4 -9
  48. package/client/features/connectors/mcp-icons.ts +1 -1
  49. package/client/features/connectors/{McpServerCards.tsx → mcp-server-cards.tsx} +1 -1
  50. package/client/features/{home/workspace-setup/DemoDialog.tsx → demo/demo-dialog.tsx} +26 -80
  51. package/client/features/dev/chat-states-fixtures.ts +4 -4
  52. package/client/features/dev/{ChatStatesPage.tsx → chat-states-page.tsx} +6 -6
  53. package/client/features/dev/collab/local-user-settings.tsx +4 -4
  54. package/client/features/dev/{DevIndexPage.tsx → dev-index-page.tsx} +7 -1
  55. package/client/features/dev/{DevRoutes.tsx → dev-routes.tsx} +8 -6
  56. package/client/features/dev/workspace-setup-mocks.ts +102 -0
  57. package/client/features/dev/workspace-setup-page.tsx +11 -0
  58. package/client/features/dev/workspace-setup-preview.tsx +253 -0
  59. package/client/features/drawings/{DrawingToolbar.tsx → drawing-toolbar.tsx} +1 -1
  60. package/client/features/drawings/{useChatAnnotation.ts → use-chat-annotation.ts} +29 -23
  61. package/client/features/drawings/{useDrawingLayer.ts → use-drawing-layer.ts} +1 -1
  62. package/client/features/drawings/{useViewSketch.ts → use-view-sketch.ts} +1 -1
  63. package/client/features/harness/api.ts +36 -0
  64. package/client/features/harness/device-login-steps.tsx +97 -0
  65. package/client/features/home/api.ts +29 -89
  66. package/client/features/home/{HomeLogo.tsx → home-logo.tsx} +1 -1
  67. package/client/features/home/{HomePage.tsx → home-page.tsx} +13 -14
  68. package/client/features/overview/api.ts +2 -2
  69. package/client/features/overview/default/registry.tsx +1 -1
  70. package/client/features/overview/default/{ViewsWidget.tsx → views-widget.tsx} +1 -1
  71. package/client/features/overview/{HiddenPanel.tsx → hidden-panel.tsx} +2 -2
  72. package/client/features/overview/{Overview.tsx → overview.tsx} +6 -6
  73. package/client/features/overview/{WidgetCanvas.tsx → widget-canvas.tsx} +1 -1
  74. package/client/features/overview/{WidgetFrame.tsx → widget-frame.tsx} +1 -1
  75. package/client/features/overview/workspace-name.tsx +55 -0
  76. package/client/features/scratchpad/{Scratchpad.tsx → scratchpad.tsx} +10 -13
  77. package/client/features/scratchpad/{useScratchpadSnapshot.tsx → use-scratchpad-snapshot.tsx} +3 -3
  78. package/client/features/settings/api.ts +15 -9
  79. package/client/features/settings/{ConnectorsSettings.tsx → connectors-settings.tsx} +3 -3
  80. package/client/features/settings/{EnvironmentSettings.tsx → environment-settings.tsx} +3 -3
  81. package/client/features/settings/{GeneralSettings.tsx → general-settings.tsx} +5 -5
  82. package/client/features/settings/{useEnvVars.ts → use-env-vars.ts} +1 -1
  83. package/client/features/settings/{WorkspaceIconPicker.tsx → workspace-icon-picker.tsx} +1 -1
  84. package/client/features/settings/{WorkspaceSettingsDialog.tsx → workspace-settings-dialog.tsx} +3 -3
  85. package/client/features/update/api.ts +1 -1
  86. package/client/features/views/api.ts +1 -1
  87. package/client/features/views/{PendingViewScreen.tsx → pending-view-screen.tsx} +7 -4
  88. package/client/features/views/{useViewActions.ts → use-view-actions.ts} +2 -2
  89. package/client/features/views/{useViewDrafts.ts → use-view-drafts.ts} +15 -6
  90. package/client/features/views/{ViewManager.tsx → view-manager.tsx} +3 -3
  91. package/client/features/views/view-submission.ts +1 -1
  92. package/client/features/workspace/add/api.ts +80 -0
  93. package/client/features/{home/workspace-setup/CreateWorkspaceDialog.tsx → workspace/add/create-workspace-dialog.tsx} +56 -42
  94. package/client/features/workspace/add/import-workspace-dialog.tsx +81 -0
  95. package/client/features/{home/workspace-setup/useWorkspaceImport.ts → workspace/add/use-workspace-import.ts} +1 -1
  96. package/client/features/workspace/add/workspace-agent-options.ts +53 -0
  97. package/client/features/{home/workspace-setup/WorkspaceAgentStep.tsx → workspace/add/workspace-agent-selector.tsx} +59 -98
  98. package/client/features/{home/workspace-setup/WorkspaceDialogContent.tsx → workspace/add/workspace-dialog-content.tsx} +1 -1
  99. package/client/features/workspace/api.ts +31 -26
  100. package/client/features/workspace/browser-tab-state.ts +1 -1
  101. package/client/features/workspace/moi-context.ts +1 -1
  102. package/client/features/workspace/setup/workspace-login-state.tsx +175 -0
  103. package/client/features/workspace/setup/workspace-recovery-states.tsx +125 -0
  104. package/client/features/workspace/setup/workspace-setup-panel.tsx +18 -0
  105. package/client/features/workspace/setup/workspace-setup.tsx +78 -0
  106. package/client/features/workspace/setup/workspace-welcome-state.tsx +81 -0
  107. package/client/features/workspace/{ThemePanel.tsx → theme-panel.tsx} +3 -3
  108. package/client/features/workspace/{useWorkspaceNavigation.ts → use-workspace-navigation.ts} +2 -2
  109. package/client/features/workspace/{WorkspaceScreen.tsx → workspace-content.tsx} +37 -80
  110. package/client/features/workspace/workspace-frame.tsx +76 -0
  111. package/client/features/workspace/workspace-identity.tsx +40 -0
  112. package/client/features/workspace/{WorkspaceLayoutContext.tsx → workspace-layout-context.tsx} +2 -0
  113. package/client/features/workspace/{WorkspaceMenu.tsx → workspace-menu.tsx} +3 -3
  114. package/client/features/workspace/workspace-pending-screen.tsx +26 -0
  115. package/client/features/{home → workspace}/workspace-presentation.tsx +10 -3
  116. package/client/features/workspace/workspace-screen.tsx +28 -0
  117. package/client/features/workspace/{WorkspaceSplitLayout.tsx → workspace-split-layout.tsx} +1 -1
  118. package/client/features/workspace/{WorkspaceTabs.tsx → workspace-tabs.tsx} +2 -2
  119. package/client/index.css +2 -2
  120. package/client/index.html +29 -10
  121. package/client/index.tsx +7 -2
  122. package/client/lib/agent-availability.ts +0 -5
  123. package/client/lib/browser-tab-id.ts +4 -0
  124. package/client/main.tsx +10 -7
  125. package/client/runtime/app-context.ts +20 -0
  126. package/client/runtime/use-workspace-events.ts +56 -0
  127. package/client/runtime/workspace-events.ts +151 -0
  128. package/dist/chunk-00rh9df4.js +2 -0
  129. package/dist/chunk-4nh7y1hq.css +1 -0
  130. package/dist/{chunk-vqpkqtdr.js → chunk-am4agx6v.js} +1 -1
  131. package/dist/{chunk-gps4qc38.js → chunk-d7cbm65e.js} +1 -1
  132. package/dist/chunk-hbpdv7vd.js +1 -0
  133. package/dist/chunk-hmka9rt5.js +2 -0
  134. package/dist/{chunk-j905va8r.js → chunk-hvh9f5h0.js} +1 -1
  135. package/dist/chunk-mjjregkn.js +10 -0
  136. package/dist/chunk-rt30jbcm.js +1 -0
  137. package/dist/chunk-vt6zybej.js +2 -0
  138. package/dist/chunk-wbkwf6cc.js +68 -0
  139. package/dist/chunk-xjyfyz64.js +1 -0
  140. package/dist/{chunk-hzwr8dp8.js → chunk-y8nbwp21.js} +71 -71
  141. package/dist/chunk-ysfdcew7.js +1 -0
  142. package/dist/index.html +30 -11
  143. package/lib/format.ts +1 -1
  144. package/lib/harness-instructions.ts +30 -0
  145. package/lib/ids.ts +3 -3
  146. package/lib/moi-context.ts +2 -2
  147. package/lib/scratchpad-skew.ts +3 -3
  148. package/lib/types.ts +28 -20
  149. package/lib/update.ts +1 -1
  150. package/package.json +5 -2
  151. package/server/AGENTS.md +10 -4
  152. package/server/README.md +102 -0
  153. package/server/api/harnesses.ts +56 -0
  154. package/server/{api.ts → api/index.ts} +125 -118
  155. package/server/app-config.ts +24 -12
  156. package/server/app-settings.ts +1 -1
  157. package/server/applets/applet-css.ts +1 -1
  158. package/server/applets/build-applet.ts +4 -4
  159. package/server/applets/build-worker.ts +1 -1
  160. package/server/applets/config.ts +1 -1
  161. package/server/{functions-worker.ts → applets/functions-worker.ts} +1 -1
  162. package/server/{functions.ts → applets/functions.ts} +2 -2
  163. package/server/applets/index.ts +2 -2
  164. package/server/{thumbnails.ts → applets/thumbnails.ts} +9 -6
  165. package/server/{applet-typecheck.ts → applets/typecheck.ts} +4 -4
  166. package/server/{ui-components.ts → applets/ui-components.ts} +2 -2
  167. package/server/{views.ts → applets/views.ts} +7 -7
  168. package/server/{widgets.ts → applets/widgets.ts} +2 -2
  169. package/server/cli/applet-selector.ts +19 -0
  170. package/server/cli/args.ts +5 -0
  171. package/server/{cli-colors.ts → cli/colors.ts} +1 -1
  172. package/server/cli/commands/bundle.ts +119 -0
  173. package/server/cli/commands/call-server-fn.ts +42 -0
  174. package/server/cli/commands/check.ts +53 -0
  175. package/server/cli/commands/config.ts +132 -0
  176. package/server/cli/commands/debug.ts +119 -0
  177. package/server/cli/commands/env.ts +162 -0
  178. package/server/cli/commands/hermes.ts +149 -0
  179. package/server/cli/commands/init.ts +286 -0
  180. package/server/cli/commands/navigate.ts +35 -0
  181. package/server/cli/commands/openclaw.ts +168 -0
  182. package/server/cli/commands/refresh.ts +39 -0
  183. package/server/cli/commands/scratch.ts +496 -0
  184. package/server/cli/commands/service.ts +298 -0
  185. package/server/cli/commands/skill.ts +122 -0
  186. package/server/cli/commands/start.ts +138 -0
  187. package/server/cli/commands/status.ts +80 -0
  188. package/server/cli/commands/tabs.ts +43 -0
  189. package/server/cli/commands/theme.ts +192 -0
  190. package/server/cli/commands/ui-components.ts +15 -0
  191. package/server/cli/commands/update.ts +192 -0
  192. package/server/cli/commands/version.ts +9 -0
  193. package/server/cli/commands/views.ts +87 -0
  194. package/server/cli/control.ts +89 -0
  195. package/server/{cli-env.ts → cli/env.ts} +9 -9
  196. package/server/cli/index.ts +171 -0
  197. package/server/{cli-pc.ts → cli/pc.ts} +1 -1
  198. package/server/cli/provider.ts +25 -0
  199. package/server/cli/server-version.ts +16 -0
  200. package/server/cli/server.ts +81 -0
  201. package/server/{cli-ui-components.ts → cli/ui-components.ts} +5 -5
  202. package/server/cli.ts +2 -3252
  203. package/server/collab/manager.ts +3 -3
  204. package/server/collab/skill/index.ts +2 -2
  205. package/server/control.ts +20 -20
  206. package/server/harness/README.md +47 -25
  207. package/server/harness/acp/NOTES.md +11 -11
  208. package/server/harness/acp/archived.ts +3 -3
  209. package/server/harness/acp/client.ts +2 -2
  210. package/server/harness/acp/run-durations.ts +1 -1
  211. package/server/harness/acp/session.ts +5 -5
  212. package/server/harness/auth.ts +303 -0
  213. package/server/harness/claude-code/NOTES.md +9 -7
  214. package/server/harness/claude-code/auth.ts +125 -17
  215. package/server/harness/claude-code/index.ts +2 -1
  216. package/server/harness/claude-code/mcp.ts +1 -1
  217. package/server/harness/claude-code/session.ts +10 -7
  218. package/server/harness/codex/NOTES.md +12 -12
  219. package/server/harness/codex/auth.ts +86 -19
  220. package/server/harness/codex/client.ts +17 -13
  221. package/server/harness/codex/index.ts +2 -1
  222. package/server/harness/codex/permissions.ts +3 -3
  223. package/server/harness/codex/probe.ts +3 -5
  224. package/server/harness/codex/session.ts +16 -13
  225. package/server/harness/codex/thread-list.ts +4 -0
  226. package/server/harness/codex/transport.ts +5 -5
  227. package/server/harness/executable.ts +42 -18
  228. package/server/harness/hermes/NOTES.md +70 -70
  229. package/server/harness/hermes/discovery.ts +1 -1
  230. package/server/harness/openclaw/NOTES.md +24 -24
  231. package/server/harness/openclaw/adapter.ts +1 -1
  232. package/server/harness/openclaw/compat.ts +1 -1
  233. package/server/harness/openclaw/session.ts +5 -2
  234. package/server/harness/registry.ts +1 -1
  235. package/server/harness/shell-path.ts +31 -21
  236. package/server/harness/types.ts +9 -2
  237. package/server/navigation-relay.ts +1 -1
  238. package/server/open-browser.ts +7 -0
  239. package/server/{scratchpad-assets.ts → scratchpad/assets.ts} +4 -4
  240. package/server/{scratchpad.ts → scratchpad/document.ts} +8 -8
  241. package/server/{scratchpad-executor.ts → scratchpad/executor.ts} +7 -7
  242. package/server/{scratchpad-relay.ts → scratchpad/relay.ts} +4 -5
  243. package/server/{scratchpad-shape-defaults.ts → scratchpad/shape-defaults.ts} +2 -2
  244. package/server/server-cwd.ts +1 -1
  245. package/server/service.ts +2 -2
  246. package/server/{session-archive.ts → sessions/archive.ts} +5 -5
  247. package/server/{attachment-message.ts → sessions/attachment-message.ts} +1 -1
  248. package/server/{session-config.ts → sessions/config.ts} +1 -1
  249. package/server/{session-lifecycle.ts → sessions/lifecycle.ts} +3 -3
  250. package/server/{pending-views.ts → sessions/pending-views.ts} +3 -3
  251. package/server/{selected-session.ts → sessions/selected.ts} +1 -1
  252. package/server/{session-store.ts → sessions/store.ts} +1 -1
  253. package/server/{view-sessions.ts → sessions/view-sessions.ts} +9 -9
  254. package/server/{skills-template.ts → skills/template.ts} +1 -1
  255. package/server/{skill-update.ts → skills/update.ts} +5 -5
  256. package/server/{skill-version.ts → skills/version.ts} +4 -4
  257. package/server/static.ts +5 -3
  258. package/server/status.ts +3 -3
  259. package/server/vendor.ts +23 -30
  260. package/server/web.ts +17 -9
  261. package/server/{env-apply.ts → workspaces/env-apply.ts} +5 -5
  262. package/server/{workspace-env.ts → workspaces/env.ts} +3 -3
  263. package/server/{workspace-import.ts → workspaces/import.ts} +4 -4
  264. package/server/{workspace-init.ts → workspaces/init.ts} +5 -5
  265. package/server/{layout.ts → workspaces/layout.ts} +13 -8
  266. package/server/{preview.ts → workspaces/preview.ts} +1 -1
  267. package/server/{registry.ts → workspaces/registry.ts} +3 -3
  268. package/server/{required-env.ts → workspaces/required-env.ts} +3 -3
  269. package/server/{moi-scaffold.ts → workspaces/scaffold.ts} +3 -3
  270. package/ui-components/button.tsx +1 -1
  271. package/ui-components/docs/attachment.md +2 -2
  272. package/ui-components/docs/button.md +1 -1
  273. package/ui-components/docs/calendar.md +1 -1
  274. package/ui-components/docs/chart.md +4 -4
  275. package/ui-components/docs/data-table.md +1 -1
  276. package/ui-components/docs/drawer.md +1 -1
  277. package/ui-components/docs/field.md +1 -1
  278. package/ui-components/docs/input.md +2 -2
  279. package/ui-components/docs/label.md +2 -2
  280. package/ui-components/docs/table.md +2 -2
  281. package/workspace/.claude/skills/moi-workspace/SKILL.md +12 -12
  282. package/workspace/.claude/skills/moi-workspace/references/COLLAB.md +2 -2
  283. package/workspace/.claude/skills/moi-workspace/references/DESIGN.md +2 -2
  284. package/workspace/.claude/skills/moi-workspace/references/INTENTS.md +2 -2
  285. package/client/features/chat/composer/banners/AgentAvailabilityBanner.tsx +0 -101
  286. package/client/features/home/workspace-setup/ImportWorkspaceDialog.tsx +0 -92
  287. package/client/features/overview/WorkspaceName.tsx +0 -60
  288. package/client/runtime/useWorkspaceEvents.ts +0 -189
  289. package/dist/chunk-1zhnhy00.js +0 -1
  290. package/dist/chunk-27501vke.js +0 -1
  291. package/dist/chunk-9xtv6djt.js +0 -2
  292. package/dist/chunk-am1x230f.js +0 -2
  293. package/dist/chunk-darpsw65.js +0 -1
  294. package/dist/chunk-n33w9y38.js +0 -10
  295. package/dist/chunk-r63ks44z.js +0 -68
  296. package/dist/chunk-wd46nk26.css +0 -1
  297. package/dist/chunk-xgt7vxt9.js +0 -1
  298. package/dist/chunk-yvzhwtfa.js +0 -2
  299. package/server/agent.ts +0 -223
  300. /package/client/components/shared/{AgentBlobatar.tsx → agent-blobatar.tsx} +0 -0
  301. /package/client/components/shared/{BottomPanel.tsx → bottom-panel.tsx} +0 -0
  302. /package/client/components/shared/{Composer.tsx → composer.tsx} +0 -0
  303. /package/client/components/shared/{LedLogo.tsx → led-logo.tsx} +0 -0
  304. /package/client/components/shared/{PanelHeader.tsx → panel-header.tsx} +0 -0
  305. /package/client/components/shared/{ReorderableList.tsx → reorderable-list.tsx} +0 -0
  306. /package/client/components/shared/{WorkspaceIcon.tsx → workspace-icon.tsx} +0 -0
  307. /package/client/features/applets/{WidgetErrorBoundary.tsx → widget-error-boundary.tsx} +0 -0
  308. /package/client/features/chat/composer/attachments/{AttachmentChip.tsx → attachment-chip.tsx} +0 -0
  309. /package/client/features/chat/messages/{ChatPromptBubbles.tsx → chat-prompt-bubbles.tsx} +0 -0
  310. /package/client/features/chat/messages/{ShimmerText.tsx → shimmer-text.tsx} +0 -0
  311. /package/client/features/chat/messages/tool-group/{CodeBlock.tsx → code-block.tsx} +0 -0
  312. /package/client/features/chat/messages/tool-group/{Collapse.tsx → collapse.tsx} +0 -0
  313. /package/client/features/chat/messages/{useStickToBottom.ts → use-stick-to-bottom.ts} +0 -0
  314. /package/client/features/connectors/{IconMcp.tsx → icon-mcp.tsx} +0 -0
  315. /package/client/features/dev/{BlobatarShapesPage.tsx → blobatar-shapes-page.tsx} +0 -0
  316. /package/client/features/dev/{HarnessDebugPage.tsx → harness-debug-page.tsx} +0 -0
  317. /package/client/features/dev/{TextureLabPage.tsx → texture-lab-page.tsx} +0 -0
  318. /package/client/features/dev/{ToolCallsPage.tsx → tool-calls-page.tsx} +0 -0
  319. /package/client/features/drawings/{DrawingLayer.tsx → drawing-layer.tsx} +0 -0
  320. /package/client/features/home/{WorkspacePreview.tsx → workspace-preview.tsx} +0 -0
  321. /package/client/features/overview/{useGridReconcile.ts → use-grid-reconcile.ts} +0 -0
  322. /package/client/features/scratchpad/{ScratchpadControls.tsx → scratchpad-controls.tsx} +0 -0
  323. /package/client/features/settings/{SettingsLayout.tsx → settings-layout.tsx} +0 -0
  324. /package/client/features/update/{UpdateControl.tsx → update-control.tsx} +0 -0
  325. /package/client/features/workspace/{UnavailablePage.tsx → unavailable-page.tsx} +0 -0
  326. /package/client/features/workspace/{useFitsSplitLayout.ts → use-fits-split-layout.ts} +0 -0
  327. /package/client/features/workspace/{WorkspaceContext.tsx → workspace-context.tsx} +0 -0
  328. /package/client/vendor/react/{development → 19.2.4/development}/_impl/react-dom-client.js +0 -0
  329. /package/client/vendor/react/{development → 19.2.4/development}/_impl/react-dom.js +0 -0
  330. /package/client/vendor/react/{development → 19.2.4/development}/_impl/react-jsx-dev-runtime.js +0 -0
  331. /package/client/vendor/react/{development → 19.2.4/development}/_impl/react-jsx-runtime.js +0 -0
  332. /package/client/vendor/react/{development → 19.2.4/development}/_impl/react.js +0 -0
  333. /package/client/vendor/react/{development → 19.2.4/development}/react-dom-client.js +0 -0
  334. /package/client/vendor/react/{development → 19.2.4/development}/react-dom.js +0 -0
  335. /package/client/vendor/react/{development → 19.2.4/development}/react-jsx-dev-runtime.js +0 -0
  336. /package/client/vendor/react/{development → 19.2.4/development}/react-jsx-runtime.js +0 -0
  337. /package/client/vendor/react/{development → 19.2.4/development}/react.js +0 -0
  338. /package/client/vendor/react/{production → 19.2.4/production}/_impl/react-dom-client.js +0 -0
  339. /package/client/vendor/react/{production → 19.2.4/production}/_impl/react-dom.js +0 -0
  340. /package/client/vendor/react/{production → 19.2.4/production}/_impl/react-jsx-dev-runtime.js +0 -0
  341. /package/client/vendor/react/{production → 19.2.4/production}/_impl/react-jsx-runtime.js +0 -0
  342. /package/client/vendor/react/{production → 19.2.4/production}/_impl/react.js +0 -0
  343. /package/client/vendor/react/{production → 19.2.4/production}/react-dom-client.js +0 -0
  344. /package/client/vendor/react/{production → 19.2.4/production}/react-dom.js +0 -0
  345. /package/client/vendor/react/{production → 19.2.4/production}/react-jsx-dev-runtime.js +0 -0
  346. /package/client/vendor/react/{production → 19.2.4/production}/react-jsx-runtime.js +0 -0
  347. /package/client/vendor/react/{production → 19.2.4/production}/react.js +0 -0
  348. /package/server/{bundle-queue.ts → applets/bundle-queue.ts} +0 -0
  349. /package/server/{applet-log.ts → applets/log.ts} +0 -0
  350. /package/server/{cli-ui.ts → cli/ui.ts} +0 -0
  351. /package/server/{workspace-config.ts → workspaces/config.ts} +0 -0
  352. /package/server/{icon.ts → workspaces/icon.ts} +0 -0
  353. /package/server/{tabs.ts → workspaces/tabs.ts} +0 -0
  354. /package/server/{theme.ts → workspaces/theme.ts} +0 -0
@@ -1,68 +0,0 @@
1
- import{$ as hf,$a as vf,$b as ck,A as C8,Aa as zk,Ab as QY,Ac as K5,B as g2,Ba as ZY,Bb as gf,Bc as _S,C as DB,Ca as Gk,Cb as kk,Cc as jS,D as E8,Da as Uk,Db as cl,Dc as f1,E as hZ,Ea as Yk,Eb as tP,Ec as cs,F as RA,Fa as Kk,Fb as dl,G as f0,Ga as Fk,Gb as gn,H as f2,Ha as JY,Hb as Zq,I as ox,Ia as rS,Ib as Ik,J as X2,Ja as RF,Jb as d2,K as G0,Ka as Qh,Kb as WS,L as Ao,Lb as Zn,M as oJ,Ma as Wk,Mb as yk,N as iJ,Na as wF,Nb as xk,O as C5,Oa as PJ,Ob as lJ,P as qj,Pa as qk,Pb as g6,Q as X0,Qa as Nk,Qb as hk,R as GJ,Ra as mn,Rb as vk,S as o0,Sa as pR,Sb as mQ,T as _$,Ta as Ak,Tb as Xx,U as P0,Ua as Dk,Ub as gk,V as Qi,Va as Vk,Vb as fk,W as iR,Wa as Lk,X as hn,Xb as mk,Y as xE,Ya as Mk,Z as LG,Za as Pk,Zb as uk,_ as rR,_b as pk,aa as xK,ab as _k,ac as dk,b as c,ba as Co,bb as vE,bc as Qq,c as Mq0,ca as eh,cb as HY,cc as lk,d as z1,da as uR,db as SF,e as s2,ea as Bv,eb as gs,ec as Rf,f as M1,fa as bF,fb as jk,fc as bo,g as t1,ga as aR,gb as dq,gc as HU,h as H0,ha as oR,hb as Nv,i as I0,ia as dB,ic as kf,j as Wz,ja as nR,jb as x5,jc as ik,k as rT,ka as sR,kb as gE,kc as rk,l as Y0,la as tR,lb as vn,lc as n5,m as B8,ma as vs,mb as Ok,mc as Kr,n as O2,na as eR,nb as Tk,nc as zx,o as w1,oa as $k,ob as Qx,oc as jf,p as E3,pa as Zk,pb as cR,pc as dY,q as HC,qa as Jk,qb as Ck,qc as ff,r as s0,ra as Hk,rb as Ja,rc as bf,s as _1,sa as S8,sb as Eo,sc as jb,t as H6,ta as Bk,tb as Ek,tc as Ob,u as AB,ua as XU,ub as bk,uc as PS,v as nC,va as x$,vb as wk,w as UG,wa as Ki,wb as Sk,wc as RS,x as kA,xa as hE,xb as BY,xc as E4,y as sC,ya as Qk,yc as qU,z as IA,za as Xk,zb as Rk,zc as AS}from"/chunk-n33w9y38.js";import{Gc as R8}from"/chunk-9xtv6djt.js";import{Hc as Rb,Ic as eA,Jc as $D,Kc as w3,Lc as xG}from"/chunk-am1x230f.js";import{Pc as G1,Qc as c4,Rc as y5}from"/chunk-vqpkqtdr.js";import{Sc as m,Tc as hG,Uc as W5,Vc as Ih,Wc as N2,Xc as nn}from"/chunk-yvzhwtfa.js";import{$c as AL,Yc as P,Zc as T5,_c as b5}from"/chunk-gps4qc38.js";var OZ=T5((Lt)=>{var c8=P(m());function Yt($,Z){return $===Z&&($!==0||1/$===1/Z)||$!==$&&Z!==Z}var Kt=typeof Object.is==="function"?Object.is:Yt,Ft=c8.useState,Wt=c8.useEffect,qt=c8.useLayoutEffect,Nt=c8.useDebugValue;function At($,Z){var J=Z(),H=Ft({inst:{value:J,getSnapshot:Z}}),B=H[0].inst,Q=H[1];return qt(function(){B.value=J,B.getSnapshot=Z,_N(B)&&Q({inst:B})},[$,J,Z]),Wt(function(){return _N(B)&&Q({inst:B}),$(function(){_N(B)&&Q({inst:B})})},[$]),Nt(J),J}function _N($){var Z=$.getSnapshot;$=$.value;try{var J=Z();return!Kt($,J)}catch(H){return!0}}function Dt($,Z){return Z()}var Vt=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Dt:At;Lt.useSyncExternalStore=c8.useSyncExternalStore!==void 0?c8.useSyncExternalStore:Vt});var Zm=T5((tZ1,$m)=>{var nf=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,$$0=/\n/g,Z$0=/^\s*/,J$0=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,H$0=/^:\s*/,B$0=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Q$0=/^[;\s]*/,X$0=/^\s+|\s+$/g,z$0=`
2
- `,sf="/",tf="*",p$="",G$0="comment",U$0="declaration";function Y$0($,Z){if(typeof $!=="string")throw TypeError("First argument must be a string");if(!$)return[];Z=Z||{};var J=1,H=1;function B(q){var N=q.match($$0);if(N)J+=N.length;var D=q.lastIndexOf(z$0);H=~D?q.length-D:H+q.length}function Q(){var q={line:J,column:H};return function(N){return N.position=new X(q),U(),N}}function X(q){this.start=q,this.end={line:J,column:H},this.source=Z.source}X.prototype.content=$;function z(q){var N=Error(Z.source+":"+J+":"+H+": "+q);if(N.reason=q,N.filename=Z.source,N.line=J,N.column=H,N.source=$,Z.silent);else throw N}function G(q){var N=q.exec($);if(!N)return;var D=N[0];return B(D),$=$.slice(D.length),N}function U(){G(Z$0)}function Y(q){var N;q=q||[];while(N=K())if(N!==!1)q.push(N);return q}function K(){var q=Q();if(sf!=$.charAt(0)||tf!=$.charAt(1))return;var N=2;while(p$!=$.charAt(N)&&(tf!=$.charAt(N)||sf!=$.charAt(N+1)))++N;if(N+=2,p$===$.charAt(N-1))return z("End of comment missing");var D=$.slice(2,N-2);return H+=2,B(D),$=$.slice(N),H+=2,q({type:G$0,comment:D})}function F(){var q=Q(),N=G(J$0);if(!N)return;if(K(),!G(H$0))return z("property missing ':'");var D=G(B$0),A=q({type:U$0,property:ef(N[0].replace(nf,p$)),value:D?ef(D[0].replace(nf,p$)):p$});return G(Q$0),A}function W(){var q=[];Y(q);var N;while(N=F())if(N!==!1)q.push(N),Y(q);return q}return U(),W()}function ef($){return $?$.replace(X$0,p$):p$}$m.exports=Y$0});var Jm=T5((lQ)=>{var K$0=lQ&&lQ.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(lQ,"__esModule",{value:!0});lQ.default=W$0;var F$0=K$0(Zm());function W$0($,Z){let J=null;if(!$||typeof $!=="string")return J;let H=(0,F$0.default)($),B=typeof Z==="function";return H.forEach((Q)=>{if(Q.type!=="declaration")return;let{property:X,value:z}=Q;if(B)Z(X,z,Q);else if(z)J=J||{},J[X]=z}),J}});var Xm=T5((Bm)=>{Object.defineProperty(Bm,"__esModule",{value:!0});Bm.camelCase=void 0;var q$0=/^--[a-zA-Z0-9_-]+$/,N$0=/-([a-z])/g,A$0=/^[^-]+$/,D$0=/^-(webkit|moz|ms|o|khtml)-/,V$0=/^-(ms)-/,L$0=function($){return!$||A$0.test($)||q$0.test($)},M$0=function($,Z){return Z.toUpperCase()},Hm=function($,Z){return"".concat(Z,"-")},P$0=function($,Z){if(Z===void 0)Z={};if(L$0($))return $;if($=$.toLowerCase(),Z.reactCompat)$=$.replace(V$0,Hm);else $=$.replace(D$0,Hm);return $.replace(N$0,M$0)};Bm.camelCase=P$0});var Gm=T5((XM,zm)=>{var _$0=XM&&XM.__importDefault||function($){return $&&$.__esModule?$:{default:$}},j$0=_$0(Jm()),O$0=Xm();function QM($,Z){var J={};if(!$||typeof $!=="string")return J;return(0,j$0.default)($,function(H,B){if(H&&B)J[(0,O$0.camelCase)(H,Z)]=B}),J}QM.default=QM;zm.exports=QM});var wu=T5((cz1,bu)=>{var GW=Object.prototype.hasOwnProperty,Eu=Object.prototype.toString,Pu=Object.defineProperty,_u=Object.getOwnPropertyDescriptor,ju=function(Z){if(typeof Array.isArray==="function")return Array.isArray(Z);return Eu.call(Z)==="[object Array]"},Ou=function(Z){if(!Z||Eu.call(Z)!=="[object Object]")return!1;var J=GW.call(Z,"constructor"),H=Z.constructor&&Z.constructor.prototype&&GW.call(Z.constructor.prototype,"isPrototypeOf");if(Z.constructor&&!J&&!H)return!1;var B;for(B in Z);return typeof B>"u"||GW.call(Z,B)},Tu=function(Z,J){if(Pu&&J.name==="__proto__")Pu(Z,J.name,{enumerable:!0,configurable:!0,value:J.newValue,writable:!0});else Z[J.name]=J.newValue},Cu=function(Z,J){if(J==="__proto__"){if(!GW.call(Z,J))return;else if(_u)return _u(Z,J).value}return Z[J]};bu.exports=function $(){var Z,J,H,B,Q,X,z=arguments[0],G=1,U=arguments.length,Y=!1;if(typeof z==="boolean")Y=z,z=arguments[1]||{},G=2;if(z==null||typeof z!=="object"&&typeof z!=="function")z={};for(;G<U;++G)if(Z=arguments[G],Z!=null){for(J in Z)if(H=Cu(z,J),B=Cu(Z,J),z!==B){if(Y&&B&&(Ou(B)||(Q=ju(B)))){if(Q)Q=!1,X=H&&ju(H)?H:[];else X=H&&Ou(H)?H:{};Tu(z,{name:J,newValue:$(Y,X,B)})}else if(typeof B<"u")Tu(z,{name:J,newValue:B})}}return z}});var Mc=T5((YY1,Lc)=>{function Bc($){if($ instanceof Map)$.clear=$.delete=$.set=function(){throw Error("map is read-only")};else if($ instanceof Set)$.add=$.clear=$.delete=function(){throw Error("set is read-only")};return Object.freeze($),Object.getOwnPropertyNames($).forEach((Z)=>{let J=$[Z],H=typeof J;if((H==="object"||H==="function")&&!Object.isFrozen(J))Bc(J)}),$}class sM{constructor($){if($.data===void 0)$.data={};this.data=$.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Qc($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function L7($,...Z){let J=Object.create(null);for(let H in $)J[H]=$[H];return Z.forEach(function(H){for(let B in H)J[B]=H[B]}),J}var oH0="</span>",tp=($)=>{return!!$.scope},nH0=($,{prefix:Z})=>{if($.startsWith("language:"))return $.replace("language:","language-");if($.includes(".")){let J=$.split(".");return[`${Z}${J.shift()}`,...J.map((H,B)=>`${H}${"_".repeat(B+1)}`)].join(" ")}return`${Z}${$}`};class Xc{constructor($,Z){this.buffer="",this.classPrefix=Z.classPrefix,$.walk(this)}addText($){this.buffer+=Qc($)}openNode($){if(!tp($))return;let Z=nH0($.scope,{prefix:this.classPrefix});this.span(Z)}closeNode($){if(!tp($))return;this.buffer+=oH0}value(){return this.buffer}span($){this.buffer+=`<span class="${$}">`}}var ep=($={})=>{let Z={children:[]};return Object.assign(Z,$),Z};class tM{constructor(){this.rootNode=ep(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add($){this.top.children.push($)}openNode($){let Z=ep({scope:$});this.add(Z),this.stack.push(Z)}closeNode(){if(this.stack.length>1)return this.stack.pop();return}closeAllNodes(){while(this.closeNode());}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk($){return this.constructor._walk($,this.rootNode)}static _walk($,Z){if(typeof Z==="string")$.addText(Z);else if(Z.children)$.openNode(Z),Z.children.forEach((J)=>this._walk($,J)),$.closeNode(Z);return $}static _collapse($){if(typeof $==="string")return;if(!$.children)return;if($.children.every((Z)=>typeof Z==="string"))$.children=[$.children.join("")];else $.children.forEach((Z)=>{tM._collapse(Z)})}}class zc extends tM{constructor($){super();this.options=$}addText($){if($==="")return;this.add($)}startScope($){this.openNode($)}endScope(){this.closeNode()}__addSublanguage($,Z){let J=$.root;if(Z)J.scope=`language:${Z}`;this.add(J)}toHTML(){return new Xc(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function GX($){if(!$)return null;if(typeof $==="string")return $;return $.source}function Gc($){return t$("(?=",$,")")}function sH0($){return t$("(?:",$,")*")}function tH0($){return t$("(?:",$,")?")}function t$(...$){return $.map((J)=>GX(J)).join("")}function eH0($){let Z=$[$.length-1];if(typeof Z==="object"&&Z.constructor===Object)return $.splice($.length-1,1),Z;else return{}}function eM(...$){return"("+(eH0($).capture?"":"?:")+$.map((H)=>GX(H)).join("|")+")"}function Uc($){return new RegExp($.toString()+"|").exec("").length-1}function $B0($,Z){let J=$&&$.exec(Z);return J&&J.index===0}var ZB0=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function $P($,{joinWith:Z}){let J=0;return $.map((H)=>{J+=1;let B=J,Q=GX(H),X="";while(Q.length>0){let z=ZB0.exec(Q);if(!z){X+=Q;break}if(X+=Q.substring(0,z.index),Q=Q.substring(z.index+z[0].length),z[0][0]==="\\"&&z[1])X+="\\"+String(Number(z[1])+B);else if(X+=z[0],z[0]==="(")J++}return X}).map((H)=>`(${H})`).join(Z)}var JB0=/\b\B/,Yc="[a-zA-Z]\\w*",ZP="[a-zA-Z_]\\w*",Kc="\\b\\d+(\\.\\d+)?",Fc="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Wc="\\b(0b[01]+)",HB0="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",BB0=($={})=>{let Z=/^#![ ]*\//;if($.binary)$.begin=t$(Z,/.*\b/,$.binary,/\b.*/);return L7({scope:"meta",begin:Z,end:/$/,relevance:0,"on:begin":(J,H)=>{if(J.index!==0)H.ignoreMatch()}},$)},UX={begin:"\\\\[\\s\\S]",relevance:0},QB0={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[UX]},XB0={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[UX]},zB0={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},_W=function($,Z,J={}){let H=L7({scope:"comment",begin:$,end:Z,contains:[]},J);H.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let B=eM("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return H.contains.push({begin:t$(/[ ]+/,"(",B,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),H},GB0=_W("//","$"),UB0=_W("/\\*","\\*/"),YB0=_W("#","$"),KB0={scope:"number",begin:Kc,relevance:0},FB0={scope:"number",begin:Fc,relevance:0},WB0={scope:"number",begin:Wc,relevance:0},qB0={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[UX,{begin:/\[/,end:/\]/,relevance:0,contains:[UX]}]},NB0={scope:"title",begin:Yc,relevance:0},AB0={scope:"title",begin:ZP,relevance:0},DB0={begin:"\\.\\s*"+ZP,relevance:0},VB0=function($){return Object.assign($,{"on:begin":(Z,J)=>{J.data._beginMatch=Z[1]},"on:end":(Z,J)=>{if(J.data._beginMatch!==Z[1])J.ignoreMatch()}})},MW=Object.freeze({__proto__:null,APOS_STRING_MODE:QB0,BACKSLASH_ESCAPE:UX,BINARY_NUMBER_MODE:WB0,BINARY_NUMBER_RE:Wc,COMMENT:_W,C_BLOCK_COMMENT_MODE:UB0,C_LINE_COMMENT_MODE:GB0,C_NUMBER_MODE:FB0,C_NUMBER_RE:Fc,END_SAME_AS_BEGIN:VB0,HASH_COMMENT_MODE:YB0,IDENT_RE:Yc,MATCH_NOTHING_RE:JB0,METHOD_GUARD:DB0,NUMBER_MODE:KB0,NUMBER_RE:Kc,PHRASAL_WORDS_MODE:zB0,QUOTE_STRING_MODE:XB0,REGEXP_MODE:qB0,RE_STARTERS_RE:HB0,SHEBANG:BB0,TITLE_MODE:NB0,UNDERSCORE_IDENT_RE:ZP,UNDERSCORE_TITLE_MODE:AB0});function LB0($,Z){if($.input[$.index-1]===".")Z.ignoreMatch()}function MB0($,Z){if($.className!==void 0)$.scope=$.className,delete $.className}function PB0($,Z){if(!Z)return;if(!$.beginKeywords)return;if($.begin="\\b("+$.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",$.__beforeBegin=LB0,$.keywords=$.keywords||$.beginKeywords,delete $.beginKeywords,$.relevance===void 0)$.relevance=0}function _B0($,Z){if(!Array.isArray($.illegal))return;$.illegal=eM(...$.illegal)}function jB0($,Z){if(!$.match)return;if($.begin||$.end)throw Error("begin & end are not supported with match");$.begin=$.match,delete $.match}function OB0($,Z){if($.relevance===void 0)$.relevance=1}var TB0=($,Z)=>{if(!$.beforeMatch)return;if($.starts)throw Error("beforeMatch cannot be used with starts");let J=Object.assign({},$);Object.keys($).forEach((H)=>{delete $[H]}),$.keywords=J.keywords,$.begin=t$(J.beforeMatch,Gc(J.begin)),$.starts={relevance:0,contains:[Object.assign(J,{endsParent:!0})]},$.relevance=0,delete J.beforeMatch},CB0=["of","and","for","in","not","or","if","then","parent","list","value"],EB0="keyword";function qc($,Z,J=EB0){let H=Object.create(null);if(typeof $==="string")B(J,$.split(" "));else if(Array.isArray($))B(J,$);else Object.keys($).forEach(function(Q){Object.assign(H,qc($[Q],Z,Q))});return H;function B(Q,X){if(Z)X=X.map((z)=>z.toLowerCase());X.forEach(function(z){let G=z.split("|");H[G[0]]=[Q,bB0(G[0],G[1])]})}}function bB0($,Z){if(Z)return Number(Z);return wB0($)?0:1}function wB0($){return CB0.includes($.toLowerCase())}var $c={},s$=($)=>{console.error($)},Zc=($,...Z)=>{console.log(`WARN: ${$}`,...Z)},WH=($,Z)=>{if($c[`${$}/${Z}`])return;console.log(`Deprecated as of ${$}. ${Z}`),$c[`${$}/${Z}`]=!0},PW=Error();function Nc($,Z,{key:J}){let H=0,B=$[J],Q={},X={};for(let z=1;z<=Z.length;z++)X[z+H]=B[z],Q[z+H]=!0,H+=Uc(Z[z-1]);$[J]=X,$[J]._emit=Q,$[J]._multi=!0}function SB0($){if(!Array.isArray($.begin))return;if($.skip||$.excludeBegin||$.returnBegin)throw s$("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),PW;if(typeof $.beginScope!=="object"||$.beginScope===null)throw s$("beginScope must be object"),PW;Nc($,$.begin,{key:"beginScope"}),$.begin=$P($.begin,{joinWith:""})}function RB0($){if(!Array.isArray($.end))return;if($.skip||$.excludeEnd||$.returnEnd)throw s$("skip, excludeEnd, returnEnd not compatible with endScope: {}"),PW;if(typeof $.endScope!=="object"||$.endScope===null)throw s$("endScope must be object"),PW;Nc($,$.end,{key:"endScope"}),$.end=$P($.end,{joinWith:""})}function kB0($){if($.scope&&typeof $.scope==="object"&&$.scope!==null)$.beginScope=$.scope,delete $.scope}function IB0($){if(kB0($),typeof $.beginScope==="string")$.beginScope={_wrap:$.beginScope};if(typeof $.endScope==="string")$.endScope={_wrap:$.endScope};SB0($),RB0($)}function yB0($){function Z(X,z){return new RegExp(GX(X),"m"+($.case_insensitive?"i":"")+($.unicodeRegex?"u":"")+(z?"g":""))}class J{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(X,z){z.position=this.position++,this.matchIndexes[this.matchAt]=z,this.regexes.push([z,X]),this.matchAt+=Uc(X)+1}compile(){if(this.regexes.length===0)this.exec=()=>null;let X=this.regexes.map((z)=>z[1]);this.matcherRe=Z($P(X,{joinWith:"|"}),!0),this.lastIndex=0}exec(X){this.matcherRe.lastIndex=this.lastIndex;let z=this.matcherRe.exec(X);if(!z)return null;let G=z.findIndex((Y,K)=>K>0&&Y!==void 0),U=this.matchIndexes[G];return z.splice(0,G),Object.assign(z,U)}}class H{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(X){if(this.multiRegexes[X])return this.multiRegexes[X];let z=new J;return this.rules.slice(X).forEach(([G,U])=>z.addRule(G,U)),z.compile(),this.multiRegexes[X]=z,z}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(X,z){if(this.rules.push([X,z]),z.type==="begin")this.count++}exec(X){let z=this.getMatcher(this.regexIndex);z.lastIndex=this.lastIndex;let G=z.exec(X);if(this.resumingScanAtSamePosition())if(G&&G.index===this.lastIndex);else{let U=this.getMatcher(0);U.lastIndex=this.lastIndex+1,G=U.exec(X)}if(G){if(this.regexIndex+=G.position+1,this.regexIndex===this.count)this.considerAll()}return G}}function B(X){let z=new H;if(X.contains.forEach((G)=>z.addRule(G.begin,{rule:G,type:"begin"})),X.terminatorEnd)z.addRule(X.terminatorEnd,{type:"end"});if(X.illegal)z.addRule(X.illegal,{type:"illegal"});return z}function Q(X,z){let G=X;if(X.isCompiled)return G;[MB0,jB0,IB0,TB0].forEach((Y)=>Y(X,z)),$.compilerExtensions.forEach((Y)=>Y(X,z)),X.__beforeBegin=null,[PB0,_B0,OB0].forEach((Y)=>Y(X,z)),X.isCompiled=!0;let U=null;if(typeof X.keywords==="object"&&X.keywords.$pattern)X.keywords=Object.assign({},X.keywords),U=X.keywords.$pattern,delete X.keywords.$pattern;if(U=U||/\w+/,X.keywords)X.keywords=qc(X.keywords,$.case_insensitive);if(G.keywordPatternRe=Z(U,!0),z){if(!X.begin)X.begin=/\B|\b/;if(G.beginRe=Z(G.begin),!X.end&&!X.endsWithParent)X.end=/\B|\b/;if(X.end)G.endRe=Z(G.end);if(G.terminatorEnd=GX(G.end)||"",X.endsWithParent&&z.terminatorEnd)G.terminatorEnd+=(X.end?"|":"")+z.terminatorEnd}if(X.illegal)G.illegalRe=Z(X.illegal);if(!X.contains)X.contains=[];if(X.contains=[].concat(...X.contains.map(function(Y){return xB0(Y==="self"?X:Y)})),X.contains.forEach(function(Y){Q(Y,G)}),X.starts)Q(X.starts,z);return G.matcher=B(G),G}if(!$.compilerExtensions)$.compilerExtensions=[];if($.contains&&$.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return $.classNameAliases=L7($.classNameAliases||{}),Q($)}function Ac($){if(!$)return!1;return $.endsWithParent||Ac($.starts)}function xB0($){if($.variants&&!$.cachedVariants)$.cachedVariants=$.variants.map(function(Z){return L7($,{variants:null},Z)});if($.cachedVariants)return $.cachedVariants;if(Ac($))return L7($,{starts:$.starts?L7($.starts):null});if(Object.isFrozen($))return L7($);return $}var hB0="11.11.1";class Dc extends Error{constructor($,Z){super($);this.name="HTMLInjectionError",this.html=Z}}var nM=Qc,Jc=L7,Hc=Symbol("nomatch"),vB0=7,Vc=function($){let Z=Object.create(null),J=Object.create(null),H=[],B=!0,Q="Could not find the language '{}', did you forget to load/include a language module?",X={disableAutodetect:!0,name:"Plain text",contains:[]},z={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:zc};function G(I){return z.noHighlightRe.test(I)}function U(I){let x=I.className+" ";x+=I.parentNode?I.parentNode.className:"";let v=z.languageDetectRe.exec(x);if(v){let g=T(v[1]);if(!g)Zc(Q.replace("{}",v[1])),Zc("Falling back to no-highlight mode for this block.",I);return g?v[1]:"no-highlight"}return x.split(/\s+/).find((g)=>G(g)||T(g))}function Y(I,x,v){let g="",E="";if(typeof x==="object")g=I,v=x.ignoreIllegals,E=x.language;else WH("10.7.0","highlight(lang, code, ...args) has been deprecated."),WH("10.7.0",`Please use highlight(code, options) instead.
3
- https://github.com/highlightjs/highlight.js/issues/2277`),E=I,g=x;if(v===void 0)v=!0;let l={code:g,language:E};O("before:highlight",l);let r=l.result?l.result:K(l.language,l.code,v);return r.code=l.code,O("after:highlight",r),r}function K(I,x,v,g){let E=Object.create(null);function l(f,u){return f.keywords[u]}function r(){if(!a.keywords){$0.addText(Q0);return}let f=0;a.keywordPatternRe.lastIndex=0;let u=a.keywordPatternRe.exec(Q0),t="";while(u){t+=Q0.substring(f,u.index);let W0=D0.case_insensitive?u[0].toLowerCase():u[0],S0=l(a,W0);if(S0){let[p0,g0]=S0;if($0.addText(t),t="",E[W0]=(E[W0]||0)+1,E[W0]<=vB0)_0+=g0;if(p0.startsWith("_"))t+=u[0];else{let T0=D0.classNameAliases[p0]||p0;o(u[0],T0)}}else t+=u[0];f=a.keywordPatternRe.lastIndex,u=a.keywordPatternRe.exec(Q0)}t+=Q0.substring(f),$0.addText(t)}function h(){if(Q0==="")return;let f=null;if(typeof a.subLanguage==="string"){if(!Z[a.subLanguage]){$0.addText(Q0);return}f=K(a.subLanguage,Q0,!0,e[a.subLanguage]),e[a.subLanguage]=f._top}else f=W(Q0,a.subLanguage.length?a.subLanguage:null);if(a.relevance>0)_0+=f.relevance;$0.__addSublanguage(f._emitter,f.language)}function d(){if(a.subLanguage!=null)h();else r();Q0=""}function o(f,u){if(f==="")return;$0.startScope(u),$0.addText(f),$0.endScope()}function p(f,u){let t=1,W0=u.length-1;while(t<=W0){if(!f._emit[t]){t++;continue}let S0=D0.classNameAliases[f[t]]||f[t],p0=u[t];if(S0)o(p0,S0);else Q0=p0,r(),Q0="";t++}}function i(f,u){if(f.scope&&typeof f.scope==="string")$0.openNode(D0.classNameAliases[f.scope]||f.scope);if(f.beginScope){if(f.beginScope._wrap)o(Q0,D0.classNameAliases[f.beginScope._wrap]||f.beginScope._wrap),Q0="";else if(f.beginScope._multi)p(f.beginScope,u),Q0=""}return a=Object.create(f,{parent:{value:a}}),a}function n(f,u,t){let W0=$B0(f.endRe,t);if(W0){if(f["on:end"]){let S0=new sM(f);if(f["on:end"](u,S0),S0.isMatchIgnored)W0=!1}if(W0){while(f.endsParent&&f.parent)f=f.parent;return f}}if(f.endsWithParent)return n(f.parent,u,t)}function Z0(f){if(a.matcher.regexIndex===0)return Q0+=f[0],1;else return L0=!0,0}function J0(f){let u=f[0],t=f.rule,W0=new sM(t),S0=[t.__beforeBegin,t["on:begin"]];for(let p0 of S0){if(!p0)continue;if(p0(f,W0),W0.isMatchIgnored)return Z0(u)}if(t.skip)Q0+=u;else{if(t.excludeBegin)Q0+=u;if(d(),!t.returnBegin&&!t.excludeBegin)Q0=u}return i(t,f),t.returnBegin?0:u.length}function U0(f){let u=f[0],t=x.substring(f.index),W0=n(a,f,t);if(!W0)return Hc;let S0=a;if(a.endScope&&a.endScope._wrap)d(),o(u,a.endScope._wrap);else if(a.endScope&&a.endScope._multi)d(),p(a.endScope,f);else if(S0.skip)Q0+=u;else{if(!(S0.returnEnd||S0.excludeEnd))Q0+=u;if(d(),S0.excludeEnd)Q0=u}do{if(a.scope)$0.closeNode();if(!a.skip&&!a.subLanguage)_0+=a.relevance;a=a.parent}while(a!==W0.parent);if(W0.starts)i(W0.starts,f);return S0.returnEnd?0:u.length}function z0(){let f=[];for(let u=a;u!==D0;u=u.parent)if(u.scope)f.unshift(u.scope);f.forEach((u)=>$0.openNode(u))}let B0={};function N0(f,u){let t=u&&u[0];if(Q0+=f,t==null)return d(),0;if(B0.type==="begin"&&u.type==="end"&&B0.index===u.index&&t===""){if(Q0+=x.slice(u.index,u.index+1),!B){let W0=Error(`0 width match regex (${I})`);throw W0.languageName=I,W0.badRule=B0.rule,W0}return 1}if(B0=u,u.type==="begin")return J0(u);else if(u.type==="illegal"&&!v){let W0=Error('Illegal lexeme "'+t+'" for mode "'+(a.scope||"<unnamed>")+'"');throw W0.mode=a,W0}else if(u.type==="end"){let W0=U0(u);if(W0!==Hc)return W0}if(u.type==="illegal"&&t==="")return Q0+=`
4
- `,1;if(A0>1e5&&A0>u.index*3)throw Error("potential infinite loop, way more iterations than matches");return Q0+=t,t.length}let D0=T(I);if(!D0)throw s$(Q.replace("{}",I)),Error('Unknown language: "'+I+'"');let F0=yB0(D0),s="",a=g||F0,e={},$0=new z.__emitter(z);z0();let Q0="",_0=0,M0=0,A0=0,L0=!1;try{if(!D0.__emitTokens){a.matcher.considerAll();for(;;){if(A0++,L0)L0=!1;else a.matcher.considerAll();a.matcher.lastIndex=M0;let f=a.matcher.exec(x);if(!f)break;let u=x.substring(M0,f.index),t=N0(u,f);M0=f.index+t}N0(x.substring(M0))}else D0.__emitTokens(x,$0);return $0.finalize(),s=$0.toHTML(),{language:I,value:s,relevance:_0,illegal:!1,_emitter:$0,_top:a}}catch(f){if(f.message&&f.message.includes("Illegal"))return{language:I,value:nM(x),illegal:!0,relevance:0,_illegalBy:{message:f.message,index:M0,context:x.slice(M0-100,M0+100),mode:f.mode,resultSoFar:s},_emitter:$0};else if(B)return{language:I,value:nM(x),illegal:!1,relevance:0,errorRaised:f,_emitter:$0,_top:a};else throw f}}function F(I){let x={value:nM(I),illegal:!1,relevance:0,_top:X,_emitter:new z.__emitter(z)};return x._emitter.addText(I),x}function W(I,x){x=x||z.languages||Object.keys(Z);let v=F(I),g=x.filter(T).filter(C).map((d)=>K(d,I,!1));g.unshift(v);let E=g.sort((d,o)=>{if(d.relevance!==o.relevance)return o.relevance-d.relevance;if(d.language&&o.language){if(T(d.language).supersetOf===o.language)return 1;else if(T(o.language).supersetOf===d.language)return-1}return 0}),[l,r]=E,h=l;return h.secondBest=r,h}function q(I,x,v){let g=x&&J[x]||v;I.classList.add("hljs"),I.classList.add(`language-${g}`)}function N(I){let x=null,v=U(I);if(G(v))return;if(O("before:highlightElement",{el:I,language:v}),I.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",I);return}if(I.children.length>0){if(!z.ignoreUnescapedHTML)console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(I);if(z.throwUnescapedHTML)throw new Dc("One of your code blocks includes unescaped HTML.",I.innerHTML)}x=I;let g=x.textContent,E=v?Y(g,{language:v,ignoreIllegals:!0}):W(g);if(I.innerHTML=E.value,I.dataset.highlighted="yes",q(I,v,E.language),I.result={language:E.language,re:E.relevance,relevance:E.relevance},E.secondBest)I.secondBest={language:E.secondBest.language,relevance:E.secondBest.relevance};O("after:highlightElement",{el:I,result:E,text:g})}function D(I){z=Jc(z,I)}let A=()=>{j(),WH("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function V(){j(),WH("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let L=!1;function j(){function I(){j()}if(document.readyState==="loading"){if(!L)window.addEventListener("DOMContentLoaded",I,!1);L=!0;return}document.querySelectorAll(z.cssSelector).forEach(N)}function M(I,x){let v=null;try{v=x($)}catch(g){if(s$("Language definition for '{}' could not be registered.".replace("{}",I)),!B)throw g;else s$(g);v=X}if(!v.name)v.name=I;if(Z[I]=v,v.rawDefinition=x.bind(null,$),v.aliases)b(v.aliases,{languageName:I})}function _(I){delete Z[I];for(let x of Object.keys(J))if(J[x]===I)delete J[x]}function w(){return Object.keys(Z)}function T(I){return I=(I||"").toLowerCase(),Z[I]||Z[J[I]]}function b(I,{languageName:x}){if(typeof I==="string")I=[I];I.forEach((v)=>{J[v.toLowerCase()]=x})}function C(I){let x=T(I);return x&&!x.disableAutodetect}function k(I){if(I["before:highlightBlock"]&&!I["before:highlightElement"])I["before:highlightElement"]=(x)=>{I["before:highlightBlock"](Object.assign({block:x.el},x))};if(I["after:highlightBlock"]&&!I["after:highlightElement"])I["after:highlightElement"]=(x)=>{I["after:highlightBlock"](Object.assign({block:x.el},x))}}function S(I){k(I),H.push(I)}function R(I){let x=H.indexOf(I);if(x!==-1)H.splice(x,1)}function O(I,x){let v=I;H.forEach(function(g){if(g[v])g[v](x)})}function y(I){return WH("10.7.0","highlightBlock will be removed entirely in v12.0"),WH("10.7.0","Please use highlightElement now."),N(I)}Object.assign($,{highlight:Y,highlightAuto:W,highlightAll:j,highlightElement:N,highlightBlock:y,configure:D,initHighlighting:A,initHighlightingOnLoad:V,registerLanguage:M,unregisterLanguage:_,listLanguages:w,getLanguage:T,registerAliases:b,autoDetection:C,inherit:Jc,addPlugin:S,removePlugin:R}),$.debugMode=function(){B=!1},$.safeMode=function(){B=!0},$.versionString=hB0,$.regex={concat:t$,lookahead:Gc,either:eM,optional:tH0,anyNumberOfTimes:sH0};for(let I in MW)if(typeof MW[I]==="object")Bc(MW[I]);return Object.assign($,MW),$},qH=Vc({});qH.newInstance=()=>Vc({});Lc.exports=qH;qH.HighlightJS=qH;qH.default=qH});var Ml=T5((UA1,Ll)=>{var Uz0=["||","&&",";;","|&","<(","<<<",">>",">&","<&","&",";","(",")","|","<",">"],Vl=/[\n\r\u2028\u2029]/,Yz0=/[\s#!"$&'():;<=>@\\^`|]/g;Ll.exports=function(Z){return Z.map(function(J){if(J==="")return"''";if(J&&typeof J==="object"){if("op"in J&&J.op==="glob"){if(typeof J.pattern!=="string")throw TypeError("glob token requires a string `pattern`");if(Vl.test(J.pattern))throw TypeError("glob `pattern` must not contain line terminators");return J.pattern.replace(Yz0,"\\$&")}if("op"in J&&typeof J.op==="string"){if(Uz0.indexOf(J.op)<0)throw TypeError("invalid `op` value: "+JSON.stringify(J.op));return J.op.replace(/[\s\S]/g,"\\$&")}if("comment"in J&&typeof J.comment==="string"){if(Vl.test(J.comment))throw TypeError("`comment` must not contain line terminators");return"#"+J.comment}throw TypeError("unrecognized object token shape")}if(/["\s\\]/.test(J)&&!/'/.test(J))return"'"+J.replace(/(['])/g,"\\$1")+"'";if(/["'\s]/.test(J))return'"'+J.replace(/(["\\$`!])/g,"\\$1")+'"';return String(J).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}~])/g,"$1\\$2")}).join(" ")}});var El=T5((YA1,Cl)=>{var Tl="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",Pl=new RegExp("^"+Tl+"$"),_l="|&;()<> \\t",Kz0="'([^']*?)'",Fz0='"((\\\\"|[^"])*?)"',Wz0=/^#$/,jl="'",Ol='"',kW="$",ZZ="",qz0=4294967296;for(IW=0;IW<4;IW++)ZZ+=(qz0*Math.random()).toString(16);var IW,Nz0=new RegExp("^"+ZZ);function Az0($,Z){var J=Z.lastIndex,H=[],B;while(B=Z.exec($))if(H[H.length]=B,Z.lastIndex===B.index)Z.lastIndex+=1;return Z.lastIndex=J,H}function Dz0($,Z,J){var H=typeof $==="function"?$(J):$[J];if(typeof H>"u"&&J!="")H="";else if(typeof H>"u")H="$";if(typeof H==="object")return Z+ZZ+JSON.stringify(H)+ZZ;return Z+H}function Vz0($,Z,J){if(!J)J={};var H=J.escape||"\\",B=J.splitUnquoted===!0?`
5
- `:typeof J.splitUnquoted==="string"?J.splitUnquoted:"",Q="(\\"+H+`['"`+_l+`]|[^\\s'"`+_l+"])+",X=new RegExp(["("+Tl+")","("+Q+"|"+Fz0+"|"+Kz0+")+"].join("|"),"g"),z=Az0($,X);if(z.length===0)return[];if(!Z)Z={};var G=!1;return z.map(function(U){var Y=U[0];if(!Y||G)return;if(Pl.test(Y))return{op:Y};var K=!1,F=!1,W="",q=[],N=!1,D=null,A=!1,V;function L(){V+=1;var k,S,R=Y.charAt(V);if(R==="{"){if(V+=1,Y.charAt(V)==="}")throw Error("Bad substitution: "+Y.slice(V-2,V+1));var O=1;k=V;while(O>0&&k<Y.length){if(Y.charAt(k)==="{"&&Y.charAt(k-1)==="$")O+=1;else if(Y.charAt(k)==="}")O-=1;k+=1}if(O!==0)throw Error("Bad substitution: "+Y.slice(V));k-=1,S=Y.slice(V,k),V=k}else if(/[*@#?$!_-]/.test(R))S=R,V+=1;else{var y=Y.slice(V);if(k=y.match(/[^\w\d_]/),!k)S=y,V=Y.length;else S=y.slice(0,k.index),V+=k.index-1}return Dz0(Z,"",S)}function j(){if(D===null)return;if(D===0){if(W!=="")q[q.length]=W,W=""}else{q[q.length]=W,W="";for(var k=1;k<D;k+=1)q[q.length]=""}D=null}for(V=0;V<Y.length;V++){var M=Y.charAt(V);if(B&&M!==kW)j();if(A=A||!K&&(M==="*"||M==="?"),F)W+=M,F=!1;else if(K)if(M===K)K=!1;else if(K==jl)W+=M;else if(M===H)if(V+=1,M=Y.charAt(V),M===Ol||M===H||M===kW)W+=M;else W+=H+M;else if(M===kW)W+=L();else W+=M;else if(M===Ol||M===jl)K=M,N=!0;else if(Pl.test(M))return{op:Y};else if(Wz0.test(M)){G=!0;var _={comment:$.slice(U.index+V+1)};if(W.length)return[W,_];return[_]}else if(M===H)F=!0;else if(M===kW){var w=L();if(!B)W+=w;else for(var T=0;T<w.length;T+=1){var b=w.charAt(T);if(B.indexOf(b)<0)j(),W+=b;else if(D===null)D=b===" "||b==="\t"||b===`
6
- `?0:1;else if(b!==" "&&b!=="\t"&&b!==`
7
- `)D+=1}}else W+=M}if(A)return{op:"glob",pattern:W};if(B){if(D!==null&&D>0){q[q.length]=W,W="";for(var C=1;C<D;C+=1)q[q.length]=""}if(W!==""||N&&q.length===0)q[q.length]=W;return q}return W}).reduce(function(U,Y){if(typeof Y>"u")return U;return[].concat(Y).forEach(function(K){U[U.length]=K}),U},[])}Cl.exports=function(Z,J,H){var B=Vz0(Z,J,H);if(typeof J!=="function")return B;return B.reduce(function(Q,X){if(typeof X==="object")return Q[Q.length]=X,Q;var z=X.split(RegExp("("+ZZ+".*?"+ZZ+")","g"));if(z.length===1)return Q[Q.length]=z[0],Q;return z.filter(Boolean).forEach(function(G){Q[Q.length]=Nz0.test(G)?JSON.parse(G.split(ZZ)[1]):G}),Q},[])}});var Wi=T5((QV1,Fi)=>{var wG0="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";Fi.exports=wG0});var Di=T5((XV1,Ai)=>{var SG0=Wi();function qi(){}function Ni(){}Ni.resetWarningCache=qi;Ai.exports=function(){function $(H,B,Q,X,z,G){if(G===SG0)return;var U=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw U.name="Invariant Violation",U}$.isRequired=$;function Z(){return $}var J={array:$,bigint:$,bool:$,func:$,number:$,object:$,string:$,symbol:$,any:$,arrayOf:Z,element:$,elementType:$,instanceOf:Z,node:$,objectOf:Z,oneOf:Z,oneOfType:Z,shape:Z,exact:Z,checkPropTypes:Ni,resetWarningCache:qi};return J.PropTypes=J,J}});var DX=T5((zV1,Vi)=>{Vi.exports=Di()();var RG0,kG0});var Pi=T5((GV1,Y_)=>{function Mi($){var Z,J,H="";if(typeof $=="string"||typeof $=="number")H+=$;else if(typeof $=="object")if(Array.isArray($)){var B=$.length;for(Z=0;Z<B;Z++)$[Z]&&(J=Mi($[Z]))&&(H&&(H+=" "),H+=J)}else for(J in $)$[J]&&(H&&(H+=" "),H+=J);return H}function Li(){for(var $,Z,J=0,H="",B=arguments.length;J<B;J++)($=arguments[J])&&(Z=Mi($))&&(H&&(H+=" "),H+=Z);return H}Y_.exports=Li,Y_.exports.clsx=Li});var VX=T5((_i)=>{Object.defineProperty(_i,"__esModule",{value:!0});_i.dontSetMe=vG0;_i.findInArray=IG0;_i.int=hG0;_i.isFunction=yG0;_i.isNum=xG0;function IG0($,Z){for(let J=0,H=$.length;J<H;J++)if(Z.apply(Z,[$[J],J,$]))return $[J]}function yG0($){return typeof $==="function"||Object.prototype.toString.call($)==="[object Function]"}function xG0($){return typeof $==="number"&&!isNaN($)}function hG0($){return parseInt($,10)}function vG0($,Z,J){if($[Z])return Error(`Invalid prop ${Z} passed to ${J} - do not set this, set it on the child.`)}});var Ei=T5((Ti)=>{Object.defineProperty(Ti,"__esModule",{value:!0});Ti.browserPrefixToKey=Oi;Ti.browserPrefixToStyle=cG0;Ti.default=void 0;Ti.getPrefix=ji;var K_=["Moz","Webkit","O","ms"];function ji(){let $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";let Z=window.document?.documentElement?.style;if(!Z)return"";if($ in Z)return"";for(let J=0;J<K_.length;J++)if(Oi($,K_[J])in Z)return K_[J];return""}function Oi($,Z){return Z?`${Z}${dG0($)}`:$}function cG0($,Z){return Z?`-${Z.toLowerCase()}-${$}`:$}function dG0($){let Z="",J=!0;for(let H=0;H<$.length;H++)if(J)Z+=$[H].toUpperCase(),J=!1;else if($[H]==="-")J=!0;else Z+=$[H];return Z}var YV1=Ti.default=ji()});var mW=T5((yi)=>{Object.defineProperty(yi,"__esModule",{value:!0});yi.addClassName=ki;yi.addEvent=oG0;yi.addUserSelectStyles=XU0;yi.createCSSTransform=JU0;yi.createSVGTransform=HU0;yi.getTouch=BU0;yi.getTouchIdentifier=QU0;yi.getTranslation=F_;yi.innerHeight=eG0;yi.innerWidth=$U0;yi.matchesSelector=Ri;yi.matchesSelectorAndParentsTo=aG0;yi.offsetXYFromParent=ZU0;yi.outerHeight=sG0;yi.outerWidth=tG0;yi.removeClassName=Ii;yi.removeEvent=nG0;yi.scheduleRemoveUserSelectStyles=zU0;var q8=VX(),bi=Si(Ei());function Si($,Z){if(typeof WeakMap=="function")var J=new WeakMap,H=new WeakMap;return(Si=function(B,Q){if(!Q&&B&&B.__esModule)return B;var X,z,G={__proto__:null,default:B};if(B===null||typeof B!="object"&&typeof B!="function")return G;if(X=Q?H:J){if(X.has(B))return X.get(B);X.set(B,G)}for(let U in B)U!=="default"&&{}.hasOwnProperty.call(B,U)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(B,U))&&(z.get||z.set)?X(G,U,z):G[U]=B[U]);return G})($,Z)}var fW="";function Ri($,Z){if(!fW)fW=(0,q8.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(J){return(0,q8.isFunction)($[J])});if(!(0,q8.isFunction)($[fW]))return!1;return $[fW](Z)}function aG0($,Z,J){let H=$;do{if(Ri(H,Z))return!0;if(H===J)return!1;H=H.parentNode}while(H);return!1}function oG0($,Z,J,H){if(!$)return;let B={capture:!0,...H};if($.addEventListener)$.addEventListener(Z,J,B);else if($.attachEvent)$.attachEvent("on"+Z,J);else $["on"+Z]=J}function nG0($,Z,J,H){if(!$)return;let B={capture:!0,...H};if($.removeEventListener)$.removeEventListener(Z,J,B);else if($.detachEvent)$.detachEvent("on"+Z,J);else $["on"+Z]=null}function sG0($){let Z=$.clientHeight,J=$.ownerDocument.defaultView.getComputedStyle($);return Z+=(0,q8.int)(J.borderTopWidth),Z+=(0,q8.int)(J.borderBottomWidth),Z}function tG0($){let Z=$.clientWidth,J=$.ownerDocument.defaultView.getComputedStyle($);return Z+=(0,q8.int)(J.borderLeftWidth),Z+=(0,q8.int)(J.borderRightWidth),Z}function eG0($){let Z=$.clientHeight,J=$.ownerDocument.defaultView.getComputedStyle($);return Z-=(0,q8.int)(J.paddingTop),Z-=(0,q8.int)(J.paddingBottom),Z}function $U0($){let Z=$.clientWidth,J=$.ownerDocument.defaultView.getComputedStyle($);return Z-=(0,q8.int)(J.paddingLeft),Z-=(0,q8.int)(J.paddingRight),Z}function ZU0($,Z,J){let B=Z===Z.ownerDocument.body?{left:0,top:0}:Z.getBoundingClientRect(),Q=($.clientX+Z.scrollLeft-B.left)/J,X=($.clientY+Z.scrollTop-B.top)/J;return{x:Q,y:X}}function JU0($,Z){let J=F_($,Z,"px");return{[(0,bi.browserPrefixToKey)("transform",bi.default)]:J}}function HU0($,Z){return F_($,Z,"")}function F_($,Z,J){let{x:H,y:B}=$,Q=`translate(${H}${J},${B}${J})`;if(Z){let X=`${typeof Z.x==="string"?Z.x:Z.x+J}`,z=`${typeof Z.y==="string"?Z.y:Z.y+J}`;Q=`translate(${X}, ${z})`+Q}return Q}function BU0($,Z){return $.targetTouches&&(0,q8.findInArray)($.targetTouches,(J)=>Z===J.identifier)||$.changedTouches&&(0,q8.findInArray)($.changedTouches,(J)=>Z===J.identifier)}function QU0($){if($.targetTouches&&$.targetTouches[0])return $.targetTouches[0].identifier;if($.changedTouches&&$.changedTouches[0])return $.changedTouches[0].identifier}function XU0($){if(!$)return;let Z=$.getElementById("react-draggable-style-el");if(!Z)Z=$.createElement("style"),Z.type="text/css",Z.id="react-draggable-style-el",Z.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
8
- `,Z.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
9
- `,$.getElementsByTagName("head")[0].appendChild(Z);if($.body)ki($.body,"react-draggable-transparent-selection")}function zU0($){if(window.requestAnimationFrame)window.requestAnimationFrame(()=>{wi($)});else wi($)}function wi($){if(!$)return;try{if($.body)Ii($.body,"react-draggable-transparent-selection");if($.selection)$.selection.empty();else{let Z=($.defaultView||window).getSelection();if(Z&&Z.type!=="Caret")Z.removeAllRanges()}}catch(Z){}}function ki($,Z){if($.classList)$.classList.add(Z);else if(!$.className.match(new RegExp(`(?:^|\\s)${Z}(?!\\S)`)))$.className+=` ${Z}`}function Ii($,Z){if($.classList)$.classList.remove(Z);else $.className=$.className.replace(new RegExp(`(?:^|\\s)${Z}(?!\\S)`,"g"),"")}});var q_=T5((xi)=>{Object.defineProperty(xi,"__esModule",{value:!0});xi.canDragX=bU0;xi.canDragY=wU0;xi.createCoreData=RU0;xi.createDraggableData=kU0;xi.getBoundPosition=CU0;xi.getControlPosition=SU0;xi.snapToGrid=EU0;var N8=VX(),TH=mW();function CU0($,Z,J){if(!$.props.bounds)return[Z,J];let{bounds:H}=$.props;H=typeof H==="string"?H:IU0(H);let B=W_($);if(typeof H==="string"){let{ownerDocument:Q}=B,X=Q.defaultView,z;if(H==="parent")z=B.parentNode;else z=B.getRootNode().querySelector(H);if(!(z instanceof X.HTMLElement))throw Error('Bounds selector "'+H+'" could not find an element.');let G=z,U=X.getComputedStyle(B),Y=X.getComputedStyle(G);H={left:-B.offsetLeft+(0,N8.int)(Y.paddingLeft)+(0,N8.int)(U.marginLeft),top:-B.offsetTop+(0,N8.int)(Y.paddingTop)+(0,N8.int)(U.marginTop),right:(0,TH.innerWidth)(G)-(0,TH.outerWidth)(B)-B.offsetLeft+(0,N8.int)(Y.paddingRight)-(0,N8.int)(U.marginRight),bottom:(0,TH.innerHeight)(G)-(0,TH.outerHeight)(B)-B.offsetTop+(0,N8.int)(Y.paddingBottom)-(0,N8.int)(U.marginBottom)}}if((0,N8.isNum)(H.right))Z=Math.min(Z,H.right);if((0,N8.isNum)(H.bottom))J=Math.min(J,H.bottom);if((0,N8.isNum)(H.left))Z=Math.max(Z,H.left);if((0,N8.isNum)(H.top))J=Math.max(J,H.top);return[Z,J]}function EU0($,Z,J){let H=Math.round(Z/$[0])*$[0],B=Math.round(J/$[1])*$[1];return[H,B]}function bU0($){return $.props.axis==="both"||$.props.axis==="x"}function wU0($){return $.props.axis==="both"||$.props.axis==="y"}function SU0($,Z,J){let H=typeof Z==="number"?(0,TH.getTouch)($,Z):null;if(typeof Z==="number"&&!H)return null;let B=W_(J),Q=J.props.offsetParent||B.offsetParent||B.ownerDocument.body;return(0,TH.offsetXYFromParent)(H||$,Q,J.props.scale)}function RU0($,Z,J){let H=!(0,N8.isNum)($.lastX),B=W_($);if(H)return{node:B,deltaX:0,deltaY:0,lastX:Z,lastY:J,x:Z,y:J};else return{node:B,deltaX:Z-$.lastX,deltaY:J-$.lastY,lastX:$.lastX,lastY:$.lastY,x:Z,y:J}}function kU0($,Z){let J=$.props.scale;return{node:Z.node,x:$.state.x+Z.deltaX/J,y:$.state.y+Z.deltaY/J,deltaX:Z.deltaX/J,deltaY:Z.deltaY/J,lastX:$.state.x,lastY:$.state.y}}function IU0($){return{left:$.left,top:$.top,right:$.right,bottom:$.bottom}}function W_($){let Z=$.findDOMNode();if(!Z)throw Error("<DraggableCore>: Unmounted during event!");return Z}});var N_=T5((hi)=>{Object.defineProperty(hi,"__esModule",{value:!0});hi.default=uU0;function uU0(){}});var mi=T5((gi)=>{var iU0=P(m()),rU0=P(B8());Object.defineProperty(gi,"__esModule",{value:!0});gi.default=void 0;var A_=vi(iU0),R4=V_(DX()),cU0=V_(rU0),A4=mW(),_7=q_(),D_=VX(),LX=V_(N_());function V_($){return $&&$.__esModule?$:{default:$}}function vi($,Z){if(typeof WeakMap=="function")var J=new WeakMap,H=new WeakMap;return(vi=function(B,Q){if(!Q&&B&&B.__esModule)return B;var X,z,G={__proto__:null,default:B};if(B===null||typeof B!="object"&&typeof B!="function")return G;if(X=Q?H:J){if(X.has(B))return X.get(B);X.set(B,G)}for(let U in B)U!=="default"&&{}.hasOwnProperty.call(B,U)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(B,U))&&(z.get||z.set)?X(G,U,z):G[U]=B[U]);return G})($,Z)}function k4($,Z,J){return(Z=dU0(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function dU0($){var Z=lU0($,"string");return typeof Z=="symbol"?Z:Z+""}function lU0($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var H=J.call($,Z||"default");if(typeof H!="object")return H;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}var U9={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},j7=U9.mouse;class MX extends A_.Component{constructor(){super(...arguments);k4(this,"dragging",!1),k4(this,"lastX",NaN),k4(this,"lastY",NaN),k4(this,"touchIdentifier",null),k4(this,"mounted",!1),k4(this,"handleDragStart",($)=>{if(this.props.onMouseDown($),!this.props.allowAnyClick&&typeof $.button==="number"&&$.button!==0)return!1;let Z=this.findDOMNode();if(!Z||!Z.ownerDocument||!Z.ownerDocument.body)throw Error("<DraggableCore> not mounted on DragStart!");let{ownerDocument:J}=Z;if(this.props.disabled||!($.target instanceof J.defaultView.Node)||this.props.handle&&!(0,A4.matchesSelectorAndParentsTo)($.target,this.props.handle,Z)||this.props.cancel&&(0,A4.matchesSelectorAndParentsTo)($.target,this.props.cancel,Z))return;if($.type==="touchstart"&&!this.props.allowMobileScroll)$.preventDefault();let H=(0,A4.getTouchIdentifier)($);this.touchIdentifier=H;let B=(0,_7.getControlPosition)($,H,this);if(B==null)return;let{x:Q,y:X}=B,z=(0,_7.createCoreData)(this,Q,X);if((0,LX.default)("DraggableCore: handleDragStart: %j",z),(0,LX.default)("calling",this.props.onStart),this.props.onStart($,z)===!1||this.mounted===!1)return;if(this.props.enableUserSelectHack)(0,A4.addUserSelectStyles)(J);this.dragging=!0,this.lastX=Q,this.lastY=X,(0,A4.addEvent)(J,j7.move,this.handleDrag),(0,A4.addEvent)(J,j7.stop,this.handleDragStop)}),k4(this,"handleDrag",($)=>{let Z=(0,_7.getControlPosition)($,this.touchIdentifier,this);if(Z==null)return;let{x:J,y:H}=Z;if(Array.isArray(this.props.grid)){let X=J-this.lastX,z=H-this.lastY;if([X,z]=(0,_7.snapToGrid)(this.props.grid,X,z),!X&&!z)return;J=this.lastX+X,H=this.lastY+z}let B=(0,_7.createCoreData)(this,J,H);if((0,LX.default)("DraggableCore: handleDrag: %j",B),this.props.onDrag($,B)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch(X){let z=document.createEvent("MouseEvents");z.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(z)}return}this.lastX=J,this.lastY=H}),k4(this,"handleDragStop",($)=>{if(!this.dragging)return;let Z=(0,_7.getControlPosition)($,this.touchIdentifier,this);if(Z==null)return;let{x:J,y:H}=Z;if(Array.isArray(this.props.grid)){let z=J-this.lastX||0,G=H-this.lastY||0;[z,G]=(0,_7.snapToGrid)(this.props.grid,z,G),J=this.lastX+z,H=this.lastY+G}let B=(0,_7.createCoreData)(this,J,H);if(this.props.onStop($,B)===!1||this.mounted===!1)return!1;let X=this.findDOMNode();if(X){if(this.props.enableUserSelectHack)(0,A4.scheduleRemoveUserSelectStyles)(X.ownerDocument)}if((0,LX.default)("DraggableCore: handleDragStop: %j",B),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,X)(0,LX.default)("DraggableCore: Removing handlers"),(0,A4.removeEvent)(X.ownerDocument,j7.move,this.handleDrag),(0,A4.removeEvent)(X.ownerDocument,j7.stop,this.handleDragStop)}),k4(this,"onMouseDown",($)=>{return j7=U9.mouse,this.handleDragStart($)}),k4(this,"onMouseUp",($)=>{return j7=U9.mouse,this.handleDragStop($)}),k4(this,"onTouchStart",($)=>{return j7=U9.touch,this.handleDragStart($)}),k4(this,"onTouchEnd",($)=>{return j7=U9.touch,this.handleDragStop($)})}componentDidMount(){this.mounted=!0;let $=this.findDOMNode();if($)(0,A4.addEvent)($,U9.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let $=this.findDOMNode();if($){let{ownerDocument:Z}=$;if((0,A4.removeEvent)(Z,U9.mouse.move,this.handleDrag),(0,A4.removeEvent)(Z,U9.touch.move,this.handleDrag),(0,A4.removeEvent)(Z,U9.mouse.stop,this.handleDragStop),(0,A4.removeEvent)(Z,U9.touch.stop,this.handleDragStop),(0,A4.removeEvent)($,U9.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack)(0,A4.scheduleRemoveUserSelectStyles)(Z)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:cU0.default.findDOMNode(this)}render(){return A_.cloneElement(A_.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}gi.default=MX;k4(MX,"displayName","DraggableCore");k4(MX,"propTypes",{allowAnyClick:R4.default.bool,allowMobileScroll:R4.default.bool,children:R4.default.node.isRequired,disabled:R4.default.bool,enableUserSelectHack:R4.default.bool,offsetParent:function($,Z){if($[Z]&&$[Z].nodeType!==1)throw Error("Draggable's offsetParent must be a DOM Node.")},grid:R4.default.arrayOf(R4.default.number),handle:R4.default.string,cancel:R4.default.string,nodeRef:R4.default.object,onStart:R4.default.func,onDrag:R4.default.func,onStop:R4.default.func,onMouseDown:R4.default.func,scale:R4.default.number,className:D_.dontSetMe,style:D_.dontSetMe,transform:D_.dontSetMe});k4(MX,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1})});var di=T5((P_)=>{var tU0=P(m()),eU0=P(B8());Object.defineProperty(P_,"__esModule",{value:!0});Object.defineProperty(P_,"DraggableCore",{enumerable:!0,get:function(){return cW.default}});P_.default=void 0;var uW=pi(tU0),h5=dW(DX()),aU0=dW(eU0),oU0=Pi(),ui=mW(),CH=q_(),L_=VX(),cW=dW(mi()),pW=dW(N_());function dW($){return $&&$.__esModule?$:{default:$}}function pi($,Z){if(typeof WeakMap=="function")var J=new WeakMap,H=new WeakMap;return(pi=function(B,Q){if(!Q&&B&&B.__esModule)return B;var X,z,G={__proto__:null,default:B};if(B===null||typeof B!="object"&&typeof B!="function")return G;if(X=Q?H:J){if(X.has(B))return X.get(B);X.set(B,G)}for(let U in B)U!=="default"&&{}.hasOwnProperty.call(B,U)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(B,U))&&(z.get||z.set)?X(G,U,z):G[U]=B[U]);return G})($,Z)}function M_(){return M_=Object.assign?Object.assign.bind():function($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z];for(var H in J)({}).hasOwnProperty.call(J,H)&&($[H]=J[H])}return $},M_.apply(null,arguments)}function EH($,Z,J){return(Z=nU0(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function nU0($){var Z=sU0($,"string");return typeof Z=="symbol"?Z:Z+""}function sU0($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var H=J.call($,Z||"default");if(typeof H!="object")return H;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}class PX extends uW.Component{static getDerivedStateFromProps($,Z){let{position:J}=$,{prevPropsPosition:H}=Z;if(J&&(!H||J.x!==H.x||J.y!==H.y))return(0,pW.default)("Draggable: getDerivedStateFromProps %j",{position:J,prevPropsPosition:H}),{x:J.x,y:J.y,prevPropsPosition:{...J}};return null}constructor($){super($);if(EH(this,"onDragStart",(Z,J)=>{if((0,pW.default)("Draggable: onDragStart: %j",J),this.props.onStart(Z,(0,CH.createDraggableData)(this,J))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),EH(this,"onDrag",(Z,J)=>{if(!this.state.dragging)return!1;(0,pW.default)("Draggable: onDrag: %j",J);let H=(0,CH.createDraggableData)(this,J),B={x:H.x,y:H.y,slackX:0,slackY:0};if(this.props.bounds){let{x:X,y:z}=B;B.x+=this.state.slackX,B.y+=this.state.slackY;let[G,U]=(0,CH.getBoundPosition)(this,B.x,B.y);B.x=G,B.y=U,B.slackX=this.state.slackX+(X-B.x),B.slackY=this.state.slackY+(z-B.y),H.x=B.x,H.y=B.y,H.deltaX=B.x-this.state.x,H.deltaY=B.y-this.state.y}if(this.props.onDrag(Z,H)===!1)return!1;this.setState(B)}),EH(this,"onDragStop",(Z,J)=>{if(!this.state.dragging)return!1;if(this.props.onStop(Z,(0,CH.createDraggableData)(this,J))===!1)return!1;(0,pW.default)("Draggable: onDragStop: %j",J);let B={dragging:!1,slackX:0,slackY:0};if(Boolean(this.props.position)){let{x:X,y:z}=this.props.position;B.x=X,B.y=z}this.setState(B)}),this.state={dragging:!1,dragged:!1,x:$.position?$.position.x:$.defaultPosition.x,y:$.position?$.position.y:$.defaultPosition.y,prevPropsPosition:{...$.position},slackX:0,slackY:0,isElementSVG:!1},$.position&&!($.onDrag||$.onStop))console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){if(typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement)this.setState({isElementSVG:!0})}componentWillUnmount(){if(this.state.dragging)this.setState({dragging:!1})}findDOMNode(){return this.props?.nodeRef?.current??aU0.default.findDOMNode(this)}render(){let{axis:$,bounds:Z,children:J,defaultPosition:H,defaultClassName:B,defaultClassNameDragging:Q,defaultClassNameDragged:X,position:z,positionOffset:G,scale:U,...Y}=this.props,K={},F=null,q=!Boolean(z)||this.state.dragging,N=z||H,D={x:(0,CH.canDragX)(this)&&q?this.state.x:N.x,y:(0,CH.canDragY)(this)&&q?this.state.y:N.y};if(this.state.isElementSVG)F=(0,ui.createSVGTransform)(D,G);else K=(0,ui.createCSSTransform)(D,G);let A=(0,oU0.clsx)(J.props.className||"",B,{[Q]:this.state.dragging,[X]:this.state.dragged});return uW.createElement(cW.default,M_({},Y,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),uW.cloneElement(uW.Children.only(J),{className:A,style:{...J.props.style,...K},transform:F}))}}P_.default=PX;EH(PX,"displayName","Draggable");EH(PX,"propTypes",{...cW.default.propTypes,axis:h5.default.oneOf(["both","x","y","none"]),bounds:h5.default.oneOfType([h5.default.shape({left:h5.default.number,right:h5.default.number,top:h5.default.number,bottom:h5.default.number}),h5.default.string,h5.default.oneOf([!1])]),defaultClassName:h5.default.string,defaultClassNameDragging:h5.default.string,defaultClassNameDragged:h5.default.string,defaultPosition:h5.default.shape({x:h5.default.number,y:h5.default.number}),positionOffset:h5.default.shape({x:h5.default.oneOfType([h5.default.number,h5.default.string]),y:h5.default.oneOfType([h5.default.number,h5.default.string])}),position:h5.default.shape({x:h5.default.number,y:h5.default.number}),className:L_.dontSetMe,style:L_.dontSetMe,transform:L_.dontSetMe});EH(PX,"defaultProps",{...cW.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})});var iW=T5((DV1,lW)=>{var{default:li,DraggableCore:$Y0}=di();lW.exports=li;lW.exports.default=li;lW.exports.DraggableCore=$Y0});var ai=T5((zY0)=>{var YY0=P(m());zY0.__esModule=!0;zY0.cloneElement=XY0;var ZY0=JY0(YY0);function JY0($){return $&&$.__esModule?$:{default:$}}function ii($,Z){var J=Object.keys($);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols($);Z&&(H=H.filter(function(B){return Object.getOwnPropertyDescriptor($,B).enumerable})),J.push.apply(J,H)}return J}function ri($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z]!=null?arguments[Z]:{};Z%2?ii(Object(J),!0).forEach(function(H){HY0($,H,J[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(J)):ii(Object(J)).forEach(function(H){Object.defineProperty($,H,Object.getOwnPropertyDescriptor(J,H))})}return $}function HY0($,Z,J){return(Z=BY0(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function BY0($){var Z=QY0($,"string");return typeof Z=="symbol"?Z:Z+""}function QY0($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var H=J.call($,Z||"default");if(typeof H!="object")return H;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}function XY0($,Z){if(Z.style&&$.props.style)Z.style=ri(ri({},$.props.style),Z.style);if(Z.className&&$.props.className)Z.className=$.props.className+" "+Z.className;return ZY0.default.cloneElement($,Z)}});var __=T5((FY0)=>{FY0.__esModule=!0;FY0.resizableProps=void 0;var b1=KY0(DX()),LV1=iW();function KY0($){return $&&$.__esModule?$:{default:$}}var MV1=FY0.resizableProps={axis:b1.default.oneOf(["both","x","y","none"]),className:b1.default.string,children:b1.default.element.isRequired,draggableOpts:b1.default.shape({allowAnyClick:b1.default.bool,cancel:b1.default.string,children:b1.default.node,disabled:b1.default.bool,enableUserSelectHack:b1.default.bool,offsetParent:typeof Element<"u"?b1.default.instanceOf(Element):b1.default.any,grid:b1.default.arrayOf(b1.default.number),handle:b1.default.string,nodeRef:b1.default.object,onStart:b1.default.func,onDrag:b1.default.func,onStop:b1.default.func,onMouseDown:b1.default.func,scale:b1.default.number}),height:function(){for(var $=arguments.length,Z=Array($),J=0;J<$;J++)Z[J]=arguments[J];let H=Z[0];if(H.axis==="both"||H.axis==="y")return b1.default.number.isRequired(...Z);return b1.default.number(...Z)},handle:b1.default.oneOfType([b1.default.node,b1.default.func]),handleSize:b1.default.arrayOf(b1.default.number),lockAspectRatio:b1.default.bool,maxConstraints:b1.default.arrayOf(b1.default.number),minConstraints:b1.default.arrayOf(b1.default.number),onResizeStop:b1.default.func,onResizeStart:b1.default.func,onResize:b1.default.func,resizeHandles:b1.default.arrayOf(b1.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:b1.default.number,width:function(){for(var $=arguments.length,Z=Array($),J=0;J<$;J++)Z[J]=arguments[J];let H=Z[0];if(H.axis==="both"||H.axis==="x")return b1.default.number.isRequired(...Z);return b1.default.number(...Z)}}});var T_=T5((_Y0)=>{var OY0=P(m());_Y0.__esModule=!0;_Y0.default=void 0;var bH=si(OY0),qY0=iW(),NY0=ai(),AY0=__(),DY0=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function si($,Z){if(typeof WeakMap=="function")var J=new WeakMap,H=new WeakMap;return(si=function(B,Q){if(!Q&&B&&B.__esModule)return B;var X,z,G={__proto__:null,default:B};if(B===null||typeof B!="object"&&typeof B!="function")return G;if(X=Q?H:J){if(X.has(B))return X.get(B);X.set(B,G)}for(let U in B)U!=="default"&&{}.hasOwnProperty.call(B,U)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(B,U))&&(z.get||z.set)?X(G,U,z):G[U]=B[U]);return G})($,Z)}function O_(){return O_=Object.assign?Object.assign.bind():function($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z];for(var H in J)({}).hasOwnProperty.call(J,H)&&($[H]=J[H])}return $},O_.apply(null,arguments)}function VY0($,Z){if($==null)return{};var J={};for(var H in $)if({}.hasOwnProperty.call($,H)){if(Z.indexOf(H)!==-1)continue;J[H]=$[H]}return J}function ni($,Z){var J=Object.keys($);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols($);Z&&(H=H.filter(function(B){return Object.getOwnPropertyDescriptor($,B).enumerable})),J.push.apply(J,H)}return J}function j_($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z]!=null?arguments[Z]:{};Z%2?ni(Object(J),!0).forEach(function(H){LY0($,H,J[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(J)):ni(Object(J)).forEach(function(H){Object.defineProperty($,H,Object.getOwnPropertyDescriptor(J,H))})}return $}function LY0($,Z,J){return(Z=MY0(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function MY0($){var Z=PY0($,"string");return typeof Z=="symbol"?Z:Z+""}function PY0($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var H=J.call($,Z||"default");if(typeof H!="object")return H;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}class rW extends bH.Component{constructor(){super(...arguments);this.handleRefs={},this.lastHandleRect=null,this.slack=null,this.lastSize=null}componentWillUnmount(){this.resetData()}resetData(){this.lastHandleRect=this.slack=this.lastSize=null}runConstraints($,Z){let J=this.props,H=J.minConstraints,B=J.maxConstraints,Q=J.lockAspectRatio;if(!H&&!B&&!Q)return[$,Z];if(Q){let K=this.props.width/this.props.height,F=$-this.props.width,W=Z-this.props.height;if(Math.abs(F)>Math.abs(W*K))Z=$/K;else $=Z*K}let X=$,z=Z,G=this.slack||[0,0],U=G[0],Y=G[1];if($+=U,Z+=Y,H)$=Math.max(H[0],$),Z=Math.max(H[1],Z);if(B)$=Math.min(B[0],$),Z=Math.min(B[1],Z);return this.slack=[U+(X-$),Y+(z-Z)],[$,Z]}resizeHandler($,Z){return(J,H)=>{var B,Q,X,z;let{node:G,deltaX:U,deltaY:Y}=H;if($==="onResizeStart")this.resetData();let K=(this.props.axis==="both"||this.props.axis==="x")&&Z!=="n"&&Z!=="s",F=(this.props.axis==="both"||this.props.axis==="y")&&Z!=="e"&&Z!=="w";if(!K&&!F)return;let W=Z[0],q=Z[Z.length-1],N=G.getBoundingClientRect();if(this.lastHandleRect!=null){if(q==="w"){let b=N.left-this.lastHandleRect.left;U+=b}if(W==="n"){let b=N.top-this.lastHandleRect.top;Y+=b}}if(this.lastHandleRect=N,q==="w")U=-U;if(W==="n")Y=-Y;let D=(B=(Q=this.lastSize)==null?void 0:Q.width)!=null?B:this.props.width,A=(X=(z=this.lastSize)==null?void 0:z.height)!=null?X:this.props.height,V=D+(K?U/this.props.transformScale:0),L=A+(F?Y/this.props.transformScale:0);var j=this.runConstraints(V,L);if(V=j[0],L=j[1],$==="onResizeStop"&&this.lastSize){var M=this.lastSize;V=M.width,L=M.height}let _=V!==D||L!==A;if($!=="onResizeStop")this.lastSize={width:V,height:L};let w=typeof this.props[$]==="function"?this.props[$]:null;if(w&&!($==="onResize"&&!_))J.persist==null||J.persist(),w(J,{node:G,size:{width:V,height:L},handle:Z});if($==="onResizeStop")this.resetData()}}renderResizeHandle($,Z){let J=this.props.handle;if(!J)return bH.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+$,ref:Z});if(typeof J==="function")return J($,Z);let H=typeof J.type==="string",B=j_({ref:Z},H?{}:{handleAxis:$});return bH.cloneElement(J,B)}render(){let $=this.props,Z=$.children,J=$.className,H=$.draggableOpts,B=$.width,Q=$.height,X=$.handle,z=$.handleSize,G=$.lockAspectRatio,U=$.axis,Y=$.minConstraints,K=$.maxConstraints,F=$.onResize,W=$.onResizeStop,q=$.onResizeStart,N=$.resizeHandles,D=$.transformScale,A=VY0($,DY0);return(0,NY0.cloneElement)(Z,j_(j_({},A),{},{className:(J?J+" ":"")+"react-resizable",children:[...bH.Children.toArray(Z.props.children),...N.map((V)=>{var L;let j=(L=this.handleRefs[V])!=null?L:this.handleRefs[V]=bH.createRef();return bH.createElement(qY0.DraggableCore,O_({},H,{nodeRef:j,key:"resizableHandle-"+V,onStop:this.resizeHandler("onResizeStop",V),onStart:this.resizeHandler("onResizeStart",V),onDrag:this.resizeHandler("onResize",V)}),this.renderResizeHandle(V,j))})]}))}}_Y0.default=rW;rW.propTypes=AY0.resizableProps;rW.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1}});var Hr=T5((IY0)=>{var xY0=P(m());IY0.__esModule=!0;IY0.default=void 0;var C_=Zr(xY0),TY0=$r(DX()),CY0=$r(T_()),EY0=__(),bY0=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function $r($){return $&&$.__esModule?$:{default:$}}function Zr($,Z){if(typeof WeakMap=="function")var J=new WeakMap,H=new WeakMap;return(Zr=function(B,Q){if(!Q&&B&&B.__esModule)return B;var X,z,G={__proto__:null,default:B};if(B===null||typeof B!="object"&&typeof B!="function")return G;if(X=Q?H:J){if(X.has(B))return X.get(B);X.set(B,G)}for(let U in B)U!=="default"&&{}.hasOwnProperty.call(B,U)&&((z=(X=Object.defineProperty)&&Object.getOwnPropertyDescriptor(B,U))&&(z.get||z.set)?X(G,U,z):G[U]=B[U]);return G})($,Z)}function E_(){return E_=Object.assign?Object.assign.bind():function($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z];for(var H in J)({}).hasOwnProperty.call(J,H)&&($[H]=J[H])}return $},E_.apply(null,arguments)}function ei($,Z){var J=Object.keys($);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols($);Z&&(H=H.filter(function(B){return Object.getOwnPropertyDescriptor($,B).enumerable})),J.push.apply(J,H)}return J}function aW($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z]!=null?arguments[Z]:{};Z%2?ei(Object(J),!0).forEach(function(H){wY0($,H,J[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(J)):ei(Object(J)).forEach(function(H){Object.defineProperty($,H,Object.getOwnPropertyDescriptor(J,H))})}return $}function wY0($,Z,J){return(Z=SY0(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function SY0($){var Z=RY0($,"string");return typeof Z=="symbol"?Z:Z+""}function RY0($,Z){if(typeof $!="object"||!$)return $;var J=$[Symbol.toPrimitive];if(J!==void 0){var H=J.call($,Z||"default");if(typeof H!="object")return H;throw TypeError("@@toPrimitive must return a primitive value.")}return(Z==="string"?String:Number)($)}function kY0($,Z){if($==null)return{};var J={};for(var H in $)if({}.hasOwnProperty.call($,H)){if(Z.indexOf(H)!==-1)continue;J[H]=$[H]}return J}class b_ extends C_.Component{constructor(){super(...arguments);this.state={width:this.props.width,height:this.props.height,propsWidth:this.props.width,propsHeight:this.props.height},this.onResize=($,Z)=>{let J=Z.size;if(this.props.onResize)$.persist==null||$.persist(),this.setState(J,()=>this.props.onResize&&this.props.onResize($,Z));else this.setState(J)}}static getDerivedStateFromProps($,Z){if(Z.propsWidth!==$.width||Z.propsHeight!==$.height)return{width:$.width,height:$.height,propsWidth:$.width,propsHeight:$.height};return null}render(){let $=this.props,Z=$.handle,J=$.handleSize,H=$.onResize,B=$.onResizeStart,Q=$.onResizeStop,X=$.draggableOpts,z=$.minConstraints,G=$.maxConstraints,U=$.lockAspectRatio,Y=$.axis,K=$.width,F=$.height,W=$.resizeHandles,q=$.style,N=$.transformScale,D=kY0($,bY0);return C_.createElement(CY0.default,{axis:Y,draggableOpts:X,handle:Z,handleSize:J,height:this.state.height,lockAspectRatio:U,maxConstraints:G,minConstraints:z,onResizeStart:B,onResize:this.onResize,onResizeStop:Q,resizeHandles:W,transformScale:N,width:this.state.width},C_.createElement("div",E_({},D,{style:aW(aW({},q),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}}IY0.default=b_;b_.propTypes=aW(aW({},EY0.resizableProps),{},{children:TY0.default.element})});var w_=T5((OV1,oW)=>{oW.exports=function(){throw Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};oW.exports.Resizable=T_().default;oW.exports.ResizableBox=Hr().default});var ro=T5((cq,io)=>{(function($,Z){typeof cq==="object"&&typeof io<"u"?Z(cq):typeof define==="function"&&define.amd?define(["exports"],Z):($=typeof globalThis<"u"?globalThis:$||self,Z($["fast-equals"]={}))})(cq,function($){function Z(p){return function(n,Z0,J0,U0,z0,B0,N0){return p(n,Z0,N0)}}function J(p){return function(n,Z0,J0,U0){if(!n||!Z0||typeof n!=="object"||typeof Z0!=="object")return p(n,Z0,J0,U0);var z0=U0.get(n),B0=U0.get(Z0);if(z0&&B0)return z0===Z0&&B0===n;U0.set(n,Z0),U0.set(Z0,n);var N0=p(n,Z0,J0,U0);return U0.delete(n),U0.delete(Z0),N0}}function H(p,i){var n={};for(var Z0 in p)n[Z0]=p[Z0];for(var Z0 in i)n[Z0]=i[Z0];return n}function B(p){return p.constructor===Object||p.constructor==null}function Q(p){return typeof p.then==="function"}function X(p,i){return p===i||p!==p&&i!==i}var z="[object Arguments]",G="[object Boolean]",U="[object Date]",Y="[object RegExp]",K="[object Map]",F="[object Number]",W="[object Object]",q="[object Set]",N="[object String]",D=Object.prototype.toString;function A(p){var{areArraysEqual:i,areDatesEqual:n,areMapsEqual:Z0,areObjectsEqual:J0,areRegExpsEqual:U0,areSetsEqual:z0,createIsNestedEqual:B0}=p,N0=B0(D0);function D0(F0,s,a){if(F0===s)return!0;if(!F0||!s||typeof F0!=="object"||typeof s!=="object")return F0!==F0&&s!==s;if(B(F0)&&B(s))return J0(F0,s,N0,a);var e=Array.isArray(F0),$0=Array.isArray(s);if(e||$0)return e===$0&&i(F0,s,N0,a);var Q0=D.call(F0);if(Q0!==D.call(s))return!1;if(Q0===U)return n(F0,s,N0,a);if(Q0===Y)return U0(F0,s,N0,a);if(Q0===K)return Z0(F0,s,N0,a);if(Q0===q)return z0(F0,s,N0,a);if(Q0===W||Q0===z)return Q(F0)||Q(s)?!1:J0(F0,s,N0,a);if(Q0===G||Q0===F||Q0===N)return X(F0.valueOf(),s.valueOf());return!1}return D0}function V(p,i,n,Z0){var J0=p.length;if(i.length!==J0)return!1;while(J0-- >0)if(!n(p[J0],i[J0],J0,J0,p,i,Z0))return!1;return!0}var L=J(V);function j(p,i){return X(p.valueOf(),i.valueOf())}function M(p,i,n,Z0){var J0=p.size===i.size;if(!J0)return!1;if(!p.size)return!0;var U0={},z0=0;return p.forEach(function(B0,N0){if(!J0)return;var D0=!1,F0=0;i.forEach(function(s,a){if(!D0&&!U0[F0]&&(D0=n(N0,a,z0,F0,p,i,Z0)&&n(B0,s,N0,a,p,i,Z0)))U0[F0]=!0;F0++}),z0++,J0=D0}),J0}var _=J(M),w="_owner",T=Object.prototype.hasOwnProperty;function b(p,i,n,Z0){var J0=Object.keys(p),U0=J0.length;if(Object.keys(i).length!==U0)return!1;var z0;while(U0-- >0){if(z0=J0[U0],z0===w){var B0=!!p.$$typeof,N0=!!i.$$typeof;if((B0||N0)&&B0!==N0)return!1}if(!T.call(i,z0)||!n(p[z0],i[z0],z0,z0,p,i,Z0))return!1}return!0}var C=J(b);function k(p,i){return p.source===i.source&&p.flags===i.flags}function S(p,i,n,Z0){var J0=p.size===i.size;if(!J0)return!1;if(!p.size)return!0;var U0={};return p.forEach(function(z0,B0){if(!J0)return;var N0=!1,D0=0;i.forEach(function(F0,s){if(!N0&&!U0[D0]&&(N0=n(z0,F0,B0,s,p,i,Z0)))U0[D0]=!0;D0++}),J0=N0}),J0}var R=J(S),O=Object.freeze({areArraysEqual:V,areDatesEqual:j,areMapsEqual:M,areObjectsEqual:b,areRegExpsEqual:k,areSetsEqual:S,createIsNestedEqual:Z}),y=Object.freeze({areArraysEqual:L,areDatesEqual:j,areMapsEqual:_,areObjectsEqual:C,areRegExpsEqual:k,areSetsEqual:R,createIsNestedEqual:Z}),I=A(O);function x(p,i){return I(p,i,void 0)}var v=A(H(O,{createIsNestedEqual:function(){return X}}));function g(p,i){return v(p,i,void 0)}var E=A(y);function l(p,i){return E(p,i,new WeakMap)}var r=A(H(y,{createIsNestedEqual:function(){return X}}));function h(p,i){return r(p,i,new WeakMap)}function d(p){return A(H(O,p(O)))}function o(p){var i=A(H(y,p(y)));return function(n,Z0,J0){if(J0===void 0)J0=new WeakMap;return i(n,Z0,J0)}}$.circularDeepEqual=l,$.circularShallowEqual=h,$.createCustomCircularEqual=o,$.createCustomEqual=d,$.deepEqual=x,$.sameValueZeroEqual=X,$.shallowEqual=g,Object.defineProperty($,"__esModule",{value:!0})})});var DZ=P(m(),1),cj=P(c(),1),GN=DZ.createContext(void 0),X1=($)=>{let Z=DZ.useContext(GN);if($)return $;if(!Z)throw Error("No QueryClient set, use QueryClientProvider to set one");return Z},UN=({client:$,children:Z})=>{return DZ.useEffect(()=>{return $.mount(),()=>{$.unmount()}},[$]),cj.jsx(GN.Provider,{value:$,children:Z})};var tX=P(m(),1),dj=tX.createContext(!1),lj=()=>tX.useContext(dj),_q0=dj.Provider;var iH=P(m(),1),ss=P(c(),1);function ts(){let $=!1;return{clearReset:()=>{$=!1},reset:()=>{$=!0},isReset:()=>{return $}}}var es=iH.createContext(ts()),ij=()=>iH.useContext(es);var FO=P(m(),1);var $t={setTimeout:($,Z)=>setTimeout($,Z),clearTimeout:($)=>clearTimeout($),setInterval:($,Z)=>setInterval($,Z),clearInterval:($)=>clearInterval($)},Zt=class{#$=$t;#Z=!1;setTimeoutProvider($){this.#$=$}setTimeout($,Z){return this.#$.setTimeout($,Z)}clearTimeout($){this.#$.clearTimeout($)}setInterval($,Z){return this.#$.setInterval($,Z)}clearInterval($){this.#$.clearInterval($)}},V9=new Zt;function rj($){setTimeout($,0)}var KN=typeof window>"u"||"Deno"in globalThis;function p5(){}function nj($,Z){return typeof $==="function"?$(Z):$}function eX($){return typeof $==="number"&&$>=0&&$!==1/0}function $z($,Z){return Math.max($+(Z||0)-Date.now(),0)}function R5($,Z){return typeof $==="function"?$(Z):$}function Zz($,Z){let{type:J="all",exact:H,fetchStatus:B,predicate:Q,queryKey:X,stale:z}=$;if(X){if(H){if(Z.queryHash!==rH(X,Z.options))return!1}else if(!e3(Z.queryKey,X))return!1}if(J!=="all"){let G=Z.isActive();if(J==="active"&&!G)return!1;if(J==="inactive"&&G)return!1}if(typeof z==="boolean"&&Z.isStale()!==z)return!1;if(B&&B!==Z.state.fetchStatus)return!1;if(Q&&!Q(Z))return!1;return!0}function Jz($,Z){let{exact:J,status:H,predicate:B,mutationKey:Q}=$;if(Q){if(!Z.options.mutationKey)return!1;if(J){if(L9(Z.options.mutationKey)!==L9(Q))return!1}else if(!e3(Z.options.mutationKey,Q))return!1}if(H&&Z.state.status!==H)return!1;if(B&&!B(Z))return!1;return!0}function rH($,Z){return(Z?.queryKeyHashFn||L9)($)}function L9($){return JSON.stringify($,(Z,J)=>YN(J)?Object.keys(J).sort().reduce((H,B)=>{return H[B]=J[B],H},{}):J)}function e3($,Z){if($===Z)return!0;if(typeof $!==typeof Z)return!1;if($&&Z&&typeof $==="object"&&typeof Z==="object"){if(Array.isArray($)&&Array.isArray(Z)){for(let H=0;H<Z.length;H++)if(!e3($[H],Z[H]))return!1;return!0}let J=Object.keys(Z);for(let H of J)if(!e3($[H],Z[H]))return!1;return!0}return!1}var Jt=Object.prototype.hasOwnProperty;function aH($,Z,J=0){if($===Z)return $;if(J>500)return Z;let H=aj($)&&aj(Z);if(!H&&!(YN($)&&YN(Z)))return Z;let B=(H?$:Object.keys($)).length,Q=H?Z:Object.keys(Z),X=Q.length,z=H?Array(X):{},G=0;for(let U=0;U<X;U++){let Y=H?U:Q[U],K=$[Y],F=Z[Y];if(K===F){if(z[Y]=K,H?U<B:Jt.call($,Y))G++;continue}if(K===null||F===null||typeof K!=="object"||typeof F!=="object"){z[Y]=F;continue}let W=aH(K,F,J+1);if(z[Y]=W,W===K)G++}return B===X&&G===B?$:z}function VZ($,Z){if(!Z||Object.keys($).length!==Object.keys(Z).length)return!1;for(let J in $)if($[J]!==Z[J])return!1;return!0}function aj($){return Array.isArray($)&&$.length===Object.keys($).length}function YN($){if(!oj($))return!1;let Z=$.constructor;if(Z===void 0)return!0;let J=Z.prototype;if(!oj(J))return!1;if(!J.hasOwnProperty("isPrototypeOf"))return!1;if(Object.getPrototypeOf($)!==Object.prototype)return!1;return!0}function oj($){return Object.prototype.toString.call($)==="[object Object]"}function sj($){return new Promise((Z)=>{V9.setTimeout(Z,$)})}function oH($,Z,J){if(typeof J.structuralSharing==="function")return J.structuralSharing($,Z);else if(J.structuralSharing!==!1)return aH($,Z);return Z}function tj($,Z,J=0){let H=[...$,Z];return J&&H.length>J?H.slice(1):H}function ej($,Z,J=0){let H=[Z,...$];return J&&H.length>J?H.slice(0,-1):H}var LZ=Symbol();function Hz($,Z){if(!$.queryFn&&Z?.initialPromise)return()=>Z.initialPromise;if(!$.queryFn||$.queryFn===LZ)return()=>Promise.reject(Error(`Missing queryFn: '${$.queryHash}'`));return $.queryFn}function MZ($,Z){if(typeof $==="function")return $(...Z);return!!$}function $O($,Z,J){let H=!1,B;return Object.defineProperty($,"signal",{enumerable:!0,get:()=>{if(B??=Z(),H)return B;if(H=!0,B.aborted)J();else B.addEventListener("abort",J,{once:!0});return B}}),$}var Ht=()=>KN,PZ=()=>Ht();var L8=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe($){return this.listeners.add($),this.onSubscribe(),()=>{this.listeners.delete($),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};var Bt=class extends L8{#$;#Z;#J;constructor(){super();this.#J=($)=>{if(typeof window<"u"&&window.addEventListener){let Z=()=>$();return window.addEventListener("visibilitychange",Z,!1),()=>{window.removeEventListener("visibilitychange",Z)}}}}onSubscribe(){if(!this.#Z)this.setEventListener(this.#J)}onUnsubscribe(){if(!this.hasListeners())this.#Z?.(),this.#Z=void 0}setEventListener($){this.#J=$,this.#Z?.(),this.#Z=$((Z)=>{if(typeof Z==="boolean")this.setFocused(Z);else this.onFocus()})}setFocused($){if(this.#$!==$)this.#$=$,this.onFocus()}onFocus(){let $=this.isFocused();this.listeners.forEach((Z)=>{Z($)})}isFocused(){if(typeof this.#$==="boolean")return this.#$;return globalThis.document?.visibilityState!=="hidden"}},_Z=new Bt;var ZO=rj;function Qt(){let $=[],Z=0,J=(z)=>{z()},H=(z)=>{z()},B=ZO,Q=(z)=>{if(Z)$.push(z);else B(()=>{J(z)})},X=()=>{let z=$;if($=[],z.length)B(()=>{H(()=>{z.forEach((G)=>{J(G)})})})};return{batch:(z)=>{let G;Z++;try{G=z()}finally{if(Z--,!Z)X()}return G},batchCalls:(z)=>{return(...G)=>{Q(()=>{z(...G)})}},schedule:Q,setNotifyFunction:(z)=>{J=z},setBatchNotifyFunction:(z)=>{H=z},setScheduler:(z)=>{B=z}}}var X5=Qt();var Xt=class extends L8{#$=!0;#Z;#J;constructor(){super();this.#J=($)=>{if(typeof window<"u"&&window.addEventListener){let Z=()=>$(!0),J=()=>$(!1);return window.addEventListener("online",Z,!1),window.addEventListener("offline",J,!1),()=>{window.removeEventListener("online",Z),window.removeEventListener("offline",J)}}}}onSubscribe(){if(!this.#Z)this.setEventListener(this.#J)}onUnsubscribe(){if(!this.hasListeners())this.#Z?.(),this.#Z=void 0}setEventListener($){this.#J=$,this.#Z?.(),this.#Z=$(this.setOnline.bind(this))}setOnline($){if(this.#$!==$)this.#$=$,this.listeners.forEach((Z)=>{Z($)})}isOnline(){return this.#$}},jZ=new Xt;function zt($){return Math.min(1000*2**$,30000)}function FN($){return($??"online")==="online"?jZ.isOnline():!0}var Bz=class extends Error{constructor($){super("CancelledError");this.revert=$?.revert,this.silent=$?.silent}};function Qz($){let Z=!1,J=0,H,B="pending",Q,X,z=new Promise((V,L)=>{Q=V,X=L});z.catch(p5);let G=()=>B!=="pending",U=(V)=>{if(!G()){let L=new Bz(V);N(L),$.onCancel?.(L)}},Y=()=>{Z=!0},K=()=>{Z=!1},F=()=>_Z.isFocused()&&($.networkMode==="always"||jZ.isOnline())&&$.canRun(),W=()=>FN($.networkMode)&&$.canRun(),q=(V)=>{if(!G())H?.(),B="resolved",Q(V)},N=(V)=>{if(!G())H?.(),B="rejected",X(V)},D=()=>{return new Promise((V)=>{H=(L)=>{if(G()||F())V(L)},$.onPause?.()}).then(()=>{if(H=void 0,!G())$.onContinue?.()})},A=()=>{if(G())return;let V,L=J===0?$.initialPromise:void 0;try{V=L??$.fn()}catch(j){V=Promise.reject(j)}Promise.resolve(V).then(q).catch((j)=>{if(G())return;let M=$.retry??(PZ()?0:3),_=$.retryDelay??zt,w=typeof _==="function"?_(J,j):_,T=M===!0||typeof M==="number"&&J<M||typeof M==="function"&&M(J,j);if(Z||!T){N(j);return}J++,$.onFail?.(J,j),sj(w).then(()=>{return F()?void 0:D()}).then(()=>{if(Z)N(j);else A()})})};return{promise:z,status:()=>B,cancel:U,continue:()=>{return H?.(),z},cancelRetry:Y,continueRetry:K,canStart:W,start:()=>{if(W())A();else D().then(A);return z}}}var Xz=class{#$;destroy(){this.clearGcTimeout()}scheduleGc(){if(this.clearGcTimeout(),eX(this.gcTime))this.#$=V9.setTimeout(()=>{this.optionalRemove()},this.gcTime)}updateGcTime($){this.gcTime=Math.max(this.gcTime||0,$??(PZ()?1/0:300000))}clearGcTimeout(){if(this.#$!==void 0)V9.clearTimeout(this.#$),this.#$=void 0}};function HO($){return{onFetch:(Z,J)=>{let H=Z.options,B=Z.fetchOptions?.meta?.fetchMore?.direction,Q=Z.state.data?.pages||[],X=Z.state.data?.pageParams||[],z={pages:[],pageParams:[]},G=0,U=async()=>{let Y=!1,K=(q)=>{$O(q,()=>Z.signal,()=>Y=!0)},F=Hz(Z.options,Z.fetchOptions),W=async(q,N,D)=>{if(Y)return Promise.reject(Z.signal.reason);if(N==null&&q.pages.length)return Promise.resolve(q);let V=(()=>{let _={client:Z.client,queryKey:Z.queryKey,pageParam:N,direction:D?"backward":"forward",meta:Z.options.meta};return K(_),_})(),L=await F(V),{maxPages:j}=Z.options,M=D?ej:tj;return{pages:M(q.pages,L,j),pageParams:M(q.pageParams,N,j)}};if(B&&Q.length){let q=B==="backward",N=q?Gt:JO,D={pages:Q,pageParams:X};z=await W(D,N(H,D),q)}else{let q=$??Q.length;do{let N=G===0?X[0]??H.initialPageParam:JO(H,z);if(G>0&&N==null)break;z=await W(z,N),G++}while(G<q)}return z};if(Z.options.persister)Z.fetchFn=()=>{return Z.options.persister?.(U,{client:Z.client,queryKey:Z.queryKey,meta:Z.options.meta,signal:Z.signal},J)};else Z.fetchFn=U}}}function JO($,{pages:Z,pageParams:J}){let H=Z.length-1;return Z.length>0?$.getNextPageParam(Z[H],Z,J[H],J):void 0}function Gt($,{pages:Z,pageParams:J}){return Z.length>0?$.getPreviousPageParam?.(Z[0],Z,J[0],J):void 0}var XO=class extends Xz{#$;#Z;#J;#H;#Q;#B;#X;#G;constructor($){super();this.#G=!1,this.#X=$.defaultOptions,this.setOptions($.options),this.observers=[],this.#Q=$.client,this.#H=this.#Q.getQueryCache(),this.queryKey=$.queryKey,this.queryHash=$.queryHash,this.#Z=QO(this.options),this.state=$.state??this.#Z,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#$}get promise(){return this.#B?.promise}setOptions($){if(this.options={...this.#X,...$},$?._type)this.#$=$._type;if(this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let Z=QO(this.options);if(Z.data!==void 0)this.setState(BO(Z.data,Z.dataUpdatedAt)),this.#Z=Z}}optionalRemove(){if(!this.observers.length&&this.state.fetchStatus==="idle")this.#H.remove(this)}setData($,Z){let J=oH(this.state.data,$,this.options);return this.#z({data:J,type:"success",dataUpdatedAt:Z?.updatedAt,manual:Z?.manual}),J}setState($){this.#z({type:"setState",state:$})}cancel($){let Z=this.#B?.promise;return this.#B?.cancel($),Z?Z.then(p5).catch(p5):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#Z}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(($)=>R5($.options.enabled,this)!==!1)}isDisabled(){if(this.getObserversCount()>0)return!this.isActive();return this.options.queryFn===LZ||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){if(this.getObserversCount()>0)return this.observers.some(($)=>R5($.options.staleTime,this)==="static");return!1}isStale(){if(this.getObserversCount()>0)return this.observers.some(($)=>$.getCurrentResult().isStale);return this.state.data===void 0||this.state.isInvalidated}isStaleByTime($=0){if(this.state.data===void 0)return!0;if($==="static")return!1;if(this.state.isInvalidated)return!0;return!$z(this.state.dataUpdatedAt,$)}onFocus(){this.observers.find(($)=>$.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#B?.continue()}onOnline(){this.observers.find(($)=>$.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#B?.continue()}addObserver($){if(!this.observers.includes($))this.observers.push($),this.clearGcTimeout(),this.#H.notify({type:"observerAdded",query:this,observer:$})}removeObserver($){let Z=this.observers.indexOf($);if(Z!==-1){if(this.observers.splice(Z,1),!this.observers.length){if(this.#B)if(this.#G||this.state.fetchStatus==="paused"&&this.state.status==="pending")this.#B.cancel({revert:!0});else this.#B.cancelRetry();this.scheduleGc()}this.#H.notify({type:"observerRemoved",query:this,observer:$})}}getObserversCount(){return this.observers.length}invalidate(){if(!this.state.isInvalidated)this.#z({type:"invalidate"})}async fetch($,Z){if(this.state.fetchStatus!=="idle"&&this.#B?.status()!=="rejected"){if(this.state.data!==void 0&&Z?.cancelRefetch)this.cancel({silent:!0});else if(this.#B)return this.#B.continueRetry(),this.#B.promise}if($)this.setOptions($);if(!this.options.queryFn){let G=this.observers.find((U)=>U.options.queryFn);if(G)this.setOptions(G.options)}let J=new AbortController,H=(G)=>{Object.defineProperty(G,"signal",{enumerable:!0,get:()=>{return this.#G=!0,J.signal}})},B=()=>{let G=Hz(this.options,Z),Y=(()=>{let K={client:this.#Q,queryKey:this.queryKey,meta:this.meta};return H(K),K})();if(this.#G=!1,this.options.persister)return this.options.persister(G,Y,this);return G(Y)},X=(()=>{let G={fetchOptions:Z,options:this.options,queryKey:this.queryKey,client:this.#Q,state:this.state,fetchFn:B};return H(G),G})();if((this.#$==="infinite"?HO(this.options.pages):this.options.behavior)?.onFetch(X,this),this.#J=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==X.fetchOptions?.meta)this.#z({type:"fetch",meta:X.fetchOptions?.meta});let z=this.#B=Qz({initialPromise:Z?.initialPromise,fn:X.fetchFn,onCancel:(G)=>{if(G instanceof Bz&&G.revert)this.setState({...this.#J,fetchStatus:"idle"});J.abort()},onFail:(G,U)=>{this.#z({type:"failed",failureCount:G,error:U})},onPause:()=>{this.#z({type:"pause"})},onContinue:()=>{this.#z({type:"continue"})},retry:X.options.retry,retryDelay:X.options.retryDelay,networkMode:X.options.networkMode,canRun:()=>!0});try{let G=await z.start();if(G===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(G),this.#H.config.onSuccess?.(G,this),this.#H.config.onSettled?.(G,this.state.error,this),G}catch(G){if(G instanceof Bz){if(G.silent)return this.#B.promise;else if(G.revert){if(this.state.data===void 0)throw G;return this.state.data}}throw this.#z({type:"error",error:G}),this.#H.config.onError?.(G,this),this.#H.config.onSettled?.(this.state.data,G,this),G}finally{if(this.#B===z)this.#B=void 0;this.scheduleGc()}}#z($){let Z=(J)=>{switch($.type){case"failed":return{...J,fetchFailureCount:$.failureCount,fetchFailureReason:$.error};case"pause":return{...J,fetchStatus:"paused"};case"continue":return{...J,fetchStatus:"fetching"};case"fetch":return{...J,...WN(J.data,this.options),fetchMeta:$.meta??null};case"success":let H={...J,...BO($.data,$.dataUpdatedAt),dataUpdateCount:J.dataUpdateCount+1,...!$.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#J=$.manual?H:void 0,H;case"error":let B=$.error;return{...J,error:B,errorUpdateCount:J.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:J.fetchFailureCount+1,fetchFailureReason:B,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...J,isInvalidated:!0};case"setState":return{...J,...$.state}}};this.state=Z(this.state),X5.batch(()=>{this.observers.slice().forEach((J)=>{J.onQueryUpdate()}),this.#H.notify({query:this,type:"updated",action:$})})}};function WN($,Z){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:FN(Z.networkMode)?"fetching":"paused",...$===void 0&&{error:null,status:"pending"}}}function BO($,Z){return{data:$,dataUpdatedAt:Z??Date.now(),error:null,isInvalidated:!1,status:"success"}}function QO($){let Z=typeof $.initialData==="function"?$.initialData():$.initialData,J=Z!==void 0,H=J?typeof $.initialDataUpdatedAt==="function"?$.initialDataUpdatedAt():$.initialDataUpdatedAt:0;return{data:Z,dataUpdateCount:0,dataUpdatedAt:J?H??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:J?"success":"pending",fetchStatus:"idle"}}var NN=class extends L8{#$;#Z=void 0;#J=void 0;#H=void 0;#Q;#B;#X;#G;#z;#W;#Y;#K;#U;#q=new Set;constructor($,Z){super();this.options=Z,this.#$=$,this.#X=null,this.bindMethods(),this.setOptions(Z)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){if(this.listeners.size===1){if(this.#Z.addObserver(this),zO(this.#Z,this.options))this.#F();else this.updateResult();this.#L()}}onUnsubscribe(){if(!this.hasListeners())this.destroy()}shouldFetchOnReconnect(){return qN(this.#Z,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return qN(this.#Z,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#M(),this.#P(),this.#Z.removeObserver(this)}setOptions($){let Z=this.options,J=this.#Z;if(this.options=this.#$.defaultQueryOptions($),this.options.enabled!==void 0&&typeof this.options.enabled!=="boolean"&&typeof this.options.enabled!=="function"&&typeof R5(this.options.enabled,this.#Z)!=="boolean")throw Error("Expected enabled to be a boolean or a callback that returns a boolean");if(this.#_(),this.#Z.setOptions(this.options),Z._defaulted&&!VZ(this.options,Z))this.#$.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#Z,observer:this});let H=this.hasListeners();if(H&&GO(this.#Z,J,this.options,Z))this.#F();if(this.updateResult(),H&&(this.#Z!==J||R5(this.options.enabled,this.#Z)!==R5(Z.enabled,this.#Z)||R5(this.options.staleTime,this.#Z)!==R5(Z.staleTime,this.#Z)))this.#A();let B=this.#D();if(H&&(this.#Z!==J||R5(this.options.enabled,this.#Z)!==R5(Z.enabled,this.#Z)||B!==this.#U))this.#V(B)}getOptimisticResult($){let Z=this.#$.getQueryCache().build(this.#$,$),J=this.createResult(Z,$);if(!VZ(this.getCurrentResult(),J))this.#H=J,this.#B=this.options,this.#Q=this.#Z.state;return J}getCurrentResult(){return this.#H}trackResult($,Z){return new Proxy($,{get:(J,H)=>{return this.trackProp(H),Z?.(H),Reflect.get(J,H)}})}trackProp($){this.#q.add($)}getCurrentQuery(){return this.#Z}refetch({...$}={}){return this.fetch({...$})}fetchOptimistic($){let Z=this.#$.defaultQueryOptions($),J=this.#$.getQueryCache().build(this.#$,Z),H=()=>{},B,Q=new Promise((X)=>{B=X,H=this.#$.getQueryCache().subscribe((z)=>{if(z.type==="updated"&&z.query.queryHash===J.queryHash&&J.state.data!==void 0)H(),X(this.createResult(J,Z))})});return Promise.race([J.fetch().then(()=>{let X=this.createResult(J,Z);return B?.(X),X}).finally(()=>{H()}),Q])}fetch($){return this.#F({...$,cancelRefetch:$.cancelRefetch??!0}).then(()=>{return this.updateResult(),this.#H})}#F($){this.#_();let Z=this.#Z.fetch(this.options,$);if(!$?.throwOnError)Z=Z.catch(p5);return Z}#N($){return!PZ()&&R5(this.options.enabled,this.#Z)!==!1&&eX($)}#A(){this.#M();let $=R5(this.options.staleTime,this.#Z);if(this.#H.isStale||!this.#N($))return;let Z=$z(this.#H.dataUpdatedAt,$)+1;this.#Y=V9.setTimeout(()=>{if(!this.#H.isStale)this.updateResult()},Z)}#D(){return(typeof this.options.refetchInterval==="function"?this.options.refetchInterval(this.#Z):this.options.refetchInterval)??!1}#V($){if(this.#P(),this.#U=$,this.#U===0||!this.#N(this.#U))return;this.#K=V9.setInterval(()=>{if(this.options.refetchIntervalInBackground||_Z.isFocused())this.#F()},this.#U)}#L(){this.#A(),this.#V(this.#D())}#M(){if(this.#Y!==void 0)V9.clearTimeout(this.#Y),this.#Y=void 0}#P(){if(this.#K!==void 0)V9.clearInterval(this.#K),this.#K=void 0}createResult($,Z){let J=this.#Z,H=this.options,B=this.#H,Q=this.#Q,X=this.#B,z=$!==J?$.state:this.#J,{state:G}=$,U={...G},Y=!1,K;if(Z._optimisticResults){let M=this.hasListeners(),_=!M&&zO($,Z),w=M&&GO($,J,Z,H);if(_||w)U={...U,...WN(G.data,$.options)};if(Z._optimisticResults==="isRestoring")U.fetchStatus="idle"}let{error:F,errorUpdatedAt:W,status:q}=U;K=U.data;let N=!1;if(Z.placeholderData!==void 0&&K===void 0&&q==="pending"){let M;if(B?.isPlaceholderData&&Z.placeholderData===X?.placeholderData)M=B.data,N=!0;else M=typeof Z.placeholderData==="function"?Z.placeholderData(this.#W?.state.data,this.#W):Z.placeholderData;if(M!==void 0)q="success",K=oH(B?.data,M,Z),Y=!0}if(Z.select&&K!==void 0&&!N)if(B&&K===Q?.data&&Z.select===this.#G)K=this.#z;else try{this.#G=Z.select,K=Z.select(K),K=oH(B?.data,K,Z),this.#z=K,this.#X=null}catch(M){this.#X=M}else if(K===void 0)this.#X=null;if(this.#X)F=this.#X,K=this.#z,W=Date.now(),q="error",Y=!1;let D=U.fetchStatus==="fetching",A=q==="pending",V=q==="error",L=A&&D,j=K!==void 0;return{status:q,fetchStatus:U.fetchStatus,isPending:A,isSuccess:q==="success",isError:V,isInitialLoading:L,isLoading:L,data:K,dataUpdatedAt:U.dataUpdatedAt,error:F,errorUpdatedAt:W,failureCount:U.fetchFailureCount,failureReason:U.fetchFailureReason,errorUpdateCount:U.errorUpdateCount,isFetched:$.isFetched(),isFetchedAfterMount:U.dataUpdateCount>z.dataUpdateCount||U.errorUpdateCount>z.errorUpdateCount,isFetching:D,isRefetching:D&&!A,isLoadingError:V&&!j,isPaused:U.fetchStatus==="paused",isPlaceholderData:Y,isRefetchError:V&&j,isStale:AN($,Z),refetch:this.refetch,isEnabled:R5(Z.enabled,$)!==!1}}updateResult(){let $=this.#H,Z=this.createResult(this.#Z,this.options);if(this.#Q=this.#Z.state,this.#B=this.options,this.#Q.data!==void 0)this.#W=this.#Z;if(VZ(Z,$))return;this.#H=Z;let H=(()=>{if(!$)return!0;let{notifyOnChangeProps:B}=this.options,Q=typeof B==="function"?B():B;if(Q==="all"||!Q&&!this.#q.size)return!0;let X=new Set(Q??this.#q);if(this.options.throwOnError)X.add("error");return Object.keys(this.#H).some((z)=>{let G=z;return this.#H[G]!==$[G]&&X.has(G)})})();X5.batch(()=>{if(H)this.listeners.forEach((B)=>{B(this.#H)});this.#$.getQueryCache().notify({query:this.#Z,type:"observerResultsUpdated"})})}#_(){let $=this.#$.getQueryCache().build(this.#$,this.options);if($===this.#Z)return;let Z=this.#Z;if(this.#Z=$,this.#J=$.state,this.hasListeners())Z?.removeObserver(this),$.addObserver(this)}onQueryUpdate(){if(this.updateResult(),this.hasListeners())this.#L()}};function Ut($,Z){return R5(Z.enabled,$)!==!1&&$.state.data===void 0&&!($.state.status==="error"&&R5(Z.retryOnMount,$)===!1)}function zO($,Z){return Ut($,Z)||$.state.data!==void 0&&qN($,Z,Z.refetchOnMount)}function qN($,Z,J){if(R5(Z.enabled,$)!==!1&&R5(Z.staleTime,$)!=="static"){let H=typeof J==="function"?J($):J;return H==="always"||H!==!1&&AN($,Z)}return!1}function GO($,Z,J,H){return($!==Z||R5(H.enabled,$)===!1)&&(!J.suspense||$.state.status!=="error")&&AN($,J)}function AN($,Z){return R5(Z.enabled,$)!==!1&&$.isStaleByTime(R5(Z.staleTime,$))}var UO=class extends Xz{#$;#Z;#J;#H;constructor($){super();this.#$=$.client,this.mutationId=$.mutationId,this.#J=$.mutationCache,this.#Z=[],this.state=$.state||DN(),this.setOptions($.options),this.scheduleGc()}setOptions($){this.options=$,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver($){if(!this.#Z.includes($))this.#Z.push($),this.clearGcTimeout(),this.#J.notify({type:"observerAdded",mutation:this,observer:$})}removeObserver($){this.#Z=this.#Z.filter((Z)=>Z!==$),this.scheduleGc(),this.#J.notify({type:"observerRemoved",mutation:this,observer:$})}optionalRemove(){if(!this.#Z.length)if(this.state.status==="pending")this.scheduleGc();else this.#J.remove(this)}continue(){return this.#H?.continue()??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute($){let Z=()=>{this.#Q({type:"continue"})},J={client:this.#$,meta:this.options.meta,mutationKey:this.options.mutationKey},H=this.#H=Qz({fn:()=>{if(!this.options.mutationFn)return Promise.reject(Error("No mutationFn found"));return this.options.mutationFn($,J)},onFail:(X,z)=>{this.#Q({type:"failed",failureCount:X,error:z})},onPause:()=>{this.#Q({type:"pause"})},onContinue:Z,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#J.canRun(this)}),B=this.state.status==="pending",Q=!H.canStart();try{if(B)Z();else{if(this.#Q({type:"pending",variables:$,isPaused:Q}),this.#J.config.onMutate)await this.#J.config.onMutate($,this,J);let z=await this.options.onMutate?.($,J);if(z!==this.state.context)this.#Q({type:"pending",context:z,variables:$,isPaused:Q})}let X=await H.start();return await this.#J.config.onSuccess?.(X,$,this.state.context,this,J),await this.options.onSuccess?.(X,$,this.state.context,J),await this.#J.config.onSettled?.(X,null,this.state.variables,this.state.context,this,J),await this.options.onSettled?.(X,null,$,this.state.context,J),this.#Q({type:"success",data:X}),X}catch(X){try{await this.#J.config.onError?.(X,$,this.state.context,this,J)}catch(z){Promise.reject(z)}try{await this.options.onError?.(X,$,this.state.context,J)}catch(z){Promise.reject(z)}try{await this.#J.config.onSettled?.(void 0,X,this.state.variables,this.state.context,this,J)}catch(z){Promise.reject(z)}try{await this.options.onSettled?.(void 0,X,$,this.state.context,J)}catch(z){Promise.reject(z)}throw this.#Q({type:"error",error:X}),X}finally{if(this.#H===H)this.#H=void 0;this.#J.runNext(this)}}#Q($){let Z=(J)=>{switch($.type){case"failed":return{...J,failureCount:$.failureCount,failureReason:$.error};case"pause":return{...J,isPaused:!0};case"continue":return{...J,isPaused:!1};case"pending":return{...J,context:$.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:$.isPaused,status:"pending",variables:$.variables,submittedAt:Date.now()};case"success":return{...J,data:$.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...J,data:void 0,error:$.error,failureCount:J.failureCount+1,failureReason:$.error,isPaused:!1,status:"error"}}};this.state=Z(this.state),X5.batch(()=>{this.#Z.forEach((J)=>{J.onMutationUpdate($)}),this.#J.notify({mutation:this,type:"updated",action:$})})}};function DN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var YO=class extends L8{#$;#Z;#J;constructor($={}){super();this.config=$,this.#$=new Set,this.#Z=new Map,this.#J=0}build($,Z,J){let H=new UO({client:$,mutationCache:this,mutationId:++this.#J,options:$.defaultMutationOptions(Z),state:J});return this.add(H),H}add($){this.#$.add($);let Z=zz($);if(typeof Z==="string"){let J=this.#Z.get(Z);if(J)J.push($);else this.#Z.set(Z,[$])}this.notify({type:"added",mutation:$})}remove($){if(this.#$.delete($)){let Z=zz($);if(typeof Z==="string"){let J=this.#Z.get(Z);if(J){if(J.length>1){let H=J.indexOf($);if(H!==-1)J.splice(H,1)}else if(J[0]===$)this.#Z.delete(Z)}}}this.notify({type:"removed",mutation:$})}canRun($){let Z=zz($);if(typeof Z==="string"){let J=this.#Z.get(Z)?.find((H)=>H.state.status==="pending");return!J||J===$}else return!0}runNext($){let Z=zz($);if(typeof Z==="string")return this.#Z.get(Z)?.find((J)=>J!==$&&J.state.isPaused)?.continue()??Promise.resolve();else return Promise.resolve()}clear(){X5.batch(()=>{this.#$.forEach(($)=>{this.notify({type:"removed",mutation:$})}),this.#$.clear(),this.#Z.clear()})}getAll(){return Array.from(this.#$)}find($){let Z={exact:!0,...$};return this.getAll().find((J)=>Jz(Z,J))}findAll($={}){return this.getAll().filter((Z)=>Jz($,Z))}notify($){X5.batch(()=>{this.listeners.forEach((Z)=>{Z($)})})}resumePausedMutations(){let $=this.getAll().filter((Z)=>Z.state.isPaused);return X5.batch(()=>Promise.all($.map((Z)=>Z.continue().catch(p5))))}};function zz($){return $.options.scope?.id}var VN=class extends L8{#$;#Z=void 0;#J;#H;constructor($,Z){super();this.#$=$,this.setOptions(Z),this.bindMethods(),this.#Q()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions($){let Z=this.options;if(this.options=this.#$.defaultMutationOptions($),!VZ(this.options,Z))this.#$.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#J,observer:this});if(Z?.mutationKey&&this.options.mutationKey&&L9(Z.mutationKey)!==L9(this.options.mutationKey))this.reset();else if(this.#J?.state.status==="pending")this.#J.setOptions(this.options)}onSubscribe(){if(this.listeners.size===1&&this.#J)this.#J.addObserver(this),this.#Q()}onUnsubscribe(){if(!this.hasListeners())this.#J?.removeObserver(this)}onMutationUpdate($){this.#Q(),this.#B($)}getCurrentResult(){return this.#Z}reset(){this.#J?.removeObserver(this),this.#J=void 0,this.#Q(),this.#B()}mutate($,Z){return this.#H=Z,this.#J?.removeObserver(this),this.#J=this.#$.getMutationCache().build(this.#$,this.options),this.#J.addObserver(this),this.#J.execute($)}#Q(){let $=this.#J?.state??DN();this.#Z={...$,isPending:$.status==="pending",isSuccess:$.status==="success",isError:$.status==="error",isIdle:$.status==="idle",mutate:this.mutate,reset:this.reset}}#B($){X5.batch(()=>{if(this.#H&&this.hasListeners()){let Z=this.#Z.variables,J=this.#Z.context,H={client:this.#$,meta:this.options.meta,mutationKey:this.options.mutationKey};if($?.type==="success"){try{this.#H.onSuccess?.($.data,Z,J,H)}catch(B){Promise.reject(B)}try{this.#H.onSettled?.($.data,null,Z,J,H)}catch(B){Promise.reject(B)}}else if($?.type==="error"){try{this.#H.onError?.($.error,Z,J,H)}catch(B){Promise.reject(B)}try{this.#H.onSettled?.(void 0,$.error,Z,J,H)}catch(B){Promise.reject(B)}}}this.listeners.forEach((Z)=>{Z(this.#Z)})})}};var KO=class extends L8{#$;constructor($={}){super();this.config=$,this.#$=new Map}build($,Z,J){let H=Z.queryKey,B=Z.queryHash??rH(H,Z),Q=this.get(B);if(!Q)Q=new XO({client:$,queryKey:H,queryHash:B,options:$.defaultQueryOptions(Z),state:J,defaultOptions:$.getQueryDefaults(H)}),this.add(Q);return Q}add($){if(!this.#$.has($.queryHash))this.#$.set($.queryHash,$),this.notify({type:"added",query:$})}remove($){let Z=this.#$.get($.queryHash);if(Z){if($.destroy(),Z===$)this.#$.delete($.queryHash);this.notify({type:"removed",query:$})}}clear(){X5.batch(()=>{this.getAll().forEach(($)=>{this.remove($)})})}get($){return this.#$.get($)}getAll(){return[...this.#$.values()]}find($){let Z={exact:!0,...$};return this.getAll().find((J)=>Zz(Z,J))}findAll($={}){let Z=this.getAll();return Object.keys($).length>0?Z.filter((J)=>Zz($,J)):Z}notify($){X5.batch(()=>{this.listeners.forEach((Z)=>{Z($)})})}onFocus(){X5.batch(()=>{this.getAll().forEach(($)=>{$.onFocus()})})}onOnline(){X5.batch(()=>{this.getAll().forEach(($)=>{$.onOnline()})})}};var LN=class{#$;#Z;#J;#H;#Q;#B;#X;#G;constructor($={}){this.#$=$.queryCache||new KO,this.#Z=$.mutationCache||new YO,this.#J=$.defaultOptions||{},this.#H=new Map,this.#Q=new Map,this.#B=0}mount(){if(this.#B++,this.#B!==1)return;this.#X=_Z.subscribe(async($)=>{if($)await this.resumePausedMutations(),this.#$.onFocus()}),this.#G=jZ.subscribe(async($)=>{if($)await this.resumePausedMutations(),this.#$.onOnline()})}unmount(){if(this.#B--,this.#B!==0)return;this.#X?.(),this.#X=void 0,this.#G?.(),this.#G=void 0}isFetching($){return this.#$.findAll({...$,fetchStatus:"fetching"}).length}isMutating($){return this.#Z.findAll({...$,status:"pending"}).length}getQueryData($){let Z=this.defaultQueryOptions({queryKey:$});return this.#$.get(Z.queryHash)?.state.data}ensureQueryData($){let Z=this.defaultQueryOptions($),J=this.#$.build(this,Z),H=J.state.data;if(H===void 0)return this.fetchQuery($);if($.revalidateIfStale&&J.isStaleByTime(R5(Z.staleTime,J)))this.prefetchQuery(Z);return Promise.resolve(H)}getQueriesData($){return this.#$.findAll($).map(({queryKey:Z,state:J})=>{return[Z,J.data]})}setQueryData($,Z,J){let H=this.defaultQueryOptions({queryKey:$}),B=this.#$.get(H.queryHash)?.state.data,Q=nj(Z,B);if(Q===void 0)return;return this.#$.build(this,H).setData(Q,{...J,manual:!0})}setQueriesData($,Z,J){return X5.batch(()=>this.#$.findAll($).map(({queryKey:H})=>[H,this.setQueryData(H,Z,J)]))}getQueryState($){let Z=this.defaultQueryOptions({queryKey:$});return this.#$.get(Z.queryHash)?.state}removeQueries($){let Z=this.#$;X5.batch(()=>{Z.findAll($).forEach((J)=>{Z.remove(J)})})}resetQueries($,Z){let J=this.#$;return X5.batch(()=>{let H=J.findAll($),B=new Set(H);return H.forEach((Q)=>{Q.reset()}),this.refetchQueries({type:"active",predicate:(Q)=>B.has(Q)},Z)})}cancelQueries($,Z={}){let J={revert:!0,...Z},H=X5.batch(()=>this.#$.findAll($).map((B)=>B.cancel(J)));return Promise.all(H).then(p5).catch(p5)}invalidateQueries($,Z={}){return X5.batch(()=>{if(this.#$.findAll($).forEach((J)=>{J.invalidate()}),$?.refetchType==="none")return Promise.resolve();return this.refetchQueries({...$,type:$?.refetchType??$?.type??"active"},Z)})}refetchQueries($,Z={}){let J={...Z,cancelRefetch:Z.cancelRefetch??!0},H=X5.batch(()=>this.#$.findAll($).filter((B)=>!B.isDisabled()&&!B.isStatic()).map((B)=>{let Q=B.fetch(void 0,J);if(!J.throwOnError)Q=Q.catch(p5);return B.state.fetchStatus==="paused"?Promise.resolve():Q}));return Promise.all(H).then(p5)}async query($){let Z=this.defaultQueryOptions($);if(Z.retry===void 0)Z.retry=!1;let J=this.#$.build(this,Z),H=J.isStaleByTime(R5(Z.staleTime,J))?await J.fetch(Z):J.state.data,B=Z.select;if(B)return B(H);return H}fetchQuery($){let Z=this.defaultQueryOptions($);if(Z.retry===void 0)Z.retry=!1;let J=this.#$.build(this,Z);return J.isStaleByTime(R5(Z.staleTime,J))?J.fetch(Z):Promise.resolve(J.state.data)}prefetchQuery($){return this.fetchQuery($).then(p5).catch(p5)}infiniteQuery($){return $._type="infinite",this.query($)}fetchInfiniteQuery($){return $._type="infinite",this.fetchQuery($)}prefetchInfiniteQuery($){return this.fetchInfiniteQuery($).then(p5).catch(p5)}ensureInfiniteQueryData($){return $._type="infinite",this.ensureQueryData($)}resumePausedMutations(){if(jZ.isOnline())return this.#Z.resumePausedMutations();return Promise.resolve()}getQueryCache(){return this.#$}getMutationCache(){return this.#Z}getDefaultOptions(){return this.#J}setDefaultOptions($){this.#J=$}setQueryDefaults($,Z){this.#H.set(L9($),{queryKey:$,defaultOptions:Z})}getQueryDefaults($){let Z=[...this.#H.values()],J={};return Z.forEach((H)=>{if(e3($,H.queryKey))Object.assign(J,H.defaultOptions)}),J}setMutationDefaults($,Z){this.#Q.set(L9($),{mutationKey:$,defaultOptions:Z})}getMutationDefaults($){let Z=[...this.#Q.values()],J={};return Z.forEach((H)=>{if(e3($,H.mutationKey))Object.assign(J,H.defaultOptions)}),J}defaultQueryOptions($){if($._defaulted)return $;let Z={...this.#J.queries,...this.getQueryDefaults($.queryKey),...$,_defaulted:!0};if(!Z.queryHash)Z.queryHash=rH(Z.queryKey,Z);if(Z.refetchOnReconnect===void 0)Z.refetchOnReconnect=Z.networkMode!=="always";if(Z.throwOnError===void 0)Z.throwOnError=!!Z.suspense;if(!Z.networkMode&&Z.persister)Z.networkMode="offlineFirst";if(Z.queryFn===LZ)Z.enabled=!1;return Z}defaultMutationOptions($){if($?._defaulted)return $;return{...this.#J.mutations,...$?.mutationKey&&this.getMutationDefaults($.mutationKey),...$,_defaulted:!0}}clear(){this.#$.clear(),this.#Z.clear()}};var WO=($,Z,J)=>{let H=J?.state.error&&typeof $.throwOnError==="function"?MZ($.throwOnError,[J.state.error,J]):$.throwOnError;if($.suspense||H){if(!Z.isReset())$.retryOnMount=!1}},qO=($)=>{FO.useEffect(()=>{$.clearReset()},[$])},NO=({result:$,errorResetBoundary:Z,throwOnError:J,query:H,suspense:B})=>{return $.isError&&!Z.isReset()&&!$.isFetching&&H&&(B&&$.data===void 0||MZ(J,[$.error,H]))};var AO=($)=>{if($.suspense){let J=(B)=>B==="static"?B:Math.max(B??1000,1000),H=$.staleTime;if($.staleTime=typeof H==="function"?(...B)=>J(H(...B)):J(H),typeof $.gcTime==="number")$.gcTime=Math.max($.gcTime,1000)}},DO=($,Z)=>$?.suspense&&Z.isPending,VO=($,Z,J)=>Z.fetchOptimistic($).catch(()=>{J.clearReset()});var $6=P(m(),1);function LO($,Z,J){let H=lj(),B=ij(),Q=X1(J),X=Q.defaultQueryOptions($),z=Q.getQueryCache().get(X.queryHash),G=$.subscribed!==!1;X._optimisticResults=H?"isRestoring":G?"optimistic":void 0,AO(X),WO(X,B,z),qO(B);let[U]=$6.useState(()=>new Z(Q,X)),Y=U.getOptimisticResult(X),K=!H&&G;if($6.useSyncExternalStore($6.useCallback((F)=>{let W=K?U.subscribe(X5.batchCalls(F)):p5;return U.updateResult(),W},[U,K]),()=>U.getCurrentResult(),()=>U.getCurrentResult()),$6.useEffect(()=>{U.setOptions(X)},[X,U]),DO(X,Y))throw VO(X,U,B);if(NO({result:Y,errorResetBoundary:B,throwOnError:X.throwOnError,query:z,suspense:X.suspense}))throw Y.error;return!X.notifyOnChangeProps?U.trackResult(Y):Y}function Y5($,Z){return LO($,NN,Z)}function MN($){return $}var V3=P(m(),1);function PN($,Z){let J=X1(Z);return PO({filters:{...$,status:"pending"}},J).length}function MO($,Z){return $.findAll(Z.filters).map((J)=>Z.select?Z.select(J):J.state)}function PO($={},Z){let J=X1(Z).getMutationCache(),H=V3.useRef($),B=V3.useRef(null);if(B.current===null)B.current=MO(J,$);return V3.useEffect(()=>{H.current=$}),V3.useSyncExternalStore(V3.useCallback((Q)=>J.subscribe(()=>{let X=aH(B.current,MO(J,H.current));if(B.current!==X)B.current=X,X5.schedule(Q)}),[J]),()=>B.current,()=>B.current)}var L3=P(m(),1);function E5($,Z){let J=X1(Z),[H]=L3.useState(()=>new VN(J,$));L3.useEffect(()=>{H.setOptions($)},[H,$]);let B=L3.useSyncExternalStore(L3.useCallback((X)=>H.subscribe(X5.batchCalls(X)),[H]),()=>H.getCurrentResult(),()=>H.getCurrentResult()),Q=L3.useCallback((...X)=>{H.mutate(X[0],X[1]).catch(p5)},[H]);if(B.error&&MZ(H.options.throwOnError,[B.error]))throw B.error;return{...B,mutate:Q,mutateAsync:B.mutate}}var rs=P(Mq0(),1);function _O($,Z){if($ instanceof RegExp)return{keys:!1,pattern:$};var J,H,B,Q,X=[],z="",G=$.split("/");G[0]||G.shift();while(B=G.shift())if(J=B[0],J==="*")X.push(J),z+=B[1]==="?"?"(?:/(.*))?":"/(.*)";else if(J===":"){if(H=B.indexOf("?",1),Q=B.indexOf(".",1),X.push(B.substring(1,~H?H:~Q?Q:B.length)),z+=!!~H&&!~Q?"(?:/([^/]+?))?":"/([^/]+?)",~Q)z+=(~H?"?":"")+"\\"+B.substring(Q)}else z+="/"+B;return{keys:X,pattern:new RegExp("^"+z+(Z?"(?=$|/)":"/?$"),"i")}}var u7=P(m(),1),g1=P(m(),1);var Gz=P(OZ(),1);var Pt=u7.useInsertionEffect,_t=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",jN=_t?u7.useLayoutEffect:u7.useEffect,jt=Pt||jN,Uz=($)=>{let Z=u7.useRef([$,(...J)=>Z[0](...J)]).current;return jt(()=>{Z[0]=$}),Z[1]};var jO=["popstate","pushState","replaceState","hashchange"],nH=[],OO=()=>nH.forEach(($)=>$()),Ot=($)=>{if(nH.push($)===1)jO.forEach((Z)=>addEventListener(Z,OO));return()=>{if(nH=nH.filter((Z)=>Z!==$),!nH.length)jO.forEach((Z)=>removeEventListener(Z,OO))}},bO=($,Z)=>Gz.useSyncExternalStore(Ot,$,Z),TO=()=>location.search,Yz=({ssrSearch:$}={})=>bO(TO,$!=null?()=>$:TO),CO=()=>location.pathname,p7=({ssrPath:$}={})=>bO(CO,$!=null?()=>$:CO);var Tt=($,{replace:Z=!1,state:J=null}={})=>history[Z?"replaceState":"pushState"](J,"",$),wO=($)=>[p7($),Tt],EO=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[EO]>"u"){for(let $ of["pushState","replaceState"]){let Z=history[$];history[$]=function(){let J=Z.apply(this,arguments),H=new Event($);return H.arguments=arguments,dispatchEvent(H),J}}Object.defineProperty(window,EO,{value:!0})}var RO=($="")=>$==="/"?"":$,kO=($,Z)=>$[0]==="~"?$.slice(1):RO(Z)+$,ON=($,Z)=>{return $=SO(RO($)),Z=SO(Z),!$||!Z.toLowerCase().indexOf($.toLowerCase())?Z.slice($.length)||"/":"~"+Z},SO=($)=>{try{return $.includes("%")?decodeURI($):$}catch(Z){return $}};var IO={hook:wO,searchHook:Yz,parser:_O,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:($)=>$,aroundNav:($,Z,J)=>$(Z,J)},yO=g1.createContext(IO),_2=()=>g1.useContext(yO),xO={},hO=g1.createContext(xO),TN=()=>g1.useContext(hO),vO=($,Z=$.base)=>ON(Z,$.hook($)[0]),CN=($)=>{let[Z,J]=$.hook($);return[ON($.base,Z),Uz((H,B)=>$.aroundNav(J,kO(H,$.base),B))]},M8=()=>CN(_2());var gO=($,Z,J,H)=>{let{pattern:B,keys:Q}=Z instanceof RegExp?{pattern:Z}:$(Z||"*",H),X=B.exec(J);if(!X)return[!1,null];let z={};for(let G=1;G<X.length;G++)z[G-1]=X[G];if(Q)for(let G=0;G<Q.length;G++)z[Q[G]]=X[G+1];else Object.assign(z,X.groups);return H?[!0,z,X[0]]:[!0,z]};var EN=({children:$,...Z})=>{let J=_2(),H=Z.hook?IO:J,B=H;if(Z.ssrPath){let[G,U=Z.ssrSearch??""]=Z.ssrPath.split("?");if(G)Z.ssrSearch=U,Z.ssrPath=G}Z.hrefs=Z.hrefs??Z.hook?.hrefs,Z.searchHook=Z.searchHook??Z.hook?.searchHook;let Q=g1.useRef(H),X=Q.current,z=X;for(let G in H){let U=G==="base"?H[G]+(Z[G]??""):Z[G]??H[G];if(U!==z[G]){if(X===z)Q.current=z={...z};z[G]=U}if(U!==H[G]||U!==B[G])B=z}return g1.createElement(yO.Provider,{value:B},$)},Ct=({children:$,component:Z},J)=>{if(Z)return g1.createElement(Z,{params:J});return typeof $==="function"?$(J):$},Et=($)=>{let Z=g1.useRef(xO),J=Z.current,H=Object.keys($);return Z.current=H.length!==Object.keys(J).length||H.some((B)=>$[B]!==J[B])?$:J};var Kz=({path:$,nest:Z,match:J,...H})=>{let B=_2(),Q=vO(B),[X,z,G]=J??gO(B.parser,$,Q,Z),U=Et({...TN(),...z});if(!X)return null;let Y=Ct(H,U);return g1.createElement(hO.Provider,{value:U},G?g1.createElement(EN,{base:G},Y):Y)},c7=g1.forwardRef(($,Z)=>{let J=_2(),[H,B]=CN(J),{to:Q="",href:X=Q,onClick:z,asChild:G,children:U,className:Y,replace:K,state:F,transition:W,...q}=$;if(q.onClick=Uz((N)=>{if(N.ctrlKey||N.metaKey||N.altKey||N.shiftKey||N.button!==0)return;if(z?.(N),!N.defaultPrevented)N.preventDefault(),B(X,$)}),q.href=J.hrefs(X[0]==="~"?X.slice(1):J.base+X,J),Y!==void 0)q.className=Y?.call?Y(H===X):Y;if(Z)q.ref=Z;return G&&g1.isValidElement(U)?g1.cloneElement(U,q):g1.createElement("a",q,U)}),fO=($,Z=[])=>{if(Array.isArray($))for(let J of $)fO(J&&J.type===g1.Fragment?J.props.children:J,Z);else Z.push($);return Z},mO=({children:$,location:Z})=>{let J=_2(),H=vO(J);for(let B of fO($)){let Q=0;if(g1.isValidElement(B)&&(Q=gO(J.parser,B.props.path,Z||H,B.props.nest))[0])return g1.cloneElement(B,{match:Q})}return null},uO=($)=>{let{to:Z,href:J=Z}=$,H=_2(),[,B]=CN(H),Q=Uz(()=>B(Z||J,$)),{ssrContext:X}=H;if(jN(()=>{Q()},[]),X)X.redirectTo=Z;return null};var H4={};b5(H4,{useToastManager:()=>IE,createToastManager:()=>yE,Viewport:()=>TT,Title:()=>eT,Root:()=>cT,Provider:()=>PT,Positioner:()=>wE,Portal:()=>UC,Description:()=>sT,Content:()=>dT,Close:()=>$C,Arrow:()=>RE,Action:()=>JC});var MT=P(m(),1);var pO=P(m(),1);function Z6($){pO.useEffect($,s2)}var Fz=P(m(),1),bN=Fz.createContext(void 0);function M9(){let $=Fz.useContext(bN);if(!$)throw Error(I0(73));return $}var iO=P(m(),1),kN=P(OZ(),1);var J6=P(m(),1),bt=OZ();function wt($,Z){return $===Z&&($!==0||1/$===1/Z)||$!==$&&Z!==Z}var St=typeof Object.is==="function"?Object.is:wt,Rt=bt.useSyncExternalStore,kt=J6.useRef,It=J6.useEffect,yt=J6.useMemo,xt=J6.useDebugValue;var wN=function($,Z,J,H,B){var Q=kt(null);if(Q.current===null){var X={hasValue:!1,value:null};Q.current=X}else X=Q.current;Q=yt(function(){function G(W){if(!U){if(U=!0,Y=W,W=H(W),B!==void 0&&X.hasValue){var q=X.value;if(B(q,W))return K=q}return K=W}if(q=K,St(Y,W))return q;var N=H(W);if(B!==void 0&&B(q,N))return Y=W,q;return Y=W,K=N}var U=!1,Y,K,F=J===void 0?null:J;return[function(){return G(Z())},F===null?void 0:function(){return G(F())}]},[Z,J,H,B]);var z=Rt($,Q[0],Q[1]);return It(function(){X.hasValue=!0,X.value=z},[z]),xt(z),z};var cO=P(m(),1);var SN=[],RN=void 0;function dO(){return RN}function lO($){SN.push($)}function d8($){let Z=(J,H)=>{let B=t1(ht).current,Q;try{RN=B;for(let X of SN)X.before(B);Q=$(J,H);for(let X of SN)X.after(B);B.didInitialize=!0}finally{RN=void 0}return Q};return Z.displayName=$.displayName||$.name,Z}function P9($){return cO.forwardRef(d8($))}function ht(){return{didInitialize:!1}}var vt=Wz(19),gt=vt?mt:ut;function qz($,Z,J,H,B){return gt($,Z,J,H,B)}function ft($,Z,J,H,B){let Q=iO.useCallback(()=>Z($.getSnapshot(),J,H,B),[$,Z,J,H,B]);return kN.useSyncExternalStore($.subscribe,Q,Q)}lO({before($){if($.syncIndex=0,!$.didInitialize)$.syncTick=1,$.syncHooks=[],$.didChangeStore=!0,$.getSnapshot=()=>{let Z=!1;for(let J=0;J<$.syncHooks.length;J+=1){let H=$.syncHooks[J],B=H.selector(H.store.state,H.a1,H.a2,H.a3);if(!Object.is(H.value,B))Z=!0,H.value=B}if(Z)$.syncTick+=1;return $.syncTick}},after($){if($.syncHooks.length>0){if($.didChangeStore)$.didChangeStore=!1,$.subscribe=(Z)=>{let J=new Set;for(let B of $.syncHooks)J.add(B.store);let H=[];for(let B of J)H.push(B.subscribe(Z));return()=>{for(let B of H)B()}};kN.useSyncExternalStore($.subscribe,$.getSnapshot,$.getSnapshot)}}});function mt($,Z,J,H,B){let Q=dO();if(!Q)return ft($,Z,J,H,B);let X=Q.syncIndex;Q.syncIndex+=1;let z;if(!Q.didInitialize)z={store:$,selector:Z,a1:J,a2:H,a3:B,value:Z($.getSnapshot(),J,H,B)},Q.syncHooks.push(z);else if(z=Q.syncHooks[X],z.store!==$||z.selector!==Z||!Object.is(z.a1,J)||!Object.is(z.a2,H)||!Object.is(z.a3,B)){if(z.store!==$)Q.didChangeStore=!0;z.store=$,z.selector=Z,z.a1=J,z.a2=H,z.a3=B,z.value=Z($.getSnapshot(),J,H,B)}return z.value}function ut($,Z,J,H,B){return wN($.subscribe,$.getSnapshot,$.getSnapshot,(Q)=>Z(Q,J,H,B))}class IN{static create($){return new this($)}constructor($){this.state=$,this.listeners=new Set,this.updateTick=0}subscribe=($)=>{return this.listeners.add($),()=>{this.listeners.delete($)}};getSnapshot=()=>{return this.state};setState($){if(this.state===$)return;this.state=$,this.updateTick+=1;let Z=this.updateTick;for(let J of this.listeners){if(Z!==this.updateTick)return;J($)}}update($){for(let Z in $)if(!Object.is(this.state[Z],$[Z])){this.setState({...this.state,...$});return}}set($,Z){if(!Object.is(this.state[$],Z))this.setState({...this.state,[$]:Z})}notifyAll(){let $={...this.state};this.setState($)}use($,Z,J,H){return qz(this,$,Z,J,H)}}var d7=P(m(),1);class h2 extends IN{constructor($,Z={},J){super($);this.context=Z,this.selectors=J}useSyncedValue($,Z){d7.useDebugValue($);let J=this;H0(()=>{if(J.state[$]!==Z)J.set($,Z)},[J,$,Z])}useSyncedValueWithCleanup($,Z){let J=this;H0(()=>{if(J.state[$]!==Z)J.set($,Z);return()=>{J.set($,void 0)}},[J,$,Z])}useSyncedValues($){let Z=this,J=Object.values($);H0(()=>{Z.update($)},[Z,...J])}useControlledProp($,Z){d7.useDebugValue($);let J=this,H=Z!==void 0;H0(()=>{if(H&&!Object.is(J.state[$],Z))J.setState({...J.state,[$]:Z})},[J,$,Z,H])}select($,Z,J,H){let B=this.selectors[$];return B(this.state,Z,J,H)}useState($,Z,J,H){return d7.useDebugValue($),qz(this,this.selectors[$],Z,J,H)}useContextCallback($,Z){d7.useDebugValue($);let J=Y0(Z??z1);this.context[$]=J}useStateSetter($){let Z=d7.useRef(void 0);if(Z.current===void 0)Z.current=(J)=>{this.set($,J)};return Z.current}observe($,Z){let J;if(typeof $==="function")J=$;else J=this.selectors[$];let H=J(this.state);return Z(H,H,this),this.subscribe((B)=>{let Q=J(B);if(!Object.is(H,Q)){let X=H;H=Q,Z(Q,X,this)}})}}function j2(...$){return()=>{for(let Z=0;Z<$.length;Z+=1){let J=$[Z];if(J)J()}}}function a0($,Z,J,H){return $.addEventListener(Z,J,H),()=>{$.removeEventListener(Z,J,H)}}var Nz=P(m(),1);function rO(){let[,$]=Nz.useState({});return Nz.useCallback(()=>{$({})},[])}var Az=null,fD0=globalThis.requestAnimationFrame;class aO{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=($)=>{this.isScheduled=!1;let Z=this.callbacks,J=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,J>0)for(let H=0;H<Z.length;H+=1)Z[H]?.($)};request($){let Z=this.nextId;this.nextId+=1,this.callbacks.push($),this.callbacksCount+=1;let J=!1;if(!this.isScheduled||J)requestAnimationFrame(this.tick),this.isScheduled=!0;return Z}cancel($){let Z=$-this.startId;if(Z<0||Z>=this.callbacks.length)return;if(this.callbacks[Z]===null)return;this.callbacks[Z]=null,this.callbacksCount-=1}}var Dz=new aO;class v2{static create(){return new v2}static request($){return Dz.request($)}static cancel($){return Dz.cancel($)}currentId=Az;request($){this.cancel(),this.currentId=Dz.request(()=>{this.currentId=Az,$()})}cancel=()=>{if(this.currentId!==Az)Dz.cancel(this.currentId),this.currentId=Az};disposeEffect=()=>{return this.cancel}}function P4(){let $=t1(v2.create).current;return Z6($.disposeEffect),$}var sH=0;class d5{static create(){return new d5}currentId=sH;start($,Z){this.clear(),this.currentId=setTimeout(()=>{this.currentId=sH,Z()},$)}isStarted(){return this.currentId!==sH}clear=()=>{if(this.currentId!==sH)clearTimeout(this.currentId),this.currentId=sH};disposeEffect=()=>{return this.clear}}function i1(){let $=t1(d5.create).current;return Z6($.disposeEffect),$}var oO=0;function Vz($){return oO+=1,`${$}-${Math.random().toString(36).slice(2,6)}-${oO}`}function Lz($,Z){if(typeof $==="string")return{description:$};if(typeof $==="function"){let J=$(Z);return typeof J==="string"?{description:J}:J}return $}var $5={};b5($5,{screenReader:()=>fN,os:()=>hN,mediaQuery:()=>uN,env:()=>mN,engine:()=>gN});var hN={};b5(hN,{windows:()=>lt,mac:()=>eO,linux:()=>it,ios:()=>yN,apple:()=>xN,android:()=>tO});function pt(){if(typeof navigator>"u")return{userAgent:"",platform:"",maxTouchPoints:0};return{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:ct,platform:dt,maxTouchPoints:nO}=pt(),l7=ct.toLowerCase(),i7=dt.toLowerCase();var yN=/^i(os$|p)/.test(i7)||i7==="macintel"&&nO>1,sO="android",tO=i7===sO||l7.includes(sO),eO=!yN&&i7.startsWith("mac"),lt=i7.startsWith("win"),it=!tO&&/^(linux|chrome os)/.test(i7),xN=eO||yN;var gN={};b5(gN,{webkit:()=>vN,gecko:()=>rt,blink:()=>at});var vN=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none"),rt=!vN&&l7.includes("firefox"),at=!vN&&l7.includes("chrom");var fN={};b5(fN,{voiceOver:()=>ot});var ot=xN;var mN={};b5(mN,{jsdom:()=>nt});var nt=/jsdom|happydom/.test(l7);var uN={};b5(uN,{iOS:()=>st});var st="@supports (-webkit-touch-callout: none)";function d1($){let Z=$.activeElement;while(Z?.shadowRoot?.activeElement!=null)Z=Z.shadowRoot.activeElement;return Z}function R0($,Z){if(!$||!Z)return!1;let J=Z.getRootNode?.();if($.contains(Z))return!0;if(J&&H6(J)){let H=Z;while(H){if($===H)return!0;H=H.parentNode||H.host}}return!1}function P1($){if("composedPath"in $)return $.composedPath()[0]??$.target;return $.target}var tH="data-base-ui-focusable";var pN="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",eH="ArrowLeft",$B="ArrowRight",cN="ArrowUp",Mz="ArrowDown";var Z8={};b5(Z8,{startingStyle:()=>r7,endingStyle:()=>ZB});var r7="data-starting-style",ZB="data-ending-style";var tt={[r7]:""},et={[ZB]:""},B2={transitionStatus($){if($==="starting")return tt;if($==="ending")return et;return null}};var a7={};b5(a7,{startingStyle:()=>$e,side:()=>Je,open:()=>dN,endingStyle:()=>Ze,closed:()=>lN,anchorHidden:()=>iN,align:()=>He});var dN="data-open",lN="data-closed",$e=r7,Ze=ZB,iN="data-anchor-hidden",Je="data-side",He="data-align";var _z={};b5(_z,{pressed:()=>rN,popupOpen:()=>Pz});var Pz="data-popup-open",rN="data-pressed";var Be={[Pz]:""},Qe={[Pz]:"",[rN]:""},Xe={[dN]:""},ze={[lN]:""},Ge={[iN]:""},_9={open($){if($)return Be;return null}},JB={open($){if($)return Qe;return null}},J8={open($){if($)return Xe;return ze},anchorHidden($){if($)return Ge;return null}},t2={...J8,...B2};var QV0=_z.popupOpen,HB="data-trigger-disabled";function B6($,Z){if(!s0($))return!1;let J=$;if(Z.hasElement(J))return!J.hasAttribute(HB);for(let[,H]of Z.entries())if(R0(H,J))return!H.hasAttribute(HB);return!1}function jz($,Z){if(Z==null)return!1;if("composedPath"in $)return $.composedPath().includes(Z);let J=$;return J.target!=null&&Z.contains(J.target)}function ZT($){return $.matches("html,body")}function o7($){return _1($)&&$.matches(pN)}function aN($){return $?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${pN}`)!=null}function BB($){if(!$)return!1;return $.getAttribute("role")==="combobox"&&o7($)}function j9($){if(!$||$5.env.jsdom)return!0;try{return $.matches(":focus-visible")}catch(Z){return!0}}function QB($){if(!$)return null;return $.hasAttribute(tH)?$:$.querySelector(`[${tH}]`)||$}function P8($,Z,J=!0){return $.filter((B)=>B.parentId===Z).flatMap((B)=>[...!J||B.context?.open?[B]:[],...P8($,B.id,J)])}function oN($,Z){let J=[],H=$.find((B)=>B.id===Z)?.parentId;while(H){let B=$.find((Q)=>Q.id===H);if(H=B?.parentId,B)J=J.concat(B)}return J}function h4($){$.preventDefault(),$.stopPropagation()}function JT($){return"nativeEvent"in $}function TZ($){if($.pointerType===""&&$.isTrusted)return!0;if($5.os.android&&$.pointerType)return $.type==="click"&&$.buttons===1;return $.detail===0&&!$.pointerType}function CZ($){if($5.env.jsdom)return!1;return!$5.os.android&&$.width===0&&$.height===0||$5.os.android&&$.width===1&&$.height===1&&$.pressure===0&&$.detail===0&&$.pointerType==="mouse"||$.width<1&&$.height<1&&$.pressure===0&&$.detail===0&&$.pointerType==="touch"}function H8($,Z){let J=["mouse","pen"];if(!Z)J.push("",void 0);return J.includes($)}function HT($){let Z=$.type;return Z==="click"||Z==="mousedown"||Z==="keydown"||Z==="keyup"}var{min:Q6,max:l8,round:X6,floor:zB}=Math,O9=($)=>({x:$,y:$}),Ue={left:"right",right:"left",bottom:"top",top:"bottom"};function Tz($,Z,J){return l8($,Q6(Z,J))}function T9($,Z){return typeof $==="function"?$(Z):$}function e2($){return $.split("-")[0]}function _8($){return $.split("-")[1]}function Cz($){return $==="x"?"y":"x"}function GB($){return $==="y"?"height":"width"}function v4($){let Z=$[0];return Z==="t"||Z==="b"?"y":"x"}function UB($){return Cz(v4($))}function XT($,Z,J){if(J===void 0)J=!1;let H=_8($),B=UB($),Q=GB(B),X=B==="x"?H===(J?"end":"start")?"right":"left":H==="start"?"bottom":"top";if(Z.reference[Q]>Z.floating[Q])X=XB(X);return[X,XB(X)]}function zT($){let Z=XB($);return[Oz($),Z,Oz(Z)]}function Oz($){return $.includes("start")?$.replace("start","end"):$.replace("end","start")}var BT=["left","right"],QT=["right","left"],Ye=["top","bottom"],Ke=["bottom","top"];function Fe($,Z,J){switch($){case"top":case"bottom":if(J)return Z?QT:BT;return Z?BT:QT;case"left":case"right":return Z?Ye:Ke;default:return[]}}function GT($,Z,J,H){let B=_8($),Q=Fe(e2($),J==="start",H);if(B){if(Q=Q.map((X)=>X+"-"+B),Z)Q=Q.concat(Q.map(Oz))}return Q}function XB($){let Z=e2($);return Ue[Z]+$.slice(Z.length)}function We($){var Z,J,H,B;return{top:(Z=$.top)!=null?Z:0,right:(J=$.right)!=null?J:0,bottom:(H=$.bottom)!=null?H:0,left:(B=$.left)!=null?B:0}}function Ez($){return typeof $!=="number"?We($):{top:$,right:$,bottom:$,left:$}}function n7($){let{x:Z,y:J,width:H,height:B}=$;return{width:H,height:B,top:J,left:Z,right:Z+H,bottom:J+B,x:Z,y:J}}function z6($,Z){return Z<0||Z>=$.length}function s7($,Z){return j8($.current,{disabledIndices:Z})}function EZ($,Z){return j8($.current,{decrement:!0,startingIndex:$.current.length,disabledIndices:Z})}function j8($,{startingIndex:Z=-1,decrement:J=!1,disabledIndices:H,amount:B=1}={}){let Q=Z;do Q+=J?-B:B;while(Q>=0&&Q<=$.length-1&&M3($,Q,H));return Q}function M3($,Z,J){if(typeof J==="function"?J(Z):J?.includes(Z)??!1)return!0;let B=$[Z];if(!B)return!1;if(!t7(B))return!0;if(B.matches(":disabled"))return!0;return!J&&(B.hasAttribute("disabled")||B.getAttribute("aria-disabled")==="true")}function qe($){return $.visibility==="hidden"||$.visibility==="collapse"}function t7($,Z=$?g2($):null){if(!$||!$.isConnected||!Z||qe(Z))return!1;if(typeof $.checkVisibility==="function")return $.checkVisibility();return Z.display!=="none"&&Z.display!=="contents"}var Ne='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function Ae($){let Z=$.assignedSlot;if(Z)return Z;if($.parentElement)return $.parentElement;let J=$.getRootNode();return H6(J)?J.host:null}function sN($){for(let Z of Array.from($.children))if(O2(Z)==="summary")return Z;return null}function De($,Z){let J=sN(Z);return!!J&&($===J||R0(J,$))}function UT($){let Z=$?O2($):"";return $!=null&&$.matches(Ne)&&(Z!=="summary"||$.parentElement!=null&&O2($.parentElement)==="details"&&sN($.parentElement)===$)&&(Z!=="details"||sN($)==null)&&(Z!=="input"||$.type!=="hidden")}function YT($){if(!UT($)||!$.isConnected||$.matches(":disabled"))return!1;for(let Z=$;Z;Z=Ae(Z)){let J=Z!==$,H=O2(Z)==="slot";if(Z.hasAttribute("inert"))return!1;if(J&&O2(Z)==="details"&&!Z.open&&!De($,Z)||Z.hasAttribute("hidden")||!H&&!Ve(Z,J))return!1}return!0}function Ve($,Z){let J=g2($);if(!Z)return t7($,J);return J.display!=="none"}function KT($){let Z=$.tabIndex;if(Z<0){let J=O2($);if(J==="details"||J==="audio"||J==="video"||_1($)&&$.isContentEditable)return 0}return Z}function nN($){if(O2($)!=="input")return null;let Z=$;return Z.type==="radio"&&Z.name!==""?Z:null}function Le($,Z){let J=nN($);if(!J)return!0;let H=Z.find((B)=>{let Q=nN(B);return Q?.name===J.name&&Q.form===J.form&&Q.checked});if(H)return H===J;return Z.find((B)=>{let Q=nN(B);return Q?.name===J.name&&Q.form===J.form})===J}function FT($){if(_1($)&&O2($)==="slot"){let Z=$.assignedElements({flatten:!0});if(Z.length>0)return Z}if(_1($)&&$.shadowRoot)return Array.from($.shadowRoot.children);return Array.from($.children)}function WT($,Z){FT($).forEach((J)=>{if(UT(J))Z.push(J);WT(J,Z)})}function qT($,Z,J){FT($).forEach((H)=>{if(_1(H)&&H.matches(Z))J.push(H);qT(H,Z,J)})}function bz($){return YT($)&&KT($)>=0}function tN($){let Z=[];return WT($,Z),Z.filter(YT)}function bZ($){let Z=tN($);return Z.filter((J)=>KT(J)>=0&&Le(J,Z))}function NT($,Z){let J=bZ($),H=J.length;if(H===0)return;let B=d1(f0($)),Q=J.indexOf(B),X=Q===-1?Z===1?0:H-1:Q+Z;return J[X]}function wZ($){return NT(f0($).body,1)||$}function wz($){return NT(f0($).body,-1)||$}function AT($,Z){if(!$)return null;let J=bZ(f0($).body),H=J.length;if(H===0)return null;let B=J.indexOf($);if(B===-1)return null;let Q=(B+Z+H)%H;return J[Q]}function DT($){return AT($,1)}function VT($){return AT($,-1)}function P3($,Z){let J=Z||$.currentTarget,H=$.relatedTarget;return!H||!R0(J,H)}function LT($){bZ($).forEach((J)=>{J.dataset.tabindex=J.getAttribute("tabindex")||"",J.setAttribute("tabindex","-1")})}function eN($){let Z=[];qT($,"[data-tabindex]",Z),Z.forEach((J)=>{let H=J.dataset.tabindex;if(delete J.dataset.tabindex,H)J.setAttribute("tabindex",H);else J.removeAttribute("tabindex")})}function $A($){let Z=new Map,J=0,H=0;return $.forEach((B,Q)=>{let X=B.transitionStatus==="ending";if(Z.set(B.id,{value:B,domIndex:Q,visibleIndex:X?-1:J,offsetY:H}),H+=B.height||0,!X)J+=1}),Z}function ZA($,Z){let J=0;return $.map((H)=>{if(H.transitionStatus==="ending")return H;let B=J>=Z;return J+=1,H.limited===B?H:{...H,limited:B}})}var i8={toasts:($)=>$.toasts,isEmpty:($)=>$.toasts.length===0,toast:($,Z)=>$.toastMetadata.get(Z)?.value,toastIndex:($,Z)=>$.toastMetadata.get(Z)?.domIndex??-1,toastOffsetY:($,Z)=>$.toastMetadata.get(Z)?.offsetY??0,toastVisibleIndex:($,Z)=>$.toastMetadata.get(Z)?.visibleIndex??-1,focused:($)=>$.focused,expanded:($)=>$.hovering||$.focused,expandedOrOutOfFocus:($)=>$.hovering||$.focused||!$.isWindowFocused,prevFocusElement:($)=>$.prevFocusElement};class JA extends h2{timers=new Map;areTimersPaused=!1;constructor($){super({...$,toastMetadata:$A($.toasts)},{},i8)}setViewport=($)=>{this.set("viewport",$)};syncProviderProps($,Z){let J=this.state.limit!==Z;if(this.state.timeout===$&&!J)return;let H={timeout:$,limit:Z};if(J){let B=ZA(this.state.toasts,Z);H.toasts=B,H.toastMetadata=$A(B)}this.update(H)}disposeEffect=()=>{return()=>{this.timers.forEach(($)=>{$.timeout?.clear()}),this.timers.clear()}};removeToast($,Z=!1){let J=i8.toastIndex(this.state,$);if(J===-1)return;let H=this.state.toasts[J];if(!Z)H?.onRemove?.();let B=[...this.state.toasts];B.splice(J,1),this.setToasts(B)}addToast=($)=>{let{timeout:Z,limit:J}=this.state,H=$.id||Vz("toast");if($.id){let z=i8.toast(this.state,$.id);if(z)if(z.transitionStatus==="ending")this.removeToast($.id,!0);else{let{id:G,transitionStatus:U,...Y}=$;return this.updateToastInternal($.id,Y,!0,!0),$.id}}let B={...$,id:H,updateKey:0,transitionStatus:"starting"},Q=[B,...this.state.toasts];this.setToasts(ZA(Q,J));let X=B.timeout??Z;if(B.type!=="loading"&&X>0)this.scheduleTimer(H,X,()=>this.closeToast(H));if(i8.expandedOrOutOfFocus(this.state))this.pauseTimers();return H};updateToast=($,Z)=>{let J=i8.toast(this.state,$);if(!J||J.transitionStatus==="ending")return;this.updateToastInternal($,typeof Z==="function"?Z(J):Z,!1,!0)};updateToastInternal=($,Z,J=!1,H=!1)=>{let{timeout:B,toasts:Q}=this.state,X=i8.toast(this.state,$);if(!X)return;if(X.transitionStatus==="ending")return;let z={...X,...Z,...H&&{updateKey:X.updateKey+1}};this.setToasts(Q.map((N)=>N.id===$?z:N));let G=z.timeout??B,U=X.timeout??B,Y=Object.hasOwn(Z,"timeout"),K=z.transitionStatus!=="ending"&&z.type!=="loading"&&G>0,F=this.timers.has($),W=U!==G,q=X.type==="loading";if(!K&&F){this.clearTimer($);return}if(K&&(!F||W||Y||q||J)){if(this.clearTimer($),this.scheduleTimer($,G,()=>this.closeToast($)),i8.expandedOrOutOfFocus(this.state))this.pauseTimers()}};closeToast=($)=>{let Z=$===void 0,{limit:J,toasts:H}=this.state,B;if(Z)B=H,this.clearTimers();else{let z=i8.toast(this.state,$);if(!z)return;B=[z],this.clearTimer($)}let Q=H.map((z)=>Z||z.id===$?{...z,transitionStatus:"ending",height:0}:z),X=ZA(Q,J);this.setToasts(X,!X.some((z)=>z.transitionStatus!=="ending")),B.forEach((z)=>{if(z.transitionStatus!=="ending")z.onClose?.()}),this.handleFocusManagement($)};promiseToast=($,Z)=>{let J=Lz(Z.loading),H=this.addToast({...J,type:"loading"}),B=$.then((Q)=>{let X=Lz(Z.success,Q);return this.updateToast(H,{...X,type:"success",timeout:X.timeout}),Q}).catch((Q)=>{let X=Lz(Z.error,Q);return this.updateToast(H,{...X,type:"error",timeout:X.timeout}),Promise.reject(Q)});if({}.hasOwnProperty.call(Z,"setPromise"))Z.setPromise(B);return B};pauseTimers(){if(this.areTimersPaused)return;this.areTimersPaused=!0,this.timers.forEach(($)=>{if($.timeout)$.timeout.clear(),$.remaining=Math.max($.remaining-(Date.now()-$.start),0)})}resumeTimers(){if(!this.areTimersPaused)return;this.areTimersPaused=!1,this.timers.forEach(($,Z)=>{$.remaining=$.remaining>0?$.remaining:$.delay,$.timeout??=d5.create(),$.timeout.start($.remaining,()=>{this.handleTimerFired(Z),$.callback()}),$.start=Date.now()})}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=($)=>{if($.pointerType!=="touch")return;let Z=P1($);if(R0(this.state.viewport,Z))return;this.resumeTimers(),this.update({hovering:!1,focused:!1})};scheduleTimer($,Z,J){let H=Date.now(),Q=!i8.expandedOrOutOfFocus(this.state)?d5.create():void 0;Q?.start(Z,()=>{this.handleTimerFired($),J()}),this.timers.set($,{timeout:Q,start:H,delay:Z,remaining:Z,callback:J})}clearTimers(){this.timers.forEach(($)=>{$.timeout?.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer($){this.timers.get($)?.timeout?.clear(),this.timers.delete($),this.resetPausedStateIfNoTimersRemain()}handleTimerFired($){this.timers.delete($),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){if(this.timers.size===0)this.areTimersPaused=!1}setToasts($,Z=$.length===0){let J={toasts:$,toastMetadata:$A($)};if(Z)J.hovering=!1,J.focused=!1;this.update(J)}handleFocusManagement($){let Z=d1(f0(this.state.viewport));if(!this.state.viewport||!R0(this.state.viewport,Z)||!j9(Z))return;if($===void 0){this.restoreFocusToPrevElement();return}let J=i8.toasts(this.state),H=i8.toastIndex(this.state,$),B=(X,z)=>{for(let G=X;G>=0&&G<J.length;G+=z)if(J[G].transitionStatus!=="ending")return J[G];return null},Q=B(H+1,1)??B(H-1,-1);if(Q)Q.ref?.current?.focus();else this.restoreFocusToPrevElement()}}var Sz=P(c(),1),PT=function(Z){let{children:J,timeout:H=5000,limit:B=3,toastManager:Q}=Z,X=t1(()=>new JA({timeout:H,limit:B,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return Z6(X.disposeEffect),MT.useEffect(function(){if(!Q)return;return Q[" subscribe"](({action:U,options:Y})=>{let K=Y.id;if(U==="promise"&&Y.promise)X.promiseToast(Y.promise,Y);else if(U==="update"&&K)X.updateToast(K,Y.updates);else if(U==="close")X.closeToast(K);else X.addToast(Y)})},[X,Q]),Sz.jsxs(bN.Provider,{value:X,children:[Sz.jsx(Me,{store:X,timeout:H,limit:B}),J]})};function Me($){let{store:Z,timeout:J,limit:H}=$;return H0(()=>{Z.syncProviderProps(J,H)},[Z,J,H]),null}var O8=P(m(),1);var _T={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},r8={..._T,position:"fixed",top:0,left:0},Rz={..._T,position:"absolute"};var kz=P(m(),1);var jT=P(c(),1),g4=kz.forwardRef(function(Z,J){let[H,B]=kz.useState();return H0(()=>{if($5.screenReader.voiceOver&&$5.engine.webkit)B("button")},[]),jT.jsx("span",{...Z,ref:J,style:r8,"aria-hidden":H?void 0:!0,...{tabIndex:0,role:H},"data-base-ui-focus-guard":""})});var OT="--toast-frontmost-height";var _3=P(c(),1),TT=O8.forwardRef(function(Z,J){let{render:H,className:B,style:Q,children:X,...z}=Z,G=M9(),U=i1(),Y=O8.useRef(!1),K=O8.useRef(!1),F=O8.useRef(!1),W=G.useState("isEmpty"),q=G.useState("toasts"),N=G.useState("focused"),D=G.useState("expanded"),A=G.useState("prevFocusElement"),V=q[0]?.height,L=q.some((g)=>g.transitionStatus==="ending"),j=q.filter((g)=>g.priority==="high");O8.useEffect(()=>{let g=G.state.viewport;if(!g||W)return;let E=w1(g),l=f0(g);function r(o){if(o.key==="F6"&&P1(o)!==g)o.preventDefault(),G.set("prevFocusElement",d1(l)),g?.focus({preventScroll:!0}),G.pauseTimers(),G.set("focused",!0)}function h(o){if(P1(o)!==E)return;G.set("isWindowFocused",!1),G.pauseTimers()}function d(o){if(o.relatedTarget)return;let p=P1(o),i=d1(f0(g));if(p===E||!R0(g,p)||!j9(i))G.resumeTimers();U.start(0,()=>G.set("isWindowFocused",!0))}return j2(a0(E,"keydown",r),a0(E,"blur",h,!0),a0(E,"focus",d,!0),a0(l,"pointerdown",G.handleDocumentPointerDown,!0))},[G,U,W]);function M(g){Y.current=!0;let E=g.relatedTarget===G.state.viewport?q.find((l)=>l.transitionStatus!=="ending"&&!l.limited):void 0;if(E)E.ref?.current?.focus();else G.restoreFocusToPrevElement()}function _(g){if(g.key==="Tab"&&g.shiftKey&&P1(g.nativeEvent)===G.state.viewport)g.preventDefault(),G.restoreFocusToPrevElement()}function w(){if(G.state.toasts.some((E)=>E.transitionStatus==="ending")||F.current||!K.current)return;if(G.state.isWindowFocused)G.resumeTimers();G.set("hovering",!1),K.current=!1}O8.useEffect(w,[L,G]);function T(){G.pauseTimers(),G.set("hovering",!0),K.current=!1}function b(){if(G.state.isWindowFocused)G.resumeTimers()}function C(){K.current=!0,w()}function k(g){if(g.pointerType==="touch")F.current=!0}function S(g){if(g.pointerType!=="touch")return;F.current=!1,w()}function R(){if(Y.current){Y.current=!1;return}if(N)return;if(j9(d1(f0(G.state.viewport))))G.set("focused",!0),G.pauseTimers()}function O(g){if(!N||R0(G.state.viewport,g.relatedTarget))return;G.set("focused",!1),b()}let y={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:T,onMouseMove:T,onMouseLeave:C,onFocus:R,onBlur:O,onKeyDown:_,onClick:R,onPointerDown:k,onPointerUp:S,onPointerCancel:S,style:{[OT]:V?`${V}px`:void 0}},I={expanded:D},x=!W&&A&&_3.jsx(g4,{onFocus:M}),v=G0("div",Z,{ref:[J,G.setViewport],state:I,props:[y,z,{children:_3.jsxs(O8.Fragment,{children:[x,X,x]})}]});return _3.jsxs(O8.Fragment,{children:[x,v,!N&&j.length>0&&_3.jsx("div",{style:r8,children:j.map((g)=>_3.jsxs("div",{role:"alert","aria-atomic":!0,children:[_3.jsx("div",{children:g.title}),_3.jsx("div",{children:g.description})]},g.id))})]})});var D5=P(m(),1),uT=P(B8(),1);function T8($){if(Wz(19))return $;return $?"true":void 0}var Iz=P(m(),1),HA=Iz.createContext(void 0);function G6(){let $=Iz.useContext(HA);if(!$)throw Error(I0(66));return $}var CT=P(m(),1);var BA=P(B8(),1);function a8($){if($==null)return $;return"current"in $?$.current:$}var yz=null;function _e($){if(!yz){let Z=[];yz=Z,queueMicrotask(()=>{yz=null,BA.flushSync(()=>{for(let J of Z)J()})})}yz.push($)}function f4($,Z=!1,J=!1){let H=P4();return Y0((B,Q=null)=>{H.cancel();let X=a8($);if(X==null)return;let z=X,G=()=>{if(!J){BA.flushSync(B);return}_e(()=>{if(!Q?.aborted)B()})};if(typeof z.getAnimations!=="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){B();return}function U(){Promise.all(z.getAnimations().map((Y)=>Y.finished)).then(()=>{if(!Q?.aborted)G()},()=>{if(Q?.aborted)return;if(z.getAnimations().some((K)=>K.pending||K.playState!=="finished")){U();return}G()})}if(Z){let Y=r7;if(!z.hasAttribute(Y)){H.request(U);return}let K=new MutationObserver(()=>{if(!z.hasAttribute(Y))K.disconnect(),U()});K.observe(z,{attributes:!0,attributeFilter:[Y]}),Q?.addEventListener("abort",()=>K.disconnect(),{once:!0});return}H.request(U)})}function A5($){let{enabled:Z=!0,open:J,ref:H,batch:B=!1,onComplete:Q}=$,X=Y0(Q),z=f4(H,J,B);CT.useEffect(()=>{if(!Z)return;let G=new AbortController;return z(X,G.signal),()=>{G.abort()}},[Z,J,X,z])}var ET=500,xz=500,bT={style:{transition:"none"}},SZ="data-base-ui-click-trigger";var wT="[data-base-ui-swipe-ignore]",ST="[data-swipe-ignore]",RT={fallbackAxisSide:"none"},C9={fallbackAxisSide:"end"},kT={clipPath:"inset(50%)",position:"fixed",top:0,left:0};var vz=P(m(),1);function T2($,Z=Number.MIN_SAFE_INTEGER,J=Number.MAX_SAFE_INTEGER){return Math.max(Z,Math.min($,J))}function hz($,Z){let J=(Z??w1($).getComputedStyle($)).transform,H=0,B=0,Q=1;if(J&&J!=="none"){let X=J.match(/matrix(?:3d)?\(([^)]+)\)/);if(X){let z=X[1].split(", ").map(parseFloat);if(z.length===6)H=z[4],B=z[5],Q=Math.sqrt(z[0]*z[0]+z[1]*z[1]);else if(z.length===16)H=z[12],B=z[13],Q=z[0]}}return{x:H,y:B,scale:Q}}function gz($,Z,J){switch($){case"up":return-J;case"down":return J;case"left":return-Z;case"right":return Z;default:return 0}}var fz="--toast-index",IT="--toast-offset-y",yT="--toast-height",xT="--toast-swipe-movement-x",hT="--toast-swipe-movement-y";var gT="data-swipe-direction",VL0=Z8.startingStyle,LL0=Z8.endingStyle;var pT=P(c(),1),Oe={...B2,swipeDirection($){return $?{[gT]:$}:null}},fT=40,Te=10,mT=0.5,Ce=1,Ee=`${wT},${ST}`,cT=D5.forwardRef(function(Z,J){let{toast:H,render:B,className:Q,swipeDirection:X=["down","right"],style:z,...G}=Z,U=H.positionerProps?.anchor!==void 0,Y=[];if(!U)Y=Array.isArray(X)?X:[X];let K=Y.length>0,F=M9(),[W,q]=D5.useState(void 0),[N,D]=D5.useState(!1),[A,V]=D5.useState(!1),[L,j]=D5.useState({x:0,y:0}),[M,_]=D5.useState({x:0,y:0,scale:1}),[w,T]=D5.useState(),[b,C]=D5.useState(),[k,S]=D5.useState(null),R=D5.useRef(null),O=D5.useRef(void 0),y=D5.useRef({x:0,y:0}),I=D5.useRef({x:0,y:0,scale:1}),x=D5.useRef(void 0),v=D5.useRef(0),g=D5.useRef(!1),E=D5.useRef({x:0,y:0}),l=D5.useRef(!1),r=D5.useRef({x:0,y:0}),h=D5.useRef(null),d=D5.useRef(null),o=F.useState("toastIndex",H.id),p=F.useState("toastVisibleIndex",H.id),i=F.useState("toastOffsetY",H.id),n=F.useState("focused"),Z0=F.useState("expanded");A5({open:H.transitionStatus!=="ending",ref:R,onComplete(){if(H.transitionStatus==="ending")F.removeToast(H.id)}});let J0=Y0((M0=!1)=>{let A0=R.current;if(!A0)return;let L0=A0.style.height;A0.style.height="auto";let f=A0.offsetHeight;A0.style.height=L0;function u(){F.updateToastInternal(H.id,{ref:R,height:f,transitionStatus:void 0})}if(M0)uT.flushSync(u);else u()});H0(()=>{let M0=O.current;if(H.transitionStatus!=="starting"&&M0===H.id)return;if(M0!==void 0)q(void 0),_({x:0,y:0,scale:1}),U0({x:0,y:0});O.current=H.id,J0()},[J0,H.id,H.transitionStatus]);function U0(M0){r.current=M0,j(M0)}H0(()=>{return()=>{d.current?.abort()}},[]);function z0(M0,A0){let L0=(t)=>t>0?t**mT:-(Math.abs(t)**mT),f=M0>0&&!Y.includes("right")||M0<0&&!Y.includes("left"),u=A0>0&&!Y.includes("down")||A0<0&&!Y.includes("up");return{x:f?L0(M0):M0,y:u?L0(A0):A0}}let B0=Y0((M0)=>{if(M0.pointerId!==h.current)return;h.current=null,d.current?.abort(),d.current=null,D(!1),V(!1),S(null);let A0=I.current;if(M0.type==="pointercancel"||g.current){U0({x:A0.x,y:A0.y}),q(void 0);return}let L0=r.current,f=L0.x-A0.x,u=L0.y-A0.y,t;for(let W0 of Y)if(gz(W0,f,u)>fT){t=W0;break}if(t)q(t),F.closeToast(H.id);else U0({x:A0.x,y:A0.y}),q(void 0)});function N0(M0){if(M0.button!==0)return;if(M0.pointerType==="touch")F.pauseTimers();if(P1(M0.nativeEvent)?.closest(`button,a,input,textarea,[role="button"],${Ee}`))return;g.current=!1,x.current=void 0,v.current=0,h.current=M0.pointerId,y.current={x:M0.clientX,y:M0.clientY},E.current=y.current;let f=M0.currentTarget,u=hz(f);I.current=u,_(u),U0({x:u.x,y:u.y}),F.set("hovering",!0),D(!0),V(!1),S(null),l.current=!0,d.current?.abort();let t=new AbortController;d.current=t;let W0=f0(f);W0.addEventListener("pointerup",B0,{signal:t.signal}),W0.addEventListener("pointercancel",B0,{signal:t.signal}),f.setPointerCapture?.(M0.pointerId)}function D0(M0){if(M0.pointerId!==h.current)return;if(M0.preventDefault(),l.current)y.current={x:M0.clientX,y:M0.clientY},l.current=!1;let{clientY:A0,clientX:L0,movementX:f,movementY:u}=M0;if(u<0&&A0>E.current.y||u>0&&A0<E.current.y)E.current={x:E.current.x,y:A0};if(f<0&&L0>E.current.x||f>0&&L0<E.current.x)E.current={x:L0,y:E.current.y};let t=L0-y.current.x,W0=A0-y.current.y,S0=A0-E.current.y,p0=L0-E.current.x,g0=k;if(!A){if(Math.sqrt(t*t+W0*W0)>=Ce){V(!0);let W1=Y.includes("left")||Y.includes("right"),Q5=Y.includes("up")||Y.includes("down");if(W1&&Q5){let C0=Math.abs(t),x0=Math.abs(W0);g0=C0>x0?"horizontal":"vertical",S(g0)}}}let T0;if(!x.current){if(g0==="vertical"){if(W0>0)T0="down";else if(W0<0)T0="up"}else if(g0==="horizontal"){if(t>0)T0="right";else if(t<0)T0="left"}else if(Math.abs(t)>=Math.abs(W0))T0=t>0?"right":"left";else T0=W0>0?"down":"up";if(T0&&Y.includes(T0))x.current=T0,v.current=gz(T0,t,W0),q(T0)}else{let E1=x.current,W1=gz(E1,p0,S0);if(W1>fT)g.current=!1,q(E1);else if(!(Y.includes("left")&&Y.includes("right"))&&!(Y.includes("up")&&Y.includes("down"))&&v.current-W1>=Te)g.current=!0}let d0=z0(t,W0),Q1=I.current.x,e0=I.current.y,c0=Y.includes("left")||Y.includes("right"),y0=Y.includes("up")||Y.includes("down");if(g0!=="vertical"&&c0)Q1+=d0.x;if(g0!=="horizontal"&&y0)e0+=d0.y;U0({x:Q1,y:e0})}function F0(M0){if(M0.key==="Escape"){if(!R.current||!R0(R.current,d1(f0(R.current))))return;F.closeToast(H.id)}}D5.useEffect(()=>{let M0=R.current;if(!K||!M0)return;function A0(L0){if(h.current===null||!R0(M0,P1(L0)))return;L0.preventDefault()}return a0(M0,"touchmove",A0,{passive:!1})},[K]);function s(){let M0=L.x-M.x,A0=L.y-M.y;return{transition:N?"none":void 0,transform:N?`translateX(${L.x}px) translateY(${L.y}px) scale(${M.scale})`:void 0,[xT]:`${M0}px`,[hT]:`${A0}px`}}let a=H.priority==="high",e={role:a?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":w,"aria-describedby":b,"aria-hidden":a&&!n?!0:void 0,onPointerDown:K?N0:void 0,onPointerMove:K?D0:void 0,onPointerUp:K?B0:void 0,onPointerCancel:K?B0:void 0,onKeyDown:F0,inert:T8(H.limited),style:{...s(),[fz]:H.transitionStatus==="ending"?o:p,[IT]:`${i}px`,[yT]:H.height?`${H.height}px`:void 0}},$0=D5.useMemo(()=>({toast:H,setTitleId:T,setDescriptionId:C,recalculateHeight:J0,visibleIndex:p,expanded:Z0}),[H,T,C,J0,p,Z0]),Q0={transitionStatus:H.transitionStatus,expanded:Z0,limited:H.limited||!1,type:H.type,swiping:N,swipeDirection:W},_0=G0("div",Z,{ref:[J,R],state:Q0,stateAttributesMapping:Oe,props:[e,G]});return pT.jsx(HA.Provider,{value:$0,children:_0})});var mz=P(m(),1);var dT=mz.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,{visibleIndex:z,expanded:G,recalculateHeight:U}=G6(),Y=mz.useRef(null);H0(()=>{U();let W=Y.current;if(!W||typeof ResizeObserver!=="function"||typeof MutationObserver!=="function")return;let q=new ResizeObserver(()=>U(!0)),N=new MutationObserver(()=>U(!0));return q.observe(W),N.observe(W,{childList:!0,subtree:!0,characterData:!0}),()=>{q.disconnect(),N.disconnect()}},[U]);let K=z>0;return G0("div",Z,{ref:[J,Y],state:{expanded:G,behind:K},props:X})});var nT=P(m(),1);var uz=P(m(),1);var lT=0;function be($,Z="mui"){let[J,H]=uz.useState($),B=$||J;return uz.useEffect(()=>{if(J==null)lT+=1,H(`${Z}-${lT}`)},[J,Z]),B}var iT=rT.useId;function _4($,Z){if(iT!==void 0){let J=iT();return $??(Z?`${Z}-${J}`:J)}return be($,Z)}var aT=P(m(),1);function oT($){if($==null||typeof $==="boolean"||$==="")return!1;if(Array.isArray($))return $.some(oT);return!0}function pz($){return aT.isValidElement($)&&oT($.props.children)}function cz($,Z,J){let{toast:H,setTitleId:B,setDescriptionId:Q}=G6(),X=J==="title"?B:Q,z=Z??(J==="title"?H.title:H.description);return{id:_4($),children:z,type:H.type,setId:X}}function dz($,Z,J){let H=pz($);return H0(()=>{if(!H)return;return J(Z),()=>{J((B)=>B===Z?void 0:B)}},[H,Z,J]),H?$:null}var sT=nT.forwardRef(function(Z,J){let{render:H,className:B,style:Q,id:X,children:z,...G}=Z,{id:U,children:Y,type:K,setId:F}=cz(X,z,"description"),q=G0("p",Z,{ref:J,state:{type:K},props:{...G,id:U,children:Y}});return dz(q,U,F)});var tT=P(m(),1);var eT=tT.forwardRef(function(Z,J){let{render:H,className:B,style:Q,id:X,children:z,...G}=Z,{id:U,children:Y,type:K,setId:F}=cz(X,z,"title"),q=G0("h2",Z,{ref:J,state:{type:K},props:{...G,id:U,children:Y}});return dz(q,U,F)});var lz=P(m(),1);var $C=lz.forwardRef(function(Z,J){let{render:H,className:B,style:Q,disabled:X,nativeButton:z=!0,...G}=Z,U=M9(),{toast:Y,expanded:K}=G6(),[F,W]=lz.useState(!1),{getButtonProps:q,buttonRef:N}=C5({disabled:X,native:z}),D={type:Y.type};return G0("button",Z,{ref:[J,N],state:D,props:[{"aria-hidden":!K&&!F,onClick(){U.closeToast(Y.id)},onFocus(){W(!0)},onBlur(){W(!1)}},G,q]})});var ZC=P(m(),1);var JC=ZC.forwardRef(function(Z,J){let{render:H,className:B,style:Q,disabled:X,nativeButton:z=!0,...G}=Z,{toast:U}=G6(),Y=U.actionProps?.children??G.children,{getButtonProps:K,buttonRef:F}=C5({disabled:X,native:z}),W={type:U.type},q=G0("button",Z,{ref:[J,F],state:W,props:[G,U.actionProps,K,{children:Y}]});return pz(q)?q:null});var zC=P(m(),1);var az=P(m(),1),QC=P(B8(),1);var k5=P(m(),1),QA=P(B8(),1);var K0={};b5(K0,{windowResize:()=>U00,wheel:()=>$00,triggerPress:()=>Se,triggerHover:()=>Re,triggerFocus:()=>ke,trackPress:()=>fe,swipe:()=>G00,siblingOpen:()=>H00,scrub:()=>Z00,pointer:()=>te,outsidePress:()=>Ie,none:()=>we,missing:()=>Q00,listNavigation:()=>ne,linkPress:()=>he,keyboard:()=>se,itemPress:()=>ye,inputPress:()=>ie,inputPaste:()=>le,inputClear:()=>ce,inputChange:()=>pe,inputBlur:()=>de,initial:()=>X00,incrementPress:()=>me,imperativeAction:()=>z00,focusOut:()=>re,escapeKey:()=>ae,drag:()=>ee,disabled:()=>B00,decrementPress:()=>ue,closeWatcher:()=>oe,closePress:()=>xe,clearPress:()=>ve,chipRemovePress:()=>ge,cancelOpen:()=>J00});var we="none",Se="trigger-press",Re="trigger-hover",ke="trigger-focus",Ie="outside-press",ye="item-press",xe="close-press",he="link-press",ve="clear-press",ge="chip-remove-press",fe="track-press",me="increment-press",ue="decrement-press",pe="input-change",ce="input-clear",de="input-blur",le="input-paste",ie="input-press",re="focus-out",ae="escape-key",oe="close-watcher",ne="list-navigation",se="keyboard",te="pointer",ee="drag",$00="wheel",Z00="scrub",J00="cancel-open",H00="sibling-open",B00="disabled",Q00="missing",X00="initial",z00="imperative-action",G00="swipe",U00="window-resize";function w0($,Z,J,H){let B=!1,Q=!1,X=H??M1;return{reason:$,event:Z??new Event("base-ui"),cancel(){B=!0},allowPropagation(){Q=!0},get isCanceled(){return B},get isPropagationAllowed(){return Q},trigger:J,...X}}function iz($,Z,J){let H=J??M1;return{reason:$,event:Z??new Event("base-ui"),...H}}function j3($){return`data-base-ui-${$}`}var e7=P(c(),1),BC=k5.createContext(null),XA=()=>k5.useContext(BC),Y00=j3("portal");function rz($={}){let{ref:Z,container:J,componentProps:H=M1,elementProps:B}=$,Q=_4(),z=XA()?.portalNode,[G,U]=k5.useState(null),[Y,K]=k5.useState(null),F=Y0((D)=>{if(D!==null)K(D)}),W=k5.useRef(null);H0(()=>{if(J===null){if(W.current)W.current=null,K(null),U(null);return}let D=(J&&(HC(J)?J:J.current))??z??document.body;if(D==null){if(W.current)W.current=null,K(null),U(null);return}if(W.current!==D)W.current=D,K(null),U(D)},[J,z]);let q=G0("div",H,{ref:[Z,F],props:[{id:Q,[Y00]:""},B]}),N=G&&q?QA.createPortal(q,G):null;return{node:Y,nodeId:k5.isValidElement(q)?q.props.id:void 0,subtree:N}}var $$=k5.forwardRef(function(Z,J){let{render:H,className:B,style:Q,children:X,container:z,portalOwnerRole:G,...U}=Z,{node:Y,nodeId:K,subtree:F}=rz({container:z,ref:J,componentProps:Z,elementProps:U}),W=k5.useRef(null),q=k5.useRef(null),N=k5.useRef(null),D=k5.useRef(null),[A,V]=k5.useState(null),L=k5.useRef(!1),j=A?.modal,M=A?.open,_=!!A&&!A.modal&&A.open&&!!Y;k5.useEffect(()=>{if(!Y||j)return;function T(b){if(Y&&b.relatedTarget&&P3(b))if(b.type==="focusin"){if(L.current)eN(Y),L.current=!1}else LT(Y),L.current=!0}return j2(a0(Y,"focusin",T,!0),a0(Y,"focusout",T,!0))},[Y,j]),H0(()=>{if(!Y||M!==!0||!L.current)return;eN(Y),L.current=!1},[M,Y]);let w=k5.useMemo(()=>({beforeOutsideRef:W,afterOutsideRef:q,beforeInsideRef:N,afterInsideRef:D,portalNode:Y,setFocusManagerState:V}),[Y]);return e7.jsxs(k5.Fragment,{children:[F,e7.jsxs(BC.Provider,{value:w,children:[_&&Y&&e7.jsx(g4,{"data-type":"outside",ref:W,onFocus:(T)=>{if(P3(T,Y))N.current?.focus();else{let b=A?A.domReference:null;wz(b)?.focus()}}}),_&&Y&&e7.jsx("span",{role:G,"aria-owns":K,style:kT}),Y&&QA.createPortal(X,Y),_&&Y&&e7.jsx(g4,{"data-type":"outside",ref:q,onFocus:(T)=>{if(P3(T,Y))D.current?.focus();else{let b=A?A.domReference:null;if(wZ(b)?.focus(),A?.closeOnFocusOut)A?.onOpenChange(!1,w0(K0.focusOut,T.nativeEvent))}}})]})]})});var XC=P(c(),1),RZ=az.forwardRef(function(Z,J){let{children:H,container:B,className:Q,render:X,style:z,...G}=Z,{node:U,subtree:Y}=rz({container:B,ref:J,componentProps:Z,elementProps:G});if(!Y&&!U)return null;return XC.jsxs(az.Fragment,{children:[Y,U&&QC.createPortal(H,U)]})});var GC=P(c(),1),UC=zC.forwardRef(function(Z,J){return GC.jsx(RZ,{ref:J,...Z})});var VG=P(m(),1);var Q8=P(m(),1);function F5($){let Z=t1(K00,$).current;return Z.next=$,H0(Z.effect),Z}function K00($){let Z={current:$,next:$,effect:()=>{Z.current=Z.next}};return Z}var j4=P(m(),1);function F00($,Z){if(Z!=null&&!H8(Z))return 0;if(typeof $==="function")return $();return $}function o8($,Z,J){let H=F00($,J);if(typeof H==="number")return H;return H?.[Z]}function zA($){if(typeof $==="function")return $();return $}function oz($,Z){return Z||$==="click"||$==="mousedown"}function YC($){return $?.includes("mouse")&&$!=="mousedown"}var KC=P(c(),1),FC=j4.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new d5,currentIdRef:{current:null},currentContextRef:{current:null}});function W00($,Z){$.current=Z.current}function GA($){let{children:Z,delay:J,timeoutMs:H=0}=$,B=j4.useRef(J),Q=j4.useRef(J),X=j4.useRef(null),z=j4.useRef(null),G=i1();return H0(()=>{if(Q.current=J,!X.current){B.current=J;return}B.current={open:o8(B.current,"open"),close:o8(J,"close")}},[J,X,B,Q]),KC.jsx(FC.Provider,{value:j4.useMemo(()=>({hasProvider:!0,delayRef:B,initialDelayRef:Q,currentIdRef:X,timeoutMs:H,currentContextRef:z,timeout:G}),[H,G]),children:Z})}function UA($,Z={open:!1}){let{open:J}=Z,H="rootStore"in $?$.rootStore:$,B=H.useState("floatingId"),Q=j4.useContext(FC),{currentIdRef:X,delayRef:z,timeoutMs:G,initialDelayRef:U,currentContextRef:Y,hasProvider:K,timeout:F}=Q,[W,q]=j4.useState(!1),N=j4.useRef(J);return H0(()=>{N.current=J},[J]),H0(()=>{function D(){Y.current?.setIsInstantPhase(!1),X.current=null,Y.current=null,z.current=U.current,F.clear()}if(!X.current)return;if(!J&&X.current===B){if(q(!1),G){let A=B;return F.start(G,()=>{if(H.select("open")||X.current&&X.current!==A)return;D()}),()=>{if(N.current||X.current!==A)F.clear()}}D()}return},[J,B,X,z,G,U,Y,F,H]),H0(()=>{if(!J)return;let D=Y.current,A=X.current;if(F.clear(),Y.current={onOpenChange:H.setOpen,setIsInstantPhase:q},X.current=B,z.current={open:0,close:o8(U.current,"close")},A!==null&&A!==B)q(!0),D?.setIsInstantPhase(!0),D?.onOpenChange(!1,w0(K0.none));else q(!1),D?.setIsInstantPhase(!1)},[J,B,H,X,z,U,Y,F]),H0(()=>{return()=>{if(X.current===B){if(Y.current=null,!N.current)return;X.current=null,W00(z,U),F.clear()}}},[Y,X,z,B,U,F]),j4.useMemo(()=>({activeIdRef:X,hasProvider:K,delayRef:z,isInstantPhase:W}),[X,K,z,W])}var Z4=P(m(),1);var nz=0;function kZ($,Z={}){let{preventScroll:J=!1,sync:H=!1,shouldFocus:B}=Z;cancelAnimationFrame(nz);function Q(){if(B&&!B())return;$?.focus({preventScroll:J})}if(H)return Q(),z1;let X=requestAnimationFrame(Q);return nz=X,()=>{if(nz===X)cancelAnimationFrame(X),nz=0}}var YA={inert:new WeakMap,"aria-hidden":new WeakMap},WC="data-base-ui-inert",FA={inert:new WeakSet,"aria-hidden":new WeakSet},YB=new WeakMap,KA=0;function q00($){return FA[$]}function DC($){if(!$)return null;return H6($)?$.host:DC($.parentNode)}var qC=($,Z)=>Z.map((J)=>{if($.contains(J))return J;let H=DC(J);if($.contains(H))return H;return null}).filter((J)=>J!=null),NC=($)=>{let Z=new Set;return $.forEach((J)=>{let H=J;while(H&&!Z.has(H))Z.add(H),H=H.parentNode}),Z},AC=($,Z,J)=>{let H=[],B=(Q)=>{if(!Q||J.has(Q))return;Array.from(Q.children).forEach((X)=>{if(O2(X)==="script")return;if(Z.has(X))B(X);else H.push(X)})};return B($),H};function N00($,Z,J,H,{mark:B=!0}){let Q=null;if(H)Q="inert";else if(J)Q="aria-hidden";let X=null,z=null,G=qC(Z,$),U=B?AC(Z,NC(G),new Set(G)):[],Y=[],K=[];if(Q){let F=YA[Q],W=q00(Q);z=W,X=F;let q=qC(Z,Array.from(Z.querySelectorAll("[aria-live]"))),N=G.concat(q);AC(Z,NC(N),new Set(N)).forEach((A)=>{let V=A.getAttribute(Q),L=V!==null&&V!=="false",j=(F.get(A)||0)+1;if(F.set(A,j),Y.push(A),j===1&&L)W.add(A);if(!L)A.setAttribute(Q,Q==="inert"?"":"true")})}if(B)U.forEach((F)=>{let W=(YB.get(F)||0)+1;if(YB.set(F,W),K.push(F),W===1)F.setAttribute(WC,"")});return KA+=1,()=>{if(X)Y.forEach((F)=>{let q=(X.get(F)||0)-1;if(X.set(F,q),!q){if(!z?.has(F)&&Q)F.removeAttribute(Q);z?.delete(F)}});if(B)K.forEach((F)=>{let W=(YB.get(F)||0)-1;if(YB.set(F,W),!W)F.removeAttribute(WC)});if(KA-=1,!KA)YA.inert=new WeakMap,YA["aria-hidden"]=new WeakMap,FA.inert=new WeakSet,FA["aria-hidden"]=new WeakSet,YB=new WeakMap}}function WA($,Z={}){let{ariaHidden:J=!1,inert:H=!1,mark:B=!0}=Z,Q=f0($[0]).body;return N00($,Q,J,H,{mark:B})}var U6=P(m(),1);function sz(){let $=new Map;return{emit(Z,J){$.get(Z)?.forEach((H)=>H(J))},on(Z,J){if(!$.has(Z))$.set(Z,new Set);$.get(Z).add(J)},off(Z,J){$.get(Z)?.delete(J)}}}class Z${nodesRef={current:[]};events=sz();addNode($){this.nodesRef.current.push($)}removeNode($){let Z=this.nodesRef.current.findIndex((J)=>J===$);if(Z!==-1)this.nodesRef.current.splice(Z,1)}}var qA=P(c(),1),VC=U6.createContext(null),LC=U6.createContext(null),O4=()=>U6.useContext(VC)?.id||null,$4=($)=>{let Z=U6.useContext(LC);return $??Z};function O3($){let Z=_4(),J=$4($),H=O4();return H0(()=>{if(!Z)return;let B={id:Z,parentId:H};return J?.addNode(B),()=>{J?.removeNode(B)}},[J,Z,H]),Z}function J$($){let{children:Z,id:J}=$,H=O4();return qA.jsx(VC.Provider,{value:U6.useMemo(()=>({id:J,parentId:H}),[J,H]),children:Z})}function H$($){let{children:Z,externalTree:J}=$,H=t1(()=>J??new Z$).current;return qA.jsx(LC.Provider,{value:H,children:Z})}var KB=P(c(),1);function A00($,Z){let J=w1(P1($));if($ instanceof J.KeyboardEvent)return"keyboard";if($ instanceof J.FocusEvent)return Z||"keyboard";if("pointerType"in $)return $.pointerType||"keyboard";if("touches"in $)return"touch";if($ instanceof J.MouseEvent)return Z||($.detail===0?"keyboard":"mouse");return""}var MC=20,Y6=[];function NA(){Y6=Y6.filter(($)=>{return $.deref()?.isConnected})}function PC($){if(NA(),$&&O2($)!=="body"){if(Y6.push(new WeakRef($)),Y6.length>MC)Y6=Y6.slice(-MC)}}function _C(){return NA(),Y6[Y6.length-1]?.deref()}function D00($){if(!$)return null;if(bz($))return $;return bZ($)[0]||$}function jC($){if($.hasAttribute("tabindex")&&!$.hasAttribute("data-tabindex"))return;if(!$.getAttribute("role")?.includes("dialog"))return;let J=tN($).filter((B)=>{let Q=B.getAttribute("data-tabindex")||"";return bz(B)||B.hasAttribute("data-tabindex")&&!Q.startsWith("-")}),H=$.getAttribute("tabindex");if(J.length===0){if(H!=="0")$.setAttribute("tabindex","0"),$.setAttribute("data-tabindex","0")}else if(H!=="-1"||$.hasAttribute("data-tabindex")&&$.getAttribute("data-tabindex")!=="-1")$.setAttribute("tabindex","-1"),$.setAttribute("data-tabindex","-1")}function B$($){let{context:Z,children:J,disabled:H=!1,initialFocus:B=!0,returnFocus:Q=!0,restoreFocus:X=!1,modal:z=!0,closeOnFocusOut:G=!0,openInteractionType:U="",nextFocusableElement:Y,previousFocusableElement:K,beforeContentFocusGuardRef:F,externalTree:W,getInsideElements:q}=$,N="rootStore"in Z?Z.rootStore:Z,D=N.useState("open"),A=N.useState("domReferenceElement"),V=N.useState("floatingElement"),{events:L,dataRef:j}=N.context,M=Y0(()=>j.current.floatingContext?.nodeId),_=B===!1,w=BB(A)&&_,T=F5(B),b=F5(Q),C=F5(U),k=F5(D),S=$4(W),R=XA(),O=Z4.useRef(!1),y=Z4.useRef(!1),I=Z4.useRef(!1),x=Z4.useRef(null),v=Z4.useRef(""),g=Z4.useRef(""),E=Z4.useRef(null),l=Z4.useRef(null),r=f2(E,F,R?.beforeInsideRef),h=f2(l,R?.afterInsideRef),d=i1(),o=i1(),p=P4(),i=R!=null,n=QB(V),Z0=Y0((z0=n)=>{return z0?bZ(z0):[]}),J0=Y0(()=>q?.().filter((z0)=>z0!=null)??[]);Z4.useEffect(()=>{if(H||!z)return;function z0(N0){if(N0.key==="Tab"){if(R0(n,d1(f0(n)))&&Z0().length===0&&!w)h4(N0)}}let B0=f0(n);return a0(B0,"keydown",z0)},[H,n,z,w,Z0]),Z4.useEffect(()=>{if(H||!D)return;let z0=f0(n);function B0(){I.current=!1}function N0(F0){let s=P1(F0),a=J0(),e=R0(V,s)||R0(A,s)||R0(R?.portalNode,s)||a.some(($0)=>$0===s||R0($0,s));if(I.current=!e,g.current=F0.pointerType||"keyboard",s?.closest(`[${SZ}]`))y.current=!0,o.start(0,()=>{y.current=!1})}function D0(){g.current="keyboard"}return j2(a0(z0,"pointerdown",N0,!0),a0(z0,"pointerup",B0,!0),a0(z0,"pointercancel",B0,!0),a0(z0,"keydown",D0,!0),B0)},[H,V,A,n,D,R,o,J0]),Z4.useEffect(()=>{if(H||!G)return;let z0=f0(n);function B0(){y.current=!0,o.start(0,()=>{y.current=!1})}function N0(a){let e=P1(a);if(bz(e))x.current=e}function D0(a){let{relatedTarget:e,currentTarget:$0}=a,Q0=P1(a);if(z&&e==null&&Q0!=null&&R0(V,Q0))PC(Q0);queueMicrotask(()=>{let _0=M(),M0=N.context.triggerElements,A0=J0(),L0=e?.hasAttribute(j3("focus-guard"))&&[E.current,l.current,R?.beforeInsideRef.current,R?.afterInsideRef.current,R?.beforeOutsideRef.current,R?.afterOutsideRef.current,a8(K),a8(Y)].includes(e),f=!(R0(A,e)||R0(V,e)||R0(e,V)||R0(R?.portalNode,e)||A0.some((u)=>u===e||R0(u,e))||M0.hasMatchingElement((u)=>R0(u,e))||L0||S&&(P8(S.nodesRef.current,_0).find((u)=>R0(u.context?.elements.floating,e)||R0(u.context?.elements.domReference,e))||oN(S.nodesRef.current,_0).find((u)=>[u.context?.elements.floating,QB(u.context?.elements.floating)].includes(e)||u.context?.elements.domReference===e)));if($0===A&&n)jC(n);if(X&&$0!==A&&!t7(Q0)&&d1(z0)===z0.body){if(_1(n)){if(n.focus(),X==="popup"){p.request(()=>{n.focus()});return}}let u=Z0(),t=x.current,W0=(t&&u.includes(t)?t:null)||u[u.length-1]||n;if(_1(W0))W0.focus()}if(j.current.insideReactTree){j.current.insideReactTree=!1;return}if((w?!0:!z)&&e&&f&&!y.current&&(w||e!==_C()))O.current=!0,N.setOpen(!1,w0(K0.focusOut,a))})}function F0(){if(I.current)return;j.current.insideReactTree=!0,d.start(0,()=>{j.current.insideReactTree=!1})}let s=_1(A)?A:null;if(!V&&!s)return;return j2(s&&a0(s,"focusout",D0),s&&a0(s,"pointerdown",B0),V&&a0(V,"focusin",N0),V&&a0(V,"focusout",D0),V&&R&&a0(V,"focusout",F0,!0))},[H,A,V,n,z,S,R,N,G,X,Z0,w,M,j,d,o,p,Y,K,J0]),Z4.useEffect(()=>{if(H||!V||!D)return;let z0=Array.from(R?.portalNode?.querySelectorAll(`[${j3("portal")}]`)||[]),N0=(S?oN(S.nodesRef.current,M()):[]).find(($0)=>BB($0.context?.elements.domReference||null))?.context?.elements.domReference,F0=[...[V,...z0,E.current,l.current,R?.beforeOutsideRef.current,R?.afterOutsideRef.current,...J0()],N0,a8(K),a8(Y),w?A:null].filter(($0)=>$0!=null),s=WA(F0,{ariaHidden:z||w,mark:!1}),a=[V,...z0].filter(($0)=>$0!=null),e=WA(a);return()=>{e(),s()}},[D,H,A,V,z,R,w,S,M,Y,K,J0]),H0(()=>{if(!D||H||!_1(n))return;v.current="",g.current="";let z0=f0(n),B0=d1(z0);queueMicrotask(()=>{let N0=T.current,D0=typeof N0==="function"?N0(C.current||""):N0;if(D0===void 0||D0===!1)return;if(R0(n,B0))return;let s=null,a=()=>{if(s==null)s=Z0(n);return s[0]||n},e;if(D0===!0||D0===null)e=a();else e=a8(D0);e=e||a();let $0=R0(n,d1(z0));kZ(e,{preventScroll:e===n,shouldFocus(){if(!k.current)return!1;if($0)return!0;let Q0=d1(z0);return!(Q0!==e&&R0(n,Q0))}})})},[H,D,n,Z0,T,C,k]),H0(()=>{if(H||!n)return;let z0=f0(n),B0=d1(z0),N0=C.current==null;PC(B0);function D0(s){if(!s.open)v.current=A00(s.nativeEvent,g.current);if(s.reason===K0.triggerHover&&s.nativeEvent.type==="mouseleave")O.current=!0;if(s.reason!==K0.outsidePress)return;if(s.nested)O.current=!1;else if(TZ(s.nativeEvent)||CZ(s.nativeEvent))O.current=!1;else{let a=!1;if(f0(n).createElement("div").focus({get preventScroll(){return a=!0,!1}}),a)O.current=!1;else O.current=!0}}L.on("openchange",D0);function F0(s){let a=b.current,e=typeof a==="function"?a(s):a;if(e===void 0||e===!1)return null;if(e===null)e=!0;let $0=A?.isConnected?A:null,Q0=B0?.isConnected&&O2(B0)!=="body"?B0:null,_0=N0?Q0||$0:$0||Q0;if(!_0)_0=_C()||null;if(typeof e==="boolean")return _0;return a8(e)||_0||null}return()=>{L.off("openchange",D0);let s=d1(z0),a=J0(),e=R0(V,s)||a.some((M0)=>M0===s||R0(M0,s))||S&&P8(S.nodesRef.current,M(),!1).some((M0)=>R0(M0.context?.elements.floating,s)),$0=b.current,Q0=v.current,_0=F0(Q0);queueMicrotask(()=>{let M0=D00(_0),A0=typeof $0!=="boolean";if($0&&!O.current&&_1(M0)&&(!A0&&M0!==s&&s!==z0.body?e:!0)){let L0={preventScroll:!0};if(Q0==="keyboard")L0.focusVisible=!0;M0.focus(L0)}O.current=!1})}},[H,V,n,b,C,L,S,A,M,J0]),H0(()=>{if(!$5.engine.webkit||D||!V)return;let z0=d1(f0(V));if(!_1(z0)||!o7(z0))return;if(R0(V,z0))z0.blur()},[D,V]),H0(()=>{if(H||!R)return;return R.setFocusManagerState({modal:z,closeOnFocusOut:G,open:D,onOpenChange:N.setOpen,domReference:A}),()=>{R.setFocusManagerState(null)}},[H,R,z,D,N,G,A]),H0(()=>{if(H||!n)return;return jC(n),()=>{queueMicrotask(NA)}},[H,n]);let U0=!H&&(z?!w:!0)&&(i||z);return KB.jsxs(Z4.Fragment,{children:[U0&&KB.jsx(g4,{"data-type":"inside",ref:r,onFocus:(z0)=>{if(z){let B0=Z0();kZ(B0[B0.length-1])}else if(R?.portalNode)if(O.current=!1,P3(z0,R.portalNode))wZ(A)?.focus();else a8(K??R.beforeOutsideRef)?.focus()}}),J,U0&&KB.jsx(g4,{"data-type":"inside",ref:h,onFocus:(z0)=>{if(z)kZ(Z0()[0]);else if(R?.portalNode){if(G)O.current=!0;if(P3(z0,R.portalNode))wz(A)?.focus();else a8(Y??R.afterOutsideRef)?.focus()}}})]})}var FB=P(m(),1);function T3($,Z={}){let{enabled:J=!0,event:H="click",toggle:B=!0,ignoreMouse:Q=!1,stickIfOpen:X=!0,touchOpenDelay:z=0,reason:G=K0.triggerPress}=Z,U="rootStore"in $?$.rootStore:$,Y=U.context.dataRef,K=FB.useRef(void 0),F=P4(),W=i1(),q=FB.useMemo(()=>{function N(A,V,L,j){let M=w0(G,V,L);if(A&&j==="touch"&&z>0)W.start(z,()=>{U.setOpen(!0,M)});else U.setOpen(A,M)}function D(A,V,L){let j=Y.current.openEvent,M=U.select("domReferenceElement")!==V;if(A&&M)return!0;if(!A)return!0;if(!B)return!0;if(j&&X)return!L(j.type);return!1}return{onPointerDown(A){K.current=H8(A.pointerType,!0)&&CZ(A.nativeEvent)?"virtual":A.pointerType},onMouseDown(A){let V=K.current,L=A.nativeEvent,j=U.select("open");if(A.button!==0||H==="click"||H8(V,!0)&&Q)return;let M=D(j,A.currentTarget,(T)=>T==="click"||T==="mousedown"),_=P1(L);if(o7(_)){N(M,L,_,V);return}let w=A.currentTarget;F.request(()=>{N(M,L,w,V)})},onClick(A){if(H==="mousedown-only")return;let V=K.current;if(H==="mousedown"&&V){K.current=void 0;return}if(H8(V,!0)&&Q)return;let L=U.select("open"),j=D(L,A.currentTarget,(M)=>M==="click"||M==="mousedown"||M==="keydown"||M==="keyup");N(j,A.nativeEvent,A.currentTarget,V)},onKeyDown(){K.current=void 0}}},[Y,H,Q,G,U,X,B,F,W,z]);return FB.useMemo(()=>J?{reference:q}:M1,[J,q])}var m4=P(m(),1);function V00($,Z){let J=null,H=null,B=!1;return{contextElement:$||void 0,getBoundingClientRect(){let Q=$?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},X=Z.axis==="x"||Z.axis==="both",z=Z.axis==="y"||Z.axis==="both",G=["mouseenter","mousemove"].includes(Z.dataRef.current.openEvent?.type||"")&&Z.pointerType!=="touch",U=Q.width,Y=Q.height,K=Q.x,F=Q.y;if(J==null&&Z.x&&X)J=Q.x-Z.x;if(H==null&&Z.y&&z)H=Q.y-Z.y;if(K-=J||0,F-=H||0,U=0,Y=0,!B||G)U=Z.axis==="y"?Q.width:0,Y=Z.axis==="x"?Q.height:0,K=X&&Z.x!=null?Z.x:K,F=z&&Z.y!=null?Z.y:F;else if(B&&!G)Y=Z.axis==="x"?Q.height:Y,U=Z.axis==="y"?Q.width:U;return B=!0,{width:U,height:Y,x:K,y:F,top:F,right:K+U,bottom:F+Y,left:K}}}}function OC($){return $!=null&&$.clientX!=null}function AA($,Z={}){let{enabled:J=!0,axis:H="both"}=Z,B="rootStore"in $?$.rootStore:$,Q=B.useState("open"),X=B.useState("floatingElement"),z=B.useState("domReferenceElement"),G=B.context.dataRef,U=m4.useRef(!1),Y=m4.useRef(null),[K,F]=m4.useState(),[W,q]=m4.useState([]),N=Y0((j)=>{B.set("positionReference",j)}),D=Y0((j,M,_)=>{if(U.current)return;if(G.current.openEvent&&!OC(G.current.openEvent))return;B.set("positionReference",V00(_??z,{x:j,y:M,axis:H,dataRef:G,pointerType:K}))}),A=Y0((j)=>{if(!Q)D(j.clientX,j.clientY,j.currentTarget);else if(!Y.current)D(j.clientX,j.clientY,j.currentTarget),q([])}),V=H8(K)?X:Q;m4.useEffect(()=>{if(!J){N(z);return}if(!V)return;function j(){Y.current?.(),Y.current=null}let M=w1(X);function _(w){let T=P1(w);if(!R0(X,T))D(w.clientX,w.clientY);else j()}if(!G.current.openEvent||OC(G.current.openEvent))Y.current=a0(M,"mousemove",_);else N(z);return j},[V,J,X,G,z,B,D,N,W]),m4.useEffect(()=>()=>{B.set("positionReference",null)},[B]),m4.useEffect(()=>{if(J&&!X)U.current=!1},[J,X]),m4.useEffect(()=>{if(!J&&Q)U.current=!0},[J,Q]);let L=m4.useMemo(()=>{function j(M){F(M.pointerType)}return{onPointerDown:j,onPointerEnter:j,onMouseMove:A,onMouseEnter:A}},[A]);return m4.useMemo(()=>J?{reference:L,trigger:L}:{},[J,L])}var T4=P(m(),1);function L00(){return!1}function M00($){return{escapeKey:typeof $==="boolean"?$:$?.escapeKey??!1,outsidePress:typeof $==="boolean"?$:$?.outsidePress??!0}}function n8($,Z={}){let{enabled:J=!0,escapeKey:H=!0,outsidePress:B=!0,outsidePressEvent:Q="sloppy",referencePress:X=L00,bubbles:z,externalTree:G}=Z,U="rootStore"in $?$.rootStore:$,Y=U.useState("open"),K=U.useState("floatingElement"),{dataRef:F,events:W}=U.context,q=$4(G),N=Y0(typeof B==="function"?B:()=>!1),D=typeof B==="function"?N:B,A=D!==!1,V=Y0(()=>Q),{escapeKey:L,outsidePress:j}=M00(z),M=T4.useRef(!1),_=T4.useRef(!1),w=T4.useRef(!1),T=T4.useRef(!1),b=T4.useRef(!1),C=T4.useRef(""),k=T4.useRef(null),S=i1(),R=i1(),O=Y0(()=>{R.clear(),F.current.insideReactTree=!1}),y=Y0((d)=>{let o=F.current.floatingContext?.nodeId;return(q?P8(q.nodesRef.current,o):[]).some((i)=>i.context?.open&&!i.context.dataRef.current[d])}),I=Y0((d)=>{return jz(d,U.select("floatingElement"))||jz(d,U.select("domReferenceElement"))}),x=Y0((d)=>{if(!X())return;U.setOpen(!1,w0(K0.triggerPress,d.nativeEvent))}),v=Y0((d)=>{if(!Y||!J||!H||d.key!=="Escape")return;if(b.current)return;if(!L&&y("__escapeKeyBubbles"))return;let o=JT(d)?d.nativeEvent:d,p=w0(K0.escapeKey,o);if(U.setOpen(!1,p),!p.isCanceled)d.preventDefault();if(!L&&!p.isPropagationAllowed)d.stopPropagation()}),g=Y0(()=>{F.current.insideReactTree=!0,R.start(0,O)}),E=Y0((d)=>{if(!Y||!J||d.button!==0)return;let o=P1(d.nativeEvent);if(!R0(U.select("floatingElement"),o))return;if(!M.current)M.current=!0,_.current=!1}),l=Y0((d)=>{if(!Y||!J)return;if(!(d.defaultPrevented||d.nativeEvent.defaultPrevented))return;if(M.current)_.current=!0});T4.useEffect(()=>{function d(o){if(!o.open)T.current=!1}return W.on("openchange",d),()=>{W.off("openchange",d)}},[W]),T4.useEffect(()=>{if(!Y||!J){if(!Y)T.current=!1;return O}F.current.__escapeKeyBubbles=L,F.current.__outsidePressBubbles=j;let d=new d5,o=new d5,p=f0(K);function i(){d.clear(),b.current=!0}function n(){d.start($5.engine.webkit?5:0,()=>{b.current=!1})}function Z0(){w.current=!0,o.start(0,()=>{w.current=!1})}function J0(){M.current=!1,_.current=!1}function U0(){let f=C.current,u=f==="pen"||!f?"mouse":f,t=V(),W0=typeof t==="function"?t():t;if(typeof W0==="string")return W0;return W0[u]}function z0(f){let u=U0();return u==="intentional"&&f.type!=="click"||u==="sloppy"&&f.type==="click"}function B0(f){let u=F.current.floatingContext?.nodeId,t=q&&P8(q.nodesRef.current,u).some((W0)=>jz(f,W0.context?.elements.floating));return I(f)||t}function N0(f){if(z0(f)){if(f.type!=="click"&&!I(f))o.clear(),w.current=!1;O();return}if(F.current.insideReactTree){O();return}let u=P1(f),t=`[${j3("inert")}]`,W0=s0(u)?u.getRootNode():null,S0=Array.from((H6(W0)?W0:f0(U.select("floatingElement"))).querySelectorAll(t)),p0=U.context.triggerElements;if(u&&(p0.hasElement(u)||p0.hasMatchingElement((T0)=>R0(T0,u))))return;let g0=s0(u)?u:null;while(g0&&!C8(g0)){let T0=E8(g0);if(C8(T0)||!s0(T0))break;g0=T0}if(S0.length&&s0(u)&&!ZT(u)&&!R0(u,U.select("floatingElement"))&&S0.every((T0)=>!R0(g0,T0)))return;if(_1(u)&&!("touches"in f)){let T0=C8(u),d0=g2(u),Q1=/auto|scroll/,e0=T0||Q1.test(d0.overflowX),c0=T0||Q1.test(d0.overflowY),y0=e0&&u.clientWidth>0&&u.scrollWidth>u.clientWidth,E1=c0&&u.clientHeight>0&&u.scrollHeight>u.clientHeight,W1=d0.direction==="rtl",Q5=E1&&(W1?f.offsetX<=u.offsetWidth-u.clientWidth:f.offsetX>u.clientWidth),C0=y0&&f.offsetY>u.clientHeight;if(Q5||C0)return}if(B0(f))return;if(U0()==="intentional"){if(f.detail!==0&&!TZ(f)&&!T.current)return;if(w.current){o.clear(),w.current=!1;return}}if(typeof D==="function"&&!D(f))return;if(y("__outsidePressBubbles"))return;U.setOpen(!1,w0(K0.outsidePress,f)),O()}function D0(f){if(U0()!=="sloppy"||f.pointerType==="touch"||!U.select("open")||!J||I(f))return;N0(f)}function F0(f){if(U0()!=="sloppy"||!U.select("open")||!J||I(f))return;let u=f.touches[0];if(u)k.current={startTime:Date.now(),startX:u.clientX,startY:u.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},S.start(1000,()=>{if(k.current)k.current.dismissOnTouchEnd=!1,k.current.dismissOnMouseDown=!1})}function s(f,u){let t=P1(f);if(!t)return;let W0=a0(t,f.type,()=>{u(f),W0()})}function a(f){C.current="touch",s(f,F0)}function e(f){if(S.clear(),f.type==="pointerdown"){if(f.button===0)T.current=!0;C.current=f.pointerType}if(f.type==="mousedown"&&k.current&&!k.current.dismissOnMouseDown)return;s(f,(u)=>{if(u.type==="pointerdown")D0(u);else N0(u)})}function $0(f){if(f.type==="pointercancel")T.current=!1;if(!M.current)return;let u=_.current;if(J0(),U0()!=="intentional")return;if(f.type==="pointercancel"){if(u)Z0();return}if(B0(f))return;if(u){Z0();return}if(typeof D==="function"&&!D(f))return;o.clear(),w.current=!0,O()}function Q0(f){if(U0()!=="sloppy"||!k.current||I(f))return;let u=f.touches[0];if(!u)return;let t=Math.abs(u.clientX-k.current.startX),W0=Math.abs(u.clientY-k.current.startY),S0=Math.sqrt(t*t+W0*W0);if(S0>5)k.current.dismissOnTouchEnd=!0;if(S0>10)N0(f),S.clear(),k.current=null}function _0(f){s(f,Q0)}function M0(f){if(U0()!=="sloppy"||!k.current||I(f))return;if(k.current.dismissOnTouchEnd)N0(f);S.clear(),k.current=null}function A0(f){s(f,M0)}let L0=j2(H&&j2(a0(p,"keydown",v),a0(p,"compositionstart",i),a0(p,"compositionend",n)),A&&j2(a0(p,"click",e,!0),a0(p,"pointerdown",e,!0),a0(p,"pointerup",$0,!0),a0(p,"pointercancel",$0,!0),a0(p,"mousedown",e,!0),a0(p,"mouseup",$0,!0),a0(p,"touchstart",a,{capture:!0,passive:!0}),a0(p,"touchmove",_0,{capture:!0,passive:!0}),a0(p,"touchend",A0,{capture:!0,passive:!0})));return()=>{L0(),d.clear(),o.clear(),J0(),w.current=!1,O()}},[F,K,H,A,D,Y,J,L,j,v,O,V,y,I,q,U,S]);let r=T4.useMemo(()=>({onKeyDown:v,onPointerDown:x,onClick:x}),[v,x]),h=T4.useMemo(()=>({onKeyDown:v,onPointerDown:l,onMouseDown:l,onClickCapture:g,onMouseDownCapture(d){g(),E(d)},onPointerDownCapture(d){g(),E(d)},onMouseUpCapture:g,onTouchEndCapture:g,onTouchMoveCapture:g}),[v,g,E,l]);return T4.useMemo(()=>J?{reference:r,floating:h,trigger:r}:{},[J,r,h])}function tz($,Z,J,H){return{left:$,top:Z,right:J,bottom:H,x:$,y:Z,width:J-$,height:H-Z}}function P00($){return{left:$.left,top:$.top,right:$.right,bottom:$.bottom,width:$.width,height:$.height}}function CC($){let Z=[],J,H=Number.POSITIVE_INFINITY,B=Number.POSITIVE_INFINITY,Q=Number.NEGATIVE_INFINITY,X=Number.NEGATIVE_INFINITY;for(let z of Array.from($).sort((G,U)=>G.top-U.top)){if(H=Math.min(H,z.left),B=Math.min(B,z.top),Q=Math.max(Q,z.right),X=Math.max(X,z.bottom),!J||z.top-J.top>J.height/2)Z.push(P00(z));else{let G=Z[Z.length-1];G.left=Math.min(G.left,z.left),G.right=Math.max(G.right,z.right),G.bottom=Math.max(G.bottom,z.bottom),G.width=G.right-G.left,G.height=G.bottom-G.top}J=z}return{lines:Z,fallback:tz(H,B,Q,X)}}function EC($,Z,J){return $.findIndex((H)=>Z>H.left-2&&Z<H.right+2&&J>H.top-2&&J<H.bottom+2)}function TC($){return tz($.left,$.top,$.right,$.bottom)}function _00($,Z,J){let{lines:H}=CC($.getClientRects());if(H.length<2)return;let B=EC(H,Z,J);return{x:Z,y:J,lineIndex:B===-1?void 0:B,element:$}}function j00($,Z,J){let{lines:H,fallback:B}=CC($.getClientRects());if(H.length<2)return null;let Q=J?.x,X=J?.y,z=Z[0];if(J?.lineIndex!=null&&H[J.lineIndex])return TC(H[J.lineIndex]);if(Q!=null&&X!=null){let q=EC(H,Q,X);if(q!==-1)return TC(H[q])}if(H.length===2&&H[0].left>H[1].right&&Q!=null&&X!=null)return B;if(z==="t"||z==="b"){let q=H[0],N=H[H.length-1],D=z==="t"?q:N;return tz(D.left,q.top,D.right,N.bottom)}let G=z==="l",U=H[0].left,Y=H[0].right,K=G?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY,F=H[0],W=H[0];for(let q of H){U=Math.min(U,q.left),Y=Math.max(Y,q.right);let N=G?q.left:q.right;if(G&&N<K||!G&&N>K)K=N,F=q,W=q;else if(N===K)W=q}return tz(U,F.top,Y,W.bottom)}function O00($){if("contextElement"in $&&$.contextElement)return $.contextElement;return s0($)?$:void 0}function bC($,Z){function J(B){DA($,B.currentTarget,B.clientX,B.clientY)}function H(B){if(!Z)J(B)}return{onFocus(){$.current=void 0},onMouseEnter:H,onMouseMove:H}}function DA($,Z,J,H){let B=_00(Z,J,H);return $.current=B,B}function wC($){return{name:"inline",async fn(Z){let J=Z.elements.reference;if(typeof J?.getClientRects!=="function")return{};let H=O00(J),B=$.current,Q=B?.element===J||B?.element===H?B:void 0,X=j00(J,Z.placement,Q);if(!X||typeof Z.platform.getElementRects!=="function")return{};let z=await Z.platform.getElementRects({reference:{contextElement:H,getBoundingClientRect(){return X}},floating:Z.elements.floating,strategy:Z.strategy});if(Z.rects.reference.x===z.reference.x&&Z.rects.reference.y===z.reference.y&&Z.rects.reference.width===z.reference.width&&Z.rects.reference.height===z.reference.height)return{};return{reset:{rects:z}}}}}class s8{attachedStores=[];attachedStoreValue=null;storeListeners=new Set;constructor($,Z,J=!0){this.fallbackStore=$,this.componentName=Z,this.throwOnMissingTrigger=J}get attachedStore(){return this.attachedStoreValue}get store(){return this.attachedStoreValue??this.fallbackStore}get serverStore(){return this.fallbackStore}subscribeStore($){return this.storeListeners.add($),()=>{this.storeListeners.delete($)}}attachStore($){return this.attachedStores.push($),this.setActiveStore($),()=>{let Z=this.attachedStores.lastIndexOf($);if(Z!==-1)this.attachedStores.splice(Z,1);this.setActiveStore(this.attachedStores[this.attachedStores.length-1]??null)}}setActiveStore($){if(this.attachedStoreValue!==$)this.attachedStoreValue=$,this.storeListeners.forEach((Z)=>{Z()})}openByTrigger($){let Z=this.attachedStore;if(Z===null)return;let J;if($){for(let H=this.attachedStores.length-1;H>=0&&!J;H-=1)J=this.attachedStores[H].context.triggerElements.getById($);J??=this.fallbackStore.context.triggerElements.getById($)}if($&&!J){if(this.throwOnMissingTrigger)throw Error(I0(99,this.componentName,$,this.componentName))}Z.setOpen(!0,w0(K0.imperativeAction,void 0,J))}closePopup(){let $=this.attachedStore;if($===null)return;$.setOpen(!1,w0(K0.imperativeAction))}}var LA=P(m(),1),kC=P(B8(),1);var SC=P(m(),1);var T00={open:($)=>$.open,transitionStatus:($)=>$.transitionStatus,domReferenceElement:($)=>$.domReferenceElement,referenceElement:($)=>$.positionReference??$.referenceElement,floatingElement:($)=>$.floatingElement,floatingId:($)=>$.floatingId};class Q$ extends h2{constructor($){let{syncOnly:Z,nested:J,onOpenChange:H,triggerElements:B,...Q}=$;super({...Q,positionReference:Q.referenceElement,domReferenceElement:Q.referenceElement},{onOpenChange:H,dataRef:{current:{}},events:sz(),nested:J,triggerElements:B},T00);this.syncOnly=Z}syncOpenEvent=($,Z)=>{if(!$||!this.state.open||Z!=null&&HT(Z))this.context.dataRef.current.openEvent=$?Z:void 0};dispatchOpenChange=($,Z)=>{this.syncOpenEvent($,Z.event);let J={open:$,reason:Z.reason,nativeEvent:Z.event,nested:this.context.nested,triggerElement:Z.trigger};this.context.events.emit("openchange",J)};setOpen=($,Z)=>{if(this.syncOnly){this.context.onOpenChange?.($,Z);return}this.dispatchOpenChange($,Z),this.context.onOpenChange?.($,Z)}}function WB($){let{popupStore:Z,treatPopupAsFloatingElement:J=!1,floatingRootContext:H,floatingId:B,nested:Q,onOpenChange:X}=$,z=Z.useState("open"),G=Z.useState("activeTriggerElement"),U=Z.useState(J?"popupElement":"positionerElement"),Y=Z.context.triggerElements,K=X,F=SC.useRef(null);if(H===void 0&&F.current===null)F.current=new Q$({open:z,transitionStatus:void 0,referenceElement:G,floatingElement:U,triggerElements:Y,onOpenChange:K,floatingId:B,syncOnly:!0,nested:Q});let W=H??F.current;return Z.useSyncedValue("floatingId",B),H0(()=>{let q={open:z,floatingId:B,referenceElement:G,floatingElement:U};if(s0(G))q.domReferenceElement=G;if(W.state.positionReference===W.state.referenceElement)q.positionReference=G;W.update(q)},[z,B,G,U,W]),W.context.onOpenChange=K,W.context.nested=Q,W}var VA=P(m(),1);function C2($,Z=!1,J=!1,H=!1){let[B,Q]=VA.useState($&&Z?"idle":void 0),[X,z]=VA.useState($&&!H);if($&&!X)z(!0),Q("starting");if(!$&&X&&B!=="ending"&&!J)Q("ending");if(!$&&!X&&B==="ending")Q(void 0);return H0(()=>{if(!$&&X&&B!=="ending"&&J){let G=v2.request(()=>{Q("ending")});return()=>{v2.cancel(G)}}return},[$,X,B,J]),H0(()=>{if(!$||Z)return;let G=v2.request(()=>{Q(void 0)});return()=>{v2.cancel(G)}},[Z,$]),H0(()=>{if(!$||!Z)return;if($&&X&&B!=="idle")Q("starting");let G=v2.request(()=>{Q("idle")});return()=>{v2.cancel(G)}},[Z,$,X,B]),{mounted:X,setMounted:z,transitionStatus:B}}var E9={tabIndex:-1,[tH]:""};function ez($){return(Z)=>Z==="touch"?$.current:!0}function K6($,Z=!1){let J=_4(),H=O4()!=null,B=t1(()=>$(J,H)).current;return WB({popupStore:B,treatPopupAsFloatingElement:Z,floatingRootContext:B.state.floatingRootContext,floatingId:J,nested:H,onOpenChange:B.setOpen}),B}function b9({handle:$,store:Z}){return H0(()=>{return $.attachStore(Z)},[$,Z]),null}function RC($){let Z=$.context.triggerElements.size;if($.select("open")&&$.state.triggerCount!==Z)$.set("triggerCount",Z)}function MA($,Z){let J=LA.useRef(null);return Y0((H)=>{let B=J.current;if(B!==null){if(B.element===H&&B.store===Z&&B.id===$)return;J.current=null;let Q=B.store;if(Q.context.triggerElements.getById(B.id)===B.element)Q.context.triggerElements.delete(B.id),RC(Q)}if(H!==null&&$!==void 0)J.current={store:Z,id:$,element:H},Z.context.triggerElements.add($,H),RC(Z)})}function X$($,Z,J,H=!1){let B=$.preventUnmountingOnClose;if(Z)B=!1;else if(H)B=!0;let Q=J?.id??null,X=$.activeTriggerId,z=$.activeTriggerElement;if(Q||Z)X=Q,z=J??null;return{open:Z,preventUnmountingOnClose:B,activeTriggerId:X,activeTriggerElement:z}}function qB($){let Z=!1;return $.preventUnmountOnClose=()=>{Z=!0},()=>Z}function $G($,Z,J,H={}){let B=J.reason,Q=B===K0.triggerHover,X=Z&&B===K0.triggerFocus,z=!Z&&(B===K0.triggerPress||B===K0.escapeKey),G=qB(J);if($.context.onOpenChange?.(Z,J),J.isCanceled)return;H.onBeforeDispatch?.(),$.state.floatingRootContext.dispatchOpenChange(Z,J);let U=()=>{let Y=X$($.state,Z,J.trigger,G()),K={...H.extraState,...Y};if(X)K.instantType="focus";else if(z)K.instantType="dismiss";else if(Q)K.instantType=void 0;$.update(K)};if(Q)kC.flushSync(U);else U()}function w9($,Z,J,H){let B=J.useState("isMountedByTrigger",$),Q=MA($,J),X=Y0((G)=>{let U=J.select("open"),Y=J.select("activeTriggerId");if(Y===$){let K={activeTriggerElement:G,...U?H:null};J.update(K);return}if(Y==null&&U){let K={activeTriggerId:$??null,activeTriggerElement:G,...H};J.update(K)}}),z=Y0((G)=>{if(Q(G),G)X(G)});return H0(()=>{return z(Z.current),()=>z(null)},[z,Z,J,$]),H0(()=>{if(B){let G={activeTriggerElement:Z.current,...H};J.update(G)}},[B,J,Z,...Object.values(H)]),{registerTrigger:z,isMountedByThisTrigger:B}}function S9($,Z={}){let{closeOnActiveTriggerUnmount:J=!1}=Z,H=LA.useRef(null),B=$.useState("open"),Q=$.useState("triggerCount"),X=$.useState("activeTriggerId"),z=$.useState("activeTriggerElement");H0(()=>{if(!B){if(H.current=null,$.state.triggerCount!==0)$.set("triggerCount",0);return}let G=$.context.triggerElements.size,U={};if($.state.triggerCount!==G)U.triggerCount=G;let Y=$.select("activeTriggerId"),K=null;if(Y){let F=$.context.triggerElements.getById(Y);if(!F){for(let[W,q]of $.context.triggerElements.entries())if(q===$.state.activeTriggerElement){U.activeTriggerId=W,U.activeTriggerElement=q,H.current=W;break}if(U.activeTriggerId===void 0)if(H.current===Y)K=Y;else H.current=null}else if(H.current=Y,F!==$.state.activeTriggerElement)U.activeTriggerElement=F}else H.current=null;if(!K&&!Y&&G===1){let F=$.context.triggerElements.entries().next();if(!F.done){let[W,q]=F.value;U.activeTriggerId=W,U.activeTriggerElement=q,H.current=W}}if(U.triggerCount!==void 0||U.activeTriggerId!==void 0||U.activeTriggerElement!==void 0)$.update(U);if(K){if(J)queueMicrotask(()=>{if($.select("open")&&$.select("activeTriggerId")===K&&!$.context.triggerElements.getById(K)){let F=w0(K0.none);if($.setOpen(!1,F),!F.isCanceled)$.update({activeTriggerId:null,activeTriggerElement:null})}})}},[B,$,Q,X,z,J])}function R9($,Z,J,H){let{mounted:B,setMounted:Q,transitionStatus:X}=C2($,!1,!1,H),z=Z.useState("preventUnmountingOnClose"),G=$?!1:z;Z.useSyncedValues({mounted:B,transitionStatus:X,preventUnmountingOnClose:G});let U=Y0(()=>{Q(!1),Z.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),J?.(),Z.context.onOpenChangeComplete?.(!1)});return A5({enabled:B&&!$&&!G,open:$,ref:Z.context.popupRef,onComplete(){if(!$)U()}}),{forceUnmount:U,transitionStatus:X}}function k9($,Z){$.useSyncedValues(Z),H0(()=>()=>{$.update({activeTriggerProps:M1,inactiveTriggerProps:M1,popupProps:M1})},[$])}function ZG($,Z){H0(()=>{if(!Z&&$.state.openMethod!==null)$.set("openMethod",null)},[Z,$]),H0(()=>()=>{if($.state.openMethod!==null)$.set("openMethod",null)},[$])}class E2{constructor(){this.idMap=new Map}add($,Z){this.idMap.set($,Z)}delete($){this.idMap.delete($)}hasElement($){for(let Z of this.idMap.values())if(Z===$)return!0;return!1}hasMatchingElement($){for(let Z of this.idMap.values())if($(Z))return!0;return!1}getById($){return this.idMap.get($)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function I9($,Z,J=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Q$({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:$,floatingId:Z,syncOnly:!0,nested:J,onOpenChange:void 0}),floatingId:Z,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:M1,inactiveTriggerProps:M1,popupProps:M1}}var NB=($)=>$.triggerIdProp??$.activeTriggerId,PA=($)=>$.openProp??$.open,IC=($)=>{return($.popupElement?.id??$.floatingId)||void 0};function yC($,Z){return Z!==void 0&&PA($)&&NB($)===Z}function C00($,Z){if(yC($,Z))return!0;return Z!==void 0&&PA($)&&NB($)==null&&$.triggerCount===1}var y9={open:PA,mounted:($)=>$.mounted,transitionStatus:($)=>$.transitionStatus,floatingRootContext:($)=>$.floatingRootContext,triggerCount:($)=>$.triggerCount,preventUnmountingOnClose:($)=>$.preventUnmountingOnClose,payload:($)=>$.payload,activeTriggerId:NB,activeTriggerElement:($)=>$.mounted?$.activeTriggerElement:null,popupId:IC,isTriggerActive:($,Z)=>Z!==void 0&&NB($)===Z,isOpenedByTrigger:($,Z)=>yC($,Z),isMountedByTrigger:($,Z)=>Z!==void 0&&NB($)===Z&&$.mounted,triggerProps:($,Z)=>Z?$.activeTriggerProps:$.inactiveTriggerProps,triggerPopupId:($,Z)=>C00($,Z)?IC($):void 0,popupProps:($)=>$.popupProps,popupElement:($)=>$.popupElement,positionerElement:($)=>$.positionerElement};var _A=P(m(),1),xC=P(OZ(),1);function x9($){let Z=_A.useCallback((H)=>{if($===void 0)return z1;return $.subscribeStore(H)},[$]),J=_A.useCallback(()=>{return $===void 0?void 0:$.store},[$]);return xC.useSyncExternalStore(Z,J,()=>$?.serverStore)}function jA($){let{open:Z=!1,onOpenChange:J,elements:H={}}=$,B=_4(),Q=O4()!=null,X=t1(()=>new Q$({open:Z,transitionStatus:void 0,onOpenChange:J,referenceElement:H.reference??null,floatingElement:H.floating??null,triggerElements:new E2,floatingId:B,syncOnly:!1,nested:Q})).current;return H0(()=>{let z={open:Z,floatingId:B};if(H.reference!==void 0)z.referenceElement=H.reference,z.domReferenceElement=s0(H.reference)?H.reference:null;if(H.floating!==void 0)z.floatingElement=H.floating;X.update(z)},[Z,B,H.reference,H.floating,X]),X.context.onOpenChange=J,X.context.nested=Q,X}var h9=P(m(),1);var OA=$5.os.mac&&$5.engine.webkit;function z$($,Z={}){let{enabled:J=!0,delay:H}=Z,B="rootStore"in $?$.rootStore:$,{events:Q,dataRef:X}=B.context,z=h9.useRef(!1),G=h9.useRef(null),U=h9.useRef(!0),Y=i1();h9.useEffect(()=>{let F=B.select("domReferenceElement");if(!J)return;let W=w1(F);function q(){let A=B.select("domReferenceElement");if(!B.select("open")&&_1(A)&&A===d1(f0(A)))z.current=!0,G.current=A}function N(){U.current=!0}function D(){U.current=!1}return j2(a0(W,"blur",q),OA&&a0(W,"keydown",N,!0),OA&&a0(W,"pointerdown",D,!0))},[B,J]),h9.useEffect(()=>{if(!J)return;function F(W){if(W.reason===K0.triggerPress||W.reason===K0.escapeKey){let q=B.select("domReferenceElement");if(s0(q))G.current=q,z.current=!0}}return Q.on("openchange",F),()=>{Q.off("openchange",F)}},[Q,J,B]);let K=h9.useMemo(()=>{function F(){z.current=!1,G.current=null}return{onMouseLeave(){F()},onFocus(W){let q=W.currentTarget;if(z.current){if(G.current===q)return;F()}let N=P1(W.nativeEvent);if(s0(N)){if(OA&&!W.relatedTarget){if(!U.current&&!o7(N))return}else if(!j9(N))return}let D=B6(W.relatedTarget,B.context.triggerElements),{nativeEvent:A,currentTarget:V}=W,L=typeof H==="function"?H():H;if(B.select("open")&&D||L===0||L===void 0){B.setOpen(!0,w0(K0.triggerFocus,A,V));return}Y.start(L,()=>{if(z.current)return;B.setOpen(!0,w0(K0.triggerFocus,A,V))})},onBlur(W){F();let{relatedTarget:q,nativeEvent:N}=W,D=s0(q)&&q.hasAttribute(j3("focus-guard"))&&q.getAttribute("data-type")==="outside";Y.start(0,()=>{let A=B.select("domReferenceElement"),V=d1(f0(A));if(!q&&V===A)return;if(R0(X.current.floatingContext?.refs.floating.current,V)||R0(A,V)||D)return;if(B6(q??V,B.context.triggerElements))return;B.setOpen(!1,w0(K0.triggerFocus,N))})}}},[X,H,B,Y]);return h9.useMemo(()=>J?{reference:K,trigger:K}:{},[J,K])}var CA=P(m(),1);class TA{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new d5,this.restTimeout=new d5,this.handleCloseOptions=void 0}static create(){return new TA}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>{return this.dispose}}var JG=new WeakMap;function IZ($){if(!$.performedPointerEventsMutation)return;let Z=$.pointerEventsScopeElement;if(Z&&JG.get(Z)===$)$.pointerEventsScopeElement?.style.removeProperty("pointer-events"),$.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),$.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),JG.delete(Z);$.performedPointerEventsMutation=!1,$.pointerEventsScopeElement=null,$.pointerEventsReferenceElement=null,$.pointerEventsFloatingElement=null}function HG($,Z){let{scopeElement:J,referenceElement:H,floatingElement:B}=Z,Q=JG.get(J);if(Q&&Q!==$)IZ(Q);IZ($),$.performedPointerEventsMutation=!0,$.pointerEventsScopeElement=J,$.pointerEventsReferenceElement=H,$.pointerEventsFloatingElement=B,JG.set(J,$),J.style.pointerEvents="none",H.style.pointerEvents="auto",B.style.pointerEvents="auto"}function yZ($){let Z=$.context.dataRef.current,J=t1(()=>Z.hoverInteractionState??TA.create()).current;if(!Z.hoverInteractionState)Z.hoverInteractionState=J;return Z6(Z.hoverInteractionState.disposeEffect),Z.hoverInteractionState}function C3($,Z={}){let{enabled:J=!0,closeDelay:H=0,nodeId:B}=Z,Q="rootStore"in $?$.rootStore:$,X=Q.useState("open"),z=Q.useState("floatingElement"),G=Q.useState("domReferenceElement"),{dataRef:U}=Q.context,Y=$4(),K=O4(),F=yZ(Q),W=i1(),q=Y0(()=>{return oz(U.current.openEvent?.type,F.interactedInside)}),N=Y0(()=>{return YC(U.current.openEvent?.type)}),D=Y0(()=>{IZ(F)});H0(()=>{if(!X)F.pointerType=void 0,F.restTimeoutPending=!1,F.interactedInside=!1,D()},[X,F,D]),CA.useEffect(()=>{return D},[D]),H0(()=>{if(!J)return;if(X&&F.handleCloseOptions?.blockPointerEvents&&N()&&s0(G)&&z){let A=G,V=z,L=f0(z),j=Y?.nodesRef.current.find((T)=>T.id===K)?.context?.elements.floating;if(j)j.style.pointerEvents="";let M=F.pointerEventsScopeElement!==V?F.pointerEventsScopeElement:null,_=j!==V?j:null,w=F.handleCloseOptions?.getScope?.()??M??_??A.closest("[data-rootownerid]")??L.body;return HG(F,{scopeElement:w,referenceElement:A,floatingElement:V}),()=>{D()}}return},[J,X,G,z,F,N,Y,K,D]),CA.useEffect(()=>{if(!J)return;function A(){return!!(Y&&K&&P8(Y.nodesRef.current,K).length>0)}function V(T){let b=o8(H,"close",F.pointerType),C=()=>{Q.setOpen(!1,w0(K0.triggerHover,T)),Y?.events.emit("floating.closed",T)};if(b)F.openChangeTimeout.start(b,C);else F.openChangeTimeout.clear(),C()}function L(T){let b=P1(T);if(!aN(b)){F.interactedInside=!1;return}F.interactedInside=b?.closest("[aria-haspopup]")!=null}function j(){F.openChangeTimeout.clear(),W.clear(),Y?.events.off("floating.closed",_),D()}function M(T){if(A()&&Y){Y.events.on("floating.closed",_);return}if(B6(T.relatedTarget,Q.context.triggerElements))return;let b=U.current.floatingContext?.nodeId??B,C=T.relatedTarget;if(Y&&b&&s0(C)&&P8(Y.nodesRef.current,b,!1).some((S)=>R0(S.context?.elements.floating,C)))return;if(F.handler){F.handler(T);return}if(D(),N()&&!q())V(T)}function _(T){if(!Y||!K||A())return;W.start(0,()=>{Y.events.off("floating.closed",_),Q.setOpen(!1,w0(K0.triggerHover,T)),Y.events.emit("floating.closed",T)})}let w=z;return j2(w&&a0(w,"mouseenter",j),w&&a0(w,"mouseleave",M),w&&a0(w,"pointerdown",L,!0),()=>{Y?.events.off("floating.closed",_)})},[J,z,Q,U,H,B,N,q,D,F,Y,K,W])}var F6=P(m(),1),hC=P(B8(),1);var E00={current:null};function t8($,Z={}){let{enabled:J=!0,delay:H=0,handleClose:B=null,mouseOnly:Q=!1,restMs:X=0,move:z=!0,triggerElementRef:G=E00,externalTree:U,isActiveTrigger:Y=!0,getHandleCloseContext:K,isClosing:F,shouldOpen:W,guardStaleOpen:q=!1}=Z,N="rootStore"in $?$.rootStore:$,{dataRef:D,events:A}=N.context,V=$4(U),L=yZ(N),j=F6.useRef(!1),M=F5(B),_=F5(H),w=F5(X),T=F5(J),b=F5(W),C=F5(F),k=Y0(()=>{return oz(D.current.openEvent?.type,L.interactedInside)}),S=Y0(()=>{return b.current?.()!==!1}),R=Y0((I,x,v)=>{let g=N.context.triggerElements;if(g.hasElement(x))return!I||!R0(I,x);if(!s0(v))return!1;let E=v;return g.hasMatchingElement((l)=>R0(l,E))&&(!I||!R0(I,E))}),O=Y0(()=>{if(!L.handler)return;f0(N.select("domReferenceElement")).removeEventListener("mousemove",L.handler),L.handler=void 0}),y=Y0(()=>{IZ(L)});if(Y)L.handleCloseOptions=B?.__options;return F6.useEffect(()=>O,[O]),F6.useEffect(()=>{if(!J)return;function I(x){if(!x.open)j.current=x.reason===K0.triggerHover,O(),L.openChangeTimeout.clear(),L.restTimeout.clear(),L.blockMouseMove=!0,L.restTimeoutPending=!1;else j.current=!1}return A.on("openchange",I),()=>{A.off("openchange",I)}},[J,A,L,O]),F6.useEffect(()=>{if(!J)return;function I(r,h=!0){let d=o8(_.current,"close",L.pointerType);if(d)L.openChangeTimeout.start(d,()=>{N.setOpen(!1,w0(K0.triggerHover,r)),V?.events.emit("floating.closed",r)});else if(h)L.openChangeTimeout.clear(),N.setOpen(!1,w0(K0.triggerHover,r)),V?.events.emit("floating.closed",r)}let x=G.current??(Y?N.select("domReferenceElement"):null);if(!s0(x))return;function v(r){if(L.openChangeTimeout.clear(),L.blockMouseMove=!1,Q&&!H8(L.pointerType))return;let h=zA(w.current),d=o8(_.current,"open",L.pointerType),o=P1(r),p=r.currentTarget??null,i=N.select("domReferenceElement"),n=p;if(s0(o)&&!N.context.triggerElements.hasElement(o)){for(let s of N.context.triggerElements.elements())if(R0(s,o)){n=s;break}}if(s0(p)&&s0(i)&&!N.context.triggerElements.hasElement(p)&&R0(p,i))n=i;let Z0=n==null?!1:R(i,n,o),J0=N.select("open"),U0=C.current?.()??N.select("transitionStatus")==="ending",z0=!J0&&U0&&j.current,B0=!Z0&&s0(n)&&s0(i)&&R0(i,n)&&z0,N0=h>0&&!d,D0=Z0&&(J0||z0)||B0,F0=!J0||Z0;if(D0){if(S())N.setOpen(!0,w0(K0.triggerHover,r,n));return}if(N0)return;if(d)L.openChangeTimeout.start(d,()=>{if(F0&&S())N.setOpen(!0,w0(K0.triggerHover,r,n))});else if(F0){if(S())N.setOpen(!0,w0(K0.triggerHover,r,n))}}function g(r){if(k()){y();return}O();let h=N.select("domReferenceElement"),d=f0(h);L.restTimeout.clear(),L.restTimeoutPending=!1;let o=D.current.floatingContext??K?.();if(B6(r.relatedTarget,N.context.triggerElements))return;if(M.current&&o){if(!N.select("open"))L.openChangeTimeout.clear();let i=G.current;L.handler=M.current({...o,tree:V,x:r.clientX,y:r.clientY,onClose(){if(y(),O(),T.current&&!k()&&i===N.select("domReferenceElement"))I(r,!0)}}),d.addEventListener("mousemove",L.handler),L.handler(r);return}if(L.pointerType==="touch"?!R0(N.select("floatingElement"),r.relatedTarget):!0)I(r)}function E(r){if(R0(x,r.relatedTarget))return;L.openChangeTimeout.clear(),L.restTimeout.clear(),L.restTimeoutPending=!1}let l=q?a0(x,"mouseout",E):void 0;if(z)return j2(a0(x,"mousemove",v,{once:!0}),a0(x,"mouseenter",v),a0(x,"mouseleave",g),l);return j2(a0(x,"mouseenter",v),a0(x,"mouseleave",g),l)},[O,y,D,_,N,J,M,L,Y,R,k,Q,z,w,G,V,T,K,C,S,q]),F6.useMemo(()=>{if(!J)return;function I(x){L.pointerType=x.pointerType}return{onPointerDown:I,onPointerEnter:I,onMouseMove(x){let{nativeEvent:v}=x,g=x.currentTarget,E=N.select("domReferenceElement"),l=N.select("open"),r=R(E,g,x.target);if(Q&&!H8(L.pointerType))return;if(l&&r&&L.handleCloseOptions?.blockPointerEvents){let o=N.select("floatingElement");if(o){let p=L.handleCloseOptions?.getScope?.()??g.ownerDocument.body;HG(L,{scopeElement:p,referenceElement:g,floatingElement:o})}}let h=zA(w.current);if(l&&!r||h===0)return;if(!r&&L.restTimeoutPending&&x.movementX**2+x.movementY**2<2)return;L.restTimeout.clear();function d(){if(L.restTimeoutPending=!1,k())return;let o=N.select("open");if(!L.blockMouseMove&&(!o||r)&&S())N.setOpen(!0,w0(K0.triggerHover,v,g))}if(L.pointerType==="touch")hC.flushSync(()=>{d()});else if(r&&l)d();else L.restTimeoutPending=!0,L.restTimeout.start(h,d)}}},[J,L,k,R,Q,N,w,S])}var m2=P(m(),1);var b00="Escape";function vC($){return $5.engine.webkit&&$.movementX===0&&$.movementY===0}function QG($,Z,J){switch($){case"vertical":return Z;case"horizontal":return J;default:return Z||J}}function BG($,Z){return QG(Z,$===cN||$===Mz,$===eH||$===$B)}function EA($,Z,J){return QG(Z,$===Mz,J?$===eH:$===$B)||$==="Enter"||$===" "||$===""}function w00($,Z,J){return QG(Z,J?$===eH:$===$B,$===Mz)}function S00($,Z,J,H){let B=J?$===$B:$===eH,Q=$===cN;if(Z==="both"||Z==="horizontal"&&H)return $===b00;return QG(Z,B,Q)}function bA($,Z){let{listRef:J,activeIndex:H,onNavigate:B=()=>{},enabled:Q=!0,selectedIndex:X=null,allowEscape:z=!1,loopFocus:G=!1,nested:U=!1,rtl:Y=!1,virtual:K=!1,focusItemOnOpen:F="auto",focusItemOnHover:W=!0,openOnArrowKeyDown:q=!0,disabledIndices:N=void 0,orientation:D="vertical",parentOrientation:A,id:V,resetOnPointerLeave:L=!0,externalTree:j,grid:M}=Z,_=M!=null,w="rootStore"in $?$.rootStore:$,T=w.useState("open"),b=w.useState("floatingElement"),C=w.useState("domReferenceElement"),k=w.context.dataRef,S=QB(b),R=BB(C),O=F5(S),y=O4(),I=$4(j),x=m2.useRef(F),v=m2.useRef(X??-1),g=m2.useRef(null),E=m2.useRef(!0),l=Y0((A0)=>{B(v.current===-1?null:v.current,A0)}),r=m2.useRef(!!b),h=m2.useRef(T),d=m2.useRef(!1),o=m2.useRef(!1),p=m2.useRef(null),i=F5(N),n=F5(T),Z0=F5(X),J0=F5(L),U0=P4(),z0=P4(),B0=Y0(()=>{function A0(t){if(K)I?.events.emit("virtualfocus",t);else p.current=kZ(t,{sync:d.current,preventScroll:!0})}let L0=J.current[v.current],f=o.current;if(L0)A0(L0);(d.current?(t)=>t():(t)=>U0.request(t))(()=>{let t=J.current[v.current]||L0;if(!t)return;if(!L0)A0(t);if(e&&(f||!E.current))t.scrollIntoView?.({block:"nearest",inline:"nearest"})})});H0(()=>{k.current.orientation=D},[k,D]),H0(()=>{if(!Q)return;if(T&&b){if(v.current=X??-1,x.current&&X!=null)o.current=!0,l()}else if(r.current)v.current=-1,l()},[Q,T,b,X,l]),H0(()=>{if(!Q)return;if(!T){d.current=!1;return}if(!b)return;if(H==null){if(d.current=!1,Z0.current!=null)return;if(r.current)v.current=-1,B0();if((!h.current||!r.current)&&x.current&&(g.current!=null||x.current===!0&&g.current==null)){let A0=0,L0=()=>{if(J.current[0]==null){if(A0<2)(A0?(u)=>z0.request(u):queueMicrotask)(L0);A0+=1}else v.current=g.current==null||EA(g.current,D,Y)||U?s7(J):EZ(J),g.current=null,l()};L0()}}else if(!z6(J.current,H))v.current=H,B0(),o.current=!1},[Q,T,b,H,Z0,U,J,D,Y,l,B0,z0]),H0(()=>{if(!Q||b||!I||K||!r.current)return;let A0=I.nodesRef.current,L0=A0.find((t)=>t.id===y)?.context?.elements.floating,f=d1(f0(C??L0??null)),u=A0.some((t)=>t.context&&R0(t.context.elements.floating,f));if(L0&&!u&&E.current)L0.focus({preventScroll:!0})},[Q,b,C,I,y,K]),H0(()=>{h.current=T,r.current=!!b}),H0(()=>{if(!T)g.current=null,x.current=F},[T,F]);let N0=H!=null,D0=Y0((A0)=>{if(!n.current)return;let L0=J.current.indexOf(A0.currentTarget);if(L0!==-1&&(v.current!==L0||H!==L0))v.current=L0,l(A0)}),F0=Y0(()=>{return A??I?.nodesRef.current.find((A0)=>A0.id===y)?.context?.dataRef?.current.orientation}),s=Y0(()=>{return s7(J,i.current)}),a=Y0((A0)=>{if(E.current=!1,d.current=!0,A0.which===229)return;if(!n.current&&A0.currentTarget===O.current)return;if(U&&S00(A0.key,D,Y,_)){if(!BG(A0.key,F0()))h4(A0);if(w.setOpen(!1,w0(K0.listNavigation,A0.nativeEvent)),_1(C))if(K)I?.events.emit("virtualfocus",C);else C.focus();return}let L0=v.current,f=s7(J,N),u=EZ(J,N);if(!R){if(A0.key==="Home")h4(A0),v.current=f,l(A0);if(A0.key==="End")h4(A0),v.current=u,l(A0)}if(M!=null){let t=M(A0,v.current,J,D,G,Y,N,f,u);if(t!=null)v.current=t,l(A0);if(D==="both")return}if(BG(A0.key,D)){if(h4(A0),T&&!K&&d1(A0.currentTarget.ownerDocument)===A0.currentTarget){v.current=EA(A0.key,D,Y)?f:u,l(A0);return}if(EA(A0.key,D,Y))if(G)if(L0>=u)if(z&&L0!==J.current.length)v.current=-1;else d.current=!1,v.current=f;else v.current=j8(J.current,{startingIndex:L0,disabledIndices:N});else v.current=Math.min(u,j8(J.current,{startingIndex:L0,disabledIndices:N}));else if(G)if(L0<=f)if(z&&L0!==-1)v.current=J.current.length;else d.current=!1,v.current=u;else v.current=j8(J.current,{startingIndex:L0,decrement:!0,disabledIndices:N});else v.current=Math.max(f,j8(J.current,{startingIndex:L0,decrement:!0,disabledIndices:N}));if(z6(J.current,v.current))v.current=-1;l(A0)}}),e=m2.useMemo(()=>{return{onFocus(L0){d.current=!0,D0(L0)},onClick:({currentTarget:L0})=>L0.focus({preventScroll:!0}),onMouseMove(L0){if(vC(L0))return;if(d.current=!0,o.current=!1,W)D0(L0)},onPointerLeave(L0){if(!n.current||!E.current||L0.pointerType==="touch")return;d.current=!0;let f=L0.relatedTarget;if(!W||J.current.includes(f))return;if(!J0.current)return;if(p.current?.(),p.current=null,v.current=-1,l(L0),!K){let u=O.current,t=d1(f0(u));if(u&&R0(u,t))u.focus({preventScroll:!0})}}}},[D0,n,O,W,J,l,J0,K]),$0=m2.useMemo(()=>{return K&&T&&N0&&{"aria-activedescendant":`${V}-${H}`}},[K,T,N0,V,H]),Q0=m2.useMemo(()=>{return{...!R?$0:{},onKeyDown(A0){if(A0.key==="Tab"&&A0.shiftKey&&T&&!K){let L0=P1(A0.nativeEvent);if(L0&&!R0(O.current,L0))return;if(h4(A0),w.setOpen(!1,w0(K0.focusOut,A0.nativeEvent)),_1(C))C.focus();return}a(A0)},onPointerMove(A0){if(vC(A0))return;E.current=!0}}},[$0,a,O,R,w,T,K,C]),_0=m2.useMemo(()=>{function A0(u){w.setOpen(!0,w0(K0.listNavigation,u.nativeEvent,u.currentTarget))}function L0(u){if(F==="auto"&&TZ(u.nativeEvent))x.current=!K}function f(u){if(x.current=F,F==="auto"&&CZ(u.nativeEvent))x.current=!0}return{onKeyDown(u){let t=w.select("open");E.current=!1;let W0=u.key.startsWith("Arrow"),S0=w00(u.key,F0(),Y),p0=BG(u.key,D),g0=(U?S0:p0)||u.key==="Enter"||u.key.trim()==="";if(K&&t)return a(u);if(!t&&!q&&W0)return;if(g0){let T0=BG(u.key,F0());g.current=U&&T0?null:u.key}if(U){if(S0)if(h4(u),t)v.current=s(),l(u);else A0(u);return}if(p0){if(Z0.current!=null)v.current=Z0.current;if(h4(u),!t&&q)A0(u);else a(u);if(t)l(u)}return},onFocus(u){if(w.select("open")&&!K)v.current=-1,l(u)},onPointerDown:f,onPointerEnter:f,onMouseDown:L0,onClick:L0}},[a,F,s,U,l,w,q,D,F0,Y,Z0,K]),M0=m2.useMemo(()=>{return{...$0,..._0}},[$0,_0]);return m2.useMemo(()=>Q?{reference:M0,floating:Q0,item:e,trigger:_0}:{},[Q,M0,Q0,_0,e])}var G$=P(m(),1);function wA($,Z){let{listRef:J,elementsRef:H,activeIndex:B,onMatch:Q,disabledIndices:X,onTyping:z,enabled:G=!0,resetMs:U=750,selectedIndex:Y=null}=Z,K="rootStore"in $?$.rootStore:$,F=K.useState("open"),W=i1(),q=G$.useRef(""),N=G$.useRef(Y??B??-1),D=G$.useRef(null),A=Y0((j)=>{function M(O){return H?.current[O]}function _(O){let y=M(O);if(y&&!t7(y)||y?.matches(":disabled"))return!1;return X==null||!M3(s2,O,X)}function w(O,y,I=0){if(O.length===0)return-1;let x=(I%O.length+O.length)%O.length,v=y.toLowerCase();for(let g=0;g<O.length;g+=1){let E=(x+g)%O.length;if(!O[E]?.toLowerCase().startsWith(v)||!_(E))continue;return E}return-1}let T=J.current;if(q.current.length>0&&j.key===" ")h4(j),z?.(!0);if(q.current.length>0&&q.current[0]!==" "){if(w(T,q.current)===-1&&j.key!==" ")z?.(!1)}if(T==null||j.key.length!==1||j.ctrlKey||j.metaKey||j.altKey)return;if(F&&j.key!==" ")h4(j),z?.(!0);let b=q.current==="";if(b)N.current=Y??B??-1;if(T.every((O,y)=>O&&_(y)?O[0]?.toLowerCase()!==O[1]?.toLowerCase():!0)&&q.current===j.key)q.current="",N.current=D.current;q.current+=j.key,W.start(U,()=>{q.current="",N.current=D.current,z?.(!1)});let S=((b?Y??B??-1:N.current)??0)+1,R=w(T,q.current,S);if(R!==-1)Q?.(R),D.current=R;else if(j.key!==" ")q.current="",z?.(!1)}),V=Y0((j)=>{let M=j.relatedTarget,_=K.select("domReferenceElement"),w=K.select("floatingElement");if(R0(_,M)||R0(w,M))return;W.clear(),q.current="",N.current=D.current,z?.(!1)});H0(()=>{if(!F&&Y!==null)return;if(W.clear(),D.current=null,q.current!=="")q.current=""},[F,Y,W]);let L=G$.useMemo(()=>({onKeyDown:A,onBlur:V}),[A,V]);return G$.useMemo(()=>G?{reference:L,floating:L}:{},[G,L])}var gC=0.1,R00=gC*gC,V5=0.5;function XG($,Z,J,H,B,Q){return H>=Z!==Q>=Z&&$<=(B-J)*(Z-H)/(Q-H)+J}function zG($,Z,J,H,B,Q,X,z,G,U){let Y=!1;if(XG($,Z,J,H,B,Q))Y=!Y;if(XG($,Z,B,Q,X,z))Y=!Y;if(XG($,Z,X,z,G,U))Y=!Y;if(XG($,Z,G,U,J,H))Y=!Y;return Y}function k00($,Z,J){return $>=J.x&&$<=J.x+J.width&&Z>=J.y&&Z<=J.y+J.height}function GG($,Z,J,H,B,Q){let X=Math.min(J,B),z=Math.max(J,B),G=Math.min(H,Q),U=Math.max(H,Q);return $>=X&&$<=z&&Z>=G&&Z<=U}function e8($={}){let{blockPointerEvents:Z=!1}=$,J=new d5,H=({x:B,y:Q,placement:X,elements:z,onClose:G,nodeId:U,tree:Y})=>{let K=X?.split("-")[0],F=!1,W=null,q=null,N=typeof performance<"u"?performance.now():0;function D(V,L){let j=performance.now(),M=j-N;if(W===null||q===null||M===0)return W=V,q=L,N=j,!1;let _=V-W,w=L-q,T=_*_+w*w,b=M*M*R00;return W=V,q=L,N=j,T<b}function A(){J.clear(),G()}return function(L){J.clear();let{domReference:j,floating:M}=z;if(!j||!M||K==null||B==null||Q==null)return;let{clientX:_,clientY:w}=L,T=P1(L),b=L.type==="mouseleave",C=R0(M,T),k=R0(j,T);if(C){if(F=!0,!b)return}if(k){if(F=!1,!b){F=!0;return}}if(b&&s0(L.relatedTarget)&&R0(M,L.relatedTarget))return;function S(){return Boolean(Y&&P8(Y.nodesRef.current,U).length>0)}function R(){if(!S())A()}if(S())return;let O=j.getBoundingClientRect(),y=M.getBoundingClientRect(),I=B>y.right-y.width/2,x=Q>y.bottom-y.height/2,v=y.width>O.width,g=y.height>O.height,E=(v?O:y).left,l=(v?O:y).right,r=(g?O:y).top,h=(g?O:y).bottom;if(K==="top"&&Q>=O.bottom-1||K==="bottom"&&Q<=O.top+1||K==="left"&&B>=O.right-1||K==="right"&&B<=O.left+1){R();return}let d=!1;switch(K){case"top":d=GG(_,w,E,O.top+1,l,y.bottom-1);break;case"bottom":d=GG(_,w,E,y.top+1,l,O.bottom-1);break;case"left":d=GG(_,w,y.right-1,h,O.left+1,r);break;case"right":d=GG(_,w,O.right-1,h,y.left+1,r);break;default:}if(d)return;if(F&&!k00(_,w,O)){R();return}if(!b&&D(_,w)){R();return}let o=!1;switch(K){case"top":{let p=v?V5/2:V5*4,i=v?B+p:I?B+p:B-p,n=v?B-p:I?B+p:B-p,Z0=Q+V5+1,J0=I?y.bottom-V5:v?y.bottom-V5:y.top,U0=I?v?y.bottom-V5:y.top:y.bottom-V5;o=zG(_,w,i,Z0,n,Z0,y.left,J0,y.right,U0);break}case"bottom":{let p=v?V5/2:V5*4,i=v?B+p:I?B+p:B-p,n=v?B-p:I?B+p:B-p,Z0=Q-V5,J0=I?y.top+V5:v?y.top+V5:y.bottom,U0=I?v?y.top+V5:y.bottom:y.top+V5;o=zG(_,w,i,Z0,n,Z0,y.left,J0,y.right,U0);break}case"left":{let p=g?V5/2:V5*4,i=g?Q+p:x?Q+p:Q-p,n=g?Q-p:x?Q+p:Q-p,Z0=B+V5+1,J0=x?y.right-V5:g?y.right-V5:y.left,U0=x?g?y.right-V5:y.left:y.right-V5;o=zG(_,w,J0,y.top,U0,y.bottom,Z0,i,Z0,n);break}case"right":{let p=g?V5/2:V5*4,i=g?Q+p:x?Q+p:Q-p,n=g?Q-p:x?Q+p:Q-p,Z0=B-V5,J0=x?y.left+V5:g?y.left+V5:y.right,U0=x?g?y.left+V5:y.right:y.left+V5;o=zG(_,w,Z0,i,Z0,n,J0,y.top,U0,y.bottom);break}default:}if(!o)R();else if(!F)J.start(40,R);return}};return H.__options={...$,blockPointerEvents:Z},H}function fC($,Z,J){let{reference:H,floating:B}=$,Q=v4(Z),X=UB(Z),z=GB(X),G=e2(Z),U=Q==="y",Y=H.x+H.width/2-B.width/2,K=H.y+H.height/2-B.height/2,F=H[z]/2-B[z]/2,W;switch(G){case"top":W={x:Y,y:H.y-B.height};break;case"bottom":W={x:Y,y:H.y+H.height};break;case"right":W={x:H.x+H.width,y:K};break;case"left":W={x:H.x-B.width,y:K};break;default:W={x:H.x,y:H.y}}let q=_8(Z);if(q)W[X]+=F*(q==="end"?1:-1)*(J&&U?-1:1);return W}async function mC($,Z){var J;if(Z===void 0)Z={};let{x:H,y:B,platform:Q,rects:X,elements:z,strategy:G}=$,{boundary:U="clippingAncestors",rootBoundary:Y="viewport",elementContext:K="floating",altBoundary:F=!1,padding:W=0}=T9(Z,$),q=Ez(W),D=z[F?K==="floating"?"reference":"floating":K],A=n7(await Q.getClippingRect({element:((J=await(Q.isElement==null?void 0:Q.isElement(D)))!=null?J:!0)?D:D.contextElement||await(Q.getDocumentElement==null?void 0:Q.getDocumentElement(z.floating)),boundary:U,rootBoundary:Y,strategy:G})),V=K==="floating"?{x:H,y:B,width:X.floating.width,height:X.floating.height}:X.reference,L=await(Q.getOffsetParent==null?void 0:Q.getOffsetParent(z.floating)),j=await(Q.isElement==null?void 0:Q.isElement(L))&&await(Q.getScale==null?void 0:Q.getScale(L))||{x:1,y:1},M=n7(Q.convertOffsetParentRelativeRectToViewportRelativeRect?await Q.convertOffsetParentRelativeRectToViewportRelativeRect({elements:z,rect:V,offsetParent:L,strategy:G}):V);return{top:(A.top-M.top+q.top)/j.y,bottom:(M.bottom-A.bottom+q.bottom)/j.y,left:(A.left-M.left+q.left)/j.x,right:(M.right-A.right+q.right)/j.x}}var I00=50,uC=async($,Z,J)=>{let{placement:H="bottom",strategy:B="absolute",middleware:Q=[],platform:X}=J,z=X.detectOverflow?X:{...X,detectOverflow:mC},G=await(X.isRTL==null?void 0:X.isRTL(Z)),U=await X.getElementRects({reference:$,floating:Z,strategy:B}),{x:Y,y:K}=fC(U,H,G),F=H,W=0,q={};for(let N=0;N<Q.length;N++){let D=Q[N];if(!D)continue;let{name:A,fn:V}=D,{x:L,y:j,data:M,reset:_}=await V({x:Y,y:K,initialPlacement:H,placement:F,strategy:B,middlewareData:q,rects:U,platform:z,elements:{reference:$,floating:Z}});if(Y=L!=null?L:Y,K=j!=null?j:K,q[A]={...q[A],...M},_&&W<I00){if(W++,typeof _==="object"){if(_.placement)F=_.placement;if(_.rects)U=_.rects===!0?await X.getElementRects({reference:$,floating:Z,strategy:B}):_.rects;({x:Y,y:K}=fC(U,F,G))}N=-1}}return{x:Y,y:K,placement:F,strategy:B,middlewareData:q}};var pC=function($){if($===void 0)$={};return{name:"flip",options:$,async fn(Z){var J,H;let{placement:B,middlewareData:Q,rects:X,initialPlacement:z,platform:G,elements:U}=Z,{mainAxis:Y=!0,crossAxis:K=!0,fallbackPlacements:F,fallbackStrategy:W="bestFit",fallbackAxisSideDirection:q="none",flipAlignment:N=!0,...D}=T9($,Z);if((J=Q.arrow)!=null&&J.alignmentOffset)return{};let A=e2(B),V=v4(z),L=e2(z)===z,j=await(G.isRTL==null?void 0:G.isRTL(U.floating)),M=F||(L||!N?[XB(z)]:zT(z)),_=q!=="none";if(!F&&_)M.push(...GT(z,N,q,j));let w=[z,...M],T=await G.detectOverflow(Z,D),b=[],C=((H=Q.flip)==null?void 0:H.overflows)||[];if(Y)b.push(T[A]);if(K){let O=XT(B,X,j);b.push(T[O[0]],T[O[1]])}if(C=[...C,{placement:B,overflows:b}],!b.every((O)=>O<=0)){var k,S;let O=(((k=Q.flip)==null?void 0:k.index)||0)+1,y=w[O];if(y){if(!(K==="alignment"?V!==v4(y):!1)||C.every((v)=>v4(v.placement)===V?v.overflows[0]>0:!0))return{data:{index:O,overflows:C},reset:{placement:y}}}let I=(S=C.filter((x)=>x.overflows[0]<=0).sort((x,v)=>x.overflows[1]-v.overflows[1])[0])==null?void 0:S.placement;if(!I)switch(W){case"bestFit":{var R;let x=(R=C.filter((v)=>{if(_){let g=v4(v.placement);return g===V||g==="y"}return!0}).map((v)=>[v.placement,v.overflows.filter((g)=>g>0).reduce((g,E)=>g+E,0)]).sort((v,g)=>v[1]-g[1])[0])==null?void 0:R[0];if(x)I=x;break}case"initialPlacement":I=z;break}if(B!==I)return{reset:{placement:I}}}return{}}}};var cC=new Set(["left","top"]);async function y00($,Z){let{placement:J,platform:H,elements:B}=$,Q=await(H.isRTL==null?void 0:H.isRTL(B.floating)),X=e2(J),z=_8(J),G=v4(J)==="y",U=cC.has(X)?-1:1,Y=Q&&G?-1:1,K=T9(Z,$),{mainAxis:F,crossAxis:W,alignmentAxis:q}=typeof K==="number"?{mainAxis:K,crossAxis:0,alignmentAxis:null}:{mainAxis:K.mainAxis||0,crossAxis:K.crossAxis||0,alignmentAxis:K.alignmentAxis};if(z&&typeof q==="number")W=z==="end"?q*-1:q;return G?{x:W*Y,y:F*U}:{x:F*U,y:W*Y}}var dC=function($){if($===void 0)$=0;return{name:"offset",options:$,async fn(Z){var J,H;let{x:B,y:Q,placement:X,middlewareData:z}=Z,G=await y00(Z,$);if(X===((J=z.offset)==null?void 0:J.placement)&&(H=z.arrow)!=null&&H.alignmentOffset)return{};return{x:B+G.x,y:Q+G.y,data:{...G,placement:X}}}}},lC=function($){if($===void 0)$={};return{name:"shift",options:$,async fn(Z){let{x:J,y:H,placement:B,platform:Q}=Z,{mainAxis:X=!0,crossAxis:z=!1,limiter:G={fn:(V)=>{let{x:L,y:j}=V;return{x:L,y:j}}},...U}=T9($,Z),Y={x:J,y:H},K=await Q.detectOverflow(Z,U),F=v4(B),W=Cz(F),q=Y[W],N=Y[F],D=(V,L)=>Tz(L+K[V==="y"?"top":"left"],L,L-K[V==="y"?"bottom":"right"]);if(X)q=D(W,q);if(z)N=D(F,N);let A=G.fn({...Z,[W]:q,[F]:N});return{...A,data:{x:A.x-J,y:A.y-H,enabled:{[W]:X,[F]:z}}}}}},iC=function($){if($===void 0)$={};return{options:$,fn(Z){var J,H;let{x:B,y:Q,placement:X,rects:z,middlewareData:G}=Z,{offset:U=0,mainAxis:Y=!0,crossAxis:K=!0}=T9($,Z),F={x:B,y:Q},W=v4(X),q=Cz(W),N=F[q],D=F[W],A=T9(U,Z),V=typeof A==="number"?{mainAxis:A,crossAxis:0}:{mainAxis:(J=A.mainAxis)!=null?J:0,crossAxis:(H=A.crossAxis)!=null?H:0};if(Y){let M=q==="y"?"height":"width",_=z.reference[q]-z.floating[M]+V.mainAxis,w=z.reference[q]+z.reference[M]-V.mainAxis;if(N<_)N=_;else if(N>w)N=w}if(K){var L,j;let M=q==="y"?"width":"height",_=cC.has(e2(X)),w=z.reference[W]-z.floating[M]+(_?((L=G.offset)==null?void 0:L[W])||0:0)+(_?0:V.crossAxis),T=z.reference[W]+z.reference[M]+(_?0:((j=G.offset)==null?void 0:j[W])||0)-(_?V.crossAxis:0);if(D<w)D=w;else if(D>T)D=T}return{[q]:N,[W]:D}}}},rC=function($){if($===void 0)$={};return{name:"size",options:$,async fn(Z){let{placement:J,rects:H,platform:B,elements:Q}=Z,{apply:X=()=>{},...z}=T9($,Z),G=await B.detectOverflow(Z,z),U=e2(J),Y=_8(J),K=v4(J)==="y",{width:F,height:W}=H.floating,q,N;if(U==="top"||U==="bottom")q=U,N=Y===(await(B.isRTL==null?void 0:B.isRTL(Q.floating))?"start":"end")?"left":"right";else N=U,q=Y==="end"?"top":"bottom";let D=W-G.top-G.bottom,A=F-G.left-G.right,V=Q6(W-G[q],D),L=Q6(F-G[N],A),j=Z.middlewareData.shift,M=!j,_=V,w=L;if(j!=null&&j.enabled.x)w=A;if(j!=null&&j.enabled.y)_=D;if(M&&!Y)if(K)w=F-2*l8(G.left,G.right);else _=W-2*l8(G.top,G.bottom);await X({...Z,availableWidth:w,availableHeight:_});let T=await B.getDimensions(Q.floating);if(F!==T.width||W!==T.height)return{reset:{rects:!0}};return{}}}};function tC($){let Z=g2($),J=parseFloat(Z.width)||0,H=parseFloat(Z.height)||0,B=_1($),Q=B?$.offsetWidth:J,X=B?$.offsetHeight:H,z=X6(J)!==Q||X6(H)!==X;if(z)J=Q,H=X;return{width:J,height:H,$:z}}function yA($){return!s0($)?$.contextElement:$}function xZ($){let Z=yA($);if(!_1(Z))return O9(1);let J=Z.getBoundingClientRect(),{width:H,height:B,$:Q}=tC(Z),X=(Q?X6(J.width):J.width)/H,z=(Q?X6(J.height):J.height)/B;if(!X||!Number.isFinite(X))X=1;if(!z||!Number.isFinite(z))z=1;return{x:X,y:z}}var x00=O9(0);function eC($){let Z=w1($);if(!IA()||!Z.visualViewport)return x00;return{x:Z.visualViewport.offsetLeft,y:Z.visualViewport.offsetTop}}function h00($,Z,J){if(Z===void 0)Z=!1;return!!J&&Z&&J===w1($)}function U$($,Z,J,H){if(Z===void 0)Z=!1;if(J===void 0)J=!1;let B=$.getBoundingClientRect(),Q=yA($),X=O9(1);if(Z)if(H){if(s0(H))X=xZ(H)}else X=xZ($);let z=h00(Q,J,H)?eC(Q):O9(0),G=(B.left+z.x)/X.x,U=(B.top+z.y)/X.y,Y=B.width/X.x,K=B.height/X.y;if(Q&&H){let F=w1(Q),W=s0(H)?w1(H):H,q=F,N=RA(q);while(N&&W!==q){let D=xZ(N),A=N.getBoundingClientRect(),V=g2(N),L=A.left+(N.clientLeft+parseFloat(V.paddingLeft))*D.x,j=A.top+(N.clientTop+parseFloat(V.paddingTop))*D.y;G*=D.x,U*=D.y,Y*=D.x,K*=D.y,G+=L,U+=j,q=w1(N),N=RA(q)}}return n7({width:Y,height:K,x:G,y:U})}function YG($,Z){let J=DB($).scrollLeft;if(!Z)return U$(E3($)).left+J;return Z.left+J}function $E($,Z){let J=$.getBoundingClientRect(),H=J.left+Z.scrollLeft-YG($,J),B=J.top+Z.scrollTop;return{x:H,y:B}}function v00($){let{elements:Z,rect:J,offsetParent:H,strategy:B}=$,Q=B==="fixed",X=E3(H),z=Z?UG(Z.floating):!1;if(H===X||z&&Q)return J;let G={scrollLeft:0,scrollTop:0},U=O9(1),Y=O9(0),K=_1(H);if(K||!Q){if(O2(H)!=="body"||AB(X))G=DB(H);if(K){let W=U$(H);U=xZ(H),Y.x=W.x+H.clientLeft,Y.y=W.y+H.clientTop}}let F=X&&!K&&!Q?$E(X,G):O9(0);return{width:J.width*U.x,height:J.height*U.y,x:J.x*U.x-G.scrollLeft*U.x+Y.x+F.x,y:J.y*U.y-G.scrollTop*U.y+Y.y+F.y}}function g00($){return $.getClientRects?Array.from($.getClientRects()):[]}function f00($){let Z=DB($),J=$.ownerDocument.body,H=l8($.scrollWidth,$.clientWidth,J.scrollWidth,J.clientWidth),B=l8($.scrollHeight,$.clientHeight,J.scrollHeight,J.clientHeight),Q=-Z.scrollLeft+YG($),X=-Z.scrollTop;if(g2(J).direction==="rtl")Q+=l8($.clientWidth,J.clientWidth)-H;return{width:H,height:B,x:Q,y:X}}var m00=25;function u00($,Z,J){if(J===void 0)J="viewport";let H=J==="layoutViewport",B=w1($),Q=E3($),X=B.visualViewport,z=Q.clientWidth,G=Q.clientHeight,U=0,Y=0;if(X){let F=!IA()||Z==="fixed";if(H){if(!F)U=-X.offsetLeft,Y=-X.offsetTop}else if(z=X.width,G=X.height,F)U=X.offsetLeft,Y=X.offsetTop}if(YG(Q)<=0){let F=Q.ownerDocument,W=F.body,q=getComputedStyle(W),N=F.compatMode==="CSS1Compat"?parseFloat(q.marginLeft)+parseFloat(q.marginRight)||0:0,D=Math.abs(Q.clientWidth-W.clientWidth-N),A=getComputedStyle(Q).scrollbarGutter==="stable both-edges"?D/2:D;if(A<=m00)z-=A}return{width:z,height:G,x:U,y:Y}}function p00($,Z){let J=U$($,!0,Z==="fixed"),H=J.top+$.clientTop,B=J.left+$.clientLeft,Q=xZ($),X=$.clientWidth*Q.x,z=$.clientHeight*Q.y,G=B*Q.x,U=H*Q.y;return{width:X,height:z,x:G,y:U}}function aC($,Z,J){let H;if(Z==="viewport"||Z==="layoutViewport")H=u00($,J,Z);else if(Z==="document")H=f00(E3($));else if(s0(Z))H=p00(Z,J);else{let B=eC($);H={x:Z.x-B.x,y:Z.y-B.y,width:Z.width,height:Z.height}}return n7(H)}function c00($,Z){let J=Z.get($);if(J)return J;let H=hZ($,[],!1).filter((z)=>s0(z)&&O2(z)!=="body"),B=null,Q=g2($).position==="fixed",X=Q?E8($):$;while(s0(X)&&!C8(X)){let z=g2(X),G=kA(X),U=B?B.position:Q?"fixed":"";if(!G&&(U==="fixed"||U==="absolute"&&z.position==="static"))H=H.filter((K)=>K!==X);else B=z;X=E8(X)}return Z.set($,H),H}function d00($){let{element:Z,boundary:J,rootBoundary:H,strategy:B}=$,X=[...J==="clippingAncestors"?UG(Z)?[]:c00(Z,this._c):[].concat(J),H],z=aC(Z,X[0],B),G=z.top,U=z.right,Y=z.bottom,K=z.left;for(let F=1;F<X.length;F++){let W=aC(Z,X[F],B);G=l8(W.top,G),U=Q6(W.right,U),Y=Q6(W.bottom,Y),K=l8(W.left,K)}return{width:U-K,height:Y-G,x:K,y:G}}function l00($){let{width:Z,height:J}=tC($);return{width:Z,height:J}}function i00($,Z,J){let H=_1(Z),B=E3(Z),Q=J==="fixed",X=U$($,!0,Q,Z),z={scrollLeft:0,scrollTop:0},G=O9(0);if(H||!Q){if(O2(Z)!=="body"||AB(B))z=DB(Z);if(H){let F=U$(Z,!0,Q,Z);G.x=F.x+Z.clientLeft,G.y=F.y+Z.clientTop}}if(!H&&B)G.x=YG(B);let U=B&&!H&&!Q?$E(B,z):O9(0),Y=X.left+z.scrollLeft-G.x-U.x,K=X.top+z.scrollTop-G.y-U.y;return{x:Y,y:K,width:X.width,height:X.height}}function SA($){return g2($).position==="static"}function oC($,Z){if(!_1($)||g2($).position==="fixed")return null;if(Z)return Z($);let J=$.offsetParent;if(E3($)===J)J=J.ownerDocument.body;return J}function ZE($,Z){let J=w1($);if(UG($))return J;if(!_1($)){let B=E8($);while(B&&!C8(B)){if(s0(B)&&!SA(B))return B;B=E8(B)}return J}let H=oC($,Z);while(H&&nC(H)&&SA(H))H=oC(H,Z);if(H&&C8(H)&&SA(H)&&!kA(H))return J;return H||sC($)||J}var r00=async function($){let Z=this.getOffsetParent||ZE,J=this.getDimensions,H=await J($.floating);return{reference:i00($.reference,await Z($.floating),$.strategy),floating:{x:0,y:0,width:H.width,height:H.height}}};function a00($){return g2($).direction==="rtl"}var xA={convertOffsetParentRelativeRectToViewportRelativeRect:v00,getDocumentElement:E3,getClippingRect:d00,getOffsetParent:ZE,getElementRects:r00,getClientRects:g00,getDimensions:l00,getScale:xZ,isElement:s0,isRTL:a00};function JE($,Z){return $.x===Z.x&&$.y===Z.y&&$.width===Z.width&&$.height===Z.height}function o00($,Z,J){let H=null,B,Q=E3($);function X(){var Y;clearTimeout(B),(Y=H)==null||Y.disconnect(),H=null}function z(Y,K){if(Y===void 0)Y=!1;if(K===void 0)K=1;X();let F=$.getBoundingClientRect(),{left:W,top:q,width:N,height:D}=F;if(!Y)Z();if(!N||!D)return;let A=zB(q),V=zB(Q.clientWidth-(W+N)),L=zB(Q.clientHeight-(q+D)),j=zB(W),_={rootMargin:-A+"px "+-V+"px "+-L+"px "+-j+"px",threshold:l8(0,Q6(1,K))||1},w=!0;function T(b){let C=b[0].intersectionRatio;if(!JE(F,$.getBoundingClientRect()))return z();if(C!==K){if(!w)return z();if(!C)B=setTimeout(()=>{z(!1,0.0000001)},1000);else z(!1,C)}w=!1}try{H=new IntersectionObserver(T,{..._,root:Q.ownerDocument})}catch(b){H=new IntersectionObserver(T,_)}H.observe($)}let G=w1($),U=()=>z(J);return G.addEventListener("resize",U),z(!0),()=>{G.removeEventListener("resize",U),X()}}function VB($,Z,J,H){if(H===void 0)H={};let{ancestorScroll:B=!0,ancestorResize:Q=!0,elementResize:X=typeof ResizeObserver==="function",layoutShift:z=typeof IntersectionObserver==="function",animationFrame:G=!1}=H,U=yA($),Y=B||Q?[...U?hZ(U):[],...Z?hZ(Z):[]]:[];Y.forEach((A)=>{B&&A.addEventListener("scroll",J),Q&&A.addEventListener("resize",J)});let K=U&&z?o00(U,J,Q):null,F=-1,W=null;if(X){if(W=new ResizeObserver((A)=>{let[V]=A;if(V&&V.target===U&&W&&Z)W.unobserve(Z),cancelAnimationFrame(F),F=requestAnimationFrame(()=>{var L;(L=W)==null||L.observe(Z)});J()}),U&&!G)W.observe(U);if(Z)W.observe(Z)}let q,N=G?U$($):null;if(G)D();function D(){let A=U$($);if(N&&!JE(N,A))J();N=A,q=requestAnimationFrame(D)}return J(),()=>{var A;if(Y.forEach((V)=>{B&&V.removeEventListener("scroll",J),Q&&V.removeEventListener("resize",J)}),K==null||K(),(A=W)==null||A.disconnect(),W=null,G)cancelAnimationFrame(q)}}var HE=dC;var BE=lC,QE=pC,XE=rC;var zE=iC,KG=($,Z,J)=>{let H=new Map,B=J!=null?J:{},Q={...xA,...B.platform,_c:H};return uC($,Z,{...B,platform:Q})};var Q2=P(m(),1),UE=P(m(),1),YE=P(B8(),1),s00=typeof document<"u",t00=function(){},FG=s00?UE.useLayoutEffect:t00;function WG($,Z){if($===Z)return!0;if(typeof $!==typeof Z)return!1;if(typeof $==="function"&&$.toString()===Z.toString())return!0;let J,H,B;if($&&Z&&typeof $==="object"){if(Array.isArray($)){if(J=$.length,J!==Z.length)return!1;for(H=J;H--!==0;)if(!WG($[H],Z[H]))return!1;return!0}if(B=Object.keys($),J=B.length,J!==Object.keys(Z).length)return!1;for(H=J;H--!==0;)if(!{}.hasOwnProperty.call(Z,B[H]))return!1;for(H=J;H--!==0;){let Q=B[H];if(Q==="_owner"&&$.$$typeof)continue;if(!WG($[Q],Z[Q]))return!1}return!0}return $!==$&&Z!==Z}function KE($){if(typeof window>"u")return 1;return($.ownerDocument.defaultView||window).devicePixelRatio||1}function GE($,Z){let J=KE($);return Math.round(Z*J)/J}function hA($){let Z=Q2.useRef($);return FG(()=>{Z.current=$}),Z}function FE($){if($===void 0)$={};let{placement:Z="bottom",strategy:J="absolute",middleware:H=[],platform:B,elements:{reference:Q,floating:X}={},transform:z=!0,whileElementsMounted:G,open:U}=$,[Y,K]=Q2.useState({x:0,y:0,strategy:J,placement:Z,middlewareData:{},isPositioned:!1}),[F,W]=Q2.useState(H);if(!WG(F,H))W(H);let[q,N]=Q2.useState(null),[D,A]=Q2.useState(null),V=Q2.useCallback((v)=>{if(v!==_.current)_.current=v,N(v)},[]),L=Q2.useCallback((v)=>{if(v!==w.current)w.current=v,A(v)},[]),j=Q||q,M=X||D,_=Q2.useRef(null),w=Q2.useRef(null),T=Q2.useRef(Y),b=G!=null,C=hA(G),k=hA(B),S=hA(U),R=Q2.useCallback(()=>{if(!_.current||!w.current)return;let v={placement:Z,strategy:J,middleware:F};if(k.current)v.platform=k.current;KG(_.current,w.current,v).then((g)=>{let E={...g,isPositioned:S.current!==!1};if(O.current&&!WG(T.current,E))T.current=E,YE.flushSync(()=>{K(E)})})},[F,Z,J,k,S]);FG(()=>{if(U===!1&&T.current.isPositioned)T.current.isPositioned=!1,K((v)=>({...v,isPositioned:!1}))},[U]);let O=Q2.useRef(!1);FG(()=>{return O.current=!0,()=>{O.current=!1}},[]),FG(()=>{if(j)_.current=j;if(M)w.current=M;if(j&&M){if(C.current)return C.current(j,M,R);R()}},[j,M,R,C,b]);let y=Q2.useMemo(()=>({reference:_,floating:w,setReference:V,setFloating:L}),[V,L]),I=Q2.useMemo(()=>({reference:j,floating:M}),[j,M]),x=Q2.useMemo(()=>{let v={position:J,left:0,top:0};if(!I.floating)return v;let g=GE(I.floating,Y.x),E=GE(I.floating,Y.y);if(z)return{...v,transform:"translate("+g+"px, "+E+"px)",...KE(I.floating)>=1.5&&{willChange:"transform"}};return{position:J,left:g,top:E}},[J,z,I.floating,Y.x,Y.y]);return Q2.useMemo(()=>({...Y,update:R,refs:y,elements:I,floatingStyles:x}),[Y,R,y,I,x])}var vA=($,Z)=>{let J=HE($);return{name:J.name,fn:J.fn,options:[$,Z]}},gA=($,Z)=>{let J=BE($);return{name:J.name,fn:J.fn,options:[$,Z]}},fA=($,Z)=>{return{fn:zE($).fn,options:[$,Z]}},mA=($,Z)=>{let J=QE($);return{name:J.name,fn:J.fn,options:[$,Z]}},uA=($,Z)=>{let J=XE($);return{name:J.name,fn:J.fn,options:[$,Z]}};var J4=P(m(),1);function WE($){return e00($,$.rootContext)}function e00($,Z){let{nodeId:J,externalTree:H}=$,B=Z.useState("referenceElement"),Q=Z.useState("floatingElement"),X=Z.useState("domReferenceElement"),z=Z.useState("open"),G=Z.useState("floatingId"),[U,Y]=J4.useState(null),[K,F]=J4.useState(void 0),[W,q]=J4.useState(void 0),N=J4.useRef(null),D=$4(H),A=J4.useMemo(()=>({reference:B,floating:Q,domReference:X}),[B,Q,X]),V=FE({...$,elements:{...A,...U&&{reference:U}}}),L=s0(K)?K:null,j=W===void 0?Z.state.floatingElement:W;Z.useSyncedValue("referenceElement",K??null),Z.useSyncedValue("domReferenceElement",K===void 0?X:L),Z.useSyncedValue("floatingElement",j);let M=J4.useCallback((k)=>{let S=s0(k)?{getBoundingClientRect:()=>k.getBoundingClientRect(),getClientRects:()=>k.getClientRects(),contextElement:k}:k;Y(S),V.refs.setReference(S)},[V.refs]),_=J4.useCallback((k)=>{if(s0(k)||k===null)N.current=k,F(k);if(s0(V.refs.reference.current)||V.refs.reference.current===null||k!==null&&!s0(k))V.refs.setReference(k)},[V.refs,F]),w=J4.useCallback((k)=>{q(k),V.refs.setFloating(k)},[V.refs]),T=J4.useMemo(()=>({...V.refs,setReference:_,setFloating:w,setPositionReference:M,domReference:N}),[V.refs,_,w,M]),b=J4.useMemo(()=>({...V.elements,domReference:X}),[V.elements,X]),C=J4.useMemo(()=>({...V,dataRef:Z.context.dataRef,open:z,onOpenChange:Z.setOpen,events:Z.context.events,floatingId:G,refs:T,elements:b,nodeId:J,rootStore:Z}),[V,T,b,J,Z,z,G]);return H0(()=>{if(X)N.current=X},[X]),H0(()=>{Z.context.dataRef.current.floatingContext=C;let k=D?.nodesRef.current.find((S)=>S.id===J);if(k)k.context=C}),J4.useMemo(()=>({...V,context:C,refs:T,elements:b,rootStore:Z}),[V,T,b,C,Z])}var qG=P(m(),1),$10=qG.createContext(void 0);function u4(){return qG.useContext($10)?.direction??"ltr"}var Z10=($)=>({name:"arrow",options:$,async fn(Z){let{x:J,y:H,placement:B,rects:Q,platform:X,elements:z,middlewareData:G}=Z,{element:U,padding:Y=0,offsetParent:K="real"}=T9($,Z)||{};if(U==null)return{};let F=Ez(Y),W={x:J,y:H},q=UB(B),N=GB(q),D=await X.getDimensions(U),A=q==="y",V=A?"top":"left",L=A?"bottom":"right",j=A?"clientHeight":"clientWidth",M=Q.reference[N]+Q.reference[q]-W[q]-Q.floating[N],_=W[q]-Q.reference[q],w=K==="real"?await X.getOffsetParent?.(U):z.floating,T=z.floating[j]||Q.floating[N];if(!T||!await X.isElement?.(w))T=z.floating[j]||Q.floating[N];let b=M/2-_/2,C=T/2-D[N]/2-1,k=Math.min(F[V],C),S=Math.min(F[L],C),R=k,O=T-D[N]-S,y=T/2-D[N]/2+b,I=Tz(R,y,O),x=!G.arrow&&_8(B)!=null&&y!==I&&Q.reference[N]/2-(y<R?k:S)-D[N]/2<0,v=x?y<R?y-R:y-O:0;return{[q]:W[q]+v,data:{[q]:I,centerOffset:y-I-v,...x&&{alignmentOffset:v}},reset:x}}}),qE=($,Z)=>{let{name:J,fn:H}=Z10($);return{name:J,fn:H,options:[$,Z]}};var NE={name:"hide",async fn($){let{width:Z,height:J,x:H,y:B}=$.rects.reference,Q=Z===0&&J===0&&H===0&&B===0,X=await $.platform.detectOverflow($,{elementContext:"reference"});return{data:{referenceHidden:X.top-J>=0||X.right-Z>=0||X.bottom-J>=0||X.left-Z>=0||Q}}}};var vZ={sideX:"left",sideY:"top"};var NG="--available-width",AG="--available-height",AE="--anchor-width",DE="--anchor-height",VE="--transform-origin",LE="--positioner-width",ME="--positioner-height";var _E=NG,jE=AG;function CE($,Z,J){let H=$==="inline-start"||$==="inline-end";return{top:"top",right:H?J?"inline-start":"inline-end":"right",bottom:"bottom",left:H?J?"inline-end":"inline-start":"left"}[Z]}function OE($,Z,J){let{rects:H,placement:B}=$;return{side:CE(Z,e2(B),J),align:_8(B)||"center",anchor:{width:H.reference.width,height:H.reference.height},positioner:{width:H.floating.width,height:H.floating.height}}}function v9($){return J10($,WE)}function J10($,Z){let{anchor:J,positionMethod:H="absolute",side:B="bottom",sideOffset:Q=0,align:X="center",alignOffset:z=0,collisionBoundary:G,collisionPadding:U=5,sticky:Y=!1,arrowPadding:K=5,disableAnchorTracking:F=!1,inline:W,keepMounted:q=!1,floatingRootContext:N,mounted:D,collisionAvoidance:A,shift:V,nodeId:L,adaptiveOrigin:j,lazyFlip:M=!1,externalTree:_}=$,[w,T]=Q8.useState(null);if(!D&&w!==null)T(null);let b=A.side||"flip",C=A.align||"flip",k=A.fallbackAxisSide||"end",S=V?.crossAxis??!1,R=V?.rootBoundary,O=typeof J==="function"?J:void 0,y=Y0(O),I=O?y:J,x=F5(J),v=F5(D),E=u4()==="rtl",l=w||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":E?"left":"right","inline-start":E?"right":"left"}[B],r=X==="center"?l:`${l}-${X}`,h=U;if(typeof h==="number")h={top:h,right:h,bottom:h,left:h};else if(h)h={top:h.top||0,right:h.right||0,bottom:h.bottom||0,left:h.left||0};let d=1,o=B==="bottom"?d:0,p=B==="top"?d:0,i=B==="right"?d:0,n=B==="left"?d:0,Z0={boundary:G==="clipping-ancestors"?"clippingAncestors":G,padding:h},J0=Q8.useRef(null),U0=F5(Q),z0=F5(z),B0=typeof Q!=="function"?Q:0,N0=typeof z!=="function"?z:0,D0=[];if(W)D0.push(W);D0.push(vA((C0)=>{let x0=OE(C0,B,E),r0=typeof U0.current==="function"?U0.current(x0):U0.current,n0=typeof z0.current==="function"?z0.current(x0):z0.current;return{mainAxis:r0,crossAxis:n0,alignmentAxis:n0}},[B0,N0,E,B]));let F0=C==="none"&&b!=="shift",s=!F0&&(Y||S||b==="shift"),a=b==="none"?null:mA({...Z0,padding:{top:h.top+d+o,right:h.right+d+n,bottom:h.bottom+d+p,left:h.left+d+i},mainAxis:!S&&b==="flip",crossAxis:C==="flip"?"alignment":!1,fallbackAxisSideDirection:k}),e=F0?null:gA({...Z0,rootBoundary:R,mainAxis:C!=="none",crossAxis:s,limiter:Y||S?void 0:fA((C0)=>{if(!J0.current)return{};let{width:x0,height:r0}=J0.current.getBoundingClientRect(),n0=v4(e2(C0.placement)),D1=n0==="y"?x0:r0,V1=n0==="y"?h.left+h.right:h.top+h.bottom;return{offset:D1/2+V1/2}})},[Z0,Y,S,R,h,C]);if(b==="shift"||C==="shift"||X==="center")D0.push(e,a);else D0.push(a,e);D0.push(uA({...Z0,apply({elements:{floating:C0},availableWidth:x0,availableHeight:r0,rects:n0}){if(!v.current)return;let D1=C0.style;D1.setProperty(_E,`${x0}px`),D1.setProperty(jE,`${r0}px`);let V1=w1(C0).devicePixelRatio||1,{x:p1,y:e1,width:m0,height:q0}=n0.reference,h0=(Math.round((p1+m0)*V1)-Math.round(p1*V1))/V1,U1=(Math.round((e1+q0)*V1)-Math.round(e1*V1))/V1;D1.setProperty(AE,`${h0}px`),D1.setProperty(DE,`${U1}px`)}}),qE((C0)=>({element:J0.current||f0(C0.elements.floating).createElement("div"),padding:J0.current?K:0,offsetParent:"floating"}),[K]),{name:"transformOrigin",fn(C0){let{elements:{floating:x0},middlewareData:r0,placement:n0,platform:D1,rects:V1,y:p1}=C0,e1=e2(n0),m0=_8(n0),q0=v4(e1)==="y",h0=J0.current,U1=typeof Q==="function"?Q(OE(C0,B,E)):Q,k0;if(!h0&&m0&&Math.abs(q0?r0.shift?.x||0:r0.shift?.y||0)<=1)k0=m0==="start"===(q0&&D1.isRTL?.(x0)===!0)?"100%":"0%";else{let l0=q0?r0.arrow?.x||0:r0.arrow?.y||0,L1=q0?h0?.clientWidth||0:h0?.clientHeight||0;k0=`${l0+L1/2}px`}let i0=e1==="top"||e1==="left"?`calc(100% + ${U1}px)`:`${-U1}px`;if(s&&q0&&Math.abs(r0.shift?.y||0)>U1)i0=`${V1.reference.y+V1.reference.height/2-p1}px`;return x0.style.setProperty(VE,q0?`${k0} ${i0}`:`${i0} ${k0}`),{}}},NE,j),H0(()=>{if(!D&&N)N.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[D,N]);let $0=Q8.useMemo(()=>({ancestorScroll:!F,elementResize:!F&&typeof ResizeObserver<"u",layoutShift:!F&&typeof IntersectionObserver<"u"}),[F]),{refs:Q0,elements:_0,x:M0,y:A0,middlewareData:L0,update:f,placement:u,context:t,isPositioned:W0,floatingStyles:S0}=Z({rootContext:N,open:q?D:void 0,placement:r,middleware:D0,strategy:H,whileElementsMounted:q?void 0:(...C0)=>VB(...C0,$0),nodeId:L,externalTree:_}),{sideX:p0,sideY:g0}=L0.adaptiveOrigin||vZ,T0=W0?H:"fixed",d0=Q8.useMemo(()=>{let C0;if(!W0)C0={position:T0,top:0,left:0};else if(j)C0={position:T0,[p0]:M0,[g0]:A0};else C0={...S0,position:T0};if(C0[_E]="100vw",C0[jE]="100vh",!W0)C0.opacity=0;return C0},[j,T0,p0,M0,g0,A0,S0,W0]),Q1=Q8.useRef(null);H0(()=>{if(!D)return;let C0=x.current,x0=typeof C0==="function"?C0():C0,n0=(TE(x0)?x0.current:x0)||null||null;if(n0!==Q1.current)Q0.setPositionReference(n0),Q1.current=n0},[D,Q0,I,x]),Q8.useEffect(()=>{if(!D)return;let C0=x.current;if(typeof C0==="function")return;if(TE(C0)&&C0.current!==Q1.current)Q0.setPositionReference(C0.current),Q1.current=C0.current},[D,Q0,I,x]),Q8.useEffect(()=>{if(q&&D&&_0.reference&&_0.floating)return VB(_0.reference,_0.floating,f,$0);return},[q,D,_0,f,$0]);let e0=e2(u),c0=CE(B,e0,E),y0=_8(u)||"center",E1=Boolean(L0.hide?.referenceHidden);H0(()=>{if(M&&D&&W0&&e0!==l)T(e0)},[M,D,W0,e0,l]);let W1=Q8.useMemo(()=>({position:"absolute",top:L0.arrow?.y,left:L0.arrow?.x}),[L0.arrow]),Q5=L0.arrow?.centerOffset!==0;return Q8.useMemo(()=>({positionerStyles:d0,arrowStyles:W1,arrowRef:J0,arrowUncentered:Q5,side:c0,align:y0,physicalSide:e0,anchorHidden:E1,refs:Q0,context:t,isPositioned:W0,update:f}),[d0,W1,J0,Q5,c0,y0,e0,E1,Q0,t,W0,f])}function TE($){return $!=null&&"current"in $}var DG=P(m(),1),pA=DG.createContext(void 0);function EE(){let $=DG.useContext(pA);if($===void 0)throw Error(I0(84));return $}function g9($){return $==="starting"?bT:M1}function f9($,Z,{styles:J,transitionStatus:H,props:B,refs:Q,hidden:X,inert:z=!1}){let G={...J};if(z)G.pointerEvents="none";return G0("div",$,{state:Z,ref:Q,props:[{role:"presentation",hidden:X,style:G},g9(H),B],stateAttributesMapping:J8})}var bE=P(c(),1),wE=VG.forwardRef(function(Z,J){let{toast:H,...B}=Z,Q=M9(),X=H.positionerProps??M1,{render:z,className:G,anchor:U=X.anchor,positionMethod:Y=X.positionMethod??"absolute",side:K=X.side??"top",align:F=X.align??"center",sideOffset:W=X.sideOffset??0,alignOffset:q=X.alignOffset??0,collisionBoundary:N=X.collisionBoundary??"clipping-ancestors",collisionPadding:D=X.collisionPadding??5,arrowPadding:A=X.arrowPadding??5,sticky:V=X.sticky??!1,disableAnchorTracking:L=X.disableAnchorTracking??!1,collisionAvoidance:j=X.collisionAvoidance??C9,style:M,..._}=B,[w,T]=VG.useState(null),b=Q.useState("toastIndex",H.id),C=Q.useState("toastVisibleIndex",H.id),k=s0(U)?U:null,S=jA({open:!0,onOpenChange:z1,elements:{floating:w,reference:k}}),R=v9({anchor:k,positionMethod:Y,floatingRootContext:S,mounted:!0,side:K,sideOffset:W,align:F,alignOffset:q,collisionBoundary:N,collisionPadding:D,sticky:V,arrowPadding:A,disableAnchorTracking:L,keepMounted:!0,collisionAvoidance:j}),O={side:R.side,align:R.align,anchorHidden:R.anchorHidden},y=f9(Z,O,{styles:{...R.positionerStyles,[fz]:H.transitionStatus==="ending"?b:C},transitionStatus:H.transitionStatus,props:_,refs:[J,T]});return bE.jsx(pA.Provider,{value:R,children:y})});var SE=P(m(),1);var RE=SE.forwardRef(function(Z,J){let{className:H,render:B,style:Q,...X}=Z,{arrowRef:z,side:G,align:U,arrowUncentered:Y,arrowStyles:K}=EE();return G0("div",Z,{state:{side:G,align:U,uncentered:Y},ref:[J,z],props:[{style:K,"aria-hidden":!0},X]})});var kE=P(m(),1);function IE(){let $=M9(),Z=$.useState("toasts");return kE.useMemo(()=>({toasts:Z,add:$.addToast,close:$.closeToast,update:$.updateToast,promise:$.promiseToast}),[Z,$])}function yE(){let $=new Set;function Z(J){$.forEach((H)=>H(J))}return{" subscribe":function(H){return $.add(H),()=>{$.delete(H)}},add(J){let H=J.id||Vz("toast"),B={...J,id:H,transitionStatus:"starting"};return Z({action:"add",options:B}),H},close(J){Z({action:"close",options:{id:J}})},update(J,H){Z({action:"update",options:{id:J,updates:H}})},promise(J,H){let B=J;return Z({action:"promise",options:{...H,promise:J,setPromise(Q){B=Q}}}),B}}}var Z5=P(c(),1),r1=H4.createToastManager();function H10({...$}){return Z5.jsx(H4.Provider,{...$})}function B10({...$}){return Z5.jsx(H4.Portal,{"data-slot":"toast-portal",...$})}function Q10({className:$,...Z}){return Z5.jsx(H4.Viewport,{"data-slot":"toast-viewport",className:X0("pointer-events-none fixed inset-x-4 bottom-4 z-50 mx-auto w-auto max-w-sm outline-none sm:right-4 sm:left-auto sm:mx-0 sm:w-full",$),...Z})}function X10({className:$,...Z}){return Z5.jsx(H4.Root,{"data-slot":"toast",className:X0("group/toast pointer-events-auto absolute right-0 bottom-0 z-[calc(1000-var(--toast-index))] w-full origin-bottom rounded-xl bg-popover text-popover-foreground shadow-lg will-change-transform outline-none select-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","[--gap:0.75rem] [--height:var(--toast-frontmost-height,var(--toast-height))] [--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))] [--peek:0.75rem] [--scale:calc(max(0,1-(var(--toast-index)*0.1)))] [--shrink:calc(1-var(--scale))]","h-(--height) [transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--peek))-(var(--shrink)*var(--height))))_scale(var(--scale))] [transition:transform_500ms_cubic-bezier(0.22,1,0.36,1),opacity_500ms,height_150ms]","after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']","data-expanded:h-(--toast-height) data-expanded:[transform:translateX(var(--toast-swipe-movement-x))_translateY(var(--offset-y))]","data-limited:opacity-0 data-starting-style:[transform:translateY(150%)]","[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[transform:translateY(150%)]","data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]","data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]","data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]","data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]","data-expanded:data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]","data-expanded:data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]","data-expanded:data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]","data-expanded:data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]",$),...Z})}function z10({className:$,...Z}){return Z5.jsx(H4.Content,{"data-slot":"toast-content",className:X0("flex items-center gap-3 overflow-hidden p-4 transition-opacity duration-250 ease-[cubic-bezier(0.22,1,0.36,1)] data-behind:opacity-0 data-expanded:opacity-100",$),...Z})}function G10({className:$,...Z}){return Z5.jsx(H4.Title,{"data-slot":"toast-title",className:X0("text-sm font-medium",$),...Z})}function U10({className:$,...Z}){return Z5.jsx(H4.Description,{"data-slot":"toast-description",className:X0("text-sm text-muted-foreground",$),...Z})}function Y10({className:$,render:Z=Z5.jsx(P0,{variant:"outline",size:"sm"}),...J}){return Z5.jsx(H4.Action,{"data-slot":"toast-action",render:Z,className:X0("shrink-0",$),...J})}function K10({className:$,children:Z,render:J=Z5.jsx(P0,{variant:"ghost",size:"icon-sm"}),...H}){return Z5.jsx(H4.Close,{"data-slot":"toast-close","aria-label":"Close toast",render:J,className:X0("relative shrink-0 text-muted-foreground after:absolute after:-inset-2 after:content-[''] hover:text-foreground",$),...H,children:Z??Z5.jsx(n5,{"aria-hidden":"true",stroke:1.75})})}function F10({type:$}){let Z=null;if($==="success")Z=Z5.jsx(hE,{"aria-hidden":"true",stroke:1.75});if($==="info")Z=Z5.jsx(vE,{"aria-hidden":"true",stroke:1.75});if($==="warning")Z=Z5.jsx(LG,{"aria-hidden":"true",stroke:1.75});if($==="error")Z=Z5.jsx(xE,{className:"text-destructive","aria-hidden":"true",stroke:1.75});if($==="loading")Z=Z5.jsx(gE,{className:"animate-spin","aria-hidden":"true",stroke:1.75});if(!Z)return null;return Z5.jsx("span",{"data-slot":"toast-icon",className:"shrink-0 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",children:Z})}function W10(){let{toasts:$}=H4.useToastManager();return $.map((Z)=>Z5.jsx(X10,{toast:Z,children:Z5.jsxs(z10,{children:[Z5.jsx(F10,{type:Z.type}),Z5.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[Z5.jsx(G10,{}),Z5.jsx(U10,{})]}),Z5.jsx(Y10,{}),Z5.jsx(K10,{})]})},Z.id))}function fE({children:$,toastManager:Z=r1,...J}){return Z5.jsxs(H10,{toastManager:Z,...J,children:[$,Z5.jsx(B10,{children:Z5.jsx(Q10,{children:Z5.jsx(W10,{})})})]})}var _C0=H4.createToastManager,jC0=H4.useToastManager;var b3={};b5(b3,{createHandle:()=>Lb,Viewport:()=>Vb,Trigger:()=>nE,Root:()=>lE,Provider:()=>zb,Positioner:()=>Zb,Portal:()=>eE,Popup:()=>Hb,Handle:()=>bG,Arrow:()=>Qb});var gZ=P(m(),1);var MG=P(m(),1),cA=MG.createContext(void 0);function b8($){let Z=MG.useContext(cA);if(Z===void 0&&!$)throw Error(I0(72));return Z}var mE=P(m(),1);class $9 extends h2{setState($){}update($){}set($,Z){}notifyAll(){}}var uE={...y9,disabled:($)=>$.disabled,instantType:($)=>$.instantType,isInstantPhase:($)=>$.isInstantPhase,trackCursorAxis:($)=>$.trackCursorAxis,disableHoverablePopup:($)=>$.disableHoverablePopup,lastOpenChangeReason:($)=>$.openChangeReason,closeOnClick:($)=>$.closeOnClick,closeDelay:($)=>$.closeDelay,adaptiveOrigin:($)=>$.adaptiveOrigin};class dA extends h2{constructor($,Z,J){let H=new E2;super(cE($,H,Z,J),dE(H),uE)}setOpen=($,Z)=>{$G(this,$,Z,{extraState:{openChangeReason:Z.reason}})};cancelPendingOpen($){this.state.floatingRootContext.dispatchOpenChange(!1,w0(K0.triggerPress,$))}}function pE(){let $=new E2,Z=new $9(Object.freeze(cE(void 0,$)),Object.freeze(dE($)),uE);return Object.assign(Z,{setOpen:z1,cancelPendingOpen:z1})}function cE($,Z,J,H=!1){return{...I9(Z,J,H),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...$}}function dE($){return{popupRef:mE.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:$}}var LB=P(c(),1),lE=d8(function(Z){let{disabled:J=!1,defaultOpen:H=!1,open:B,disableHoverablePopup:Q=!1,trackCursorAxis:X="none",actionsRef:z,onOpenChange:G,onOpenChangeComplete:U,handle:Y,triggerId:K,defaultTriggerId:F=null,children:W}=Z,q=K6((k,S)=>new dA({open:H,openProp:B,activeTriggerId:F,triggerIdProp:K},k,S));q.useControlledProp("openProp",B),q.useControlledProp("triggerIdProp",K),q.useContextCallback("onOpenChange",G),q.useContextCallback("onOpenChangeComplete",U);let N=q.useState("open"),D=!J&&N,A=q.useState("activeTriggerId"),V=q.useState("mounted"),L=q.useState("payload");q.useSyncedValues({trackCursorAxis:X,disableHoverablePopup:Q,disabled:J}),S9(q,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:j,transitionStatus:M}=R9(D,q),_=q.useState("isInstantPhase"),w=q.useState("instantType"),T=q.useState("lastOpenChangeReason"),b=gZ.useRef(null);H0(()=>{if(N&&J)q.setOpen(!1,w0(K0.disabled))},[N,J,q]),H0(()=>{if(M==="ending"&&T===K0.none||M!=="ending"&&_){if(w!=="delay")b.current=w;q.set("instantType","delay")}else if(b.current!==null)q.set("instantType",b.current),b.current=null},[M,_,T,w,q]),H0(()=>{if(D){if(A==null)q.set("payload",void 0)}},[q,A,D]),gZ.useImperativeHandle(z,()=>({unmount:j,close:()=>q.setOpen(!1,w0(K0.imperativeAction))}),[j,q]);let C=D||V||!J&&X!=="none";return LB.jsxs(cA.Provider,{value:q,children:[Y&&LB.jsx(b9,{handle:Y,store:q}),C&&LB.jsx(q10,{store:q,disabled:J,trackCursorAxis:X}),typeof W==="function"?W({payload:L}):W]})});function q10({store:$,disabled:Z,trackCursorAxis:J}){let H=$.useState("floatingRootContext"),B=n8(H,{enabled:!Z,referencePress:()=>$.select("closeOnClick")}),Q=AA(H,{enabled:!Z&&J!=="none",axis:J==="none"?void 0:J}),X=gZ.useMemo(()=>X2(Q.reference,B.reference),[Q.reference,B.reference]);return k9($,{activeTriggerProps:X,inactiveTriggerProps:X,popupProps:B.floating??M1}),null}var _G=P(m(),1);function t0($){return _4($,"base-ui")}var PG=P(m(),1),lA=PG.createContext(void 0);function iE(){return PG.useContext(lA)}var rE=600;var oE="data-base-ui-tooltip-trigger";function aE($){if("composedPath"in $){let J=$.composedPath();for(let H=0;H<J.length;H+=1){let B=J[H];if(s0(B))return B}}let Z=$.target;if(s0(Z))return Z;return null}function N10($){let Z=$;while(Z){let J=Z.closest(`[${oE}]`);if(J)return J;let H=Z.getRootNode();Z="host"in H&&s0(H.host)?H.host:null}return null}var nE=P9(function(Z,J){let{render:H,className:B,style:Q,handle:X,payload:z,disabled:G,delay:U,closeOnClick:Y=!0,closeDelay:K,id:F,...W}=Z,q=b8(!0),D=x9(X)??q;if(!D)throw Error(I0(82));let A=t0(F),V=D.useState("isTriggerActive",A),L=D.useState("isOpenedByTrigger",A),j=D.useState("floatingRootContext"),M=_G.useRef(null),_=K??0,{registerTrigger:w,isMountedByThisTrigger:T}=w9(A,M,D,{payload:z,closeOnClick:Y,closeDelay:_}),b=iE(),{activeIdRef:C,delayRef:k,isInstantPhase:S,hasProvider:R}=UA(j,{open:L}),O=yZ(j);D.useSyncedValue("isInstantPhase",S);let y=D.useState("disabled"),I=G??y,x=F5(I),v=D.useState("trackCursorAxis"),g=D.useState("disableHoverablePopup"),E=_G.useRef(!1),l=i1(),r=_G.useRef(void 0);function h(){if(R&&C.current!=null)return 0;return U??b??rE}function d(B0){let N0=M.current;if(!N0||!B0)return!1;let D0=N10(B0);return D0!==null&&D0!==N0&&R0(N0,D0)}function o(B0){let N0=d(B0);if(E.current=N0,N0)O.openChangeTimeout.clear(),O.restTimeout.clear(),O.restTimeoutPending=!1,l.clear();return N0}let p=t8(j,{enabled:!I,mouseOnly:!0,move:!1,handleClose:!g&&v!=="both"?e8():null,restMs:h,delay(){if(K==null&&R)return{close:o8(k.current,"close")};return{close:_}},triggerElementRef:M,isActiveTrigger:V,isClosing:()=>D.select("transitionStatus")==="ending",shouldOpen(){return!E.current}}),i=z$(j,{enabled:!I}).reference,n=(B0)=>{let N0=E.current,D0=aE(B0),F0=o(D0),s=M.current,a=s&&D0&&R0(s,D0);if(F0&&D.select("open")&&D.select("lastOpenChangeReason")===K0.triggerHover){D.setOpen(!1,w0(K0.triggerHover,B0));return}if(N0&&!F0&&a&&!x.current&&!D.select("open")&&s&&H8(r.current)){let e=()=>{if(!E.current&&!x.current&&!D.select("open"))D.setOpen(!0,w0(K0.triggerHover,B0,s))},$0=h();if($0===0)l.clear(),e();else l.start($0,e)}},Z0=D.useState("triggerProps",T);return G0("button",Z,{state:{open:L},ref:[J,w,M],props:[p,i,T||v!=="none"?Z0:void 0,{onMouseOver(B0){n(B0.nativeEvent)},onFocus(B0){if(d(aE(B0.nativeEvent)))B0.preventBaseUIHandler()},onMouseLeave(){E.current=!1,l.clear(),r.current=void 0},onPointerEnter(B0){r.current=B0.pointerType},onPointerDown(B0){if(r.current=B0.pointerType,D.set("closeOnClick",Y),Y&&!D.select("open"))D.cancelPendingOpen(B0.nativeEvent)},onClick(B0){if(Y&&!D.select("open"))D.cancelPendingOpen(B0.nativeEvent)},id:A,[HB]:I?"":void 0,[oE]:I?void 0:""},W],stateAttributesMapping:_9})});var tE=P(m(),1);var jG=P(m(),1),iA=jG.createContext(void 0);function sE(){let $=jG.useContext(iA);if($===void 0)throw Error(I0(70));return $}var rA=P(c(),1),eE=tE.forwardRef(function(Z,J){let{keepMounted:H=!1,...B}=Z;if(!(b8().useState("mounted")||H))return null;return rA.jsx(iA.Provider,{value:H,children:rA.jsx(RZ,{ref:J,...B})})});var TG=P(m(),1);var OG=P(m(),1),aA=OG.createContext(void 0);function fZ(){let $=OG.useContext(aA);if($===void 0)throw Error(I0(71));return $}var $b=P(c(),1),Zb=TG.forwardRef(function(Z,J){let{render:H,className:B,anchor:Q,positionMethod:X="absolute",side:z="top",align:G="center",sideOffset:U=0,alignOffset:Y=0,collisionBoundary:K="clipping-ancestors",collisionPadding:F=5,arrowPadding:W=5,sticky:q=!1,disableAnchorTracking:N=!1,collisionAvoidance:D=C9,style:A,...V}=Z,L=b8(),j=sE(),M=L.useState("open"),_=L.useState("mounted"),w=L.useState("trackCursorAxis"),T=L.useState("disableHoverablePopup"),b=L.useState("floatingRootContext"),C=L.useState("instantType"),k=L.useState("transitionStatus"),S=L.useState("adaptiveOrigin"),R=v9({anchor:Q,positionMethod:X,floatingRootContext:b,mounted:_,side:z,sideOffset:U,align:G,alignOffset:Y,collisionBoundary:K,collisionPadding:F,sticky:q,arrowPadding:W,disableAnchorTracking:N,keepMounted:j,collisionAvoidance:D,adaptiveOrigin:S}),O=TG.useMemo(()=>({open:M,side:R.side,align:R.align,anchorHidden:R.anchorHidden,instant:w!=="none"?"tracking-cursor":C}),[M,R.side,R.align,R.anchorHidden,w,C]),y=f9(Z,O,{styles:R.positionerStyles,transitionStatus:k,props:V,refs:[J,L.useStateSetter("positionerElement")],hidden:!_,inert:!M||w==="both"||T});return $b.jsx(aA.Provider,{value:R,children:y})});var Jb=P(m(),1);var Hb=Jb.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=b8(),{side:G,align:U}=fZ(),Y=z.useState("open"),K=z.useState("instantType"),F=z.useState("transitionStatus"),W=z.useState("popupProps"),q=z.useState("floatingRootContext"),N=z.useState("disabled"),D=z.useState("closeDelay");A5({open:Y,ref:z.context.popupRef,onComplete(){if(Y)z.context.onOpenChangeComplete?.(!0)}}),C3(q,{enabled:!N,closeDelay:D});let A=z.useStateSetter("popupElement");return G0("div",Z,{state:{open:Y,side:G,align:U,instant:K,transitionStatus:F},ref:[J,z.context.popupRef,A],props:[E9,W,g9(F),X],stateAttributesMapping:t2})});var Bb=P(m(),1);var Qb=Bb.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=b8(),{arrowRef:G,side:U,align:Y,arrowUncentered:K,arrowStyles:F}=fZ(),W=z.useState("open"),q=z.useState("instantType");return G0("div",Z,{state:{open:W,side:U,align:Y,uncentered:K,instant:q},ref:[J,G],props:[{style:F,"aria-hidden":!0},X],stateAttributesMapping:J8})});var Xb=P(m(),1);var oA=P(c(),1),zb=function(Z){let{delay:J,closeDelay:H,timeout:B=400}=Z,Q=Xb.useMemo(()=>({open:J,close:H}),[J,H]);return oA.jsx(lA.Provider,{value:J,children:oA.jsx(GA,{delay:Q,timeoutMs:B,children:Z.children})})};var Db=P(m(),1);var u2=P(m(),1),Ab=P(B8(),1);var Gb=P(m(),1);function Ub($){let[Z,J]=Gb.useState({current:$,previous:null});if(!Object.is($,Z.current))J({current:$,previous:Z.current});return Z.previous}var uZ=P(m(),1);function mZ($){let Z=g2($),J=parseFloat(Z.width)||0,H=parseFloat(Z.height)||0,B=_1($),Q=B?$.offsetWidth:J,X=B?$.offsetHeight:H;if(X6(J)!==Q||X6(H)!==X)J=Q,H=X;return{width:J,height:H}}var MB="--popup-width",PB="--popup-height";function Fb($){let{popupElement:Z,positionerElement:J,content:H,mounted:B,onMeasureLayout:Q,onMeasureLayoutComplete:X,side:z,direction:G}=$,U=f4(Z,!0),Y=P4(),K=uZ.useRef(null),F=uZ.useRef(!0),W=uZ.useRef(z1),q=Y0(Q),N=Y0(X),D=uZ.useMemo(()=>A10(z,G),[z,G]);H0(()=>{if(!B){W.current=z1,F.current=!0,K.current=null;return}if(!Z||!J)return;W.current=Kb(Z,D),nA(Z,"auto");let A=EG(Z,"position","static"),V=EG(Z,"transform","none"),L=EG(Z,"scale","1"),j=Kb(J,{[NG]:"max-content",[AG]:"max-content"});function M(){A(),V(),j()}function _(){M(),L()}if(q?.(),F.current||K.current===null){CG(J,"max-content");let C=mZ(Z);return K.current=C,CG(J,C),_(),N?.(null,C),F.current=!1,()=>{W.current(),W.current=z1}}CG(J,"max-content");let w=K.current,T=mZ(Z);K.current=T,nA(Z,w),_(),N?.(w,T),CG(J,T);let b=new AbortController;return Y.request(()=>{nA(Z,T),U(()=>{Z.style.setProperty(MB,"auto"),Z.style.setProperty(PB,"auto")},b.signal)}),()=>{b.abort(),Y.cancel(),W.current(),W.current=z1}},[H,Z,J,U,Y,B,q,N,D])}function A10($,Z){let J=$==="top",H=$==="left"||$===(Z==="rtl"?"inline-end":"inline-start");if(!J&&!H)return M1;return{position:"absolute",[J?"bottom":"top"]:"0",[H?"right":"left"]:"0"}}function EG($,Z,J){let H=$.style.getPropertyValue(Z);return $.style.setProperty(Z,J),()=>{$.style.setProperty(Z,H)}}function Kb($,Z){let J=[];for(let[H,B]of Object.entries(Z))J.push(EG($,H,B));return J.length?()=>{J.forEach((H)=>H())}:z1}function nA($,Z){let J=Z==="auto"?"auto":`${Z.width}px`,H=Z==="auto"?"auto":`${Z.height}px`;$.style.setProperty(MB,J),$.style.setProperty(PB,H)}function CG($,Z){let J=Z==="max-content"?"max-content":`${Z.width}px`,H=Z==="max-content"?"max-content":`${Z.height}px`;$.style.setProperty(LE,J),$.style.setProperty(ME,H)}var Wb={name:"adaptiveOrigin",async fn($){let{x:Z,y:J,rects:{floating:H},elements:{floating:B},platform:Q,strategy:X,placement:z}=$,G=w1(B),U=G.getComputedStyle(B);if(!(U.transitionDuration!=="0s"&&U.transitionDuration!==""))return{x:Z,y:J,data:vZ};let K=await Q.getOffsetParent?.(B),F={width:0,height:0};if(X==="fixed"&&G?.visualViewport)F={width:G.visualViewport.width,height:G.visualViewport.height};else if(K===G){let V=f0(B);F={width:V.documentElement.clientWidth,height:V.documentElement.clientHeight}}else if(await Q.isElement?.(K))F=await Q.getDimensions(K);let W=e2(z),q=Z,N=J;if(W==="left")q=F.width-(Z+H.width);if(W==="top")N=F.height-(J+H.height);let D=W==="left"?"right":vZ.sideX,A=W==="top"?"bottom":vZ.sideY;return{x:q,y:N,data:{sideX:D,sideY:A}}}};var qb="data-activation-direction";var pZ=P(c(),1),W6={activationDirection:($)=>$?{[qb]:$}:null};function q6($){let{store:Z,side:J,children:H}=$,B=u4(),Q=Z.useState("activeTriggerElement"),X=Z.useState("activeTriggerId"),z=Z.useState("open"),G=Z.useState("payload"),U=Z.useState("mounted"),Y=Z.useState("popupElement"),K=Z.useState("positionerElement"),F=Ub(z?Q:null),W=M10(X,G),q=u2.useRef(null),[N,D]=u2.useState(null),[A,V]=u2.useState(null),L=u2.useRef(null),j=u2.useRef(null),M=f4(L,!0),_=P4(),w=u2.useRef(null),[T,b]=u2.useState(null),[C,k]=u2.useState(!1);H0(()=>{return Z.set("adaptiveOrigin",Wb),()=>{Z.set("adaptiveOrigin",void 0)}},[Z]);let S=Y0(()=>{L.current?.style.setProperty("animation","none"),L.current?.style.setProperty("transition","none"),j.current?.style.setProperty("display","none")}),R=Y0((g)=>{if(L.current?.style.removeProperty("animation"),L.current?.style.removeProperty("transition"),j.current?.style.removeProperty("display"),g)b(g)}),O=Y0(()=>{w.current?.abort();let g=new AbortController;w.current=g,M(()=>{D(null),b(null),q.current=null},g.signal)}),y=u2.useRef(null);H0(()=>{if(!z||!U)y.current=null},[z,U]),H0(()=>{if(Q&&F&&Q!==F&&y.current!==Q&&q.current){D(q.current),k(!0);let g=L10(F,Q);V(g),y.current=Q}},[Q,F]),H0(()=>{if(N==null)return;w.current?.abort(),k(!0),_.request(()=>{Ab.flushSync(()=>{k(!1)}),O()})},[W,N,O,_]),H0(()=>{let g=L.current;if(!g)return;let E=f0(g).createElement("div");for(let l of Array.from(g.childNodes))E.appendChild(l.cloneNode(!0));q.current=E});let I=N!=null,x;if(!I)x=pZ.jsx("div",{"data-current":!0,ref:L,children:H},W);else x=pZ.jsxs(u2.Fragment,{children:[pZ.jsx("div",{"data-previous":!0,inert:T8(!0),ref:j,style:{...T?{[MB]:`${T.width}px`,[PB]:`${T.height}px`}:null,position:"absolute"},"data-ending-style":C?void 0:""},"previous"),pZ.jsx("div",{"data-current":!0,ref:L,"data-starting-style":C?"":void 0,children:H},W)]});H0(()=>{let g=j.current;if(!g||!N)return;g.replaceChildren(...Array.from(N.childNodes))},[N]),Fb({popupElement:Y,positionerElement:K,mounted:U,content:G,onMeasureLayout:S,onMeasureLayoutComplete:R,side:J,direction:B});let v={activationDirection:V10(A),transitioning:I};return{children:x,state:v}}function V10($){if(!$)return;return`${Nb($.horizontal,5,"right","left")} ${Nb($.vertical,5,"down","up")}`}function Nb($,Z,J,H){if($>Z)return J;if($<-Z)return H;return""}function L10($,Z){let J=$.getBoundingClientRect(),H=Z.getBoundingClientRect(),B={x:J.left+J.width/2,y:J.top+J.height/2},Q={x:H.left+H.width/2,y:H.top+H.height/2};return{horizontal:Q.x-B.x,vertical:Q.y-B.y}}function M10($,Z){let[J,H]=u2.useState(0),B=u2.useRef($),Q=u2.useRef(Z),X=u2.useRef(!1);return H0(()=>{let z=B.current,G=Q.current,U=$!==z,Y=Z!==G;if(U)H((K)=>K+1),X.current=!Y;else if(X.current&&Y)H((K)=>K+1),X.current=!1;B.current=$,Q.current=Z},[$,Z]),`${$??"current"}-${J}`}var Vb=Db.forwardRef(function(Z,J){let{render:H,className:B,style:Q,children:X,...z}=Z,G=b8(),U=fZ(),Y=G.useState("instantType"),{children:K,state:F}=q6({store:G,side:U.side,children:X}),W={activationDirection:F.activationDirection,transitioning:F.transitioning,instant:Y};return G0("div",Z,{state:W,ref:J,props:[z,{children:K}],stateAttributesMapping:W6})});class bG extends s8{constructor(){super(pE(),"Tooltip")}open($){this.openByTrigger($)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}function Lb(){return new bG}var wG=P(m(),1),N6=P(c(),1);function w8({portal:$,children:Z,...J}){let[H,B]=wG.useState(void 0),Q=wG.useCallback((X)=>{if(X)B(X.closest("[data-applet]")?.getAttribute("data-applet")??void 0)},[]);return N6.jsxs(N6.Fragment,{children:[N6.jsx("span",{hidden:!0,ref:Q}),N6.jsx($,{...J,children:N6.jsx("div",{"data-applet":H,className:"contents",children:Z})})]})}var Y$=P(c(),1);function SG({delay:$=100,...Z}){return Y$.jsx(b3.Provider,{"data-slot":"tooltip-provider",delay:$,...Z})}function a1({...$}){return Y$.jsx(b3.Root,{"data-slot":"tooltip",...$})}function o1({...$}){return Y$.jsx(b3.Trigger,{"data-slot":"tooltip-trigger",...$})}function n1({className:$,side:Z="top",sideOffset:J=6,align:H="center",alignOffset:B=0,children:Q,...X}){return Y$.jsx(w8,{portal:b3.Portal,children:Y$.jsx(b3.Positioner,{align:H,alignOffset:B,side:Z,sideOffset:J,className:"isolate z-50",children:Y$.jsx(b3.Popup,{"data-slot":"tooltip-content",className:o0("z-50 flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-lg bg-popover px-2.5 py-1.5 text-xs font-medium text-popover-foreground shadow-md has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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",$),...X,children:Q})})})}function RG({cooldownMs:$,windowMs:Z,maxPerWindow:J,maxKeys:H=256,now:B=Date.now}){let Q=new Map,X=0,z=0;return{admit(G){let U=B(),Y=Q.get(G);if(Y!==void 0&&U-Y<$)return"cooldown";if(U-X>=Z)X=U,z=0;if(z>=J)return"window";if(z++,Q.set(G,U),Q.size>H)for(let K of[...Q.keys()].slice(0,Math.ceil(H/2)))Q.delete(K);return"ok"}}}var P10=RG({cooldownMs:5000,windowMs:60000,maxPerWindow:30});function X8($,Z){let J=[$,Z.source,Z.kind,Z.name,Z.message].join("\x00");if(P10.admit(J)!=="ok")return;fetch(`/api/workspaces/${$}/applet-log`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({events:[Z]})}).catch(()=>{})}var _10=/\/api\/workspaces\/([^/\s)]+)\/(widgets|views)\/([^/\s)]+)\//;function Mb($){if(!$)return null;let Z=_10.exec($);if(!Z)return null;return{workspaceId:Z[1],kind:Z[2]==="widgets"?"widget":"view",name:Z[3]}}var Pb=!1;function _b(){if(Pb)return;Pb=!0;let $=(Z,J,H)=>{let B=J instanceof Error?J:null,Q=B?.stack??"",X=Z??Mb(Q);if(!X)return;X8(X.workspaceId,{source:"window",kind:X.kind,name:X.name,message:B?.message||H||String(J),...Q?{stack:Q}:{}})};window.addEventListener("error",(Z)=>$(Mb(Z.filename),Z.error,Z.message)),window.addEventListener("unhandledrejection",(Z)=>$(null,Z.reason))}function cZ($,Z){return`${$}:${Z}`}function _B($){return $==="running"}function Tb($){return Object.values($).some(_B)}function dZ($,Z,J){return _B($[cZ(Z,J)])}function IG($,Z){let J=`${Z}:`;return Object.entries($).some(([H,B])=>H.startsWith(J)&&_B(B))}function z8($,Z){return cZ($,Z??"new")}function kG($,Z,J){for(let[H,B]of Object.entries($)){if(!H.startsWith(`${Z}:`))continue;let Q=B.find((X)=>X.localId===J);if(Q)return{key:H,attachment:Q}}}var k1=jb()(($)=>({activity:{},errors:{},previews:{},attachments:{},setActivity:(Z,J,H)=>$((B)=>({activity:{...B.activity,[cZ(Z,J)]:H}})),reconcileActivity:(Z)=>$(()=>({activity:Object.fromEntries(Z.map((J)=>[cZ(J.workspaceId,J.sessionId),J.activity]))})),setError:(Z,J,H)=>$((B)=>({errors:{...B.errors,[cZ(Z,J)]:H}})),setPreview:(Z)=>$((J)=>({previews:{...J.previews,[Z.messageId]:{workspaceId:Z.workspaceId,sessionId:Z.sessionId,parentToolUseId:Z.parentToolUseId,blocks:Z.blocks,updatedAt:Date.now()}}})),clearPreview:(Z)=>$((J)=>{if(!(Z in J.previews))return J;let{[Z]:H,...B}=J.previews;return{previews:B}}),clearPreviewsForSession:(Z,J)=>$((H)=>{let B={},Q=!1;for(let[X,z]of Object.entries(H.previews))if(z.workspaceId===Z&&z.sessionId===J)Q=!0;else B[X]=z;return Q?{previews:B}:H}),clearAllPreviews:()=>$((Z)=>Object.keys(Z.previews).length?{previews:{}}:Z),sweepPreviews:(Z,J)=>$((H)=>{let B={},Q=!1;for(let[X,z]of Object.entries(H.previews))if(J-z.updatedAt>Z)Q=!0;else B[X]=z;return Q?{previews:B}:H}),addAttachments:(Z,J,H)=>$((B)=>{let Q=z8(Z,J);return{attachments:{...B.attachments,[Q]:[...B.attachments[Q]??[],...H]}}}),updateAttachment:(Z,J,H)=>$((B)=>{let Q=kG(B.attachments,Z,J);if(!Q)return{};let{key:X,attachment:z}=Q,G=B.attachments[X];if(z.kind!=="text"&&z.previewUrl&&"previewUrl"in H&&H.previewUrl!==z.previewUrl)URL.revokeObjectURL(z.previewUrl);return{attachments:{...B.attachments,[X]:G.map((U)=>U.localId===J&&U.kind!=="text"?{...U,...H}:U)}}}),removeAttachment:(Z,J)=>$((H)=>{let B=kG(H.attachments,Z,J);if(!B)return{};let{key:Q,attachment:X}=B,z=H.attachments[Q];if(X.kind!=="text"&&X.previewUrl)URL.revokeObjectURL(X.previewUrl);return{attachments:{...H.attachments,[Q]:z.filter((G)=>G.localId!==J)}}}),clearAttachments:(Z,J)=>$((H)=>{let B=z8(Z,J);for(let X of H.attachments[B]??[])if(X.kind!=="text"&&X.previewUrl)URL.revokeObjectURL(X.previewUrl);let Q={...H.attachments};return delete Q[B],{attachments:Q}}),renameSession:(Z,J,H)=>$((B)=>{let Q=z8(Z,J),X=cZ(Z,H);if(Q===X)return B;if(!(Q in B.activity)&&!(Q in B.errors)&&!(Q in B.attachments)&&!Object.values(B.previews).some((F)=>F.workspaceId===Z&&F.sessionId===J))return B;let z={...B.activity},G={...B.errors};if(Q in z)z[X]=z[Q],delete z[Q];if(Q in G)G[X]=G[Q],delete G[Q];let U=B.previews,Y=!1;for(let[F,W]of Object.entries(B.previews))if(W.workspaceId===Z&&W.sessionId===J){if(!Y)U={...B.previews},Y=!0;U[F]={...W,sessionId:H}}let K=B.attachments;if(Q!==X&&K[Q])K={...K,[X]:[...K[X]??[],...K[Q]]},delete K[Q];return{activity:z,errors:G,previews:U,attachments:K}})}));function Cb($,Z,J){if(!J)return{root:null,byParent:{}};let H=null,B={};for(let Q of Object.values($)){if(Q.workspaceId!==Z||Q.sessionId!==J)continue;if(Q.parentToolUseId===null){if(!H||Q.updatedAt>H.updatedAt)H=Q}else{let X=B[Q.parentToolUseId];if(!X||Q.updatedAt>X.updatedAt)B[Q.parentToolUseId]=Q}}return{root:H,byParent:B}}function B4($){return Ob(k1,$)}var j0={all:["workspaces"],discover:["workspaces","discover"],setupInfo:["workspaces","setup-info"],preview:($)=>["workspaces","preview",$],layout:($)=>["workspaces","layout",$],widgets:($)=>["workspaces","widgets",$],appletThumbnails:($)=>["workspaces","applet-thumbnails",$],views:($)=>["workspaces","views",$],sessions:($)=>["workspaces","sessions",$],events:($,Z)=>["workspaces","events",$,Z],session:($,Z)=>["workspaces","session",$,Z],mcp:($)=>["workspaces","mcp",$],agent:($)=>["workspaces","agent",$],skills:($)=>["workspaces","skills",$],env:($)=>["workspaces","env",$]};function jB(){return{turns:[],notices:[]}}function yG($,Z){switch(Z.kind){case"snapshot":return{...$,snapshot:Z.snapshot};case"turn":{let J=$.turns.findIndex((B)=>B.id===Z.turn.id);if(J>=0)return{...$,turns:$.turns.map((B,Q)=>Q===J?Z.turn:B)};if(Z.turn.seq===void 0)return{...$,turns:[...$.turns,Z.turn]};let H=$.turns.findIndex((B)=>B.seq!==void 0&&B.seq>Z.turn.seq);if(H<0)return{...$,turns:[...$.turns,Z.turn]};return{...$,turns:[...$.turns.slice(0,H),Z.turn,...$.turns.slice(H)]}}case"notice":{if($.notices.some((J)=>J.id===Z.notice.id))return{...$,notices:$.notices.map((J)=>J.id===Z.notice.id?Z.notice:J)};return{...$,notices:[...$.notices,Z.notice]}}case"result":return{...$,result:Z.result}}}function Eb($){let Z=jB(),J=new Map,H=new Map,B=-1/0;for(let Q of $)switch(Q.kind){case"snapshot":Z.snapshot=Q.snapshot;break;case"turn":{let X=Q.turn,z=X.seq,G=J.get(X.id);if(G!==void 0)Z.turns[G]=X;else{let U=z!==void 0&&z<B?Z.turns.findIndex((Y)=>Y.seq!==void 0&&Y.seq>z):-1;if(U<0)J.set(X.id,Z.turns.length),Z.turns.push(X);else{Z.turns.splice(U,0,X);for(let Y=U;Y<Z.turns.length;Y++)J.set(Z.turns[Y].id,Y)}}if(z!==void 0)B=Math.max(B,z);break}case"notice":H.set(Q.notice.id,Q.notice);break;case"result":Z.result=Q.result;break}return Z.notices=[...H.values()],Z}var sA=new WeakMap;function bb($,Z,J,H){for(let B of sA.get($)??[])if(B.workspaceId===Z&&B.sessionId===J)B.events.push(H)}function wb($,Z){return MN({queryKey:j0.events($,Z),queryFn:async({client:J,signal:H})=>{let B=sA.get(J)??new Set;sA.set(J,B);let Q={workspaceId:$,sessionId:Z,events:[]};B.add(Q);try{let X=await G1(`/api/workspaces/${$}/sessions/${Z}/events`,{signal:H},"Couldn’t load chat");return Eb([...X,...Q.events])}finally{B.delete(Q)}},staleTime:1/0,gcTime:300000})}var p4=P(m(),1);function m9($){return $==="overview"||$==="scratchpad"||typeof $==="string"&&/^views\/[a-zA-Z0-9_-]+$/.test($)}function K$($){try{let Z=decodeURIComponent($);return m9(Z)?Z:void 0}catch{return}}var w5=($)=>`views/${$}`,lZ=($)=>$.startsWith("views/")?$.slice(6):void 0;function u9($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var A6={status:"disconnected",connectionId:null,connections:[],users:[],error:null},j10=[],Sb=($,Z)=>JSON.stringify([$,Z]);class tA{state=A6;usersState=A6;channels=new Map;listeners=new Set;registrations=new Map;location=null;send=()=>{};getSnapshot=()=>this.state;getUsersSnapshot=()=>this.usersState;getPresenceSnapshot=($,Z)=>this.channels.get(Sb($,Z))??j10;subscribe=($)=>{return this.listeners.add($),()=>{this.listeners.delete($)}};setSender($){this.send=$}connecting(){this.publish({status:"connecting",error:null})}disconnect($){this.publish({...A6,error:$??null})}setLocation($){if(JSON.stringify(this.location)===JSON.stringify($))return;if(this.location=$,this.publish({},!0),this.state.status==="connected")this.send({type:"location",location:$})}getLocation(){return this.location}setPresence($){let Z=this.registrations.get($.registrationId);if(Z&&JSON.stringify(Z)===JSON.stringify($))return;if(this.registrations.set($.registrationId,$),this.state.status==="connected")this.send({type:"presence:set",...$})}deletePresence($){if(this.registrations.delete($),this.state.status==="connected")this.send({type:"presence:delete",registrationId:$})}receive($){switch($.type){case"welcome":this.publish({status:"connected",connectionId:$.connectionId,connections:$.connections,users:$.users,error:null});for(let Z of this.registrations.values())this.send({type:"presence:set",...Z});break;case"connections":this.publish({connections:$.connections,users:$.users});break;case"error":this.publish({error:$.message});break;case"pong":break}}publish($,Z=!1){this.state={...this.state,...$};let J={...this.state,connections:this.state.connections.map((B)=>({...B,presence:[]}))};if(Z||JSON.stringify(J)!==JSON.stringify(this.usersState))this.usersState=J;let H=new Map;if(this.location?.status==="active")for(let B of this.state.connections){if(B.connectionId===this.state.connectionId||B.location?.page!==this.location.page||B.location.status!=="active")continue;for(let Q of B.presence){let X=Sb(Q.appletId,Q.channel),z=H.get(X)??[];z.push({registrationId:Q.registrationId,connectionId:B.connectionId,userId:B.userId,value:Q.value}),H.set(X,z)}}this.channels=new Map([...H].map(([B,Q])=>{let X=this.channels.get(B);return[B,X&&JSON.stringify(X)===JSON.stringify(Q)?X:Q]})),this.listeners.forEach((B)=>B())}}var F$=()=>{},kb=[],Ib={workspaceId:"",enabled:!1,start:()=>F$,getSnapshot:()=>A6,getUsersSnapshot:()=>A6,getPresenceSnapshot:()=>kb,subscribe:()=>F$,getCurrentUser:w3,subscribeCurrentUser:xG,getDirectory:eA,subscribeDirectory:$D,getLocation:()=>null,setLocation:F$,setPresence:F$,deletePresence:F$};class ZD{workspaceId;enabled;store=new tA;socket=null;retry;heartbeat;unsubscribeCurrentUser;presenceTimer;queuedPresence=new Map;stopped=!0;attempts=0;lastMessageAt=0;userId=w3()?.id;constructor($,Z=!0){this.workspaceId=$;this.enabled=Z;this.store.setSender((J)=>this.send(J))}getSnapshot=()=>this.enabled?this.store.getSnapshot():A6;getUsersSnapshot=()=>this.enabled?this.store.getUsersSnapshot():A6;getPresenceSnapshot=($,Z)=>this.enabled?this.store.getPresenceSnapshot($,Z):kb;subscribe=($)=>this.enabled?this.store.subscribe($):F$;getCurrentUser=w3;subscribeCurrentUser=xG;getDirectory=eA;subscribeDirectory=$D;getLocation=()=>this.enabled?this.store.getLocation():null;setLocation=($)=>{this.store.setLocation($)};setPresence=($)=>{if(this.enabled)this.store.setPresence($)};deletePresence=($)=>{if(this.enabled)this.store.deletePresence($)};start(){if(!this.enabled)return F$;if(!this.stopped)return()=>{};return this.stopped=!1,this.userId=w3()?.id,this.unsubscribeCurrentUser=xG(()=>{let $=w3();if($?.id!==this.userId)if(this.userId=$?.id,this.store.disconnect(),clearTimeout(this.retry),this.socket)this.socket.close();else this.connect();else if($)this.send({type:"profile",profile:$})}),this.connect(),()=>this.stop()}wantsConnection(){return!this.stopped&&w3()!==void 0}connect(){if(!this.wantsConnection()){this.store.disconnect();return}if(this.socket)return;clearTimeout(this.retry),this.store.connecting();let $=new WebSocket(hG(`/api/workspaces/${encodeURIComponent(this.workspaceId)}/collab/ws`));this.socket=$,$.onopen=()=>{if($!==this.socket)return;this.lastMessageAt=Date.now();let Z=w3();if(!Z){$.close();return}this.heartbeat=setInterval(()=>{if(Date.now()-this.lastMessageAt>45000)$.close();else this.rawSend({type:"ping"})},15000),this.rawSend({type:"join",version:Rb,profile:Z,location:this.store.getLocation()})},$.onmessage=(Z)=>{if($!==this.socket)return;this.lastMessageAt=Date.now();try{let J=JSON.parse(String(Z.data));if(J.type==="welcome")this.attempts=0;let H=J.type==="error"&&this.store.getSnapshot().status!=="connected";if(this.store.receive(J),H)$.close()}catch{this.store.disconnect("The collaboration connection returned an invalid message."),$.close()}},$.onerror=()=>$.close(),$.onclose=()=>{if($!==this.socket)return;if(clearInterval(this.heartbeat),clearTimeout(this.presenceTimer),this.presenceTimer=void 0,this.queuedPresence.clear(),this.socket=null,this.store.disconnect(),this.wantsConnection()){let Z=Math.min(500*2**this.attempts++,1e4);this.retry=setTimeout(()=>this.connect(),Z)}}}send($){if(!w3()&&($.type==="location"||$.type==="presence:set"||$.type==="presence:delete"))return;if($.type==="presence:set"){if(this.queuedPresence.set($.registrationId,$),!this.presenceTimer)this.presenceTimer=setTimeout(()=>{this.presenceTimer=void 0;for(let Z of this.queuedPresence.values())this.rawSend(Z);this.queuedPresence.clear()},50);return}if($.type==="presence:delete")this.queuedPresence.delete($.registrationId);this.rawSend($)}rawSend($){if(this.socket?.readyState===WebSocket.OPEN)try{this.socket.send(JSON.stringify($))}catch{this.socket.close()}}stop(){this.stopped=!0,this.unsubscribeCurrentUser?.(),clearTimeout(this.retry),clearTimeout(this.presenceTimer),this.presenceTimer=void 0,clearInterval(this.heartbeat),this.queuedPresence.clear(),this.socket?.close(),this.socket=null,this.store.disconnect()}}var QD=P(c(),1),yb=p4.createContext(Ib),xb=p4.createContext(null);function JD($,Z,J=""){let H=`${J.replace(/\/$/,"")}/workspace/${encodeURIComponent(Z)}/`,B=$.startsWith(H)?$.slice(H.length):"";return K$(B)??(B||"overview")}function HD({workspaceId:$,enabled:Z,children:J}){let H=p4.useMemo(()=>new ZD($,Z),[$,Z]),B=_2(),Q=p7(B),{base:X}=B;return p4.useEffect(()=>H.start(),[H]),p4.useEffect(()=>{let z=()=>H.setLocation({page:JD(window.location.pathname,$,X),status:document.visibilityState==="hidden"?"away":"active"});return z(),document.addEventListener("visibilitychange",z),()=>document.removeEventListener("visibilitychange",z)},[X,H,Q,$]),QD.jsx(yb,{value:H,children:J})}function OB({appletId:$,active:Z=!0,children:J}){let{enabled:H}=D6(),B=p4.useMemo(()=>({active:H&&Z,appletId:$}),[H,Z,$]);return QD.jsx(xb,{value:B,children:J})}function D6(){return p4.useContext(yb)}function BD(){return p4.useContext(xb)}function p2(){let $=D6(),Z=p4.useSyncExternalStore($.subscribeCurrentUser,$.getCurrentUser,$.getCurrentUser);return $.enabled&&Z!==void 0}var zU=P(m(),1);var S3={};b5(S3,{createHandle:()=>Tw,Viewport:()=>Ow,Trigger:()=>ab,Title:()=>Vw,Root:()=>pb,Positioner:()=>Xw,Portal:()=>sb,Popup:()=>Fw,Handle:()=>oG,Description:()=>Mw,Close:()=>_w,Backdrop:()=>Aw,Arrow:()=>qw});var TB=P(m(),1);var vG=P(m(),1),XD=vG.createContext(void 0);function l5($){let Z=vG.useContext(XD);if(Z===void 0&&!$)throw Error(I0(47));return Z}var gG=P(m(),1),hb=P(B8(),1);var vb={...y9,disabled:($)=>$.disabled,instantType:($)=>$.instantType,openMethod:($)=>$.openMethod,openChangeReason:($)=>$.openChangeReason,modal:($)=>$.modal,focusManagerModal:($)=>$.focusManagerModal,stickIfOpen:($)=>$.stickIfOpen,titleElementId:($)=>$.titleElementId,descriptionElementId:($)=>$.descriptionElementId,openOnHover:($)=>$.openOnHover,closeDelay:($)=>$.closeDelay,adaptiveOrigin:($)=>$.adaptiveOrigin};class zD extends h2{constructor($,Z,J){let H=new E2;super(fb($,H,Z,J),mb(H),vb)}setOpen=($,Z)=>{let J=Z.reason===K0.triggerHover,H=Z.reason===K0.triggerPress&&Z.event.detail===0,B=!$&&(Z.reason===K0.escapeKey||Z.reason==null),Q=qB(Z),X=this.select("activeTriggerId");if(!$&&Z.reason===K0.closePress&&Z.trigger==null&&X!=null)Z.trigger=this.context.triggerElements.getById(X)??this.select("activeTriggerElement")??void 0;if(this.context.onOpenChange?.($,Z),Z.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange($,Z);let z=()=>{let U=X$(this.state,$,Z.trigger,Q());U.openChangeReason=Z.reason,this.update(U)};if(J)this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(xz,()=>{this.set("stickIfOpen",!1)}),hb.flushSync(z);else z();let G;if(H)G="click";else if(B)G="dismiss";else if(Z.reason===K0.focusOut)G="focus";this.set("instantType",G)}}function gb(){let $=new E2,Z=new $9(Object.freeze(fb(void 0,$)),Object.freeze(mb($)),vb);return Object.assign(Z,{setOpen:z1})}function fb($,Z,J,H=!1){let B={...I9(Z,J,H),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...$};if(B.open&&$?.mounted===void 0)B.mounted=!0;return B}function mb($){return{popupRef:gG.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:gG.createRef(),beforeContentFocusGuardRef:gG.createRef(),stickIfOpenTimeout:new d5,triggerElements:$}}var V6=P(c(),1),ub=d8(function({props:Z}){let{children:J,open:H,defaultOpen:B=!1,onOpenChange:Q,onOpenChangeComplete:X,modal:z=!1,handle:G,triggerId:U,defaultTriggerId:Y=null}=Z,K=O10(G,{modal:z,open:B,openProp:H,activeTriggerId:Y,triggerIdProp:U});K.useControlledProp("openProp",H),K.useControlledProp("triggerIdProp",U);let F=K.useState("open"),W=K.useState("mounted"),q=K.useState("payload");K.useContextCallback("onOpenChange",Q),K.useContextCallback("onOpenChangeComplete",X),ZG(K,F),S9(K);let{forceUnmount:N}=R9(F,K,()=>{K.update({stickIfOpen:!0,openChangeReason:null})});K.useSyncedValues({modal:z}),TB.useEffect(()=>{if(!F)K.context.stickIfOpenTimeout.clear()},[K,F]),TB.useImperativeHandle(Z.actionsRef,()=>({unmount:N,close:()=>K.setOpen(!1,w0(K0.imperativeAction))}),[N,K]);let D=F||W;return V6.jsxs(XD.Provider,{value:K,children:[G&&V6.jsx(b9,{handle:G,store:K}),D&&V6.jsx(T10,{store:K,modal:z}),typeof J==="function"?J({payload:q}):J]})});function pb($){if(l5(!0))return V6.jsx(ub,{props:$});return V6.jsx(H$,{children:V6.jsx(ub,{props:$})})}function O10($,Z){let J=K6((H,B)=>new zD(Z,H,B));return TB.useEffect(()=>J.context.stickIfOpenTimeout.disposeEffect(),[J]),J}function T10({store:$,modal:Z}){let J=$.useState("floatingRootContext"),H=n8(J,{outsidePressEvent:{mouse:Z==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),B=H.reference,Q=H.floating;return k9($,{activeTriggerProps:B,inactiveTriggerProps:B,popupProps:Q}),null}var wB=P(m(),1);var cb=300;var db=P(m(),1),GD=P(B8(),1);function fG($,Z){let J=db.useRef(null);function H(Q){GD.flushSync(()=>{$.setOpen(!1,w0(K0.focusOut,Q.nativeEvent,Q.currentTarget))}),VT(J.current)?.focus()}function B(Q){let X=$.select("positionerElement");if(X&&P3(Q,X))$.context.beforeContentFocusGuardRef.current?.focus();else{GD.flushSync(()=>{$.setOpen(!1,w0(K0.focusOut,Q.nativeEvent,Q.currentTarget))});let z=DT($.context.triggerFocusTargetRef.current||Z.current);while(z!==null&&R0(X,z)){let G=z;if(z=wZ(z),z===G)break}z?.focus()}}return{preFocusGuardRef:J,handlePreFocusGuardFocus:H,handleFocusTargetFocus:B}}var EB=P(m(),1);var CB=P(m(),1);function lb($){let Z=CB.useRef(""),J=CB.useCallback((B)=>{if(B.defaultPrevented)return;Z.current=B.pointerType,$(B,B.pointerType)},[$]);return{onClick:CB.useCallback((B)=>{if(B.detail===0){$(B,"keyboard");return}if("pointerType"in B)$(B,B.pointerType);else $(B,Z.current);Z.current=""},[$]),onPointerDown:J}}var ib=P(m(),1);function p9($,Z){let J=ib.useRef($),H=Y0(Z);H0(()=>{if(J.current!==$)H(J.current);J.current=$},[$,H])}function bB($,Z){let J=Y0((Q,X)=>{if(!(typeof $==="function"?$():$))Z(X||($5.os.ios?"touch":""))}),{onClick:H,onPointerDown:B}=lb(J);return EB.useMemo(()=>({onClick:H,onPointerDown:B}),[H,B])}function rb($){let[Z,J]=EB.useState(null),H=bB($,J);return p9($,(B)=>{if(B&&!$)J(null)}),EB.useMemo(()=>({openMethod:Z,triggerProps:H}),[Z,H])}var iZ=P(c(),1),ab=P9(function(Z,J){let{render:H,className:B,style:Q,disabled:X=!1,nativeButton:z=!0,handle:G,payload:U,openOnHover:Y=!1,delay:K=cb,closeDelay:F=0,id:W,...q}=Z,N=l5(!0),A=x9(G)??N;if(!A)throw Error(I0(74));let V=t0(W),L=A.useState("isTriggerActive",V),j=A.useState("floatingRootContext"),M=A.useState("isOpenedByTrigger",V),_=A.useState("triggerPopupId",V),w=wB.useRef(null),{registerTrigger:T,isMountedByThisTrigger:b}=w9(V,w,A,{payload:U,disabled:X,openOnHover:Y,closeDelay:F}),C=A.useState("openChangeReason"),k=A.useState("stickIfOpen"),S=A.useState("openMethod"),R=A.useState("focusManagerModal"),O=t8(j,{enabled:!X&&Y&&(S!=="touch"||C!==K0.triggerPress),mouseOnly:!0,move:!1,handleClose:e8(),restMs:K,delay:{close:F},triggerElementRef:w,isActiveTrigger:L,isClosing:()=>A.select("transitionStatus")==="ending"}),y=T3(j,{stickIfOpen:k}),I=bB(()=>A.select("open"),(i)=>{A.set("openMethod",i)}),x=A.useState("triggerProps",b),{getButtonProps:v,buttonRef:g}=C5({disabled:X,native:z}),E={open(i){if(i&&C===K0.triggerPress)return JB.open(i);return _9.open(i)}},{preFocusGuardRef:l,handlePreFocusGuardFocus:r,handleFocusTargetFocus:h}=fG(A,w),o=G0("button",Z,{state:{disabled:X,open:M},ref:[g,J,T,w],props:[y.reference,O,x,I,{[SZ]:"",id:V,"aria-haspopup":"dialog","aria-expanded":M,"aria-controls":_},q,v],stateAttributesMapping:E}),p=iZ.jsx(wB.Fragment,{children:o},V);if(b&&!R)return iZ.jsxs(wB.Fragment,{children:[iZ.jsx(g4,{ref:l,onFocus:r}),p,iZ.jsx(g4,{ref:A.context.triggerFocusTargetRef,onFocus:h})]});return p});var nb=P(m(),1);var mG=P(m(),1),UD=mG.createContext(void 0);function ob(){let $=mG.useContext(UD);if($===void 0)throw Error(I0(45));return $}var YD=P(c(),1),sb=nb.forwardRef(function(Z,J){let{keepMounted:H=!1,...B}=Z;if(!(l5().useState("mounted")||H))return null;return YD.jsx(UD.Provider,{value:H,children:YD.jsx($$,{ref:J,...B})})});var lG=P(m(),1);var uG=P(m(),1),KD=uG.createContext(void 0);function rZ(){let $=uG.useContext(KD);if(!$)throw Error(I0(46));return $}var tb=P(m(),1),eb=P(c(),1),aZ=tb.forwardRef(function(Z,J){let{cutout:H,...B}=Z,Q;if(H){let X=H.getBoundingClientRect();Q=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${X.left}px ${X.top}px,${X.left}px ${X.bottom}px,${X.right}px ${X.bottom}px,${X.right}px ${X.top}px,${X.left}px ${X.top}px)`}return eb.jsx("div",{ref:J,role:"presentation","data-base-ui-inert":"",...B,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:Q}})});var Qw=P(m(),1);var $w={},Zw={},Jw="";function pG($,Z){return AB($)?$:Z}function Hw($,Z,J){return/hidden|clip/.test($.getComputedStyle(pG(Z,J)).overflowY)}function C10($){if(typeof document>"u")return!1;let Z=f0($);return w1(Z).innerWidth-Z.documentElement.clientWidth>0}function E10($){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;let J=f0($),H=J.documentElement,B=J.body,Q=pG(H,B),X=Q.style.overflowY,z=H.style.scrollbarGutter;H.style.scrollbarGutter="stable",Q.style.overflowY="scroll";let G=Q.offsetWidth;Q.style.overflowY="hidden";let U=Q.offsetWidth;return Q.style.overflowY=X,H.style.scrollbarGutter=z,G===U}function b10($){let Z=f0($),J=Z.documentElement,H=Z.body,B=pG(J,H),Q={overflowY:B.style.overflowY,overflowX:B.style.overflowX};return Object.assign(B.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(B.style,Q)}}function w10($){let Z=f0($),J=Z.documentElement,H=Z.body,B=w1(J),Q=0,X=0,z=!1,G=v2.create();if($5.engine.webkit&&(B.visualViewport?.scale??1)!==1)return()=>{};function U(){let W=B.getComputedStyle(J),q=B.getComputedStyle(H),A=(W.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";Q=J.scrollTop,X=J.scrollLeft,$w={scrollbarGutter:J.style.scrollbarGutter,overflowY:J.style.overflowY,overflowX:J.style.overflowX},Jw=J.style.scrollBehavior,Zw={position:H.style.position,height:H.style.height,width:H.style.width,boxSizing:H.style.boxSizing,overflowY:H.style.overflowY,overflowX:H.style.overflowX,scrollBehavior:H.style.scrollBehavior};let V=J.scrollHeight>J.clientHeight,L=J.scrollWidth>J.clientWidth,j=W.overflowY==="scroll"||q.overflowY==="scroll",M=W.overflowX==="scroll"||q.overflowX==="scroll",_=Math.max(0,B.innerWidth-H.clientWidth),w=Math.max(0,B.innerHeight-H.clientHeight),T=parseFloat(q.marginTop)+parseFloat(q.marginBottom),b=parseFloat(q.marginLeft)+parseFloat(q.marginRight),C=pG(J,H);if(z=E10($),z){J.style.scrollbarGutter=A,C.style.overflowY="hidden",C.style.overflowX="hidden";return}if(Object.assign(J.style,{scrollbarGutter:A,overflowY:"hidden",overflowX:"hidden"}),V||j)J.style.overflowY="scroll";if(L||M)J.style.overflowX="scroll";Object.assign(H.style,{position:"relative",height:T||w?`calc(100dvh - ${T+w}px)`:"100dvh",width:b||_?`calc(100vw - ${b+_}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),H.scrollTop=Q,H.scrollLeft=X,J.setAttribute("data-base-ui-scroll-locked",""),J.style.scrollBehavior="unset"}function Y(){if(Object.assign(J.style,$w),Object.assign(H.style,Zw),!z)J.scrollTop=Q,J.scrollLeft=X,J.removeAttribute("data-base-ui-scroll-locked"),J.style.scrollBehavior=Jw}function K(){Y(),G.request(U)}U();let F=a0(B,"resize",K);return()=>{if(G.cancel(),Y(),typeof B.removeEventListener==="function")F()}}class Bw{lockCount=0;restore=null;timeoutLock=d5.create();timeoutUnlock=d5.create();acquire($){if(this.lockCount+=1,this.lockCount===1&&this.restore===null)this.timeoutLock.start(0,()=>this.lock($));return this.release}release=()=>{if(this.lockCount-=1,this.lockCount===0&&this.restore)this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{if(this.lockCount===0&&this.restore)this.restore?.(),this.restore=null};lock($){if(this.lockCount===0||this.restore!==null)return;let Z=f0($),J=Z.documentElement,H=Z.body,B=w1(J);if(Hw(B,J,H)){let X=new B.MutationObserver(()=>{if(Hw(B,J,H))return;X.disconnect(),this.restore=null,this.lock($)}),z={attributes:!0};X.observe(J,z),X.observe(H,z),this.restore=()=>X.disconnect();return}let Q=$5.os.ios||!C10($);this.restore=Q?b10($):w10($)}}var S10=new Bw;function cG($=!0,Z=null){H0(()=>{if(!$)return;return S10.acquire(Z)},[$,Z])}var R10=20;function dG($,Z,J,H){let[B,Q]=Qw.useState(!1);H0(()=>{if(!$||!Z||J==null){Q(!1);return}let X=f0(J).documentElement.clientWidth,z=J.offsetWidth;Q(X>0&&z>0&&z>=X-R10)},[$,Z,J]),cG($&&(!Z||B),H)}var SB=P(c(),1),Xw=lG.forwardRef(function(Z,J){let{render:H,className:B,style:Q,anchor:X,positionMethod:z,side:G,align:U,sideOffset:Y,alignOffset:K,collisionBoundary:F="clipping-ancestors",collisionPadding:W,arrowPadding:q,sticky:N,disableAnchorTracking:D=!1,collisionAvoidance:A=C9,...V}=Z,L=l5(),j=ob(),M=O3(),_=L.useState("floatingRootContext"),w=L.useState("mounted"),T=L.useState("open"),b=L.useState("openChangeReason"),C=L.useState("activeTriggerElement"),k=L.useState("modal"),S=L.useState("openMethod"),R=L.useState("positionerElement"),O=L.useState("instantType"),y=L.useState("transitionStatus"),I=L.useState("adaptiveOrigin"),x=lG.useRef(null),v=f4(R),g=v9({anchor:X,floatingRootContext:_,positionMethod:z,mounted:w,side:G,sideOffset:Y,align:U,alignOffset:K,arrowPadding:q,collisionBoundary:F,collisionPadding:W,sticky:N,disableAnchorTracking:D,keepMounted:j,nodeId:M,collisionAvoidance:A,adaptiveOrigin:I}),E=_.useState("domReferenceElement");H0(()=>{let o=E,p=x.current;if(o)x.current=o;if(p&&o&&o!==p){L.set("instantType",void 0);let i=new AbortController;return v(()=>{L.set("instantType","trigger-change")},i.signal),()=>{i.abort()}}return},[E,v,L]);let l=k===!0&&b!==K0.triggerHover;dG(T&&l,S==="touch",R,C);let r=L.useStateSetter("positionerElement"),h={open:T,side:g.side,align:g.align,anchorHidden:g.anchorHidden,instant:O},d=f9(Z,h,{styles:g.positionerStyles,transitionStatus:y,props:V,refs:[J,r],hidden:!w,inert:!T});return SB.jsxs(KD.Provider,{value:g,children:[w&&l&&SB.jsx(aZ,{inert:T8(!T),cutout:C}),SB.jsx(J$,{id:M,children:d})]})});var Kw=P(m(),1);var oZ="ArrowUp",nZ="ArrowDown",sZ="ArrowLeft",tZ="ArrowRight",eZ="Home",$J="End",FD="PageUp",WD="PageDown",Z9=new Set([oZ,nZ,sZ,tZ,eZ,$J]),k10="Shift",Gw=[k10,"Control","Alt","Meta"];function I10($){return _1($)&&$.tagName==="INPUT"}function qD($){if(I10($)&&$.selectionStart!=null)return!0;if(_1($)&&$.tagName==="TEXTAREA")return!0;return!1}function ND($,Z,J,H){if(!$||!Z||!Z.scrollTo)return;let{scrollLeft:B,scrollTop:Q}=$,X=$.clientWidth<$.scrollWidth,z=$.clientHeight<$.scrollHeight;if(X&&H!=="vertical"){let G=zw($,Z,"left"),U=iG($),Y=iG(Z);if(J==="ltr"){if(G+Z.offsetWidth+Y.scrollMarginRight>$.scrollLeft+$.clientWidth-U.scrollPaddingRight)B=G+Z.offsetWidth+Y.scrollMarginRight-$.clientWidth+U.scrollPaddingRight;else if(G-Y.scrollMarginLeft<$.scrollLeft+U.scrollPaddingLeft)B=G-Y.scrollMarginLeft-U.scrollPaddingLeft}if(J==="rtl"){if(G-Y.scrollMarginLeft<$.scrollLeft+U.scrollPaddingLeft)B=G-Y.scrollMarginLeft-U.scrollPaddingLeft;else if(G+Z.offsetWidth+Y.scrollMarginRight>$.scrollLeft+$.clientWidth-U.scrollPaddingRight)B=G+Z.offsetWidth+Y.scrollMarginRight-$.clientWidth+U.scrollPaddingRight}}if(z&&H!=="horizontal"){let G=zw($,Z,"top"),U=iG($),Y=iG(Z);if(G-Y.scrollMarginTop<$.scrollTop+U.scrollPaddingTop)Q=G-Y.scrollMarginTop-U.scrollPaddingTop;else if(G+Z.offsetHeight+Y.scrollMarginBottom>$.scrollTop+$.clientHeight-U.scrollPaddingBottom)Q=G+Z.offsetHeight+Y.scrollMarginBottom-$.clientHeight+U.scrollPaddingBottom}$.scrollTo({left:B,top:Q,behavior:"auto"})}function zw($,Z,J){let H=J==="left"?"offsetLeft":"offsetTop",B=0;while(Z.offsetParent){if(B+=Z[H],Z.offsetParent===$)break;Z=Z.offsetParent}return B}function iG($){let Z=getComputedStyle($);return{scrollMarginTop:parseFloat(Z.scrollMarginTop)||0,scrollMarginRight:parseFloat(Z.scrollMarginRight)||0,scrollMarginBottom:parseFloat(Z.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(Z.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(Z.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(Z.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(Z.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(Z.scrollPaddingLeft)||0}}var rG=P(m(),1),y10=rG.createContext(void 0);function aG($){let Z=rG.useContext(y10);if(Z===void 0&&!$)throw Error(I0(69));return Z}var L6=P(m(),1);var AD=L6.createContext(void 0);function Uw(){let[$,Z]=L6.useState(0),J=Y0(()=>{return Z((B)=>B+1),()=>{Z((B)=>Math.max(0,B-1))}});return{context:L6.useMemo(()=>({register:J}),[J]),hasClosePart:$>0}}function Yw(){let $=L6.useContext(AD);H0(()=>{return $?.register()},[$])}var DD=P(c(),1),Fw=Kw.forwardRef(function(Z,J){let{render:H,className:B,style:Q,initialFocus:X,finalFocus:z,...G}=Z,U=l5(),Y=rZ(),K=aG(!0)!=null,{context:F,hasClosePart:W}=Uw(),q=U.useState("open"),N=U.useState("openMethod"),D=U.useState("instantType"),A=U.useState("transitionStatus"),V=U.useState("popupProps"),L=U.useState("titleElementId"),j=U.useState("descriptionElementId"),M=U.useState("modal"),_=U.useState("mounted"),w=U.useState("openChangeReason"),T=U.useState("activeTriggerElement"),b=U.useState("floatingRootContext"),C=b.useState("floatingId"),k=U.useState("disabled"),S=U.useState("openOnHover"),R=U.useState("closeDelay");A5({open:q,ref:U.context.popupRef,onComplete(){if(q)U.context.onOpenChangeComplete?.(!0)}}),C3(b,{enabled:S&&!k,closeDelay:R});let O=X===void 0?ez(U.context.popupRef):X,y=M!==!1&&W;U.useSyncedValue("focusManagerModal",y);let I=U.useStateSetter("popupElement"),x={open:q,side:Y.side,align:Y.align,instant:D,transitionStatus:A},v=G0("div",Z,{state:x,ref:[J,U.context.popupRef,I],props:[V,{id:C,role:"dialog",...E9,"aria-labelledby":L,"aria-describedby":j,onKeyDown(g){if(K&&Z9.has(g.key))g.stopPropagation()}},g9(A),G],stateAttributesMapping:t2});return DD.jsx(B$,{context:b,openInteractionType:N,modal:y,disabled:!_||w===K0.triggerHover,initialFocus:O,returnFocus:z,restoreFocus:"popup",previousFocusableElement:_1(T)?T:void 0,nextFocusableElement:U.context.triggerFocusTargetRef,beforeContentFocusGuardRef:U.context.beforeContentFocusGuardRef,children:DD.jsx(AD.Provider,{value:F,children:v})})});var Ww=P(m(),1);var qw=Ww.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,G=l5().useState("open"),{arrowRef:U,side:Y,align:K,arrowUncentered:F,arrowStyles:W}=rZ();return G0("div",Z,{state:{open:G,side:Y,align:K,uncentered:F},ref:[J,U],props:[{style:W,"aria-hidden":!0},X],stateAttributesMapping:J8})});var Nw=P(m(),1);var Aw=Nw.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=l5(),G=z.useState("open"),U=z.useState("mounted"),Y=z.useState("transitionStatus"),K=z.useState("openChangeReason");return G0("div",Z,{state:{open:G,transitionStatus:Y},ref:J,props:[{role:"presentation",hidden:!U,style:{pointerEvents:K===K0.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},X],stateAttributesMapping:t2})});var Dw=P(m(),1);var Vw=Dw.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=l5(),G=t0(X.id);return z.useSyncedValueWithCleanup("titleElementId",G),G0("h2",Z,{ref:J,props:[{id:G},X]})});var Lw=P(m(),1);var Mw=Lw.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=l5(),G=t0(X.id);return z.useSyncedValueWithCleanup("descriptionElementId",G),G0("p",Z,{ref:J,props:[{id:G},X]})});var Pw=P(m(),1);var _w=Pw.forwardRef(function(Z,J){let{render:H,className:B,style:Q,disabled:X=!1,nativeButton:z=!0,...G}=Z,{buttonRef:U,getButtonProps:Y}=C5({disabled:X,focusableWhenDisabled:!1,native:z}),K=l5();return Yw(),G0("button",Z,{ref:[J,U],props:[{onClick(W){K.setOpen(!1,w0(K0.closePress,W.nativeEvent))}},G,Y]})});var jw=P(m(),1);var Ow=jw.forwardRef(function(Z,J){let{render:H,className:B,style:Q,children:X,...z}=Z,G=l5(),{side:U}=rZ(),Y=G.useState("instantType"),{children:K,state:F}=q6({store:G,side:U,children:X}),W={activationDirection:F.activationDirection,transitioning:F.transitioning,instant:Y};return G0("div",Z,{state:W,ref:J,props:[z,{children:K}],stateAttributesMapping:W6})});class oG extends s8{constructor(){super(gb(),"Popover")}open($){this.openByTrigger($)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}function Tw(){return new oG}var M6=P(c(),1);function P6({...$}){return M6.jsx(S3.Root,{"data-slot":"popover",...$})}function _6({...$}){return M6.jsx(S3.Trigger,{"data-slot":"popover-trigger",...$})}function j6({className:$,align:Z="center",alignOffset:J=0,side:H="bottom",sideOffset:B=4,keepMounted:Q,...X}){return M6.jsx(w8,{portal:S3.Portal,keepMounted:Q,children:M6.jsx(S3.Positioner,{align:Z,alignOffset:J,side:H,sideOffset:B,className:"isolate z-50",children:M6.jsx(S3.Popup,{"data-slot":"popover-content",className:o0("z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-3 text-sm text-popover-foreground shadow-md outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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-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",$),...X})})})}function Cw({className:$,...Z}){return M6.jsx("div",{"data-slot":"popover-header",className:o0("flex flex-col gap-0.5 text-sm",$),...Z})}function Ew({className:$,...Z}){return M6.jsx(S3.Title,{"data-slot":"popover-title",className:o0("font-medium",$),...Z})}var sG=P(m(),1),W$=P(c(),1),x10=($,Z)=>`mo-root${$==="always"?" mo-always":""}${Z?" mo-expr":""}`;function h10($){let Z=Math.round($.num("motion.blink",3500,6500)),J=Math.round($.num("motion.saccade",4200,7600)),H=$.num("motion.lookX",1,2.2),B=$.num("motion.lookY",0.8,1.7),Q=(X)=>Math.round(X*100)/100;return{phase:Math.round($.num("motion.phase",0,2800)),bob:Math.round($.num("motion.bob",0,3400)),blink:Z,blinkPhase:Math.round($.num("motion.blinkPhase",0,Z)),saccade:J,saccadePhase:Math.round($.num("motion.saccadePhase",0,J)),lookX:Q(H)*($.bool("motion.lookXFlip")?-1:1),lookY:Q(B)*($.bool("motion.lookYFlip")?-1:1),lookMX:Q(H),lookMY:Q(B)}}function v10($){let Z=(H)=>`${-H}ms`,J=h10($);return{"--mo-phase":Z(J.phase),"--mo-bob-phase":Z(J.bob),"--mo-blink":`${J.blink}ms`,"--mo-blink-phase":Z(J.blinkPhase),"--mo-look-x":String(J.lookX),"--mo-look-mx":String(J.lookMX),"--mo-look-y":String(J.lookY),"--mo-look-my":String(J.lookMY),"--mo-saccade":`${J.saccade}ms`,"--mo-saccade-phase":Z(J.saccadePhase)}}function VD({l:$,c:Z,h:J}){let H=J*Math.PI/180,B=Z*Math.cos(H),Q=Z*Math.sin(H),X=$+0.3963377774*B+0.2158037573*Q,z=$-0.1055613458*B-0.0638541728*Q,G=$-0.0894841775*B-1.291485548*Q,U=X*X*X,Y=z*z*z,K=G*G*G;return[4.0767416621*U-3.3077115913*Y+0.2309699292*K,-1.2684380046*U+2.6097574011*Y-0.3413193965*K,-0.0041960863*U-0.7034186147*Y+1.707614701*K]}var bw=($)=>$.every((Z)=>Z>=-0.0001&&Z<=1.0001);function kw($){let Z=VD($);if(!bw(Z)){let J=0,H=$.c;for(let B=0;B<12;B++){let Q=(J+H)/2;if(bw(VD({...$,c:Q})))J=Q;else H=Q}Z=VD({...$,c:J})}return Z.map((J)=>Math.min(1,Math.max(0,J)))}function ww($){let[Z,J,H]=kw($);return 0.2126*Z+0.7152*J+0.0722*H}function nG($,Z){let J=ww($),H=ww(Z);return(Math.max(J,H)+0.05)/(Math.min(J,H)+0.05)}function Iw($,Z,J){if(nG($,Z)>=J)return $;let H=$.l>=Z.l?1:-1;for(let X of[H,-H]){let z={...$};for(let G=0;G<60;G++){if(z.l=Math.min(1,Math.max(0,z.l+X*0.02)),nG(z,Z)>=J)return z;if(z.l===0||z.l===1)break}}let B={...$,l:0,c:0},Q={...$,l:1,c:0};return nG(B,Z)>=nG(Q,Z)?B:Q}function g10($){return"#"+kw($).map((Z)=>{let J=Z<=0.0031308?12.92*Z:1.055*Math.pow(Z,0.4166666666666667)-0.055;return Math.round(J*255).toString(16).padStart(2,"0")}).join("")}var Sw=[[0.2,{l:0.86,c:0.085}],[0.36,{l:0.9,c:0.028}],[0.62,{l:0.73,c:0.135}],[0.8,{l:0.62,c:0.165}],[0.93,{l:0.87,c:0.16}],[1,{l:0.34,c:0.035}]],f10=($)=>Sw.find(([Z])=>$<Z)?.[1]??Sw[0][1],m10={l:0.145,c:0,h:0},u10=1.5,p10=($,Z)=>{let J=f10(Z),H=Iw({l:J.l,c:J.c,h:$},m10,u10);return{bg:{l:0.965,c:0.01,h:$},head:H,eye:H.l>=0.5?{l:0.17,c:0.02,h:$}:{l:0.97,c:0.012,h:$}}},c10=[["head","bg",1.25],["eye","head",4.5]];function d10($,Z=!0,J=0){let H=p10($,J);if(Z)for(let[B,Q,X]of c10)H[B]=Iw(H[B],H[Q],X);return H}function l10($,Z=!0,J=0){let H=d10($,Z,J),B={};for(let Q in H)B[Q]=g10(H[Q]);return B}var L5=($)=>{let Z=Math.round($*100)/100;return Object.is(Z,-0)?"0":String(Z)};function LD({cx:$,cy:Z,rx:J,ry:H,n:B=4,rot:Q=0}){let X=Math.min(1,(8*Math.pow(2,-1/B)-4)/3),z=J,G=H,U=z*X,Y=G*X,K=[[z,0],[z,Y],[U,G],[0,G],[-U,G],[-z,Y],[-z,0],[-z,-Y],[-U,-G],[0,-G],[U,-G],[z,-Y],[z,0]],F=Q*Math.PI/180,W=Math.cos(F),q=Math.sin(F),N=(A)=>{let[V,L]=K[A];return`${L5($+V*W-L*q)} ${L5(Z+V*q+L*W)}`},D=`M${N(0)}`;for(let A=1;A<13;A+=3)D+=`C${N(A)} ${N(A+1)} ${N(A+2)}`;return D+"Z"}function i10($,Z,J,H,B,Q=0){let X=B.length,z=Q*Math.PI/180,G=B.map((K,F)=>{let W=z+2*Math.PI*F/X;return[$+J*K*Math.cos(W),Z+H*K*Math.sin(W)]}),U=(K)=>G[(K%X+X)%X],Y=`M${L5(U(0)[0])} ${L5(U(0)[1])}`;for(let K=0;K<X;K++){let[F,W]=U(K-1),[q,N]=U(K),[D,A]=U(K+1),[V,L]=U(K+2);Y+=`C${L5(q+(D-F)/6)} ${L5(N+(A-W)/6)} ${L5(D-(V-q)/6)} ${L5(A-(L-N)/6)} ${L5(D)} ${L5(A)}`}return Y+"Z"}function r10({cx:$,cy:Z,rx:J,ry:H,sides:B,round:Q=0.3,rot:X=0}){let z=Q>0?Q<1?Q/2:0.5:0,G=X*Math.PI/180-Math.PI/2,U=Array.from({length:B},(W,q)=>{let N=G+2*Math.PI*q/B;return[$+J*Math.cos(N),Z+H*Math.sin(N)]}),Y=(W)=>U[(W%B+B)%B],K=(W,q)=>{let[N,D]=Y(W),[A,V]=Y(q);return`${L5(N+(A-N)*z)} ${L5(D+(V-D)*z)}`},F=`M${K(0,-1)}`;for(let W=0;W<B;W++){let[q,N]=Y(W);if(F+=`Q${L5(q)} ${L5(N)} ${K(W,W+1)}`,z<0.5)F+=`L${K(W+1,W)}`}return F+"Z"}function a10($,Z,J,H){let B=L5($-J),Q=L5($+J);return`M${B} ${L5(Z-H)}H${Q}V${L5(Z+H)}H${B}Z`}function o10($,Z,J,H,B){let Q=Math.max(1.05,B),X=J*Math.sqrt(1-1/(Q*Q)),z=Z-H/Q,G=Z-Q*H,U=X*0.14,Y=z+0.86*(G-z);return`M${L5($-X)} ${L5(z)}L${L5($-U)} ${L5(Y)}Q${L5($)} ${L5(G)} ${L5($+U)} ${L5(Y)}L${L5($+X)} ${L5(z)}Z`}function MD($,Z){for(let J=0;J<Z.length;J++)$=Math.imul($^Z[J],3432918353),$=$<<13|$>>>19;return $}function n10($){return $=Math.imul($^$>>>16,2246822507),$=Math.imul($^$>>>13,3266489909),($^$>>>16)>>>0}var yw=new TextEncoder;function s10($){return $.normalize("NFC").trim().toLowerCase()}function t10($,Z=!0){let J=Z?s10($):$;return MD(1779033703^J.length,yw.encode(J))}function Rw($,Z){return n10(MD(MD($,Uint8Array.of(255)),yw.encode(Z)))/4294967296}function e10($,Z=!0,J){let H=t10($,Z),B=(Q)=>{let X=J?.[Q],z=Array.isArray(X)?X[Math.floor(Rw(H,Q)*X.length)]:X;return z===void 0?Rw(H,Q):z>0?z<1?z:0.999999:0};return B.num=(Q,X,z)=>X+B(Q)*(z-X),B.int=(Q,X,z)=>X+Math.floor(B(Q)*(z-X+1)),B.pick=(Q,X)=>X[Math.floor(B(Q)*X.length)],B.bool=(Q,X=0.5)=>B(Q)<X,B.jitter=(Q,X)=>(B(Q)*2-1)*X,B}function xw($,Z,J){let H=Z.expression;if(J||!H)return{l:$,wrap:""};return H.bake($,H.p)}var $50=($,Z)=>Z?.tint?Z.tint($,Z.p):$,hw=($,Z)=>Z?`<g transform="${Z}">${$}</g>`:$,Z50=($)=>$.replace(/[&<>]/g,(Z)=>Z==="&"?"&amp;":Z==="<"?"&lt;":"&gt;");function vw($,Z){let J=e10($,Z.normalize??!0,Z.traits);return{t:J,palette:{...l10(Z.hue??J.num("hue",0,360),Z.contrast??!0,Z.tone??J("tone")),...Z.palette}}}var J50=($)=>$.title?`<title>${Z50($.title)}</title>`:"";function gw($,Z,J){let H=Z.background??$.background;if(H===!1)return;return{d:H==="square"?"M0 0H100V100H0Z":LD({cx:50,cy:50,rx:50,ry:50,n:H==="circle"?2:6}),fill:J.bg}}var H50=($)=>$?`<path d="${$.d}" fill="${$.fill}"/>`:"";function B50($){return(Z,J={})=>{let{t:H,palette:B}=vw(Z,J),Q=$50(B,J.expression),X=J.size?` width="${J.size}" height="${J.size}"`:"",z=xw($.layout(H),J),G=J50(J)+H50(gw($,J,Q))+hw($.render(z.l,Q),z.wrap);return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"${X}>${G}</svg>`}}function Q50($){return(Z,J={},H)=>{let{t:B,palette:Q}=vw(Z,J),X=H?.(B,Q),z=xw($.layout(B),J,X);return{cls:X?.cls,bg:gw($,J,Q),inner:hw($.render(z.l,Q,!!X),z.wrap),vars:X?.vars}}}var X50=($,Z,J)=>{let H=Z.rx,B=$.num("eye.rx",0.075,0.105)*H,Q=$.num("eye.ratio",1.9,3.2),X=$.num("eye.scale",0.78,1.24),z=$.num("eye.stretch",0.85,1.18),G=$.num("eye.gap",0.1,0.24)*H,U=B*Math.max(1,X),Y=B*Q*Math.max(1,X*z),K=U+H*0.03+G,F=$.jitter("gaze.x",0.09)*J.rx,W=$.num("gaze.y",-0.2,0.08)*J.ry,q=$.jitter("eye.dy",0.04)*J.ry,N=Math.hypot(U,Y),D=Math.hypot((Math.abs(F)+K+N)/J.rx,(Math.abs(W)+Math.abs(q)+N)/J.ry),A=D>0.9?0.9/D:1,V=B*A,L=V*Q,j=K*A,M=Math.max(0,Math.min(1,G/Y)),_=Math.min(12,Math.asin(M)*180/Math.PI),w=$.num("eye.lean",-1,1)*_,T=Math.max(-12,Math.min(12,w+$.jitter("eye.lean2",3.5))),b=J.cx+F*A,C=J.cy+W*A;return[{cx:b-j,cy:C,rx:V,ry:L,n:$.num("eye.n",3.5,6),rot:w},{cx:b+j,cy:C+q*A,rx:V*X,ry:L*X*z,n:$.num("eye.n",3.5,6),rot:T}]};function z50($,Z){let J=(Q)=>($.find(([,X])=>Q<X)??$[$.length-1])[0];function H(Q){let X=J(Q("shape")),z=Q.num("body.r",31,38)*X.core,G={cx:50+Q.jitter("body.x",1.5),cy:50+Q.jitter("body.y",1.5),rx:z,ry:z*Q.num("body.ratio",0.92,1.08),n:Q.num("body.n",1.9,2.5),rot:0,radii:Array.from({length:Q.int("body.pts",6,8)},(K,F)=>1+Q.jitter(`body.r${F}`,0.16))};X.body?.(Q,G);let U=X.face?.(G)??G,Y={petals:[],extra:[]};return X.decorate?.(Q,G,Y),{shape:X.name,draw:X.path,body:G,face:U,petals:Y.petals,extra:Y.extra,eyes:Z(Q,G,U)}}function B(Q,X,z){let G=(K)=>Math.round(K*100)/100,U=(K,F)=>{let W=`<path d="${LD(K)}"/>`;return z?`<g class="mo-eye" style="--mo-wrap:${F?1:-1};--mo-lean:${G(K.rot)};transform-origin:${G(K.cx)}px ${G(K.cy)}px">${W}</g>`:W},Y=`<g fill="${X.head}">`+Q.petals.map((K)=>`<circle cx="${G(K.cx)}" cy="${G(K.cy)}" r="${G(K.r)}"/>`).join("")+Q.extra.map((K)=>`<path d="${K}"/>`).join("")+`<path d="${Q.draw?Q.draw(Q.body):LD(Q.body)}"/></g><g fill="${X.eye}"${z?' class="mo-eyes"':""}>`+Q.eyes.map(U).join("")+"</g>";return z?`<g class="mo-breathe"><g class="mo-bob">${Y}</g></g>`:Y}return{layout:H,render:B,background:!1}}var fw=($)=>r10($),mw=($)=>i10($.cx,$.cy,$.rx,$.ry,$.radii,$.rot),PD=($)=>(Z)=>({cx:Z.cx,cy:Z.cy,rx:Z.rx*$,ry:Z.ry*$}),uw=($)=>PD(Math.min(...$.radii)*0.95)($),G50=($)=>PD(0.84)($),U50={name:"round",core:1},Y50={name:"organic",core:0.98,path:mw,face:uw},K50={name:"boxy",core:0.86,body:($,Z)=>{Z.n=$.num("body.n",3.4,6),Z.rot=$.num("body.rot",-20,20)}},F50={name:"capsule",core:1.02,body:($,Z)=>{Z.ry*=$.num("capsule.squat",0.55,0.68)},face:PD(0.94),decorate:($,Z,J)=>{for(let H of[-1,1])J.petals.push({cx:Z.cx+H*(Z.rx-Z.ry),cy:Z.cy,r:Z.ry})},path:($)=>a10($.cx,$.cy,$.rx-$.ry,$.ry)},W50={name:"nub",core:0.88,decorate:($,Z,J)=>{let H=$.int("nub.n",1,2);for(let B=0;B<H;B++){let Q=$.num(`nub.a${B}`,0,2*Math.PI);J.petals.push({cx:Z.cx+Math.cos(Q)*Z.rx*0.88,cy:Z.cy+Math.sin(Q)*Z.rx*0.88,r:Z.rx*$.num(`nub.r${B}`,0.24,0.4)})}}},q50={name:"cloud",core:0.78,face:uw,path:mw,decorate:($,Z,J)=>{let H=$.int("cloud.n",4,6);for(let B=0;B<H;B++){let Q=Math.PI+Math.PI*(B+0.5)/H;J.petals.push({cx:Z.cx+Math.cos(Q)*Z.rx*0.8,cy:Z.cy+Math.sin(Q)*Z.rx*0.5,r:Z.rx*$.num(`cloud.r${B}`,0.44,0.62)})}}},N50={name:"droplet",core:0.78,body:($,Z)=>{Z.cy+=0.22*Z.ry,Z.n=2},face:($)=>({cx:$.cx,cy:$.cy+$.ry*0.05,rx:$.rx*0.88,ry:$.ry*0.88}),decorate:($,Z,J)=>{J.extra.push(o10(Z.cx,Z.cy,Z.rx,Z.ry,$.num("droplet.tip",1.4,1.65)))}},A50={name:"hexagon",core:1.05,path:fw,face:G50,body:($,Z)=>{Z.sides=6,Z.rot=$.num("body.rot",-12,12),Z.round=$.num("poly.round",0.24,0.5)}},D50={name:"sun",core:0.7,decorate:($,Z,J)=>{let H=$.int("sun.n",6,9),B=Z.rx*$.num("sun.dist",1,1.08),Q=Z.rx*$.num("sun.r",0.2,0.26),X=$.num("sun.rot",0,2*Math.PI);for(let z=0;z<H;z++){let G=X+2*Math.PI*z/H;J.petals.push({cx:Z.cx+Math.cos(G)*B,cy:Z.cy+Math.sin(G)*B,r:Q})}}},V50={name:"triangle",core:1.15,path:fw,body:($,Z)=>{Z.sides=3,Z.rot=$.num("body.rot",-5,5),Z.round=$.num("poly.round",0.24,0.5)},face:($)=>({cx:$.cx,cy:$.cy+$.ry*0.1,rx:$.rx*0.54,ry:$.ry*0.36})},L50=[[U50,0.22],[Y50,0.48],[K50,0.6],[F50,0.7],[W50,0.79],[q50,0.86],[N50,0.915],[A50,0.95],[D50,0.98],[V50,1]],pw=z50(L50,X50),M50=B50(pw),P50=($,Z)=>(J,H)=>{let B=Z?Z.vars(Z.p):{},Q=Z?.tint?Z.tint(H,Z.p):H;return{cls:x10($,!!Object.keys(B).length||!!Z?.tint),vars:{...v10(J),"--mo-head":Q.head,"--mo-eye":Q.eye,...B}}};function _50($,Z={}){return Q50(pw)($,Z,Z.animate&&P50(Z.animate,Z.expression))}function j50($,Z){return"data:image/svg+xml,"+M50($,Z).replace(/"/g,"'").replace(/[%#<>{}|\\^[\]`]/g,(J)=>"%"+J.charCodeAt(0).toString(16).toUpperCase()).replace(/\s+/g," ")}function cw({name:$,size:Z,background:J,palette:H,hue:B,tone:Q,normalize:X,contrast:z,title:G,animate:U,expression:Y,traits:K,...F}){let W={size:Z,background:J,palette:H,hue:B,tone:Q,normalize:X,contrast:z,title:G,expression:Y,traits:K},q=JSON.stringify([$,W,U]),N=sG.useMemo(()=>U?"":j50($,W),[q]),D=sG.useMemo(()=>U?_50($,{...W,animate:U}):null,[q]),A=sG.useMemo(()=>({__html:D?.inner??""}),[D?.inner]);if(D){let{style:j,...M}=F;return W$.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",width:Z,height:Z,role:G?"img":void 0,"aria-hidden":G?void 0:!0,style:{...D.vars,...j},...M,children:[G?W$.jsx("title",{children:G}):null,D.bg?W$.jsx("path",{d:D.bg.d,fill:D.bg.fill}):null,W$.jsx("g",{className:D.cls,dangerouslySetInnerHTML:A})]})}let{alt:V,...L}=F;return W$.jsx("img",{src:N,width:Z,height:Z,alt:V??G??"",...L})}var tG=cw;var BJ={};b5(BJ,{Root:()=>lw,Image:()=>aw,Fallback:()=>ow});var JJ=P(m(),1);var eG=P(m(),1),_D=eG.createContext(void 0);function $U(){let $=eG.useContext(_D);if($===void 0)throw Error(I0(13));return $}var ZJ={imageLoadingStatus:()=>null};var dw=P(c(),1),lw=JJ.forwardRef(function(Z,J){let{className:H,render:B,style:Q,...X}=Z,[z,G]=JJ.useState("idle"),U={imageLoadingStatus:z},Y=JJ.useMemo(()=>({imageLoadingStatus:z,setImageLoadingStatus:G}),[z,G]),K=G0("span",Z,{state:U,ref:J,props:X,stateAttributesMapping:ZJ});return dw.jsx(_D.Provider,{value:Y,children:K})});var RB=P(m(),1);var iw=P(m(),1);function rw($,{referrerPolicy:Z,crossOrigin:J,sizes:H,srcSet:B},Q){let X=iw.useState("idle"),z=X[1];return H0(()=>{if(!Q)return z1;if(!$&&!B)return z("error"),z1;let G=!0,U=new window.Image,Y=(K)=>()=>{if(!G)return;z(K)};if(z("loading"),U.onload=Y("loaded"),U.onerror=Y("error"),Z)U.referrerPolicy=Z;if(U.crossOrigin=J??null,H)U.sizes=H;if(B)U.srcset=B;if($)U.src=$;if(U.complete)z(U.naturalWidth>0?"loaded":"error");return()=>{G=!1}},[Q,$,B,H,J,Z,z]),X}var O50={...ZJ,...B2},aw=RB.forwardRef(function(Z,J){let{className:H,render:B,onLoadingStatusChange:Q,keepMounted:X=!1,style:z,sizes:G,srcSet:U,src:Y,...K}=Z,{setImageLoadingStatus:F}=$U(),[W,q]=rw(Y,Z,!X),N=W==="loaded",{mounted:D,transitionStatus:A,setMounted:V}=C2(N),L=RB.useRef(null),j=RB.useRef(!0);H0(()=>{if(!X)return;let k=j.current;j.current=!1;let S=L.current;if(!S)return;if(!S.complete){q("loading");return}let R=S.naturalWidth>0?"loaded":"error";if(q(R),R==="loaded"&&k)V(!0)},[X,Y,U,G,K.crossOrigin,K.referrerPolicy,B,q,V]);let M=X?{"data-loading":W==="loading"?"":void 0,"data-error":W==="error"?"":void 0,"aria-hidden":W!=="loaded"||void 0,onLoad(){q("loaded")},onError(){q("error")}}:void 0,_=Y0((k)=>{Q?.(k),F(k)});H0(()=>{if(W!=="idle")_(W)},[W,_]),H0(()=>{return()=>F("idle")},[F]),A5({enabled:!N,open:N,ref:L,onComplete(){if(!N)V(!1)}});let w={imageLoadingStatus:W,transitionStatus:X&&A==="ending"?void 0:A},T=X||D,b={};if(G!==void 0)b.sizes=G;if(U!==void 0)b.srcSet=U;if(Y!==void 0)b.src=Y;let C=G0("img",Z,{state:w,ref:[J,L],props:[M,K,b],stateAttributesMapping:O50,enabled:T});if(!T)return null;return C});var HJ=P(m(),1);var ow=HJ.forwardRef(function(Z,J){let{className:H,render:B,delay:Q=0,style:X,...z}=Z,{imageLoadingStatus:G}=$U(),[U,Y]=HJ.useState(Q===0),K=i1();return HJ.useEffect(()=>{if(Q>0)K.start(Q,()=>Y(!0));else Y(!0);return K.clear},[K,Q]),G0("span",Z,{state:{imageLoadingStatus:G},ref:J,props:z,stateAttributesMapping:ZJ,enabled:G!=="loaded"&&(Q===0||U)})});var q$=P(c(),1);function nw({className:$,size:Z="default",...J}){return q$.jsx(BJ.Root,{"data-slot":"avatar","data-size":Z,className:o0("group/avatar relative isolate flex shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=default]:size-8 data-[size=lg]:size-10 data-[size=sm]:size-6 data-[size=xs]:size-5 dark:after:mix-blend-lighten","[--avatar-badge-size:--spacing(2.5)] data-[size=sm]:[--avatar-badge-size:--spacing(2)] data-[size=xs]:[--avatar-badge-size:--spacing(1.5)]","has-[>[data-slot=avatar-badge]]:[&::after,&>:where([data-slot=avatar-image],[data-slot=avatar-fallback])]:mask-[radial-gradient(circle_at_calc(100%_-_var(--avatar-badge-size)/2)_calc(100%_-_var(--avatar-badge-size)/2),transparent_calc(var(--avatar-badge-size)/2_+_2px),black_calc(var(--avatar-badge-size)/2_+_2.5px))]",$),...J})}function sw({className:$,...Z}){return q$.jsx(BJ.Image,{"data-slot":"avatar-image",className:o0("aspect-square size-full rounded-full object-cover",$),...Z})}function tw({className:$,...Z}){return q$.jsx(BJ.Fallback,{"data-slot":"avatar-fallback",className:o0("flex size-full items-center justify-center overflow-hidden rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs group-data-[size=xs]/avatar:text-xs",$),...Z})}function ew({className:$,...Z}){return q$.jsx("span",{"data-slot":"avatar-badge",className:o0("absolute right-0 bottom-0 size-(--avatar-badge-size) rounded-full bg-primary select-none",$),...Z})}function $S({className:$,...Z}){return q$.jsx("div",{"data-slot":"avatar-group",className:o0("group/avatar-group flex items-center -space-x-2 [--avatar-radius:--spacing(4)]","*:data-[size=lg]:[--avatar-radius:--spacing(5)] *:data-[size=sm]:[--avatar-radius:--spacing(3)] *:data-[size=xs]:[--avatar-radius:--spacing(2.5)]","[&>[data-slot=avatar]:not(:last-child)]:mask-[radial-gradient(circle_at_calc(100%_+_var(--avatar-radius)_-_--spacing(2))_50%,transparent_calc(var(--avatar-radius)_+_2px),black_calc(var(--avatar-radius)_+_2.5px))]",$),...Z})}function ZS({className:$,size:Z="default",...J}){return q$.jsx("div",{"data-slot":"avatar-group-count","data-size":Z,className:o0("relative flex shrink-0 items-center justify-center rounded-full bg-accent text-sm text-muted-foreground [&>svg]:size-4","data-[size=default]:size-8 data-[size=lg]:size-10 data-[size=sm]:size-6 data-[size=xs]:size-5","data-[size=sm]:text-[11px] data-[size=xs]:text-[11px]","data-[size=lg]:[&>svg]:size-5 data-[size=sm]:[&>svg]:size-3 data-[size=xs]:[&>svg]:size-3",$),...J})}var I5=P(m(),1);function O6($){return $.name?.trim()||$.email?.trim()||$.id}function JS($,Z){let J=$.filter((H)=>H.userId===Z);return J.some((H)=>H.location?.status==="active")?"active":J.length?"away":"offline"}function HS($,Z,J){if(J!==void 0)return J;let H=new Map($.map((B)=>[B.id,B]));if(Z)H.set(Z.id,Z);return[...H.values()]}function QJ($,Z){let J=$.users.find((H)=>H.id===Z);return J?{...J,status:JS($.connections,Z)}:void 0}function BS($,Z,J,{scope:H="page",status:B}={}){let Q=[],X=new Set($.connections.filter((z)=>z.userId!==Z&&(H==="workspace"||J!==null&&z.location?.page===J.page)).map((z)=>z.userId));for(let z of X){let G=QJ($,z);if(G&&(!B||G.status===B))Q.push(G)}return Q}function QS($,Z){return[...Z.users].sort((H,B)=>Number(B.id===Z.currentUser?.id)-Number(H.id===Z.currentUser?.id)).map((H)=>{let B=new Set;for(let X of $){if(X.userId!==H.id||X.connectionId===Z.connectionId)continue;if(X.location)B.add(X.location.page)}let Q=H.id===Z.currentUser?.id;if(Q&&Z.page)B.add(Z.page);return{profile:H,self:Q,pages:[...B],status:JS($,H.id)}})}function XS($,Z,J=()=>!0){let H=!1,B=()=>{if(!H)return;H=!1,$.deletePresence(Z.registrationId)};return{publish(Q,X){if(!X||!J(Q)){B();return}H=!0,$.setPresence({...Z,value:Q})},clear:B}}function jD(){let $=D6();return I5.useSyncExternalStore($.subscribe,$.getUsersSnapshot,$.getUsersSnapshot)}function XJ(){let $=D6(),Z=jD(),J=I5.useSyncExternalStore($.subscribeCurrentUser,$.getCurrentUser,$.getCurrentUser),H=I5.useSyncExternalStore($.subscribeDirectory,$.getDirectory,$.getDirectory),B=I5.useMemo(()=>HS(Z.users,J,H),[Z.users,J,H]);return{state:Z,self:J,users:B,engine:$}}function T6($){let{state:Z,users:J}=XJ();return I5.useMemo(()=>QJ({...Z,users:J},$),[Z,J,$])}function zS($){let{state:Z,users:J}=XJ();return $.map((H)=>QJ({...Z,users:J},H))}function ZU({status:$}={}){let{state:Z,users:J}=XJ();return I5.useMemo(()=>J.map((H)=>QJ({...Z,users:J},H.id)).filter((H)=>!$||H.status===$),[Z,J,$])}function JU(){let{state:$,self:Z,users:J}=XJ();return I5.useMemo(()=>Z?QJ({...$,users:J},Z.id):void 0,[$,Z,J])}function GS($={}){let{state:Z,self:J,users:H,engine:B}=XJ(),{scope:Q,status:X}=$;return I5.useMemo(()=>BS({...Z,users:H},J?.id,B.getLocation(),{scope:Q,status:X}),[Z,J,H,B,Q,X])}var zJ={custom:($)=>`custom:${$}`,cursor:($)=>`cursor:${$}`,target:($)=>`field:${$}`};function US($){return kB(zJ.custom($))}function kB($){let{users:Z,engine:J}=XJ(),H=BD(),B=H?.appletId??"",Q=I5.useCallback(()=>J.getPresenceSnapshot(B,$),[J,B,$]),X=I5.useSyncExternalStore(J.subscribe,Q,Q);return I5.useMemo(()=>{if(!H?.active)return[];let z=new Set(Z.map((G)=>G.id));return X.filter((G)=>z.has(G.userId)).map((G)=>({connectionId:G.connectionId,userId:G.userId,value:G.value}))},[X,Z,H])}function IB($,Z,J){let H=D6(),B=BD(),[Q]=I5.useState(()=>crypto.randomUUID()),X=I5.useRef(Z),z=I5.useRef(!1),G=B?.appletId??"",U=I5.useMemo(()=>XS(H,{registrationId:Q,appletId:G,channel:$},J),[H,Q,G,$,J]),Y=I5.useCallback(()=>{U.publish(X.current,B?.active===!0&&document.visibilityState!=="hidden")},[B,U]);return I5.useLayoutEffect(()=>{if(!B?.active)return;return z.current=!0,Y(),document.addEventListener("visibilitychange",Y),()=>{z.current=!1,document.removeEventListener("visibilitychange",Y),U.clear()}},[B,Y,U]),I5.useCallback((K)=>{if(X.current=K,z.current)Y()},[Y])}function T50($,Z,J){let H=IB($,Z,J);I5.useLayoutEffect(()=>H(Z),[H,Z])}function YS($,Z){T50(zJ.custom($),Z)}var C6=P(c(),1);function E6({id:$,size:Z="default",showStatusBadge:J,className:H}){let B=T6($),Q=B?O6(B):"Unknown user";return C6.jsxs(nw,{size:Z,"aria-label":Q,"data-collab-color":B?.color??"unknown",className:H,children:[B?.avatar&&C6.jsx(sw,{src:B.avatar,alt:""}),C6.jsx(tw,{children:B?C6.jsx(tG,{name:$,animate:"hover",background:"circle",traits:{shape:0,"body.r":1},palette:{bg:"var(--collab)",head:"var(--collab)",eye:"var(--collab-foreground)"}}):C6.jsx(HU,{size:Z==="xs"||Z==="sm"?12:16,stroke:1.75})}),J&&B?.status==="active"&&C6.jsx(ew,{className:"bg-success"})]})}var c9=P(c(),1),C50="Unknown user";function BU({id:$,size:Z="default",showStatusBadge:J,showYouLabel:H,description:B,className:Q}){let X=T6($),z=JU(),G=X?O6(X):C50,U=X!==void 0&&X.id===z?.id;return c9.jsxs("span",{className:X0("inline-flex min-w-0 items-center gap-2",Q),children:[c9.jsx(E6,{id:$,size:Z,showStatusBadge:J}),c9.jsxs("span",{className:X0("flex min-w-0 flex-1 text-sm",Z==="xs"?"items-baseline":"flex-col"),children:[c9.jsxs("span",{className:"flex min-w-0 items-baseline gap-1",children:[c9.jsx("span",{className:X0("truncate",!X&&"text-muted-foreground"),children:G}),H&&U&&c9.jsx("span",{className:"shrink-0 text-muted-foreground",children:"(You)"})]}),B&&c9.jsxs("span",{className:X0("truncate text-muted-foreground",Z==="sm"&&"text-xs leading-tight"),children:[Z==="xs"&&c9.jsx("span",{"aria-hidden":"true",className:"whitespace-pre",children:" · "}),B]})]})]})}var yB=P(c(),1);function QU({ids:$,max:Z=3,size:J="sm",className:H}){let B=[...new Set($)],Q=B.slice(0,Z),X=B.length-Q.length;return yB.jsxs($S,{className:H,"aria-label":`${B.length} users`,children:[Q.map((z)=>yB.jsx(E6,{id:z,size:J},z)),X>0&&yB.jsxs(ZS,{size:J,"aria-label":`${X} more`,children:["+",X]})]})}var z2=P(c(),1),KS={active:0,away:1,offline:2};function OD({workspaceId:$,describeTab:Z,onOpenTab:J}){let H=p2(),B=D6(),Q=jD(),X=ZU(),z=zU.useSyncExternalStore(B.subscribeCurrentUser,B.getCurrentUser,B.getCurrentUser),G=_2(),U=JD(p7(G),$,G.base),Y=QS(Q.connections,{currentUser:z,connectionId:Q.connectionId,users:X,page:U}),K=Y.filter((q)=>q.self||q.status!=="offline").map((q)=>q.profile.id),[F,W]=zU.useState(!1);if(!H)return null;return z2.jsxs(P6,{open:F,onOpenChange:W,children:[z2.jsxs(_6,{render:z2.jsx(P0,{variant:"ghost",size:"sm","aria-label":"Users in this workspace",className:"gap-0.5 rounded-full pr-1 pl-1 data-popup-open:bg-accent"}),children:[z2.jsx(QU,{ids:K,size:"xs",max:4}),z2.jsx(XU,{stroke:2.5,className:"size-3! text-muted-foreground"})]}),z2.jsxs(j6,{align:"end",className:"max-w-64 p-1",children:[z2.jsx(Ew,{className:"sr-only",children:"Users in this workspace"}),z2.jsx(E50,{users:Y,page:U,describeTab:Z,onOpenTab:(q)=>{W(!1),J(q)}}),Y.length===0&&z2.jsx("p",{className:"px-2 py-1 text-xs text-muted-foreground",children:"No workspace users to show."})]})]})}function E50({users:$,page:Z,describeTab:J,onOpenTab:H}){let B=$.toSorted((Q,X)=>KS[Q.status]-KS[X.status]||Number(X.self)-Number(Q.self));return z2.jsx("ul",{className:"flex max-h-80 scroll-fade flex-col overflow-y-auto",children:B.map((Q)=>z2.jsx(b50,{user:Q,page:Z,describeTab:J,onOpenTab:H},Q.profile.id))})}function b50({user:$,page:Z,describeTab:J,onOpenTab:H}){let B=$.pages.map((F)=>{let W=K$(F);return{tab:W,info:W?J(W):null}}),Q=$.self||$.status==="offline"?void 0:B.find(({tab:F,info:W})=>F!==null&&W!==null&&F!==Z),X=Q?.tab,z=[...new Set(B.map(({tab:F,info:W})=>W?.label??F??"Another tab"))].join(", "),G=$.status==="offline"?"Offline":$.status==="away"?z?`${z} · Away`:"Away":z||"Another tab",U=$.status==="offline"?void 0:B[0]?.info?.Icon,Y=z2.jsx(BU,{id:$.profile.id,className:"flex-1",size:"sm",showYouLabel:!0,description:z2.jsxs("span",{className:"flex items-center gap-1 text-xs",children:[U&&z2.jsx(U,{size:12,stroke:1.75,className:"shrink-0"}),z2.jsx("span",{className:"truncate",children:G})]})}),K="flex w-full items-center gap-2.5 rounded-md px-2 py-1 text-left";return z2.jsx("li",{children:X?z2.jsx("button",{type:"button",title:`Go to ${Q?.info?.label}`,className:X0("flex w-full items-center gap-2.5 rounded-md px-2 py-1 text-left","cursor-pointer outline-none hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50"),onClick:()=>H(X),children:Y}):z2.jsx("div",{className:"flex w-full items-center gap-2.5 rounded-md px-2 py-1 text-left",children:Y})})}var N$=P(m(),1);function FS($){return G0($.defaultTagName??"div",$,$)}var w50=GJ("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-sm border border-transparent px-1.5 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-accent [a]:hover:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function GU({className:$,variant:Z="default",render:J,...H}){return FS({defaultTagName:"span",props:X2({className:o0(w50({variant:Z}),$)},H),render:J,state:{slot:"badge",variant:Z}})}var b6=P(m(),1);function UU(...$){if(!$.length||$.some((Z)=>typeof Z!=="string"||!Z.trim()))throw Error("PresenceGroup, PresenceFrame, and PresenceAvatars require a nonempty id.");return $.map((Z)=>encodeURIComponent(Z)).join("/")}var TD=($)=>$!==!1&&$!==null,UJ=b6.createContext([]);function YU($){return UU(...b6.useContext(UJ),$)}function KU($,Z){let J=Z===void 0,H=b6.useRef(null),B=zJ.target($),Q=kB(B),X=IB(B,!1,TD),z=(U,Y)=>Y!==null&&U instanceof Element&&U.closest("[data-presence-target]")===Y;b6.useLayoutEffect(()=>{X(Z??z(document.activeElement,H.current))},[$,Z,X]);let G=new Map;for(let U of Q)if(U.value===!0&&!G.has(U.userId))G.set(U.userId,{id:U.userId,connectionId:U.connectionId});return{users:[...G.values()],props:{ref:H,"data-collab-target":$,"data-presence-target":J?$:void 0,onFocusCapture:J?(U)=>X(z(U.target,U.currentTarget)):void 0,onBlurCapture:J?(U)=>X(z(U.relatedTarget,U.currentTarget)):void 0}}}var J9=P(c(),1);function S50($){if(!$||typeof $!=="object"||Array.isArray($))return null;if(typeof $.x!=="number"||typeof $.y!=="number")return null;if(!Number.isFinite($.x)||!Number.isFinite($.y))return null;return{x:$.x,y:$.y,...typeof $.target==="string"?{target:$.target}:{},...typeof $.targetX==="number"&&Number.isFinite($.targetX)?{targetX:$.targetX}:{},...typeof $.targetY==="number"&&Number.isFinite($.targetY)?{targetY:$.targetY}:{}}}function qS({id:$="default",children:Z,className:J}){let H=N$.useRef(null),B=N$.useRef(null);N$.useLayoutEffect(()=>{let Y=H.current,K=B.current;if(!Y||!K)return;let F=()=>{K.style.transform=`translate(${Y.scrollLeft}px, ${Y.scrollTop}px)`};return F(),Y.addEventListener("scroll",F),()=>Y.removeEventListener("scroll",F)},[]);let Q=zJ.cursor($),X=kB(Q),z=IB(Q,null,TD),G=new Map;for(let{connectionId:Y,userId:K,value:F}of X){let W=S50(F);if(W)G.set(Y,{id:K,point:W})}let U=(Y)=>{if(Y.pointerType==="touch")return;let K=H.current;if(!K||!(Y.target instanceof Element)||Y.target.closest("[data-collab-cursors]")!==K)return;let F=K.getBoundingClientRect(),W=Y.target instanceof Element?Y.target.closest("[data-collab-target]"):null,q=W&&K.contains(W)?W:null,N=q?.getBoundingClientRect();z({x:Y.clientX-F.left-K.clientLeft+K.scrollLeft,y:Y.clientY-F.top-K.clientTop+K.scrollTop,...q&&N?{target:q.dataset.collabTarget??"",targetX:N.width?(Y.clientX-N.left)/N.width:0,targetY:N.height?(Y.clientY-N.top)/N.height:0}:{}})};return J9.jsxs("div",{ref:H,"data-collab-cursors":$,className:X0("relative",J),onPointerEnter:U,onPointerMove:U,onPointerLeave:(Y)=>{if(Y.target instanceof Element&&Y.target.closest("[data-collab-cursors]")===Y.currentTarget)z(null)},children:[Z,J9.jsx("div",{ref:B,className:"pointer-events-none absolute inset-0 overflow-hidden","aria-hidden":"true",children:[...G].map(([Y,{id:K,point:F}])=>J9.jsx(R50,{root:H,point:F,id:K},Y))})]})}function R50({root:$,point:Z,id:J}){let H=N$.useRef(null);return N$.useLayoutEffect(()=>{let B=$.current,Q=H.current;if(!B||!Q)return;let X=(Y=!1)=>{let K=Z.x-B.scrollLeft,F=Z.y-B.scrollTop;if(Z.target){let q=[...B.querySelectorAll("[data-collab-target]")].find((A)=>A.dataset.collabTarget===Z.target);if(!q){Q.hidden=!0;return}let N=B.getBoundingClientRect(),D=q.getBoundingClientRect();K=D.left-N.left-B.clientLeft+D.width*(Z.targetX??0),F=D.top-N.top-B.clientTop+D.height*(Z.targetY??0)}let W=`translate(${K}px, ${F}px)`;if(Q.hidden||Q.style.transform!==W)Q.dataset.moving=Y&&!Q.hidden?"true":"false",Q.style.transform=W;Q.hidden=!1};X(!0);let z=()=>X(),G=new ResizeObserver(z);G.observe(B);let U=new MutationObserver(z);return U.observe(B,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-collab-target"]}),B.addEventListener("scroll",z,!0),window.addEventListener("resize",z),()=>{G.disconnect(),U.disconnect(),B.removeEventListener("scroll",z,!0),window.removeEventListener("resize",z)}},[$,Z]),J9.jsx(k50,{ref:H,id:J})}function k50({id:$,ref:Z}){let J=T6($);return J9.jsx("span",{ref:Z,hidden:!0,"aria-hidden":"true","data-collab-color":J?.color??"unknown",className:"pointer-events-none absolute top-0 left-0 transition-transform duration-100 ease-linear data-[moving=false]:transition-none motion-reduce:transition-none",children:J9.jsxs("span",{className:"relative block animate-in duration-200 zoom-in-75 fade-in",children:[J9.jsx(WS,{size:24,stroke:1.5,className:"-translate-x-0.5 -translate-y-0.5 fill-collab stroke-white drop-shadow-xs"}),J9.jsx(GU,{className:"absolute top-3.5 left-3.5 bg-collab text-collab-foreground",children:J9.jsx("span",{className:"truncate",children:J?O6(J):"Someone"})})]})})}var FU=P(m(),1);var w6=P(c(),1);function NS({id:$,present:Z,align:J,children:H,className:B}){let Q=YU($),X=KU(Q,Z);return w6.jsx(I50,{...X.props,ids:X.users.map((z)=>z.id),align:J,className:B,children:H})}function I50({ids:$,align:Z,children:J,className:H,...B}){let Q=zS($).filter((X)=>X!==void 0);return w6.jsxs("div",{className:X0("relative",H),...B,children:[w6.jsx(h50,{names:Q.map(O6).join(", "),color:Q[0]?.color,align:Z}),J]})}var xB=4,y50=6,x50=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function h50({names:$,color:Z,align:J="end"}){let H=FU.useRef(null);return FU.useLayoutEffect(()=>{let B=H.current,Q=B?.parentElement;if(!$||!B||!Q)return;let X=()=>{let G=[...Q.children].filter((A)=>{if(A===B)return!1;let{display:V,position:L}=getComputedStyle(A);return V!=="none"&&L!=="absolute"&&L!=="fixed"}),U=[...Q.childNodes].some((A)=>A.nodeType===Node.TEXT_NODE&&A.textContent?.trim()),Y=G.length===1&&!U?G[0]:null,K=Y instanceof HTMLElement?Y:null,W=(K??Q).getBoundingClientRect(),q=Q.getBoundingClientRect(),N=B.style;N.left=`${W.left-q.left-Q.clientLeft+Q.scrollLeft-xB}px`,N.top=`${W.top-q.top-Q.clientTop+Q.scrollTop-xB}px`,N.width=`${W.width+xB*2}px`,N.height=`${W.height+xB*2}px`,N.setProperty("--presence-target-width",`${W.width}px`);let D=K?getComputedStyle(K):null;for(let A of x50)N[A]=D?`calc(${D[A]} + ${xB}px)`:`${y50}px`};X();let z=new ResizeObserver(X);z.observe(Q);for(let G of Q.children)if(G!==B)z.observe(G);return()=>z.disconnect()}),w6.jsx("div",{ref:H,hidden:!$,"data-align":J,"data-collab-color":Z??"unknown",className:"group/frame pointer-events-none absolute m-0! animate-in ring-2 ring-collab duration-150 fade-in",children:w6.jsx(GU,{className:"absolute bottom-full mb-1.5 max-w-[min(var(--presence-target-width),10rem)] bg-collab text-collab-foreground group-data-[align=end]/frame:-right-0.5 group-data-[align=start]/frame:-left-0.5",children:w6.jsx("span",{className:"truncate",children:$})})})}var YJ=P(m(),1);var WU=P(c(),1);function DS({id:$,children:Z}){let J=YJ.useContext(UJ),H=YJ.useMemo(()=>{return UU($),[...J,$]},[J,$]),B=YJ.useId();return WU.jsx(AS,{reducedMotion:"user",children:WU.jsx(qU,{id:B,children:WU.jsx(UJ,{value:H,children:Z})})})}var VS=P(m(),1);var A$=P(c(),1);function LS({id:$,present:Z,align:J,children:H,className:B}){let Q=YU($),X=KU(Q,Z),z=VS.useContext(UJ).length>0;return A$.jsx(v50,{...X.props,users:X.users,animate:z&&Z===void 0,align:J,className:B,children:H})}function v50({users:$,children:Z,animate:J=!1,align:H="center",className:B,...Q}){return A$.jsxs("div",{className:X0("relative pl-8",B),...Q,children:[Z,A$.jsx("div",{"data-align":H,className:"pointer-events-none absolute inset-y-0 left-0 flex items-center -space-x-3 data-[align=end]:items-end data-[align=start]:items-start","aria-hidden":"true",children:$.map(({id:X,connectionId:z})=>A$.jsx(K5.span,{layoutId:J?`presence:${z}`:void 0,children:A$.jsx(E6,{id:X,size:"sm",className:"animate-in duration-200 zoom-in-75 fade-in"})},X))})]})}var CD={Cursors:qS,User:BU,UserAvatar:E6,UserAvatarGroup:QU,PresenceFrame:NS,PresenceAvatars:LS,PresenceGroup:DS,useMe:JU,usePeers:GS,useUser:T6,useWorkspaceUsers:ZU,usePresence:US,usePublishPresence:YS};var MS=($)=>`moi:collab:${$}:session`,NU=()=>({selected:{},pinned:null});function S6($){try{let Z=sessionStorage.getItem(MS($));if(!Z)return NU();if(!Z.startsWith("{"))return{selected:{overview:Z},pinned:null};let J=JSON.parse(Z);if(!J||typeof J!=="object"||!("selected"in J))return NU();let H=J.selected;if(!H||typeof H!=="object"||Array.isArray(H))return NU();return{selected:Object.fromEntries(Object.entries(H).filter(([,B])=>typeof B==="string"||B===null)),pinned:null}}catch{return NU()}}function R6($,Z){try{sessionStorage.setItem(MS($),JSON.stringify({selected:Z.selected}))}catch{}}var KJ=P(m(),1);function q2($){return`draft:${$}`}function b2($,Z){return JSON.stringify([$,Z])}var g50=($)=>PS()(jS((Z)=>({discoveredWorkspacesOpen:!0,hasSentMessageFromMoi:!1,workspaceIdsPendingAnalysis:[],composerDrafts:{},dockedChatWidth:360,popupChatWidth:440,setDiscoveredWorkspacesOpen:(J)=>Z({discoveredWorkspacesOpen:J}),markWorkspacePendingAnalysis:(J)=>Z((H)=>{let B=H.workspaceIdsPendingAnalysis??[];return{workspaceIdsPendingAnalysis:B.includes(J)?B:[...B,J]}}),markMessageSentFromMoi:(J)=>Z((H)=>({hasSentMessageFromMoi:!0,workspaceIdsPendingAnalysis:(H.workspaceIdsPendingAnalysis??[]).filter((B)=>B!==J)})),setComposerDraft:(J,H)=>Z((B)=>{if(H===null?!(J in B.composerDrafts):B.composerDrafts[J]===H)return B;let Q={...B.composerDrafts};if(H===null)delete Q[J];else Q[J]=H;return{composerDrafts:Q}}),moveComposerDraft:(J,H)=>Z((B)=>{if(J===H||!(J in B.composerDrafts))return B;let Q={...B.composerDrafts};return Q[H]??=Q[J],delete Q[J],{composerDrafts:Q}}),setDockedChatWidth:(J)=>Z({dockedChatWidth:J}),setPopupChatWidth:(J)=>Z({popupChatWidth:J})}),{name:"moi:ui",...$?{storage:_S(()=>$)}:{}})),S1=g50();var R3={all:["app-ui"],sessionSelection:($)=>["app-ui","session-selection",$]};function c2($,Z="shared"){let J=R3.sessionSelection($);return Z==="browser-tab"?[...J,"browser-tab"]:J}function vB($,Z="shared"){return{queryKey:c2($,Z),queryFn:()=>Z==="browser-tab"?Promise.resolve(S6($)):G1(`/api/workspaces/${$}/selected-session`),staleTime:1/0,gcTime:0,refetchOnMount:!1,refetchOnWindowFocus:!1}}function f50($,Z){return[...c2($,Z),"save"]}function hB($,Z,J,H,B="shared"){let Q=c2(Z,B),X=$.getQueryData(Q),z=X?.selected[H]??null;if(X&&z===J&&(B==="shared"||(H in X.selected)))return null;let G={...X?.selected};if(J===null&&B==="shared")delete G[H];else G[H]=J;if($.setQueryData(Q,{selected:G,pinned:X?.pinned??null}),B==="browser-tab")R6(Z,{selected:G,pinned:null});return{sessionId:J,previousSessionId:z,tabId:H,scope:B}}function m50($,Z,J,H){let B=c2(Z,H.scope),Q=$.getQueryData(B),X=Q?.selected[H.tabId]??null;if(J.sessionId!==H.sessionId&&X!==J.sessionId)return"conflict";if(X!==H.sessionId&&X!==H.previousSessionId)return"ignored";let z={...Q?.selected};if(J.sessionId===null&&H.scope==="shared")delete z[H.tabId];else z[H.tabId]=J.sessionId;return $.setQueryData(B,{selected:z,pinned:Q?.pinned??null}),"applied"}function u50($,Z,J){if(J)return;$.invalidateQueries({queryKey:R3.sessionSelection(Z),exact:!0})}function AU($,Z,J,H){S1.getState().moveComposerDraft(b2(Z,J),b2(Z,H));for(let Q of["shared","browser-tab"])$.setQueryData(c2(Z,Q),(X)=>X?{selected:Object.fromEntries(Object.entries(X.selected).map(([z,G])=>[z,G===J?H:G])),pinned:X.pinned===J?H:X.pinned}:X);let B=S6(Z);R6(Z,{selected:Object.fromEntries(Object.entries(B.selected).map(([Q,X])=>[Q,X===J?H:X])),pinned:null})}function k3(){let $=TN()["*"];return m9($)?$:"overview"}function ED($,Z,J){if(!$)return;if($.pinned)return $.pinned;if(J&&Z in J.selected)return J.selected[Z]??null;return $.selected[Z]??null}function I3($){let Z=k3(),J=$??Z,H=f1(),Q=p2()?"browser-tab":"shared",X=X1(),z=KJ.useMemo(()=>c2(H,Q),[H,Q]),G=KJ.useMemo(()=>f50(H,Q),[H,Q]),U=PN({mutationKey:G,exact:!0}),Y=Y5(vB(H,Q)),K=OS().data,{mutate:F,mutateAsync:W}=E5({mutationKey:G,scope:{id:`selected-session:${H}`},mutationFn:(A)=>{if(A.scope==="browser-tab")return R6(H,X.getQueryData(z)??S6(H)),Promise.resolve({sessionId:A.sessionId});return G1(`/api/workspaces/${H}/selected-session`,y5("PUT",A),"Couldn’t save selected chat")},onSuccess:(A,V)=>{if(m50(X,H,A,V)!=="conflict")return;r1.add({title:"Couldn’t save selected chat",type:"error"}),X.invalidateQueries({queryKey:z,exact:!0})},onError:(A,V)=>{if((X.getQueryData(z)?.selected[V.tabId]??null)!==V.sessionId)return;r1.add({title:"Couldn’t save selected chat",type:"error"}),X.invalidateQueries({queryKey:z,exact:!0})},onSettled:()=>{if(Q==="shared"&&X.isMutating({mutationKey:G,exact:!0})===1)X.invalidateQueries({queryKey:z,exact:!0})}}),q=KJ.useCallback((A)=>{if(X.getQueryData(c2(H))?.pinned)return;let V=hB(X,H,A,J,Q);if(V)F(V)},[X,F,H,J,Q]),N=KJ.useCallback(async(A,V)=>{let L=hB(X,H,A,V,Q);if(!L)return;if((await W(L)).sessionId!==A||X.getQueryData(z)?.selected[V]!==A)throw Error("Couldn’t save selected chat")},[X,z,W,Q,H]);return N2((A)=>{if(A.type!=="selected-session:updated"||A.workspaceId!==H)return;u50(X,H,Q==="shared"&&U>0)}),[Y.data===void 0||K===void 0?void 0:ED(K,J,Q==="browser-tab"?Y.data:void 0),q,N]}function OS(){let $=f1();return Y5(vB($))}function k6(){let $=f1(),Z=X1(),{data:J}=OS(),H=E5({scope:{id:`pinned-session:${$}`},mutationFn:(B)=>G1(`/api/workspaces/${$}/pinned-session`,y5("PUT",{sessionId:B})),onMutate:(B)=>{let Q=R3.sessionSelection($),X=Z.getQueryData(Q)?.pinned??null;return Z.setQueryData(Q,(z)=>({selected:z?.selected??{},pinned:B})),X},onError:(B,Q,X)=>{Z.setQueryData(R3.sessionSelection($),(z)=>z?.pinned===Q?{...z,pinned:X??null}:z),r1.add({title:"Couldn’t pin chat",type:"error"})},onSettled:()=>{Z.invalidateQueries({queryKey:R3.sessionSelection($),exact:!0})}});return{pinnedSessionId:J?.pinned??null,loaded:J!==void 0,pin:H.mutate,pinAsync:H.mutateAsync}}var TS=P(m(),1);var G8={staleTime:0,gcTime:300000,refetchOnMount:!0,refetchOnWindowFocus:!0};function CS($){return{queryKey:j0.sessions($),queryFn:()=>G1(`/api/workspaces/${$}/sessions`),...G8}}function FJ($){return Y5(CS($))}function ES(){let $=f1(),Z=X1(),J=p2(),[,,H]=I3(),{pinAsync:B}=k6(),Q=W5({collabEnabled:J,selectSessionForTab:H,pinAsync:B});return TS.useCallback(async(X,z,G)=>{let{collabEnabled:U,selectSessionForTab:Y,pinAsync:K}=Q.current;G.throwIfAborted();let F=Z.getQueryData(j0.sessions($))??[];if(!F.some((q)=>q.sessionId===X))F=await Z.fetchQuery(CS($));if(G.throwIfAborted(),!F.some((q)=>q.sessionId===X))return!1;if(await Z.ensureQueryData(vB($)),U)await Z.ensureQueryData(vB($,"browser-tab"));G.throwIfAborted();let W=Z.getQueryData(c2($))?.pinned;if(W&&W!==X)await K(null),G.throwIfAborted();if(W!==X)await Y(X,z),G.throwIfAborted();return!0},[Z,Q,$])}function p50($,Z){return $?.filter((J)=>J.sessionId!==Z)}function bD($,Z,J){let H=j0.sessions(Z);$.cancelQueries({queryKey:H}),$.setQueryData(H,(B)=>p50(B,J)),$.removeQueries({queryKey:j0.events(Z,J)}),$.removeQueries({queryKey:j0.session(Z,J)});for(let B of["shared","browser-tab"]){let Q=c2(Z,B),X=$.getQueryData(Q)??(B==="browser-tab"?S6(Z):void 0);if(!X)continue;let z=X.pinned===J,G=Object.fromEntries(Object.entries(X.selected));for(let[Y,K]of Object.entries(G)){if(K!==J)continue;if(z=!0,B==="browser-tab")G[Y]=null;else delete G[Y]}if(!z)continue;let U={selected:G,pinned:X.pinned===J?null:X.pinned};if($.setQueryData(Q,U),B==="browser-tab")R6(Z,U)}$.invalidateQueries({queryKey:c2(Z),exact:!0})}function bS($){let Z=X1();return E5({mutationFn:(J)=>c4(`/api/workspaces/${$}/sessions/${J}/archive`,{method:"POST"},"Couldn’t archive chat"),onSuccess:(J,H)=>{bD(Z,$,H),Z.invalidateQueries({queryKey:j0.preview($)})}})}function wS($,Z){return Y5({...wb($,Z??""),enabled:Boolean(Z)})}function DU($,Z){return Y5({queryKey:j0.session($,Z??""),queryFn:()=>G1(`/api/workspaces/${$}/sessions/${Z}`),enabled:Boolean(Z),staleTime:1/0,gcTime:300000,refetchOnMount:!1,refetchOnWindowFocus:!1})}function SS($){let Z=X1();return E5({mutationFn:({patch:J,sessionId:H})=>G1(`/api/workspaces/${$}/sessions/${H}/config`,y5("PUT",J),"Failed to save chat settings"),onSuccess:(J,{sessionId:H})=>{Z.setQueryData(j0.session($,H),J)}})}function kS($,Z){let{queryClient:J,sendMessage:H,onWorkspaceSwitch:B}=Z,Q=k1.getState();if($.type==="status_snapshot"){Q.reconcileActivity($.sessions??[]);return}if($.type==="status"){let{workspaceId:U,sessionId:Y,activity:K}=$;if(Q.setActivity(U,Y,K),K!=="running")Q.clearPreviewsForSession(U,Y);return}if($.type==="preview"){let U=$,Y=j0.events(U.workspaceId,U.sessionId);if(J?.getQueryData(Y)===void 0)return;Q.setPreview({workspaceId:U.workspaceId,sessionId:U.sessionId,messageId:U.messageId,parentToolUseId:U.parentToolUseId,blocks:U.blocks});return}if($.type==="session_renamed"){let{workspaceId:U,from:Y,to:K}=$,F=j0.sessions(U),q=J?.getQueryData(F)?.find((A)=>A.sessionId===Y||A.sessionId===K);if(q)J?.cancelQueries({queryKey:F});if(Q.renameSession(U,Y,K),J)AU(J,U,Y,K);if(q)J?.setQueryData(F,(A)=>[{...q,sessionId:K},...(A??[]).filter((V)=>V.sessionId!==Y&&V.sessionId!==K)]);let N=J?.getQueryData(j0.events(U,Y));if(N!==void 0)J?.setQueryData(j0.events(U,K),N),J?.removeQueries({queryKey:j0.events(U,Y)});let D=J?.getQueryData(j0.session(U,Y));if(D!==void 0)J?.setQueryData(j0.session(U,K),D),J?.removeQueries({queryKey:j0.session(U,Y)});if(!q)J?.invalidateQueries({queryKey:F});J?.invalidateQueries({queryKey:j0.preview(U)});return}if($.type==="sessions_changed"||$.type==="session_archived"){let U=$.workspaceId;if(J&&$.type==="session_archived"&&typeof $.sessionId==="string")bD(J,U,$.sessionId);let Y=j0.sessions(U);if(J?.invalidateQueries({queryKey:Y}),J?.invalidateQueries({queryKey:j0.preview(U)}),typeof $.sessionId==="string")J?.invalidateQueries({queryKey:j0.session(U,$.sessionId)});return}if($.type==="workspace:switch"){B?.($.workspaceId);return}if($.type==="scratchpad:op"){let U=RS($.workspaceId);if(!U)return;let Y=$.opId;U($.op).then((K)=>H({type:"scratchpad:op-result",opId:Y,result:K}),(K)=>H({type:"scratchpad:op-result",opId:Y,error:K instanceof Error?K.message:String(K)}));return}let{workspaceId:X,sessionId:z}=$;if(!X||!z)return;let G=$.kind;if(G==="snapshot"||G==="turn"||G==="notice"||G==="result"){if(c50(J,X,z,$),G==="turn"){let U=$.turn?.meta?.apiMessageId;if(U)Q.clearPreview(U)}if(G==="result")Q.clearPreviewsForSession(X,z)}if(G==="error"&&typeof $.content==="string"){if(Q.setError(X,z,$.content),$.terminal!==!1)Q.setActivity(X,z,"idle"),Q.clearPreviewsForSession(X,z)}if(G==="stopped")Q.setActivity(X,z,"idle"),Q.clearPreviewsForSession(X,z)}function c50($,Z,J,H){if(!$)return;bb($,Z,J,H);let B=j0.events(Z,J),Q=$.getQueryData(B);if(Q===void 0)return;$.setQueryData(B,yG(Q,H))}var SD=null,WJ=null,VU=0,LU=null,wD=[],yS=null,IS=null,d50=15000;function xS($){if(SD=$,!IS)IS=setInterval(()=>k1.getState().sweepPreviews(d50,Date.now()),5000);if(WJ)return;hS()}function hS(){let $=++VU;if(LU)clearTimeout(LU),LU=null;let Z=new WebSocket(hG("/ws"));WJ=Z,Z.onopen=()=>{if(VU!==$){Z.close();return}for(let J of wD)Z.send(JSON.stringify(J));wD.length=0,SD?.invalidateQueries({queryKey:["workspaces","events"]}),k1.getState().clearAllPreviews()},Z.onmessage=(J)=>{if(VU!==$)return;let H;try{H=JSON.parse(J.data)}catch{return}l50(H)},Z.onclose=()=>{if(VU!==$)return;WJ=null,LU=setTimeout(hS,1000)},Z.onerror=()=>Z.close()}function l50($){kS($,{queryClient:SD,sendMessage:MU,onWorkspaceSwitch:yS})}function MU($){if(WJ&&WJ.readyState===WebSocket.OPEN)WJ.send(JSON.stringify($));else wD.push($)}function RD($){yS=$}var QN=P(m(),1);function vS($,Z){let J=$??[],H=J.findIndex((B)=>B.id===Z.id||B.path===Z.path);if(H===-1)return[Z,...J];return J.map((B,Q)=>Q===H?{...B,...Z}:B)}function PU(){return Y5({queryKey:j0.all,queryFn:()=>G1("/api/workspaces"),staleTime:1/0,refetchOnMount:"always"})}function _U($){return Y5({queryKey:j0.preview($),queryFn:()=>G1(`/api/workspaces/${$}/preview`),staleTime:60000})}function gS(){return Y5({queryKey:j0.discover,queryFn:()=>G1("/api/workspaces/discover")})}function fS(){let $=X1();return E5({mutationFn:(Z)=>G1("/api/workspaces",y5("POST",Z),"Failed to add workspace"),onSuccess:(Z,J)=>{S1.getState().markWorkspacePendingAnalysis(Z.id),$.setQueryData(j0.all,(H)=>vS(H,Z)),$.setQueryData(j0.discover,(H)=>(H??[]).filter((B)=>B.path!==J.path))}})}function jU(){return Y5({queryKey:j0.setupInfo,queryFn:()=>G1("/api/workspaces/create"),staleTime:30000,refetchOnMount:"always"})}function mS(){let $=X1();return E5({mutationFn:(Z)=>G1("/api/workspaces/create",y5("POST",Z),"Failed to create workspace"),onSuccess:(Z)=>{$.setQueryData(j0.all,(J)=>vS(J,Z))}})}function uS(){let $=X1();return E5({mutationFn:(Z)=>G1("/api/workspaces/order",y5("PUT",{ids:Z}),"Failed to reorder spaces"),onMutate:async(Z)=>{await $.cancelQueries({queryKey:j0.all,exact:!0});let J=$.getQueryData(j0.all);if(J){let H=new Map(J.map((Q)=>[Q.id,Q])),B=Z.map((Q)=>H.get(Q)).filter((Q)=>Boolean(Q));if(B.length===J.length)$.setQueryData(j0.all,B)}return{previous:J}},onError:(Z,J,H)=>{if(H?.previous)$.setQueryData(j0.all,H.previous);$.invalidateQueries({queryKey:j0.all,exact:!0})},onSuccess:(Z)=>{$.setQueryData(j0.all,Z)}})}function pS(){let $=X1();return E5({mutationFn:(Z)=>c4(`/api/workspaces/${Z}`,{method:"DELETE"},"Failed to remove workspace"),onSuccess:(Z,J)=>{$.setQueryData(j0.all,(H)=>(H??[]).filter((B)=>B.id!==J)),$.invalidateQueries({queryKey:j0.discover})}})}var aS=P(m(),1);var cS=P(c(),1);function U8({className:$,...Z}){return cS.jsx(x5,{"data-slot":"spinner",role:"status","aria-label":"Loading",className:o0("size-4 animate-spin",$),stroke:1.75,...Z})}var kD="Wait for active agents to finish, or stop them before updating moi";var i50=["update"],dS=300000,r50=1000;function lS($){return Y5({queryKey:i50,queryFn:()=>G1("/api/update"),staleTime:dS,refetchInterval:$?r50:dS,refetchOnWindowFocus:!0,retry:!1})}function iS(){return E5({mutationFn:()=>G1("/api/update",{method:"POST"},"Could not update moi")})}var y3=P(c(),1);function a50($,Z){return!!Z&&$?.runningVersion===Z}function o50($,Z,J){let H=Z||J,B=$&&!H;return{busy:H,blocked:B,label:Z?"Updating":J?"Restarting":B?kD:"Update"}}function oS(){let $=iS(),Z=lS($.isSuccess),J=B4((z)=>Tb(z.activity)),H=Z.data,B=$.data?.installedVersion??null;if(aS.useEffect(()=>{if(a50(H,B))window.location.reload()},[B,H]),Z.isPending)return{status:"loading"};if(!H?.availableVersion&&!$.isSuccess)return{status:"unavailable"};let Q=$.isSuccess;return{status:"available",button:{...o50(J,$.isPending,Q),errorMessage:$.error?.message??null,onClick:()=>$.mutate()}}}function nS({busy:$,blocked:Z,label:J,errorMessage:H,onClick:B}){return y3.jsxs(a1,{children:[y3.jsx(o1,{render:y3.jsx("div",{children:y3.jsx(P0,{type:"button",size:"icon",variant:$?"ghost":"default","aria-label":J,disabled:Z||$,onClick:B,children:$?y3.jsx(U8,{stroke:1.5}):y3.jsx(rS,{stroke:1.5})})})}),y3.jsx(n1,{side:"right",className:Z?"max-w-56":void 0,children:Z?kD:H??J})]})}var XQ=P(m(),1);var H9={};b5(H9,{createHandle:()=>NR,Viewport:()=>xU,Trigger:()=>vU,Title:()=>hU,Root:()=>KR,Portal:()=>kU,Popup:()=>RU,Handle:()=>qJ,Description:()=>EU,Close:()=>CU,Backdrop:()=>TU});var sS=P(m(),1);var OU=P(m(),1),ID=OU.createContext(void 0);function w2($){let Z=OU.useContext(ID);if(!$&&Z===void 0)throw Error(I0(27));return Z}var TU=sS.forwardRef(function(Z,J){let{render:H,className:B,style:Q,forceRender:X=!1,...z}=Z,G=w2(),U=G.useState("open"),Y=G.useState("nested"),K=G.useState("mounted"),F=G.useState("transitionStatus");return G0("div",Z,{state:{open:U,transitionStatus:F},ref:[G.context.backdropRef,J],stateAttributesMapping:t2,props:[{role:"presentation",hidden:!K,style:{userSelect:"none",WebkitUserSelect:"none"}},z],enabled:X||!Y})});var tS=P(m(),1);var CU=tS.forwardRef(function(Z,J){let{render:H,className:B,style:Q,disabled:X=!1,nativeButton:z=!0,...G}=Z,U=w2(),Y=U.useState("open"),{getButtonProps:K,buttonRef:F}=C5({disabled:X,native:z}),W={disabled:X};function q(N){if(Y)U.setOpen(!1,w0(K0.closePress,N.nativeEvent))}return G0("button",Z,{state:W,ref:[J,F],props:[{onClick:q},G,K]})});var eS=P(m(),1);var EU=eS.forwardRef(function(Z,J){let{render:H,className:B,style:Q,id:X,...z}=Z,G=w2(),U=t0(X);return G.useSyncedValueWithCleanup("descriptionElementId",U),G0("p",Z,{ref:J,props:[{id:U},z]})});var JR=P(m(),1);var bU=P(m(),1),yD=bU.createContext(void 0);function wU(){let $=bU.useContext(yD);if($===void 0)throw Error(I0(26));return $}var $R="--nested-dialogs";var Zh0=a7.open,Jh0=a7.closed,Hh0=a7.startingStyle,Bh0=a7.endingStyle;var ZR="data-nested-dialog-open";var SU={...J8,...B2,nestedDialogOpen($){return $?{[ZR]:""}:null}};var HR=P(c(),1),RU=JR.forwardRef(function(Z,J){let{render:H,className:B,style:Q,finalFocus:X,initialFocus:z,...G}=Z,U=w2(),Y=U.useState("descriptionElementId"),K=U.useState("disablePointerDismissal"),F=U.useState("floatingRootContext"),W=U.useState("popupProps"),q=U.useState("modal"),N=U.useState("mounted"),D=U.useState("nested"),A=U.useState("nestedOpenDialogCount"),V=U.useState("open"),L=U.useState("openMethod"),j=U.useState("titleElementId"),M=U.useState("transitionStatus"),_=U.useState("role"),w=F.useState("floatingId");wU(),A5({open:V,ref:U.context.popupRef,onComplete(){if(V)U.context.onOpenChangeComplete?.(!0)}});let T=z===void 0?ez(U.context.popupRef):z,b=A>0,C=U.useStateSetter("popupElement"),S=G0("div",Z,{state:{open:V,nested:D,transitionStatus:M,nestedDialogOpen:b},props:[W,{id:w,"aria-labelledby":j,"aria-describedby":Y,role:_,...E9,hidden:!N,onKeyDown(R){if(Z9.has(R.key))R.stopPropagation()},style:{[$R]:A}},G],ref:[J,U.context.popupRef,C],stateAttributesMapping:SU});return HR.jsx(B$,{context:F,openInteractionType:L,disabled:!N,closeOnFocusOut:!K,initialFocus:T,returnFocus:X,modal:q!==!1,restoreFocus:"popup",children:S})});var BR=P(m(),1);var gB=P(c(),1),kU=BR.forwardRef(function(Z,J){let{keepMounted:H=!1,...B}=Z,Q=w2(),X=Q.useState("mounted"),z=Q.useState("modal"),G=Q.useState("open");if(!(X||H))return null;return gB.jsx(yD.Provider,{value:H,children:gB.jsxs($$,{ref:J,...B,children:[X&&z===!0&&gB.jsx(aZ,{ref:Q.context.internalBackdropRef,inert:T8(!G)}),Z.children]})})});var YR=P(m(),1);var xD=P(m(),1);function QR({store:$,parentContext:Z,isDrawer:J}){let H=$.useState("open"),B=$.useState("disablePointerDismissal"),Q=$.useState("modal"),X=$.useState("popupElement"),z=$.useState("floatingRootContext"),[G,U]=xD.useState(0),[Y,K]=xD.useState(0),F=G===0,W=n8(z,{outsidePressEvent(){if($.context.internalBackdropRef.current||$.context.backdropRef.current)return"intentional";return{mouse:Q==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(q){if(!$.context.outsidePressEnabledRef.current)return!1;if("button"in q&&q.button!==0)return!1;if("touches"in q){if(q.type==="touchend"){if(q.changedTouches.length!==1||q.touches.length!==0)return!1}else if(q.touches.length!==1)return!1}let N=P1(q);if(F&&!B){if(Q){let D=$.context.internalBackdropRef.current,A=$.context.backdropRef.current;return D||A?D===N||A===N||R0(N,X)&&!N?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:F});return cG(H&&Q===!0,X),$.useContextCallback("onNestedDialogOpen",(q,N)=>{U(q),K(N)}),H0(()=>{if(Z?.onNestedDialogOpen)if(H)Z.onNestedDialogOpen(G+1,Y+(J?1:0));else Z.onNestedDialogOpen(0,0);return()=>{if(Z?.onNestedDialogOpen&&H)Z.onNestedDialogOpen(0,0)}},[J,H,G,Y,Z]),k9($,{activeTriggerProps:W.reference,inactiveTriggerProps:W.trigger,popupProps:W.floating,nestedOpenDialogCount:G,nestedOpenDrawerCount:Y}),null}var IU=P(m(),1);var XR={...y9,modal:($)=>$.modal,nested:($)=>$.nested,nestedOpenDialogCount:($)=>$.nestedOpenDialogCount,nestedOpenDrawerCount:($)=>$.nestedOpenDrawerCount,disablePointerDismissal:($)=>$.disablePointerDismissal,openMethod:($)=>$.openMethod,descriptionElementId:($)=>$.descriptionElementId,titleElementId:($)=>$.titleElementId,viewportElement:($)=>$.viewportElement,role:($)=>$.role};class hD extends h2{constructor($,Z,J){let H=new E2,B=GR($,H,Z,J);super(B,UR(H),XR)}setOpen=($,Z)=>{if(Z.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!$&&Z.trigger==null&&this.state.activeTriggerId!=null)Z.trigger=this.state.activeTriggerElement??void 0;if(this.context.onOpenChange?.($,Z),Z.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange($,Z),this.update(X$(this.state,$,Z.trigger))}}function zR(){let $=new E2;return new $9(Object.freeze(GR(void 0,$)),Object.freeze(UR($)),XR)}function GR($,Z,J,H=!1){return{...I9(Z,J,H),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...$}}function UR($){return{popupRef:IU.createRef(),backdropRef:IU.createRef(),internalBackdropRef:IU.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:$,onOpenChange:void 0,onOpenChangeComplete:void 0}}var fB=P(c(),1);function yU($,Z){let{children:J,open:H,defaultOpen:B=!1,onOpenChange:Q,onOpenChangeComplete:X,disablePointerDismissal:z=!1,modal:G=!0,actionsRef:U,handle:Y,triggerId:K,defaultTriggerId:F=null}=Z,W=$==="drawer",q=$==="alert-dialog",N=q?!0:G,D=q||z,A=q?"alertdialog":"dialog",V=w2(!0),L=V!=null,j={modal:N,disablePointerDismissal:D,nested:L,role:A},M=K6((k,S)=>new hD({open:B,openProp:H,activeTriggerId:F,triggerIdProp:K,...j},k,S),!0);M.useControlledProp("openProp",H),M.useControlledProp("triggerIdProp",K),M.useSyncedValues(j),M.useContextCallback("onOpenChange",Q),M.useContextCallback("onOpenChangeComplete",X);let _=M.useState("open"),w=M.useState("mounted"),T=M.useState("payload");ZG(M,_),S9(M);let{forceUnmount:b}=R9(_,M);YR.useImperativeHandle(U,()=>({unmount:b,close:()=>M.setOpen(!1,w0(K0.imperativeAction))}),[b,M]);let C=_||w;return fB.jsxs(ID.Provider,{value:M,children:[Y&&fB.jsx(b9,{handle:Y,store:M}),C&&fB.jsx(QR,{store:M,parentContext:V?.context,isDrawer:W}),typeof J==="function"?J({payload:T}):J]})}var KR=d8(function(Z){return yU("dialog",Z)});var FR=P(m(),1);var xU=FR.forwardRef(function(Z,J){let{render:H,className:B,style:Q,children:X,...z}=Z,G=wU(),U=w2(),Y=U.useState("open"),K=U.useState("nested"),F=U.useState("transitionStatus"),W=U.useState("nestedOpenDialogCount"),q=U.useState("mounted"),N=U.useStateSetter("viewportElement"),D=W>0;return G0("div",Z,{enabled:G||q,state:{open:Y,nested:K,transitionStatus:F,nestedDialogOpen:D},ref:[J,N],stateAttributesMapping:SU,props:[{role:"presentation",hidden:!q,style:{pointerEvents:!Y?"none":void 0},children:X},z]})});var WR=P(m(),1);var hU=WR.forwardRef(function(Z,J){let{render:H,className:B,style:Q,id:X,...z}=Z,G=w2(),U=t0(X);return G.useSyncedValueWithCleanup("titleElementId",U),G0("h2",Z,{ref:J,props:[{id:U},z]})});var qR=P(m(),1);var vU=P9(function(Z,J){let{render:H,className:B,style:Q,disabled:X=!1,nativeButton:z=!0,id:G,payload:U,handle:Y,...K}=Z,F=w2(!0),q=x9(Y)??F;if(!q)throw Error(I0(79));let N=t0(G),D=q.useState("floatingRootContext"),A=q.useState("isOpenedByTrigger",N),V=q.useState("triggerPopupId",N),L=qR.useRef(null),{registerTrigger:j,isMountedByThisTrigger:M}=w9(N,L,q,{payload:U}),{getButtonProps:_,buttonRef:w}=C5({disabled:X,native:z}),T=T3(D),b=bB(()=>q.select("open"),(S)=>{q.set("openMethod",S)}),C={disabled:X,open:A},k=q.useState("triggerProps",M);return G0("button",Z,{state:C,ref:[w,J,j,L],props:[T.reference,k,b,{[SZ]:"",id:N,"aria-haspopup":"dialog","aria-expanded":A,"aria-controls":V},K,_],stateAttributesMapping:_9})});class qJ extends s8{constructor(){super(zR(),"Dialog",!1)}open($){this.openByTrigger($)}openWithPayload($){let Z=this.attachedStore;if(Z===null)return;Z.set("payload",$),Z.setOpen(!0,w0(K0.imperativeAction))}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}function NR(){return new qJ}var Q4=P(c(),1);function I6({...$}){return Q4.jsx(H9.Root,{"data-slot":"dialog",...$})}function x3({...$}){return Q4.jsx(H9.Trigger,{"data-slot":"dialog-trigger",...$})}function t50({...$}){return Q4.jsx(w8,{portal:H9.Portal,"data-slot":"dialog-portal",...$})}function mB({...$}){return Q4.jsx(H9.Close,{"data-slot":"dialog-close",...$})}function e50({className:$,...Z}){return Q4.jsx(H9.Backdrop,{"data-slot":"dialog-overlay",className:o0("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",$),...Z})}function NJ({className:$,children:Z,showCloseButton:J=!0,...H}){return Q4.jsxs(t50,{children:[Q4.jsx(e50,{}),Q4.jsxs(H9.Popup,{"data-slot":"dialog-content",className:o0("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 rounded-xl bg-popover p-6 text-sm text-popover-foreground shadow-xl duration-100 outline-none sm:max-w-sm 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",$),...H,children:[Z,J&&Q4.jsxs(mB,{render:Q4.jsx(P0,{variant:"ghost",size:"icon-sm",className:"absolute top-4 right-4"}),children:[Q4.jsx(n5,{stroke:1.75}),Q4.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function y6({className:$,...Z}){return Q4.jsx(H9.Title,{"data-slot":"dialog-title",className:o0("text-lg font-semibold",$),...Z})}function AJ({className:$,...Z}){return Q4.jsx(H9.Description,{"data-slot":"dialog-description",className:o0("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",$),...Z})}var xR=P(m(),1);var nU={};b5(nU,{Validity:()=>IR,Root:()=>TR,Label:()=>ER,Item:()=>yR,Error:()=>bR,Description:()=>SR,Control:()=>RR});var R2=P(m(),1);var gU=P(m(),1);var AR="data-valid",DR="data-invalid";var D$={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Z20={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},VR={disabled:!1,...Z20},S2={valid($){if($===null)return null;if($)return{[AR]:""};return{[DR]:""}}};var J20={invalid:void 0,name:void 0,validityData:{state:D$,errors:[],error:"",value:"",initialValue:null},setValidityData:z1,disabled:void 0,setTouched:z1,setDirty:z1,setFilled:z1,setFocused:z1,validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:VR,registerFieldControl:z1,validation:{getValidationProps:($,Z=M1)=>Z,inputRef:{current:null},registeredInputs:new Map,registerInput:z1,getInputControl:()=>null,commit:async()=>{},change:z1}},vD=gU.createContext(J20);function i5($=!0){let Z=gU.useContext(vD);if(Z.setValidityData===z1&&!$)throw Error(I0(28));return Z}var fU=P(m(),1),H20=fU.createContext(void 0);function LR($=!1){let Z=fU.useContext(H20);if(!Z&&!$)throw Error(I0(86));return Z}var mU=P(m(),1);var B20=mU.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:z1,validationMode:"onSubmit",submitCountRef:{current:0}});function X4(){return mU.useContext(B20)}var x6=P(m(),1);var uU=P(m(),1);var gD=uU.createContext({controlId:void 0,registerControlId:z1,resetControlId:z1,labelId:void 0,setLabelId:z1,messageIds:[],setMessageIds:z1,getDescriptionProps:($)=>$});function r5(){return uU.useContext(gD)}var MR=P(c(),1),pU=function(Z){let J=t0(),[H,B]=x6.useState(J),[Q,X]=x6.useState(),[z,G]=x6.useState([]),U=H===void 0?J:H,Y=t1(()=>new Map),{messageIds:K}=r5(),F=Y0((D,A)=>{let V=Y.current;if(A===void 0)V.delete(D);else V.set(D,A);B((L)=>{if(V.size===0)return L;let j;for(let M of V.values()){if(M===L)return L;if(j===void 0)j=M}return j})}),W=Y0(()=>{if(Y.current.size===0)B(J)}),q=x6.useCallback((D)=>{let A=D["aria-describedby"]?D["aria-describedby"].split(" "):[];return A.push(...K,...z),{...D,"aria-describedby":Array.from(new Set(A)).join(" ")||void 0}},[K,z]),N=x6.useMemo(()=>({controlId:U,registerControlId:F,resetControlId:W,labelId:Q,setLabelId:X,messageIds:z,setMessageIds:G,getDescriptionProps:q}),[U,F,W,Q,X,z,G,q]);return MR.jsx(gD.Provider,{value:N,children:Z.children})};var h3=P(m(),1);function V$($,Z){return{...$,state:{...$.state,valid:!Z&&$.state.valid}}}var fD=Object.keys(D$);function Q20($,Z){if($.matches(":disabled"))return!1;if(!Z||$.form===Z)return!0;return $.form===null&&!$.hasAttribute("form")}function PR($,Z){let J=null;for(let H of $.keys()){if(!Q20(H,Z))continue;if(!H.validity.valid)return H;J??=H}return J}function _R($){return{...D$,valid:!$,customError:$}}function mD($){return $&&$.validationMessage?[$.validationMessage]:[]}function jR($){let{elementRef:Z,formRef:J}=X4(),{setValidityData:H,validate:B,validityData:Q,validationDebounceTime:X,invalid:z,markedDirtyRef:G,state:U,shouldValidateOnChange:Y,validationMode:K,registeredFieldIdRef:F}=$,{controlId:W,getDescriptionProps:q}=r5(),N=i1(),D=h3.useRef(null),A=t1(()=>new Map).current,V=h3.useRef(0),L=h3.useRef(null),j=h3.useCallback((b,C)=>{return A.set(b,C),()=>{A.delete(b)}},[A]),M=Y0(()=>{let b=PR(A,Z.current);return b&&A.get(b)?.controlRef.current||null}),_=Y0(async(b,C=!1)=>{V.current+=1;let k=V.current;function S(d,o=z){let p=F.current??W;if(p==null)return;let i=J.current.fields.get(p);if(!i)return;let n=V$(d,o);J.current.fields.set(p,{...i,validityData:n})}function R(d,o){let p=d.valid===!1?o:[];return{value:b,state:d,error:p[0]??"",errors:p,initialValue:Q.initialValue}}function O(d,o){let p=d.validity.customError?d.validationMessage:"",i=o.replace(/\r\n?/g,`
10
- `);d.setCustomValidity(i),L.current=[d,i,p]}function y(){let d=L.current;if(L.current=null,d&&(!d[0].willValidate||d[0].validationMessage===d[1]))d[0].setCustomValidity(d[2])}function I(d,o,p){let i=R(d,o);S(i,p),H(i)}function x(d){let o=fD.reduce((i,n)=>{return i[n]=d.validity[n],i},{}),p=!1;for(let i of fD){if(i==="valid")continue;if(i==="valueMissing"&&o[i])p=!0;else if(o[i])return o}if(p&&!G.current)o.valid=!0,o.valueMissing=!1;return o}function v(){return A.size>0?PR(A,Z.current):D.current}let g=v();function E(){return g=v(),g?.willValidate?x(g):_R(!1)}if(C){if(U.valid!==!1||!g)return;if(!g.validity.valueMissing){y();let d=v(),o=d?.validity.customError?mD(d):[];I(_R(o.length>0),o,!1);return}for(let d of fD)if(d!=="valid"&&d!=="valueMissing"&&d!=="customError"&&g.validity[d])return}N.clear(),y();let l=E(),r=mD(g),h=Y();if(r.length===0||h){let d=Array.from(J.current.fields.values()).reduce((i,n)=>{if(n.name)i[n.name]=n.getValue();return i},{}),o=B(b,d),p;if(typeof o==="object"&&o!==null&&"then"in o){if(l.valid===!1)I(l,r);else if(K==="onSubmit"||!Q.state.customError)l.valid=null,I(l,r);if(p=await o,k!==V.current)return;l=E()}else p=o;if(r=p?[].concat(p).filter(Boolean):[],r.length>0){if(l.valid=!1,l.customError=!0,g?.willValidate)O(g,r.join(`
11
- `))}else r=mD(g)}I(l,r)}),w=Y0((b,C=!1)=>{if(N.clear(),V.current+=1,C)return;let k=Y();if(k&&b!==""&&X)N.start(X,()=>{_(b)});else _(b,!k)}),T=h3.useCallback((b,C={})=>X2(q(C),U.valid===!1&&!U.disabled&&!b?{"aria-invalid":!0}:M1),[q,U.disabled,U.valid]);return h3.useMemo(()=>({getValidationProps:T,inputRef:D,registeredInputs:A,registerInput:j,getInputControl:M,commit:_,change:w}),[T,A,j,M,_,w])}var cU=P(m(),1);function OR($){let{change:Z,commit:J,invalid:H,markedDirtyRef:B,name:Q,setRegisteredFieldName:X,registeredFieldIdRef:z,setValidityData:G,validityData:U}=$,{formRef:Y}=X4(),K=cU.useRef(null),F=cU.useRef(null),W=cU.useRef(!1),q=Y0(()=>{let M=F.current;if(!M)return;if(M.getValue)return M.getValue();return M.value});function N(M){return M.value===void 0?q():M.value}let D=Y0(()=>{let M=F.current;if(B.current=!0,!M){J(U.value);return}J(N(M))});function A(){let M=F.current;if(!M||!M.id)return;Y.current.fields.set(M.id,{getValue:q,name:Q??M.name,controlRef:M.controlRef,validityData:V$(U,H),validate:D})}function V(M=F.current?.id){if(M)Y.current.fields.delete(M)}function L(M){if(W.current)return;W.current=!0;let _=N(M);G((w)=>w.initialValue===_?w:{...w,initialValue:_})}H0(()=>{let M=F.current;if(!M||!M.id)return;X(Q?void 0:M.name),Y.current.fields.set(M.id,{getValue:q,name:Q??M.name,controlRef:M.controlRef,validityData:V$(U,H),validate:D})},[Y,q,H,Q,X,D,U]),H0(()=>{let M=Y.current.fields;return()=>{let _=F.current?.id;if(_)M.delete(_)}},[Y]);let j=Y0((M,_)=>{if(!_){if(K.current===M)K.current=null,Z(void 0,!0),V(),F.current=null,X(void 0),z.current=void 0;return}let w=F.current?.id,T=K.current;if(T&&T!==M)Z(void 0,!0);if(K.current=M,F.current=_,!Q)X(_.name);if(z.current=_.id,w&&w!==_.id)V(w);L(_),A()});return[D,j]}var dU=P(c(),1),X20=R2.forwardRef(function(Z,J){let{errors:H,validationMode:B,submitCountRef:Q}=X4(),{render:X,className:z,validate:G,validationDebounceTime:U=0,validationMode:Y=B,name:K,disabled:F=!1,invalid:W,dirty:q,touched:N,actionsRef:D,style:A,...V}=Z,L=LR(!0)?.disabled,j=Y0(G||(()=>null)),M=L||F,[_,w]=R2.useState(!1),[T,b]=R2.useState(!1),[C,k]=R2.useState(!1),[S,R]=R2.useState(!1),O=q??T,y=N??_,I=R2.useRef(O),x=R2.useRef(void 0),[v,g]=R2.useState(),E=K??v;H0(()=>{if(q!==void 0)I.current=q},[q]);let l=Y0((F0)=>{if(q!==void 0)return;if(F0)I.current=!0;b(F0)}),r=Y0((F0)=>{if(N!==void 0)return;w(F0)}),h=Y0(()=>Y==="onChange"||Y==="onSubmit"&&Q.current>0),d=E&&Object.hasOwn(H,E)?H[E]:null,o=!!(Array.isArray(d)?d.length:d),p=W===!0||o,[i,n]=R2.useState({state:D$,error:"",errors:[],value:null,initialValue:null}),Z0=!p&&(M?null:i.state.valid),J0=R2.useMemo(()=>({disabled:M,touched:y,dirty:O,valid:Z0,filled:C,focused:S}),[M,y,O,Z0,C,S]),U0=jR({setValidityData:n,validate:j,validityData:i,validationDebounceTime:U,invalid:p,markedDirtyRef:I,state:J0,shouldValidateOnChange:h,validationMode:Y,registeredFieldIdRef:x}),[z0,B0]=OR({change:U0.change,commit:U0.commit,invalid:p,markedDirtyRef:I,name:K,setRegisteredFieldName:g,registeredFieldIdRef:x,setValidityData:n,validityData:i});R2.useImperativeHandle(D,()=>({validate:z0}),[z0]);let N0=R2.useMemo(()=>({invalid:p,name:E,validityData:i,setValidityData:n,disabled:M,setTouched:r,setDirty:l,setFilled:k,setFocused:R,validationMode:Y,shouldValidateOnChange:h,state:J0,registerFieldControl:B0,validation:U0}),[p,E,i,M,r,l,k,R,Y,h,J0,B0,U0]),D0=G0("div",Z,{ref:J,state:J0,props:V,stateAttributesMapping:S2});return dU.jsx(vD.Provider,{value:N0,children:D0})}),TR=R2.forwardRef(function(Z,J){return dU.jsx(pU,{children:dU.jsx(X20,{...Z,ref:J})})});var uB=P(m(),1);function CR($,Z){let J=t0($);return H0(()=>{return Z(J),()=>{Z((H)=>H===J?void 0:H)}},[J,Z]),J}function lU($={}){let{id:Z,fallbackControlId:J,native:H=!1,setLabelId:B,focusControl:Q}=$,{controlId:X,setLabelId:z}=r5(),G=Y0((W)=>{z(W),B?.(W)}),U=CR(Z,G),Y=X??J;function K(W){if(Q){Q(W,Y);return}if(!Y)return;let q=f0(W.currentTarget).getElementById(Y);if(_1(q))iU(q)}function F(W){if(P1(W.nativeEvent)?.closest("button,input,select,textarea"))return;if(!W.defaultPrevented&&W.detail>1)W.preventDefault();if(H)return;K(W)}return H?{id:U,htmlFor:Y,onMouseDown:F}:{id:U,onClick:F,onPointerDown(W){W.preventDefault()}}}function iU($){$.focus({focusVisible:!0})}var rU=P(m(),1),uD=rU.createContext({disabled:!1});function DJ(){return rU.useContext(uD)}var ER=uB.forwardRef(function(Z,J){let{render:H,className:B,style:Q,id:X,nativeLabel:z=!0,...G}=Z,U=i5(!1),Y=DJ(),{labelId:K}=r5(),F={...U.state,disabled:U.disabled||Y.disabled},W=uB.useRef(null),q=lU({id:K??X,native:z});return G0("label",Z,{ref:[J,W],state:F,props:[q,G],stateAttributesMapping:S2})});var L$=P(m(),1);var pD=P(c(),1),z20={...S2,...B2},bR=L$.forwardRef(function(Z,J){let{render:H,id:B,className:Q,match:X,style:z,...G}=Z,U=t0(B),{validityData:Y,state:K,name:F}=i5(!1),{setMessageIds:W}=r5(),{errors:q}=X4(),N=F&&Object.hasOwn(q,F)?q[F]:null,D=!!(Array.isArray(N)?N.length:N),A=typeof X==="string",V=!1;if(X===!0)V=!0;else if(K.disabled)V=!1;else if(A)V=Boolean(Y.state[X]);else V=D||Y.state.valid===!1;let{mounted:L,transitionStatus:j,setMounted:M}=C2(V);H0(()=>{if(!V||!U)return;return W((I)=>I.concat(U)),()=>{W((I)=>I.filter((x)=>x!==U))}},[V,U,W]);let _=L$.useRef(null),[w,T]=L$.useState(null),[b,C]=L$.useState(null),k=Y.error;if(!A&&D)k=N;else if(Y.errors.length>1)k=Y.errors;let S=k;if(Array.isArray(k))S=k.length>1?pD.jsx("ul",{children:k.map((I)=>pD.jsx("li",{children:I},I))}):k[0];let R=Array.isArray(k)?JSON.stringify(k):k;if(V&&R!==b)C(R),T(S);A5({open:V,ref:_,onComplete(){if(!V)M(!1)}});let O={...K,transitionStatus:j},y=G0("div",Z,{ref:[J,_],state:O,props:[{id:U,children:V?S:w},G],stateAttributesMapping:z20,enabled:L});if(!L)return null;return y});var wR=P(m(),1);var SR=wR.forwardRef(function(Z,J){let{render:H,id:B,className:Q,style:X,...z}=Z,G=t0(B),U=i5(!1),Y=DJ(),{setMessageIds:K}=r5(),F={...U.state,disabled:U.disabled||Y.disabled};return H0(()=>{if(!G)return;return K((q)=>q.concat(G)),()=>{K((q)=>q.filter((N)=>N!==G))}},[G,K]),G0("p",Z,{ref:J,state:F,props:[{id:G},z],stateAttributesMapping:S2})});var aU=P(m(),1);var M$=P(m(),1);function z4({controlled:$,default:Z,name:J,state:H="value"}){let{current:B}=M$.useRef($!==void 0),[Q,X]=M$.useState(Z),z=B&&$!==void 0?$:Q,G=M$.useCallback((U)=>{if(!B)X(U)},[]);return[z,G]}function h6($,Z,J,H,B=!0,Q){let{registerFieldControl:X}=i5(),z=t1(()=>Symbol());H0(()=>{let G=z.current;if(!B){X(G,void 0);return}X(G,{controlRef:$,getValue:H,id:Z,name:Q,value:J})},[$,B,H,Z,Q,X,z,J]),H0(()=>{let G=z.current;return()=>{X(G,void 0)}},[X,z])}var cD=P(m(),1);function v6($={}){let{id:Z,enabled:J=!0}=$,{controlId:H,registerControlId:B,resetControlId:Q}=r5(),X=t0(),z=t1(()=>Symbol()),G=cD.useRef(!1),U=cD.useRef(!1),Y=Y0(()=>{if(!G.current||B===z1)return;G.current=!1,B(z.current,void 0)});return H0(()=>{if(!J||B===z1){Y();return}let K;if(Z!==void 0)U.current=!0,K=Z;else if(U.current)K=X;else{Q();return}if(K===void 0){Y();return}G.current=!0,B(z.current,K);return},[Z,J,B,Q,X,z,Y]),H0(()=>{return Y},[Y]),(J?H:void 0)??Z??X}var RR=aU.forwardRef(function(Z,J){let{render:H,className:B,id:Q,name:X,value:z,disabled:G=!1,onValueChange:U,defaultValue:Y,autoFocus:K=!1,style:F,...W}=Z,{state:q,name:N,disabled:D,setTouched:A,setDirty:V,validityData:L,setFocused:j,setFilled:M,validationMode:_,validation:w}=i5(),{clearErrors:T,elementRef:b,submitCountRef:C}=X4(),k=D||G,S=N??X,R={...q,disabled:k},{labelId:O}=r5(),y=v6({id:Q}),[I]=z4({controlled:z,default:Y,name:"FieldControl",state:"value"}),x=z!==void 0,v=x?I:void 0,g=v==null?void 0:String(v),E=Y0(()=>w.inputRef.current?.value);h6(w.inputRef,y,g,E,!k,X),H0(()=>{let d=g??w.inputRef.current?.value;if(d!==void 0)M(d!=="")},[g,w.inputRef,M]),p9(g,()=>{if(g===void 0)return;T(S),V(g!==(L.initialValue??"")),w.change(g)});let l=aU.useRef(null),r=i1();return H0(()=>{if(K&&l.current===d1(f0(l.current)))j(!0)},[K,j]),G0("input",Z,{ref:[J,l],state:R,props:[{id:y,disabled:k,name:S,ref:w.inputRef,"aria-labelledby":O,autoFocus:K,...x?{value:v}:{defaultValue:Y},onChange(d){let o=d.currentTarget.value,p=w0(K0.none,d.nativeEvent);if(U?.(o,p),x)return;if(V(o!==(L.initialValue??"")),M(o!==""),!d.nativeEvent.defaultPrevented&&!p.isCanceled)T(S),w.change(o)},onFocus(){j(!0)},onBlur(d){if(A(!0),j(!1),_==="onBlur"){let o=d.currentTarget.value;if(w.commit(o),x)queueMicrotask(()=>{let p=w.inputRef.current?.value;if(p!==void 0&&p!==o&&p!==(L.initialValue??""))w.commit(p)})}},onKeyDown(d){if(d.currentTarget.tagName==="INPUT"&&d.key==="Enter"){A(!0);let o=d.currentTarget.value,p=d.currentTarget.form;if(p&&p===b.current&&!d.defaultPrevented){let i=d.currentTarget,n=C.current;r.start(0,()=>{if(C.current===n)w.commit(i.value)})}else w.commit(o)}}},W,(d)=>w.getValidationProps(k,d)],stateAttributesMapping:S2})});var pB=P(m(),1);var kR=P(c(),1),IR=function(Z){let{children:J}=Z,{validityData:H,invalid:B}=i5(!1),Q=pB.useMemo(()=>V$(H,B),[H,B]),X=Q.state.valid===!1,{transitionStatus:z}=C2(X),G=pB.useMemo(()=>{return{...Q,validity:Q.state,transitionStatus:z}},[Q,z]);return kR.jsx(pB.Fragment,{children:J(G)})};var oU=P(m(),1);var dD=P(c(),1),yR=oU.forwardRef(function(Z,J){let{render:H,className:B,style:Q,disabled:X=!1,...z}=Z,{state:G,disabled:U}=i5(!1),Y=U||X,K={...G,disabled:Y},F=oU.useMemo(()=>({disabled:Y}),[Y]),W=G0("div",Z,{ref:J,state:K,props:z,stateAttributesMapping:S2});return dD.jsx(pU,{children:dD.jsx(uD.Provider,{value:F,children:W})})});var hR=P(c(),1),cB=xR.forwardRef(function(Z,J){return hR.jsx(nU.Control,{ref:J,...Z})});var vR=P(c(),1);function P$({className:$,type:Z,...J}){return vR.jsx(cB,{type:Z,"data-slot":"input",className:o0("h-8 w-full min-w-0 rounded-lg border bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",$),...J})}function gR($){if(!$)return"Folder name is required";if($.length>64)return"Folder name is too long (max 64 characters)";if(!/^[A-Za-z0-9][A-Za-z0-9._ -]*$/.test($))return"Use letters, numbers, dots, dashes, underscores and spaces, starting with a letter or number";if($.endsWith(".")||$.endsWith(" "))return"Folder name cannot end with a dot or space";return null}var VJ=["claude-code","codex","openclaw","hermes"];var LJ=P(m(),1);var sU="/claude-z2xnay0d.svg";var fR="/floppy-disk-wmjs0n85.webp";var tU="/hermes-pznd63x9.png";var eU="/openai-ep9ht2pq.svg";var $Y="/openclaw-a2pyfhpn.svg";var Y1=P(c(),1),dR="Set up the moi workspace for this project. Fetch https://moi.computer/INSTALL.md, and follow the steps.";function MJ({trigger:$,open:Z,onOpenChange:J}){return Y1.jsxs(I6,{open:Z,onOpenChange:J,children:[$&&Y1.jsx(x3,{render:$}),Y1.jsx(N20,{})]})}var mR=2;function W20({demoInstallUrl:$}){let Z=LJ.useRef(null);return Y1.jsx("div",{className:"relative min-h-56 overflow-hidden md:min-h-full",onMouseMove:(B)=>{if(!Z.current)return;let Q=B.currentTarget.getBoundingClientRect(),X=(B.clientX-Q.left)/Q.width-0.5,z=(B.clientY-Q.top)/Q.height-0.5;Z.current.style.setProperty("--floppy-x",`${X*-2*mR}px`),Z.current.style.setProperty("--floppy-y",`${z*-2*mR}px`)},onMouseLeave:()=>{Z.current?.style.removeProperty("--floppy-x"),Z.current?.style.removeProperty("--floppy-y")},children:Y1.jsxs("a",{ref:Z,href:$,target:"_blank",rel:"noreferrer",className:"group absolute top-1/2 left-1/2 w-44 -translate-x-1/2 -translate-y-1/2 rotate-4 [transform:translate3d(var(--floppy-x,0px),var(--floppy-y,0px),0)] rounded-lg transition-transform duration-150 ease-out will-change-transform outline-none focus-visible:ring-3 focus-visible:ring-ring/50 motion-reduce:transform-none motion-reduce:transition-none md:w-40",children:[Y1.jsx("img",{src:fR,alt:"",className:"w-full drop-shadow-xl"}),Y1.jsxs("div",{className:_$({variant:"outline",className:"absolute -right-3 -bottom-2 -rotate-8"}),children:["About moi",Y1.jsx(uR,{"data-icon":"inline-end",stroke:1.5})]})]})})}function q20(){let[$,Z]=LJ.useState(!1);return LJ.useEffect(()=>{if(!$)return;let H=setTimeout(()=>Z(!1),1500);return()=>clearTimeout(H)},[$]),{copied:$,copy:()=>{navigator.clipboard?.writeText(dR).then(()=>Z(!0)).catch(()=>{})}}}function N20(){let{demoInstallUrl:$}=R8(),{copied:Z,copy:J}=q20();return Y1.jsxs(NJ,{"data-vivid":!0,showCloseButton:!1,className:"block w-full max-w-md overflow-hidden rounded-2xl bg-primary texture-checker-16 p-2 text-primary-foreground sm:max-w-md md:max-w-2xl",children:[Y1.jsx("div",{className:"absolute inset-0 bg-[linear-gradient(to_right,color-mix(in_oklch,var(--background)_14%,transparent),color-mix(in_oklch,var(--background)_6%,transparent))]"}),Y1.jsxs("svg",{className:"pointer-events-none absolute inset-0 size-full opacity-30 mix-blend-soft-light","aria-hidden":"true",children:[Y1.jsx("filter",{id:"floppy-grain",children:Y1.jsx("feTurbulence",{type:"fractalNoise",baseFrequency:"0.8",numOctaves:"2",stitchTiles:"stitch"})}),Y1.jsx("rect",{width:"100%",height:"100%",filter:"url(#floppy-grain)"})]}),Y1.jsxs("div",{className:"relative grid max-h-[calc(100dvh-2rem)] overflow-y-auto md:grid-cols-[3fr_2fr] md:overflow-visible",children:[Y1.jsxs("div",{className:"rounded-xl bg-background p-6 text-foreground shadow-sm md:p-8",children:[Y1.jsxs("div",{className:"flex flex-col gap-0.5",children:[Y1.jsx(y6,{children:"Unlock all features"}),Y1.jsx(AJ,{className:"mt-1",children:"This is a demo version with sample workspaces. Install moi locally and connect to your agent."})]}),Y1.jsxs("ul",{className:"mt-4 flex flex-col gap-3",children:[Y1.jsxs("li",{className:"flex items-center gap-3",children:[Y1.jsx(pR,{stroke:0.75,className:"mt-0.5 size-8 shrink-0 text-muted-foreground"}),Y1.jsx("span",{className:"text-sm text-foreground",children:"Connect your own data sources and work on existing projects"})]}),Y1.jsxs("li",{className:"flex items-center gap-3",children:[Y1.jsx(cR,{stroke:0.75,className:"mt-0.5 size-8 shrink-0 text-muted-foreground"}),Y1.jsxs("span",{className:"flex flex-wrap items-center gap-x-1 gap-y-0.5 text-sm text-foreground",children:[Y1.jsx("span",{children:"Build with"}),Y1.jsxs("span",{className:"inline-flex items-center gap-1 font-medium",children:[Y1.jsx("img",{src:sU,alt:"",className:"size-3.5 object-contain"}),"Claude Code,"]}),Y1.jsxs("span",{className:"inline-flex items-center gap-1 font-medium",children:[Y1.jsx("img",{src:eU,alt:"",className:"size-3.5 object-contain"}),"Codex,"]}),Y1.jsxs("span",{className:"inline-flex items-center gap-1 font-medium",children:[Y1.jsx("img",{src:tU,alt:"",className:"size-3.5 object-contain"}),"Hermes,"]}),Y1.jsxs("span",{className:"inline-flex items-center gap-1 font-medium",children:[Y1.jsx("img",{src:$Y,alt:"",className:"size-3.5 object-contain"}),"OpenClaw,"]}),Y1.jsx("span",{children:"and more"})]})]})]}),Y1.jsxs("div",{className:"mt-8 flex flex-col gap-3 pb-4",children:[Y1.jsx("p",{className:"text-sm text-muted-foreground",children:"Give this prompt to your agent:"}),Y1.jsxs("div",{className:"relative rounded-lg bg-muted p-4 pb-8 ring-1 ring-border",children:[Y1.jsx("code",{className:"block font-mono text-sm leading-relaxed text-foreground",children:dR}),Y1.jsxs(P0,{type:"button",onClick:J,className:"absolute right-4 -bottom-4",children:[Z?Y1.jsx(S8,{"data-icon":"inline-start",stroke:1.5}):Y1.jsx(ZY,{"data-icon":"inline-start",stroke:1.5}),Z?"Copied":"Copy prompt"]})]})]})]}),Y1.jsx(W20,{demoInstallUrl:$})]}),Y1.jsx(mB,{render:Y1.jsx(P0,{variant:"outline",size:"icon","aria-label":"Close",className:"absolute top-4 right-4",children:Y1.jsx(n5,{stroke:1.5})})})]})}var Fy=P(m(),1);var Yy=P(m(),1);var lD=["rocket","sparkles","bolt","flame","star","heart","diamond","trophy","target","bulb","brain","robot","wand","atom","flask","cpu","code","terminal","api","database","cube","hexagon","plug","tool","settings","dots","bug","activity","chart","briefcase","folder","file","book","message","mail","bell","paperclip","key","shield","user","home","globe","world","planet","compass","map","calendar","cloud","sun","moon","snowflake","leaf","mountain","feather","ghost","music","piano","camera","photo","palette","gamepad","gift","cart","chef"],A20=new Set(lD);function lR($){return A20.has($)}var ak={rocket:xk,sparkles:fk,bolt:dB,flame:qk,star:mk,heart:Mk,diamond:Fk,trophy:lk,target:pk,bulb:$k,brain:sR,robot:yk,wand:ik,atom:aR,flask:Nk,cpu:Gk,code:Xk,terminal:ck,api:rR,database:Yk,cube:Uk,hexagon:Pk,plug:Ik,tool:dk,settings:g6,dots:JY,bug:eR,activity:iR,chart:Hk,briefcase:tR,folder:Ak,file:PJ,book:nR,message:Ck,mail:Ok,bell:oR,paperclip:BY,key:HY,shield:hk,user:HU,home:_k,globe:Lk,world:rk,planet:kk,compass:zk,map:Tk,calendar:Zk,cloud:Qk,sun:uk,moon:Ek,snowflake:gk,leaf:jk,mountain:bk,feather:Wk,ghost:Dk,music:wk,piano:QY,camera:Jk,photo:Rk,palette:Sk,gamepad:Kk,gift:Vk,cart:vk,chef:Bk},ok=lD.map(($)=>({id:$,Icon:ak[$]}));function XY($){return $&&lR($)?ak[$]:null}var D20=($,Z)=>{if(typeof $!=="number")return;if(Z===3)return{mode:"rgb",r:($>>8&15|$>>4&240)/255,g:($>>4&15|$&240)/255,b:($&15|$<<4&240)/255};if(Z===4)return{mode:"rgb",r:($>>12&15|$>>8&240)/255,g:($>>8&15|$>>4&240)/255,b:($>>4&15|$&240)/255,alpha:($&15|$<<4&240)/255};if(Z===6)return{mode:"rgb",r:($>>16&255)/255,g:($>>8&255)/255,b:($&255)/255};if(Z===8)return{mode:"rgb",r:($>>24&255)/255,g:($>>16&255)/255,b:($>>8&255)/255,alpha:($&255)/255}},zY=D20;var V20={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},nk=V20;var L20=($)=>{return zY(nk[$.toLowerCase()],6)},sk=L20;var M20=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,P20=($)=>{let Z;return(Z=$.match(M20))?zY(parseInt(Z[1],16),Z[1].length):void 0},tk=P20;var GY="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)";var j$="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%";var lB="(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?))";var ek="(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)(deg|grad|rad|turn)|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?))";var f6="\\s*,\\s*";var vm0=new RegExp("^(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)|none)$");var _20=new RegExp(`^rgba?\\(\\s*${GY}${f6}${GY}${f6}${GY}\\s*(?:,\\s*${lB}\\s*)?\\)$`),j20=new RegExp(`^rgba?\\(\\s*${j$}${f6}${j$}${f6}${j$}\\s*(?:,\\s*${lB}\\s*)?\\)$`),O20=($)=>{let Z={mode:"rgb"},J;if(J=$.match(_20)){if(J[1]!==void 0)Z.r=J[1]/255;if(J[2]!==void 0)Z.g=J[2]/255;if(J[3]!==void 0)Z.b=J[3]/255}else if(J=$.match(j20)){if(J[1]!==void 0)Z.r=J[1]/100;if(J[2]!==void 0)Z.g=J[2]/100;if(J[3]!==void 0)Z.b=J[3]/100}else return;if(J[4]!==void 0)Z.alpha=Math.max(0,Math.min(1,J[4]/100));else if(J[5]!==void 0)Z.alpha=Math.max(0,Math.min(1,+J[5]));return Z},$I=O20;var T20=($,Z)=>$===void 0?void 0:typeof $!=="object"?JI($):$.mode!==void 0?$:Z?{...$,mode:Z}:void 0,ZI=T20;var C20=($="rgb")=>(Z)=>(Z=ZI(Z,$))!==void 0?Z.mode===$?Z:B9[Z.mode][$]?B9[Z.mode][$](Z):$==="rgb"?B9[Z.mode].rgb(Z):B9.rgb[$](B9[Z.mode].rgb(Z)):void 0,UY=C20;var B9={},HI={},iB=[],iD={},E20=($)=>$,z5=($)=>{if(B9[$.mode]={...B9[$.mode],...$.toMode},Object.keys($.fromMode||{}).forEach((Z)=>{if(!B9[Z])B9[Z]={};B9[Z][$.mode]=$.fromMode[Z]}),!$.ranges)$.ranges={};if(!$.difference)$.difference={};return $.channels.forEach((Z)=>{if($.ranges[Z]===void 0)$.ranges[Z]=[0,1];if(!$.interpolate[Z])throw Error(`Missing interpolator for: ${Z}`);if(typeof $.interpolate[Z]==="function")$.interpolate[Z]={use:$.interpolate[Z]};if(!$.interpolate[Z].fixup)$.interpolate[Z].fixup=E20}),HI[$.mode]=$,($.parse||[]).forEach((Z)=>{b20(Z,$.mode)}),UY($.mode)},BI=($)=>HI[$],b20=($,Z)=>{if(typeof $==="string"){if(!Z)throw Error("'mode' required when 'parser' is a string");iD[$]=Z}else if(typeof $==="function"){if(iB.indexOf($)<0)iB.push($)}};var rD=/[^\x00-\x7F]|[a-zA-Z_]/,w20=/[^\x00-\x7F]|[-\w]/,O0={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"},K1=0;function YY($){let Z=$[K1],J=$[K1+1];if(Z==="-"||Z==="+")return/\d/.test(J)||J==="."&&/\d/.test($[K1+2]);if(Z===".")return/\d/.test(J);return/\d/.test(Z)}function aD($){if(K1>=$.length)return!1;let Z=$[K1];if(rD.test(Z))return!0;if(Z==="-"){if($.length-K1<2)return!1;let J=$[K1+1];if(J==="-"||rD.test(J))return!0;return!1}return!1}var S20={deg:1,rad:180/Math.PI,grad:0.9,turn:360};function rB($){let Z="";if($[K1]==="-"||$[K1]==="+")Z+=$[K1++];if(Z+=KY($),$[K1]==="."&&/\d/.test($[K1+1]))Z+=$[K1++]+KY($);if($[K1]==="e"||$[K1]==="E"){if(($[K1+1]==="-"||$[K1+1]==="+")&&/\d/.test($[K1+2]))Z+=$[K1++]+$[K1++]+KY($);else if(/\d/.test($[K1+1]))Z+=$[K1++]+KY($)}if(aD($)){let J=FY($);if(J==="deg"||J==="rad"||J==="turn"||J==="grad")return{type:O0.Hue,value:Z*S20[J]};return}if($[K1]==="%")return K1++,{type:O0.Percentage,value:+Z};return{type:O0.Number,value:+Z}}function KY($){let Z="";while(/\d/.test($[K1]))Z+=$[K1++];return Z}function FY($){let Z="";while(K1<$.length&&w20.test($[K1]))Z+=$[K1++];return Z}function R20($){let Z=FY($);if($[K1]==="(")return K1++,{type:O0.Function,value:Z};if(Z==="none")return{type:O0.None,value:void 0};return{type:O0.Ident,value:Z}}function k20($=""){let Z=$.trim(),J=[],H;K1=0;while(K1<Z.length){if(H=Z[K1++],H===`
12
- `||H==="\t"||H===" "){while(K1<Z.length&&(Z[K1]===`
13
- `||Z[K1]==="\t"||Z[K1]===" "))K1++;continue}if(H===",")return;if(H===")"){J.push({type:O0.ParenClose});continue}if(H==="+"){if(K1--,YY(Z)){J.push(rB(Z));continue}return}if(H==="-"){if(K1--,YY(Z)){J.push(rB(Z));continue}if(aD(Z)){J.push({type:O0.Ident,value:FY(Z)});continue}return}if(H==="."){if(K1--,YY(Z)){J.push(rB(Z));continue}return}if(H==="/"){while(K1<Z.length&&(Z[K1]===`
14
- `||Z[K1]==="\t"||Z[K1]===" "))K1++;let B;if(YY(Z)){if(B=rB(Z),B.type!==O0.Hue){J.push({type:O0.Alpha,value:B});continue}}if(aD(Z)){if(FY(Z)==="none"){J.push({type:O0.Alpha,value:{type:O0.None,value:void 0}});continue}}return}if(/\d/.test(H)){K1--,J.push(rB(Z));continue}if(rD.test(H)){K1--,J.push(R20(Z));continue}return}return J}function I20($){$._i=0;let Z=$[$._i++];if(!Z||Z.type!==O0.Function||Z.value!=="color")return;if(Z=$[$._i++],Z.type!==O0.Ident)return;let J=iD[Z.value];if(!J)return;let H={mode:J},B=QI($,!1);if(!B)return;let Q=BI(J).channels;for(let X=0,z,G;X<Q.length;X++)if(z=B[X],G=Q[X],z.type!==O0.None){if(H[G]=z.type===O0.Number?z.value:z.value/100,G==="alpha")H[G]=Math.max(0,Math.min(1,H[G]))}return H}function QI($,Z){let J=[],H;while($._i<$.length){if(H=$[$._i++],H.type===O0.None||H.type===O0.Number||H.type===O0.Alpha||H.type===O0.Percentage||Z&&H.type===O0.Hue){J.push(H);continue}if(H.type===O0.ParenClose){if($._i<$.length)return;continue}return}if(J.length<3||J.length>4)return;if(J.length===4){if(J[3].type!==O0.Alpha)return;J[3]=J[3].value}if(J.length===3)J.push({type:O0.None,value:void 0});return J.every((B)=>B.type!==O0.Alpha)?J:void 0}function y20($,Z){$._i=0;let J=$[$._i++];if(!J||J.type!==O0.Function)return;let H=QI($,Z);if(!H)return;return H.unshift(J.value),H}var x20=($)=>{if(typeof $!=="string")return;let Z=k20($),J=Z?y20(Z,!0):void 0,H=void 0,B=0,Q=iB.length;while(B<Q)if((H=iB[B++]($,J))!==void 0)return H;return Z?I20(Z):void 0},JI=x20;function h20($,Z){if(!Z||Z[0]!=="rgb"&&Z[0]!=="rgba")return;let J={mode:"rgb"},[,H,B,Q,X]=Z;if(H.type===O0.Hue||B.type===O0.Hue||Q.type===O0.Hue)return;if(H.type!==O0.None)J.r=H.type===O0.Number?H.value/255:H.value/100;if(B.type!==O0.None)J.g=B.type===O0.Number?B.value/255:B.value/100;if(Q.type!==O0.None)J.b=Q.type===O0.Number?Q.value/255:Q.value/100;if(X.type!==O0.None)J.alpha=Math.min(1,Math.max(0,X.type===O0.Number?X.value:X.value/100));return J}var XI=h20;var v20=($)=>$==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,zI=v20;var GI=($,Z,J)=>$+J*(Z-$);var g20=($)=>{let Z=[];for(let J=0;J<$.length-1;J++){let H=$[J],B=$[J+1];if(H===void 0&&B===void 0)Z.push(void 0);else if(H!==void 0&&B!==void 0)Z.push([H,B]);else Z.push(H!==void 0?[H,H]:[B,B])}return Z},UI=($)=>(Z)=>{let J=g20(Z);return(H)=>{let B=H*J.length,Q=H>=1?J.length-1:Math.max(Math.floor(B),0),X=J[Q];return X===void 0?void 0:$(X[0],X[1],B-Q)}};var E0=UI(GI);var I1=($)=>{let Z=!1,J=$.map((H)=>{if(H!==void 0)return Z=!0,H;return 1});return Z?J:$};var f20={mode:"rgb",channels:["r","g","b","alpha"],parse:[XI,tk,$I,sk,zI,"srgb"],serialize:"srgb",interpolate:{r:E0,g:E0,b:E0,alpha:{use:E0,fixup:I1}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},k8=f20;var oD=($=0)=>Math.pow(Math.abs($),2.19921875)*Math.sign($),m20=($)=>{let Z=oD($.r),J=oD($.g),H=oD($.b),B={mode:"xyz65",x:0.5766690429101305*Z+0.1855582379065463*J+0.1882286462349947*H,y:0.297344975250536*Z+0.6273635662554661*J+0.0752914584939979*H,z:0.0270313613864123*Z+0.0706888525358272*J+0.9913375368376386*H};if($.alpha!==void 0)B.alpha=$.alpha;return B},nD=m20;var sD=($)=>Math.pow(Math.abs($),0.4547069271758437)*Math.sign($),u20=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B={mode:"a98",r:sD($*2.0415879038107465-Z*0.5650069742788597-0.3447313507783297*J),g:sD($*-0.9692436362808798+Z*1.8759675015077206+0.0415550574071756*J),b:sD($*0.0134442806320312-Z*0.1183623922310184+1.0151749943912058*J)};if(H!==void 0)B.alpha=H;return B},tD=u20;var eD=($=0)=>{let Z=Math.abs($);if(Z<=0.04045)return $/12.92;return(Math.sign($)||1)*Math.pow((Z+0.055)/1.055,2.4)},p20=({r:$,g:Z,b:J,alpha:H})=>{let B={mode:"lrgb",r:eD($),g:eD(Z),b:eD(J)};if(H!==void 0)B.alpha=H;return B},I8=p20;var c20=($)=>{let{r:Z,g:J,b:H,alpha:B}=I8($),Q={mode:"xyz65",x:0.4123907992659593*Z+0.357584339383878*J+0.1804807884018343*H,y:0.2126390058715102*Z+0.715168678767756*J+0.0721923153607337*H,z:0.0193308187155918*Z+0.119194779794626*J+0.9505321522496607*H};if(B!==void 0)Q.alpha=B;return Q},d4=c20;var $V=($=0)=>{let Z=Math.abs($);if(Z>0.0031308)return(Math.sign($)||1)*(1.055*Math.pow(Z,0.4166666666666667)-0.055);return $*12.92},d20=({r:$,g:Z,b:J,alpha:H},B="rgb")=>{let Q={mode:B,r:$V($),g:$V(Z),b:$V(J)};if(H!==void 0)Q.alpha=H;return Q},y8=d20;var l20=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=y8({r:$*3.2409699419045226-Z*1.537383177570094-0.4986107602930034*J,g:$*-0.9692436362808796+Z*1.8759675015077204+0.0415550574071756*J,b:$*0.0556300796969936-Z*0.2039769588889765+1.0569715142428784*J});if(H!==void 0)B.alpha=H;return B},l4=l20;var i20={...k8,mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:($)=>tD(d4($)),xyz65:tD},toMode:{rgb:($)=>l4(nD($)),xyz65:nD}},YI=i20;var r20=($)=>($=$%360)<0?$+360:$,M5=r20;var a20=($,Z)=>{return $.map((J,H,B)=>{if(J===void 0)return J;let Q=M5(J);if(H===0||$[H-1]===void 0)return Q;return Z(Q-M5(B[H-1]))}).reduce((J,H)=>{if(!J.length||H===void 0||J[J.length-1]===void 0)return J.push(H),J;return J.push(H+J[J.length-1]),J},[])},k2=($)=>a20($,(Z)=>Math.abs(Z)<=180?Z:Z-360*Math.sign(Z));var G2=[-0.14861,1.78277,-0.29227,-0.90649,1.97294,0],KI=Math.PI/180,FI=180/Math.PI;var WI=G2[3]*G2[4],qI=G2[1]*G2[4],NI=G2[1]*G2[2]-G2[0]*G2[3],o20=({r:$,g:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=(NI*J+$*WI-Z*qI)/(NI+WI-qI),Q=J-B,X=(G2[4]*(Z-B)-G2[2]*Q)/G2[3],z={mode:"cubehelix",l:B,s:B===0||B===1?void 0:Math.sqrt(Q*Q+X*X)/(G2[4]*B*(1-B))};if(z.s)z.h=Math.atan2(X,Q)*FI-120;if(H!==void 0)z.alpha=H;return z},AI=o20;var n20=({h:$,s:Z,l:J,alpha:H})=>{let B={mode:"rgb"};if($=($===void 0?0:$+120)*KI,J===void 0)J=0;let Q=Z===void 0?0:Z*J*(1-J),X=Math.cos($),z=Math.sin($);if(B.r=J+Q*(G2[0]*X+G2[1]*z),B.g=J+Q*(G2[2]*X+G2[3]*z),B.b=J+Q*(G2[4]*X+G2[5]*z),H!==void 0)B.alpha=H;return B},DI=n20;var m6=($,Z)=>{if($.h===void 0||Z.h===void 0||!$.s||!Z.s)return 0;let J=M5($.h),H=M5(Z.h),B=Math.sin((H-J+360)/2*Math.PI/180);return 2*Math.sqrt($.s*Z.s)*B},VI=($,Z)=>{if($.h===void 0||Z.h===void 0)return 0;let J=M5($.h),H=M5(Z.h);if(Math.abs(H-J)>180)return J-(H-360*Math.sign(H-J));return H-J},u6=($,Z)=>{if($.h===void 0||Z.h===void 0||!$.c||!Z.c)return 0;let J=M5($.h),H=M5(Z.h),B=Math.sin((H-J+360)/2*Math.PI/180);return 2*Math.sqrt($.c*Z.c)*B};var I2=($)=>{let Z=$.reduce((H,B)=>{if(B!==void 0){let Q=B*Math.PI/180;H.sin+=Math.sin(Q),H.cos+=Math.cos(Q)}return H},{sin:0,cos:0}),J=Math.atan2(Z.sin,Z.cos)*180/Math.PI;return J<0?360+J:J};var s20={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:AI},toMode:{rgb:DI},interpolate:{h:{use:E0,fixup:k2},s:E0,l:E0,alpha:{use:E0,fixup:I1}},difference:{h:m6},average:{h:I2}},LI=s20;var t20=({l:$,a:Z,b:J,alpha:H},B="lch")=>{if(Z===void 0)Z=0;if(J===void 0)J=0;let Q=Math.sqrt(Z*Z+J*J),X={mode:B,l:$,c:Q};if(Q)X.h=M5(Math.atan2(J,Z)*180/Math.PI);if(H!==void 0)X.alpha=H;return X},Y8=t20;var e20=({l:$,c:Z,h:J,alpha:H},B="lab")=>{if(J===void 0)J=0;let Q={mode:B,l:$,a:Z?Z*Math.cos(J/180*Math.PI):0,b:Z?Z*Math.sin(J/180*Math.PI):0};if(H!==void 0)Q.alpha=H;return Q},K8=e20;var WY=Math.pow(29,3)/Math.pow(3,3),qY=Math.pow(6,3)/Math.pow(29,3);var m5={X:0.9642956764295677,Y:1,Z:0.8251046025104602},p6={X:0.9504559270516716,Y:1,Z:1.0890577507598784},nu0=Math.pow(29,3)/Math.pow(3,3),su0=Math.pow(6,3)/Math.pow(29,3);var ZV=($)=>Math.pow($,3)>qY?Math.pow($,3):(116*$-16)/WY,$40=({l:$,a:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=($+16)/116,Q=Z/500+B,X=B-J/200,z={mode:"xyz65",x:ZV(Q)*p6.X,y:ZV(B)*p6.Y,z:ZV(X)*p6.Z};if(H!==void 0)z.alpha=H;return z},NY=$40;var Z40=($)=>l4(NY($)),c6=Z40;var JV=($)=>$>qY?Math.cbrt($):(WY*$+16)/116,J40=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=JV($/p6.X),Q=JV(Z/p6.Y),X=JV(J/p6.Z),z={mode:"lab65",l:116*Q-16,a:500*(B-Q),b:200*(Q-X)};if(H!==void 0)z.alpha=H;return z},AY=J40;var H40=($)=>{let Z=AY(d4($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},d6=H40;var _J=1,DY=1,O$=0.14444444444444443*Math.PI,jJ=Math.cos(O$),OJ=Math.sin(O$),VY=100/Math.log(1.39);var B40=({l:$,c:Z,h:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B={mode:"lab65",l:(Math.exp($*_J/VY)-1)/0.0039},Q=(Math.exp(0.0435*Z*DY*_J)-1)/0.075,X=Q*Math.cos(J/180*Math.PI-O$),z=Q*Math.sin(J/180*Math.PI-O$);if(B.a=X*jJ-z/0.83*OJ,B.b=X*OJ+z/0.83*jJ,H!==void 0)B.alpha=H;return B},aB=B40;var Q40=({l:$,a:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=Z*jJ+J*OJ,Q=0.83*(J*jJ-Z*OJ),X=Math.sqrt(B*B+Q*Q),z={mode:"dlch",l:VY/_J*Math.log(1+0.0039*$),c:Math.log(1+0.075*X)/(0.0435*DY*_J)};if(z.c)z.h=M5((Math.atan2(Q,B)+O$)/Math.PI*180);if(H!==void 0)z.alpha=H;return z},oB=Q40;var MI=($)=>aB(Y8($,"dlch")),PI=($)=>K8(oB($),"dlab"),X40={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:MI,rgb:($)=>c6(MI($))},fromMode:{lab65:PI,rgb:($)=>PI(d6($))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:E0,a:E0,b:E0,alpha:{use:E0,fixup:I1}}},_I=X40;var z40={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:aB,dlab:($)=>K8($,"dlab"),rgb:($)=>c6(aB($))},fromMode:{lab65:oB,dlab:($)=>Y8($,"dlch"),rgb:($)=>oB(d6($))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:E0,c:E0,h:{use:E0,fixup:k2},alpha:{use:E0,fixup:I1}},difference:{h:u6},average:{h:I2}},jI=z40;function HV({h:$,s:Z,i:J,alpha:H}){if($=M5($!==void 0?$:0),Z===void 0)Z=0;if(J===void 0)J=0;let B=Math.abs($/60%2-1),Q;switch(Math.floor($/60)){case 0:Q={r:J*(1+Z*(3/(2-B)-1)),g:J*(1+Z*(3*(1-B)/(2-B)-1)),b:J*(1-Z)};break;case 1:Q={r:J*(1+Z*(3*(1-B)/(2-B)-1)),g:J*(1+Z*(3/(2-B)-1)),b:J*(1-Z)};break;case 2:Q={r:J*(1-Z),g:J*(1+Z*(3/(2-B)-1)),b:J*(1+Z*(3*(1-B)/(2-B)-1))};break;case 3:Q={r:J*(1-Z),g:J*(1+Z*(3*(1-B)/(2-B)-1)),b:J*(1+Z*(3/(2-B)-1))};break;case 4:Q={r:J*(1+Z*(3*(1-B)/(2-B)-1)),g:J*(1-Z),b:J*(1+Z*(3/(2-B)-1))};break;case 5:Q={r:J*(1+Z*(3/(2-B)-1)),g:J*(1-Z),b:J*(1+Z*(3*(1-B)/(2-B)-1))};break;default:Q={r:J*(1-Z),g:J*(1-Z),b:J*(1-Z)}}if(Q.mode="rgb",H!==void 0)Q.alpha=H;return Q}function BV({r:$,g:Z,b:J,alpha:H}){if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=Math.max($,Z,J),Q=Math.min($,Z,J),X={mode:"hsi",s:$+Z+J===0?0:1-3*Q/($+Z+J),i:($+Z+J)/3};if(B-Q!==0)X.h=(B===$?(Z-J)/(B-Q)+(Z<J)*6:B===Z?(J-$)/(B-Q)+2:($-Z)/(B-Q)+4)*60;if(H!==void 0)X.alpha=H;return X}var G40={mode:"hsi",toMode:{rgb:HV},parse:["--hsi"],serialize:"--hsi",fromMode:{rgb:BV},channels:["h","s","i","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:E0,fixup:k2},s:E0,i:E0,alpha:{use:E0,fixup:I1}},difference:{h:m6},average:{h:I2}},OI=G40;function QV({h:$,s:Z,l:J,alpha:H}){if($=M5($!==void 0?$:0),Z===void 0)Z=0;if(J===void 0)J=0;let B=J+Z*(J<0.5?J:1-J),Q=B-(B-J)*2*Math.abs($/60%2-1),X;switch(Math.floor($/60)){case 0:X={r:B,g:Q,b:2*J-B};break;case 1:X={r:Q,g:B,b:2*J-B};break;case 2:X={r:2*J-B,g:B,b:Q};break;case 3:X={r:2*J-B,g:Q,b:B};break;case 4:X={r:Q,g:2*J-B,b:B};break;case 5:X={r:B,g:2*J-B,b:Q};break;default:X={r:2*J-B,g:2*J-B,b:2*J-B}}if(X.mode="rgb",H!==void 0)X.alpha=H;return X}function XV({r:$,g:Z,b:J,alpha:H}){if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=Math.max($,Z,J),Q=Math.min($,Z,J),X={mode:"hsl",s:B===Q?0:(B-Q)/(1-Math.abs(B+Q-1)),l:0.5*(B+Q)};if(B-Q!==0)X.h=(B===$?(Z-J)/(B-Q)+(Z<J)*6:B===Z?(J-$)/(B-Q)+2:($-Z)/(B-Q)+4)*60;if(H!==void 0)X.alpha=H;return X}var U40=($,Z)=>{switch(Z){case"deg":return+$;case"rad":return $/Math.PI*180;case"grad":return $/10*9;case"turn":return $*360}},TI=U40;var Y40=new RegExp(`^hsla?\\(\\s*${ek}${f6}${j$}${f6}${j$}\\s*(?:,\\s*${lB}\\s*)?\\)$`),K40=($)=>{let Z=$.match(Y40);if(!Z)return;let J={mode:"hsl"};if(Z[3]!==void 0)J.h=+Z[3];else if(Z[1]!==void 0&&Z[2]!==void 0)J.h=TI(Z[1],Z[2]);if(Z[4]!==void 0)J.s=Math.min(Math.max(0,Z[4]/100),1);if(Z[5]!==void 0)J.l=Math.min(Math.max(0,Z[5]/100),1);if(Z[6]!==void 0)J.alpha=Math.max(0,Math.min(1,Z[6]/100));else if(Z[7]!==void 0)J.alpha=Math.max(0,Math.min(1,+Z[7]));return J},CI=K40;function F40($,Z){if(!Z||Z[0]!=="hsl"&&Z[0]!=="hsla")return;let J={mode:"hsl"},[,H,B,Q,X]=Z;if(H.type!==O0.None){if(H.type===O0.Percentage)return;J.h=H.value}if(B.type!==O0.None){if(B.type===O0.Hue)return;J.s=B.value/100}if(Q.type!==O0.None){if(Q.type===O0.Hue)return;J.l=Q.value/100}if(X.type!==O0.None)J.alpha=Math.min(1,Math.max(0,X.type===O0.Number?X.value:X.value/100));return J}var EI=F40;var W40={mode:"hsl",toMode:{rgb:QV},fromMode:{rgb:XV},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[EI,CI],serialize:($)=>`hsl(${$.h!==void 0?$.h:"none"} ${$.s!==void 0?$.s*100+"%":"none"} ${$.l!==void 0?$.l*100+"%":"none"}${$.alpha<1?` / ${$.alpha}`:""})`,interpolate:{h:{use:E0,fixup:k2},s:E0,l:E0,alpha:{use:E0,fixup:I1}},difference:{h:m6},average:{h:I2}},LY=W40;function nB({h:$,s:Z,v:J,alpha:H}){if($=M5($!==void 0?$:0),Z===void 0)Z=0;if(J===void 0)J=0;let B=Math.abs($/60%2-1),Q;switch(Math.floor($/60)){case 0:Q={r:J,g:J*(1-Z*B),b:J*(1-Z)};break;case 1:Q={r:J*(1-Z*B),g:J,b:J*(1-Z)};break;case 2:Q={r:J*(1-Z),g:J,b:J*(1-Z*B)};break;case 3:Q={r:J*(1-Z),g:J*(1-Z*B),b:J};break;case 4:Q={r:J*(1-Z*B),g:J*(1-Z),b:J};break;case 5:Q={r:J,g:J*(1-Z),b:J*(1-Z*B)};break;default:Q={r:J*(1-Z),g:J*(1-Z),b:J*(1-Z)}}if(Q.mode="rgb",H!==void 0)Q.alpha=H;return Q}function sB({r:$,g:Z,b:J,alpha:H}){if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=Math.max($,Z,J),Q=Math.min($,Z,J),X={mode:"hsv",s:B===0?0:1-Q/B,v:B};if(B-Q!==0)X.h=(B===$?(Z-J)/(B-Q)+(Z<J)*6:B===Z?(J-$)/(B-Q)+2:($-Z)/(B-Q)+4)*60;if(H!==void 0)X.alpha=H;return X}var q40={mode:"hsv",toMode:{rgb:nB},parse:["--hsv"],serialize:"--hsv",fromMode:{rgb:sB},channels:["h","s","v","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:E0,fixup:k2},s:E0,v:E0,alpha:{use:E0,fixup:I1}},difference:{h:m6},average:{h:I2}},MY=q40;function zV({h:$,w:Z,b:J,alpha:H}){if(Z===void 0)Z=0;if(J===void 0)J=0;if(Z+J>1){let B=Z+J;Z/=B,J/=B}return nB({h:$,s:J===1?1:1-Z/(1-J),v:1-J,alpha:H})}function GV($){let Z=sB($);if(Z===void 0)return;let J=Z.s!==void 0?Z.s:0,H=Z.v!==void 0?Z.v:0,B={mode:"hwb",w:(1-J)*H,b:1-H};if(Z.h!==void 0)B.h=Z.h;if(Z.alpha!==void 0)B.alpha=Z.alpha;return B}function N40($,Z){if(!Z||Z[0]!=="hwb")return;let J={mode:"hwb"},[,H,B,Q,X]=Z;if(H.type!==O0.None){if(H.type===O0.Percentage)return;J.h=H.value}if(B.type!==O0.None){if(B.type===O0.Hue)return;J.w=B.value/100}if(Q.type!==O0.None){if(Q.type===O0.Hue)return;J.b=Q.value/100}if(X.type!==O0.None)J.alpha=Math.min(1,Math.max(0,X.type===O0.Number?X.value:X.value/100));return J}var bI=N40;var A40={mode:"hwb",toMode:{rgb:zV},fromMode:{rgb:GV},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[bI],serialize:($)=>`hwb(${$.h!==void 0?$.h:"none"} ${$.w!==void 0?$.w*100+"%":"none"} ${$.b!==void 0?$.b*100+"%":"none"}${$.alpha<1?` / ${$.alpha}`:""})`,interpolate:{h:{use:E0,fixup:k2},w:E0,b:E0,alpha:{use:E0,fixup:I1}},difference:{h:VI},average:{h:I2}},wI=A40;var PY=203;var _Y=0.1593017578125;var jY=0.8359375,OY=18.8515625,TY=18.6875;function CY($){if($<0)return 0;let Z=Math.pow($,0.012683313515655966);return 1e4*Math.pow(Math.max(0,Z-0.8359375)/(18.8515625-18.6875*Z),6.277394636015326)}function EY($){if($<0)return 0;let Z=Math.pow($/1e4,0.1593017578125);return Math.pow((0.8359375+18.8515625*Z)/(1+18.6875*Z),78.84375)}var UV=($)=>Math.max($/PY,0),D40=({i:$,t:Z,p:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=CY($+0.008609037037932761*Z+0.11102962500302593*J),Q=CY($-0.00860903703793275*Z-0.11102962500302599*J),X=CY($+0.5600313357106791*Z-0.32062717498731885*J),z={mode:"xyz65",x:UV(2.070152218389422*B-1.3263473389671556*Q+0.2066510476294051*X),y:UV(0.3647385209748074*B+0.680566024947227*Q-0.0453045459220346*X),z:UV(-0.049747207535812*B-0.0492609666966138*Q+1.1880659249923042*X)};if(H!==void 0)z.alpha=H;return z},YV=D40;var KV=($=0)=>Math.max($*PY,0),V40=({x:$,y:Z,z:J,alpha:H})=>{let B=KV($),Q=KV(Z),X=KV(J),z=EY(0.3592832590121217*B+0.6976051147779502*Q-0.0358915932320289*X),G=EY(-0.1920808463704995*B+1.1004767970374323*Q+0.0753748658519118*X),U=EY(0.0070797844607477*B+0.0748396662186366*Q+0.8433265453898765*X),Y=0.5*z+0.5*G,K=1.61376953125*z-3.323486328125*G+1.709716796875*U,F=4.378173828125*z-4.24560546875*G-0.132568359375*U,W={mode:"itp",i:Y,t:K,p:F};if(H!==void 0)W.alpha=H;return W},FV=V40;var L40={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:YV,rgb:($)=>l4(YV($))},fromMode:{xyz65:FV,rgb:($)=>FV(d4($))},ranges:{i:[0,0.581],t:[-0.369,0.272],p:[-0.164,0.331]},interpolate:{i:E0,t:E0,p:E0,alpha:{use:E0,fixup:I1}}},SI=L40;var M40=134.03437499999998,P40=0.000000000016295499532821565,WV=($)=>{if($<0)return 0;let Z=Math.pow($/1e4,_Y);return Math.pow((jY+OY*Z)/(1+TY*Z),M40)},qV=($=0)=>Math.max($*203,0),_40=({x:$,y:Z,z:J,alpha:H})=>{$=qV($),Z=qV(Z),J=qV(J);let B=1.15*$-0.15*J,Q=0.66*Z+0.34*$,X=WV(0.41478972*B+0.579999*Q+0.014648*J),z=WV(-0.20151*B+1.120649*Q+0.0531008*J),G=WV(-0.0166008*B+0.2648*Q+0.6684799*J),U=(X+z)/2,Y={mode:"jab",j:0.44*U/(1-0.56*U)-P40,a:3.524*X-4.066708*z+0.542708*G,b:0.199076*X+1.096799*z-1.295875*G};if(H!==void 0)Y.alpha=H;return Y},bY=_40;var j40=134.03437499999998,RI=0.000000000016295499532821565,NV=($)=>{if($<0)return 0;let Z=Math.pow($,1/j40);return 1e4*Math.pow((jY-Z)/(TY*Z-OY),1/_Y)},AV=($)=>$/203,O40=({j:$,a:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=($+RI)/(0.44+0.56*($+RI)),Q=NV(B+0.13860504*Z+0.058047316*J),X=NV(B-0.13860504*Z-0.058047316*J),z=NV(B-0.096019242*Z-0.8118919*J),G={mode:"xyz65",x:AV(1.661373024652174*Q-0.914523081304348*X+0.23136208173913045*z),y:AV(-0.3250758611844533*Q+1.571847026732543*X-0.21825383453227928*z),z:AV(-0.090982811*Q-0.31272829*X+1.5227666*z)};if(H!==void 0)G.alpha=H;return G},wY=O40;var T40=($)=>{let Z=bY(d4($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},SY=T40;var C40=($)=>l4(wY($)),RY=C40;var E40={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:SY,xyz65:bY},toMode:{rgb:RY,xyz65:wY},ranges:{j:[0,0.222],a:[-0.109,0.129],b:[-0.185,0.134]},interpolate:{j:E0,a:E0,b:E0,alpha:{use:E0,fixup:I1}}},kI=E40;var b40=({j:$,a:Z,b:J,alpha:H})=>{if(Z===void 0)Z=0;if(J===void 0)J=0;let B=Math.sqrt(Z*Z+J*J),Q={mode:"jch",j:$,c:B};if(B)Q.h=M5(Math.atan2(J,Z)*180/Math.PI);if(H!==void 0)Q.alpha=H;return Q},DV=b40;var w40=({j:$,c:Z,h:J,alpha:H})=>{if(J===void 0)J=0;let B={mode:"jab",j:$,a:Z?Z*Math.cos(J/180*Math.PI):0,b:Z?Z*Math.sin(J/180*Math.PI):0};if(H!==void 0)B.alpha=H;return B},VV=w40;var S40={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:VV,rgb:($)=>RY(VV($))},fromMode:{rgb:($)=>DV(SY($)),jab:DV},channels:["j","c","h","alpha"],ranges:{j:[0,0.221],c:[0,0.19],h:[0,360]},interpolate:{h:{use:E0,fixup:k2},c:E0,j:E0,alpha:{use:E0,fixup:I1}},difference:{h:u6},average:{h:I2}},II=S40;var l6=Math.pow(29,3)/Math.pow(3,3),TJ=Math.pow(6,3)/Math.pow(29,3);var LV=($)=>Math.pow($,3)>TJ?Math.pow($,3):(116*$-16)/l6,R40=({l:$,a:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=($+16)/116,Q=Z/500+B,X=B-J/200,z={mode:"xyz50",x:LV(Q)*m5.X,y:LV(B)*m5.Y,z:LV(X)*m5.Z};if(H!==void 0)z.alpha=H;return z},CJ=R40;var k40=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=y8({r:$*3.1341359569958707-Z*1.6173863321612538-0.4906619460083532*J,g:$*-0.978795502912089+Z*1.916254567259524+0.03344273116131949*J,b:$*0.07195537988411677-Z*0.2289768264158322+1.405386058324125*J});if(H!==void 0)B.alpha=H;return B},d9=k40;var I40=($)=>d9(CJ($)),kY=I40;var y40=($)=>{let{r:Z,g:J,b:H,alpha:B}=I8($),Q={mode:"xyz50",x:0.436065742824811*Z+0.3851514688337912*J+0.14307845442264197*H,y:0.22249319175623702*Z+0.7168870538238823*J+0.06061979053616537*H,z:0.013923904500943465*Z+0.09708128566574634*J+0.7140993584005155*H};if(B!==void 0)Q.alpha=B;return Q},l9=y40;var MV=($)=>$>TJ?Math.cbrt($):(l6*$+16)/116,x40=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=MV($/m5.X),Q=MV(Z/m5.Y),X=MV(J/m5.Z),z={mode:"lab",l:116*Q-16,a:500*(B-Q),b:200*(Q-X)};if(H!==void 0)z.alpha=H;return z},EJ=x40;var h40=($)=>{let Z=EJ(l9($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},IY=h40;function v40($,Z){if(!Z||Z[0]!=="lab")return;let J={mode:"lab"},[,H,B,Q,X]=Z;if(H.type===O0.Hue||B.type===O0.Hue||Q.type===O0.Hue)return;if(H.type!==O0.None)J.l=Math.min(Math.max(0,H.value),100);if(B.type!==O0.None)J.a=B.type===O0.Number?B.value:B.value*125/100;if(Q.type!==O0.None)J.b=Q.type===O0.Number?Q.value:Q.value*125/100;if(X.type!==O0.None)J.alpha=Math.min(1,Math.max(0,X.type===O0.Number?X.value:X.value/100));return J}var yI=v40;var g40={mode:"lab",toMode:{xyz50:CJ,rgb:kY},fromMode:{xyz50:EJ,rgb:IY},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-125,125],b:[-125,125]},parse:[yI],serialize:($)=>`lab(${$.l!==void 0?$.l:"none"} ${$.a!==void 0?$.a:"none"} ${$.b!==void 0?$.b:"none"}${$.alpha<1?` / ${$.alpha}`:""})`,interpolate:{l:E0,a:E0,b:E0,alpha:{use:E0,fixup:I1}}},bJ=g40;var f40={...bJ,mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:NY,rgb:c6},fromMode:{xyz65:AY,rgb:d6},ranges:{l:[0,100],a:[-125,125],b:[-125,125]}},xI=f40;function m40($,Z){if(!Z||Z[0]!=="lch")return;let J={mode:"lch"},[,H,B,Q,X]=Z;if(H.type!==O0.None){if(H.type===O0.Hue)return;J.l=Math.min(Math.max(0,H.value),100)}if(B.type!==O0.None)J.c=Math.max(0,B.type===O0.Number?B.value:B.value*150/100);if(Q.type!==O0.None){if(Q.type===O0.Percentage)return;J.h=Q.value}if(X.type!==O0.None)J.alpha=Math.min(1,Math.max(0,X.type===O0.Number?X.value:X.value/100));return J}var hI=m40;var u40={mode:"lch",toMode:{lab:K8,rgb:($)=>kY(K8($))},fromMode:{rgb:($)=>Y8(IY($)),lab:Y8},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[hI],serialize:($)=>`lch(${$.l!==void 0?$.l:"none"} ${$.c!==void 0?$.c:"none"} ${$.h!==void 0?$.h:"none"}${$.alpha<1?` / ${$.alpha}`:""})`,interpolate:{h:{use:E0,fixup:k2},c:E0,l:E0,alpha:{use:E0,fixup:I1}},difference:{h:u6},average:{h:I2}},wJ=u40;var p40={...wJ,mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:($)=>K8($,"lab65"),rgb:($)=>c6(K8($,"lab65"))},fromMode:{rgb:($)=>Y8(d6($),"lch65"),lab65:($)=>Y8($,"lch65")},ranges:{l:[0,100],c:[0,150],h:[0,360]}},vI=p40;var c40=({l:$,u:Z,v:J,alpha:H})=>{if(Z===void 0)Z=0;if(J===void 0)J=0;let B=Math.sqrt(Z*Z+J*J),Q={mode:"lchuv",l:$,c:B};if(B)Q.h=M5(Math.atan2(J,Z)*180/Math.PI);if(H!==void 0)Q.alpha=H;return Q},PV=c40;var d40=({l:$,c:Z,h:J,alpha:H})=>{if(J===void 0)J=0;let B={mode:"luv",l:$,u:Z?Z*Math.cos(J/180*Math.PI):0,v:Z?Z*Math.sin(J/180*Math.PI):0};if(H!==void 0)B.alpha=H;return B},_V=d40;var gI=($,Z,J)=>4*$/($+15*Z+3*J),fI=($,Z,J)=>9*Z/($+15*Z+3*J),l40=gI(m5.X,m5.Y,m5.Z),i40=fI(m5.X,m5.Y,m5.Z),r40=($)=>$<=TJ?l6*$:116*Math.cbrt($)-16,a40=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=r40(Z/m5.Y),Q=gI($,Z,J),X=fI($,Z,J);if(!isFinite(Q)||!isFinite(X))B=Q=X=0;else Q=13*B*(Q-l40),X=13*B*(X-i40);let z={mode:"luv",l:B,u:Q,v:X};if(H!==void 0)z.alpha=H;return z},tB=a40;var o40=($,Z,J)=>4*$/($+15*Z+3*J),n40=($,Z,J)=>9*Z/($+15*Z+3*J),s40=o40(m5.X,m5.Y,m5.Z),t40=n40(m5.X,m5.Y,m5.Z),e40=({l:$,u:Z,v:J,alpha:H})=>{if($===void 0)$=0;if($===0)return{mode:"xyz50",x:0,y:0,z:0};if(Z===void 0)Z=0;if(J===void 0)J=0;let B=Z/(13*$)+s40,Q=J/(13*$)+t40,X=m5.Y*($<=8?$/l6:Math.pow(($+16)/116,3)),z=X*(9*B)/(4*Q),G=X*(12-3*B-20*Q)/(4*Q),U={mode:"xyz50",x:z,y:X,z:G};if(H!==void 0)U.alpha=H;return U},eB=e40;var $80=($)=>PV(tB(l9($))),Z80=($)=>d9(eB(_V($))),J80={mode:"lchuv",toMode:{luv:_V,rgb:Z80},fromMode:{rgb:$80,luv:PV},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:E0,fixup:k2},c:E0,l:E0,alpha:{use:E0,fixup:I1}},difference:{h:u6},average:{h:I2}},mI=J80;var H80={...k8,mode:"lrgb",toMode:{rgb:y8},fromMode:{rgb:I8},parse:["srgb-linear"],serialize:"srgb-linear"},uI=H80;var B80={mode:"luv",toMode:{xyz50:eB,rgb:($)=>d9(eB($))},fromMode:{xyz50:tB,rgb:($)=>tB(l9($))},channels:["l","u","v","alpha"],parse:["--luv"],serialize:"--luv",ranges:{l:[0,100],u:[-84.936,175.042],v:[-125.882,87.243]},interpolate:{l:E0,u:E0,v:E0,alpha:{use:E0,fixup:I1}}},pI=B80;var Q80=({r:$,g:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=Math.cbrt(0.412221469470763*$+0.5363325372617348*Z+0.0514459932675022*J),Q=Math.cbrt(0.2119034958178252*$+0.6806995506452344*Z+0.1073969535369406*J),X=Math.cbrt(0.0883024591900564*$+0.2817188391361215*Z+0.6299787016738222*J),z={mode:"oklab",l:0.210454268309314*B+0.7936177747023054*Q-0.0040720430116193*X,a:1.9779985324311684*B-2.42859224204858*Q+0.450593709617411*X,b:0.0259040424655478*B+0.7827717124575296*Q-0.8086757549230774*X};if(H!==void 0)z.alpha=H;return z},yY=Q80;var X80=($)=>{let Z=yY(I8($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},i6=X80;var z80=({l:$,a:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=Math.pow($+0.3963377773761749*Z+0.2158037573099136*J,3),Q=Math.pow($-0.1055613458156586*Z-0.0638541728258133*J,3),X=Math.pow($-0.0894841775298119*Z-1.2914855480194092*J,3),z={mode:"lrgb",r:4.076741636075957*B-3.3077115392580616*Q+0.2309699031821044*X,g:-1.2684379732850317*B+2.6097573492876887*Q-0.3413193760026573*X,b:-0.0041960761386756*B-0.7034186179359362*Q+1.7076146940746117*X};if(H!==void 0)z.alpha=H;return z},i9=z80;var G80=($)=>y8(i9($)),r6=G80;function $Q($){return 0.5*(1.170873786407767*$-0.206+Math.sqrt((1.170873786407767*$-0.206)*(1.170873786407767*$-0.206)+0.14050485436893204*$))}function T$($){return($*$+0.206*$)/(1.170873786407767*($+0.03))}function U80($,Z){let J,H,B,Q,X,z,G,U;if(-1.88170328*$-0.80936493*Z>1)J=1.19086277,H=1.76576728,B=0.59662641,Q=0.75515197,X=0.56771245,z=4.0767416621,G=-3.3077115913,U=0.2309699292;else if(1.81444104*$-1.19445276*Z>1)J=0.73956515,H=-0.45954404,B=0.08285427,Q=0.1254107,X=0.14503204,z=-1.2684380046,G=2.6097574011,U=-0.3413193965;else J=1.35733652,H=-0.00915799,B=-1.1513021,Q=-0.50559606,X=0.00692167,z=-0.0041960863,G=-0.7034186147,U=1.707614701;let Y=J+H*$+B*Z+Q*$*$+X*$*Z,K=0.3963377774*$+0.2158037573*Z,F=-0.1055613458*$-0.0638541728*Z,W=-0.0894841775*$-1.291485548*Z;{let q=1+Y*K,N=1+Y*F,D=1+Y*W,A=q*q*q,V=N*N*N,L=D*D*D,j=3*K*q*q,M=3*F*N*N,_=3*W*D*D,w=6*K*K*q,T=6*F*F*N,b=6*W*W*D,C=z*A+G*V+U*L,k=z*j+G*M+U*_,S=z*w+G*T+U*b;Y=Y-C*k/(k*k-0.5*C*S)}return Y}function jV($,Z){let J=U80($,Z),H=i9({l:1,a:J*$,b:J*Z}),B=Math.cbrt(1/Math.max(H.r,H.g,H.b)),Q=B*J;return[B,Q]}function Y80($,Z,J,H,B,Q=null){if(!Q)Q=jV($,Z);let X;if((J-B)*Q[1]-(Q[0]-B)*H<=0)X=Q[1]*B/(H*Q[0]+Q[1]*(B-J));else{X=Q[1]*(B-1)/(H*(Q[0]-1)+Q[1]*(B-J));{let z=J-B,G=H,U=0.3963377774*$+0.2158037573*Z,Y=-0.1055613458*$-0.0638541728*Z,K=-0.0894841775*$-1.291485548*Z,F=z+G*U,W=z+G*Y,q=z+G*K;{let N=B*(1-X)+X*J,D=X*H,A=N+D*U,V=N+D*Y,L=N+D*K,j=A*A*A,M=V*V*V,_=L*L*L,w=3*F*A*A,T=3*W*V*V,b=3*q*L*L,C=6*F*F*A,k=6*W*W*V,S=6*q*q*L,R=4.0767416621*j-3.3077115913*M+0.2309699292*_-1,O=4.0767416621*w-3.3077115913*T+0.2309699292*b,y=4.0767416621*C-3.3077115913*k+0.2309699292*S,I=O/(O*O-0.5*R*y),x=-R*I,v=-1.2684380046*j+2.6097574011*M-0.3413193965*_-1,g=-1.2684380046*w+2.6097574011*T-0.3413193965*b,E=-1.2684380046*C+2.6097574011*k-0.3413193965*S,l=g/(g*g-0.5*v*E),r=-v*l,h=-0.0041960863*j-0.7034186147*M+1.707614701*_-1,d=-0.0041960863*w-0.7034186147*T+1.707614701*b,o=-0.0041960863*C-0.7034186147*k+1.707614701*S,p=d/(d*d-0.5*h*o),i=-h*p;x=I>=0?x:1e6,r=l>=0?r:1e6,i=p>=0?i:1e6,X+=Math.min(x,Math.min(r,i))}}}return X}function ZQ($,Z,J=null){if(!J)J=jV($,Z);let H=J[0],B=J[1];return[B/H,B/(1-H)]}function xY($,Z,J){let H=jV(Z,J),B=Y80(Z,J,$,1,$,H),Q=ZQ(Z,J,H),X=0.11516993+1/(7.4477897+4.1590124*J+Z*(-2.19557347+1.75198401*J+Z*(-2.13704948-10.02301043*J+Z*(-4.24894561+5.38770819*J+4.69891013*Z)))),z=0.11239642+1/(1.6132032-0.68124379*J+Z*(0.40370612+0.90148123*J+Z*(-0.27087943+0.6122399*J+Z*(0.00299215-0.45399568*J-0.14661872*Z)))),G=B/Math.min($*Q[0],(1-$)*Q[1]),U=$*X,Y=(1-$)*z,K=0.9*G*Math.sqrt(Math.sqrt(1/(1/(U*U*U*U)+1/(Y*Y*Y*Y))));return U=$*0.4,Y=(1-$)*0.8,[Math.sqrt(1/(1/(U*U)+1/(Y*Y))),K,B]}function hY($){let Z=$.l!==void 0?$.l:0,J=$.a!==void 0?$.a:0,H=$.b!==void 0?$.b:0,B={mode:"okhsl",l:$Q(Z)};if($.alpha!==void 0)B.alpha=$.alpha;let Q=Math.sqrt(J*J+H*H);if(!Q)return B.s=0,B;let[X,z,G]=xY(Z,J/Q,H/Q),U;if(Q<z){let Y=0,K=0.8*X,F=1-K/z;U=(Q-Y)/(K+F*(Q-Y))*0.8}else{let Y=z,K=0.2*z*z*1.25*1.25/X,F=1-K/(G-z);U=0.8+0.2*((Q-Y)/(K+F*(Q-Y)))}if(U)B.s=U,B.h=M5(Math.atan2(H,J)*180/Math.PI);return B}function vY($){let Z=$.h!==void 0?$.h:0,J=$.s!==void 0?$.s:0,H=$.l!==void 0?$.l:0,B={mode:"oklab",l:T$(H)};if($.alpha!==void 0)B.alpha=$.alpha;if(!J||H===1)return B.a=B.b=0,B;let Q=Math.cos(Z/180*Math.PI),X=Math.sin(Z/180*Math.PI),[z,G,U]=xY(B.l,Q,X),Y,K,F,W;if(J<0.8)Y=1.25*J,K=0,F=0.8*z,W=1-F/G;else Y=5*(J-0.8),K=G,F=0.2*G*G*1.25*1.25/z,W=1-F/(U-G);let q=K+Y*F/(1-W*Y);return B.a=q*Q,B.b=q*X,B}var K80={...LY,mode:"okhsl",channels:["h","s","l","alpha"],parse:["--okhsl"],serialize:"--okhsl",fromMode:{oklab:hY,rgb:($)=>hY(i6($))},toMode:{oklab:vY,rgb:($)=>r6(vY($))}},cI=K80;function gY($){let Z=$.l!==void 0?$.l:0,J=$.a!==void 0?$.a:0,H=$.b!==void 0?$.b:0,B=Math.sqrt(J*J+H*H),Q=B?J/B:1,X=B?H/B:1,[z,G]=ZQ(Q,X),U=0.5,Y=1-U/z,K=G/(B+Z*G),F=K*Z,W=K*B,q=T$(F),N=W*q/F,D=i9({l:q,a:Q*N,b:X*N}),A=Math.cbrt(1/Math.max(D.r,D.g,D.b,0));Z=Z/A,B=B/A*$Q(Z)/Z,Z=$Q(Z);let V={mode:"okhsv",s:B?(U+G)*W/(G*U+G*Y*W):0,v:Z?Z/F:0};if(V.s)V.h=M5(Math.atan2(H,J)*180/Math.PI);if($.alpha!==void 0)V.alpha=$.alpha;return V}function fY($){let Z={mode:"oklab"};if($.alpha!==void 0)Z.alpha=$.alpha;let J=$.h!==void 0?$.h:0,H=$.s!==void 0?$.s:0,B=$.v!==void 0?$.v:0,Q=Math.cos(J/180*Math.PI),X=Math.sin(J/180*Math.PI),[z,G]=ZQ(Q,X),U=0.5,Y=1-U/z,K=1-H*U/(U+G-G*Y*H),F=H*G*U/(U+G-G*Y*H),W=T$(K),q=F*W/K,N=i9({l:W,a:Q*q,b:X*q}),D=Math.cbrt(1/Math.max(N.r,N.g,N.b,0)),A=T$(B*K),V=F*A/K;return Z.l=A*D,Z.a=V*Q*D,Z.b=V*X*D,Z}var F80={...MY,mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:gY,rgb:($)=>gY(i6($))},toMode:{oklab:fY,rgb:($)=>r6(fY($))}},dI=F80;function W80($,Z){if(!Z||Z[0]!=="oklab")return;let J={mode:"oklab"},[,H,B,Q,X]=Z;if(H.type===O0.Hue||B.type===O0.Hue||Q.type===O0.Hue)return;if(H.type!==O0.None)J.l=Math.min(Math.max(0,H.type===O0.Number?H.value:H.value/100),1);if(B.type!==O0.None)J.a=B.type===O0.Number?B.value:B.value*0.4/100;if(Q.type!==O0.None)J.b=Q.type===O0.Number?Q.value:Q.value*0.4/100;if(X.type!==O0.None)J.alpha=Math.min(1,Math.max(0,X.type===O0.Number?X.value:X.value/100));return J}var lI=W80;var q80={...bJ,mode:"oklab",toMode:{lrgb:i9,rgb:r6},fromMode:{lrgb:yY,rgb:i6},ranges:{l:[0,1],a:[-0.4,0.4],b:[-0.4,0.4]},parse:[lI],serialize:($)=>`oklab(${$.l!==void 0?$.l:"none"} ${$.a!==void 0?$.a:"none"} ${$.b!==void 0?$.b:"none"}${$.alpha<1?` / ${$.alpha}`:""})`},iI=q80;function N80($,Z){if(!Z||Z[0]!=="oklch")return;let J={mode:"oklch"},[,H,B,Q,X]=Z;if(H.type!==O0.None){if(H.type===O0.Hue)return;J.l=Math.min(Math.max(0,H.type===O0.Number?H.value:H.value/100),1)}if(B.type!==O0.None)J.c=Math.max(0,B.type===O0.Number?B.value:B.value*0.4/100);if(Q.type!==O0.None){if(Q.type===O0.Percentage)return;J.h=Q.value}if(X.type!==O0.None)J.alpha=Math.min(1,Math.max(0,X.type===O0.Number?X.value:X.value/100));return J}var rI=N80;var A80={...wJ,mode:"oklch",toMode:{oklab:($)=>K8($,"oklab"),rgb:($)=>r6(K8($,"oklab"))},fromMode:{rgb:($)=>Y8(i6($),"oklch"),oklab:($)=>Y8($,"oklch")},parse:[rI],serialize:($)=>`oklch(${$.l!==void 0?$.l:"none"} ${$.c!==void 0?$.c:"none"} ${$.h!==void 0?$.h:"none"}${$.alpha<1?` / ${$.alpha}`:""})`,ranges:{l:[0,1],c:[0,0.4],h:[0,360]}},aI=A80;var D80=($)=>{let{r:Z,g:J,b:H,alpha:B}=I8($),Q={mode:"xyz65",x:0.486570948648216*Z+0.265667693169093*J+0.1982172852343625*H,y:0.2289745640697487*Z+0.6917385218365062*J+0.079286914093745*H,z:0*Z+0.0451133818589026*J+1.043944368900976*H};if(B!==void 0)Q.alpha=B;return Q},OV=D80;var V80=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=y8({r:$*2.4934969119414263-Z*0.9313836179191242-0.402710784450717*J,g:$*-0.8294889695615749+Z*1.7626640603183465+0.0236246858419436*J,b:$*0.0358458302437845-Z*0.0761723892680418+0.9568845240076871*J},"p3");if(H!==void 0)B.alpha=H;return B},TV=V80;var L80={...k8,mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:($)=>TV(d4($)),xyz65:TV},toMode:{rgb:($)=>l4(OV($)),xyz65:OV}},oI=L80;var CV=($)=>{let Z=Math.abs($);if(Z>=0.001953125)return Math.sign($)*Math.pow(Z,0.5555555555555556);return 16*$},M80=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B={mode:"prophoto",r:CV($*1.3457868816471585-Z*0.2555720873797946-0.0511018649755453*J),g:CV($*-0.5446307051249019+Z*1.5082477428451466+0.0205274474364214*J),b:CV($*0+Z*0+1.2119675456389452*J)};if(H!==void 0)B.alpha=H;return B},EV=M80;var bV=($=0)=>{let Z=Math.abs($);if(Z>=0.03125)return Math.sign($)*Math.pow(Z,1.8);return $/16},P80=($)=>{let Z=bV($.r),J=bV($.g),H=bV($.b),B={mode:"xyz50",x:0.7977666449006423*Z+0.1351812974005331*J+0.0313477341283922*H,y:0.2880748288194013*Z+0.7118352342418731*J+0.0000899369387256*H,z:0*Z+0*J+0.8251046025104602*H};if($.alpha!==void 0)B.alpha=$.alpha;return B},wV=P80;var _80={...k8,mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:EV,rgb:($)=>EV(l9($))},toMode:{xyz50:wV,rgb:($)=>d9(wV($))}},nI=_80;var SV=($)=>{let Z=Math.abs($);if(Z>0.018053968510807)return(Math.sign($)||1)*(1.09929682680944*Math.pow(Z,0.45)-0.09929682680944008);return 4.5*$},j80=({x:$,y:Z,z:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B={mode:"rec2020",r:SV($*1.7166511879712683-Z*0.3556707837763925-0.2533662813736599*J),g:SV($*-0.6666843518324893+Z*1.6164812366349395+0.0157685458139111*J),b:SV($*0.0176398574453108-Z*0.0427706132578085+0.9421031212354739*J)};if(H!==void 0)B.alpha=H;return B},RV=j80;var kV=($=0)=>{let Z=Math.abs($);if(Z<0.08124285829863151)return $/4.5;return(Math.sign($)||1)*Math.pow((Z+1.09929682680944-1)/1.09929682680944,2.2222222222222223)},O80=($)=>{let Z=kV($.r),J=kV($.g),H=kV($.b),B={mode:"xyz65",x:0.6369580483012911*Z+0.1446169035862083*J+0.1688809751641721*H,y:0.262700212011267*Z+0.6779980715188708*J+0.059301716469862*H,z:0*Z+0.0280726930490874*J+1.0609850577107909*H};if($.alpha!==void 0)B.alpha=$.alpha;return B},IV=O80;var T80={...k8,mode:"rec2020",fromMode:{xyz65:RV,rgb:($)=>RV(d4($))},toMode:{xyz65:IV,rgb:($)=>l4(IV($))},parse:["rec2020"],serialize:"rec2020"},sI=T80;var a6=0.0037930732552754493,mY=Math.cbrt(0.0037930732552754493);var yV=($)=>Math.cbrt($)-mY,C80=($)=>{let{r:Z,g:J,b:H,alpha:B}=I8($),Q=yV(0.3*Z+0.622*J+0.078*H+a6),X=yV(0.23*Z+0.692*J+0.078*H+a6),z=yV(0.2434226892454782*Z+0.2047674442449682*J+0.5518098665095535*H+a6),G={mode:"xyb",x:(Q-X)/2,y:(Q+X)/2,b:z-(Q+X)/2};if(B!==void 0)G.alpha=B;return G},tI=C80;var xV=($)=>Math.pow($+mY,3),E80=({x:$,y:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B=xV($+Z)-a6,Q=xV(Z-$)-a6,X=xV(J+Z)-a6,z=y8({r:11.031566904639861*B-9.866943908131562*Q-0.16462299650829934*X,g:-3.2541473810744237*B+4.418770377582723*Q-0.16462299650829934*X,b:-3.6588512867136815*B+2.7129230459360922*Q+1.9459282407775895*X});if(H!==void 0)z.alpha=H;return z},eI=E80;var b80={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:eI},fromMode:{rgb:tI},ranges:{x:[-0.0154,0.0281],y:[0,0.8453],b:[-0.2778,0.388]},interpolate:{x:E0,y:E0,b:E0,alpha:{use:E0,fixup:I1}}},$y=b80;var w80={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:d9,lab:EJ},fromMode:{rgb:l9,lab:CJ},channels:["x","y","z","alpha"],ranges:{x:[0,0.964],y:[0,0.999],z:[0,0.825]},interpolate:{x:E0,y:E0,z:E0,alpha:{use:E0,fixup:I1}}},Zy=w80;var S80=($)=>{let{x:Z,y:J,z:H,alpha:B}=$;if(Z===void 0)Z=0;if(J===void 0)J=0;if(H===void 0)H=0;let Q={mode:"xyz50",x:1.0479298208405488*Z+0.0229467933410191*J-0.0501922295431356*H,y:0.0296278156881593*Z+0.990434484573249*J-0.0170738250293851*H,z:-0.0092430581525912*Z+0.0150551448965779*J+0.7518742899580008*H};if(B!==void 0)Q.alpha=B;return Q},Jy=S80;var R80=($)=>{let{x:Z,y:J,z:H,alpha:B}=$;if(Z===void 0)Z=0;if(J===void 0)J=0;if(H===void 0)H=0;let Q={mode:"xyz65",x:0.9554734527042182*Z-0.0230985368742614*J+0.0632593086610217*H,y:-0.0283697069632081*Z+1.0099954580058226*J+0.021041398966943*H,z:0.0123140016883199*Z-0.0205076964334779*J+1.3303659366080753*H};if(B!==void 0)Q.alpha=B;return Q},Hy=R80;var k80={mode:"xyz65",toMode:{rgb:l4,xyz50:Jy},fromMode:{rgb:d4,xyz50:Hy},ranges:{x:[0,0.95],y:[0,1],z:[0,1.088]},channels:["x","y","z","alpha"],parse:["xyz","xyz-d65"],serialize:"xyz-d65",interpolate:{x:E0,y:E0,z:E0,alpha:{use:E0,fixup:I1}}},By=k80;var I80=({r:$,g:Z,b:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B={mode:"yiq",y:0.29889531*$+0.58662247*Z+0.11448223*J,i:0.59597799*$-0.2741761*Z-0.32180189*J,q:0.21147017*$-0.52261711*Z+0.31114694*J};if(H!==void 0)B.alpha=H;return B},Qy=I80;var y80=({y:$,i:Z,q:J,alpha:H})=>{if($===void 0)$=0;if(Z===void 0)Z=0;if(J===void 0)J=0;let B={mode:"rgb",r:$+0.95608445*Z+0.6208885*J,g:$-0.27137664*Z-0.6486059*J,b:$-1.10561724*Z+1.70250126*J};if(H!==void 0)B.alpha=H;return B},Xy=y80;var x80={mode:"yiq",toMode:{rgb:Xy},fromMode:{rgb:Qy},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-0.595,0.595],q:[-0.522,0.522]},interpolate:{y:E0,i:E0,q:E0,alpha:{use:E0,fixup:I1}}},zy=x80;function hV($){let Z=UY("lrgb")($);return 0.2126*Z.r+0.7152*Z.g+0.0722*Z.b}var ia0=z5(YI),ra0=z5(LI),aa0=z5(_I),oa0=z5(jI),na0=z5(OI),sa0=z5(LY),ta0=z5(MY),ea0=z5(wI),$o0=z5(SI),Zo0=z5(kI),Jo0=z5(II),Ho0=z5(bJ),Bo0=z5(xI),Qo0=z5(wJ),Xo0=z5(vI),zo0=z5(mI),Go0=z5(uI),Uo0=z5(pI),Yo0=z5(cI),Ko0=z5(dI),Fo0=z5(iI),Wo0=z5(aI),qo0=z5(oI),No0=z5(nI),Ao0=z5(sI),Do0=z5(k8),Vo0=z5($y),Lo0=z5(Zy),Mo0=z5(By),Po0=z5(zy);var o6={sans:{label:"Sans",sans:"system-ui",mono:"Geist Mono",googleFontsQuery:"Geist+Mono:wght@400;500"},serif:{label:"Serif",sans:"Literata",mono:"Geist Mono",googleFontsQuery:"Literata:wght@400;600;700&family=Geist+Mono:wght@400;500"},mono:{label:"Mono",sans:"Geist Mono",mono:"Geist Mono",googleFontsQuery:"Geist+Mono:wght@400;500;600"},geometric:{label:"Geometric",sans:"Manrope",mono:"Geist Mono",googleFontsQuery:"Manrope:wght@400;500;600&family=Geist+Mono:wght@400;500"},rounded:{label:"Rounded",sans:"SN Pro",mono:"Geist Mono",googleFontsQuery:"SN+Pro:wght@400;500;600&family=Geist+Mono:wght@400;500"},blobby:{label:"Blobby",sans:"Sour Gummy",mono:"Azeret Mono",googleFontsQuery:"Sour+Gummy:wght@400;500;600&family=Azeret+Mono:wght@400;500"},awkward:{label:"Awkward",sans:"Averia Sans Libre",mono:"Azeret Mono",googleFontsQuery:"Averia+Sans+Libre:wght@400;500;600&family=Azeret+Mono:wght@400;500"},comic:{label:"Comic",sans:"Comic Sans MS, Comic Sans, cursive",mono:"Geist Mono",googleFontsQuery:"Geist+Mono:wght@400;500"}},JQ={squishy:{label:"Squishy",radius:"0.875rem"},soft:{label:"Soft",radius:"0.625rem"},subtle:{label:"Subtle",radius:"0.375rem"},square:{label:"Square",radius:"0"}},HQ={blob:{label:"Blob",traits:{shape:0.11,"body.r":0.5,"body.ratio":0,"body.n":0.5}},boxy:{label:"Boxy",traits:{shape:0.54,"body.r":1,"body.ratio":0}},pill:{label:"Pill",traits:{shape:0.65,"body.r":1}},dorito:{label:"Dorito",traits:{shape:0.99,"body.r":1,"body.ratio":0,"body.rot":0}}},vV="oklch(0.205 0 0)";function Gy($){return hV($)>0.3?"oklch(0 0 0)":"oklch(1 0 0)"}var Uy={workspace:{primary:($)=>$,primaryForeground:($)=>Gy($),background:()=>"color-mix(in srgb, var(--primary) 2%, oklch(1 0 0) 98%)",foreground:()=>"color-mix(in srgb, var(--primary) 20%, oklch(0 0 0) 80%)",muted:()=>"color-mix(in srgb, var(--background) 95%, var(--foreground) 5%)",mutedForeground:()=>"color-mix(in srgb, var(--background) 50%, var(--foreground) 50%)",accent:()=>"color-mix(in srgb, var(--primary) 3%, var(--foreground) 4%)",accentForeground:()=>"var(--foreground)",border:()=>"color-mix(in srgb, var(--foreground) 7%, transparent)",ring:()=>"color-mix(in srgb, var(--background) 50%, var(--primary) 50%)"},widget:{background:($)=>$,foreground:($)=>Gy($),primary:()=>"color-mix(in srgb, var(--background) 2%, oklch(1 0 0) 98%)",primaryForeground:()=>"color-mix(in srgb, var(--background) 20%, oklch(0 0 0) 80%)",muted:()=>"color-mix(in srgb, var(--background) 95%, var(--foreground) 5%)",mutedForeground:()=>"color-mix(in srgb, var(--background) 50%, var(--foreground) 50%)",accent:()=>"color-mix(in srgb, var(--primary) 3%, var(--foreground) 4%)",accentForeground:()=>"var(--foreground)",border:()=>"color-mix(in srgb, var(--foreground) 15%, transparent)",ring:()=>"color-mix(in srgb, var(--background) 50%, var(--primary) 50%)"}},gV=Object.keys(Uy.workspace);function fV($,Z="workspace"){let J={},H=Uy[Z];for(let B of gV)J[B]=H[B]($);return J}var pY={default:{label:"Default"},paper:{label:"Paper",primary:"oklch(0.4328 0.0351 66.67)"},rose:{label:"Rose",primary:"oklch(0.6322 0.2171 26.02)"},tangerine:{label:"Tangerine",primary:"oklch(0.6886 0.22 37.15)"},sand:{label:"Sand",primary:"oklch(0.8334 0.1271 67.80)"},mint:{label:"Tropics",primary:"oklch(0.5774 0.1399 156.06)"},sky:{label:"Sky",primary:"oklch(0.5824 0.1830 253.59)"},lavender:{label:"Lavender",primary:"oklch(0.6025 0.2426 294.58)"}},r9={font:"sans",color:"default",radius:"soft",agent:"boxy"};function uY($,Z,J){return typeof $==="string"&&Object.hasOwn(Z,$)?$:J}function Q9($){return{font:uY($?.font,o6,r9.font),color:uY($?.color,pY,r9.color),radius:uY($?.radius,JQ,r9.radius),agent:uY($?.agent,HQ,r9.agent)}}function cY($,Z="workspace"){let J=Q9($),B=pY[J.color].primary??(Z==="widget"?vV:void 0);return B?fV(B,Z):void 0}var BQ=P(c(),1),QQ={"claude-code":sU,openclaw:$Y,codex:eU,hermes:tU};function h80($,Z,J){switch($?.type){case"emoji":return BQ.jsx("span",{"aria-hidden":"true",className:X0("flex size-full translate-y-[2cqi] items-center justify-center font-[Apple_Color_Emoji,Segoe_UI_Emoji,Noto_Color_Emoji,sans-serif] leading-none",Z?"text-[60cqi]":"text-[85cqi]"),children:$.value});case"upload":return BQ.jsx("img",{src:$.value,alt:"",className:"size-full"});case"glyph":{let H=XY($.value);if(H)return Yy.createElement(H,{"aria-hidden":!0,stroke:1.75,className:Z?"size-[70%]":"size-[95%] text-foreground"})}default:return BQ.jsx("img",{src:J,alt:"",className:"size-[95%]"})}}function n6({className:$,icon:Z,workspaceType:J,workspaceTheme:H}){let B=Z?.type!=="upload"&&Z?.background==="theme",Q=B?cY(H)??fV(vV):void 0,X=QQ[J??"claude-code"];return BQ.jsx("span",{className:X0("@container inline-flex shrink-0 items-center justify-center overflow-hidden",B&&"shadow-[inset_0_0_1rem_rgba(255,255,255,0.3)]",$),style:Q?{backgroundColor:Q.primary,color:Q.primaryForeground}:void 0,children:h80(Z,B,X)})}var mV=P(c(),1),uV={"claude-code":"Claude Code",openclaw:"OpenClaw",codex:"Codex",hermes:"Hermes"};function Ky({types:$}){let Z=$.map((J)=>uV[J]).join(", ");return mV.jsx("span",{role:"img","aria-label":Z,className:"inline-flex shrink-0 items-center -space-x-0.5",children:$.map((J)=>mV.jsx("img",{src:QQ[J],alt:"",className:"size-4 shrink-0 rounded-full bg-muted ring-2 ring-muted"},J))})}function C$($){if("types"in $)return $.path.split("/").pop()||$.path;if($.name)return $.name;if($.type==="openclaw")return $.agentId??"OpenClaw agent";if($.type==="hermes")return $.agentId??"Hermes agent";return $.path.split("/").pop()||$.path}var G5=P(c(),1),v80="Choose which agent moi will use to build your workspace",g80={openclaw:"To connect an OpenClaw agent, run",hermes:"To connect a Hermes agent, run"},f80={openclaw:"moi openclaw init",hermes:"moi hermes init"},m80={"claude-code":"Anthropic",codex:"OpenAI",openclaw:"Open-source",hermes:"Nous Research"};function u80({availability:$,detectedTypes:Z=[]}){return VJ.map((J)=>{let H=$?.[J],B=H&&H.status!=="available"?H.reason:void 0,Q=!Z.includes(J)?g80[J]:void 0,X=!Z.includes(J)?f80[J]:void 0,z=B??Q;return{type:J,description:m80[J],disabled:Boolean(z),...z?{disabledReason:z}:{},...!B&&X?{disabledCommand:X}:{}}})}function p80($,Z){let J=$.find((H)=>H.type===Z);if(J&&!J.disabled)return J.type;return $.find((H)=>!H.disabled)?.type}function lY({title:$,selectedType:Z,detectedTypes:J,availability:H,isPending:B,errorMessage:Q,secondaryAction:X,primaryLabel:z,pendingLabel:G,onTypeChange:U,onSubmit:Y}){let K=S1((D)=>D.hasSentMessageFromMoi),F=u80({availability:H,detectedTypes:J}),W=p80(F,Z),q=W!==Z,N=W==="claude-code"?"Tip: you can use your existing Claude subscription in moi":W==="codex"?"Tip: you can use your existing ChatGPT subscription in moi":void 0;return Fy.useEffect(()=>{if(W&&q)U(W)},[U,W,q]),G5.jsxs("div",{className:"flex flex-col gap-5",children:[G5.jsxs("div",{className:"flex flex-col gap-0.5 pr-8",children:[G5.jsx(y6,{children:$}),G5.jsx(AJ,{children:v80})]}),G5.jsxs("div",{className:"flex flex-col gap-4",children:[G5.jsx(c80,{options:F,selectedType:q?void 0:Z,onTypeChange:U}),!K&&N&&G5.jsx("p",{className:"text-sm text-muted-foreground",children:N})]}),Q&&G5.jsx("p",{role:"alert",className:"text-xs text-destructive",children:Q}),G5.jsxs("div",{className:"flex items-center justify-end gap-2",children:[X,G5.jsx(P0,{onClick:Y,disabled:B||q,children:B&&G?G:z})]})]})}function c80({options:$,selectedType:Z,onTypeChange:J}){return G5.jsx("div",{role:"group","aria-label":"Agent",className:X0("grid gap-2",$.length>2?"grid-cols-4":"grid-cols-2"),children:$.map((H)=>G5.jsx(d80,{option:H,selected:Z===H.type,onSelect:J},H.type))})}function d80({option:$,selected:Z,onSelect:J}){let H=Boolean($.disabledReason),B=G5.jsxs("button",{type:"button",disabled:$.disabled&&!H,"aria-disabled":$.disabled||void 0,"aria-pressed":Z,onClick:(Q)=>{if($.disabled){Q.preventDefault();return}J($.type)},className:X0("relative flex w-full flex-col items-start justify-between gap-6 rounded-xl bg-card p-4 text-left ring-1 ring-border transition-opacity outline-none focus-visible:ring-3 focus-visible:ring-ring/50",!Z&&"opacity-70",!Z&&!$.disabled&&"cursor-pointer hover:opacity-100",$.disabled&&"cursor-not-allowed"),children:[G5.jsxs("span",{className:"relative inline-flex",children:[G5.jsx(l80,{type:$.type}),Z&&G5.jsx(dY,{size:16,stroke:1.75,"aria-hidden":"true",className:"absolute -top-1.5 -right-1.5"})]}),G5.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[G5.jsx("span",{className:"text-sm font-medium text-foreground",children:uV[$.type]}),G5.jsx("span",{className:"text-xs leading-4 text-muted-foreground",children:$.description})]})]});if(!H)return B;return G5.jsxs(a1,{children:[G5.jsx(o1,{render:B}),G5.jsx(n1,{className:X0("max-w-64",$.disabledCommand&&"max-w-none leading-5"),children:G5.jsxs("span",{className:"text-center",children:[$.disabledReason,$.disabledCommand&&G5.jsxs(G5.Fragment,{children:[G5.jsx("br",{}),G5.jsx("code",{className:"rounded-xs bg-accent px-1 py-0.5 font-mono whitespace-nowrap",children:$.disabledCommand})]})]})})]})}function l80({type:$}){return G5.jsx("img",{src:QQ[$],alt:"",className:"size-8 shrink-0"})}var Wy=P(c(),1);function iY({children:$,showCloseButton:Z=!0}){return Wy.jsx(NJ,{showCloseButton:Z,className:"block w-[calc(100%-2rem)] max-w-xl overflow-hidden p-6 sm:max-w-xl",children:$})}var S5=P(c(),1),qy=VJ[0];function zQ({trigger:$}){let[,Z]=M8(),J=R8(),H=jU(),B=mS(),[Q,X]=XQ.useState(!1),[z,G]=XQ.useState("agent"),[U,Y]=XQ.useState(qy),[K,F]=XQ.useState(""),W=K.trim(),q=W?gR(W):null,N=B.isPending;if(J.cloudDemo)return S5.jsx(MJ,{trigger:$});function D(j){X(!1),Z(`/workspace/${j}`)}function A(){G("agent"),Y(qy),F(""),B.reset()}function V(){B.reset(),G("name")}function L(){if(!W||q||N)return;B.reset(),B.mutate({name:W,type:U},{onSuccess:(j)=>D(j.id)})}return S5.jsxs(I6,{open:Q,onOpenChange:X,onOpenChangeComplete:(j)=>{if(!j)A()},children:[S5.jsx(x3,{render:$}),S5.jsx(iY,{children:z==="agent"?S5.jsx(lY,{title:"Create new workspace",selectedType:U,availability:H.data?.availability,isPending:!1,secondaryAction:S5.jsx(r80,{}),primaryLabel:"Next",onTypeChange:Y,onSubmit:V}):S5.jsx(i80,{name:K,validationError:q,requestError:B.error?.message,isPending:N,onNameChange:F,onSubmit:L})})]})}function i80({name:$,validationError:Z,requestError:J,isPending:H,onNameChange:B,onSubmit:Q}){function X(z){z.preventDefault(),Q()}return S5.jsxs("form",{className:"flex flex-col gap-5",onSubmit:X,children:[S5.jsxs("div",{className:"flex flex-col gap-0.5 pr-8",children:[S5.jsx(y6,{children:"Create new workspace"}),S5.jsx(AJ,{children:"Give it a short and recognizable name"})]}),S5.jsxs("div",{className:"flex flex-col gap-2",children:[S5.jsx("label",{htmlFor:"workspace-name",className:"sr-only",children:"Workspace name"}),S5.jsx(P$,{id:"workspace-name",value:$,onChange:(z)=>B(z.target.value),placeholder:"my-workspace",autoFocus:!0,"aria-invalid":Boolean(Z),"aria-describedby":Z?"workspace-name-error":void 0,autoComplete:"off",spellCheck:!1}),Z&&S5.jsx("p",{id:"workspace-name-error",role:"alert",className:"text-xs text-destructive",children:Z})]}),J&&S5.jsx("p",{role:"alert",className:"text-xs text-destructive",children:J}),S5.jsx("div",{className:"flex items-center justify-end gap-2",children:S5.jsx(P0,{type:"submit",disabled:!$.trim()||Boolean(Z)||H,children:H?"Creating…":"Create workspace"})})]})}function r80(){return S5.jsxs(a1,{children:[S5.jsx(o1,{render:S5.jsx(P0,{variant:"secondary","aria-disabled":!0,onClick:(Z)=>Z.preventDefault(),className:"cursor-not-allowed opacity-50",children:"Use existing folder"})}),S5.jsx(n1,{className:"max-w-64",children:S5.jsxs("span",{className:"text-center",children:["Not supported yet — run"," ",S5.jsx("code",{className:"rounded-xs bg-accent px-1 py-0.5 font-mono whitespace-nowrap",children:"moi init"})," ","in the folder from your console to add it"]})})]})}var t6=P(m(),1);var V0=P(m(),1),R$=P(B8(),1);var U2=P(m(),1);var GQ=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function E$($){let Z=Object.prototype.toString.call($);return Z==="[object Window]"||Z==="[object global]"}function rY($){return"nodeType"in $}function G4($){var Z,J;if(!$)return window;if(E$($))return $;if(!rY($))return window;return(Z=(J=$.ownerDocument)==null?void 0:J.defaultView)!=null?Z:window}function aY($){let{Document:Z}=G4($);return $ instanceof Z}function RJ($){if(E$($))return!1;return $ instanceof G4($).HTMLElement}function cV($){return $ instanceof G4($).SVGElement}function b$($){if(!$)return document;if(E$($))return $.document;if(!rY($))return document;if(aY($))return $;if(RJ($)||cV($))return $.ownerDocument;return document}var a9=GQ?U2.useLayoutEffect:U2.useEffect;function UQ($){let Z=U2.useRef($);return a9(()=>{Z.current=$}),U2.useCallback(function(){for(var J=arguments.length,H=Array(J),B=0;B<J;B++)H[B]=arguments[B];return Z.current==null?void 0:Z.current(...H)},[])}function Ay(){let $=U2.useRef(null),Z=U2.useCallback((H,B)=>{$.current=setInterval(H,B)},[]),J=U2.useCallback(()=>{if($.current!==null)clearInterval($.current),$.current=null},[]);return[Z,J]}function kJ($,Z){if(Z===void 0)Z=[$];let J=U2.useRef($);return a9(()=>{if(J.current!==$)J.current=$},Z),J}function IJ($,Z){let J=U2.useRef();return U2.useMemo(()=>{let H=$(J.current);return J.current=H,H},[...Z])}function YQ($){let Z=UQ($),J=U2.useRef(null),H=U2.useCallback((B)=>{if(B!==J.current)Z==null||Z(B,J.current);J.current=B},[]);return[J,H]}function KQ($){let Z=U2.useRef();return U2.useEffect(()=>{Z.current=$},[$]),Z.current}var pV={};function FQ($,Z){return U2.useMemo(()=>{if(Z)return Z;let J=pV[$]==null?0:pV[$]+1;return pV[$]=J,$+"-"+J},[$,Z])}function Dy($){return function(Z){for(var J=arguments.length,H=Array(J>1?J-1:0),B=1;B<J;B++)H[B-1]=arguments[B];return H.reduce((Q,X)=>{let z=Object.entries(X);for(let[G,U]of z){let Y=Q[G];if(Y!=null)Q[G]=Y+$*U}return Q},{...Z})}}var w$=Dy(1),WQ=Dy(-1);function a80($){return"clientX"in $&&"clientY"in $}function oY($){if(!$)return!1;let{KeyboardEvent:Z}=G4($.target);return Z&&$ instanceof Z}function o80($){if(!$)return!1;let{TouchEvent:Z}=G4($.target);return Z&&$ instanceof Z}function qQ($){if(o80($)){if($.touches&&$.touches.length){let{clientX:Z,clientY:J}=$.touches[0];return{x:Z,y:J}}else if($.changedTouches&&$.changedTouches.length){let{clientX:Z,clientY:J}=$.changedTouches[0];return{x:Z,y:J}}}if(a80($))return{x:$.clientX,y:$.clientY};return null}var SJ=Object.freeze({Translate:{toString($){if(!$)return;let{x:Z,y:J}=$;return"translate3d("+(Z?Math.round(Z):0)+"px, "+(J?Math.round(J):0)+"px, 0)"}},Scale:{toString($){if(!$)return;let{scaleX:Z,scaleY:J}=$;return"scaleX("+Z+") scaleY("+J+")"}},Transform:{toString($){if(!$)return;return[SJ.Translate.toString($),SJ.Scale.toString($)].join(" ")}},Transition:{toString($){let{property:Z,duration:J,easing:H}=$;return Z+" "+J+"ms "+H}}}),Ny="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Vy($){if($.matches(Ny))return $;return $.querySelector(Ny)}var S$=P(m(),1),n80={display:"none"};function Ly($){let{id:Z,value:J}=$;return S$.default.createElement("div",{id:Z,style:n80},J)}function My($){let{id:Z,announcement:J,ariaLiveType:H="assertive"}=$,B={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return S$.default.createElement("div",{id:Z,style:B,role:"status","aria-live":H,"aria-atomic":!0},J)}function Py(){let[$,Z]=S$.useState("");return{announce:S$.useCallback((H)=>{if(H!=null)Z(H)},[]),announcement:$}}var yy=V0.createContext(null);function s80($){let Z=V0.useContext(yy);V0.useEffect(()=>{if(!Z)throw Error("useDndMonitor must be used within a children of <DndContext>");return Z($)},[$,Z])}function t80(){let[$]=V0.useState(()=>new Set),Z=V0.useCallback((H)=>{return $.add(H),()=>$.delete(H)},[$]);return[V0.useCallback((H)=>{let{type:B,event:Q}=H;$.forEach((X)=>{var z;return(z=X[B])==null?void 0:z.call(X,Q)})},[$]),Z]}var e80={draggable:`
15
- To pick up a draggable item, press the space bar.
16
- While dragging, use the arrow keys to move the item.
17
- Press space again to drop the item in its new position, or press escape to cancel.
18
- `},$90={onDragStart($){let{active:Z}=$;return"Picked up draggable item "+Z.id+"."},onDragOver($){let{active:Z,over:J}=$;if(J)return"Draggable item "+Z.id+" was moved over droppable area "+J.id+".";return"Draggable item "+Z.id+" is no longer over a droppable area."},onDragEnd($){let{active:Z,over:J}=$;if(J)return"Draggable item "+Z.id+" was dropped over droppable area "+J.id;return"Draggable item "+Z.id+" was dropped."},onDragCancel($){let{active:Z}=$;return"Dragging was cancelled. Draggable item "+Z.id+" was dropped."}};function Z90($){let{announcements:Z=$90,container:J,hiddenTextDescribedById:H,screenReaderInstructions:B=e80}=$,{announce:Q,announcement:X}=Py(),z=FQ("DndLiveRegion"),[G,U]=V0.useState(!1);if(V0.useEffect(()=>{U(!0)},[]),s80(V0.useMemo(()=>({onDragStart(K){let{active:F}=K;Q(Z.onDragStart({active:F}))},onDragMove(K){let{active:F,over:W}=K;if(Z.onDragMove)Q(Z.onDragMove({active:F,over:W}))},onDragOver(K){let{active:F,over:W}=K;Q(Z.onDragOver({active:F,over:W}))},onDragEnd(K){let{active:F,over:W}=K;Q(Z.onDragEnd({active:F,over:W}))},onDragCancel(K){let{active:F,over:W}=K;Q(Z.onDragCancel({active:F,over:W}))}}),[Q,Z])),!G)return null;let Y=V0.default.createElement(V0.default.Fragment,null,V0.default.createElement(Ly,{id:H,value:B.draggable}),V0.default.createElement(My,{id:z,announcement:X}));return J?R$.createPortal(Y,J):Y}var A2;(function($){$.DragStart="dragStart",$.DragMove="dragMove",$.DragEnd="dragEnd",$.DragCancel="dragCancel",$.DragOver="dragOver",$.RegisterDroppable="registerDroppable",$.SetDroppableDisabled="setDroppableDisabled",$.UnregisterDroppable="unregisterDroppable"})(A2||(A2={}));function sY(){}function nV($,Z){return V0.useMemo(()=>({sensor:$,options:Z!=null?Z:{}}),[$,Z])}function xy(){for(var $=arguments.length,Z=Array($),J=0;J<$;J++)Z[J]=arguments[J];return V0.useMemo(()=>[...Z].filter((H)=>H!=null),[...Z])}var X9=Object.freeze({x:0,y:0});function J90($,Z){return Math.sqrt(Math.pow($.x-Z.x,2)+Math.pow($.y-Z.y,2))}function H90($,Z){let J=qQ($);if(!J)return"0 0";let H={x:(J.x-Z.left)/Z.width*100,y:(J.y-Z.top)/Z.height*100};return H.x+"% "+H.y+"%"}function B90($,Z){let{data:{value:J}}=$,{data:{value:H}}=Z;return J-H}function Q90($,Z){let{data:{value:J}}=$,{data:{value:H}}=Z;return H-J}function X90($,Z){if(!$||$.length===0)return null;let[J]=$;return Z?J[Z]:J}function _y($,Z,J){if(Z===void 0)Z=$.left;if(J===void 0)J=$.top;return{x:Z+$.width*0.5,y:J+$.height*0.5}}var hy=($)=>{let{collisionRect:Z,droppableRects:J,droppableContainers:H}=$,B=_y(Z,Z.left,Z.top),Q=[];for(let X of H){let{id:z}=X,G=J.get(z);if(G){let U=J90(_y(G),B);Q.push({id:z,data:{droppableContainer:X,value:U}})}}return Q.sort(B90)};function z90($,Z){let J=Math.max(Z.top,$.top),H=Math.max(Z.left,$.left),B=Math.min(Z.left+Z.width,$.left+$.width),Q=Math.min(Z.top+Z.height,$.top+$.height),X=B-H,z=Q-J;if(H<B&&J<Q){let G=Z.width*Z.height,U=$.width*$.height,Y=X*z,K=Y/(G+U-Y);return Number(K.toFixed(4))}return 0}var G90=($)=>{let{collisionRect:Z,droppableRects:J,droppableContainers:H}=$,B=[];for(let Q of H){let{id:X}=Q,z=J.get(X);if(z){let G=z90(z,Z);if(G>0)B.push({id:X,data:{droppableContainer:Q,value:G}})}}return B.sort(Q90)};function U90($,Z,J){return{...$,scaleX:Z&&J?Z.width/J.width:1,scaleY:Z&&J?Z.height/J.height:1}}function vy($,Z){return $&&Z?{x:$.left-Z.left,y:$.top-Z.top}:X9}function Y90($){return function(J){for(var H=arguments.length,B=Array(H>1?H-1:0),Q=1;Q<H;Q++)B[Q-1]=arguments[Q];return B.reduce((X,z)=>({...X,top:X.top+$*z.y,bottom:X.bottom+$*z.y,left:X.left+$*z.x,right:X.right+$*z.x}),{...J})}}var K90=Y90(1);function gy($){if($.startsWith("matrix3d(")){let Z=$.slice(9,-1).split(/, /);return{x:+Z[12],y:+Z[13],scaleX:+Z[0],scaleY:+Z[5]}}else if($.startsWith("matrix(")){let Z=$.slice(7,-1).split(/, /);return{x:+Z[4],y:+Z[5],scaleX:+Z[0],scaleY:+Z[3]}}return null}function F90($,Z,J){let H=gy(Z);if(!H)return $;let{scaleX:B,scaleY:Q,x:X,y:z}=H,G=$.left-X-(1-B)*parseFloat(J),U=$.top-z-(1-Q)*parseFloat(J.slice(J.indexOf(" ")+1)),Y=B?$.width/B:$.width,K=Q?$.height/Q:$.height;return{width:Y,height:K,top:U,right:G+Y,bottom:U+K,left:G}}var W90={ignoreTransform:!1};function DQ($,Z){if(Z===void 0)Z=W90;let J=$.getBoundingClientRect();if(Z.ignoreTransform){let{transform:U,transformOrigin:Y}=G4($).getComputedStyle($);if(U)J=F90(J,U,Y)}let{top:H,left:B,width:Q,height:X,bottom:z,right:G}=J;return{top:H,left:B,width:Q,height:X,bottom:z,right:G}}function jy($){return DQ($,{ignoreTransform:!0})}function q90($){let{innerWidth:Z,innerHeight:J}=$;return{top:0,left:0,right:Z,bottom:J,width:Z,height:J}}function N90($,Z){if(Z===void 0)Z=G4($).getComputedStyle($);return Z.position==="fixed"}function A90($,Z){if(Z===void 0)Z=G4($).getComputedStyle($);let J=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((B)=>{let Q=Z[B];return typeof Q==="string"?J.test(Q):!1})}function sV($,Z){let J=[];function H(B){if(Z!=null&&J.length>=Z)return J;if(!B)return J;if(aY(B)&&B.scrollingElement!=null&&!J.includes(B.scrollingElement))return J.push(B.scrollingElement),J;if(!RJ(B)||cV(B))return J;if(J.includes(B))return J;let Q=G4($).getComputedStyle(B);if(B!==$){if(A90(B,Q))J.push(B)}if(N90(B,Q))return J;return H(B.parentNode)}if(!$)return J;return H($)}function fy($){let[Z]=sV($,1);return Z!=null?Z:null}function dV($){if(!GQ||!$)return null;if(E$($))return $;if(!rY($))return null;if(aY($)||$===b$($).scrollingElement)return window;if(RJ($))return $;return null}function my($){if(E$($))return $.scrollX;return $.scrollLeft}function uy($){if(E$($))return $.scrollY;return $.scrollTop}function rV($){return{x:my($),y:uy($)}}var y2;(function($){$[$.Forward=1]="Forward",$[$.Backward=-1]="Backward"})(y2||(y2={}));function py($){if(!GQ||!$)return!1;return $===document.scrollingElement}function cy($){let Z={x:0,y:0},J=py($)?{height:window.innerHeight,width:window.innerWidth}:{height:$.clientHeight,width:$.clientWidth},H={x:$.scrollWidth-J.width,y:$.scrollHeight-J.height},B=$.scrollTop<=Z.y,Q=$.scrollLeft<=Z.x,X=$.scrollTop>=H.y,z=$.scrollLeft>=H.x;return{isTop:B,isLeft:Q,isBottom:X,isRight:z,maxScroll:H,minScroll:Z}}var D90={x:0.2,y:0.2};function V90($,Z,J,H,B){let{top:Q,left:X,right:z,bottom:G}=J;if(H===void 0)H=10;if(B===void 0)B=D90;let{isTop:U,isBottom:Y,isLeft:K,isRight:F}=cy($),W={x:0,y:0},q={x:0,y:0},N={height:Z.height*B.y,width:Z.width*B.x};if(!U&&Q<=Z.top+N.height)W.y=y2.Backward,q.y=H*Math.abs((Z.top+N.height-Q)/N.height);else if(!Y&&G>=Z.bottom-N.height)W.y=y2.Forward,q.y=H*Math.abs((Z.bottom-N.height-G)/N.height);if(!F&&z>=Z.right-N.width)W.x=y2.Forward,q.x=H*Math.abs((Z.right-N.width-z)/N.width);else if(!K&&X<=Z.left+N.width)W.x=y2.Backward,q.x=H*Math.abs((Z.left+N.width-X)/N.width);return{direction:W,speed:q}}function L90($){if($===document.scrollingElement){let{innerWidth:Q,innerHeight:X}=window;return{top:0,left:0,right:Q,bottom:X,width:Q,height:X}}let{top:Z,left:J,right:H,bottom:B}=$.getBoundingClientRect();return{top:Z,left:J,right:H,bottom:B,width:$.clientWidth,height:$.clientHeight}}function dy($){return $.reduce((Z,J)=>{return w$(Z,rV(J))},X9)}function M90($){return $.reduce((Z,J)=>{return Z+my(J)},0)}function P90($){return $.reduce((Z,J)=>{return Z+uy(J)},0)}function ly($,Z){if(Z===void 0)Z=DQ;if(!$)return;let{top:J,left:H,bottom:B,right:Q}=Z($);if(!fy($))return;if(B<=0||Q<=0||J>=window.innerHeight||H>=window.innerWidth)$.scrollIntoView({block:"center",inline:"center"})}var _90=[["x",["left","right"],M90],["y",["top","bottom"],P90]];class eY{constructor($,Z){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let J=sV(Z),H=dy(J);this.rect={...$},this.width=$.width,this.height=$.height;for(let[B,Q,X]of _90)for(let z of Q)Object.defineProperty(this,z,{get:()=>{let G=X(J),U=H[B]-G;return this.rect[z]+U},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class yJ{constructor($){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((Z)=>{var J;return(J=this.target)==null?void 0:J.removeEventListener(...Z)})},this.target=$}add($,Z,J){var H;(H=this.target)==null||H.addEventListener($,Z,J),this.listeners.push([$,Z,J])}}function j90($){let{EventTarget:Z}=G4($);return $ instanceof Z?$:b$($)}function lV($,Z){let J=Math.abs($.x),H=Math.abs($.y);if(typeof Z==="number")return Math.sqrt(J**2+H**2)>Z;if("x"in Z&&"y"in Z)return J>Z.x&&H>Z.y;if("x"in Z)return J>Z.x;if("y"in Z)return H>Z.y;return!1}var x8;(function($){$.Click="click",$.DragStart="dragstart",$.Keydown="keydown",$.ContextMenu="contextmenu",$.Resize="resize",$.SelectionChange="selectionchange",$.VisibilityChange="visibilitychange"})(x8||(x8={}));function Oy($){$.preventDefault()}function O90($){$.stopPropagation()}var J5;(function($){$.Space="Space",$.Down="ArrowDown",$.Right="ArrowRight",$.Left="ArrowLeft",$.Up="ArrowUp",$.Esc="Escape",$.Enter="Enter",$.Tab="Tab"})(J5||(J5={}));var iy={start:[J5.Space,J5.Enter],cancel:[J5.Esc],end:[J5.Space,J5.Enter,J5.Tab]},T90=($,Z)=>{let{currentCoordinates:J}=Z;switch($.code){case J5.Right:return{...J,x:J.x+25};case J5.Left:return{...J,x:J.x-25};case J5.Down:return{...J,y:J.y+25};case J5.Up:return{...J,y:J.y-25}}return};class VQ{constructor($){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=$;let{event:{target:Z}}=$;this.props=$,this.listeners=new yJ(b$(Z)),this.windowListeners=new yJ(G4(Z)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(x8.Resize,this.handleCancel),this.windowListeners.add(x8.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(x8.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:$,onStart:Z}=this.props,J=$.node.current;if(J)ly(J);Z(X9)}handleKeyDown($){if(oY($)){let{active:Z,context:J,options:H}=this.props,{keyboardCodes:B=iy,coordinateGetter:Q=T90,scrollBehavior:X="smooth"}=H,{code:z}=$;if(B.end.includes(z)){this.handleEnd($);return}if(B.cancel.includes(z)){this.handleCancel($);return}let{collisionRect:G}=J.current,U=G?{x:G.left,y:G.top}:X9;if(!this.referenceCoordinates)this.referenceCoordinates=U;let Y=Q($,{active:Z,context:J.current,currentCoordinates:U});if(Y){let K=WQ(Y,U),F={x:0,y:0},{scrollableAncestors:W}=J.current;for(let q of W){let N=$.code,{isTop:D,isRight:A,isLeft:V,isBottom:L,maxScroll:j,minScroll:M}=cy(q),_=L90(q),w={x:Math.min(N===J5.Right?_.right-_.width/2:_.right,Math.max(N===J5.Right?_.left:_.left+_.width/2,Y.x)),y:Math.min(N===J5.Down?_.bottom-_.height/2:_.bottom,Math.max(N===J5.Down?_.top:_.top+_.height/2,Y.y))},T=N===J5.Right&&!A||N===J5.Left&&!V,b=N===J5.Down&&!L||N===J5.Up&&!D;if(T&&w.x!==Y.x){let C=q.scrollLeft+K.x,k=N===J5.Right&&C<=j.x||N===J5.Left&&C>=M.x;if(k&&!K.y){q.scrollTo({left:C,behavior:X});return}if(k)F.x=q.scrollLeft-C;else F.x=N===J5.Right?q.scrollLeft-j.x:q.scrollLeft-M.x;if(F.x)q.scrollBy({left:-F.x,behavior:X});break}else if(b&&w.y!==Y.y){let C=q.scrollTop+K.y,k=N===J5.Down&&C<=j.y||N===J5.Up&&C>=M.y;if(k&&!K.x){q.scrollTo({top:C,behavior:X});return}if(k)F.y=q.scrollTop-C;else F.y=N===J5.Down?q.scrollTop-j.y:q.scrollTop-M.y;if(F.y)q.scrollBy({top:-F.y,behavior:X});break}}this.handleMove($,w$(WQ(Y,this.referenceCoordinates),F))}}}handleMove($,Z){let{onMove:J}=this.props;$.preventDefault(),J(Z)}handleEnd($){let{onEnd:Z}=this.props;$.preventDefault(),this.detach(),Z()}handleCancel($){let{onCancel:Z}=this.props;$.preventDefault(),this.detach(),Z()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}VQ.activators=[{eventName:"onKeyDown",handler:($,Z,J)=>{let{keyboardCodes:H=iy,onActivation:B}=Z,{active:Q}=J,{code:X}=$.nativeEvent;if(H.start.includes(X)){let z=Q.activatorNode.current;if(z&&$.target!==z)return!1;return $.preventDefault(),B==null||B({event:$.nativeEvent}),!0}return!1}}];function Ty($){return Boolean($&&"distance"in $)}function Cy($){return Boolean($&&"delay"in $)}class $K{constructor($,Z,J){var H;if(J===void 0)J=j90($.event.target);this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=$,this.events=Z;let{event:B}=$,{target:Q}=B;this.props=$,this.events=Z,this.document=b$(Q),this.documentListeners=new yJ(this.document),this.listeners=new yJ(J),this.windowListeners=new yJ(G4(Q)),this.initialCoordinates=(H=qQ(B))!=null?H:X9,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:$,props:{options:{activationConstraint:Z,bypassActivationConstraint:J}}}=this;if(this.listeners.add($.move.name,this.handleMove,{passive:!1}),this.listeners.add($.end.name,this.handleEnd),$.cancel)this.listeners.add($.cancel.name,this.handleCancel);if(this.windowListeners.add(x8.Resize,this.handleCancel),this.windowListeners.add(x8.DragStart,Oy),this.windowListeners.add(x8.VisibilityChange,this.handleCancel),this.windowListeners.add(x8.ContextMenu,Oy),this.documentListeners.add(x8.Keydown,this.handleKeydown),Z){if(J!=null&&J({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Cy(Z)){this.timeoutId=setTimeout(this.handleStart,Z.delay),this.handlePending(Z);return}if(Ty(Z)){this.handlePending(Z);return}}this.handleStart()}detach(){if(this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null)clearTimeout(this.timeoutId),this.timeoutId=null}handlePending($,Z){let{active:J,onPending:H}=this.props;H(J,$,this.initialCoordinates,Z)}handleStart(){let{initialCoordinates:$}=this,{onStart:Z}=this.props;if($)this.activated=!0,this.documentListeners.add(x8.Click,O90,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(x8.SelectionChange,this.removeTextSelection),Z($)}handleMove($){var Z;let{activated:J,initialCoordinates:H,props:B}=this,{onMove:Q,options:{activationConstraint:X}}=B;if(!H)return;let z=(Z=qQ($))!=null?Z:X9,G=WQ(H,z);if(!J&&X){if(Ty(X)){if(X.tolerance!=null&&lV(G,X.tolerance))return this.handleCancel();if(lV(G,X.distance))return this.handleStart()}if(Cy(X)){if(lV(G,X.tolerance))return this.handleCancel()}this.handlePending(X,G);return}if($.cancelable)$.preventDefault();Q(z)}handleEnd(){let{onAbort:$,onEnd:Z}=this.props;if(this.detach(),!this.activated)$(this.props.active);Z()}handleCancel(){let{onAbort:$,onCancel:Z}=this.props;if(this.detach(),!this.activated)$(this.props.active);Z()}handleKeydown($){if($.code===J5.Esc)this.handleCancel()}removeTextSelection(){var $;($=this.document.getSelection())==null||$.removeAllRanges()}}var C90={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class LQ extends $K{constructor($){let{event:Z}=$,J=b$(Z.target);super($,C90,J)}}LQ.activators=[{eventName:"onPointerDown",handler:($,Z)=>{let{nativeEvent:J}=$,{onActivation:H}=Z;if(!J.isPrimary||J.button!==0)return!1;return H==null||H({event:J}),!0}}];var E90={move:{name:"mousemove"},end:{name:"mouseup"}},aV;(function($){$[$.RightClick=2]="RightClick"})(aV||(aV={}));class ry extends $K{constructor($){super($,E90,b$($.event.target))}}ry.activators=[{eventName:"onMouseDown",handler:($,Z)=>{let{nativeEvent:J}=$,{onActivation:H}=Z;if(J.button===aV.RightClick)return!1;return H==null||H({event:J}),!0}}];var iV={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class ay extends $K{constructor($){super($,iV)}static setup(){return window.addEventListener(iV.move.name,$,{capture:!1,passive:!1}),function(){window.removeEventListener(iV.move.name,$)};function $(){}}}ay.activators=[{eventName:"onTouchStart",handler:($,Z)=>{let{nativeEvent:J}=$,{onActivation:H}=Z,{touches:B}=J;if(B.length>1)return!1;return H==null||H({event:J}),!0}}];var NQ;(function($){$[$.Pointer=0]="Pointer",$[$.DraggableRect=1]="DraggableRect"})(NQ||(NQ={}));var tY;(function($){$[$.TreeOrder=0]="TreeOrder",$[$.ReversedTreeOrder=1]="ReversedTreeOrder"})(tY||(tY={}));function b90($){let{acceleration:Z,activator:J=NQ.Pointer,canScroll:H,draggingRect:B,enabled:Q,interval:X=5,order:z=tY.TreeOrder,pointerCoordinates:G,scrollableAncestors:U,scrollableAncestorRects:Y,delta:K,threshold:F}=$,W=S90({delta:K,disabled:!Q}),[q,N]=Ay(),D=V0.useRef({x:0,y:0}),A=V0.useRef({x:0,y:0}),V=V0.useMemo(()=>{switch(J){case NQ.Pointer:return G?{top:G.y,bottom:G.y,left:G.x,right:G.x}:null;case NQ.DraggableRect:return B}},[J,B,G]),L=V0.useRef(null),j=V0.useCallback(()=>{let _=L.current;if(!_)return;let w=D.current.x*A.current.x,T=D.current.y*A.current.y;_.scrollBy(w,T)},[]),M=V0.useMemo(()=>z===tY.TreeOrder?[...U].reverse():U,[z,U]);V0.useEffect(()=>{if(!Q||!U.length||!V){N();return}for(let _ of M){if((H==null?void 0:H(_))===!1)continue;let w=U.indexOf(_),T=Y[w];if(!T)continue;let{direction:b,speed:C}=V90(_,T,V,Z,F);for(let k of["x","y"])if(!W[k][b[k]])C[k]=0,b[k]=0;if(C.x>0||C.y>0){N(),L.current=_,q(j,X),D.current=C,A.current=b;return}}D.current={x:0,y:0},A.current={x:0,y:0},N()},[Z,j,H,N,Q,X,JSON.stringify(V),JSON.stringify(W),q,U,M,Y,JSON.stringify(F)])}var w90={x:{[y2.Backward]:!1,[y2.Forward]:!1},y:{[y2.Backward]:!1,[y2.Forward]:!1}};function S90($){let{delta:Z,disabled:J}=$,H=KQ(Z);return IJ((B)=>{if(J||!H||!B)return w90;let Q={x:Math.sign(Z.x-H.x),y:Math.sign(Z.y-H.y)};return{x:{[y2.Backward]:B.x[y2.Backward]||Q.x===-1,[y2.Forward]:B.x[y2.Forward]||Q.x===1},y:{[y2.Backward]:B.y[y2.Backward]||Q.y===-1,[y2.Forward]:B.y[y2.Forward]||Q.y===1}}},[J,Z,H])}function R90($,Z){let J=Z!=null?$.get(Z):void 0,H=J?J.node.current:null;return IJ((B)=>{var Q;if(Z==null)return null;return(Q=H!=null?H:B)!=null?Q:null},[H,Z])}function k90($,Z){return V0.useMemo(()=>$.reduce((J,H)=>{let{sensor:B}=H,Q=B.activators.map((X)=>({eventName:X.eventName,handler:Z(X.handler,H)}));return[...J,...Q]},[]),[$,Z])}var AQ;(function($){$[$.Always=0]="Always",$[$.BeforeDragging=1]="BeforeDragging",$[$.WhileDragging=2]="WhileDragging"})(AQ||(AQ={}));var oV;(function($){$.Optimized="optimized"})(oV||(oV={}));var Ey=new Map;function I90($,Z){let{dragging:J,dependencies:H,config:B}=Z,[Q,X]=V0.useState(null),{frequency:z,measure:G,strategy:U}=B,Y=V0.useRef($),K=D(),F=kJ(K),W=V0.useCallback(function(A){if(A===void 0)A=[];if(F.current)return;X((V)=>{if(V===null)return A;return V.concat(A.filter((L)=>!V.includes(L)))})},[F]),q=V0.useRef(null),N=IJ((A)=>{if(K&&!J)return Ey;if(!A||A===Ey||Y.current!==$||Q!=null){let V=new Map;for(let L of $){if(!L)continue;if(Q&&Q.length>0&&!Q.includes(L.id)&&L.rect.current){V.set(L.id,L.rect.current);continue}let j=L.node.current,M=j?new eY(G(j),j):null;if(L.rect.current=M,M)V.set(L.id,M)}return V}return A},[$,Q,J,K,G]);return V0.useEffect(()=>{Y.current=$},[$]),V0.useEffect(()=>{if(K)return;W()},[J,K]),V0.useEffect(()=>{if(Q&&Q.length>0)X(null)},[JSON.stringify(Q)]),V0.useEffect(()=>{if(K||typeof z!=="number"||q.current!==null)return;q.current=setTimeout(()=>{W(),q.current=null},z)},[z,K,W,...H]),{droppableRects:N,measureDroppableContainers:W,measuringScheduled:Q!=null};function D(){switch(U){case AQ.Always:return!1;case AQ.BeforeDragging:return J;default:return!J}}}function tV($,Z){return IJ((J)=>{if(!$)return null;if(J)return J;return typeof Z==="function"?Z($):$},[Z,$])}function y90($,Z){return tV($,Z)}function x90($){let{callback:Z,disabled:J}=$,H=UQ(Z),B=V0.useMemo(()=>{if(J||typeof window>"u"||typeof window.MutationObserver>"u")return;let{MutationObserver:Q}=window;return new Q(H)},[H,J]);return V0.useEffect(()=>{return()=>B==null?void 0:B.disconnect()},[B]),B}function ZK($){let{callback:Z,disabled:J}=$,H=UQ(Z),B=V0.useMemo(()=>{if(J||typeof window>"u"||typeof window.ResizeObserver>"u")return;let{ResizeObserver:Q}=window;return new Q(H)},[J]);return V0.useEffect(()=>{return()=>B==null?void 0:B.disconnect()},[B]),B}function h90($){return new eY(DQ($),$)}function by($,Z,J){if(Z===void 0)Z=h90;let[H,B]=V0.useState(null);function Q(){B((G)=>{if(!$)return null;if($.isConnected===!1){var U;return(U=G!=null?G:J)!=null?U:null}let Y=Z($);if(JSON.stringify(G)===JSON.stringify(Y))return G;return Y})}let X=x90({callback(G){if(!$)return;for(let U of G){let{type:Y,target:K}=U;if(Y==="childList"&&K instanceof HTMLElement&&K.contains($)){Q();break}}}}),z=ZK({callback:Q});return a9(()=>{if(Q(),$)z==null||z.observe($),X==null||X.observe(document.body,{childList:!0,subtree:!0});else z==null||z.disconnect(),X==null||X.disconnect()},[$]),H}function v90($){let Z=tV($);return vy($,Z)}var wy=[];function g90($){let Z=V0.useRef($),J=IJ((H)=>{if(!$)return wy;if(H&&H!==wy&&$&&Z.current&&$.parentNode===Z.current.parentNode)return H;return sV($)},[$]);return V0.useEffect(()=>{Z.current=$},[$]),J}function f90($){let[Z,J]=V0.useState(null),H=V0.useRef($),B=V0.useCallback((Q)=>{let X=dV(Q.target);if(!X)return;J((z)=>{if(!z)return null;return z.set(X,rV(X)),new Map(z)})},[]);return V0.useEffect(()=>{let Q=H.current;if($!==Q){X(Q);let z=$.map((G)=>{let U=dV(G);if(U)return U.addEventListener("scroll",B,{passive:!0}),[U,rV(U)];return null}).filter((G)=>G!=null);J(z.length?new Map(z):null),H.current=$}return()=>{X($),X(Q)};function X(z){z.forEach((G)=>{let U=dV(G);U==null||U.removeEventListener("scroll",B)})}},[B,$]),V0.useMemo(()=>{if($.length)return Z?Array.from(Z.values()).reduce((Q,X)=>w$(Q,X),X9):dy($);return X9},[$,Z])}function Sy($,Z){if(Z===void 0)Z=[];let J=V0.useRef(null);return V0.useEffect(()=>{J.current=null},Z),V0.useEffect(()=>{let H=$!==X9;if(H&&!J.current)J.current=$;if(!H&&J.current)J.current=null},[$]),J.current?WQ($,J.current):X9}function m90($){V0.useEffect(()=>{if(!GQ)return;let Z=$.map((J)=>{let{sensor:H}=J;return H.setup==null?void 0:H.setup()});return()=>{for(let J of Z)J==null||J()}},$.map((Z)=>{let{sensor:J}=Z;return J}))}function u90($,Z){return V0.useMemo(()=>{return $.reduce((J,H)=>{let{eventName:B,handler:Q}=H;return J[B]=(X)=>{Q(X,Z)},J},{})},[$,Z])}function oy($){return V0.useMemo(()=>$?q90($):null,[$])}var Ry=[];function p90($,Z){if(Z===void 0)Z=DQ;let[J]=$,H=oy(J?G4(J):null),[B,Q]=V0.useState(Ry);function X(){Q(()=>{if(!$.length)return Ry;return $.map((G)=>py(G)?H:new eY(Z(G),G))})}let z=ZK({callback:X});return a9(()=>{z==null||z.disconnect(),X(),$.forEach((G)=>z==null?void 0:z.observe(G))},[$]),B}function ny($){if(!$)return null;if($.children.length>1)return $;let Z=$.children[0];return RJ(Z)?Z:$}function c90($){let{measure:Z}=$,[J,H]=V0.useState(null),B=V0.useCallback((U)=>{for(let{target:Y}of U)if(RJ(Y)){H((K)=>{let F=Z(Y);return K?{...K,width:F.width,height:F.height}:F});break}},[Z]),Q=ZK({callback:B}),X=V0.useCallback((U)=>{let Y=ny(U);if(Q==null||Q.disconnect(),Y)Q==null||Q.observe(Y);H(Y?Z(Y):null)},[Z,Q]),[z,G]=YQ(X);return V0.useMemo(()=>({nodeRef:z,rect:J,setRef:G}),[J,z,G])}var d90=[{sensor:LQ,options:{}},{sensor:VQ,options:{}}],l90={current:{}},nY={draggable:{measure:jy},droppable:{measure:jy,strategy:AQ.WhileDragging,frequency:oV.Optimized},dragOverlay:{measure:DQ}};class xJ extends Map{get($){var Z;return $!=null?(Z=super.get($))!=null?Z:void 0:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(($)=>{let{disabled:Z}=$;return!Z})}getNodeFor($){var Z,J;return(Z=(J=this.get($))==null?void 0:J.node.current)!=null?Z:void 0}}var i90={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new xJ,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:sY},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:nY,measureDroppableContainers:sY,windowRect:null,measuringScheduled:!1},sy={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:sY,draggableNodes:new Map,over:null,measureDroppableContainers:sY},MQ=V0.createContext(sy),ty=V0.createContext(i90);function r90(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new xJ}}}function a90($,Z){switch(Z.type){case A2.DragStart:return{...$,draggable:{...$.draggable,initialCoordinates:Z.initialCoordinates,active:Z.active}};case A2.DragMove:if($.draggable.active==null)return $;return{...$,draggable:{...$.draggable,translate:{x:Z.coordinates.x-$.draggable.initialCoordinates.x,y:Z.coordinates.y-$.draggable.initialCoordinates.y}}};case A2.DragEnd:case A2.DragCancel:return{...$,draggable:{...$.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case A2.RegisterDroppable:{let{element:J}=Z,{id:H}=J,B=new xJ($.droppable.containers);return B.set(H,J),{...$,droppable:{...$.droppable,containers:B}}}case A2.SetDroppableDisabled:{let{id:J,key:H,disabled:B}=Z,Q=$.droppable.containers.get(J);if(!Q||H!==Q.key)return $;let X=new xJ($.droppable.containers);return X.set(J,{...Q,disabled:B}),{...$,droppable:{...$.droppable,containers:X}}}case A2.UnregisterDroppable:{let{id:J,key:H}=Z,B=$.droppable.containers.get(J);if(!B||H!==B.key)return $;let Q=new xJ($.droppable.containers);return Q.delete(J),{...$,droppable:{...$.droppable,containers:Q}}}default:return $}}function o90($){let{disabled:Z}=$,{active:J,activatorEvent:H,draggableNodes:B}=V0.useContext(MQ),Q=KQ(H),X=KQ(J==null?void 0:J.id);return V0.useEffect(()=>{if(Z)return;if(!H&&Q&&X!=null){if(!oY(Q))return;if(document.activeElement===Q.target)return;let z=B.get(X);if(!z)return;let{activatorNode:G,node:U}=z;if(!G.current&&!U.current)return;requestAnimationFrame(()=>{for(let Y of[G.current,U.current]){if(!Y)continue;let K=Vy(Y);if(K){K.focus();break}}})}},[H,Z,B,X,Q]),null}function ey($,Z){let{transform:J,...H}=Z;return $!=null&&$.length?$.reduce((B,Q)=>{return Q({transform:B,...H})},J):J}function n90($){return V0.useMemo(()=>({draggable:{...nY.draggable,...$==null?void 0:$.draggable},droppable:{...nY.droppable,...$==null?void 0:$.droppable},dragOverlay:{...nY.dragOverlay,...$==null?void 0:$.dragOverlay}}),[$==null?void 0:$.draggable,$==null?void 0:$.droppable,$==null?void 0:$.dragOverlay])}function s90($){let{activeNode:Z,measure:J,initialRect:H,config:B=!0}=$,Q=V0.useRef(!1),{x:X,y:z}=typeof B==="boolean"?{x:B,y:B}:B;a9(()=>{if(!X&&!z||!Z){Q.current=!1;return}if(Q.current||!H)return;let U=Z==null?void 0:Z.node.current;if(!U||U.isConnected===!1)return;let Y=J(U),K=vy(Y,H);if(!X)K.x=0;if(!z)K.y=0;if(Q.current=!0,Math.abs(K.x)>0||Math.abs(K.y)>0){let F=fy(U);if(F)F.scrollBy({top:K.y,left:K.x})}},[Z,X,z,H,J])}var JK=V0.createContext({...X9,scaleX:1,scaleY:1}),s6;(function($){$[$.Uninitialized=0]="Uninitialized",$[$.Initializing=1]="Initializing",$[$.Initialized=2]="Initialized"})(s6||(s6={}));var $x=V0.memo(function(Z){var J,H,B,Q;let{id:X,accessibility:z,autoScroll:G=!0,children:U,sensors:Y=d90,collisionDetection:K=G90,measuring:F,modifiers:W,...q}=Z,N=V0.useReducer(a90,void 0,r90),[D,A]=N,[V,L]=t80(),[j,M]=V0.useState(s6.Uninitialized),_=j===s6.Initialized,{draggable:{active:w,nodes:T,translate:b},droppable:{containers:C}}=D,k=w!=null?T.get(w):null,S=V0.useRef({initial:null,translated:null}),R=V0.useMemo(()=>{var C0;return w!=null?{id:w,data:(C0=k==null?void 0:k.data)!=null?C0:l90,rect:S}:null},[w,k]),O=V0.useRef(null),[y,I]=V0.useState(null),[x,v]=V0.useState(null),g=kJ(q,Object.values(q)),E=FQ("DndDescribedBy",X),l=V0.useMemo(()=>C.getEnabled(),[C]),r=n90(F),{droppableRects:h,measureDroppableContainers:d,measuringScheduled:o}=I90(l,{dragging:_,dependencies:[b.x,b.y],config:r.droppable}),p=R90(T,w),i=V0.useMemo(()=>x?qQ(x):null,[x]),n=Q5(),Z0=y90(p,r.draggable.measure);s90({activeNode:w!=null?T.get(w):null,config:n.layoutShiftCompensation,initialRect:Z0,measure:r.draggable.measure});let J0=by(p,r.draggable.measure,Z0),U0=by(p?p.parentElement:null),z0=V0.useRef({activatorEvent:null,active:null,activeNode:p,collisionRect:null,collisions:null,droppableRects:h,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:C,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),B0=C.getNodeFor((J=z0.current.over)==null?void 0:J.id),N0=c90({measure:r.dragOverlay.measure}),D0=(H=N0.nodeRef.current)!=null?H:p,F0=_?(B=N0.rect)!=null?B:J0:null,s=Boolean(N0.nodeRef.current&&N0.rect),a=v90(s?null:J0),e=oy(D0?G4(D0):null),$0=g90(_?B0!=null?B0:p:null),Q0=p90($0),_0=ey(W,{transform:{x:b.x-a.x,y:b.y-a.y,scaleX:1,scaleY:1},activatorEvent:x,active:R,activeNodeRect:J0,containerNodeRect:U0,draggingNodeRect:F0,over:z0.current.over,overlayNodeRect:N0.rect,scrollableAncestors:$0,scrollableAncestorRects:Q0,windowRect:e}),M0=i?w$(i,b):null,A0=f90($0),L0=Sy(A0),f=Sy(A0,[J0]),u=w$(_0,L0),t=F0?K90(F0,_0):null,W0=R&&t?K({active:R,collisionRect:t,droppableRects:h,droppableContainers:l,pointerCoordinates:M0}):null,S0=X90(W0,"id"),[p0,g0]=V0.useState(null),T0=s?_0:w$(_0,f),d0=U90(T0,(Q=p0==null?void 0:p0.rect)!=null?Q:null,J0),Q1=V0.useRef(null),e0=V0.useCallback((C0,x0)=>{let{sensor:r0,options:n0}=x0;if(O.current==null)return;let D1=T.get(O.current);if(!D1)return;let V1=C0.nativeEvent,p1=new r0({active:O.current,activeNode:D1,event:V1,options:n0,context:z0,onAbort(m0){if(!T.get(m0))return;let{onDragAbort:h0}=g.current,U1={id:m0};h0==null||h0(U1),V({type:"onDragAbort",event:U1})},onPending(m0,q0,h0,U1){if(!T.get(m0))return;let{onDragPending:i0}=g.current,l0={id:m0,constraint:q0,initialCoordinates:h0,offset:U1};i0==null||i0(l0),V({type:"onDragPending",event:l0})},onStart(m0){let q0=O.current;if(q0==null)return;let h0=T.get(q0);if(!h0)return;let{onDragStart:U1}=g.current,k0={activatorEvent:V1,active:{id:q0,data:h0.data,rect:S}};R$.unstable_batchedUpdates(()=>{U1==null||U1(k0),M(s6.Initializing),A({type:A2.DragStart,initialCoordinates:m0,active:q0}),V({type:"onDragStart",event:k0}),I(Q1.current),v(V1)})},onMove(m0){A({type:A2.DragMove,coordinates:m0})},onEnd:e1(A2.DragEnd),onCancel:e1(A2.DragCancel)});Q1.current=p1;function e1(m0){return async function(){let{active:h0,collisions:U1,over:k0,scrollAdjustedTranslate:i0}=z0.current,l0=null;if(h0&&i0){let{cancelDrop:L1}=g.current;if(l0={activatorEvent:V1,active:h0,collisions:U1,delta:i0,over:k0},m0===A2.DragEnd&&typeof L1==="function"){if(await Promise.resolve(L1(l0)))m0=A2.DragCancel}}O.current=null,R$.unstable_batchedUpdates(()=>{A({type:m0}),M(s6.Uninitialized),g0(null),I(null),v(null),Q1.current=null;let L1=m0===A2.DragEnd?"onDragEnd":"onDragCancel";if(l0){let T1=g.current[L1];T1==null||T1(l0),V({type:L1,event:l0})}})}}},[T]),c0=V0.useCallback((C0,x0)=>{return(r0,n0)=>{let D1=r0.nativeEvent,V1=T.get(n0);if(O.current!==null||!V1||D1.dndKit||D1.defaultPrevented)return;let p1={active:V1};if(C0(r0,x0.options,p1)===!0)D1.dndKit={capturedBy:x0.sensor},O.current=n0,e0(r0,x0)}},[T,e0]),y0=k90(Y,c0);m90(Y),a9(()=>{if(J0&&j===s6.Initializing)M(s6.Initialized)},[J0,j]),V0.useEffect(()=>{let{onDragMove:C0}=g.current,{active:x0,activatorEvent:r0,collisions:n0,over:D1}=z0.current;if(!x0||!r0)return;let V1={active:x0,activatorEvent:r0,collisions:n0,delta:{x:u.x,y:u.y},over:D1};R$.unstable_batchedUpdates(()=>{C0==null||C0(V1),V({type:"onDragMove",event:V1})})},[u.x,u.y]),V0.useEffect(()=>{let{active:C0,activatorEvent:x0,collisions:r0,droppableContainers:n0,scrollAdjustedTranslate:D1}=z0.current;if(!C0||O.current==null||!x0||!D1)return;let{onDragOver:V1}=g.current,p1=n0.get(S0),e1=p1&&p1.rect.current?{id:p1.id,rect:p1.rect.current,data:p1.data,disabled:p1.disabled}:null,m0={active:C0,activatorEvent:x0,collisions:r0,delta:{x:D1.x,y:D1.y},over:e1};R$.unstable_batchedUpdates(()=>{g0(e1),V1==null||V1(m0),V({type:"onDragOver",event:m0})})},[S0]),a9(()=>{z0.current={activatorEvent:x,active:R,activeNode:p,collisionRect:t,collisions:W0,droppableRects:h,draggableNodes:T,draggingNode:D0,draggingNodeRect:F0,droppableContainers:C,over:p0,scrollableAncestors:$0,scrollAdjustedTranslate:u},S.current={initial:F0,translated:t}},[R,p,W0,t,T,D0,F0,h,C,p0,$0,u]),b90({...n,delta:b,draggingRect:t,pointerCoordinates:M0,scrollableAncestors:$0,scrollableAncestorRects:Q0});let E1=V0.useMemo(()=>{return{active:R,activeNode:p,activeNodeRect:J0,activatorEvent:x,collisions:W0,containerNodeRect:U0,dragOverlay:N0,draggableNodes:T,droppableContainers:C,droppableRects:h,over:p0,measureDroppableContainers:d,scrollableAncestors:$0,scrollableAncestorRects:Q0,measuringConfiguration:r,measuringScheduled:o,windowRect:e}},[R,p,J0,x,W0,U0,N0,T,C,h,p0,d,$0,Q0,r,o,e]),W1=V0.useMemo(()=>{return{activatorEvent:x,activators:y0,active:R,activeNodeRect:J0,ariaDescribedById:{draggable:E},dispatch:A,draggableNodes:T,over:p0,measureDroppableContainers:d}},[x,y0,R,J0,A,E,T,p0,d]);return V0.default.createElement(yy.Provider,{value:L},V0.default.createElement(MQ.Provider,{value:W1},V0.default.createElement(ty.Provider,{value:E1},V0.default.createElement(JK.Provider,{value:d0},U)),V0.default.createElement(o90,{disabled:(z==null?void 0:z.restoreFocus)===!1})),V0.default.createElement(Z90,{...z,hiddenTextDescribedById:E}));function Q5(){let C0=(y==null?void 0:y.autoScrollEnabled)===!1,x0=typeof G==="object"?G.enabled===!1:G===!1,r0=_&&!C0&&!x0;if(typeof G==="object")return{...G,enabled:r0};return{enabled:r0}}}),t90=V0.createContext(null),ky="button",e90="Draggable";function Zx($){let{id:Z,data:J,disabled:H=!1,attributes:B}=$,Q=FQ(e90),{activators:X,activatorEvent:z,active:G,activeNodeRect:U,ariaDescribedById:Y,draggableNodes:K,over:F}=V0.useContext(MQ),{role:W=ky,roleDescription:q="draggable",tabIndex:N=0}=B!=null?B:{},D=(G==null?void 0:G.id)===Z,A=V0.useContext(D?JK:t90),[V,L]=YQ(),[j,M]=YQ(),_=u90(X,Z),w=kJ(J);a9(()=>{return K.set(Z,{id:Z,key:Q,node:V,activatorNode:j,data:w}),()=>{let b=K.get(Z);if(b&&b.key===Q)K.delete(Z)}},[K,Z]);let T=V0.useMemo(()=>({role:W,tabIndex:N,"aria-disabled":H,"aria-pressed":D&&W===ky?!0:void 0,"aria-roledescription":q,"aria-describedby":Y.draggable}),[H,W,N,D,q,Y.draggable]);return{active:G,activatorEvent:z,activeNodeRect:U,attributes:T,isDragging:D,listeners:H?void 0:_,node:V,over:F,setNodeRef:L,setActivatorNodeRef:M,transform:A}}function $30(){return V0.useContext(ty)}var Z30="Droppable",J30={timeout:25};function Jx($){let{data:Z,disabled:J=!1,id:H,resizeObserverConfig:B}=$,Q=FQ(Z30),{active:X,dispatch:z,over:G,measureDroppableContainers:U}=V0.useContext(MQ),Y=V0.useRef({disabled:J}),K=V0.useRef(!1),F=V0.useRef(null),W=V0.useRef(null),{disabled:q,updateMeasurementsFor:N,timeout:D}={...J30,...B},A=kJ(N!=null?N:H),V=V0.useCallback(()=>{if(!K.current){K.current=!0;return}if(W.current!=null)clearTimeout(W.current);W.current=setTimeout(()=>{U(Array.isArray(A.current)?A.current:[A.current]),W.current=null},D)},[D]),L=ZK({callback:V,disabled:q||!X}),j=V0.useCallback((T,b)=>{if(!L)return;if(b)L.unobserve(b),K.current=!1;if(T)L.observe(T)},[L]),[M,_]=YQ(j),w=kJ(Z);return V0.useEffect(()=>{if(!L||!M.current)return;L.disconnect(),K.current=!1,L.observe(M.current)},[M,L]),V0.useEffect(()=>{return z({type:A2.RegisterDroppable,element:{id:H,key:Q,disabled:J,node:M,rect:F,data:w}}),()=>z({type:A2.UnregisterDroppable,key:Q,id:H})},[H]),V0.useEffect(()=>{if(J!==Y.current.disabled)z({type:A2.SetDroppableDisabled,id:H,key:Q,disabled:J}),Y.current.disabled=J},[H,Q,J,z]),{active:X,rect:F,isOver:(G==null?void 0:G.id)===H,node:M,over:G,setNodeRef:_}}function H30($){let{animation:Z,children:J}=$,[H,B]=V0.useState(null),[Q,X]=V0.useState(null),z=KQ(J);if(!J&&!H&&z)B(z);return a9(()=>{if(!Q)return;let G=H==null?void 0:H.key,U=H==null?void 0:H.props.id;if(G==null||U==null){B(null);return}Promise.resolve(Z(U,Q)).then(()=>{B(null)})},[Z,H,Q]),V0.default.createElement(V0.default.Fragment,null,J,H?V0.cloneElement(H,{ref:X}):null)}var B30={x:0,y:0,scaleX:1,scaleY:1};function Q30($){let{children:Z}=$;return V0.default.createElement(MQ.Provider,{value:sy},V0.default.createElement(JK.Provider,{value:B30},Z))}var X30={position:"fixed",touchAction:"none"},z30=($)=>{return oY($)?"transform 250ms ease":void 0},G30=V0.forwardRef(($,Z)=>{let{as:J,activatorEvent:H,adjustScale:B,children:Q,className:X,rect:z,style:G,transform:U,transition:Y=z30}=$;if(!z)return null;let K=B?U:{...U,scaleX:1,scaleY:1},F={...X30,width:z.width,height:z.height,top:z.top,left:z.left,transform:SJ.Transform.toString(K),transformOrigin:B&&H?H90(H,z):void 0,transition:typeof Y==="function"?Y(H):Y,...G};return V0.default.createElement(J,{className:X,style:F,ref:Z},Q)}),U30=($)=>(Z)=>{let{active:J,dragOverlay:H}=Z,B={},{styles:Q,className:X}=$;if(Q!=null&&Q.active)for(let[z,G]of Object.entries(Q.active)){if(G===void 0)continue;B[z]=J.node.style.getPropertyValue(z),J.node.style.setProperty(z,G)}if(Q!=null&&Q.dragOverlay)for(let[z,G]of Object.entries(Q.dragOverlay)){if(G===void 0)continue;H.node.style.setProperty(z,G)}if(X!=null&&X.active)J.node.classList.add(X.active);if(X!=null&&X.dragOverlay)H.node.classList.add(X.dragOverlay);return function(){for(let[G,U]of Object.entries(B))J.node.style.setProperty(G,U);if(X!=null&&X.active)J.node.classList.remove(X.active)}},Y30=($)=>{let{transform:{initial:Z,final:J}}=$;return[{transform:SJ.Transform.toString(Z)},{transform:SJ.Transform.toString(J)}]},K30={duration:250,easing:"ease",keyframes:Y30,sideEffects:U30({styles:{active:{opacity:"0"}}})};function F30($){let{config:Z,draggableNodes:J,droppableContainers:H,measuringConfiguration:B}=$;return UQ((Q,X)=>{if(Z===null)return;let z=J.get(Q);if(!z)return;let G=z.node.current;if(!G)return;let U=ny(X);if(!U)return;let{transform:Y}=G4(X).getComputedStyle(X),K=gy(Y);if(!K)return;let F=typeof Z==="function"?Z:W30(Z);return ly(G,B.draggable.measure),F({active:{id:Q,data:z.data,node:G,rect:B.draggable.measure(G)},draggableNodes:J,dragOverlay:{node:X,rect:B.dragOverlay.measure(U)},droppableContainers:H,measuringConfiguration:B,transform:K})})}function W30($){let{duration:Z,easing:J,sideEffects:H,keyframes:B}={...K30,...$};return(Q)=>{let{active:X,dragOverlay:z,transform:G,...U}=Q;if(!Z)return;let Y={x:z.rect.left-X.rect.left,y:z.rect.top-X.rect.top},K={scaleX:G.scaleX!==1?X.rect.width*G.scaleX/z.rect.width:1,scaleY:G.scaleY!==1?X.rect.height*G.scaleY/z.rect.height:1},F={x:G.x-Y.x,y:G.y-Y.y,...K},W=B({...U,active:X,dragOverlay:z,transform:{initial:G,final:F}}),[q]=W,N=W[W.length-1];if(JSON.stringify(q)===JSON.stringify(N))return;let D=H==null?void 0:H({active:X,dragOverlay:z,...U}),A=z.node.animate(W,{duration:Z,easing:J,fill:"forwards"});return new Promise((V)=>{A.onfinish=()=>{D==null||D(),V()}})}}var Iy=0;function q30($){return V0.useMemo(()=>{if($==null)return;return Iy++,Iy},[$])}var Hx=V0.default.memo(($)=>{let{adjustScale:Z=!1,children:J,dropAnimation:H,style:B,transition:Q,modifiers:X,wrapperElement:z="div",className:G,zIndex:U=999}=$,{activatorEvent:Y,active:K,activeNodeRect:F,containerNodeRect:W,draggableNodes:q,droppableContainers:N,dragOverlay:D,over:A,measuringConfiguration:V,scrollableAncestors:L,scrollableAncestorRects:j,windowRect:M}=$30(),_=V0.useContext(JK),w=q30(K==null?void 0:K.id),T=ey(X,{activatorEvent:Y,active:K,activeNodeRect:F,containerNodeRect:W,draggingNodeRect:D.rect,over:A,overlayNodeRect:D.rect,scrollableAncestors:L,scrollableAncestorRects:j,transform:_,windowRect:M}),b=tV(F),C=F30({config:H,draggableNodes:q,droppableContainers:N,measuringConfiguration:V}),k=b?D.setRef:void 0;return V0.default.createElement(Q30,null,V0.default.createElement(H30,{animation:C},K&&w?V0.default.createElement(G30,{key:w,id:K.id,ref:k,as:z,activatorEvent:Y,adjustScale:Z,className:G,transition:Q,rect:b,style:{zIndex:U,...B},transform:T},J):null))});var k$=P(c(),1),N30={start:[J5.Space],cancel:[J5.Esc],end:[J5.Space,J5.Tab]};function A30($,Z,J){let H=$.indexOf(Z),B=$.indexOf(J);if(H<0||B<0||H===B)return $;let Q=[...$],[X]=Q.splice(H,1);return Q.splice(B,0,X),Q}function HK({items:$,getId:Z,className:J,itemClassName:H,dragDisabled:B=!1,isItemDragDisabled:Q,onReorder:X,renderItem:z,renderPlaceholder:G,renderOverlay:U}){let Y=xy(nV(LQ,{activationConstraint:{distance:4}}),nV(VQ,{keyboardCodes:N30})),[K,F]=t6.useState(null),[W,q]=t6.useState(null),N=t6.useRef(null),D=t6.useMemo(()=>$.map(Z),[$,Z]),A=t6.useMemo(()=>new Map($.map((b)=>[Z(b),b])),[$,Z]),L=(K&&W?W:D).map((b)=>A.get(b)).filter((b)=>Boolean(b)),j=K?A.get(K):void 0,M=Q?$.filter((b)=>!Q(b)).length:$.length,_=B||M<2;return k$.jsxs($x,{sensors:Y,collisionDetection:hy,onDragStart:(b)=>{let C=$.map(Z);F(String(b.active.id)),N.current=C,q(C)},onDragOver:(b)=>{let C=String(b.active.id),k=b.over?String(b.over.id):void 0,S=N.current;if(!k||k===C||!S)return;let R=A30(S,C,k);if(R===S)return;N.current=R,q(R)},onDragCancel:()=>{N.current=null,F(null),q(null)},onDragEnd:(b)=>{let C=String(b.active.id),k=N.current;if(N.current=null,F(null),q(null),!k||k.join("|")===D.join("|"))return;if(!k.includes(C))return;X(k)},children:[k$.jsx("div",{className:J,children:L.map((b)=>k$.jsx(D30,{id:Z(b),item:b,disabled:_||Q?.(b)===!0,itemClassName:H,renderItem:z,renderPlaceholder:G},Z(b)))}),k$.jsx(Hx,{dropAnimation:null,children:j&&U?U(j):null})]})}function D30({id:$,item:Z,disabled:J,itemClassName:H,renderItem:B,renderPlaceholder:Q}){let{setNodeRef:X,isOver:z}=Jx({id:$,disabled:J}),{attributes:G,listeners:U,setNodeRef:Y,isDragging:K}=Zx({id:$,disabled:J,attributes:{roleDescription:"sortable item"}}),F=(q)=>{X(q),Y(q)},W={isDragging:K,isOver:z,dragDisabled:J,dragHandleProps:J?{}:{...G,...U}};return k$.jsxs(K5.div,{layout:!0,ref:F,className:X0("relative",H?.(Z,W)),transition:{type:"spring",duration:0.25,bounce:0},children:[K&&Q?.(Z),B(Z,W)]})}var F1=P(c(),1),V30="https://mlfrg.notion.site/3c678a44b6788042b734d775dd2e935e?pvs=105";function L30($){return X0(_$({variant:"ghost",size:"icon"}),$&&"bg-accent text-accent-foreground")}function BK({children:$,showWorkspaces:Z=!0}){let{data:J}=PU(),H=X1();return N2((B)=>{if(B.type==="workspace:updated"||B.type==="theme:updated"||B.type==="workspaces-list:updated")H.invalidateQueries({queryKey:j0.all,exact:!0})}),F1.jsxs("div",{className:"flex h-dvh bg-muted transition-colors duration-100 ease-out motion-reduce:transition-none",children:[F1.jsx(M30,{workspaces:Z?J??[]:[]}),F1.jsx("main",{className:"flex min-w-0 flex-1 flex-col",children:$})]})}function M30({workspaces:$}){let Z=uS();return F1.jsx(SG,{delay:500,children:F1.jsxs("aside",{className:"flex h-full shrink-0 flex-col items-center gap-4 px-2 py-5 [font-family:var(--default-sans)]",children:[F1.jsxs(a1,{children:[F1.jsx(o1,{render:F1.jsx(c7,{href:"/","aria-label":"Home",className:L30,children:F1.jsx(Xx,{stroke:1.5})})}),F1.jsx(n1,{side:"right",children:"Home"})]}),F1.jsx("nav",{className:"flex max-h-full min-h-0 w-14 flex-1 flex-col items-center justify-center gap-4",children:$.length>0&&F1.jsxs(F1.Fragment,{children:[F1.jsx("div",{className:"no-scrollbar min-h-0 scroll-fade overflow-y-auto [--scroll-fade-reveal:16px]",children:F1.jsx(HK,{items:$,getId:(J)=>J.id,className:"flex flex-col gap-4",onReorder:(J)=>Z.mutate(J),renderPlaceholder:()=>F1.jsx("div",{className:"pointer-events-none absolute top-0 left-1 size-12 rounded-xl bg-accent"}),renderOverlay:(J)=>F1.jsx(Bx,{workspace:J,dragOverlay:!0}),renderItem:(J,H)=>F1.jsx(Bx,{workspace:J,dragState:H})})}),F1.jsx("div",{className:"shrink-0",children:F1.jsxs(a1,{children:[F1.jsx(zQ,{trigger:F1.jsx(o1,{render:F1.jsx(P0,{type:"button",variant:"ghost",size:"icon-lg","aria-label":"Create new workspace",className:"text-muted-foreground hover:text-foreground",children:F1.jsx(d2,{"data-icon":"inline-start",stroke:1.5})})})}),F1.jsx(n1,{side:"right",children:"Create new workspace"})]})})]})}),F1.jsx("div",{className:"size-8 shrink-0",children:F1.jsx(P30,{})})]})})}function P30(){let{cloudDemo:$}=R8(),Z=oS();if($)return F1.jsx(MJ,{trigger:F1.jsx(P0,{size:"icon","aria-label":"Unlock all features",title:"Unlock all features",children:F1.jsx(zx,{stroke:1.5})})});if(Z.status==="loading")return null;if(Z.status==="available")return F1.jsx(nS,{...Z.button});return F1.jsx(_30,{})}function _30(){return F1.jsxs(a1,{children:[F1.jsx(o1,{render:F1.jsx(P0,{render:F1.jsx("a",{href:V30,target:"_blank",rel:"noreferrer"}),variant:"ghost",size:"icon","aria-label":"Leave feedback",className:"text-muted-foreground hover:text-foreground",children:F1.jsx(Qx,{stroke:1.5})})}),F1.jsx(n1,{side:"right",children:"Leave feedback"})]})}function Bx({workspace:$,dragOverlay:Z=!1,dragState:J}){let[H]=M8(),B=`/workspace/${$.id}`,Q=C$($),X=H===B||H.startsWith(`${B}/`),z=F1.jsx("div",{className:X0(_$({variant:"ghost",size:"icon-lg"}),"pointer-events-none size-12 transition-[border-radius,background-color,color] duration-100 ease-out motion-reduce:transition-none",Z?"bg-background shadow-lg":"group-hover:bg-accent group-hover:text-accent-foreground group-focus-visible:ring-3 group-focus-visible:ring-ring/50",X&&!Z&&"bg-accent text-accent-foreground"),children:F1.jsx(n6,{icon:$.icon,workspaceType:$.type,workspaceTheme:$.theme,className:"size-7 shrink-0 rounded-md transition-[border-radius] duration-100 ease-out motion-reduce:transition-none"})}),G=F1.jsx("span",{className:"mt-0.5 line-clamp-2 w-full text-center text-[11px] leading-snug font-medium text-ellipsis text-foreground",children:Q});if(Z)return F1.jsxs("span",{className:"flex w-14 flex-col items-center",children:[z,G]});return F1.jsxs(c7,{href:B,"aria-label":Q,onClick:(U)=>{if(J?.isDragging)U.preventDefault()},className:X0("group flex w-14 flex-col items-center rounded-xl outline-none",J?.isDragging&&"invisible"),...J?.dragHandleProps,children:[z,F1.jsxs(a1,{children:[F1.jsx(o1,{render:G}),F1.jsx(n1,{side:"right",children:Q})]})]})}var Xh=P(m(),1);var Gx=P(m(),1);var I$=P(c(),1);function j30({choice:$,availability:Z,isPending:J,errorMessage:H,onTypeChange:B,onSubmit:Q}){return I$.jsx(lY,{title:`Import ${C$($.workspace)}`,selectedType:$.selectedType,detectedTypes:$.workspace.types,availability:Z,isPending:J,errorMessage:H,secondaryAction:I$.jsx(mB,{render:I$.jsx(P0,{variant:"secondary"}),disabled:J,children:"Cancel"}),primaryLabel:"Add workspace",pendingLabel:"Adding…",onTypeChange:B,onSubmit:Q})}function Ux({choice:$,availability:Z,isPending:J,errorMessage:H,onTypeChange:B,onSubmit:Q,onReset:X}){let[z,G]=Gx.useState(!0);function U(K){if(!K&&J)return;G(K)}function Y(K){if(!K)X()}return I$.jsx(I6,{open:z,onOpenChange:U,onOpenChangeComplete:Y,children:I$.jsx(iY,{showCloseButton:!J,children:I$.jsx(j30,{choice:$,availability:Z,isPending:J,errorMessage:H,onTypeChange:B,onSubmit:Q})})})}var Yx=P(m(),1);function O30($){return $.types[0]??VJ[0]}function Kx({onSuccess:$}){let Z=fS(),[J,H]=Yx.useState(null);function B(G){Z.reset(),H({workspace:G,selectedType:O30(G)})}function Q(G){H((U)=>U?{...U,selectedType:G}:U)}function X(){if(!J||Z.isPending)return;Z.mutate({path:J.workspace.path,type:J.selectedType},{onSuccess:$})}function z(){H(null),Z.reset()}return{choice:J,isPending:Z.isPending,error:Z.error,startImport:B,selectType:Q,submit:X,reset:z}}var _Q=P(m(),1);var jQ=P(c(),1),T30=[["OOOOO","O.O.O","O.O.O"],["OOO","O.O","OOO"],["O","O","O"]],e6=10,QK=3,C30=2.5,E30={O:1,o:0.5,".":0},b30=3000,w30=2,Fx=3,$7=3,Wx=0.001,y$={courantSquared:0.14,damping:0.976,driveAmplitude:1.4,driveFrequency:0.027,gain:0.65,fadeIn:0.36,fadeOut:0.1};function S30($){let Z=Math.max(...$.map((Q)=>Q.length)),J=Z*e6+(Z-1)*QK,H=$.length*e6+($.length-1)*QK,B=[];return $.forEach((Q,X)=>{Array.from(Q).forEach((z,G)=>{let U=E30[z];if(U===void 0)return;let Y=G*(e6+QK),K=X*(e6+QK);B.push({x:Y,y:K,centerX:Y+e6/2,centerY:K+e6/2,targetOpacity:U})})}),{width:J,height:H,fieldColumns:Math.round(J/$7)+1,fieldRows:Math.round(H/$7)+1,pixels:B}}var R30=T30.map(S30);function PQ($,Z,J){return $<Z?Z:$>J?J:$}function k30($){return $<0.5?2*$*$:1-(-2*$+2)**2/2}class qx{rects;svg;geometry;animationFrame=0;running=!1;intro=!0;introStartedAt=-1;field;previousField;nextField;pointerActive=!1;pointerX=0;pointerY=0;activation=0;constructor($,Z,J){this.rects=$,this.svg=Z,this.geometry=J;let H=J.fieldColumns*J.fieldRows;this.field=new Float32Array(H),this.previousField=new Float32Array(H),this.nextField=new Float32Array(H)}start(){this.seedImpulse(),this.activation=1,this.resume()}stop(){cancelAnimationFrame(this.animationFrame),this.running=!1}handlePointerMove=($)=>{let Z=this.svg.getBoundingClientRect();if(!Z.width||!Z.height)return;if(this.pointerActive=$.clientX>=Z.left&&$.clientX<=Z.right&&$.clientY>=Z.top&&$.clientY<=Z.bottom,this.pointerActive)this.pointerX=($.clientX-Z.left)/Z.width*this.geometry.width,this.pointerY=($.clientY-Z.top)/Z.height*this.geometry.height,this.resume()};seedImpulse(){let $=Math.round(this.geometry.width/2/$7),Z=Math.round(this.geometry.height/2/$7),J=2*Fx*Fx;for(let H=0;H<this.geometry.fieldRows;H++)for(let B=0;B<this.geometry.fieldColumns;B++){let Q=(B-$)**2+(H-Z)**2,X=w30*Math.exp(-Q/J),z=H*this.geometry.fieldColumns+B;this.field[z]=X,this.previousField[z]=X}}resume(){if(this.running)return;this.running=!0,this.animationFrame=requestAnimationFrame(this.animate)}animate=($)=>{if(this.stepWave(),this.pointerActive)this.driveWave($);if(this.intro&&!this.pointerActive){if(this.introStartedAt<0)this.introStartedAt=$;let J=($-this.introStartedAt)/b30;if(this.activation=1-k30(Math.min(1,J)),J>=1)this.intro=!1}else{this.intro=!1;let J=this.pointerActive?1:0,H=this.pointerActive?y$.fadeIn:y$.fadeOut;this.activation+=(J-this.activation)*H}let Z=this.renderWave();if(this.intro||this.pointerActive||this.activation>Wx||Z>Wx){this.animationFrame=requestAnimationFrame(this.animate);return}this.running=!1,this.activation=0,this.renderTargets()};stepWave(){let{fieldColumns:$,fieldRows:Z}=this.geometry;for(let H=1;H<Z-1;H++)for(let B=1;B<$-1;B++){let Q=H*$+B,X=this.field[Q-1]+this.field[Q+1]+this.field[Q-$]+this.field[Q+$]-4*this.field[Q];this.nextField[Q]=(2*this.field[Q]-this.previousField[Q]+y$.courantSquared*X)*y$.damping}let J=this.previousField;this.previousField=this.field,this.field=this.nextField,this.nextField=J}driveWave($){let Z=PQ(Math.round(this.pointerX/$7),1,this.geometry.fieldColumns-2),J=PQ(Math.round(this.pointerY/$7),1,this.geometry.fieldRows-2);this.field[J*this.geometry.fieldColumns+Z]=y$.driveAmplitude*Math.sin($*y$.driveFrequency)}sampleField($,Z){let J=PQ($/$7,0,this.geometry.fieldColumns-1),H=PQ(Z/$7,0,this.geometry.fieldRows-1),B=Math.floor(J),Q=Math.floor(H),X=Math.min(B+1,this.geometry.fieldColumns-1),z=Math.min(Q+1,this.geometry.fieldRows-1),G=J-B,U=H-Q,{fieldColumns:Y}=this.geometry,K=this.field[Q*Y+B],F=this.field[Q*Y+X],W=this.field[z*Y+B],q=this.field[z*Y+X];return(K*(1-G)+F*G)*(1-U)+(W*(1-G)+q*G)*U}renderWave(){let $=0;return this.geometry.pixels.forEach((Z,J)=>{let H=this.rects[J];if(!H)return;let B=this.sampleField(Z.centerX,Z.centerY);$=Math.max($,Math.abs(B));let Q=PQ(0.5+B*y$.gain,0,1),X=Z.targetOpacity*(1-this.activation)+Q*this.activation;H.setAttribute("opacity",X.toFixed(3))}),$}renderTargets(){this.geometry.pixels.forEach(($,Z)=>{this.rects[Z]?.setAttribute("opacity",String($.targetOpacity))})}}function I30({geometry:$}){let Z=_Q.useRef([]),J=_Q.useRef(null);return _Q.useEffect(()=>{let H=J.current;if(!H||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let B=new qx(Z.current,H,$);return B.start(),window.addEventListener("pointermove",B.handlePointerMove),()=>{B.stop(),window.removeEventListener("pointermove",B.handlePointerMove)}},[$]),jQ.jsx("svg",{ref:J,className:"h-8 w-auto",viewBox:`0 0 ${$.width} ${$.height}`,fill:"currentColor","aria-hidden":"true",children:$.pixels.map((H,B)=>jQ.jsx("rect",{ref:(Q)=>{Z.current[B]=Q},x:H.x,y:H.y,width:e6,height:e6,rx:C30,opacity:H.targetOpacity},`${H.x}-${H.y}`))})}function Nx({className:$}){return jQ.jsx("div",{role:"img","aria-label":"moi",className:X0("flex items-center gap-2 text-accent",$),children:R30.map((Z,J)=>jQ.jsx(I30,{geometry:Z},J))})}function eV({l:$,c:Z,h:J}){let H=J*Math.PI/180,B=Z*Math.cos(H),Q=Z*Math.sin(H),X=$+0.3963377774*B+0.2158037573*Q,z=$-0.1055613458*B-0.0638541728*Q,G=$-0.0894841775*B-1.291485548*Q,U=X*X*X,Y=z*z*z,K=G*G*G;return[4.0767416621*U-3.3077115913*Y+0.2309699292*K,-1.2684380046*U+2.6097574011*Y-0.3413193965*K,-0.0041960863*U-0.7034186147*Y+1.707614701*K]}var Ax=($)=>$.every((Z)=>Z>=-0.0001&&Z<=1.0001);function Mx($){let Z=eV($);if(!Ax(Z)){let J=0,H=$.c;for(let B=0;B<12;B++){let Q=(J+H)/2;if(Ax(eV({...$,c:Q})))J=Q;else H=Q}Z=eV({...$,c:J})}return Z.map((J)=>Math.min(1,Math.max(0,J)))}function Dx($){let[Z,J,H]=Mx($);return 0.2126*Z+0.7152*J+0.0722*H}function OQ($,Z){let J=Dx($),H=Dx(Z);return(Math.max(J,H)+0.05)/(Math.min(J,H)+0.05)}function Vx($,Z,J){if(OQ($,Z)>=J)return $;let H=$.l>=Z.l?1:-1;for(let X of[H,-H]){let z={...$};for(let G=0;G<60;G++){if(z.l=Math.min(1,Math.max(0,z.l+X*0.02)),OQ(z,Z)>=J)return z;if(z.l===0||z.l===1)break}}let B={...$,l:0,c:0},Q={...$,l:1,c:0};return OQ(B,Z)>=OQ(Q,Z)?B:Q}function XK($){return"#"+Mx($).map((Z)=>{let J=Z<=0.0031308?12.92*Z:1.055*Math.pow(Z,0.4166666666666667)-0.055;return Math.round(J*255).toString(16).padStart(2,"0")}).join("")}function hJ($){let Z=parseInt($.slice(1),16),[J,H,B]=[Z>>16&255,Z>>8&255,Z&255].map((Y)=>{let K=Y/255;return K<=0.04045?K/12.92:Math.pow((K+0.055)/1.055,2.4)}),Q=Math.cbrt(0.4122214708*J+0.5363325363*H+0.0514459929*B),X=Math.cbrt(0.2119034982*J+0.6806995451*H+0.1073969566*B),z=Math.cbrt(0.0883024619*J+0.2817188376*H+0.6299787005*B),G=1.9779984951*Q-2.428592205*X+0.4505937099*z,U=0.0259040371*Q+0.7827717662*X-0.808675766*z;return{l:0.2104542553*Q+0.793617785*X-0.0040720468*z,c:Math.hypot(G,U),h:Math.atan2(U,G)*180/Math.PI}}function y30($,Z,J){let H=(Y)=>Y*Math.PI/180,B=$.c*Math.cos(H($.h)),Q=$.c*Math.sin(H($.h)),X=Z.c*Math.cos(H(Z.h)),z=Z.c*Math.sin(H(Z.h)),G=B+(X-B)*J,U=Q+(z-Q)*J;return{l:$.l+(Z.l-$.l)*J,c:Math.hypot(G,U),h:Math.atan2(U,G)*180/Math.PI}}var zK=($,Z,J)=>XK(y30(hJ($),hJ(Z),J));var x30={h:12,l:0.84,pull:0.4,c:0.1};var Lx=4.55;function h30($,Z,J){let H=hJ($),B=hJ(Z),Q={l:H.l+(J.l-H.l)*J.pull,c:Math.max(H.c,J.c),h:J.h};Q=Vx(Q,v30,g30);let X=Vx(B,Q,Lx),z=X.l>=Q.l?1:-1,G=XK(Q);for(let U=0;U<40;U++){let Y=XK(X),K=1/0;for(let W=0;W<=10;W++){let q=W/10;K=Math.min(K,OQ(hJ(zK(Z,Y,q)),hJ(zK($,G,q))))}if(K>=Lx)return[G,Y];let F=Math.min(1,Math.max(0,X.l+z*0.02));if(F===X.l)return[G,Y];X={...X,l:F}}return[G,XK(X)]}var v30={l:0.145,c:0,h:0},g30=1.5;var $L={esx:1,esy:1,tilt:0,edy:0,edx:0,esx2:0,esy2:0,tilt2:0,edy2:0,lock:0,heat:0,shake:0,rock:0,bdy:0},Px=($)=>String(Math.round($*1000)/1000);function o9($,Z){return{l:{...$,eyes:$.eyes.map((J,H)=>({...J,cx:J.cx+Z.edx*(H?1:-1),cy:J.cy+Z.edy+(H?Z.edy2:0),rx:J.rx*(Z.esx+(H?Z.esx2:0)),ry:J.ry*(Z.esy+(H?Z.esy2:0)),rot:J.rot*(1-Z.lock)+(Z.tilt+(H?Z.tilt2:0))*(H?1:-1)}))},wrap:Z.bdy!==0?`translate(0 ${Px(Z.bdy)})`:""}}function n9($){let Z={};for(let J in $L){if(J==="heat")continue;let H=$[J];if(H!==$L[J])Z["--mo-"+J]=Px(H)}return Z}function f30($,Z,J){let[H,B]=h30($.head,$.eye,J);return{...$,head:zK($.head,H,Z.heat),eye:zK($.eye,B,Z.heat)}}var _x={p:$L,vars:n9,bake:o9},jx={p:{esx:1.72,esy:0.3,tilt:8,edy:-1.5,edx:1.5,esx2:0.08,esy2:0.05,tilt2:-16,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:-2.2},vars:n9,bake:o9},Ox={p:{esx:0.6,esy:0.56,tilt:26,edy:3.6,edx:1.9,esx2:-0.05,esy2:-0.07,tilt2:-7,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:2.6},vars:n9,bake:o9};var Tx={p:{esx:1.34,esy:1.2,tilt:-6,edy:-1.05,edx:0.5,esx2:0.05,esy2:0.07,tilt2:3,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:-1.4},vars:n9,bake:o9},Cx={p:{esx:1.32,esy:0.76,tilt:5,edy:-0.6,edx:0.8,esx2:0.26,esy2:-0.56,tilt2:-11,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:-1.1},vars:n9,bake:o9},Ex={p:{esx:1.14,esy:0.22,tilt:0,edy:2.4,edx:0.3,esx2:-0.04,esy2:0.03,tilt2:4,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:1.2},vars:n9,bake:o9},bx={p:{esx:1.3,esy:0.42,tilt:18,edy:-0.5,edx:0.5,esx2:0.06,esy2:-0.06,tilt2:-36,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:-1},vars:n9,bake:o9},wx={p:{esx:0.95,esy:1.02,tilt:4,edy:-0.2,edx:0.3,esx2:0.24,esy2:-0.44,tilt2:-18,edy2:0,lock:1,heat:0,shake:0,rock:0,bdy:0},vars:n9,bake:o9};var Sx={p:{esx:0.62,esy:0.5,tilt:10,edy:1.4,edx:-0.2,esx2:-0.05,esy2:-0.04,tilt2:-8,edy2:0,lock:1,heat:0.55,shake:0,rock:0,bdy:0.9},vars:n9,bake:o9,tint:($,Z)=>f30($,Z,x30)};var Rx={p:{esx:1.15,esy:0.62,tilt:0,edy:4.2,edx:0.4,esx2:0.02,esy2:0.06,tilt2:0,edy2:-8.4,lock:1,heat:0,shake:0,rock:0.8,bdy:-0.4},vars:n9,bake:o9};var kx=P(c(),1),m30="moi-agent",u30={default:{head:"var(--foreground)",eye:"var(--background)"},primary:{head:"var(--primary)",eye:"var(--primary-foreground)"},secondary:{head:"var(--accent)",eye:"var(--accent-foreground)"}},p30={idle:_x,happy:jx,sad:Ox,surprised:Tx,wink:Cx,sleepy:Ex,smug:bx,unsure:wx,shy:Sx,thinking:Rx};function s9({size:$=56,preset:Z=r9.agent,animated:J=!1,color:H="default",expression:B="idle",className:Q}){return kx.jsx(tG,{name:m30,size:$,animate:J?"always":"hover",palette:u30[H],expression:B?p30[B]:void 0,className:X0("shrink-0",Q),traits:HQ[Z].traits})}var gJ={};b5(gJ,{Trigger:()=>dx,Root:()=>px,Panel:()=>nx});var TQ=P(m(),1);var GK=P(m(),1);function Ix($){let{open:Z,defaultOpen:J=!1,onOpenChange:H,disabled:B}=$,[Q,X]=z4({controlled:Z,default:J,name:"Collapsible",state:"open"}),{mounted:z,setMounted:G,transitionStatus:U}=C2(Q,!0,!0),Y=t0(),[K,F]=GK.useState(),W=K===null?void 0:K??Y,q=Y0((N)=>{let D=!Q,A=w0(K0.triggerPress,N.nativeEvent);if(H(D,A),A.isCanceled)return;X(D)});return GK.useMemo(()=>({defaultPanelId:Y,disabled:B,handleTrigger:q,mounted:z,open:Q,panelId:W,setMounted:G,setOpen:X,setPanelIdState:F,transitionStatus:U}),[Y,B,q,z,Q,W,G,X,F,U])}var UK=P(m(),1),ZL=UK.createContext(void 0);function YK(){let $=UK.useContext(ZL);if($===void 0)throw Error(I0(15));return $}var yx="data-open",xx="data-closed",hx=Z8.startingStyle,Xs0=Z8.endingStyle;var gx="data-panel-open";var d30={[yx]:""},l30={[xx]:""},fx={open($){if($)return{[gx]:""};return null}},mx={open($){if($)return d30;return l30}};var KK={...mx,...B2};var ux=P(c(),1),px=TQ.forwardRef(function(Z,J){let{render:H,className:B,defaultOpen:Q=!1,disabled:X=!1,onOpenChange:z,open:G,style:U,...Y}=Z,K=Y0(z),F=Ix({open:G,defaultOpen:Q,onOpenChange:K,disabled:X}),W=TQ.useMemo(()=>({open:F.open,disabled:F.disabled,transitionStatus:F.transitionStatus}),[F.open,F.disabled,F.transitionStatus]),q=TQ.useMemo(()=>({...F,onOpenChange:K,state:W}),[F,K,W]),N=G0("div",Z,{state:W,ref:J,props:Y,stateAttributesMapping:KK});return ux.jsx(ZL.Provider,{value:q,children:N})});var cx=P(m(),1);var i30={...fx,...B2},dx=cx.forwardRef(function(Z,J){let{panelId:H,open:B,handleTrigger:Q,state:X,disabled:z}=YK(),{className:G,disabled:U=z,render:Y,nativeButton:K=!0,style:F,...W}=Z,{getButtonProps:q,buttonRef:N}=C5({disabled:U,focusableWhenDisabled:!0,native:K});return G0("button",Z,{state:X,ref:[J,N],props:[{"aria-controls":B?H:void 0,"aria-expanded":B,onClick:Q},W,q],stateAttributesMapping:i30})});var JL=P(m(),1);var C4=P(m(),1);var CQ={height:void 0,width:void 0};function ix($){let{externalRef:Z,hiddenUntilFound:J,id:H,keepMounted:B,mounted:Q,onOpenChange:X,open:z,setMounted:G,setOpen:U,transitionStatus:Y}=$,K=C4.useRef(null),F=C4.useRef(null),[W,q]=C4.useState(CQ),N=C4.useRef(CQ),D=C4.useRef(!1),A=C4.useRef(z),V=C4.useRef(!1),[L,j]=C4.useState(!1),M=C4.useRef(null),_=f2(Z,K),w=F5(z),T=f4(K),b=!z&&!Q,C=L?"idle":Y,k=z&&(A.current||V.current),S=!z&&Q&&F.current==="css-animation"&&W.height===void 0&&W.width===void 0?N.current:W,R=J&&b&&F.current!=="css-animation",O=Y0((g,E=!0)=>{if(E)N.current=g;q(g)}),y=Y0(()=>{M.current?.(),M.current=null}),I=Y0((g)=>{y(),M.current=()=>{M.current=null,g()}}),x=Y0(()=>{if(z&&Q&&F.current==="css-animation")V.current=!0});H0(()=>{if(!L||Y==="starting")return;j(!1)},[L,Y]),C4.useEffect(()=>{return()=>{x(),y()}},[x,y]),H0(()=>{let g=K.current;if(!g)return;if(!z&&M.current)y();let E=r30(g,k);if(F.current=E,z&&Y==="idle"&&A.current&&E==="css-animation"){N.current=vJ(g);return}if(z&&Y==="starting"){let h=D.current;if(D.current=!1,E==="none"){O(vJ(g)),j(!0);return}if(E==="css-transition"){let p=a30(g);if(O(vJ(g)),!h)return p;let i=FK(g,"transition-duration","0s");return I(i),j(!0),p}O(vJ(g));let d=FK(g,"animation-name","none");if(!h){d();return}let o=FK(g,"animation-duration","0s");d(),I(o),j(!0);return}if(!z&&Q&&(Y==="idle"||Y==="starting")){if(A.current=!1,V.current=!1,E==="none"){O(CQ,!1),G(!1);return}O(vJ(g));return}if(Y!=="ending")return;if(E==="none"){G(!1);return}let l=vJ(g);if(!(l.height>0||l.width>0)){G(!1);return}if(O(l),E==="css-animation")FK(g,"animation-name","none")();return},[Q,z,y,O,G,I,k,Y]),A5({enabled:z&&Q&&C==="idle",open:!0,ref:K,onComplete(){if(!z)return;O(CQ,!1)}}),C4.useEffect(()=>{if(z||!Q||C!=="ending")return;if(!K.current)return;let E=new AbortController,l=-1;function r(){if(w.current)return;G(!1),O(CQ,!1)}return l=v2.request(()=>{T(r,E.signal)}),()=>{v2.cancel(l),E.abort()}},[w,Q,z,C,T,O,G]),H0(()=>{let g=K.current;if(!g||!J||!b)return;g.setAttribute("hidden","until-found")},[b,J]),C4.useEffect(function(){let E=K.current;if(!E)return;function l(r){let h=w0(K0.none,r);if(X(!0,h),h.isCanceled)return;D.current=!0,U(!0)}return a0(E,"beforematch",l)},[X,U]);let v=B||J||Q||z;return{height:S.height,props:{...R?{[hx]:""}:void 0,hidden:b,id:H},ref:_,shouldPreventOpenAnimation:k,shouldRender:v,transitionStatus:C,width:S.width}}function vJ($){return{height:$.scrollHeight,width:$.scrollWidth}}function r30($,Z){let J=w1($).getComputedStyle($),H=(J.animationName.split(",").map((Q)=>Q.trim()).some((Q)=>Q!==""&&Q!=="none")||Z)&&lx(J.animationDuration),B=lx(J.transitionDuration);if(H&&B)return"css-transition";if(B)return"css-transition";if(H)return"css-animation";return"none"}function lx($){return $.split(",").map((Z)=>Z.trim()).some((Z)=>Z!==""&&Number.parseFloat(Z)>0)}function FK($,Z,J){let H=$.style.getPropertyValue(Z),B=$.style.getPropertyPriority(Z);return $.style.setProperty(Z,J),()=>{if(H===""){$.style.removeProperty(Z);return}$.style.setProperty(Z,H,B)}}function a30($){let Z={"justify-content":$.style.justifyContent,"align-items":$.style.alignItems,"align-content":$.style.alignContent,"justify-items":$.style.justifyItems};Object.keys(Z).forEach((B)=>{$.style.setProperty(B,"initial","important")});function J(){Object.entries(Z).forEach(([B,Q])=>{if(Q===""){$.style.removeProperty(B);return}$.style.setProperty(B,Q)})}let H=v2.request(J);return()=>{v2.cancel(H),J()}}var rx="--collapsible-panel-height",ax="--collapsible-panel-width";var nx=JL.forwardRef(function(Z,J){let{className:H,hiddenUntilFound:B,keepMounted:Q,render:X,id:z,style:G,...U}=Z,{defaultPanelId:Y,mounted:K,onOpenChange:F,open:W,setMounted:q,setPanelIdState:N,setOpen:D,state:A,transitionStatus:V}=YK(),L=B??!1,j=Q??!1,M=z||void 0,_=M??Y;H0(()=>{return N((x)=>M??(x===null?void 0:x)),()=>{N((x)=>x===M?null:x)}},[M,N]);let{height:w,props:T,ref:b,shouldPreventOpenAnimation:C,shouldRender:k,transitionStatus:S,width:R}=ix({externalRef:J,hiddenUntilFound:L,id:_,keepMounted:j,mounted:K,onOpenChange:F,open:W,setMounted:q,setOpen:D,transitionStatus:V}),O={...A,transitionStatus:S},y=ox(G,O),I=G0("div",{...Z,style:void 0},{state:O,ref:b,props:[T,{style:{[rx]:w===void 0?"auto":`${w}px`,[ax]:R===void 0?"auto":`${R}px`}},U,y?{style:y}:void 0,C?{style:{animationName:"none"}}:void 0],stateAttributesMapping:KK});if(!k)return null;return I});var AK=P(c(),1);function WK({...$}){return AK.jsx(gJ.Root,{"data-slot":"collapsible",...$})}function qK({...$}){return AK.jsx(gJ.Trigger,{"data-slot":"collapsible-trigger",...$})}function NK({...$}){return AK.jsx(gJ.Panel,{"data-slot":"collapsible-content",...$})}var DK=P(m(),1);var HL="moi-fonts",sx="moi-font-previews",n30=Object.values(o6).map(($)=>$.googleFontsQuery).filter(Boolean).join("&family="),ex=[["sans","--sans"],["mono","--mono"]],$h=gV.map(($)=>[$,s30($)]),Zh="--radius",tx=[...ex.map(([,$])=>$),...$h.map(([,$])=>$),Zh];function s30($){return`--${$.replace(/[A-Z]/g,(J)=>`-${J.toLowerCase()}`)}`}function t30($){let Z={},J=Q9($),H=J.font===r9.font?void 0:o6[J.font];for(let[B,Q]of ex)Z[Q]=H?.[B];return Z}function BL($,Z="workspace"){let J={},H=cY($,Z);for(let[B,Q]of $h)J[Q]=H?.[B];return J}function e30($){let Z={},J=Q9($),H=J.radius===r9.radius?void 0:JQ[J.radius];return Z[Zh]=H?.radius,Z}function z9($,Z="workspace"){return{...t30($),...BL($,Z),...e30($)}}function VK(){DK.useEffect(()=>{if(document.getElementById(sx))return;let $=document.createElement("link");return $.id=sx,$.rel="stylesheet",$.crossOrigin="anonymous",$.href=`https://fonts.googleapis.com/css2?family=${n30}&display=swap`,document.head.appendChild($),()=>{$.remove()}},[])}function $60($){DK.useEffect(()=>{let Z=document.documentElement,J=z9($);for(let H of tx){let B=J[H];if(B)Z.style.setProperty(H,B);else Z.style.removeProperty(H)}return()=>{for(let H of tx)Z.style.removeProperty(H)}},[$])}function Jh($){let{font:Z}=Q9($);$60($),DK.useEffect(()=>{let J=o6[Z]??o6[r9.font],H=document.getElementById(HL);if(!J.googleFontsQuery)H?.remove();else{let B=`https://fonts.googleapis.com/css2?family=${J.googleFontsQuery}&display=swap`;if(H)H.href=B;else{let Q=document.createElement("link");Q.id=HL,Q.rel="stylesheet",Q.crossOrigin="anonymous",Q.href=B,document.head.appendChild(Q)}}return()=>{document.getElementById(HL)?.remove()}},[Z])}function F8($,{workspaceId:Z,base:J="",apiBase:H}={}){if(typeof $!=="string")throw Error("A URL is required");if(!$.startsWith("moi:")){let q=new URL($);if(q.protocol!=="https:"&&q.protocol!=="http:")throw Error("Unsupported URL");return q.href}if(!$.startsWith("moi:/")||$.startsWith("moi://"))throw Error("Expected a workspace address such as moi:/views/events?eventId=123");let B=$.slice(5),Q=B.search(/[?#]/),X=Q<0?B:B.slice(0,Q),z=Q<0?"":B.slice(Q),G=X.split("/").map(decodeURIComponent);if(G.some((q)=>!q||q==="."||q===".."||/[/\\\0]/.test(q)))throw Error("Invalid workspace address");let U=Z===void 0?void 0:encodeURIComponent(Z);if(G[0]==="files"){if(G.length<2)throw Error("Invalid workspace file path");return`${H??(U===void 0?"moi:":`/api/workspaces/${U}`)}/files/${G.slice(1).map(encodeURIComponent).join("/")}${z}`}let Y=G.join("/");if($.includes("#")||/\s/.test(Y))throw Error("Invalid workspace address");if(Y!=="chat"&&!m9(Y)&&!(G[0]==="chats"&&G.length===2))throw Error(`Unsupported workspace destination: ${Y}`);let K=new URLSearchParams(z);K.sort();let F=K.toString();return`${U===void 0?"moi:":`${J.replace(/\/$/,"")}/workspace/${U}`}/${G.map(encodeURIComponent).join("/")}${F?`?${F}`:""}`}var fJ=P(m(),1);var D2=P(c(),1),EQ={width:320,height:180,radius:32,topLeftRadius:18,bodyTop:24,tabEnd:124,shoulder:{width:48,roundness:20}};function Z60($){let{width:Z,height:J,radius:H,topLeftRadius:B,bodyTop:Q,tabEnd:X,shoulder:z}=EQ,G=Math.min(Z/2,H*$),U=Math.min(Z/2,B*$),Y=Math.max(0,z.width),K=X+Y,F=Math.max(0,Math.min(z.roundness,Y/2));return[`M ${U} 0`,`H ${X}`,`C ${X+F} 0 ${K-F} ${Q} ${K} ${Q}`,`H ${Z-G}`,`Q ${Z} ${Q} ${Z} ${Q+H}`,`V ${J-H}`,`Q ${Z} ${J} ${Z-G} ${J}`,`H ${G}`,`Q 0 ${J} 0 ${J-H}`,`V ${B}`,`Q 0 0 ${U} 0`,"Z"].join(" ")}function J60(){let $=fJ.useRef(null),[Z,J]=fJ.useState(1);return fJ.useLayoutEffect(()=>{let H=$.current;if(!H)return;let B=(z,G)=>{if(z<=0||G<=0)return;let U=z/EQ.width,K=G/EQ.height/U;J((F)=>Math.abs(F-K)<0.001?F:K)},Q=H.getBoundingClientRect();B(Q.width,Q.height);let X=new ResizeObserver(([z])=>{if(z)B(z.contentRect.width,z.contentRect.height)});return X.observe(H),()=>X.disconnect()},[]),{ref:$,horizontalRadiusScale:Z}}var Hh=[{frame:X0("-translate-x-3 translate-y-3 -rotate-6","group-focus-within:translate-y-2 group-hover:translate-y-2"),img:"opacity-40"},{frame:X0("translate-x-3 translate-y-2 rotate-5","group-focus-within:translate-y-1 group-hover:translate-y-1"),img:"opacity-50"},{frame:X0("-translate-x-1 translate-y-1 -rotate-2","group-focus-within:-translate-y-2 group-hover:-translate-y-2"),img:"opacity-100"}];function Bh({workspaceId:$}){let Z=_U($),J=Z.data?[...Z.data.thumbnails].reverse():[],H=Hh.slice(Hh.length-J.length),B=Z.data?.firstUserMessage,Q=Z.data?.theme,{ref:X,horizontalRadiusScale:z}=J60(),G=Z60(z),U=`folder-noise-${$}`,Y=z9(Q),K=BL(Q);return D2.jsxs("div",{ref:X,style:K,className:"relative h-45 w-full",children:[D2.jsxs("svg",{viewBox:`0 0 ${EQ.width} ${EQ.height}`,preserveAspectRatio:"none","aria-hidden":"true",className:"absolute inset-0 h-full w-full overflow-visible",children:[D2.jsx("defs",{children:D2.jsxs("filter",{id:U,x:"0%",y:"0%",width:"100%",height:"100%",colorInterpolationFilters:"sRGB",children:[D2.jsx("feTurbulence",{type:"fractalNoise",baseFrequency:"0.5",numOctaves:"3",seed:"7",result:"noise"}),D2.jsx("feColorMatrix",{in:"noise",type:"saturate",values:"0",result:"monochromeNoise"}),D2.jsx("feComponentTransfer",{in:"monochromeNoise",result:"faintNoise",children:D2.jsx("feFuncA",{type:"linear",slope:"0.24"})}),D2.jsx("feComposite",{in:"faintNoise",in2:"SourceAlpha",operator:"in",result:"clippedNoise"}),D2.jsx("feBlend",{in:"SourceGraphic",in2:"clippedNoise",mode:"soft-light"})]})}),D2.jsx("path",{d:G,filter:`url(#${U})`,className:"fill-accent"})]}),J.map((F,W)=>D2.jsx("div",{className:X0("absolute top-[12%] left-[14%] w-fit max-w-[72%] overflow-hidden rounded-[calc(var(--radius-2xl)*0.4)] bg-background shadow-xs squircle","animate-in duration-300 ease-out fade-in",H[W].frame),children:D2.jsx("img",{src:F,alt:"",loading:"lazy",className:X0("block h-auto max-h-32 w-auto max-w-full object-contain",H[W].img)})},F)),J.length===0&&B&&D2.jsx("div",{className:"absolute inset-x-[12%] top-[22%] flex justify-end",children:D2.jsx("div",{"aria-hidden":"true",style:Y,className:X0("w-max max-w-40 origin-center rounded-lg bg-card px-3 py-2 font-sans shadow-xs","animate-in transition-transform duration-300 ease-out fade-in","-translate-x-1 translate-y-1 -rotate-2","group-focus-within:translate-y-0.5 group-hover:translate-y-0.5"),children:D2.jsx("p",{className:"line-clamp-3 text-sm leading-normal whitespace-normal",children:B})})}),D2.jsx("div",{className:X0("absolute inset-x-2 top-[40%] bottom-2 rounded-3xl bg-[color-mix(in_oklch,var(--accent),var(--foreground)_5%)]","mask-[linear-gradient(to_bottom,rgba(0,0,0,0.9)_0%,black_50%)] backdrop-blur-lg","inset-shadow-[0_0_12px_color-mix(in_oklab,var(--background)_20%,transparent)]")})]})}var H1=P(c(),1);function zh(){VK();let[,$]=M8(),Z=PU(),J=gS(),H=jU(),B=Kx({onSuccess:(q)=>$(`/workspace/${q.id}`)}),Q=R8(),[X,z]=Xh.useState(!1),G=S1((q)=>q.discoveredWorkspacesOpen),U=S1((q)=>q.setDiscoveredWorkspacesOpen);if(Z.isPending||J.isPending)return H1.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:H1.jsx(x5,{size:20,stroke:1.5,className:"animate-spin text-muted-foreground"})});if(Z.isError||J.isError)return H1.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:H1.jsx("p",{className:"text-sm text-muted-foreground",children:"Could not load spaces."})});let Y=Z.data,K=J.data,F=Y.length;function W(q){if(Q.cloudDemo){z(!0);return}B.startImport(q)}return H1.jsxs("div",{className:"mx-auto w-full max-w-3xl px-8 pt-14 pb-16",children:[H1.jsx(Nx,{className:"mb-10"}),F>0?H1.jsxs("section",{className:"mb-12",children:[H1.jsxs("div",{className:"mb-4 flex items-center justify-between gap-2",children:[H1.jsx("h1",{className:"text-sm font-medium text-foreground",children:"My workspaces"}),H1.jsx(zQ,{trigger:H1.jsxs(P0,{variant:"outline",size:"sm",children:[H1.jsx(d2,{"data-icon":"inline-start",stroke:1.75}),"New"]})})]}),H1.jsx("div",{className:"grid grid-cols-1 gap-x-4 gap-y-8 sm:grid-cols-2 md:grid-cols-3",children:Y.map((q)=>H1.jsx(H60,{workspace:q},q.id))})]}):H1.jsxs("div",{className:"mb-10 flex flex-col items-center gap-4 px-8 pt-8 pb-16 text-center",children:[H1.jsx(Qh,{size:32,stroke:1.5,className:"text-muted-foreground"}),H1.jsxs("div",{className:"flex flex-col gap-1.5",children:[H1.jsx("h2",{className:"font-medium",children:"Let’s start with creating your first workspace"}),H1.jsx("p",{className:"mx-auto max-w-sm text-sm text-muted-foreground",children:"Workspace is a place for all the chats, widgets, and views that share the same context. Create a new one or import an existing folder you’ve worked in before."})]}),H1.jsx(zQ,{trigger:H1.jsx(P0,{children:"Create workspace"})})]}),K.length>0&&H1.jsx("section",{children:H1.jsxs(WK,{open:G,onOpenChange:U,className:"group",children:[H1.jsxs(qK,{className:X0("group/trigger","flex w-full items-center gap-1 pb-4 text-left outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring","text-muted-foreground group-data-open:text-foreground hover:text-foreground"),children:[H1.jsx("span",{className:"text-sm font-medium",children:"Import from this computer"}),H1.jsx(x$,{size:16,stroke:2,className:X0("opacity-0 transition-[opacity,transform]","group-hover/trigger:opacity-100 group-focus-visible/trigger:opacity-100 group-data-open:rotate-90")})]}),H1.jsx(NK,{children:H1.jsx("ul",{className:"border-t border-border",children:K.map((q)=>H1.jsx(B60,{suggestion:q,onAdd:W},q.path))})})]})}),B.choice&&H1.jsx(Ux,{choice:B.choice,availability:H.data?.availability,isPending:B.isPending,errorMessage:B.error?.message,onTypeChange:B.selectType,onSubmit:B.submit,onReset:B.reset}),H1.jsx(MJ,{open:X,onOpenChange:z})]})}function H60({workspace:$}){let Z=C$($),J=_U($.id),H=$.theme??J.data?.theme,B=Q9(H).agent,Q=B4((G)=>IG(G.activity,$.id)),X=J.data?.updatedAt??new Date($.addedAt).getTime(),z=`/workspace/${$.id}`;return H1.jsxs("div",{className:"group flex min-w-0 flex-col gap-3",children:[H1.jsxs("div",{className:"relative",children:[H1.jsx(Bh,{workspaceId:$.id}),H1.jsx(c7,{href:z,"aria-label":`Open ${Z}`,className:"absolute inset-0 rounded-2xl outline-none focus-visible:ring-3 focus-visible:ring-ring/50"}),J.data&&H1.jsxs(a1,{children:[H1.jsx(o1,{render:H1.jsx(c7,{href:F8("moi:/chat",{workspaceId:$.id}),"aria-label":`Chat in ${Z}`,style:z9(H),className:"absolute right-3 bottom-3 rounded-lg outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:H1.jsx(s9,{preset:B,color:"primary",animated:Q,expression:Q?"thinking":void 0,size:48,className:"drop-shadow-sm drop-shadow-primary/20"})})}),H1.jsx(n1,{children:"Chat"})]})]}),H1.jsxs(c7,{href:z,className:"flex min-w-0 flex-col gap-2 rounded-lg px-2 outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[H1.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 font-sans",style:z9(H),children:[H1.jsx(n6,{icon:$.icon,workspaceType:$.type,workspaceTheme:H,className:"size-4 shrink-0 rounded-xs"}),H1.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:Z})]}),H1.jsx("span",{className:"text-xs text-muted-foreground",children:Q60(X)})]})]})}function B60({suggestion:$,onAdd:Z}){let{path:J,types:H}=$,B=C$($);return H1.jsxs("li",{className:"flex items-center gap-2 border-b border-border px-1 py-3",children:[H1.jsx(Ky,{types:H}),H1.jsx("span",{className:"shrink-0 text-sm font-medium text-foreground",children:B}),H1.jsx("span",{title:J,className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:$.displayPath??J}),H1.jsxs(P0,{variant:"outline",size:"sm",onClick:()=>Z($),children:[H1.jsx(d2,{stroke:1.75}),"Add"]})]})}function Q60($){let Z=Date.now()-$,J=Math.floor(Z/60000);if(J<1)return"Updated just now";if(J<60)return`Updated ${J} min${J===1?"":"s"} ago`;let H=Math.floor(J/60);if(H<24)return`Updated ${H} hour${H===1?"":"s"} ago`;let B=Math.floor(H/24);if(B<30)return`Updated ${B} day${B===1?"":"s"} ago`;return`Updated ${new Date($).toLocaleDateString()}`}var LK=P(c(),1);function Gh(){return LK.jsx(BK,{showWorkspaces:!1,children:LK.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:LK.jsx(zh,{})})})}var MK=P(m(),1);var QL=P(c(),1),Kh=($)=>$.map((Z)=>[...Z].map((J)=>J==="#"?1:0)),X60=["####.","#.#.#","#.#.#","#.#.#","#.#.#"],z60=["###.#","#.#.#","#.#.#","#.#.#","###.#"],G60=Kh([".....","####.","#.#.#","#.#.#","#.#.#"]),U60=Kh(X60.map(($,Z)=>`${$}.${z60[Z]}`)),Y60={moi:G60,"moi-full":U60};function Fh($,Z,J){let H=[];for(let B=0;B<Z;B++){let Q=[];for(let X=0;X<$;X++)Q.push(J(X,B));H.push(Q)}return H}function Uh($,Z,J){let H=Math.sin($*12.9898+Z*78.233+J*37.719)*43758.5453;return H-Math.floor(H)}function K60($,Z,J){return Fh(Z,J,(H,B)=>{let Q=Uh(H,B,0)*Math.PI*2,X=5+Uh(H,B,1)*6,z=0.5+0.5*Math.sin($*X+Q);return z*z})}function F60($,Z,J){return Fh(Z,J,(B,Q)=>0.5+0.5*Math.sin(B*0.5+Q*0.32-$*6.5))}var Wh=0.55;function W60($,Z){let J=$.length,H=$.reduce((G,U)=>Math.max(G,U.length),0),B=Math.min(Z/Wh,1),Q=1-Math.pow(1-B,3),X=Math.round((1-Q)*J),z=[];for(let G=0;G<J;G++){let U=[];for(let Y=0;Y<H;Y++)U.push($[G-X]?.[Y]??0);z.push(U)}return z}function Yh($,Z,J){let H=Y60[$];if(Z===void 0)return W60(H,J);let B=H.length,Q=H[0]?.length??0;return Z==="wave"?F60(J,Q,B):K60(J,Q,B)}var q60=24;function N60($,Z,J){let[H,B]=MK.useState(()=>Yh($,Z,0));return MK.useEffect(()=>{let Q=0,X=null,z=0,G=1000/J,U=(Y)=>{if(X===null)X=Y;let K=(Y-X)/1000;if(Y-z>=G){if(z=Y,B(Yh($,Z,K)),Z===void 0&&K>=Wh)return}Q=requestAnimationFrame(U)};return Q=requestAnimationFrame(U),()=>cancelAnimationFrame(Q)},[$,Z,J]),H}function A60($){return`rgba(23, 23, 23, ${(0.1+Math.max(0,Math.min(1,$))*0.9).toFixed(3)})`}function qh({sprite:$="moi",effect:Z,fps:J=q60,pixelSize:H=3,gap:B=1,className:Q}){let X=N60($,Z,J),z=X[0]?.length??0,G=Z!==void 0;return QL.jsx("div",{className:X0("grid",Q),style:{gridTemplateColumns:`repeat(${z}, ${H}px)`,gap:`${B}px`},children:X.flatMap((U,Y)=>U.map((K,F)=>QL.jsx("div",{className:"rounded-[2px]",style:{width:H,height:H,background:A60(K),boxShadow:G?`0 0 ${(H*(0.4+K)).toFixed(1)}px rgba(23, 23, 23, ${(K*0.35).toFixed(3)})`:void 0}},`${Y}-${F}`)))})}var uJ=P(m(),1);var PK=5000,_K=120;var D60="</moi-attachments>";function XL($){if(!u9($)||typeof $.label!=="string")return null;let Z=$.label.trim();if(!Z||Z.length>_K||typeof $.text!=="string"||!$.text.trim()||$.text.length>PK)return null;return{label:Z,text:$.text}}function Nh($){return Array.isArray($)&&$.every((Z)=>u9(Z)&&Z.purpose===void 0&&(Z.source===void 0||typeof Z.source==="string"&&Z.source.length>0)&&XL(Z)!==null)}function Ah($){return $==="annotation"||$==="sketch"}function V60($){return Array.isArray($)&&$.every((Z)=>{if(!u9(Z))return!1;if(Z.type==="text")return Nh([Z]);if(Z.type!=="file"&&Z.type!=="image")return!1;if(Z.source!==void 0&&(typeof Z.source!=="string"||!Z.source))return!1;if(typeof Z.mediaType!=="string"||!Z.mediaType)return!1;if(Z.purpose!==void 0&&(!Ah(Z.purpose)||!Z.mediaType.startsWith("image/")))return!1;let J=typeof Z.path==="string"&&/^(\/|[A-Za-z]:[\\/])/.test(Z.path)&&!Z.path.includes("\x00");if(Z.type==="file")return J&&Z.label===void 0;return Z.path===void 0&&Z.mediaType.startsWith("image/")&&typeof Z.label==="string"&&Boolean(Z.label.trim())})}function zL($){let Z=[],J=!1,H=$.replace(/<moi-attachments>([^<]*)<\/moi-attachments>/g,(B,Q)=>{try{let X=JSON.parse(Q),z=u9(X)&&X.version===1&&Array.isArray(X.attachments)?X.attachments.map((G)=>u9(G)?{type:"text",source:G.source,label:G.label,text:G.text}:G):X;if(!V60(z))return B;return Z.push(...z),J=!0,""}catch{return B}});return{text:J?H.trim():$,attachments:Z}}function GL($){return $.type==="file"?$.path.split(/[\\/]/).at(-1):$.label}function Dh($,Z){let{source:J}=$,H=GL($);if($.type==="text")return{type:"text-attachment",source:$.source,label:H,text:$.text};return{type:"file-attachment",label:H,mediaType:$.mediaType,source:J,...$.purpose?{purpose:$.purpose}:{},previewUrl:Z,path:$.type==="file"?$.path:void 0}}function L60($){return zL($).text}function Vh($){let Z=L60($),J=Z.search(/<moi-attachments>\s*(?:\[|\{"version":1,"attachments":\[)/);return(J<0||Z.includes(D60,J)?Z:Z.slice(0,J)).trimEnd()}var bQ=10;function jK($){return $.length>bQ?`A message can have at most ${bQ} attachments.`:null}var Lh=33554432;function Mh($){return typeof $==="string"&&$.length>0&&!/[\\:\0]/.test($)&&$.split("/").every((Z)=>Z.length>0&&!Z.startsWith("."))}var Oh=P(m(),1);var Ph=()=>({emit($,...Z){for(let J=this.events[$]||[],H=0,B=J.length;H<B;H++)J[H](...Z)},events:{},on($,Z){return(this.events[$]||=[]).push(Z),()=>{this.events[$]=this.events[$]?.filter((J)=>Z!==J)}}});var M60=({kind:$,name:Z})=>`${$}:${Z}`,P60=1000,UL={cooldownMs:2000,windowMs:60000,maxPerWindow:10,maxKeys:64};function _60($){let Z=Ph(),J=RG(UL),H=(X,z)=>{X8($,{source:"runtime",kind:X.kind,name:X.name,message:z})},B=(X,z,G,U,Y)=>{let K=X.admit(G);if(K==="ok")return!0;return H(z,K==="cooldown"?U:Y),!1},Q=(X,z,G)=>{return B(J,X,`${z}\x00${G}`,`sendChatMessage() for "${G}" was dropped: the same message was already sent less than ${UL.cooldownMs/1000}s ago. Call it from an event handler, not during render.`,`sendChatMessage() for "${G}" was dropped: more than ${UL.maxPerWindow} messages in a minute from this workspace. Each one starts an agent run, so send only on a real user action.`)};return{on(X,z){return Z.on(X,z)},connect(X,z=""){let G=!0,U=M60(X);return{bridge:{get collab(){return G?CD:void 0},addChatAttachment(K){if(!G)return;try{let F=_h(K,U);Z.emit("addChatAttachment",F)}catch(F){let W=YL(F);r1.add({title:"Couldn’t add attachment",description:W,type:"error"}),H(X,`addChatAttachment() was dropped: ${W}`)}},navigate(K){if(!G)return;try{Z.emit("navigate",F8(K))}catch(F){H(X,`navigate() was dropped: ${YL(F)}`)}},resolveUrl(K){if(!G)return"";return F8(K,{workspaceId:$,base:z})},sendChatMessage(K,F){if(!G)return;try{if(typeof K==="string")K={message:K,attachments:F===void 0?[]:[{type:"text",label:"Context",text:JSON.stringify(F)}]};if(!u9(K)||typeof K.message!=="string")throw Error("This message uses an unsupported format");if("context"in K)throw Error("This message uses an outdated format");let W=K.message.trim();if(!W)throw Error("The message is empty");if(W.length>P60)throw Error("Messages can be up to 1,000 characters");if(K.attachments!==void 0&&!Array.isArray(K.attachments))throw Error("The attachments use an unsupported format");let q=Array.from(K.attachments??[],(N)=>_h(N,U));if(!Q(X,U,W))return;Z.emit("sendChatMessage",{message:W,applet:{kind:X.kind,id:X.name},attachments:q})}catch(W){let q=YL(W);r1.add({title:"Couldn’t send message",description:q,type:"error"}),H(X,`sendChatMessage() was dropped: ${q}`)}}},dispose:()=>{G=!1}}}}}function _h($,Z){if(!u9($))throw Error("This attachment isn’t supported");if($.type==="text"){let J=XL($);if(J)return{type:"text",...J,source:Z};if(typeof $.label!=="string"||!$.label.trim())throw Error("Add a label to this text attachment");if($.label.trim().length>_K)throw Error(`Attachment labels can be up to ${_K} characters`);if(typeof $.text!=="string"||!$.text.trim())throw Error("Add some text to this attachment");if($.text.length>PK)throw Error(`Text attachments can be up to ${PK.toLocaleString("en-US")} characters`)}else if($.type==="file"){if($.file instanceof File&&$.path===void 0){if($.file.size>Lh)throw Error("Files can be up to 32 MB");return{type:"file",file:$.file,source:Z}}if(typeof $.path==="string"&&$.file===void 0){if(!Mh($.path))throw Error("Choose a file from this workspace");return{type:"file",path:$.path,source:Z}}}throw Error("This attachment isn’t supported")}function YL($){return $ instanceof Error?$.message:String($)}var jh=new Map;function TK($){let Z=jh.get($);if(!Z)Z=_60($),jh.set($,Z);return Z}function CK($,Z,J){let H=W5(J);Oh.useEffect(()=>{let B=(...Q)=>H.current(...Q);return TK($).on(Z,B)},[$,Z,H])}var OK=new Map;function Th($,Z,J,H,B=""){let Q=$.__attachBridge;if(typeof Q!=="function")return;OK.get(J)?.();let{bridge:X,dispose:z}=TK(Z).connect(H,B);OK.set(J,z),Q(X)}function KL($){let Z=OK.get($);if(!Z)return;OK.delete($),Z()}function EK($,Z,J){return`${$}/${Z}/${J}`}var mJ=new Map,wQ=new Map;function j60($,Z,J){return mJ.get(EK($,Z,J))??0}var O60="module";function Ch($,Z,J){return`/api/workspaces/${Z}/${$}/${J}/${O60}?v=${j60($,Z,J)}`}function bK($,Z,J){return`/api/workspaces/${Z}/${$}/${J}`}function Z7($,Z){return`${$}/${Z}`}function Eh($){return wQ.get($)}function bh($,Z){wQ.set($,Z)}function wK($,Z,J){let H=EK($,Z,J);wQ.delete(H),mJ.set(H,(mJ.get(H)??0)+1),KL(H)}function FL($){let Z=`${$}/`;for(let J of new Set([...wQ.keys(),...mJ.keys()]))if(J.startsWith(Z))wQ.delete(J),mJ.set(J,(mJ.get(J)??0)+1),KL(J)}var T60={kind:"widget",segment:"widgets",shouldReload:($,Z)=>$.type==="widget:updated"&&$.name===Z||$.type==="applets:refresh"&&$.only!=="views"},C60={kind:"view",segment:"views",shouldReload:($,Z)=>$.type==="view:updated"&&$.name===Z||$.type==="applets:refresh"&&$.only!=="widgets"};function E60($,Z,J,H){let{segment:B}=$,Q=EK(B,Z,J),X=Eh(Q);if(X)return X;let z=import(Ch(B,Z,J)).then((G)=>{if(!G.default)throw Error(`"${J}" has no default export`);return Th(G,Z,Q,{kind:$.kind,name:J},H),G.default});return bh(Q,z),z}function wh($,Z){let J=f1(),{base:H}=_2(),[B,Q]=uJ.useState({status:"loading",version:0}),X=uJ.useCallback(()=>{Q((z)=>({status:"loading",version:z.version})),E60($,J,Z,H).then((z)=>Q((G)=>({status:"ready",Component:z,version:G.version+1}))).catch((z)=>{X8(J,{source:"load",kind:$.kind,name:Z,message:String(z),...z instanceof Error&&z.stack?{stack:z.stack}:{}}),Q((G)=>({status:"error",error:String(z),version:G.version+1}))})},[H,$,J,Z]);return uJ.useEffect(()=>{X()},[X]),N2((z)=>{if($.shouldReload(z,Z))wK($.segment,J,Z),X()}),B}function Sh($){return wh(T60,$)}function Rh($){return wh(C60,$)}function kh(){let $=f1();N2((Z)=>{if(Z.type==="view:updated")wK("views",$,Z.name);else if(Z.type==="widget:updated")wK("widgets",$,Z.name);else if(Z.type==="applets:refresh"){if(Z.only!=="views")FL("widgets");if(Z.only!=="widgets")FL("views")}})}var h8=P(m(),1);var yh=P(m(),1);function xh($){return Y5({queryKey:j0.layout($),queryFn:()=>G1(`/api/workspaces/${$}`),...G8})}function t9($){let Z=X1();return yh.useEffect(()=>Ih(()=>{Z.invalidateQueries({queryKey:j0.agent($)})}),[Z,$]),N2((J)=>{if(J.type==="agent:updated"&&J.workspaceId===$)Z.setQueryData(j0.agent($),(H)=>H?{...H,availability:J.availability,login:J.login}:H);if(J.type==="env:updated"&&J.workspaceId===$)Z.invalidateQueries({queryKey:j0.agent($)})}),Y5({queryKey:j0.agent($),queryFn:()=>G1(`/api/workspaces/${$}/agent`),staleTime:30000,refetchOnWindowFocus:!0})}function hh($){return G1(`/api/workspaces/${$}/auth/login`,{method:"POST"},"Could not start sign-in")}function vh($){return Y5({queryKey:j0.skills($),queryFn:()=>G1(`/api/workspaces/${$}/skills`),...G8})}async function b60($){let Z=await fetch(`/api/workspaces/${$}/skills/update`,{method:"POST"}),J=await Z.text(),H=null;try{H=JSON.parse(J)}catch{}if(!Z.ok){let B=H&&"error"in H?H.error:J,Q=Error(B||"Failed to update workspace skill");if(H?.skills)Q.status={skills:H.skills,updateAvailable:H.updateAvailable};throw Q}if(!H)throw Error("Invalid workspace skill update response");return H}function gh($){let Z=X1();return E5({mutationFn:()=>b60($),onSuccess:(J)=>{Z.setQueryData(j0.skills($),J)},onError:(J)=>{if(J.status)Z.setQueryData(j0.skills($),J.status)}})}function fh($){let Z=X1();return E5({mutationFn:(J)=>c4(`/api/workspaces/${$}`,y5("PUT",J),"Failed to save layout"),onSuccess:()=>{Z.invalidateQueries({queryKey:j0.preview($)})}})}var WL={id:"_moi_views",config:{colSpan:4,rowSpan:1},defaultPosition:{x:0,y:0}},qL=[WL],w60=new Set(qL.map(($)=>$.id));function e9($){return w60.has($)}function mh($){return[...qL,...$]}function uh(){return qL.map(($)=>({i:$.id,...$.defaultPosition}))}function SK(){return{open:["overview","scratchpad"],active:"overview"}}function RK($){let Z=SK();if(!$||typeof $!=="object")return Z;let J=$,H=Array.isArray(J.open)?J.open.filter(m9).filter((X,z,G)=>G.indexOf(X)===z):[];if(H.length===0)return Z;let B=["overview",...H.filter((X)=>X!=="overview")],Q=m9(J.active)&&B.includes(J.active)?J.active:"overview";return{open:B,active:Q}}function ph(){return{version:1,widgetGrid:uh(),layoutMode:"split",tabs:SK()}}function ch($,Z,J){let{tabs:H,...B}=$,Q=Z.tabs??J?.tabs;return Q===void 0?B:{...B,tabs:Q}}var rh=P(c(),1),NL=h8.createContext(null);function m1(){let $=h8.useContext(NL);if(!$)throw Error("useWorkspaceLayoutCtx must be used within <WorkspaceLayoutProvider>");return $}function lh(){return h8.useContext(NL)?.layout.theme}function dh($){let{cwd:Z,name:J,provider:H,agentId:B,...Q}=$;return Q}function ih({id:$,children:Z}){let J=X1(),H=xh($),B=fh($),Q=W5(B.mutate),X=h8.useRef(null),z=h8.useRef(null),G=h8.useCallback((Y)=>{let K=j0.layout($),F=J.getQueryData(K);if(!F)return;let W={...F,...Y};if(J.setQueryData(K,W),z.current=ch(dh(W),Y,z.current),X.current)clearTimeout(X.current);X.current=setTimeout(()=>{X.current=null;let q=z.current;if(z.current=null,q)Q.current(q)},600)},[$,J,Q]),U=h8.useMemo(()=>({layout:H.data?dh(H.data):ph(),setLayout:G,name:H.data?.name??null,cwd:H.data?.cwd??null,provider:H.data?.provider??null,workspaceId:$,isLoading:H.isLoading}),[H.data,H.isLoading,G,$]);return rh.jsx(NL,{value:U,children:Z})}var o2=P(m(),1);var IK=P(c(),1);function kK({visible:$,editing:Z,canvasRef:J,width:H,height:B,pointerProps:Q,onKeyDown:X,children:z}){if(!$)return null;return IK.jsxs("div",{className:"absolute inset-0 animate-in duration-100 fade-in",onKeyDown:X,children:[IK.jsx("canvas",{ref:J,...Q,width:H,height:B,"aria-label":"Drawing area",tabIndex:0,className:"absolute inset-0 size-full cursor-pencil touch-none outline-none"}),Z&&z]})}var $1=P(m(),1);function DL($,Z,J){let H=Math.max($,Z);if(H<=0)return 1;return Math.min(Math.max(J,1),1568/H)}function S60($){return new Promise((Z,J)=>{setTimeout(()=>J(Error("Annotation capture timed out")),$)})}function R60($){if(!($ instanceof HTMLElement))return;let{overflowX:Z,overflowY:J}=$.style;if(J==="auto"||J==="scroll")$.style.overflowY="hidden";if(Z==="auto"||Z==="scroll")$.style.overflowX="hidden"}async function ah($){let Z=$.getBoundingClientRect();if(Z.width<=0||Z.height<=0)throw Error("Annotation target is not visible");let{createContext:J,destroyContext:H,domToCanvas:B}=await import("/chunk-j905va8r.js"),Q=async()=>{let X=await J($,{width:Math.round(Z.width),height:Math.round(Z.height),scale:DL(Z.width,Z.height,window.devicePixelRatio),type:"image/png",backgroundColor:getComputedStyle($).backgroundColor,timeout:1000,features:{restoreScrollPosition:!0},style:{overflow:"hidden"},onCloneEachNode:R60});try{return await B(X)}finally{H(X)}};return Promise.race([Q(),S60(1e4)])}var VL={past:[],present:[],future:[]};function k60($,Z){if(Z.type==="commit")return{past:[...$.past,$.present],present:[...$.present,Z.stroke],future:[]};if(Z.type==="undo"){let J=$.past.at(-1);if(!J)return $;return{past:$.past.slice(0,-1),present:J,future:[$.present,...$.future]}}if(Z.type==="redo"){let J=$.future[0];if(!J)return $;return{past:[...$.past,$.present],present:J,future:$.future.slice(1)}}if($.present.length===0)return $;return{past:[...$.past,$.present],present:[],future:[]}}function sh($,Z,J){let H=$.getBoundingClientRect();return{x:(Z-H.left)/H.width*$.width,y:(J-H.top)/H.height*$.height}}function oh($,Z){let J=Z.getCoalescedEvents?.()??[];return(J.length>0?J:[Z]).map((B)=>sh($,B.clientX,B.clientY))}var I60={canUndo:!1,canRedo:!1,hasStrokes:!1};function SQ($){return $1.useSyncExternalStore($.subscribeHistory,$.getHistoryState,$.getHistoryState)}function nh($,Z,J,H){let B=Z.points[0];if(!B)return;$.beginPath(),$.lineCap="round",$.lineJoin="round",$.lineWidth=H,$.strokeStyle=J,$.moveTo(B.x,B.y);for(let Q=1;Q<Z.points.length;Q++){let X=Z.points[Q];$.lineTo(X.x,X.y)}if(Z.points.length===1)$.lineTo(B.x+0.01,B.y+0.01);$.stroke()}function th($,Z,J,H,B,Q=null){let X=Math.max(3,Math.min(Z,J)*0.005),z=X+Math.max(2,X*0.75),G=Q?[...B,Q]:B;for(let U of G)nh($,U,H.haloColor,z);for(let U of G)nh($,U,H.strokeColor,X)}function y60($,Z,J,H=null){let B=$.getContext("2d");if(!B)return;B.clearRect(0,0,$.width,$.height),th(B,$.width,$.height,Z,J,H)}function x60($,Z,J){let H=$.getContext("2d");if(!H)return;H.clearRect(0,0,$.width,$.height),H.drawImage(Z.snapshot,0,0,$.width,$.height),th(H,$.width,$.height,Z,J)}function h60($){return new Promise((Z,J)=>{$.toBlob((H)=>{if(H)Z(H);else J(Error("Could not export drawing"))},"image/png")})}function v60($,Z,J){let H=$.getBoundingClientRect();if(H.width<=0||H.height<=0)return null;let B=getComputedStyle($),Q=DL(H.width,H.height,window.devicePixelRatio),X=Math.max(1,Math.round(H.width*Q)),z=Math.max(1,Math.round(H.height*Q)),G=document.createElement("canvas");G.width=X,G.height=z;let U=B.getPropertyValue("--background").trim()||"#ffffff",Y=G.getContext("2d");if(Y)Y.fillStyle=U,Y.fillRect(0,0,X,z);return Z.width=X,Z.height=z,{id:J,snapshot:G,strokeColor:B.getPropertyValue("--primary").trim()||"#2563eb",haloColor:U,targetWidth:H.width,targetHeight:H.height}}function g60($){return $ instanceof HTMLInputElement||$ instanceof HTMLTextAreaElement||$ instanceof HTMLElement&&$.isContentEditable}function yK({mode:$="annotation",onChange:Z,onEditingStart:J,onFinish:H}={}){let B=$1.useRef(null),Q=$1.useRef(null),[X,z]=$1.useState(null),G=$1.useRef(X),[U,Y]=$1.useState(!1),K=$1.useRef(!1),F=$1.useRef(VL),W=$1.useRef(I60),q=$1.useRef(new Set),N=$1.useRef(0),D=$1.useRef(null),A=$1.useRef(null),V=$1.useRef(0),L=$1.useRef(0),j=$1.useRef(null),M=$1.useRef(null),[_,w]=$1.useState(!1),T=$1.useRef(!1),[b,C]=$1.useState(!1),k=$1.useRef(!1),S=W5(Z),R=W5(J),O=W5(H),y=$1.useCallback(()=>{let s=F.current,a=W.current,e={canUndo:s.past.length>0,canRedo:s.future.length>0,hasStrokes:s.present.length>0};if(e.canUndo===a.canUndo&&e.canRedo===a.canRedo&&e.hasStrokes===a.hasStrokes)return;W.current=e;for(let $0 of q.current)$0()},[]),I=$1.useCallback((s)=>{return q.current.add(s),()=>{q.current.delete(s)}},[]),x=$1.useCallback(()=>W.current,[]),v=$1.useCallback((s,a=null)=>{if(V.current)cancelAnimationFrame(V.current),V.current=0;let e=Q.current,$0=G.current;if(e&&$0)y60(e,$0,s,a)},[]),g=$1.useCallback(()=>{if(V.current)return;V.current=requestAnimationFrame(()=>{V.current=0,v(F.current.present,D.current)})},[v]),E=$1.useCallback((s,a,e)=>{let $0=j.current;if($0?.sessionId===s.id&&$0.historyVersion===e)return Promise.resolve($0.blob);let Q0=M.current;if(Q0?.sessionId===s.id&&Q0.historyVersion===e)return Q0.promise;if(a.length===0)return j.current={sessionId:s.id,historyVersion:e,blob:null},S.current?.(null),Promise.resolve(null);let _0=document.createElement("canvas");_0.width=s.snapshot.width,_0.height=s.snapshot.height,x60(_0,s,a);let M0=h60(_0).then((A0)=>{if(G.current?.id!==s.id||N.current!==e)return A0;return j.current={sessionId:s.id,historyVersion:e,blob:A0},S.current?.(A0),A0}).catch(()=>{if(G.current?.id===s.id&&N.current===e)r1.add({title:"Couldn’t export the drawing",type:"error"});return null}).finally(()=>{if(M.current?.promise===M0)M.current=null});return M.current={sessionId:s.id,historyVersion:e,promise:M0},M0},[S]),l=$1.useCallback(()=>{if(!D.current)return;let s=Q.current,a=A.current;if(s&&a!==null&&s.hasPointerCapture(a))s.releasePointerCapture(a);D.current=null,A.current=null,v(F.current.present)},[v]),r=$1.useCallback((s)=>{let a=G.current;if(!a||k.current)return;let e=k60(F.current,s);if(e===F.current)return;F.current=e,y(),D.current=null;let $0=++N.current;v(e.present),E(a,e.present,$0)},[E,y,v]),h=$1.useCallback((s)=>{F.current=VL,N.current=0,j.current=null,M.current=null,D.current=null,A.current=null,y(),G.current=s,z(s)},[y]),d=$1.useCallback(()=>{if(K.current)return;K.current=!0,Y(!0),R.current?.()},[R]),o=$1.useCallback(async()=>{let s=B.current;if(!s||G.current||T.current)return!1;let a=++L.current;T.current=!0,w(!0);try{let e=await ah(s);if(a!==L.current||B.current!==s)return!1;let $0=s.getBoundingClientRect(),Q0=getComputedStyle(s),_0={id:a,snapshot:e,strokeColor:Q0.getPropertyValue("--primary").trim()||"#2563eb",haloColor:Q0.getPropertyValue("--background").trim()||"#ffffff",targetWidth:$0.width,targetHeight:$0.height};return h(_0),d(),!0}finally{if(a===L.current)T.current=!1,w(!1)}},[d,h]),p=$1.useCallback(()=>{let s=G.current;L.current+=1,T.current=!1,k.current=!1,w(!1),C(!1),K.current=!1,Y(!1),l(),z(null),F.current=VL,y();let a=M.current;if(!s||a?.sessionId!==s.id)return G.current=null,Promise.resolve();return a.promise.then(()=>{if(G.current?.id===s.id)G.current=null})},[l,y]),i=$1.useCallback(async()=>{let s=G.current;if(!s)return null;return l(),E(s,F.current.present,N.current)},[l,E]),n=$1.useCallback(async()=>{return K.current=!1,Y(!1),i()},[i]),Z0=$1.useCallback(async()=>{let s=G.current;if(!s||k.current)return null;k.current=!0,C(!0),l();let a=N.current,e=F.current.present,$0=null;if(e.length>0||a>0)$0=await E(s,e,a);if(G.current?.id!==s.id)return $0;try{await O.current?.($0)}finally{if(G.current?.id===s.id)L.current+=1,K.current=!1,Y(!1),G.current=null,z(null),k.current=!1,C(!1)}return $0},[l,E,O]),J0=$1.useCallback(()=>r({type:"undo"}),[r]),U0=$1.useCallback(()=>r({type:"redo"}),[r]),z0=$1.useCallback(()=>r({type:"clear"}),[r]),B0=$1.useMemo(()=>({onPointerDown:(s)=>{if(k.current||!s.isPrimary||s.pointerType==="mouse"&&s.button!==0)return;if(!G.current&&$==="sketch"){let a=B.current;if(!a)return;let e=v60(a,s.currentTarget,++L.current);if(!e)return;h(e)}if(!G.current)return;d(),A.current=s.pointerId,s.currentTarget.setPointerCapture(s.pointerId),D.current={points:[sh(s.currentTarget,s.clientX,s.clientY)]},v(F.current.present,D.current)},onPointerMove:(s)=>{if(s.pointerId!==A.current||!D.current)return;D.current.points.push(...oh(s.currentTarget,s.nativeEvent)),g()},onPointerUp:(s)=>{if(s.pointerId!==A.current||!D.current)return;let a=D.current;if(a.points.push(...oh(s.currentTarget,s.nativeEvent)),D.current=null,A.current=null,s.currentTarget.hasPointerCapture(s.pointerId))s.currentTarget.releasePointerCapture(s.pointerId);r({type:"commit",stroke:a})},onPointerCancel:(s)=>{if(s.pointerId===A.current)l()}}),[r,d,l,h,$,v,g]),N0=$1.useCallback((s)=>{if(g60(s.target))return;if(s.key==="Escape"&&$==="annotation"){s.preventDefault(),Z0();return}if(!(s.metaKey||s.ctrlKey)||s.key.toLowerCase()!=="z")return;if(s.preventDefault(),s.shiftKey)U0();else J0()},[Z0,$,U0,J0]);$1.useLayoutEffect(()=>{if(!X)return;if(v(F.current.present,D.current),U)Q.current?.focus()},[U,v,X]),$1.useEffect(()=>{if(!X||$==="sketch")return;let s=B.current;if(!s){p();return}let a=new ResizeObserver((e)=>{let $0=e[0]?.contentRect;if(!$0)return;if(Math.abs($0.width-X.targetWidth)>1||Math.abs($0.height-X.targetHeight)>1)p()});return a.observe(s),()=>a.disconnect()},[p,$,X]),$1.useEffect(()=>()=>{if(L.current+=1,K.current=!1,G.current=null,V.current)cancelAnimationFrame(V.current)},[]);let D0=$1.useMemo(()=>({active:U,visible:$==="sketch"||X!==null,starting:_,finishing:b,open:o,undo:J0,redo:U0,clear:z0,flush:i,deactivate:n,finish:Z0,cancel:p,subscribeHistory:I,getHistoryState:x}),[U,$,X,_,b,o,J0,U0,z0,i,n,Z0,p,I,x]),F0=$1.useMemo(()=>({visible:D0.visible,editing:D0.active,canvasRef:Q,width:X?.snapshot.width??1,height:X?.snapshot.height??1,pointerProps:B0,onKeyDown:N0}),[D0.active,D0.visible,X,B0,N0]);return $1.useMemo(()=>({targetRef:B,controls:D0,layerProps:F0}),[D0,F0])}var s5=P(c(),1);function hK({controls:$,title:Z,busy:J,onComplete:H}){let{canUndo:B,canRedo:Q,hasStrokes:X}=SQ($);return s5.jsxs("div",{className:"absolute bottom-3 left-1/2 flex -translate-x-1/2 items-center gap-2 rounded-lg bg-popover p-1.5 shadow-md",children:[s5.jsx("span",{className:"mr-2 ml-2 text-sm font-medium",children:Z}),s5.jsxs("div",{className:"flex gap-1",children:[s5.jsxs(a1,{children:[s5.jsx(o1,{render:s5.jsx(P0,{type:"button",variant:"outline",size:"icon-sm",onClick:$.undo,disabled:J||!B,"aria-label":"Undo",children:s5.jsx(xK,{stroke:1.75})})}),s5.jsx(n1,{children:"Undo"})]}),s5.jsxs(a1,{children:[s5.jsx(o1,{render:s5.jsx(P0,{type:"button",variant:"outline",size:"icon-sm",onClick:$.redo,disabled:J||!Q,"aria-label":"Redo",children:s5.jsx(eh,{stroke:1.75})})}),s5.jsx(n1,{children:"Redo"})]}),s5.jsx(P0,{type:"button",variant:"outline",size:"sm",onClick:$.clear,disabled:J||!X,children:"Clear"})]}),s5.jsx(E4,{mode:"popLayout",initial:!1,children:s5.jsx(K5.div,{variants:{from:{opacity:0,scale:0.8,filter:"blur(4px)"},to:{opacity:1,scale:1,filter:"blur(0px)"}},initial:"from",animate:"to",exit:"from",transition:{type:"spring",duration:0.1,bounce:0},children:s5.jsx(P0,{type:"button",variant:X?"default":"ghost",size:"icon-sm",onClick:H,disabled:J,"aria-label":"Complete",className:X0(!X&&"text-muted-foreground"),children:X?s5.jsx(S8,{stroke:1.75}):s5.jsx(n5,{stroke:1.75})})},X?"complete":"cancel")})]})}var Y2=P(m(),1);async function RQ($,Z){let J=`/api/workspaces/${$}/uploads`;if(typeof Z==="string")return G1(`${J}/from-path`,y5("POST",{path:Z}),"The file couldn’t be uploaded");let H=new FormData;H.append("files",Z);let[B]=await G1(J,{method:"POST",body:H},"The file couldn’t be uploaded");if(!B)throw Error("The upload didn’t finish");return B}function LL({workspaceId:$,sessionId:Z}){if((k1.getState().attachments[z8($,Z)]??[]).length<bQ)return!0;return r1.add({id:"draft-attachment-limit",title:"Attachment limit reached",description:`You can attach up to ${bQ} items. Remove one to add another.`,type:"error"}),!1}function $v($,Z){for(let J of Z)Zv($,J)}async function Zv({workspaceId:$,sessionId:Z},J,H,B){if(!LL({workspaceId:$,sessionId:Z}))return;let Q=typeof J==="string"?null:J,X=typeof J==="string"?J.split("/").at(-1):J.name||"file",z=crypto.randomUUID();k1.getState().addAttachments($,Z,[{kind:"file",source:B,localId:z,label:X,mediaType:Q?.type||"application/octet-stream",previewUrl:Q?.type.startsWith("image/")?URL.createObjectURL(Q):void 0,status:"uploading"}]);try{let G=await RQ($,J);k1.getState().updateAttachment($,z,{status:"ready",upload:G,label:G.filename,mediaType:G.mediaType,...G.kind==="image"&&!Q?.type.startsWith("image/")?{previewUrl:`/api/workspaces/${$}/uploads/${G.id}`}:{}})}catch(G){let U=G instanceof Error?G.message:"The file couldn’t be uploaded";k1.getState().removeAttachment($,z),r1.add({title:`Couldn’t add ${X}`,description:U,type:"error"}),H?.(U)}}function Jv($,Z){if(Z.type==="text"){let{source:J,label:H,text:B}=Z;return f60($,{source:J,label:H,text:B}),Promise.resolve()}return Zv($,Z.file??Z.path,(J)=>{X8($.workspaceId,{source:"runtime",message:`addChatAttachment() from ${Z.source}: ${J}`})},Z.source)}function kQ({workspaceId:$,sessionId:Z,localId:J,purpose:H,source:B,blob:Q}){let X=H==="sketch"?"Sketch":"Annotation",z=k1.getState(),G=kG(z.attachments,$,J);if(!G&&!LL({workspaceId:$,sessionId:Z}))return!1;let U=URL.createObjectURL(Q);if(G)z.updateAttachment($,J,{previewUrl:U,status:"draft",upload:void 0});else z.addAttachments($,Z,[{kind:"drawing",purpose:H,localId:J,source:B,label:`${X}.png`,mediaType:"image/png",previewUrl:U,status:"draft"}]);return!0}async function vK($){let{workspaceId:Z,localId:J,purpose:H,blob:B,isCurrent:Q}=$,X=H==="sketch"?"Sketch":"Annotation";if(!kQ($))return;k1.getState().updateAttachment(Z,J,{status:"uploading"});try{let z=await RQ(Z,new File([B],`${X}.png`,{type:"image/png"}));if(!Q())return;k1.getState().updateAttachment(Z,J,{status:"ready",upload:z,mediaType:z.mediaType})}catch{if(!Q())return;k1.getState().removeAttachment(Z,J)}}function f60({workspaceId:$,sessionId:Z},J){if(!LL({workspaceId:$,sessionId:Z}))return;k1.getState().addAttachments($,Z,[{kind:"text",localId:crypto.randomUUID(),...J}])}function Hv({workspaceId:$,sessionId:Z,activeTab:J,mode:H,available:B,closePopup:Q,openPopup:X}){let z=Y2.useRef(null),G=Y2.useRef(null),U=Y2.useRef(new Map),Y=W5(Q),K=W5(X),F=Y2.useCallback((O)=>{let y=z.current;if(!y)return;if(G.current=O,!O){k1.getState().removeAttachment(y.workspaceId,y.attachmentId);return}kQ({workspaceId:y.workspaceId,sessionId:y.sourceSessionId,localId:y.attachmentId,purpose:"annotation",source:y.source,blob:O})},[]),W=Y2.useCallback((O,y)=>{let I=(U.current.get(O.attachmentId)??0)+1;return U.current.set(O.attachmentId,I),vK({workspaceId:O.workspaceId,sessionId:O.sourceSessionId,localId:O.attachmentId,purpose:"annotation",source:O.source,blob:y,isCurrent:()=>U.current.get(O.attachmentId)===I})},[]),q=Y2.useCallback(async(O)=>{let y=z.current;if(z.current=null,G.current=null,y&&O)await W(y,O);if(y?.origin==="popup")K.current()},[K,W]),N=yK({onChange:F,onFinish:q}),{controls:D}=N,{active:A,starting:V,open:L,finish:j,cancel:M}=D,_=Y2.useCallback(async(O)=>{if(!B||A||V)return;let y={workspaceId:$,sourceSessionId:Z,source:J,origin:O,attachmentId:crypto.randomUUID()};z.current=y;try{if(!await L()){if(z.current===y)z.current=null;return}if(O==="popup")Y.current()}catch{if(z.current!==y)return;z.current=null,r1.add({title:"Couldn’t capture this page",type:"error"})}},[A,J,B,Y,L,Z,V,$]),w=Y2.useCallback(async()=>{let O=z.current;if(await M(),z.current!==O)return;z.current=null;let y=G.current;if(G.current=null,O&&y)W(O,y)},[M,W]),T=Y2.useCallback((O)=>{let y=(U.current.get(O)??0)+1;if(U.current.set(O,y),k1.getState().removeAttachment($,O),z.current?.attachmentId===O)z.current=null,G.current=null,M()},[M,$]),b=Y2.useCallback(async()=>{if(V){await w();return}await j()},[w,j,V]),C=Y2.useCallback(()=>{if(A||V)b();else _("docked")},[A,b,_,V]),k=Y2.useCallback(()=>{if(A||V)b();else _("popup")},[A,b,_,V]);Y2.useEffect(()=>{let O=z.current;if(!O)return;let y=O.origin==="docked"?"split":"fullscreen";if(O.workspaceId!==$||O.sourceSessionId!==Z||O.source!==J||H!==y||!B)w()},[J,B,w,H,Z,$]);let S=Y2.useMemo(()=>B?{active:A||V,finish:b,onRemove:T,onToggle:C}:void 0,[B,A,V,b,T,C]),R=Y2.useMemo(()=>B?{active:A||V,finish:b,onRemove:T,onToggle:k}:void 0,[B,A,V,b,T,k]);return Y2.useMemo(()=>({...N,docked:S,popup:R}),[N,S,R])}var o4=P(m(),1);var v8=P(c(),1);function ML($){if(!$)return;$.focus();let Z=$.value.length;$.setSelectionRange(Z,Z)}function Qv({composerRef:$,className:Z,onMouseDown:J,children:H,...B}){return v8.jsx("form",{...B,onMouseDown:(Q)=>{if(J?.(Q),Q.defaultPrevented)return;if(Q.target instanceof Element&&Q.target.closest('button, input, textarea, select, a, [contenteditable="true"]'))return;ML($.current)},className:X0("group/composer flex w-full cursor-text flex-col gap-1 rounded-xl bg-card p-2 text-card-foreground shadow-xs transition-[color,box-shadow] outline-none focus-within:shadow-sm",Z),children:H})}function Xv({textareaRef:$,className:Z,...J}){return v8.jsx("textarea",{...J,ref:$,className:X0("field-sizing-content max-h-40 w-full resize-none bg-transparent px-2 py-1 text-sm leading-relaxed outline-none placeholder:text-muted-foreground disabled:opacity-50",Z)})}function zv({className:$,children:Z,...J}){return v8.jsx("div",{...J,className:X0("flex items-center justify-end gap-3",$),children:Z})}function m60($){if($.status==="checking")return"Checking agent status…";return}function IQ($,Z,J){return $&&!Z&&J.status==="available"}function Gv({label:$,hasContent:Z,busy:J=!1,loading:H=!1,availability:B}){let Q=IQ(Z,J||H,B),X=m60(B),z=v8.jsx(P0,{type:"submit",size:"icon",disabled:!Q,"aria-label":$,children:H?v8.jsx(U8,{}):v8.jsx(Bv,{stroke:1.5})});if(H||!X)return z;return v8.jsxs(a1,{children:[v8.jsx(o1,{render:v8.jsx("span",{className:"inline-flex",children:z})}),v8.jsx(n1,{className:"max-w-64 text-center",children:X})]})}var W8=P(m(),1),u60=48;function Uv($,Z){let J=W8.useRef(!0),[H,B]=W8.useState(!0),Q=W8.useCallback((G)=>{J.current=G,B((U)=>U===G?U:G)},[]),X=W8.useCallback((G="auto")=>{let U=$.current;if(!U)return;Q(!0),U.scrollTo({top:U.scrollHeight,behavior:G})},[$,Q]),z=W8.useCallback(()=>{let G=$.current;if(!G)return;Q(!1),G.scrollTo({top:0,behavior:"auto"})},[$,Q]);return W8.useEffect(()=>{let G=$.current;if(!G)return;let U=()=>{let Y=G.scrollHeight-G.scrollTop-G.clientHeight;Q(Y<=u60)};return G.addEventListener("scroll",U,{passive:!0}),()=>G.removeEventListener("scroll",U)},[$,Q]),W8.useEffect(()=>{let G=$.current;if(!G)return;let U=G.firstElementChild??G,Y=new ResizeObserver(()=>{if(J.current)G.scrollTop=G.scrollHeight});return Y.observe(U),()=>Y.disconnect()},[$]),W8.useLayoutEffect(()=>{X("auto")},[Z,X]),{atBottom:H,scrollToBottom:X,scrollToTop:z}}function p60($){return $.origin.kind!=="replay"&&$.origin.kind!=="synthetic"&&$.origin.kind!=="subagent-prompt"}function Yv($,Z){let J=$.meta||Z.meta?{...$.meta,...Z.meta}:void 0;return{...$,parts:[...$.parts,...Z.parts],timestamp:Z.timestamp??$.timestamp,meta:J}}function Kv($,Z){if(!Z)return $;let J=$.at(-1);if(J?.role==="assistant")return[...$.slice(0,-1),Yv(J,Z)];return[...$,Z]}function Fv($){let Z=[];for(let J of $){if(!p60(J))continue;if(J.role!=="assistant"){Z.push(J);continue}let H=Z.length>0?Z[Z.length-1]:null;if(H?.role==="assistant")Z[Z.length-1]=Yv(H,J);else Z.push(J)}return Z.map((J,H)=>{let B=Z[H-1];if(J.role!=="assistant"||J.meta?.durationMs!==void 0||B?.role!=="user"||B.origin.kind!=="user-input"||!B.timestamp||!J.timestamp)return J;let Q=Date.parse(B.timestamp),X=Date.parse(J.timestamp);if(!Number.isFinite(Q)||!Number.isFinite(X)||X<Q)return J;return{...J,meta:{...J.meta,durationMs:X-Q}}})}function PL($){switch($.kind){case"warning":return $.message;case"compact":return"Context compacted";case"model-change":return $.prev?`Model changed to ${$.model} (was ${$.prev})`:`Model changed to ${$.model}`;case"api-retry":return $.error?`Retrying: ${$.error}`:"Retrying the connection";case"rate-limit":case"hook":case"session-state":case"files-persisted":case"elicitation":default:return null}}function Wv($){if(!$)return;let Z=Date.parse($);return Number.isNaN(Z)?void 0:Z}function qv($,Z){let J=Z.filter((G)=>PL(G)!==null);if(J.length===0)return $.map((G)=>({kind:"turn",turn:G}));let H=[],B=[];for(let G of J){let U=Wv(G.at);if(U===void 0)B.push(G);else H.push({notice:G,time:U})}H.sort((G,U)=>G.time-U.time);let Q=[],X=0,z=Number.NEGATIVE_INFINITY;for(let G of $){z=Math.max(z,Wv(G.timestamp)??z);while(X<H.length&&H[X].time<=z)Q.push({kind:"notice",notice:H[X].notice}),X+=1;Q.push({kind:"turn",turn:G})}for(;X<H.length;X+=1)Q.push({kind:"notice",notice:H[X].notice});for(let G of B)Q.push({kind:"notice",notice:G});return Q}var t5=P(c(),1);function pJ({label:$,icon:Z,onRemove:J,previewUrl:H,loading:B,className:Q,children:X,...z}){return t5.jsxs("div",{...z,className:X0("group relative flex max-w-full min-w-0 cursor-default items-center rounded-md bg-background text-sm whitespace-nowrap text-foreground ring-1 ring-border outline-none focus-visible:ring-3 focus-visible:ring-ring/50",H?"size-14 overflow-hidden":"h-7 pr-2 pl-0.5",Q),children:[B&&t5.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center bg-background/70",children:t5.jsx(x5,{size:16,stroke:1.75,className:"animate-spin text-muted-foreground"})}),H?t5.jsx(d60,{label:$,previewUrl:H,onRemove:J}):t5.jsx(c60,{label:$,icon:Z,onRemove:J}),X]})}function c60({label:$,icon:Z,onRemove:J}){return t5.jsxs(t5.Fragment,{children:[J?t5.jsxs(P0,{type:"button",variant:"ghost",size:"icon-sm",onClick:J,"aria-label":`Remove ${$}`,className:"size-6 shrink-0 hover:bg-transparent hover:text-current",children:[t5.jsx(Z,{stroke:1.75,className:"group-focus-within:hidden group-hover:hidden"}),t5.jsx(n5,{stroke:1.75,className:"hidden group-focus-within:block group-hover:block"})]}):t5.jsx("span",{className:"flex size-6 shrink-0 items-center justify-center",children:t5.jsx(Z,{size:16,stroke:1.75})}),t5.jsx("span",{className:"truncate",children:$})]})}function d60({label:$,previewUrl:Z,onRemove:J}){return t5.jsxs(t5.Fragment,{children:[t5.jsx("img",{src:Z,alt:$,className:"size-full object-cover"}),J&&t5.jsx(P0,{type:"button",variant:"outline",size:"icon-sm",onClick:J,"aria-label":`Remove ${$}`,className:"absolute top-1 right-1 size-4 rounded-xs border-0 opacity-0 shadow-xs transition-opacity group-focus-within:opacity-100 group-hover:opacity-100 [&_svg]:size-3",children:t5.jsx(n5,{stroke:1.75})})]})}var Av=P(c(),1);function yQ({label:$,onRemove:Z}){return Av.jsx(pJ,{label:$,icon:Nv,onRemove:Z})}var H7={};b5(H7,{createHandle:()=>uv,Viewport:()=>mv,Trigger:()=>Sv,Root:()=>Tv,Positioner:()=>kv,Portal:()=>bv,Popup:()=>yv,Handle:()=>pK,Backdrop:()=>gv,Arrow:()=>hv});var Ov=P(m(),1);var gK=P(m(),1),_L=gK.createContext(void 0);function U4($){let Z=gK.useContext(_L);if(Z===void 0&&!$)throw Error(I0(50));return Z}var Vv=P(m(),1);var Dv=600,fK=300;var Lv={...y9,instantType:($)=>$.instantType,adaptiveOrigin:($)=>$.adaptiveOrigin,closeDelay:($)=>$.closeDelay};class jL extends h2{constructor($,Z,J){let H=new E2;super(Pv($,H,Z,J),_v(H),Lv)}setOpen=($,Z)=>{let{inlineRectCoordsRef:J}=this.context;$G(this,$,Z,{onBeforeDispatch(){let H=Z.event;if($&&Z.reason===K0.triggerHover&&Z.trigger&&"clientX"in H&&"clientY"in H&&J.current?.element!==Z.trigger)DA(J,Z.trigger,H.clientX,H.clientY)}})}}function Mv(){let $=new E2;return new $9(Object.freeze(Pv(void 0,$)),Object.freeze(_v($)),Lv)}function Pv($,Z,J,H=!1){return{...I9(Z,J,H),instantType:void 0,adaptiveOrigin:void 0,closeDelay:fK,...$}}function _v($){return{popupRef:Vv.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:$,inlineRectCoordsRef:{current:void 0}}}var J7=P(c(),1);function jv($){let{open:Z,defaultOpen:J=!1,onOpenChange:H,onOpenChangeComplete:B,actionsRef:Q,handle:X,triggerId:z,defaultTriggerId:G=null,children:U}=$,Y=K6((A,V)=>new jL({open:J,openProp:Z,activeTriggerId:G,triggerIdProp:z},A,V));Y.useControlledProp("openProp",Z),Y.useControlledProp("triggerIdProp",z),Y.useContextCallback("onOpenChange",H),Y.useContextCallback("onOpenChangeComplete",B);let K=Y.useState("open"),F=Y.useState("activeTriggerId"),W=Y.useState("mounted"),q=Y.useState("payload");S9(Y,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:N}=R9(K,Y,()=>{Y.context.inlineRectCoordsRef.current=void 0});H0(()=>{if(K){if(F==null)Y.set("payload",void 0)}},[Y,F,K]),Ov.useImperativeHandle(Q,()=>({unmount:N,close:()=>Y.setOpen(!1,w0(K0.imperativeAction))}),[N,Y]);let D=K||W;return J7.jsxs(_L.Provider,{value:Y,children:[X&&J7.jsx(b9,{handle:X,store:Y}),D&&J7.jsx(l60,{store:Y}),typeof U==="function"?U({payload:q}):U]})}function l60({store:$}){let Z=$.useState("floatingRootContext"),J=n8(Z);return k9($,{activeTriggerProps:J.reference,inactiveTriggerProps:J.trigger,popupProps:J.floating}),null}var Tv=d8(function(Z){if(U4(!0))return J7.jsx(jv,{...Z});return J7.jsx(H$,{children:J7.jsx(jv,{...Z})})});var Ev=P(m(),1);var mK=P(m(),1),OL=mK.createContext(void 0);function Cv(){let $=mK.useContext(OL);if($===void 0)throw Error(I0(48));return $}var TL=P(c(),1),bv=Ev.forwardRef(function(Z,J){let{keepMounted:H=!1,...B}=Z;if(!(U4().useState("mounted")||H))return null;return TL.jsx(OL.Provider,{value:H,children:TL.jsx(RZ,{ref:J,...B})})});var wv=P(m(),1);var Sv=P9(function(Z,J){let{render:H,className:B,delay:Q,closeDelay:X,id:z,payload:G,handle:U,style:Y,...K}=Z,F=U4(!0),q=x9(U)??F;if(!q)throw Error(I0(89));let N=t0(z),D=q.useState("isTriggerActive",N),A=q.useState("isOpenedByTrigger",N),V=q.useState("floatingRootContext"),L=q.context.inlineRectCoordsRef,j=wv.useRef(null),M=Q??Dv,_=X??fK,{registerTrigger:w,isMountedByThisTrigger:T}=w9(N,j,q,{payload:G,closeDelay:_}),b=t8(V,{mouseOnly:!0,move:!1,handleClose:e8(),delay:()=>({open:M,close:_}),triggerElementRef:j,isActiveTrigger:D,isClosing:()=>q.select("transitionStatus")==="ending"}),C=z$(V,{delay:M}),k={open:A},S=q.useState("triggerProps",T),R=bC(L,A);return G0("a",Z,{state:k,ref:[J,w,j],props:[b,C.reference,S,R,{id:N},K],stateAttributesMapping:_9})});var Rv=P(m(),1);var uK=P(m(),1),CL=uK.createContext(void 0);function cJ(){let $=uK.useContext(CL);if($===void 0)throw Error(I0(49));return $}var EL=P(c(),1),kv=Rv.forwardRef(function(Z,J){let{render:H,className:B,anchor:Q,positionMethod:X="absolute",side:z="bottom",align:G="center",sideOffset:U=0,alignOffset:Y=0,collisionBoundary:K="clipping-ancestors",collisionPadding:F=5,arrowPadding:W=5,sticky:q=!1,disableAnchorTracking:N=!1,collisionAvoidance:D=C9,style:A,...V}=Z,L=U4(),j=Cv(),M=O3(),_=L.useState("open"),w=L.useState("mounted"),T=L.useState("floatingRootContext"),b=L.useState("instantType"),C=L.useState("transitionStatus"),k=L.useState("adaptiveOrigin"),S=L.context.inlineRectCoordsRef,R=v9({anchor:Q,floatingRootContext:T,positionMethod:X,mounted:w,side:z,sideOffset:U,align:G,alignOffset:Y,arrowPadding:W,collisionBoundary:K,collisionPadding:F,sticky:q,disableAnchorTracking:N,keepMounted:j,nodeId:M,collisionAvoidance:D,adaptiveOrigin:k,inline:wC(S)}),O=R.update;H0(()=>{if(_&&w)O()},[_,w,O]);let y={open:_,side:R.side,align:R.align,anchorHidden:R.anchorHidden,instant:b},I=f9(Z,y,{styles:R.positionerStyles,transitionStatus:C,props:V,refs:[J,L.useStateSetter("positionerElement")],hidden:!w,inert:!_});return EL.jsx(CL.Provider,{value:R,children:EL.jsx(J$,{id:M,children:I})})});var Iv=P(m(),1);var yv=Iv.forwardRef(function(Z,J){let{className:H,render:B,style:Q,...X}=Z,z=U4(),{side:G,align:U}=cJ(),Y=z.useState("open"),K=z.useState("instantType"),F=z.useState("transitionStatus"),W=z.useState("popupProps"),q=z.useState("floatingRootContext"),N=z.useState("closeDelay");return A5({open:Y,ref:z.context.popupRef,onComplete(){if(Y)z.context.onOpenChangeComplete?.(!0)}}),C3(q,{closeDelay:N}),G0("div",Z,{state:{open:Y,side:G,align:U,instant:K,transitionStatus:F},ref:[J,z.context.popupRef,z.useStateSetter("popupElement")],props:[E9,W,g9(F),X],stateAttributesMapping:t2})});var xv=P(m(),1);var hv=xv.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=U4(),{arrowRef:G,side:U,align:Y,arrowUncentered:K,arrowStyles:F}=cJ(),q={open:z.useState("open"),side:U,align:Y,uncentered:K};return G0("div",Z,{state:q,ref:[G,J],props:[{style:F,"aria-hidden":!0},X],stateAttributesMapping:J8})});var vv=P(m(),1);var gv=vv.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=U4(),G=z.useState("open"),U=z.useState("mounted"),Y=z.useState("transitionStatus");return G0("div",Z,{state:{open:G,transitionStatus:Y},ref:[J],props:[{role:"presentation",hidden:!U,style:{pointerEvents:"none",userSelect:"none",WebkitUserSelect:"none"}},X],stateAttributesMapping:t2})});var fv=P(m(),1);var mv=fv.forwardRef(function(Z,J){let{render:H,className:B,style:Q,children:X,...z}=Z,G=U4(),U=cJ(),Y=G.useState("instantType"),{children:K,state:F}=q6({store:G,side:U.side,children:X}),W={activationDirection:F.activationDirection,transitioning:F.transitioning,instant:Y};return G0("div",Z,{state:W,ref:J,props:[z,{children:K}],stateAttributesMapping:W6})});class pK extends s8{constructor(){super(Mv(),"PreviewCard")}open($){this.openByTrigger($)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}function uv(){return new pK}var dJ=P(c(),1);function pv({...$}){return dJ.jsx(H7.Root,{"data-slot":"hover-card",...$})}function cv({...$}){return dJ.jsx(H7.Trigger,{"data-slot":"hover-card-trigger",...$})}function dv({className:$,side:Z="bottom",sideOffset:J=4,align:H="center",alignOffset:B=0,...Q}){return dJ.jsx(w8,{portal:H7.Portal,"data-slot":"hover-card-portal",children:dJ.jsx(H7.Positioner,{align:H,alignOffset:B,side:Z,sideOffset:J,className:"isolate z-50",children:dJ.jsx(H7.Popup,{"data-slot":"hover-card-content",className:o0("z-50 w-64 origin-(--transform-origin) rounded-lg bg-popover p-3 text-sm text-popover-foreground shadow-md outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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-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",$),...Q})})})}var h$=P(c(),1);function lv({attachment:$,onRemove:Z}){let{previewUrl:J,purpose:H}=$,B=H==="sketch"?"Sketch":"Annotation";return h$.jsxs(pv,{children:[h$.jsx(cv,{render:h$.jsx(pJ,{tabIndex:0,label:B,icon:lJ,onRemove:Z})}),J&&h$.jsx(dv,{side:"top",align:"start",className:"w-60 max-w-[calc(100vw-2rem)] rounded-xl",children:h$.jsx("img",{src:J,alt:`${B} preview`,className:"max-h-72 w-full rounded-md object-contain"})})]})}var rv=P(c(),1);function iv({attachment:$,onRemove:Z}){return rv.jsx(pJ,{label:$.label,icon:PJ,onRemove:Z,previewUrl:$.previewUrl,loading:$.status==="uploading",title:$.label,className:"max-w-52"})}var f$=P(m(),1);var $H=P(m(),1);var i60=["fable","opus","sonnet","haiku"];function cK($,Z,J=$.find((H)=>H.value==="default")?.resolvedModel){let H=$.filter((B)=>B.value!=="default");return H.find((B)=>B.value===Z)??H.find((B)=>(B.resolvedModel??B.value)===J)??H[0]}function av($){let Z=$.resolvedModel??$.value,J=i60.findIndex((H)=>Z===H||Z.startsWith(`${H}[`)||Z.includes(`-${H}-`));return J===-1?void 0:J}function r60($,Z){if($===void 0&&Z===void 0)return 0;if($===void 0)return-1;if(Z===void 0)return 1;return $-Z}function a60($,Z){return r60(av($),av(Z))}var o60={"claude-code":a60};function n60($,Z){return $.map((J,H)=>({model:J,index:H})).sort((J,H)=>Z(J.model,H.model)||J.index-H.index).map(({model:J})=>J)}function bL($,Z,J){if(Z&&$.includes(Z))return Z;if(J&&$.includes(J))return J;if($.includes("high"))return"high";return $[$.length-1]}function ov($,Z,J){let H=bL($,Z,J);return H?$.indexOf(H):-1}function nv($){return $.length>1}function sv($,Z){if($.supportsFastMode!==!0)return!1;return Z??$.defaultFastMode??!1}function tv($,Z){let J=o60[Z];return J?n60($,J):$}function ev($,Z){let J=[];for(let H of $){let B=H.group??Z,Q=J.find((X)=>X.label===B);if(Q)Q.models.push(H);else J.push({label:B,models:[H]})}return J}var i4={};b5(i4,{createHandle:()=>sg,Viewport:()=>ig,Trigger:()=>dg,SubmenuTrigger:()=>ng,SubmenuRoot:()=>fg,Separator:()=>ag,Root:()=>KF,RadioItemIndicator:()=>Ig,RadioItem:()=>kg,RadioGroup:()=>wg,Positioner:()=>Eg,Portal:()=>Og,Popup:()=>Pg,LinkItem:()=>Lg,Item:()=>Vg,Handle:()=>NF,GroupLabel:()=>Ag,Group:()=>qg,CheckboxItemIndicator:()=>Kg,CheckboxItem:()=>Yg,Backdrop:()=>Hg,Arrow:()=>Zg});var $g=P(m(),1);var dK=P(m(),1),wL=dK.createContext(void 0);function Y4($){let Z=dK.useContext(wL);if(Z===void 0&&!$)throw Error(I0(33));return Z}var lK=P(m(),1),SL=lK.createContext(void 0);function P5($){let Z=lK.useContext(SL);if(Z===void 0&&!$)throw Error(I0(36));return Z}var Zg=$g.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,{store:z}=P5(),{arrowRef:G,side:U,align:Y,arrowUncentered:K,arrowStyles:F}=Y4(),q={open:z.useState("open"),side:U,align:Y,uncentered:K};return G0("div",Z,{ref:[G,J],stateAttributesMapping:J8,state:q,props:{style:F,"aria-hidden":!0,...X}})});var Jg=P(m(),1);var iK=P(m(),1),s60=iK.createContext(void 0);function B7($=!0){let Z=iK.useContext(s60);if(Z===void 0&&!$)throw Error(I0(25));return Z}var Hg=Jg.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,{store:z}=P5(),G=z.useState("open"),U=z.useState("mounted"),Y=z.useState("transitionStatus"),K=z.useState("lastOpenChangeReason"),F=B7(),W={open:G,transitionStatus:Y};return G0("div",Z,{ref:F?.backdropRef?[J,F.backdropRef]:J,state:W,stateAttributesMapping:t2,props:[{role:"presentation",hidden:!U,style:{pointerEvents:K===K0.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},X]})});var nK=P(m(),1);var rK=P(m(),1),RL=rK.createContext(void 0);function Bg(){let $=rK.useContext(RL);if($===void 0)throw Error(I0(30));return $}var rJ=P(m(),1);var Qg=P(m(),1);function aK($){let{closeOnClick:Z,highlighted:J,id:H,nodeId:B,store:Q,typingRef:X,itemRef:z,itemMetadata:G}=$,{events:U}=Q.useState("floatingTreeRoot"),Y=Q.useState("open"),K=B7(!0),F=K!==void 0;return Qg.useMemo(()=>({id:H,role:"menuitem",tabIndex:Y&&J?0:-1,onKeyDown(W){if(W.key===" "&&X?.current)W.preventDefault()},onMouseMove(W){if(!B)return;U.emit("itemhover",{nodeId:B,target:W.currentTarget})},onClick(W){if(Z)U.emit("close",{domEvent:W,reason:K0.itemPress})},onMouseUp(W){if(K){let q=K.initialCursorPointRef.current;if(K.initialCursorPointRef.current=null,F&&q&&Math.abs(W.clientX-q.x)<=1&&Math.abs(W.clientY-q.y)<=1)return;if(F&&!$5.os.mac&&W.button===2)return}if(z.current&&Q.context.allowMouseUpTriggerRef.current&&(!F||W.button===2)){if(G.type==="regular-item")iJ(z.current,W,{detail:1})}}}),[Z,J,H,U,B,Y,Q,X,z,K,F,G])}var Q7={type:"regular-item"};function X7($){let{closeOnClick:Z,disabled:J,highlighted:H,id:B,store:Q,typingRef:X=Q.context.typingRef,nativeButton:z,itemMetadata:G,nodeId:U}=$,Y=rJ.useRef(null),{getButtonProps:K,buttonRef:F}=C5({disabled:J,focusableWhenDisabled:!0,native:z,composite:!0}),W=aK({closeOnClick:Z,highlighted:H,id:B,nodeId:U,store:Q,typingRef:X,itemRef:Y,itemMetadata:G}),q=rJ.useCallback((D)=>{return X2(W,{onMouseEnter(){if(G.type!=="submenu-trigger")return;G.setActive()}},D,K)},[W,K,G]),N=f2(Y,F);return rJ.useMemo(()=>({getItemProps:q,itemRef:N}),[q,N])}var v$=P(m(),1);var oK=P(m(),1),kL=oK.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Xg(){return oK.useContext(kL)}function K4($={}){let{guess:Z,label:J,metadata:H,textRef:B,index:Q}=$,{register:X,unregister:z,subscribeMapChange:G,nextIndexRef:U}=Xg(),Y=v$.useRef(-1),[K,F]=v$.useState(Q==null&&Z?()=>{if(Y.current===-1){let D=U.current;U.current+=1,Y.current=D}return Y.current}:-1),W=Q??K,q=v$.useRef(null),N=v$.useCallback((D)=>{let A=q.current;if(A)z(A);if(q.current=D,D)X(D,{metadata:H??null,index:Q??null,label:J,textRef:B})},[Q,X,z,H,J,B]);return H0(()=>{if(Q!=null)return;return G((D)=>{let A=q.current?D.get(q.current)?.index:null;if(A!=null)F(A)})},[Q,G]),{ref:N,index:W}}var zg="data-checked",Gg="data-unchecked";var z7={checked($){if($)return{[zg]:""};return{[Gg]:""}},...B2};var Ug=P(c(),1),Yg=nK.forwardRef(function(Z,J){let{render:H,className:B,id:Q,label:X,nativeButton:z=!1,disabled:G=!1,closeOnClick:U=!1,checked:Y,defaultChecked:K,onCheckedChange:F,style:W,...q}=Z,N=K4({guess:!0,label:X}),D=Y4(!0),A=t0(Q),{store:V}=P5(),L=V.useState("disabled"),j=G||L,M=V.useState("isActive",N.index),_=V.useState("itemProps"),[w,T]=z4({controlled:Y,default:K??!1,name:"MenuCheckboxItem",state:"checked"}),{getItemProps:b,itemRef:C}=X7({closeOnClick:U,disabled:j,highlighted:M,id:A,store:V,nativeButton:z,nodeId:D?.context.nodeId,itemMetadata:Q7}),k=nK.useMemo(()=>({disabled:j,highlighted:M,checked:w}),[j,M,w]);function S(O){let y=w0(K0.itemPress,O.nativeEvent,void 0,{preventUnmountOnClose:z1});if(F?.(!w,y),y.isCanceled)return;T((I)=>!I)}let R=G0("div",Z,{state:k,stateAttributesMapping:z7,props:[_,{role:"menuitemcheckbox","aria-checked":w,onClick:S},q,b],ref:[C,J,N.ref]});return Ug.jsx(RL.Provider,{value:k,children:R})});var sK=P(m(),1);var Kg=sK.forwardRef(function(Z,J){let{render:H,className:B,style:Q,keepMounted:X=!1,...z}=Z,G=Bg(),U=sK.useRef(null),{transitionStatus:Y,mounted:K,setMounted:F}=C2(G.checked);A5({batch:!0,enabled:!G.checked,open:G.checked,ref:U,onComplete(){if(!G.checked)F(!1)}});let W={checked:G.checked,disabled:G.disabled,highlighted:G.highlighted,transitionStatus:Y};return G0("span",Z,{state:W,ref:[J,U],stateAttributesMapping:z7,props:{"aria-hidden":!0,...z},enabled:X||K})});var eK=P(m(),1);var tK=P(m(),1),xQ=tK.createContext(void 0);function Fg(){let $=tK.useContext(xQ);if($===void 0)throw Error(I0(31));return $}var Wg=P(c(),1),qg=eK.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,[z,G]=eK.useState(void 0),U=G0("div",Z,{ref:J,props:{role:"group","aria-labelledby":z,...X}});return Wg.jsx(xQ.Provider,{value:G,children:U})});var Ng=P(m(),1);var Ag=Ng.forwardRef(function(Z,J){let{render:H,className:B,style:Q,id:X,...z}=Z,G=t0(X),U=Fg();return H0(()=>{return U(G),()=>{U((Y)=>Y===G?void 0:Y)}},[U,G]),G0("div",Z,{ref:J,props:{id:G,"aria-hidden":!0,...z}})});var Dg=P(m(),1);var Vg=Dg.forwardRef(function(Z,J){let{render:H,className:B,id:Q,label:X,nativeButton:z=!1,disabled:G=!1,closeOnClick:U=!0,style:Y,...K}=Z,F=K4({guess:!0,label:X}),W=Y4(!0),q=t0(Q),{store:N}=P5(),D=N.useState("disabled"),A=G||D,V=N.useState("isActive",F.index),L=N.useState("itemProps"),{getItemProps:j,itemRef:M}=X7({closeOnClick:U,disabled:A,highlighted:V,id:q,store:N,nativeButton:z,nodeId:W?.context.nodeId,itemMetadata:Q7});return G0("div",Z,{state:{disabled:A,highlighted:V},props:[L,K,j],ref:[M,J,F.ref]})});var $F=P(m(),1);var Lg=$F.forwardRef(function(Z,J){let{render:H,className:B,id:Q,label:X,closeOnClick:z=!1,style:G,...U}=Z,Y=$F.useRef(null),K=K4({guess:!0,label:X}),W=Y4(!0)?.context.nodeId,q=t0(Q),{store:N}=P5(),D=N.useState("isActive",K.index),A=N.useState("itemProps"),V=N.context.typingRef,{getButtonProps:L,buttonRef:j}=C5({native:!1,composite:!0}),M=aK({closeOnClick:z,highlighted:D,id:q,nodeId:W,store:N,typingRef:V,itemRef:Y,itemMetadata:Q7});function _(T){return X2(M,T,L)}return G0("a",Z,{state:{highlighted:D},props:[A,U,_],ref:[Y,j,J,K.ref]})});var ZF=P(m(),1);var Mg=P(c(),1),Pg=ZF.forwardRef(function(Z,J){let{render:H,className:B,style:Q,finalFocus:X,...z}=Z,{store:G}=P5(),{side:U,align:Y}=Y4(),K=aG(!0)!=null,F=G.useState("open"),W=G.useState("transitionStatus"),q=G.useState("popupProps"),N=G.useState("mounted"),D=G.useState("instantType"),A=G.useState("activeTriggerElement"),V=G.useState("parent"),L=G.useState("lastOpenChangeReason"),j=G.useState("rootId"),M=G.useState("floatingRootContext"),_=G.useState("floatingTreeRoot"),w=G.useState("closeDelay"),T=G.useState("hoverEnabled"),b=G.useState("disabled"),C=G.useState("openMethod"),k=V.type==="context-menu";A5({open:F,ref:G.context.popupRef,onComplete(){if(F)G.context.onOpenChangeComplete?.(!0)}}),ZF.useEffect(()=>{function I(x){G.setOpen(!1,w0(x.reason,x.domEvent))}return _.events.on("close",I),()=>{_.events.off("close",I)}},[_.events,G]),C3(M,{enabled:T&&!b&&!k&&V.type!=="menubar",closeDelay:w});let S=G.useStateSetter("popupElement"),R={transitionStatus:W,side:U,align:Y,open:F,nested:V.type==="menu",instant:D},O=G0("div",Z,{state:R,ref:[J,G.context.popupRef,S],stateAttributesMapping:t2,props:[q,{onKeyDown(I){if(K&&Z9.has(I.key))I.stopPropagation()}},g9(W),z,{"data-rootownerid":j}]}),y=V.type===void 0||k;if(A||V.type==="menubar"&&L!==K0.outsidePress)y=!0;return Mg.jsx(B$,{context:M,openInteractionType:C,modal:k,disabled:!N,returnFocus:X===void 0?y:X,initialFocus:V.type!=="menu",restoreFocus:!0,externalTree:V.type!=="menubar"?_:void 0,previousFocusableElement:A,nextFocusableElement:V.type===void 0?G.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:V.type===void 0?G.context.beforeContentFocusGuardRef:void 0,children:O})});var jg=P(m(),1);var JF=P(m(),1),IL=JF.createContext(void 0);function _g(){let $=JF.useContext(IL);if($===void 0)throw Error(I0(32));return $}var yL=P(c(),1),Og=jg.forwardRef(function(Z,J){let{keepMounted:H=!1,...B}=Z,{store:Q,parent:X}=P5();if(!(Q.useState("mounted")||H))return null;let U=X.type==="menu"||X.type==="menubar"?"group":void 0;return yL.jsx(IL.Provider,{value:H,children:yL.jsx($$,{ref:J,...B,portalOwnerRole:U})})});var $3=P(m(),1);var v3=P(m(),1);var Tg=P(c(),1);function G7($){let{children:Z,elementsRef:J,labelsRef:H,onMapChange:B}=$,Q=Y0(B),[,X]=v3.useState(!1),z=t1($70).current,G=t1(e60).current,U=v3.useRef(0),Y=v3.useRef(!0),K=v3.useRef(null),F=v3.useRef(null),W=Y0(()=>{if(Y.current)return;Y.current=!0,X((M)=>!M)}),q=Y0((M,_)=>{G.set(M,_),W()}),N=Y0((M)=>{G.delete(M),W()}),D=Y0((M)=>{let _=new Map;if(J.current.length=0,H)H.current.length=0;return M.forEach((w)=>{if(_.set(w.element,{...w.registration.metadata??{},index:w.index}),J.current[w.index]=w.element,H)H.current[w.index]=w.registration.label!==void 0?w.registration.label:w.registration.textRef?.current?.textContent??w.element.textContent}),U.current=J.current.length,_});function A(M){if(F.current?.disconnect(),F.current=null,typeof MutationObserver!=="function"||M.length<2)return;let _=new MutationObserver((T)=>{if(!H70(T))return;let b=null;for(let C of M){if(!C.isConnected)continue;if(b&&Cg(b,C)>0){_.disconnect(),W();return}b=C}});F.current=_;let w=new Set;for(let T=1;T<M.length;T+=1){let b=J70(M[T-1],M[T]);if(b)w.add(b)}w.forEach((T)=>_.observe(T,{childList:!0}))}let V=Y0(()=>{let[M,_]=Z70(G),w=D(M),T=K.current,b=!T||T.length!==M.length||M.some((C,k)=>{let S=T[k];return C.index!==S.index||C.element!==S.element||C.registration.index!==S.registration.index||C.registration.metadata!==S.registration.metadata});if(A(_),K.current=M,Y.current=!1,!b)return;z.forEach((C)=>C(w)),Q(w)});H0(()=>{if(!Y.current&&K.current)D(K.current);return()=>{if(J.current=[],H)H.current=[]}},[J,H,D]),H0(()=>{if(Y.current)V()}),H0(()=>{return()=>{F.current?.disconnect(),Y.current=!0}},[]);let L=Y0((M)=>{return z.add(M),()=>{z.delete(M)}}),j=v3.useMemo(()=>({register:q,unregister:N,subscribeMapChange:L,nextIndexRef:U}),[q,N,L,U]);return Tg.jsx(kL.Provider,{value:j,children:Z})}function e60(){return new Map}function $70(){return new Set}function Z70($){let Z=new Set,J=[],H=[];$.forEach((Q,X)=>{if(!X.isConnected)return;let z=Q.index,G={index:z??-1,element:X,registration:Q};if(z===null)H.push(G);else if(z>=0)Z.add(z),J.push(G)});let B=0;if(H.sort((Q,X)=>Cg(Q.element,X.element)),H.forEach((Q)=>{while(Z.has(B))B+=1;Q.index=B,J.push(Q),B+=1}),Z.size>0)J.sort((Q,X)=>Q.index-X.index);return[J,H.map((Q)=>Q.element)]}function J70($,Z){let J=$.parentElement;while(J&&!J.contains(Z))J=J.parentElement;return J}function H70($){for(let Z of $)for(let J=0;J<Z.removedNodes.length;J+=1)if(Z.removedNodes[J].isConnected)return!0;return!1}function Cg($,Z){return $.compareDocumentPosition(Z)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var aJ=P(c(),1),Eg=$3.forwardRef(function(Z,J){let{anchor:H,positionMethod:B="absolute",className:Q,render:X,side:z,align:G,sideOffset:U=0,alignOffset:Y=0,collisionBoundary:K="clipping-ancestors",collisionPadding:F=5,arrowPadding:W=5,sticky:q=!1,disableAnchorTracking:N=!1,collisionAvoidance:D=RT,style:A,...V}=Z,{store:L}=P5(),j=_g(),M=B7(!0),_=L.useState("parent"),w=L.useState("floatingRootContext"),T=L.useState("floatingTreeRoot"),b=L.useState("mounted"),C=L.useState("open"),k=L.useState("modal"),S=L.useState("openMethod"),R=L.useState("activeTriggerElement"),O=L.useState("transitionStatus"),y=L.useState("positionerElement"),I=L.useState("instantType"),x=L.useState("adaptiveOrigin"),v=L.useState("lastOpenChangeReason"),g=L.useState("floatingNodeId"),E=L.useState("floatingParentNodeId"),l=w.useState("domReferenceElement"),r=$3.useRef(null),h=f4(y),d=H,o=U,p=Y,i=G,n=D;if(_.type==="context-menu"){if(d=H??_.context?.anchor,i=i??"start",!z&&i!=="center")p=Z.alignOffset??2,o=Z.sideOffset??-5}let Z0=z,J0=i;if(_.type==="menu")Z0=Z0??"inline-end",J0=J0??"start",n=Z.collisionAvoidance??C9;else if(_.type==="menubar")Z0=Z0??(_.context.orientation==="vertical"?"inline-end":"bottom"),J0=J0??"start";let U0=_.type==="context-menu",z0=v9({anchor:d,floatingRootContext:w,positionMethod:M?"fixed":B,mounted:b,side:Z0,sideOffset:o,align:J0,alignOffset:p,arrowPadding:U0?0:W,collisionBoundary:K,collisionPadding:F,sticky:q,nodeId:g,keepMounted:j,disableAnchorTracking:N,collisionAvoidance:n,shift:U0?{crossAxis:!(("side"in n)&&n.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:T,adaptiveOrigin:x});$3.useEffect(()=>{function $0(Q0){if(Q0.open){if(Q0.parentNodeId===g)L.set("hoverEnabled",!1);if(Q0.nodeId!==g&&Q0.parentNodeId===L.select("floatingParentNodeId"))L.setOpen(!1,w0(K0.siblingOpen))}}return T.events.on("menuopenchange",$0),()=>{T.events.off("menuopenchange",$0)}},[L,T.events,g]),$3.useEffect(()=>{if(L.select("floatingParentNodeId")==null)return;function $0(Q0){if(Q0.open||Q0.nodeId!==L.select("floatingParentNodeId"))return;let _0=Q0.reason??K0.siblingOpen;L.setOpen(!1,w0(_0))}return T.events.on("menuopenchange",$0),()=>{T.events.off("menuopenchange",$0)}},[T.events,L]);let B0=i1();$3.useEffect(()=>{if(!C)B0.clear()},[C,B0]),$3.useEffect(()=>{function $0(Q0){if(!C||Q0.nodeId!==L.select("floatingParentNodeId"))return;if(Q0.target&&R&&R!==Q0.target){let _0=L.select("closeDelay");if(_0>0){if(!B0.isStarted())B0.start(_0,()=>{L.setOpen(!1,w0(K0.siblingOpen))})}else L.setOpen(!1,w0(K0.siblingOpen))}else B0.clear()}return T.events.on("itemhover",$0),()=>{T.events.off("itemhover",$0)}},[T.events,C,R,L,B0]),$3.useEffect(()=>{let $0={open:C,nodeId:g,parentNodeId:E,reason:L.select("lastOpenChangeReason")};T.events.emit("menuopenchange",$0)},[T.events,C,L,g,E]),H0(()=>{let $0=l,Q0=r.current;if($0)r.current=$0;if(Q0&&$0&&$0!==Q0){L.set("instantType",void 0);let _0=new AbortController;return h(()=>{L.set("instantType","trigger-change")},_0.signal),()=>{_0.abort()}}return},[l,h,L]);let N0={open:C,side:z0.side,align:z0.align,anchorHidden:z0.anchorHidden,nested:_.type==="menu",instant:I},D0=_.type==="menubar"&&_.context.modal,F0=k&&v!==K0.triggerHover;dG(C&&(D0||F0),S==="touch",y,R);let s=f9(Z,N0,{styles:z0.positionerStyles,transitionStatus:O,props:V,refs:[J,L.useStateSetter("positionerElement")],hidden:!b,inert:!C}),a=b&&_.type!=="menu"&&(_.type!=="menubar"&&k&&v!==K0.triggerHover||_.type==="menubar"&&_.context.modal),e=null;if(_.type==="menubar")e=_.context.contentElement;else if(_.type===void 0)e=R;return aJ.jsxs(wL.Provider,{value:z0,children:[a&&aJ.jsx(aZ,{ref:_.type==="context-menu"||_.type==="nested-context-menu"?_.context.internalBackdropRef:null,inert:T8(!C),cutout:e}),aJ.jsx(J$,{id:g,children:aJ.jsx(G7,{elementsRef:L.context.itemDomElements,labelsRef:L.context.itemLabels,children:s})})]})});var U7=P(m(),1);var HF=P(m(),1),xL=HF.createContext(void 0);function bg(){let $=HF.useContext(xL);if($===void 0)throw Error(I0(34));return $}var hL=P(c(),1),wg=U7.memo(U7.forwardRef(function(Z,J){let{render:H,className:B,value:Q,defaultValue:X,onValueChange:z,disabled:G=!1,style:U,"aria-labelledby":Y,...K}=Z,[F,W]=U7.useState(void 0),[q,N]=z4({controlled:Q,default:X,name:"MenuRadioGroup"}),D=Y0((j,M)=>{if(z?.(j,M),M.isCanceled)return;N(j)}),V=G0("div",Z,{state:{disabled:G},ref:J,props:{role:"group","aria-labelledby":Y??F,"aria-disabled":G||void 0,...K}}),L=U7.useMemo(()=>({value:q,setValue:D,disabled:G}),[q,D,G]);return hL.jsx(xQ.Provider,{value:W,children:hL.jsx(xL.Provider,{value:L,children:V})})}));var QF=P(m(),1);var BF=P(m(),1),vL=BF.createContext(void 0);function Sg(){let $=BF.useContext(vL);if($===void 0)throw Error(I0(35));return $}var Rg=P(c(),1),kg=QF.forwardRef(function(Z,J){let{render:H,className:B,id:Q,label:X,nativeButton:z=!1,disabled:G=!1,closeOnClick:U=!1,value:Y,style:K,...F}=Z,W=K4({guess:!0,label:X}),q=Y4(!0),N=t0(Q),{store:D}=P5(),A=D.useState("isActive",W.index),V=D.useState("itemProps"),{value:L,setValue:j,disabled:M}=bg(),_=D.useState("disabled"),w=G||M||_,T=L===Y,{getItemProps:b,itemRef:C}=X7({closeOnClick:U,disabled:w,highlighted:A,id:N,store:D,nativeButton:z,nodeId:q?.context.nodeId,itemMetadata:Q7}),k=QF.useMemo(()=>({disabled:w,highlighted:A,checked:T}),[w,A,T]);function S(O){let y=w0(K0.itemPress,O.nativeEvent,void 0,{preventUnmountOnClose:z1});j(Y,y)}let R=G0("div",Z,{state:k,stateAttributesMapping:z7,props:[V,{role:"menuitemradio","aria-checked":T,onClick:S},F,b],ref:[C,J,W.ref]});return Rg.jsx(vL.Provider,{value:k,children:R})});var XF=P(m(),1);var Ig=XF.forwardRef(function(Z,J){let{render:H,className:B,style:Q,keepMounted:X=!1,...z}=Z,G=Sg(),U=XF.useRef(null),{transitionStatus:Y,mounted:K,setMounted:F}=C2(G.checked);A5({batch:!0,enabled:!G.checked,open:G.checked,ref:U,onComplete(){if(!G.checked)F(!1)}});let W={checked:G.checked,disabled:G.disabled,highlighted:G.highlighted,transitionStatus:Y};return G0("span",Z,{state:W,stateAttributesMapping:z7,ref:[J,U],props:{"aria-hidden":!0,...z},enabled:X||K})});var e5=P(m(),1);var zF=P(m(),1),B70=zF.createContext(null);function GF($){let Z=zF.useContext(B70);if(Z===null&&!$)throw Error(I0(5));return Z}var hQ=P(m(),1);var yg={...y9,disabled:($)=>$.parent.type==="menubar"?$.parent.context.disabled||$.disabled:$.disabled,modal:($)=>($.parent.type===void 0||$.parent.type==="context-menu")&&($.modal??!0),openMethod:($)=>$.openMethod,allowMouseEnter:($)=>$.allowMouseEnter,highlightItemOnHover:($)=>$.highlightItemOnHover,parent:($)=>$.parent,rootId:($)=>{if($.parent.type==="menu")return $.parent.store.select("rootId");return $.parent.type!==void 0?$.parent.context.rootId:$.rootId},activeIndex:($)=>$.activeIndex,isActive:($,Z)=>$.activeIndex===Z,hoverEnabled:($)=>$.hoverEnabled,instantType:($)=>$.instantType,lastOpenChangeReason:($)=>$.openChangeReason,floatingTreeRoot:($)=>{if($.parent.type==="menu")return $.parent.store.select("floatingTreeRoot");return $.floatingTreeRoot},floatingNodeId:($)=>$.floatingNodeId,floatingParentNodeId:($)=>$.floatingParentNodeId,itemProps:($)=>$.itemProps,closeDelay:($)=>$.closeDelay,adaptiveOrigin:($)=>$.adaptiveOrigin,keyboardEventRelay:($)=>{if($.keyboardEventRelay)return $.keyboardEventRelay;if($.parent.type==="menu")return $.parent.store.select("keyboardEventRelay");return}};class gL extends h2{constructor($,Z,J=!1){let H=new E2,B=vg(H,Z,J,$);super(B,hg(H),yg);this.unsubscribeParentListener=this.observe("parent",(Q)=>{if(this.unsubscribeParentListener?.(),Q.type==="menu"){let X=Q.store.select("rootId"),z=Q.store.select("floatingTreeRoot"),G=Q.store.select("keyboardEventRelay");this.unsubscribeParentListener=Q.store.subscribe(()=>{let U=Q.store.select("rootId"),Y=Q.store.select("floatingTreeRoot"),K=Q.store.select("keyboardEventRelay");if(X===U&&z===Y&&G===K)return;X=U,z=Y,G=K,this.notifyAll()}),this.context.allowMouseUpTriggerRef=Q.store.context.allowMouseUpTriggerRef;return}if(Q.type!==void 0)this.context.allowMouseUpTriggerRef=Q.context.allowMouseUpTriggerRef;this.unsubscribeParentListener=null})}setOpen($,Z){this.state.floatingRootContext.context.events.emit("setOpen",{open:$,eventDetails:Z})}unsubscribeParentListener=null}function xg(){let $=new E2,Z=new $9(Object.freeze(vg($)),Object.freeze(hg($)),yg);return Object.assign(Z,{setOpen:z1})}function hg($){return{positionerRef:hQ.createRef(),popupRef:hQ.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:hQ.createRef(),beforeContentFocusGuardRef:hQ.createRef(),onOpenChangeComplete:void 0,triggerElements:$}}function vg($,Z,J=!1,H){return{...I9($,Z,J),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new Z$,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:M1,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...H}}var UF=P(m(),1),fL=UF.createContext(void 0);function YF(){return UF.useContext(fL)}var vQ=P(c(),1),KF=d8(function(Z){let{children:J,open:H,onOpenChange:B,onOpenChangeComplete:Q,defaultOpen:X=!1,disabled:z=!1,modal:G,loopFocus:U=!0,orientation:Y="vertical",actionsRef:K,closeParentOnEsc:F=!1,handle:W,triggerId:q,defaultTriggerId:N=null,highlightItemOnHover:D=!0}=Z,A=B7(!0),V=P5(!0),L=GF(!0),j=YF(),M=e5.useMemo(()=>{if(j&&V)return{type:"menu",store:V.store};if(L)return{type:"menubar",context:L};if(A&&!V)return{type:"context-menu",context:A};return{type:void 0}},[A,V,L,j]),_=_4(),w=_4(),T=O4(),b=M.type==="menu"?M.store:void 0,C=(H??X)&&b?.state.transitionStatus==="starting",k=t1(()=>C?b?.state.instantType:void 0).current,S=Q70({open:X,openProp:H,activeTriggerId:N,triggerIdProp:q,parent:M,disabled:z,highlightItemOnHover:D,modal:M.type===void 0?G:void 0,rootId:_,instantType:k},w,T!=null);S.useControlledProp("openProp",H),S.useControlledProp("triggerIdProp",q),S.useContextCallback("onOpenChangeComplete",Q);let R=S.useState("floatingTreeRoot"),O=O3(R),y=S.useState("open"),I=S.useState("activeTriggerElement"),x=S.useState("positionerElement"),v=S.useState("hoverEnabled"),g=S.useState("disabled"),E=S.useState("lastOpenChangeReason"),l=S.useState("parent"),r=S.useState("activeIndex"),h=S.useState("payload"),d=S.useState("floatingParentNodeId"),o=e5.useRef(null),p=e5.useRef(l.type!=="context-menu"),i=i1(),n=e5.useRef(!0),Z0=i1(),J0=d!=null,{openMethod:U0,triggerProps:z0}=rb(y);S.useSyncedValues({disabled:z,highlightItemOnHover:D,modal:l.type===void 0?G:void 0,openMethod:U0,rootId:_}),S9(S);let{forceUnmount:B0,transitionStatus:N0}=R9(y,S,()=>{S.set("allowMouseEnter",!1)},C),D0=f4(S.context.popupRef);e5.useEffect(()=>{if(k===void 0)return;let T0=()=>{if(S.state.instantType===k)S.set("instantType",void 0)};if(!y){T0();return}if(N0!==void 0)return;if(S.context.popupRef.current==null){T0();return}let d0=new AbortController;return D0(T0,d0.signal),()=>{d0.abort()}},[k,y,N0,D0,S]),H0(()=>{if(A&&!V)S.update({parent:{type:"context-menu",context:A},floatingNodeId:O,floatingParentNodeId:T});else if(V)S.update({floatingNodeId:O,floatingParentNodeId:T})},[A,V,O,T,S]),e5.useEffect(()=>{if(!y)o.current=null;if(l.type!=="context-menu")return;if(!y){i.clear(),p.current=!1;return}i.start(500,()=>{p.current=!0})},[i,y,l.type]),H0(()=>{if(!y&&!v)S.set("hoverEnabled",!0)},[y,v,S]);let F0=Y0((T0,d0)=>{let Q1=d0.reason;if(!T0&&!S.select("open"))return;if(y===T0&&d0.trigger===I&&E===Q1)return;let e0=qB(d0);if(!T0&&d0.trigger==null)d0.trigger=I??void 0;if(B?.(T0,d0),d0.isCanceled)return;S.state.floatingRootContext.dispatchOpenChange(T0,d0);let c0=d0.event;if(T0===!1&&c0?.type==="click"&&c0.pointerType==="touch"&&!n.current)return;if(T0&&Q1===K0.triggerFocus)n.current=!1,Z0.start(300,()=>{n.current=!0});else n.current=!0,Z0.clear();let y0=(Q1===K0.triggerPress||Q1===K0.itemPress)&&c0.detail===0,E1=!T0&&(Q1===K0.escapeKey||Q1==null);o.current=d0.event;let W1=X$(S.state,T0,d0.trigger,e0());if(W1.openChangeReason=Q1,l.type==="menubar"&&(Q1===K0.triggerFocus||Q1===K0.focusOut||Q1===K0.triggerHover||Q1===K0.listNavigation||Q1===K0.siblingOpen))W1.instantType="group";else if(y0||E1)W1.instantType=y0?"click":"dismiss";else W1.instantType=void 0;S.update(W1)}),s=WB({popupStore:S,floatingRootContext:S.state.floatingRootContext,floatingId:w,nested:T!=null,onOpenChange:F0}),a=s.context.events;H0(()=>{let T0=({open:d0,eventDetails:Q1})=>F0(d0,Q1);return a.on("setOpen",T0),()=>{a?.off("setOpen",T0)}},[a,F0]);let e=e5.useCallback(()=>{S.setOpen(!1,w0(K0.imperativeAction))},[S]);e5.useImperativeHandle(K,()=>({unmount:B0,close:e}),[B0,e]);let $0;if(l.type==="context-menu")$0=l.context;e5.useImperativeHandle($0?.positionerRef,()=>x,[x]),e5.useImperativeHandle($0?.actionsRef,()=>({setOpen:F0}),[F0]);let Q0=n8(s,{enabled:!g,bubbles:{escapeKey:F&&l.type==="menu"},outsidePress(){if(l.type!=="context-menu"||o.current?.type==="contextmenu")return!0;return p.current},externalTree:J0?R:void 0}),_0=u4(),M0=e5.useCallback((T0)=>{if(S.select("activeIndex")===T0)return;S.set("activeIndex",T0)},[S]),A0=bA(s,{enabled:!g,listRef:S.context.itemDomElements,activeIndex:r,nested:l.type!==void 0,loopFocus:U,orientation:Y,parentOrientation:l.type==="menubar"?l.context.orientation:void 0,rtl:_0==="rtl",disabledIndices:s2,onNavigate:M0,openOnArrowKeyDown:l.type!=="context-menu",externalTree:J0?R:void 0,focusItemOnHover:D}),L0=e5.useCallback((T0)=>{S.context.typingRef.current=T0},[S]),f=wA(s,{enabled:!g,listRef:S.context.itemLabels,elementsRef:S.context.itemDomElements,activeIndex:r,resetMs:ET,onMatch:(T0)=>{if(y&&T0!==r)S.set("activeIndex",T0)},onTyping:L0}),u=e5.useMemo(()=>{let T0=X2(f.reference,A0.reference,Q0.reference,{onMouseMove(){S.set("allowMouseEnter",!0)}},z0);return T0["aria-haspopup"]="menu",T0["aria-expanded"]=y,T0},[S,f.reference,A0.reference,Q0.reference,z0,y]),t=e5.useMemo(()=>{let T0=X2(A0.trigger,Q0.trigger,z0);return T0["aria-haspopup"]="menu",T0["aria-expanded"]=!1,T0},[A0.trigger,Q0.trigger,z0]);t1(()=>{return S.update({inactiveTriggerProps:t}),null});let W0=e5.useMemo(()=>X2(E9,{id:w,role:"menu","aria-orientation":Y==="horizontal"?"horizontal":void 0,"aria-labelledby":I?.id,onMouseMove(){if(S.set("allowMouseEnter",!0),l.type==="menu")S.set("hoverEnabled",!1)},onClick(){if(S.select("hoverEnabled"))S.set("hoverEnabled",!1)},onKeyDown(T0){let d0=S.select("keyboardEventRelay");if(d0&&!T0.isPropagationStopped())d0(T0)}},f.floating,A0.floating,Q0.floating),[I,w,Y,l.type,S,f.floating,A0.floating,Q0.floating]),S0=A0.item??M1;k9(S,{floatingRootContext:s,activeTriggerProps:u,inactiveTriggerProps:t,popupProps:W0,itemProps:S0});let p0=e5.useMemo(()=>({store:S,parent:M}),[S,M]),g0=vQ.jsxs(SL.Provider,{value:p0,children:[W&&vQ.jsx(b9,{handle:W,store:S}),typeof J==="function"?J({payload:h}):J]});if(l.type===void 0||l.type==="context-menu")return vQ.jsx(H$,{externalTree:R,children:g0});return g0});function Q70($,Z,J){return t1(()=>new gL($,Z,J)).current}var gg=P(m(),1);var mL=P(c(),1);function fg($){let Z=P5().store,J=gg.useMemo(()=>({parentMenu:Z}),[Z]);return mL.jsx(fL.Provider,{value:J,children:mL.jsx(KF,{...$})})}var F4=P(m(),1);var FF=5;function mg($,Z){let J=X70(Z);return $.clientX>=J.left-FF&&$.clientX<=J.right+FF&&$.clientY>=J.top-FF&&$.clientY<=J.bottom+FF}function X70($){let Z=$.getBoundingClientRect(),J=w1($);if($5.env.jsdom)return Z;let H=J.getComputedStyle($,"::before"),B=J.getComputedStyle($,"::after");if(!(H.content!=="none"||B.content!=="none"))return Z;let X=parseFloat(H.width)||0,z=parseFloat(H.height)||0,G=parseFloat(B.width)||0,U=parseFloat(B.height)||0,Y=Math.max(Z.width,X,G),K=Math.max(Z.height,z,U),F=Y-Z.width,W=K-Z.height;return{left:Z.left-F/2,right:Z.right+F/2,top:Z.top-W/2,bottom:Z.bottom+W/2}}var ug=P(m(),1);function WF($={}){let{highlightItemOnHover:Z,highlightedIndex:J,onHighlightedIndexChange:H}=oJ(),{ref:B,index:Q}=K4($),X=J===Q,z=ug.useRef(null),G=f2(B,z);return{compositeProps:{tabIndex:X?0:-1,onFocus(){H(Q)},onMouseMove(){let Y=z.current;if(!Z||!Y)return;let K=Y.hasAttribute("disabled")||Y.ariaDisabled==="true";if(!X&&!K)Y.focus()}},compositeRef:G,index:Q}}function pg($){let{render:Z,className:J,style:H,state:B=M1,props:Q=s2,refs:X=s2,metadata:z,stateAttributesMapping:G,tag:U="div",...Y}=$,{compositeProps:K,compositeRef:F}=WF({metadata:z});return G0(U,$,{state:B,ref:[F,...X],props:[K,...Q,Y],stateAttributesMapping:G})}function uL($){if(_1($)&&$.hasAttribute("data-rootownerid"))return $.getAttribute("data-rootownerid");if(C8($))return;return uL(E8($))}var qF=P(m(),1);function cg($){let{enabled:Z=!0,mouseDownAction:J,open:H}=$,B=qF.useRef(!1);return qF.useMemo(()=>{if(!Z)return M1;return{onMouseDown:(Q)=>{if(J==="open"&&!H||J==="close"&&H)B.current=!0,f0(Q.currentTarget).addEventListener("click",()=>{B.current=!1},{once:!0})},onClick:(Q)=>{if(B.current)B.current=!1,Q.preventBaseUIHandler()}}},[Z,J,H])}var Y7=P(c(),1),dg=P9(function(Z,J){let{render:H,className:B,style:Q,disabled:X=!1,nativeButton:z=!0,id:G,openOnHover:U,delay:Y=100,closeDelay:K=0,handle:F,payload:W,...q}=Z,N=P5(!0),A=x9(F)??N?.store;if(!A)throw Error(I0(85));let V=t0(G),L=A.useState("isTriggerActive",V),j=A.useState("floatingRootContext"),M=A.useState("isOpenedByTrigger",V),_=A.useState("triggerPopupId",V),w=F4.useRef(null),T=G70(),b=oJ(!0),C=$4(),k=F4.useMemo(()=>{return C??new Z$},[C]),S=O3(k),R=O4(),{registerTrigger:O,isMountedByThisTrigger:y}=w9(V,w,A,{payload:W,closeDelay:K,parent:T,floatingTreeRoot:k,floatingNodeId:S,floatingParentNodeId:R,keyboardEventRelay:b?.relayKeyboardEvent}),I=T.type==="menubar",x=A.useState("disabled"),v=X||x||I&&T.context.disabled,{getButtonProps:g,buttonRef:E}=C5({disabled:v,native:z});F4.useEffect(()=>{if(!M&&T.type===void 0)A.context.allowMouseUpTriggerRef.current=!1},[A,M,T.type]);let l=F4.useRef(null),r=i1(),h=Y0(($0)=>{if(!l.current)return;r.clear(),A.context.allowMouseUpTriggerRef.current=!1;let Q0=$0.target;if(R0(l.current,Q0)||R0(A.select("positionerElement"),Q0)||Q0===l.current)return;if(Q0!=null&&uL(Q0)===A.select("rootId"))return;if(mg($0,l.current))return;k.events.emit("close",{domEvent:$0,reason:K0.cancelOpen})});F4.useEffect(()=>{if(M&&A.select("lastOpenChangeReason")===K0.triggerHover)f0(l.current).addEventListener("mouseup",h,{once:!0})},[M,h,A]);let d=I&&T.context.hasSubmenuOpen,p=t8(j,{enabled:(U??d)&&!v&&(!I||d&&!y),handleClose:e8({blockPointerEvents:!I}),mouseOnly:!0,move:!1,restMs:T.type===void 0?Y:void 0,delay:{close:K},triggerElementRef:w,externalTree:k,isActiveTrigger:L,isClosing:()=>A.select("transitionStatus")==="ending"}),i=z70(M,A.select("lastOpenChangeReason")),n=T3(j,{enabled:!v,event:M&&I?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:T.type===void 0?i:!1}),Z0=z$(j,{enabled:!v&&d}),J0=cg({open:M,enabled:I,mouseDownAction:"open"}),U0=F4.useMemo(()=>X2(Z0.reference,n.reference),[Z0.reference,n.reference]),z0=A.useState("triggerProps",y),{preFocusGuardRef:B0,handlePreFocusGuardFocus:N0,handleFocusTargetFocus:D0}=fG(A,w),F0={disabled:v,open:M},s=[l,J,E,O,w],a=[U0,p??M1,z0,{"aria-haspopup":"menu","aria-controls":_,id:V,onMouseDown:($0)=>{if(A.select("open"))return;r.start(200,()=>{A.context.allowMouseUpTriggerRef.current=!0}),f0($0.currentTarget).addEventListener("mouseup",h,{once:!0})}},I?{role:"menuitem"}:{},J0,q,g],e=G0("button",Z,{enabled:!I,stateAttributesMapping:JB,state:F0,ref:s,props:a});if(I)return Y7.jsx(pg,{tag:"button",render:H,className:B,style:Q,state:F0,refs:s,props:a,stateAttributesMapping:JB});if(M)return Y7.jsxs(F4.Fragment,{children:[Y7.jsx(g4,{ref:B0,onFocus:N0},`${V}-pre-focus-guard`),Y7.jsx(F4.Fragment,{children:e},V),Y7.jsx(g4,{ref:A.context.triggerFocusTargetRef,onFocus:D0},`${V}-post-focus-guard`)]});return Y7.jsx(F4.Fragment,{children:e},V)});function z70($,Z){let J=i1(),[H,B]=F4.useState(!1);return H0(()=>{if($&&Z===K0.triggerHover)B(!0),J.start(xz,()=>{B(!1)});else if(!$)J.clear(),B(!1)},[$,Z,J]),H}function G70(){let $=GF(!0);return F4.useMemo(()=>{if($)return{type:"menubar",context:$};return{type:void 0}},[$])}var lg=P(m(),1);var ig=lg.forwardRef(function(Z,J){let{render:H,className:B,style:Q,children:X,...z}=Z,{store:G}=P5(),{side:U}=Y4(),Y=G.useState("instantType"),{children:K,state:F}=q6({store:G,side:U,children:X}),W={activationDirection:F.activationDirection,transitioning:F.transitioning,instant:Y};return G0("div",Z,{state:W,ref:J,props:[z,{children:K}],stateAttributesMapping:W6})});var rg=P(m(),1);var ag=rg.forwardRef(function(Z,J){let{className:H,render:B,orientation:Q="horizontal",style:X,...z}=Z;return G0("div",Z,{state:{orientation:Q},ref:J,props:[{role:"separator","aria-orientation":Q},z]})});var g3=P(m(),1);function og($){return $==null||$.hasAttribute("disabled")||$.getAttribute("aria-disabled")==="true"}var U70={"aria-expanded":void 0},ng=g3.forwardRef(function(Z,J){let{render:H,className:B,style:Q,label:X,id:z,nativeButton:G=!1,openOnHover:U=!0,delay:Y=100,closeDelay:K=0,disabled:F=!1,...W}=Z,q=YF();if(!q?.parentMenu)throw Error(I0(37));let N=K4({guess:!0,label:X}),D=Y4(),{store:A}=P5(),V=t0(z),L=A.useState("open"),j=A.useState("floatingRootContext"),M=A.useState("floatingTreeRoot"),_=A.useState("triggerPopupId",V),w=MA(V,A),T=Y0((U0)=>{if(w(U0),U0!==null&&A.select("open")&&A.select("activeTriggerId")==null)A.update({activeTriggerId:V??null,activeTriggerElement:U0,closeDelay:K})}),b=g3.useRef(null),C=g3.useCallback((U0)=>{b.current=U0,A.set("activeTriggerElement",U0)},[A]);H0(()=>{return T(b.current),()=>T(null)},[T,V,A]),A.useSyncedValue("closeDelay",K);let k=q.parentMenu,S=A.useState("disabled"),R=k.useState("disabled"),O=F||S||R,y=k.useState("itemProps"),I=k.useState("isActive",N.index),x=g3.useMemo(()=>({type:"submenu-trigger",setActive(){if(k.select("highlightItemOnHover"))k.set("activeIndex",N.index)}}),[k,N.index]),{getItemProps:v,itemRef:g}=X7({closeOnClick:!1,disabled:O,highlighted:I,id:V,store:A,typingRef:k.context.typingRef,nativeButton:G,itemMetadata:x,nodeId:D?.context.nodeId}),E=A.useState("hoverEnabled"),l=t8(j,{enabled:E&&U&&!O,handleClose:e8({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:Y,delay:{open:Y,close:K},shouldOpen:Y>0?()=>k.select("allowMouseEnter"):void 0,triggerElementRef:b,externalTree:M,isClosing:()=>A.select("transitionStatus")==="ending",guardStaleOpen:!0}),h=T3(j,{enabled:!O,event:"mousedown",toggle:!U,ignoreMouse:U,stickIfOpen:!1}).reference??M1,d=A.useState("triggerProps",!0);delete d.id;let o={disabled:O,highlighted:I,open:L},p=A.useState("openMethod"),n=A.useState("lastOpenChangeReason")===K0.listNavigation||p==="keyboard",Z0=L&&n&&$5.screenReader.voiceOver;return G0("div",Z,{state:o,stateAttributesMapping:_9,props:[h,l,d,y,Z0?U70:void 0,{"aria-controls":_,tabIndex:L||I?0:-1,onBlur(){if(I)k.set("activeIndex",null)}},W,v],ref:[J,N.ref,g,T,C]})});class NF extends s8{constructor(){super(xg(),"Menu")}open($){this.openByTrigger($)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}function sg(){return new NF}var W4=P(c(),1);function Z3({...$}){return W4.jsx(i4.Root,{"data-slot":"dropdown-menu",...$})}function Y70({...$}){return W4.jsx(w8,{portal:i4.Portal,"data-slot":"dropdown-menu-portal",...$})}function J3({...$}){return W4.jsx(i4.Trigger,{"data-slot":"dropdown-menu-trigger",...$})}function H3({align:$="start",alignOffset:Z=0,side:J="bottom",sideOffset:H=4,className:B,...Q}){return W4.jsx(Y70,{children:W4.jsx(i4.Positioner,{className:"isolate z-50 outline-none",align:$,alignOffset:Z,side:J,sideOffset:H,children:W4.jsx(i4.Popup,{"data-slot":"dropdown-menu-content",className:o0("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 rtl:data-[side=inline-end]:slide-in-from-right-2 rtl:data-[side=inline-start]:slide-in-from-left-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",B),...Q})})})}function K7({...$}){return W4.jsx(i4.Group,{"data-slot":"dropdown-menu-group",...$})}function AF({className:$,inset:Z,...J}){return W4.jsx(i4.GroupLabel,{"data-slot":"dropdown-menu-label","data-inset":Z,className:o0("px-2 pt-1.5 pb-0.5 text-xs text-muted-foreground data-inset:ps-7",$),...J})}function B3({className:$,inset:Z,variant:J="default",...H}){return W4.jsx(i4.Item,{"data-slot":"dropdown-menu-item","data-inset":Z,"data-variant":J,className:o0("group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:ps-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",$),...H})}function tg({...$}){return W4.jsx(i4.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...$})}function eg({className:$,children:Z,inset:J,...H}){return W4.jsxs(i4.RadioItem,{"data-slot":"dropdown-menu-radio-item","data-inset":J,className:o0("relative flex cursor-default items-center gap-2 rounded-md py-1 ps-2 pe-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:ps-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",$),...H,children:[W4.jsx("span",{className:"pointer-events-none absolute end-2 flex items-center justify-center","data-slot":"dropdown-menu-radio-item-indicator",children:W4.jsx(i4.RadioItemIndicator,{children:W4.jsx(S8,{stroke:1.75})})}),Z]})}var EF=P(m(),1);var F7={};b5(F7,{Value:()=>Xf,Track:()=>Yf,Thumb:()=>Af,Root:()=>Jf,Label:()=>Bf,Indicator:()=>Vf,Control:()=>Gf});var $2=P(m(),1);function pL($,Z,J=Object.is){let{length:H}=$;if(H!==Z.length)return!1;for(let B=0;B<H;B+=1)if(!J($[B],Z[B]))return!1;return!0}function $f($){return $==null?void 0:`${$}-label`}function Zf($,Z){return $??Z}function DF($,Z){return $-Z}function VF($,Z,J,H,B,Q){let X=T2($,J,H);if(!B)return X;let z=Q.slice();return z[Z]=T2(X,Q[Z-1]??-1/0,Q[Z+1]??1/0),z.sort(DF)}function LF($,Z,J){if(!Array.isArray($))return!0;let H=Z*J;for(let B=0;B<$.length-1;B+=1)if(!(Math.abs($[B]-$[B+1])>=H))return!1;return!0}var nJ=()=>null,r4={activeThumbIndex:nJ,max:nJ,min:nJ,minStepsBetweenValues:nJ,step:nJ,values:nJ,...S2};var MF=P(m(),1),cL=MF.createContext(void 0);function g8(){let $=MF.useContext(cL);if($===void 0)throw Error(I0(62));return $}var dL=P(c(),1);function K70($,Z){return $===Z||Array.isArray($)&&Array.isArray(Z)&&pL($,Z)}var Jf=$2.forwardRef(function(Z,J){let{"aria-labelledby":H,className:B,defaultValue:Q,disabled:X=!1,id:z,format:G,largeStep:U=10,locale:Y,render:K,max:F=100,min:W=0,minStepsBetweenValues:q=0,form:N,name:D,onValueChange:A,onValueCommitted:V,orientation:L="horizontal",step:j=1,thumbCollisionBehavior:M="push",thumbAlignment:_="center",value:w,style:T,...b}=Z,C=t0(z),k=$f(C),S=Y0(A),R=Y0(V),{clearErrors:O}=X4(),{state:y,disabled:I,name:x,setTouched:v,setDirty:g,validityData:E,validation:l}=i5(),{labelId:r}=r5(),[h,d]=$2.useState(),o=H??Zf(r,h),p=I||X,i=x??D,[n,Z0]=z4({controlled:w,default:Q??W,name:"Slider"}),J0=$2.useRef(null),U0=$2.useRef(null),z0=$2.useRef([]),B0=$2.useRef(null),N0=$2.useRef(-1),D0=$2.useRef(null),F0=$2.useRef(K0.none),[s,a]=$2.useState(-1),[e,$0]=$2.useState(-1),[Q0,_0]=$2.useState(!1),[M0,A0]=$2.useState(()=>new Map),[L0,f]=$2.useState([void 0,void 0]),u=Y0((c0)=>{if(a(c0),c0!==-1)$0(c0)}),t=Y0((c0)=>{if(c0)U0.current=c0}),W0=Array.isArray(n),S0=$2.useMemo(()=>{if(!W0)return[T2(n,W,F)];return n.map((c0)=>T2(c0,W,F)).sort(DF)},[F,W,W0,n]),p0=W0?S0:S0[0];h6(l.inputRef,C,p0,void 0,!p,D),p9(p0,()=>{O(i),l.change(p0);let c0=E.initialValue,y0;if(Array.isArray(p0)&&Array.isArray(c0))y0=!pL(p0,c0);else y0=p0!==c0;g(y0)});let g0=Y0((c0,y0)=>{if(Number.isNaN(c0)||K70(c0,n))return!1;let E1=y0.event,Q5=new E1.constructor(E1.type,E1);if(Object.defineProperty(Q5,"target",{writable:!0,value:{value:c0,name:i}}),y0.event=Q5,S(c0,y0),y0.isCanceled)return!1;return F0.current=y0.reason,Z0(c0),!0}),T0=Y0((c0,y0,E1)=>{let W1=VF(c0,y0,W,F,W0,S0);if(LF(W1,j,q)){let Q5="key"in E1?K0.keyboard:K0.inputChange,C0=g0(W1,w0(Q5,E1.nativeEvent,void 0,{activeThumbIndex:y0}));if(v(!0),C0)R(W1,iz(Q5,E1.nativeEvent))}});H0(()=>{if(!p)return;let c0=d1(f0(J0.current));if(R0(J0.current,c0))c0.blur();if(s!==-1)u(-1)},[s,p,u]);let d0=$2.useMemo(()=>({...y,activeThumbIndex:s,disabled:p,dragging:Q0,orientation:L,max:F,min:W,minStepsBetweenValues:q,step:j,values:S0}),[y,s,p,Q0,F,W,q,L,j,S0]),Q1=$2.useMemo(()=>({active:s,controlRef:U0,disabled:p,dragging:Q0,validation:l,format:G,handleInputChange:T0,indicatorPosition:L0,inset:_!=="center",labelId:o,rootLabelId:k,largeStep:U,lastUsedThumbIndex:e,lastChangeReasonRef:F0,form:N,locale:Y,max:F,min:W,minStepsBetweenValues:q,name:i,onValueCommitted:R,orientation:L,pressedThumbCenterOffsetRef:B0,pressedThumbIndexRef:N0,pressedValuesRef:D0,registerFieldControlRef:t,renderBeforeHydration:_==="edge",setActive:u,setDragging:_0,setIndicatorPosition:f,setLabelId:d,setValue:g0,state:d0,step:j,thumbCollisionBehavior:M,thumbMap:M0,thumbRefs:z0,values:S0}),[s,o,k,p,Q0,l,G,T0,L0,U,e,N,Y,F,W,q,i,R,L,t,u,g0,d0,j,M,_,M0,S0]),e0=G0("div",Z,{state:d0,ref:[J,J0],props:[{"aria-labelledby":o,id:C,role:"group"},b,(c0)=>l.getValidationProps(p,c0)],stateAttributesMapping:r4});return dL.jsx(cL.Provider,{value:Q1,children:dL.jsx(G7,{elementsRef:z0,onMapChange:A0,children:e0})})});var Hf=P(m(),1);var Bf=Hf.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=X;delete z.id;let{state:G,setLabelId:U,controlRef:Y,rootLabelId:K}=g8();function F(q,N){if(N){let V=f0(q.currentTarget).getElementById(N);if(_1(V)){iU(V);return}}let D=Y.current?.querySelectorAll('input[type="range"]'),A=D?.length===1?D[0]:null;if(_1(A))iU(A)}let W=lU({id:K,setLabelId:U,focusControl:F});return G0("div",Z,{ref:J,state:G,props:[W,X],stateAttributesMapping:r4})});var PF=P(m(),1);function lL($){if(Array.isArray($))return $.map((Z)=>lL(Z)).join(",");if($==null)return"";return String($)}var Qf=new Map;function F70($,Z){let J=JSON.stringify({locale:lL($),options:Z}),H=Qf.get(J);if(H)return H;let B=new Intl.NumberFormat($,Z);return Qf.set(J,B),B}function sJ($,Z,J){if($==null)return"";return F70(Z,J).format($)}var Xf=PF.forwardRef(function(Z,J){let{"aria-live":H="off",render:B,className:Q,children:X,style:z,...G}=Z,{thumbMap:U,state:Y,values:K,format:F,locale:W}=g8(),q=Array.from(U.values(),({inputId:V})=>V).join(" ").trim()||void 0,N=PF.useMemo(()=>K.map((V)=>sJ(V,W,F)),[F,W,K]),D=N.join(" – ");return G0("output",Z,{state:Y,ref:J,props:[{"aria-live":H,children:typeof X==="function"?X(N,K):D,htmlFor:q},G],stateAttributesMapping:r4})});var f8=P(m(),1);function _F($,Z){let J=$.getBoundingClientRect();return Z?(J.top+J.bottom)/2:(J.left+J.right)/2}function tJ($){if($===0)return 0;if(Math.abs($)<1){let J=$.toExponential().split("e-"),H=J[0].split(".")[1];return(H?H.length:0)+parseInt(J[1],10)}let Z=$.toString().split(".")[1];return Z?Z.length:0}function jF($,Z,J){let H=Math.round(($-J)/Z)*Z+J;return Number(H.toFixed(Math.max(tJ(Z),tJ(J))))}function iL($,Z,J,H,B,Q,X,z){let G=$.slice(),U=Q*X,Y=G.length-1,K=z??$,F=H+Z*U,W=B-(Y-Z)*U;G[Z]=T2(J,F,W);for(let q=Z+1;q<=Y;q+=1){let N=G[q-1]+U,D=B-(Y-q)*U,A=K[q],V=Math.max(G[q],N);if(A<V)V=Math.max(A,N);G[q]=T2(V,N,D)}for(let q=Z-1;q>=0;q-=1){let N=G[q+1]-U,D=H+q*U,A=K[q],V=Math.min(G[q],N);if(A>V)V=Math.min(A,N);G[q]=T2(V,D,N)}for(let q=0;q<=Y;q+=1)G[q]=Number(G[q].toFixed(12));return G}function zf($,Z,J,H,B,Q,X,z,G,U){let Y=J??Z,K=H??Z;if(!(Y.length>1))return{value:Q,thumbIndex:0,didSwap:!1};let W=G*U;if($==="push")return{value:iL(Y,B,Q,X,z,G,U),thumbIndex:B,didSwap:!1};let q=Y.slice(),N=q[B-1],D=q[B+1],A=N!=null?N+W:X,V=D!=null?D-W:z,L=Number(T2(Q,A,V).toFixed(12));switch(q[B]=L,$){case"swap":{let j=Y[B],M=0.0000001,_=Q>j,w=Q<j,T=_&&D!=null&&Q>=D-0.0000001,b=w&&N!=null&&Q<=N+0.0000001;if(!T&&!b)return{value:q,thumbIndex:B,didSwap:!1};let C=T?B+1:B-1,k=q.map((E,l)=>{if(l===B)return L;let r=K[l];if(r!=null)return r;return Y[l]}),S=Q;if(T)S=Math.max(Q,q[C]);else S=Math.min(Q,q[C]);let R=iL(q,C,S,X,z,G,U,k),O=T?C-1:C+1,y=R[O-1],I=R[O+1],x=y!=null?y+W:X;x=Math.max(x,X+O*W);let v=I!=null?I-W:z;v=Math.min(v,z-(R.length-1-O)*W);let g=T2(L,x,v);return R[O]=Number(g.toFixed(12)),{value:R,thumbIndex:C,didSwap:!0}}case"none":default:return{value:q,thumbIndex:B,didSwap:!1}}}var W70=2;function q70($,Z){if(!$)return{start:0,end:0};function J(Q){let X=Q!=null?parseFloat(Q):0;return Number.isNaN(X)?0:X}let H=!Z?"InlineStart":"Top",B=!Z?"InlineEnd":"Bottom";return{start:J($[`border${H}Width`])+J($[`padding${H}`]),end:J($[`border${B}Width`])+J($[`padding${B}`])}}function N70($,Z){if(Z.current!=null&&$.changedTouches){let J=$;for(let H=0;H<J.changedTouches.length;H+=1){let B=J.changedTouches[H];if(B.identifier===Z.current)return{x:B.clientX,y:B.clientY}}return null}return{x:$.clientX,y:$.clientY}}var Gf=f8.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,{disabled:z,dragging:G,inset:U,lastChangeReasonRef:Y,max:K,min:F,minStepsBetweenValues:W,onValueCommitted:q,orientation:N,pressedThumbCenterOffsetRef:D,pressedThumbIndexRef:A,pressedValuesRef:V,registerFieldControlRef:L,renderBeforeHydration:j,setActive:M,setDragging:_,setValue:w,state:T,step:b,thumbCollisionBehavior:C,thumbRefs:k,values:S}=g8(),R=u4(),O=S.length>1,y=N==="vertical",I=f8.useRef(null),x=f8.useRef(null),v=Y0((a)=>{if(a&&x.current==null)x.current=w1(a).getComputedStyle(a)}),g=f8.useRef(null),E=f8.useRef(0),l=f8.useRef(0),r=f8.useRef(null),h=F5(S);function d(a){return a?.querySelector('input[type="range"]')}function o(a){if(A.current=a,!k.current[a])D.current=null}function p(){A.current=-1,D.current=null}function i(a){if(!s0(a))return!1;return k.current.some((e)=>{if(!s0(e)||!R0(e,a))return!1;return d(e)?.disabled===!0})}function n(a){let e=I.current,$0=A.current;if(!e||$0<0||$0>=S.length){if($0>=S.length)r.current=null;return null}let{width:Q0,height:_0,bottom:M0,left:A0,right:L0}=e.getBoundingClientRect(),f=q70(x.current,y),u=l.current,t=(y?_0:Q0)-f.start-f.end-u*2,W0=D.current??0,S0=a.x-W0,p0=a.y-W0,g0=y?M0-p0-f.end:(R==="rtl"?L0-S0:S0-A0)-f.start,T0=T2((g0-u)/t,0,1),d0=(K-F)*T0+F;if(d0=jF(d0,b,F),d0=T2(d0,F,K),!O)return{value:d0,thumbIndex:$0,didSwap:!1};return zf(C,S,h.current,V.current,$0,d0,F,K,b,W)}function Z0(a){V.current=O?S.slice():null,r.current=null,h.current=S;let e=A.current,$0=e;if(e>-1&&e<S.length){if(S[e]===K){let Q0=e;while(Q0>0&&S[Q0-1]===K)Q0-=1;$0=Q0}}else{let Q0=!y?"x":"y",_0;$0=-1;for(let M0=0;M0<k.current.length;M0+=1){let A0=k.current[M0];if(s0(A0)&&!d(A0)?.disabled){let L0=_F(A0,y),f=Math.abs(a[Q0]-L0);if(_0===void 0||f<=_0)$0=M0,_0=f}}}if($0>-1&&$0!==e)o($0);if(U){let Q0=k.current[$0];if(s0(Q0)){let _0=Q0.getBoundingClientRect(),M0=!y?"width":"height";l.current=_0[M0]/2}}}function J0(a){let e=d(k.current?.[a]);if(!e)return;e.focus({preventScroll:!0,focusVisible:!1})}function U0(a,e,$0){let Q0=w(a.value,w0(e,$0,void 0,{activeThumbIndex:a.thumbIndex}));if(Q0){if(r.current=a.value,h.current=Array.isArray(a.value)?a.value:[a.value],a.didSwap)o(a.thumbIndex),J0(a.thumbIndex)}return Q0}let z0=Y0((a)=>{let e=N70(a,g);if(e==null)return;if(E.current+=1,a.type==="pointermove"&&a.buttons===0){B0(a);return}let $0=n(e);if($0==null)return;if(LF($0.value,b,W)){if(!G&&E.current>W70)_(!0);U0($0,K0.drag,a)}}),B0=Y0((a)=>{M(-1),_(!1),D.current=null;let e=r.current;if(Array.isArray(e)&&e.length!==S.length)r.current=null;if(r.current!=null){let $0=Y.current;q(r.current,iz($0,a))}if("pointerType"in a&&I.current?.hasPointerCapture(a.pointerId))I.current?.releasePointerCapture(a.pointerId);A.current=-1,g.current=null,D0()}),N0=Y0((a)=>{if(z)return;if(i(P1(a))){p();return}let e=a.changedTouches[0];if(e==null)return;g.current=e.identifier;let $0={x:e.clientX,y:e.clientY};Z0($0);let Q0=n($0);if(Q0==null)return;J0(Q0.thumbIndex),U0(Q0,K0.trackPress,a),E.current=0;let _0=f0(I.current);_0.addEventListener("touchmove",z0,{passive:!0}),_0.addEventListener("touchend",B0,{passive:!0})}),D0=Y0(()=>{let a=f0(I.current);a.removeEventListener("pointermove",z0),a.removeEventListener("pointerup",B0),a.removeEventListener("touchmove",z0),a.removeEventListener("touchend",B0),V.current=null,r.current=null}),F0=P4();return f8.useEffect(()=>{let a=I.current;if(!a)return()=>D0();let e=a0(a,"touchstart",N0,{passive:!0});return()=>{e(),F0.cancel(),D0()}},[D0,N0,I,F0]),f8.useEffect(()=>{if(z)D0()},[z,D0]),G0("div",Z,{state:T,ref:[J,L,I,v],props:[{["data-base-ui-slider-control"]:j?"":void 0,onPointerDown(a){let e=I.current,$0=P1(a.nativeEvent);if(!e||z||a.defaultPrevented||!s0($0)||a.button!==0)return;if(i($0)){p();return}let Q0={x:a.clientX,y:a.clientY};Z0(Q0);let _0=n(Q0);if(_0==null)return;if(R0(k.current[_0.thumbIndex],d1(f0(e))))a.preventDefault();else F0.request(()=>{J0(_0.thumbIndex)});if(_(!0),D.current==null)U0(_0,K0.trackPress,a.nativeEvent);if(a.nativeEvent.pointerId)e.setPointerCapture(a.nativeEvent.pointerId);E.current=0;let L0=f0(e);L0.addEventListener("pointermove",z0,{passive:!0}),L0.addEventListener("pointerup",B0,{once:!0})}},X],stateAttributesMapping:r4})});var Uf=P(m(),1);var Yf=Uf.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,{state:z}=g8();return G0("div",Z,{state:z,ref:J,props:[{style:{position:"relative"}},X],stateAttributesMapping:r4})});var m8=P(m(),1);var OF="";var Kf=P(OZ(),1);function A70(){return z1}function D70(){return!1}function V70(){return!0}function eJ(){return Kf.useSyncExternalStore(A70,D70,V70)}function gQ($,Z,J){return($-Z)*100/(J-Z)}var $71=P(m(),1);var TF=P(m(),1),L70=TF.createContext(void 0),M70={disableStyleElements:!1};function Ff(){return TF.useContext(L70)??M70}var Wf=P(c(),1);function CF($){let{script:Z}=$,{nonce:J}=Ff();if(!eJ())return null;return Wf.jsx("script",{nonce:J,dangerouslySetInnerHTML:{__html:Z},suppressHydrationWarning:!0})}var qf="data-index";var fQ=P(c(),1),Nf,_70=new Set([...Z9,FD,WD]);function j70($,Z,J,H){if(Z<0)return;if($.length===2)return`${sJ($[Z],H,J)} ${Z===0?"start":"end"} range`;return J?sJ($[Z],H,J):void 0}function O70($,Z,J,H,B){let Q=$+Z*J,X=Number(Q.toFixed(Math.max(tJ($),tJ(Z),tJ(H))));return T2(X,H,B)}var Af=m8.forwardRef(function(Z,J){let{render:H,children:B,className:Q,"aria-describedby":X,"aria-label":z,"aria-labelledby":G,"aria-valuetext":U,disabled:Y=!1,getAriaLabel:K,getAriaValueText:F,id:W,index:q,inputRef:N,onBlur:D,onFocus:A,onKeyDown:V,tabIndex:L,style:j,...M}=Z,_=t0(W),{active:w,lastUsedThumbIndex:T,controlRef:b,disabled:C,validation:k,format:S,handleInputChange:R,inset:O,labelId:y,largeStep:I,locale:x,max:v,min:g,minStepsBetweenValues:E,form:l,name:r,orientation:h,pressedThumbCenterOffsetRef:d,pressedThumbIndexRef:o,renderBeforeHydration:p,setActive:i,setIndicatorPosition:n,state:Z0,step:J0,thumbRefs:U0,values:z0}=g8(),B0=u4(),N0=Y||C,D0=z0.length>1,F0=h==="vertical",s=B0==="rtl",{setTouched:a,setFocused:e,validationMode:$0}=i5(),Q0=m8.useRef(null),_0=m8.useRef(null),M0=m8.useRef(!1),A0=Y0((m0)=>{if(M0.current)return;A?.(m0)}),L0=Y0((m0)=>{if(M0.current)return;D?.(m0)}),f=t0(),u=v6(),t=D0?f:u,W0=m8.useMemo(()=>({inputId:t}),[t]),{ref:S0,index:p0}=K4({metadata:W0}),g0=!D0?0:q??p0,T0=g0===z0.length-1,d0=z0[g0],Q1=gQ(d0,g,v),[e0,c0]=m8.useState(),y0=eJ(),E1=T>=0&&T<z0.length?T:-1,W1=Y0(()=>{let m0=b.current,q0=Q0.current;if(!m0||!q0)return;let h0=q0.getBoundingClientRect(),U1=m0.getBoundingClientRect(),k0=F0?"height":"width",i0=U1[k0]-h0[k0],L1=(h0[k0]/2+i0*Q1/100)/U1[k0]*100,T1=Number.isFinite(L1)?L1:void 0;if(c0(T1),g0===0)n((c1)=>[T1,c1[1]]);else if(T0)n((c1)=>[c1[0],T1])});H0(()=>{if(O)queueMicrotask(W1)},[W1,O]),H0(()=>{if(O)W1()},[W1,O,Q1]),H0(()=>{if(!O)return;let m0=b.current,q0=Q0.current;if(!m0||!q0)return;let h0=w1(m0).ResizeObserver;if(typeof h0!=="function")return;let U1=new h0(W1);return U1.observe(m0),U1.observe(q0),()=>{U1.disconnect()}},[b,W1,O]);let Q5=F0?"bottom":"insetInlineStart",C0=F0?"left":"top",x0;if(D0){if(w===g0)x0=2;else if(E1===g0)x0=1}else if(w===g0)x0=1;let r0;if(!O&&!Number.isFinite(Q1))r0=r8;else r0={position:"absolute",[Q5]:O?"var(--position)":`${Q1}%`,[C0]:"50%",translate:`${(F0||!s?-1:1)*50}% ${(F0?1:-1)*50}%`,zIndex:x0,...O&&{["--position"]:`${e0??0}%`,visibility:p&&y0||e0===void 0?"hidden":void 0}};let n0;if(F0)n0=s?"vertical-rl":"vertical-lr";let D1=typeof K==="function"?K(g0):z,V1=X2({"aria-label":D1,"aria-labelledby":G??(D1==null?y:void 0),"aria-describedby":X,"aria-orientation":h,"aria-valuenow":d0,"aria-valuetext":typeof F==="function"?F(sJ(d0,x,S),d0,g0):U??j70(z0,g0,S,x),disabled:N0,form:l,id:t,max:v,min:g,name:r,onChange(m0){R(m0.currentTarget.valueAsNumber,g0,m0)},onFocus(m0){let q0=M0.current;if(M0.current=!1,i(g0),e(!0),q0)m0.stopPropagation()},onBlur(m0){if(M0.current){m0.stopPropagation();return}if(i(-1),U0.current.some((q0)=>R0(q0,m0.relatedTarget)))return;if(a(!0),e(!1),$0==="onBlur")k.commit(VF(d0,g0,g,v,D0,z0))},onKeyDown(m0){if(m0.defaultPrevented)return;if(!_70.has(m0.key))return;if(Z9.has(m0.key))m0.stopPropagation();let q0=null,h0=0,U1=m0.shiftKey?I:J0,k0=jF(d0,J0,g);switch(m0.key){case oZ:h0=1;break;case tZ:h0=s?-1:1;break;case nZ:h0=-1;break;case sZ:h0=s?1:-1;break;case FD:U1=I,h0=1;break;case WD:U1=I,h0=-1;break;case $J:q0=D0&&Number.isFinite(z0[g0+1])?z0[g0+1]-J0*E:v;break;case eZ:q0=D0&&Number.isFinite(z0[g0-1])?z0[g0-1]+J0*E:g;break;default:break}if(h0!==0)q0=O70(k0,U1,h0,g,v);if(q0!==null){let i0=m0.currentTarget;if(!j9(i0))M0.current=!0,i0.blur(),i0.focus({preventScroll:!0,focusVisible:!0});R(q0,g0,m0),m0.preventDefault()}},step:J0,style:{...r8,width:"100%",height:"100%",writingMode:n0},tabIndex:L,type:"range",value:d0??""},(m0)=>k.getValidationProps(N0,m0),{onFocus:A0,onBlur:L0,onKeyDown:V}),p1=f2(_0,k.inputRef,N);return G0("div",Z,{state:Z0,ref:[J,S0,Q0],props:[{[qf]:g0,children:fQ.jsxs(m8.Fragment,{children:[B,fQ.jsx("input",{ref:p1,...V1,suppressHydrationWarning:!0}),O&&T0&&p&&(Nf||(Nf=fQ.jsx(CF,{script:OF})))]}),id:_,onPointerDown(m0){if(N0)return;o.current=g0;let q0=_F(m0.currentTarget,F0);d.current=(F0?m0.clientY:m0.clientX)-q0},style:r0,suppressHydrationWarning:p||void 0},M],stateAttributesMapping:r4})});var Df=P(m(),1);function T70($,Z,J,H,B,Q){let X={visibility:Q||J&&(H===void 0||Z&&B===void 0)?"hidden":void 0,position:$?"absolute":"relative",[$?"width":"height"]:"inherit"},z=`${H??0}%`,G=`${(B??0)-(H??0)}%`;if(J){if(X["--start-position"]=z,z="var(--start-position)",Z)X["--relative-size"]=G,G="var(--relative-size)"}return X[$?"bottom":"insetInlineStart"]=Z?z:0,X[$?"height":"width"]=Z?G:z,X}var Vf=Df.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,{indicatorPosition:z,inset:G,max:U,min:Y,orientation:K,renderBeforeHydration:F,state:W,values:q}=g8(),N=eJ(),D=K==="vertical",A=q.length>1,V=T70(D,A,G,G?z[0]:gQ(q[0],Y,U),G?z[1]:gQ(q[q.length-1],Y,U),G&&F&&N);return G0("div",Z,{state:W,ref:J,props:[{["data-base-ui-slider-indicator"]:F?"":void 0,style:V,suppressHydrationWarning:F||void 0},X],stateAttributesMapping:r4})});var g$=P(c(),1);function Lf({animate:$=!1,children:Z,className:J,defaultValue:H,value:B,min:Q=0,max:X=100,...z}){let[G,U]=EF.useState(!1),Y=Array.isArray(B)?B:Array.isArray(H)?H:[Q];return EF.useEffect(()=>{let K=requestAnimationFrame(()=>U(!0));return()=>cancelAnimationFrame(K)},[]),g$.jsx(F7.Root,{className:o0("data-horizontal:w-full data-vertical:h-full",J),"data-slot":"slider",defaultValue:H,value:B,min:Q,max:X,thumbAlignment:"edge",...z,children:g$.jsxs(F7.Control,{className:"relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col",children:[g$.jsx(F7.Track,{"data-slot":"slider-track",className:"relative grow overflow-hidden rounded-full bg-accent select-none data-horizontal:h-1 data-horizontal:w-full data-vertical:h-full data-vertical:w-1",children:g$.jsx(F7.Indicator,{"data-slot":"slider-range",className:o0("bg-primary select-none data-horizontal:h-full data-vertical:w-full",$&&G&&"transition-[width,height,inset-inline-start,bottom] duration-100 ease-in-out")})}),Z,Array.from({length:Y.length},(K,F)=>g$.jsx(F7.Thumb,{"data-slot":"slider-thumb",className:o0("relative block size-3 shrink-0 rounded-xs bg-white shadow-xs ring-ring/50 select-none after:absolute after:-inset-2 hover:ring-3 focus-visible:ring-3 focus-visible:outline-hidden active:ring-3 disabled:pointer-events-none disabled:opacity-50 data-horizontal:cursor-ew-resize data-vertical:cursor-ns-resize",$&&G&&"transition-[inset-inline-start,bottom,color,box-shadow] duration-100 ease-in-out")},F))]})})}var j1=P(c(),1);function C70($){return $.charAt(0).toUpperCase()+$.slice(1)}function E70($){return $==="xhigh"?"Extra":C70($)}function Mf($){return typeof $==="number"?$:$[0]??0}var Pf={from:{opacity:0,filter:"blur(4px)"},to:{opacity:1,filter:"blur(0px)"}},_f={type:"spring",duration:0.3,delay:0.1,bounce:0};function Of({label:$,leadingIcon:Z,className:J,...H}){return j1.jsxs(P0,{...H,variant:"ghost",className:X0("group/picker max-w-56 min-w-0 px-2 text-muted-foreground hover:text-muted-foreground",J),children:[Z,j1.jsx("span",{className:"truncate font-normal",children:$})]})}function b70({current:$,model:Z,models:J,onValueChange:H}){let B=Z.displayName,Q=ev(J,"Models");return j1.jsxs(Z3,{children:[j1.jsx(J3,{render:j1.jsx(Of,{label:B,className:"shrink","aria-label":`Model: ${B}`})}),j1.jsx(H3,{align:"end",side:"top",className:"w-max max-w-64 min-w-40",children:j1.jsx(tg,{value:$,onValueChange:H,children:Q.map((X)=>j1.jsxs(K7,{children:[j1.jsx(AF,{children:X.label}),X.models.map((z)=>j1.jsx(eg,{value:z.value,closeOnClick:!0,children:z.displayName},z.value))]},X.label))})})]})}function Tf({fastMode:$,onChange:Z}){return j1.jsxs(a1,{children:[j1.jsx(o1,{render:j1.jsx(P0,{type:"button",variant:"ghost",size:"icon-sm","aria-label":$?"Turn off fast mode":"Turn on fast mode","aria-pressed":$,onClick:()=>Z(!$),className:"-my-1 -mr-1",children:$?j1.jsx(jf,{className:"text-primary",stroke:1.75}):j1.jsx(dB,{className:"text-muted-foreground",stroke:1.75})})}),j1.jsxs(n1,{align:"center",className:"flex-col gap-0",children:[j1.jsx("span",{children:"Fast mode"}),j1.jsx("span",{className:"font-normal text-muted-foreground",children:"More usage"})]})]})}function w70({currentEffort:$,effortLevels:Z,fastMode:J,showFastMode:H,onFastModeChange:B,onValueChange:Q}){let X=ov(Z,$),[z,G]=$H.useState(!1),[U,Y]=$H.useState(X),[K,F]=$H.useState(!1),q=Z[z?U:X]??$,N=E70(q),D=(V)=>{if(V)Y(X);else F(!1);G(V)},A=(V)=>{let L=Z[V];if(L&&L!==$)Q(L)};return j1.jsxs(P6,{open:z,onOpenChange:D,children:[j1.jsx(_6,{render:j1.jsx(Of,{label:N,leadingIcon:J?j1.jsx(dB,{stroke:1.5}):void 0,"aria-label":`Effort: ${N}`})}),j1.jsxs(j6,{align:"end",side:"top",className:"w-64",children:[j1.jsx(Cw,{className:"relative h-5 flex-row items-center",children:j1.jsx(E4,{mode:"popLayout",initial:!1,children:K?j1.jsxs(K5.div,{className:"flex h-5 w-full items-center justify-between text-sm text-muted-foreground","aria-hidden":"true",variants:Pf,initial:"from",animate:"to",exit:"from",transition:_f,children:[j1.jsx("span",{children:"Faster"}),j1.jsx("span",{children:"Smarter"})]},"range"):j1.jsxs(K5.div,{className:"flex h-5 w-full items-center justify-between gap-2",variants:Pf,initial:"from",animate:"to",exit:"from",transition:_f,children:[j1.jsxs("div",{className:"flex items-center gap-1",children:[j1.jsx("span",{className:"text-muted-foreground",children:"Effort"}),j1.jsx("output",{"aria-live":"polite",children:N})]}),H&&j1.jsx(Tf,{fastMode:J,onChange:B})]},"effort")})}),j1.jsxs("label",{className:"block",children:[j1.jsx("span",{className:"sr-only",children:"Reasoning effort"}),j1.jsx(Lf,{value:[U],min:0,max:Z.length-1,step:1,onPointerDown:(V)=>{if(V.button===0)F(!0)},onPointerCancel:()=>F(!1),onValueChange:(V)=>Y(Mf(V)),onValueCommitted:(V)=>{F(!1),A(Mf(V))},className:X0("**:data-[slot=slider-track]:h-6 **:data-[slot=slider-track]:rounded-sm","**:data-[slot=slider-thumb]:h-6 **:data-[slot=slider-thumb]:w-5 **:data-[slot=slider-thumb]:rounded-sm **:data-[slot=slider-thumb]:ring-0"),animate:!0,children:j1.jsx("span",{"data-slot":"slider-marks","aria-hidden":"true",className:"absolute inset-x-2 flex items-center justify-between",children:Array.from({length:Z.length},(V,L)=>j1.jsx("span",{className:X0("size-1 rounded-full",L<=U?"bg-primary-foreground/30":"bg-foreground/30")},L))})})]})]})]})}var Cf=$H.memo(function({sessionId:Z}){let{workspaceId:J,layout:H,setLayout:B}=m1(),{data:Q}=t9(J),X=Q?.models??[],z=X.find((_)=>_.value==="default"),G=Q?tv(X.filter((_)=>_.value!=="default"),Q.provider):[],U=DU(J,Z).data?.config,Y=SS(J),K=(Z?U?.model:void 0)??H.selectedModel,F=(Z?U?.effort:void 0)??H.selectedEffort,W=(Z?U?.fastMode:void 0)??H.selectedFastMode,q=(_)=>{if(Z)Y.mutate({sessionId:Z,patch:{model:_}});else B({selectedModel:_})},N=(_)=>{if(Z)Y.mutate({sessionId:Z,patch:{effort:_}});else B({selectedEffort:_})},D=(_)=>{if(Z)Y.mutate({sessionId:Z,patch:{fastMode:_}});else B({selectedFastMode:_})},A=cK(G,K,z?.resolvedModel);if(!A)return null;let V=A.supportsEffort?A.supportedEffortLevels??[]:[],L=bL(V,F,A.defaultEffort),j=nv(V)&&L!==void 0,M=sv(A,W);return j1.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[j1.jsx(b70,{current:A.value,model:A,models:G,onValueChange:q}),!j&&A.supportsFastMode&&j1.jsx(Tf,{fastMode:M,onChange:D}),j&&j1.jsx(w70,{currentEffort:L,effortLevels:V,fastMode:M,showFastMode:A.supportsFastMode===!0,onFastModeChange:D,onValueChange:N},A.value)]})});var _5=P(c(),1);function wf({composerRef:$,onSend:Z,onStop:J,processing:H,sessionId:B,modelSessionId:Q,availability:X,chatReady:z,annotation:G,onRemoveDrawing:U,allowFiles:Y=!0,placeholder:K}){let F=f$.useRef(null),W=f1(),q=k3(),N=b2(W,B??q2(q)),D=S1((O)=>O.composerDrafts[N]??"");f$.useEffect(()=>{if(q==="overview")S1.getState().moveComposerDraft(W,N)},[q,W,N]);let A=W5(D),V=B4((O)=>O.attachments[z8(W,B)]??S70),[L,j]=f$.useState(!1),M=V.some((O)=>O.kind!=="text"&&O.status==="uploading"),_=V.some((O)=>O.kind==="text"||O.status==="ready"||O.status==="draft"),w=D.trim().length>0||_,T=z&&IQ(w,M,X),b=(O)=>{A.current=O,S1.getState().setComposerDraft(N,O)},C=(O)=>{if(Y)$v({workspaceId:W,sessionId:B},O)},k=f$.useRef(!1),S=(O)=>{if(O.kind==="drawing"&&U){U(O.localId);return}k1.getState().removeAttachment(W,O.localId)},R=async()=>{if(!T||k.current)return;k.current=!0;try{await G?.finish(),await Z(A.current),A.current="",S1.getState().setComposerDraft(N,null)}catch(O){r1.add({title:O instanceof Error?O.message:"Couldn’t send message",type:"error"})}finally{k.current=!1}};return _5.jsxs(Qv,{composerRef:$,onSubmit:(O)=>{O.preventDefault(),R()},onDragOver:(O)=>{if(!O.dataTransfer.types.includes("Files"))return;if(O.preventDefault(),Y)j(!0)},onDragLeave:(O)=>{if(!Y)return;if(O.currentTarget.contains(O.relatedTarget))return;j(!1)},onDrop:(O)=>{if(!O.dataTransfer.types.includes("Files"))return;O.preventDefault(),j(!1),C(Array.from(O.dataTransfer.files))},className:X0(L&&"ring-2 ring-ring/60"),children:[V.length>0&&_5.jsx("div",{className:"flex flex-wrap gap-2 px-1 pt-1 pb-1",children:V.toSorted((O,y)=>Ef[O.kind]-Ef[y.kind]).map((O)=>O.kind==="text"?_5.jsx(yQ,{label:O.label,onRemove:()=>S(O)},O.localId):O.kind==="drawing"?_5.jsx(lv,{attachment:O,onRemove:()=>S(O)},O.localId):_5.jsx(iv,{attachment:O,onRemove:()=>S(O)},O.localId))}),_5.jsx(Xv,{textareaRef:$,id:"chat-input",name:"message",value:D,onChange:(O)=>b(O.target.value),onKeyDown:(O)=>{if(O.key==="Enter"&&!O.shiftKey)O.preventDefault(),R()},onPaste:(O)=>{let y=Array.from(O.clipboardData?.files??[]);if(y.length===0)return;O.preventDefault(),C(y)},placeholder:H?"Queue a follow-up":K??"Do anything",rows:1}),_5.jsxs(zv,{children:[Y&&_5.jsx("input",{ref:F,type:"file",multiple:!0,hidden:!0,onChange:(O)=>{C(Array.from(O.target.files??[])),O.target.value=""}}),_5.jsxs("div",{className:"mr-auto flex shrink-0 items-center gap-0.5",children:[Y&&_5.jsxs(a1,{children:[_5.jsx(o1,{render:_5.jsx(P0,{type:"button",variant:"ghost",size:"icon",onClick:()=>F.current?.click(),"aria-label":"Attach files",children:_5.jsx(BY,{stroke:1.6,className:"size-4.5!"})})}),_5.jsx(n1,{children:"Attach files"})]}),G&&_5.jsxs(a1,{children:[_5.jsx(o1,{render:_5.jsx(P0,{type:"button",variant:"ghost",size:"icon",onClick:G.onToggle,className:X0(G.active&&"bg-accent"),"aria-label":"Draw annotation","aria-pressed":G.active,children:_5.jsx(lJ,{stroke:1.5})})}),_5.jsx(n1,{children:"Draw annotation"})]})]}),_5.jsx(Cf,{sessionId:Q}),H?_5.jsxs(a1,{children:[_5.jsx(o1,{render:_5.jsx(P0,{type:"button",size:"icon",onClick:J,"aria-label":"Stop agent",children:_5.jsx(bf,{})})}),_5.jsx(n1,{children:"Stop answering"})]}):_5.jsx(Gv,{label:"Send message",hasContent:w,busy:M||!z,availability:X})]})]})}var S70=[],Ef={file:0,drawing:1,text:2};var m$=P(c(),1);function rL({className:$,prompt:Z,disabled:J=!1,onSelect:H}){let B=Z.icon;return m$.jsxs(P0,{type:"button",size:"sm",disabled:J,onClick:()=>H(Z),className:X0("h-auto items-start justify-start gap-2 rounded-lg p-2 px-3 text-left leading-snug whitespace-normal",$),children:[m$.jsx(B,{stroke:2,"aria-hidden":!0,className:"mt-0.5"}),m$.jsx("span",{children:Z.label})]})}function Sf({prompts:$,disabled:Z=!1,onSelect:J}){return m$.jsx("div",{className:"row-gap-2 grid w-full grid-cols-1 gap-x-3 gap-y-2 @md:grid-cols-3",children:$.map((H,B)=>{return m$.jsx(rL,{prompt:H,disabled:Z,onSelect:J,className:X0("h-full w-fit @md:w-full",B===0&&"@md:translate-y-3 @md:rotate-3 @md:hover:translate-y-2.5",B===1&&"@md:-rotate-1",B===2&&"@md:translate-y-3 @md:-rotate-4 @md:hover:translate-y-2.5")},H.prompt)})})}var H5=P(c(),1),aL="Keep the final reply brief and user-facing. Do not include file or storage links, file paths, or bundle, test, and runtime-log summaries.",R70=[{label:"Check the weather",prompt:"Build me a set of weather widgets that surface current conditions, today's hourly forecast, and a simple weekly outlook at a glance",context:["Build this onboarding example immediately without asking follow-up questions.","Create three separate widgets: current conditions, today's hourly forecast, and a seven-day outlook.","Use one shared Open-Meteo server function with no API key and use Berlin as the default location.","Give each widget an appropriate grid size and a compact, visually distinct layout with loading, error, and last-updated states.","Bundle all three widgets, smoke-test the shared weather function, and check runtime logs before finishing.",aL],icon:Rf},{label:"Track my finances",prompt:"Build me a personal finance view for tracking income, expenses, monthly budgets, spending trends, and savings, with an agent action that can add sample transactions",context:["Build this onboarding example immediately without asking follow-up questions, and don't use external services or bank connections.","Create a responsive View with a month selector, income, spending, and savings summaries, an income-versus-spending trend, category breakdowns, budget progress, and recent transactions.","Support adding, editing, and deleting income and expense transactions, categories, and monthly category budgets.","Persist transactions, categories, and budgets in a workspace-local SQLite database accessed through server functions. Store monetary amounts as integer cents and seed realistic sample data only when the database is empty.","Add an “Add with agent” action that imports `sendChatMessage` from `moi` and sends a concise request for the agent to generate and insert a realistic batch of sample transactions into the same database.","Provide a small documented workspace script the agent can use to validate and append transactions safely, then refresh the View data after the agent updates the database.","Include loading, empty, and error states, then bundle the View and smoke-test its SQLite persistence and transaction mutations before finishing.",aL],icon:kf},{label:"Build a playful synthesizer",prompt:"Build me a view with a simple, playful synthesizer featuring a keyboard, five sound controls, and the ability to record, save, and load music files from the workspace",context:["Build this onboarding example immediately without asking follow-up questions, and don't use external services.","Create a responsive View that uses the browser's audio capabilities, with an onscreen piano and computer-keyboard controls.","Include five clearly labeled sound controls for waveform, attack, release, filter cutoff, and volume.","Let the user record timed note events, play and stop recordings, give them names, and save and load them as JSON music files in a workspace music folder.","Include clear empty and error states, then bundle the View and check runtime logs before finishing.",aL],icon:QY}],k70={label:"Explore the workspace",prompt:"Explore this workspace and suggest what moi can build based on its content",context:["Explore the existing workspace files before making suggestions.","Briefly explain what the workspace appears to be for and which content informed your ideas.","Propose a focused set of useful widgets or views that fit the work already here.","Wait for me to choose before building anything."],icon:wF};function If({tabId:$,isViewDraft:Z,hasSentMessageFromMoi:J,isWorkspacePendingAnalysis:H}){if(Z)return"view-draft";if(!J)return"welcome";if(H)return"explore-workspace";return $==="overview"?"overview-empty":"tab-empty"}function yf({agent:$,kind:Z,hasWorkspaceApplets:J,disabled:H=!1,onSelectPrompt:B,onNavigate:Q}){switch(Z){case"view-draft":return H5.jsx(I70,{agent:$});case"welcome":return H5.jsx(y70,{agent:$,disabled:H,showExamples:!J,onSelectPrompt:B,onNavigate:Q});case"explore-workspace":return H5.jsx(x70,{agent:$,disabled:H,onSelectPrompt:B});case"overview-empty":return H5.jsx(h70,{agent:$});case"tab-empty":return H5.jsx(v70,{agent:$})}}function uQ({agent:$,children:Z,className:J}){return H5.jsxs("div",{className:X0("flex flex-1 flex-col items-center justify-center self-center",J),children:[H5.jsx(s9,{preset:$,color:"secondary",expression:"idle",className:"mb-2",animated:!0}),Z]})}function I70({agent:$}){return H5.jsx(uQ,{agent:$,className:"text-center text-muted-foreground",children:H5.jsx("p",{className:"mx-auto max-w-xs px-8 text-sm",children:"Describe the content, data, and key actions you need in the view"})})}function y70({agent:$,disabled:Z=!1,showExamples:J=!0,onSelectPrompt:H,onNavigate:B}){return H5.jsx(uQ,{agent:$,className:"@container w-full max-w-md min-w-0",children:H5.jsxs("div",{className:"mt-2 flex flex-col gap-4",children:[H5.jsxs("div",{className:"prose prose-sm min-w-0 wrap-anywhere prose-inherit",children:[H5.jsx("p",{children:"moi is the personal workspace built for you by your agent. It grows and adapts to your needs."}),H5.jsxs("p",{children:["Ask the agent to build widgets on the"," ",H5.jsx(oL,{Icon:SF,destination:"overview",onNavigate:B,children:"Overview"})," ","page, or more complex tools as separate"," ",H5.jsx(oL,{Icon:bF,destination:"views",onNavigate:B,children:"Views"}),". Use"," ",H5.jsx(oL,{Icon:mQ,destination:"scratchpad",onNavigate:B,children:"Scratchpad"})," ","for exploring and shaping ideas with your agent."]}),J&&H5.jsx("p",{children:"Try an example:"})]}),J&&H5.jsx(Sf,{prompts:R70,disabled:Z,onSelect:H})]})})}function x70({agent:$,disabled:Z=!1,onSelectPrompt:J}){return H5.jsx(uQ,{agent:$,children:H5.jsxs("div",{className:"flex flex-col items-center gap-4",children:[H5.jsx("div",{className:"prose prose-sm max-w-xs min-w-0 text-center wrap-anywhere prose-inherit",children:H5.jsx("p",{children:"Your agent can explore this workspace and suggest useful widgets and views based on what’s already here"})}),H5.jsx(rL,{prompt:k70,disabled:Z,onSelect:J})]})})}function h70({agent:$}){return H5.jsx(uQ,{agent:$,className:"text-center text-muted-foreground",children:H5.jsx("p",{className:"mx-auto max-w-sm px-8 text-sm",children:"Chat with your agent, create widgets and views, and manage your workspace context from here"})})}function v70({agent:$}){return H5.jsx(uQ,{agent:$,className:"text-center text-muted-foreground",children:H5.jsx("p",{className:"mx-auto max-w-sm px-8 text-sm",children:"Chat with your agent and manage the view from here"})})}function oL({Icon:$,children:Z,destination:J,onNavigate:H}){return H5.jsxs("button",{type:"button","data-welcome-destination":J,onClick:()=>H(J),className:"inline-flex cursor-pointer items-center gap-0.5 align-bottom font-medium text-foreground",children:[H5.jsx($,{size:16,stroke:1.75,"aria-hidden":!0}),Z]})}var pQ=P(m(),1);var q1=P(c(),1);function g70($){if($.flavor==="cron"||$.flavor==="subagent")return $.flavor;let Z=$.origin?.provider.trim().toLowerCase();return Z?Z:null}function f70({active:$,canArchive:Z,confirmingArchive:J,onArchive:H,onRequestArchive:B,onSelect:Q,session:X,workspaceId:z}){let G=pQ.useRef(!1),[U,Y]=pQ.useState(!1),K=B4((N)=>dZ(N.activity,z,X.sessionId)),F=g70(X);function W(){B(X.sessionId)}async function q(){if(G.current)return;G.current=!0,Y(!0);try{await H(X.sessionId)}catch{r1.add({title:"Couldn’t archive chat",type:"error"})}finally{G.current=!1,Y(!1)}}return q1.jsxs("div",{className:"group/chat relative",children:[q1.jsx(B3,{className:X0("font-medium group-hover/chat:bg-accent group-hover/chat:text-accent-foreground",$&&"bg-accent text-accent-foreground"),onClick:()=>Q(X.sessionId),children:q1.jsx("div",{className:X0("flex min-w-0 flex-1 overflow-hidden",(K||U)&&"mr-4 mask-r-from-[calc(100%-16px)]",Z&&!J&&"group-focus-within/chat:mr-4 group-focus-within/chat:mask-r-from-[calc(100%-16px)] group-hover/chat:mr-4 group-hover/chat:mask-r-from-[calc(100%-16px)] [@media(hover:none)]:mr-4 [@media(hover:none)]:mask-r-from-[calc(100%-16px)]",J&&"mr-14 mask-r-from-[calc(100%-16px)]"),children:q1.jsxs("span",{className:X0("flex min-w-0 items-baseline gap-1.5",(K||U)&&"-mr-4",J?"-mr-14":Z&&"group-focus-within/chat:-mr-4 group-hover/chat:-mr-4 [@media(hover:none)]:-mr-4"),children:[q1.jsx("span",{className:"min-w-0 truncate",children:X.summary}),F&&q1.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:F})]})})}),K&&q1.jsx(U8,{className:X0("pointer-events-none absolute top-1/2 right-1.5 -translate-y-1/2 text-muted-foreground",Z&&"group-focus-within/chat:hidden group-hover/chat:hidden [@media(hover:none)]:hidden",(J||U)&&"hidden")}),Z&&q1.jsx("div",{className:X0("absolute top-1/2 right-0 flex -translate-y-1/2 items-center opacity-100 transition-none",!J&&"group-focus-within/chat:opacity-100 group-hover/chat:opacity-100 [@media(hover:hover)]:opacity-0",U&&"opacity-100!"),children:J?q1.jsx(P0,{type:"button",variant:"secondary",size:"sm","aria-label":`Confirm archive ${X.summary}`,tabIndex:-1,className:"mr-1 h-5 rounded-sm px-1.5 text-xs hover:bg-accent",disabled:U,onClick:q,onPointerDown:(N)=>N.stopPropagation(),children:"Confirm"}):q1.jsxs(a1,{children:[q1.jsx(o1,{render:q1.jsx(P0,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Archive ${X.summary}`,tabIndex:-1,className:"text-muted-foreground hover:bg-transparent hover:text-foreground",disabled:U,onClick:W,onPointerDown:(N)=>N.stopPropagation(),children:q1.jsx(hf,{stroke:1.75})})}),q1.jsx(n1,{side:"right",children:"Archive chat"})]})})]})}function m70($){return`${$.getFullYear()}-${$.getMonth()}-${$.getDate()}`}function xf($){return Date.UTC($.getFullYear(),$.getMonth(),$.getDate())/86400000}function u70($,Z){let J=xf(Z)-xf($);if(J===0)return"Today";if(J===1)return"Yesterday";if(J>=2&&J<=5)return`${J} days ago`;return $.toLocaleDateString([],{month:"short",day:"numeric",...$.getFullYear()===Z.getFullYear()?{}:{year:"numeric"}})}function p70($,Z=new Date){let J=new Map;for(let H of $.slice().sort((B,Q)=>Q.lastModified-B.lastModified)){let B=new Date(H.lastModified),Q=m70(B),X=J.get(Q);if(X){X.sessions.push(H);continue}J.set(Q,{key:Q,label:u70(B,Z),sessions:[H]})}return[...J.values()]}function c70($,Z,J=new Date){return p70($.filter((H)=>Z==="overview"?!H.tabId?.startsWith("views/"):H.tabId===Z),J)}function mf({className:$}){let Z=f1(),{pinnedSessionId:J,loaded:H,pin:B}=k6(),[Q]=I3(),{data:X=[]}=FJ(Z);if(!H)return null;if(J){let z=X.find((G)=>G.sessionId===J)?.summary;if(!z)return null;return q1.jsxs("div",{className:X0("-my-0.5 -ml-0.5 box-content h-7 max-w-64 rounded-lg py-0.5 pr-0.5 pl-3","flex min-w-0 items-center gap-1 bg-accent text-sm font-medium"),children:[q1.jsx("span",{className:"min-w-0 flex-1 truncate",children:z}),q1.jsxs(a1,{children:[q1.jsx(o1,{render:q1.jsx(P0,{variant:"ghost",size:"icon-sm",className:$,onClick:()=>B(null),"aria-label":"Unpin chat","aria-pressed":!0,children:q1.jsx(ff,{stroke:1.75})})}),q1.jsx(n1,{children:"Unpin chat"})]},"unpin")]})}return q1.jsxs("div",{className:"flex w-full min-w-0 items-center justify-between gap-1",children:[q1.jsx(d70,{className:$,sessions:X}),Q&&q1.jsxs(a1,{children:[q1.jsx(o1,{render:q1.jsx(P0,{variant:"ghost",size:"icon-sm",className:$,onClick:()=>B(Q),"aria-label":"Pin chat to workspace","aria-pressed":!1,children:q1.jsx(gf,{stroke:1.75})})}),q1.jsx(n1,{children:"Pin chat to workspace"})]},"pin")]})}function d70({className:$,sessions:Z}){let J=f1(),H=k3(),[B,Q]=I3(),[X,z]=pQ.useState(null),G=t9(J).data?.supportsArchiving===!0,U=bS(J),Y=c70(Z,H);if(Y.length===0&&!B)return null;function K(W){if(!W)z(null)}async function F(W){z(null),await U.mutateAsync(W);let q=k1.getState();if(q.clearAttachments(J,W),q.clearPreviewsForSession(J,W),B===W)Q(null)}return B?q1.jsxs(a1,{children:[q1.jsx(o1,{render:q1.jsx(P0,{variant:"ghost",size:"icon-sm","aria-label":"New chat",onClick:()=>Q(null),className:$,children:q1.jsx(RF,{stroke:1.75})})}),q1.jsx(n1,{children:"New chat"})]}):q1.jsxs(Z3,{onOpenChange:K,children:[q1.jsxs(a1,{children:[q1.jsx(J3,{render:q1.jsx(o1,{render:q1.jsx(P0,{variant:"ghost",size:"icon-sm","aria-label":"History",className:$,children:q1.jsx(vf,{stroke:1.75})})})}),q1.jsx(n1,{children:"History"})]}),q1.jsx(H3,{align:"start",className:"flex max-h-100 w-max max-w-72 min-w-40 flex-col overflow-hidden",children:q1.jsx("div",{className:"no-scrollbar flex min-h-0 flex-1 scroll-fade flex-col gap-1 overflow-y-auto overscroll-contain [--scroll-fade-reveal:8px]",children:Y.map((W)=>q1.jsxs(K7,{children:[q1.jsx(AF,{children:W.label}),W.sessions.map((q)=>q1.jsx(f70,{session:q,active:B===q.sessionId,canArchive:G,confirmingArchive:X===q.sessionId,onSelect:Q,onArchive:F,onRequestArchive:z,workspaceId:J},q.sessionId))]},W.key))})})]})}var zi=P(m(),1);function B5(){}function kF(){}function uf($,Z){let J=Z||{};return($[$.length-1]===""?[...$,""]:$).join((J.padRight?" ":"")+","+(J.padLeft===!1?"":" ")).trim()}var l70=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,i70=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,r70={};function IF($,Z){return((Z||r70).jsx?i70:l70).test($)}var a70=/[ \t\n\f\r]/g;function nL($){return typeof $==="object"?$.type==="text"?pf($.value):!1:pf($)}function pf($){return $.replace(a70,"")===""}class W7{constructor($,Z,J){if(this.normal=Z,this.property=$,J)this.space=J}}W7.prototype.normal={};W7.prototype.property={};W7.prototype.space=void 0;function sL($,Z){let J={},H={};for(let B of $)Object.assign(J,B.property),Object.assign(H,B.normal);return new W7(J,H,Z)}function cQ($){return $.toLowerCase()}class l2{constructor($,Z){this.attribute=Z,this.property=$}}l2.prototype.attribute="";l2.prototype.booleanish=!1;l2.prototype.boolean=!1;l2.prototype.commaOrSpaceSeparated=!1;l2.prototype.commaSeparated=!1;l2.prototype.defined=!1;l2.prototype.mustUseProperty=!1;l2.prototype.number=!1;l2.prototype.overloadedBoolean=!1;l2.prototype.property="";l2.prototype.spaceSeparated=!1;l2.prototype.space=void 0;var dQ={};b5(dQ,{spaceSeparated:()=>q5,overloadedBoolean:()=>yF,number:()=>b0,commaSeparated:()=>q7,commaOrSpaceSeparated:()=>a4,booleanish:()=>a5,boolean:()=>O1});var o70=0,O1=u$(),a5=u$(),yF=u$(),b0=u$(),q5=u$(),q7=u$(),a4=u$();function u$(){return 2**++o70}var tL=Object.keys(dQ);class ZH extends l2{constructor($,Z,J,H){let B=-1;super($,Z);if(cf(this,"space",H),typeof J==="number")while(++B<tL.length){let Q=tL[B];cf(this,tL[B],(J&dQ[Q])===dQ[Q])}}}ZH.prototype.defined=!0;function cf($,Z,J){if(J)$[Z]=J}function u8($){let Z={},J={};for(let[H,B]of Object.entries($.properties)){let Q=new ZH(H,$.transform($.attributes||{},H),B,$.space);if($.mustUseProperty&&$.mustUseProperty.includes(H))Q.mustUseProperty=!0;Z[H]=Q,J[cQ(H)]=H,J[cQ(Q.attribute)]=H}return new W7(Z,J,$.space)}var eL=u8({properties:{ariaActiveDescendant:null,ariaAtomic:a5,ariaAutoComplete:null,ariaBusy:a5,ariaChecked:a5,ariaColCount:b0,ariaColIndex:b0,ariaColSpan:b0,ariaControls:q5,ariaCurrent:null,ariaDescribedBy:q5,ariaDetails:null,ariaDisabled:a5,ariaDropEffect:q5,ariaErrorMessage:null,ariaExpanded:a5,ariaFlowTo:q5,ariaGrabbed:a5,ariaHasPopup:null,ariaHidden:a5,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:q5,ariaLevel:b0,ariaLive:null,ariaModal:a5,ariaMultiLine:a5,ariaMultiSelectable:a5,ariaOrientation:null,ariaOwns:q5,ariaPlaceholder:null,ariaPosInSet:b0,ariaPressed:a5,ariaReadOnly:a5,ariaRelevant:null,ariaRequired:a5,ariaRoleDescription:q5,ariaRowCount:b0,ariaRowIndex:b0,ariaRowSpan:b0,ariaSelected:a5,ariaSetSize:b0,ariaSort:null,ariaValueMax:b0,ariaValueMin:b0,ariaValueNow:b0,ariaValueText:null,role:null},transform($,Z){return Z==="role"?Z:"aria-"+Z.slice(4).toLowerCase()}});function xF($,Z){return Z in $?$[Z]:Z}function hF($,Z){return xF($,Z.toLowerCase())}var df=u8({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:q7,acceptCharset:q5,accessKey:q5,action:null,allow:null,allowFullScreen:O1,allowPaymentRequest:O1,allowUserMedia:O1,alt:null,as:null,async:O1,autoCapitalize:null,autoComplete:q5,autoFocus:O1,autoPlay:O1,blocking:q5,capture:null,charSet:null,checked:O1,cite:null,className:q5,cols:b0,colSpan:null,content:null,contentEditable:a5,controls:O1,controlsList:q5,coords:b0|q7,crossOrigin:null,data:null,dateTime:null,decoding:null,default:O1,defer:O1,dir:null,dirName:null,disabled:O1,download:yF,draggable:a5,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:O1,formTarget:null,headers:q5,height:b0,hidden:yF,high:b0,href:null,hrefLang:null,htmlFor:q5,httpEquiv:q5,id:null,imageSizes:null,imageSrcSet:null,inert:O1,inputMode:null,integrity:null,is:null,isMap:O1,itemId:null,itemProp:q5,itemRef:q5,itemScope:O1,itemType:q5,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:O1,low:b0,manifest:null,max:null,maxLength:b0,media:null,method:null,min:null,minLength:b0,multiple:O1,muted:O1,name:null,nonce:null,noModule:O1,noValidate:O1,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:O1,optimum:b0,pattern:null,ping:q5,placeholder:null,playsInline:O1,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:O1,referrerPolicy:null,rel:q5,required:O1,reversed:O1,rows:b0,rowSpan:b0,sandbox:q5,scope:null,scoped:O1,seamless:O1,selected:O1,shadowRootClonable:O1,shadowRootDelegatesFocus:O1,shadowRootMode:null,shape:null,size:b0,sizes:null,slot:null,span:b0,spellCheck:a5,src:null,srcDoc:null,srcLang:null,srcSet:null,start:b0,step:null,style:null,tabIndex:b0,target:null,title:null,translate:null,type:null,typeMustMatch:O1,useMap:null,value:a5,width:b0,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:q5,axis:null,background:null,bgColor:null,border:b0,borderColor:null,bottomMargin:b0,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:O1,declare:O1,event:null,face:null,frame:null,frameBorder:null,hSpace:b0,leftMargin:b0,link:null,longDesc:null,lowSrc:null,marginHeight:b0,marginWidth:b0,noResize:O1,noHref:O1,noShade:O1,noWrap:O1,object:null,profile:null,prompt:null,rev:null,rightMargin:b0,rules:null,scheme:null,scrolling:a5,standby:null,summary:null,text:null,topMargin:b0,valueType:null,version:null,vAlign:null,vLink:null,vSpace:b0,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:O1,disableRemotePlayback:O1,prefix:null,property:null,results:b0,security:null,unselectable:null},space:"html",transform:hF});var lf=u8({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:a4,accentHeight:b0,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:b0,amplitude:b0,arabicForm:null,ascent:b0,attributeName:null,attributeType:null,azimuth:b0,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:b0,by:null,calcMode:null,capHeight:b0,className:q5,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:b0,diffuseConstant:b0,direction:null,display:null,dur:null,divisor:b0,dominantBaseline:null,download:O1,dx:null,dy:null,edgeMode:null,editable:null,elevation:b0,enableBackground:null,end:null,event:null,exponent:b0,externalResourcesRequired:null,fill:null,fillOpacity:b0,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:q7,g2:q7,glyphName:q7,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:b0,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:b0,horizOriginX:b0,horizOriginY:b0,id:null,ideographic:b0,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:b0,k:b0,k1:b0,k2:b0,k3:b0,k4:b0,kernelMatrix:a4,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:b0,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:b0,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:b0,overlineThickness:b0,paintOrder:null,panose1:null,path:null,pathLength:b0,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:q5,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:b0,pointsAtY:b0,pointsAtZ:b0,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:a4,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:a4,rev:a4,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:a4,requiredFeatures:a4,requiredFonts:a4,requiredFormats:a4,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:b0,specularExponent:b0,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:b0,strikethroughThickness:b0,string:null,stroke:null,strokeDashArray:a4,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:b0,strokeOpacity:b0,strokeWidth:null,style:null,surfaceScale:b0,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:a4,tabIndex:b0,tableValues:null,target:null,targetX:b0,targetY:b0,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:a4,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:b0,underlineThickness:b0,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:b0,values:null,vAlphabetic:b0,vMathematical:b0,vectorEffect:null,vHanging:b0,vIdeographic:b0,version:null,vertAdvY:b0,vertOriginX:b0,vertOriginY:b0,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:b0,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:xF});var $M=u8({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform($,Z){return"xlink:"+Z.slice(5).toLowerCase()}});var ZM=u8({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:hF});var JM=u8({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform($,Z){return"xml:"+Z.slice(3).toLowerCase()}});var HM={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"};var n70=/[A-Z]/g,rf=/-[a-z]/g,s70=/^data[-\w.:]+$/i;function BM($,Z){let J=cQ(Z),H=Z,B=l2;if(J in $.normal)return $.property[$.normal[J]];if(J.length>4&&J.slice(0,4)==="data"&&s70.test(Z)){if(Z.charAt(4)==="-"){let Q=Z.slice(5).replace(rf,e70);H="data"+Q.charAt(0).toUpperCase()+Q.slice(1)}else{let Q=Z.slice(4);if(!rf.test(Q)){let X=Q.replace(n70,t70);if(X.charAt(0)!=="-")X="-"+X;Z="data"+X}}B=ZH}return new B(H,Z)}function t70($){return"-"+$.toLowerCase()}function e70($){return $.charAt(1).toUpperCase()}var af=sL([eL,df,$M,ZM,JM],"html"),vF=sL([eL,lf,$M,ZM,JM],"svg");function of($){return $.join(" ").trim()}var Fm=P(Gm(),1);var gF=Um("end"),JH=Um("start");function Um($){return Z;function Z(J){let H=J&&J.position&&J.position[$]||{};if(typeof H.line==="number"&&H.line>0&&typeof H.column==="number"&&H.column>0)return{line:H.line,column:H.column,offset:typeof H.offset==="number"&&H.offset>-1?H.offset:void 0}}}function zM($){let Z=JH($),J=gF($);if(Z&&J)return{start:Z,end:J}}function N7($){if(!$||typeof $!=="object")return"";if("position"in $||"type"in $)return Ym($.position);if("start"in $||"end"in $)return Ym($);if("line"in $||"column"in $)return GM($);return""}function GM($){return Km($&&$.line)+":"+Km($&&$.column)}function Ym($){return GM($&&$.start)+"-"+GM($&&$.end)}function Km($){return $&&typeof $==="number"?$:1}class K2 extends Error{constructor($,Z,J){super();if(typeof Z==="string")J=Z,Z=void 0;let H="",B={},Q=!1;if(Z)if("line"in Z&&"column"in Z)B={place:Z};else if("start"in Z&&"end"in Z)B={place:Z};else if("type"in Z)B={ancestors:[Z],place:Z.position};else B={...Z};if(typeof $==="string")H=$;else if(!B.cause&&$)Q=!0,H=$.message,B.cause=$;if(!B.ruleId&&!B.source&&typeof J==="string"){let z=J.indexOf(":");if(z===-1)B.ruleId=J;else B.source=J.slice(0,z),B.ruleId=J.slice(z+1)}if(!B.place&&B.ancestors&&B.ancestors){let z=B.ancestors[B.ancestors.length-1];if(z)B.place=z.position}let X=B.place&&"start"in B.place?B.place.start:B.place;this.ancestors=B.ancestors||void 0,this.cause=B.cause||void 0,this.column=X?X.column:void 0,this.fatal=void 0,this.file="",this.message=H,this.line=X?X.line:void 0,this.name=N7(B.place)||"1:1",this.place=B.place||void 0,this.reason=this.message,this.ruleId=B.ruleId||void 0,this.source=B.source||void 0,this.stack=Q&&B.cause&&typeof B.cause.stack==="string"?B.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}K2.prototype.file="";K2.prototype.name="";K2.prototype.reason="";K2.prototype.message="";K2.prototype.stack="";K2.prototype.column=void 0;K2.prototype.line=void 0;K2.prototype.ancestors=void 0;K2.prototype.cause=void 0;K2.prototype.fatal=void 0;K2.prototype.place=void 0;K2.prototype.ruleId=void 0;K2.prototype.source=void 0;var UM={}.hasOwnProperty,T$0=new Map,C$0=/[A-Z]/g,E$0=new Set(["table","tbody","thead","tfoot","tr"]),b$0=new Set(["td","th"]),Wm="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function YM($,Z){if(!Z||Z.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let J=Z.filePath||void 0,H;if(Z.development){if(typeof Z.jsxDEV!=="function")throw TypeError("Expected `jsxDEV` in options when `development: true`");H=h$0(J,Z.jsxDEV)}else{if(typeof Z.jsx!=="function")throw TypeError("Expected `jsx` in production options");if(typeof Z.jsxs!=="function")throw TypeError("Expected `jsxs` in production options");H=x$0(J,Z.jsx,Z.jsxs)}let B={Fragment:Z.Fragment,ancestors:[],components:Z.components||{},create:H,elementAttributeNameCase:Z.elementAttributeNameCase||"react",evaluater:Z.createEvaluater?Z.createEvaluater():void 0,filePath:J,ignoreInvalidStyle:Z.ignoreInvalidStyle||!1,passKeys:Z.passKeys!==!1,passNode:Z.passNode||!1,schema:Z.space==="svg"?vF:af,stylePropertyNameCase:Z.stylePropertyNameCase||"dom",tableCellAlignToStyle:Z.tableCellAlignToStyle!==!1},Q=qm(B,$,void 0);if(Q&&typeof Q!=="string")return Q;return B.create($,B.Fragment,{children:Q||void 0},void 0)}function qm($,Z,J){if(Z.type==="element")return w$0($,Z,J);if(Z.type==="mdxFlowExpression"||Z.type==="mdxTextExpression")return S$0($,Z);if(Z.type==="mdxJsxFlowElement"||Z.type==="mdxJsxTextElement")return k$0($,Z,J);if(Z.type==="mdxjsEsm")return R$0($,Z);if(Z.type==="root")return I$0($,Z,J);if(Z.type==="text")return y$0($,Z)}function w$0($,Z,J){let H=$.schema,B=H;if(Z.tagName.toLowerCase()==="svg"&&H.space==="html")B=vF,$.schema=B;$.ancestors.push(Z);let Q=Am($,Z.tagName,!1),X=v$0($,Z),z=FM($,Z);if(E$0.has(Z.tagName))z=z.filter(function(G){return typeof G==="string"?!nL(G):!0});return Nm($,X,Q,Z),KM(X,z),$.ancestors.pop(),$.schema=H,$.create(Z,Q,X,J)}function S$0($,Z){if(Z.data&&Z.data.estree&&$.evaluater){let H=Z.data.estree.body[0];return B5(H.type==="ExpressionStatement"),$.evaluater.evaluateExpression(H.expression)}iQ($,Z.position)}function R$0($,Z){if(Z.data&&Z.data.estree&&$.evaluater)return $.evaluater.evaluateProgram(Z.data.estree);iQ($,Z.position)}function k$0($,Z,J){let H=$.schema,B=H;if(Z.name==="svg"&&H.space==="html")B=vF,$.schema=B;$.ancestors.push(Z);let Q=Z.name===null?$.Fragment:Am($,Z.name,!0),X=g$0($,Z),z=FM($,Z);return Nm($,X,Q,Z),KM(X,z),$.ancestors.pop(),$.schema=H,$.create(Z,Q,X,J)}function I$0($,Z,J){let H={};return KM(H,FM($,Z)),$.create(Z,$.Fragment,H,J)}function y$0($,Z){return Z.value}function Nm($,Z,J,H){if(typeof J!=="string"&&J!==$.Fragment&&$.passNode)Z.node=H}function KM($,Z){if(Z.length>0){let J=Z.length>1?Z:Z[0];if(J)$.children=J}}function x$0($,Z,J){return H;function H(B,Q,X,z){let U=Array.isArray(X.children)?J:Z;return z?U(Q,X,z):U(Q,X)}}function h$0($,Z){return J;function J(H,B,Q,X){let z=Array.isArray(Q.children),G=JH(H);return Z(B,Q,X,z,{columnNumber:G?G.column-1:void 0,fileName:$,lineNumber:G?G.line:void 0},void 0)}}function v$0($,Z){let J={},H,B;for(B in Z.properties)if(B!=="children"&&UM.call(Z.properties,B)){let Q=f$0($,B,Z.properties[B]);if(Q){let[X,z]=Q;if($.tableCellAlignToStyle&&X==="align"&&typeof z==="string"&&b$0.has(Z.tagName))H=z;else J[X]=z}}if(H){let Q=J.style||(J.style={});Q[$.stylePropertyNameCase==="css"?"text-align":"textAlign"]=H}return J}function g$0($,Z){let J={};for(let H of Z.attributes)if(H.type==="mdxJsxExpressionAttribute")if(H.data&&H.data.estree&&$.evaluater){let Q=H.data.estree.body[0];B5(Q.type==="ExpressionStatement");let X=Q.expression;B5(X.type==="ObjectExpression");let z=X.properties[0];B5(z.type==="SpreadElement"),Object.assign(J,$.evaluater.evaluateExpression(z.argument))}else iQ($,Z.position);else{let B=H.name,Q;if(H.value&&typeof H.value==="object")if(H.value.data&&H.value.data.estree&&$.evaluater){let z=H.value.data.estree.body[0];B5(z.type==="ExpressionStatement"),Q=$.evaluater.evaluateExpression(z.expression)}else iQ($,Z.position);else Q=H.value===null?!0:H.value;J[B]=Q}return J}function FM($,Z){let J=[],H=-1,B=$.passKeys?new Map:T$0;while(++H<Z.children.length){let Q=Z.children[H],X;if($.passKeys){let G=Q.type==="element"?Q.tagName:Q.type==="mdxJsxFlowElement"||Q.type==="mdxJsxTextElement"?Q.name:void 0;if(G){let U=B.get(G)||0;X=G+"-"+U,B.set(G,U+1)}}let z=qm($,Q,X);if(z!==void 0)J.push(z)}return J}function f$0($,Z,J){let H=BM($.schema,Z);if(J===null||J===void 0||typeof J==="number"&&Number.isNaN(J))return;if(Array.isArray(J))J=H.commaSeparated?uf(J):of(J);if(H.property==="style"){let B=typeof J==="object"?J:m$0($,String(J));if($.stylePropertyNameCase==="css")B=u$0(B);return["style",B]}return[$.elementAttributeNameCase==="react"&&H.space?HM[H.property]||H.property:H.attribute,J]}function m$0($,Z){try{return Fm.default(Z,{reactCompat:!0})}catch(J){if($.ignoreInvalidStyle)return{};let H=J,B=new K2("Cannot parse `style` attribute",{ancestors:$.ancestors,cause:H,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw B.file=$.filePath||void 0,B.url=Wm+"#cannot-parse-style-attribute",B}}function Am($,Z,J){let H;if(!J)H={type:"Literal",value:Z};else if(Z.includes(".")){let B=Z.split("."),Q=-1,X;while(++Q<B.length){let z=IF(B[Q])?{type:"Identifier",name:B[Q]}:{type:"Literal",value:B[Q]};X=X?{type:"MemberExpression",object:X,property:z,computed:Boolean(Q&&z.type==="Literal"),optional:!1}:z}B5(X,"always a result"),H=X}else H=IF(Z)&&!/^[a-z]/.test(Z)?{type:"Identifier",name:Z}:{type:"Literal",value:Z};if(H.type==="Literal"){let B=H.value;return UM.call($.components,B)?$.components[B]:B}if($.evaluater)return $.evaluater.evaluateExpression(H);iQ($)}function iQ($,Z){let J=new K2("Cannot handle MDX estrees without `createEvaluater`",{ancestors:$.ancestors,place:Z,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw J.file=$.filePath||void 0,J.url=Wm+"#cannot-handle-mdx-estrees-without-createevaluater",J}function u$0($){let Z={},J;for(J in $)if(UM.call($,J))Z[p$0(J)]=$[J];return Z}function p$0($){let Z=$.replace(C$0,c$0);if(Z.slice(0,3)==="ms-")Z="-"+Z;return Z}function c$0($){return"-"+$.toLowerCase()}var rQ={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"]};var YH=P(c(),1),fu=P(m(),1);var d$0={};function c$($,Z){let J=Z||d$0,H=typeof J.includeImageAlt==="boolean"?J.includeImageAlt:!0,B=typeof J.includeHtml==="boolean"?J.includeHtml:!0;return Vm($,H,B)}function Vm($,Z,J){if(l$0($)){if("value"in $)return $.type==="html"&&!J?"":$.value;if(Z&&"alt"in $&&$.alt)return $.alt;if("children"in $)return Dm($.children,Z,J)}if(Array.isArray($))return Dm($,Z,J);return""}function Dm($,Z,J){let H=[],B=-1;while(++B<$.length)H[B]=Vm($[B],Z,J);return H.join("")}function l$0($){return Boolean($&&typeof $==="object")}var Lm=document.createElement("i");function HH($){let Z="&"+$+";";Lm.innerHTML=Z;let J=Lm.textContent;if(J.charCodeAt(J.length-1)===59&&$!=="semi")return!1;return J===Z?!1:J}function Z2($,Z,J,H){let B=$.length,Q=0,X;if(Z<0)Z=-Z>B?0:B+Z;else Z=Z>B?B:Z;if(J=J>0?J:0,H.length<1e4)X=Array.from(H),X.unshift(Z,J),$.splice(...X);else{if(J)$.splice(Z,J);while(Q<H.length)X=H.slice(Q,Q+1e4),X.unshift(Z,0),$.splice(...X),Q+=1e4,Z+=1e4}}function b4($,Z){if($.length>0)return Z2($,$.length,0,Z),$;return Z}var Mm={}.hasOwnProperty;function fF($){let Z={},J=-1;while(++J<$.length)i$0(Z,$[J]);return Z}function i$0($,Z){let J;for(J in Z){let B=(Mm.call($,J)?$[J]:void 0)||($[J]={}),Q=Z[J],X;if(Q)for(X in Q){if(!Mm.call(B,X))B[X]=[];let z=Q[X];r$0(B[X],Array.isArray(z)?z:z?[z]:[])}}}function r$0($,Z){let J=-1,H=[];while(++J<Z.length)(Z[J].add==="after"?$:H).push(Z[J]);Z2($,0,0,H)}function mF($,Z){let J=Number.parseInt($,Z);if(J<9||J===11||J>13&&J<32||J>126&&J<160||J>55295&&J<57344||J>64975&&J<65008||(J&65535)===65535||(J&65535)===65534||J>1114111)return"�";return String.fromCodePoint(J)}function q4($){return $.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var V2=A7(/[A-Za-z]/),o5=A7(/[\dA-Za-z]/),Pm=A7(/[#-'*+\--9=?A-Z^-~]/);function d$($){return $!==null&&($<32||$===127)}var aQ=A7(/\d/),_m=A7(/[\dA-Fa-f]/),jm=A7(/[!-/:-@[-`{-~]/);function u0($){return $!==null&&$<-2}function y1($){return $!==null&&($<0||$===32)}function B1($){return $===-2||$===-1||$===32}var l$=A7(/\p{P}|\p{S}/u),Q3=A7(/\s/);function A7($){return Z;function Z(J){return J!==null&&J>-1&&$.test(String.fromCharCode(J))}}function p8($){let Z=[],J=-1,H=0,B=0;while(++J<$.length){let Q=$.charCodeAt(J),X="";if(Q===37&&o5($.charCodeAt(J+1))&&o5($.charCodeAt(J+2)))B=2;else if(Q<128){if(!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(Q)))X=String.fromCharCode(Q)}else if(Q>55295&&Q<57344){let z=$.charCodeAt(J+1);if(Q<56320&&z>56319&&z<57344)X=String.fromCharCode(Q,z),B=1;else X="�"}else X=String.fromCharCode(Q);if(X)Z.push($.slice(H,J),encodeURIComponent(X)),H=J+B+1,X="";if(B)J+=B,B=0}return Z.join("")+$.slice(H)}function Z1($,Z,J,H){let B=H?H-1:Number.POSITIVE_INFINITY,Q=0;return X;function X(G){if(B1(G))return $.enter(J),z(G);return Z(G)}function z(G){if(B1(G)&&Q++<B)return $.consume(G),z;return $.exit(J),Z(G)}}var Om={tokenize:a$0};function a$0($){let Z=$.attempt(this.parser.constructs.contentInitial,H,B),J;return Z;function H(z){if(z===null){$.consume(z);return}return $.enter("lineEnding"),$.consume(z),$.exit("lineEnding"),Z1($,Z,"linePrefix")}function B(z){return $.enter("paragraph"),Q(z)}function Q(z){let G=$.enter("chunkText",{contentType:"text",previous:J});if(J)J.next=G;return J=G,X(z)}function X(z){if(z===null){$.exit("chunkText"),$.exit("paragraph"),$.consume(z);return}if(u0(z))return $.consume(z),$.exit("chunkText"),Q;return $.consume(z),X}}var Cm={tokenize:o$0},Tm={tokenize:n$0};function o$0($){let Z=this,J=[],H=0,B,Q,X;return z;function z(L){if(H<J.length){let j=J[H];return Z.containerState=j[1],$.attempt(j[0].continuation,G,U)(L)}return U(L)}function G(L){if(H++,Z.containerState._closeFlow){if(Z.containerState._closeFlow=void 0,B)V();let j=Z.events.length,M=j,_;while(M--)if(Z.events[M][0]==="exit"&&Z.events[M][1].type==="chunkFlow"){_=Z.events[M][1].end;break}A(H);let w=j;while(w<Z.events.length)Z.events[w][1].end={..._},w++;return Z2(Z.events,M+1,0,Z.events.slice(j)),Z.events.length=w,U(L)}return z(L)}function U(L){if(H===J.length){if(!B)return F(L);if(B.currentConstruct&&B.currentConstruct.concrete)return q(L);Z.interrupt=Boolean(B.currentConstruct&&!B._gfmTableDynamicInterruptHack)}return Z.containerState={},$.check(Tm,Y,K)(L)}function Y(L){if(B)V();return A(H),F(L)}function K(L){return Z.parser.lazy[Z.now().line]=H!==J.length,X=Z.now().offset,q(L)}function F(L){return Z.containerState={},$.attempt(Tm,W,q)(L)}function W(L){return H++,J.push([Z.currentConstruct,Z.containerState]),F(L)}function q(L){if(L===null){if(B)V();A(0),$.consume(L);return}return B=B||Z.parser.flow(Z.now()),$.enter("chunkFlow",{_tokenizer:B,contentType:"flow",previous:Q}),N(L)}function N(L){if(L===null){D($.exit("chunkFlow"),!0),A(0),$.consume(L);return}if(u0(L))return $.consume(L),D($.exit("chunkFlow")),H=0,Z.interrupt=void 0,z;return $.consume(L),N}function D(L,j){let M=Z.sliceStream(L);if(j)M.push(null);if(L.previous=Q,Q)Q.next=L;if(Q=L,B.defineSkip(L.start),B.write(M),Z.parser.lazy[L.start.line]){let _=B.events.length;while(_--)if(B.events[_][1].start.offset<X&&(!B.events[_][1].end||B.events[_][1].end.offset>X))return;let w=Z.events.length,T=w,b,C;while(T--)if(Z.events[T][0]==="exit"&&Z.events[T][1].type==="chunkFlow"){if(b){C=Z.events[T][1].end;break}b=!0}A(H),_=w;while(_<Z.events.length)Z.events[_][1].end={...C},_++;Z2(Z.events,T+1,0,Z.events.slice(w)),Z.events.length=_}}function A(L){let j=J.length;while(j-- >L){let M=J[j];Z.containerState=M[1],M[0].exit.call(Z,$)}J.length=L}function V(){B.write([null]),Q=void 0,B=void 0,Z.containerState._closeFlow=void 0}}function n$0($,Z,J){return Z1($,$.attempt(this.parser.constructs.document,Z,J),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function f3($){if($===null||y1($)||Q3($))return 1;if(l$($))return 2}function D7($,Z,J){let H=[],B=-1;while(++B<$.length){let Q=$[B].resolveAll;if(Q&&!H.includes(Q))Z=Q(Z,J),H.push(Q)}return Z}var oQ={name:"attention",resolveAll:s$0,tokenize:t$0};function s$0($,Z){let J=-1,H,B,Q,X,z,G,U,Y;while(++J<$.length)if($[J][0]==="enter"&&$[J][1].type==="attentionSequence"&&$[J][1]._close){H=J;while(H--)if($[H][0]==="exit"&&$[H][1].type==="attentionSequence"&&$[H][1]._open&&Z.sliceSerialize($[H][1]).charCodeAt(0)===Z.sliceSerialize($[J][1]).charCodeAt(0)){if(($[H][1]._close||$[J][1]._open)&&($[J][1].end.offset-$[J][1].start.offset)%3&&!(($[H][1].end.offset-$[H][1].start.offset+$[J][1].end.offset-$[J][1].start.offset)%3))continue;G=$[H][1].end.offset-$[H][1].start.offset>1&&$[J][1].end.offset-$[J][1].start.offset>1?2:1;let K={...$[H][1].end},F={...$[J][1].start};if(Em(K,-G),Em(F,G),X={type:G>1?"strongSequence":"emphasisSequence",start:K,end:{...$[H][1].end}},z={type:G>1?"strongSequence":"emphasisSequence",start:{...$[J][1].start},end:F},Q={type:G>1?"strongText":"emphasisText",start:{...$[H][1].end},end:{...$[J][1].start}},B={type:G>1?"strong":"emphasis",start:{...X.start},end:{...z.end}},$[H][1].end={...X.start},$[J][1].start={...z.end},U=[],$[H][1].end.offset-$[H][1].start.offset)U=b4(U,[["enter",$[H][1],Z],["exit",$[H][1],Z]]);if(U=b4(U,[["enter",B,Z],["enter",X,Z],["exit",X,Z],["enter",Q,Z]]),U=b4(U,D7(Z.parser.constructs.insideSpan.null,$.slice(H+1,J),Z)),U=b4(U,[["exit",Q,Z],["enter",z,Z],["exit",z,Z],["exit",B,Z]]),$[J][1].end.offset-$[J][1].start.offset)Y=2,U=b4(U,[["enter",$[J][1],Z],["exit",$[J][1],Z]]);else Y=0;Z2($,H-1,J-H+3,U),J=H+U.length-Y-2;break}}J=-1;while(++J<$.length)if($[J][1].type==="attentionSequence")$[J][1].type="data";return $}function t$0($,Z){let J=this.parser.constructs.attentionMarkers.null,H=this.previous,B=f3(H),Q;return X;function X(G){return Q=G,$.enter("attentionSequence"),z(G)}function z(G){if(G===Q)return $.consume(G),z;let U=$.exit("attentionSequence"),Y=f3(G),K=!Y||Y===2&&B||J.includes(G),F=!B||B===2&&Y||J.includes(H);return U._open=Boolean(Q===42?K:K&&(B||!F)),U._close=Boolean(Q===42?F:F&&(Y||!K)),Z(G)}}function Em($,Z){$.column+=Z,$.offset+=Z,$._bufferIndex+=Z}var WM={name:"autolink",tokenize:e$0};function e$0($,Z,J){let H=0;return B;function B(W){return $.enter("autolink"),$.enter("autolinkMarker"),$.consume(W),$.exit("autolinkMarker"),$.enter("autolinkProtocol"),Q}function Q(W){if(V2(W))return $.consume(W),X;if(W===64)return J(W);return U(W)}function X(W){if(W===43||W===45||W===46||o5(W))return H=1,z(W);return U(W)}function z(W){if(W===58)return $.consume(W),H=0,G;if((W===43||W===45||W===46||o5(W))&&H++<32)return $.consume(W),z;return H=0,U(W)}function G(W){if(W===62)return $.exit("autolinkProtocol"),$.enter("autolinkMarker"),$.consume(W),$.exit("autolinkMarker"),$.exit("autolink"),Z;if(W===null||W===32||W===60||d$(W))return J(W);return $.consume(W),G}function U(W){if(W===64)return $.consume(W),Y;if(Pm(W))return $.consume(W),U;return J(W)}function Y(W){return o5(W)?K(W):J(W)}function K(W){if(W===46)return $.consume(W),H=0,Y;if(W===62)return $.exit("autolinkProtocol").type="autolinkEmail",$.enter("autolinkMarker"),$.consume(W),$.exit("autolinkMarker"),$.exit("autolink"),Z;return F(W)}function F(W){if((W===45||o5(W))&&H++<63){let q=W===45?F:K;return $.consume(W),q}return J(W)}}var X3={partial:!0,tokenize:$Z0};function $Z0($,Z,J){return H;function H(Q){return B1(Q)?Z1($,B,"linePrefix")(Q):B(Q)}function B(Q){return Q===null||u0(Q)?Z(Q):J(Q)}}var uF={continuation:{tokenize:JZ0},exit:HZ0,name:"blockQuote",tokenize:ZZ0};function ZZ0($,Z,J){let H=this;return B;function B(X){if(X===62){let z=H.containerState;if(!z.open)$.enter("blockQuote",{_container:!0}),z.open=!0;return $.enter("blockQuotePrefix"),$.enter("blockQuoteMarker"),$.consume(X),$.exit("blockQuoteMarker"),Q}return J(X)}function Q(X){if(B1(X))return $.enter("blockQuotePrefixWhitespace"),$.consume(X),$.exit("blockQuotePrefixWhitespace"),$.exit("blockQuotePrefix"),Z;return $.exit("blockQuotePrefix"),Z(X)}}function JZ0($,Z,J){let H=this;return B;function B(X){if(B1(X))return Z1($,Q,"linePrefix",H.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(X);return Q(X)}function Q(X){return $.attempt(uF,Z,J)(X)}}function HZ0($){$.exit("blockQuote")}var pF={name:"characterEscape",tokenize:BZ0};function BZ0($,Z,J){return H;function H(Q){return $.enter("characterEscape"),$.enter("escapeMarker"),$.consume(Q),$.exit("escapeMarker"),B}function B(Q){if(jm(Q))return $.enter("characterEscapeValue"),$.consume(Q),$.exit("characterEscapeValue"),$.exit("characterEscape"),Z;return J(Q)}}var cF={name:"characterReference",tokenize:QZ0};function QZ0($,Z,J){let H=this,B=0,Q,X;return z;function z(K){return $.enter("characterReference"),$.enter("characterReferenceMarker"),$.consume(K),$.exit("characterReferenceMarker"),G}function G(K){if(K===35)return $.enter("characterReferenceMarkerNumeric"),$.consume(K),$.exit("characterReferenceMarkerNumeric"),U;return $.enter("characterReferenceValue"),Q=31,X=o5,Y(K)}function U(K){if(K===88||K===120)return $.enter("characterReferenceMarkerHexadecimal"),$.consume(K),$.exit("characterReferenceMarkerHexadecimal"),$.enter("characterReferenceValue"),Q=6,X=_m,Y;return $.enter("characterReferenceValue"),Q=7,X=aQ,Y(K)}function Y(K){if(K===59&&B){let F=$.exit("characterReferenceValue");if(X===o5&&!HH(H.sliceSerialize(F)))return J(K);return $.enter("characterReferenceMarker"),$.consume(K),$.exit("characterReferenceMarker"),$.exit("characterReference"),Z}if(X(K)&&B++<Q)return $.consume(K),Y;return J(K)}}var bm={partial:!0,tokenize:zZ0},dF={concrete:!0,name:"codeFenced",tokenize:XZ0};function XZ0($,Z,J){let H=this,B={partial:!0,tokenize:M},Q=0,X=0,z;return G;function G(_){return U(_)}function U(_){let w=H.events[H.events.length-1];return Q=w&&w[1].type==="linePrefix"?w[2].sliceSerialize(w[1],!0).length:0,z=_,$.enter("codeFenced"),$.enter("codeFencedFence"),$.enter("codeFencedFenceSequence"),Y(_)}function Y(_){if(_===z)return X++,$.consume(_),Y;if(X<3)return J(_);return $.exit("codeFencedFenceSequence"),B1(_)?Z1($,K,"whitespace")(_):K(_)}function K(_){if(_===null||u0(_))return $.exit("codeFencedFence"),H.interrupt?Z(_):$.check(bm,N,j)(_);return $.enter("codeFencedFenceInfo"),$.enter("chunkString",{contentType:"string"}),F(_)}function F(_){if(_===null||u0(_))return $.exit("chunkString"),$.exit("codeFencedFenceInfo"),K(_);if(B1(_))return $.exit("chunkString"),$.exit("codeFencedFenceInfo"),Z1($,W,"whitespace")(_);if(_===96&&_===z)return J(_);return $.consume(_),F}function W(_){if(_===null||u0(_))return K(_);return $.enter("codeFencedFenceMeta"),$.enter("chunkString",{contentType:"string"}),q(_)}function q(_){if(_===null||u0(_))return $.exit("chunkString"),$.exit("codeFencedFenceMeta"),K(_);if(_===96&&_===z)return J(_);return $.consume(_),q}function N(_){return $.attempt(B,j,D)(_)}function D(_){return $.enter("lineEnding"),$.consume(_),$.exit("lineEnding"),A}function A(_){return Q>0&&B1(_)?Z1($,V,"linePrefix",Q+1)(_):V(_)}function V(_){if(_===null||u0(_))return $.check(bm,N,j)(_);return $.enter("codeFlowValue"),L(_)}function L(_){if(_===null||u0(_))return $.exit("codeFlowValue"),V(_);return $.consume(_),L}function j(_){return $.exit("codeFenced"),Z(_)}function M(_,w,T){let b=0;return C;function C(y){return _.enter("lineEnding"),_.consume(y),_.exit("lineEnding"),k}function k(y){return _.enter("codeFencedFence"),B1(y)?Z1(_,S,"linePrefix",H.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(y):S(y)}function S(y){if(y===z)return _.enter("codeFencedFenceSequence"),R(y);return T(y)}function R(y){if(y===z)return b++,_.consume(y),R;if(b>=X)return _.exit("codeFencedFenceSequence"),B1(y)?Z1(_,O,"whitespace")(y):O(y);return T(y)}function O(y){if(y===null||u0(y))return _.exit("codeFencedFence"),w(y);return T(y)}}}function zZ0($,Z,J){let H=this;return B;function B(X){if(X===null)return J(X);return $.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),Q}function Q(X){return H.parser.lazy[H.now().line]?J(X):Z(X)}}var nQ={name:"codeIndented",tokenize:UZ0},GZ0={partial:!0,tokenize:YZ0};function UZ0($,Z,J){let H=this;return B;function B(U){return $.enter("codeIndented"),Z1($,Q,"linePrefix",5)(U)}function Q(U){let Y=H.events[H.events.length-1];return Y&&Y[1].type==="linePrefix"&&Y[2].sliceSerialize(Y[1],!0).length>=4?X(U):J(U)}function X(U){if(U===null)return G(U);if(u0(U))return $.attempt(GZ0,X,G)(U);return $.enter("codeFlowValue"),z(U)}function z(U){if(U===null||u0(U))return $.exit("codeFlowValue"),X(U);return $.consume(U),z}function G(U){return $.exit("codeIndented"),Z(U)}}function YZ0($,Z,J){let H=this;return B;function B(X){if(H.parser.lazy[H.now().line])return J(X);if(u0(X))return $.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),B;return Z1($,Q,"linePrefix",5)(X)}function Q(X){let z=H.events[H.events.length-1];return z&&z[1].type==="linePrefix"&&z[2].sliceSerialize(z[1],!0).length>=4?Z(X):u0(X)?B(X):J(X)}}var qM={name:"codeText",previous:FZ0,resolve:KZ0,tokenize:WZ0};function KZ0($){let Z=$.length-4,J=3,H,B;if(($[J][1].type==="lineEnding"||$[J][1].type==="space")&&($[Z][1].type==="lineEnding"||$[Z][1].type==="space")){H=J;while(++H<Z)if($[H][1].type==="codeTextData"){$[J][1].type="codeTextPadding",$[Z][1].type="codeTextPadding",J+=2,Z-=2;break}}H=J-1,Z++;while(++H<=Z)if(B===void 0){if(H!==Z&&$[H][1].type!=="lineEnding")B=H}else if(H===Z||$[H][1].type==="lineEnding"){if($[B][1].type="codeTextData",H!==B+2)$[B][1].end=$[H-1][1].end,$.splice(B+2,H-B-2),Z-=H-B-2,H=B+2;B=void 0}return $}function FZ0($){return $!==96||this.events[this.events.length-1][1].type==="characterEscape"}function WZ0($,Z,J){let H=this,B=0,Q,X;return z;function z(F){return $.enter("codeText"),$.enter("codeTextSequence"),G(F)}function G(F){if(F===96)return $.consume(F),B++,G;return $.exit("codeTextSequence"),U(F)}function U(F){if(F===null)return J(F);if(F===32)return $.enter("space"),$.consume(F),$.exit("space"),U;if(F===96)return X=$.enter("codeTextSequence"),Q=0,K(F);if(u0(F))return $.enter("lineEnding"),$.consume(F),$.exit("lineEnding"),U;return $.enter("codeTextData"),Y(F)}function Y(F){if(F===null||F===32||F===96||u0(F))return $.exit("codeTextData"),U(F);return $.consume(F),Y}function K(F){if(F===96)return $.consume(F),Q++,K;if(Q===B)return $.exit("codeTextSequence"),$.exit("codeText"),Z(F);return X.type="codeTextData",Y(F)}}class NM{constructor($){this.left=$?[...$]:[],this.right=[]}get($){if($<0||$>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+$+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");if($<this.left.length)return this.left[$];return this.right[this.right.length-$+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice($,Z){let J=Z===null||Z===void 0?Number.POSITIVE_INFINITY:Z;if(J<this.left.length)return this.left.slice($,J);if($>this.left.length)return this.right.slice(this.right.length-J+this.left.length,this.right.length-$+this.left.length).reverse();return this.left.slice($).concat(this.right.slice(this.right.length-J+this.left.length).reverse())}splice($,Z,J){let H=Z||0;this.setCursor(Math.trunc($));let B=this.right.splice(this.right.length-H,Number.POSITIVE_INFINITY);if(J)sQ(this.left,J);return B.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push($){this.setCursor(Number.POSITIVE_INFINITY),this.left.push($)}pushMany($){this.setCursor(Number.POSITIVE_INFINITY),sQ(this.left,$)}unshift($){this.setCursor(0),this.right.push($)}unshiftMany($){this.setCursor(0),sQ(this.right,$.reverse())}setCursor($){if($===this.left.length||$>this.left.length&&this.right.length===0||$<0&&this.left.length===0)return;if($<this.left.length){let Z=this.left.splice($,Number.POSITIVE_INFINITY);sQ(this.right,Z.reverse())}else{let Z=this.right.splice(this.left.length+this.right.length-$,Number.POSITIVE_INFINITY);sQ(this.left,Z.reverse())}}}function sQ($,Z){let J=0;if(Z.length<1e4)$.push(...Z);else while(J<Z.length)$.push(...Z.slice(J,J+1e4)),J+=1e4}function lF($){let Z={},J=-1,H,B,Q,X,z,G,U,Y=new NM($);while(++J<Y.length){while(J in Z)J=Z[J];if(H=Y.get(J),J&&H[1].type==="chunkFlow"&&Y.get(J-1)[1].type==="listItemPrefix"){if(G=H[1]._tokenizer.events,Q=0,Q<G.length&&G[Q][1].type==="lineEndingBlank")Q+=2;if(Q<G.length&&G[Q][1].type==="content")while(++Q<G.length){if(G[Q][1].type==="content")break;if(G[Q][1].type==="chunkText")G[Q][1]._isInFirstContentOfListItem=!0,Q++}}if(H[0]==="enter"){if(H[1].contentType)Object.assign(Z,qZ0(Y,J)),J=Z[J],U=!0}else if(H[1]._container){Q=J,B=void 0;while(Q--)if(X=Y.get(Q),X[1].type==="lineEnding"||X[1].type==="lineEndingBlank"){if(X[0]==="enter"){if(B)Y.get(B)[1].type="lineEndingBlank";X[1].type="lineEnding",B=Q}}else if(X[1].type==="linePrefix"||X[1].type==="listItemIndent");else break;if(B)H[1].end={...Y.get(B)[1].start},z=Y.slice(B,J),z.unshift(H),Y.splice(B,J-B+1,z)}}return Z2($,0,Number.POSITIVE_INFINITY,Y.slice(0)),!U}function qZ0($,Z){let J=$.get(Z)[1],H=$.get(Z)[2],B=Z-1,Q=[],X=J._tokenizer;if(!X){if(X=H.parser[J.contentType](J.start),J._contentTypeTextTrailing)X._contentTypeTextTrailing=!0}let z=X.events,G=[],U={},Y,K,F=-1,W=J,q=0,N=0,D=[N];while(W){while($.get(++B)[1]!==W);if(Q.push(B),!W._tokenizer){if(Y=H.sliceStream(W),!W.next)Y.push(null);if(K)X.defineSkip(W.start);if(W._isInFirstContentOfListItem)X._gfmTasklistFirstContentOfListItem=!0;if(X.write(Y),W._isInFirstContentOfListItem)X._gfmTasklistFirstContentOfListItem=void 0}K=W,W=W.next}W=J;while(++F<z.length)if(z[F][0]==="exit"&&z[F-1][0]==="enter"&&z[F][1].type===z[F-1][1].type&&z[F][1].start.line!==z[F][1].end.line)N=F+1,D.push(N),W._tokenizer=void 0,W.previous=void 0,W=W.next;if(X.events=[],W)W._tokenizer=void 0,W.previous=void 0;else D.pop();F=D.length;while(F--){let A=z.slice(D[F],D[F+1]),V=Q.pop();G.push([V,V+A.length-1]),$.splice(V,2,A)}G.reverse(),F=-1;while(++F<G.length)U[q+G[F][0]]=q+G[F][1],q+=G[F][1]-G[F][0]-1;return U}var AM={resolve:AZ0,tokenize:DZ0},NZ0={partial:!0,tokenize:VZ0};function AZ0($){return lF($),$}function DZ0($,Z){let J;return H;function H(z){return $.enter("content"),J=$.enter("chunkContent",{contentType:"content"}),B(z)}function B(z){if(z===null)return Q(z);if(u0(z))return $.check(NZ0,X,Q)(z);return $.consume(z),B}function Q(z){return $.exit("chunkContent"),$.exit("content"),Z(z)}function X(z){return $.consume(z),$.exit("chunkContent"),J.next=$.enter("chunkContent",{contentType:"content",previous:J}),J=J.next,B}}function VZ0($,Z,J){let H=this;return B;function B(X){return $.exit("chunkContent"),$.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),Z1($,Q,"linePrefix")}function Q(X){if(X===null||u0(X))return J(X);let z=H.events[H.events.length-1];if(!H.parser.constructs.disable.null.includes("codeIndented")&&z&&z[1].type==="linePrefix"&&z[2].sliceSerialize(z[1],!0).length>=4)return Z(X);return $.interrupt(H.parser.constructs.flow,J,Z)(X)}}function iF($,Z,J,H,B,Q,X,z,G){let U=G||Number.POSITIVE_INFINITY,Y=0;return K;function K(A){if(A===60)return $.enter(H),$.enter(B),$.enter(Q),$.consume(A),$.exit(Q),F;if(A===null||A===32||A===41||d$(A))return J(A);return $.enter(H),$.enter(X),$.enter(z),$.enter("chunkString",{contentType:"string"}),N(A)}function F(A){if(A===62)return $.enter(Q),$.consume(A),$.exit(Q),$.exit(B),$.exit(H),Z;return $.enter(z),$.enter("chunkString",{contentType:"string"}),W(A)}function W(A){if(A===62)return $.exit("chunkString"),$.exit(z),F(A);if(A===null||A===60||u0(A))return J(A);return $.consume(A),A===92?q:W}function q(A){if(A===60||A===62||A===92)return $.consume(A),W;return W(A)}function N(A){if(!Y&&(A===null||A===41||y1(A)))return $.exit("chunkString"),$.exit(z),$.exit(X),$.exit(H),Z(A);if(Y<U&&A===40)return $.consume(A),Y++,N;if(A===41)return $.consume(A),Y--,N;if(A===null||A===32||A===40||d$(A))return J(A);return $.consume(A),A===92?D:N}function D(A){if(A===40||A===41||A===92)return $.consume(A),N;return N(A)}}function rF($,Z,J,H,B,Q){let X=this,z=0,G;return U;function U(W){return $.enter(H),$.enter(B),$.consume(W),$.exit(B),$.enter(Q),Y}function Y(W){if(z>999||W===null||W===91||W===93&&!G||W===94&&!z&&"_hiddenFootnoteSupport"in X.parser.constructs)return J(W);if(W===93)return $.exit(Q),$.enter(B),$.consume(W),$.exit(B),$.exit(H),Z;if(u0(W))return $.enter("lineEnding"),$.consume(W),$.exit("lineEnding"),Y;return $.enter("chunkString",{contentType:"string"}),K(W)}function K(W){if(W===null||W===91||W===93||u0(W)||z++>999)return $.exit("chunkString"),Y(W);if($.consume(W),!G)G=!B1(W);return W===92?F:K}function F(W){if(W===91||W===92||W===93)return $.consume(W),z++,K;return K(W)}}function aF($,Z,J,H,B,Q){let X;return z;function z(F){if(F===34||F===39||F===40)return $.enter(H),$.enter(B),$.consume(F),$.exit(B),X=F===40?41:F,G;return J(F)}function G(F){if(F===X)return $.enter(B),$.consume(F),$.exit(B),$.exit(H),Z;return $.enter(Q),U(F)}function U(F){if(F===X)return $.exit(Q),G(X);if(F===null)return J(F);if(u0(F))return $.enter("lineEnding"),$.consume(F),$.exit("lineEnding"),Z1($,U,"linePrefix");return $.enter("chunkString",{contentType:"string"}),Y(F)}function Y(F){if(F===X||F===null||u0(F))return $.exit("chunkString"),U(F);return $.consume(F),F===92?K:Y}function K(F){if(F===X||F===92)return $.consume(F),Y;return Y(F)}}function i$($,Z){let J;return H;function H(B){if(u0(B))return $.enter("lineEnding"),$.consume(B),$.exit("lineEnding"),J=!0,H;if(B1(B))return Z1($,H,J?"linePrefix":"lineSuffix")(B);return Z(B)}}var DM={name:"definition",tokenize:MZ0},LZ0={partial:!0,tokenize:PZ0};function MZ0($,Z,J){let H=this,B;return Q;function Q(W){return $.enter("definition"),X(W)}function X(W){return rF.call(H,$,z,J,"definitionLabel","definitionLabelMarker","definitionLabelString")(W)}function z(W){if(B=q4(H.sliceSerialize(H.events[H.events.length-1][1]).slice(1,-1)),W===58)return $.enter("definitionMarker"),$.consume(W),$.exit("definitionMarker"),G;return J(W)}function G(W){return y1(W)?i$($,U)(W):U(W)}function U(W){return iF($,Y,J,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(W)}function Y(W){return $.attempt(LZ0,K,K)(W)}function K(W){return B1(W)?Z1($,F,"whitespace")(W):F(W)}function F(W){if(W===null||u0(W))return $.exit("definition"),H.parser.defined.push(B),Z(W);return J(W)}}function PZ0($,Z,J){return H;function H(z){return y1(z)?i$($,B)(z):J(z)}function B(z){return aF($,Q,J,"definitionTitle","definitionTitleMarker","definitionTitleString")(z)}function Q(z){return B1(z)?Z1($,X,"whitespace")(z):X(z)}function X(z){return z===null||u0(z)?Z(z):J(z)}}var VM={name:"hardBreakEscape",tokenize:_Z0};function _Z0($,Z,J){return H;function H(Q){return $.enter("hardBreakEscape"),$.consume(Q),B}function B(Q){if(u0(Q))return $.exit("hardBreakEscape"),Z(Q);return J(Q)}}var LM={name:"headingAtx",resolve:jZ0,tokenize:OZ0};function jZ0($,Z){let J=$.length-2,H=3,B,Q;if($[H][1].type==="whitespace")H+=2;if(J-2>H&&$[J][1].type==="whitespace")J-=2;if($[J][1].type==="atxHeadingSequence"&&(H===J-1||J-4>H&&$[J-2][1].type==="whitespace"))J-=H+1===J?2:4;if(J>H)B={type:"atxHeadingText",start:$[H][1].start,end:$[J][1].end},Q={type:"chunkText",start:$[H][1].start,end:$[J][1].end,contentType:"text"},Z2($,H,J-H+1,[["enter",B,Z],["enter",Q,Z],["exit",Q,Z],["exit",B,Z]]);return $}function OZ0($,Z,J){let H=0;return B;function B(Y){return $.enter("atxHeading"),Q(Y)}function Q(Y){return $.enter("atxHeadingSequence"),X(Y)}function X(Y){if(Y===35&&H++<6)return $.consume(Y),X;if(Y===null||y1(Y))return $.exit("atxHeadingSequence"),z(Y);return J(Y)}function z(Y){if(Y===35)return $.enter("atxHeadingSequence"),G(Y);if(Y===null||u0(Y))return $.exit("atxHeading"),Z(Y);if(B1(Y))return Z1($,z,"whitespace")(Y);return $.enter("atxHeadingText"),U(Y)}function G(Y){if(Y===35)return $.consume(Y),G;return $.exit("atxHeadingSequence"),z(Y)}function U(Y){if(Y===null||Y===35||y1(Y))return $.exit("atxHeadingText"),z(Y);return $.consume(Y),U}}var wm=["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"],MM=["pre","script","style","textarea"];var PM={concrete:!0,name:"htmlFlow",resolveTo:EZ0,tokenize:bZ0},TZ0={partial:!0,tokenize:SZ0},CZ0={partial:!0,tokenize:wZ0};function EZ0($){let Z=$.length;while(Z--)if($[Z][0]==="enter"&&$[Z][1].type==="htmlFlow")break;if(Z>1&&$[Z-2][1].type==="linePrefix")$[Z][1].start=$[Z-2][1].start,$[Z+1][1].start=$[Z-2][1].start,$.splice(Z-2,2);return $}function bZ0($,Z,J){let H=this,B,Q,X,z,G;return U;function U(h){return Y(h)}function Y(h){return $.enter("htmlFlow"),$.enter("htmlFlowData"),$.consume(h),K}function K(h){if(h===33)return $.consume(h),F;if(h===47)return $.consume(h),Q=!0,N;if(h===63)return $.consume(h),B=3,H.interrupt?Z:E;if(V2(h))return $.consume(h),X=String.fromCharCode(h),D;return J(h)}function F(h){if(h===45)return $.consume(h),B=2,W;if(h===91)return $.consume(h),B=5,z=0,q;if(V2(h))return $.consume(h),B=4,H.interrupt?Z:E;return J(h)}function W(h){if(h===45)return $.consume(h),H.interrupt?Z:E;return J(h)}function q(h){if(h==="CDATA[".charCodeAt(z++)){if($.consume(h),z===6)return H.interrupt?Z:S;return q}return J(h)}function N(h){if(V2(h))return $.consume(h),X=String.fromCharCode(h),D;return J(h)}function D(h){if(h===null||h===47||h===62||y1(h)){let d=h===47,o=X.toLowerCase();if(!d&&!Q&&MM.includes(o))return B=1,H.interrupt?Z(h):S(h);if(wm.includes(X.toLowerCase())){if(B=6,d)return $.consume(h),A;return H.interrupt?Z(h):S(h)}return B=7,H.interrupt&&!H.parser.lazy[H.now().line]?J(h):Q?V(h):L(h)}if(h===45||o5(h))return $.consume(h),X+=String.fromCharCode(h),D;return J(h)}function A(h){if(h===62)return $.consume(h),H.interrupt?Z:S;return J(h)}function V(h){if(B1(h))return $.consume(h),V;return C(h)}function L(h){if(h===47)return $.consume(h),C;if(h===58||h===95||V2(h))return $.consume(h),j;if(B1(h))return $.consume(h),L;return C(h)}function j(h){if(h===45||h===46||h===58||h===95||o5(h))return $.consume(h),j;return M(h)}function M(h){if(h===61)return $.consume(h),_;if(B1(h))return $.consume(h),M;return L(h)}function _(h){if(h===null||h===60||h===61||h===62||h===96)return J(h);if(h===34||h===39)return $.consume(h),G=h,w;if(B1(h))return $.consume(h),_;return T(h)}function w(h){if(h===G)return $.consume(h),G=null,b;if(h===null||u0(h))return J(h);return $.consume(h),w}function T(h){if(h===null||h===34||h===39||h===47||h===60||h===61||h===62||h===96||y1(h))return M(h);return $.consume(h),T}function b(h){if(h===47||h===62||B1(h))return L(h);return J(h)}function C(h){if(h===62)return $.consume(h),k;return J(h)}function k(h){if(h===null||u0(h))return S(h);if(B1(h))return $.consume(h),k;return J(h)}function S(h){if(h===45&&B===2)return $.consume(h),I;if(h===60&&B===1)return $.consume(h),x;if(h===62&&B===4)return $.consume(h),l;if(h===63&&B===3)return $.consume(h),E;if(h===93&&B===5)return $.consume(h),g;if(u0(h)&&(B===6||B===7))return $.exit("htmlFlowData"),$.check(TZ0,r,R)(h);if(h===null||u0(h))return $.exit("htmlFlowData"),R(h);return $.consume(h),S}function R(h){return $.check(CZ0,O,r)(h)}function O(h){return $.enter("lineEnding"),$.consume(h),$.exit("lineEnding"),y}function y(h){if(h===null||u0(h))return R(h);return $.enter("htmlFlowData"),S(h)}function I(h){if(h===45)return $.consume(h),E;return S(h)}function x(h){if(h===47)return $.consume(h),X="",v;return S(h)}function v(h){if(h===62){let d=X.toLowerCase();if(MM.includes(d))return $.consume(h),l;return S(h)}if(V2(h)&&X.length<8)return $.consume(h),X+=String.fromCharCode(h),v;return S(h)}function g(h){if(h===93)return $.consume(h),E;return S(h)}function E(h){if(h===62)return $.consume(h),l;if(h===45&&B===2)return $.consume(h),E;return S(h)}function l(h){if(h===null||u0(h))return $.exit("htmlFlowData"),r(h);return $.consume(h),l}function r(h){return $.exit("htmlFlow"),Z(h)}}function wZ0($,Z,J){let H=this;return B;function B(X){if(u0(X))return $.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),Q;return J(X)}function Q(X){return H.parser.lazy[H.now().line]?J(X):Z(X)}}function SZ0($,Z,J){return H;function H(B){return $.enter("lineEnding"),$.consume(B),$.exit("lineEnding"),$.attempt(X3,Z,J)}}var _M={name:"htmlText",tokenize:RZ0};function RZ0($,Z,J){let H=this,B,Q,X;return z;function z(E){return $.enter("htmlText"),$.enter("htmlTextData"),$.consume(E),G}function G(E){if(E===33)return $.consume(E),U;if(E===47)return $.consume(E),M;if(E===63)return $.consume(E),L;if(V2(E))return $.consume(E),T;return J(E)}function U(E){if(E===45)return $.consume(E),Y;if(E===91)return $.consume(E),Q=0,q;if(V2(E))return $.consume(E),V;return J(E)}function Y(E){if(E===45)return $.consume(E),W;return J(E)}function K(E){if(E===null)return J(E);if(E===45)return $.consume(E),F;if(u0(E))return X=K,x(E);return $.consume(E),K}function F(E){if(E===45)return $.consume(E),W;return K(E)}function W(E){return E===62?I(E):E===45?F(E):K(E)}function q(E){if(E==="CDATA[".charCodeAt(Q++))return $.consume(E),Q===6?N:q;return J(E)}function N(E){if(E===null)return J(E);if(E===93)return $.consume(E),D;if(u0(E))return X=N,x(E);return $.consume(E),N}function D(E){if(E===93)return $.consume(E),A;return N(E)}function A(E){if(E===62)return I(E);if(E===93)return $.consume(E),A;return N(E)}function V(E){if(E===null||E===62)return I(E);if(u0(E))return X=V,x(E);return $.consume(E),V}function L(E){if(E===null)return J(E);if(E===63)return $.consume(E),j;if(u0(E))return X=L,x(E);return $.consume(E),L}function j(E){return E===62?I(E):L(E)}function M(E){if(V2(E))return $.consume(E),_;return J(E)}function _(E){if(E===45||o5(E))return $.consume(E),_;return w(E)}function w(E){if(u0(E))return X=w,x(E);if(B1(E))return $.consume(E),w;return I(E)}function T(E){if(E===45||o5(E))return $.consume(E),T;if(E===47||E===62||y1(E))return b(E);return J(E)}function b(E){if(E===47)return $.consume(E),I;if(E===58||E===95||V2(E))return $.consume(E),C;if(u0(E))return X=b,x(E);if(B1(E))return $.consume(E),b;return I(E)}function C(E){if(E===45||E===46||E===58||E===95||o5(E))return $.consume(E),C;return k(E)}function k(E){if(E===61)return $.consume(E),S;if(u0(E))return X=k,x(E);if(B1(E))return $.consume(E),k;return b(E)}function S(E){if(E===null||E===60||E===61||E===62||E===96)return J(E);if(E===34||E===39)return $.consume(E),B=E,R;if(u0(E))return X=S,x(E);if(B1(E))return $.consume(E),S;return $.consume(E),O}function R(E){if(E===B)return $.consume(E),B=void 0,y;if(E===null)return J(E);if(u0(E))return X=R,x(E);return $.consume(E),R}function O(E){if(E===null||E===34||E===39||E===60||E===61||E===96)return J(E);if(E===47||E===62||y1(E))return b(E);return $.consume(E),O}function y(E){if(E===47||E===62||y1(E))return b(E);return J(E)}function I(E){if(E===62)return $.consume(E),$.exit("htmlTextData"),$.exit("htmlText"),Z;return J(E)}function x(E){return $.exit("htmlTextData"),$.enter("lineEnding"),$.consume(E),$.exit("lineEnding"),v}function v(E){return B1(E)?Z1($,g,"linePrefix",H.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):g(E)}function g(E){return $.enter("htmlTextData"),X(E)}}var r$={name:"labelEnd",resolveAll:xZ0,resolveTo:hZ0,tokenize:vZ0},kZ0={tokenize:gZ0},IZ0={tokenize:fZ0},yZ0={tokenize:mZ0};function xZ0($){let Z=-1,J=[];while(++Z<$.length){let H=$[Z][1];if(J.push($[Z]),H.type==="labelImage"||H.type==="labelLink"||H.type==="labelEnd"){let B=H.type==="labelImage"?4:2;H.type="data",Z+=B}}if($.length!==J.length)Z2($,0,$.length,J);return $}function hZ0($,Z){let J=$.length,H=0,B,Q,X,z;while(J--)if(B=$[J][1],Q){if(B.type==="link"||B.type==="labelLink"&&B._inactive)break;if($[J][0]==="enter"&&B.type==="labelLink")B._inactive=!0}else if(X){if($[J][0]==="enter"&&(B.type==="labelImage"||B.type==="labelLink")&&!B._balanced){if(Q=J,B.type!=="labelLink"){H=2;break}}}else if(B.type==="labelEnd")X=J;let G={type:$[Q][1].type==="labelLink"?"link":"image",start:{...$[Q][1].start},end:{...$[$.length-1][1].end}},U={type:"label",start:{...$[Q][1].start},end:{...$[X][1].end}},Y={type:"labelText",start:{...$[Q+H+2][1].end},end:{...$[X-2][1].start}};return z=[["enter",G,Z],["enter",U,Z]],z=b4(z,$.slice(Q+1,Q+H+3)),z=b4(z,[["enter",Y,Z]]),z=b4(z,D7(Z.parser.constructs.insideSpan.null,$.slice(Q+H+4,X-3),Z)),z=b4(z,[["exit",Y,Z],$[X-2],$[X-1],["exit",U,Z]]),z=b4(z,$.slice(X+1)),z=b4(z,[["exit",G,Z]]),Z2($,Q,$.length,z),$}function vZ0($,Z,J){let H=this,B=H.events.length,Q,X;while(B--)if((H.events[B][1].type==="labelImage"||H.events[B][1].type==="labelLink")&&!H.events[B][1]._balanced){Q=H.events[B][1];break}return z;function z(F){if(!Q)return J(F);if(Q._inactive)return K(F);return X=H.parser.defined.includes(q4(H.sliceSerialize({start:Q.end,end:H.now()}))),$.enter("labelEnd"),$.enter("labelMarker"),$.consume(F),$.exit("labelMarker"),$.exit("labelEnd"),G}function G(F){if(F===40)return $.attempt(kZ0,Y,X?Y:K)(F);if(F===91)return $.attempt(IZ0,Y,X?U:K)(F);return X?Y(F):K(F)}function U(F){return $.attempt(yZ0,Y,K)(F)}function Y(F){return Z(F)}function K(F){return Q._balanced=!0,J(F)}}function gZ0($,Z,J){return H;function H(K){return $.enter("resource"),$.enter("resourceMarker"),$.consume(K),$.exit("resourceMarker"),B}function B(K){return y1(K)?i$($,Q)(K):Q(K)}function Q(K){if(K===41)return Y(K);return iF($,X,z,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(K)}function X(K){return y1(K)?i$($,G)(K):Y(K)}function z(K){return J(K)}function G(K){if(K===34||K===39||K===40)return aF($,U,J,"resourceTitle","resourceTitleMarker","resourceTitleString")(K);return Y(K)}function U(K){return y1(K)?i$($,Y)(K):Y(K)}function Y(K){if(K===41)return $.enter("resourceMarker"),$.consume(K),$.exit("resourceMarker"),$.exit("resource"),Z;return J(K)}}function fZ0($,Z,J){let H=this;return B;function B(z){return rF.call(H,$,Q,X,"reference","referenceMarker","referenceString")(z)}function Q(z){return H.parser.defined.includes(q4(H.sliceSerialize(H.events[H.events.length-1][1]).slice(1,-1)))?Z(z):J(z)}function X(z){return J(z)}}function mZ0($,Z,J){return H;function H(Q){return $.enter("reference"),$.enter("referenceMarker"),$.consume(Q),$.exit("referenceMarker"),B}function B(Q){if(Q===93)return $.enter("referenceMarker"),$.consume(Q),$.exit("referenceMarker"),$.exit("reference"),Z;return J(Q)}}var jM={name:"labelStartImage",resolveAll:r$.resolveAll,tokenize:uZ0};function uZ0($,Z,J){let H=this;return B;function B(z){return $.enter("labelImage"),$.enter("labelImageMarker"),$.consume(z),$.exit("labelImageMarker"),Q}function Q(z){if(z===91)return $.enter("labelMarker"),$.consume(z),$.exit("labelMarker"),$.exit("labelImage"),X;return J(z)}function X(z){return z===94&&"_hiddenFootnoteSupport"in H.parser.constructs?J(z):Z(z)}}var OM={name:"labelStartLink",resolveAll:r$.resolveAll,tokenize:pZ0};function pZ0($,Z,J){let H=this;return B;function B(X){return $.enter("labelLink"),$.enter("labelMarker"),$.consume(X),$.exit("labelMarker"),$.exit("labelLink"),Q}function Q(X){return X===94&&"_hiddenFootnoteSupport"in H.parser.constructs?J(X):Z(X)}}var tQ={name:"lineEnding",tokenize:cZ0};function cZ0($,Z){return J;function J(H){return $.enter("lineEnding"),$.consume(H),$.exit("lineEnding"),Z1($,Z,"linePrefix")}}var a$={name:"thematicBreak",tokenize:dZ0};function dZ0($,Z,J){let H=0,B;return Q;function Q(U){return $.enter("thematicBreak"),X(U)}function X(U){return B=U,z(U)}function z(U){if(U===B)return $.enter("thematicBreakSequence"),G(U);if(H>=3&&(U===null||u0(U)))return $.exit("thematicBreak"),Z(U);return J(U)}function G(U){if(U===B)return $.consume(U),H++,G;return $.exit("thematicBreakSequence"),B1(U)?Z1($,z,"whitespace")(U):z(U)}}var N4={continuation:{tokenize:aZ0},exit:nZ0,name:"list",tokenize:rZ0},lZ0={partial:!0,tokenize:sZ0},iZ0={partial:!0,tokenize:oZ0};function rZ0($,Z,J){let H=this,B=H.events[H.events.length-1],Q=B&&B[1].type==="linePrefix"?B[2].sliceSerialize(B[1],!0).length:0,X=0;return z;function z(W){let q=H.containerState.type||(W===42||W===43||W===45?"listUnordered":"listOrdered");if(q==="listUnordered"?!H.containerState.marker||W===H.containerState.marker:aQ(W)){if(!H.containerState.type)H.containerState.type=q,$.enter(q,{_container:!0});if(q==="listUnordered")return $.enter("listItemPrefix"),W===42||W===45?$.check(a$,J,U)(W):U(W);if(!H.interrupt||W===49)return $.enter("listItemPrefix"),$.enter("listItemValue"),G(W)}return J(W)}function G(W){if(aQ(W)&&++X<10)return $.consume(W),G;if((!H.interrupt||X<2)&&(H.containerState.marker?W===H.containerState.marker:W===41||W===46))return $.exit("listItemValue"),U(W);return J(W)}function U(W){return $.enter("listItemMarker"),$.consume(W),$.exit("listItemMarker"),H.containerState.marker=H.containerState.marker||W,$.check(X3,H.interrupt?J:Y,$.attempt(lZ0,F,K))}function Y(W){return H.containerState.initialBlankLine=!0,Q++,F(W)}function K(W){if(B1(W))return $.enter("listItemPrefixWhitespace"),$.consume(W),$.exit("listItemPrefixWhitespace"),F;return J(W)}function F(W){return H.containerState.size=Q+H.sliceSerialize($.exit("listItemPrefix"),!0).length,Z(W)}}function aZ0($,Z,J){let H=this;return H.containerState._closeFlow=void 0,$.check(X3,B,Q);function B(z){return H.containerState.furtherBlankLines=H.containerState.furtherBlankLines||H.containerState.initialBlankLine,Z1($,Z,"listItemIndent",H.containerState.size+1)(z)}function Q(z){if(H.containerState.furtherBlankLines||!B1(z))return H.containerState.furtherBlankLines=void 0,H.containerState.initialBlankLine=void 0,X(z);return H.containerState.furtherBlankLines=void 0,H.containerState.initialBlankLine=void 0,$.attempt(iZ0,Z,X)(z)}function X(z){return H.containerState._closeFlow=!0,H.interrupt=void 0,Z1($,$.attempt(N4,Z,J),"linePrefix",H.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z)}}function oZ0($,Z,J){let H=this;return Z1($,B,"listItemIndent",H.containerState.size+1);function B(Q){let X=H.events[H.events.length-1];return X&&X[1].type==="listItemIndent"&&X[2].sliceSerialize(X[1],!0).length===H.containerState.size?Z(Q):J(Q)}}function nZ0($){$.exit(this.containerState.type)}function sZ0($,Z,J){let H=this;return Z1($,B,"listItemPrefixWhitespace",H.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function B(Q){let X=H.events[H.events.length-1];return!B1(Q)&&X&&X[1].type==="listItemPrefixWhitespace"?Z(Q):J(Q)}}var oF={name:"setextUnderline",resolveTo:tZ0,tokenize:eZ0};function tZ0($,Z){let J=$.length,H,B,Q;while(J--)if($[J][0]==="enter"){if($[J][1].type==="content"){H=J;break}if($[J][1].type==="paragraph")B=J}else{if($[J][1].type==="content")$.splice(J,1);if(!Q&&$[J][1].type==="definition")Q=J}let X={type:"setextHeading",start:{...$[H][1].start},end:{...$[$.length-1][1].end}};if($[B][1].type="setextHeadingText",Q)$.splice(B,0,["enter",X,Z]),$.splice(Q+1,0,["exit",$[H][1],Z]),$[H][1].end={...$[Q][1].end};else $[H][1]=X;return $.push(["exit",X,Z]),$}function eZ0($,Z,J){let H=this,B;return Q;function Q(U){let Y=H.events.length,K;while(Y--)if(H.events[Y][1].type!=="lineEnding"&&H.events[Y][1].type!=="linePrefix"&&H.events[Y][1].type!=="content"){K=H.events[Y][1].type==="paragraph";break}if(!H.parser.lazy[H.now().line]&&(H.interrupt||K))return $.enter("setextHeadingLine"),B=U,X(U);return J(U)}function X(U){return $.enter("setextHeadingLineSequence"),z(U)}function z(U){if(U===B)return $.consume(U),z;return $.exit("setextHeadingLineSequence"),B1(U)?Z1($,G,"lineSuffix")(U):G(U)}function G(U){if(U===null||u0(U))return $.exit("setextHeadingLine"),Z(U);return J(U)}}var Sm={tokenize:$J0};function $J0($){let Z=this,J=$.attempt(X3,H,$.attempt(this.parser.constructs.flowInitial,B,Z1($,$.attempt(this.parser.constructs.flow,B,$.attempt(AM,B)),"linePrefix")));return J;function H(Q){if(Q===null){$.consume(Q);return}return $.enter("lineEndingBlank"),$.consume(Q),$.exit("lineEndingBlank"),Z.currentConstruct=void 0,J}function B(Q){if(Q===null){$.consume(Q);return}return $.enter("lineEnding"),$.consume(Q),$.exit("lineEnding"),Z.currentConstruct=void 0,J}}var Rm={resolveAll:xm()},km=ym("string"),Im=ym("text");function ym($){return{resolveAll:xm($==="text"?ZJ0:void 0),tokenize:Z};function Z(J){let H=this,B=this.parser.constructs[$],Q=J.attempt(B,X,z);return X;function X(Y){return U(Y)?Q(Y):z(Y)}function z(Y){if(Y===null){J.consume(Y);return}return J.enter("data"),J.consume(Y),G}function G(Y){if(U(Y))return J.exit("data"),Q(Y);return J.consume(Y),G}function U(Y){if(Y===null)return!0;let K=B[Y],F=-1;if(K)while(++F<K.length){let W=K[F];if(!W.previous||W.previous.call(H,H.previous))return!0}return!1}}}function xm($){return Z;function Z(J,H){let B=-1,Q;while(++B<=J.length)if(Q===void 0){if(J[B]&&J[B][1].type==="data")Q=B,B++}else if(!J[B]||J[B][1].type!=="data"){if(B!==Q+2)J[Q][1].end=J[B-1][1].end,J.splice(Q+2,B-Q-2),B=Q+2;Q=void 0}return $?$(J,H):J}}function ZJ0($,Z){let J=0;while(++J<=$.length)if((J===$.length||$[J][1].type==="lineEnding")&&$[J-1][1].type==="data"){let H=$[J-1][1],B=Z.sliceStream(H),Q=B.length,X=-1,z=0,G;while(Q--){let U=B[Q];if(typeof U==="string"){X=U.length;while(U.charCodeAt(X-1)===32)z++,X--;if(X)break;X=-1}else if(U===-2)G=!0,z++;else if(U===-1);else{Q++;break}}if(Z._contentTypeTextTrailing&&J===$.length)z=0;if(z){let U={type:J===$.length||G||z<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:Q?X:H.start._bufferIndex+X,_index:H.start._index+Q,line:H.end.line,column:H.end.column-z,offset:H.end.offset-z},end:{...H.end}};if(H.end={...U.start},H.start.offset===H.end.offset)Object.assign(H,U);else $.splice(J,0,["enter",U,Z],["exit",U,Z]),J+=2}J++}return $}var TM={};b5(TM,{text:()=>zJ0,string:()=>XJ0,insideSpan:()=>GJ0,flowInitial:()=>BJ0,flow:()=>QJ0,document:()=>JJ0,disable:()=>YJ0,contentInitial:()=>HJ0,attentionMarkers:()=>UJ0});var JJ0={[42]:N4,[43]:N4,[45]:N4,[48]:N4,[49]:N4,[50]:N4,[51]:N4,[52]:N4,[53]:N4,[54]:N4,[55]:N4,[56]:N4,[57]:N4,[62]:uF},HJ0={[91]:DM},BJ0={[-2]:nQ,[-1]:nQ,[32]:nQ},QJ0={[35]:LM,[42]:a$,[45]:[oF,a$],[60]:PM,[61]:oF,[95]:a$,[96]:dF,[126]:dF},XJ0={[38]:cF,[92]:pF},zJ0={[-5]:tQ,[-4]:tQ,[-3]:tQ,[33]:jM,[38]:cF,[42]:oQ,[60]:[WM,_M],[91]:OM,[92]:[VM,pF],[93]:r$,[95]:oQ,[96]:qM},GJ0={null:[oQ,Rm]},UJ0={null:[42,95]},YJ0={null:[]};function hm($,Z,J){let H={_bufferIndex:-1,_index:0,line:J&&J.line||1,column:J&&J.column||1,offset:J&&J.offset||0},B={},Q=[],X=[],z=[],G=!0,U={attempt:b(w),check:b(T),consume:j,enter:M,exit:_,interrupt:b(T,{interrupt:!0})},Y={code:null,containerState:{},defineSkip:A,events:[],now:D,parser:$,previous:null,sliceSerialize:q,sliceStream:N,write:W},K=Z.tokenize.call(Y,U),F;if(Z.resolveAll)Q.push(Z);return Y;function W(R){if(X=b4(X,R),V(),X[X.length-1]!==null)return[];return C(Z,0),Y.events=D7(Q,Y.events,Y),Y.events}function q(R,O){return FJ0(N(R),O)}function N(R){return KJ0(X,R)}function D(){let{_bufferIndex:R,_index:O,line:y,column:I,offset:x}=H;return{_bufferIndex:R,_index:O,line:y,column:I,offset:x}}function A(R){B[R.line]=R.column,S()}function V(){let R;while(H._index<X.length){let O=X[H._index];if(typeof O==="string"){if(R=H._index,H._bufferIndex<0)H._bufferIndex=0;while(H._index===R&&H._bufferIndex<O.length)L(O.charCodeAt(H._bufferIndex))}else L(O)}}function L(R){G=void 0,F=R,K=K(R)}function j(R){if(u0(R))H.line++,H.column=1,H.offset+=R===-3?2:1,S();else if(R!==-1)H.column++,H.offset++;if(H._bufferIndex<0)H._index++;else if(H._bufferIndex++,H._bufferIndex===X[H._index].length)H._bufferIndex=-1,H._index++;Y.previous=R,G=!0}function M(R,O){let y=O||{};return y.type=R,y.start=D(),Y.events.push(["enter",y,Y]),z.push(y),y}function _(R){let O=z.pop();return O.end=D(),Y.events.push(["exit",O,Y]),O}function w(R,O){C(R,O.from)}function T(R,O){O.restore()}function b(R,O){return y;function y(I,x,v){let g,E,l,r;return Array.isArray(I)?d(I):("tokenize"in I)?d([I]):h(I);function h(n){return Z0;function Z0(J0){let U0=J0!==null&&n[J0],z0=J0!==null&&n.null,B0=[...Array.isArray(U0)?U0:U0?[U0]:[],...Array.isArray(z0)?z0:z0?[z0]:[]];return d(B0)(J0)}}function d(n){if(g=n,E=0,n.length===0)return v;return o(n[E])}function o(n){return Z0;function Z0(J0){if(r=k(),l=n,!n.partial)Y.currentConstruct=n;if(n.name&&Y.parser.constructs.disable.null.includes(n.name))return i(J0);return n.tokenize.call(O?Object.assign(Object.create(Y),O):Y,U,p,i)(J0)}}function p(n){return G=!0,R(l,r),x}function i(n){if(G=!0,r.restore(),++E<g.length)return o(g[E]);return v}}}function C(R,O){if(R.resolveAll&&!Q.includes(R))Q.push(R);if(R.resolve)Z2(Y.events,O,Y.events.length-O,R.resolve(Y.events.slice(O),Y));if(R.resolveTo)Y.events=R.resolveTo(Y.events,Y)}function k(){let R=D(),O=Y.previous,y=Y.currentConstruct,I=Y.events.length,x=Array.from(z);return{from:I,restore:v};function v(){H=R,Y.previous=O,Y.currentConstruct=y,Y.events.length=I,z=x,S()}}function S(){if(H.line in B&&H.column<2)H.column=B[H.line],H.offset+=B[H.line]-1}}function KJ0($,Z){let J=Z.start._index,H=Z.start._bufferIndex,B=Z.end._index,Q=Z.end._bufferIndex,X;if(J===B)X=[$[J].slice(H,Q)];else{if(X=$.slice(J,B),H>-1){let z=X[0];if(typeof z==="string")X[0]=z.slice(H);else X.shift()}if(Q>0)X.push($[B].slice(0,Q))}return X}function FJ0($,Z){let J=-1,H=[],B;while(++J<$.length){let Q=$[J],X;if(typeof Q==="string")X=Q;else switch(Q){case-5:{X="\r";break}case-4:{X=`
19
- `;break}case-3:{X=`\r
20
- `;break}case-2:{X=Z?" ":"\t";break}case-1:{if(!Z&&B)continue;X=" ";break}default:X=String.fromCharCode(Q)}B=Q===-2,H.push(X)}return H.join("")}function CM($){let H={constructs:fF([TM,...($||{}).extensions||[]]),content:B(Om),defined:[],document:B(Cm),flow:B(Sm),lazy:{},string:B(km),text:B(Im)};return H;function B(Q){return X;function X(z){return hm(H,Q,z)}}}function EM($){while(!lF($));return $}var vm=/[\0\t\n\r]/g;function bM(){let $=1,Z="",J=!0,H;return B;function B(Q,X,z){let G=[],U,Y,K,F,W;if(Q=Z+(typeof Q==="string"?Q.toString():new TextDecoder(X||void 0).decode(Q)),K=0,Z="",J){if(Q.charCodeAt(0)===65279)K++;J=void 0}while(K<Q.length){if(vm.lastIndex=K,U=vm.exec(Q),F=U&&U.index!==void 0?U.index:Q.length,W=Q.charCodeAt(F),!U){Z=Q.slice(K);break}if(W===10&&K===F&&H)G.push(-3),H=void 0;else{if(H)G.push(-5),H=void 0;if(K<F)G.push(Q.slice(K,F)),$+=F-K;switch(W){case 0:{G.push(65533),$++;break}case 9:{Y=Math.ceil($/4)*4,G.push(-2);while($++<Y)G.push(-1);break}case 10:{G.push(-4),$=1;break}default:H=!0,$=1}}K=F+1}if(z){if(H)G.push(-5);if(Z)G.push(Z);G.push(null)}return G}}var WJ0=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function gm($){return $.replace(WJ0,qJ0)}function qJ0($,Z,J){if(Z)return Z;if(J.charCodeAt(0)===35){let B=J.charCodeAt(1),Q=B===120||B===88;return mF(J.slice(Q?2:1),Q?16:10)}return HH(J)||$}var mm={}.hasOwnProperty;function wM($,Z,J){if(Z&&typeof Z==="object")J=Z,Z=void 0;return NJ0(J)(EM(CM(J).document().write(bM()($,Z,!0))))}function NJ0($){let Z={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:Q(e),autolinkProtocol:b,autolinkEmail:b,atxHeading:Q(D0),blockQuote:Q(J0),characterEscape:b,characterReference:b,codeFenced:Q(U0),codeFencedFenceInfo:X,codeFencedFenceMeta:X,codeIndented:Q(U0,X),codeText:Q(z0,X),codeTextData:b,data:b,codeFlowValue:b,definition:Q(B0),definitionDestinationString:X,definitionLabelString:X,definitionTitleString:X,emphasis:Q(N0),hardBreakEscape:Q(F0),hardBreakTrailing:Q(F0),htmlFlow:Q(s,X),htmlFlowData:b,htmlText:Q(s,X),htmlTextData:b,image:Q(a),label:X,link:Q(e),listItem:Q(Q0),listItemValue:F,listOrdered:Q($0,K),listUnordered:Q($0),paragraph:Q(_0),reference:h,referenceString:X,resourceDestinationString:X,resourceTitleString:X,setextHeading:Q(D0),strong:Q(M0),thematicBreak:Q(L0)},exit:{atxHeading:G(),atxHeadingSequence:M,autolink:G(),autolinkEmail:Z0,autolinkProtocol:n,blockQuote:G(),characterEscapeValue:C,characterReferenceMarkerHexadecimal:o,characterReferenceMarkerNumeric:o,characterReferenceValue:p,characterReference:i,codeFenced:G(D),codeFencedFence:N,codeFencedFenceInfo:W,codeFencedFenceMeta:q,codeFlowValue:C,codeIndented:G(A),codeText:G(y),codeTextData:C,data:C,definition:G(),definitionDestinationString:j,definitionLabelString:V,definitionTitleString:L,emphasis:G(),hardBreakEscape:G(S),hardBreakTrailing:G(S),htmlFlow:G(R),htmlFlowData:C,htmlText:G(O),htmlTextData:C,image:G(x),label:g,labelText:v,lineEnding:k,link:G(I),listItem:G(),listOrdered:G(),listUnordered:G(),paragraph:G(),referenceString:d,resourceDestinationString:E,resourceTitleString:l,resource:r,setextHeading:G(T),setextHeadingLineSequence:w,setextHeadingText:_,strong:G(),thematicBreak:G()}};um(Z,($||{}).mdastExtensions||[]);let J={};return H;function H(f){let u={type:"root",children:[]},t={stack:[u],tokenStack:[],config:Z,enter:z,exit:U,buffer:X,resume:Y,data:J},W0=[],S0=-1;while(++S0<f.length)if(f[S0][1].type==="listOrdered"||f[S0][1].type==="listUnordered")if(f[S0][0]==="enter")W0.push(S0);else{let p0=W0.pop();S0=B(f,p0,S0)}S0=-1;while(++S0<f.length){let p0=Z[f[S0][0]];if(mm.call(p0,f[S0][1].type))p0[f[S0][1].type].call(Object.assign({sliceSerialize:f[S0][2].sliceSerialize},t),f[S0][1])}if(t.tokenStack.length>0){let p0=t.tokenStack[t.tokenStack.length-1];(p0[1]||fm).call(t,void 0,p0[0])}u.position={start:V7(f.length>0?f[0][1].start:{line:1,column:1,offset:0}),end:V7(f.length>0?f[f.length-2][1].end:{line:1,column:1,offset:0})},S0=-1;while(++S0<Z.transforms.length)u=Z.transforms[S0](u)||u;return u}function B(f,u,t){let W0=u-1,S0=-1,p0=!1,g0,T0,d0,Q1;while(++W0<=t){let e0=f[W0];switch(e0[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{if(e0[0]==="enter")S0++;else S0--;Q1=void 0;break}case"lineEndingBlank":{if(e0[0]==="enter"){if(g0&&!Q1&&!S0&&!d0)d0=W0;Q1=void 0}break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Q1=void 0}if(!S0&&e0[0]==="enter"&&e0[1].type==="listItemPrefix"||S0===-1&&e0[0]==="exit"&&(e0[1].type==="listUnordered"||e0[1].type==="listOrdered")){if(g0){let c0=W0;T0=void 0;while(c0--){let y0=f[c0];if(y0[1].type==="lineEnding"||y0[1].type==="lineEndingBlank"){if(y0[0]==="exit")continue;if(T0)f[T0][1].type="lineEndingBlank",p0=!0;y0[1].type="lineEnding",T0=c0}else if(y0[1].type==="linePrefix"||y0[1].type==="blockQuotePrefix"||y0[1].type==="blockQuotePrefixWhitespace"||y0[1].type==="blockQuoteMarker"||y0[1].type==="listItemIndent");else break}if(d0&&(!T0||d0<T0))g0._spread=!0;g0.end=Object.assign({},T0?f[T0][1].start:e0[1].end),f.splice(T0||W0,0,["exit",g0,e0[2]]),W0++,t++}if(e0[1].type==="listItemPrefix"){let c0={type:"listItem",_spread:!1,start:Object.assign({},e0[1].start),end:void 0};g0=c0,f.splice(W0,0,["enter",c0,e0[2]]),W0++,t++,d0=void 0,Q1=!0}}}return f[u][1]._spread=p0,t}function Q(f,u){return t;function t(W0){if(z.call(this,f(W0),W0),u)u.call(this,W0)}}function X(){this.stack.push({type:"fragment",children:[]})}function z(f,u,t){this.stack[this.stack.length-1].children.push(f),this.stack.push(f),this.tokenStack.push([u,t||void 0]),f.position={start:V7(u.start),end:void 0}}function G(f){return u;function u(t){if(f)f.call(this,t);U.call(this,t)}}function U(f,u){let t=this.stack.pop(),W0=this.tokenStack.pop();if(!W0)throw Error("Cannot close `"+f.type+"` ("+N7({start:f.start,end:f.end})+"): it’s not open");else if(W0[0].type!==f.type)if(u)u.call(this,f,W0[0]);else(W0[1]||fm).call(this,f,W0[0]);t.position.end=V7(f.end)}function Y(){return c$(this.stack.pop())}function K(){this.data.expectingFirstListItemValue=!0}function F(f){if(this.data.expectingFirstListItemValue){let u=this.stack[this.stack.length-2];u.start=Number.parseInt(this.sliceSerialize(f),10),this.data.expectingFirstListItemValue=void 0}}function W(){let f=this.resume(),u=this.stack[this.stack.length-1];u.lang=f}function q(){let f=this.resume(),u=this.stack[this.stack.length-1];u.meta=f}function N(){if(this.data.flowCodeInside)return;this.buffer(),this.data.flowCodeInside=!0}function D(){let f=this.resume(),u=this.stack[this.stack.length-1];u.value=f.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function A(){let f=this.resume(),u=this.stack[this.stack.length-1];u.value=f.replace(/(\r?\n|\r)$/g,"")}function V(f){let u=this.resume(),t=this.stack[this.stack.length-1];t.label=u,t.identifier=q4(this.sliceSerialize(f)).toLowerCase()}function L(){let f=this.resume(),u=this.stack[this.stack.length-1];u.title=f}function j(){let f=this.resume(),u=this.stack[this.stack.length-1];u.url=f}function M(f){let u=this.stack[this.stack.length-1];if(!u.depth){let t=this.sliceSerialize(f).length;u.depth=t}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function w(f){let u=this.stack[this.stack.length-1];u.depth=this.sliceSerialize(f).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function b(f){let t=this.stack[this.stack.length-1].children,W0=t[t.length-1];if(!W0||W0.type!=="text")W0=A0(),W0.position={start:V7(f.start),end:void 0},t.push(W0);this.stack.push(W0)}function C(f){let u=this.stack.pop();u.value+=this.sliceSerialize(f),u.position.end=V7(f.end)}function k(f){let u=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=u.children[u.children.length-1];t.position.end=V7(f.end),this.data.atHardBreak=void 0;return}if(!this.data.setextHeadingSlurpLineEnding&&Z.canContainEols.includes(u.type))b.call(this,f),C.call(this,f)}function S(){this.data.atHardBreak=!0}function R(){let f=this.resume(),u=this.stack[this.stack.length-1];u.value=f}function O(){let f=this.resume(),u=this.stack[this.stack.length-1];u.value=f}function y(){let f=this.resume(),u=this.stack[this.stack.length-1];u.value=f}function I(){let f=this.stack[this.stack.length-1];if(this.data.inReference){let u=this.data.referenceType||"shortcut";f.type+="Reference",f.referenceType=u,delete f.url,delete f.title}else delete f.identifier,delete f.label;this.data.referenceType=void 0}function x(){let f=this.stack[this.stack.length-1];if(this.data.inReference){let u=this.data.referenceType||"shortcut";f.type+="Reference",f.referenceType=u,delete f.url,delete f.title}else delete f.identifier,delete f.label;this.data.referenceType=void 0}function v(f){let u=this.sliceSerialize(f),t=this.stack[this.stack.length-2];t.label=gm(u),t.identifier=q4(u).toLowerCase()}function g(){let f=this.stack[this.stack.length-1],u=this.resume(),t=this.stack[this.stack.length-1];if(this.data.inReference=!0,t.type==="link"){let W0=f.children;t.children=W0}else t.alt=u}function E(){let f=this.resume(),u=this.stack[this.stack.length-1];u.url=f}function l(){let f=this.resume(),u=this.stack[this.stack.length-1];u.title=f}function r(){this.data.inReference=void 0}function h(){this.data.referenceType="collapsed"}function d(f){let u=this.resume(),t=this.stack[this.stack.length-1];t.label=u,t.identifier=q4(this.sliceSerialize(f)).toLowerCase(),this.data.referenceType="full"}function o(f){this.data.characterReferenceType=f.type}function p(f){let u=this.sliceSerialize(f),t=this.data.characterReferenceType,W0;if(t)W0=mF(u,t==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0;else W0=HH(u);let S0=this.stack[this.stack.length-1];S0.value+=W0}function i(f){let u=this.stack.pop();u.position.end=V7(f.end)}function n(f){C.call(this,f);let u=this.stack[this.stack.length-1];u.url=this.sliceSerialize(f)}function Z0(f){C.call(this,f);let u=this.stack[this.stack.length-1];u.url="mailto:"+this.sliceSerialize(f)}function J0(){return{type:"blockquote",children:[]}}function U0(){return{type:"code",lang:null,meta:null,value:""}}function z0(){return{type:"inlineCode",value:""}}function B0(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function N0(){return{type:"emphasis",children:[]}}function D0(){return{type:"heading",depth:0,children:[]}}function F0(){return{type:"break"}}function s(){return{type:"html",value:""}}function a(){return{type:"image",title:null,url:"",alt:null}}function e(){return{type:"link",title:null,url:"",children:[]}}function $0(f){return{type:"list",ordered:f.type==="listOrdered",start:null,spread:f._spread,children:[]}}function Q0(f){return{type:"listItem",spread:f._spread,checked:null,children:[]}}function _0(){return{type:"paragraph",children:[]}}function M0(){return{type:"strong",children:[]}}function A0(){return{type:"text",value:""}}function L0(){return{type:"thematicBreak"}}}function V7($){return{line:$.line,column:$.column,offset:$.offset}}function um($,Z){let J=-1;while(++J<Z.length){let H=Z[J];if(Array.isArray(H))um($,H);else AJ0($,H)}}function AJ0($,Z){let J;for(J in Z)if(mm.call(Z,J))switch(J){case"canContainEols":{let H=Z[J];if(H)$[J].push(...H);break}case"transforms":{let H=Z[J];if(H)$[J].push(...H);break}case"enter":case"exit":{let H=Z[J];if(H)Object.assign($[J],H);break}}}function fm($,Z){if($)throw Error("Cannot close `"+$.type+"` ("+N7({start:$.start,end:$.end})+"): a different token (`"+Z.type+"`, "+N7({start:Z.start,end:Z.end})+") is open");else throw Error("Cannot close document, a token (`"+Z.type+"`, "+N7({start:Z.start,end:Z.end})+") is still open")}function nF($){let Z=this;Z.parser=J;function J(H){return wM(H,{...Z.data("settings"),...$,extensions:Z.data("micromarkExtensions")||[],mdastExtensions:Z.data("fromMarkdownExtensions")||[]})}}var sF=-1,BH=0,o$=1,QH=2,eQ=3,$X=4,ZX=5,JX=6,tF=7,eF=8;var pm=typeof self==="object"?self:globalThis,DJ0=($,Z)=>{let J=(B,Q)=>{return $.set(Q,B),B},H=(B)=>{if($.has(B))return $.get(B);let[Q,X]=Z[B];switch(Q){case BH:case sF:return J(X,B);case o$:{let z=J([],B);for(let G of X)z.push(H(G));return z}case QH:{let z=J({},B);for(let[G,U]of X)z[H(G)]=H(U);return z}case eQ:return J(new Date(X),B);case $X:{let{source:z,flags:G}=X;return J(new RegExp(z,G),B)}case ZX:{let z=J(new Map,B);for(let[G,U]of X)z.set(H(G),H(U));return z}case JX:{let z=J(new Set,B);for(let G of X)z.add(H(G));return z}case tF:{let{name:z,message:G}=X;return J(new pm[z](G),B)}case eF:return J(BigInt(X),B);case"BigInt":return J(Object(BigInt(X)),B);case"ArrayBuffer":return J(new Uint8Array(X).buffer,X);case"DataView":{let{buffer:z}=new Uint8Array(X);return J(new DataView(z),X)}}return J(new pm[Q](X),B)};return H},SM=($)=>DJ0(new Map,$)(0);var XH="",{toString:VJ0}={},{keys:LJ0}=Object,HX=($)=>{let Z=typeof $;if(Z!=="object"||!$)return[BH,Z];let J=VJ0.call($).slice(8,-1);switch(J){case"Array":return[o$,XH];case"Object":return[QH,XH];case"Date":return[eQ,XH];case"RegExp":return[$X,XH];case"Map":return[ZX,XH];case"Set":return[JX,XH];case"DataView":return[o$,J]}if(J.includes("Array"))return[o$,J];if(J.includes("Error"))return[tF,J];return[QH,J]},$W=([$,Z])=>$===BH&&(Z==="function"||Z==="symbol"),MJ0=($,Z,J,H)=>{let B=(X,z)=>{let G=H.push(X)-1;return J.set(z,G),G},Q=(X)=>{if(J.has(X))return J.get(X);let[z,G]=HX(X);switch(z){case BH:{let Y=X;switch(G){case"bigint":z=eF,Y=X.toString();break;case"function":case"symbol":if($)throw TypeError("unable to serialize "+G);Y=null;break;case"undefined":return B([sF],X)}return B([z,Y],X)}case o$:{if(G){let F=X;if(G==="DataView")F=new Uint8Array(X.buffer);else if(G==="ArrayBuffer")F=new Uint8Array(X);return B([G,[...F]],X)}let Y=[],K=B([z,Y],X);for(let F of X)Y.push(Q(F));return K}case QH:{if(G)switch(G){case"BigInt":return B([G,X.toString()],X);case"Boolean":case"Number":case"String":return B([G,X.valueOf()],X)}if(Z&&"toJSON"in X)return Q(X.toJSON());let Y=[],K=B([z,Y],X);for(let F of LJ0(X))if($||!$W(HX(X[F])))Y.push([Q(F),Q(X[F])]);return K}case eQ:return B([z,X.toISOString()],X);case $X:{let{source:Y,flags:K}=X;return B([z,{source:Y,flags:K}],X)}case ZX:{let Y=[],K=B([z,Y],X);for(let[F,W]of X)if($||!($W(HX(F))||$W(HX(W))))Y.push([Q(F),Q(W)]);return K}case JX:{let Y=[],K=B([z,Y],X);for(let F of X)if($||!$W(HX(F)))Y.push(Q(F));return K}}let{message:U}=X;return B([z,{name:G,message:U}],X)};return Q},RM=($,{json:Z,lossy:J}={})=>{let H=[];return MJ0(!(Z||J),!!Z,new Map,H)($),H};var zH=typeof structuredClone==="function"?($,Z)=>Z&&(("json"in Z)||("lossy"in Z))?SM(RM($,Z)):structuredClone($):($,Z)=>SM(RM($,Z));function PJ0($,Z){let J=[{type:"text",value:"↩"}];if(Z>1)J.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(Z)}]});return J}function _J0($,Z){return"Back to reference "+($+1)+(Z>1?"-"+Z:"")}function cm($){let Z=typeof $.options.clobberPrefix==="string"?$.options.clobberPrefix:"user-content-",J=$.options.footnoteBackContent||PJ0,H=$.options.footnoteBackLabel||_J0,B=$.options.footnoteLabel||"Footnotes",Q=$.options.footnoteLabelTagName||"h2",X=$.options.footnoteLabelProperties||{className:["sr-only"]},z=[],G=-1;while(++G<$.footnoteOrder.length){let U=$.footnoteById.get($.footnoteOrder[G]);if(!U)continue;let Y=$.all(U),K=String(U.identifier).toUpperCase(),F=p8(K.toLowerCase()),W=0,q=[],N=$.footnoteCounts.get(K);while(N!==void 0&&++W<=N){if(q.length>0)q.push({type:"text",value:" "});let V=typeof J==="string"?J:J(G,W);if(typeof V==="string")V={type:"text",value:V};q.push({type:"element",tagName:"a",properties:{href:"#"+Z+"fnref-"+F+(W>1?"-"+W:""),dataFootnoteBackref:"",ariaLabel:typeof H==="string"?H:H(G,W),className:["data-footnote-backref"]},children:Array.isArray(V)?V:[V]})}let D=Y[Y.length-1];if(D&&D.type==="element"&&D.tagName==="p"){let V=D.children[D.children.length-1];if(V&&V.type==="text")V.value+=" ";else D.children.push({type:"text",value:" "});D.children.push(...q)}else Y.push(...q);let A={type:"element",tagName:"li",properties:{id:Z+"fn-"+F},children:$.wrap(Y,!0)};$.patch(U,A),z.push(A)}if(z.length===0)return;return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:Q,properties:{...zH(X),id:"footnote-label"},children:[{type:"text",value:B}]},{type:"text",value:`
21
- `},{type:"element",tagName:"ol",properties:{},children:$.wrap(z,!0)},{type:"text",value:`
22
- `}]}}var z3=function($){if($===null||$===void 0)return CJ0;if(typeof $==="function")return ZW($);if(typeof $==="object")return Array.isArray($)?jJ0($):OJ0($);if(typeof $==="string")return TJ0($);throw Error("Expected function, string, or object as test")};function jJ0($){let Z=[],J=-1;while(++J<$.length)Z[J]=z3($[J]);return ZW(H);function H(...B){let Q=-1;while(++Q<Z.length)if(Z[Q].apply(this,B))return!0;return!1}}function OJ0($){let Z=$;return ZW(J);function J(H){let B=H,Q;for(Q in $)if(B[Q]!==Z[Q])return!1;return!0}}function TJ0($){return ZW(Z);function Z(J){return J&&J.type===$}}function ZW($){return Z;function Z(J,H,B){return Boolean(EJ0(J)&&$.call(this,J,typeof H==="number"?H:void 0,B||void 0))}}function CJ0(){return!0}function EJ0($){return $!==null&&typeof $==="object"&&"type"in $}function dm($){return $}var lm=[],JW=!0,n$=!1,HW="skip";function BX($,Z,J,H){let B;if(typeof Z==="function"&&typeof J!=="function")H=J,J=Z;else B=Z;let Q=z3(B),X=H?-1:1;z($,void 0,[])();function z(G,U,Y){let K=G&&typeof G==="object"?G:{};if(typeof K.type==="string"){let W=typeof K.tagName==="string"?K.tagName:typeof K.name==="string"?K.name:void 0;Object.defineProperty(F,"name",{value:"node ("+dm(G.type+(W?"<"+W+">":""))+")"})}return F;function F(){let W=lm,q,N,D;if(!Z||Q(G,U,Y[Y.length-1]||void 0)){if(W=bJ0(J(G,Y)),W[0]===n$)return W}if("children"in G&&G.children){let A=G;if(A.children&&W[0]!==HW){N=(H?A.children.length:-1)+X,D=Y.concat(A);while(N>-1&&N<A.children.length){let V=A.children[N];if(q=z(V,N,D)(),q[0]===n$)return q;N=typeof q[1]==="number"?q[1]:N+X}}}return W}}}function bJ0($){if(Array.isArray($))return $;if(typeof $==="number")return[JW,$];return $===null||$===void 0?lm:[$]}function m3($,Z,J,H){let B,Q,X;if(typeof Z==="function"&&typeof J!=="function")Q=void 0,X=Z,B=J;else Q=Z,X=J,B=H;BX($,Q,z,B);function z(G,U){let Y=U[U.length-1],K=Y?Y.children.indexOf(G):void 0;return X(G,K,Y)}}function im($,Z){let J={type:"element",tagName:"blockquote",properties:{},children:$.wrap($.all(Z),!0)};return $.patch(Z,J),$.applyData(Z,J)}function rm($,Z){let J={type:"element",tagName:"br",properties:{},children:[]};return $.patch(Z,J),[$.applyData(Z,J),{type:"text",value:`
23
- `}]}function am($,Z){let J=Z.value?Z.value+`
24
- `:"",H={},B=Z.lang?Z.lang.split(/\s+/):[];if(B.length>0)H.className=["language-"+B[0]];let Q={type:"element",tagName:"code",properties:H,children:[{type:"text",value:J}]};if(Z.meta)Q.data={meta:Z.meta};return $.patch(Z,Q),Q=$.applyData(Z,Q),Q={type:"element",tagName:"pre",properties:{},children:[Q]},$.patch(Z,Q),Q}function om($,Z){let J={type:"element",tagName:"del",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function nm($,Z){let J={type:"element",tagName:"em",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function sm($,Z){let J=typeof $.options.clobberPrefix==="string"?$.options.clobberPrefix:"user-content-",H=String(Z.identifier).toUpperCase(),B=p8(H.toLowerCase()),Q=$.footnoteOrder.indexOf(H),X,z=$.footnoteCounts.get(H);if(z===void 0)z=0,$.footnoteOrder.push(H),X=$.footnoteOrder.length;else X=Q+1;z+=1,$.footnoteCounts.set(H,z);let G={type:"element",tagName:"a",properties:{href:"#"+J+"fn-"+B,id:J+"fnref-"+B+(z>1?"-"+z:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(X)}]};$.patch(Z,G);let U={type:"element",tagName:"sup",properties:{},children:[G]};return $.patch(Z,U),$.applyData(Z,U)}function tm($,Z){let J={type:"element",tagName:"h"+Z.depth,properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function em($,Z){if($.options.allowDangerousHtml){let J={type:"raw",value:Z.value};return $.patch(Z,J),$.applyData(Z,J)}return}function BW($,Z){let J=Z.referenceType,H="]";if(J==="collapsed")H+="[]";else if(J==="full")H+="["+(Z.label||Z.identifier)+"]";if(Z.type==="imageReference")return[{type:"text",value:"!["+Z.alt+H}];let B=$.all(Z),Q=B[0];if(Q&&Q.type==="text")Q.value="["+Q.value;else B.unshift({type:"text",value:"["});let X=B[B.length-1];if(X&&X.type==="text")X.value+=H;else B.push({type:"text",value:H});return B}function $u($,Z){let J=String(Z.identifier).toUpperCase(),H=$.definitionById.get(J);if(!H)return BW($,Z);let B={src:p8(H.url||""),alt:Z.alt};if(H.title!==null&&H.title!==void 0)B.title=H.title;let Q={type:"element",tagName:"img",properties:B,children:[]};return $.patch(Z,Q),$.applyData(Z,Q)}function Zu($,Z){let J={src:p8(Z.url)};if(Z.alt!==null&&Z.alt!==void 0)J.alt=Z.alt;if(Z.title!==null&&Z.title!==void 0)J.title=Z.title;let H={type:"element",tagName:"img",properties:J,children:[]};return $.patch(Z,H),$.applyData(Z,H)}function Ju($,Z){let J={type:"text",value:Z.value.replace(/\r?\n|\r/g," ")};$.patch(Z,J);let H={type:"element",tagName:"code",properties:{},children:[J]};return $.patch(Z,H),$.applyData(Z,H)}function Hu($,Z){let J=String(Z.identifier).toUpperCase(),H=$.definitionById.get(J);if(!H)return BW($,Z);let B={href:p8(H.url||"")};if(H.title!==null&&H.title!==void 0)B.title=H.title;let Q={type:"element",tagName:"a",properties:B,children:$.all(Z)};return $.patch(Z,Q),$.applyData(Z,Q)}function Bu($,Z){let J={href:p8(Z.url)};if(Z.title!==null&&Z.title!==void 0)J.title=Z.title;let H={type:"element",tagName:"a",properties:J,children:$.all(Z)};return $.patch(Z,H),$.applyData(Z,H)}function Qu($,Z,J){let H=$.all(Z),B=J?wJ0(J):Xu(Z),Q={},X=[];if(typeof Z.checked==="boolean"){let Y=H[0],K;if(Y&&Y.type==="element"&&Y.tagName==="p")K=Y;else K={type:"element",tagName:"p",properties:{},children:[]},H.unshift(K);if(K.children.length>0)K.children.unshift({type:"text",value:" "});K.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:Z.checked,disabled:!0},children:[]}),Q.className=["task-list-item"]}let z=-1;while(++z<H.length){let Y=H[z];if(B||z!==0||Y.type!=="element"||Y.tagName!=="p")X.push({type:"text",value:`
25
- `});if(Y.type==="element"&&Y.tagName==="p"&&!B)X.push(...Y.children);else X.push(Y)}let G=H[H.length-1];if(G&&(B||G.type!=="element"||G.tagName!=="p"))X.push({type:"text",value:`
26
- `});let U={type:"element",tagName:"li",properties:Q,children:X};return $.patch(Z,U),$.applyData(Z,U)}function wJ0($){let Z=!1;if($.type==="list"){Z=$.spread||!1;let J=$.children,H=-1;while(!Z&&++H<J.length)Z=Xu(J[H])}return Z}function Xu($){let Z=$.spread;return Z===null||Z===void 0?$.children.length>1:Z}function zu($,Z){let J={},H=$.all(Z),B=-1;if(typeof Z.start==="number"&&Z.start!==1)J.start=Z.start;while(++B<H.length){let X=H[B];if(X.type==="element"&&X.tagName==="li"&&X.properties&&Array.isArray(X.properties.className)&&X.properties.className.includes("task-list-item")){J.className=["contains-task-list"];break}}let Q={type:"element",tagName:Z.ordered?"ol":"ul",properties:J,children:$.wrap(H,!0)};return $.patch(Z,Q),$.applyData(Z,Q)}function Gu($,Z){let J={type:"element",tagName:"p",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function Uu($,Z){let J={type:"root",children:$.wrap($.all(Z))};return $.patch(Z,J),$.applyData(Z,J)}function Yu($,Z){let J={type:"element",tagName:"strong",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function Ku($,Z){let J=$.all(Z),H=J.shift(),B=[];if(H){let X={type:"element",tagName:"thead",properties:{},children:$.wrap([H],!0)};$.patch(Z.children[0],X),B.push(X)}if(J.length>0){let X={type:"element",tagName:"tbody",properties:{},children:$.wrap(J,!0)},z=JH(Z.children[1]),G=gF(Z.children[Z.children.length-1]);if(z&&G)X.position={start:z,end:G};B.push(X)}let Q={type:"element",tagName:"table",properties:{},children:$.wrap(B,!0)};return $.patch(Z,Q),$.applyData(Z,Q)}function Fu($,Z,J){let H=J?J.children:void 0,Q=(H?H.indexOf(Z):1)===0?"th":"td",X=J&&J.type==="table"?J.align:void 0,z=X?X.length:Z.children.length,G=-1,U=[];while(++G<z){let K=Z.children[G],F={},W=X?X[G]:void 0;if(W)F.align=W;let q={type:"element",tagName:Q,properties:F,children:[]};if(K)q.children=$.all(K),$.patch(K,q),q=$.applyData(K,q);U.push(q)}let Y={type:"element",tagName:"tr",properties:{},children:$.wrap(U,!0)};return $.patch(Z,Y),$.applyData(Z,Y)}function Wu($,Z){let J={type:"element",tagName:"td",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function Nu($){let Z=String($),J=/\r?\n|\r/g,H=J.exec(Z),B=0,Q=[];while(H)Q.push(qu(Z.slice(B,H.index),B>0,!0),H[0]),B=H.index+H[0].length,H=J.exec(Z);return Q.push(qu(Z.slice(B),B>0,!1)),Q.join("")}function qu($,Z,J){let H=0,B=$.length;if(Z){let Q=$.codePointAt(H);while(Q===9||Q===32)H++,Q=$.codePointAt(H)}if(J){let Q=$.codePointAt(B-1);while(Q===9||Q===32)B--,Q=$.codePointAt(B-1)}return B>H?$.slice(H,B):""}function Au($,Z){let J={type:"text",value:Nu(String(Z.value))};return $.patch(Z,J),$.applyData(Z,J)}function Du($,Z){let J={type:"element",tagName:"hr",properties:{},children:[]};return $.patch(Z,J),$.applyData(Z,J)}var Vu={blockquote:im,break:rm,code:am,delete:om,emphasis:nm,footnoteReference:sm,heading:tm,html:em,imageReference:$u,image:Zu,inlineCode:Ju,linkReference:Hu,link:Bu,listItem:Qu,list:zu,paragraph:Gu,root:Uu,strong:Yu,table:Ku,tableCell:Wu,tableRow:Fu,text:Au,thematicBreak:Du,toml:QW,yaml:QW,definition:QW,footnoteDefinition:QW};function QW(){return}var kM={}.hasOwnProperty,SJ0={};function Mu($,Z){let J=Z||SJ0,H=new Map,B=new Map,Q=new Map,X={...Vu,...J.handlers},z={all:U,applyData:kJ0,definitionById:H,footnoteById:B,footnoteCounts:Q,footnoteOrder:[],handlers:X,one:G,options:J,patch:RJ0,wrap:yJ0};return m3($,function(Y){if(Y.type==="definition"||Y.type==="footnoteDefinition"){let K=Y.type==="definition"?H:B,F=String(Y.identifier).toUpperCase();if(!K.has(F))K.set(F,Y)}}),z;function G(Y,K){let F=Y.type,W=z.handlers[F];if(kM.call(z.handlers,F)&&W)return W(z,Y,K);if(z.options.passThrough&&z.options.passThrough.includes(F)){if("children"in Y){let{children:N,...D}=Y,A=zH(D);return A.children=z.all(Y),A}return zH(Y)}return(z.options.unknownHandler||IJ0)(z,Y,K)}function U(Y){let K=[];if("children"in Y){let F=Y.children,W=-1;while(++W<F.length){let q=z.one(F[W],Y);if(q){if(W&&F[W-1].type==="break"){if(!Array.isArray(q)&&q.type==="text")q.value=Lu(q.value);if(!Array.isArray(q)&&q.type==="element"){let N=q.children[0];if(N&&N.type==="text")N.value=Lu(N.value)}}if(Array.isArray(q))K.push(...q);else K.push(q)}}}return K}}function RJ0($,Z){if($.position)Z.position=zM($)}function kJ0($,Z){let J=Z;if($&&$.data){let H=$.data.hName,B=$.data.hChildren,Q=$.data.hProperties;if(typeof H==="string")if(J.type==="element")J.tagName=H;else{let X="children"in J?J.children:[J];J={type:"element",tagName:H,properties:{},children:X}}if(J.type==="element"&&Q)Object.assign(J.properties,zH(Q));if("children"in J&&J.children&&B!==null&&B!==void 0)J.children=B}return J}function IJ0($,Z){let J=Z.data||{},H="value"in Z&&!(kM.call(J,"hProperties")||kM.call(J,"hChildren"))?{type:"text",value:Z.value}:{type:"element",tagName:"div",properties:{},children:$.all(Z)};return $.patch(Z,H),$.applyData(Z,H)}function yJ0($,Z){let J=[],H=-1;if(Z)J.push({type:"text",value:`
27
- `});while(++H<$.length){if(H)J.push({type:"text",value:`
28
- `});J.push($[H])}if(Z&&$.length>0)J.push({type:"text",value:`
29
- `});return J}function Lu($){let Z=0,J=$.charCodeAt(Z);while(J===9||J===32)Z++,J=$.charCodeAt(Z);return $.slice(Z)}function XW($,Z){let J=Mu($,Z),H=J.one($,void 0),B=cm(J),Q=Array.isArray(H)?{type:"root",children:H}:H||{type:"root",children:[]};if(B)B5("children"in Q),Q.children.push({type:"text",value:`
30
- `},B);return Q}function zW($,Z){if($&&"run"in $)return async function(J,H){let B=XW(J,{file:H,...Z});await $.run(B,H)};return function(J,H){return XW(J,{file:H,...$||Z})}}function IM($){if($)throw $}var YW=P(wu(),1);function QX($){if(typeof $!=="object"||$===null)return!1;let Z=Object.getPrototypeOf($);return(Z===null||Z===Object.prototype||Object.getPrototypeOf(Z)===null)&&!(Symbol.toStringTag in $)&&!(Symbol.iterator in $)}function yM(){let $=[],Z={run:J,use:H};return Z;function J(...B){let Q=-1,X=B.pop();if(typeof X!=="function")throw TypeError("Expected function as last argument, not "+X);z(null,...B);function z(G,...U){let Y=$[++Q],K=-1;if(G){X(G);return}while(++K<B.length)if(U[K]===null||U[K]===void 0)U[K]=B[K];if(B=U,Y)Su(Y,z)(...U);else X(null,...U)}}function H(B){if(typeof B!=="function")throw TypeError("Expected `middelware` to be a function, not "+B);return $.push(B),Z}}function Su($,Z){let J;return H;function H(...X){let z=$.length>X.length,G;if(z)X.push(B);try{G=$.apply(this,X)}catch(U){let Y=U;if(z&&J)throw Y;return B(Y)}if(!z)if(G&&G.then&&typeof G.then==="function")G.then(Q,B);else if(G instanceof Error)B(G);else Q(G)}function B(X,...z){if(!J)J=!0,Z(X,...z)}function Q(X){B(null,X)}}var G9={basename:xJ0,dirname:hJ0,extname:vJ0,join:gJ0,sep:"/"};function xJ0($,Z){if(Z!==void 0&&typeof Z!=="string")throw TypeError('"ext" argument must be a string');XX($);let J=0,H=-1,B=$.length,Q;if(Z===void 0||Z.length===0||Z.length>$.length){while(B--)if($.codePointAt(B)===47){if(Q){J=B+1;break}}else if(H<0)Q=!0,H=B+1;return H<0?"":$.slice(J,H)}if(Z===$)return"";let X=-1,z=Z.length-1;while(B--)if($.codePointAt(B)===47){if(Q){J=B+1;break}}else{if(X<0)Q=!0,X=B+1;if(z>-1)if($.codePointAt(B)===Z.codePointAt(z--)){if(z<0)H=B}else z=-1,H=X}if(J===H)H=X;else if(H<0)H=$.length;return $.slice(J,H)}function hJ0($){if(XX($),$.length===0)return".";let Z=-1,J=$.length,H;while(--J)if($.codePointAt(J)===47){if(H){Z=J;break}}else if(!H)H=!0;return Z<0?$.codePointAt(0)===47?"/":".":Z===1&&$.codePointAt(0)===47?"//":$.slice(0,Z)}function vJ0($){XX($);let Z=$.length,J=-1,H=0,B=-1,Q=0,X;while(Z--){let z=$.codePointAt(Z);if(z===47){if(X){H=Z+1;break}continue}if(J<0)X=!0,J=Z+1;if(z===46){if(B<0)B=Z;else if(Q!==1)Q=1}else if(B>-1)Q=-1}if(B<0||J<0||Q===0||Q===1&&B===J-1&&B===H+1)return"";return $.slice(B,J)}function gJ0(...$){let Z=-1,J;while(++Z<$.length)if(XX($[Z]),$[Z])J=J===void 0?$[Z]:J+"/"+$[Z];return J===void 0?".":fJ0(J)}function fJ0($){XX($);let Z=$.codePointAt(0)===47,J=mJ0($,!Z);if(J.length===0&&!Z)J=".";if(J.length>0&&$.codePointAt($.length-1)===47)J+="/";return Z?"/"+J:J}function mJ0($,Z){let J="",H=0,B=-1,Q=0,X=-1,z,G;while(++X<=$.length){if(X<$.length)z=$.codePointAt(X);else if(z===47)break;else z=47;if(z===47){if(B===X-1||Q===1);else if(B!==X-1&&Q===2){if(J.length<2||H!==2||J.codePointAt(J.length-1)!==46||J.codePointAt(J.length-2)!==46){if(J.length>2){if(G=J.lastIndexOf("/"),G!==J.length-1){if(G<0)J="",H=0;else J=J.slice(0,G),H=J.length-1-J.lastIndexOf("/");B=X,Q=0;continue}}else if(J.length>0){J="",H=0,B=X,Q=0;continue}}if(Z)J=J.length>0?J+"/..":"..",H=2}else{if(J.length>0)J+="/"+$.slice(B+1,X);else J=$.slice(B+1,X);H=X-B-1}B=X,Q=0}else if(z===46&&Q>-1)Q++;else Q=-1}return J}function XX($){if(typeof $!=="string")throw TypeError("Path must be a string. Received "+JSON.stringify($))}var Ru={cwd:uJ0};function uJ0(){return"/"}function GH($){return Boolean($!==null&&typeof $==="object"&&"href"in $&&$.href&&"protocol"in $&&$.protocol&&$.auth===void 0)}function ku($){if(typeof $==="string")$=new URL($);else if(!GH($)){let Z=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+$+"`");throw Z.code="ERR_INVALID_ARG_TYPE",Z}if($.protocol!=="file:"){let Z=TypeError("The URL must be of scheme file");throw Z.code="ERR_INVALID_URL_SCHEME",Z}return pJ0($)}function pJ0($){if($.hostname!==""){let H=TypeError('File URL host must be "localhost" or empty on darwin');throw H.code="ERR_INVALID_FILE_URL_HOST",H}let Z=$.pathname,J=-1;while(++J<Z.length)if(Z.codePointAt(J)===37&&Z.codePointAt(J+1)===50){let H=Z.codePointAt(J+2);if(H===70||H===102){let B=TypeError("File URL path must not include encoded / characters");throw B.code="ERR_INVALID_FILE_URL_PATH",B}}return decodeURIComponent(Z)}var xM=["history","path","basename","stem","extname","dirname"];class UH{constructor($){let Z;if(!$)Z={};else if(GH($))Z={path:$};else if(typeof $==="string"||cJ0($))Z={value:$};else Z=$;this.cwd="cwd"in Z?"":Ru.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let J=-1;while(++J<xM.length){let B=xM[J];if(B in Z&&Z[B]!==void 0&&Z[B]!==null)this[B]=B==="history"?[...Z[B]]:Z[B]}let H;for(H in Z)if(!xM.includes(H))this[H]=Z[H]}get basename(){return typeof this.path==="string"?G9.basename(this.path):void 0}set basename($){vM($,"basename"),hM($,"basename"),this.path=G9.join(this.dirname||"",$)}get dirname(){return typeof this.path==="string"?G9.dirname(this.path):void 0}set dirname($){Iu(this.basename,"dirname"),this.path=G9.join($||"",this.basename)}get extname(){return typeof this.path==="string"?G9.extname(this.path):void 0}set extname($){if(hM($,"extname"),Iu(this.dirname,"extname"),$){if($.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if($.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=G9.join(this.dirname,this.stem+($||""))}get path(){return this.history[this.history.length-1]}set path($){if(GH($))$=ku($);if(vM($,"path"),this.path!==$)this.history.push($)}get stem(){return typeof this.path==="string"?G9.basename(this.path,this.extname):void 0}set stem($){vM($,"stem"),hM($,"stem"),this.path=G9.join(this.dirname||"",$+(this.extname||""))}fail($,Z,J){let H=this.message($,Z,J);throw H.fatal=!0,H}info($,Z,J){let H=this.message($,Z,J);return H.fatal=void 0,H}message($,Z,J){let H=new K2($,Z,J);if(this.path)H.name=this.path+":"+H.name,H.file=this.path;return H.fatal=!1,this.messages.push(H),H}toString($){if(this.value===void 0)return"";if(typeof this.value==="string")return this.value;return new TextDecoder($||void 0).decode(this.value)}}function hM($,Z){if($&&$.includes(G9.sep))throw Error("`"+Z+"` cannot be a path: did not expect `"+G9.sep+"`")}function vM($,Z){if(!$)throw Error("`"+Z+"` cannot be empty")}function Iu($,Z){if(!$)throw Error("Setting `"+Z+"` requires `path` to be set too")}function cJ0($){return Boolean($&&typeof $==="object"&&"byteLength"in $&&"byteOffset"in $)}var yu=function($){let H=this.constructor.prototype,B=H[$],Q=function(){return B.apply(Q,arguments)};return Object.setPrototypeOf(Q,H),Q};var dJ0={}.hasOwnProperty;class uM extends yu{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=yM()}copy(){let $=new uM,Z=-1;while(++Z<this.attachers.length){let J=this.attachers[Z];$.use(...J)}return $.data(YW.default(!0,{},this.namespace)),$}data($,Z){if(typeof $==="string"){if(arguments.length===2)return mM("data",this.frozen),this.namespace[$]=Z,this;return dJ0.call(this.namespace,$)&&this.namespace[$]||void 0}if($)return mM("data",this.frozen),this.namespace=$,this;return this.namespace}freeze(){if(this.frozen)return this;let $=this;while(++this.freezeIndex<this.attachers.length){let[Z,...J]=this.attachers[this.freezeIndex];if(J[0]===!1)continue;if(J[0]===!0)J[0]=void 0;let H=Z.call($,...J);if(typeof H==="function")this.transformers.use(H)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse($){this.freeze();let Z=UW($),J=this.parser||this.Parser;return gM("parse",J),J(String(Z),Z)}process($,Z){let J=this;return this.freeze(),gM("process",this.parser||this.Parser),fM("process",this.compiler||this.Compiler),Z?H(void 0,Z):new Promise(H);function H(B,Q){let X=UW($),z=J.parse(X);J.run(z,X,function(U,Y,K){if(U||!Y||!K)return G(U);let F=Y,W=J.stringify(F,K);if(iJ0(W))K.value=W;else K.result=W;G(U,K)});function G(U,Y){if(U||!Y)Q(U);else if(B)B(Y);else B5(Z,"`done` is defined if `resolve` is not"),Z(void 0,Y)}}}processSync($){let Z=!1,J;return this.freeze(),gM("processSync",this.parser||this.Parser),fM("processSync",this.compiler||this.Compiler),this.process($,H),hu("processSync","process",Z),B5(J,"we either bailed on an error or have a tree"),J;function H(B,Q){Z=!0,IM(B),J=Q}}run($,Z,J){xu($),this.freeze();let H=this.transformers;if(!J&&typeof Z==="function")J=Z,Z=void 0;return J?B(void 0,J):new Promise(B);function B(Q,X){B5(typeof Z!=="function","`file` can’t be a `done` anymore, we checked");let z=UW(Z);H.run($,z,G);function G(U,Y,K){let F=Y||$;if(U)X(U);else if(Q)Q(F);else B5(J,"`done` is defined if `resolve` is not"),J(void 0,F,K)}}}runSync($,Z){let J=!1,H;return this.run($,Z,B),hu("runSync","run",J),B5(H,"we either bailed on an error or have a tree"),H;function B(Q,X){IM(Q),H=X,J=!0}}stringify($,Z){this.freeze();let J=UW(Z),H=this.compiler||this.Compiler;return fM("stringify",H),xu($),H($,J)}use($,...Z){let J=this.attachers,H=this.namespace;if(mM("use",this.frozen),$===null||$===void 0);else if(typeof $==="function")z($,Z);else if(typeof $==="object")if(Array.isArray($))X($);else Q($);else throw TypeError("Expected usable value, not `"+$+"`");return this;function B(G){if(typeof G==="function")z(G,[]);else if(typeof G==="object")if(Array.isArray(G)){let[U,...Y]=G;z(U,Y)}else Q(G);else throw TypeError("Expected usable value, not `"+G+"`")}function Q(G){if(!("plugins"in G)&&!("settings"in G))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");if(X(G.plugins),G.settings)H.settings=YW.default(!0,H.settings,G.settings)}function X(G){let U=-1;if(G===null||G===void 0);else if(Array.isArray(G))while(++U<G.length){let Y=G[U];B(Y)}else throw TypeError("Expected a list of plugins, not `"+G+"`")}function z(G,U){let Y=-1,K=-1;while(++Y<J.length)if(J[Y][0]===G){K=Y;break}if(K===-1)J.push([G,...U]);else if(U.length>0){let[F,...W]=U,q=J[K][1];if(QX(q)&&QX(F))F=YW.default(!0,q,F);J[K]=[G,F,...W]}}}}var pM=new uM().freeze();function gM($,Z){if(typeof Z!=="function")throw TypeError("Cannot `"+$+"` without `parser`")}function fM($,Z){if(typeof Z!=="function")throw TypeError("Cannot `"+$+"` without `compiler`")}function mM($,Z){if(Z)throw Error("Cannot call `"+$+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function xu($){if(!QX($)||typeof $.type!=="string")throw TypeError("Expected node, got `"+$+"`")}function hu($,Z,J){if(!J)throw Error("`"+$+"` finished async. Use `"+Z+"` instead")}function UW($){return lJ0($)?$:new UH($)}function lJ0($){return Boolean($&&typeof $==="object"&&"message"in $&&"messages"in $)}function iJ0($){return typeof $==="string"||rJ0($)}function rJ0($){return Boolean($&&typeof $==="object"&&"byteLength"in $&&"byteOffset"in $)}var aJ0="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",vu=[],gu={allowDangerousHtml:!0},oJ0=/^(https?|ircs?|mailto|xmpp)$/i,nJ0=[{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 KW($){let Z=sJ0($),J=tJ0($);return eJ0(Z.runSync(Z.parse(J),J),$)}function sJ0($){let Z=$.rehypePlugins||vu,J=$.remarkPlugins||vu,H=$.remarkRehypeOptions?{...$.remarkRehypeOptions,...gu}:gu;return pM().use(nF).use(J).use(zW,H).use(Z)}function tJ0($){let Z=$.children||"",J=new UH;if(typeof Z==="string")J.value=Z;else kF("Unexpected value `"+Z+"` for `children` prop, expected `string`");return J}function eJ0($,Z){let{allowedElements:J,allowElement:H,components:B,disallowedElements:Q,skipHtml:X,unwrapDisallowed:z}=Z,G=Z.urlTransform||FW;for(let Y of nJ0)if(Object.hasOwn(Z,Y.from))kF("Unexpected `"+Y.from+"` prop, "+(Y.to?"use `"+Y.to+"` instead":"remove it")+" (see <"+aJ0+"#"+Y.id+"> for more info)");if(J&&Q)kF("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other");return m3($,U),YM($,{Fragment:YH.Fragment,components:B,ignoreInvalidStyle:!0,jsx:YH.jsx,jsxs:YH.jsxs,passKeys:!0,passNode:!0});function U(Y,K,F){if(Y.type==="raw"&&F&&typeof K==="number"){if(X)F.children.splice(K,1);else F.children[K]={type:"text",value:Y.value};return K}if(Y.type==="element"){let W;for(W in rQ)if(Object.hasOwn(rQ,W)&&Object.hasOwn(Y.properties,W)){let q=Y.properties[W],N=rQ[W];if(N===null||N.includes(Y.tagName))Y.properties[W]=G(String(q||""),W,Y)}}if(Y.type==="element"){let W=J?!J.includes(Y.tagName):Q?Q.includes(Y.tagName):!1;if(!W&&H&&typeof K==="number")W=!H(Y,K,F);if(W&&F&&typeof K==="number"){if(z&&Y.children)F.children.splice(K,1,...Y.children);else F.children.splice(K,1);return K}}}}function FW($){let Z=$.indexOf(":"),J=$.indexOf("?"),H=$.indexOf("#"),B=$.indexOf("/");if(Z===-1||B!==-1&&Z>B||J!==-1&&Z>J||H!==-1&&Z>H||oJ0.test($.slice(0,Z)))return $;return""}var WW=function($,Z,J){let H=z3(J);if(!$||!$.type||!$.children)throw Error("Expected parent node");if(typeof Z==="number"){if(Z<0||Z===Number.POSITIVE_INFINITY)throw Error("Expected positive finite number as index")}else if(Z=$.children.indexOf(Z),Z<0)throw Error("Expected child node or index");while(++Z<$.children.length)if(H($.children[Z],Z,$))return $.children[Z];return};var u3=function($){if($===null||$===void 0)return JH0;if(typeof $==="string")return ZH0($);if(typeof $==="object")return $H0($);if(typeof $==="function")return cM($);throw Error("Expected function, string, or array as `test`")};function $H0($){let Z=[],J=-1;while(++J<$.length)Z[J]=u3($[J]);return cM(H);function H(...B){let Q=-1;while(++Q<Z.length)if(Z[Q].apply(this,B))return!0;return!1}}function ZH0($){return cM(Z);function Z(J){return J.tagName===$}}function cM($){return Z;function Z(J,H,B){return Boolean(HH0(J)&&$.call(this,J,typeof H==="number"?H:void 0,B||void 0))}}function JH0($){return Boolean($&&typeof $==="object"&&"type"in $&&$.type==="element"&&"tagName"in $&&typeof $.tagName==="string")}function HH0($){return $!==null&&typeof $==="object"&&"type"in $&&"tagName"in $}var mu=/\n/g,uu=/[\t ]+/g,dM=u3("br"),pu=u3(YH0),BH0=u3("p"),cu=u3("tr"),QH0=u3(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",UH0,KH0]),du=u3(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function lM($,Z){let J=Z||{},H="children"in $?$.children:[],B=du($),Q=ru($,{whitespace:J.whitespace||"normal",breakBefore:!1,breakAfter:!1}),X=[];if($.type==="text"||$.type==="comment")X.push(...iu($,{whitespace:Q,breakBefore:!0,breakAfter:!0}));let z=-1;while(++z<H.length)X.push(...lu(H[z],$,{whitespace:Q,breakBefore:z?void 0:B,breakAfter:z<H.length-1?dM(H[z+1]):B}));let G=[],U;z=-1;while(++z<X.length){let Y=X[z];if(typeof Y==="number"){if(U!==void 0&&Y>U)U=Y}else if(Y){if(U!==void 0&&U>-1)G.push(`
31
- `.repeat(U)||" ");U=-1,G.push(Y)}}return G.join("")}function lu($,Z,J){if($.type==="element")return XH0($,Z,J);if($.type==="text")return J.whitespace==="normal"?iu($,J):zH0($);return[]}function XH0($,Z,J){let H=ru($,J),B=$.children||[],Q=-1,X=[];if(QH0($))return X;let z,G;if(dM($))G=`
32
- `;else if(cu($)&&WW(Z,$,cu))G=`
33
- `;else if(BH0($))z=2,G=2;else if(du($))z=1,G=1;while(++Q<B.length)X=X.concat(lu(B[Q],$,{whitespace:H,breakBefore:Q?void 0:z,breakAfter:Q<B.length-1?dM(B[Q+1]):G}));if(pu($)&&WW(Z,$,pu))X.push("\t");if(z)X.unshift(z);if(G)X.push(G);return X}function iu($,Z){let J=String($.value),H=[],B=[],Q=0;while(Q<=J.length){mu.lastIndex=Q;let G=mu.exec(J),U=G&&"index"in G?G.index:J.length;H.push(GH0(J.slice(Q,U).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),Q===0?Z.breakBefore:!0,U===J.length?Z.breakAfter:!0)),Q=U+1}let X=-1,z;while(++X<H.length)if(H[X].charCodeAt(H[X].length-1)===8203||X<H.length-1&&H[X+1].charCodeAt(0)===8203)B.push(H[X]),z=void 0;else if(H[X]){if(typeof z==="number")B.push(z);B.push(H[X]),z=0}else if(X===0||X===H.length-1)B.push(0);return B}function zH0($){return[String($.value)]}function GH0($,Z,J){let H=[],B=0,Q;while(B<$.length){uu.lastIndex=B;let X=uu.exec($);if(Q=X?X.index:$.length,!B&&!Q&&X&&!Z)H.push("");if(B!==Q)H.push($.slice(B,Q));B=X?Q+X[0].length:Q}if(B!==Q&&!J)H.push("");return H.join(" ")}function ru($,Z){if($.type==="element"){let J=$.properties||{};switch($.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return J.wrap?"pre-wrap":"pre";case"td":case"th":return J.noWrap?"nowrap":Z.whitespace;case"textarea":return"pre-wrap";default:}}return Z.whitespace}function UH0($){return Boolean(($.properties||{}).hidden)}function YH0($){return $.tagName==="td"||$.tagName==="th"}function KH0($){return $.tagName==="dialog"&&!($.properties||{}).open}function FH0($){let Z=$.regex,J=$.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),H="decltype\\(auto\\)",B="[a-zA-Z_]\\w*::",Q="<[^<>]+>",X="(?!struct)(decltype\\(auto\\)|"+Z.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+Z.optional("<[^<>]+>")+")",z={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},G="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",U={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[$.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},$.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},Y={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},K={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},$.inherit(U,{className:"string"}),{className:"string",begin:/<.*?>/},J,$.C_BLOCK_COMMENT_MODE]},F={className:"title",begin:Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE,relevance:0},W=Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE+"\\s*\\(",q=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],N=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],D=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],A=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],j={type:N,keyword:q,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:D},M={className:"function.dispatch",relevance:0,keywords:{_hint:A},begin:Z.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,$.IDENT_RE,Z.lookahead(/(<[^<>]+>|)\s*\(/))},_=[M,K,z,J,$.C_BLOCK_COMMENT_MODE,Y,U],w={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:j,contains:_.concat([{begin:/\(/,end:/\)/,keywords:j,contains:_.concat(["self"]),relevance:0}]),relevance:0},T={className:"function",begin:"("+X+"[\\*&\\s]+)+"+W,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:j,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:j,relevance:0},{begin:W,returnBegin:!0,contains:[F],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[U,Y]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:j,relevance:0,contains:[J,$.C_BLOCK_COMMENT_MODE,U,Y,z,{begin:/\(/,end:/\)/,keywords:j,relevance:0,contains:["self",J,$.C_BLOCK_COMMENT_MODE,U,Y,z]}]},z,J,$.C_BLOCK_COMMENT_MODE,K]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:j,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(w,T,M,_,[K,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:j,contains:["self",z]},{begin:$.IDENT_RE+"::",keywords:j},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function au($){let Z={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},J=FH0($),H=J.keywords;return H.type=[...H.type,...Z.type],H.literal=[...H.literal,...Z.literal],H.built_in=[...H.built_in,...Z.built_in],H._hints=Z._hints,J.name="Arduino",J.aliases=["ino"],J.supersetOf="cpp",J}function ou($){let Z=$.regex,J={},H={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[J]}]};Object.assign(J,{className:"variable",variants:[{begin:Z.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},H]});let B={className:"subst",begin:/\$\(/,end:/\)/,contains:[$.BACKSLASH_ESCAPE]},Q=$.inherit($.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),X={begin:/<<-?\s*(?=\w+)/,starts:{contains:[$.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},z={className:"string",begin:/"/,end:/"/,contains:[$.BACKSLASH_ESCAPE,J,B]};B.contains.push(z);let G={match:/\\"/},U={className:"string",begin:/'/,end:/'/},Y={match:/\\'/},K={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},$.NUMBER_MODE,J]},F=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],W=$.SHEBANG({binary:`(${F.join("|")})`,relevance:10}),q={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[$.inherit($.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},N=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],D=["true","false"],A={match:/(\/[a-z._-]+)+/},V=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],L=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],j=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],M=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:N,literal:D,built_in:[...V,...L,"set","shopt",...j,...M]},contains:[W,$.SHEBANG(),q,K,Q,X,A,z,G,U,Y,J]}}function nu($){let Z=$.regex,J=$.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),H="decltype\\(auto\\)",B="[a-zA-Z_]\\w*::",Q="<[^<>]+>",X="(decltype\\(auto\\)|"+Z.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+Z.optional("<[^<>]+>")+")",z={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},G="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",U={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[$.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},$.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},Y={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},K={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},$.inherit(U,{className:"string"}),{className:"string",begin:/<.*?>/},J,$.C_BLOCK_COMMENT_MODE]},F={className:"title",begin:Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE,relevance:0},W=Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE+"\\s*\\(",D={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},A=[K,z,J,$.C_BLOCK_COMMENT_MODE,Y,U],V={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:D,contains:A.concat([{begin:/\(/,end:/\)/,keywords:D,contains:A.concat(["self"]),relevance:0}]),relevance:0},L={begin:"("+X+"[\\*&\\s]+)+"+W,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:D,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:D,relevance:0},{begin:W,returnBegin:!0,contains:[$.inherit(F,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:D,relevance:0,contains:[J,$.C_BLOCK_COMMENT_MODE,U,Y,z,{begin:/\(/,end:/\)/,keywords:D,relevance:0,contains:["self",J,$.C_BLOCK_COMMENT_MODE,U,Y,z]}]},z,J,$.C_BLOCK_COMMENT_MODE,K]};return{name:"C",aliases:["h"],keywords:D,disableAutodetect:!0,illegal:"</",contains:[].concat(V,L,A,[K,{begin:$.IDENT_RE+"::",keywords:D},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},$.TITLE_MODE]}]),exports:{preprocessor:K,strings:U,keywords:D}}}function su($){let Z=$.regex,J=$.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),H="decltype\\(auto\\)",B="[a-zA-Z_]\\w*::",Q="<[^<>]+>",X="(?!struct)(decltype\\(auto\\)|"+Z.optional("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+Z.optional("<[^<>]+>")+")",z={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},G="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",U={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[$.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},$.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},Y={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},K={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},$.inherit(U,{className:"string"}),{className:"string",begin:/<.*?>/},J,$.C_BLOCK_COMMENT_MODE]},F={className:"title",begin:Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE,relevance:0},W=Z.optional("[a-zA-Z_]\\w*::")+$.IDENT_RE+"\\s*\\(",q=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],N=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],D=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],A=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],j={type:N,keyword:q,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:D},M={className:"function.dispatch",relevance:0,keywords:{_hint:A},begin:Z.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,$.IDENT_RE,Z.lookahead(/(<[^<>]+>|)\s*\(/))},_=[M,K,z,J,$.C_BLOCK_COMMENT_MODE,Y,U],w={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:j,contains:_.concat([{begin:/\(/,end:/\)/,keywords:j,contains:_.concat(["self"]),relevance:0}]),relevance:0},T={className:"function",begin:"("+X+"[\\*&\\s]+)+"+W,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:j,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:j,relevance:0},{begin:W,returnBegin:!0,contains:[F],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[U,Y]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:j,relevance:0,contains:[J,$.C_BLOCK_COMMENT_MODE,U,Y,z,{begin:/\(/,end:/\)/,keywords:j,relevance:0,contains:["self",J,$.C_BLOCK_COMMENT_MODE,U,Y,z]}]},z,J,$.C_BLOCK_COMMENT_MODE,K]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:j,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(w,T,M,_,[K,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:j,contains:["self",z]},{begin:$.IDENT_RE+"::",keywords:j},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function tu($){let Z=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],J=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],H=["default","false","null","true"],B=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],Q=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],X={keyword:B.concat(Q),built_in:Z,literal:H},z=$.inherit($.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),G={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},U={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},Y={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},K=$.inherit(Y,{illegal:/\n/}),F={className:"subst",begin:/\{/,end:/\}/,keywords:X},W=$.inherit(F,{illegal:/\n/}),q={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},$.BACKSLASH_ESCAPE,W]},N={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},F]},D=$.inherit(N,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},W]});F.contains=[N,q,Y,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,G,$.C_BLOCK_COMMENT_MODE],W.contains=[D,q,K,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,G,$.inherit($.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let A={variants:[U,N,q,Y,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},V={begin:"<",end:">",contains:[{beginKeywords:"in out"},z]},L=$.IDENT_RE+"(<"+$.IDENT_RE+"(\\s*,\\s*"+$.IDENT_RE+")*>)?(\\[\\])?",j={begin:"@"+$.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:X,illegal:/::/,contains:[$.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},A,G,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},z,V,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[z,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[z,V,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+L+"\\s+)+"+$.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:X,contains:[{beginKeywords:J.join(" "),relevance:0},{begin:$.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[$.TITLE_MODE,V],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:X,relevance:0,contains:[A,G,$.C_BLOCK_COMMENT_MODE]},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},j]}}var WH0=($)=>{return{IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:$.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:$.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}},qH0=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],NH0=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],AH0=[...qH0,...NH0],DH0=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),VH0=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),LH0=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),MH0=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function eu($){let Z=$.regex,J=WH0($),H={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},B="and or not only",Q=/@-?\w[\w]*(-\w+)*/,X="[a-zA-Z-][a-zA-Z0-9_-]*",z=[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[J.BLOCK_COMMENT,H,J.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},J.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+VH0.join("|")+")"},{begin:":(:)?("+LH0.join("|")+")"}]},J.CSS_VARIABLE,{className:"attribute",begin:"\\b("+MH0.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[J.BLOCK_COMMENT,J.HEXCOLOR,J.IMPORTANT,J.CSS_NUMBER_MODE,...z,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...z,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},J.FUNCTION_DISPATCH]},{begin:Z.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:Q},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:DH0.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...z,J.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+AH0.join("|")+")\\b"}]}}function $p($){let Z=$.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:Z.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:Z.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function Zp($){let Q={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:Q,illegal:"</",contains:[$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,{className:"string",variants:[$.QUOTE_STRING_MODE,$.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[$.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:Q,illegal:/["']/}]}]}}function Jp($){let Z=$.regex,J=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[$.HASH_COMMENT_MODE,$.QUOTE_STRING_MODE,$.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:Z.concat(J,Z.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function Hp($){let Z=$.regex,J={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:$.NUMBER_RE}]},H=$.COMMENT();H.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let B={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},Q={className:"literal",begin:/\bon|off|true|false|yes|no\b/},X={className:"string",contains:[$.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},z={begin:/\[/,end:/\]/,contains:[H,Q,B,X,J,"self"],relevance:0},G=/[A-Za-z0-9_-]+/,U=/"(\\"|[^"])*"/,Y=/'[^']*'/,K=Z.either(G,U,Y),F=Z.concat(K,"(\\s*\\.\\s*",K,")*",Z.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[H,{className:"section",begin:/\[+/,end:/\]+/},{begin:F,className:"attr",starts:{end:/$/,contains:[H,z,Q,B,X,J]}}]}}var KH="[0-9](_*[0-9])*",qW=`\\.(${KH})`,NW="[0-9a-fA-F](_*[0-9a-fA-F])*",Bp={className:"number",variants:[{begin:`(\\b(${KH})((${qW})|\\.)?|(${qW}))[eE][+-]?(${KH})[fFdD]?\\b`},{begin:`\\b(${KH})((${qW})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${qW})[fFdD]?\\b`},{begin:`\\b(${KH})[fFdD]\\b`},{begin:`\\b0[xX]((${NW})\\.?|(${NW})?\\.(${NW}))[pP][+-]?(${KH})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${NW})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Qp($,Z,J){if(J===-1)return"";return $.replace(Z,(H)=>{return Qp($,Z,J-1)})}function Xp($){let Z=$.regex,J="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",H="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+Qp("(?:<"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+"~~~(?:\\s*,\\s*"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+"~~~)*>)?",/~~~/g,2),G={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},U={className:"meta",begin:"@"+"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},Y={className:"params",begin:/\(/,end:/\)/,keywords:G,relevance:0,contains:[$.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:G,illegal:/<\/|#/,contains:[$.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[$.BACKSLASH_ESCAPE]},$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[Z.concat(/(?!else)/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"),/\s+/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,"[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"],className:{1:"keyword",3:"title.class"},contains:[Y,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+H+"\\s+)",$.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:G,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:G,relevance:0,contains:[U,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,Bp,$.C_BLOCK_COMMENT_MODE]},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},Bp,U]}}var PH0=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],_H0=["true","false","null","undefined","NaN","Infinity"],zp=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Gp=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Up=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],jH0=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],OH0=[].concat(Up,zp,Gp);function Yp($){let Z=$.regex,J=(v,{after:g})=>{let E="</"+v[0].slice(1);return v.input.indexOf(E,g)!==-1},H="[A-Za-z$_][0-9A-Za-z$_]*",B={begin:"<>",end:"</>"},Q=/<[A-Za-z0-9\\._:-]+\s*\/>/,X={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(v,g)=>{let E=v[0].length+v.index,l=v.input[E];if(l==="<"||l===","){g.ignoreMatch();return}if(l===">"){if(!J(v,{after:E}))g.ignoreMatch()}let r,h=v.input.substring(E);if(r=h.match(/^\s*=/)){g.ignoreMatch();return}if(r=h.match(/^\s+extends\s+/)){if(r.index===0){g.ignoreMatch();return}}}},z={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:PH0,literal:_H0,built_in:OH0,"variable.language":jH0},G="[0-9](_?[0-9])*",U="\\.([0-9](_?[0-9])*)",Y="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",K={className:"number",variants:[{begin:"(\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)((\\.([0-9](_?[0-9])*))|\\.)?|(\\.([0-9](_?[0-9])*)))[eE][+-]?([0-9](_?[0-9])*)\\b"},{begin:"\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)\\b((\\.([0-9](_?[0-9])*))\\b|\\.)?|(\\.([0-9](_?[0-9])*))\\b"},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},F={className:"subst",begin:"\\$\\{",end:"\\}",keywords:z,contains:[]},W={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,F],subLanguage:"xml"}},q={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,F],subLanguage:"css"}},N={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,F],subLanguage:"graphql"}},D={className:"string",begin:"`",end:"`",contains:[$.BACKSLASH_ESCAPE,F]},V={className:"comment",variants:[$.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:"[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),$.C_BLOCK_COMMENT_MODE,$.C_LINE_COMMENT_MODE]},L=[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,W,q,N,D,{match:/\$\d+/},K];F.contains=L.concat({begin:/\{/,end:/\}/,keywords:z,contains:["self"].concat(L)});let j=[].concat(V,F.contains),M=j.concat([{begin:/(\s*)\(/,end:/\)/,keywords:z,contains:["self"].concat(j)}]),_={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:M},w={variants:[{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s+/,/extends/,/\s+/,Z.concat("[A-Za-z$_][0-9A-Za-z$_]*","(",Z.concat(/\./,"[A-Za-z$_][0-9A-Za-z$_]*"),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*"],scope:{1:"keyword",3:"title.class"}}]},T={relevance:0,match:Z.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...zp,...Gp]}},b={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},C={variants:[{match:[/function/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[_],illegal:/%/},k={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function S(v){return Z.concat("(?!",v.join("|"),")")}let R={match:Z.concat(/\b/,S([...Up,"super","import"].map((v)=>`${v}\\s*\\(`)),"[A-Za-z$_][0-9A-Za-z$_]*",Z.lookahead(/\s*\(/)),className:"title.function",relevance:0},O={begin:Z.concat(/\./,Z.lookahead(Z.concat("[A-Za-z$_][0-9A-Za-z$_]*",/(?![0-9A-Za-z$_(])/))),end:"[A-Za-z$_][0-9A-Za-z$_]*",excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},y={match:[/get|set/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},_]},I="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+$.UNDERSCORE_IDENT_RE+")\\s*=>",x={match:[/const|var|let/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s*/,/=\s*/,/(async\s*)?/,Z.lookahead(I)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[_]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:z,exports:{PARAMS_CONTAINS:M,CLASS_REFERENCE:T},illegal:/#(?![$_A-z])/,contains:[$.SHEBANG({label:"shebang",binary:"node",relevance:5}),b,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,W,q,N,D,V,{match:/\$\d+/},K,T,{scope:"attr",match:"[A-Za-z$_][0-9A-Za-z$_]*"+Z.lookahead(":"),relevance:0},x,{begin:"("+$.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[V,$.REGEXP_MODE,{className:"function",begin:I,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:$.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:M}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:B.begin,end:B.end},{match:Q},{begin:X.begin,"on:begin":X.isTrulyOpeningTag,end:X.end}],subLanguage:"xml",contains:[{begin:X.begin,end:X.end,skip:!0,contains:["self"]}]}]},C,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+$.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[_,$.inherit($.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*",className:"title.function"})]},{match:/\.\.\./,relevance:0},O,{match:"\\$[A-Za-z$_][0-9A-Za-z$_]*",relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[_]},R,k,w,y,{match:/\$[(.]/}]}}function Kp($){let Z={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},J={match:/[{}[\],:]/,className:"punctuation",relevance:0},H=["true","false","null"],B={scope:"literal",beginKeywords:H.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:H},contains:[Z,J,$.QUOTE_STRING_MODE,B,$.C_NUMBER_MODE,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var FH="[0-9](_*[0-9])*",AW=`\\.(${FH})`,DW="[0-9a-fA-F](_*[0-9a-fA-F])*",TH0={className:"number",variants:[{begin:`(\\b(${FH})((${AW})|\\.)?|(${AW}))[eE][+-]?(${FH})[fFdD]?\\b`},{begin:`\\b(${FH})((${AW})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${AW})[fFdD]?\\b`},{begin:`\\b(${FH})[fFdD]\\b`},{begin:`\\b0[xX]((${DW})\\.?|(${DW})?\\.(${DW}))[pP][+-]?(${FH})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${DW})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Fp($){let Z={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},J={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},H={className:"symbol",begin:$.UNDERSCORE_IDENT_RE+"@"},B={className:"subst",begin:/\$\{/,end:/\}/,contains:[$.C_NUMBER_MODE]},Q={className:"variable",begin:"\\$"+$.UNDERSCORE_IDENT_RE},X={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[Q,B]},{begin:"'",end:"'",illegal:/\n/,contains:[$.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[$.BACKSLASH_ESCAPE,Q,B]}]};B.contains.push(X);let z={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+$.UNDERSCORE_IDENT_RE+")?"},G={className:"meta",begin:"@"+$.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[$.inherit(X,{className:"string"}),"self"]}]},U=TH0,Y=$.COMMENT("/\\*","\\*/",{contains:[$.C_BLOCK_COMMENT_MODE]}),K={variants:[{className:"type",begin:$.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},F=K;return F.variants[1].contains=[K],K.variants[1].contains=[F],{name:"Kotlin",aliases:["kt","kts"],keywords:Z,contains:[$.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),$.C_LINE_COMMENT_MODE,Y,J,H,z,G,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:Z,relevance:5,contains:[{begin:$.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[$.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:Z,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[K,$.C_LINE_COMMENT_MODE,Y],relevance:0},$.C_LINE_COMMENT_MODE,Y,z,G,X,$.C_NUMBER_MODE]},Y]},{begin:[/class|interface|trait/,/\s+/,$.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},$.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},z,G]},X,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
34
- `},U]}}var CH0=($)=>{return{IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:$.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:$.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}},EH0=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],bH0=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],wH0=[...EH0,...bH0],SH0=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Wp=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),qp=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),RH0=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),kH0=Wp.concat(qp).sort().reverse();function Np($){let Z=CH0($),J=kH0,H="and or not only",B="[\\w-]+",Q="([\\w-]+|@\\{[\\w-]+\\})",X=[],z=[],G=function(L){return{className:"string",begin:"~?"+L+".*?"+L}},U=function(L,j,M){return{className:L,begin:j,relevance:M}},Y={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:SH0.join(" ")},K={begin:"\\(",end:"\\)",contains:z,keywords:Y,relevance:0};z.push($.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,G("'"),G('"'),Z.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},Z.HEXCOLOR,K,U("variable","@@?[\\w-]+",10),U("variable","@\\{[\\w-]+\\}"),U("built_in","~?`[^`]*?`"),{className:"attribute",begin:"[\\w-]+\\s*:",end:":",returnBegin:!0,excludeEnd:!0},Z.IMPORTANT,{beginKeywords:"and not"},Z.FUNCTION_DISPATCH);let F=z.concat({begin:/\{/,end:/\}/,contains:X}),W={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(z)},q={begin:Q+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},Z.CSS_VARIABLE,{className:"attribute",begin:"\\b("+RH0.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:z}}]},N={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:Y,returnEnd:!0,contains:z,relevance:0}},D={className:"variable",variants:[{begin:"@[\\w-]+\\s*:",relevance:15},{begin:"@[\\w-]+"}],starts:{end:"[;}]",returnEnd:!0,contains:F}},A={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:Q,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,W,U("keyword","all\\b"),U("variable","@\\{[\\w-]+\\}"),{begin:"\\b("+wH0.join("|")+")\\b",className:"selector-tag"},Z.CSS_NUMBER_MODE,U("selector-tag",Q,0),U("selector-id","#"+Q),U("selector-class","\\."+Q,0),U("selector-tag","&",0),Z.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+Wp.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+qp.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:F},{begin:"!important"},Z.FUNCTION_DISPATCH]},V={begin:`[\\w-]+:(:)?(${J.join("|")})`,returnBegin:!0,contains:[A]};return X.push($.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,N,D,V,q,A,W,Z.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:X}}function Ap($){let H={begin:"\\[=*\\[",end:"\\]=*\\]",contains:["self"]},B=[$.COMMENT("--(?!\\[=*\\[)","$"),$.COMMENT("--\\[=*\\[","\\]=*\\]",{contains:[H],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:$.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:B.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[$.inherit($.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:B}].concat(B)},$.C_NUMBER_MODE,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,{className:"string",begin:"\\[=*\\[",end:"\\]=*\\]",contains:[H],relevance:5}])}}function Dp($){let Z={className:"variable",variants:[{begin:"\\$\\("+$.UNDERSCORE_IDENT_RE+"\\)",contains:[$.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},J={className:"string",begin:/"/,end:/"/,contains:[$.BACKSLASH_ESCAPE,Z]},H={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[Z,J]},B={begin:"^"+$.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},Q={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},X={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[Z]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[$.HASH_COMMENT_MODE,Z,J,H,B,Q,X]}}function Vp($){let Z=$.regex,J={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},H={begin:"^[-\\*]{3,}",end:"$"},B={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},Q={className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},X={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},z=/[A-Za-z][A-Za-z0-9+.-]*/,G={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:Z.concat(/\[.+?\]\(/,z,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},U={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},Y={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},K=$.inherit(U,{contains:[]}),F=$.inherit(Y,{contains:[]});U.contains.push(F),Y.contains.push(K);let W=[J,G];return[U,Y,K,F].forEach((A)=>{A.contains=A.contains.concat(W)}),W=W.concat(U,Y),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:W},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:W}]}]},J,Q,U,Y,{className:"quote",begin:"^>\\s+",contains:W,end:"$"},B,H,G,X,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Lp($){let Z={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},J=/[a-zA-Z@][a-zA-Z0-9_]*/,z={"variable.language":["this","super"],$pattern:J,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},G={$pattern:J,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:z,illegal:"</",contains:[Z,$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,$.C_NUMBER_MODE,$.QUOTE_STRING_MODE,$.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[$.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},$.inherit($.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+G.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:G,contains:[$.UNDERSCORE_TITLE_MODE]},{begin:"\\."+$.UNDERSCORE_IDENT_RE,relevance:0}]}}function Mp($){let Z=$.regex,J=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],H=/[dualxmsipngr]{0,12}/,B={$pattern:/[\w.]+/,keyword:J.join(" ")},Q={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:B},X={begin:/->\{/,end:/\}/},z={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},G={scope:"variable",variants:[{begin:/\$\d/},{begin:Z.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[z]},U={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},Y=[$.BACKSLASH_ESCAPE,Q,G],K=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],F=(N,D,A="\\1")=>{let V=A==="\\1"?A:Z.concat(A,D);return Z.concat(Z.concat("(?:",N,")"),D,/(?:\\.|[^\\\/])*?/,V,/(?:\\.|[^\\\/])*?/,A,H)},W=(N,D,A)=>{return Z.concat(Z.concat("(?:",N,")"),D,/(?:\\.|[^\\\/])*?/,A,H)},q=[G,$.HASH_COMMENT_MODE,$.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),X,{className:"string",contains:Y,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[$.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[$.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},U,{begin:"(\\/\\/|"+$.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[$.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:F("s|tr|y",Z.either(...K,{capture:!0}))},{begin:F("s|tr|y","\\(","\\)")},{begin:F("s|tr|y","\\[","\\]")},{begin:F("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:W("(?:m|qr)?",/\//,/\//)},{begin:W("m|qr",Z.either(...K,{capture:!0}),/\1/)},{begin:W("m|qr",/\(/,/\)/)},{begin:W("m|qr",/\[/,/\]/)},{begin:W("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[$.TITLE_MODE,z]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[$.TITLE_MODE,z,U]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return Q.contains=q,X.contains=q,{name:"Perl",aliases:["pl","pm"],keywords:B,contains:q}}function Pp($){let Z=$.regex,J=/(?![A-Za-z0-9])(?![$])/,H=Z.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,J),B=Z.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,J),Q=Z.concat(/[A-Z]+/,J),X={scope:"variable",match:"\\$+"+H},z={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:0.1},{begin:/\?>/}]},G={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},U=$.inherit($.APOS_STRING_MODE,{illegal:null}),Y=$.inherit($.QUOTE_STRING_MODE,{illegal:null,contains:$.QUOTE_STRING_MODE.contains.concat(G)}),K={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:$.QUOTE_STRING_MODE.contains.concat(G),"on:begin":(O,y)=>{y.data._beginMatch=O[1]||O[2]},"on:end":(O,y)=>{if(y.data._beginMatch!==O[1])y.ignoreMatch()}},F=$.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),W=`[
35
- ]`,q={scope:"string",variants:[Y,U,K,F]},N={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},D=["false","null","true"],A=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],V=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],j={keyword:A,literal:((O)=>{let y=[];return O.forEach((I)=>{if(y.push(I),I.toLowerCase()===I)y.push(I.toUpperCase());else y.push(I.toLowerCase())}),y})(D),built_in:V},M=(O)=>{return O.map((y)=>{return y.replace(/\|\d+$/,"")})},_={variants:[{match:[/new/,Z.concat(`[
36
- ]`,"+"),Z.concat("(?!",M(V).join("\\b|"),"\\b)"),B],scope:{1:"keyword",4:"title.class"}}]},w=Z.concat(H,"\\b(?!\\()"),T={variants:[{match:[Z.concat(/::/,Z.lookahead(/(?!class\b)/)),w],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[B,Z.concat(/::/,Z.lookahead(/(?!class\b)/)),w],scope:{1:"title.class",3:"variable.constant"}},{match:[B,Z.concat("::",Z.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[B,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},b={scope:"attr",match:Z.concat(H,Z.lookahead(":"),Z.lookahead(/(?!::)/))},C={relevance:0,begin:/\(/,end:/\)/,keywords:j,contains:[b,X,T,$.C_BLOCK_COMMENT_MODE,q,N,_]},k={relevance:0,match:[/\b/,Z.concat("(?!fn\\b|function\\b|",M(A).join("\\b|"),"|",M(V).join("\\b|"),"\\b)"),H,Z.concat(`[
37
- ]`,"*"),Z.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[C]};C.contains.push(k);let S=[b,T,$.C_BLOCK_COMMENT_MODE,q,N,_],R={begin:Z.concat(/#\[\s*\\?/,Z.either(B,Q)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:D,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:D,keyword:["new","array"]},contains:["self",...S]},...S,{scope:"meta",variants:[{match:B},{match:Q}]}]};return{case_insensitive:!1,keywords:j,contains:[R,$.HASH_COMMENT_MODE,$.COMMENT("//","$"),$.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:$.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},z,{scope:"variable.language",match:/\$this\b/},X,k,T,{match:[/const/,/\s/,H],scope:{1:"keyword",3:"variable.constant"}},_,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},$.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:j,contains:["self",R,X,T,$.C_BLOCK_COMMENT_MODE,q,N]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},$.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[$.inherit($.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},$.UNDERSCORE_TITLE_MODE]},q,N]}}function _p($){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},$.inherit($.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),$.inherit($.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function jp($){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function Op($){let Z=$.regex,J=/[\p{XID_Start}_]\p{XID_Continue}*/u,H=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],z={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:H,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},G={className:"meta",begin:/^(>>>|\.\.\.) /},U={className:"subst",begin:/\{/,end:/\}/,keywords:z,illegal:/#/},Y={begin:/\{\{/,relevance:0},K={className:"string",contains:[$.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[$.BACKSLASH_ESCAPE,G],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[$.BACKSLASH_ESCAPE,G],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[$.BACKSLASH_ESCAPE,G,Y,U]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[$.BACKSLASH_ESCAPE,G,Y,U]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[$.BACKSLASH_ESCAPE,Y,U]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[$.BACKSLASH_ESCAPE,Y,U]},$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},F="[0-9](_?[0-9])*",W="(\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.",q=`\\b|${H.join("|")}`,N={className:"number",relevance:0,variants:[{begin:`(\\b([0-9](_?[0-9])*)|((\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.))[eE][+-]?([0-9](_?[0-9])*)[jJ]?(?=${q})`},{begin:"((\\b([0-9](_?[0-9])*))?\\.([0-9](_?[0-9])*)|\\b([0-9](_?[0-9])*)\\.)[jJ]?"},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${q})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${q})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${q})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${q})`},{begin:`\\b([0-9](_?[0-9])*)[jJ](?=${q})`}]},D={className:"comment",begin:Z.lookahead(/# type:/),end:/$/,keywords:z,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},A={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:["self",G,N,K,$.HASH_COMMENT_MODE]}]};return U.contains=[K,N,G],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:z,illegal:/(<\/|\?)|=>/,contains:[G,N,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},K,D,$.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,J],scope:{1:"keyword",3:"title.function"},contains:[A]},{variants:[{match:[/\bclass/,/\s+/,J,/\s*/,/\(\s*/,J,/\s*\)/]},{match:[/\bclass/,/\s+/,J]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[N,A,K]}]}}function Tp($){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function Cp($){let Z=$.regex,J=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,H=Z.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),B=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,Q=Z.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:J,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[$.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:Z.lookahead(Z.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:J},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),$.HASH_COMMENT_MODE,{scope:"string",contains:[$.BACKSLASH_ESCAPE],variants:[$.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),$.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),$.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),$.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),$.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),$.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[B,H]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,H]},{scope:{1:"punctuation",2:"number"},match:[Q,H]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,H]}]},{scope:{3:"operator"},match:[J,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:B},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:Q},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function Ep($){let Z=$.regex,J="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",H=Z.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),B=Z.concat(H,/(::\w+)*/),X={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},z={className:"doctag",begin:"@[A-Za-z]+"},G={begin:"#<",end:">"},U=[$.COMMENT("#","$",{contains:[z]}),$.COMMENT("^=begin","^=end",{contains:[z],relevance:10}),$.COMMENT("^__END__",$.MATCH_NOTHING_RE)],Y={className:"subst",begin:/#\{/,end:/\}/,keywords:X},K={className:"string",contains:[$.BACKSLASH_ESCAPE,Y],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:Z.concat(/<<[-~]?'?/,Z.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[$.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[$.BACKSLASH_ESCAPE,Y]})]}]},F="[1-9](_?[0-9])*|0",W="[0-9](_?[0-9])*",q={className:"number",relevance:0,variants:[{begin:"\\b([1-9](_?[0-9])*|0)(\\.([0-9](_?[0-9])*))?([eE][+-]?([0-9](_?[0-9])*)|r)?i?\\b"},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},N={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:X}]},_=[K,{variants:[{match:[/class\s+/,B,/\s+<\s+/,B]},{match:[/\b(class|module)\s+/,B]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:X},{match:[/(include|extend)\s+/,B],scope:{2:"title.class"},keywords:X},{relevance:0,match:[B,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:H,scope:"title.class"},{match:[/def/,/\s+/,"([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)"],scope:{1:"keyword",3:"title.function"},contains:[N]},{begin:$.IDENT_RE+"::"},{className:"symbol",begin:$.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[K,{begin:"([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)"}],relevance:0},q,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:X},{begin:"("+$.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[$.BACKSLASH_ESCAPE,Y],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(G,U),relevance:0}].concat(G,U);Y.contains=_,N.contains=_;let w="[>?]>",T="[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]",b="(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>",C=[{begin:/^\s*=>/,starts:{end:"$",contains:_}},{className:"meta.prompt",begin:"^("+w+"|"+T+"|"+b+")(?=[ ])",starts:{end:"$",keywords:X,contains:_}}];return U.unshift(G),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:X,illegal:/\/\*/,contains:[$.SHEBANG({binary:"ruby"})].concat(C).concat(U).concat(_)}}function bp($){let Z=$.regex,J=/(r#)?/,H=Z.concat(J,$.UNDERSCORE_IDENT_RE),B=Z.concat(J,$.IDENT_RE),Q={className:"title.function.invoke",relevance:0,begin:Z.concat(/\b/,/(?!let|for|while|if|else|match\b)/,B,Z.lookahead(/\s*\(/))},X="([ui](8|16|32|64|128|size)|f(32|64))?",z=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],G=["true","false","Some","None","Ok","Err"],U=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],Y=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:$.IDENT_RE+"!?",type:Y,keyword:z,literal:G,built_in:U},illegal:"</",contains:[$.C_LINE_COMMENT_MODE,$.COMMENT("/\\*","\\*/",{contains:["self"]}),$.inherit($.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)([ui](8|16|32|64|128|size)|f(32|64))?"},{begin:"\\b0o([0-7_]+)([ui](8|16|32|64|128|size)|f(32|64))?"},{begin:"\\b0x([A-Fa-f0-9_]+)([ui](8|16|32|64|128|size)|f(32|64))?"},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)([ui](8|16|32|64|128|size)|f(32|64))?"}],relevance:0},{begin:[/fn/,/\s+/,H],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[$.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,H],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,H,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,H],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,H],className:{1:"keyword",3:"title.class"}},{begin:$.IDENT_RE+"::",keywords:{keyword:"Self",built_in:U,type:Y}},{className:"punctuation",begin:"->"},Q]}}var IH0=($)=>{return{IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:$.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:$.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}},yH0=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],xH0=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],hH0=[...yH0,...xH0],vH0=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),gH0=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),fH0=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),mH0=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function wp($){let Z=IH0($),J=fH0,H=gH0,B="@[a-z-]+",Q="and or not only",X="[a-zA-Z-][a-zA-Z0-9_-]*",z={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE,Z.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},Z.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+hH0.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+H.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+J.join("|")+")"},z,{begin:/\(/,end:/\)/,contains:[Z.CSS_NUMBER_MODE]},Z.CSS_VARIABLE,{className:"attribute",begin:"\\b("+mH0.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[Z.BLOCK_COMMENT,z,Z.HEXCOLOR,Z.CSS_NUMBER_MODE,$.QUOTE_STRING_MODE,$.APOS_STRING_MODE,Z.IMPORTANT,Z.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:"@[a-z-]+",keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:vH0.join(" ")},contains:[{begin:"@[a-z-]+",className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},z,$.QUOTE_STRING_MODE,$.APOS_STRING_MODE,Z.HEXCOLOR,Z.CSS_NUMBER_MODE]},Z.FUNCTION_DISPATCH]}}function Sp($){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function Rp($){let Z=$.regex,J=$.COMMENT("--","$"),H={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},B={begin:/"/,end:/"/,contains:[{match:/""/}]},Q=["true","false","unknown"],X=["double precision","large object","with timezone","without timezone"],z=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],G=["add","asc","collation","desc","final","first","last","view"],U=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],Y=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],K=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],F=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],W=Y,q=[...U,...G].filter((M)=>{return!Y.includes(M)}),N={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},D={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},A={match:Z.concat(/\b/,Z.either(...W),/\s*\(/),relevance:0,keywords:{built_in:W}};function V(M){return Z.concat(/\b/,Z.either(...M.map((_)=>{return _.replace(/\s+/,"\\s+")})),/\b/)}let L={scope:"keyword",match:V(F),relevance:0};function j(M,{exceptions:_,when:w}={}){let T=w;return _=_||[],M.map((b)=>{if(b.match(/\|\d+$/)||_.includes(b))return b;else if(T(b))return`${b}|0`;else return b})}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:j(q,{when:(M)=>M.length<3}),literal:Q,type:z,built_in:K},contains:[{scope:"type",match:V(X)},L,A,N,H,B,$.C_NUMBER_MODE,$.C_BLOCK_COMMENT_MODE,J,D]}}function xp($){if(!$)return null;if(typeof $==="string")return $;return $.source}function zX($){return j5("(?=",$,")")}function j5(...$){return $.map((J)=>xp(J)).join("")}function uH0($){let Z=$[$.length-1];if(typeof Z==="object"&&Z.constructor===Object)return $.splice($.length-1,1),Z;else return{}}function w4(...$){return"("+(uH0($).capture?"":"?:")+$.map((H)=>xp(H)).join("|")+")"}var aM=($)=>j5(/\b/,$,/\w$/.test($)?/\b/:/\B/),pH0=["Protocol","Type"].map(aM),kp=["init","self"].map(aM),cH0=["Any","Self"],iM=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Ip=["false","nil","true"],dH0=["assignment","associativity","higherThan","left","lowerThan","none","right"],lH0=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],yp=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],hp=w4(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),vp=w4(hp,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),rM=j5(hp,vp,"*"),gp=w4(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),LW=w4(gp,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),G3=j5(gp,LW,"*"),VW=j5(/[A-Z]/,LW,"*"),iH0=["attached","autoclosure",j5(/convention\(/,w4("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",j5(/objc\(/,G3,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],rH0=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function fp($){let Z={match:/\s+/,relevance:0},J=$.COMMENT("/\\*","\\*/",{contains:["self"]}),H=[$.C_LINE_COMMENT_MODE,J],B={match:[/\./,w4(...pH0,...kp)],className:{2:"keyword"}},Q={match:j5(/\./,w4(...iM)),relevance:0},X=iM.filter((F0)=>typeof F0==="string").concat(["_|0"]),z=iM.filter((F0)=>typeof F0!=="string").concat(cH0).map(aM),G={variants:[{className:"keyword",match:w4(...z,...kp)}]},U={$pattern:w4(/\b\w+/,/#\w+/),keyword:X.concat(lH0),literal:Ip},Y=[B,Q,G],K={match:j5(/\./,w4(...yp)),relevance:0},F={className:"built_in",match:j5(/\b/,w4(...yp),/(?=\()/)},W=[K,F],q={match:/->/,relevance:0},N={className:"operator",relevance:0,variants:[{match:rM},{match:`\\.(\\.|${vp})+`}]},D=[q,N],A="([0-9]_*)+",V="([0-9a-fA-F]_*)+",L={className:"number",relevance:0,variants:[{match:"\\b(([0-9]_*)+)(\\.(([0-9]_*)+))?([eE][+-]?(([0-9]_*)+))?\\b"},{match:"\\b0x(([0-9a-fA-F]_*)+)(\\.(([0-9a-fA-F]_*)+))?([pP][+-]?(([0-9]_*)+))?\\b"},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},j=(F0="")=>({className:"subst",variants:[{match:j5(/\\/,F0,/[0\\tnr"']/)},{match:j5(/\\/,F0,/u\{[0-9a-fA-F]{1,8}\}/)}]}),M=(F0="")=>({className:"subst",match:j5(/\\/,F0,/[\t ]*(?:[\r\n]|\r\n)/)}),_=(F0="")=>({className:"subst",label:"interpol",begin:j5(/\\/,F0,/\(/),end:/\)/}),w=(F0="")=>({begin:j5(F0,/"""/),end:j5(/"""/,F0),contains:[j(F0),M(F0),_(F0)]}),T=(F0="")=>({begin:j5(F0,/"/),end:j5(/"/,F0),contains:[j(F0),_(F0)]}),b={className:"string",variants:[w(),w("#"),w("##"),w("###"),T(),T("#"),T("##"),T("###")]},C=[$.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[$.BACKSLASH_ESCAPE]}],k={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:C},S=(F0)=>{let s=j5(F0,/\//),a=j5(/\//,F0);return{begin:s,end:a,contains:[...C,{scope:"comment",begin:`#(?!.*${a})`,end:/$/}]}},R={scope:"regexp",variants:[S("###"),S("##"),S("#"),k]},O={match:j5(/`/,G3,/`/)},y={className:"variable",match:/\$\d+/},I={className:"variable",match:`\\$${LW}+`},x=[O,y,I],v={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:rH0,contains:[...D,L,b]}]}},g={scope:"keyword",match:j5(/@/,w4(...iH0),zX(w4(/\(/,/\s+/)))},E={scope:"meta",match:j5(/@/,G3)},l=[v,g,E],r={match:zX(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:j5(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,LW,"+")},{className:"type",match:VW,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:j5(/\s+&\s+/,zX(VW)),relevance:0}]},h={begin:/</,end:/>/,keywords:U,contains:[...H,...Y,...l,q,r]};r.contains.push(h);let d={match:j5(G3,/\s*:/),keywords:"_|0",relevance:0},o={begin:/\(/,end:/\)/,relevance:0,keywords:U,contains:["self",d,...H,R,...Y,...W,...D,L,b,...x,...l,r]},p={begin:/</,end:/>/,keywords:"repeat each",contains:[...H,r]},i={begin:w4(zX(j5(G3,/\s*:/)),zX(j5(G3,/\s+/,G3,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:G3}]},n={begin:/\(/,end:/\)/,keywords:U,contains:[i,...H,...Y,...D,L,b,...l,r,o],endsParent:!0,illegal:/["']/},Z0={match:[/(func|macro)/,/\s+/,w4(O.match,G3,rM)],className:{1:"keyword",3:"title.function"},contains:[p,n,Z],illegal:[/\[/,/%/]},J0={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[p,n,Z],illegal:/\[|%/},U0={match:[/operator/,/\s+/,rM],className:{1:"keyword",3:"title"}},z0={begin:[/precedencegroup/,/\s+/,VW],className:{1:"keyword",3:"title"},contains:[r],keywords:[...dH0,...Ip],end:/}/},B0={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},N0={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},D0={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,G3,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:U,contains:[p,...Y,{begin:/:/,end:/\{/,keywords:U,contains:[{scope:"title.class.inherited",match:VW},...Y],relevance:0}]};for(let F0 of b.variants){let s=F0.contains.find((e)=>e.label==="interpol");s.keywords=U;let a=[...Y,...W,...D,L,b,...x];s.contains=[...a,{begin:/\(/,end:/\)/,contains:["self",...a]}]}return{name:"Swift",keywords:U,contains:[...H,Z0,J0,B0,N0,D0,U0,z0,{beginKeywords:"import",end:/$/,contains:[...H],relevance:0},R,...Y,...W,...D,L,b,...x,...l,r,o]}}var mp=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],up=["true","false","null","undefined","NaN","Infinity"],pp=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],cp=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],dp=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],lp=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ip=[].concat(dp,pp,cp);function aH0($){let Z=$.regex,J=(v,{after:g})=>{let E="</"+v[0].slice(1);return v.input.indexOf(E,g)!==-1},H="[A-Za-z$_][0-9A-Za-z$_]*",B={begin:"<>",end:"</>"},Q=/<[A-Za-z0-9\\._:-]+\s*\/>/,X={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(v,g)=>{let E=v[0].length+v.index,l=v.input[E];if(l==="<"||l===","){g.ignoreMatch();return}if(l===">"){if(!J(v,{after:E}))g.ignoreMatch()}let r,h=v.input.substring(E);if(r=h.match(/^\s*=/)){g.ignoreMatch();return}if(r=h.match(/^\s+extends\s+/)){if(r.index===0){g.ignoreMatch();return}}}},z={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:mp,literal:up,built_in:ip,"variable.language":lp},G="[0-9](_?[0-9])*",U="\\.([0-9](_?[0-9])*)",Y="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",K={className:"number",variants:[{begin:"(\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)((\\.([0-9](_?[0-9])*))|\\.)?|(\\.([0-9](_?[0-9])*)))[eE][+-]?([0-9](_?[0-9])*)\\b"},{begin:"\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)\\b((\\.([0-9](_?[0-9])*))\\b|\\.)?|(\\.([0-9](_?[0-9])*))\\b"},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},F={className:"subst",begin:"\\$\\{",end:"\\}",keywords:z,contains:[]},W={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,F],subLanguage:"xml"}},q={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,F],subLanguage:"css"}},N={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[$.BACKSLASH_ESCAPE,F],subLanguage:"graphql"}},D={className:"string",begin:"`",end:"`",contains:[$.BACKSLASH_ESCAPE,F]},V={className:"comment",variants:[$.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:"[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),$.C_BLOCK_COMMENT_MODE,$.C_LINE_COMMENT_MODE]},L=[$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,W,q,N,D,{match:/\$\d+/},K];F.contains=L.concat({begin:/\{/,end:/\}/,keywords:z,contains:["self"].concat(L)});let j=[].concat(V,F.contains),M=j.concat([{begin:/(\s*)\(/,end:/\)/,keywords:z,contains:["self"].concat(j)}]),_={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:M},w={variants:[{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s+/,/extends/,/\s+/,Z.concat("[A-Za-z$_][0-9A-Za-z$_]*","(",Z.concat(/\./,"[A-Za-z$_][0-9A-Za-z$_]*"),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*"],scope:{1:"keyword",3:"title.class"}}]},T={relevance:0,match:Z.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...pp,...cp]}},b={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},C={variants:[{match:[/function/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[_],illegal:/%/},k={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function S(v){return Z.concat("(?!",v.join("|"),")")}let R={match:Z.concat(/\b/,S([...dp,"super","import"].map((v)=>`${v}\\s*\\(`)),"[A-Za-z$_][0-9A-Za-z$_]*",Z.lookahead(/\s*\(/)),className:"title.function",relevance:0},O={begin:Z.concat(/\./,Z.lookahead(Z.concat("[A-Za-z$_][0-9A-Za-z$_]*",/(?![0-9A-Za-z$_(])/))),end:"[A-Za-z$_][0-9A-Za-z$_]*",excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},y={match:[/get|set/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},_]},I="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+$.UNDERSCORE_IDENT_RE+")\\s*=>",x={match:[/const|var|let/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s*/,/=\s*/,/(async\s*)?/,Z.lookahead(I)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[_]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:z,exports:{PARAMS_CONTAINS:M,CLASS_REFERENCE:T},illegal:/#(?![$_A-z])/,contains:[$.SHEBANG({label:"shebang",binary:"node",relevance:5}),b,$.APOS_STRING_MODE,$.QUOTE_STRING_MODE,W,q,N,D,V,{match:/\$\d+/},K,T,{scope:"attr",match:"[A-Za-z$_][0-9A-Za-z$_]*"+Z.lookahead(":"),relevance:0},x,{begin:"("+$.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[V,$.REGEXP_MODE,{className:"function",begin:I,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:$.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:z,contains:M}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:B.begin,end:B.end},{match:Q},{begin:X.begin,"on:begin":X.isTrulyOpeningTag,end:X.end}],subLanguage:"xml",contains:[{begin:X.begin,end:X.end,skip:!0,contains:["self"]}]}]},C,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+$.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[_,$.inherit($.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*",className:"title.function"})]},{match:/\.\.\./,relevance:0},O,{match:"\\$[A-Za-z$_][0-9A-Za-z$_]*",relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[_]},R,k,w,y,{match:/\$[(.]/}]}}function rp($){let Z=$.regex,J=aH0($),H="[A-Za-z$_][0-9A-Za-z$_]*",B=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],Q={begin:[/namespace/,/\s+/,$.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},X={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:B},contains:[J.exports.CLASS_REFERENCE]},z={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},G=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],U={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:mp.concat(G),literal:up,built_in:ip.concat(B),"variable.language":lp},Y={className:"meta",begin:"@[A-Za-z$_][0-9A-Za-z$_]*"},K=(N,D,A)=>{let V=N.contains.findIndex((L)=>L.label===D);if(V===-1)throw Error("can not find mode to replace");N.contains.splice(V,1,A)};Object.assign(J.keywords,U),J.exports.PARAMS_CONTAINS.push(Y);let F=J.contains.find((N)=>N.scope==="attr"),W=Object.assign({},F,{match:Z.concat("[A-Za-z$_][0-9A-Za-z$_]*",Z.lookahead(/\s*\?:/))});J.exports.PARAMS_CONTAINS.push([J.exports.CLASS_REFERENCE,F,W]),J.contains=J.contains.concat([Y,Q,X,W]),K(J,"shebang",$.SHEBANG()),K(J,"use_strict",z);let q=J.contains.find((N)=>N.label==="func.def");return q.relevance=0,Object.assign(J,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),J}function ap($){let Z=$.regex,J={className:"string",begin:/"(""|[^/n])"C\b/},H={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},B=/\d{1,2}\/\d{1,2}\/\d{4}/,Q=/\d{4}-\d{1,2}-\d{1,2}/,X=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,z=/\d{1,2}(:\d{1,2}){1,2}/,G={className:"literal",variants:[{begin:Z.concat(/# */,Z.either(Q,B),/ *#/)},{begin:Z.concat(/# */,z,/ *#/)},{begin:Z.concat(/# */,X,/ *#/)},{begin:Z.concat(/# */,Z.either(Q,B),/ +/,Z.either(X,z),/ *#/)}]},U={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},Y={className:"label",begin:/^\w+:/},K=$.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),F=$.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[J,H,G,U,Y,K,F,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[F]}]}}function op($){$.regex;let Z=$.COMMENT(/\(;/,/;\)/);Z.contains.push("self");let J=$.COMMENT(/;;/,/$/),H=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],B={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},Q={className:"variable",begin:/\$[\w_]+/},X={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},z={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},G={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},U={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:H},contains:[J,Z,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},Q,X,B,$.QUOTE_STRING_MODE,G,U,z]}}function np($){let Z=$.regex,J=Z.concat(/[\p{L}_]/u,Z.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),H=/[\p{L}0-9._:-]+/u,B={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},Q={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},X=$.inherit(Q,{begin:/\(/,end:/\)/}),z=$.inherit($.APOS_STRING_MODE,{className:"string"}),G=$.inherit($.QUOTE_STRING_MODE,{className:"string"}),U={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:H,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[B]},{begin:/'/,end:/'/,contains:[B]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[Q,G,z,X,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[Q,X,G,z]}]}]},$.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},B,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[G]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[U],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[U],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:Z.concat(/</,Z.lookahead(Z.concat(J,Z.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:J,relevance:0,starts:U}]},{className:"tag",begin:Z.concat(/<\//,Z.lookahead(Z.concat(J,/>/))),contains:[{className:"name",begin:J,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function sp($){let H={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},B={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},Q={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},X={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[$.BACKSLASH_ESCAPE,B]},z=$.inherit(X,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),G="[0-9]{4}(-[0-9][0-9]){0,2}",U="([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?",Y="(\\.[0-9]*)?",K="([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?",F={className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},W={end:",",endsWithParent:!0,excludeEnd:!0,keywords:"true false yes no null",relevance:0},q={begin:/\{/,end:/\}/,contains:[W],illegal:"\\n",relevance:0},N={begin:"\\[",end:"\\]",contains:[W],illegal:"\\n",relevance:0},D=[H,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+![\\w#;/?:@&=+$,.~*'()[\\]]+"},{className:"type",begin:"!<[\\w#;/?:@&=+$,.~*'()[\\]]+>"},{className:"type",begin:"![\\w#;/?:@&=+$,.~*'()[\\]]+"},{className:"type",begin:"!![\\w#;/?:@&=+$,.~*'()[\\]]+"},{className:"meta",begin:"&"+$.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+$.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},$.HASH_COMMENT_MODE,{beginKeywords:"true false yes no null",keywords:{literal:"true false yes no null"}},F,{className:"number",begin:$.C_NUMBER_RE+"\\b",relevance:0},q,N,Q,X],A=[...D];return A.pop(),A.push(z),W.contains=A,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:D}}var oM={arduino:au,bash:ou,c:nu,cpp:su,csharp:tu,css:eu,diff:$p,go:Zp,graphql:Jp,ini:Hp,java:Xp,javascript:Yp,json:Kp,kotlin:Fp,less:Np,lua:Ap,makefile:Dp,markdown:Vp,objectivec:Lp,perl:Mp,php:Pp,"php-template":_p,plaintext:jp,python:Op,"python-repl":Tp,r:Cp,ruby:Ep,rust:bp,scss:wp,shell:Sp,sql:Rp,swift:fp,typescript:rp,vbnet:ap,wasm:op,xml:np,yaml:sp};var Pc=P(Mc(),1);var _c=Pc.default;var jc={},gB0="hljs-";function JP($){let Z=_c.newInstance();if($)Q($);return{highlight:J,highlightAuto:H,listLanguages:B,register:Q,registerAlias:X,registered:z};function J(G,U,Y){B5(typeof G==="string","expected `string` as `name`"),B5(typeof U==="string","expected `string` as `value`");let K=Y||jc,F=typeof K.prefix==="string"?K.prefix:gB0;if(!Z.getLanguage(G))throw Error("Unknown language: `"+G+"` is not registered");Z.configure({__emitter:Oc,classPrefix:F});let W=Z.highlight(U,{ignoreIllegals:!0,language:G});if(W.errorRaised)throw Error("Could not highlight with `Highlight.js`",{cause:W.errorRaised});let q=W._emitter.root,N=q.data;return N.language=W.language,N.relevance=W.relevance,q}function H(G,U){B5(typeof G==="string","expected `string` as `value`");let K=(U||jc).subset||B(),F=-1,W=0,q;while(++F<K.length){let N=K[F];if(!Z.getLanguage(N))continue;let D=J(N,G,U);if(D.data&&D.data.relevance!==void 0&&D.data.relevance>W)W=D.data.relevance,q=D}return q||{type:"root",children:[],data:{language:void 0,relevance:W}}}function B(){return Z.listLanguages()}function Q(G,U){if(typeof G==="string")B5(U!==void 0,"expected `grammar`"),Z.registerLanguage(G,U);else{let Y;for(Y in G)if(Object.hasOwn(G,Y))Z.registerLanguage(Y,G[Y])}}function X(G,U){if(typeof G==="string")B5(U!==void 0),Z.registerAliases(typeof U==="string"?U:[...U],{languageName:G});else{let Y;for(Y in G)if(Object.hasOwn(G,Y)){let K=G[Y];Z.registerAliases(typeof K==="string"?K:[...K],{languageName:Y})}}}function z(G){return Boolean(Z.getLanguage(G))}}class Oc{constructor($){this.options=$,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText($){if($==="")return;let Z=this.stack[this.stack.length-1],J=Z.children[Z.children.length-1];if(J&&J.type==="text")J.value+=$;else Z.children.push({type:"text",value:$})}startScope($){this.openNode(String($))}endScope(){this.closeNode()}__addSublanguage($,Z){let J=this.stack[this.stack.length-1],H=$.root.children;if(Z)J.children.push({type:"element",tagName:"span",properties:{className:[Z]},children:H});else J.children.push(...H)}openNode($){let Z=this,J=$.split(".").map(function(Q,X){return X?Q+"_".repeat(X):Z.options.classPrefix+Q}),H=this.stack[this.stack.length-1],B={type:"element",tagName:"span",properties:{className:J},children:[]};H.children.push(B),this.stack.push(B)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}var fB0={};function jW($){let Z=$||fB0,J=Z.aliases,H=Z.detect||!1,B=Z.languages||oM,Q=Z.plainText,X=Z.prefix,z=Z.subset,G="hljs",U=JP(B);if(J)U.registerAlias(J);if(X){let Y=X.indexOf("-");G=Y===-1?X:X.slice(0,Y)}return function(Y,K){m3(Y,"element",function(F,W,q){if(F.tagName!=="code"||!q||q.type!=="element"||q.tagName!=="pre")return;let N=mB0(F);if(N===!1||!N&&!H||N&&Q&&Q.includes(N))return;if(!Array.isArray(F.properties.className))F.properties.className=[];if(!F.properties.className.includes(G))F.properties.className.unshift(G);let D=lM(F,{whitespace:"pre"}),A;try{A=N?U.highlight(N,D,{prefix:X}):U.highlightAuto(D,{prefix:X,subset:z})}catch(V){let L=V;if(N&&/Unknown language/.test(L.message)){K.message("Cannot highlight as `"+N+"`, it’s not registered",{ancestors:[q,F],cause:L,place:F.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw L}if(!N&&A.data&&A.data.language)F.properties.className.push("language-"+A.data.language);if(A.children.length>0)F.children=A.children})}}function mB0($){let Z=$.properties.className,J=-1;if(!Array.isArray(Z))return;let H;while(++J<Z.length){let B=String(Z[J]);if(B==="no-highlight"||B==="nohighlight")return!1;if(!H&&B.slice(0,5)==="lang-")H=B.slice(5);if(!H&&B.slice(0,9)==="language-")H=B.slice(9)}return H}function HP($,Z){let J=String($);if(typeof Z!=="string")throw TypeError("Expected character");let H=0,B=J.indexOf(Z);while(B!==-1)H++,B=J.indexOf(Z,B+Z.length);return H}function BP($){if(typeof $!=="string")throw TypeError("Expected a string");return $.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function QP($,Z,J){let B=z3((J||{}).ignore||[]),Q=uB0(Z),X=-1;while(++X<Q.length)BX($,"text",z);function z(U,Y){let K=-1,F;while(++K<Y.length){let W=Y[K],q=F?F.children:void 0;if(B(W,q?q.indexOf(W):void 0,F))return;F=W}if(F)return G(U,Y)}function G(U,Y){let K=Y[Y.length-1],F=Q[X][0],W=Q[X][1],q=0,D=K.children.indexOf(U),A=!1,V=[];F.lastIndex=0;let L=F.exec(U.value);while(L){let j=L.index,M={index:L.index,input:L.input,stack:[...Y,U]},_=W(...L,M);if(typeof _==="string")_=_.length>0?{type:"text",value:_}:void 0;if(_===!1)F.lastIndex=j+1;else{if(q!==j)V.push({type:"text",value:U.value.slice(q,j)});if(Array.isArray(_))V.push(..._);else if(_)V.push(_);q=j+L[0].length,A=!0}if(!F.global)break;L=F.exec(U.value)}if(A){if(q<U.value.length)V.push({type:"text",value:U.value.slice(q)});K.children.splice(D,1,...V)}else V=[U];return D+V.length}}function uB0($){let Z=[];if(!Array.isArray($))throw TypeError("Expected find and replace tuple or list of tuples");let J=!$[0]||Array.isArray($[0])?$:[$],H=-1;while(++H<J.length){let B=J[H];Z.push([pB0(B[0]),cB0(B[1])])}return Z}function pB0($){return typeof $==="string"?new RegExp(BP($),"g"):$}function cB0($){return typeof $==="function"?$:function(){return $}}var XP="phrasing",zP=["autolink","link","image","label"];function UP(){return{transforms:[oB0],enter:{literalAutolink:dB0,literalAutolinkEmail:GP,literalAutolinkHttp:GP,literalAutolinkWww:GP},exit:{literalAutolink:aB0,literalAutolinkEmail:rB0,literalAutolinkHttp:lB0,literalAutolinkWww:iB0}}}function YP(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:XP,notInConstruct:zP},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:XP,notInConstruct:zP},{character:":",before:"[ps]",after:"\\/",inConstruct:XP,notInConstruct:zP}]}}function dB0($){this.enter({type:"link",title:null,url:"",children:[]},$)}function GP($){this.config.enter.autolinkProtocol.call(this,$)}function lB0($){this.config.exit.autolinkProtocol.call(this,$)}function iB0($){this.config.exit.data.call(this,$);let Z=this.stack[this.stack.length-1];B5(Z.type==="link"),Z.url="http://"+this.sliceSerialize($)}function rB0($){this.config.exit.autolinkEmail.call(this,$)}function aB0($){this.exit($)}function oB0($){QP($,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,nB0],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,sB0]],{ignore:["link","linkReference"]})}function nB0($,Z,J,H,B){let Q="";if(!Tc(B))return!1;if(/^w/i.test(Z))J=Z+J,Z="",Q="http://";if(!tB0(J))return!1;let X=eB0(J+H);if(!X[0])return!1;let z={type:"link",title:null,url:Q+Z+X[0],children:[{type:"text",value:Z+X[0]}]};if(X[1])return[z,{type:"text",value:X[1]}];return z}function sB0($,Z,J,H){if(!Tc(H,!0)||/[-\d_]$/.test(J))return!1;return{type:"link",title:null,url:"mailto:"+Z+"@"+J,children:[{type:"text",value:Z+"@"+J}]}}function tB0($){let Z=$.split(".");if(Z.length<2||Z[Z.length-1]&&(/_/.test(Z[Z.length-1])||!/[a-zA-Z\d]/.test(Z[Z.length-1]))||Z[Z.length-2]&&(/_/.test(Z[Z.length-2])||!/[a-zA-Z\d]/.test(Z[Z.length-2])))return!1;return!0}function eB0($){let Z=/[!"&'),.:;<>?\]}]+$/.exec($);if(!Z)return[$,void 0];$=$.slice(0,Z.index);let J=Z[0],H=J.indexOf(")"),B=HP($,"("),Q=HP($,")");while(H!==-1&&B>Q)$+=J.slice(0,H+1),J=J.slice(H+1),H=J.indexOf(")"),Q++;return[$,J]}function Tc($,Z){let J=$.input.charCodeAt($.index-1);return($.index===0||Q3(J)||l$(J))&&(!Z||J!==47)}Cc.peek=GQ0;function $Q0(){this.buffer()}function ZQ0($){this.enter({type:"footnoteReference",identifier:"",label:""},$)}function JQ0(){this.buffer()}function HQ0($){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},$)}function BQ0($){let Z=this.resume(),J=this.stack[this.stack.length-1];B5(J.type==="footnoteReference"),J.identifier=q4(this.sliceSerialize($)).toLowerCase(),J.label=Z}function QQ0($){this.exit($)}function XQ0($){let Z=this.resume(),J=this.stack[this.stack.length-1];B5(J.type==="footnoteDefinition"),J.identifier=q4(this.sliceSerialize($)).toLowerCase(),J.label=Z}function zQ0($){this.exit($)}function GQ0(){return"["}function Cc($,Z,J,H){let B=J.createTracker(H),Q=B.move("[^"),X=J.enter("footnoteReference"),z=J.enter("reference");return Q+=B.move(J.safe(J.associationId($),{after:"]",before:Q})),z(),X(),Q+=B.move("]"),Q}function KP(){return{enter:{gfmFootnoteCallString:$Q0,gfmFootnoteCall:ZQ0,gfmFootnoteDefinitionLabelString:JQ0,gfmFootnoteDefinition:HQ0},exit:{gfmFootnoteCallString:BQ0,gfmFootnoteCall:QQ0,gfmFootnoteDefinitionLabelString:XQ0,gfmFootnoteDefinition:zQ0}}}function FP($){let Z=!1;if($&&$.firstLineBlank)Z=!0;return{handlers:{footnoteDefinition:J,footnoteReference:Cc},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function J(H,B,Q,X){let z=Q.createTracker(X),G=z.move("[^"),U=Q.enter("footnoteDefinition"),Y=Q.enter("label");if(G+=z.move(Q.safe(Q.associationId(H),{before:G,after:"]"})),Y(),G+=z.move("]:"),H.children&&H.children.length>0)z.shift(4),G+=z.move((Z?`
38
- `:" ")+Q.indentLines(Q.containerFlow(H,z.current()),Z?Ec:UQ0));return U(),G}}function UQ0($,Z,J){return Z===0?$:Ec($,Z,J)}function Ec($,Z,J){return(J?"":" ")+$}var YQ0=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];bc.peek=WQ0;function WP(){return{canContainEols:["delete"],enter:{strikethrough:KQ0},exit:{strikethrough:FQ0}}}function qP(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:YQ0}],handlers:{delete:bc}}}function KQ0($){this.enter({type:"delete",children:[]},$)}function FQ0($){this.exit($)}function bc($,Z,J,H){let B=J.createTracker(H),Q=J.enter("strikethrough"),X=B.move("~~");return X+=J.containerPhrasing($,{...B.current(),before:X,after:"~"}),X+=B.move("~~"),Q(),X}function WQ0(){return"~"}function qQ0($){return $.length}function Sc($,Z){let J=Z||{},H=(J.align||[]).concat(),B=J.stringLength||qQ0,Q=[],X=[],z=[],G=[],U=0,Y=-1;while(++Y<$.length){let N=[],D=[],A=-1;if($[Y].length>U)U=$[Y].length;while(++A<$[Y].length){let V=NQ0($[Y][A]);if(J.alignDelimiters!==!1){let L=B(V);if(D[A]=L,G[A]===void 0||L>G[A])G[A]=L}N.push(V)}X[Y]=N,z[Y]=D}let K=-1;if(typeof H==="object"&&"length"in H)while(++K<U)Q[K]=wc(H[K]);else{let N=wc(H);while(++K<U)Q[K]=N}K=-1;let F=[],W=[];while(++K<U){let N=Q[K],D="",A="";if(N===99)D=":",A=":";else if(N===108)D=":";else if(N===114)A=":";let V=J.alignDelimiters===!1?1:Math.max(1,G[K]-D.length-A.length),L=D+"-".repeat(V)+A;if(J.alignDelimiters!==!1){if(V=D.length+V+A.length,V>G[K])G[K]=V;W[K]=V}F[K]=L}X.splice(1,0,F),z.splice(1,0,W),Y=-1;let q=[];while(++Y<X.length){let N=X[Y],D=z[Y];K=-1;let A=[];while(++K<U){let V=N[K]||"",L="",j="";if(J.alignDelimiters!==!1){let M=G[K]-(D[K]||0),_=Q[K];if(_===114)L=" ".repeat(M);else if(_===99)if(M%2)L=" ".repeat(M/2+0.5),j=" ".repeat(M/2-0.5);else L=" ".repeat(M/2),j=L;else j=" ".repeat(M)}if(J.delimiterStart!==!1&&!K)A.push("|");if(J.padding!==!1&&!(J.alignDelimiters===!1&&V==="")&&(J.delimiterStart!==!1||K))A.push(" ");if(J.alignDelimiters!==!1)A.push(L);if(A.push(V),J.alignDelimiters!==!1)A.push(j);if(J.padding!==!1)A.push(" ");if(J.delimiterEnd!==!1||K!==U-1)A.push("|")}q.push(J.delimiterEnd===!1?A.join("").replace(/ +$/,""):A.join(""))}return q.join(`
39
- `)}function NQ0($){return $===null||$===void 0?"":String($)}function wc($){let Z=typeof $==="string"?$.codePointAt(0):0;return Z===67||Z===99?99:Z===76||Z===108?108:Z===82||Z===114?114:0}function Rc($,Z,J,H){let B=J.enter("blockquote"),Q=J.createTracker(H);Q.move("> "),Q.shift(2);let X=J.indentLines(J.containerFlow($,Q.current()),AQ0);return B(),X}function AQ0($,Z,J){return">"+(J?"":" ")+$}function Ic($,Z){return kc($,Z.inConstruct,!0)&&!kc($,Z.notInConstruct,!1)}function kc($,Z,J){if(typeof Z==="string")Z=[Z];if(!Z||Z.length===0)return J;let H=-1;while(++H<Z.length)if($.includes(Z[H]))return!0;return!1}function NP($,Z,J,H){let B=-1;while(++B<J.unsafe.length)if(J.unsafe[B].character===`
40
- `&&Ic(J.stack,J.unsafe[B]))return/[ \t]/.test(H.before)?"":" ";return"\\\n"}function yc($,Z){let J=String($),H=J.indexOf(Z),B=H,Q=0,X=0;if(typeof Z!=="string")throw TypeError("Expected substring");while(H!==-1){if(H===B){if(++Q>X)X=Q}else Q=1;B=H+Z.length,H=J.indexOf(Z,B)}return X}function xc($,Z){return Boolean(Z.options.fences===!1&&$.value&&!$.lang&&/[^ \r\n]/.test($.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test($.value))}function hc($){let Z=$.options.fence||"`";if(Z!=="`"&&Z!=="~")throw Error("Cannot serialize code with `"+Z+"` for `options.fence`, expected `` ` `` or `~`");return Z}function vc($,Z,J,H){let B=hc(J),Q=$.value||"",X=B==="`"?"GraveAccent":"Tilde";if(xc($,J)){let K=J.enter("codeIndented"),F=J.indentLines(Q,DQ0);return K(),F}let z=J.createTracker(H),G=B.repeat(Math.max(yc(Q,B)+1,3)),U=J.enter("codeFenced"),Y=z.move(G);if($.lang){let K=J.enter(`codeFencedLang${X}`);Y+=z.move(J.safe($.lang,{before:Y,after:" ",encode:["`"],...z.current()})),K()}if($.lang&&$.meta){let K=J.enter(`codeFencedMeta${X}`);Y+=z.move(" "),Y+=z.move(J.safe($.meta,{before:Y,after:`
41
- `,encode:["`"],...z.current()})),K()}if(Y+=z.move(`
42
- `),Q)Y+=z.move(Q+`
43
- `);return Y+=z.move(G),U(),Y}function DQ0($,Z,J){return(J?"":" ")+$}function NH($){let Z=$.options.quote||'"';if(Z!=='"'&&Z!=="'")throw Error("Cannot serialize title with `"+Z+"` for `options.quote`, expected `\"`, or `'`");return Z}function gc($,Z,J,H){let B=NH(J),Q=B==='"'?"Quote":"Apostrophe",X=J.enter("definition"),z=J.enter("label"),G=J.createTracker(H),U=G.move("[");if(U+=G.move(J.safe(J.associationId($),{before:U,after:"]",...G.current()})),U+=G.move("]: "),z(),!$.url||/[\0- \u007F]/.test($.url))z=J.enter("destinationLiteral"),U+=G.move("<"),U+=G.move(J.safe($.url,{before:U,after:">",...G.current()})),U+=G.move(">");else z=J.enter("destinationRaw"),U+=G.move(J.safe($.url,{before:U,after:$.title?" ":`
44
- `,...G.current()}));if(z(),$.title)z=J.enter(`title${Q}`),U+=G.move(" "+B),U+=G.move(J.safe($.title,{before:U,after:B,...G.current()})),U+=G.move(B),z();return X(),U}function fc($){let Z=$.options.emphasis||"*";if(Z!=="*"&&Z!=="_")throw Error("Cannot serialize emphasis with `"+Z+"` for `options.emphasis`, expected `*`, or `_`");return Z}function M7($){return"&#x"+$.toString(16).toUpperCase()+";"}function AH($,Z,J){let H=f3($),B=f3(Z);if(H===void 0)return B===void 0?J==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:B===1?{inside:!0,outside:!0}:{inside:!1,outside:!0};if(H===1)return B===void 0?{inside:!1,outside:!1}:B===1?{inside:!0,outside:!0}:{inside:!1,outside:!1};return B===void 0?{inside:!1,outside:!1}:B===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}AP.peek=VQ0;function AP($,Z,J,H){let B=fc(J),Q=J.enter("emphasis"),X=J.createTracker(H),z=X.move(B),G=X.move(J.containerPhrasing($,{after:B,before:z,...X.current()})),U=G.charCodeAt(0),Y=AH(H.before.charCodeAt(H.before.length-1),U,B);if(Y.inside)G=M7(U)+G.slice(1);let K=G.charCodeAt(G.length-1),F=AH(H.after.charCodeAt(0),K,B);if(F.inside)G=G.slice(0,-1)+M7(K);let W=X.move(B);return Q(),J.attentionEncodeSurroundingInfo={after:F.outside,before:Y.outside},z+G+W}function VQ0($,Z,J){return J.options.emphasis||"*"}function mc($,Z){let J=!1;return m3($,function(H){if("value"in H&&/\r?\n|\r/.test(H.value)||H.type==="break")return J=!0,n$}),Boolean((!$.depth||$.depth<3)&&c$($)&&(Z.options.setext||J))}function uc($,Z,J,H){let B=Math.max(Math.min(6,$.depth||1),1),Q=J.createTracker(H);if(mc($,J)){let Y=J.enter("headingSetext"),K=J.enter("phrasing"),F=J.containerPhrasing($,{...Q.current(),before:`
45
- `,after:`
46
- `});return K(),Y(),F+`
47
- `+(B===1?"=":"-").repeat(F.length-(Math.max(F.lastIndexOf("\r"),F.lastIndexOf(`
48
- `))+1))}let X="#".repeat(B),z=J.enter("headingAtx"),G=J.enter("phrasing");Q.move(X+" ");let U=J.containerPhrasing($,{before:"# ",after:`
49
- `,...Q.current()});if(/^[\t ]/.test(U))U=M7(U.charCodeAt(0))+U.slice(1);if(U=U?X+" "+U:X,J.options.closeAtx)U+=" "+X;return G(),z(),U}DP.peek=LQ0;function DP($){return $.value||""}function LQ0(){return"<"}VP.peek=MQ0;function VP($,Z,J,H){let B=NH(J),Q=B==='"'?"Quote":"Apostrophe",X=J.enter("image"),z=J.enter("label"),G=J.createTracker(H),U=G.move("![");if(U+=G.move(J.safe($.alt,{before:U,after:"]",...G.current()})),U+=G.move("]("),z(),!$.url&&$.title||/[\0- \u007F]/.test($.url))z=J.enter("destinationLiteral"),U+=G.move("<"),U+=G.move(J.safe($.url,{before:U,after:">",...G.current()})),U+=G.move(">");else z=J.enter("destinationRaw"),U+=G.move(J.safe($.url,{before:U,after:$.title?" ":")",...G.current()}));if(z(),$.title)z=J.enter(`title${Q}`),U+=G.move(" "+B),U+=G.move(J.safe($.title,{before:U,after:B,...G.current()})),U+=G.move(B),z();return U+=G.move(")"),X(),U}function MQ0(){return"!"}LP.peek=PQ0;function LP($,Z,J,H){let B=$.referenceType,Q=J.enter("imageReference"),X=J.enter("label"),z=J.createTracker(H),G=z.move("!["),U=J.safe($.alt,{before:G,after:"]",...z.current()});G+=z.move(U+"]["),X();let Y=J.stack;J.stack=[],X=J.enter("reference");let K=J.safe(J.associationId($),{before:G,after:"]",...z.current()});if(X(),J.stack=Y,Q(),B==="full"||!U||U!==K)G+=z.move(K+"]");else if(B==="shortcut")G=G.slice(0,-1);else G+=z.move("]");return G}function PQ0(){return"!"}MP.peek=_Q0;function MP($,Z,J){let H=$.value||"",B="`",Q=-1;while(new RegExp("(^|[^`])"+B+"([^`]|$)").test(H))B+="`";if(/[^ \r\n]/.test(H)&&(/^[ \r\n]/.test(H)&&/[ \r\n]$/.test(H)||/^`|`$/.test(H)))H=" "+H+" ";while(++Q<J.unsafe.length){let X=J.unsafe[Q],z=J.compilePattern(X),G;if(!X.atBreak)continue;while(G=z.exec(H)){let U=G.index;if(H.charCodeAt(U)===10&&H.charCodeAt(U-1)===13)U--;H=H.slice(0,U)+" "+H.slice(G.index+1)}}return B+H+B}function _Q0(){return"`"}function PP($,Z){let J=c$($);return Boolean(!Z.options.resourceLink&&$.url&&!$.title&&$.children&&$.children.length===1&&$.children[0].type==="text"&&(J===$.url||"mailto:"+J===$.url)&&/^[a-z][a-z+.-]+:/i.test($.url)&&!/[\0- <>\u007F]/.test($.url))}_P.peek=jQ0;function _P($,Z,J,H){let B=NH(J),Q=B==='"'?"Quote":"Apostrophe",X=J.createTracker(H),z,G;if(PP($,J)){let Y=J.stack;J.stack=[],z=J.enter("autolink");let K=X.move("<");return K+=X.move(J.containerPhrasing($,{before:K,after:">",...X.current()})),K+=X.move(">"),z(),J.stack=Y,K}z=J.enter("link"),G=J.enter("label");let U=X.move("[");if(U+=X.move(J.containerPhrasing($,{before:U,after:"](",...X.current()})),U+=X.move("]("),G(),!$.url&&$.title||/[\0- \u007F]/.test($.url))G=J.enter("destinationLiteral"),U+=X.move("<"),U+=X.move(J.safe($.url,{before:U,after:">",...X.current()})),U+=X.move(">");else G=J.enter("destinationRaw"),U+=X.move(J.safe($.url,{before:U,after:$.title?" ":")",...X.current()}));if(G(),$.title)G=J.enter(`title${Q}`),U+=X.move(" "+B),U+=X.move(J.safe($.title,{before:U,after:B,...X.current()})),U+=X.move(B),G();return U+=X.move(")"),z(),U}function jQ0($,Z,J){return PP($,J)?"<":"["}jP.peek=OQ0;function jP($,Z,J,H){let B=$.referenceType,Q=J.enter("linkReference"),X=J.enter("label"),z=J.createTracker(H),G=z.move("["),U=J.containerPhrasing($,{before:G,after:"]",...z.current()});G+=z.move(U+"]["),X();let Y=J.stack;J.stack=[],X=J.enter("reference");let K=J.safe(J.associationId($),{before:G,after:"]",...z.current()});if(X(),J.stack=Y,Q(),B==="full"||!U||U!==K)G+=z.move(K+"]");else if(B==="shortcut")G=G.slice(0,-1);else G+=z.move("]");return G}function OQ0(){return"["}function DH($){let Z=$.options.bullet||"*";if(Z!=="*"&&Z!=="+"&&Z!=="-")throw Error("Cannot serialize items with `"+Z+"` for `options.bullet`, expected `*`, `+`, or `-`");return Z}function pc($){let Z=DH($),J=$.options.bulletOther;if(!J)return Z==="*"?"-":"*";if(J!=="*"&&J!=="+"&&J!=="-")throw Error("Cannot serialize items with `"+J+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(J===Z)throw Error("Expected `bullet` (`"+Z+"`) and `bulletOther` (`"+J+"`) to be different");return J}function cc($){let Z=$.options.bulletOrdered||".";if(Z!=="."&&Z!==")")throw Error("Cannot serialize items with `"+Z+"` for `options.bulletOrdered`, expected `.` or `)`");return Z}function OW($){let Z=$.options.rule||"*";if(Z!=="*"&&Z!=="-"&&Z!=="_")throw Error("Cannot serialize rules with `"+Z+"` for `options.rule`, expected `*`, `-`, or `_`");return Z}function dc($,Z,J,H){let B=J.enter("list"),Q=J.bulletCurrent,X=$.ordered?cc(J):DH(J),z=$.ordered?X==="."?")":".":pc(J),G=Z&&J.bulletLastUsed?X===J.bulletLastUsed:!1;if(!$.ordered){let Y=$.children?$.children[0]:void 0;if((X==="*"||X==="-")&&Y&&(!Y.children||!Y.children[0])&&J.stack[J.stack.length-1]==="list"&&J.stack[J.stack.length-2]==="listItem"&&J.stack[J.stack.length-3]==="list"&&J.stack[J.stack.length-4]==="listItem"&&J.indexStack[J.indexStack.length-1]===0&&J.indexStack[J.indexStack.length-2]===0&&J.indexStack[J.indexStack.length-3]===0)G=!0;if(OW(J)===X&&Y){let K=-1;while(++K<$.children.length){let F=$.children[K];if(F&&F.type==="listItem"&&F.children&&F.children[0]&&F.children[0].type==="thematicBreak"){G=!0;break}}}}if(G)X=z;J.bulletCurrent=X;let U=J.containerFlow($,H);return J.bulletLastUsed=X,J.bulletCurrent=Q,B(),U}function lc($){let Z=$.options.listItemIndent||"one";if(Z!=="tab"&&Z!=="one"&&Z!=="mixed")throw Error("Cannot serialize items with `"+Z+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return Z}function ic($,Z,J,H){let B=lc(J),Q=J.bulletCurrent||DH(J);if(Z&&Z.type==="list"&&Z.ordered)Q=(typeof Z.start==="number"&&Z.start>-1?Z.start:1)+(J.options.incrementListMarker===!1?0:Z.children.indexOf($))+Q;let X=Q.length+1;if(B==="tab"||B==="mixed"&&(Z&&Z.type==="list"&&Z.spread||$.spread))X=Math.ceil(X/4)*4;let z=J.createTracker(H);z.move(Q+" ".repeat(X-Q.length)),z.shift(X);let G=J.enter("listItem"),U=J.indentLines(J.containerFlow($,z.current()),Y);return G(),U;function Y(K,F,W){if(F)return(W?"":" ".repeat(X))+K;return(W?Q:Q+" ".repeat(X-Q.length))+K}}function rc($,Z,J,H){let B=J.enter("paragraph"),Q=J.enter("phrasing"),X=J.containerPhrasing($,H);return Q(),B(),X}var OP=z3(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function ac($,Z,J,H){return($.children.some(function(X){return OP(X)})?J.containerPhrasing:J.containerFlow).call(J,$,H)}function oc($){let Z=$.options.strong||"*";if(Z!=="*"&&Z!=="_")throw Error("Cannot serialize strong with `"+Z+"` for `options.strong`, expected `*`, or `_`");return Z}TP.peek=TQ0;function TP($,Z,J,H){let B=oc(J),Q=J.enter("strong"),X=J.createTracker(H),z=X.move(B+B),G=X.move(J.containerPhrasing($,{after:B,before:z,...X.current()})),U=G.charCodeAt(0),Y=AH(H.before.charCodeAt(H.before.length-1),U,B);if(Y.inside)G=M7(U)+G.slice(1);let K=G.charCodeAt(G.length-1),F=AH(H.after.charCodeAt(0),K,B);if(F.inside)G=G.slice(0,-1)+M7(K);let W=X.move(B+B);return Q(),J.attentionEncodeSurroundingInfo={after:F.outside,before:Y.outside},z+G+W}function TQ0($,Z,J){return J.options.strong||"*"}function nc($,Z,J,H){return J.safe($.value,H)}function sc($){let Z=$.options.ruleRepetition||3;if(Z<3)throw Error("Cannot serialize rules with repetition `"+Z+"` for `options.ruleRepetition`, expected `3` or more");return Z}function tc($,Z,J){let H=(OW(J)+(J.options.ruleSpaces?" ":"")).repeat(sc(J));return J.options.ruleSpaces?H.slice(0,-1):H}var YX={blockquote:Rc,break:NP,code:vc,definition:gc,emphasis:AP,hardBreak:NP,heading:uc,html:DP,image:VP,imageReference:LP,inlineCode:MP,link:_P,linkReference:jP,list:dc,listItem:ic,paragraph:rc,root:ac,strong:TP,text:nc,thematicBreak:tc};function EP(){return{enter:{table:CQ0,tableData:ec,tableHeader:ec,tableRow:bQ0},exit:{codeText:wQ0,table:EQ0,tableData:CP,tableHeader:CP,tableRow:CP}}}function CQ0($){let Z=$._align;B5(Z,"expected `_align` on table"),this.enter({type:"table",align:Z.map(function(J){return J==="none"?null:J}),children:[]},$),this.data.inTable=!0}function EQ0($){this.exit($),this.data.inTable=void 0}function bQ0($){this.enter({type:"tableRow",children:[]},$)}function CP($){this.exit($)}function ec($){this.enter({type:"tableCell",children:[]},$)}function wQ0($){let Z=this.resume();if(this.data.inTable)Z=Z.replace(/\\([\\|])/g,SQ0);let J=this.stack[this.stack.length-1];B5(J.type==="inlineCode"),J.value=Z,this.exit($)}function SQ0($,Z){return Z==="|"?Z:$}function bP($){let Z=$||{},J=Z.tableCellPadding,H=Z.tablePipeAlign,B=Z.stringLength,Q=J?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
50
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:F,table:X,tableCell:G,tableRow:z}};function X(W,q,N,D){return U(Y(W,N,D),W.align)}function z(W,q,N,D){let A=K(W,N,D),V=U([A]);return V.slice(0,V.indexOf(`
51
- `))}function G(W,q,N,D){let A=N.enter("tableCell"),V=N.enter("phrasing"),L=N.containerPhrasing(W,{...D,before:Q,after:Q});return V(),A(),L}function U(W,q){return Sc(W,{align:q,alignDelimiters:H,padding:J,stringLength:B})}function Y(W,q,N){let D=W.children,A=-1,V=[],L=q.enter("table");while(++A<D.length)V[A]=K(D[A],q,N);return L(),V}function K(W,q,N){let D=W.children,A=-1,V=[],L=q.enter("tableRow");while(++A<D.length)V[A]=G(D[A],W,q,N);return L(),V}function F(W,q,N){let D=YX.inlineCode(W,q,N);if(N.stack.includes("tableCell"))D=D.replace(/\|/g,"\\$&");return D}}function wP(){return{exit:{taskListCheckValueChecked:$d,taskListCheckValueUnchecked:$d,paragraph:RQ0}}}function SP(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:kQ0}}}function $d($){let Z=this.stack[this.stack.length-2];B5(Z.type==="listItem"),Z.checked=$.type==="taskListCheckValueChecked"}function RQ0($){let Z=this.stack[this.stack.length-2];if(Z&&Z.type==="listItem"&&typeof Z.checked==="boolean"){let J=this.stack[this.stack.length-1];B5(J.type==="paragraph");let H=J.children[0];if(H&&H.type==="text"){let B=Z.children,Q=-1,X;while(++Q<B.length){let z=B[Q];if(z.type==="paragraph"){X=z;break}}if(X===J){if(H.value=H.value.slice(1),H.value.length===0)J.children.shift();else if(J.position&&H.position&&typeof H.position.start.offset==="number")H.position.start.column++,H.position.start.offset++,J.position.start=Object.assign({},H.position.start)}}}this.exit($)}function kQ0($,Z,J,H){let B=$.children[0],Q=typeof $.checked==="boolean"&&B&&B.type==="paragraph",X="["+($.checked?"x":" ")+"] ",z=J.createTracker(H);if(Q)z.move(X);let G=YX.listItem($,Z,J,{...H,...z.current()});if(Q)G=G.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,U);return G;function U(Y){return Y+X}}function RP(){return[UP(),KP(),WP(),EP(),wP()]}function kP($){return{extensions:[YP(),FP($),qP(),bP($),SP()]}}var IQ0={tokenize:gQ0,partial:!0},Zd={tokenize:fQ0,partial:!0},Jd={tokenize:mQ0,partial:!0},Hd={tokenize:uQ0,partial:!0},yQ0={tokenize:pQ0,partial:!0},Bd={name:"wwwAutolink",tokenize:hQ0,previous:Xd},Qd={name:"protocolAutolink",tokenize:vQ0,previous:zd},p3={name:"emailAutolink",tokenize:xQ0,previous:Gd},U3={};function yP(){return{text:U3}}var e$=48;while(e$<123)if(U3[e$]=p3,e$++,e$===58)e$=65;else if(e$===91)e$=97;U3[43]=p3;U3[45]=p3;U3[46]=p3;U3[95]=p3;U3[72]=[p3,Qd];U3[104]=[p3,Qd];U3[87]=[p3,Bd];U3[119]=[p3,Bd];function xQ0($,Z,J){let H=this,B,Q;return X;function X(K){if(!IP(K)||!Gd.call(H,H.previous)||xP(H.events))return J(K);return $.enter("literalAutolink"),$.enter("literalAutolinkEmail"),z(K)}function z(K){if(IP(K))return $.consume(K),z;if(K===64)return $.consume(K),G;return J(K)}function G(K){if(K===46)return $.check(yQ0,Y,U)(K);if(K===45||K===95||o5(K))return Q=!0,$.consume(K),G;return Y(K)}function U(K){return $.consume(K),B=!0,G}function Y(K){if(Q&&B&&V2(H.previous))return $.exit("literalAutolinkEmail"),$.exit("literalAutolink"),Z(K);return J(K)}}function hQ0($,Z,J){let H=this;return B;function B(X){if(X!==87&&X!==119||!Xd.call(H,H.previous)||xP(H.events))return J(X);return $.enter("literalAutolink"),$.enter("literalAutolinkWww"),$.check(IQ0,$.attempt(Zd,$.attempt(Jd,Q),J),J)(X)}function Q(X){return $.exit("literalAutolinkWww"),$.exit("literalAutolink"),Z(X)}}function vQ0($,Z,J){let H=this,B="",Q=!1;return X;function X(K){if((K===72||K===104)&&zd.call(H,H.previous)&&!xP(H.events))return $.enter("literalAutolink"),$.enter("literalAutolinkHttp"),B+=String.fromCodePoint(K),$.consume(K),z;return J(K)}function z(K){if(V2(K)&&B.length<5)return B+=String.fromCodePoint(K),$.consume(K),z;if(K===58){let F=B.toLowerCase();if(F==="http"||F==="https")return $.consume(K),G}return J(K)}function G(K){if(K===47){if($.consume(K),Q)return U;return Q=!0,G}return J(K)}function U(K){return K===null||d$(K)||y1(K)||Q3(K)||l$(K)?J(K):$.attempt(Zd,$.attempt(Jd,Y),J)(K)}function Y(K){return $.exit("literalAutolinkHttp"),$.exit("literalAutolink"),Z(K)}}function gQ0($,Z,J){let H=0;return B;function B(X){if((X===87||X===119)&&H<3)return H++,$.consume(X),B;if(X===46&&H===3)return $.consume(X),Q;return J(X)}function Q(X){return X===null?J(X):Z(X)}}function fQ0($,Z,J){let H,B,Q;return X;function X(U){if(U===46||U===95)return $.check(Hd,G,z)(U);if(U===null||y1(U)||Q3(U)||U!==45&&l$(U))return G(U);return Q=!0,$.consume(U),X}function z(U){if(U===95)H=!0;else B=H,H=void 0;return $.consume(U),X}function G(U){if(B||H||!Q)return J(U);return Z(U)}}function mQ0($,Z){let J=0,H=0;return B;function B(X){if(X===40)return J++,$.consume(X),B;if(X===41&&H<J)return Q(X);if(X===33||X===34||X===38||X===39||X===41||X===42||X===44||X===46||X===58||X===59||X===60||X===63||X===93||X===95||X===126)return $.check(Hd,Z,Q)(X);if(X===null||y1(X)||Q3(X))return Z(X);return $.consume(X),B}function Q(X){if(X===41)H++;return $.consume(X),B}}function uQ0($,Z,J){return H;function H(z){if(z===33||z===34||z===39||z===41||z===42||z===44||z===46||z===58||z===59||z===63||z===95||z===126)return $.consume(z),H;if(z===38)return $.consume(z),Q;if(z===93)return $.consume(z),B;if(z===60||z===null||y1(z)||Q3(z))return Z(z);return J(z)}function B(z){if(z===null||z===40||z===91||y1(z)||Q3(z))return Z(z);return H(z)}function Q(z){return V2(z)?X(z):J(z)}function X(z){if(z===59)return $.consume(z),H;if(V2(z))return $.consume(z),X;return J(z)}}function pQ0($,Z,J){return H;function H(Q){return $.consume(Q),B}function B(Q){return o5(Q)?J(Q):Z(Q)}}function Xd($){return $===null||$===40||$===42||$===95||$===91||$===93||$===126||y1($)}function zd($){return!V2($)}function Gd($){return!($===47||IP($))}function IP($){return $===43||$===45||$===46||$===95||o5($)}function xP($){let Z=$.length,J=!1;while(Z--){let H=$[Z][1];if((H.type==="labelLink"||H.type==="labelImage")&&!H._balanced){J=!0;break}if(H._gfmAutolinkLiteralWalkedInto){J=!1;break}}if($.length>0&&!J)$[$.length-1][1]._gfmAutolinkLiteralWalkedInto=!0;return J}var cQ0={tokenize:nQ0,partial:!0};function hP(){return{document:{[91]:{name:"gfmFootnoteDefinition",tokenize:rQ0,continuation:{tokenize:aQ0},exit:oQ0}},text:{[91]:{name:"gfmFootnoteCall",tokenize:iQ0},[93]:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:dQ0,resolveTo:lQ0}}}}function dQ0($,Z,J){let H=this,B=H.events.length,Q=H.parser.gfmFootnotes||(H.parser.gfmFootnotes=[]),X;while(B--){let G=H.events[B][1];if(G.type==="labelImage"){X=G;break}if(G.type==="gfmFootnoteCall"||G.type==="labelLink"||G.type==="label"||G.type==="image"||G.type==="link")break}return z;function z(G){if(!X||!X._balanced)return J(G);let U=q4(H.sliceSerialize({start:X.end,end:H.now()}));if(U.codePointAt(0)!==94||!Q.includes(U.slice(1)))return J(G);return $.enter("gfmFootnoteCallLabelMarker"),$.consume(G),$.exit("gfmFootnoteCallLabelMarker"),Z(G)}}function lQ0($,Z){let J=$.length,H;while(J--)if($[J][1].type==="labelImage"&&$[J][0]==="enter"){H=$[J][1];break}$[J+1][1].type="data",$[J+3][1].type="gfmFootnoteCallLabelMarker";let B={type:"gfmFootnoteCall",start:Object.assign({},$[J+3][1].start),end:Object.assign({},$[$.length-1][1].end)},Q={type:"gfmFootnoteCallMarker",start:Object.assign({},$[J+3][1].end),end:Object.assign({},$[J+3][1].end)};Q.end.column++,Q.end.offset++,Q.end._bufferIndex++;let X={type:"gfmFootnoteCallString",start:Object.assign({},Q.end),end:Object.assign({},$[$.length-1][1].start)},z={type:"chunkString",contentType:"string",start:Object.assign({},X.start),end:Object.assign({},X.end)},G=[$[J+1],$[J+2],["enter",B,Z],$[J+3],$[J+4],["enter",Q,Z],["exit",Q,Z],["enter",X,Z],["enter",z,Z],["exit",z,Z],["exit",X,Z],$[$.length-2],$[$.length-1],["exit",B,Z]];return $.splice(J,$.length-J+1,...G),$}function iQ0($,Z,J){let H=this,B=H.parser.gfmFootnotes||(H.parser.gfmFootnotes=[]),Q=0,X;return z;function z(K){return $.enter("gfmFootnoteCall"),$.enter("gfmFootnoteCallLabelMarker"),$.consume(K),$.exit("gfmFootnoteCallLabelMarker"),G}function G(K){if(K!==94)return J(K);return $.enter("gfmFootnoteCallMarker"),$.consume(K),$.exit("gfmFootnoteCallMarker"),$.enter("gfmFootnoteCallString"),$.enter("chunkString").contentType="string",U}function U(K){if(Q>999||K===93&&!X||K===null||K===91||y1(K))return J(K);if(K===93){$.exit("chunkString");let F=$.exit("gfmFootnoteCallString");if(!B.includes(q4(H.sliceSerialize(F))))return J(K);return $.enter("gfmFootnoteCallLabelMarker"),$.consume(K),$.exit("gfmFootnoteCallLabelMarker"),$.exit("gfmFootnoteCall"),Z}if(!y1(K))X=!0;return Q++,$.consume(K),K===92?Y:U}function Y(K){if(K===91||K===92||K===93)return $.consume(K),Q++,U;return U(K)}}function rQ0($,Z,J){let H=this,B=H.parser.gfmFootnotes||(H.parser.gfmFootnotes=[]),Q,X=0,z;return G;function G(q){return $.enter("gfmFootnoteDefinition")._container=!0,$.enter("gfmFootnoteDefinitionLabel"),$.enter("gfmFootnoteDefinitionLabelMarker"),$.consume(q),$.exit("gfmFootnoteDefinitionLabelMarker"),U}function U(q){if(q===94)return $.enter("gfmFootnoteDefinitionMarker"),$.consume(q),$.exit("gfmFootnoteDefinitionMarker"),$.enter("gfmFootnoteDefinitionLabelString"),$.enter("chunkString").contentType="string",Y;return J(q)}function Y(q){if(X>999||q===93&&!z||q===null||q===91||y1(q))return J(q);if(q===93){$.exit("chunkString");let N=$.exit("gfmFootnoteDefinitionLabelString");return Q=q4(H.sliceSerialize(N)),$.enter("gfmFootnoteDefinitionLabelMarker"),$.consume(q),$.exit("gfmFootnoteDefinitionLabelMarker"),$.exit("gfmFootnoteDefinitionLabel"),F}if(!y1(q))z=!0;return X++,$.consume(q),q===92?K:Y}function K(q){if(q===91||q===92||q===93)return $.consume(q),X++,Y;return Y(q)}function F(q){if(q===58){if($.enter("definitionMarker"),$.consume(q),$.exit("definitionMarker"),!B.includes(Q))B.push(Q);return Z1($,W,"gfmFootnoteDefinitionWhitespace")}return J(q)}function W(q){return Z(q)}}function aQ0($,Z,J){return $.check(X3,Z,$.attempt(cQ0,Z,J))}function oQ0($){$.exit("gfmFootnoteDefinition")}function nQ0($,Z,J){let H=this;return Z1($,B,"gfmFootnoteDefinitionIndent",5);function B(Q){let X=H.events[H.events.length-1];return X&&X[1].type==="gfmFootnoteDefinitionIndent"&&X[2].sliceSerialize(X[1],!0).length===4?Z(Q):J(Q)}}function vP($){let J=($||{}).singleTilde,H={name:"strikethrough",tokenize:Q,resolveAll:B};if(J===null||J===void 0)J=!0;return{text:{[126]:H},insideSpan:{null:[H]},attentionMarkers:{null:[126]}};function B(X,z){let G=-1;while(++G<X.length)if(X[G][0]==="enter"&&X[G][1].type==="strikethroughSequenceTemporary"&&X[G][1]._close){let U=G;while(U--)if(X[U][0]==="exit"&&X[U][1].type==="strikethroughSequenceTemporary"&&X[U][1]._open&&X[G][1].end.offset-X[G][1].start.offset===X[U][1].end.offset-X[U][1].start.offset){X[G][1].type="strikethroughSequence",X[U][1].type="strikethroughSequence";let Y={type:"strikethrough",start:Object.assign({},X[U][1].start),end:Object.assign({},X[G][1].end)},K={type:"strikethroughText",start:Object.assign({},X[U][1].end),end:Object.assign({},X[G][1].start)},F=[["enter",Y,z],["enter",X[U][1],z],["exit",X[U][1],z],["enter",K,z]],W=z.parser.constructs.insideSpan.null;if(W)Z2(F,F.length,0,D7(W,X.slice(U+1,G),z));Z2(F,F.length,0,[["exit",K,z],["enter",X[G][1],z],["exit",X[G][1],z],["exit",Y,z]]),Z2(X,U-1,G-U+3,F),G=U+F.length-2;break}}G=-1;while(++G<X.length)if(X[G][1].type==="strikethroughSequenceTemporary")X[G][1].type="data";return X}function Q(X,z,G){let U=this.previous,Y=this.events,K=0;return F;function F(q){if(U===126&&Y[Y.length-1][1].type!=="characterEscape")return G(q);return X.enter("strikethroughSequenceTemporary"),W(q)}function W(q){let N=f3(U);if(q===126){if(K>1)return G(q);return X.consume(q),K++,W}if(K<2&&!J)return G(q);let D=X.exit("strikethroughSequenceTemporary"),A=f3(q);return D._open=!A||A===2&&Boolean(N),D._close=!N||N===2&&Boolean(A),z(q)}}}class gP{constructor(){this.map=[]}add($,Z,J){sQ0(this,$,Z,J)}consume($){if(this.map.sort(function(B,Q){return B[0]-Q[0]}),this.map.length===0)return;let Z=this.map.length,J=[];while(Z>0)Z-=1,J.push($.slice(this.map[Z][0]+this.map[Z][1]),this.map[Z][2]),$.length=this.map[Z][0];J.push($.slice()),$.length=0;let H=J.pop();while(H){for(let B of H)$.push(B);H=J.pop()}this.map.length=0}}function sQ0($,Z,J,H){let B=0;if(J===0&&H.length===0)return;while(B<$.map.length){if($.map[B][0]===Z){$.map[B][1]+=J,$.map[B][2].push(...H);return}B+=1}$.map.push([Z,J,H])}function Ud($,Z){let J=!1,H=[];while(Z<$.length){let B=$[Z];if(J){if(B[0]==="enter"){if(B[1].type==="tableContent")H.push($[Z+1][1].type==="tableDelimiterMarker"?"left":"none")}else if(B[1].type==="tableContent"){if($[Z-1][1].type==="tableDelimiterMarker"){let Q=H.length-1;H[Q]=H[Q]==="left"?"center":"right"}}else if(B[1].type==="tableDelimiterRow")break}else if(B[0]==="enter"&&B[1].type==="tableDelimiterRow")J=!0;Z+=1}return H}function fP(){return{flow:{null:{name:"table",tokenize:tQ0,resolveAll:eQ0}}}}function tQ0($,Z,J){let H=this,B=0,Q=0,X;return z;function z(C){let k=H.events.length-1;while(k>-1){let O=H.events[k][1].type;if(O==="lineEnding"||O==="linePrefix")k--;else break}let S=k>-1?H.events[k][1].type:null,R=S==="tableHead"||S==="tableRow"?_:G;if(R===_&&H.parser.lazy[H.now().line])return J(C);return R(C)}function G(C){return $.enter("tableHead"),$.enter("tableRow"),U(C)}function U(C){if(C===124)return Y(C);return X=!0,Q+=1,Y(C)}function Y(C){if(C===null)return J(C);if(u0(C)){if(Q>1)return Q=0,H.interrupt=!0,$.exit("tableRow"),$.enter("lineEnding"),$.consume(C),$.exit("lineEnding"),W;return J(C)}if(B1(C))return Z1($,Y,"whitespace")(C);if(Q+=1,X)X=!1,B+=1;if(C===124)return $.enter("tableCellDivider"),$.consume(C),$.exit("tableCellDivider"),X=!0,Y;return $.enter("data"),K(C)}function K(C){if(C===null||C===124||y1(C))return $.exit("data"),Y(C);return $.consume(C),C===92?F:K}function F(C){if(C===92||C===124)return $.consume(C),K;return K(C)}function W(C){if(H.interrupt=!1,H.parser.lazy[H.now().line])return J(C);if($.enter("tableDelimiterRow"),X=!1,B1(C))return Z1($,q,"linePrefix",H.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C);return q(C)}function q(C){if(C===45||C===58)return D(C);if(C===124)return X=!0,$.enter("tableCellDivider"),$.consume(C),$.exit("tableCellDivider"),N;return M(C)}function N(C){if(B1(C))return Z1($,D,"whitespace")(C);return D(C)}function D(C){if(C===58)return Q+=1,X=!0,$.enter("tableDelimiterMarker"),$.consume(C),$.exit("tableDelimiterMarker"),A;if(C===45)return Q+=1,A(C);if(C===null||u0(C))return j(C);return M(C)}function A(C){if(C===45)return $.enter("tableDelimiterFiller"),V(C);return M(C)}function V(C){if(C===45)return $.consume(C),V;if(C===58)return X=!0,$.exit("tableDelimiterFiller"),$.enter("tableDelimiterMarker"),$.consume(C),$.exit("tableDelimiterMarker"),L;return $.exit("tableDelimiterFiller"),L(C)}function L(C){if(B1(C))return Z1($,j,"whitespace")(C);return j(C)}function j(C){if(C===124)return q(C);if(C===null||u0(C)){if(!X||B!==Q)return M(C);return $.exit("tableDelimiterRow"),$.exit("tableHead"),Z(C)}return M(C)}function M(C){return J(C)}function _(C){return $.enter("tableRow"),w(C)}function w(C){if(C===124)return $.enter("tableCellDivider"),$.consume(C),$.exit("tableCellDivider"),w;if(C===null||u0(C))return $.exit("tableRow"),Z(C);if(B1(C))return Z1($,w,"whitespace")(C);return $.enter("data"),T(C)}function T(C){if(C===null||C===124||y1(C))return $.exit("data"),w(C);return $.consume(C),C===92?b:T}function b(C){if(C===92||C===124)return $.consume(C),T;return T(C)}}function eQ0($,Z){let J=-1,H=!0,B=0,Q=[0,0,0,0],X=[0,0,0,0],z=!1,G=0,U,Y,K,F=new gP;while(++J<$.length){let W=$[J],q=W[1];if(W[0]==="enter"){if(q.type==="tableHead"){if(z=!1,G!==0)Yd(F,Z,G,U,Y),Y=void 0,G=0;U={type:"table",start:Object.assign({},q.start),end:Object.assign({},q.end)},F.add(J,0,[["enter",U,Z]])}else if(q.type==="tableRow"||q.type==="tableDelimiterRow"){if(H=!0,K=void 0,Q=[0,0,0,0],X=[0,J+1,0,0],z)z=!1,Y={type:"tableBody",start:Object.assign({},q.start),end:Object.assign({},q.end)},F.add(J,0,[["enter",Y,Z]]);B=q.type==="tableDelimiterRow"?2:Y?3:1}else if(B&&(q.type==="data"||q.type==="tableDelimiterMarker"||q.type==="tableDelimiterFiller")){if(H=!1,X[2]===0){if(Q[1]!==0)X[0]=X[1],K=TW(F,Z,Q,B,void 0,K),Q=[0,0,0,0];X[2]=J}}else if(q.type==="tableCellDivider")if(H)H=!1;else{if(Q[1]!==0)X[0]=X[1],K=TW(F,Z,Q,B,void 0,K);Q=X,X=[Q[1],J,0,0]}}else if(q.type==="tableHead")z=!0,G=J;else if(q.type==="tableRow"||q.type==="tableDelimiterRow"){if(G=J,Q[1]!==0)X[0]=X[1],K=TW(F,Z,Q,B,J,K);else if(X[1]!==0)K=TW(F,Z,X,B,J,K);B=0}else if(B&&(q.type==="data"||q.type==="tableDelimiterMarker"||q.type==="tableDelimiterFiller"))X[3]=J}if(G!==0)Yd(F,Z,G,U,Y);F.consume(Z.events),J=-1;while(++J<Z.events.length){let W=Z.events[J];if(W[0]==="enter"&&W[1].type==="table")W[1]._align=Ud(Z.events,J)}return $}function TW($,Z,J,H,B,Q){let X=H===1?"tableHeader":H===2?"tableDelimiter":"tableData",z="tableContent";if(J[0]!==0)Q.end=Object.assign({},VH(Z.events,J[0])),$.add(J[0],0,[["exit",Q,Z]]);let G=VH(Z.events,J[1]);if(Q={type:X,start:Object.assign({},G),end:Object.assign({},G)},$.add(J[1],0,[["enter",Q,Z]]),J[2]!==0){let U=VH(Z.events,J[2]),Y=VH(Z.events,J[3]),K={type:"tableContent",start:Object.assign({},U),end:Object.assign({},Y)};if($.add(J[2],0,[["enter",K,Z]]),H!==2){let F=Z.events[J[2]],W=Z.events[J[3]];if(F[1].end=Object.assign({},W[1].end),F[1].type="chunkText",F[1].contentType="text",J[3]>J[2]+1){let q=J[2]+1,N=J[3]-J[2]-1;$.add(q,N,[])}}$.add(J[3]+1,0,[["exit",K,Z]])}if(B!==void 0)Q.end=Object.assign({},VH(Z.events,B)),$.add(B,0,[["exit",Q,Z]]),Q=void 0;return Q}function Yd($,Z,J,H,B){let Q=[],X=VH(Z.events,J);if(B)B.end=Object.assign({},X),Q.push(["exit",B,Z]);H.end=Object.assign({},X),Q.push(["exit",H,Z]),$.add(J+1,0,Q)}function VH($,Z){let J=$[Z],H=J[0]==="enter"?"start":"end";return J[1][H]}var $X0={name:"tasklistCheck",tokenize:ZX0};function mP(){return{text:{[91]:$X0}}}function ZX0($,Z,J){let H=this;return B;function B(G){if(H.previous!==null||!H._gfmTasklistFirstContentOfListItem)return J(G);return $.enter("taskListCheck"),$.enter("taskListCheckMarker"),$.consume(G),$.exit("taskListCheckMarker"),Q}function Q(G){if(y1(G))return $.enter("taskListCheckValueUnchecked"),$.consume(G),$.exit("taskListCheckValueUnchecked"),X;if(G===88||G===120)return $.enter("taskListCheckValueChecked"),$.consume(G),$.exit("taskListCheckValueChecked"),X;return J(G)}function X(G){if(G===93)return $.enter("taskListCheckMarker"),$.consume(G),$.exit("taskListCheckMarker"),$.exit("taskListCheck"),z;return J(G)}function z(G){if(u0(G))return Z(G);if(B1(G))return $.check({tokenize:JX0},Z,J)(G);return J(G)}}function JX0($,Z,J){return Z1($,H,"whitespace");function H(B){return B===null?J(B):Z(B)}}function Kd($){return fF([yP(),hP(),vP($),fP(),mP()])}var HX0={};function CW($){let Z=this,J=$||HX0,H=Z.data(),B=H.micromarkExtensions||(H.micromarkExtensions=[]),Q=H.fromMarkdownExtensions||(H.fromMarkdownExtensions=[]),X=H.toMarkdownExtensions||(H.toMarkdownExtensions=[]);B.push(Kd(J)),Q.push(RP()),X.push(kP(J))}var $Z=P(c(),1),BX0=[CW],QX0=[jW],XX0={code({node:$,className:Z,children:J,...H}){return $Z.jsx("code",{className:X0("rounded-xs bg-accent px-1 py-0.5 font-mono font-normal before:content-none after:content-none",Z),...H,children:J})},pre({children:$}){return $Z.jsx("div",{className:"not-prose my-2 rounded-lg border border-border bg-accent px-3 py-2.5",children:$Z.jsx("pre",{className:"overflow-auto font-mono text-xs leading-relaxed whitespace-pre text-foreground [&>code]:rounded-none [&>code]:bg-transparent [&>code]:p-0",children:$})})}};function Fd({size:$="sm",content:Z}){let J=f1(),{base:H}=_2();return $Z.jsx("div",{className:X0("prose max-w-full min-w-0 wrap-anywhere prose-inherit",$==="sm"&&"prose-sm"),children:$Z.jsx(KW,{remarkPlugins:BX0,rehypePlugins:QX0,components:XX0,urlTransform:(B,Q,X)=>{if(X.tagName==="a"&&Q==="href"&&B.startsWith("moi:"))try{return F8(B,{workspaceId:J,base:H})}catch{return""}return FW(B)},children:Z})})}function Wd({content:$}){return $Z.jsx(KW,{allowedElements:[],skipHtml:!0,unwrapDisallowed:!0,children:$})}var G_=P(m(),1);var qd="/airtable-hsa66v6q.png";var Nd="/apollo-2ed5dy2d.png";var Ad="/asana-tvgtwbx2.png";var Dd="/atlassian-b3tq39hs.png";var Vd="/box-w3n36t5g.png";var uP="/chrome-tspm94rw.svg";var Ld="/clickup-qqrqqvqb.png";var Md="/cloudflare-j9p931v6.png";var Pd="/context7-8ht0xjfy.png";var _d="/datadog-70ne3yzt.png";var jd="/discord-vejhptwx.png";var Od="/dropbox-4m5s9mgr.png";var Td="/elevenlabs-2nzzej1t.png";var Cd="/exa-qqj3vr0x.png";var Ed="/figma-y9898rry.png";var bd="/firecrawl-w2t8nehx.png";var wd="/github-av5r5y3e.png";var Sd="/gitlab-4pv5vm6b.png";var Rd="/gmail-sg6a5v3x.png";var kd="/googlecalendar-nqhh2v7r.png";var Id="/googledrive-6s8xyab7.png";var yd="/grafana-1yfsnwr6.png";var xd="/granola-7j3b0nk2.png";var hd="/hubspot-hghcmc2t.png";var vd="/huggingface-kxzaxj83.png";var gd="/intercom-td763jt8.png";var fd="/linear-v9s3az2d.png";var md="/monday-jdbs4wwf.png";var ud="/mongodb-emzxvhd5.png";var pd="/neon-zj4qar44.png";var cd="/notion-w034c0b8.png";var dd="/paper-zbt34fab.png";var ld="/paypal-kwwf7xsc.png";var id="/perplexity-4y63rxvj.png";var rd="/postgresql-qsspbsr1.png";var ad="/posthog-sphppc4w.png";var od="/puppeteer-2xjt1a9b.png";var nd="/railway-834de8d2.png";var sd="/redis-spm6w2m1.png";var td="/salesforce-1mk56v4z.png";var ed="/sentry-hdwpmvek.png";var $l="/shopify-90dadaav.png";var Zl="/slack-1c1wj62s.png";var Jl="/snowflake-hfpykpgy.png";var Hl="/stripe-zrfaqbj3.png";var Bl="/supabase-4vg33zf2.png";var Ql="/telegram-v6tjyrs7.png";var Xl="/twilio-dpyjdwpj.png";var zl="/vercel-7d0ssw28.png";var Gl="/zapier-p67qfch0.png";var Hz0={airtable:qd,apollo:Nd,asana:Ad,atlassian:Dd,box:Vd,chrome:uP,"chrome-devtools":uP,clickup:Ld,cloudflare:Md,context7:Pd,datadog:_d,discord:jd,dropbox:Od,elevenlabs:Td,exa:Cd,figma:Ed,firecrawl:bd,github:wd,gitlab:Sd,gmail:Rd,googlecalendar:kd,googledrive:Id,grafana:yd,granola:xd,hubspot:hd,huggingface:vd,intercom:gd,linear:fd,monday:md,mongodb:ud,neon:pd,notion:cd,paper:dd,paypal:ld,perplexity:id,postgresql:rd,posthog:ad,puppeteer:od,railway:nd,redis:sd,salesforce:td,sentry:ed,shopify:$l,slack:Zl,snowflake:Jl,stripe:Hl,supabase:Bl,telegram:Ql,twilio:Xl,vercel:zl,zapier:Gl},Bz0={"google drive":"googledrive","google calendar":"googlecalendar",gcal:"googlecalendar",gdrive:"googledrive","apollo.io":"apollo","paper-desktop":"paper","granola-mcp":"granola","claude-in-chrome":"chrome",postgres:"postgresql","hugging face":"huggingface",jira:"atlassian",confluence:"atlassian"};function Ul($){let Z=$.match(/^claude[._]ai[._\s]+(.+)$/i);if(!Z)return $;return Z[1].replace(/_/g," ")}function EW($){return $.toLowerCase().replace(/[\s._-]+/g,"")}var Qz0=new Map(Object.entries(Hz0).map(([$,Z])=>[EW($),Z])),Xz0=new Map(Object.entries(Bz0).map(([$,Z])=>[EW($),EW(Z)]));function bW($){let Z=EW(Ul($));return Qz0.get(Xz0.get(Z)??Z)}function wW($){return Ul($).split(/[\s._-]+/).filter(Boolean).map((Z)=>Z[0].toUpperCase()+Z.slice(1)).join(" ")}var pP=P(c(),1);function KX({open:$,children:Z}){return pP.jsx(E4,{initial:!1,children:$&&pP.jsx(K5.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{type:"spring",duration:0.25,bounce:0.1},className:"overflow-hidden",children:Z},"content")})}var Yl=P(m(),1);var Wl=P(c(),1),zz0=/\.(png|jpe?g|gif|webp|avif|svg)$/i;function Kl($,Z){if($.name!=="Read"||!Z)return null;let J=$.input,H=typeof J.file_path==="string"?J.file_path:null;if(!H||!zz0.test(H))return null;let B=Z.endsWith("/")?Z:`${Z}/`;if(!H.startsWith(B))return null;return H.slice(B.length)}function Fl({relPath:$}){let Z=f1(),[J,H]=Yl.useState(!1);if(J)return null;let B=`/api/workspaces/${Z}/preview/${$.split("/").map(encodeURIComponent).join("/")}`;return Wl.jsx("img",{src:B,alt:$,loading:"lazy",onError:()=>H(!0),className:"max-h-64 max-w-full self-start rounded-lg border border-border object-contain"})}var NX=P(m(),1);var Nl=P(c(),1),Gz0=X0("animate-[text-shimmer_2s_ease-in-out_infinite]","bg-clip-text text-transparent","bg-[length:200%_auto]","bg-[linear-gradient(90deg,var(--muted-foreground)_0%,var(--muted-foreground)_40%,var(--foreground)_50%,var(--muted-foreground)_60%,var(--muted-foreground)_100%)]");function ql({children:$,active:Z=!0,className:J}){return Nl.jsx("span",{className:X0(J,Z&&Gz0),children:$})}var FX=P(c(),1);function SW({className:$}){return FX.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:$,"aria-hidden":"true",children:[FX.jsx("path",{d:"M3.49994 11.7501L11.6717 3.57855C12.7762 2.47398 14.5672 2.47398 15.6717 3.57855C16.7762 4.68312 16.7762 6.47398 15.6717 7.57855M15.6717 7.57855L9.49994 13.7501M15.6717 7.57855C16.7762 6.47398 18.5672 6.47398 19.6717 7.57855C20.7762 8.68312 20.7762 10.474 19.6717 11.5785L12.7072 18.543C12.3167 18.9335 12.3167 19.5667 12.7072 19.9572L13.9999 21.2499"}),FX.jsx("path",{d:"M17.4999 9.74921L11.3282 15.921C10.2238 17.0255 8.43275 17.0255 7.32825 15.921C6.22376 14.8164 6.22376 13.0255 7.32825 11.921L13.4999 5.74939"})]})}var L2=P(c(),1),RW="group/row flex w-full items-center gap-2 py-1.5 text-left select-none";function MH({isFirst:$,isLast:Z,marker:J,loading:H=!1,isError:B=!1,children:Q}){let X=J!=null||H;return L2.jsxs("div",{className:"relative flex gap-2.5",children:[L2.jsxs("div",{className:"relative w-[13px] shrink-0",children:[!$&&L2.jsx("span",{className:X0("absolute top-0 left-1/2 w-px -translate-x-1/2 bg-border",X?"h-1":"h-2.5")}),!Z&&L2.jsx("span",{className:X0("absolute bottom-0 left-1/2 w-px -translate-x-1/2 bg-border",X?"top-[26px]":"top-5")}),J?L2.jsx("span",{className:"absolute top-[15px] left-1/2 z-10 -translate-x-1/2 -translate-y-1/2",children:J}):H?L2.jsx("span",{className:"absolute top-[15px] left-1/2 z-10 flex -translate-x-1/2 -translate-y-1/2 p-0.5",children:L2.jsx(x5,{size:12,stroke:1.75,className:"animate-spin text-muted-foreground"})}):L2.jsx("span",{className:X0("absolute top-[15px] left-1/2 z-10 size-[5px] -translate-x-1/2 -translate-y-1/2 rounded-full",B?"bg-destructive":"bg-border")})]}),Q]})}function WX({open:$}){return L2.jsx(K5.span,{animate:{rotate:$?90:0},transition:{type:"spring",duration:0.2,bounce:0.1},className:X0("flex shrink-0",$?"opacity-100":"opacity-0 group-hover/row:opacity-100"),children:L2.jsx(x$,{size:12,stroke:1.75})})}function LH({children:$,className:Z}){return L2.jsx("span",{className:X0("flex size-4 items-center justify-center overflow-hidden rounded-xs bg-muted",Z),children:$})}function Al({icon:$,size:Z=12,stroke:J=1.75}){return L2.jsx(LH,{children:L2.jsx($,{size:Z,stroke:J,className:"text-muted-foreground"})})}function Dl({src:$}){if(!$)return L2.jsx(LH,{children:L2.jsx(SW,{className:"size-3 text-muted-foreground"})});return L2.jsx(LH,{children:L2.jsx("img",{src:$,alt:"",className:"size-full object-cover"})})}var Lz0=Ml(),cP=El();function Mz0($){if(!$)return"$";return/^[A-Za-z_][A-Za-z0-9_]*$/.test($)?`$${$}`:`\${${$}}`}function Pz0($){try{return cP($,Mz0)}catch{return null}}function bl($){return $.split("/").pop()??$}var _z0=new Set(["bash","sh","zsh","fish","dash","ash","ksh","mksh","csh","tcsh","nu","pwsh","powershell"]),jz0=new Set(["-o","+o","-O","+O","--rcfile","--init-file"]),Oz0=/^[A-Za-z_][A-Za-z0-9_]*=/;function Tz0($){if(/^-[a-zA-Z]*c$/.test($))return!0;let Z=$.toLowerCase();return Z==="--command"||Z==="-command"}function Cz0($){let Z=Pz0($);if(!Z||Z.length<3)return null;let J=(Q)=>{let X=Z[Q];return typeof X==="string"?X:null},H=0,B=()=>{while(Oz0.test(J(H)??""))H++};if(B(),bl(J(H)??"")==="env")H++,B();if(!_z0.has(bl(J(H)??"")))return null;H++;while(H<Z.length){let Q=J(H);if(Q===null)return null;if(Tz0(Q)){if(H+2!==Z.length)return null;return J(H+1)?.trim()||null}if(!Q.startsWith("-")&&!Q.startsWith("+"))return null;H+=jz0.has(Q)?2:1}return null}function Ez0($){let Z=$;for(let J=0;J<3;J++){let H=Cz0(Z);if(H===null)return Z;Z=H}return Z}function bz0($){return $.replace(/\\\r?\n[ \t]*/g," ").replace(/[ \t]*\r?\n[ \t]*/g," ").replace(/[ \t]{2,}/g," ").trim()}function JZ($){return bz0(Ez0($))}function PH($,Z){let J=JZ($);return J?Z(`$ ${J}`):""}var wz0=/^[A-Za-z]:\//;function Sz0($=""){if(!$)return $;return $.replace(/\\/g,"/").replace(wz0,(Z)=>Z.toUpperCase())}var Rz0=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;var wl=/^\/([A-Za-z]:)?$/;function kz0(){if(typeof process<"u"&&typeof process.cwd==="function")return process.cwd().replace(/\\/g,"/");return"/"}var dP=function(...$){$=$.map((H)=>Sz0(H));let Z="",J=!1;for(let H=$.length-1;H>=-1&&!J;H--){let B=H>=0?$[H]:kz0();if(!B||B.length===0)continue;Z=`${B}/${Z}`,J=lP(B)}if(Z=Sl(Z,!J),J&&!lP(Z))return`/${Z}`;return Z.length>0?Z:"."};function Sl($,Z){let J="",H=0,B=-1,Q=0,X=null;for(let z=0;z<=$.length;++z){if(z<$.length)X=$[z];else if(X==="/")break;else X="/";if(X==="/"){if(B===z-1||Q===1);else if(Q===2){if(J.length<2||H!==2||J[J.length-1]!=="."||J[J.length-2]!=="."){if(J.length>2){let G=J.lastIndexOf("/");if(G===-1)J="",H=0;else J=J.slice(0,G),H=J.length-1-J.lastIndexOf("/");B=z,Q=0;continue}else if(J.length>0){J="",H=0,B=z,Q=0;continue}}if(Z)J+=J.length>0?"/..":"..",H=2}else{if(J.length>0)J+=`/${$.slice(B+1,z)}`;else J=$.slice(B+1,z);H=z-B-1}B=z,Q=0}else if(X==="."&&Q!==-1)++Q;else Q=-1}return J}var lP=function($){return Rz0.test($)};var iP=function($,Z){let J=dP($).replace(wl,"$1").split("/"),H=dP(Z).replace(wl,"$1").split("/");if(H[0][1]===":"&&J[0][1]===":"&&J[0]!==H[0])return H.join("/");let B=[...J];for(let Q of B){if(H[0]!==Q)break;J.shift(),H.shift()}return[...J.map(()=>".."),...H].join("/")};function _H($){return $.input??{}}function N1($,Z){let J=$[Z];return typeof J==="string"?J:""}function Rl($){return(Z)=>Z.replace(/\/[^\s"']+/g,(J)=>{if(!$)return J;let H=iP($,J);return H.startsWith("..")?J:H})}function HZ($){let Z=Math.max(1,Math.round($/1000));if(Z<60)return`${Z}s`;let J=Math.floor(Z/60),H=Z%60;return H?`${J}m ${H}s`:`${J}m`}var Iz0={ToolSearch:"Tool search",WebSearch:"Web search",WebFetch:"Web fetch"};function yz0($){if(!$.startsWith("mcp__"))return $;let Z=$.slice(5).split("__");return Z.length>=2?Z.slice(1).join("__"):Z[0]}function xz0($,Z){let J=$.name,H=_H($);if(J==="Bash")return PH(N1(H,"command"),Z);if(J==="Read"||J==="Write"||J==="Edit")return Z(N1(H,"file_path"));if(J==="Glob")return Z(N1(H,"pattern"));if(J==="Grep")return`/${N1(H,"pattern")}/ ${Z(N1(H,"path"))}`;if(J==="WebSearch")return N1(H,"query");if(J==="WebFetch")return N1(H,"url");if(J==="ToolSearch"){let B=N1(H,"query");if(B.startsWith("select:"))return B.slice(7).split(",").map(yz0).join(", ");return B}return""}var qX={displayName:($)=>Iz0[$.name]??$.name,brief:xz0};var rP={exec:"Bash",apply_patch:"Edit",web_search:"Web search",update_plan:"Update plan",subagent:"Run sub-agent",subagent_activity:"Sub-agent",review:"Review",view_image:"View image",generate_image:"Generate image",list_mcp_resources:"List MCP resources",list_mcp_resource_templates:"List MCP templates",read_mcp_resource:"Read MCP resource"},Il={read:"Read",listFiles:"List files",search:"Search"};function yl($){let Z=$?.commandActions;if(!Array.isArray(Z)||Z.length===0)return null;let J=Z[0],H=J?.type;if(!H||!(H in Il))return null;if(Z.some((B)=>B?.type!==H))return null;return J}var kl={spawn_agent:"Run sub-agent",send_input:"Message the agent",resume_agent:"Resume the agent",close_agent:"Stopping the agent"};function hz0($){if($.name==="exec"){let Z=yl($.input);if(Z?.type)return Il[Z.type]}if($.name==="subagent"){let Z=$.input?.action;if(typeof Z==="string"&&Z in kl)return kl[Z]}return rP[$.name]??$.name}function vz0($,Z){let J=$.name,H=_H($);if(J==="exec"){let B=yl(H);if(B?.type==="read")return Z(B.path||B.name||"");if(B?.type==="search")return[B.query&&`/${B.query}/`,B.path&&Z(B.path)].filter(Boolean).join(" ");if(B?.type==="listFiles")return B.path?Z(B.path):"";return PH(N1(H,"command"),Z)}if(J==="apply_patch"){let B=H.changes;if(Array.isArray(B))return B.map((X)=>X&&typeof X==="object"?X.path:void 0).filter((X)=>typeof X==="string").map(Z).join(", ");return""}if(J==="web_search"){let B=H.queries;if(Array.isArray(B)&&B.length>0)return B.filter((Q)=>typeof Q==="string").join(" · ");return N1(H,"query")||[N1(H,"url"),N1(H,"pattern")].filter(Boolean).join(" · ")}if(J==="update_plan"){let B=H.plan;return typeof B==="string"?B.split(`
52
- `)[0]:""}if(J==="subagent"){if(N1(H,"action")==="close_agent")return"";return N1(H,"prompt")}if(J==="subagent_activity")return N1(H,"kind");if(J==="generate_image")return N1(H,"prompt").split(`
53
- `)[0];if(J==="read_mcp_resource")return N1(H,"uri");if(J==="list_mcp_resources"||J==="list_mcp_resource_templates")return N1(H,"server");return""}var xl={displayName:hz0,brief:vz0};function hl($){let Z=$.indexOf(":"),J=(Z>0?$.slice(0,Z):$).trim(),H=Z>0?$.slice(Z+1).trim():"",B=J.match(/^(.*?)\s*\(([^)]*)\)$/);if(!B)return{action:J,qualifier:"",detail:H};return{action:B[1].trim(),qualifier:B[2].trim(),detail:H}}var gz0={terminal:"Run command",read:"Read",write:"Write",edit:"Edit",patch:"Edit",search:"Search",extract:"Fetch webpage","web extract":"Fetch webpage","web search":"Web search",delegate:"Delegate task","delegate batch":"Delegate tasks",todo:"Update TODO",python:"Run Python","process wait":"Wait for process","session search":"Search sessions","skills list":"List skills","skill view":"View skill"};function fz0($){let{action:Z}=hl($.name),J=gz0[Z];if(J)return J;let H=Z.replace(/_/g," ");return H.charAt(0).toUpperCase()+H.slice(1)}function mz0($,Z){let{action:J,qualifier:H,detail:B}=hl($.name),Q=B||H;if(!Q)return"";return J==="terminal"?`$ ${JZ(Q)}`:Z(Q)}var vl={displayName:fz0,brief:mz0};var uz0={read:"Read file",write:"Write file",edit:"Edit file",apply_patch:"Edit",exec:"Bash",bash:"Bash",ls:"List files",find:"Find files",grep:"Search",process:"Manage process",web_search:"Web search",web_fetch:"Fetch",sessions_list:"List sessions",sessions_history:"Recall session",sessions_yield:"Yield to session",sessions_send:"Send to session",sessions_spawn:"Spawn session",subagents:"Run sub-agent",agents_list:"List agents",session_status:"Session status",image:"Analyze image",image_generate:"Generate image",memory_get:"Read memory",memory_search:"Search memory",update_plan:"Update plan",message:"Send message",browser:"Browser",canvas:"Canvas",cron:"Cron",gateway:"Gateway",code_execution:"Run Python",tts:"Text-to-speech",music_generate:"Generate music",video_generate:"Generate video",x_search:"Search X"};function pz0($,Z){let J=$.name,H=_H($);if(J==="read"||J==="write"||J==="edit")return Z(N1(H,"path"));if(J==="apply_patch"){let B=H.changes;if(Array.isArray(B)&&B.length>0){let z=B.map((G)=>G&&typeof G==="object"?N1(G,"path"):"").filter(Boolean);if(z.length===1)return Z(z[0]);if(z.length>1)return`${z.length} files`}let Q=N1(H,"patch")||N1(H,"input"),X=Q.split(`
54
- `).find((z)=>z.startsWith("*** "))??Q.split(`
55
- `)[0];return Z(X??"")}if(J==="exec"||J==="bash"){let B=N1(H,"command")||N1(H,"code");return PH(B,Z)}if(J==="ls"||J==="find"||J==="grep")return Z(N1(H,"path")||N1(H,"pattern"));if(J==="process"){let B=N1(H,"action"),Q=N1(H,"name");return[B,Q].filter(Boolean).join(" ")||Z(JZ(N1(H,"command")))}if(J==="web_search"||J==="x_search")return N1(H,"query");if(J==="web_fetch")return N1(H,"url");if(J==="memory_search")return N1(H,"query");if(J==="memory_get")return N1(H,"key")||N1(H,"name");if(J==="sessions_history"||J==="sessions_send"||J==="sessions_yield")return N1(H,"sessionKey")||N1(H,"agentId");if(J==="sessions_list"||J==="agents_list")return N1(H,"agentId");if(J==="subagents"||J==="sessions_spawn")return N1(H,"task")||N1(H,"agentId");if(J==="image"||J==="image_generate")return N1(H,"prompt")||Z(N1(H,"path"));if(J==="message")return N1(H,"recipient")||N1(H,"to");if(J==="update_plan"){let B=H.plan;if(Array.isArray(B)){let X=B.find((z)=>!!z&&typeof z==="object"&&z.status==="in_progress")?.step??B[0]?.step;if(typeof X==="string")return X}return""}return""}var gl={displayName:($)=>uz0[$.name]??qX.displayName($),brief:($,Z)=>pz0($,Z)||qX.brief($,Z)};function aP($){if(!($.name==="Bash"||$.name==="exec"||$.name==="bash"))return null;let J=$.input??{},H=typeof J.command==="string"?J.command:"";if(!H)return null;let Q=JZ(H).match(/(?:^|\s|\$\()mcporter(?:\)?)\s+call\s+([A-Za-z0-9_-]+)\.([A-Za-z0-9_-]+)((?:\s+(?!&&|\|\||;|\|)\S+)*)/);if(!Q)return null;return{server:Q[1],tool:Q[2],rest:(Q[3]??"").trim()}}function oP($){let Z=$.name;if(!Z.startsWith("mcp__"))return null;let J=Z.slice(5),H=J.indexOf("__");if(H<=0)return null;return{server:J.slice(0,H),tool:J.slice(H+2),rest:""}}function nP($){if($.provider!=="codex"||!$.mcpServer)return null;if($.name in rP)return null;if($.mcpServer==="codex")return null;let Z=$.name.indexOf(".");if(Z>0)return{server:$.name.slice(0,Z),tool:$.name.slice(Z+1),rest:""};return{server:$.mcpServer,tool:$.name,rest:""}}function sP($,Z){let J=Z.toLowerCase();return["-","_","."].find((B)=>J.startsWith($.toLowerCase()+B))?Z.slice($.length+1):Z}var cz0={"claude-code":qX,openclaw:gl,codex:xl,hermes:vl};function fl($){return cz0[$.provider??"claude-code"]}function ml($){return fl($).displayName($)}function ul($,Z){return fl($).brief($,Rl(Z))}var J2=P(c(),1),pl=[cl,dl,tP];function dz0(){let[$,Z]=NX.useState(0);NX.useEffect(()=>{let H=setInterval(()=>Z((B)=>(B+1)%pl.length),600);return()=>clearInterval(H)},[]);let J=pl[$];return J2.jsx(LH,{className:"size-5",children:J2.jsx(J,{size:16,stroke:1.75,className:"text-foreground"})})}function ll({call:$,cwd:Z,isFirst:J,isLast:H,renderNestedParts:B}){let[Q,X]=NX.useState(!1),z=$.subagent,G=$.input??{},U=z?.description??G.description??"Subtask",Y=z?.status,K=$.state==="error"||Y==="failed",F=$.state==="running"||Y==="running",W=z?.usage?.toolUses,q=z?.usage?.durationMs,D=(F&&z?.progress?.length?z.progress[z.progress.length-1]:null)??(W!=null?`Took ${W} step${W===1?"":"s"}`:null),A=(z?.transcript??[]).flatMap((j)=>j.parts),V=typeof $.output==="string"?$.output:"",L=A.length>0||!!V;return J2.jsx(MH,{isFirst:J,isLast:H,marker:F?J2.jsx(dz0,{}):J2.jsx(LH,{className:"size-5",children:J2.jsx(tP,{size:16,stroke:1.75,className:"text-foreground"})}),isError:K,children:J2.jsxs("div",{className:"min-w-0 flex-1",children:[J2.jsxs("button",{type:"button",title:`Agent: ${U}`,onClick:()=>L&&X((j)=>!j),className:X0("group/row flex w-full flex-col items-start gap-0.5 py-1.5 text-left select-none",L?"cursor-pointer":"cursor-default"),children:[J2.jsxs("span",{className:"flex w-full items-center gap-2",children:[J2.jsxs(ql,{active:F,className:"min-w-0 flex-1 truncate text-xs font-medium",children:["Agent: ",U]}),!F&&q!=null&&J2.jsx("span",{className:"shrink-0 rounded-full border border-border px-1.5 text-[10px] font-medium text-muted-foreground tabular-nums",children:HZ(q)}),Y==="failed"&&J2.jsx("span",{className:"shrink-0 text-xs text-destructive",children:"✗"}),Y==="stopped"&&J2.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:"✗"}),L&&J2.jsx(WX,{open:Q})]}),D&&J2.jsx("span",{className:"w-full truncate text-xs text-muted-foreground",children:D})]}),L&&J2.jsx(KX,{open:Q,children:J2.jsxs("div",{className:"mt-1 mb-1 overflow-hidden rounded-lg border border-border",children:[A.length>0&&J2.jsx("div",{className:"py-1.5 pr-2 pl-3",children:B(A,Z)}),V&&J2.jsx("div",{className:X0("bg-muted/30 px-3.5 py-3 text-xs leading-relaxed whitespace-pre-wrap text-muted-foreground",A.length>0&&"border-t border-border"),children:V})]})})]})})}var BZ=P(m(),1);var Zi=P(m(),1);var $_=new Set(["<",">","{","}","[","]"]),B_=new Set(["for","do","while","if","else","return","function","var","let","const","true","false","undefined","this","new","delete","typeof","in","instanceof","void","break","continue","switch","case","default","throw","try","catch","finally","debugger","with","yield","async","await","class","extends","super","import","export","from","static"]),lz0=new Set([...B_,"type","interface","enum","implements","readonly","abstract","declare","namespace","module","private","protected","public","override","keyof","infer","is","asserts","satisfies","as","unknown","never","any","number","string","boolean","bigint","symbol","object"]),ol=new Set(["+","-","*","/","%","=","!","&","|","^","~","!","?",":",".",",",";","'",'"',".","(",")","[","]","#","@","\\",...$_]),iz0={keywords:B_,onCommentStart:el,onCommentEnd:JG0};function rz0($){let Z=0;if(/\binterface\s+[A-Za-z_$][\w$]*/.test($))Z+=2;if(/\btype\s+[A-Za-z_$][\w$]*\s*=/.test($))Z+=2;if(/\benum\s+[A-Za-z_$][\w$]*/.test($))Z+=2;if(/\b(?:implements|readonly|declare|namespace|satisfies|infer|keyof|asserts)\b/.test($))Z+=2;if(/:\s*[A-Za-z_$][\w$]*(?:<[^>\n]+>)?(?:\[\])?(?=\s*[,)=;{])/m.test($))Z+=1;if(/\b(?:const|let|var)\s+[A-Za-z_$][\w$]*\s*:\s*/.test($))Z+=1;if(/\)\s*:\s*[A-Za-z_$][\w$]*(?:<[^>\n]+>)?(?:\[\])?\s*(?:=>|\{)/.test($))Z+=1;return Z>=2}function az0($,Z){if($[Z]!=="<")return!1;let J=0,H=!1;for(let B=Z;B<$.length;B++){let Q=$[B];if(Q==="<"){J++;continue}if(Q===">"){if(J--,J===0){let X=B+1;while(X<$.length&&/\s/.test($[X]))X++;if(!(H&&$[X]==="("))return!1;let z=$.slice(X,X+320);return/\)\s*(?::[\s\S]{0,120}?)?=>/.test(z)}continue}if(J===0)continue;if(/[$A-Za-z_]/.test(Q)){H=!0;continue}if(/[\s,\.\=\?\:\|\&\[\]]/.test(Q))continue;return!1}return!1}var xW=["identifier","keyword","string","class","property","entity","jsxliterals","sign","comment","break","space"],[jH,oz0,P7,eP,yW,nz0,sz0,Y3,il,Z_,rl]=xW.map(($,Z)=>Z);function AX($){return/^[^\S\r\n]+$/g.test($)}function tz0($){return ol.has($)}var ez0={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};function $G0($){if(!/[&<>"']/.test($))return $;return $.replace(/[&<>"']/g,(Z)=>ez0[Z])}function hW($){return/^[\w_]+$/.test($)||nl($)}function al($){let Z=$[0];return hW(Z)&&Z===Z.toUpperCase()||$==="null"}function nl($){return/[^\u0000-\u007f]/.test($)}function sl($){return/^[a-zA-Z]$/.test($)}function tl($){return sl($)||nl($)}function OH($){return tl($[0])&&($.length===1||hW($.slice(1)))}function J_($){return $==="`"}function H_($){return $==='"'||$==="'"}function ZG0($){return H_($)||J_($)}function el($,Z){let J=$+Z;if(J==="/*")return 2;return J==="//"?1:0}function JG0($,Z){return $+Z==="*/"?2:Z===`
56
- `?1:0}function HG0($){return $[0]==="/"&&!el($[0],$[1])}function BG0($,Z){let J=Z+1;while(J<$.length&&/\s/.test($[J]))J++;return $[J]===":"}function QG0($,Z){let J={...iz0,...Z},H=!!(Z&&Z.keywords instanceof Set),B=rz0($),Q=H?J.keywords:B?lz0:B_,{onCommentStart:X,onCommentEnd:z}=J,G=J.typeKeywords instanceof Set?J.typeKeywords:null,U="",Y=-1,K=[-1,""],F=[-2,""],W=[],q=!1,N=0,D=!1,A=0,V=()=>q&&!D&&!N,L=()=>N&&!V(),j=()=>!N&&V()&&!D&&A>0,M=null,_=0,w=!1,T=0,b=0,C=()=>M!==null,k=()=>w,S=()=>b>T,R=()=>b>0&&b===T,O=()=>C()||S();function y(x){let v=x===`
57
- `;if(L()){if(C())return P7;let[,E]=K;if(OH(x)){if(E==="<"||E==="</")return nz0}}if(j())return sz0;if(C()||S())return P7;else if(G&&G.has(x))return K[1]==="."?jH:eP;else if(Q.has(x))return K[1]==="."?jH:oz0;else if(v)return Z_;else if(AX(x))return rl;else if(x.split("").every(tz0))return Y3;else if(al(x))return L()?jH:eP;else{if(OH(x)){let E=K[1]==="."&&OH(F[1]);if(!O()&&!E)return jH;if(E)return yW}return P7}}let I=(x,v)=>{if(v)U=v;if(U){Y=typeof x==="number"?x:y(U);let g=[Y,U];if(Y!==rl&&Y!==Z_)F=K,K=g;W.push(g)}U=""};for(let x=0;x<$.length;x++){let v=$[x],g=$[x-1],E=$[x+1],l=g+v,r=v+E;if(typeof J.onQuote==="function"&&v==="'"&&!C()&&!j()&&!S()){let i=J.onQuote(v,x,$);if(typeof i==="number"&&i>=1&&!Number.isNaN(i)){let n=Math.min(i,$.length-x),Z0=x+n;I(),U=$.slice(x,Z0),I(jH),x=Z0-1;continue}}if(H_(v)&&!j()&&!S()){I();let i=!1;if(g!=="\\"){if(M&&v===M)M=null,i=!0;else if(!M)M=v,_=W.length}if(I(P7,v),J.quotedKeys&&i&&BG0($,x))for(let n=_;n<W.length;n++)W[n][0]=yW;continue}if(!S()){if(g!=="\\n"&&J_(v)){I(),I(P7,v),b++;continue}}if(S()){if(g!=="\\n"&&J_(v)){if(b>0){I(),b--,I(P7,v);continue}}if(r==="${"){T++,I(P7),I(Y3,r),x++;continue}}if(R()&&v==="}"){I(),T--,I(Y3,v);continue}if(V()){if(v==="{"){I(),I(Y3,v),D=!0;continue}}if(q){if(!N&&v==="<"){if(I(),E==="/")N=2,U=r,x++;else N=1,U=v;I(Y3);continue}if(N){if(v===">"&&!"/=".includes(g)){if(I(),N===1)N=0,A++;else N=0,q=!1;I(Y3,v);continue}if(r==="/>"||r==="</"){if(U!=="<"&&U!=="/")I();if(r==="/>")N=0;else A--;if(!A)q=!1;U=r,x++,I(Y3);continue}if(v==="<"){I(),U=v,I(Y3);continue}if(E==="-"&&!O()&&!j()){if(U){I(yW,U+v+E),x++;continue}}if(E==="="&&!O()){if(!AX(v)){if(AX(U))I();let i=U+v;if(OH(i)){I(yW,i);continue}}}}}if(!N&&(v==="<"&&tl(E)||r==="</")){let i=x-1;while(i>=0&&/\s/.test($[i]))i--;let n=i>=0?$[i]:"",[Z0,J0]=K,U0=!1,z0=!1;if(U&&!AX(U)){let D0=U;if(al(D0)||D0==="true"||D0==="false")U0=!0;else if(Q.has(D0)&&OH(D0))z0=!0;else if(OH(D0))U0=!0}let B0=v==="<"&&/[$\w\]\)]/.test(n)&&(U0||!z0&&(Z0===jH||Z0===eP||Z0===Y3&&(J0===")"||J0==="]"))),N0=v==="<"&&az0($,x);if(!B0&&!N0)N=E==="/"?2:1;if(v==="<"&&(E==="/"||sl(E))){if(!B0&&!N0&&!O()&&!j()&&!k())q=!0}}let h=ZG0(v),d=S(),o=!q&&HG0(r),p=j();if(h||d||H_(M))U+=v;else if(o){I();let[i,n]=K;if(o&&i!==-1&&!(i===Y3&&n!==")"||i===il)){U=v,I();continue}w=!0;let Z0=x++,J0=()=>x>=$.length,U0=()=>J0()||$[x]===`
58
- `,z0=!1,B0=!1;for(;!U0();x++){let N0=$[x],D0=$[x-1]==="\\";if(!D0&&N0==="[")B0=!0;if(!D0&&N0==="]")B0=!1;if(N0==="/"&&!B0&&!D0){z0=!0;while(Z0!==x&&/^[a-z]$/.test($[x+1])&&!U0())x++;break}}if(w=!1,Z0!==x&&z0)U=$.slice(Z0,x+1),I(P7);else U=v,I(),x=Z0}else if(X(v,E)){I();let i=x,n=X(v,E);if(n){for(;x<$.length;x++)if(z($[x-1],$[x])==n)break}U=$.slice(i,x+1),I(il)}else if(v===" "||v===`
59
- `)if(v===" "&&(AX(U)||!U||p)){let i=x+1;while($[i]===" ")i++;if(U+=$.slice(x,i),x=i-1,$[i]==="<")I()}else I(),U=v,I();else if(D&&v==="}")I(),U=v,I(),D=!1;else if(p&&!$_.has(v)||S()||(hW(v)===hW(U[U.length-1])||V())&&!ol.has(v))U+=v;else{if(l==="</")U=l;if(I(),l!=="</")U=v;if(r==="</"||r==="/>")U=r,I(),x++;else if($_.has(v))I()}}return I(),W}function XG0($,Z){let J=[],H=Z&&typeof Z.lineClassName==="function"?Z.lineClassName:null,B=0,Q=(U,Y)=>{let K=H?H(Y,B):"";return B++,{type:"element",tagName:"span",children:U,properties:{className:K?`sh__line ${K}`:"sh__line"}}};function X(U){let Y=U.map(([,F])=>F).join(""),K=U.map(([F,W])=>{let q=xW[F];return{type:"element",tagName:"span",children:[{type:"text",value:W}],properties:{className:`sh__token--${q}`,style:{color:`var(--sh-${q})`}}}});J.push(Q(K,Y))}let z=[],G=!1;for(let U=0;U<$.length;U++){let Y=$[U],[K,F]=Y,W=U===$.length-1;if(K!==Z_){if(F.includes(`
60
- `)){let q=F.split(`
61
- `);for(let N=0;N<q.length;N++)if(z.push([K,q[N]]),N<q.length-1)X(z),z.length=0}else z.push(Y);G=!1}else{if(G)X([]);else X(z),z.length=0;if(W)X([]);G=!0}}if(z.length)X(z);return J}var zG0=($)=>{let Z=`class="${$.className}"`;if($.style){let J=Object.entries($.style).map(([H,B])=>`${H}:${B}`).join(";");Z+=` style="${J}"`}return Z};function GG0($){return $.map((Z)=>{let{tagName:J}=Z,H=Z.children.map((B)=>{let{tagName:Q,children:X,properties:z}=B;return`<${Q} ${zG0(z)}>${$G0(X[0].value)}</${Q}>`}).join("");return`<${J} class="${Z.properties.className}">${H}</${J}>`}).join(`
62
- `)}function $i($,Z){let J=QG0($,Z),H=XG0(J,Z);return GG0(H)}var QD1={TokenTypes:xW,TokenMap:new Map(xW.map(($,Z)=>[$,Z]))};var Q_=P(c(),1),UG0=X0("[--sh-identifier:#1f2937]","[--sh-keyword:#cf222e]","[--sh-string:#16a34a]","[--sh-class:#2d6e7e]","[--sh-property:#0550ae]","[--sh-entity:#6f42c1]","[--sh-jsxliterals:#6f42c1]","[--sh-sign:#8b949e]","[--sh-comment:#9ca3af]");function Ji({code:$,className:Z}){let J=Zi.useMemo(()=>$i($),[$]);return Q_.jsx("pre",{className:X0("overflow-auto font-mono text-xs leading-relaxed whitespace-pre",UG0,Z),children:Q_.jsx("code",{className:"font-mono",dangerouslySetInnerHTML:{__html:J}})})}var YG0={ts:"ts",tsx:"tsx",js:"js",jsx:"jsx",mjs:"js",cjs:"js",json:"json",md:"md",mdx:"mdx",css:"css",scss:"scss",html:"html",py:"py",rb:"rb",go:"go",rs:"rs",java:"java",c:"c",h:"c",cpp:"cpp",sh:"sh",bash:"sh",yml:"yaml",yaml:"yaml",toml:"toml",sql:"sql",php:"php",swift:"swift",kt:"kt"};function KG0($){let Z=$.split(/[\\/]/).pop()??"",J=Z.lastIndexOf("."),H=J>0?Z.slice(J+1).toLowerCase():"";return YG0[H]??null}function FG0($){let Z=$.trim();if(Z.length<2||!(Z.startsWith("{")||Z.startsWith("[")))return null;try{return JSON.stringify(JSON.parse(Z),null,2)}catch{return null}}function WG0($){let Z=$.split(`
63
- `);if(!Z.some((J)=>/^\s*\d+\t/.test(J)))return $;return Z.map((J)=>J.replace(/^\s*\d+\t/,"")).join(`
64
- `)}function Hi($,Z){let J=$.input??{},H=typeof J.file_path==="string"?J.file_path:typeof J.path==="string"?J.path:"",B=H?KG0(H):null,Q=$.name==="Read"||$.name==="read",X=$.name==="Write"||$.name==="write";if(B&&Q&&Z)return{kind:"highlight",code:WG0(Z),label:B};if(B&&X&&typeof J.content==="string"&&J.content)return{kind:"highlight",code:J.content,label:B};let z=FG0(Z);if(z)return{kind:"highlight",code:z,label:"json"};return{kind:"plain"}}var S4=P(c(),1),X_="max-h-[280px] overflow-auto px-3 py-2.5 font-mono text-xs leading-relaxed";function Bi({call:$,output:Z,isError:J}){let[H,B]=BZ.useState(!1),Q=BZ.useMemo(()=>J?{kind:"plain"}:Hi($,Z),[$,Z,J]);if(Q.kind==="plain")return S4.jsx("div",{className:X0("rounded-lg border",J?"border-destructive/30 bg-destructive/10":"border-border bg-muted"),children:S4.jsx("pre",{className:X0(X_,"break-all whitespace-pre-wrap",J?"text-destructive":"text-muted-foreground"),children:Z||"(empty)"})});return S4.jsxs("div",{className:"overflow-hidden rounded-lg border border-border bg-muted",children:[S4.jsx(qG0,{raw:H,onRaw:B,label:Q.label,copyText:H?Z:Q.code}),H?S4.jsx("pre",{className:X0(X_,"break-all whitespace-pre-wrap text-muted-foreground"),children:Z||"(empty)"}):S4.jsx(Ji,{code:Q.code,className:X0(X_,"text-muted-foreground")})]})}function qG0({raw:$,onRaw:Z,label:J,copyText:H}){return S4.jsxs("div",{className:"flex items-center gap-1 border-b border-border p-2",children:[[[!1,J],[!0,"raw"]].map(([Q,X])=>S4.jsx(P0,{type:"button",variant:$===Q?"outline":"ghost",size:"sm",onClick:()=>Z(Q),className:"rounded-full text-xs uppercase",children:X},X)),S4.jsx("div",{className:"flex-1"}),S4.jsx(NG0,{text:H})]})}function NG0({text:$}){let[Z,J]=BZ.useState(!1);return BZ.useEffect(()=>{if(!Z)return;let B=setTimeout(()=>J(!1),1500);return()=>clearTimeout(B)},[Z]),S4.jsx(P0,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard?.writeText($).then(()=>J(!0)).catch(()=>{})},"aria-label":Z?"Copied":"Copy",children:Z?S4.jsx(S8,{stroke:1.75}):S4.jsx(ZY,{stroke:1.75})})}var u1=P(c(),1);function vW({parts:$,cwd:Z=null,processing:J=!1}){let H=$.filter((B)=>B.type==="reasoning"||B.type==="tool-call");return u1.jsx("div",{className:"flex flex-col",children:H.map((B,Q)=>{let X=Q===H.length-1,z={isFirst:Q===0,isLast:X};if(B.type==="reasoning")return u1.jsx(AG0,{text:B.text,durationMs:B.durationMs,inProgress:J&&X,...z},Q);return u1.jsx(DG0,{call:B.call,cwd:Z,...z},B.call.toolCallId||Q)})})}function z_({isFirst:$,isLast:Z,call:J,leading:H,marker:B,name:Q,brief:X,preview:z}){let[G,U]=G_.useState(!1),Y=J.state==="error",K=J.state==="running"||J.state==="pending",F=Y?J.errorText??"":typeof J.output==="string"?J.output:"",W=!!(F||Y||z),q=X?`${Q}: ${X}`:Q;return u1.jsx(MH,{isFirst:$,isLast:Z,marker:B,loading:K,isError:Y,children:u1.jsxs("div",{className:"min-w-0 flex-1",children:[u1.jsxs("button",{type:"button",title:q,onClick:()=>W&&U((N)=>!N),className:X0(RW,W?"cursor-pointer":"cursor-default"),children:[H,u1.jsx("span",{className:"shrink-0 text-xs font-medium whitespace-nowrap",children:Q}),X&&u1.jsx("span",{className:"min-w-0 self-baseline truncate text-[12px] text-muted-foreground",children:X}),K&&B&&u1.jsx(x5,{size:12,stroke:1.75,className:"shrink-0 animate-spin text-muted-foreground"}),W&&u1.jsx(WX,{open:G})]}),W&&u1.jsx(KX,{open:G,children:u1.jsxs("div",{className:"mt-1 mb-1 flex flex-col gap-1.5",children:[z,(F||Y)&&u1.jsx(Bi,{call:J,output:F,isError:Y})]})})]})})}function AG0({isFirst:$,isLast:Z,text:J,inProgress:H=!1,durationMs:B}){let[Q,X]=G_.useState(!1);if(!J){let U=B===void 0?"Thought":`Thought for ${HZ(B)}`;return u1.jsx(MH,{isFirst:$,isLast:Z,loading:H,children:u1.jsx("div",{className:X0(RW,"min-w-0 flex-1 cursor-default"),children:u1.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:H?"Thinking":U})})})}let z=H?"Thinking":"Thought",G=H||Q;return u1.jsx(MH,{isFirst:$,isLast:Z,loading:H,children:u1.jsxs("div",{className:"min-w-0 flex-1",children:[u1.jsxs("button",{type:"button","aria-expanded":G,onClick:()=>X((U)=>!U),className:X0(RW,"cursor-pointer"),children:[u1.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:z}),u1.jsx(WX,{open:G})]}),u1.jsx(KX,{open:G,children:u1.jsx("div",{className:"mt-1 mb-1 pr-2 text-xs leading-relaxed whitespace-pre-wrap text-muted-foreground",children:u1.jsx(Wd,{content:J})})})]})})}function DG0({call:$,cwd:Z,isFirst:J,isLast:H}){if($.caller==="subagent")return u1.jsx(ll,{call:$,cwd:Z,isFirst:J,isLast:H,renderNestedParts:(X,z)=>u1.jsx(vW,{parts:X,cwd:z})});if($.name==="Skill"&&$.skill){let X=$.state==="success";return u1.jsx(z_,{isFirst:J,isLast:H,call:$,marker:X?u1.jsx(Al,{icon:Qi,size:16,stroke:1.75}):void 0,name:"Loading skill",brief:$.skill.skillName})}let B=aP($)??oP($)??nP($);if(B){let X=sP(B.server,B.tool);return u1.jsx(z_,{isFirst:J,isLast:H,call:$,marker:u1.jsx(Dl,{src:bW(B.server)}),name:wW(B.server),brief:B.rest?`${X} ${B.rest}`:X})}let Q=$.state==="error"?null:Kl($,Z);return u1.jsx(z_,{isFirst:J,isLast:H,call:$,leading:u1.jsx(VG0,{call:$}),name:ml($),brief:ul($,Z),preview:Q?u1.jsx(Fl,{relPath:Q}):void 0})}function VG0({call:$}){if($.caller!=="mcp"&&$.caller!=="server-tool")return null;let Z=$.caller==="mcp"?`mcp${$.mcpServer?`:${$.mcpServer.slice(0,8)}`:""}`:"server";return u1.jsx("span",{className:"shrink-0 rounded border border-border px-1 text-[9px] text-muted-foreground uppercase",children:Z})}var x1=P(c(),1);function Gi($){if($.type==="reasoning")return!0;if($.type==="tool-call")return!0;return!1}function LG0($){let Z=[];for(let J of $)if(Gi(J)){let H=Z[Z.length-1];if(H&&H.kind==="run")H.parts.push(J);else Z.push({kind:"run",parts:[J]})}else Z.push({kind:"single",part:J});return Z}function gW({parts:$,cwd:Z,processing:J=!1}){let H=LG0($);return x1.jsx("div",{className:"flex flex-col",children:H.map((B,Q)=>{let X=Q===0?"":"mt-3",z=Q===H.length-1;return x1.jsx("div",{className:X,children:B.kind==="run"?x1.jsx(vW,{parts:B.parts,cwd:Z,processing:J&&z}):x1.jsx(OG0,{part:B.part})},Q)})})}function MG0($){return $.some((Z)=>Z.type!=="text"||Z.text.trim().length>0)}function PG0($){let Z=-1;for(let H=$.length-1;H>=0;H--)if(Gi($[H])){Z=H;break}if(Z<0)return null;let J=$.slice(Z+1);if(!MG0(J))return null;return{work:$.slice(0,Z+1),response:J}}function _G0({parts:$,cwd:Z,durationMs:J,defaultOpen:H}){let B=J===void 0?"Worked":`Worked for ${HZ(J)}`;return x1.jsxs(WK,{defaultOpen:H,className:"group/collapsible",children:[x1.jsxs(qK,{className:"flex w-fit items-center gap-1 rounded-sm py-1 text-left text-sm text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:[x1.jsx("span",{children:B}),x1.jsx(x$,{size:16,stroke:1.5,className:"shrink-0 transition-transform group-data-open/collapsible:rotate-90"})]}),x1.jsx(NK,{className:"overflow-hidden pt-2",children:x1.jsx(gW,{parts:$,cwd:Z})})]})}function jG0({parts:$,cwd:Z,processing:J=!1,durationMs:H}){let B=J?null:PG0($);return x1.jsx("div",{className:"w-full min-w-0",children:J?x1.jsx(gW,{parts:$,cwd:Z,processing:!0}):B?x1.jsxs("div",{className:"flex flex-col gap-3",children:[x1.jsx(_G0,{parts:B.work,cwd:Z,durationMs:H}),x1.jsx(gW,{parts:B.response,cwd:Z})]}):x1.jsx(gW,{parts:$,cwd:Z})})}var Ui=zi.memo(function({turn:Z,processing:J=!1}){let H=m1().cwd;if(Z.role==="user"&&Z.origin.kind==="user-input"){let B=Z.parts.filter((z)=>z.type==="file-attachment"),Q=Z.parts.filter((z)=>z.type==="text-attachment"),X=Z.parts.filter((z)=>z.type==="text").map((z)=>z.type==="text"?z.text:"").join(`
65
- `);if(!X&&B.length===0&&Q.length===0)return null;return x1.jsxs("div",{className:"flex w-full min-w-0 flex-col items-end gap-1.5 pl-8",children:[Q.map((z,G)=>x1.jsx(yQ,{label:z.label},`text-attachment:${G}`)),B.map((z,G)=>x1.jsx(Yi,{mediaType:z.mediaType,previewUrl:z.previewUrl,label:z.label},G)),X&&x1.jsx("p",{className:X0("max-w-full min-w-0 rounded-lg bg-primary px-3 py-2 text-sm leading-normal wrap-anywhere whitespace-pre-wrap text-primary-foreground","inset-shadow-[0_0_10px_color-mix(in_oklab,var(--color-white)_30%,transparent)]"),children:X})]})}return x1.jsx(jG0,{parts:Z.parts,cwd:H,processing:J,durationMs:Z.meta?.durationMs})});function OG0({part:$}){switch($.type){case"text-attachment":return x1.jsx(yQ,{label:$.label});case"text":return x1.jsx(Fd,{content:$.text});case"tool-call":return x1.jsx(vW,{parts:[$],cwd:null});case"file-attachment":return x1.jsx(Yi,{mediaType:$.mediaType,previewUrl:$.previewUrl,label:$.label});case"source-url":return x1.jsx(Xi,{url:$.url,title:$.title});case"source-document":return x1.jsx(Xi,{url:"#",title:$.title});case"data":return x1.jsx(TG0,{name:$.name,data:$.data});case"reasoning":return null}}function Yi({mediaType:$,previewUrl:Z,label:J}){if($.startsWith("image/")&&Z)return x1.jsx("img",{src:Z,alt:J??"attachment",className:"max-h-64 max-w-full rounded-lg border border-border object-contain"});return x1.jsxs("div",{className:"flex items-center gap-1.5 rounded-lg border border-border bg-accent px-2.5 py-1.5 text-xs text-accent-foreground",children:[x1.jsx(PJ,{size:16,stroke:1.75}),x1.jsx("span",{className:"truncate",children:J??$})]})}function Xi({url:$,title:Z}){return x1.jsx("a",{href:$,target:"_blank",rel:"noreferrer",className:"text-xs underline",children:Z??$})}function TG0({name:$,data:Z}){return x1.jsxs("details",{children:[x1.jsxs("summary",{className:"cursor-pointer list-none text-xs text-muted-foreground marker:hidden [&::-webkit-details-marker]:hidden",children:["data:",$]}),x1.jsx("pre",{className:"mt-1 overflow-auto rounded bg-muted p-2 font-mono text-xs text-muted-foreground",children:JSON.stringify(Z,null,2)})]})}var s1=P(c(),1),CG0=[],EG0=[];function U_({forkedFromSessionId:$,agent:Z,active:J=!0,focusRequest:H=0,docked:B=!1,chatLoaded:Q,hasWorkspaceApplets:X,view:z,previewTurn:G,sessionId:U,processing:Y,composerBanner:K,agentAvailability:F,annotation:W,send:q,stop:N,onNavigateFromWelcome:D,onClose:A,viewDraft:V}){let L=f1(),{base:j}=_2(),{data:M}=FJ(L),_=M?.find((B0)=>B0.sessionId===$)?.summary,w=k3(),T=o4.useRef(null),b=o4.useRef(null),C=V?.sessionId??U??q2(w),k=V?null:U??null,S=V?CG0:z.turns,R=S1((B0)=>B0.hasSentMessageFromMoi),O=S1((B0)=>(B0.workspaceIdsPendingAnalysis??[]).includes(L)),y=B4((B0)=>(B0.attachments[z8(L,C)]??[]).some((N0)=>N0.kind!=="text"&&N0.status==="uploading")),I=Q||!!V,x=!I||!IQ(!0,y,F),v=V?null:G,g=V?EG0:z.notices,E=o4.useMemo(()=>Fv(S),[S]),l=o4.useMemo(()=>Kv(E,v),[E,v]),r=o4.useMemo(()=>qv(l,g),[l,g]),h=l.length>0?l[l.length-1].id:null,d=V?!1:Y,o=!!V||!$&&Q&&r.length===0&&!d,p=Q&&!o,i=If({tabId:w,isViewDraft:!!V,hasSentMessageFromMoi:R,isWorkspacePendingAnalysis:O}),{atBottom:n,scrollToBottom:Z0,scrollToTop:J0}=Uv(b,C);o4.useLayoutEffect(()=>{if(o&&i!=="overview-empty"&&i!=="tab-empty")J0()},[o,i,J0]),o4.useEffect(()=>{if(J)ML(T.current)},[J,H]);let U0=o4.useCallback(async(B0,N0)=>{await q(B0,N0),Z0()},[q,Z0]),z0=o4.useCallback((B0)=>{if(x)return;U0(B0.prompt,{directives:B0.context})},[U0,x]);return s1.jsxs("div",{className:"flex min-h-0 flex-1 flex-col pt-2 pb-3",children:[s1.jsxs("header",{className:"flex w-full min-w-0 items-center justify-between pr-2 pb-2 pl-2",children:[s1.jsx("div",{className:"flex h-7 min-w-0 flex-1",children:s1.jsx(mf,{className:X0("text-foreground",B&&"text-muted-foreground")})}),B&&s1.jsxs(a1,{children:[s1.jsx(o1,{render:s1.jsx(P0,{variant:"ghost",size:"icon-sm",onClick:A,"aria-label":"Undock chat",children:s1.jsx(Ki,{className:"size-5! text-muted-foreground",stroke:1.5})})}),s1.jsx(n1,{children:"Undock chat"})]}),!V&&!B&&s1.jsx(P0,{variant:"ghost",size:"icon-sm",onClick:A,"aria-label":"Close chat",children:s1.jsx(n5,{stroke:2})})]}),s1.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[s1.jsx("div",{ref:b,className:"flex scrollbar-thin flex-1 scroll-fade flex-col overflow-y-auto overscroll-contain px-5 pt-4 pb-8 [--scroll-fade-reveal:8px]",children:s1.jsxs("div",{className:"mx-auto flex w-full max-w-(--chat-max-container) flex-1 flex-col gap-6",children:[$&&s1.jsx("a",{href:F8(`moi:/chats/${encodeURIComponent($)}`,{workspaceId:L,base:j}),className:"block text-sm outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:s1.jsxs("div",{className:"flex items-center gap-3",children:[s1.jsx(xK,{size:20,stroke:1.5,"aria-hidden":"true",className:"shrink-0 text-muted-foreground"}),s1.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[s1.jsx("span",{className:"text-muted-foreground",children:"Started from another chat"}),s1.jsx("span",{className:"truncate font-medium",title:_,children:_||"Another chat"})]})]})}),o&&s1.jsx(yf,{agent:Z,kind:i,hasWorkspaceApplets:X,disabled:x,onSelectPrompt:z0,onNavigate:D}),p&&r.map((B0)=>B0.kind==="notice"?s1.jsx(bG0,{notice:B0.notice},`notice:${B0.notice.id}`):s1.jsx(Ui,{turn:B0.turn,processing:d&&B0.turn.id===h},B0.turn.id)),p&&s1.jsx("div",{className:"mt-auto -ml-3 pt-2",children:s1.jsx(s9,{preset:Z,color:"primary",animated:d,expression:d?"thinking":void 0})})]})}),p&&!n&&S.length>0&&s1.jsx(P0,{type:"button",variant:"outline",size:"icon",onClick:()=>Z0("smooth"),"aria-label":"Jump to latest",className:"absolute bottom-3 left-1/2 -translate-x-1/2 animate-in rounded-full fade-in slide-in-from-bottom-1",children:s1.jsx(XU,{stroke:1.5})})]}),s1.jsx("div",{className:"mx-auto flex w-full max-w-[calc(var(--chat-max-container)+24px)] flex-col px-3",children:s1.jsxs("div",{className:X0("@container flex w-full flex-col transition-[padding]",K&&"gap-2 rounded-t-lg rounded-b-2xl p-2",K?.tone==="default"&&"bg-accent",K?.tone==="error"&&"bg-destructive/10"),children:[K?.content,s1.jsx(wf,{composerRef:T,onSend:U0,onStop:N,processing:d,sessionId:C,modelSessionId:k,availability:F,chatReady:I,annotation:V?void 0:W,onRemoveDrawing:V?.onRemoveDrawing??W?.onRemove,allowFiles:!V,placeholder:V?"Drop in the details":void 0})]})})]})}function bG0({notice:$}){let Z=PL($);if(!Z)return null;return s1.jsx("div",{className:"flex justify-center",children:s1.jsx("span",{className:"max-w-full truncate text-xs text-muted-foreground",children:Z})})}var wH=P(m(),1);var Br=P(w_(),1);var Y9=P(c(),1);function Qr({agent:$,loading:Z,open:J,onOpenChange:H,onOpenChangeComplete:B,children:Q}){let X=wH.useRef(null),z=S1((N)=>N.popupChatWidth),G=S1((N)=>N.setPopupChatWidth),[U,Y]=wH.useState({width:z,min:0,max:z}),K=wH.useCallback((N)=>{if(X.current=N,!N)return;N.style.setProperty("--chat-popup-width",`${z}px`);let D=new ResizeObserver(([A])=>{if(!A)return;let{minWidth:V,maxWidth:L}=getComputedStyle(N);Y({width:Math.round(A.contentRect.width),min:parseFloat(V),max:parseFloat(L)})});return D.observe(N),()=>{D.disconnect(),X.current=null}},[z]),F=(N)=>{if(!X.current)return;let{minWidth:D,maxWidth:A}=getComputedStyle(X.current);G(Math.round(Math.min(parseFloat(A),Math.max(parseFloat(D),N))))},W=()=>H(!1);return Y9.jsxs(P6,{open:J,onOpenChange:(N,D)=>{if(!N&&(D.reason==="outside-press"||D.reason==="focus-out")){D.cancel();return}H(N)},onOpenChangeComplete:B,children:[Y9.jsx(_6,{render:Y9.jsx("div",{className:"fixed right-3 bottom-3",children:Y9.jsx(K5.div,{variants:{from:{opacity:0,scale:0.8,filter:"blur(4px)"},to:{opacity:1,scale:1,filter:"blur(0px)"},invisible:{opacity:0,scale:1,filter:"blur(4px)"}},initial:"from",animate:J?"invisible":"to",transition:{type:"spring",duration:0.3,delay:0.2,bounce:0},children:Y9.jsx("button",{type:"button",className:"group block cursor-pointer p-0 drop-shadow-[0_0_4px_var(--background)] outline-none focus-visible:ring-3 focus-visible:ring-ring/50","aria-label":"Agent",children:Y9.jsx(s9,{preset:$,color:"primary",animated:Z,size:Z?80:64,expression:Z?"thinking":void 0,className:X0("drop-shadow-md drop-shadow-primary/25","group-hover:drop-shadow-lg group-hover:drop-shadow-primary/40","transition-[width,height,filter] duration-300 ease-in-out motion-reduce:transition-none")})})})})}),Y9.jsx(Br.Resizable,{axis:"x",width:U.width,height:0,resizeHandles:["w"],minConstraints:[U.min,0],maxConstraints:[U.max,0],onResize:(N,{size:D})=>G(Math.round(D.width)),handle:Y9.jsx("div",{role:"separator","aria-label":"Resize chat popup","aria-orientation":"vertical","aria-valuemin":U.min,"aria-valuemax":U.max,"aria-valuenow":U.width,"aria-valuetext":`${U.width} pixels wide`,tabIndex:0,className:"absolute inset-y-6 -left-1 w-2 cursor-ew-resize touch-none rounded-full outline-none focus-visible:ring-3 focus-visible:ring-ring/50",onKeyDown:(N)=>{let D=X.current?.offsetWidth??z,A=N.shiftKey?32:16;if(N.key==="ArrowLeft")F(D+A);else if(N.key==="ArrowRight")F(D-A);else if(N.key==="Home")F(-1/0);else if(N.key==="End")F(1/0);else return;N.preventDefault()}}),children:Y9.jsx(j6,{ref:K,side:"top",sideOffset:({anchor:N})=>-N.height,align:"end",className:"relative flex h-[calc(100vh-2rem)] w-(--chat-popup-width) max-w-[calc(100vw-1.5rem)] min-w-[min(440px,calc(100vw-1.5rem))] flex-col gap-0 rounded-3xl p-0 transition-[opacity,transform] sm:h-[calc(100vh-8rem)]",keepMounted:!0,children:Q(W)})})]})}var c3=P(c(),1);function nW({actions:$,className:Z,title:J,children:H,onClose:B,ref:Q}){return c3.jsxs(K5.div,{ref:Q,className:X0("absolute inset-x-4 bottom-4 no-scrollbar flex max-h-full flex-col gap-4 overflow-y-auto rounded-2xl bg-popover text-popover-foreground shadow-md","mx-auto max-w-[calc(var(--chat-max-container)+var(--page-pad)*2)] p-(--page-pad)",H&&"pb-0",Z),variants:{hidden:{opacity:0,y:40,filter:"blur(4px)"},visible:{opacity:1,y:0,filter:"blur(0px)"}},initial:"hidden",animate:"visible",exit:"hidden",transition:{type:"spring",duration:0.25,bounce:0},children:[c3.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-4",children:[c3.jsx("p",{className:"text-sm font-medium",children:J}),c3.jsxs("div",{className:"flex items-center gap-2",children:[$,c3.jsx(P0,{type:"button",variant:"ghost",size:"icon-sm",onClick:B,"aria-label":"Close panel",children:c3.jsx(n5,{stroke:1.75})})]})]}),H&&c3.jsx("div",{className:"flex-1 pb-(--page-pad)",children:H})]})}var N5=P(c(),1),hY0=Object.entries(o6),vY0=Object.entries(pY),gY0=Object.entries(JQ),fY0=Object.entries(HQ),mY0="relative w-full rounded-lg text-left ring-1 ring-border transition-opacity outline-none focus-visible:ring-3 focus-visible:ring-ring/50";function sW({children:$,className:Z,gridClassName:J,label:H}){return N5.jsxs("div",{className:X0("flex flex-col gap-2",Z),children:[N5.jsx("p",{className:"text-xs font-medium",children:H}),N5.jsx("div",{role:"group","aria-label":H,className:X0("grid grid-cols-4 gap-2 @4xl/workspace:grid-cols-2",J),children:$})]})}function tW({active:$,children:Z,className:J,onSelect:H,style:B}){return N5.jsxs("button",{type:"button","aria-pressed":$,onClick:H,className:X0(mY0,"flex items-center gap-2 p-3",J,!$&&"cursor-pointer pr-9 opacity-70 hover:opacity-100"),style:B,children:[N5.jsx("div",{className:"flex flex-1 flex-col justify-center",children:Z}),$&&N5.jsx(dY,{size:20,stroke:1.5,"aria-hidden":"true"})]})}function Xr({onClose:$,ref:Z}){VK();let{layout:J,setLayout:H}=m1(),B=Q9(J.theme);function Q(X){H({theme:{...B,...X}})}return N5.jsx(nW,{ref:Z,title:"Theme",onClose:$,className:"@4xl/workspace:max-w-5xl",children:N5.jsxs("div",{className:"grid grid-cols-1 gap-4 @4xl/workspace:grid-cols-[repeat(2,minmax(0,1fr))_0.5rem_repeat(2,minmax(0,1fr))_0.5rem_minmax(0,1fr)_0.5rem_minmax(0,1fr)] @4xl/workspace:gap-x-2",children:[N5.jsx(sW,{label:"Font",className:"@4xl/workspace:col-span-2 @4xl/workspace:col-start-1",children:hY0.map(([X,z])=>N5.jsx(tW,{active:X===B.font,onSelect:()=>Q({font:X}),style:{fontFamily:z.sans},children:N5.jsx("span",{className:"text-sm font-medium",children:z.label})},X))}),N5.jsx(sW,{label:"Colors",className:"@4xl/workspace:col-span-2 @4xl/workspace:col-start-4",children:vY0.map(([X,z])=>N5.jsx(tW,{active:X===B.color,className:z.primary&&"bg-background text-foreground",onSelect:()=>Q({color:X}),style:z9({...B,color:X}),children:N5.jsxs("div",{className:"flex gap-2",children:[N5.jsx("span",{className:X0("flex size-5 shrink-0 items-center justify-center rounded-sm text-[9px] leading-none font-bold",z.primary?"bg-primary text-primary-foreground":"bg-foreground text-background"),children:"Aa"}),N5.jsx("span",{className:"text-sm font-medium",children:z.label})]})},X))}),N5.jsx(sW,{label:"Radius",className:"@4xl/workspace:col-start-7",gridClassName:"@4xl/workspace:grid-cols-1",children:gY0.map(([X,z])=>N5.jsx(tW,{active:X===B.radius,onSelect:()=>Q({radius:X}),style:z9({...B,radius:X}),children:N5.jsxs("div",{className:"flex items-center gap-2",children:[N5.jsx("span",{className:"size-5 shrink-0 rounded-sm bg-card texture-checker-2.5 shadow-xs","aria-hidden":"true"}),N5.jsx("span",{className:"text-sm font-medium",children:z.label})]})},X))}),N5.jsx(sW,{label:"Agent",className:"@4xl/workspace:col-start-9",gridClassName:"@4xl/workspace:grid-cols-1",children:fY0.map(([X,z])=>N5.jsx(tW,{active:X===B.agent,onSelect:()=>Q({agent:X}),children:N5.jsxs("div",{className:"flex items-center gap-2",children:[N5.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:N5.jsx(s9,{preset:X,color:"primary",size:28})}),N5.jsx("span",{className:"text-sm font-medium",children:z.label})]})},X))})]})})}var lq=P(m(),1);var Ur=P(m(),1);function zr($){return Y5({queryKey:j0.appletThumbnails($),queryFn:async()=>(await G1(`/api/workspaces/${$}/applet-thumbnails`)).thumbnails,...G8})}function Gr($){let Z=X1();return E5({mutationFn:(J)=>c4(`/api/workspaces/${$}/applet-thumbnails`,y5("PUT",J),"Failed to save applet thumbnails"),onSuccess:()=>{Z.invalidateQueries({queryKey:j0.appletThumbnails($)}),Z.invalidateQueries({queryKey:j0.preview($)})}})}var uY0=1000,pY0=3,cY0=10800000,dY0=1000,lY0="1000px-3x-webp-q80-v1",iY0=5000,rY0=1000,aY0=1e4,oY0=100,nY0=5000;function sY0($){return Math.min(pY0,uY0/Math.max($.offsetWidth,$.offsetHeight))}function tY0($){return`${lY0}:${$??""}`}function eY0($,Z,J=Date.now()){if(!$||$.revision!==Z)return!0;let H=Date.parse($.capturedAt);return!Number.isFinite(H)||J-H>=cY0}function $K0($,Z){return $!==void 0&&$.revision===Z&&$.captureMs!==void 0&&$.captureMs>=dY0}var ZK0=($)=>new Promise((Z)=>{setTimeout(()=>Z(null),$)});function JK0($,Z=oY0){let J=$.getBoundingClientRect(),H=J.top-Z,B=J.bottom+Z,Q=J.left-Z,X=J.right+Z;return(z)=>{if(z.nodeType!==1)return!0;let G=z,U=G.getBoundingClientRect();if(U.width===0&&U.height===0)return G.ownerDocument?.defaultView?.getComputedStyle(G).display!=="none";return U.bottom>H&&U.top<B&&U.right>Q&&U.left<X}}function HK0($,Z,J=nY0){let H=J,B=(Q)=>{for(let X of Q.children){if(!Z(X))continue;if(--H<0)return!0;if(B(X))return!0}return!1};return B($)}async function BK0($,Z){let{createContext:J,destroyContext:H,domToDataUrl:B}=await import("/chunk-j905va8r.js"),Q=JK0($);if(HK0($,Q))return null;let X=async()=>{let z=await J($,{scale:sY0($),type:"image/webp",quality:0.8,backgroundColor:"#ffffff",timeout:rY0,filter:Q,...Z&&{onCreateForeignObjectSvg:(G)=>{let U=document.createElement("style");U.textContent="[data-widget-chrome] { border-radius: 0 !important; box-shadow: none !important; }[data-widget-chrome]::after { display: none !important; }",G.append(U)}}});try{return await B(z)}finally{H(z)}};return Promise.race([X(),ZK0(aY0)])}async function QK0($,Z,J,H,B=BK0,Q=Date.now()){let X=[];for(let z of J){if(H())return null;let G=tY0(z.revision),U=Z.find((W)=>W.kind===$&&W.id===z.id);if(!eY0(U,G,Q)){X.push({id:z.id,revision:G});continue}if($K0(U,G)){X.push({id:z.id,revision:G});continue}if(!z.element){X.push({id:z.id,revision:G,image:null});continue}let Y=performance.now(),K=await B(z.element,$==="widget").catch(()=>null),F=Math.round(performance.now()-Y);if(H())return null;X.push({id:z.id,revision:G,image:K,captureMs:F})}return X}function eW({kind:$,enabled:Z,targets:J}){let H=f1(),B=zr(H).data,Q=Gr(H),X=W5(J),z=W5(B??[]),G=W5(Q.mutate),U=J.map((K)=>`${K.id}@${K.revision??""}`).join(`
66
- `),Y=B!==void 0;Ur.useEffect(()=>{if(!Z||!Y||U==="")return;let K=!1,F=0,W,q=()=>{F+=1;let N=F;if(W!==void 0)clearTimeout(W);if(document.visibilityState!=="visible")return;W=setTimeout(async()=>{W=void 0;let D=await QK0($,z.current,X.current.map((A)=>({...A,element:document.querySelector(`[data-applet-thumbnail="${CSS.escape(Z7($==="view"?"views":"widgets",A.id))}"]`)})),()=>K||F!==N||document.visibilityState!=="visible");if(!D||K||document.visibilityState!=="visible")return;G.current({kind:$,thumbnails:D})},iY0)};return document.addEventListener("visibilitychange",q),q(),()=>{if(K=!0,W!==void 0)clearTimeout(W);document.removeEventListener("visibilitychange",q)}},[Z,$,Y,z,G,U,X])}var fr=P(m(),1);var Yr=P(c(),1);function $q({className:$,...Z}){return Yr.jsx("div",{"data-slot":"skeleton",className:o0("animate-pulse rounded-lg bg-accent",$),...Z})}var x2=P(c(),1);function XK0($){if($==="needs-auth")return"Needs auth";return $[0].toUpperCase()+$.slice(1)}function zK0({name:$,status:Z}){let J=bW($),H="size-full rounded-lg ring-2 ring-background";return x2.jsxs("span",{className:"relative size-10 shrink-0",children:[J?x2.jsx("img",{src:J,alt:"",className:"size-full rounded-lg ring-2 ring-background"}):x2.jsx("span",{className:"flex size-full items-center justify-center rounded-lg bg-muted text-muted-foreground ring-2 ring-background",children:x2.jsx(SW,{className:"size-5"})}),Z!=="connected"&&x2.jsx(Kr,{"aria-hidden":"true",size:16,stroke:1.75,className:"absolute -top-1 -right-1 rounded-full bg-card text-amber-400"})]})}function Fr($){return[...$].sort((Z,J)=>Number(J.status==="connected")-Number(Z.status==="connected"))}function Wr({icon:$,children:Z}){return x2.jsxs("div",{className:"flex items-center gap-3 text-card-foreground",children:[$,x2.jsx("div",{className:"flex min-w-0 flex-1 flex-col justify-center gap-0.5",children:Z})]})}function qr({server:$}){return x2.jsxs(Wr,{icon:x2.jsx(zK0,{name:$.name,status:$.status}),children:[x2.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:wW($.name)}),x2.jsx("span",{className:"text-sm text-muted-foreground",children:XK0($.status)})]})}function Nr(){return x2.jsxs(Wr,{icon:x2.jsx($q,{className:"size-10 shrink-0 rounded-lg"}),children:[x2.jsx($q,{className:"h-4 w-36 max-w-full"}),x2.jsx($q,{className:"h-4 w-20"})]})}function S_({children:$}){return x2.jsx("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:$})}function Ar($,Z){return Y5({queryKey:j0.mcp($),queryFn:()=>G1(`/api/workspaces/${$}/mcp`),enabled:Z,staleTime:1/0,gcTime:1/0,refetchOnMount:!1,refetchOnWindowFocus:!1})}var n4=P(c(),1);function SH({title:$,description:Z,children:J}){return n4.jsxs("div",{className:"flex flex-col gap-6",children:[n4.jsxs("header",{className:"flex flex-col gap-0.5",children:[n4.jsx("h2",{className:"text-lg font-medium",children:$}),Z&&n4.jsx("p",{className:"text-sm text-muted-foreground",children:Z})]}),J]})}function RH({label:$,children:Z}){return n4.jsxs("section",{className:"flex flex-col gap-2",children:[$&&n4.jsx("p",{className:"px-0.5 text-xs font-medium text-muted-foreground",children:$}),n4.jsx("div",{className:"flex flex-col divide-y divide-dashed divide-border overflow-hidden rounded-xl border",children:Z})]})}function _X({title:$,description:Z,control:J}){return n4.jsxs("div",{className:"flex items-center gap-3 px-3.5 py-3",children:[n4.jsxs("div",{className:"flex min-w-0 flex-col",children:[n4.jsx("span",{className:"text-sm font-medium",children:$}),Z&&n4.jsx("span",{className:"text-xs text-muted-foreground",children:Z})]}),J&&n4.jsx("div",{className:"ml-auto flex shrink-0 items-center pl-3",children:J})]})}var D4=P(c(),1),GK0=Array.from({length:4},($,Z)=>Z);function UK0({connectors:$}){if($.isPending)return D4.jsx("div",{role:"status","aria-label":"Loading connectors",children:D4.jsx(S_,{children:GK0.map((Z)=>D4.jsx(Nr,{},Z))})});if($.isError)return D4.jsxs(Dr,{children:[D4.jsx("p",{className:"text-sm text-muted-foreground",children:"Could not load connectors."}),D4.jsx(P0,{variant:"outline",size:"sm",onClick:()=>$.refetch(),children:"Retry"})]});if($.data.length===0)return D4.jsxs(Dr,{children:[D4.jsx(Zq,{size:24,stroke:1.5,className:"text-muted-foreground"}),D4.jsx("p",{className:"text-sm text-foreground",children:"No connectors configured."})]});return D4.jsx(S_,{children:Fr($.data).map((Z)=>D4.jsx(qr,{server:Z},Z.name))})}function Dr({children:$}){return D4.jsx("div",{className:"flex min-h-48 flex-col items-center justify-center gap-3 rounded-xl border border-dashed border-border px-8 py-12 text-center",children:$})}function Vr(){let{workspaceId:$}=m1(),Z=Ar($,!0);return D4.jsx(SH,{title:"Connectors",description:"Connectors available to the agent in this workspace.",children:D4.jsx(UK0,{connectors:Z})})}var y_=P(m(),1);var OX={};b5(OX,{Thumb:()=>Tr,Root:()=>jr});var QZ=P(m(),1);var Jq=P(m(),1),R_=Jq.createContext(void 0);function Lr(){let $=Jq.useContext(R_);if($===void 0)throw Error(I0(63));return $}var Mr="data-checked",Pr="data-unchecked";var Hq={...S2,checked($){if($)return{[Mr]:""};return{[Pr]:""}}};var _r=P(m(),1);function Bq($,Z,J,H=!0,B){let[Q,X]=_r.useState(),z=t0(B?`${B}-label`:void 0),G=$??Z??Q;return H0(()=>{let U=$||Z||!H?void 0:KK0(J.current,z);if(Q!==U)X(U)}),G}function KK0($,Z){let J=FK0($);if(!J)return;if(!J.id&&Z)J.id=Z;return J.id||void 0}function FK0($){if(!$)return;let Z=$.parentElement;if(Z&&Z.tagName==="LABEL")return Z;let J=$.id;if(J){let B=$.nextElementSibling;if(B&&B.htmlFor===J)return B}let H=$.labels;return H&&H[0]}var jX=P(c(),1),jr=QZ.forwardRef(function(Z,J){let{checked:H,className:B,defaultChecked:Q,"aria-labelledby":X,form:z,id:G,inputRef:U,name:Y,nativeButton:K=!1,onCheckedChange:F,readOnly:W=!1,required:q=!1,disabled:N=!1,render:D,uncheckedValue:A,value:V,style:L,...j}=Z,{clearErrors:M}=X4(),{state:_,setTouched:w,setDirty:T,validityData:b,setFilled:C,setFocused:k,validationMode:S,disabled:R,name:O,validation:y}=i5(),{labelId:I}=r5(),x=R||N,v=O??Y,g=QZ.useRef(null),E=f2(g,U,y.inputRef),l=QZ.useRef(null),r=t0(),h=v6({id:G}),d=K?void 0:h,[o,p]=z4({controlled:H,default:Boolean(Q),name:"Switch",state:"checked"});h6(l,r,o,void 0,!x,Y),H0(()=>{C(o)},[o,C]),p9(o,()=>{M(v),T(o!==b.initialValue),y.change(o)});let{getButtonProps:i,buttonRef:n}=C5({disabled:x,native:K}),Z0=Bq(X,I,g,!K,d),J0={id:K?h:r,role:"switch","aria-checked":o,"aria-readonly":W||void 0,"aria-required":q||void 0,"aria-labelledby":Z0,onFocus(){if(!x)k(!0)},onBlur(){let N0=g.current;if(!N0||x)return;if(w(!0),k(!1),S==="onBlur")y.commit(N0.checked)},onClick(N0){if(W||x)return;N0.preventDefault();let D0=g.current;if(!D0)return;iJ(D0,N0)}},U0={...y.getValidationProps(x),checked:o,disabled:x,form:z,id:d,name:v,required:q,style:v?Rz:r8,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:E,onChange(N0){if(N0.nativeEvent.defaultPrevented)return;if(W){N0.preventDefault();return}let D0=N0.currentTarget.checked,F0=w0(K0.none,N0.nativeEvent);if(F?.(D0,F0),F0.isCanceled)return;p(D0)},onClick(N0){N0.stopPropagation()},onFocus(){l.current?.focus()},...V!==void 0?{value:V}:M1},z0=QZ.useMemo(()=>({..._,checked:o,disabled:x,readOnly:W,required:q}),[_,o,x,W,q]),B0=G0("span",Z,{state:z0,ref:[J,l,n],props:[J0,j,i,(N0)=>y.getValidationProps(x,N0)],stateAttributesMapping:Hq});return jX.jsxs(R_.Provider,{value:z0,children:[B0,!o&&v&&A!==void 0&&jX.jsx("input",{type:"hidden",form:z,name:v,value:A,disabled:x}),jX.jsx("input",{...U0,suppressHydrationWarning:!0})]})});var Or=P(m(),1);var Tr=Or.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=Lr();return G0("span",Z,{state:z,ref:J,stateAttributesMapping:Hq,props:X})});var k_=P(c(),1);function Cr({className:$,...Z}){return k_.jsx(OX.Root,{"data-slot":"switch",className:o0('peer relative inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-sm border border-transparent p-px transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-checked:bg-primary data-unchecked:bg-accent data-disabled:cursor-not-allowed data-disabled:opacity-50 [:where([class~="group/field-label"]:has(:focus-visible))_&]:border-transparent [:where([class~="group/field-label"]:has(:focus-visible))_&]:ring-0',$),...Z,children:k_.jsx(OX.Thumb,{"data-slot":"switch-thumb",className:"pointer-events-none block size-4 rounded-xs bg-background shadow-xs ring-0 transition-transform data-checked:translate-x-full data-checked:bg-white data-unchecked:translate-x-0"})})}var I_=["app-settings"];function Er(){let $=X1();return N2((Z)=>{if(Z.type==="settings:updated")$.setQueryData(I_,Z.settings)}),Y5({queryKey:I_,queryFn:()=>G1("/api/settings"),staleTime:30000})}function br(){let $=X1();return E5({mutationFn:(Z)=>G1("/api/settings",y5("PATCH",Z),"Failed to save settings"),onSuccess:(Z)=>{$.setQueryData(I_,Z)}})}function wr($){return Y5({queryKey:j0.env($),queryFn:()=>G1(`/api/workspaces/${$}/env`),...G8})}function Sr($){let Z=X1();return E5({mutationFn:(J)=>G1(`/api/workspaces/${$}/env`,y5("PUT",J)),onSuccess:(J)=>{Z.setQueryData(j0.env($),J)}})}function Rr($){let Z=X1();return E5({mutationFn:(J)=>c4(`/api/workspaces/${$}/config`,y5("PUT",{name:J}),"Failed to save name"),onSuccess:()=>{Z.invalidateQueries({queryKey:j0.layout($)}),Z.invalidateQueries({queryKey:j0.all})}})}function kr($){let Z=X1();return E5({scope:{id:`workspace-icon:${$}`},mutationFn:async(J)=>{if(J.kind==="set"){await c4(`/api/workspaces/${$}/config`,y5("PUT",{icon:J.icon}),"Failed to save icon");return}if(J.kind==="reset"){await c4(`/api/workspaces/${$}/icon`,{method:"DELETE"},"Failed to reset icon");return}await G1(`/api/workspaces/${$}/icon`,{method:"PUT",headers:{"Content-Type":J.file.type||"application/octet-stream"},body:J.file})},onMutate:(J)=>{if(J.kind!=="set")return;let H={icon:J.icon};Z.setQueryData(j0.layout($),(B)=>B?{...B,...H}:B),Z.setQueryData(j0.all,(B)=>B?.map((Q)=>Q.id===$?{...Q,...H}:Q))},onError:(J,H)=>{if(H.kind!=="set")return;Z.invalidateQueries({queryKey:j0.layout($)}),Z.invalidateQueries({queryKey:j0.all,exact:!0})},onSuccess:()=>{Z.invalidateQueries({queryKey:j0.layout($)}),Z.invalidateQueries({queryKey:j0.all})}})}function Ir($){let Z=X1();return N2((J)=>{if(J.type==="env:updated"&&J.workspaceId===$)Z.invalidateQueries({queryKey:j0.env($)})}),{env:wr($),update:Sr($)}}var c5=P(c(),1),WK0={dotenv:".env",custom:"secret",both:"override"},qK0=/^[A-Za-z_][A-Za-z0-9_]*$/;function yr(){let{workspaceId:$}=m1(),{env:Z,update:J}=Ir($),[H,B]=y_.useState(""),[Q,X]=y_.useState(""),z=qK0.test(H),G=z&&Q.length>0&&!J.isPending,U=()=>{if(!G)return;J.mutate({set:{[H]:Q}},{onSuccess:()=>{B(""),X("")}})},Y=Z.data?.vars??[],K=Z.data?.files.reduce((W,q)=>W+q.count,0)??0,F=Z.data?.files.length??0;return c5.jsxs(SH,{title:"Environment",description:"Secrets injected into widgets and the agent at run time. Values are write-only — they're never shown again once saved.",children:[c5.jsxs(RH,{label:"Variables",children:[Z.isLoading?c5.jsx("div",{className:"flex items-center justify-center px-3.5 py-6 text-muted-foreground",children:c5.jsx(x5,{className:"size-4 animate-spin",stroke:1.75})}):Y.length===0?c5.jsx("p",{className:"px-3.5 py-4 text-sm text-muted-foreground",children:"No variables yet."}):Y.map((W)=>{let q=W.source!=="dotenv";return c5.jsxs("div",{className:"flex items-center gap-3 px-3.5 py-2.5",children:[c5.jsx("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-foreground",children:W.key}),c5.jsx("span",{className:"text-xs tracking-widest text-muted-foreground/60 select-none",children:"••••••"}),c5.jsx("span",{className:X0("rounded-lg px-1.5 py-0.5 text-[11px] font-medium",W.source==="dotenv"?"bg-muted text-muted-foreground":"bg-primary/10 text-primary"),children:WK0[W.source]}),!q&&c5.jsx("span",{className:"text-right text-[11px] text-muted-foreground/60",children:"from file"}),c5.jsx(P0,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>J.mutate({remove:[W.key]}),disabled:!q,"aria-label":`Delete ${W.key}`,className:"disabled:invisible",children:c5.jsx(Qq,{stroke:1.75})})]},W.key)}),c5.jsxs("div",{className:"flex items-center gap-2 px-3.5 py-2.5",children:[c5.jsx(P$,{value:H,onChange:(W)=>B(W.target.value),placeholder:"NEW_KEY","aria-invalid":H.length>0&&!z,className:"h-7 w-40 font-mono text-xs"}),c5.jsx(P$,{value:Q,onChange:(W)=>X(W.target.value),onKeyDown:(W)=>{if(W.key==="Enter")U()},type:"password",placeholder:"value",className:"h-7 flex-1 text-xs"}),c5.jsxs(P0,{variant:"outline",size:"sm",onClick:U,disabled:!G,children:[J.isPending?c5.jsx(x5,{stroke:1.75,className:"animate-spin"}):c5.jsx(d2,{stroke:1.75}),"Add"]})]})]}),c5.jsx(RH,{label:"From .env files",children:c5.jsx(_X,{title:"Inherit .env files",description:F>0?`Discovered ${K} ${K===1?"key":"keys"} across ${F} ${F===1?"file":"files"} in this space.`:"No .env files found in this space.",control:c5.jsx(Cr,{checked:Z.data?.inheritDotenv??!0,disabled:Z.isLoading,onCheckedChange:(W)=>J.mutate({inheritDotenv:W})})})})]})}var K9={};b5(K9,{createHandle:()=>vr,Viewport:()=>xU,Trigger:()=>hr,Title:()=>hU,Root:()=>xr,Portal:()=>kU,Popup:()=>RU,Handle:()=>Xq,Description:()=>EU,Close:()=>CU,Backdrop:()=>TU});function xr($){return yU("alert-dialog",$)}var hr=vU;class Xq extends qJ{}function vr(){return new Xq}var V4=P(c(),1);function zq({...$}){return V4.jsx(K9.Root,{"data-slot":"alert-dialog",...$})}function Gq({...$}){return V4.jsx(K9.Trigger,{"data-slot":"alert-dialog-trigger",...$})}function NK0({...$}){return V4.jsx(w8,{portal:K9.Portal,"data-slot":"alert-dialog-portal",...$})}function AK0({className:$,...Z}){return V4.jsx(K9.Backdrop,{"data-slot":"alert-dialog-overlay",className:o0("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",$),...Z})}function Uq({className:$,size:Z="default",...J}){return V4.jsxs(NK0,{children:[V4.jsx(AK0,{}),V4.jsx(K9.Popup,{"data-slot":"alert-dialog-content","data-size":Z,className:o0("group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-6 text-sm text-popover-foreground shadow-xl duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm 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",$),...J})]})}function Yq({className:$,...Z}){return V4.jsx("div",{"data-slot":"alert-dialog-header",className:o0("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",$),...Z})}function Kq({className:$,...Z}){return V4.jsx("div",{"data-slot":"alert-dialog-footer",className:o0("-mx-6 -mb-6 flex flex-col-reverse gap-2 rounded-b-xl p-6 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",$),...Z})}function Fq({className:$,...Z}){return V4.jsx(K9.Title,{"data-slot":"alert-dialog-title",className:o0('text-base font-medium sm:group-data-[size=default]/alert-dialog-content:[:where([class~="group/alert-dialog-content"]):has([data-slot=alert-dialog-media])_&]:col-start-2',$),...Z})}function Wq({className:$,...Z}){return V4.jsx(K9.Description,{"data-slot":"alert-dialog-description",className:o0("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",$),...Z})}function qq({className:$,...Z}){return V4.jsx(P0,{"data-slot":"alert-dialog-action",className:o0($),...Z})}function Nq({className:$,variant:Z="outline",size:J="default",...H}){return V4.jsx(K9.Close,{"data-slot":"alert-dialog-cancel",className:o0($),render:V4.jsx(P0,{variant:Z,size:J}),...H})}var F2=P(c(),1);function gr(){let{cloudDemo:$}=R8(),{name:Z,cwd:J,workspaceId:H}=m1(),[,B]=M8(),Q=pS(),X=Z??J??"this space",z=()=>{Q.mutate(H,{onSuccess:()=>B("/")})};return F2.jsxs(SH,{title:"General",description:"Basic details for this space.",children:[F2.jsx(RH,{children:F2.jsx(_X,{title:"Path",control:F2.jsx(P$,{value:J??"","aria-label":"Workspace path",title:J??void 0,className:"w-56",readOnly:!0})})}),!$&&F2.jsx(RH,{label:"Danger zone",children:F2.jsx(_X,{title:"Remove space",description:"Remove this space from moi. Its folder and sessions stay on disk.",control:F2.jsxs(zq,{children:[F2.jsx(Gq,{render:F2.jsx(P0,{type:"button",variant:"destructive",size:"sm"}),disabled:Q.isPending,children:"Remove"}),F2.jsxs(Uq,{children:[F2.jsxs(Yq,{children:[F2.jsxs(Fq,{children:["Remove “",X,"” from your workspaces?"]}),F2.jsx(Wq,{children:"This only removes it from your list. The folder and its sessions stay on disk. You can add it back any time."})]}),Q.isError&&F2.jsx("p",{className:"text-xs text-destructive",children:Q.error.message}),F2.jsxs(Kq,{children:[F2.jsx(Nq,{disabled:Q.isPending,children:"Cancel"}),F2.jsxs(qq,{type:"button",variant:"destructive",onClick:z,disabled:Q.isPending,children:[Q.isPending&&F2.jsx(x5,{"data-icon":"inline-start",stroke:1.75,className:"animate-spin"}),"Remove"]})]})]})]})})})]})}var s4=P(c(),1),DK0=[{id:"general",label:"General",icon:g6},{id:"connectors",label:"Connectors",icon:Zq},{id:"environment",label:"Environment",icon:HY}];function Aq({children:$}){let[Z,J]=fr.useState("general");return s4.jsxs(I6,{children:[$,s4.jsxs(NJ,{className:"flex h-[min(680px,90vh)] w-[880px] gap-0 overflow-hidden p-0 sm:max-w-[94vw]",children:[s4.jsx(y6,{className:"sr-only",children:"Space settings"}),s4.jsxs("nav",{className:"flex w-48 shrink-0 flex-col gap-0.5 border-r bg-muted p-3",children:[s4.jsx("p",{className:"px-2.5 pt-4 pb-2 text-xs text-muted-foreground",children:"Settings"}),DK0.map((H)=>s4.jsxs(P0,{type:"button",variant:Z===H.id?"secondary":"ghost",size:"sm",onClick:()=>J(H.id),className:"justify-start",children:[s4.jsx(H.icon,{stroke:1.75}),H.label]},H.id))]}),s4.jsx("div",{className:"relative scrollbar-thin min-w-0 flex-1 overflow-y-auto",children:s4.jsxs("div",{className:"px-8 py-7",children:[Z==="general"&&s4.jsx(gr,{}),Z==="connectors"&&s4.jsx(Vr,{}),Z==="environment"&&s4.jsx(yr,{})]})})]})]})}var rr=P(m(),1);var mr=P(m(),1);var ur=P(c(),1);function Dq({className:$,onBlur:Z,onFocus:J,onKeyDown:H,onValueChange:B,onValueCommit:Q,selectOnFocus:X,...z}){let G=mr.useRef(null);function U(F){let W=G.current!==null;if(G.current=null,Z?.(F),!F.defaultPrevented&&W)Q?.(F.currentTarget.value)}function Y(F){if(G.current=F.currentTarget.value,X){let W=F.currentTarget;W.select(),requestAnimationFrame(()=>{W.scrollLeft=0})}J?.(F)}function K(F){if(H?.(F),F.defaultPrevented)return;if(F.key==="Enter")F.preventDefault(),F.currentTarget.blur();else if(F.key==="Escape"){F.preventDefault();let W=G.current??F.currentTarget.value;G.current=null,F.currentTarget.value=W,B?.(W),F.currentTarget.blur()}}return ur.jsx(cB,{"data-slot":"inline-input",className:X0("-ml-2 [field-sizing:content] w-auto max-w-full min-w-0 rounded-md bg-transparent px-2 py-0.5 text-sm shadow-none outline-none focus:[field-sizing:fixed] focus:w-full focus-visible:border-ring focus-visible:bg-accent disabled:pointer-events-none",$),onBlur:U,onChange:(F)=>B?.(F.target.value),onFocus:Y,onKeyDown:K,...z})}function Vq($){let Z=X1();return N2((J)=>{if((J.type==="views:changed"||J.type==="view:deleted")&&J.workspaceId===$){if(Z.invalidateQueries({queryKey:j0.views($)}),J.type==="view:deleted")Z.invalidateQueries({queryKey:j0.sessions($)})}}),Y5({queryKey:j0.views($),queryFn:async()=>(await G1(`/api/workspaces/${$}/views`)).views,...G8})}function TX($,Z){let J=X1();return E5({mutationFn:Z,onSuccess:()=>J.invalidateQueries({queryKey:j0.views($)})})}function pr($){return TX($,({viewId:Z,title:J})=>G1(`/api/workspaces/${$}/views/${encodeURIComponent(Z)}`,y5("PATCH",{title:J}),"Couldn’t rename view"))}function x_($){return TX($,(Z)=>c4(`/api/workspaces/${$}/views/${encodeURIComponent(Z)}`,{method:"DELETE"},"Couldn’t delete view"))}function cr($){return TX($,()=>G1(`/api/workspaces/${$}/views`,y5("POST"),"Couldn’t create view"))}function dr($){return TX($,({viewId:Z,requirements:J})=>G1(`/api/workspaces/${$}/views/${Z}`,y5("PATCH",{requirements:J}),"Couldn’t save view requirements"))}function lr($){return TX($,({viewId:Z,...J})=>G1(`/api/workspaces/${$}/views/${Z}/submit`,y5("POST",J),"Couldn’t start view chat"))}var ir=x_;function CX($){return $.title||($.status==="compiled"?$.id:"New view")}function EX($){return XY($.icon)??bF}var C1=P(c(),1);function VK0({outlined:$,onClick:Z}){return C1.jsxs("button",{type:"button","aria-label":"Create new view",onClick:Z,className:X0("group flex w-20 shrink-0 cursor-pointer flex-col items-center gap-2 text-sm",$?"text-foreground":"text-muted-foreground"),children:[C1.jsx("div",{className:X0("size-16 rounded-2xl squircle",$&&"shadow-xs transition-shadow duration-300 ease-out group-hover:shadow-2xl"),children:C1.jsx("div",{className:X0("flex size-full items-center justify-center rounded-2xl squircle",$?"bg-background text-foreground":"bg-accent"),children:C1.jsx(d2,{size:32,stroke:1.25})})}),C1.jsx("span",{className:"line-clamp-2 w-full text-xs leading-snug font-medium text-ellipsis",children:"New view"})]})}function LK0({view:$,Icon:Z,onOpen:J}){let{workspaceId:H}=m1(),B=pr(H),Q=x_(H),X=CX($),[z,G]=rr.useState(!1);function U(){G(!0)}function Y(K){let F=K.trim();if(!F||F===X)return;B.mutate({viewId:$.id,title:F},{onError:(W)=>{r1.add({title:"Couldn’t rename view",description:W.message,type:"error"})}})}return C1.jsxs("div",{className:"group/item relative w-20 shrink-0",children:[C1.jsxs("button",{type:"button","aria-label":`Open ${X}`,onClick:J,className:"group flex w-20 cursor-pointer flex-col items-center gap-2 text-sm text-foreground",children:[C1.jsx("div",{className:"size-16 rounded-2xl transition-shadow duration-300 ease-out squircle group-hover:shadow-xl group-hover/item:shadow-xl",children:C1.jsx("div",{"data-vivid":!0,className:"flex size-full items-center justify-center rounded-2xl bg-primary text-primary-foreground inset-shadow-[0_0_10px_color-mix(in_oklab,var(--color-white)_30%,transparent)] squircle",children:C1.jsx(Z,{size:32,stroke:1.25})})}),C1.jsx("span",{className:"line-clamp-2 w-full text-xs leading-snug font-medium text-ellipsis",children:z?"":X})]}),z&&C1.jsx(Dq,{autoFocus:!0,selectOnFocus:!0,"aria-label":`Rename ${X}`,defaultValue:X,onBlur:()=>G(!1),onValueCommit:Y,className:"absolute top-18 left-0 m-0 h-auto w-20 max-w-20 min-w-0 rounded-xs px-1 py-0 text-center text-xs leading-snug font-medium"}),C1.jsxs(zq,{children:[C1.jsxs(Z3,{children:[C1.jsx(J3,{render:C1.jsx(P0,{type:"button",variant:"outline",size:"icon-xs","aria-label":`View actions for ${X}`,className:"absolute -top-1 right-1 border-0 opacity-0 shadow-xs transition-opacity group-hover/item:opacity-100 group-hover/item:delay-400 focus-visible:opacity-100 data-popup-open:opacity-100",children:C1.jsx(JY,{stroke:1.75})})}),C1.jsxs(H3,{align:"end",className:"min-w-32",children:[C1.jsxs(B3,{onClick:U,disabled:B.isPending,children:[C1.jsx(RF,{stroke:1.75}),"Rename"]}),C1.jsxs(B3,{nativeButton:!0,render:C1.jsx(Gq,{}),disabled:Q.isPending,onClick:()=>Q.reset(),className:"w-full",children:[C1.jsx(Qq,{stroke:1.75}),"Delete"]})]})]}),C1.jsxs(Uq,{children:[C1.jsxs(Yq,{children:[C1.jsxs(Fq,{children:["Delete “",X,"”?"]}),C1.jsx(Wq,{children:"This deletes the view and its source code. Related data and shared files stay in the workspace."})]}),Q.isError&&C1.jsx("p",{className:"text-xs text-destructive",children:Q.error.message}),C1.jsxs(Kq,{children:[C1.jsx(Nq,{disabled:Q.isPending,children:"Cancel"}),C1.jsxs(qq,{type:"button",variant:"destructive",disabled:Q.isPending,onClick:()=>Q.mutate($.id),children:[Q.isPending&&C1.jsx(x5,{"data-icon":"inline-start",stroke:1.75,className:"animate-spin"}),"Delete view"]})]})]})]})]})}function ar({views:$,onOpenView:Z,onCreateView:J,showOnboarding:H}){let B=$.length===0;return C1.jsxs("div",{className:"relative no-scrollbar flex size-full items-center overflow-hidden bg-muted",children:[B&&C1.jsx("div",{className:"pointer-events-none absolute inset-0 texture-checker [mask-image:linear-gradient(to_right,transparent_40%,black_80%)]","aria-hidden":!0}),C1.jsx("h2",{className:"relative pr-6 pl-12 text-2xl font-semibold text-foreground",children:"Views"}),C1.jsxs("div",{className:"relative no-scrollbar flex scroll-fade-x gap-2 overflow-x-auto px-6 pt-4 [--scroll-fade-reveal:16px]",children:[$.map((Q)=>C1.jsx(LK0,{view:Q,Icon:EX(Q),onOpen:()=>Z(Q.id)},Q.id)),C1.jsx(VK0,{outlined:B,onClick:J})]}),B&&H&&C1.jsx("p",{className:"relative mr-8 ml-auto max-w-56 text-right text-sm text-muted-foreground",children:"Create new views when you need separate pages for focused tasks"})]})}var nr=P(c(),1),MK0={[WL.id]:($)=>nr.jsx(ar,{views:$.views,onOpenView:$.onOpenView,onCreateView:$.onCreateView,showOnboarding:$.showOnboarding})};function or($,Z){if(!e9($))return;return MK0[$](Z)}function sr($,Z,J,H){let B=$.reduce((Q,X)=>Math.max(Q,X.y+X.h),0);for(let Q=0;Q<=B+J;Q++)for(let X=0;X<=H-Z;X++)if(!$.some((G)=>!(X+Z<=G.x||G.x+G.w<=X||Q+J<=G.y||G.y+G.h<=Q)))return{x:X,y:Q};return{x:0,y:B}}function bX($,Z=[],J=4){let H=[];for(let B of $){let{x:Q,y:X}=B.x!==void 0&&B.y!==void 0?{x:B.x,y:B.y}:sr([...Z,...H],B.w,B.h,J);H.push({i:B.id,x:Q,y:X,w:B.w,h:B.h})}return H}function Lq($,Z,J){return sr($,Z,J,4)}function tr($,Z){let J=new Map(Z.map((H)=>[H.id,H]));return $.map((H)=>{let B=J.get(H.i);return B?{...H,x:B.x,y:B.y}:H})}var h_=P(m(),1),Mq=new Map;function PK0($){let Z=window.__moiAppletCss?.get($)??"",J=Mq.get($);if(!J){let Q=document.createElement("style");Q.dataset.appletStyle=$,document.head.appendChild(Q),J={el:Q,refs:0},Mq.set($,J)}if(J.el.textContent!==Z)J.el.textContent=Z;J.refs++;let H=J,B=!1;return()=>{if(B)return;if(B=!0,H.refs--,H.refs<=0)H.el.remove(),Mq.delete($)}}function _K0($){let Z=Mq.get($);if(!Z||Z.el===document.head.lastElementChild)return;document.head.appendChild(Z.el)}function Pq($,Z,J=!1){h_.useInsertionEffect(()=>PK0($),[$,Z]),h_.useInsertionEffect(()=>{if(J)_K0($)},[$,J,Z])}var v_=P(c(),1);function er({segment:$,name:Z,version:J,children:H}){let B=f1(),Q=Z7($,Z);return Pq(bK($,B,Z),J),v_.jsx("div",{"data-applet":Q,className:"size-full",children:v_.jsx(OB,{appletId:Q,children:H})})}var $a=P(m(),1);var kH=P(c(),1);class wX extends $a.Component{state={error:null};static getDerivedStateFromError($){return{error:$}}componentDidCatch($,Z){console.error(`[widget:${this.props.name}]`,$,Z.componentStack),X8(this.props.workspaceId,{source:"render",kind:this.props.kind,name:this.props.name,message:$.message||String($),stack:[$.stack,Z.componentStack].filter(Boolean).join(`
67
- `)})}componentDidUpdate($){if($.resetKey!==this.props.resetKey&&this.state.error)this.setState({error:null})}render(){if(this.state.error)return kH.jsxs("div",{className:"flex h-full w-full flex-col items-start justify-start gap-1.5 p-4 text-xs",children:[kH.jsxs("div",{className:"flex items-center gap-1.5 font-semibold text-destructive",children:[kH.jsx(LG,{size:16,stroke:1.75}),"Widget crashed"]}),kH.jsx("div",{className:"font-mono break-words text-muted-foreground",children:this.state.error.message})]});return this.props.children}}var O7=P(c(),1);function Za({name:$}){let Z=f1(),J=Sh($);return O7.jsxs(E4,{mode:"wait",initial:!1,children:[J.status==="ready"&&O7.jsx(K5.div,{className:"absolute inset-0",initial:{opacity:0,filter:"blur(4px)"},animate:{opacity:1,filter:"blur(0px)"},exit:{opacity:0,filter:"blur(4px)"},transition:{duration:0.45,ease:"easeInOut"},children:O7.jsx(wX,{name:$,kind:"widget",workspaceId:Z,resetKey:J.version,children:O7.jsx(er,{segment:"widgets",name:$,version:J.version,children:O7.jsx(J.Component,{})})})},J.version),J.status==="error"&&O7.jsx(K5.p,{className:"absolute inset-0 p-4 text-xs text-destructive",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:0.45,ease:"easeInOut"},children:J.error},`err-${J.version}`)]})}var Ha=P(m(),1);var T7=P(c(),1);function _q({customizing:$,hidden:Z,widgetId:J,onRemove:H,children:B}){let Q=lh(),X=!J||!e9(J);return T7.jsxs(K5.div,{variants:{idle:{rotate:0},wiggle:{rotate:[0.5,-0.5],transition:{rotate:{repeat:1/0,repeatType:"reverse",duration:0.15,ease:"easeInOut"}}}},animate:$?"wiggle":"idle",transition:{type:"spring",duration:0.35,bounce:0},className:"group/widget relative size-full",children:[T7.jsx("div",{"data-widget-chrome":!0,"data-vivid":X?!0:void 0,style:X?z9(Q,"widget"):void 0,className:X0("absolute inset-0 overflow-hidden rounded-2xl text-foreground squircle",$&&"pointer-events-none"),children:B}),$&&H&&T7.jsx("div",{className:"absolute -top-2 -right-2 opacity-0 transition-opacity group-hover/widget:opacity-100",children:T7.jsx(P0,{size:"icon-sm",variant:"outline",className:"rounded-full","aria-label":Z?"Restore widget":"Hide widget",onPointerDown:(z)=>z.stopPropagation(),onClick:H,children:Z?T7.jsx(d2,{stroke:1.75}):T7.jsx(Ja,{stroke:1.75})})})]})}var d3=P(c(),1),jK0={0:"col-start-1",1:"col-start-2",2:"col-start-3",3:"col-start-4"},OK0={0:"row-start-1",1:"row-start-2",2:"row-start-3",3:"row-start-4",4:"row-start-5",5:"row-start-6",6:"row-start-7",7:"row-start-8"},TK0={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4"},CK0={1:"row-span-1",2:"row-span-2",3:"row-span-3",4:"row-span-4"};function Ba({items:$,renderItem:Z,onCreateWidget:J,onClose:H,onRestore:B,ref:Q}){let X=Ha.useMemo(()=>bX($),[$]);return d3.jsx(nW,{ref:Q,title:"Widgets",actions:d3.jsxs(P0,{type:"button",variant:"secondary",size:"sm",onClick:J,children:[d3.jsx(d2,{"data-icon":"inline-start",stroke:1.75}),"New widget"]}),onClose:H,className:"max-h-[60vh]",children:X.length>0&&d3.jsx("div",{className:"grid auto-rows-[160px] grid-cols-4 gap-2",children:d3.jsx(E4,{children:X.map((z)=>d3.jsx(K5.div,{layoutId:z.i,className:X0(jK0[z.x],OK0[z.y],TK0[z.w],CK0[z.h]),transition:{type:"spring",duration:0.35,bounce:0},children:d3.jsx(_q,{customizing:!0,widgetId:z.i,onRemove:()=>B(z.i),hidden:!0,children:Z(z.i)})},z.i))})})})}var gq=P(m(),1);var I4=P(m(),1);var J1=P(m(),1),IH=P(m(),1),D8=P(m(),1),Ca=P(c(),1),Oq=P(m(),1),Tq=P(m(),1),h1=P(c(),1),EK0=Object.defineProperty,bK0=($,Z)=>{for(var J in Z)EK0($,J,{get:Z[J],enumerable:!0})},l3={};bK0(l3,{ActiveEmoji:()=>pa,Empty:()=>ua,List:()=>ga,Loading:()=>ma,Root:()=>Ra,Search:()=>ka,SkinTone:()=>ca,SkinToneSelector:()=>fa,Viewport:()=>Ia});var Ma="'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Android Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', EmojiSymbols, sans-serif",m_=["none","light","medium-light","medium","medium-dark","dark"];function g_($){return $.charAt(0).toUpperCase()+$.slice(1)}var F9=2,L4=null;function Qa($){try{L4??=document.createElement("canvas").getContext("2d",{willReadFrequently:!0})}catch{}if(!L4||(queueMicrotask(()=>{L4&&(L4=null)}),L4.canvas.width=F9,L4.canvas.height=F9,L4.font=`2px ${Ma}`,L4.textBaseline="middle",L4.measureText($).width>=F9*2))return!1;L4.fillStyle="#00f",L4.fillText($,0,0);let Z=L4.getImageData(0,0,F9,F9).data;L4.clearRect(0,0,F9,F9),L4.fillStyle="#f00",L4.fillText($,0,0);let J=L4.getImageData(0,0,F9,F9).data;for(let H=0;H<F9*F9*4;H+=4)if(Z[H]!==J[H]||Z[H+1]!==J[H+1]||Z[H+2]!==J[H+2])return!1;return!0}function Xa($,Z,J){try{let H=$.getItem(Z);if(!H)throw Error(`No value found for "${Z}".`);let B=JSON.parse(H);return J(B)}catch{return null}}function Pa($,Z,J){$.setItem(Z,JSON.stringify(J))}function za($){return(Z)=>Z===void 0?void 0:$(Z)}function Ga($){return(Z)=>Z===null?null:$(Z)}function i2($){if(typeof $!="string")throw Error();return $}function jq($){if(typeof $!="number")throw Error();return $}function _a($){if(typeof $!="boolean")throw Error();return $}function C7($){return(Z)=>{if(typeof Z!="object"||Z===null)throw Error();let J={};for(let H in $){let B=Z[H];B===void 0&&$[H](void 0),J[H]=$[H](B)}return J}}function f_($){return(Z)=>{if(!Array.isArray(Z))throw Error();return Z.length>0&&$(Z[0]),Z}}var ja=($,Z)=>`${$}/${Z}/data.json`,Oa=($,Z)=>`${$}/${Z}/messages.json`,wK0=["bn","da","de","en-gb","en","es-mx","es","et","fi","fr","hi","hu","it","ja","ko","lt","ms","nb","nl","pl","pt","ru","sv","th","uk","vi","zh-hant","zh"],Ua="en",Ta=($)=>`frimousse/data/${$}`,Ya="frimousse/metadata";async function Ka($,Z){try{return(await fetch($,{method:"HEAD",signal:Z})).headers.get("etag")}catch{return null}}async function SK0($,Z,J){let[{emojis:H,emojisEtag:B},{messages:Q,messagesEtag:X}]=await Promise.all([fetch(ja($,Z),{signal:J}).then(async(z)=>({emojis:await z.json(),emojisEtag:z.headers.get("etag")})),fetch(Oa($,Z),{signal:J}).then(async(z)=>({messages:await z.json(),messagesEtag:z.headers.get("etag")}))]);return{emojis:H,messages:Q,emojisEtag:B,messagesEtag:X}}async function RK0($,Z,J){let[H,B]=await Promise.all([Ka(ja($,Z),J),Ka(Oa($,Z),J)]);return{emojisEtag:H,messagesEtag:B}}function kK0($){return $.skins?$.skins.filter((Z)=>typeof Z.tone=="number").reduce((Z,J)=>{let H=m_[J.tone];return Z[H]=J.emoji,Z},{}):void 0}async function Fa($,Z,J){let{emojis:H,emojisEtag:B,messages:Q,messagesEtag:X}=await SK0($,Z,J),z=Q.subgroups.find((q)=>q.key==="country-flag"||q.key==="subdivision-flag"),G=Q.groups.filter((q)=>q.key!=="component"),U=H.filter((q)=>("group"in q)),Y=G.map((q)=>({index:q.order,label:g_(q.message)})),K=Q.skinTones.reduce((q,N)=>(q[N.key]=g_(N.message),q),{}),F=U.map((q)=>({emoji:q.emoji,category:q.group,version:q.version,label:g_(q.label),tags:q.tags??[],countryFlag:z&&q.subgroup===z.order||void 0,skins:kK0(q)})),W={locale:Z,emojis:F,categories:Y,skinTones:K};return Pa(localStorage,Ta(Z),{data:W,metadata:{emojisEtag:B,messagesEtag:X}}),W}function IK0($,Z){let J=new Map;for(let X of $)J.has(X.version)||J.set(X.version,X.emoji);let H=[...J.keys()].sort((X,z)=>z-X),B=H[0]??0,Q=Qa("\uD83C\uDDEA\uD83C\uDDFA");if(typeof Z=="number")return{emojiVersion:Z,countryFlags:Q};for(let X of H){let z=J.get(X);if(Qa(z))return{emojiVersion:X,countryFlags:Q}}return{emojiVersion:B,countryFlags:Q}}var yK0=C7({emojiVersion:jq,countryFlags:_a}),xK0=C7({data:C7({locale:i2,emojis:f_(C7({emoji:i2,category:jq,label:i2,version:jq,tags:f_(i2),countryFlag:za(_a),skins:za(C7({light:i2,"medium-light":i2,medium:i2,"medium-dark":i2,dark:i2}))})),categories:f_(C7({index:jq,label:i2})),skinTones:C7({light:i2,"medium-light":i2,medium:i2,"medium-dark":i2,dark:i2})}),metadata:C7({emojisEtag:Ga(i2),messagesEtag:Ga(i2)})});async function hK0({locale:$,emojiVersion:Z,emojibaseUrl:J,signal:H}){let B=typeof J=="string"?J:`https://cdn.jsdelivr.net/npm/emojibase-data@${typeof Z=="number"?Math.floor(Z):"latest"}`,Q=Xa(sessionStorage,Ya,yK0),X=Xa(localStorage,Ta($),xK0),z;if(!X)z=await Fa(B,$,H);else if(Q)z=X.data;else try{let{emojisEtag:U,messagesEtag:Y}=await RK0(B,$,H);z=!U||!Y||U!==X.metadata.emojisEtag||Y!==X.metadata.messagesEtag?await Fa(B,$,H):X.data}catch{z=X.data}Q??=IK0(z.emojis,Z),Pa(sessionStorage,Ya,Q);let G=z.emojis.filter((U)=>{let Y=U.version<=Q.emojiVersion;return U.countryFlag?Y&&Q.countryFlags:Y});return{locale:$,emojis:G,categories:z.categories,skinTones:z.skinTones}}function Wa($){return wK0.includes($)?$:(console.warn(`Locale "${$}" is not supported, using "${Ua}" instead.`),Ua)}function qa($){return m_.includes($)?$:(console.warn(`Skin tone "${$}" is not valid, using "none" instead.`),"none")}function vK0($,Z){let J=[];if(Z<=0)return J;for(let H=0,B=$.length;H<B;H+=Z)J.push($.slice(H,H+Z));return J}function gK0($,Z){if(!Z)return $;let J=Z.toLowerCase().trim(),H=new WeakMap;return $.filter((B)=>{let Q=0;B.label.toLowerCase().includes(J)&&(Q+=10);for(let X of B.tags)X.toLowerCase().includes(J)&&(Q+=1);return Q>0?(H.set(B,Q),!0):!1}).sort((B,Q)=>(H.get(Q)??0)-(H.get(B)??0))}function fK0($,Z,J,H){let B=gK0($.emojis,H),Q=[],X=[],z=[],G={},U=0,Y=0;for(let K of B)G[K.category]||(G[K.category]=[]),G[K.category].push({emoji:J&&J!=="none"&&K.skins?K.skins[J]:K.emoji,label:K.label});for(let K of $.categories){let F=G[K.index];if(!F||F.length===0)continue;let W=vK0(Array.from(F),Z).map((q)=>({categoryIndex:U,emojis:q}));Q.push(...W),X.push({label:K.label,rowsCount:W.length,startRowIndex:Y}),z.push(Y),U++,Y+=W.length}return{count:B.length,categories:X,categoriesStartRowIndices:z,rows:Q,skinTones:$.skinTones}}function mK0($){let Z={},J=null,H=null,B=new Set,Q=()=>{if(J){Z=J,J=null;for(let U of B)U(Z)}H=null},X=()=>J??Z,z=(U)=>{J??=Z,Object.assign(J,typeof U=="function"?U(X()):U),H||(H=requestAnimationFrame(Q))},G=(U)=>(B.add(U),()=>B.delete(U));return Z=$(z,X),{get:X,set:z,subscribe:G}}function uK0($){let[Z]=D8.useState($);return Z}function pK0($){let Z=D8.createContext(null);return{useStore:()=>{let J=D8.useContext(Z);if(!J)throw Error($);return J},Provider:({store:J,children:H})=>Ca.jsx(Z.Provider,{value:J,children:H})}}function A8($,Z,J=Object.is){let[H,B]=D8.useState(()=>Z($.get()));return D8.useEffect(()=>$.subscribe(()=>{let Q=Z($.get());B((X)=>J(X,Q)?X:Q)}),[$,Z,J]),D8.useDebugValue(H),H}function K3($,Z,J){let H=D8.useCallback((B)=>B[Z],[Z]);return A8($,H,J)}var Na=2;function cK0($,Z,J,H,B){let Q=0;return mK0((X,z)=>({locale:Z,columns:J,sticky:H,skinTone:B,onEmojiSelect:$,data:null,search:"",interaction:"none",activeColumnIndex:0,activeRowIndex:0,rowHeight:null,categoryHeaderHeight:null,viewportWidth:null,viewportHeight:null,viewportCurrentCategoryIndex:null,viewportStartCategoryIndex:0,viewportStartRowIndex:0,viewportEndRowIndex:0,rootRef:null,searchRef:null,viewportRef:null,listRef:null,updateViewportState:(G)=>{let U=z(),Y=G?.data??U.data,K=G?.categoryHeaderHeight??U.categoryHeaderHeight,F=G?.rowHeight??U.rowHeight,W=G?.viewportHeight??U.viewportHeight;if(!Y||Y.rows.length===0||!K||!F||!W)return X({...G,viewportStartCategoryIndex:0,viewportStartRowIndex:0,viewportEndRowIndex:0});let q=0,N=0;for(let T of Y.categories)if(N++*K+T.startRowIndex*F<Q)q+=K;else break;let D=Y.categories.length*K+Y.rows.length*F,A=Math.floor(Na*F/2),V=Math.ceil(Na*F/2),L=Math.min(Q-q-A,D-W),j=L+W+V,M=Math.max(0,Math.floor(L/F)),_=Math.min(Y.rows.length-1,Math.ceil(j/F)),w=Y.rows[M]?.categoryIndex;return X(w===void 0&&G?G:{...G,viewportStartCategoryIndex:w,viewportStartRowIndex:M,viewportEndRowIndex:_})},onDataChange:(G)=>{z().updateViewportState({data:G,activeColumnIndex:0,activeRowIndex:0})},onSearchChange:(G)=>{X({search:G,interaction:G?"keyboard":"none"})},onActiveEmojiChange:(G,U,Y)=>{if(X({interaction:G,activeColumnIndex:U,activeRowIndex:Y}),G!=="keyboard")return;let{listRef:K,viewportRef:F,sticky:W,rowHeight:q,viewportHeight:N,categoryHeaderHeight:D}=z(),A=K?.current,V=F?.current;if(!A||!V||!q||!D||!N)return;let L=Y;L===0&&V.scrollTo({top:0,behavior:"instant"});let j=A.querySelector(`[aria-rowindex="${L}"]`);if(!(j instanceof HTMLElement))return;let M=j.offsetTop,_=getComputedStyle(j),w=Number.parseFloat(_.scrollMarginTop),T=Number.parseFloat(_.scrollMarginBottom),b=Q+w;W&&M<Q+N/2&&(b+=D);let C=b+N-T;(M<b||M+q>C)&&V.scrollTo({top:Math.max(M<b+D?M-Math.max(W?D:0,w):M-N+q+T,0),behavior:"instant"})},onActiveEmojiReset:()=>{X({interaction:"none",activeColumnIndex:0,activeRowIndex:0})},onRowHeightChange:(G)=>{z().updateViewportState({rowHeight:G})},onCategoryHeaderHeightChange:(G)=>{z().updateViewportState({categoryHeaderHeight:G})},onViewportSizeChange:(G,U)=>{z().updateViewportState({viewportWidth:G,viewportHeight:U})},onViewportScroll:(G)=>{Q=G,z().updateViewportState()}}))}var{useStore:t4,Provider:dK0}=pK0("EmojiPicker.Root is missing.");function lK0($){return $.search}function u_($){return $.interaction==="none"?void 0:$.data?.rows[$.activeRowIndex]?.emojis[$.activeColumnIndex]}function iK0($){return $.data===void 0||typeof $.data?.count=="number"&&$.data.count===0}function rK0($){return $.data===null||$.viewportHeight===null||$.rowHeight===null||$.categoryHeaderHeight===null}function Ea($){return $.data?.rows.length}function aK0($){return $.data?.categories.length}function oK0($){return $.data?.categoriesStartRowIndices}function nK0($){return $.data?.skinTones}function ba($,Z){return $?.emoji===Z?.emoji}function sK0($,Z){return $?.categoryIndex!==Z?.categoryIndex||$?.emojis.length!==Z?.emojis.length?!1:!!$?.emojis.every((J,H)=>ba(J,Z?.emojis[H]))}var SX="‍",Aa=/\p{Emoji_Modifier_Base}/u,tK0=/\uFE0F$/,eK0=/\u{1F3FB}|\u{1F3FC}|\u{1F3FD}|\u{1F3FE}|\u{1F3FF}/gu,$F0={light:"\uD83C\uDFFB","medium-light":"\uD83C\uDFFC",medium:"\uD83C\uDFFD","medium-dark":"\uD83C\uDFFE",dark:"\uD83C\uDFFF"};function ZF0($,Z){if(!$.split(SX).some((H)=>Aa.test(H)))return $;let J=$.split(SX).map((H)=>H.replace(eK0,"")).join(SX);return Z==="none"?J:J.split(SX).map((H,B,Q)=>{let X=Q.length>1;return!Aa.test(H)||X&&H==="\uD83E\uDD1D"?H:H.replace(tK0,"")+$F0[Z]}).join(SX)}function JF0($){return m_.map((Z)=>({skinTone:Z,emoji:ZF0($,Z)}))}function wa(){let $=t4(),Z=A8($,u_,ba);return IH.useDeferredValue(Z)}function Sa($="✋"){let Z=t4(),J=K3(Z,"skinTone"),H=IH.useMemo(()=>JF0($),[$]),B=IH.useCallback((Q)=>{Z.set({skinTone:Q})},[]);return[J,B,H]}function p_($,Z){if(Object.is($,Z))return!0;if(typeof $!="object"||typeof Z!="object"||$===null||Z===null||Array.isArray($)!==Array.isArray(Z))return!1;let J=Object.keys($),H=Object.keys(Z);return J.length!==H.length?!1:J.every((B)=>(B in Z)&&$[B]===Z[B])}function HF0(...$){}function BF0($,Z){let J=null;if(typeof window.requestIdleCallback=="function")J=window.requestIdleCallback($,Z);else{let H=Date.now();J=window.setTimeout(()=>{$({didTimeout:!1,timeRemaining:()=>Math.max(0,(Z?.timeout??50)-(Date.now()-H))})},10)}return()=>{typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(J):window.clearTimeout(J)}}var W9=typeof window<"u"?Oq.useLayoutEffect:Oq.useEffect;function QF0($){let Z=Tq.useRef($);return W9(()=>{Z.current=$}),Tq.useCallback((...J)=>Z.current(...J),[])}function XF0({emojiVersion:$,emojibaseUrl:Z}){let[J,H]=J1.useState(void 0),B=t4(),Q=K3(B,"locale"),X=K3(B,"columns"),z=K3(B,"skinTone"),G=K3(B,"search");return J1.useEffect(()=>{let U=new AbortController,Y=U.signal;return hK0({locale:Q,emojiVersion:$,emojibaseUrl:Z,signal:Y}).then((K)=>{H(K)}).catch((K)=>{Y.aborted||console.error(K)}),()=>{U.abort()}},[$,Z,Q]),J1.useEffect(()=>{if(J)return BF0(()=>{B.get().onDataChange(fK0(J,X,z,G))},{timeout:100})},[J,X,z,G]),null}var Ra=J1.forwardRef(({locale:$="en",columns:Z=9,skinTone:J="none",onEmojiSelect:H=HF0,emojiVersion:B,emojibaseUrl:Q,onFocusCapture:X,onBlurCapture:z,children:G,style:U,sticky:Y=!0,...K},F)=>{let W=QF0(H),q=uK0(()=>cK0(W,Wa($),Z,Y,qa(J))),[N,D]=J1.useState(!1),A=J1.useRef(null),V=J1.useCallback((M)=>{M&&(A.current=M,q.set({rootRef:A}))},[]);W9(()=>{q.set({locale:Wa($)})},[$]),W9(()=>{q.set({columns:Z})},[Z]),W9(()=>{q.set({sticky:Y})},[Y]),W9(()=>{q.set({skinTone:qa(J)})},[J]);let L=J1.useCallback((M)=>{X?.(M);let{searchRef:_,viewportRef:w}=q.get(),T=M.target===_?.current||M.target.hasAttribute("frimousse-search"),b=M.target===w?.current||M.target.hasAttribute("frimousse-viewport");M.isDefaultPrevented()||(D(T||b),M.isDefaultPrevented()||(D(T||b),b?q.get().onActiveEmojiChange("keyboard",0,0):T&&q.get().search===""&&q.set({interaction:"none"})))},[X]),j=J1.useCallback((M)=>{z?.(M),!M.isDefaultPrevented()&&!M.currentTarget.contains(M.relatedTarget)&&D(!1)},[z]);return W9(()=>{N||q.get().onActiveEmojiReset()},[N]),J1.useImperativeHandle(F,()=>A.current),J1.useEffect(()=>{if(!N)return;function M(_){if(_.defaultPrevented||!_.key.startsWith("Arrow")&&_.key!=="Enter")return;let{data:w,onEmojiSelect:T,onActiveEmojiChange:b,interaction:C,activeColumnIndex:k,activeRowIndex:S}=q.get();if(_.key==="Enter"){let R=u_(q.get());R&&(_.preventDefault(),T(R))}if(_.key.startsWith("Arrow")){let R=k,O=S;if(_.preventDefault(),C!=="none"){if(w?.rows&&w.rows.length>0)switch(_.key){case"ArrowLeft":{if(R===0){let y=O-1,I=w.rows[y];I&&(O=y,R=I.emojis.length-1)}else R-=1;break}case"ArrowRight":{if(R===w.rows[O].emojis.length-1){let y=O+1;w.rows[y]&&(O=y,R=0)}else R+=1;break}case"ArrowUp":{let y=w.rows[O-1];y&&(O-=1,y.emojis[R]||(R=y.emojis.length-1));break}case"ArrowDown":{let y=w.rows[O+1];y&&(O+=1,y.emojis[R]||(R=y.emojis.length-1));break}}b("keyboard",R,O)}else b("keyboard",0,0)}}return document.addEventListener("keydown",M),()=>{document.removeEventListener("keydown",M)}},[N]),W9(()=>{let M=null,_=null,w=null,T=null,b=q.subscribe((O)=>{A.current&&(M!==O.viewportWidth&&(M=O.viewportWidth,A.current.style.setProperty("--frimousse-viewport-width",`${O.viewportWidth}px`)),_!==O.viewportHeight&&(_=O.viewportHeight,A.current.style.setProperty("--frimousse-viewport-height",`${O.viewportHeight}px`)),w!==O.rowHeight&&(w=O.rowHeight,A.current.style.setProperty("--frimousse-row-height",`${O.rowHeight}px`)),T!==O.categoryHeaderHeight&&(T=O.categoryHeaderHeight,A.current.style.setProperty("--frimousse-category-header-height",`${O.categoryHeaderHeight}px`)))}),{viewportWidth:C,viewportHeight:k,rowHeight:S,categoryHeaderHeight:R}=q.get();return C&&A.current.style.setProperty("--frimousse-viewport-width",`${C}px`),k&&A.current.style.setProperty("--frimousse-viewport-height",`${k}px`),S&&A.current.style.setProperty("--frimousse-row-height",`${S}px`),R&&A.current.style.setProperty("--frimousse-category-header-height",`${R}px`),b},[]),h1.jsx("div",{"data-focused":N?"":void 0,"frimousse-root":"",onBlurCapture:j,onFocusCapture:L,...K,ref:V,style:{"--frimousse-emoji-font":Ma,...U},children:h1.jsxs(dK0,{store:q,children:[h1.jsx(XF0,{emojiVersion:B,emojibaseUrl:Q}),G]})})}),ka=J1.forwardRef(({value:$,defaultValue:Z,onChange:J,...H},B)=>{let Q=t4(),X=J1.useRef(null),z=J1.useCallback((K)=>{K&&(X.current=K,Q.set({searchRef:X}))},[]),G=typeof $=="string",U=J1.useRef(G);J1.useEffect(()=>{U.current=G},[G]),W9(()=>{Q.set({search:typeof $=="string"?$:typeof Z=="string"?Z:""})},[]),W9(()=>{typeof $=="string"&&Q.get().onSearchChange($)},[$]);let Y=J1.useCallback((K)=>{J?.(K),K.isDefaultPrevented()||Q.get().onSearchChange(K.target.value)},[J]);return J1.useImperativeHandle(B,()=>X.current),h1.jsx("input",{autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",enterKeyHint:"done","frimousse-search":"",placeholder:"Search…",spellCheck:!1,type:"search",...H,defaultValue:Z,onChange:Y,ref:z,value:$})}),zF0=J1.memo(()=>{let $=wa();return $?h1.jsx("div",{"aria-live":"polite",style:{border:0,clip:"rect(0, 0, 0, 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:1,wordWrap:"normal"},children:$.label}):null}),Ia=J1.forwardRef(({children:$,onScroll:Z,onKeyDown:J,style:H,...B},Q)=>{let X=t4(),z=J1.useRef(null),G=J1.useCallback((F)=>{F&&(z.current=F,X.set({viewportRef:z}))},[]),U=A8(X,Ea),Y=A8(X,aK0),K=J1.useCallback((F)=>{Z?.(F),X.get().onViewportScroll(F.currentTarget.scrollTop)},[Z]);return W9(()=>{if(!z.current)return;let F=new ResizeObserver(([W])=>{let q=W?.borderBoxSize[0]?.inlineSize??0,N=W?.borderBoxSize[0]?.blockSize??0,{onViewportSizeChange:D,viewportHeight:A,viewportWidth:V}=X.get();(A!==N||V!==q)&&D(q,N)});return F.observe(z.current),X.get().onViewportSizeChange(z.current.offsetWidth,z.current.clientHeight),()=>{F.disconnect()}},[]),J1.useImperativeHandle(Q,()=>z.current),h1.jsxs("div",{"frimousse-viewport":"",...B,onScroll:K,ref:G,style:{position:"relative",boxSizing:"border-box",contain:"layout paint",containIntrinsicSize:typeof U=="number"&&typeof Y=="number"?`var(--frimousse-viewport-width, auto) calc(${U} * var(--frimousse-row-height) + ${Y} * var(--frimousse-category-header-height))`:void 0,overflowY:"auto",overscrollBehavior:"contain",scrollbarGutter:"stable",willChange:"scroll-position",...H},children:[h1.jsx(zF0,{}),$]})});function ya($,Z,J){return{emoji:{...$,isActive:J},role:"gridcell","aria-colindex":Z,"aria-selected":J||void 0,"aria-label":$.label,"data-active":J?"":void 0,"frimousse-emoji":"",style:{fontFamily:"var(--frimousse-emoji-font)"},tabIndex:-1}}function xa($,Z=!1){return{role:Z?void 0:"row","aria-rowindex":Z?void 0:$,"frimousse-row":"",style:{contain:Z?void 0:"content",height:Z?void 0:"var(--frimousse-row-height)",display:"flex"}}}function ha($,Z){return{"frimousse-category":"",style:{contain:"content",top:Z?`calc(${$} * var(--frimousse-category-header-height) + ${Z.startRowIndex} * var(--frimousse-row-height))`:void 0,height:Z?`calc(var(--frimousse-category-header-height) + ${Z.rowsCount} * var(--frimousse-row-height))`:void 0,width:"100%",pointerEvents:"none",position:"absolute"}}}function va($,Z=!1,J=!0){return{category:$,"frimousse-category-header":"",style:{contain:Z?void 0:"layout paint",height:Z?void 0:"var(--frimousse-category-header-height)",pointerEvents:"auto",position:J?"sticky":void 0,top:0}}}function Da($,Z,J,H){return{"frimousse-list-sizer":"",style:{position:"relative",boxSizing:"border-box",height:`calc(${$} * var(--frimousse-row-height) + ${Z} * var(--frimousse-category-header-height))`,paddingTop:`calc(${J} * var(--frimousse-row-height) + ${H} * var(--frimousse-category-header-height))`}}}function Va($,Z,J){return{"aria-colcount":$,"aria-rowcount":Z,"frimousse-list":"",style:{"--frimousse-list-columns":$,...J},role:"grid"}}function GF0($){$.preventDefault()}var UF0=J1.memo(({Emoji:$,emoji:Z,columnIndex:J,rowIndex:H})=>{let B=t4(),Q=A8(B,(U)=>u_(U)?.emoji===Z.emoji),X=J1.useCallback(()=>{B.get().onEmojiSelect(Z)},[Z]),z=J1.useCallback(()=>{B.get().onActiveEmojiChange("pointer",J,H)},[J,H]),G=J1.useCallback(()=>{B.get().onActiveEmojiReset()},[]);return h1.jsx($,{...ya(Z,J,Q),onClick:X,onPointerDown:GF0,onPointerEnter:z,onPointerLeave:G})}),YF0=J1.memo(({Row:$,Emoji:Z,rowIndex:J})=>{let H=t4(),B=A8(H,(Q)=>Q.data?.rows[J],sK0);return B?h1.jsx($,{...xa(J),children:B.emojis.map((Q,X)=>h1.jsx(UF0,{Emoji:Z,columnIndex:X,emoji:Q,rowIndex:J},Q.label))}):null}),KF0=J1.memo(({CategoryHeader:$,categoryIndex:Z})=>{let J=t4(),H=A8(J,(Q)=>Q.data?.categories[Z],p_),B=K3(J,"sticky");return H?h1.jsx("div",{...ha(Z,H),children:h1.jsx($,{...va({label:H.label},!1,B)})}):null}),La=J1.memo(({CategoryHeader:$,Row:Z,Emoji:J})=>{let H=J1.useRef(null),B=t4(),Q=K3(B,"columns"),X=J1.useMemo(()=>Array(Q).fill({emoji:"\uD83D\uDE42",label:""}),[Q]),z=J1.useMemo(()=>({label:"Category"}),[]),G=J1.useRef(null),U=J1.useRef(null);return W9(()=>{let Y=H.current?.parentElement?.parentElement;if(!Y||!G.current||!U.current)return;let K=new ResizeObserver((q)=>{for(let N of q){let D=N.contentRect.height,{onRowHeightChange:A,onCategoryHeaderHeightChange:V,rowHeight:L,categoryHeaderHeight:j}=B.get();N.target===G.current&&L!==D&&A(D),N.target===U.current&&j!==D&&V(D)}});K.observe(Y),K.observe(G.current),K.observe(U.current);let{onRowHeightChange:F,onCategoryHeaderHeightChange:W}=B.get();return F(G.current.clientHeight),W(U.current.clientHeight),()=>{K.disconnect()}},[]),h1.jsxs("div",{"aria-hidden":!0,ref:H,style:{height:0,visibility:"hidden"},children:[h1.jsx("div",{"frimousse-row-sizer":"",ref:G,children:h1.jsx(Z,{...xa(-1,!0),children:X.map((Y,K)=>h1.jsx(J,{...ya(Y,K,!1)},K))})}),h1.jsx("div",{...ha(-1),children:h1.jsx("div",{"frimousse-category-header-sizer":"",ref:U,children:h1.jsx($,{...va(z,!0)})})})]})});function FF0({category:$,...Z}){return h1.jsx("div",{...Z,children:$.label})}function WF0({emoji:$,...Z}){return h1.jsx("button",{type:"button",...Z,children:$.emoji})}function qF0({...$}){return h1.jsx("div",{...$})}var ga=J1.forwardRef(({style:$,components:Z,...J},H)=>{let B=t4(),Q=J1.useRef(null),X=J1.useCallback((A)=>{A&&(Q.current=A,B.set({listRef:Q}))},[]),z=Z?.CategoryHeader??FF0,G=Z?.Emoji??WF0,U=Z?.Row??qF0,Y=K3(B,"columns"),K=K3(B,"viewportStartRowIndex"),F=K3(B,"viewportEndRowIndex"),W=A8(B,Ea),q=A8(B,oK0,p_),N=J1.useMemo(()=>q?.filter((A)=>A<K).length??0,[q,K]),D=q?.length??0;return J1.useImperativeHandle(H,()=>Q.current),!W||!q||D===0?h1.jsx("div",{...Va(Y,0,$),...J,children:h1.jsx("div",{...Da(0,0,0,0),children:h1.jsx(La,{CategoryHeader:z,Emoji:G,Row:U})})}):h1.jsx("div",{...Va(Y,W,$),...J,ref:X,children:h1.jsxs("div",{...Da(W,D,K,N),children:[h1.jsx(La,{CategoryHeader:z,Emoji:G,Row:U}),Array.from({length:F-K+1},(A,V)=>{let L=K+V,j=q.indexOf(L);return h1.jsxs(J1.Fragment,{children:[j>=0&&h1.jsx("div",{style:{height:"var(--frimousse-category-header-height)"}}),h1.jsx(YF0,{Emoji:G,Row:U,rowIndex:L})]},L)}),Array.from({length:D},(A,V)=>h1.jsx(KF0,{CategoryHeader:z,categoryIndex:V},V))]})})}),fa=J1.forwardRef(({emoji:$,onClick:Z,"aria-label":J="Change skin tone",...H},B)=>{let Q=t4(),X=A8(Q,nK0,p_),[z,G,U]=Sa($),Y=J1.useMemo(()=>Math.max(0,U.findIndex((D)=>D.skinTone===z)),[z,U]),K=U[Y],F=U[(Y+1)%U.length].skinTone,W=z==="none"?void 0:X?.[z],q=F==="none"?void 0:X?.[F],N=J1.useCallback((D)=>{Z?.(D),D.isDefaultPrevented()||G(F)},[Z,G,F]);return h1.jsx("button",{type:"button",...H,"aria-label":J+(q?` (${q})`:""),"aria-live":"polite","aria-valuetext":W,"frimousse-skin-tone-selector":"",onClick:N,ref:B,children:K.emoji})});function ma({children:$,...Z}){let J=t4();return A8(J,rK0)?h1.jsx("span",{"frimousse-loading":"",...Z,children:$}):null}function NF0({children:$}){let Z=t4(),J=A8(Z,lK0);return $({search:J})}function ua({children:$,...Z}){let J=t4();return A8(J,iK0)?h1.jsx("span",{"frimousse-empty":"",...Z,children:typeof $=="function"?h1.jsx(NF0,{children:$}):$}):null}function pa({children:$}){let Z=wa();return $({emoji:Z})}function ca({children:$,emoji:Z}){let[J,H,B]=Sa(Z);return $({skinTone:J,setSkinTone:H,skinToneVariations:B})}Ra.displayName="EmojiPicker.Root";ka.displayName="EmojiPicker.Search";Ia.displayName="EmojiPicker.Viewport";ga.displayName="EmojiPicker.List";ma.displayName="EmojiPicker.Loading";ua.displayName="EmojiPicker.Empty";fa.displayName="EmojiPicker.SkinToneSelector";pa.displayName="EmojiPicker.ActiveEmoji";ca.displayName="EmojiPicker.SkinTone";var kX={};b5(kX,{Root:()=>oa,Indicator:()=>na});var q9=P(m(),1);function da($){if(!$)return null;for(let Z of $.elements){let J=Z.tagName;if(J==="BUTTON"||J==="INPUT"){let H=Z;if(H.type==="submit")return H}}return null}var la="data-checked",ia="data-unchecked";function Cq($){return{checked(Z){if($.indeterminate)return{};if(Z)return{[la]:""};return{[ia]:""}},...S2}}var Eq=P(m(),1),DF0=Eq.createContext(void 0);function ra(){return Eq.useContext(DF0)}var bq=P(m(),1),c_=bq.createContext(void 0);function aa(){let $=bq.useContext(c_);if($===void 0)throw Error(I0(14));return $}var RX=P(c(),1),VF0="data-parent",oa=q9.forwardRef(function(Z,J){let{checked:H,className:B,defaultChecked:Q=!1,"aria-labelledby":X,disabled:z=!1,form:G,id:U,indeterminate:Y=!1,inputRef:K,name:F,onCheckedChange:W,parent:q=!1,readOnly:N=!1,render:D,required:A=!1,uncheckedValue:V,value:L,nativeButton:j=!1,style:M,..._}=Z,{clearErrors:w}=X4(),{disabled:T,name:b,setDirty:C,setFilled:k,setFocused:S,setTouched:R,state:O,validationMode:y,validityData:I,validation:x}=i5(),v=DJ(),{labelId:g,registerControlId:E,getDescriptionProps:l}=r5(),r=ra(),h=r?.allValues===void 0?void 0:r.parent,d=h!==void 0,o=T||v.disabled||r?.disabled||z,p=b??F,i=L??p,n=t0(),Z0=r?.registerControlId!==E,J0=v6({id:U||void 0,enabled:Z0}),U0=j?J0:n,z0={};if(d){if(q)z0=h.getParentProps();else if(i!==void 0)z0=h.getChildProps(i)}let{checked:B0=H,indeterminate:N0=Y,onCheckedChange:D0,...F0}=z0,s=r?.value,a=q9.useRef(null),{getButtonProps:e,buttonRef:$0}=C5({disabled:o,native:j}),Q0=r?.validation??x,[_0,M0]=z4({controlled:i!==void 0&&s!==void 0&&!q?s.includes(i):B0,default:Q,name:"Checkbox",state:"checked"}),A0=d?Boolean(B0):_0,L0=d?N0||Y:Y;h6(a,n,_0,void 0,!r&&!o,F);let f=h?.registerChildId,u=q9.useRef(null),t=Q0.registerInput,W0=r?i:void 0,S0=q9.useCallback((y0)=>t(y0,{controlRef:a,value:W0}),[t,W0]),p0=f2(K,u,q?void 0:S0),g0=Bq(X,g,u,!j,J0);H0(()=>{if(u.current)u.current.indeterminate=L0;if(!r)k(_0)},[_0,L0,r,k]),p9(_0,()=>{if(r)return;w(p),C(_0!==I.initialValue),Q0.change(_0)});let T0=X2({checked:_0,disabled:o,form:G,name:q?void 0:p,id:j?void 0:J0,required:A,ref:p0,style:p?Rz:r8,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(y0){if(y0.nativeEvent.defaultPrevented)return;if(N){y0.preventDefault();return}let E1=y0.currentTarget.checked,W1=w0(K0.none,y0.nativeEvent);if(W?.(E1,W1),W1.isCanceled)return;if(D0?.(E1,W1),W1.isCanceled)return;if(M0(E1),i!==void 0&&r!==void 0&&!q&&!d){let Q5=E1?[...r.value,i]:r.value.filter((C0)=>C0!==i);r.setValue(Q5,W1)}},onClick(y0){y0.stopPropagation()},onFocus(){a.current?.focus()}},L!==void 0?{value:(r?_0&&L:L)||""}:M1,l,(y0)=>Q0.getValidationProps(o,y0));q9.useEffect(()=>{if(!h||i===void 0)return;let y0=h.disabledStatesRef.current;return y0.set(i,o),()=>{y0.delete(i)}},[h,o,i]);let d0=q9.useMemo(()=>({...O,checked:A0,disabled:o,readOnly:N,required:A,indeterminate:L0}),[O,A0,o,N,A,L0]),Q1=Cq(d0),e0=G0("span",Z,{state:d0,ref:[$0,a,J],props:[{id:U0,role:"checkbox","aria-checked":L0?"mixed":A0,"aria-readonly":N||void 0,"aria-required":A||void 0,"aria-labelledby":g0,[VF0]:q?"":void 0,onFocus(){if(!o)S(!0)},onBlur(){let y0=u.current;if(!y0)return;if(R(!0),S(!1),y==="onBlur")Q0.commit(r?s:y0.checked)},onKeyDown(y0){if(y0.key!=="Enter")return;if(y0.preventBaseUIHandler(),y0.defaultPrevented)return;let E1=u.current?.form??null,W1=y0.currentTarget,Q5=y0.nativeEvent,C0=y0.preventDefault,x0=Q5.preventDefault,r0=!1;y0.preventDefault=()=>{r0=!0,C0.call(y0)},Q5.preventDefault=()=>{r0=!0,x0.call(Q5)},x0.call(Q5),w1(W1).queueMicrotask(()=>{if(y0.preventDefault=C0,Q5.preventDefault=x0,!r0)da(E1)?.click()})},onClick(y0){if(N||o)return;y0.preventDefault();let E1=u.current;if(!E1)return;iJ(E1,y0)}},_,F0,e,l,(y0)=>Q0.getValidationProps(o,y0)],stateAttributesMapping:Q1}),c0=e0.props.id;return H0(()=>{if(!f||q||i===void 0||c0===void 0)return;return f(i,c0)},[f,q,i,c0]),RX.jsxs(c_.Provider,{value:d0,children:[e0,!_0&&!r&&p&&!q&&V!==void 0&&RX.jsx("input",{type:"hidden",form:G,name:p,value:V,disabled:o}),RX.jsx("input",{...T0,suppressHydrationWarning:!0})]})});var wq=P(m(),1);var na=wq.forwardRef(function(Z,J){let{render:H,className:B,style:Q,keepMounted:X=!1,...z}=Z,G=aa(),U=G.checked||G.indeterminate,{mounted:Y,transitionStatus:K,setMounted:F}=C2(U),W=wq.useRef(null),q={...G,transitionStatus:K};A5({batch:!0,enabled:!U,open:U,ref:W,onComplete(){if(!U)F(!1)}});let D={...Cq(G),...B2},A=X||Y,V=G0("span",Z,{ref:[J,W],state:q,stateAttributesMapping:D,props:z});if(!A)return null;return V});var Sq=P(c(),1);function sa({className:$,...Z}){return Sq.jsx(kX.Root,{"data-slot":"checkbox",className:o0('peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border transition-colors outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground [:where([class~="group/field"]):has(:disabled)_&]:opacity-50 [:where([class~="group/field-label"]):has(:focus-visible)_&]:not-data-checked:border-border [:where([class~="group/field-label"]):has(:focus-visible)_&]:data-checked:border-primary [:where([class~="group/field-label"]:has(:focus-visible))_&]:ring-0',$),...Z,children:Sq.jsx(kX.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:Sq.jsx(S8,{stroke:2})})})}var zZ={};b5(zZ,{Tab:()=>Zo,Root:()=>$o,Panel:()=>qo,List:()=>Lo,Indicator:()=>Fo});var H2=P(m(),1);var Rq=P(m(),1),d_=Rq.createContext(void 0);function E7(){let $=Rq.useContext(d_);if($===void 0)throw Error(I0(64));return $}var ta="data-activation-direction";var F3={tabActivationDirection:($)=>({[ta]:$})};var l_=P(c(),1),$o=H2.forwardRef(function(Z,J){let{className:H,defaultValue:B=0,onValueChange:Q,orientation:X="horizontal",render:z,value:G,style:U,...Y}=Z,K=Z.defaultValue!==void 0,F=H2.useRef([]),[W,q]=H2.useState(()=>new Map),[N,D]=z4({controlled:G,default:B,name:"Tabs",state:"value"}),A=G!==void 0,[V,L]=H2.useState(()=>new Map),j=H2.useRef(void 0),M=H2.useCallback((n)=>i_(V,n),[V]),[_,w]=H2.useState(()=>({previousValue:N,tabActivationDirection:"none"})),{previousValue:T,tabActivationDirection:b}=_,C=b,k=!1;if(T!==N)C=ea(T,N,X,V),k=T!=null&&N!=null&&M(N)==null;let S=k?T:N,R=T!==S||b!==C;H0(()=>{if(!R)return;w({previousValue:S,tabActivationDirection:C})},[S,R,C]);let O=Y0((n,Z0)=>{let J0=ea(N,n,X,V);if(Z0.activationDirection=J0,Q?.(n,Z0),Z0.isCanceled)return;D(n)}),y=Y0((n,Z0)=>{Q?.(n,w0(Z0,void 0,void 0,{activationDirection:"none"}))}),I=Y0((n,Z0)=>{return q((J0)=>{let U0=new Map(J0);return U0.set(n,Z0),U0}),()=>{q((J0)=>{if(J0.get(n)!==Z0)return J0;let U0=new Map(J0);return U0.delete(n),U0})}}),x=H2.useCallback((n)=>{return W.get(n)},[W]),v=H2.useCallback((n)=>{for(let Z0 of V.values())if(n===Z0.value)return Z0.id;return},[V]),g=H2.useMemo(()=>({getTabElementBySelectedValue:M,getTabIdByPanelValue:v,getTabPanelIdByValue:x,onValueChange:O,orientation:X,registerMountedTabPanel:I,setTabMap:L,tabActivationDirection:C,value:N}),[M,v,x,O,X,I,L,C,N]),E=H2.useMemo(()=>{for(let n of V.values())if(n.value===N)return n;return},[V,N]),l=H2.useMemo(()=>{for(let n of V.values())if(!n.disabled)return n.value;return},[V]),r=H2.useRef(!K),h=H2.useRef(B),d=H2.useRef(K),o=H2.useRef(!1);H0(()=>{if(A)return;function n(z0,B0){D(z0),w({previousValue:z0,tabActivationDirection:"none"}),y(z0,B0),r.current=!1}if(V.size===0){if(o.current&&N!==null&&!j.current?.isConnected)n(null,K0.missing);return}o.current=!0,j.current=V.keys().next().value;let Z0=E?.disabled,J0=E==null&&N!==null;if(!Z0&&N===h.current)d.current=!1;if(d.current&&Z0&&N===h.current)return;let U0=r.current;if(Z0||J0){let z0=l??null;if(N===z0){r.current=!1;return}let B0=K0.missing;if(U0)B0=K0.initial;else if(Z0)B0=K0.disabled;n(z0,B0);return}if(U0&&E!=null)y(N,K0.initial),r.current=!1},[l,A,y,E,D,V,N]);let i=G0("div",Z,{state:{orientation:X,tabActivationDirection:C},ref:J,props:Y,stateAttributesMapping:F3});return l_.jsx(d_.Provider,{value:g,children:l_.jsx(G7,{elementsRef:F,children:i})})});function i_($,Z){for(let[J,H]of $.entries())if(Z===H.value)return J;return null}function ea($,Z,J,H){if($==null||Z==null)return"none";let[B,Q,X]=J==="horizontal"?["left","left","right"]:["top","up","down"],z=i_(H,$),G=i_(H,Z);if(z==null||G==null){if(z!==G&&(typeof $==="number"||typeof $==="string")&&typeof $===typeof Z)return Z>$?X:Q;return"none"}let U=z.getBoundingClientRect()[B],Y=G.getBoundingClientRect()[B];if(Y<U)return Q;if(Y>U)return X;return"none"}var i3=P(m(),1);var IX="data-composite-item-active";var kq=P(m(),1),r_=kq.createContext(void 0);function Iq(){let $=kq.useContext(r_);if($===void 0)throw Error(I0(65));return $}var Zo=i3.forwardRef(function(Z,J){let{className:H,disabled:B=!1,render:Q,value:X,id:z,nativeButton:G=!0,style:U,...Y}=Z,{value:K,getTabPanelIdByValue:F,onValueChange:W,orientation:q,tabActivationDirection:N}=E7(),{activateOnFocus:D,registerTabResizeObserverElement:A,tabsListElement:V}=Iq(),{highlightedIndex:L,onHighlightedIndexChange:j}=oJ(),M=t0(z),_=i3.useMemo(()=>({disabled:B,id:M,value:X}),[B,M,X]),{compositeProps:w,compositeRef:T,index:b}=WF({metadata:_}),C=X===K,k=i3.useRef(!1),S=i3.useRef(null),R=Y0((o)=>{S.current?.(),S.current=o?A(o):null});H0(()=>{if(k.current){k.current=!1;return}if(!(C&&b>-1&&L!==b))return;let o=V;if(o!=null){let p=d1(f0(o));if(p&&R0(o,p))return}if(!B)j(b)},[C,b,L,j,B,V]);let{getButtonProps:O,buttonRef:y}=C5({disabled:B,native:G,focusableWhenDisabled:!0}),I=F(X),x=i3.useRef(!1),v=i3.useRef(!1);function g(o){W(X,w0(K0.none,o.nativeEvent,void 0,{activationDirection:"none"}))}function E(o){if(C||B)return;g(o)}function l(o){if(C||B)return;if(D&&(!x.current||v.current))g(o)}function r(o){if(C||B)return;x.current=!0,v.current=o.button===0;let p=f0(o.currentTarget);function i(){x.current=!1,v.current=!1,p.removeEventListener("pointerup",i),p.removeEventListener("pointercancel",i)}p.addEventListener("pointerup",i),p.addEventListener("pointercancel",i)}return G0("button",Z,{state:{disabled:B,active:C,orientation:q,tabActivationDirection:N},ref:[J,y,T,R],props:[w,{role:"tab","aria-controls":I,"aria-selected":C,id:M,onClick:E,onFocus:l,onPointerDown:r,[IX]:C?"":void 0,onKeyDownCapture(){k.current=!0}},Y,O],stateAttributesMapping:F3})});var yH=P(m(),1);var Jo="--active-tab-left",Ho="--active-tab-right",Bo="--active-tab-top",Qo="--active-tab-bottom",Xo="--active-tab-width",zo="--active-tab-height";var yq=P(c(),1),Go,PF0={...F3,activeTabPosition:()=>null,activeTabSize:()=>null},Uo=2,Fo=yH.forwardRef(function(Z,J){let{className:H,render:B,renderBeforeHydration:Q=!1,style:X,...z}=Z,{getTabElementBySelectedValue:G,orientation:U,tabActivationDirection:Y,value:K}=E7(),{tabsListElement:F,registerIndicatorUpdateListener:W}=Iq(),q=rO();yH.useEffect(()=>{return W(q)},[W,q]);let N=0,D=0,A=0,V=0,L=0,j=0,M=!1;if(K!=null&&F!=null){let S=G(K);if(S!=null){M=!0;let{width:R,height:O}=mZ(S),{width:y,height:I}=mZ(F),x=S.getBoundingClientRect(),v=F.getBoundingClientRect(),g=y>0?v.width/y:1,E=I>0?v.height/I:1,l=_F0(S,F);N=l.left,A=l.top;let r=(x.left-v.left)/g+F.scrollLeft-F.clientLeft,h=(x.top-v.top)/E+F.scrollTop-F.clientTop,d=jF0(S);if(Math.abs(r-d.x-N)<=Uo&&Math.abs(h-d.y-A)<=Uo)N=r,A=h;L=R,j=O,D=F.scrollWidth-N-L,V=F.scrollHeight-A-j}}let _=M?{left:N,right:D,top:A,bottom:V}:null,w=M?{width:L,height:j}:null,T=M?{[Jo]:`${N}px`,[Ho]:`${D}px`,[Bo]:`${A}px`,[Qo]:`${V}px`,[Xo]:`${L}px`,[zo]:`${j}px`}:void 0,b=M&&L>0&&j>0,k=G0("span",Z,{state:{orientation:U,activeTabPosition:_,activeTabSize:w,tabActivationDirection:Y},ref:J,props:[{role:"presentation",style:T,hidden:!b},z,{suppressHydrationWarning:!0}],stateAttributesMapping:PF0});if(K==null)return null;return yq.jsxs(yH.Fragment,{children:[k,Q&&(Go||(Go=yq.jsx(CF,{script:OF})))]})});function _F0($,Z){let J=Yo($),H=Yo(Z),B=J.left-H.left-Z.clientLeft,Q=J.top-H.top-Z.clientTop,X=E8($);while(_1(X)&&X!==Z&&!C8(X))B-=X.scrollLeft,Q-=X.scrollTop,X=E8(X);return{left:B,top:Q}}function Yo($){let Z=0,J=0,H=$;while(H!=null){Z+=H.offsetLeft,J+=H.offsetTop;let B=H.offsetParent;if(B!=null)Z+=B.clientLeft,J+=B.clientTop;H=B}return{left:Z,top:J}}function jF0($){let Z=w1($).getComputedStyle($),{x:J,y:H}=hz($,Z),B=J,Q=H,{translate:X}=Z;if(X&&X!=="none"){let z=X.split(" ");B+=Ko(z[0],$.offsetWidth),Q+=Ko(z[1],$.offsetHeight)}return{x:B,y:Q}}function Ko($,Z){if(!$)return 0;let J=parseFloat($);if(!Number.isFinite(J))return 0;return $.endsWith("%")?J/100*Z:J}var xq=P(m(),1);var Wo="data-index";var QO1=Z8.startingStyle,XO1=Z8.endingStyle;var TF0={...F3,...B2},qo=xq.forwardRef(function(Z,J){let{className:H,value:B,render:Q,keepMounted:X=!1,style:z,...G}=Z,{value:U,getTabIdByPanelValue:Y,orientation:K,tabActivationDirection:F,registerMountedTabPanel:W}=E7(),q=t0(),{ref:N,index:D}=K4(),A=B===U,{mounted:V,transitionStatus:L,setMounted:j}=C2(A),M=!V,_=Y(B),w={hidden:M,orientation:K,tabActivationDirection:F,transitionStatus:L},T=xq.useRef(null),b=G0("div",Z,{state:w,ref:[J,N,T],props:[{"aria-labelledby":_,hidden:M,id:q,role:"tabpanel",tabIndex:A?0:-1,inert:T8(!A),[Wo]:D},G],stateAttributesMapping:TF0});if(A5({open:A,ref:T,onComplete(){if(!A)j(!1)}}),H0(()=>{if(q==null||M&&!X)return;return W(B,q)},[M,X,B,q,W]),!(X||V))return null;return b});var N9=P(m(),1);var Do=P(m(),1);var XZ=P(m(),1);function No($){let{loopFocus:Z=!0,orientation:J="both",grid:H,onLoop:B,direction:Q,highlightedIndex:X,onHighlightedIndexChange:z,rootRef:G,enableHomeAndEndKeys:U=!1,stopEventPropagation:Y,disabledIndices:K,modifierKeys:F=s2}=$,[W,q]=XZ.useState(0),N=H!=null,D=XZ.useRef(null),A=f2(D,G),V=XZ.useRef([]),L=XZ.useRef(!1),j=XZ.useRef(null),M=X??W,_=Y0((k,S=!1)=>{if(j.current=V.current[k]??null,(z??q)(k),S){let R=V.current[k];ND(D.current,R,Q,J)}}),w=Y0((k)=>{if(k.size===0)return;if(L.current){let y=V.current,I=y.indexOf(j.current);if(I===-1){let x=y[M];if(!x||M3(y,M,K))_(CF0(y,K));else j.current=x}else if(I!==M)_(I);return}L.current=!0;let S=Array.from(k.keys()),R=S.find((y)=>y?.hasAttribute(IX))??null,O=R?k.get(R)?.index??-1:-1;if(O!==-1)_(O);else if(M3(S,M,K)){let y=j8(S,{disabledIndices:K});if(!z6(S,y))_(y)}ND(D.current,R,Q,J)});H0(()=>{if(K==null||X!=null||!L.current)return;let k=V.current;if(M3(k,M,K)){let S=j8(k,{disabledIndices:K});if(!z6(k,S))_(S)}},[K,X,M,V,_]);let T=Y0((k,S,R)=>{if(!B)return R;return B(k,S,R,V)}),b=Y0((k)=>{let S=k.key===eZ||k.key===$J;if(!Z9.has(k.key)||!U&&S)return;if(EF0(k,F))return;if(!D.current)return;let O=Q==="rtl",y=O?sZ:tZ,I=O?tZ:sZ,x=J==="vertical"?nZ:y,v=J==="vertical"?oZ:I,g=P1(k.nativeEvent);if(g!=null&&qD(g)&&!og(g)){let{selectionStart:o,selectionEnd:p,value:i}=g;if(o==null||k.shiftKey||o!==p)return;if(k.key!==v&&o<i.length)return;if(k.key!==x&&o>0)return}let E=M,l=s7(V,K),r=EZ(V,K);if(H!=null)E=H({disabledIndices:K,elementsRef:V,event:k,highlightedIndex:M,loopFocus:Z,maxIndex:r,minIndex:l,onLoop:T,orientation:J,rtl:O});let h=J!=="vertical"&&k.key===y||J!=="horizontal"&&k.key===nZ,d=J!=="vertical"&&k.key===I||J!=="horizontal"&&k.key===oZ;if(U){if(k.key===eZ)E=l;else if(k.key===$J)E=r}if(E===M&&(h||d))if(Z&&E===r&&h){if(E=l,B)E=B(k,M,E,V)}else if(Z&&E===l&&d){if(E=r,B)E=B(k,M,E,V)}else E=j8(V.current,{startingIndex:E,decrement:d,disabledIndices:K});if(E!==M&&!z6(V.current,E)){if(Y)k.stopPropagation();if(N||S||h||d)k.preventDefault();_(E,!0),queueMicrotask(()=>{V.current[E]?.focus()})}});return{props:{ref:A,onFocus(k){let S=D.current,R=P1(k.nativeEvent);if(!S||R==null||!qD(R))return;R.setSelectionRange(0,R.value.length)},onKeyDown:b},highlightedIndex:M,onHighlightedIndexChange:_,elementsRef:V,onMapChange:w,relayKeyboardEvent:b}}function CF0($,Z){let J=-1;for(let H=0;H<$.length;H+=1){let B=$[H];if(!B||M3($,H,Z))continue;if(B.hasAttribute(IX))return H;if(J===-1)J=H}return Math.max(J,0)}function EF0($,Z){for(let J of Gw){if(Z.includes(J))continue;if($.getModifierState(J))return!0}return!1}var a_=P(c(),1);function Vo($){let{render:Z,className:J,style:H,refs:B=s2,props:Q=s2,state:X=M1,stateAttributesMapping:z,highlightedIndex:G,onHighlightedIndexChange:U,orientation:Y,grid:K,loopFocus:F,onLoop:W,enableHomeAndEndKeys:q,onMapChange:N,stopEventPropagation:D=!0,rootRef:A,disabledIndices:V,modifierKeys:L,highlightItemOnHover:j=!1,tag:M="div",..._}=$,w=u4(),{props:T,highlightedIndex:b,onHighlightedIndexChange:C,elementsRef:k,onMapChange:S,relayKeyboardEvent:R}=No({grid:K,loopFocus:F,onLoop:W,orientation:Y,highlightedIndex:G,onHighlightedIndexChange:U,rootRef:A,stopEventPropagation:D,enableHomeAndEndKeys:q,direction:w,disabledIndices:V,modifierKeys:L}),O=G0(M,$,{state:X,ref:B,props:[T,...Q,_],stateAttributesMapping:z}),y=Do.useMemo(()=>({highlightedIndex:b,onHighlightedIndexChange:C,highlightItemOnHover:j,relayKeyboardEvent:R}),[b,C,j,R]);return a_.jsx(Ao.Provider,{value:y,children:a_.jsx(G7,{elementsRef:k,onMapChange:(I)=>{N?.(I),S(I)},children:O})})}var o_=P(c(),1),Lo=N9.forwardRef(function(Z,J){let{activateOnFocus:H=!1,className:B,loopFocus:Q=!0,render:X,style:z,...G}=Z,{orientation:U,setTabMap:Y,tabActivationDirection:K}=E7(),[F,W]=N9.useState(0),[q,N]=N9.useState(null),D=N9.useRef(new Set),A=N9.useRef(new Set),V=N9.useRef(null);H0(()=>{if(typeof ResizeObserver>"u")return;let T=new ResizeObserver(()=>{D.current.forEach((b)=>{b()})});if(V.current=T,q)T.observe(q);return A.current.forEach((b)=>{T.observe(b)}),()=>{T.disconnect(),V.current=null}},[q]);let L=Y0((T)=>{return D.current.add(T),()=>{D.current.delete(T)}}),j=Y0((T)=>{return A.current.add(T),V.current?.observe(T),()=>{A.current.delete(T),V.current?.unobserve(T)}}),M={orientation:U,tabActivationDirection:K},_={"aria-orientation":U==="vertical"?"vertical":void 0,role:"tablist"},w=N9.useMemo(()=>({activateOnFocus:H,registerIndicatorUpdateListener:L,registerTabResizeObserverElement:j,tabsListElement:q}),[H,L,j,q]);return o_.jsx(r_.Provider,{value:w,children:o_.jsx(Vo,{render:X,className:B,style:z,state:M,refs:[J,N],props:[_,G],stateAttributesMapping:F3,highlightedIndex:F,enableHomeAndEndKeys:!0,loopFocus:Q,orientation:U,onHighlightedIndexChange:W,onMapChange:Y,disabledIndices:s2})})});var yX=P(c(),1);function Mo({className:$,orientation:Z="horizontal",...J}){return yX.jsx(zZ.Root,{"data-slot":"tabs","data-orientation":Z,orientation:Z,className:o0("group/tabs flex gap-2 data-horizontal:flex-col",$),...J})}var bF0=GJ("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-accent",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function Po({className:$,variant:Z="default",...J}){return yX.jsx(zZ.List,{"data-slot":"tabs-list","data-variant":Z,className:o0(bF0({variant:Z}),$),...J})}function hq({className:$,...Z}){return yX.jsx(zZ.Tab,{"data-slot":"tabs-trigger",className:o0("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-muted-foreground transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background data-active:text-foreground data-active:ring-1 data-active:ring-border","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",$),...Z})}function vq({className:$,...Z}){return yX.jsx(zZ.Panel,{"data-slot":"tabs-content",className:o0("flex-1 text-sm outline-none",$),...Z})}var _o=["\uD83D\uDE80","✨","\uD83D\uDD25","⚡","\uD83D\uDCA1","\uD83E\uDDE0","\uD83E\uDD16","\uD83E\uDE84","\uD83E\uDDEA","⚙️","\uD83D\uDEE0️","\uD83D\uDCBB","\uD83D\uDCE6","\uD83D\uDCCA","\uD83D\uDCC8","\uD83D\uDCDD","\uD83D\uDCDA","\uD83C\uDFAF","\uD83C\uDFC6","\uD83D\uDC8E","\uD83E\uDE90","\uD83C\uDF0D","\uD83E\uDDED","\uD83C\uDFA8","\uD83C\uDFAE","☕"],n_="font-[Apple_Color_Emoji,Segoe_UI_Emoji,Noto_Color_Emoji,sans-serif]";var A1=P(c(),1),wF0=32,jo=4,SF0=12,wo="flex pt-4 pb-2 items-center bg-background px-3 text-xs font-medium text-muted-foreground",So=I4.createContext(null);function Oo($,Z){if(Z)return{...$,background:"theme"};if($.type==="emoji")return{type:"emoji",value:$.value};return{type:"glyph",value:$.value}}function RF0({category:$,className:Z,...J}){return A1.jsx("div",{...J,className:X0(wo,Z),children:$.label})}function To({className:$,...Z}){return A1.jsx("div",{className:X0("flex flex-wrap content-start gap-1",$),...Z})}function s_({className:$,selected:Z=!1,...J}){return A1.jsx(P0,{type:"button",variant:"ghost",size:"icon","aria-pressed":Z,className:X0("shrink-0 data-active:bg-accent",Z&&"bg-accent",$),...J})}function kF0({children:$,className:Z,...J}){return A1.jsx("div",{...J,className:X0("flex h-8 gap-1 px-1.5",Z),children:$})}function IF0({emoji:$,...Z}){let J=I4.useContext(So);return A1.jsx(s_,{selected:J===$.emoji,className:n_,...Z,children:A1.jsx("span",{className:"text-xl leading-none",children:$.emoji})})}function Ro(){let{layout:$,workspaceId:Z}=m1(),{icon:J}=$,H=kr(Z),[B,Q]=I4.useState(J?.type??"glyph"),[X,z]=I4.useState(!J||J.type!=="upload"&&J.background==="theme"),G=J?.type==="upload"?void 0:J,[U,Y]=I4.useState(""),[K,F]=I4.useState(13),[W,q]=I4.useState(null),[N,D]=I4.useState(!1),A=I4.useRef(null),V=(M)=>{let _=Oo(M,X);H.mutate({kind:"set",icon:_})},L=(M)=>{H.mutate({kind:"upload",file:M})},j=(M)=>{if(z(M),G){let _=Oo(G,M);H.mutate({kind:"set",icon:_})}};return I4.useEffect(()=>{if(!W)return;let M=(w)=>{let T=Math.max(1,Math.floor((w-SF0+jo)/(wF0+jo)));F((b)=>b===T?b:T)};M(W.clientWidth);let _=new ResizeObserver(([w])=>{M(w?.contentRect.width??W.clientWidth)});return _.observe(W),()=>_.disconnect()},[W]),A1.jsxs(Mo,{value:B,onValueChange:(M)=>Q(M),className:"min-w-0 gap-4",children:[A1.jsxs("div",{className:"flex items-center justify-between gap-4",children:[A1.jsxs(Po,{"aria-label":"Icon source",children:[A1.jsx(hq,{value:"glyph",children:"Icon"}),A1.jsx(hq,{value:"emoji",children:"Emoji"}),A1.jsx(hq,{value:"upload",children:"Upload"})]}),J&&A1.jsxs(P0,{type:"button",variant:"ghost",onClick:()=>{z(!0),H.mutate({kind:"reset"})},className:"text-muted-foreground",children:[A1.jsx(Co,{"data-icon":"inline-start",stroke:1.5}),"Reset"]})]}),A1.jsx(vq,{value:"emoji",className:"flex-none",children:A1.jsx(So,{value:G?.type==="emoji"?G.value:null,children:A1.jsxs(l3.Root,{onEmojiSelect:(M)=>V({type:"emoji",value:M.emoji}),emojibaseUrl:"/vendor/emojibase",columns:K,className:"isolate flex h-72 flex-col overflow-hidden rounded-xl border border-border bg-background",children:[A1.jsxs("div",{className:"flex items-center gap-1.5 p-1.5 pb-0",children:[A1.jsx(l3.Search,{placeholder:"Search emoji",onChange:(M)=>Y(M.target.value),className:"h-8 min-w-0 flex-1 appearance-none rounded-md bg-muted px-2.5 text-sm outline-none placeholder:text-muted-foreground"}),A1.jsx(l3.SkinToneSelector,{className:"size-8 shrink-0 rounded-lg text-lg hover:bg-accent"})]}),A1.jsxs(l3.Viewport,{ref:q,className:"relative scrollbar-thin flex-1 overflow-y-auto outline-none",children:[A1.jsxs(l3.Loading,{className:"absolute inset-0 flex items-center justify-center gap-2 text-xs text-muted-foreground",children:[A1.jsx(x5,{size:16,stroke:1.75,className:"animate-spin"}),"Loading emoji…"]}),U.trim()===""&&A1.jsxs("div",{className:"border-b border-dashed border-border",children:[A1.jsx("p",{className:X0("sticky top-0",wo),children:"Favorites"}),A1.jsx(To,{className:"px-1.5 pb-1.5",children:_o.map((M)=>A1.jsx(s_,{onClick:()=>V({type:"emoji",value:M}),selected:G?.type==="emoji"&&G.value===M,className:n_,children:A1.jsx("span",{className:"text-xl leading-none",children:M})},M))})]}),A1.jsxs(l3.Empty,{className:"absolute inset-0 flex flex-col items-center justify-center gap-1 text-xs text-muted-foreground",children:[A1.jsx(Eo,{size:20,stroke:1.5}),"No emoji found"]}),A1.jsx(l3.List,{className:"select-none",components:{CategoryHeader:RF0,Row:kF0,Emoji:IF0}})]})]})})}),A1.jsx(vq,{value:"glyph",className:"scrollbar-thin h-72 overflow-y-auto rounded-xl border border-border bg-background p-1.5",children:A1.jsx(To,{children:ok.map(({id:M,Icon:_})=>A1.jsx(s_,{"aria-label":M,onClick:()=>V({type:"glyph",value:M}),selected:G?.type==="glyph"&&G.value===M,className:"text-muted-foreground aria-pressed:text-accent-foreground",children:A1.jsx(_,{stroke:1.75})},M))})}),A1.jsx(vq,{value:"upload",className:"flex-none",children:A1.jsxs("button",{type:"button",onClick:()=>A.current?.click(),onDragOver:(M)=>{M.preventDefault(),D(!0)},onDragLeave:()=>D(!1),onDrop:(M)=>{M.preventDefault(),D(!1);let _=M.dataTransfer.files?.[0];if(_)L(_)},className:X0("flex h-72 w-full flex-col items-center justify-center gap-2 rounded-xl border border-dashed transition-colors",N?"border-primary bg-primary/5 text-primary":"border-border text-muted-foreground hover:border-muted-foreground/30 hover:text-foreground"),children:[A1.jsx(bo,{size:24,stroke:1.5}),A1.jsx("span",{className:"text-xs font-medium",children:"Click or drop an image"}),A1.jsx("span",{className:"text-[11px] text-muted-foreground/70",children:"PNG, JPG, GIF, or WebP"})]})}),B!=="upload"&&A1.jsxs("label",{htmlFor:"workspace-icon-theme-background",className:"flex w-fit cursor-pointer items-center gap-2 text-sm font-medium",children:[A1.jsx(sa,{id:"workspace-icon-theme-background",checked:X,onCheckedChange:j}),"Use theme background"]}),H.error&&A1.jsx("p",{className:"text-xs text-destructive","aria-live":"polite",children:H.error.message}),A1.jsx("input",{ref:A,type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",className:"hidden",onChange:(M)=>{let _=M.target.files?.[0];if(_)L(_);M.target.value=""}})]})}var W3=P(c(),1);function ko(){let{layout:$,name:Z,provider:J,workspaceId:H}=m1(),B=Z??"Workspace",Q=Rr(H),[X,z]=gq.useState(B);gq.useEffect(()=>z(B),[B]);function G(U){let Y=U.trim();if(z(Y),Y!==B)Q.mutate(Y===""?null:Y)}return W3.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-4",children:[W3.jsxs(P6,{children:[W3.jsx(_6,{render:W3.jsx("button",{type:"button","aria-label":"Change workspace icon",className:"group inline-flex size-10 shrink-0 cursor-pointer items-center justify-center rounded-lg p-0 outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:W3.jsx(n6,{icon:$.icon,workspaceType:J,workspaceTheme:$.theme,className:"size-full rounded-lg"})})}),W3.jsx(j6,{align:"start",sideOffset:8,className:"w-[min(32rem,calc(100vw-2rem))] gap-4 rounded-2xl p-6",children:W3.jsx(Ro,{})})]}),W3.jsx(Dq,{"aria-label":"Workspace name",value:X,onValueChange:z,onValueCommit:G,className:"min-w-0 truncate text-3xl font-semibold md:text-3xl"})]})}var cX=P(m(),1);function w7($){let{margin:Z,containerPadding:J,containerWidth:H,cols:B}=$;return(H-Z[0]*(B-1)-J[0]*2)/B}function A9($,Z,J){if(!Number.isFinite($))return $;return Math.round(Z*$+Math.max(0,$-1)*J)}function hX($,Z,J,H,B,Q,X){let{margin:z,containerPadding:G,rowHeight:U}=$,Y=w7($),K,F,W,q;if(X)K=Math.round(X.width),F=Math.round(X.height);else K=A9(H,Y,z[0]),F=A9(B,U,z[1]);if(Q)W=Math.round(Q.top),q=Math.round(Q.left);else if(X)W=Math.round(X.top),q=Math.round(X.left);else W=Math.round((U+z[1])*J+G[1]),q=Math.round((Y+z[0])*Z+G[0]);if(!Q&&!X){if(Number.isFinite(H)){let D=Math.round((Y+z[0])*(Z+H)+G[0])-q-K;if(D!==z[0])K+=D-z[0]}if(Number.isFinite(B)){let D=Math.round((U+z[1])*(J+B)+G[1])-W-F;if(D!==z[1])F+=D-z[1]}}return{top:W,left:q,width:K,height:F}}function yo($,Z,J,H,B){let{margin:Q,containerPadding:X,cols:z,rowHeight:G,maxRows:U}=$,Y=w7($),K=Math.round((J-X[0])/(Y+Q[0])),F=Math.round((Z-X[1])/(G+Q[1]));return K=xX(K,0,z-H),F=xX(F,0,U-B),{x:K,y:F}}function vX($,Z,J){let{margin:H,containerPadding:B,rowHeight:Q}=$,X=w7($),z=Math.round((J-B[0])/(X+H[0])),G=Math.round((Z-B[1])/(Q+H[1]));return{x:z,y:G}}function xo($,Z,J){let{margin:H,rowHeight:B}=$,Q=w7($),X=Math.max(1,Math.round((Z+H[0])/(Q+H[0]))),z=Math.max(1,Math.round((J+H[1])/(B+H[1])));return{w:X,h:z}}function xX($,Z,J){return Math.max(Math.min($,J),Z)}function mq($,Z){if($.i===Z.i)return!1;if($.x+$.w<=Z.x)return!1;if($.x>=Z.x+Z.w)return!1;if($.y+$.h<=Z.y)return!1;if($.y>=Z.y+Z.h)return!1;return!0}function S7($,Z){for(let J=0;J<$.length;J++){let H=$[J];if(H!==void 0&&mq(H,Z))return H}return}function t_($,Z){return $.filter((J)=>mq(J,Z))}function yF0($,Z){if(Z==="horizontal")return e_($);if(Z==="vertical")return fq($);if(Z==="wrap")return fq($);return[...$]}function fq($){return[...$].sort((Z,J)=>{if(Z.y!==J.y)return Z.y-J.y;return Z.x-J.x})}function e_($){return[...$].sort((Z,J)=>{if(Z.x!==J.x)return Z.x-J.x;return Z.y-J.y})}function gX($){let Z=0;for(let J=0;J<$.length;J++){let H=$[J];if(H!==void 0){let B=H.y+H.h;if(B>Z)Z=B}}return Z}function R7($,Z){for(let J=0;J<$.length;J++){let H=$[J];if(H!==void 0&&H.i===Z)return H}return}function fX($){return $.filter((Z)=>Z.static===!0)}function r3($){return{i:$.i,x:$.x,y:$.y,w:$.w,h:$.h,minW:$.minW,maxW:$.maxW,minH:$.minH,maxH:$.maxH,moved:Boolean($.moved),static:Boolean($.static),isDraggable:$.isDraggable,isResizable:$.isResizable,resizeHandles:$.resizeHandles,constraints:$.constraints,isBounded:$.isBounded}}function xH($){let Z=Array($.length);for(let J=0;J<$.length;J++){let H=$[J];if(H!==void 0)Z[J]=r3(H)}return Z}function xF0($,Z){let J=Array($.length);for(let H=0;H<$.length;H++){let B=$[H];if(B!==void 0)if(Z.i===B.i)J[H]=Z;else J[H]=B}return J}function ho($,Z,J){let H=R7($,Z);if(!H)return[[...$],null];return H=J(r3(H)),[xF0($,H),H]}function $j($,Z){let J=fX($);for(let H=0;H<$.length;H++){let B=$[H];if(B===void 0)continue;if(B.x+B.w>Z.cols)B.x=Z.cols-B.w;if(B.x<0)B.x=0,B.w=Z.cols;if(!B.static)J.push(B);else while(S7(J,B))B.y++}return $}function b7($,Z,J,H,B,Q,X,z,G){if(Z.static&&Z.isDraggable!==!0)return[...$];if(Z.y===H&&Z.x===J)return[...$];let{x:U,y:Y}=Z;if(typeof J==="number")Z.x=J;if(typeof H==="number")Z.y=H;Z.moved=!0;let K=yF0($,X);if(X==="vertical"&&typeof H==="number"?Y>=H:X==="horizontal"&&typeof J==="number"?U>=J:!1)K=K.reverse();let W=t_(K,Z),q=W.length>0;if(q&&G)return xH($);if(q&&Q)return Z.x=U,Z.y=Y,Z.moved=!1,$;let N=[...$];for(let D=0;D<W.length;D++){let A=W[D];if(A===void 0)continue;if(A.moved)continue;if(A.static)N=Io(N,A,Z,B,X);else N=Io(N,Z,A,B,X)}return N}function Io($,Z,J,H,B,Q){let X=B==="horizontal",z=B==="vertical",G=Z.static;if(H){H=!1;let K={x:X?Math.max(Z.x-J.w,0):J.x,y:z?Math.max(Z.y-J.h,0):J.y,w:J.w,h:J.h,i:"-1"},F=S7($,K),W=F!==void 0&&F.y+F.h>Z.y,q=F!==void 0&&Z.x+Z.w>F.x;if(!F)return b7($,J,X?K.x:void 0,z?K.y:void 0,H,G,B);if(W&&z)return b7($,J,void 0,J.y+1,H,G,B);if(W&&B===null)return Z.y=J.y,J.y=J.y+J.h,[...$];if(q&&X)return b7($,Z,J.x,void 0,H,G,B)}let U=X?J.x+1:void 0,Y=z?J.y+1:void 0;if(U===void 0&&Y===void 0)return[...$];return b7($,J,U,Y,H,G,B)}function hH($,Z,J){return Math.max(Z,Math.min(J,$))}var hF0={name:"gridBounds",constrainPosition($,Z,J,{cols:H,maxRows:B}){return{x:hH(Z,0,Math.max(0,H-$.w)),y:hH(J,0,Math.max(0,B-$.h))}},constrainSize($,Z,J,H,{cols:B,maxRows:Q}){let X=H==="w"||H==="nw"||H==="sw"?$.x+$.w:B-$.x,z=H==="n"||H==="nw"||H==="ne"?$.y+$.h:Q-$.y;return{w:hH(Z,1,Math.max(1,X)),h:hH(J,1,Math.max(1,z))}}},vF0={name:"minMaxSize",constrainSize($,Z,J){return{w:hH(Z,$.minW??1,$.maxW??1/0),h:hH(J,$.minH??1,$.maxH??1/0)}}};var Zj=[hF0,vF0];function mX($,Z,J,H,B){let Q={x:J,y:H};for(let X of $)if(X.constrainPosition)Q=X.constrainPosition(Z,Q.x,Q.y,B);if(Z.constraints){for(let X of Z.constraints)if(X.constrainPosition)Q=X.constrainPosition(Z,Q.x,Q.y,B)}return Q}function vo($,Z,J,H,B,Q){let X={w:J,h:H};for(let z of $)if(z.constrainSize)X=z.constrainSize(Z,X.w,X.h,B,Q);if(Z.constraints){for(let z of Z.constraints)if(z.constrainSize)X=z.constrainSize(Z,X.w,X.h,B,Q)}return X}function pq({top:$,left:Z,width:J,height:H}){let B=`translate(${Z}px,${$}px)`;return{transform:B,WebkitTransform:B,MozTransform:B,msTransform:B,OTransform:B,width:`${J}px`,height:`${H}px`,position:"absolute"}}function Jj({top:$,left:Z,width:J,height:H}){return{top:`${$}px`,left:`${Z}px`,width:`${J}px`,height:`${H}px`,position:"absolute"}}function Hj($){return $*100+"%"}function gF0($,Z,J,H){return $+J>H?Z:J}function go($,Z,J){return $<0?Z:J}function fF0($){return Math.max(0,$)}function uq($){return Math.max(0,$)}var Bj=($,Z,J)=>{let{left:H,height:B,width:Q}=Z,X=$.top-(B-$.height);return{left:H,width:Q,height:go(X,$.height,B),top:uq(X)}},Qj=($,Z,J)=>{let{top:H,left:B,height:Q,width:X}=Z;return{top:H,height:Q,width:gF0($.left,$.width,X,J),left:fF0(B)}},Xj=($,Z,J)=>{let{top:H,height:B,width:Q}=Z,X=$.left+$.width-Q;if(X<0)return{height:B,width:$.left+$.width,top:uq(H),left:0};return{height:B,width:Q,top:uq(H),left:X}},zj=($,Z,J)=>{let{top:H,left:B,height:Q,width:X}=Z;return{width:X,left:B,height:go(H,$.height,Q),top:uq(H)}},mF0=($,Z,J)=>Bj($,Qj($,Z,J)),uF0=($,Z,J)=>Bj($,Xj($,Z)),pF0=($,Z,J)=>zj($,Qj($,Z,J)),cF0=($,Z,J)=>zj($,Xj($,Z)),dF0={n:Bj,ne:mF0,e:Qj,se:pF0,s:zj,sw:cF0,w:Xj,nw:uF0};function fo($,Z,J,H){let B=dF0[$];if(!B)return J;return B(Z,{...Z,...J},H)}var lF0={type:"transform",scale:1,calcStyle($){return pq($)}};var mo=lF0,uo={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},po={enabled:!0,bounded:!1,threshold:3},co={enabled:!0,handles:["se"]},lo={enabled:!1,defaultItem:{w:1,h:1}};function Gj($,Z,J,H,B){let Q=H==="x"?"w":"h";Z[H]+=1;let X=$.findIndex((G)=>G.i===Z.i),z=B??fX($).length>0;for(let G=X+1;G<$.length;G++){let U=$[G];if(U===void 0)continue;if(U.static)continue;if(!z&&U.y>Z.y+Z.h)break;if(mq(Z,U))Gj($,U,J+Z[Q],H,z)}Z[H]=J}function iF0($,Z,J,H){Z.x=Math.max(Z.x,0),Z.y=Math.max(Z.y,0),Z.y=Math.min(H,Z.y);while(Z.y>0&&!S7($,Z))Z.y--;let B;while((B=S7($,Z))!==void 0)Gj(J,Z,B.y+B.h,"y");return Z.y=Math.max(Z.y,0),Z}function rF0($,Z,J,H){Z.x=Math.max(Z.x,0),Z.y=Math.max(Z.y,0);while(Z.x>0&&!S7($,Z))Z.x--;let B;while((B=S7($,Z))!==void 0)if(Gj(H,Z,B.x+B.w,"x"),Z.x+Z.w>J){Z.x=J-Z.w,Z.y++;while(Z.x>0&&!S7($,Z))Z.x--}return Z.x=Math.max(Z.x,0),Z}var uX={type:"vertical",allowOverlap:!1,compact($,Z){let J=fX($),H=gX(J),B=fq($),Q=Array($.length);for(let X=0;X<B.length;X++){let z=B[X];if(z===void 0)continue;let G=r3(z);if(!G.static)G=iF0(J,G,B,H),H=Math.max(H,G.y+G.h),J.push(G);let U=$.indexOf(z);Q[U]=G,G.moved=!1}return Q}},Uj={type:"horizontal",allowOverlap:!1,compact($,Z){let J=fX($),H=e_($),B=Array($.length);for(let Q=0;Q<H.length;Q++){let X=H[Q];if(X===void 0)continue;let z=r3(X);if(!z.static)z=rF0(J,z,Z,H),J.push(z);let G=$.indexOf(X);B[G]=z,z.moved=!1}return B}},Yj={type:null,allowOverlap:!1,compact($,Z){return xH($)}},aF0={...uX,allowOverlap:!0,compact($,Z){return xH($)}},oF0={...Uj,allowOverlap:!0,compact($,Z){return xH($)}},nF0={...Yj,allowOverlap:!0};function Kj($,Z=!1,J=!1){let H;if(Z)if($==="vertical")H=aF0;else if($==="horizontal")H=oF0;else H=nF0;else if($==="vertical")H=uX;else if($==="horizontal")H=Uj;else H=Yj;if(J)return{...H,preventCollision:J};return H}var D9=P(m(),1);function sF0($){let Z=typeof globalThis.getComputedStyle==="function"?globalThis.getComputedStyle($):null;if(!Z)return $.clientWidth;let J=(B)=>{let Q=Number.parseFloat(B);return Number.isFinite(Q)?Q:0},H=Number.parseFloat(Z.width);if(Number.isFinite(H))return Math.max(0,H);return Math.max(0,$.clientWidth-J(Z.paddingLeft)-J(Z.paddingRight))}function Fj($={}){let{measureBeforeMount:Z=!1,initialWidth:J=1280}=$,[H,B]=D9.useState(J),[Q,X]=D9.useState(!Z),z=D9.useRef(null),G=D9.useRef(null),U=D9.useCallback(()=>{let Y=z.current;if(Y){let K=Math.round(sF0(Y));if(B((F)=>F===K?F:K),!Q)X(!0)}},[Q]);return D9.useEffect(()=>{let Y=z.current;if(!Y)return;if(U(),typeof ResizeObserver<"u"){let K=null;return G.current=new ResizeObserver((F)=>{let W=F[0];if(W){let q=Math.round(W.contentRect.width);if(K!==null)cancelAnimationFrame(K);K=requestAnimationFrame(()=>{B((N)=>N===q?N:q),K=null})}}),G.current.observe(Y),()=>{if(K!==null)cancelAnimationFrame(K);if(G.current)G.current.disconnect(),G.current=null}}return()=>{if(G.current)G.current.disconnect(),G.current=null}},[U]),{width:H,mounted:Q,containerRef:z,measureWidth:U}}var v0=P(m(),1),no=P(iW(),1),so=P(w_(),1);var o3=P(c(),1),GZ=P(ro(),1);function Wj($){let{children:Z,cols:J,containerWidth:H,margin:B,containerPadding:Q,rowHeight:X,maxRows:z,isDraggable:G,isResizable:U,isBounded:Y,static:K,useCSSTransforms:F=!0,usePercentages:W=!1,transformScale:q=1,positionStrategy:N,dragThreshold:D=0,droppingPosition:A,className:V="",style:L,handle:j="",cancel:M="",x:_,y:w,w:T,h:b,minW:C=1,maxW:k=1/0,minH:S=1,maxH:R=1/0,i:O,resizeHandles:y,resizeHandle:I,constraints:x=Zj,layoutItem:v,layout:g=[],onDragStart:E,onDrag:l,onDragStop:r,onResizeStart:h,onResize:d,onResizeStop:o}=$,[p,i]=v0.useState(!1),[n,Z0]=v0.useState(!1),J0=v0.useRef(null),U0=v0.useRef({left:0,top:0}),z0=v0.useRef({top:0,left:0,width:0,height:0}),B0=v0.useRef(void 0),N0=v0.useRef(g);N0.current=g;let D0=v0.useRef(null),F0=v0.useRef(null),s=v0.useRef(!1),a=v0.useRef({x:0,y:0}),e=v0.useRef(!1),$0=v0.useMemo(()=>({cols:J,containerPadding:Q,containerWidth:H,margin:B,maxRows:z,rowHeight:X}),[J,Q,H,B,z,X]),Q0=v0.useMemo(()=>({cols:J,maxRows:z,containerWidth:H,containerHeight:0,rowHeight:X,margin:B,layout:[]}),[J,z,H,X,B]),_0=v0.useCallback(()=>({...Q0,layout:N0.current}),[Q0]),M0=v0.useMemo(()=>v??{i:O,x:_,y:w,w:T,h:b,minW:C,maxW:k,minH:S,maxH:R},[v,O,_,w,T,b,C,k,S,R]),A0=v0.useCallback((C0)=>{if(N?.calcStyle)return N.calcStyle(C0);if(F)return pq(C0);let x0=Jj(C0);if(W)return{...x0,left:Hj(C0.left/H),width:Hj(C0.width/H)};return x0},[N,F,W,H]),L0=v0.useCallback((C0,{node:x0})=>{if(!E)return;let{offsetParent:r0}=x0;if(!r0)return;let n0=r0.getBoundingClientRect(),D1=x0.getBoundingClientRect(),V1=D1.left/q,p1=n0.left/q,e1=D1.top/q,m0=n0.top/q,q0;if(N?.calcDragPosition){let i0=C0;q0=N.calcDragPosition(i0.clientX,i0.clientY,i0.clientX-D1.left,i0.clientY-D1.top)}else q0={left:V1-p1+r0.scrollLeft,top:e1-m0+r0.scrollTop};if(U0.current=q0,D>0){let i0=C0;a.current={x:i0.clientX,y:i0.clientY},s.current=!0,e.current=!1,i(!0);return}i(!0);let h0=vX($0,q0.top,q0.left),{x:U1,y:k0}=mX(x,M0,h0.x,h0.y,_0());E(O,U1,k0,{e:C0,node:x0,newPosition:q0})},[E,q,$0,N,D,x,M0,_0,O]),f=v0.useCallback((C0,{node:x0,deltaX:r0,deltaY:n0})=>{if(!l||!p)return;let D1=C0;if(s.current&&!e.current){let U1=D1.clientX-a.current.x,k0=D1.clientY-a.current.y;if(Math.hypot(U1,k0)<D)return;if(e.current=!0,s.current=!1,E){let l0=vX($0,U0.current.top,U0.current.left),{x:L1,y:T1}=mX(x,M0,l0.x,l0.y,_0());E(O,L1,T1,{e:C0,node:x0,newPosition:U0.current})}}let V1=U0.current.top+n0,p1=U0.current.left+r0;if(Y){let{offsetParent:U1}=x0;if(U1){let k0=U1.clientHeight-A9(b,X,B[1]);V1=xX(V1,0,k0);let i0=w7($0),l0=H-A9(T,i0,B[0]);p1=xX(p1,0,l0)}}let e1={top:V1,left:p1};U0.current=e1;let m0=vX($0,V1,p1),{x:q0,y:h0}=mX(x,M0,m0.x,m0.y,_0());l(O,q0,h0,{e:C0,node:x0,newPosition:e1})},[l,E,p,D,Y,b,X,B,$0,H,T,O,x,M0,_0]),u=v0.useCallback((C0,{node:x0})=>{if(!r||!p)return;let r0=s.current;if(s.current=!1,e.current=!1,a.current={x:0,y:0},r0){i(!1),U0.current={left:0,top:0};return}let{left:n0,top:D1}=U0.current,V1={top:D1,left:n0};i(!1),U0.current={left:0,top:0};let p1=vX($0,D1,n0),{x:e1,y:m0}=mX(x,M0,p1.x,p1.y,_0());r(O,e1,m0,{e:C0,node:x0,newPosition:V1})},[r,p,$0,x,M0,_0,O]);D0.current=L0,F0.current=f;let t=v0.useCallback((C0,{node:x0,size:r0,handle:n0},D1,V1)=>{let p1=V1==="onResizeStart"?h:V1==="onResize"?d:o;if(!p1)return;let e1;if(x0)e1=fo(n0,D1,r0,H);else e1={...r0,top:D1.top,left:D1.left};z0.current=e1;let m0=xo($0,e1.width,e1.height),{w:q0,h:h0}=vo(x,M0,m0.w,m0.h,n0,_0());p1(O,q0,h0,{e:C0.nativeEvent??C0,node:x0,size:e1,handle:n0})},[h,d,o,H,$0,O,x,M0,_0]),W0=v0.useCallback((C0,x0)=>{Z0(!0);let r0=hX($0,_,w,T,b),n0={...x0,handle:x0.handle};t(C0,n0,r0,"onResizeStart")},[t,$0,_,w,T,b]),S0=v0.useCallback((C0,x0)=>{let r0=hX($0,_,w,T,b),n0={...x0,handle:x0.handle};t(C0,n0,r0,"onResize")},[t,$0,_,w,T,b]),p0=v0.useCallback((C0,x0)=>{Z0(!1),z0.current={top:0,left:0,width:0,height:0};let r0=hX($0,_,w,T,b),n0={...x0,handle:x0.handle};t(C0,n0,r0,"onResizeStop")},[t,$0,_,w,T,b]);v0.useEffect(()=>{if(!A)return;let C0=J0.current;if(!C0)return;let x0=B0.current||{left:0,top:0},r0=p&&(A.left!==x0.left||A.top!==x0.top);if(!p){let n0={node:C0,deltaX:A.left,deltaY:A.top,lastX:0,lastY:0,x:A.left,y:A.top};D0.current?.(A.e,n0)}else if(r0){let n0=A.left-U0.current.left,D1=A.top-U0.current.top,V1={node:C0,deltaX:n0,deltaY:D1,lastX:U0.current.left,lastY:U0.current.top,x:A.left,y:A.top};F0.current?.(A.e,V1)}B0.current=A},[A,p,O]);let g0=hX($0,_,w,T,b,p?U0.current:null,n?z0.current:null),T0=v0.default.Children.only(Z),d0=w7($0),Q1=[A9(C,d0,B[0]),A9(S,X,B[1])],e0=[A9(k,d0,B[0]),A9(R,X,B[1])],c0=T0.props,y0=c0.className,E1=c0.style,W1=v0.default.cloneElement(T0,{ref:J0,className:qj("react-grid-item",y0,V,{static:K,resizing:n,"react-draggable":G,"react-draggable-dragging":p,dropping:Boolean(A),cssTransforms:F}),style:{...L,...E1,...A0(g0)}}),Q5=I;return W1=o3.jsx(so.Resizable,{draggableOpts:{disabled:!U},className:U?void 0:"react-resizable-hide",width:g0.width,height:g0.height,minConstraints:Q1,maxConstraints:e0,onResizeStart:W0,onResize:S0,onResizeStop:p0,transformScale:q,resizeHandles:y,handle:Q5,children:W1}),W1=o3.jsx(no.DraggableCore,{disabled:!G,onStart:L0,onDrag:f,onStop:u,handle:j,cancel:".react-resizable-handle"+(M?","+M:""),scale:q,nodeRef:J0,children:W1}),W1}var a3=()=>{},ao="react-grid-layout",to=!1;try{to=/firefox/i.test(navigator.userAgent)}catch{}function ZW0($,Z){let J=v0.default.Children.toArray($),H=v0.default.Children.toArray(Z);if(J.length!==H.length)return!1;for(let B=0;B<J.length;B++){let Q=J[B],X=H[B];if(Q?.key!==X?.key)return!1}return!0}function oo($,Z,J,H){let B=[],Q=new Set;v0.default.Children.forEach(Z,(z)=>{if(!v0.default.isValidElement(z)||z.key===null)return;let G=String(z.key);Q.add(G);let U=$.find((Y)=>Y.i===G);if(U)B.push(r3(U));else{let K=z.props["data-grid"];if(K)B.push({i:G,x:K.x??0,y:K.y??0,w:K.w??1,h:K.h??1,minW:K.minW,maxW:K.maxW,minH:K.minH,maxH:K.maxH,static:K.static,isDraggable:K.isDraggable,isResizable:K.isResizable,resizeHandles:K.resizeHandles,isBounded:K.isBounded});else B.push({i:G,x:0,y:gX(B),w:1,h:1})}});let X=$j(B,{cols:J});return H.compact(X,J)}function pX($){let{children:Z,width:J,gridConfig:H,dragConfig:B,resizeConfig:Q,dropConfig:X,positionStrategy:z=mo,compactor:G,constraints:U=Zj,layout:Y=[],droppingItem:K,autoSize:F=!0,className:W="",style:q={},innerRef:N,onLayoutChange:D=a3,onDragStart:A=a3,onDrag:V=a3,onDragStop:L=a3,onResizeStart:j=a3,onResize:M=a3,onResizeStop:_=a3,onDrop:w=a3,onDropDragOver:T=a3}=$,b=v0.useMemo(()=>({...uo,...H}),[H]),C=v0.useMemo(()=>({...po,...B}),[B]),k=v0.useMemo(()=>({...co,...Q}),[Q]),S=v0.useMemo(()=>({...lo,...X}),[X]),{cols:R,rowHeight:O,maxRows:y,margin:I,containerPadding:x}=b,{enabled:v,bounded:g,handle:E,cancel:l,threshold:r}=C,{enabled:h,handles:d,handleComponent:o}=k,{enabled:p,defaultItem:i,onDragOver:n}=S,Z0=G??Kj("vertical"),J0=Z0.type,U0=Z0.allowOverlap,z0=Z0.preventCollision??!1,B0=v0.useMemo(()=>K??{i:"__dropping-elem__",...i},[K,i]),N0=z.type==="transform",D0=z.scale,F0=x??I,[s,a]=v0.useState(!1),[e,$0]=v0.useState(()=>oo(Y,Z,R,Z0)),[Q0,_0]=v0.useState(null),[M0,A0]=v0.useState(!1),[L0,f]=v0.useState(null),[u,t]=v0.useState(),W0=v0.useRef(null),S0=v0.useRef(null),p0=v0.useRef(null),g0=v0.useRef(0),T0=v0.useRef(e),d0=v0.useRef(Y),Q1=v0.useRef(Z),e0=v0.useRef(J0),c0=v0.useRef(e);c0.current=e,v0.useEffect(()=>{if(a(!0),!GZ.deepEqual(e,Y))D(e)},[]),v0.useEffect(()=>{if(Q0)return;if(L0)return;let k0=!GZ.deepEqual(Y,d0.current),i0=!ZW0(Z,Q1.current),l0=J0!==e0.current;if(k0||i0||l0){let T1=oo(k0?Y:e,Z,R,Z0);if(!GZ.deepEqual(T1,e))$0(T1)}d0.current=Y,Q1.current=Z,e0.current=J0},[Y,Z,R,J0,Z0,Q0,L0,e]),v0.useEffect(()=>{if(!Q0&&!GZ.deepEqual(e,T0.current)){T0.current=e;let k0=e.filter((i0)=>i0.i!==B0.i);D(k0)}},[e,Q0,D,B0.i]);let y0=v0.useMemo(()=>{if(!F)return;let k0=gX(e),i0=F0[1];return k0*O+(k0-1)*I[1]+i0*2+"px"},[F,e,O,I,F0]),E1=v0.useCallback((k0,i0,l0,L1)=>{let T1=c0.current,c1=R7(T1,k0);if(!c1)return;let g5={w:c1.w,h:c1.h,x:c1.x,y:c1.y,i:k0};W0.current=r3(c1),p0.current=T1,_0(g5),A(T1,c1,c1,null,L1.e,L1.node)},[A]),W1=v0.useCallback((k0,i0,l0,L1)=>{let T1=c0.current,c1=W0.current,g5=R7(T1,k0);if(!g5)return;let P2={w:g5.w,h:g5.h,x:g5.x,y:g5.y,i:k0},f5=b7(T1,g5,i0,l0,!0,z0,J0,R,U0);V(f5,c1,g5,P2,L1.e,L1.node),$0(Z0.compact(f5,R)),_0(P2)},[z0,J0,R,U0,Z0,V]),Q5=v0.useCallback((k0,i0,l0,L1)=>{if(!Q0)return;let T1=c0.current,c1=W0.current,g5=R7(T1,k0);if(!g5)return;let P2=b7(T1,g5,i0,l0,!0,z0,J0,R,U0),f5=Z0.compact(P2,R);L(f5,c1,g5,null,L1.e,L1.node);let n2=p0.current;if(W0.current=null,p0.current=null,_0(null),$0(f5),n2&&!GZ.deepEqual(n2,f5))D(f5)},[Q0,z0,J0,R,U0,Z0,L,D]),C0=v0.useCallback((k0,i0,l0,L1)=>{let T1=c0.current,c1=R7(T1,k0);if(!c1)return;S0.current=r3(c1),p0.current=T1,A0(!0),j(T1,c1,c1,null,L1.e,L1.node)},[j]),x0=v0.useCallback((k0,i0,l0,L1)=>{let T1=c0.current,c1=S0.current,{handle:g5}=L1,P2=!1,f5,n2,[aX,D3]=ho(T1,k0,(u5)=>{if(f5=u5.x,n2=u5.y,["sw","w","nw","n","ne"].includes(g5)){if(["sw","nw","w"].includes(g5))f5=u5.x+(u5.w-i0),i0=u5.x!==f5&&f5<0?u5.w:i0,f5=f5<0?0:f5;if(["ne","n","nw"].includes(g5))n2=u5.y+(u5.h-l0),l0=u5.y!==n2&&n2<0?u5.h:l0,n2=n2<0?0:n2;P2=!0}if(z0&&!U0){if(t_(T1,{...u5,w:i0,h:l0,x:f5??u5.x,y:n2??u5.y}).filter((nX)=>nX.i!==u5.i).length>0)n2=u5.y,l0=u5.h,f5=u5.x,i0=u5.w,P2=!1}return u5.w=i0,u5.h=l0,u5});if(!D3)return;let lH=aX;if(P2&&f5!==void 0&&n2!==void 0)lH=b7(aX,D3,f5,n2,!0,z0,J0,R,U0);let oX={w:D3.w,h:D3.h,x:D3.x,y:D3.y,i:k0,static:!0};M(lH,c1,D3,oX,L1.e,L1.node),$0(Z0.compact(lH,R)),_0(oX)},[z0,J0,R,U0,Z0,M]),r0=v0.useCallback((k0,i0,l0,L1)=>{let T1=c0.current,c1=S0.current,g5=R7(T1,k0),P2=Z0.compact(T1,R);_(P2,c1,g5??null,null,L1.e,L1.node);let f5=p0.current;if(S0.current=null,p0.current=null,_0(null),A0(!1),$0(P2),f5&&!GZ.deepEqual(f5,P2))D(P2)},[R,Z0,_,D]),n0=v0.useCallback(()=>{let k0=c0.current;if(!k0.some((L1)=>L1.i===B0.i)){f(null),_0(null),t(void 0);return}let l0=Z0.compact(k0.filter((L1)=>L1.i!==B0.i),R);$0(l0),f(null),_0(null),t(void 0)},[B0.i,R,Z0]),D1=v0.useCallback((k0)=>{if(k0.preventDefault(),k0.stopPropagation(),to&&!k0.nativeEvent.target?.classList.contains(ao))return!1;let i0=n?n(k0.nativeEvent):T(k0);if(i0===!1){if(L0)n0();return!1}let{dragOffsetX:l0=0,dragOffsetY:L1=0,...T1}=i0??{},c1={...B0,...T1},g5=k0.currentTarget.getBoundingClientRect(),P2={cols:R,margin:I,maxRows:y,rowHeight:O,containerWidth:J,containerPadding:F0},f5=w7(P2),n2=A9(c1.w,f5,I[0]),aX=A9(c1.h,O,I[1]),D3=n2/2,lH=aX/2,oX=k0.clientX-g5.left+l0-D3,u5=k0.clientY-g5.top+L1-lH,XN=Math.max(0,oX),nX=Math.max(0,u5),sX={left:XN/D0,top:nX/D0,e:k0.nativeEvent};if(!L0){let zN=yo(P2,nX,XN,c1.w,c1.h);f(o3.jsx("div",{},c1.i)),t(sX);let os=c0.current.filter((ns)=>ns.i!==c1.i);$0([...os,{...c1,x:zN.x,y:zN.y,static:!1,isDraggable:!0}])}else if(u){if(u.left!==sX.left||u.top!==sX.top)t(sX)}},[L0,u,B0,n,T,n0,D0,R,I,y,O,J,F0]),V1=v0.useCallback((k0)=>{if(k0.preventDefault(),k0.stopPropagation(),g0.current--,g0.current<0)g0.current=0;if(g0.current===0)n0()},[n0]),p1=v0.useCallback((k0)=>{k0.preventDefault(),k0.stopPropagation(),g0.current++},[]),e1=v0.useCallback((k0)=>{k0.preventDefault(),k0.stopPropagation();let i0=c0.current,l0=i0.find((L1)=>L1.i===B0.i);g0.current=0,n0(),w(i0,l0,k0.nativeEvent)},[B0.i,n0,w]),m0=v0.useCallback((k0,i0)=>{if(!k0||!k0.key)return null;let l0=R7(e,String(k0.key));if(!l0)return null;let L1=typeof l0.isDraggable==="boolean"?l0.isDraggable:!l0.static&&v,T1=typeof l0.isResizable==="boolean"?l0.isResizable:!l0.static&&h,c1=l0.resizeHandles||[...d],g5=L1&&g&&l0.isBounded!==!1,P2=o;return o3.jsx(Wj,{containerWidth:J,cols:R,margin:I,containerPadding:F0,maxRows:y,rowHeight:O,cancel:l,handle:E,onDragStart:E1,onDrag:W1,onDragStop:Q5,onResizeStart:C0,onResize:x0,onResizeStop:r0,isDraggable:L1,isResizable:T1,isBounded:g5,useCSSTransforms:N0&&s,usePercentages:!s,transformScale:D0,positionStrategy:z,dragThreshold:r,w:l0.w,h:l0.h,x:l0.x,y:l0.y,i:l0.i,minH:l0.minH,minW:l0.minW,maxH:l0.maxH,maxW:l0.maxW,static:l0.static,droppingPosition:i0?u:void 0,resizeHandles:c1,resizeHandle:P2,constraints:U,layoutItem:l0,layout:e,children:k0},l0.i)},[e,J,R,I,F0,y,O,l,E,E1,W1,Q5,C0,x0,r0,v,h,g,N0,s,D0,z,r,u,d,o,U]),q0=()=>{if(!Q0)return null;return o3.jsx(Wj,{w:Q0.w,h:Q0.h,x:Q0.x,y:Q0.y,i:Q0.i,className:`react-grid-placeholder ${M0?"placeholder-resizing":""}`,containerWidth:J,cols:R,margin:I,containerPadding:F0,maxRows:y,rowHeight:O,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:N0,transformScale:D0,constraints:U,layout:e,children:o3.jsx("div",{})})},h0=qj(ao,W),U1={height:y0,...q};return o3.jsxs("div",{ref:N,className:h0,style:U1,onDrop:p?e1:void 0,onDragLeave:p?V1:void 0,onDragEnter:p?p1:void 0,onDragOver:p?D1:void 0,children:[v0.default.Children.map(Z,(k0)=>{if(!v0.default.isValidElement(k0))return null;return m0(k0)}),p&&L0&&m0(L0,!0),q0()]})}var V8=P(c(),1),Nj="moi:empty-state",eo={type:"spring",duration:0.35,bounce:0};function HW0({items:$,customizing:Z,emptyState:J,renderItem:H,onMove:B,onRemove:Q}){let[X,z]=cX.useState(()=>bX($)),[G,U]=cX.useState($),{width:Y,containerRef:K,mounted:F}=Fj({measureBeforeMount:!0});if(G!==$)U($),z((N)=>{let D=new Map(N.map((L)=>[L.i,L])),A=$.filter((L)=>D.has(L.id)).map((L)=>({...D.get(L.id),w:L.w,h:L.h})),V=new Set(A.map((L)=>L.i));return[...A,...bX($.filter((L)=>!V.has(L.id)),A)]});let W=J?[...X,{i:Nj,x:0,y:X.reduce((N,D)=>Math.max(N,D.y+D.h),0),w:4,h:2,static:!0}]:X,q=cX.useCallback((N)=>{let D=N.filter((A)=>A.i!==Nj);z(D),B?.(D.map((A)=>({id:A.i,x:A.x,y:A.y})))},[B]);return V8.jsx("div",{ref:K,className:"w-full",children:F&&V8.jsxs(pX,{width:Y,layout:W,gridConfig:{cols:4,rowHeight:160,margin:[8,8],containerPadding:[0,0]},dragConfig:{enabled:!!Z},resizeConfig:{enabled:!1},compactor:uX,onLayoutChange:q,children:[X.map((N)=>V8.jsx("div",{children:V8.jsx(K5.div,{layoutId:N.i,"data-applet-thumbnail":Z7("widgets",N.i),className:"size-full",transition:eo,children:V8.jsx(_q,{customizing:Z,widgetId:N.i,onRemove:Q?()=>Q(N.i):void 0,children:H(N.i)})})},N.i)),J&&V8.jsx("div",{children:V8.jsx(K5.div,{layout:!0,className:"size-full",transition:eo,children:J})},Nj)]})})}function $n({items:$,customizing:Z,header:J,emptyState:H,bottomInset:B=0,renderItem:Q,onMove:X,onRemove:z}){return V8.jsxs("div",{className:"size-full overflow-y-auto p-4",children:[V8.jsx("div",{className:"mx-auto h-32 w-full max-w-(--column-w)",children:J}),V8.jsx(K5.div,{className:"mx-auto flex min-h-0 w-full max-w-(--column-w) flex-col gap-2",animate:{marginBottom:B},transition:{type:"spring",duration:0.3,bounce:0},children:($.length>0||H)&&V8.jsx(HW0,{items:$,customizing:Z,emptyState:H,renderItem:Q,onMove:X,onRemove:z})})]})}var l1=P(c(),1);function BW0({onCreateWidget:$,showOnboarding:Z}){return l1.jsxs("div",{className:"relative grid size-full grid-cols-4 grid-rows-2 gap-2 overflow-hidden",children:[l1.jsx("div",{className:"col-span-2 overflow-hidden rounded-2xl bg-muted texture-checker squircle",children:l1.jsx("div",{className:"flex size-full items-start justify-start bg-radial-[at_top_left] from-muted from-40% to-transparent p-12",children:l1.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"Widgets"})})}),l1.jsx("div",{className:"col-span-2 overflow-hidden rounded-2xl bg-muted texture-checker squircle"}),l1.jsx("div",{className:"col-span-2 overflow-hidden rounded-2xl bg-muted texture-checker squircle"}),l1.jsx("div",{className:"col-span-2 overflow-hidden rounded-2xl bg-muted texture-checker squircle",children:Z&&l1.jsx("div",{className:"flex size-full items-end justify-end",children:l1.jsx("span",{className:"m-8 max-w-56 text-right text-sm text-muted-foreground",children:"Widgets can surface information, read data, and perform actions"})})}),l1.jsxs(P0,{type:"button",variant:"outline",className:X0("absolute inset-0 m-auto h-fit w-fit","flex-col gap-1 rounded-2xl border-0 py-4 pr-12 pl-12! text-xs shadow-sm transition-shadow duration-300 ease-out squircle hover:bg-background hover:shadow-lg [&_svg]:size-8"),onClick:$,children:[l1.jsx(d2,{"data-icon":"inline-start",stroke:1}),"New widget"]})]})}function Aj({Icon:$,label:Z,active:J,className:H,...B}){return l1.jsx(P0,{type:"button",variant:J?"default":"secondary",className:X0("relative h-16 w-24 rounded-lg px-4 py-0 text-xs [&_svg]:size-5",H),"aria-pressed":J,...B,children:l1.jsx(E4,{mode:"popLayout",initial:!1,children:l1.jsxs(K5.span,{className:"flex flex-col items-center gap-1.5",variants:{from:{opacity:0,filter:"blur(4px)"},to:{opacity:1,filter:"blur(0px)"}},initial:"from",animate:"to",exit:"from",transition:{type:"spring",duration:0.2,bounce:0},children:[J?l1.jsx(S8,{stroke:1.5}):l1.jsx($,{stroke:1.5}),l1.jsx("span",{children:J?"Done":Z})]},J?"done":"action")})})}function QW0({customizing:$,theming:Z,onCustomizingChange:J,onThemingChange:H}){return l1.jsxs("div",{className:"flex size-full items-center gap-4",children:[l1.jsx(ko,{}),l1.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[l1.jsx(Aj,{Icon:Zn,label:"Customize",active:$,onClick:()=>J(!$)}),l1.jsx(Aj,{Icon:dq,label:"Theme",active:Z,onClick:()=>H(!Z)}),l1.jsx(Aq,{children:l1.jsx(x3,{render:l1.jsx(Aj,{Icon:g6,label:"Settings"})})})]})]})}function XW0(){let[$,Z]=lq.useState(0);return[lq.useCallback((H)=>{if(!H)return;let B=new ResizeObserver(([Q])=>{let X=Q.borderBoxSize?.[0];Z(X?X.blockSize:Q.contentRect.height)});return B.observe(H),()=>B.disconnect()},[]),$]}function Jn({onCreateWidget:$,onCreateView:Z,onOpenView:J,customizing:H,theming:B,onThemingChange:Q,onCustomizingChange:X,widgets:z,views:G}){let{layout:U,setLayout:Y}=m1(),K=S1((b)=>b.hasSentMessageFromMoi),F=new Map(z.map((b)=>[b.id,b])),W=new Set(U.widgetGrid.map((b)=>b.i)),q=U.widgetGrid.filter((b)=>F.has(b.i)).map((b)=>{let C=F.get(b.i);return{id:b.i,w:C.config.colSpan,h:C.config.rowSpan,x:b.x,y:b.y}}),N=z.filter((b)=>!W.has(b.id)).map((b)=>({id:b.id,w:b.config.colSpan,h:b.config.rowSpan})),D=!H&&q.every((b)=>e9(b.id)),A=!K&&z.every((b)=>e9(b.id)),[V,L]=XW0(),j=H;eW({kind:"widget",enabled:!H,targets:q.filter((b)=>!e9(b.id)).map((b)=>({id:b.id,revision:F.get(b.id)?.revision}))});function M(b){let C=or(b,{views:G,onOpenView:J,onCreateView:Z,showOnboarding:A});if(C)return C;return l1.jsx(Za,{name:b})}function _(b){Y({widgetGrid:U.widgetGrid.filter((C)=>C.i!==b)})}function w(b){let C=F.get(b);if(!C)return;let k=U.widgetGrid.map((R)=>{let O=F.get(R.i);return{...R,w:O?.config.colSpan??1,h:O?.config.rowSpan??1}}),S=Lq(k,C.config.colSpan,C.config.rowSpan);Y({widgetGrid:[...U.widgetGrid,{i:b,x:S.x,y:S.y}]})}function T(b){Y({widgetGrid:tr(U.widgetGrid,b)})}return l1.jsx("div",{className:"relative min-h-0 flex-1 bg-background",children:l1.jsxs(qU,{children:[l1.jsx($n,{items:q,customizing:H,header:l1.jsx(QW0,{customizing:H,theming:B,onCustomizingChange:X,onThemingChange:Q}),emptyState:D?l1.jsx(BW0,{onCreateWidget:$,showOnboarding:A}):void 0,bottomInset:j?L:0,renderItem:M,onMove:T,onRemove:_}),l1.jsx(E4,{children:H&&l1.jsx(Ba,{ref:V,items:N,renderItem:M,onCreateWidget:$,onClose:()=>X(!1),onRestore:w})})]})})}var Bn=P(c(),1);function Hn({children:$}){return Bn.jsx("header",{className:X0("@container relative flex shrink-0 items-center gap-1 py-2 pr-3 pl-4","after:absolute after:top-full after:left-0 after:h-px after:w-full after:bg-border"),children:$})}var Qn=!0;var zW0=64;function Xn($,Z=[]){let J=zL($),H=J.attachments.map(GL);return(Vh(J.text).trim()||(H.length?H:Z).filter(Boolean).join(", ")).replace(/\s+/gu," ").trim().slice(0,zW0).trimEnd()}function iq($,Z,J={}){if("id"in $){let X={source:J.source,...$.kind==="image"?{purpose:J.purpose}:{}};return{attachment:{type:"upload",uploadId:$.id,...X},part:{type:"file-attachment",mediaType:$.mediaType,label:$.filename,...X,previewUrl:$.kind==="image"?Z:void 0}}}let{source:H,label:B,text:Q}=$;return{attachment:{type:"text",source:H,label:B,text:Q},part:Dh({type:"text",source:H,label:B,text:Q})}}function zn($){return{attachments:$.map((Z)=>Z.attachment),parts:$.map((Z)=>Z.part)}}async function Gn($,Z){let J=jK(Z);if(J)throw Error(J);return zn(await Promise.all(Z.map(async(H)=>{if(H.type==="text")return iq(H);let B=await RQ($,H.file??H.path);return iq(B,`/api/workspaces/${$}/uploads/${B.id}`,{source:H.source})})))}function Dj($){return zn($.flatMap((Z)=>{if(Z.kind==="text")return[iq(Z)];if(!Z.upload)return[];return[iq({...Z.upload,filename:Z.label,mediaType:Z.mediaType},Z.previewUrl,{source:Z.source,purpose:Z.kind==="drawing"?Z.purpose:void 0})]}))}function Vj($){return!$?.applet&&!$?.preparedAttachments}function rq($,Z,J){if(!Vj(J))return[];return(k1.getState().attachments[z8($,Z)]??[]).filter((B)=>B.kind==="text"||B.status==="ready"&&B.upload)}function GW0({queryClient:$,workspaceId:Z,sessionId:J,parts:H}){let B=`optimistic:${crypto.randomUUID()}`;return $.setQueryData(j0.events(Z,J),(Q)=>yG(Q??jB(),{kind:"turn",turn:{id:B,role:"user",origin:{kind:"user-input"},parts:H,timestamp:new Date().toISOString()}})),k1.getState().setActivity(Z,J,"running"),k1.getState().setError(Z,J,null),B}function aq({tabId:$,queryClient:Z,workspaceId:J,sessionId:H,text:B,filenames:Q=[]}){let X=Xn(B,Q);if(!X)return;Z.setQueryData(j0.sessions(J),(z)=>[{sessionId:H,summary:X,lastModified:Date.now(),...$?{tabId:$}:{}},...(z??[]).filter((G)=>G.sessionId!==H)])}function oq($,Z,J,H){let B=$?.models,Q=!Z||!B||B.some((K)=>K.value===Z)?Z:void 0,X=$?.provider==="codex"?cK($.models,Z):B?.find((K)=>K.value===(Q??"default")),z=$?.provider==="codex"&&X?X.resolvedModel??X.value:Q,G=J&&(!X||(X.supportedEffortLevels??[]).includes(J))?J:void 0,U=H===void 0||!X||X.supportsFastMode?H:!1,Y=Qn&&$?.supportsStreaming?!0:void 0;return{model:z,effort:G,...U!==void 0?{fastMode:U}:{},stream:Y}}function k7($,Z,J){k1.getState().renameSession($,Z,J),S1.getState().moveComposerDraft(b2($,Z),b2($,J))}function nq($,Z,J=Dj(Z)){let H=[...J.parts];if($.text)H.push({type:"text",text:$.text});return{attachments:J.attachments,optimisticId:GW0({...$,parts:H})}}function sq($,Z){for(let J of Z)k1.getState().removeAttachment($,J.localId);S1.getState().markMessageSentFromMoi($)}var Yn=P(m(),1);function Un($){if($.status==="available")return null;if($.status==="checking")return"The agent is still connecting";if($.status==="disconnected")return"This workspace is disconnected from moi";if($.status==="login-required")return"Sign in to the agent to send this message";return"The agent is unavailable in this workspace"}function UW0($,Z,J,H="shared"){let B=new Set,Q=!1,X=()=>{let G=Z.getQueryData(c2($,H)),U=Z.getQueryData(c2($));return ED(U,J().tabId,H==="browser-tab"?G:void 0)??null};async function z(G){if(Q)return;let U=(L)=>{r1.add({title:"Couldn’t send message",description:L,type:"error"}),X8($,{source:"runtime",message:`sendChatMessage() from ${G.applet.kind}:${G.applet.id}: ${L}`})},Y=Un(J().agentAvailability);if(Y){U(Y);return}let K=X(),F=J().tabId,W=!0,q,N=()=>{if(W=!1,A(),B.delete(D),q)r1.close(q)},D=()=>{if(!W)return;N(),r1.add({title:"Message canceled",description:"The active chat changed before attachments were ready",type:"info"})},A=Z.getQueryCache().subscribe(()=>{if(X()!==K||J().tabId!==F)D()});if(B.add(D),J().sessionId!==K){D();return}J().revealChat();let V;try{if(G.attachments.some((M)=>M.type==="file"))q=r1.add({title:"Preparing attachments…",type:"loading",timeout:0});if(V=await Gn($,G.attachments),!W)return;let L=J(),j=Un(L.agentAvailability);if(j)throw Error(j);if(L.sessionId!==K||L.tabId!==F){D();return}}catch(L){if(W)N(),U(L instanceof Error?L.message:"Couldn’t prepare the attachments");return}N();try{J().send(G.message,{applet:G.applet,preparedAttachments:V})}catch(L){U(L instanceof Error?L.message:"Something went wrong while sending this message")}}return{handle:z,dispose(){Q=!0;for(let G of B)G()}}}function Kn($){let Z=f1(),J=X1(),H=k3(),B=p2(),Q=W5({...$,tabId:H});Yn.useLayoutEffect(()=>{let X=UW0(Z,J,()=>Q.current,B?"browser-tab":"shared"),z=TK(Z).on("sendChatMessage",(G)=>{X.handle(G)});return()=>{z(),X.dispose()}},[Z,J,Q,H,B])}function Fn($,Z){let J=f1();CK(J,"addChatAttachment",(H)=>{Jv({workspaceId:J,sessionId:$},H),Z()})}var UZ=P(m(),1);var qn=P(m(),1);var Wn=new Map;function YW0($){let Z=Wn.get($)??[];return Wn.delete($),Z}function KW0($,Z=[]){return[...YW0($),...Z]}function FW0($,Z){if(!$.startsWith("views/"))return;return Object.keys(Z).length>0?Z:void 0}function WW0($,Z){if($.startsWith("views/"))return Z?.find((J)=>J.id===$.slice(6))?.title||void 0;return}function Nn({activeTab:$,appletParams:Z}){let J=f1(),H=Vq(J).data;return qn.useCallback((B={})=>{let Q=KW0(J,B.directives??[]),X=FW0($,Z);return{activeTab:{id:$,title:WW0($,H),...X?{params:X}:{}},...B.applet?{applet:B.applet}:{},...Q.length>0?{directives:Q}:{}}},[J,$,Z,H])}function An($,Z){if(!Z?.forkedFromSessionId||!Z.forkedThroughMessageId)return $;let J=Z.forkedThroughMessageId,H=$.turns.findIndex((Q)=>Q.id===J);if(H<0)return $;let B=new Set(Z.forkedNoticeIds);return{...$,turns:$.turns.slice(H+1),notices:$.notices.filter((Q)=>!B.has(Q.id))}}function qW0($){return $.filter((Z)=>Z.text.length>0).map((Z)=>Z.kind==="reasoning"?{type:"reasoning",text:Z.text}:{type:"text",text:Z.text})}function Dn($){let Z=qW0($?.blocks??[]);if(Z.length===0)return null;return{id:"live-preview",role:"assistant",origin:{kind:"user-input"},parts:Z}}var Vn=jB();function Ln($){let Z=f1(),J=X1(),{layout:H}=m1(),[B,Q]=I3($.activeTab),X=p2(),z=t9(Z).data,G=FJ(Z).data,U=B??null,Y=U??q2($.activeTab),K=Nn($),F=B4((O)=>U?O.activity[`${Z}:${U}`]??"idle":"idle"),W=_B(F),q=B4((O)=>U?O.errors[`${Z}:${U}`]??null:null),N=wS(Z,U),{refetch:D}=N,A=DU(Z,U),{refetch:V}=A,L=UZ.useCallback(async()=>{await D(),await V()},[D,V]),j=A.data?.forkedFromSessionId,M=!U||A.data!==void 0,_=M?N.data??Vn:Vn;if(N.data&&j)_=An(N.data,A.data);let w=B!==void 0&&M&&G!==void 0&&(U===null||N.data!==void 0),T=B4((O)=>Cb(O.previews,Z,U).root),b=UZ.useMemo(()=>Dn(T),[T]),C=A.data?.config,k=UZ.useCallback((O,y)=>{let I=O.trim(),x=rq(Z,Y,y);if(!I&&x.length===0&&!y?.preparedAttachments?.attachments.length)return;let v=y?.preparedAttachments??Dj(x),g=jK(v.attachments);if(g){r1.add({title:"Couldn’t send message",description:g,type:"error"});return}let E=U,l=!1;if(!E){if(E=crypto.randomUUID(),l=!0,!Vj(y))k7(Z,Y,E);Q(E),aq({tabId:$.activeTab,queryClient:J,workspaceId:Z,sessionId:E,text:I,filenames:x.map((U0)=>U0.label)})}let{attachments:r,optimisticId:h}=nq({queryClient:J,workspaceId:Z,sessionId:E,text:I},x,v),d=C?.model??H.selectedModel,o=C?.effort??H.selectedEffort,p=C?.fastMode??H.selectedFastMode,{model:i,effort:n,fastMode:Z0,stream:J0}=oq(z,d,o,p);if(MU({type:"chat",workspaceId:Z,content:I,sessionId:E,isNew:l,selectedSessionScope:X?"browser-tab":"shared",optimisticId:h,model:i,effort:n,fastMode:Z0,stream:J0,context:K(y),...r.length>0?{attachments:r}:{}}),sq(Z,x),l)J.invalidateQueries({queryKey:j0.preview(Z)})},[$.activeTab,Y,U,Z,J,H.selectedModel,H.selectedEffort,H.selectedFastMode,K,C?.model,C?.effort,C?.fastMode,Q,X,z]),S=UZ.useCallback(()=>{if(!U)return;k1.getState().setError(Z,U,null)},[U,Z]),R=UZ.useCallback(()=>{if(!W||!U)return;MU({type:"stop",workspaceId:Z,sessionId:U})},[W,U,Z]);return{view:_,forkedFromSessionId:j,chatLoaded:w,previewTurn:b,sessionId:U,composerSessionId:Y,processing:W,error:q,loadError:A.error?.message??N.error?.message??null,retryLoad:L,send:k,stop:R,selectSession:Q,dismissError:S}}var Pn=P(m(),1);var r2=P(m(),1);function Mn({active:$,viewId:Z,sessionId:J,source:H,workspaceId:B,onEditingStart:Q,onContinueInChat:X}){let z=r2.useRef(`sketch:${Z}`),G=r2.useRef(0),U=r2.useRef(null),Y=r2.useRef(null),K=r2.useRef(!0),[F,W]=r2.useState(!1),q=W5(Q),N=W5(X),D=r2.useCallback((T)=>{if(!K.current)return;if(!T){G.current+=1,U.current=null,Y.current=null,k1.getState().removeAttachment(B,z.current);return}kQ({workspaceId:B,sessionId:J,localId:z.current,purpose:"sketch",source:H,blob:T})},[J,H,B]),A=r2.useCallback((T)=>{if(!T)return Y.current??Promise.resolve();if(T===U.current){if(k1.getState().attachments[z8(B,J)]?.some((S)=>S.localId===z.current&&S.kind!=="text"&&(S.status==="ready"||S.status==="uploading")))return Y.current??Promise.resolve()}U.current=T;let b=++G.current,C=vK({workspaceId:B,sessionId:J,localId:z.current,purpose:"sketch",source:H,blob:T,isCurrent:()=>G.current===b});return Y.current=C,C},[J,H,B]),V=yK({mode:"sketch",onChange:D,onEditingStart:()=>q.current()}),{controls:L}=V,j=r2.useCallback(async()=>{await A(await L.flush())},[L,A]),M=r2.useCallback(async()=>{await A(await L.deactivate())},[L,A]),_=r2.useCallback(async()=>{if(F)return;W(!0);try{await M(),N.current()}finally{W(!1)}},[F,M,N]),w=r2.useCallback(async()=>{K.current=!1,G.current+=1,U.current=null,Y.current=null,k1.getState().removeAttachment(B,z.current);try{await L.cancel()}finally{K.current=!0}},[L,B]);return r2.useEffect(()=>{if(!$&&L.active)M()},[$,L.active,M]),{...V,continuing:F,continueInChat:_,prepareForSend:j,resetDocument:w}}var v1=P(c(),1);function _n({ref:$,active:Z,pendingView:J,running:H,sketchSessionId:B,chatDocked:Q,workspaceId:X,onEditingStart:z,onContinueInChat:G,onOpenChat:U,onDiscard:Y}){let K=J.status==="submitted"?H?"building":"waiting":J.status,F=Mn({active:Z&&J.status==="draft",viewId:J.id,sessionId:B??J.executionSessionId??q2(w5(J.id)),source:w5(J.id),workspaceId:X,onEditingStart:z,onContinueInChat:G});return Pn.useImperativeHandle($,()=>({prepareSketchForSend:F.prepareForSend,resetSketch:F.resetDocument}),[F.prepareForSend,F.resetDocument]),v1.jsx(DW0,{active:Z,chatDocked:Q,error:J.error,sketch:F,displayStatus:K,onDiscard:Y,onOpenChat:U})}function NW0(){return v1.jsx(tq,{children:v1.jsxs("div",{className:"flex max-w-md flex-col items-center gap-4 p-8 text-center",children:[v1.jsx(U8,{className:"size-6 text-muted-foreground"}),v1.jsx("p",{className:"text-sm text-muted-foreground",children:"Starting view chat…"})]})})}function AW0({error:$,onOpenChat:Z,onDiscard:J}){return v1.jsx(tq,{children:v1.jsxs("div",{className:"pointer-events-auto flex max-w-md flex-col items-center gap-4 bg-radial from-background from-50% to-transparent to-75% p-8 text-center",children:[v1.jsx("p",{className:"text-sm text-muted-foreground",children:$}),v1.jsx(P0,{onClick:Z,children:"Open chat"}),v1.jsx(P0,{variant:"secondary",onClick:J,children:"Discard view"})]})})}function DW0({active:$,chatDocked:Z,error:J,sketch:H,displayStatus:B,onDiscard:Q,onOpenChat:X}){let z=B==="draft";return v1.jsxs("div",{className:X0("relative min-h-0 flex-1 overflow-hidden bg-background",$?"flex":"hidden"),children:[v1.jsx(VW0,{chatDocked:Z,sketch:H,draft:z}),v1.jsx("div",{inert:z?void 0:!0,className:X0("absolute inset-0",!z&&"pointer-events-none opacity-50"),children:v1.jsx(kK,{...H.layerProps,children:z&&v1.jsx(hK,{controls:H.controls,title:"Sketch the view",busy:H.continuing,onComplete:()=>void H.continueInChat()})})}),v1.jsx("div",{"aria-hidden":!0,className:X0("pointer-events-none absolute inset-0 transition-shadow duration-500 ease-in-out",B==="building"&&"animate-glow texture-inset-shadow-50% motion-reduce:animate-none")}),B==="building"&&v1.jsx(MW0,{controls:H.controls}),B==="starting"&&v1.jsx(NW0,{}),B==="waiting"&&v1.jsx(LW0,{error:J,onDiscard:Q,onOpenChat:X}),B==="failed"&&v1.jsx(AW0,{error:J,onOpenChat:X,onDiscard:Q})]})}function VW0({chatDocked:$,sketch:Z,draft:J}){let{controls:H,targetRef:B}=Z,{hasStrokes:Q}=SQ(H);return v1.jsx("div",{ref:B,className:"absolute inset-0 flex items-center justify-center texture-checker-20",children:J&&!H.active&&!Q&&v1.jsxs("div",{className:X0("mb-4 flex h-full flex-col items-center justify-center gap-2 p-12 text-center text-sm text-muted-foreground","bg-radial from-background from-10% to-transparent",$?"w-full":"mr-auto w-[calc(100%-var(--chat-max))]"),children:[v1.jsx(lJ,{size:56,stroke:0.5}),v1.jsx("span",{className:"max-w-32",children:"Sketch how the view should look"})]})})}function LW0({error:$,onDiscard:Z,onOpenChat:J}){return v1.jsx(tq,{children:v1.jsxs("div",{className:"pointer-events-auto flex max-w-md flex-col items-center gap-4 bg-radial from-background from-50% to-transparent to-75% p-12 text-center",children:[v1.jsxs("div",{className:"flex flex-col gap-1",children:[v1.jsx("h1",{className:"font-medium",children:"The view needs your attention"}),v1.jsx("p",{className:"text-sm text-muted-foreground",children:$??"Open the chat to answer or ask the agent to continue"})]}),v1.jsxs("div",{className:"flex gap-2",children:[v1.jsx(P0,{onClick:J,children:"Open chat"}),v1.jsx(P0,{variant:"secondary",onClick:Z,children:"Discard view"})]})]})})}function MW0({controls:$}){let{hasStrokes:Z}=SQ($);return v1.jsx(tq,{children:!Z&&v1.jsx(U8,{className:"size-6 text-muted-foreground"})})}function tq({children:$}){return v1.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:$})}var e4=P(m(),1);function jn($,{activeId:Z,available:J,now:H}){let B=[];if(Z!==null&&J.has(Z))B.push({id:Z,releasedAt:null});for(let Q of $){if(Q.id===Z||!J.has(Q.id))continue;let X=Q.releasedAt??H;if(H-X>=60000)continue;if(B.length>=4)break;B.push({id:Q.id,releasedAt:X})}return B}function On($,Z){let J=null;for(let{releasedAt:H}of $){if(H===null)continue;let B=H+60000;if(J===null||B<J)J=B}return J===null?null:Math.max(0,J-Z)}function Tn($,Z){return $.length===Z.length&&$.every((J,H)=>{let B=Z[H];return J.id===B.id&&J.releasedAt===B.releasedAt})}var M2=P(c(),1),En=e4.memo(function({views:Z,activeViewId:J,params:H}){let B=PW0(J,Z),Q=new Set(B.map((X)=>X.id));return M2.jsx("div",{className:X0("relative min-h-0 flex-1 overflow-hidden",!J&&"hidden"),children:Z.filter((X)=>Q.has(X.id)).map((X)=>M2.jsx(_W0,{view:X,active:X.id===J,params:H},X.id))})});function PW0($,Z){let[J,H]=e4.useState([]),B=W5(Z),Q=Z.map((z)=>z.id).join(`
68
- `),X=e4.useCallback(()=>{H((z)=>{let G=jn(z,{activeId:$,available:new Set(B.current.map((U)=>U.id)),now:Date.now()});return Tn(z,G)?z:G})},[$,B]);return e4.useEffect(()=>{X()},[Q,X]),e4.useEffect(()=>{let z=On(J,Date.now());if(z===null)return;let G=setTimeout(X,z);return()=>clearTimeout(G)},[X,J]),J}function _W0({view:$,active:Z,params:J}){let H=f1(),B=Rh($.id),{current:Q,outgoing:X}=OW0(B,Z),[z,G]=e4.useState(J);if(Z&&z!==J)G(J);Pq(bK("views",H,$.id),Q?.version??B.version,Z);let U=B.status==="error";return eW({kind:"view",enabled:Z&&Boolean(Q)&&!U,targets:[{id:$.id,revision:$.revision}]}),M2.jsxs(M2.Fragment,{children:[Z&&U&&M2.jsx("p",{className:"absolute inset-0 p-4 text-xs text-destructive",children:B.error}),Z&&!U&&!Q&&M2.jsx(TW0,{}),Q&&!U&&M2.jsxs(e4.Activity,{mode:Z?"visible":"hidden",children:[X&&M2.jsx(Cn,{view:$,build:X,params:z},X.version),M2.jsx(Cn,{view:$,build:Q,params:z,entering:X!==null,current:!0},Q.version)]})]})}function Cn({view:$,build:Z,params:J,entering:H,current:B=!1}){let Q=f1(),X=Z7("views",$.id);return M2.jsx("div",{"data-applet-thumbnail":B?X:void 0,"data-applet":X,className:X0("absolute inset-0 isolate",H&&"animate-in duration-200 ease-out blur-in-4 fade-in"),children:M2.jsx("div",{className:"size-full overflow-auto",children:M2.jsx(wX,{name:$.id,kind:"view",workspaceId:Q,resetKey:Z.version,children:M2.jsx(OB,{appletId:X,active:B,children:M2.jsx(Z.Component,{params:J})})})})})}var jW0=200;function OW0($,Z){let[J,H]=e4.useState({current:null,outgoing:null});if($.status==="ready"&&J.current?.version!==$.version){let B={Component:$.Component,version:$.version};H((Q)=>({current:B,outgoing:Z?Q.current:null}))}return e4.useEffect(()=>{if(!J.outgoing)return;let B=setTimeout(()=>H((Q)=>({...Q,outgoing:null})),jW0);return()=>clearTimeout(B)},[J.outgoing]),J}function TW0(){return M2.jsx("div",{className:"absolute inset-0 flex animate-in items-center justify-center delay-150 duration-200 fill-mode-both fade-in",children:M2.jsx(U8,{className:"text-muted-foreground"})})}function bn($){return $?.status==="compiled"?void 0:$}async function wn($,Z,J,H,B,Q,X="shared"){let G=bn($.getQueryData(j0.views(Z))?.find((K)=>K.id===J))?.executionSessionId??H;try{let[{views:K},F]=await Promise.all([G1(`/api/workspaces/${Z}/views`),G1(`/api/workspaces/${Z}/selected-session`)]),W=bn(K.find((q)=>q.id===J));if(!Q&&W?.status==="draft")G=q2(w5(J)),$.setQueryData(j0.sessions(Z),(q)=>q?.filter((N)=>N.sessionId!==H)),$.removeQueries({queryKey:j0.events(Z,H)});else G=W?.executionSessionId??(Q?F.pinned:F.selected[w5(J)])??H;if(k7(Z,H,G),W?.status==="draft"||W?.status==="failed")k1.getState().setActivity(Z,G,"idle");if($.setQueryData(j0.views(Z),K),$.setQueryData(R3.sessionSelection(Z),F),X==="browser-tab"&&!Q){let N={...($.getQueryData(c2(Z,"browser-tab"))??S6(Z)).selected};if(W?.status==="draft")delete N[w5(J)];else N[w5(J)]=G;let D={selected:N,pinned:null};$.setQueryData(c2(Z,"browser-tab"),D),R6(Z,D)}}catch{k7(Z,H,G),$.invalidateQueries({queryKey:j0.views(Z)}),$.invalidateQueries({queryKey:R3.sessionSelection(Z)})}let U=b2(Z,G),Y=S1.getState();Y.setComposerDraft(U,Y.composerDrafts[U]??B)}function Sn(){let $=X1(),J=p2()?"browser-tab":"shared",{workspaceId:H,layout:B}=m1(),{pinnedSessionId:Q}=k6(),X=t9(H).data,z=cr(H),G=dr(H),U=lr(H),Y=ir(H);return{create:()=>z.mutateAsync(),save:(N,D)=>G.mutateAsync({viewId:N,requirements:D}),submit:async(N,D)=>{let A=D.trim(),V=Q??q2(w5(N.id)),L=Q??crypto.randomUUID(),j=rq(H,V);if(!A&&j.length===0)return;if(!Q)aq({tabId:w5(N.id),queryClient:$,workspaceId:H,sessionId:L,text:A,filenames:j.map((k)=>k.label)});if(!Q)k7(H,V,L),hB($,H,L,w5(N.id),J);let M=nq({queryClient:$,workspaceId:H,sessionId:L,text:A},j),_=$.getQueryData(j0.session(H,L))?.config,{model:w,effort:T,fastMode:b,stream:C}=oq(X,_?.model??B.selectedModel,_?.effort??B.selectedEffort,_?.fastMode??B.selectedFastMode);$.setQueryData(j0.views(H),(k)=>k?.map((S)=>S.id===N.id&&S.status==="draft"?{...S,status:"starting",requirements:A,executionSessionId:L}:S));try{let k=await U.mutateAsync({viewId:N.id,sessionId:L,requirements:A,optimisticId:M.optimisticId,selectedSessionScope:J,...j.length>0?{attachments:M.attachments}:{},model:w,effort:T,fastMode:b,stream:C});if(k7(H,L,k.sessionId),AU($,H,L,k.sessionId),!Q)hB($,H,k.sessionId,w5(N.id),J);sq(H,j);let S=b2(H,k.sessionId),R=S1.getState();if(R.composerDrafts[S]?.trim()===A)R.setComposerDraft(S,null)}catch(k){throw await wn($,H,N.id,L,A,!!Q,J),k}},discard:(N)=>Y.mutateAsync(N)}}var I7=P(m(),1);function Rn({workspaceId:$,pendingViews:Z,onSave:J}){let H=I7.useRef(new Set),B=I7.useRef(new Map),Q=W5(Z),X=W5(J),z=I7.useCallback((G)=>{clearTimeout(B.current.get(G)),B.current.delete(G),S1.getState().setComposerDraft(b2($,q2(w5(G))),null)},[$]);return I7.useEffect(()=>{for(let G of Z){let U=q2(w5(G.id)),Y=b2($,U);if(S1.getState().moveComposerDraft(U,Y),G.status!=="draft")z(G.id);else if(!H.current.has(Y)){if(H.current.add(Y),S1.getState().composerDrafts[Y]===void 0)S1.getState().setComposerDraft(Y,G.requirements)}}},[$,Z,z]),I7.useEffect(()=>{let G=B.current,U=S1.subscribe((Y,K)=>{for(let F of Q.current){if(F.status!=="draft")continue;let W=b2($,q2(w5(F.id))),q=Y.composerDrafts[W];if(q===K.composerDrafts[W])continue;if(clearTimeout(G.get(F.id)),G.delete(F.id),q===void 0)continue;G.set(F.id,setTimeout(()=>{if(G.delete(F.id),Q.current.find((N)=>N.id===F.id)?.status!=="draft")return;X.current(F.id,q).catch(()=>{r1.add({title:"Couldn’t save view description",type:"error"})})},500))}});return()=>{U();for(let Y of G.values())clearTimeout(Y);G.clear()}},[$,Q,X]),{clear:z}}var vH=P(m(),1);function Lj($){let Z=document.documentElement,J=getComputedStyle(Z).getPropertyValue($).trim(),H=Number.parseFloat(J);if(!Number.isFinite(H))return 0;return J.endsWith("rem")?H*Number.parseFloat(getComputedStyle(Z).fontSize):H}function kn(){let $=vH.useRef(null),[Z,J]=vH.useState(null);return vH.useLayoutEffect(()=>{let H=$.current;if(!H)return;let B=(X)=>{let z=Lj("--column-w"),G=Lj("--chat-min"),U=Lj("--chat-max"),Y={fits:X-G>=z,workspaceMinWidth:z,chatMinWidth:G,chatMaxWidth:U};J((K)=>K?.fits===Y.fits&&K.workspaceMinWidth===Y.workspaceMinWidth&&K.chatMinWidth===Y.chatMinWidth&&K.chatMaxWidth===Y.chatMaxWidth?K:Y)};B(H.getBoundingClientRect().width);let Q=()=>B(H.getBoundingClientRect().width);return window.addEventListener("resize",Q),()=>window.removeEventListener("resize",Q)},[]),{ref:$,fits:Z?.fits??!1,constraints:Z?{workspaceMinWidth:Z.workspaceMinWidth,chatMinWidth:Z.chatMinWidth,chatMaxWidth:Z.chatMaxWidth}:null}}function In($,Z){if(Z)return{status:"disconnected"};return $??{status:"checking"}}var yn=P(c(),1);function Mj({agentUnavailable:$,chatError:Z,skillUpdate:J}){return $??Z??J}function y7({className:$,...Z}){return yn.jsx("div",{...Z,className:X0("w-full p-2 text-sm @xl:p-1 @xl:pl-3",$)})}var YZ=P(c(),1);function Pj({error:$,onDismiss:Z,onRetry:J}){return YZ.jsxs(y7,{role:"alert",className:"flex items-center gap-2 text-destructive",children:[YZ.jsx("span",{className:"flex-1 wrap-break-word",children:$}),J&&YZ.jsx(P0,{type:"button",variant:"ghost",size:"sm",onClick:J,children:"Retry"}),Z&&YZ.jsx(P0,{type:"button",variant:"ghost",size:"icon-sm",onClick:Z,className:"text-destructive hover:text-destructive","aria-label":"Dismiss error",children:YZ.jsx(n5,{stroke:1.75})})]})}var _j=P(m(),1);var y4=P(c(),1);function fn({availability:$,login:Z,onStartLogin:J}){switch($.status){case"login-required":return y4.jsx(CW0,{login:Z,onStartLogin:J});case"disconnected":return y4.jsx(xn,{icon:gn,children:"Reconnecting to moi…"});case"unavailable":return y4.jsx(xn,{icon:hn,children:$.reason})}}function CW0({login:$,onStartLogin:Z}){let[J,H]=_j.useState(!1),[B,Q]=_j.useState(null),X=$?.state==="failed"?$.reason:null,z=B??X,G=async()=>{let U=window.open("about:blank","moi-agent-login");if(U)U.opener=null;H(!0),Q(null);try{let Y=await Z();if(Y.url){if(!U)throw Error("Allow pop-ups, then try again");U.location.href=Y.url}else U?.close()}catch(Y){U?.close(),Q(Y instanceof Error?Y.message:"Could not start sign-in")}finally{H(!1)}};return y4.jsxs(y7,{role:"alert",className:"flex items-center gap-2",children:[y4.jsx(vn,{size:20,stroke:1.5}),y4.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[y4.jsx("div",{className:"wrap-break-word",children:"Log in to your agent to send messages"}),z&&y4.jsx("div",{className:"wrap-break-word text-destructive",children:z})]}),y4.jsxs(P0,{type:"button",size:"sm",onClick:()=>void G(),disabled:J,children:[J&&y4.jsx(x5,{stroke:1.75,className:"animate-spin"}),"Log in"]})]})}function xn({icon:$,children:Z}){return y4.jsxs(y7,{role:"alert",className:"flex items-center gap-2",children:[y4.jsx($,{size:20,stroke:1.5}),y4.jsx("div",{className:"min-w-0 flex-1 wrap-break-word",children:Z})]})}var a2=P(c(),1);function un({error:$,pendingAction:Z,onUpdate:J,onDismiss:H}){if(!$&&Z==="auto")return a2.jsxs(y7,{role:"status",className:"flex items-center gap-1.5 text-muted-foreground",children:[a2.jsx(x5,{size:20,stroke:1.5,className:"shrink-0 animate-spin"}),a2.jsx("span",{className:"wrap-break-word",children:"Updating moi skills…"})]});let B=Z!==null;return a2.jsxs(y7,{role:$?"alert":"status",className:X0("grid grid-cols-[minmax(0,1fr)_auto] gap-x-2 gap-y-2","@xl:flex @xl:items-center",$&&"text-destructive"),children:[a2.jsxs("div",{className:"flex min-w-0 items-start gap-1.5 @xl:order-1 @xl:flex-1 @xl:items-center",children:[a2.jsx(mn,{size:20,stroke:1.5,className:"shrink-0"}),$?a2.jsx("span",{className:"wrap-break-word",children:`Update failed: ${$}`}):a2.jsx("span",{className:"wrap-break-word",children:"This workspace is using old moi skills"})]}),a2.jsx(P0,{type:"button",variant:"ghost",size:"icon-sm",onClick:H,className:"col-start-2 row-start-1 -mt-1 -mr-1 text-muted-foreground hover:text-foreground @xl:order-4 @xl:m-0","aria-label":"Dismiss skill update",children:a2.jsx(n5,{stroke:1.75})}),a2.jsxs("div",{className:"col-span-2 flex flex-wrap gap-1.5 @xl:contents",children:[a2.jsxs(P0,{type:"button",variant:"default",size:"sm",onClick:()=>J("auto"),disabled:B,className:"@xl:order-2",children:[Z==="auto"&&a2.jsx(x5,{stroke:1.75,className:"animate-spin"}),Z==="auto"?"Updating…":"Auto-update"]}),a2.jsxs(P0,{type:"button",variant:"secondary",size:"sm",onClick:()=>J("once"),disabled:B,className:"@xl:order-3",children:[Z==="once"&&a2.jsx(x5,{stroke:1.75,className:"animate-spin"}),Z==="once"?"Updating…":"Update once"]})]})]})}var x7=P(m(),1);function jj($){return{workspaceId:$,phase:"idle",pendingAction:null,error:null}}function EW0($){return $.phase==="active"||$.phase==="idle"&&$.updateAvailable&&!$.autoUpdateEnabled}function bW0($){return $.updateAvailable&&$.autoUpdateEnabled&&!$.updatePending&&$.phase==="idle"}function pn($){let Z=vh($),{isPending:J,mutate:H,reset:B}=gh($),Q=Er(),{mutate:X}=br(),z=Q.data!==void 0,G=Q.data?.autoUpdateSkills??!1,U=x7.useCallback(()=>X({autoUpdateSkills:!0}),[X]),[Y,K]=x7.useState(()=>jj($)),F=Y.workspaceId===$?Y:jj($);x7.useEffect(()=>{K(jj($)),B()},[$,B]);let W=x7.useCallback((D)=>{if(J)return;if(D==="auto")U();K({workspaceId:$,phase:"active",pendingAction:D,error:null}),H(void 0,{onSuccess:()=>{K((A)=>A.workspaceId===$?{...A,phase:"dismissed",pendingAction:null,error:null}:A)},onError:(A)=>{K((V)=>V.workspaceId===$&&V.phase!=="dismissed"?{...V,phase:"active",pendingAction:null,error:A.message}:V)}})},[U,J,H,$]),q=Z.data?.updateAvailable??!1;return x7.useEffect(()=>{if(z&&bW0({updateAvailable:q,autoUpdateEnabled:G,updatePending:J,phase:F.phase}))W("auto")},[G,F.phase,W,z,q,J]),{bannerProps:z&&EW0({updateAvailable:q,autoUpdateEnabled:G,phase:F.phase})?{error:F.error,pendingAction:F.pendingAction,onUpdate:W,onDismiss:()=>{K((D)=>D.workspaceId===$?{...D,phase:"dismissed",pendingAction:null,error:null}:D)}}:null}}var dX=P(c(),1);function cn($,{chatError:Z,onDismissChatError:J,chatLoadError:H,onRetryChatLoad:B}){let{data:Q,error:X}=t9($),z=Q?.availability,{bannerProps:G}=pn($),U=In(z,Boolean(X)),Y=U.status==="checking"||U.status==="available"?void 0:U,K=Y?{tone:"default",content:dX.jsx(fn,{availability:Y,login:Q?.login,onStartLogin:()=>hh($)})}:void 0,F;if(H)F={tone:"error",content:dX.jsx(Pj,{error:H,onRetry:B})};else if(Z)F={tone:"error",content:dX.jsx(Pj,{error:Z,onDismiss:J})};let W=G?{tone:"default",content:dX.jsx(un,{...G})}:void 0,q=Mj({agentUnavailable:K,chatError:F,skillUpdate:W}),N=Mj({agentUnavailable:K,skillUpdate:W});return{agentAvailability:U,composerBanner:q,viewDraftComposerBanner:N}}var dn=P(m(),1);var $8=P(c(),1);function ln({onOpenTheme:$}){let{layout:Z,name:J,provider:H}=m1(),[B,Q]=dn.useState(!1);return $8.jsx(Aq,{children:$8.jsxs(Z3,{children:[$8.jsxs(J3,{className:"flex min-w-0 cursor-pointer items-center gap-2 rounded-sm outline-none focus-visible:ring-3 focus-visible:ring-ring/50","aria-label":`${J??"Workspace"} menu`,onPointerEnter:()=>Q(!0),onPointerLeave:()=>Q(!1),children:[$8.jsx(n6,{icon:B?{...Z.icon,type:"glyph",value:"dots"}:Z.icon,workspaceType:H,workspaceTheme:Z.theme,className:"size-5 rounded-sm"}),J&&$8.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:J})]}),$8.jsx(H3,{align:"start",sideOffset:6,className:"w-36",children:$8.jsxs(K7,{children:[$8.jsxs(B3,{onClick:$,children:[$8.jsx(dq,{stroke:1.75}),"Theme"]}),$8.jsxs(B3,{nativeButton:!0,render:$8.jsx(x3,{}),className:"w-full",children:[$8.jsx(g6,{stroke:1.75}),"Settings"]})]})})]})})}var wW0=SK();function n3($,Z){if($==="overview"||$==="scratchpad")return!0;let J=lZ($);return J?Z.some((H)=>H.id===J):!1}function eq($,Z){let J=$.open.filter((H)=>n3(H,Z));return J.length>0?J:wW0.open}function Oj($,Z,J){if($!==void 0)return $;let H=eq(Z,J);return H.includes(Z.active)?Z.active:H[0]??"overview"}var W2=P(m(),1);var gH=P(m(),1);var rn=($)=>`moi:collab:${$}:tabs`;function SW0($,Z){try{let J=sessionStorage.getItem(rn($));return J?RK(JSON.parse(J)):Z}catch{return Z}}function RW0($,Z){try{sessionStorage.setItem(rn($),JSON.stringify(Z))}catch{}}function an(){let{workspaceId:$,layout:Z,setLayout:J}=m1(),H=p2(),B=gH.useMemo(()=>RK(Z.tabs),[Z.tabs]),[Q,X]=gH.useState(()=>H?SW0($,B):B),z=gH.useCallback((G)=>{let U=RK(G);if(H)X(U),RW0($,U);else J({tabs:U});return U},[H,J,$]);return[H?Q:B,z]}function sn($){let Z=new URLSearchParams($);Z.sort();let J=Z.toString();return J?`?${J}`:""}function Tj(){return window.location.pathname+sn(window.location.search)}function Cj($,Z){return $.get(Z)??`moi:/${Z}`}var on=new Map;function tn({views:$,onOpenChat:Z}){let J=X1(),{workspaceId:H}=m1(),[B,Q]=an(),X=W2.useRef({views:$,tabsState:B,onOpenChat:Z});W2.useLayoutEffect(()=>{X.current={views:$,tabsState:B,onOpenChat:Z}},[$,B,Z]);let z=ES(),G=W2.useRef(null),[,U]=M8(),Y=_2(),{base:K}=Y,F=`${K.replace(/\/$/,"")}/workspace/${encodeURIComponent(H)}/`,W=p7(Y).slice(F.length),q=sn(Yz(Y)),N=W2.useMemo(()=>{let S=new URLSearchParams(q);return Object.fromEntries(Array.from(S.keys(),(R)=>[R,S.get(R)]))},[q]),D=W2.useMemo(()=>{let S=on.get(H);if(!S)on.set(H,S=new Map);return S},[H]),A=K$(W),V=W==="chat"||W==="chats"||W.startsWith("chats/"),L=Oj(A,B,$),j=Boolean(W)&&!V&&(!A||!n3(A,$)),M=A!==void 0&&!j,_=W2.useCallback((S)=>{X.current={...X.current,tabsState:Q(S)}},[X,Q]),w=W2.useCallback(()=>{let S=K$(window.location.pathname.slice(F.length)),{tabsState:R,views:O}=X.current,y=S??Oj(void 0,R,O),I=S?`moi:/${y}${window.location.search}`:Cj(D,y);return{tab:y,href:I}},[X,F,D]),T=W2.useCallback(async(S,{replace:R=!1}={},O=new AbortController)=>{let y=F8(S,{workspaceId:H,base:K});if(G.current?.controller.abort(),!y.startsWith(F)){G.current=null,O.signal.throwIfAborted(),window.location.assign(y);return}G.current={controller:O,address:Tj()};let I=(x)=>{if(O.signal.throwIfAborted(),G.current=null,Tj()!==x||window.location.hash)U(`~${x}`,{replace:R})};try{let x=y.slice(F.length).split("?",1)[0];if(x==="chat"||x.startsWith("chats/")){let{tab:E,href:l}=w(),r=x==="chat"?!0:await z(decodeURIComponent(x.slice(6)),E,O.signal);if(I(F8(l,{workspaceId:H,base:K})),r)X.current.onOpenChat();return}if(!m9(x))throw Error("This destination is unavailable in this workspace");let v=j0.views(H),g=J.getQueryData(v)??X.current.views;if(!n3(x,g))await J.refetchQueries({queryKey:v,exact:!0},{throwOnError:!0}),g=J.getQueryData(v)??X.current.views;if(!n3(x,g))throw Error("This destination is unavailable in this workspace");I(y)}finally{if(G.current?.controller===O)G.current=null}},[K,w,X,F,J,z,U,H]);W2.useEffect(()=>{let S=G.current;if(S&&S.address!==Tj())S.controller.abort()},[W,q,H]),W2.useEffect(()=>()=>G.current?.controller.abort(),[]);let b=W2.useCallback((S)=>{if(S instanceof Error&&S.name==="AbortError")return;let R=S instanceof Error?S.message:"Navigation failed";r1.add({type:"error",title:"Could not navigate",description:R}),X8(H,{source:"runtime",message:R})},[H]),C=W2.useCallback((S,R={})=>{T(Cj(D,S),R).catch(b)},[T,D,b]);CK(H,"navigate",(S)=>{T(S).catch(b)}),nn(H,T),W2.useEffect(()=>{if(W&&!V)return;let S=Cj(D,L);if(V)try{S=F8(`moi:/${W}`)}catch{}let R=new AbortController;return T(S,{replace:!0},R).catch((O)=>{if(!R.signal.aborted)b(O)}),()=>R.abort()},[L,V,T,W,D,b,q]),W2.useEffect(()=>{if(!M)return;D.set(L,`moi:/${L}${q}`);let S=X.current.tabsState,R=S.open.includes(L)?S.open:[...S.open,L];if(R!==S.open||S.active!==L)_({open:R,active:L})},[L,M,X,D,q,_]);let k=W2.useCallback((S)=>{if(S.defaultPrevented||S.button!==0||S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;let R=S.target instanceof Element?S.target.closest("a[href]"):null;if(!(R instanceof HTMLAnchorElement)||R.hasAttribute("download")||R.target&&R.target!=="_self")return;let O=new URL(R.href);if(O.origin!==window.location.origin||!O.pathname.startsWith(F))return;if(O.hash)return;S.preventDefault(),T(`moi:/${O.pathname.slice(F.length)}${O.search}`).catch(b)},[T,F,b]);return{tabsState:B,activeTab:L,appletParams:N,navigateToTab:C,setTabs:_,isUnavailable:j,onNavigationClick:k}}var v5=P(c(),1),kW0=GJ([_$({variant:"ghost",size:"sm"}),"group/tab min-w-0"],{variants:{active:{true:"bg-accent text-accent-foreground"},dragging:{true:"invisible"},preview:{true:"cursor-grabbing ring-1 ring-border"}},compoundVariants:[{preview:!0}]});function IW0({items:$}){return v5.jsxs(Z3,{children:[v5.jsx(J3,{render:v5.jsx(P0,{type:"button",variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":"Create tab",children:v5.jsx(d2,{stroke:1.75})})}),v5.jsx(H3,{align:"start",className:"min-w-48",children:v5.jsx(K7,{children:$.map((Z)=>v5.jsxs(B3,{onClick:Z.onClick,className:"font-medium",children:[v5.jsx(Z.Icon,{stroke:2}),Z.label]},Z.key))})})]})}function en($){let{tab:Z,active:J}=$,H=$.preview===!0;return v5.jsxs("button",{type:"button","aria-hidden":H||void 0,"aria-label":Z.label,disabled:H,tabIndex:H?-1:void 0,onClick:$.preview?void 0:()=>$.onSelect(Z.key),className:kW0({active:J,dragging:$.preview?!1:$.state.isDragging,preview:H}),...$.preview?{}:$.state.dragHandleProps,children:[v5.jsxs("div",{className:X0("flex items-center gap-1 overflow-hidden select-none",Z.closable&&"group-hover/tab:mr-3"),children:[Z.loading?v5.jsx(U8,{"data-icon":"inline-start",className:"shrink-0"}):v5.jsx(Z.Icon,{"data-icon":"inline-start",stroke:2,className:"size-4 shrink-0"}),v5.jsx("span",{className:X0("truncate",Z.closable&&"group-hover/tab:-mr-3 group-hover/tab:mask-r-from-[calc(100%-24px)] group-hover/tab:mask-r-to-[calc(100%-12px)]"),children:Z.label})]}),Z.closable&&v5.jsx("div",{"aria-label":`Close ${Z.label}`,tabIndex:H?-1:void 0,className:X0("absolute right-2 hidden size-3 items-center justify-center text-muted-foreground group-hover/tab:flex hover:text-foreground",H&&"pointer-events-none"),onClick:$.preview?void 0:(B)=>{B.stopPropagation(),$.onClose(Z.key)},children:v5.jsx(n5,{stroke:1.75,className:"size-4 shrink-0"})})]})}function $s({tabs:$,active:Z,createItems:J,onSelect:H,onClose:B,onReorder:Q}){return v5.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1",children:[v5.jsx("div",{className:"no-scrollbar min-w-0 scroll-fade-x overflow-x-auto overflow-y-hidden [--scroll-fade-reveal:16px]",children:v5.jsx(HK,{items:$,getId:(X)=>X.key,isItemDragDisabled:(X)=>X.reorderable===!1,className:"flex w-max items-center gap-1",onReorder:(X)=>Q(X),renderPlaceholder:()=>v5.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-md bg-muted"}),renderOverlay:(X)=>v5.jsx(en,{tab:X,active:Z===X.key,preview:!0}),renderItem:(X,z)=>v5.jsx(en,{tab:X,active:Z===X.key,state:z,onSelect:H,onClose:B})})}),v5.jsx("div",{className:"shrink-0",children:v5.jsx(IW0,{items:J})})]})}var f7=P(m(),1);var cH=P(c(),1),R1=P(m(),1);function yW0($,Z){let J=getComputedStyle($),H=parseFloat(J.fontSize);return Z*H}function xW0($,Z){let J=getComputedStyle($.ownerDocument.documentElement),H=parseFloat(J.fontSize);return Z*H}function hW0($){return $/100*window.innerHeight}function vW0($){return $/100*window.innerWidth}function gW0($){switch(typeof $){case"number":return[$,"px"];case"string":{let Z=parseFloat($);return $.endsWith("%")?[Z,"%"]:$.endsWith("px")?[Z,"px"]:$.endsWith("rem")?[Z,"rem"]:$.endsWith("em")?[Z,"em"]:$.endsWith("vh")?[Z,"vh"]:$.endsWith("vw")?[Z,"vw"]:[Z,"%"]}}}function lX({groupSize:$,panelElement:Z,styleProp:J}){let H,[B,Q]=gW0(J);switch(Q){case"%":{H=B/100*$;break}case"px":{H=B;break}case"rem":{H=xW0(Z,B);break}case"em":{H=yW0(Z,B);break}case"vh":{H=hW0(B);break}case"vw":{H=vW0(B);break}}return H}function x4($){return parseFloat($.toFixed(3))}function dH({group:$}){let{orientation:Z,panels:J}=$;return J.reduce((H,B)=>(H+=Z==="horizontal"?B.element.offsetWidth:B.element.offsetHeight,H),0)}function bj($){let{panels:Z}=$,J=dH({group:$});return J===0?Z.map((H)=>({groupResizeBehavior:H.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:H.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:H.panelConstraints.disabled,minSize:0,maxSize:100,panelId:H.id})):Z.map((H)=>{let{element:B,panelConstraints:Q}=H,X=0;if(Q.collapsedSize!==void 0){let Y=lX({groupSize:J,panelElement:B,styleProp:Q.collapsedSize});X=x4(Y/J*100)}let z;if(Q.defaultSize!==void 0){let Y=lX({groupSize:J,panelElement:B,styleProp:Q.defaultSize});z=x4(Y/J*100)}let G=0;if(Q.minSize!==void 0){let Y=lX({groupSize:J,panelElement:B,styleProp:Q.minSize});G=x4(Y/J*100)}let U=100;if(Q.maxSize!==void 0){let Y=lX({groupSize:J,panelElement:B,styleProp:Q.maxSize});U=x4(Y/J*100)}return{groupResizeBehavior:Q.groupResizeBehavior,collapsedSize:X,collapsible:Q.collapsible===!0,defaultSize:z,disabled:Q.disabled,minSize:G,maxSize:U,panelId:H.id}})}function O5($,Z="Assertion error"){if(!$)throw Error(Z)}function wj($,Z){return Array.from(Z).sort($==="horizontal"?fW0:mW0)}function fW0($,Z){let J=$.element.offsetLeft-Z.element.offsetLeft;return J!==0?J:$.element.offsetWidth-Z.element.offsetWidth}function mW0($,Z){let J=$.element.offsetTop-Z.element.offsetTop;return J!==0?J:$.element.offsetHeight-Z.element.offsetHeight}function Vs($){return $!==null&&typeof $=="object"&&"nodeType"in $&&$.nodeType===Node.ELEMENT_NODE}function Ls($,Z){return{x:$.x>=Z.left&&$.x<=Z.right?0:Math.min(Math.abs($.x-Z.left),Math.abs($.x-Z.right)),y:$.y>=Z.top&&$.y<=Z.bottom?0:Math.min(Math.abs($.y-Z.top),Math.abs($.y-Z.bottom))}}function uW0({orientation:$,rects:Z,targetRect:J}){let H={x:J.x+J.width/2,y:J.y+J.height/2},B,Q=Number.MAX_VALUE;for(let X of Z){let{x:z,y:G}=Ls(H,X),U=$==="horizontal"?z:G;U<Q&&(Q=U,B=X)}return O5(B,"No rect found"),B}var $N;function pW0(){return $N===void 0&&(typeof matchMedia=="function"?$N=!!matchMedia("(pointer:coarse)").matches:$N=!1),$N}function Ms($){let{element:Z,orientation:J,panels:H,separators:B}=$,Q=wj(J,Array.from(Z.children).filter(Vs).map((q)=>({element:q}))).map(({element:q})=>q),X=[],z=!1,G=!1,U=-1,Y=-1,K=0,F,W=[];{let q=-1;for(let N of Q)N.hasAttribute("data-panel")&&(q++,N.hasAttribute("data-disabled")||(K++,U===-1&&(U=q),Y=q))}if(K>1){let q=-1;for(let N of Q)if(N.hasAttribute("data-panel")){q++;let D=H.find((A)=>A.element===N);if(D){if(F){let A=F.element.getBoundingClientRect(),V=N.getBoundingClientRect(),L;if(G){let j=J==="horizontal"?new DOMRect(A.right,A.top,0,A.height):new DOMRect(A.left,A.bottom,A.width,0),M=J==="horizontal"?new DOMRect(V.left,V.top,0,V.height):new DOMRect(V.left,V.top,V.width,0);switch(W.length){case 0:{L=[j,M];break}case 1:{let _=W[0],w=uW0({orientation:J,rects:[A,V],targetRect:_.element.getBoundingClientRect()});L=[_,w===A?M:j];break}default:{L=W;break}}}else W.length?L=W:L=[J==="horizontal"?new DOMRect(A.right,V.top,V.left-A.right,V.height):new DOMRect(V.left,A.bottom,V.width,V.top-A.bottom)];for(let j of L){let M="width"in j?j:j.element.getBoundingClientRect(),_=pW0()?$.resizeTargetMinimumSize.coarse:$.resizeTargetMinimumSize.fine;if(M.width<_){let T=_-M.width;M=new DOMRect(M.x-T/2,M.y,M.width+T,M.height)}if(M.height<_){let T=_-M.height;M=new DOMRect(M.x,M.y-T/2,M.width,M.height+T)}let w=q<=U||q>Y;!z&&!w&&X.push({group:$,groupSize:dH({group:$}),panels:[F,D],separator:"width"in j?void 0:j,rect:M}),z=!1}}G=!1,F=D,W=[]}}else if(N.hasAttribute("data-separator")){N.ariaDisabled!==null&&(z=!0);let D=B.find((A)=>A.element===N);D?W.push(D):(F=void 0,W=[])}else G=!0}return X}class Sj{#$={};addListener($,Z){let J=this.#$[$];return J===void 0?this.#$[$]=[Z]:J.includes(Z)||J.push(Z),()=>{this.removeListener($,Z)}}emit($,Z){let J=this.#$[$];if(J!==void 0)if(J.length===1)J[0].call(null,Z);else{let H=!1,B=null,Q=Array.from(J);for(let X=0;X<Q.length;X++){let z=Q[X];try{z.call(null,Z)}catch(G){B===null&&(H=!0,B=G)}}if(H)throw B}}removeAllListeners(){this.#$={}}removeListener($,Z){let J=this.#$[$];if(J!==void 0){let H=J.indexOf(Z);H>=0&&J.splice(H,1)}}}var uH={cursorFlags:0,state:"inactive"},Rj=new Sj;function FZ(){return uH}function cW0($){return Rj.addListener("change",$)}function dW0($){let Z=uH,J={...uH};J.cursorFlags=$,uH=J,Rj.emit("change",{prev:Z,next:J})}function pH($){let Z=uH;uH=$,Rj.emit("change",{prev:Z,next:$})}var lW0=($)=>$,Ej=()=>{},Ps=1,_s=2,js=4,Os=8,Zs=3,Js=12,ZN;function Hs(){return ZN===void 0&&(ZN=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(ZN=!0)),ZN}function iW0({cursorFlags:$,groups:Z,state:J}){let H=0,B=0;switch(J){case"active":case"hover":Z.forEach((Q)=>{if(!Q.mutableState.disableCursor)switch(Q.orientation){case"horizontal":{H++;break}case"vertical":{B++;break}}})}if(!(H===0&&B===0)){switch(J){case"active":{if($&&Hs()){let Q=($&Ps)!==0,X=($&_s)!==0,z=($&js)!==0,G=($&Os)!==0;if(Q)return z?"se-resize":G?"ne-resize":"e-resize";if(X)return z?"sw-resize":G?"nw-resize":"w-resize";if(z)return"s-resize";if(G)return"n-resize"}break}}return Hs()?H>0&&B>0?"move":H>0?"ew-resize":"ns-resize":H>0&&B>0?"grab":H>0?"col-resize":"row-resize"}}var Bs=new WeakMap;function kj($){if(!$.defaultView||!$.adoptedStyleSheets)return;let{prevStyle:Z,styleSheet:J}=Bs.get($)??{};J===void 0&&(J=new $.defaultView.CSSStyleSheet,$.adoptedStyleSheets&&(Object.isExtensible($.adoptedStyleSheets)?$.adoptedStyleSheets.push(J):$.adoptedStyleSheets=[...$.adoptedStyleSheets,J]));let H=FZ();switch(H.state){case"active":case"hover":{let B=iW0({cursorFlags:H.cursorFlags,groups:H.hitRegions.map((X)=>X.group),state:H.state}),Q=`*, *:hover {cursor: ${B} !important; }`;if(Z===Q)return;Z=Q,B?J.cssRules.length===0?J.insertRule(Q):J.replaceSync(Q):J.cssRules.length===1&&J.deleteRule(0);break}case"inactive":{Z=void 0,J.cssRules.length===1&&J.deleteRule(0);break}}Bs.set($,{prevStyle:Z,styleSheet:J})}var N3=new Map,Ts=new Sj;function rW0($){N3=new Map(N3),N3.delete($)}function Qs($,Z){for(let[J]of N3)if(J.id===$)return J}function h7($,Z){for(let[J,H]of N3)if(J.id===$)return H;if(Z)throw Error(`Could not find data for Group with id ${$}`)}function v7(){return N3}function Ij($,Z){return Ts.addListener("groupChange",(J)=>{J.group.id===$&&Z(J)})}function s3($,Z,J){let H=N3.get($);N3=new Map(N3),N3.set($,Z),Ts.emit("groupChange",{group:$,isUserInteraction:J?.isUserInteraction===!0,prev:H,next:Z})}function Cs($){let Z=FZ(),J=v7(),H=!1;switch(Z.state){case"active":pH({cursorFlags:0,state:"inactive"}),Z.hitRegions.length>0&&(kj($),H=!0,Z.hitRegions.forEach((B)=>{if(!J.has(B.group))return;let Q=h7(B.group.id,!0);s3(B.group,Q,{isUserInteraction:!0})}))}return H}function Xs($){$.defaultPrevented||Cs($.currentTarget)}function aW0($,Z,J){let H,B={x:1/0,y:1/0};for(let Q of Z){let X=Ls(J,Q.rect);switch($){case"horizontal":{X.x<=B.x&&(H=Q,B=X);break}case"vertical":{X.y<=B.y&&(H=Q,B=X);break}}}return H?{distance:B,hitRegion:H}:void 0}function oW0($){return $!==null&&typeof $=="object"&&"nodeType"in $&&$.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function nW0($,Z){if($===Z)throw Error("Cannot compare node with itself");let J={a:Us($),b:Us(Z)},H;for(;J.a.at(-1)===J.b.at(-1);)H=J.a.pop(),J.b.pop();O5(H,"Stacking order can only be calculated for elements with a common ancestor");let B={a:Gs(zs(J.a)),b:Gs(zs(J.b))};if(B.a===B.b){let Q=H.childNodes,X={a:J.a.at(-1),b:J.b.at(-1)},z=Q.length;for(;z--;){let G=Q[z];if(G===X.a)return 1;if(G===X.b)return-1}}return Math.sign(B.a-B.b)}var sW0=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function tW0($){let Z=getComputedStyle(Es($)??$).display;return Z==="flex"||Z==="inline-flex"}function eW0($){let Z=getComputedStyle($);return!!(Z.position==="fixed"||Z.zIndex!=="auto"&&(Z.position!=="static"||tW0($))||+Z.opacity<1||("transform"in Z)&&Z.transform!=="none"||("webkitTransform"in Z)&&Z.webkitTransform!=="none"||("mixBlendMode"in Z)&&Z.mixBlendMode!=="normal"||("filter"in Z)&&Z.filter!=="none"||("webkitFilter"in Z)&&Z.webkitFilter!=="none"||("isolation"in Z)&&Z.isolation==="isolate"||sW0.test(Z.willChange)||Z.webkitOverflowScrolling==="touch")}function zs($){let Z=$.length;for(;Z--;){let J=$[Z];if(O5(J,"Missing node"),eW0(J))return J}return null}function Gs($){return $&&Number(getComputedStyle($).zIndex)||0}function Us($){let Z=[];for(;$;)Z.push($),$=Es($);return Z}function Es($){let{parentNode:Z}=$;return oW0(Z)?Z.host:Z}function $q0($,Z){return $.x<Z.x+Z.width&&$.x+$.width>Z.x&&$.y<Z.y+Z.height&&$.y+$.height>Z.y}function Zq0({groupElement:$,hitRegion:Z,pointerEventTarget:J}){if(!Vs(J)||J.contains($)||$.contains(J))return!0;if(nW0(J,$)>0){let H=J;for(;H;){if(H.contains($))return!0;if($q0(H.getBoundingClientRect(),Z))return!1;H=H.parentElement}}return!0}function yj($,Z){let J=[];return Z.forEach((H,B)=>{if(B.disabled)return;let Q=Ms(B),X=aW0(B.orientation,Q,{x:$.clientX,y:$.clientY});X&&X.distance.x<=0&&X.distance.y<=0&&Zq0({groupElement:B.element,hitRegion:X.hitRegion.rect,pointerEventTarget:$.target})&&J.push(X.hitRegion)}),J}function Jq0($,Z){if($.length!==Z.length)return!1;for(let J=0;J<$.length;J++)if($[J]!=Z[J])return!1;return!0}function M4($,Z,J=0){return Math.abs(x4($)-x4(Z))<=J}function q3($,Z){return M4($,Z)?0:$>Z?1:-1}function mH({overrideDisabledPanels:$,panelConstraints:Z,prevSize:J,size:H}){let{collapsedSize:B=0,collapsible:Q,disabled:X,maxSize:z=100,minSize:G=0}=Z;if(X&&!$)return J;if(q3(H,G)<0)if(Q){let U=(B+G)/2;q3(H,U)<0?H=B:H=G}else H=G;return H=Math.min(z,H),H=x4(H),H}function rX({delta:$,initialLayout:Z,panelConstraints:J,pivotIndices:H,prevLayout:B,trigger:Q}){if(M4($,0))return Z;let X=Q==="imperative-api",z=Object.values(Z),G=Object.values(B),U=[...z],[Y,K]=H;O5(Y!=null,"Invalid first pivot index"),O5(K!=null,"Invalid second pivot index");let F=0;switch(Q){case"keyboard":{{let N=$<0?K:Y,D=J[N];O5(D,`Panel constraints not found for index ${N}`);let{collapsedSize:A=0,collapsible:V,minSize:L=0}=D;if(V){let j=z[N];if(O5(j!=null,`Previous layout not found for panel index ${N}`),M4(j,A)){let M=L-j;q3(M,Math.abs($))>0&&($=$<0?0-M:M)}}}{let N=$<0?Y:K,D=J[N];O5(D,`No panel constraints found for index ${N}`);let{collapsedSize:A=0,collapsible:V,minSize:L=0}=D;if(V){let j=z[N];if(O5(j!=null,`Previous layout not found for panel index ${N}`),M4(j,L)){let M=j-A;q3(M,Math.abs($))>0&&($=$<0?0-M:M)}}}break}default:{let N=$<0?K:Y,D=J[N];O5(D,`Panel constraints not found for index ${N}`);let A=z[N],{collapsible:V,collapsedSize:L,minSize:j}=D;if(V&&q3(A,j)<0)if($>0){let M=j-L,_=M/2,w=A+$;q3(w,j)<0&&($=q3($,_)<=0?0:M)}else{let M=j-L,_=100-M/2,w=A-$;q3(w,j)<0&&($=q3(100+$,_)>0?0:-M)}break}}{let N=$<0?1:-1,D=$<0?K:Y,A=0;for(;;){let L=z[D];O5(L!=null,`Previous layout not found for panel index ${D}`);let j=mH({overrideDisabledPanels:X,panelConstraints:J[D],prevSize:L,size:100})-L;if(A+=j,D+=N,D<0||D>=J.length)break}let V=Math.min(Math.abs($),Math.abs(A));$=$<0?0-V:V}{let N=$<0?Y:K;for(;N>=0&&N<J.length;){let D=Math.abs($)-Math.abs(F),A=z[N];O5(A!=null,`Previous layout not found for panel index ${N}`);let V=A-D,L=mH({overrideDisabledPanels:X,panelConstraints:J[N],prevSize:A,size:V});if(!M4(A,L)&&(F+=A-L,U[N]=L,F.toFixed(3).localeCompare(Math.abs($).toFixed(3),void 0,{numeric:!0})>=0))break;$<0?N--:N++}}if(Jq0(G,U))return B;{let N=$<0?K:Y,D=z[N];O5(D!=null,`Previous layout not found for panel index ${N}`);let A=D+F,V=mH({overrideDisabledPanels:X,panelConstraints:J[N],prevSize:D,size:A});if(U[N]=V,!M4(V,A)){let L=A-V,j=$<0?K:Y;for(;j>=0&&j<J.length;){let M=U[j];O5(M!=null,`Previous layout not found for panel index ${j}`);let _=M+L,w=mH({overrideDisabledPanels:X,panelConstraints:J[j],prevSize:M,size:_});if(M4(M,w)||(L-=w-M,U[j]=w),M4(L,0))break;$>0?j--:j++}}}let W=Object.values(U).reduce((N,D)=>D+N,0);if(!M4(W,100,0.1))return B;let q=Object.keys(B);return U.reduce((N,D,A)=>(N[q[A]]=D,N),{})}function WZ($,Z){if(Object.keys($).length!==Object.keys(Z).length)return!1;for(let J in $)if(Z[J]===void 0||q3($[J],Z[J])!==0)return!1;return!0}function qZ({layout:$,panelConstraints:Z}){let J=Object.values($),H=[...J],B=H.reduce((z,G)=>z+G,0);if(H.length!==Z.length)throw Error(`Invalid ${Z.length} panel layout: ${H.map((z)=>`${z}%`).join(", ")}`);if(!M4(B,100)&&H.length>0)for(let z=0;z<Z.length;z++){let G=H[z];O5(G!=null,`No layout data found for index ${z}`);let U=100/B*G;H[z]=U}let Q=0;for(let z=0;z<Z.length;z++){let G=J[z];O5(G!=null,`No layout data found for index ${z}`);let U=H[z];O5(U!=null,`No layout data found for index ${z}`);let Y=mH({overrideDisabledPanels:!0,panelConstraints:Z[z],prevSize:G,size:U});U!=Y&&(Q+=U-Y,H[z]=Y)}if(!M4(Q,0))for(let z=0;z<Z.length;z++){let G=H[z];O5(G!=null,`No layout data found for index ${z}`);let U=G+Q,Y=mH({overrideDisabledPanels:!0,panelConstraints:Z[z],prevSize:G,size:U});if(G!==Y&&(Q-=Y-G,H[z]=Y,M4(Q,0)))break}let X=Object.keys($);return H.reduce((z,G,U)=>(z[X[U]]=G,z),{})}function bs({groupId:$,panelId:Z}){let J=()=>{let G=v7();for(let[U,{defaultLayoutDeferred:Y,derivedPanelConstraints:K,layout:F,groupSize:W,separatorToPanels:q}]of G)if(U.id===$)return{defaultLayoutDeferred:Y,derivedPanelConstraints:K,group:U,groupSize:W,layout:F,separatorToPanels:q};throw Error(`Group ${$} not found`)},H=()=>{let G=J().derivedPanelConstraints.find((U)=>U.panelId===Z);if(G!==void 0)return G;throw Error(`Panel constraints not found for Panel ${Z}`)},B=()=>{let G=J().group.panels.find((U)=>U.id===Z);if(G!==void 0)return G;throw Error(`Layout not found for Panel ${Z}`)},Q=()=>{let G=J().layout[Z];if(G!==void 0)return G;throw Error(`Layout not found for Panel ${Z}`)},X=({nextSize:G,panels:U,prevLayout:Y,derivedPanelConstraints:K})=>{let F=Q(),W=U.findIndex((D)=>D.id===Z),q=W===0,N=W===U.length-1;if(N&&G<F&&(q||U.slice(0,W).every((D,A)=>{let V=K[A];return V?.collapsible&&M4(V.collapsedSize,Y[V.panelId])}))){let D=U.slice(0,W).reduce((A,V)=>A+Y[V.id],0);return{...Y,[Z]:x4(100-D)}}return rX({delta:N?F-G:G-F,initialLayout:Y,panelConstraints:K,pivotIndices:N?[W-1,W]:[W,W+1],prevLayout:Y,trigger:"imperative-api"})},z=(G)=>{let U=Q();if(G===U)return;let{defaultLayoutDeferred:Y,derivedPanelConstraints:K,group:F,groupSize:W,layout:q,separatorToPanels:N}=J(),D=X({nextSize:G,panels:F.panels,prevLayout:q,derivedPanelConstraints:K}),A=qZ({layout:D,panelConstraints:K});WZ(q,A)||s3(F,{defaultLayoutDeferred:Y,derivedPanelConstraints:K,groupSize:W,layout:A,separatorToPanels:N})};return{collapse:()=>{let{collapsible:G,collapsedSize:U}=H(),{mutableValues:Y}=B(),K=Q();G&&K!==U&&(Y.expandToSize=K,z(U))},expand:()=>{let{collapsible:G,collapsedSize:U,minSize:Y}=H(),{mutableValues:K}=B(),F=Q();if(G&&F===U){let W=K.expandToSize??Y;W===0&&(W=1),z(W)}},getSize:()=>{let{group:G}=J(),U=Q(),{element:Y}=B(),K=G.orientation==="horizontal"?Y.offsetWidth:Y.offsetHeight;return{asPercentage:U,inPixels:K}},isCollapsed:()=>{let{collapsible:G,collapsedSize:U}=H(),Y=Q();return G&&M4(U,Y)},resize:(G)=>{let{group:U}=J(),{element:Y}=B(),K=dH({group:U}),F=lX({groupSize:K,panelElement:Y,styleProp:G}),W=x4(F/K*100);z(W)}}}function Ys($){if($.defaultPrevented)return;let Z=v7();yj($,Z).forEach((J)=>{if(J.separator&&!J.separator.disableDoubleClick){let H=J.panels.find((B)=>B.panelConstraints.defaultSize!==void 0);if(H){let B=H.panelConstraints.defaultSize,Q=bs({groupId:J.group.id,panelId:H.id});Q&&B!==void 0&&(Q.resize(B),$.preventDefault())}}})}function JN($){let Z=v7();for(let[J]of Z)if(J.separators.some((H)=>H.element===$))return J;throw Error("Could not find parent Group for separator element")}function ws({groupId:$}){let Z=()=>{let J=v7();for(let[H,B]of J)if(H.id===$)return{group:H,...B};throw Error(`Could not find Group with id "${$}"`)};return{getLayout(){let{defaultLayoutDeferred:J,layout:H}=Z();return J?{}:H},setLayout(J){let{defaultLayoutDeferred:H,derivedPanelConstraints:B,group:Q,groupSize:X,layout:z,separatorToPanels:G}=Z(),U=qZ({layout:J,panelConstraints:B});return H?z:(WZ(z,U)||s3(Q,{defaultLayoutDeferred:H,derivedPanelConstraints:B,groupSize:X,layout:U,separatorToPanels:G}),U)}}}function KZ($,Z){let J=JN($),H=h7(J.id,!0),B=J.separators.find((Y)=>Y.element===$);O5(B,"Matching separator not found");let Q=H.separatorToPanels.get(B);O5(Q,"Matching panels not found");let X=Q.map((Y)=>J.panels.indexOf(Y)),z=ws({groupId:J.id}).getLayout(),G=rX({delta:Z,initialLayout:z,panelConstraints:H.derivedPanelConstraints,pivotIndices:X,prevLayout:z,trigger:"keyboard"}),U=qZ({layout:G,panelConstraints:H.derivedPanelConstraints});WZ(z,U)||s3(J,{defaultLayoutDeferred:H.defaultLayoutDeferred,derivedPanelConstraints:H.derivedPanelConstraints,groupSize:H.groupSize,layout:U,separatorToPanels:H.separatorToPanels},{isUserInteraction:!0})}function Ks($){if($.defaultPrevented)return;let Z=$.currentTarget,J=JN(Z);if(!J.disabled)switch($.key){case"ArrowDown":{$.preventDefault(),J.orientation==="vertical"&&KZ(Z,5);break}case"ArrowLeft":{$.preventDefault(),J.orientation==="horizontal"&&KZ(Z,-5);break}case"ArrowRight":{$.preventDefault(),J.orientation==="horizontal"&&KZ(Z,5);break}case"ArrowUp":{$.preventDefault(),J.orientation==="vertical"&&KZ(Z,-5);break}case"End":{$.preventDefault(),KZ(Z,100);break}case"Enter":{$.preventDefault();let H=JN(Z),B=h7(H.id,!0),{derivedPanelConstraints:Q,layout:X,separatorToPanels:z}=B,G=H.separators.find((F)=>F.element===Z);O5(G,"Matching separator not found");let U=z.get(G);O5(U,"Matching panels not found");let Y=U[0],K=Q.find((F)=>F.panelId===Y.id);if(O5(K,"Panel metadata not found"),K.collapsible){let F=X[Y.id],W=K.collapsedSize===F?H.mutableState.expandedPanelSizes[Y.id]??K.minSize:K.collapsedSize;KZ(Z,W-F)}break}case"F6":{$.preventDefault();let H=JN(Z).separators.map((X)=>X.element),B=Array.from(H).findIndex((X)=>X===$.currentTarget);O5(B!==null,"Index not found");let Q=$.shiftKey?B>0?B-1:H.length-1:B+1<H.length?B+1:0;H[Q].focus({preventScroll:!0});break}case"Home":{$.preventDefault(),KZ(Z,-100);break}}}function Fs($){if($.defaultPrevented)return;if($.pointerType==="mouse"&&$.button>0)return;let Z=v7(),J=yj($,Z),H=new Map,B=!1;J.forEach((Q)=>{Q.separator&&(B||(B=!0,Q.separator.element.focus({focusVisible:!1,preventScroll:!0})));let X=Z.get(Q.group);X&&H.set(Q.group,X.layout)}),pH({cursorFlags:0,hitRegions:J,initialLayoutMap:H,pointerDownAtPoint:{x:$.clientX,y:$.clientY},state:"active"}),J.length&&$.preventDefault()}function Ss({document:$,event:Z,hitRegions:J,initialLayoutMap:H,mountedGroups:B,pointerDownAtPoint:Q,prevCursorFlags:X}){let z=0;J.forEach((U)=>{let{group:Y,groupSize:K}=U,{orientation:F,panels:W}=Y,{disableCursor:q}=Y.mutableState,N=0;Q?F==="horizontal"?N=(Z.clientX-Q.x)/K*100:N=(Z.clientY-Q.y)/K*100:F==="horizontal"?N=Z.clientX<0?-100:100:N=Z.clientY<0?-100:100;let D=H.get(Y),A=B.get(Y);if(!D||!A)return;let{defaultLayoutDeferred:V,derivedPanelConstraints:L,groupSize:j,layout:M,separatorToPanels:_}=A;if(L&&M&&_){let w=rX({delta:N,initialLayout:D,panelConstraints:L,pivotIndices:U.panels.map((T)=>W.indexOf(T)),prevLayout:M,trigger:"mouse-or-touch"});if(WZ(w,M)){if(N!==0&&!q)switch(F){case"horizontal":{z|=N<0?Ps:_s;break}case"vertical":{z|=N<0?js:Os;break}}}else s3(U.group,{defaultLayoutDeferred:V,derivedPanelConstraints:L,groupSize:j,layout:w,separatorToPanels:_})}});let G=0;Z.movementX===0?G|=X&Zs:G|=z&Zs,Z.movementY===0?G|=X&Js:G|=z&Js,dW0(G),kj($)}function Ws($){let Z=v7(),J=FZ();switch(J.state){case"active":Ss({document:$.currentTarget,event:$,hitRegions:J.hitRegions,initialLayoutMap:J.initialLayoutMap,mountedGroups:Z,prevCursorFlags:J.cursorFlags})}}function qs($){if($.defaultPrevented)return;let Z=FZ(),J=v7();switch(Z.state){case"active":{if($.buttons===0){pH({cursorFlags:0,state:"inactive"}),Z.hitRegions.forEach((H)=>{if(!J.has(H.group))return;let B=h7(H.group.id,!0);s3(H.group,B,{isUserInteraction:!0})});return}for(let H of Z.hitRegions)if(H.separator){let{element:B}=H.separator;B.isConnected&&!B.hasPointerCapture?.($.pointerId)&&B.setPointerCapture?.($.pointerId)}Ss({document:$.currentTarget,event:$,hitRegions:Z.hitRegions,initialLayoutMap:Z.initialLayoutMap,mountedGroups:J,pointerDownAtPoint:Z.pointerDownAtPoint,prevCursorFlags:Z.cursorFlags});break}default:{let H=yj($,J);H.length===0?Z.state!=="inactive"&&pH({cursorFlags:0,state:"inactive"}):pH({cursorFlags:0,hitRegions:H,state:"hover"}),kj($.currentTarget);break}}}function Ns($){if($.relatedTarget instanceof HTMLIFrameElement)switch(FZ().state){case"hover":pH({cursorFlags:0,state:"inactive"})}}function As($){if($.defaultPrevented)return;if($.pointerType==="mouse"&&$.button>0)return;Cs($.currentTarget)&&$.preventDefault()}function Ds($){let Z=0,J=0,H={};for(let Q of $)if(Q.defaultSize!==void 0){Z++;let X=x4(Q.defaultSize);J+=X,H[Q.panelId]=X}else H[Q.panelId]=void 0;let B=$.length-Z;if(B!==0){let Q=x4((100-J)/B);for(let X of $)X.defaultSize===void 0&&(H[X.panelId]=Q)}return H}function Hq0($,Z,J){if(!J[0])return;let H=$.panels.find((G)=>G.element===Z);if(!H||!H.onResize)return;let B=dH({group:$}),Q=$.orientation==="horizontal"?H.element.offsetWidth:H.element.offsetHeight,X=H.mutableValues.prevSize,z={asPercentage:x4(Q/B*100),inPixels:Q};H.mutableValues.prevSize=z,H.onResize(z,H.id,X)}function Bq0($,Z){if(Object.keys($).length!==Object.keys(Z).length)return!1;for(let J in $)if($[J]!==Z[J])return!1;return!0}function Qq0($,Z){return $.length!==Z.length?!1:$.every((J,H)=>Bq0(J,Z[H]))}function Xq0({group:$,nextGroupSize:Z,prevGroupSize:J,prevLayout:H}){if(J<=0||Z<=0||J===Z)return H;let B=0,Q=0,X=!1,z=new Map,G=[];for(let K of $.panels){let F=H[K.id]??0;switch(K.panelConstraints.groupResizeBehavior){case"preserve-pixel-size":{X=!0;let W=F/100*J,q=x4(W/Z*100);z.set(K.id,q),B+=q;break}case"preserve-relative-size":default:{G.push(K.id),Q+=F;break}}}if(!X||G.length===0)return H;let U=100-B,Y={...H};if(z.forEach((K,F)=>{Y[F]=K}),Q>0)for(let K of G){let F=H[K]??0;Y[K]=x4(F/Q*U)}else{let K=x4(U/G.length);for(let F of G)Y[F]=K}return Y}function zq0($,Z){let J=$.map((B)=>B.id),H=Object.keys(Z);if(J.length!==H.length)return!1;for(let B of J)if(!H.includes(B))return!1;return!0}var fH=new Map;function Gq0($){let Z=!0;O5($.element.ownerDocument.defaultView,"Cannot register an unmounted Group");let J=$.element.ownerDocument.defaultView.ResizeObserver,H=new Set,B=new Set,Q=new J((q)=>{for(let N of q){let{borderBoxSize:D,target:A}=N;if(A===$.element){if(Z){let V=dH({group:$});if(V===0)return;let L=h7($.id);if(!L)return;let j=bj($),M=L.defaultLayoutDeferred?Ds(j):L.layout,_=Xq0({group:$,nextGroupSize:V,prevGroupSize:L.groupSize,prevLayout:M}),w=qZ({layout:_,panelConstraints:j});if(!L.defaultLayoutDeferred&&WZ(L.layout,w)&&Qq0(L.derivedPanelConstraints,j)&&L.groupSize===V)continue;s3($,{defaultLayoutDeferred:!1,derivedPanelConstraints:j,groupSize:V,layout:w,separatorToPanels:L.separatorToPanels})}}else Hq0($,A,D)}});Q.observe($.element),$.panels.forEach((q)=>{O5(!H.has(q.id),`Panel ids must be unique; id "${q.id}" was used more than once`),H.add(q.id),q.onResize&&Q.observe(q.element)});let X=dH({group:$}),z=bj($),G=$.panels.map(({id:q})=>q).join(","),U=$.mutableState.defaultLayout;U&&(zq0($.panels,U)||(U=void 0));let Y=$.mutableState.layouts[G]??U??Ds(z),K=qZ({layout:Y,panelConstraints:z}),F=$.element.ownerDocument;fH.set(F,(fH.get(F)??0)+1);let W=new Map;return Ms($).forEach((q)=>{q.separator&&W.set(q.separator,q.panels)}),s3($,{defaultLayoutDeferred:X===0,derivedPanelConstraints:z,groupSize:X,layout:K,separatorToPanels:W}),$.separators.forEach((q)=>{O5(!B.has(q.id),`Separator ids must be unique; id "${q.id}" was used more than once`),B.add(q.id),q.element.addEventListener("keydown",Ks)}),fH.get(F)===1&&(F.addEventListener("contextmenu",Xs,!0),F.addEventListener("dblclick",Ys,!0),F.addEventListener("pointerdown",Fs,!0),F.addEventListener("pointerleave",Ws),F.addEventListener("pointermove",qs),F.addEventListener("pointerout",Ns),F.addEventListener("pointerup",As,!0)),function(){Z=!1,fH.set(F,Math.max(0,(fH.get(F)??0)-1)),rW0($),$.separators.forEach((q)=>{q.element.removeEventListener("keydown",Ks)}),fH.get(F)||(F.removeEventListener("contextmenu",Xs,!0),F.removeEventListener("dblclick",Ys,!0),F.removeEventListener("pointerdown",Fs,!0),F.removeEventListener("pointerleave",Ws),F.removeEventListener("pointermove",qs),F.removeEventListener("pointerout",Ns),F.removeEventListener("pointerup",As,!0)),Q.disconnect()}}function Uq0(){let[$,Z]=R1.useState({}),J=R1.useCallback(()=>Z({}),[]);return[$,J]}function xj($){let Z=R1.useId();return`${$??Z}`}var NZ=typeof window<"u"?R1.useLayoutEffect:R1.useEffect;function iX($){let Z=R1.useRef($);return NZ(()=>{Z.current=$},[$]),R1.useCallback((...J)=>Z.current?.(...J),[Z])}function hj(...$){return iX((Z)=>{$.forEach((J)=>{if(J)switch(typeof J){case"function":{J(Z);break}case"object":{J.current=Z;break}}})})}function vj($){let Z=R1.useRef({...$});return NZ(()=>{for(let J in $)Z.current[J]=$[J]},[$]),Z.current}var Rs=R1.createContext(null);function Yq0($,Z){let J=R1.useRef({getLayout:()=>({}),setLayout:lW0});R1.useImperativeHandle(Z,()=>J.current,[]),NZ(()=>{Object.assign(J.current,ws({groupId:$}))})}function gj({children:$,className:Z,defaultLayout:J,disableCursor:H,disabled:B,elementRef:Q,groupRef:X,id:z,onLayoutChange:G,onLayoutChanged:U,orientation:Y="horizontal",resizeTargetMinimumSize:K={coarse:20,fine:10},style:F,...W}){let q=R1.useRef({onLayoutChange:{},onLayoutChanged:{}}),N=iX((k)=>{WZ(q.current.onLayoutChange,k)||(q.current.onLayoutChange=k,G?.(k))}),D=iX((k,S)=>{WZ(q.current.onLayoutChanged,k)||(q.current.onLayoutChanged=k,U?.(k,{isUserInteraction:S}))}),A=xj(z),V=R1.useRef(null),[L,j]=Uq0(),M=R1.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:K,separators:[]}),_=hj(V,Q);Yq0(A,X);let w=iX((k,S)=>{let R=FZ(),O=Qs(k),y=h7(k);if(y){let I=!1;switch(R.state){case"active":{I=R.hitRegions.some((x)=>x.group===O);break}}return{flexGrow:y.layout[S]??1,pointerEvents:I?"none":void 0}}if(J?.[S])return{flexGrow:J?.[S]}}),T=vj({defaultLayout:J,disableCursor:H}),b=R1.useMemo(()=>({get disableCursor(){return!!T.disableCursor},getPanelStyles:w,id:A,orientation:Y,registerPanel:(k)=>{let S=M.current;return S.panels=wj(Y,[...S.panels,k]),j(),()=>{S.panels=S.panels.filter((R)=>R!==k),j()}},registerSeparator:(k)=>{let S=M.current;return S.separators=wj(Y,[...S.separators,k]),j(),()=>{S.separators=S.separators.filter((R)=>R!==k),j()}},updatePanelProps:(k,{disabled:S})=>{let R=M.current.panels.find((I)=>I.id===k);R&&(R.panelConstraints.disabled=S);let O=Qs(A),y=h7(A);O&&y&&s3(O,{...y,derivedPanelConstraints:bj(O)})},updateSeparatorProps:(k,{disabled:S,disableDoubleClick:R})=>{let O=M.current.separators.find((y)=>y.id===k);O&&(O.disabled=S,O.disableDoubleClick=R)}}),[w,A,j,Y,T]),C=R1.useRef(null);return NZ(()=>{let k=V.current;if(k===null)return;let S=M.current,R;if(T.defaultLayout!==void 0&&Object.keys(T.defaultLayout).length===S.panels.length){R={};for(let E of S.panels){let l=T.defaultLayout[E.id];l!==void 0&&(R[E.id]=l)}}let O={disabled:!!B,element:k,id:A,mutableState:{defaultLayout:R,disableCursor:!!T.disableCursor,expandedPanelSizes:M.current.lastExpandedPanelSizes,layouts:M.current.layouts},orientation:Y,panels:S.panels,resizeTargetMinimumSize:S.resizeTargetMinimumSize,separators:S.separators};C.current=O;let y=Gq0(O),{defaultLayoutDeferred:I,derivedPanelConstraints:x,layout:v}=h7(O.id,!0);!I&&x.length>0&&(N(v),D(v,!1));let g=Ij(A,(E)=>{let{defaultLayoutDeferred:l,derivedPanelConstraints:r,layout:h}=E.next;if(l||r.length===0)return;let d=O.panels.map(({id:p})=>p).join(",");O.mutableState.layouts[d]=h,r.forEach((p)=>{if(p.collapsible){let{layout:i}=E.prev??{};if(i){let n=M4(p.collapsedSize,h[p.panelId]),Z0=M4(p.collapsedSize,i[p.panelId]);n&&!Z0&&(O.mutableState.expandedPanelSizes[p.panelId]=i[p.panelId])}}});let o=FZ().state!=="active";N(h),o&&D(h,E.isUserInteraction)});return()=>{C.current=null,y(),g()}},[B,A,D,N,Y,L,T]),R1.useEffect(()=>{let k=C.current;k&&(k.mutableState.defaultLayout=J,k.mutableState.disableCursor=!!H)}),cH.jsx(Rs.Provider,{value:b,children:cH.jsx("div",{...W,className:Z,"data-group":!0,"data-testid":A,id:A,ref:_,style:{height:"100%",width:"100%",overflow:"hidden",...F,display:"flex",flexDirection:Y==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:Y==="horizontal"?"pan-y":"pan-x"},children:$})})}gj.displayName="Group";function fj(){let $=R1.useContext(Rs);return O5($,"Group Context not found; did you render a Panel or Separator outside of a Group?"),$}function Kq0($,Z){let{id:J}=fj(),H=R1.useRef({collapse:Ej,expand:Ej,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Ej});R1.useImperativeHandle(Z,()=>H.current,[]),NZ(()=>{Object.assign(H.current,bs({groupId:J,panelId:$}))})}function mj({children:$,className:Z,collapsedSize:J="0%",collapsible:H=!1,defaultSize:B,disabled:Q,elementRef:X,groupResizeBehavior:z="preserve-relative-size",id:G,maxSize:U="100%",minSize:Y="0%",onResize:K,panelRef:F,style:W,...q}){let N=!!G,D=xj(G),A=vj({disabled:Q}),V=R1.useRef(null),L=hj(V,X),{getPanelStyles:j,id:M,orientation:_,registerPanel:w,updatePanelProps:T}=fj(),b=K!==null,C=iX((O,y,I)=>{K?.(O,G,I)});NZ(()=>{let O=V.current;if(O!==null){let y={element:O,id:D,idIsStable:N,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:b?C:void 0,panelConstraints:{groupResizeBehavior:z,collapsedSize:J,collapsible:H,defaultSize:B,disabled:A.disabled,maxSize:U,minSize:Y}};return w(y)}},[z,J,H,B,b,D,N,U,Y,C,w,A]),R1.useEffect(()=>{T(D,{disabled:Q})},[Q,D,T]),Kq0(D,F);let k=()=>{let O=j(M,D);if(O)return JSON.stringify(O)},S=R1.useSyncExternalStore((O)=>Ij(M,O),k,k),R;return S?R=JSON.parse(S):B!==void 0?R={flexGrow:void 0,flexShrink:void 0,flexBasis:B}:R={flexGrow:1},cH.jsx("div",{...q,"data-disabled":Q||void 0,"data-panel":!0,"data-testid":D,id:D,ref:L,style:{...Fq0,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...R},children:cH.jsx("div",{className:Z,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...W,touchAction:_==="horizontal"?"pan-y":"pan-x"},children:$})})}mj.displayName="Panel";var Fq0={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function Wq0({layout:$,panelConstraints:Z,panelId:J,panelIndex:H}){let B,Q,X=$[J],z=Z.find((G)=>G.panelId===J);if(z){let G=z.maxSize,U=z.collapsible?z.collapsedSize:z.minSize,Y=[H,H+1];Q=qZ({layout:rX({delta:U-X,initialLayout:$,panelConstraints:Z,pivotIndices:Y,prevLayout:$}),panelConstraints:Z})[J],B=qZ({layout:rX({delta:G-X,initialLayout:$,panelConstraints:Z,pivotIndices:Y,prevLayout:$}),panelConstraints:Z})[J]}return{valueControls:J,valueMax:B,valueMin:Q,valueNow:X}}function uj({children:$,className:Z,disabled:J,disableDoubleClick:H,elementRef:B,id:Q,style:X,...z}){let G=xj(Q),U=vj({disabled:J,disableDoubleClick:H}),[Y,K]=R1.useState({}),[F,W]=R1.useState("inactive"),[q,N]=R1.useState(!1),D=R1.useRef(null),A=hj(D,B),{disableCursor:V,id:L,orientation:j,registerSeparator:M,updateSeparatorProps:_}=fj(),w=j==="horizontal"?"vertical":"horizontal";NZ(()=>{let C=D.current;if(C!==null){let k={disabled:U.disabled,disableDoubleClick:U.disableDoubleClick,element:C,id:G},S=M(k),R=cW0((y)=>{W(y.next.state!=="inactive"&&y.next.hitRegions.some((I)=>I.separator===k)?y.next.state:"inactive")}),O=Ij(L,(y)=>{let{derivedPanelConstraints:I,layout:x,separatorToPanels:v}=y.next,g=v.get(k);if(g){let E=g[0],l=I.findIndex((r)=>r.panelId===E.id);K(Wq0({layout:x,panelConstraints:I,panelId:E.id,panelIndex:l}))}});return()=>{R(),O(),S()}}},[L,G,M,U]),R1.useEffect(()=>{_(G,{disabled:J,disableDoubleClick:H})},[J,H,G,_]);let T;J&&!V&&(T="not-allowed");let b;if(J)b="disabled";else switch(F){case"active":{b="active";break}default:q?b="focus":b=F}return cH.jsx("div",{...z,"aria-controls":Y.valueControls,"aria-disabled":J||void 0,"aria-orientation":w,"aria-valuemax":Y.valueMax,"aria-valuemin":Y.valueMin,"aria-valuenow":Y.valueNow,children:$,className:Z,"data-separator":b,"data-testid":G,id:G,onBlur:()=>N(!1),onFocus:()=>N(!0),ref:A,role:"separator",style:{flexBasis:"auto",cursor:T,...X,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:J?void 0:0})}uj.displayName="Separator";var HN=P(c(),1);function ks({className:$,...Z}){return HN.jsx(gj,{"data-slot":"resizable-panel-group",className:o0("flex h-full w-full aria-[orientation=vertical]:flex-col",$),...Z})}function pj({...$}){return HN.jsx(mj,{"data-slot":"resizable-panel",...$})}function Is({showDivider:$=!0,className:Z,...J}){return HN.jsx(uj,{"data-slot":"resizable-handle",className:o0("relative flex items-center justify-center ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2",$?"w-px bg-border aria-[orientation=horizontal]:h-px":"w-0 aria-[orientation=horizontal]:h-0",Z),...J})}var g7=P(c(),1);function ys({workspace:$,chat:Z,open:J,workspaceMinWidth:H,chatMinWidth:B,chatMaxWidth:Q,chatWidth:X,onCollapse:z,onChatWidthChange:G}){let U=f7.useRef(null),Y=f7.useRef(null),[K,F]=f7.useState(!1),W=Math.min(Math.max(X,B),Q),[q]=f7.useState(()=>J?W:0);return f7.useLayoutEffect(()=>{let N=U.current;if(!N)return;if(J)N.resize(W);else N.collapse()},[W,J]),g7.jsxs(ks,{orientation:"horizontal",className:X0("overflow-visible!",K&&"[&>#chat]:transition-[flex-grow] [&>#chat]:duration-200 [&>#chat]:ease-in-out motion-reduce:[&>#chat]:transition-none!",K&&"has-[[data-separator=active]]:[&>#chat]:transition-none!"),onLayoutChanged:(N,D)=>{if(!K&&Y.current===null)Y.current=requestAnimationFrame(()=>{F(!0)});if(D.isUserInteraction)requestAnimationFrame(()=>{let A=U.current;if(!A)return;let V=A.getSize();if(V.inPixels>0)G(Math.round(V.inPixels))})},children:[g7.jsx(pj,{id:"workspace",className:"overflow-visible!",minSize:H,children:g7.jsx("div",{"data-slot":"workspace-split-workspace",className:"flex h-full min-h-0 min-w-0 flex-col",children:$})}),g7.jsx(Is,{"aria-label":"Resize chat",showDivider:!1,hidden:!J,disabled:!J}),g7.jsx(pj,{id:"chat","aria-hidden":!J,inert:!J,collapsible:!0,collapsedSize:0,defaultSize:q,minSize:B,maxSize:Q,groupResizeBehavior:"preserve-pixel-size",panelRef:U,onResize:(N,D,A)=>{if(J&&N.inPixels===0&&A&&A.inPixels>0)z()},className:X0("overflow-hidden!",K&&"transition-opacity duration-200 ease-in-out motion-reduce:transition-none",J?"opacity-100":"opacity-0"),children:g7.jsx("div",{"data-slot":"workspace-split-chat",className:"flex h-full min-h-0 min-w-(--chat-min) flex-col",children:Z})})]})}var AZ=P(c(),1);function xs({onOpenOverview:$}){return AZ.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 p-6 text-center",children:[AZ.jsxs("div",{className:"flex flex-col items-center justify-center gap-2",children:[AZ.jsx(wF,{size:56,stroke:0.5,"aria-hidden":!0}),AZ.jsx("p",{className:"text-sm",children:"There's no such page in this workspace"})]}),AZ.jsx(P0,{variant:"secondary",onClick:$,children:"Back to overview"})]})}var U5=P(c(),1),Nq0=o2.lazy(()=>import("/chunk-hzwr8dp8.js").then(($)=>({default:$.Scratchpad})));function hs($,Z,J,H){if($==="overview")return{key:$,Icon:SF,label:"Overview",closable:!1,reorderable:!1};if($==="scratchpad")return{key:$,Icon:mQ,label:"Scratchpad",closable:J};let B=lZ($),Q=B?Z.find((X)=>X.id===B):null;return Q?{key:$,Icon:EX(Q),label:CX(Q),closable:J||Q.status!=="compiled",loading:Q.status!=="compiled"&&!!Q.executionSessionId&&H(Q.executionSessionId)}:null}function fs({widgets:$,views:Z}){let{layout:J,setLayout:H,workspaceId:B}=m1(),Q=Q9(J.theme),X=Sn(),{ref:z,fits:G,constraints:U}=kn(),[Y,K]=o2.useState("idle"),[F,W]=o2.useState(!1),[q,N]=o2.useState(0),D=o2.useRef(new Map),A=S1((q0)=>q0.dockedChatWidth),V=S1((q0)=>q0.setDockedChatWidth),L=B4((q0)=>q0.activity),j=Z.filter((q0)=>q0.status==="compiled"),M=Z.filter((q0)=>q0.status!=="compiled"),_=IG(L,B),w=Rn({workspaceId:B,pendingViews:M,onSave:(q0,h0)=>X.save(q0,h0)});Jh(J.theme);let T=$.some((q0)=>!e9(q0.id)),b=T||j.length>0,k=J.layoutMode==="split"&&G?"split":"fullscreen",S=o2.useCallback(()=>{W(!0),N((q0)=>q0+1)},[]),{tabsState:R,activeTab:O,appletParams:y,navigateToTab:I,setTabs:x,isUnavailable:v,onNavigationClick:g}=tn({views:Z,onOpenChat:S}),{view:E,forkedFromSessionId:l,chatLoaded:r,previewTurn:h,sessionId:d,composerSessionId:o,processing:p,error:i,loadError:n,retryLoad:Z0,send:J0,stop:U0,selectSession:z0,dismissError:B0}=Ln({activeTab:O,appletParams:y}),{pinnedSessionId:N0}=k6(),{composerBanner:D0,viewDraftComposerBanner:F0,agentAvailability:s}=cn(B,{chatError:i,onDismissChatError:B0,chatLoadError:n,onRetryChatLoad:Z0}),a=eq(R,Z),e=new Set(R.open),$0=(q0)=>{H({layoutMode:q0})},Q0=a.length>1,_0=a.map((q0)=>hs(q0,Z,Q0,(h0)=>dZ(L,B,h0))).filter((q0)=>Boolean(q0)),M0=lZ(O),A0=M0?j.find((q0)=>q0.id===M0):void 0,L0=M0?M.find((q0)=>q0.id===M0):void 0,f=!N0&&d===null&&L0?.status==="draft"&&(!L0.executionSessionId||!dZ(L,B,L0.executionSessionId))?L0:void 0,u=f?.id,t=!N0&&L0?.status==="starting",W0=r&&!t,S0=Y==="idle"&&(O==="overview"&&T||A0!==void 0),{controls:p0,docked:g0,layerProps:T0,popup:d0,targetRef:Q1}=Hv({workspaceId:B,sessionId:o,activeTab:O,mode:k,available:S0,closePopup:()=>W(!1),openPopup:()=>W(!0)});o2.useEffect(()=>{if(R.open.filter((U1)=>n3(U1,Z)).length===R.open.length)return;let h0=eq(R,Z);x({open:h0,active:h0.includes(R.active)?R.active:h0[0]})},[Z,x,R]),o2.useEffect(()=>{if(k!=="fullscreen")W(!1)},[k]),o2.useEffect(()=>{if(!u)return;if(k==="fullscreen")W(!0);N((q0)=>q0+1)},[u,k]);let e0=I,c0=()=>{X.create().then((q0)=>e0(w5(q0.id)))},y0=(q0)=>{if(q0==="views"){let h0=j[0];if(h0)e0(w5(h0.id));else c0()}else e0(q0);W(!1)};N2((q0)=>{if(q0.type==="view:deleted"&&q0.workspaceId===B&&O===w5(q0.name))e0("overview")});let E1=async(q0)=>{let h0=D.current.get(q0.id);try{await X.discard(q0.id)}catch(U1){return r1.add({title:U1 instanceof Error?U1.message:"Couldn’t discard view",type:"error"}),!1}return await h0?.resetSketch(),w.clear(q0.id),!0},W1=(q0)=>{if(q0==="overview")return;let h0=lZ(q0),U1=h0?M.find((T1)=>T1.id===h0):void 0;if(!Q0&&!U1||!e.has(q0))return;let k0=R.open.filter((T1)=>T1!==q0);if(k0.length===0)k0=["overview"];let i0=a.indexOf(q0),l0=a[i0+1]??a[i0-1]??k0.find((T1)=>n3(T1,Z))??"overview",L1=R.active===q0||!k0.includes(R.active)?l0:R.active;if(x({open:k0,active:L1}),O===q0)I(l0);if(U1?.status==="draft")E1(U1)},Q5=async(q0)=>{if(!await E1(q0))return;let h0=w5(q0.id);if(!e.has(h0))return;let U1=R.open.filter((l0)=>l0!==h0);if(U1.length===0)U1=["overview"];let k0=U1.find((l0)=>n3(l0,Z))??"overview",i0=R.active===h0?k0:R.active;if(x({open:U1,active:i0}),O===h0)I(k0,{replace:!0})},C0=(q0)=>{x({open:q0,active:R.active})},x0=(q0)=>{if(q0!==void 0)S1.getState().setComposerDraft(b2(B,o),q0);if(k==="fullscreen"){if(W(!0),F)N((h0)=>h0+1);return}N((h0)=>h0+1)};Kn({sessionId:d,send:J0,revealChat:x0,agentAvailability:s}),Fn(o,x0);let r0=[...!e.has("scratchpad")?[{key:"scratchpad",Icon:mQ,label:"Scratchpad",onClick:()=>e0("scratchpad")}]:[],...Z.map((q0)=>({view:q0,tab:w5(q0.id)})).filter(({tab:q0})=>!e.has(q0)).map(({view:q0,tab:h0})=>({key:h0,Icon:EX(q0),label:CX(q0),onClick:()=>e0(h0)})),{key:"create-view",Icon:vs,label:"New view",onClick:c0}],n0=o2.useCallback(()=>{if(f)D.current.get(f.id)?.resetSketch()},[f]),D1=async(q0,h0)=>{if(L0?.status==="draft")await D.current.get(L0.id)?.prepareSketchForSend(),await X.submit(L0,q0),w.clear(L0.id);else await J0(q0,h0)},V1=f?{sessionId:q2(w5(f.id)),onRemoveDrawing:n0}:void 0,p1={agent:Q.agent,focusRequest:q,chatLoaded:W0,hasWorkspaceApplets:b,view:E,forkedFromSessionId:l,previewTurn:h,sessionId:d,processing:p,composerBanner:f?F0:D0,agentAvailability:s,send:D1,stop:U0,onNavigateFromWelcome:y0,viewDraft:V1},e1=U5.jsx(U_,{...p1,active:k==="split",onClose:()=>$0("fullscreen"),annotation:g0,docked:!0}),m0=U5.jsxs("div",{className:X0("@container/workspace relative flex h-full min-h-0 min-w-0 flex-1 flex-col-reverse overflow-hidden bg-background shadow-md transition-[border-radius,background-color] duration-100 ease-out motion-reduce:transition-none",k==="split"&&"rounded-xl"),children:[U5.jsxs("div",{className:"relative flex min-h-0 flex-1",children:[U5.jsxs("div",{ref:Q1,inert:p0.active||void 0,"aria-hidden":p0.active||void 0,className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background transition-colors duration-100 ease-out motion-reduce:transition-none",children:[v?U5.jsx(xs,{onOpenOverview:()=>e0("overview")}):O==="overview"?U5.jsx(Jn,{customizing:Y==="customizing",theming:Y==="theming",onThemingChange:(q0)=>K(q0?"theming":"idle"),onCustomizingChange:(q0)=>K(q0?"customizing":"idle"),widgets:$,views:j,onOpenView:(q0)=>e0(w5(q0)),onCreateView:c0,onCreateWidget:()=>{z0(null),x0("Create widget")}}):O==="scratchpad"?U5.jsx(o2.Suspense,{fallback:null,children:U5.jsx(Nq0,{})}):null,M.map((q0)=>U5.jsx(_n,{ref:(h0)=>{if(h0)D.current.set(q0.id,h0);else D.current.delete(q0.id)},active:!v&&L0?.id===q0.id,pendingView:q0,running:!!q0.executionSessionId&&dZ(L,B,q0.executionSessionId),sketchSessionId:q0.status==="draft"?N0??q2(w5(q0.id)):void 0,chatDocked:k==="split",workspaceId:B,onEditingStart:()=>{if(k==="fullscreen")W(!1)},onContinueInChat:x0,onOpenChat:()=>x0(),onDiscard:()=>Q5(q0)},q0.id)),U5.jsx(En,{views:j,activeViewId:v?null:A0?.id??null,params:y})]}),U5.jsx(kK,{...T0,children:U5.jsx(hK,{controls:p0,title:"Draw annotation",busy:p0.finishing,onComplete:()=>void p0.finish()})})]}),U5.jsx(E4,{children:Y==="theming"&&U5.jsx(Xr,{onClose:()=>K("idle")})}),U5.jsxs(Hn,{children:[U5.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-4",children:[U5.jsx(ln,{onOpenTheme:()=>K("theming")}),U5.jsx($s,{tabs:_0,active:O,createItems:r0,onSelect:e0,onClose:W1,onReorder:C0})]}),U5.jsx(OD,{workspaceId:B,describeTab:(q0)=>hs(q0,Z,!1,()=>!1),onOpenTab:e0}),G&&k==="fullscreen"&&U5.jsxs(a1,{children:[U5.jsx(o1,{render:U5.jsx(P0,{variant:"ghost",size:"icon-sm",onClick:()=>$0("split"),"aria-label":"Dock chat",className:"text-muted-foreground",children:U5.jsx(gs,{stroke:1.75})})}),U5.jsx(n1,{children:"Dock chat"})]})]})]});return U5.jsxs("div",{onClick:g,className:"relative flex h-full min-h-0 flex-col font-sans text-foreground",children:[U5.jsx("div",{ref:z,className:"flex min-h-0 flex-1",children:G&&U?U5.jsx(ys,{...U,workspace:m0,chat:e1,open:k==="split",chatWidth:A,onCollapse:()=>$0("fullscreen"),onChatWidthChange:V}):m0}),k==="fullscreen"&&U5.jsx(Qr,{agent:Q.agent,loading:_,open:F,onOpenChange:W,onOpenChangeComplete:(q0)=>{if(q0)N((h0)=>h0+1)},children:(q0)=>U5.jsx(U_,{...p1,active:F,onClose:q0,annotation:d0})})]})}var us=P(m(),1);var BN=P(m(),1);function Aq0($){return new Map($.map((Z)=>[Z.id,{w:Z.config.colSpan,h:Z.config.rowSpan}]))}function Dq0($,Z,J){let H=new Set($.map((Y)=>Y.i)),B=Z.filter((Y)=>{let K=J.get(Y.id);if(!K)return!H.has(Y.id);if(!H.has(Y.id))return!1;return K.w!==Y.config.colSpan||K.h!==Y.config.rowSpan});if(B.length===0)return null;let Q=new Set(B.map((Y)=>Y.id)),X=new Map(Z.map((Y)=>[Y.id,Y.config])),z=$.filter((Y)=>!Q.has(Y.i)&&X.has(Y.i)).map((Y)=>{let K=X.get(Y.i);return{...Y,w:K.colSpan,h:K.rowSpan}}),G=z.map(({i:Y,x:K,y:F})=>({i:Y,x:K,y:F})),U=[...z];for(let Y of B){let K=Lq(U,Y.config.colSpan,Y.config.rowSpan);G.push({i:Y.id,...K}),U.push({i:Y.id,...K,w:Y.config.colSpan,h:Y.config.rowSpan})}return G}function ms($,Z,J,H){let B=BN.useRef(null);BN.useEffect(()=>{if(!Z)return;let Q=Aq0(Z);if(B.current?.workspaceId!==$){B.current={workspaceId:$,sizes:Q};return}let X=Dq0(J.widgetGrid,Z,B.current.sizes);if(B.current={workspaceId:$,sizes:Q},X)H({widgetGrid:X})},[$,Z,J.widgetGrid,H])}function ps($){let{layout:Z,setLayout:J}=m1(),H=Y5({queryKey:j0.widgets($),queryFn:async()=>{return(await G1(`/api/workspaces/${$}/widgets`)).widgets},...G8}),B=us.useMemo(()=>mh(H.data??[]),[H.data]);return ms($,H.data?B:void 0,Z,J),{...H,data:B}}var t3=P(c(),1);function ds({id:$}){let{experimental:Z}=R8();return t3.jsx(cs,{id:$,children:t3.jsx(ih,{id:$,children:t3.jsx(HD,{workspaceId:$,enabled:Z.collab,children:t3.jsx(Vq0,{id:$})})})})}function Vq0({id:$}){let Z=p2(),J=X1(),[H]=I3(),{isLoading:B}=m1(),Q=ps($),X=Vq($);kh(),N2((G)=>{if(G.type==="theme:updated"||G.type==="workspace:updated")J.invalidateQueries({queryKey:j0.layout($)});else if(G.type==="widget-layout:updated"||G.type==="widget:updated")J.invalidateQueries({queryKey:j0.widgets($)});else if(G.type==="view-layout:updated"||G.type==="view:updated")J.invalidateQueries({queryKey:j0.views($)})});let z=B||H===void 0||Q.isLoading||X.isLoading;return t3.jsx(BK,{children:z?t3.jsx("div",{className:"flex h-full items-center justify-center",children:t3.jsx(qh,{sprite:"moi",effect:"chaos"})}):t3.jsx(fs,{widgets:Q.data,views:X.data??[]},Z?"browser-tab":"shared")})}var A3=P(c(),1),ls=null;function Lq0(){if(!ls)return A3.jsx(uO,{to:"/"});return A3.jsx(QN.Suspense,{fallback:null,children:A3.jsx(ls,{})})}function is(){let[,$]=M8();return QN.useEffect(()=>{return RD((Z)=>$(`/workspace/${Z}`)),()=>RD(null)},[$]),A3.jsxs(mO,{children:[A3.jsx(Kz,{path:"/",component:Gh}),A3.jsx(Kz,{path:"/dev/*?",component:Lq0}),A3.jsx(Kz,{path:"/workspace/:id/*?",children:(Z)=>A3.jsx(ds,{id:Z.id},Z.id)})]})}var m7=P(c(),1),as=new LN;xS(as);_b();function VR1($){function Z(){return m7.jsx(UN,{client:as,children:m7.jsxs(SG,{children:[m7.jsx(EN,{children:m7.jsx(is,{})}),m7.jsx(fE,{})]})})}rs.createRoot($).render(m7.jsx(Z,{}))}export{VR1 as mount};