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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. package/LICENSE.md +6 -0
  2. package/__assets__/package-og.svg +1 -1
  3. package/dist/index.d.ts +45 -23
  4. package/dist/index.js +31 -31
  5. package/dist/mount.d.ts +1 -1
  6. package/dist/mount.js +3 -2
  7. package/dist/{packem_shared/ApiTab-W3no0KOj.js → packem_chunks/ApiTab.js} +5 -5
  8. package/dist/{packem_shared/AuditPanel-Bq4o_IqT.js → packem_chunks/AuditPanel.js} +29 -41
  9. package/dist/{packem_shared/ExportImportPanel-dxY56TDF.js → packem_chunks/ExportImportPanel.js} +16 -11
  10. package/dist/{packem_shared/FileBrowser-Dhy4zES8.js → packem_chunks/FileBrowser.js} +55 -32
  11. package/dist/{packem_shared/FunctionRunner--fQJRPAD.js → packem_chunks/FunctionRunner.js} +15 -32
  12. package/dist/{packem_shared/FunctionStatsPanel-BjRUA_G3.js → packem_chunks/FunctionStatsPanel.js} +153 -208
  13. package/dist/{packem_shared/HealthPanel-PxclMWmA.js → packem_chunks/HealthPanel.js} +37 -29
  14. package/dist/{packem_shared/InsightsPanel-CWS_C-xW.js → packem_chunks/InsightsPanel.js} +108 -69
  15. package/dist/{packem_shared/LogsPanel-CTW8CFcM.js → packem_chunks/LogsPanel.js} +46 -58
  16. package/dist/{packem_shared/MailPanel-BwkvfIHF.js → packem_chunks/MailPanel.js} +45 -139
  17. package/dist/{packem_shared/MetricsPanel-BLuOhZQ4.js → packem_chunks/MetricsPanel.js} +41 -322
  18. package/dist/{packem_shared/MigrationsPanel-DT3lnwHF.js → packem_chunks/MigrationsPanel.js} +44 -51
  19. package/dist/{packem_shared/PitrPanel-CdErL7EJ.js → packem_chunks/PitrPanel.js} +9 -9
  20. package/dist/{packem_shared/SchemaViewer-LJDcmNIO.js → packem_chunks/SchemaViewer.js} +17 -16
  21. package/dist/{packem_shared/SecurityAdvisorPanel-C_ETsPih.js → packem_chunks/SecurityAdvisorPanel.js} +47 -31
  22. package/dist/packem_chunks/SettingsPanel.js +391 -0
  23. package/dist/{packem_shared/sql-editor-panel-BFRpzj6r.js → packem_chunks/SqlEditorPanel.js} +159 -387
  24. package/dist/{packem_shared/TableEditor-ChfUOZec.js → packem_chunks/TableEditor.js} +13 -94
  25. package/dist/packem_chunks/agents-panel.js +326 -0
  26. package/dist/packem_chunks/analytics-panel.js +261 -0
  27. package/dist/packem_chunks/auth-config-panel.js +365 -0
  28. package/dist/packem_chunks/auth-sessions-panel.js +175 -0
  29. package/dist/packem_chunks/containers-panel.js +261 -0
  30. package/dist/packem_chunks/dashboards-panel.js +781 -0
  31. package/dist/packem_chunks/fanout-panel.js +482 -0
  32. package/dist/packem_chunks/flags-panel.js +176 -0
  33. package/dist/packem_chunks/issues-panel.js +188 -0
  34. package/dist/packem_chunks/kv-browser.js +1896 -0
  35. package/dist/packem_chunks/log-drains-panel.js +273 -0
  36. package/dist/packem_chunks/organizations-panel.js +3178 -0
  37. package/dist/packem_chunks/payments-panel.js +186 -0
  38. package/dist/packem_chunks/permissions-panel.js +805 -0
  39. package/dist/packem_chunks/queues-panel.js +1075 -0
  40. package/dist/packem_chunks/rls-panel.js +315 -0
  41. package/dist/packem_chunks/schedule-panel.js +831 -0
  42. package/dist/packem_chunks/sparkline.js +79 -0
  43. package/dist/packem_chunks/storage-rules-panel.js +140 -0
  44. package/dist/packem_chunks/subscriptions-panel.js +238 -0
  45. package/dist/packem_chunks/users-panel.js +1731 -0
  46. package/dist/packem_chunks/vector-browser.js +281 -0
  47. package/dist/packem_chunks/workflows-panel.js +562 -0
  48. package/dist/packem_shared/{ADMIN_FUNCTIONS-DmBqMZ-z.js → ADMIN_FUNCTIONS-DNeyYtUN.js} +8 -0
  49. package/dist/packem_shared/{ApiDocsPanel-C5-yJ1p7.js → ApiDocsPanel-_aEZxAMX.js} +2 -2
  50. package/dist/packem_shared/{ApiReferencePanel-1vubqG5s.js → ApiReferencePanel-Dd8pcswz.js} +2 -1
  51. package/dist/packem_shared/{CommandPalette-BtgkBzZI.js → CommandPalette-BXV4eKf5.js} +1 -1
  52. package/dist/packem_shared/{DataBrowser-CtBe1So9.js → DataBrowser-C8hejnub.js} +201 -250
  53. package/dist/packem_shared/{DataFilters-FNquMaiu.js → DataFilters-B1Q7mrt7.js} +6 -2
  54. package/dist/packem_shared/{GlobalDataBrowser-BTEmGrph.js → GlobalDataBrowser-CxJxRRf2.js} +37 -66
  55. package/dist/packem_shared/HomePanel-Ye8PaqQL.js +14 -0
  56. package/dist/packem_shared/{OpenRpcReferencePanel-vbcYbv3V.js → OpenRpcReferencePanel-CWaf0ZtX.js} +2 -1
  57. package/dist/packem_shared/{ScheduledJobs-CabfKbyM.js → ScheduledJobs-dHMgnJbx.js} +163 -60
  58. package/dist/packem_shared/{ShardInput-gx_DZXXn.js → ShardInput-CZnpHILL.js} +1 -1
  59. package/dist/packem_shared/Studio-xJLTlLpf.js +16 -0
  60. package/dist/packem_shared/{StudioApp-D4azxYBu.js → StudioApp-oCQholCL.js} +6 -21
  61. package/dist/packem_shared/{advisor-view-CGcfMiPq.js → advisor-view-Cx21PS_T.js} +6 -6
  62. package/dist/packem_shared/alert-CdAET2K_.js +68 -0
  63. package/dist/packem_shared/{app.d-CCmwDEVs.d.ts → app.d-CGdOmLTm.d.ts} +1 -1
  64. package/dist/packem_shared/{bar-chart-CzJAgqkp.js → bar-chart-DSwcWIRy.js} +5 -4
  65. package/dist/packem_shared/browser-storage-L4gOP5gJ.js +105 -0
  66. package/dist/packem_shared/{cf-links-2cktDedA.js → cf-links-BZfRdxSE.js} +1 -1
  67. package/dist/packem_shared/{data-grid-B5CaV3wS.js → data-grid-C9I16KWr.js} +1 -1
  68. package/dist/packem_shared/data-view-params-Cd6yRVbv.js +96 -0
  69. package/dist/packem_shared/error-alert-vIPQoN3Y.js +114 -0
  70. package/dist/packem_shared/{grid-features-CzUfqgsM.js → grid-features-B_fZH4iQ.js} +133 -164
  71. package/dist/packem_shared/home-panel-D62G8108.js +1889 -0
  72. package/dist/packem_shared/internal-zwBoOv24.js +122 -0
  73. package/dist/packem_shared/modal-shell-hyaJvIJ6.js +100 -0
  74. package/dist/packem_shared/{reference-view-B4E49Lip.js → reference-view-DUULLuOi.js} +8 -61
  75. package/dist/packem_shared/result-chart-DZradBAS.js +119 -0
  76. package/dist/packem_shared/scroll-area-DLhcy-ml.js +93 -0
  77. package/dist/packem_shared/select-UkNYCT3s.js +273 -0
  78. package/dist/packem_shared/shard-history-AxiJ1WPP.js +16 -0
  79. package/dist/packem_shared/skeleton-CGhL0p20.js +45 -0
  80. package/dist/packem_shared/{sparkline-10dG-_f0.js → sparkline-BnA1kC9X.js} +1 -1
  81. package/dist/packem_shared/studio-WZUOecDv.js +4069 -0
  82. package/dist/packem_shared/{table-_RzNvy3R.js → table-DsCa9Qp9.js} +1 -1
  83. package/dist/packem_shared/{table-list-sidebar-Bg7uzbvC.js → table-list-sidebar-huX4VmgI.js} +19 -9
  84. package/dist/packem_shared/use-admin-query-BGJ010yZ.js +106 -0
  85. package/dist/packem_shared/use-async-submit-DGCtuDyz.js +91 -0
  86. package/dist/standalone/chunk-22C6COGE.js +13 -0
  87. package/dist/standalone/chunk-2CCWLKQW.js +1 -0
  88. package/dist/standalone/chunk-2JTPX3CV.js +1 -0
  89. package/dist/standalone/chunk-2K47A3P6.js +1 -0
  90. package/dist/standalone/chunk-2MLA6WFH.js +1 -0
  91. package/dist/standalone/chunk-2NGUNNGW.js +1 -0
  92. package/dist/standalone/chunk-3CPQ5IQU.js +1 -0
  93. package/dist/standalone/chunk-3GXGLNKW.js +1 -0
  94. package/dist/standalone/chunk-3OA7PECS.js +6 -0
  95. package/dist/standalone/chunk-4AXW2ECS.js +13 -0
  96. package/dist/standalone/chunk-4BVRLBEW.js +1 -0
  97. package/dist/standalone/chunk-4PC7IXNY.js +1 -0
  98. package/dist/standalone/chunk-4QHKBC77.js +1 -0
  99. package/dist/standalone/chunk-5OIBXYZM.js +1 -0
  100. package/dist/standalone/chunk-5OZQHQ26.js +1 -0
  101. package/dist/standalone/chunk-6RREMPQX.js +2 -0
  102. package/dist/standalone/chunk-6ZBU3JWR.js +3 -0
  103. package/dist/standalone/chunk-7LDYSHOU.js +1 -0
  104. package/dist/standalone/chunk-7TJJXVSE.js +1 -0
  105. package/dist/standalone/chunk-A2DBMISD.js +1 -0
  106. package/dist/standalone/chunk-A3ZJACVT.js +4 -0
  107. package/dist/standalone/chunk-A66LI6OV.js +4 -0
  108. package/dist/standalone/chunk-AHILM3ZP.js +1 -0
  109. package/dist/standalone/chunk-AITOCPML.js +1 -0
  110. package/dist/standalone/chunk-APSSZB6Z.js +1 -0
  111. package/dist/standalone/chunk-BGG56IF5.js +1 -0
  112. package/dist/standalone/chunk-BJGBHGK3.js +1 -0
  113. package/dist/standalone/chunk-CJXJIRSN.js +1 -0
  114. package/dist/standalone/chunk-CKSHCYGC.js +2 -0
  115. package/dist/standalone/chunk-DR6LGPXE.js +1 -0
  116. package/dist/standalone/chunk-DWDILV2E.js +1 -0
  117. package/dist/standalone/chunk-EEWKIQUE.js +1 -0
  118. package/dist/standalone/chunk-EOE5NDMK.js +1 -0
  119. package/dist/standalone/chunk-FAUN4Z72.js +1 -0
  120. package/dist/standalone/chunk-G7ZBM54M.js +1 -0
  121. package/dist/standalone/chunk-GTM65MVX.js +1 -0
  122. package/dist/standalone/chunk-HAJSYWFT.js +8 -0
  123. package/dist/standalone/chunk-HQM6MBPS.js +1 -0
  124. package/dist/standalone/chunk-HTQNZXDT.js +1 -0
  125. package/dist/standalone/chunk-HV7G6DFP.js +5 -0
  126. package/dist/standalone/chunk-IO2XEI6T.js +1 -0
  127. package/dist/standalone/chunk-ITQKVEP7.js +19 -0
  128. package/dist/standalone/chunk-IZN4TYMN.js +1 -0
  129. package/dist/standalone/chunk-J6J54MBP.js +1 -0
  130. package/dist/standalone/chunk-JM7XBQVK.js +1 -0
  131. package/dist/standalone/chunk-JPILGFXT.js +1 -0
  132. package/dist/standalone/chunk-JSEXCW5Q.js +1 -0
  133. package/dist/standalone/chunk-JUDPYSJZ.js +1 -0
  134. package/dist/standalone/chunk-K4S652EQ.js +4 -0
  135. package/dist/standalone/chunk-KEGAWN6Y.js +1 -0
  136. package/dist/standalone/chunk-KJFFID72.js +1 -0
  137. package/dist/standalone/chunk-KJJ3WM6H.js +4 -0
  138. package/dist/standalone/chunk-KZ6INM5M.js +1 -0
  139. package/dist/standalone/chunk-L7SK4ZZD.js +1 -0
  140. package/dist/standalone/chunk-LAK5VSPI.js +1 -0
  141. package/dist/standalone/chunk-LJAAZNQ6.js +1 -0
  142. package/dist/standalone/chunk-LUP4YTBS.js +1 -0
  143. package/dist/standalone/chunk-LX7KONE3.js +1 -0
  144. package/dist/standalone/chunk-MDTNVR3G.js +1 -0
  145. package/dist/standalone/chunk-NS23QR4W.js +1 -0
  146. package/dist/standalone/chunk-NW6SZZ5O.js +1 -0
  147. package/dist/standalone/chunk-O3NAGRTR.js +1 -0
  148. package/dist/standalone/chunk-P2ERTKMB.js +1 -0
  149. package/dist/standalone/chunk-PS3XCCZD.js +1 -0
  150. package/dist/standalone/chunk-QAFAJBAW.js +1 -0
  151. package/dist/standalone/chunk-RRCPZMC2.js +22 -0
  152. package/dist/standalone/chunk-RS7S7XVP.js +1 -0
  153. package/dist/standalone/chunk-S5NTGHCG.js +1 -0
  154. package/dist/standalone/chunk-S7AB7Y75.js +1 -0
  155. package/dist/standalone/chunk-SDMZKBTD.js +1 -0
  156. package/dist/standalone/chunk-SDQE2IUJ.js +1 -0
  157. package/dist/standalone/chunk-SEU5V7I6.js +1 -0
  158. package/dist/standalone/chunk-SHERR7ZP.js +1 -0
  159. package/dist/standalone/chunk-SHJUAHC6.js +1 -0
  160. package/dist/standalone/chunk-TAD43CG5.js +1 -0
  161. package/dist/standalone/chunk-TO6D2PJC.js +6 -0
  162. package/dist/standalone/chunk-TQ36RWOP.js +1 -0
  163. package/dist/standalone/chunk-TYN6SQ73.js +1 -0
  164. package/dist/standalone/chunk-U26QNHMO.js +1 -0
  165. package/dist/standalone/chunk-UK64ZSUW.js +1 -0
  166. package/dist/standalone/chunk-UTHHHJYS.js +1 -0
  167. package/dist/standalone/chunk-V43BLH4J.js +1 -0
  168. package/dist/standalone/chunk-VL23Y44O.js +4 -0
  169. package/dist/standalone/chunk-VL6HOZHF.js +1 -0
  170. package/dist/standalone/chunk-VLXV72QE.js +1 -0
  171. package/dist/standalone/chunk-W666BB6V.js +1 -0
  172. package/dist/standalone/chunk-W6JKUZKD.js +1 -0
  173. package/dist/standalone/chunk-WI7GWFEG.js +1 -0
  174. package/dist/standalone/chunk-WUFVFVHJ.js +1 -0
  175. package/dist/standalone/chunk-WVTPZ6CM.js +1 -0
  176. package/dist/standalone/chunk-X2TQRMQV.js +1 -0
  177. package/dist/standalone/chunk-X4676IX6.js +1 -0
  178. package/dist/standalone/chunk-X4QFAAZ5.js +76 -0
  179. package/dist/standalone/chunk-XJU5SRNL.js +4 -0
  180. package/dist/standalone/chunk-XNJNSCLM.js +1 -0
  181. package/dist/standalone/chunk-XWPZBZSZ.js +3 -0
  182. package/dist/standalone/chunk-YLHDKM2P.js +1 -0
  183. package/dist/standalone/chunk-ZHVTQ37P.js +1 -0
  184. package/dist/standalone/chunk-ZIGWVHCS.js +1 -0
  185. package/dist/standalone/chunk-ZPP2KOR4.js +1 -0
  186. package/dist/standalone/chunk-ZPUO7FNI.js +1 -0
  187. package/dist/standalone/studio.js +104 -246
  188. package/dist/styles.css +2 -2
  189. package/package.json +17 -15
  190. package/dist/packem_shared/HomePanel-Cw16stjq.js +0 -1273
  191. package/dist/packem_shared/SettingsPanel-C0uLRf5P.js +0 -176
  192. package/dist/packem_shared/SqlEditorPanel-CguV7otm.js +0 -13
  193. package/dist/packem_shared/Studio-BmSGSIuY.js +0 -33
  194. package/dist/packem_shared/internal-rXJEAhXS.js +0 -68
  195. package/dist/packem_shared/shard-history-DyebH1R5.js +0 -38
  196. package/dist/packem_shared/studio-H9fuQgSj.js +0 -10303
  197. package/dist/packem_shared/use-live-admin-Dq6g3daN.js +0 -73
  198. package/dist/packem_shared/use-live-shard-seed-Cuk3dnH0.js +0 -76
