moi-computer 0.12.1-next.0 → 0.12.1-next.1
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.
- package/README.md +26 -26
- package/bin/moi.mjs +2 -2
- package/client/AGENTS.md +5 -2
- package/client/api/app-config.ts +3 -2
- package/client/api/workspace-keys.ts +1 -1
- package/client/app/{AppRouter.tsx → app-router.tsx} +4 -4
- package/client/app/routes/{HomeRoute.tsx → home-route.tsx} +2 -2
- package/client/app/routes/{WorkspaceRoute.tsx → workspace-route.tsx} +18 -23
- package/client/app/shell/{SidebarLayout.tsx → sidebar-layout.tsx} +10 -10
- package/client/dev/index.html +43 -0
- package/client/dev/index.ts +15 -0
- package/client/features/applets/{AppletContainer.tsx → applet-container.tsx} +1 -1
- package/client/features/applets/applet-thumbnail.ts +1 -1
- package/client/features/applets/{useApplet.ts → use-applet.ts} +2 -2
- package/client/features/applets/{WidgetShell.tsx → widget-shell.tsx} +4 -4
- package/client/features/chat/applet-chat-intents.ts +4 -4
- package/client/features/chat/{ChatPanel.tsx → chat-panel.tsx} +11 -11
- package/client/features/chat/{ChatPopup.tsx → chat-popup.tsx} +1 -1
- package/client/features/chat/composer/attachments/{DrawingAttachmentChip.tsx → drawing-attachment-chip.tsx} +1 -1
- package/client/features/chat/composer/attachments/{FileAttachmentChip.tsx → file-attachment-chip.tsx} +1 -1
- package/client/features/chat/composer/attachments/{TextAttachmentChip.tsx → text-attachment-chip.tsx} +1 -1
- package/client/features/chat/composer/banners/{ComposerBanner.tsx → composer-banner.tsx} +0 -14
- package/client/features/chat/composer/banners/{ErrorBanner.tsx → error-banner.tsx} +1 -1
- package/client/features/chat/composer/banners/{SkillUpdateBanner.tsx → skill-update-banner.tsx} +3 -3
- package/client/features/chat/composer/{ChatComposer.tsx → chat-composer.tsx} +8 -7
- package/client/features/chat/composer/{ModelPicker.tsx → model-picker.tsx} +1 -1
- package/client/features/chat/composer/{useWorkspaceComposerState.tsx → use-workspace-composer-state.tsx} +12 -28
- package/client/features/chat/composer/{useWorkspaceSkillUpdates.ts → use-workspace-skill-updates.ts} +1 -1
- package/client/features/chat/connection/chat-frames.ts +1 -1
- package/client/features/chat/messages/{ChatEmptyState.tsx → chat-empty-state.tsx} +4 -4
- package/client/features/chat/messages/{MarkdownContent.tsx → markdown-content.tsx} +1 -1
- package/client/features/chat/messages/tool-group/index.ts +1 -1
- package/client/features/chat/messages/tool-group/{ReadImagePreview.tsx → read-image-preview.tsx} +2 -2
- package/client/features/chat/messages/tool-group/{SubagentCard.tsx → subagent-card.tsx} +3 -3
- package/client/features/chat/messages/tool-group/{TimelineRow.tsx → timeline-row.tsx} +1 -1
- package/client/features/chat/messages/tool-group/{ToolCallGroup.tsx → tool-call-group.tsx} +8 -8
- package/client/features/chat/messages/tool-group/{ToolOutput.tsx → tool-output.tsx} +1 -1
- package/client/features/chat/messages/{TurnView.tsx → turn-view.tsx} +4 -4
- package/client/features/chat/sessions/api.ts +2 -2
- package/client/features/chat/sessions/{ChatSelector.tsx → chat-selector.tsx} +2 -2
- package/client/features/chat/sessions/{useSelectedSession.ts → use-selected-session.ts} +2 -2
- package/client/features/chat/{useChat.ts → use-chat.ts} +3 -3
- package/client/features/collab/proxy-user.ts +1 -1
- package/client/features/connectors/mcp-icons.ts +1 -1
- package/client/features/connectors/{McpServerCards.tsx → mcp-server-cards.tsx} +1 -1
- package/client/features/{home/workspace-setup/DemoDialog.tsx → demo/demo-dialog.tsx} +6 -6
- package/client/features/dev/chat-states-fixtures.ts +4 -4
- package/client/features/dev/{ChatStatesPage.tsx → chat-states-page.tsx} +6 -6
- package/client/features/dev/collab/local-user-settings.tsx +4 -4
- package/client/features/dev/{DevIndexPage.tsx → dev-index-page.tsx} +7 -1
- package/client/features/dev/{DevRoutes.tsx → dev-routes.tsx} +8 -6
- package/client/features/dev/workspace-setup-mocks.ts +102 -0
- package/client/features/dev/workspace-setup-page.tsx +11 -0
- package/client/features/dev/workspace-setup-preview.tsx +226 -0
- package/client/features/drawings/{DrawingToolbar.tsx → drawing-toolbar.tsx} +1 -1
- package/client/features/drawings/{useChatAnnotation.ts → use-chat-annotation.ts} +29 -23
- package/client/features/drawings/{useDrawingLayer.ts → use-drawing-layer.ts} +1 -1
- package/client/features/drawings/{useViewSketch.ts → use-view-sketch.ts} +1 -1
- package/client/features/harness/api.ts +36 -0
- package/client/features/harness/device-login-steps.tsx +97 -0
- package/client/features/home/api.ts +1 -81
- package/client/features/home/{HomeLogo.tsx → home-logo.tsx} +1 -1
- package/client/features/home/{HomePage.tsx → home-page.tsx} +14 -18
- package/client/features/overview/api.ts +2 -2
- package/client/features/overview/default/registry.tsx +1 -1
- package/client/features/overview/default/{ViewsWidget.tsx → views-widget.tsx} +1 -1
- package/client/features/overview/{HiddenPanel.tsx → hidden-panel.tsx} +2 -2
- package/client/features/overview/{Overview.tsx → overview.tsx} +6 -6
- package/client/features/overview/{WidgetCanvas.tsx → widget-canvas.tsx} +1 -1
- package/client/features/overview/{WidgetFrame.tsx → widget-frame.tsx} +1 -1
- package/client/features/overview/workspace-name.tsx +55 -0
- package/client/features/scratchpad/{Scratchpad.tsx → scratchpad.tsx} +7 -7
- package/client/features/scratchpad/{useScratchpadSnapshot.tsx → use-scratchpad-snapshot.tsx} +3 -3
- package/client/features/settings/api.ts +1 -1
- package/client/features/settings/{ConnectorsSettings.tsx → connectors-settings.tsx} +3 -3
- package/client/features/settings/{EnvironmentSettings.tsx → environment-settings.tsx} +3 -3
- package/client/features/settings/{GeneralSettings.tsx → general-settings.tsx} +5 -5
- package/client/features/settings/{useEnvVars.ts → use-env-vars.ts} +1 -1
- package/client/features/settings/{WorkspaceIconPicker.tsx → workspace-icon-picker.tsx} +1 -1
- package/client/features/settings/{WorkspaceSettingsDialog.tsx → workspace-settings-dialog.tsx} +3 -3
- package/client/features/update/api.ts +1 -1
- package/client/features/views/api.ts +1 -1
- package/client/features/views/{PendingViewScreen.tsx → pending-view-screen.tsx} +7 -4
- package/client/features/views/{useViewActions.ts → use-view-actions.ts} +2 -2
- package/client/features/views/{useViewDrafts.ts → use-view-drafts.ts} +15 -6
- package/client/features/views/{ViewManager.tsx → view-manager.tsx} +3 -3
- package/client/features/views/view-submission.ts +1 -1
- package/client/features/workspace/add/api.ts +80 -0
- package/client/features/{home/workspace-setup/CreateWorkspaceDialog.tsx → workspace/add/create-workspace-dialog.tsx} +56 -42
- package/client/features/workspace/add/import-workspace-dialog.tsx +81 -0
- package/client/features/{home/workspace-setup/useWorkspaceImport.ts → workspace/add/use-workspace-import.ts} +1 -1
- package/client/features/workspace/add/workspace-agent-options.ts +53 -0
- package/client/features/{home/workspace-setup/WorkspaceAgentStep.tsx → workspace/add/workspace-agent-selector.tsx} +59 -98
- package/client/features/{home/workspace-setup/WorkspaceDialogContent.tsx → workspace/add/workspace-dialog-content.tsx} +1 -1
- package/client/features/workspace/api.ts +24 -15
- package/client/features/workspace/browser-tab-state.ts +1 -1
- package/client/features/workspace/moi-context.ts +1 -1
- package/client/features/workspace/setup/workspace-login-state.tsx +175 -0
- package/client/features/workspace/setup/workspace-recovery-states.tsx +125 -0
- package/client/features/workspace/setup/workspace-setup-panel.tsx +18 -0
- package/client/features/workspace/setup/workspace-setup.tsx +77 -0
- package/client/features/workspace/setup/workspace-welcome-state.tsx +81 -0
- package/client/features/workspace/{ThemePanel.tsx → theme-panel.tsx} +3 -3
- package/client/features/workspace/{useWorkspaceNavigation.ts → use-workspace-navigation.ts} +2 -2
- package/client/features/workspace/{WorkspaceScreen.tsx → workspace-content.tsx} +27 -30
- package/client/features/workspace/workspace-identity.tsx +40 -0
- package/client/features/workspace/{WorkspaceMenu.tsx → workspace-menu.tsx} +3 -3
- package/client/features/{home → workspace}/workspace-presentation.tsx +10 -3
- package/client/features/workspace/workspace-screen.tsx +28 -0
- package/client/features/workspace/{WorkspaceSplitLayout.tsx → workspace-split-layout.tsx} +1 -1
- package/client/features/workspace/{WorkspaceTabs.tsx → workspace-tabs.tsx} +2 -2
- package/client/index.css +2 -2
- package/client/index.html +1 -1
- package/client/lib/agent-availability.ts +0 -5
- package/client/main.tsx +1 -1
- package/client/runtime/{useWorkspaceEvents.ts → use-workspace-events.ts} +3 -12
- package/dist/chunk-08ndj2rg.js +2 -0
- package/dist/chunk-2x040tmg.js +68 -0
- package/dist/chunk-3smxq0ts.js +1 -0
- package/dist/{chunk-am1x230f.js → chunk-68ch5hs8.js} +1 -1
- package/dist/{chunk-yvzhwtfa.js → chunk-9vg3xa81.js} +2 -2
- package/dist/chunk-c2p00p9j.css +1 -0
- package/dist/chunk-cs833y9j.js +1 -0
- package/dist/{chunk-gps4qc38.js → chunk-d7cbm65e.js} +1 -1
- package/dist/{chunk-j905va8r.js → chunk-hvh9f5h0.js} +1 -1
- package/dist/{chunk-vqpkqtdr.js → chunk-jvyvwwv3.js} +1 -1
- package/dist/chunk-nwevqe86.js +10 -0
- package/dist/{chunk-hzwr8dp8.js → chunk-q0gbdts4.js} +3 -3
- package/dist/chunk-rt30jbcm.js +1 -0
- package/dist/chunk-y5y3kj67.js +1 -0
- package/dist/index.html +2 -2
- package/lib/format.ts +1 -1
- package/lib/harness-instructions.ts +30 -0
- package/lib/ids.ts +1 -1
- package/lib/moi-context.ts +2 -2
- package/lib/scratchpad-skew.ts +3 -3
- package/lib/types.ts +28 -20
- package/lib/update.ts +1 -1
- package/package.json +5 -2
- package/server/AGENTS.md +10 -4
- package/server/README.md +102 -0
- package/server/api/harnesses.ts +56 -0
- package/server/{api.ts → api/index.ts} +85 -97
- package/server/app-config.ts +24 -12
- package/server/app-settings.ts +1 -1
- package/server/applets/applet-css.ts +1 -1
- package/server/applets/build-applet.ts +4 -4
- package/server/applets/build-worker.ts +1 -1
- package/server/applets/config.ts +1 -1
- package/server/{functions-worker.ts → applets/functions-worker.ts} +1 -1
- package/server/{functions.ts → applets/functions.ts} +2 -2
- package/server/applets/index.ts +2 -2
- package/server/{thumbnails.ts → applets/thumbnails.ts} +1 -1
- package/server/{applet-typecheck.ts → applets/typecheck.ts} +4 -4
- package/server/{ui-components.ts → applets/ui-components.ts} +2 -2
- package/server/{views.ts → applets/views.ts} +7 -7
- package/server/{widgets.ts → applets/widgets.ts} +2 -2
- package/server/cli/applet-selector.ts +19 -0
- package/server/cli/args.ts +5 -0
- package/server/{cli-colors.ts → cli/colors.ts} +1 -1
- package/server/cli/commands/bundle.ts +119 -0
- package/server/cli/commands/call-server-fn.ts +42 -0
- package/server/cli/commands/check.ts +53 -0
- package/server/cli/commands/config.ts +132 -0
- package/server/cli/commands/debug.ts +119 -0
- package/server/cli/commands/env.ts +162 -0
- package/server/cli/commands/hermes.ts +149 -0
- package/server/cli/commands/init.ts +286 -0
- package/server/cli/commands/navigate.ts +35 -0
- package/server/cli/commands/openclaw.ts +168 -0
- package/server/cli/commands/refresh.ts +39 -0
- package/server/cli/commands/scratch.ts +496 -0
- package/server/cli/commands/service.ts +298 -0
- package/server/cli/commands/skill.ts +122 -0
- package/server/cli/commands/start.ts +138 -0
- package/server/cli/commands/status.ts +80 -0
- package/server/cli/commands/tabs.ts +43 -0
- package/server/cli/commands/theme.ts +192 -0
- package/server/cli/commands/ui-components.ts +15 -0
- package/server/cli/commands/update.ts +192 -0
- package/server/cli/commands/version.ts +9 -0
- package/server/cli/commands/views.ts +87 -0
- package/server/cli/control.ts +89 -0
- package/server/{cli-env.ts → cli/env.ts} +9 -9
- package/server/cli/index.ts +171 -0
- package/server/{cli-pc.ts → cli/pc.ts} +1 -1
- package/server/cli/provider.ts +25 -0
- package/server/cli/server-version.ts +16 -0
- package/server/cli/server.ts +81 -0
- package/server/{cli-ui-components.ts → cli/ui-components.ts} +5 -5
- package/server/cli.ts +2 -3252
- package/server/collab/manager.ts +3 -3
- package/server/collab/skill/index.ts +2 -2
- package/server/control.ts +20 -20
- package/server/harness/README.md +47 -25
- package/server/harness/acp/NOTES.md +11 -11
- package/server/harness/acp/archived.ts +3 -3
- package/server/harness/acp/client.ts +2 -2
- package/server/harness/acp/run-durations.ts +1 -1
- package/server/harness/acp/session.ts +5 -5
- package/server/harness/auth.ts +303 -0
- package/server/harness/claude-code/NOTES.md +9 -7
- package/server/harness/claude-code/auth.ts +125 -17
- package/server/harness/claude-code/index.ts +2 -1
- package/server/harness/claude-code/mcp.ts +1 -1
- package/server/harness/claude-code/session.ts +10 -7
- package/server/harness/codex/NOTES.md +12 -12
- package/server/harness/codex/auth.ts +86 -19
- package/server/harness/codex/client.ts +17 -13
- package/server/harness/codex/index.ts +2 -1
- package/server/harness/codex/permissions.ts +3 -3
- package/server/harness/codex/probe.ts +3 -5
- package/server/harness/codex/session.ts +16 -13
- package/server/harness/codex/transport.ts +5 -5
- package/server/harness/executable.ts +42 -18
- package/server/harness/hermes/NOTES.md +70 -70
- package/server/harness/hermes/discovery.ts +1 -1
- package/server/harness/openclaw/NOTES.md +24 -24
- package/server/harness/openclaw/adapter.ts +1 -1
- package/server/harness/openclaw/compat.ts +1 -1
- package/server/harness/openclaw/session.ts +5 -2
- package/server/harness/registry.ts +1 -1
- package/server/harness/shell-path.ts +31 -21
- package/server/harness/types.ts +9 -2
- package/server/navigation-relay.ts +1 -1
- package/server/open-browser.ts +7 -0
- package/server/{scratchpad-assets.ts → scratchpad/assets.ts} +4 -4
- package/server/{scratchpad.ts → scratchpad/document.ts} +8 -8
- package/server/{scratchpad-executor.ts → scratchpad/executor.ts} +7 -7
- package/server/{scratchpad-relay.ts → scratchpad/relay.ts} +4 -5
- package/server/{scratchpad-shape-defaults.ts → scratchpad/shape-defaults.ts} +2 -2
- package/server/server-cwd.ts +1 -1
- package/server/service.ts +2 -2
- package/server/{session-archive.ts → sessions/archive.ts} +5 -5
- package/server/{attachment-message.ts → sessions/attachment-message.ts} +1 -1
- package/server/{session-config.ts → sessions/config.ts} +1 -1
- package/server/{session-lifecycle.ts → sessions/lifecycle.ts} +3 -3
- package/server/{pending-views.ts → sessions/pending-views.ts} +3 -3
- package/server/{selected-session.ts → sessions/selected.ts} +1 -1
- package/server/{session-store.ts → sessions/store.ts} +1 -1
- package/server/{view-sessions.ts → sessions/view-sessions.ts} +9 -9
- package/server/{skills-template.ts → skills/template.ts} +1 -1
- package/server/{skill-update.ts → skills/update.ts} +5 -5
- package/server/{skill-version.ts → skills/version.ts} +4 -4
- package/server/static.ts +1 -1
- package/server/status.ts +3 -3
- package/server/web.ts +14 -7
- package/server/{env-apply.ts → workspaces/env-apply.ts} +5 -5
- package/server/{workspace-env.ts → workspaces/env.ts} +3 -3
- package/server/{workspace-import.ts → workspaces/import.ts} +4 -4
- package/server/{workspace-init.ts → workspaces/init.ts} +5 -5
- package/server/{layout.ts → workspaces/layout.ts} +2 -2
- package/server/{preview.ts → workspaces/preview.ts} +1 -1
- package/server/{registry.ts → workspaces/registry.ts} +3 -3
- package/server/{required-env.ts → workspaces/required-env.ts} +3 -3
- package/server/{moi-scaffold.ts → workspaces/scaffold.ts} +3 -3
- package/ui-components/button.tsx +1 -1
- package/ui-components/docs/attachment.md +2 -2
- package/ui-components/docs/button.md +1 -1
- package/ui-components/docs/calendar.md +1 -1
- package/ui-components/docs/chart.md +4 -4
- package/ui-components/docs/data-table.md +1 -1
- package/ui-components/docs/drawer.md +1 -1
- package/ui-components/docs/field.md +1 -1
- package/ui-components/docs/input.md +2 -2
- package/ui-components/docs/label.md +2 -2
- package/ui-components/docs/table.md +2 -2
- package/workspace/.claude/skills/moi-workspace/SKILL.md +12 -12
- package/workspace/.claude/skills/moi-workspace/references/COLLAB.md +2 -2
- package/workspace/.claude/skills/moi-workspace/references/DESIGN.md +2 -2
- package/workspace/.claude/skills/moi-workspace/references/INTENTS.md +2 -2
- package/client/features/chat/composer/banners/AgentAvailabilityBanner.tsx +0 -101
- package/client/features/home/workspace-setup/ImportWorkspaceDialog.tsx +0 -92
- package/client/features/overview/WorkspaceName.tsx +0 -60
- package/dist/chunk-1zhnhy00.js +0 -1
- package/dist/chunk-27501vke.js +0 -1
- package/dist/chunk-9xtv6djt.js +0 -2
- package/dist/chunk-darpsw65.js +0 -1
- package/dist/chunk-n33w9y38.js +0 -10
- package/dist/chunk-r63ks44z.js +0 -68
- package/dist/chunk-wd46nk26.css +0 -1
- package/dist/chunk-xgt7vxt9.js +0 -1
- package/server/agent.ts +0 -223
- /package/client/components/shared/{AgentBlobatar.tsx → agent-blobatar.tsx} +0 -0
- /package/client/components/shared/{BottomPanel.tsx → bottom-panel.tsx} +0 -0
- /package/client/components/shared/{Composer.tsx → composer.tsx} +0 -0
- /package/client/components/shared/{LedLogo.tsx → led-logo.tsx} +0 -0
- /package/client/components/shared/{PanelHeader.tsx → panel-header.tsx} +0 -0
- /package/client/components/shared/{ReorderableList.tsx → reorderable-list.tsx} +0 -0
- /package/client/components/shared/{WorkspaceIcon.tsx → workspace-icon.tsx} +0 -0
- /package/client/features/applets/{WidgetErrorBoundary.tsx → widget-error-boundary.tsx} +0 -0
- /package/client/features/chat/composer/attachments/{AttachmentChip.tsx → attachment-chip.tsx} +0 -0
- /package/client/features/chat/messages/{ChatPromptBubbles.tsx → chat-prompt-bubbles.tsx} +0 -0
- /package/client/features/chat/messages/{ShimmerText.tsx → shimmer-text.tsx} +0 -0
- /package/client/features/chat/messages/tool-group/{CodeBlock.tsx → code-block.tsx} +0 -0
- /package/client/features/chat/messages/tool-group/{Collapse.tsx → collapse.tsx} +0 -0
- /package/client/features/chat/messages/{useStickToBottom.ts → use-stick-to-bottom.ts} +0 -0
- /package/client/features/connectors/{IconMcp.tsx → icon-mcp.tsx} +0 -0
- /package/client/features/dev/{BlobatarShapesPage.tsx → blobatar-shapes-page.tsx} +0 -0
- /package/client/features/dev/{HarnessDebugPage.tsx → harness-debug-page.tsx} +0 -0
- /package/client/features/dev/{TextureLabPage.tsx → texture-lab-page.tsx} +0 -0
- /package/client/features/dev/{ToolCallsPage.tsx → tool-calls-page.tsx} +0 -0
- /package/client/features/drawings/{DrawingLayer.tsx → drawing-layer.tsx} +0 -0
- /package/client/features/home/{WorkspacePreview.tsx → workspace-preview.tsx} +0 -0
- /package/client/features/overview/{useGridReconcile.ts → use-grid-reconcile.ts} +0 -0
- /package/client/features/scratchpad/{ScratchpadControls.tsx → scratchpad-controls.tsx} +0 -0
- /package/client/features/settings/{SettingsLayout.tsx → settings-layout.tsx} +0 -0
- /package/client/features/update/{UpdateControl.tsx → update-control.tsx} +0 -0
- /package/client/features/workspace/{UnavailablePage.tsx → unavailable-page.tsx} +0 -0
- /package/client/features/workspace/{useFitsSplitLayout.ts → use-fits-split-layout.ts} +0 -0
- /package/client/features/workspace/{WorkspaceContext.tsx → workspace-context.tsx} +0 -0
- /package/client/features/workspace/{WorkspaceLayoutContext.tsx → workspace-layout-context.tsx} +0 -0
- /package/server/{bundle-queue.ts → applets/bundle-queue.ts} +0 -0
- /package/server/{applet-log.ts → applets/log.ts} +0 -0
- /package/server/{cli-ui.ts → cli/ui.ts} +0 -0
- /package/server/{workspace-config.ts → workspaces/config.ts} +0 -0
- /package/server/{icon.ts → workspaces/icon.ts} +0 -0
- /package/server/{tabs.ts → workspaces/tabs.ts} +0 -0
- /package/server/{theme.ts → workspaces/theme.ts} +0 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import{$ as SG,$b as nI,A as R8,Aa as iE,Ab as NY,Ac as TU,B as u2,Ba as qI,Bc as CS,C as CB,Ca as NI,Cb as mI,Cc as K5,D as I8,Da as AI,Db as AY,Dc as IS,E as pZ,Ea as TJ,Eb as tg,Ec as kS,F as lA,Fa as DI,Fb as uI,Fc as m1,G as g0,Ga as VI,Gb as Ji,Gc as Nt,H as p2,Ha as LI,Hb as U_,I as Ph,Ia as MI,Ib as Hi,J as Y2,Ja as PI,Jb as qq,K as G0,Ka as WY,Kb as pI,L as Co,La as eS,Lb as a2,M as BH,Ma as lF,Mb as OS,N as ZH,Na as Rh,Nb as Kn,O as w5,Ob as cI,P as TO,Pa as _I,Pb as dI,Q as B0,Qa as cF,Qb as $H,R as qJ,Ra as bJ,Rb as u6,S as r0,Sa as OI,Sb as lI,T as z9,Ta as jI,Tb as iI,U as P0,Ua as ln,Ub as nQ,V as Vi,Va as Ht,Vb as Cx,W as ss,Wa as sR,Wb as rI,X as ts,Xa as TI,Xb as aI,Y as es,Ya as CI,Z as ZI,Za as EI,Zb as oI,_ as lE,_a as bI,aa as JI,ab as wI,ac as sI,b as c,ba as ng,bb as SI,bc as tI,c as bq0,ca as oK,cc as eI,d as G1,da as ho,db as sg,dc as Vq,e as Z4,ea as Fv,eb as RI,ec as $k,f as M1,fa as Zt,fb as rE,g as $5,ga as nR,gb as qY,gc as lg,h as H0,ha as Dv,hb as dF,hc as fo,i as k0,ia as pF,ib as cs,ic as qU,j as jz,ja as HI,jb as II,k as HC,ka as BI,kb as JN,kc as ig,l as Y0,la as $Q,lb as bv,lc as Zk,m as K8,ma as QI,mc as Jk,n as b2,na as XI,nb as d5,nc as e5,o as S1,oa as zI,ob as aE,oc as Or,p as S3,pa as ps,pb as kI,pc as Ex,q as WC,qa as GI,qb as yI,qc as vg,r as s0,ra as UI,rb as Tx,rc as QK,s as _1,sa as YI,sb as tR,sc as eg,t as X6,ta as KI,tb as xI,tc as pg,u as TB,ua as FI,ub as Fa,uc as kb,v as XE,va as a4,vb as vo,vc as yb,w as MG,wa as WI,wb as hI,wc as RS,x as iA,xa as DU,xb as vI,y as zE,ya as m3,yb as fI,yc as uS,z as rA,za as ji,zb as gI,zc as I4}from"/chunk-nwevqe86.js";import{Ic as o4}from"/chunk-08ndj2rg.js";import{Jc as ub,Kc as WD,Lc as qD,Mc as I3,Nc as iG}from"/chunk-68ch5hs8.js";import{Rc as B1,Sc as U4,Tc as _5}from"/chunk-jvyvwwv3.js";import{Uc as m,Vc as rG,Wc as N5,Xc as bx,Yc as L2,Zc as Zs}from"/chunk-9vg3xa81.js";import{$c as b5,_c as P,ad as I5,bd as EL}from"/chunk-d7cbm65e.js";var SZ=b5((lt)=>{var i8=P(m());function ht($,Z){return $===Z&&($!==0||1/$===1/Z)||$!==$&&Z!==Z}var vt=typeof Object.is==="function"?Object.is:ht,ft=i8.useState,gt=i8.useEffect,mt=i8.useLayoutEffect,ut=i8.useDebugValue;function pt($,Z){var J=Z(),H=ft({inst:{value:J,getSnapshot:Z}}),B=H[0].inst,Q=H[1];return mt(function(){B.value=J,B.getSnapshot=Z,hN(B)&&Q({inst:B})},[$,J,Z]),gt(function(){return hN(B)&&Q({inst:B}),$(function(){hN(B)&&Q({inst:B})})},[$]),ut(J),J}function hN($){var Z=$.getSnapshot;$=$.value;try{var J=Z();return!vt($,J)}catch(H){return!0}}function ct($,Z){return Z()}var dt=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?ct:pt;lt.useSyncExternalStore=i8.useSyncExternalStore!==void 0?i8.useSyncExternalStore:dt});var qm=b5((kJ1,Wm)=>{var Um=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,U$0=/\n/g,Y$0=/^\s*/,K$0=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,F$0=/^:\s*/,W$0=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,q$0=/^[;\s]*/,N$0=/^\s+|\s+$/g,A$0=`
|
|
2
|
+
`,Ym="/",Km="*",l$="",D$0="comment",V$0="declaration";function L$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(U$0);if(N)J+=N.length;var D=q.lastIndexOf(A$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(Y$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(Ym!=$.charAt(0)||Km!=$.charAt(1))return;var N=2;while(l$!=$.charAt(N)&&(Km!=$.charAt(N)||Ym!=$.charAt(N+1)))++N;if(N+=2,l$===$.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:D$0,comment:D})}function F(){var q=Q(),N=G(K$0);if(!N)return;if(K(),!G(F$0))return z("property missing ':'");var D=G(W$0),A=q({type:V$0,property:Fm(N[0].replace(Um,l$)),value:D?Fm(D[0].replace(Um,l$)):l$});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 Fm($){return $?$.replace(N$0,l$):l$}Wm.exports=L$0});var Nm=b5((ZX)=>{var M$0=ZX&&ZX.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(ZX,"__esModule",{value:!0});ZX.default=_$0;var P$0=M$0(qm());function _$0($,Z){let J=null;if(!$||typeof $!=="string")return J;let H=(0,P$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 Lm=b5((Dm)=>{Object.defineProperty(Dm,"__esModule",{value:!0});Dm.camelCase=void 0;var O$0=/^--[a-zA-Z0-9_-]+$/,j$0=/-([a-z])/g,T$0=/^[^-]+$/,C$0=/^-(webkit|moz|ms|o|khtml)-/,E$0=/^-(ms)-/,b$0=function($){return!$||T$0.test($)||O$0.test($)},w$0=function($,Z){return Z.toUpperCase()},Am=function($,Z){return"".concat(Z,"-")},S$0=function($,Z){if(Z===void 0)Z={};if(b$0($))return $;if($=$.toLowerCase(),Z.reactCompat)$=$.replace(E$0,Am);else $=$.replace(C$0,Am);return $.replace(j$0,w$0)};Dm.camelCase=S$0});var Pm=b5((DM,Mm)=>{var R$0=DM&&DM.__importDefault||function($){return $&&$.__esModule?$:{default:$}},I$0=R$0(Nm()),k$0=Lm();function AM($,Z){var J={};if(!$||typeof $!=="string")return J;return(0,I$0.default)($,function(H,B){if(H&&B)J[(0,k$0.camelCase)(H,Z)]=B}),J}AM.default=AM;Mm.exports=AM});var pu=b5((jG1,uu)=>{var _W=Object.prototype.hasOwnProperty,mu=Object.prototype.toString,yu=Object.defineProperty,xu=Object.getOwnPropertyDescriptor,hu=function(Z){if(typeof Array.isArray==="function")return Array.isArray(Z);return mu.call(Z)==="[object Array]"},vu=function(Z){if(!Z||mu.call(Z)!=="[object Object]")return!1;var J=_W.call(Z,"constructor"),H=Z.constructor&&Z.constructor.prototype&&_W.call(Z.constructor.prototype,"isPrototypeOf");if(Z.constructor&&!J&&!H)return!1;var B;for(B in Z);return typeof B>"u"||_W.call(Z,B)},fu=function(Z,J){if(yu&&J.name==="__proto__")yu(Z,J.name,{enumerable:!0,configurable:!0,value:J.newValue,writable:!0});else Z[J.name]=J.newValue},gu=function(Z,J){if(J==="__proto__"){if(!_W.call(Z,J))return;else if(xu)return xu(Z,J).value}return Z[J]};uu.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=gu(z,J),B=gu(Z,J),z!==B){if(Y&&B&&(vu(B)||(Q=hu(B)))){if(Q)Q=!1,X=H&&hu(H)?H:[];else X=H&&vu(H)?H:{};fu(z,{name:J,newValue:$(Y,X,B)})}else if(typeof B<"u")fu(z,{name:J,newValue:B})}}return z}});var kc=b5((lY1,Ic)=>{function Dc($){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))Dc(J)}),$}class GP{constructor($){if($.data===void 0)$.data={};this.data=$.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Vc($){return $.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function O7($,...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 BB0="</span>",Kc=($)=>{return!!$.scope},QB0=($,{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 Lc{constructor($,Z){this.buffer="",this.classPrefix=Z.classPrefix,$.walk(this)}addText($){this.buffer+=Vc($)}openNode($){if(!Kc($))return;let Z=QB0($.scope,{prefix:this.classPrefix});this.span(Z)}closeNode($){if(!Kc($))return;this.buffer+=BB0}value(){return this.buffer}span($){this.buffer+=`<span class="${$}">`}}var Fc=($={})=>{let Z={children:[]};return Object.assign(Z,$),Z};class UP{constructor(){this.rootNode=Fc(),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=Fc({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)=>{UP._collapse(Z)})}}class Mc extends UP{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 Lc(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function VX($){if(!$)return null;if(typeof $==="string")return $;return $.source}function Pc($){return ZZ("(?=",$,")")}function XB0($){return ZZ("(?:",$,")*")}function zB0($){return ZZ("(?:",$,")?")}function ZZ(...$){return $.map((J)=>VX(J)).join("")}function GB0($){let Z=$[$.length-1];if(typeof Z==="object"&&Z.constructor===Object)return $.splice($.length-1,1),Z;else return{}}function YP(...$){return"("+(GB0($).capture?"":"?:")+$.map((H)=>VX(H)).join("|")+")"}function _c($){return new RegExp($.toString()+"|").exec("").length-1}function UB0($,Z){let J=$&&$.exec(Z);return J&&J.index===0}var YB0=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function KP($,{joinWith:Z}){let J=0;return $.map((H)=>{J+=1;let B=J,Q=VX(H),X="";while(Q.length>0){let z=YB0.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 KB0=/\b\B/,Oc="[a-zA-Z]\\w*",FP="[a-zA-Z_]\\w*",jc="\\b\\d+(\\.\\d+)?",Tc="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Cc="\\b(0b[01]+)",FB0="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",WB0=($={})=>{let Z=/^#![ ]*\//;if($.binary)$.begin=ZZ(Z,/.*\b/,$.binary,/\b.*/);return O7({scope:"meta",begin:Z,end:/$/,relevance:0,"on:begin":(J,H)=>{if(J.index!==0)H.ignoreMatch()}},$)},LX={begin:"\\\\[\\s\\S]",relevance:0},qB0={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[LX]},NB0={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[LX]},AB0={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/},hW=function($,Z,J={}){let H=O7({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=YP("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:ZZ(/[ ]+/,"(",B,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),H},DB0=hW("//","$"),VB0=hW("/\\*","\\*/"),LB0=hW("#","$"),MB0={scope:"number",begin:jc,relevance:0},PB0={scope:"number",begin:Tc,relevance:0},_B0={scope:"number",begin:Cc,relevance:0},OB0={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[LX,{begin:/\[/,end:/\]/,relevance:0,contains:[LX]}]},jB0={scope:"title",begin:Oc,relevance:0},TB0={scope:"title",begin:FP,relevance:0},CB0={begin:"\\.\\s*"+FP,relevance:0},EB0=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()}})},yW=Object.freeze({__proto__:null,APOS_STRING_MODE:qB0,BACKSLASH_ESCAPE:LX,BINARY_NUMBER_MODE:_B0,BINARY_NUMBER_RE:Cc,COMMENT:hW,C_BLOCK_COMMENT_MODE:VB0,C_LINE_COMMENT_MODE:DB0,C_NUMBER_MODE:PB0,C_NUMBER_RE:Tc,END_SAME_AS_BEGIN:EB0,HASH_COMMENT_MODE:LB0,IDENT_RE:Oc,MATCH_NOTHING_RE:KB0,METHOD_GUARD:CB0,NUMBER_MODE:MB0,NUMBER_RE:jc,PHRASAL_WORDS_MODE:AB0,QUOTE_STRING_MODE:NB0,REGEXP_MODE:OB0,RE_STARTERS_RE:FB0,SHEBANG:WB0,TITLE_MODE:jB0,UNDERSCORE_IDENT_RE:FP,UNDERSCORE_TITLE_MODE:TB0});function bB0($,Z){if($.input[$.index-1]===".")Z.ignoreMatch()}function wB0($,Z){if($.className!==void 0)$.scope=$.className,delete $.className}function SB0($,Z){if(!Z)return;if(!$.beginKeywords)return;if($.begin="\\b("+$.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",$.__beforeBegin=bB0,$.keywords=$.keywords||$.beginKeywords,delete $.beginKeywords,$.relevance===void 0)$.relevance=0}function RB0($,Z){if(!Array.isArray($.illegal))return;$.illegal=YP(...$.illegal)}function IB0($,Z){if(!$.match)return;if($.begin||$.end)throw Error("begin & end are not supported with match");$.begin=$.match,delete $.match}function kB0($,Z){if($.relevance===void 0)$.relevance=1}var yB0=($,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=ZZ(J.beforeMatch,Pc(J.begin)),$.starts={relevance:0,contains:[Object.assign(J,{endsParent:!0})]},$.relevance=0,delete J.beforeMatch},xB0=["of","and","for","in","not","or","if","then","parent","list","value"],hB0="keyword";function Ec($,Z,J=hB0){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,Ec($[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,vB0(G[0],G[1])]})}}function vB0($,Z){if(Z)return Number(Z);return fB0($)?0:1}function fB0($){return xB0.includes($.toLowerCase())}var Wc={},$Z=($)=>{console.error($)},qc=($,...Z)=>{console.log(`WARN: ${$}`,...Z)},_H=($,Z)=>{if(Wc[`${$}/${Z}`])return;console.log(`Deprecated as of ${$}. ${Z}`),Wc[`${$}/${Z}`]=!0},xW=Error();function bc($,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+=_c(Z[z-1]);$[J]=X,$[J]._emit=Q,$[J]._multi=!0}function gB0($){if(!Array.isArray($.begin))return;if($.skip||$.excludeBegin||$.returnBegin)throw $Z("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),xW;if(typeof $.beginScope!=="object"||$.beginScope===null)throw $Z("beginScope must be object"),xW;bc($,$.begin,{key:"beginScope"}),$.begin=KP($.begin,{joinWith:""})}function mB0($){if(!Array.isArray($.end))return;if($.skip||$.excludeEnd||$.returnEnd)throw $Z("skip, excludeEnd, returnEnd not compatible with endScope: {}"),xW;if(typeof $.endScope!=="object"||$.endScope===null)throw $Z("endScope must be object"),xW;bc($,$.end,{key:"endScope"}),$.end=KP($.end,{joinWith:""})}function uB0($){if($.scope&&typeof $.scope==="object"&&$.scope!==null)$.beginScope=$.scope,delete $.scope}function pB0($){if(uB0($),typeof $.beginScope==="string")$.beginScope={_wrap:$.beginScope};if(typeof $.endScope==="string")$.endScope={_wrap:$.endScope};gB0($),mB0($)}function cB0($){function Z(X,z){return new RegExp(VX(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+=_c(X)+1}compile(){if(this.regexes.length===0)this.exec=()=>null;let X=this.regexes.map((z)=>z[1]);this.matcherRe=Z(KP(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;[wB0,IB0,pB0,yB0].forEach((Y)=>Y(X,z)),$.compilerExtensions.forEach((Y)=>Y(X,z)),X.__beforeBegin=null,[SB0,RB0,kB0].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=Ec(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=VX(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 dB0(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=O7($.classNameAliases||{}),Q($)}function wc($){if(!$)return!1;return $.endsWithParent||wc($.starts)}function dB0($){if($.variants&&!$.cachedVariants)$.cachedVariants=$.variants.map(function(Z){return O7($,{variants:null},Z)});if($.cachedVariants)return $.cachedVariants;if(wc($))return O7($,{starts:$.starts?O7($.starts):null});if(Object.isFrozen($))return O7($);return $}var lB0="11.11.1";class Sc extends Error{constructor($,Z){super($);this.name="HTMLInjectionError",this.html=Z}}var zP=Vc,Nc=O7,Ac=Symbol("nomatch"),iB0=7,Rc=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:Mc};function G(k){return z.noHighlightRe.test(k)}function U(k){let x=k.className+" ";x+=k.parentNode?k.parentNode.className:"";let v=z.languageDetectRe.exec(x);if(v){let f=C(v[1]);if(!f)qc(Q.replace("{}",v[1])),qc("Falling back to no-highlight mode for this block.",k);return f?v[1]:"no-highlight"}return x.split(/\s+/).find((f)=>G(f)||C(f))}function Y(k,x,v){let f="",E="";if(typeof x==="object")f=k,v=x.ignoreIllegals,E=x.language;else _H("10.7.0","highlight(lang, code, ...args) has been deprecated."),_H("10.7.0",`Please use highlight(code, options) instead.
|
|
3
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),E=k,f=x;if(v===void 0)v=!0;let l={code:f,language:E};j("before:highlight",l);let r=l.result?l.result:K(l.language,l.code,v);return r.code=l.code,j("after:highlight",r),r}function K(k,x,v,f){let E=Object.create(null);function l(g,u){return g.keywords[u]}function r(){if(!a.keywords){$0.addText(X0);return}let g=0;a.keywordPatternRe.lastIndex=0;let u=a.keywordPatternRe.exec(X0),t="";while(u){t+=X0.substring(g,u.index);let W0=D0.case_insensitive?u[0].toLowerCase():u[0],S0=l(a,W0);if(S0){let[p0,f0]=S0;if($0.addText(t),t="",E[W0]=(E[W0]||0)+1,E[W0]<=iB0)_0+=f0;if(p0.startsWith("_"))t+=u[0];else{let T0=D0.classNameAliases[p0]||p0;o(u[0],T0)}}else t+=u[0];g=a.keywordPatternRe.lastIndex,u=a.keywordPatternRe.exec(X0)}t+=X0.substring(g),$0.addText(t)}function h(){if(X0==="")return;let g=null;if(typeof a.subLanguage==="string"){if(!Z[a.subLanguage]){$0.addText(X0);return}g=K(a.subLanguage,X0,!0,e[a.subLanguage]),e[a.subLanguage]=g._top}else g=W(X0,a.subLanguage.length?a.subLanguage:null);if(a.relevance>0)_0+=g.relevance;$0.__addSublanguage(g._emitter,g.language)}function d(){if(a.subLanguage!=null)h();else r();X0=""}function o(g,u){if(g==="")return;$0.startScope(u),$0.addText(g),$0.endScope()}function p(g,u){let t=1,W0=u.length-1;while(t<=W0){if(!g._emit[t]){t++;continue}let S0=D0.classNameAliases[g[t]]||g[t],p0=u[t];if(S0)o(p0,S0);else X0=p0,r(),X0="";t++}}function i(g,u){if(g.scope&&typeof g.scope==="string")$0.openNode(D0.classNameAliases[g.scope]||g.scope);if(g.beginScope){if(g.beginScope._wrap)o(X0,D0.classNameAliases[g.beginScope._wrap]||g.beginScope._wrap),X0="";else if(g.beginScope._multi)p(g.beginScope,u),X0=""}return a=Object.create(g,{parent:{value:a}}),a}function n(g,u,t){let W0=UB0(g.endRe,t);if(W0){if(g["on:end"]){let S0=new GP(g);if(g["on:end"](u,S0),S0.isMatchIgnored)W0=!1}if(W0){while(g.endsParent&&g.parent)g=g.parent;return g}}if(g.endsWithParent)return n(g.parent,u,t)}function Z0(g){if(a.matcher.regexIndex===0)return X0+=g[0],1;else return L0=!0,0}function J0(g){let u=g[0],t=g.rule,W0=new GP(t),S0=[t.__beforeBegin,t["on:begin"]];for(let p0 of S0){if(!p0)continue;if(p0(g,W0),W0.isMatchIgnored)return Z0(u)}if(t.skip)X0+=u;else{if(t.excludeBegin)X0+=u;if(d(),!t.returnBegin&&!t.excludeBegin)X0=u}return i(t,g),t.returnBegin?0:u.length}function U0(g){let u=g[0],t=x.substring(g.index),W0=n(a,g,t);if(!W0)return Ac;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,g);else if(S0.skip)X0+=u;else{if(!(S0.returnEnd||S0.excludeEnd))X0+=u;if(d(),S0.excludeEnd)X0=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,g);return S0.returnEnd?0:u.length}function z0(){let g=[];for(let u=a;u!==D0;u=u.parent)if(u.scope)g.unshift(u.scope);g.forEach((u)=>$0.openNode(u))}let Q0={};function N0(g,u){let t=u&&u[0];if(X0+=g,t==null)return d(),0;if(Q0.type==="begin"&&u.type==="end"&&Q0.index===u.index&&t===""){if(X0+=x.slice(u.index,u.index+1),!B){let W0=Error(`0 width match regex (${k})`);throw W0.languageName=k,W0.badRule=Q0.rule,W0}return 1}if(Q0=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!==Ac)return W0}if(u.type==="illegal"&&t==="")return X0+=`
|
|
4
|
+
`,1;if(A0>1e5&&A0>u.index*3)throw Error("potential infinite loop, way more iterations than matches");return X0+=t,t.length}let D0=C(k);if(!D0)throw $Z(Q.replace("{}",k)),Error('Unknown language: "'+k+'"');let F0=cB0(D0),s="",a=f||F0,e={},$0=new z.__emitter(z);z0();let X0="",_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 g=a.matcher.exec(x);if(!g)break;let u=x.substring(M0,g.index),t=N0(u,g);M0=g.index+t}N0(x.substring(M0))}else D0.__emitTokens(x,$0);return $0.finalize(),s=$0.toHTML(),{language:k,value:s,relevance:_0,illegal:!1,_emitter:$0,_top:a}}catch(g){if(g.message&&g.message.includes("Illegal"))return{language:k,value:zP(x),illegal:!0,relevance:0,_illegalBy:{message:g.message,index:M0,context:x.slice(M0-100,M0+100),mode:g.mode,resultSoFar:s},_emitter:$0};else if(B)return{language:k,value:zP(x),illegal:!1,relevance:0,errorRaised:g,_emitter:$0,_top:a};else throw g}}function F(k){let x={value:zP(k),illegal:!1,relevance:0,_top:X,_emitter:new z.__emitter(z)};return x._emitter.addText(k),x}function W(k,x){x=x||z.languages||Object.keys(Z);let v=F(k),f=x.filter(C).filter(T).map((d)=>K(d,k,!1));f.unshift(v);let E=f.sort((d,o)=>{if(d.relevance!==o.relevance)return o.relevance-d.relevance;if(d.language&&o.language){if(C(d.language).supersetOf===o.language)return 1;else if(C(o.language).supersetOf===d.language)return-1}return 0}),[l,r]=E,h=l;return h.secondBest=r,h}function q(k,x,v){let f=x&&J[x]||v;k.classList.add("hljs"),k.classList.add(`language-${f}`)}function N(k){let x=null,v=U(k);if(G(v))return;if(j("before:highlightElement",{el:k,language:v}),k.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",k);return}if(k.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(k);if(z.throwUnescapedHTML)throw new Sc("One of your code blocks includes unescaped HTML.",k.innerHTML)}x=k;let f=x.textContent,E=v?Y(f,{language:v,ignoreIllegals:!0}):W(f);if(k.innerHTML=E.value,k.dataset.highlighted="yes",q(k,v,E.language),k.result={language:E.language,re:E.relevance,relevance:E.relevance},E.secondBest)k.secondBest={language:E.secondBest.language,relevance:E.secondBest.relevance};j("after:highlightElement",{el:k,result:E,text:f})}function D(k){z=Nc(z,k)}let A=()=>{O(),_H("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function V(){O(),_H("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let L=!1;function O(){function k(){O()}if(document.readyState==="loading"){if(!L)window.addEventListener("DOMContentLoaded",k,!1);L=!0;return}document.querySelectorAll(z.cssSelector).forEach(N)}function M(k,x){let v=null;try{v=x($)}catch(f){if($Z("Language definition for '{}' could not be registered.".replace("{}",k)),!B)throw f;else $Z(f);v=X}if(!v.name)v.name=k;if(Z[k]=v,v.rawDefinition=x.bind(null,$),v.aliases)b(v.aliases,{languageName:k})}function _(k){delete Z[k];for(let x of Object.keys(J))if(J[x]===k)delete J[x]}function w(){return Object.keys(Z)}function C(k){return k=(k||"").toLowerCase(),Z[k]||Z[J[k]]}function b(k,{languageName:x}){if(typeof k==="string")k=[k];k.forEach((v)=>{J[v.toLowerCase()]=x})}function T(k){let x=C(k);return x&&!x.disableAutodetect}function I(k){if(k["before:highlightBlock"]&&!k["before:highlightElement"])k["before:highlightElement"]=(x)=>{k["before:highlightBlock"](Object.assign({block:x.el},x))};if(k["after:highlightBlock"]&&!k["after:highlightElement"])k["after:highlightElement"]=(x)=>{k["after:highlightBlock"](Object.assign({block:x.el},x))}}function S(k){I(k),H.push(k)}function R(k){let x=H.indexOf(k);if(x!==-1)H.splice(x,1)}function j(k,x){let v=k;H.forEach(function(f){if(f[v])f[v](x)})}function y(k){return _H("10.7.0","highlightBlock will be removed entirely in v12.0"),_H("10.7.0","Please use highlightElement now."),N(k)}Object.assign($,{highlight:Y,highlightAuto:W,highlightAll:O,highlightElement:N,highlightBlock:y,configure:D,initHighlighting:A,initHighlightingOnLoad:V,registerLanguage:M,unregisterLanguage:_,listLanguages:w,getLanguage:C,registerAliases:b,autoDetection:T,inherit:Nc,addPlugin:S,removePlugin:R}),$.debugMode=function(){B=!1},$.safeMode=function(){B=!0},$.versionString=lB0,$.regex={concat:ZZ,lookahead:Pc,either:YP,optional:zB0,anyNumberOfTimes:XB0};for(let k in yW)if(typeof yW[k]==="object")Dc(yW[k]);return Object.assign($,yW),$},OH=Rc({});OH.newInstance=()=>Rc({});Ic.exports=OH;OH.HighlightJS=OH;OH.default=OH});var kl=b5((dA1,Il)=>{var Vz0=["||","&&",";;","|&","<(","<<<",">>",">&","<&","&",";","(",")","|","<",">"],Rl=/[\n\r\u2028\u2029]/,Lz0=/[\s#!"$&'():;<=>@\\^`|]/g;Il.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(Rl.test(J.pattern))throw TypeError("glob `pattern` must not contain line terminators");return J.pattern.replace(Lz0,"\\$&")}if("op"in J&&typeof J.op==="string"){if(Vz0.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(Rl.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 ml=b5((lA1,gl)=>{var fl="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",yl=new RegExp("^"+fl+"$"),xl="|&;()<> \\t",Mz0="'([^']*?)'",Pz0='"((\\\\"|[^"])*?)"',_z0=/^#$/,hl="'",vl='"',iW="$",BZ="",Oz0=4294967296;for(rW=0;rW<4;rW++)BZ+=(Oz0*Math.random()).toString(16);var rW,jz0=new RegExp("^"+BZ);function Tz0($,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 Cz0($,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+BZ+JSON.stringify(H)+BZ;return Z+H}function Ez0($,Z,J){if(!J)J={};var H=J.escape||"\\",B=J.splitUnquoted===!0?`
|
|
5
|
+
`:typeof J.splitUnquoted==="string"?J.splitUnquoted:"",Q="(\\"+H+`['"`+xl+`]|[^\\s'"`+xl+"])+",X=new RegExp(["("+fl+")","("+Q+"|"+Pz0+"|"+Mz0+")+"].join("|"),"g"),z=Tz0($,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(yl.test(Y))return{op:Y};var K=!1,F=!1,W="",q=[],N=!1,D=null,A=!1,V;function L(){V+=1;var I,S,R=Y.charAt(V);if(R==="{"){if(V+=1,Y.charAt(V)==="}")throw Error("Bad substitution: "+Y.slice(V-2,V+1));var j=1;I=V;while(j>0&&I<Y.length){if(Y.charAt(I)==="{"&&Y.charAt(I-1)==="$")j+=1;else if(Y.charAt(I)==="}")j-=1;I+=1}if(j!==0)throw Error("Bad substitution: "+Y.slice(V));I-=1,S=Y.slice(V,I),V=I}else if(/[*@#?$!_-]/.test(R))S=R,V+=1;else{var y=Y.slice(V);if(I=y.match(/[^\w\d_]/),!I)S=y,V=Y.length;else S=y.slice(0,I.index),V+=I.index-1}return Cz0(Z,"",S)}function O(){if(D===null)return;if(D===0){if(W!=="")q[q.length]=W,W=""}else{q[q.length]=W,W="";for(var I=1;I<D;I+=1)q[q.length]=""}D=null}for(V=0;V<Y.length;V++){var M=Y.charAt(V);if(B&&M!==iW)O();if(A=A||!K&&(M==="*"||M==="?"),F)W+=M,F=!1;else if(K)if(M===K)K=!1;else if(K==hl)W+=M;else if(M===H)if(V+=1,M=Y.charAt(V),M===vl||M===H||M===iW)W+=M;else W+=H+M;else if(M===iW)W+=L();else W+=M;else if(M===vl||M===hl)K=M,N=!0;else if(yl.test(M))return{op:Y};else if(_z0.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===iW){var w=L();if(!B)W+=w;else for(var C=0;C<w.length;C+=1){var b=w.charAt(C);if(B.indexOf(b)<0)O(),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 T=1;T<D;T+=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},[])}gl.exports=function(Z,J,H){var B=Ez0(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("("+BZ+".*?"+BZ+")","g"));if(z.length===1)return Q[Q.length]=z[0],Q;return z.filter(Boolean).forEach(function(G){Q[Q.length]=jz0.test(G)?JSON.parse(G.split(BZ)[1]):G}),Q},[])}});var Ci=b5((mV1,Ti)=>{var fG0="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";Ti.exports=fG0});var Si=b5((uV1,wi)=>{var gG0=Ci();function Ei(){}function bi(){}bi.resetWarningCache=Ei;wi.exports=function(){function $(H,B,Q,X,z,G){if(G===gG0)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:bi,resetWarningCache:Ei};return J.PropTypes=J,J}});var EX=b5((pV1,Ri)=>{Ri.exports=Si()();var mG0,uG0});var yi=b5((cV1,P_)=>{function ki($){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=ki($[Z]))&&(H&&(H+=" "),H+=J)}else for(J in $)$[J]&&(H&&(H+=" "),H+=J);return H}function Ii(){for(var $,Z,J=0,H="",B=arguments.length;J<B;J++)($=arguments[J])&&(Z=ki($))&&(H&&(H+=" "),H+=Z);return H}P_.exports=Ii,P_.exports.clsx=Ii});var bX=b5((xi)=>{Object.defineProperty(xi,"__esModule",{value:!0});xi.dontSetMe=iG0;xi.findInArray=pG0;xi.int=lG0;xi.isFunction=cG0;xi.isNum=dG0;function pG0($,Z){for(let J=0,H=$.length;J<H;J++)if(Z.apply(Z,[$[J],J,$]))return $[J]}function cG0($){return typeof $==="function"||Object.prototype.toString.call($)==="[object Function]"}function dG0($){return typeof $==="number"&&!isNaN($)}function lG0($){return parseInt($,10)}function iG0($,Z,J){if($[Z])return Error(`Invalid prop ${Z} passed to ${J} - do not set this, set it on the child.`)}});var mi=b5((fi)=>{Object.defineProperty(fi,"__esModule",{value:!0});fi.browserPrefixToKey=vi;fi.browserPrefixToStyle=tG0;fi.default=void 0;fi.getPrefix=hi;var __=["Moz","Webkit","O","ms"];function hi(){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<__.length;J++)if(vi($,__[J])in Z)return __[J];return""}function vi($,Z){return Z?`${Z}${eG0($)}`:$}function tG0($,Z){return Z?`-${Z.toLowerCase()}-${$}`:$}function eG0($){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 lV1=fi.default=hi()});var $q=b5((ri)=>{Object.defineProperty(ri,"__esModule",{value:!0});ri.addClassName=li;ri.addEvent=BU0;ri.addUserSelectStyles=NU0;ri.createCSSTransform=KU0;ri.createSVGTransform=FU0;ri.getTouch=WU0;ri.getTouchIdentifier=qU0;ri.getTranslation=O_;ri.innerHeight=GU0;ri.innerWidth=UU0;ri.matchesSelector=di;ri.matchesSelectorAndParentsTo=HU0;ri.offsetXYFromParent=YU0;ri.outerHeight=XU0;ri.outerWidth=zU0;ri.removeClassName=ii;ri.removeEvent=QU0;ri.scheduleRemoveUserSelectStyles=AU0;var M8=bX(),ui=ci(mi());function ci($,Z){if(typeof WeakMap=="function")var J=new WeakMap,H=new WeakMap;return(ci=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 eW="";function di($,Z){if(!eW)eW=(0,M8.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(J){return(0,M8.isFunction)($[J])});if(!(0,M8.isFunction)($[eW]))return!1;return $[eW](Z)}function HU0($,Z,J){let H=$;do{if(di(H,Z))return!0;if(H===J)return!1;H=H.parentNode}while(H);return!1}function BU0($,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 QU0($,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 XU0($){let Z=$.clientHeight,J=$.ownerDocument.defaultView.getComputedStyle($);return Z+=(0,M8.int)(J.borderTopWidth),Z+=(0,M8.int)(J.borderBottomWidth),Z}function zU0($){let Z=$.clientWidth,J=$.ownerDocument.defaultView.getComputedStyle($);return Z+=(0,M8.int)(J.borderLeftWidth),Z+=(0,M8.int)(J.borderRightWidth),Z}function GU0($){let Z=$.clientHeight,J=$.ownerDocument.defaultView.getComputedStyle($);return Z-=(0,M8.int)(J.paddingTop),Z-=(0,M8.int)(J.paddingBottom),Z}function UU0($){let Z=$.clientWidth,J=$.ownerDocument.defaultView.getComputedStyle($);return Z-=(0,M8.int)(J.paddingLeft),Z-=(0,M8.int)(J.paddingRight),Z}function YU0($,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 KU0($,Z){let J=O_($,Z,"px");return{[(0,ui.browserPrefixToKey)("transform",ui.default)]:J}}function FU0($,Z){return O_($,Z,"")}function O_($,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 WU0($,Z){return $.targetTouches&&(0,M8.findInArray)($.targetTouches,(J)=>Z===J.identifier)||$.changedTouches&&(0,M8.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 NU0($){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)li($.body,"react-draggable-transparent-selection")}function AU0($){if(window.requestAnimationFrame)window.requestAnimationFrame(()=>{pi($)});else pi($)}function pi($){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 li($,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 T_=b5((ai)=>{Object.defineProperty(ai,"__esModule",{value:!0});ai.canDragX=vU0;ai.canDragY=fU0;ai.createCoreData=mU0;ai.createDraggableData=uU0;ai.getBoundPosition=xU0;ai.getControlPosition=gU0;ai.snapToGrid=hU0;var P8=bX(),yH=$q();function xU0($,Z,J){if(!$.props.bounds)return[Z,J];let{bounds:H}=$.props;H=typeof H==="string"?H:pU0(H);let B=j_($);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,P8.int)(Y.paddingLeft)+(0,P8.int)(U.marginLeft),top:-B.offsetTop+(0,P8.int)(Y.paddingTop)+(0,P8.int)(U.marginTop),right:(0,yH.innerWidth)(G)-(0,yH.outerWidth)(B)-B.offsetLeft+(0,P8.int)(Y.paddingRight)-(0,P8.int)(U.marginRight),bottom:(0,yH.innerHeight)(G)-(0,yH.outerHeight)(B)-B.offsetTop+(0,P8.int)(Y.paddingBottom)-(0,P8.int)(U.marginBottom)}}if((0,P8.isNum)(H.right))Z=Math.min(Z,H.right);if((0,P8.isNum)(H.bottom))J=Math.min(J,H.bottom);if((0,P8.isNum)(H.left))Z=Math.max(Z,H.left);if((0,P8.isNum)(H.top))J=Math.max(J,H.top);return[Z,J]}function hU0($,Z,J){let H=Math.round(Z/$[0])*$[0],B=Math.round(J/$[1])*$[1];return[H,B]}function vU0($){return $.props.axis==="both"||$.props.axis==="x"}function fU0($){return $.props.axis==="both"||$.props.axis==="y"}function gU0($,Z,J){let H=typeof Z==="number"?(0,yH.getTouch)($,Z):null;if(typeof Z==="number"&&!H)return null;let B=j_(J),Q=J.props.offsetParent||B.offsetParent||B.ownerDocument.body;return(0,yH.offsetXYFromParent)(H||$,Q,J.props.scale)}function mU0($,Z,J){let H=!(0,P8.isNum)($.lastX),B=j_($);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 uU0($,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 pU0($){return{left:$.left,top:$.top,right:$.right,bottom:$.bottom}}function j_($){let Z=$.findDOMNode();if(!Z)throw Error("<DraggableCore>: Unmounted during event!");return Z}});var C_=b5((oi)=>{Object.defineProperty(oi,"__esModule",{value:!0});oi.default=nU0;function nU0(){}});var ei=b5((si)=>{var ZY0=P(m()),JY0=P(K8());Object.defineProperty(si,"__esModule",{value:!0});si.default=void 0;var E_=ni(ZY0),h4=w_(EX()),tU0=w_(JY0),P4=$q(),C7=T_(),b_=bX(),wX=w_(C_());function w_($){return $&&$.__esModule?$:{default:$}}function ni($,Z){if(typeof WeakMap=="function")var J=new WeakMap,H=new WeakMap;return(ni=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 v4($,Z,J){return(Z=eU0(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function eU0($){var Z=$Y0($,"string");return typeof Z=="symbol"?Z:Z+""}function $Y0($,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 W9={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},E7=W9.mouse;class SX extends E_.Component{constructor(){super(...arguments);v4(this,"dragging",!1),v4(this,"lastX",NaN),v4(this,"lastY",NaN),v4(this,"touchIdentifier",null),v4(this,"mounted",!1),v4(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,P4.matchesSelectorAndParentsTo)($.target,this.props.handle,Z)||this.props.cancel&&(0,P4.matchesSelectorAndParentsTo)($.target,this.props.cancel,Z))return;if($.type==="touchstart"&&!this.props.allowMobileScroll)$.preventDefault();let H=(0,P4.getTouchIdentifier)($);this.touchIdentifier=H;let B=(0,C7.getControlPosition)($,H,this);if(B==null)return;let{x:Q,y:X}=B,z=(0,C7.createCoreData)(this,Q,X);if((0,wX.default)("DraggableCore: handleDragStart: %j",z),(0,wX.default)("calling",this.props.onStart),this.props.onStart($,z)===!1||this.mounted===!1)return;if(this.props.enableUserSelectHack)(0,P4.addUserSelectStyles)(J);this.dragging=!0,this.lastX=Q,this.lastY=X,(0,P4.addEvent)(J,E7.move,this.handleDrag),(0,P4.addEvent)(J,E7.stop,this.handleDragStop)}),v4(this,"handleDrag",($)=>{let Z=(0,C7.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,C7.snapToGrid)(this.props.grid,X,z),!X&&!z)return;J=this.lastX+X,H=this.lastY+z}let B=(0,C7.createCoreData)(this,J,H);if((0,wX.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}),v4(this,"handleDragStop",($)=>{if(!this.dragging)return;let Z=(0,C7.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,C7.snapToGrid)(this.props.grid,z,G),J=this.lastX+z,H=this.lastY+G}let B=(0,C7.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,P4.scheduleRemoveUserSelectStyles)(X.ownerDocument)}if((0,wX.default)("DraggableCore: handleDragStop: %j",B),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,X)(0,wX.default)("DraggableCore: Removing handlers"),(0,P4.removeEvent)(X.ownerDocument,E7.move,this.handleDrag),(0,P4.removeEvent)(X.ownerDocument,E7.stop,this.handleDragStop)}),v4(this,"onMouseDown",($)=>{return E7=W9.mouse,this.handleDragStart($)}),v4(this,"onMouseUp",($)=>{return E7=W9.mouse,this.handleDragStop($)}),v4(this,"onTouchStart",($)=>{return E7=W9.touch,this.handleDragStart($)}),v4(this,"onTouchEnd",($)=>{return E7=W9.touch,this.handleDragStop($)})}componentDidMount(){this.mounted=!0;let $=this.findDOMNode();if($)(0,P4.addEvent)($,W9.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let $=this.findDOMNode();if($){let{ownerDocument:Z}=$;if((0,P4.removeEvent)(Z,W9.mouse.move,this.handleDrag),(0,P4.removeEvent)(Z,W9.touch.move,this.handleDrag),(0,P4.removeEvent)(Z,W9.mouse.stop,this.handleDragStop),(0,P4.removeEvent)(Z,W9.touch.stop,this.handleDragStop),(0,P4.removeEvent)($,W9.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack)(0,P4.scheduleRemoveUserSelectStyles)(Z)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:tU0.default.findDOMNode(this)}render(){return E_.cloneElement(E_.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}si.default=SX;v4(SX,"displayName","DraggableCore");v4(SX,"propTypes",{allowAnyClick:h4.default.bool,allowMobileScroll:h4.default.bool,children:h4.default.node.isRequired,disabled:h4.default.bool,enableUserSelectHack:h4.default.bool,offsetParent:function($,Z){if($[Z]&&$[Z].nodeType!==1)throw Error("Draggable's offsetParent must be a DOM Node.")},grid:h4.default.arrayOf(h4.default.number),handle:h4.default.string,cancel:h4.default.string,nodeRef:h4.default.object,onStart:h4.default.func,onDrag:h4.default.func,onStop:h4.default.func,onMouseDown:h4.default.func,scale:h4.default.number,className:b_.dontSetMe,style:b_.dontSetMe,transform:b_.dontSetMe});v4(SX,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1})});var Hr=b5((I_)=>{var zY0=P(m()),GY0=P(K8());Object.defineProperty(I_,"__esModule",{value:!0});Object.defineProperty(I_,"DraggableCore",{enumerable:!0,get:function(){return Hq.default}});I_.default=void 0;var Zq=Zr(zY0),v5=Bq(EX()),HY0=Bq(GY0),BY0=yi(),$r=$q(),xH=T_(),S_=bX(),Hq=Bq(ei()),Jq=Bq(C_());function Bq($){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 R_(){return R_=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 $},R_.apply(null,arguments)}function hH($,Z,J){return(Z=QY0(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function QY0($){var Z=XY0($,"string");return typeof Z=="symbol"?Z:Z+""}function XY0($,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 RX extends Zq.Component{static getDerivedStateFromProps($,Z){let{position:J}=$,{prevPropsPosition:H}=Z;if(J&&(!H||J.x!==H.x||J.y!==H.y))return(0,Jq.default)("Draggable: getDerivedStateFromProps %j",{position:J,prevPropsPosition:H}),{x:J.x,y:J.y,prevPropsPosition:{...J}};return null}constructor($){super($);if(hH(this,"onDragStart",(Z,J)=>{if((0,Jq.default)("Draggable: onDragStart: %j",J),this.props.onStart(Z,(0,xH.createDraggableData)(this,J))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),hH(this,"onDrag",(Z,J)=>{if(!this.state.dragging)return!1;(0,Jq.default)("Draggable: onDrag: %j",J);let H=(0,xH.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,xH.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)}),hH(this,"onDragStop",(Z,J)=>{if(!this.state.dragging)return!1;if(this.props.onStop(Z,(0,xH.createDraggableData)(this,J))===!1)return!1;(0,Jq.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??HY0.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,xH.canDragX)(this)&&q?this.state.x:N.x,y:(0,xH.canDragY)(this)&&q?this.state.y:N.y};if(this.state.isElementSVG)F=(0,$r.createSVGTransform)(D,G);else K=(0,$r.createCSSTransform)(D,G);let A=(0,BY0.clsx)(J.props.className||"",B,{[Q]:this.state.dragging,[X]:this.state.dragged});return Zq.createElement(Hq.default,R_({},Y,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),Zq.cloneElement(Zq.Children.only(J),{className:A,style:{...J.props.style,...K},transform:F}))}}I_.default=RX;hH(RX,"displayName","Draggable");hH(RX,"propTypes",{...Hq.default.propTypes,axis:v5.default.oneOf(["both","x","y","none"]),bounds:v5.default.oneOfType([v5.default.shape({left:v5.default.number,right:v5.default.number,top:v5.default.number,bottom:v5.default.number}),v5.default.string,v5.default.oneOf([!1])]),defaultClassName:v5.default.string,defaultClassNameDragging:v5.default.string,defaultClassNameDragged:v5.default.string,defaultPosition:v5.default.shape({x:v5.default.number,y:v5.default.number}),positionOffset:v5.default.shape({x:v5.default.oneOfType([v5.default.number,v5.default.string]),y:v5.default.oneOfType([v5.default.number,v5.default.string])}),position:v5.default.shape({x:v5.default.number,y:v5.default.number}),className:S_.dontSetMe,style:S_.dontSetMe,transform:S_.dontSetMe});hH(RX,"defaultProps",{...Hq.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 Xq=b5((tV1,Qq)=>{var{default:Br,DraggableCore:UY0}=Hr();Qq.exports=Br;Qq.exports.default=Br;Qq.exports.DraggableCore=UY0});var zr=b5((AY0)=>{var LY0=P(m());AY0.__esModule=!0;AY0.cloneElement=NY0;var YY0=KY0(LY0);function KY0($){return $&&$.__esModule?$:{default:$}}function Qr($,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 Xr($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z]!=null?arguments[Z]:{};Z%2?Qr(Object(J),!0).forEach(function(H){FY0($,H,J[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(J)):Qr(Object(J)).forEach(function(H){Object.defineProperty($,H,Object.getOwnPropertyDescriptor(J,H))})}return $}function FY0($,Z,J){return(Z=WY0(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function WY0($){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 NY0($,Z){if(Z.style&&$.props.style)Z.style=Xr(Xr({},$.props.style),Z.style);if(Z.className&&$.props.className)Z.className=$.props.className+" "+Z.className;return YY0.default.cloneElement($,Z)}});var k_=b5((PY0)=>{PY0.__esModule=!0;PY0.resizableProps=void 0;var w1=MY0(EX()),$L1=Xq();function MY0($){return $&&$.__esModule?$:{default:$}}var ZL1=PY0.resizableProps={axis:w1.default.oneOf(["both","x","y","none"]),className:w1.default.string,children:w1.default.element.isRequired,draggableOpts:w1.default.shape({allowAnyClick:w1.default.bool,cancel:w1.default.string,children:w1.default.node,disabled:w1.default.bool,enableUserSelectHack:w1.default.bool,offsetParent:typeof Element<"u"?w1.default.instanceOf(Element):w1.default.any,grid:w1.default.arrayOf(w1.default.number),handle:w1.default.string,nodeRef:w1.default.object,onStart:w1.default.func,onDrag:w1.default.func,onStop:w1.default.func,onMouseDown:w1.default.func,scale:w1.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 w1.default.number.isRequired(...Z);return w1.default.number(...Z)},handle:w1.default.oneOfType([w1.default.node,w1.default.func]),handleSize:w1.default.arrayOf(w1.default.number),lockAspectRatio:w1.default.bool,maxConstraints:w1.default.arrayOf(w1.default.number),minConstraints:w1.default.arrayOf(w1.default.number),onResizeStop:w1.default.func,onResizeStart:w1.default.func,onResize:w1.default.func,resizeHandles:w1.default.arrayOf(w1.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:w1.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 w1.default.number.isRequired(...Z);return w1.default.number(...Z)}}});var h_=b5((RY0)=>{var kY0=P(m());RY0.__esModule=!0;RY0.default=void 0;var vH=Yr(kY0),OY0=Xq(),jY0=zr(),TY0=k_(),CY0=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function Yr($,Z){if(typeof WeakMap=="function")var J=new WeakMap,H=new WeakMap;return(Yr=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 x_(){return x_=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 $},x_.apply(null,arguments)}function EY0($,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 Ur($,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 y_($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z]!=null?arguments[Z]:{};Z%2?Ur(Object(J),!0).forEach(function(H){bY0($,H,J[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(J)):Ur(Object(J)).forEach(function(H){Object.defineProperty($,H,Object.getOwnPropertyDescriptor(J,H))})}return $}function bY0($,Z,J){return(Z=wY0(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function wY0($){var Z=SY0($,"string");return typeof Z=="symbol"?Z:Z+""}function SY0($,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 zq extends vH.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 O=this.runConstraints(V,L);if(V=O[0],L=O[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 vH.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=y_({ref:Z},H?{}:{handleAxis:$});return vH.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=EY0($,CY0);return(0,jY0.cloneElement)(Z,y_(y_({},A),{},{className:(J?J+" ":"")+"react-resizable",children:[...vH.Children.toArray(Z.props.children),...N.map((V)=>{var L;let O=(L=this.handleRefs[V])!=null?L:this.handleRefs[V]=vH.createRef();return vH.createElement(OY0.DraggableCore,x_({},H,{nodeRef:O,key:"resizableHandle-"+V,onStop:this.resizeHandler("onResizeStop",V),onStart:this.resizeHandler("onResizeStart",V),onDrag:this.resizeHandler("onResize",V)}),this.renderResizeHandle(V,O))})]}))}}RY0.default=zq;zq.propTypes=TY0.resizableProps;zq.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1}});var Ar=b5((pY0)=>{var dY0=P(m());pY0.__esModule=!0;pY0.default=void 0;var v_=qr(dY0),yY0=Wr(EX()),xY0=Wr(h_()),hY0=k_(),vY0=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function Wr($){return $&&$.__esModule?$:{default:$}}function qr($,Z){if(typeof WeakMap=="function")var J=new WeakMap,H=new WeakMap;return(qr=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 f_(){return f_=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 $},f_.apply(null,arguments)}function Fr($,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 Gq($){for(var Z=1;Z<arguments.length;Z++){var J=arguments[Z]!=null?arguments[Z]:{};Z%2?Fr(Object(J),!0).forEach(function(H){fY0($,H,J[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(J)):Fr(Object(J)).forEach(function(H){Object.defineProperty($,H,Object.getOwnPropertyDescriptor(J,H))})}return $}function fY0($,Z,J){return(Z=gY0(Z))in $?Object.defineProperty($,Z,{value:J,enumerable:!0,configurable:!0,writable:!0}):$[Z]=J,$}function gY0($){var Z=mY0($,"string");return typeof Z=="symbol"?Z:Z+""}function mY0($,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 uY0($,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 g_ extends v_.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=uY0($,vY0);return v_.createElement(xY0.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},v_.createElement("div",f_({},D,{style:Gq(Gq({},q),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}}pY0.default=g_;g_.propTypes=Gq(Gq({},hY0.resizableProps),{},{children:yY0.default.element})});var m_=b5((QL1,Uq)=>{Uq.exports=function(){throw Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};Uq.exports.Resizable=h_().default;Uq.exports.ResizableBox=Ar().default});var Hn=b5((ZN,Jn)=>{(function($,Z){typeof ZN==="object"&&typeof Jn<"u"?Z(ZN):typeof define==="function"&&define.amd?define(["exports"],Z):($=typeof globalThis<"u"?globalThis:$||self,Z($["fast-equals"]={}))})(ZN,function($){function Z(p){return function(n,Z0,J0,U0,z0,Q0,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),Q0=U0.get(Z0);if(z0&&Q0)return z0===Z0&&Q0===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:Q0}=p,N0=Q0(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 X0=D.call(F0);if(X0!==D.call(s))return!1;if(X0===U)return n(F0,s,N0,a);if(X0===Y)return U0(F0,s,N0,a);if(X0===K)return Z0(F0,s,N0,a);if(X0===q)return z0(F0,s,N0,a);if(X0===W||X0===z)return Q(F0)||Q(s)?!1:J0(F0,s,N0,a);if(X0===G||X0===F||X0===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 O(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(Q0,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(Q0,s,N0,a,p,i,Z0)))U0[F0]=!0;F0++}),z0++,J0=D0}),J0}var _=J(M),w="_owner",C=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 Q0=!!p.$$typeof,N0=!!i.$$typeof;if((Q0||N0)&&Q0!==N0)return!1}if(!C.call(i,z0)||!n(p[z0],i[z0],z0,z0,p,i,Z0))return!1}return!0}var T=J(b);function I(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,Q0){if(!J0)return;var N0=!1,D0=0;i.forEach(function(F0,s){if(!N0&&!U0[D0]&&(N0=n(z0,F0,Q0,s,p,i,Z0)))U0[D0]=!0;D0++}),J0=N0}),J0}var R=J(S),j=Object.freeze({areArraysEqual:V,areDatesEqual:O,areMapsEqual:M,areObjectsEqual:b,areRegExpsEqual:I,areSetsEqual:S,createIsNestedEqual:Z}),y=Object.freeze({areArraysEqual:L,areDatesEqual:O,areMapsEqual:_,areObjectsEqual:T,areRegExpsEqual:I,areSetsEqual:R,createIsNestedEqual:Z}),k=A(j);function x(p,i){return k(p,i,void 0)}var v=A(H(j,{createIsNestedEqual:function(){return X}}));function f(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(j,p(j)))}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=f,Object.defineProperty($,"__esModule",{value:!0})})});var OZ=P(m(),1),eO=P(c(),1),_N=OZ.createContext(void 0),$1=($)=>{let Z=OZ.useContext(_N);if($)return $;if(!Z)throw Error("No QueryClient set, use QueryClientProvider to set one");return Z},ON=({client:$,children:Z})=>{return OZ.useEffect(()=>{return $.mount(),()=>{$.unmount()}},[$]),eO.jsx(_N.Provider,{value:$,children:Z})};var Uz=P(m(),1),$j=Uz.createContext(!1),Zj=()=>Uz.useContext($j),Sq0=$j.Provider;var ZB=P(m(),1),Ot=P(c(),1);function jt(){let $=!1;return{clearReset:()=>{$=!1},reset:()=>{$=!0},isReset:()=>{return $}}}var Tt=ZB.createContext(jt()),Jj=()=>ZB.useContext(Tt);var _j=P(m(),1);var Ct={setTimeout:($,Z)=>setTimeout($,Z),clearTimeout:($)=>clearTimeout($),setInterval:($,Z)=>setInterval($,Z),clearInterval:($)=>clearInterval($)},Et=class{#$=Ct;#Z=!1;setTimeoutProvider($){this.#$=$}setTimeout($,Z){return this.#$.setTimeout($,Z)}clearTimeout($){this.#$.clearTimeout($)}setInterval($,Z){return this.#$.setInterval($,Z)}clearInterval($){this.#$.clearInterval($)}},_9=new Et;function Hj($){setTimeout($,0)}var TN=typeof window>"u"||"Deno"in globalThis;function c5(){}function Xj($,Z){return typeof $==="function"?$(Z):$}function Yz($){return typeof $==="number"&&$>=0&&$!==1/0}function Kz($,Z){return Math.max($+(Z||0)-Date.now(),0)}function y5($,Z){return typeof $==="function"?$(Z):$}function Fz($,Z){let{type:J="all",exact:H,fetchStatus:B,predicate:Q,queryKey:X,stale:z}=$;if(X){if(H){if(Z.queryHash!==JB(X,Z.options))return!1}else if(!J6(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 Wz($,Z){let{exact:J,status:H,predicate:B,mutationKey:Q}=$;if(Q){if(!Z.options.mutationKey)return!1;if(J){if(O9(Z.options.mutationKey)!==O9(Q))return!1}else if(!J6(Z.options.mutationKey,Q))return!1}if(H&&Z.state.status!==H)return!1;if(B&&!B(Z))return!1;return!0}function JB($,Z){return(Z?.queryKeyHashFn||O9)($)}function O9($){return JSON.stringify($,(Z,J)=>jN(J)?Object.keys(J).sort().reduce((H,B)=>{return H[B]=J[B],H},{}):J)}function J6($,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(!J6($[H],Z[H]))return!1;return!0}let J=Object.keys(Z);for(let H of J)if(!J6($[H],Z[H]))return!1;return!0}return!1}var bt=Object.prototype.hasOwnProperty;function HB($,Z,J=0){if($===Z)return $;if(J>500)return Z;let H=Bj($)&&Bj(Z);if(!H&&!(jN($)&&jN(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:bt.call($,Y))G++;continue}if(K===null||F===null||typeof K!=="object"||typeof F!=="object"){z[Y]=F;continue}let W=HB(K,F,J+1);if(z[Y]=W,W===K)G++}return B===X&&G===B?$:z}function jZ($,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 Bj($){return Array.isArray($)&&$.length===Object.keys($).length}function jN($){if(!Qj($))return!1;let Z=$.constructor;if(Z===void 0)return!0;let J=Z.prototype;if(!Qj(J))return!1;if(!J.hasOwnProperty("isPrototypeOf"))return!1;if(Object.getPrototypeOf($)!==Object.prototype)return!1;return!0}function Qj($){return Object.prototype.toString.call($)==="[object Object]"}function zj($){return new Promise((Z)=>{_9.setTimeout(Z,$)})}function BB($,Z,J){if(typeof J.structuralSharing==="function")return J.structuralSharing($,Z);else if(J.structuralSharing!==!1)return HB($,Z);return Z}function Gj($,Z,J=0){let H=[...$,Z];return J&&H.length>J?H.slice(1):H}function Uj($,Z,J=0){let H=[Z,...$];return J&&H.length>J?H.slice(0,-1):H}var TZ=Symbol();function qz($,Z){if(!$.queryFn&&Z?.initialPromise)return()=>Z.initialPromise;if(!$.queryFn||$.queryFn===TZ)return()=>Promise.reject(Error(`Missing queryFn: '${$.queryHash}'`));return $.queryFn}function CZ($,Z){if(typeof $==="function")return $(...Z);return!!$}function Yj($,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 wt=()=>TN,EZ=()=>wt();var T8=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 St=class extends T8{#$;#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"}},bZ=new St;var Kj=Hj;function Rt(){let $=[],Z=0,J=(z)=>{z()},H=(z)=>{z()},B=Kj,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 G5=Rt();var It=class extends T8{#$=!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.#$}},wZ=new It;function kt($){return Math.min(1000*2**$,30000)}function CN($){return($??"online")==="online"?wZ.isOnline():!0}var Nz=class extends Error{constructor($){super("CancelledError");this.revert=$?.revert,this.silent=$?.silent}};function Az($){let Z=!1,J=0,H,B="pending",Q,X,z=new Promise((V,L)=>{Q=V,X=L});z.catch(c5);let G=()=>B!=="pending",U=(V)=>{if(!G()){let L=new Nz(V);N(L),$.onCancel?.(L)}},Y=()=>{Z=!0},K=()=>{Z=!1},F=()=>bZ.isFocused()&&($.networkMode==="always"||wZ.isOnline())&&$.canRun(),W=()=>CN($.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(O){V=Promise.reject(O)}Promise.resolve(V).then(q).catch((O)=>{if(G())return;let M=$.retry??(EZ()?0:3),_=$.retryDelay??kt,w=typeof _==="function"?_(J,O):_,C=M===!0||typeof M==="number"&&J<M||typeof M==="function"&&M(J,O);if(Z||!C){N(O);return}J++,$.onFail?.(J,O),zj(w).then(()=>{return F()?void 0:D()}).then(()=>{if(Z)N(O);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 Dz=class{#$;destroy(){this.clearGcTimeout()}scheduleGc(){if(this.clearGcTimeout(),Yz(this.gcTime))this.#$=_9.setTimeout(()=>{this.optionalRemove()},this.gcTime)}updateGcTime($){this.gcTime=Math.max(this.gcTime||0,$??(EZ()?1/0:300000))}clearGcTimeout(){if(this.#$!==void 0)_9.clearTimeout(this.#$),this.#$=void 0}};function Wj($){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)=>{Yj(q,()=>Z.signal,()=>Y=!0)},F=qz(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:O}=Z.options,M=D?Uj:Gj;return{pages:M(q.pages,L,O),pageParams:M(q.pageParams,N,O)}};if(B&&Q.length){let q=B==="backward",N=q?yt:Fj,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:Fj(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 Fj($,{pages:Z,pageParams:J}){let H=Z.length-1;return Z.length>0?$.getNextPageParam(Z[H],Z,J[H],J):void 0}function yt($,{pages:Z,pageParams:J}){return Z.length>0?$.getPreviousPageParam?.(Z[0],Z,J[0],J):void 0}var Aj=class extends Dz{#$;#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=Nj(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=Nj(this.options);if(Z.data!==void 0)this.setState(qj(Z.data,Z.dataUpdatedAt)),this.#Z=Z}}optionalRemove(){if(!this.observers.length&&this.state.fetchStatus==="idle")this.#H.remove(this)}setData($,Z){let J=BB(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(c5).catch(c5):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(($)=>y5($.options.enabled,this)!==!1)}isDisabled(){if(this.getObserversCount()>0)return!this.isActive();return this.options.queryFn===TZ||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){if(this.getObserversCount()>0)return this.observers.some(($)=>y5($.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!Kz(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=qz(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"?Wj(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=Az({initialPromise:Z?.initialPromise,fn:X.fetchFn,onCancel:(G)=>{if(G instanceof Nz&&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 Nz){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,...EN(J.data,this.options),fetchMeta:$.meta??null};case"success":let H={...J,...qj($.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),G5.batch(()=>{this.observers.slice().forEach((J)=>{J.onQueryUpdate()}),this.#H.notify({query:this,type:"updated",action:$})})}};function EN($,Z){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:CN(Z.networkMode)?"fetching":"paused",...$===void 0&&{error:null,status:"pending"}}}function qj($,Z){return{data:$,dataUpdatedAt:Z??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Nj($){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 wN=class extends T8{#$;#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),Dj(this.#Z,this.options))this.#F();else this.updateResult();this.#L()}}onUnsubscribe(){if(!this.hasListeners())this.destroy()}shouldFetchOnReconnect(){return bN(this.#Z,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return bN(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 y5(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&&!jZ(this.options,Z))this.#$.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#Z,observer:this});let H=this.hasListeners();if(H&&Vj(this.#Z,J,this.options,Z))this.#F();if(this.updateResult(),H&&(this.#Z!==J||y5(this.options.enabled,this.#Z)!==y5(Z.enabled,this.#Z)||y5(this.options.staleTime,this.#Z)!==y5(Z.staleTime,this.#Z)))this.#A();let B=this.#D();if(H&&(this.#Z!==J||y5(this.options.enabled,this.#Z)!==y5(Z.enabled,this.#Z)||B!==this.#U))this.#V(B)}getOptimisticResult($){let Z=this.#$.getQueryCache().build(this.#$,$),J=this.createResult(Z,$);if(!jZ(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(c5);return Z}#N($){return!EZ()&&y5(this.options.enabled,this.#Z)!==!1&&Yz($)}#A(){this.#M();let $=y5(this.options.staleTime,this.#Z);if(this.#H.isStale||!this.#N($))return;let Z=Kz(this.#H.dataUpdatedAt,$)+1;this.#Y=_9.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=_9.setInterval(()=>{if(this.options.refetchIntervalInBackground||bZ.isFocused())this.#F()},this.#U)}#L(){this.#A(),this.#V(this.#D())}#M(){if(this.#Y!==void 0)_9.clearTimeout(this.#Y),this.#Y=void 0}#P(){if(this.#K!==void 0)_9.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&&Dj($,Z),w=M&&Vj($,J,Z,H);if(_||w)U={...U,...EN(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=BB(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=BB(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,O=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&&!O,isPaused:U.fetchStatus==="paused",isPlaceholderData:Y,isRefetchError:V&&O,isStale:SN($,Z),refetch:this.refetch,isEnabled:y5(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(jZ(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)})})();G5.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 xt($,Z){return y5(Z.enabled,$)!==!1&&$.state.data===void 0&&!($.state.status==="error"&&y5(Z.retryOnMount,$)===!1)}function Dj($,Z){return xt($,Z)||$.state.data!==void 0&&bN($,Z,Z.refetchOnMount)}function bN($,Z,J){if(y5(Z.enabled,$)!==!1&&y5(Z.staleTime,$)!=="static"){let H=typeof J==="function"?J($):J;return H==="always"||H!==!1&&SN($,Z)}return!1}function Vj($,Z,J,H){return($!==Z||y5(H.enabled,$)===!1)&&(!J.suspense||$.state.status!=="error")&&SN($,J)}function SN($,Z){return y5(Z.enabled,$)!==!1&&$.isStaleByTime(y5(Z.staleTime,$))}var Lj=class extends Dz{#$;#Z;#J;#H;constructor($){super();this.#$=$.client,this.mutationId=$.mutationId,this.#J=$.mutationCache,this.#Z=[],this.state=$.state||RN(),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=Az({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),G5.batch(()=>{this.#Z.forEach((J)=>{J.onMutationUpdate($)}),this.#J.notify({mutation:this,type:"updated",action:$})})}};function RN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Mj=class extends T8{#$;#Z;#J;constructor($={}){super();this.config=$,this.#$=new Set,this.#Z=new Map,this.#J=0}build($,Z,J){let H=new Lj({client:$,mutationCache:this,mutationId:++this.#J,options:$.defaultMutationOptions(Z),state:J});return this.add(H),H}add($){this.#$.add($);let Z=Vz($);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=Vz($);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=Vz($);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=Vz($);if(typeof Z==="string")return this.#Z.get(Z)?.find((J)=>J!==$&&J.state.isPaused)?.continue()??Promise.resolve();else return Promise.resolve()}clear(){G5.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)=>Wz(Z,J))}findAll($={}){return this.getAll().filter((Z)=>Wz($,Z))}notify($){G5.batch(()=>{this.listeners.forEach((Z)=>{Z($)})})}resumePausedMutations(){let $=this.getAll().filter((Z)=>Z.state.isPaused);return G5.batch(()=>Promise.all($.map((Z)=>Z.continue().catch(c5))))}};function Vz($){return $.options.scope?.id}var IN=class extends T8{#$;#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($),!jZ(this.options,Z))this.#$.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#J,observer:this});if(Z?.mutationKey&&this.options.mutationKey&&O9(Z.mutationKey)!==O9(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??RN();this.#Z={...$,isPending:$.status==="pending",isSuccess:$.status==="success",isError:$.status==="error",isIdle:$.status==="idle",mutate:this.mutate,reset:this.reset}}#B($){G5.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 Pj=class extends T8{#$;constructor($={}){super();this.config=$,this.#$=new Map}build($,Z,J){let H=Z.queryKey,B=Z.queryHash??JB(H,Z),Q=this.get(B);if(!Q)Q=new Aj({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(){G5.batch(()=>{this.getAll().forEach(($)=>{this.remove($)})})}get($){return this.#$.get($)}getAll(){return[...this.#$.values()]}find($){let Z={exact:!0,...$};return this.getAll().find((J)=>Fz(Z,J))}findAll($={}){let Z=this.getAll();return Object.keys($).length>0?Z.filter((J)=>Fz($,J)):Z}notify($){G5.batch(()=>{this.listeners.forEach((Z)=>{Z($)})})}onFocus(){G5.batch(()=>{this.getAll().forEach(($)=>{$.onFocus()})})}onOnline(){G5.batch(()=>{this.getAll().forEach(($)=>{$.onOnline()})})}};var kN=class{#$;#Z;#J;#H;#Q;#B;#X;#G;constructor($={}){this.#$=$.queryCache||new Pj,this.#Z=$.mutationCache||new Mj,this.#J=$.defaultOptions||{},this.#H=new Map,this.#Q=new Map,this.#B=0}mount(){if(this.#B++,this.#B!==1)return;this.#X=bZ.subscribe(async($)=>{if($)await this.resumePausedMutations(),this.#$.onFocus()}),this.#G=wZ.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(y5(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=Xj(Z,B);if(Q===void 0)return;return this.#$.build(this,H).setData(Q,{...J,manual:!0})}setQueriesData($,Z,J){return G5.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.#$;G5.batch(()=>{Z.findAll($).forEach((J)=>{Z.remove(J)})})}resetQueries($,Z){let J=this.#$;return G5.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=G5.batch(()=>this.#$.findAll($).map((B)=>B.cancel(J)));return Promise.all(H).then(c5).catch(c5)}invalidateQueries($,Z={}){return G5.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=G5.batch(()=>this.#$.findAll($).filter((B)=>!B.isDisabled()&&!B.isStatic()).map((B)=>{let Q=B.fetch(void 0,J);if(!J.throwOnError)Q=Q.catch(c5);return B.state.fetchStatus==="paused"?Promise.resolve():Q}));return Promise.all(H).then(c5)}async query($){let Z=this.defaultQueryOptions($);if(Z.retry===void 0)Z.retry=!1;let J=this.#$.build(this,Z),H=J.isStaleByTime(y5(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(y5(Z.staleTime,J))?J.fetch(Z):Promise.resolve(J.state.data)}prefetchQuery($){return this.fetchQuery($).then(c5).catch(c5)}infiniteQuery($){return $._type="infinite",this.query($)}fetchInfiniteQuery($){return $._type="infinite",this.fetchQuery($)}prefetchInfiniteQuery($){return this.fetchInfiniteQuery($).then(c5).catch(c5)}ensureInfiniteQueryData($){return $._type="infinite",this.ensureQueryData($)}resumePausedMutations(){if(wZ.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(O9($),{queryKey:$,defaultOptions:Z})}getQueryDefaults($){let Z=[...this.#H.values()],J={};return Z.forEach((H)=>{if(J6($,H.queryKey))Object.assign(J,H.defaultOptions)}),J}setMutationDefaults($,Z){this.#Q.set(O9($),{mutationKey:$,defaultOptions:Z})}getMutationDefaults($){let Z=[...this.#Q.values()],J={};return Z.forEach((H)=>{if(J6($,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=JB(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===TZ)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 Oj=($,Z,J)=>{let H=J?.state.error&&typeof $.throwOnError==="function"?CZ($.throwOnError,[J.state.error,J]):$.throwOnError;if($.suspense||H){if(!Z.isReset())$.retryOnMount=!1}},jj=($)=>{_j.useEffect(()=>{$.clearReset()},[$])},Tj=({result:$,errorResetBoundary:Z,throwOnError:J,query:H,suspense:B})=>{return $.isError&&!Z.isReset()&&!$.isFetching&&H&&(B&&$.data===void 0||CZ(J,[$.error,H]))};var Cj=($)=>{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)}},Ej=($,Z)=>$?.suspense&&Z.isPending,bj=($,Z,J)=>Z.fetchOptimistic($).catch(()=>{J.clearReset()});var H6=P(m(),1);function wj($,Z,J){let H=Zj(),B=Jj(),Q=$1(J),X=Q.defaultQueryOptions($),z=Q.getQueryCache().get(X.queryHash),G=$.subscribed!==!1;X._optimisticResults=H?"isRestoring":G?"optimistic":void 0,Cj(X),Oj(X,B,z),jj(B);let[U]=H6.useState(()=>new Z(Q,X)),Y=U.getOptimisticResult(X),K=!H&&G;if(H6.useSyncExternalStore(H6.useCallback((F)=>{let W=K?U.subscribe(G5.batchCalls(F)):c5;return U.updateResult(),W},[U,K]),()=>U.getCurrentResult(),()=>U.getCurrentResult()),H6.useEffect(()=>{U.setOptions(X)},[X,U]),Ej(X,Y))throw bj(X,U,B);if(Tj({result:Y,errorResetBoundary:B,throwOnError:X.throwOnError,query:z,suspense:X.suspense}))throw Y.error;return!X.notifyOnChangeProps?U.trackResult(Y):Y}function e1($,Z){return wj($,wN,Z)}function yN($){return $}var P3=P(m(),1);function xN($,Z){let J=$1(Z);return Rj({filters:{...$,status:"pending"}},J).length}function Sj($,Z){return $.findAll(Z.filters).map((J)=>Z.select?Z.select(J):J.state)}function Rj($={},Z){let J=$1(Z).getMutationCache(),H=P3.useRef($),B=P3.useRef(null);if(B.current===null)B.current=Sj(J,$);return P3.useEffect(()=>{H.current=$}),P3.useSyncExternalStore(P3.useCallback((Q)=>J.subscribe(()=>{let X=HB(B.current,Sj(J,H.current));if(B.current!==X)B.current=X,G5.schedule(Q)}),[J]),()=>B.current,()=>B.current)}var _3=P(m(),1);function W5($,Z){let J=$1(Z),[H]=_3.useState(()=>new IN(J,$));_3.useEffect(()=>{H.setOptions($)},[H,$]);let B=_3.useSyncExternalStore(_3.useCallback((X)=>H.subscribe(G5.batchCalls(X)),[H]),()=>H.getCurrentResult(),()=>H.getCurrentResult()),Q=_3.useCallback((...X)=>{H.mutate(X[0],X[1]).catch(c5)},[H]);if(B.error&&CZ(H.options.throwOnError,[B.error]))throw B.error;return{...B,mutate:Q,mutateAsync:B.mutate}}var Lt=P(bq0(),1);function Ij($,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 l7=P(m(),1),g1=P(m(),1);var Lz=P(SZ(),1);var rt=l7.useInsertionEffect,at=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",vN=at?l7.useLayoutEffect:l7.useEffect,ot=rt||vN,Mz=($)=>{let Z=l7.useRef([$,(...J)=>Z[0](...J)]).current;return ot(()=>{Z[0]=$}),Z[1]};var kj=["popstate","pushState","replaceState","hashchange"],QB=[],yj=()=>QB.forEach(($)=>$()),nt=($)=>{if(QB.push($)===1)kj.forEach((Z)=>addEventListener(Z,yj));return()=>{if(QB=QB.filter((Z)=>Z!==$),!QB.length)kj.forEach((Z)=>removeEventListener(Z,yj))}},fj=($,Z)=>Lz.useSyncExternalStore(nt,$,Z),xj=()=>location.search,Pz=({ssrSearch:$}={})=>fj(xj,$!=null?()=>$:xj),hj=()=>location.pathname,i7=({ssrPath:$}={})=>fj(hj,$!=null?()=>$:hj);var st=($,{replace:Z=!1,state:J=null}={})=>history[Z?"replaceState":"pushState"](J,"",$),gj=($)=>[i7($),st],vj=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[vj]>"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,vj,{value:!0})}var uj=($="")=>$==="/"?"":$,pj=($,Z)=>$[0]==="~"?$.slice(1):uj(Z)+$,fN=($,Z)=>{return $=mj(uj($)),Z=mj(Z),!$||!Z.toLowerCase().indexOf($.toLowerCase())?Z.slice($.length)||"/":"~"+Z},mj=($)=>{try{return $.includes("%")?decodeURI($):$}catch(Z){return $}};var cj={hook:gj,searchHook:Pz,parser:Ij,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:($)=>$,aroundNav:($,Z,J)=>$(Z,J)},dj=g1.createContext(cj),C2=()=>g1.useContext(dj),lj={},ij=g1.createContext(lj),gN=()=>g1.useContext(ij),rj=($,Z=$.base)=>fN(Z,$.hook($)[0]),mN=($)=>{let[Z,J]=$.hook($);return[fN($.base,Z),Mz((H,B)=>$.aroundNav(J,pj(H,$.base),B))]},m4=()=>mN(C2());var aj=($,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 uN=({children:$,...Z})=>{let J=C2(),H=Z.hook?cj: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(dj.Provider,{value:B},$)},tt=({children:$,component:Z},J)=>{if(Z)return g1.createElement(Z,{params:J});return typeof $==="function"?$(J):$},et=($)=>{let Z=g1.useRef(lj),J=Z.current,H=Object.keys($);return Z.current=H.length!==Object.keys(J).length||H.some((B)=>$[B]!==J[B])?$:J};var _z=({path:$,nest:Z,match:J,...H})=>{let B=C2(),Q=rj(B),[X,z,G]=J??aj(B.parser,$,Q,Z),U=et({...gN(),...z});if(!X)return null;let Y=tt(H,U);return g1.createElement(ij.Provider,{value:U},G?g1.createElement(uN,{base:G},Y):Y)},r7=g1.forwardRef(($,Z)=>{let J=C2(),[H,B]=mN(J),{to:Q="",href:X=Q,onClick:z,asChild:G,children:U,className:Y,replace:K,state:F,transition:W,...q}=$;if(q.onClick=Mz((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)}),oj=($,Z=[])=>{if(Array.isArray($))for(let J of $)oj(J&&J.type===g1.Fragment?J.props.children:J,Z);else Z.push($);return Z},nj=({children:$,location:Z})=>{let J=C2(),H=rj(J);for(let B of oj($)){let Q=0;if(g1.isValidElement(B)&&(Q=aj(J.parser,B.props.path,Z||H,B.props.nest))[0])return g1.cloneElement(B,{match:Q})}return null},sj=($)=>{let{to:Z,href:J=Z}=$,H=C2(),[,B]=mN(H),Q=Mz(()=>B(Z||J,$)),{ssrContext:X}=H;if(vN(()=>{Q()},[]),X)X.redirectTo=Z;return null};var z4={};I5(z4,{useToastManager:()=>cE,createToastManager:()=>dE,Viewport:()=>xT,Title:()=>UC,Root:()=>eT,Provider:()=>RT,Positioner:()=>gE,Portal:()=>LC,Description:()=>zC,Content:()=>$C,Close:()=>YC,Arrow:()=>uE,Action:()=>FC});var ST=P(m(),1);var tj=P(m(),1);function B6($){tj.useEffect($,Z4)}var Oz=P(m(),1),pN=Oz.createContext(void 0);function j9(){let $=Oz.useContext(pN);if(!$)throw Error(k0(73));return $}var JT=P(m(),1),iN=P(SZ(),1);var Q6=P(m(),1),$e=SZ();function Ze($,Z){return $===Z&&($!==0||1/$===1/Z)||$!==$&&Z!==Z}var Je=typeof Object.is==="function"?Object.is:Ze,He=$e.useSyncExternalStore,Be=Q6.useRef,Qe=Q6.useEffect,Xe=Q6.useMemo,ze=Q6.useDebugValue;var cN=function($,Z,J,H,B){var Q=Be(null);if(Q.current===null){var X={hasValue:!1,value:null};Q.current=X}else X=Q.current;Q=Xe(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,Je(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=He($,Q[0],Q[1]);return Qe(function(){X.hasValue=!0,X.value=z},[z]),ze(z),z};var ej=P(m(),1);var dN=[],lN=void 0;function $T(){return lN}function ZT($){dN.push($)}function r8($){let Z=(J,H)=>{let B=$5(Ge).current,Q;try{lN=B;for(let X of dN)X.before(B);Q=$(J,H);for(let X of dN)X.after(B);B.didInitialize=!0}finally{lN=void 0}return Q};return Z.displayName=$.displayName||$.name,Z}function T9($){return ej.forwardRef(r8($))}function Ge(){return{didInitialize:!1}}var Ue=jz(19),Ye=Ue?Fe:We;function Tz($,Z,J,H,B){return Ye($,Z,J,H,B)}function Ke($,Z,J,H,B){let Q=JT.useCallback(()=>Z($.getSnapshot(),J,H,B),[$,Z,J,H,B]);return iN.useSyncExternalStore($.subscribe,Q,Q)}ZT({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()}};iN.useSyncExternalStore($.subscribe,$.getSnapshot,$.getSnapshot)}}});function Fe($,Z,J,H,B){let Q=$T();if(!Q)return Ke($,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 We($,Z,J,H,B){return cN($.subscribe,$.getSnapshot,$.getSnapshot,(Q)=>Z(Q,J,H,B))}class rN{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 Tz(this,$,Z,J,H)}}var a7=P(m(),1);class g2 extends rN{constructor($,Z={},J){super($);this.context=Z,this.selectors=J}useSyncedValue($,Z){a7.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){a7.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 a7.useDebugValue($),Tz(this,this.selectors[$],Z,J,H)}useContextCallback($,Z){a7.useDebugValue($);let J=Y0(Z??G1);this.context[$]=J}useStateSetter($){let Z=a7.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 E2(...$){return()=>{for(let Z=0;Z<$.length;Z+=1){let J=$[Z];if(J)J()}}}function o0($,Z,J,H){return $.addEventListener(Z,J,H),()=>{$.removeEventListener(Z,J,H)}}var Cz=P(m(),1);function HT(){let[,$]=Cz.useState({});return Cz.useCallback(()=>{$({})},[])}var Ez=null,rD0=globalThis.requestAnimationFrame;class BT{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 bz=new BT;class m2{static create(){return new m2}static request($){return bz.request($)}static cancel($){return bz.cancel($)}currentId=Ez;request($){this.cancel(),this.currentId=bz.request(()=>{this.currentId=Ez,$()})}cancel=()=>{if(this.currentId!==Ez)bz.cancel(this.currentId),this.currentId=Ez};disposeEffect=()=>{return this.cancel}}function C4(){let $=$5(m2.create).current;return B6($.disposeEffect),$}var XB=0;class r5{static create(){return new r5}currentId=XB;start($,Z){this.clear(),this.currentId=setTimeout(()=>{this.currentId=XB,Z()},$)}isStarted(){return this.currentId!==XB}clear=()=>{if(this.currentId!==XB)clearTimeout(this.currentId),this.currentId=XB};disposeEffect=()=>{return this.clear}}function r1(){let $=$5(r5.create).current;return B6($.disposeEffect),$}var QT=0;function wz($){return QT+=1,`${$}-${Math.random().toString(36).slice(2,6)}-${QT}`}function Sz($,Z){if(typeof $==="string")return{description:$};if(typeof $==="function"){let J=$(Z);return typeof J==="string"?{description:J}:J}return $}var J5={};I5(J5,{screenReader:()=>eN,os:()=>nN,mediaQuery:()=>ZA,env:()=>$A,engine:()=>tN});var nN={};I5(nN,{windows:()=>De,mac:()=>UT,linux:()=>Ve,ios:()=>aN,apple:()=>oN,android:()=>GT});function qe(){if(typeof navigator>"u")return{userAgent:"",platform:"",maxTouchPoints:0};return{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:Ne,platform:Ae,maxTouchPoints:XT}=qe(),o7=Ne.toLowerCase(),n7=Ae.toLowerCase();var aN=/^i(os$|p)/.test(n7)||n7==="macintel"&&XT>1,zT="android",GT=n7===zT||o7.includes(zT),UT=!aN&&n7.startsWith("mac"),De=n7.startsWith("win"),Ve=!GT&&/^(linux|chrome os)/.test(n7),oN=UT||aN;var tN={};I5(tN,{webkit:()=>sN,gecko:()=>Le,blink:()=>Me});var sN=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none"),Le=!sN&&o7.includes("firefox"),Me=!sN&&o7.includes("chrom");var eN={};I5(eN,{voiceOver:()=>Pe});var Pe=oN;var $A={};I5($A,{jsdom:()=>_e});var _e=/jsdom|happydom/.test(o7);var ZA={};I5(ZA,{iOS:()=>Oe});var Oe="@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&&X6(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 zB="data-base-ui-focusable";var JA="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",GB="ArrowLeft",UB="ArrowRight",HA="ArrowUp",Rz="ArrowDown";var G8={};I5(G8,{startingStyle:()=>s7,endingStyle:()=>YB});var s7="data-starting-style",YB="data-ending-style";var je={[s7]:""},Te={[YB]:""},G2={transitionStatus($){if($==="starting")return je;if($==="ending")return Te;return null}};var t7={};I5(t7,{startingStyle:()=>Ce,side:()=>be,open:()=>BA,endingStyle:()=>Ee,closed:()=>QA,anchorHidden:()=>XA,align:()=>we});var BA="data-open",QA="data-closed",Ce=s7,Ee=YB,XA="data-anchor-hidden",be="data-side",we="data-align";var kz={};I5(kz,{pressed:()=>zA,popupOpen:()=>Iz});var Iz="data-popup-open",zA="data-pressed";var Se={[Iz]:""},Re={[Iz]:"",[zA]:""},Ie={[BA]:""},ke={[QA]:""},ye={[XA]:""},C9={open($){if($)return Se;return null}},KB={open($){if($)return Re;return null}},U8={open($){if($)return Ie;return ke},anchorHidden($){if($)return ye;return null}},J4={...U8,...G2};var WV0=kz.popupOpen,FB="data-trigger-disabled";function z6($,Z){if(!s0($))return!1;let J=$;if(Z.hasElement(J))return!J.hasAttribute(FB);for(let[,H]of Z.entries())if(R0(H,J))return!H.hasAttribute(FB);return!1}function yz($,Z){if(Z==null)return!1;if("composedPath"in $)return $.composedPath().includes(Z);let J=$;return J.target!=null&&Z.contains(J.target)}function KT($){return $.matches("html,body")}function e7($){return _1($)&&$.matches(JA)}function GA($){return $?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${JA}`)!=null}function WB($){if(!$)return!1;return $.getAttribute("role")==="combobox"&&e7($)}function E9($){if(!$||J5.env.jsdom)return!0;try{return $.matches(":focus-visible")}catch(Z){return!0}}function qB($){if(!$)return null;return $.hasAttribute(zB)?$:$.querySelector(`[${zB}]`)||$}function C8($,Z,J=!0){return $.filter((B)=>B.parentId===Z).flatMap((B)=>[...!J||B.context?.open?[B]:[],...C8($,B.id,J)])}function UA($,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 u4($){$.preventDefault(),$.stopPropagation()}function FT($){return"nativeEvent"in $}function RZ($){if($.pointerType===""&&$.isTrusted)return!0;if(J5.os.android&&$.pointerType)return $.type==="click"&&$.buttons===1;return $.detail===0&&!$.pointerType}function IZ($){if(J5.env.jsdom)return!1;return!J5.os.android&&$.width===0&&$.height===0||J5.os.android&&$.width===1&&$.height===1&&$.pressure===0&&$.detail===0&&$.pointerType==="mouse"||$.width<1&&$.height<1&&$.pressure===0&&$.detail===0&&$.pointerType==="touch"}function Y8($,Z){let J=["mouse","pen"];if(!Z)J.push("",void 0);return J.includes($)}function WT($){let Z=$.type;return Z==="click"||Z==="mousedown"||Z==="keydown"||Z==="keyup"}var{min:G6,max:a8,round:U6,floor:AB}=Math,b9=($)=>({x:$,y:$}),xe={left:"right",right:"left",bottom:"top",top:"bottom"};function hz($,Z,J){return a8($,G6(Z,J))}function w9($,Z){return typeof $==="function"?$(Z):$}function H4($){return $.split("-")[0]}function E8($){return $.split("-")[1]}function vz($){return $==="x"?"y":"x"}function DB($){return $==="y"?"height":"width"}function p4($){let Z=$[0];return Z==="t"||Z==="b"?"y":"x"}function VB($){return vz(p4($))}function AT($,Z,J){if(J===void 0)J=!1;let H=E8($),B=VB($),Q=DB(B),X=B==="x"?H===(J?"end":"start")?"right":"left":H==="start"?"bottom":"top";if(Z.reference[Q]>Z.floating[Q])X=NB(X);return[X,NB(X)]}function DT($){let Z=NB($);return[xz($),Z,xz(Z)]}function xz($){return $.includes("start")?$.replace("start","end"):$.replace("end","start")}var qT=["left","right"],NT=["right","left"],he=["top","bottom"],ve=["bottom","top"];function fe($,Z,J){switch($){case"top":case"bottom":if(J)return Z?NT:qT;return Z?qT:NT;case"left":case"right":return Z?he:ve;default:return[]}}function VT($,Z,J,H){let B=E8($),Q=fe(H4($),J==="start",H);if(B){if(Q=Q.map((X)=>X+"-"+B),Z)Q=Q.concat(Q.map(xz))}return Q}function NB($){let Z=H4($);return xe[Z]+$.slice(Z.length)}function ge($){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 fz($){return typeof $!=="number"?ge($):{top:$,right:$,bottom:$,left:$}}function $$($){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 Y6($,Z){return Z<0||Z>=$.length}function Z$($,Z){return b8($.current,{disabledIndices:Z})}function kZ($,Z){return b8($.current,{decrement:!0,startingIndex:$.current.length,disabledIndices:Z})}function b8($,{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&&O3($,Q,H));return Q}function O3($,Z,J){if(typeof J==="function"?J(Z):J?.includes(Z)??!1)return!0;let B=$[Z];if(!B)return!1;if(!J$(B))return!0;if(B.matches(":disabled"))return!0;return!J&&(B.hasAttribute("disabled")||B.getAttribute("aria-disabled")==="true")}function me($){return $.visibility==="hidden"||$.visibility==="collapse"}function J$($,Z=$?u2($):null){if(!$||!$.isConnected||!Z||me(Z))return!1;if(typeof $.checkVisibility==="function")return $.checkVisibility();return Z.display!=="none"&&Z.display!=="contents"}var ue='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function pe($){let Z=$.assignedSlot;if(Z)return Z;if($.parentElement)return $.parentElement;let J=$.getRootNode();return X6(J)?J.host:null}function KA($){for(let Z of Array.from($.children))if(b2(Z)==="summary")return Z;return null}function ce($,Z){let J=KA(Z);return!!J&&($===J||R0(J,$))}function LT($){let Z=$?b2($):"";return $!=null&&$.matches(ue)&&(Z!=="summary"||$.parentElement!=null&&b2($.parentElement)==="details"&&KA($.parentElement)===$)&&(Z!=="details"||KA($)==null)&&(Z!=="input"||$.type!=="hidden")}function MT($){if(!LT($)||!$.isConnected||$.matches(":disabled"))return!1;for(let Z=$;Z;Z=pe(Z)){let J=Z!==$,H=b2(Z)==="slot";if(Z.hasAttribute("inert"))return!1;if(J&&b2(Z)==="details"&&!Z.open&&!ce($,Z)||Z.hasAttribute("hidden")||!H&&!de(Z,J))return!1}return!0}function de($,Z){let J=u2($);if(!Z)return J$($,J);return J.display!=="none"}function PT($){let Z=$.tabIndex;if(Z<0){let J=b2($);if(J==="details"||J==="audio"||J==="video"||_1($)&&$.isContentEditable)return 0}return Z}function YA($){if(b2($)!=="input")return null;let Z=$;return Z.type==="radio"&&Z.name!==""?Z:null}function le($,Z){let J=YA($);if(!J)return!0;let H=Z.find((B)=>{let Q=YA(B);return Q?.name===J.name&&Q.form===J.form&&Q.checked});if(H)return H===J;return Z.find((B)=>{let Q=YA(B);return Q?.name===J.name&&Q.form===J.form})===J}function _T($){if(_1($)&&b2($)==="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 OT($,Z){_T($).forEach((J)=>{if(LT(J))Z.push(J);OT(J,Z)})}function jT($,Z,J){_T($).forEach((H)=>{if(_1(H)&&H.matches(Z))J.push(H);jT(H,Z,J)})}function gz($){return MT($)&&PT($)>=0}function FA($){let Z=[];return OT($,Z),Z.filter(MT)}function yZ($){let Z=FA($);return Z.filter((J)=>PT(J)>=0&&le(J,Z))}function TT($,Z){let J=yZ($),H=J.length;if(H===0)return;let B=d1(g0($)),Q=J.indexOf(B),X=Q===-1?Z===1?0:H-1:Q+Z;return J[X]}function xZ($){return TT(g0($).body,1)||$}function mz($){return TT(g0($).body,-1)||$}function CT($,Z){if(!$)return null;let J=yZ(g0($).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 ET($){return CT($,1)}function bT($){return CT($,-1)}function j3($,Z){let J=Z||$.currentTarget,H=$.relatedTarget;return!H||!R0(J,H)}function wT($){yZ($).forEach((J)=>{J.dataset.tabindex=J.getAttribute("tabindex")||"",J.setAttribute("tabindex","-1")})}function WA($){let Z=[];jT($,"[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 qA($){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 NA($,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 o8={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 AA extends g2{timers=new Map;areTimersPaused=!1;constructor($){super({...$,toastMetadata:qA($.toasts)},{},o8)}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=NA(this.state.toasts,Z);H.toasts=B,H.toastMetadata=qA(B)}this.update(H)}disposeEffect=()=>{return()=>{this.timers.forEach(($)=>{$.timeout?.clear()}),this.timers.clear()}};removeToast($,Z=!1){let J=o8.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||wz("toast");if($.id){let z=o8.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(NA(Q,J));let X=B.timeout??Z;if(B.type!=="loading"&&X>0)this.scheduleTimer(H,X,()=>this.closeToast(H));if(o8.expandedOrOutOfFocus(this.state))this.pauseTimers();return H};updateToast=($,Z)=>{let J=o8.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=o8.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($)),o8.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=o8.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=NA(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=Sz(Z.loading),H=this.addToast({...J,type:"loading"}),B=$.then((Q)=>{let X=Sz(Z.success,Q);return this.updateToast(H,{...X,type:"success",timeout:X.timeout}),Q}).catch((Q)=>{let X=Sz(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??=r5.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=!o8.expandedOrOutOfFocus(this.state)?r5.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:qA($)};if(Z)J.hovering=!1,J.focused=!1;this.update(J)}handleFocusManagement($){let Z=d1(g0(this.state.viewport));if(!this.state.viewport||!R0(this.state.viewport,Z)||!E9(Z))return;if($===void 0){this.restoreFocusToPrevElement();return}let J=o8.toasts(this.state),H=o8.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 uz=P(c(),1),RT=function(Z){let{children:J,timeout:H=5000,limit:B=3,toastManager:Q}=Z,X=$5(()=>new AA({timeout:H,limit:B,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return B6(X.disposeEffect),ST.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]),uz.jsxs(pN.Provider,{value:X,children:[uz.jsx(ie,{store:X,timeout:H,limit:B}),J]})};function ie($){let{store:Z,timeout:J,limit:H}=$;return H0(()=>{Z.syncProviderProps(J,H)},[Z,J,H]),null}var w8=P(m(),1);var IT={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},n8={...IT,position:"fixed",top:0,left:0},pz={...IT,position:"absolute"};var cz=P(m(),1);var kT=P(c(),1),c4=cz.forwardRef(function(Z,J){let[H,B]=cz.useState();return H0(()=>{if(J5.screenReader.voiceOver&&J5.engine.webkit)B("button")},[]),kT.jsx("span",{...Z,ref:J,style:n8,"aria-hidden":H?void 0:!0,...{tabIndex:0,role:H},"data-base-ui-focus-guard":""})});var yT="--toast-frontmost-height";var T3=P(c(),1),xT=w8.forwardRef(function(Z,J){let{render:H,className:B,style:Q,children:X,...z}=Z,G=j9(),U=r1(),Y=w8.useRef(!1),K=w8.useRef(!1),F=w8.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((f)=>f.transitionStatus==="ending"),O=q.filter((f)=>f.priority==="high");w8.useEffect(()=>{let f=G.state.viewport;if(!f||W)return;let E=S1(f),l=g0(f);function r(o){if(o.key==="F6"&&P1(o)!==f)o.preventDefault(),G.set("prevFocusElement",d1(l)),f?.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(g0(f));if(p===E||!R0(f,p)||!E9(i))G.resumeTimers();U.start(0,()=>G.set("isWindowFocused",!0))}return E2(o0(E,"keydown",r),o0(E,"blur",h,!0),o0(E,"focus",d,!0),o0(l,"pointerdown",G.handleDocumentPointerDown,!0))},[G,U,W]);function M(f){Y.current=!0;let E=f.relatedTarget===G.state.viewport?q.find((l)=>l.transitionStatus!=="ending"&&!l.limited):void 0;if(E)E.ref?.current?.focus();else G.restoreFocusToPrevElement()}function _(f){if(f.key==="Tab"&&f.shiftKey&&P1(f.nativeEvent)===G.state.viewport)f.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}w8.useEffect(w,[L,G]);function C(){G.pauseTimers(),G.set("hovering",!0),K.current=!1}function b(){if(G.state.isWindowFocused)G.resumeTimers()}function T(){K.current=!0,w()}function I(f){if(f.pointerType==="touch")F.current=!0}function S(f){if(f.pointerType!=="touch")return;F.current=!1,w()}function R(){if(Y.current){Y.current=!1;return}if(N)return;if(E9(d1(g0(G.state.viewport))))G.set("focused",!0),G.pauseTimers()}function j(f){if(!N||R0(G.state.viewport,f.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:C,onMouseMove:C,onMouseLeave:T,onFocus:R,onBlur:j,onKeyDown:_,onClick:R,onPointerDown:I,onPointerUp:S,onPointerCancel:S,style:{[yT]:V?`${V}px`:void 0}},k={expanded:D},x=!W&&A&&T3.jsx(c4,{onFocus:M}),v=G0("div",Z,{ref:[J,G.setViewport],state:k,props:[y,z,{children:T3.jsxs(w8.Fragment,{children:[x,X,x]})}]});return T3.jsxs(w8.Fragment,{children:[x,v,!N&&O.length>0&&T3.jsx("div",{style:n8,children:O.map((f)=>T3.jsxs("div",{role:"alert","aria-atomic":!0,children:[T3.jsx("div",{children:f.title}),T3.jsx("div",{children:f.description})]},f.id))})]})});var L5=P(m(),1),sT=P(K8(),1);function S8($){if(jz(19))return $;return $?"true":void 0}var dz=P(m(),1),DA=dz.createContext(void 0);function K6(){let $=dz.useContext(DA);if(!$)throw Error(k0(66));return $}var hT=P(m(),1);var VA=P(K8(),1);function s8($){if($==null)return $;return"current"in $?$.current:$}var lz=null;function ae($){if(!lz){let Z=[];lz=Z,queueMicrotask(()=>{lz=null,VA.flushSync(()=>{for(let J of Z)J()})})}lz.push($)}function d4($,Z=!1,J=!1){let H=C4();return Y0((B,Q=null)=>{H.cancel();let X=s8($);if(X==null)return;let z=X,G=()=>{if(!J){VA.flushSync(B);return}ae(()=>{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=s7;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 V5($){let{enabled:Z=!0,open:J,ref:H,batch:B=!1,onComplete:Q}=$,X=Y0(Q),z=d4(H,J,B);hT.useEffect(()=>{if(!Z)return;let G=new AbortController;return z(X,G.signal),()=>{G.abort()}},[Z,J,X,z])}var vT=500,iz=500,fT={style:{transition:"none"}},hZ="data-base-ui-click-trigger";var gT="[data-base-ui-swipe-ignore]",mT="[data-swipe-ignore]",uT={fallbackAxisSide:"none"},S9={fallbackAxisSide:"end"},pT={clipPath:"inset(50%)",position:"fixed",top:0,left:0};var az=P(m(),1);function w2($,Z=Number.MIN_SAFE_INTEGER,J=Number.MAX_SAFE_INTEGER){return Math.max(Z,Math.min($,J))}function rz($,Z){let J=(Z??S1($).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 oz($,Z,J){switch($){case"up":return-J;case"down":return J;case"left":return-Z;case"right":return Z;default:return 0}}var nz="--toast-index",cT="--toast-offset-y",dT="--toast-height",lT="--toast-swipe-movement-x",iT="--toast-swipe-movement-y";var aT="data-swipe-direction",CL0=G8.startingStyle,EL0=G8.endingStyle;var tT=P(c(),1),ne={...G2,swipeDirection($){return $?{[aT]:$}:null}},oT=40,se=10,nT=0.5,te=1,ee=`${gT},${mT}`,eT=L5.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=j9(),[W,q]=L5.useState(void 0),[N,D]=L5.useState(!1),[A,V]=L5.useState(!1),[L,O]=L5.useState({x:0,y:0}),[M,_]=L5.useState({x:0,y:0,scale:1}),[w,C]=L5.useState(),[b,T]=L5.useState(),[I,S]=L5.useState(null),R=L5.useRef(null),j=L5.useRef(void 0),y=L5.useRef({x:0,y:0}),k=L5.useRef({x:0,y:0,scale:1}),x=L5.useRef(void 0),v=L5.useRef(0),f=L5.useRef(!1),E=L5.useRef({x:0,y:0}),l=L5.useRef(!1),r=L5.useRef({x:0,y:0}),h=L5.useRef(null),d=L5.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");V5({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 g=A0.offsetHeight;A0.style.height=L0;function u(){F.updateToastInternal(H.id,{ref:R,height:g,transitionStatus:void 0})}if(M0)sT.flushSync(u);else u()});H0(()=>{let M0=j.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});j.current=H.id,J0()},[J0,H.id,H.transitionStatus]);function U0(M0){r.current=M0,O(M0)}H0(()=>{return()=>{d.current?.abort()}},[]);function z0(M0,A0){let L0=(t)=>t>0?t**nT:-(Math.abs(t)**nT),g=M0>0&&!Y.includes("right")||M0<0&&!Y.includes("left"),u=A0>0&&!Y.includes("down")||A0<0&&!Y.includes("up");return{x:g?L0(M0):M0,y:u?L0(A0):A0}}let Q0=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=k.current;if(M0.type==="pointercancel"||f.current){U0({x:A0.x,y:A0.y}),q(void 0);return}let L0=r.current,g=L0.x-A0.x,u=L0.y-A0.y,t;for(let W0 of Y)if(oz(W0,g,u)>oT){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;f.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 g=M0.currentTarget,u=rz(g);k.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=g0(g);W0.addEventListener("pointerup",Q0,{signal:t.signal}),W0.addEventListener("pointercancel",Q0,{signal:t.signal}),g.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:g,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(g<0&&L0>E.current.x||g>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,f0=I;if(!A){if(Math.sqrt(t*t+W0*W0)>=te){V(!0);let W1=Y.includes("left")||Y.includes("right"),z5=Y.includes("up")||Y.includes("down");if(W1&&z5){let C0=Math.abs(t),x0=Math.abs(W0);f0=C0>x0?"horizontal":"vertical",S(f0)}}}let T0;if(!x.current){if(f0==="vertical"){if(W0>0)T0="down";else if(W0<0)T0="up"}else if(f0==="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=oz(T0,t,W0),q(T0)}else{let E1=x.current,W1=oz(E1,p0,S0);if(W1>oT)f.current=!1,q(E1);else if(!(Y.includes("left")&&Y.includes("right"))&&!(Y.includes("up")&&Y.includes("down"))&&v.current-W1>=se)f.current=!0}let d0=z0(t,W0),z1=k.current.x,e0=k.current.y,c0=Y.includes("left")||Y.includes("right"),y0=Y.includes("up")||Y.includes("down");if(f0!=="vertical"&&c0)z1+=d0.x;if(f0!=="horizontal"&&y0)e0+=d0.y;U0({x:z1,y:e0})}function F0(M0){if(M0.key==="Escape"){if(!R.current||!R0(R.current,d1(g0(R.current))))return;F.closeToast(H.id)}}L5.useEffect(()=>{let M0=R.current;if(!K||!M0)return;function A0(L0){if(h.current===null||!R0(M0,P1(L0)))return;L0.preventDefault()}return o0(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,[lT]:`${M0}px`,[iT]:`${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?Q0:void 0,onPointerCancel:K?Q0:void 0,onKeyDown:F0,inert:S8(H.limited),style:{...s(),[nz]:H.transitionStatus==="ending"?o:p,[cT]:`${i}px`,[dT]:H.height?`${H.height}px`:void 0}},$0=L5.useMemo(()=>({toast:H,setTitleId:C,setDescriptionId:T,recalculateHeight:J0,visibleIndex:p,expanded:Z0}),[H,C,T,J0,p,Z0]),X0={transitionStatus:H.transitionStatus,expanded:Z0,limited:H.limited||!1,type:H.type,swiping:N,swipeDirection:W},_0=G0("div",Z,{ref:[J,R],state:X0,stateAttributesMapping:ne,props:[e,G]});return tT.jsx(DA.Provider,{value:$0,children:_0})});var sz=P(m(),1);var $C=sz.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,{visibleIndex:z,expanded:G,recalculateHeight:U}=K6(),Y=sz.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 XC=P(m(),1);var tz=P(m(),1);var ZC=0;function $00($,Z="mui"){let[J,H]=tz.useState($),B=$||J;return tz.useEffect(()=>{if(J==null)ZC+=1,H(`${Z}-${ZC}`)},[J,Z]),B}var JC=HC.useId;function E4($,Z){if(JC!==void 0){let J=JC();return $??(Z?`${Z}-${J}`:J)}return $00($,Z)}var BC=P(m(),1);function QC($){if($==null||typeof $==="boolean"||$==="")return!1;if(Array.isArray($))return $.some(QC);return!0}function ez($){return BC.isValidElement($)&&QC($.props.children)}function $G($,Z,J){let{toast:H,setTitleId:B,setDescriptionId:Q}=K6(),X=J==="title"?B:Q,z=Z??(J==="title"?H.title:H.description);return{id:E4($),children:z,type:H.type,setId:X}}function ZG($,Z,J){let H=ez($);return H0(()=>{if(!H)return;return J(Z),()=>{J((B)=>B===Z?void 0:B)}},[H,Z,J]),H?$:null}var zC=XC.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}=$G(X,z,"description"),q=G0("p",Z,{ref:J,state:{type:K},props:{...G,id:U,children:Y}});return ZG(q,U,F)});var GC=P(m(),1);var UC=GC.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}=$G(X,z,"title"),q=G0("h2",Z,{ref:J,state:{type:K},props:{...G,id:U,children:Y}});return ZG(q,U,F)});var JG=P(m(),1);var YC=JG.forwardRef(function(Z,J){let{render:H,className:B,style:Q,disabled:X,nativeButton:z=!0,...G}=Z,U=j9(),{toast:Y,expanded:K}=K6(),[F,W]=JG.useState(!1),{getButtonProps:q,buttonRef:N}=w5({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 KC=P(m(),1);var FC=KC.forwardRef(function(Z,J){let{render:H,className:B,style:Q,disabled:X,nativeButton:z=!0,...G}=Z,{toast:U}=K6(),Y=U.actionProps?.children??G.children,{getButtonProps:K,buttonRef:F}=w5({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 ez(q)?q:null});var DC=P(m(),1);var QG=P(m(),1),NC=P(K8(),1);var x5=P(m(),1),LA=P(K8(),1);var K0={};I5(K0,{windowResize:()=>x00,wheel:()=>C00,triggerPress:()=>J00,triggerHover:()=>H00,triggerFocus:()=>B00,trackPress:()=>K00,swipe:()=>y00,siblingOpen:()=>w00,scrub:()=>E00,pointer:()=>j00,outsidePress:()=>Q00,none:()=>Z00,missing:()=>R00,listNavigation:()=>_00,linkPress:()=>G00,keyboard:()=>O00,itemPress:()=>X00,inputPress:()=>V00,inputPaste:()=>D00,inputClear:()=>N00,inputChange:()=>q00,inputBlur:()=>A00,initial:()=>I00,incrementPress:()=>F00,imperativeAction:()=>k00,focusOut:()=>L00,escapeKey:()=>M00,drag:()=>T00,disabled:()=>S00,decrementPress:()=>W00,closeWatcher:()=>P00,closePress:()=>z00,clearPress:()=>U00,chipRemovePress:()=>Y00,cancelOpen:()=>b00});var Z00="none",J00="trigger-press",H00="trigger-hover",B00="trigger-focus",Q00="outside-press",X00="item-press",z00="close-press",G00="link-press",U00="clear-press",Y00="chip-remove-press",K00="track-press",F00="increment-press",W00="decrement-press",q00="input-change",N00="input-clear",A00="input-blur",D00="input-paste",V00="input-press",L00="focus-out",M00="escape-key",P00="close-watcher",_00="list-navigation",O00="keyboard",j00="pointer",T00="drag",C00="wheel",E00="scrub",b00="cancel-open",w00="sibling-open",S00="disabled",R00="missing",I00="initial",k00="imperative-action",y00="swipe",x00="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 HG($,Z,J){let H=J??M1;return{reason:$,event:Z??new Event("base-ui"),...H}}function C3($){return`data-base-ui-${$}`}var H$=P(c(),1),qC=x5.createContext(null),MA=()=>x5.useContext(qC),h00=C3("portal");function BG($={}){let{ref:Z,container:J,componentProps:H=M1,elementProps:B}=$,Q=E4(),z=MA()?.portalNode,[G,U]=x5.useState(null),[Y,K]=x5.useState(null),F=Y0((D)=>{if(D!==null)K(D)}),W=x5.useRef(null);H0(()=>{if(J===null){if(W.current)W.current=null,K(null),U(null);return}let D=(J&&(WC(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,[h00]:""},B]}),N=G&&q?LA.createPortal(q,G):null;return{node:Y,nodeId:x5.isValidElement(q)?q.props.id:void 0,subtree:N}}var B$=x5.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}=BG({container:z,ref:J,componentProps:Z,elementProps:U}),W=x5.useRef(null),q=x5.useRef(null),N=x5.useRef(null),D=x5.useRef(null),[A,V]=x5.useState(null),L=x5.useRef(!1),O=A?.modal,M=A?.open,_=!!A&&!A.modal&&A.open&&!!Y;x5.useEffect(()=>{if(!Y||O)return;function C(b){if(Y&&b.relatedTarget&&j3(b))if(b.type==="focusin"){if(L.current)WA(Y),L.current=!1}else wT(Y),L.current=!0}return E2(o0(Y,"focusin",C,!0),o0(Y,"focusout",C,!0))},[Y,O]),H0(()=>{if(!Y||M!==!0||!L.current)return;WA(Y),L.current=!1},[M,Y]);let w=x5.useMemo(()=>({beforeOutsideRef:W,afterOutsideRef:q,beforeInsideRef:N,afterInsideRef:D,portalNode:Y,setFocusManagerState:V}),[Y]);return H$.jsxs(x5.Fragment,{children:[F,H$.jsxs(qC.Provider,{value:w,children:[_&&Y&&H$.jsx(c4,{"data-type":"outside",ref:W,onFocus:(C)=>{if(j3(C,Y))N.current?.focus();else{let b=A?A.domReference:null;mz(b)?.focus()}}}),_&&Y&&H$.jsx("span",{role:G,"aria-owns":K,style:pT}),Y&&LA.createPortal(X,Y),_&&Y&&H$.jsx(c4,{"data-type":"outside",ref:q,onFocus:(C)=>{if(j3(C,Y))D.current?.focus();else{let b=A?A.domReference:null;if(xZ(b)?.focus(),A?.closeOnFocusOut)A?.onOpenChange(!1,w0(K0.focusOut,C.nativeEvent))}}})]})]})});var AC=P(c(),1),vZ=QG.forwardRef(function(Z,J){let{children:H,container:B,className:Q,render:X,style:z,...G}=Z,{node:U,subtree:Y}=BG({container:B,ref:J,componentProps:Z,elementProps:G});if(!Y&&!U)return null;return AC.jsxs(QG.Fragment,{children:[Y,U&&NC.createPortal(H,U)]})});var VC=P(c(),1),LC=DC.forwardRef(function(Z,J){return VC.jsx(vZ,{ref:J,...Z})});var wG=P(m(),1);var F8=P(m(),1);function q5($){let Z=$5(v00,$).current;return Z.next=$,H0(Z.effect),Z}function v00($){let Z={current:$,next:$,effect:()=>{Z.current=Z.next}};return Z}var b4=P(m(),1);function f00($,Z){if(Z!=null&&!Y8(Z))return 0;if(typeof $==="function")return $();return $}function t8($,Z,J){let H=f00($,J);if(typeof H==="number")return H;return H?.[Z]}function PA($){if(typeof $==="function")return $();return $}function XG($,Z){return Z||$==="click"||$==="mousedown"}function MC($){return $?.includes("mouse")&&$!=="mousedown"}var PC=P(c(),1),_C=b4.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new r5,currentIdRef:{current:null},currentContextRef:{current:null}});function g00($,Z){$.current=Z.current}function _A($){let{children:Z,delay:J,timeoutMs:H=0}=$,B=b4.useRef(J),Q=b4.useRef(J),X=b4.useRef(null),z=b4.useRef(null),G=r1();return H0(()=>{if(Q.current=J,!X.current){B.current=J;return}B.current={open:t8(B.current,"open"),close:t8(J,"close")}},[J,X,B,Q]),PC.jsx(_C.Provider,{value:b4.useMemo(()=>({hasProvider:!0,delayRef:B,initialDelayRef:Q,currentIdRef:X,timeoutMs:H,currentContextRef:z,timeout:G}),[H,G]),children:Z})}function OA($,Z={open:!1}){let{open:J}=Z,H="rootStore"in $?$.rootStore:$,B=H.useState("floatingId"),Q=b4.useContext(_C),{currentIdRef:X,delayRef:z,timeoutMs:G,initialDelayRef:U,currentContextRef:Y,hasProvider:K,timeout:F}=Q,[W,q]=b4.useState(!1),N=b4.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:t8(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,g00(z,U),F.clear()}}},[Y,X,z,B,U,F]),b4.useMemo(()=>({activeIdRef:X,hasProvider:K,delayRef:z,isInstantPhase:W}),[X,K,z,W])}var Q4=P(m(),1);var zG=0;function fZ($,Z={}){let{preventScroll:J=!1,sync:H=!1,shouldFocus:B}=Z;cancelAnimationFrame(zG);function Q(){if(B&&!B())return;$?.focus({preventScroll:J})}if(H)return Q(),G1;let X=requestAnimationFrame(Q);return zG=X,()=>{if(zG===X)cancelAnimationFrame(X),zG=0}}var jA={inert:new WeakMap,"aria-hidden":new WeakMap},OC="data-base-ui-inert",CA={inert:new WeakSet,"aria-hidden":new WeakSet},LB=new WeakMap,TA=0;function m00($){return CA[$]}function EC($){if(!$)return null;return X6($)?$.host:EC($.parentNode)}var jC=($,Z)=>Z.map((J)=>{if($.contains(J))return J;let H=EC(J);if($.contains(H))return H;return null}).filter((J)=>J!=null),TC=($)=>{let Z=new Set;return $.forEach((J)=>{let H=J;while(H&&!Z.has(H))Z.add(H),H=H.parentNode}),Z},CC=($,Z,J)=>{let H=[],B=(Q)=>{if(!Q||J.has(Q))return;Array.from(Q.children).forEach((X)=>{if(b2(X)==="script")return;if(Z.has(X))B(X);else H.push(X)})};return B($),H};function u00($,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=jC(Z,$),U=B?CC(Z,TC(G),new Set(G)):[],Y=[],K=[];if(Q){let F=jA[Q],W=m00(Q);z=W,X=F;let q=jC(Z,Array.from(Z.querySelectorAll("[aria-live]"))),N=G.concat(q);CC(Z,TC(N),new Set(N)).forEach((A)=>{let V=A.getAttribute(Q),L=V!==null&&V!=="false",O=(F.get(A)||0)+1;if(F.set(A,O),Y.push(A),O===1&&L)W.add(A);if(!L)A.setAttribute(Q,Q==="inert"?"":"true")})}if(B)U.forEach((F)=>{let W=(LB.get(F)||0)+1;if(LB.set(F,W),K.push(F),W===1)F.setAttribute(OC,"")});return TA+=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=(LB.get(F)||0)-1;if(LB.set(F,W),!W)F.removeAttribute(OC)});if(TA-=1,!TA)jA.inert=new WeakMap,jA["aria-hidden"]=new WeakMap,CA.inert=new WeakSet,CA["aria-hidden"]=new WeakSet,LB=new WeakMap}}function EA($,Z={}){let{ariaHidden:J=!1,inert:H=!1,mark:B=!0}=Z,Q=g0($[0]).body;return u00($,Q,J,H,{mark:B})}var F6=P(m(),1);function GG(){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 Q${nodesRef={current:[]};events=GG();addNode($){this.nodesRef.current.push($)}removeNode($){let Z=this.nodesRef.current.findIndex((J)=>J===$);if(Z!==-1)this.nodesRef.current.splice(Z,1)}}var bA=P(c(),1),bC=F6.createContext(null),wC=F6.createContext(null),w4=()=>F6.useContext(bC)?.id||null,B4=($)=>{let Z=F6.useContext(wC);return $??Z};function E3($){let Z=E4(),J=B4($),H=w4();return H0(()=>{if(!Z)return;let B={id:Z,parentId:H};return J?.addNode(B),()=>{J?.removeNode(B)}},[J,Z,H]),Z}function X$($){let{children:Z,id:J}=$,H=w4();return bA.jsx(bC.Provider,{value:F6.useMemo(()=>({id:J,parentId:H}),[J,H]),children:Z})}function z$($){let{children:Z,externalTree:J}=$,H=$5(()=>J??new Q$).current;return bA.jsx(wC.Provider,{value:H,children:Z})}var MB=P(c(),1);function p00($,Z){let J=S1(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 SC=20,W6=[];function wA(){W6=W6.filter(($)=>{return $.deref()?.isConnected})}function RC($){if(wA(),$&&b2($)!=="body"){if(W6.push(new WeakRef($)),W6.length>SC)W6=W6.slice(-SC)}}function IC(){return wA(),W6[W6.length-1]?.deref()}function c00($){if(!$)return null;if(gz($))return $;return yZ($)[0]||$}function kC($){if($.hasAttribute("tabindex")&&!$.hasAttribute("data-tabindex"))return;if(!$.getAttribute("role")?.includes("dialog"))return;let J=FA($).filter((B)=>{let Q=B.getAttribute("data-tabindex")||"";return gz(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 G$($){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:O}=N.context,M=Y0(()=>O.current.floatingContext?.nodeId),_=B===!1,w=WB(A)&&_,C=q5(B),b=q5(Q),T=q5(U),I=q5(D),S=B4(W),R=MA(),j=Q4.useRef(!1),y=Q4.useRef(!1),k=Q4.useRef(!1),x=Q4.useRef(null),v=Q4.useRef(""),f=Q4.useRef(""),E=Q4.useRef(null),l=Q4.useRef(null),r=p2(E,F,R?.beforeInsideRef),h=p2(l,R?.afterInsideRef),d=r1(),o=r1(),p=C4(),i=R!=null,n=qB(V),Z0=Y0((z0=n)=>{return z0?yZ(z0):[]}),J0=Y0(()=>q?.().filter((z0)=>z0!=null)??[]);Q4.useEffect(()=>{if(H||!z)return;function z0(N0){if(N0.key==="Tab"){if(R0(n,d1(g0(n)))&&Z0().length===0&&!w)u4(N0)}}let Q0=g0(n);return o0(Q0,"keydown",z0)},[H,n,z,w,Z0]),Q4.useEffect(()=>{if(H||!D)return;let z0=g0(n);function Q0(){k.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(k.current=!e,f.current=F0.pointerType||"keyboard",s?.closest(`[${hZ}]`))y.current=!0,o.start(0,()=>{y.current=!1})}function D0(){f.current="keyboard"}return E2(o0(z0,"pointerdown",N0,!0),o0(z0,"pointerup",Q0,!0),o0(z0,"pointercancel",Q0,!0),o0(z0,"keydown",D0,!0),Q0)},[H,V,A,n,D,R,o,J0]),Q4.useEffect(()=>{if(H||!G)return;let z0=g0(n);function Q0(){y.current=!0,o.start(0,()=>{y.current=!1})}function N0(a){let e=P1(a);if(gz(e))x.current=e}function D0(a){let{relatedTarget:e,currentTarget:$0}=a,X0=P1(a);if(z&&e==null&&X0!=null&&R0(V,X0))RC(X0);queueMicrotask(()=>{let _0=M(),M0=N.context.triggerElements,A0=J0(),L0=e?.hasAttribute(C3("focus-guard"))&&[E.current,l.current,R?.beforeInsideRef.current,R?.afterInsideRef.current,R?.beforeOutsideRef.current,R?.afterOutsideRef.current,s8(K),s8(Y)].includes(e),g=!(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&&(C8(S.nodesRef.current,_0).find((u)=>R0(u.context?.elements.floating,e)||R0(u.context?.elements.domReference,e))||UA(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)kC(n);if(X&&$0!==A&&!J$(X0)&&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(O.current.insideReactTree){O.current.insideReactTree=!1;return}if((w?!0:!z)&&e&&g&&!y.current&&(w||e!==IC()))j.current=!0,N.setOpen(!1,w0(K0.focusOut,a))})}function F0(){if(k.current)return;O.current.insideReactTree=!0,d.start(0,()=>{O.current.insideReactTree=!1})}let s=_1(A)?A:null;if(!V&&!s)return;return E2(s&&o0(s,"focusout",D0),s&&o0(s,"pointerdown",Q0),V&&o0(V,"focusin",N0),V&&o0(V,"focusout",D0),V&&R&&o0(V,"focusout",F0,!0))},[H,A,V,n,z,S,R,N,G,X,Z0,w,M,O,d,o,p,Y,K,J0]),Q4.useEffect(()=>{if(H||!V||!D)return;let z0=Array.from(R?.portalNode?.querySelectorAll(`[${C3("portal")}]`)||[]),N0=(S?UA(S.nodesRef.current,M()):[]).find(($0)=>WB($0.context?.elements.domReference||null))?.context?.elements.domReference,F0=[...[V,...z0,E.current,l.current,R?.beforeOutsideRef.current,R?.afterOutsideRef.current,...J0()],N0,s8(K),s8(Y),w?A:null].filter(($0)=>$0!=null),s=EA(F0,{ariaHidden:z||w,mark:!1}),a=[V,...z0].filter(($0)=>$0!=null),e=EA(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="",f.current="";let z0=g0(n),Q0=d1(z0);queueMicrotask(()=>{let N0=C.current,D0=typeof N0==="function"?N0(T.current||""):N0;if(D0===void 0||D0===!1)return;if(R0(n,Q0))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=s8(D0);e=e||a();let $0=R0(n,d1(z0));fZ(e,{preventScroll:e===n,shouldFocus(){if(!I.current)return!1;if($0)return!0;let X0=d1(z0);return!(X0!==e&&R0(n,X0))}})})},[H,D,n,Z0,C,T,I]),H0(()=>{if(H||!n)return;let z0=g0(n),Q0=d1(z0),N0=T.current==null;RC(Q0);function D0(s){if(!s.open)v.current=p00(s.nativeEvent,f.current);if(s.reason===K0.triggerHover&&s.nativeEvent.type==="mouseleave")j.current=!0;if(s.reason!==K0.outsidePress)return;if(s.nested)j.current=!1;else if(RZ(s.nativeEvent)||IZ(s.nativeEvent))j.current=!1;else{let a=!1;if(g0(n).createElement("div").focus({get preventScroll(){return a=!0,!1}}),a)j.current=!1;else j.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,X0=Q0?.isConnected&&b2(Q0)!=="body"?Q0:null,_0=N0?X0||$0:$0||X0;if(!_0)_0=IC()||null;if(typeof e==="boolean")return _0;return s8(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&&C8(S.nodesRef.current,M(),!1).some((M0)=>R0(M0.context?.elements.floating,s)),$0=b.current,X0=v.current,_0=F0(X0);queueMicrotask(()=>{let M0=c00(_0),A0=typeof $0!=="boolean";if($0&&!j.current&&_1(M0)&&(!A0&&M0!==s&&s!==z0.body?e:!0)){let L0={preventScroll:!0};if(X0==="keyboard")L0.focusVisible=!0;M0.focus(L0)}j.current=!1})}},[H,V,n,b,T,L,S,A,M,J0]),H0(()=>{if(!J5.engine.webkit||D||!V)return;let z0=d1(g0(V));if(!_1(z0)||!e7(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 kC(n),()=>{queueMicrotask(wA)}},[H,n]);let U0=!H&&(z?!w:!0)&&(i||z);return MB.jsxs(Q4.Fragment,{children:[U0&&MB.jsx(c4,{"data-type":"inside",ref:r,onFocus:(z0)=>{if(z){let Q0=Z0();fZ(Q0[Q0.length-1])}else if(R?.portalNode)if(j.current=!1,j3(z0,R.portalNode))xZ(A)?.focus();else s8(K??R.beforeOutsideRef)?.focus()}}),J,U0&&MB.jsx(c4,{"data-type":"inside",ref:h,onFocus:(z0)=>{if(z)fZ(Z0()[0]);else if(R?.portalNode){if(G)j.current=!0;if(j3(z0,R.portalNode))mz(A)?.focus();else s8(Y??R.afterOutsideRef)?.focus()}}})]})}var PB=P(m(),1);function b3($,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=PB.useRef(void 0),F=C4(),W=r1(),q=PB.useMemo(()=>{function N(A,V,L,O){let M=w0(G,V,L);if(A&&O==="touch"&&z>0)W.start(z,()=>{U.setOpen(!0,M)});else U.setOpen(A,M)}function D(A,V,L){let O=Y.current.openEvent,M=U.select("domReferenceElement")!==V;if(A&&M)return!0;if(!A)return!0;if(!B)return!0;if(O&&X)return!L(O.type);return!1}return{onPointerDown(A){K.current=Y8(A.pointerType,!0)&&IZ(A.nativeEvent)?"virtual":A.pointerType},onMouseDown(A){let V=K.current,L=A.nativeEvent,O=U.select("open");if(A.button!==0||H==="click"||Y8(V,!0)&&Q)return;let M=D(O,A.currentTarget,(C)=>C==="click"||C==="mousedown"),_=P1(L);if(e7(_)){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(Y8(V,!0)&&Q)return;let L=U.select("open"),O=D(L,A.currentTarget,(M)=>M==="click"||M==="mousedown"||M==="keydown"||M==="keyup");N(O,A.nativeEvent,A.currentTarget,V)},onKeyDown(){K.current=void 0}}},[Y,H,Q,G,U,X,B,F,W,z]);return PB.useMemo(()=>J?{reference:q}:M1,[J,q])}var l4=P(m(),1);function d00($,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 yC($){return $!=null&&$.clientX!=null}function SA($,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=l4.useRef(!1),Y=l4.useRef(null),[K,F]=l4.useState(),[W,q]=l4.useState([]),N=Y0((O)=>{B.set("positionReference",O)}),D=Y0((O,M,_)=>{if(U.current)return;if(G.current.openEvent&&!yC(G.current.openEvent))return;B.set("positionReference",d00(_??z,{x:O,y:M,axis:H,dataRef:G,pointerType:K}))}),A=Y0((O)=>{if(!Q)D(O.clientX,O.clientY,O.currentTarget);else if(!Y.current)D(O.clientX,O.clientY,O.currentTarget),q([])}),V=Y8(K)?X:Q;l4.useEffect(()=>{if(!J){N(z);return}if(!V)return;function O(){Y.current?.(),Y.current=null}let M=S1(X);function _(w){let C=P1(w);if(!R0(X,C))D(w.clientX,w.clientY);else O()}if(!G.current.openEvent||yC(G.current.openEvent))Y.current=o0(M,"mousemove",_);else N(z);return O},[V,J,X,G,z,B,D,N,W]),l4.useEffect(()=>()=>{B.set("positionReference",null)},[B]),l4.useEffect(()=>{if(J&&!X)U.current=!1},[J,X]),l4.useEffect(()=>{if(!J&&Q)U.current=!0},[J,Q]);let L=l4.useMemo(()=>{function O(M){F(M.pointerType)}return{onPointerDown:O,onPointerEnter:O,onMouseMove:A,onMouseEnter:A}},[A]);return l4.useMemo(()=>J?{reference:L,trigger:L}:{},[J,L])}var S4=P(m(),1);function l00(){return!1}function i00($){return{escapeKey:typeof $==="boolean"?$:$?.escapeKey??!1,outsidePress:typeof $==="boolean"?$:$?.outsidePress??!0}}function e8($,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=B4(G),N=Y0(typeof B==="function"?B:()=>!1),D=typeof B==="function"?N:B,A=D!==!1,V=Y0(()=>Q),{escapeKey:L,outsidePress:O}=i00(z),M=S4.useRef(!1),_=S4.useRef(!1),w=S4.useRef(!1),C=S4.useRef(!1),b=S4.useRef(!1),T=S4.useRef(""),I=S4.useRef(null),S=r1(),R=r1(),j=Y0(()=>{R.clear(),F.current.insideReactTree=!1}),y=Y0((d)=>{let o=F.current.floatingContext?.nodeId;return(q?C8(q.nodesRef.current,o):[]).some((i)=>i.context?.open&&!i.context.dataRef.current[d])}),k=Y0((d)=>{return yz(d,U.select("floatingElement"))||yz(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=FT(d)?d.nativeEvent:d,p=w0(K0.escapeKey,o);if(U.setOpen(!1,p),!p.isCanceled)d.preventDefault();if(!L&&!p.isPropagationAllowed)d.stopPropagation()}),f=Y0(()=>{F.current.insideReactTree=!0,R.start(0,j)}),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});S4.useEffect(()=>{function d(o){if(!o.open)C.current=!1}return W.on("openchange",d),()=>{W.off("openchange",d)}},[W]),S4.useEffect(()=>{if(!Y||!J){if(!Y)C.current=!1;return j}F.current.__escapeKeyBubbles=L,F.current.__outsidePressBubbles=O;let d=new r5,o=new r5,p=g0(K);function i(){d.clear(),b.current=!0}function n(){d.start(J5.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 g=T.current,u=g==="pen"||!g?"mouse":g,t=V(),W0=typeof t==="function"?t():t;if(typeof W0==="string")return W0;return W0[u]}function z0(g){let u=U0();return u==="intentional"&&g.type!=="click"||u==="sloppy"&&g.type==="click"}function Q0(g){let u=F.current.floatingContext?.nodeId,t=q&&C8(q.nodesRef.current,u).some((W0)=>yz(g,W0.context?.elements.floating));return k(g)||t}function N0(g){if(z0(g)){if(g.type!=="click"&&!k(g))o.clear(),w.current=!1;j();return}if(F.current.insideReactTree){j();return}let u=P1(g),t=`[${C3("inert")}]`,W0=s0(u)?u.getRootNode():null,S0=Array.from((X6(W0)?W0:g0(U.select("floatingElement"))).querySelectorAll(t)),p0=U.context.triggerElements;if(u&&(p0.hasElement(u)||p0.hasMatchingElement((T0)=>R0(T0,u))))return;let f0=s0(u)?u:null;while(f0&&!R8(f0)){let T0=I8(f0);if(R8(T0)||!s0(T0))break;f0=T0}if(S0.length&&s0(u)&&!KT(u)&&!R0(u,U.select("floatingElement"))&&S0.every((T0)=>!R0(f0,T0)))return;if(_1(u)&&!("touches"in g)){let T0=R8(u),d0=u2(u),z1=/auto|scroll/,e0=T0||z1.test(d0.overflowX),c0=T0||z1.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",z5=E1&&(W1?g.offsetX<=u.offsetWidth-u.clientWidth:g.offsetX>u.clientWidth),C0=y0&&g.offsetY>u.clientHeight;if(z5||C0)return}if(Q0(g))return;if(U0()==="intentional"){if(g.detail!==0&&!RZ(g)&&!C.current)return;if(w.current){o.clear(),w.current=!1;return}}if(typeof D==="function"&&!D(g))return;if(y("__outsidePressBubbles"))return;U.setOpen(!1,w0(K0.outsidePress,g)),j()}function D0(g){if(U0()!=="sloppy"||g.pointerType==="touch"||!U.select("open")||!J||k(g))return;N0(g)}function F0(g){if(U0()!=="sloppy"||!U.select("open")||!J||k(g))return;let u=g.touches[0];if(u)I.current={startTime:Date.now(),startX:u.clientX,startY:u.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},S.start(1000,()=>{if(I.current)I.current.dismissOnTouchEnd=!1,I.current.dismissOnMouseDown=!1})}function s(g,u){let t=P1(g);if(!t)return;let W0=o0(t,g.type,()=>{u(g),W0()})}function a(g){T.current="touch",s(g,F0)}function e(g){if(S.clear(),g.type==="pointerdown"){if(g.button===0)C.current=!0;T.current=g.pointerType}if(g.type==="mousedown"&&I.current&&!I.current.dismissOnMouseDown)return;s(g,(u)=>{if(u.type==="pointerdown")D0(u);else N0(u)})}function $0(g){if(g.type==="pointercancel")C.current=!1;if(!M.current)return;let u=_.current;if(J0(),U0()!=="intentional")return;if(g.type==="pointercancel"){if(u)Z0();return}if(Q0(g))return;if(u){Z0();return}if(typeof D==="function"&&!D(g))return;o.clear(),w.current=!0,j()}function X0(g){if(U0()!=="sloppy"||!I.current||k(g))return;let u=g.touches[0];if(!u)return;let t=Math.abs(u.clientX-I.current.startX),W0=Math.abs(u.clientY-I.current.startY),S0=Math.sqrt(t*t+W0*W0);if(S0>5)I.current.dismissOnTouchEnd=!0;if(S0>10)N0(g),S.clear(),I.current=null}function _0(g){s(g,X0)}function M0(g){if(U0()!=="sloppy"||!I.current||k(g))return;if(I.current.dismissOnTouchEnd)N0(g);S.clear(),I.current=null}function A0(g){s(g,M0)}let L0=E2(H&&E2(o0(p,"keydown",v),o0(p,"compositionstart",i),o0(p,"compositionend",n)),A&&E2(o0(p,"click",e,!0),o0(p,"pointerdown",e,!0),o0(p,"pointerup",$0,!0),o0(p,"pointercancel",$0,!0),o0(p,"mousedown",e,!0),o0(p,"mouseup",$0,!0),o0(p,"touchstart",a,{capture:!0,passive:!0}),o0(p,"touchmove",_0,{capture:!0,passive:!0}),o0(p,"touchend",A0,{capture:!0,passive:!0})));return()=>{L0(),d.clear(),o.clear(),J0(),w.current=!1,j()}},[F,K,H,A,D,Y,J,L,O,v,j,V,y,k,q,U,S]);let r=S4.useMemo(()=>({onKeyDown:v,onPointerDown:x,onClick:x}),[v,x]),h=S4.useMemo(()=>({onKeyDown:v,onPointerDown:l,onMouseDown:l,onClickCapture:f,onMouseDownCapture(d){f(),E(d)},onPointerDownCapture(d){f(),E(d)},onMouseUpCapture:f,onTouchEndCapture:f,onTouchMoveCapture:f}),[v,f,E,l]);return S4.useMemo(()=>J?{reference:r,floating:h,trigger:r}:{},[J,r,h])}function UG($,Z,J,H){return{left:$,top:Z,right:J,bottom:H,x:$,y:Z,width:J-$,height:H-Z}}function r00($){return{left:$.left,top:$.top,right:$.right,bottom:$.bottom,width:$.width,height:$.height}}function hC($){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(r00(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:UG(H,B,Q,X)}}function vC($,Z,J){return $.findIndex((H)=>Z>H.left-2&&Z<H.right+2&&J>H.top-2&&J<H.bottom+2)}function xC($){return UG($.left,$.top,$.right,$.bottom)}function a00($,Z,J){let{lines:H}=hC($.getClientRects());if(H.length<2)return;let B=vC(H,Z,J);return{x:Z,y:J,lineIndex:B===-1?void 0:B,element:$}}function o00($,Z,J){let{lines:H,fallback:B}=hC($.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 xC(H[J.lineIndex]);if(Q!=null&&X!=null){let q=vC(H,Q,X);if(q!==-1)return xC(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 UG(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 UG(U,F.top,Y,W.bottom)}function n00($){if("contextElement"in $&&$.contextElement)return $.contextElement;return s0($)?$:void 0}function fC($,Z){function J(B){RA($,B.currentTarget,B.clientX,B.clientY)}function H(B){if(!Z)J(B)}return{onFocus(){$.current=void 0},onMouseEnter:H,onMouseMove:H}}function RA($,Z,J,H){let B=a00(Z,J,H);return $.current=B,B}function gC($){return{name:"inline",async fn(Z){let J=Z.elements.reference;if(typeof J?.getClientRects!=="function")return{};let H=n00(J),B=$.current,Q=B?.element===J||B?.element===H?B:void 0,X=o00(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 $9{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(k0(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 kA=P(m(),1),pC=P(K8(),1);var mC=P(m(),1);var s00={open:($)=>$.open,transitionStatus:($)=>$.transitionStatus,domReferenceElement:($)=>$.domReferenceElement,referenceElement:($)=>$.positionReference??$.referenceElement,floatingElement:($)=>$.floatingElement,floatingId:($)=>$.floatingId};class U$ extends g2{constructor($){let{syncOnly:Z,nested:J,onOpenChange:H,triggerElements:B,...Q}=$;super({...Q,positionReference:Q.referenceElement,domReferenceElement:Q.referenceElement},{onOpenChange:H,dataRef:{current:{}},events:GG(),nested:J,triggerElements:B},s00);this.syncOnly=Z}syncOpenEvent=($,Z)=>{if(!$||!this.state.open||Z!=null&&WT(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 _B($){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=mC.useRef(null);if(H===void 0&&F.current===null)F.current=new U$({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 IA=P(m(),1);function S2($,Z=!1,J=!1,H=!1){let[B,Q]=IA.useState($&&Z?"idle":void 0),[X,z]=IA.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=m2.request(()=>{Q("ending")});return()=>{m2.cancel(G)}}return},[$,X,B,J]),H0(()=>{if(!$||Z)return;let G=m2.request(()=>{Q(void 0)});return()=>{m2.cancel(G)}},[Z,$]),H0(()=>{if(!$||!Z)return;if($&&X&&B!=="idle")Q("starting");let G=m2.request(()=>{Q("idle")});return()=>{m2.cancel(G)}},[Z,$,X,B]),{mounted:X,setMounted:z,transitionStatus:B}}var R9={tabIndex:-1,[zB]:""};function YG($){return(Z)=>Z==="touch"?$.current:!0}function q6($,Z=!1){let J=E4(),H=w4()!=null,B=$5(()=>$(J,H)).current;return _B({popupStore:B,treatPopupAsFloatingElement:Z,floatingRootContext:B.state.floatingRootContext,floatingId:J,nested:H,onOpenChange:B.setOpen}),B}function I9({handle:$,store:Z}){return H0(()=>{return $.attachStore(Z)},[$,Z]),null}function uC($){let Z=$.context.triggerElements.size;if($.select("open")&&$.state.triggerCount!==Z)$.set("triggerCount",Z)}function yA($,Z){let J=kA.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),uC(Q)}if(H!==null&&$!==void 0)J.current={store:Z,id:$,element:H},Z.context.triggerElements.add($,H),uC(Z)})}function Y$($,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 OB($){let Z=!1;return $.preventUnmountOnClose=()=>{Z=!0},()=>Z}function KG($,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=OB(J);if($.context.onOpenChange?.(Z,J),J.isCanceled)return;H.onBeforeDispatch?.(),$.state.floatingRootContext.dispatchOpenChange(Z,J);let U=()=>{let Y=Y$($.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)pC.flushSync(U);else U()}function k9($,Z,J,H){let B=J.useState("isMountedByTrigger",$),Q=yA($,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 y9($,Z={}){let{closeOnActiveTriggerUnmount:J=!1}=Z,H=kA.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 x9($,Z,J,H){let{mounted:B,setMounted:Q,transitionStatus:X}=S2($,!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 V5({enabled:B&&!$&&!G,open:$,ref:Z.context.popupRef,onComplete(){if(!$)U()}}),{forceUnmount:U,transitionStatus:X}}function h9($,Z){$.useSyncedValues(Z),H0(()=>()=>{$.update({activeTriggerProps:M1,inactiveTriggerProps:M1,popupProps:M1})},[$])}function FG($,Z){H0(()=>{if(!Z&&$.state.openMethod!==null)$.set("openMethod",null)},[Z,$]),H0(()=>()=>{if($.state.openMethod!==null)$.set("openMethod",null)},[$])}class R2{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 v9($,Z,J=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new U$({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 jB=($)=>$.triggerIdProp??$.activeTriggerId,xA=($)=>$.openProp??$.open,cC=($)=>{return($.popupElement?.id??$.floatingId)||void 0};function dC($,Z){return Z!==void 0&&xA($)&&jB($)===Z}function t00($,Z){if(dC($,Z))return!0;return Z!==void 0&&xA($)&&jB($)==null&&$.triggerCount===1}var f9={open:xA,mounted:($)=>$.mounted,transitionStatus:($)=>$.transitionStatus,floatingRootContext:($)=>$.floatingRootContext,triggerCount:($)=>$.triggerCount,preventUnmountingOnClose:($)=>$.preventUnmountingOnClose,payload:($)=>$.payload,activeTriggerId:jB,activeTriggerElement:($)=>$.mounted?$.activeTriggerElement:null,popupId:cC,isTriggerActive:($,Z)=>Z!==void 0&&jB($)===Z,isOpenedByTrigger:($,Z)=>dC($,Z),isMountedByTrigger:($,Z)=>Z!==void 0&&jB($)===Z&&$.mounted,triggerProps:($,Z)=>Z?$.activeTriggerProps:$.inactiveTriggerProps,triggerPopupId:($,Z)=>t00($,Z)?cC($):void 0,popupProps:($)=>$.popupProps,popupElement:($)=>$.popupElement,positionerElement:($)=>$.positionerElement};var hA=P(m(),1),lC=P(SZ(),1);function g9($){let Z=hA.useCallback((H)=>{if($===void 0)return G1;return $.subscribeStore(H)},[$]),J=hA.useCallback(()=>{return $===void 0?void 0:$.store},[$]);return lC.useSyncExternalStore(Z,J,()=>$?.serverStore)}function vA($){let{open:Z=!1,onOpenChange:J,elements:H={}}=$,B=E4(),Q=w4()!=null,X=$5(()=>new U$({open:Z,transitionStatus:void 0,onOpenChange:J,referenceElement:H.reference??null,floatingElement:H.floating??null,triggerElements:new R2,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 m9=P(m(),1);var fA=J5.os.mac&&J5.engine.webkit;function K$($,Z={}){let{enabled:J=!0,delay:H}=Z,B="rootStore"in $?$.rootStore:$,{events:Q,dataRef:X}=B.context,z=m9.useRef(!1),G=m9.useRef(null),U=m9.useRef(!0),Y=r1();m9.useEffect(()=>{let F=B.select("domReferenceElement");if(!J)return;let W=S1(F);function q(){let A=B.select("domReferenceElement");if(!B.select("open")&&_1(A)&&A===d1(g0(A)))z.current=!0,G.current=A}function N(){U.current=!0}function D(){U.current=!1}return E2(o0(W,"blur",q),fA&&o0(W,"keydown",N,!0),fA&&o0(W,"pointerdown",D,!0))},[B,J]),m9.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=m9.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(fA&&!W.relatedTarget){if(!U.current&&!e7(N))return}else if(!E9(N))return}let D=z6(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(C3("focus-guard"))&&q.getAttribute("data-type")==="outside";Y.start(0,()=>{let A=B.select("domReferenceElement"),V=d1(g0(A));if(!q&&V===A)return;if(R0(X.current.floatingContext?.refs.floating.current,V)||R0(A,V)||D)return;if(z6(q??V,B.context.triggerElements))return;B.setOpen(!1,w0(K0.triggerFocus,N))})}}},[X,H,B,Y]);return m9.useMemo(()=>J?{reference:K,trigger:K}:{},[J,K])}var mA=P(m(),1);class gA{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 r5,this.restTimeout=new r5,this.handleCloseOptions=void 0}static create(){return new gA}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>{return this.dispose}}var WG=new WeakMap;function gZ($){if(!$.performedPointerEventsMutation)return;let Z=$.pointerEventsScopeElement;if(Z&&WG.get(Z)===$)$.pointerEventsScopeElement?.style.removeProperty("pointer-events"),$.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),$.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),WG.delete(Z);$.performedPointerEventsMutation=!1,$.pointerEventsScopeElement=null,$.pointerEventsReferenceElement=null,$.pointerEventsFloatingElement=null}function qG($,Z){let{scopeElement:J,referenceElement:H,floatingElement:B}=Z,Q=WG.get(J);if(Q&&Q!==$)gZ(Q);gZ($),$.performedPointerEventsMutation=!0,$.pointerEventsScopeElement=J,$.pointerEventsReferenceElement=H,$.pointerEventsFloatingElement=B,WG.set(J,$),J.style.pointerEvents="none",H.style.pointerEvents="auto",B.style.pointerEvents="auto"}function mZ($){let Z=$.context.dataRef.current,J=$5(()=>Z.hoverInteractionState??gA.create()).current;if(!Z.hoverInteractionState)Z.hoverInteractionState=J;return B6(Z.hoverInteractionState.disposeEffect),Z.hoverInteractionState}function w3($,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=B4(),K=w4(),F=mZ(Q),W=r1(),q=Y0(()=>{return XG(U.current.openEvent?.type,F.interactedInside)}),N=Y0(()=>{return MC(U.current.openEvent?.type)}),D=Y0(()=>{gZ(F)});H0(()=>{if(!X)F.pointerType=void 0,F.restTimeoutPending=!1,F.interactedInside=!1,D()},[X,F,D]),mA.useEffect(()=>{return D},[D]),H0(()=>{if(!J)return;if(X&&F.handleCloseOptions?.blockPointerEvents&&N()&&s0(G)&&z){let A=G,V=z,L=g0(z),O=Y?.nodesRef.current.find((C)=>C.id===K)?.context?.elements.floating;if(O)O.style.pointerEvents="";let M=F.pointerEventsScopeElement!==V?F.pointerEventsScopeElement:null,_=O!==V?O:null,w=F.handleCloseOptions?.getScope?.()??M??_??A.closest("[data-rootownerid]")??L.body;return qG(F,{scopeElement:w,referenceElement:A,floatingElement:V}),()=>{D()}}return},[J,X,G,z,F,N,Y,K,D]),mA.useEffect(()=>{if(!J)return;function A(){return!!(Y&&K&&C8(Y.nodesRef.current,K).length>0)}function V(C){let b=t8(H,"close",F.pointerType),T=()=>{Q.setOpen(!1,w0(K0.triggerHover,C)),Y?.events.emit("floating.closed",C)};if(b)F.openChangeTimeout.start(b,T);else F.openChangeTimeout.clear(),T()}function L(C){let b=P1(C);if(!GA(b)){F.interactedInside=!1;return}F.interactedInside=b?.closest("[aria-haspopup]")!=null}function O(){F.openChangeTimeout.clear(),W.clear(),Y?.events.off("floating.closed",_),D()}function M(C){if(A()&&Y){Y.events.on("floating.closed",_);return}if(z6(C.relatedTarget,Q.context.triggerElements))return;let b=U.current.floatingContext?.nodeId??B,T=C.relatedTarget;if(Y&&b&&s0(T)&&C8(Y.nodesRef.current,b,!1).some((S)=>R0(S.context?.elements.floating,T)))return;if(F.handler){F.handler(C);return}if(D(),N()&&!q())V(C)}function _(C){if(!Y||!K||A())return;W.start(0,()=>{Y.events.off("floating.closed",_),Q.setOpen(!1,w0(K0.triggerHover,C)),Y.events.emit("floating.closed",C)})}let w=z;return E2(w&&o0(w,"mouseenter",O),w&&o0(w,"mouseleave",M),w&&o0(w,"pointerdown",L,!0),()=>{Y?.events.off("floating.closed",_)})},[J,z,Q,U,H,B,N,q,D,F,Y,K,W])}var N6=P(m(),1),iC=P(K8(),1);var e00={current:null};function Z9($,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=B4(U),L=mZ(N),O=N6.useRef(!1),M=q5(B),_=q5(H),w=q5(X),C=q5(J),b=q5(W),T=q5(F),I=Y0(()=>{return XG(D.current.openEvent?.type,L.interactedInside)}),S=Y0(()=>{return b.current?.()!==!1}),R=Y0((k,x,v)=>{let f=N.context.triggerElements;if(f.hasElement(x))return!k||!R0(k,x);if(!s0(v))return!1;let E=v;return f.hasMatchingElement((l)=>R0(l,E))&&(!k||!R0(k,E))}),j=Y0(()=>{if(!L.handler)return;g0(N.select("domReferenceElement")).removeEventListener("mousemove",L.handler),L.handler=void 0}),y=Y0(()=>{gZ(L)});if(Y)L.handleCloseOptions=B?.__options;return N6.useEffect(()=>j,[j]),N6.useEffect(()=>{if(!J)return;function k(x){if(!x.open)O.current=x.reason===K0.triggerHover,j(),L.openChangeTimeout.clear(),L.restTimeout.clear(),L.blockMouseMove=!0,L.restTimeoutPending=!1;else O.current=!1}return A.on("openchange",k),()=>{A.off("openchange",k)}},[J,A,L,j]),N6.useEffect(()=>{if(!J)return;function k(r,h=!0){let d=t8(_.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&&!Y8(L.pointerType))return;let h=PA(w.current),d=t8(_.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=T.current?.()??N.select("transitionStatus")==="ending",z0=!J0&&U0&&O.current,Q0=!Z0&&s0(n)&&s0(i)&&R0(i,n)&&z0,N0=h>0&&!d,D0=Z0&&(J0||z0)||Q0,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 f(r){if(I()){y();return}j();let h=N.select("domReferenceElement"),d=g0(h);L.restTimeout.clear(),L.restTimeoutPending=!1;let o=D.current.floatingContext??K?.();if(z6(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(),j(),C.current&&!I()&&i===N.select("domReferenceElement"))k(r,!0)}}),d.addEventListener("mousemove",L.handler),L.handler(r);return}if(L.pointerType==="touch"?!R0(N.select("floatingElement"),r.relatedTarget):!0)k(r)}function E(r){if(R0(x,r.relatedTarget))return;L.openChangeTimeout.clear(),L.restTimeout.clear(),L.restTimeoutPending=!1}let l=q?o0(x,"mouseout",E):void 0;if(z)return E2(o0(x,"mousemove",v,{once:!0}),o0(x,"mouseenter",v),o0(x,"mouseleave",f),l);return E2(o0(x,"mouseenter",v),o0(x,"mouseleave",f),l)},[j,y,D,_,N,J,M,L,Y,R,I,Q,z,w,G,V,C,K,T,S,q]),N6.useMemo(()=>{if(!J)return;function k(x){L.pointerType=x.pointerType}return{onPointerDown:k,onPointerEnter:k,onMouseMove(x){let{nativeEvent:v}=x,f=x.currentTarget,E=N.select("domReferenceElement"),l=N.select("open"),r=R(E,f,x.target);if(Q&&!Y8(L.pointerType))return;if(l&&r&&L.handleCloseOptions?.blockPointerEvents){let o=N.select("floatingElement");if(o){let p=L.handleCloseOptions?.getScope?.()??f.ownerDocument.body;qG(L,{scopeElement:p,referenceElement:f,floatingElement:o})}}let h=PA(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,I())return;let o=N.select("open");if(!L.blockMouseMove&&(!o||r)&&S())N.setOpen(!0,w0(K0.triggerHover,v,f))}if(L.pointerType==="touch")iC.flushSync(()=>{d()});else if(r&&l)d();else L.restTimeoutPending=!0,L.restTimeout.start(h,d)}}},[J,L,I,R,Q,N,w,S])}var c2=P(m(),1);var $10="Escape";function rC($){return J5.engine.webkit&&$.movementX===0&&$.movementY===0}function AG($,Z,J){switch($){case"vertical":return Z;case"horizontal":return J;default:return Z||J}}function NG($,Z){return AG(Z,$===HA||$===Rz,$===GB||$===UB)}function uA($,Z,J){return AG(Z,$===Rz,J?$===GB:$===UB)||$==="Enter"||$===" "||$===""}function Z10($,Z,J){return AG(Z,J?$===GB:$===UB,$===Rz)}function J10($,Z,J,H){let B=J?$===UB:$===GB,Q=$===HA;if(Z==="both"||Z==="horizontal"&&H)return $===$10;return AG(Z,B,Q)}function pA($,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:O,grid:M}=Z,_=M!=null,w="rootStore"in $?$.rootStore:$,C=w.useState("open"),b=w.useState("floatingElement"),T=w.useState("domReferenceElement"),I=w.context.dataRef,S=qB(b),R=WB(T),j=q5(S),y=w4(),k=B4(O),x=c2.useRef(F),v=c2.useRef(X??-1),f=c2.useRef(null),E=c2.useRef(!0),l=Y0((A0)=>{B(v.current===-1?null:v.current,A0)}),r=c2.useRef(!!b),h=c2.useRef(C),d=c2.useRef(!1),o=c2.useRef(!1),p=c2.useRef(null),i=q5(N),n=q5(C),Z0=q5(X),J0=q5(L),U0=C4(),z0=C4(),Q0=Y0(()=>{function A0(t){if(K)k?.events.emit("virtualfocus",t);else p.current=fZ(t,{sync:d.current,preventScroll:!0})}let L0=J.current[v.current],g=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&&(g||!E.current))t.scrollIntoView?.({block:"nearest",inline:"nearest"})})});H0(()=>{I.current.orientation=D},[I,D]),H0(()=>{if(!Q)return;if(C&&b){if(v.current=X??-1,x.current&&X!=null)o.current=!0,l()}else if(r.current)v.current=-1,l()},[Q,C,b,X,l]),H0(()=>{if(!Q)return;if(!C){d.current=!1;return}if(!b)return;if(H==null){if(d.current=!1,Z0.current!=null)return;if(r.current)v.current=-1,Q0();if((!h.current||!r.current)&&x.current&&(f.current!=null||x.current===!0&&f.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=f.current==null||uA(f.current,D,Y)||U?Z$(J):kZ(J),f.current=null,l()};L0()}}else if(!Y6(J.current,H))v.current=H,Q0(),o.current=!1},[Q,C,b,H,Z0,U,J,D,Y,l,Q0,z0]),H0(()=>{if(!Q||b||!k||K||!r.current)return;let A0=k.nodesRef.current,L0=A0.find((t)=>t.id===y)?.context?.elements.floating,g=d1(g0(T??L0??null)),u=A0.some((t)=>t.context&&R0(t.context.elements.floating,g));if(L0&&!u&&E.current)L0.focus({preventScroll:!0})},[Q,b,T,k,y,K]),H0(()=>{h.current=C,r.current=!!b}),H0(()=>{if(!C)f.current=null,x.current=F},[C,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??k?.nodesRef.current.find((A0)=>A0.id===y)?.context?.dataRef?.current.orientation}),s=Y0(()=>{return Z$(J,i.current)}),a=Y0((A0)=>{if(E.current=!1,d.current=!0,A0.which===229)return;if(!n.current&&A0.currentTarget===j.current)return;if(U&&J10(A0.key,D,Y,_)){if(!NG(A0.key,F0()))u4(A0);if(w.setOpen(!1,w0(K0.listNavigation,A0.nativeEvent)),_1(T))if(K)k?.events.emit("virtualfocus",T);else T.focus();return}let L0=v.current,g=Z$(J,N),u=kZ(J,N);if(!R){if(A0.key==="Home")u4(A0),v.current=g,l(A0);if(A0.key==="End")u4(A0),v.current=u,l(A0)}if(M!=null){let t=M(A0,v.current,J,D,G,Y,N,g,u);if(t!=null)v.current=t,l(A0);if(D==="both")return}if(NG(A0.key,D)){if(u4(A0),C&&!K&&d1(A0.currentTarget.ownerDocument)===A0.currentTarget){v.current=uA(A0.key,D,Y)?g:u,l(A0);return}if(uA(A0.key,D,Y))if(G)if(L0>=u)if(z&&L0!==J.current.length)v.current=-1;else d.current=!1,v.current=g;else v.current=b8(J.current,{startingIndex:L0,disabledIndices:N});else v.current=Math.min(u,b8(J.current,{startingIndex:L0,disabledIndices:N}));else if(G)if(L0<=g)if(z&&L0!==-1)v.current=J.current.length;else d.current=!1,v.current=u;else v.current=b8(J.current,{startingIndex:L0,decrement:!0,disabledIndices:N});else v.current=Math.max(g,b8(J.current,{startingIndex:L0,decrement:!0,disabledIndices:N}));if(Y6(J.current,v.current))v.current=-1;l(A0)}}),e=c2.useMemo(()=>{return{onFocus(L0){d.current=!0,D0(L0)},onClick:({currentTarget:L0})=>L0.focus({preventScroll:!0}),onMouseMove(L0){if(rC(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 g=L0.relatedTarget;if(!W||J.current.includes(g))return;if(!J0.current)return;if(p.current?.(),p.current=null,v.current=-1,l(L0),!K){let u=j.current,t=d1(g0(u));if(u&&R0(u,t))u.focus({preventScroll:!0})}}}},[D0,n,j,W,J,l,J0,K]),$0=c2.useMemo(()=>{return K&&C&&N0&&{"aria-activedescendant":`${V}-${H}`}},[K,C,N0,V,H]),X0=c2.useMemo(()=>{return{...!R?$0:{},onKeyDown(A0){if(A0.key==="Tab"&&A0.shiftKey&&C&&!K){let L0=P1(A0.nativeEvent);if(L0&&!R0(j.current,L0))return;if(u4(A0),w.setOpen(!1,w0(K0.focusOut,A0.nativeEvent)),_1(T))T.focus();return}a(A0)},onPointerMove(A0){if(rC(A0))return;E.current=!0}}},[$0,a,j,R,w,C,K,T]),_0=c2.useMemo(()=>{function A0(u){w.setOpen(!0,w0(K0.listNavigation,u.nativeEvent,u.currentTarget))}function L0(u){if(F==="auto"&&RZ(u.nativeEvent))x.current=!K}function g(u){if(x.current=F,F==="auto"&&IZ(u.nativeEvent))x.current=!0}return{onKeyDown(u){let t=w.select("open");E.current=!1;let W0=u.key.startsWith("Arrow"),S0=Z10(u.key,F0(),Y),p0=NG(u.key,D),f0=(U?S0:p0)||u.key==="Enter"||u.key.trim()==="";if(K&&t)return a(u);if(!t&&!q&&W0)return;if(f0){let T0=NG(u.key,F0());f.current=U&&T0?null:u.key}if(U){if(S0)if(u4(u),t)v.current=s(),l(u);else A0(u);return}if(p0){if(Z0.current!=null)v.current=Z0.current;if(u4(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:g,onPointerEnter:g,onMouseDown:L0,onClick:L0}},[a,F,s,U,l,w,q,D,F0,Y,Z0,K]),M0=c2.useMemo(()=>{return{...$0,..._0}},[$0,_0]);return c2.useMemo(()=>Q?{reference:M0,floating:X0,item:e,trigger:_0}:{},[Q,M0,X0,_0,e])}var F$=P(m(),1);function cA($,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=r1(),q=F$.useRef(""),N=F$.useRef(Y??B??-1),D=F$.useRef(null),A=Y0((O)=>{function M(j){return H?.current[j]}function _(j){let y=M(j);if(y&&!J$(y)||y?.matches(":disabled"))return!1;return X==null||!O3(Z4,j,X)}function w(j,y,k=0){if(j.length===0)return-1;let x=(k%j.length+j.length)%j.length,v=y.toLowerCase();for(let f=0;f<j.length;f+=1){let E=(x+f)%j.length;if(!j[E]?.toLowerCase().startsWith(v)||!_(E))continue;return E}return-1}let C=J.current;if(q.current.length>0&&O.key===" ")u4(O),z?.(!0);if(q.current.length>0&&q.current[0]!==" "){if(w(C,q.current)===-1&&O.key!==" ")z?.(!1)}if(C==null||O.key.length!==1||O.ctrlKey||O.metaKey||O.altKey)return;if(F&&O.key!==" ")u4(O),z?.(!0);let b=q.current==="";if(b)N.current=Y??B??-1;if(C.every((j,y)=>j&&_(y)?j[0]?.toLowerCase()!==j[1]?.toLowerCase():!0)&&q.current===O.key)q.current="",N.current=D.current;q.current+=O.key,W.start(U,()=>{q.current="",N.current=D.current,z?.(!1)});let S=((b?Y??B??-1:N.current)??0)+1,R=w(C,q.current,S);if(R!==-1)Q?.(R),D.current=R;else if(O.key!==" ")q.current="",z?.(!1)}),V=Y0((O)=>{let M=O.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=F$.useMemo(()=>({onKeyDown:A,onBlur:V}),[A,V]);return F$.useMemo(()=>G?{reference:L,floating:L}:{},[G,L])}var aC=0.1,H10=aC*aC,M5=0.5;function DG($,Z,J,H,B,Q){return H>=Z!==Q>=Z&&$<=(B-J)*(Z-H)/(Q-H)+J}function VG($,Z,J,H,B,Q,X,z,G,U){let Y=!1;if(DG($,Z,J,H,B,Q))Y=!Y;if(DG($,Z,B,Q,X,z))Y=!Y;if(DG($,Z,X,z,G,U))Y=!Y;if(DG($,Z,G,U,J,H))Y=!Y;return Y}function B10($,Z,J){return $>=J.x&&$<=J.x+J.width&&Z>=J.y&&Z<=J.y+J.height}function LG($,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 J9($={}){let{blockPointerEvents:Z=!1}=$,J=new r5,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 O=performance.now(),M=O-N;if(W===null||q===null||M===0)return W=V,q=L,N=O,!1;let _=V-W,w=L-q,C=_*_+w*w,b=M*M*H10;return W=V,q=L,N=O,C<b}function A(){J.clear(),G()}return function(L){J.clear();let{domReference:O,floating:M}=z;if(!O||!M||K==null||B==null||Q==null)return;let{clientX:_,clientY:w}=L,C=P1(L),b=L.type==="mouseleave",T=R0(M,C),I=R0(O,C);if(T){if(F=!0,!b)return}if(I){if(F=!1,!b){F=!0;return}}if(b&&s0(L.relatedTarget)&&R0(M,L.relatedTarget))return;function S(){return Boolean(Y&&C8(Y.nodesRef.current,U).length>0)}function R(){if(!S())A()}if(S())return;let j=O.getBoundingClientRect(),y=M.getBoundingClientRect(),k=B>y.right-y.width/2,x=Q>y.bottom-y.height/2,v=y.width>j.width,f=y.height>j.height,E=(v?j:y).left,l=(v?j:y).right,r=(f?j:y).top,h=(f?j:y).bottom;if(K==="top"&&Q>=j.bottom-1||K==="bottom"&&Q<=j.top+1||K==="left"&&B>=j.right-1||K==="right"&&B<=j.left+1){R();return}let d=!1;switch(K){case"top":d=LG(_,w,E,j.top+1,l,y.bottom-1);break;case"bottom":d=LG(_,w,E,y.top+1,l,j.bottom-1);break;case"left":d=LG(_,w,y.right-1,h,j.left+1,r);break;case"right":d=LG(_,w,j.right-1,h,y.left+1,r);break;default:}if(d)return;if(F&&!B10(_,w,j)){R();return}if(!b&&D(_,w)){R();return}let o=!1;switch(K){case"top":{let p=v?M5/2:M5*4,i=v?B+p:k?B+p:B-p,n=v?B-p:k?B+p:B-p,Z0=Q+M5+1,J0=k?y.bottom-M5:v?y.bottom-M5:y.top,U0=k?v?y.bottom-M5:y.top:y.bottom-M5;o=VG(_,w,i,Z0,n,Z0,y.left,J0,y.right,U0);break}case"bottom":{let p=v?M5/2:M5*4,i=v?B+p:k?B+p:B-p,n=v?B-p:k?B+p:B-p,Z0=Q-M5,J0=k?y.top+M5:v?y.top+M5:y.bottom,U0=k?v?y.top+M5:y.bottom:y.top+M5;o=VG(_,w,i,Z0,n,Z0,y.left,J0,y.right,U0);break}case"left":{let p=f?M5/2:M5*4,i=f?Q+p:x?Q+p:Q-p,n=f?Q-p:x?Q+p:Q-p,Z0=B+M5+1,J0=x?y.right-M5:f?y.right-M5:y.left,U0=x?f?y.right-M5:y.left:y.right-M5;o=VG(_,w,J0,y.top,U0,y.bottom,Z0,i,Z0,n);break}case"right":{let p=f?M5/2:M5*4,i=f?Q+p:x?Q+p:Q-p,n=f?Q-p:x?Q+p:Q-p,Z0=B-M5,J0=x?y.left+M5:f?y.left+M5:y.right,U0=x?f?y.left+M5:y.right:y.left+M5;o=VG(_,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 oC($,Z,J){let{reference:H,floating:B}=$,Q=p4(Z),X=VB(Z),z=DB(X),G=H4(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=E8(Z);if(q)W[X]+=F*(q==="end"?1:-1)*(J&&U?-1:1);return W}async function nC($,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}=w9(Z,$),q=fz(W),D=z[F?K==="floating"?"reference":"floating":K],A=$$(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)),O=await(Q.isElement==null?void 0:Q.isElement(L))&&await(Q.getScale==null?void 0:Q.getScale(L))||{x:1,y:1},M=$$(Q.convertOffsetParentRelativeRectToViewportRelativeRect?await Q.convertOffsetParentRelativeRectToViewportRelativeRect({elements:z,rect:V,offsetParent:L,strategy:G}):V);return{top:(A.top-M.top+q.top)/O.y,bottom:(M.bottom-A.bottom+q.bottom)/O.y,left:(A.left-M.left+q.left)/O.x,right:(M.right-A.right+q.right)/O.x}}var Q10=50,sC=async($,Z,J)=>{let{placement:H="bottom",strategy:B="absolute",middleware:Q=[],platform:X}=J,z=X.detectOverflow?X:{...X,detectOverflow:nC},G=await(X.isRTL==null?void 0:X.isRTL(Z)),U=await X.getElementRects({reference:$,floating:Z,strategy:B}),{x:Y,y:K}=oC(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:O,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=O!=null?O:K,q[A]={...q[A],...M},_&&W<Q10){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}=oC(U,F,G))}N=-1}}return{x:Y,y:K,placement:F,strategy:B,middlewareData:q}};var tC=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}=w9($,Z);if((J=Q.arrow)!=null&&J.alignmentOffset)return{};let A=H4(B),V=p4(z),L=H4(z)===z,O=await(G.isRTL==null?void 0:G.isRTL(U.floating)),M=F||(L||!N?[NB(z)]:DT(z)),_=q!=="none";if(!F&&_)M.push(...VT(z,N,q,O));let w=[z,...M],C=await G.detectOverflow(Z,D),b=[],T=((H=Q.flip)==null?void 0:H.overflows)||[];if(Y)b.push(C[A]);if(K){let j=AT(B,X,O);b.push(C[j[0]],C[j[1]])}if(T=[...T,{placement:B,overflows:b}],!b.every((j)=>j<=0)){var I,S;let j=(((I=Q.flip)==null?void 0:I.index)||0)+1,y=w[j];if(y){if(!(K==="alignment"?V!==p4(y):!1)||T.every((v)=>p4(v.placement)===V?v.overflows[0]>0:!0))return{data:{index:j,overflows:T},reset:{placement:y}}}let k=(S=T.filter((x)=>x.overflows[0]<=0).sort((x,v)=>x.overflows[1]-v.overflows[1])[0])==null?void 0:S.placement;if(!k)switch(W){case"bestFit":{var R;let x=(R=T.filter((v)=>{if(_){let f=p4(v.placement);return f===V||f==="y"}return!0}).map((v)=>[v.placement,v.overflows.filter((f)=>f>0).reduce((f,E)=>f+E,0)]).sort((v,f)=>v[1]-f[1])[0])==null?void 0:R[0];if(x)k=x;break}case"initialPlacement":k=z;break}if(B!==k)return{reset:{placement:k}}}return{}}}};var eC=new Set(["left","top"]);async function X10($,Z){let{placement:J,platform:H,elements:B}=$,Q=await(H.isRTL==null?void 0:H.isRTL(B.floating)),X=H4(J),z=E8(J),G=p4(J)==="y",U=eC.has(X)?-1:1,Y=Q&&G?-1:1,K=w9(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 $E=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 X10(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}}}}},ZE=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:O}=V;return{x:L,y:O}}},...U}=w9($,Z),Y={x:J,y:H},K=await Q.detectOverflow(Z,U),F=p4(B),W=vz(F),q=Y[W],N=Y[F],D=(V,L)=>hz(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}}}}}},JE=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}=w9($,Z),F={x:B,y:Q},W=p4(X),q=vz(W),N=F[q],D=F[W],A=w9(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,O;let M=q==="y"?"width":"height",_=eC.has(H4(X)),w=z.reference[W]-z.floating[M]+(_?((L=G.offset)==null?void 0:L[W])||0:0)+(_?0:V.crossAxis),C=z.reference[W]+z.reference[M]+(_?0:((O=G.offset)==null?void 0:O[W])||0)-(_?V.crossAxis:0);if(D<w)D=w;else if(D>C)D=C}return{[q]:N,[W]:D}}}},HE=function($){if($===void 0)$={};return{name:"size",options:$,async fn(Z){let{placement:J,rects:H,platform:B,elements:Q}=Z,{apply:X=()=>{},...z}=w9($,Z),G=await B.detectOverflow(Z,z),U=H4(J),Y=E8(J),K=p4(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=G6(W-G[q],D),L=G6(F-G[N],A),O=Z.middlewareData.shift,M=!O,_=V,w=L;if(O!=null&&O.enabled.x)w=A;if(O!=null&&O.enabled.y)_=D;if(M&&!Y)if(K)w=F-2*a8(G.left,G.right);else _=W-2*a8(G.top,G.bottom);await X({...Z,availableWidth:w,availableHeight:_});let C=await B.getDimensions(Q.floating);if(F!==C.width||W!==C.height)return{reset:{rects:!0}};return{}}}};function GE($){let Z=u2($),J=parseFloat(Z.width)||0,H=parseFloat(Z.height)||0,B=_1($),Q=B?$.offsetWidth:J,X=B?$.offsetHeight:H,z=U6(J)!==Q||U6(H)!==X;if(z)J=Q,H=X;return{width:J,height:H,$:z}}function aA($){return!s0($)?$.contextElement:$}function uZ($){let Z=aA($);if(!_1(Z))return b9(1);let J=Z.getBoundingClientRect(),{width:H,height:B,$:Q}=GE(Z),X=(Q?U6(J.width):J.width)/H,z=(Q?U6(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 z10=b9(0);function UE($){let Z=S1($);if(!rA()||!Z.visualViewport)return z10;return{x:Z.visualViewport.offsetLeft,y:Z.visualViewport.offsetTop}}function G10($,Z,J){if(Z===void 0)Z=!1;return!!J&&Z&&J===S1($)}function W$($,Z,J,H){if(Z===void 0)Z=!1;if(J===void 0)J=!1;let B=$.getBoundingClientRect(),Q=aA($),X=b9(1);if(Z)if(H){if(s0(H))X=uZ(H)}else X=uZ($);let z=G10(Q,J,H)?UE(Q):b9(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=S1(Q),W=s0(H)?S1(H):H,q=F,N=lA(q);while(N&&W!==q){let D=uZ(N),A=N.getBoundingClientRect(),V=u2(N),L=A.left+(N.clientLeft+parseFloat(V.paddingLeft))*D.x,O=A.top+(N.clientTop+parseFloat(V.paddingTop))*D.y;G*=D.x,U*=D.y,Y*=D.x,K*=D.y,G+=L,U+=O,q=S1(N),N=lA(q)}}return $$({width:Y,height:K,x:G,y:U})}function PG($,Z){let J=CB($).scrollLeft;if(!Z)return W$(S3($)).left+J;return Z.left+J}function YE($,Z){let J=$.getBoundingClientRect(),H=J.left+Z.scrollLeft-PG($,J),B=J.top+Z.scrollTop;return{x:H,y:B}}function U10($){let{elements:Z,rect:J,offsetParent:H,strategy:B}=$,Q=B==="fixed",X=S3(H),z=Z?MG(Z.floating):!1;if(H===X||z&&Q)return J;let G={scrollLeft:0,scrollTop:0},U=b9(1),Y=b9(0),K=_1(H);if(K||!Q){if(b2(H)!=="body"||TB(X))G=CB(H);if(K){let W=W$(H);U=uZ(H),Y.x=W.x+H.clientLeft,Y.y=W.y+H.clientTop}}let F=X&&!K&&!Q?YE(X,G):b9(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 Y10($){return $.getClientRects?Array.from($.getClientRects()):[]}function K10($){let Z=CB($),J=$.ownerDocument.body,H=a8($.scrollWidth,$.clientWidth,J.scrollWidth,J.clientWidth),B=a8($.scrollHeight,$.clientHeight,J.scrollHeight,J.clientHeight),Q=-Z.scrollLeft+PG($),X=-Z.scrollTop;if(u2(J).direction==="rtl")Q+=a8($.clientWidth,J.clientWidth)-H;return{width:H,height:B,x:Q,y:X}}var F10=25;function W10($,Z,J){if(J===void 0)J="viewport";let H=J==="layoutViewport",B=S1($),Q=S3($),X=B.visualViewport,z=Q.clientWidth,G=Q.clientHeight,U=0,Y=0;if(X){let F=!rA()||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(PG(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<=F10)z-=A}return{width:z,height:G,x:U,y:Y}}function q10($,Z){let J=W$($,!0,Z==="fixed"),H=J.top+$.clientTop,B=J.left+$.clientLeft,Q=uZ($),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 BE($,Z,J){let H;if(Z==="viewport"||Z==="layoutViewport")H=W10($,J,Z);else if(Z==="document")H=K10(S3($));else if(s0(Z))H=q10(Z,J);else{let B=UE($);H={x:Z.x-B.x,y:Z.y-B.y,width:Z.width,height:Z.height}}return $$(H)}function N10($,Z){let J=Z.get($);if(J)return J;let H=pZ($,[],!1).filter((z)=>s0(z)&&b2(z)!=="body"),B=null,Q=u2($).position==="fixed",X=Q?I8($):$;while(s0(X)&&!R8(X)){let z=u2(X),G=iA(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=I8(X)}return Z.set($,H),H}function A10($){let{element:Z,boundary:J,rootBoundary:H,strategy:B}=$,X=[...J==="clippingAncestors"?MG(Z)?[]:N10(Z,this._c):[].concat(J),H],z=BE(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=BE(Z,X[F],B);G=a8(W.top,G),U=G6(W.right,U),Y=G6(W.bottom,Y),K=a8(W.left,K)}return{width:U-K,height:Y-G,x:K,y:G}}function D10($){let{width:Z,height:J}=GE($);return{width:Z,height:J}}function V10($,Z,J){let H=_1(Z),B=S3(Z),Q=J==="fixed",X=W$($,!0,Q,Z),z={scrollLeft:0,scrollTop:0},G=b9(0);if(H||!Q){if(b2(Z)!=="body"||TB(B))z=CB(Z);if(H){let F=W$(Z,!0,Q,Z);G.x=F.x+Z.clientLeft,G.y=F.y+Z.clientTop}}if(!H&&B)G.x=PG(B);let U=B&&!H&&!Q?YE(B,z):b9(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 dA($){return u2($).position==="static"}function QE($,Z){if(!_1($)||u2($).position==="fixed")return null;if(Z)return Z($);let J=$.offsetParent;if(S3($)===J)J=J.ownerDocument.body;return J}function KE($,Z){let J=S1($);if(MG($))return J;if(!_1($)){let B=I8($);while(B&&!R8(B)){if(s0(B)&&!dA(B))return B;B=I8(B)}return J}let H=QE($,Z);while(H&&XE(H)&&dA(H))H=QE(H,Z);if(H&&R8(H)&&dA(H)&&!iA(H))return J;return H||zE($)||J}var L10=async function($){let Z=this.getOffsetParent||KE,J=this.getDimensions,H=await J($.floating);return{reference:V10($.reference,await Z($.floating),$.strategy),floating:{x:0,y:0,width:H.width,height:H.height}}};function M10($){return u2($).direction==="rtl"}var oA={convertOffsetParentRelativeRectToViewportRelativeRect:U10,getDocumentElement:S3,getClippingRect:A10,getOffsetParent:KE,getElementRects:L10,getClientRects:Y10,getDimensions:D10,getScale:uZ,isElement:s0,isRTL:M10};function FE($,Z){return $.x===Z.x&&$.y===Z.y&&$.width===Z.width&&$.height===Z.height}function P10($,Z,J){let H=null,B,Q=S3($);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=AB(q),V=AB(Q.clientWidth-(W+N)),L=AB(Q.clientHeight-(q+D)),O=AB(W),_={rootMargin:-A+"px "+-V+"px "+-L+"px "+-O+"px",threshold:a8(0,G6(1,K))||1},w=!0;function C(b){let T=b[0].intersectionRatio;if(!FE(F,$.getBoundingClientRect()))return z();if(T!==K){if(!w)return z();if(!T)B=setTimeout(()=>{z(!1,0.0000001)},1000);else z(!1,T)}w=!1}try{H=new IntersectionObserver(C,{..._,root:Q.ownerDocument})}catch(b){H=new IntersectionObserver(C,_)}H.observe($)}let G=S1($),U=()=>z(J);return G.addEventListener("resize",U),z(!0),()=>{G.removeEventListener("resize",U),X()}}function EB($,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=aA($),Y=B||Q?[...U?pZ(U):[],...Z?pZ(Z):[]]:[];Y.forEach((A)=>{B&&A.addEventListener("scroll",J),Q&&A.addEventListener("resize",J)});let K=U&&z?P10(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?W$($):null;if(G)D();function D(){let A=W$($);if(N&&!FE(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 WE=$E;var qE=ZE,NE=tC,AE=HE;var DE=JE,_G=($,Z,J)=>{let H=new Map,B=J!=null?J:{},Q={...oA,...B.platform,_c:H};return sC($,Z,{...B,platform:Q})};var U2=P(m(),1),LE=P(m(),1),ME=P(K8(),1),O10=typeof document<"u",j10=function(){},OG=O10?LE.useLayoutEffect:j10;function jG($,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(!jG($[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(!jG($[Q],Z[Q]))return!1}return!0}return $!==$&&Z!==Z}function PE($){if(typeof window>"u")return 1;return($.ownerDocument.defaultView||window).devicePixelRatio||1}function VE($,Z){let J=PE($);return Math.round(Z*J)/J}function nA($){let Z=U2.useRef($);return OG(()=>{Z.current=$}),Z}function _E($){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]=U2.useState({x:0,y:0,strategy:J,placement:Z,middlewareData:{},isPositioned:!1}),[F,W]=U2.useState(H);if(!jG(F,H))W(H);let[q,N]=U2.useState(null),[D,A]=U2.useState(null),V=U2.useCallback((v)=>{if(v!==_.current)_.current=v,N(v)},[]),L=U2.useCallback((v)=>{if(v!==w.current)w.current=v,A(v)},[]),O=Q||q,M=X||D,_=U2.useRef(null),w=U2.useRef(null),C=U2.useRef(Y),b=G!=null,T=nA(G),I=nA(B),S=nA(U),R=U2.useCallback(()=>{if(!_.current||!w.current)return;let v={placement:Z,strategy:J,middleware:F};if(I.current)v.platform=I.current;_G(_.current,w.current,v).then((f)=>{let E={...f,isPositioned:S.current!==!1};if(j.current&&!jG(C.current,E))C.current=E,ME.flushSync(()=>{K(E)})})},[F,Z,J,I,S]);OG(()=>{if(U===!1&&C.current.isPositioned)C.current.isPositioned=!1,K((v)=>({...v,isPositioned:!1}))},[U]);let j=U2.useRef(!1);OG(()=>{return j.current=!0,()=>{j.current=!1}},[]),OG(()=>{if(O)_.current=O;if(M)w.current=M;if(O&&M){if(T.current)return T.current(O,M,R);R()}},[O,M,R,T,b]);let y=U2.useMemo(()=>({reference:_,floating:w,setReference:V,setFloating:L}),[V,L]),k=U2.useMemo(()=>({reference:O,floating:M}),[O,M]),x=U2.useMemo(()=>{let v={position:J,left:0,top:0};if(!k.floating)return v;let f=VE(k.floating,Y.x),E=VE(k.floating,Y.y);if(z)return{...v,transform:"translate("+f+"px, "+E+"px)",...PE(k.floating)>=1.5&&{willChange:"transform"}};return{position:J,left:f,top:E}},[J,z,k.floating,Y.x,Y.y]);return U2.useMemo(()=>({...Y,update:R,refs:y,elements:k,floatingStyles:x}),[Y,R,y,k,x])}var sA=($,Z)=>{let J=WE($);return{name:J.name,fn:J.fn,options:[$,Z]}},tA=($,Z)=>{let J=qE($);return{name:J.name,fn:J.fn,options:[$,Z]}},eA=($,Z)=>{return{fn:DE($).fn,options:[$,Z]}},$D=($,Z)=>{let J=NE($);return{name:J.name,fn:J.fn,options:[$,Z]}},ZD=($,Z)=>{let J=AE($);return{name:J.name,fn:J.fn,options:[$,Z]}};var X4=P(m(),1);function OE($){return T10($,$.rootContext)}function T10($,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]=X4.useState(null),[K,F]=X4.useState(void 0),[W,q]=X4.useState(void 0),N=X4.useRef(null),D=B4(H),A=X4.useMemo(()=>({reference:B,floating:Q,domReference:X}),[B,Q,X]),V=_E({...$,elements:{...A,...U&&{reference:U}}}),L=s0(K)?K:null,O=W===void 0?Z.state.floatingElement:W;Z.useSyncedValue("referenceElement",K??null),Z.useSyncedValue("domReferenceElement",K===void 0?X:L),Z.useSyncedValue("floatingElement",O);let M=X4.useCallback((I)=>{let S=s0(I)?{getBoundingClientRect:()=>I.getBoundingClientRect(),getClientRects:()=>I.getClientRects(),contextElement:I}:I;Y(S),V.refs.setReference(S)},[V.refs]),_=X4.useCallback((I)=>{if(s0(I)||I===null)N.current=I,F(I);if(s0(V.refs.reference.current)||V.refs.reference.current===null||I!==null&&!s0(I))V.refs.setReference(I)},[V.refs,F]),w=X4.useCallback((I)=>{q(I),V.refs.setFloating(I)},[V.refs]),C=X4.useMemo(()=>({...V.refs,setReference:_,setFloating:w,setPositionReference:M,domReference:N}),[V.refs,_,w,M]),b=X4.useMemo(()=>({...V.elements,domReference:X}),[V.elements,X]),T=X4.useMemo(()=>({...V,dataRef:Z.context.dataRef,open:z,onOpenChange:Z.setOpen,events:Z.context.events,floatingId:G,refs:C,elements:b,nodeId:J,rootStore:Z}),[V,C,b,J,Z,z,G]);return H0(()=>{if(X)N.current=X},[X]),H0(()=>{Z.context.dataRef.current.floatingContext=T;let I=D?.nodesRef.current.find((S)=>S.id===J);if(I)I.context=T}),X4.useMemo(()=>({...V,context:T,refs:C,elements:b,rootStore:Z}),[V,C,b,T,Z])}var TG=P(m(),1),C10=TG.createContext(void 0);function i4(){return TG.useContext(C10)?.direction??"ltr"}var E10=($)=>({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"}=w9($,Z)||{};if(U==null)return{};let F=fz(Y),W={x:J,y:H},q=VB(B),N=DB(q),D=await X.getDimensions(U),A=q==="y",V=A?"top":"left",L=A?"bottom":"right",O=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,C=z.floating[O]||Q.floating[N];if(!C||!await X.isElement?.(w))C=z.floating[O]||Q.floating[N];let b=M/2-_/2,T=C/2-D[N]/2-1,I=Math.min(F[V],T),S=Math.min(F[L],T),R=I,j=C-D[N]-S,y=C/2-D[N]/2+b,k=hz(R,y,j),x=!G.arrow&&E8(B)!=null&&y!==k&&Q.reference[N]/2-(y<R?I:S)-D[N]/2<0,v=x?y<R?y-R:y-j:0;return{[q]:W[q]+v,data:{[q]:k,centerOffset:y-k-v,...x&&{alignmentOffset:v}},reset:x}}}),jE=($,Z)=>{let{name:J,fn:H}=E10($);return{name:J,fn:H,options:[$,Z]}};var TE={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 cZ={sideX:"left",sideY:"top"};var CG="--available-width",EG="--available-height",CE="--anchor-width",EE="--anchor-height",bE="--transform-origin",wE="--positioner-width",SE="--positioner-height";var IE=CG,kE=EG;function hE($,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 yE($,Z,J){let{rects:H,placement:B}=$;return{side:hE(Z,H4(B),J),align:E8(B)||"center",anchor:{width:H.reference.width,height:H.reference.height},positioner:{width:H.floating.width,height:H.floating.height}}}function u9($){return b10($,OE)}function b10($,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:O,lazyFlip:M=!1,externalTree:_}=$,[w,C]=F8.useState(null);if(!D&&w!==null)C(null);let b=A.side||"flip",T=A.align||"flip",I=A.fallbackAxisSide||"end",S=V?.crossAxis??!1,R=V?.rootBoundary,j=typeof J==="function"?J:void 0,y=Y0(j),k=j?y:J,x=q5(J),v=q5(D),E=i4()==="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=F8.useRef(null),U0=q5(Q),z0=q5(z),Q0=typeof Q!=="function"?Q:0,N0=typeof z!=="function"?z:0,D0=[];if(W)D0.push(W);D0.push(sA((C0)=>{let x0=yE(C0,B,E),a0=typeof U0.current==="function"?U0.current(x0):U0.current,n0=typeof z0.current==="function"?z0.current(x0):z0.current;return{mainAxis:a0,crossAxis:n0,alignmentAxis:n0}},[Q0,N0,E,B]));let F0=T==="none"&&b!=="shift",s=!F0&&(Y||S||b==="shift"),a=b==="none"?null:$D({...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:T==="flip"?"alignment":!1,fallbackAxisSideDirection:I}),e=F0?null:tA({...Z0,rootBoundary:R,mainAxis:T!=="none",crossAxis:s,limiter:Y||S?void 0:eA((C0)=>{if(!J0.current)return{};let{width:x0,height:a0}=J0.current.getBoundingClientRect(),n0=p4(H4(C0.placement)),D1=n0==="y"?x0:a0,V1=n0==="y"?h.left+h.right:h.top+h.bottom;return{offset:D1/2+V1/2}})},[Z0,Y,S,R,h,T]);if(b==="shift"||T==="shift"||X==="center")D0.push(e,a);else D0.push(a,e);D0.push(ZD({...Z0,apply({elements:{floating:C0},availableWidth:x0,availableHeight:a0,rects:n0}){if(!v.current)return;let D1=C0.style;D1.setProperty(IE,`${x0}px`),D1.setProperty(kE,`${a0}px`);let V1=S1(C0).devicePixelRatio||1,{x:p1,y:Z5,width:m0,height:q0}=n0.reference,h0=(Math.round((p1+m0)*V1)-Math.round(p1*V1))/V1,U1=(Math.round((Z5+q0)*V1)-Math.round(Z5*V1))/V1;D1.setProperty(CE,`${h0}px`),D1.setProperty(EE,`${U1}px`)}}),jE((C0)=>({element:J0.current||g0(C0.elements.floating).createElement("div"),padding:J0.current?K:0,offsetParent:"floating"}),[K]),{name:"transformOrigin",fn(C0){let{elements:{floating:x0},middlewareData:a0,placement:n0,platform:D1,rects:V1,y:p1}=C0,Z5=H4(n0),m0=E8(n0),q0=p4(Z5)==="y",h0=J0.current,U1=typeof Q==="function"?Q(yE(C0,B,E)):Q,I0;if(!h0&&m0&&Math.abs(q0?a0.shift?.x||0:a0.shift?.y||0)<=1)I0=m0==="start"===(q0&&D1.isRTL?.(x0)===!0)?"100%":"0%";else{let l0=q0?a0.arrow?.x||0:a0.arrow?.y||0,L1=q0?h0?.clientWidth||0:h0?.clientHeight||0;I0=`${l0+L1/2}px`}let i0=Z5==="top"||Z5==="left"?`calc(100% + ${U1}px)`:`${-U1}px`;if(s&&q0&&Math.abs(a0.shift?.y||0)>U1)i0=`${V1.reference.y+V1.reference.height/2-p1}px`;return x0.style.setProperty(bE,q0?`${I0} ${i0}`:`${i0} ${I0}`),{}}},TE,O),H0(()=>{if(!D&&N)N.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[D,N]);let $0=F8.useMemo(()=>({ancestorScroll:!F,elementResize:!F&&typeof ResizeObserver<"u",layoutShift:!F&&typeof IntersectionObserver<"u"}),[F]),{refs:X0,elements:_0,x:M0,y:A0,middlewareData:L0,update:g,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)=>EB(...C0,$0),nodeId:L,externalTree:_}),{sideX:p0,sideY:f0}=L0.adaptiveOrigin||cZ,T0=W0?H:"fixed",d0=F8.useMemo(()=>{let C0;if(!W0)C0={position:T0,top:0,left:0};else if(O)C0={position:T0,[p0]:M0,[f0]:A0};else C0={...S0,position:T0};if(C0[IE]="100vw",C0[kE]="100vh",!W0)C0.opacity=0;return C0},[O,T0,p0,M0,f0,A0,S0,W0]),z1=F8.useRef(null);H0(()=>{if(!D)return;let C0=x.current,x0=typeof C0==="function"?C0():C0,n0=(xE(x0)?x0.current:x0)||null||null;if(n0!==z1.current)X0.setPositionReference(n0),z1.current=n0},[D,X0,k,x]),F8.useEffect(()=>{if(!D)return;let C0=x.current;if(typeof C0==="function")return;if(xE(C0)&&C0.current!==z1.current)X0.setPositionReference(C0.current),z1.current=C0.current},[D,X0,k,x]),F8.useEffect(()=>{if(q&&D&&_0.reference&&_0.floating)return EB(_0.reference,_0.floating,g,$0);return},[q,D,_0,g,$0]);let e0=H4(u),c0=hE(B,e0,E),y0=E8(u)||"center",E1=Boolean(L0.hide?.referenceHidden);H0(()=>{if(M&&D&&W0&&e0!==l)C(e0)},[M,D,W0,e0,l]);let W1=F8.useMemo(()=>({position:"absolute",top:L0.arrow?.y,left:L0.arrow?.x}),[L0.arrow]),z5=L0.arrow?.centerOffset!==0;return F8.useMemo(()=>({positionerStyles:d0,arrowStyles:W1,arrowRef:J0,arrowUncentered:z5,side:c0,align:y0,physicalSide:e0,anchorHidden:E1,refs:X0,context:t,isPositioned:W0,update:g}),[d0,W1,J0,z5,c0,y0,e0,E1,X0,t,W0,g])}function xE($){return $!=null&&"current"in $}var bG=P(m(),1),JD=bG.createContext(void 0);function vE(){let $=bG.useContext(JD);if($===void 0)throw Error(k0(84));return $}function p9($){return $==="starting"?fT:M1}function c9($,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},p9(H),B],stateAttributesMapping:U8})}var fE=P(c(),1),gE=wG.forwardRef(function(Z,J){let{toast:H,...B}=Z,Q=j9(),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:O=X.collisionAvoidance??S9,style:M,..._}=B,[w,C]=wG.useState(null),b=Q.useState("toastIndex",H.id),T=Q.useState("toastVisibleIndex",H.id),I=s0(U)?U:null,S=vA({open:!0,onOpenChange:G1,elements:{floating:w,reference:I}}),R=u9({anchor:I,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:O}),j={side:R.side,align:R.align,anchorHidden:R.anchorHidden},y=c9(Z,j,{styles:{...R.positionerStyles,[nz]:H.transitionStatus==="ending"?b:T},transitionStatus:H.transitionStatus,props:_,refs:[J,C]});return fE.jsx(JD.Provider,{value:R,children:y})});var mE=P(m(),1);var uE=mE.forwardRef(function(Z,J){let{className:H,render:B,style:Q,...X}=Z,{arrowRef:z,side:G,align:U,arrowUncentered:Y,arrowStyles:K}=vE();return G0("div",Z,{state:{side:G,align:U,uncentered:Y},ref:[J,z],props:[{style:K,"aria-hidden":!0},X]})});var pE=P(m(),1);function cE(){let $=j9(),Z=$.useState("toasts");return pE.useMemo(()=>({toasts:Z,add:$.addToast,close:$.closeToast,update:$.updateToast,promise:$.promiseToast}),[Z,$])}function dE(){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||wz("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 H5=P(c(),1),a1=z4.createToastManager();function w10({...$}){return H5.jsx(z4.Provider,{...$})}function S10({...$}){return H5.jsx(z4.Portal,{"data-slot":"toast-portal",...$})}function R10({className:$,...Z}){return H5.jsx(z4.Viewport,{"data-slot":"toast-viewport",className:B0("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 I10({className:$,...Z}){return H5.jsx(z4.Root,{"data-slot":"toast",className:B0("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 k10({className:$,...Z}){return H5.jsx(z4.Content,{"data-slot":"toast-content",className:B0("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 y10({className:$,...Z}){return H5.jsx(z4.Title,{"data-slot":"toast-title",className:B0("text-sm font-medium",$),...Z})}function x10({className:$,...Z}){return H5.jsx(z4.Description,{"data-slot":"toast-description",className:B0("text-sm text-muted-foreground",$),...Z})}function h10({className:$,render:Z=H5.jsx(P0,{variant:"outline",size:"sm"}),...J}){return H5.jsx(z4.Action,{"data-slot":"toast-action",render:Z,className:B0("shrink-0",$),...J})}function v10({className:$,children:Z,render:J=H5.jsx(P0,{variant:"ghost",size:"icon-sm"}),...H}){return H5.jsx(z4.Close,{"data-slot":"toast-close","aria-label":"Close toast",render:J,className:B0("relative shrink-0 text-muted-foreground after:absolute after:-inset-2 after:content-[''] hover:text-foreground",$),...H,children:Z??H5.jsx(e5,{"aria-hidden":"true",stroke:1.75})})}function f10({type:$}){let Z=null;if($==="success")Z=H5.jsx(iE,{"aria-hidden":"true",stroke:1.75});if($==="info")Z=H5.jsx(rE,{"aria-hidden":"true",stroke:1.75});if($==="warning")Z=H5.jsx(SG,{"aria-hidden":"true",stroke:1.75});if($==="error")Z=H5.jsx(lE,{className:"text-destructive","aria-hidden":"true",stroke:1.75});if($==="loading")Z=H5.jsx(aE,{className:"animate-spin","aria-hidden":"true",stroke:1.75});if(!Z)return null;return H5.jsx("span",{"data-slot":"toast-icon",className:"shrink-0 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",children:Z})}function g10(){let{toasts:$}=z4.useToastManager();return $.map((Z)=>H5.jsx(I10,{toast:Z,children:H5.jsxs(k10,{children:[H5.jsx(f10,{type:Z.type}),H5.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[H5.jsx(y10,{}),H5.jsx(x10,{})]}),H5.jsx(h10,{}),H5.jsx(v10,{})]})},Z.id))}function oE({children:$,toastManager:Z=a1,...J}){return H5.jsxs(w10,{toastManager:Z,...J,children:[$,H5.jsx(S10,{children:H5.jsx(R10,{children:H5.jsx(g10,{})})})]})}var SC0=z4.createToastManager,RC0=z4.useToastManager;var R3={};I5(R3,{createHandle:()=>wb,Viewport:()=>bb,Trigger:()=>Xb,Root:()=>Zb,Provider:()=>Db,Positioner:()=>Kb,Portal:()=>Ub,Popup:()=>Wb,Handle:()=>gG,Arrow:()=>Nb});var dZ=P(m(),1);var RG=P(m(),1),HD=RG.createContext(void 0);function k8($){let Z=RG.useContext(HD);if(Z===void 0&&!$)throw Error(k0(72));return Z}var nE=P(m(),1);class H9 extends g2{setState($){}update($){}set($,Z){}notifyAll(){}}var sE={...f9,disabled:($)=>$.disabled,instantType:($)=>$.instantType,isInstantPhase:($)=>$.isInstantPhase,trackCursorAxis:($)=>$.trackCursorAxis,disableHoverablePopup:($)=>$.disableHoverablePopup,lastOpenChangeReason:($)=>$.openChangeReason,closeOnClick:($)=>$.closeOnClick,closeDelay:($)=>$.closeDelay,adaptiveOrigin:($)=>$.adaptiveOrigin};class BD extends g2{constructor($,Z,J){let H=new R2;super(eE($,H,Z,J),$b(H),sE)}setOpen=($,Z)=>{KG(this,$,Z,{extraState:{openChangeReason:Z.reason}})};cancelPendingOpen($){this.state.floatingRootContext.dispatchOpenChange(!1,w0(K0.triggerPress,$))}}function tE(){let $=new R2,Z=new H9(Object.freeze(eE(void 0,$)),Object.freeze($b($)),sE);return Object.assign(Z,{setOpen:G1,cancelPendingOpen:G1})}function eE($,Z,J,H=!1){return{...v9(Z,J,H),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...$}}function $b($){return{popupRef:nE.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:$}}var bB=P(c(),1),Zb=r8(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=q6((I,S)=>new BD({open:H,openProp:B,activeTriggerId:F,triggerIdProp:K},I,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}),y9(q,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:O,transitionStatus:M}=x9(D,q),_=q.useState("isInstantPhase"),w=q.useState("instantType"),C=q.useState("lastOpenChangeReason"),b=dZ.useRef(null);H0(()=>{if(N&&J)q.setOpen(!1,w0(K0.disabled))},[N,J,q]),H0(()=>{if(M==="ending"&&C===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,_,C,w,q]),H0(()=>{if(D){if(A==null)q.set("payload",void 0)}},[q,A,D]),dZ.useImperativeHandle(z,()=>({unmount:O,close:()=>q.setOpen(!1,w0(K0.imperativeAction))}),[O,q]);let T=D||V||!J&&X!=="none";return bB.jsxs(HD.Provider,{value:q,children:[Y&&bB.jsx(I9,{handle:Y,store:q}),T&&bB.jsx(m10,{store:q,disabled:J,trackCursorAxis:X}),typeof W==="function"?W({payload:L}):W]})});function m10({store:$,disabled:Z,trackCursorAxis:J}){let H=$.useState("floatingRootContext"),B=e8(H,{enabled:!Z,referencePress:()=>$.select("closeOnClick")}),Q=SA(H,{enabled:!Z&&J!=="none",axis:J==="none"?void 0:J}),X=dZ.useMemo(()=>Y2(Q.reference,B.reference),[Q.reference,B.reference]);return h9($,{activeTriggerProps:X,inactiveTriggerProps:X,popupProps:B.floating??M1}),null}var kG=P(m(),1);function t0($){return E4($,"base-ui")}var IG=P(m(),1),QD=IG.createContext(void 0);function Jb(){return IG.useContext(QD)}var Hb=600;var Qb="data-base-ui-tooltip-trigger";function Bb($){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 u10($){let Z=$;while(Z){let J=Z.closest(`[${Qb}]`);if(J)return J;let H=Z.getRootNode();Z="host"in H&&s0(H.host)?H.host:null}return null}var Xb=T9(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=k8(!0),D=g9(X)??q;if(!D)throw Error(k0(82));let A=t0(F),V=D.useState("isTriggerActive",A),L=D.useState("isOpenedByTrigger",A),O=D.useState("floatingRootContext"),M=kG.useRef(null),_=K??0,{registerTrigger:w,isMountedByThisTrigger:C}=k9(A,M,D,{payload:z,closeOnClick:Y,closeDelay:_}),b=Jb(),{activeIdRef:T,delayRef:I,isInstantPhase:S,hasProvider:R}=OA(O,{open:L}),j=mZ(O);D.useSyncedValue("isInstantPhase",S);let y=D.useState("disabled"),k=G??y,x=q5(k),v=D.useState("trackCursorAxis"),f=D.useState("disableHoverablePopup"),E=kG.useRef(!1),l=r1(),r=kG.useRef(void 0);function h(){if(R&&T.current!=null)return 0;return U??b??Hb}function d(Q0){let N0=M.current;if(!N0||!Q0)return!1;let D0=u10(Q0);return D0!==null&&D0!==N0&&R0(N0,D0)}function o(Q0){let N0=d(Q0);if(E.current=N0,N0)j.openChangeTimeout.clear(),j.restTimeout.clear(),j.restTimeoutPending=!1,l.clear();return N0}let p=Z9(O,{enabled:!k,mouseOnly:!0,move:!1,handleClose:!f&&v!=="both"?J9():null,restMs:h,delay(){if(K==null&&R)return{close:t8(I.current,"close")};return{close:_}},triggerElementRef:M,isActiveTrigger:V,isClosing:()=>D.select("transitionStatus")==="ending",shouldOpen(){return!E.current}}),i=K$(O,{enabled:!k}).reference,n=(Q0)=>{let N0=E.current,D0=Bb(Q0),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,Q0));return}if(N0&&!F0&&a&&!x.current&&!D.select("open")&&s&&Y8(r.current)){let e=()=>{if(!E.current&&!x.current&&!D.select("open"))D.setOpen(!0,w0(K0.triggerHover,Q0,s))},$0=h();if($0===0)l.clear(),e();else l.start($0,e)}},Z0=D.useState("triggerProps",C);return G0("button",Z,{state:{open:L},ref:[J,w,M],props:[p,i,C||v!=="none"?Z0:void 0,{onMouseOver(Q0){n(Q0.nativeEvent)},onFocus(Q0){if(d(Bb(Q0.nativeEvent)))Q0.preventBaseUIHandler()},onMouseLeave(){E.current=!1,l.clear(),r.current=void 0},onPointerEnter(Q0){r.current=Q0.pointerType},onPointerDown(Q0){if(r.current=Q0.pointerType,D.set("closeOnClick",Y),Y&&!D.select("open"))D.cancelPendingOpen(Q0.nativeEvent)},onClick(Q0){if(Y&&!D.select("open"))D.cancelPendingOpen(Q0.nativeEvent)},id:A,[FB]:k?"":void 0,[Qb]:k?void 0:""},W],stateAttributesMapping:C9})});var Gb=P(m(),1);var yG=P(m(),1),XD=yG.createContext(void 0);function zb(){let $=yG.useContext(XD);if($===void 0)throw Error(k0(70));return $}var zD=P(c(),1),Ub=Gb.forwardRef(function(Z,J){let{keepMounted:H=!1,...B}=Z;if(!(k8().useState("mounted")||H))return null;return zD.jsx(XD.Provider,{value:H,children:zD.jsx(vZ,{ref:J,...B})})});var hG=P(m(),1);var xG=P(m(),1),GD=xG.createContext(void 0);function lZ(){let $=xG.useContext(GD);if($===void 0)throw Error(k0(71));return $}var Yb=P(c(),1),Kb=hG.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=S9,style:A,...V}=Z,L=k8(),O=zb(),M=L.useState("open"),_=L.useState("mounted"),w=L.useState("trackCursorAxis"),C=L.useState("disableHoverablePopup"),b=L.useState("floatingRootContext"),T=L.useState("instantType"),I=L.useState("transitionStatus"),S=L.useState("adaptiveOrigin"),R=u9({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:O,collisionAvoidance:D,adaptiveOrigin:S}),j=hG.useMemo(()=>({open:M,side:R.side,align:R.align,anchorHidden:R.anchorHidden,instant:w!=="none"?"tracking-cursor":T}),[M,R.side,R.align,R.anchorHidden,w,T]),y=c9(Z,j,{styles:R.positionerStyles,transitionStatus:I,props:V,refs:[J,L.useStateSetter("positionerElement")],hidden:!_,inert:!M||w==="both"||C});return Yb.jsx(GD.Provider,{value:R,children:y})});var Fb=P(m(),1);var Wb=Fb.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=k8(),{side:G,align:U}=lZ(),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");V5({open:Y,ref:z.context.popupRef,onComplete(){if(Y)z.context.onOpenChangeComplete?.(!0)}}),w3(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:[R9,W,p9(F),X],stateAttributesMapping:J4})});var qb=P(m(),1);var Nb=qb.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=k8(),{arrowRef:G,side:U,align:Y,arrowUncentered:K,arrowStyles:F}=lZ(),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:U8})});var Ab=P(m(),1);var UD=P(c(),1),Db=function(Z){let{delay:J,closeDelay:H,timeout:B=400}=Z,Q=Ab.useMemo(()=>({open:J,close:H}),[J,H]);return UD.jsx(QD.Provider,{value:J,children:UD.jsx(_A,{delay:Q,timeoutMs:B,children:Z.children})})};var Eb=P(m(),1);var d2=P(m(),1),Cb=P(K8(),1);var Vb=P(m(),1);function Lb($){let[Z,J]=Vb.useState({current:$,previous:null});if(!Object.is($,Z.current))J({current:$,previous:Z.current});return Z.previous}var rZ=P(m(),1);function iZ($){let Z=u2($),J=parseFloat(Z.width)||0,H=parseFloat(Z.height)||0,B=_1($),Q=B?$.offsetWidth:J,X=B?$.offsetHeight:H;if(U6(J)!==Q||U6(H)!==X)J=Q,H=X;return{width:J,height:H}}var wB="--popup-width",SB="--popup-height";function _b($){let{popupElement:Z,positionerElement:J,content:H,mounted:B,onMeasureLayout:Q,onMeasureLayoutComplete:X,side:z,direction:G}=$,U=d4(Z,!0),Y=C4(),K=rZ.useRef(null),F=rZ.useRef(!0),W=rZ.useRef(G1),q=Y0(Q),N=Y0(X),D=rZ.useMemo(()=>p10(z,G),[z,G]);H0(()=>{if(!B){W.current=G1,F.current=!0,K.current=null;return}if(!Z||!J)return;W.current=Pb(Z,D),YD(Z,"auto");let A=fG(Z,"position","static"),V=fG(Z,"transform","none"),L=fG(Z,"scale","1"),O=Pb(J,{[CG]:"max-content",[EG]:"max-content"});function M(){A(),V(),O()}function _(){M(),L()}if(q?.(),F.current||K.current===null){vG(J,"max-content");let T=iZ(Z);return K.current=T,vG(J,T),_(),N?.(null,T),F.current=!1,()=>{W.current(),W.current=G1}}vG(J,"max-content");let w=K.current,C=iZ(Z);K.current=C,YD(Z,w),_(),N?.(w,C),vG(J,C);let b=new AbortController;return Y.request(()=>{YD(Z,C),U(()=>{Z.style.setProperty(wB,"auto"),Z.style.setProperty(SB,"auto")},b.signal)}),()=>{b.abort(),Y.cancel(),W.current(),W.current=G1}},[H,Z,J,U,Y,B,q,N,D])}function p10($,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 fG($,Z,J){let H=$.style.getPropertyValue(Z);return $.style.setProperty(Z,J),()=>{$.style.setProperty(Z,H)}}function Pb($,Z){let J=[];for(let[H,B]of Object.entries(Z))J.push(fG($,H,B));return J.length?()=>{J.forEach((H)=>H())}:G1}function YD($,Z){let J=Z==="auto"?"auto":`${Z.width}px`,H=Z==="auto"?"auto":`${Z.height}px`;$.style.setProperty(wB,J),$.style.setProperty(SB,H)}function vG($,Z){let J=Z==="max-content"?"max-content":`${Z.width}px`,H=Z==="max-content"?"max-content":`${Z.height}px`;$.style.setProperty(wE,J),$.style.setProperty(SE,H)}var Ob={name:"adaptiveOrigin",async fn($){let{x:Z,y:J,rects:{floating:H},elements:{floating:B},platform:Q,strategy:X,placement:z}=$,G=S1(B),U=G.getComputedStyle(B);if(!(U.transitionDuration!=="0s"&&U.transitionDuration!==""))return{x:Z,y:J,data:cZ};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=g0(B);F={width:V.documentElement.clientWidth,height:V.documentElement.clientHeight}}else if(await Q.isElement?.(K))F=await Q.getDimensions(K);let W=H4(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":cZ.sideX,A=W==="top"?"bottom":cZ.sideY;return{x:q,y:N,data:{sideX:D,sideY:A}}}};var jb="data-activation-direction";var aZ=P(c(),1),A6={activationDirection:($)=>$?{[jb]:$}:null};function D6($){let{store:Z,side:J,children:H}=$,B=i4(),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=Lb(z?Q:null),W=i10(X,G),q=d2.useRef(null),[N,D]=d2.useState(null),[A,V]=d2.useState(null),L=d2.useRef(null),O=d2.useRef(null),M=d4(L,!0),_=C4(),w=d2.useRef(null),[C,b]=d2.useState(null),[T,I]=d2.useState(!1);H0(()=>{return Z.set("adaptiveOrigin",Ob),()=>{Z.set("adaptiveOrigin",void 0)}},[Z]);let S=Y0(()=>{L.current?.style.setProperty("animation","none"),L.current?.style.setProperty("transition","none"),O.current?.style.setProperty("display","none")}),R=Y0((f)=>{if(L.current?.style.removeProperty("animation"),L.current?.style.removeProperty("transition"),O.current?.style.removeProperty("display"),f)b(f)}),j=Y0(()=>{w.current?.abort();let f=new AbortController;w.current=f,M(()=>{D(null),b(null),q.current=null},f.signal)}),y=d2.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),I(!0);let f=l10(F,Q);V(f),y.current=Q}},[Q,F]),H0(()=>{if(N==null)return;w.current?.abort(),I(!0),_.request(()=>{Cb.flushSync(()=>{I(!1)}),j()})},[W,N,j,_]),H0(()=>{let f=L.current;if(!f)return;let E=g0(f).createElement("div");for(let l of Array.from(f.childNodes))E.appendChild(l.cloneNode(!0));q.current=E});let k=N!=null,x;if(!k)x=aZ.jsx("div",{"data-current":!0,ref:L,children:H},W);else x=aZ.jsxs(d2.Fragment,{children:[aZ.jsx("div",{"data-previous":!0,inert:S8(!0),ref:O,style:{...C?{[wB]:`${C.width}px`,[SB]:`${C.height}px`}:null,position:"absolute"},"data-ending-style":T?void 0:""},"previous"),aZ.jsx("div",{"data-current":!0,ref:L,"data-starting-style":T?"":void 0,children:H},W)]});H0(()=>{let f=O.current;if(!f||!N)return;f.replaceChildren(...Array.from(N.childNodes))},[N]),_b({popupElement:Y,positionerElement:K,mounted:U,content:G,onMeasureLayout:S,onMeasureLayoutComplete:R,side:J,direction:B});let v={activationDirection:d10(A),transitioning:k};return{children:x,state:v}}function d10($){if(!$)return;return`${Tb($.horizontal,5,"right","left")} ${Tb($.vertical,5,"down","up")}`}function Tb($,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 i10($,Z){let[J,H]=d2.useState(0),B=d2.useRef($),Q=d2.useRef(Z),X=d2.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 bb=Eb.forwardRef(function(Z,J){let{render:H,className:B,style:Q,children:X,...z}=Z,G=k8(),U=lZ(),Y=G.useState("instantType"),{children:K,state:F}=D6({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:A6})});class gG extends $9{constructor(){super(tE(),"Tooltip")}open($){this.openByTrigger($)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}function wb(){return new gG}var mG=P(m(),1),V6=P(c(),1);function y8({portal:$,children:Z,...J}){let[H,B]=mG.useState(void 0),Q=mG.useCallback((X)=>{if(X)B(X.closest("[data-applet]")?.getAttribute("data-applet")??void 0)},[]);return V6.jsxs(V6.Fragment,{children:[V6.jsx("span",{hidden:!0,ref:Q}),V6.jsx($,{...J,children:V6.jsx("div",{"data-applet":H,className:"contents",children:Z})})]})}var q$=P(c(),1);function uG({delay:$=100,...Z}){return q$.jsx(R3.Provider,{"data-slot":"tooltip-provider",delay:$,...Z})}function o1({...$}){return q$.jsx(R3.Root,{"data-slot":"tooltip",...$})}function n1({...$}){return q$.jsx(R3.Trigger,{"data-slot":"tooltip-trigger",...$})}function s1({className:$,side:Z="top",sideOffset:J=6,align:H="center",alignOffset:B=0,children:Q,...X}){return q$.jsx(y8,{portal:R3.Portal,children:q$.jsx(R3.Positioner,{align:H,alignOffset:B,side:Z,sideOffset:J,className:"isolate z-50",children:q$.jsx(R3.Popup,{"data-slot":"tooltip-content",className:r0("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 pG({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 r10=pG({cooldownMs:5000,windowMs:60000,maxPerWindow:30});function W8($,Z){let J=[$,Z.source,Z.kind,Z.name,Z.message].join("\x00");if(r10.admit(J)!=="ok")return;fetch(`/api/workspaces/${$}/applet-log`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({events:[Z]})}).catch(()=>{})}var a10=/\/api\/workspaces\/([^/\s)]+)\/(widgets|views)\/([^/\s)]+)\//;function Sb($){if(!$)return null;let Z=a10.exec($);if(!Z)return null;return{workspaceId:Z[1],kind:Z[2]==="widgets"?"widget":"view",name:Z[3]}}var Rb=!1;function Ib(){if(Rb)return;Rb=!0;let $=(Z,J,H)=>{let B=J instanceof Error?J:null,Q=B?.stack??"",X=Z??Sb(Q);if(!X)return;W8(X.workspaceId,{source:"window",kind:X.kind,name:X.name,message:B?.message||H||String(J),...Q?{stack:Q}:{}})};window.addEventListener("error",(Z)=>$(Sb(Z.filename),Z.error,Z.message)),window.addEventListener("unhandledrejection",(Z)=>$(null,Z.reason))}function oZ($,Z){return`${$}:${Z}`}function RB($){return $==="running"}function xb($){return Object.values($).some(RB)}function nZ($,Z,J){return RB($[oZ(Z,J)])}function dG($,Z){let J=`${Z}:`;return Object.entries($).some(([H,B])=>H.startsWith(J)&&RB(B))}function q8($,Z){return oZ($,Z??"new")}function cG($,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 I1=kb()(($)=>({activity:{},errors:{},previews:{},attachments:{},setActivity:(Z,J,H)=>$((B)=>({activity:{...B.activity,[oZ(Z,J)]:H}})),reconcileActivity:(Z)=>$(()=>({activity:Object.fromEntries(Z.map((J)=>[oZ(J.workspaceId,J.sessionId),J.activity]))})),setError:(Z,J,H)=>$((B)=>({errors:{...B.errors,[oZ(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=q8(Z,J);return{attachments:{...B.attachments,[Q]:[...B.attachments[Q]??[],...H]}}}),updateAttachment:(Z,J,H)=>$((B)=>{let Q=cG(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=cG(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=q8(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=q8(Z,J),X=oZ(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 hb($,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 G4($){return yb(I1,$)}var O0={all:["workspaces"],discover:["workspaces","discover"],creationInfo:["workspaces","creation-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 IB(){return{turns:[],notices:[]}}function lG($,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 vb($){let Z=IB(),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 KD=new WeakMap;function fb($,Z,J,H){for(let B of KD.get($)??[])if(B.workspaceId===Z&&B.sessionId===J)B.events.push(H)}function gb($,Z){return yN({queryKey:O0.events($,Z),queryFn:async({client:J,signal:H})=>{let B=KD.get(J)??new Set;KD.set(J,B);let Q={workspaceId:$,sessionId:Z,events:[]};B.add(Q);try{let X=await B1(`/api/workspaces/${$}/sessions/${Z}/events`,{signal:H},"Couldn’t load chat");return vb([...X,...Q.events])}finally{B.delete(Q)}},staleTime:1/0,gcTime:300000})}var r4=P(m(),1);function d9($){return $==="overview"||$==="scratchpad"||typeof $==="string"&&/^views\/[a-zA-Z0-9_-]+$/.test($)}function N$($){try{let Z=decodeURIComponent($);return d9(Z)?Z:void 0}catch{return}}var S5=($)=>`views/${$}`,sZ=($)=>$.startsWith("views/")?$.slice(6):void 0;function l9($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var L6={status:"disconnected",connectionId:null,connections:[],users:[],error:null},o10=[],mb=($,Z)=>JSON.stringify([$,Z]);class FD{state=L6;usersState=L6;channels=new Map;listeners=new Set;registrations=new Map;location=null;send=()=>{};getSnapshot=()=>this.state;getUsersSnapshot=()=>this.usersState;getPresenceSnapshot=($,Z)=>this.channels.get(mb($,Z))??o10;subscribe=($)=>{return this.listeners.add($),()=>{this.listeners.delete($)}};setSender($){this.send=$}connecting(){this.publish({status:"connecting",error:null})}disconnect($){this.publish({...L6,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=mb(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 A$=()=>{},pb=[],cb={workspaceId:"",enabled:!1,start:()=>A$,getSnapshot:()=>L6,getUsersSnapshot:()=>L6,getPresenceSnapshot:()=>pb,subscribe:()=>A$,getCurrentUser:I3,subscribeCurrentUser:iG,getDirectory:WD,subscribeDirectory:qD,getLocation:()=>null,setLocation:A$,setPresence:A$,deletePresence:A$};class ND{workspaceId;enabled;store=new FD;socket=null;retry;heartbeat;unsubscribeCurrentUser;presenceTimer;queuedPresence=new Map;stopped=!0;attempts=0;lastMessageAt=0;userId=I3()?.id;constructor($,Z=!0){this.workspaceId=$;this.enabled=Z;this.store.setSender((J)=>this.send(J))}getSnapshot=()=>this.enabled?this.store.getSnapshot():L6;getUsersSnapshot=()=>this.enabled?this.store.getUsersSnapshot():L6;getPresenceSnapshot=($,Z)=>this.enabled?this.store.getPresenceSnapshot($,Z):pb;subscribe=($)=>this.enabled?this.store.subscribe($):A$;getCurrentUser=I3;subscribeCurrentUser=iG;getDirectory=WD;subscribeDirectory=qD;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 A$;if(!this.stopped)return()=>{};return this.stopped=!1,this.userId=I3()?.id,this.unsubscribeCurrentUser=iG(()=>{let $=I3();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&&I3()!==void 0}connect(){if(!this.wantsConnection()){this.store.disconnect();return}if(this.socket)return;clearTimeout(this.retry),this.store.connecting();let $=new WebSocket(rG(`/api/workspaces/${encodeURIComponent(this.workspaceId)}/collab/ws`));this.socket=$,$.onopen=()=>{if($!==this.socket)return;this.lastMessageAt=Date.now();let Z=I3();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:ub,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(!I3()&&($.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 LD=P(c(),1),db=r4.createContext(cb),lb=r4.createContext(null);function AD($,Z,J=""){let H=`${J.replace(/\/$/,"")}/workspace/${encodeURIComponent(Z)}/`,B=$.startsWith(H)?$.slice(H.length):"";return N$(B)??(B||"overview")}function DD({workspaceId:$,enabled:Z,children:J}){let H=r4.useMemo(()=>new ND($,Z),[$,Z]),B=C2(),Q=i7(B),{base:X}=B;return r4.useEffect(()=>H.start(),[H]),r4.useEffect(()=>{let z=()=>H.setLocation({page:AD(window.location.pathname,$,X),status:document.visibilityState==="hidden"?"away":"active"});return z(),document.addEventListener("visibilitychange",z),()=>document.removeEventListener("visibilitychange",z)},[X,H,Q,$]),LD.jsx(db,{value:H,children:J})}function kB({appletId:$,active:Z=!0,children:J}){let{enabled:H}=M6(),B=r4.useMemo(()=>({active:H&&Z,appletId:$}),[H,Z,$]);return LD.jsx(lb,{value:B,children:J})}function M6(){return r4.useContext(db)}function VD(){return r4.useContext(lb)}function l2(){let $=M6(),Z=r4.useSyncExternalStore($.subscribeCurrentUser,$.getCurrentUser,$.getCurrentUser);return $.enabled&&Z!==void 0}var VU=P(m(),1);var k3={};I5(k3,{createHandle:()=>xw,Viewport:()=>yw,Trigger:()=>Bw,Title:()=>bw,Root:()=>tb,Positioner:()=>Aw,Portal:()=>zw,Popup:()=>_w,Handle:()=>XU,Description:()=>Sw,Close:()=>Iw,Backdrop:()=>Cw,Arrow:()=>jw});var yB=P(m(),1);var aG=P(m(),1),MD=aG.createContext(void 0);function a5($){let Z=aG.useContext(MD);if(Z===void 0&&!$)throw Error(k0(47));return Z}var oG=P(m(),1),ib=P(K8(),1);var rb={...f9,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 PD extends g2{constructor($,Z,J){let H=new R2;super(ob($,H,Z,J),nb(H),rb)}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=OB(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=Y$(this.state,$,Z.trigger,Q());U.openChangeReason=Z.reason,this.update(U)};if(J)this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(iz,()=>{this.set("stickIfOpen",!1)}),ib.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 ab(){let $=new R2,Z=new H9(Object.freeze(ob(void 0,$)),Object.freeze(nb($)),rb);return Object.assign(Z,{setOpen:G1})}function ob($,Z,J,H=!1){let B={...v9(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 nb($){return{popupRef:oG.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:oG.createRef(),beforeContentFocusGuardRef:oG.createRef(),stickIfOpenTimeout:new r5,triggerElements:$}}var P6=P(c(),1),sb=r8(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=n10(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),FG(K,F),y9(K);let{forceUnmount:N}=x9(F,K,()=>{K.update({stickIfOpen:!0,openChangeReason:null})});K.useSyncedValues({modal:z}),yB.useEffect(()=>{if(!F)K.context.stickIfOpenTimeout.clear()},[K,F]),yB.useImperativeHandle(Z.actionsRef,()=>({unmount:N,close:()=>K.setOpen(!1,w0(K0.imperativeAction))}),[N,K]);let D=F||W;return P6.jsxs(MD.Provider,{value:K,children:[G&&P6.jsx(I9,{handle:G,store:K}),D&&P6.jsx(s10,{store:K,modal:z}),typeof J==="function"?J({payload:q}):J]})});function tb($){if(a5(!0))return P6.jsx(sb,{props:$});return P6.jsx(z$,{children:P6.jsx(sb,{props:$})})}function n10($,Z){let J=q6((H,B)=>new PD(Z,H,B));return yB.useEffect(()=>J.context.stickIfOpenTimeout.disposeEffect(),[J]),J}function s10({store:$,modal:Z}){let J=$.useState("floatingRootContext"),H=e8(J,{outsidePressEvent:{mouse:Z==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),B=H.reference,Q=H.floating;return h9($,{activeTriggerProps:B,inactiveTriggerProps:B,popupProps:Q}),null}var fB=P(m(),1);var eb=300;var $w=P(m(),1),_D=P(K8(),1);function nG($,Z){let J=$w.useRef(null);function H(Q){_D.flushSync(()=>{$.setOpen(!1,w0(K0.focusOut,Q.nativeEvent,Q.currentTarget))}),bT(J.current)?.focus()}function B(Q){let X=$.select("positionerElement");if(X&&j3(Q,X))$.context.beforeContentFocusGuardRef.current?.focus();else{_D.flushSync(()=>{$.setOpen(!1,w0(K0.focusOut,Q.nativeEvent,Q.currentTarget))});let z=ET($.context.triggerFocusTargetRef.current||Z.current);while(z!==null&&R0(X,z)){let G=z;if(z=xZ(z),z===G)break}z?.focus()}}return{preFocusGuardRef:J,handlePreFocusGuardFocus:H,handleFocusTargetFocus:B}}var hB=P(m(),1);var xB=P(m(),1);function Zw($){let Z=xB.useRef(""),J=xB.useCallback((B)=>{if(B.defaultPrevented)return;Z.current=B.pointerType,$(B,B.pointerType)},[$]);return{onClick:xB.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 Jw=P(m(),1);function i9($,Z){let J=Jw.useRef($),H=Y0(Z);H0(()=>{if(J.current!==$)H(J.current);J.current=$},[$,H])}function vB($,Z){let J=Y0((Q,X)=>{if(!(typeof $==="function"?$():$))Z(X||(J5.os.ios?"touch":""))}),{onClick:H,onPointerDown:B}=Zw(J);return hB.useMemo(()=>({onClick:H,onPointerDown:B}),[H,B])}function Hw($){let[Z,J]=hB.useState(null),H=vB($,J);return i9($,(B)=>{if(B&&!$)J(null)}),hB.useMemo(()=>({openMethod:Z,triggerProps:H}),[Z,H])}var tZ=P(c(),1),Bw=T9(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=eb,closeDelay:F=0,id:W,...q}=Z,N=a5(!0),A=g9(G)??N;if(!A)throw Error(k0(74));let V=t0(W),L=A.useState("isTriggerActive",V),O=A.useState("floatingRootContext"),M=A.useState("isOpenedByTrigger",V),_=A.useState("triggerPopupId",V),w=fB.useRef(null),{registerTrigger:C,isMountedByThisTrigger:b}=k9(V,w,A,{payload:U,disabled:X,openOnHover:Y,closeDelay:F}),T=A.useState("openChangeReason"),I=A.useState("stickIfOpen"),S=A.useState("openMethod"),R=A.useState("focusManagerModal"),j=Z9(O,{enabled:!X&&Y&&(S!=="touch"||T!==K0.triggerPress),mouseOnly:!0,move:!1,handleClose:J9(),restMs:K,delay:{close:F},triggerElementRef:w,isActiveTrigger:L,isClosing:()=>A.select("transitionStatus")==="ending"}),y=b3(O,{stickIfOpen:I}),k=vB(()=>A.select("open"),(i)=>{A.set("openMethod",i)}),x=A.useState("triggerProps",b),{getButtonProps:v,buttonRef:f}=w5({disabled:X,native:z}),E={open(i){if(i&&T===K0.triggerPress)return KB.open(i);return C9.open(i)}},{preFocusGuardRef:l,handlePreFocusGuardFocus:r,handleFocusTargetFocus:h}=nG(A,w),o=G0("button",Z,{state:{disabled:X,open:M},ref:[f,J,C,w],props:[y.reference,j,x,k,{[hZ]:"",id:V,"aria-haspopup":"dialog","aria-expanded":M,"aria-controls":_},q,v],stateAttributesMapping:E}),p=tZ.jsx(fB.Fragment,{children:o},V);if(b&&!R)return tZ.jsxs(fB.Fragment,{children:[tZ.jsx(c4,{ref:l,onFocus:r}),p,tZ.jsx(c4,{ref:A.context.triggerFocusTargetRef,onFocus:h})]});return p});var Xw=P(m(),1);var sG=P(m(),1),OD=sG.createContext(void 0);function Qw(){let $=sG.useContext(OD);if($===void 0)throw Error(k0(45));return $}var jD=P(c(),1),zw=Xw.forwardRef(function(Z,J){let{keepMounted:H=!1,...B}=Z;if(!(a5().useState("mounted")||H))return null;return jD.jsx(OD.Provider,{value:H,children:jD.jsx(B$,{ref:J,...B})})});var JU=P(m(),1);var tG=P(m(),1),TD=tG.createContext(void 0);function eZ(){let $=tG.useContext(TD);if(!$)throw Error(k0(46));return $}var Gw=P(m(),1),Uw=P(c(),1),$J=Gw.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 Uw.jsx("div",{ref:J,role:"presentation","data-base-ui-inert":"",...B,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:Q}})});var Nw=P(m(),1);var Yw={},Kw={},Fw="";function eG($,Z){return TB($)?$:Z}function Ww($,Z,J){return/hidden|clip/.test($.getComputedStyle(eG(Z,J)).overflowY)}function t10($){if(typeof document>"u")return!1;let Z=g0($);return S1(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=g0($),H=J.documentElement,B=J.body,Q=eG(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 $50($){let Z=g0($),J=Z.documentElement,H=Z.body,B=eG(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 Z50($){let Z=g0($),J=Z.documentElement,H=Z.body,B=S1(J),Q=0,X=0,z=!1,G=m2.create();if(J5.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,Yw={scrollbarGutter:J.style.scrollbarGutter,overflowY:J.style.overflowY,overflowX:J.style.overflowX},Fw=J.style.scrollBehavior,Kw={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,O=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),C=parseFloat(q.marginTop)+parseFloat(q.marginBottom),b=parseFloat(q.marginLeft)+parseFloat(q.marginRight),T=eG(J,H);if(z=e10($),z){J.style.scrollbarGutter=A,T.style.overflowY="hidden",T.style.overflowX="hidden";return}if(Object.assign(J.style,{scrollbarGutter:A,overflowY:"hidden",overflowX:"hidden"}),V||O)J.style.overflowY="scroll";if(L||M)J.style.overflowX="scroll";Object.assign(H.style,{position:"relative",height:C||w?`calc(100dvh - ${C+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,Yw),Object.assign(H.style,Kw),!z)J.scrollTop=Q,J.scrollLeft=X,J.removeAttribute("data-base-ui-scroll-locked"),J.style.scrollBehavior=Fw}function K(){Y(),G.request(U)}U();let F=o0(B,"resize",K);return()=>{if(G.cancel(),Y(),typeof B.removeEventListener==="function")F()}}class qw{lockCount=0;restore=null;timeoutLock=r5.create();timeoutUnlock=r5.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=g0($),J=Z.documentElement,H=Z.body,B=S1(J);if(Ww(B,J,H)){let X=new B.MutationObserver(()=>{if(Ww(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=J5.os.ios||!t10($);this.restore=Q?$50($):Z50($)}}var J50=new qw;function $U($=!0,Z=null){H0(()=>{if(!$)return;return J50.acquire(Z)},[$,Z])}var H50=20;function ZU($,Z,J,H){let[B,Q]=Nw.useState(!1);H0(()=>{if(!$||!Z||J==null){Q(!1);return}let X=g0(J).documentElement.clientWidth,z=J.offsetWidth;Q(X>0&&z>0&&z>=X-H50)},[$,Z,J]),$U($&&(!Z||B),H)}var gB=P(c(),1),Aw=JU.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=S9,...V}=Z,L=a5(),O=Qw(),M=E3(),_=L.useState("floatingRootContext"),w=L.useState("mounted"),C=L.useState("open"),b=L.useState("openChangeReason"),T=L.useState("activeTriggerElement"),I=L.useState("modal"),S=L.useState("openMethod"),R=L.useState("positionerElement"),j=L.useState("instantType"),y=L.useState("transitionStatus"),k=L.useState("adaptiveOrigin"),x=JU.useRef(null),v=d4(R),f=u9({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:O,nodeId:M,collisionAvoidance:A,adaptiveOrigin:k}),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=I===!0&&b!==K0.triggerHover;ZU(C&&l,S==="touch",R,T);let r=L.useStateSetter("positionerElement"),h={open:C,side:f.side,align:f.align,anchorHidden:f.anchorHidden,instant:j},d=c9(Z,h,{styles:f.positionerStyles,transitionStatus:y,props:V,refs:[J,r],hidden:!w,inert:!C});return gB.jsxs(TD.Provider,{value:f,children:[w&&l&&gB.jsx($J,{inert:S8(!C),cutout:T}),gB.jsx(X$,{id:M,children:d})]})});var Pw=P(m(),1);var ZJ="ArrowUp",JJ="ArrowDown",HJ="ArrowLeft",BJ="ArrowRight",QJ="Home",XJ="End",CD="PageUp",ED="PageDown",B9=new Set([ZJ,JJ,HJ,BJ,QJ,XJ]),B50="Shift",Vw=[B50,"Control","Alt","Meta"];function Q50($){return _1($)&&$.tagName==="INPUT"}function bD($){if(Q50($)&&$.selectionStart!=null)return!0;if(_1($)&&$.tagName==="TEXTAREA")return!0;return!1}function wD($,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=Dw($,Z,"left"),U=HU($),Y=HU(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=Dw($,Z,"top"),U=HU($),Y=HU(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 Dw($,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 HU($){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 BU=P(m(),1),X50=BU.createContext(void 0);function QU($){let Z=BU.useContext(X50);if(Z===void 0&&!$)throw Error(k0(69));return Z}var _6=P(m(),1);var SD=_6.createContext(void 0);function Lw(){let[$,Z]=_6.useState(0),J=Y0(()=>{return Z((B)=>B+1),()=>{Z((B)=>Math.max(0,B-1))}});return{context:_6.useMemo(()=>({register:J}),[J]),hasClosePart:$>0}}function Mw(){let $=_6.useContext(SD);H0(()=>{return $?.register()},[$])}var RD=P(c(),1),_w=Pw.forwardRef(function(Z,J){let{render:H,className:B,style:Q,initialFocus:X,finalFocus:z,...G}=Z,U=a5(),Y=eZ(),K=QU(!0)!=null,{context:F,hasClosePart:W}=Lw(),q=U.useState("open"),N=U.useState("openMethod"),D=U.useState("instantType"),A=U.useState("transitionStatus"),V=U.useState("popupProps"),L=U.useState("titleElementId"),O=U.useState("descriptionElementId"),M=U.useState("modal"),_=U.useState("mounted"),w=U.useState("openChangeReason"),C=U.useState("activeTriggerElement"),b=U.useState("floatingRootContext"),T=b.useState("floatingId"),I=U.useState("disabled"),S=U.useState("openOnHover"),R=U.useState("closeDelay");V5({open:q,ref:U.context.popupRef,onComplete(){if(q)U.context.onOpenChangeComplete?.(!0)}}),w3(b,{enabled:S&&!I,closeDelay:R});let j=X===void 0?YG(U.context.popupRef):X,y=M!==!1&&W;U.useSyncedValue("focusManagerModal",y);let k=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,k],props:[V,{id:T,role:"dialog",...R9,"aria-labelledby":L,"aria-describedby":O,onKeyDown(f){if(K&&B9.has(f.key))f.stopPropagation()}},p9(A),G],stateAttributesMapping:J4});return RD.jsx(G$,{context:b,openInteractionType:N,modal:y,disabled:!_||w===K0.triggerHover,initialFocus:j,returnFocus:z,restoreFocus:"popup",previousFocusableElement:_1(C)?C:void 0,nextFocusableElement:U.context.triggerFocusTargetRef,beforeContentFocusGuardRef:U.context.beforeContentFocusGuardRef,children:RD.jsx(SD.Provider,{value:F,children:v})})});var Ow=P(m(),1);var jw=Ow.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,G=a5().useState("open"),{arrowRef:U,side:Y,align:K,arrowUncentered:F,arrowStyles:W}=eZ();return G0("div",Z,{state:{open:G,side:Y,align:K,uncentered:F},ref:[J,U],props:[{style:W,"aria-hidden":!0},X],stateAttributesMapping:U8})});var Tw=P(m(),1);var Cw=Tw.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=a5(),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:J4})});var Ew=P(m(),1);var bw=Ew.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=a5(),G=t0(X.id);return z.useSyncedValueWithCleanup("titleElementId",G),G0("h2",Z,{ref:J,props:[{id:G},X]})});var ww=P(m(),1);var Sw=ww.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=a5(),G=t0(X.id);return z.useSyncedValueWithCleanup("descriptionElementId",G),G0("p",Z,{ref:J,props:[{id:G},X]})});var Rw=P(m(),1);var Iw=Rw.forwardRef(function(Z,J){let{render:H,className:B,style:Q,disabled:X=!1,nativeButton:z=!0,...G}=Z,{buttonRef:U,getButtonProps:Y}=w5({disabled:X,focusableWhenDisabled:!1,native:z}),K=a5();return Mw(),G0("button",Z,{ref:[J,U],props:[{onClick(W){K.setOpen(!1,w0(K0.closePress,W.nativeEvent))}},G,Y]})});var kw=P(m(),1);var yw=kw.forwardRef(function(Z,J){let{render:H,className:B,style:Q,children:X,...z}=Z,G=a5(),{side:U}=eZ(),Y=G.useState("instantType"),{children:K,state:F}=D6({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:A6})});class XU extends $9{constructor(){super(ab(),"Popover")}open($){this.openByTrigger($)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}function xw(){return new XU}var O6=P(c(),1);function j6({...$}){return O6.jsx(k3.Root,{"data-slot":"popover",...$})}function T6({...$}){return O6.jsx(k3.Trigger,{"data-slot":"popover-trigger",...$})}function C6({className:$,align:Z="center",alignOffset:J=0,side:H="bottom",sideOffset:B=4,keepMounted:Q,...X}){return O6.jsx(y8,{portal:k3.Portal,keepMounted:Q,children:O6.jsx(k3.Positioner,{align:Z,alignOffset:J,side:H,sideOffset:B,className:"isolate z-50",children:O6.jsx(k3.Popup,{"data-slot":"popover-content",className:r0("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 hw({className:$,...Z}){return O6.jsx("div",{"data-slot":"popover-header",className:r0("flex flex-col gap-0.5 text-sm",$),...Z})}function vw({className:$,...Z}){return O6.jsx(k3.Title,{"data-slot":"popover-title",className:r0("font-medium",$),...Z})}var GU=P(m(),1),D$=P(c(),1),z50=($,Z)=>`mo-root${$==="always"?" mo-always":""}${Z?" mo-expr":""}`;function G50($){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 U50($){let Z=(H)=>`${-H}ms`,J=G50($);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 ID({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 fw=($)=>$.every((Z)=>Z>=-0.0001&&Z<=1.0001);function pw($){let Z=ID($);if(!fw(Z)){let J=0,H=$.c;for(let B=0;B<12;B++){let Q=(J+H)/2;if(fw(ID({...$,c:Q})))J=Q;else H=Q}Z=ID({...$,c:J})}return Z.map((J)=>Math.min(1,Math.max(0,J)))}function gw($){let[Z,J,H]=pw($);return 0.2126*Z+0.7152*J+0.0722*H}function zU($,Z){let J=gw($),H=gw(Z);return(Math.max(J,H)+0.05)/(Math.min(J,H)+0.05)}function cw($,Z,J){if(zU($,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)),zU(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 zU(B,Z)>=zU(Q,Z)?B:Q}function Y50($){return"#"+pw($).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 mw=[[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}]],K50=($)=>mw.find(([Z])=>$<Z)?.[1]??mw[0][1],F50={l:0.145,c:0,h:0},W50=1.5,q50=($,Z)=>{let J=K50(Z),H=cw({l:J.l,c:J.c,h:$},F50,W50);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:$}}},N50=[["head","bg",1.25],["eye","head",4.5]];function A50($,Z=!0,J=0){let H=q50($,J);if(Z)for(let[B,Q,X]of N50)H[B]=cw(H[B],H[Q],X);return H}function D50($,Z=!0,J=0){let H=A50($,Z,J),B={};for(let Q in H)B[Q]=Y50(H[Q]);return B}var P5=($)=>{let Z=Math.round($*100)/100;return Object.is(Z,-0)?"0":String(Z)};function kD({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`${P5($+V*W-L*q)} ${P5(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 V50($,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${P5(U(0)[0])} ${P5(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${P5(q+(D-F)/6)} ${P5(N+(A-W)/6)} ${P5(D-(V-q)/6)} ${P5(A-(L-N)/6)} ${P5(D)} ${P5(A)}`}return Y+"Z"}function L50({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`${P5(N+(A-N)*z)} ${P5(D+(V-D)*z)}`},F=`M${K(0,-1)}`;for(let W=0;W<B;W++){let[q,N]=Y(W);if(F+=`Q${P5(q)} ${P5(N)} ${K(W,W+1)}`,z<0.5)F+=`L${K(W+1,W)}`}return F+"Z"}function M50($,Z,J,H){let B=P5($-J),Q=P5($+J);return`M${B} ${P5(Z-H)}H${Q}V${P5(Z+H)}H${B}Z`}function P50($,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${P5($-X)} ${P5(z)}L${P5($-U)} ${P5(Y)}Q${P5($)} ${P5(G)} ${P5($+U)} ${P5(Y)}L${P5($+X)} ${P5(z)}Z`}function yD($,Z){for(let J=0;J<Z.length;J++)$=Math.imul($^Z[J],3432918353),$=$<<13|$>>>19;return $}function _50($){return $=Math.imul($^$>>>16,2246822507),$=Math.imul($^$>>>13,3266489909),($^$>>>16)>>>0}var dw=new TextEncoder;function O50($){return $.normalize("NFC").trim().toLowerCase()}function j50($,Z=!0){let J=Z?O50($):$;return yD(1779033703^J.length,dw.encode(J))}function uw($,Z){return _50(yD(yD($,Uint8Array.of(255)),dw.encode(Z)))/4294967296}function T50($,Z=!0,J){let H=j50($,Z),B=(Q)=>{let X=J?.[Q],z=Array.isArray(X)?X[Math.floor(uw(H,Q)*X.length)]:X;return z===void 0?uw(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 lw($,Z,J){let H=Z.expression;if(J||!H)return{l:$,wrap:""};return H.bake($,H.p)}var C50=($,Z)=>Z?.tint?Z.tint($,Z.p):$,iw=($,Z)=>Z?`<g transform="${Z}">${$}</g>`:$,E50=($)=>$.replace(/[&<>]/g,(Z)=>Z==="&"?"&":Z==="<"?"<":">");function rw($,Z){let J=T50($,Z.normalize??!0,Z.traits);return{t:J,palette:{...D50(Z.hue??J.num("hue",0,360),Z.contrast??!0,Z.tone??J("tone")),...Z.palette}}}var b50=($)=>$.title?`<title>${E50($.title)}</title>`:"";function aw($,Z,J){let H=Z.background??$.background;if(H===!1)return;return{d:H==="square"?"M0 0H100V100H0Z":kD({cx:50,cy:50,rx:50,ry:50,n:H==="circle"?2:6}),fill:J.bg}}var w50=($)=>$?`<path d="${$.d}" fill="${$.fill}"/>`:"";function S50($){return(Z,J={})=>{let{t:H,palette:B}=rw(Z,J),Q=C50(B,J.expression),X=J.size?` width="${J.size}" height="${J.size}"`:"",z=lw($.layout(H),J),G=b50(J)+w50(aw($,J,Q))+iw($.render(z.l,Q),z.wrap);return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"${X}>${G}</svg>`}}function R50($){return(Z,J={},H)=>{let{t:B,palette:Q}=rw(Z,J),X=H?.(B,Q),z=lw($.layout(B),J,X);return{cls:X?.cls,bg:aw($,J,Q),inner:iw($.render(z.l,Q,!!X),z.wrap),vars:X?.vars}}}var I50=($,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,O=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)*_,C=Math.max(-12,Math.min(12,w+$.jitter("eye.lean2",3.5))),b=J.cx+F*A,T=J.cy+W*A;return[{cx:b-O,cy:T,rx:V,ry:L,n:$.num("eye.n",3.5,6),rot:w},{cx:b+O,cy:T+q*A,rx:V*X,ry:L*X*z,n:$.num("eye.n",3.5,6),rot:C}]};function k50($,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="${kD(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):kD(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 ow=($)=>L50($),nw=($)=>V50($.cx,$.cy,$.rx,$.ry,$.radii,$.rot),xD=($)=>(Z)=>({cx:Z.cx,cy:Z.cy,rx:Z.rx*$,ry:Z.ry*$}),sw=($)=>xD(Math.min(...$.radii)*0.95)($),y50=($)=>xD(0.84)($),x50={name:"round",core:1},h50={name:"organic",core:0.98,path:nw,face:sw},v50={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:xD(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:($)=>M50($.cx,$.cy,$.rx-$.ry,$.ry)},g50={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)})}}},m50={name:"cloud",core:0.78,face:sw,path:nw,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)})}}},u50={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(P50(Z.cx,Z.cy,Z.rx,Z.ry,$.num("droplet.tip",1.4,1.65)))}},p50={name:"hexagon",core:1.05,path:ow,face:y50,body:($,Z)=>{Z.sides=6,Z.rot=$.num("body.rot",-12,12),Z.round=$.num("poly.round",0.24,0.5)}},c50={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})}}},d50={name:"triangle",core:1.15,path:ow,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=[[x50,0.22],[h50,0.48],[v50,0.6],[f50,0.7],[g50,0.79],[m50,0.86],[u50,0.915],[p50,0.95],[c50,0.98],[d50,1]],tw=k50(l50,I50),i50=S50(tw),r50=($,Z)=>(J,H)=>{let B=Z?Z.vars(Z.p):{},Q=Z?.tint?Z.tint(H,Z.p):H;return{cls:z50($,!!Object.keys(B).length||!!Z?.tint),vars:{...U50(J),"--mo-head":Q.head,"--mo-eye":Q.eye,...B}}};function a50($,Z={}){return R50(tw)($,Z,Z.animate&&r50(Z.animate,Z.expression))}function o50($,Z){return"data:image/svg+xml,"+i50($,Z).replace(/"/g,"'").replace(/[%#<>{}|\\^[\]`]/g,(J)=>"%"+J.charCodeAt(0).toString(16).toUpperCase()).replace(/\s+/g," ")}function ew({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=GU.useMemo(()=>U?"":o50($,W),[q]),D=GU.useMemo(()=>U?a50($,{...W,animate:U}):null,[q]),A=GU.useMemo(()=>({__html:D?.inner??""}),[D?.inner]);if(D){let{style:O,...M}=F;return D$.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,...O},...M,children:[G?D$.jsx("title",{children:G}):null,D.bg?D$.jsx("path",{d:D.bg.d,fill:D.bg.fill}):null,D$.jsx("g",{className:D.cls,dangerouslySetInnerHTML:A})]})}let{alt:V,...L}=F;return D$.jsx("img",{src:N,width:Z,height:Z,alt:V??G??"",...L})}var UU=ew;var YJ={};I5(YJ,{Root:()=>ZS,Image:()=>BS,Fallback:()=>QS});var GJ=P(m(),1);var YU=P(m(),1),hD=YU.createContext(void 0);function KU(){let $=YU.useContext(hD);if($===void 0)throw Error(k0(13));return $}var zJ={imageLoadingStatus:()=>null};var $S=P(c(),1),ZS=GJ.forwardRef(function(Z,J){let{className:H,render:B,style:Q,...X}=Z,[z,G]=GJ.useState("idle"),U={imageLoadingStatus:z},Y=GJ.useMemo(()=>({imageLoadingStatus:z,setImageLoadingStatus:G}),[z,G]),K=G0("span",Z,{state:U,ref:J,props:X,stateAttributesMapping:zJ});return $S.jsx(hD.Provider,{value:Y,children:K})});var mB=P(m(),1);var JS=P(m(),1);function HS($,{referrerPolicy:Z,crossOrigin:J,sizes:H,srcSet:B},Q){let X=JS.useState("idle"),z=X[1];return H0(()=>{if(!Q)return G1;if(!$&&!B)return z("error"),G1;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 n50={...zJ,...G2},BS=mB.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}=KU(),[W,q]=HS(Y,Z,!X),N=W==="loaded",{mounted:D,transitionStatus:A,setMounted:V}=S2(N),L=mB.useRef(null),O=mB.useRef(!0);H0(()=>{if(!X)return;let I=O.current;O.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"&&I)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((I)=>{Q?.(I),F(I)});H0(()=>{if(W!=="idle")_(W)},[W,_]),H0(()=>{return()=>F("idle")},[F]),V5({enabled:!N,open:N,ref:L,onComplete(){if(!N)V(!1)}});let w={imageLoadingStatus:W,transitionStatus:X&&A==="ending"?void 0:A},C=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 T=G0("img",Z,{state:w,ref:[J,L],props:[M,K,b],stateAttributesMapping:n50,enabled:C});if(!C)return null;return T});var UJ=P(m(),1);var QS=UJ.forwardRef(function(Z,J){let{className:H,render:B,delay:Q=0,style:X,...z}=Z,{imageLoadingStatus:G}=KU(),[U,Y]=UJ.useState(Q===0),K=r1();return UJ.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 V$=P(c(),1);function XS({className:$,size:Z="default",...J}){return V$.jsx(YJ.Root,{"data-slot":"avatar","data-size":Z,className:r0("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 zS({className:$,...Z}){return V$.jsx(YJ.Image,{"data-slot":"avatar-image",className:r0("aspect-square size-full rounded-full object-cover",$),...Z})}function GS({className:$,...Z}){return V$.jsx(YJ.Fallback,{"data-slot":"avatar-fallback",className:r0("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 US({className:$,...Z}){return V$.jsx("span",{"data-slot":"avatar-badge",className:r0("absolute right-0 bottom-0 size-(--avatar-badge-size) rounded-full bg-primary select-none",$),...Z})}function YS({className:$,...Z}){return V$.jsx("div",{"data-slot":"avatar-group",className:r0("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 KS({className:$,size:Z="default",...J}){return V$.jsx("div",{"data-slot":"avatar-group-count","data-size":Z,className:r0("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 h5=P(m(),1);function E6($){return $.name?.trim()||$.email?.trim()||$.id}function FS($,Z){let J=$.filter((H)=>H.userId===Z);return J.some((H)=>H.location?.status==="active")?"active":J.length?"away":"offline"}function WS($,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 KJ($,Z){let J=$.users.find((H)=>H.id===Z);return J?{...J,status:FS($.connections,Z)}:void 0}function qS($,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=KJ($,z);if(G&&(!B||G.status===B))Q.push(G)}return Q}function NS($,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:FS($,H.id)}})}function AS($,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 vD(){let $=M6();return h5.useSyncExternalStore($.subscribe,$.getUsersSnapshot,$.getUsersSnapshot)}function FJ(){let $=M6(),Z=vD(),J=h5.useSyncExternalStore($.subscribeCurrentUser,$.getCurrentUser,$.getCurrentUser),H=h5.useSyncExternalStore($.subscribeDirectory,$.getDirectory,$.getDirectory),B=h5.useMemo(()=>WS(Z.users,J,H),[Z.users,J,H]);return{state:Z,self:J,users:B,engine:$}}function b6($){let{state:Z,users:J}=FJ();return h5.useMemo(()=>KJ({...Z,users:J},$),[Z,J,$])}function DS($){let{state:Z,users:J}=FJ();return $.map((H)=>KJ({...Z,users:J},H))}function FU({status:$}={}){let{state:Z,users:J}=FJ();return h5.useMemo(()=>J.map((H)=>KJ({...Z,users:J},H.id)).filter((H)=>!$||H.status===$),[Z,J,$])}function WU(){let{state:$,self:Z,users:J}=FJ();return h5.useMemo(()=>Z?KJ({...$,users:J},Z.id):void 0,[$,Z,J])}function VS($={}){let{state:Z,self:J,users:H,engine:B}=FJ(),{scope:Q,status:X}=$;return h5.useMemo(()=>qS({...Z,users:H},J?.id,B.getLocation(),{scope:Q,status:X}),[Z,J,H,B,Q,X])}var WJ={custom:($)=>`custom:${$}`,cursor:($)=>`cursor:${$}`,target:($)=>`field:${$}`};function LS($){return uB(WJ.custom($))}function uB($){let{users:Z,engine:J}=FJ(),H=VD(),B=H?.appletId??"",Q=h5.useCallback(()=>J.getPresenceSnapshot(B,$),[J,B,$]),X=h5.useSyncExternalStore(J.subscribe,Q,Q);return h5.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 pB($,Z,J){let H=M6(),B=VD(),[Q]=h5.useState(()=>crypto.randomUUID()),X=h5.useRef(Z),z=h5.useRef(!1),G=B?.appletId??"",U=h5.useMemo(()=>AS(H,{registrationId:Q,appletId:G,channel:$},J),[H,Q,G,$,J]),Y=h5.useCallback(()=>{U.publish(X.current,B?.active===!0&&document.visibilityState!=="hidden")},[B,U]);return h5.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]),h5.useCallback((K)=>{if(X.current=K,z.current)Y()},[Y])}function s50($,Z,J){let H=pB($,Z,J);h5.useLayoutEffect(()=>H(Z),[H,Z])}function MS($,Z){s50(WJ.custom($),Z)}var w6=P(c(),1);function S6({id:$,size:Z="default",showStatusBadge:J,className:H}){let B=b6($),Q=B?E6(B):"Unknown user";return w6.jsxs(XS,{size:Z,"aria-label":Q,"data-collab-color":B?.color??"unknown",className:H,children:[B?.avatar&&w6.jsx(zS,{src:B.avatar,alt:""}),w6.jsx(GS,{children:B?w6.jsx(UU,{name:$,animate:"hover",background:"circle",traits:{shape:0,"body.r":1},palette:{bg:"var(--collab)",head:"var(--collab)",eye:"var(--collab-foreground)"}}):w6.jsx(qU,{size:Z==="xs"||Z==="sm"?12:16,stroke:1.75})}),J&&B?.status==="active"&&w6.jsx(US,{className:"bg-success"})]})}var r9=P(c(),1),t50="Unknown user";function NU({id:$,size:Z="default",showStatusBadge:J,showYouLabel:H,description:B,className:Q}){let X=b6($),z=WU(),G=X?E6(X):t50,U=X!==void 0&&X.id===z?.id;return r9.jsxs("span",{className:B0("inline-flex min-w-0 items-center gap-2",Q),children:[r9.jsx(S6,{id:$,size:Z,showStatusBadge:J}),r9.jsxs("span",{className:B0("flex min-w-0 flex-1 text-sm",Z==="xs"?"items-baseline":"flex-col"),children:[r9.jsxs("span",{className:"flex min-w-0 items-baseline gap-1",children:[r9.jsx("span",{className:B0("truncate",!X&&"text-muted-foreground"),children:G}),H&&U&&r9.jsx("span",{className:"shrink-0 text-muted-foreground",children:"(You)"})]}),B&&r9.jsxs("span",{className:B0("truncate text-muted-foreground",Z==="sm"&&"text-xs leading-tight"),children:[Z==="xs"&&r9.jsx("span",{"aria-hidden":"true",className:"whitespace-pre",children:" · "}),B]})]})]})}var cB=P(c(),1);function AU({ids:$,max:Z=3,size:J="sm",className:H}){let B=[...new Set($)],Q=B.slice(0,Z),X=B.length-Q.length;return cB.jsxs(YS,{className:H,"aria-label":`${B.length} users`,children:[Q.map((z)=>cB.jsx(S6,{id:z,size:J},z)),X>0&&cB.jsxs(KS,{size:J,"aria-label":`${X} more`,children:["+",X]})]})}var K2=P(c(),1),PS={active:0,away:1,offline:2};function fD({workspaceId:$,describeTab:Z,onOpenTab:J}){let H=l2(),B=M6(),Q=vD(),X=FU(),z=VU.useSyncExternalStore(B.subscribeCurrentUser,B.getCurrentUser,B.getCurrentUser),G=C2(),U=AD(i7(G),$,G.base),Y=NS(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]=VU.useState(!1);if(!H)return null;return K2.jsxs(j6,{open:F,onOpenChange:W,children:[K2.jsxs(T6,{render:K2.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:[K2.jsx(AU,{ids:K,size:"xs",max:4}),K2.jsx(DU,{stroke:2.5,className:"size-3! text-muted-foreground"})]}),K2.jsxs(C6,{align:"end",className:"max-w-64 p-1",children:[K2.jsx(vw,{className:"sr-only",children:"Users in this workspace"}),K2.jsx(e50,{users:Y,page:U,describeTab:Z,onOpenTab:(q)=>{W(!1),J(q)}}),Y.length===0&&K2.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)=>PS[Q.status]-PS[X.status]||Number(X.self)-Number(Q.self));return K2.jsx("ul",{className:"flex max-h-80 scroll-fade flex-col overflow-y-auto",children:B.map((Q)=>K2.jsx($20,{user:Q,page:Z,describeTab:J,onOpenTab:H},Q.profile.id))})}function $20({user:$,page:Z,describeTab:J,onOpenTab:H}){let B=$.pages.map((F)=>{let W=N$(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=K2.jsx(NU,{id:$.profile.id,className:"flex-1",size:"sm",showYouLabel:!0,description:K2.jsxs("span",{className:"flex items-center gap-1 text-xs",children:[U&&K2.jsx(U,{size:12,stroke:1.75,className:"shrink-0"}),K2.jsx("span",{className:"truncate",children:G})]})}),K="flex w-full items-center gap-2.5 rounded-md px-2 py-1 text-left";return K2.jsx("li",{children:X?K2.jsx("button",{type:"button",title:`Go to ${Q?.info?.label}`,className:B0("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}):K2.jsx("div",{className:"flex w-full items-center gap-2.5 rounded-md px-2 py-1 text-left",children:Y})})}var L$=P(m(),1);function _S($){return G0($.defaultTagName??"div",$,$)}var Z20=qJ("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 LU({className:$,variant:Z="default",render:J,...H}){return _S({defaultTagName:"span",props:Y2({className:r0(Z20({variant:Z}),$)},H),render:J,state:{slot:"badge",variant:Z}})}var R6=P(m(),1);function MU(...$){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 gD=($)=>$!==!1&&$!==null,NJ=R6.createContext([]);function PU($){return MU(...R6.useContext(NJ),$)}function _U($,Z){let J=Z===void 0,H=R6.useRef(null),B=WJ.target($),Q=uB(B),X=pB(B,!1,gD),z=(U,Y)=>Y!==null&&U instanceof Element&&U.closest("[data-presence-target]")===Y;R6.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 Q9=P(c(),1);function J20($){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 jS({id:$="default",children:Z,className:J}){let H=L$.useRef(null),B=L$.useRef(null);L$.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=WJ.cursor($),X=uB(Q),z=pB(Q,null,gD),G=new Map;for(let{connectionId:Y,userId:K,value:F}of X){let W=J20(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 Q9.jsxs("div",{ref:H,"data-collab-cursors":$,className:B0("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,Q9.jsx("div",{ref:B,className:"pointer-events-none absolute inset-0 overflow-hidden","aria-hidden":"true",children:[...G].map(([Y,{id:K,point:F}])=>Q9.jsx(H20,{root:H,point:F,id:K},Y))})]})}function H20({root:$,point:Z,id:J}){let H=L$.useRef(null);return L$.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]),Q9.jsx(B20,{ref:H,id:J})}function B20({id:$,ref:Z}){let J=b6($);return Q9.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:Q9.jsxs("span",{className:"relative block animate-in duration-200 zoom-in-75 fade-in",children:[Q9.jsx(OS,{size:24,stroke:1.5,className:"-translate-x-0.5 -translate-y-0.5 fill-collab stroke-white drop-shadow-xs"}),Q9.jsx(LU,{className:"absolute top-3.5 left-3.5 bg-collab text-collab-foreground",children:Q9.jsx("span",{className:"truncate",children:J?E6(J):"Someone"})})]})})}var OU=P(m(),1);var I6=P(c(),1);function TS({id:$,present:Z,align:J,children:H,className:B}){let Q=PU($),X=_U(Q,Z);return I6.jsx(Q20,{...X.props,ids:X.users.map((z)=>z.id),align:J,className:B,children:H})}function Q20({ids:$,align:Z,children:J,className:H,...B}){let Q=DS($).filter((X)=>X!==void 0);return I6.jsxs("div",{className:B0("relative",H),...B,children:[I6.jsx(G20,{names:Q.map(E6).join(", "),color:Q[0]?.color,align:Z}),J]})}var dB=4,X20=6,z20=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function G20({names:$,color:Z,align:J="end"}){let H=OU.useRef(null);return OU.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-dB}px`,N.top=`${W.top-q.top-Q.clientTop+Q.scrollTop-dB}px`,N.width=`${W.width+dB*2}px`,N.height=`${W.height+dB*2}px`,N.setProperty("--presence-target-width",`${W.width}px`);let D=K?getComputedStyle(K):null;for(let A of z20)N[A]=D?`calc(${D[A]} + ${dB}px)`:`${X20}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()}),I6.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:I6.jsx(LU,{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:I6.jsx("span",{className:"truncate",children:$})})})}var AJ=P(m(),1);var jU=P(c(),1);function ES({id:$,children:Z}){let J=AJ.useContext(NJ),H=AJ.useMemo(()=>{return MU($),[...J,$]},[J,$]),B=AJ.useId();return jU.jsx(CS,{reducedMotion:"user",children:jU.jsx(TU,{id:B,children:jU.jsx(NJ,{value:H,children:Z})})})}var bS=P(m(),1);var M$=P(c(),1);function wS({id:$,present:Z,align:J,children:H,className:B}){let Q=PU($),X=_U(Q,Z),z=bS.useContext(NJ).length>0;return M$.jsx(U20,{...X.props,users:X.users,animate:z&&Z===void 0,align:J,className:B,children:H})}function U20({users:$,children:Z,animate:J=!1,align:H="center",className:B,...Q}){return M$.jsxs("div",{className:B0("relative pl-8",B),...Q,children:[Z,M$.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})=>M$.jsx(K5.span,{layoutId:J?`presence:${z}`:void 0,children:M$.jsx(S6,{id:X,size:"sm",className:"animate-in duration-200 zoom-in-75 fade-in"})},X))})]})}var mD={Cursors:jS,User:NU,UserAvatar:S6,UserAvatarGroup:AU,PresenceFrame:TS,PresenceAvatars:wS,PresenceGroup:ES,useMe:WU,usePeers:VS,useUser:b6,useWorkspaceUsers:FU,usePresence:LS,usePublishPresence:MS};var SS=($)=>`moi:collab:${$}:session`,CU=()=>({selected:{},pinned:null});function k6($){try{let Z=sessionStorage.getItem(SS($));if(!Z)return CU();if(!Z.startsWith("{"))return{selected:{overview:Z},pinned:null};let J=JSON.parse(Z);if(!J||typeof J!=="object"||!("selected"in J))return CU();let H=J.selected;if(!H||typeof H!=="object"||Array.isArray(H))return CU();return{selected:Object.fromEntries(Object.entries(H).filter(([,B])=>typeof B==="string"||B===null)),pinned:null}}catch{return CU()}}function y6($,Z){try{sessionStorage.setItem(SS($),JSON.stringify({selected:Z.selected}))}catch{}}var DJ=P(m(),1);function F2($){return`draft:${$}`}function V2($,Z){return JSON.stringify([$,Z])}var Y20=($)=>RS()(kS((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:IS(()=>$)}:{}})),b1=Y20();var y3={all:["app-ui"],sessionSelection:($)=>["app-ui","session-selection",$]};function i2($,Z="shared"){let J=y3.sessionSelection($);return Z==="browser-tab"?[...J,"browser-tab"]:J}function iB($,Z="shared"){return{queryKey:i2($,Z),queryFn:()=>Z==="browser-tab"?Promise.resolve(k6($)):B1(`/api/workspaces/${$}/selected-session`),staleTime:1/0,gcTime:0,refetchOnMount:!1,refetchOnWindowFocus:!1}}function K20($,Z){return[...i2($,Z),"save"]}function lB($,Z,J,H,B="shared"){let Q=i2(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")y6(Z,{selected:G,pinned:null});return{sessionId:J,previousSessionId:z,tabId:H,scope:B}}function F20($,Z,J,H){let B=i2(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 W20($,Z,J){if(J)return;$.invalidateQueries({queryKey:y3.sessionSelection(Z),exact:!0})}function EU($,Z,J,H){b1.getState().moveComposerDraft(V2(Z,J),V2(Z,H));for(let Q of["shared","browser-tab"])$.setQueryData(i2(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=k6(Z);y6(Z,{selected:Object.fromEntries(Object.entries(B.selected).map(([Q,X])=>[Q,X===J?H:X])),pinned:null})}function x3(){let $=gN()["*"];return d9($)?$:"overview"}function uD($,Z,J){if(!$)return;if($.pinned)return $.pinned;if(J&&Z in J.selected)return J.selected[Z]??null;return $.selected[Z]??null}function h3($){let Z=x3(),J=$??Z,H=m1(),Q=l2()?"browser-tab":"shared",X=$1(),z=DJ.useMemo(()=>i2(H,Q),[H,Q]),G=DJ.useMemo(()=>K20(H,Q),[H,Q]),U=xN({mutationKey:G,exact:!0}),Y=e1(iB(H,Q)),K=yS().data,{mutate:F,mutateAsync:W}=W5({mutationKey:G,scope:{id:`selected-session:${H}`},mutationFn:(A)=>{if(A.scope==="browser-tab")return y6(H,X.getQueryData(z)??k6(H)),Promise.resolve({sessionId:A.sessionId});return B1(`/api/workspaces/${H}/selected-session`,_5("PUT",A),"Couldn’t save selected chat")},onSuccess:(A,V)=>{if(F20(X,H,A,V)!=="conflict")return;a1.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;a1.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=DJ.useCallback((A)=>{if(X.getQueryData(i2(H))?.pinned)return;let V=lB(X,H,A,J,Q);if(V)F(V)},[X,F,H,J,Q]),N=DJ.useCallback(async(A,V)=>{let L=lB(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 L2((A)=>{if(A.type!=="selected-session:updated"||A.workspaceId!==H)return;W20(X,H,Q==="shared"&&U>0)}),[Y.data===void 0||K===void 0?void 0:uD(K,J,Q==="browser-tab"?Y.data:void 0),q,N]}function yS(){let $=m1();return e1(iB($))}function x6(){let $=m1(),Z=$1(),{data:J}=yS(),H=W5({scope:{id:`pinned-session:${$}`},mutationFn:(B)=>B1(`/api/workspaces/${$}/pinned-session`,_5("PUT",{sessionId:B})),onMutate:(B)=>{let Q=y3.sessionSelection($),X=Z.getQueryData(Q)?.pinned??null;return Z.setQueryData(Q,(z)=>({selected:z?.selected??{},pinned:B})),X},onError:(B,Q,X)=>{Z.setQueryData(y3.sessionSelection($),(z)=>z?.pinned===Q?{...z,pinned:X??null}:z),a1.add({title:"Couldn’t pin chat",type:"error"})},onSettled:()=>{Z.invalidateQueries({queryKey:y3.sessionSelection($),exact:!0})}});return{pinnedSessionId:J?.pinned??null,loaded:J!==void 0,pin:H.mutate,pinAsync:H.mutateAsync}}var xS=P(m(),1);var N8={staleTime:0,gcTime:300000,refetchOnMount:!0,refetchOnWindowFocus:!0};function hS($){return{queryKey:O0.sessions($),queryFn:()=>B1(`/api/workspaces/${$}/sessions`),...N8}}function VJ($){return e1(hS($))}function vS(){let $=m1(),Z=$1(),J=l2(),[,,H]=h3(),{pinAsync:B}=x6(),Q=N5({collabEnabled:J,selectSessionForTab:H,pinAsync:B});return xS.useCallback(async(X,z,G)=>{let{collabEnabled:U,selectSessionForTab:Y,pinAsync:K}=Q.current;G.throwIfAborted();let F=Z.getQueryData(O0.sessions($))??[];if(!F.some((q)=>q.sessionId===X))F=await Z.fetchQuery(hS($));if(G.throwIfAborted(),!F.some((q)=>q.sessionId===X))return!1;if(await Z.ensureQueryData(iB($)),U)await Z.ensureQueryData(iB($,"browser-tab"));G.throwIfAborted();let W=Z.getQueryData(i2($))?.pinned;if(W&&W!==X)await K(null),G.throwIfAborted();if(W!==X)await Y(X,z),G.throwIfAborted();return!0},[Z,Q,$])}function q20($,Z){return $?.filter((J)=>J.sessionId!==Z)}function pD($,Z,J){let H=O0.sessions(Z);$.cancelQueries({queryKey:H}),$.setQueryData(H,(B)=>q20(B,J)),$.removeQueries({queryKey:O0.events(Z,J)}),$.removeQueries({queryKey:O0.session(Z,J)});for(let B of["shared","browser-tab"]){let Q=i2(Z,B),X=$.getQueryData(Q)??(B==="browser-tab"?k6(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")y6(Z,U)}$.invalidateQueries({queryKey:i2(Z),exact:!0})}function fS($){let Z=$1();return W5({mutationFn:(J)=>U4(`/api/workspaces/${$}/sessions/${J}/archive`,{method:"POST"},"Couldn’t archive chat"),onSuccess:(J,H)=>{pD(Z,$,H),Z.invalidateQueries({queryKey:O0.preview($)})}})}function gS($,Z){return e1({...gb($,Z??""),enabled:Boolean(Z)})}function bU($,Z){return e1({queryKey:O0.session($,Z??""),queryFn:()=>B1(`/api/workspaces/${$}/sessions/${Z}`),enabled:Boolean(Z),staleTime:1/0,gcTime:300000,refetchOnMount:!1,refetchOnWindowFocus:!1})}function mS($){let Z=$1();return W5({mutationFn:({patch:J,sessionId:H})=>B1(`/api/workspaces/${$}/sessions/${H}/config`,_5("PUT",J),"Failed to save chat settings"),onSuccess:(J,{sessionId:H})=>{Z.setQueryData(O0.session($,H),J)}})}function pS($,Z){let{queryClient:J,sendMessage:H,onWorkspaceSwitch:B}=Z,Q=I1.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=O0.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=O0.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)EU(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(O0.events(U,Y));if(N!==void 0)J?.setQueryData(O0.events(U,K),N),J?.removeQueries({queryKey:O0.events(U,Y)});let D=J?.getQueryData(O0.session(U,Y));if(D!==void 0)J?.setQueryData(O0.session(U,K),D),J?.removeQueries({queryKey:O0.session(U,Y)});if(!q)J?.invalidateQueries({queryKey:F});J?.invalidateQueries({queryKey:O0.preview(U)});return}if($.type==="sessions_changed"||$.type==="session_archived"){let U=$.workspaceId;if(J&&$.type==="session_archived"&&typeof $.sessionId==="string")pD(J,U,$.sessionId);let Y=O0.sessions(U);if(J?.invalidateQueries({queryKey:Y}),J?.invalidateQueries({queryKey:O0.preview(U)}),typeof $.sessionId==="string")J?.invalidateQueries({queryKey:O0.session(U,$.sessionId)});return}if($.type==="workspace:switch"){B?.($.workspaceId);return}if($.type==="scratchpad:op"){let U=uS($.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(N20(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 N20($,Z,J,H){if(!$)return;fb($,Z,J,H);let B=O0.events(Z,J),Q=$.getQueryData(B);if(Q===void 0)return;$.setQueryData(B,lG(Q,H))}var dD=null,LJ=null,wU=0,SU=null,cD=[],dS=null,cS=null,A20=15000;function lS($){if(dD=$,!cS)cS=setInterval(()=>I1.getState().sweepPreviews(A20,Date.now()),5000);if(LJ)return;iS()}function iS(){let $=++wU;if(SU)clearTimeout(SU),SU=null;let Z=new WebSocket(rG("/ws"));LJ=Z,Z.onopen=()=>{if(wU!==$){Z.close();return}for(let J of cD)Z.send(JSON.stringify(J));cD.length=0,dD?.invalidateQueries({queryKey:["workspaces","events"]}),I1.getState().clearAllPreviews()},Z.onmessage=(J)=>{if(wU!==$)return;let H;try{H=JSON.parse(J.data)}catch{return}D20(H)},Z.onclose=()=>{if(wU!==$)return;LJ=null,SU=setTimeout(iS,1000)},Z.onerror=()=>Z.close()}function D20($){pS($,{queryClient:dD,sendMessage:RU,onWorkspaceSwitch:dS})}function RU($){if(LJ&&LJ.readyState===WebSocket.OPEN)LJ.send(JSON.stringify($));else cD.push($)}function lD($){dS=$}var LN=P(m(),1);function IU(){return e1({queryKey:O0.all,queryFn:()=>B1("/api/workspaces"),staleTime:1/0,refetchOnMount:"always"})}function kU($){return e1({queryKey:O0.preview($),queryFn:()=>B1(`/api/workspaces/${$}/preview`),staleTime:60000})}function rS(){return e1({queryKey:O0.discover,queryFn:()=>B1("/api/workspaces/discover")})}function aS(){let $=$1();return W5({mutationFn:(Z)=>B1("/api/workspaces/order",_5("PUT",{ids:Z}),"Failed to reorder spaces"),onMutate:async(Z)=>{await $.cancelQueries({queryKey:O0.all,exact:!0});let J=$.getQueryData(O0.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(O0.all,B)}return{previous:J}},onError:(Z,J,H)=>{if(H?.previous)$.setQueryData(O0.all,H.previous);$.invalidateQueries({queryKey:O0.all,exact:!0})},onSuccess:(Z)=>{$.setQueryData(O0.all,Z)}})}function yU(){let $=$1();return W5({mutationFn:(Z)=>U4(`/api/workspaces/${Z}`,{method:"DELETE"},"Failed to remove workspace"),onSuccess:(Z,J)=>{$.setQueryData(O0.all,(H)=>(H??[]).filter((B)=>B.id!==J)),$.invalidateQueries({queryKey:O0.discover})}})}var $R=P(m(),1);var oS=P(c(),1);function r2({className:$,...Z}){return oS.jsx(d5,{"data-slot":"spinner",role:"status","aria-label":"Loading",className:r0("size-4 animate-spin",$),stroke:1.75,...Z})}var iD="Wait for active agents to finish, or stop them before updating Moi";var V20=["update"],nS=300000,L20=1000;function sS($){return e1({queryKey:V20,queryFn:()=>B1("/api/update"),staleTime:nS,refetchInterval:$?L20:nS,refetchOnWindowFocus:!0,retry:!1})}function tS(){return W5({mutationFn:()=>B1("/api/update",{method:"POST"},"Could not update Moi")})}var v3=P(c(),1);function M20($,Z){return!!Z&&$?.runningVersion===Z}function P20($,Z,J){let H=Z||J,B=$&&!H;return{busy:H,blocked:B,label:Z?"Updating":J?"Restarting":B?iD:"Update"}}function ZR(){let $=tS(),Z=sS($.isSuccess),J=G4((z)=>xb(z.activity)),H=Z.data,B=$.data?.installedVersion??null;if($R.useEffect(()=>{if(M20(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:{...P20(J,$.isPending,Q),errorMessage:$.error?.message??null,onClick:()=>$.mutate()}}}function JR({busy:$,blocked:Z,label:J,errorMessage:H,onClick:B}){return v3.jsxs(o1,{children:[v3.jsx(n1,{render:v3.jsx("div",{children:v3.jsx(P0,{type:"button",size:"icon",variant:$?"ghost":"default","aria-label":J,disabled:Z||$,onClick:B,children:$?v3.jsx(r2,{stroke:1.5}):v3.jsx(eS,{stroke:1.5})})})}),v3.jsx(s1,{side:"right",className:Z?"max-w-56":void 0,children:Z?iD:H??J})]})}var AQ=P(m(),1);function HR($,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 BR(){let $=$1();return W5({mutationFn:(Z)=>B1("/api/workspaces",_5("POST",Z),"Failed to add workspace"),onSuccess:(Z,J)=>{b1.getState().markWorkspacePendingAnalysis(Z.id),$.setQueryData(O0.all,(H)=>HR(H,Z)),$.setQueryData(O0.discover,(H)=>(H??[]).filter((B)=>B.path!==J.path))}})}function xU(){return e1({queryKey:O0.creationInfo,queryFn:()=>B1("/api/workspaces/create"),staleTime:30000,refetchOnMount:"always"})}function QR(){let $=$1();return W5({mutationFn:(Z)=>B1("/api/workspaces/create",_5("POST",Z),"Failed to create workspace"),onSuccess:(Z)=>{$.setQueryData(O0.all,(J)=>HR(J,Z))}})}var X9={};I5(X9,{createHandle:()=>jR,Viewport:()=>rU,Trigger:()=>oU,Title:()=>aU,Root:()=>MR,Portal:()=>dU,Popup:()=>cU,Handle:()=>MJ,Description:()=>gU,Close:()=>fU,Backdrop:()=>vU});var XR=P(m(),1);var hU=P(m(),1),rD=hU.createContext(void 0);function I2($){let Z=hU.useContext(rD);if(!$&&Z===void 0)throw Error(k0(27));return Z}var vU=XR.forwardRef(function(Z,J){let{render:H,className:B,style:Q,forceRender:X=!1,...z}=Z,G=I2(),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:J4,props:[{role:"presentation",hidden:!K,style:{userSelect:"none",WebkitUserSelect:"none"}},z],enabled:X||!Y})});var zR=P(m(),1);var fU=zR.forwardRef(function(Z,J){let{render:H,className:B,style:Q,disabled:X=!1,nativeButton:z=!0,...G}=Z,U=I2(),Y=U.useState("open"),{getButtonProps:K,buttonRef:F}=w5({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 GR=P(m(),1);var gU=GR.forwardRef(function(Z,J){let{render:H,className:B,style:Q,id:X,...z}=Z,G=I2(),U=t0(X);return G.useSyncedValueWithCleanup("descriptionElementId",U),G0("p",Z,{ref:J,props:[{id:U},z]})});var KR=P(m(),1);var mU=P(m(),1),aD=mU.createContext(void 0);function uU(){let $=mU.useContext(aD);if($===void 0)throw Error(k0(26));return $}var UR="--nested-dialogs";var Wh0=t7.open,qh0=t7.closed,Nh0=t7.startingStyle,Ah0=t7.endingStyle;var YR="data-nested-dialog-open";var pU={...U8,...G2,nestedDialogOpen($){return $?{[YR]:""}:null}};var FR=P(c(),1),cU=KR.forwardRef(function(Z,J){let{render:H,className:B,style:Q,finalFocus:X,initialFocus:z,...G}=Z,U=I2(),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"),O=U.useState("titleElementId"),M=U.useState("transitionStatus"),_=U.useState("role"),w=F.useState("floatingId");uU(),V5({open:V,ref:U.context.popupRef,onComplete(){if(V)U.context.onOpenChangeComplete?.(!0)}});let C=z===void 0?YG(U.context.popupRef):z,b=A>0,T=U.useStateSetter("popupElement"),S=G0("div",Z,{state:{open:V,nested:D,transitionStatus:M,nestedDialogOpen:b},props:[W,{id:w,"aria-labelledby":O,"aria-describedby":Y,role:_,...R9,hidden:!N,onKeyDown(R){if(B9.has(R.key))R.stopPropagation()},style:{[UR]:A}},G],ref:[J,U.context.popupRef,T],stateAttributesMapping:pU});return FR.jsx(G$,{context:F,openInteractionType:L,disabled:!N,closeOnFocusOut:!K,initialFocus:C,returnFocus:X,modal:q!==!1,restoreFocus:"popup",children:S})});var WR=P(m(),1);var rB=P(c(),1),dU=WR.forwardRef(function(Z,J){let{keepMounted:H=!1,...B}=Z,Q=I2(),X=Q.useState("mounted"),z=Q.useState("modal"),G=Q.useState("open");if(!(X||H))return null;return rB.jsx(aD.Provider,{value:H,children:rB.jsxs(B$,{ref:J,...B,children:[X&&z===!0&&rB.jsx($J,{ref:Q.context.internalBackdropRef,inert:S8(!G)}),Z.children]})})});var LR=P(m(),1);var oD=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]=oD.useState(0),[Y,K]=oD.useState(0),F=G===0,W=e8(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 $U(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]),h9($,{activeTriggerProps:W.reference,inactiveTriggerProps:W.trigger,popupProps:W.floating,nestedOpenDialogCount:G,nestedOpenDrawerCount:Y}),null}var lU=P(m(),1);var NR={...f9,modal:($)=>$.modal,nested:($)=>$.nested,nestedOpenDialogCount:($)=>$.nestedOpenDialogCount,nestedOpenDrawerCount:($)=>$.nestedOpenDrawerCount,disablePointerDismissal:($)=>$.disablePointerDismissal,openMethod:($)=>$.openMethod,descriptionElementId:($)=>$.descriptionElementId,titleElementId:($)=>$.titleElementId,viewportElement:($)=>$.viewportElement,role:($)=>$.role};class nD extends g2{constructor($,Z,J){let H=new R2,B=DR($,H,Z,J);super(B,VR(H),NR)}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(Y$(this.state,$,Z.trigger))}}function AR(){let $=new R2;return new H9(Object.freeze(DR(void 0,$)),Object.freeze(VR($)),NR)}function DR($,Z,J,H=!1){return{...v9(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 VR($){return{popupRef:lU.createRef(),backdropRef:lU.createRef(),internalBackdropRef:lU.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:$,onOpenChange:void 0,onOpenChangeComplete:void 0}}var aB=P(c(),1);function iU($,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=I2(!0),L=V!=null,O={modal:N,disablePointerDismissal:D,nested:L,role:A},M=q6((I,S)=>new nD({open:B,openProp:H,activeTriggerId:F,triggerIdProp:K,...O},I,S),!0);M.useControlledProp("openProp",H),M.useControlledProp("triggerIdProp",K),M.useSyncedValues(O),M.useContextCallback("onOpenChange",Q),M.useContextCallback("onOpenChangeComplete",X);let _=M.useState("open"),w=M.useState("mounted"),C=M.useState("payload");FG(M,_),y9(M);let{forceUnmount:b}=x9(_,M);LR.useImperativeHandle(U,()=>({unmount:b,close:()=>M.setOpen(!1,w0(K0.imperativeAction))}),[b,M]);let T=_||w;return aB.jsxs(rD.Provider,{value:M,children:[Y&&aB.jsx(I9,{handle:Y,store:M}),T&&aB.jsx(qR,{store:M,parentContext:V?.context,isDrawer:W}),typeof J==="function"?J({payload:C}):J]})}var MR=r8(function(Z){return iU("dialog",Z)});var PR=P(m(),1);var rU=PR.forwardRef(function(Z,J){let{render:H,className:B,style:Q,children:X,...z}=Z,G=uU(),U=I2(),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:pU,props:[{role:"presentation",hidden:!q,style:{pointerEvents:!Y?"none":void 0},children:X},z]})});var _R=P(m(),1);var aU=_R.forwardRef(function(Z,J){let{render:H,className:B,style:Q,id:X,...z}=Z,G=I2(),U=t0(X);return G.useSyncedValueWithCleanup("titleElementId",U),G0("h2",Z,{ref:J,props:[{id:U},z]})});var OR=P(m(),1);var oU=T9(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=I2(!0),q=g9(Y)??F;if(!q)throw Error(k0(79));let N=t0(G),D=q.useState("floatingRootContext"),A=q.useState("isOpenedByTrigger",N),V=q.useState("triggerPopupId",N),L=OR.useRef(null),{registerTrigger:O,isMountedByThisTrigger:M}=k9(N,L,q,{payload:U}),{getButtonProps:_,buttonRef:w}=w5({disabled:X,native:z}),C=b3(D),b=vB(()=>q.select("open"),(S)=>{q.set("openMethod",S)}),T={disabled:X,open:A},I=q.useState("triggerProps",M);return G0("button",Z,{state:T,ref:[w,J,O,L],props:[C.reference,I,b,{[hZ]:"",id:N,"aria-haspopup":"dialog","aria-expanded":A,"aria-controls":V},K,_],stateAttributesMapping:C9})});class MJ extends $9{constructor(){super(AR(),"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 jR(){return new MJ}var Y4=P(c(),1);function h6({...$}){return Y4.jsx(X9.Root,{"data-slot":"dialog",...$})}function f3({...$}){return Y4.jsx(X9.Trigger,{"data-slot":"dialog-trigger",...$})}function j20({...$}){return Y4.jsx(y8,{portal:X9.Portal,"data-slot":"dialog-portal",...$})}function oB({...$}){return Y4.jsx(X9.Close,{"data-slot":"dialog-close",...$})}function T20({className:$,...Z}){return Y4.jsx(X9.Backdrop,{"data-slot":"dialog-overlay",className:r0("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 PJ({className:$,children:Z,showCloseButton:J=!0,...H}){return Y4.jsxs(j20,{children:[Y4.jsx(T20,{}),Y4.jsxs(X9.Popup,{"data-slot":"dialog-content",className:r0("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&&Y4.jsxs(oB,{render:Y4.jsx(P0,{variant:"ghost",size:"icon-sm",className:"absolute top-4 right-4"}),children:[Y4.jsx(e5,{stroke:1.75}),Y4.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function v6({className:$,...Z}){return Y4.jsx(X9.Title,{"data-slot":"dialog-title",className:r0("text-lg font-semibold",$),...Z})}function _J({className:$,...Z}){return Y4.jsx(X9.Description,{"data-slot":"dialog-description",className:r0("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",$),...Z})}var dR=P(m(),1);var GY={};I5(GY,{Validity:()=>pR,Root:()=>yR,Label:()=>hR,Item:()=>cR,Error:()=>vR,Description:()=>gR,Control:()=>mR});var y2=P(m(),1);var nU=P(m(),1);var TR="data-valid",CR="data-invalid";var P$={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},E20={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},ER={disabled:!1,...E20},k2={valid($){if($===null)return null;if($)return{[TR]:""};return{[CR]:""}}};var b20={invalid:void 0,name:void 0,validityData:{state:P$,errors:[],error:"",value:"",initialValue:null},setValidityData:G1,disabled:void 0,setTouched:G1,setDirty:G1,setFilled:G1,setFocused:G1,validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:ER,registerFieldControl:G1,validation:{getValidationProps:($,Z=M1)=>Z,inputRef:{current:null},registeredInputs:new Map,registerInput:G1,getInputControl:()=>null,commit:async()=>{},change:G1}},sD=nU.createContext(b20);function o5($=!0){let Z=nU.useContext(sD);if(Z.setValidityData===G1&&!$)throw Error(k0(28));return Z}var sU=P(m(),1),w20=sU.createContext(void 0);function bR($=!1){let Z=sU.useContext(w20);if(!Z&&!$)throw Error(k0(86));return Z}var tU=P(m(),1);var S20=tU.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:G1,validationMode:"onSubmit",submitCountRef:{current:0}});function K4(){return tU.useContext(S20)}var f6=P(m(),1);var eU=P(m(),1);var tD=eU.createContext({controlId:void 0,registerControlId:G1,resetControlId:G1,labelId:void 0,setLabelId:G1,messageIds:[],setMessageIds:G1,getDescriptionProps:($)=>$});function n5(){return eU.useContext(tD)}var wR=P(c(),1),$Y=function(Z){let J=t0(),[H,B]=f6.useState(J),[Q,X]=f6.useState(),[z,G]=f6.useState([]),U=H===void 0?J:H,Y=$5(()=>new Map),{messageIds:K}=n5(),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 O;for(let M of V.values()){if(M===L)return L;if(O===void 0)O=M}return O})}),W=Y0(()=>{if(Y.current.size===0)B(J)}),q=f6.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=f6.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 wR.jsx(tD.Provider,{value:N,children:Z.children})};var g3=P(m(),1);function _$($,Z){return{...$,state:{...$.state,valid:!Z&&$.state.valid}}}var eD=Object.keys(P$);function R20($,Z){if($.matches(":disabled"))return!1;if(!Z||$.form===Z)return!0;return $.form===null&&!$.hasAttribute("form")}function SR($,Z){let J=null;for(let H of $.keys()){if(!R20(H,Z))continue;if(!H.validity.valid)return H;J??=H}return J}function RR($){return{...P$,valid:!$,customError:$}}function $V($){return $&&$.validationMessage?[$.validationMessage]:[]}function IR($){let{elementRef:Z,formRef:J}=K4(),{setValidityData:H,validate:B,validityData:Q,validationDebounceTime:X,invalid:z,markedDirtyRef:G,state:U,shouldValidateOnChange:Y,validationMode:K,registeredFieldIdRef:F}=$,{controlId:W,getDescriptionProps:q}=n5(),N=r1(),D=g3.useRef(null),A=$5(()=>new Map).current,V=g3.useRef(0),L=g3.useRef(null),O=g3.useCallback((b,T)=>{return A.set(b,T),()=>{A.delete(b)}},[A]),M=Y0(()=>{let b=SR(A,Z.current);return b&&A.get(b)?.controlRef.current||null}),_=Y0(async(b,T=!1)=>{V.current+=1;let I=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=_$(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 j(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 k(d,o,p){let i=R(d,o);S(i,p),H(i)}function x(d){let o=eD.reduce((i,n)=>{return i[n]=d.validity[n],i},{}),p=!1;for(let i of eD){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?SR(A,Z.current):D.current}let f=v();function E(){return f=v(),f?.willValidate?x(f):RR(!1)}if(T){if(U.valid!==!1||!f)return;if(!f.validity.valueMissing){y();let d=v(),o=d?.validity.customError?$V(d):[];k(RR(o.length>0),o,!1);return}for(let d of eD)if(d!=="valid"&&d!=="valueMissing"&&d!=="customError"&&f.validity[d])return}N.clear(),y();let l=E(),r=$V(f),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)k(l,r);else if(K==="onSubmit"||!Q.state.customError)l.valid=null,k(l,r);if(p=await o,I!==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,f?.willValidate)j(f,r.join(`
|
|
11
|
+
`))}else r=$V(f)}k(l,r)}),w=Y0((b,T=!1)=>{if(N.clear(),V.current+=1,T)return;let I=Y();if(I&&b!==""&&X)N.start(X,()=>{_(b)});else _(b,!I)}),C=g3.useCallback((b,T={})=>Y2(q(T),U.valid===!1&&!U.disabled&&!b?{"aria-invalid":!0}:M1),[q,U.disabled,U.valid]);return g3.useMemo(()=>({getValidationProps:C,inputRef:D,registeredInputs:A,registerInput:O,getInputControl:M,commit:_,change:w}),[C,A,O,M,_,w])}var ZY=P(m(),1);function kR($){let{change:Z,commit:J,invalid:H,markedDirtyRef:B,name:Q,setRegisteredFieldName:X,registeredFieldIdRef:z,setValidityData:G,validityData:U}=$,{formRef:Y}=K4(),K=ZY.useRef(null),F=ZY.useRef(null),W=ZY.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:_$(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:_$(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 O=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,C=K.current;if(C&&C!==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,O]}var JY=P(c(),1),I20=y2.forwardRef(function(Z,J){let{errors:H,validationMode:B,submitCountRef:Q}=K4(),{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=bR(!0)?.disabled,O=Y0(G||(()=>null)),M=L||F,[_,w]=y2.useState(!1),[C,b]=y2.useState(!1),[T,I]=y2.useState(!1),[S,R]=y2.useState(!1),j=q??C,y=N??_,k=y2.useRef(j),x=y2.useRef(void 0),[v,f]=y2.useState(),E=K??v;H0(()=>{if(q!==void 0)k.current=q},[q]);let l=Y0((F0)=>{if(q!==void 0)return;if(F0)k.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]=y2.useState({state:P$,error:"",errors:[],value:null,initialValue:null}),Z0=!p&&(M?null:i.state.valid),J0=y2.useMemo(()=>({disabled:M,touched:y,dirty:j,valid:Z0,filled:T,focused:S}),[M,y,j,Z0,T,S]),U0=IR({setValidityData:n,validate:O,validityData:i,validationDebounceTime:U,invalid:p,markedDirtyRef:k,state:J0,shouldValidateOnChange:h,validationMode:Y,registeredFieldIdRef:x}),[z0,Q0]=kR({change:U0.change,commit:U0.commit,invalid:p,markedDirtyRef:k,name:K,setRegisteredFieldName:f,registeredFieldIdRef:x,setValidityData:n,validityData:i});y2.useImperativeHandle(D,()=>({validate:z0}),[z0]);let N0=y2.useMemo(()=>({invalid:p,name:E,validityData:i,setValidityData:n,disabled:M,setTouched:r,setDirty:l,setFilled:I,setFocused:R,validationMode:Y,shouldValidateOnChange:h,state:J0,registerFieldControl:Q0,validation:U0}),[p,E,i,M,r,l,I,R,Y,h,J0,Q0,U0]),D0=G0("div",Z,{ref:J,state:J0,props:V,stateAttributesMapping:k2});return JY.jsx(sD.Provider,{value:N0,children:D0})}),yR=y2.forwardRef(function(Z,J){return JY.jsx($Y,{children:JY.jsx(I20,{...Z,ref:J})})});var nB=P(m(),1);function xR($,Z){let J=t0($);return H0(()=>{return Z(J),()=>{Z((H)=>H===J?void 0:H)}},[J,Z]),J}function HY($={}){let{id:Z,fallbackControlId:J,native:H=!1,setLabelId:B,focusControl:Q}=$,{controlId:X,setLabelId:z}=n5(),G=Y0((W)=>{z(W),B?.(W)}),U=xR(Z,G),Y=X??J;function K(W){if(Q){Q(W,Y);return}if(!Y)return;let q=g0(W.currentTarget).getElementById(Y);if(_1(q))BY(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 BY($){$.focus({focusVisible:!0})}var QY=P(m(),1),ZV=QY.createContext({disabled:!1});function OJ(){return QY.useContext(ZV)}var hR=nB.forwardRef(function(Z,J){let{render:H,className:B,style:Q,id:X,nativeLabel:z=!0,...G}=Z,U=o5(!1),Y=OJ(),{labelId:K}=n5(),F={...U.state,disabled:U.disabled||Y.disabled},W=nB.useRef(null),q=HY({id:K??X,native:z});return G0("label",Z,{ref:[J,W],state:F,props:[q,G],stateAttributesMapping:k2})});var O$=P(m(),1);var JV=P(c(),1),k20={...k2,...G2},vR=O$.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}=o5(!1),{setMessageIds:W}=n5(),{errors:q}=K4(),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:O,setMounted:M}=S2(V);H0(()=>{if(!V||!U)return;return W((k)=>k.concat(U)),()=>{W((k)=>k.filter((x)=>x!==U))}},[V,U,W]);let _=O$.useRef(null),[w,C]=O$.useState(null),[b,T]=O$.useState(null),I=Y.error;if(!A&&D)I=N;else if(Y.errors.length>1)I=Y.errors;let S=I;if(Array.isArray(I))S=I.length>1?JV.jsx("ul",{children:I.map((k)=>JV.jsx("li",{children:k},k))}):I[0];let R=Array.isArray(I)?JSON.stringify(I):I;if(V&&R!==b)T(R),C(S);V5({open:V,ref:_,onComplete(){if(!V)M(!1)}});let j={...K,transitionStatus:O},y=G0("div",Z,{ref:[J,_],state:j,props:[{id:U,children:V?S:w},G],stateAttributesMapping:k20,enabled:L});if(!L)return null;return y});var fR=P(m(),1);var gR=fR.forwardRef(function(Z,J){let{render:H,id:B,className:Q,style:X,...z}=Z,G=t0(B),U=o5(!1),Y=OJ(),{setMessageIds:K}=n5(),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:k2})});var XY=P(m(),1);var j$=P(m(),1);function F4({controlled:$,default:Z,name:J,state:H="value"}){let{current:B}=j$.useRef($!==void 0),[Q,X]=j$.useState(Z),z=B&&$!==void 0?$:Q,G=j$.useCallback((U)=>{if(!B)X(U)},[]);return[z,G]}function g6($,Z,J,H,B=!0,Q){let{registerFieldControl:X}=o5(),z=$5(()=>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 HV=P(m(),1);function m6($={}){let{id:Z,enabled:J=!0}=$,{controlId:H,registerControlId:B,resetControlId:Q}=n5(),X=t0(),z=$5(()=>Symbol()),G=HV.useRef(!1),U=HV.useRef(!1),Y=Y0(()=>{if(!G.current||B===G1)return;G.current=!1,B(z.current,void 0)});return H0(()=>{if(!J||B===G1){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 mR=XY.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:O,setFilled:M,validationMode:_,validation:w}=o5(),{clearErrors:C,elementRef:b,submitCountRef:T}=K4(),I=D||G,S=N??X,R={...q,disabled:I},{labelId:j}=n5(),y=m6({id:Q}),[k]=F4({controlled:z,default:Y,name:"FieldControl",state:"value"}),x=z!==void 0,v=x?k:void 0,f=v==null?void 0:String(v),E=Y0(()=>w.inputRef.current?.value);g6(w.inputRef,y,f,E,!I,X),H0(()=>{let d=f??w.inputRef.current?.value;if(d!==void 0)M(d!=="")},[f,w.inputRef,M]),i9(f,()=>{if(f===void 0)return;C(S),V(f!==(L.initialValue??"")),w.change(f)});let l=XY.useRef(null),r=r1();return H0(()=>{if(K&&l.current===d1(g0(l.current)))O(!0)},[K,O]),G0("input",Z,{ref:[J,l],state:R,props:[{id:y,disabled:I,name:S,ref:w.inputRef,"aria-labelledby":j,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)C(S),w.change(o)},onFocus(){O(!0)},onBlur(d){if(A(!0),O(!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=T.current;r.start(0,()=>{if(T.current===n)w.commit(i.value)})}else w.commit(o)}}},W,(d)=>w.getValidationProps(I,d)],stateAttributesMapping:k2})});var sB=P(m(),1);var uR=P(c(),1),pR=function(Z){let{children:J}=Z,{validityData:H,invalid:B}=o5(!1),Q=sB.useMemo(()=>_$(H,B),[H,B]),X=Q.state.valid===!1,{transitionStatus:z}=S2(X),G=sB.useMemo(()=>{return{...Q,validity:Q.state,transitionStatus:z}},[Q,z]);return uR.jsx(sB.Fragment,{children:J(G)})};var zY=P(m(),1);var BV=P(c(),1),cR=zY.forwardRef(function(Z,J){let{render:H,className:B,style:Q,disabled:X=!1,...z}=Z,{state:G,disabled:U}=o5(!1),Y=U||X,K={...G,disabled:Y},F=zY.useMemo(()=>({disabled:Y}),[Y]),W=G0("div",Z,{ref:J,state:K,props:z,stateAttributesMapping:k2});return BV.jsx($Y,{children:BV.jsx(ZV.Provider,{value:F,children:W})})});var lR=P(c(),1),tB=dR.forwardRef(function(Z,J){return lR.jsx(GY.Control,{ref:J,...Z})});var iR=P(c(),1);function T$({className:$,type:Z,...J}){return iR.jsx(tB,{type:Z,"data-slot":"input",className:r0("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 rR($){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 jJ=["claude-code","codex","openclaw","hermes"];var CJ=P(m(),1);var UY="/claude-z2xnay0d.svg";var aR="/floppy-disk-wmjs0n85.webp";var YY="/hermes-pznd63x9.png";var KY="/openai-ep9ht2pq.svg";var FY="/openclaw-a2pyfhpn.svg";var Y1=P(c(),1),eR="Set up the Moi workspace for this project. Fetch https://moi.computer/INSTALL.md, and follow the steps.";function EJ({trigger:$,open:Z,onOpenChange:J}){return Y1.jsxs(h6,{open:Z,onOpenChange:J,children:[$&&Y1.jsx(f3,{render:$}),Y1.jsx(u20,{})]})}var oR=2;function g20({demoInstallUrl:$}){let Z=CJ.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*oR}px`),Z.current.style.setProperty("--floppy-y",`${z*-2*oR}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:aR,alt:"",className:"w-full drop-shadow-xl"}),Y1.jsxs("div",{className:z9({variant:"outline",className:"absolute -right-3 -bottom-2 -rotate-8"}),children:["About Moi",Y1.jsx(nR,{"data-icon":"inline-end",stroke:1.5})]})]})})}function m20(){let[$,Z]=CJ.useState(!1);return CJ.useEffect(()=>{if(!$)return;let H=setTimeout(()=>Z(!1),1500);return()=>clearTimeout(H)},[$]),{copied:$,copy:()=>{navigator.clipboard?.writeText(eR).then(()=>Z(!0)).catch(()=>{})}}}function u20(){let{demoInstallUrl:$}=o4(),{copied:Z,copy:J}=m20();return Y1.jsxs(PJ,{"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(v6,{children:"Unlock all features"}),Y1.jsx(_J,{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(sR,{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(tR,{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:UY,alt:"",className:"size-3.5 object-contain"}),"Claude,"]}),Y1.jsxs("span",{className:"inline-flex items-center gap-1 font-medium",children:[Y1.jsx("img",{src:KY,alt:"",className:"size-3.5 object-contain"}),"ChatGPT,"]}),Y1.jsxs("span",{className:"inline-flex items-center gap-1 font-medium",children:[Y1.jsx("img",{src:YY,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:FY,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:eR}),Y1.jsxs(P0,{type:"button",onClick:J,className:"absolute right-4 -bottom-4",children:[Z?Y1.jsx(a4,{"data-icon":"inline-start",stroke:1.5}):Y1.jsx(TJ,{"data-icon":"inline-start",stroke:1.5}),Z?"Copied":"Copy prompt"]})]})]})]}),Y1.jsx(g20,{demoInstallUrl:$})]}),Y1.jsx(oB,{render:Y1.jsx(P0,{variant:"outline",size:"icon","aria-label":"Close",className:"absolute top-4 right-4",children:Y1.jsx(e5,{stroke:1.5})})})]})}var $7=P(m(),1);var Ly=P(m(),1);var eB=["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"],p20=new Set(eB);function $I($){return p20.has($)}var Hk={rocket:dI,sparkles:aI,bolt:$Q,flame:OI,star:oI,heart:wI,diamond:PI,trophy:$k,target:sI,bulb:UI,brain:XI,robot:cI,wand:Zk,atom:HI,flask:jI,cpu:DI,code:NI,terminal:tI,api:JI,database:LI,cube:VI,hexagon:SI,plug:pI,tool:eI,settings:u6,dots:WY,bug:GI,activity:ZI,chart:FI,briefcase:zI,folder:TI,file:bJ,book:QI,message:xI,mail:kI,bell:BI,paperclip:NY,key:qY,shield:lI,user:qU,home:RI,globe:bI,world:Jk,planet:uI,compass:AI,map:yI,calendar:YI,cloud:qI,sun:nI,moon:hI,snowflake:rI,leaf:II,mountain:vI,feather:_I,ghost:CI,music:fI,piano:AY,camera:KI,photo:mI,palette:gI,gamepad:MI,gift:EI,cart:iI,chef:WI},Bk=eB.map(($)=>({id:$,Icon:Hk[$]}));function DY($){return $&&$I($)?Hk[$]:null}var c20=($,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}},VY=c20;var d20={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},Qk=d20;var l20=($)=>{return VY(Qk[$.toLowerCase()],6)},Xk=l20;var i20=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,r20=($)=>{let Z;return(Z=$.match(i20))?VY(parseInt(Z[1],16),Z[1].length):void 0},zk=r20;var LY="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)";var C$="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%";var ZQ="(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?))";var Gk="(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)(deg|grad|rad|turn)|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?))";var p6="\\s*,\\s*";var om0=new RegExp("^(?:([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%|([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)|none)$");var a20=new RegExp(`^rgba?\\(\\s*${LY}${p6}${LY}${p6}${LY}\\s*(?:,\\s*${ZQ}\\s*)?\\)$`),o20=new RegExp(`^rgba?\\(\\s*${C$}${p6}${C$}${p6}${C$}\\s*(?:,\\s*${ZQ}\\s*)?\\)$`),n20=($)=>{let Z={mode:"rgb"},J;if(J=$.match(a20)){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(o20)){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},Uk=n20;var s20=($,Z)=>$===void 0?void 0:typeof $!=="object"?Kk($):$.mode!==void 0?$:Z?{...$,mode:Z}:void 0,Yk=s20;var t20=($="rgb")=>(Z)=>(Z=Yk(Z,$))!==void 0?Z.mode===$?Z:G9[Z.mode][$]?G9[Z.mode][$](Z):$==="rgb"?G9[Z.mode].rgb(Z):G9.rgb[$](G9[Z.mode].rgb(Z)):void 0,MY=t20;var G9={},Fk={},JQ=[],QV={},e20=($)=>$,U5=($)=>{if(G9[$.mode]={...G9[$.mode],...$.toMode},Object.keys($.fromMode||{}).forEach((Z)=>{if(!G9[Z])G9[Z]={};G9[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}),Fk[$.mode]=$,($.parse||[]).forEach((Z)=>{$40(Z,$.mode)}),MY($.mode)},Wk=($)=>Fk[$],$40=($,Z)=>{if(typeof $==="string"){if(!Z)throw Error("'mode' required when 'parser' is a string");QV[$]=Z}else if(typeof $==="function"){if(JQ.indexOf($)<0)JQ.push($)}};var XV=/[^\x00-\x7F]|[a-zA-Z_]/,Z40=/[^\x00-\x7F]|[-\w]/,j0={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"},K1=0;function PY($){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 zV($){if(K1>=$.length)return!1;let Z=$[K1];if(XV.test(Z))return!0;if(Z==="-"){if($.length-K1<2)return!1;let J=$[K1+1];if(J==="-"||XV.test(J))return!0;return!1}return!1}var J40={deg:1,rad:180/Math.PI,grad:0.9,turn:360};function HQ($){let Z="";if($[K1]==="-"||$[K1]==="+")Z+=$[K1++];if(Z+=_Y($),$[K1]==="."&&/\d/.test($[K1+1]))Z+=$[K1++]+_Y($);if($[K1]==="e"||$[K1]==="E"){if(($[K1+1]==="-"||$[K1+1]==="+")&&/\d/.test($[K1+2]))Z+=$[K1++]+$[K1++]+_Y($);else if(/\d/.test($[K1+1]))Z+=$[K1++]+_Y($)}if(zV($)){let J=OY($);if(J==="deg"||J==="rad"||J==="turn"||J==="grad")return{type:j0.Hue,value:Z*J40[J]};return}if($[K1]==="%")return K1++,{type:j0.Percentage,value:+Z};return{type:j0.Number,value:+Z}}function _Y($){let Z="";while(/\d/.test($[K1]))Z+=$[K1++];return Z}function OY($){let Z="";while(K1<$.length&&Z40.test($[K1]))Z+=$[K1++];return Z}function H40($){let Z=OY($);if($[K1]==="(")return K1++,{type:j0.Function,value:Z};if(Z==="none")return{type:j0.None,value:void 0};return{type:j0.Ident,value:Z}}function B40($=""){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:j0.ParenClose});continue}if(H==="+"){if(K1--,PY(Z)){J.push(HQ(Z));continue}return}if(H==="-"){if(K1--,PY(Z)){J.push(HQ(Z));continue}if(zV(Z)){J.push({type:j0.Ident,value:OY(Z)});continue}return}if(H==="."){if(K1--,PY(Z)){J.push(HQ(Z));continue}return}if(H==="/"){while(K1<Z.length&&(Z[K1]===`
|
|
14
|
+
`||Z[K1]==="\t"||Z[K1]===" "))K1++;let B;if(PY(Z)){if(B=HQ(Z),B.type!==j0.Hue){J.push({type:j0.Alpha,value:B});continue}}if(zV(Z)){if(OY(Z)==="none"){J.push({type:j0.Alpha,value:{type:j0.None,value:void 0}});continue}}return}if(/\d/.test(H)){K1--,J.push(HQ(Z));continue}if(XV.test(H)){K1--,J.push(H40(Z));continue}return}return J}function Q40($){$._i=0;let Z=$[$._i++];if(!Z||Z.type!==j0.Function||Z.value!=="color")return;if(Z=$[$._i++],Z.type!==j0.Ident)return;let J=QV[Z.value];if(!J)return;let H={mode:J},B=qk($,!1);if(!B)return;let Q=Wk(J).channels;for(let X=0,z,G;X<Q.length;X++)if(z=B[X],G=Q[X],z.type!==j0.None){if(H[G]=z.type===j0.Number?z.value:z.value/100,G==="alpha")H[G]=Math.max(0,Math.min(1,H[G]))}return H}function qk($,Z){let J=[],H;while($._i<$.length){if(H=$[$._i++],H.type===j0.None||H.type===j0.Number||H.type===j0.Alpha||H.type===j0.Percentage||Z&&H.type===j0.Hue){J.push(H);continue}if(H.type===j0.ParenClose){if($._i<$.length)return;continue}return}if(J.length<3||J.length>4)return;if(J.length===4){if(J[3].type!==j0.Alpha)return;J[3]=J[3].value}if(J.length===3)J.push({type:j0.None,value:void 0});return J.every((B)=>B.type!==j0.Alpha)?J:void 0}function X40($,Z){$._i=0;let J=$[$._i++];if(!J||J.type!==j0.Function)return;let H=qk($,Z);if(!H)return;return H.unshift(J.value),H}var z40=($)=>{if(typeof $!=="string")return;let Z=B40($),J=Z?X40(Z,!0):void 0,H=void 0,B=0,Q=JQ.length;while(B<Q)if((H=JQ[B++]($,J))!==void 0)return H;return Z?Q40(Z):void 0},Kk=z40;function G40($,Z){if(!Z||Z[0]!=="rgb"&&Z[0]!=="rgba")return;let J={mode:"rgb"},[,H,B,Q,X]=Z;if(H.type===j0.Hue||B.type===j0.Hue||Q.type===j0.Hue)return;if(H.type!==j0.None)J.r=H.type===j0.Number?H.value/255:H.value/100;if(B.type!==j0.None)J.g=B.type===j0.Number?B.value/255:B.value/100;if(Q.type!==j0.None)J.b=Q.type===j0.Number?Q.value/255:Q.value/100;if(X.type!==j0.None)J.alpha=Math.min(1,Math.max(0,X.type===j0.Number?X.value:X.value/100));return J}var Nk=G40;var U40=($)=>$==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,Ak=U40;var Dk=($,Z,J)=>$+J*(Z-$);var Y40=($)=>{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},Vk=($)=>(Z)=>{let J=Y40(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=Vk(Dk);var k1=($)=>{let Z=!1,J=$.map((H)=>{if(H!==void 0)return Z=!0,H;return 1});return Z?J:$};var K40={mode:"rgb",channels:["r","g","b","alpha"],parse:[Nk,zk,Uk,Xk,Ak,"srgb"],serialize:"srgb",interpolate:{r:E0,g:E0,b:E0,alpha:{use:E0,fixup:k1}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},x8=K40;var GV=($=0)=>Math.pow(Math.abs($),2.19921875)*Math.sign($),F40=($)=>{let Z=GV($.r),J=GV($.g),H=GV($.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},UV=F40;var YV=($)=>Math.pow(Math.abs($),0.4547069271758437)*Math.sign($),W40=({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:YV($*2.0415879038107465-Z*0.5650069742788597-0.3447313507783297*J),g:YV($*-0.9692436362808798+Z*1.8759675015077206+0.0415550574071756*J),b:YV($*0.0134442806320312-Z*0.1183623922310184+1.0151749943912058*J)};if(H!==void 0)B.alpha=H;return B},KV=W40;var FV=($=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)},q40=({r:$,g:Z,b:J,alpha:H})=>{let B={mode:"lrgb",r:FV($),g:FV(Z),b:FV(J)};if(H!==void 0)B.alpha=H;return B},h8=q40;var N40=($)=>{let{r:Z,g:J,b:H,alpha:B}=h8($),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},n4=N40;var WV=($=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},A40=({r:$,g:Z,b:J,alpha:H},B="rgb")=>{let Q={mode:B,r:WV($),g:WV(Z),b:WV(J)};if(H!==void 0)Q.alpha=H;return Q},v8=A40;var D40=({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=v8({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},s4=D40;var V40={...x8,mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:($)=>KV(n4($)),xyz65:KV},toMode:{rgb:($)=>s4(UV($)),xyz65:UV}},Lk=V40;var L40=($)=>($=$%360)<0?$+360:$,O5=L40;var M40=($,Z)=>{return $.map((J,H,B)=>{if(J===void 0)return J;let Q=O5(J);if(H===0||$[H-1]===void 0)return Q;return Z(Q-O5(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},[])},x2=($)=>M40($,(Z)=>Math.abs(Z)<=180?Z:Z-360*Math.sign(Z));var W2=[-0.14861,1.78277,-0.29227,-0.90649,1.97294,0],Mk=Math.PI/180,Pk=180/Math.PI;var _k=W2[3]*W2[4],Ok=W2[1]*W2[4],jk=W2[1]*W2[2]-W2[0]*W2[3],P40=({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=(jk*J+$*_k-Z*Ok)/(jk+_k-Ok),Q=J-B,X=(W2[4]*(Z-B)-W2[2]*Q)/W2[3],z={mode:"cubehelix",l:B,s:B===0||B===1?void 0:Math.sqrt(Q*Q+X*X)/(W2[4]*B*(1-B))};if(z.s)z.h=Math.atan2(X,Q)*Pk-120;if(H!==void 0)z.alpha=H;return z},Tk=P40;var _40=({h:$,s:Z,l:J,alpha:H})=>{let B={mode:"rgb"};if($=($===void 0?0:$+120)*Mk,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*(W2[0]*X+W2[1]*z),B.g=J+Q*(W2[2]*X+W2[3]*z),B.b=J+Q*(W2[4]*X+W2[5]*z),H!==void 0)B.alpha=H;return B},Ck=_40;var c6=($,Z)=>{if($.h===void 0||Z.h===void 0||!$.s||!Z.s)return 0;let J=O5($.h),H=O5(Z.h),B=Math.sin((H-J+360)/2*Math.PI/180);return 2*Math.sqrt($.s*Z.s)*B},Ek=($,Z)=>{if($.h===void 0||Z.h===void 0)return 0;let J=O5($.h),H=O5(Z.h);if(Math.abs(H-J)>180)return J-(H-360*Math.sign(H-J));return H-J},d6=($,Z)=>{if($.h===void 0||Z.h===void 0||!$.c||!Z.c)return 0;let J=O5($.h),H=O5(Z.h),B=Math.sin((H-J+360)/2*Math.PI/180);return 2*Math.sqrt($.c*Z.c)*B};var h2=($)=>{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 O40={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:Tk},toMode:{rgb:Ck},interpolate:{h:{use:E0,fixup:x2},s:E0,l:E0,alpha:{use:E0,fixup:k1}},difference:{h:c6},average:{h:h2}},bk=O40;var j40=({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=O5(Math.atan2(J,Z)*180/Math.PI);if(H!==void 0)X.alpha=H;return X},A8=j40;var T40=({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},D8=T40;var jY=Math.pow(29,3)/Math.pow(3,3),TY=Math.pow(6,3)/Math.pow(29,3);var u5={X:0.9642956764295677,Y:1,Z:0.8251046025104602},l6={X:0.9504559270516716,Y:1,Z:1.0890577507598784},Gp0=Math.pow(29,3)/Math.pow(3,3),Up0=Math.pow(6,3)/Math.pow(29,3);var qV=($)=>Math.pow($,3)>TY?Math.pow($,3):(116*$-16)/jY,C40=({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:qV(Q)*l6.X,y:qV(B)*l6.Y,z:qV(X)*l6.Z};if(H!==void 0)z.alpha=H;return z},CY=C40;var E40=($)=>s4(CY($)),i6=E40;var NV=($)=>$>TY?Math.cbrt($):(jY*$+16)/116,b40=({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=NV($/l6.X),Q=NV(Z/l6.Y),X=NV(J/l6.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},EY=b40;var w40=($)=>{let Z=EY(n4($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},r6=w40;var wJ=1,bY=1,E$=0.14444444444444443*Math.PI,SJ=Math.cos(E$),RJ=Math.sin(E$),wY=100/Math.log(1.39);var S40=({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($*wJ/wY)-1)/0.0039},Q=(Math.exp(0.0435*Z*bY*wJ)-1)/0.075,X=Q*Math.cos(J/180*Math.PI-E$),z=Q*Math.sin(J/180*Math.PI-E$);if(B.a=X*SJ-z/0.83*RJ,B.b=X*RJ+z/0.83*SJ,H!==void 0)B.alpha=H;return B},BQ=S40;var 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=Z*SJ+J*RJ,Q=0.83*(J*SJ-Z*RJ),X=Math.sqrt(B*B+Q*Q),z={mode:"dlch",l:wY/wJ*Math.log(1+0.0039*$),c:Math.log(1+0.075*X)/(0.0435*bY*wJ)};if(z.c)z.h=O5((Math.atan2(Q,B)+E$)/Math.PI*180);if(H!==void 0)z.alpha=H;return z},QQ=R40;var wk=($)=>BQ(A8($,"dlch")),Sk=($)=>D8(QQ($),"dlab"),I40={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:wk,rgb:($)=>i6(wk($))},fromMode:{lab65:Sk,rgb:($)=>Sk(r6($))},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:k1}}},Rk=I40;var k40={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:BQ,dlab:($)=>D8($,"dlab"),rgb:($)=>i6(BQ($))},fromMode:{lab65:QQ,dlab:($)=>A8($,"dlch"),rgb:($)=>QQ(r6($))},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:x2},alpha:{use:E0,fixup:k1}},difference:{h:d6},average:{h:h2}},Ik=k40;function AV({h:$,s:Z,i:J,alpha:H}){if($=O5($!==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 DV({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 y40={mode:"hsi",toMode:{rgb:AV},parse:["--hsi"],serialize:"--hsi",fromMode:{rgb:DV},channels:["h","s","i","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:E0,fixup:x2},s:E0,i:E0,alpha:{use:E0,fixup:k1}},difference:{h:c6},average:{h:h2}},kk=y40;function VV({h:$,s:Z,l:J,alpha:H}){if($=O5($!==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 LV({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 x40=($,Z)=>{switch(Z){case"deg":return+$;case"rad":return $/Math.PI*180;case"grad":return $/10*9;case"turn":return $*360}},yk=x40;var h40=new RegExp(`^hsla?\\(\\s*${Gk}${p6}${C$}${p6}${C$}\\s*(?:,\\s*${ZQ}\\s*)?\\)$`),v40=($)=>{let Z=$.match(h40);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=yk(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},xk=v40;function f40($,Z){if(!Z||Z[0]!=="hsl"&&Z[0]!=="hsla")return;let J={mode:"hsl"},[,H,B,Q,X]=Z;if(H.type!==j0.None){if(H.type===j0.Percentage)return;J.h=H.value}if(B.type!==j0.None){if(B.type===j0.Hue)return;J.s=B.value/100}if(Q.type!==j0.None){if(Q.type===j0.Hue)return;J.l=Q.value/100}if(X.type!==j0.None)J.alpha=Math.min(1,Math.max(0,X.type===j0.Number?X.value:X.value/100));return J}var hk=f40;var g40={mode:"hsl",toMode:{rgb:VV},fromMode:{rgb:LV},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[hk,xk],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:x2},s:E0,l:E0,alpha:{use:E0,fixup:k1}},difference:{h:c6},average:{h:h2}},SY=g40;function XQ({h:$,s:Z,v:J,alpha:H}){if($=O5($!==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 zQ({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 m40={mode:"hsv",toMode:{rgb:XQ},parse:["--hsv"],serialize:"--hsv",fromMode:{rgb:zQ},channels:["h","s","v","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:E0,fixup:x2},s:E0,v:E0,alpha:{use:E0,fixup:k1}},difference:{h:c6},average:{h:h2}},RY=m40;function MV({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 XQ({h:$,s:J===1?1:1-Z/(1-J),v:1-J,alpha:H})}function PV($){let Z=zQ($);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 u40($,Z){if(!Z||Z[0]!=="hwb")return;let J={mode:"hwb"},[,H,B,Q,X]=Z;if(H.type!==j0.None){if(H.type===j0.Percentage)return;J.h=H.value}if(B.type!==j0.None){if(B.type===j0.Hue)return;J.w=B.value/100}if(Q.type!==j0.None){if(Q.type===j0.Hue)return;J.b=Q.value/100}if(X.type!==j0.None)J.alpha=Math.min(1,Math.max(0,X.type===j0.Number?X.value:X.value/100));return J}var vk=u40;var p40={mode:"hwb",toMode:{rgb:MV},fromMode:{rgb:PV},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[vk],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:x2},w:E0,b:E0,alpha:{use:E0,fixup:k1}},difference:{h:Ek},average:{h:h2}},fk=p40;var IY=203;var kY=0.1593017578125;var yY=0.8359375,xY=18.8515625,hY=18.6875;function vY($){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 fY($){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 _V=($)=>Math.max($/IY,0),c40=({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=vY($+0.008609037037932761*Z+0.11102962500302593*J),Q=vY($-0.00860903703793275*Z-0.11102962500302599*J),X=vY($+0.5600313357106791*Z-0.32062717498731885*J),z={mode:"xyz65",x:_V(2.070152218389422*B-1.3263473389671556*Q+0.2066510476294051*X),y:_V(0.3647385209748074*B+0.680566024947227*Q-0.0453045459220346*X),z:_V(-0.049747207535812*B-0.0492609666966138*Q+1.1880659249923042*X)};if(H!==void 0)z.alpha=H;return z},OV=c40;var jV=($=0)=>Math.max($*IY,0),d40=({x:$,y:Z,z:J,alpha:H})=>{let B=jV($),Q=jV(Z),X=jV(J),z=fY(0.3592832590121217*B+0.6976051147779502*Q-0.0358915932320289*X),G=fY(-0.1920808463704995*B+1.1004767970374323*Q+0.0753748658519118*X),U=fY(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},TV=d40;var l40={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:OV,rgb:($)=>s4(OV($))},fromMode:{xyz65:TV,rgb:($)=>TV(n4($))},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:k1}}},gk=l40;var i40=134.03437499999998,r40=0.000000000016295499532821565,CV=($)=>{if($<0)return 0;let Z=Math.pow($/1e4,kY);return Math.pow((yY+xY*Z)/(1+hY*Z),i40)},EV=($=0)=>Math.max($*203,0),a40=({x:$,y:Z,z:J,alpha:H})=>{$=EV($),Z=EV(Z),J=EV(J);let B=1.15*$-0.15*J,Q=0.66*Z+0.34*$,X=CV(0.41478972*B+0.579999*Q+0.014648*J),z=CV(-0.20151*B+1.120649*Q+0.0531008*J),G=CV(-0.0166008*B+0.2648*Q+0.6684799*J),U=(X+z)/2,Y={mode:"jab",j:0.44*U/(1-0.56*U)-r40,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},gY=a40;var o40=134.03437499999998,mk=0.000000000016295499532821565,bV=($)=>{if($<0)return 0;let Z=Math.pow($,1/o40);return 1e4*Math.pow((yY-Z)/(hY*Z-xY),1/kY)},wV=($)=>$/203,n40=({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=($+mk)/(0.44+0.56*($+mk)),Q=bV(B+0.13860504*Z+0.058047316*J),X=bV(B-0.13860504*Z-0.058047316*J),z=bV(B-0.096019242*Z-0.8118919*J),G={mode:"xyz65",x:wV(1.661373024652174*Q-0.914523081304348*X+0.23136208173913045*z),y:wV(-0.3250758611844533*Q+1.571847026732543*X-0.21825383453227928*z),z:wV(-0.090982811*Q-0.31272829*X+1.5227666*z)};if(H!==void 0)G.alpha=H;return G},mY=n40;var s40=($)=>{let Z=gY(n4($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},uY=s40;var t40=($)=>s4(mY($)),pY=t40;var e40={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:uY,xyz65:gY},toMode:{rgb:pY,xyz65:mY},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:k1}}},uk=e40;var $80=({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=O5(Math.atan2(J,Z)*180/Math.PI);if(H!==void 0)Q.alpha=H;return Q},SV=$80;var Z80=({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},RV=Z80;var J80={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:RV,rgb:($)=>pY(RV($))},fromMode:{rgb:($)=>SV(uY($)),jab:SV},channels:["j","c","h","alpha"],ranges:{j:[0,0.221],c:[0,0.19],h:[0,360]},interpolate:{h:{use:E0,fixup:x2},c:E0,j:E0,alpha:{use:E0,fixup:k1}},difference:{h:d6},average:{h:h2}},pk=J80;var a6=Math.pow(29,3)/Math.pow(3,3),IJ=Math.pow(6,3)/Math.pow(29,3);var IV=($)=>Math.pow($,3)>IJ?Math.pow($,3):(116*$-16)/a6,H80=({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:IV(Q)*u5.X,y:IV(B)*u5.Y,z:IV(X)*u5.Z};if(H!==void 0)z.alpha=H;return z},kJ=H80;var B80=({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=v8({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},a9=B80;var Q80=($)=>a9(kJ($)),cY=Q80;var X80=($)=>{let{r:Z,g:J,b:H,alpha:B}=h8($),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},o9=X80;var kV=($)=>$>IJ?Math.cbrt($):(a6*$+16)/116,z80=({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=kV($/u5.X),Q=kV(Z/u5.Y),X=kV(J/u5.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},yJ=z80;var G80=($)=>{let Z=yJ(o9($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},dY=G80;function U80($,Z){if(!Z||Z[0]!=="lab")return;let J={mode:"lab"},[,H,B,Q,X]=Z;if(H.type===j0.Hue||B.type===j0.Hue||Q.type===j0.Hue)return;if(H.type!==j0.None)J.l=Math.min(Math.max(0,H.value),100);if(B.type!==j0.None)J.a=B.type===j0.Number?B.value:B.value*125/100;if(Q.type!==j0.None)J.b=Q.type===j0.Number?Q.value:Q.value*125/100;if(X.type!==j0.None)J.alpha=Math.min(1,Math.max(0,X.type===j0.Number?X.value:X.value/100));return J}var ck=U80;var Y80={mode:"lab",toMode:{xyz50:kJ,rgb:cY},fromMode:{xyz50:yJ,rgb:dY},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-125,125],b:[-125,125]},parse:[ck],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:k1}}},xJ=Y80;var K80={...xJ,mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:CY,rgb:i6},fromMode:{xyz65:EY,rgb:r6},ranges:{l:[0,100],a:[-125,125],b:[-125,125]}},dk=K80;function F80($,Z){if(!Z||Z[0]!=="lch")return;let J={mode:"lch"},[,H,B,Q,X]=Z;if(H.type!==j0.None){if(H.type===j0.Hue)return;J.l=Math.min(Math.max(0,H.value),100)}if(B.type!==j0.None)J.c=Math.max(0,B.type===j0.Number?B.value:B.value*150/100);if(Q.type!==j0.None){if(Q.type===j0.Percentage)return;J.h=Q.value}if(X.type!==j0.None)J.alpha=Math.min(1,Math.max(0,X.type===j0.Number?X.value:X.value/100));return J}var lk=F80;var W80={mode:"lch",toMode:{lab:D8,rgb:($)=>cY(D8($))},fromMode:{rgb:($)=>A8(dY($)),lab:A8},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[lk],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:x2},c:E0,l:E0,alpha:{use:E0,fixup:k1}},difference:{h:d6},average:{h:h2}},hJ=W80;var q80={...hJ,mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:($)=>D8($,"lab65"),rgb:($)=>i6(D8($,"lab65"))},fromMode:{rgb:($)=>A8(r6($),"lch65"),lab65:($)=>A8($,"lch65")},ranges:{l:[0,100],c:[0,150],h:[0,360]}},ik=q80;var N80=({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=O5(Math.atan2(J,Z)*180/Math.PI);if(H!==void 0)Q.alpha=H;return Q},yV=N80;var A80=({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},xV=A80;var rk=($,Z,J)=>4*$/($+15*Z+3*J),ak=($,Z,J)=>9*Z/($+15*Z+3*J),D80=rk(u5.X,u5.Y,u5.Z),V80=ak(u5.X,u5.Y,u5.Z),L80=($)=>$<=IJ?a6*$:116*Math.cbrt($)-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=L80(Z/u5.Y),Q=rk($,Z,J),X=ak($,Z,J);if(!isFinite(Q)||!isFinite(X))B=Q=X=0;else Q=13*B*(Q-D80),X=13*B*(X-V80);let z={mode:"luv",l:B,u:Q,v:X};if(H!==void 0)z.alpha=H;return z},GQ=M80;var P80=($,Z,J)=>4*$/($+15*Z+3*J),_80=($,Z,J)=>9*Z/($+15*Z+3*J),O80=P80(u5.X,u5.Y,u5.Z),j80=_80(u5.X,u5.Y,u5.Z),T80=({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*$)+O80,Q=J/(13*$)+j80,X=u5.Y*($<=8?$/a6: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},UQ=T80;var C80=($)=>yV(GQ(o9($))),E80=($)=>a9(UQ(xV($))),b80={mode:"lchuv",toMode:{luv:xV,rgb:E80},fromMode:{rgb:C80,luv:yV},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:x2},c:E0,l:E0,alpha:{use:E0,fixup:k1}},difference:{h:d6},average:{h:h2}},ok=b80;var w80={...x8,mode:"lrgb",toMode:{rgb:v8},fromMode:{rgb:h8},parse:["srgb-linear"],serialize:"srgb-linear"},nk=w80;var S80={mode:"luv",toMode:{xyz50:UQ,rgb:($)=>a9(UQ($))},fromMode:{xyz50:GQ,rgb:($)=>GQ(o9($))},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:k1}}},sk=S80;var R80=({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},lY=R80;var I80=($)=>{let Z=lY(h8($));if($.r===$.b&&$.b===$.g)Z.a=Z.b=0;return Z},o6=I80;var k80=({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},n9=k80;var y80=($)=>v8(n9($)),n6=y80;function YQ($){return 0.5*(1.170873786407767*$-0.206+Math.sqrt((1.170873786407767*$-0.206)*(1.170873786407767*$-0.206)+0.14050485436893204*$))}function b$($){return($*$+0.206*$)/(1.170873786407767*($+0.03))}function x80($,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,O=3*K*q*q,M=3*F*N*N,_=3*W*D*D,w=6*K*K*q,C=6*F*F*N,b=6*W*W*D,T=z*A+G*V+U*L,I=z*O+G*M+U*_,S=z*w+G*C+U*b;Y=Y-T*I/(I*I-0.5*T*S)}return Y}function hV($,Z){let J=x80($,Z),H=n9({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 h80($,Z,J,H,B,Q=null){if(!Q)Q=hV($,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,O=A*A*A,M=V*V*V,_=L*L*L,w=3*F*A*A,C=3*W*V*V,b=3*q*L*L,T=6*F*F*A,I=6*W*W*V,S=6*q*q*L,R=4.0767416621*O-3.3077115913*M+0.2309699292*_-1,j=4.0767416621*w-3.3077115913*C+0.2309699292*b,y=4.0767416621*T-3.3077115913*I+0.2309699292*S,k=j/(j*j-0.5*R*y),x=-R*k,v=-1.2684380046*O+2.6097574011*M-0.3413193965*_-1,f=-1.2684380046*w+2.6097574011*C-0.3413193965*b,E=-1.2684380046*T+2.6097574011*I-0.3413193965*S,l=f/(f*f-0.5*v*E),r=-v*l,h=-0.0041960863*O-0.7034186147*M+1.707614701*_-1,d=-0.0041960863*w-0.7034186147*C+1.707614701*b,o=-0.0041960863*T-0.7034186147*I+1.707614701*S,p=d/(d*d-0.5*h*o),i=-h*p;x=k>=0?x:1e6,r=l>=0?r:1e6,i=p>=0?i:1e6,X+=Math.min(x,Math.min(r,i))}}}return X}function KQ($,Z,J=null){if(!J)J=hV($,Z);let H=J[0],B=J[1];return[B/H,B/(1-H)]}function iY($,Z,J){let H=hV(Z,J),B=h80(Z,J,$,1,$,H),Q=KQ(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 rY($){let Z=$.l!==void 0?$.l:0,J=$.a!==void 0?$.a:0,H=$.b!==void 0?$.b:0,B={mode:"okhsl",l:YQ(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]=iY(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=O5(Math.atan2(H,J)*180/Math.PI);return B}function aY($){let Z=$.h!==void 0?$.h:0,J=$.s!==void 0?$.s:0,H=$.l!==void 0?$.l:0,B={mode:"oklab",l:b$(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]=iY(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 v80={...SY,mode:"okhsl",channels:["h","s","l","alpha"],parse:["--okhsl"],serialize:"--okhsl",fromMode:{oklab:rY,rgb:($)=>rY(o6($))},toMode:{oklab:aY,rgb:($)=>n6(aY($))}},tk=v80;function oY($){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]=KQ(Q,X),U=0.5,Y=1-U/z,K=G/(B+Z*G),F=K*Z,W=K*B,q=b$(F),N=W*q/F,D=n9({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*YQ(Z)/Z,Z=YQ(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=O5(Math.atan2(H,J)*180/Math.PI);if($.alpha!==void 0)V.alpha=$.alpha;return V}function nY($){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]=KQ(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=b$(K),q=F*W/K,N=n9({l:W,a:Q*q,b:X*q}),D=Math.cbrt(1/Math.max(N.r,N.g,N.b,0)),A=b$(B*K),V=F*A/K;return Z.l=A*D,Z.a=V*Q*D,Z.b=V*X*D,Z}var f80={...RY,mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:oY,rgb:($)=>oY(o6($))},toMode:{oklab:nY,rgb:($)=>n6(nY($))}},ek=f80;function g80($,Z){if(!Z||Z[0]!=="oklab")return;let J={mode:"oklab"},[,H,B,Q,X]=Z;if(H.type===j0.Hue||B.type===j0.Hue||Q.type===j0.Hue)return;if(H.type!==j0.None)J.l=Math.min(Math.max(0,H.type===j0.Number?H.value:H.value/100),1);if(B.type!==j0.None)J.a=B.type===j0.Number?B.value:B.value*0.4/100;if(Q.type!==j0.None)J.b=Q.type===j0.Number?Q.value:Q.value*0.4/100;if(X.type!==j0.None)J.alpha=Math.min(1,Math.max(0,X.type===j0.Number?X.value:X.value/100));return J}var $y=g80;var m80={...xJ,mode:"oklab",toMode:{lrgb:n9,rgb:n6},fromMode:{lrgb:lY,rgb:o6},ranges:{l:[0,1],a:[-0.4,0.4],b:[-0.4,0.4]},parse:[$y],serialize:($)=>`oklab(${$.l!==void 0?$.l:"none"} ${$.a!==void 0?$.a:"none"} ${$.b!==void 0?$.b:"none"}${$.alpha<1?` / ${$.alpha}`:""})`},Zy=m80;function u80($,Z){if(!Z||Z[0]!=="oklch")return;let J={mode:"oklch"},[,H,B,Q,X]=Z;if(H.type!==j0.None){if(H.type===j0.Hue)return;J.l=Math.min(Math.max(0,H.type===j0.Number?H.value:H.value/100),1)}if(B.type!==j0.None)J.c=Math.max(0,B.type===j0.Number?B.value:B.value*0.4/100);if(Q.type!==j0.None){if(Q.type===j0.Percentage)return;J.h=Q.value}if(X.type!==j0.None)J.alpha=Math.min(1,Math.max(0,X.type===j0.Number?X.value:X.value/100));return J}var Jy=u80;var p80={...hJ,mode:"oklch",toMode:{oklab:($)=>D8($,"oklab"),rgb:($)=>n6(D8($,"oklab"))},fromMode:{rgb:($)=>A8(o6($),"oklch"),oklab:($)=>A8($,"oklch")},parse:[Jy],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]}},Hy=p80;var c80=($)=>{let{r:Z,g:J,b:H,alpha:B}=h8($),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},vV=c80;var d80=({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=v8({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},fV=d80;var l80={...x8,mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:($)=>fV(n4($)),xyz65:fV},toMode:{rgb:($)=>s4(vV($)),xyz65:vV}},By=l80;var gV=($)=>{let Z=Math.abs($);if(Z>=0.001953125)return Math.sign($)*Math.pow(Z,0.5555555555555556);return 16*$},i80=({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:gV($*1.3457868816471585-Z*0.2555720873797946-0.0511018649755453*J),g:gV($*-0.5446307051249019+Z*1.5082477428451466+0.0205274474364214*J),b:gV($*0+Z*0+1.2119675456389452*J)};if(H!==void 0)B.alpha=H;return B},mV=i80;var uV=($=0)=>{let Z=Math.abs($);if(Z>=0.03125)return Math.sign($)*Math.pow(Z,1.8);return $/16},r80=($)=>{let Z=uV($.r),J=uV($.g),H=uV($.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},pV=r80;var a80={...x8,mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:mV,rgb:($)=>mV(o9($))},toMode:{xyz50:pV,rgb:($)=>a9(pV($))}},Qy=a80;var cV=($)=>{let Z=Math.abs($);if(Z>0.018053968510807)return(Math.sign($)||1)*(1.09929682680944*Math.pow(Z,0.45)-0.09929682680944008);return 4.5*$},o80=({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:cV($*1.7166511879712683-Z*0.3556707837763925-0.2533662813736599*J),g:cV($*-0.6666843518324893+Z*1.6164812366349395+0.0157685458139111*J),b:cV($*0.0176398574453108-Z*0.0427706132578085+0.9421031212354739*J)};if(H!==void 0)B.alpha=H;return B},dV=o80;var lV=($=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)},n80=($)=>{let Z=lV($.r),J=lV($.g),H=lV($.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=n80;var s80={...x8,mode:"rec2020",fromMode:{xyz65:dV,rgb:($)=>dV(n4($))},toMode:{xyz65:iV,rgb:($)=>s4(iV($))},parse:["rec2020"],serialize:"rec2020"},Xy=s80;var s6=0.0037930732552754493,sY=Math.cbrt(0.0037930732552754493);var rV=($)=>Math.cbrt($)-sY,t80=($)=>{let{r:Z,g:J,b:H,alpha:B}=h8($),Q=rV(0.3*Z+0.622*J+0.078*H+s6),X=rV(0.23*Z+0.692*J+0.078*H+s6),z=rV(0.2434226892454782*Z+0.2047674442449682*J+0.5518098665095535*H+s6),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},zy=t80;var aV=($)=>Math.pow($+sY,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=aV($+Z)-s6,Q=aV(Z-$)-s6,X=aV(J+Z)-s6,z=v8({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},Gy=e80;var $90={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:Gy},fromMode:{rgb:zy},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:k1}}},Uy=$90;var Z90={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:a9,lab:yJ},fromMode:{rgb:o9,lab:kJ},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:k1}}},Yy=Z90;var J90=($)=>{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},Ky=J90;var H90=($)=>{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},Fy=H90;var B90={mode:"xyz65",toMode:{rgb:s4,xyz50:Ky},fromMode:{rgb:n4,xyz50:Fy},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:k1}}},Wy=B90;var Q90=({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=Q90;var X90=({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},Ny=X90;var z90={mode:"yiq",toMode:{rgb:Ny},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:k1}}},Ay=z90;function oV($){let Z=MY("lrgb")($);return 0.2126*Z.r+0.7152*Z.g+0.0722*Z.b}var Bo0=U5(Lk),Qo0=U5(bk),Xo0=U5(Rk),zo0=U5(Ik),Go0=U5(kk),Uo0=U5(SY),Yo0=U5(RY),Ko0=U5(fk),Fo0=U5(gk),Wo0=U5(uk),qo0=U5(pk),No0=U5(xJ),Ao0=U5(dk),Do0=U5(hJ),Vo0=U5(ik),Lo0=U5(ok),Mo0=U5(nk),Po0=U5(sk),_o0=U5(tk),Oo0=U5(ek),jo0=U5(Zy),To0=U5(Hy),Co0=U5(By),Eo0=U5(Qy),bo0=U5(Xy),wo0=U5(x8),So0=U5(Uy),Ro0=U5(Yy),Io0=U5(Wy),ko0=U5(Ay);var t6={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"}},FQ={squishy:{label:"Squishy",radius:"0.875rem"},soft:{label:"Soft",radius:"0.625rem"},subtle:{label:"Subtle",radius:"0.375rem"},square:{label:"Square",radius:"0"}},WQ={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}}},nV="oklch(0.205 0 0)";function Dy($){return oV($)>0.3?"oklch(0 0 0)":"oklch(1 0 0)"}var Vy={workspace:{primary:($)=>$,primaryForeground:($)=>Dy($),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:($)=>Dy($),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%)"}},sV=Object.keys(Vy.workspace);function tV($,Z="workspace"){let J={},H=Vy[Z];for(let B of sV)J[B]=H[B]($);return J}var eY={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)"}},s9={font:"sans",color:"default",radius:"soft",agent:"boxy"};function tY($,Z,J){return typeof $==="string"&&Object.hasOwn(Z,$)?$:J}function U9($){return{font:tY($?.font,t6,s9.font),color:tY($?.color,eY,s9.color),radius:tY($?.radius,FQ,s9.radius),agent:tY($?.agent,WQ,s9.agent)}}function $K($,Z="workspace"){let J=U9($),B=eY[J.color].primary??(Z==="widget"?nV:void 0);return B?tV(B,Z):void 0}var qQ=P(c(),1),t9={"claude-code":UY,openclaw:FY,codex:KY,hermes:YY};function G90($,Z,J){switch($?.type){case"emoji":return qQ.jsx("span",{"aria-hidden":"true",className:B0("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 qQ.jsx("img",{src:$.value,alt:"",className:"size-full"});case"glyph":{let H=DY($.value);if(H)return Ly.createElement(H,{"aria-hidden":!0,stroke:1.75,className:Z?"size-[70%]":"size-[95%] text-foreground"})}default:return qQ.jsx("img",{src:J,alt:"",className:"size-[95%]"})}}function e6({className:$,icon:Z,workspaceType:J,workspaceTheme:H}){let B=Z?.type!=="upload"&&Z?.background==="theme",Q=B?$K(H)??tV(nV):void 0,X=t9[J??"claude-code"];return qQ.jsx("span",{className:B0("@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:G90(Z,B,X)})}var My=P(m(),1);var Py=P(c(),1);function ZK({className:$,onBlur:Z,onFocus:J,onKeyDown:H,onValueChange:B,onValueCommit:Q,selectOnFocus:X,...z}){let G=My.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 Py.jsx(tB,{"data-slot":"inline-input",className:B0("-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})}var NQ=P(c(),1);function JK({name:$="Workspace",onNameChange:Z,onNameCommit:J,renderIcon:H,...B}){let Q=NQ.jsx(e6,{...B,className:"size-10 rounded-lg"});return NQ.jsxs("div",{className:"flex max-w-full min-w-0 flex-1 items-center gap-4",children:[H?H(Q):Q,NQ.jsx(ZK,{"aria-label":"Workspace name",value:$,onValueChange:Z,onValueCommit:J,readOnly:!Z,tabIndex:Z?void 0:-1,className:B0("min-w-0 truncate text-3xl font-semibold md:text-3xl",!Z&&"pointer-events-none")})]})}var vJ=P(c(),1),_y=["Welcome to","This is","Make yourself at home in","A fresh start in","Good to see you in"],HK;function Oy($){HK=$}function jy($){let[Z,J]=$7.useState(()=>HK===$);return $7.useEffect(()=>{if(HK===$)HK=void 0;if(!Z)return;let H=setTimeout(()=>J(!1),3000);return()=>clearTimeout(H)},[$,Z]),Z}function Ty({name:$="Workspace",icon:Z,...J}){let[H]=$7.useState(()=>_y[Math.floor(Math.random()*_y.length)]),[B]=$7.useState(()=>{let z=[...eB];return Array.from({length:4},()=>z.splice(Math.floor(Math.random()*z.length),1)[0])}),[Q,X]=$7.useState(()=>typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches?4:0);return $7.useEffect(()=>{if(window.matchMedia?.("(prefers-reduced-motion: reduce)").matches)return;let z=[500,1000,1500,2000].map((G,U)=>setTimeout(()=>X(U+1),G));return()=>z.forEach(clearTimeout)},[]),vJ.jsx("div",{"aria-label":"Workspace welcome",className:"flex flex-1 items-center justify-center p-6 text-center",children:vJ.jsxs("div",{className:"flex min-w-0 flex-col items-center gap-1",children:[vJ.jsx("p",{className:"text-sm text-muted-foreground",children:H}),vJ.jsx(JK,{...J,name:$,icon:Q<4?{type:"glyph",value:B[Q]}:Z})]})})}var Iy=P(m(),1);var Cy=P(c(),1);function w$({className:$,...Z}){return Cy.jsx("div",{"data-slot":"skeleton",className:r0("animate-pulse rounded-lg bg-accent",$),...Z})}var eV=P(c(),1),S$={"claude-code":"Claude",openclaw:"OpenClaw",codex:"ChatGPT",hermes:"Hermes"},Ey={"claude-code":"Anthropic",codex:"OpenAI",openclaw:"Open-source",hermes:"Nous Research"};function by({types:$}){let Z=$.map((J)=>S$[J]).join(", ");return eV.jsx("span",{role:"img","aria-label":Z,className:"inline-flex shrink-0 items-center -space-x-0.5",children:$.map((J)=>eV.jsx("img",{src:t9[J],alt:"",className:"size-4 shrink-0 rounded-full bg-muted ring-2 ring-muted"},J))})}function R$($){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 wy={"claude-code":{reason:"Run in terminal to install Claude:",command:"curl -fsSL https://claude.ai/install.sh | sh"},codex:{reason:"Run in terminal to install ChatGPT:",command:"curl -fsSL https://chatgpt.com/codex/install.sh | sh"},openclaw:{reason:"Run in terminal to connect OpenClaw:",command:"moi openclaw init"},hermes:{reason:"Run in terminal to connect Hermes:",command:"moi hermes init"}};var Sy={"claude-code":{importOnly:!1},codex:{importOnly:!1},openclaw:{importOnly:!0},hermes:{importOnly:!0}};function BK($,Z=[]){if(!$)return[];return jJ.filter((J)=>$[J]||!Sy[J].importOnly).map((J)=>{let H=Sy[J],B=wy[J],Q=!$[J]||H.importOnly&&!Z.includes(J);return{type:J,description:Ey[J],disabled:Q,disabledReason:Q?B.reason:void 0,disabledCommand:Q?B.command:void 0}})}function Ry($,Z){let J=$.find((H)=>H.type===Z);if(J&&!J.disabled)return J.type;return $.find((H)=>!H.disabled)?.type}var l1=P(c(),1),U90="Choose which agent Moi will use to build your workspace";function XK({title:$,selectedType:Z,options:J,isLoading:H=!1,isPending:B,errorMessage:Q,emptyMessage:X,secondaryAction:z,primaryLabel:G,pendingLabel:U,onTypeChange:Y,onSubmit:K}){let F=b1((D)=>D.hasSentMessageFromMoi),W=Ry(J,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 Iy.useEffect(()=>{if(!B&&W&&q)Y(W)},[B,Y,W,q]),l1.jsxs("div",{className:"flex min-w-[min(22rem,calc(100vw-5rem))] flex-col gap-5",children:[l1.jsxs("div",{className:"flex w-0 min-w-full flex-col gap-0.5 pr-8",children:[l1.jsx(v6,{children:$}),l1.jsx(_J,{children:U90})]}),l1.jsxs("div",{className:"flex flex-col gap-4",children:[H?l1.jsxs("div",{className:"flex flex-wrap justify-center gap-2",role:"status","aria-label":"Checking installed agents",children:[l1.jsx(w$,{className:"h-32 min-w-32 flex-1"}),l1.jsx(w$,{className:"h-32 min-w-32 flex-1"})]}):l1.jsx(Y90,{disabled:B,options:J,selectedType:q?void 0:Z,onTypeChange:Y}),!F&&N&&l1.jsx("p",{className:"w-0 min-w-full text-sm text-muted-foreground",children:N})]}),Q&&l1.jsx("p",{role:"alert",className:"w-0 min-w-full text-xs text-destructive",children:Q}),X&&!W&&!B&&!Q&&l1.jsx("p",{className:"w-0 min-w-full text-sm text-muted-foreground",children:X}),l1.jsxs("div",{className:"flex items-center justify-end gap-2",children:[z,l1.jsx(P0,{onClick:K,disabled:B||q,children:B&&U?U:G})]})]})}function Y90({disabled:$,options:Z,selectedType:J,onTypeChange:H}){return l1.jsx("fieldset",{disabled:$,"aria-label":"Agent",className:"flex min-w-0 flex-wrap justify-center gap-2",children:Z.map((B)=>l1.jsx(K90,{option:B,selected:J===B.type,onSelect:H},B.type))})}function K90({option:$,selected:Z,onSelect:J}){let H=Boolean($.disabledReason),B=l1.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:B0("relative flex h-32 min-w-32 flex-1 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:[l1.jsxs("span",{className:"relative inline-flex",children:[l1.jsx(F90,{type:$.type}),Z&&l1.jsx(QK,{size:16,stroke:1.75,"aria-hidden":"true",className:"absolute -top-1.5 -right-1.5"})]}),l1.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[l1.jsx("span",{className:"text-sm font-medium text-foreground",children:S$[$.type]}),l1.jsx("span",{className:"text-xs leading-4 text-muted-foreground",children:$.description})]})]});if(!H)return B;return l1.jsxs(o1,{children:[l1.jsx(n1,{render:B}),l1.jsx(s1,{className:"max-w-[calc(100vw-2rem)] leading-5 sm:max-w-96",children:l1.jsxs("span",{className:"text-center",children:[$.disabledReason,$.disabledCommand&&l1.jsxs(l1.Fragment,{children:[l1.jsx("br",{}),l1.jsx("code",{className:"rounded-xs bg-accent px-1 py-0.5 font-mono wrap-anywhere",children:$.disabledCommand})]})]})})]})}function F90({type:$}){return l1.jsx("img",{src:t9[$],alt:"",className:"size-8 shrink-0"})}var ky=P(c(),1);function zK({children:$,showCloseButton:Z=!0}){return ky.jsx(PJ,{showCloseButton:Z,className:"block max-h-[calc(100dvh-2rem)] w-max max-w-[calc(100vw-2rem)] overflow-y-auto p-6 sm:max-w-[calc(100vw-2rem)]",children:$})}var k5=P(c(),1),yy=jJ[0];function DQ({trigger:$}){let[,Z]=m4(),J=o4(),H=xU(),B=QR(),[Q,X]=AQ.useState(!1),[z,G]=AQ.useState("name"),[U,Y]=AQ.useState(yy),[K,F]=AQ.useState(""),W=K.trim(),q=W?rR(W):null,N=B.isPending,D=H.isPending||H.isFetching,A=H.isError?void 0:H.data?.installed,V=BK(A),L=V.some((T)=>T.type===U&&!T.disabled),O=!D&&!A?"Could not check installed agents.":void 0,M=!D&&!O&&L;if(J.demo)return k5.jsx(EJ,{trigger:$});function _(T){Oy(T),X(!1),Z(`/workspace/${T}`)}function w(){G("name"),Y(yy),F(""),B.reset()}function C(){if(!W||q)return;B.reset(),G("agent")}function b(){if(!W||q||N||!M)return;B.reset(),B.mutate({name:W,type:U},{onSuccess:(T)=>_(T.id)})}return k5.jsxs(h6,{open:Q,onOpenChange:(T)=>{if(!T&&N)return;if(X(T),T)H.refetch({cancelRefetch:!1})},onOpenChangeComplete:(T)=>{if(!T)w()},children:[k5.jsx(f3,{render:$}),k5.jsx(zK,{showCloseButton:!N,children:z==="name"?k5.jsx(W90,{name:K,validationError:q,onNameChange:F,onSubmit:C}):k5.jsx(XK,{title:"Create new workspace",selectedType:U,options:V,isLoading:D&&!A,errorMessage:O??B.error?.message,emptyMessage:"Install at least one agent to create a new workspace",isPending:N||D||Boolean(O),secondaryAction:k5.jsx(P0,{variant:"secondary",disabled:N,onClick:()=>G("name"),children:"Back"}),primaryLabel:"Create workspace",pendingLabel:N?"Creating…":void 0,onTypeChange:Y,onSubmit:b})})]})}function W90({name:$,validationError:Z,onNameChange:J,onSubmit:H}){function B(Q){Q.preventDefault(),H()}return k5.jsxs("form",{className:"flex min-w-[min(22rem,calc(100vw-5rem))] flex-col gap-5",onSubmit:B,children:[k5.jsxs("div",{className:"flex flex-col gap-0.5 pr-8",children:[k5.jsx(v6,{children:"Create new workspace"}),k5.jsx(_J,{children:"Give it a short and recognizable name"})]}),k5.jsxs("div",{className:"flex flex-col gap-2",children:[k5.jsx("label",{htmlFor:"workspace-name",className:"sr-only",children:"Workspace name"}),k5.jsx(T$,{id:"workspace-name",value:$,onChange:(Q)=>J(Q.target.value),placeholder:"Workspace name",autoFocus:!0,"aria-invalid":Boolean(Z),"aria-describedby":Z?"workspace-name-error":void 0,autoComplete:"off",spellCheck:!1}),Z&&k5.jsx("p",{id:"workspace-name-error",role:"alert",className:"text-xs text-destructive",children:Z})]}),k5.jsxs("div",{className:"flex items-center justify-end gap-2",children:[k5.jsx(q90,{}),k5.jsx(P0,{type:"submit",disabled:!$.trim()||Boolean(Z),children:"Next"})]})]})}function q90(){return k5.jsxs(o1,{children:[k5.jsx(n1,{render:k5.jsx(P0,{variant:"secondary","aria-disabled":!0,onClick:(Z)=>Z.preventDefault(),className:"cursor-not-allowed bg-accent text-muted-foreground hover:bg-accent",children:"Use existing folder"})}),k5.jsx(s1,{className:"max-w-64",children:k5.jsxs("span",{className:"text-center",children:["Not supported yet — run"," ",k5.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 J7=P(m(),1);var V0=P(m(),1),h$=P(K8(),1);var q2=P(m(),1);var VQ=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function I$($){let Z=Object.prototype.toString.call($);return Z==="[object Window]"||Z==="[object global]"}function GK($){return"nodeType"in $}function W4($){var Z,J;if(!$)return window;if(I$($))return $;if(!GK($))return window;return(Z=(J=$.ownerDocument)==null?void 0:J.defaultView)!=null?Z:window}function UK($){let{Document:Z}=W4($);return $ instanceof Z}function gJ($){if(I$($))return!1;return $ instanceof W4($).HTMLElement}function ZL($){return $ instanceof W4($).SVGElement}function k$($){if(!$)return document;if(I$($))return $.document;if(!GK($))return document;if(UK($))return $;if(gJ($)||ZL($))return $.ownerDocument;return document}var e9=VQ?q2.useLayoutEffect:q2.useEffect;function LQ($){let Z=q2.useRef($);return e9(()=>{Z.current=$}),q2.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 hy(){let $=q2.useRef(null),Z=q2.useCallback((H,B)=>{$.current=setInterval(H,B)},[]),J=q2.useCallback(()=>{if($.current!==null)clearInterval($.current),$.current=null},[]);return[Z,J]}function mJ($,Z){if(Z===void 0)Z=[$];let J=q2.useRef($);return e9(()=>{if(J.current!==$)J.current=$},Z),J}function uJ($,Z){let J=q2.useRef();return q2.useMemo(()=>{let H=$(J.current);return J.current=H,H},[...Z])}function MQ($){let Z=LQ($),J=q2.useRef(null),H=q2.useCallback((B)=>{if(B!==J.current)Z==null||Z(B,J.current);J.current=B},[]);return[J,H]}function PQ($){let Z=q2.useRef();return q2.useEffect(()=>{Z.current=$},[$]),Z.current}var $L={};function _Q($,Z){return q2.useMemo(()=>{if(Z)return Z;let J=$L[$]==null?0:$L[$]+1;return $L[$]=J,$+"-"+J},[$,Z])}function vy($){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 y$=vy(1),OQ=vy(-1);function N90($){return"clientX"in $&&"clientY"in $}function YK($){if(!$)return!1;let{KeyboardEvent:Z}=W4($.target);return Z&&$ instanceof Z}function A90($){if(!$)return!1;let{TouchEvent:Z}=W4($.target);return Z&&$ instanceof Z}function jQ($){if(A90($)){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(N90($))return{x:$.clientX,y:$.clientY};return null}var fJ=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[fJ.Translate.toString($),fJ.Scale.toString($)].join(" ")}},Transition:{toString($){let{property:Z,duration:J,easing:H}=$;return Z+" "+J+"ms "+H}}}),xy="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function fy($){if($.matches(xy))return $;return $.querySelector(xy)}var x$=P(m(),1),D90={display:"none"};function gy($){let{id:Z,value:J}=$;return x$.default.createElement("div",{id:Z,style:D90},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 x$.default.createElement("div",{id:Z,style:B,role:"status","aria-live":H,"aria-atomic":!0},J)}function uy(){let[$,Z]=x$.useState("");return{announce:x$.useCallback((H)=>{if(H!=null)Z(H)},[]),announcement:$}}var $x=V0.createContext(null);function V90($){let Z=V0.useContext($x);V0.useEffect(()=>{if(!Z)throw Error("useDndMonitor must be used within a children of <DndContext>");return Z($)},[$,Z])}function L90(){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 M90={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
|
+
`},P90={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 _90($){let{announcements:Z=P90,container:J,hiddenTextDescribedById:H,screenReaderInstructions:B=M90}=$,{announce:Q,announcement:X}=uy(),z=_Q("DndLiveRegion"),[G,U]=V0.useState(!1);if(V0.useEffect(()=>{U(!0)},[]),V90(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(gy,{id:H,value:B.draggable}),V0.default.createElement(my,{id:z,announcement:X}));return J?h$.createPortal(Y,J):Y}var M2;(function($){$.DragStart="dragStart",$.DragMove="dragMove",$.DragEnd="dragEnd",$.DragCancel="dragCancel",$.DragOver="dragOver",$.RegisterDroppable="registerDroppable",$.SetDroppableDisabled="setDroppableDisabled",$.UnregisterDroppable="unregisterDroppable"})(M2||(M2={}));function FK(){}function GL($,Z){return V0.useMemo(()=>({sensor:$,options:Z!=null?Z:{}}),[$,Z])}function Zx(){for(var $=arguments.length,Z=Array($),J=0;J<$;J++)Z[J]=arguments[J];return V0.useMemo(()=>[...Z].filter((H)=>H!=null),[...Z])}var Y9=Object.freeze({x:0,y:0});function O90($,Z){return Math.sqrt(Math.pow($.x-Z.x,2)+Math.pow($.y-Z.y,2))}function j90($,Z){let J=jQ($);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 T90($,Z){let{data:{value:J}}=$,{data:{value:H}}=Z;return J-H}function C90($,Z){let{data:{value:J}}=$,{data:{value:H}}=Z;return H-J}function E90($,Z){if(!$||$.length===0)return null;let[J]=$;return Z?J[Z]:J}function py($,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 Jx=($)=>{let{collisionRect:Z,droppableRects:J,droppableContainers:H}=$,B=py(Z,Z.left,Z.top),Q=[];for(let X of H){let{id:z}=X,G=J.get(z);if(G){let U=O90(py(G),B);Q.push({id:z,data:{droppableContainer:X,value:U}})}}return Q.sort(T90)};function b90($,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 w90=($)=>{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=b90(z,Z);if(G>0)B.push({id:X,data:{droppableContainer:Q,value:G}})}}return B.sort(C90)};function S90($,Z,J){return{...$,scaleX:Z&&J?Z.width/J.width:1,scaleY:Z&&J?Z.height/J.height:1}}function Hx($,Z){return $&&Z?{x:$.left-Z.left,y:$.top-Z.top}:Y9}function R90($){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 I90=R90(1);function Bx($){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 k90($,Z,J){let H=Bx(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 y90={ignoreTransform:!1};function EQ($,Z){if(Z===void 0)Z=y90;let J=$.getBoundingClientRect();if(Z.ignoreTransform){let{transform:U,transformOrigin:Y}=W4($).getComputedStyle($);if(U)J=k90(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 cy($){return EQ($,{ignoreTransform:!0})}function x90($){let{innerWidth:Z,innerHeight:J}=$;return{top:0,left:0,right:Z,bottom:J,width:Z,height:J}}function h90($,Z){if(Z===void 0)Z=W4($).getComputedStyle($);return Z.position==="fixed"}function v90($,Z){if(Z===void 0)Z=W4($).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 UL($,Z){let J=[];function H(B){if(Z!=null&&J.length>=Z)return J;if(!B)return J;if(UK(B)&&B.scrollingElement!=null&&!J.includes(B.scrollingElement))return J.push(B.scrollingElement),J;if(!gJ(B)||ZL(B))return J;if(J.includes(B))return J;let Q=W4($).getComputedStyle(B);if(B!==$){if(v90(B,Q))J.push(B)}if(h90(B,Q))return J;return H(B.parentNode)}if(!$)return J;return H($)}function Qx($){let[Z]=UL($,1);return Z!=null?Z:null}function JL($){if(!VQ||!$)return null;if(I$($))return $;if(!GK($))return null;if(UK($)||$===k$($).scrollingElement)return window;if(gJ($))return $;return null}function Xx($){if(I$($))return $.scrollX;return $.scrollLeft}function zx($){if(I$($))return $.scrollY;return $.scrollTop}function QL($){return{x:Xx($),y:zx($)}}var v2;(function($){$[$.Forward=1]="Forward",$[$.Backward=-1]="Backward"})(v2||(v2={}));function Gx($){if(!VQ||!$)return!1;return $===document.scrollingElement}function Ux($){let Z={x:0,y:0},J=Gx($)?{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 f90={x:0.2,y:0.2};function g90($,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=f90;let{isTop:U,isBottom:Y,isLeft:K,isRight:F}=Ux($),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=v2.Backward,q.y=H*Math.abs((Z.top+N.height-Q)/N.height);else if(!Y&&G>=Z.bottom-N.height)W.y=v2.Forward,q.y=H*Math.abs((Z.bottom-N.height-G)/N.height);if(!F&&z>=Z.right-N.width)W.x=v2.Forward,q.x=H*Math.abs((Z.right-N.width-z)/N.width);else if(!K&&X<=Z.left+N.width)W.x=v2.Backward,q.x=H*Math.abs((Z.left+N.width-X)/N.width);return{direction:W,speed:q}}function m90($){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 Yx($){return $.reduce((Z,J)=>{return y$(Z,QL(J))},Y9)}function u90($){return $.reduce((Z,J)=>{return Z+Xx(J)},0)}function p90($){return $.reduce((Z,J)=>{return Z+zx(J)},0)}function Kx($,Z){if(Z===void 0)Z=EQ;if(!$)return;let{top:J,left:H,bottom:B,right:Q}=Z($);if(!Qx($))return;if(B<=0||Q<=0||J>=window.innerHeight||H>=window.innerWidth)$.scrollIntoView({block:"center",inline:"center"})}var c90=[["x",["left","right"],u90],["y",["top","bottom"],p90]];class qK{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=UL(Z),H=Yx(J);this.rect={...$},this.width=$.width,this.height=$.height;for(let[B,Q,X]of c90)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 pJ{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 d90($){let{EventTarget:Z}=W4($);return $ instanceof Z?$:k$($)}function HL($,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 f8;(function($){$.Click="click",$.DragStart="dragstart",$.Keydown="keydown",$.ContextMenu="contextmenu",$.Resize="resize",$.SelectionChange="selectionchange",$.VisibilityChange="visibilitychange"})(f8||(f8={}));function dy($){$.preventDefault()}function l90($){$.stopPropagation()}var B5;(function($){$.Space="Space",$.Down="ArrowDown",$.Right="ArrowRight",$.Left="ArrowLeft",$.Up="ArrowUp",$.Esc="Escape",$.Enter="Enter",$.Tab="Tab"})(B5||(B5={}));var Fx={start:[B5.Space,B5.Enter],cancel:[B5.Esc],end:[B5.Space,B5.Enter,B5.Tab]},i90=($,Z)=>{let{currentCoordinates:J}=Z;switch($.code){case B5.Right:return{...J,x:J.x+25};case B5.Left:return{...J,x:J.x-25};case B5.Down:return{...J,y:J.y+25};case B5.Up:return{...J,y:J.y-25}}return};class bQ{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 pJ(k$(Z)),this.windowListeners=new pJ(W4(Z)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(f8.Resize,this.handleCancel),this.windowListeners.add(f8.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(f8.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:$,onStart:Z}=this.props,J=$.node.current;if(J)Kx(J);Z(Y9)}handleKeyDown($){if(YK($)){let{active:Z,context:J,options:H}=this.props,{keyboardCodes:B=Fx,coordinateGetter:Q=i90,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}:Y9;if(!this.referenceCoordinates)this.referenceCoordinates=U;let Y=Q($,{active:Z,context:J.current,currentCoordinates:U});if(Y){let K=OQ(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:O,minScroll:M}=Ux(q),_=m90(q),w={x:Math.min(N===B5.Right?_.right-_.width/2:_.right,Math.max(N===B5.Right?_.left:_.left+_.width/2,Y.x)),y:Math.min(N===B5.Down?_.bottom-_.height/2:_.bottom,Math.max(N===B5.Down?_.top:_.top+_.height/2,Y.y))},C=N===B5.Right&&!A||N===B5.Left&&!V,b=N===B5.Down&&!L||N===B5.Up&&!D;if(C&&w.x!==Y.x){let T=q.scrollLeft+K.x,I=N===B5.Right&&T<=O.x||N===B5.Left&&T>=M.x;if(I&&!K.y){q.scrollTo({left:T,behavior:X});return}if(I)F.x=q.scrollLeft-T;else F.x=N===B5.Right?q.scrollLeft-O.x:q.scrollLeft-M.x;if(F.x)q.scrollBy({left:-F.x,behavior:X});break}else if(b&&w.y!==Y.y){let T=q.scrollTop+K.y,I=N===B5.Down&&T<=O.y||N===B5.Up&&T>=M.y;if(I&&!K.x){q.scrollTo({top:T,behavior:X});return}if(I)F.y=q.scrollTop-T;else F.y=N===B5.Down?q.scrollTop-O.y:q.scrollTop-M.y;if(F.y)q.scrollBy({top:-F.y,behavior:X});break}}this.handleMove($,y$(OQ(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()}}bQ.activators=[{eventName:"onKeyDown",handler:($,Z,J)=>{let{keyboardCodes:H=Fx,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 ly($){return Boolean($&&"distance"in $)}function iy($){return Boolean($&&"delay"in $)}class NK{constructor($,Z,J){var H;if(J===void 0)J=d90($.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=k$(Q),this.documentListeners=new pJ(this.document),this.listeners=new pJ(J),this.windowListeners=new pJ(W4(Q)),this.initialCoordinates=(H=jQ(B))!=null?H:Y9,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(f8.Resize,this.handleCancel),this.windowListeners.add(f8.DragStart,dy),this.windowListeners.add(f8.VisibilityChange,this.handleCancel),this.windowListeners.add(f8.ContextMenu,dy),this.documentListeners.add(f8.Keydown,this.handleKeydown),Z){if(J!=null&&J({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(iy(Z)){this.timeoutId=setTimeout(this.handleStart,Z.delay),this.handlePending(Z);return}if(ly(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(f8.Click,l90,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(f8.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=jQ($))!=null?Z:Y9,G=OQ(H,z);if(!J&&X){if(ly(X)){if(X.tolerance!=null&&HL(G,X.tolerance))return this.handleCancel();if(HL(G,X.distance))return this.handleStart()}if(iy(X)){if(HL(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===B5.Esc)this.handleCancel()}removeTextSelection(){var $;($=this.document.getSelection())==null||$.removeAllRanges()}}var r90={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class wQ extends NK{constructor($){let{event:Z}=$,J=k$(Z.target);super($,r90,J)}}wQ.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 a90={move:{name:"mousemove"},end:{name:"mouseup"}},XL;(function($){$[$.RightClick=2]="RightClick"})(XL||(XL={}));class Wx extends NK{constructor($){super($,a90,k$($.event.target))}}Wx.activators=[{eventName:"onMouseDown",handler:($,Z)=>{let{nativeEvent:J}=$,{onActivation:H}=Z;if(J.button===XL.RightClick)return!1;return H==null||H({event:J}),!0}}];var BL={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class qx extends NK{constructor($){super($,BL)}static setup(){return window.addEventListener(BL.move.name,$,{capture:!1,passive:!1}),function(){window.removeEventListener(BL.move.name,$)};function $(){}}}qx.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 TQ;(function($){$[$.Pointer=0]="Pointer",$[$.DraggableRect=1]="DraggableRect"})(TQ||(TQ={}));var WK;(function($){$[$.TreeOrder=0]="TreeOrder",$[$.ReversedTreeOrder=1]="ReversedTreeOrder"})(WK||(WK={}));function o90($){let{acceleration:Z,activator:J=TQ.Pointer,canScroll:H,draggingRect:B,enabled:Q,interval:X=5,order:z=WK.TreeOrder,pointerCoordinates:G,scrollableAncestors:U,scrollableAncestorRects:Y,delta:K,threshold:F}=$,W=s90({delta:K,disabled:!Q}),[q,N]=hy(),D=V0.useRef({x:0,y:0}),A=V0.useRef({x:0,y:0}),V=V0.useMemo(()=>{switch(J){case TQ.Pointer:return G?{top:G.y,bottom:G.y,left:G.x,right:G.x}:null;case TQ.DraggableRect:return B}},[J,B,G]),L=V0.useRef(null),O=V0.useCallback(()=>{let _=L.current;if(!_)return;let w=D.current.x*A.current.x,C=D.current.y*A.current.y;_.scrollBy(w,C)},[]),M=V0.useMemo(()=>z===WK.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(_),C=Y[w];if(!C)continue;let{direction:b,speed:T}=g90(_,C,V,Z,F);for(let I of["x","y"])if(!W[I][b[I]])T[I]=0,b[I]=0;if(T.x>0||T.y>0){N(),L.current=_,q(O,X),D.current=T,A.current=b;return}}D.current={x:0,y:0},A.current={x:0,y:0},N()},[Z,O,H,N,Q,X,JSON.stringify(V),JSON.stringify(W),q,U,M,Y,JSON.stringify(F)])}var n90={x:{[v2.Backward]:!1,[v2.Forward]:!1},y:{[v2.Backward]:!1,[v2.Forward]:!1}};function s90($){let{delta:Z,disabled:J}=$,H=PQ(Z);return uJ((B)=>{if(J||!H||!B)return n90;let Q={x:Math.sign(Z.x-H.x),y:Math.sign(Z.y-H.y)};return{x:{[v2.Backward]:B.x[v2.Backward]||Q.x===-1,[v2.Forward]:B.x[v2.Forward]||Q.x===1},y:{[v2.Backward]:B.y[v2.Backward]||Q.y===-1,[v2.Forward]:B.y[v2.Forward]||Q.y===1}}},[J,Z,H])}function t90($,Z){let J=Z!=null?$.get(Z):void 0,H=J?J.node.current:null;return uJ((B)=>{var Q;if(Z==null)return null;return(Q=H!=null?H:B)!=null?Q:null},[H,Z])}function e90($,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 CQ;(function($){$[$.Always=0]="Always",$[$.BeforeDragging=1]="BeforeDragging",$[$.WhileDragging=2]="WhileDragging"})(CQ||(CQ={}));var zL;(function($){$.Optimized="optimized"})(zL||(zL={}));var ry=new Map;function $30($,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=mJ(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=uJ((A)=>{if(K&&!J)return ry;if(!A||A===ry||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 O=L.node.current,M=O?new qK(G(O),O):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 CQ.Always:return!1;case CQ.BeforeDragging:return J;default:return!J}}}function YL($,Z){return uJ((J)=>{if(!$)return null;if(J)return J;return typeof Z==="function"?Z($):$},[Z,$])}function Z30($,Z){return YL($,Z)}function J30($){let{callback:Z,disabled:J}=$,H=LQ(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 AK($){let{callback:Z,disabled:J}=$,H=LQ(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 H30($){return new qK(EQ($),$)}function ay($,Z,J){if(Z===void 0)Z=H30;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=J30({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=AK({callback:Q});return e9(()=>{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 B30($){let Z=YL($);return Hx($,Z)}var oy=[];function Q30($){let Z=V0.useRef($),J=uJ((H)=>{if(!$)return oy;if(H&&H!==oy&&$&&Z.current&&$.parentNode===Z.current.parentNode)return H;return UL($)},[$]);return V0.useEffect(()=>{Z.current=$},[$]),J}function X30($){let[Z,J]=V0.useState(null),H=V0.useRef($),B=V0.useCallback((Q)=>{let X=JL(Q.target);if(!X)return;J((z)=>{if(!z)return null;return z.set(X,QL(X)),new Map(z)})},[]);return V0.useEffect(()=>{let Q=H.current;if($!==Q){X(Q);let z=$.map((G)=>{let U=JL(G);if(U)return U.addEventListener("scroll",B,{passive:!0}),[U,QL(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=JL(G);U==null||U.removeEventListener("scroll",B)})}},[B,$]),V0.useMemo(()=>{if($.length)return Z?Array.from(Z.values()).reduce((Q,X)=>y$(Q,X),Y9):Yx($);return Y9},[$,Z])}function ny($,Z){if(Z===void 0)Z=[];let J=V0.useRef(null);return V0.useEffect(()=>{J.current=null},Z),V0.useEffect(()=>{let H=$!==Y9;if(H&&!J.current)J.current=$;if(!H&&J.current)J.current=null},[$]),J.current?OQ($,J.current):Y9}function z30($){V0.useEffect(()=>{if(!VQ)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 G30($,Z){return V0.useMemo(()=>{return $.reduce((J,H)=>{let{eventName:B,handler:Q}=H;return J[B]=(X)=>{Q(X,Z)},J},{})},[$,Z])}function Nx($){return V0.useMemo(()=>$?x90($):null,[$])}var sy=[];function U30($,Z){if(Z===void 0)Z=EQ;let[J]=$,H=Nx(J?W4(J):null),[B,Q]=V0.useState(sy);function X(){Q(()=>{if(!$.length)return sy;return $.map((G)=>Gx(G)?H:new qK(Z(G),G))})}let z=AK({callback:X});return e9(()=>{z==null||z.disconnect(),X(),$.forEach((G)=>z==null?void 0:z.observe(G))},[$]),B}function Ax($){if(!$)return null;if($.children.length>1)return $;let Z=$.children[0];return gJ(Z)?Z:$}function Y30($){let{measure:Z}=$,[J,H]=V0.useState(null),B=V0.useCallback((U)=>{for(let{target:Y}of U)if(gJ(Y)){H((K)=>{let F=Z(Y);return K?{...K,width:F.width,height:F.height}:F});break}},[Z]),Q=AK({callback:B}),X=V0.useCallback((U)=>{let Y=Ax(U);if(Q==null||Q.disconnect(),Y)Q==null||Q.observe(Y);H(Y?Z(Y):null)},[Z,Q]),[z,G]=MQ(X);return V0.useMemo(()=>({nodeRef:z,rect:J,setRef:G}),[J,z,G])}var K30=[{sensor:wQ,options:{}},{sensor:bQ,options:{}}],F30={current:{}},KK={draggable:{measure:cy},droppable:{measure:cy,strategy:CQ.WhileDragging,frequency:zL.Optimized},dragOverlay:{measure:EQ}};class cJ 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 W30={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new cJ,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:FK},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:KK,measureDroppableContainers:FK,windowRect:null,measuringScheduled:!1},Dx={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:FK,draggableNodes:new Map,over:null,measureDroppableContainers:FK},SQ=V0.createContext(Dx),Vx=V0.createContext(W30);function q30(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new cJ}}}function N30($,Z){switch(Z.type){case M2.DragStart:return{...$,draggable:{...$.draggable,initialCoordinates:Z.initialCoordinates,active:Z.active}};case M2.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 M2.DragEnd:case M2.DragCancel:return{...$,draggable:{...$.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case M2.RegisterDroppable:{let{element:J}=Z,{id:H}=J,B=new cJ($.droppable.containers);return B.set(H,J),{...$,droppable:{...$.droppable,containers:B}}}case M2.SetDroppableDisabled:{let{id:J,key:H,disabled:B}=Z,Q=$.droppable.containers.get(J);if(!Q||H!==Q.key)return $;let X=new cJ($.droppable.containers);return X.set(J,{...Q,disabled:B}),{...$,droppable:{...$.droppable,containers:X}}}case M2.UnregisterDroppable:{let{id:J,key:H}=Z,B=$.droppable.containers.get(J);if(!B||H!==B.key)return $;let Q=new cJ($.droppable.containers);return Q.delete(J),{...$,droppable:{...$.droppable,containers:Q}}}default:return $}}function A30($){let{disabled:Z}=$,{active:J,activatorEvent:H,draggableNodes:B}=V0.useContext(SQ),Q=PQ(H),X=PQ(J==null?void 0:J.id);return V0.useEffect(()=>{if(Z)return;if(!H&&Q&&X!=null){if(!YK(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=fy(Y);if(K){K.focus();break}}})}},[H,Z,B,X,Q]),null}function Lx($,Z){let{transform:J,...H}=Z;return $!=null&&$.length?$.reduce((B,Q)=>{return Q({transform:B,...H})},J):J}function D30($){return V0.useMemo(()=>({draggable:{...KK.draggable,...$==null?void 0:$.draggable},droppable:{...KK.droppable,...$==null?void 0:$.droppable},dragOverlay:{...KK.dragOverlay,...$==null?void 0:$.dragOverlay}}),[$==null?void 0:$.draggable,$==null?void 0:$.droppable,$==null?void 0:$.dragOverlay])}function V30($){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;e9(()=>{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=Hx(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=Qx(U);if(F)F.scrollBy({top:K.y,left:K.x})}},[Z,X,z,H,J])}var DK=V0.createContext({...Y9,scaleX:1,scaleY:1}),Z7;(function($){$[$.Uninitialized=0]="Uninitialized",$[$.Initializing=1]="Initializing",$[$.Initialized=2]="Initialized"})(Z7||(Z7={}));var Mx=V0.memo(function(Z){var J,H,B,Q;let{id:X,accessibility:z,autoScroll:G=!0,children:U,sensors:Y=K30,collisionDetection:K=w90,measuring:F,modifiers:W,...q}=Z,N=V0.useReducer(N30,void 0,q30),[D,A]=N,[V,L]=L90(),[O,M]=V0.useState(Z7.Uninitialized),_=O===Z7.Initialized,{draggable:{active:w,nodes:C,translate:b},droppable:{containers:T}}=D,I=w!=null?C.get(w):null,S=V0.useRef({initial:null,translated:null}),R=V0.useMemo(()=>{var C0;return w!=null?{id:w,data:(C0=I==null?void 0:I.data)!=null?C0:F30,rect:S}:null},[w,I]),j=V0.useRef(null),[y,k]=V0.useState(null),[x,v]=V0.useState(null),f=mJ(q,Object.values(q)),E=_Q("DndDescribedBy",X),l=V0.useMemo(()=>T.getEnabled(),[T]),r=D30(F),{droppableRects:h,measureDroppableContainers:d,measuringScheduled:o}=$30(l,{dragging:_,dependencies:[b.x,b.y],config:r.droppable}),p=t90(C,w),i=V0.useMemo(()=>x?jQ(x):null,[x]),n=z5(),Z0=Z30(p,r.draggable.measure);V30({activeNode:w!=null?C.get(w):null,config:n.layoutShiftCompensation,initialRect:Z0,measure:r.draggable.measure});let J0=ay(p,r.draggable.measure,Z0),U0=ay(p?p.parentElement:null),z0=V0.useRef({activatorEvent:null,active:null,activeNode:p,collisionRect:null,collisions:null,droppableRects:h,draggableNodes:C,draggingNode:null,draggingNodeRect:null,droppableContainers:T,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Q0=T.getNodeFor((J=z0.current.over)==null?void 0:J.id),N0=Y30({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=B30(s?null:J0),e=Nx(D0?W4(D0):null),$0=Q30(_?Q0!=null?Q0:p:null),X0=U30($0),_0=Lx(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:X0,windowRect:e}),M0=i?y$(i,b):null,A0=X30($0),L0=ny(A0),g=ny(A0,[J0]),u=y$(_0,L0),t=F0?I90(F0,_0):null,W0=R&&t?K({active:R,collisionRect:t,droppableRects:h,droppableContainers:l,pointerCoordinates:M0}):null,S0=E90(W0,"id"),[p0,f0]=V0.useState(null),T0=s?_0:y$(_0,g),d0=S90(T0,(Q=p0==null?void 0:p0.rect)!=null?Q:null,J0),z1=V0.useRef(null),e0=V0.useCallback((C0,x0)=>{let{sensor:a0,options:n0}=x0;if(j.current==null)return;let D1=C.get(j.current);if(!D1)return;let V1=C0.nativeEvent,p1=new a0({active:j.current,activeNode:D1,event:V1,options:n0,context:z0,onAbort(m0){if(!C.get(m0))return;let{onDragAbort:h0}=f.current,U1={id:m0};h0==null||h0(U1),V({type:"onDragAbort",event:U1})},onPending(m0,q0,h0,U1){if(!C.get(m0))return;let{onDragPending:i0}=f.current,l0={id:m0,constraint:q0,initialCoordinates:h0,offset:U1};i0==null||i0(l0),V({type:"onDragPending",event:l0})},onStart(m0){let q0=j.current;if(q0==null)return;let h0=C.get(q0);if(!h0)return;let{onDragStart:U1}=f.current,I0={activatorEvent:V1,active:{id:q0,data:h0.data,rect:S}};h$.unstable_batchedUpdates(()=>{U1==null||U1(I0),M(Z7.Initializing),A({type:M2.DragStart,initialCoordinates:m0,active:q0}),V({type:"onDragStart",event:I0}),k(z1.current),v(V1)})},onMove(m0){A({type:M2.DragMove,coordinates:m0})},onEnd:Z5(M2.DragEnd),onCancel:Z5(M2.DragCancel)});z1.current=p1;function Z5(m0){return async function(){let{active:h0,collisions:U1,over:I0,scrollAdjustedTranslate:i0}=z0.current,l0=null;if(h0&&i0){let{cancelDrop:L1}=f.current;if(l0={activatorEvent:V1,active:h0,collisions:U1,delta:i0,over:I0},m0===M2.DragEnd&&typeof L1==="function"){if(await Promise.resolve(L1(l0)))m0=M2.DragCancel}}j.current=null,h$.unstable_batchedUpdates(()=>{A({type:m0}),M(Z7.Uninitialized),f0(null),k(null),v(null),z1.current=null;let L1=m0===M2.DragEnd?"onDragEnd":"onDragCancel";if(l0){let T1=f.current[L1];T1==null||T1(l0),V({type:L1,event:l0})}})}}},[C]),c0=V0.useCallback((C0,x0)=>{return(a0,n0)=>{let D1=a0.nativeEvent,V1=C.get(n0);if(j.current!==null||!V1||D1.dndKit||D1.defaultPrevented)return;let p1={active:V1};if(C0(a0,x0.options,p1)===!0)D1.dndKit={capturedBy:x0.sensor},j.current=n0,e0(a0,x0)}},[C,e0]),y0=e90(Y,c0);z30(Y),e9(()=>{if(J0&&O===Z7.Initializing)M(Z7.Initialized)},[J0,O]),V0.useEffect(()=>{let{onDragMove:C0}=f.current,{active:x0,activatorEvent:a0,collisions:n0,over:D1}=z0.current;if(!x0||!a0)return;let V1={active:x0,activatorEvent:a0,collisions:n0,delta:{x:u.x,y:u.y},over:D1};h$.unstable_batchedUpdates(()=>{C0==null||C0(V1),V({type:"onDragMove",event:V1})})},[u.x,u.y]),V0.useEffect(()=>{let{active:C0,activatorEvent:x0,collisions:a0,droppableContainers:n0,scrollAdjustedTranslate:D1}=z0.current;if(!C0||j.current==null||!x0||!D1)return;let{onDragOver:V1}=f.current,p1=n0.get(S0),Z5=p1&&p1.rect.current?{id:p1.id,rect:p1.rect.current,data:p1.data,disabled:p1.disabled}:null,m0={active:C0,activatorEvent:x0,collisions:a0,delta:{x:D1.x,y:D1.y},over:Z5};h$.unstable_batchedUpdates(()=>{f0(Z5),V1==null||V1(m0),V({type:"onDragOver",event:m0})})},[S0]),e9(()=>{z0.current={activatorEvent:x,active:R,activeNode:p,collisionRect:t,collisions:W0,droppableRects:h,draggableNodes:C,draggingNode:D0,draggingNodeRect:F0,droppableContainers:T,over:p0,scrollableAncestors:$0,scrollAdjustedTranslate:u},S.current={initial:F0,translated:t}},[R,p,W0,t,C,D0,F0,h,T,p0,$0,u]),o90({...n,delta:b,draggingRect:t,pointerCoordinates:M0,scrollableAncestors:$0,scrollableAncestorRects:X0});let E1=V0.useMemo(()=>{return{active:R,activeNode:p,activeNodeRect:J0,activatorEvent:x,collisions:W0,containerNodeRect:U0,dragOverlay:N0,draggableNodes:C,droppableContainers:T,droppableRects:h,over:p0,measureDroppableContainers:d,scrollableAncestors:$0,scrollableAncestorRects:X0,measuringConfiguration:r,measuringScheduled:o,windowRect:e}},[R,p,J0,x,W0,U0,N0,C,T,h,p0,d,$0,X0,r,o,e]),W1=V0.useMemo(()=>{return{activatorEvent:x,activators:y0,active:R,activeNodeRect:J0,ariaDescribedById:{draggable:E},dispatch:A,draggableNodes:C,over:p0,measureDroppableContainers:d}},[x,y0,R,J0,A,E,C,p0,d]);return V0.default.createElement($x.Provider,{value:L},V0.default.createElement(SQ.Provider,{value:W1},V0.default.createElement(Vx.Provider,{value:E1},V0.default.createElement(DK.Provider,{value:d0},U)),V0.default.createElement(A30,{disabled:(z==null?void 0:z.restoreFocus)===!1})),V0.default.createElement(_90,{...z,hiddenTextDescribedById:E}));function z5(){let C0=(y==null?void 0:y.autoScrollEnabled)===!1,x0=typeof G==="object"?G.enabled===!1:G===!1,a0=_&&!C0&&!x0;if(typeof G==="object")return{...G,enabled:a0};return{enabled:a0}}}),L30=V0.createContext(null),ty="button",M30="Draggable";function Px($){let{id:Z,data:J,disabled:H=!1,attributes:B}=$,Q=_Q(M30),{activators:X,activatorEvent:z,active:G,activeNodeRect:U,ariaDescribedById:Y,draggableNodes:K,over:F}=V0.useContext(SQ),{role:W=ty,roleDescription:q="draggable",tabIndex:N=0}=B!=null?B:{},D=(G==null?void 0:G.id)===Z,A=V0.useContext(D?DK:L30),[V,L]=MQ(),[O,M]=MQ(),_=G30(X,Z),w=mJ(J);e9(()=>{return K.set(Z,{id:Z,key:Q,node:V,activatorNode:O,data:w}),()=>{let b=K.get(Z);if(b&&b.key===Q)K.delete(Z)}},[K,Z]);let C=V0.useMemo(()=>({role:W,tabIndex:N,"aria-disabled":H,"aria-pressed":D&&W===ty?!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:C,isDragging:D,listeners:H?void 0:_,node:V,over:F,setNodeRef:L,setActivatorNodeRef:M,transform:A}}function P30(){return V0.useContext(Vx)}var _30="Droppable",O30={timeout:25};function _x($){let{data:Z,disabled:J=!1,id:H,resizeObserverConfig:B}=$,Q=_Q(_30),{active:X,dispatch:z,over:G,measureDroppableContainers:U}=V0.useContext(SQ),Y=V0.useRef({disabled:J}),K=V0.useRef(!1),F=V0.useRef(null),W=V0.useRef(null),{disabled:q,updateMeasurementsFor:N,timeout:D}={...O30,...B},A=mJ(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=AK({callback:V,disabled:q||!X}),O=V0.useCallback((C,b)=>{if(!L)return;if(b)L.unobserve(b),K.current=!1;if(C)L.observe(C)},[L]),[M,_]=MQ(O),w=mJ(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:M2.RegisterDroppable,element:{id:H,key:Q,disabled:J,node:M,rect:F,data:w}}),()=>z({type:M2.UnregisterDroppable,key:Q,id:H})},[H]),V0.useEffect(()=>{if(J!==Y.current.disabled)z({type:M2.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 j30($){let{animation:Z,children:J}=$,[H,B]=V0.useState(null),[Q,X]=V0.useState(null),z=PQ(J);if(!J&&!H&&z)B(z);return e9(()=>{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 T30={x:0,y:0,scaleX:1,scaleY:1};function C30($){let{children:Z}=$;return V0.default.createElement(SQ.Provider,{value:Dx},V0.default.createElement(DK.Provider,{value:T30},Z))}var E30={position:"fixed",touchAction:"none"},b30=($)=>{return YK($)?"transform 250ms ease":void 0},w30=V0.forwardRef(($,Z)=>{let{as:J,activatorEvent:H,adjustScale:B,children:Q,className:X,rect:z,style:G,transform:U,transition:Y=b30}=$;if(!z)return null;let K=B?U:{...U,scaleX:1,scaleY:1},F={...E30,width:z.width,height:z.height,top:z.top,left:z.left,transform:fJ.Transform.toString(K),transformOrigin:B&&H?j90(H,z):void 0,transition:typeof Y==="function"?Y(H):Y,...G};return V0.default.createElement(J,{className:X,style:F,ref:Z},Q)}),S30=($)=>(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)}},R30=($)=>{let{transform:{initial:Z,final:J}}=$;return[{transform:fJ.Transform.toString(Z)},{transform:fJ.Transform.toString(J)}]},I30={duration:250,easing:"ease",keyframes:R30,sideEffects:S30({styles:{active:{opacity:"0"}}})};function k30($){let{config:Z,draggableNodes:J,droppableContainers:H,measuringConfiguration:B}=$;return LQ((Q,X)=>{if(Z===null)return;let z=J.get(Q);if(!z)return;let G=z.node.current;if(!G)return;let U=Ax(X);if(!U)return;let{transform:Y}=W4(X).getComputedStyle(X),K=Bx(Y);if(!K)return;let F=typeof Z==="function"?Z:y30(Z);return Kx(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 y30($){let{duration:Z,easing:J,sideEffects:H,keyframes:B}={...I30,...$};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 ey=0;function x30($){return V0.useMemo(()=>{if($==null)return;return ey++,ey},[$])}var Ox=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:O,windowRect:M}=P30(),_=V0.useContext(DK),w=x30(K==null?void 0:K.id),C=Lx(X,{activatorEvent:Y,active:K,activeNodeRect:F,containerNodeRect:W,draggingNodeRect:D.rect,over:A,overlayNodeRect:D.rect,scrollableAncestors:L,scrollableAncestorRects:O,transform:_,windowRect:M}),b=YL(F),T=k30({config:H,draggableNodes:q,droppableContainers:N,measuringConfiguration:V}),I=b?D.setRef:void 0;return V0.default.createElement(C30,null,V0.default.createElement(j30,{animation:T},K&&w?V0.default.createElement(w30,{key:w,id:K.id,ref:I,as:z,activatorEvent:Y,adjustScale:Z,className:G,transition:Q,rect:b,style:{zIndex:U,...B},transform:C},J):null))});var v$=P(c(),1),h30={start:[B5.Space],cancel:[B5.Esc],end:[B5.Space,B5.Tab]};function v30($,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 VK({items:$,getId:Z,className:J,itemClassName:H,dragDisabled:B=!1,isItemDragDisabled:Q,onReorder:X,renderItem:z,renderPlaceholder:G,renderOverlay:U}){let Y=Zx(GL(wQ,{activationConstraint:{distance:4}}),GL(bQ,{keyboardCodes:h30})),[K,F]=J7.useState(null),[W,q]=J7.useState(null),N=J7.useRef(null),D=J7.useMemo(()=>$.map(Z),[$,Z]),A=J7.useMemo(()=>new Map($.map((b)=>[Z(b),b])),[$,Z]),L=(K&&W?W:D).map((b)=>A.get(b)).filter((b)=>Boolean(b)),O=K?A.get(K):void 0,M=Q?$.filter((b)=>!Q(b)).length:$.length,_=B||M<2;return v$.jsxs(Mx,{sensors:Y,collisionDetection:Jx,onDragStart:(b)=>{let T=$.map(Z);F(String(b.active.id)),N.current=T,q(T)},onDragOver:(b)=>{let T=String(b.active.id),I=b.over?String(b.over.id):void 0,S=N.current;if(!I||I===T||!S)return;let R=v30(S,T,I);if(R===S)return;N.current=R,q(R)},onDragCancel:()=>{N.current=null,F(null),q(null)},onDragEnd:(b)=>{let T=String(b.active.id),I=N.current;if(N.current=null,F(null),q(null),!I||I.join("|")===D.join("|"))return;if(!I.includes(T))return;X(I)},children:[v$.jsx("div",{className:J,children:L.map((b)=>v$.jsx(f30,{id:Z(b),item:b,disabled:_||Q?.(b)===!0,itemClassName:H,renderItem:z,renderPlaceholder:G},Z(b)))}),v$.jsx(Ox,{dropAnimation:null,children:O&&U?U(O):null})]})}function f30({id:$,item:Z,disabled:J,itemClassName:H,renderItem:B,renderPlaceholder:Q}){let{setNodeRef:X,isOver:z}=_x({id:$,disabled:J}),{attributes:G,listeners:U,setNodeRef:Y,isDragging:K}=Px({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 v$.jsxs(K5.div,{layout:!0,ref:F,className:B0("relative",H?.(Z,W)),transition:{type:"spring",duration:0.25,bounce:0},children:[K&&Q?.(Z),B(Z,W)]})}var F1=P(c(),1),g30="https://mlfrg.notion.site/3c678a44b6788042b734d775dd2e935e?pvs=105";function m30($){return B0(z9({variant:"ghost",size:"icon"}),$&&"bg-accent text-accent-foreground")}function LK({children:$,showWorkspaces:Z=!0}){let{data:J}=IU(),H=$1();return L2((B)=>{if(B.type==="workspace:updated"||B.type==="theme:updated"||B.type==="workspaces-list:updated")H.invalidateQueries({queryKey:O0.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(u30,{workspaces:Z?J??[]:[]}),F1.jsx("main",{className:"flex min-w-0 flex-1 flex-col",children:$})]})}function u30({workspaces:$}){let Z=aS();return F1.jsx(uG,{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(o1,{children:[F1.jsx(n1,{render:F1.jsx(r7,{href:"/","aria-label":"Home",className:m30,children:F1.jsx(Cx,{stroke:1.5})})}),F1.jsx(s1,{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(VK,{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(jx,{workspace:J,dragOverlay:!0}),renderItem:(J,H)=>F1.jsx(jx,{workspace:J,dragState:H})})}),F1.jsx("div",{className:"shrink-0",children:F1.jsxs(o1,{children:[F1.jsx(DQ,{trigger:F1.jsx(n1,{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(a2,{"data-icon":"inline-start",stroke:1.5})})})}),F1.jsx(s1,{side:"right",children:"Create new workspace"})]})})]})}),F1.jsx("div",{className:"size-8 shrink-0",children:F1.jsx(p30,{})})]})})}function p30(){let{demo:$}=o4(),Z=ZR();if($)return F1.jsx(EJ,{trigger:F1.jsx(P0,{size:"icon","aria-label":"Unlock all features",title:"Unlock all features",children:F1.jsx(Ex,{stroke:1.5})})});if(Z.status==="loading")return null;if(Z.status==="available")return F1.jsx(JR,{...Z.button});return F1.jsx(c30,{})}function c30(){return F1.jsxs(o1,{children:[F1.jsx(n1,{render:F1.jsx(P0,{render:F1.jsx("a",{href:g30,target:"_blank",rel:"noreferrer"}),variant:"ghost",size:"icon","aria-label":"Leave feedback",className:"text-muted-foreground hover:text-foreground",children:F1.jsx(Tx,{stroke:1.5})})}),F1.jsx(s1,{side:"right",children:"Leave feedback"})]})}function jx({workspace:$,dragOverlay:Z=!1,dragState:J}){let[H]=m4(),B=`/workspace/${$.id}`,Q=R$($),X=H===B||H.startsWith(`${B}/`),z=F1.jsx("div",{className:B0(z9({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(e6,{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(r7,{href:B,"aria-label":Q,onClick:(U)=>{if(J?.isDragging)U.preventDefault()},className:B0("group flex w-14 flex-col items-center rounded-xl outline-none",J?.isDragging&&"invisible"),...J?.dragHandleProps,children:[z,F1.jsxs(o1,{children:[F1.jsx(n1,{render:G}),F1.jsx(s1,{side:"right",children:Q})]})]})}var Ih=P(m(),1);var wx=P(m(),1);function Sx($){return e1({queryKey:O0.layout($),queryFn:()=>B1(`/api/workspaces/${$}`),...N8})}function t4($){let Z=$1();return wx.useEffect(()=>bx(()=>{Z.invalidateQueries({queryKey:O0.agent($)})}),[Z,$]),L2((J)=>{if(J.type==="harness:updated"&&J.workspaceId===$)Z.setQueryData(O0.agent($),(H)=>H?{...H,availability:J.availability}:H);if(J.type==="env:updated"&&J.workspaceId===$)Z.invalidateQueries({queryKey:O0.agent($)})}),e1({queryKey:O0.agent($),queryFn:async({signal:J})=>{let H=O0.agent($),B=Z.getQueryData(H),Q=await B1(`/api/workspaces/${$}/agent?refresh=true`,{signal:J}),X=Z.getQueryData(H);return X&&X!==B?{...Q,availability:X.availability}:Q},staleTime:30000,refetchOnMount:(J)=>J.state.data?.availability.status==="available"?!0:"always",refetchOnWindowFocus:!0})}function Rx($){return e1({queryKey:O0.skills($),queryFn:()=>B1(`/api/workspaces/${$}/skills`),...N8})}async function d30($){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 Ix($){let Z=$1();return W5({mutationFn:()=>d30($),onSuccess:(J)=>{Z.setQueryData(O0.skills($),J)},onError:(J)=>{if(J.status)Z.setQueryData(O0.skills($),J.status)}})}function kx($){let Z=$1();return W5({mutationFn:(J)=>U4(`/api/workspaces/${$}`,_5("PUT",J),"Failed to save layout"),onSuccess:()=>{Z.invalidateQueries({queryKey:O0.preview($)})}})}var yx=P(m(),1);var dJ=P(c(),1);function xx({choice:$,isPending:Z,errorMessage:J,onTypeChange:H,onSubmit:B,onReset:Q}){let[X,z]=yx.useState(!0),G=xU(),U=G.isPending||G.isFetching,Y=G.isError?void 0:G.data?.installed,K=BK(Y,$.workspace.types),F=!U&&!Y?"Could not check installed agents.":void 0,W=!Z&&!U&&!F&&K.some((D)=>D.type===$.selectedType&&!D.disabled);function q(D){if(!D&&Z)return;z(D)}function N(D){if(!D)Q()}return dJ.jsx(h6,{open:X,onOpenChange:q,onOpenChangeComplete:N,children:dJ.jsx(zK,{showCloseButton:!Z,children:dJ.jsx(XK,{title:`Import ${R$($.workspace)}`,selectedType:$.selectedType,options:K,isLoading:U&&!Y,isPending:Z||U||Boolean(F),errorMessage:F??J,secondaryAction:dJ.jsx(oB,{render:dJ.jsx(P0,{variant:"secondary"}),disabled:Z,children:"Cancel"}),primaryLabel:"Add workspace",pendingLabel:Z?"Adding…":void 0,onTypeChange:H,onSubmit:()=>{if(W)B()}})})})}var hx=P(m(),1);function l30($){return $.types[0]??jJ[0]}function vx({onSuccess:$}){let Z=BR(),[J,H]=hx.useState(null);function B(G){Z.reset(),H({workspace:G,selectedType:l30(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 IQ=P(m(),1);var kQ=P(c(),1),i30=[["OOOOO","O.O.O","O.O.O"],["OOO","O.O","OOO"],["O","O","O"]],H7=10,MK=3,r30=2.5,a30={O:1,o:0.5,".":0},o30=3000,n30=2,fx=3,B7=3,gx=0.001,f$={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*H7+(Z-1)*MK,H=$.length*H7+($.length-1)*MK,B=[];return $.forEach((Q,X)=>{Array.from(Q).forEach((z,G)=>{let U=a30[z];if(U===void 0)return;let Y=G*(H7+MK),K=X*(H7+MK);B.push({x:Y,y:K,centerX:Y+H7/2,centerY:K+H7/2,targetOpacity:U})})}),{width:J,height:H,fieldColumns:Math.round(J/B7)+1,fieldRows:Math.round(H/B7)+1,pixels:B}}var t30=i30.map(s30);function RQ($,Z,J){return $<Z?Z:$>J?J:$}function e30($){return $<0.5?2*$*$:1-(-2*$+2)**2/2}class mx{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/B7),Z=Math.round(this.geometry.height/2/B7),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=n30*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)/o30;if(this.activation=1-e30(Math.min(1,J)),J>=1)this.intro=!1}else{this.intro=!1;let J=this.pointerActive?1:0,H=this.pointerActive?f$.fadeIn:f$.fadeOut;this.activation+=(J-this.activation)*H}let Z=this.renderWave();if(this.intro||this.pointerActive||this.activation>gx||Z>gx){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]+f$.courantSquared*X)*f$.damping}let J=this.previousField;this.previousField=this.field,this.field=this.nextField,this.nextField=J}driveWave($){let Z=RQ(Math.round(this.pointerX/B7),1,this.geometry.fieldColumns-2),J=RQ(Math.round(this.pointerY/B7),1,this.geometry.fieldRows-2);this.field[J*this.geometry.fieldColumns+Z]=f$.driveAmplitude*Math.sin($*f$.driveFrequency)}sampleField($,Z){let J=RQ($/B7,0,this.geometry.fieldColumns-1),H=RQ(Z/B7,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=RQ(0.5+B*f$.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 $60({geometry:$}){let Z=IQ.useRef([]),J=IQ.useRef(null);return IQ.useEffect(()=>{let H=J.current;if(!H||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let B=new mx(Z.current,H,$);return B.start(),window.addEventListener("pointermove",B.handlePointerMove),()=>{B.stop(),window.removeEventListener("pointermove",B.handlePointerMove)}},[$]),kQ.jsx("svg",{ref:J,className:"h-8 w-auto",viewBox:`0 0 ${$.width} ${$.height}`,fill:"currentColor","aria-hidden":"true",children:$.pixels.map((H,B)=>kQ.jsx("rect",{ref:(Q)=>{Z.current[B]=Q},x:H.x,y:H.y,width:H7,height:H7,rx:r30,opacity:H.targetOpacity},`${H.x}-${H.y}`))})}function ux({className:$}){return kQ.jsx("div",{role:"img","aria-label":"Moi",className:B0("flex items-center gap-2 text-accent",$),children:t30.map((Z,J)=>kQ.jsx($60,{geometry:Z},J))})}function KL({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 px=($)=>$.every((Z)=>Z>=-0.0001&&Z<=1.0001);function ix($){let Z=KL($);if(!px(Z)){let J=0,H=$.c;for(let B=0;B<12;B++){let Q=(J+H)/2;if(px(KL({...$,c:Q})))J=Q;else H=Q}Z=KL({...$,c:J})}return Z.map((J)=>Math.min(1,Math.max(0,J)))}function cx($){let[Z,J,H]=ix($);return 0.2126*Z+0.7152*J+0.0722*H}function yQ($,Z){let J=cx($),H=cx(Z);return(Math.max(J,H)+0.05)/(Math.min(J,H)+0.05)}function dx($,Z,J){if(yQ($,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)),yQ(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 yQ(B,Z)>=yQ(Q,Z)?B:Q}function PK($){return"#"+ix($).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 lJ($){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 Z60($,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 _K=($,Z,J)=>PK(Z60(lJ($),lJ(Z),J));var J60={h:12,l:0.84,pull:0.4,c:0.1};var lx=4.55;function H60($,Z,J){let H=lJ($),B=lJ(Z),Q={l:H.l+(J.l-H.l)*J.pull,c:Math.max(H.c,J.c),h:J.h};Q=dx(Q,B60,Q60);let X=dx(B,Q,lx),z=X.l>=Q.l?1:-1,G=PK(Q);for(let U=0;U<40;U++){let Y=PK(X),K=1/0;for(let W=0;W<=10;W++){let q=W/10;K=Math.min(K,yQ(lJ(_K(Z,Y,q)),lJ(_K($,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,PK(X)]}var B60={l:0.145,c:0,h:0},Q60=1.5;var FL={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},rx=($)=>String(Math.round($*1000)/1000);function $3($,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 ${rx(Z.bdy)})`:""}}function Z3($){let Z={};for(let J in FL){if(J==="heat")continue;let H=$[J];if(H!==FL[J])Z["--mo-"+J]=rx(H)}return Z}function X60($,Z,J){let[H,B]=H60($.head,$.eye,J);return{...$,head:_K($.head,H,Z.heat),eye:_K($.eye,B,Z.heat)}}var ax={p:FL,vars:Z3,bake:$3},ox={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:Z3,bake:$3},nx={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:Z3,bake:$3};var sx={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:Z3,bake:$3},tx={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:Z3,bake:$3},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:Z3,bake:$3},$h={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:Z3,bake:$3},Zh={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:Z3,bake:$3};var Jh={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:Z3,bake:$3,tint:($,Z)=>X60($,Z,J60)};var Hh={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:Z3,bake:$3};var Bh=P(c(),1),z60="moi-agent",G60={default:{head:"var(--foreground)",eye:"var(--background)"},primary:{head:"var(--primary)",eye:"var(--primary-foreground)"},secondary:{head:"var(--accent)",eye:"var(--accent-foreground)"}},U60={idle:ax,happy:ox,sad:nx,surprised:sx,wink:tx,sleepy:ex,smug:$h,unsure:Zh,shy:Jh,thinking:Hh};function J3({size:$=56,preset:Z=s9.agent,animated:J=!1,color:H="default",expression:B="idle",className:Q}){return Bh.jsx(UU,{name:z60,size:$,animate:J?"always":"hover",palette:G60[H],expression:B?U60[B]:void 0,className:B0("shrink-0",Q),traits:WQ[Z].traits})}var rJ={};I5(rJ,{Trigger:()=>Ah,Root:()=>qh,Panel:()=>_h});var xQ=P(m(),1);var OK=P(m(),1);function Qh($){let{open:Z,defaultOpen:J=!1,onOpenChange:H,disabled:B}=$,[Q,X]=F4({controlled:Z,default:J,name:"Collapsible",state:"open"}),{mounted:z,setMounted:G,transitionStatus:U}=S2(Q,!0,!0),Y=t0(),[K,F]=OK.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 OK.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 jK=P(m(),1),WL=jK.createContext(void 0);function TK(){let $=jK.useContext(WL);if($===void 0)throw Error(k0(15));return $}var Xh="data-open",zh="data-closed",Gh=G8.startingStyle,as0=G8.endingStyle;var Yh="data-panel-open";var K60={[Xh]:""},F60={[zh]:""},Kh={open($){if($)return{[Yh]:""};return null}},Fh={open($){if($)return K60;return F60}};var CK={...Fh,...G2};var Wh=P(c(),1),qh=xQ.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=Qh({open:G,defaultOpen:Q,onOpenChange:K,disabled:X}),W=xQ.useMemo(()=>({open:F.open,disabled:F.disabled,transitionStatus:F.transitionStatus}),[F.open,F.disabled,F.transitionStatus]),q=xQ.useMemo(()=>({...F,onOpenChange:K,state:W}),[F,K,W]),N=G0("div",Z,{state:W,ref:J,props:Y,stateAttributesMapping:CK});return Wh.jsx(WL.Provider,{value:q,children:N})});var Nh=P(m(),1);var W60={...Kh,...G2},Ah=Nh.forwardRef(function(Z,J){let{panelId:H,open:B,handleTrigger:Q,state:X,disabled:z}=TK(),{className:G,disabled:U=z,render:Y,nativeButton:K=!0,style:F,...W}=Z,{getButtonProps:q,buttonRef:N}=w5({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:W60})});var qL=P(m(),1);var R4=P(m(),1);var hQ={height:void 0,width:void 0};function Vh($){let{externalRef:Z,hiddenUntilFound:J,id:H,keepMounted:B,mounted:Q,onOpenChange:X,open:z,setMounted:G,setOpen:U,transitionStatus:Y}=$,K=R4.useRef(null),F=R4.useRef(null),[W,q]=R4.useState(hQ),N=R4.useRef(hQ),D=R4.useRef(!1),A=R4.useRef(z),V=R4.useRef(!1),[L,O]=R4.useState(!1),M=R4.useRef(null),_=p2(Z,K),w=q5(z),C=d4(K),b=!z&&!Q,T=L?"idle":Y,I=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",j=Y0((f,E=!0)=>{if(E)N.current=f;q(f)}),y=Y0(()=>{M.current?.(),M.current=null}),k=Y0((f)=>{y(),M.current=()=>{M.current=null,f()}}),x=Y0(()=>{if(z&&Q&&F.current==="css-animation")V.current=!0});H0(()=>{if(!L||Y==="starting")return;O(!1)},[L,Y]),R4.useEffect(()=>{return()=>{x(),y()}},[x,y]),H0(()=>{let f=K.current;if(!f)return;if(!z&&M.current)y();let E=q60(f,I);if(F.current=E,z&&Y==="idle"&&A.current&&E==="css-animation"){N.current=iJ(f);return}if(z&&Y==="starting"){let h=D.current;if(D.current=!1,E==="none"){j(iJ(f)),O(!0);return}if(E==="css-transition"){let p=N60(f);if(j(iJ(f)),!h)return p;let i=EK(f,"transition-duration","0s");return k(i),O(!0),p}j(iJ(f));let d=EK(f,"animation-name","none");if(!h){d();return}let o=EK(f,"animation-duration","0s");d(),k(o),O(!0);return}if(!z&&Q&&(Y==="idle"||Y==="starting")){if(A.current=!1,V.current=!1,E==="none"){j(hQ,!1),G(!1);return}j(iJ(f));return}if(Y!=="ending")return;if(E==="none"){G(!1);return}let l=iJ(f);if(!(l.height>0||l.width>0)){G(!1);return}if(j(l),E==="css-animation")EK(f,"animation-name","none")();return},[Q,z,y,j,G,k,I,Y]),V5({enabled:z&&Q&&T==="idle",open:!0,ref:K,onComplete(){if(!z)return;j(hQ,!1)}}),R4.useEffect(()=>{if(z||!Q||T!=="ending")return;if(!K.current)return;let E=new AbortController,l=-1;function r(){if(w.current)return;G(!1),j(hQ,!1)}return l=m2.request(()=>{C(r,E.signal)}),()=>{m2.cancel(l),E.abort()}},[w,Q,z,T,C,j,G]),H0(()=>{let f=K.current;if(!f||!J||!b)return;f.setAttribute("hidden","until-found")},[b,J]),R4.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 o0(E,"beforematch",l)},[X,U]);let v=B||J||Q||z;return{height:S.height,props:{...R?{[Gh]:""}:void 0,hidden:b,id:H},ref:_,shouldPreventOpenAnimation:I,shouldRender:v,transitionStatus:T,width:S.width}}function iJ($){return{height:$.scrollHeight,width:$.scrollWidth}}function q60($,Z){let J=S1($).getComputedStyle($),H=(J.animationName.split(",").map((Q)=>Q.trim()).some((Q)=>Q!==""&&Q!=="none")||Z)&&Dh(J.animationDuration),B=Dh(J.transitionDuration);if(H&&B)return"css-transition";if(B)return"css-transition";if(H)return"css-animation";return"none"}function Dh($){return $.split(",").map((Z)=>Z.trim()).some((Z)=>Z!==""&&Number.parseFloat(Z)>0)}function EK($,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 N60($){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=m2.request(J);return()=>{m2.cancel(H),J()}}var Lh="--collapsible-panel-height",Mh="--collapsible-panel-width";var _h=qL.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}=TK(),L=B??!1,O=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:C,ref:b,shouldPreventOpenAnimation:T,shouldRender:I,transitionStatus:S,width:R}=Vh({externalRef:J,hiddenUntilFound:L,id:_,keepMounted:O,mounted:K,onOpenChange:F,open:W,setMounted:q,setOpen:D,transitionStatus:V}),j={...A,transitionStatus:S},y=Ph(G,j),k=G0("div",{...Z,style:void 0},{state:j,ref:b,props:[C,{style:{[Lh]:w===void 0?"auto":`${w}px`,[Mh]:R===void 0?"auto":`${R}px`}},U,y?{style:y}:void 0,T?{style:{animationName:"none"}}:void 0],stateAttributesMapping:CK});if(!I)return null;return k});var RK=P(c(),1);function bK({...$}){return RK.jsx(rJ.Root,{"data-slot":"collapsible",...$})}function wK({...$}){return RK.jsx(rJ.Trigger,{"data-slot":"collapsible-trigger",...$})}function SK({...$}){return RK.jsx(rJ.Panel,{"data-slot":"collapsible-content",...$})}var IK=P(m(),1);var NL="moi-fonts",Oh="moi-font-previews",D60=Object.values(t6).map(($)=>$.googleFontsQuery).filter(Boolean).join("&family="),Th=[["sans","--sans"],["mono","--mono"]],Ch=sV.map(($)=>[$,V60($)]),Eh="--radius",jh=[...Th.map(([,$])=>$),...Ch.map(([,$])=>$),Eh];function V60($){return`--${$.replace(/[A-Z]/g,(J)=>`-${J.toLowerCase()}`)}`}function L60($){let Z={},J=U9($),H=J.font===s9.font?void 0:t6[J.font];for(let[B,Q]of Th)Z[Q]=H?.[B];return Z}function AL($,Z="workspace"){let J={},H=$K($,Z);for(let[B,Q]of Ch)J[Q]=H?.[B];return J}function M60($){let Z={},J=U9($),H=J.radius===s9.radius?void 0:FQ[J.radius];return Z[Eh]=H?.radius,Z}function K9($,Z="workspace"){return{...L60($),...AL($,Z),...M60($)}}function kK(){IK.useEffect(()=>{if(document.getElementById(Oh))return;let $=document.createElement("link");return $.id=Oh,$.rel="stylesheet",$.crossOrigin="anonymous",$.href=`https://fonts.googleapis.com/css2?family=${D60}&display=swap`,document.head.appendChild($),()=>{$.remove()}},[])}function P60($){IK.useEffect(()=>{let Z=document.documentElement,J=K9($);for(let H of jh){let B=J[H];if(B)Z.style.setProperty(H,B);else Z.style.removeProperty(H)}return()=>{for(let H of jh)Z.style.removeProperty(H)}},[$])}function bh($){let{font:Z}=U9($);P60($),IK.useEffect(()=>{let J=t6[Z]??t6[s9.font],H=document.getElementById(NL);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=NL,Q.rel="stylesheet",Q.crossOrigin="anonymous",Q.href=B,document.head.appendChild(Q)}}return()=>{document.getElementById(NL)?.remove()}},[Z])}function V8($,{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"&&!d9(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 aJ=P(m(),1);var P2=P(c(),1),vQ={width:320,height:180,radius:32,topLeftRadius:18,bodyTop:24,tabEnd:124,shoulder:{width:48,roundness:20}};function _60($){let{width:Z,height:J,radius:H,topLeftRadius:B,bodyTop:Q,tabEnd:X,shoulder:z}=vQ,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 O60(){let $=aJ.useRef(null),[Z,J]=aJ.useState(1);return aJ.useLayoutEffect(()=>{let H=$.current;if(!H)return;let B=(z,G)=>{if(z<=0||G<=0)return;let U=z/vQ.width,K=G/vQ.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 wh=[{frame:B0("-translate-x-3 translate-y-3 -rotate-6","group-focus-within:translate-y-2 group-hover:translate-y-2"),img:"opacity-40"},{frame:B0("translate-x-3 translate-y-2 rotate-5","group-focus-within:translate-y-1 group-hover:translate-y-1"),img:"opacity-50"},{frame:B0("-translate-x-1 translate-y-1 -rotate-2","group-focus-within:-translate-y-2 group-hover:-translate-y-2"),img:"opacity-100"}];function Sh({workspaceId:$}){let Z=kU($),J=Z.data?[...Z.data.thumbnails].reverse():[],H=wh.slice(wh.length-J.length),B=Z.data?.firstUserMessage,Q=Z.data?.theme,{ref:X,horizontalRadiusScale:z}=O60(),G=_60(z),U=`folder-noise-${$}`,Y=K9(Q),K=AL(Q);return P2.jsxs("div",{ref:X,style:K,className:"relative h-45 w-full",children:[P2.jsxs("svg",{viewBox:`0 0 ${vQ.width} ${vQ.height}`,preserveAspectRatio:"none","aria-hidden":"true",className:"absolute inset-0 h-full w-full overflow-visible",children:[P2.jsx("defs",{children:P2.jsxs("filter",{id:U,x:"0%",y:"0%",width:"100%",height:"100%",colorInterpolationFilters:"sRGB",children:[P2.jsx("feTurbulence",{type:"fractalNoise",baseFrequency:"0.5",numOctaves:"3",seed:"7",result:"noise"}),P2.jsx("feColorMatrix",{in:"noise",type:"saturate",values:"0",result:"monochromeNoise"}),P2.jsx("feComponentTransfer",{in:"monochromeNoise",result:"faintNoise",children:P2.jsx("feFuncA",{type:"linear",slope:"0.24"})}),P2.jsx("feComposite",{in:"faintNoise",in2:"SourceAlpha",operator:"in",result:"clippedNoise"}),P2.jsx("feBlend",{in:"SourceGraphic",in2:"clippedNoise",mode:"soft-light"})]})}),P2.jsx("path",{d:G,filter:`url(#${U})`,className:"fill-accent"})]}),J.map((F,W)=>P2.jsx("div",{className:B0("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:P2.jsx("img",{src:F,alt:"",loading:"lazy",className:B0("block h-auto max-h-32 w-auto max-w-full object-contain",H[W].img)})},F)),J.length===0&&B&&P2.jsx("div",{className:"absolute inset-x-[12%] top-[22%] flex justify-end",children:P2.jsx("div",{"aria-hidden":"true",style:Y,className:B0("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:P2.jsx("p",{className:"line-clamp-3 text-sm leading-normal whitespace-normal",children:B})})}),P2.jsx("div",{className:B0("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 Q1=P(c(),1);function kh(){kK();let[,$]=m4(),Z=IU(),J=rS(),H=vx({onSuccess:(W)=>$(`/workspace/${W.id}`)}),B=o4(),[Q,X]=Ih.useState(!1),z=b1((W)=>W.discoveredWorkspacesOpen),G=b1((W)=>W.setDiscoveredWorkspacesOpen);if(Z.isPending||J.isPending)return Q1.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:Q1.jsx(d5,{size:20,stroke:1.5,className:"animate-spin text-muted-foreground"})});if(Z.isError||J.isError)return Q1.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:Q1.jsx("p",{className:"text-sm text-muted-foreground",children:"Could not load spaces."})});let U=Z.data,Y=J.data,K=U.length;function F(W){if(B.demo){X(!0);return}H.startImport(W)}return Q1.jsxs("div",{className:"mx-auto w-full max-w-3xl px-8 pt-14 pb-16",children:[Q1.jsx(ux,{className:"mb-10"}),K>0?Q1.jsxs("section",{className:"mb-12",children:[Q1.jsxs("div",{className:"mb-4 flex items-center justify-between gap-2",children:[Q1.jsx("h1",{className:"text-sm font-medium text-foreground",children:"My workspaces"}),Q1.jsx(DQ,{trigger:Q1.jsxs(P0,{variant:"outline",size:"sm",children:[Q1.jsx(a2,{"data-icon":"inline-start",stroke:1.75}),"New"]})})]}),Q1.jsx("div",{className:"grid grid-cols-1 gap-x-4 gap-y-8 sm:grid-cols-2 md:grid-cols-3",children:U.map((W)=>Q1.jsx(j60,{workspace:W},W.id))})]}):Q1.jsxs("div",{className:"mb-10 flex flex-col items-center gap-4 px-8 pt-8 pb-16 text-center",children:[Q1.jsx(Rh,{size:32,stroke:1.5,className:"text-muted-foreground"}),Q1.jsxs("div",{className:"flex flex-col gap-1.5",children:[Q1.jsx("h2",{className:"font-medium",children:"Let’s start with creating your first workspace"}),Q1.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."})]}),Q1.jsx(DQ,{trigger:Q1.jsx(P0,{children:"Create workspace"})})]}),Y.length>0&&Q1.jsx("section",{children:Q1.jsxs(bK,{open:z,onOpenChange:G,className:"group",children:[Q1.jsxs(wK,{className:B0("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:[Q1.jsx("span",{className:"text-sm font-medium",children:"Import from this computer"}),Q1.jsx(m3,{size:16,stroke:2,className:B0("opacity-0 transition-[opacity,transform]","group-hover/trigger:opacity-100 group-focus-visible/trigger:opacity-100 group-data-open:rotate-90")})]}),Q1.jsx(SK,{children:Q1.jsx("ul",{className:"border-t border-border",children:Y.map((W)=>Q1.jsx(T60,{suggestion:W,onAdd:F},W.path))})})]})}),H.choice&&Q1.jsx(xx,{choice:H.choice,isPending:H.isPending,errorMessage:H.error?.message,onTypeChange:H.selectType,onSubmit:H.submit,onReset:H.reset}),Q1.jsx(EJ,{open:Q,onOpenChange:X})]})}function j60({workspace:$}){t4($.id);let Z=R$($),J=kU($.id),H=$.theme??J.data?.theme,B=U9(H).agent,Q=G4((G)=>dG(G.activity,$.id)),X=J.data?.updatedAt??new Date($.addedAt).getTime(),z=`/workspace/${$.id}`;return Q1.jsxs("div",{className:"group flex min-w-0 flex-col gap-3",children:[Q1.jsxs("div",{className:"relative",children:[Q1.jsx(Sh,{workspaceId:$.id}),Q1.jsx(r7,{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&&Q1.jsxs(o1,{children:[Q1.jsx(n1,{render:Q1.jsx(r7,{href:V8("moi:/chat",{workspaceId:$.id}),"aria-label":`Chat in ${Z}`,style:K9(H),className:"absolute right-3 bottom-3 rounded-lg outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:Q1.jsx(J3,{preset:B,color:"primary",animated:Q,expression:Q?"thinking":void 0,size:48,className:"drop-shadow-sm drop-shadow-primary/20"})})}),Q1.jsx(s1,{children:"Chat"})]})]}),Q1.jsxs(r7,{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:[Q1.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 font-sans",style:K9(H),children:[Q1.jsx(e6,{icon:$.icon,workspaceType:$.type,workspaceTheme:H,className:"size-4 shrink-0 rounded-xs"}),Q1.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:Z})]}),Q1.jsx("span",{className:"text-xs text-muted-foreground",children:C60(X)})]})]})}function T60({suggestion:$,onAdd:Z}){let{path:J,types:H}=$,B=R$($);return Q1.jsxs("li",{className:"flex items-center gap-2 border-b border-border px-1 py-3",children:[Q1.jsx(by,{types:H}),Q1.jsx("span",{className:"shrink-0 text-sm font-medium text-foreground",children:B}),Q1.jsx("span",{title:J,className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:$.displayPath??J}),Q1.jsxs(P0,{variant:"outline",size:"sm",onClick:()=>Z($),children:[Q1.jsx(a2,{stroke:1.75}),"Add"]})]})}function C60($){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 yK=P(c(),1);function yh(){return yK.jsx(LK,{showWorkspaces:!1,children:yK.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:yK.jsx(kh,{})})})}var nJ=P(m(),1);var xK=5000,hK=120;var E60="</moi-attachments>";function DL($){if(!l9($)||typeof $.label!=="string")return null;let Z=$.label.trim();if(!Z||Z.length>hK||typeof $.text!=="string"||!$.text.trim()||$.text.length>xK)return null;return{label:Z,text:$.text}}function xh($){return Array.isArray($)&&$.every((Z)=>l9(Z)&&Z.purpose===void 0&&(Z.source===void 0||typeof Z.source==="string"&&Z.source.length>0)&&DL(Z)!==null)}function hh($){return $==="annotation"||$==="sketch"}function b60($){return Array.isArray($)&&$.every((Z)=>{if(!l9(Z))return!1;if(Z.type==="text")return xh([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&&(!hh(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 VL($){let Z=[],J=!1,H=$.replace(/<moi-attachments>([^<]*)<\/moi-attachments>/g,(B,Q)=>{try{let X=JSON.parse(Q),z=l9(X)&&X.version===1&&Array.isArray(X.attachments)?X.attachments.map((G)=>l9(G)?{type:"text",source:G.source,label:G.label,text:G.text}:G):X;if(!b60(z))return B;return Z.push(...z),J=!0,""}catch{return B}});return{text:J?H.trim():$,attachments:Z}}function LL($){return $.type==="file"?$.path.split(/[\\/]/).at(-1):$.label}function vh($,Z){let{source:J}=$,H=LL($);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 w60($){return VL($).text}function fh($){let Z=w60($),J=Z.search(/<moi-attachments>\s*(?:\[|\{"version":1,"attachments":\[)/);return(J<0||Z.includes(E60,J)?Z:Z.slice(0,J)).trimEnd()}var fQ=10;function vK($){return $.length>fQ?`A message can have at most ${fQ} attachments.`:null}var gh=33554432;function mh($){return typeof $==="string"&&$.length>0&&!/[\\:\0]/.test($)&&$.split("/").every((Z)=>Z.length>0&&!Z.startsWith("."))}var dh=P(m(),1);var uh=()=>({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 S60=({kind:$,name:Z})=>`${$}:${Z}`,R60=1000,ML={cooldownMs:2000,windowMs:60000,maxPerWindow:10,maxKeys:64};function I60($){let Z=uh(),J=pG(ML),H=(X,z)=>{W8($,{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 ${ML.cooldownMs/1000}s ago. Call it from an event handler, not during render.`,`sendChatMessage() for "${G}" was dropped: more than ${ML.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=S60(X);return{bridge:{get collab(){return G?mD:void 0},addChatAttachment(K){if(!G)return;try{let F=ph(K,U);Z.emit("addChatAttachment",F)}catch(F){let W=PL(F);a1.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",V8(K))}catch(F){H(X,`navigate() was dropped: ${PL(F)}`)}},resolveUrl(K){if(!G)return"";return V8(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(!l9(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>R60)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)=>ph(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=PL(W);a1.add({title:"Couldn’t send message",description:q,type:"error"}),H(X,`sendChatMessage() was dropped: ${q}`)}}},dispose:()=>{G=!1}}}}}function ph($,Z){if(!l9($))throw Error("This attachment isn’t supported");if($.type==="text"){let J=DL($);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>hK)throw Error(`Attachment labels can be up to ${hK} characters`);if(typeof $.text!=="string"||!$.text.trim())throw Error("Add some text to this attachment");if($.text.length>xK)throw Error(`Text attachments can be up to ${xK.toLocaleString("en-US")} characters`)}else if($.type==="file"){if($.file instanceof File&&$.path===void 0){if($.file.size>gh)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 PL($){return $ instanceof Error?$.message:String($)}var ch=new Map;function gK($){let Z=ch.get($);if(!Z)Z=I60($),ch.set($,Z);return Z}function mK($,Z,J){let H=N5(J);dh.useEffect(()=>{let B=(...Q)=>H.current(...Q);return gK($).on(Z,B)},[$,Z,H])}var fK=new Map;function lh($,Z,J,H,B=""){let Q=$.__attachBridge;if(typeof Q!=="function")return;fK.get(J)?.();let{bridge:X,dispose:z}=gK(Z).connect(H,B);fK.set(J,z),Q(X)}function _L($){let Z=fK.get($);if(!Z)return;fK.delete($),Z()}function uK($,Z,J){return`${$}/${Z}/${J}`}var oJ=new Map,gQ=new Map;function k60($,Z,J){return oJ.get(uK($,Z,J))??0}var y60="module";function ih($,Z,J){return`/api/workspaces/${Z}/${$}/${J}/${y60}?v=${k60($,Z,J)}`}function pK($,Z,J){return`/api/workspaces/${Z}/${$}/${J}`}function Q7($,Z){return`${$}/${Z}`}function rh($){return gQ.get($)}function ah($,Z){gQ.set($,Z)}function cK($,Z,J){let H=uK($,Z,J);gQ.delete(H),oJ.set(H,(oJ.get(H)??0)+1),_L(H)}function OL($){let Z=`${$}/`;for(let J of new Set([...gQ.keys(),...oJ.keys()]))if(J.startsWith(Z))gQ.delete(J),oJ.set(J,(oJ.get(J)??0)+1),_L(J)}var x60={kind:"widget",segment:"widgets",shouldReload:($,Z)=>$.type==="widget:updated"&&$.name===Z||$.type==="applets:refresh"&&$.only!=="views"},h60={kind:"view",segment:"views",shouldReload:($,Z)=>$.type==="view:updated"&&$.name===Z||$.type==="applets:refresh"&&$.only!=="widgets"};function v60($,Z,J,H){let{segment:B}=$,Q=uK(B,Z,J),X=rh(Q);if(X)return X;let z=import(ih(B,Z,J)).then((G)=>{if(!G.default)throw Error(`"${J}" has no default export`);return lh(G,Z,Q,{kind:$.kind,name:J},H),G.default});return ah(Q,z),z}function oh($,Z){let J=m1(),{base:H}=C2(),[B,Q]=nJ.useState({status:"loading",version:0}),X=nJ.useCallback(()=>{Q((z)=>({status:"loading",version:z.version})),v60($,J,Z,H).then((z)=>Q((G)=>({status:"ready",Component:z,version:G.version+1}))).catch((z)=>{W8(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 nJ.useEffect(()=>{X()},[X]),L2((z)=>{if($.shouldReload(z,Z))cK($.segment,J,Z),X()}),B}function nh($){return oh(x60,$)}function sh($){return oh(h60,$)}function th(){let $=m1();L2((Z)=>{if(Z.type==="view:updated")cK("views",$,Z.name);else if(Z.type==="widget:updated")cK("widgets",$,Z.name);else if(Z.type==="applets:refresh"){if(Z.only!=="views")OL("widgets");if(Z.only!=="widgets")OL("views")}})}var g8=P(m(),1);var jL={id:"_moi_views",config:{colSpan:4,rowSpan:1},defaultPosition:{x:0,y:0}},TL=[jL],f60=new Set(TL.map(($)=>$.id));function H3($){return f60.has($)}function eh($){return[...TL,...$]}function $v(){return TL.map(($)=>({i:$.id,...$.defaultPosition}))}function dK(){return{open:["overview","scratchpad"],active:"overview"}}function lK($){let Z=dK();if(!$||typeof $!=="object")return Z;let J=$,H=Array.isArray(J.open)?J.open.filter(d9).filter((X,z,G)=>G.indexOf(X)===z):[];if(H.length===0)return Z;let B=["overview",...H.filter((X)=>X!=="overview")],Q=d9(J.active)&&B.includes(J.active)?J.active:"overview";return{open:B,active:Q}}function Zv(){return{version:1,widgetGrid:$v(),layoutMode:"split",tabs:dK()}}function Jv($,Z,J){let{tabs:H,...B}=$,Q=Z.tabs??J?.tabs;return Q===void 0?B:{...B,tabs:Q}}var Xv=P(c(),1),CL=g8.createContext(null);function y1(){let $=g8.useContext(CL);if(!$)throw Error("useWorkspaceLayoutCtx must be used within <WorkspaceLayoutProvider>");return $}function Bv(){return g8.useContext(CL)?.layout.theme}function Hv($){let{cwd:Z,name:J,provider:H,agentId:B,...Q}=$;return Q}function Qv({id:$,children:Z}){let J=$1(),H=Sx($),B=kx($),Q=N5(B.mutate),X=g8.useRef(null),z=g8.useRef(null),G=g8.useCallback((Y)=>{let K=O0.layout($),F=J.getQueryData(K);if(!F)return;let W={...F,...Y};if(J.setQueryData(K,W),z.current=Jv(Hv(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=g8.useMemo(()=>({layout:H.data?Hv(H.data):Zv(),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 Xv.jsx(CL,{value:U,children:Z})}var e2=P(m(),1);var rK=P(c(),1);function iK({visible:$,editing:Z,canvasRef:J,width:H,height:B,pointerProps:Q,onKeyDown:X,children:z}){if(!$)return null;return rK.jsxs("div",{className:"absolute inset-0 animate-in duration-100 fade-in",onKeyDown:X,children:[rK.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 Z1=P(m(),1);function bL($,Z,J){let H=Math.max($,Z);if(H<=0)return 1;return Math.min(Math.max(J,1),1568/H)}function g60($){return new Promise((Z,J)=>{setTimeout(()=>J(Error("Annotation capture timed out")),$)})}function m60($){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 zv($){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-hvh9f5h0.js"),Q=async()=>{let X=await J($,{width:Math.round(Z.width),height:Math.round(Z.height),scale:bL(Z.width,Z.height,window.devicePixelRatio),type:"image/png",backgroundColor:getComputedStyle($).backgroundColor,timeout:1000,features:{restoreScrollPosition:!0},style:{overflow:"hidden"},onCloneEachNode:m60});try{return await B(X)}finally{H(X)}};return Promise.race([Q(),g60(1e4)])}var wL={past:[],present:[],future:[]};function u60($,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 Yv($,Z,J){let H=$.getBoundingClientRect();return{x:(Z-H.left)/H.width*$.width,y:(J-H.top)/H.height*$.height}}function Gv($,Z){let J=Z.getCoalescedEvents?.()??[];return(J.length>0?J:[Z]).map((B)=>Yv($,B.clientX,B.clientY))}var p60={canUndo:!1,canRedo:!1,hasStrokes:!1};function mQ($){return Z1.useSyncExternalStore($.subscribeHistory,$.getHistoryState,$.getHistoryState)}function Uv($,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 Kv($,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)Uv($,U,H.haloColor,z);for(let U of G)Uv($,U,H.strokeColor,X)}function c60($,Z,J,H=null){let B=$.getContext("2d");if(!B)return;B.clearRect(0,0,$.width,$.height),Kv(B,$.width,$.height,Z,J,H)}function d60($,Z,J){let H=$.getContext("2d");if(!H)return;H.clearRect(0,0,$.width,$.height),H.drawImage(Z.snapshot,0,0,$.width,$.height),Kv(H,$.width,$.height,Z,J)}function l60($){return new Promise((Z,J)=>{$.toBlob((H)=>{if(H)Z(H);else J(Error("Could not export drawing"))},"image/png")})}function i60($,Z,J){let H=$.getBoundingClientRect();if(H.width<=0||H.height<=0)return null;let B=getComputedStyle($),Q=bL(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 r60($){return $ instanceof HTMLInputElement||$ instanceof HTMLTextAreaElement||$ instanceof HTMLElement&&$.isContentEditable}function aK({mode:$="annotation",onChange:Z,onEditingStart:J,onFinish:H}={}){let B=Z1.useRef(null),Q=Z1.useRef(null),[X,z]=Z1.useState(null),G=Z1.useRef(X),[U,Y]=Z1.useState(!1),K=Z1.useRef(!1),F=Z1.useRef(wL),W=Z1.useRef(p60),q=Z1.useRef(new Set),N=Z1.useRef(0),D=Z1.useRef(null),A=Z1.useRef(null),V=Z1.useRef(0),L=Z1.useRef(0),O=Z1.useRef(null),M=Z1.useRef(null),[_,w]=Z1.useState(!1),C=Z1.useRef(!1),[b,T]=Z1.useState(!1),I=Z1.useRef(!1),S=N5(Z),R=N5(J),j=N5(H),y=Z1.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()},[]),k=Z1.useCallback((s)=>{return q.current.add(s),()=>{q.current.delete(s)}},[]),x=Z1.useCallback(()=>W.current,[]),v=Z1.useCallback((s,a=null)=>{if(V.current)cancelAnimationFrame(V.current),V.current=0;let e=Q.current,$0=G.current;if(e&&$0)c60(e,$0,s,a)},[]),f=Z1.useCallback(()=>{if(V.current)return;V.current=requestAnimationFrame(()=>{V.current=0,v(F.current.present,D.current)})},[v]),E=Z1.useCallback((s,a,e)=>{let $0=O.current;if($0?.sessionId===s.id&&$0.historyVersion===e)return Promise.resolve($0.blob);let X0=M.current;if(X0?.sessionId===s.id&&X0.historyVersion===e)return X0.promise;if(a.length===0)return O.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,d60(_0,s,a);let M0=l60(_0).then((A0)=>{if(G.current?.id!==s.id||N.current!==e)return A0;return O.current={sessionId:s.id,historyVersion:e,blob:A0},S.current?.(A0),A0}).catch(()=>{if(G.current?.id===s.id&&N.current===e)a1.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=Z1.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=Z1.useCallback((s)=>{let a=G.current;if(!a||I.current)return;let e=u60(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=Z1.useCallback((s)=>{F.current=wL,N.current=0,O.current=null,M.current=null,D.current=null,A.current=null,y(),G.current=s,z(s)},[y]),d=Z1.useCallback(()=>{if(K.current)return;K.current=!0,Y(!0),R.current?.()},[R]),o=Z1.useCallback(async()=>{let s=B.current;if(!s||G.current||C.current)return!1;let a=++L.current;C.current=!0,w(!0);try{let e=await zv(s);if(a!==L.current||B.current!==s)return!1;let $0=s.getBoundingClientRect(),X0=getComputedStyle(s),_0={id:a,snapshot:e,strokeColor:X0.getPropertyValue("--primary").trim()||"#2563eb",haloColor:X0.getPropertyValue("--background").trim()||"#ffffff",targetWidth:$0.width,targetHeight:$0.height};return h(_0),d(),!0}finally{if(a===L.current)C.current=!1,w(!1)}},[d,h]),p=Z1.useCallback(()=>{let s=G.current;L.current+=1,C.current=!1,I.current=!1,w(!1),T(!1),K.current=!1,Y(!1),l(),z(null),F.current=wL,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=Z1.useCallback(async()=>{let s=G.current;if(!s)return null;return l(),E(s,F.current.present,N.current)},[l,E]),n=Z1.useCallback(async()=>{return K.current=!1,Y(!1),i()},[i]),Z0=Z1.useCallback(async()=>{let s=G.current;if(!s||I.current)return null;I.current=!0,T(!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 j.current?.($0)}finally{if(G.current?.id===s.id)L.current+=1,K.current=!1,Y(!1),G.current=null,z(null),I.current=!1,T(!1)}return $0},[l,E,j]),J0=Z1.useCallback(()=>r({type:"undo"}),[r]),U0=Z1.useCallback(()=>r({type:"redo"}),[r]),z0=Z1.useCallback(()=>r({type:"clear"}),[r]),Q0=Z1.useMemo(()=>({onPointerDown:(s)=>{if(I.current||!s.isPrimary||s.pointerType==="mouse"&&s.button!==0)return;if(!G.current&&$==="sketch"){let a=B.current;if(!a)return;let e=i60(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:[Yv(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(...Gv(s.currentTarget,s.nativeEvent)),f()},onPointerUp:(s)=>{if(s.pointerId!==A.current||!D.current)return;let a=D.current;if(a.points.push(...Gv(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,f]),N0=Z1.useCallback((s)=>{if(r60(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]);Z1.useLayoutEffect(()=>{if(!X)return;if(v(F.current.present,D.current),U)Q.current?.focus()},[U,v,X]),Z1.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]),Z1.useEffect(()=>()=>{if(L.current+=1,K.current=!1,G.current=null,V.current)cancelAnimationFrame(V.current)},[]);let D0=Z1.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:k,getHistoryState:x}),[U,$,X,_,b,o,J0,U0,z0,i,n,Z0,p,k,x]),F0=Z1.useMemo(()=>({visible:D0.visible,editing:D0.active,canvasRef:Q,width:X?.snapshot.width??1,height:X?.snapshot.height??1,pointerProps:Q0,onKeyDown:N0}),[D0.active,D0.visible,X,Q0,N0]);return Z1.useMemo(()=>({targetRef:B,controls:D0,layerProps:F0}),[D0,F0])}var $2=P(c(),1);function nK({controls:$,title:Z,busy:J,onComplete:H}){let{canUndo:B,canRedo:Q,hasStrokes:X}=mQ($);return $2.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:[$2.jsx("span",{className:"mr-2 ml-2 text-sm font-medium",children:Z}),$2.jsxs("div",{className:"flex gap-1",children:[$2.jsxs(o1,{children:[$2.jsx(n1,{render:$2.jsx(P0,{type:"button",variant:"outline",size:"icon-sm",onClick:$.undo,disabled:J||!B,"aria-label":"Undo",children:$2.jsx(oK,{stroke:1.75})})}),$2.jsx(s1,{children:"Undo"})]}),$2.jsxs(o1,{children:[$2.jsx(n1,{render:$2.jsx(P0,{type:"button",variant:"outline",size:"icon-sm",onClick:$.redo,disabled:J||!Q,"aria-label":"Redo",children:$2.jsx(Fv,{stroke:1.75})})}),$2.jsx(s1,{children:"Redo"})]}),$2.jsx(P0,{type:"button",variant:"outline",size:"sm",onClick:$.clear,disabled:J||!X,children:"Clear"})]}),$2.jsx(I4,{mode:"popLayout",initial:!1,children:$2.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:$2.jsx(P0,{type:"button",variant:X?"default":"ghost",size:"icon-sm",onClick:H,disabled:J,"aria-label":"Complete",className:B0(!X&&"text-muted-foreground"),children:X?$2.jsx(a4,{stroke:1.75}):$2.jsx(e5,{stroke:1.75})})},X?"complete":"cancel")})]})}var Z2=P(m(),1);async function uQ($,Z){let J=`/api/workspaces/${$}/uploads`;if(typeof Z==="string")return B1(`${J}/from-path`,_5("POST",{path:Z}),"The file couldn’t be uploaded");let H=new FormData;H.append("files",Z);let[B]=await B1(J,{method:"POST",body:H},"The file couldn’t be uploaded");if(!B)throw Error("The upload didn’t finish");return B}function SL({workspaceId:$,sessionId:Z}){if((I1.getState().attachments[q8($,Z)]??[]).length<fQ)return!0;return a1.add({id:"draft-attachment-limit",title:"Attachment limit reached",description:`You can attach up to ${fQ} items. Remove one to add another.`,type:"error"}),!1}function Wv($,Z){for(let J of Z)qv($,J)}async function qv({workspaceId:$,sessionId:Z},J,H,B){if(!SL({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();I1.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 uQ($,J);I1.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";I1.getState().removeAttachment($,z),a1.add({title:`Couldn’t add ${X}`,description:U,type:"error"}),H?.(U)}}function Nv($,Z){if(Z.type==="text"){let{source:J,label:H,text:B}=Z;return a60($,{source:J,label:H,text:B}),Promise.resolve()}return qv($,Z.file??Z.path,(J)=>{W8($.workspaceId,{source:"runtime",message:`addChatAttachment() from ${Z.source}: ${J}`})},Z.source)}function pQ({workspaceId:$,sessionId:Z,localId:J,purpose:H,source:B,blob:Q}){let X=H==="sketch"?"Sketch":"Annotation",z=I1.getState(),G=cG(z.attachments,$,J);if(!G&&!SL({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 sK($){let{workspaceId:Z,localId:J,purpose:H,blob:B,isCurrent:Q}=$,X=H==="sketch"?"Sketch":"Annotation";if(!pQ($))return;I1.getState().updateAttachment(Z,J,{status:"uploading"});try{let z=await uQ(Z,new File([B],`${X}.png`,{type:"image/png"}));if(!Q())return;I1.getState().updateAttachment(Z,J,{status:"ready",upload:z,mediaType:z.mediaType})}catch{if(!Q())return;I1.getState().removeAttachment(Z,J)}}function a60({workspaceId:$,sessionId:Z},J){if(!SL({workspaceId:$,sessionId:Z}))return;I1.getState().addAttachments($,Z,[{kind:"text",localId:crypto.randomUUID(),...J}])}function Av({workspaceId:$,sessionId:Z,activeTab:J,mode:H,available:B,closePopup:Q,openPopup:X}){let z=Z2.useRef(null),G=Z2.useRef(new Map),U=N5(Q),Y=N5(X),K=Z2.useCallback((j)=>{let y=z.current;if(!y)return;if(!j){I1.getState().removeAttachment(y.workspaceId,y.attachmentId);return}pQ({workspaceId:y.workspaceId,sessionId:y.sourceSessionId,localId:y.attachmentId,purpose:"annotation",source:y.source,blob:j})},[]),F=Z2.useCallback(async(j)=>{let y=z.current;if(!y)return;z.current=null;let k=(G.current.get(y.attachmentId)??0)+1;G.current.set(y.attachmentId,k);let x=()=>G.current.get(y.attachmentId)===k,v=await j;if(!v||!x())return;await sK({workspaceId:y.workspaceId,sessionId:y.sourceSessionId,localId:y.attachmentId,purpose:"annotation",source:y.source,blob:v,isCurrent:x})},[]),W=Z2.useCallback(async(j)=>{let y=z.current;if(await F(j),y?.origin==="popup")Y.current()},[Y,F]),q=aK({onChange:K,onFinish:W}),{controls:N}=q,{active:D,starting:A,open:V,finish:L,flush:O,cancel:M}=N;Z2.useLayoutEffect(()=>()=>{if(z.current)F(O())},[O,F]);let _=Z2.useCallback(async(j)=>{if(!B||D||A)return;let y={workspaceId:$,sourceSessionId:Z,source:J,origin:j,attachmentId:crypto.randomUUID()};z.current=y;try{if(!await V()){if(z.current===y)z.current=null;return}if(j==="popup")U.current()}catch{if(z.current!==y)return;z.current=null,a1.add({title:"Couldn’t capture this page",type:"error"})}},[D,J,B,U,V,Z,A,$]),w=Z2.useCallback(async()=>{let j=z.current?F(O()):void 0;await M(),await j},[M,O,F]),C=Z2.useCallback((j)=>{let y=(G.current.get(j)??0)+1;if(G.current.set(j,y),I1.getState().removeAttachment($,j),z.current?.attachmentId===j)z.current=null,M()},[M,$]),b=Z2.useCallback(async()=>{if(A){await w();return}await L()},[w,L,A]),T=Z2.useCallback(()=>{if(D||A)b();else _("docked")},[D,b,_,A]),I=Z2.useCallback(()=>{if(D||A)b();else _("popup")},[D,b,_,A]);Z2.useEffect(()=>{let j=z.current;if(!j)return;let y=j.origin==="docked"?"split":"fullscreen";if(j.workspaceId!==$||j.sourceSessionId!==Z||j.source!==J||H!==y||!B)w()},[J,B,w,H,Z,$]);let S=Z2.useMemo(()=>B?{active:D||A,finish:b,onRemove:C,onToggle:T}:void 0,[B,D,A,b,C,T]),R=Z2.useMemo(()=>B?{active:D||A,finish:b,onRemove:C,onToggle:I}:void 0,[B,D,A,b,C,I]);return Z2.useMemo(()=>({...q,docked:S,popup:R}),[q,S,R])}var J8=P(m(),1);var m8=P(c(),1);function RL($){if(!$)return;$.focus();let Z=$.value.length;$.setSelectionRange(Z,Z)}function Vv({composerRef:$,className:Z,onMouseDown:J,children:H,...B}){return m8.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;RL($.current)},className:B0("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 Lv({textareaRef:$,className:Z,...J}){return m8.jsx("textarea",{...J,ref:$,className:B0("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 Mv({className:$,children:Z,...J}){return m8.jsx("div",{...J,className:B0("flex items-center justify-end gap-3",$),children:Z})}function o60($){if($.status==="checking")return"Checking agent status…";return}function cQ($,Z,J){return $&&!Z&&J.status==="available"}function Pv({label:$,hasContent:Z,busy:J=!1,loading:H=!1,availability:B}){let Q=cQ(Z,J||H,B),X=o60(B),z=m8.jsx(P0,{type:"submit",size:"icon",disabled:!Q,"aria-label":$,children:H?m8.jsx(r2,{}):m8.jsx(Dv,{stroke:1.5})});if(H||!X)return z;return m8.jsxs(o1,{children:[m8.jsx(n1,{render:m8.jsx("span",{className:"inline-flex",children:z})}),m8.jsx(s1,{className:"max-w-64 text-center",children:X})]})}var L8=P(m(),1),n60=48;function _v($,Z){let J=L8.useRef(!0),[H,B]=L8.useState(!0),Q=L8.useCallback((G)=>{J.current=G,B((U)=>U===G?U:G)},[]),X=L8.useCallback((G="auto")=>{let U=$.current;if(!U)return;Q(!0),U.scrollTo({top:U.scrollHeight,behavior:G})},[$,Q]),z=L8.useCallback(()=>{let G=$.current;if(!G)return;Q(!1),G.scrollTo({top:0,behavior:"auto"})},[$,Q]);return L8.useEffect(()=>{let G=$.current;if(!G)return;let U=()=>{let Y=G.scrollHeight-G.scrollTop-G.clientHeight;Q(Y<=n60)};return G.addEventListener("scroll",U,{passive:!0}),()=>G.removeEventListener("scroll",U)},[$,Q]),L8.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()},[$]),L8.useLayoutEffect(()=>{X("auto")},[Z,X]),{atBottom:H,scrollToBottom:X,scrollToTop:z}}function s60($){return $.origin.kind!=="replay"&&$.origin.kind!=="synthetic"&&$.origin.kind!=="subagent-prompt"}function Ov($,Z){let J=$.meta||Z.meta?{...$.meta,...Z.meta}:void 0;return{...$,parts:[...$.parts,...Z.parts],timestamp:Z.timestamp??$.timestamp,meta:J}}function jv($,Z){if(!Z)return $;let J=$.at(-1);if(J?.role==="assistant")return[...$.slice(0,-1),Ov(J,Z)];return[...$,Z]}function Tv($){let Z=[];for(let J of $){if(!s60(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]=Ov(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 IL($){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 Cv($){if(!$)return;let Z=Date.parse($);return Number.isNaN(Z)?void 0:Z}function Ev($,Z){let J=Z.filter((G)=>IL(G)!==null);if(J.length===0)return $.map((G)=>({kind:"turn",turn:G}));let H=[],B=[];for(let G of J){let U=Cv(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,Cv(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 J2=P(c(),1);function sJ({label:$,icon:Z,onRemove:J,previewUrl:H,loading:B,className:Q,children:X,...z}){return J2.jsxs("div",{...z,className:B0("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&&J2.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center bg-background/70",children:J2.jsx(d5,{size:16,stroke:1.75,className:"animate-spin text-muted-foreground"})}),H?J2.jsx(e60,{label:$,previewUrl:H,onRemove:J}):J2.jsx(t60,{label:$,icon:Z,onRemove:J}),X]})}function t60({label:$,icon:Z,onRemove:J}){return J2.jsxs(J2.Fragment,{children:[J?J2.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:[J2.jsx(Z,{stroke:1.75,className:"group-focus-within:hidden group-hover:hidden"}),J2.jsx(e5,{stroke:1.75,className:"hidden group-focus-within:block group-hover:block"})]}):J2.jsx("span",{className:"flex size-6 shrink-0 items-center justify-center",children:J2.jsx(Z,{size:16,stroke:1.75})}),J2.jsx("span",{className:"truncate",children:$})]})}function e60({label:$,previewUrl:Z,onRemove:J}){return J2.jsxs(J2.Fragment,{children:[J2.jsx("img",{src:Z,alt:$,className:"size-full object-cover"}),J&&J2.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:J2.jsx(e5,{stroke:1.75})})]})}var wv=P(c(),1);function dQ({label:$,onRemove:Z}){return wv.jsx(sJ,{label:$,icon:bv,onRemove:Z})}var z7={};I5(z7,{createHandle:()=>$f,Viewport:()=>ev,Trigger:()=>cv,Root:()=>fv,Positioner:()=>lv,Portal:()=>uv,Popup:()=>rv,Handle:()=>JF,Backdrop:()=>sv,Arrow:()=>ov});var vv=P(m(),1);var tK=P(m(),1),kL=tK.createContext(void 0);function q4($){let Z=tK.useContext(kL);if(Z===void 0&&!$)throw Error(k0(50));return Z}var Rv=P(m(),1);var Sv=600,eK=300;var Iv={...f9,instantType:($)=>$.instantType,adaptiveOrigin:($)=>$.adaptiveOrigin,closeDelay:($)=>$.closeDelay};class yL extends g2{constructor($,Z,J){let H=new R2;super(yv($,H,Z,J),xv(H),Iv)}setOpen=($,Z)=>{let{inlineRectCoordsRef:J}=this.context;KG(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)RA(J,Z.trigger,H.clientX,H.clientY)}})}}function kv(){let $=new R2;return new H9(Object.freeze(yv(void 0,$)),Object.freeze(xv($)),Iv)}function yv($,Z,J,H=!1){return{...v9(Z,J,H),instantType:void 0,adaptiveOrigin:void 0,closeDelay:eK,...$}}function xv($){return{popupRef:Rv.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:$,inlineRectCoordsRef:{current:void 0}}}var X7=P(c(),1);function hv($){let{open:Z,defaultOpen:J=!1,onOpenChange:H,onOpenChangeComplete:B,actionsRef:Q,handle:X,triggerId:z,defaultTriggerId:G=null,children:U}=$,Y=q6((A,V)=>new yL({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");y9(Y,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:N}=x9(K,Y,()=>{Y.context.inlineRectCoordsRef.current=void 0});H0(()=>{if(K){if(F==null)Y.set("payload",void 0)}},[Y,F,K]),vv.useImperativeHandle(Q,()=>({unmount:N,close:()=>Y.setOpen(!1,w0(K0.imperativeAction))}),[N,Y]);let D=K||W;return X7.jsxs(kL.Provider,{value:Y,children:[X&&X7.jsx(I9,{handle:X,store:Y}),D&&X7.jsx($70,{store:Y}),typeof U==="function"?U({payload:q}):U]})}function $70({store:$}){let Z=$.useState("floatingRootContext"),J=e8(Z);return h9($,{activeTriggerProps:J.reference,inactiveTriggerProps:J.trigger,popupProps:J.floating}),null}var fv=r8(function(Z){if(q4(!0))return X7.jsx(hv,{...Z});return X7.jsx(z$,{children:X7.jsx(hv,{...Z})})});var mv=P(m(),1);var $F=P(m(),1),xL=$F.createContext(void 0);function gv(){let $=$F.useContext(xL);if($===void 0)throw Error(k0(48));return $}var hL=P(c(),1),uv=mv.forwardRef(function(Z,J){let{keepMounted:H=!1,...B}=Z;if(!(q4().useState("mounted")||H))return null;return hL.jsx(xL.Provider,{value:H,children:hL.jsx(vZ,{ref:J,...B})})});var pv=P(m(),1);var cv=T9(function(Z,J){let{render:H,className:B,delay:Q,closeDelay:X,id:z,payload:G,handle:U,style:Y,...K}=Z,F=q4(!0),q=g9(U)??F;if(!q)throw Error(k0(89));let N=t0(z),D=q.useState("isTriggerActive",N),A=q.useState("isOpenedByTrigger",N),V=q.useState("floatingRootContext"),L=q.context.inlineRectCoordsRef,O=pv.useRef(null),M=Q??Sv,_=X??eK,{registerTrigger:w,isMountedByThisTrigger:C}=k9(N,O,q,{payload:G,closeDelay:_}),b=Z9(V,{mouseOnly:!0,move:!1,handleClose:J9(),delay:()=>({open:M,close:_}),triggerElementRef:O,isActiveTrigger:D,isClosing:()=>q.select("transitionStatus")==="ending"}),T=K$(V,{delay:M}),I={open:A},S=q.useState("triggerProps",C),R=fC(L,A);return G0("a",Z,{state:I,ref:[J,w,O],props:[b,T.reference,S,R,{id:N},K],stateAttributesMapping:C9})});var dv=P(m(),1);var ZF=P(m(),1),vL=ZF.createContext(void 0);function tJ(){let $=ZF.useContext(vL);if($===void 0)throw Error(k0(49));return $}var fL=P(c(),1),lv=dv.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=S9,style:A,...V}=Z,L=q4(),O=gv(),M=E3(),_=L.useState("open"),w=L.useState("mounted"),C=L.useState("floatingRootContext"),b=L.useState("instantType"),T=L.useState("transitionStatus"),I=L.useState("adaptiveOrigin"),S=L.context.inlineRectCoordsRef,R=u9({anchor:Q,floatingRootContext:C,positionMethod:X,mounted:w,side:z,sideOffset:U,align:G,alignOffset:Y,arrowPadding:W,collisionBoundary:K,collisionPadding:F,sticky:q,disableAnchorTracking:N,keepMounted:O,nodeId:M,collisionAvoidance:D,adaptiveOrigin:I,inline:gC(S)}),j=R.update;H0(()=>{if(_&&w)j()},[_,w,j]);let y={open:_,side:R.side,align:R.align,anchorHidden:R.anchorHidden,instant:b},k=c9(Z,y,{styles:R.positionerStyles,transitionStatus:T,props:V,refs:[J,L.useStateSetter("positionerElement")],hidden:!w,inert:!_});return fL.jsx(vL.Provider,{value:R,children:fL.jsx(X$,{id:M,children:k})})});var iv=P(m(),1);var rv=iv.forwardRef(function(Z,J){let{className:H,render:B,style:Q,...X}=Z,z=q4(),{side:G,align:U}=tJ(),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 V5({open:Y,ref:z.context.popupRef,onComplete(){if(Y)z.context.onOpenChangeComplete?.(!0)}}),w3(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:[R9,W,p9(F),X],stateAttributesMapping:J4})});var av=P(m(),1);var ov=av.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=q4(),{arrowRef:G,side:U,align:Y,arrowUncentered:K,arrowStyles:F}=tJ(),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:U8})});var nv=P(m(),1);var sv=nv.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=q4(),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:J4})});var tv=P(m(),1);var ev=tv.forwardRef(function(Z,J){let{render:H,className:B,style:Q,children:X,...z}=Z,G=q4(),U=tJ(),Y=G.useState("instantType"),{children:K,state:F}=D6({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:A6})});class JF extends $9{constructor(){super(kv(),"PreviewCard")}open($){this.openByTrigger($)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}function $f(){return new JF}var eJ=P(c(),1);function Zf({...$}){return eJ.jsx(z7.Root,{"data-slot":"hover-card",...$})}function Jf({...$}){return eJ.jsx(z7.Trigger,{"data-slot":"hover-card-trigger",...$})}function Hf({className:$,side:Z="bottom",sideOffset:J=4,align:H="center",alignOffset:B=0,...Q}){return eJ.jsx(y8,{portal:z7.Portal,"data-slot":"hover-card-portal",children:eJ.jsx(z7.Positioner,{align:H,alignOffset:B,side:Z,sideOffset:J,className:"isolate z-50",children:eJ.jsx(z7.Popup,{"data-slot":"hover-card-content",className:r0("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 g$=P(c(),1);function Bf({attachment:$,onRemove:Z}){let{previewUrl:J,purpose:H}=$,B=H==="sketch"?"Sketch":"Annotation";return g$.jsxs(Zf,{children:[g$.jsx(Jf,{render:g$.jsx(sJ,{tabIndex:0,label:B,icon:$H,onRemove:Z})}),J&&g$.jsx(Hf,{side:"top",align:"start",className:"w-60 max-w-[calc(100vw-2rem)] rounded-xl",children:g$.jsx("img",{src:J,alt:`${B} preview`,className:"max-h-72 w-full rounded-md object-contain"})})]})}var Xf=P(c(),1);function Qf({attachment:$,onRemove:Z}){return Xf.jsx(sJ,{label:$.label,icon:bJ,onRemove:Z,previewUrl:$.previewUrl,loading:$.status==="uploading",title:$.label,className:"max-w-52"})}var p$=P(m(),1);var UH=P(m(),1);var Z70=["fable","opus","sonnet","haiku"];function HF($,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 zf($){let Z=$.resolvedModel??$.value,J=Z70.findIndex((H)=>Z===H||Z.startsWith(`${H}[`)||Z.includes(`-${H}-`));return J===-1?void 0:J}function J70($,Z){if($===void 0&&Z===void 0)return 0;if($===void 0)return-1;if(Z===void 0)return 1;return $-Z}function H70($,Z){return J70(zf($),zf(Z))}var B70={"claude-code":H70};function Q70($,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 gL($,Z,J){if(Z&&$.includes(Z))return Z;if(J&&$.includes(J))return J;if($.includes("high"))return"high";return $[$.length-1]}function Gf($,Z,J){let H=gL($,Z,J);return H?$.indexOf(H):-1}function Uf($){return $.length>1}function Yf($,Z){if($.supportsFastMode!==!0)return!1;return Z??$.defaultFastMode??!1}function Kf($,Z){let J=B70[Z];return J?Q70($,J):$}function Ff($,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 e4={};I5(e4,{createHandle:()=>Kg,Viewport:()=>Xg,Trigger:()=>Bg,SubmenuTrigger:()=>Yg,SubmenuRoot:()=>ef,Separator:()=>Gg,Root:()=>TF,RadioItemIndicator:()=>rf,RadioItem:()=>lf,RadioGroup:()=>pf,Positioner:()=>mf,Portal:()=>vf,Popup:()=>yf,LinkItem:()=>If,Item:()=>Rf,Handle:()=>wF,GroupLabel:()=>wf,Group:()=>Ef,CheckboxItemIndicator:()=>jf,CheckboxItem:()=>Of,Backdrop:()=>Af,Arrow:()=>qf});var Wf=P(m(),1);var BF=P(m(),1),mL=BF.createContext(void 0);function N4($){let Z=BF.useContext(mL);if(Z===void 0&&!$)throw Error(k0(33));return Z}var QF=P(m(),1),uL=QF.createContext(void 0);function j5($){let Z=QF.useContext(uL);if(Z===void 0&&!$)throw Error(k0(36));return Z}var qf=Wf.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,{store:z}=j5(),{arrowRef:G,side:U,align:Y,arrowUncentered:K,arrowStyles:F}=N4(),q={open:z.useState("open"),side:U,align:Y,uncentered:K};return G0("div",Z,{ref:[G,J],stateAttributesMapping:U8,state:q,props:{style:F,"aria-hidden":!0,...X}})});var Nf=P(m(),1);var XF=P(m(),1),X70=XF.createContext(void 0);function G7($=!0){let Z=XF.useContext(X70);if(Z===void 0&&!$)throw Error(k0(25));return Z}var Af=Nf.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,{store:z}=j5(),G=z.useState("open"),U=z.useState("mounted"),Y=z.useState("transitionStatus"),K=z.useState("lastOpenChangeReason"),F=G7(),W={open:G,transitionStatus:Y};return G0("div",Z,{ref:F?.backdropRef?[J,F.backdropRef]:J,state:W,stateAttributesMapping:J4,props:[{role:"presentation",hidden:!U,style:{pointerEvents:K===K0.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},X]})});var YF=P(m(),1);var zF=P(m(),1),pL=zF.createContext(void 0);function Df(){let $=zF.useContext(pL);if($===void 0)throw Error(k0(30));return $}var JH=P(m(),1);var Vf=P(m(),1);function GF($){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=G7(!0),F=K!==void 0;return Vf.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&&!J5.os.mac&&W.button===2)return}if(z.current&&Q.context.allowMouseUpTriggerRef.current&&(!F||W.button===2)){if(G.type==="regular-item")ZH(z.current,W,{detail:1})}}}),[Z,J,H,U,B,Y,Q,X,z,K,F,G])}var U7={type:"regular-item"};function Y7($){let{closeOnClick:Z,disabled:J,highlighted:H,id:B,store:Q,typingRef:X=Q.context.typingRef,nativeButton:z,itemMetadata:G,nodeId:U}=$,Y=JH.useRef(null),{getButtonProps:K,buttonRef:F}=w5({disabled:J,focusableWhenDisabled:!0,native:z,composite:!0}),W=GF({closeOnClick:Z,highlighted:H,id:B,nodeId:U,store:Q,typingRef:X,itemRef:Y,itemMetadata:G}),q=JH.useCallback((D)=>{return Y2(W,{onMouseEnter(){if(G.type!=="submenu-trigger")return;G.setActive()}},D,K)},[W,K,G]),N=p2(Y,F);return JH.useMemo(()=>({getItemProps:q,itemRef:N}),[q,N])}var m$=P(m(),1);var UF=P(m(),1),cL=UF.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Lf(){return UF.useContext(cL)}function A4($={}){let{guess:Z,label:J,metadata:H,textRef:B,index:Q}=$,{register:X,unregister:z,subscribeMapChange:G,nextIndexRef:U}=Lf(),Y=m$.useRef(-1),[K,F]=m$.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=m$.useRef(null),N=m$.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 Mf="data-checked",Pf="data-unchecked";var K7={checked($){if($)return{[Mf]:""};return{[Pf]:""}},...G2};var _f=P(c(),1),Of=YF.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=A4({guess:!0,label:X}),D=N4(!0),A=t0(Q),{store:V}=j5(),L=V.useState("disabled"),O=G||L,M=V.useState("isActive",N.index),_=V.useState("itemProps"),[w,C]=F4({controlled:Y,default:K??!1,name:"MenuCheckboxItem",state:"checked"}),{getItemProps:b,itemRef:T}=Y7({closeOnClick:U,disabled:O,highlighted:M,id:A,store:V,nativeButton:z,nodeId:D?.context.nodeId,itemMetadata:U7}),I=YF.useMemo(()=>({disabled:O,highlighted:M,checked:w}),[O,M,w]);function S(j){let y=w0(K0.itemPress,j.nativeEvent,void 0,{preventUnmountOnClose:G1});if(F?.(!w,y),y.isCanceled)return;C((k)=>!k)}let R=G0("div",Z,{state:I,stateAttributesMapping:K7,props:[_,{role:"menuitemcheckbox","aria-checked":w,onClick:S},q,b],ref:[T,J,N.ref]});return _f.jsx(pL.Provider,{value:I,children:R})});var KF=P(m(),1);var jf=KF.forwardRef(function(Z,J){let{render:H,className:B,style:Q,keepMounted:X=!1,...z}=Z,G=Df(),U=KF.useRef(null),{transitionStatus:Y,mounted:K,setMounted:F}=S2(G.checked);V5({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:K7,props:{"aria-hidden":!0,...z},enabled:X||K})});var WF=P(m(),1);var FF=P(m(),1),lQ=FF.createContext(void 0);function Tf(){let $=FF.useContext(lQ);if($===void 0)throw Error(k0(31));return $}var Cf=P(c(),1),Ef=WF.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,[z,G]=WF.useState(void 0),U=G0("div",Z,{ref:J,props:{role:"group","aria-labelledby":z,...X}});return Cf.jsx(lQ.Provider,{value:G,children:U})});var bf=P(m(),1);var wf=bf.forwardRef(function(Z,J){let{render:H,className:B,style:Q,id:X,...z}=Z,G=t0(X),U=Tf();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 Sf=P(m(),1);var Rf=Sf.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=A4({guess:!0,label:X}),W=N4(!0),q=t0(Q),{store:N}=j5(),D=N.useState("disabled"),A=G||D,V=N.useState("isActive",F.index),L=N.useState("itemProps"),{getItemProps:O,itemRef:M}=Y7({closeOnClick:U,disabled:A,highlighted:V,id:q,store:N,nativeButton:z,nodeId:W?.context.nodeId,itemMetadata:U7});return G0("div",Z,{state:{disabled:A,highlighted:V},props:[L,K,O],ref:[M,J,F.ref]})});var qF=P(m(),1);var If=qF.forwardRef(function(Z,J){let{render:H,className:B,id:Q,label:X,closeOnClick:z=!1,style:G,...U}=Z,Y=qF.useRef(null),K=A4({guess:!0,label:X}),W=N4(!0)?.context.nodeId,q=t0(Q),{store:N}=j5(),D=N.useState("isActive",K.index),A=N.useState("itemProps"),V=N.context.typingRef,{getButtonProps:L,buttonRef:O}=w5({native:!1,composite:!0}),M=GF({closeOnClick:z,highlighted:D,id:q,nodeId:W,store:N,typingRef:V,itemRef:Y,itemMetadata:U7});function _(C){return Y2(M,C,L)}return G0("a",Z,{state:{highlighted:D},props:[A,U,_],ref:[Y,O,J,K.ref]})});var NF=P(m(),1);var kf=P(c(),1),yf=NF.forwardRef(function(Z,J){let{render:H,className:B,style:Q,finalFocus:X,...z}=Z,{store:G}=j5(),{side:U,align:Y}=N4(),K=QU(!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"),O=G.useState("rootId"),M=G.useState("floatingRootContext"),_=G.useState("floatingTreeRoot"),w=G.useState("closeDelay"),C=G.useState("hoverEnabled"),b=G.useState("disabled"),T=G.useState("openMethod"),I=V.type==="context-menu";V5({open:F,ref:G.context.popupRef,onComplete(){if(F)G.context.onOpenChangeComplete?.(!0)}}),NF.useEffect(()=>{function k(x){G.setOpen(!1,w0(x.reason,x.domEvent))}return _.events.on("close",k),()=>{_.events.off("close",k)}},[_.events,G]),w3(M,{enabled:C&&!b&&!I&&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},j=G0("div",Z,{state:R,ref:[J,G.context.popupRef,S],stateAttributesMapping:J4,props:[q,{onKeyDown(k){if(K&&B9.has(k.key))k.stopPropagation()}},p9(W),z,{"data-rootownerid":O}]}),y=V.type===void 0||I;if(A||V.type==="menubar"&&L!==K0.outsidePress)y=!0;return kf.jsx(G$,{context:M,openInteractionType:T,modal:I,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:j})});var hf=P(m(),1);var AF=P(m(),1),dL=AF.createContext(void 0);function xf(){let $=AF.useContext(dL);if($===void 0)throw Error(k0(32));return $}var lL=P(c(),1),vf=hf.forwardRef(function(Z,J){let{keepMounted:H=!1,...B}=Z,{store:Q,parent:X}=j5();if(!(Q.useState("mounted")||H))return null;let U=X.type==="menu"||X.type==="menubar"?"group":void 0;return lL.jsx(dL.Provider,{value:H,children:lL.jsx(B$,{ref:J,...B,portalOwnerRole:U})})});var B3=P(m(),1);var u3=P(m(),1);var ff=P(c(),1);function F7($){let{children:Z,elementsRef:J,labelsRef:H,onMapChange:B}=$,Q=Y0(B),[,X]=u3.useState(!1),z=$5(U70).current,G=$5(G70).current,U=u3.useRef(0),Y=u3.useRef(!0),K=u3.useRef(null),F=u3.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((C)=>{if(!F70(C))return;let b=null;for(let T of M){if(!T.isConnected)continue;if(b&&gf(b,T)>0){_.disconnect(),W();return}b=T}});F.current=_;let w=new Set;for(let C=1;C<M.length;C+=1){let b=K70(M[C-1],M[C]);if(b)w.add(b)}w.forEach((C)=>_.observe(C,{childList:!0}))}let V=Y0(()=>{let[M,_]=Y70(G),w=D(M),C=K.current,b=!C||C.length!==M.length||M.some((T,I)=>{let S=C[I];return T.index!==S.index||T.element!==S.element||T.registration.index!==S.registration.index||T.registration.metadata!==S.registration.metadata});if(A(_),K.current=M,Y.current=!1,!b)return;z.forEach((T)=>T(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)}}),O=u3.useMemo(()=>({register:q,unregister:N,subscribeMapChange:L,nextIndexRef:U}),[q,N,L,U]);return ff.jsx(cL.Provider,{value:O,children:Z})}function G70(){return new Map}function U70(){return new Set}function Y70($){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)=>gf(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 K70($,Z){let J=$.parentElement;while(J&&!J.contains(Z))J=J.parentElement;return J}function F70($){for(let Z of $)for(let J=0;J<Z.removedNodes.length;J+=1)if(Z.removedNodes[J].isConnected)return!0;return!1}function gf($,Z){return $.compareDocumentPosition(Z)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var HH=P(c(),1),mf=B3.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=uT,style:A,...V}=Z,{store:L}=j5(),O=xf(),M=G7(!0),_=L.useState("parent"),w=L.useState("floatingRootContext"),C=L.useState("floatingTreeRoot"),b=L.useState("mounted"),T=L.useState("open"),I=L.useState("modal"),S=L.useState("openMethod"),R=L.useState("activeTriggerElement"),j=L.useState("transitionStatus"),y=L.useState("positionerElement"),k=L.useState("instantType"),x=L.useState("adaptiveOrigin"),v=L.useState("lastOpenChangeReason"),f=L.useState("floatingNodeId"),E=L.useState("floatingParentNodeId"),l=w.useState("domReferenceElement"),r=B3.useRef(null),h=d4(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??S9;else if(_.type==="menubar")Z0=Z0??(_.context.orientation==="vertical"?"inline-end":"bottom"),J0=J0??"start";let U0=_.type==="context-menu",z0=u9({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:f,keepMounted:O,disableAnchorTracking:N,collisionAvoidance:n,shift:U0?{crossAxis:!(("side"in n)&&n.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:C,adaptiveOrigin:x});B3.useEffect(()=>{function $0(X0){if(X0.open){if(X0.parentNodeId===f)L.set("hoverEnabled",!1);if(X0.nodeId!==f&&X0.parentNodeId===L.select("floatingParentNodeId"))L.setOpen(!1,w0(K0.siblingOpen))}}return C.events.on("menuopenchange",$0),()=>{C.events.off("menuopenchange",$0)}},[L,C.events,f]),B3.useEffect(()=>{if(L.select("floatingParentNodeId")==null)return;function $0(X0){if(X0.open||X0.nodeId!==L.select("floatingParentNodeId"))return;let _0=X0.reason??K0.siblingOpen;L.setOpen(!1,w0(_0))}return C.events.on("menuopenchange",$0),()=>{C.events.off("menuopenchange",$0)}},[C.events,L]);let Q0=r1();B3.useEffect(()=>{if(!T)Q0.clear()},[T,Q0]),B3.useEffect(()=>{function $0(X0){if(!T||X0.nodeId!==L.select("floatingParentNodeId"))return;if(X0.target&&R&&R!==X0.target){let _0=L.select("closeDelay");if(_0>0){if(!Q0.isStarted())Q0.start(_0,()=>{L.setOpen(!1,w0(K0.siblingOpen))})}else L.setOpen(!1,w0(K0.siblingOpen))}else Q0.clear()}return C.events.on("itemhover",$0),()=>{C.events.off("itemhover",$0)}},[C.events,T,R,L,Q0]),B3.useEffect(()=>{let $0={open:T,nodeId:f,parentNodeId:E,reason:L.select("lastOpenChangeReason")};C.events.emit("menuopenchange",$0)},[C.events,T,L,f,E]),H0(()=>{let $0=l,X0=r.current;if($0)r.current=$0;if(X0&&$0&&$0!==X0){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:T,side:z0.side,align:z0.align,anchorHidden:z0.anchorHidden,nested:_.type==="menu",instant:k},D0=_.type==="menubar"&&_.context.modal,F0=I&&v!==K0.triggerHover;ZU(T&&(D0||F0),S==="touch",y,R);let s=c9(Z,N0,{styles:z0.positionerStyles,transitionStatus:j,props:V,refs:[J,L.useStateSetter("positionerElement")],hidden:!b,inert:!T}),a=b&&_.type!=="menu"&&(_.type!=="menubar"&&I&&v!==K0.triggerHover||_.type==="menubar"&&_.context.modal),e=null;if(_.type==="menubar")e=_.context.contentElement;else if(_.type===void 0)e=R;return HH.jsxs(mL.Provider,{value:z0,children:[a&&HH.jsx($J,{ref:_.type==="context-menu"||_.type==="nested-context-menu"?_.context.internalBackdropRef:null,inert:S8(!T),cutout:e}),HH.jsx(X$,{id:f,children:HH.jsx(F7,{elementsRef:L.context.itemDomElements,labelsRef:L.context.itemLabels,children:s})})]})});var W7=P(m(),1);var DF=P(m(),1),iL=DF.createContext(void 0);function uf(){let $=DF.useContext(iL);if($===void 0)throw Error(k0(34));return $}var rL=P(c(),1),pf=W7.memo(W7.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]=W7.useState(void 0),[q,N]=F4({controlled:Q,default:X,name:"MenuRadioGroup"}),D=Y0((O,M)=>{if(z?.(O,M),M.isCanceled)return;N(O)}),V=G0("div",Z,{state:{disabled:G},ref:J,props:{role:"group","aria-labelledby":Y??F,"aria-disabled":G||void 0,...K}}),L=W7.useMemo(()=>({value:q,setValue:D,disabled:G}),[q,D,G]);return rL.jsx(lQ.Provider,{value:W,children:rL.jsx(iL.Provider,{value:L,children:V})})}));var LF=P(m(),1);var VF=P(m(),1),aL=VF.createContext(void 0);function cf(){let $=VF.useContext(aL);if($===void 0)throw Error(k0(35));return $}var df=P(c(),1),lf=LF.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=A4({guess:!0,label:X}),q=N4(!0),N=t0(Q),{store:D}=j5(),A=D.useState("isActive",W.index),V=D.useState("itemProps"),{value:L,setValue:O,disabled:M}=uf(),_=D.useState("disabled"),w=G||M||_,C=L===Y,{getItemProps:b,itemRef:T}=Y7({closeOnClick:U,disabled:w,highlighted:A,id:N,store:D,nativeButton:z,nodeId:q?.context.nodeId,itemMetadata:U7}),I=LF.useMemo(()=>({disabled:w,highlighted:A,checked:C}),[w,A,C]);function S(j){let y=w0(K0.itemPress,j.nativeEvent,void 0,{preventUnmountOnClose:G1});O(Y,y)}let R=G0("div",Z,{state:I,stateAttributesMapping:K7,props:[V,{role:"menuitemradio","aria-checked":C,onClick:S},F,b],ref:[T,J,W.ref]});return df.jsx(aL.Provider,{value:I,children:R})});var MF=P(m(),1);var rf=MF.forwardRef(function(Z,J){let{render:H,className:B,style:Q,keepMounted:X=!1,...z}=Z,G=cf(),U=MF.useRef(null),{transitionStatus:Y,mounted:K,setMounted:F}=S2(G.checked);V5({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:K7,ref:[J,U],props:{"aria-hidden":!0,...z},enabled:X||K})});var H2=P(m(),1);var PF=P(m(),1),W70=PF.createContext(null);function _F($){let Z=PF.useContext(W70);if(Z===null&&!$)throw Error(k0(5));return Z}var iQ=P(m(),1);var af={...f9,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 oL extends g2{constructor($,Z,J=!1){let H=new R2,B=sf(H,Z,J,$);super(B,nf(H),af);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 of(){let $=new R2,Z=new H9(Object.freeze(sf($)),Object.freeze(nf($)),af);return Object.assign(Z,{setOpen:G1})}function nf($){return{positionerRef:iQ.createRef(),popupRef:iQ.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:iQ.createRef(),beforeContentFocusGuardRef:iQ.createRef(),onOpenChangeComplete:void 0,triggerElements:$}}function sf($,Z,J=!1,H){return{...v9($,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 Q$,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:M1,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...H}}var OF=P(m(),1),nL=OF.createContext(void 0);function jF(){return OF.useContext(nL)}var rQ=P(c(),1),TF=r8(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=G7(!0),V=j5(!0),L=_F(!0),O=jF(),M=H2.useMemo(()=>{if(O&&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,O]),_=E4(),w=E4(),C=w4(),b=M.type==="menu"?M.store:void 0,T=(H??X)&&b?.state.transitionStatus==="starting",I=$5(()=>T?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:I},w,C!=null);S.useControlledProp("openProp",H),S.useControlledProp("triggerIdProp",q),S.useContextCallback("onOpenChangeComplete",Q);let R=S.useState("floatingTreeRoot"),j=E3(R),y=S.useState("open"),k=S.useState("activeTriggerElement"),x=S.useState("positionerElement"),v=S.useState("hoverEnabled"),f=S.useState("disabled"),E=S.useState("lastOpenChangeReason"),l=S.useState("parent"),r=S.useState("activeIndex"),h=S.useState("payload"),d=S.useState("floatingParentNodeId"),o=H2.useRef(null),p=H2.useRef(l.type!=="context-menu"),i=r1(),n=H2.useRef(!0),Z0=r1(),J0=d!=null,{openMethod:U0,triggerProps:z0}=Hw(y);S.useSyncedValues({disabled:z,highlightItemOnHover:D,modal:l.type===void 0?G:void 0,openMethod:U0,rootId:_}),y9(S);let{forceUnmount:Q0,transitionStatus:N0}=x9(y,S,()=>{S.set("allowMouseEnter",!1)},T),D0=d4(S.context.popupRef);H2.useEffect(()=>{if(I===void 0)return;let T0=()=>{if(S.state.instantType===I)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()}},[I,y,N0,D0,S]),H0(()=>{if(A&&!V)S.update({parent:{type:"context-menu",context:A},floatingNodeId:j,floatingParentNodeId:C});else if(V)S.update({floatingNodeId:j,floatingParentNodeId:C})},[A,V,j,C,S]),H2.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 z1=d0.reason;if(!T0&&!S.select("open"))return;if(y===T0&&d0.trigger===k&&E===z1)return;let e0=OB(d0);if(!T0&&d0.trigger==null)d0.trigger=k??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&&z1===K0.triggerFocus)n.current=!1,Z0.start(300,()=>{n.current=!0});else n.current=!0,Z0.clear();let y0=(z1===K0.triggerPress||z1===K0.itemPress)&&c0.detail===0,E1=!T0&&(z1===K0.escapeKey||z1==null);o.current=d0.event;let W1=Y$(S.state,T0,d0.trigger,e0());if(W1.openChangeReason=z1,l.type==="menubar"&&(z1===K0.triggerFocus||z1===K0.focusOut||z1===K0.triggerHover||z1===K0.listNavigation||z1===K0.siblingOpen))W1.instantType="group";else if(y0||E1)W1.instantType=y0?"click":"dismiss";else W1.instantType=void 0;S.update(W1)}),s=_B({popupStore:S,floatingRootContext:S.state.floatingRootContext,floatingId:w,nested:C!=null,onOpenChange:F0}),a=s.context.events;H0(()=>{let T0=({open:d0,eventDetails:z1})=>F0(d0,z1);return a.on("setOpen",T0),()=>{a?.off("setOpen",T0)}},[a,F0]);let e=H2.useCallback(()=>{S.setOpen(!1,w0(K0.imperativeAction))},[S]);H2.useImperativeHandle(K,()=>({unmount:Q0,close:e}),[Q0,e]);let $0;if(l.type==="context-menu")$0=l.context;H2.useImperativeHandle($0?.positionerRef,()=>x,[x]),H2.useImperativeHandle($0?.actionsRef,()=>({setOpen:F0}),[F0]);let X0=e8(s,{enabled:!f,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=i4(),M0=H2.useCallback((T0)=>{if(S.select("activeIndex")===T0)return;S.set("activeIndex",T0)},[S]),A0=pA(s,{enabled:!f,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:Z4,onNavigate:M0,openOnArrowKeyDown:l.type!=="context-menu",externalTree:J0?R:void 0,focusItemOnHover:D}),L0=H2.useCallback((T0)=>{S.context.typingRef.current=T0},[S]),g=cA(s,{enabled:!f,listRef:S.context.itemLabels,elementsRef:S.context.itemDomElements,activeIndex:r,resetMs:vT,onMatch:(T0)=>{if(y&&T0!==r)S.set("activeIndex",T0)},onTyping:L0}),u=H2.useMemo(()=>{let T0=Y2(g.reference,A0.reference,X0.reference,{onMouseMove(){S.set("allowMouseEnter",!0)}},z0);return T0["aria-haspopup"]="menu",T0["aria-expanded"]=y,T0},[S,g.reference,A0.reference,X0.reference,z0,y]),t=H2.useMemo(()=>{let T0=Y2(A0.trigger,X0.trigger,z0);return T0["aria-haspopup"]="menu",T0["aria-expanded"]=!1,T0},[A0.trigger,X0.trigger,z0]);$5(()=>{return S.update({inactiveTriggerProps:t}),null});let W0=H2.useMemo(()=>Y2(R9,{id:w,role:"menu","aria-orientation":Y==="horizontal"?"horizontal":void 0,"aria-labelledby":k?.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)}},g.floating,A0.floating,X0.floating),[k,w,Y,l.type,S,g.floating,A0.floating,X0.floating]),S0=A0.item??M1;h9(S,{floatingRootContext:s,activeTriggerProps:u,inactiveTriggerProps:t,popupProps:W0,itemProps:S0});let p0=H2.useMemo(()=>({store:S,parent:M}),[S,M]),f0=rQ.jsxs(uL.Provider,{value:p0,children:[W&&rQ.jsx(I9,{handle:W,store:S}),typeof J==="function"?J({payload:h}):J]});if(l.type===void 0||l.type==="context-menu")return rQ.jsx(z$,{externalTree:R,children:f0});return f0});function q70($,Z,J){return $5(()=>new oL($,Z,J)).current}var tf=P(m(),1);var sL=P(c(),1);function ef($){let Z=j5().store,J=tf.useMemo(()=>({parentMenu:Z}),[Z]);return sL.jsx(nL.Provider,{value:J,children:sL.jsx(TF,{...$})})}var D4=P(m(),1);var CF=5;function $g($,Z){let J=N70(Z);return $.clientX>=J.left-CF&&$.clientX<=J.right+CF&&$.clientY>=J.top-CF&&$.clientY<=J.bottom+CF}function N70($){let Z=$.getBoundingClientRect(),J=S1($);if(J5.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 Zg=P(m(),1);function EF($={}){let{highlightItemOnHover:Z,highlightedIndex:J,onHighlightedIndexChange:H}=BH(),{ref:B,index:Q}=A4($),X=J===Q,z=Zg.useRef(null),G=p2(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 Jg($){let{render:Z,className:J,style:H,state:B=M1,props:Q=Z4,refs:X=Z4,metadata:z,stateAttributesMapping:G,tag:U="div",...Y}=$,{compositeProps:K,compositeRef:F}=EF({metadata:z});return G0(U,$,{state:B,ref:[F,...X],props:[K,...Q,Y],stateAttributesMapping:G})}function tL($){if(_1($)&&$.hasAttribute("data-rootownerid"))return $.getAttribute("data-rootownerid");if(R8($))return;return tL(I8($))}var bF=P(m(),1);function Hg($){let{enabled:Z=!0,mouseDownAction:J,open:H}=$,B=bF.useRef(!1);return bF.useMemo(()=>{if(!Z)return M1;return{onMouseDown:(Q)=>{if(J==="open"&&!H||J==="close"&&H)B.current=!0,g0(Q.currentTarget).addEventListener("click",()=>{B.current=!1},{once:!0})},onClick:(Q)=>{if(B.current)B.current=!1,Q.preventBaseUIHandler()}}},[Z,J,H])}var q7=P(c(),1),Bg=T9(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=j5(!0),A=g9(F)??N?.store;if(!A)throw Error(k0(85));let V=t0(G),L=A.useState("isTriggerActive",V),O=A.useState("floatingRootContext"),M=A.useState("isOpenedByTrigger",V),_=A.useState("triggerPopupId",V),w=D4.useRef(null),C=D70(),b=BH(!0),T=B4(),I=D4.useMemo(()=>{return T??new Q$},[T]),S=E3(I),R=w4(),{registerTrigger:j,isMountedByThisTrigger:y}=k9(V,w,A,{payload:W,closeDelay:K,parent:C,floatingTreeRoot:I,floatingNodeId:S,floatingParentNodeId:R,keyboardEventRelay:b?.relayKeyboardEvent}),k=C.type==="menubar",x=A.useState("disabled"),v=X||x||k&&C.context.disabled,{getButtonProps:f,buttonRef:E}=w5({disabled:v,native:z});D4.useEffect(()=>{if(!M&&C.type===void 0)A.context.allowMouseUpTriggerRef.current=!1},[A,M,C.type]);let l=D4.useRef(null),r=r1(),h=Y0(($0)=>{if(!l.current)return;r.clear(),A.context.allowMouseUpTriggerRef.current=!1;let X0=$0.target;if(R0(l.current,X0)||R0(A.select("positionerElement"),X0)||X0===l.current)return;if(X0!=null&&tL(X0)===A.select("rootId"))return;if($g($0,l.current))return;I.events.emit("close",{domEvent:$0,reason:K0.cancelOpen})});D4.useEffect(()=>{if(M&&A.select("lastOpenChangeReason")===K0.triggerHover)g0(l.current).addEventListener("mouseup",h,{once:!0})},[M,h,A]);let d=k&&C.context.hasSubmenuOpen,p=Z9(O,{enabled:(U??d)&&!v&&(!k||d&&!y),handleClose:J9({blockPointerEvents:!k}),mouseOnly:!0,move:!1,restMs:C.type===void 0?Y:void 0,delay:{close:K},triggerElementRef:w,externalTree:I,isActiveTrigger:L,isClosing:()=>A.select("transitionStatus")==="ending"}),i=A70(M,A.select("lastOpenChangeReason")),n=b3(O,{enabled:!v,event:M&&k?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:C.type===void 0?i:!1}),Z0=K$(O,{enabled:!v&&d}),J0=Hg({open:M,enabled:k,mouseDownAction:"open"}),U0=D4.useMemo(()=>Y2(Z0.reference,n.reference),[Z0.reference,n.reference]),z0=A.useState("triggerProps",y),{preFocusGuardRef:Q0,handlePreFocusGuardFocus:N0,handleFocusTargetFocus:D0}=nG(A,w),F0={disabled:v,open:M},s=[l,J,E,j,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}),g0($0.currentTarget).addEventListener("mouseup",h,{once:!0})}},k?{role:"menuitem"}:{},J0,q,f],e=G0("button",Z,{enabled:!k,stateAttributesMapping:KB,state:F0,ref:s,props:a});if(k)return q7.jsx(Jg,{tag:"button",render:H,className:B,style:Q,state:F0,refs:s,props:a,stateAttributesMapping:KB});if(M)return q7.jsxs(D4.Fragment,{children:[q7.jsx(c4,{ref:Q0,onFocus:N0},`${V}-pre-focus-guard`),q7.jsx(D4.Fragment,{children:e},V),q7.jsx(c4,{ref:A.context.triggerFocusTargetRef,onFocus:D0},`${V}-post-focus-guard`)]});return q7.jsx(D4.Fragment,{children:e},V)});function A70($,Z){let J=r1(),[H,B]=D4.useState(!1);return H0(()=>{if($&&Z===K0.triggerHover)B(!0),J.start(iz,()=>{B(!1)});else if(!$)J.clear(),B(!1)},[$,Z,J]),H}function D70(){let $=_F(!0);return D4.useMemo(()=>{if($)return{type:"menubar",context:$};return{type:void 0}},[$])}var Qg=P(m(),1);var Xg=Qg.forwardRef(function(Z,J){let{render:H,className:B,style:Q,children:X,...z}=Z,{store:G}=j5(),{side:U}=N4(),Y=G.useState("instantType"),{children:K,state:F}=D6({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:A6})});var zg=P(m(),1);var Gg=zg.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 p3=P(m(),1);function Ug($){return $==null||$.hasAttribute("disabled")||$.getAttribute("aria-disabled")==="true"}var V70={"aria-expanded":void 0},Yg=p3.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=jF();if(!q?.parentMenu)throw Error(k0(37));let N=A4({guess:!0,label:X}),D=N4(),{store:A}=j5(),V=t0(z),L=A.useState("open"),O=A.useState("floatingRootContext"),M=A.useState("floatingTreeRoot"),_=A.useState("triggerPopupId",V),w=yA(V,A),C=Y0((U0)=>{if(w(U0),U0!==null&&A.select("open")&&A.select("activeTriggerId")==null)A.update({activeTriggerId:V??null,activeTriggerElement:U0,closeDelay:K})}),b=p3.useRef(null),T=p3.useCallback((U0)=>{b.current=U0,A.set("activeTriggerElement",U0)},[A]);H0(()=>{return C(b.current),()=>C(null)},[C,V,A]),A.useSyncedValue("closeDelay",K);let I=q.parentMenu,S=A.useState("disabled"),R=I.useState("disabled"),j=F||S||R,y=I.useState("itemProps"),k=I.useState("isActive",N.index),x=p3.useMemo(()=>({type:"submenu-trigger",setActive(){if(I.select("highlightItemOnHover"))I.set("activeIndex",N.index)}}),[I,N.index]),{getItemProps:v,itemRef:f}=Y7({closeOnClick:!1,disabled:j,highlighted:k,id:V,store:A,typingRef:I.context.typingRef,nativeButton:G,itemMetadata:x,nodeId:D?.context.nodeId}),E=A.useState("hoverEnabled"),l=Z9(O,{enabled:E&&U&&!j,handleClose:J9({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:Y,delay:{open:Y,close:K},shouldOpen:Y>0?()=>I.select("allowMouseEnter"):void 0,triggerElementRef:b,externalTree:M,isClosing:()=>A.select("transitionStatus")==="ending",guardStaleOpen:!0}),h=b3(O,{enabled:!j,event:"mousedown",toggle:!U,ignoreMouse:U,stickIfOpen:!1}).reference??M1,d=A.useState("triggerProps",!0);delete d.id;let o={disabled:j,highlighted:k,open:L},p=A.useState("openMethod"),n=A.useState("lastOpenChangeReason")===K0.listNavigation||p==="keyboard",Z0=L&&n&&J5.screenReader.voiceOver;return G0("div",Z,{state:o,stateAttributesMapping:C9,props:[h,l,d,y,Z0?V70:void 0,{"aria-controls":_,tabIndex:L||k?0:-1,onBlur(){if(k)I.set("activeIndex",null)}},W,v],ref:[J,N.ref,f,C,T]})});class wF extends $9{constructor(){super(of(),"Menu")}open($){this.openByTrigger($)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}function Kg(){return new wF}var V4=P(c(),1);function Q3({...$}){return V4.jsx(e4.Root,{"data-slot":"dropdown-menu",...$})}function L70({...$}){return V4.jsx(y8,{portal:e4.Portal,"data-slot":"dropdown-menu-portal",...$})}function X3({...$}){return V4.jsx(e4.Trigger,{"data-slot":"dropdown-menu-trigger",...$})}function z3({align:$="start",alignOffset:Z=0,side:J="bottom",sideOffset:H=4,className:B,...Q}){return V4.jsx(L70,{children:V4.jsx(e4.Positioner,{className:"isolate z-50 outline-none",align:$,alignOffset:Z,side:J,sideOffset:H,children:V4.jsx(e4.Popup,{"data-slot":"dropdown-menu-content",className:r0("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 N7({...$}){return V4.jsx(e4.Group,{"data-slot":"dropdown-menu-group",...$})}function SF({className:$,inset:Z,...J}){return V4.jsx(e4.GroupLabel,{"data-slot":"dropdown-menu-label","data-inset":Z,className:r0("px-2 pt-1.5 pb-0.5 text-xs text-muted-foreground data-inset:ps-7",$),...J})}function G3({className:$,inset:Z,variant:J="default",...H}){return V4.jsx(e4.Item,{"data-slot":"dropdown-menu-item","data-inset":Z,"data-variant":J,className:r0("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 Fg({...$}){return V4.jsx(e4.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...$})}function Wg({className:$,children:Z,inset:J,...H}){return V4.jsxs(e4.RadioItem,{"data-slot":"dropdown-menu-radio-item","data-inset":J,className:r0("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:[V4.jsx("span",{className:"pointer-events-none absolute end-2 flex items-center justify-center","data-slot":"dropdown-menu-radio-item-indicator",children:V4.jsx(e4.RadioItemIndicator,{children:V4.jsx(a4,{stroke:1.75})})}),Z]})}var uF=P(m(),1);var A7={};I5(A7,{Value:()=>Mg,Track:()=>jg,Thumb:()=>Sg,Root:()=>Ag,Label:()=>Vg,Indicator:()=>Ig,Control:()=>_g});var B2=P(m(),1);function eL($,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 qg($){return $==null?void 0:`${$}-label`}function Ng($,Z){return $??Z}function RF($,Z){return $-Z}function IF($,Z,J,H,B,Q){let X=w2($,J,H);if(!B)return X;let z=Q.slice();return z[Z]=w2(X,Q[Z-1]??-1/0,Q[Z+1]??1/0),z.sort(RF)}function kF($,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 QH=()=>null,$8={activeThumbIndex:QH,max:QH,min:QH,minStepsBetweenValues:QH,step:QH,values:QH,...k2};var yF=P(m(),1),$M=yF.createContext(void 0);function u8(){let $=yF.useContext($M);if($===void 0)throw Error(k0(62));return $}var ZM=P(c(),1);function M70($,Z){return $===Z||Array.isArray($)&&Array.isArray(Z)&&eL($,Z)}var Ag=B2.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:O=1,thumbCollisionBehavior:M="push",thumbAlignment:_="center",value:w,style:C,...b}=Z,T=t0(z),I=qg(T),S=Y0(A),R=Y0(V),{clearErrors:j}=K4(),{state:y,disabled:k,name:x,setTouched:v,setDirty:f,validityData:E,validation:l}=o5(),{labelId:r}=n5(),[h,d]=B2.useState(),o=H??Ng(r,h),p=k||X,i=x??D,[n,Z0]=F4({controlled:w,default:Q??W,name:"Slider"}),J0=B2.useRef(null),U0=B2.useRef(null),z0=B2.useRef([]),Q0=B2.useRef(null),N0=B2.useRef(-1),D0=B2.useRef(null),F0=B2.useRef(K0.none),[s,a]=B2.useState(-1),[e,$0]=B2.useState(-1),[X0,_0]=B2.useState(!1),[M0,A0]=B2.useState(()=>new Map),[L0,g]=B2.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=B2.useMemo(()=>{if(!W0)return[w2(n,W,F)];return n.map((c0)=>w2(c0,W,F)).sort(RF)},[F,W,W0,n]),p0=W0?S0:S0[0];g6(l.inputRef,T,p0,void 0,!p,D),i9(p0,()=>{j(i),l.change(p0);let c0=E.initialValue,y0;if(Array.isArray(p0)&&Array.isArray(c0))y0=!eL(p0,c0);else y0=p0!==c0;f(y0)});let f0=Y0((c0,y0)=>{if(Number.isNaN(c0)||M70(c0,n))return!1;let E1=y0.event,z5=new E1.constructor(E1.type,E1);if(Object.defineProperty(z5,"target",{writable:!0,value:{value:c0,name:i}}),y0.event=z5,S(c0,y0),y0.isCanceled)return!1;return F0.current=y0.reason,Z0(c0),!0}),T0=Y0((c0,y0,E1)=>{let W1=IF(c0,y0,W,F,W0,S0);if(kF(W1,O,q)){let z5="key"in E1?K0.keyboard:K0.inputChange,C0=f0(W1,w0(z5,E1.nativeEvent,void 0,{activeThumbIndex:y0}));if(v(!0),C0)R(W1,HG(z5,E1.nativeEvent))}});H0(()=>{if(!p)return;let c0=d1(g0(J0.current));if(R0(J0.current,c0))c0.blur();if(s!==-1)u(-1)},[s,p,u]);let d0=B2.useMemo(()=>({...y,activeThumbIndex:s,disabled:p,dragging:X0,orientation:L,max:F,min:W,minStepsBetweenValues:q,step:O,values:S0}),[y,s,p,X0,F,W,q,L,O,S0]),z1=B2.useMemo(()=>({active:s,controlRef:U0,disabled:p,dragging:X0,validation:l,format:G,handleInputChange:T0,indicatorPosition:L0,inset:_!=="center",labelId:o,rootLabelId:I,largeStep:U,lastUsedThumbIndex:e,lastChangeReasonRef:F0,form:N,locale:Y,max:F,min:W,minStepsBetweenValues:q,name:i,onValueCommitted:R,orientation:L,pressedThumbCenterOffsetRef:Q0,pressedThumbIndexRef:N0,pressedValuesRef:D0,registerFieldControlRef:t,renderBeforeHydration:_==="edge",setActive:u,setDragging:_0,setIndicatorPosition:g,setLabelId:d,setValue:f0,state:d0,step:O,thumbCollisionBehavior:M,thumbMap:M0,thumbRefs:z0,values:S0}),[s,o,I,p,X0,l,G,T0,L0,U,e,N,Y,F,W,q,i,R,L,t,u,f0,d0,O,M,_,M0,S0]),e0=G0("div",Z,{state:d0,ref:[J,J0],props:[{"aria-labelledby":o,id:T,role:"group"},b,(c0)=>l.getValidationProps(p,c0)],stateAttributesMapping:$8});return ZM.jsx($M.Provider,{value:z1,children:ZM.jsx(F7,{elementsRef:z0,onMapChange:A0,children:e0})})});var Dg=P(m(),1);var Vg=Dg.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}=u8();function F(q,N){if(N){let V=g0(q.currentTarget).getElementById(N);if(_1(V)){BY(V);return}}let D=Y.current?.querySelectorAll('input[type="range"]'),A=D?.length===1?D[0]:null;if(_1(A))BY(A)}let W=HY({id:K,setLabelId:U,focusControl:F});return G0("div",Z,{ref:J,state:G,props:[W,X],stateAttributesMapping:$8})});var xF=P(m(),1);function JM($){if(Array.isArray($))return $.map((Z)=>JM(Z)).join(",");if($==null)return"";return String($)}var Lg=new Map;function P70($,Z){let J=JSON.stringify({locale:JM($),options:Z}),H=Lg.get(J);if(H)return H;let B=new Intl.NumberFormat($,Z);return Lg.set(J,B),B}function XH($,Z,J){if($==null)return"";return P70(Z,J).format($)}var Mg=xF.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}=u8(),q=Array.from(U.values(),({inputId:V})=>V).join(" ").trim()||void 0,N=xF.useMemo(()=>K.map((V)=>XH(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:$8})});var p8=P(m(),1);function hF($,Z){let J=$.getBoundingClientRect();return Z?(J.top+J.bottom)/2:(J.left+J.right)/2}function zH($){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 vF($,Z,J){let H=Math.round(($-J)/Z)*Z+J;return Number(H.toFixed(Math.max(zH(Z),zH(J))))}function HM($,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]=w2(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]=w2(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]=w2(V,D,N)}for(let q=0;q<=Y;q+=1)G[q]=Number(G[q].toFixed(12));return G}function Pg($,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:HM(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(w2(Q,A,V).toFixed(12));switch(q[B]=L,$){case"swap":{let O=Y[B],M=0.0000001,_=Q>O,w=Q<O,C=_&&D!=null&&Q>=D-0.0000001,b=w&&N!=null&&Q<=N+0.0000001;if(!C&&!b)return{value:q,thumbIndex:B,didSwap:!1};let T=C?B+1:B-1,I=q.map((E,l)=>{if(l===B)return L;let r=K[l];if(r!=null)return r;return Y[l]}),S=Q;if(C)S=Math.max(Q,q[T]);else S=Math.min(Q,q[T]);let R=HM(q,T,S,X,z,G,U,I),j=C?T-1:T+1,y=R[j-1],k=R[j+1],x=y!=null?y+W:X;x=Math.max(x,X+j*W);let v=k!=null?k-W:z;v=Math.min(v,z-(R.length-1-j)*W);let f=w2(L,x,v);return R[j]=Number(f.toFixed(12)),{value:R,thumbIndex:T,didSwap:!0}}case"none":default:return{value:q,thumbIndex:B,didSwap:!1}}}var _70=2;function O70($,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 j70($,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 _g=p8.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:O,setActive:M,setDragging:_,setValue:w,state:C,step:b,thumbCollisionBehavior:T,thumbRefs:I,values:S}=u8(),R=i4(),j=S.length>1,y=N==="vertical",k=p8.useRef(null),x=p8.useRef(null),v=Y0((a)=>{if(a&&x.current==null)x.current=S1(a).getComputedStyle(a)}),f=p8.useRef(null),E=p8.useRef(0),l=p8.useRef(0),r=p8.useRef(null),h=q5(S);function d(a){return a?.querySelector('input[type="range"]')}function o(a){if(A.current=a,!I.current[a])D.current=null}function p(){A.current=-1,D.current=null}function i(a){if(!s0(a))return!1;return I.current.some((e)=>{if(!s0(e)||!R0(e,a))return!1;return d(e)?.disabled===!0})}function n(a){let e=k.current,$0=A.current;if(!e||$0<0||$0>=S.length){if($0>=S.length)r.current=null;return null}let{width:X0,height:_0,bottom:M0,left:A0,right:L0}=e.getBoundingClientRect(),g=O70(x.current,y),u=l.current,t=(y?_0:X0)-g.start-g.end-u*2,W0=D.current??0,S0=a.x-W0,p0=a.y-W0,f0=y?M0-p0-g.end:(R==="rtl"?L0-S0:S0-A0)-g.start,T0=w2((f0-u)/t,0,1),d0=(K-F)*T0+F;if(d0=vF(d0,b,F),d0=w2(d0,F,K),!j)return{value:d0,thumbIndex:$0,didSwap:!1};return Pg(T,S,h.current,V.current,$0,d0,F,K,b,W)}function Z0(a){V.current=j?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 X0=e;while(X0>0&&S[X0-1]===K)X0-=1;$0=X0}}else{let X0=!y?"x":"y",_0;$0=-1;for(let M0=0;M0<I.current.length;M0+=1){let A0=I.current[M0];if(s0(A0)&&!d(A0)?.disabled){let L0=hF(A0,y),g=Math.abs(a[X0]-L0);if(_0===void 0||g<=_0)$0=M0,_0=g}}}if($0>-1&&$0!==e)o($0);if(U){let X0=I.current[$0];if(s0(X0)){let _0=X0.getBoundingClientRect(),M0=!y?"width":"height";l.current=_0[M0]/2}}}function J0(a){let e=d(I.current?.[a]);if(!e)return;e.focus({preventScroll:!0,focusVisible:!1})}function U0(a,e,$0){let X0=w(a.value,w0(e,$0,void 0,{activeThumbIndex:a.thumbIndex}));if(X0){if(r.current=a.value,h.current=Array.isArray(a.value)?a.value:[a.value],a.didSwap)o(a.thumbIndex),J0(a.thumbIndex)}return X0}let z0=Y0((a)=>{let e=j70(a,f);if(e==null)return;if(E.current+=1,a.type==="pointermove"&&a.buttons===0){Q0(a);return}let $0=n(e);if($0==null)return;if(kF($0.value,b,W)){if(!G&&E.current>_70)_(!0);U0($0,K0.drag,a)}}),Q0=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,HG($0,a))}if("pointerType"in a&&k.current?.hasPointerCapture(a.pointerId))k.current?.releasePointerCapture(a.pointerId);A.current=-1,f.current=null,D0()}),N0=Y0((a)=>{if(z)return;if(i(P1(a))){p();return}let e=a.changedTouches[0];if(e==null)return;f.current=e.identifier;let $0={x:e.clientX,y:e.clientY};Z0($0);let X0=n($0);if(X0==null)return;J0(X0.thumbIndex),U0(X0,K0.trackPress,a),E.current=0;let _0=g0(k.current);_0.addEventListener("touchmove",z0,{passive:!0}),_0.addEventListener("touchend",Q0,{passive:!0})}),D0=Y0(()=>{let a=g0(k.current);a.removeEventListener("pointermove",z0),a.removeEventListener("pointerup",Q0),a.removeEventListener("touchmove",z0),a.removeEventListener("touchend",Q0),V.current=null,r.current=null}),F0=C4();return p8.useEffect(()=>{let a=k.current;if(!a)return()=>D0();let e=o0(a,"touchstart",N0,{passive:!0});return()=>{e(),F0.cancel(),D0()}},[D0,N0,k,F0]),p8.useEffect(()=>{if(z)D0()},[z,D0]),G0("div",Z,{state:C,ref:[J,L,k,v],props:[{["data-base-ui-slider-control"]:O?"":void 0,onPointerDown(a){let e=k.current,$0=P1(a.nativeEvent);if(!e||z||a.defaultPrevented||!s0($0)||a.button!==0)return;if(i($0)){p();return}let X0={x:a.clientX,y:a.clientY};Z0(X0);let _0=n(X0);if(_0==null)return;if(R0(I.current[_0.thumbIndex],d1(g0(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=g0(e);L0.addEventListener("pointermove",z0,{passive:!0}),L0.addEventListener("pointerup",Q0,{once:!0})}},X],stateAttributesMapping:$8})});var Og=P(m(),1);var jg=Og.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,{state:z}=u8();return G0("div",Z,{state:z,ref:J,props:[{style:{position:"relative"}},X],stateAttributesMapping:$8})});var c8=P(m(),1);var fF="";var Tg=P(SZ(),1);function T70(){return G1}function C70(){return!1}function E70(){return!0}function GH(){return Tg.useSyncExternalStore(T70,C70,E70)}function aQ($,Z,J){return($-Z)*100/(J-Z)}var x71=P(m(),1);var gF=P(m(),1),b70=gF.createContext(void 0),w70={disableStyleElements:!1};function Cg(){return gF.useContext(b70)??w70}var Eg=P(c(),1);function mF($){let{script:Z}=$,{nonce:J}=Cg();if(!GH())return null;return Eg.jsx("script",{nonce:J,dangerouslySetInnerHTML:{__html:Z},suppressHydrationWarning:!0})}var bg="data-index";var oQ=P(c(),1),wg,R70=new Set([...B9,CD,ED]);function I70($,Z,J,H){if(Z<0)return;if($.length===2)return`${XH($[Z],H,J)} ${Z===0?"start":"end"} range`;return J?XH($[Z],H,J):void 0}function k70($,Z,J,H,B){let Q=$+Z*J,X=Number(Q.toFixed(Math.max(zH($),zH(Z),zH(H))));return w2(X,H,B)}var Sg=c8.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:O,...M}=Z,_=t0(W),{active:w,lastUsedThumbIndex:C,controlRef:b,disabled:T,validation:I,format:S,handleInputChange:R,inset:j,labelId:y,largeStep:k,locale:x,max:v,min:f,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}=u8(),Q0=i4(),N0=Y||T,D0=z0.length>1,F0=h==="vertical",s=Q0==="rtl",{setTouched:a,setFocused:e,validationMode:$0}=o5(),X0=c8.useRef(null),_0=c8.useRef(null),M0=c8.useRef(!1),A0=Y0((m0)=>{if(M0.current)return;A?.(m0)}),L0=Y0((m0)=>{if(M0.current)return;D?.(m0)}),g=t0(),u=m6(),t=D0?g:u,W0=c8.useMemo(()=>({inputId:t}),[t]),{ref:S0,index:p0}=A4({metadata:W0}),f0=!D0?0:q??p0,T0=f0===z0.length-1,d0=z0[f0],z1=aQ(d0,f,v),[e0,c0]=c8.useState(),y0=GH(),E1=C>=0&&C<z0.length?C:-1,W1=Y0(()=>{let m0=b.current,q0=X0.current;if(!m0||!q0)return;let h0=q0.getBoundingClientRect(),U1=m0.getBoundingClientRect(),I0=F0?"height":"width",i0=U1[I0]-h0[I0],L1=(h0[I0]/2+i0*z1/100)/U1[I0]*100,T1=Number.isFinite(L1)?L1:void 0;if(c0(T1),f0===0)n((c1)=>[T1,c1[1]]);else if(T0)n((c1)=>[c1[0],T1])});H0(()=>{if(j)queueMicrotask(W1)},[W1,j]),H0(()=>{if(j)W1()},[W1,j,z1]),H0(()=>{if(!j)return;let m0=b.current,q0=X0.current;if(!m0||!q0)return;let h0=S1(m0).ResizeObserver;if(typeof h0!=="function")return;let U1=new h0(W1);return U1.observe(m0),U1.observe(q0),()=>{U1.disconnect()}},[b,W1,j]);let z5=F0?"bottom":"insetInlineStart",C0=F0?"left":"top",x0;if(D0){if(w===f0)x0=2;else if(E1===f0)x0=1}else if(w===f0)x0=1;let a0;if(!j&&!Number.isFinite(z1))a0=n8;else a0={position:"absolute",[z5]:j?"var(--position)":`${z1}%`,[C0]:"50%",translate:`${(F0||!s?-1:1)*50}% ${(F0?1:-1)*50}%`,zIndex:x0,...j&&{["--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(f0):z,V1=Y2({"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(XH(d0,x,S),d0,f0):U??I70(z0,f0,S,x),disabled:N0,form:l,id:t,max:v,min:f,name:r,onChange(m0){R(m0.currentTarget.valueAsNumber,f0,m0)},onFocus(m0){let q0=M0.current;if(M0.current=!1,i(f0),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")I.commit(IF(d0,f0,f,v,D0,z0))},onKeyDown(m0){if(m0.defaultPrevented)return;if(!R70.has(m0.key))return;if(B9.has(m0.key))m0.stopPropagation();let q0=null,h0=0,U1=m0.shiftKey?k:J0,I0=vF(d0,J0,f);switch(m0.key){case ZJ:h0=1;break;case BJ:h0=s?-1:1;break;case JJ:h0=-1;break;case HJ:h0=s?1:-1;break;case CD:U1=k,h0=1;break;case ED:U1=k,h0=-1;break;case XJ:q0=D0&&Number.isFinite(z0[f0+1])?z0[f0+1]-J0*E:v;break;case QJ:q0=D0&&Number.isFinite(z0[f0-1])?z0[f0-1]+J0*E:f;break;default:break}if(h0!==0)q0=k70(I0,U1,h0,f,v);if(q0!==null){let i0=m0.currentTarget;if(!E9(i0))M0.current=!0,i0.blur(),i0.focus({preventScroll:!0,focusVisible:!0});R(q0,f0,m0),m0.preventDefault()}},step:J0,style:{...n8,width:"100%",height:"100%",writingMode:n0},tabIndex:L,type:"range",value:d0??""},(m0)=>I.getValidationProps(N0,m0),{onFocus:A0,onBlur:L0,onKeyDown:V}),p1=p2(_0,I.inputRef,N);return G0("div",Z,{state:Z0,ref:[J,S0,X0],props:[{[bg]:f0,children:oQ.jsxs(c8.Fragment,{children:[B,oQ.jsx("input",{ref:p1,...V1,suppressHydrationWarning:!0}),j&&T0&&p&&(wg||(wg=oQ.jsx(mF,{script:fF})))]}),id:_,onPointerDown(m0){if(N0)return;o.current=f0;let q0=hF(m0.currentTarget,F0);d.current=(F0?m0.clientY:m0.clientX)-q0},style:a0,suppressHydrationWarning:p||void 0},M],stateAttributesMapping:$8})});var Rg=P(m(),1);function y70($,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 Ig=Rg.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}=u8(),N=GH(),D=K==="vertical",A=q.length>1,V=y70(D,A,G,G?z[0]:aQ(q[0],Y,U),G?z[1]:aQ(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:$8})});var u$=P(c(),1);function kg({animate:$=!1,children:Z,className:J,defaultValue:H,value:B,min:Q=0,max:X=100,...z}){let[G,U]=uF.useState(!1),Y=Array.isArray(B)?B:Array.isArray(H)?H:[Q];return uF.useEffect(()=>{let K=requestAnimationFrame(()=>U(!0));return()=>cancelAnimationFrame(K)},[]),u$.jsx(A7.Root,{className:r0("data-horizontal:w-full data-vertical:h-full",J),"data-slot":"slider",defaultValue:H,value:B,min:Q,max:X,thumbAlignment:"edge",...z,children:u$.jsxs(A7.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:[u$.jsx(A7.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:u$.jsx(A7.Indicator,{"data-slot":"slider-range",className:r0("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)=>u$.jsx(A7.Thumb,{"data-slot":"slider-thumb",className:r0("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 O1=P(c(),1);function x70($){return $.charAt(0).toUpperCase()+$.slice(1)}function h70($){return $==="xhigh"?"Extra":x70($)}function yg($){return typeof $==="number"?$:$[0]??0}var xg={from:{opacity:0,filter:"blur(4px)"},to:{opacity:1,filter:"blur(0px)"}},hg={type:"spring",duration:0.3,delay:0.1,bounce:0};function fg({label:$,leadingIcon:Z,className:J,...H}){return O1.jsxs(P0,{...H,variant:"ghost",className:B0("group/picker max-w-56 min-w-0 px-2 text-muted-foreground hover:text-muted-foreground",J),children:[Z,O1.jsx("span",{className:"truncate font-normal",children:$})]})}function v70({current:$,model:Z,models:J,onValueChange:H}){let B=Z.displayName,Q=Ff(J,"Models");return O1.jsxs(Q3,{children:[O1.jsx(X3,{render:O1.jsx(fg,{label:B,className:"shrink","aria-label":`Model: ${B}`})}),O1.jsx(z3,{align:"end",side:"top",className:"w-max max-w-64 min-w-40",children:O1.jsx(Fg,{value:$,onValueChange:H,children:Q.map((X)=>O1.jsxs(N7,{children:[O1.jsx(SF,{children:X.label}),X.models.map((z)=>O1.jsx(Wg,{value:z.value,closeOnClick:!0,children:z.displayName},z.value))]},X.label))})})]})}function gg({fastMode:$,onChange:Z}){return O1.jsxs(o1,{children:[O1.jsx(n1,{render:O1.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:$?O1.jsx(vg,{className:"text-primary",stroke:1.75}):O1.jsx($Q,{className:"text-muted-foreground",stroke:1.75})})}),O1.jsxs(s1,{align:"center",className:"flex-col gap-0",children:[O1.jsx("span",{children:"Fast mode"}),O1.jsx("span",{className:"font-normal text-muted-foreground",children:"More usage"})]})]})}function f70({currentEffort:$,effortLevels:Z,fastMode:J,showFastMode:H,onFastModeChange:B,onValueChange:Q}){let X=Gf(Z,$),[z,G]=UH.useState(!1),[U,Y]=UH.useState(X),[K,F]=UH.useState(!1),q=Z[z?U:X]??$,N=h70(q),D=(V)=>{if(V)Y(X);else F(!1);G(V)},A=(V)=>{let L=Z[V];if(L&&L!==$)Q(L)};return O1.jsxs(j6,{open:z,onOpenChange:D,children:[O1.jsx(T6,{render:O1.jsx(fg,{label:N,leadingIcon:J?O1.jsx($Q,{stroke:1.5}):void 0,"aria-label":`Effort: ${N}`})}),O1.jsxs(C6,{align:"end",side:"top",className:"w-64",children:[O1.jsx(hw,{className:"relative h-5 flex-row items-center",children:O1.jsx(I4,{mode:"popLayout",initial:!1,children:K?O1.jsxs(K5.div,{className:"flex h-5 w-full items-center justify-between text-sm text-muted-foreground","aria-hidden":"true",variants:xg,initial:"from",animate:"to",exit:"from",transition:hg,children:[O1.jsx("span",{children:"Faster"}),O1.jsx("span",{children:"Smarter"})]},"range"):O1.jsxs(K5.div,{className:"flex h-5 w-full items-center justify-between gap-2",variants:xg,initial:"from",animate:"to",exit:"from",transition:hg,children:[O1.jsxs("div",{className:"flex items-center gap-1",children:[O1.jsx("span",{className:"text-muted-foreground",children:"Effort"}),O1.jsx("output",{"aria-live":"polite",children:N})]}),H&&O1.jsx(gg,{fastMode:J,onChange:B})]},"effort")})}),O1.jsxs("label",{className:"block",children:[O1.jsx("span",{className:"sr-only",children:"Reasoning effort"}),O1.jsx(kg,{value:[U],min:0,max:Z.length-1,step:1,onPointerDown:(V)=>{if(V.button===0)F(!0)},onPointerCancel:()=>F(!1),onValueChange:(V)=>Y(yg(V)),onValueCommitted:(V)=>{F(!1),A(yg(V))},className:B0("**: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:O1.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)=>O1.jsx("span",{className:B0("size-1 rounded-full",L<=U?"bg-primary-foreground/30":"bg-foreground/30")},L))})})]})]})]})}var mg=UH.memo(function({sessionId:Z}){let{workspaceId:J,layout:H,setLayout:B}=y1(),{data:Q}=t4(J),X=Q?.models??[],z=X.find((_)=>_.value==="default"),G=Q?Kf(X.filter((_)=>_.value!=="default"),Q.provider):[],U=bU(J,Z).data?.config,Y=mS(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=HF(G,K,z?.resolvedModel);if(!A)return null;let V=A.supportsEffort?A.supportedEffortLevels??[]:[],L=gL(V,F,A.defaultEffort),O=Uf(V)&&L!==void 0,M=Yf(A,W);return O1.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[O1.jsx(v70,{current:A.value,model:A,models:G,onValueChange:q}),!O&&A.supportsFastMode&&O1.jsx(gg,{fastMode:M,onChange:D}),O&&O1.jsx(f70,{currentEffort:L,effortLevels:V,fastMode:M,showFastMode:A.supportsFastMode===!0,onFastModeChange:D,onValueChange:N},A.value)]})});var T5=P(c(),1);function cg({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=p$.useRef(null),W=m1(),q=x3(),N=V2(W,B??F2(q)),D=b1((j)=>j.composerDrafts[N]??"");p$.useEffect(()=>{if(q==="overview")b1.getState().moveComposerDraft(W,N)},[q,W,N]);let A=N5(D),V=G4((j)=>j.attachments[q8(W,B)]??g70),[L,O]=p$.useState(!1),M=V.some((j)=>j.kind!=="text"&&j.status==="uploading"),_=V.some((j)=>j.kind==="text"||j.status==="ready"||j.status==="draft"),w=D.trim().length>0||_,C=z&&cQ(w,M,X),b=(j)=>{A.current=j,b1.getState().setComposerDraft(N,j)},T=(j)=>{if(Y)Wv({workspaceId:W,sessionId:B},j)},I=p$.useRef(!1),S=(j)=>{if(j.kind==="drawing"&&U){U(j.localId);return}I1.getState().removeAttachment(W,j.localId)},R=async()=>{if(!C||I.current)return;I.current=!0;try{await G?.finish(),await Z(A.current),A.current="",b1.getState().setComposerDraft(N,null)}catch(j){a1.add({title:j instanceof Error?j.message:"Couldn’t send message",type:"error"})}finally{I.current=!1}};return T5.jsxs(Vv,{composerRef:$,onSubmit:(j)=>{j.preventDefault(),R()},onDragOver:(j)=>{if(!j.dataTransfer.types.includes("Files"))return;if(j.preventDefault(),Y)O(!0)},onDragLeave:(j)=>{if(!Y)return;if(j.currentTarget.contains(j.relatedTarget))return;O(!1)},onDrop:(j)=>{if(!j.dataTransfer.types.includes("Files"))return;j.preventDefault(),O(!1),T(Array.from(j.dataTransfer.files))},className:B0(L&&"ring-2 ring-ring/60"),children:[V.length>0&&T5.jsx("div",{className:"flex flex-wrap gap-2 px-1 pt-1 pb-1",children:V.toSorted((j,y)=>ug[j.kind]-ug[y.kind]).map((j)=>j.kind==="text"?T5.jsx(dQ,{label:j.label,onRemove:()=>S(j)},j.localId):j.kind==="drawing"?T5.jsx(Bf,{attachment:j,onRemove:()=>S(j)},j.localId):T5.jsx(Qf,{attachment:j,onRemove:()=>S(j)},j.localId))}),T5.jsx(Lv,{textareaRef:$,disabled:X.status!=="available",id:"chat-input",name:"message",value:D,onChange:(j)=>b(j.target.value),onKeyDown:(j)=>{if(j.key==="Enter"&&!j.shiftKey)j.preventDefault(),R()},onPaste:(j)=>{let y=Array.from(j.clipboardData?.files??[]);if(y.length===0)return;j.preventDefault(),T(y)},placeholder:H?"Queue a follow-up":K??"Do anything",rows:1}),T5.jsxs(Mv,{children:[Y&&T5.jsx("input",{ref:F,type:"file",multiple:!0,hidden:!0,onChange:(j)=>{T(Array.from(j.target.files??[])),j.target.value=""}}),T5.jsxs("div",{className:"mr-auto flex shrink-0 items-center gap-0.5",children:[Y&&T5.jsxs(o1,{children:[T5.jsx(n1,{render:T5.jsx(P0,{type:"button",variant:"ghost",size:"icon",onClick:()=>F.current?.click(),"aria-label":"Attach files",children:T5.jsx(NY,{stroke:1.6,className:"size-4.5!"})})}),T5.jsx(s1,{children:"Attach files"})]}),G&&T5.jsxs(o1,{children:[T5.jsx(n1,{render:T5.jsx(P0,{type:"button",variant:"ghost",size:"icon",onClick:G.onToggle,className:B0(G.active&&"bg-accent"),"aria-label":"Draw annotation","aria-pressed":G.active,children:T5.jsx($H,{stroke:1.5})})}),T5.jsx(s1,{children:"Draw annotation"})]})]}),T5.jsx(mg,{sessionId:Q}),H?T5.jsxs(o1,{children:[T5.jsx(n1,{render:T5.jsx(P0,{type:"button",size:"icon",onClick:J,"aria-label":"Stop agent",children:T5.jsx(pg,{})})}),T5.jsx(s1,{children:"Stop answering"})]}):T5.jsx(Pv,{label:"Send message",hasContent:w,busy:M||!z,availability:X})]})]})}var g70=[],ug={file:0,drawing:1,text:2};var c$=P(c(),1);function BM({className:$,prompt:Z,disabled:J=!1,onSelect:H}){let B=Z.icon;return c$.jsxs(P0,{type:"button",size:"sm",disabled:J,onClick:()=>H(Z),className:B0("h-auto items-start justify-start gap-2 rounded-lg p-2 px-3 text-left leading-snug whitespace-normal",$),children:[c$.jsx(B,{stroke:2,"aria-hidden":!0,className:"mt-0.5"}),c$.jsx("span",{children:Z.label})]})}function dg({prompts:$,disabled:Z=!1,onSelect:J}){return c$.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 c$.jsx(BM,{prompt:H,disabled:Z,onSelect:J,className:B0("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 Q5=P(c(),1),QM="Keep the final reply brief and user-facing. Do not include file or storage links, file paths, or bundle, test, and runtime-log summaries.",m70=[{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.",QM],icon:lg},{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.",QM],icon:ig},{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.",QM],icon:AY}],u70={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:cF};function rg({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 ag({agent:$,kind:Z,hasWorkspaceApplets:J,disabled:H=!1,onSelectPrompt:B,onNavigate:Q}){switch(Z){case"view-draft":return Q5.jsx(p70,{agent:$});case"welcome":return Q5.jsx(c70,{agent:$,disabled:H,showExamples:!J,onSelectPrompt:B,onNavigate:Q});case"explore-workspace":return Q5.jsx(d70,{agent:$,disabled:H,onSelectPrompt:B});case"overview-empty":return Q5.jsx(l70,{agent:$});case"tab-empty":return Q5.jsx(i70,{agent:$})}}function sQ({agent:$,children:Z,className:J}){return Q5.jsxs("div",{className:B0("flex flex-1 flex-col items-center justify-center self-center",J),children:[Q5.jsx(J3,{preset:$,color:"secondary",expression:"idle",className:"mb-2",animated:!0}),Z]})}function p70({agent:$}){return Q5.jsx(sQ,{agent:$,className:"text-center text-muted-foreground",children:Q5.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 c70({agent:$,disabled:Z=!1,showExamples:J=!0,onSelectPrompt:H,onNavigate:B}){return Q5.jsx(sQ,{agent:$,className:"@container w-full max-w-md min-w-0",children:Q5.jsxs("div",{className:"mt-2 flex flex-col gap-4",children:[Q5.jsxs("div",{className:"prose prose-sm min-w-0 wrap-anywhere prose-inherit",children:[Q5.jsx("p",{children:"Moi is the personal workspace built for you by your agent. It grows and adapts to your needs."}),Q5.jsxs("p",{children:["Ask the agent to build widgets on the"," ",Q5.jsx(XM,{Icon:dF,destination:"overview",onNavigate:B,children:"Overview"})," ","page, or more complex tools as separate"," ",Q5.jsx(XM,{Icon:pF,destination:"views",onNavigate:B,children:"Views"}),". Use"," ",Q5.jsx(XM,{Icon:nQ,destination:"scratchpad",onNavigate:B,children:"Scratchpad"})," ","for exploring and shaping ideas with your agent."]}),J&&Q5.jsx("p",{children:"Try an example:"})]}),J&&Q5.jsx(dg,{prompts:m70,disabled:Z,onSelect:H})]})})}function d70({agent:$,disabled:Z=!1,onSelectPrompt:J}){return Q5.jsx(sQ,{agent:$,children:Q5.jsxs("div",{className:"flex flex-col items-center gap-4",children:[Q5.jsx("div",{className:"prose prose-sm max-w-xs min-w-0 text-center wrap-anywhere prose-inherit",children:Q5.jsx("p",{children:"Your agent can explore this workspace and suggest useful widgets and views based on what’s already here"})}),Q5.jsx(BM,{prompt:u70,disabled:Z,onSelect:J})]})})}function l70({agent:$}){return Q5.jsx(sQ,{agent:$,className:"text-center text-muted-foreground",children:Q5.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 i70({agent:$}){return Q5.jsx(sQ,{agent:$,className:"text-center text-muted-foreground",children:Q5.jsx("p",{className:"mx-auto max-w-sm px-8 text-sm",children:"Chat with your agent and manage the view from here"})})}function XM({Icon:$,children:Z,destination:J,onNavigate:H}){return Q5.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:[Q5.jsx($,{size:16,stroke:1.75,"aria-hidden":!0}),Z]})}var tQ=P(m(),1);var q1=P(c(),1);function r70($){if($.flavor==="cron"||$.flavor==="subagent")return $.flavor;let Z=$.origin?.provider.trim().toLowerCase();return Z?Z:null}function a70({active:$,canArchive:Z,confirmingArchive:J,onArchive:H,onRequestArchive:B,onSelect:Q,session:X,workspaceId:z}){let G=tQ.useRef(!1),[U,Y]=tQ.useState(!1),K=G4((N)=>nZ(N.activity,z,X.sessionId)),F=r70(X);function W(){B(X.sessionId)}async function q(){if(G.current)return;G.current=!0,Y(!0);try{await H(X.sessionId)}catch{a1.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(G3,{className:B0("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:B0("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:B0("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(r2,{className:B0("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:B0("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(o1,{children:[q1.jsx(n1,{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(ng,{stroke:1.75})})}),q1.jsx(s1,{side:"right",children:"Archive chat"})]})})]})}function o70($){return`${$.getFullYear()}-${$.getMonth()}-${$.getDate()}`}function og($){return Date.UTC($.getFullYear(),$.getMonth(),$.getDate())/86400000}function n70($,Z){let J=og(Z)-og($);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 s70($,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=o70(B),X=J.get(Q);if(X){X.sessions.push(H);continue}J.set(Q,{key:Q,label:n70(B,Z),sessions:[H]})}return[...J.values()]}function t70($,Z,J=new Date){return s70($.filter((H)=>Z==="overview"?!H.tabId?.startsWith("views/"):H.tabId===Z),J)}function $m({className:$}){let Z=m1(),{pinnedSessionId:J,loaded:H,pin:B}=x6(),[Q]=h3(),{data:X=[]}=VJ(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:B0("-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(o1,{children:[q1.jsx(n1,{render:q1.jsx(P0,{variant:"ghost",size:"icon-sm",className:$,onClick:()=>B(null),"aria-label":"Unpin chat","aria-pressed":!0,children:q1.jsx(eg,{stroke:1.75})})}),q1.jsx(s1,{children:"Unpin chat"})]},"unpin")]})}return q1.jsxs("div",{className:"flex w-full min-w-0 items-center justify-between gap-1",children:[q1.jsx(e70,{className:$,sessions:X}),Q&&q1.jsxs(o1,{children:[q1.jsx(n1,{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(tg,{stroke:1.75})})}),q1.jsx(s1,{children:"Pin chat to workspace"})]},"pin")]})}function e70({className:$,sessions:Z}){let J=m1(),H=x3(),[B,Q]=h3(),[X,z]=tQ.useState(null),G=t4(J).data?.supportsArchiving===!0,U=fS(J),Y=t70(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=I1.getState();if(q.clearAttachments(J,W),q.clearPreviewsForSession(J,W),B===W)Q(null)}return B?q1.jsxs(o1,{children:[q1.jsx(n1,{render:q1.jsx(P0,{variant:"ghost",size:"icon-sm","aria-label":"New chat",onClick:()=>Q(null),className:$,children:q1.jsx(lF,{stroke:1.75})})}),q1.jsx(s1,{children:"New chat"})]}):q1.jsxs(Q3,{onOpenChange:K,children:[q1.jsxs(o1,{children:[q1.jsx(X3,{render:q1.jsx(n1,{render:q1.jsx(P0,{variant:"ghost",size:"icon-sm","aria-label":"History",className:$,children:q1.jsx(sg,{stroke:1.75})})})}),q1.jsx(s1,{children:"History"})]}),q1.jsx(z3,{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(N7,{children:[q1.jsx(SF,{children:W.label}),W.sessions.map((q)=>q1.jsx(a70,{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 Mi=P(m(),1);function X5(){}function iF(){}function Zm($,Z){let J=Z||{};return($[$.length-1]===""?[...$,""]:$).join((J.padRight?" ":"")+","+(J.padLeft===!1?"":" ")).trim()}var $$0=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Z$0=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,J$0={};function rF($,Z){return((Z||J$0).jsx?Z$0:$$0).test($)}var H$0=/[ \t\n\f\r]/g;function zM($){return typeof $==="object"?$.type==="text"?Jm($.value):!1:Jm($)}function Jm($){return $.replace(H$0,"")===""}class D7{constructor($,Z,J){if(this.normal=Z,this.property=$,J)this.space=J}}D7.prototype.normal={};D7.prototype.property={};D7.prototype.space=void 0;function GM($,Z){let J={},H={};for(let B of $)Object.assign(J,B.property),Object.assign(H,B.normal);return new D7(J,H,Z)}function eQ($){return $.toLowerCase()}class o2{constructor($,Z){this.attribute=Z,this.property=$}}o2.prototype.attribute="";o2.prototype.booleanish=!1;o2.prototype.boolean=!1;o2.prototype.commaOrSpaceSeparated=!1;o2.prototype.commaSeparated=!1;o2.prototype.defined=!1;o2.prototype.mustUseProperty=!1;o2.prototype.number=!1;o2.prototype.overloadedBoolean=!1;o2.prototype.property="";o2.prototype.spaceSeparated=!1;o2.prototype.space=void 0;var $X={};I5($X,{spaceSeparated:()=>A5,overloadedBoolean:()=>aF,number:()=>b0,commaSeparated:()=>V7,commaOrSpaceSeparated:()=>Z8,booleanish:()=>s5,boolean:()=>j1});var B$0=0,j1=d$(),s5=d$(),aF=d$(),b0=d$(),A5=d$(),V7=d$(),Z8=d$();function d$(){return 2**++B$0}var UM=Object.keys($X);class YH extends o2{constructor($,Z,J,H){let B=-1;super($,Z);if(Hm(this,"space",H),typeof J==="number")while(++B<UM.length){let Q=UM[B];Hm(this,UM[B],(J&$X[Q])===$X[Q])}}}YH.prototype.defined=!0;function Hm($,Z,J){if(J)$[Z]=J}function d8($){let Z={},J={};for(let[H,B]of Object.entries($.properties)){let Q=new YH(H,$.transform($.attributes||{},H),B,$.space);if($.mustUseProperty&&$.mustUseProperty.includes(H))Q.mustUseProperty=!0;Z[H]=Q,J[eQ(H)]=H,J[eQ(Q.attribute)]=H}return new D7(Z,J,$.space)}var YM=d8({properties:{ariaActiveDescendant:null,ariaAtomic:s5,ariaAutoComplete:null,ariaBusy:s5,ariaChecked:s5,ariaColCount:b0,ariaColIndex:b0,ariaColSpan:b0,ariaControls:A5,ariaCurrent:null,ariaDescribedBy:A5,ariaDetails:null,ariaDisabled:s5,ariaDropEffect:A5,ariaErrorMessage:null,ariaExpanded:s5,ariaFlowTo:A5,ariaGrabbed:s5,ariaHasPopup:null,ariaHidden:s5,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:A5,ariaLevel:b0,ariaLive:null,ariaModal:s5,ariaMultiLine:s5,ariaMultiSelectable:s5,ariaOrientation:null,ariaOwns:A5,ariaPlaceholder:null,ariaPosInSet:b0,ariaPressed:s5,ariaReadOnly:s5,ariaRelevant:null,ariaRequired:s5,ariaRoleDescription:A5,ariaRowCount:b0,ariaRowIndex:b0,ariaRowSpan:b0,ariaSelected:s5,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 oF($,Z){return Z in $?$[Z]:Z}function nF($,Z){return oF($,Z.toLowerCase())}var Bm=d8({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:V7,acceptCharset:A5,accessKey:A5,action:null,allow:null,allowFullScreen:j1,allowPaymentRequest:j1,allowUserMedia:j1,alt:null,as:null,async:j1,autoCapitalize:null,autoComplete:A5,autoFocus:j1,autoPlay:j1,blocking:A5,capture:null,charSet:null,checked:j1,cite:null,className:A5,cols:b0,colSpan:null,content:null,contentEditable:s5,controls:j1,controlsList:A5,coords:b0|V7,crossOrigin:null,data:null,dateTime:null,decoding:null,default:j1,defer:j1,dir:null,dirName:null,disabled:j1,download:aF,draggable:s5,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:j1,formTarget:null,headers:A5,height:b0,hidden:aF,high:b0,href:null,hrefLang:null,htmlFor:A5,httpEquiv:A5,id:null,imageSizes:null,imageSrcSet:null,inert:j1,inputMode:null,integrity:null,is:null,isMap:j1,itemId:null,itemProp:A5,itemRef:A5,itemScope:j1,itemType:A5,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:j1,low:b0,manifest:null,max:null,maxLength:b0,media:null,method:null,min:null,minLength:b0,multiple:j1,muted:j1,name:null,nonce:null,noModule:j1,noValidate:j1,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:j1,optimum:b0,pattern:null,ping:A5,placeholder:null,playsInline:j1,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:j1,referrerPolicy:null,rel:A5,required:j1,reversed:j1,rows:b0,rowSpan:b0,sandbox:A5,scope:null,scoped:j1,seamless:j1,selected:j1,shadowRootClonable:j1,shadowRootDelegatesFocus:j1,shadowRootMode:null,shape:null,size:b0,sizes:null,slot:null,span:b0,spellCheck:s5,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:j1,useMap:null,value:s5,width:b0,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:A5,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:j1,declare:j1,event:null,face:null,frame:null,frameBorder:null,hSpace:b0,leftMargin:b0,link:null,longDesc:null,lowSrc:null,marginHeight:b0,marginWidth:b0,noResize:j1,noHref:j1,noShade:j1,noWrap:j1,object:null,profile:null,prompt:null,rev:null,rightMargin:b0,rules:null,scheme:null,scrolling:s5,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:j1,disableRemotePlayback:j1,prefix:null,property:null,results:b0,security:null,unselectable:null},space:"html",transform:nF});var Qm=d8({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:Z8,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:A5,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:j1,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:V7,g2:V7,glyphName:V7,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:Z8,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:A5,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:b0,pointsAtY:b0,pointsAtZ:b0,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Z8,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Z8,rev:Z8,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Z8,requiredFeatures:Z8,requiredFonts:Z8,requiredFormats:Z8,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:Z8,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:Z8,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:Z8,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:oF});var KM=d8({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 FM=d8({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:nF});var WM=d8({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform($,Z){return"xml:"+Z.slice(3).toLowerCase()}});var qM={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 Q$0=/[A-Z]/g,Xm=/-[a-z]/g,X$0=/^data[-\w.:]+$/i;function NM($,Z){let J=eQ(Z),H=Z,B=o2;if(J in $.normal)return $.property[$.normal[J]];if(J.length>4&&J.slice(0,4)==="data"&&X$0.test(Z)){if(Z.charAt(4)==="-"){let Q=Z.slice(5).replace(Xm,G$0);H="data"+Q.charAt(0).toUpperCase()+Q.slice(1)}else{let Q=Z.slice(4);if(!Xm.test(Q)){let X=Q.replace(Q$0,z$0);if(X.charAt(0)!=="-")X="-"+X;Z="data"+X}}B=YH}return new B(H,Z)}function z$0($){return"-"+$.toLowerCase()}function G$0($){return $.charAt(1).toUpperCase()}var zm=GM([YM,Bm,KM,FM,WM],"html"),sF=GM([YM,Qm,KM,FM,WM],"svg");function Gm($){return $.join(" ").trim()}var Tm=P(Pm(),1);var tF=_m("end"),KH=_m("start");function _m($){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 VM($){let Z=KH($),J=tF($);if(Z&&J)return{start:Z,end:J}}function L7($){if(!$||typeof $!=="object")return"";if("position"in $||"type"in $)return Om($.position);if("start"in $||"end"in $)return Om($);if("line"in $||"column"in $)return LM($);return""}function LM($){return jm($&&$.line)+":"+jm($&&$.column)}function Om($){return LM($&&$.start)+"-"+LM($&&$.end)}function jm($){return $&&typeof $==="number"?$:1}class N2 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=L7(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}}N2.prototype.file="";N2.prototype.name="";N2.prototype.reason="";N2.prototype.message="";N2.prototype.stack="";N2.prototype.column=void 0;N2.prototype.line=void 0;N2.prototype.ancestors=void 0;N2.prototype.cause=void 0;N2.prototype.fatal=void 0;N2.prototype.place=void 0;N2.prototype.ruleId=void 0;N2.prototype.source=void 0;var MM={}.hasOwnProperty,y$0=new Map,x$0=/[A-Z]/g,h$0=new Set(["table","tbody","thead","tfoot","tr"]),v$0=new Set(["td","th"]),Cm="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function PM($,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=l$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=d$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"?sF:zm,stylePropertyNameCase:Z.stylePropertyNameCase||"dom",tableCellAlignToStyle:Z.tableCellAlignToStyle!==!1},Q=Em(B,$,void 0);if(Q&&typeof Q!=="string")return Q;return B.create($,B.Fragment,{children:Q||void 0},void 0)}function Em($,Z,J){if(Z.type==="element")return f$0($,Z,J);if(Z.type==="mdxFlowExpression"||Z.type==="mdxTextExpression")return g$0($,Z);if(Z.type==="mdxJsxFlowElement"||Z.type==="mdxJsxTextElement")return u$0($,Z,J);if(Z.type==="mdxjsEsm")return m$0($,Z);if(Z.type==="root")return p$0($,Z,J);if(Z.type==="text")return c$0($,Z)}function f$0($,Z,J){let H=$.schema,B=H;if(Z.tagName.toLowerCase()==="svg"&&H.space==="html")B=sF,$.schema=B;$.ancestors.push(Z);let Q=wm($,Z.tagName,!1),X=i$0($,Z),z=OM($,Z);if(h$0.has(Z.tagName))z=z.filter(function(G){return typeof G==="string"?!zM(G):!0});return bm($,X,Q,Z),_M(X,z),$.ancestors.pop(),$.schema=H,$.create(Z,Q,X,J)}function g$0($,Z){if(Z.data&&Z.data.estree&&$.evaluater){let H=Z.data.estree.body[0];return X5(H.type==="ExpressionStatement"),$.evaluater.evaluateExpression(H.expression)}JX($,Z.position)}function m$0($,Z){if(Z.data&&Z.data.estree&&$.evaluater)return $.evaluater.evaluateProgram(Z.data.estree);JX($,Z.position)}function u$0($,Z,J){let H=$.schema,B=H;if(Z.name==="svg"&&H.space==="html")B=sF,$.schema=B;$.ancestors.push(Z);let Q=Z.name===null?$.Fragment:wm($,Z.name,!0),X=r$0($,Z),z=OM($,Z);return bm($,X,Q,Z),_M(X,z),$.ancestors.pop(),$.schema=H,$.create(Z,Q,X,J)}function p$0($,Z,J){let H={};return _M(H,OM($,Z)),$.create(Z,$.Fragment,H,J)}function c$0($,Z){return Z.value}function bm($,Z,J,H){if(typeof J!=="string"&&J!==$.Fragment&&$.passNode)Z.node=H}function _M($,Z){if(Z.length>0){let J=Z.length>1?Z:Z[0];if(J)$.children=J}}function d$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 l$0($,Z){return J;function J(H,B,Q,X){let z=Array.isArray(Q.children),G=KH(H);return Z(B,Q,X,z,{columnNumber:G?G.column-1:void 0,fileName:$,lineNumber:G?G.line:void 0},void 0)}}function i$0($,Z){let J={},H,B;for(B in Z.properties)if(B!=="children"&&MM.call(Z.properties,B)){let Q=a$0($,B,Z.properties[B]);if(Q){let[X,z]=Q;if($.tableCellAlignToStyle&&X==="align"&&typeof z==="string"&&v$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 r$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];X5(Q.type==="ExpressionStatement");let X=Q.expression;X5(X.type==="ObjectExpression");let z=X.properties[0];X5(z.type==="SpreadElement"),Object.assign(J,$.evaluater.evaluateExpression(z.argument))}else JX($,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];X5(z.type==="ExpressionStatement"),Q=$.evaluater.evaluateExpression(z.expression)}else JX($,Z.position);else Q=H.value===null?!0:H.value;J[B]=Q}return J}function OM($,Z){let J=[],H=-1,B=$.passKeys?new Map:y$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=Em($,Q,X);if(z!==void 0)J.push(z)}return J}function a$0($,Z,J){let H=NM($.schema,Z);if(J===null||J===void 0||typeof J==="number"&&Number.isNaN(J))return;if(Array.isArray(J))J=H.commaSeparated?Zm(J):Gm(J);if(H.property==="style"){let B=typeof J==="object"?J:o$0($,String(J));if($.stylePropertyNameCase==="css")B=n$0(B);return["style",B]}return[$.elementAttributeNameCase==="react"&&H.space?qM[H.property]||H.property:H.attribute,J]}function o$0($,Z){try{return Tm.default(Z,{reactCompat:!0})}catch(J){if($.ignoreInvalidStyle)return{};let H=J,B=new N2("Cannot parse `style` attribute",{ancestors:$.ancestors,cause:H,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw B.file=$.filePath||void 0,B.url=Cm+"#cannot-parse-style-attribute",B}}function wm($,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=rF(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}X5(X,"always a result"),H=X}else H=rF(Z)&&!/^[a-z]/.test(Z)?{type:"Identifier",name:Z}:{type:"Literal",value:Z};if(H.type==="Literal"){let B=H.value;return MM.call($.components,B)?$.components[B]:B}if($.evaluater)return $.evaluater.evaluateExpression(H);JX($)}function JX($,Z){let J=new N2("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=Cm+"#cannot-handle-mdx-estrees-without-createevaluater",J}function n$0($){let Z={},J;for(J in $)if(MM.call($,J))Z[s$0(J)]=$[J];return Z}function s$0($){let Z=$.replace(x$0,t$0);if(Z.slice(0,3)==="ms-")Z="-"+Z;return Z}function t$0($){return"-"+$.toLowerCase()}var HX={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 LH=P(c(),1),tu=P(m(),1);var e$0={};function i$($,Z){let J=Z||e$0,H=typeof J.includeImageAlt==="boolean"?J.includeImageAlt:!0,B=typeof J.includeHtml==="boolean"?J.includeHtml:!0;return Rm($,H,B)}function Rm($,Z,J){if($Z0($)){if("value"in $)return $.type==="html"&&!J?"":$.value;if(Z&&"alt"in $&&$.alt)return $.alt;if("children"in $)return Sm($.children,Z,J)}if(Array.isArray($))return Sm($,Z,J);return""}function Sm($,Z,J){let H=[],B=-1;while(++B<$.length)H[B]=Rm($[B],Z,J);return H.join("")}function $Z0($){return Boolean($&&typeof $==="object")}var Im=document.createElement("i");function FH($){let Z="&"+$+";";Im.innerHTML=Z;let J=Im.textContent;if(J.charCodeAt(J.length-1)===59&&$!=="semi")return!1;return J===Z?!1:J}function Q2($,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 k4($,Z){if($.length>0)return Q2($,$.length,0,Z),$;return Z}var km={}.hasOwnProperty;function eF($){let Z={},J=-1;while(++J<$.length)ZZ0(Z,$[J]);return Z}function ZZ0($,Z){let J;for(J in Z){let B=(km.call($,J)?$[J]:void 0)||($[J]={}),Q=Z[J],X;if(Q)for(X in Q){if(!km.call(B,X))B[X]=[];let z=Q[X];JZ0(B[X],Array.isArray(z)?z:z?[z]:[])}}}function JZ0($,Z){let J=-1,H=[];while(++J<Z.length)(Z[J].add==="after"?$:H).push(Z[J]);Q2($,0,0,H)}function $W($,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 L4($){return $.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var _2=M7(/[A-Za-z]/),t5=M7(/[\dA-Za-z]/),ym=M7(/[#-'*+\--9=?A-Z^-~]/);function r$($){return $!==null&&($<32||$===127)}var BX=M7(/\d/),xm=M7(/[\dA-Fa-f]/),hm=M7(/[!-/:-@[-`{-~]/);function u0($){return $!==null&&$<-2}function x1($){return $!==null&&($<0||$===32)}function X1($){return $===-2||$===-1||$===32}var a$=M7(/\p{P}|\p{S}/u),U3=M7(/\s/);function M7($){return Z;function Z(J){return J!==null&&J>-1&&$.test(String.fromCharCode(J))}}function l8($){let Z=[],J=-1,H=0,B=0;while(++J<$.length){let Q=$.charCodeAt(J),X="";if(Q===37&&t5($.charCodeAt(J+1))&&t5($.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 J1($,Z,J,H){let B=H?H-1:Number.POSITIVE_INFINITY,Q=0;return X;function X(G){if(X1(G))return $.enter(J),z(G);return Z(G)}function z(G){if(X1(G)&&Q++<B)return $.consume(G),z;return $.exit(J),Z(G)}}var vm={tokenize:HZ0};function HZ0($){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"),J1($,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 gm={tokenize:BZ0},fm={tokenize:QZ0};function BZ0($){let Z=this,J=[],H=0,B,Q,X;return z;function z(L){if(H<J.length){let O=J[H];return Z.containerState=O[1],$.attempt(O[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 O=Z.events.length,M=O,_;while(M--)if(Z.events[M][0]==="exit"&&Z.events[M][1].type==="chunkFlow"){_=Z.events[M][1].end;break}A(H);let w=O;while(w<Z.events.length)Z.events[w][1].end={..._},w++;return Q2(Z.events,M+1,0,Z.events.slice(O)),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(fm,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(fm,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,O){let M=Z.sliceStream(L);if(O)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,C=w,b,T;while(C--)if(Z.events[C][0]==="exit"&&Z.events[C][1].type==="chunkFlow"){if(b){T=Z.events[C][1].end;break}b=!0}A(H),_=w;while(_<Z.events.length)Z.events[_][1].end={...T},_++;Q2(Z.events,C+1,0,Z.events.slice(w)),Z.events.length=_}}function A(L){let O=J.length;while(O-- >L){let M=J[O];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 QZ0($,Z,J){return J1($,$.attempt(this.parser.constructs.document,Z,J),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function c3($){if($===null||x1($)||U3($))return 1;if(a$($))return 2}function P7($,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 QX={name:"attention",resolveAll:XZ0,tokenize:zZ0};function XZ0($,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(mm(K,-G),mm(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=k4(U,[["enter",$[H][1],Z],["exit",$[H][1],Z]]);if(U=k4(U,[["enter",B,Z],["enter",X,Z],["exit",X,Z],["enter",Q,Z]]),U=k4(U,P7(Z.parser.constructs.insideSpan.null,$.slice(H+1,J),Z)),U=k4(U,[["exit",Q,Z],["enter",z,Z],["exit",z,Z],["exit",B,Z]]),$[J][1].end.offset-$[J][1].start.offset)Y=2,U=k4(U,[["enter",$[J][1],Z],["exit",$[J][1],Z]]);else Y=0;Q2($,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 zZ0($,Z){let J=this.parser.constructs.attentionMarkers.null,H=this.previous,B=c3(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=c3(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 mm($,Z){$.column+=Z,$.offset+=Z,$._bufferIndex+=Z}var jM={name:"autolink",tokenize:GZ0};function GZ0($,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(_2(W))return $.consume(W),X;if(W===64)return J(W);return U(W)}function X(W){if(W===43||W===45||W===46||t5(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||t5(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||r$(W))return J(W);return $.consume(W),G}function U(W){if(W===64)return $.consume(W),Y;if(ym(W))return $.consume(W),U;return J(W)}function Y(W){return t5(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||t5(W))&&H++<63){let q=W===45?F:K;return $.consume(W),q}return J(W)}}var Y3={partial:!0,tokenize:UZ0};function UZ0($,Z,J){return H;function H(Q){return X1(Q)?J1($,B,"linePrefix")(Q):B(Q)}function B(Q){return Q===null||u0(Q)?Z(Q):J(Q)}}var ZW={continuation:{tokenize:KZ0},exit:FZ0,name:"blockQuote",tokenize:YZ0};function YZ0($,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(X1(X))return $.enter("blockQuotePrefixWhitespace"),$.consume(X),$.exit("blockQuotePrefixWhitespace"),$.exit("blockQuotePrefix"),Z;return $.exit("blockQuotePrefix"),Z(X)}}function KZ0($,Z,J){let H=this;return B;function B(X){if(X1(X))return J1($,Q,"linePrefix",H.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(X);return Q(X)}function Q(X){return $.attempt(ZW,Z,J)(X)}}function FZ0($){$.exit("blockQuote")}var JW={name:"characterEscape",tokenize:WZ0};function WZ0($,Z,J){return H;function H(Q){return $.enter("characterEscape"),$.enter("escapeMarker"),$.consume(Q),$.exit("escapeMarker"),B}function B(Q){if(hm(Q))return $.enter("characterEscapeValue"),$.consume(Q),$.exit("characterEscapeValue"),$.exit("characterEscape"),Z;return J(Q)}}var HW={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=t5,Y(K)}function U(K){if(K===88||K===120)return $.enter("characterReferenceMarkerHexadecimal"),$.consume(K),$.exit("characterReferenceMarkerHexadecimal"),$.enter("characterReferenceValue"),Q=6,X=xm,Y;return $.enter("characterReferenceValue"),Q=7,X=BX,Y(K)}function Y(K){if(K===59&&B){let F=$.exit("characterReferenceValue");if(X===t5&&!FH(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 um={partial:!0,tokenize:AZ0},BW={concrete:!0,name:"codeFenced",tokenize:NZ0};function NZ0($,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"),X1(_)?J1($,K,"whitespace")(_):K(_)}function K(_){if(_===null||u0(_))return $.exit("codeFencedFence"),H.interrupt?Z(_):$.check(um,N,O)(_);return $.enter("codeFencedFenceInfo"),$.enter("chunkString",{contentType:"string"}),F(_)}function F(_){if(_===null||u0(_))return $.exit("chunkString"),$.exit("codeFencedFenceInfo"),K(_);if(X1(_))return $.exit("chunkString"),$.exit("codeFencedFenceInfo"),J1($,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,O,D)(_)}function D(_){return $.enter("lineEnding"),$.consume(_),$.exit("lineEnding"),A}function A(_){return Q>0&&X1(_)?J1($,V,"linePrefix",Q+1)(_):V(_)}function V(_){if(_===null||u0(_))return $.check(um,N,O)(_);return $.enter("codeFlowValue"),L(_)}function L(_){if(_===null||u0(_))return $.exit("codeFlowValue"),V(_);return $.consume(_),L}function O(_){return $.exit("codeFenced"),Z(_)}function M(_,w,C){let b=0;return T;function T(y){return _.enter("lineEnding"),_.consume(y),_.exit("lineEnding"),I}function I(y){return _.enter("codeFencedFence"),X1(y)?J1(_,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 C(y)}function R(y){if(y===z)return b++,_.consume(y),R;if(b>=X)return _.exit("codeFencedFenceSequence"),X1(y)?J1(_,j,"whitespace")(y):j(y);return C(y)}function j(y){if(y===null||u0(y))return _.exit("codeFencedFence"),w(y);return C(y)}}}function AZ0($,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 XX={name:"codeIndented",tokenize:VZ0},DZ0={partial:!0,tokenize:LZ0};function VZ0($,Z,J){let H=this;return B;function B(U){return $.enter("codeIndented"),J1($,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(DZ0,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 LZ0($,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 J1($,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 TM={name:"codeText",previous:PZ0,resolve:MZ0,tokenize:_Z0};function MZ0($){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 PZ0($){return $!==96||this.events[this.events.length-1][1].type==="characterEscape"}function _Z0($,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 CM{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)zX(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),zX(this.left,$)}unshift($){this.setCursor(0),this.right.push($)}unshiftMany($){this.setCursor(0),zX(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);zX(this.right,Z.reverse())}else{let Z=this.right.splice(this.left.length+this.right.length-$,Number.POSITIVE_INFINITY);zX(this.left,Z.reverse())}}}function zX($,Z){let J=0;if(Z.length<1e4)$.push(...Z);else while(J<Z.length)$.push(...Z.slice(J,J+1e4)),J+=1e4}function QW($){let Z={},J=-1,H,B,Q,X,z,G,U,Y=new CM($);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,OZ0(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 Q2($,0,Number.POSITIVE_INFINITY,Y.slice(0)),!U}function OZ0($,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 EM={resolve:TZ0,tokenize:CZ0},jZ0={partial:!0,tokenize:EZ0};function TZ0($){return QW($),$}function CZ0($,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(jZ0,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 EZ0($,Z,J){let H=this;return B;function B(X){return $.exit("chunkContent"),$.enter("lineEnding"),$.consume(X),$.exit("lineEnding"),J1($,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 XW($,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||r$(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||x1(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||r$(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 zW($,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=!X1(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 GW($,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"),J1($,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 o$($,Z){let J;return H;function H(B){if(u0(B))return $.enter("lineEnding"),$.consume(B),$.exit("lineEnding"),J=!0,H;if(X1(B))return J1($,H,J?"linePrefix":"lineSuffix")(B);return Z(B)}}var bM={name:"definition",tokenize:wZ0},bZ0={partial:!0,tokenize:SZ0};function wZ0($,Z,J){let H=this,B;return Q;function Q(W){return $.enter("definition"),X(W)}function X(W){return zW.call(H,$,z,J,"definitionLabel","definitionLabelMarker","definitionLabelString")(W)}function z(W){if(B=L4(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 x1(W)?o$($,U)(W):U(W)}function U(W){return XW($,Y,J,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(W)}function Y(W){return $.attempt(bZ0,K,K)(W)}function K(W){return X1(W)?J1($,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 SZ0($,Z,J){return H;function H(z){return x1(z)?o$($,B)(z):J(z)}function B(z){return GW($,Q,J,"definitionTitle","definitionTitleMarker","definitionTitleString")(z)}function Q(z){return X1(z)?J1($,X,"whitespace")(z):X(z)}function X(z){return z===null||u0(z)?Z(z):J(z)}}var wM={name:"hardBreakEscape",tokenize:RZ0};function RZ0($,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 SM={name:"headingAtx",resolve:IZ0,tokenize:kZ0};function IZ0($,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"},Q2($,H,J-H+1,[["enter",B,Z],["enter",Q,Z],["exit",Q,Z],["exit",B,Z]]);return $}function kZ0($,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||x1(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(X1(Y))return J1($,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||x1(Y))return $.exit("atxHeadingText"),z(Y);return $.consume(Y),U}}var pm=["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"],RM=["pre","script","style","textarea"];var IM={concrete:!0,name:"htmlFlow",resolveTo:hZ0,tokenize:vZ0},yZ0={partial:!0,tokenize:gZ0},xZ0={partial:!0,tokenize:fZ0};function hZ0($){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 vZ0($,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(_2(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(_2(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(_2(h))return $.consume(h),X=String.fromCharCode(h),D;return J(h)}function D(h){if(h===null||h===47||h===62||x1(h)){let d=h===47,o=X.toLowerCase();if(!d&&!Q&&RM.includes(o))return B=1,H.interrupt?Z(h):S(h);if(pm.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||t5(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(X1(h))return $.consume(h),V;return T(h)}function L(h){if(h===47)return $.consume(h),T;if(h===58||h===95||_2(h))return $.consume(h),O;if(X1(h))return $.consume(h),L;return T(h)}function O(h){if(h===45||h===46||h===58||h===95||t5(h))return $.consume(h),O;return M(h)}function M(h){if(h===61)return $.consume(h),_;if(X1(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(X1(h))return $.consume(h),_;return C(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 C(h){if(h===null||h===34||h===39||h===47||h===60||h===61||h===62||h===96||x1(h))return M(h);return $.consume(h),C}function b(h){if(h===47||h===62||X1(h))return L(h);return J(h)}function T(h){if(h===62)return $.consume(h),I;return J(h)}function I(h){if(h===null||u0(h))return S(h);if(X1(h))return $.consume(h),I;return J(h)}function S(h){if(h===45&&B===2)return $.consume(h),k;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),f;if(u0(h)&&(B===6||B===7))return $.exit("htmlFlowData"),$.check(yZ0,r,R)(h);if(h===null||u0(h))return $.exit("htmlFlowData"),R(h);return $.consume(h),S}function R(h){return $.check(xZ0,j,r)(h)}function j(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 k(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(RM.includes(d))return $.consume(h),l;return S(h)}if(_2(h)&&X.length<8)return $.consume(h),X+=String.fromCharCode(h),v;return S(h)}function f(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 fZ0($,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 gZ0($,Z,J){return H;function H(B){return $.enter("lineEnding"),$.consume(B),$.exit("lineEnding"),$.attempt(Y3,Z,J)}}var kM={name:"htmlText",tokenize:mZ0};function mZ0($,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(_2(E))return $.consume(E),C;return J(E)}function U(E){if(E===45)return $.consume(E),Y;if(E===91)return $.consume(E),Q=0,q;if(_2(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?k(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 k(E);if(E===93)return $.consume(E),A;return N(E)}function V(E){if(E===null||E===62)return k(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),O;if(u0(E))return X=L,x(E);return $.consume(E),L}function O(E){return E===62?k(E):L(E)}function M(E){if(_2(E))return $.consume(E),_;return J(E)}function _(E){if(E===45||t5(E))return $.consume(E),_;return w(E)}function w(E){if(u0(E))return X=w,x(E);if(X1(E))return $.consume(E),w;return k(E)}function C(E){if(E===45||t5(E))return $.consume(E),C;if(E===47||E===62||x1(E))return b(E);return J(E)}function b(E){if(E===47)return $.consume(E),k;if(E===58||E===95||_2(E))return $.consume(E),T;if(u0(E))return X=b,x(E);if(X1(E))return $.consume(E),b;return k(E)}function T(E){if(E===45||E===46||E===58||E===95||t5(E))return $.consume(E),T;return I(E)}function I(E){if(E===61)return $.consume(E),S;if(u0(E))return X=I,x(E);if(X1(E))return $.consume(E),I;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(X1(E))return $.consume(E),S;return $.consume(E),j}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 j(E){if(E===null||E===34||E===39||E===60||E===61||E===96)return J(E);if(E===47||E===62||x1(E))return b(E);return $.consume(E),j}function y(E){if(E===47||E===62||x1(E))return b(E);return J(E)}function k(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 X1(E)?J1($,f,"linePrefix",H.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):f(E)}function f(E){return $.enter("htmlTextData"),X(E)}}var n$={name:"labelEnd",resolveAll:dZ0,resolveTo:lZ0,tokenize:iZ0},uZ0={tokenize:rZ0},pZ0={tokenize:aZ0},cZ0={tokenize:oZ0};function dZ0($){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)Q2($,0,$.length,J);return $}function lZ0($,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=k4(z,$.slice(Q+1,Q+H+3)),z=k4(z,[["enter",Y,Z]]),z=k4(z,P7(Z.parser.constructs.insideSpan.null,$.slice(Q+H+4,X-3),Z)),z=k4(z,[["exit",Y,Z],$[X-2],$[X-1],["exit",U,Z]]),z=k4(z,$.slice(X+1)),z=k4(z,[["exit",G,Z]]),Q2($,Q,$.length,z),$}function iZ0($,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(L4(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(uZ0,Y,X?Y:K)(F);if(F===91)return $.attempt(pZ0,Y,X?U:K)(F);return X?Y(F):K(F)}function U(F){return $.attempt(cZ0,Y,K)(F)}function Y(F){return Z(F)}function K(F){return Q._balanced=!0,J(F)}}function rZ0($,Z,J){return H;function H(K){return $.enter("resource"),$.enter("resourceMarker"),$.consume(K),$.exit("resourceMarker"),B}function B(K){return x1(K)?o$($,Q)(K):Q(K)}function Q(K){if(K===41)return Y(K);return XW($,X,z,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(K)}function X(K){return x1(K)?o$($,G)(K):Y(K)}function z(K){return J(K)}function G(K){if(K===34||K===39||K===40)return GW($,U,J,"resourceTitle","resourceTitleMarker","resourceTitleString")(K);return Y(K)}function U(K){return x1(K)?o$($,Y)(K):Y(K)}function Y(K){if(K===41)return $.enter("resourceMarker"),$.consume(K),$.exit("resourceMarker"),$.exit("resource"),Z;return J(K)}}function aZ0($,Z,J){let H=this;return B;function B(z){return zW.call(H,$,Q,X,"reference","referenceMarker","referenceString")(z)}function Q(z){return H.parser.defined.includes(L4(H.sliceSerialize(H.events[H.events.length-1][1]).slice(1,-1)))?Z(z):J(z)}function X(z){return J(z)}}function oZ0($,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 yM={name:"labelStartImage",resolveAll:n$.resolveAll,tokenize:nZ0};function nZ0($,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 xM={name:"labelStartLink",resolveAll:n$.resolveAll,tokenize:sZ0};function sZ0($,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 GX={name:"lineEnding",tokenize:tZ0};function tZ0($,Z){return J;function J(H){return $.enter("lineEnding"),$.consume(H),$.exit("lineEnding"),J1($,Z,"linePrefix")}}var s$={name:"thematicBreak",tokenize:eZ0};function eZ0($,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"),X1(U)?J1($,z,"whitespace")(U):z(U)}}var M4={continuation:{tokenize:HJ0},exit:QJ0,name:"list",tokenize:JJ0},$J0={partial:!0,tokenize:XJ0},ZJ0={partial:!0,tokenize:BJ0};function JJ0($,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:BX(W)){if(!H.containerState.type)H.containerState.type=q,$.enter(q,{_container:!0});if(q==="listUnordered")return $.enter("listItemPrefix"),W===42||W===45?$.check(s$,J,U)(W):U(W);if(!H.interrupt||W===49)return $.enter("listItemPrefix"),$.enter("listItemValue"),G(W)}return J(W)}function G(W){if(BX(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(Y3,H.interrupt?J:Y,$.attempt($J0,F,K))}function Y(W){return H.containerState.initialBlankLine=!0,Q++,F(W)}function K(W){if(X1(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 HJ0($,Z,J){let H=this;return H.containerState._closeFlow=void 0,$.check(Y3,B,Q);function B(z){return H.containerState.furtherBlankLines=H.containerState.furtherBlankLines||H.containerState.initialBlankLine,J1($,Z,"listItemIndent",H.containerState.size+1)(z)}function Q(z){if(H.containerState.furtherBlankLines||!X1(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(ZJ0,Z,X)(z)}function X(z){return H.containerState._closeFlow=!0,H.interrupt=void 0,J1($,$.attempt(M4,Z,J),"linePrefix",H.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z)}}function BJ0($,Z,J){let H=this;return J1($,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 QJ0($){$.exit(this.containerState.type)}function XJ0($,Z,J){let H=this;return J1($,B,"listItemPrefixWhitespace",H.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function B(Q){let X=H.events[H.events.length-1];return!X1(Q)&&X&&X[1].type==="listItemPrefixWhitespace"?Z(Q):J(Q)}}var UW={name:"setextUnderline",resolveTo:zJ0,tokenize:GJ0};function zJ0($,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 GJ0($,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"),X1(U)?J1($,G,"lineSuffix")(U):G(U)}function G(U){if(U===null||u0(U))return $.exit("setextHeadingLine"),Z(U);return J(U)}}var cm={tokenize:UJ0};function UJ0($){let Z=this,J=$.attempt(Y3,H,$.attempt(this.parser.constructs.flowInitial,B,J1($,$.attempt(this.parser.constructs.flow,B,$.attempt(EM,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 dm={resolveAll:am()},lm=rm("string"),im=rm("text");function rm($){return{resolveAll:am($==="text"?YJ0: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 am($){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 YJ0($,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 hM={};I5(hM,{text:()=>AJ0,string:()=>NJ0,insideSpan:()=>DJ0,flowInitial:()=>WJ0,flow:()=>qJ0,document:()=>KJ0,disable:()=>LJ0,contentInitial:()=>FJ0,attentionMarkers:()=>VJ0});var KJ0={[42]:M4,[43]:M4,[45]:M4,[48]:M4,[49]:M4,[50]:M4,[51]:M4,[52]:M4,[53]:M4,[54]:M4,[55]:M4,[56]:M4,[57]:M4,[62]:ZW},FJ0={[91]:bM},WJ0={[-2]:XX,[-1]:XX,[32]:XX},qJ0={[35]:SM,[42]:s$,[45]:[UW,s$],[60]:IM,[61]:UW,[95]:s$,[96]:BW,[126]:BW},NJ0={[38]:HW,[92]:JW},AJ0={[-5]:GX,[-4]:GX,[-3]:GX,[33]:yM,[38]:HW,[42]:QX,[60]:[jM,kM],[91]:xM,[92]:[wM,JW],[93]:n$,[95]:QX,[96]:TM},DJ0={null:[QX,dm]},VJ0={null:[42,95]},LJ0={null:[]};function om($,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(C),consume:O,enter:M,exit:_,interrupt:b(C,{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=k4(X,R),V(),X[X.length-1]!==null)return[];return T(Z,0),Y.events=P7(Q,Y.events,Y),Y.events}function q(R,j){return PJ0(N(R),j)}function N(R){return MJ0(X,R)}function D(){let{_bufferIndex:R,_index:j,line:y,column:k,offset:x}=H;return{_bufferIndex:R,_index:j,line:y,column:k,offset:x}}function A(R){B[R.line]=R.column,S()}function V(){let R;while(H._index<X.length){let j=X[H._index];if(typeof j==="string"){if(R=H._index,H._bufferIndex<0)H._bufferIndex=0;while(H._index===R&&H._bufferIndex<j.length)L(j.charCodeAt(H._bufferIndex))}else L(j)}}function L(R){G=void 0,F=R,K=K(R)}function O(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,j){let y=j||{};return y.type=R,y.start=D(),Y.events.push(["enter",y,Y]),z.push(y),y}function _(R){let j=z.pop();return j.end=D(),Y.events.push(["exit",j,Y]),j}function w(R,j){T(R,j.from)}function C(R,j){j.restore()}function b(R,j){return y;function y(k,x,v){let f,E,l,r;return Array.isArray(k)?d(k):("tokenize"in k)?d([k]):h(k);function h(n){return Z0;function Z0(J0){let U0=J0!==null&&n[J0],z0=J0!==null&&n.null,Q0=[...Array.isArray(U0)?U0:U0?[U0]:[],...Array.isArray(z0)?z0:z0?[z0]:[]];return d(Q0)(J0)}}function d(n){if(f=n,E=0,n.length===0)return v;return o(n[E])}function o(n){return Z0;function Z0(J0){if(r=I(),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(j?Object.assign(Object.create(Y),j):Y,U,p,i)(J0)}}function p(n){return G=!0,R(l,r),x}function i(n){if(G=!0,r.restore(),++E<f.length)return o(f[E]);return v}}}function T(R,j){if(R.resolveAll&&!Q.includes(R))Q.push(R);if(R.resolve)Q2(Y.events,j,Y.events.length-j,R.resolve(Y.events.slice(j),Y));if(R.resolveTo)Y.events=R.resolveTo(Y.events,Y)}function I(){let R=D(),j=Y.previous,y=Y.currentConstruct,k=Y.events.length,x=Array.from(z);return{from:k,restore:v};function v(){H=R,Y.previous=j,Y.currentConstruct=y,Y.events.length=k,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 MJ0($,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 PJ0($,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 vM($){let H={constructs:eF([hM,...($||{}).extensions||[]]),content:B(vm),defined:[],document:B(gm),flow:B(cm),lazy:{},string:B(lm),text:B(im)};return H;function B(Q){return X;function X(z){return om(H,Q,z)}}}function fM($){while(!QW($));return $}var nm=/[\0\t\n\r]/g;function gM(){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(nm.lastIndex=K,U=nm.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 _J0=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function sm($){return $.replace(_J0,OJ0)}function OJ0($,Z,J){if(Z)return Z;if(J.charCodeAt(0)===35){let B=J.charCodeAt(1),Q=B===120||B===88;return $W(J.slice(Q?2:1),Q?16:10)}return FH(J)||$}var em={}.hasOwnProperty;function mM($,Z,J){if(Z&&typeof Z==="object")J=Z,Z=void 0;return jJ0(J)(fM(vM(J).document().write(gM()($,Z,!0))))}function jJ0($){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(Q0),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(X0),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:T,characterReferenceMarkerHexadecimal:o,characterReferenceMarkerNumeric:o,characterReferenceValue:p,characterReference:i,codeFenced:G(D),codeFencedFence:N,codeFencedFenceInfo:W,codeFencedFenceMeta:q,codeFlowValue:T,codeIndented:G(A),codeText:G(y),codeTextData:T,data:T,definition:G(),definitionDestinationString:O,definitionLabelString:V,definitionTitleString:L,emphasis:G(),hardBreakEscape:G(S),hardBreakTrailing:G(S),htmlFlow:G(R),htmlFlowData:T,htmlText:G(j),htmlTextData:T,image:G(x),label:f,labelText:v,lineEnding:I,link:G(k),listItem:G(),listOrdered:G(),listUnordered:G(),paragraph:G(),referenceString:d,resourceDestinationString:E,resourceTitleString:l,resource:r,setextHeading:G(C),setextHeadingLineSequence:w,setextHeadingText:_,strong:G(),thematicBreak:G()}};$u(Z,($||{}).mdastExtensions||[]);let J={};return H;function H(g){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<g.length)if(g[S0][1].type==="listOrdered"||g[S0][1].type==="listUnordered")if(g[S0][0]==="enter")W0.push(S0);else{let p0=W0.pop();S0=B(g,p0,S0)}S0=-1;while(++S0<g.length){let p0=Z[g[S0][0]];if(em.call(p0,g[S0][1].type))p0[g[S0][1].type].call(Object.assign({sliceSerialize:g[S0][2].sliceSerialize},t),g[S0][1])}if(t.tokenStack.length>0){let p0=t.tokenStack[t.tokenStack.length-1];(p0[1]||tm).call(t,void 0,p0[0])}u.position={start:_7(g.length>0?g[0][1].start:{line:1,column:1,offset:0}),end:_7(g.length>0?g[g.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(g,u,t){let W0=u-1,S0=-1,p0=!1,f0,T0,d0,z1;while(++W0<=t){let e0=g[W0];switch(e0[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{if(e0[0]==="enter")S0++;else S0--;z1=void 0;break}case"lineEndingBlank":{if(e0[0]==="enter"){if(f0&&!z1&&!S0&&!d0)d0=W0;z1=void 0}break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:z1=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(f0){let c0=W0;T0=void 0;while(c0--){let y0=g[c0];if(y0[1].type==="lineEnding"||y0[1].type==="lineEndingBlank"){if(y0[0]==="exit")continue;if(T0)g[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))f0._spread=!0;f0.end=Object.assign({},T0?g[T0][1].start:e0[1].end),g.splice(T0||W0,0,["exit",f0,e0[2]]),W0++,t++}if(e0[1].type==="listItemPrefix"){let c0={type:"listItem",_spread:!1,start:Object.assign({},e0[1].start),end:void 0};f0=c0,g.splice(W0,0,["enter",c0,e0[2]]),W0++,t++,d0=void 0,z1=!0}}}return g[u][1]._spread=p0,t}function Q(g,u){return t;function t(W0){if(z.call(this,g(W0),W0),u)u.call(this,W0)}}function X(){this.stack.push({type:"fragment",children:[]})}function z(g,u,t){this.stack[this.stack.length-1].children.push(g),this.stack.push(g),this.tokenStack.push([u,t||void 0]),g.position={start:_7(u.start),end:void 0}}function G(g){return u;function u(t){if(g)g.call(this,t);U.call(this,t)}}function U(g,u){let t=this.stack.pop(),W0=this.tokenStack.pop();if(!W0)throw Error("Cannot close `"+g.type+"` ("+L7({start:g.start,end:g.end})+"): it’s not open");else if(W0[0].type!==g.type)if(u)u.call(this,g,W0[0]);else(W0[1]||tm).call(this,g,W0[0]);t.position.end=_7(g.end)}function Y(){return i$(this.stack.pop())}function K(){this.data.expectingFirstListItemValue=!0}function F(g){if(this.data.expectingFirstListItemValue){let u=this.stack[this.stack.length-2];u.start=Number.parseInt(this.sliceSerialize(g),10),this.data.expectingFirstListItemValue=void 0}}function W(){let g=this.resume(),u=this.stack[this.stack.length-1];u.lang=g}function q(){let g=this.resume(),u=this.stack[this.stack.length-1];u.meta=g}function N(){if(this.data.flowCodeInside)return;this.buffer(),this.data.flowCodeInside=!0}function D(){let g=this.resume(),u=this.stack[this.stack.length-1];u.value=g.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function A(){let g=this.resume(),u=this.stack[this.stack.length-1];u.value=g.replace(/(\r?\n|\r)$/g,"")}function V(g){let u=this.resume(),t=this.stack[this.stack.length-1];t.label=u,t.identifier=L4(this.sliceSerialize(g)).toLowerCase()}function L(){let g=this.resume(),u=this.stack[this.stack.length-1];u.title=g}function O(){let g=this.resume(),u=this.stack[this.stack.length-1];u.url=g}function M(g){let u=this.stack[this.stack.length-1];if(!u.depth){let t=this.sliceSerialize(g).length;u.depth=t}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function w(g){let u=this.stack[this.stack.length-1];u.depth=this.sliceSerialize(g).codePointAt(0)===61?1:2}function C(){this.data.setextHeadingSlurpLineEnding=void 0}function b(g){let t=this.stack[this.stack.length-1].children,W0=t[t.length-1];if(!W0||W0.type!=="text")W0=A0(),W0.position={start:_7(g.start),end:void 0},t.push(W0);this.stack.push(W0)}function T(g){let u=this.stack.pop();u.value+=this.sliceSerialize(g),u.position.end=_7(g.end)}function I(g){let u=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=u.children[u.children.length-1];t.position.end=_7(g.end),this.data.atHardBreak=void 0;return}if(!this.data.setextHeadingSlurpLineEnding&&Z.canContainEols.includes(u.type))b.call(this,g),T.call(this,g)}function S(){this.data.atHardBreak=!0}function R(){let g=this.resume(),u=this.stack[this.stack.length-1];u.value=g}function j(){let g=this.resume(),u=this.stack[this.stack.length-1];u.value=g}function y(){let g=this.resume(),u=this.stack[this.stack.length-1];u.value=g}function k(){let g=this.stack[this.stack.length-1];if(this.data.inReference){let u=this.data.referenceType||"shortcut";g.type+="Reference",g.referenceType=u,delete g.url,delete g.title}else delete g.identifier,delete g.label;this.data.referenceType=void 0}function x(){let g=this.stack[this.stack.length-1];if(this.data.inReference){let u=this.data.referenceType||"shortcut";g.type+="Reference",g.referenceType=u,delete g.url,delete g.title}else delete g.identifier,delete g.label;this.data.referenceType=void 0}function v(g){let u=this.sliceSerialize(g),t=this.stack[this.stack.length-2];t.label=sm(u),t.identifier=L4(u).toLowerCase()}function f(){let g=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=g.children;t.children=W0}else t.alt=u}function E(){let g=this.resume(),u=this.stack[this.stack.length-1];u.url=g}function l(){let g=this.resume(),u=this.stack[this.stack.length-1];u.title=g}function r(){this.data.inReference=void 0}function h(){this.data.referenceType="collapsed"}function d(g){let u=this.resume(),t=this.stack[this.stack.length-1];t.label=u,t.identifier=L4(this.sliceSerialize(g)).toLowerCase(),this.data.referenceType="full"}function o(g){this.data.characterReferenceType=g.type}function p(g){let u=this.sliceSerialize(g),t=this.data.characterReferenceType,W0;if(t)W0=$W(u,t==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0;else W0=FH(u);let S0=this.stack[this.stack.length-1];S0.value+=W0}function i(g){let u=this.stack.pop();u.position.end=_7(g.end)}function n(g){T.call(this,g);let u=this.stack[this.stack.length-1];u.url=this.sliceSerialize(g)}function Z0(g){T.call(this,g);let u=this.stack[this.stack.length-1];u.url="mailto:"+this.sliceSerialize(g)}function J0(){return{type:"blockquote",children:[]}}function U0(){return{type:"code",lang:null,meta:null,value:""}}function z0(){return{type:"inlineCode",value:""}}function Q0(){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(g){return{type:"list",ordered:g.type==="listOrdered",start:null,spread:g._spread,children:[]}}function X0(g){return{type:"listItem",spread:g._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 _7($){return{line:$.line,column:$.column,offset:$.offset}}function $u($,Z){let J=-1;while(++J<Z.length){let H=Z[J];if(Array.isArray(H))$u($,H);else TJ0($,H)}}function TJ0($,Z){let J;for(J in Z)if(em.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 tm($,Z){if($)throw Error("Cannot close `"+$.type+"` ("+L7({start:$.start,end:$.end})+"): a different token (`"+Z.type+"`, "+L7({start:Z.start,end:Z.end})+") is open");else throw Error("Cannot close document, a token (`"+Z.type+"`, "+L7({start:Z.start,end:Z.end})+") is still open")}function YW($){let Z=this;Z.parser=J;function J(H){return mM(H,{...Z.data("settings"),...$,extensions:Z.data("micromarkExtensions")||[],mdastExtensions:Z.data("fromMarkdownExtensions")||[]})}}var KW=-1,WH=0,t$=1,qH=2,UX=3,YX=4,KX=5,FX=6,FW=7,WW=8;var Zu=typeof self==="object"?self:globalThis,CJ0=($,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 WH:case KW:return J(X,B);case t$:{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 UX:return J(new Date(X),B);case YX:{let{source:z,flags:G}=X;return J(new RegExp(z,G),B)}case KX:{let z=J(new Map,B);for(let[G,U]of X)z.set(H(G),H(U));return z}case FX:{let z=J(new Set,B);for(let G of X)z.add(H(G));return z}case FW:{let{name:z,message:G}=X;return J(new Zu[z](G),B)}case WW: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 Zu[Q](X),B)};return H},uM=($)=>CJ0(new Map,$)(0);var NH="",{toString:EJ0}={},{keys:bJ0}=Object,WX=($)=>{let Z=typeof $;if(Z!=="object"||!$)return[WH,Z];let J=EJ0.call($).slice(8,-1);switch(J){case"Array":return[t$,NH];case"Object":return[qH,NH];case"Date":return[UX,NH];case"RegExp":return[YX,NH];case"Map":return[KX,NH];case"Set":return[FX,NH];case"DataView":return[t$,J]}if(J.includes("Array"))return[t$,J];if(J.includes("Error"))return[FW,J];return[qH,J]},qW=([$,Z])=>$===WH&&(Z==="function"||Z==="symbol"),wJ0=($,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]=WX(X);switch(z){case WH:{let Y=X;switch(G){case"bigint":z=WW,Y=X.toString();break;case"function":case"symbol":if($)throw TypeError("unable to serialize "+G);Y=null;break;case"undefined":return B([KW],X)}return B([z,Y],X)}case t$:{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 bJ0(X))if($||!qW(WX(X[F])))Y.push([Q(F),Q(X[F])]);return K}case UX:return B([z,X.toISOString()],X);case YX:{let{source:Y,flags:K}=X;return B([z,{source:Y,flags:K}],X)}case KX:{let Y=[],K=B([z,Y],X);for(let[F,W]of X)if($||!(qW(WX(F))||qW(WX(W))))Y.push([Q(F),Q(W)]);return K}case FX:{let Y=[],K=B([z,Y],X);for(let F of X)if($||!qW(WX(F)))Y.push(Q(F));return K}}let{message:U}=X;return B([z,{name:G,message:U}],X)};return Q},pM=($,{json:Z,lossy:J}={})=>{let H=[];return wJ0(!(Z||J),!!Z,new Map,H)($),H};var AH=typeof structuredClone==="function"?($,Z)=>Z&&(("json"in Z)||("lossy"in Z))?uM(pM($,Z)):structuredClone($):($,Z)=>uM(pM($,Z));function SJ0($,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 RJ0($,Z){return"Back to reference "+($+1)+(Z>1?"-"+Z:"")}function Ju($){let Z=typeof $.options.clobberPrefix==="string"?$.options.clobberPrefix:"user-content-",J=$.options.footnoteBackContent||SJ0,H=$.options.footnoteBackLabel||RJ0,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=l8(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:{...AH(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 K3=function($){if($===null||$===void 0)return xJ0;if(typeof $==="function")return NW($);if(typeof $==="object")return Array.isArray($)?IJ0($):kJ0($);if(typeof $==="string")return yJ0($);throw Error("Expected function, string, or object as test")};function IJ0($){let Z=[],J=-1;while(++J<$.length)Z[J]=K3($[J]);return NW(H);function H(...B){let Q=-1;while(++Q<Z.length)if(Z[Q].apply(this,B))return!0;return!1}}function kJ0($){let Z=$;return NW(J);function J(H){let B=H,Q;for(Q in $)if(B[Q]!==Z[Q])return!1;return!0}}function yJ0($){return NW(Z);function Z(J){return J&&J.type===$}}function NW($){return Z;function Z(J,H,B){return Boolean(hJ0(J)&&$.call(this,J,typeof H==="number"?H:void 0,B||void 0))}}function xJ0(){return!0}function hJ0($){return $!==null&&typeof $==="object"&&"type"in $}function Hu($){return $}var Bu=[],AW=!0,e$=!1,DW="skip";function qX($,Z,J,H){let B;if(typeof Z==="function"&&typeof J!=="function")H=J,J=Z;else B=Z;let Q=K3(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 ("+Hu(G.type+(W?"<"+W+">":""))+")"})}return F;function F(){let W=Bu,q,N,D;if(!Z||Q(G,U,Y[Y.length-1]||void 0)){if(W=vJ0(J(G,Y)),W[0]===e$)return W}if("children"in G&&G.children){let A=G;if(A.children&&W[0]!==DW){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]===e$)return q;N=typeof q[1]==="number"?q[1]:N+X}}}return W}}}function vJ0($){if(Array.isArray($))return $;if(typeof $==="number")return[AW,$];return $===null||$===void 0?Bu:[$]}function d3($,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;qX($,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 Qu($,Z){let J={type:"element",tagName:"blockquote",properties:{},children:$.wrap($.all(Z),!0)};return $.patch(Z,J),$.applyData(Z,J)}function Xu($,Z){let J={type:"element",tagName:"br",properties:{},children:[]};return $.patch(Z,J),[$.applyData(Z,J),{type:"text",value:`
|
|
23
|
+
`}]}function zu($,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 Gu($,Z){let J={type:"element",tagName:"del",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function Uu($,Z){let J={type:"element",tagName:"em",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function Yu($,Z){let J=typeof $.options.clobberPrefix==="string"?$.options.clobberPrefix:"user-content-",H=String(Z.identifier).toUpperCase(),B=l8(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 Ku($,Z){let J={type:"element",tagName:"h"+Z.depth,properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function Fu($,Z){if($.options.allowDangerousHtml){let J={type:"raw",value:Z.value};return $.patch(Z,J),$.applyData(Z,J)}return}function VW($,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 Wu($,Z){let J=String(Z.identifier).toUpperCase(),H=$.definitionById.get(J);if(!H)return VW($,Z);let B={src:l8(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 qu($,Z){let J={src:l8(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 Nu($,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 Au($,Z){let J=String(Z.identifier).toUpperCase(),H=$.definitionById.get(J);if(!H)return VW($,Z);let B={href:l8(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 Du($,Z){let J={href:l8(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 Vu($,Z,J){let H=$.all(Z),B=J?fJ0(J):Lu(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 fJ0($){let Z=!1;if($.type==="list"){Z=$.spread||!1;let J=$.children,H=-1;while(!Z&&++H<J.length)Z=Lu(J[H])}return Z}function Lu($){let Z=$.spread;return Z===null||Z===void 0?$.children.length>1:Z}function Mu($,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 Pu($,Z){let J={type:"element",tagName:"p",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function _u($,Z){let J={type:"root",children:$.wrap($.all(Z))};return $.patch(Z,J),$.applyData(Z,J)}function Ou($,Z){let J={type:"element",tagName:"strong",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function ju($,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=KH(Z.children[1]),G=tF(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 Tu($,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 Cu($,Z){let J={type:"element",tagName:"td",properties:{},children:$.all(Z)};return $.patch(Z,J),$.applyData(Z,J)}function bu($){let Z=String($),J=/\r?\n|\r/g,H=J.exec(Z),B=0,Q=[];while(H)Q.push(Eu(Z.slice(B,H.index),B>0,!0),H[0]),B=H.index+H[0].length,H=J.exec(Z);return Q.push(Eu(Z.slice(B),B>0,!1)),Q.join("")}function Eu($,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 wu($,Z){let J={type:"text",value:bu(String(Z.value))};return $.patch(Z,J),$.applyData(Z,J)}function Su($,Z){let J={type:"element",tagName:"hr",properties:{},children:[]};return $.patch(Z,J),$.applyData(Z,J)}var Ru={blockquote:Qu,break:Xu,code:zu,delete:Gu,emphasis:Uu,footnoteReference:Yu,heading:Ku,html:Fu,imageReference:Wu,image:qu,inlineCode:Nu,linkReference:Au,link:Du,listItem:Vu,list:Mu,paragraph:Pu,root:_u,strong:Ou,table:ju,tableCell:Cu,tableRow:Tu,text:wu,thematicBreak:Su,toml:LW,yaml:LW,definition:LW,footnoteDefinition:LW};function LW(){return}var cM={}.hasOwnProperty,gJ0={};function ku($,Z){let J=Z||gJ0,H=new Map,B=new Map,Q=new Map,X={...Ru,...J.handlers},z={all:U,applyData:uJ0,definitionById:H,footnoteById:B,footnoteCounts:Q,footnoteOrder:[],handlers:X,one:G,options:J,patch:mJ0,wrap:cJ0};return d3($,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(cM.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=AH(D);return A.children=z.all(Y),A}return AH(Y)}return(z.options.unknownHandler||pJ0)(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=Iu(q.value);if(!Array.isArray(q)&&q.type==="element"){let N=q.children[0];if(N&&N.type==="text")N.value=Iu(N.value)}}if(Array.isArray(q))K.push(...q);else K.push(q)}}}return K}}function mJ0($,Z){if($.position)Z.position=VM($)}function uJ0($,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,AH(Q));if("children"in J&&J.children&&B!==null&&B!==void 0)J.children=B}return J}function pJ0($,Z){let J=Z.data||{},H="value"in Z&&!(cM.call(J,"hProperties")||cM.call(J,"hChildren"))?{type:"text",value:Z.value}:{type:"element",tagName:"div",properties:{},children:$.all(Z)};return $.patch(Z,H),$.applyData(Z,H)}function cJ0($,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 Iu($){let Z=0,J=$.charCodeAt(Z);while(J===9||J===32)Z++,J=$.charCodeAt(Z);return $.slice(Z)}function MW($,Z){let J=ku($,Z),H=J.one($,void 0),B=Ju(J),Q=Array.isArray(H)?{type:"root",children:H}:H||{type:"root",children:[]};if(B)X5("children"in Q),Q.children.push({type:"text",value:`
|
|
30
|
+
`},B);return Q}function PW($,Z){if($&&"run"in $)return async function(J,H){let B=MW(J,{file:H,...Z});await $.run(B,H)};return function(J,H){return MW(J,{file:H,...$||Z})}}function dM($){if($)throw $}var jW=P(pu(),1);function NX($){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 lM(){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)cu(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 cu($,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 F9={basename:dJ0,dirname:lJ0,extname:iJ0,join:rJ0,sep:"/"};function dJ0($,Z){if(Z!==void 0&&typeof Z!=="string")throw TypeError('"ext" argument must be a string');AX($);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 lJ0($){if(AX($),$.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 iJ0($){AX($);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 rJ0(...$){let Z=-1,J;while(++Z<$.length)if(AX($[Z]),$[Z])J=J===void 0?$[Z]:J+"/"+$[Z];return J===void 0?".":aJ0(J)}function aJ0($){AX($);let Z=$.codePointAt(0)===47,J=oJ0($,!Z);if(J.length===0&&!Z)J=".";if(J.length>0&&$.codePointAt($.length-1)===47)J+="/";return Z?"/"+J:J}function oJ0($,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 AX($){if(typeof $!=="string")throw TypeError("Path must be a string. Received "+JSON.stringify($))}var du={cwd:nJ0};function nJ0(){return"/"}function DH($){return Boolean($!==null&&typeof $==="object"&&"href"in $&&$.href&&"protocol"in $&&$.protocol&&$.auth===void 0)}function lu($){if(typeof $==="string")$=new URL($);else if(!DH($)){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 sJ0($)}function sJ0($){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 iM=["history","path","basename","stem","extname","dirname"];class VH{constructor($){let Z;if(!$)Z={};else if(DH($))Z={path:$};else if(typeof $==="string"||tJ0($))Z={value:$};else Z=$;this.cwd="cwd"in Z?"":du.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let J=-1;while(++J<iM.length){let B=iM[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(!iM.includes(H))this[H]=Z[H]}get basename(){return typeof this.path==="string"?F9.basename(this.path):void 0}set basename($){aM($,"basename"),rM($,"basename"),this.path=F9.join(this.dirname||"",$)}get dirname(){return typeof this.path==="string"?F9.dirname(this.path):void 0}set dirname($){iu(this.basename,"dirname"),this.path=F9.join($||"",this.basename)}get extname(){return typeof this.path==="string"?F9.extname(this.path):void 0}set extname($){if(rM($,"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=F9.join(this.dirname,this.stem+($||""))}get path(){return this.history[this.history.length-1]}set path($){if(DH($))$=lu($);if(aM($,"path"),this.path!==$)this.history.push($)}get stem(){return typeof this.path==="string"?F9.basename(this.path,this.extname):void 0}set stem($){aM($,"stem"),rM($,"stem"),this.path=F9.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 N2($,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 rM($,Z){if($&&$.includes(F9.sep))throw Error("`"+Z+"` cannot be a path: did not expect `"+F9.sep+"`")}function aM($,Z){if(!$)throw Error("`"+Z+"` cannot be empty")}function iu($,Z){if(!$)throw Error("Setting `"+Z+"` requires `path` to be set too")}function tJ0($){return Boolean($&&typeof $==="object"&&"byteLength"in $&&"byteOffset"in $)}var ru=function($){let H=this.constructor.prototype,B=H[$],Q=function(){return B.apply(Q,arguments)};return Object.setPrototypeOf(Q,H),Q};var eJ0={}.hasOwnProperty;class tM extends ru{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=lM()}copy(){let $=new tM,Z=-1;while(++Z<this.attachers.length){let J=this.attachers[Z];$.use(...J)}return $.data(jW.default(!0,{},this.namespace)),$}data($,Z){if(typeof $==="string"){if(arguments.length===2)return sM("data",this.frozen),this.namespace[$]=Z,this;return eJ0.call(this.namespace,$)&&this.namespace[$]||void 0}if($)return sM("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=OW($),J=this.parser||this.Parser;return oM("parse",J),J(String(Z),Z)}process($,Z){let J=this;return this.freeze(),oM("process",this.parser||this.Parser),nM("process",this.compiler||this.Compiler),Z?H(void 0,Z):new Promise(H);function H(B,Q){let X=OW($),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(ZH0(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 X5(Z,"`done` is defined if `resolve` is not"),Z(void 0,Y)}}}processSync($){let Z=!1,J;return this.freeze(),oM("processSync",this.parser||this.Parser),nM("processSync",this.compiler||this.Compiler),this.process($,H),ou("processSync","process",Z),X5(J,"we either bailed on an error or have a tree"),J;function H(B,Q){Z=!0,dM(B),J=Q}}run($,Z,J){au($),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){X5(typeof Z!=="function","`file` can’t be a `done` anymore, we checked");let z=OW(Z);H.run($,z,G);function G(U,Y,K){let F=Y||$;if(U)X(U);else if(Q)Q(F);else X5(J,"`done` is defined if `resolve` is not"),J(void 0,F,K)}}}runSync($,Z){let J=!1,H;return this.run($,Z,B),ou("runSync","run",J),X5(H,"we either bailed on an error or have a tree"),H;function B(Q,X){dM(Q),H=X,J=!0}}stringify($,Z){this.freeze();let J=OW(Z),H=this.compiler||this.Compiler;return nM("stringify",H),au($),H($,J)}use($,...Z){let J=this.attachers,H=this.namespace;if(sM("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=jW.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(NX(q)&&NX(F))F=jW.default(!0,q,F);J[K]=[G,F,...W]}}}}var eM=new tM().freeze();function oM($,Z){if(typeof Z!=="function")throw TypeError("Cannot `"+$+"` without `parser`")}function nM($,Z){if(typeof Z!=="function")throw TypeError("Cannot `"+$+"` without `compiler`")}function sM($,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 au($){if(!NX($)||typeof $.type!=="string")throw TypeError("Expected node, got `"+$+"`")}function ou($,Z,J){if(!J)throw Error("`"+$+"` finished async. Use `"+Z+"` instead")}function OW($){return $H0($)?$:new VH($)}function $H0($){return Boolean($&&typeof $==="object"&&"message"in $&&"messages"in $)}function ZH0($){return typeof $==="string"||JH0($)}function JH0($){return Boolean($&&typeof $==="object"&&"byteLength"in $&&"byteOffset"in $)}var HH0="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",nu=[],su={allowDangerousHtml:!0},BH0=/^(https?|ircs?|mailto|xmpp)$/i,QH0=[{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 TW($){let Z=XH0($),J=zH0($);return GH0(Z.runSync(Z.parse(J),J),$)}function XH0($){let Z=$.rehypePlugins||nu,J=$.remarkPlugins||nu,H=$.remarkRehypeOptions?{...$.remarkRehypeOptions,...su}:su;return eM().use(YW).use(J).use(PW,H).use(Z)}function zH0($){let Z=$.children||"",J=new VH;if(typeof Z==="string")J.value=Z;else iF("Unexpected value `"+Z+"` for `children` prop, expected `string`");return J}function GH0($,Z){let{allowedElements:J,allowElement:H,components:B,disallowedElements:Q,skipHtml:X,unwrapDisallowed:z}=Z,G=Z.urlTransform||CW;for(let Y of QH0)if(Object.hasOwn(Z,Y.from))iF("Unexpected `"+Y.from+"` prop, "+(Y.to?"use `"+Y.to+"` instead":"remove it")+" (see <"+HH0+"#"+Y.id+"> for more info)");if(J&&Q)iF("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other");return d3($,U),PM($,{Fragment:LH.Fragment,components:B,ignoreInvalidStyle:!0,jsx:LH.jsx,jsxs:LH.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 HX)if(Object.hasOwn(HX,W)&&Object.hasOwn(Y.properties,W)){let q=Y.properties[W],N=HX[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 CW($){let Z=$.indexOf(":"),J=$.indexOf("?"),H=$.indexOf("#"),B=$.indexOf("/");if(Z===-1||B!==-1&&Z>B||J!==-1&&Z>J||H!==-1&&Z>H||BH0.test($.slice(0,Z)))return $;return""}var EW=function($,Z,J){let H=K3(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 l3=function($){if($===null||$===void 0)return KH0;if(typeof $==="string")return YH0($);if(typeof $==="object")return UH0($);if(typeof $==="function")return $P($);throw Error("Expected function, string, or array as `test`")};function UH0($){let Z=[],J=-1;while(++J<$.length)Z[J]=l3($[J]);return $P(H);function H(...B){let Q=-1;while(++Q<Z.length)if(Z[Q].apply(this,B))return!0;return!1}}function YH0($){return $P(Z);function Z(J){return J.tagName===$}}function $P($){return Z;function Z(J,H,B){return Boolean(FH0(J)&&$.call(this,J,typeof H==="number"?H:void 0,B||void 0))}}function KH0($){return Boolean($&&typeof $==="object"&&"type"in $&&$.type==="element"&&"tagName"in $&&typeof $.tagName==="string")}function FH0($){return $!==null&&typeof $==="object"&&"type"in $&&"tagName"in $}var eu=/\n/g,$p=/[\t ]+/g,ZP=l3("br"),Zp=l3(LH0),WH0=l3("p"),Jp=l3("tr"),qH0=l3(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",VH0,MH0]),Hp=l3(["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 JP($,Z){let J=Z||{},H="children"in $?$.children:[],B=Hp($),Q=Xp($,{whitespace:J.whitespace||"normal",breakBefore:!1,breakAfter:!1}),X=[];if($.type==="text"||$.type==="comment")X.push(...Qp($,{whitespace:Q,breakBefore:!0,breakAfter:!0}));let z=-1;while(++z<H.length)X.push(...Bp(H[z],$,{whitespace:Q,breakBefore:z?void 0:B,breakAfter:z<H.length-1?ZP(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 Bp($,Z,J){if($.type==="element")return NH0($,Z,J);if($.type==="text")return J.whitespace==="normal"?Qp($,J):AH0($);return[]}function NH0($,Z,J){let H=Xp($,J),B=$.children||[],Q=-1,X=[];if(qH0($))return X;let z,G;if(ZP($))G=`
|
|
32
|
+
`;else if(Jp($)&&EW(Z,$,Jp))G=`
|
|
33
|
+
`;else if(WH0($))z=2,G=2;else if(Hp($))z=1,G=1;while(++Q<B.length)X=X.concat(Bp(B[Q],$,{whitespace:H,breakBefore:Q?void 0:z,breakAfter:Q<B.length-1?ZP(B[Q+1]):G}));if(Zp($)&&EW(Z,$,Zp))X.push("\t");if(z)X.unshift(z);if(G)X.push(G);return X}function Qp($,Z){let J=String($.value),H=[],B=[],Q=0;while(Q<=J.length){eu.lastIndex=Q;let G=eu.exec(J),U=G&&"index"in G?G.index:J.length;H.push(DH0(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 AH0($){return[String($.value)]}function DH0($,Z,J){let H=[],B=0,Q;while(B<$.length){$p.lastIndex=B;let X=$p.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 Xp($,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 VH0($){return Boolean(($.properties||{}).hidden)}function LH0($){return $.tagName==="td"||$.tagName==="th"}function MH0($){return $.tagName==="dialog"&&!($.properties||{}).open}function PH0($){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"],O={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:O,contains:_.concat([{begin:/\(/,end:/\)/,keywords:O,contains:_.concat(["self"]),relevance:0}]),relevance:0},C={className:"function",begin:"("+X+"[\\*&\\s]+)+"+W,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:O,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:O,relevance:0,contains:[J,$.C_BLOCK_COMMENT_MODE,U,Y,z,{begin:/\(/,end:/\)/,keywords:O,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:O,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(w,C,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:O,contains:["self",z]},{begin:$.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function zp($){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=PH0($),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 Gp($){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"],O=["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",...O,...M]},contains:[W,$.SHEBANG(),q,K,Q,X,A,z,G,U,Y,J]}}function Up($){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 Yp($){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"],O={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:O,contains:_.concat([{begin:/\(/,end:/\)/,keywords:O,contains:_.concat(["self"]),relevance:0}]),relevance:0},C={className:"function",begin:"("+X+"[\\*&\\s]+)+"+W,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:O,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:O,relevance:0,contains:[J,$.C_BLOCK_COMMENT_MODE,U,Y,z,{begin:/\(/,end:/\)/,keywords:O,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:O,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(w,C,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:O,contains:["self",z]},{begin:$.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Kp($){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+")*>)?(\\[\\])?",O={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]},O]}}var _H0=($)=>{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_-]*/}}},OH0=["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"],jH0=["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"],TH0=[...OH0,...jH0],CH0=["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(),EH0=["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(),bH0=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),wH0=["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 Fp($){let Z=$.regex,J=_H0($),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:":("+EH0.join("|")+")"},{begin:":(:)?("+bH0.join("|")+")"}]},J.CSS_VARIABLE,{className:"attribute",begin:"\\b("+wH0.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:CH0.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...z,J.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+TH0.join("|")+")\\b"}]}}function Wp($){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 qp($){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 Np($){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 Ap($){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 MH="[0-9](_*[0-9])*",bW=`\\.(${MH})`,wW="[0-9a-fA-F](_*[0-9a-fA-F])*",Dp={className:"number",variants:[{begin:`(\\b(${MH})((${bW})|\\.)?|(${bW}))[eE][+-]?(${MH})[fFdD]?\\b`},{begin:`\\b(${MH})((${bW})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${bW})[fFdD]?\\b`},{begin:`\\b(${MH})[fFdD]\\b`},{begin:`\\b0[xX]((${wW})\\.?|(${wW})?\\.(${wW}))[pP][+-]?(${MH})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${wW})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Vp($,Z,J){if(J===-1)return"";return $.replace(Z,(H)=>{return Vp($,Z,J-1)})}function Lp($){let Z=$.regex,J="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",H="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*"+Vp("(?:<"+"[À-ʸ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,Dp,$.C_BLOCK_COMMENT_MODE]},$.C_LINE_COMMENT_MODE,$.C_BLOCK_COMMENT_MODE]},Dp,U]}}var SH0=["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"],RH0=["true","false","null","undefined","NaN","Infinity"],Mp=["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"],Pp=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],_p=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],IH0=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],kH0=[].concat(_p,Mp,Pp);function Op($){let Z=$.regex,J=(v,{after:f})=>{let E="</"+v[0].slice(1);return v.input.indexOf(E,f)!==-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,f)=>{let E=v[0].length+v.index,l=v.input[E];if(l==="<"||l===","){f.ignoreMatch();return}if(l===">"){if(!J(v,{after:E}))f.ignoreMatch()}let r,h=v.input.substring(E);if(r=h.match(/^\s*=/)){f.ignoreMatch();return}if(r=h.match(/^\s+extends\s+/)){if(r.index===0){f.ignoreMatch();return}}}},z={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:SH0,literal:RH0,built_in:kH0,"variable.language":IH0},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 O=[].concat(V,F.contains),M=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:z,contains:["self"].concat(O)}]),_={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"}}]},C={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:{_:[...Mp,...Pp]}},b={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={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:/%/},I={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([..._p,"super","import"].map((v)=>`${v}\\s*\\(`)),"[A-Za-z$_][0-9A-Za-z$_]*",Z.lookahead(/\s*\(/)),className:"title.function",relevance:0},j={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:/\(\)/},_]},k="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+$.UNDERSCORE_IDENT_RE+")\\s*=>",x={match:[/const|var|let/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s*/,/=\s*/,/(async\s*)?/,Z.lookahead(k)],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:C},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,C,{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:k,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"]}]}]},T,{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},j,{match:"\\$[A-Za-z$_][0-9A-Za-z$_]*",relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[_]},R,I,w,y,{match:/\$[(.]/}]}}function jp($){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 PH="[0-9](_*[0-9])*",SW=`\\.(${PH})`,RW="[0-9a-fA-F](_*[0-9a-fA-F])*",yH0={className:"number",variants:[{begin:`(\\b(${PH})((${SW})|\\.)?|(${SW}))[eE][+-]?(${PH})[fFdD]?\\b`},{begin:`\\b(${PH})((${SW})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${SW})[fFdD]?\\b`},{begin:`\\b(${PH})[fFdD]\\b`},{begin:`\\b0[xX]((${RW})\\.?|(${RW})?\\.(${RW}))[pP][+-]?(${PH})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${RW})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Tp($){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=yH0,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 xH0=($)=>{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_-]*/}}},hH0=["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"],vH0=["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"],fH0=[...hH0,...vH0],gH0=["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(),Cp=["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(),Ep=["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(),uH0=Cp.concat(Ep).sort().reverse();function bp($){let Z=xH0($),J=uH0,H="and or not only",B="[\\w-]+",Q="([\\w-]+|@\\{[\\w-]+\\})",X=[],z=[],G=function(L){return{className:"string",begin:"~?"+L+".*?"+L}},U=function(L,O,M){return{className:L,begin:O,relevance:M}},Y={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:gH0.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("+mH0.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("+fH0.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:":("+Cp.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+Ep.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 wp($){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 Sp($){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 Rp($){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 Ip($){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 kp($){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 yp($){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":(j,y)=>{y.data._beginMatch=j[1]||j[2]},"on:end":(j,y)=>{if(y.data._beginMatch!==j[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"],O={keyword:A,literal:((j)=>{let y=[];return j.forEach((k)=>{if(y.push(k),k.toLowerCase()===k)y.push(k.toUpperCase());else y.push(k.toLowerCase())}),y})(D),built_in:V},M=(j)=>{return j.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(?!\\()"),C={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(/(?!::)/))},T={relevance:0,begin:/\(/,end:/\)/,keywords:O,contains:[b,X,C,$.C_BLOCK_COMMENT_MODE,q,N,_]},I={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:[T]};T.contains.push(I);let S=[b,C,$.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:O,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,I,C,{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:O,contains:["self",R,X,C,$.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 xp($){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 hp($){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function vp($){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 fp($){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function gp($){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 mp($){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="[>?]>",C="[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]",b="(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>",T=[{begin:/^\s*=>/,starts:{end:"$",contains:_}},{className:"meta.prompt",begin:"^("+w+"|"+C+"|"+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(T).concat(U).concat(_)}}function up($){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 pH0=($)=>{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_-]*/}}},cH0=["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"],dH0=["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"],lH0=[...cH0,...dH0],iH0=["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(),rH0=["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(),aH0=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),oH0=["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 pp($){let Z=pH0($),J=aH0,H=rH0,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("+lH0.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("+oH0.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:iH0.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 cp($){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function dp($){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 O(M,{exceptions:_,when:w}={}){let C=w;return _=_||[],M.map((b)=>{if(b.match(/\|\d+$/)||_.includes(b))return b;else if(C(b))return`${b}|0`;else return b})}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:O(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 ap($){if(!$)return null;if(typeof $==="string")return $;return $.source}function DX($){return C5("(?=",$,")")}function C5(...$){return $.map((J)=>ap(J)).join("")}function nH0($){let Z=$[$.length-1];if(typeof Z==="object"&&Z.constructor===Object)return $.splice($.length-1,1),Z;else return{}}function y4(...$){return"("+(nH0($).capture?"":"?:")+$.map((H)=>ap(H)).join("|")+")"}var QP=($)=>C5(/\b/,$,/\w$/.test($)?/\b/:/\B/),sH0=["Protocol","Type"].map(QP),lp=["init","self"].map(QP),tH0=["Any","Self"],HP=["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"],eH0=["assignment","associativity","higherThan","left","lowerThan","none","right"],$B0=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],rp=["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"],op=y4(/[/=\-+!*%<>&|^~?]/,/[\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]/),np=y4(op,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),BP=C5(op,np,"*"),sp=y4(/[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]/),kW=y4(sp,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),F3=C5(sp,kW,"*"),IW=C5(/[A-Z]/,kW,"*"),ZB0=["attached","autoclosure",C5(/convention\(/,y4("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",C5(/objc\(/,F3,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],JB0=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function tp($){let Z={match:/\s+/,relevance:0},J=$.COMMENT("/\\*","\\*/",{contains:["self"]}),H=[$.C_LINE_COMMENT_MODE,J],B={match:[/\./,y4(...sH0,...lp)],className:{2:"keyword"}},Q={match:C5(/\./,y4(...HP)),relevance:0},X=HP.filter((F0)=>typeof F0==="string").concat(["_|0"]),z=HP.filter((F0)=>typeof F0!=="string").concat(tH0).map(QP),G={variants:[{className:"keyword",match:y4(...z,...lp)}]},U={$pattern:y4(/\b\w+/,/#\w+/),keyword:X.concat($B0),literal:ip},Y=[B,Q,G],K={match:C5(/\./,y4(...rp)),relevance:0},F={className:"built_in",match:C5(/\b/,y4(...rp),/(?=\()/)},W=[K,F],q={match:/->/,relevance:0},N={className:"operator",relevance:0,variants:[{match:BP},{match:`\\.(\\.|${np})+`}]},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/}]},O=(F0="")=>({className:"subst",variants:[{match:C5(/\\/,F0,/[0\\tnr"']/)},{match:C5(/\\/,F0,/u\{[0-9a-fA-F]{1,8}\}/)}]}),M=(F0="")=>({className:"subst",match:C5(/\\/,F0,/[\t ]*(?:[\r\n]|\r\n)/)}),_=(F0="")=>({className:"subst",label:"interpol",begin:C5(/\\/,F0,/\(/),end:/\)/}),w=(F0="")=>({begin:C5(F0,/"""/),end:C5(/"""/,F0),contains:[O(F0),M(F0),_(F0)]}),C=(F0="")=>({begin:C5(F0,/"/),end:C5(/"/,F0),contains:[O(F0),_(F0)]}),b={className:"string",variants:[w(),w("#"),w("##"),w("###"),C(),C("#"),C("##"),C("###")]},T=[$.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[$.BACKSLASH_ESCAPE]}],I={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:T},S=(F0)=>{let s=C5(F0,/\//),a=C5(/\//,F0);return{begin:s,end:a,contains:[...T,{scope:"comment",begin:`#(?!.*${a})`,end:/$/}]}},R={scope:"regexp",variants:[S("###"),S("##"),S("#"),I]},j={match:C5(/`/,F3,/`/)},y={className:"variable",match:/\$\d+/},k={className:"variable",match:`\\$${kW}+`},x=[j,y,k],v={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:JB0,contains:[...D,L,b]}]}},f={scope:"keyword",match:C5(/@/,y4(...ZB0),DX(y4(/\(/,/\s+/)))},E={scope:"meta",match:C5(/@/,F3)},l=[v,f,E],r={match:DX(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:C5(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,kW,"+")},{className:"type",match:IW,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:C5(/\s+&\s+/,DX(IW)),relevance:0}]},h={begin:/</,end:/>/,keywords:U,contains:[...H,...Y,...l,q,r]};r.contains.push(h);let d={match:C5(F3,/\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:y4(DX(C5(F3,/\s*:/)),DX(C5(F3,/\s+/,F3,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:F3}]},n={begin:/\(/,end:/\)/,keywords:U,contains:[i,...H,...Y,...D,L,b,...l,r,o],endsParent:!0,illegal:/["']/},Z0={match:[/(func|macro)/,/\s+/,y4(j.match,F3,BP)],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+/,BP],className:{1:"keyword",3:"title"}},z0={begin:[/precedencegroup/,/\s+/,IW],className:{1:"keyword",3:"title"},contains:[r],keywords:[...eH0,...ip],end:/}/},Q0={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+/,F3,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:U,contains:[p,...Y,{begin:/:/,end:/\{/,keywords:U,contains:[{scope:"title.class.inherited",match:IW},...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,Q0,N0,D0,U0,z0,{beginKeywords:"import",end:/$/,contains:[...H],relevance:0},R,...Y,...W,...D,L,b,...x,...l,r,o]}}var ep=["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"],$c=["true","false","null","undefined","NaN","Infinity"],Zc=["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"],Jc=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Hc=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Bc=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Qc=[].concat(Hc,Zc,Jc);function HB0($){let Z=$.regex,J=(v,{after:f})=>{let E="</"+v[0].slice(1);return v.input.indexOf(E,f)!==-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,f)=>{let E=v[0].length+v.index,l=v.input[E];if(l==="<"||l===","){f.ignoreMatch();return}if(l===">"){if(!J(v,{after:E}))f.ignoreMatch()}let r,h=v.input.substring(E);if(r=h.match(/^\s*=/)){f.ignoreMatch();return}if(r=h.match(/^\s+extends\s+/)){if(r.index===0){f.ignoreMatch();return}}}},z={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:ep,literal:$c,built_in:Qc,"variable.language":Bc},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 O=[].concat(V,F.contains),M=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:z,contains:["self"].concat(O)}]),_={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"}}]},C={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:{_:[...Zc,...Jc]}},b={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={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:/%/},I={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([...Hc,"super","import"].map((v)=>`${v}\\s*\\(`)),"[A-Za-z$_][0-9A-Za-z$_]*",Z.lookahead(/\s*\(/)),className:"title.function",relevance:0},j={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:/\(\)/},_]},k="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+$.UNDERSCORE_IDENT_RE+")\\s*=>",x={match:[/const|var|let/,/\s+/,"[A-Za-z$_][0-9A-Za-z$_]*",/\s*/,/=\s*/,/(async\s*)?/,Z.lookahead(k)],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:C},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,C,{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:k,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"]}]}]},T,{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},j,{match:"\\$[A-Za-z$_][0-9A-Za-z$_]*",relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[_]},R,I,w,y,{match:/\$[(.]/}]}}function Xc($){let Z=$.regex,J=HB0($),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:ep.concat(G),literal:$c,built_in:Qc.concat(B),"variable.language":Bc},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 zc($){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 Gc($){$.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 Uc($){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 Yc($){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 XP={arduino:zp,bash:Gp,c:Up,cpp:Yp,csharp:Kp,css:Fp,diff:Wp,go:qp,graphql:Np,ini:Ap,java:Lp,javascript:Op,json:jp,kotlin:Tp,less:bp,lua:wp,makefile:Sp,markdown:Rp,objectivec:Ip,perl:kp,php:yp,"php-template":xp,plaintext:hp,python:vp,"python-repl":fp,r:gp,ruby:mp,rust:up,scss:pp,shell:cp,sql:dp,swift:tp,typescript:Xc,vbnet:zc,wasm:Gc,xml:Uc,yaml:Yc};var yc=P(kc(),1);var xc=yc.default;var hc={},rB0="hljs-";function WP($){let Z=xc.newInstance();if($)Q($);return{highlight:J,highlightAuto:H,listLanguages:B,register:Q,registerAlias:X,registered:z};function J(G,U,Y){X5(typeof G==="string","expected `string` as `name`"),X5(typeof U==="string","expected `string` as `value`");let K=Y||hc,F=typeof K.prefix==="string"?K.prefix:rB0;if(!Z.getLanguage(G))throw Error("Unknown language: `"+G+"` is not registered");Z.configure({__emitter:vc,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){X5(typeof G==="string","expected `string` as `value`");let K=(U||hc).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")X5(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")X5(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 vc{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 aB0={};function vW($){let Z=$||aB0,J=Z.aliases,H=Z.detect||!1,B=Z.languages||XP,Q=Z.plainText,X=Z.prefix,z=Z.subset,G="hljs",U=WP(B);if(J)U.registerAlias(J);if(X){let Y=X.indexOf("-");G=Y===-1?X:X.slice(0,Y)}return function(Y,K){d3(Y,"element",function(F,W,q){if(F.tagName!=="code"||!q||q.type!=="element"||q.tagName!=="pre")return;let N=oB0(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=JP(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 oB0($){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 qP($,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 NP($){if(typeof $!=="string")throw TypeError("Expected a string");return $.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function AP($,Z,J){let B=K3((J||{}).ignore||[]),Q=nB0(Z),X=-1;while(++X<Q.length)qX($,"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 O=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=O+1;else{if(q!==O)V.push({type:"text",value:U.value.slice(q,O)});if(Array.isArray(_))V.push(..._);else if(_)V.push(_);q=O+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 nB0($){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([sB0(B[0]),tB0(B[1])])}return Z}function sB0($){return typeof $==="string"?new RegExp(NP($),"g"):$}function tB0($){return typeof $==="function"?$:function(){return $}}var DP="phrasing",VP=["autolink","link","image","label"];function MP(){return{transforms:[BQ0],enter:{literalAutolink:eB0,literalAutolinkEmail:LP,literalAutolinkHttp:LP,literalAutolinkWww:LP},exit:{literalAutolink:HQ0,literalAutolinkEmail:JQ0,literalAutolinkHttp:$Q0,literalAutolinkWww:ZQ0}}}function PP(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:DP,notInConstruct:VP},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:DP,notInConstruct:VP},{character:":",before:"[ps]",after:"\\/",inConstruct:DP,notInConstruct:VP}]}}function eB0($){this.enter({type:"link",title:null,url:"",children:[]},$)}function LP($){this.config.enter.autolinkProtocol.call(this,$)}function $Q0($){this.config.exit.autolinkProtocol.call(this,$)}function ZQ0($){this.config.exit.data.call(this,$);let Z=this.stack[this.stack.length-1];X5(Z.type==="link"),Z.url="http://"+this.sliceSerialize($)}function JQ0($){this.config.exit.autolinkEmail.call(this,$)}function HQ0($){this.exit($)}function BQ0($){AP($,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,QQ0],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,XQ0]],{ignore:["link","linkReference"]})}function QQ0($,Z,J,H,B){let Q="";if(!fc(B))return!1;if(/^w/i.test(Z))J=Z+J,Z="",Q="http://";if(!zQ0(J))return!1;let X=GQ0(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 XQ0($,Z,J,H){if(!fc(H,!0)||/[-\d_]$/.test(J))return!1;return{type:"link",title:null,url:"mailto:"+Z+"@"+J,children:[{type:"text",value:Z+"@"+J}]}}function zQ0($){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 GQ0($){let Z=/[!"&'),.:;<>?\]}]+$/.exec($);if(!Z)return[$,void 0];$=$.slice(0,Z.index);let J=Z[0],H=J.indexOf(")"),B=qP($,"("),Q=qP($,")");while(H!==-1&&B>Q)$+=J.slice(0,H+1),J=J.slice(H+1),H=J.indexOf(")"),Q++;return[$,J]}function fc($,Z){let J=$.input.charCodeAt($.index-1);return($.index===0||U3(J)||a$(J))&&(!Z||J!==47)}gc.peek=DQ0;function UQ0(){this.buffer()}function YQ0($){this.enter({type:"footnoteReference",identifier:"",label:""},$)}function KQ0(){this.buffer()}function FQ0($){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},$)}function WQ0($){let Z=this.resume(),J=this.stack[this.stack.length-1];X5(J.type==="footnoteReference"),J.identifier=L4(this.sliceSerialize($)).toLowerCase(),J.label=Z}function qQ0($){this.exit($)}function NQ0($){let Z=this.resume(),J=this.stack[this.stack.length-1];X5(J.type==="footnoteDefinition"),J.identifier=L4(this.sliceSerialize($)).toLowerCase(),J.label=Z}function AQ0($){this.exit($)}function DQ0(){return"["}function gc($,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 _P(){return{enter:{gfmFootnoteCallString:UQ0,gfmFootnoteCall:YQ0,gfmFootnoteDefinitionLabelString:KQ0,gfmFootnoteDefinition:FQ0},exit:{gfmFootnoteCallString:WQ0,gfmFootnoteCall:qQ0,gfmFootnoteDefinitionLabelString:NQ0,gfmFootnoteDefinition:AQ0}}}function OP($){let Z=!1;if($&&$.firstLineBlank)Z=!0;return{handlers:{footnoteDefinition:J,footnoteReference:gc},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?mc:VQ0));return U(),G}}function VQ0($,Z,J){return Z===0?$:mc($,Z,J)}function mc($,Z,J){return(J?"":" ")+$}var LQ0=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];uc.peek=_Q0;function jP(){return{canContainEols:["delete"],enter:{strikethrough:MQ0},exit:{strikethrough:PQ0}}}function TP(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:LQ0}],handlers:{delete:uc}}}function MQ0($){this.enter({type:"delete",children:[]},$)}function PQ0($){this.exit($)}function uc($,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 _Q0(){return"~"}function OQ0($){return $.length}function cc($,Z){let J=Z||{},H=(J.align||[]).concat(),B=J.stringLength||OQ0,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=jQ0($[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]=pc(H[K]);else{let N=pc(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="",O="";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),O=" ".repeat(M/2-0.5);else L=" ".repeat(M/2),O=L;else O=" ".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(O);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 jQ0($){return $===null||$===void 0?"":String($)}function pc($){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 dc($,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()),TQ0);return B(),X}function TQ0($,Z,J){return">"+(J?"":" ")+$}function ic($,Z){return lc($,Z.inConstruct,!0)&&!lc($,Z.notInConstruct,!1)}function lc($,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 CP($,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 rc($,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 ac($,Z){return Boolean(Z.options.fences===!1&&$.value&&!$.lang&&/[^ \r\n]/.test($.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test($.value))}function oc($){let Z=$.options.fence||"`";if(Z!=="`"&&Z!=="~")throw Error("Cannot serialize code with `"+Z+"` for `options.fence`, expected `` ` `` or `~`");return Z}function nc($,Z,J,H){let B=oc(J),Q=$.value||"",X=B==="`"?"GraveAccent":"Tilde";if(ac($,J)){let K=J.enter("codeIndented"),F=J.indentLines(Q,CQ0);return K(),F}let z=J.createTracker(H),G=B.repeat(Math.max(rc(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 CQ0($,Z,J){return(J?"":" ")+$}function jH($){let Z=$.options.quote||'"';if(Z!=='"'&&Z!=="'")throw Error("Cannot serialize title with `"+Z+"` for `options.quote`, expected `\"`, or `'`");return Z}function sc($,Z,J,H){let B=jH(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 tc($){let Z=$.options.emphasis||"*";if(Z!=="*"&&Z!=="_")throw Error("Cannot serialize emphasis with `"+Z+"` for `options.emphasis`, expected `*`, or `_`");return Z}function j7($){return"&#x"+$.toString(16).toUpperCase()+";"}function TH($,Z,J){let H=c3($),B=c3(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}}EP.peek=EQ0;function EP($,Z,J,H){let B=tc(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=TH(H.before.charCodeAt(H.before.length-1),U,B);if(Y.inside)G=j7(U)+G.slice(1);let K=G.charCodeAt(G.length-1),F=TH(H.after.charCodeAt(0),K,B);if(F.inside)G=G.slice(0,-1)+j7(K);let W=X.move(B);return Q(),J.attentionEncodeSurroundingInfo={after:F.outside,before:Y.outside},z+G+W}function EQ0($,Z,J){return J.options.emphasis||"*"}function ec($,Z){let J=!1;return d3($,function(H){if("value"in H&&/\r?\n|\r/.test(H.value)||H.type==="break")return J=!0,e$}),Boolean((!$.depth||$.depth<3)&&i$($)&&(Z.options.setext||J))}function $d($,Z,J,H){let B=Math.max(Math.min(6,$.depth||1),1),Q=J.createTracker(H);if(ec($,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=j7(U.charCodeAt(0))+U.slice(1);if(U=U?X+" "+U:X,J.options.closeAtx)U+=" "+X;return G(),z(),U}bP.peek=bQ0;function bP($){return $.value||""}function bQ0(){return"<"}wP.peek=wQ0;function wP($,Z,J,H){let B=jH(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 wQ0(){return"!"}SP.peek=SQ0;function SP($,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 SQ0(){return"!"}RP.peek=RQ0;function RP($,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 RQ0(){return"`"}function IP($,Z){let J=i$($);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))}kP.peek=IQ0;function kP($,Z,J,H){let B=jH(J),Q=B==='"'?"Quote":"Apostrophe",X=J.createTracker(H),z,G;if(IP($,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 IQ0($,Z,J){return IP($,J)?"<":"["}yP.peek=kQ0;function yP($,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 kQ0(){return"["}function CH($){let Z=$.options.bullet||"*";if(Z!=="*"&&Z!=="+"&&Z!=="-")throw Error("Cannot serialize items with `"+Z+"` for `options.bullet`, expected `*`, `+`, or `-`");return Z}function Zd($){let Z=CH($),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 Jd($){let Z=$.options.bulletOrdered||".";if(Z!=="."&&Z!==")")throw Error("Cannot serialize items with `"+Z+"` for `options.bulletOrdered`, expected `.` or `)`");return Z}function fW($){let Z=$.options.rule||"*";if(Z!=="*"&&Z!=="-"&&Z!=="_")throw Error("Cannot serialize rules with `"+Z+"` for `options.rule`, expected `*`, `-`, or `_`");return Z}function Hd($,Z,J,H){let B=J.enter("list"),Q=J.bulletCurrent,X=$.ordered?Jd(J):CH(J),z=$.ordered?X==="."?")":".":Zd(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(fW(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 Bd($){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 Qd($,Z,J,H){let B=Bd(J),Q=J.bulletCurrent||CH(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 Xd($,Z,J,H){let B=J.enter("paragraph"),Q=J.enter("phrasing"),X=J.containerPhrasing($,H);return Q(),B(),X}var xP=K3(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function zd($,Z,J,H){return($.children.some(function(X){return xP(X)})?J.containerPhrasing:J.containerFlow).call(J,$,H)}function Gd($){let Z=$.options.strong||"*";if(Z!=="*"&&Z!=="_")throw Error("Cannot serialize strong with `"+Z+"` for `options.strong`, expected `*`, or `_`");return Z}hP.peek=yQ0;function hP($,Z,J,H){let B=Gd(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=TH(H.before.charCodeAt(H.before.length-1),U,B);if(Y.inside)G=j7(U)+G.slice(1);let K=G.charCodeAt(G.length-1),F=TH(H.after.charCodeAt(0),K,B);if(F.inside)G=G.slice(0,-1)+j7(K);let W=X.move(B+B);return Q(),J.attentionEncodeSurroundingInfo={after:F.outside,before:Y.outside},z+G+W}function yQ0($,Z,J){return J.options.strong||"*"}function Ud($,Z,J,H){return J.safe($.value,H)}function Yd($){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 Kd($,Z,J){let H=(fW(J)+(J.options.ruleSpaces?" ":"")).repeat(Yd(J));return J.options.ruleSpaces?H.slice(0,-1):H}var MX={blockquote:dc,break:CP,code:nc,definition:sc,emphasis:EP,hardBreak:CP,heading:$d,html:bP,image:wP,imageReference:SP,inlineCode:RP,link:kP,linkReference:yP,list:Hd,listItem:Qd,paragraph:Xd,root:zd,strong:hP,text:Ud,thematicBreak:Kd};function fP(){return{enter:{table:xQ0,tableData:Fd,tableHeader:Fd,tableRow:vQ0},exit:{codeText:fQ0,table:hQ0,tableData:vP,tableHeader:vP,tableRow:vP}}}function xQ0($){let Z=$._align;X5(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 hQ0($){this.exit($),this.data.inTable=void 0}function vQ0($){this.enter({type:"tableRow",children:[]},$)}function vP($){this.exit($)}function Fd($){this.enter({type:"tableCell",children:[]},$)}function fQ0($){let Z=this.resume();if(this.data.inTable)Z=Z.replace(/\\([\\|])/g,gQ0);let J=this.stack[this.stack.length-1];X5(J.type==="inlineCode"),J.value=Z,this.exit($)}function gQ0($,Z){return Z==="|"?Z:$}function gP($){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 cc(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=MX.inlineCode(W,q,N);if(N.stack.includes("tableCell"))D=D.replace(/\|/g,"\\$&");return D}}function mP(){return{exit:{taskListCheckValueChecked:Wd,taskListCheckValueUnchecked:Wd,paragraph:mQ0}}}function uP(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:uQ0}}}function Wd($){let Z=this.stack[this.stack.length-2];X5(Z.type==="listItem"),Z.checked=$.type==="taskListCheckValueChecked"}function mQ0($){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];X5(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 uQ0($,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=MX.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 pP(){return[MP(),_P(),jP(),fP(),mP()]}function cP($){return{extensions:[PP(),OP($),TP(),gP($),uP()]}}var pQ0={tokenize:rQ0,partial:!0},qd={tokenize:aQ0,partial:!0},Nd={tokenize:oQ0,partial:!0},Ad={tokenize:nQ0,partial:!0},cQ0={tokenize:sQ0,partial:!0},Dd={name:"wwwAutolink",tokenize:lQ0,previous:Ld},Vd={name:"protocolAutolink",tokenize:iQ0,previous:Md},i3={name:"emailAutolink",tokenize:dQ0,previous:Pd},W3={};function lP(){return{text:W3}}var JZ=48;while(JZ<123)if(W3[JZ]=i3,JZ++,JZ===58)JZ=65;else if(JZ===91)JZ=97;W3[43]=i3;W3[45]=i3;W3[46]=i3;W3[95]=i3;W3[72]=[i3,Vd];W3[104]=[i3,Vd];W3[87]=[i3,Dd];W3[119]=[i3,Dd];function dQ0($,Z,J){let H=this,B,Q;return X;function X(K){if(!dP(K)||!Pd.call(H,H.previous)||iP(H.events))return J(K);return $.enter("literalAutolink"),$.enter("literalAutolinkEmail"),z(K)}function z(K){if(dP(K))return $.consume(K),z;if(K===64)return $.consume(K),G;return J(K)}function G(K){if(K===46)return $.check(cQ0,Y,U)(K);if(K===45||K===95||t5(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&&_2(H.previous))return $.exit("literalAutolinkEmail"),$.exit("literalAutolink"),Z(K);return J(K)}}function lQ0($,Z,J){let H=this;return B;function B(X){if(X!==87&&X!==119||!Ld.call(H,H.previous)||iP(H.events))return J(X);return $.enter("literalAutolink"),$.enter("literalAutolinkWww"),$.check(pQ0,$.attempt(qd,$.attempt(Nd,Q),J),J)(X)}function Q(X){return $.exit("literalAutolinkWww"),$.exit("literalAutolink"),Z(X)}}function iQ0($,Z,J){let H=this,B="",Q=!1;return X;function X(K){if((K===72||K===104)&&Md.call(H,H.previous)&&!iP(H.events))return $.enter("literalAutolink"),$.enter("literalAutolinkHttp"),B+=String.fromCodePoint(K),$.consume(K),z;return J(K)}function z(K){if(_2(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||r$(K)||x1(K)||U3(K)||a$(K)?J(K):$.attempt(qd,$.attempt(Nd,Y),J)(K)}function Y(K){return $.exit("literalAutolinkHttp"),$.exit("literalAutolink"),Z(K)}}function rQ0($,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 aQ0($,Z,J){let H,B,Q;return X;function X(U){if(U===46||U===95)return $.check(Ad,G,z)(U);if(U===null||x1(U)||U3(U)||U!==45&&a$(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 oQ0($,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(Ad,Z,Q)(X);if(X===null||x1(X)||U3(X))return Z(X);return $.consume(X),B}function Q(X){if(X===41)H++;return $.consume(X),B}}function nQ0($,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||x1(z)||U3(z))return Z(z);return J(z)}function B(z){if(z===null||z===40||z===91||x1(z)||U3(z))return Z(z);return H(z)}function Q(z){return _2(z)?X(z):J(z)}function X(z){if(z===59)return $.consume(z),H;if(_2(z))return $.consume(z),X;return J(z)}}function sQ0($,Z,J){return H;function H(Q){return $.consume(Q),B}function B(Q){return t5(Q)?J(Q):Z(Q)}}function Ld($){return $===null||$===40||$===42||$===95||$===91||$===93||$===126||x1($)}function Md($){return!_2($)}function Pd($){return!($===47||dP($))}function dP($){return $===43||$===45||$===46||$===95||t5($)}function iP($){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 tQ0={tokenize:QX0,partial:!0};function rP(){return{document:{[91]:{name:"gfmFootnoteDefinition",tokenize:JX0,continuation:{tokenize:HX0},exit:BX0}},text:{[91]:{name:"gfmFootnoteCall",tokenize:ZX0},[93]:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:eQ0,resolveTo:$X0}}}}function eQ0($,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=L4(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 $X0($,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 ZX0($,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||x1(K))return J(K);if(K===93){$.exit("chunkString");let F=$.exit("gfmFootnoteCallString");if(!B.includes(L4(H.sliceSerialize(F))))return J(K);return $.enter("gfmFootnoteCallLabelMarker"),$.consume(K),$.exit("gfmFootnoteCallLabelMarker"),$.exit("gfmFootnoteCall"),Z}if(!x1(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 JX0($,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||x1(q))return J(q);if(q===93){$.exit("chunkString");let N=$.exit("gfmFootnoteDefinitionLabelString");return Q=L4(H.sliceSerialize(N)),$.enter("gfmFootnoteDefinitionLabelMarker"),$.consume(q),$.exit("gfmFootnoteDefinitionLabelMarker"),$.exit("gfmFootnoteDefinitionLabel"),F}if(!x1(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 J1($,W,"gfmFootnoteDefinitionWhitespace")}return J(q)}function W(q){return Z(q)}}function HX0($,Z,J){return $.check(Y3,Z,$.attempt(tQ0,Z,J))}function BX0($){$.exit("gfmFootnoteDefinition")}function QX0($,Z,J){let H=this;return J1($,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 aP($){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)Q2(F,F.length,0,P7(W,X.slice(U+1,G),z));Q2(F,F.length,0,[["exit",K,z],["enter",X[G][1],z],["exit",X[G][1],z],["exit",Y,z]]),Q2(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=c3(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=c3(q);return D._open=!A||A===2&&Boolean(N),D._close=!N||N===2&&Boolean(A),z(q)}}}class oP{constructor(){this.map=[]}add($,Z,J){XX0(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 XX0($,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 _d($,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 nP(){return{flow:{null:{name:"table",tokenize:zX0,resolveAll:GX0}}}}function zX0($,Z,J){let H=this,B=0,Q=0,X;return z;function z(T){let I=H.events.length-1;while(I>-1){let j=H.events[I][1].type;if(j==="lineEnding"||j==="linePrefix")I--;else break}let S=I>-1?H.events[I][1].type:null,R=S==="tableHead"||S==="tableRow"?_:G;if(R===_&&H.parser.lazy[H.now().line])return J(T);return R(T)}function G(T){return $.enter("tableHead"),$.enter("tableRow"),U(T)}function U(T){if(T===124)return Y(T);return X=!0,Q+=1,Y(T)}function Y(T){if(T===null)return J(T);if(u0(T)){if(Q>1)return Q=0,H.interrupt=!0,$.exit("tableRow"),$.enter("lineEnding"),$.consume(T),$.exit("lineEnding"),W;return J(T)}if(X1(T))return J1($,Y,"whitespace")(T);if(Q+=1,X)X=!1,B+=1;if(T===124)return $.enter("tableCellDivider"),$.consume(T),$.exit("tableCellDivider"),X=!0,Y;return $.enter("data"),K(T)}function K(T){if(T===null||T===124||x1(T))return $.exit("data"),Y(T);return $.consume(T),T===92?F:K}function F(T){if(T===92||T===124)return $.consume(T),K;return K(T)}function W(T){if(H.interrupt=!1,H.parser.lazy[H.now().line])return J(T);if($.enter("tableDelimiterRow"),X=!1,X1(T))return J1($,q,"linePrefix",H.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T);return q(T)}function q(T){if(T===45||T===58)return D(T);if(T===124)return X=!0,$.enter("tableCellDivider"),$.consume(T),$.exit("tableCellDivider"),N;return M(T)}function N(T){if(X1(T))return J1($,D,"whitespace")(T);return D(T)}function D(T){if(T===58)return Q+=1,X=!0,$.enter("tableDelimiterMarker"),$.consume(T),$.exit("tableDelimiterMarker"),A;if(T===45)return Q+=1,A(T);if(T===null||u0(T))return O(T);return M(T)}function A(T){if(T===45)return $.enter("tableDelimiterFiller"),V(T);return M(T)}function V(T){if(T===45)return $.consume(T),V;if(T===58)return X=!0,$.exit("tableDelimiterFiller"),$.enter("tableDelimiterMarker"),$.consume(T),$.exit("tableDelimiterMarker"),L;return $.exit("tableDelimiterFiller"),L(T)}function L(T){if(X1(T))return J1($,O,"whitespace")(T);return O(T)}function O(T){if(T===124)return q(T);if(T===null||u0(T)){if(!X||B!==Q)return M(T);return $.exit("tableDelimiterRow"),$.exit("tableHead"),Z(T)}return M(T)}function M(T){return J(T)}function _(T){return $.enter("tableRow"),w(T)}function w(T){if(T===124)return $.enter("tableCellDivider"),$.consume(T),$.exit("tableCellDivider"),w;if(T===null||u0(T))return $.exit("tableRow"),Z(T);if(X1(T))return J1($,w,"whitespace")(T);return $.enter("data"),C(T)}function C(T){if(T===null||T===124||x1(T))return $.exit("data"),w(T);return $.consume(T),T===92?b:C}function b(T){if(T===92||T===124)return $.consume(T),C;return C(T)}}function GX0($,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 oP;while(++J<$.length){let W=$[J],q=W[1];if(W[0]==="enter"){if(q.type==="tableHead"){if(z=!1,G!==0)Od(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=gW(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=gW(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=gW(F,Z,Q,B,J,K);else if(X[1]!==0)K=gW(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)Od(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=_d(Z.events,J)}return $}function gW($,Z,J,H,B,Q){let X=H===1?"tableHeader":H===2?"tableDelimiter":"tableData",z="tableContent";if(J[0]!==0)Q.end=Object.assign({},EH(Z.events,J[0])),$.add(J[0],0,[["exit",Q,Z]]);let G=EH(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=EH(Z.events,J[2]),Y=EH(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({},EH(Z.events,B)),$.add(B,0,[["exit",Q,Z]]),Q=void 0;return Q}function Od($,Z,J,H,B){let Q=[],X=EH(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 EH($,Z){let J=$[Z],H=J[0]==="enter"?"start":"end";return J[1][H]}var UX0={name:"tasklistCheck",tokenize:YX0};function sP(){return{text:{[91]:UX0}}}function YX0($,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(x1(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(X1(G))return $.check({tokenize:KX0},Z,J)(G);return J(G)}}function KX0($,Z,J){return J1($,H,"whitespace");function H(B){return B===null?J(B):Z(B)}}function jd($){return eF([lP(),rP(),aP($),nP(),sP()])}var FX0={};function mW($){let Z=this,J=$||FX0,H=Z.data(),B=H.micromarkExtensions||(H.micromarkExtensions=[]),Q=H.fromMarkdownExtensions||(H.fromMarkdownExtensions=[]),X=H.toMarkdownExtensions||(H.toMarkdownExtensions=[]);B.push(jd(J)),Q.push(pP()),X.push(cP(J))}var HZ=P(c(),1),WX0=[mW],qX0=[vW],NX0={code({node:$,className:Z,children:J,...H}){return HZ.jsx("code",{className:B0("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 HZ.jsx("div",{className:"not-prose my-2 rounded-lg border border-border bg-accent px-3 py-2.5",children:HZ.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 Td({size:$="sm",content:Z}){let J=m1(),{base:H}=C2();return HZ.jsx("div",{className:B0("prose max-w-full min-w-0 wrap-anywhere prose-inherit",$==="sm"&&"prose-sm"),children:HZ.jsx(TW,{remarkPlugins:WX0,rehypePlugins:qX0,components:NX0,urlTransform:(B,Q,X)=>{if(X.tagName==="a"&&Q==="href"&&B.startsWith("moi:"))try{return V8(B,{workspaceId:J,base:H})}catch{return""}return CW(B)},children:Z})})}function Cd({content:$}){return HZ.jsx(TW,{allowedElements:[],skipHtml:!0,unwrapDisallowed:!0,children:$})}var L_=P(m(),1);var Ed="/airtable-hsa66v6q.png";var bd="/apollo-2ed5dy2d.png";var wd="/asana-tvgtwbx2.png";var Sd="/atlassian-b3tq39hs.png";var Rd="/box-w3n36t5g.png";var tP="/chrome-tspm94rw.svg";var Id="/clickup-qqrqqvqb.png";var kd="/cloudflare-j9p931v6.png";var yd="/context7-8ht0xjfy.png";var xd="/datadog-70ne3yzt.png";var hd="/discord-vejhptwx.png";var vd="/dropbox-4m5s9mgr.png";var fd="/elevenlabs-2nzzej1t.png";var gd="/exa-qqj3vr0x.png";var md="/figma-y9898rry.png";var ud="/firecrawl-w2t8nehx.png";var pd="/github-av5r5y3e.png";var cd="/gitlab-4pv5vm6b.png";var dd="/gmail-sg6a5v3x.png";var ld="/googlecalendar-nqhh2v7r.png";var id="/googledrive-6s8xyab7.png";var rd="/grafana-1yfsnwr6.png";var ad="/granola-7j3b0nk2.png";var od="/hubspot-hghcmc2t.png";var nd="/huggingface-kxzaxj83.png";var sd="/intercom-td763jt8.png";var td="/linear-v9s3az2d.png";var ed="/monday-jdbs4wwf.png";var $l="/mongodb-emzxvhd5.png";var Zl="/neon-zj4qar44.png";var Jl="/notion-w034c0b8.png";var Hl="/paper-zbt34fab.png";var Bl="/paypal-kwwf7xsc.png";var Ql="/perplexity-4y63rxvj.png";var Xl="/postgresql-qsspbsr1.png";var zl="/posthog-sphppc4w.png";var Gl="/puppeteer-2xjt1a9b.png";var Ul="/railway-834de8d2.png";var Yl="/redis-spm6w2m1.png";var Kl="/salesforce-1mk56v4z.png";var Fl="/sentry-hdwpmvek.png";var Wl="/shopify-90dadaav.png";var ql="/slack-1c1wj62s.png";var Nl="/snowflake-hfpykpgy.png";var Al="/stripe-zrfaqbj3.png";var Dl="/supabase-4vg33zf2.png";var Vl="/telegram-v6tjyrs7.png";var Ll="/twilio-dpyjdwpj.png";var Ml="/vercel-7d0ssw28.png";var Pl="/zapier-p67qfch0.png";var Fz0={airtable:Ed,apollo:bd,asana:wd,atlassian:Sd,box:Rd,chrome:tP,"chrome-devtools":tP,clickup:Id,cloudflare:kd,context7:yd,datadog:xd,discord:hd,dropbox:vd,elevenlabs:fd,exa:gd,figma:md,firecrawl:ud,github:pd,gitlab:cd,gmail:dd,googlecalendar:ld,googledrive:id,grafana:rd,granola:ad,hubspot:od,huggingface:nd,intercom:sd,linear:td,monday:ed,mongodb:$l,neon:Zl,notion:Jl,paper:Hl,paypal:Bl,perplexity:Ql,postgresql:Xl,posthog:zl,puppeteer:Gl,railway:Ul,redis:Yl,salesforce:Kl,sentry:Fl,shopify:Wl,slack:ql,snowflake:Nl,stripe:Al,supabase:Dl,telegram:Vl,twilio:Ll,vercel:Ml,zapier:Pl},Wz0={"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 _l($){let Z=$.match(/^claude[._]ai[._\s]+(.+)$/i);if(!Z)return $;return Z[1].replace(/_/g," ")}function uW($){return $.toLowerCase().replace(/[\s._-]+/g,"")}var qz0=new Map(Object.entries(Fz0).map(([$,Z])=>[uW($),Z])),Nz0=new Map(Object.entries(Wz0).map(([$,Z])=>[uW($),uW(Z)]));function pW($){let Z=uW(_l($));return qz0.get(Nz0.get(Z)??Z)}function cW($){return _l($).split(/[\s._-]+/).filter(Boolean).map((Z)=>Z[0].toUpperCase()+Z.slice(1)).join(" ")}var eP=P(c(),1);function PX({open:$,children:Z}){return eP.jsx(I4,{initial:!1,children:$&&eP.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 Ol=P(m(),1);var Cl=P(c(),1),Az0=/\.(png|jpe?g|gif|webp|avif|svg)$/i;function jl($,Z){if($.name!=="Read"||!Z)return null;let J=$.input,H=typeof J.file_path==="string"?J.file_path:null;if(!H||!Az0.test(H))return null;let B=Z.endsWith("/")?Z:`${Z}/`;if(!H.startsWith(B))return null;return H.slice(B.length)}function Tl({relPath:$}){let Z=m1(),[J,H]=Ol.useState(!1);if(J)return null;let B=`/api/workspaces/${Z}/preview/${$.split("/").map(encodeURIComponent).join("/")}`;return Cl.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 TX=P(m(),1);var bl=P(c(),1),Dz0=B0("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 El({children:$,active:Z=!0,className:J}){return bl.jsx("span",{className:B0(J,Z&&Dz0),children:$})}var _X=P(c(),1);function dW({className:$}){return _X.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:[_X.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"}),_X.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 O2=P(c(),1),lW="group/row flex w-full items-center gap-2 py-1.5 text-left select-none";function wH({isFirst:$,isLast:Z,marker:J,loading:H=!1,isError:B=!1,children:Q}){let X=J!=null||H;return O2.jsxs("div",{className:"relative flex gap-2.5",children:[O2.jsxs("div",{className:"relative w-[13px] shrink-0",children:[!$&&O2.jsx("span",{className:B0("absolute top-0 left-1/2 w-px -translate-x-1/2 bg-border",X?"h-1":"h-2.5")}),!Z&&O2.jsx("span",{className:B0("absolute bottom-0 left-1/2 w-px -translate-x-1/2 bg-border",X?"top-[26px]":"top-5")}),J?O2.jsx("span",{className:"absolute top-[15px] left-1/2 z-10 -translate-x-1/2 -translate-y-1/2",children:J}):H?O2.jsx("span",{className:"absolute top-[15px] left-1/2 z-10 flex -translate-x-1/2 -translate-y-1/2 p-0.5",children:O2.jsx(d5,{size:12,stroke:1.75,className:"animate-spin text-muted-foreground"})}):O2.jsx("span",{className:B0("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 OX({open:$}){return O2.jsx(K5.span,{animate:{rotate:$?90:0},transition:{type:"spring",duration:0.2,bounce:0.1},className:B0("flex shrink-0",$?"opacity-100":"opacity-0 group-hover/row:opacity-100"),children:O2.jsx(m3,{size:12,stroke:1.75})})}function bH({children:$,className:Z}){return O2.jsx("span",{className:B0("flex size-4 items-center justify-center overflow-hidden rounded-xs bg-muted",Z),children:$})}function wl({icon:$,size:Z=12,stroke:J=1.75}){return O2.jsx(bH,{children:O2.jsx($,{size:Z,stroke:J,className:"text-muted-foreground"})})}function Sl({src:$}){if(!$)return O2.jsx(bH,{children:O2.jsx(dW,{className:"size-3 text-muted-foreground"})});return O2.jsx(bH,{children:O2.jsx("img",{src:$,alt:"",className:"size-full object-cover"})})}var bz0=kl(),$_=ml();function wz0($){if(!$)return"$";return/^[A-Za-z_][A-Za-z0-9_]*$/.test($)?`$${$}`:`\${${$}}`}function Sz0($){try{return $_($,wz0)}catch{return null}}function ul($){return $.split("/").pop()??$}var Rz0=new Set(["bash","sh","zsh","fish","dash","ash","ksh","mksh","csh","tcsh","nu","pwsh","powershell"]),Iz0=new Set(["-o","+o","-O","+O","--rcfile","--init-file"]),kz0=/^[A-Za-z_][A-Za-z0-9_]*=/;function yz0($){if(/^-[a-zA-Z]*c$/.test($))return!0;let Z=$.toLowerCase();return Z==="--command"||Z==="-command"}function xz0($){let Z=Sz0($);if(!Z||Z.length<3)return null;let J=(Q)=>{let X=Z[Q];return typeof X==="string"?X:null},H=0,B=()=>{while(kz0.test(J(H)??""))H++};if(B(),ul(J(H)??"")==="env")H++,B();if(!Rz0.has(ul(J(H)??"")))return null;H++;while(H<Z.length){let Q=J(H);if(Q===null)return null;if(yz0(Q)){if(H+2!==Z.length)return null;return J(H+1)?.trim()||null}if(!Q.startsWith("-")&&!Q.startsWith("+"))return null;H+=Iz0.has(Q)?2:1}return null}function hz0($){let Z=$;for(let J=0;J<3;J++){let H=xz0(Z);if(H===null)return Z;Z=H}return Z}function vz0($){return $.replace(/\\\r?\n[ \t]*/g," ").replace(/[ \t]*\r?\n[ \t]*/g," ").replace(/[ \t]{2,}/g," ").trim()}function QZ($){return vz0(hz0($))}function SH($,Z){let J=QZ($);return J?Z(`$ ${J}`):""}var fz0=/^[A-Za-z]:\//;function gz0($=""){if(!$)return $;return $.replace(/\\/g,"/").replace(fz0,(Z)=>Z.toUpperCase())}var mz0=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;var pl=/^\/([A-Za-z]:)?$/;function uz0(){if(typeof process<"u"&&typeof process.cwd==="function")return process.cwd().replace(/\\/g,"/");return"/"}var Z_=function(...$){$=$.map((H)=>gz0(H));let Z="",J=!1;for(let H=$.length-1;H>=-1&&!J;H--){let B=H>=0?$[H]:uz0();if(!B||B.length===0)continue;Z=`${B}/${Z}`,J=J_(B)}if(Z=cl(Z,!J),J&&!J_(Z))return`/${Z}`;return Z.length>0?Z:"."};function cl($,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 J_=function($){return mz0.test($)};var H_=function($,Z){let J=Z_($).replace(pl,"$1").split("/"),H=Z_(Z).replace(pl,"$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 RH($){return $.input??{}}function N1($,Z){let J=$[Z];return typeof J==="string"?J:""}function dl($){return(Z)=>Z.replace(/\/[^\s"']+/g,(J)=>{if(!$)return J;let H=H_($,J);return H.startsWith("..")?J:H})}function XZ($){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 pz0={ToolSearch:"Tool search",WebSearch:"Web search",WebFetch:"Web fetch"};function cz0($){if(!$.startsWith("mcp__"))return $;let Z=$.slice(5).split("__");return Z.length>=2?Z.slice(1).join("__"):Z[0]}function dz0($,Z){let J=$.name,H=RH($);if(J==="Bash")return SH(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(cz0).join(", ");return B}return""}var jX={displayName:($)=>pz0[$.name]??$.name,brief:dz0};var B_={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 rl($){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 ll={spawn_agent:"Run sub-agent",send_input:"Message the agent",resume_agent:"Resume the agent",close_agent:"Stopping the agent"};function lz0($){if($.name==="exec"){let Z=rl($.input);if(Z?.type)return il[Z.type]}if($.name==="subagent"){let Z=$.input?.action;if(typeof Z==="string"&&Z in ll)return ll[Z]}return B_[$.name]??$.name}function iz0($,Z){let J=$.name,H=RH($);if(J==="exec"){let B=rl(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 SH(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 al={displayName:lz0,brief:iz0};function ol($){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 rz0={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 az0($){let{action:Z}=ol($.name),J=rz0[Z];if(J)return J;let H=Z.replace(/_/g," ");return H.charAt(0).toUpperCase()+H.slice(1)}function oz0($,Z){let{action:J,qualifier:H,detail:B}=ol($.name),Q=B||H;if(!Q)return"";return J==="terminal"?`$ ${QZ(Q)}`:Z(Q)}var nl={displayName:az0,brief:oz0};var nz0={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 sz0($,Z){let J=$.name,H=RH($);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 SH(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(QZ(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 sl={displayName:($)=>nz0[$.name]??jX.displayName($),brief:($,Z)=>sz0($,Z)||jX.brief($,Z)};function Q_($){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=QZ(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 X_($){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 z_($){if($.provider!=="codex"||!$.mcpServer)return null;if($.name in B_)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 G_($,Z){let J=Z.toLowerCase();return["-","_","."].find((B)=>J.startsWith($.toLowerCase()+B))?Z.slice($.length+1):Z}var tz0={"claude-code":jX,openclaw:sl,codex:al,hermes:nl};function tl($){return tz0[$.provider??"claude-code"]}function el($){return tl($).displayName($)}function $i($,Z){return tl($).brief($,dl(Z))}var X2=P(c(),1),Zi=[Ji,Hi,U_];function ez0(){let[$,Z]=TX.useState(0);TX.useEffect(()=>{let H=setInterval(()=>Z((B)=>(B+1)%Zi.length),600);return()=>clearInterval(H)},[]);let J=Zi[$];return X2.jsx(bH,{className:"size-5",children:X2.jsx(J,{size:16,stroke:1.75,className:"text-foreground"})})}function Bi({call:$,cwd:Z,isFirst:J,isLast:H,renderNestedParts:B}){let[Q,X]=TX.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((O)=>O.parts),V=typeof $.output==="string"?$.output:"",L=A.length>0||!!V;return X2.jsx(wH,{isFirst:J,isLast:H,marker:F?X2.jsx(ez0,{}):X2.jsx(bH,{className:"size-5",children:X2.jsx(U_,{size:16,stroke:1.75,className:"text-foreground"})}),isError:K,children:X2.jsxs("div",{className:"min-w-0 flex-1",children:[X2.jsxs("button",{type:"button",title:`Agent: ${U}`,onClick:()=>L&&X((O)=>!O),className:B0("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:[X2.jsxs("span",{className:"flex w-full items-center gap-2",children:[X2.jsxs(El,{active:F,className:"min-w-0 flex-1 truncate text-xs font-medium",children:["Agent: ",U]}),!F&&q!=null&&X2.jsx("span",{className:"shrink-0 rounded-full border border-border px-1.5 text-[10px] font-medium text-muted-foreground tabular-nums",children:XZ(q)}),Y==="failed"&&X2.jsx("span",{className:"shrink-0 text-xs text-destructive",children:"✗"}),Y==="stopped"&&X2.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:"✗"}),L&&X2.jsx(OX,{open:Q})]}),D&&X2.jsx("span",{className:"w-full truncate text-xs text-muted-foreground",children:D})]}),L&&X2.jsx(PX,{open:Q,children:X2.jsxs("div",{className:"mt-1 mb-1 overflow-hidden rounded-lg border border-border",children:[A.length>0&&X2.jsx("div",{className:"py-1.5 pr-2 pl-3",children:B(A,Z)}),V&&X2.jsx("div",{className:B0("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 zZ=P(m(),1);var qi=P(m(),1);var K_=new Set(["<",">","{","}","[","]"]),N_=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"]),$G0=new Set([...N_,"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"]),Gi=new Set(["+","-","*","/","%","=","!","&","|","^","~","!","?",":",".",",",";","'",'"',".","(",")","[","]","#","@","\\",...K_]),ZG0={keywords:N_,onCommentStart:Fi,onCommentEnd:KG0};function JG0($){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 HG0($,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 oW=["identifier","keyword","string","class","property","entity","jsxliterals","sign","comment","break","space"],[IH,BG0,T7,Y_,aW,QG0,XG0,q3,Qi,F_,Xi]=oW.map(($,Z)=>Z);function CX($){return/^[^\S\r\n]+$/g.test($)}function zG0($){return Gi.has($)}var GG0={"&":"&","<":"<",">":">",'"':""","'":"'"};function UG0($){if(!/[&<>"']/.test($))return $;return $.replace(/[&<>"']/g,(Z)=>GG0[Z])}function nW($){return/^[\w_]+$/.test($)||Ui($)}function zi($){let Z=$[0];return nW(Z)&&Z===Z.toUpperCase()||$==="null"}function Ui($){return/[^\u0000-\u007f]/.test($)}function Yi($){return/^[a-zA-Z]$/.test($)}function Ki($){return Yi($)||Ui($)}function kH($){return Ki($[0])&&($.length===1||nW($.slice(1)))}function W_($){return $==="`"}function q_($){return $==='"'||$==="'"}function YG0($){return q_($)||W_($)}function Fi($,Z){let J=$+Z;if(J==="/*")return 2;return J==="//"?1:0}function KG0($,Z){return $+Z==="*/"?2:Z===`
|
|
56
|
+
`?1:0}function FG0($){return $[0]==="/"&&!Fi($[0],$[1])}function WG0($,Z){let J=Z+1;while(J<$.length&&/\s/.test($[J]))J++;return $[J]===":"}function qG0($,Z){let J={...ZG0,...Z},H=!!(Z&&Z.keywords instanceof Set),B=JG0($),Q=H?J.keywords:B?$G0:N_,{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(),O=()=>!N&&V()&&!D&&A>0,M=null,_=0,w=!1,C=0,b=0,T=()=>M!==null,I=()=>w,S=()=>b>C,R=()=>b>0&&b===C,j=()=>T()||S();function y(x){let v=x===`
|
|
57
|
+
`;if(L()){if(T())return T7;let[,E]=K;if(kH(x)){if(E==="<"||E==="</")return QG0}}if(O())return XG0;if(T()||S())return T7;else if(G&&G.has(x))return K[1]==="."?IH:Y_;else if(Q.has(x))return K[1]==="."?IH:BG0;else if(v)return F_;else if(CX(x))return Xi;else if(x.split("").every(zG0))return q3;else if(zi(x))return L()?IH:Y_;else{if(kH(x)){let E=K[1]==="."&&kH(F[1]);if(!j()&&!E)return IH;if(E)return aW}return T7}}let k=(x,v)=>{if(v)U=v;if(U){Y=typeof x==="number"?x:y(U);let f=[Y,U];if(Y!==Xi&&Y!==F_)F=K,K=f;W.push(f)}U=""};for(let x=0;x<$.length;x++){let v=$[x],f=$[x-1],E=$[x+1],l=f+v,r=v+E;if(typeof J.onQuote==="function"&&v==="'"&&!T()&&!O()&&!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;k(),U=$.slice(x,Z0),k(IH),x=Z0-1;continue}}if(q_(v)&&!O()&&!S()){k();let i=!1;if(f!=="\\"){if(M&&v===M)M=null,i=!0;else if(!M)M=v,_=W.length}if(k(T7,v),J.quotedKeys&&i&&WG0($,x))for(let n=_;n<W.length;n++)W[n][0]=aW;continue}if(!S()){if(f!=="\\n"&&W_(v)){k(),k(T7,v),b++;continue}}if(S()){if(f!=="\\n"&&W_(v)){if(b>0){k(),b--,k(T7,v);continue}}if(r==="${"){C++,k(T7),k(q3,r),x++;continue}}if(R()&&v==="}"){k(),C--,k(q3,v);continue}if(V()){if(v==="{"){k(),k(q3,v),D=!0;continue}}if(q){if(!N&&v==="<"){if(k(),E==="/")N=2,U=r,x++;else N=1,U=v;k(q3);continue}if(N){if(v===">"&&!"/=".includes(f)){if(k(),N===1)N=0,A++;else N=0,q=!1;k(q3,v);continue}if(r==="/>"||r==="</"){if(U!=="<"&&U!=="/")k();if(r==="/>")N=0;else A--;if(!A)q=!1;U=r,x++,k(q3);continue}if(v==="<"){k(),U=v,k(q3);continue}if(E==="-"&&!j()&&!O()){if(U){k(aW,U+v+E),x++;continue}}if(E==="="&&!j()){if(!CX(v)){if(CX(U))k();let i=U+v;if(kH(i)){k(aW,i);continue}}}}}if(!N&&(v==="<"&&Ki(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&&!CX(U)){let D0=U;if(zi(D0)||D0==="true"||D0==="false")U0=!0;else if(Q.has(D0)&&kH(D0))z0=!0;else if(kH(D0))U0=!0}let Q0=v==="<"&&/[$\w\]\)]/.test(n)&&(U0||!z0&&(Z0===IH||Z0===Y_||Z0===q3&&(J0===")"||J0==="]"))),N0=v==="<"&&HG0($,x);if(!Q0&&!N0)N=E==="/"?2:1;if(v==="<"&&(E==="/"||Yi(E))){if(!Q0&&!N0&&!j()&&!O()&&!I())q=!0}}let h=YG0(v),d=S(),o=!q&&FG0(r),p=O();if(h||d||q_(M))U+=v;else if(o){k();let[i,n]=K;if(o&&i!==-1&&!(i===q3&&n!==")"||i===Qi)){U=v,k();continue}w=!0;let Z0=x++,J0=()=>x>=$.length,U0=()=>J0()||$[x]===`
|
|
58
|
+
`,z0=!1,Q0=!1;for(;!U0();x++){let N0=$[x],D0=$[x-1]==="\\";if(!D0&&N0==="[")Q0=!0;if(!D0&&N0==="]")Q0=!1;if(N0==="/"&&!Q0&&!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),k(T7);else U=v,k(),x=Z0}else if(X(v,E)){k();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),k(Qi)}else if(v===" "||v===`
|
|
59
|
+
`)if(v===" "&&(CX(U)||!U||p)){let i=x+1;while($[i]===" ")i++;if(U+=$.slice(x,i),x=i-1,$[i]==="<")k()}else k(),U=v,k();else if(D&&v==="}")k(),U=v,k(),D=!1;else if(p&&!K_.has(v)||S()||(nW(v)===nW(U[U.length-1])||V())&&!Gi.has(v))U+=v;else{if(l==="</")U=l;if(k(),l!=="</")U=v;if(r==="</"||r==="/>")U=r,k(),x++;else if(K_.has(v))k()}}return k(),W}function NG0($,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=oW[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!==F_){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 AG0=($)=>{let Z=`class="${$.className}"`;if($.style){let J=Object.entries($.style).map(([H,B])=>`${H}:${B}`).join(";");Z+=` style="${J}"`}return Z};function DG0($){return $.map((Z)=>{let{tagName:J}=Z,H=Z.children.map((B)=>{let{tagName:Q,children:X,properties:z}=B;return`<${Q} ${AG0(z)}>${UG0(X[0].value)}</${Q}>`}).join("");return`<${J} class="${Z.properties.className}">${H}</${J}>`}).join(`
|
|
62
|
+
`)}function Wi($,Z){let J=qG0($,Z),H=NG0(J,Z);return DG0(H)}var mD1={TokenTypes:oW,TokenMap:new Map(oW.map(($,Z)=>[$,Z]))};var A_=P(c(),1),VG0=B0("[--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 Ni({code:$,className:Z}){let J=qi.useMemo(()=>Wi($),[$]);return A_.jsx("pre",{className:B0("overflow-auto font-mono text-xs leading-relaxed whitespace-pre",VG0,Z),children:A_.jsx("code",{className:"font-mono",dangerouslySetInnerHTML:{__html:J}})})}var LG0={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 MG0($){let Z=$.split(/[\\/]/).pop()??"",J=Z.lastIndexOf("."),H=J>0?Z.slice(J+1).toLowerCase():"";return LG0[H]??null}function PG0($){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 _G0($){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 Ai($,Z){let J=$.input??{},H=typeof J.file_path==="string"?J.file_path:typeof J.path==="string"?J.path:"",B=H?MG0(H):null,Q=$.name==="Read"||$.name==="read",X=$.name==="Write"||$.name==="write";if(B&&Q&&Z)return{kind:"highlight",code:_G0(Z),label:B};if(B&&X&&typeof J.content==="string"&&J.content)return{kind:"highlight",code:J.content,label:B};let z=PG0(Z);if(z)return{kind:"highlight",code:z,label:"json"};return{kind:"plain"}}var x4=P(c(),1),D_="max-h-[280px] overflow-auto px-3 py-2.5 font-mono text-xs leading-relaxed";function Di({call:$,output:Z,isError:J}){let[H,B]=zZ.useState(!1),Q=zZ.useMemo(()=>J?{kind:"plain"}:Ai($,Z),[$,Z,J]);if(Q.kind==="plain")return x4.jsx("div",{className:B0("rounded-lg border",J?"border-destructive/30 bg-destructive/10":"border-border bg-muted"),children:x4.jsx("pre",{className:B0(D_,"break-all whitespace-pre-wrap",J?"text-destructive":"text-muted-foreground"),children:Z||"(empty)"})});return x4.jsxs("div",{className:"overflow-hidden rounded-lg border border-border bg-muted",children:[x4.jsx(OG0,{raw:H,onRaw:B,label:Q.label,copyText:H?Z:Q.code}),H?x4.jsx("pre",{className:B0(D_,"break-all whitespace-pre-wrap text-muted-foreground"),children:Z||"(empty)"}):x4.jsx(Ni,{code:Q.code,className:B0(D_,"text-muted-foreground")})]})}function OG0({raw:$,onRaw:Z,label:J,copyText:H}){return x4.jsxs("div",{className:"flex items-center gap-1 border-b border-border p-2",children:[[[!1,J],[!0,"raw"]].map(([Q,X])=>x4.jsx(P0,{type:"button",variant:$===Q?"outline":"ghost",size:"sm",onClick:()=>Z(Q),className:"rounded-full text-xs uppercase",children:X},X)),x4.jsx("div",{className:"flex-1"}),x4.jsx(jG0,{text:H})]})}function jG0({text:$}){let[Z,J]=zZ.useState(!1);return zZ.useEffect(()=>{if(!Z)return;let B=setTimeout(()=>J(!1),1500);return()=>clearTimeout(B)},[Z]),x4.jsx(P0,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard?.writeText($).then(()=>J(!0)).catch(()=>{})},"aria-label":Z?"Copied":"Copy",children:Z?x4.jsx(a4,{stroke:1.75}):x4.jsx(TJ,{stroke:1.75})})}var u1=P(c(),1);function sW({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(TG0,{text:B.text,durationMs:B.durationMs,inProgress:J&&X,...z},Q);return u1.jsx(CG0,{call:B.call,cwd:Z,...z},B.call.toolCallId||Q)})})}function V_({isFirst:$,isLast:Z,call:J,leading:H,marker:B,name:Q,brief:X,preview:z}){let[G,U]=L_.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(wH,{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:B0(lW,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(d5,{size:12,stroke:1.75,className:"shrink-0 animate-spin text-muted-foreground"}),W&&u1.jsx(OX,{open:G})]}),W&&u1.jsx(PX,{open:G,children:u1.jsxs("div",{className:"mt-1 mb-1 flex flex-col gap-1.5",children:[z,(F||Y)&&u1.jsx(Di,{call:J,output:F,isError:Y})]})})]})})}function TG0({isFirst:$,isLast:Z,text:J,inProgress:H=!1,durationMs:B}){let[Q,X]=L_.useState(!1);if(!J){let U=B===void 0?"Thought":`Thought for ${XZ(B)}`;return u1.jsx(wH,{isFirst:$,isLast:Z,loading:H,children:u1.jsx("div",{className:B0(lW,"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(wH,{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:B0(lW,"cursor-pointer"),children:[u1.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:z}),u1.jsx(OX,{open:G})]}),u1.jsx(PX,{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(Cd,{content:J})})})]})})}function CG0({call:$,cwd:Z,isFirst:J,isLast:H}){if($.caller==="subagent")return u1.jsx(Bi,{call:$,cwd:Z,isFirst:J,isLast:H,renderNestedParts:(X,z)=>u1.jsx(sW,{parts:X,cwd:z})});if($.name==="Skill"&&$.skill){let X=$.state==="success";return u1.jsx(V_,{isFirst:J,isLast:H,call:$,marker:X?u1.jsx(wl,{icon:Vi,size:16,stroke:1.75}):void 0,name:"Loading skill",brief:$.skill.skillName})}let B=Q_($)??X_($)??z_($);if(B){let X=G_(B.server,B.tool);return u1.jsx(V_,{isFirst:J,isLast:H,call:$,marker:u1.jsx(Sl,{src:pW(B.server)}),name:cW(B.server),brief:B.rest?`${X} ${B.rest}`:X})}let Q=$.state==="error"?null:jl($,Z);return u1.jsx(V_,{isFirst:J,isLast:H,call:$,leading:u1.jsx(EG0,{call:$}),name:el($),brief:$i($,Z),preview:Q?u1.jsx(Tl,{relPath:Q}):void 0})}function EG0({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 h1=P(c(),1);function Pi($){if($.type==="reasoning")return!0;if($.type==="tool-call")return!0;return!1}function bG0($){let Z=[];for(let J of $)if(Pi(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 tW({parts:$,cwd:Z,processing:J=!1}){let H=bG0($);return h1.jsx("div",{className:"flex flex-col",children:H.map((B,Q)=>{let X=Q===0?"":"mt-3",z=Q===H.length-1;return h1.jsx("div",{className:X,children:B.kind==="run"?h1.jsx(sW,{parts:B.parts,cwd:Z,processing:J&&z}):h1.jsx(kG0,{part:B.part})},Q)})})}function wG0($){return $.some((Z)=>Z.type!=="text"||Z.text.trim().length>0)}function SG0($){let Z=-1;for(let H=$.length-1;H>=0;H--)if(Pi($[H])){Z=H;break}if(Z<0)return null;let J=$.slice(Z+1);if(!wG0(J))return null;return{work:$.slice(0,Z+1),response:J}}function RG0({parts:$,cwd:Z,durationMs:J,defaultOpen:H}){let B=J===void 0?"Worked":`Worked for ${XZ(J)}`;return h1.jsxs(bK,{defaultOpen:H,className:"group/collapsible",children:[h1.jsxs(wK,{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:[h1.jsx("span",{children:B}),h1.jsx(m3,{size:16,stroke:1.5,className:"shrink-0 transition-transform group-data-open/collapsible:rotate-90"})]}),h1.jsx(SK,{className:"overflow-hidden pt-2",children:h1.jsx(tW,{parts:$,cwd:Z})})]})}function IG0({parts:$,cwd:Z,processing:J=!1,durationMs:H}){let B=J?null:SG0($);return h1.jsx("div",{className:"w-full min-w-0",children:J?h1.jsx(tW,{parts:$,cwd:Z,processing:!0}):B?h1.jsxs("div",{className:"flex flex-col gap-3",children:[h1.jsx(RG0,{parts:B.work,cwd:Z,durationMs:H}),h1.jsx(tW,{parts:B.response,cwd:Z})]}):h1.jsx(tW,{parts:$,cwd:Z})})}var _i=Mi.memo(function({turn:Z,processing:J=!1}){let H=y1().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 h1.jsxs("div",{className:"flex w-full min-w-0 flex-col items-end gap-1.5 pl-8",children:[Q.map((z,G)=>h1.jsx(dQ,{label:z.label},`text-attachment:${G}`)),B.map((z,G)=>h1.jsx(Oi,{mediaType:z.mediaType,previewUrl:z.previewUrl,label:z.label},G)),X&&h1.jsx("p",{className:B0("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 h1.jsx(IG0,{parts:Z.parts,cwd:H,processing:J,durationMs:Z.meta?.durationMs})});function kG0({part:$}){switch($.type){case"text-attachment":return h1.jsx(dQ,{label:$.label});case"text":return h1.jsx(Td,{content:$.text});case"tool-call":return h1.jsx(sW,{parts:[$],cwd:null});case"file-attachment":return h1.jsx(Oi,{mediaType:$.mediaType,previewUrl:$.previewUrl,label:$.label});case"source-url":return h1.jsx(Li,{url:$.url,title:$.title});case"source-document":return h1.jsx(Li,{url:"#",title:$.title});case"data":return h1.jsx(yG0,{name:$.name,data:$.data});case"reasoning":return null}}function Oi({mediaType:$,previewUrl:Z,label:J}){if($.startsWith("image/")&&Z)return h1.jsx("img",{src:Z,alt:J??"attachment",className:"max-h-64 max-w-full rounded-lg border border-border object-contain"});return h1.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:[h1.jsx(bJ,{size:16,stroke:1.75}),h1.jsx("span",{className:"truncate",children:J??$})]})}function Li({url:$,title:Z}){return h1.jsx("a",{href:$,target:"_blank",rel:"noreferrer",className:"text-xs underline",children:Z??$})}function yG0({name:$,data:Z}){return h1.jsxs("details",{children:[h1.jsxs("summary",{className:"cursor-pointer list-none text-xs text-muted-foreground marker:hidden [&::-webkit-details-marker]:hidden",children:["data:",$]}),h1.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 t1=P(c(),1),xG0=[],hG0=[];function M_({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=m1(),{base:O}=C2(),{data:M}=VJ(L),_=M?.find((Q0)=>Q0.sessionId===$)?.summary,w=x3(),C=J8.useRef(null),b=J8.useRef(null),T=V?.sessionId??U??F2(w),I=V?null:U??null,S=V?xG0:z.turns,R=b1((Q0)=>Q0.hasSentMessageFromMoi),j=b1((Q0)=>(Q0.workspaceIdsPendingAnalysis??[]).includes(L)),y=G4((Q0)=>(Q0.attachments[q8(L,T)]??[]).some((N0)=>N0.kind!=="text"&&N0.status==="uploading")),k=Q||!!V,x=!k||!cQ(!0,y,F),v=V?null:G,f=V?hG0:z.notices,E=J8.useMemo(()=>Tv(S),[S]),l=J8.useMemo(()=>jv(E,v),[E,v]),r=J8.useMemo(()=>Ev(l,f),[l,f]),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=rg({tabId:w,isViewDraft:!!V,hasSentMessageFromMoi:R,isWorkspacePendingAnalysis:j}),{atBottom:n,scrollToBottom:Z0,scrollToTop:J0}=_v(b,T);J8.useLayoutEffect(()=>{if(o&&i!=="overview-empty"&&i!=="tab-empty")J0()},[o,i,J0]),J8.useEffect(()=>{if(J)RL(C.current)},[J,H]);let U0=J8.useCallback(async(Q0,N0)=>{await q(Q0,N0),Z0()},[q,Z0]),z0=J8.useCallback((Q0)=>{if(x)return;U0(Q0.prompt,{directives:Q0.context})},[U0,x]);return t1.jsxs("div",{className:"flex min-h-0 flex-1 flex-col pt-2 pb-3",children:[t1.jsxs("header",{className:"flex w-full min-w-0 items-center justify-between pr-2 pb-2 pl-2",children:[t1.jsx("div",{className:"flex h-7 min-w-0 flex-1",children:t1.jsx($m,{className:B0("text-foreground",B&&"text-muted-foreground")})}),B&&t1.jsxs(o1,{children:[t1.jsx(n1,{render:t1.jsx(P0,{variant:"ghost",size:"icon-sm",onClick:A,"aria-label":"Undock chat",children:t1.jsx(ji,{className:"size-5! text-muted-foreground",stroke:1.5})})}),t1.jsx(s1,{children:"Undock chat"})]}),!V&&!B&&t1.jsx(P0,{variant:"ghost",size:"icon-sm",onClick:A,"aria-label":"Close chat",children:t1.jsx(e5,{stroke:2})})]}),t1.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[t1.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:t1.jsxs("div",{className:"mx-auto flex w-full max-w-(--chat-max-container) flex-1 flex-col gap-6",children:[$&&t1.jsx("a",{href:V8(`moi:/chats/${encodeURIComponent($)}`,{workspaceId:L,base:O}),className:"block text-sm outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:t1.jsxs("div",{className:"flex items-center gap-3",children:[t1.jsx(oK,{size:20,stroke:1.5,"aria-hidden":"true",className:"shrink-0 text-muted-foreground"}),t1.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[t1.jsx("span",{className:"text-muted-foreground",children:"Started from another chat"}),t1.jsx("span",{className:"truncate font-medium",title:_,children:_||"Another chat"})]})]})}),o&&t1.jsx(ag,{agent:Z,kind:i,hasWorkspaceApplets:X,disabled:x,onSelectPrompt:z0,onNavigate:D}),p&&r.map((Q0)=>Q0.kind==="notice"?t1.jsx(vG0,{notice:Q0.notice},`notice:${Q0.notice.id}`):t1.jsx(_i,{turn:Q0.turn,processing:d&&Q0.turn.id===h},Q0.turn.id)),p&&t1.jsx("div",{className:"mt-auto -ml-3 pt-2",children:t1.jsx(J3,{preset:Z,color:"primary",animated:d,expression:d?"thinking":void 0})})]})}),p&&!n&&S.length>0&&t1.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:t1.jsx(DU,{stroke:1.5})})]}),t1.jsx("div",{className:"mx-auto flex w-full max-w-[calc(var(--chat-max-container)+24px)] flex-col px-3",children:t1.jsxs("div",{className:B0("@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,t1.jsx(cg,{composerRef:C,onSend:U0,onStop:N,processing:d,sessionId:T,modelSessionId:I,availability:F,chatReady:k,annotation:V?void 0:W,onRemoveDrawing:V?.onRemoveDrawing??W?.onRemove,allowFiles:!V,placeholder:V?"Drop in the details":void 0})]})})]})}function vG0({notice:$}){let Z=IL($);if(!Z)return null;return t1.jsx("div",{className:"flex justify-center",children:t1.jsx("span",{className:"max-w-full truncate text-xs text-muted-foreground",children:Z})})}var fH=P(m(),1);var Dr=P(m_(),1);var q9=P(c(),1);function Vr({agent:$,loading:Z,open:J,onOpenChange:H,onOpenChangeComplete:B,children:Q}){let X=fH.useRef(null),z=b1((N)=>N.popupChatWidth),G=b1((N)=>N.setPopupChatWidth),[U,Y]=fH.useState({width:z,min:0,max:z}),K=fH.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 q9.jsxs(j6,{open:J,onOpenChange:(N,D)=>{if(!N&&(D.reason==="outside-press"||D.reason==="focus-out")){D.cancel();return}H(N)},onOpenChangeComplete:B,children:[q9.jsx(T6,{render:q9.jsx("div",{className:"fixed right-3 bottom-3",children:q9.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:q9.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:q9.jsx(J3,{preset:$,color:"primary",animated:Z,size:Z?80:64,expression:Z?"thinking":void 0,className:B0("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")})})})})}),q9.jsx(Dr.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:q9.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:q9.jsx(C6,{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 r3=P(c(),1);function Yq({actions:$,className:Z,title:J,children:H,onClose:B,ref:Q}){return r3.jsxs(K5.div,{ref:Q,className:B0("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:[r3.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-4",children:[r3.jsx("p",{className:"text-sm font-medium",children:J}),r3.jsxs("div",{className:"flex items-center gap-2",children:[$,r3.jsx(P0,{type:"button",variant:"ghost",size:"icon-sm",onClick:B,"aria-label":"Close panel",children:r3.jsx(e5,{stroke:1.75})})]})]}),H&&r3.jsx("div",{className:"flex-1 pb-(--page-pad)",children:H})]})}var D5=P(c(),1),lY0=Object.entries(t6),iY0=Object.entries(eY),rY0=Object.entries(FQ),aY0=Object.entries(WQ),oY0="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 Kq({children:$,className:Z,gridClassName:J,label:H}){return D5.jsxs("div",{className:B0("flex flex-col gap-2",Z),children:[D5.jsx("p",{className:"text-xs font-medium",children:H}),D5.jsx("div",{role:"group","aria-label":H,className:B0("grid grid-cols-4 gap-2 @4xl/workspace:grid-cols-2",J),children:$})]})}function Fq({active:$,children:Z,className:J,onSelect:H,style:B}){return D5.jsxs("button",{type:"button","aria-pressed":$,onClick:H,className:B0(oY0,"flex items-center gap-2 p-3",J,!$&&"cursor-pointer pr-9 opacity-70 hover:opacity-100"),style:B,children:[D5.jsx("div",{className:"flex flex-1 flex-col justify-center",children:Z}),$&&D5.jsx(QK,{size:20,stroke:1.5,"aria-hidden":"true"})]})}function Lr({onClose:$,ref:Z}){kK();let{layout:J,setLayout:H}=y1(),B=U9(J.theme);function Q(X){H({theme:{...B,...X}})}return D5.jsx(Yq,{ref:Z,title:"Theme",onClose:$,className:"@4xl/workspace:max-w-5xl",children:D5.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:[D5.jsx(Kq,{label:"Font",className:"@4xl/workspace:col-span-2 @4xl/workspace:col-start-1",children:lY0.map(([X,z])=>D5.jsx(Fq,{active:X===B.font,onSelect:()=>Q({font:X}),style:{fontFamily:z.sans},children:D5.jsx("span",{className:"text-sm font-medium",children:z.label})},X))}),D5.jsx(Kq,{label:"Colors",className:"@4xl/workspace:col-span-2 @4xl/workspace:col-start-4",children:iY0.map(([X,z])=>D5.jsx(Fq,{active:X===B.color,className:z.primary&&"bg-background text-foreground",onSelect:()=>Q({color:X}),style:K9({...B,color:X}),children:D5.jsxs("div",{className:"flex gap-2",children:[D5.jsx("span",{className:B0("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"}),D5.jsx("span",{className:"text-sm font-medium",children:z.label})]})},X))}),D5.jsx(Kq,{label:"Radius",className:"@4xl/workspace:col-start-7",gridClassName:"@4xl/workspace:grid-cols-1",children:rY0.map(([X,z])=>D5.jsx(Fq,{active:X===B.radius,onSelect:()=>Q({radius:X}),style:K9({...B,radius:X}),children:D5.jsxs("div",{className:"flex items-center gap-2",children:[D5.jsx("span",{className:"size-5 shrink-0 rounded-sm bg-card texture-checker-2.5 shadow-xs","aria-hidden":"true"}),D5.jsx("span",{className:"text-sm font-medium",children:z.label})]})},X))}),D5.jsx(Kq,{label:"Agent",className:"@4xl/workspace:col-start-9",gridClassName:"@4xl/workspace:grid-cols-1",children:aY0.map(([X,z])=>D5.jsx(Fq,{active:X===B.agent,onSelect:()=>Q({agent:X}),children:D5.jsxs("div",{className:"flex items-center gap-2",children:[D5.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:D5.jsx(J3,{preset:X,color:"primary",size:28})}),D5.jsx("span",{className:"text-sm font-medium",children:z.label})]})},X))})]})})}var HN=P(m(),1);var _r=P(m(),1);function Mr($){return e1({queryKey:O0.appletThumbnails($),queryFn:async()=>(await B1(`/api/workspaces/${$}/applet-thumbnails`)).thumbnails,...N8})}function Pr($){let Z=$1();return W5({mutationFn:(J)=>U4(`/api/workspaces/${$}/applet-thumbnails`,_5("PUT",J),"Failed to save applet thumbnails"),onSuccess:()=>{Z.invalidateQueries({queryKey:O0.appletThumbnails($)}),Z.invalidateQueries({queryKey:O0.preview($)})}})}var nY0=1000,sY0=3,tY0=10800000,eY0=1000,$K0="1000px-3x-webp-q80-v1",ZK0=5000,JK0=1000,HK0=1e4,BK0=100,QK0=5000;function XK0($){return Math.min(sY0,nY0/Math.max($.offsetWidth,$.offsetHeight))}function zK0($){return`${$K0}:${$??""}`}function GK0($,Z,J=Date.now()){if(!$||$.revision!==Z)return!0;let H=Date.parse($.capturedAt);return!Number.isFinite(H)||J-H>=tY0}function UK0($,Z){return $!==void 0&&$.revision===Z&&$.captureMs!==void 0&&$.captureMs>=eY0}var YK0=($)=>new Promise((Z)=>{setTimeout(()=>Z(null),$)});function KK0($,Z=BK0){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 FK0($,Z,J=QK0){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 WK0($,Z){let{createContext:J,destroyContext:H,domToDataUrl:B}=await import("/chunk-hvh9f5h0.js"),Q=KK0($);if(FK0($,Q))return null;let X=async()=>{let z=await J($,{scale:XK0($),type:"image/webp",quality:0.8,backgroundColor:"#ffffff",timeout:JK0,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(),YK0(HK0)])}async function qK0($,Z,J,H,B=WK0,Q=Date.now()){let X=[];for(let z of J){if(H())return null;let G=zK0(z.revision),U=Z.find((W)=>W.kind===$&&W.id===z.id);if(!GK0(U,G,Q)){X.push({id:z.id,revision:G});continue}if(UK0(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 Wq({kind:$,enabled:Z,targets:J}){let H=m1(),B=Mr(H).data,Q=Pr(H),X=N5(J),z=N5(B??[]),G=N5(Q.mutate),U=J.map((K)=>`${K.id}@${K.revision??""}`).join(`
|
|
66
|
+
`),Y=B!==void 0;_r.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(Q7($==="view"?"views":"widgets",A.id))}"]`)})),()=>K||F!==N||document.visibilityState!=="visible");if(!D||K||document.visibilityState!=="visible")return;G.current({kind:$,thumbnails:D})},ZK0)};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 sr=P(m(),1);var f2=P(c(),1);function NK0($){if($==="needs-auth")return"Needs auth";return $[0].toUpperCase()+$.slice(1)}function AK0({name:$,status:Z}){let J=pW($),H="size-full rounded-lg ring-2 ring-background";return f2.jsxs("span",{className:"relative size-10 shrink-0",children:[J?f2.jsx("img",{src:J,alt:"",className:"size-full rounded-lg ring-2 ring-background"}):f2.jsx("span",{className:"flex size-full items-center justify-center rounded-lg bg-muted text-muted-foreground ring-2 ring-background",children:f2.jsx(dW,{className:"size-5"})}),Z!=="connected"&&f2.jsx(Or,{"aria-hidden":"true",size:16,stroke:1.75,className:"absolute -top-1 -right-1 rounded-full bg-card text-amber-400"})]})}function jr($){return[...$].sort((Z,J)=>Number(J.status==="connected")-Number(Z.status==="connected"))}function Tr({icon:$,children:Z}){return f2.jsxs("div",{className:"flex items-center gap-3 text-card-foreground",children:[$,f2.jsx("div",{className:"flex min-w-0 flex-1 flex-col justify-center gap-0.5",children:Z})]})}function Cr({server:$}){return f2.jsxs(Tr,{icon:f2.jsx(AK0,{name:$.name,status:$.status}),children:[f2.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:cW($.name)}),f2.jsx("span",{className:"text-sm text-muted-foreground",children:NK0($.status)})]})}function Er(){return f2.jsxs(Tr,{icon:f2.jsx(w$,{className:"size-10 shrink-0 rounded-lg"}),children:[f2.jsx(w$,{className:"h-4 w-36 max-w-full"}),f2.jsx(w$,{className:"h-4 w-20"})]})}function u_({children:$}){return f2.jsx("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:$})}function br($,Z){return e1({queryKey:O0.mcp($),queryFn:()=>B1(`/api/workspaces/${$}/mcp`),enabled:Z,staleTime:1/0,gcTime:1/0,refetchOnMount:!1,refetchOnWindowFocus:!1})}var H8=P(c(),1);function gH({title:$,description:Z,children:J}){return H8.jsxs("div",{className:"flex flex-col gap-6",children:[H8.jsxs("header",{className:"flex flex-col gap-0.5",children:[H8.jsx("h2",{className:"text-lg font-medium",children:$}),Z&&H8.jsx("p",{className:"text-sm text-muted-foreground",children:Z})]}),J]})}function mH({label:$,children:Z}){return H8.jsxs("section",{className:"flex flex-col gap-2",children:[$&&H8.jsx("p",{className:"px-0.5 text-xs font-medium text-muted-foreground",children:$}),H8.jsx("div",{className:"flex flex-col divide-y divide-dashed divide-border overflow-hidden rounded-xl border",children:Z})]})}function IX({title:$,description:Z,control:J}){return H8.jsxs("div",{className:"flex items-center gap-3 px-3.5 py-3",children:[H8.jsxs("div",{className:"flex min-w-0 flex-col",children:[H8.jsx("span",{className:"text-sm font-medium",children:$}),Z&&H8.jsx("span",{className:"text-xs text-muted-foreground",children:Z})]}),J&&H8.jsx("div",{className:"ml-auto flex shrink-0 items-center pl-3",children:J})]})}var _4=P(c(),1),DK0=Array.from({length:4},($,Z)=>Z);function VK0({connectors:$}){if($.isPending)return _4.jsx("div",{role:"status","aria-label":"Loading connectors",children:_4.jsx(u_,{children:DK0.map((Z)=>_4.jsx(Er,{},Z))})});if($.isError)return _4.jsxs(wr,{children:[_4.jsx("p",{className:"text-sm text-muted-foreground",children:"Could not load connectors."}),_4.jsx(P0,{variant:"outline",size:"sm",onClick:()=>$.refetch(),children:"Retry"})]});if($.data.length===0)return _4.jsxs(wr,{children:[_4.jsx(qq,{size:24,stroke:1.5,className:"text-muted-foreground"}),_4.jsx("p",{className:"text-sm text-foreground",children:"No connectors configured."})]});return _4.jsx(u_,{children:jr($.data).map((Z)=>_4.jsx(Cr,{server:Z},Z.name))})}function wr({children:$}){return _4.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 Sr(){let{workspaceId:$}=y1(),Z=br($,!0);return _4.jsx(gH,{title:"Connectors",description:"Connectors available to the agent in this workspace.",children:_4.jsx(VK0,{connectors:Z})})}var l_=P(m(),1);var yX={};I5(yX,{Thumb:()=>vr,Root:()=>xr});var GZ=P(m(),1);var Nq=P(m(),1),p_=Nq.createContext(void 0);function Rr(){let $=Nq.useContext(p_);if($===void 0)throw Error(k0(63));return $}var Ir="data-checked",kr="data-unchecked";var Aq={...k2,checked($){if($)return{[Ir]:""};return{[kr]:""}}};var yr=P(m(),1);function Dq($,Z,J,H=!0,B){let[Q,X]=yr.useState(),z=t0(B?`${B}-label`:void 0),G=$??Z??Q;return H0(()=>{let U=$||Z||!H?void 0:MK0(J.current,z);if(Q!==U)X(U)}),G}function MK0($,Z){let J=PK0($);if(!J)return;if(!J.id&&Z)J.id=Z;return J.id||void 0}function PK0($){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 kX=P(c(),1),xr=GZ.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,...O}=Z,{clearErrors:M}=K4(),{state:_,setTouched:w,setDirty:C,validityData:b,setFilled:T,setFocused:I,validationMode:S,disabled:R,name:j,validation:y}=o5(),{labelId:k}=n5(),x=R||N,v=j??Y,f=GZ.useRef(null),E=p2(f,U,y.inputRef),l=GZ.useRef(null),r=t0(),h=m6({id:G}),d=K?void 0:h,[o,p]=F4({controlled:H,default:Boolean(Q),name:"Switch",state:"checked"});g6(l,r,o,void 0,!x,Y),H0(()=>{T(o)},[o,T]),i9(o,()=>{M(v),C(o!==b.initialValue),y.change(o)});let{getButtonProps:i,buttonRef:n}=w5({disabled:x,native:K}),Z0=Dq(X,k,f,!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)I(!0)},onBlur(){let N0=f.current;if(!N0||x)return;if(w(!0),I(!1),S==="onBlur")y.commit(N0.checked)},onClick(N0){if(W||x)return;N0.preventDefault();let D0=f.current;if(!D0)return;ZH(D0,N0)}},U0={...y.getValidationProps(x),checked:o,disabled:x,form:z,id:d,name:v,required:q,style:v?pz:n8,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=GZ.useMemo(()=>({..._,checked:o,disabled:x,readOnly:W,required:q}),[_,o,x,W,q]),Q0=G0("span",Z,{state:z0,ref:[J,l,n],props:[J0,O,i,(N0)=>y.getValidationProps(x,N0)],stateAttributesMapping:Aq});return kX.jsxs(p_.Provider,{value:z0,children:[Q0,!o&&v&&A!==void 0&&kX.jsx("input",{type:"hidden",form:z,name:v,value:A,disabled:x}),kX.jsx("input",{...U0,suppressHydrationWarning:!0})]})});var hr=P(m(),1);var vr=hr.forwardRef(function(Z,J){let{render:H,className:B,style:Q,...X}=Z,z=Rr();return G0("span",Z,{state:z,ref:J,stateAttributesMapping:Aq,props:X})});var c_=P(c(),1);function fr({className:$,...Z}){return c_.jsx(yX.Root,{"data-slot":"switch",className:r0('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:c_.jsx(yX.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 d_=["app-settings"];function gr(){let $=$1();return L2((Z)=>{if(Z.type==="settings:updated")$.setQueryData(d_,Z.settings)}),e1({queryKey:d_,queryFn:()=>B1("/api/settings"),staleTime:30000})}function mr(){let $=$1();return W5({mutationFn:(Z)=>B1("/api/settings",_5("PATCH",Z),"Failed to save settings"),onSuccess:(Z)=>{$.setQueryData(d_,Z)}})}function ur($){return e1({queryKey:O0.env($),queryFn:()=>B1(`/api/workspaces/${$}/env`),...N8})}function pr($){let Z=$1();return W5({mutationFn:(J)=>B1(`/api/workspaces/${$}/env`,_5("PUT",J)),onSuccess:(J)=>{Z.setQueryData(O0.env($),J)}})}function cr($){let Z=$1();return W5({mutationFn:(J)=>U4(`/api/workspaces/${$}/config`,_5("PUT",{name:J}),"Failed to save name"),onSuccess:()=>{Z.invalidateQueries({queryKey:O0.layout($)}),Z.invalidateQueries({queryKey:O0.all})}})}function dr($){let Z=$1();return W5({scope:{id:`workspace-icon:${$}`},mutationFn:async(J)=>{if(J.kind==="set"){await U4(`/api/workspaces/${$}/config`,_5("PUT",{icon:J.icon}),"Failed to save icon");return}if(J.kind==="reset"){await U4(`/api/workspaces/${$}/icon`,{method:"DELETE"},"Failed to reset icon");return}await B1(`/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(O0.layout($),(B)=>B?{...B,...H}:B),Z.setQueryData(O0.all,(B)=>B?.map((Q)=>Q.id===$?{...Q,...H}:Q))},onError:(J,H)=>{if(H.kind!=="set")return;Z.invalidateQueries({queryKey:O0.layout($)}),Z.invalidateQueries({queryKey:O0.all,exact:!0})},onSuccess:()=>{Z.invalidateQueries({queryKey:O0.layout($)}),Z.invalidateQueries({queryKey:O0.all})}})}function lr($){let Z=$1();return L2((J)=>{if(J.type==="env:updated"&&J.workspaceId===$)Z.invalidateQueries({queryKey:O0.env($)})}),{env:ur($),update:pr($)}}var l5=P(c(),1),_K0={dotenv:".env",custom:"secret",both:"override"},OK0=/^[A-Za-z_][A-Za-z0-9_]*$/;function ir(){let{workspaceId:$}=y1(),{env:Z,update:J}=lr($),[H,B]=l_.useState(""),[Q,X]=l_.useState(""),z=OK0.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 l5.jsxs(gH,{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:[l5.jsxs(mH,{label:"Variables",children:[Z.isLoading?l5.jsx("div",{className:"flex items-center justify-center px-3.5 py-6 text-muted-foreground",children:l5.jsx(d5,{className:"size-4 animate-spin",stroke:1.75})}):Y.length===0?l5.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 l5.jsxs("div",{className:"flex items-center gap-3 px-3.5 py-2.5",children:[l5.jsx("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-foreground",children:W.key}),l5.jsx("span",{className:"text-xs tracking-widest text-muted-foreground/60 select-none",children:"••••••"}),l5.jsx("span",{className:B0("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:_K0[W.source]}),!q&&l5.jsx("span",{className:"text-right text-[11px] text-muted-foreground/60",children:"from file"}),l5.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:l5.jsx(Vq,{stroke:1.75})})]},W.key)}),l5.jsxs("div",{className:"flex items-center gap-2 px-3.5 py-2.5",children:[l5.jsx(T$,{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"}),l5.jsx(T$,{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"}),l5.jsxs(P0,{variant:"outline",size:"sm",onClick:U,disabled:!G,children:[J.isPending?l5.jsx(d5,{stroke:1.75,className:"animate-spin"}):l5.jsx(a2,{stroke:1.75}),"Add"]})]})]}),l5.jsx(mH,{label:"From .env files",children:l5.jsx(IX,{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:l5.jsx(fr,{checked:Z.data?.inheritDotenv??!0,disabled:Z.isLoading,onCheckedChange:(W)=>J.mutate({inheritDotenv:W})})})})]})}var N9={};I5(N9,{createHandle:()=>or,Viewport:()=>rU,Trigger:()=>ar,Title:()=>aU,Root:()=>rr,Portal:()=>dU,Popup:()=>cU,Handle:()=>Lq,Description:()=>gU,Close:()=>fU,Backdrop:()=>vU});function rr($){return iU("alert-dialog",$)}var ar=oU;class Lq extends MJ{}function or(){return new Lq}var O4=P(c(),1);function Mq({...$}){return O4.jsx(N9.Root,{"data-slot":"alert-dialog",...$})}function Pq({...$}){return O4.jsx(N9.Trigger,{"data-slot":"alert-dialog-trigger",...$})}function jK0({...$}){return O4.jsx(y8,{portal:N9.Portal,"data-slot":"alert-dialog-portal",...$})}function TK0({className:$,...Z}){return O4.jsx(N9.Backdrop,{"data-slot":"alert-dialog-overlay",className:r0("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 _q({className:$,size:Z="default",...J}){return O4.jsxs(jK0,{children:[O4.jsx(TK0,{}),O4.jsx(N9.Popup,{"data-slot":"alert-dialog-content","data-size":Z,className:r0("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 Oq({className:$,...Z}){return O4.jsx("div",{"data-slot":"alert-dialog-header",className:r0("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 jq({className:$,...Z}){return O4.jsx("div",{"data-slot":"alert-dialog-footer",className:r0("-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 Tq({className:$,...Z}){return O4.jsx(N9.Title,{"data-slot":"alert-dialog-title",className:r0('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 Cq({className:$,...Z}){return O4.jsx(N9.Description,{"data-slot":"alert-dialog-description",className:r0("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",$),...Z})}function Eq({className:$,...Z}){return O4.jsx(P0,{"data-slot":"alert-dialog-action",className:r0($),...Z})}function bq({className:$,variant:Z="outline",size:J="default",...H}){return O4.jsx(N9.Close,{"data-slot":"alert-dialog-cancel",className:r0($),render:O4.jsx(P0,{variant:Z,size:J}),...H})}var A2=P(c(),1);function nr(){let{demo:$}=o4(),{name:Z,cwd:J,workspaceId:H}=y1(),[,B]=m4(),Q=yU(),X=Z??J??"this space",z=()=>{Q.mutate(H,{onSuccess:()=>B("/")})};return A2.jsxs(gH,{title:"General",description:"Basic details for this space.",children:[A2.jsx(mH,{children:A2.jsx(IX,{title:"Path",control:A2.jsx(T$,{value:J??"","aria-label":"Workspace path",title:J??void 0,className:"w-56",readOnly:!0})})}),!$&&A2.jsx(mH,{label:"Danger zone",children:A2.jsx(IX,{title:"Remove space",description:"Remove this space from Moi. Its folder and sessions stay on disk.",control:A2.jsxs(Mq,{children:[A2.jsx(Pq,{render:A2.jsx(P0,{type:"button",variant:"destructive",size:"sm"}),disabled:Q.isPending,children:"Remove"}),A2.jsxs(_q,{children:[A2.jsxs(Oq,{children:[A2.jsxs(Tq,{children:["Remove “",X,"” from your workspaces?"]}),A2.jsx(Cq,{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&&A2.jsx("p",{className:"text-xs text-destructive",children:Q.error.message}),A2.jsxs(jq,{children:[A2.jsx(bq,{disabled:Q.isPending,children:"Cancel"}),A2.jsxs(Eq,{type:"button",variant:"destructive",onClick:z,disabled:Q.isPending,children:[Q.isPending&&A2.jsx(d5,{"data-icon":"inline-start",stroke:1.75,className:"animate-spin"}),"Remove"]})]})]})]})})})]})}var B8=P(c(),1),CK0=[{id:"general",label:"General",icon:u6},{id:"connectors",label:"Connectors",icon:qq},{id:"environment",label:"Environment",icon:qY}];function wq({children:$}){let[Z,J]=sr.useState("general");return B8.jsxs(h6,{children:[$,B8.jsxs(PJ,{className:"flex h-[min(680px,90vh)] w-[880px] gap-0 overflow-hidden p-0 sm:max-w-[94vw]",children:[B8.jsx(v6,{className:"sr-only",children:"Space settings"}),B8.jsxs("nav",{className:"flex w-48 shrink-0 flex-col gap-0.5 border-r bg-muted p-3",children:[B8.jsx("p",{className:"px-2.5 pt-4 pb-2 text-xs text-muted-foreground",children:"Settings"}),CK0.map((H)=>B8.jsxs(P0,{type:"button",variant:Z===H.id?"secondary":"ghost",size:"sm",onClick:()=>J(H.id),className:"justify-start",children:[B8.jsx(H.icon,{stroke:1.75}),H.label]},H.id))]}),B8.jsx("div",{className:"relative scrollbar-thin min-w-0 flex-1 overflow-y-auto",children:B8.jsxs("div",{className:"px-8 py-7",children:[Z==="general"&&B8.jsx(nr,{}),Z==="connectors"&&B8.jsx(Sr,{}),Z==="environment"&&B8.jsx(ir,{})]})})]})]})}var Ha=P(m(),1);function Sq($){let Z=$1();return L2((J)=>{if((J.type==="views:changed"||J.type==="view:deleted")&&J.workspaceId===$){if(Z.invalidateQueries({queryKey:O0.views($)}),J.type==="view:deleted")Z.invalidateQueries({queryKey:O0.sessions($)})}}),e1({queryKey:O0.views($),queryFn:async()=>(await B1(`/api/workspaces/${$}/views`)).views,...N8})}function xX($,Z){let J=$1();return W5({mutationFn:Z,onSuccess:()=>J.invalidateQueries({queryKey:O0.views($)})})}function tr($){return xX($,({viewId:Z,title:J})=>B1(`/api/workspaces/${$}/views/${encodeURIComponent(Z)}`,_5("PATCH",{title:J}),"Couldn’t rename view"))}function i_($){return xX($,(Z)=>U4(`/api/workspaces/${$}/views/${encodeURIComponent(Z)}`,{method:"DELETE"},"Couldn’t delete view"))}function er($){return xX($,()=>B1(`/api/workspaces/${$}/views`,_5("POST"),"Couldn’t create view"))}function $a($){return xX($,({viewId:Z,requirements:J})=>B1(`/api/workspaces/${$}/views/${Z}`,_5("PATCH",{requirements:J}),"Couldn’t save view requirements"))}function Za($){return xX($,({viewId:Z,...J})=>B1(`/api/workspaces/${$}/views/${Z}/submit`,_5("POST",J),"Couldn’t start view chat"))}var Ja=i_;function hX($){return $.title||($.status==="compiled"?$.id:"New view")}function vX($){return DY($.icon)??pF}var C1=P(c(),1);function EK0({outlined:$,onClick:Z}){return C1.jsxs("button",{type:"button","aria-label":"Create new view",onClick:Z,className:B0("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:B0("size-16 rounded-2xl squircle",$&&"shadow-xs transition-shadow duration-300 ease-out group-hover:shadow-2xl"),children:C1.jsx("div",{className:B0("flex size-full items-center justify-center rounded-2xl squircle",$?"bg-background text-foreground":"bg-accent"),children:C1.jsx(a2,{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 bK0({view:$,Icon:Z,onOpen:J}){let{workspaceId:H}=y1(),B=tr(H),Q=i_(H),X=hX($),[z,G]=Ha.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)=>{a1.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(ZK,{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(Mq,{children:[C1.jsxs(Q3,{children:[C1.jsx(X3,{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(WY,{stroke:1.75})})}),C1.jsxs(z3,{align:"end",className:"min-w-32",children:[C1.jsxs(G3,{onClick:U,disabled:B.isPending,children:[C1.jsx(lF,{stroke:1.75}),"Rename"]}),C1.jsxs(G3,{nativeButton:!0,render:C1.jsx(Pq,{}),disabled:Q.isPending,onClick:()=>Q.reset(),className:"w-full",children:[C1.jsx(Vq,{stroke:1.75}),"Delete"]})]})]}),C1.jsxs(_q,{children:[C1.jsxs(Oq,{children:[C1.jsxs(Tq,{children:["Delete “",X,"”?"]}),C1.jsx(Cq,{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(jq,{children:[C1.jsx(bq,{disabled:Q.isPending,children:"Cancel"}),C1.jsxs(Eq,{type:"button",variant:"destructive",disabled:Q.isPending,onClick:()=>Q.mutate($.id),children:[Q.isPending&&C1.jsx(d5,{"data-icon":"inline-start",stroke:1.75,className:"animate-spin"}),"Delete view"]})]})]})]})]})}function Ba({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(bK0,{view:Q,Icon:vX(Q),onOpen:()=>Z(Q.id)},Q.id)),C1.jsx(EK0,{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 Xa=P(c(),1),wK0={[jL.id]:($)=>Xa.jsx(Ba,{views:$.views,onOpenView:$.onOpenView,onCreateView:$.onCreateView,showOnboarding:$.showOnboarding})};function Qa($,Z){if(!H3($))return;return wK0[$](Z)}function za($,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 fX($,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}:za([...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 Rq($,Z,J){return za($,Z,J,4)}function Ga($,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 r_=P(m(),1),Iq=new Map;function SK0($){let Z=window.__moiAppletCss?.get($)??"",J=Iq.get($);if(!J){let Q=document.createElement("style");Q.dataset.appletStyle=$,document.head.appendChild(Q),J={el:Q,refs:0},Iq.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(),Iq.delete($)}}function RK0($){let Z=Iq.get($);if(!Z||Z.el===document.head.lastElementChild)return;document.head.appendChild(Z.el)}function kq($,Z,J=!1){r_.useInsertionEffect(()=>SK0($),[$,Z]),r_.useInsertionEffect(()=>{if(J)RK0($)},[$,J,Z])}var a_=P(c(),1);function Ua({segment:$,name:Z,version:J,children:H}){let B=m1(),Q=Q7($,Z);return kq(pK($,B,Z),J),a_.jsx("div",{"data-applet":Q,className:"size-full",children:a_.jsx(kB,{appletId:Q,children:H})})}var Ya=P(m(),1);var uH=P(c(),1);class gX extends Ya.Component{state={error:null};static getDerivedStateFromError($){return{error:$}}componentDidCatch($,Z){console.error(`[widget:${this.props.name}]`,$,Z.componentStack),W8(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 uH.jsxs("div",{className:"flex h-full w-full flex-col items-start justify-start gap-1.5 p-4 text-xs",children:[uH.jsxs("div",{className:"flex items-center gap-1.5 font-semibold text-destructive",children:[uH.jsx(SG,{size:16,stroke:1.75}),"Widget crashed"]}),uH.jsx("div",{className:"font-mono break-words text-muted-foreground",children:this.state.error.message})]});return this.props.children}}var b7=P(c(),1);function Ka({name:$}){let Z=m1(),J=nh($);return b7.jsxs(I4,{mode:"wait",initial:!1,children:[J.status==="ready"&&b7.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:b7.jsx(gX,{name:$,kind:"widget",workspaceId:Z,resetKey:J.version,children:b7.jsx(Ua,{segment:"widgets",name:$,version:J.version,children:b7.jsx(J.Component,{})})})},J.version),J.status==="error"&&b7.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 Wa=P(m(),1);var w7=P(c(),1);function yq({customizing:$,hidden:Z,widgetId:J,onRemove:H,children:B}){let Q=Bv(),X=!J||!H3(J);return w7.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:[w7.jsx("div",{"data-widget-chrome":!0,"data-vivid":X?!0:void 0,style:X?K9(Q,"widget"):void 0,className:B0("absolute inset-0 overflow-hidden rounded-2xl text-foreground squircle",$&&"pointer-events-none"),children:B}),$&&H&&w7.jsx("div",{className:"absolute -top-2 -right-2 opacity-0 transition-opacity group-hover/widget:opacity-100",children:w7.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?w7.jsx(a2,{stroke:1.75}):w7.jsx(Fa,{stroke:1.75})})})]})}var a3=P(c(),1),IK0={0:"col-start-1",1:"col-start-2",2:"col-start-3",3:"col-start-4"},kK0={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"},yK0={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4"},xK0={1:"row-span-1",2:"row-span-2",3:"row-span-3",4:"row-span-4"};function qa({items:$,renderItem:Z,onCreateWidget:J,onClose:H,onRestore:B,ref:Q}){let X=Wa.useMemo(()=>fX($),[$]);return a3.jsx(Yq,{ref:Q,title:"Widgets",actions:a3.jsxs(P0,{type:"button",variant:"secondary",size:"sm",onClick:J,children:[a3.jsx(a2,{"data-icon":"inline-start",stroke:1.75}),"New widget"]}),onClose:H,className:"max-h-[60vh]",children:X.length>0&&a3.jsx("div",{className:"grid auto-rows-[160px] grid-cols-4 gap-2",children:a3.jsx(I4,{children:X.map((z)=>a3.jsx(K5.div,{layoutId:z.i,className:B0(IK0[z.x],kK0[z.y],yK0[z.w],xK0[z.h]),transition:{type:"spring",duration:0.35,bounce:0},children:a3.jsx(yq,{customizing:!0,widgetId:z.i,onRemove:()=>B(z.i),hidden:!0,children:Z(z.i)})},z.i))})})})}var nq=P(m(),1);var f4=P(m(),1);var H1=P(m(),1),pH=P(m(),1),O8=P(m(),1),ha=P(c(),1),hq=P(m(),1),vq=P(m(),1),v1=P(c(),1),hK0=Object.defineProperty,vK0=($,Z)=>{for(var J in Z)hK0($,J,{get:Z[J],enumerable:!0})},o3={};vK0(o3,{ActiveEmoji:()=>ta,Empty:()=>sa,List:()=>aa,Loading:()=>na,Root:()=>ua,Search:()=>pa,SkinTone:()=>ea,SkinToneSelector:()=>oa,Viewport:()=>ca});var Sa="'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Android Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', EmojiSymbols, sans-serif",s_=["none","light","medium-light","medium","medium-dark","dark"];function o_($){return $.charAt(0).toUpperCase()+$.slice(1)}var A9=2,j4=null;function Na($){try{j4??=document.createElement("canvas").getContext("2d",{willReadFrequently:!0})}catch{}if(!j4||(queueMicrotask(()=>{j4&&(j4=null)}),j4.canvas.width=A9,j4.canvas.height=A9,j4.font=`2px ${Sa}`,j4.textBaseline="middle",j4.measureText($).width>=A9*2))return!1;j4.fillStyle="#00f",j4.fillText($,0,0);let Z=j4.getImageData(0,0,A9,A9).data;j4.clearRect(0,0,A9,A9),j4.fillStyle="#f00",j4.fillText($,0,0);let J=j4.getImageData(0,0,A9,A9).data;for(let H=0;H<A9*A9*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 Aa($,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 Ra($,Z,J){$.setItem(Z,JSON.stringify(J))}function Da($){return(Z)=>Z===void 0?void 0:$(Z)}function Va($){return(Z)=>Z===null?null:$(Z)}function n2($){if(typeof $!="string")throw Error();return $}function xq($){if(typeof $!="number")throw Error();return $}function Ia($){if(typeof $!="boolean")throw Error();return $}function S7($){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 n_($){return(Z)=>{if(!Array.isArray(Z))throw Error();return Z.length>0&&$(Z[0]),Z}}var ka=($,Z)=>`${$}/${Z}/data.json`,ya=($,Z)=>`${$}/${Z}/messages.json`,fK0=["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"],La="en",xa=($)=>`frimousse/data/${$}`,Ma="frimousse/metadata";async function Pa($,Z){try{return(await fetch($,{method:"HEAD",signal:Z})).headers.get("etag")}catch{return null}}async function gK0($,Z,J){let[{emojis:H,emojisEtag:B},{messages:Q,messagesEtag:X}]=await Promise.all([fetch(ka($,Z),{signal:J}).then(async(z)=>({emojis:await z.json(),emojisEtag:z.headers.get("etag")})),fetch(ya($,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 mK0($,Z,J){let[H,B]=await Promise.all([Pa(ka($,Z),J),Pa(ya($,Z),J)]);return{emojisEtag:H,messagesEtag:B}}function uK0($){return $.skins?$.skins.filter((Z)=>typeof Z.tone=="number").reduce((Z,J)=>{let H=s_[J.tone];return Z[H]=J.emoji,Z},{}):void 0}async function _a($,Z,J){let{emojis:H,emojisEtag:B,messages:Q,messagesEtag:X}=await gK0($,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:o_(q.message)})),K=Q.skinTones.reduce((q,N)=>(q[N.key]=o_(N.message),q),{}),F=U.map((q)=>({emoji:q.emoji,category:q.group,version:q.version,label:o_(q.label),tags:q.tags??[],countryFlag:z&&q.subgroup===z.order||void 0,skins:uK0(q)})),W={locale:Z,emojis:F,categories:Y,skinTones:K};return Ra(localStorage,xa(Z),{data:W,metadata:{emojisEtag:B,messagesEtag:X}}),W}function pK0($,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=Na("\uD83C\uDDEA\uD83C\uDDFA");if(typeof Z=="number")return{emojiVersion:Z,countryFlags:Q};for(let X of H){let z=J.get(X);if(Na(z))return{emojiVersion:X,countryFlags:Q}}return{emojiVersion:B,countryFlags:Q}}var cK0=S7({emojiVersion:xq,countryFlags:Ia}),dK0=S7({data:S7({locale:n2,emojis:n_(S7({emoji:n2,category:xq,label:n2,version:xq,tags:n_(n2),countryFlag:Da(Ia),skins:Da(S7({light:n2,"medium-light":n2,medium:n2,"medium-dark":n2,dark:n2}))})),categories:n_(S7({index:xq,label:n2})),skinTones:S7({light:n2,"medium-light":n2,medium:n2,"medium-dark":n2,dark:n2})}),metadata:S7({emojisEtag:Va(n2),messagesEtag:Va(n2)})});async function lK0({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=Aa(sessionStorage,Ma,cK0),X=Aa(localStorage,xa($),dK0),z;if(!X)z=await _a(B,$,H);else if(Q)z=X.data;else try{let{emojisEtag:U,messagesEtag:Y}=await mK0(B,$,H);z=!U||!Y||U!==X.metadata.emojisEtag||Y!==X.metadata.messagesEtag?await _a(B,$,H):X.data}catch{z=X.data}Q??=pK0(z.emojis,Z),Ra(sessionStorage,Ma,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 Oa($){return fK0.includes($)?$:(console.warn(`Locale "${$}" is not supported, using "${La}" instead.`),La)}function ja($){return s_.includes($)?$:(console.warn(`Skin tone "${$}" is not valid, using "none" instead.`),"none")}function iK0($,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 rK0($,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 aK0($,Z,J,H){let B=rK0($.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=iK0(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 oK0($){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 nK0($){let[Z]=O8.useState($);return Z}function sK0($){let Z=O8.createContext(null);return{useStore:()=>{let J=O8.useContext(Z);if(!J)throw Error($);return J},Provider:({store:J,children:H})=>ha.jsx(Z.Provider,{value:J,children:H})}}function _8($,Z,J=Object.is){let[H,B]=O8.useState(()=>Z($.get()));return O8.useEffect(()=>$.subscribe(()=>{let Q=Z($.get());B((X)=>J(X,Q)?X:Q)}),[$,Z,J]),O8.useDebugValue(H),H}function N3($,Z,J){let H=O8.useCallback((B)=>B[Z],[Z]);return _8($,H,J)}var Ta=2;function tK0($,Z,J,H,B){let Q=0;return oK0((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 C of Y.categories)if(N++*K+C.startRowIndex*F<Q)q+=K;else break;let D=Y.categories.length*K+Y.rows.length*F,A=Math.floor(Ta*F/2),V=Math.ceil(Ta*F/2),L=Math.min(Q-q-A,D-W),O=L+W+V,M=Math.max(0,Math.floor(L/F)),_=Math.min(Y.rows.length-1,Math.ceil(O/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 O=A.querySelector(`[aria-rowindex="${L}"]`);if(!(O instanceof HTMLElement))return;let M=O.offsetTop,_=getComputedStyle(O),w=Number.parseFloat(_.scrollMarginTop),C=Number.parseFloat(_.scrollMarginBottom),b=Q+w;W&&M<Q+N/2&&(b+=D);let T=b+N-C;(M<b||M+q>T)&&V.scrollTo({top:Math.max(M<b+D?M-Math.max(W?D:0,w):M-N+q+C,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:Q8,Provider:eK0}=sK0("EmojiPicker.Root is missing.");function $F0($){return $.search}function t_($){return $.interaction==="none"?void 0:$.data?.rows[$.activeRowIndex]?.emojis[$.activeColumnIndex]}function ZF0($){return $.data===void 0||typeof $.data?.count=="number"&&$.data.count===0}function JF0($){return $.data===null||$.viewportHeight===null||$.rowHeight===null||$.categoryHeaderHeight===null}function va($){return $.data?.rows.length}function HF0($){return $.data?.categories.length}function BF0($){return $.data?.categoriesStartRowIndices}function QF0($){return $.data?.skinTones}function fa($,Z){return $?.emoji===Z?.emoji}function XF0($,Z){return $?.categoryIndex!==Z?.categoryIndex||$?.emojis.length!==Z?.emojis.length?!1:!!$?.emojis.every((J,H)=>fa(J,Z?.emojis[H]))}var mX="",Ca=/\p{Emoji_Modifier_Base}/u,zF0=/\uFE0F$/,GF0=/\u{1F3FB}|\u{1F3FC}|\u{1F3FD}|\u{1F3FE}|\u{1F3FF}/gu,UF0={light:"\uD83C\uDFFB","medium-light":"\uD83C\uDFFC",medium:"\uD83C\uDFFD","medium-dark":"\uD83C\uDFFE",dark:"\uD83C\uDFFF"};function YF0($,Z){if(!$.split(mX).some((H)=>Ca.test(H)))return $;let J=$.split(mX).map((H)=>H.replace(GF0,"")).join(mX);return Z==="none"?J:J.split(mX).map((H,B,Q)=>{let X=Q.length>1;return!Ca.test(H)||X&&H==="\uD83E\uDD1D"?H:H.replace(zF0,"")+UF0[Z]}).join(mX)}function KF0($){return s_.map((Z)=>({skinTone:Z,emoji:YF0($,Z)}))}function ga(){let $=Q8(),Z=_8($,t_,fa);return pH.useDeferredValue(Z)}function ma($="✋"){let Z=Q8(),J=N3(Z,"skinTone"),H=pH.useMemo(()=>KF0($),[$]),B=pH.useCallback((Q)=>{Z.set({skinTone:Q})},[]);return[J,B,H]}function e_($,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 FF0(...$){}function WF0($,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 D9=typeof window<"u"?hq.useLayoutEffect:hq.useEffect;function qF0($){let Z=vq.useRef($);return D9(()=>{Z.current=$}),vq.useCallback((...J)=>Z.current(...J),[])}function NF0({emojiVersion:$,emojibaseUrl:Z}){let[J,H]=H1.useState(void 0),B=Q8(),Q=N3(B,"locale"),X=N3(B,"columns"),z=N3(B,"skinTone"),G=N3(B,"search");return H1.useEffect(()=>{let U=new AbortController,Y=U.signal;return lK0({locale:Q,emojiVersion:$,emojibaseUrl:Z,signal:Y}).then((K)=>{H(K)}).catch((K)=>{Y.aborted||console.error(K)}),()=>{U.abort()}},[$,Z,Q]),H1.useEffect(()=>{if(J)return WF0(()=>{B.get().onDataChange(aK0(J,X,z,G))},{timeout:100})},[J,X,z,G]),null}var ua=H1.forwardRef(({locale:$="en",columns:Z=9,skinTone:J="none",onEmojiSelect:H=FF0,emojiVersion:B,emojibaseUrl:Q,onFocusCapture:X,onBlurCapture:z,children:G,style:U,sticky:Y=!0,...K},F)=>{let W=qF0(H),q=nK0(()=>tK0(W,Oa($),Z,Y,ja(J))),[N,D]=H1.useState(!1),A=H1.useRef(null),V=H1.useCallback((M)=>{M&&(A.current=M,q.set({rootRef:A}))},[]);D9(()=>{q.set({locale:Oa($)})},[$]),D9(()=>{q.set({columns:Z})},[Z]),D9(()=>{q.set({sticky:Y})},[Y]),D9(()=>{q.set({skinTone:ja(J)})},[J]);let L=H1.useCallback((M)=>{X?.(M);let{searchRef:_,viewportRef:w}=q.get(),C=M.target===_?.current||M.target.hasAttribute("frimousse-search"),b=M.target===w?.current||M.target.hasAttribute("frimousse-viewport");M.isDefaultPrevented()||(D(C||b),M.isDefaultPrevented()||(D(C||b),b?q.get().onActiveEmojiChange("keyboard",0,0):C&&q.get().search===""&&q.set({interaction:"none"})))},[X]),O=H1.useCallback((M)=>{z?.(M),!M.isDefaultPrevented()&&!M.currentTarget.contains(M.relatedTarget)&&D(!1)},[z]);return D9(()=>{N||q.get().onActiveEmojiReset()},[N]),H1.useImperativeHandle(F,()=>A.current),H1.useEffect(()=>{if(!N)return;function M(_){if(_.defaultPrevented||!_.key.startsWith("Arrow")&&_.key!=="Enter")return;let{data:w,onEmojiSelect:C,onActiveEmojiChange:b,interaction:T,activeColumnIndex:I,activeRowIndex:S}=q.get();if(_.key==="Enter"){let R=t_(q.get());R&&(_.preventDefault(),C(R))}if(_.key.startsWith("Arrow")){let R=I,j=S;if(_.preventDefault(),T!=="none"){if(w?.rows&&w.rows.length>0)switch(_.key){case"ArrowLeft":{if(R===0){let y=j-1,k=w.rows[y];k&&(j=y,R=k.emojis.length-1)}else R-=1;break}case"ArrowRight":{if(R===w.rows[j].emojis.length-1){let y=j+1;w.rows[y]&&(j=y,R=0)}else R+=1;break}case"ArrowUp":{let y=w.rows[j-1];y&&(j-=1,y.emojis[R]||(R=y.emojis.length-1));break}case"ArrowDown":{let y=w.rows[j+1];y&&(j+=1,y.emojis[R]||(R=y.emojis.length-1));break}}b("keyboard",R,j)}else b("keyboard",0,0)}}return document.addEventListener("keydown",M),()=>{document.removeEventListener("keydown",M)}},[N]),D9(()=>{let M=null,_=null,w=null,C=null,b=q.subscribe((j)=>{A.current&&(M!==j.viewportWidth&&(M=j.viewportWidth,A.current.style.setProperty("--frimousse-viewport-width",`${j.viewportWidth}px`)),_!==j.viewportHeight&&(_=j.viewportHeight,A.current.style.setProperty("--frimousse-viewport-height",`${j.viewportHeight}px`)),w!==j.rowHeight&&(w=j.rowHeight,A.current.style.setProperty("--frimousse-row-height",`${j.rowHeight}px`)),C!==j.categoryHeaderHeight&&(C=j.categoryHeaderHeight,A.current.style.setProperty("--frimousse-category-header-height",`${j.categoryHeaderHeight}px`)))}),{viewportWidth:T,viewportHeight:I,rowHeight:S,categoryHeaderHeight:R}=q.get();return T&&A.current.style.setProperty("--frimousse-viewport-width",`${T}px`),I&&A.current.style.setProperty("--frimousse-viewport-height",`${I}px`),S&&A.current.style.setProperty("--frimousse-row-height",`${S}px`),R&&A.current.style.setProperty("--frimousse-category-header-height",`${R}px`),b},[]),v1.jsx("div",{"data-focused":N?"":void 0,"frimousse-root":"",onBlurCapture:O,onFocusCapture:L,...K,ref:V,style:{"--frimousse-emoji-font":Sa,...U},children:v1.jsxs(eK0,{store:q,children:[v1.jsx(NF0,{emojiVersion:B,emojibaseUrl:Q}),G]})})}),pa=H1.forwardRef(({value:$,defaultValue:Z,onChange:J,...H},B)=>{let Q=Q8(),X=H1.useRef(null),z=H1.useCallback((K)=>{K&&(X.current=K,Q.set({searchRef:X}))},[]),G=typeof $=="string",U=H1.useRef(G);H1.useEffect(()=>{U.current=G},[G]),D9(()=>{Q.set({search:typeof $=="string"?$:typeof Z=="string"?Z:""})},[]),D9(()=>{typeof $=="string"&&Q.get().onSearchChange($)},[$]);let Y=H1.useCallback((K)=>{J?.(K),K.isDefaultPrevented()||Q.get().onSearchChange(K.target.value)},[J]);return H1.useImperativeHandle(B,()=>X.current),v1.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:$})}),AF0=H1.memo(()=>{let $=ga();return $?v1.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}),ca=H1.forwardRef(({children:$,onScroll:Z,onKeyDown:J,style:H,...B},Q)=>{let X=Q8(),z=H1.useRef(null),G=H1.useCallback((F)=>{F&&(z.current=F,X.set({viewportRef:z}))},[]),U=_8(X,va),Y=_8(X,HF0),K=H1.useCallback((F)=>{Z?.(F),X.get().onViewportScroll(F.currentTarget.scrollTop)},[Z]);return D9(()=>{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()}},[]),H1.useImperativeHandle(Q,()=>z.current),v1.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:[v1.jsx(AF0,{}),$]})});function da($,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 la($,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 ia($,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 ra($,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 Ea($,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 ba($,Z,J){return{"aria-colcount":$,"aria-rowcount":Z,"frimousse-list":"",style:{"--frimousse-list-columns":$,...J},role:"grid"}}function DF0($){$.preventDefault()}var VF0=H1.memo(({Emoji:$,emoji:Z,columnIndex:J,rowIndex:H})=>{let B=Q8(),Q=_8(B,(U)=>t_(U)?.emoji===Z.emoji),X=H1.useCallback(()=>{B.get().onEmojiSelect(Z)},[Z]),z=H1.useCallback(()=>{B.get().onActiveEmojiChange("pointer",J,H)},[J,H]),G=H1.useCallback(()=>{B.get().onActiveEmojiReset()},[]);return v1.jsx($,{...da(Z,J,Q),onClick:X,onPointerDown:DF0,onPointerEnter:z,onPointerLeave:G})}),LF0=H1.memo(({Row:$,Emoji:Z,rowIndex:J})=>{let H=Q8(),B=_8(H,(Q)=>Q.data?.rows[J],XF0);return B?v1.jsx($,{...la(J),children:B.emojis.map((Q,X)=>v1.jsx(VF0,{Emoji:Z,columnIndex:X,emoji:Q,rowIndex:J},Q.label))}):null}),MF0=H1.memo(({CategoryHeader:$,categoryIndex:Z})=>{let J=Q8(),H=_8(J,(Q)=>Q.data?.categories[Z],e_),B=N3(J,"sticky");return H?v1.jsx("div",{...ia(Z,H),children:v1.jsx($,{...ra({label:H.label},!1,B)})}):null}),wa=H1.memo(({CategoryHeader:$,Row:Z,Emoji:J})=>{let H=H1.useRef(null),B=Q8(),Q=N3(B,"columns"),X=H1.useMemo(()=>Array(Q).fill({emoji:"\uD83D\uDE42",label:""}),[Q]),z=H1.useMemo(()=>({label:"Category"}),[]),G=H1.useRef(null),U=H1.useRef(null);return D9(()=>{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:O}=B.get();N.target===G.current&&L!==D&&A(D),N.target===U.current&&O!==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()}},[]),v1.jsxs("div",{"aria-hidden":!0,ref:H,style:{height:0,visibility:"hidden"},children:[v1.jsx("div",{"frimousse-row-sizer":"",ref:G,children:v1.jsx(Z,{...la(-1,!0),children:X.map((Y,K)=>v1.jsx(J,{...da(Y,K,!1)},K))})}),v1.jsx("div",{...ia(-1),children:v1.jsx("div",{"frimousse-category-header-sizer":"",ref:U,children:v1.jsx($,{...ra(z,!0)})})})]})});function PF0({category:$,...Z}){return v1.jsx("div",{...Z,children:$.label})}function _F0({emoji:$,...Z}){return v1.jsx("button",{type:"button",...Z,children:$.emoji})}function OF0({...$}){return v1.jsx("div",{...$})}var aa=H1.forwardRef(({style:$,components:Z,...J},H)=>{let B=Q8(),Q=H1.useRef(null),X=H1.useCallback((A)=>{A&&(Q.current=A,B.set({listRef:Q}))},[]),z=Z?.CategoryHeader??PF0,G=Z?.Emoji??_F0,U=Z?.Row??OF0,Y=N3(B,"columns"),K=N3(B,"viewportStartRowIndex"),F=N3(B,"viewportEndRowIndex"),W=_8(B,va),q=_8(B,BF0,e_),N=H1.useMemo(()=>q?.filter((A)=>A<K).length??0,[q,K]),D=q?.length??0;return H1.useImperativeHandle(H,()=>Q.current),!W||!q||D===0?v1.jsx("div",{...ba(Y,0,$),...J,children:v1.jsx("div",{...Ea(0,0,0,0),children:v1.jsx(wa,{CategoryHeader:z,Emoji:G,Row:U})})}):v1.jsx("div",{...ba(Y,W,$),...J,ref:X,children:v1.jsxs("div",{...Ea(W,D,K,N),children:[v1.jsx(wa,{CategoryHeader:z,Emoji:G,Row:U}),Array.from({length:F-K+1},(A,V)=>{let L=K+V,O=q.indexOf(L);return v1.jsxs(H1.Fragment,{children:[O>=0&&v1.jsx("div",{style:{height:"var(--frimousse-category-header-height)"}}),v1.jsx(LF0,{Emoji:G,Row:U,rowIndex:L})]},L)}),Array.from({length:D},(A,V)=>v1.jsx(MF0,{CategoryHeader:z,categoryIndex:V},V))]})})}),oa=H1.forwardRef(({emoji:$,onClick:Z,"aria-label":J="Change skin tone",...H},B)=>{let Q=Q8(),X=_8(Q,QF0,e_),[z,G,U]=ma($),Y=H1.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=H1.useCallback((D)=>{Z?.(D),D.isDefaultPrevented()||G(F)},[Z,G,F]);return v1.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 na({children:$,...Z}){let J=Q8();return _8(J,JF0)?v1.jsx("span",{"frimousse-loading":"",...Z,children:$}):null}function jF0({children:$}){let Z=Q8(),J=_8(Z,$F0);return $({search:J})}function sa({children:$,...Z}){let J=Q8();return _8(J,ZF0)?v1.jsx("span",{"frimousse-empty":"",...Z,children:typeof $=="function"?v1.jsx(jF0,{children:$}):$}):null}function ta({children:$}){let Z=ga();return $({emoji:Z})}function ea({children:$,emoji:Z}){let[J,H,B]=ma(Z);return $({skinTone:J,setSkinTone:H,skinToneVariations:B})}ua.displayName="EmojiPicker.Root";pa.displayName="EmojiPicker.Search";ca.displayName="EmojiPicker.Viewport";aa.displayName="EmojiPicker.List";na.displayName="EmojiPicker.Loading";sa.displayName="EmojiPicker.Empty";oa.displayName="EmojiPicker.SkinToneSelector";ta.displayName="EmojiPicker.ActiveEmoji";ea.displayName="EmojiPicker.SkinTone";var pX={};I5(pX,{Root:()=>Qo,Indicator:()=>Xo});var V9=P(m(),1);function $o($){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 Zo="data-checked",Jo="data-unchecked";function fq($){return{checked(Z){if($.indeterminate)return{};if(Z)return{[Zo]:""};return{[Jo]:""}},...k2}}var gq=P(m(),1),CF0=gq.createContext(void 0);function Ho(){return gq.useContext(CF0)}var mq=P(m(),1),$O=mq.createContext(void 0);function Bo(){let $=mq.useContext($O);if($===void 0)throw Error(k0(14));return $}var uX=P(c(),1),EF0="data-parent",Qo=V9.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:O=!1,style:M,..._}=Z,{clearErrors:w}=K4(),{disabled:C,name:b,setDirty:T,setFilled:I,setFocused:S,setTouched:R,state:j,validationMode:y,validityData:k,validation:x}=o5(),v=OJ(),{labelId:f,registerControlId:E,getDescriptionProps:l}=n5(),r=Ho(),h=r?.allValues===void 0?void 0:r.parent,d=h!==void 0,o=C||v.disabled||r?.disabled||z,p=b??F,i=L??p,n=t0(),Z0=r?.registerControlId!==E,J0=m6({id:U||void 0,enabled:Z0}),U0=O?J0:n,z0={};if(d){if(q)z0=h.getParentProps();else if(i!==void 0)z0=h.getChildProps(i)}let{checked:Q0=H,indeterminate:N0=Y,onCheckedChange:D0,...F0}=z0,s=r?.value,a=V9.useRef(null),{getButtonProps:e,buttonRef:$0}=w5({disabled:o,native:O}),X0=r?.validation??x,[_0,M0]=F4({controlled:i!==void 0&&s!==void 0&&!q?s.includes(i):Q0,default:Q,name:"Checkbox",state:"checked"}),A0=d?Boolean(Q0):_0,L0=d?N0||Y:Y;g6(a,n,_0,void 0,!r&&!o,F);let g=h?.registerChildId,u=V9.useRef(null),t=X0.registerInput,W0=r?i:void 0,S0=V9.useCallback((y0)=>t(y0,{controlRef:a,value:W0}),[t,W0]),p0=p2(K,u,q?void 0:S0),f0=Dq(X,f,u,!O,J0);H0(()=>{if(u.current)u.current.indeterminate=L0;if(!r)I(_0)},[_0,L0,r,I]),i9(_0,()=>{if(r)return;w(p),T(_0!==k.initialValue),X0.change(_0)});let T0=Y2({checked:_0,disabled:o,form:G,name:q?void 0:p,id:O?void 0:J0,required:A,ref:p0,style:p?pz:n8,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 z5=E1?[...r.value,i]:r.value.filter((C0)=>C0!==i);r.setValue(z5,W1)}},onClick(y0){y0.stopPropagation()},onFocus(){a.current?.focus()}},L!==void 0?{value:(r?_0&&L:L)||""}:M1,l,(y0)=>X0.getValidationProps(o,y0));V9.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=V9.useMemo(()=>({...j,checked:A0,disabled:o,readOnly:N,required:A,indeterminate:L0}),[j,A0,o,N,A,L0]),z1=fq(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":f0,[EF0]:q?"":void 0,onFocus(){if(!o)S(!0)},onBlur(){let y0=u.current;if(!y0)return;if(R(!0),S(!1),y==="onBlur")X0.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,z5=y0.nativeEvent,C0=y0.preventDefault,x0=z5.preventDefault,a0=!1;y0.preventDefault=()=>{a0=!0,C0.call(y0)},z5.preventDefault=()=>{a0=!0,x0.call(z5)},x0.call(z5),S1(W1).queueMicrotask(()=>{if(y0.preventDefault=C0,z5.preventDefault=x0,!a0)$o(E1)?.click()})},onClick(y0){if(N||o)return;y0.preventDefault();let E1=u.current;if(!E1)return;ZH(E1,y0)}},_,F0,e,l,(y0)=>X0.getValidationProps(o,y0)],stateAttributesMapping:z1}),c0=e0.props.id;return H0(()=>{if(!g||q||i===void 0||c0===void 0)return;return g(i,c0)},[g,q,i,c0]),uX.jsxs($O.Provider,{value:d0,children:[e0,!_0&&!r&&p&&!q&&V!==void 0&&uX.jsx("input",{type:"hidden",form:G,name:p,value:V,disabled:o}),uX.jsx("input",{...T0,suppressHydrationWarning:!0})]})});var uq=P(m(),1);var Xo=uq.forwardRef(function(Z,J){let{render:H,className:B,style:Q,keepMounted:X=!1,...z}=Z,G=Bo(),U=G.checked||G.indeterminate,{mounted:Y,transitionStatus:K,setMounted:F}=S2(U),W=uq.useRef(null),q={...G,transitionStatus:K};V5({batch:!0,enabled:!U,open:U,ref:W,onComplete(){if(!U)F(!1)}});let D={...fq(G),...G2},A=X||Y,V=G0("span",Z,{ref:[J,W],state:q,stateAttributesMapping:D,props:z});if(!A)return null;return V});var pq=P(c(),1);function zo({className:$,...Z}){return pq.jsx(pX.Root,{"data-slot":"checkbox",className:r0('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:pq.jsx(pX.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:pq.jsx(a4,{stroke:2})})})}var YZ={};I5(YZ,{Tab:()=>Ko,Root:()=>Yo,Panel:()=>jo,List:()=>wo,Indicator:()=>_o});var z2=P(m(),1);var cq=P(m(),1),ZO=cq.createContext(void 0);function R7(){let $=cq.useContext(ZO);if($===void 0)throw Error(k0(64));return $}var Go="data-activation-direction";var A3={tabActivationDirection:($)=>({[Go]:$})};var JO=P(c(),1),Yo=z2.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=z2.useRef([]),[W,q]=z2.useState(()=>new Map),[N,D]=F4({controlled:G,default:B,name:"Tabs",state:"value"}),A=G!==void 0,[V,L]=z2.useState(()=>new Map),O=z2.useRef(void 0),M=z2.useCallback((n)=>HO(V,n),[V]),[_,w]=z2.useState(()=>({previousValue:N,tabActivationDirection:"none"})),{previousValue:C,tabActivationDirection:b}=_,T=b,I=!1;if(C!==N)T=Uo(C,N,X,V),I=C!=null&&N!=null&&M(N)==null;let S=I?C:N,R=C!==S||b!==T;H0(()=>{if(!R)return;w({previousValue:S,tabActivationDirection:T})},[S,R,T]);let j=Y0((n,Z0)=>{let J0=Uo(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"}))}),k=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=z2.useCallback((n)=>{return W.get(n)},[W]),v=z2.useCallback((n)=>{for(let Z0 of V.values())if(n===Z0.value)return Z0.id;return},[V]),f=z2.useMemo(()=>({getTabElementBySelectedValue:M,getTabIdByPanelValue:v,getTabPanelIdByValue:x,onValueChange:j,orientation:X,registerMountedTabPanel:k,setTabMap:L,tabActivationDirection:T,value:N}),[M,v,x,j,X,k,L,T,N]),E=z2.useMemo(()=>{for(let n of V.values())if(n.value===N)return n;return},[V,N]),l=z2.useMemo(()=>{for(let n of V.values())if(!n.disabled)return n.value;return},[V]),r=z2.useRef(!K),h=z2.useRef(B),d=z2.useRef(K),o=z2.useRef(!1);H0(()=>{if(A)return;function n(z0,Q0){D(z0),w({previousValue:z0,tabActivationDirection:"none"}),y(z0,Q0),r.current=!1}if(V.size===0){if(o.current&&N!==null&&!O.current?.isConnected)n(null,K0.missing);return}o.current=!0,O.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 Q0=K0.missing;if(U0)Q0=K0.initial;else if(Z0)Q0=K0.disabled;n(z0,Q0);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:T},ref:J,props:Y,stateAttributesMapping:A3});return JO.jsx(ZO.Provider,{value:f,children:JO.jsx(F7,{elementsRef:F,children:i})})});function HO($,Z){for(let[J,H]of $.entries())if(Z===H.value)return J;return null}function Uo($,Z,J,H){if($==null||Z==null)return"none";let[B,Q,X]=J==="horizontal"?["left","left","right"]:["top","up","down"],z=HO(H,$),G=HO(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 n3=P(m(),1);var cX="data-composite-item-active";var dq=P(m(),1),BO=dq.createContext(void 0);function lq(){let $=dq.useContext(BO);if($===void 0)throw Error(k0(65));return $}var Ko=n3.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}=R7(),{activateOnFocus:D,registerTabResizeObserverElement:A,tabsListElement:V}=lq(),{highlightedIndex:L,onHighlightedIndexChange:O}=BH(),M=t0(z),_=n3.useMemo(()=>({disabled:B,id:M,value:X}),[B,M,X]),{compositeProps:w,compositeRef:C,index:b}=EF({metadata:_}),T=X===K,I=n3.useRef(!1),S=n3.useRef(null),R=Y0((o)=>{S.current?.(),S.current=o?A(o):null});H0(()=>{if(I.current){I.current=!1;return}if(!(T&&b>-1&&L!==b))return;let o=V;if(o!=null){let p=d1(g0(o));if(p&&R0(o,p))return}if(!B)O(b)},[T,b,L,O,B,V]);let{getButtonProps:j,buttonRef:y}=w5({disabled:B,native:G,focusableWhenDisabled:!0}),k=F(X),x=n3.useRef(!1),v=n3.useRef(!1);function f(o){W(X,w0(K0.none,o.nativeEvent,void 0,{activationDirection:"none"}))}function E(o){if(T||B)return;f(o)}function l(o){if(T||B)return;if(D&&(!x.current||v.current))f(o)}function r(o){if(T||B)return;x.current=!0,v.current=o.button===0;let p=g0(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:T,orientation:q,tabActivationDirection:N},ref:[J,y,C,R],props:[w,{role:"tab","aria-controls":k,"aria-selected":T,id:M,onClick:E,onFocus:l,onPointerDown:r,[cX]:T?"":void 0,onKeyDownCapture(){I.current=!0}},Y,j],stateAttributesMapping:A3})});var cH=P(m(),1);var Fo="--active-tab-left",Wo="--active-tab-right",qo="--active-tab-top",No="--active-tab-bottom",Ao="--active-tab-width",Do="--active-tab-height";var iq=P(c(),1),Vo,SF0={...A3,activeTabPosition:()=>null,activeTabSize:()=>null},Lo=2,_o=cH.forwardRef(function(Z,J){let{className:H,render:B,renderBeforeHydration:Q=!1,style:X,...z}=Z,{getTabElementBySelectedValue:G,orientation:U,tabActivationDirection:Y,value:K}=R7(),{tabsListElement:F,registerIndicatorUpdateListener:W}=lq(),q=HT();cH.useEffect(()=>{return W(q)},[W,q]);let N=0,D=0,A=0,V=0,L=0,O=0,M=!1;if(K!=null&&F!=null){let S=G(K);if(S!=null){M=!0;let{width:R,height:j}=iZ(S),{width:y,height:k}=iZ(F),x=S.getBoundingClientRect(),v=F.getBoundingClientRect(),f=y>0?v.width/y:1,E=k>0?v.height/k:1,l=RF0(S,F);N=l.left,A=l.top;let r=(x.left-v.left)/f+F.scrollLeft-F.clientLeft,h=(x.top-v.top)/E+F.scrollTop-F.clientTop,d=IF0(S);if(Math.abs(r-d.x-N)<=Lo&&Math.abs(h-d.y-A)<=Lo)N=r,A=h;L=R,O=j,D=F.scrollWidth-N-L,V=F.scrollHeight-A-O}}let _=M?{left:N,right:D,top:A,bottom:V}:null,w=M?{width:L,height:O}:null,C=M?{[Fo]:`${N}px`,[Wo]:`${D}px`,[qo]:`${A}px`,[No]:`${V}px`,[Ao]:`${L}px`,[Do]:`${O}px`}:void 0,b=M&&L>0&&O>0,I=G0("span",Z,{state:{orientation:U,activeTabPosition:_,activeTabSize:w,tabActivationDirection:Y},ref:J,props:[{role:"presentation",style:C,hidden:!b},z,{suppressHydrationWarning:!0}],stateAttributesMapping:SF0});if(K==null)return null;return iq.jsxs(cH.Fragment,{children:[I,Q&&(Vo||(Vo=iq.jsx(mF,{script:fF})))]})});function RF0($,Z){let J=Mo($),H=Mo(Z),B=J.left-H.left-Z.clientLeft,Q=J.top-H.top-Z.clientTop,X=I8($);while(_1(X)&&X!==Z&&!R8(X))B-=X.scrollLeft,Q-=X.scrollTop,X=I8(X);return{left:B,top:Q}}function Mo($){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 IF0($){let Z=S1($).getComputedStyle($),{x:J,y:H}=rz($,Z),B=J,Q=H,{translate:X}=Z;if(X&&X!=="none"){let z=X.split(" ");B+=Po(z[0],$.offsetWidth),Q+=Po(z[1],$.offsetHeight)}return{x:B,y:Q}}function Po($,Z){if(!$)return 0;let J=parseFloat($);if(!Number.isFinite(J))return 0;return $.endsWith("%")?J/100*Z:J}var rq=P(m(),1);var Oo="data-index";var kj1=G8.startingStyle,yj1=G8.endingStyle;var yF0={...A3,...G2},jo=rq.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}=R7(),q=t0(),{ref:N,index:D}=A4(),A=B===U,{mounted:V,transitionStatus:L,setMounted:O}=S2(A),M=!V,_=Y(B),w={hidden:M,orientation:K,tabActivationDirection:F,transitionStatus:L},C=rq.useRef(null),b=G0("div",Z,{state:w,ref:[J,N,C],props:[{"aria-labelledby":_,hidden:M,id:q,role:"tabpanel",tabIndex:A?0:-1,inert:S8(!A),[Oo]:D},G],stateAttributesMapping:yF0});if(V5({open:A,ref:C,onComplete(){if(!A)O(!1)}}),H0(()=>{if(q==null||M&&!X)return;return W(B,q)},[M,X,B,q,W]),!(X||V))return null;return b});var L9=P(m(),1);var Eo=P(m(),1);var UZ=P(m(),1);function To($){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=Z4}=$,[W,q]=UZ.useState(0),N=H!=null,D=UZ.useRef(null),A=p2(D,G),V=UZ.useRef([]),L=UZ.useRef(!1),O=UZ.useRef(null),M=X??W,_=Y0((I,S=!1)=>{if(O.current=V.current[I]??null,(z??q)(I),S){let R=V.current[I];wD(D.current,R,Q,J)}}),w=Y0((I)=>{if(I.size===0)return;if(L.current){let y=V.current,k=y.indexOf(O.current);if(k===-1){let x=y[M];if(!x||O3(y,M,K))_(xF0(y,K));else O.current=x}else if(k!==M)_(k);return}L.current=!0;let S=Array.from(I.keys()),R=S.find((y)=>y?.hasAttribute(cX))??null,j=R?I.get(R)?.index??-1:-1;if(j!==-1)_(j);else if(O3(S,M,K)){let y=b8(S,{disabledIndices:K});if(!Y6(S,y))_(y)}wD(D.current,R,Q,J)});H0(()=>{if(K==null||X!=null||!L.current)return;let I=V.current;if(O3(I,M,K)){let S=b8(I,{disabledIndices:K});if(!Y6(I,S))_(S)}},[K,X,M,V,_]);let C=Y0((I,S,R)=>{if(!B)return R;return B(I,S,R,V)}),b=Y0((I)=>{let S=I.key===QJ||I.key===XJ;if(!B9.has(I.key)||!U&&S)return;if(hF0(I,F))return;if(!D.current)return;let j=Q==="rtl",y=j?HJ:BJ,k=j?BJ:HJ,x=J==="vertical"?JJ:y,v=J==="vertical"?ZJ:k,f=P1(I.nativeEvent);if(f!=null&&bD(f)&&!Ug(f)){let{selectionStart:o,selectionEnd:p,value:i}=f;if(o==null||I.shiftKey||o!==p)return;if(I.key!==v&&o<i.length)return;if(I.key!==x&&o>0)return}let E=M,l=Z$(V,K),r=kZ(V,K);if(H!=null)E=H({disabledIndices:K,elementsRef:V,event:I,highlightedIndex:M,loopFocus:Z,maxIndex:r,minIndex:l,onLoop:C,orientation:J,rtl:j});let h=J!=="vertical"&&I.key===y||J!=="horizontal"&&I.key===JJ,d=J!=="vertical"&&I.key===k||J!=="horizontal"&&I.key===ZJ;if(U){if(I.key===QJ)E=l;else if(I.key===XJ)E=r}if(E===M&&(h||d))if(Z&&E===r&&h){if(E=l,B)E=B(I,M,E,V)}else if(Z&&E===l&&d){if(E=r,B)E=B(I,M,E,V)}else E=b8(V.current,{startingIndex:E,decrement:d,disabledIndices:K});if(E!==M&&!Y6(V.current,E)){if(Y)I.stopPropagation();if(N||S||h||d)I.preventDefault();_(E,!0),queueMicrotask(()=>{V.current[E]?.focus()})}});return{props:{ref:A,onFocus(I){let S=D.current,R=P1(I.nativeEvent);if(!S||R==null||!bD(R))return;R.setSelectionRange(0,R.value.length)},onKeyDown:b},highlightedIndex:M,onHighlightedIndexChange:_,elementsRef:V,onMapChange:w,relayKeyboardEvent:b}}function xF0($,Z){let J=-1;for(let H=0;H<$.length;H+=1){let B=$[H];if(!B||O3($,H,Z))continue;if(B.hasAttribute(cX))return H;if(J===-1)J=H}return Math.max(J,0)}function hF0($,Z){for(let J of Vw){if(Z.includes(J))continue;if($.getModifierState(J))return!0}return!1}var QO=P(c(),1);function bo($){let{render:Z,className:J,style:H,refs:B=Z4,props:Q=Z4,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:O=!1,tag:M="div",..._}=$,w=i4(),{props:C,highlightedIndex:b,onHighlightedIndexChange:T,elementsRef:I,onMapChange:S,relayKeyboardEvent:R}=To({grid:K,loopFocus:F,onLoop:W,orientation:Y,highlightedIndex:G,onHighlightedIndexChange:U,rootRef:A,stopEventPropagation:D,enableHomeAndEndKeys:q,direction:w,disabledIndices:V,modifierKeys:L}),j=G0(M,$,{state:X,ref:B,props:[C,...Q,_],stateAttributesMapping:z}),y=Eo.useMemo(()=>({highlightedIndex:b,onHighlightedIndexChange:T,highlightItemOnHover:O,relayKeyboardEvent:R}),[b,T,O,R]);return QO.jsx(Co.Provider,{value:y,children:QO.jsx(F7,{elementsRef:I,onMapChange:(k)=>{N?.(k),S(k)},children:j})})}var XO=P(c(),1),wo=L9.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}=R7(),[F,W]=L9.useState(0),[q,N]=L9.useState(null),D=L9.useRef(new Set),A=L9.useRef(new Set),V=L9.useRef(null);H0(()=>{if(typeof ResizeObserver>"u")return;let C=new ResizeObserver(()=>{D.current.forEach((b)=>{b()})});if(V.current=C,q)C.observe(q);return A.current.forEach((b)=>{C.observe(b)}),()=>{C.disconnect(),V.current=null}},[q]);let L=Y0((C)=>{return D.current.add(C),()=>{D.current.delete(C)}}),O=Y0((C)=>{return A.current.add(C),V.current?.observe(C),()=>{A.current.delete(C),V.current?.unobserve(C)}}),M={orientation:U,tabActivationDirection:K},_={"aria-orientation":U==="vertical"?"vertical":void 0,role:"tablist"},w=L9.useMemo(()=>({activateOnFocus:H,registerIndicatorUpdateListener:L,registerTabResizeObserverElement:O,tabsListElement:q}),[H,L,O,q]);return XO.jsx(BO.Provider,{value:w,children:XO.jsx(bo,{render:X,className:B,style:z,state:M,refs:[J,N],props:[_,G],stateAttributesMapping:A3,highlightedIndex:F,enableHomeAndEndKeys:!0,loopFocus:Q,orientation:U,onHighlightedIndexChange:W,onMapChange:Y,disabledIndices:Z4})})});var dX=P(c(),1);function So({className:$,orientation:Z="horizontal",...J}){return dX.jsx(YZ.Root,{"data-slot":"tabs","data-orientation":Z,orientation:Z,className:r0("group/tabs flex gap-2 data-horizontal:flex-col",$),...J})}var vF0=qJ("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 Ro({className:$,variant:Z="default",...J}){return dX.jsx(YZ.List,{"data-slot":"tabs-list","data-variant":Z,className:r0(vF0({variant:Z}),$),...J})}function aq({className:$,...Z}){return dX.jsx(YZ.Tab,{"data-slot":"tabs-trigger",className:r0("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 oq({className:$,...Z}){return dX.jsx(YZ.Panel,{"data-slot":"tabs-content",className:r0("flex-1 text-sm outline-none",$),...Z})}var Io=["\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","☕"],zO="font-[Apple_Color_Emoji,Segoe_UI_Emoji,Noto_Color_Emoji,sans-serif]";var A1=P(c(),1),fF0=32,ko=4,gF0=12,go="flex pt-4 pb-2 items-center bg-background px-3 text-xs font-medium text-muted-foreground",mo=f4.createContext(null);function yo($,Z){if(Z)return{...$,background:"theme"};if($.type==="emoji")return{type:"emoji",value:$.value};return{type:"glyph",value:$.value}}function mF0({category:$,className:Z,...J}){return A1.jsx("div",{...J,className:B0(go,Z),children:$.label})}function xo({className:$,...Z}){return A1.jsx("div",{className:B0("flex flex-wrap content-start gap-1",$),...Z})}function GO({className:$,selected:Z=!1,...J}){return A1.jsx(P0,{type:"button",variant:"ghost",size:"icon","aria-pressed":Z,className:B0("shrink-0 data-active:bg-accent",Z&&"bg-accent",$),...J})}function uF0({children:$,className:Z,...J}){return A1.jsx("div",{...J,className:B0("flex h-8 gap-1 px-1.5",Z),children:$})}function pF0({emoji:$,...Z}){let J=f4.useContext(mo);return A1.jsx(GO,{selected:J===$.emoji,className:zO,...Z,children:A1.jsx("span",{className:"text-xl leading-none",children:$.emoji})})}function uo(){let{layout:$,workspaceId:Z}=y1(),{icon:J}=$,H=dr(Z),[B,Q]=f4.useState(J?.type??"glyph"),[X,z]=f4.useState(!J||J.type!=="upload"&&J.background==="theme"),G=J?.type==="upload"?void 0:J,[U,Y]=f4.useState(""),[K,F]=f4.useState(13),[W,q]=f4.useState(null),[N,D]=f4.useState(!1),A=f4.useRef(null),V=(M)=>{let _=yo(M,X);H.mutate({kind:"set",icon:_})},L=(M)=>{H.mutate({kind:"upload",file:M})},O=(M)=>{if(z(M),G){let _=yo(G,M);H.mutate({kind:"set",icon:_})}};return f4.useEffect(()=>{if(!W)return;let M=(w)=>{let C=Math.max(1,Math.floor((w-gF0+ko)/(fF0+ko)));F((b)=>b===C?b:C)};M(W.clientWidth);let _=new ResizeObserver(([w])=>{M(w?.contentRect.width??W.clientWidth)});return _.observe(W),()=>_.disconnect()},[W]),A1.jsxs(So,{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(Ro,{"aria-label":"Icon source",children:[A1.jsx(aq,{value:"glyph",children:"Icon"}),A1.jsx(aq,{value:"emoji",children:"Emoji"}),A1.jsx(aq,{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(ho,{"data-icon":"inline-start",stroke:1.5}),"Reset"]})]}),A1.jsx(oq,{value:"emoji",className:"flex-none",children:A1.jsx(mo,{value:G?.type==="emoji"?G.value:null,children:A1.jsxs(o3.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(o3.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(o3.SkinToneSelector,{className:"size-8 shrink-0 rounded-lg text-lg hover:bg-accent"})]}),A1.jsxs(o3.Viewport,{ref:q,className:"relative scrollbar-thin flex-1 overflow-y-auto outline-none",children:[A1.jsxs(o3.Loading,{className:"absolute inset-0 flex items-center justify-center gap-2 text-xs text-muted-foreground",children:[A1.jsx(d5,{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:B0("sticky top-0",go),children:"Favorites"}),A1.jsx(xo,{className:"px-1.5 pb-1.5",children:Io.map((M)=>A1.jsx(GO,{onClick:()=>V({type:"emoji",value:M}),selected:G?.type==="emoji"&&G.value===M,className:zO,children:A1.jsx("span",{className:"text-xl leading-none",children:M})},M))})]}),A1.jsxs(o3.Empty,{className:"absolute inset-0 flex flex-col items-center justify-center gap-1 text-xs text-muted-foreground",children:[A1.jsx(vo,{size:20,stroke:1.5}),"No emoji found"]}),A1.jsx(o3.List,{className:"select-none",components:{CategoryHeader:mF0,Row:uF0,Emoji:pF0}})]})]})})}),A1.jsx(oq,{value:"glyph",className:"scrollbar-thin h-72 overflow-y-auto rounded-xl border border-border bg-background p-1.5",children:A1.jsx(xo,{children:Bk.map(({id:M,Icon:_})=>A1.jsx(GO,{"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(oq,{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:B0("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(fo,{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(zo,{id:"workspace-icon-theme-background",checked:X,onCheckedChange:O}),"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 I7=P(c(),1);function po(){let{layout:$,name:Z,provider:J,workspaceId:H}=y1(),B=Z??"Workspace",Q=cr(H),[X,z]=nq.useState(B);nq.useEffect(()=>z(B),[B]);function G(U){let Y=U.trim();if(z(Y),Y!==B)Q.mutate(Y===""?null:Y)}return I7.jsx(JK,{name:X,icon:$.icon,workspaceType:J,workspaceTheme:$.theme,onNameChange:z,onNameCommit:G,renderIcon:(U)=>I7.jsxs(j6,{children:[I7.jsx(T6,{render:I7.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:U})}),I7.jsx(C6,{align:"start",sideOffset:8,className:"w-[min(32rem,calc(100vw-2rem))] gap-4 rounded-2xl p-6",children:I7.jsx(uo,{})})]})})}var eX=P(m(),1);function y7($){let{margin:Z,containerPadding:J,containerWidth:H,cols:B}=$;return(H-Z[0]*(B-1)-J[0]*2)/B}function M9($,Z,J){if(!Number.isFinite($))return $;return Math.round(Z*$+Math.max(0,$-1)*J)}function iX($,Z,J,H,B,Q,X){let{margin:z,containerPadding:G,rowHeight:U}=$,Y=y7($),K,F,W,q;if(X)K=Math.round(X.width),F=Math.round(X.height);else K=M9(H,Y,z[0]),F=M9(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 lo($,Z,J,H,B){let{margin:Q,containerPadding:X,cols:z,rowHeight:G,maxRows:U}=$,Y=y7($),K=Math.round((J-X[0])/(Y+Q[0])),F=Math.round((Z-X[1])/(G+Q[1]));return K=lX(K,0,z-H),F=lX(F,0,U-B),{x:K,y:F}}function rX($,Z,J){let{margin:H,containerPadding:B,rowHeight:Q}=$,X=y7($),z=Math.round((J-B[0])/(X+H[0])),G=Math.round((Z-B[1])/(Q+H[1]));return{x:z,y:G}}function io($,Z,J){let{margin:H,rowHeight:B}=$,Q=y7($),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 lX($,Z,J){return Math.max(Math.min($,J),Z)}function tq($,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 x7($,Z){for(let J=0;J<$.length;J++){let H=$[J];if(H!==void 0&&tq(H,Z))return H}return}function UO($,Z){return $.filter((J)=>tq(J,Z))}function cF0($,Z){if(Z==="horizontal")return YO($);if(Z==="vertical")return sq($);if(Z==="wrap")return sq($);return[...$]}function sq($){return[...$].sort((Z,J)=>{if(Z.y!==J.y)return Z.y-J.y;return Z.x-J.x})}function YO($){return[...$].sort((Z,J)=>{if(Z.x!==J.x)return Z.x-J.x;return Z.y-J.y})}function aX($){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 h7($,Z){for(let J=0;J<$.length;J++){let H=$[J];if(H!==void 0&&H.i===Z)return H}return}function oX($){return $.filter((Z)=>Z.static===!0)}function s3($){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 dH($){let Z=Array($.length);for(let J=0;J<$.length;J++){let H=$[J];if(H!==void 0)Z[J]=s3(H)}return Z}function dF0($,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 ro($,Z,J){let H=h7($,Z);if(!H)return[[...$],null];return H=J(s3(H)),[dF0($,H),H]}function KO($,Z){let J=oX($);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(x7(J,B))B.y++}return $}function k7($,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=cF0($,X);if(X==="vertical"&&typeof H==="number"?Y>=H:X==="horizontal"&&typeof J==="number"?U>=J:!1)K=K.reverse();let W=UO(K,Z),q=W.length>0;if(q&&G)return dH($);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=co(N,A,Z,B,X);else N=co(N,Z,A,B,X)}return N}function co($,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=x7($,K),W=F!==void 0&&F.y+F.h>Z.y,q=F!==void 0&&Z.x+Z.w>F.x;if(!F)return k7($,J,X?K.x:void 0,z?K.y:void 0,H,G,B);if(W&&z)return k7($,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 k7($,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 k7($,J,U,Y,H,G,B)}function lH($,Z,J){return Math.max(Z,Math.min(J,$))}var lF0={name:"gridBounds",constrainPosition($,Z,J,{cols:H,maxRows:B}){return{x:lH(Z,0,Math.max(0,H-$.w)),y:lH(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:lH(Z,1,Math.max(1,X)),h:lH(J,1,Math.max(1,z))}}},iF0={name:"minMaxSize",constrainSize($,Z,J){return{w:lH(Z,$.minW??1,$.maxW??1/0),h:lH(J,$.minH??1,$.maxH??1/0)}}};var FO=[lF0,iF0];function nX($,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 ao($,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 $N({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 WO({top:$,left:Z,width:J,height:H}){return{top:`${$}px`,left:`${Z}px`,width:`${J}px`,height:`${H}px`,position:"absolute"}}function qO($){return $*100+"%"}function rF0($,Z,J,H){return $+J>H?Z:J}function oo($,Z,J){return $<0?Z:J}function aF0($){return Math.max(0,$)}function eq($){return Math.max(0,$)}var NO=($,Z,J)=>{let{left:H,height:B,width:Q}=Z,X=$.top-(B-$.height);return{left:H,width:Q,height:oo(X,$.height,B),top:eq(X)}},AO=($,Z,J)=>{let{top:H,left:B,height:Q,width:X}=Z;return{top:H,height:Q,width:rF0($.left,$.width,X,J),left:aF0(B)}},DO=($,Z,J)=>{let{top:H,height:B,width:Q}=Z,X=$.left+$.width-Q;if(X<0)return{height:B,width:$.left+$.width,top:eq(H),left:0};return{height:B,width:Q,top:eq(H),left:X}},VO=($,Z,J)=>{let{top:H,left:B,height:Q,width:X}=Z;return{width:X,left:B,height:oo(H,$.height,Q),top:eq(H)}},oF0=($,Z,J)=>NO($,AO($,Z,J)),nF0=($,Z,J)=>NO($,DO($,Z)),sF0=($,Z,J)=>VO($,AO($,Z,J)),tF0=($,Z,J)=>VO($,DO($,Z)),eF0={n:NO,ne:oF0,e:AO,se:sF0,s:VO,sw:tF0,w:DO,nw:nF0};function no($,Z,J,H){let B=eF0[$];if(!B)return J;return B(Z,{...Z,...J},H)}var $W0={type:"transform",scale:1,calcStyle($){return $N($)}};var so=$W0,to={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},eo={enabled:!0,bounded:!1,threshold:3},$n={enabled:!0,handles:["se"]},Zn={enabled:!1,defaultItem:{w:1,h:1}};function LO($,Z,J,H,B){let Q=H==="x"?"w":"h";Z[H]+=1;let X=$.findIndex((G)=>G.i===Z.i),z=B??oX($).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(tq(Z,U))LO($,U,J+Z[Q],H,z)}Z[H]=J}function ZW0($,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&&!x7($,Z))Z.y--;let B;while((B=x7($,Z))!==void 0)LO(J,Z,B.y+B.h,"y");return Z.y=Math.max(Z.y,0),Z}function JW0($,Z,J,H){Z.x=Math.max(Z.x,0),Z.y=Math.max(Z.y,0);while(Z.x>0&&!x7($,Z))Z.x--;let B;while((B=x7($,Z))!==void 0)if(LO(H,Z,B.x+B.w,"x"),Z.x+Z.w>J){Z.x=J-Z.w,Z.y++;while(Z.x>0&&!x7($,Z))Z.x--}return Z.x=Math.max(Z.x,0),Z}var sX={type:"vertical",allowOverlap:!1,compact($,Z){let J=oX($),H=aX(J),B=sq($),Q=Array($.length);for(let X=0;X<B.length;X++){let z=B[X];if(z===void 0)continue;let G=s3(z);if(!G.static)G=ZW0(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}},MO={type:"horizontal",allowOverlap:!1,compact($,Z){let J=oX($),H=YO($),B=Array($.length);for(let Q=0;Q<H.length;Q++){let X=H[Q];if(X===void 0)continue;let z=s3(X);if(!z.static)z=JW0(J,z,Z,H),J.push(z);let G=$.indexOf(X);B[G]=z,z.moved=!1}return B}},PO={type:null,allowOverlap:!1,compact($,Z){return dH($)}},HW0={...sX,allowOverlap:!0,compact($,Z){return dH($)}},BW0={...MO,allowOverlap:!0,compact($,Z){return dH($)}},QW0={...PO,allowOverlap:!0};function _O($,Z=!1,J=!1){let H;if(Z)if($==="vertical")H=HW0;else if($==="horizontal")H=BW0;else H=QW0;else if($==="vertical")H=sX;else if($==="horizontal")H=MO;else H=PO;if(J)return{...H,preventCollision:J};return H}var P9=P(m(),1);function XW0($){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 OO($={}){let{measureBeforeMount:Z=!1,initialWidth:J=1280}=$,[H,B]=P9.useState(J),[Q,X]=P9.useState(!Z),z=P9.useRef(null),G=P9.useRef(null),U=P9.useCallback(()=>{let Y=z.current;if(Y){let K=Math.round(XW0(Y));if(B((F)=>F===K?F:K),!Q)X(!0)}},[Q]);return P9.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),Xn=P(Xq(),1),zn=P(m_(),1);var e3=P(c(),1),KZ=P(Hn(),1);function jO($){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:O="",cancel:M="",x:_,y:w,w:C,h:b,minW:T=1,maxW:I=1/0,minH:S=1,maxH:R=1/0,i:j,resizeHandles:y,resizeHandle:k,constraints:x=FO,layoutItem:v,layout:f=[],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}),Q0=v0.useRef(void 0),N0=v0.useRef(f);N0.current=f;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]),X0=v0.useMemo(()=>({cols:J,maxRows:z,containerWidth:H,containerHeight:0,rowHeight:X,margin:B,layout:[]}),[J,z,H,X,B]),_0=v0.useCallback(()=>({...X0,layout:N0.current}),[X0]),M0=v0.useMemo(()=>v??{i:j,x:_,y:w,w:C,h:b,minW:T,maxW:I,minH:S,maxH:R},[v,j,_,w,C,b,T,I,S,R]),A0=v0.useCallback((C0)=>{if(N?.calcStyle)return N.calcStyle(C0);if(F)return $N(C0);let x0=WO(C0);if(W)return{...x0,left:qO(C0.left/H),width:qO(C0.width/H)};return x0},[N,F,W,H]),L0=v0.useCallback((C0,{node:x0})=>{if(!E)return;let{offsetParent:a0}=x0;if(!a0)return;let n0=a0.getBoundingClientRect(),D1=x0.getBoundingClientRect(),V1=D1.left/q,p1=n0.left/q,Z5=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+a0.scrollLeft,top:Z5-m0+a0.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=rX($0,q0.top,q0.left),{x:U1,y:I0}=nX(x,M0,h0.x,h0.y,_0());E(j,U1,I0,{e:C0,node:x0,newPosition:q0})},[E,q,$0,N,D,x,M0,_0,j]),g=v0.useCallback((C0,{node:x0,deltaX:a0,deltaY:n0})=>{if(!l||!p)return;let D1=C0;if(s.current&&!e.current){let U1=D1.clientX-a.current.x,I0=D1.clientY-a.current.y;if(Math.hypot(U1,I0)<D)return;if(e.current=!0,s.current=!1,E){let l0=rX($0,U0.current.top,U0.current.left),{x:L1,y:T1}=nX(x,M0,l0.x,l0.y,_0());E(j,L1,T1,{e:C0,node:x0,newPosition:U0.current})}}let V1=U0.current.top+n0,p1=U0.current.left+a0;if(Y){let{offsetParent:U1}=x0;if(U1){let I0=U1.clientHeight-M9(b,X,B[1]);V1=lX(V1,0,I0);let i0=y7($0),l0=H-M9(C,i0,B[0]);p1=lX(p1,0,l0)}}let Z5={top:V1,left:p1};U0.current=Z5;let m0=rX($0,V1,p1),{x:q0,y:h0}=nX(x,M0,m0.x,m0.y,_0());l(j,q0,h0,{e:C0,node:x0,newPosition:Z5})},[l,E,p,D,Y,b,X,B,$0,H,C,j,x,M0,_0]),u=v0.useCallback((C0,{node:x0})=>{if(!r||!p)return;let a0=s.current;if(s.current=!1,e.current=!1,a.current={x:0,y:0},a0){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=rX($0,D1,n0),{x:Z5,y:m0}=nX(x,M0,p1.x,p1.y,_0());r(j,Z5,m0,{e:C0,node:x0,newPosition:V1})},[r,p,$0,x,M0,_0,j]);D0.current=L0,F0.current=g;let t=v0.useCallback((C0,{node:x0,size:a0,handle:n0},D1,V1)=>{let p1=V1==="onResizeStart"?h:V1==="onResize"?d:o;if(!p1)return;let Z5;if(x0)Z5=no(n0,D1,a0,H);else Z5={...a0,top:D1.top,left:D1.left};z0.current=Z5;let m0=io($0,Z5.width,Z5.height),{w:q0,h:h0}=ao(x,M0,m0.w,m0.h,n0,_0());p1(j,q0,h0,{e:C0.nativeEvent??C0,node:x0,size:Z5,handle:n0})},[h,d,o,H,$0,j,x,M0,_0]),W0=v0.useCallback((C0,x0)=>{Z0(!0);let a0=iX($0,_,w,C,b),n0={...x0,handle:x0.handle};t(C0,n0,a0,"onResizeStart")},[t,$0,_,w,C,b]),S0=v0.useCallback((C0,x0)=>{let a0=iX($0,_,w,C,b),n0={...x0,handle:x0.handle};t(C0,n0,a0,"onResize")},[t,$0,_,w,C,b]),p0=v0.useCallback((C0,x0)=>{Z0(!1),z0.current={top:0,left:0,width:0,height:0};let a0=iX($0,_,w,C,b),n0={...x0,handle:x0.handle};t(C0,n0,a0,"onResizeStop")},[t,$0,_,w,C,b]);v0.useEffect(()=>{if(!A)return;let C0=J0.current;if(!C0)return;let x0=Q0.current||{left:0,top:0},a0=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(a0){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)}Q0.current=A},[A,p,j]);let f0=iX($0,_,w,C,b,p?U0.current:null,n?z0.current:null),T0=v0.default.Children.only(Z),d0=y7($0),z1=[M9(T,d0,B[0]),M9(S,X,B[1])],e0=[M9(I,d0,B[0]),M9(R,X,B[1])],c0=T0.props,y0=c0.className,E1=c0.style,W1=v0.default.cloneElement(T0,{ref:J0,className:TO("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(f0)}}),z5=k;return W1=e3.jsx(zn.Resizable,{draggableOpts:{disabled:!U},className:U?void 0:"react-resizable-hide",width:f0.width,height:f0.height,minConstraints:z1,maxConstraints:e0,onResizeStart:W0,onResize:S0,onResizeStop:p0,transformScale:q,resizeHandles:y,handle:z5,children:W1}),W1=e3.jsx(Xn.DraggableCore,{disabled:!G,onStart:L0,onDrag:g,onStop:u,handle:O,cancel:".react-resizable-handle"+(M?","+M:""),scale:q,nodeRef:J0,children:W1}),W1}var t3=()=>{},Bn="react-grid-layout",Gn=!1;try{Gn=/firefox/i.test(navigator.userAgent)}catch{}function YW0($,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 Qn($,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(s3(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:aX(B),w:1,h:1})}});let X=KO(B,{cols:J});return H.compact(X,J)}function tX($){let{children:Z,width:J,gridConfig:H,dragConfig:B,resizeConfig:Q,dropConfig:X,positionStrategy:z=so,compactor:G,constraints:U=FO,layout:Y=[],droppingItem:K,autoSize:F=!0,className:W="",style:q={},innerRef:N,onLayoutChange:D=t3,onDragStart:A=t3,onDrag:V=t3,onDragStop:L=t3,onResizeStart:O=t3,onResize:M=t3,onResizeStop:_=t3,onDrop:w=t3,onDropDragOver:C=t3}=$,b=v0.useMemo(()=>({...to,...H}),[H]),T=v0.useMemo(()=>({...eo,...B}),[B]),I=v0.useMemo(()=>({...$n,...Q}),[Q]),S=v0.useMemo(()=>({...Zn,...X}),[X]),{cols:R,rowHeight:j,maxRows:y,margin:k,containerPadding:x}=b,{enabled:v,bounded:f,handle:E,cancel:l,threshold:r}=T,{enabled:h,handles:d,handleComponent:o}=I,{enabled:p,defaultItem:i,onDragOver:n}=S,Z0=G??_O("vertical"),J0=Z0.type,U0=Z0.allowOverlap,z0=Z0.preventCollision??!1,Q0=v0.useMemo(()=>K??{i:"__dropping-elem__",...i},[K,i]),N0=z.type==="transform",D0=z.scale,F0=x??k,[s,a]=v0.useState(!1),[e,$0]=v0.useState(()=>Qn(Y,Z,R,Z0)),[X0,_0]=v0.useState(null),[M0,A0]=v0.useState(!1),[L0,g]=v0.useState(null),[u,t]=v0.useState(),W0=v0.useRef(null),S0=v0.useRef(null),p0=v0.useRef(null),f0=v0.useRef(0),T0=v0.useRef(e),d0=v0.useRef(Y),z1=v0.useRef(Z),e0=v0.useRef(J0),c0=v0.useRef(e);c0.current=e,v0.useEffect(()=>{if(a(!0),!KZ.deepEqual(e,Y))D(e)},[]),v0.useEffect(()=>{if(X0)return;if(L0)return;let I0=!KZ.deepEqual(Y,d0.current),i0=!YW0(Z,z1.current),l0=J0!==e0.current;if(I0||i0||l0){let T1=Qn(I0?Y:e,Z,R,Z0);if(!KZ.deepEqual(T1,e))$0(T1)}d0.current=Y,z1.current=Z,e0.current=J0},[Y,Z,R,J0,Z0,X0,L0,e]),v0.useEffect(()=>{if(!X0&&!KZ.deepEqual(e,T0.current)){T0.current=e;let I0=e.filter((i0)=>i0.i!==Q0.i);D(I0)}},[e,X0,D,Q0.i]);let y0=v0.useMemo(()=>{if(!F)return;let I0=aX(e),i0=F0[1];return I0*j+(I0-1)*k[1]+i0*2+"px"},[F,e,j,k,F0]),E1=v0.useCallback((I0,i0,l0,L1)=>{let T1=c0.current,c1=h7(T1,I0);if(!c1)return;let g5={w:c1.w,h:c1.h,x:c1.x,y:c1.y,i:I0};W0.current=s3(c1),p0.current=T1,_0(g5),A(T1,c1,c1,null,L1.e,L1.node)},[A]),W1=v0.useCallback((I0,i0,l0,L1)=>{let T1=c0.current,c1=W0.current,g5=h7(T1,I0);if(!g5)return;let T2={w:g5.w,h:g5.h,x:g5.x,y:g5.y,i:I0},m5=k7(T1,g5,i0,l0,!0,z0,J0,R,U0);V(m5,c1,g5,T2,L1.e,L1.node),$0(Z0.compact(m5,R)),_0(T2)},[z0,J0,R,U0,Z0,V]),z5=v0.useCallback((I0,i0,l0,L1)=>{if(!X0)return;let T1=c0.current,c1=W0.current,g5=h7(T1,I0);if(!g5)return;let T2=k7(T1,g5,i0,l0,!0,z0,J0,R,U0),m5=Z0.compact(T2,R);L(m5,c1,g5,null,L1.e,L1.node);let $4=p0.current;if(W0.current=null,p0.current=null,_0(null),$0(m5),$4&&!KZ.deepEqual($4,m5))D(m5)},[X0,z0,J0,R,U0,Z0,L,D]),C0=v0.useCallback((I0,i0,l0,L1)=>{let T1=c0.current,c1=h7(T1,I0);if(!c1)return;S0.current=s3(c1),p0.current=T1,A0(!0),O(T1,c1,c1,null,L1.e,L1.node)},[O]),x0=v0.useCallback((I0,i0,l0,L1)=>{let T1=c0.current,c1=S0.current,{handle:g5}=L1,T2=!1,m5,$4,[Qz,M3]=ro(T1,I0,(p5)=>{if(m5=p5.x,$4=p5.y,["sw","w","nw","n","ne"].includes(g5)){if(["sw","nw","w"].includes(g5))m5=p5.x+(p5.w-i0),i0=p5.x!==m5&&m5<0?p5.w:i0,m5=m5<0?0:m5;if(["ne","n","nw"].includes(g5))$4=p5.y+(p5.h-l0),l0=p5.y!==$4&&$4<0?p5.h:l0,$4=$4<0?0:$4;T2=!0}if(z0&&!U0){if(UO(T1,{...p5,w:i0,h:l0,x:m5??p5.x,y:$4??p5.y}).filter((zz)=>zz.i!==p5.i).length>0)$4=p5.y,l0=p5.h,m5=p5.x,i0=p5.w,T2=!1}return p5.w=i0,p5.h=l0,p5});if(!M3)return;let $B=Qz;if(T2&&m5!==void 0&&$4!==void 0)$B=k7(Qz,M3,m5,$4,!0,z0,J0,R,U0);let Xz={w:M3.w,h:M3.h,x:M3.x,y:M3.y,i:I0,static:!0};M($B,c1,M3,Xz,L1.e,L1.node),$0(Z0.compact($B,R)),_0(Xz)},[z0,J0,R,U0,Z0,M]),a0=v0.useCallback((I0,i0,l0,L1)=>{let T1=c0.current,c1=S0.current,g5=h7(T1,I0),T2=Z0.compact(T1,R);_(T2,c1,g5??null,null,L1.e,L1.node);let m5=p0.current;if(S0.current=null,p0.current=null,_0(null),A0(!1),$0(T2),m5&&!KZ.deepEqual(m5,T2))D(T2)},[R,Z0,_,D]),n0=v0.useCallback(()=>{let I0=c0.current;if(!I0.some((L1)=>L1.i===Q0.i)){g(null),_0(null),t(void 0);return}let l0=Z0.compact(I0.filter((L1)=>L1.i!==Q0.i),R);$0(l0),g(null),_0(null),t(void 0)},[Q0.i,R,Z0]),D1=v0.useCallback((I0)=>{if(I0.preventDefault(),I0.stopPropagation(),Gn&&!I0.nativeEvent.target?.classList.contains(Bn))return!1;let i0=n?n(I0.nativeEvent):C(I0);if(i0===!1){if(L0)n0();return!1}let{dragOffsetX:l0=0,dragOffsetY:L1=0,...T1}=i0??{},c1={...Q0,...T1},g5=I0.currentTarget.getBoundingClientRect(),T2={cols:R,margin:k,maxRows:y,rowHeight:j,containerWidth:J,containerPadding:F0},m5=y7(T2),$4=M9(c1.w,m5,k[0]),Qz=M9(c1.h,j,k[1]),M3=$4/2,$B=Qz/2,Xz=I0.clientX-g5.left+l0-M3,p5=I0.clientY-g5.top+L1-$B,MN=Math.max(0,Xz),zz=Math.max(0,p5),Gz={left:MN/D0,top:zz/D0,e:I0.nativeEvent};if(!L0){let PN=lo(T2,zz,MN,c1.w,c1.h);g(e3.jsx("div",{},c1.i)),t(Gz);let Pt=c0.current.filter((_t)=>_t.i!==c1.i);$0([...Pt,{...c1,x:PN.x,y:PN.y,static:!1,isDraggable:!0}])}else if(u){if(u.left!==Gz.left||u.top!==Gz.top)t(Gz)}},[L0,u,Q0,n,C,n0,D0,R,k,y,j,J,F0]),V1=v0.useCallback((I0)=>{if(I0.preventDefault(),I0.stopPropagation(),f0.current--,f0.current<0)f0.current=0;if(f0.current===0)n0()},[n0]),p1=v0.useCallback((I0)=>{I0.preventDefault(),I0.stopPropagation(),f0.current++},[]),Z5=v0.useCallback((I0)=>{I0.preventDefault(),I0.stopPropagation();let i0=c0.current,l0=i0.find((L1)=>L1.i===Q0.i);f0.current=0,n0(),w(i0,l0,I0.nativeEvent)},[Q0.i,n0,w]),m0=v0.useCallback((I0,i0)=>{if(!I0||!I0.key)return null;let l0=h7(e,String(I0.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&&f&&l0.isBounded!==!1,T2=o;return e3.jsx(jO,{containerWidth:J,cols:R,margin:k,containerPadding:F0,maxRows:y,rowHeight:j,cancel:l,handle:E,onDragStart:E1,onDrag:W1,onDragStop:z5,onResizeStart:C0,onResize:x0,onResizeStop:a0,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:T2,constraints:U,layoutItem:l0,layout:e,children:I0},l0.i)},[e,J,R,k,F0,y,j,l,E,E1,W1,z5,C0,x0,a0,v,h,f,N0,s,D0,z,r,u,d,o,U]),q0=()=>{if(!X0)return null;return e3.jsx(jO,{w:X0.w,h:X0.h,x:X0.x,y:X0.y,i:X0.i,className:`react-grid-placeholder ${M0?"placeholder-resizing":""}`,containerWidth:J,cols:R,margin:k,containerPadding:F0,maxRows:y,rowHeight:j,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:N0,transformScale:D0,constraints:U,layout:e,children:e3.jsx("div",{})})},h0=TO(Bn,W),U1={height:y0,...q};return e3.jsxs("div",{ref:N,className:h0,style:U1,onDrop:p?Z5:void 0,onDragLeave:p?V1:void 0,onDragEnter:p?p1:void 0,onDragOver:p?D1:void 0,children:[v0.default.Children.map(Z,(I0)=>{if(!v0.default.isValidElement(I0))return null;return m0(I0)}),p&&L0&&m0(L0,!0),q0()]})}var j8=P(c(),1),CO="moi:empty-state",Un={type:"spring",duration:0.35,bounce:0};function FW0({items:$,customizing:Z,emptyState:J,renderItem:H,onMove:B,onRemove:Q}){let[X,z]=eX.useState(()=>fX($)),[G,U]=eX.useState($),{width:Y,containerRef:K,mounted:F}=OO({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,...fX($.filter((L)=>!V.has(L.id)),A)]});let W=J?[...X,{i:CO,x:0,y:X.reduce((N,D)=>Math.max(N,D.y+D.h),0),w:4,h:2,static:!0}]:X,q=eX.useCallback((N)=>{let D=N.filter((A)=>A.i!==CO);z(D),B?.(D.map((A)=>({id:A.i,x:A.x,y:A.y})))},[B]);return j8.jsx("div",{ref:K,className:"w-full",children:F&&j8.jsxs(tX,{width:Y,layout:W,gridConfig:{cols:4,rowHeight:160,margin:[8,8],containerPadding:[0,0]},dragConfig:{enabled:!!Z},resizeConfig:{enabled:!1},compactor:sX,onLayoutChange:q,children:[X.map((N)=>j8.jsx("div",{children:j8.jsx(K5.div,{layoutId:N.i,"data-applet-thumbnail":Q7("widgets",N.i),className:"size-full",transition:Un,children:j8.jsx(yq,{customizing:Z,widgetId:N.i,onRemove:Q?()=>Q(N.i):void 0,children:H(N.i)})})},N.i)),J&&j8.jsx("div",{children:j8.jsx(K5.div,{layout:!0,className:"size-full",transition:Un,children:J})},CO)]})})}function Yn({items:$,customizing:Z,header:J,emptyState:H,bottomInset:B=0,renderItem:Q,onMove:X,onRemove:z}){return j8.jsxs("div",{className:"size-full overflow-y-auto p-4",children:[j8.jsx("div",{className:"mx-auto h-32 w-full max-w-(--column-w)",children:J}),j8.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)&&j8.jsx(FW0,{items:$,customizing:Z,emptyState:H,renderItem:Q,onMove:X,onRemove:z})})]})}var i1=P(c(),1);function WW0({onCreateWidget:$,showOnboarding:Z}){return i1.jsxs("div",{className:"relative grid size-full grid-cols-4 grid-rows-2 gap-2 overflow-hidden",children:[i1.jsx("div",{className:"col-span-2 overflow-hidden rounded-2xl bg-muted texture-checker squircle",children:i1.jsx("div",{className:"flex size-full items-start justify-start bg-radial-[at_top_left] from-muted from-40% to-transparent p-12",children:i1.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"Widgets"})})}),i1.jsx("div",{className:"col-span-2 overflow-hidden rounded-2xl bg-muted texture-checker squircle"}),i1.jsx("div",{className:"col-span-2 overflow-hidden rounded-2xl bg-muted texture-checker squircle"}),i1.jsx("div",{className:"col-span-2 overflow-hidden rounded-2xl bg-muted texture-checker squircle",children:Z&&i1.jsx("div",{className:"flex size-full items-end justify-end",children:i1.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"})})}),i1.jsxs(P0,{type:"button",variant:"outline",className:B0("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:[i1.jsx(a2,{"data-icon":"inline-start",stroke:1}),"New widget"]})]})}function EO({Icon:$,label:Z,active:J,className:H,...B}){return i1.jsx(P0,{type:"button",variant:J?"default":"secondary",className:B0("relative h-16 w-24 rounded-lg px-4 py-0 text-xs [&_svg]:size-5",H),"aria-pressed":J,...B,children:i1.jsx(I4,{mode:"popLayout",initial:!1,children:i1.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?i1.jsx(a4,{stroke:1.5}):i1.jsx($,{stroke:1.5}),i1.jsx("span",{children:J?"Done":Z})]},J?"done":"action")})})}function qW0({customizing:$,theming:Z,onCustomizingChange:J,onThemingChange:H}){return i1.jsxs("div",{className:"flex size-full items-center gap-4",children:[i1.jsx(po,{}),i1.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[i1.jsx(EO,{Icon:Kn,label:"Customize",active:$,onClick:()=>J(!$)}),i1.jsx(EO,{Icon:JN,label:"Theme",active:Z,onClick:()=>H(!Z)}),i1.jsx(wq,{children:i1.jsx(f3,{render:i1.jsx(EO,{Icon:u6,label:"Settings"})})})]})]})}function NW0(){let[$,Z]=HN.useState(0);return[HN.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 Fn({onCreateWidget:$,onCreateView:Z,onOpenView:J,customizing:H,theming:B,onThemingChange:Q,onCustomizingChange:X,widgets:z,views:G}){let{layout:U,setLayout:Y}=y1(),K=b1((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 T=F.get(b.i);return{id:b.i,w:T.config.colSpan,h:T.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)=>H3(b.id)),A=!K&&z.every((b)=>H3(b.id)),[V,L]=NW0(),O=H;Wq({kind:"widget",enabled:!H,targets:q.filter((b)=>!H3(b.id)).map((b)=>({id:b.id,revision:F.get(b.id)?.revision}))});function M(b){let T=Qa(b,{views:G,onOpenView:J,onCreateView:Z,showOnboarding:A});if(T)return T;return i1.jsx(Ka,{name:b})}function _(b){Y({widgetGrid:U.widgetGrid.filter((T)=>T.i!==b)})}function w(b){let T=F.get(b);if(!T)return;let I=U.widgetGrid.map((R)=>{let j=F.get(R.i);return{...R,w:j?.config.colSpan??1,h:j?.config.rowSpan??1}}),S=Rq(I,T.config.colSpan,T.config.rowSpan);Y({widgetGrid:[...U.widgetGrid,{i:b,x:S.x,y:S.y}]})}function C(b){Y({widgetGrid:Ga(U.widgetGrid,b)})}return i1.jsx("div",{className:"relative min-h-0 flex-1 bg-background",children:i1.jsxs(TU,{children:[i1.jsx(Yn,{items:q,customizing:H,header:i1.jsx(qW0,{customizing:H,theming:B,onCustomizingChange:X,onThemingChange:Q}),emptyState:D?i1.jsx(WW0,{onCreateWidget:$,showOnboarding:A}):void 0,bottomInset:O?L:0,renderItem:M,onMove:C,onRemove:_}),i1.jsx(I4,{children:H&&i1.jsx(qa,{ref:V,items:N,renderItem:M,onCreateWidget:$,onClose:()=>X(!1),onRestore:w})})]})})}var qn=P(c(),1);function Wn({children:$}){return qn.jsx("header",{className:B0("@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 Nn=!0;var AW0=64;function An($,Z=[]){let J=VL($),H=J.attachments.map(LL);return(fh(J.text).trim()||(H.length?H:Z).filter(Boolean).join(", ")).replace(/\s+/gu," ").trim().slice(0,AW0).trimEnd()}function BN($,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:vh({type:"text",source:H,label:B,text:Q})}}function Dn($){return{attachments:$.map((Z)=>Z.attachment),parts:$.map((Z)=>Z.part)}}async function Vn($,Z){let J=vK(Z);if(J)throw Error(J);return Dn(await Promise.all(Z.map(async(H)=>{if(H.type==="text")return BN(H);let B=await uQ($,H.file??H.path);return BN(B,`/api/workspaces/${$}/uploads/${B.id}`,{source:H.source})})))}function bO($){return Dn($.flatMap((Z)=>{if(Z.kind==="text")return[BN(Z)];if(!Z.upload)return[];return[BN({...Z.upload,filename:Z.label,mediaType:Z.mediaType},Z.previewUrl,{source:Z.source,purpose:Z.kind==="drawing"?Z.purpose:void 0})]}))}function wO($){return!$?.applet&&!$?.preparedAttachments}function QN($,Z,J){if(!wO(J))return[];return(I1.getState().attachments[q8($,Z)]??[]).filter((B)=>B.kind==="text"||B.status==="ready"&&B.upload)}function DW0({queryClient:$,workspaceId:Z,sessionId:J,parts:H}){let B=`optimistic:${crypto.randomUUID()}`;return $.setQueryData(O0.events(Z,J),(Q)=>lG(Q??IB(),{kind:"turn",turn:{id:B,role:"user",origin:{kind:"user-input"},parts:H,timestamp:new Date().toISOString()}})),I1.getState().setActivity(Z,J,"running"),I1.getState().setError(Z,J,null),B}function XN({tabId:$,queryClient:Z,workspaceId:J,sessionId:H,text:B,filenames:Q=[]}){let X=An(B,Q);if(!X)return;Z.setQueryData(O0.sessions(J),(z)=>[{sessionId:H,summary:X,lastModified:Date.now(),...$?{tabId:$}:{}},...(z??[]).filter((G)=>G.sessionId!==H)])}function zN($,Z,J,H){let B=$?.models,Q=!Z||!B||B.some((K)=>K.value===Z)?Z:void 0,X=$?.provider==="codex"?HF($.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=Nn&&$?.supportsStreaming?!0:void 0;return{model:z,effort:G,...U!==void 0?{fastMode:U}:{},stream:Y}}function v7($,Z,J){I1.getState().renameSession($,Z,J),b1.getState().moveComposerDraft(V2($,Z),V2($,J))}function GN($,Z,J=bO(Z)){let H=[...J.parts];if($.text)H.push({type:"text",text:$.text});return{attachments:J.attachments,optimisticId:DW0({...$,parts:H})}}function UN($,Z){for(let J of Z)I1.getState().removeAttachment($,J.localId);b1.getState().markMessageSentFromMoi($)}var Mn=P(m(),1);function Ln($){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 VW0($,Z,J,H="shared"){let B=new Set,Q=!1,X=()=>{let G=Z.getQueryData(i2($,H)),U=Z.getQueryData(i2($));return uD(U,J().tabId,H==="browser-tab"?G:void 0)??null};async function z(G){if(Q)return;let U=(L)=>{a1.add({title:"Couldn’t send message",description:L,type:"error"}),W8($,{source:"runtime",message:`sendChatMessage() from ${G.applet.kind}:${G.applet.id}: ${L}`})},Y=Ln(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)a1.close(q)},D=()=>{if(!W)return;N(),a1.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=a1.add({title:"Preparing attachments…",type:"loading",timeout:0});if(V=await Vn($,G.attachments),!W)return;let L=J(),O=Ln(L.agentAvailability);if(O)throw Error(O);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 Pn($){let Z=m1(),J=$1(),H=x3(),B=l2(),Q=N5({...$,tabId:H});Mn.useLayoutEffect(()=>{let X=VW0(Z,J,()=>Q.current,B?"browser-tab":"shared"),z=gK(Z).on("sendChatMessage",(G)=>{X.handle(G)});return()=>{z(),X.dispose()}},[Z,J,Q,H,B])}function _n($,Z){let J=m1();mK(J,"addChatAttachment",(H)=>{Nv({workspaceId:J,sessionId:$},H),Z()})}var FZ=P(m(),1);var jn=P(m(),1);var On=new Map;function LW0($){let Z=On.get($)??[];return On.delete($),Z}function MW0($,Z=[]){return[...LW0($),...Z]}function PW0($,Z){if(!$.startsWith("views/"))return;return Object.keys(Z).length>0?Z:void 0}function _W0($,Z){if($.startsWith("views/"))return Z?.find((J)=>J.id===$.slice(6))?.title||void 0;return}function Tn({activeTab:$,appletParams:Z}){let J=m1(),H=Sq(J).data;return jn.useCallback((B={})=>{let Q=MW0(J,B.directives??[]),X=PW0($,Z);return{activeTab:{id:$,title:_W0($,H),...X?{params:X}:{}},...B.applet?{applet:B.applet}:{},...Q.length>0?{directives:Q}:{}}},[J,$,Z,H])}function Cn($,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 OW0($){return $.filter((Z)=>Z.text.length>0).map((Z)=>Z.kind==="reasoning"?{type:"reasoning",text:Z.text}:{type:"text",text:Z.text})}function En($){let Z=OW0($?.blocks??[]);if(Z.length===0)return null;return{id:"live-preview",role:"assistant",origin:{kind:"user-input"},parts:Z}}var bn=IB();function wn($){let Z=m1(),J=$1(),{layout:H}=y1(),[B,Q]=h3($.activeTab),X=l2(),z=t4(Z).data,G=VJ(Z).data,U=B??null,Y=U??F2($.activeTab),K=Tn($),F=G4((j)=>U?j.activity[`${Z}:${U}`]??"idle":"idle"),W=RB(F),q=G4((j)=>U?j.errors[`${Z}:${U}`]??null:null),N=gS(Z,U),{refetch:D}=N,A=bU(Z,U),{refetch:V}=A,L=FZ.useCallback(async()=>{await D(),await V()},[D,V]),O=A.data?.forkedFromSessionId,M=!U||A.data!==void 0,_=M?N.data??bn:bn;if(N.data&&O)_=Cn(N.data,A.data);let w=B!==void 0&&M&&G!==void 0&&(U===null||N.data!==void 0),C=G4((j)=>hb(j.previews,Z,U).root),b=FZ.useMemo(()=>En(C),[C]),T=A.data?.config,I=FZ.useCallback((j,y)=>{let k=j.trim(),x=QN(Z,Y,y);if(!k&&x.length===0&&!y?.preparedAttachments?.attachments.length)return;let v=y?.preparedAttachments??bO(x),f=vK(v.attachments);if(f){a1.add({title:"Couldn’t send message",description:f,type:"error"});return}let E=U,l=!1;if(!E){if(E=crypto.randomUUID(),l=!0,!wO(y))v7(Z,Y,E);Q(E),XN({tabId:$.activeTab,queryClient:J,workspaceId:Z,sessionId:E,text:k,filenames:x.map((U0)=>U0.label)})}let{attachments:r,optimisticId:h}=GN({queryClient:J,workspaceId:Z,sessionId:E,text:k},x,v),d=T?.model??H.selectedModel,o=T?.effort??H.selectedEffort,p=T?.fastMode??H.selectedFastMode,{model:i,effort:n,fastMode:Z0,stream:J0}=zN(z,d,o,p);if(RU({type:"chat",workspaceId:Z,content:k,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}:{}}),UN(Z,x),l)J.invalidateQueries({queryKey:O0.preview(Z)})},[$.activeTab,Y,U,Z,J,H.selectedModel,H.selectedEffort,H.selectedFastMode,K,T?.model,T?.effort,T?.fastMode,Q,X,z]),S=FZ.useCallback(()=>{if(!U)return;I1.getState().setError(Z,U,null)},[U,Z]),R=FZ.useCallback(()=>{if(!W||!U)return;RU({type:"stop",workspaceId:Z,sessionId:U})},[W,U,Z]);return{view:_,forkedFromSessionId:O,chatLoaded:w,previewTurn:b,sessionId:U,composerSessionId:Y,processing:W,error:q,loadError:A.error?.message??N.error?.message??null,retryLoad:L,send:I,stop:R,selectSession:Q,dismissError:S}}var Rn=P(m(),1);var s2=P(m(),1);function Sn({active:$,viewId:Z,sessionId:J,source:H,workspaceId:B,onEditingStart:Q,onContinueInChat:X}){let z=s2.useRef(`sketch:${Z}`),G=s2.useRef(0),U=s2.useRef(null),Y=s2.useRef(null),K=s2.useRef(!0),[F,W]=s2.useState(!1),q=N5(Q),N=N5(X),D=s2.useCallback((C)=>{if(!K.current)return;if(!C){G.current+=1,U.current=null,Y.current=null,I1.getState().removeAttachment(B,z.current);return}pQ({workspaceId:B,sessionId:J,localId:z.current,purpose:"sketch",source:H,blob:C})},[J,H,B]),A=s2.useCallback((C)=>{if(!C)return Y.current??Promise.resolve();if(C===U.current){if(I1.getState().attachments[q8(B,J)]?.some((S)=>S.localId===z.current&&S.kind!=="text"&&(S.status==="ready"||S.status==="uploading")))return Y.current??Promise.resolve()}U.current=C;let b=++G.current,T=sK({workspaceId:B,sessionId:J,localId:z.current,purpose:"sketch",source:H,blob:C,isCurrent:()=>G.current===b});return Y.current=T,T},[J,H,B]),V=aK({mode:"sketch",onChange:D,onEditingStart:()=>q.current()}),{controls:L}=V,O=s2.useCallback(async()=>{await A(await L.flush())},[L,A]),M=s2.useCallback(async()=>{await A(await L.deactivate())},[L,A]),_=s2.useCallback(async()=>{if(F)return;W(!0);try{await M(),N.current()}finally{W(!1)}},[F,M,N]),w=s2.useCallback(async()=>{K.current=!1,G.current+=1,U.current=null,Y.current=null,I1.getState().removeAttachment(B,z.current);try{await L.cancel()}finally{K.current=!0}},[L,B]);return s2.useEffect(()=>{if(!$&&L.active)M()},[$,L.active,M]),{...V,continuing:F,continueInChat:_,prepareForSend:O,resetDocument:w}}var f1=P(c(),1);function In({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=Sn({active:Z&&J.status==="draft",viewId:J.id,sessionId:B??J.executionSessionId??F2(S5(J.id)),source:S5(J.id),workspaceId:X,onEditingStart:z,onContinueInChat:G});return Rn.useImperativeHandle($,()=>({prepareSketchForSend:F.prepareForSend,resetSketch:F.resetDocument}),[F.prepareForSend,F.resetDocument]),f1.jsx(CW0,{active:Z,chatDocked:Q,error:J.error,sketch:F,displayStatus:K,onDiscard:Y,onOpenChat:U})}function jW0(){return f1.jsx(YN,{children:f1.jsxs("div",{className:"flex max-w-md flex-col items-center gap-4 p-8 text-center",children:[f1.jsx(r2,{className:"size-6 text-muted-foreground"}),f1.jsx("p",{className:"text-sm text-muted-foreground",children:"Starting view chat…"})]})})}function TW0({error:$,onOpenChat:Z,onDiscard:J}){return f1.jsx(YN,{children:f1.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:[f1.jsx("p",{className:"text-sm text-muted-foreground",children:$}),f1.jsx(P0,{onClick:Z,children:"Open chat"}),f1.jsx(P0,{variant:"secondary",onClick:J,children:"Discard view"})]})})}function CW0({active:$,chatDocked:Z,error:J,sketch:H,displayStatus:B,onDiscard:Q,onOpenChat:X}){let z=B==="draft";return f1.jsxs("div",{className:B0("relative min-h-0 flex-1 overflow-hidden bg-background",$?"flex":"hidden"),children:[f1.jsx(EW0,{chatDocked:Z,sketch:H,draft:z}),f1.jsx("div",{inert:z?void 0:!0,className:B0("absolute inset-0",!z&&"pointer-events-none opacity-50"),children:f1.jsx(iK,{...H.layerProps,children:z&&f1.jsx(nK,{controls:H.controls,title:"Sketch the view",busy:H.continuing,onComplete:()=>void H.continueInChat()})})}),f1.jsx("div",{"aria-hidden":!0,className:B0("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"&&f1.jsx(wW0,{controls:H.controls}),B==="starting"&&f1.jsx(jW0,{}),B==="waiting"&&f1.jsx(bW0,{error:J,onDiscard:Q,onOpenChat:X}),B==="failed"&&f1.jsx(TW0,{error:J,onOpenChat:X,onDiscard:Q})]})}function EW0({chatDocked:$,sketch:Z,draft:J}){let{controls:H,targetRef:B}=Z,{hasStrokes:Q}=mQ(H);return f1.jsx("div",{ref:B,className:"absolute inset-0 flex items-center justify-center texture-checker-20",children:J&&!H.active&&!Q&&f1.jsxs("div",{className:B0("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:[f1.jsx($H,{size:56,stroke:0.5}),f1.jsx("span",{className:"max-w-32",children:"Sketch how the view should look"})]})})}function bW0({error:$,onDiscard:Z,onOpenChat:J}){return f1.jsx(YN,{children:f1.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:[f1.jsxs("div",{className:"flex flex-col gap-1",children:[f1.jsx("h1",{className:"font-medium",children:"The view needs your attention"}),f1.jsx("p",{className:"text-sm text-muted-foreground",children:$??"Open the chat to answer or ask the agent to continue"})]}),f1.jsxs("div",{className:"flex gap-2",children:[f1.jsx(P0,{onClick:J,children:"Open chat"}),f1.jsx(P0,{variant:"secondary",onClick:Z,children:"Discard view"})]})]})})}function wW0({controls:$}){let{hasStrokes:Z}=mQ($);return f1.jsx(YN,{children:!Z&&f1.jsx(r2,{className:"size-6 text-muted-foreground"})})}function YN({children:$}){return f1.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:$})}var X8=P(m(),1);function kn($,{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 yn($,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 xn($,Z){return $.length===Z.length&&$.every((J,H)=>{let B=Z[H];return J.id===B.id&&J.releasedAt===B.releasedAt})}var j2=P(c(),1),vn=X8.memo(function({views:Z,activeViewId:J,params:H}){let B=SW0(J,Z),Q=new Set(B.map((X)=>X.id));return j2.jsx("div",{className:B0("relative min-h-0 flex-1 overflow-hidden",!J&&"hidden"),children:Z.filter((X)=>Q.has(X.id)).map((X)=>j2.jsx(RW0,{view:X,active:X.id===J,params:H},X.id))})});function SW0($,Z){let[J,H]=X8.useState([]),B=N5(Z),Q=Z.map((z)=>z.id).join(`
|
|
68
|
+
`),X=X8.useCallback(()=>{H((z)=>{let G=kn(z,{activeId:$,available:new Set(B.current.map((U)=>U.id)),now:Date.now()});return xn(z,G)?z:G})},[$,B]);return X8.useEffect(()=>{X()},[Q,X]),X8.useEffect(()=>{let z=yn(J,Date.now());if(z===null)return;let G=setTimeout(X,z);return()=>clearTimeout(G)},[X,J]),J}function RW0({view:$,active:Z,params:J}){let H=m1(),B=sh($.id),{current:Q,outgoing:X}=kW0(B,Z),[z,G]=X8.useState(J);if(Z&&z!==J)G(J);kq(pK("views",H,$.id),Q?.version??B.version,Z);let U=B.status==="error";return Wq({kind:"view",enabled:Z&&Boolean(Q)&&!U,targets:[{id:$.id,revision:$.revision}]}),j2.jsxs(j2.Fragment,{children:[Z&&U&&j2.jsx("p",{className:"absolute inset-0 p-4 text-xs text-destructive",children:B.error}),Z&&!U&&!Q&&j2.jsx(yW0,{}),Q&&!U&&j2.jsxs(X8.Activity,{mode:Z?"visible":"hidden",children:[X&&j2.jsx(hn,{view:$,build:X,params:z},X.version),j2.jsx(hn,{view:$,build:Q,params:z,entering:X!==null,current:!0},Q.version)]})]})}function hn({view:$,build:Z,params:J,entering:H,current:B=!1}){let Q=m1(),X=Q7("views",$.id);return j2.jsx("div",{"data-applet-thumbnail":B?X:void 0,"data-applet":X,className:B0("absolute inset-0 isolate",H&&"animate-in duration-200 ease-out blur-in-4 fade-in"),children:j2.jsx("div",{className:"size-full overflow-auto",children:j2.jsx(gX,{name:$.id,kind:"view",workspaceId:Q,resetKey:Z.version,children:j2.jsx(kB,{appletId:X,active:B,children:j2.jsx(Z.Component,{params:J})})})})})}var IW0=200;function kW0($,Z){let[J,H]=X8.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 X8.useEffect(()=>{if(!J.outgoing)return;let B=setTimeout(()=>H((Q)=>({...Q,outgoing:null})),IW0);return()=>clearTimeout(B)},[J.outgoing]),J}function yW0(){return j2.jsx("div",{className:"absolute inset-0 flex animate-in items-center justify-center delay-150 duration-200 fill-mode-both fade-in",children:j2.jsx(r2,{className:"text-muted-foreground"})})}function fn($){return $?.status==="compiled"?void 0:$}async function gn($,Z,J,H,B,Q,X="shared"){let G=fn($.getQueryData(O0.views(Z))?.find((K)=>K.id===J))?.executionSessionId??H;try{let[{views:K},F]=await Promise.all([B1(`/api/workspaces/${Z}/views`),B1(`/api/workspaces/${Z}/selected-session`)]),W=fn(K.find((q)=>q.id===J));if(!Q&&W?.status==="draft")G=F2(S5(J)),$.setQueryData(O0.sessions(Z),(q)=>q?.filter((N)=>N.sessionId!==H)),$.removeQueries({queryKey:O0.events(Z,H)});else G=W?.executionSessionId??(Q?F.pinned:F.selected[S5(J)])??H;if(v7(Z,H,G),W?.status==="draft"||W?.status==="failed")I1.getState().setActivity(Z,G,"idle");if($.setQueryData(O0.views(Z),K),$.setQueryData(y3.sessionSelection(Z),F),X==="browser-tab"&&!Q){let N={...($.getQueryData(i2(Z,"browser-tab"))??k6(Z)).selected};if(W?.status==="draft")delete N[S5(J)];else N[S5(J)]=G;let D={selected:N,pinned:null};$.setQueryData(i2(Z,"browser-tab"),D),y6(Z,D)}}catch{v7(Z,H,G),$.invalidateQueries({queryKey:O0.views(Z)}),$.invalidateQueries({queryKey:y3.sessionSelection(Z)})}let U=V2(Z,G),Y=b1.getState();Y.setComposerDraft(U,Y.composerDrafts[U]??B)}function mn(){let $=$1(),J=l2()?"browser-tab":"shared",{workspaceId:H,layout:B}=y1(),{pinnedSessionId:Q}=x6(),X=t4(H).data,z=er(H),G=$a(H),U=Za(H),Y=Ja(H);return{create:()=>z.mutateAsync(),save:(N,D)=>G.mutateAsync({viewId:N,requirements:D}),submit:async(N,D)=>{let A=D.trim(),V=Q??F2(S5(N.id)),L=Q??crypto.randomUUID(),O=QN(H,V);if(!A&&O.length===0)return;if(!Q)XN({tabId:S5(N.id),queryClient:$,workspaceId:H,sessionId:L,text:A,filenames:O.map((I)=>I.label)});if(!Q)v7(H,V,L),lB($,H,L,S5(N.id),J);let M=GN({queryClient:$,workspaceId:H,sessionId:L,text:A},O),_=$.getQueryData(O0.session(H,L))?.config,{model:w,effort:C,fastMode:b,stream:T}=zN(X,_?.model??B.selectedModel,_?.effort??B.selectedEffort,_?.fastMode??B.selectedFastMode);$.setQueryData(O0.views(H),(I)=>I?.map((S)=>S.id===N.id&&S.status==="draft"?{...S,status:"starting",requirements:A,executionSessionId:L}:S));try{let I=await U.mutateAsync({viewId:N.id,sessionId:L,requirements:A,optimisticId:M.optimisticId,selectedSessionScope:J,...O.length>0?{attachments:M.attachments}:{},model:w,effort:C,fastMode:b,stream:T});if(v7(H,L,I.sessionId),EU($,H,L,I.sessionId),!Q)lB($,H,I.sessionId,S5(N.id),J);UN(H,O);let S=V2(H,I.sessionId),R=b1.getState();if(R.composerDrafts[S]?.trim()===A)R.setComposerDraft(S,null)}catch(I){throw await gn($,H,N.id,L,A,!!Q,J),I}},discard:(N)=>Y.mutateAsync(N)}}var f7=P(m(),1);function un({workspaceId:$,pendingViews:Z,onSave:J}){let H=f7.useRef(new Set),B=f7.useRef(new Map),Q=N5(Z),X=N5(J),z=f7.useCallback((G)=>{clearTimeout(B.current.get(G)),B.current.delete(G),b1.getState().setComposerDraft(V2($,F2(S5(G))),null)},[$]);return f7.useEffect(()=>{for(let G of Z){let U=F2(S5(G.id)),Y=V2($,U);if(b1.getState().moveComposerDraft(U,Y),G.status!=="draft")z(G.id);else if(!H.current.has(Y)){if(H.current.add(Y),b1.getState().composerDrafts[Y]===void 0)b1.getState().setComposerDraft(Y,G.requirements)}}},[$,Z,z]),f7.useEffect(()=>{let G=B.current,U=(K)=>{if(Q.current.find((q)=>q.id===K)?.status!=="draft")return;let F=V2($,F2(S5(K))),W=b1.getState().composerDrafts[F];if(W===void 0)return;X.current(K,W).catch(()=>{a1.add({title:"Couldn’t save view description",type:"error"})})},Y=b1.subscribe((K,F)=>{for(let W of Q.current){if(W.status!=="draft")continue;let q=V2($,F2(S5(W.id))),N=K.composerDrafts[q];if(N===F.composerDrafts[q])continue;if(clearTimeout(G.get(W.id)),G.delete(W.id),N===void 0)continue;G.set(W.id,setTimeout(()=>{G.delete(W.id),U(W.id)},500))}});return()=>{Y();for(let[K,F]of G)clearTimeout(F),U(K);G.clear()}},[$,Q,X]),{clear:z}}var iH=P(m(),1);function SO($){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 pn(){let $=iH.useRef(null),[Z,J]=iH.useState(null);return iH.useLayoutEffect(()=>{let H=$.current;if(!H)return;let B=(X)=>{let z=SO("--column-w"),G=SO("--chat-min"),U=SO("--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 cn($,Z){if(Z)return{status:"disconnected"};return $??{status:"checking"}}var dn=P(c(),1);function $z({className:$,...Z}){return dn.jsx("div",{...Z,className:B0("w-full p-2 text-sm @xl:p-1 @xl:pl-3",$)})}var WZ=P(c(),1);function KN({error:$,onDismiss:Z,onRetry:J}){return WZ.jsxs($z,{role:"alert",className:"flex items-center gap-2 text-destructive",children:[WZ.jsx("span",{className:"flex-1 wrap-break-word",children:$}),J&&WZ.jsx(P0,{type:"button",variant:"ghost",size:"sm",onClick:J,children:"Retry"}),Z&&WZ.jsx(P0,{type:"button",variant:"ghost",size:"icon-sm",onClick:Z,className:"text-destructive hover:text-destructive","aria-label":"Dismiss error",children:WZ.jsx(e5,{stroke:1.75})})]})}var t2=P(c(),1);function rn({error:$,pendingAction:Z,onUpdate:J,onDismiss:H}){if(!$&&Z==="auto")return t2.jsxs($z,{role:"status",className:"flex items-center gap-1.5 text-muted-foreground",children:[t2.jsx(d5,{size:20,stroke:1.5,className:"shrink-0 animate-spin"}),t2.jsx("span",{className:"wrap-break-word",children:"Updating Moi skills…"})]});let B=Z!==null;return t2.jsxs($z,{role:$?"alert":"status",className:B0("grid grid-cols-[minmax(0,1fr)_auto] gap-x-2 gap-y-2","@xl:flex @xl:items-center",$&&"text-destructive"),children:[t2.jsxs("div",{className:"flex min-w-0 items-start gap-1.5 @xl:order-1 @xl:flex-1 @xl:items-center",children:[t2.jsx(ln,{size:20,stroke:1.5,className:"shrink-0"}),$?t2.jsx("span",{className:"wrap-break-word",children:`Update failed: ${$}`}):t2.jsx("span",{className:"wrap-break-word",children:"This workspace is using old Moi skills"})]}),t2.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:t2.jsx(e5,{stroke:1.75})}),t2.jsxs("div",{className:"col-span-2 flex flex-wrap gap-1.5 @xl:contents",children:[t2.jsxs(P0,{type:"button",variant:"default",size:"sm",onClick:()=>J("auto"),disabled:B,className:"@xl:order-2",children:[Z==="auto"&&t2.jsx(d5,{stroke:1.75,className:"animate-spin"}),Z==="auto"?"Updating…":"Auto-update"]}),t2.jsxs(P0,{type:"button",variant:"secondary",size:"sm",onClick:()=>J("once"),disabled:B,className:"@xl:order-3",children:[Z==="once"&&t2.jsx(d5,{stroke:1.75,className:"animate-spin"}),Z==="once"?"Updating…":"Update once"]})]})]})}var g7=P(m(),1);function RO($){return{workspaceId:$,phase:"idle",pendingAction:null,error:null}}function xW0($){return $.phase==="active"||$.phase==="idle"&&$.updateAvailable&&!$.autoUpdateEnabled}function hW0($){return $.updateAvailable&&$.autoUpdateEnabled&&!$.updatePending&&$.phase==="idle"}function an($){let Z=Rx($),{isPending:J,mutate:H,reset:B}=Ix($),Q=gr(),{mutate:X}=mr(),z=Q.data!==void 0,G=Q.data?.autoUpdateSkills??!1,U=g7.useCallback(()=>X({autoUpdateSkills:!0}),[X]),[Y,K]=g7.useState(()=>RO($)),F=Y.workspaceId===$?Y:RO($);g7.useEffect(()=>{K(RO($)),B()},[$,B]);let W=g7.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 g7.useEffect(()=>{if(z&&hW0({updateAvailable:q,autoUpdateEnabled:G,updatePending:J,phase:F.phase}))W("auto")},[G,F.phase,W,z,q,J]),{bannerProps:z&&xW0({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 Zz=P(c(),1);function on($,{chatError:Z,onDismissChatError:J,chatLoadError:H,onRetryChatLoad:B}){let{data:Q,error:X,refetch:z}=t4($),G=Q?.availability,{bannerProps:U}=an($),Y=cn(G,Boolean(X)),K=X?{tone:"error",content:Zz.jsx(KN,{error:"Could not check agent availability",onRetry:()=>void z()})}:void 0,F;if(H)F={tone:"error",content:Zz.jsx(KN,{error:H,onRetry:B})};else if(Z)F={tone:"error",content:Zz.jsx(KN,{error:Z,onDismiss:J})};let W=U?{tone:"default",content:Zz.jsx(rn,{...U})}:void 0;return{agentAvailability:Y,composerBanner:K??F??W,viewDraftComposerBanner:K??W}}var nn=P(m(),1);var z8=P(c(),1);function sn({onOpenTheme:$}){let{layout:Z,name:J,provider:H}=y1(),[B,Q]=nn.useState(!1);return z8.jsx(wq,{children:z8.jsxs(Q3,{children:[z8.jsxs(X3,{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:[z8.jsx(e6,{icon:B?{...Z.icon,type:"glyph",value:"dots"}:Z.icon,workspaceType:H,workspaceTheme:Z.theme,className:"size-5 rounded-sm"}),J&&z8.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:J})]}),z8.jsx(z3,{align:"start",sideOffset:6,className:"w-36",children:z8.jsxs(N7,{children:[z8.jsxs(G3,{onClick:$,children:[z8.jsx(JN,{stroke:1.75}),"Theme"]}),z8.jsxs(G3,{nativeButton:!0,render:z8.jsx(f3,{}),className:"w-full",children:[z8.jsx(u6,{stroke:1.75}),"Settings"]})]})})]})})}var vW0=dK();function $6($,Z){if($==="overview"||$==="scratchpad")return!0;let J=sZ($);return J?Z.some((H)=>H.id===J):!1}function FN($,Z){let J=$.open.filter((H)=>$6(H,Z));return J.length>0?J:vW0.open}function IO($,Z,J){if($!==void 0)return $;let H=FN(Z,J);return H.includes(Z.active)?Z.active:H[0]??"overview"}var D2=P(m(),1);var rH=P(m(),1);var tn=($)=>`moi:collab:${$}:tabs`;function fW0($,Z){try{let J=sessionStorage.getItem(tn($));return J?lK(JSON.parse(J)):Z}catch{return Z}}function gW0($,Z){try{sessionStorage.setItem(tn($),JSON.stringify(Z))}catch{}}function en(){let{workspaceId:$,layout:Z,setLayout:J}=y1(),H=l2(),B=rH.useMemo(()=>lK(Z.tabs),[Z.tabs]),[Q,X]=rH.useState(()=>H?fW0($,B):B),z=rH.useCallback((G)=>{let U=lK(G);if(H)X(U),gW0($,U);else J({tabs:U});return U},[H,J,$]);return[H?Q:B,z]}function Js($){let Z=new URLSearchParams($);Z.sort();let J=Z.toString();return J?`?${J}`:""}function kO(){return window.location.pathname+Js(window.location.search)}function yO($,Z){return $.get(Z)??`moi:/${Z}`}var $s=new Map;function Hs({views:$,onOpenChat:Z}){let J=$1(),{workspaceId:H}=y1(),[B,Q]=en(),X=D2.useRef({views:$,tabsState:B,onOpenChat:Z});D2.useLayoutEffect(()=>{X.current={views:$,tabsState:B,onOpenChat:Z}},[$,B,Z]);let z=vS(),G=D2.useRef(null),[,U]=m4(),Y=C2(),{base:K}=Y,F=`${K.replace(/\/$/,"")}/workspace/${encodeURIComponent(H)}/`,W=i7(Y).slice(F.length),q=Js(Pz(Y)),N=D2.useMemo(()=>{let S=new URLSearchParams(q);return Object.fromEntries(Array.from(S.keys(),(R)=>[R,S.get(R)]))},[q]),D=D2.useMemo(()=>{let S=$s.get(H);if(!S)$s.set(H,S=new Map);return S},[H]),A=N$(W),V=W==="chat"||W==="chats"||W.startsWith("chats/"),L=IO(A,B,$),O=Boolean(W)&&!V&&(!A||!$6(A,$)),M=A!==void 0&&!O,_=D2.useCallback((S)=>{X.current={...X.current,tabsState:Q(S)}},[X,Q]),w=D2.useCallback(()=>{let S=N$(window.location.pathname.slice(F.length)),{tabsState:R,views:j}=X.current,y=S??IO(void 0,R,j),k=S?`moi:/${y}${window.location.search}`:yO(D,y);return{tab:y,href:k}},[X,F,D]),C=D2.useCallback(async(S,{replace:R=!1}={},j=new AbortController)=>{let y=V8(S,{workspaceId:H,base:K});if(G.current?.controller.abort(),!y.startsWith(F)){G.current=null,j.signal.throwIfAborted(),window.location.assign(y);return}G.current={controller:j,address:kO()};let k=(x)=>{if(j.signal.throwIfAborted(),G.current=null,kO()!==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,j.signal);if(k(V8(l,{workspaceId:H,base:K})),r)X.current.onOpenChat();return}if(!d9(x))throw Error("This destination is unavailable in this workspace");let v=O0.views(H),f=J.getQueryData(v)??X.current.views;if(!$6(x,f))await J.refetchQueries({queryKey:v,exact:!0},{throwOnError:!0}),f=J.getQueryData(v)??X.current.views;if(!$6(x,f))throw Error("This destination is unavailable in this workspace");k(y)}finally{if(G.current?.controller===j)G.current=null}},[K,w,X,F,J,z,U,H]);D2.useEffect(()=>{let S=G.current;if(S&&S.address!==kO())S.controller.abort()},[W,q,H]),D2.useEffect(()=>()=>G.current?.controller.abort(),[]);let b=D2.useCallback((S)=>{if(S instanceof Error&&S.name==="AbortError")return;let R=S instanceof Error?S.message:"Navigation failed";a1.add({type:"error",title:"Could not navigate",description:R}),W8(H,{source:"runtime",message:R})},[H]),T=D2.useCallback((S,R={})=>{C(yO(D,S),R).catch(b)},[C,D,b]);mK(H,"navigate",(S)=>{C(S).catch(b)}),Zs(H,C),D2.useEffect(()=>{if(W&&!V)return;let S=yO(D,L);if(V)try{S=V8(`moi:/${W}`)}catch{}let R=new AbortController;return C(S,{replace:!0},R).catch((j)=>{if(!R.signal.aborted)b(j)}),()=>R.abort()},[L,V,C,W,D,b,q]),D2.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 I=D2.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 j=new URL(R.href);if(j.origin!==window.location.origin||!j.pathname.startsWith(F))return;if(j.hash)return;S.preventDefault(),C(`moi:/${j.pathname.slice(F.length)}${j.search}`).catch(b)},[C,F,b]);return{tabsState:B,activeTab:L,appletParams:N,navigateToTab:T,setTabs:_,isUnavailable:O,onNavigationClick:I}}var f5=P(c(),1),mW0=qJ([z9({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 uW0({items:$}){return f5.jsxs(Q3,{children:[f5.jsx(X3,{render:f5.jsx(P0,{type:"button",variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":"Create tab",children:f5.jsx(a2,{stroke:1.75})})}),f5.jsx(z3,{align:"start",className:"min-w-48",children:f5.jsx(N7,{children:$.map((Z)=>f5.jsxs(G3,{onClick:Z.onClick,className:"font-medium",children:[f5.jsx(Z.Icon,{stroke:2}),Z.label]},Z.key))})})]})}function Bs($){let{tab:Z,active:J}=$,H=$.preview===!0;return f5.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:mW0({active:J,dragging:$.preview?!1:$.state.isDragging,preview:H}),...$.preview?{}:$.state.dragHandleProps,children:[f5.jsxs("div",{className:B0("flex items-center gap-1 overflow-hidden select-none",Z.closable&&"group-hover/tab:mr-3"),children:[Z.loading?f5.jsx(r2,{"data-icon":"inline-start",className:"shrink-0"}):f5.jsx(Z.Icon,{"data-icon":"inline-start",stroke:2,className:"size-4 shrink-0"}),f5.jsx("span",{className:B0("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&&f5.jsx("div",{"aria-label":`Close ${Z.label}`,tabIndex:H?-1:void 0,className:B0("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:f5.jsx(e5,{stroke:1.75,className:"size-4 shrink-0"})})]})}function Qs({tabs:$,active:Z,createItems:J,onSelect:H,onClose:B,onReorder:Q}){return f5.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1",children:[f5.jsx("div",{className:"no-scrollbar min-w-0 scroll-fade-x overflow-x-auto overflow-y-hidden [--scroll-fade-reveal:16px]",children:f5.jsx(VK,{items:$,getId:(X)=>X.key,isItemDragDisabled:(X)=>X.reorderable===!1,className:"flex w-max items-center gap-1",onReorder:(X)=>Q(X),renderPlaceholder:()=>f5.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-md bg-muted"}),renderOverlay:(X)=>f5.jsx(Bs,{tab:X,active:Z===X.key,preview:!0}),renderItem:(X,z)=>f5.jsx(Bs,{tab:X,active:Z===X.key,state:z,onSelect:H,onClose:B})})}),f5.jsx("div",{className:"shrink-0",children:f5.jsx(uW0,{items:J})})]})}var c7=P(m(),1);var tH=P(c(),1),R1=P(m(),1);function pW0($,Z){let J=getComputedStyle($),H=parseFloat(J.fontSize);return Z*H}function cW0($,Z){let J=getComputedStyle($.ownerDocument.documentElement),H=parseFloat(J.fontSize);return Z*H}function dW0($){return $/100*window.innerHeight}function lW0($){return $/100*window.innerWidth}function iW0($){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 Jz({groupSize:$,panelElement:Z,styleProp:J}){let H,[B,Q]=iW0(J);switch(Q){case"%":{H=B/100*$;break}case"px":{H=B;break}case"rem":{H=cW0(Z,B);break}case"em":{H=pW0(Z,B);break}case"vh":{H=dW0(B);break}case"vw":{H=lW0(B);break}}return H}function g4($){return parseFloat($.toFixed(3))}function eH({group:$}){let{orientation:Z,panels:J}=$;return J.reduce((H,B)=>(H+=Z==="horizontal"?B.element.offsetWidth:B.element.offsetHeight,H),0)}function hO($){let{panels:Z}=$,J=eH({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=Jz({groupSize:J,panelElement:B,styleProp:Q.collapsedSize});X=g4(Y/J*100)}let z;if(Q.defaultSize!==void 0){let Y=Jz({groupSize:J,panelElement:B,styleProp:Q.defaultSize});z=g4(Y/J*100)}let G=0;if(Q.minSize!==void 0){let Y=Jz({groupSize:J,panelElement:B,styleProp:Q.minSize});G=g4(Y/J*100)}let U=100;if(Q.maxSize!==void 0){let Y=Jz({groupSize:J,panelElement:B,styleProp:Q.maxSize});U=g4(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 E5($,Z="Assertion error"){if(!$)throw Error(Z)}function vO($,Z){return Array.from(Z).sort($==="horizontal"?rW0:aW0)}function rW0($,Z){let J=$.element.offsetLeft-Z.element.offsetLeft;return J!==0?J:$.element.offsetWidth-Z.element.offsetWidth}function aW0($,Z){let J=$.element.offsetTop-Z.element.offsetTop;return J!==0?J:$.element.offsetHeight-Z.element.offsetHeight}function Os($){return $!==null&&typeof $=="object"&&"nodeType"in $&&$.nodeType===Node.ELEMENT_NODE}function js($,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 oW0({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}=js(H,X),U=$==="horizontal"?z:G;U<Q&&(Q=U,B=X)}return E5(B,"No rect found"),B}var WN;function nW0(){return WN===void 0&&(typeof matchMedia=="function"?WN=!!matchMedia("(pointer:coarse)").matches:WN=!1),WN}function Ts($){let{element:Z,orientation:J,panels:H,separators:B}=$,Q=vO(J,Array.from(Z.children).filter(Os).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 O=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=[O,M];break}case 1:{let _=W[0],w=oW0({orientation:J,rects:[A,V],targetRect:_.element.getBoundingClientRect()});L=[_,w===A?M:O];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 O of L){let M="width"in O?O:O.element.getBoundingClientRect(),_=nW0()?$.resizeTargetMinimumSize.coarse:$.resizeTargetMinimumSize.fine;if(M.width<_){let C=_-M.width;M=new DOMRect(M.x-C/2,M.y,M.width+C,M.height)}if(M.height<_){let C=_-M.height;M=new DOMRect(M.x,M.y-C/2,M.width,M.height+C)}let w=q<=U||q>Y;!z&&!w&&X.push({group:$,groupSize:eH({group:$}),panels:[F,D],separator:"width"in O?void 0:O,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 fO{#$={};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 nH={cursorFlags:0,state:"inactive"},gO=new fO;function NZ(){return nH}function sW0($){return gO.addListener("change",$)}function tW0($){let Z=nH,J={...nH};J.cursorFlags=$,nH=J,gO.emit("change",{prev:Z,next:J})}function sH($){let Z=nH;nH=$,gO.emit("change",{prev:Z,next:$})}var eW0=($)=>$,xO=()=>{},Cs=1,Es=2,bs=4,ws=8,Xs=3,zs=12,qN;function Gs(){return qN===void 0&&(qN=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(qN=!0)),qN}function $q0({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($&&Gs()){let Q=($&Cs)!==0,X=($&Es)!==0,z=($&bs)!==0,G=($&ws)!==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 Gs()?H>0&&B>0?"move":H>0?"ew-resize":"ns-resize":H>0&&B>0?"grab":H>0?"col-resize":"row-resize"}}var Us=new WeakMap;function mO($){if(!$.defaultView||!$.adoptedStyleSheets)return;let{prevStyle:Z,styleSheet:J}=Us.get($)??{};J===void 0&&(J=new $.defaultView.CSSStyleSheet,$.adoptedStyleSheets&&(Object.isExtensible($.adoptedStyleSheets)?$.adoptedStyleSheets.push(J):$.adoptedStyleSheets=[...$.adoptedStyleSheets,J]));let H=NZ();switch(H.state){case"active":case"hover":{let B=$q0({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}}Us.set($,{prevStyle:Z,styleSheet:J})}var V3=new Map,Ss=new fO;function Zq0($){V3=new Map(V3),V3.delete($)}function Ys($,Z){for(let[J]of V3)if(J.id===$)return J}function m7($,Z){for(let[J,H]of V3)if(J.id===$)return H;if(Z)throw Error(`Could not find data for Group with id ${$}`)}function u7(){return V3}function uO($,Z){return Ss.addListener("groupChange",(J)=>{J.group.id===$&&Z(J)})}function Z6($,Z,J){let H=V3.get($);V3=new Map(V3),V3.set($,Z),Ss.emit("groupChange",{group:$,isUserInteraction:J?.isUserInteraction===!0,prev:H,next:Z})}function Rs($){let Z=NZ(),J=u7(),H=!1;switch(Z.state){case"active":sH({cursorFlags:0,state:"inactive"}),Z.hitRegions.length>0&&(mO($),H=!0,Z.hitRegions.forEach((B)=>{if(!J.has(B.group))return;let Q=m7(B.group.id,!0);Z6(B.group,Q,{isUserInteraction:!0})}))}return H}function Ks($){$.defaultPrevented||Rs($.currentTarget)}function Jq0($,Z,J){let H,B={x:1/0,y:1/0};for(let Q of Z){let X=js(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 Hq0($){return $!==null&&typeof $=="object"&&"nodeType"in $&&$.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function Bq0($,Z){if($===Z)throw Error("Cannot compare node with itself");let J={a:qs($),b:qs(Z)},H;for(;J.a.at(-1)===J.b.at(-1);)H=J.a.pop(),J.b.pop();E5(H,"Stacking order can only be calculated for elements with a common ancestor");let B={a:Ws(Fs(J.a)),b:Ws(Fs(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 Qq0=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Xq0($){let Z=getComputedStyle(Is($)??$).display;return Z==="flex"||Z==="inline-flex"}function zq0($){let Z=getComputedStyle($);return!!(Z.position==="fixed"||Z.zIndex!=="auto"&&(Z.position!=="static"||Xq0($))||+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"||Qq0.test(Z.willChange)||Z.webkitOverflowScrolling==="touch")}function Fs($){let Z=$.length;for(;Z--;){let J=$[Z];if(E5(J,"Missing node"),zq0(J))return J}return null}function Ws($){return $&&Number(getComputedStyle($).zIndex)||0}function qs($){let Z=[];for(;$;)Z.push($),$=Is($);return Z}function Is($){let{parentNode:Z}=$;return Hq0(Z)?Z.host:Z}function Gq0($,Z){return $.x<Z.x+Z.width&&$.x+$.width>Z.x&&$.y<Z.y+Z.height&&$.y+$.height>Z.y}function Uq0({groupElement:$,hitRegion:Z,pointerEventTarget:J}){if(!Os(J)||J.contains($)||$.contains(J))return!0;if(Bq0(J,$)>0){let H=J;for(;H;){if(H.contains($))return!0;if(Gq0(H.getBoundingClientRect(),Z))return!1;H=H.parentElement}}return!0}function pO($,Z){let J=[];return Z.forEach((H,B)=>{if(B.disabled)return;let Q=Ts(B),X=Jq0(B.orientation,Q,{x:$.clientX,y:$.clientY});X&&X.distance.x<=0&&X.distance.y<=0&&Uq0({groupElement:B.element,hitRegion:X.hitRegion.rect,pointerEventTarget:$.target})&&J.push(X.hitRegion)}),J}function Yq0($,Z){if($.length!==Z.length)return!1;for(let J=0;J<$.length;J++)if($[J]!=Z[J])return!1;return!0}function T4($,Z,J=0){return Math.abs(g4($)-g4(Z))<=J}function D3($,Z){return T4($,Z)?0:$>Z?1:-1}function oH({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(D3(H,G)<0)if(Q){let U=(B+G)/2;D3(H,U)<0?H=B:H=G}else H=G;return H=Math.min(z,H),H=g4(H),H}function Bz({delta:$,initialLayout:Z,panelConstraints:J,pivotIndices:H,prevLayout:B,trigger:Q}){if(T4($,0))return Z;let X=Q==="imperative-api",z=Object.values(Z),G=Object.values(B),U=[...z],[Y,K]=H;E5(Y!=null,"Invalid first pivot index"),E5(K!=null,"Invalid second pivot index");let F=0;switch(Q){case"keyboard":{{let N=$<0?K:Y,D=J[N];E5(D,`Panel constraints not found for index ${N}`);let{collapsedSize:A=0,collapsible:V,minSize:L=0}=D;if(V){let O=z[N];if(E5(O!=null,`Previous layout not found for panel index ${N}`),T4(O,A)){let M=L-O;D3(M,Math.abs($))>0&&($=$<0?0-M:M)}}}{let N=$<0?Y:K,D=J[N];E5(D,`No panel constraints found for index ${N}`);let{collapsedSize:A=0,collapsible:V,minSize:L=0}=D;if(V){let O=z[N];if(E5(O!=null,`Previous layout not found for panel index ${N}`),T4(O,L)){let M=O-A;D3(M,Math.abs($))>0&&($=$<0?0-M:M)}}}break}default:{let N=$<0?K:Y,D=J[N];E5(D,`Panel constraints not found for index ${N}`);let A=z[N],{collapsible:V,collapsedSize:L,minSize:O}=D;if(V&&D3(A,O)<0)if($>0){let M=O-L,_=M/2,w=A+$;D3(w,O)<0&&($=D3($,_)<=0?0:M)}else{let M=O-L,_=100-M/2,w=A-$;D3(w,O)<0&&($=D3(100+$,_)>0?0:-M)}break}}{let N=$<0?1:-1,D=$<0?K:Y,A=0;for(;;){let L=z[D];E5(L!=null,`Previous layout not found for panel index ${D}`);let O=oH({overrideDisabledPanels:X,panelConstraints:J[D],prevSize:L,size:100})-L;if(A+=O,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];E5(A!=null,`Previous layout not found for panel index ${N}`);let V=A-D,L=oH({overrideDisabledPanels:X,panelConstraints:J[N],prevSize:A,size:V});if(!T4(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(Yq0(G,U))return B;{let N=$<0?K:Y,D=z[N];E5(D!=null,`Previous layout not found for panel index ${N}`);let A=D+F,V=oH({overrideDisabledPanels:X,panelConstraints:J[N],prevSize:D,size:A});if(U[N]=V,!T4(V,A)){let L=A-V,O=$<0?K:Y;for(;O>=0&&O<J.length;){let M=U[O];E5(M!=null,`Previous layout not found for panel index ${O}`);let _=M+L,w=oH({overrideDisabledPanels:X,panelConstraints:J[O],prevSize:M,size:_});if(T4(M,w)||(L-=w-M,U[O]=w),T4(L,0))break;$>0?O--:O++}}}let W=Object.values(U).reduce((N,D)=>D+N,0);if(!T4(W,100,0.1))return B;let q=Object.keys(B);return U.reduce((N,D,A)=>(N[q[A]]=D,N),{})}function AZ($,Z){if(Object.keys($).length!==Object.keys(Z).length)return!1;for(let J in $)if(Z[J]===void 0||D3($[J],Z[J])!==0)return!1;return!0}function DZ({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(!T4(B,100)&&H.length>0)for(let z=0;z<Z.length;z++){let G=H[z];E5(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];E5(G!=null,`No layout data found for index ${z}`);let U=H[z];E5(U!=null,`No layout data found for index ${z}`);let Y=oH({overrideDisabledPanels:!0,panelConstraints:Z[z],prevSize:G,size:U});U!=Y&&(Q+=U-Y,H[z]=Y)}if(!T4(Q,0))for(let z=0;z<Z.length;z++){let G=H[z];E5(G!=null,`No layout data found for index ${z}`);let U=G+Q,Y=oH({overrideDisabledPanels:!0,panelConstraints:Z[z],prevSize:G,size:U});if(G!==Y&&(Q-=Y-G,H[z]=Y,T4(Q,0)))break}let X=Object.keys($);return H.reduce((z,G,U)=>(z[X[U]]=G,z),{})}function ks({groupId:$,panelId:Z}){let J=()=>{let G=u7();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&&T4(V.collapsedSize,Y[V.panelId])}))){let D=U.slice(0,W).reduce((A,V)=>A+Y[V.id],0);return{...Y,[Z]:g4(100-D)}}return Bz({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=DZ({layout:D,panelConstraints:K});AZ(q,A)||Z6(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&&T4(U,Y)},resize:(G)=>{let{group:U}=J(),{element:Y}=B(),K=eH({group:U}),F=Jz({groupSize:K,panelElement:Y,styleProp:G}),W=g4(F/K*100);z(W)}}}function Ns($){if($.defaultPrevented)return;let Z=u7();pO($,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=ks({groupId:J.group.id,panelId:H.id});Q&&B!==void 0&&(Q.resize(B),$.preventDefault())}}})}function NN($){let Z=u7();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 ys({groupId:$}){let Z=()=>{let J=u7();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=DZ({layout:J,panelConstraints:B});return H?z:(AZ(z,U)||Z6(Q,{defaultLayoutDeferred:H,derivedPanelConstraints:B,groupSize:X,layout:U,separatorToPanels:G}),U)}}}function qZ($,Z){let J=NN($),H=m7(J.id,!0),B=J.separators.find((Y)=>Y.element===$);E5(B,"Matching separator not found");let Q=H.separatorToPanels.get(B);E5(Q,"Matching panels not found");let X=Q.map((Y)=>J.panels.indexOf(Y)),z=ys({groupId:J.id}).getLayout(),G=Bz({delta:Z,initialLayout:z,panelConstraints:H.derivedPanelConstraints,pivotIndices:X,prevLayout:z,trigger:"keyboard"}),U=DZ({layout:G,panelConstraints:H.derivedPanelConstraints});AZ(z,U)||Z6(J,{defaultLayoutDeferred:H.defaultLayoutDeferred,derivedPanelConstraints:H.derivedPanelConstraints,groupSize:H.groupSize,layout:U,separatorToPanels:H.separatorToPanels},{isUserInteraction:!0})}function As($){if($.defaultPrevented)return;let Z=$.currentTarget,J=NN(Z);if(!J.disabled)switch($.key){case"ArrowDown":{$.preventDefault(),J.orientation==="vertical"&&qZ(Z,5);break}case"ArrowLeft":{$.preventDefault(),J.orientation==="horizontal"&&qZ(Z,-5);break}case"ArrowRight":{$.preventDefault(),J.orientation==="horizontal"&&qZ(Z,5);break}case"ArrowUp":{$.preventDefault(),J.orientation==="vertical"&&qZ(Z,-5);break}case"End":{$.preventDefault(),qZ(Z,100);break}case"Enter":{$.preventDefault();let H=NN(Z),B=m7(H.id,!0),{derivedPanelConstraints:Q,layout:X,separatorToPanels:z}=B,G=H.separators.find((F)=>F.element===Z);E5(G,"Matching separator not found");let U=z.get(G);E5(U,"Matching panels not found");let Y=U[0],K=Q.find((F)=>F.panelId===Y.id);if(E5(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;qZ(Z,W-F)}break}case"F6":{$.preventDefault();let H=NN(Z).separators.map((X)=>X.element),B=Array.from(H).findIndex((X)=>X===$.currentTarget);E5(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(),qZ(Z,-100);break}}}function Ds($){if($.defaultPrevented)return;if($.pointerType==="mouse"&&$.button>0)return;let Z=u7(),J=pO($,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)}),sH({cursorFlags:0,hitRegions:J,initialLayoutMap:H,pointerDownAtPoint:{x:$.clientX,y:$.clientY},state:"active"}),J.length&&$.preventDefault()}function xs({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:O,layout:M,separatorToPanels:_}=A;if(L&&M&&_){let w=Bz({delta:N,initialLayout:D,panelConstraints:L,pivotIndices:U.panels.map((C)=>W.indexOf(C)),prevLayout:M,trigger:"mouse-or-touch"});if(AZ(w,M)){if(N!==0&&!q)switch(F){case"horizontal":{z|=N<0?Cs:Es;break}case"vertical":{z|=N<0?bs:ws;break}}}else Z6(U.group,{defaultLayoutDeferred:V,derivedPanelConstraints:L,groupSize:O,layout:w,separatorToPanels:_})}});let G=0;Z.movementX===0?G|=X&Xs:G|=z&Xs,Z.movementY===0?G|=X&zs:G|=z&zs,tW0(G),mO($)}function Vs($){let Z=u7(),J=NZ();switch(J.state){case"active":xs({document:$.currentTarget,event:$,hitRegions:J.hitRegions,initialLayoutMap:J.initialLayoutMap,mountedGroups:Z,prevCursorFlags:J.cursorFlags})}}function Ls($){if($.defaultPrevented)return;let Z=NZ(),J=u7();switch(Z.state){case"active":{if($.buttons===0){sH({cursorFlags:0,state:"inactive"}),Z.hitRegions.forEach((H)=>{if(!J.has(H.group))return;let B=m7(H.group.id,!0);Z6(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)}xs({document:$.currentTarget,event:$,hitRegions:Z.hitRegions,initialLayoutMap:Z.initialLayoutMap,mountedGroups:J,pointerDownAtPoint:Z.pointerDownAtPoint,prevCursorFlags:Z.cursorFlags});break}default:{let H=pO($,J);H.length===0?Z.state!=="inactive"&&sH({cursorFlags:0,state:"inactive"}):sH({cursorFlags:0,hitRegions:H,state:"hover"}),mO($.currentTarget);break}}}function Ms($){if($.relatedTarget instanceof HTMLIFrameElement)switch(NZ().state){case"hover":sH({cursorFlags:0,state:"inactive"})}}function Ps($){if($.defaultPrevented)return;if($.pointerType==="mouse"&&$.button>0)return;Rs($.currentTarget)&&$.preventDefault()}function _s($){let Z=0,J=0,H={};for(let Q of $)if(Q.defaultSize!==void 0){Z++;let X=g4(Q.defaultSize);J+=X,H[Q.panelId]=X}else H[Q.panelId]=void 0;let B=$.length-Z;if(B!==0){let Q=g4((100-J)/B);for(let X of $)X.defaultSize===void 0&&(H[X.panelId]=Q)}return H}function Kq0($,Z,J){if(!J[0])return;let H=$.panels.find((G)=>G.element===Z);if(!H||!H.onResize)return;let B=eH({group:$}),Q=$.orientation==="horizontal"?H.element.offsetWidth:H.element.offsetHeight,X=H.mutableValues.prevSize,z={asPercentage:g4(Q/B*100),inPixels:Q};H.mutableValues.prevSize=z,H.onResize(z,H.id,X)}function Fq0($,Z){if(Object.keys($).length!==Object.keys(Z).length)return!1;for(let J in $)if($[J]!==Z[J])return!1;return!0}function Wq0($,Z){return $.length!==Z.length?!1:$.every((J,H)=>Fq0(J,Z[H]))}function qq0({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=g4(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]=g4(F/Q*U)}else{let K=g4(U/G.length);for(let F of G)Y[F]=K}return Y}function Nq0($,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 aH=new Map;function Aq0($){let Z=!0;E5($.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=eH({group:$});if(V===0)return;let L=m7($.id);if(!L)return;let O=hO($),M=L.defaultLayoutDeferred?_s(O):L.layout,_=qq0({group:$,nextGroupSize:V,prevGroupSize:L.groupSize,prevLayout:M}),w=DZ({layout:_,panelConstraints:O});if(!L.defaultLayoutDeferred&&AZ(L.layout,w)&&Wq0(L.derivedPanelConstraints,O)&&L.groupSize===V)continue;Z6($,{defaultLayoutDeferred:!1,derivedPanelConstraints:O,groupSize:V,layout:w,separatorToPanels:L.separatorToPanels})}}else Kq0($,A,D)}});Q.observe($.element),$.panels.forEach((q)=>{E5(!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=eH({group:$}),z=hO($),G=$.panels.map(({id:q})=>q).join(","),U=$.mutableState.defaultLayout;U&&(Nq0($.panels,U)||(U=void 0));let Y=$.mutableState.layouts[G]??U??_s(z),K=DZ({layout:Y,panelConstraints:z}),F=$.element.ownerDocument;aH.set(F,(aH.get(F)??0)+1);let W=new Map;return Ts($).forEach((q)=>{q.separator&&W.set(q.separator,q.panels)}),Z6($,{defaultLayoutDeferred:X===0,derivedPanelConstraints:z,groupSize:X,layout:K,separatorToPanels:W}),$.separators.forEach((q)=>{E5(!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",As)}),aH.get(F)===1&&(F.addEventListener("contextmenu",Ks,!0),F.addEventListener("dblclick",Ns,!0),F.addEventListener("pointerdown",Ds,!0),F.addEventListener("pointerleave",Vs),F.addEventListener("pointermove",Ls),F.addEventListener("pointerout",Ms),F.addEventListener("pointerup",Ps,!0)),function(){Z=!1,aH.set(F,Math.max(0,(aH.get(F)??0)-1)),Zq0($),$.separators.forEach((q)=>{q.element.removeEventListener("keydown",As)}),aH.get(F)||(F.removeEventListener("contextmenu",Ks,!0),F.removeEventListener("dblclick",Ns,!0),F.removeEventListener("pointerdown",Ds,!0),F.removeEventListener("pointerleave",Vs),F.removeEventListener("pointermove",Ls),F.removeEventListener("pointerout",Ms),F.removeEventListener("pointerup",Ps,!0)),Q.disconnect()}}function Dq0(){let[$,Z]=R1.useState({}),J=R1.useCallback(()=>Z({}),[]);return[$,J]}function cO($){let Z=R1.useId();return`${$??Z}`}var VZ=typeof window<"u"?R1.useLayoutEffect:R1.useEffect;function Hz($){let Z=R1.useRef($);return VZ(()=>{Z.current=$},[$]),R1.useCallback((...J)=>Z.current?.(...J),[Z])}function dO(...$){return Hz((Z)=>{$.forEach((J)=>{if(J)switch(typeof J){case"function":{J(Z);break}case"object":{J.current=Z;break}}})})}function lO($){let Z=R1.useRef({...$});return VZ(()=>{for(let J in $)Z.current[J]=$[J]},[$]),Z.current}var hs=R1.createContext(null);function Vq0($,Z){let J=R1.useRef({getLayout:()=>({}),setLayout:eW0});R1.useImperativeHandle(Z,()=>J.current,[]),VZ(()=>{Object.assign(J.current,ys({groupId:$}))})}function iO({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=Hz((I)=>{AZ(q.current.onLayoutChange,I)||(q.current.onLayoutChange=I,G?.(I))}),D=Hz((I,S)=>{AZ(q.current.onLayoutChanged,I)||(q.current.onLayoutChanged=I,U?.(I,{isUserInteraction:S}))}),A=cO(z),V=R1.useRef(null),[L,O]=Dq0(),M=R1.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:K,separators:[]}),_=dO(V,Q);Vq0(A,X);let w=Hz((I,S)=>{let R=NZ(),j=Ys(I),y=m7(I);if(y){let k=!1;switch(R.state){case"active":{k=R.hitRegions.some((x)=>x.group===j);break}}return{flexGrow:y.layout[S]??1,pointerEvents:k?"none":void 0}}if(J?.[S])return{flexGrow:J?.[S]}}),C=lO({defaultLayout:J,disableCursor:H}),b=R1.useMemo(()=>({get disableCursor(){return!!C.disableCursor},getPanelStyles:w,id:A,orientation:Y,registerPanel:(I)=>{let S=M.current;return S.panels=vO(Y,[...S.panels,I]),O(),()=>{S.panels=S.panels.filter((R)=>R!==I),O()}},registerSeparator:(I)=>{let S=M.current;return S.separators=vO(Y,[...S.separators,I]),O(),()=>{S.separators=S.separators.filter((R)=>R!==I),O()}},updatePanelProps:(I,{disabled:S})=>{let R=M.current.panels.find((k)=>k.id===I);R&&(R.panelConstraints.disabled=S);let j=Ys(A),y=m7(A);j&&y&&Z6(j,{...y,derivedPanelConstraints:hO(j)})},updateSeparatorProps:(I,{disabled:S,disableDoubleClick:R})=>{let j=M.current.separators.find((y)=>y.id===I);j&&(j.disabled=S,j.disableDoubleClick=R)}}),[w,A,O,Y,C]),T=R1.useRef(null);return VZ(()=>{let I=V.current;if(I===null)return;let S=M.current,R;if(C.defaultLayout!==void 0&&Object.keys(C.defaultLayout).length===S.panels.length){R={};for(let E of S.panels){let l=C.defaultLayout[E.id];l!==void 0&&(R[E.id]=l)}}let j={disabled:!!B,element:I,id:A,mutableState:{defaultLayout:R,disableCursor:!!C.disableCursor,expandedPanelSizes:M.current.lastExpandedPanelSizes,layouts:M.current.layouts},orientation:Y,panels:S.panels,resizeTargetMinimumSize:S.resizeTargetMinimumSize,separators:S.separators};T.current=j;let y=Aq0(j),{defaultLayoutDeferred:k,derivedPanelConstraints:x,layout:v}=m7(j.id,!0);!k&&x.length>0&&(N(v),D(v,!1));let f=uO(A,(E)=>{let{defaultLayoutDeferred:l,derivedPanelConstraints:r,layout:h}=E.next;if(l||r.length===0)return;let d=j.panels.map(({id:p})=>p).join(",");j.mutableState.layouts[d]=h,r.forEach((p)=>{if(p.collapsible){let{layout:i}=E.prev??{};if(i){let n=T4(p.collapsedSize,h[p.panelId]),Z0=T4(p.collapsedSize,i[p.panelId]);n&&!Z0&&(j.mutableState.expandedPanelSizes[p.panelId]=i[p.panelId])}}});let o=NZ().state!=="active";N(h),o&&D(h,E.isUserInteraction)});return()=>{T.current=null,y(),f()}},[B,A,D,N,Y,L,C]),R1.useEffect(()=>{let I=T.current;I&&(I.mutableState.defaultLayout=J,I.mutableState.disableCursor=!!H)}),tH.jsx(hs.Provider,{value:b,children:tH.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:$})})}iO.displayName="Group";function rO(){let $=R1.useContext(hs);return E5($,"Group Context not found; did you render a Panel or Separator outside of a Group?"),$}function Lq0($,Z){let{id:J}=rO(),H=R1.useRef({collapse:xO,expand:xO,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:xO});R1.useImperativeHandle(Z,()=>H.current,[]),VZ(()=>{Object.assign(H.current,ks({groupId:J,panelId:$}))})}function aO({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=cO(G),A=lO({disabled:Q}),V=R1.useRef(null),L=dO(V,X),{getPanelStyles:O,id:M,orientation:_,registerPanel:w,updatePanelProps:C}=rO(),b=K!==null,T=Hz((j,y,k)=>{K?.(j,G,k)});VZ(()=>{let j=V.current;if(j!==null){let y={element:j,id:D,idIsStable:N,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:b?T: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,T,w,A]),R1.useEffect(()=>{C(D,{disabled:Q})},[Q,D,C]),Lq0(D,F);let I=()=>{let j=O(M,D);if(j)return JSON.stringify(j)},S=R1.useSyncExternalStore((j)=>uO(M,j),I,I),R;return S?R=JSON.parse(S):B!==void 0?R={flexGrow:void 0,flexShrink:void 0,flexBasis:B}:R={flexGrow:1},tH.jsx("div",{...q,"data-disabled":Q||void 0,"data-panel":!0,"data-testid":D,id:D,ref:L,style:{...Mq0,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...R},children:tH.jsx("div",{className:Z,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...W,touchAction:_==="horizontal"?"pan-y":"pan-x"},children:$})})}aO.displayName="Panel";var Mq0={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function Pq0({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=DZ({layout:Bz({delta:U-X,initialLayout:$,panelConstraints:Z,pivotIndices:Y,prevLayout:$}),panelConstraints:Z})[J],B=DZ({layout:Bz({delta:G-X,initialLayout:$,panelConstraints:Z,pivotIndices:Y,prevLayout:$}),panelConstraints:Z})[J]}return{valueControls:J,valueMax:B,valueMin:Q,valueNow:X}}function oO({children:$,className:Z,disabled:J,disableDoubleClick:H,elementRef:B,id:Q,style:X,...z}){let G=cO(Q),U=lO({disabled:J,disableDoubleClick:H}),[Y,K]=R1.useState({}),[F,W]=R1.useState("inactive"),[q,N]=R1.useState(!1),D=R1.useRef(null),A=dO(D,B),{disableCursor:V,id:L,orientation:O,registerSeparator:M,updateSeparatorProps:_}=rO(),w=O==="horizontal"?"vertical":"horizontal";VZ(()=>{let T=D.current;if(T!==null){let I={disabled:U.disabled,disableDoubleClick:U.disableDoubleClick,element:T,id:G},S=M(I),R=sW0((y)=>{W(y.next.state!=="inactive"&&y.next.hitRegions.some((k)=>k.separator===I)?y.next.state:"inactive")}),j=uO(L,(y)=>{let{derivedPanelConstraints:k,layout:x,separatorToPanels:v}=y.next,f=v.get(I);if(f){let E=f[0],l=k.findIndex((r)=>r.panelId===E.id);K(Pq0({layout:x,panelConstraints:k,panelId:E.id,panelIndex:l}))}});return()=>{R(),j(),S()}}},[L,G,M,U]),R1.useEffect(()=>{_(G,{disabled:J,disableDoubleClick:H})},[J,H,G,_]);let C;J&&!V&&(C="not-allowed");let b;if(J)b="disabled";else switch(F){case"active":{b="active";break}default:q?b="focus":b=F}return tH.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:C,...X,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:J?void 0:0})}oO.displayName="Separator";var AN=P(c(),1);function vs({className:$,...Z}){return AN.jsx(iO,{"data-slot":"resizable-panel-group",className:r0("flex h-full w-full aria-[orientation=vertical]:flex-col",$),...Z})}function nO({...$}){return AN.jsx(aO,{"data-slot":"resizable-panel",...$})}function fs({showDivider:$=!0,className:Z,...J}){return AN.jsx(oO,{"data-slot":"resizable-handle",className:r0("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 p7=P(c(),1);function gs({workspace:$,chat:Z,open:J,workspaceMinWidth:H,chatMinWidth:B,chatMaxWidth:Q,chatWidth:X,onCollapse:z,onChatWidthChange:G}){let U=c7.useRef(null),Y=c7.useRef(null),[K,F]=c7.useState(!1),W=Math.min(Math.max(X,B),Q),[q]=c7.useState(()=>J?W:0);return c7.useLayoutEffect(()=>{let N=U.current;if(!N)return;if(J)N.resize(W);else N.collapse()},[W,J]),p7.jsxs(vs,{orientation:"horizontal",className:B0("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:[p7.jsx(nO,{id:"workspace",className:"overflow-visible!",minSize:H,children:p7.jsx("div",{"data-slot":"workspace-split-workspace",className:"flex h-full min-h-0 min-w-0 flex-col",children:$})}),p7.jsx(fs,{"aria-label":"Resize chat",showDivider:!1,hidden:!J,disabled:!J}),p7.jsx(nO,{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:B0("overflow-hidden!",K&&"transition-opacity duration-200 ease-in-out motion-reduce:transition-none",J?"opacity-100":"opacity-0"),children:p7.jsx("div",{"data-slot":"workspace-split-chat",className:"flex h-full min-h-0 min-w-(--chat-min) flex-col",children:Z})})]})}var LZ=P(c(),1);function ms({onOpenOverview:$}){return LZ.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 p-6 text-center",children:[LZ.jsxs("div",{className:"flex flex-col items-center justify-center gap-2",children:[LZ.jsx(cF,{size:56,stroke:0.5,"aria-hidden":!0}),LZ.jsx("p",{className:"text-sm",children:"There's no such page in this workspace"})]}),LZ.jsx(P0,{variant:"secondary",onClick:$,children:"Back to overview"})]})}var Y5=P(c(),1),Oq0=e2.lazy(()=>import("/chunk-q0gbdts4.js").then(($)=>({default:$.Scratchpad})));function us($,Z,J,H){if($==="overview")return{key:$,Icon:dF,label:"Overview",closable:!1,reorderable:!1};if($==="scratchpad")return{key:$,Icon:nQ,label:"Scratchpad",closable:J};let B=sZ($),Q=B?Z.find((X)=>X.id===B):null;return Q?{key:$,Icon:vX(Q),label:hX(Q),closable:J||Q.status!=="compiled",loading:Q.status!=="compiled"&&!!Q.executionSessionId&&H(Q.executionSessionId)}:null}function ds({widgets:$,views:Z}){let{layout:J,setLayout:H,workspaceId:B}=y1(),Q=U9(J.theme),X=mn(),{ref:z,fits:G,constraints:U}=pn(),[Y,K]=e2.useState("idle"),[F,W]=e2.useState(!1),[q,N]=e2.useState(0),D=e2.useRef(new Map),A=b1((q0)=>q0.dockedChatWidth),V=b1((q0)=>q0.setDockedChatWidth),L=G4((q0)=>q0.activity),O=Z.filter((q0)=>q0.status==="compiled"),M=Z.filter((q0)=>q0.status!=="compiled"),_=dG(L,B),w=un({workspaceId:B,pendingViews:M,onSave:(q0,h0)=>X.save(q0,h0)}),C=$.some((q0)=>!H3(q0.id)),b=C||O.length>0,I=J.layoutMode==="split"&&G?"split":"fullscreen",S=e2.useCallback(()=>{W(!0),N((q0)=>q0+1)},[]),{tabsState:R,activeTab:j,appletParams:y,navigateToTab:k,setTabs:x,isUnavailable:v,onNavigationClick:f}=Hs({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:Q0}=wn({activeTab:j,appletParams:y}),{pinnedSessionId:N0}=x6(),{composerBanner:D0,viewDraftComposerBanner:F0,agentAvailability:s}=on(B,{chatError:i,onDismissChatError:Q0,chatLoadError:n,onRetryChatLoad:Z0}),a=FN(R,Z),e=new Set(R.open),$0=(q0)=>{H({layoutMode:q0})},X0=a.length>1,_0=a.map((q0)=>us(q0,Z,X0,(h0)=>nZ(L,B,h0))).filter((q0)=>Boolean(q0)),M0=sZ(j),A0=M0?O.find((q0)=>q0.id===M0):void 0,L0=M0?M.find((q0)=>q0.id===M0):void 0,g=!N0&&d===null&&L0?.status==="draft"&&(!L0.executionSessionId||!nZ(L,B,L0.executionSessionId))?L0:void 0,u=g?.id,t=!N0&&L0?.status==="starting",W0=r&&!t,S0=Y==="idle"&&(j==="overview"&&C||A0!==void 0),{controls:p0,docked:f0,layerProps:T0,popup:d0,targetRef:z1}=Av({workspaceId:B,sessionId:o,activeTab:j,mode:I,available:S0,closePopup:()=>W(!1),openPopup:()=>W(!0)});e2.useEffect(()=>{if(R.open.filter((U1)=>$6(U1,Z)).length===R.open.length)return;let h0=FN(R,Z);x({open:h0,active:h0.includes(R.active)?R.active:h0[0]})},[Z,x,R]),e2.useEffect(()=>{if(I!=="fullscreen")W(!1)},[I]),e2.useEffect(()=>{if(!u)return;if(I==="fullscreen")W(!0);N((q0)=>q0+1)},[u,I]);let e0=k,c0=()=>{X.create().then((q0)=>e0(S5(q0.id)))},y0=(q0)=>{if(q0==="views"){let h0=O[0];if(h0)e0(S5(h0.id));else c0()}else e0(q0);W(!1)};L2((q0)=>{if(q0.type==="view:deleted"&&q0.workspaceId===B&&j===S5(q0.name))e0("overview")});let E1=async(q0)=>{let h0=D.current.get(q0.id);try{await X.discard(q0.id)}catch(U1){return a1.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=sZ(q0),U1=h0?M.find((T1)=>T1.id===h0):void 0;if(!X0&&!U1||!e.has(q0))return;let I0=R.open.filter((T1)=>T1!==q0);if(I0.length===0)I0=["overview"];let i0=a.indexOf(q0),l0=a[i0+1]??a[i0-1]??I0.find((T1)=>$6(T1,Z))??"overview",L1=R.active===q0||!I0.includes(R.active)?l0:R.active;if(x({open:I0,active:L1}),j===q0)k(l0);if(U1?.status==="draft")E1(U1)},z5=async(q0)=>{if(!await E1(q0))return;let h0=S5(q0.id);if(!e.has(h0))return;let U1=R.open.filter((l0)=>l0!==h0);if(U1.length===0)U1=["overview"];let I0=U1.find((l0)=>$6(l0,Z))??"overview",i0=R.active===h0?I0:R.active;if(x({open:U1,active:i0}),j===h0)k(I0,{replace:!0})},C0=(q0)=>{x({open:q0,active:R.active})},x0=(q0)=>{if(q0!==void 0)b1.getState().setComposerDraft(V2(B,o),q0);if(I==="fullscreen"){if(W(!0),F)N((h0)=>h0+1);return}N((h0)=>h0+1)};Pn({sessionId:d,send:J0,revealChat:x0,agentAvailability:s}),_n(o,x0);let a0=[...!e.has("scratchpad")?[{key:"scratchpad",Icon:nQ,label:"Scratchpad",onClick:()=>e0("scratchpad")}]:[],...Z.map((q0)=>({view:q0,tab:S5(q0.id)})).filter(({tab:q0})=>!e.has(q0)).map(({view:q0,tab:h0})=>({key:h0,Icon:vX(q0),label:hX(q0),onClick:()=>e0(h0)})),{key:"create-view",Icon:ps,label:"New view",onClick:c0}],n0=e2.useCallback(()=>{if(g)D.current.get(g.id)?.resetSketch()},[g]),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=g?{sessionId:F2(S5(g.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:g?F0:D0,agentAvailability:s,send:D1,stop:U0,onNavigateFromWelcome:y0,viewDraft:V1},Z5=Y5.jsx(M_,{...p1,active:I==="split",onClose:()=>$0("fullscreen"),annotation:f0,docked:!0}),m0=Y5.jsxs("div",{className:B0("@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",I==="split"&&"rounded-xl"),children:[Y5.jsxs("div",{className:"relative flex min-h-0 flex-1",children:[Y5.jsxs("div",{ref:z1,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?Y5.jsx(ms,{onOpenOverview:()=>e0("overview")}):j==="overview"?Y5.jsx(Fn,{customizing:Y==="customizing",theming:Y==="theming",onThemingChange:(q0)=>K(q0?"theming":"idle"),onCustomizingChange:(q0)=>K(q0?"customizing":"idle"),widgets:$,views:O,onOpenView:(q0)=>e0(S5(q0)),onCreateView:c0,onCreateWidget:()=>{z0(null),x0("Create widget")}}):j==="scratchpad"?Y5.jsx(e2.Suspense,{fallback:null,children:Y5.jsx(Oq0,{})}):null,M.map((q0)=>Y5.jsx(In,{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&&nZ(L,B,q0.executionSessionId),sketchSessionId:q0.status==="draft"?N0??F2(S5(q0.id)):void 0,chatDocked:I==="split",workspaceId:B,onEditingStart:()=>{if(I==="fullscreen")W(!1)},onContinueInChat:x0,onOpenChat:()=>x0(),onDiscard:()=>z5(q0)},q0.id)),Y5.jsx(vn,{views:O,activeViewId:v?null:A0?.id??null,params:y})]}),Y5.jsx(iK,{...T0,children:Y5.jsx(nK,{controls:p0,title:"Draw annotation",busy:p0.finishing,onComplete:()=>void p0.finish()})})]}),Y5.jsx(I4,{children:Y==="theming"&&Y5.jsx(Lr,{onClose:()=>K("idle")})}),Y5.jsxs(Wn,{children:[Y5.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-4",children:[Y5.jsx(sn,{onOpenTheme:()=>K("theming")}),Y5.jsx(Qs,{tabs:_0,active:j,createItems:a0,onSelect:e0,onClose:W1,onReorder:C0})]}),Y5.jsx(fD,{workspaceId:B,describeTab:(q0)=>us(q0,Z,!1,()=>!1),onOpenTab:e0}),G&&I==="fullscreen"&&Y5.jsxs(o1,{children:[Y5.jsx(n1,{render:Y5.jsx(P0,{variant:"ghost",size:"icon-sm",onClick:()=>$0("split"),"aria-label":"Dock chat",className:"text-muted-foreground",children:Y5.jsx(cs,{stroke:1.75})})}),Y5.jsx(s1,{children:"Dock chat"})]})]})]});return Y5.jsxs("div",{onClick:f,className:"relative flex h-full min-h-0 flex-col font-sans text-foreground",children:[Y5.jsx("div",{ref:z,className:"flex min-h-0 flex-1",children:G&&U?Y5.jsx(gs,{...U,workspace:m0,chat:Z5,open:I==="split",chatWidth:A,onCollapse:()=>$0("fullscreen"),onChatWidthChange:V}):m0}),I==="fullscreen"&&Y5.jsx(Vr,{agent:Q.agent,loading:_,open:F,onOpenChange:W,onOpenChangeComplete:(q0)=>{if(q0)N((h0)=>h0+1)},children:(q0)=>Y5.jsx(M_,{...p1,active:F,onClose:q0,annotation:d0})})]})}var sO=P(c(),1);function ls({children:$}){return sO.jsx("section",{"aria-label":"Workspace setup",className:"flex min-h-0 flex-1 flex-col overflow-y-auto bg-muted texture-checker-20",children:sO.jsx("div",{className:"flex flex-1 flex-col bg-radial from-background from-25% to-transparent",children:$})})}var Ut=P(m(),1);var MZ=P(m(),1);var rs=P(c(),1);function is({className:$,...Z}){return rs.jsx("textarea",{"data-slot":"textarea",className:r0("flex field-sizing-content min-h-16 w-full rounded-lg border bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 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",$),...Z})}function as($){return B1(`/api/harnesses/${$}/auth/login`,{method:"POST"},"Could not start sign-in")}function os($){return e1({queryKey:["harness-auth",$],queryFn:()=>B1(`/api/harnesses/${$}/auth`),staleTime:2000,refetchInterval:2000})}function ns($,Z,J){return U4(`/api/harnesses/${$}/auth/login/${Z}/code`,_5("POST",{code:J}))}var DN=P(m(),1);var i5=P(c(),1);function $t({code:$,url:Z}){let[J,H]=DN.useState(!1);return DN.useEffect(()=>{if(!J)return;let Q=setTimeout(()=>H(!1),3000);return()=>clearTimeout(Q)},[J]),i5.jsxs("ol",{className:"mx-auto grid w-full max-w-64 gap-6 text-left text-sm lg:max-w-3xl lg:grid-cols-3 lg:text-center",children:[i5.jsxs("li",{className:"flex flex-col items-start gap-3 lg:items-center",children:[i5.jsx(ss,{size:24,stroke:1.5,className:"shrink-0"}),i5.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-3 lg:items-center",children:[i5.jsx("p",{children:"Enable device code sign-in for Codex in ChatGPT settings"}),i5.jsxs("a",{href:"https://chatgpt.com/settings/security",target:"_blank",rel:"noopener noreferrer",className:"inline-flex h-8 flex-wrap items-center gap-1 font-semibold focus-visible:ring-3 focus-visible:ring-ring/50",children:["Settings",i5.jsx(m3,{size:16,stroke:2,"aria-hidden":"true"}),"Security and login"]})]})]}),i5.jsxs("li",{className:"flex flex-col items-start gap-3 lg:items-center",children:[i5.jsx(ts,{size:24,stroke:1.5,className:"shrink-0"}),i5.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-3 lg:items-center",children:[i5.jsx("p",{children:"Copy the one-time device code provided below"}),i5.jsxs("div",{className:"flex h-8 items-center gap-2 rounded-lg border border-input bg-accent pr-2 pl-3",children:[i5.jsx("code",{className:"cursor-text text-sm font-medium select-text",children:$}),i5.jsxs("button",{type:"button",className:"relative size-4 cursor-pointer text-muted-foreground outline-none hover:text-foreground focus-visible:text-foreground","aria-label":J?"Code copied":"Copy code",onClick:()=>{navigator.clipboard?.writeText($).then(()=>H(!0)).catch(()=>{})},children:[i5.jsx(TJ,{className:B0("absolute inset-0 transition-[opacity,filter] duration-200 motion-reduce:transition-none",J&&"opacity-0 blur-[2px]"),stroke:1.75,size:16}),i5.jsx(a4,{className:B0("absolute inset-0 transition-[opacity,filter] duration-200 motion-reduce:transition-none",!J&&"opacity-0 blur-[2px]"),stroke:1.75,size:16})]})]})]})]}),i5.jsxs("li",{className:"flex flex-col items-start gap-3 lg:items-center",children:[i5.jsx(es,{size:24,stroke:1.5,className:"shrink-0"}),i5.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-3 lg:items-center",children:[i5.jsx("p",{children:"Sign-in in browser, paste the code, and then come back to Moi"}),i5.jsx("a",{href:Z,target:"_blank",rel:"noopener noreferrer",className:z9(),children:"Open browser"})]})]})]})}var F5=P(c(),1);function Jt({type:$,reason:Z,checking:J,onRecheck:H}){let{environment:B}=o4(),Q=os($),X=$1(),[z,G]=MZ.useState(""),[U,Y]=MZ.useState(!1),K=MZ.useId(),F=S$[$],W=Q.data?.login,q=W?.state==="pending"?W:void 0,N=W?.state==="starting",D=B==="local"&&!U,A=!N&&!q&&Q.data?.availability.status==="available";MZ.useEffect(()=>{if(A)H()},[A,H]);let V=W5({mutationFn:async(M)=>{if(M==="start")Y(!1),G(""),await as($);if(M==="submit"&&q)await ns($,q.id,z),G("")},onSettled:()=>X.invalidateQueries({queryKey:["harness-auth"]})}),L=Q.isError||Q.data?.availability.status==="unavailable",O=V.error?.message??(W?.state==="failed"?W.reason:void 0);return F5.jsx("div",{className:"flex flex-1 items-center justify-center p-6",children:F5.jsxs("div",{className:"flex w-full max-w-5xl flex-col text-center",children:[F5.jsx("img",{src:t9[$],alt:"",className:"mb-4 size-10 self-center"}),F5.jsxs("h1",{className:"mb-6 text-center text-xl font-medium",children:["Log in to ",F]}),F5.jsxs("section",{className:B0("flex w-full flex-col gap-3 self-center",!q?.userCode&&"max-w-xs"),"aria-label":F,children:[Q.isPending?F5.jsx(r2,{className:"size-6 self-center text-muted-foreground",stroke:1.5}):L?F5.jsxs("div",{role:"alert",className:"flex flex-col items-start gap-2",children:[F5.jsx("p",{children:"Could not check agent login status."}),F5.jsx(P0,{variant:"secondary",disabled:Q.isFetching,onClick:()=>void Q.refetch(),children:"Try again"})]}):A?F5.jsxs("div",{role:"status",className:"flex flex-col items-center gap-4",children:[F5.jsx("p",{className:"text-sm text-muted-foreground",children:J?"Checking workspace access…":`Signed in to ${F}, but this workspace still needs attention. ${Z}`}),F5.jsx(P0,{variant:"secondary",disabled:J,onClick:H,children:"Try again"})]}):F5.jsx(F5.Fragment,{children:q?.userCode?F5.jsx($t,{code:q.userCode,url:q.url}):q?F5.jsxs(F5.Fragment,{children:[F5.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:q.codeUrl&&!D?"Sign in to get the authorization code.":"Sign in in your browser, then come back to Moi. Your workspace will open once you’re connected."}),F5.jsx("a",{className:z9({variant:"secondary"}),href:U?q.codeUrl??q.url:q.url,target:"_blank",rel:"noopener noreferrer",children:"Open browser"}),D&&q.codeUrl&&F5.jsx(P0,{variant:"ghost",onClick:()=>Y(!0),children:"Having trouble signing in?"}),!D&&q.codeUrl&&F5.jsxs("form",{className:"mt-3 flex flex-col gap-3",onSubmit:(M)=>{M.preventDefault(),V.mutate("submit")},children:[F5.jsx("label",{htmlFor:K,className:"text-sm text-muted-foreground",children:"Paste the code here:"}),F5.jsx(is,{id:K,"aria-label":"Authorization code",rows:3,className:"field-sizing-fixed resize-none",value:z,onChange:(M)=>G(M.target.value),autoComplete:"off",spellCheck:!1}),F5.jsx(P0,{type:"submit",className:"mt-3",disabled:!z.trim()||V.isPending,children:V.isPending?"Connecting…":"Continue"})]})]}):F5.jsxs(P0,{className:"self-center",disabled:V.isPending||N,onClick:()=>V.mutate("start"),children:["Continue",F5.jsx(Zt,{stroke:1.75,"data-icon":"inline-end"})]})}),O&&F5.jsx("p",{role:"alert",className:"text-sm text-destructive",children:O})]})]})})}var R5=P(c(),1);function Bt($){return R5.jsx(Gt,{title:"Could not check your agent",...$,children:"Could not check this workspace’s agent. Try again."})}function Qt({workspaceId:$}){let[,Z]=m4(),J=yU();return R5.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 p-6 text-center",children:[R5.jsx(Ht,{size:56,stroke:0.5,className:"text-muted-foreground","aria-hidden":!0}),R5.jsx("h1",{className:"font-medium",children:"The workspace folder is missing"}),R5.jsx(P0,{variant:"secondary",disabled:J.isPending,onClick:()=>J.mutate($,{onSuccess:()=>Z("/")}),children:J.isPending?"Deleting workspace…":"Delete workspace"}),J.error&&R5.jsx("p",{role:"alert",className:"text-sm text-destructive",children:J.error.message})]})}function Xt({type:$,availability:Z,...J}){if(Z.status==="unavailable"&&Z.code==="not-installed")return R5.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 p-6 text-center",children:[R5.jsx("img",{src:t9[$],alt:"",className:"size-10"}),R5.jsxs("h1",{className:"font-medium",children:[S$[$]," is uninstalled from the device"]}),R5.jsx(P0,{variant:"secondary",disabled:J.retrying,onClick:J.onRetry,children:"Check again"})]});let H=Z.status==="login-required";return R5.jsxs(Gt,{title:H?"Connect your agent":"Your agent is unavailable",type:$,...J,children:[Z.reason,H&&R5.jsxs(R5.Fragment,{children:[R5.jsx("br",{}),R5.jsx("br",{}),"Complete sign-in in your agent’s terminal, then try again."]})]})}function zt(){return R5.jsx("div",{className:"flex flex-1 items-center justify-center",children:R5.jsx(r2,{className:"size-6 text-muted-foreground",stroke:1.5})})}function Gt({title:$,type:Z,children:J,retrying:H,onRetry:B}){return R5.jsx("div",{className:"flex flex-1 items-center justify-center p-6",children:R5.jsxs("div",{className:"flex w-full max-w-md flex-col gap-6",children:[Z&&R5.jsx("img",{src:t9[Z],alt:"",className:"size-10 self-center"}),R5.jsx("h1",{className:"text-center text-xl font-medium",children:$}),R5.jsxs("div",{role:"alert",className:"flex flex-col items-center gap-4",children:[R5.jsx("p",{className:"text-sm wrap-anywhere whitespace-pre-wrap text-muted-foreground",children:J}),R5.jsx(P0,{variant:"secondary",disabled:H,onClick:B,children:"Try again"})]})]})})}var PZ=P(c(),1);function Yt($,Z=!1,J={}){let{data:H,isError:B,isPending:Q,isFetching:X,isFetchedAfterMount:z,refetch:G}=t4($),U=Q||X&&!z&&H?.availability.status!=="available",Y=Ut.useCallback(()=>{G()},[G]);function K(){if(U)return;if(B&&H?.availability.status==="available")return;if(B||!H)return PZ.jsx(Bt,{retrying:X,onRetry:Y});if(H.workspaceFolderMissing)return PZ.jsx(Qt,{workspaceId:$});let{provider:N,availability:D}=H;if(D.status==="available")return;if(D.status==="login-required"&&(N==="claude-code"||N==="codex"))return PZ.jsx(Jt,{type:N,reason:D.reason,checking:X,onRecheck:Y});return PZ.jsx(Xt,{type:N,availability:D,retrying:X,onRetry:Y})}let F=K(),W=!F&&!Z&&!U,q=jy($);return{content:q?PZ.jsx(Ty,{...J}):F??PZ.jsx(zt,{}),ready:W&&!q}}var tO=P(c(),1);function Kt({contentPending:$,widgets:Z,views:J}){let{layout:H,workspaceId:B,name:Q,provider:X}=y1(),{content:z,ready:G}=Yt(B,$,{name:Q??"Workspace",icon:H.icon,workspaceType:X,workspaceTheme:H.theme});return G?tO.jsx(ds,{widgets:Z,views:J}):tO.jsx(ls,{children:z})}var Wt=P(m(),1);var VN=P(m(),1);function jq0($){return new Map($.map((Z)=>[Z.id,{w:Z.config.colSpan,h:Z.config.rowSpan}]))}function Tq0($,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=Rq(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 Ft($,Z,J,H){let B=VN.useRef(null);VN.useEffect(()=>{if(!Z)return;let Q=jq0(Z);if(B.current?.workspaceId!==$){B.current={workspaceId:$,sizes:Q};return}let X=Tq0(J.widgetGrid,Z,B.current.sizes);if(B.current={workspaceId:$,sizes:Q},X)H({widgetGrid:X})},[$,Z,J.widgetGrid,H])}function qt($){let{layout:Z,setLayout:J}=y1(),H=e1({queryKey:O0.widgets($),queryFn:async()=>{return(await B1(`/api/workspaces/${$}/widgets`)).widgets},...N8}),B=Wt.useMemo(()=>eh(H.data??[]),[H.data]);return Ft($,H.data?B:void 0,Z,J),{...H,data:B}}var _Z=P(c(),1);function At({id:$}){let{experimental:Z}=o4();return _Z.jsx(Nt,{id:$,children:_Z.jsx(Qv,{id:$,children:_Z.jsx(DD,{workspaceId:$,enabled:Z.collab,children:_Z.jsx(Cq0,{id:$})})})})}function Cq0({id:$}){let Z=l2(),J=$1(),[H]=h3(),{isLoading:B,layout:Q}=y1();bh(Q.theme);let X=qt($),z=Sq($);th(),L2((U)=>{if(U.type==="theme:updated"||U.type==="workspace:updated")J.invalidateQueries({queryKey:O0.layout($)});else if(U.type==="widget-layout:updated"||U.type==="widget:updated")J.invalidateQueries({queryKey:O0.widgets($)});else if(U.type==="view-layout:updated"||U.type==="view:updated")J.invalidateQueries({queryKey:O0.views($)})});let G=B||H===void 0||X.isLoading||z.isLoading;return _Z.jsx(LK,{children:_Z.jsx(Kt,{contentPending:G,widgets:X.data,views:z.data??[]},Z?"browser-tab":"shared")})}var L3=P(c(),1),Dt=null;function Eq0(){if(!Dt)return L3.jsx(sj,{to:"/"});return L3.jsx(LN.Suspense,{fallback:null,children:L3.jsx(Dt,{})})}function Vt(){let[,$]=m4();return LN.useEffect(()=>{return lD((Z)=>$(`/workspace/${Z}`)),()=>lD(null)},[$]),L3.jsxs(nj,{children:[L3.jsx(_z,{path:"/dev/*?",component:Eq0}),L3.jsx(_z,{path:"/",component:yh}),L3.jsx(_z,{path:"/workspace/:id/*?",children:(Z)=>L3.jsx(At,{id:Z.id},Z.id)})]})}var d7=P(c(),1),Mt=new kN;lS(Mt);Ib();function CI1($){function Z(){return d7.jsx(ON,{client:Mt,children:d7.jsxs(uG,{children:[d7.jsx(uN,{children:d7.jsx(Vt,{})}),d7.jsx(oE,{})]})})}Lt.createRoot($).render(d7.jsx(Z,{}))}export{CI1 as mount};
|