@agent-native/dispatch 0.1.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/dist/actions/index.d.ts.map +1 -1
  2. package/dist/actions/index.js +2 -0
  3. package/dist/actions/index.js.map +1 -1
  4. package/dist/actions/list-dispatch-usage-metrics.d.ts +3 -0
  5. package/dist/actions/list-dispatch-usage-metrics.d.ts.map +1 -0
  6. package/dist/actions/list-dispatch-usage-metrics.js +18 -0
  7. package/dist/actions/list-dispatch-usage-metrics.js.map +1 -0
  8. package/dist/actions/navigate.d.ts +1 -0
  9. package/dist/actions/navigate.d.ts.map +1 -1
  10. package/dist/actions/navigate.js +3 -17
  11. package/dist/actions/navigate.js.map +1 -1
  12. package/dist/actions/view-screen.d.ts.map +1 -1
  13. package/dist/actions/view-screen.js +19 -0
  14. package/dist/actions/view-screen.js.map +1 -1
  15. package/dist/components/agents-panel.js +3 -3
  16. package/dist/components/app-keys-popover.js +2 -2
  17. package/dist/components/create-app-popover.js +2 -2
  18. package/dist/components/dispatch-shell.js +2 -2
  19. package/dist/components/index.d.ts +1 -0
  20. package/dist/components/index.d.ts.map +1 -1
  21. package/dist/components/index.js.map +1 -1
  22. package/dist/components/layout/Header.js +4 -4
  23. package/dist/components/layout/Header.js.map +1 -1
  24. package/dist/components/layout/Layout.d.ts +28 -3
  25. package/dist/components/layout/Layout.d.ts.map +1 -1
  26. package/dist/components/layout/Layout.js +137 -26
  27. package/dist/components/layout/Layout.js.map +1 -1
  28. package/dist/components/messaging-setup-panel.js +4 -4
  29. package/dist/components/ui/accordion.js +1 -1
  30. package/dist/components/ui/alert-dialog.js +2 -2
  31. package/dist/components/ui/alert.js +1 -1
  32. package/dist/components/ui/avatar.js +1 -1
  33. package/dist/components/ui/badge.js +1 -1
  34. package/dist/components/ui/breadcrumb.js +1 -1
  35. package/dist/components/ui/button.js +1 -1
  36. package/dist/components/ui/calendar.js +2 -2
  37. package/dist/components/ui/card.js +1 -1
  38. package/dist/components/ui/carousel.d.ts +2 -2
  39. package/dist/components/ui/carousel.js +2 -2
  40. package/dist/components/ui/chart.js +1 -1
  41. package/dist/components/ui/checkbox.js +1 -1
  42. package/dist/components/ui/command.js +2 -2
  43. package/dist/components/ui/context-menu.js +1 -1
  44. package/dist/components/ui/dialog.js +1 -1
  45. package/dist/components/ui/drawer.js +1 -1
  46. package/dist/components/ui/dropdown-menu.js +1 -1
  47. package/dist/components/ui/form.js +2 -2
  48. package/dist/components/ui/hover-card.js +1 -1
  49. package/dist/components/ui/input-otp.js +1 -1
  50. package/dist/components/ui/input.js +1 -1
  51. package/dist/components/ui/label.js +1 -1
  52. package/dist/components/ui/menubar.js +1 -1
  53. package/dist/components/ui/navigation-menu.js +1 -1
  54. package/dist/components/ui/pagination.d.ts +1 -1
  55. package/dist/components/ui/pagination.js +2 -2
  56. package/dist/components/ui/popover.js +1 -1
  57. package/dist/components/ui/progress.js +1 -1
  58. package/dist/components/ui/radio-group.js +1 -1
  59. package/dist/components/ui/resizable.js +1 -1
  60. package/dist/components/ui/scroll-area.js +1 -1
  61. package/dist/components/ui/select.js +1 -1
  62. package/dist/components/ui/separator.js +1 -1
  63. package/dist/components/ui/sheet.js +1 -1
  64. package/dist/components/ui/sidebar.d.ts +2 -2
  65. package/dist/components/ui/sidebar.js +8 -8
  66. package/dist/components/ui/skeleton.js +1 -1
  67. package/dist/components/ui/slider.js +1 -1
  68. package/dist/components/ui/sonner.js +1 -1
  69. package/dist/components/ui/spinner.js +1 -1
  70. package/dist/components/ui/switch.js +1 -1
  71. package/dist/components/ui/table.js +1 -1
  72. package/dist/components/ui/tabs.js +1 -1
  73. package/dist/components/ui/textarea.js +1 -1
  74. package/dist/components/ui/toast.js +1 -1
  75. package/dist/components/ui/toaster.js +2 -2
  76. package/dist/components/ui/toggle-group.js +2 -2
  77. package/dist/components/ui/toggle.js +1 -1
  78. package/dist/components/ui/tooltip.js +1 -1
  79. package/dist/components/ui/use-toast.d.ts +1 -1
  80. package/dist/components/ui/use-toast.js +1 -1
  81. package/dist/hooks/use-navigation-state.d.ts +2 -1
  82. package/dist/hooks/use-navigation-state.d.ts.map +1 -1
  83. package/dist/hooks/use-navigation-state.js +36 -8
  84. package/dist/hooks/use-navigation-state.js.map +1 -1
  85. package/dist/hooks/use-toast.d.ts +1 -1
  86. package/dist/routes/index.d.ts.map +1 -1
  87. package/dist/routes/index.js +3 -2
  88. package/dist/routes/index.js.map +1 -1
  89. package/dist/routes/pages/_index.js +1 -1
  90. package/dist/routes/pages/agents.js +2 -2
  91. package/dist/routes/pages/approval.js +2 -2
  92. package/dist/routes/pages/approvals.js +4 -4
  93. package/dist/routes/pages/apps.$appId.js +3 -3
  94. package/dist/routes/pages/apps.js +5 -5
  95. package/dist/routes/pages/audit.js +1 -1
  96. package/dist/routes/pages/destinations.js +6 -6
  97. package/dist/routes/pages/extensions.$id.d.ts +2 -0
  98. package/dist/routes/pages/extensions.$id.d.ts.map +1 -0
  99. package/dist/routes/pages/extensions.$id.js +6 -0
  100. package/dist/routes/pages/extensions.$id.js.map +1 -0
  101. package/dist/routes/pages/extensions._index.d.ts +2 -0
  102. package/dist/routes/pages/extensions._index.d.ts.map +1 -0
  103. package/dist/routes/pages/extensions._index.js +6 -0
  104. package/dist/routes/pages/extensions._index.js.map +1 -0
  105. package/dist/routes/pages/identities.js +2 -2
  106. package/dist/routes/pages/integrations.js +4 -4
  107. package/dist/routes/pages/messaging.js +2 -2
  108. package/dist/routes/pages/metrics.d.ts +5 -0
  109. package/dist/routes/pages/metrics.d.ts.map +1 -0
  110. package/dist/routes/pages/metrics.js +135 -0
  111. package/dist/routes/pages/metrics.js.map +1 -0
  112. package/dist/routes/pages/new-app.js +1 -1
  113. package/dist/routes/pages/overview.d.ts.map +1 -1
  114. package/dist/routes/pages/overview.js +9 -17
  115. package/dist/routes/pages/overview.js.map +1 -1
  116. package/dist/routes/pages/team.js +1 -1
  117. package/dist/routes/pages/vault.js +10 -10
  118. package/dist/routes/pages/workspace.js +10 -10
  119. package/dist/server/lib/pre-auth-routing.d.ts.map +1 -1
  120. package/dist/server/lib/pre-auth-routing.js +9 -2
  121. package/dist/server/lib/pre-auth-routing.js.map +1 -1
  122. package/dist/server/lib/usage-metrics-store.d.ts +93 -0
  123. package/dist/server/lib/usage-metrics-store.d.ts.map +1 -0
  124. package/dist/server/lib/usage-metrics-store.js +386 -0
  125. package/dist/server/lib/usage-metrics-store.js.map +1 -0
  126. package/package.json +9 -5
  127. package/src/actions/index.ts +2 -0
  128. package/src/actions/list-dispatch-usage-metrics.ts +19 -0
  129. package/src/actions/navigate.ts +5 -17
  130. package/src/actions/view-screen.ts +18 -0
  131. package/src/components/index.ts +6 -0
  132. package/src/components/layout/Header.tsx +1 -1
  133. package/src/components/layout/Layout.tsx +194 -37
  134. package/src/hooks/use-navigation-state.ts +57 -8
  135. package/src/routes/index.ts +3 -2
  136. package/src/routes/pages/extensions.$id.tsx +5 -0
  137. package/src/routes/pages/extensions._index.tsx +5 -0
  138. package/src/routes/pages/metrics.tsx +667 -0
  139. package/src/routes/pages/overview.tsx +0 -10
  140. package/src/server/lib/pre-auth-routing.ts +10 -2
  141. package/src/server/lib/usage-metrics-store.ts +605 -0