@@ -0,0 +1,4069 @@
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-D62G8108.js';
25
+ import { StudioI18nProvider } from './StudioI18nProvider-B-tDCZIi.js';
26
+ import { v as validateDataViewSearch } from './data-view-params-Cd6yRVbv.js';
27
+ import { f as fireAndForget } from './internal-zwBoOv24.js';
28
+ import { CommandPalette, openCommandPalette } from './CommandPalette-BXV4eKf5.js';
29
+
30
+ const DARK_MEDIA_QUERY = "(prefers-color-scheme: dark)";
31
+ const store = () => {
32
+ try {
33
+ return globalThis.localStorage;
34
+ } catch {
35
+ return void 0;
36
+ }
37
+ };
38
+ const isPreference = (value) => value === "system" || value === "light" || value === "dark";
39
+ const matchMedia = () => globalThis.matchMedia;
40
+ const THEME_STORAGE_KEY = "lunora-studio-theme";
41
+ const THEME_ORDER = ["system", "light", "dark"];
42
+ const loadThemePreference = (fallback = "system") => {
43
+ try {
44
+ const raw = store()?.getItem(THEME_STORAGE_KEY);
45
+ return isPreference(raw) ? raw : fallback;
46
+ } catch {
47
+ return fallback;
48
+ }
49
+ };
50
+ const saveThemePreference = (preference) => {
51
+ const storage = store();
52
+ if (storage === void 0) {
53
+ return;
54
+ }
55
+ try {
56
+ storage.setItem(THEME_STORAGE_KEY, preference);
57
+ } catch {
58
+ }
59
+ };
60
+ const getSystemTheme = () => {
61
+ try {
62
+ return matchMedia()?.(DARK_MEDIA_QUERY).matches ? "dark" : "light";
63
+ } catch {
64
+ return "light";
65
+ }
66
+ };
67
+ const resolveTheme = (preference, system) => preference === "system" ? system : preference;
68
+ const subscribeSystemTheme = (onChange) => {
69
+ let mql;
70
+ try {
71
+ mql = matchMedia()?.(DARK_MEDIA_QUERY);
72
+ } catch {
73
+ mql = void 0;
74
+ }
75
+ if (mql === void 0) {
76
+ return () => {
77
+ };
78
+ }
79
+ const handler = (event) => {
80
+ onChange(event.matches ? "dark" : "light");
81
+ };
82
+ mql.addEventListener("change", handler);
83
+ return () => {
84
+ mql.removeEventListener("change", handler);
85
+ };
86
+ };
87
+
88
+ const ThemeContext = /* @__PURE__ */ createContext(null);
89
+ const ThemeProvider = ({
90
+ children,
91
+ defaultTheme = "system"
92
+ }) => {
93
+ const [theme, setThemeState] = useState(() => loadThemePreference(defaultTheme));
94
+ const [systemTheme, setSystemTheme] = useState(() => getSystemTheme());
95
+ useEffect(() => subscribeSystemTheme(setSystemTheme), []);
96
+ const setTheme = (next) => {
97
+ saveThemePreference(next);
98
+ setThemeState(next);
99
+ };
100
+ const cycleTheme = () => {
101
+ setThemeState((current) => {
102
+ const next_0 = THEME_ORDER[(THEME_ORDER.indexOf(current) + 1) % THEME_ORDER.length] ?? current;
103
+ saveThemePreference(next_0);
104
+ return next_0;
105
+ });
106
+ };
107
+ const value = {
108
+ cycleTheme,
109
+ resolvedTheme: resolveTheme(theme, systemTheme),
110
+ setTheme,
111
+ systemTheme,
112
+ theme
113
+ };
114
+ return /* @__PURE__ */ jsxDEV(ThemeContext, {
115
+ value,
116
+ children
117
+ }, void 0, false);
118
+ };
119
+ const 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 AgentsPanel = lazyNamed(() => import('../packem_chunks/agents-panel.js'), "AgentsPanel");
1627
+ const AnalyticsPanel = lazyNamed(() => import('../packem_chunks/analytics-panel.js'), "AnalyticsPanel");
1628
+ const ApiTab = /* @__PURE__ */ lazy(() => import('../packem_chunks/ApiTab.js'));
1629
+ const AuthConfigPanel = lazyNamed(() => import('../packem_chunks/auth-config-panel.js'), "AuthConfigPanel");
1630
+ const AuthSessionsPanel = lazyNamed(() => import('../packem_chunks/auth-sessions-panel.js'), "AuthSessionsPanel");
1631
+ const OrganizationsPanel = lazyNamed(() => import('../packem_chunks/organizations-panel.js'), "OrganizationsPanel");
1632
+ const UsersPanel = lazyNamed(() => import('../packem_chunks/users-panel.js'), "UsersPanel");
1633
+ const ContainersPanel = lazyNamed(() => import('../packem_chunks/containers-panel.js'), "ContainersPanel");
1634
+ const TableEditor = lazyNamed(() => import('../packem_chunks/TableEditor.js'), "TableEditor");
1635
+ const ExportImportPanel = lazyNamed(() => import('../packem_chunks/ExportImportPanel.js'), "ExportImportPanel");
1636
+ const MigrationsPanel = lazyNamed(() => import('../packem_chunks/MigrationsPanel.js'), "MigrationsPanel");
1637
+ const PitrPanel = lazyNamed(() => import('../packem_chunks/PitrPanel.js'), "PitrPanel");
1638
+ const FlagsPanel = lazyNamed(() => import('../packem_chunks/flags-panel.js'), "FlagsPanel");
1639
+ const FunctionRunner = lazyNamed(() => import('../packem_chunks/FunctionRunner.js'), "FunctionRunner");
1640
+ const FunctionStatsPanel = lazyNamed(() => import('../packem_chunks/FunctionStatsPanel.js'), "FunctionStatsPanel");
1641
+ const IssuesPanel = lazyNamed(() => import('../packem_chunks/issues-panel.js'), "IssuesPanel");
1642
+ const AuditPanel = lazyNamed(() => import('../packem_chunks/AuditPanel.js'), "AuditPanel");
1643
+ const LogDrainsPanel = lazyNamed(() => import('../packem_chunks/log-drains-panel.js'), "LogDrainsPanel");
1644
+ const LogsPanel = /* @__PURE__ */ lazy(() => import('../packem_chunks/LogsPanel.js').then((m) => {
1645
+ return {
1646
+ default: m.LogsPanel
1647
+ };
1648
+ }));
1649
+ const MailPanel = lazyNamed(() => import('../packem_chunks/MailPanel.js'), "MailPanel");
1650
+ const SchedulePanel = lazyNamed(() => import('../packem_chunks/schedule-panel.js'), "SchedulePanel");
1651
+ const SubscriptionsPanel = /* @__PURE__ */ lazy(() => import('../packem_chunks/subscriptions-panel.js'));
1652
+ const KvBrowser = lazyNamed(() => import('../packem_chunks/kv-browser.js'), "KvBrowser");
1653
+ const PaymentsPanel = lazyNamed(() => import('../packem_chunks/payments-panel.js'), "PaymentsPanel");
1654
+ const PermissionsPanel = lazyNamed(() => import('../packem_chunks/permissions-panel.js'), "PermissionsPanel");
1655
+ const QueuesPanel = /* @__PURE__ */ lazy(() => import('../packem_chunks/queues-panel.js'));
1656
+ const DashboardsPanel = /* @__PURE__ */ lazy(() => import('../packem_chunks/dashboards-panel.js'));
1657
+ const FanoutPanel = /* @__PURE__ */ lazy(() => import('../packem_chunks/fanout-panel.js'));
1658
+ const HealthPanel = lazyNamed(() => import('../packem_chunks/HealthPanel.js'), "HealthPanel");
1659
+ const MetricsPanel = lazyNamed(() => import('../packem_chunks/MetricsPanel.js'), "MetricsPanel");
1660
+ const SchemaViewer = lazyNamed(() => import('../packem_chunks/SchemaViewer.js'), "SchemaViewer");
1661
+ const SettingsPanel = lazyNamed(() => import('../packem_chunks/SettingsPanel.js'), "SettingsPanel");
1662
+ const SqlEditorPanel = lazyNamed(() => import('../packem_chunks/SqlEditorPanel.js'), "SqlEditorPanel");
1663
+ const FileBrowser = lazyNamed(() => import('../packem_chunks/FileBrowser.js'), "FileBrowser");
1664
+ const StorageRulesPanel = lazyNamed(() => import('../packem_chunks/storage-rules-panel.js'), "StorageRulesPanel");
1665
+ const VectorBrowser = lazyNamed(() => import('../packem_chunks/vector-browser.js'), "VectorBrowser");
1666
+ const WorkflowsPanel = /* @__PURE__ */ lazy(() => import('../packem_chunks/workflows-panel.js'));
1667
+ const StudioChromeContext = /* @__PURE__ */ createContext(null);
1668
+ const TAB_ICONS = {
1669
+ analytics: /* @__PURE__ */ jsxDEV("path", {
1670
+ d: "M5 20V10m6.5 10V4M18 20v-7M3 20h18"
1671
+ }, void 0, false),
1672
+ api: /* @__PURE__ */ jsxDEV("path", {
1673
+ d: "m9 8-4 4 4 4m6-8 4 4-4 4M13 5l-2 14"
1674
+ }, void 0, false),
1675
+ audit: /* @__PURE__ */ jsxDEV("path", {
1676
+ 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"
1677
+ }, void 0, false),
1678
+ authConfig: /* @__PURE__ */ jsxDEV("path", {
1679
+ 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"
1680
+ }, void 0, false),
1681
+ agents: /* @__PURE__ */ jsxDEV("path", {
1682
+ d: "M12 8V5m0 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM6 8h12a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-6a2 2 0 0 1 2-2Zm3 5h.01M15 13h.01M9 21h6"
1683
+ }, void 0, false),
1684
+ authSessions: /* @__PURE__ */ jsxDEV("path", {
1685
+ d: "M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-13.5V12l4 2"
1686
+ }, void 0, false),
1687
+ containers: /* @__PURE__ */ jsxDEV("path", {
1688
+ d: "M3 7.5 12 3l9 4.5v9L12 21l-9-4.5v-9Zm0 0 9 4.5m0 0 9-4.5m-9 4.5V21"
1689
+ }, void 0, false),
1690
+ dashboards: /* @__PURE__ */ jsxDEV("path", {
1691
+ d: "M4 5h7v6H4V5Zm9 0h7v4h-7V5ZM4 14h7v5H4v-5Zm9-1h7v6h-7v-6Z"
1692
+ }, void 0, false),
1693
+ drains: /* @__PURE__ */ jsxDEV("path", {
1694
+ d: "M5 5h14M7 5v6a5 5 0 0 0 10 0V5M10 16h4v3h-4zM12 19v2"
1695
+ }, void 0, false),
1696
+ data: /* @__PURE__ */ jsxDEV("path", {
1697
+ 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"
1698
+ }, void 0, false),
1699
+ export: /* @__PURE__ */ jsxDEV("path", {
1700
+ d: "M12 3v11m0 0 4-4m-4 4-4-4M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2"
1701
+ }, void 0, false),
1702
+ fanout: /* @__PURE__ */ jsxDEV("path", {
1703
+ 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"
1704
+ }, void 0, false),
1705
+ files: /* @__PURE__ */ jsxDEV("path", {
1706
+ 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"
1707
+ }, void 0, false),
1708
+ flags: /* @__PURE__ */ jsxDEV("path", {
1709
+ d: "M6 21V4m0 0h11l-2 3 2 3H6"
1710
+ }, void 0, false),
1711
+ functions: /* @__PURE__ */ jsxDEV("path", {
1712
+ d: "m9 8-4 4 4 4m6-8 4 4-4 4"
1713
+ }, void 0, false),
1714
+ health: /* @__PURE__ */ jsxDEV("path", {
1715
+ d: "M3 12h4l2 6 4-14 2 8h6"
1716
+ }, void 0, false),
1717
+ home: /* @__PURE__ */ jsxDEV("path", {
1718
+ d: "M3 11.5 12 4l9 7.5M5 10v9a1 1 0 0 0 1 1h4v-6h4v6h4a1 1 0 0 0 1-1v-9"
1719
+ }, void 0, false),
1720
+ insights: /* @__PURE__ */ jsxDEV("path", {
1721
+ 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"
1722
+ }, void 0, false),
1723
+ issues: /* @__PURE__ */ jsxDEV("path", {
1724
+ d: "M10.3 4.3 2.5 18a2 2 0 0 0 1.7 3h15.6a2 2 0 0 0 1.7-3L13.7 4.3a2 2 0 0 0-3.4 0ZM12 9v4m0 3v.01"
1725
+ }, void 0, false),
1726
+ kv: /* @__PURE__ */ jsxDEV("path", {
1727
+ d: "M5 5h14v4H5V5Zm0 5h14v4H5v-4Zm0 5h14v4H5v-4Z"
1728
+ }, void 0, false),
1729
+ logs: /* @__PURE__ */ jsxDEV("path", {
1730
+ d: "M5 6h14M5 10h14M5 14h9M5 18h11"
1731
+ }, void 0, false),
1732
+ mail: /* @__PURE__ */ jsxDEV("path", {
1733
+ d: "M4 5h16v14H4V5Zm0 1.5 8 6 8-6"
1734
+ }, void 0, false),
1735
+ payments: /* @__PURE__ */ jsxDEV("path", {
1736
+ d: "M3 7h18v10H3V7Zm0 3h18M7 14h4"
1737
+ }, void 0, false),
1738
+ metrics: /* @__PURE__ */ jsxDEV("path", {
1739
+ d: "M5 20V10m6.5 10V4M18 20v-7M3 20h18"
1740
+ }, void 0, false),
1741
+ migrations: /* @__PURE__ */ jsxDEV("path", {
1742
+ 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"
1743
+ }, void 0, false),
1744
+ organizations: /* @__PURE__ */ jsxDEV("path", {
1745
+ d: "M3 21V8l6-4 6 4v13M9 21v-5h2v5M15 11h6v10M18 14v.01M18 17v.01M6 9v.01M6 12v.01M6 15v.01"
1746
+ }, void 0, false),
1747
+ permissions: /* @__PURE__ */ jsxDEV("path", {
1748
+ 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"
1749
+ }, void 0, false),
1750
+ pitr: /* @__PURE__ */ jsxDEV("path", {
1751
+ d: "M12 21a9 9 0 1 0-9-9M12 7.5V12l3 2M3 12l-2-2m2 2 2-2"
1752
+ }, void 0, false),
1753
+ queues: /* @__PURE__ */ jsxDEV("path", {
1754
+ d: "M4 6h16M4 10h16M4 14h10M4 18h10m4-2 3 2-3 2v-4Z"
1755
+ }, void 0, false),
1756
+ realtime: /* @__PURE__ */ jsxDEV("path", {
1757
+ 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"
1758
+ }, void 0, false),
1759
+ rls: /* @__PURE__ */ jsxDEV("path", {
1760
+ 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"
1761
+ }, void 0, false),
1762
+ schedule: /* @__PURE__ */ jsxDEV("path", {
1763
+ d: "M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-13.5V12l4 2"
1764
+ }, void 0, false),
1765
+ schema: /* @__PURE__ */ jsxDEV("path", {
1766
+ d: "M4 5h16v14H4V5Zm0 5h16M10 10v9M4 14.5h16"
1767
+ }, void 0, false),
1768
+ sql: /* @__PURE__ */ jsxDEV("path", {
1769
+ d: "M4 5h16v14H4V5Zm3 4 3 3-3 3m6 0h4"
1770
+ }, void 0, false),
1771
+ storageRules: /* @__PURE__ */ jsxDEV("path", {
1772
+ 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"
1773
+ }, void 0, false),
1774
+ security: /* @__PURE__ */ jsxDEV("path", {
1775
+ 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"
1776
+ }, void 0, false),
1777
+ settings: /* @__PURE__ */ jsxDEV("path", {
1778
+ 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"
1779
+ }, void 0, false),
1780
+ users: /* @__PURE__ */ jsxDEV("path", {
1781
+ 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"
1782
+ }, void 0, false),
1783
+ vectors: /* @__PURE__ */ jsxDEV("path", {
1784
+ d: "M4 7l8-4 8 4-8 4-8-4Zm0 5 8 4 8-4M4 17l8 4 8-4"
1785
+ }, void 0, false),
1786
+ workflows: /* @__PURE__ */ jsxDEV("path", {
1787
+ d: "M5 5h5v5H5V5Zm9 9h5v5h-5v-5ZM7.5 10v2a2 2 0 0 0 2 2H14m2.5-4V8a2 2 0 0 0-2-2H10"
1788
+ }, void 0, false)
1789
+ };
1790
+ const NAV_GROUPS = [{
1791
+ key: "overview",
1792
+ tabs: ["home", "dashboards"]
1793
+ }, {
1794
+ key: "database",
1795
+ tabs: ["data", "sql", "schema", "migrations", "vectors", "pitr", "export"]
1796
+ }, {
1797
+ key: "functions",
1798
+ tabs: ["functions", "api", "workflows", "agents", "queues"]
1799
+ }, {
1800
+ key: "auth",
1801
+ tabs: ["users", "organizations", "authSessions", "authConfig"]
1802
+ }, {
1803
+ key: "storage",
1804
+ tabs: ["files", "storageRules", "kv"]
1805
+ }, {
1806
+ key: "observability",
1807
+ tabs: ["issues", "logs", "audit", "realtime", "fanout", "containers", "metrics", "analytics", "health"]
1808
+ }, {
1809
+ key: "advisors",
1810
+ tabs: ["security", "rls", "permissions", "insights"]
1811
+ }, {
1812
+ key: "operations",
1813
+ tabs: ["schedule", "mail", "drains", "payments", "flags"]
1814
+ }, {
1815
+ key: "settings",
1816
+ tabs: ["settings"]
1817
+ }];
1818
+ const TAB_FEATURE = {
1819
+ analytics: "analytics",
1820
+ authConfig: "auth",
1821
+ authSessions: "auth",
1822
+ containers: "containers",
1823
+ files: "storage",
1824
+ flags: "flags",
1825
+ kv: "kv",
1826
+ mail: "mail",
1827
+ organizations: "auth",
1828
+ payments: "payments",
1829
+ queues: "queues",
1830
+ schedule: "scheduler",
1831
+ storageRules: "storage",
1832
+ users: "auth",
1833
+ vectors: "vectors",
1834
+ workflows: "workflows"
1835
+ };
1836
+ const isTabVisible = (tab, features) => {
1837
+ const feature = TAB_FEATURE[tab];
1838
+ return feature === void 0 || features[feature];
1839
+ };
1840
+ const TabIcon = (t0) => {
1841
+ const $ = c(2);
1842
+ const {
1843
+ tab
1844
+ } = t0;
1845
+ const t1 = TAB_ICONS[tab];
1846
+ let t2;
1847
+ if ($[0] !== t1) {
1848
+ t2 = /* @__PURE__ */ jsxDEV("svg", {
1849
+ "aria-hidden": "true",
1850
+ className: "size-4 shrink-0",
1851
+ fill: "none",
1852
+ stroke: "currentColor",
1853
+ strokeLinecap: "round",
1854
+ strokeLinejoin: "round",
1855
+ strokeWidth: 1.6,
1856
+ viewBox: "0 0 24 24",
1857
+ children: t1
1858
+ }, void 0, false);
1859
+ $[0] = t1;
1860
+ $[1] = t2;
1861
+ } else {
1862
+ t2 = $[1];
1863
+ }
1864
+ return t2;
1865
+ };
1866
+ const exhaustiveRouteTabs = (tabs) => tabs;
1867
+ const TABS = exhaustiveRouteTabs(["home", "data", "sql", "functions", "api", "workflows", "agents", "queues", "containers", "schema", "migrations", "vectors", "export", "pitr", "users", "organizations", "authSessions", "authConfig", "files", "storageRules", "kv", "dashboards", "metrics", "analytics", "health", "security", "rls", "permissions", "insights", "issues", "logs", "realtime", "fanout", "mail", "payments", "audit", "schedule", "drains", "flags", "settings"]);
1868
+ const FULL_HEIGHT_TABS = /* @__PURE__ */ new Set(["api", "data", "sql"]);
1869
+ const tabFromPathname = (pathname) => {
1870
+ const slug = pathname.split("/").findLast(Boolean) ?? "";
1871
+ return TABS.includes(slug) ? slug : "home";
1872
+ };
1873
+ const ConnectPopoverContent = (t0) => {
1874
+ const $ = c(19);
1875
+ const {
1876
+ chrome,
1877
+ connected
1878
+ } = t0;
1879
+ const t = useT();
1880
+ let t1;
1881
+ if ($[0] !== t) {
1882
+ t1 = t("admin token");
1883
+ $[0] = t;
1884
+ $[1] = t1;
1885
+ } else {
1886
+ t1 = $[1];
1887
+ }
1888
+ let t2;
1889
+ if ($[2] !== t1) {
1890
+ t2 = /* @__PURE__ */ jsxDEV("label", {
1891
+ className: "text-xs font-medium text-foreground",
1892
+ htmlFor: "dash-app-token",
1893
+ children: t1
1894
+ }, void 0, false);
1895
+ $[2] = t1;
1896
+ $[3] = t2;
1897
+ } else {
1898
+ t2 = $[3];
1899
+ }
1900
+ let t3;
1901
+ if ($[4] !== chrome.onTokenChange || $[5] !== chrome.token) {
1902
+ t3 = /* @__PURE__ */ jsxDEV(Input, {
1903
+ className: "h-8",
1904
+ "data-testid": "dash-app-token",
1905
+ id: "dash-app-token",
1906
+ onChange: chrome.onTokenChange,
1907
+ placeholder: "LUNORA_ADMIN_TOKEN",
1908
+ type: "password",
1909
+ value: chrome.token
1910
+ }, void 0, false);
1911
+ $[4] = chrome.onTokenChange;
1912
+ $[5] = chrome.token;
1913
+ $[6] = t3;
1914
+ } else {
1915
+ t3 = $[6];
1916
+ }
1917
+ let t4;
1918
+ if ($[7] !== connected || $[8] !== t) {
1919
+ t4 = connected && /* @__PURE__ */ jsxDEV("p", {
1920
+ className: "flex items-start gap-1.5 text-[11px] text-muted-foreground",
1921
+ "data-testid": "dash-app-token-warning",
1922
+ role: "note",
1923
+ children: [/* @__PURE__ */ jsxDEV("span", {
1924
+ "aria-hidden": "true",
1925
+ className: "text-warning",
1926
+ children: "⚠"
1927
+ }, void 0, false), t("Token rides the WebSocket URL — it can surface in browser DevTools and server logs. Use a dev-only token.")]
1928
+ }, void 0, true);
1929
+ $[7] = connected;
1930
+ $[8] = t;
1931
+ $[9] = t4;
1932
+ } else {
1933
+ t4 = $[9];
1934
+ }
1935
+ let t5;
1936
+ if ($[10] !== chrome.clearToken || $[11] !== connected || $[12] !== t) {
1937
+ t5 = connected && /* @__PURE__ */ jsxDEV("button", {
1938
+ 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",
1939
+ "data-testid": "dash-app-clear-token",
1940
+ onClick: chrome.clearToken,
1941
+ type: "button",
1942
+ children: t("Clear")
1943
+ }, void 0, false);
1944
+ $[10] = chrome.clearToken;
1945
+ $[11] = connected;
1946
+ $[12] = t;
1947
+ $[13] = t5;
1948
+ } else {
1949
+ t5 = $[13];
1950
+ }
1951
+ let t6;
1952
+ if ($[14] !== t2 || $[15] !== t3 || $[16] !== t4 || $[17] !== t5) {
1953
+ t6 = /* @__PURE__ */ jsxDEV("div", {
1954
+ className: "flex flex-col gap-2",
1955
+ children: [t2, t3, t4, t5]
1956
+ }, void 0, true);
1957
+ $[14] = t2;
1958
+ $[15] = t3;
1959
+ $[16] = t4;
1960
+ $[17] = t5;
1961
+ $[18] = t6;
1962
+ } else {
1963
+ t6 = $[18];
1964
+ }
1965
+ return t6;
1966
+ };
1967
+ const CollapsedGroupNav = (t0) => {
1968
+ const $ = c(25);
1969
+ const {
1970
+ current,
1971
+ group,
1972
+ groupLabel,
1973
+ selectTab,
1974
+ tabDescription,
1975
+ tabLabel
1976
+ } = t0;
1977
+ const t1 = group.tabs.includes(current) ? "page" : void 0;
1978
+ const t2 = groupLabel[group.key];
1979
+ const t3 = group.tabs[0];
1980
+ let t4;
1981
+ if ($[0] !== t3) {
1982
+ t4 = /* @__PURE__ */ jsxDEV(TabIcon, {
1983
+ tab: t3
1984
+ }, void 0, false);
1985
+ $[0] = t3;
1986
+ $[1] = t4;
1987
+ } else {
1988
+ t4 = $[1];
1989
+ }
1990
+ let t5;
1991
+ if ($[2] !== t1 || $[3] !== t2 || $[4] !== t4) {
1992
+ t5 = /* @__PURE__ */ jsxDEV(PopoverTrigger, {
1993
+ "aria-current": t1,
1994
+ "aria-label": t2,
1995
+ 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",
1996
+ delay: 120,
1997
+ openOnHover: true,
1998
+ children: t4
1999
+ }, void 0, false);
2000
+ $[2] = t1;
2001
+ $[3] = t2;
2002
+ $[4] = t4;
2003
+ $[5] = t5;
2004
+ } else {
2005
+ t5 = $[5];
2006
+ }
2007
+ const t6 = groupLabel[group.key];
2008
+ let t7;
2009
+ if ($[6] !== t6) {
2010
+ t7 = /* @__PURE__ */ jsxDEV("div", {
2011
+ className: "px-2 py-1.5 text-[11px] font-medium tracking-wider text-muted-foreground uppercase",
2012
+ children: t6
2013
+ }, void 0, false);
2014
+ $[6] = t6;
2015
+ $[7] = t7;
2016
+ } else {
2017
+ t7 = $[7];
2018
+ }
2019
+ let t8;
2020
+ if ($[8] !== current || $[9] !== group.tabs || $[10] !== selectTab || $[11] !== tabDescription || $[12] !== tabLabel) {
2021
+ let t92;
2022
+ if ($[14] !== current || $[15] !== selectTab || $[16] !== tabDescription || $[17] !== tabLabel) {
2023
+ t92 = (tab) => /* @__PURE__ */ jsxDEV("button", {
2024
+ "aria-current": current === tab ? "page" : void 0,
2025
+ 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",
2026
+ "data-tab": tab,
2027
+ "data-testid": `dash-tab-${tab}`,
2028
+ onClick: selectTab,
2029
+ title: tabDescription[tab],
2030
+ type: "button",
2031
+ children: [/* @__PURE__ */ jsxDEV(TabIcon, {
2032
+ tab
2033
+ }, void 0, false), /* @__PURE__ */ jsxDEV("span", {
2034
+ children: tabLabel[tab]
2035
+ }, void 0, false)]
2036
+ }, tab, true);
2037
+ $[14] = current;
2038
+ $[15] = selectTab;
2039
+ $[16] = tabDescription;
2040
+ $[17] = tabLabel;
2041
+ $[18] = t92;
2042
+ } else {
2043
+ t92 = $[18];
2044
+ }
2045
+ t8 = group.tabs.map(t92);
2046
+ $[8] = current;
2047
+ $[9] = group.tabs;
2048
+ $[10] = selectTab;
2049
+ $[11] = tabDescription;
2050
+ $[12] = tabLabel;
2051
+ $[13] = t8;
2052
+ } else {
2053
+ t8 = $[13];
2054
+ }
2055
+ let t9;
2056
+ if ($[19] !== t7 || $[20] !== t8) {
2057
+ t9 = /* @__PURE__ */ jsxDEV(PopoverContent, {
2058
+ align: "start",
2059
+ className: "w-56 p-1",
2060
+ side: "right",
2061
+ sideOffset: 8,
2062
+ children: [t7, t8]
2063
+ }, void 0, true);
2064
+ $[19] = t7;
2065
+ $[20] = t8;
2066
+ $[21] = t9;
2067
+ } else {
2068
+ t9 = $[21];
2069
+ }
2070
+ let t10;
2071
+ if ($[22] !== t5 || $[23] !== t9) {
2072
+ t10 = /* @__PURE__ */ jsxDEV(Popover, {
2073
+ children: [t5, t9]
2074
+ }, void 0, true);
2075
+ $[22] = t5;
2076
+ $[23] = t9;
2077
+ $[24] = t10;
2078
+ } else {
2079
+ t10 = $[24];
2080
+ }
2081
+ return t10;
2082
+ };
2083
+ const SidebarFooterProfile = (t0) => {
2084
+ const $ = c(45);
2085
+ const {
2086
+ chrome,
2087
+ collapsed,
2088
+ connected
2089
+ } = t0;
2090
+ const t = useT();
2091
+ if (chrome === null) {
2092
+ let t14;
2093
+ if ($[0] !== t) {
2094
+ t14 = t("Admin");
2095
+ $[0] = t;
2096
+ $[1] = t14;
2097
+ } else {
2098
+ t14 = $[1];
2099
+ }
2100
+ let t22;
2101
+ if ($[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2102
+ t22 = /* @__PURE__ */ jsxDEV("span", {
2103
+ className: "flex size-8 items-center justify-center rounded-full bg-sidebar-accent text-[11px] font-medium",
2104
+ children: "C"
2105
+ }, void 0, false);
2106
+ $[2] = t22;
2107
+ } else {
2108
+ t22 = $[2];
2109
+ }
2110
+ let t32;
2111
+ if ($[3] !== t) {
2112
+ t32 = t("Admin");
2113
+ $[3] = t;
2114
+ $[4] = t32;
2115
+ } else {
2116
+ t32 = $[4];
2117
+ }
2118
+ let t42;
2119
+ if ($[5] !== t32) {
2120
+ t42 = /* @__PURE__ */ jsxDEV("span", {
2121
+ className: "truncate text-[13px] font-medium",
2122
+ children: t32
2123
+ }, void 0, false);
2124
+ $[5] = t32;
2125
+ $[6] = t42;
2126
+ } else {
2127
+ t42 = $[6];
2128
+ }
2129
+ let t52;
2130
+ if ($[7] !== t) {
2131
+ t52 = t("Studio");
2132
+ $[7] = t;
2133
+ $[8] = t52;
2134
+ } else {
2135
+ t52 = $[8];
2136
+ }
2137
+ let t62;
2138
+ if ($[9] !== t52) {
2139
+ t62 = /* @__PURE__ */ jsxDEV("span", {
2140
+ className: "truncate text-[11px] text-muted-foreground",
2141
+ children: t52
2142
+ }, void 0, false);
2143
+ $[9] = t52;
2144
+ $[10] = t62;
2145
+ } else {
2146
+ t62 = $[10];
2147
+ }
2148
+ let t72;
2149
+ if ($[11] !== t42 || $[12] !== t62) {
2150
+ t72 = /* @__PURE__ */ jsxDEV("span", {
2151
+ className: "grid flex-1 text-start leading-tight",
2152
+ children: [t42, t62]
2153
+ }, void 0, true);
2154
+ $[11] = t42;
2155
+ $[12] = t62;
2156
+ $[13] = t72;
2157
+ } else {
2158
+ t72 = $[13];
2159
+ }
2160
+ let t82;
2161
+ if ($[14] !== t14 || $[15] !== t72) {
2162
+ t82 = /* @__PURE__ */ jsxDEV(SidebarMenuButton, {
2163
+ className: "data-active:bg-transparent",
2164
+ size: "lg",
2165
+ tooltip: t14,
2166
+ children: [t22, t72]
2167
+ }, void 0, true);
2168
+ $[14] = t14;
2169
+ $[15] = t72;
2170
+ $[16] = t82;
2171
+ } else {
2172
+ t82 = $[16];
2173
+ }
2174
+ return t82;
2175
+ }
2176
+ const t1 = collapsed ? "mx-auto size-8 justify-center" : "w-full p-2";
2177
+ let t2;
2178
+ if ($[17] !== t1) {
2179
+ 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);
2180
+ $[17] = t1;
2181
+ $[18] = t2;
2182
+ } else {
2183
+ t2 = $[18];
2184
+ }
2185
+ let t3;
2186
+ if ($[19] !== connected || $[20] !== t) {
2187
+ t3 = connected ? t("Connected") : t("Not connected");
2188
+ $[19] = connected;
2189
+ $[20] = t;
2190
+ $[21] = t3;
2191
+ } else {
2192
+ t3 = $[21];
2193
+ }
2194
+ const t4 = connected ? "bg-success" : "bg-muted-foreground/50";
2195
+ let t5;
2196
+ if ($[22] !== t4) {
2197
+ t5 = cn("absolute -end-0.5 -bottom-0.5 size-2.5 rounded-full border-2 border-sidebar", t4);
2198
+ $[22] = t4;
2199
+ $[23] = t5;
2200
+ } else {
2201
+ t5 = $[23];
2202
+ }
2203
+ let t6;
2204
+ if ($[24] !== t5) {
2205
+ t6 = /* @__PURE__ */ jsxDEV("span", {
2206
+ className: "relative flex size-8 shrink-0 items-center justify-center rounded-full bg-sidebar-accent text-[11px] font-medium",
2207
+ children: ["C", /* @__PURE__ */ jsxDEV("span", {
2208
+ "aria-hidden": "true",
2209
+ className: t5
2210
+ }, void 0, false)]
2211
+ }, void 0, true);
2212
+ $[24] = t5;
2213
+ $[25] = t6;
2214
+ } else {
2215
+ t6 = $[25];
2216
+ }
2217
+ let t7;
2218
+ if ($[26] !== collapsed || $[27] !== connected || $[28] !== t) {
2219
+ t7 = !collapsed && /* @__PURE__ */ jsxDEV(Fragment, {
2220
+ children: [/* @__PURE__ */ jsxDEV("span", {
2221
+ className: "grid flex-1 text-start leading-tight",
2222
+ children: [/* @__PURE__ */ jsxDEV("span", {
2223
+ className: "truncate text-[13px] font-medium",
2224
+ children: t("Admin")
2225
+ }, void 0, false), /* @__PURE__ */ jsxDEV("span", {
2226
+ className: "truncate text-[11px] text-muted-foreground",
2227
+ children: connected ? t("Connected") : t("Not connected")
2228
+ }, void 0, false)]
2229
+ }, void 0, true), /* @__PURE__ */ jsxDEV("svg", {
2230
+ "aria-hidden": "true",
2231
+ className: "size-4 text-muted-foreground",
2232
+ fill: "none",
2233
+ stroke: "currentColor",
2234
+ strokeWidth: 1.7,
2235
+ viewBox: "0 0 24 24",
2236
+ children: /* @__PURE__ */ jsxDEV("path", {
2237
+ d: "m8 9 4-4 4 4M8 15l4 4 4-4",
2238
+ strokeLinecap: "round",
2239
+ strokeLinejoin: "round"
2240
+ }, void 0, false)
2241
+ }, void 0, false)]
2242
+ }, void 0, true);
2243
+ $[26] = collapsed;
2244
+ $[27] = connected;
2245
+ $[28] = t;
2246
+ $[29] = t7;
2247
+ } else {
2248
+ t7 = $[29];
2249
+ }
2250
+ let t8;
2251
+ if ($[30] !== t2 || $[31] !== t3 || $[32] !== t6 || $[33] !== t7) {
2252
+ t8 = /* @__PURE__ */ jsxDEV(PopoverTrigger, {
2253
+ className: t2,
2254
+ "data-testid": "dash-app-connect",
2255
+ title: t3,
2256
+ children: [t6, t7]
2257
+ }, void 0, true);
2258
+ $[30] = t2;
2259
+ $[31] = t3;
2260
+ $[32] = t6;
2261
+ $[33] = t7;
2262
+ $[34] = t8;
2263
+ } else {
2264
+ t8 = $[34];
2265
+ }
2266
+ const t9 = collapsed ? "end" : "start";
2267
+ const t10 = collapsed ? "right" : "top";
2268
+ let t11;
2269
+ if ($[35] !== chrome || $[36] !== connected) {
2270
+ t11 = /* @__PURE__ */ jsxDEV(ConnectPopoverContent, {
2271
+ chrome,
2272
+ connected
2273
+ }, void 0, false);
2274
+ $[35] = chrome;
2275
+ $[36] = connected;
2276
+ $[37] = t11;
2277
+ } else {
2278
+ t11 = $[37];
2279
+ }
2280
+ let t12;
2281
+ if ($[38] !== t10 || $[39] !== t11 || $[40] !== t9) {
2282
+ t12 = /* @__PURE__ */ jsxDEV(PopoverContent, {
2283
+ align: t9,
2284
+ keepMounted: true,
2285
+ side: t10,
2286
+ children: t11
2287
+ }, void 0, false);
2288
+ $[38] = t10;
2289
+ $[39] = t11;
2290
+ $[40] = t9;
2291
+ $[41] = t12;
2292
+ } else {
2293
+ t12 = $[41];
2294
+ }
2295
+ let t13;
2296
+ if ($[42] !== t12 || $[43] !== t8) {
2297
+ t13 = /* @__PURE__ */ jsxDEV(Popover, {
2298
+ children: [t8, t12]
2299
+ }, void 0, true);
2300
+ $[42] = t12;
2301
+ $[43] = t8;
2302
+ $[44] = t13;
2303
+ } else {
2304
+ t13 = $[44];
2305
+ }
2306
+ return t13;
2307
+ };
2308
+ const StudioSidebar = (t0) => {
2309
+ const $ = c(28);
2310
+ const {
2311
+ chrome,
2312
+ connected,
2313
+ current,
2314
+ groupLabel,
2315
+ groups,
2316
+ selectTab,
2317
+ tabDescription,
2318
+ tabLabel
2319
+ } = t0;
2320
+ const t = useT();
2321
+ const {
2322
+ state
2323
+ } = useSidebar();
2324
+ const collapsed = state === "collapsed";
2325
+ const t1 = collapsed && "justify-center px-0";
2326
+ let t2;
2327
+ if ($[0] !== t1) {
2328
+ t2 = cn("flex items-center gap-2.5 px-1.5 py-1", t1);
2329
+ $[0] = t1;
2330
+ $[1] = t2;
2331
+ } else {
2332
+ t2 = $[1];
2333
+ }
2334
+ let t3;
2335
+ if ($[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2336
+ t3 = /* @__PURE__ */ jsxDEV(BrandMark, {
2337
+ className: "size-9 shrink-0 text-foreground"
2338
+ }, void 0, false);
2339
+ $[2] = t3;
2340
+ } else {
2341
+ t3 = $[2];
2342
+ }
2343
+ let t4;
2344
+ if ($[3] !== collapsed || $[4] !== connected || $[5] !== t) {
2345
+ t4 = !collapsed && /* @__PURE__ */ jsxDEV(Fragment, {
2346
+ children: [/* @__PURE__ */ jsxDEV("span", {
2347
+ className: "grid flex-1 leading-tight",
2348
+ children: [/* @__PURE__ */ jsxDEV("span", {
2349
+ className: "truncate text-sm font-semibold text-foreground",
2350
+ children: "lunora"
2351
+ }, void 0, false), /* @__PURE__ */ jsxDEV("span", {
2352
+ className: "truncate text-[11px] text-muted-foreground",
2353
+ children: t("Studio")
2354
+ }, void 0, false)]
2355
+ }, void 0, true), /* @__PURE__ */ jsxDEV(Badge, {
2356
+ className: "px-1.5 text-[10px] tracking-wider uppercase",
2357
+ variant: "secondary",
2358
+ children: connected ? t("Live") : t("Local")
2359
+ }, void 0, false)]
2360
+ }, void 0, true);
2361
+ $[3] = collapsed;
2362
+ $[4] = connected;
2363
+ $[5] = t;
2364
+ $[6] = t4;
2365
+ } else {
2366
+ t4 = $[6];
2367
+ }
2368
+ let t5;
2369
+ if ($[7] !== t2 || $[8] !== t4) {
2370
+ t5 = /* @__PURE__ */ jsxDEV(SidebarHeader, {
2371
+ children: /* @__PURE__ */ jsxDEV("div", {
2372
+ className: t2,
2373
+ children: [t3, t4]
2374
+ }, void 0, true)
2375
+ }, void 0, false);
2376
+ $[7] = t2;
2377
+ $[8] = t4;
2378
+ $[9] = t5;
2379
+ } else {
2380
+ t5 = $[9];
2381
+ }
2382
+ let t6;
2383
+ if ($[10] !== collapsed || $[11] !== current || $[12] !== groupLabel || $[13] !== groups || $[14] !== selectTab || $[15] !== tabDescription || $[16] !== tabLabel) {
2384
+ t6 = collapsed ? groups.map((group) => /* @__PURE__ */ jsxDEV(CollapsedGroupNav, {
2385
+ current,
2386
+ group,
2387
+ groupLabel,
2388
+ selectTab,
2389
+ tabDescription,
2390
+ tabLabel
2391
+ }, group.key, false)) : groups.map((group_0) => /* @__PURE__ */ jsxDEV(SidebarGroup, {
2392
+ children: [/* @__PURE__ */ jsxDEV(SidebarGroupLabel, {
2393
+ className: "text-[11px] font-medium tracking-wider uppercase",
2394
+ children: groupLabel[group_0.key]
2395
+ }, void 0, false), /* @__PURE__ */ jsxDEV(SidebarGroupContent, {
2396
+ children: /* @__PURE__ */ jsxDEV(SidebarMenu, {
2397
+ children: group_0.tabs.map((tab) => /* @__PURE__ */ jsxDEV(SidebarMenuItem, {
2398
+ children: /* @__PURE__ */ jsxDEV(SidebarMenuButton, {
2399
+ className: "data-active:text-foreground dark:data-active:text-royal-amethyst data-active:shadow-[inset_2px_0_0_0_var(--royal-amethyst)]",
2400
+ "data-tab": tab,
2401
+ "data-testid": `dash-tab-${tab}`,
2402
+ isActive: current === tab,
2403
+ onClick: selectTab,
2404
+ title: tabDescription[tab],
2405
+ tooltip: tabDescription[tab],
2406
+ children: [/* @__PURE__ */ jsxDEV(TabIcon, {
2407
+ tab
2408
+ }, void 0, false), /* @__PURE__ */ jsxDEV("span", {
2409
+ children: tabLabel[tab]
2410
+ }, void 0, false)]
2411
+ }, void 0, true)
2412
+ }, tab, false))
2413
+ }, void 0, false)
2414
+ }, void 0, false)]
2415
+ }, group_0.key, true));
2416
+ $[10] = collapsed;
2417
+ $[11] = current;
2418
+ $[12] = groupLabel;
2419
+ $[13] = groups;
2420
+ $[14] = selectTab;
2421
+ $[15] = tabDescription;
2422
+ $[16] = tabLabel;
2423
+ $[17] = t6;
2424
+ } else {
2425
+ t6 = $[17];
2426
+ }
2427
+ let t7;
2428
+ if ($[18] !== t6) {
2429
+ t7 = /* @__PURE__ */ jsxDEV(SidebarContent, {
2430
+ children: t6
2431
+ }, void 0, false);
2432
+ $[18] = t6;
2433
+ $[19] = t7;
2434
+ } else {
2435
+ t7 = $[19];
2436
+ }
2437
+ let t8;
2438
+ if ($[20] !== chrome || $[21] !== collapsed || $[22] !== connected) {
2439
+ t8 = /* @__PURE__ */ jsxDEV(SidebarFooter, {
2440
+ children: /* @__PURE__ */ jsxDEV(SidebarMenu, {
2441
+ children: /* @__PURE__ */ jsxDEV(SidebarMenuItem, {
2442
+ children: /* @__PURE__ */ jsxDEV(SidebarFooterProfile, {
2443
+ chrome,
2444
+ collapsed,
2445
+ connected
2446
+ }, void 0, false)
2447
+ }, void 0, false)
2448
+ }, void 0, false)
2449
+ }, void 0, false);
2450
+ $[20] = chrome;
2451
+ $[21] = collapsed;
2452
+ $[22] = connected;
2453
+ $[23] = t8;
2454
+ } else {
2455
+ t8 = $[23];
2456
+ }
2457
+ let t9;
2458
+ if ($[24] !== t5 || $[25] !== t7 || $[26] !== t8) {
2459
+ t9 = /* @__PURE__ */ jsxDEV(Sidebar, {
2460
+ collapsible: "icon",
2461
+ variant: "inset",
2462
+ children: [t5, t7, t8]
2463
+ }, void 0, true);
2464
+ $[24] = t5;
2465
+ $[25] = t7;
2466
+ $[26] = t8;
2467
+ $[27] = t9;
2468
+ } else {
2469
+ t9 = $[27];
2470
+ }
2471
+ return t9;
2472
+ };
2473
+ const RoutePending = () => {
2474
+ const $ = c(1);
2475
+ let t0;
2476
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2477
+ t0 = /* @__PURE__ */ jsxDEV("div", {
2478
+ className: "flex flex-col gap-4",
2479
+ "data-testid": "dash-pending",
2480
+ children: [/* @__PURE__ */ jsxDEV("div", {
2481
+ className: "flex items-center gap-2",
2482
+ children: [/* @__PURE__ */ jsxDEV(Skeleton, {
2483
+ className: "h-8 w-40"
2484
+ }, void 0, false), /* @__PURE__ */ jsxDEV(Skeleton, {
2485
+ className: "h-8 w-24"
2486
+ }, void 0, false)]
2487
+ }, void 0, true), /* @__PURE__ */ jsxDEV(Skeleton, {
2488
+ className: "h-72 w-full"
2489
+ }, void 0, false)]
2490
+ }, void 0, true);
2491
+ $[0] = t0;
2492
+ } else {
2493
+ t0 = $[0];
2494
+ }
2495
+ return t0;
2496
+ };
2497
+ const StudioLayout = () => {
2498
+ const $ = c(306);
2499
+ const t = useT();
2500
+ const navigate = useNavigate();
2501
+ let t0;
2502
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2503
+ t0 = {
2504
+ select: _temp
2505
+ };
2506
+ $[0] = t0;
2507
+ } else {
2508
+ t0 = $[0];
2509
+ }
2510
+ const pathname = useRouterState(t0);
2511
+ let current;
2512
+ let t1;
2513
+ if ($[1] !== pathname) {
2514
+ current = tabFromPathname(pathname);
2515
+ t1 = FULL_HEIGHT_TABS.has(current);
2516
+ $[1] = pathname;
2517
+ $[2] = current;
2518
+ $[3] = t1;
2519
+ } else {
2520
+ current = $[2];
2521
+ t1 = $[3];
2522
+ }
2523
+ const fullHeight = t1;
2524
+ const features = useStudioFeatures();
2525
+ let t2;
2526
+ if ($[4] !== features) {
2527
+ t2 = (group) => ({
2528
+ ...group,
2529
+ tabs: group.tabs.filter((tab) => isTabVisible(tab, features))
2530
+ });
2531
+ $[4] = features;
2532
+ $[5] = t2;
2533
+ } else {
2534
+ t2 = $[5];
2535
+ }
2536
+ const visibleGroups = NAV_GROUPS.map(t2).filter(_temp2);
2537
+ let t3;
2538
+ let t4;
2539
+ if ($[6] !== current || $[7] !== features || $[8] !== navigate) {
2540
+ t3 = () => {
2541
+ if (!isTabVisible(current, features)) {
2542
+ fireAndForget(navigate({
2543
+ replace: true,
2544
+ to: "/home"
2545
+ }));
2546
+ }
2547
+ };
2548
+ t4 = [current, features, navigate];
2549
+ $[6] = current;
2550
+ $[7] = features;
2551
+ $[8] = navigate;
2552
+ $[9] = t3;
2553
+ $[10] = t4;
2554
+ } else {
2555
+ t3 = $[9];
2556
+ t4 = $[10];
2557
+ }
2558
+ useEffect(t3, t4);
2559
+ let t5;
2560
+ if ($[11] !== t) {
2561
+ t5 = t("Agents");
2562
+ $[11] = t;
2563
+ $[12] = t5;
2564
+ } else {
2565
+ t5 = $[12];
2566
+ }
2567
+ let t6;
2568
+ if ($[13] !== t) {
2569
+ t6 = t("Analytics");
2570
+ $[13] = t;
2571
+ $[14] = t6;
2572
+ } else {
2573
+ t6 = $[14];
2574
+ }
2575
+ let t7;
2576
+ if ($[15] !== t) {
2577
+ t7 = t("API");
2578
+ $[15] = t;
2579
+ $[16] = t7;
2580
+ } else {
2581
+ t7 = $[16];
2582
+ }
2583
+ let t8;
2584
+ if ($[17] !== t) {
2585
+ t8 = t("Audit");
2586
+ $[17] = t;
2587
+ $[18] = t8;
2588
+ } else {
2589
+ t8 = $[18];
2590
+ }
2591
+ let t9;
2592
+ if ($[19] !== t) {
2593
+ t9 = t("Configuration");
2594
+ $[19] = t;
2595
+ $[20] = t9;
2596
+ } else {
2597
+ t9 = $[20];
2598
+ }
2599
+ let t10;
2600
+ if ($[21] !== t) {
2601
+ t10 = t("Sessions");
2602
+ $[21] = t;
2603
+ $[22] = t10;
2604
+ } else {
2605
+ t10 = $[22];
2606
+ }
2607
+ let t11;
2608
+ if ($[23] !== t) {
2609
+ t11 = t("Containers");
2610
+ $[23] = t;
2611
+ $[24] = t11;
2612
+ } else {
2613
+ t11 = $[24];
2614
+ }
2615
+ let t12;
2616
+ if ($[25] !== t) {
2617
+ t12 = t("Dashboards");
2618
+ $[25] = t;
2619
+ $[26] = t12;
2620
+ } else {
2621
+ t12 = $[26];
2622
+ }
2623
+ let t13;
2624
+ if ($[27] !== t) {
2625
+ t13 = t("Data");
2626
+ $[27] = t;
2627
+ $[28] = t13;
2628
+ } else {
2629
+ t13 = $[28];
2630
+ }
2631
+ let t14;
2632
+ if ($[29] !== t) {
2633
+ t14 = t("Log drains");
2634
+ $[29] = t;
2635
+ $[30] = t14;
2636
+ } else {
2637
+ t14 = $[30];
2638
+ }
2639
+ let t15;
2640
+ if ($[31] !== t) {
2641
+ t15 = t("Export / Import");
2642
+ $[31] = t;
2643
+ $[32] = t15;
2644
+ } else {
2645
+ t15 = $[32];
2646
+ }
2647
+ let t16;
2648
+ if ($[33] !== t) {
2649
+ t16 = t("Fan-out");
2650
+ $[33] = t;
2651
+ $[34] = t16;
2652
+ } else {
2653
+ t16 = $[34];
2654
+ }
2655
+ let t17;
2656
+ if ($[35] !== t) {
2657
+ t17 = t("Files");
2658
+ $[35] = t;
2659
+ $[36] = t17;
2660
+ } else {
2661
+ t17 = $[36];
2662
+ }
2663
+ let t18;
2664
+ if ($[37] !== t) {
2665
+ t18 = t("Flags");
2666
+ $[37] = t;
2667
+ $[38] = t18;
2668
+ } else {
2669
+ t18 = $[38];
2670
+ }
2671
+ let t19;
2672
+ if ($[39] !== t) {
2673
+ t19 = t("Functions");
2674
+ $[39] = t;
2675
+ $[40] = t19;
2676
+ } else {
2677
+ t19 = $[40];
2678
+ }
2679
+ let t20;
2680
+ if ($[41] !== t) {
2681
+ t20 = t("Health");
2682
+ $[41] = t;
2683
+ $[42] = t20;
2684
+ } else {
2685
+ t20 = $[42];
2686
+ }
2687
+ let t21;
2688
+ if ($[43] !== t) {
2689
+ t21 = t("Home");
2690
+ $[43] = t;
2691
+ $[44] = t21;
2692
+ } else {
2693
+ t21 = $[44];
2694
+ }
2695
+ let t22;
2696
+ if ($[45] !== t) {
2697
+ t22 = t("Performance");
2698
+ $[45] = t;
2699
+ $[46] = t22;
2700
+ } else {
2701
+ t22 = $[46];
2702
+ }
2703
+ let t23;
2704
+ if ($[47] !== t) {
2705
+ t23 = t("Issues");
2706
+ $[47] = t;
2707
+ $[48] = t23;
2708
+ } else {
2709
+ t23 = $[48];
2710
+ }
2711
+ let t24;
2712
+ if ($[49] !== t) {
2713
+ t24 = t("KV");
2714
+ $[49] = t;
2715
+ $[50] = t24;
2716
+ } else {
2717
+ t24 = $[50];
2718
+ }
2719
+ let t25;
2720
+ if ($[51] !== t) {
2721
+ t25 = t("Logs");
2722
+ $[51] = t;
2723
+ $[52] = t25;
2724
+ } else {
2725
+ t25 = $[52];
2726
+ }
2727
+ let t26;
2728
+ if ($[53] !== t) {
2729
+ t26 = t("Metrics");
2730
+ $[53] = t;
2731
+ $[54] = t26;
2732
+ } else {
2733
+ t26 = $[54];
2734
+ }
2735
+ let t27;
2736
+ if ($[55] !== t) {
2737
+ t27 = t("Migrations");
2738
+ $[55] = t;
2739
+ $[56] = t27;
2740
+ } else {
2741
+ t27 = $[56];
2742
+ }
2743
+ let t28;
2744
+ if ($[57] !== t) {
2745
+ t28 = t("Organizations");
2746
+ $[57] = t;
2747
+ $[58] = t28;
2748
+ } else {
2749
+ t28 = $[58];
2750
+ }
2751
+ let t29;
2752
+ if ($[59] !== t) {
2753
+ t29 = t("Time Travel");
2754
+ $[59] = t;
2755
+ $[60] = t29;
2756
+ } else {
2757
+ t29 = $[60];
2758
+ }
2759
+ let t30;
2760
+ if ($[61] !== t) {
2761
+ t30 = t("Mail");
2762
+ $[61] = t;
2763
+ $[62] = t30;
2764
+ } else {
2765
+ t30 = $[62];
2766
+ }
2767
+ let t31;
2768
+ if ($[63] !== t) {
2769
+ t31 = t("Payments");
2770
+ $[63] = t;
2771
+ $[64] = t31;
2772
+ } else {
2773
+ t31 = $[64];
2774
+ }
2775
+ let t32;
2776
+ if ($[65] !== t) {
2777
+ t32 = t("Permissions");
2778
+ $[65] = t;
2779
+ $[66] = t32;
2780
+ } else {
2781
+ t32 = $[66];
2782
+ }
2783
+ let t33;
2784
+ if ($[67] !== t) {
2785
+ t33 = t("Queues");
2786
+ $[67] = t;
2787
+ $[68] = t33;
2788
+ } else {
2789
+ t33 = $[68];
2790
+ }
2791
+ let t34;
2792
+ if ($[69] !== t) {
2793
+ t34 = t("Realtime");
2794
+ $[69] = t;
2795
+ $[70] = t34;
2796
+ } else {
2797
+ t34 = $[70];
2798
+ }
2799
+ let t35;
2800
+ if ($[71] !== t) {
2801
+ t35 = t("RLS Policies");
2802
+ $[71] = t;
2803
+ $[72] = t35;
2804
+ } else {
2805
+ t35 = $[72];
2806
+ }
2807
+ let t36;
2808
+ if ($[73] !== t) {
2809
+ t36 = t("Scheduled");
2810
+ $[73] = t;
2811
+ $[74] = t36;
2812
+ } else {
2813
+ t36 = $[74];
2814
+ }
2815
+ let t37;
2816
+ if ($[75] !== t) {
2817
+ t37 = t("Schema");
2818
+ $[75] = t;
2819
+ $[76] = t37;
2820
+ } else {
2821
+ t37 = $[76];
2822
+ }
2823
+ let t38;
2824
+ if ($[77] !== t) {
2825
+ t38 = t("Security");
2826
+ $[77] = t;
2827
+ $[78] = t38;
2828
+ } else {
2829
+ t38 = $[78];
2830
+ }
2831
+ let t39;
2832
+ if ($[79] !== t) {
2833
+ t39 = t("Settings");
2834
+ $[79] = t;
2835
+ $[80] = t39;
2836
+ } else {
2837
+ t39 = $[80];
2838
+ }
2839
+ let t40;
2840
+ if ($[81] !== t) {
2841
+ t40 = t("SQL editor");
2842
+ $[81] = t;
2843
+ $[82] = t40;
2844
+ } else {
2845
+ t40 = $[82];
2846
+ }
2847
+ let t41;
2848
+ if ($[83] !== t) {
2849
+ t41 = t("Access Rules");
2850
+ $[83] = t;
2851
+ $[84] = t41;
2852
+ } else {
2853
+ t41 = $[84];
2854
+ }
2855
+ let t42;
2856
+ if ($[85] !== t) {
2857
+ t42 = t("Users");
2858
+ $[85] = t;
2859
+ $[86] = t42;
2860
+ } else {
2861
+ t42 = $[86];
2862
+ }
2863
+ let t43;
2864
+ if ($[87] !== t) {
2865
+ t43 = t("Vectors");
2866
+ $[87] = t;
2867
+ $[88] = t43;
2868
+ } else {
2869
+ t43 = $[88];
2870
+ }
2871
+ let t44;
2872
+ if ($[89] !== t) {
2873
+ t44 = t("Workflows");
2874
+ $[89] = t;
2875
+ $[90] = t44;
2876
+ } else {
2877
+ t44 = $[90];
2878
+ }
2879
+ let t45;
2880
+ if ($[91] !== t10 || $[92] !== t11 || $[93] !== t12 || $[94] !== t13 || $[95] !== t14 || $[96] !== t15 || $[97] !== t16 || $[98] !== t17 || $[99] !== t18 || $[100] !== t19 || $[101] !== t20 || $[102] !== t21 || $[103] !== t22 || $[104] !== t23 || $[105] !== t24 || $[106] !== t25 || $[107] !== t26 || $[108] !== t27 || $[109] !== t28 || $[110] !== t29 || $[111] !== t30 || $[112] !== t31 || $[113] !== t32 || $[114] !== t33 || $[115] !== t34 || $[116] !== t35 || $[117] !== t36 || $[118] !== t37 || $[119] !== t38 || $[120] !== t39 || $[121] !== t40 || $[122] !== t41 || $[123] !== t42 || $[124] !== t43 || $[125] !== t44 || $[126] !== t5 || $[127] !== t6 || $[128] !== t7 || $[129] !== t8 || $[130] !== t9) {
2881
+ t45 = {
2882
+ agents: t5,
2883
+ analytics: t6,
2884
+ api: t7,
2885
+ audit: t8,
2886
+ authConfig: t9,
2887
+ authSessions: t10,
2888
+ containers: t11,
2889
+ dashboards: t12,
2890
+ data: t13,
2891
+ drains: t14,
2892
+ export: t15,
2893
+ fanout: t16,
2894
+ files: t17,
2895
+ flags: t18,
2896
+ functions: t19,
2897
+ health: t20,
2898
+ home: t21,
2899
+ insights: t22,
2900
+ issues: t23,
2901
+ kv: t24,
2902
+ logs: t25,
2903
+ metrics: t26,
2904
+ migrations: t27,
2905
+ organizations: t28,
2906
+ pitr: t29,
2907
+ mail: t30,
2908
+ payments: t31,
2909
+ permissions: t32,
2910
+ queues: t33,
2911
+ realtime: t34,
2912
+ rls: t35,
2913
+ schedule: t36,
2914
+ schema: t37,
2915
+ security: t38,
2916
+ settings: t39,
2917
+ sql: t40,
2918
+ storageRules: t41,
2919
+ users: t42,
2920
+ vectors: t43,
2921
+ workflows: t44
2922
+ };
2923
+ $[91] = t10;
2924
+ $[92] = t11;
2925
+ $[93] = t12;
2926
+ $[94] = t13;
2927
+ $[95] = t14;
2928
+ $[96] = t15;
2929
+ $[97] = t16;
2930
+ $[98] = t17;
2931
+ $[99] = t18;
2932
+ $[100] = t19;
2933
+ $[101] = t20;
2934
+ $[102] = t21;
2935
+ $[103] = t22;
2936
+ $[104] = t23;
2937
+ $[105] = t24;
2938
+ $[106] = t25;
2939
+ $[107] = t26;
2940
+ $[108] = t27;
2941
+ $[109] = t28;
2942
+ $[110] = t29;
2943
+ $[111] = t30;
2944
+ $[112] = t31;
2945
+ $[113] = t32;
2946
+ $[114] = t33;
2947
+ $[115] = t34;
2948
+ $[116] = t35;
2949
+ $[117] = t36;
2950
+ $[118] = t37;
2951
+ $[119] = t38;
2952
+ $[120] = t39;
2953
+ $[121] = t40;
2954
+ $[122] = t41;
2955
+ $[123] = t42;
2956
+ $[124] = t43;
2957
+ $[125] = t44;
2958
+ $[126] = t5;
2959
+ $[127] = t6;
2960
+ $[128] = t7;
2961
+ $[129] = t8;
2962
+ $[130] = t9;
2963
+ $[131] = t45;
2964
+ } else {
2965
+ t45 = $[131];
2966
+ }
2967
+ const tabLabel = t45;
2968
+ const groupLabel = {
2969
+ advisors: t("Advisors"),
2970
+ auth: t("Auth"),
2971
+ database: t("Database"),
2972
+ functions: t("Functions"),
2973
+ observability: t("Observability"),
2974
+ operations: t("Operations"),
2975
+ overview: t("Overview"),
2976
+ settings: t("Settings"),
2977
+ storage: t("Storage")
2978
+ };
2979
+ let t46;
2980
+ if ($[132] !== t) {
2981
+ t46 = t("Inspect agent threads, message timelines, tool calls, and token usage.");
2982
+ $[132] = t;
2983
+ $[133] = t46;
2984
+ } else {
2985
+ t46 = $[133];
2986
+ }
2987
+ let t47;
2988
+ if ($[134] !== t) {
2989
+ t47 = t("Usage and latency from Analytics Engine — request volume, p50/p95, and hot shards.");
2990
+ $[134] = t;
2991
+ $[135] = t47;
2992
+ } else {
2993
+ t47 = $[135];
2994
+ }
2995
+ let t48;
2996
+ if ($[136] !== t) {
2997
+ t48 = t("Interactive OpenAPI reference and copy-paste snippets for your functions.");
2998
+ $[136] = t;
2999
+ $[137] = t48;
3000
+ } else {
3001
+ t48 = $[137];
3002
+ }
3003
+ let t49;
3004
+ if ($[138] !== t) {
3005
+ t49 = t("A durable log of admin state-changing operations.");
3006
+ $[138] = t;
3007
+ $[139] = t49;
3008
+ } else {
3009
+ t49 = $[139];
3010
+ }
3011
+ let t50;
3012
+ if ($[140] !== t) {
3013
+ t50 = t("Enabled plugins and session config (read-only).");
3014
+ $[140] = t;
3015
+ $[141] = t50;
3016
+ } else {
3017
+ t50 = $[141];
3018
+ }
3019
+ let t51;
3020
+ if ($[142] !== t) {
3021
+ t51 = t("Browse and revoke active sessions across all users.");
3022
+ $[142] = t;
3023
+ $[143] = t51;
3024
+ } else {
3025
+ t51 = $[143];
3026
+ }
3027
+ let t52;
3028
+ if ($[144] !== t) {
3029
+ t52 = t("Live Cloudflare Containers — current lifecycle state per instance from the log stream.");
3030
+ $[144] = t;
3031
+ $[145] = t52;
3032
+ } else {
3033
+ t52 = $[145];
3034
+ }
3035
+ let t53;
3036
+ if ($[146] !== t) {
3037
+ t53 = t("Chart widgets backed by saved read-only SQL queries.");
3038
+ $[146] = t;
3039
+ $[147] = t53;
3040
+ } else {
3041
+ t53 = $[147];
3042
+ }
3043
+ let t54;
3044
+ if ($[148] !== t) {
3045
+ t54 = t("Browse and edit rows across your shard and global tables.");
3046
+ $[148] = t;
3047
+ $[149] = t54;
3048
+ } else {
3049
+ t54 = $[149];
3050
+ }
3051
+ let t55;
3052
+ if ($[150] !== t) {
3053
+ t55 = t("Forward logs to Logpush, Tail Workers, or a webhook collector.");
3054
+ $[150] = t;
3055
+ $[151] = t55;
3056
+ } else {
3057
+ t55 = $[151];
3058
+ }
3059
+ let t56;
3060
+ if ($[152] !== t) {
3061
+ t56 = t("Export a shard to NDJSON, or import rows from it.");
3062
+ $[152] = t;
3063
+ $[153] = t56;
3064
+ } else {
3065
+ t56 = $[153];
3066
+ }
3067
+ let t57;
3068
+ if ($[154] !== t) {
3069
+ t57 = t("Realtime fan-out cost and per-topic subscriber counts for this shard.");
3070
+ $[154] = t;
3071
+ $[155] = t57;
3072
+ } else {
3073
+ t57 = $[155];
3074
+ }
3075
+ let t58;
3076
+ if ($[156] !== t) {
3077
+ t58 = t("Browse objects in your R2 storage buckets.");
3078
+ $[156] = t;
3079
+ $[157] = t58;
3080
+ } else {
3081
+ t58 = $[157];
3082
+ }
3083
+ let t59;
3084
+ if ($[158] !== t) {
3085
+ t59 = t("Inspect feature flags and their live evaluation under a targeting context.");
3086
+ $[158] = t;
3087
+ $[159] = t59;
3088
+ } else {
3089
+ t59 = $[159];
3090
+ }
3091
+ let t60;
3092
+ if ($[160] !== t) {
3093
+ t60 = t("Run registered queries, mutations, and actions.");
3094
+ $[160] = t;
3095
+ $[161] = t60;
3096
+ } else {
3097
+ t60 = $[161];
3098
+ }
3099
+ let t61;
3100
+ if ($[162] !== t) {
3101
+ t61 = t("At-a-glance connection, error, and shard signals.");
3102
+ $[162] = t;
3103
+ $[163] = t61;
3104
+ } else {
3105
+ t61 = $[163];
3106
+ }
3107
+ let t62;
3108
+ if ($[164] !== t) {
3109
+ t62 = t("Connection, health, and advisor summary for your deployment.");
3110
+ $[164] = t;
3111
+ $[165] = t62;
3112
+ } else {
3113
+ t62 = $[165];
3114
+ }
3115
+ let t63;
3116
+ if ($[166] !== t) {
3117
+ t63 = t("Surface slow functions, error spikes, and cache problems.");
3118
+ $[166] = t;
3119
+ $[167] = t63;
3120
+ } else {
3121
+ t63 = $[167];
3122
+ }
3123
+ let t64;
3124
+ if ($[168] !== t) {
3125
+ t64 = t("Grouped error triage — Worker throws and container crashes folded by fingerprint.");
3126
+ $[168] = t;
3127
+ $[169] = t64;
3128
+ } else {
3129
+ t64 = $[169];
3130
+ }
3131
+ let t65;
3132
+ if ($[170] !== t) {
3133
+ t65 = t("A live stream of recent function logs.");
3134
+ $[170] = t;
3135
+ $[171] = t65;
3136
+ } else {
3137
+ t65 = $[171];
3138
+ }
3139
+ let t66;
3140
+ if ($[172] !== t) {
3141
+ t66 = t("Per-shard health and aggregate metrics.");
3142
+ $[172] = t;
3143
+ $[173] = t66;
3144
+ } else {
3145
+ t66 = $[173];
3146
+ }
3147
+ let t67;
3148
+ if ($[174] !== t) {
3149
+ t67 = t("Review migration status and run them.");
3150
+ $[174] = t;
3151
+ $[175] = t67;
3152
+ } else {
3153
+ t67 = $[175];
3154
+ }
3155
+ let t68;
3156
+ if ($[176] !== t) {
3157
+ t68 = t("Browse and manage organizations, members, and invitations.");
3158
+ $[176] = t;
3159
+ $[177] = t68;
3160
+ } else {
3161
+ t68 = $[177];
3162
+ }
3163
+ let t69;
3164
+ if ($[178] !== t) {
3165
+ t69 = t("Restore a shard to a point in the last 30 days.");
3166
+ $[178] = t;
3167
+ $[179] = t69;
3168
+ } else {
3169
+ t69 = $[179];
3170
+ }
3171
+ let t70;
3172
+ if ($[180] !== t) {
3173
+ t70 = t("Email your app sent, captured in dev.");
3174
+ $[180] = t;
3175
+ $[181] = t70;
3176
+ } else {
3177
+ t70 = $[181];
3178
+ }
3179
+ let t71;
3180
+ if ($[182] !== t) {
3181
+ t71 = t("Synced customers, subscriptions, and webhook events.");
3182
+ $[182] = t;
3183
+ $[183] = t71;
3184
+ } else {
3185
+ t71 = $[183];
3186
+ }
3187
+ let t72;
3188
+ if ($[184] !== t) {
3189
+ t72 = t("Inspect access policies per table, and probe a function as any identity.");
3190
+ $[184] = t;
3191
+ $[185] = t72;
3192
+ } else {
3193
+ t72 = $[185];
3194
+ }
3195
+ let t73;
3196
+ if ($[186] !== t) {
3197
+ t73 = t("Inspect declared Cloudflare Queues — their producer bindings, consumer mode, and dead-letter queue.");
3198
+ $[186] = t;
3199
+ $[187] = t73;
3200
+ } else {
3201
+ t73 = $[187];
3202
+ }
3203
+ let t74;
3204
+ if ($[188] !== t) {
3205
+ t74 = t("Active WebSocket subscriptions on this shard.");
3206
+ $[188] = t;
3207
+ $[189] = t74;
3208
+ } else {
3209
+ t74 = $[189];
3210
+ }
3211
+ let t75;
3212
+ if ($[190] !== t) {
3213
+ t75 = t("Inspect row-level-security policies and roles, per table.");
3214
+ $[190] = t;
3215
+ $[191] = t75;
3216
+ } else {
3217
+ t75 = $[191];
3218
+ }
3219
+ let t76;
3220
+ if ($[192] !== t) {
3221
+ t76 = t("Inspect and cancel scheduled jobs.");
3222
+ $[192] = t;
3223
+ $[193] = t76;
3224
+ } else {
3225
+ t76 = $[193];
3226
+ }
3227
+ let t77;
3228
+ if ($[194] !== t) {
3229
+ t77 = t("Inspect each table and its columns.");
3230
+ $[194] = t;
3231
+ $[195] = t77;
3232
+ } else {
3233
+ t77 = $[195];
3234
+ }
3235
+ let t78;
3236
+ if ($[196] !== t) {
3237
+ t78 = t("Review admin gates, credentials, and log redaction.");
3238
+ $[196] = t;
3239
+ $[197] = t78;
3240
+ } else {
3241
+ t78 = $[197];
3242
+ }
3243
+ let t79;
3244
+ if ($[198] !== t) {
3245
+ t79 = t("Read-only deployment config — vars, secrets, and bindings.");
3246
+ $[198] = t;
3247
+ $[199] = t79;
3248
+ } else {
3249
+ t79 = $[199];
3250
+ }
3251
+ let t80;
3252
+ if ($[200] !== t) {
3253
+ t80 = t("Run read-only SQL against a shard.");
3254
+ $[200] = t;
3255
+ $[201] = t80;
3256
+ } else {
3257
+ t80 = $[201];
3258
+ }
3259
+ let t81;
3260
+ if ($[202] !== t) {
3261
+ t81 = t("Browse and edit key-value pairs in your Workers KV namespaces.");
3262
+ $[202] = t;
3263
+ $[203] = t81;
3264
+ } else {
3265
+ t81 = $[203];
3266
+ }
3267
+ let t82;
3268
+ if ($[204] !== t) {
3269
+ t82 = t("Inspect storage access rules — per bucket, operation, and key prefix.");
3270
+ $[204] = t;
3271
+ $[205] = t82;
3272
+ } else {
3273
+ t82 = $[205];
3274
+ }
3275
+ let t83;
3276
+ if ($[206] !== t) {
3277
+ t83 = t("Manage auth users — roles, bans, sessions, and identity.");
3278
+ $[206] = t;
3279
+ $[207] = t83;
3280
+ } else {
3281
+ t83 = $[207];
3282
+ }
3283
+ let t84;
3284
+ if ($[208] !== t) {
3285
+ t84 = t("Browse Vectorize indexes and run similarity searches.");
3286
+ $[208] = t;
3287
+ $[209] = t84;
3288
+ } else {
3289
+ t84 = $[209];
3290
+ }
3291
+ let t85;
3292
+ if ($[210] !== t) {
3293
+ t85 = t("Inspect declared Cloudflare Workflows and their bindings.");
3294
+ $[210] = t;
3295
+ $[211] = t85;
3296
+ } else {
3297
+ t85 = $[211];
3298
+ }
3299
+ let t86;
3300
+ if ($[212] !== t46 || $[213] !== t47 || $[214] !== t48 || $[215] !== t49 || $[216] !== t50 || $[217] !== t51 || $[218] !== t52 || $[219] !== t53 || $[220] !== t54 || $[221] !== t55 || $[222] !== t56 || $[223] !== t57 || $[224] !== t58 || $[225] !== t59 || $[226] !== t60 || $[227] !== t61 || $[228] !== t62 || $[229] !== t63 || $[230] !== t64 || $[231] !== t65 || $[232] !== t66 || $[233] !== t67 || $[234] !== t68 || $[235] !== t69 || $[236] !== t70 || $[237] !== t71 || $[238] !== t72 || $[239] !== t73 || $[240] !== t74 || $[241] !== t75 || $[242] !== t76 || $[243] !== t77 || $[244] !== t78 || $[245] !== t79 || $[246] !== t80 || $[247] !== t81 || $[248] !== t82 || $[249] !== t83 || $[250] !== t84 || $[251] !== t85) {
3301
+ t86 = {
3302
+ agents: t46,
3303
+ analytics: t47,
3304
+ api: t48,
3305
+ audit: t49,
3306
+ authConfig: t50,
3307
+ authSessions: t51,
3308
+ containers: t52,
3309
+ dashboards: t53,
3310
+ data: t54,
3311
+ drains: t55,
3312
+ export: t56,
3313
+ fanout: t57,
3314
+ files: t58,
3315
+ flags: t59,
3316
+ functions: t60,
3317
+ health: t61,
3318
+ home: t62,
3319
+ insights: t63,
3320
+ issues: t64,
3321
+ logs: t65,
3322
+ metrics: t66,
3323
+ migrations: t67,
3324
+ organizations: t68,
3325
+ pitr: t69,
3326
+ mail: t70,
3327
+ payments: t71,
3328
+ permissions: t72,
3329
+ queues: t73,
3330
+ realtime: t74,
3331
+ rls: t75,
3332
+ schedule: t76,
3333
+ schema: t77,
3334
+ security: t78,
3335
+ settings: t79,
3336
+ sql: t80,
3337
+ kv: t81,
3338
+ storageRules: t82,
3339
+ users: t83,
3340
+ vectors: t84,
3341
+ workflows: t85
3342
+ };
3343
+ $[212] = t46;
3344
+ $[213] = t47;
3345
+ $[214] = t48;
3346
+ $[215] = t49;
3347
+ $[216] = t50;
3348
+ $[217] = t51;
3349
+ $[218] = t52;
3350
+ $[219] = t53;
3351
+ $[220] = t54;
3352
+ $[221] = t55;
3353
+ $[222] = t56;
3354
+ $[223] = t57;
3355
+ $[224] = t58;
3356
+ $[225] = t59;
3357
+ $[226] = t60;
3358
+ $[227] = t61;
3359
+ $[228] = t62;
3360
+ $[229] = t63;
3361
+ $[230] = t64;
3362
+ $[231] = t65;
3363
+ $[232] = t66;
3364
+ $[233] = t67;
3365
+ $[234] = t68;
3366
+ $[235] = t69;
3367
+ $[236] = t70;
3368
+ $[237] = t71;
3369
+ $[238] = t72;
3370
+ $[239] = t73;
3371
+ $[240] = t74;
3372
+ $[241] = t75;
3373
+ $[242] = t76;
3374
+ $[243] = t77;
3375
+ $[244] = t78;
3376
+ $[245] = t79;
3377
+ $[246] = t80;
3378
+ $[247] = t81;
3379
+ $[248] = t82;
3380
+ $[249] = t83;
3381
+ $[250] = t84;
3382
+ $[251] = t85;
3383
+ $[252] = t86;
3384
+ } else {
3385
+ t86 = $[252];
3386
+ }
3387
+ const tabDescription = t86;
3388
+ let t87;
3389
+ if ($[253] !== navigate) {
3390
+ t87 = (event) => {
3391
+ fireAndForget(navigate({
3392
+ to: `/${event.currentTarget.dataset.tab ?? ""}`
3393
+ }));
3394
+ };
3395
+ $[253] = navigate;
3396
+ $[254] = t87;
3397
+ } else {
3398
+ t87 = $[254];
3399
+ }
3400
+ const selectTab = t87;
3401
+ let t88;
3402
+ let t89;
3403
+ if ($[255] !== current || $[256] !== tabLabel) {
3404
+ t88 = () => {
3405
+ if (typeof document !== "undefined") {
3406
+ document.title = `${tabLabel[current]} · lunora`;
3407
+ }
3408
+ };
3409
+ t89 = [current, tabLabel];
3410
+ $[255] = current;
3411
+ $[256] = tabLabel;
3412
+ $[257] = t88;
3413
+ $[258] = t89;
3414
+ } else {
3415
+ t88 = $[257];
3416
+ t89 = $[258];
3417
+ }
3418
+ useEffect(t88, t89);
3419
+ const activeGroup = visibleGroups.find((group_1) => group_1.tabs.includes(current)) ?? NAV_GROUPS[0];
3420
+ const commandItems = visibleGroups.flatMap((group_2) => group_2.tabs.map((tab_0) => ({
3421
+ group: groupLabel[group_2.key],
3422
+ label: tabLabel[tab_0],
3423
+ to: `/${tab_0}`
3424
+ })));
3425
+ const chrome = use(StudioChromeContext);
3426
+ const connected = chrome !== null && chrome.token !== "";
3427
+ let t90;
3428
+ if ($[259] !== commandItems) {
3429
+ t90 = /* @__PURE__ */ jsxDEV(CommandPalette, {
3430
+ items: commandItems
3431
+ }, void 0, false);
3432
+ $[259] = commandItems;
3433
+ $[260] = t90;
3434
+ } else {
3435
+ t90 = $[260];
3436
+ }
3437
+ let t91;
3438
+ if ($[261] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3439
+ t91 = /* @__PURE__ */ jsxDEV(SidebarTrigger, {
3440
+ className: "-ms-1"
3441
+ }, void 0, false);
3442
+ $[261] = t91;
3443
+ } else {
3444
+ t91 = $[261];
3445
+ }
3446
+ let t92;
3447
+ if ($[262] !== t) {
3448
+ t92 = t("Breadcrumb");
3449
+ $[262] = t;
3450
+ $[263] = t92;
3451
+ } else {
3452
+ t92 = $[263];
3453
+ }
3454
+ const t93 = groupLabel[activeGroup.key];
3455
+ let t94;
3456
+ if ($[264] !== t93) {
3457
+ t94 = /* @__PURE__ */ jsxDEV("span", {
3458
+ className: "text-muted-foreground",
3459
+ children: t93
3460
+ }, void 0, false);
3461
+ $[264] = t93;
3462
+ $[265] = t94;
3463
+ } else {
3464
+ t94 = $[265];
3465
+ }
3466
+ let t95;
3467
+ if ($[266] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3468
+ t95 = /* @__PURE__ */ jsxDEV("svg", {
3469
+ "aria-hidden": "true",
3470
+ className: "size-3.5 text-muted-foreground/60",
3471
+ fill: "none",
3472
+ stroke: "currentColor",
3473
+ strokeWidth: 1.7,
3474
+ viewBox: "0 0 24 24",
3475
+ children: /* @__PURE__ */ jsxDEV("path", {
3476
+ d: "m9 6 6 6-6 6",
3477
+ strokeLinecap: "round",
3478
+ strokeLinejoin: "round"
3479
+ }, void 0, false)
3480
+ }, void 0, false);
3481
+ $[266] = t95;
3482
+ } else {
3483
+ t95 = $[266];
3484
+ }
3485
+ const t96 = tabLabel[current];
3486
+ let t97;
3487
+ if ($[267] !== t96) {
3488
+ t97 = /* @__PURE__ */ jsxDEV("span", {
3489
+ className: "font-medium text-foreground",
3490
+ children: t96
3491
+ }, void 0, false);
3492
+ $[267] = t96;
3493
+ $[268] = t97;
3494
+ } else {
3495
+ t97 = $[268];
3496
+ }
3497
+ let t98;
3498
+ if ($[269] !== t92 || $[270] !== t94 || $[271] !== t97) {
3499
+ t98 = /* @__PURE__ */ jsxDEV("nav", {
3500
+ "aria-label": t92,
3501
+ className: "flex items-center gap-1.5 text-[13px]",
3502
+ children: [t94, t95, t97]
3503
+ }, void 0, true);
3504
+ $[269] = t92;
3505
+ $[270] = t94;
3506
+ $[271] = t97;
3507
+ $[272] = t98;
3508
+ } else {
3509
+ t98 = $[272];
3510
+ }
3511
+ let t99;
3512
+ if ($[273] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3513
+ t99 = /* @__PURE__ */ jsxDEV("svg", {
3514
+ "aria-hidden": "true",
3515
+ className: "size-3.5",
3516
+ fill: "none",
3517
+ stroke: "currentColor",
3518
+ strokeWidth: 1.8,
3519
+ viewBox: "0 0 24 24",
3520
+ children: [/* @__PURE__ */ jsxDEV("circle", {
3521
+ cx: "11",
3522
+ cy: "11",
3523
+ r: "7"
3524
+ }, void 0, false), /* @__PURE__ */ jsxDEV("path", {
3525
+ d: "m21 21-4.3-4.3",
3526
+ strokeLinecap: "round"
3527
+ }, void 0, false)]
3528
+ }, void 0, true);
3529
+ $[273] = t99;
3530
+ } else {
3531
+ t99 = $[273];
3532
+ }
3533
+ let t100;
3534
+ if ($[274] !== t) {
3535
+ t100 = t("Search…");
3536
+ $[274] = t;
3537
+ $[275] = t100;
3538
+ } else {
3539
+ t100 = $[275];
3540
+ }
3541
+ let t101;
3542
+ if ($[276] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3543
+ t101 = /* @__PURE__ */ jsxDEV("kbd", {
3544
+ className: "ms-auto rounded border border-border bg-background px-1 font-sans text-[10px] text-muted-foreground",
3545
+ children: "⌘K"
3546
+ }, void 0, false);
3547
+ $[276] = t101;
3548
+ } else {
3549
+ t101 = $[276];
3550
+ }
3551
+ let t102;
3552
+ if ($[277] !== t100) {
3553
+ t102 = /* @__PURE__ */ jsxDEV("button", {
3554
+ 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",
3555
+ "data-testid": "dash-app-search",
3556
+ onClick: openCommandPalette,
3557
+ type: "button",
3558
+ children: [t99, t100, t101]
3559
+ }, void 0, true);
3560
+ $[277] = t100;
3561
+ $[278] = t102;
3562
+ } else {
3563
+ t102 = $[278];
3564
+ }
3565
+ let t103;
3566
+ if ($[279] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3567
+ t103 = /* @__PURE__ */ jsxDEV("div", {
3568
+ className: "ms-auto flex items-center gap-1.5 md:ms-0",
3569
+ children: /* @__PURE__ */ jsxDEV(ThemeToggle, {}, void 0, false)
3570
+ }, void 0, false);
3571
+ $[279] = t103;
3572
+ } else {
3573
+ t103 = $[279];
3574
+ }
3575
+ let t104;
3576
+ if ($[280] !== t102 || $[281] !== t98) {
3577
+ t104 = /* @__PURE__ */ jsxDEV("header", {
3578
+ className: "flex h-11 shrink-0 items-center gap-2 border-b border-border px-4",
3579
+ "data-testid": "dash-app-header",
3580
+ children: [t91, t98, t102, t103]
3581
+ }, void 0, true);
3582
+ $[280] = t102;
3583
+ $[281] = t98;
3584
+ $[282] = t104;
3585
+ } else {
3586
+ t104 = $[282];
3587
+ }
3588
+ let t105;
3589
+ if ($[283] !== chrome?.rulesInstalled) {
3590
+ t105 = chrome?.rulesInstalled === false && /* @__PURE__ */ jsxDEV(RulesBanner, {}, void 0, false);
3591
+ $[283] = chrome?.rulesInstalled;
3592
+ $[284] = t105;
3593
+ } else {
3594
+ t105 = $[284];
3595
+ }
3596
+ const t106 = `dash-tab-${current}`;
3597
+ const t107 = fullHeight ? "flex min-w-0 flex-1 flex-col overflow-hidden" : "min-w-0 flex-1 overflow-auto p-6";
3598
+ const t108 = tabLabel[current];
3599
+ let t109;
3600
+ if ($[285] !== t || $[286] !== t108) {
3601
+ t109 = t("{title} failed", {
3602
+ title: t108
3603
+ });
3604
+ $[285] = t;
3605
+ $[286] = t108;
3606
+ $[287] = t109;
3607
+ } else {
3608
+ t109 = $[287];
3609
+ }
3610
+ const t110 = tabLabel[current];
3611
+ let t111;
3612
+ if ($[288] !== t) {
3613
+ t111 = t("Try again");
3614
+ $[288] = t;
3615
+ $[289] = t111;
3616
+ } else {
3617
+ t111 = $[289];
3618
+ }
3619
+ let t112;
3620
+ if ($[290] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3621
+ t112 = /* @__PURE__ */ jsxDEV(Suspense, {
3622
+ fallback: /* @__PURE__ */ jsxDEV(RoutePending, {}, void 0, false),
3623
+ children: /* @__PURE__ */ jsxDEV(Outlet, {}, void 0, false)
3624
+ }, void 0, false);
3625
+ $[290] = t112;
3626
+ } else {
3627
+ t112 = $[290];
3628
+ }
3629
+ let t113;
3630
+ if ($[291] !== current || $[292] !== t109 || $[293] !== t110 || $[294] !== t111) {
3631
+ t113 = /* @__PURE__ */ jsxDEV(ErrorBoundary, {
3632
+ fallbackTitle: t109,
3633
+ label: t110,
3634
+ retryLabel: t111,
3635
+ children: t112
3636
+ }, current, false);
3637
+ $[291] = current;
3638
+ $[292] = t109;
3639
+ $[293] = t110;
3640
+ $[294] = t111;
3641
+ $[295] = t113;
3642
+ } else {
3643
+ t113 = $[295];
3644
+ }
3645
+ let t114;
3646
+ if ($[296] !== t107 || $[297] !== t113) {
3647
+ t114 = /* @__PURE__ */ jsxDEV("div", {
3648
+ className: t107,
3649
+ children: t113
3650
+ }, void 0, false);
3651
+ $[296] = t107;
3652
+ $[297] = t113;
3653
+ $[298] = t114;
3654
+ } else {
3655
+ t114 = $[298];
3656
+ }
3657
+ let t115;
3658
+ if ($[299] !== t106 || $[300] !== t114) {
3659
+ t115 = /* @__PURE__ */ jsxDEV("div", {
3660
+ "aria-labelledby": t106,
3661
+ className: "flex min-w-0 flex-1 flex-col overflow-hidden",
3662
+ "data-testid": "dash-panel",
3663
+ id: "dash-panel",
3664
+ role: "tabpanel",
3665
+ children: t114
3666
+ }, void 0, false);
3667
+ $[299] = t106;
3668
+ $[300] = t114;
3669
+ $[301] = t115;
3670
+ } else {
3671
+ t115 = $[301];
3672
+ }
3673
+ let t116;
3674
+ if ($[302] !== t104 || $[303] !== t105 || $[304] !== t115) {
3675
+ t116 = /* @__PURE__ */ jsxDEV(SidebarInset, {
3676
+ className: "overflow-hidden md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",
3677
+ children: [t104, t105, t115]
3678
+ }, void 0, true);
3679
+ $[302] = t104;
3680
+ $[303] = t105;
3681
+ $[304] = t115;
3682
+ $[305] = t116;
3683
+ } else {
3684
+ t116 = $[305];
3685
+ }
3686
+ return /* @__PURE__ */ jsxDEV(SidebarProvider, {
3687
+ className: "min-h-0 flex-1",
3688
+ "data-testid": "lunora-studio",
3689
+ children: [t90, /* @__PURE__ */ jsxDEV(StudioSidebar, {
3690
+ chrome,
3691
+ connected,
3692
+ current,
3693
+ groupLabel,
3694
+ groups: visibleGroups,
3695
+ selectTab,
3696
+ tabDescription,
3697
+ tabLabel
3698
+ }, void 0, false), t116]
3699
+ }, void 0, true);
3700
+ };
3701
+ const SchemaRoutePanel = (t0) => {
3702
+ const $ = c(5);
3703
+ const {
3704
+ initialShardKey,
3705
+ schemaEditable
3706
+ } = t0;
3707
+ let t1;
3708
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3709
+ t1 = {
3710
+ strict: false
3711
+ };
3712
+ $[0] = t1;
3713
+ } else {
3714
+ t1 = $[0];
3715
+ }
3716
+ const search = useSearch(t1);
3717
+ const {
3718
+ table
3719
+ } = search;
3720
+ const initialTable = typeof table === "string" ? table : void 0;
3721
+ let t2;
3722
+ if ($[1] !== initialShardKey || $[2] !== initialTable || $[3] !== schemaEditable) {
3723
+ t2 = /* @__PURE__ */ jsxDEV(SchemaViewer, {
3724
+ initialShardKey,
3725
+ initialTable,
3726
+ schemaEditable
3727
+ }, void 0, false);
3728
+ $[1] = initialShardKey;
3729
+ $[2] = initialTable;
3730
+ $[3] = schemaEditable;
3731
+ $[4] = t2;
3732
+ } else {
3733
+ t2 = $[4];
3734
+ }
3735
+ return t2;
3736
+ };
3737
+ const NotFoundRedirect = () => {
3738
+ const $ = c(3);
3739
+ const navigate = useNavigate();
3740
+ let t0;
3741
+ let t1;
3742
+ if ($[0] !== navigate) {
3743
+ t0 = () => {
3744
+ fireAndForget(navigate({
3745
+ replace: true,
3746
+ to: "/home"
3747
+ }));
3748
+ };
3749
+ t1 = [navigate];
3750
+ $[0] = navigate;
3751
+ $[1] = t0;
3752
+ $[2] = t1;
3753
+ } else {
3754
+ t0 = $[1];
3755
+ t1 = $[2];
3756
+ }
3757
+ useEffect(t0, t1);
3758
+ return null;
3759
+ };
3760
+ const buildRouter = ({
3761
+ basePath,
3762
+ dataEditable = false,
3763
+ functions,
3764
+ initialShardKey,
3765
+ openApiSpec,
3766
+ openRpcSpec,
3767
+ runAsIdentity = false,
3768
+ schemaEditable = false,
3769
+ scheduledCancel,
3770
+ scheduledCron,
3771
+ scheduledLoad
3772
+ }) => {
3773
+ const rootRoute = createRootRoute({
3774
+ component: StudioLayout
3775
+ });
3776
+ const panels = {
3777
+ agents: /* @__PURE__ */ jsxDEV(AgentsPanel, {
3778
+ initialShardKey
3779
+ }, void 0, false),
3780
+ analytics: /* @__PURE__ */ jsxDEV(AnalyticsPanel, {}, void 0, false),
3781
+ api: /* @__PURE__ */ jsxDEV(ApiTab, {
3782
+ functions,
3783
+ initialShardKey,
3784
+ openApiSpec,
3785
+ openRpcSpec
3786
+ }, void 0, false),
3787
+ audit: /* @__PURE__ */ jsxDEV(AuditPanel, {
3788
+ initialShardKey
3789
+ }, void 0, false),
3790
+ authConfig: /* @__PURE__ */ jsxDEV(AuthConfigPanel, {}, void 0, false),
3791
+ authSessions: /* @__PURE__ */ jsxDEV(AuthSessionsPanel, {}, void 0, false),
3792
+ containers: /* @__PURE__ */ jsxDEV(ContainersPanel, {}, void 0, false),
3793
+ dashboards: /* @__PURE__ */ jsxDEV(DashboardsPanel, {
3794
+ initialShardKey
3795
+ }, void 0, false),
3796
+ data: /* @__PURE__ */ jsxDEV(TableEditor, {
3797
+ editable: dataEditable,
3798
+ initialShardKey
3799
+ }, void 0, false),
3800
+ drains: /* @__PURE__ */ jsxDEV(LogDrainsPanel, {}, void 0, false),
3801
+ export: /* @__PURE__ */ jsxDEV(ExportImportPanel, {
3802
+ initialShardKey
3803
+ }, void 0, false),
3804
+ fanout: /* @__PURE__ */ jsxDEV(FanoutPanel, {
3805
+ initialShardKey
3806
+ }, void 0, false),
3807
+ files: /* @__PURE__ */ jsxDEV(FileBrowser, {}, void 0, false),
3808
+ kv: /* @__PURE__ */ jsxDEV(KvBrowser, {}, void 0, false),
3809
+ flags: /* @__PURE__ */ jsxDEV(FlagsPanel, {
3810
+ initialShardKey
3811
+ }, void 0, false),
3812
+ functions: /* @__PURE__ */ jsxDEV("div", {
3813
+ className: "flex flex-col gap-8",
3814
+ children: [/* @__PURE__ */ jsxDEV(FunctionStatsPanel, {
3815
+ functions,
3816
+ initialShardKey
3817
+ }, void 0, false), /* @__PURE__ */ jsxDEV(FunctionRunner, {
3818
+ functions,
3819
+ runAsIdentity
3820
+ }, void 0, false)]
3821
+ }, void 0, true),
3822
+ health: /* @__PURE__ */ jsxDEV(HealthPanel, {
3823
+ initialShardKey
3824
+ }, void 0, false),
3825
+ home: /* @__PURE__ */ jsxDEV(HomePanel, {
3826
+ initialShardKey
3827
+ }, void 0, false),
3828
+ insights: /* @__PURE__ */ jsxDEV(InsightsPanel, {
3829
+ initialShardKey
3830
+ }, void 0, false),
3831
+ issues: /* @__PURE__ */ jsxDEV(IssuesPanel, {
3832
+ initialShardKey
3833
+ }, void 0, false),
3834
+ logs: /* @__PURE__ */ jsxDEV(LogsPanel, {
3835
+ initialShardKey
3836
+ }, void 0, false),
3837
+ metrics: /* @__PURE__ */ jsxDEV(MetricsPanel, {
3838
+ initialShardKey
3839
+ }, void 0, false),
3840
+ migrations: /* @__PURE__ */ jsxDEV(MigrationsPanel, {
3841
+ initialShardKey
3842
+ }, void 0, false),
3843
+ organizations: /* @__PURE__ */ jsxDEV(OrganizationsPanel, {}, void 0, false),
3844
+ permissions: /* @__PURE__ */ jsxDEV(PermissionsPanel, {
3845
+ functions,
3846
+ runAsIdentity,
3847
+ schemaEditable
3848
+ }, void 0, false),
3849
+ pitr: /* @__PURE__ */ jsxDEV(PitrPanel, {
3850
+ initialShardKey
3851
+ }, void 0, false),
3852
+ mail: /* @__PURE__ */ jsxDEV(MailPanel, {}, void 0, false),
3853
+ payments: /* @__PURE__ */ jsxDEV(PaymentsPanel, {}, void 0, false),
3854
+ queues: /* @__PURE__ */ jsxDEV(QueuesPanel, {}, void 0, false),
3855
+ realtime: /* @__PURE__ */ jsxDEV(SubscriptionsPanel, {
3856
+ initialShardKey
3857
+ }, void 0, false),
3858
+ rls: /* @__PURE__ */ jsxDEV(RlsPanel, {}, void 0, false),
3859
+ schedule: /* @__PURE__ */ jsxDEV(SchedulePanel, {
3860
+ loadCronJobs: scheduledCron,
3861
+ scheduledCancel,
3862
+ scheduledLoad
3863
+ }, void 0, false),
3864
+ schema: /* @__PURE__ */ jsxDEV(SchemaRoutePanel, {
3865
+ initialShardKey,
3866
+ schemaEditable
3867
+ }, void 0, false),
3868
+ security: /* @__PURE__ */ jsxDEV(SecurityAdvisorPanel, {}, void 0, false),
3869
+ settings: /* @__PURE__ */ jsxDEV(SettingsPanel, {
3870
+ initialShardKey
3871
+ }, void 0, false),
3872
+ sql: /* @__PURE__ */ jsxDEV(SqlEditorPanel, {
3873
+ initialShardKey
3874
+ }, void 0, false),
3875
+ storageRules: /* @__PURE__ */ jsxDEV(StorageRulesPanel, {}, void 0, false),
3876
+ users: /* @__PURE__ */ jsxDEV(UsersPanel, {}, void 0, false),
3877
+ vectors: /* @__PURE__ */ jsxDEV(VectorBrowser, {}, void 0, false),
3878
+ workflows: /* @__PURE__ */ jsxDEV(WorkflowsPanel, {}, void 0, false)
3879
+ };
3880
+ const indexRoute = createRoute({
3881
+ component: () => panels.home,
3882
+ getParentRoute: () => rootRoute,
3883
+ path: "/"
3884
+ });
3885
+ const tabRoutes = TABS.map((tab) => {
3886
+ if (tab === "data") {
3887
+ return createRoute({
3888
+ component: () => panels[tab],
3889
+ getParentRoute: () => rootRoute,
3890
+ path: `/${tab}`,
3891
+ validateSearch: validateDataViewSearch
3892
+ });
3893
+ }
3894
+ return createRoute({
3895
+ component: () => panels[tab],
3896
+ getParentRoute: () => rootRoute,
3897
+ path: `/${tab}`
3898
+ });
3899
+ });
3900
+ const routeTree = rootRoute.addChildren([indexRoute, ...tabRoutes]);
3901
+ const history = "window" in globalThis ? createBrowserHistory() : createMemoryHistory({
3902
+ initialEntries: ["/home"]
3903
+ });
3904
+ return createRouter({
3905
+ // When mounted under a prefix (e.g. the `/__lunora` dev route), the router
3906
+ // works in that subtree: `/__lunora` matches the index route and every
3907
+ // `navigate({ to: "/logs" })` resolves to `/__lunora/logs`, so navigation
3908
+ // never escapes the mount. Omitted for a root mount.
3909
+ ...basePath === void 0 || basePath === "/" ? {} : {
3910
+ basepath: basePath
3911
+ },
3912
+ defaultNotFoundComponent: NotFoundRedirect,
3913
+ defaultPendingComponent: RoutePending,
3914
+ defaultPendingMinMs: 0,
3915
+ defaultPendingMs: 0,
3916
+ history,
3917
+ routeTree
3918
+ });
3919
+ };
3920
+ const StudioShell = (t0) => {
3921
+ const $ = c(17);
3922
+ const {
3923
+ basePath,
3924
+ chrome,
3925
+ dataEditable,
3926
+ functions,
3927
+ initialShardKey,
3928
+ openApiSpec,
3929
+ openRpcSpec,
3930
+ runAsIdentity,
3931
+ schemaEditable,
3932
+ scheduledCancel,
3933
+ scheduledCron,
3934
+ scheduledLoad
3935
+ } = t0;
3936
+ let t1;
3937
+ if ($[0] !== basePath || $[1] !== dataEditable || $[2] !== functions || $[3] !== initialShardKey || $[4] !== openApiSpec || $[5] !== openRpcSpec || $[6] !== runAsIdentity || $[7] !== scheduledCancel || $[8] !== scheduledCron || $[9] !== scheduledLoad || $[10] !== schemaEditable) {
3938
+ t1 = buildRouter({
3939
+ basePath,
3940
+ dataEditable,
3941
+ functions,
3942
+ initialShardKey,
3943
+ openApiSpec,
3944
+ openRpcSpec,
3945
+ runAsIdentity,
3946
+ schemaEditable,
3947
+ scheduledCancel,
3948
+ scheduledCron,
3949
+ scheduledLoad
3950
+ });
3951
+ $[0] = basePath;
3952
+ $[1] = dataEditable;
3953
+ $[2] = functions;
3954
+ $[3] = initialShardKey;
3955
+ $[4] = openApiSpec;
3956
+ $[5] = openRpcSpec;
3957
+ $[6] = runAsIdentity;
3958
+ $[7] = scheduledCancel;
3959
+ $[8] = scheduledCron;
3960
+ $[9] = scheduledLoad;
3961
+ $[10] = schemaEditable;
3962
+ $[11] = t1;
3963
+ } else {
3964
+ t1 = $[11];
3965
+ }
3966
+ const router = t1;
3967
+ const t2 = chrome ?? null;
3968
+ let t3;
3969
+ if ($[12] !== router) {
3970
+ t3 = /* @__PURE__ */ jsxDEV(RouterProvider, {
3971
+ router
3972
+ }, void 0, false);
3973
+ $[12] = router;
3974
+ $[13] = t3;
3975
+ } else {
3976
+ t3 = $[13];
3977
+ }
3978
+ let t4;
3979
+ if ($[14] !== t2 || $[15] !== t3) {
3980
+ t4 = /* @__PURE__ */ jsxDEV(StudioChromeContext, {
3981
+ value: t2,
3982
+ children: t3
3983
+ }, void 0, false);
3984
+ $[14] = t2;
3985
+ $[15] = t3;
3986
+ $[16] = t4;
3987
+ } else {
3988
+ t4 = $[16];
3989
+ }
3990
+ return t4;
3991
+ };
3992
+ const Studio = (t0) => {
3993
+ const $ = c(17);
3994
+ const {
3995
+ basePath,
3996
+ chrome,
3997
+ dataEditable,
3998
+ functions,
3999
+ i18n,
4000
+ initialShardKey,
4001
+ locale,
4002
+ openApiSpec,
4003
+ openRpcSpec,
4004
+ runAsIdentity,
4005
+ schemaEditable,
4006
+ scheduledCancel,
4007
+ scheduledCron,
4008
+ scheduledLoad
4009
+ } = t0;
4010
+ let t1;
4011
+ 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) {
4012
+ t1 = /* @__PURE__ */ jsxDEV(StudioShell, {
4013
+ basePath,
4014
+ chrome,
4015
+ dataEditable,
4016
+ functions,
4017
+ initialShardKey,
4018
+ openApiSpec,
4019
+ openRpcSpec,
4020
+ runAsIdentity,
4021
+ scheduledCancel,
4022
+ scheduledCron,
4023
+ scheduledLoad,
4024
+ schemaEditable
4025
+ }, void 0, false);
4026
+ $[0] = basePath;
4027
+ $[1] = chrome;
4028
+ $[2] = dataEditable;
4029
+ $[3] = functions;
4030
+ $[4] = initialShardKey;
4031
+ $[5] = openApiSpec;
4032
+ $[6] = openRpcSpec;
4033
+ $[7] = runAsIdentity;
4034
+ $[8] = scheduledCancel;
4035
+ $[9] = scheduledCron;
4036
+ $[10] = scheduledLoad;
4037
+ $[11] = schemaEditable;
4038
+ $[12] = t1;
4039
+ } else {
4040
+ t1 = $[12];
4041
+ }
4042
+ const shell = t1;
4043
+ if (i18n === void 0 && locale === void 0) {
4044
+ return shell;
4045
+ }
4046
+ let t2;
4047
+ if ($[13] !== i18n || $[14] !== locale || $[15] !== shell) {
4048
+ t2 = /* @__PURE__ */ jsxDEV(StudioI18nProvider, {
4049
+ i18n,
4050
+ locale,
4051
+ children: shell
4052
+ }, void 0, false);
4053
+ $[13] = i18n;
4054
+ $[14] = locale;
4055
+ $[15] = shell;
4056
+ $[16] = t2;
4057
+ } else {
4058
+ t2 = $[16];
4059
+ }
4060
+ return t2;
4061
+ };
4062
+ function _temp(state) {
4063
+ return state.location.pathname;
4064
+ }
4065
+ function _temp2(group_0) {
4066
+ return group_0.tabs.length > 0;
4067
+ }
4068
+
4069
+ 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 };