@lunora/studio 1.0.0-alpha.5 → 1.0.0-alpha.51

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 (198) hide show
  1. package/LICENSE.md +6 -0
  2. package/__assets__/package-og.svg +1 -1
  3. package/dist/index.d.ts +45 -23
  4. package/dist/index.js +31 -31
  5. package/dist/mount.d.ts +1 -1
  6. package/dist/mount.js +3 -2
  7. package/dist/{packem_shared/ApiTab-W3no0KOj.js → packem_chunks/ApiTab.js} +5 -5
  8. package/dist/{packem_shared/AuditPanel-Bq4o_IqT.js → packem_chunks/AuditPanel.js} +29 -41
  9. package/dist/{packem_shared/ExportImportPanel-dxY56TDF.js → packem_chunks/ExportImportPanel.js} +16 -11
  10. package/dist/{packem_shared/FileBrowser-Dhy4zES8.js → packem_chunks/FileBrowser.js} +55 -32
  11. package/dist/{packem_shared/FunctionRunner--fQJRPAD.js → packem_chunks/FunctionRunner.js} +15 -32
  12. package/dist/{packem_shared/FunctionStatsPanel-BjRUA_G3.js → packem_chunks/FunctionStatsPanel.js} +153 -208
  13. package/dist/{packem_shared/HealthPanel-PxclMWmA.js → packem_chunks/HealthPanel.js} +37 -29
  14. package/dist/{packem_shared/InsightsPanel-CWS_C-xW.js → packem_chunks/InsightsPanel.js} +108 -69
  15. package/dist/{packem_shared/LogsPanel-CTW8CFcM.js → packem_chunks/LogsPanel.js} +46 -58
  16. package/dist/{packem_shared/MailPanel-BwkvfIHF.js → packem_chunks/MailPanel.js} +45 -139
  17. package/dist/{packem_shared/MetricsPanel-BLuOhZQ4.js → packem_chunks/MetricsPanel.js} +41 -322
  18. package/dist/{packem_shared/MigrationsPanel-DT3lnwHF.js → packem_chunks/MigrationsPanel.js} +44 -51
  19. package/dist/{packem_shared/PitrPanel-CdErL7EJ.js → packem_chunks/PitrPanel.js} +9 -9
  20. package/dist/{packem_shared/SchemaViewer-LJDcmNIO.js → packem_chunks/SchemaViewer.js} +17 -16
  21. package/dist/{packem_shared/SecurityAdvisorPanel-C_ETsPih.js → packem_chunks/SecurityAdvisorPanel.js} +47 -31
  22. package/dist/packem_chunks/SettingsPanel.js +391 -0
  23. package/dist/{packem_shared/sql-editor-panel-BFRpzj6r.js → packem_chunks/SqlEditorPanel.js} +179 -401
  24. package/dist/{packem_shared/TableEditor-ChfUOZec.js → packem_chunks/TableEditor.js} +13 -94
  25. package/dist/packem_chunks/agents-panel.js +326 -0
  26. package/dist/packem_chunks/analytics-panel.js +261 -0
  27. package/dist/packem_chunks/auth-config-panel.js +365 -0
  28. package/dist/packem_chunks/auth-sessions-panel.js +175 -0
  29. package/dist/packem_chunks/containers-panel.js +261 -0
  30. package/dist/packem_chunks/dashboards-panel.js +781 -0
  31. package/dist/packem_chunks/fanout-panel.js +482 -0
  32. package/dist/packem_chunks/flags-panel.js +176 -0
  33. package/dist/packem_chunks/issues-panel.js +188 -0
  34. package/dist/packem_chunks/kv-browser.js +1896 -0
  35. package/dist/packem_chunks/log-drains-panel.js +273 -0
  36. package/dist/packem_chunks/organizations-panel.js +3178 -0
  37. package/dist/packem_chunks/payments-panel.js +186 -0
  38. package/dist/packem_chunks/permissions-panel.js +805 -0
  39. package/dist/packem_chunks/queues-panel.js +1075 -0
  40. package/dist/packem_chunks/rls-panel.js +315 -0
  41. package/dist/packem_chunks/schedule-panel.js +831 -0
  42. package/dist/packem_chunks/sparkline.js +79 -0
  43. package/dist/packem_chunks/storage-rules-panel.js +140 -0
  44. package/dist/packem_chunks/subscriptions-panel.js +238 -0
  45. package/dist/packem_chunks/users-panel.js +1731 -0
  46. package/dist/packem_chunks/vector-browser.js +281 -0
  47. package/dist/packem_chunks/workflows-panel.js +562 -0
  48. package/dist/packem_shared/{ADMIN_FUNCTIONS-DmBqMZ-z.js → ADMIN_FUNCTIONS-DNeyYtUN.js} +8 -0
  49. package/dist/packem_shared/{ApiDocsPanel-C5-yJ1p7.js → ApiDocsPanel-_aEZxAMX.js} +2 -2
  50. package/dist/packem_shared/{ApiReferencePanel-1vubqG5s.js → ApiReferencePanel-Dd8pcswz.js} +2 -1
  51. package/dist/packem_shared/{CommandPalette-BtgkBzZI.js → CommandPalette-BXV4eKf5.js} +1 -1
  52. package/dist/packem_shared/{DataBrowser-CtBe1So9.js → DataBrowser-C8hejnub.js} +201 -250
  53. package/dist/packem_shared/{DataFilters-FNquMaiu.js → DataFilters-B1Q7mrt7.js} +6 -2
  54. package/dist/packem_shared/{GlobalDataBrowser-BTEmGrph.js → GlobalDataBrowser-f5Ll2AQK.js} +43 -68
  55. package/dist/packem_shared/HomePanel-Ye8PaqQL.js +14 -0
  56. package/dist/packem_shared/{OpenRpcReferencePanel-vbcYbv3V.js → OpenRpcReferencePanel-CWaf0ZtX.js} +2 -1
  57. package/dist/packem_shared/{ScheduledJobs-CabfKbyM.js → ScheduledJobs-dHMgnJbx.js} +163 -60
  58. package/dist/packem_shared/{ShardInput-gx_DZXXn.js → ShardInput-CZnpHILL.js} +1 -1
  59. package/dist/packem_shared/Studio-BNGjxLVo.js +16 -0
  60. package/dist/packem_shared/{StudioApp-D4azxYBu.js → StudioApp-K9dn1Q9d.js} +75 -24
  61. package/dist/packem_shared/{advisor-view-CGcfMiPq.js → advisor-view-Cx21PS_T.js} +6 -6
  62. package/dist/packem_shared/alert-CdAET2K_.js +68 -0
  63. package/dist/packem_shared/{app.d-CCmwDEVs.d.ts → app.d-CGdOmLTm.d.ts} +1 -1
  64. package/dist/packem_shared/{bar-chart-CzJAgqkp.js → bar-chart-DSwcWIRy.js} +5 -4
  65. package/dist/packem_shared/browser-storage-L4gOP5gJ.js +105 -0
  66. package/dist/packem_shared/{cf-links-2cktDedA.js → cf-links-BZfRdxSE.js} +1 -1
  67. package/dist/packem_shared/{data-grid-B5CaV3wS.js → data-grid-C9I16KWr.js} +1 -1
  68. package/dist/packem_shared/data-view-params-Cd6yRVbv.js +96 -0
  69. package/dist/packem_shared/error-alert-vIPQoN3Y.js +114 -0
  70. package/dist/packem_shared/{grid-features-CzUfqgsM.js → grid-features-B_fZH4iQ.js} +133 -164
  71. package/dist/packem_shared/home-panel-D62G8108.js +1889 -0
  72. package/dist/packem_shared/internal-zwBoOv24.js +122 -0
  73. package/dist/packem_shared/modal-shell-hyaJvIJ6.js +100 -0
  74. package/dist/packem_shared/{reference-view-B4E49Lip.js → reference-view-DUULLuOi.js} +8 -61
  75. package/dist/packem_shared/result-chart-DZradBAS.js +119 -0
  76. package/dist/packem_shared/scroll-area-DLhcy-ml.js +93 -0
  77. package/dist/packem_shared/select-UkNYCT3s.js +273 -0
  78. package/dist/packem_shared/shard-history-AxiJ1WPP.js +16 -0
  79. package/dist/packem_shared/skeleton-CGhL0p20.js +45 -0
  80. package/dist/packem_shared/{sparkline-10dG-_f0.js → sparkline-BnA1kC9X.js} +1 -1
  81. package/dist/packem_shared/studio-Cd21fp4v.js +4090 -0
  82. package/dist/packem_shared/{table-_RzNvy3R.js → table-DsCa9Qp9.js} +1 -1
  83. package/dist/packem_shared/{table-list-sidebar-Bg7uzbvC.js → table-list-sidebar-huX4VmgI.js} +19 -9
  84. package/dist/packem_shared/use-admin-query-BGJ010yZ.js +106 -0
  85. package/dist/packem_shared/use-async-submit-DGCtuDyz.js +91 -0
  86. package/dist/standalone/chunk-22C6COGE.js +13 -0
  87. package/dist/standalone/chunk-2K47A3P6.js +1 -0
  88. package/dist/standalone/chunk-2MLA6WFH.js +1 -0
  89. package/dist/standalone/chunk-2NGUNNGW.js +1 -0
  90. package/dist/standalone/chunk-2ZL6MXBC.js +4 -0
  91. package/dist/standalone/chunk-3GXGLNKW.js +1 -0
  92. package/dist/standalone/chunk-3OA7PECS.js +6 -0
  93. package/dist/standalone/chunk-4PC7IXNY.js +1 -0
  94. package/dist/standalone/chunk-4QA5TWYJ.js +1 -0
  95. package/dist/standalone/chunk-4QHKBC77.js +1 -0
  96. package/dist/standalone/chunk-5OIBXYZM.js +1 -0
  97. package/dist/standalone/chunk-6TYT447C.js +1 -0
  98. package/dist/standalone/chunk-7SN6J4DZ.js +1 -0
  99. package/dist/standalone/chunk-7TJJXVSE.js +1 -0
  100. package/dist/standalone/chunk-A3ZJACVT.js +4 -0
  101. package/dist/standalone/chunk-AHILM3ZP.js +1 -0
  102. package/dist/standalone/chunk-AITOCPML.js +1 -0
  103. package/dist/standalone/chunk-AJ2B326V.js +1 -0
  104. package/dist/standalone/chunk-APSSZB6Z.js +1 -0
  105. package/dist/standalone/chunk-AVONJCNY.js +4 -0
  106. package/dist/standalone/chunk-BE24FXAK.js +1 -0
  107. package/dist/standalone/chunk-BJGBHGK3.js +1 -0
  108. package/dist/standalone/chunk-CKSHCYGC.js +2 -0
  109. package/dist/standalone/chunk-CP2EQVLU.js +1 -0
  110. package/dist/standalone/chunk-DTPFXYHG.js +1 -0
  111. package/dist/standalone/chunk-DWDILV2E.js +1 -0
  112. package/dist/standalone/chunk-E3FVNRH7.js +1 -0
  113. package/dist/standalone/chunk-EEWKIQUE.js +1 -0
  114. package/dist/standalone/chunk-EOE5NDMK.js +1 -0
  115. package/dist/standalone/chunk-FJV4UNYY.js +1 -0
  116. package/dist/standalone/chunk-FWTZYHX4.js +1 -0
  117. package/dist/standalone/chunk-G465LTLD.js +1 -0
  118. package/dist/standalone/chunk-G6URLCRC.js +3 -0
  119. package/dist/standalone/chunk-G7ZBM54M.js +1 -0
  120. package/dist/standalone/chunk-GTM65MVX.js +1 -0
  121. package/dist/standalone/chunk-HV7G6DFP.js +5 -0
  122. package/dist/standalone/chunk-IMZKGRPW.js +1 -0
  123. package/dist/standalone/chunk-ITQKVEP7.js +19 -0
  124. package/dist/standalone/chunk-IZN4TYMN.js +1 -0
  125. package/dist/standalone/chunk-J6J54MBP.js +1 -0
  126. package/dist/standalone/chunk-JM7XBQVK.js +1 -0
  127. package/dist/standalone/chunk-JPILGFXT.js +1 -0
  128. package/dist/standalone/chunk-JSEXCW5Q.js +1 -0
  129. package/dist/standalone/chunk-KDZJ5A3R.js +1 -0
  130. package/dist/standalone/chunk-KEGAWN6Y.js +1 -0
  131. package/dist/standalone/chunk-KGQGNJJ2.js +1 -0
  132. package/dist/standalone/chunk-KJJ3WM6H.js +4 -0
  133. package/dist/standalone/chunk-KKJZL75J.js +1 -0
  134. package/dist/standalone/chunk-KZ6INM5M.js +1 -0
  135. package/dist/standalone/chunk-L2YBC2BV.js +11 -0
  136. package/dist/standalone/chunk-L7SK4ZZD.js +1 -0
  137. package/dist/standalone/chunk-LAK5VSPI.js +1 -0
  138. package/dist/standalone/chunk-LDEVBRDZ.js +1 -0
  139. package/dist/standalone/chunk-LUP4YTBS.js +1 -0
  140. package/dist/standalone/chunk-LVH4KLXS.js +13 -0
  141. package/dist/standalone/chunk-MDTNVR3G.js +1 -0
  142. package/dist/standalone/chunk-N4NG7HGI.js +1 -0
  143. package/dist/standalone/chunk-O3NAGRTR.js +1 -0
  144. package/dist/standalone/chunk-ONSKQCYN.js +3 -0
  145. package/dist/standalone/chunk-OQE56NBE.js +1 -0
  146. package/dist/standalone/chunk-OSPEOESV.js +8 -0
  147. package/dist/standalone/chunk-Q7PYLDZU.js +1 -0
  148. package/dist/standalone/chunk-Q7TKOAGT.js +1 -0
  149. package/dist/standalone/chunk-QAFAJBAW.js +1 -0
  150. package/dist/standalone/chunk-RRCPZMC2.js +22 -0
  151. package/dist/standalone/chunk-RXVQJ4DO.js +1 -0
  152. package/dist/standalone/chunk-S5NTGHCG.js +1 -0
  153. package/dist/standalone/chunk-SDQE2IUJ.js +1 -0
  154. package/dist/standalone/chunk-SEU5V7I6.js +1 -0
  155. package/dist/standalone/chunk-SHERR7ZP.js +1 -0
  156. package/dist/standalone/chunk-T3UCZ5PJ.js +1 -0
  157. package/dist/standalone/chunk-TAD43CG5.js +1 -0
  158. package/dist/standalone/chunk-TAQM5WML.js +1 -0
  159. package/dist/standalone/chunk-TO6D2PJC.js +6 -0
  160. package/dist/standalone/chunk-TQ36RWOP.js +1 -0
  161. package/dist/standalone/chunk-TSLR3ZU2.js +1 -0
  162. package/dist/standalone/chunk-UK64ZSUW.js +1 -0
  163. package/dist/standalone/chunk-UX53GWGU.js +1 -0
  164. package/dist/standalone/chunk-V43BLH4J.js +1 -0
  165. package/dist/standalone/chunk-VC5RNEHU.js +1 -0
  166. package/dist/standalone/chunk-VL23Y44O.js +4 -0
  167. package/dist/standalone/chunk-VLIRTNLA.js +4 -0
  168. package/dist/standalone/chunk-VLXV72QE.js +1 -0
  169. package/dist/standalone/chunk-VN2PDOMK.js +1 -0
  170. package/dist/standalone/chunk-VZFJI6XE.js +1 -0
  171. package/dist/standalone/chunk-W6JKUZKD.js +1 -0
  172. package/dist/standalone/chunk-WI7GWFEG.js +1 -0
  173. package/dist/standalone/chunk-WJ6OBCUM.js +1 -0
  174. package/dist/standalone/chunk-WUFVFVHJ.js +1 -0
  175. package/dist/standalone/chunk-WVTPZ6CM.js +1 -0
  176. package/dist/standalone/chunk-X4QFAAZ5.js +76 -0
  177. package/dist/standalone/chunk-XNJNSCLM.js +1 -0
  178. package/dist/standalone/chunk-XOANGJJP.js +1 -0
  179. package/dist/standalone/chunk-YA6POZJD.js +1 -0
  180. package/dist/standalone/chunk-ZECNJ4FG.js +1 -0
  181. package/dist/standalone/chunk-ZETIKSQJ.js +1 -0
  182. package/dist/standalone/chunk-ZHVTQ37P.js +1 -0
  183. package/dist/standalone/chunk-ZIGWVHCS.js +1 -0
  184. package/dist/standalone/chunk-ZPP2KOR4.js +1 -0
  185. package/dist/standalone/chunk-ZPUO7FNI.js +1 -0
  186. package/dist/standalone/chunk-ZZMGCPXE.js +2 -0
  187. package/dist/standalone/studio.js +104 -246
  188. package/dist/styles.css +2 -2
  189. package/package.json +17 -15
  190. package/dist/packem_shared/HomePanel-Cw16stjq.js +0 -1273
  191. package/dist/packem_shared/SettingsPanel-C0uLRf5P.js +0 -176
  192. package/dist/packem_shared/SqlEditorPanel-CguV7otm.js +0 -13
  193. package/dist/packem_shared/Studio-BmSGSIuY.js +0 -33
  194. package/dist/packem_shared/internal-rXJEAhXS.js +0 -68
  195. package/dist/packem_shared/shard-history-DyebH1R5.js +0 -38
  196. package/dist/packem_shared/studio-H9fuQgSj.js +0 -10303
  197. package/dist/packem_shared/use-live-admin-Dq6g3daN.js +0 -73
  198. package/dist/packem_shared/use-live-shard-seed-Cuk3dnH0.js +0 -76