@@ -4,27 +4,107 @@ import { NavLink, useLocation } from "react-router";
4
4
  import { AgentSidebar, FeedbackButton, appPath, useActionQuery, } from "@agent-native/core/client";
5
5
  import { InvitationBanner } from "@agent-native/core/client/org";
6
6
  import { ToolsSidebarSection } from "@agent-native/core/client/tools";
7
- import { IconArrowUpRight, IconApps, IconBrandTelegram, IconKey, IconChevronDown, IconLayersSubtract, IconPlugConnected, IconBroadcast, IconFingerprint, IconHistory, IconPuzzle, IconShieldCheck, IconUsersGroup, } from "@tabler/icons-react";
8
- import { cn } from "../../lib/utils";
9
- import { Sheet, SheetContent, SheetDescription, SheetTitle, } from "../../components/ui/sheet";
10
- import { Header } from "./Header";
11
- import { HeaderActionsProvider } from "./HeaderActions";
7
+ import { IconArrowUpRight, IconApps, IconChartBar, IconBrandTelegram, IconKey, IconChevronDown, IconLayersSubtract, IconPlugConnected, IconBroadcast, IconFingerprint, IconHistory, IconPuzzle, IconShieldCheck, IconUsersGroup, } from "@tabler/icons-react";
8
+ import { cn } from "../../lib/utils.js";
9
+ import { Sheet, SheetContent, SheetDescription, SheetTitle, } from "../../components/ui/sheet.js";
10
+ import { Header } from "./Header.js";
11
+ import { HeaderActionsProvider } from "./HeaderActions.js";
12
12
  const PRIMARY_NAV_ITEMS = [
13
- { to: "/overview", label: "Overview", icon: IconBroadcast },
14
- { to: "/apps", label: "Apps", icon: IconApps },
15
- { to: "/vault", label: "Vault", icon: IconKey },
16
- { to: "/integrations", label: "Integrations", icon: IconPuzzle },
17
- { to: "/agents", label: "Agents", icon: IconPlugConnected },
13
+ {
14
+ id: "overview",
15
+ to: "/overview",
16
+ label: "Overview",
17
+ icon: IconBroadcast,
18
+ section: "primary",
19
+ },
20
+ {
21
+ id: "apps",
22
+ to: "/apps",
23
+ label: "Apps",
24
+ icon: IconApps,
25
+ section: "primary",
26
+ },
27
+ {
28
+ id: "metrics",
29
+ to: "/metrics",
30
+ label: "Metrics",
31
+ icon: IconChartBar,
32
+ section: "primary",
33
+ },
34
+ {
35
+ id: "vault",
36
+ to: "/vault",
37
+ label: "Vault",
38
+ icon: IconKey,
39
+ section: "primary",
40
+ },
41
+ {
42
+ id: "integrations",
43
+ to: "/integrations",
44
+ label: "Integrations",
45
+ icon: IconPuzzle,
46
+ section: "primary",
47
+ },
48
+ {
49
+ id: "agents",
50
+ to: "/agents",
51
+ label: "Agents",
52
+ icon: IconPlugConnected,
53
+ section: "primary",
54
+ },
18
55
  ];
19
56
  const OPERATIONS_NAV_ITEMS = [
20
- { to: "/workspace", label: "Resources", icon: IconLayersSubtract },
21
- { to: "/messaging", label: "Messaging", icon: IconBrandTelegram },
22
- { to: "/destinations", label: "Destinations", icon: IconArrowUpRight },
23
- { to: "/identities", label: "Identities", icon: IconFingerprint },
24
- { to: "/approvals", label: "Approvals", icon: IconShieldCheck },
25
- { to: "/audit", label: "Audit", icon: IconHistory },
26
- { to: "/team", label: "Team", icon: IconUsersGroup },
57
+ {
58
+ id: "workspace",
59
+ to: "/workspace",
60
+ label: "Resources",
61
+ icon: IconLayersSubtract,
62
+ section: "operations",
63
+ },
64
+ {
65
+ id: "messaging",
66
+ to: "/messaging",
67
+ label: "Messaging",
68
+ icon: IconBrandTelegram,
69
+ section: "operations",
70
+ },
71
+ {
72
+ id: "destinations",
73
+ to: "/destinations",
74
+ label: "Destinations",
75
+ icon: IconArrowUpRight,
76
+ section: "operations",
77
+ },
78
+ {
79
+ id: "identities",
80
+ to: "/identities",
81
+ label: "Identities",
82
+ icon: IconFingerprint,
83
+ section: "operations",
84
+ },
85
+ {
86
+ id: "approvals",
87
+ to: "/approvals",
88
+ label: "Approvals",
89
+ icon: IconShieldCheck,
90
+ section: "operations",
91
+ },
92
+ {
93
+ id: "audit",
94
+ to: "/audit",
95
+ label: "Audit",
96
+ icon: IconHistory,
97
+ section: "operations",
98
+ },
99
+ {
100
+ id: "team",
101
+ to: "/team",
102
+ label: "Team",
103
+ icon: IconUsersGroup,
104
+ section: "operations",
105
+ },
27
106
  ];
