@lunora/studio 1.0.0-alpha.57 → 1.0.0-alpha.59

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 (115) hide show
  1. package/dist/index.d.ts +61 -4
  2. package/dist/index.js +8 -6
  3. package/dist/mount.d.ts +1 -1
  4. package/dist/mount.js +1 -1
  5. package/dist/packem_chunks/ApiTab.js +1 -1
  6. package/dist/packem_chunks/AuditPanel.js +1 -1
  7. package/dist/packem_chunks/DeploymentHealthPanel.js +664 -0
  8. package/dist/packem_chunks/ExportImportPanel.js +1 -1
  9. package/dist/packem_chunks/FileBrowser.js +1 -1
  10. package/dist/packem_chunks/FunctionRunner.js +1 -1
  11. package/dist/packem_chunks/FunctionStatsPanel.js +1 -1
  12. package/dist/packem_chunks/HealthPanel.js +1 -1
  13. package/dist/packem_chunks/InsightsPanel.js +1 -1
  14. package/dist/packem_chunks/LogsPanel.js +1 -1
  15. package/dist/packem_chunks/MailPanel.js +1 -1
  16. package/dist/packem_chunks/MetricsPanel.js +473 -242
  17. package/dist/packem_chunks/MigrationsPanel.js +1 -1
  18. package/dist/packem_chunks/NotificationsPanel.js +306 -0
  19. package/dist/packem_chunks/PitrPanel.js +1 -1
  20. package/dist/packem_chunks/SchemaViewer.js +1 -1
  21. package/dist/packem_chunks/SecurityAdvisorPanel.js +1 -1
  22. package/dist/packem_chunks/SettingsPanel.js +1 -1
  23. package/dist/packem_chunks/SqlEditorPanel.js +1 -1
  24. package/dist/packem_chunks/TableEditor.js +1 -1
  25. package/dist/packem_chunks/agents-panel.js +1 -1
  26. package/dist/packem_chunks/auth-audit-panel.js +247 -0
  27. package/dist/packem_chunks/containers-panel.js +1 -1
  28. package/dist/packem_chunks/dashboards-panel.js +1 -1
  29. package/dist/packem_chunks/fanout-panel.js +1 -1
  30. package/dist/packem_chunks/flags-panel.js +1 -1
  31. package/dist/packem_chunks/issues-panel.js +1 -1
  32. package/dist/packem_chunks/kv-browser.js +1 -1
  33. package/dist/packem_chunks/payments-panel.js +28 -1
  34. package/dist/packem_chunks/permissions-panel.js +1 -1
  35. package/dist/packem_chunks/queues-panel.js +1 -1
  36. package/dist/packem_chunks/rls-panel.js +1 -1
  37. package/dist/packem_chunks/storage-rules-panel.js +1 -1
  38. package/dist/packem_chunks/subscriptions-panel.js +1 -1
  39. package/dist/packem_chunks/traces-panel.js +125 -112
  40. package/dist/packem_chunks/workflows-panel.js +1 -1
  41. package/dist/packem_shared/{ADMIN_FUNCTIONS-C1LXrovV.js → ADMIN_FUNCTIONS-P2UzJscH.js} +3 -0
  42. package/dist/packem_shared/{ApiDocsPanel-BBvinlRD.js → ApiDocsPanel-DNDpeR5O.js} +1 -1
  43. package/dist/packem_shared/{DataBrowser-BoinTGxr.js → DataBrowser-obTn4sKX.js} +1 -1
  44. package/dist/packem_shared/{HomePanel-BpdGcW4L.js → HomePanel-DCRj3hGB.js} +2 -2
  45. package/dist/packem_shared/{Studio-BpnYw3lc.js → Studio-DnlPCbID.js} +2 -2
  46. package/dist/packem_shared/{StudioApp-DRGVBnFx.js → StudioApp-CzqlB4zO.js} +1 -1
  47. package/dist/packem_shared/{app.d-C-kxb-1T.d.ts → app.d-bRPJhby-.d.ts} +1 -1
  48. package/dist/packem_shared/{home-panel-Dmg4sNiv.js → home-panel-BRAA2UlM.js} +1 -1
  49. package/dist/packem_shared/{studio-LL4iP8fZ.js → studio-8QSXbZ98.js} +682 -607
  50. package/dist/packem_shared/trace-handoff-CGolF3KS.js +38 -0
  51. package/dist/standalone/{chunk-C7UZEQZ7.js → chunk-3LJEGSMK.js} +2 -2
  52. package/dist/standalone/{chunk-SAQU44MF.js → chunk-56XQYNUJ.js} +1 -1
  53. package/dist/standalone/chunk-5QT5JRXD.js +3 -0
  54. package/dist/standalone/{chunk-JM3ZISDM.js → chunk-6RLPR7PL.js} +1 -1
  55. package/dist/standalone/{chunk-T3R6VHAT.js → chunk-6V74EUPK.js} +1 -1
  56. package/dist/standalone/{chunk-27JTW53L.js → chunk-7EE33WLB.js} +1 -1
  57. package/dist/standalone/{chunk-R4ALMCZA.js → chunk-AXNGWSBM.js} +1 -1
  58. package/dist/standalone/{chunk-OHCGUIOG.js → chunk-AXZILWRM.js} +1 -1
  59. package/dist/standalone/{chunk-J2DQ63SR.js → chunk-C7RHEBOH.js} +1 -1
  60. package/dist/standalone/chunk-CSWIYOB3.js +1 -0
  61. package/dist/standalone/{chunk-NV5LO5I6.js → chunk-D3VAON25.js} +1 -1
  62. package/dist/standalone/{chunk-HQ2CPGA4.js → chunk-DDLQN67F.js} +1 -1
  63. package/dist/standalone/chunk-DGHW5JG5.js +1 -0
  64. package/dist/standalone/{chunk-EFYZYQUA.js → chunk-DMCSOTAE.js} +1 -1
  65. package/dist/standalone/{chunk-MBG7XWNH.js → chunk-E3BKETAS.js} +1 -1
  66. package/dist/standalone/{chunk-IMVAYDPK.js → chunk-E3OXNN6O.js} +1 -1
  67. package/dist/standalone/chunk-E6BOGDIS.js +1 -0
  68. package/dist/standalone/{chunk-2ICZ6HXQ.js → chunk-F7GE4X2U.js} +1 -1
  69. package/dist/standalone/{chunk-CENYZ5GF.js → chunk-FAVUOGJR.js} +1 -1
  70. package/dist/standalone/{chunk-NIC6UYAQ.js → chunk-FXP6256Q.js} +1 -1
  71. package/dist/standalone/{chunk-X34PHGZF.js → chunk-G6CTAYHJ.js} +1 -1
  72. package/dist/standalone/chunk-H42W62SE.js +1 -0
  73. package/dist/standalone/{chunk-LABWKVKR.js → chunk-HTF5ZX4I.js} +1 -1
  74. package/dist/standalone/{chunk-AYHAJL3Z.js → chunk-I2PS4L74.js} +1 -1
  75. package/dist/standalone/{chunk-MJ4HATA2.js → chunk-J7OGP4NN.js} +1 -1
  76. package/dist/standalone/{chunk-2XUT4Z4W.js → chunk-L2LN3MK4.js} +1 -1
  77. package/dist/standalone/{chunk-2BSDITP4.js → chunk-LT3FH6MW.js} +1 -1
  78. package/dist/standalone/{chunk-ZXLEXF4X.js → chunk-LXULVPEM.js} +3 -3
  79. package/dist/standalone/{chunk-RIZDNIW7.js → chunk-LZUWZBPE.js} +1 -1
  80. package/dist/standalone/{chunk-W3EYW2EA.js → chunk-M4JM3TOY.js} +1 -1
  81. package/dist/standalone/{chunk-P7MZQ6VJ.js → chunk-MLA5ZAEB.js} +1 -1
  82. package/dist/standalone/{chunk-67YMILPJ.js → chunk-MRBI5HNQ.js} +1 -1
  83. package/dist/standalone/{chunk-53J4JZ2D.js → chunk-NKFXMDOD.js} +1 -1
  84. package/dist/standalone/{chunk-WAX3RSAI.js → chunk-NPSNKFHE.js} +1 -1
  85. package/dist/standalone/{chunk-ZVQMTQYX.js → chunk-O7FVPUCO.js} +1 -1
  86. package/dist/standalone/{chunk-227DORM6.js → chunk-OKQXTLFX.js} +1 -1
  87. package/dist/standalone/{chunk-OPSAI5PZ.js → chunk-QAIM6KWT.js} +1 -1
  88. package/dist/standalone/{chunk-7YGTGBP7.js → chunk-QCPMTB6W.js} +1 -1
  89. package/dist/standalone/{chunk-XAGYDGI6.js → chunk-QQ2LOSZL.js} +1 -1
  90. package/dist/standalone/{chunk-Y26ZIWUZ.js → chunk-R2GMHLJY.js} +1 -1
  91. package/dist/standalone/{chunk-2YUYNNHQ.js → chunk-RD5UG2YL.js} +1 -1
  92. package/dist/standalone/chunk-RJTIP3WF.js +1 -0
  93. package/dist/standalone/{chunk-BIA2DLBR.js → chunk-SOC5CY3F.js} +1 -1
  94. package/dist/standalone/{chunk-GF6GF6CF.js → chunk-SS7JLF2I.js} +1 -1
  95. package/dist/standalone/{chunk-PYPWIYI2.js → chunk-SWWYUGPL.js} +1 -1
  96. package/dist/standalone/chunk-TEWVD66F.js +1 -0
  97. package/dist/standalone/{chunk-QAW6AWOE.js → chunk-TTXRHJUP.js} +1 -1
  98. package/dist/standalone/{chunk-4Q66FL5S.js → chunk-UKDHGVOC.js} +1 -1
  99. package/dist/standalone/{chunk-5IGHDPEP.js → chunk-UPNTMJFF.js} +1 -1
  100. package/dist/standalone/{chunk-PRHAIUWS.js → chunk-XN6QYJQ6.js} +1 -1
  101. package/dist/standalone/chunk-Y4U6CC22.js +1 -0
  102. package/dist/standalone/{chunk-SWMBBYJU.js → chunk-Y7PD5KP4.js} +1 -1
  103. package/dist/standalone/chunk-YFIPHCEC.js +1 -0
  104. package/dist/standalone/chunk-YJXOWLFJ.js +1 -0
  105. package/dist/standalone/{chunk-CURAOCQJ.js → chunk-YNN6NFRZ.js} +1 -1
  106. package/dist/standalone/{chunk-LFORIMS7.js → chunk-YUGHRVPD.js} +1 -1
  107. package/dist/standalone/studio.js +1 -1
  108. package/dist/styles.css +1 -1
  109. package/package.json +6 -6
  110. package/dist/standalone/chunk-EXNK5XAW.js +0 -1
  111. package/dist/standalone/chunk-LT2HPR6R.js +0 -3
  112. package/dist/standalone/chunk-MHGJUKCZ.js +0 -1
  113. package/dist/standalone/chunk-N2E4TKRD.js +0 -1
  114. package/dist/standalone/chunk-S6PTK7Y2.js +0 -1
  115. package/dist/standalone/chunk-X3VAERRH.js +0 -1