@@ -0,0 +1,4090 @@
1
+ 'use client';
2
+ import { c } from 'react/compiler-runtime';
3
+ import { createRootRoute, createRoute, createBrowserHistory, createMemoryHistory, createRouter, useNavigate, useRouterState, useSearch, Outlet, RouterProvider } from '@tanstack/react-router';
4
+ import * as React from 'react';
5
+ import { use, createContext, useState, useEffect, lazy, Suspense } from 'react';
6
+ import { c as cn } from './utils-B05Dmz_H.js';
7
+ import { jsxDEV, Fragment } from 'react/jsx-dev-runtime';
8
+ import { ErrorBoundary } from './ErrorBoundary-BzAApI7J.js';
9
+ import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
10
+ import { LunoraError } from '@lunora/errors';
11
+ import { motion } from 'motion/react';
12
+ import { B as Badge } from './badge-B2PKA1-5.js';
13
+ import { I as Input } from './input-XH4r1Pt1.js';
14
+ import { Popover as Popover$1 } from '@base-ui/react/popover';
15
+ import { Cancel01Icon, SidebarLeftIcon } from '@hugeicons/core-free-icons';
16
+ import { HugeiconsIcon } from '@hugeicons/react';
17
+ import { mergeProps } from '@base-ui/react/merge-props';
18
+ import { useRender } from '@base-ui/react/use-render';
19
+ import { cva } from 'class-variance-authority';
20
+ import { B as Button } from './button-BhsN2uZH.js';
21
+ import { Dialog } from '@base-ui/react/dialog';
22
+ import { Tooltip as Tooltip$1 } from '@base-ui/react/tooltip';
23
+ import { S as Skeleton } from './skeleton-CGhL0p20.js';
24
+ import { u as useStudioFeatures, H as HomePanel } from './home-panel-D62G8108.js';
25
+ import { StudioI18nProvider } from './StudioI18nProvider-B-tDCZIi.js';
26
+ import { v as validateDataViewSearch } from './data-view-params-Cd6yRVbv.js';
27
+ import { f as fireAndForget } from './internal-zwBoOv24.js';
28
+ import { CommandPalette, openCommandPalette } from './CommandPalette-BXV4eKf5.js';
29
+
30
+ const DARK_MEDIA_QUERY = "(prefers-color-scheme: dark)";
31
+ const store = () => {
32
+ try {
33
+ return globalThis.localStorage;
34
+ } catch {
35
+ return void 0;
36
+ }
37
+ };
38
+ const isPreference = (value) => value === "system" || value === "light" || value === "dark";
39
+ const matchMedia = () => globalThis.matchMedia;
40
+ const THEME_STORAGE_KEY = "lunora-studio-theme";
41
+ const THEME_ORDER = ["system", "light", "dark"];
42
+ const loadThemePreference = (fallback = "system") => {
43
+ try {
44
+ const raw = store()?.getItem(THEME_STORAGE_KEY);
45
+ return isPreference(raw) ? raw : fallback;
46
+ } catch {
47
+ return fallback;
48
+ }
49
+ };
50
+ const saveThemePreference = (preference) => {
51
+ const storage = store();
52
+ if (storage === void 0) {
53
+ return;
54
+ }
55
+ try {
56
+ storage.setItem(THEME_STORAGE_KEY, preference);
57
+ } catch {
58
+ }
59
+ };
60
+ const getSystemTheme = () => {
61
+ try {
62
+ return matchMedia()?.(DARK_MEDIA_QUERY).matches ? "dark" : "light";
63
+ } catch {
64
+ return "light";
65
+ }
66
+ };
67
+ const resolveTheme = (preference, system) => preference === "system" ? system : preference;
68
+ const subscribeSystemTheme = (onChange) => {
69
+ let mql;
70
+ try {
71
+ mql = matchMedia()?.(DARK_MEDIA_QUERY);
72
+ } catch {
73
+ mql = void 0;
74
+ }
75
+ if (mql === void 0) {
76
+ return () => {
77
+ };
78
+ }
79
+ const handler = (event) => {
80
+ onChange(event.matches ? "dark" : "light");
81
+ };
82
+ mql.addEventListener("change", handler);
83
+ return () => {
84
+ mql.removeEventListener("change", handler);
85
+ };
86
+ };
87
+
88
+ const ThemeContext = /* @__PURE__ */ createContext(null);
89
+ const ThemeProvider = ({
90
+ children,
91
+ defaultTheme = "system"
92
+ }) => {
93
+ const [theme, setThemeState] = useState(() => loadThemePreference(defaultTheme));
94
+ const [systemTheme, setSystemTheme] = useState(() => getSystemTheme());
95
+ useEffect(() => subscribeSystemTheme(setSystemTheme), []);
96
+ const setTheme = (next) => {
97
+ saveThemePreference(next);
98
+ setThemeState(next);
99
+ };
100
+ const cycleTheme = () => {
101
+ setThemeState((current) => {
102
+ const next_0 = THEME_ORDER[(THEME_ORDER.indexOf(current) + 1) % THEME_ORDER.length] ?? current;
103
+ saveThemePreference(next_0);
104
+ return next_0;
105
+ });
106
+ };
107
+ const value = {
108
+ cycleTheme,
109
+ resolvedTheme: resolveTheme(theme, systemTheme),
110
+ setTheme,
111
+ systemTheme,
112
+ theme
113
+ };
114
+ return /* @__PURE__ */ jsxDEV(ThemeContext, {
115
+ value,
116
+ children
117
+ }, void 0, false);
118
+ };
119
+ const EnsureThemeProvider = (t0) => {
120
+ const $ = c(3);
121
+ const {
122
+ children
123
+ } = t0;
124
+ const existing = use(ThemeContext);
125
+ let t1;
126
+ if ($[0] !== children || $[1] !== existing) {
127
+ t1 = existing === null ? /* @__PURE__ */ jsxDEV(ThemeProvider, {
128
+ children
129
+ }, void 0, false) : children;
130
+ $[0] = children;
131
+ $[1] = existing;
132
+ $[2] = t1;
133
+ } else {
134
+ t1 = $[2];
135
+ }
136
+ return t1;
137
+ };
138
+ const useTheme = () => {
139
+ const context = use(ThemeContext);
140
+ if (context === null) {
141
+ throw new LunoraError("INTERNAL", "useTheme must be used within a <ThemeProvider>");
142
+ }
143
+ return context;
144
+ };
145
+
146
+ function TooltipProvider({
147
+ delay = 0,
148
+ ...props
149
+ }) {
150
+ return /* @__PURE__ */ jsxDEV(Tooltip$1.Provider, {
151
+ "data-slot": "tooltip-provider",
152
+ delay,
153
+ ...props
154
+ }, void 0, false);
155
+ }
156
+ function Tooltip(t0) {
157
+ const $ = c(4);
158
+ let props;
159
+ if ($[0] !== t0) {
160
+ ({
161
+ ...props
162
+ } = t0);
163
+ $[0] = t0;
164
+ $[1] = props;
165
+ } else {
166
+ props = $[1];
167
+ }
168
+ let t1;
169
+ if ($[2] !== props) {
170
+ t1 = /* @__PURE__ */ jsxDEV(Tooltip$1.Root, {
171
+ "data-slot": "tooltip",
172
+ ...props
173
+ }, void 0, false);
174
+ $[2] = props;
175
+ $[3] = t1;
176
+ } else {
177
+ t1 = $[3];
178
+ }
179
+ return t1;
180
+ }
181
+ function TooltipTrigger(t0) {
182
+ const $ = c(4);
183
+ let props;
184
+ if ($[0] !== t0) {
185
+ ({
186
+ ...props
187
+ } = t0);
188
+ $[0] = t0;
189
+ $[1] = props;
190
+ } else {
191
+ props = $[1];
192
+ }
193
+ let t1;
194
+ if ($[2] !== props) {
195
+ t1 = /* @__PURE__ */ jsxDEV(Tooltip$1.Trigger, {
196
+ "data-slot": "tooltip-trigger",
197
+ ...props
198
+ }, void 0, false);
199
+ $[2] = props;
200
+ $[3] = t1;
201
+ } else {
202
+ t1 = $[3];
203
+ }
204
+ return t1;
205
+ }
206
+ function TooltipContent({
207
+ className,
208
+ side = "top",
209
+ sideOffset = 4,
210
+ align = "center",
211
+ alignOffset = 0,
212
+ children,
213
+ ...props
214
+ }) {
215
+ return /* @__PURE__ */ jsxDEV(Tooltip$1.Portal, {
216
+ children: /* @__PURE__ */ jsxDEV(Tooltip$1.Positioner, {
217
+ align,
218
+ alignOffset,
219
+ side,
220
+ sideOffset,
221
+ className: "isolate z-50",
222
+ children: /* @__PURE__ */ jsxDEV(Tooltip$1.Popup, {
223
+ "data-slot": "tooltip-content",
224
+ className: cn("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pe-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-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-md 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", className),
225
+ ...props,
226
+ children: [children, /* @__PURE__ */ jsxDEV(Tooltip$1.Arrow, {
227
+ className: "z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-md bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-start-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-end-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"
228
+ }, void 0, false)]
229
+ }, void 0, true)
230
+ }, void 0, false)
231
+ }, void 0, false);
232
+ }
233
+
234
+ const BrandMark = (t0) => {
235
+ const $ = c(5);
236
+ const {
237
+ className
238
+ } = t0;
239
+ let t1;
240
+ if ($[0] !== className) {
241
+ t1 = cn("h-full w-full text-foreground", className);
242
+ $[0] = className;
243
+ $[1] = t1;
244
+ } else {
245
+ t1 = $[1];
246
+ }
247
+ let t2;
248
+ if ($[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
249
+ t2 = /* @__PURE__ */ jsxDEV("path", {
250
+ d: "M 259.500 10.552 C 220.080 15.859, 182.424 32.566, 152.500 58.025 C 110.179 94.031, 85.380 137.183, 77.518 188.500 C 75.410 202.255, 74.569 225.677, 75.796 236.466 C 76.757 244.917, 76.683 245.692, 74.518 249.966 C 63.118 272.466, 53.141 303.876, 51.382 322.799 L 50.718 329.943 71.960 320.471 C 83.643 315.262, 93.326 311, 93.478 311 C 93.630 311, 96.547 316.063, 99.959 322.250 C 103.371 328.438, 107.249 334.850, 108.577 336.500 L 110.990 339.500 110.981 336 C 110.977 334.075, 111.499 324.991, 112.143 315.813 L 113.312 299.127 121.406 293.336 C 132.495 285.403, 149.593 271.554, 161 261.268 C 171.556 251.748, 189.116 235, 188.540 235 C 188.337 235, 183.069 238.648, 176.835 243.106 C 142.318 267.789, 68.537 314, 63.646 314 C 61.843 314, 72.791 281.179, 80.905 262.259 C 92.233 235.845, 107.473 212.389, 132.106 183.453 L 138.451 176 148.268 176 C 176.192 176, 197.512 187.154, 212.868 209.797 C 216.470 215.108, 217.035 216.595, 216.477 219.297 C 211.386 243.968, 202.359 274.496, 193.797 296 C 183.898 320.861, 167.147 352.101, 152.395 373.215 L 147.004 380.930 152.891 385.830 C 161.400 392.911, 165.563 396, 166.594 395.998 C 167.092 395.998, 168.772 391.641, 170.327 386.317 C 176.279 365.934, 188.422 338.749, 200.942 317.778 C 223.060 280.731, 256.432 244.369, 294.500 215.836 C 309.956 204.252, 313.937 201.603, 314.719 202.385 C 315.116 202.783, 315.449 213.096, 315.460 225.304 C 315.474 241.855, 315.021 250.405, 313.680 258.924 C 307.009 301.272, 291.175 336.677, 263.112 372 C 255.259 381.883, 227.182 410.673, 218.516 417.727 L 213.532 421.783 223.439 424.880 C 281.705 443.093, 349.165 436.018, 398.616 406.508 C 446.728 377.797, 483.322 331.466, 497.366 281.481 C 503.381 260.075, 504.480 250.741, 504.491 221 C 504.501 191.997, 503.598 184.047, 497.987 163.732 C 484.768 115.871, 452.505 72.708, 407.718 42.964 C 381.051 25.254, 352.818 14.828, 319.695 10.460 C 305.932 8.645, 273.298 8.695, 259.500 10.552",
251
+ fillRule: "evenodd"
252
+ }, void 0, false);
253
+ $[2] = t2;
254
+ } else {
255
+ t2 = $[2];
256
+ }
257
+ let t3;
258
+ if ($[3] !== t1) {
259
+ t3 = /* @__PURE__ */ jsxDEV("svg", {
260
+ "aria-hidden": "true",
261
+ className: t1,
262
+ fill: "currentColor",
263
+ viewBox: "0 0 543 446",
264
+ children: t2
265
+ }, void 0, false);
266
+ $[3] = t1;
267
+ $[4] = t3;
268
+ } else {
269
+ t3 = $[4];
270
+ }
271
+ return t3;
272
+ };
273
+
274
+ const RULES_BANNER_DISMISSED_KEY = "lunora.studio.rulesBannerDismissed";
275
+ const readBannerDismissed = () => {
276
+ try {
277
+ return globalThis.localStorage.getItem(RULES_BANNER_DISMISSED_KEY) === "1";
278
+ } catch {
279
+ return false;
280
+ }
281
+ };
282
+ const writeBannerDismissed = () => {
283
+ try {
284
+ globalThis.localStorage.setItem(RULES_BANNER_DISMISSED_KEY, "1");
285
+ } catch {
286
+ }
287
+ };
288
+ const RulesBanner = () => {
289
+ const $ = c(18);
290
+ const t = useT();
291
+ const [dismissed, setDismissed] = useState(_temp$1);
292
+ let t0;
293
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
294
+ t0 = () => {
295
+ setDismissed(true);
296
+ writeBannerDismissed();
297
+ };
298
+ $[0] = t0;
299
+ } else {
300
+ t0 = $[0];
301
+ }
302
+ const dismiss = t0;
303
+ if (dismissed) {
304
+ return null;
305
+ }
306
+ let t1;
307
+ if ($[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
308
+ t1 = /* @__PURE__ */ jsxDEV("span", {
309
+ "aria-hidden": "true",
310
+ className: "text-warning",
311
+ children: "⚠"
312
+ }, void 0, false);
313
+ $[1] = t1;
314
+ } else {
315
+ t1 = $[1];
316
+ }
317
+ let t2;
318
+ if ($[2] !== t) {
319
+ t2 = t("Lunora AI rules aren't installed.");
320
+ $[2] = t;
321
+ $[3] = t2;
322
+ } else {
323
+ t2 = $[3];
324
+ }
325
+ let t3;
326
+ if ($[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
327
+ t3 = /* @__PURE__ */ jsxDEV("code", {
328
+ className: "rounded bg-muted px-1 py-0.5 font-mono text-[11px]",
329
+ children: "lunora rules install"
330
+ }, void 0, false);
331
+ $[4] = t3;
332
+ } else {
333
+ t3 = $[4];
334
+ }
335
+ let t4;
336
+ if ($[5] !== t) {
337
+ t4 = t("lets your coding agent use Lunora correctly.");
338
+ $[5] = t;
339
+ $[6] = t4;
340
+ } else {
341
+ t4 = $[6];
342
+ }
343
+ let t5;
344
+ if ($[7] !== t2 || $[8] !== t4) {
345
+ t5 = /* @__PURE__ */ jsxDEV("span", {
346
+ children: [t2, " ", t3, " ", t4]
347
+ }, void 0, true);
348
+ $[7] = t2;
349
+ $[8] = t4;
350
+ $[9] = t5;
351
+ } else {
352
+ t5 = $[9];
353
+ }
354
+ let t6;
355
+ if ($[10] !== t) {
356
+ t6 = t("Dismiss");
357
+ $[10] = t;
358
+ $[11] = t6;
359
+ } else {
360
+ t6 = $[11];
361
+ }
362
+ let t7;
363
+ if ($[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
364
+ t7 = /* @__PURE__ */ jsxDEV("svg", {
365
+ "aria-hidden": "true",
366
+ className: "size-3.5",
367
+ fill: "none",
368
+ stroke: "currentColor",
369
+ strokeLinecap: "round",
370
+ strokeWidth: 1.8,
371
+ viewBox: "0 0 24 24",
372
+ children: /* @__PURE__ */ jsxDEV("path", {
373
+ d: "M18 6 6 18M6 6l12 12"
374
+ }, void 0, false)
375
+ }, void 0, false);
376
+ $[12] = t7;
377
+ } else {
378
+ t7 = $[12];
379
+ }
380
+ let t8;
381
+ if ($[13] !== t6) {
382
+ t8 = /* @__PURE__ */ jsxDEV("button", {
383
+ "aria-label": t6,
384
+ className: "ms-auto flex size-5 items-center justify-center rounded text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent",
385
+ "data-testid": "dash-app-rules-banner-dismiss",
386
+ onClick: dismiss,
387
+ type: "button",
388
+ children: t7
389
+ }, void 0, false);
390
+ $[13] = t6;
391
+ $[14] = t8;
392
+ } else {
393
+ t8 = $[14];
394
+ }
395
+ let t9;
396
+ if ($[15] !== t5 || $[16] !== t8) {
397
+ t9 = /* @__PURE__ */ jsxDEV("div", {
398
+ className: "flex shrink-0 items-center gap-2 border-b border-warning/30 bg-warning/10 px-6 py-2 text-[12px] text-foreground",
399
+ "data-testid": "dash-app-rules-banner",
400
+ role: "note",
401
+ children: [t1, t5, t8]
402
+ }, void 0, true);
403
+ $[15] = t5;
404
+ $[16] = t8;
405
+ $[17] = t9;
406
+ } else {
407
+ t9 = $[17];
408
+ }
409
+ return t9;
410
+ };
411
+ function _temp$1() {
412
+ return readBannerDismissed();
413
+ }
414
+
415
+ const MonitorIcon = () => {
416
+ const $ = c(1);
417
+ let t0;
418
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
419
+ t0 = /* @__PURE__ */ jsxDEV("svg", {
420
+ "aria-hidden": "true",
421
+ className: "size-3.5",
422
+ fill: "none",
423
+ stroke: "currentColor",
424
+ strokeLinecap: "round",
425
+ strokeLinejoin: "round",
426
+ strokeWidth: 1.8,
427
+ viewBox: "0 0 24 24",
428
+ children: [/* @__PURE__ */ jsxDEV("rect", {
429
+ height: "14",
430
+ rx: "2",
431
+ width: "20",
432
+ x: "2",
433
+ y: "3"
434
+ }, void 0, false), /* @__PURE__ */ jsxDEV("path", {
435
+ d: "M8 21h8M12 17v4"
436
+ }, void 0, false)]
437
+ }, void 0, true);
438
+ $[0] = t0;
439
+ } else {
440
+ t0 = $[0];
441
+ }
442
+ return t0;
443
+ };
444
+ const SunIcon = () => {
445
+ const $ = c(1);
446
+ let t0;
447
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
448
+ t0 = /* @__PURE__ */ jsxDEV("svg", {
449
+ "aria-hidden": "true",
450
+ className: "size-3.5",
451
+ fill: "none",
452
+ stroke: "currentColor",
453
+ strokeLinecap: "round",
454
+ strokeLinejoin: "round",
455
+ strokeWidth: 1.8,
456
+ viewBox: "0 0 24 24",
457
+ children: [/* @__PURE__ */ jsxDEV("circle", {
458
+ cx: "12",
459
+ cy: "12",
460
+ r: "4"
461
+ }, void 0, false), /* @__PURE__ */ jsxDEV("path", {
462
+ d: "M12 2v2m0 16v2M4.9 4.9l1.4 1.4m11.4 11.4 1.4 1.4M2 12h2m16 0h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"
463
+ }, void 0, false)]
464
+ }, void 0, true);
465
+ $[0] = t0;
466
+ } else {
467
+ t0 = $[0];
468
+ }
469
+ return t0;
470
+ };
471
+ const MoonIcon = () => {
472
+ const $ = c(1);
473
+ let t0;
474
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
475
+ t0 = /* @__PURE__ */ jsxDEV("svg", {
476
+ "aria-hidden": "true",
477
+ className: "size-3.5",
478
+ fill: "none",
479
+ stroke: "currentColor",
480
+ strokeLinecap: "round",
481
+ strokeLinejoin: "round",
482
+ strokeWidth: 1.8,
483
+ viewBox: "0 0 24 24",
484
+ children: /* @__PURE__ */ jsxDEV("path", {
485
+ d: "M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8Z"
486
+ }, void 0, false)
487
+ }, void 0, false);
488
+ $[0] = t0;
489
+ } else {
490
+ t0 = $[0];
491
+ }
492
+ return t0;
493
+ };
494
+ const OPTIONS = [{
495
+ Icon: MonitorIcon,
496
+ value: "system"
497
+ }, {
498
+ Icon: SunIcon,
499
+ value: "light"
500
+ }, {
501
+ Icon: MoonIcon,
502
+ value: "dark"
503
+ }];
504
+ const ThemeToggle = () => {
505
+ const $ = c(19);
506
+ const {
507
+ theme,
508
+ setTheme
509
+ } = useTheme();
510
+ const t = useT();
511
+ let t0;
512
+ if ($[0] !== t) {
513
+ t0 = t("Dark theme");
514
+ $[0] = t;
515
+ $[1] = t0;
516
+ } else {
517
+ t0 = $[1];
518
+ }
519
+ let t1;
520
+ if ($[2] !== t) {
521
+ t1 = t("Light theme");
522
+ $[2] = t;
523
+ $[3] = t1;
524
+ } else {
525
+ t1 = $[3];
526
+ }
527
+ let t2;
528
+ if ($[4] !== t) {
529
+ t2 = t("System theme");
530
+ $[4] = t;
531
+ $[5] = t2;
532
+ } else {
533
+ t2 = $[5];
534
+ }
535
+ let t3;
536
+ if ($[6] !== t0 || $[7] !== t1 || $[8] !== t2) {
537
+ t3 = {
538
+ dark: t0,
539
+ light: t1,
540
+ system: t2
541
+ };
542
+ $[6] = t0;
543
+ $[7] = t1;
544
+ $[8] = t2;
545
+ $[9] = t3;
546
+ } else {
547
+ t3 = $[9];
548
+ }
549
+ const label = t3;
550
+ let t4;
551
+ if ($[10] !== t) {
552
+ t4 = t("Theme");
553
+ $[10] = t;
554
+ $[11] = t4;
555
+ } else {
556
+ t4 = $[11];
557
+ }
558
+ let t5;
559
+ if ($[12] !== label || $[13] !== setTheme || $[14] !== theme) {
560
+ t5 = OPTIONS.map((t62) => {
561
+ const {
562
+ Icon,
563
+ value
564
+ } = t62;
565
+ const active = theme === value;
566
+ return /* @__PURE__ */ jsxDEV("button", {
567
+ "aria-checked": active,
568
+ "aria-label": label[value],
569
+ className: cn("relative flex size-7 cursor-pointer items-center justify-center rounded-md outline-none transition-colors focus-visible:bg-accent", active ? "text-foreground" : "text-muted-foreground hover:text-foreground"),
570
+ "data-testid": `dash-app-theme-${value}`,
571
+ onClick: () => {
572
+ setTheme(value);
573
+ },
574
+ role: "radio",
575
+ title: label[value],
576
+ type: "button",
577
+ children: [active && /* @__PURE__ */ jsxDEV(motion.span, {
578
+ className: "absolute inset-0 rounded-md border border-muted-foreground/40 bg-background/40",
579
+ layoutId: "studio-theme-active",
580
+ transition: {
581
+ bounce: 0.1,
582
+ duration: 0.45,
583
+ type: "spring"
584
+ }
585
+ }, void 0, false), /* @__PURE__ */ jsxDEV("span", {
586
+ className: "relative",
587
+ children: /* @__PURE__ */ jsxDEV(Icon, {}, void 0, false)
588
+ }, void 0, false)]
589
+ }, value, true);
590
+ });
591
+ $[12] = label;
592
+ $[13] = setTheme;
593
+ $[14] = theme;
594
+ $[15] = t5;
595
+ } else {
596
+ t5 = $[15];
597
+ }
598
+ let t6;
599
+ if ($[16] !== t4 || $[17] !== t5) {
600
+ t6 = /* @__PURE__ */ jsxDEV("div", {
601
+ "aria-label": t4,
602
+ className: "inline-flex items-center gap-0.5 overflow-hidden rounded-md border border-border bg-muted/60 p-0.5",
603
+ "data-testid": "dash-app-theme",
604
+ role: "radiogroup",
605
+ children: t5
606
+ }, void 0, false);
607
+ $[16] = t4;
608
+ $[17] = t5;
609
+ $[18] = t6;
610
+ } else {
611
+ t6 = $[18];
612
+ }
613
+ return t6;
614
+ };
615
+
616
+ function Popover(t0) {
617
+ const $ = c(4);
618
+ let props;
619
+ if ($[0] !== t0) {
620
+ ({
621
+ ...props
622
+ } = t0);
623
+ $[0] = t0;
624
+ $[1] = props;
625
+ } else {
626
+ props = $[1];
627
+ }
628
+ let t1;
629
+ if ($[2] !== props) {
630
+ t1 = /* @__PURE__ */ jsxDEV(Popover$1.Root, {
631
+ "data-slot": "popover",
632
+ ...props
633
+ }, void 0, false);
634
+ $[2] = props;
635
+ $[3] = t1;
636
+ } else {
637
+ t1 = $[3];
638
+ }
639
+ return t1;
640
+ }
641
+ function PopoverTrigger(t0) {
642
+ const $ = c(4);
643
+ let props;
644
+ if ($[0] !== t0) {
645
+ ({
646
+ ...props
647
+ } = t0);
648
+ $[0] = t0;
649
+ $[1] = props;
650
+ } else {
651
+ props = $[1];
652
+ }
653
+ let t1;
654
+ if ($[2] !== props) {
655
+ t1 = /* @__PURE__ */ jsxDEV(Popover$1.Trigger, {
656
+ "data-slot": "popover-trigger",
657
+ ...props
658
+ }, void 0, false);
659
+ $[2] = props;
660
+ $[3] = t1;
661
+ } else {
662
+ t1 = $[3];
663
+ }
664
+ return t1;
665
+ }
666
+ function PopoverContent({
667
+ align = "end",
668
+ alignOffset = 0,
669
+ className,
670
+ keepMounted = false,
671
+ side = "bottom",
672
+ sideOffset = 6,
673
+ ...props
674
+ }) {
675
+ return /* @__PURE__ */ jsxDEV(Popover$1.Portal, {
676
+ keepMounted,
677
+ children: /* @__PURE__ */ jsxDEV(Popover$1.Positioner, {
678
+ align,
679
+ alignOffset,
680
+ className: "isolate z-50 outline-none",
681
+ side,
682
+ sideOffset,
683
+ children: /* @__PURE__ */ jsxDEV(Popover$1.Popup, {
684
+ className: cn("z-50 w-72 origin-(--transform-origin) rounded-lg border border-border bg-popover p-3 text-popover-foreground shadow-md outline-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
685
+ "data-slot": "popover-content",
686
+ ...props
687
+ }, void 0, false)
688
+ }, void 0, false)
689
+ }, void 0, false);
690
+ }
691
+
692
+ const MOBILE_BREAKPOINT = 768;
693
+ function useIsMobile() {
694
+ const $ = c(2);
695
+ const [isMobile, setIsMobile] = useState(void 0);
696
+ let t0;
697
+ let t1;
698
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
699
+ t0 = () => {
700
+ const mql = globalThis.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
701
+ const onChange = () => {
702
+ setIsMobile(globalThis.innerWidth < MOBILE_BREAKPOINT);
703
+ };
704
+ mql.addEventListener("change", onChange);
705
+ setIsMobile(globalThis.innerWidth < MOBILE_BREAKPOINT);
706
+ return () => {
707
+ mql.removeEventListener("change", onChange);
708
+ };
709
+ };
710
+ t1 = [];
711
+ $[0] = t0;
712
+ $[1] = t1;
713
+ } else {
714
+ t0 = $[0];
715
+ t1 = $[1];
716
+ }
717
+ useEffect(t0, t1);
718
+ return Boolean(isMobile);
719
+ }
720
+
721
+ function Sheet(t0) {
722
+ const $ = c(4);
723
+ let props;
724
+ if ($[0] !== t0) {
725
+ ({
726
+ ...props
727
+ } = t0);
728
+ $[0] = t0;
729
+ $[1] = props;
730
+ } else {
731
+ props = $[1];
732
+ }
733
+ let t1;
734
+ if ($[2] !== props) {
735
+ t1 = /* @__PURE__ */ jsxDEV(Dialog.Root, {
736
+ "data-slot": "sheet",
737
+ ...props
738
+ }, void 0, false);
739
+ $[2] = props;
740
+ $[3] = t1;
741
+ } else {
742
+ t1 = $[3];
743
+ }
744
+ return t1;
745
+ }
746
+ function SheetPortal(t0) {
747
+ const $ = c(4);
748
+ let props;
749
+ if ($[0] !== t0) {
750
+ ({
751
+ ...props
752
+ } = t0);
753
+ $[0] = t0;
754
+ $[1] = props;
755
+ } else {
756
+ props = $[1];
757
+ }
758
+ let t1;
759
+ if ($[2] !== props) {
760
+ t1 = /* @__PURE__ */ jsxDEV(Dialog.Portal, {
761
+ "data-slot": "sheet-portal",
762
+ ...props
763
+ }, void 0, false);
764
+ $[2] = props;
765
+ $[3] = t1;
766
+ } else {
767
+ t1 = $[3];
768
+ }
769
+ return t1;
770
+ }
771
+ function SheetOverlay(t0) {
772
+ const $ = c(8);
773
+ let className;
774
+ let props;
775
+ if ($[0] !== t0) {
776
+ ({
777
+ className,
778
+ ...props
779
+ } = t0);
780
+ $[0] = t0;
781
+ $[1] = className;
782
+ $[2] = props;
783
+ } else {
784
+ className = $[1];
785
+ props = $[2];
786
+ }
787
+ let t1;
788
+ if ($[3] !== className) {
789
+ t1 = cn("fixed inset-0 z-50 bg-black/10 text-xs/relaxed transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:", className);
790
+ $[3] = className;
791
+ $[4] = t1;
792
+ } else {
793
+ t1 = $[4];
794
+ }
795
+ let t2;
796
+ if ($[5] !== props || $[6] !== t1) {
797
+ t2 = /* @__PURE__ */ jsxDEV(Dialog.Backdrop, {
798
+ "data-slot": "sheet-overlay",
799
+ className: t1,
800
+ ...props
801
+ }, void 0, false);
802
+ $[5] = props;
803
+ $[6] = t1;
804
+ $[7] = t2;
805
+ } else {
806
+ t2 = $[7];
807
+ }
808
+ return t2;
809
+ }
810
+ function SheetContent({
811
+ className,
812
+ children,
813
+ side = "right",
814
+ showCloseButton = true,
815
+ ...props
816
+ }) {
817
+ return /* @__PURE__ */ jsxDEV(SheetPortal, {
818
+ children: [/* @__PURE__ */ jsxDEV(SheetOverlay, {}, void 0, false), /* @__PURE__ */ jsxDEV(Dialog.Popup, {
819
+ "data-slot": "sheet-content",
820
+ "data-side": side,
821
+ className: cn("fixed z-50 flex flex-col bg-popover bg-clip-padding text-xs/relaxed text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-e data-[side=left]:data-ending-style:translate-x-[-2.5rem] rtl:data-[side=left]:data-ending-style:-translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] rtl:data-[side=left]:data-starting-style:-translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-s data-[side=right]:data-ending-style:translate-x-[2.5rem] rtl:data-[side=right]:data-ending-style:-translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] rtl:data-[side=right]:data-starting-style:-translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm", className),
822
+ ...props,
823
+ children: [children, showCloseButton && /* @__PURE__ */ jsxDEV(Dialog.Close, {
824
+ "data-slot": "sheet-close",
825
+ render: /* @__PURE__ */ jsxDEV(Button, {
826
+ variant: "ghost",
827
+ className: "absolute top-3 end-3",
828
+ size: "icon-sm"
829
+ }, void 0, false),
830
+ children: [/* @__PURE__ */ jsxDEV(HugeiconsIcon, {
831
+ icon: Cancel01Icon,
832
+ strokeWidth: 2
833
+ }, void 0, false), /* @__PURE__ */ jsxDEV("span", {
834
+ className: "sr-only",
835
+ children: "Close"
836
+ }, void 0, false)]
837
+ }, void 0, true)]
838
+ }, void 0, true)]
839
+ }, void 0, true);
840
+ }
841
+ function SheetHeader(t0) {
842
+ const $ = c(8);
843
+ let className;
844
+ let props;
845
+ if ($[0] !== t0) {
846
+ ({
847
+ className,
848
+ ...props
849
+ } = t0);
850
+ $[0] = t0;
851
+ $[1] = className;
852
+ $[2] = props;
853
+ } else {
854
+ className = $[1];
855
+ props = $[2];
856
+ }
857
+ let t1;
858
+ if ($[3] !== className) {
859
+ t1 = cn("flex flex-col gap-0.5 p-4", className);
860
+ $[3] = className;
861
+ $[4] = t1;
862
+ } else {
863
+ t1 = $[4];
864
+ }
865
+ let t2;
866
+ if ($[5] !== props || $[6] !== t1) {
867
+ t2 = /* @__PURE__ */ jsxDEV("div", {
868
+ "data-slot": "sheet-header",
869
+ className: t1,
870
+ ...props
871
+ }, void 0, false);
872
+ $[5] = props;
873
+ $[6] = t1;
874
+ $[7] = t2;
875
+ } else {
876
+ t2 = $[7];
877
+ }
878
+ return t2;
879
+ }
880
+ function SheetTitle(t0) {
881
+ const $ = c(8);
882
+ let className;
883
+ let props;
884
+ if ($[0] !== t0) {
885
+ ({
886
+ className,
887
+ ...props
888
+ } = t0);
889
+ $[0] = t0;
890
+ $[1] = className;
891
+ $[2] = props;
892
+ } else {
893
+ className = $[1];
894
+ props = $[2];
895
+ }
896
+ let t1;
897
+ if ($[3] !== className) {
898
+ t1 = cn("text-sm font-medium text-foreground", className);
899
+ $[3] = className;
900
+ $[4] = t1;
901
+ } else {
902
+ t1 = $[4];
903
+ }
904
+ let t2;
905
+ if ($[5] !== props || $[6] !== t1) {
906
+ t2 = /* @__PURE__ */ jsxDEV(Dialog.Title, {
907
+ "data-slot": "sheet-title",
908
+ className: t1,
909
+ ...props
910
+ }, void 0, false);
911
+ $[5] = props;
912
+ $[6] = t1;
913
+ $[7] = t2;
914
+ } else {
915
+ t2 = $[7];
916
+ }
917
+ return t2;
918
+ }
919
+ function SheetDescription(t0) {
920
+ const $ = c(8);
921
+ let className;
922
+ let props;
923
+ if ($[0] !== t0) {
924
+ ({
925
+ className,
926
+ ...props
927
+ } = t0);
928
+ $[0] = t0;
929
+ $[1] = className;
930
+ $[2] = props;
931
+ } else {
932
+ className = $[1];
933
+ props = $[2];
934
+ }
935
+ let t1;
936
+ if ($[3] !== className) {
937
+ t1 = cn("text-xs/relaxed text-muted-foreground", className);
938
+ $[3] = className;
939
+ $[4] = t1;
940
+ } else {
941
+ t1 = $[4];
942
+ }
943
+ let t2;
944
+ if ($[5] !== props || $[6] !== t1) {
945
+ t2 = /* @__PURE__ */ jsxDEV(Dialog.Description, {
946
+ "data-slot": "sheet-description",
947
+ className: t1,
948
+ ...props
949
+ }, void 0, false);
950
+ $[5] = props;
951
+ $[6] = t1;
952
+ $[7] = t2;
953
+ } else {
954
+ t2 = $[7];
955
+ }
956
+ return t2;
957
+ }
958
+
959
+ const SIDEBAR_COOKIE_NAME = "sidebar_state";
960
+ const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
961
+ const SIDEBAR_WIDTH = "16rem";
962
+ const SIDEBAR_WIDTH_MOBILE = "18rem";
963
+ const SIDEBAR_WIDTH_ICON = "3rem";
964
+ const SIDEBAR_KEYBOARD_SHORTCUT = "b";
965
+ const SidebarContext = /* @__PURE__ */ React.createContext(null);
966
+ function useSidebar() {
967
+ const context = React.useContext(SidebarContext);
968
+ if (!context) {
969
+ throw new LunoraError("INTERNAL", "useSidebar must be used within a SidebarProvider.");
970
+ }
971
+ return context;
972
+ }
973
+ function SidebarProvider({
974
+ defaultOpen = true,
975
+ open: openProp,
976
+ onOpenChange: setOpenProp,
977
+ className,
978
+ style,
979
+ children,
980
+ ...props
981
+ }) {
982
+ const isMobile = useIsMobile();
983
+ const [openMobile, setOpenMobile] = React.useState(false);
984
+ const [_open, _setOpen] = React.useState(defaultOpen);
985
+ const open = openProp ?? _open;
986
+ const setOpen = (value) => {
987
+ const openState = typeof value === "function" ? value(open) : value;
988
+ if (setOpenProp) {
989
+ setOpenProp(openState);
990
+ } else {
991
+ _setOpen(openState);
992
+ }
993
+ document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
994
+ };
995
+ const toggleSidebar = () => {
996
+ return isMobile ? setOpenMobile((open_0) => !open_0) : setOpen((open_1) => !open_1);
997
+ };
998
+ React.useEffect(() => {
999
+ const handleKeyDown = (event) => {
1000
+ if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
1001
+ event.preventDefault();
1002
+ toggleSidebar();
1003
+ }
1004
+ };
1005
+ globalThis.addEventListener("keydown", handleKeyDown);
1006
+ return () => globalThis.removeEventListener("keydown", handleKeyDown);
1007
+ }, [toggleSidebar]);
1008
+ const state = open ? "expanded" : "collapsed";
1009
+ const contextValue = {
1010
+ state,
1011
+ open,
1012
+ setOpen,
1013
+ isMobile,
1014
+ openMobile,
1015
+ setOpenMobile,
1016
+ toggleSidebar
1017
+ };
1018
+ return /* @__PURE__ */ jsxDEV(SidebarContext.Provider, {
1019
+ value: contextValue,
1020
+ children: /* @__PURE__ */ jsxDEV("div", {
1021
+ "data-slot": "sidebar-wrapper",
1022
+ style: {
1023
+ "--sidebar-width": SIDEBAR_WIDTH,
1024
+ "--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
1025
+ ...style
1026
+ },
1027
+ className: cn("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar", className),
1028
+ ...props,
1029
+ children
1030
+ }, void 0, false)
1031
+ }, void 0, false);
1032
+ }
1033
+ function Sidebar({
1034
+ side = "left",
1035
+ variant = "sidebar",
1036
+ collapsible = "offcanvas",
1037
+ className,
1038
+ children,
1039
+ dir,
1040
+ ...props
1041
+ }) {
1042
+ const {
1043
+ isMobile,
1044
+ state,
1045
+ openMobile,
1046
+ setOpenMobile
1047
+ } = useSidebar();
1048
+ if (collapsible === "none") {
1049
+ return /* @__PURE__ */ jsxDEV("div", {
1050
+ "data-slot": "sidebar",
1051
+ className: cn("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground", className),
1052
+ ...props,
1053
+ children
1054
+ }, void 0, false);
1055
+ }
1056
+ if (isMobile) {
1057
+ return /* @__PURE__ */ jsxDEV(Sheet, {
1058
+ open: openMobile,
1059
+ onOpenChange: setOpenMobile,
1060
+ ...props,
1061
+ children: /* @__PURE__ */ jsxDEV(SheetContent, {
1062
+ dir,
1063
+ "data-sidebar": "sidebar",
1064
+ "data-slot": "sidebar",
1065
+ "data-mobile": "true",
1066
+ className: "w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",
1067
+ style: {
1068
+ "--sidebar-width": SIDEBAR_WIDTH_MOBILE
1069
+ },
1070
+ side,
1071
+ children: [/* @__PURE__ */ jsxDEV(SheetHeader, {
1072
+ className: "sr-only",
1073
+ children: [/* @__PURE__ */ jsxDEV(SheetTitle, {
1074
+ children: "Sidebar"
1075
+ }, void 0, false), /* @__PURE__ */ jsxDEV(SheetDescription, {
1076
+ children: "Displays the mobile sidebar."
1077
+ }, void 0, false)]
1078
+ }, void 0, true), /* @__PURE__ */ jsxDEV("div", {
1079
+ className: "flex h-full w-full flex-col",
1080
+ children
1081
+ }, void 0, false)]
1082
+ }, void 0, true)
1083
+ }, void 0, false);
1084
+ }
1085
+ return /* @__PURE__ */ jsxDEV("div", {
1086
+ className: "group peer hidden text-sidebar-foreground md:block",
1087
+ "data-state": state,
1088
+ "data-collapsible": state === "collapsed" ? collapsible : "",
1089
+ "data-variant": variant,
1090
+ "data-side": side,
1091
+ "data-slot": "sidebar",
1092
+ children: [/* @__PURE__ */ jsxDEV("div", {
1093
+ "data-slot": "sidebar-gap",
1094
+ className: cn("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear", "group-data-[collapsible=offcanvas]:w-0", "group-data-[side=right]:rotate-180", variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)")
1095
+ }, void 0, false), /* @__PURE__ */ jsxDEV("div", {
1096
+ "data-slot": "sidebar-container",
1097
+ "data-side": side,
1098
+ className: cn(
1099
+ "fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",
1100
+ // Adjust the padding for floating and inset variants.
1101
+ variant === "floating" || variant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-e group-data-[side=right]:border-s",
1102
+ className
1103
+ ),
1104
+ ...props,
1105
+ children: /* @__PURE__ */ jsxDEV("div", {
1106
+ "data-sidebar": "sidebar",
1107
+ "data-slot": "sidebar-inner",
1108
+ className: "flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-none group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",
1109
+ children
1110
+ }, void 0, false)
1111
+ }, void 0, false)]
1112
+ }, void 0, true);
1113
+ }
1114
+ function SidebarTrigger(t0) {
1115
+ const $ = c(15);
1116
+ let className;
1117
+ let onClick;
1118
+ let props;
1119
+ if ($[0] !== t0) {
1120
+ ({
1121
+ className,
1122
+ onClick,
1123
+ ...props
1124
+ } = t0);
1125
+ $[0] = t0;
1126
+ $[1] = className;
1127
+ $[2] = onClick;
1128
+ $[3] = props;
1129
+ } else {
1130
+ className = $[1];
1131
+ onClick = $[2];
1132
+ props = $[3];
1133
+ }
1134
+ const {
1135
+ toggleSidebar
1136
+ } = useSidebar();
1137
+ let t1;
1138
+ if ($[4] !== className) {
1139
+ t1 = cn(className);
1140
+ $[4] = className;
1141
+ $[5] = t1;
1142
+ } else {
1143
+ t1 = $[5];
1144
+ }
1145
+ let t2;
1146
+ if ($[6] !== onClick || $[7] !== toggleSidebar) {
1147
+ t2 = (event) => {
1148
+ onClick?.(event);
1149
+ toggleSidebar();
1150
+ };
1151
+ $[6] = onClick;
1152
+ $[7] = toggleSidebar;
1153
+ $[8] = t2;
1154
+ } else {
1155
+ t2 = $[8];
1156
+ }
1157
+ let t3;
1158
+ let t4;
1159
+ if ($[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
1160
+ t3 = /* @__PURE__ */ jsxDEV(HugeiconsIcon, {
1161
+ icon: SidebarLeftIcon,
1162
+ strokeWidth: 2,
1163
+ className: "rtl:rotate-180"
1164
+ }, void 0, false);
1165
+ t4 = /* @__PURE__ */ jsxDEV("span", {
1166
+ className: "sr-only",
1167
+ children: "Toggle Sidebar"
1168
+ }, void 0, false);
1169
+ $[9] = t3;
1170
+ $[10] = t4;
1171
+ } else {
1172
+ t3 = $[9];
1173
+ t4 = $[10];
1174
+ }
1175
+ let t5;
1176
+ if ($[11] !== props || $[12] !== t1 || $[13] !== t2) {
1177
+ t5 = /* @__PURE__ */ jsxDEV(Button, {
1178
+ "data-sidebar": "trigger",
1179
+ "data-slot": "sidebar-trigger",
1180
+ variant: "ghost",
1181
+ size: "icon-sm",
1182
+ className: t1,
1183
+ onClick: t2,
1184
+ ...props,
1185
+ children: [t3, t4]
1186
+ }, void 0, true);
1187
+ $[11] = props;
1188
+ $[12] = t1;
1189
+ $[13] = t2;
1190
+ $[14] = t5;
1191
+ } else {
1192
+ t5 = $[14];
1193
+ }
1194
+ return t5;
1195
+ }
1196
+ function SidebarInset(t0) {
1197
+ const $ = c(8);
1198
+ let className;
1199
+ let props;
1200
+ if ($[0] !== t0) {
1201
+ ({
1202
+ className,
1203
+ ...props
1204
+ } = t0);
1205
+ $[0] = t0;
1206
+ $[1] = className;
1207
+ $[2] = props;
1208
+ } else {
1209
+ className = $[1];
1210
+ props = $[2];
1211
+ }
1212
+ let t1;
1213
+ if ($[3] !== className) {
1214
+ t1 = cn("relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ms-0 md:peer-data-[variant=inset]:rounded-none md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ms-2", className);
1215
+ $[3] = className;
1216
+ $[4] = t1;
1217
+ } else {
1218
+ t1 = $[4];
1219
+ }
1220
+ let t2;
1221
+ if ($[5] !== props || $[6] !== t1) {
1222
+ t2 = /* @__PURE__ */ jsxDEV("main", {
1223
+ "data-slot": "sidebar-inset",
1224
+ className: t1,
1225
+ ...props
1226
+ }, void 0, false);
1227
+ $[5] = props;
1228
+ $[6] = t1;
1229
+ $[7] = t2;
1230
+ } else {
1231
+ t2 = $[7];
1232
+ }
1233
+ return t2;
1234
+ }
1235
+ function SidebarHeader(t0) {
1236
+ const $ = c(8);
1237
+ let className;
1238
+ let props;
1239
+ if ($[0] !== t0) {
1240
+ ({
1241
+ className,
1242
+ ...props
1243
+ } = t0);
1244
+ $[0] = t0;
1245
+ $[1] = className;
1246
+ $[2] = props;
1247
+ } else {
1248
+ className = $[1];
1249
+ props = $[2];
1250
+ }
1251
+ let t1;
1252
+ if ($[3] !== className) {
1253
+ t1 = cn("flex flex-col gap-2 p-2", className);
1254
+ $[3] = className;
1255
+ $[4] = t1;
1256
+ } else {
1257
+ t1 = $[4];
1258
+ }
1259
+ let t2;
1260
+ if ($[5] !== props || $[6] !== t1) {
1261
+ t2 = /* @__PURE__ */ jsxDEV("div", {
1262
+ "data-slot": "sidebar-header",
1263
+ "data-sidebar": "header",
1264
+ className: t1,
1265
+ ...props
1266
+ }, void 0, false);
1267
+ $[5] = props;
1268
+ $[6] = t1;
1269
+ $[7] = t2;
1270
+ } else {
1271
+ t2 = $[7];
1272
+ }
1273
+ return t2;
1274
+ }
1275
+ function SidebarFooter(t0) {
1276
+ const $ = c(8);
1277
+ let className;
1278
+ let props;
1279
+ if ($[0] !== t0) {
1280
+ ({
1281
+ className,
1282
+ ...props
1283
+ } = t0);
1284
+ $[0] = t0;
1285
+ $[1] = className;
1286
+ $[2] = props;
1287
+ } else {
1288
+ className = $[1];
1289
+ props = $[2];
1290
+ }
1291
+ let t1;
1292
+ if ($[3] !== className) {
1293
+ t1 = cn("flex flex-col gap-2 p-2", className);
1294
+ $[3] = className;
1295
+ $[4] = t1;
1296
+ } else {
1297
+ t1 = $[4];
1298
+ }
1299
+ let t2;
1300
+ if ($[5] !== props || $[6] !== t1) {
1301
+ t2 = /* @__PURE__ */ jsxDEV("div", {
1302
+ "data-slot": "sidebar-footer",
1303
+ "data-sidebar": "footer",
1304
+ className: t1,
1305
+ ...props
1306
+ }, void 0, false);
1307
+ $[5] = props;
1308
+ $[6] = t1;
1309
+ $[7] = t2;
1310
+ } else {
1311
+ t2 = $[7];
1312
+ }
1313
+ return t2;
1314
+ }
1315
+ function SidebarContent(t0) {
1316
+ const $ = c(8);
1317
+ let className;
1318
+ let props;
1319
+ if ($[0] !== t0) {
1320
+ ({
1321
+ className,
1322
+ ...props
1323
+ } = t0);
1324
+ $[0] = t0;
1325
+ $[1] = className;
1326
+ $[2] = props;
1327
+ } else {
1328
+ className = $[1];
1329
+ props = $[2];
1330
+ }
1331
+ let t1;
1332
+ if ($[3] !== className) {
1333
+ t1 = cn("flex min-h-0 flex-1 flex-col gap-0 overflow-x-hidden overflow-y-auto [scrollbar-color:color-mix(in_oklch,var(--muted-foreground)_25%,transparent)_transparent] [scrollbar-width:thin] [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-muted-foreground/25 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar]:w-1.5 hover:[scrollbar-color:color-mix(in_oklch,var(--muted-foreground)_50%,transparent)_transparent] hover:[&::-webkit-scrollbar-thumb]:bg-muted-foreground/50", className);
1334
+ $[3] = className;
1335
+ $[4] = t1;
1336
+ } else {
1337
+ t1 = $[4];
1338
+ }
1339
+ let t2;
1340
+ if ($[5] !== props || $[6] !== t1) {
1341
+ t2 = /* @__PURE__ */ jsxDEV("div", {
1342
+ "data-slot": "sidebar-content",
1343
+ "data-sidebar": "content",
1344
+ className: t1,
1345
+ ...props
1346
+ }, void 0, false);
1347
+ $[5] = props;
1348
+ $[6] = t1;
1349
+ $[7] = t2;
1350
+ } else {
1351
+ t2 = $[7];
1352
+ }
1353
+ return t2;
1354
+ }
1355
+ function SidebarGroup(t0) {
1356
+ const $ = c(8);
1357
+ let className;
1358
+ let props;
1359
+ if ($[0] !== t0) {
1360
+ ({
1361
+ className,
1362
+ ...props
1363
+ } = t0);
1364
+ $[0] = t0;
1365
+ $[1] = className;
1366
+ $[2] = props;
1367
+ } else {
1368
+ className = $[1];
1369
+ props = $[2];
1370
+ }
1371
+ let t1;
1372
+ if ($[3] !== className) {
1373
+ t1 = cn("relative flex w-full min-w-0 flex-col p-2", className);
1374
+ $[3] = className;
1375
+ $[4] = t1;
1376
+ } else {
1377
+ t1 = $[4];
1378
+ }
1379
+ let t2;
1380
+ if ($[5] !== props || $[6] !== t1) {
1381
+ t2 = /* @__PURE__ */ jsxDEV("div", {
1382
+ "data-slot": "sidebar-group",
1383
+ "data-sidebar": "group",
1384
+ className: t1,
1385
+ ...props
1386
+ }, void 0, false);
1387
+ $[5] = props;
1388
+ $[6] = t1;
1389
+ $[7] = t2;
1390
+ } else {
1391
+ t2 = $[7];
1392
+ }
1393
+ return t2;
1394
+ }
1395
+ function SidebarGroupLabel(t0) {
1396
+ const $ = c(10);
1397
+ let render;
1398
+ let t1;
1399
+ let t2;
1400
+ let t3;
1401
+ if ($[0] !== t0) {
1402
+ const {
1403
+ className,
1404
+ render: t42,
1405
+ ...props
1406
+ } = t0;
1407
+ render = t42;
1408
+ t3 = useRender;
1409
+ t1 = "div";
1410
+ t2 = mergeProps({
1411
+ className: cn("flex h-8 shrink-0 items-center rounded-none px-2 text-xs text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0", className)
1412
+ }, props);
1413
+ $[0] = t0;
1414
+ $[1] = render;
1415
+ $[2] = t1;
1416
+ $[3] = t2;
1417
+ $[4] = t3;
1418
+ } else {
1419
+ render = $[1];
1420
+ t1 = $[2];
1421
+ t2 = $[3];
1422
+ t3 = $[4];
1423
+ }
1424
+ let t4;
1425
+ if ($[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
1426
+ t4 = {
1427
+ slot: "sidebar-group-label",
1428
+ sidebar: "group-label"
1429
+ };
1430
+ $[5] = t4;
1431
+ } else {
1432
+ t4 = $[5];
1433
+ }
1434
+ let t5;
1435
+ if ($[6] !== render || $[7] !== t1 || $[8] !== t2) {
1436
+ t5 = {
1437
+ defaultTagName: t1,
1438
+ props: t2,
1439
+ render,
1440
+ state: t4
1441
+ };
1442
+ $[6] = render;
1443
+ $[7] = t1;
1444
+ $[8] = t2;
1445
+ $[9] = t5;
1446
+ } else {
1447
+ t5 = $[9];
1448
+ }
1449
+ return t3(t5);
1450
+ }
1451
+ function SidebarGroupContent(t0) {
1452
+ const $ = c(8);
1453
+ let className;
1454
+ let props;
1455
+ if ($[0] !== t0) {
1456
+ ({
1457
+ className,
1458
+ ...props
1459
+ } = t0);
1460
+ $[0] = t0;
1461
+ $[1] = className;
1462
+ $[2] = props;
1463
+ } else {
1464
+ className = $[1];
1465
+ props = $[2];
1466
+ }
1467
+ let t1;
1468
+ if ($[3] !== className) {
1469
+ t1 = cn("w-full text-xs", className);
1470
+ $[3] = className;
1471
+ $[4] = t1;
1472
+ } else {
1473
+ t1 = $[4];
1474
+ }
1475
+ let t2;
1476
+ if ($[5] !== props || $[6] !== t1) {
1477
+ t2 = /* @__PURE__ */ jsxDEV("div", {
1478
+ "data-slot": "sidebar-group-content",
1479
+ "data-sidebar": "group-content",
1480
+ className: t1,
1481
+ ...props
1482
+ }, void 0, false);
1483
+ $[5] = props;
1484
+ $[6] = t1;
1485
+ $[7] = t2;
1486
+ } else {
1487
+ t2 = $[7];
1488
+ }
1489
+ return t2;
1490
+ }
1491
+ function SidebarMenu(t0) {
1492
+ const $ = c(8);
1493
+ let className;
1494
+ let props;
1495
+ if ($[0] !== t0) {
1496
+ ({
1497
+ className,
1498
+ ...props
1499
+ } = t0);
1500
+ $[0] = t0;
1501
+ $[1] = className;
1502
+ $[2] = props;
1503
+ } else {
1504
+ className = $[1];
1505
+ props = $[2];
1506
+ }
1507
+ let t1;
1508
+ if ($[3] !== className) {
1509
+ t1 = cn("flex w-full min-w-0 flex-col gap-0", className);
1510
+ $[3] = className;
1511
+ $[4] = t1;
1512
+ } else {
1513
+ t1 = $[4];
1514
+ }
1515
+ let t2;
1516
+ if ($[5] !== props || $[6] !== t1) {
1517
+ t2 = /* @__PURE__ */ jsxDEV("ul", {
1518
+ "data-slot": "sidebar-menu",
1519
+ "data-sidebar": "menu",
1520
+ className: t1,
1521
+ ...props
1522
+ }, void 0, false);
1523
+ $[5] = props;
1524
+ $[6] = t1;
1525
+ $[7] = t2;
1526
+ } else {
1527
+ t2 = $[7];
1528
+ }
1529
+ return t2;
1530
+ }
1531
+ function SidebarMenuItem(t0) {
1532
+ const $ = c(8);
1533
+ let className;
1534
+ let props;
1535
+ if ($[0] !== t0) {
1536
+ ({
1537
+ className,
1538
+ ...props
1539
+ } = t0);
1540
+ $[0] = t0;
1541
+ $[1] = className;
1542
+ $[2] = props;
1543
+ } else {
1544
+ className = $[1];
1545
+ props = $[2];
1546
+ }
1547
+ let t1;
1548
+ if ($[3] !== className) {
1549
+ t1 = cn("group/menu-item relative", className);
1550
+ $[3] = className;
1551
+ $[4] = t1;
1552
+ } else {
1553
+ t1 = $[4];
1554
+ }
1555
+ let t2;
1556
+ if ($[5] !== props || $[6] !== t1) {
1557
+ t2 = /* @__PURE__ */ jsxDEV("li", {
1558
+ "data-slot": "sidebar-menu-item",
1559
+ "data-sidebar": "menu-item",
1560
+ className: t1,
1561
+ ...props
1562
+ }, void 0, false);
1563
+ $[5] = props;
1564
+ $[6] = t1;
1565
+ $[7] = t2;
1566
+ } else {
1567
+ t2 = $[7];
1568
+ }
1569
+ return t2;
1570
+ }
1571
+ const sidebarMenuButtonVariants = cva("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-none p-2 text-start text-xs ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pe-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate", {
1572
+ variants: {
1573
+ variant: {
1574
+ default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
1575
+ outline: "bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"
1576
+ },
1577
+ size: {
1578
+ default: "h-8 text-xs",
1579
+ sm: "h-7 text-xs",
1580
+ lg: "h-12 text-xs group-data-[collapsible=icon]:p-0!"
1581
+ }
1582
+ },
1583
+ defaultVariants: {
1584
+ variant: "default",
1585
+ size: "default"
1586
+ }
1587
+ });
1588
+ function SidebarMenuButton({
1589
+ render,
1590
+ isActive = false,
1591
+ variant = "default",
1592
+ size = "default",
1593
+ tooltip,
1594
+ className,
1595
+ ...props
1596
+ }) {
1597
+ const {
1598
+ isMobile,
1599
+ state
1600
+ } = useSidebar();
1601
+ const comp = useRender({
1602
+ defaultTagName: "button",
1603
+ props: mergeProps({
1604
+ className: cn(sidebarMenuButtonVariants({
1605
+ variant,
1606
+ size
1607
+ }), className)
1608
+ }, props),
1609
+ render: !tooltip ? render : /* @__PURE__ */ jsxDEV(TooltipTrigger, {
1610
+ render
1611
+ }, void 0, false),
1612
+ state: {
1613
+ slot: "sidebar-menu-button",
1614
+ sidebar: "menu-button",
1615
+ size,
1616
+ active: isActive
1617
+ }
1618
+ });
1619
+ if (!tooltip) {
1620
+ return comp;
1621
+ }
1622
+ if (typeof tooltip === "string") {
1623
+ tooltip = {
1624
+ children: tooltip
1625
+ };
1626
+ }
1627
+ return /* @__PURE__ */ jsxDEV(Tooltip, {
1628
+ children: [comp, /* @__PURE__ */ jsxDEV(TooltipContent, {
1629
+ side: "right",
1630
+ align: "center",
1631
+ hidden: state !== "collapsed" || isMobile,
1632
+ ...tooltip
1633
+ }, void 0, false)]
1634
+ }, void 0, true);
1635
+ }
1636
+
1637
+ const lazyNamed = (load, key) => /* @__PURE__ */ lazy(() => load().then((loaded) => {
1638
+ return {
1639
+ default: loaded[key]
1640
+ };
1641
+ }));
1642
+ const InsightsPanel = lazyNamed(() => import('../packem_chunks/InsightsPanel.js'), "InsightsPanel");
1643
+ const RlsPanel = /* @__PURE__ */ lazy(() => import('../packem_chunks/rls-panel.js'));
1644
+ const SecurityAdvisorPanel = /* @__PURE__ */ lazy(() => import('../packem_chunks/SecurityAdvisorPanel.js'));
1645
+ const AgentsPanel = lazyNamed(() => import('../packem_chunks/agents-panel.js'), "AgentsPanel");
1646
+ const AnalyticsPanel = lazyNamed(() => import('../packem_chunks/analytics-panel.js'), "AnalyticsPanel");
1647
+ const ApiTab = /* @__PURE__ */ lazy(() => import('../packem_chunks/ApiTab.js'));
1648
+ const AuthConfigPanel = lazyNamed(() => import('../packem_chunks/auth-config-panel.js'), "AuthConfigPanel");
1649
+ const AuthSessionsPanel = lazyNamed(() => import('../packem_chunks/auth-sessions-panel.js'), "AuthSessionsPanel");
1650
+ const OrganizationsPanel = lazyNamed(() => import('../packem_chunks/organizations-panel.js'), "OrganizationsPanel");
1651
+ const UsersPanel = lazyNamed(() => import('../packem_chunks/users-panel.js'), "UsersPanel");
1652
+ const ContainersPanel = lazyNamed(() => import('../packem_chunks/containers-panel.js'), "ContainersPanel");
1653
+ const TableEditor = lazyNamed(() => import('../packem_chunks/TableEditor.js'), "TableEditor");
1654
+ const ExportImportPanel = lazyNamed(() => import('../packem_chunks/ExportImportPanel.js'), "ExportImportPanel");
1655
+ const MigrationsPanel = lazyNamed(() => import('../packem_chunks/MigrationsPanel.js'), "MigrationsPanel");
1656
+ const PitrPanel = lazyNamed(() => import('../packem_chunks/PitrPanel.js'), "PitrPanel");
1657
+ const FlagsPanel = lazyNamed(() => import('../packem_chunks/flags-panel.js'), "FlagsPanel");
1658
+ const FunctionRunner = lazyNamed(() => import('../packem_chunks/FunctionRunner.js'), "FunctionRunner");
1659
+ const FunctionStatsPanel = lazyNamed(() => import('../packem_chunks/FunctionStatsPanel.js'), "FunctionStatsPanel");
1660
+ const IssuesPanel = lazyNamed(() => import('../packem_chunks/issues-panel.js'), "IssuesPanel");
1661
+ const AuditPanel = lazyNamed(() => import('../packem_chunks/AuditPanel.js'), "AuditPanel");
1662
+ const LogDrainsPanel = lazyNamed(() => import('../packem_chunks/log-drains-panel.js'), "LogDrainsPanel");
1663
+ const LogsPanel = /* @__PURE__ */ lazy(() => import('../packem_chunks/LogsPanel.js').then((m) => {
1664
+ return {
1665
+ default: m.LogsPanel
1666
+ };
1667
+ }));
1668
+ const MailPanel = lazyNamed(() => import('../packem_chunks/MailPanel.js'), "MailPanel");
1669
+ const SchedulePanel = lazyNamed(() => import('../packem_chunks/schedule-panel.js'), "SchedulePanel");
1670
+ const SubscriptionsPanel = /* @__PURE__ */ lazy(() => import('../packem_chunks/subscriptions-panel.js'));
1671
+ const KvBrowser = lazyNamed(() => import('../packem_chunks/kv-browser.js'), "KvBrowser");
1672
+ const PaymentsPanel = lazyNamed(() => import('../packem_chunks/payments-panel.js'), "PaymentsPanel");
1673
+ const PermissionsPanel = lazyNamed(() => import('../packem_chunks/permissions-panel.js'), "PermissionsPanel");
1674
+ const QueuesPanel = /* @__PURE__ */ lazy(() => import('../packem_chunks/queues-panel.js'));
1675
+ const DashboardsPanel = /* @__PURE__ */ lazy(() => import('../packem_chunks/dashboards-panel.js'));
1676
+ const FanoutPanel = /* @__PURE__ */ lazy(() => import('../packem_chunks/fanout-panel.js'));
1677
+ const HealthPanel = lazyNamed(() => import('../packem_chunks/HealthPanel.js'), "HealthPanel");
1678
+ const MetricsPanel = lazyNamed(() => import('../packem_chunks/MetricsPanel.js'), "MetricsPanel");
1679
+ const SchemaViewer = lazyNamed(() => import('../packem_chunks/SchemaViewer.js'), "SchemaViewer");
1680
+ const SettingsPanel = lazyNamed(() => import('../packem_chunks/SettingsPanel.js'), "SettingsPanel");
1681
+ const SqlEditorPanel = lazyNamed(() => import('../packem_chunks/SqlEditorPanel.js'), "SqlEditorPanel");
1682
+ const FileBrowser = lazyNamed(() => import('../packem_chunks/FileBrowser.js'), "FileBrowser");
1683
+ const StorageRulesPanel = lazyNamed(() => import('../packem_chunks/storage-rules-panel.js'), "StorageRulesPanel");
1684
+ const VectorBrowser = lazyNamed(() => import('../packem_chunks/vector-browser.js'), "VectorBrowser");
1685
+ const WorkflowsPanel = /* @__PURE__ */ lazy(() => import('../packem_chunks/workflows-panel.js'));
1686
+ const StudioChromeContext = /* @__PURE__ */ createContext(null);
1687
+ const TAB_ICONS = {
1688
+ analytics: /* @__PURE__ */ jsxDEV("path", {
1689
+ d: "M5 20V10m6.5 10V4M18 20v-7M3 20h18"
1690
+ }, void 0, false),
1691
+ api: /* @__PURE__ */ jsxDEV("path", {
1692
+ d: "m9 8-4 4 4 4m6-8 4 4-4 4M13 5l-2 14"
1693
+ }, void 0, false),
1694
+ audit: /* @__PURE__ */ jsxDEV("path", {
1695
+ d: "M7 4h7l4 4v11a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1Zm6 0v5h5M9 13h6M9 16h6M9 10h2"
1696
+ }, void 0, false),
1697
+ authConfig: /* @__PURE__ */ jsxDEV("path", {
1698
+ d: "M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm7.4-3a7.4 7.4 0 0 0-.1-1.2l2-1.6-2-3.4-2.4 1a7.3 7.3 0 0 0-2-1.2l-.4-2.6h-3.6l-.4 2.6a7.3 7.3 0 0 0-2 1.2l-2.4-1-2 3.4 2 1.6a7.4 7.4 0 0 0 0 2.4l-2 1.6 2 3.4 2.4-1a7.3 7.3 0 0 0 2 1.2l.4 2.6h3.6l.4-2.6a7.3 7.3 0 0 0 2-1.2l2.4 1 2-3.4-2-1.6a7.4 7.4 0 0 0 .1-1.2Z"
1699
+ }, void 0, false),
1700
+ agents: /* @__PURE__ */ jsxDEV("path", {
1701
+ d: "M12 8V5m0 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM6 8h12a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-6a2 2 0 0 1 2-2Zm3 5h.01M15 13h.01M9 21h6"
1702
+ }, void 0, false),
1703
+ authSessions: /* @__PURE__ */ jsxDEV("path", {
1704
+ d: "M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-13.5V12l4 2"
1705
+ }, void 0, false),
1706
+ containers: /* @__PURE__ */ jsxDEV("path", {
1707
+ d: "M3 7.5 12 3l9 4.5v9L12 21l-9-4.5v-9Zm0 0 9 4.5m0 0 9-4.5m-9 4.5V21"
1708
+ }, void 0, false),
1709
+ dashboards: /* @__PURE__ */ jsxDEV("path", {
1710
+ d: "M4 5h7v6H4V5Zm9 0h7v4h-7V5ZM4 14h7v5H4v-5Zm9-1h7v6h-7v-6Z"
1711
+ }, void 0, false),
1712
+ drains: /* @__PURE__ */ jsxDEV("path", {
1713
+ d: "M5 5h14M7 5v6a5 5 0 0 0 10 0V5M10 16h4v3h-4zM12 19v2"
1714
+ }, void 0, false),
1715
+ data: /* @__PURE__ */ jsxDEV("path", {
1716
+ d: "M5 6c0-1.4 3.1-2.5 7-2.5s7 1.1 7 2.5-3.1 2.5-7 2.5S5 7.4 5 6Zm0 0v12c0 1.4 3.1 2.5 7 2.5s7-1.1 7-2.5V6M5 12c0 1.4 3.1 2.5 7 2.5s7-1.1 7-2.5"
1717
+ }, void 0, false),
1718
+ export: /* @__PURE__ */ jsxDEV("path", {
1719
+ d: "M12 3v11m0 0 4-4m-4 4-4-4M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2"
1720
+ }, void 0, false),
1721
+ fanout: /* @__PURE__ */ jsxDEV("path", {
1722
+ d: "M12 5a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm-7 16a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm14 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM12 7v3.5M12 10.5 6 17m6-6.5 6 6.5"
1723
+ }, void 0, false),
1724
+ files: /* @__PURE__ */ jsxDEV("path", {
1725
+ d: "M4 7a2 2 0 0 1 2-2h3l2 2.5h7a2 2 0 0 1 2 2V18a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V7Z"
1726
+ }, void 0, false),
1727
+ flags: /* @__PURE__ */ jsxDEV("path", {
1728
+ d: "M6 21V4m0 0h11l-2 3 2 3H6"
1729
+ }, void 0, false),
1730
+ functions: /* @__PURE__ */ jsxDEV("path", {
1731
+ d: "m9 8-4 4 4 4m6-8 4 4-4 4"
1732
+ }, void 0, false),
1733
+ health: /* @__PURE__ */ jsxDEV("path", {
1734
+ d: "M3 12h4l2 6 4-14 2 8h6"
1735
+ }, void 0, false),
1736
+ home: /* @__PURE__ */ jsxDEV("path", {
1737
+ d: "M3 11.5 12 4l9 7.5M5 10v9a1 1 0 0 0 1 1h4v-6h4v6h4a1 1 0 0 0 1-1v-9"
1738
+ }, void 0, false),
1739
+ insights: /* @__PURE__ */ jsxDEV("path", {
1740
+ d: "M12 3a6 6 0 0 0-3.6 10.8c.5.4.8.9.9 1.5l.2 1.2h5l.2-1.2c.1-.6.4-1.1.9-1.5A6 6 0 0 0 12 3ZM9.5 20.5h5M10 18h4"
1741
+ }, void 0, false),
1742
+ issues: /* @__PURE__ */ jsxDEV("path", {
1743
+ d: "M10.3 4.3 2.5 18a2 2 0 0 0 1.7 3h15.6a2 2 0 0 0 1.7-3L13.7 4.3a2 2 0 0 0-3.4 0ZM12 9v4m0 3v.01"
1744
+ }, void 0, false),
1745
+ kv: /* @__PURE__ */ jsxDEV("path", {
1746
+ d: "M5 5h14v4H5V5Zm0 5h14v4H5v-4Zm0 5h14v4H5v-4Z"
1747
+ }, void 0, false),
1748
+ logs: /* @__PURE__ */ jsxDEV("path", {
1749
+ d: "M5 6h14M5 10h14M5 14h9M5 18h11"
1750
+ }, void 0, false),
1751
+ mail: /* @__PURE__ */ jsxDEV("path", {
1752
+ d: "M4 5h16v14H4V5Zm0 1.5 8 6 8-6"
1753
+ }, void 0, false),
1754
+ payments: /* @__PURE__ */ jsxDEV("path", {
1755
+ d: "M3 7h18v10H3V7Zm0 3h18M7 14h4"
1756
+ }, void 0, false),
1757
+ metrics: /* @__PURE__ */ jsxDEV("path", {
1758
+ d: "M5 20V10m6.5 10V4M18 20v-7M3 20h18"
1759
+ }, void 0, false),
1760
+ migrations: /* @__PURE__ */ jsxDEV("path", {
1761
+ d: "M4 12a8 8 0 0 1 13.7-5.6L20 8M20 4v4h-4M20 12a8 8 0 0 1-13.7 5.6L4 16m0 4v-4h4"
1762
+ }, void 0, false),
1763
+ organizations: /* @__PURE__ */ jsxDEV("path", {
1764
+ d: "M3 21V8l6-4 6 4v13M9 21v-5h2v5M15 11h6v10M18 14v.01M18 17v.01M6 9v.01M6 12v.01M6 15v.01"
1765
+ }, void 0, false),
1766
+ permissions: /* @__PURE__ */ jsxDEV("path", {
1767
+ d: "M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3Zm-3 8 2.2 2.2L15 9.5M8.5 16h7"
1768
+ }, void 0, false),
1769
+ pitr: /* @__PURE__ */ jsxDEV("path", {
1770
+ d: "M12 21a9 9 0 1 0-9-9M12 7.5V12l3 2M3 12l-2-2m2 2 2-2"
1771
+ }, void 0, false),
1772
+ queues: /* @__PURE__ */ jsxDEV("path", {
1773
+ d: "M4 6h16M4 10h16M4 14h10M4 18h10m4-2 3 2-3 2v-4Z"
1774
+ }, void 0, false),
1775
+ realtime: /* @__PURE__ */ jsxDEV("path", {
1776
+ d: "M5 12a7 7 0 0 1 14 0M8 12a4 4 0 0 1 8 0M12 12v8m0-8a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"
1777
+ }, void 0, false),
1778
+ rls: /* @__PURE__ */ jsxDEV("path", {
1779
+ d: "M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3ZM8.5 10h7M8.5 13h7"
1780
+ }, void 0, false),
1781
+ schedule: /* @__PURE__ */ jsxDEV("path", {
1782
+ d: "M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-13.5V12l4 2"
1783
+ }, void 0, false),
1784
+ schema: /* @__PURE__ */ jsxDEV("path", {
1785
+ d: "M4 5h16v14H4V5Zm0 5h16M10 10v9M4 14.5h16"
1786
+ }, void 0, false),
1787
+ sql: /* @__PURE__ */ jsxDEV("path", {
1788
+ d: "M4 5h16v14H4V5Zm3 4 3 3-3 3m6 0h4"
1789
+ }, void 0, false),
1790
+ storageRules: /* @__PURE__ */ jsxDEV("path", {
1791
+ d: "M7 10V7a5 5 0 0 1 10 0v3m-11 0h12a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1Zm6 4v2"
1792
+ }, void 0, false),
1793
+ security: /* @__PURE__ */ jsxDEV("path", {
1794
+ d: "M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3Zm-2.5 8.5 2 2 4-4"
1795
+ }, void 0, false),
1796
+ settings: /* @__PURE__ */ jsxDEV("path", {
1797
+ d: "M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm7.4-3a7.4 7.4 0 0 0-.1-1.2l2-1.6-2-3.4-2.4 1a7.3 7.3 0 0 0-2-1.2l-.4-2.6H10.5l-.4 2.6a7.3 7.3 0 0 0-2 1.2l-2.4-1-2 3.4 2 1.6a7.4 7.4 0 0 0 0 2.4l-2 1.6 2 3.4 2.4-1a7.3 7.3 0 0 0 2 1.2l.4 2.6h3.6l.4-2.6a7.3 7.3 0 0 0 2-1.2l2.4 1 2-3.4-2-1.6a7.4 7.4 0 0 0 .1-1.2Z"
1798
+ }, void 0, false),
1799
+ users: /* @__PURE__ */ jsxDEV("path", {
1800
+ d: "M16 20v-2a4 4 0 0 0-4-4H7a4 4 0 0 0-4 4v2M9.5 10a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Zm11.5 10v-2a4 4 0 0 0-3-3.85M16 3.13A4 4 0 0 1 16 11"
1801
+ }, void 0, false),
1802
+ vectors: /* @__PURE__ */ jsxDEV("path", {
1803
+ d: "M4 7l8-4 8 4-8 4-8-4Zm0 5 8 4 8-4M4 17l8 4 8-4"
1804
+ }, void 0, false),
1805
+ workflows: /* @__PURE__ */ jsxDEV("path", {
1806
+ d: "M5 5h5v5H5V5Zm9 9h5v5h-5v-5ZM7.5 10v2a2 2 0 0 0 2 2H14m2.5-4V8a2 2 0 0 0-2-2H10"
1807
+ }, void 0, false)
1808
+ };
1809
+ const NAV_GROUPS = [{
1810
+ key: "overview",
1811
+ tabs: ["home", "dashboards"]
1812
+ }, {
1813
+ key: "database",
1814
+ tabs: ["data", "sql", "schema", "migrations", "vectors", "pitr", "export"]
1815
+ }, {
1816
+ key: "functions",
1817
+ tabs: ["functions", "api", "workflows", "agents", "queues"]
1818
+ }, {
1819
+ key: "auth",
1820
+ tabs: ["users", "organizations", "authSessions", "authConfig"]
1821
+ }, {
1822
+ key: "storage",
1823
+ tabs: ["files", "storageRules", "kv"]
1824
+ }, {
1825
+ key: "observability",
1826
+ tabs: ["issues", "logs", "audit", "realtime", "fanout", "containers", "metrics", "analytics", "health"]
1827
+ }, {
1828
+ key: "advisors",
1829
+ tabs: ["security", "rls", "permissions", "insights"]
1830
+ }, {
1831
+ key: "operations",
1832
+ tabs: ["schedule", "mail", "drains", "payments", "flags"]
1833
+ }, {
1834
+ key: "settings",
1835
+ tabs: ["settings"]
1836
+ }];
1837
+ const TAB_FEATURE = {
1838
+ analytics: "analytics",
1839
+ authConfig: "auth",
1840
+ authSessions: "auth",
1841
+ containers: "containers",
1842
+ files: "storage",
1843
+ flags: "flags",
1844
+ kv: "kv",
1845
+ mail: "mail",
1846
+ organizations: "auth",
1847
+ payments: "payments",
1848
+ queues: "queues",
1849
+ schedule: "scheduler",
1850
+ storageRules: "storage",
1851
+ users: "auth",
1852
+ vectors: "vectors",
1853
+ workflows: "workflows"
1854
+ };
1855
+ const isTabVisible = (tab, features) => {
1856
+ const feature = TAB_FEATURE[tab];
1857
+ return feature === void 0 || features[feature];
1858
+ };
1859
+ const TabIcon = (t0) => {
1860
+ const $ = c(2);
1861
+ const {
1862
+ tab
1863
+ } = t0;
1864
+ const t1 = TAB_ICONS[tab];
1865
+ let t2;
1866
+ if ($[0] !== t1) {
1867
+ t2 = /* @__PURE__ */ jsxDEV("svg", {
1868
+ "aria-hidden": "true",
1869
+ className: "size-4 shrink-0",
1870
+ fill: "none",
1871
+ stroke: "currentColor",
1872
+ strokeLinecap: "round",
1873
+ strokeLinejoin: "round",
1874
+ strokeWidth: 1.6,
1875
+ viewBox: "0 0 24 24",
1876
+ children: t1
1877
+ }, void 0, false);
1878
+ $[0] = t1;
1879
+ $[1] = t2;
1880
+ } else {
1881
+ t2 = $[1];
1882
+ }
1883
+ return t2;
1884
+ };
1885
+ const exhaustiveRouteTabs = (tabs) => tabs;
1886
+ const TABS = exhaustiveRouteTabs(["home", "data", "sql", "functions", "api", "workflows", "agents", "queues", "containers", "schema", "migrations", "vectors", "export", "pitr", "users", "organizations", "authSessions", "authConfig", "files", "storageRules", "kv", "dashboards", "metrics", "analytics", "health", "security", "rls", "permissions", "insights", "issues", "logs", "realtime", "fanout", "mail", "payments", "audit", "schedule", "drains", "flags", "settings"]);
1887
+ const FULL_HEIGHT_TABS = /* @__PURE__ */ new Set(["api", "data", "sql"]);
1888
+ const tabFromPathname = (pathname) => {
1889
+ const slug = pathname.split("/").findLast(Boolean) ?? "";
1890
+ return TABS.includes(slug) ? slug : "home";
1891
+ };
1892
+ const ConnectPopoverContent = (t0) => {
1893
+ const $ = c(19);
1894
+ const {
1895
+ chrome,
1896
+ connected
1897
+ } = t0;
1898
+ const t = useT();
1899
+ let t1;
1900
+ if ($[0] !== t) {
1901
+ t1 = t("admin token");
1902
+ $[0] = t;
1903
+ $[1] = t1;
1904
+ } else {
1905
+ t1 = $[1];
1906
+ }
1907
+ let t2;
1908
+ if ($[2] !== t1) {
1909
+ t2 = /* @__PURE__ */ jsxDEV("label", {
1910
+ className: "text-xs font-medium text-foreground",
1911
+ htmlFor: "dash-app-token",
1912
+ children: t1
1913
+ }, void 0, false);
1914
+ $[2] = t1;
1915
+ $[3] = t2;
1916
+ } else {
1917
+ t2 = $[3];
1918
+ }
1919
+ let t3;
1920
+ if ($[4] !== chrome.onTokenChange || $[5] !== chrome.token) {
1921
+ t3 = /* @__PURE__ */ jsxDEV(Input, {
1922
+ className: "h-8",
1923
+ "data-testid": "dash-app-token",
1924
+ id: "dash-app-token",
1925
+ onChange: chrome.onTokenChange,
1926
+ placeholder: "LUNORA_ADMIN_TOKEN",
1927
+ type: "password",
1928
+ value: chrome.token
1929
+ }, void 0, false);
1930
+ $[4] = chrome.onTokenChange;
1931
+ $[5] = chrome.token;
1932
+ $[6] = t3;
1933
+ } else {
1934
+ t3 = $[6];
1935
+ }
1936
+ let t4;
1937
+ if ($[7] !== connected || $[8] !== t) {
1938
+ t4 = connected && /* @__PURE__ */ jsxDEV("p", {
1939
+ className: "flex items-start gap-1.5 text-[11px] text-muted-foreground",
1940
+ "data-testid": "dash-app-token-warning",
1941
+ role: "note",
1942
+ children: [/* @__PURE__ */ jsxDEV("span", {
1943
+ "aria-hidden": "true",
1944
+ className: "text-warning",
1945
+ children: "⚠"
1946
+ }, void 0, false), t("Token rides the WebSocket URL — it can surface in browser DevTools and server logs. Use a dev-only token.")]
1947
+ }, void 0, true);
1948
+ $[7] = connected;
1949
+ $[8] = t;
1950
+ $[9] = t4;
1951
+ } else {
1952
+ t4 = $[9];
1953
+ }
1954
+ let t5;
1955
+ if ($[10] !== chrome.clearToken || $[11] !== connected || $[12] !== t) {
1956
+ t5 = connected && /* @__PURE__ */ jsxDEV("button", {
1957
+ className: "self-start rounded-md border border-border px-2.5 py-1 text-xs font-medium outline-none transition-colors hover:bg-accent focus-visible:bg-accent",
1958
+ "data-testid": "dash-app-clear-token",
1959
+ onClick: chrome.clearToken,
1960
+ type: "button",
1961
+ children: t("Clear")
1962
+ }, void 0, false);
1963
+ $[10] = chrome.clearToken;
1964
+ $[11] = connected;
1965
+ $[12] = t;
1966
+ $[13] = t5;
1967
+ } else {
1968
+ t5 = $[13];
1969
+ }
1970
+ let t6;
1971
+ if ($[14] !== t2 || $[15] !== t3 || $[16] !== t4 || $[17] !== t5) {
1972
+ t6 = /* @__PURE__ */ jsxDEV("div", {
1973
+ className: "flex flex-col gap-2",
1974
+ children: [t2, t3, t4, t5]
1975
+ }, void 0, true);
1976
+ $[14] = t2;
1977
+ $[15] = t3;
1978
+ $[16] = t4;
1979
+ $[17] = t5;
1980
+ $[18] = t6;
1981
+ } else {
1982
+ t6 = $[18];
1983
+ }
1984
+ return t6;
1985
+ };
1986
+ const CollapsedGroupNav = (t0) => {
1987
+ const $ = c(25);
1988
+ const {
1989
+ current,
1990
+ group,
1991
+ groupLabel,
1992
+ selectTab,
1993
+ tabDescription,
1994
+ tabLabel
1995
+ } = t0;
1996
+ const t1 = group.tabs.includes(current) ? "page" : void 0;
1997
+ const t2 = groupLabel[group.key];
1998
+ const t3 = group.tabs[0];
1999
+ let t4;
2000
+ if ($[0] !== t3) {
2001
+ t4 = /* @__PURE__ */ jsxDEV(TabIcon, {
2002
+ tab: t3
2003
+ }, void 0, false);
2004
+ $[0] = t3;
2005
+ $[1] = t4;
2006
+ } else {
2007
+ t4 = $[1];
2008
+ }
2009
+ let t5;
2010
+ if ($[2] !== t1 || $[3] !== t2 || $[4] !== t4) {
2011
+ t5 = /* @__PURE__ */ jsxDEV(PopoverTrigger, {
2012
+ "aria-current": t1,
2013
+ "aria-label": t2,
2014
+ className: "mx-auto flex size-8 items-center justify-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:bg-sidebar-accent data-[popup-open]:bg-sidebar-accent data-[popup-open]:text-sidebar-accent-foreground data-[popup-open]:shadow-xs aria-[current=page]:bg-sidebar-accent aria-[current=page]:text-sidebar-accent-foreground aria-[current=page]:shadow-xs",
2015
+ delay: 120,
2016
+ openOnHover: true,
2017
+ children: t4
2018
+ }, void 0, false);
2019
+ $[2] = t1;
2020
+ $[3] = t2;
2021
+ $[4] = t4;
2022
+ $[5] = t5;
2023
+ } else {
2024
+ t5 = $[5];
2025
+ }
2026
+ const t6 = groupLabel[group.key];
2027
+ let t7;
2028
+ if ($[6] !== t6) {
2029
+ t7 = /* @__PURE__ */ jsxDEV("div", {
2030
+ className: "px-2 py-1.5 text-[11px] font-medium tracking-wider text-muted-foreground uppercase",
2031
+ children: t6
2032
+ }, void 0, false);
2033
+ $[6] = t6;
2034
+ $[7] = t7;
2035
+ } else {
2036
+ t7 = $[7];
2037
+ }
2038
+ let t8;
2039
+ if ($[8] !== current || $[9] !== group.tabs || $[10] !== selectTab || $[11] !== tabDescription || $[12] !== tabLabel) {
2040
+ let t92;
2041
+ if ($[14] !== current || $[15] !== selectTab || $[16] !== tabDescription || $[17] !== tabLabel) {
2042
+ t92 = (tab) => /* @__PURE__ */ jsxDEV("button", {
2043
+ "aria-current": current === tab ? "page" : void 0,
2044
+ className: "flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-start text-[13px] text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent aria-[current=page]:bg-accent aria-[current=page]:font-medium [&_svg]:opacity-70 aria-[current=page]:[&_svg]:opacity-100",
2045
+ "data-tab": tab,
2046
+ "data-testid": `dash-tab-${tab}`,
2047
+ onClick: selectTab,
2048
+ title: tabDescription[tab],
2049
+ type: "button",
2050
+ children: [/* @__PURE__ */ jsxDEV(TabIcon, {
2051
+ tab
2052
+ }, void 0, false), /* @__PURE__ */ jsxDEV("span", {
2053
+ children: tabLabel[tab]
2054
+ }, void 0, false)]
2055
+ }, tab, true);
2056
+ $[14] = current;
2057
+ $[15] = selectTab;
2058
+ $[16] = tabDescription;
2059
+ $[17] = tabLabel;
2060
+ $[18] = t92;
2061
+ } else {
2062
+ t92 = $[18];
2063
+ }
2064
+ t8 = group.tabs.map(t92);
2065
+ $[8] = current;
2066
+ $[9] = group.tabs;
2067
+ $[10] = selectTab;
2068
+ $[11] = tabDescription;
2069
+ $[12] = tabLabel;
2070
+ $[13] = t8;
2071
+ } else {
2072
+ t8 = $[13];
2073
+ }
2074
+ let t9;
2075
+ if ($[19] !== t7 || $[20] !== t8) {
2076
+ t9 = /* @__PURE__ */ jsxDEV(PopoverContent, {
2077
+ align: "start",
2078
+ className: "w-56 p-1",
2079
+ side: "right",
2080
+ sideOffset: 8,
2081
+ children: [t7, t8]
2082
+ }, void 0, true);
2083
+ $[19] = t7;
2084
+ $[20] = t8;
2085
+ $[21] = t9;
2086
+ } else {
2087
+ t9 = $[21];
2088
+ }
2089
+ let t10;
2090
+ if ($[22] !== t5 || $[23] !== t9) {
2091
+ t10 = /* @__PURE__ */ jsxDEV(Popover, {
2092
+ children: [t5, t9]
2093
+ }, void 0, true);
2094
+ $[22] = t5;
2095
+ $[23] = t9;
2096
+ $[24] = t10;
2097
+ } else {
2098
+ t10 = $[24];
2099
+ }
2100
+ return t10;
2101
+ };
2102
+ const SidebarFooterProfile = (t0) => {
2103
+ const $ = c(45);
2104
+ const {
2105
+ chrome,
2106
+ collapsed,
2107
+ connected
2108
+ } = t0;
2109
+ const t = useT();
2110
+ if (chrome === null) {
2111
+ let t14;
2112
+ if ($[0] !== t) {
2113
+ t14 = t("Admin");
2114
+ $[0] = t;
2115
+ $[1] = t14;
2116
+ } else {
2117
+ t14 = $[1];
2118
+ }
2119
+ let t22;
2120
+ if ($[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2121
+ t22 = /* @__PURE__ */ jsxDEV("span", {
2122
+ className: "flex size-8 items-center justify-center rounded-full bg-sidebar-accent text-[11px] font-medium",
2123
+ children: "C"
2124
+ }, void 0, false);
2125
+ $[2] = t22;
2126
+ } else {
2127
+ t22 = $[2];
2128
+ }
2129
+ let t32;
2130
+ if ($[3] !== t) {
2131
+ t32 = t("Admin");
2132
+ $[3] = t;
2133
+ $[4] = t32;
2134
+ } else {
2135
+ t32 = $[4];
2136
+ }
2137
+ let t42;
2138
+ if ($[5] !== t32) {
2139
+ t42 = /* @__PURE__ */ jsxDEV("span", {
2140
+ className: "truncate text-[13px] font-medium",
2141
+ children: t32
2142
+ }, void 0, false);
2143
+ $[5] = t32;
2144
+ $[6] = t42;
2145
+ } else {
2146
+ t42 = $[6];
2147
+ }
2148
+ let t52;
2149
+ if ($[7] !== t) {
2150
+ t52 = t("Studio");
2151
+ $[7] = t;
2152
+ $[8] = t52;
2153
+ } else {
2154
+ t52 = $[8];
2155
+ }
2156
+ let t62;
2157
+ if ($[9] !== t52) {
2158
+ t62 = /* @__PURE__ */ jsxDEV("span", {
2159
+ className: "truncate text-[11px] text-muted-foreground",
2160
+ children: t52
2161
+ }, void 0, false);
2162
+ $[9] = t52;
2163
+ $[10] = t62;
2164
+ } else {
2165
+ t62 = $[10];
2166
+ }
2167
+ let t72;
2168
+ if ($[11] !== t42 || $[12] !== t62) {
2169
+ t72 = /* @__PURE__ */ jsxDEV("span", {
2170
+ className: "grid flex-1 text-start leading-tight",
2171
+ children: [t42, t62]
2172
+ }, void 0, true);
2173
+ $[11] = t42;
2174
+ $[12] = t62;
2175
+ $[13] = t72;
2176
+ } else {
2177
+ t72 = $[13];
2178
+ }
2179
+ let t82;
2180
+ if ($[14] !== t14 || $[15] !== t72) {
2181
+ t82 = /* @__PURE__ */ jsxDEV(SidebarMenuButton, {
2182
+ className: "data-active:bg-transparent",
2183
+ size: "lg",
2184
+ tooltip: t14,
2185
+ children: [t22, t72]
2186
+ }, void 0, true);
2187
+ $[14] = t14;
2188
+ $[15] = t72;
2189
+ $[16] = t82;
2190
+ } else {
2191
+ t82 = $[16];
2192
+ }
2193
+ return t82;
2194
+ }
2195
+ const t1 = collapsed ? "mx-auto size-8 justify-center" : "w-full p-2";
2196
+ let t2;
2197
+ if ($[17] !== t1) {
2198
+ t2 = cn("flex items-center gap-2 rounded-md text-start outline-none transition-colors hover:bg-sidebar-accent focus-visible:bg-sidebar-accent", t1);
2199
+ $[17] = t1;
2200
+ $[18] = t2;
2201
+ } else {
2202
+ t2 = $[18];
2203
+ }
2204
+ let t3;
2205
+ if ($[19] !== connected || $[20] !== t) {
2206
+ t3 = connected ? t("Connected") : t("Not connected");
2207
+ $[19] = connected;
2208
+ $[20] = t;
2209
+ $[21] = t3;
2210
+ } else {
2211
+ t3 = $[21];
2212
+ }
2213
+ const t4 = connected ? "bg-success" : "bg-muted-foreground/50";
2214
+ let t5;
2215
+ if ($[22] !== t4) {
2216
+ t5 = cn("absolute -end-0.5 -bottom-0.5 size-2.5 rounded-full border-2 border-sidebar", t4);
2217
+ $[22] = t4;
2218
+ $[23] = t5;
2219
+ } else {
2220
+ t5 = $[23];
2221
+ }
2222
+ let t6;
2223
+ if ($[24] !== t5) {
2224
+ t6 = /* @__PURE__ */ jsxDEV("span", {
2225
+ className: "relative flex size-8 shrink-0 items-center justify-center rounded-full bg-sidebar-accent text-[11px] font-medium",
2226
+ children: ["C", /* @__PURE__ */ jsxDEV("span", {
2227
+ "aria-hidden": "true",
2228
+ className: t5
2229
+ }, void 0, false)]
2230
+ }, void 0, true);
2231
+ $[24] = t5;
2232
+ $[25] = t6;
2233
+ } else {
2234
+ t6 = $[25];
2235
+ }
2236
+ let t7;
2237
+ if ($[26] !== collapsed || $[27] !== connected || $[28] !== t) {
2238
+ t7 = !collapsed && /* @__PURE__ */ jsxDEV(Fragment, {
2239
+ children: [/* @__PURE__ */ jsxDEV("span", {
2240
+ className: "grid flex-1 text-start leading-tight",
2241
+ children: [/* @__PURE__ */ jsxDEV("span", {
2242
+ className: "truncate text-[13px] font-medium",
2243
+ children: t("Admin")
2244
+ }, void 0, false), /* @__PURE__ */ jsxDEV("span", {
2245
+ className: "truncate text-[11px] text-muted-foreground",
2246
+ children: connected ? t("Connected") : t("Not connected")
2247
+ }, void 0, false)]
2248
+ }, void 0, true), /* @__PURE__ */ jsxDEV("svg", {
2249
+ "aria-hidden": "true",
2250
+ className: "size-4 text-muted-foreground",
2251
+ fill: "none",
2252
+ stroke: "currentColor",
2253
+ strokeWidth: 1.7,
2254
+ viewBox: "0 0 24 24",
2255
+ children: /* @__PURE__ */ jsxDEV("path", {
2256
+ d: "m8 9 4-4 4 4M8 15l4 4 4-4",
2257
+ strokeLinecap: "round",
2258
+ strokeLinejoin: "round"
2259
+ }, void 0, false)
2260
+ }, void 0, false)]
2261
+ }, void 0, true);
2262
+ $[26] = collapsed;
2263
+ $[27] = connected;
2264
+ $[28] = t;
2265
+ $[29] = t7;
2266
+ } else {
2267
+ t7 = $[29];
2268
+ }
2269
+ let t8;
2270
+ if ($[30] !== t2 || $[31] !== t3 || $[32] !== t6 || $[33] !== t7) {
2271
+ t8 = /* @__PURE__ */ jsxDEV(PopoverTrigger, {
2272
+ className: t2,
2273
+ "data-testid": "dash-app-connect",
2274
+ title: t3,
2275
+ children: [t6, t7]
2276
+ }, void 0, true);
2277
+ $[30] = t2;
2278
+ $[31] = t3;
2279
+ $[32] = t6;
2280
+ $[33] = t7;
2281
+ $[34] = t8;
2282
+ } else {
2283
+ t8 = $[34];
2284
+ }
2285
+ const t9 = collapsed ? "end" : "start";
2286
+ const t10 = collapsed ? "right" : "top";
2287
+ let t11;
2288
+ if ($[35] !== chrome || $[36] !== connected) {
2289
+ t11 = /* @__PURE__ */ jsxDEV(ConnectPopoverContent, {
2290
+ chrome,
2291
+ connected
2292
+ }, void 0, false);
2293
+ $[35] = chrome;
2294
+ $[36] = connected;
2295
+ $[37] = t11;
2296
+ } else {
2297
+ t11 = $[37];
2298
+ }
2299
+ let t12;
2300
+ if ($[38] !== t10 || $[39] !== t11 || $[40] !== t9) {
2301
+ t12 = /* @__PURE__ */ jsxDEV(PopoverContent, {
2302
+ align: t9,
2303
+ keepMounted: true,
2304
+ side: t10,
2305
+ children: t11
2306
+ }, void 0, false);
2307
+ $[38] = t10;
2308
+ $[39] = t11;
2309
+ $[40] = t9;
2310
+ $[41] = t12;
2311
+ } else {
2312
+ t12 = $[41];
2313
+ }
2314
+ let t13;
2315
+ if ($[42] !== t12 || $[43] !== t8) {
2316
+ t13 = /* @__PURE__ */ jsxDEV(Popover, {
2317
+ children: [t8, t12]
2318
+ }, void 0, true);
2319
+ $[42] = t12;
2320
+ $[43] = t8;
2321
+ $[44] = t13;
2322
+ } else {
2323
+ t13 = $[44];
2324
+ }
2325
+ return t13;
2326
+ };
2327
+ const StudioSidebar = (t0) => {
2328
+ const $ = c(28);
2329
+ const {
2330
+ chrome,
2331
+ connected,
2332
+ current,
2333
+ groupLabel,
2334
+ groups,
2335
+ selectTab,
2336
+ tabDescription,
2337
+ tabLabel
2338
+ } = t0;
2339
+ const t = useT();
2340
+ const {
2341
+ state
2342
+ } = useSidebar();
2343
+ const collapsed = state === "collapsed";
2344
+ const t1 = collapsed && "justify-center px-0";
2345
+ let t2;
2346
+ if ($[0] !== t1) {
2347
+ t2 = cn("flex items-center gap-2.5 px-1.5 py-1", t1);
2348
+ $[0] = t1;
2349
+ $[1] = t2;
2350
+ } else {
2351
+ t2 = $[1];
2352
+ }
2353
+ let t3;
2354
+ if ($[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2355
+ t3 = /* @__PURE__ */ jsxDEV(BrandMark, {
2356
+ className: "size-9 shrink-0 text-foreground"
2357
+ }, void 0, false);
2358
+ $[2] = t3;
2359
+ } else {
2360
+ t3 = $[2];
2361
+ }
2362
+ let t4;
2363
+ if ($[3] !== collapsed || $[4] !== connected || $[5] !== t) {
2364
+ t4 = !collapsed && /* @__PURE__ */ jsxDEV(Fragment, {
2365
+ children: [/* @__PURE__ */ jsxDEV("span", {
2366
+ className: "grid flex-1 leading-tight",
2367
+ children: [/* @__PURE__ */ jsxDEV("span", {
2368
+ className: "truncate text-sm font-semibold text-foreground",
2369
+ children: "lunora"
2370
+ }, void 0, false), /* @__PURE__ */ jsxDEV("span", {
2371
+ className: "truncate text-[11px] text-muted-foreground",
2372
+ children: t("Studio")
2373
+ }, void 0, false)]
2374
+ }, void 0, true), /* @__PURE__ */ jsxDEV(Badge, {
2375
+ className: "px-1.5 text-[10px] tracking-wider uppercase",
2376
+ variant: "secondary",
2377
+ children: connected ? t("Live") : t("Local")
2378
+ }, void 0, false)]
2379
+ }, void 0, true);
2380
+ $[3] = collapsed;
2381
+ $[4] = connected;
2382
+ $[5] = t;
2383
+ $[6] = t4;
2384
+ } else {
2385
+ t4 = $[6];
2386
+ }
2387
+ let t5;
2388
+ if ($[7] !== t2 || $[8] !== t4) {
2389
+ t5 = /* @__PURE__ */ jsxDEV(SidebarHeader, {
2390
+ children: /* @__PURE__ */ jsxDEV("div", {
2391
+ className: t2,
2392
+ children: [t3, t4]
2393
+ }, void 0, true)
2394
+ }, void 0, false);
2395
+ $[7] = t2;
2396
+ $[8] = t4;
2397
+ $[9] = t5;
2398
+ } else {
2399
+ t5 = $[9];
2400
+ }
2401
+ let t6;
2402
+ if ($[10] !== collapsed || $[11] !== current || $[12] !== groupLabel || $[13] !== groups || $[14] !== selectTab || $[15] !== tabDescription || $[16] !== tabLabel) {
2403
+ t6 = collapsed ? groups.map((group) => /* @__PURE__ */ jsxDEV(CollapsedGroupNav, {
2404
+ current,
2405
+ group,
2406
+ groupLabel,
2407
+ selectTab,
2408
+ tabDescription,
2409
+ tabLabel
2410
+ }, group.key, false)) : groups.map((group_0) => /* @__PURE__ */ jsxDEV(SidebarGroup, {
2411
+ children: [/* @__PURE__ */ jsxDEV(SidebarGroupLabel, {
2412
+ className: "text-[11px] font-medium tracking-wider uppercase",
2413
+ children: groupLabel[group_0.key]
2414
+ }, void 0, false), /* @__PURE__ */ jsxDEV(SidebarGroupContent, {
2415
+ children: /* @__PURE__ */ jsxDEV(SidebarMenu, {
2416
+ children: group_0.tabs.map((tab) => /* @__PURE__ */ jsxDEV(SidebarMenuItem, {
2417
+ children: /* @__PURE__ */ jsxDEV(SidebarMenuButton, {
2418
+ className: "data-active:text-foreground dark:data-active:text-royal-amethyst data-active:shadow-[inset_2px_0_0_0_var(--royal-amethyst)]",
2419
+ "data-tab": tab,
2420
+ "data-testid": `dash-tab-${tab}`,
2421
+ isActive: current === tab,
2422
+ onClick: selectTab,
2423
+ title: tabDescription[tab],
2424
+ tooltip: tabDescription[tab],
2425
+ children: [/* @__PURE__ */ jsxDEV(TabIcon, {
2426
+ tab
2427
+ }, void 0, false), /* @__PURE__ */ jsxDEV("span", {
2428
+ children: tabLabel[tab]
2429
+ }, void 0, false)]
2430
+ }, void 0, true)
2431
+ }, tab, false))
2432
+ }, void 0, false)
2433
+ }, void 0, false)]
2434
+ }, group_0.key, true));
2435
+ $[10] = collapsed;
2436
+ $[11] = current;
2437
+ $[12] = groupLabel;
2438
+ $[13] = groups;
2439
+ $[14] = selectTab;
2440
+ $[15] = tabDescription;
2441
+ $[16] = tabLabel;
2442
+ $[17] = t6;
2443
+ } else {
2444
+ t6 = $[17];
2445
+ }
2446
+ let t7;
2447
+ if ($[18] !== t6) {
2448
+ t7 = /* @__PURE__ */ jsxDEV(SidebarContent, {
2449
+ children: t6
2450
+ }, void 0, false);
2451
+ $[18] = t6;
2452
+ $[19] = t7;
2453
+ } else {
2454
+ t7 = $[19];
2455
+ }
2456
+ let t8;
2457
+ if ($[20] !== chrome || $[21] !== collapsed || $[22] !== connected) {
2458
+ t8 = /* @__PURE__ */ jsxDEV(SidebarFooter, {
2459
+ children: /* @__PURE__ */ jsxDEV(SidebarMenu, {
2460
+ children: /* @__PURE__ */ jsxDEV(SidebarMenuItem, {
2461
+ children: /* @__PURE__ */ jsxDEV(SidebarFooterProfile, {
2462
+ chrome,
2463
+ collapsed,
2464
+ connected
2465
+ }, void 0, false)
2466
+ }, void 0, false)
2467
+ }, void 0, false)
2468
+ }, void 0, false);
2469
+ $[20] = chrome;
2470
+ $[21] = collapsed;
2471
+ $[22] = connected;
2472
+ $[23] = t8;
2473
+ } else {
2474
+ t8 = $[23];
2475
+ }
2476
+ let t9;
2477
+ if ($[24] !== t5 || $[25] !== t7 || $[26] !== t8) {
2478
+ t9 = /* @__PURE__ */ jsxDEV(Sidebar, {
2479
+ collapsible: "icon",
2480
+ variant: "inset",
2481
+ children: [t5, t7, t8]
2482
+ }, void 0, true);
2483
+ $[24] = t5;
2484
+ $[25] = t7;
2485
+ $[26] = t8;
2486
+ $[27] = t9;
2487
+ } else {
2488
+ t9 = $[27];
2489
+ }
2490
+ return t9;
2491
+ };
2492
+ const RoutePending = () => {
2493
+ const $ = c(1);
2494
+ let t0;
2495
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2496
+ t0 = /* @__PURE__ */ jsxDEV("div", {
2497
+ className: "flex flex-col gap-4",
2498
+ "data-testid": "dash-pending",
2499
+ children: [/* @__PURE__ */ jsxDEV("div", {
2500
+ className: "flex items-center gap-2",
2501
+ children: [/* @__PURE__ */ jsxDEV(Skeleton, {
2502
+ className: "h-8 w-40"
2503
+ }, void 0, false), /* @__PURE__ */ jsxDEV(Skeleton, {
2504
+ className: "h-8 w-24"
2505
+ }, void 0, false)]
2506
+ }, void 0, true), /* @__PURE__ */ jsxDEV(Skeleton, {
2507
+ className: "h-72 w-full"
2508
+ }, void 0, false)]
2509
+ }, void 0, true);
2510
+ $[0] = t0;
2511
+ } else {
2512
+ t0 = $[0];
2513
+ }
2514
+ return t0;
2515
+ };
2516
+ const StudioLayout = () => {
2517
+ const $ = c(306);
2518
+ const t = useT();
2519
+ const navigate = useNavigate();
2520
+ let t0;
2521
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2522
+ t0 = {
2523
+ select: _temp
2524
+ };
2525
+ $[0] = t0;
2526
+ } else {
2527
+ t0 = $[0];
2528
+ }
2529
+ const pathname = useRouterState(t0);
2530
+ let current;
2531
+ let t1;
2532
+ if ($[1] !== pathname) {
2533
+ current = tabFromPathname(pathname);
2534
+ t1 = FULL_HEIGHT_TABS.has(current);
2535
+ $[1] = pathname;
2536
+ $[2] = current;
2537
+ $[3] = t1;
2538
+ } else {
2539
+ current = $[2];
2540
+ t1 = $[3];
2541
+ }
2542
+ const fullHeight = t1;
2543
+ const features = useStudioFeatures();
2544
+ let t2;
2545
+ if ($[4] !== features) {
2546
+ t2 = (group) => ({
2547
+ ...group,
2548
+ tabs: group.tabs.filter((tab) => isTabVisible(tab, features))
2549
+ });
2550
+ $[4] = features;
2551
+ $[5] = t2;
2552
+ } else {
2553
+ t2 = $[5];
2554
+ }
2555
+ const visibleGroups = NAV_GROUPS.map(t2).filter(_temp2);
2556
+ let t3;
2557
+ let t4;
2558
+ if ($[6] !== current || $[7] !== features || $[8] !== navigate) {
2559
+ t3 = () => {
2560
+ if (!isTabVisible(current, features)) {
2561
+ fireAndForget(navigate({
2562
+ replace: true,
2563
+ to: "/home"
2564
+ }));
2565
+ }
2566
+ };
2567
+ t4 = [current, features, navigate];
2568
+ $[6] = current;
2569
+ $[7] = features;
2570
+ $[8] = navigate;
2571
+ $[9] = t3;
2572
+ $[10] = t4;
2573
+ } else {
2574
+ t3 = $[9];
2575
+ t4 = $[10];
2576
+ }
2577
+ useEffect(t3, t4);
2578
+ let t5;
2579
+ if ($[11] !== t) {
2580
+ t5 = t("Agents");
2581
+ $[11] = t;
2582
+ $[12] = t5;
2583
+ } else {
2584
+ t5 = $[12];
2585
+ }
2586
+ let t6;
2587
+ if ($[13] !== t) {
2588
+ t6 = t("Analytics");
2589
+ $[13] = t;
2590
+ $[14] = t6;
2591
+ } else {
2592
+ t6 = $[14];
2593
+ }
2594
+ let t7;
2595
+ if ($[15] !== t) {
2596
+ t7 = t("API");
2597
+ $[15] = t;
2598
+ $[16] = t7;
2599
+ } else {
2600
+ t7 = $[16];
2601
+ }
2602
+ let t8;
2603
+ if ($[17] !== t) {
2604
+ t8 = t("Audit");
2605
+ $[17] = t;
2606
+ $[18] = t8;
2607
+ } else {
2608
+ t8 = $[18];
2609
+ }
2610
+ let t9;
2611
+ if ($[19] !== t) {
2612
+ t9 = t("Configuration");
2613
+ $[19] = t;
2614
+ $[20] = t9;
2615
+ } else {
2616
+ t9 = $[20];
2617
+ }
2618
+ let t10;
2619
+ if ($[21] !== t) {
2620
+ t10 = t("Sessions");
2621
+ $[21] = t;
2622
+ $[22] = t10;
2623
+ } else {
2624
+ t10 = $[22];
2625
+ }
2626
+ let t11;
2627
+ if ($[23] !== t) {
2628
+ t11 = t("Containers");
2629
+ $[23] = t;
2630
+ $[24] = t11;
2631
+ } else {
2632
+ t11 = $[24];
2633
+ }
2634
+ let t12;
2635
+ if ($[25] !== t) {
2636
+ t12 = t("Dashboards");
2637
+ $[25] = t;
2638
+ $[26] = t12;
2639
+ } else {
2640
+ t12 = $[26];
2641
+ }
2642
+ let t13;
2643
+ if ($[27] !== t) {
2644
+ t13 = t("Data");
2645
+ $[27] = t;
2646
+ $[28] = t13;
2647
+ } else {
2648
+ t13 = $[28];
2649
+ }
2650
+ let t14;
2651
+ if ($[29] !== t) {
2652
+ t14 = t("Log drains");
2653
+ $[29] = t;
2654
+ $[30] = t14;
2655
+ } else {
2656
+ t14 = $[30];
2657
+ }
2658
+ let t15;
2659
+ if ($[31] !== t) {
2660
+ t15 = t("Export / Import");
2661
+ $[31] = t;
2662
+ $[32] = t15;
2663
+ } else {
2664
+ t15 = $[32];
2665
+ }
2666
+ let t16;
2667
+ if ($[33] !== t) {
2668
+ t16 = t("Fan-out");
2669
+ $[33] = t;
2670
+ $[34] = t16;
2671
+ } else {
2672
+ t16 = $[34];
2673
+ }
2674
+ let t17;
2675
+ if ($[35] !== t) {
2676
+ t17 = t("Files");
2677
+ $[35] = t;
2678
+ $[36] = t17;
2679
+ } else {
2680
+ t17 = $[36];
2681
+ }
2682
+ let t18;
2683
+ if ($[37] !== t) {
2684
+ t18 = t("Flags");
2685
+ $[37] = t;
2686
+ $[38] = t18;
2687
+ } else {
2688
+ t18 = $[38];
2689
+ }
2690
+ let t19;
2691
+ if ($[39] !== t) {
2692
+ t19 = t("Functions");
2693
+ $[39] = t;
2694
+ $[40] = t19;
2695
+ } else {
2696
+ t19 = $[40];
2697
+ }
2698
+ let t20;
2699
+ if ($[41] !== t) {
2700
+ t20 = t("Health");
2701
+ $[41] = t;
2702
+ $[42] = t20;
2703
+ } else {
2704
+ t20 = $[42];
2705
+ }
2706
+ let t21;
2707
+ if ($[43] !== t) {
2708
+ t21 = t("Home");
2709
+ $[43] = t;
2710
+ $[44] = t21;
2711
+ } else {
2712
+ t21 = $[44];
2713
+ }
2714
+ let t22;
2715
+ if ($[45] !== t) {
2716
+ t22 = t("Performance");
2717
+ $[45] = t;
2718
+ $[46] = t22;
2719
+ } else {
2720
+ t22 = $[46];
2721
+ }
2722
+ let t23;
2723
+ if ($[47] !== t) {
2724
+ t23 = t("Issues");
2725
+ $[47] = t;
2726
+ $[48] = t23;
2727
+ } else {
2728
+ t23 = $[48];
2729
+ }
2730
+ let t24;
2731
+ if ($[49] !== t) {
2732
+ t24 = t("KV");
2733
+ $[49] = t;
2734
+ $[50] = t24;
2735
+ } else {
2736
+ t24 = $[50];
2737
+ }
2738
+ let t25;
2739
+ if ($[51] !== t) {
2740
+ t25 = t("Logs");
2741
+ $[51] = t;
2742
+ $[52] = t25;
2743
+ } else {
2744
+ t25 = $[52];
2745
+ }
2746
+ let t26;
2747
+ if ($[53] !== t) {
2748
+ t26 = t("Metrics");
2749
+ $[53] = t;
2750
+ $[54] = t26;
2751
+ } else {
2752
+ t26 = $[54];
2753
+ }
2754
+ let t27;
2755
+ if ($[55] !== t) {
2756
+ t27 = t("Migrations");
2757
+ $[55] = t;
2758
+ $[56] = t27;
2759
+ } else {
2760
+ t27 = $[56];
2761
+ }
2762
+ let t28;
2763
+ if ($[57] !== t) {
2764
+ t28 = t("Organizations");
2765
+ $[57] = t;
2766
+ $[58] = t28;
2767
+ } else {
2768
+ t28 = $[58];
2769
+ }
2770
+ let t29;
2771
+ if ($[59] !== t) {
2772
+ t29 = t("Time Travel");
2773
+ $[59] = t;
2774
+ $[60] = t29;
2775
+ } else {
2776
+ t29 = $[60];
2777
+ }
2778
+ let t30;
2779
+ if ($[61] !== t) {
2780
+ t30 = t("Mail");
2781
+ $[61] = t;
2782
+ $[62] = t30;
2783
+ } else {
2784
+ t30 = $[62];
2785
+ }
2786
+ let t31;
2787
+ if ($[63] !== t) {
2788
+ t31 = t("Payments");
2789
+ $[63] = t;
2790
+ $[64] = t31;
2791
+ } else {
2792
+ t31 = $[64];
2793
+ }
2794
+ let t32;
2795
+ if ($[65] !== t) {
2796
+ t32 = t("Permissions");
2797
+ $[65] = t;
2798
+ $[66] = t32;
2799
+ } else {
2800
+ t32 = $[66];
2801
+ }
2802
+ let t33;
2803
+ if ($[67] !== t) {
2804
+ t33 = t("Queues");
2805
+ $[67] = t;
2806
+ $[68] = t33;
2807
+ } else {
2808
+ t33 = $[68];
2809
+ }
2810
+ let t34;
2811
+ if ($[69] !== t) {
2812
+ t34 = t("Realtime");
2813
+ $[69] = t;
2814
+ $[70] = t34;
2815
+ } else {
2816
+ t34 = $[70];
2817
+ }
2818
+ let t35;
2819
+ if ($[71] !== t) {
2820
+ t35 = t("RLS Policies");
2821
+ $[71] = t;
2822
+ $[72] = t35;
2823
+ } else {
2824
+ t35 = $[72];
2825
+ }
2826
+ let t36;
2827
+ if ($[73] !== t) {
2828
+ t36 = t("Scheduled");
2829
+ $[73] = t;
2830
+ $[74] = t36;
2831
+ } else {
2832
+ t36 = $[74];
2833
+ }
2834
+ let t37;
2835
+ if ($[75] !== t) {
2836
+ t37 = t("Schema");
2837
+ $[75] = t;
2838
+ $[76] = t37;
2839
+ } else {
2840
+ t37 = $[76];
2841
+ }
2842
+ let t38;
2843
+ if ($[77] !== t) {
2844
+ t38 = t("Security");
2845
+ $[77] = t;
2846
+ $[78] = t38;
2847
+ } else {
2848
+ t38 = $[78];
2849
+ }
2850
+ let t39;
2851
+ if ($[79] !== t) {
2852
+ t39 = t("Settings");
2853
+ $[79] = t;
2854
+ $[80] = t39;
2855
+ } else {
2856
+ t39 = $[80];
2857
+ }
2858
+ let t40;
2859
+ if ($[81] !== t) {
2860
+ t40 = t("SQL editor");
2861
+ $[81] = t;
2862
+ $[82] = t40;
2863
+ } else {
2864
+ t40 = $[82];
2865
+ }
2866
+ let t41;
2867
+ if ($[83] !== t) {
2868
+ t41 = t("Access Rules");
2869
+ $[83] = t;
2870
+ $[84] = t41;
2871
+ } else {
2872
+ t41 = $[84];
2873
+ }
2874
+ let t42;
2875
+ if ($[85] !== t) {
2876
+ t42 = t("Users");
2877
+ $[85] = t;
2878
+ $[86] = t42;
2879
+ } else {
2880
+ t42 = $[86];
2881
+ }
2882
+ let t43;
2883
+ if ($[87] !== t) {
2884
+ t43 = t("Vectors");
2885
+ $[87] = t;
2886
+ $[88] = t43;
2887
+ } else {
2888
+ t43 = $[88];
2889
+ }
2890
+ let t44;
2891
+ if ($[89] !== t) {
2892
+ t44 = t("Workflows");
2893
+ $[89] = t;
2894
+ $[90] = t44;
2895
+ } else {
2896
+ t44 = $[90];
2897
+ }
2898
+ let t45;
2899
+ if ($[91] !== t10 || $[92] !== t11 || $[93] !== t12 || $[94] !== t13 || $[95] !== t14 || $[96] !== t15 || $[97] !== t16 || $[98] !== t17 || $[99] !== t18 || $[100] !== t19 || $[101] !== t20 || $[102] !== t21 || $[103] !== t22 || $[104] !== t23 || $[105] !== t24 || $[106] !== t25 || $[107] !== t26 || $[108] !== t27 || $[109] !== t28 || $[110] !== t29 || $[111] !== t30 || $[112] !== t31 || $[113] !== t32 || $[114] !== t33 || $[115] !== t34 || $[116] !== t35 || $[117] !== t36 || $[118] !== t37 || $[119] !== t38 || $[120] !== t39 || $[121] !== t40 || $[122] !== t41 || $[123] !== t42 || $[124] !== t43 || $[125] !== t44 || $[126] !== t5 || $[127] !== t6 || $[128] !== t7 || $[129] !== t8 || $[130] !== t9) {
2900
+ t45 = {
2901
+ agents: t5,
2902
+ analytics: t6,
2903
+ api: t7,
2904
+ audit: t8,
2905
+ authConfig: t9,
2906
+ authSessions: t10,
2907
+ containers: t11,
2908
+ dashboards: t12,
2909
+ data: t13,
2910
+ drains: t14,
2911
+ export: t15,
2912
+ fanout: t16,
2913
+ files: t17,
2914
+ flags: t18,
2915
+ functions: t19,
2916
+ health: t20,
2917
+ home: t21,
2918
+ insights: t22,
2919
+ issues: t23,
2920
+ kv: t24,
2921
+ logs: t25,
2922
+ metrics: t26,
2923
+ migrations: t27,
2924
+ organizations: t28,
2925
+ pitr: t29,
2926
+ mail: t30,
2927
+ payments: t31,
2928
+ permissions: t32,
2929
+ queues: t33,
2930
+ realtime: t34,
2931
+ rls: t35,
2932
+ schedule: t36,
2933
+ schema: t37,
2934
+ security: t38,
2935
+ settings: t39,
2936
+ sql: t40,
2937
+ storageRules: t41,
2938
+ users: t42,
2939
+ vectors: t43,
2940
+ workflows: t44
2941
+ };
2942
+ $[91] = t10;
2943
+ $[92] = t11;
2944
+ $[93] = t12;
2945
+ $[94] = t13;
2946
+ $[95] = t14;
2947
+ $[96] = t15;
2948
+ $[97] = t16;
2949
+ $[98] = t17;
2950
+ $[99] = t18;
2951
+ $[100] = t19;
2952
+ $[101] = t20;
2953
+ $[102] = t21;
2954
+ $[103] = t22;
2955
+ $[104] = t23;
2956
+ $[105] = t24;
2957
+ $[106] = t25;
2958
+ $[107] = t26;
2959
+ $[108] = t27;
2960
+ $[109] = t28;
2961
+ $[110] = t29;
2962
+ $[111] = t30;
2963
+ $[112] = t31;
2964
+ $[113] = t32;
2965
+ $[114] = t33;
2966
+ $[115] = t34;
2967
+ $[116] = t35;
2968
+ $[117] = t36;
2969
+ $[118] = t37;
2970
+ $[119] = t38;
2971
+ $[120] = t39;
2972
+ $[121] = t40;
2973
+ $[122] = t41;
2974
+ $[123] = t42;
2975
+ $[124] = t43;
2976
+ $[125] = t44;
2977
+ $[126] = t5;
2978
+ $[127] = t6;
2979
+ $[128] = t7;
2980
+ $[129] = t8;
2981
+ $[130] = t9;
2982
+ $[131] = t45;
2983
+ } else {
2984
+ t45 = $[131];
2985
+ }
2986
+ const tabLabel = t45;
2987
+ const groupLabel = {
2988
+ advisors: t("Advisors"),
2989
+ auth: t("Auth"),
2990
+ database: t("Database"),
2991
+ functions: t("Functions"),
2992
+ observability: t("Observability"),
2993
+ operations: t("Operations"),
2994
+ overview: t("Overview"),
2995
+ settings: t("Settings"),
2996
+ storage: t("Storage")
2997
+ };
2998
+ let t46;
2999
+ if ($[132] !== t) {
3000
+ t46 = t("Inspect agent threads, message timelines, tool calls, and token usage.");
3001
+ $[132] = t;
3002
+ $[133] = t46;
3003
+ } else {
3004
+ t46 = $[133];
3005
+ }
3006
+ let t47;
3007
+ if ($[134] !== t) {
3008
+ t47 = t("Usage and latency from Analytics Engine — request volume, p50/p95, and hot shards.");
3009
+ $[134] = t;
3010
+ $[135] = t47;
3011
+ } else {
3012
+ t47 = $[135];
3013
+ }
3014
+ let t48;
3015
+ if ($[136] !== t) {
3016
+ t48 = t("Interactive OpenAPI reference and copy-paste snippets for your functions.");
3017
+ $[136] = t;
3018
+ $[137] = t48;
3019
+ } else {
3020
+ t48 = $[137];
3021
+ }
3022
+ let t49;
3023
+ if ($[138] !== t) {
3024
+ t49 = t("A durable log of admin state-changing operations.");
3025
+ $[138] = t;
3026
+ $[139] = t49;
3027
+ } else {
3028
+ t49 = $[139];
3029
+ }
3030
+ let t50;
3031
+ if ($[140] !== t) {
3032
+ t50 = t("Enabled plugins and session config (read-only).");
3033
+ $[140] = t;
3034
+ $[141] = t50;
3035
+ } else {
3036
+ t50 = $[141];
3037
+ }
3038
+ let t51;
3039
+ if ($[142] !== t) {
3040
+ t51 = t("Browse and revoke active sessions across all users.");
3041
+ $[142] = t;
3042
+ $[143] = t51;
3043
+ } else {
3044
+ t51 = $[143];
3045
+ }
3046
+ let t52;
3047
+ if ($[144] !== t) {
3048
+ t52 = t("Live Cloudflare Containers — current lifecycle state per instance from the log stream.");
3049
+ $[144] = t;
3050
+ $[145] = t52;
3051
+ } else {
3052
+ t52 = $[145];
3053
+ }
3054
+ let t53;
3055
+ if ($[146] !== t) {
3056
+ t53 = t("Chart widgets backed by saved read-only SQL queries.");
3057
+ $[146] = t;
3058
+ $[147] = t53;
3059
+ } else {
3060
+ t53 = $[147];
3061
+ }
3062
+ let t54;
3063
+ if ($[148] !== t) {
3064
+ t54 = t("Browse and edit rows across your shard and global tables.");
3065
+ $[148] = t;
3066
+ $[149] = t54;
3067
+ } else {
3068
+ t54 = $[149];
3069
+ }
3070
+ let t55;
3071
+ if ($[150] !== t) {
3072
+ t55 = t("Forward logs to Logpush, Tail Workers, or a webhook collector.");
3073
+ $[150] = t;
3074
+ $[151] = t55;
3075
+ } else {
3076
+ t55 = $[151];
3077
+ }
3078
+ let t56;
3079
+ if ($[152] !== t) {
3080
+ t56 = t("Export a shard to NDJSON, or import rows from it.");
3081
+ $[152] = t;
3082
+ $[153] = t56;
3083
+ } else {
3084
+ t56 = $[153];
3085
+ }
3086
+ let t57;
3087
+ if ($[154] !== t) {
3088
+ t57 = t("Realtime fan-out cost and per-topic subscriber counts for this shard.");
3089
+ $[154] = t;
3090
+ $[155] = t57;
3091
+ } else {
3092
+ t57 = $[155];
3093
+ }
3094
+ let t58;
3095
+ if ($[156] !== t) {
3096
+ t58 = t("Browse objects in your R2 storage buckets.");
3097
+ $[156] = t;
3098
+ $[157] = t58;
3099
+ } else {
3100
+ t58 = $[157];
3101
+ }
3102
+ let t59;
3103
+ if ($[158] !== t) {
3104
+ t59 = t("Inspect feature flags and their live evaluation under a targeting context.");
3105
+ $[158] = t;
3106
+ $[159] = t59;
3107
+ } else {
3108
+ t59 = $[159];
3109
+ }
3110
+ let t60;
3111
+ if ($[160] !== t) {
3112
+ t60 = t("Run registered queries, mutations, and actions.");
3113
+ $[160] = t;
3114
+ $[161] = t60;
3115
+ } else {
3116
+ t60 = $[161];
3117
+ }
3118
+ let t61;
3119
+ if ($[162] !== t) {
3120
+ t61 = t("At-a-glance connection, error, and shard signals.");
3121
+ $[162] = t;
3122
+ $[163] = t61;
3123
+ } else {
3124
+ t61 = $[163];
3125
+ }
3126
+ let t62;
3127
+ if ($[164] !== t) {
3128
+ t62 = t("Connection, health, and advisor summary for your deployment.");
3129
+ $[164] = t;
3130
+ $[165] = t62;
3131
+ } else {
3132
+ t62 = $[165];
3133
+ }
3134
+ let t63;
3135
+ if ($[166] !== t) {
3136
+ t63 = t("Surface slow functions, error spikes, and cache problems.");
3137
+ $[166] = t;
3138
+ $[167] = t63;
3139
+ } else {
3140
+ t63 = $[167];
3141
+ }
3142
+ let t64;
3143
+ if ($[168] !== t) {
3144
+ t64 = t("Grouped error triage — Worker throws and container crashes folded by fingerprint.");
3145
+ $[168] = t;
3146
+ $[169] = t64;
3147
+ } else {
3148
+ t64 = $[169];
3149
+ }
3150
+ let t65;
3151
+ if ($[170] !== t) {
3152
+ t65 = t("A live stream of recent function logs.");
3153
+ $[170] = t;
3154
+ $[171] = t65;
3155
+ } else {
3156
+ t65 = $[171];
3157
+ }
3158
+ let t66;
3159
+ if ($[172] !== t) {
3160
+ t66 = t("Per-shard health and aggregate metrics.");
3161
+ $[172] = t;
3162
+ $[173] = t66;
3163
+ } else {
3164
+ t66 = $[173];
3165
+ }
3166
+ let t67;
3167
+ if ($[174] !== t) {
3168
+ t67 = t("Review migration status and run them.");
3169
+ $[174] = t;
3170
+ $[175] = t67;
3171
+ } else {
3172
+ t67 = $[175];
3173
+ }
3174
+ let t68;
3175
+ if ($[176] !== t) {
3176
+ t68 = t("Browse and manage organizations, members, and invitations.");
3177
+ $[176] = t;
3178
+ $[177] = t68;
3179
+ } else {
3180
+ t68 = $[177];
3181
+ }
3182
+ let t69;
3183
+ if ($[178] !== t) {
3184
+ t69 = t("Restore a shard to a point in the last 30 days.");
3185
+ $[178] = t;
3186
+ $[179] = t69;
3187
+ } else {
3188
+ t69 = $[179];
3189
+ }
3190
+ let t70;
3191
+ if ($[180] !== t) {
3192
+ t70 = t("Email your app sent, captured in dev.");
3193
+ $[180] = t;
3194
+ $[181] = t70;
3195
+ } else {
3196
+ t70 = $[181];
3197
+ }
3198
+ let t71;
3199
+ if ($[182] !== t) {
3200
+ t71 = t("Synced customers, subscriptions, and webhook events.");
3201
+ $[182] = t;
3202
+ $[183] = t71;
3203
+ } else {
3204
+ t71 = $[183];
3205
+ }
3206
+ let t72;
3207
+ if ($[184] !== t) {
3208
+ t72 = t("Inspect access policies per table, and probe a function as any identity.");
3209
+ $[184] = t;
3210
+ $[185] = t72;
3211
+ } else {
3212
+ t72 = $[185];
3213
+ }
3214
+ let t73;
3215
+ if ($[186] !== t) {
3216
+ t73 = t("Inspect declared Cloudflare Queues — their producer bindings, consumer mode, and dead-letter queue.");
3217
+ $[186] = t;
3218
+ $[187] = t73;
3219
+ } else {
3220
+ t73 = $[187];
3221
+ }
3222
+ let t74;
3223
+ if ($[188] !== t) {
3224
+ t74 = t("Active WebSocket subscriptions on this shard.");
3225
+ $[188] = t;
3226
+ $[189] = t74;
3227
+ } else {
3228
+ t74 = $[189];
3229
+ }
3230
+ let t75;
3231
+ if ($[190] !== t) {
3232
+ t75 = t("Inspect row-level-security policies and roles, per table.");
3233
+ $[190] = t;
3234
+ $[191] = t75;
3235
+ } else {
3236
+ t75 = $[191];
3237
+ }
3238
+ let t76;
3239
+ if ($[192] !== t) {
3240
+ t76 = t("Inspect and cancel scheduled jobs.");
3241
+ $[192] = t;
3242
+ $[193] = t76;
3243
+ } else {
3244
+ t76 = $[193];
3245
+ }
3246
+ let t77;
3247
+ if ($[194] !== t) {
3248
+ t77 = t("Inspect each table and its columns.");
3249
+ $[194] = t;
3250
+ $[195] = t77;
3251
+ } else {
3252
+ t77 = $[195];
3253
+ }
3254
+ let t78;
3255
+ if ($[196] !== t) {
3256
+ t78 = t("Review admin gates, credentials, and log redaction.");
3257
+ $[196] = t;
3258
+ $[197] = t78;
3259
+ } else {
3260
+ t78 = $[197];
3261
+ }
3262
+ let t79;
3263
+ if ($[198] !== t) {
3264
+ t79 = t("Read-only deployment config — vars, secrets, and bindings.");
3265
+ $[198] = t;
3266
+ $[199] = t79;
3267
+ } else {
3268
+ t79 = $[199];
3269
+ }
3270
+ let t80;
3271
+ if ($[200] !== t) {
3272
+ t80 = t("Run read-only SQL against a shard.");
3273
+ $[200] = t;
3274
+ $[201] = t80;
3275
+ } else {
3276
+ t80 = $[201];
3277
+ }
3278
+ let t81;
3279
+ if ($[202] !== t) {
3280
+ t81 = t("Browse and edit key-value pairs in your Workers KV namespaces.");
3281
+ $[202] = t;
3282
+ $[203] = t81;
3283
+ } else {
3284
+ t81 = $[203];
3285
+ }
3286
+ let t82;
3287
+ if ($[204] !== t) {
3288
+ t82 = t("Inspect storage access rules — per bucket, operation, and key prefix.");
3289
+ $[204] = t;
3290
+ $[205] = t82;
3291
+ } else {
3292
+ t82 = $[205];
3293
+ }
3294
+ let t83;
3295
+ if ($[206] !== t) {
3296
+ t83 = t("Manage auth users — roles, bans, sessions, and identity.");
3297
+ $[206] = t;
3298
+ $[207] = t83;
3299
+ } else {
3300
+ t83 = $[207];
3301
+ }
3302
+ let t84;
3303
+ if ($[208] !== t) {
3304
+ t84 = t("Browse Vectorize indexes and run similarity searches.");
3305
+ $[208] = t;
3306
+ $[209] = t84;
3307
+ } else {
3308
+ t84 = $[209];
3309
+ }
3310
+ let t85;
3311
+ if ($[210] !== t) {
3312
+ t85 = t("Inspect declared Cloudflare Workflows and their bindings.");
3313
+ $[210] = t;
3314
+ $[211] = t85;
3315
+ } else {
3316
+ t85 = $[211];
3317
+ }
3318
+ let t86;
3319
+ if ($[212] !== t46 || $[213] !== t47 || $[214] !== t48 || $[215] !== t49 || $[216] !== t50 || $[217] !== t51 || $[218] !== t52 || $[219] !== t53 || $[220] !== t54 || $[221] !== t55 || $[222] !== t56 || $[223] !== t57 || $[224] !== t58 || $[225] !== t59 || $[226] !== t60 || $[227] !== t61 || $[228] !== t62 || $[229] !== t63 || $[230] !== t64 || $[231] !== t65 || $[232] !== t66 || $[233] !== t67 || $[234] !== t68 || $[235] !== t69 || $[236] !== t70 || $[237] !== t71 || $[238] !== t72 || $[239] !== t73 || $[240] !== t74 || $[241] !== t75 || $[242] !== t76 || $[243] !== t77 || $[244] !== t78 || $[245] !== t79 || $[246] !== t80 || $[247] !== t81 || $[248] !== t82 || $[249] !== t83 || $[250] !== t84 || $[251] !== t85) {
3320
+ t86 = {
3321
+ agents: t46,
3322
+ analytics: t47,
3323
+ api: t48,
3324
+ audit: t49,
3325
+ authConfig: t50,
3326
+ authSessions: t51,
3327
+ containers: t52,
3328
+ dashboards: t53,
3329
+ data: t54,
3330
+ drains: t55,
3331
+ export: t56,
3332
+ fanout: t57,
3333
+ files: t58,
3334
+ flags: t59,
3335
+ functions: t60,
3336
+ health: t61,
3337
+ home: t62,
3338
+ insights: t63,
3339
+ issues: t64,
3340
+ logs: t65,
3341
+ metrics: t66,
3342
+ migrations: t67,
3343
+ organizations: t68,
3344
+ pitr: t69,
3345
+ mail: t70,
3346
+ payments: t71,
3347
+ permissions: t72,
3348
+ queues: t73,
3349
+ realtime: t74,
3350
+ rls: t75,
3351
+ schedule: t76,
3352
+ schema: t77,
3353
+ security: t78,
3354
+ settings: t79,
3355
+ sql: t80,
3356
+ kv: t81,
3357
+ storageRules: t82,
3358
+ users: t83,
3359
+ vectors: t84,
3360
+ workflows: t85
3361
+ };
3362
+ $[212] = t46;
3363
+ $[213] = t47;
3364
+ $[214] = t48;
3365
+ $[215] = t49;
3366
+ $[216] = t50;
3367
+ $[217] = t51;
3368
+ $[218] = t52;
3369
+ $[219] = t53;
3370
+ $[220] = t54;
3371
+ $[221] = t55;
3372
+ $[222] = t56;
3373
+ $[223] = t57;
3374
+ $[224] = t58;
3375
+ $[225] = t59;
3376
+ $[226] = t60;
3377
+ $[227] = t61;
3378
+ $[228] = t62;
3379
+ $[229] = t63;
3380
+ $[230] = t64;
3381
+ $[231] = t65;
3382
+ $[232] = t66;
3383
+ $[233] = t67;
3384
+ $[234] = t68;
3385
+ $[235] = t69;
3386
+ $[236] = t70;
3387
+ $[237] = t71;
3388
+ $[238] = t72;
3389
+ $[239] = t73;
3390
+ $[240] = t74;
3391
+ $[241] = t75;
3392
+ $[242] = t76;
3393
+ $[243] = t77;
3394
+ $[244] = t78;
3395
+ $[245] = t79;
3396
+ $[246] = t80;
3397
+ $[247] = t81;
3398
+ $[248] = t82;
3399
+ $[249] = t83;
3400
+ $[250] = t84;
3401
+ $[251] = t85;
3402
+ $[252] = t86;
3403
+ } else {
3404
+ t86 = $[252];
3405
+ }
3406
+ const tabDescription = t86;
3407
+ let t87;
3408
+ if ($[253] !== navigate) {
3409
+ t87 = (event) => {
3410
+ fireAndForget(navigate({
3411
+ to: `/${event.currentTarget.dataset.tab ?? ""}`
3412
+ }));
3413
+ };
3414
+ $[253] = navigate;
3415
+ $[254] = t87;
3416
+ } else {
3417
+ t87 = $[254];
3418
+ }
3419
+ const selectTab = t87;
3420
+ let t88;
3421
+ let t89;
3422
+ if ($[255] !== current || $[256] !== tabLabel) {
3423
+ t88 = () => {
3424
+ if (typeof document !== "undefined") {
3425
+ document.title = `${tabLabel[current]} · lunora`;
3426
+ }
3427
+ };
3428
+ t89 = [current, tabLabel];
3429
+ $[255] = current;
3430
+ $[256] = tabLabel;
3431
+ $[257] = t88;
3432
+ $[258] = t89;
3433
+ } else {
3434
+ t88 = $[257];
3435
+ t89 = $[258];
3436
+ }
3437
+ useEffect(t88, t89);
3438
+ const activeGroup = visibleGroups.find((group_1) => group_1.tabs.includes(current)) ?? NAV_GROUPS[0];
3439
+ const commandItems = visibleGroups.flatMap((group_2) => group_2.tabs.map((tab_0) => ({
3440
+ group: groupLabel[group_2.key],
3441
+ label: tabLabel[tab_0],
3442
+ to: `/${tab_0}`
3443
+ })));
3444
+ const chrome = use(StudioChromeContext);
3445
+ const connected = chrome !== null && chrome.token !== "";
3446
+ let t90;
3447
+ if ($[259] !== commandItems) {
3448
+ t90 = /* @__PURE__ */ jsxDEV(CommandPalette, {
3449
+ items: commandItems
3450
+ }, void 0, false);
3451
+ $[259] = commandItems;
3452
+ $[260] = t90;
3453
+ } else {
3454
+ t90 = $[260];
3455
+ }
3456
+ let t91;
3457
+ if ($[261] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3458
+ t91 = /* @__PURE__ */ jsxDEV(SidebarTrigger, {
3459
+ className: "-ms-1"
3460
+ }, void 0, false);
3461
+ $[261] = t91;
3462
+ } else {
3463
+ t91 = $[261];
3464
+ }
3465
+ let t92;
3466
+ if ($[262] !== t) {
3467
+ t92 = t("Breadcrumb");
3468
+ $[262] = t;
3469
+ $[263] = t92;
3470
+ } else {
3471
+ t92 = $[263];
3472
+ }
3473
+ const t93 = groupLabel[activeGroup.key];
3474
+ let t94;
3475
+ if ($[264] !== t93) {
3476
+ t94 = /* @__PURE__ */ jsxDEV("span", {
3477
+ className: "text-muted-foreground",
3478
+ children: t93
3479
+ }, void 0, false);
3480
+ $[264] = t93;
3481
+ $[265] = t94;
3482
+ } else {
3483
+ t94 = $[265];
3484
+ }
3485
+ let t95;
3486
+ if ($[266] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3487
+ t95 = /* @__PURE__ */ jsxDEV("svg", {
3488
+ "aria-hidden": "true",
3489
+ className: "size-3.5 text-muted-foreground/60",
3490
+ fill: "none",
3491
+ stroke: "currentColor",
3492
+ strokeWidth: 1.7,
3493
+ viewBox: "0 0 24 24",
3494
+ children: /* @__PURE__ */ jsxDEV("path", {
3495
+ d: "m9 6 6 6-6 6",
3496
+ strokeLinecap: "round",
3497
+ strokeLinejoin: "round"
3498
+ }, void 0, false)
3499
+ }, void 0, false);
3500
+ $[266] = t95;
3501
+ } else {
3502
+ t95 = $[266];
3503
+ }
3504
+ const t96 = tabLabel[current];
3505
+ let t97;
3506
+ if ($[267] !== t96) {
3507
+ t97 = /* @__PURE__ */ jsxDEV("span", {
3508
+ className: "font-medium text-foreground",
3509
+ children: t96
3510
+ }, void 0, false);
3511
+ $[267] = t96;
3512
+ $[268] = t97;
3513
+ } else {
3514
+ t97 = $[268];
3515
+ }
3516
+ let t98;
3517
+ if ($[269] !== t92 || $[270] !== t94 || $[271] !== t97) {
3518
+ t98 = /* @__PURE__ */ jsxDEV("nav", {
3519
+ "aria-label": t92,
3520
+ className: "flex items-center gap-1.5 text-[13px]",
3521
+ children: [t94, t95, t97]
3522
+ }, void 0, true);
3523
+ $[269] = t92;
3524
+ $[270] = t94;
3525
+ $[271] = t97;
3526
+ $[272] = t98;
3527
+ } else {
3528
+ t98 = $[272];
3529
+ }
3530
+ let t99;
3531
+ if ($[273] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3532
+ t99 = /* @__PURE__ */ jsxDEV("svg", {
3533
+ "aria-hidden": "true",
3534
+ className: "size-3.5",
3535
+ fill: "none",
3536
+ stroke: "currentColor",
3537
+ strokeWidth: 1.8,
3538
+ viewBox: "0 0 24 24",
3539
+ children: [/* @__PURE__ */ jsxDEV("circle", {
3540
+ cx: "11",
3541
+ cy: "11",
3542
+ r: "7"
3543
+ }, void 0, false), /* @__PURE__ */ jsxDEV("path", {
3544
+ d: "m21 21-4.3-4.3",
3545
+ strokeLinecap: "round"
3546
+ }, void 0, false)]
3547
+ }, void 0, true);
3548
+ $[273] = t99;
3549
+ } else {
3550
+ t99 = $[273];
3551
+ }
3552
+ let t100;
3553
+ if ($[274] !== t) {
3554
+ t100 = t("Search…");
3555
+ $[274] = t;
3556
+ $[275] = t100;
3557
+ } else {
3558
+ t100 = $[275];
3559
+ }
3560
+ let t101;
3561
+ if ($[276] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3562
+ t101 = /* @__PURE__ */ jsxDEV("kbd", {
3563
+ className: "ms-auto rounded border border-border bg-background px-1 font-sans text-[10px] text-muted-foreground",
3564
+ children: "⌘K"
3565
+ }, void 0, false);
3566
+ $[276] = t101;
3567
+ } else {
3568
+ t101 = $[276];
3569
+ }
3570
+ let t102;
3571
+ if ($[277] !== t100) {
3572
+ t102 = /* @__PURE__ */ jsxDEV("button", {
3573
+ className: "mx-auto hidden h-8 w-72 items-center gap-2 rounded-lg border border-border bg-muted/40 px-3 text-xs text-muted-foreground transition-colors hover:bg-muted md:flex",
3574
+ "data-testid": "dash-app-search",
3575
+ onClick: openCommandPalette,
3576
+ type: "button",
3577
+ children: [t99, t100, t101]
3578
+ }, void 0, true);
3579
+ $[277] = t100;
3580
+ $[278] = t102;
3581
+ } else {
3582
+ t102 = $[278];
3583
+ }
3584
+ let t103;
3585
+ if ($[279] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3586
+ t103 = /* @__PURE__ */ jsxDEV("div", {
3587
+ className: "ms-auto flex items-center gap-1.5 md:ms-0",
3588
+ children: /* @__PURE__ */ jsxDEV(ThemeToggle, {}, void 0, false)
3589
+ }, void 0, false);
3590
+ $[279] = t103;
3591
+ } else {
3592
+ t103 = $[279];
3593
+ }
3594
+ let t104;
3595
+ if ($[280] !== t102 || $[281] !== t98) {
3596
+ t104 = /* @__PURE__ */ jsxDEV("header", {
3597
+ className: "flex h-11 shrink-0 items-center gap-2 border-b border-border px-4",
3598
+ "data-testid": "dash-app-header",
3599
+ children: [t91, t98, t102, t103]
3600
+ }, void 0, true);
3601
+ $[280] = t102;
3602
+ $[281] = t98;
3603
+ $[282] = t104;
3604
+ } else {
3605
+ t104 = $[282];
3606
+ }
3607
+ let t105;
3608
+ if ($[283] !== chrome?.rulesInstalled) {
3609
+ t105 = chrome?.rulesInstalled === false && /* @__PURE__ */ jsxDEV(RulesBanner, {}, void 0, false);
3610
+ $[283] = chrome?.rulesInstalled;
3611
+ $[284] = t105;
3612
+ } else {
3613
+ t105 = $[284];
3614
+ }
3615
+ const t106 = `dash-tab-${current}`;
3616
+ const t107 = fullHeight ? "flex min-w-0 flex-1 flex-col overflow-hidden" : "min-w-0 flex-1 overflow-auto p-6";
3617
+ const t108 = tabLabel[current];
3618
+ let t109;
3619
+ if ($[285] !== t || $[286] !== t108) {
3620
+ t109 = t("{title} failed", {
3621
+ title: t108
3622
+ });
3623
+ $[285] = t;
3624
+ $[286] = t108;
3625
+ $[287] = t109;
3626
+ } else {
3627
+ t109 = $[287];
3628
+ }
3629
+ const t110 = tabLabel[current];
3630
+ let t111;
3631
+ if ($[288] !== t) {
3632
+ t111 = t("Try again");
3633
+ $[288] = t;
3634
+ $[289] = t111;
3635
+ } else {
3636
+ t111 = $[289];
3637
+ }
3638
+ let t112;
3639
+ if ($[290] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3640
+ t112 = /* @__PURE__ */ jsxDEV(Suspense, {
3641
+ fallback: /* @__PURE__ */ jsxDEV(RoutePending, {}, void 0, false),
3642
+ children: /* @__PURE__ */ jsxDEV(Outlet, {}, void 0, false)
3643
+ }, void 0, false);
3644
+ $[290] = t112;
3645
+ } else {
3646
+ t112 = $[290];
3647
+ }
3648
+ let t113;
3649
+ if ($[291] !== current || $[292] !== t109 || $[293] !== t110 || $[294] !== t111) {
3650
+ t113 = /* @__PURE__ */ jsxDEV(ErrorBoundary, {
3651
+ fallbackTitle: t109,
3652
+ label: t110,
3653
+ retryLabel: t111,
3654
+ children: t112
3655
+ }, current, false);
3656
+ $[291] = current;
3657
+ $[292] = t109;
3658
+ $[293] = t110;
3659
+ $[294] = t111;
3660
+ $[295] = t113;
3661
+ } else {
3662
+ t113 = $[295];
3663
+ }
3664
+ let t114;
3665
+ if ($[296] !== t107 || $[297] !== t113) {
3666
+ t114 = /* @__PURE__ */ jsxDEV("div", {
3667
+ className: t107,
3668
+ children: t113
3669
+ }, void 0, false);
3670
+ $[296] = t107;
3671
+ $[297] = t113;
3672
+ $[298] = t114;
3673
+ } else {
3674
+ t114 = $[298];
3675
+ }
3676
+ let t115;
3677
+ if ($[299] !== t106 || $[300] !== t114) {
3678
+ t115 = /* @__PURE__ */ jsxDEV("div", {
3679
+ "aria-labelledby": t106,
3680
+ className: "flex min-w-0 flex-1 flex-col overflow-hidden",
3681
+ "data-testid": "dash-panel",
3682
+ id: "dash-panel",
3683
+ role: "tabpanel",
3684
+ children: t114
3685
+ }, void 0, false);
3686
+ $[299] = t106;
3687
+ $[300] = t114;
3688
+ $[301] = t115;
3689
+ } else {
3690
+ t115 = $[301];
3691
+ }
3692
+ let t116;
3693
+ if ($[302] !== t104 || $[303] !== t105 || $[304] !== t115) {
3694
+ t116 = /* @__PURE__ */ jsxDEV(SidebarInset, {
3695
+ className: "overflow-hidden md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",
3696
+ children: [t104, t105, t115]
3697
+ }, void 0, true);
3698
+ $[302] = t104;
3699
+ $[303] = t105;
3700
+ $[304] = t115;
3701
+ $[305] = t116;
3702
+ } else {
3703
+ t116 = $[305];
3704
+ }
3705
+ return /* @__PURE__ */ jsxDEV(SidebarProvider, {
3706
+ className: "min-h-0 flex-1",
3707
+ "data-testid": "lunora-studio",
3708
+ children: [t90, /* @__PURE__ */ jsxDEV(StudioSidebar, {
3709
+ chrome,
3710
+ connected,
3711
+ current,
3712
+ groupLabel,
3713
+ groups: visibleGroups,
3714
+ selectTab,
3715
+ tabDescription,
3716
+ tabLabel
3717
+ }, void 0, false), t116]
3718
+ }, void 0, true);
3719
+ };
3720
+ const SchemaRoutePanel = (t0) => {
3721
+ const $ = c(5);
3722
+ const {
3723
+ initialShardKey,
3724
+ schemaEditable
3725
+ } = t0;
3726
+ let t1;
3727
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3728
+ t1 = {
3729
+ strict: false
3730
+ };
3731
+ $[0] = t1;
3732
+ } else {
3733
+ t1 = $[0];
3734
+ }
3735
+ const search = useSearch(t1);
3736
+ const {
3737
+ table
3738
+ } = search;
3739
+ const initialTable = typeof table === "string" ? table : void 0;
3740
+ let t2;
3741
+ if ($[1] !== initialShardKey || $[2] !== initialTable || $[3] !== schemaEditable) {
3742
+ t2 = /* @__PURE__ */ jsxDEV(SchemaViewer, {
3743
+ initialShardKey,
3744
+ initialTable,
3745
+ schemaEditable
3746
+ }, void 0, false);
3747
+ $[1] = initialShardKey;
3748
+ $[2] = initialTable;
3749
+ $[3] = schemaEditable;
3750
+ $[4] = t2;
3751
+ } else {
3752
+ t2 = $[4];
3753
+ }
3754
+ return t2;
3755
+ };
3756
+ const NotFoundRedirect = () => {
3757
+ const $ = c(3);
3758
+ const navigate = useNavigate();
3759
+ let t0;
3760
+ let t1;
3761
+ if ($[0] !== navigate) {
3762
+ t0 = () => {
3763
+ fireAndForget(navigate({
3764
+ replace: true,
3765
+ to: "/home"
3766
+ }));
3767
+ };
3768
+ t1 = [navigate];
3769
+ $[0] = navigate;
3770
+ $[1] = t0;
3771
+ $[2] = t1;
3772
+ } else {
3773
+ t0 = $[1];
3774
+ t1 = $[2];
3775
+ }
3776
+ useEffect(t0, t1);
3777
+ return null;
3778
+ };
3779
+ const buildRouter = ({
3780
+ basePath,
3781
+ dataEditable = false,
3782
+ functions,
3783
+ initialShardKey,
3784
+ openApiSpec,
3785
+ openRpcSpec,
3786
+ runAsIdentity = false,
3787
+ schemaEditable = false,
3788
+ scheduledCancel,
3789
+ scheduledCron,
3790
+ scheduledLoad
3791
+ }) => {
3792
+ const rootRoute = createRootRoute({
3793
+ component: StudioLayout
3794
+ });
3795
+ const panels = {
3796
+ agents: /* @__PURE__ */ jsxDEV(AgentsPanel, {
3797
+ initialShardKey
3798
+ }, void 0, false),
3799
+ analytics: /* @__PURE__ */ jsxDEV(AnalyticsPanel, {}, void 0, false),
3800
+ api: /* @__PURE__ */ jsxDEV(ApiTab, {
3801
+ functions,
3802
+ initialShardKey,
3803
+ openApiSpec,
3804
+ openRpcSpec
3805
+ }, void 0, false),
3806
+ audit: /* @__PURE__ */ jsxDEV(AuditPanel, {
3807
+ initialShardKey
3808
+ }, void 0, false),
3809
+ authConfig: /* @__PURE__ */ jsxDEV(AuthConfigPanel, {}, void 0, false),
3810
+ authSessions: /* @__PURE__ */ jsxDEV(AuthSessionsPanel, {}, void 0, false),
3811
+ containers: /* @__PURE__ */ jsxDEV(ContainersPanel, {}, void 0, false),
3812
+ dashboards: /* @__PURE__ */ jsxDEV(DashboardsPanel, {
3813
+ initialShardKey
3814
+ }, void 0, false),
3815
+ data: /* @__PURE__ */ jsxDEV(TableEditor, {
3816
+ editable: dataEditable,
3817
+ initialShardKey
3818
+ }, void 0, false),
3819
+ drains: /* @__PURE__ */ jsxDEV(LogDrainsPanel, {}, void 0, false),
3820
+ export: /* @__PURE__ */ jsxDEV(ExportImportPanel, {
3821
+ initialShardKey
3822
+ }, void 0, false),
3823
+ fanout: /* @__PURE__ */ jsxDEV(FanoutPanel, {
3824
+ initialShardKey
3825
+ }, void 0, false),
3826
+ files: /* @__PURE__ */ jsxDEV(FileBrowser, {}, void 0, false),
3827
+ kv: /* @__PURE__ */ jsxDEV(KvBrowser, {}, void 0, false),
3828
+ flags: /* @__PURE__ */ jsxDEV(FlagsPanel, {
3829
+ initialShardKey
3830
+ }, void 0, false),
3831
+ functions: /* @__PURE__ */ jsxDEV("div", {
3832
+ className: "flex flex-col gap-8",
3833
+ children: [/* @__PURE__ */ jsxDEV(FunctionStatsPanel, {
3834
+ functions,
3835
+ initialShardKey
3836
+ }, void 0, false), /* @__PURE__ */ jsxDEV(FunctionRunner, {
3837
+ functions,
3838
+ runAsIdentity
3839
+ }, void 0, false)]
3840
+ }, void 0, true),
3841
+ health: /* @__PURE__ */ jsxDEV(HealthPanel, {
3842
+ initialShardKey
3843
+ }, void 0, false),
3844
+ home: /* @__PURE__ */ jsxDEV(HomePanel, {
3845
+ initialShardKey
3846
+ }, void 0, false),
3847
+ insights: /* @__PURE__ */ jsxDEV(InsightsPanel, {
3848
+ initialShardKey
3849
+ }, void 0, false),
3850
+ issues: /* @__PURE__ */ jsxDEV(IssuesPanel, {
3851
+ initialShardKey
3852
+ }, void 0, false),
3853
+ logs: /* @__PURE__ */ jsxDEV(LogsPanel, {
3854
+ initialShardKey
3855
+ }, void 0, false),
3856
+ metrics: /* @__PURE__ */ jsxDEV(MetricsPanel, {
3857
+ initialShardKey
3858
+ }, void 0, false),
3859
+ migrations: /* @__PURE__ */ jsxDEV(MigrationsPanel, {
3860
+ initialShardKey
3861
+ }, void 0, false),
3862
+ organizations: /* @__PURE__ */ jsxDEV(OrganizationsPanel, {}, void 0, false),
3863
+ permissions: /* @__PURE__ */ jsxDEV(PermissionsPanel, {
3864
+ functions,
3865
+ runAsIdentity,
3866
+ schemaEditable
3867
+ }, void 0, false),
3868
+ pitr: /* @__PURE__ */ jsxDEV(PitrPanel, {
3869
+ initialShardKey
3870
+ }, void 0, false),
3871
+ mail: /* @__PURE__ */ jsxDEV(MailPanel, {}, void 0, false),
3872
+ payments: /* @__PURE__ */ jsxDEV(PaymentsPanel, {}, void 0, false),
3873
+ queues: /* @__PURE__ */ jsxDEV(QueuesPanel, {}, void 0, false),
3874
+ realtime: /* @__PURE__ */ jsxDEV(SubscriptionsPanel, {
3875
+ initialShardKey
3876
+ }, void 0, false),
3877
+ rls: /* @__PURE__ */ jsxDEV(RlsPanel, {}, void 0, false),
3878
+ schedule: /* @__PURE__ */ jsxDEV(SchedulePanel, {
3879
+ loadCronJobs: scheduledCron,
3880
+ scheduledCancel,
3881
+ scheduledLoad
3882
+ }, void 0, false),
3883
+ schema: /* @__PURE__ */ jsxDEV(SchemaRoutePanel, {
3884
+ initialShardKey,
3885
+ schemaEditable
3886
+ }, void 0, false),
3887
+ security: /* @__PURE__ */ jsxDEV(SecurityAdvisorPanel, {}, void 0, false),
3888
+ settings: /* @__PURE__ */ jsxDEV(SettingsPanel, {
3889
+ initialShardKey
3890
+ }, void 0, false),
3891
+ sql: /* @__PURE__ */ jsxDEV(SqlEditorPanel, {
3892
+ initialShardKey
3893
+ }, void 0, false),
3894
+ storageRules: /* @__PURE__ */ jsxDEV(StorageRulesPanel, {}, void 0, false),
3895
+ users: /* @__PURE__ */ jsxDEV(UsersPanel, {}, void 0, false),
3896
+ vectors: /* @__PURE__ */ jsxDEV(VectorBrowser, {}, void 0, false),
3897
+ workflows: /* @__PURE__ */ jsxDEV(WorkflowsPanel, {}, void 0, false)
3898
+ };
3899
+ const indexRoute = createRoute({
3900
+ component: () => panels.home,
3901
+ getParentRoute: () => rootRoute,
3902
+ path: "/"
3903
+ });
3904
+ const tabRoutes = TABS.map((tab) => {
3905
+ if (tab === "data") {
3906
+ return createRoute({
3907
+ component: () => panels[tab],
3908
+ getParentRoute: () => rootRoute,
3909
+ path: `/${tab}`,
3910
+ validateSearch: validateDataViewSearch
3911
+ });
3912
+ }
3913
+ return createRoute({
3914
+ component: () => panels[tab],
3915
+ getParentRoute: () => rootRoute,
3916
+ path: `/${tab}`
3917
+ });
3918
+ });
3919
+ const routeTree = rootRoute.addChildren([indexRoute, ...tabRoutes]);
3920
+ const history = "window" in globalThis ? createBrowserHistory() : createMemoryHistory({
3921
+ initialEntries: ["/home"]
3922
+ });
3923
+ return createRouter({
3924
+ // When mounted under a prefix (e.g. the `/__lunora` dev route), the router
3925
+ // works in that subtree: `/__lunora` matches the index route and every
3926
+ // `navigate({ to: "/logs" })` resolves to `/__lunora/logs`, so navigation
3927
+ // never escapes the mount. Omitted for a root mount.
3928
+ ...basePath === void 0 || basePath === "/" ? {} : {
3929
+ basepath: basePath
3930
+ },
3931
+ defaultNotFoundComponent: NotFoundRedirect,
3932
+ defaultPendingComponent: RoutePending,
3933
+ defaultPendingMinMs: 0,
3934
+ defaultPendingMs: 0,
3935
+ history,
3936
+ routeTree
3937
+ });
3938
+ };
3939
+ const StudioShell = (t0) => {
3940
+ const $ = c(17);
3941
+ const {
3942
+ basePath,
3943
+ chrome,
3944
+ dataEditable,
3945
+ functions,
3946
+ initialShardKey,
3947
+ openApiSpec,
3948
+ openRpcSpec,
3949
+ runAsIdentity,
3950
+ schemaEditable,
3951
+ scheduledCancel,
3952
+ scheduledCron,
3953
+ scheduledLoad
3954
+ } = t0;
3955
+ let t1;
3956
+ if ($[0] !== basePath || $[1] !== dataEditable || $[2] !== functions || $[3] !== initialShardKey || $[4] !== openApiSpec || $[5] !== openRpcSpec || $[6] !== runAsIdentity || $[7] !== scheduledCancel || $[8] !== scheduledCron || $[9] !== scheduledLoad || $[10] !== schemaEditable) {
3957
+ t1 = buildRouter({
3958
+ basePath,
3959
+ dataEditable,
3960
+ functions,
3961
+ initialShardKey,
3962
+ openApiSpec,
3963
+ openRpcSpec,
3964
+ runAsIdentity,
3965
+ schemaEditable,
3966
+ scheduledCancel,
3967
+ scheduledCron,
3968
+ scheduledLoad
3969
+ });
3970
+ $[0] = basePath;
3971
+ $[1] = dataEditable;
3972
+ $[2] = functions;
3973
+ $[3] = initialShardKey;
3974
+ $[4] = openApiSpec;
3975
+ $[5] = openRpcSpec;
3976
+ $[6] = runAsIdentity;
3977
+ $[7] = scheduledCancel;
3978
+ $[8] = scheduledCron;
3979
+ $[9] = scheduledLoad;
3980
+ $[10] = schemaEditable;
3981
+ $[11] = t1;
3982
+ } else {
3983
+ t1 = $[11];
3984
+ }
3985
+ const router = t1;
3986
+ const t2 = chrome ?? null;
3987
+ let t3;
3988
+ if ($[12] !== router) {
3989
+ t3 = /* @__PURE__ */ jsxDEV(RouterProvider, {
3990
+ router
3991
+ }, void 0, false);
3992
+ $[12] = router;
3993
+ $[13] = t3;
3994
+ } else {
3995
+ t3 = $[13];
3996
+ }
3997
+ let t4;
3998
+ if ($[14] !== t2 || $[15] !== t3) {
3999
+ t4 = /* @__PURE__ */ jsxDEV(StudioChromeContext, {
4000
+ value: t2,
4001
+ children: t3
4002
+ }, void 0, false);
4003
+ $[14] = t2;
4004
+ $[15] = t3;
4005
+ $[16] = t4;
4006
+ } else {
4007
+ t4 = $[16];
4008
+ }
4009
+ return t4;
4010
+ };
4011
+ const Studio = (t0) => {
4012
+ const $ = c(17);
4013
+ const {
4014
+ basePath,
4015
+ chrome,
4016
+ dataEditable,
4017
+ functions,
4018
+ i18n,
4019
+ initialShardKey,
4020
+ locale,
4021
+ openApiSpec,
4022
+ openRpcSpec,
4023
+ runAsIdentity,
4024
+ schemaEditable,
4025
+ scheduledCancel,
4026
+ scheduledCron,
4027
+ scheduledLoad
4028
+ } = t0;
4029
+ let t1;
4030
+ if ($[0] !== basePath || $[1] !== chrome || $[2] !== dataEditable || $[3] !== functions || $[4] !== initialShardKey || $[5] !== openApiSpec || $[6] !== openRpcSpec || $[7] !== runAsIdentity || $[8] !== scheduledCancel || $[9] !== scheduledCron || $[10] !== scheduledLoad || $[11] !== schemaEditable) {
4031
+ t1 = /* @__PURE__ */ jsxDEV(EnsureThemeProvider, {
4032
+ children: /* @__PURE__ */ jsxDEV(StudioShell, {
4033
+ basePath,
4034
+ chrome,
4035
+ dataEditable,
4036
+ functions,
4037
+ initialShardKey,
4038
+ openApiSpec,
4039
+ openRpcSpec,
4040
+ runAsIdentity,
4041
+ scheduledCancel,
4042
+ scheduledCron,
4043
+ scheduledLoad,
4044
+ schemaEditable
4045
+ }, void 0, false)
4046
+ }, void 0, false);
4047
+ $[0] = basePath;
4048
+ $[1] = chrome;
4049
+ $[2] = dataEditable;
4050
+ $[3] = functions;
4051
+ $[4] = initialShardKey;
4052
+ $[5] = openApiSpec;
4053
+ $[6] = openRpcSpec;
4054
+ $[7] = runAsIdentity;
4055
+ $[8] = scheduledCancel;
4056
+ $[9] = scheduledCron;
4057
+ $[10] = scheduledLoad;
4058
+ $[11] = schemaEditable;
4059
+ $[12] = t1;
4060
+ } else {
4061
+ t1 = $[12];
4062
+ }
4063
+ const shell = t1;
4064
+ if (i18n === void 0 && locale === void 0) {
4065
+ return shell;
4066
+ }
4067
+ let t2;
4068
+ if ($[13] !== i18n || $[14] !== locale || $[15] !== shell) {
4069
+ t2 = /* @__PURE__ */ jsxDEV(StudioI18nProvider, {
4070
+ i18n,
4071
+ locale,
4072
+ children: shell
4073
+ }, void 0, false);
4074
+ $[13] = i18n;
4075
+ $[14] = locale;
4076
+ $[15] = shell;
4077
+ $[16] = t2;
4078
+ } else {
4079
+ t2 = $[16];
4080
+ }
4081
+ return t2;
4082
+ };
4083
+ function _temp(state) {
4084
+ return state.location.pathname;
4085
+ }
4086
+ function _temp2(group_0) {
4087
+ return group_0.tabs.length > 0;
4088
+ }
4089
+
4090
+ export { BrandMark as B, Studio as S, ThemeProvider as T, TooltipProvider as a, Sheet as b, SheetContent as c, SheetHeader as d, SheetTitle as e, useTheme as u };