@lunora/studio 1.0.0-alpha.4 → 1.0.0-alpha.40

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