@@ -14,7 +14,7 @@ import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as Table
14
14
  import { u as useAdminQuery } from '../packem_shared/use-admin-query-C7JNuQp-.js';
15
15
  import useDebounced from '../packem_shared/useDebounced-Dxncpg6z.js';
16
16
  import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
17
- import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-C1LXrovV.js';
17
+ import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-P2UzJscH.js';
18
18
  import { i as formatTimestamp, f as fireAndForget, c as callOptions, e as errorMessage, a as adminRef } from '../packem_shared/internal-DzHCc2Rq.js';
19
19
  import { r as recordShard } from '../packem_shared/shard-history-AxiJ1WPP.js';
20
20
  import { jsxDEV } from 'react/jsx-dev-runtime';
@@ -0,0 +1,306 @@
1
+ import { c } from 'react/compiler-runtime';
2
+ import { useState } from 'react';
3
+ import { E as ErrorAlert } from '../packem_shared/error-alert-D9uIFJUS.js';
4
+ import { B as Badge } from '../packem_shared/badge-B2PKA1-5.js';
5
+ import { B as Button } from '../packem_shared/button-BhsN2uZH.js';
6
+ import { C as Card, a as CardContent } from '../packem_shared/card-F2vH_aj2.js';
7
+ import { E as EmptyState } from '../packem_shared/empty-state-DY_oe0k6.js';
8
+ import { I as Input } from '../packem_shared/input-XH4r1Pt1.js';
9
+ import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell } from '../packem_shared/table-DsCa9Qp9.js';
10
+ import { u as useAdminQuery } from '../packem_shared/use-admin-query-C7JNuQp-.js';
11
+ import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
12
+ import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-P2UzJscH.js';
13
+ import { i as formatTimestamp } from '../packem_shared/internal-DzHCc2Rq.js';
14
+ import { jsxDEV } from 'react/jsx-dev-runtime';
15
+
16
+ const statusVariant = (status) => {
17
+ if (status === "ok") {
18
+ return "success";
19
+ }
20
+ if (status === "failed") {
21
+ return "destructive";
22
+ }
23
+ if (status === "expired") {
24
+ return "warning";
25
+ }
26
+ return "secondary";
27
+ };
28
+ const deviceTarget = (device) => device.endpoint ?? device.id;
29
+ const NotificationsPanel = () => {
30
+ const $ = c(38);
31
+ const t = useT();
32
+ const [kind, setKind] = useState("all");
33
+ const [search, setSearch] = useState("");
34
+ let t0;
35
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
36
+ t0 = {};
37
+ $[0] = t0;
38
+ } else {
39
+ t0 = $[0];
40
+ }
41
+ const {
42
+ data,
43
+ error,
44
+ errorSource,
45
+ isLoading,
46
+ refetch
47
+ } = useAdminQuery(ADMIN_FUNCTIONS.listPushSubscriptions, t0);
48
+ let t1;
49
+ if ($[1] !== data?.subscriptions || $[2] !== error || $[3] !== errorSource || $[4] !== isLoading || $[5] !== kind || $[6] !== refetch || $[7] !== search || $[8] !== t) {
50
+ const devices = data?.subscriptions ?? [];
51
+ const needle = search.trim().toLowerCase();
52
+ const filtered = devices.filter((device) => {
53
+ if (kind !== "all" && device.kind !== kind) {
54
+ return false;
55
+ }
56
+ if (needle === "") {
57
+ return true;
58
+ }
59
+ return `${deviceTarget(device)} ${device.userId ?? ""}`.toLowerCase().includes(needle);
60
+ });
61
+ let t2;
62
+ if ($[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
63
+ t2 = (event) => {
64
+ setSearch(event.target.value);
65
+ };
66
+ $[10] = t2;
67
+ } else {
68
+ t2 = $[10];
69
+ }
70
+ const onSearchChange = t2;
71
+ let t3;
72
+ if ($[11] !== refetch) {
73
+ t3 = () => {
74
+ refetch();
75
+ };
76
+ $[11] = refetch;
77
+ $[12] = t3;
78
+ } else {
79
+ t3 = $[12];
80
+ }
81
+ const onRefresh = t3;
82
+ let t4;
83
+ if ($[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
84
+ t4 = ["all", "web-push", "fcm"];
85
+ $[13] = t4;
86
+ } else {
87
+ t4 = $[13];
88
+ }
89
+ const kinds = t4;
90
+ let t5;
91
+ if ($[14] !== kind || $[15] !== t) {
92
+ t5 = /* @__PURE__ */ jsxDEV("div", {
93
+ className: "flex items-center gap-1",
94
+ "data-testid": "nt-kind-filter",
95
+ role: "tablist",
96
+ children: kinds.map((value) => /* @__PURE__ */ jsxDEV(Button, {
97
+ "aria-selected": kind === value,
98
+ "data-testid": `nt-kind-${value}`,
99
+ onClick: () => {
100
+ setKind(value);
101
+ },
102
+ role: "tab",
103
+ size: "sm",
104
+ type: "button",
105
+ variant: kind === value ? "secondary" : "ghost",
106
+ children: value === "all" ? t("All") : value
107
+ }, value, false))
108
+ }, void 0, false);
109
+ $[14] = kind;
110
+ $[15] = t;
111
+ $[16] = t5;
112
+ } else {
113
+ t5 = $[16];
114
+ }
115
+ let t6;
116
+ if ($[17] !== t) {
117
+ t6 = t("Filter devices");
118
+ $[17] = t;
119
+ $[18] = t6;
120
+ } else {
121
+ t6 = $[18];
122
+ }
123
+ let t7;
124
+ if ($[19] !== t) {
125
+ t7 = t("filter endpoint, user");
126
+ $[19] = t;
127
+ $[20] = t7;
128
+ } else {
129
+ t7 = $[20];
130
+ }
131
+ let t8;
132
+ if ($[21] !== search || $[22] !== t6 || $[23] !== t7) {
133
+ t8 = /* @__PURE__ */ jsxDEV(Input, {
134
+ "aria-label": t6,
135
+ className: "h-8 w-56",
136
+ "data-testid": "nt-search",
137
+ onChange: onSearchChange,
138
+ placeholder: t7,
139
+ value: search
140
+ }, void 0, false);
141
+ $[21] = search;
142
+ $[22] = t6;
143
+ $[23] = t7;
144
+ $[24] = t8;
145
+ } else {
146
+ t8 = $[24];
147
+ }
148
+ let t9;
149
+ if ($[25] !== t) {
150
+ t9 = t("Refresh");
151
+ $[25] = t;
152
+ $[26] = t9;
153
+ } else {
154
+ t9 = $[26];
155
+ }
156
+ let t10;
157
+ if ($[27] !== onRefresh || $[28] !== t9) {
158
+ t10 = /* @__PURE__ */ jsxDEV(Button, {
159
+ className: "ml-auto",
160
+ "data-testid": "nt-refresh",
161
+ onClick: onRefresh,
162
+ size: "sm",
163
+ type: "button",
164
+ variant: "outline",
165
+ children: t9
166
+ }, void 0, false);
167
+ $[27] = onRefresh;
168
+ $[28] = t9;
169
+ $[29] = t10;
170
+ } else {
171
+ t10 = $[29];
172
+ }
173
+ const t11 = devices.length > 0 && /* @__PURE__ */ jsxDEV(Badge, {
174
+ "data-testid": "nt-count",
175
+ variant: "secondary",
176
+ children: t("{count} devices", {
177
+ count: devices.length
178
+ })
179
+ }, void 0, false);
180
+ let t12;
181
+ if ($[30] !== t10 || $[31] !== t11 || $[32] !== t5 || $[33] !== t8) {
182
+ t12 = /* @__PURE__ */ jsxDEV("div", {
183
+ className: "flex flex-wrap items-center gap-2",
184
+ children: [t5, t8, t10, t11]
185
+ }, void 0, true);
186
+ $[30] = t10;
187
+ $[31] = t11;
188
+ $[32] = t5;
189
+ $[33] = t8;
190
+ $[34] = t12;
191
+ } else {
192
+ t12 = $[34];
193
+ }
194
+ let t13;
195
+ if ($[35] !== error || $[36] !== errorSource) {
196
+ t13 = error !== null && /* @__PURE__ */ jsxDEV(ErrorAlert, {
197
+ error: errorSource,
198
+ testId: "nt-error"
199
+ }, void 0, false);
200
+ $[35] = error;
201
+ $[36] = errorSource;
202
+ $[37] = t13;
203
+ } else {
204
+ t13 = $[37];
205
+ }
206
+ t1 = /* @__PURE__ */ jsxDEV("div", {
207
+ className: "flex flex-col gap-4",
208
+ "data-testid": "lunora-notifications",
209
+ children: [t12, t13, error === null && !isLoading && filtered.length === 0 && /* @__PURE__ */ jsxDEV(EmptyState, {
210
+ description: t("Registered Web Push / FCM devices appear here. Configure lunora/notify.ts with defineNotify({ store }) and register a device with ctx.push.register(...)."),
211
+ icon: /* @__PURE__ */ jsxDEV("svg", {
212
+ "aria-hidden": "true",
213
+ fill: "none",
214
+ stroke: "currentColor",
215
+ strokeLinecap: "round",
216
+ strokeLinejoin: "round",
217
+ strokeWidth: 1.6,
218
+ viewBox: "0 0 24 24",
219
+ children: /* @__PURE__ */ jsxDEV("path", {
220
+ d: "M15 17h5l-1.4-1.4A2 2 0 0 1 18 14.2V11a6 6 0 0 0-4-5.7V5a2 2 0 1 0-4 0v.3A6 6 0 0 0 6 11v3.2a2 2 0 0 1-.6 1.4L4 17h5m6 0v1a3 3 0 1 1-6 0v-1m6 0H9"
221
+ }, void 0, false)
222
+ }, void 0, false),
223
+ testId: "nt-empty",
224
+ title: t("No registered devices.")
225
+ }, void 0, false), filtered.length > 0 && /* @__PURE__ */ jsxDEV(Card, {
226
+ className: "overflow-hidden py-0",
227
+ children: /* @__PURE__ */ jsxDEV(CardContent, {
228
+ className: "max-h-[30rem] overflow-auto px-0",
229
+ children: /* @__PURE__ */ jsxDEV(Table, {
230
+ "data-testid": "nt-table",
231
+ children: [/* @__PURE__ */ jsxDEV(TableHeader, {
232
+ children: /* @__PURE__ */ jsxDEV(TableRow, {
233
+ children: [/* @__PURE__ */ jsxDEV(TableHead, {
234
+ children: t("kind")
235
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
236
+ children: t("endpoint")
237
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
238
+ children: t("user")
239
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
240
+ children: t("last seen")
241
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
242
+ children: t("status")
243
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
244
+ children: t("error")
245
+ }, void 0, false)]
246
+ }, void 0, true)
247
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableBody, {
248
+ children: filtered.map((device_0) => {
249
+ const target = deviceTarget(device_0);
250
+ return /* @__PURE__ */ jsxDEV(TableRow, {
251
+ "data-testid": "nt-row",
252
+ children: [/* @__PURE__ */ jsxDEV(TableCell, {
253
+ children: /* @__PURE__ */ jsxDEV(Badge, {
254
+ variant: "outline",
255
+ children: device_0.kind
256
+ }, void 0, false)
257
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
258
+ className: "max-w-[28ch] truncate font-mono text-xs",
259
+ title: target,
260
+ children: target
261
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
262
+ className: "max-w-[16ch] truncate font-mono text-xs",
263
+ children: device_0.userId ?? /* @__PURE__ */ jsxDEV("span", {
264
+ className: "text-muted-foreground",
265
+ children: "—"
266
+ }, void 0, false)
267
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
268
+ className: "text-muted-foreground tabular-nums",
269
+ children: formatTimestamp(device_0.lastSeenAt, "—")
270
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
271
+ children: /* @__PURE__ */ jsxDEV(Badge, {
272
+ "data-testid": `nt-status-${device_0.id}`,
273
+ variant: statusVariant(device_0.lastStatus),
274
+ children: device_0.lastStatus ?? t("n/a")
275
+ }, void 0, false)
276
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
277
+ className: "max-w-[28ch] truncate font-mono text-xs text-muted-foreground",
278
+ title: device_0.lastError ?? void 0,
279
+ children: device_0.lastError ?? /* @__PURE__ */ jsxDEV("span", {
280
+ className: "text-muted-foreground",
281
+ children: "—"
282
+ }, void 0, false)
283
+ }, void 0, false)]
284
+ }, device_0.id, true);
285
+ })
286
+ }, void 0, false)]
287
+ }, void 0, true)
288
+ }, void 0, false)
289
+ }, void 0, false)]
290
+ }, void 0, true);
291
+ $[1] = data?.subscriptions;
292
+ $[2] = error;
293
+ $[3] = errorSource;
294
+ $[4] = isLoading;
295
+ $[5] = kind;
296
+ $[6] = refetch;
297
+ $[7] = search;
298
+ $[8] = t;
299
+ $[9] = t1;
300
+ } else {
301
+ t1 = $[9];
302
+ }
303
+ return t1;
304
+ };
305
+
306
+ export { NotificationsPanel };
@@ -7,7 +7,7 @@ import { I as Input } from '../packem_shared/input-XH4r1Pt1.js';
7
7
  import { L as Label } from '../packem_shared/label-D8ykjn5J.js';
8
8
  import { useAutoRefresh } from '../packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js';
9
9
  import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
10
- import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-C1LXrovV.js';
10
+ import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-P2UzJscH.js';
11
11
  import { c as callOptions, e as errorMessage, f as fireAndForget, a as adminRef } from '../packem_shared/internal-DzHCc2Rq.js';
12
12
  import { jsxDEV } from 'react/jsx-dev-runtime';
13
13
 
@@ -11,7 +11,7 @@ import { E as EmptyState } from '../packem_shared/empty-state-DY_oe0k6.js';
11
11
  import { I as Input } from '../packem_shared/input-XH4r1Pt1.js';
12
12
  import useDebounced from '../packem_shared/useDebounced-Dxncpg6z.js';
13
13
  import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
14
- import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-C1LXrovV.js';
14
+ import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-P2UzJscH.js';
15
15
  import { f as fireAndForget, c as callOptions, e as errorMessage, a as adminRef } from '../packem_shared/internal-DzHCc2Rq.js';
16
16
  import { r as recordShard } from '../packem_shared/shard-history-AxiJ1WPP.js';
17
17
  import { c as cn } from '../packem_shared/utils-B05Dmz_H.js';
@@ -1,7 +1,7 @@
1
1
  import { c } from 'react/compiler-runtime';
2
2
  import { u as useAdminQuery } from '../packem_shared/use-admin-query-C7JNuQp-.js';
3
3
  import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
4
- import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-C1LXrovV.js';
4
+ import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-P2UzJscH.js';
5
5
  import { A as AdvisorView } from '../packem_shared/advisor-view-D95sN-wO.js';
6
6
  import { jsxDEV } from 'react/jsx-dev-runtime';
7
7
 
@@ -6,7 +6,7 @@ import { C as Card, a as CardContent } from '../packem_shared/card-F2vH_aj2.js';
6
6
  import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell } from '../packem_shared/table-DsCa9Qp9.js';
7
7
  import { u as useAdminQuery } from '../packem_shared/use-admin-query-C7JNuQp-.js';
8
8
  import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
9
- import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-C1LXrovV.js';
9
+ import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-P2UzJscH.js';
10
10
  import { a as CLOUDFLARE_WORKERS_URL } from '../packem_shared/cf-links-SIbyi4Y1.js';
11
11
  import { jsxDEV } from 'react/jsx-dev-runtime';
12
12
 
@@ -6,7 +6,7 @@ import { ShardInput } from '../packem_shared/ShardInput-CZnpHILL.js';
6
6
  import { A as Alert } from '../packem_shared/alert-CdAET2K_.js';
7
7
  import { c as TableHead, a as TableHeader, b as TableRow, e as TableCell, d as TableBody, T as Table } from '../packem_shared/table-DsCa9Qp9.js';
8
8
  import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
9
- import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-C1LXrovV.js';
9
+ import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-P2UzJscH.js';
10
10
  import { u as usePersistedList, n as newId, b as usePersistedValue } from '../packem_shared/browser-storage-L4gOP5gJ.js';
11
11
  import { f as fireAndForget, c as callOptions, a as adminRef, e as errorMessage } from '../packem_shared/internal-DzHCc2Rq.js';
12
12
  import { r as recordShard } from '../packem_shared/shard-history-AxiJ1WPP.js';
@@ -7,7 +7,7 @@ import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
7
7
  import { s as searchToDataView, d as dataViewToSearch } from '../packem_shared/data-view-params-Cd6yRVbv.js';
8
8
  import { f as fireAndForget } from '../packem_shared/internal-DzHCc2Rq.js';
9
9
  import { l as loadJsonArray, s as saveJson } from '../packem_shared/browser-storage-L4gOP5gJ.js';
10
- import { DataBrowser } from '../packem_shared/DataBrowser-BoinTGxr.js';
10
+ import { DataBrowser } from '../packem_shared/DataBrowser-obTn4sKX.js';
11
11
  import { GlobalDataBrowser } from '../packem_shared/GlobalDataBrowser-BCaohHZ5.js';
12
12
  import { jsxDEV } from 'react/jsx-dev-runtime';
13
13
 
@@ -7,7 +7,7 @@ import { E as EmptyState } from '../packem_shared/empty-state-DY_oe0k6.js';
7
7
  import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell } from '../packem_shared/table-DsCa9Qp9.js';