107
+ const EMPTY_NAV_ITEMS = [];
28
108
  const SIDEBAR_SUGGESTIONS = [
29
109
  "Create a new app",
30
110
  "Grant a key to an app",
@@ -37,26 +117,57 @@ const CHROMELESS_PATHS = ["/approval"];
37
117
  function pageOwnsToolbar(pathname) {
38
118
  if (pathname === "/tools" || pathname.startsWith("/tools/"))
39
119
  return true;
120
+ if (pathname === "/extensions" || pathname.startsWith("/extensions/"))
121
+ return true;
40
122
  return false;
41
123
  }
42
- export function NavContent({ onNavigate }) {
124
+ function sectionFor(item) {
125
+ return item.section ?? "operations";
126
+ }
127
+ function navItemMatchesPath(item, pathname) {
128
+ if (item.match) {
129
+ try {
130
+ if (item.match(pathname))
131
+ return true;
132
+ }
133
+ catch {
134
+ return false;
135
+ }
136
+ }
137
+ return pathname === item.to || pathname.startsWith(`${item.to}/`);
138
+ }
139
+ function navItemsForSection(items, section) {
140
+ return items.filter((item) => sectionFor(item) === section);
141
+ }
142
+ export function NavContent({ onNavigate, extensions, }) {
43
143
  const location = useLocation();
44
144
  const { data: workspace } = useActionQuery("get-workspace-info", {}, { staleTime: 60_000 });
45
145
  const ws = workspace;
46
146
  const workspaceLabel = ws?.displayName ?? ws?.name ?? null;
47
- const operationsOpen = OPERATIONS_NAV_ITEMS.some((item) => location.pathname === item.to ||
48
- location.pathname.startsWith(`${item.to}/`));
147
+ const extensionNavItems = extensions?.navItems ?? EMPTY_NAV_ITEMS;
148
+ const primaryNavItems = [
149
+ ...PRIMARY_NAV_ITEMS,
150
+ ...navItemsForSection(extensionNavItems, "primary"),
151
+ ];
152
+ const operationsNavItems = [
153
+ ...OPERATIONS_NAV_ITEMS,
154
+ ...navItemsForSection(extensionNavItems, "operations"),
155
+ ];
156
+ const operationsOpen = operationsNavItems.some((item) => navItemMatchesPath(item, location.pathname));
49
157
  const renderNavItem = (item) => {
50
158
  const Icon = item.icon;
51
- return (_jsx("li", { children: _jsxs(NavLink, { to: item.to, onClick: onNavigate, className: ({ isActive }) => cn("flex h-8 w-full items-center gap-2 rounded-md px-2 text-sm", isActive
52
- ? "bg-sidebar-accent font-medium text-sidebar-accent-foreground"
53
- : "text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"), children: [_jsx(Icon, { size: 16, className: "shrink-0" }), _jsx("span", { className: "truncate", children: item.label })] }) }, item.to));
159
+ return (_jsx("li", { children: _jsxs(NavLink, { to: item.to, onClick: onNavigate, className: ({ isActive }) => {
160
+ const active = isActive || navItemMatchesPath(item, location.pathname);
161
+ return cn("flex h-8 w-full items-center gap-2 rounded-md px-2 text-sm", active
162
+ ? "bg-sidebar-accent font-medium text-sidebar-accent-foreground"
163
+ : "text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground");
164
+ }, children: [Icon ? (_jsx(Icon, { size: 16, className: "shrink-0" })) : (_jsx("span", { className: "h-4 w-4 shrink-0", "aria-hidden": "true" })), _jsx("span", { className: "truncate", children: item.label })] }) }, item.id));
54
165
  };
55
166
  return (_jsxs(_Fragment, { children: [_jsx("div", { className: "border-b px-4 py-3", children: _jsxs("div", { className: "flex items-center gap-3", children: [_jsxs("div", { className: "flex h-9 w-9 items-center justify-center rounded-xl border bg-card text-foreground", children: [_jsx("img", { src: appPath("/agent-native-icon-light.svg"), alt: "", "aria-hidden": "true", className: "block h-4 w-auto shrink-0 dark:hidden" }), _jsx("img", { src: appPath("/agent-native-icon-dark.svg"), alt: "", "aria-hidden": "true", className: "hidden h-4 w-auto shrink-0 dark:block" })] }), _jsxs("div", { className: "min-w-0", children: [_jsx("div", { className: "truncate text-sm font-semibold text-foreground", children: workspaceLabel ?? "Dispatch" }), _jsx("div", { className: "truncate text-xs text-muted-foreground", children: workspaceLabel
56
167
  ? `Workspace · ${ws?.appCount ?? 0} app${ws?.appCount === 1 ? "" : "s"}`
57
- : "Workspace control plane" })] })] }) }), _jsxs("nav", { className: "flex-1 overflow-y-auto px-2 py-3", children: [_jsx("ul", { className: "space-y-0.5", children: PRIMARY_NAV_ITEMS.map(renderNavItem) }), _jsxs("details", { className: "group mt-4", open: operationsOpen, children: [_jsxs("summary", { className: "flex h-8 cursor-pointer list-none items-center justify-between rounded-md px-2 text-xs font-medium uppercase text-sidebar-foreground/50 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground [&::-webkit-details-marker]:hidden", children: [_jsx("span", { children: "Operations" }), _jsx(IconChevronDown, { size: 14, className: "transition-transform group-open:rotate-180" })] }), _jsx("ul", { className: "mt-1 space-y-0.5", children: OPERATIONS_NAV_ITEMS.map(renderNavItem) })] })] }), _jsxs("div", { className: "border-t px-2 py-2", children: [_jsx(ToolsSidebarSection, {}), _jsx(FeedbackButton, {})] })] }));
168
+ : "Workspace control plane" })] })] }) }), _jsxs("nav", { className: "flex-1 overflow-y-auto px-2 py-3", children: [_jsx("ul", { className: "space-y-0.5", children: primaryNavItems.map(renderNavItem) }), _jsxs("details", { className: "group mt-4", open: operationsOpen, children: [_jsxs("summary", { className: "flex h-8 cursor-pointer list-none items-center justify-between rounded-md px-2 text-xs font-medium uppercase text-sidebar-foreground/50 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground [&::-webkit-details-marker]:hidden", children: [_jsx("span", { children: "Operations" }), _jsx(IconChevronDown, { size: 14, className: "transition-transform group-open:rotate-180" })] }), _jsx("ul", { className: "mt-1 space-y-0.5", children: operationsNavItems.map(renderNavItem) })] })] }), _jsxs("div", { className: "border-t px-2 py-2", children: [_jsx(ToolsSidebarSection, {}), _jsx(FeedbackButton, {})] })] }));
58
169
  }