8
8
  import { u as useAdminQuery } from '../packem_shared/use-admin-query-C7JNuQp-.js';
9
9
  import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
10
- import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-C1LXrovV.js';
10
+ import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-P2UzJscH.js';
11
11
  import { i as formatTimestamp } from '../packem_shared/internal-DzHCc2Rq.js';
12
12
  import { jsxDEV } from 'react/jsx-dev-runtime';
13
13
 
@@ -0,0 +1,247 @@
1
+ import { c } from 'react/compiler-runtime';
2
+ import { useState } from 'react';
3
+ import { E as ErrorAlert } from '../packem_shared/error-alert-D9uIFJUS.js';
4
+ import { B as Badge } from '../packem_shared/badge-B2PKA1-5.js';
5
+ import { B as Button } from '../packem_shared/button-BhsN2uZH.js';
6
+ import { C as Card, a as CardContent } from '../packem_shared/card-F2vH_aj2.js';
7
+ import { E as EmptyState } from '../packem_shared/empty-state-DY_oe0k6.js';
8
+ import { I as Input } from '../packem_shared/input-XH4r1Pt1.js';
9
+ import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell } from '../packem_shared/table-DsCa9Qp9.js';
10
+ import { u as useAdminQuery } from '../packem_shared/use-admin-query-C7JNuQp-.js';
11
+ import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
12
+ import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-P2UzJscH.js';
13
+ import { i as formatTimestamp } from '../packem_shared/internal-DzHCc2Rq.js';
14
+ import { jsxDEV } from 'react/jsx-dev-runtime';
15
+
16
+ const AuthAuditPanel = () => {
17
+ const $ = c(39);
18
+ const t = useT();
19
+ const [search, setSearch] = useState("");
20
+ let t0;
21
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
22
+ t0 = {};
23
+ $[0] = t0;
24
+ } else {
25
+ t0 = $[0];
26
+ }
27
+ const {
28
+ data,
29
+ error,
30
+ errorSource,
31
+ isLoading,
32
+ refetch
33
+ } = useAdminQuery(ADMIN_FUNCTIONS.getAuthAuditLog, t0);
34
+ let t1;
35
+ if ($[1] !== data?.entries || $[2] !== search) {
36
+ const entries = data?.entries ?? [];
37
+ const needle = search.trim().toLowerCase();
38
+ t1 = needle === "" ? entries : entries.filter((entry) => entry.event.toLowerCase().includes(needle) || (entry.actorId ?? "").toLowerCase().includes(needle) || (entry.actorEmail ?? "").toLowerCase().includes(needle) || (entry.ip ?? "").toLowerCase().includes(needle) || entry.outcome.toLowerCase().includes(needle));
39
+ $[1] = data?.entries;
40
+ $[2] = search;
41
+ $[3] = t1;
42
+ } else {
43
+ t1 = $[3];
44
+ }
45
+ const filtered = t1;
46
+ let t2;
47
+ if ($[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
48
+ t2 = (event) => {
49
+ setSearch(event.target.value);
50
+ };
51
+ $[4] = t2;
52
+ } else {
53
+ t2 = $[4];
54
+ }
55
+ const onSearchChange = t2;
56
+ let t3;
57
+ if ($[5] !== t) {
58
+ t3 = t("Filter security events");
59
+ $[5] = t;
60
+ $[6] = t3;
61
+ } else {
62
+ t3 = $[6];
63
+ }
64
+ let t4;
65
+ if ($[7] !== t) {
66
+ t4 = t("filter event, actor, IP");
67
+ $[7] = t;
68
+ $[8] = t4;
69
+ } else {
70
+ t4 = $[8];
71
+ }
72
+ let t5;
73
+ if ($[9] !== search || $[10] !== t3 || $[11] !== t4) {
74
+ t5 = /* @__PURE__ */ jsxDEV(Input, {
75
+ "aria-label": t3,
76
+ className: "h-8 w-56",
77
+ "data-testid": "aa-search",
78
+ onChange: onSearchChange,
79
+ placeholder: t4,
80
+ value: search
81
+ }, void 0, false);
82
+ $[9] = search;
83
+ $[10] = t3;
84
+ $[11] = t4;
85
+ $[12] = t5;
86
+ } else {
87
+ t5 = $[12];
88
+ }
89
+ let t6;
90
+ if ($[13] !== refetch) {
91
+ t6 = () => {
92
+ refetch();
93
+ };
94
+ $[13] = refetch;
95
+ $[14] = t6;
96
+ } else {
97
+ t6 = $[14];
98
+ }
99
+ let t7;
100
+ if ($[15] !== t) {
101
+ t7 = t("Refresh");
102
+ $[15] = t;
103
+ $[16] = t7;
104
+ } else {
105
+ t7 = $[16];
106
+ }
107
+ let t8;
108
+ if ($[17] !== t6 || $[18] !== t7) {
109
+ t8 = /* @__PURE__ */ jsxDEV(Button, {
110
+ "data-testid": "aa-refresh",
111
+ onClick: t6,
112
+ size: "xs",
113
+ type: "button",
114
+ variant: "ghost",
115
+ children: t7
116
+ }, void 0, false);
117
+ $[17] = t6;
118
+ $[18] = t7;
119
+ $[19] = t8;
120
+ } else {
121
+ t8 = $[19];
122
+ }
123
+ let t9;
124
+ if ($[20] !== t5 || $[21] !== t8) {
125
+ t9 = /* @__PURE__ */ jsxDEV("div", {
126
+ className: "flex flex-wrap items-center gap-2",
127
+ children: [t5, t8]
128
+ }, void 0, true);
129
+ $[20] = t5;
130
+ $[21] = t8;
131
+ $[22] = t9;
132
+ } else {
133
+ t9 = $[22];
134
+ }
135
+ let t10;
136
+ if ($[23] !== error || $[24] !== errorSource) {
137
+ t10 = error !== null && /* @__PURE__ */ jsxDEV(ErrorAlert, {
138
+ error: errorSource,
139
+ testId: "aa-error"
140
+ }, void 0, false);
141
+ $[23] = error;
142
+ $[24] = errorSource;
143
+ $[25] = t10;
144
+ } else {
145
+ t10 = $[25];
146
+ }
147
+ let t11;
148
+ if ($[26] !== error || $[27] !== filtered.length || $[28] !== isLoading || $[29] !== t) {
149
+ t11 = error === null && !isLoading && filtered.length === 0 && /* @__PURE__ */ jsxDEV(EmptyState, {
150
+ description: t("Authentication and security events are recorded here."),
151
+ testId: "aa-empty",
152
+ title: t("No security events.")
153
+ }, void 0, false);
154
+ $[26] = error;
155
+ $[27] = filtered.length;
156
+ $[28] = isLoading;
157
+ $[29] = t;
158
+ $[30] = t11;
159
+ } else {
160
+ t11 = $[30];
161
+ }
162
+ let t12;
163
+ if ($[31] !== filtered || $[32] !== t) {
164
+ t12 = filtered.length > 0 && /* @__PURE__ */ jsxDEV(Card, {
165
+ className: "overflow-hidden py-0",
166
+ children: /* @__PURE__ */ jsxDEV(CardContent, {
167
+ className: "max-h-[30rem] overflow-auto px-0",
168
+ children: /* @__PURE__ */ jsxDEV(Table, {
169
+ "data-testid": "aa-table",
170
+ children: [/* @__PURE__ */ jsxDEV(TableHeader, {
171
+ children: /* @__PURE__ */ jsxDEV(TableRow, {
172
+ children: [/* @__PURE__ */ jsxDEV(TableHead, {
173
+ children: t("time")
174
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
175
+ children: t("event")
176
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
177
+ children: t("actor")
178
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
179
+ children: t("ip / user agent")
180
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
181
+ children: t("outcome")
182
+ }, void 0, false)]
183
+ }, void 0, true)
184
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableBody, {
185
+ children: filtered.map((entry_0) => /* @__PURE__ */ jsxDEV(TableRow, {
186
+ "data-testid": "aa-row",
187
+ children: [/* @__PURE__ */ jsxDEV(TableCell, {
188
+ className: "text-muted-foreground tabular-nums",
189
+ children: formatTimestamp(entry_0.ts, "—")
190
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
191
+ children: /* @__PURE__ */ jsxDEV(Badge, {
192
+ variant: "secondary",
193
+ children: entry_0.event
194
+ }, void 0, false)
195
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
196
+ className: "max-w-[24ch] truncate font-mono text-xs",
197
+ title: entry_0.actorId ?? void 0,
198
+ children: entry_0.actorEmail ?? entry_0.actorId ?? /* @__PURE__ */ jsxDEV("span", {
199
+ className: "text-muted-foreground",
200
+ children: "—"
201
+ }, void 0, false)
202
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
203
+ className: "max-w-[28ch] truncate text-xs text-muted-foreground",
204
+ title: entry_0.userAgent ?? void 0,
205
+ children: [entry_0.ip ?? /* @__PURE__ */ jsxDEV("span", {
206
+ className: "text-muted-foreground",
207
+ children: "—"
208
+ }, void 0, false), entry_0.userAgent !== void 0 && /* @__PURE__ */ jsxDEV("span", {
209
+ className: "ml-1 opacity-70",
210
+ children: ["· ", entry_0.userAgent]
211
+ }, void 0, true)]
212
+ }, void 0, true), /* @__PURE__ */ jsxDEV(TableCell, {
213
+ children: /* @__PURE__ */ jsxDEV(Badge, {
214
+ variant: entry_0.outcome === "failure" ? "destructive" : "outline",
215
+ children: t(entry_0.outcome)
216
+ }, void 0, false)
217
+ }, void 0, false)]
218
+ }, entry_0.seq, true))
219
+ }, void 0, false)]
220
+ }, void 0, true)
221
+ }, void 0, false)
222
+ }, void 0, false);
223
+ $[31] = filtered;
224
+ $[32] = t;
225
+ $[33] = t12;
226
+ } else {
227
+ t12 = $[33];
228
+ }
229
+ let t13;
230
+ if ($[34] !== t10 || $[35] !== t11 || $[36] !== t12 || $[37] !== t9) {
231
+ t13 = /* @__PURE__ */ jsxDEV("div", {
232
+ className: "flex flex-col gap-4",
233
+ "data-testid": "lunora-auth-audit",
234
+ children: [t9, t10, t11, t12]
235
+ }, void 0, true);
236
+ $[34] = t10;
237
+ $[35] = t11;
238
+ $[36] = t12;
239
+ $[37] = t9;
240
+ $[38] = t13;
241
+ } else {
242
+ t13 = $[38];
243
+ }
244
+ return t13;
245
+ };
246
+
247
+ export { AuthAuditPanel };
@@ -7,7 +7,7 @@ import { E as EmptyState } from '../packem_shared/empty-state-DY_oe0k6.js';
7
7
  import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell } from '../packem_shared/table-DsCa9Qp9.js';
8
8
  import { u as useAdminQuery } from '../packem_shared/use-admin-query-C7JNuQp-.js';
9
9
  import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
10
- import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-C1LXrovV.js';
10
+ import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-P2UzJscH.js';
11
11
  import { jsxDEV } from 'react/jsx-dev-runtime';
12
12
 
13
13
  const CONTAINER_LOG_PREFIX = "container:";
@@ -8,7 +8,7 @@ import { E as EmptyState } from '../packem_shared/empty-state-DY_oe0k6.js';
8
8
  import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
9
9
  import { u as usePersistedList, n as newId } from '../packem_shared/browser-storage-L4gOP5gJ.js';
10
10
  import { useLunora } from '@lunora/react';
11
- import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-C1LXrovV.js';
11
+ import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-P2UzJscH.js';
12
12
  import { c as callOptions, e as errorMessage, f as fireAndForget, a as adminRef } from '../packem_shared/internal-DzHCc2Rq.js';
13
13
  import { jsxDEV } from 'react/jsx-dev-runtime';
14
14
 
@@ -10,7 +10,7 @@ import { u as useAdminQuery } from '../packem_shared/use-admin-query-C7JNuQp-.js
10
10
  import { useAutoRefresh } from '../packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js';
11
11
  import useDebounced from '../packem_shared/useDebounced-Dxncpg6z.js';
12
12
  import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
13
- import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-C1LXrovV.js';
13
+ import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-P2UzJscH.js';
14
14
  import { jsxDEV, Fragment } from 'react/jsx-dev-runtime';
15
15
 
16
16
  const formatMs = (ms) => `${ms.toString()} ms`;
@@ -8,7 +8,7 @@ import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as Table
8
8
  import { T as Textarea } from '../packem_shared/textarea-D3gaCU_-.js';
9
9
  import { u as useAdminQuery } from '../packem_shared/use-admin-query-C7JNuQp-.js';
10
10
  import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
11
- import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-C1LXrovV.js';
11
+ import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-P2UzJscH.js';
12
12
  import { jsxDEV } from 'react/jsx-dev-runtime';
13
13
 
14
14
  const parseContext = (raw) => {