59
- export function Layout({ children }) {
170
+ export function Layout({ children, extensions, }) {
60
171
  const location = useLocation();
61
172
  const [mobileOpen, setMobileOpen] = useState(false);
62
173
  const hasEmbeddedAgentChat = location.pathname === "/" || location.pathname === "/overview";
@@ -65,6 +176,6 @@ export function Layout({ children }) {
65
176
  }
66
177
  const showHeader = !pageOwnsToolbar(location.pathname);
67
178
  const appContent = (_jsxs("div", { className: "flex h-full flex-1 flex-col overflow-hidden", children: [showHeader ? (_jsx(Header, { onOpenMobile: () => setMobileOpen(true), showAgentToggle: !hasEmbeddedAgentChat })) : null, _jsx(InvitationBanner, {}), _jsx("main", { className: "flex-1 overflow-y-auto", children: showHeader ? (_jsx("div", { className: "mx-auto max-w-7xl space-y-5 px-4 py-6 sm:px-6", children: children })) : (children) })] }));
68
- return (_jsx(HeaderActionsProvider, { children: _jsxs("div", { className: "flex h-screen w-full overflow-hidden bg-background", children: [_jsx("aside", { className: "hidden 2xl:flex w-64 shrink-0 flex-col border-r bg-sidebar text-sidebar-foreground", children: _jsx(NavContent, {}) }), _jsx(Sheet, { open: mobileOpen, onOpenChange: setMobileOpen, children: _jsxs(SheetContent, { side: "left", className: "w-72 p-0 bg-sidebar text-sidebar-foreground [&>button]:hidden", children: [_jsx(SheetTitle, { className: "sr-only", children: "Navigation" }), _jsx(SheetDescription, { className: "sr-only", children: "Workspace navigation links" }), _jsx("div", { className: "flex h-full w-full flex-col", children: _jsx(NavContent, { onNavigate: () => setMobileOpen(false) }) })] }) }), _jsx(AgentSidebar, { position: "right", defaultOpen: false, emptyStateText: "Create apps, grant keys, and route work across the workspace.", suggestions: SIDEBAR_SUGGESTIONS, children: appContent })] }) }));
179
+ return (_jsx(HeaderActionsProvider, { children: _jsxs("div", { className: "flex h-screen w-full overflow-hidden bg-background", children: [_jsx("aside", { className: "hidden 2xl:flex w-64 shrink-0 flex-col border-r bg-sidebar text-sidebar-foreground", children: _jsx(NavContent, { extensions: extensions }) }), _jsx(Sheet, { open: mobileOpen, onOpenChange: setMobileOpen, children: _jsxs(SheetContent, { side: "left", className: "w-72 p-0 bg-sidebar text-sidebar-foreground [&>button]:hidden", children: [_jsx(SheetTitle, { className: "sr-only", children: "Navigation" }), _jsx(SheetDescription, { className: "sr-only", children: "Workspace navigation links" }), _jsx("div", { className: "flex h-full w-full flex-col", children: _jsx(NavContent, { extensions: extensions, onNavigate: () => setMobileOpen(false) }) })] }) }), _jsx(AgentSidebar, { position: "right", defaultOpen: false, emptyStateText: "Create apps, grant keys, and route work across the workspace.", suggestions: SIDEBAR_SUGGESTIONS, children: appContent })] }) }));
69
180
  }
70
181
  //# sourceMappingURL=Layout.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Layout.js","sourceRoot":"","sources":["../../../src/components/layout/Layout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EACL,YAAY,EACZ,cAAc,EACd,OAAO,EACP,cAAc,GACf,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM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C,CACH,CAAC,CAAC,CAAC,IAAI,EACR,KAAC,gBAAgB,KAAG,EACpB,eAAM,SAAS,EAAC,wBAAwB,YACrC,UAAU,CAAC,CAAC,CAAC,CACZ,cAAK,SAAS,EAAC,+CAA+C,YAC3D,QAAQ,GACL,CACP,CAAC,CAAC,CAAC,CACF,QAAQ,CACT,GACI,IACH,CACP,CAAC;IAEF,OAAO,CACL,KAAC,qBAAqB,cACpB,eAAK,SAAS,EAAC,oDAAoD,aACjE,gBAAO,SAAS,EAAC,oFAAoF,YACnG,KAAC,UAAU,KAAG,GACR,EAER,KAAC,KAAK,IAAC,IAAI,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,YAClD,MAAC,YAAY,IACX,IAAI,EAAC,MAAM,EACX,SAAS,EAAC,+DAA+D,aAEzE,KAAC,UAAU,IAAC,SAAS,EAAC,SAAS,2BAAwB,EACvD,KAAC,gBAAgB,IAAC,SAAS,EAAC,SAAS,2CAElB,EACnB,cAAK,SAAS,EAAC,6BAA6B,YAC1C,KAAC,UAAU,IAAC,UAAU,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,GAAI,GAClD,IACO,GACT,EAOR,KAAC,YAAY,IACX,QAAQ,EAAC,OAAO,EAChB,WAAW,EAAE,KAAK,EAClB,cAAc,EAAC,+DAA+D,EAC9E,WAAW,EAAE,mBAAmB,YAE/B,UAAU,GACE,IACX,GACgB,CACzB,CAAC;AACJ,CAAC","sourcesContent":["import { useState, type ReactNode } from \"react\";\nimport { NavLink, useLocation } from \"react-router\";\nimport {\n AgentSidebar,\n FeedbackButton,\n appPath,\n useActionQuery,\n} from \"@agent-native/core/client\";\nimport { InvitationBanner } from \"@agent-native/core/client/org\";\nimport { ToolsSidebarSection } from \"@agent-native/core/client/tools\";\nimport {\n IconArrowUpRight,\n IconApps,\n IconBrandTelegram,\n IconKey,\n IconChevronDown,\n IconLayersSubtract,\n IconPlugConnected,\n IconBroadcast,\n IconFingerprint,\n IconHistory,\n IconPuzzle,\n IconShieldCheck,\n IconUsersGroup,\n} from \"@tabler/icons-react\";\nimport { cn } from \"@/lib/utils\";\nimport {\n Sheet,\n SheetContent,\n SheetDescription,\n SheetTitle,\n} from \"@/components/ui/sheet\";\nimport { Header } from \"./Header\";\nimport { HeaderActionsProvider } from \"./HeaderActions\";\n\nconst PRIMARY_NAV_ITEMS = [\n { to: \"/overview\", label: \"Overview\", icon: IconBroadcast },\n { to: \"/apps\", label: \"Apps\", icon: IconApps },\n { to: \"/vault\", label: \"Vault\", icon: IconKey },\n { to: \"/integrations\", label: \"Integrations\", icon: IconPuzzle },\n { to: \"/agents\", label: \"Agents\", icon: IconPlugConnected },\n] as const;\n\nconst OPERATIONS_NAV_ITEMS = [\n { to: \"/workspace\", label: \"Resources\", icon: IconLayersSubtract },\n { to: \"/messaging\", label: \"Messaging\", icon: IconBrandTelegram },\n { to: \"/destinations\", label: \"Destinations\", icon: IconArrowUpRight },\n { to: \"/identities\", label: \"Identities\", icon: IconFingerprint },\n { to: \"/approvals\", label: \"Approvals\", icon: IconShieldCheck },\n { to: \"/audit\", label: \"Audit\", icon: IconHistory },\n { to: \"/team\", label: \"Team\", icon: IconUsersGroup },\n] as const;\n\ntype NavItem =\n | (typeof PRIMARY_NAV_ITEMS)[number]\n | (typeof OPERATIONS_NAV_ITEMS)[number];\n\nconst SIDEBAR_SUGGESTIONS = [\n \"Create a new app\",\n \"Grant a key to an app\",\n \"Check integration health\",\n];\n\nconst CHROMELESS_PATHS = [\"/approval\"];\n\n// Routes whose page renders its own toolbar (with NotificationsBell + AgentToggleButton).\n// Layout still mounts the sidebar + AgentSidebar, but skips its own Header so\n// there's no double-header.\nfunction pageOwnsToolbar(pathname: string): boolean {\n if (pathname === \"/tools\" || pathname.startsWith(\"/tools/\")) return true;\n return false;\n}\n\ninterface WorkspaceInfo {\n name: string | null;\n displayName: string | null;\n appCount: number;\n}\n\nexport function NavContent({ onNavigate }: { onNavigate?: () => void }) {\n const location = useLocation();\n const { data: workspace } = useActionQuery(\n \"get-workspace-info\",\n {},\n { staleTime: 60_000 },\n );\n const ws = workspace as WorkspaceInfo | undefined;\n const workspaceLabel = ws?.displayName ?? ws?.name ?? null;\n const operationsOpen = OPERATIONS_NAV_ITEMS.some(\n (item) =>\n location.pathname === item.to ||\n location.pathname.startsWith(`${item.to}/`),\n );\n\n const renderNavItem = (item: NavItem) => {\n const Icon = item.icon;\n return (\n <li key={item.to}>\n <NavLink\n to={item.to}\n onClick={onNavigate}\n className={({ isActive }) =>\n cn(\n \"flex h-8 w-full items-center gap-2 rounded-md px-2 text-sm\",\n isActive\n ? \"bg-sidebar-accent font-medium text-sidebar-accent-foreground\"\n : \"text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground\",\n )\n }\n >\n <Icon size={16} className=\"shrink-0\" />\n <span className=\"truncate\">{item.label}</span>\n </NavLink>\n </li>\n );\n };\n\n return (\n <>\n <div className=\"border-b px-4 py-3\">\n <div className=\"flex items-center gap-3\">\n <div className=\"flex h-9 w-9 items-center justify-center rounded-xl border bg-card text-foreground\">\n <img\n src={appPath(\"/agent-native-icon-light.svg\")}\n alt=\"\"\n aria-hidden=\"true\"\n className=\"block h-4 w-auto shrink-0 dark:hidden\"\n />\n <img\n src={appPath(\"/agent-native-icon-dark.svg\")}\n alt=\"\"\n aria-hidden=\"true\"\n className=\"hidden h-4 w-auto shrink-0 dark:block\"\n />\n </div>\n <div className=\"min-w-0\">\n <div className=\"truncate text-sm font-semibold text-foreground\">\n {workspaceLabel ?? \"Dispatch\"}\n </div>\n <div className=\"truncate text-xs text-muted-foreground\">\n {workspaceLabel\n ? `Workspace · ${ws?.appCount ?? 0} app${ws?.appCount === 1 ? \"\" : \"s\"}`\n : \"Workspace control plane\"}\n </div>\n </div>\n </div>\n </div>\n\n <nav className=\"flex-1 overflow-y-auto px-2 py-3\">\n <ul className=\"space-y-0.5\">{PRIMARY_NAV_ITEMS.map(renderNavItem)}</ul>\n <details className=\"group mt-4\" open={operationsOpen}>\n <summary className=\"flex h-8 cursor-pointer list-none items-center justify-between rounded-md px-2 text-xs font-medium uppercase text-sidebar-foreground/50 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground [&::-webkit-details-marker]:hidden\">\n <span>Operations</span>\n <IconChevronDown\n size={14}\n className=\"transition-transform group-open:rotate-180\"\n />\n </summary>\n <ul className=\"mt-1 space-y-0.5\">\n {OPERATIONS_NAV_ITEMS.map(renderNavItem)}\n </ul>\n </details>\n </nav>\n\n <div className=\"border-t px-2 py-2\">\n <ToolsSidebarSection />\n <FeedbackButton />\n </div>\n </>\n );\n}\n\nexport function Layout({ children }: { children: ReactNode }) {\n const location = useLocation();\n const [mobileOpen, setMobileOpen] = useState(false);\n const hasEmbeddedAgentChat =\n location.pathname === \"/\" || location.pathname === \"/overview\";\n\n if (CHROMELESS_PATHS.some((path) => location.pathname === path)) {\n return <>{children}</>;\n }\n\n const showHeader = !pageOwnsToolbar(location.pathname);\n const appContent = (\n <div className=\"flex h-full flex-1 flex-col overflow-hidden\">\n {showHeader ? (\n <Header\n onOpenMobile={() => setMobileOpen(true)}\n showAgentToggle={!hasEmbeddedAgentChat}\n />\n ) : null}\n <InvitationBanner />\n <main className=\"flex-1 overflow-y-auto\">\n {showHeader ? (\n <div className=\"mx-auto max-w-7xl space-y-5 px-4 py-6 sm:px-6\">\n {children}\n </div>\n ) : (\n children\n )}\n </main>\n </div>\n );\n\n return (\n <HeaderActionsProvider>\n <div className=\"flex h-screen w-full overflow-hidden bg-background\">\n <aside className=\"hidden 2xl:flex w-64 shrink-0 flex-col border-r bg-sidebar text-sidebar-foreground\">\n <NavContent />\n </aside>\n\n <Sheet open={mobileOpen} onOpenChange={setMobileOpen}>\n <SheetContent\n side=\"left\"\n className=\"w-72 p-0 bg-sidebar text-sidebar-foreground [&>button]:hidden\"\n >\n <SheetTitle className=\"sr-only\">Navigation</SheetTitle>\n <SheetDescription className=\"sr-only\">\n Workspace navigation links\n </SheetDescription>\n <div className=\"flex h-full w-full flex-col\">\n <NavContent onNavigate={() => setMobileOpen(false)} />\n </div>\n </SheetContent>\n </Sheet>\n\n {/*\n * Always mount AgentSidebar so home composer's sendToAgentChat\n * fallback can pop it via agent-panel:open. The toggle button stays\n * hidden on overview because the home composer is the primary input.\n */}\n <AgentSidebar\n position=\"right\"\n defaultOpen={false}\n emptyStateText=\"Create apps, grant keys, and route work across the workspace.\"\n suggestions={SIDEBAR_SUGGESTIONS}\n >\n {appContent}\n </AgentSidebar>\n </div>\n </HeaderActionsProvider>\n );\n}\n"]}
1
+ {"version":3,"file":"Layout.js","sourceRoot":"","sources":["../../../src/components/layout/Layout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAsC,MAAM,OAAO,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EACL,YAAY,EACZ,cAAc,EACd,OAAO,EACP,cAAc,GACf,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EACL,gBAAgB,EAChB,QAAQ,EACR,YAAY,EACZ,iBAAiB,EACjB,OAAO,EACP,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,WAAW,EACX,UAAU,EACV,eAAe,EACf,cAAc,GACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EACL,KAAK,EACL,YAAY,EACZ,gBAAgB,EAChB,UAAU,GACX,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AA6BxD,MAAM,iBAAiB,GAAG;IACxB;QACE,EAAE,EAAE,UAAU;QACd,EAAE,EAAE,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aACzD,UAAU,CAAC,CAAC,CAAC,CACZ,KAAC,MAAM,IACL,YAAY,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,EACvC,eAAe,EAAE,CAAC,oBAAoB,GACtC,CACH,CAAC,CAAC,CAAC,IAAI,EACR,KAAC,gBAAgB,KAAG,EACpB,eAAM,SAAS,EAAC,wBAAwB,YACrC,UAAU,CAAC,CAAC,CAAC,CACZ,cAAK,SAAS,EAAC,+CAA+C,YAC3D,QAAQ,GACL,CACP,CAAC,CAAC,CAAC,CACF,QAAQ,CACT,GACI,IACH,CACP,CAAC;IAEF,OAAO,CACL,KAAC,qBAAqB,cACpB,eAAK,SAAS,EAAC,oDAAoD,aACjE,gBAAO,SAAS,EAAC,oFAAoF,YACnG,KAAC,UAAU,IAAC,UAAU,EAAE,UAAU,GAAI,GAChC,EAER,KAAC,KAAK,IAAC,IAAI,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,YAClD,MAAC,YAAY,IACX,IAAI,EAAC,MAAM,EACX,SAAS,EAAC,+DAA+D,aAEzE,KAAC,UAAU,IAAC,SAAS,EAAC,SAAS,2BAAwB,EACvD,KAAC,gBAAgB,IAAC,SAAS,EAAC,SAAS,2CAElB,EACnB,cAAK,SAAS,EAAC,6BAA6B,YAC1C,KAAC,UAAU,IACT,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,GACtC,GACE,IACO,GACT,EAOR,KAAC,YAAY,IACX,QAAQ,EAAC,OAAO,EAChB,WAAW,EAAE,KAAK,EAClB,cAAc,EAAC,+DAA+D,EAC9E,WAAW,EAAE,mBAAmB,YAE/B,UAAU,GACE,IACX,GACgB,CACzB,CAAC;AACJ,CAAC","sourcesContent":["import { useState, type ComponentType, type ReactNode } from \"react\";\nimport { NavLink, useLocation } from \"react-router\";\nimport {\n AgentSidebar,\n FeedbackButton,\n appPath,\n useActionQuery,\n} from \"@agent-native/core/client\";\nimport { InvitationBanner } from \"@agent-native/core/client/org\";\nimport { ToolsSidebarSection } from \"@agent-native/core/client/tools\";\nimport {\n IconArrowUpRight,\n IconApps,\n IconChartBar,\n IconBrandTelegram,\n IconKey,\n IconChevronDown,\n IconLayersSubtract,\n IconPlugConnected,\n IconBroadcast,\n IconFingerprint,\n IconHistory,\n IconPuzzle,\n IconShieldCheck,\n IconUsersGroup,\n} from \"@tabler/icons-react\";\nimport { cn } from \"@/lib/utils\";\nimport {\n Sheet,\n SheetContent,\n SheetDescription,\n SheetTitle,\n} from \"@/components/ui/sheet\";\nimport { Header } from \"./Header\";\nimport { HeaderActionsProvider } from \"./HeaderActions\";\n\nexport type DispatchNavSection = \"primary\" | \"operations\";\n\nexport type DispatchNavIcon = ComponentType<{\n size?: number | string;\n className?: string;\n}>;\n\nexport interface DispatchNavItem {\n /** Stable id used for keys and navigation.view. Avoid built-in ids. */\n id: string;\n /** React Router path for the tab, usually backed by an app/routes/*.tsx file. */\n to: string;\n label: string;\n icon?: DispatchNavIcon;\n /** Defaults to \"operations\", which is where local management tools usually fit. */\n section?: DispatchNavSection;\n /** Override active matching for nested or multi-route tools. */\n match?: (pathname: string) => boolean;\n}\n\nexport interface DispatchExtensionConfig {\n /** Extra sidebar tabs supplied by the generated workspace. */\n navItems?: readonly DispatchNavItem[];\n /** Extra React Query keys to invalidate when Dispatch receives DB sync events. */\n queryKeys?: readonly string[];\n}\n\nconst PRIMARY_NAV_ITEMS = [\n {\n id: \"overview\",\n to: \"/overview\",\n label: \"Overview\",\n icon: IconBroadcast,\n section: \"primary\",\n },\n {\n id: \"apps\",\n to: \"/apps\",\n label: \"Apps\",\n icon: IconApps,\n section: \"primary\",\n },\n {\n id: \"metrics\",\n to: \"/metrics\",\n label: \"Metrics\",\n icon: IconChartBar,\n section: \"primary\",\n },\n {\n id: \"vault\",\n to: \"/vault\",\n label: \"Vault\",\n icon: IconKey,\n section: \"primary\",\n },\n {\n id: \"integrations\",\n to: \"/integrations\",\n label: \"Integrations\",\n icon: IconPuzzle,\n section: \"primary\",\n },\n {\n id: \"agents\",\n to: \"/agents\",\n label: \"Agents\",\n icon: IconPlugConnected,\n section: \"primary\",\n },\n] as const satisfies readonly DispatchNavItem[];\n\nconst OPERATIONS_NAV_ITEMS = [\n {\n id: \"workspace\",\n to: \"/workspace\",\n label: \"Resources\",\n icon: IconLayersSubtract,\n section: \"operations\",\n },\n {\n id: \"messaging\",\n to: \"/messaging\",\n label: \"Messaging\",\n icon: IconBrandTelegram,\n section: \"operations\",\n },\n {\n id: \"destinations\",\n to: \"/destinations\",\n label: \"Destinations\",\n icon: IconArrowUpRight,\n section: \"operations\",\n },\n {\n id: \"identities\",\n to: \"/identities\",\n label: \"Identities\",\n icon: IconFingerprint,\n section: \"operations\",\n },\n {\n id: \"approvals\",\n to: \"/approvals\",\n label: \"Approvals\",\n icon: IconShieldCheck,\n section: \"operations\",\n },\n {\n id: \"audit\",\n to: \"/audit\",\n label: \"Audit\",\n icon: IconHistory,\n section: \"operations\",\n },\n {\n id: \"team\",\n to: \"/team\",\n label: \"Team\",\n icon: IconUsersGroup,\n section: \"operations\",\n },\n] as const satisfies readonly DispatchNavItem[];\n\nconst EMPTY_NAV_ITEMS: readonly DispatchNavItem[] = [];\n\nconst SIDEBAR_SUGGESTIONS = [\n \"Create a new app\",\n \"Grant a key to an app\",\n \"Check integration health\",\n];\n\nconst CHROMELESS_PATHS = [\"/approval\"];\n\n// Routes whose page renders its own toolbar (with NotificationsBell + AgentToggleButton).\n// Layout still mounts the sidebar + AgentSidebar, but skips its own Header so\n// there's no double-header.\nfunction pageOwnsToolbar(pathname: string): boolean {\n if (pathname === \"/tools\" || pathname.startsWith(\"/tools/\")) return true;\n if (pathname === \"/extensions\" || pathname.startsWith(\"/extensions/\"))\n return true;\n return false;\n}\n\ninterface WorkspaceInfo {\n name: string | null;\n displayName: string | null;\n appCount: number;\n}\n\nfunction sectionFor(item: DispatchNavItem): DispatchNavSection {\n return item.section ?? \"operations\";\n}\n\nfunction navItemMatchesPath(item: DispatchNavItem, pathname: string): boolean {\n if (item.match) {\n try {\n if (item.match(pathname)) return true;\n } catch {\n return false;\n }\n }\n return pathname === item.to || pathname.startsWith(`${item.to}/`);\n}\n\nfunction navItemsForSection(\n items: readonly DispatchNavItem[],\n section: DispatchNavSection,\n): DispatchNavItem[] {\n return items.filter((item) => sectionFor(item) === section);\n}\n\nexport function NavContent({\n onNavigate,\n extensions,\n}: {\n onNavigate?: () => void;\n extensions?: DispatchExtensionConfig;\n}) {\n const location = useLocation();\n const { data: workspace } = useActionQuery(\n \"get-workspace-info\",\n {},\n { staleTime: 60_000 },\n );\n const ws = workspace as WorkspaceInfo | undefined;\n const workspaceLabel = ws?.displayName ?? ws?.name ?? null;\n const extensionNavItems = extensions?.navItems ?? EMPTY_NAV_ITEMS;\n const primaryNavItems = [\n ...PRIMARY_NAV_ITEMS,\n ...navItemsForSection(extensionNavItems, \"primary\"),\n ];\n const operationsNavItems = [\n ...OPERATIONS_NAV_ITEMS,\n ...navItemsForSection(extensionNavItems, \"operations\"),\n ];\n const operationsOpen = operationsNavItems.some((item) =>\n navItemMatchesPath(item, location.pathname),\n );\n\n const renderNavItem = (item: DispatchNavItem) => {\n const Icon = item.icon;\n return (\n <li key={item.id}>\n <NavLink\n to={item.to}\n onClick={onNavigate}\n className={({ isActive }) => {\n const active =\n isActive || navItemMatchesPath(item, location.pathname);\n return cn(\n \"flex h-8 w-full items-center gap-2 rounded-md px-2 text-sm\",\n active\n ? \"bg-sidebar-accent font-medium text-sidebar-accent-foreground\"\n : \"text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground\",\n );\n }}\n >\n {Icon ? (\n <Icon size={16} className=\"shrink-0\" />\n ) : (\n <span className=\"h-4 w-4 shrink-0\" aria-hidden=\"true\" />\n )}\n <span className=\"truncate\">{item.label}</span>\n </NavLink>\n </li>\n );\n };\n\n return (\n <>\n <div className=\"border-b px-4 py-3\">\n <div className=\"flex items-center gap-3\">\n <div className=\"flex h-9 w-9 items-center justify-center rounded-xl border bg-card text-foreground\">\n <img\n src={appPath(\"/agent-native-icon-light.svg\")}\n alt=\"\"\n aria-hidden=\"true\"\n className=\"block h-4 w-auto shrink-0 dark:hidden\"\n />\n <img\n src={appPath(\"/agent-native-icon-dark.svg\")}\n alt=\"\"\n aria-hidden=\"true\"\n className=\"hidden h-4 w-auto shrink-0 dark:block\"\n />\n </div>\n <div className=\"min-w-0\">\n <div className=\"truncate text-sm font-semibold text-foreground\">\n {workspaceLabel ?? \"Dispatch\"}\n </div>\n <div className=\"truncate text-xs text-muted-foreground\">\n {workspaceLabel\n ? `Workspace · ${ws?.appCount ?? 0} app${ws?.appCount === 1 ? \"\" : \"s\"}`\n : \"Workspace control plane\"}\n </div>\n </div>\n </div>\n </div>\n\n <nav className=\"flex-1 overflow-y-auto px-2 py-3\">\n <ul className=\"space-y-0.5\">{primaryNavItems.map(renderNavItem)}</ul>\n <details className=\"group mt-4\" open={operationsOpen}>\n <summary className=\"flex h-8 cursor-pointer list-none items-center justify-between rounded-md px-2 text-xs font-medium uppercase text-sidebar-foreground/50 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground [&::-webkit-details-marker]:hidden\">\n <span>Operations</span>\n <IconChevronDown\n size={14}\n className=\"transition-transform group-open:rotate-180\"\n />\n </summary>\n <ul className=\"mt-1 space-y-0.5\">\n {operationsNavItems.map(renderNavItem)}\n </ul>\n </details>\n </nav>\n\n <div className=\"border-t px-2 py-2\">\n <ToolsSidebarSection />\n <FeedbackButton />\n </div>\n </>\n );\n}\n\nexport function Layout({\n children,\n extensions,\n}: {\n children: ReactNode;\n extensions?: DispatchExtensionConfig;\n}) {\n const location = useLocation();\n const [mobileOpen, setMobileOpen] = useState(false);\n const hasEmbeddedAgentChat =\n location.pathname === \"/\" || location.pathname === \"/overview\";\n\n if (CHROMELESS_PATHS.some((path) => location.pathname === path)) {\n return <>{children}</>;\n }\n\n const showHeader = !pageOwnsToolbar(location.pathname);\n const appContent = (\n <div className=\"flex h-full flex-1 flex-col overflow-hidden\">\n {showHeader ? (\n <Header\n onOpenMobile={() => setMobileOpen(true)}\n showAgentToggle={!hasEmbeddedAgentChat}\n />\n ) : null}\n <InvitationBanner />\n <main className=\"flex-1 overflow-y-auto\">\n {showHeader ? (\n <div className=\"mx-auto max-w-7xl space-y-5 px-4 py-6 sm:px-6\">\n {children}\n </div>\n ) : (\n children\n )}\n </main>\n </div>\n );\n\n return (\n <HeaderActionsProvider>\n <div className=\"flex h-screen w-full overflow-hidden bg-background\">\n <aside className=\"hidden 2xl:flex w-64 shrink-0 flex-col border-r bg-sidebar text-sidebar-foreground\">\n <NavContent extensions={extensions} />\n </aside>\n\n <Sheet open={mobileOpen} onOpenChange={setMobileOpen}>\n <SheetContent\n side=\"left\"\n className=\"w-72 p-0 bg-sidebar text-sidebar-foreground [&>button]:hidden\"\n >\n <SheetTitle className=\"sr-only\">Navigation</SheetTitle>\n <SheetDescription className=\"sr-only\">\n Workspace navigation links\n </SheetDescription>\n <div className=\"flex h-full w-full flex-col\">\n <NavContent\n extensions={extensions}\n onNavigate={() => setMobileOpen(false)}\n />\n </div>\n </SheetContent>\n </Sheet>\n\n {/*\n * Always mount AgentSidebar so home composer's sendToAgentChat\n * fallback can pop it via agent-panel:open. The toggle button stays\n * hidden on overview because the home composer is the primary input.\n */}\n <AgentSidebar\n position=\"right\"\n defaultOpen={false}\n emptyStateText=\"Create apps, grant keys, and route work across the workspace.\"\n suggestions={SIDEBAR_SUGGESTIONS}\n >\n {appContent}\n </AgentSidebar>\n </div>\n </HeaderActionsProvider>\n );\n}\n"]}
@@ -2,10 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
2
2
  import { useEffect, useMemo, useState } from "react";
3
3
  import { toast } from "sonner";
4
4
  import { IconBrandSlack, IconBrandTelegram, IconBrandWhatsapp, IconCheck, IconChevronRight, IconCopy, IconExternalLink, IconInfoCircle, IconLoader2, IconMail, } from "@tabler/icons-react";
5
- import { Button } from "../components/ui/button";
6
- import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from "../components/ui/collapsible";
7
- import { Input } from "../components/ui/input";
8
- import { Tooltip, TooltipContent, TooltipTrigger, } from "../components/ui/tooltip";
5
+ import { Button } from "../components/ui/button.js";
6
+ import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from "../components/ui/collapsible.js";
7
+ import { Input } from "../components/ui/input.js";
8
+ import { Tooltip, TooltipContent, TooltipTrigger, } from "../components/ui/tooltip.js";
9
9
  import { agentNativePath } from "@agent-native/core/client";
10
10
  const PLATFORM_DEFINITIONS = [
11
11
  {
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import * as AccordionPrimitive from "@radix-ui/react-accordion";
4
4
  import { IconChevronDown } from "@tabler/icons-react";
5
- import { cn } from "../../lib/utils";
5
+ import { cn } from "../../lib/utils.js";
6
6
  const Accordion = AccordionPrimitive.Root;
7
7
  const AccordionItem = React.forwardRef(({ className, ...props }, ref) => (_jsx(AccordionPrimitive.Item, { ref: ref, className: cn("border-b", className), ...props })));
8
8
  AccordionItem.displayName = "AccordionItem";
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
4
- import { cn } from "../../lib/utils";
5
- import { buttonVariants } from "../../components/ui/button";
4
+ import { cn } from "../../lib/utils.js";
5
+ import { buttonVariants } from "../../components/ui/button.js";
6
6
  const AlertDialog = AlertDialogPrimitive.Root;
7
7
  const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
8
8
  const AlertDialogPortal = AlertDialogPrimitive.Portal;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import { cva } from "class-variance-authority";
4
- import { cn } from "../../lib/utils";
4
+ import { cn } from "../../lib/utils.js";
5
5
  const alertVariants = cva("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground", {
6
6
  variants: {
7
7
  variant: {
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import * as AvatarPrimitive from "@radix-ui/react-avatar";
4
- import { cn } from "../../lib/utils";
4
+ import { cn } from "../../lib/utils.js";
5
5
  const Avatar = React.forwardRef(({ className, ...props }, ref) => (_jsx(AvatarPrimitive.Root, { ref: ref, className: cn("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", className), ...props })));
6
6
  Avatar.displayName = AvatarPrimitive.Root.displayName;
7
7
  const AvatarImage = React.forwardRef(({ className, ...props }, ref) => (_jsx(AvatarPrimitive.Image, { ref: ref, className: cn("aspect-square h-full w-full", className), ...props })));
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { cva } from "class-variance-authority";
3
- import { cn } from "../../lib/utils";
3
+ import { cn } from "../../lib/utils.js";
4
4
  const badgeVariants = cva("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", {
5
5
  variants: {
6
6
  variant: {
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import { Slot } from "@radix-ui/react-slot";
4
4
  import { IconChevronRight, IconDots } from "@tabler/icons-react";
5
- import { cn } from "../../lib/utils";
5
+ import { cn } from "../../lib/utils.js";
6
6
  const Breadcrumb = React.forwardRef(({ ...props }, ref) => _jsx("nav", { ref: ref, "aria-label": "breadcrumb", ...props }));
7
7
  Breadcrumb.displayName = "Breadcrumb";
8
8
  const BreadcrumbList = React.forwardRef(({ className, ...props }, ref) => (_jsx("ol", { ref: ref, className: cn("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5", className), ...props })));
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import { Slot } from "@radix-ui/react-slot";
4
4
  import { cva } from "class-variance-authority";
5
- import { cn } from "../../lib/utils";
5
+ import { cn } from "../../lib/utils.js";
6
6
  const buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", {
7
7
  variants: {
8
8
  variant: {
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { IconChevronLeft, IconChevronRight } from "@tabler/icons-react";
3
3
  import { DayPicker } from "react-day-picker";
4
- import { cn } from "../../lib/utils";
5
- import { buttonVariants } from "../../components/ui/button";
4
+ import { cn } from "../../lib/utils.js";
5
+ import { buttonVariants } from "../../components/ui/button.js";
6
6
  function Calendar({ className, classNames, showOutsideDays = true, ...props }) {
7
7
  return (_jsx(DayPicker, { showOutsideDays: showOutsideDays, className: cn("p-3", className), classNames: {
8
8
  months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
- import { cn } from "../../lib/utils";
3
+ import { cn } from "../../lib/utils.js";
4
4
  const Card = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("rounded-lg border bg-card text-card-foreground shadow-sm", className), ...props })));
5
5
  Card.displayName = "Card";
6
6
  const CardHeader = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("flex flex-col space-y-1.5 p-6", className), ...props })));
@@ -13,7 +13,7 @@ type CarouselProps = {
13
13
  declare const Carousel: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & CarouselProps & React.RefAttributes<HTMLDivElement>>;
14
14
  declare const CarouselContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
15
15
  declare const CarouselItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
16
- declare const CarouselPrevious: React.ForwardRefExoticComponent<Omit<import("../../components/ui/button").ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
17
- declare const CarouselNext: React.ForwardRefExoticComponent<Omit<import("../../components/ui/button").ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
16
+ declare const CarouselPrevious: React.ForwardRefExoticComponent<Omit<import("../../components/ui/button.js").ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
17
+ declare const CarouselNext: React.ForwardRefExoticComponent<Omit<import("../../components/ui/button.js").ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
18
18
  export { type CarouselApi, Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, };
19
19
  //# sourceMappingURL=carousel.d.ts.map
@@ -2,8 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import useEmblaCarousel from "embla-carousel-react";
4
4
  import { IconArrowLeft, IconArrowRight } from "@tabler/icons-react";
5
- import { cn } from "../../lib/utils";
6
- import { Button } from "../../components/ui/button";
5
+ import { cn } from "../../lib/utils.js";
6
+ import { Button } from "../../components/ui/button.js";
7
7
  const CarouselContext = React.createContext(null);
8
8
  function useCarousel() {
9
9
  const context = React.useContext(CarouselContext);
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import * as RechartsPrimitive from "recharts";
4
- import { cn } from "../../lib/utils";
4
+ import { cn } from "../../lib/utils.js";
5
5
  // Format: { THEME_NAME: CSS_SELECTOR }
6
6
  const THEMES = { light: "", dark: ".dark" };
7
7
  const ChartContext = React.createContext(null);
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
4
4
  import { IconCheck } from "@tabler/icons-react";
5
- import { cn } from "../../lib/utils";
5
+ import { cn } from "../../lib/utils.js";
6
6
  const Checkbox = React.forwardRef(({ className, ...props }, ref) => (_jsx(CheckboxPrimitive.Root, { ref: ref, className: cn("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground", className), ...props, children: _jsx(CheckboxPrimitive.Indicator, { className: cn("flex items-center justify-center text-current"), children: _jsx(IconCheck, { className: "h-4 w-4" }) }) })));
7
7
  Checkbox.displayName = CheckboxPrimitive.Root.displayName;
8
8
  export { Checkbox };
@@ -2,8 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import { Command as CommandPrimitive } from "cmdk";
4
4
  import { IconSearch } from "@tabler/icons-react";
5
- import { cn } from "../../lib/utils";
6
- import { Dialog, DialogContent, DialogTitle } from "../../components/ui/dialog";
5
+ import { cn } from "../../lib/utils.js";
6
+ import { Dialog, DialogContent, DialogTitle } from "../../components/ui/dialog.js";
7
7
  const Command = React.forwardRef(({ className, ...props }, ref) => (_jsx(CommandPrimitive, { ref: ref, className: cn("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground", className), ...props })));
8
8
  Command.displayName = CommandPrimitive.displayName;
9
9
  const CommandDialog = ({ children, ...props }) => {
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
4
4
  import { IconCheck, IconChevronRight, IconCircle } from "@tabler/icons-react";
5
- import { cn } from "../../lib/utils";
5
+ import { cn } from "../../lib/utils.js";
6
6
  const ContextMenu = ContextMenuPrimitive.Root;
7
7
  const ContextMenuTrigger = ContextMenuPrimitive.Trigger;
8
8
  const ContextMenuGroup = ContextMenuPrimitive.Group;
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import * as DialogPrimitive from "@radix-ui/react-dialog";
4
4
  import { IconX } from "@tabler/icons-react";
5
- import { cn } from "../../lib/utils";
5
+ import { cn } from "../../lib/utils.js";
6
6
  const Dialog = DialogPrimitive.Root;
7
7
  const DialogTrigger = DialogPrimitive.Trigger;
8
8
  const DialogPortal = DialogPrimitive.Portal;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import { Drawer as DrawerPrimitive } from "vaul";
4
- import { cn } from "../../lib/utils";
4
+ import { cn } from "../../lib/utils.js";
5
5
  const Drawer = ({ shouldScaleBackground = true, ...props }) => (_jsx(DrawerPrimitive.Root, { shouldScaleBackground: shouldScaleBackground, ...props }));
6
6
  Drawer.displayName = "Drawer";
7
7
  const DrawerTrigger = DrawerPrimitive.Trigger;
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
4
4
  import { IconCheck, IconChevronRight, IconCircle } from "@tabler/icons-react";
5
- import { cn } from "../../lib/utils";
5
+ import { cn } from "../../lib/utils.js";
6
6
  const DropdownMenu = DropdownMenuPrimitive.Root;
7
7
  const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
8
8
  const DropdownMenuGroup = DropdownMenuPrimitive.Group;
@@ -2,8 +2,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import { Slot } from "@radix-ui/react-slot";
4
4
  import { Controller, FormProvider, useFormContext, } from "react-hook-form";
5
- import { cn } from "../../lib/utils";
6
- import { Label } from "../../components/ui/label";
5
+ import { cn } from "../../lib/utils.js";
6
+ import { Label } from "../../components/ui/label.js";
7
7
  const Form = FormProvider;
8
8
  const FormFieldContext = React.createContext({});
9
9
  const FormField = ({ ...props }) => {
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
4
- import { cn } from "../../lib/utils";
4
+ import { cn } from "../../lib/utils.js";
5
5
  const HoverCard = HoverCardPrimitive.Root;
6
6
  const HoverCardTrigger = HoverCardPrimitive.Trigger;
7
7
  const HoverCardContent = React.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => (_jsx(HoverCardPrimitive.Content, { ref: ref, align: align, sideOffset: sideOffset, className: cn("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className), ...props })));
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import { OTPInput, OTPInputContext } from "input-otp";
4
4
  import { IconPoint } from "@tabler/icons-react";
5
- import { cn } from "../../lib/utils";
5
+ import { cn } from "../../lib/utils.js";
6
6
  const InputOTP = React.forwardRef(({ className, containerClassName, ...props }, ref) => (_jsx(OTPInput, { ref: ref, containerClassName: cn("flex items-center gap-2 has-[:disabled]:opacity-50", containerClassName), className: cn("disabled:cursor-not-allowed", className), ...props })));
7
7
  InputOTP.displayName = "InputOTP";
8
8
  const InputOTPGroup = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("flex items-center", className), ...props })));
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
- import { cn } from "../../lib/utils";
3
+ import { cn } from "../../lib/utils.js";
4
4
  const Input = React.forwardRef(({ className, type, ...props }, ref) => {
5
5
  return (_jsx("input", { type: type, className: cn("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", className), ref: ref, ...props }));
6
6
  });
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import * as LabelPrimitive from "@radix-ui/react-label";
4
4
  import { cva } from "class-variance-authority";
5
- import { cn } from "../../lib/utils";
5
+ import { cn } from "../../lib/utils.js";
6
6
  const labelVariants = cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70");
7
7
  const Label = React.forwardRef(({ className, ...props }, ref) => (_jsx(LabelPrimitive.Root, { ref: ref, className: cn(labelVariants(), className), ...props })));
8
8
  Label.displayName = LabelPrimitive.Root.displayName;
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import * as MenubarPrimitive from "@radix-ui/react-menubar";
4
4
  import { IconCheck, IconChevronRight, IconCircle } from "@tabler/icons-react";
5
- import { cn } from "../../lib/utils";
5
+ import { cn } from "../../lib/utils.js";
6
6
  // Explicit type annotations needed because TS can't generate portable .d.ts
7
7
  // declarations for these without referencing internal Radix types from a
8
8
  // hoisted pnpm path. Casting to React.FC<any> erases the prop types from the
@@ -3,7 +3,7 @@ import * as React from "react";
3
3
  import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
4
4
  import { cva } from "class-variance-authority";
5
5
  import { IconChevronDown } from "@tabler/icons-react";
6
- import { cn } from "../../lib/utils";
6
+ import { cn } from "../../lib/utils.js";
7
7
  const NavigationMenu = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(NavigationMenuPrimitive.Root, { ref: ref, className: cn("relative z-10 flex max-w-max flex-1 items-center justify-center", className), ...props, children: [children, _jsx(NavigationMenuViewport, {})] })));
8
8
  NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;
9
9
  const NavigationMenuList = React.forwardRef(({ className, ...props }, ref) => (_jsx(NavigationMenuPrimitive.List, { ref: ref, className: cn("group flex flex-1 list-none items-center justify-center space-x-1", className), ...props })));
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { ButtonProps } from "../../components/ui/button";
2
+ import { ButtonProps } from "../../components/ui/button.js";
3
3
  declare const Pagination: {
4
4
  ({ className, ...props }: React.ComponentProps<"nav">): import("react/jsx-runtime").JSX.Element;
5
5
  displayName: string;
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import { IconChevronLeft, IconChevronRight, IconDots, } from "@tabler/icons-react";
4
- import { cn } from "../../lib/utils";
5
- import { buttonVariants } from "../../components/ui/button";
4
+ import { cn } from "../../lib/utils.js";
5
+ import { buttonVariants } from "../../components/ui/button.js";
6
6
  const Pagination = ({ className, ...props }) => (_jsx("nav", { role: "navigation", "aria-label": "pagination", className: cn("mx-auto flex w-full justify-center", className), ...props }));
7
7
  Pagination.displayName = "Pagination";
8
8
  const PaginationContent = React.forwardRef(({ className, ...props }, ref) => (_jsx("ul", { ref: ref, className: cn("flex flex-row items-center gap-1", className), ...props })));