@burdenoff/microfe-bigconsole 2026.610.1 → 2026.612.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/bigconsole/components/dashboard/DashboardCanvas.js +3 -3
  2. package/dist/bigconsole/components/dashboard/DashboardCanvas.js.map +1 -1
  3. package/dist/bigconsole/components/dashboard/DashboardToolbar.js +6 -5
  4. package/dist/bigconsole/components/dashboard/DashboardToolbar.js.map +1 -1
  5. package/dist/bigconsole/components/widgets/WidgetRegistry.js +2 -1
  6. package/dist/bigconsole/components/widgets/WidgetRegistry.js.map +1 -1
  7. package/dist/bigconsole/components/widgets/event-logs/EventLogViewer.js +4 -4
  8. package/dist/bigconsole/components/widgets/event-logs/EventLogViewer.js.map +1 -1
  9. package/dist/bigconsole/components/widgets/form/FormWidget.js +20 -20
  10. package/dist/bigconsole/components/widgets/form/FormWidget.js.map +1 -1
  11. package/dist/bigconsole/components/widgets/kanban/KanbanWidget.js +1 -1
  12. package/dist/bigconsole/components/widgets/kanban/KanbanWidget.js.map +1 -1
  13. package/dist/bigconsole/components/widgets/map-widget/MapWidget.js +2 -2
  14. package/dist/bigconsole/components/widgets/map-widget/MapWidget.js.map +1 -1
  15. package/dist/bigconsole/components/widgets/timeline/TimelineWidget.js +2 -2
  16. package/dist/bigconsole/components/widgets/timeline/TimelineWidget.js.map +1 -1
  17. package/dist/bigconsole/components/widgets/webhook-config/WebhookConfigPanel.js +37 -37
  18. package/dist/bigconsole/components/widgets/webhook-config/WebhookConfigPanel.js.map +1 -1
  19. package/dist/bigconsole/hooks/useDashboardOperations.js +92 -70
  20. package/dist/bigconsole/hooks/useDashboardOperations.js.map +1 -1
  21. package/dist/bigconsole/pages/DashboardBuilderPage.js +220 -200
  22. package/dist/bigconsole/pages/DashboardBuilderPage.js.map +1 -1
  23. package/dist/bigconsole/pages/DashboardViewPage.js +11 -9
  24. package/dist/bigconsole/pages/DashboardViewPage.js.map +1 -1
  25. package/dist/bigconsole/pages/DashboardsPage.js +501 -164
  26. package/dist/bigconsole/pages/DashboardsPage.js.map +1 -1
  27. package/dist/bigconsole/pages/InsightsPage.js +783 -395
  28. package/dist/bigconsole/pages/InsightsPage.js.map +1 -1
  29. package/dist/generated/wspace-operations.js +105 -107
  30. package/dist/generated/wspace-operations.js.map +1 -1
  31. package/package.json +1 -1
@@ -2,12 +2,12 @@ import { useAppNavigate as e } from "../contexts/NavigationContext.js";
2
2
  import "../contexts/index.js";
3
3
  import { isNative as t, nativeImpact as n, nativeNotify as r } from "../../utils/nativeBridge.js";
4
4
  import { memo as i, useCallback as a, useEffect as o, useState as s } from "react";
5
- import { AlertCircle as c, ArrowRight as l, CheckCircle as u, Clock as d, Loader2 as f, Sparkles as p, Trash2 as m, XCircle as h } from "lucide-react";
6
- import { gql as g } from "@apollo/client";
7
- import { useMutation as _, useQuery as v } from "@apollo/client/react";
8
- import { jsx as y, jsxs as b } from "react/jsx-runtime";
5
+ import { AlertCircle as c, ArrowRight as l, Ban as ee, CheckCircle as u, Clock as d, Eye as f, Loader2 as p, RefreshCw as m, Sparkles as h, Trash2 as te, Wand2 as g, X as ne, XCircle as _ } from "lucide-react";
6
+ import { gql as v } from "@apollo/client";
7
+ import { useMutation as y, useQuery as b } from "@apollo/client/react";
8
+ import { jsx as x, jsxs as S } from "react/jsx-runtime";
9
9
  //#region src/bigconsole/pages/InsightsPage.tsx
10
- var x = g`
10
+ var C = v`
11
11
  query ListPromptGenerations($status: PromptGenerationStatus, $first: Int) {
12
12
  listPromptGenerations(status: $status, first: $first) {
13
13
  edges {
@@ -36,7 +36,7 @@ var x = g`
36
36
  totalCount
37
37
  }
38
38
  }
39
- `, S = g`
39
+ `, re = v`
40
40
  query GetPromptSuggestions($category: String, $limit: Int) {
41
41
  getPromptSuggestions(category: $category, limit: $limit) {
42
42
  id
@@ -47,7 +47,7 @@ var x = g`
47
47
  tags
48
48
  }
49
49
  }
50
- `, C = g`
50
+ `, ie = v`
51
51
  mutation GenerateDashboardFromPrompt($input: GenerateDashboardFromPromptInput!) {
52
52
  generateDashboardFromPrompt(input: $input) {
53
53
  id
@@ -55,42 +55,65 @@ var x = g`
55
55
  prompt
56
56
  }
57
57
  }
58
- `, w = g`
58
+ `, w = v`
59
59
  mutation CreateDashboardFromGeneration($input: CreateDashboardFromGenerationInput!) {
60
60
  createDashboardFromGeneration(input: $input) {
61
61
  id
62
62
  }
63
63
  }
64
- `, T = g`
64
+ `, T = v`
65
65
  mutation DeletePromptGeneration($generationId: ID!) {
66
66
  deletePromptGeneration(generationId: $generationId)
67
67
  }
68
- `, E = [
68
+ `, ae = v`
69
+ mutation CancelPromptGeneration($generationId: ID!) {
70
+ cancelPromptGeneration(generationId: $generationId) {
71
+ id
72
+ status
73
+ }
74
+ }
75
+ `, E = v`
76
+ mutation RegenerateDashboard($input: RegenerateDashboardInput!) {
77
+ regenerateDashboard(input: $input) {
78
+ id
79
+ status
80
+ prompt
81
+ }
82
+ }
83
+ `, oe = v`
84
+ mutation RefineGeneratedDashboard($input: RefineGeneratedDashboardInput!) {
85
+ refineGeneratedDashboard(input: $input) {
86
+ id
87
+ status
88
+ prompt
89
+ }
90
+ }
91
+ `, D = [
69
92
  "PENDING",
70
93
  "PROCESSING",
71
94
  "GENERATING"
72
95
  ];
73
- function D(e) {
96
+ function se(e) {
74
97
  switch (e) {
75
- case "COMPLETED": return /* @__PURE__ */ y(u, {
98
+ case "COMPLETED": return /* @__PURE__ */ x(u, {
76
99
  size: 16,
77
100
  className: "text-green-500"
78
101
  });
79
- case "FAILED": return /* @__PURE__ */ y(h, {
102
+ case "FAILED": return /* @__PURE__ */ x(_, {
80
103
  size: 16,
81
104
  className: "text-red-500"
82
105
  });
83
- case "CANCELLED": return /* @__PURE__ */ y(h, {
106
+ case "CANCELLED": return /* @__PURE__ */ x(_, {
84
107
  size: 16,
85
108
  className: "text-gray-400"
86
109
  });
87
110
  case "PENDING":
88
111
  case "PROCESSING":
89
- case "GENERATING": return /* @__PURE__ */ y(f, {
112
+ case "GENERATING": return /* @__PURE__ */ x(p, {
90
113
  size: 16,
91
114
  className: "text-blue-500 animate-spin"
92
115
  });
93
- default: return /* @__PURE__ */ y(d, {
116
+ default: return /* @__PURE__ */ x(d, {
94
117
  size: 16,
95
118
  className: "text-gray-400"
96
119
  });
@@ -108,483 +131,848 @@ function O(e) {
108
131
  }
109
132
  }
110
133
  var k = i(function() {
111
- let i = e(), [u, d] = s(""), [h, g] = s(!1), [k, A] = s(null), { data: j, loading: M, refetch: N } = v(x, {
134
+ let i = e(), [u, d] = s(""), [_, v] = s(!1), [k, A] = s(null), [j, M] = s(() => /* @__PURE__ */ new Set()), [N, P] = s(null), [F, I] = s(null), [L, R] = s(""), z = a((e) => {
135
+ M((t) => new Set(t).add(e));
136
+ }, []), B = a((e) => {
137
+ M((t) => {
138
+ let n = new Set(t);
139
+ return n.delete(e), n;
140
+ });
141
+ }, []), { data: V, loading: H, refetch: U } = b(C, {
112
142
  variables: { first: 20 },
113
143
  fetchPolicy: "cache-and-network"
114
- }), { data: P } = v(S, { variables: { limit: 6 } }), [F] = _(C), [I] = _(w), [L] = _(T), R = j?.listPromptGenerations?.edges?.map((e) => e.node) || [], z = P?.getPromptSuggestions || [];
144
+ }), { data: W } = b(re, { variables: { limit: 6 } }), [G] = y(ie), [K] = y(w), [q] = y(T), [J] = y(ae), [Y] = y(E), [X] = y(oe), Z = V?.listPromptGenerations?.edges?.map((e) => e.node) || [], Q = W?.getPromptSuggestions || [];
115
145
  o(() => {
116
- if (!R.some((e) => E.includes(e.status))) return;
146
+ if (!Z.some((e) => D.includes(e.status))) return;
117
147
  let e = setInterval(() => {
118
- N();
148
+ U();
119
149
  }, 3e3);
120
150
  return () => clearInterval(e);
121
- }, [R, N]);
122
- let B = a(async () => {
123
- if (!(!u.trim() || h)) {
151
+ }, [Z, U]), o(() => {
152
+ if (!N && !F) return;
153
+ let e = (e) => {
154
+ e.key === "Escape" && (P(null), I(null));
155
+ };
156
+ return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
157
+ }, [N, F]);
158
+ let $ = a(async () => {
159
+ if (!(!u.trim() || _)) {
124
160
  if (u.length > 2e3) {
125
161
  A("Prompt is too long (max 2000 characters).");
126
162
  return;
127
163
  }
128
- A(null), g(!0);
164
+ A(null), v(!0);
129
165
  try {
130
- await F({ variables: { input: {
166
+ await G({ variables: { input: {
131
167
  prompt: u.trim(),
132
168
  styleType: "MODERN",
133
169
  layoutType: "GRID",
134
170
  maxWidgets: 8
135
- } } }), d(""), N();
171
+ } } }), d(""), U();
136
172
  } catch (e) {
137
173
  A(e instanceof Error ? e.message : "Failed to generate dashboard");
138
174
  } finally {
139
- g(!1);
175
+ v(!1);
140
176
  }
141
177
  }
142
178
  }, [
143
179
  u,
144
- h,
145
- F,
146
- N
147
- ]), V = a(async (e) => {
180
+ _,
181
+ G,
182
+ U
183
+ ]), ce = a(async (e) => {
148
184
  A(null);
149
185
  try {
150
- let t = (await I({ variables: { input: { generationId: e } } })).data?.createDashboardFromGeneration?.id;
186
+ let t = (await K({ variables: { input: { generationId: e } } })).data?.createDashboardFromGeneration?.id;
151
187
  t && i(`/dashboards/${t}`);
152
188
  } catch (e) {
153
189
  A(e instanceof Error ? e.message : "Failed to create dashboard");
154
190
  }
155
- }, [I, i]), H = a(async (e) => {
191
+ }, [K, i]), le = a(async (e) => {
156
192
  A(null);
157
193
  try {
158
- await L({ variables: { generationId: e } }), t() && r("success"), N();
194
+ await q({ variables: { generationId: e } }), t() && r("success"), U();
159
195
  } catch (e) {
160
196
  A(e instanceof Error ? e.message : "Failed to delete generation"), t() && r("error");
161
197
  }
162
- }, [L, N]), U = a((e) => {
198
+ }, [q, U]), ue = a(async (e) => {
199
+ A(null), z(e);
200
+ try {
201
+ await J({ variables: { generationId: e } }), U();
202
+ } catch (e) {
203
+ A(e instanceof Error ? e.message : "Failed to cancel generation");
204
+ } finally {
205
+ B(e);
206
+ }
207
+ }, [J, U]), de = a(async (e) => {
208
+ A(null), z(e);
209
+ try {
210
+ await Y({ variables: { input: { generationId: e } } }), U();
211
+ } catch (e) {
212
+ A(e instanceof Error ? e.message : "Failed to regenerate dashboard");
213
+ } finally {
214
+ B(e);
215
+ }
216
+ }, [Y, U]), fe = a(async () => {
217
+ if (!F || !L.trim()) return;
218
+ let e = F.id;
219
+ A(null), z(e);
220
+ try {
221
+ await X({ variables: { input: {
222
+ generationId: e,
223
+ refinementPrompt: L.trim()
224
+ } } }), I(null), R(""), U();
225
+ } catch (e) {
226
+ A(e instanceof Error ? e.message : "Failed to refine generation");
227
+ } finally {
228
+ B(e);
229
+ }
230
+ }, [
231
+ F,
232
+ L,
233
+ X,
234
+ U
235
+ ]), pe = a((e) => {
163
236
  d(e);
164
237
  }, []);
165
- return /* @__PURE__ */ y("div", {
238
+ return /* @__PURE__ */ S("div", {
166
239
  style: {
167
240
  minHeight: "100vh",
168
241
  backgroundColor: "var(--color-bg-canvas)"
169
242
  },
170
- children: /* @__PURE__ */ b("div", {
171
- style: {
172
- padding: "var(--space-pagePadding)",
173
- maxWidth: 960,
174
- margin: "0 auto"
175
- },
176
- children: [
177
- /* @__PURE__ */ b("div", {
178
- style: { marginBottom: "var(--space-sectionGap)" },
179
- children: [/* @__PURE__ */ b("div", {
180
- style: {
181
- display: "flex",
182
- alignItems: "center",
183
- gap: "var(--space-iconGap)"
184
- },
185
- children: [/* @__PURE__ */ y(p, {
186
- size: 24,
187
- style: { color: "var(--color-action-primary-bg)" }
188
- }), /* @__PURE__ */ y("h1", {
243
+ children: [
244
+ /* @__PURE__ */ S("div", {
245
+ style: {
246
+ padding: "var(--space-pagePadding)",
247
+ maxWidth: 960,
248
+ margin: "0 auto"
249
+ },
250
+ children: [
251
+ /* @__PURE__ */ S("div", {
252
+ style: { marginBottom: "var(--space-sectionGap)" },
253
+ children: [/* @__PURE__ */ S("div", {
189
254
  style: {
190
- fontSize: "var(--font-size-heading-h4)",
191
- fontWeight: "var(--font-weight-bold)",
192
- color: "var(--color-text-primary)"
193
- },
194
- children: "AI Insights"
195
- })]
196
- }), /* @__PURE__ */ y("p", {
197
- style: {
198
- fontSize: "var(--font-size-body-md)",
199
- color: "var(--color-text-secondary)",
200
- marginTop: 4
201
- },
202
- children: "Generate dashboards from natural language prompts"
203
- })]
204
- }),
205
- /* @__PURE__ */ b("div", {
206
- style: {
207
- backgroundColor: "var(--color-bg-surface)",
208
- border: "1px solid var(--color-border)",
209
- borderRadius: "var(--radius-card)",
210
- padding: "var(--space-cardPadding)",
211
- marginBottom: "var(--space-sectionGap)"
212
- },
213
- children: [
214
- /* @__PURE__ */ y("label", {
215
- htmlFor: "prompt-input",
216
- style: {
217
- display: "block",
218
- fontSize: "var(--font-size-body-sm)",
219
- fontWeight: "var(--font-weight-medium)",
220
- color: "var(--color-text-primary)",
221
- marginBottom: 8
255
+ display: "flex",
256
+ alignItems: "center",
257
+ gap: "var(--space-iconGap)"
222
258
  },
223
- children: "Describe the dashboard you want to create"
224
- }),
225
- /* @__PURE__ */ y("textarea", {
226
- id: "prompt-input",
227
- value: u,
228
- onChange: (e) => d(e.target.value),
229
- placeholder: "e.g., Create a sales dashboard showing revenue trends, top products, and regional performance",
230
- rows: 3,
231
- maxLength: 2e3,
259
+ children: [/* @__PURE__ */ x(h, {
260
+ size: 24,
261
+ style: { color: "var(--color-action-primary-bg)" }
262
+ }), /* @__PURE__ */ x("h1", {
263
+ style: {
264
+ fontSize: "var(--font-size-heading-h4)",
265
+ fontWeight: "var(--font-weight-bold)",
266
+ color: "var(--color-text-primary)"
267
+ },
268
+ children: "AI Insights"
269
+ })]
270
+ }), /* @__PURE__ */ x("p", {
232
271
  style: {
233
- width: "100%",
234
- padding: "8px 12px",
235
- borderRadius: "var(--radius-button)",
236
- border: "1px solid var(--color-border)",
237
- backgroundColor: "var(--color-bg-canvas)",
238
- color: "var(--color-text-primary)",
239
272
  fontSize: "var(--font-size-body-md)",
240
- resize: "vertical",
241
- outline: "none"
242
- },
243
- onKeyDown: (e) => {
244
- e.key === "Enter" && (e.metaKey || e.ctrlKey) && B();
245
- }
246
- }),
247
- /* @__PURE__ */ b("div", {
248
- style: {
249
- display: "flex",
250
- justifyContent: "space-between",
251
- alignItems: "center",
252
- marginTop: 8,
253
- flexWrap: "wrap",
254
- gap: 8
273
+ color: "var(--color-text-secondary)",
274
+ marginTop: 4
255
275
  },
256
- children: [/* @__PURE__ */ y("span", {
276
+ children: "Generate dashboards from natural language prompts"
277
+ })]
278
+ }),
279
+ /* @__PURE__ */ S("div", {
280
+ style: {
281
+ backgroundColor: "var(--color-bg-surface)",
282
+ border: "1px solid var(--color-border)",
283
+ borderRadius: "var(--radius-card)",
284
+ padding: "var(--space-cardPadding)",
285
+ marginBottom: "var(--space-sectionGap)"
286
+ },
287
+ children: [
288
+ /* @__PURE__ */ x("label", {
289
+ htmlFor: "prompt-input",
257
290
  style: {
291
+ display: "block",
258
292
  fontSize: "var(--font-size-body-sm)",
259
- color: "var(--color-text-muted)"
293
+ fontWeight: "var(--font-weight-medium)",
294
+ color: "var(--color-text-primary)",
295
+ marginBottom: 8
296
+ },
297
+ children: "Describe the dashboard you want to create"
298
+ }),
299
+ /* @__PURE__ */ x("textarea", {
300
+ id: "prompt-input",
301
+ value: u,
302
+ onChange: (e) => d(e.target.value),
303
+ placeholder: "e.g., Create a sales dashboard showing revenue trends, top products, and regional performance",
304
+ rows: 3,
305
+ maxLength: 2e3,
306
+ style: {
307
+ width: "100%",
308
+ padding: "8px 12px",
309
+ borderRadius: "var(--radius-button)",
310
+ border: "1px solid var(--color-border)",
311
+ backgroundColor: "var(--color-bg-canvas)",
312
+ color: "var(--color-text-primary)",
313
+ fontSize: "var(--font-size-body-md)",
314
+ resize: "vertical",
315
+ outline: "none"
260
316
  },
261
- children: "Press Ctrl+Enter to generate"
262
- }), /* @__PURE__ */ b("button", {
263
- onClick: B,
264
- disabled: !u.trim() || h,
317
+ onKeyDown: (e) => {
318
+ e.key === "Enter" && (e.metaKey || e.ctrlKey) && $();
319
+ }
320
+ }),
321
+ /* @__PURE__ */ S("div", {
265
322
  style: {
266
323
  display: "flex",
324
+ justifyContent: "space-between",
267
325
  alignItems: "center",
268
- gap: 8,
269
- padding: "8px 16px",
270
- borderRadius: "var(--radius-button)",
271
- backgroundColor: "var(--color-action-primary-bg)",
272
- color: "var(--color-action-primary-text)",
273
- fontWeight: "var(--font-weight-medium)",
274
- fontSize: "var(--font-size-body-sm)",
275
- border: "none",
276
- cursor: !u.trim() || h ? "not-allowed" : "pointer",
277
- opacity: !u.trim() || h ? .5 : 1
326
+ marginTop: 8,
327
+ flexWrap: "wrap",
328
+ gap: 8
278
329
  },
279
- children: [h ? /* @__PURE__ */ y(f, {
280
- size: 16,
281
- className: "animate-spin"
282
- }) : /* @__PURE__ */ y(p, { size: 16 }), "Generate Dashboard"]
283
- })]
284
- })
285
- ]
286
- }),
287
- k && /* @__PURE__ */ b("div", {
288
- style: {
289
- display: "flex",
290
- alignItems: "center",
291
- justifyContent: "space-between",
292
- gap: 8,
293
- padding: "10px 16px",
294
- marginBottom: "var(--space-sectionGap)",
295
- borderRadius: "var(--radius-card)",
296
- border: "1px solid var(--color-status-error-text)",
297
- backgroundColor: "var(--color-bg-surface)",
298
- color: "var(--color-status-error-text)",
299
- fontSize: "var(--font-size-body-sm)"
300
- },
301
- children: [/* @__PURE__ */ b("div", {
330
+ children: [/* @__PURE__ */ x("span", {
331
+ style: {
332
+ fontSize: "var(--font-size-body-sm)",
333
+ color: "var(--color-text-muted)"
334
+ },
335
+ children: "Press Ctrl+Enter to generate"
336
+ }), /* @__PURE__ */ S("button", {
337
+ onClick: $,
338
+ disabled: !u.trim() || _,
339
+ style: {
340
+ display: "flex",
341
+ alignItems: "center",
342
+ gap: 8,
343
+ padding: "8px 16px",
344
+ borderRadius: "var(--radius-button)",
345
+ backgroundColor: "var(--color-action-primary-bg)",
346
+ color: "var(--color-action-primary-text)",
347
+ fontWeight: "var(--font-weight-medium)",
348
+ fontSize: "var(--font-size-body-sm)",
349
+ border: "none",
350
+ cursor: !u.trim() || _ ? "not-allowed" : "pointer",
351
+ opacity: !u.trim() || _ ? .5 : 1
352
+ },
353
+ children: [_ ? /* @__PURE__ */ x(p, {
354
+ size: 16,
355
+ className: "animate-spin"
356
+ }) : /* @__PURE__ */ x(h, { size: 16 }), "Generate Dashboard"]
357
+ })]
358
+ })
359
+ ]
360
+ }),
361
+ k && /* @__PURE__ */ S("div", {
302
362
  style: {
303
363
  display: "flex",
304
364
  alignItems: "center",
305
- gap: 8
306
- },
307
- children: [/* @__PURE__ */ y(c, { size: 16 }), k]
308
- }), /* @__PURE__ */ y("button", {
309
- onClick: () => A(null),
310
- style: {
311
- background: "none",
312
- border: "none",
365
+ justifyContent: "space-between",
366
+ gap: 8,
367
+ padding: "10px 16px",
368
+ marginBottom: "var(--space-sectionGap)",
369
+ borderRadius: "var(--radius-card)",
370
+ border: "1px solid var(--color-status-error-text)",
371
+ backgroundColor: "var(--color-bg-surface)",
313
372
  color: "var(--color-status-error-text)",
314
- cursor: "pointer",
315
- fontSize: "var(--font-size-body-md)",
316
- padding: "0 4px"
373
+ fontSize: "var(--font-size-body-sm)"
317
374
  },
318
- "aria-label": "Dismiss error",
319
- children: "×"
320
- })]
321
- }),
322
- z.length > 0 && /* @__PURE__ */ b("div", {
323
- style: { marginBottom: "var(--space-sectionGap)" },
324
- children: [/* @__PURE__ */ y("h2", {
375
+ children: [/* @__PURE__ */ S("div", {
376
+ style: {
377
+ display: "flex",
378
+ alignItems: "center",
379
+ gap: 8
380
+ },
381
+ children: [/* @__PURE__ */ x(c, { size: 16 }), k]
382
+ }), /* @__PURE__ */ x("button", {
383
+ onClick: () => A(null),
384
+ style: {
385
+ background: "none",
386
+ border: "none",
387
+ color: "var(--color-status-error-text)",
388
+ cursor: "pointer",
389
+ fontSize: "var(--font-size-body-md)",
390
+ padding: "0 4px"
391
+ },
392
+ "aria-label": "Dismiss error",
393
+ children: "×"
394
+ })]
395
+ }),
396
+ Q.length > 0 && /* @__PURE__ */ S("div", {
397
+ style: { marginBottom: "var(--space-sectionGap)" },
398
+ children: [/* @__PURE__ */ x("h2", {
399
+ style: {
400
+ fontSize: "var(--font-size-body-md)",
401
+ fontWeight: "var(--font-weight-semibold)",
402
+ color: "var(--color-text-primary)",
403
+ marginBottom: 12
404
+ },
405
+ children: "Suggestions"
406
+ }), /* @__PURE__ */ x("div", {
407
+ style: {
408
+ display: "grid",
409
+ gridTemplateColumns: "repeat(auto-fill, minmax(min(280px, 100%), 1fr))",
410
+ gap: 12
411
+ },
412
+ children: Q.map((e) => /* @__PURE__ */ S("button", {
413
+ onClick: () => pe(e.prompt),
414
+ style: {
415
+ textAlign: "left",
416
+ padding: 12,
417
+ borderRadius: "var(--radius-card)",
418
+ border: "1px solid var(--color-border)",
419
+ backgroundColor: "var(--color-bg-surface)",
420
+ cursor: "pointer"
421
+ },
422
+ children: [
423
+ /* @__PURE__ */ x("div", {
424
+ style: {
425
+ fontWeight: "var(--font-weight-medium)",
426
+ fontSize: "var(--font-size-body-sm)",
427
+ color: "var(--color-text-primary)",
428
+ marginBottom: 4
429
+ },
430
+ children: e.title
431
+ }),
432
+ /* @__PURE__ */ x("div", {
433
+ style: {
434
+ fontSize: "var(--font-size-body-sm)",
435
+ color: "var(--color-text-secondary)",
436
+ lineHeight: 1.4
437
+ },
438
+ children: e.exampleDescription || e.prompt.slice(0, 80)
439
+ }),
440
+ /* @__PURE__ */ x("div", {
441
+ style: {
442
+ display: "flex",
443
+ gap: 4,
444
+ marginTop: 8,
445
+ flexWrap: "wrap"
446
+ },
447
+ children: e.tags.slice(0, 3).map((e) => /* @__PURE__ */ x("span", {
448
+ style: {
449
+ fontSize: 11,
450
+ padding: "2px 6px",
451
+ borderRadius: 4,
452
+ backgroundColor: "var(--color-bg-sunken)",
453
+ color: "var(--color-text-muted)"
454
+ },
455
+ children: e
456
+ }, e))
457
+ })
458
+ ]
459
+ }, e.id))
460
+ })]
461
+ }),
462
+ /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("h2", {
325
463
  style: {
326
464
  fontSize: "var(--font-size-body-md)",
327
465
  fontWeight: "var(--font-weight-semibold)",
328
466
  color: "var(--color-text-primary)",
329
467
  marginBottom: 12
330
468
  },
331
- children: "Suggestions"
332
- }), /* @__PURE__ */ y("div", {
469
+ children: "Recent Generations"
470
+ }), H && Z.length === 0 ? /* @__PURE__ */ S("div", {
471
+ style: {
472
+ textAlign: "center",
473
+ padding: 40,
474
+ color: "var(--color-text-muted)"
475
+ },
476
+ children: [/* @__PURE__ */ x(p, {
477
+ size: 24,
478
+ className: "animate-spin",
479
+ style: { margin: "0 auto 8px" }
480
+ }), /* @__PURE__ */ x("p", { children: "Loading generations..." })]
481
+ }) : Z.length === 0 ? /* @__PURE__ */ S("div", {
482
+ style: {
483
+ textAlign: "center",
484
+ padding: 40,
485
+ backgroundColor: "var(--color-bg-surface)",
486
+ border: "1px solid var(--color-border)",
487
+ borderRadius: "var(--radius-card)"
488
+ },
489
+ children: [
490
+ /* @__PURE__ */ x(h, {
491
+ size: 32,
492
+ style: {
493
+ color: "var(--color-text-muted)",
494
+ margin: "0 auto 8px"
495
+ }
496
+ }),
497
+ /* @__PURE__ */ x("p", {
498
+ style: {
499
+ color: "var(--color-text-secondary)",
500
+ fontWeight: "var(--font-weight-medium)"
501
+ },
502
+ children: "No generations yet"
503
+ }),
504
+ /* @__PURE__ */ x("p", {
505
+ style: {
506
+ color: "var(--color-text-muted)",
507
+ fontSize: "var(--font-size-body-sm)",
508
+ marginTop: 4
509
+ },
510
+ children: "Describe a dashboard above to get started"
511
+ })
512
+ ]
513
+ }) : /* @__PURE__ */ x("div", {
333
514
  style: {
334
- display: "grid",
335
- gridTemplateColumns: "repeat(auto-fill, minmax(min(280px, 100%), 1fr))",
515
+ display: "flex",
516
+ flexDirection: "column",
336
517
  gap: 12
337
518
  },
338
- children: z.map((e) => /* @__PURE__ */ b("button", {
339
- onClick: () => U(e.prompt),
519
+ children: Z.map((e) => /* @__PURE__ */ x("div", {
340
520
  style: {
341
- textAlign: "left",
342
- padding: 12,
521
+ padding: 16,
343
522
  borderRadius: "var(--radius-card)",
344
523
  border: "1px solid var(--color-border)",
345
- backgroundColor: "var(--color-bg-surface)",
346
- cursor: "pointer"
524
+ backgroundColor: "var(--color-bg-surface)"
347
525
  },
348
- children: [
349
- /* @__PURE__ */ y("div", {
350
- style: {
351
- fontWeight: "var(--font-weight-medium)",
352
- fontSize: "var(--font-size-body-sm)",
353
- color: "var(--color-text-primary)",
354
- marginBottom: 4
355
- },
356
- children: e.title
357
- }),
358
- /* @__PURE__ */ y("div", {
526
+ children: /* @__PURE__ */ S("div", {
527
+ style: {
528
+ display: "flex",
529
+ justifyContent: "space-between",
530
+ alignItems: "flex-start",
531
+ flexWrap: "wrap",
532
+ gap: 8
533
+ },
534
+ children: [/* @__PURE__ */ S("div", {
359
535
  style: {
360
- fontSize: "var(--font-size-body-sm)",
361
- color: "var(--color-text-secondary)",
362
- lineHeight: 1.4
536
+ flex: "1 1 200px",
537
+ minWidth: 0
363
538
  },
364
- children: e.exampleDescription || e.prompt.slice(0, 80)
365
- }),
366
- /* @__PURE__ */ y("div", {
539
+ children: [
540
+ /* @__PURE__ */ S("div", {
541
+ style: {
542
+ display: "flex",
543
+ alignItems: "center",
544
+ gap: 8,
545
+ marginBottom: 4,
546
+ minWidth: 0
547
+ },
548
+ children: [
549
+ se(e.status),
550
+ /* @__PURE__ */ x("span", {
551
+ style: {
552
+ fontSize: "var(--font-size-body-sm)",
553
+ fontWeight: "var(--font-weight-medium)",
554
+ color: "var(--color-text-primary)",
555
+ minWidth: 0,
556
+ overflow: "hidden",
557
+ textOverflow: "ellipsis",
558
+ whiteSpace: "nowrap"
559
+ },
560
+ children: e.generatedSpec?.name || "Generating..."
561
+ }),
562
+ /* @__PURE__ */ x("span", {
563
+ style: {
564
+ fontSize: 11,
565
+ color: "var(--color-text-muted)",
566
+ padding: "2px 6px",
567
+ borderRadius: 4,
568
+ backgroundColor: "var(--color-bg-sunken)"
569
+ },
570
+ children: O(e.status)
571
+ })
572
+ ]
573
+ }),
574
+ /* @__PURE__ */ x("p", {
575
+ style: {
576
+ fontSize: "var(--font-size-body-sm)",
577
+ color: "var(--color-text-secondary)",
578
+ marginBottom: 4
579
+ },
580
+ children: e.prompt.length > 120 ? e.prompt.slice(0, 120) + "..." : e.prompt
581
+ }),
582
+ e.generatedSpec && /* @__PURE__ */ S("div", {
583
+ style: {
584
+ fontSize: 11,
585
+ color: "var(--color-text-muted)"
586
+ },
587
+ children: [
588
+ e.generatedSpec.pages.reduce((e, t) => e + t.widgets.length, 0),
589
+ " widgets across",
590
+ " ",
591
+ e.generatedSpec.pages.length,
592
+ " page(s) ·",
593
+ " ",
594
+ Math.round(e.generatedSpec.overallConfidence * 100),
595
+ "% confidence"
596
+ ]
597
+ }),
598
+ e.errorMessage && /* @__PURE__ */ S("div", {
599
+ style: {
600
+ display: "flex",
601
+ alignItems: "center",
602
+ gap: 4,
603
+ marginTop: 4,
604
+ fontSize: "var(--font-size-body-sm)",
605
+ color: "var(--color-status-error-text)"
606
+ },
607
+ children: [/* @__PURE__ */ x(c, { size: 14 }), e.errorMessage]
608
+ })
609
+ ]
610
+ }), /* @__PURE__ */ S("div", {
367
611
  style: {
368
612
  display: "flex",
369
- gap: 4,
370
- marginTop: 8,
613
+ gap: 8,
371
614
  flexWrap: "wrap"
372
615
  },
373
- children: e.tags.slice(0, 3).map((e) => /* @__PURE__ */ y("span", {
374
- style: {
375
- fontSize: 11,
376
- padding: "2px 6px",
377
- borderRadius: 4,
378
- backgroundColor: "var(--color-bg-sunken)",
379
- color: "var(--color-text-muted)"
380
- },
381
- children: e
382
- }, e))
383
- })
384
- ]
616
+ children: [
617
+ D.includes(e.status) && /* @__PURE__ */ S("button", {
618
+ onClick: () => {
619
+ n("medium"), ue(e.id);
620
+ },
621
+ disabled: j.has(e.id),
622
+ title: "Cancel generation",
623
+ style: {
624
+ display: "flex",
625
+ alignItems: "center",
626
+ gap: 4,
627
+ padding: "6px 12px",
628
+ borderRadius: "var(--radius-button)",
629
+ border: "1px solid var(--color-border)",
630
+ backgroundColor: "transparent",
631
+ color: "var(--color-status-warning-text)",
632
+ fontSize: "var(--font-size-body-sm)",
633
+ cursor: j.has(e.id) ? "wait" : "pointer"
634
+ },
635
+ children: [/* @__PURE__ */ x(ee, { size: 14 }), " Cancel"]
636
+ }),
637
+ e.status === "COMPLETED" && e.generatedSpec && /* @__PURE__ */ S("button", {
638
+ onClick: () => P(e),
639
+ title: "Preview proposed layout",
640
+ style: {
641
+ display: "flex",
642
+ alignItems: "center",
643
+ gap: 4,
644
+ padding: "6px 12px",
645
+ borderRadius: "var(--radius-button)",
646
+ border: "1px solid var(--color-border)",
647
+ backgroundColor: "transparent",
648
+ color: "var(--color-text-primary)",
649
+ fontSize: "var(--font-size-body-sm)",
650
+ cursor: "pointer"
651
+ },
652
+ children: [/* @__PURE__ */ x(f, { size: 14 }), " Preview"]
653
+ }),
654
+ e.status === "COMPLETED" && e.generatedSpec && /* @__PURE__ */ S("button", {
655
+ onClick: () => {
656
+ I(e), R("");
657
+ },
658
+ title: "Refine with instructions",
659
+ style: {
660
+ display: "flex",
661
+ alignItems: "center",
662
+ gap: 4,
663
+ padding: "6px 12px",
664
+ borderRadius: "var(--radius-button)",
665
+ border: "1px solid var(--color-border)",
666
+ backgroundColor: "transparent",
667
+ color: "var(--color-text-primary)",
668
+ fontSize: "var(--font-size-body-sm)",
669
+ cursor: "pointer"
670
+ },
671
+ children: [/* @__PURE__ */ x(g, { size: 14 }), " Refine"]
672
+ }),
673
+ (e.status === "COMPLETED" || e.status === "FAILED" || e.status === "CANCELLED") && /* @__PURE__ */ S("button", {
674
+ onClick: () => {
675
+ n("medium"), de(e.id);
676
+ },
677
+ disabled: j.has(e.id),
678
+ title: "Regenerate with the same prompt",
679
+ style: {
680
+ display: "flex",
681
+ alignItems: "center",
682
+ gap: 4,
683
+ padding: "6px 12px",
684
+ borderRadius: "var(--radius-button)",
685
+ border: "1px solid var(--color-border)",
686
+ backgroundColor: "transparent",
687
+ color: "var(--color-text-primary)",
688
+ fontSize: "var(--font-size-body-sm)",
689
+ cursor: j.has(e.id) ? "wait" : "pointer"
690
+ },
691
+ children: [/* @__PURE__ */ x(m, {
692
+ size: 14,
693
+ className: j.has(e.id) ? "animate-spin" : ""
694
+ }), " Regenerate"]
695
+ }),
696
+ e.status === "COMPLETED" && !e.dashboardId && /* @__PURE__ */ S("button", {
697
+ onClick: () => ce(e.id),
698
+ style: {
699
+ display: "flex",
700
+ alignItems: "center",
701
+ gap: 4,
702
+ padding: "6px 12px",
703
+ borderRadius: "var(--radius-button)",
704
+ backgroundColor: "var(--color-action-primary-bg)",
705
+ color: "var(--color-action-primary-text)",
706
+ border: "none",
707
+ fontSize: "var(--font-size-body-sm)",
708
+ cursor: "pointer"
709
+ },
710
+ children: ["Create ", /* @__PURE__ */ x(l, { size: 14 })]
711
+ }),
712
+ e.dashboardId && /* @__PURE__ */ S("button", {
713
+ onClick: () => i(`/dashboards/${e.dashboardId}`),
714
+ style: {
715
+ display: "flex",
716
+ alignItems: "center",
717
+ gap: 4,
718
+ padding: "6px 12px",
719
+ borderRadius: "var(--radius-button)",
720
+ border: "1px solid var(--color-border)",
721
+ backgroundColor: "transparent",
722
+ color: "var(--color-text-primary)",
723
+ fontSize: "var(--font-size-body-sm)",
724
+ cursor: "pointer"
725
+ },
726
+ children: ["View Dashboard ", /* @__PURE__ */ x(l, { size: 14 })]
727
+ }),
728
+ /* @__PURE__ */ x("button", {
729
+ onClick: () => {
730
+ n("medium"), le(e.id);
731
+ },
732
+ title: "Delete generation",
733
+ style: {
734
+ display: "flex",
735
+ alignItems: "center",
736
+ padding: 6,
737
+ borderRadius: "var(--radius-button)",
738
+ border: "1px solid var(--color-border)",
739
+ backgroundColor: "transparent",
740
+ color: "var(--color-text-muted)",
741
+ cursor: "pointer"
742
+ },
743
+ children: /* @__PURE__ */ x(te, { size: 14 })
744
+ })
745
+ ]
746
+ })]
747
+ })
385
748
  }, e.id))
386
- })]
387
- }),
388
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("h2", {
389
- style: {
390
- fontSize: "var(--font-size-body-md)",
391
- fontWeight: "var(--font-weight-semibold)",
392
- color: "var(--color-text-primary)",
393
- marginBottom: 12
394
- },
395
- children: "Recent Generations"
396
- }), M && R.length === 0 ? /* @__PURE__ */ b("div", {
749
+ })] })
750
+ ]
751
+ }),
752
+ N?.generatedSpec && /* @__PURE__ */ x("div", {
753
+ role: "dialog",
754
+ "aria-modal": "true",
755
+ "aria-label": "Generation preview",
756
+ onClick: () => P(null),
757
+ style: {
758
+ position: "fixed",
759
+ inset: 0,
760
+ zIndex: 1e3,
761
+ backgroundColor: "var(--color-overlay-scrim)",
762
+ display: "flex",
763
+ alignItems: "center",
764
+ justifyContent: "center",
765
+ padding: "var(--space-pagePadding)"
766
+ },
767
+ children: /* @__PURE__ */ S("div", {
768
+ onClick: (e) => e.stopPropagation(),
397
769
  style: {
398
- textAlign: "center",
399
- padding: 40,
400
- color: "var(--color-text-muted)"
401
- },
402
- children: [/* @__PURE__ */ y(f, {
403
- size: 24,
404
- className: "animate-spin",
405
- style: { margin: "0 auto 8px" }
406
- }), /* @__PURE__ */ y("p", { children: "Loading generations..." })]
407
- }) : R.length === 0 ? /* @__PURE__ */ b("div", {
408
- style: {
409
- textAlign: "center",
410
- padding: 40,
770
+ width: "min(640px, 100%)",
771
+ maxHeight: "80vh",
772
+ overflowY: "auto",
411
773
  backgroundColor: "var(--color-bg-surface)",
774
+ borderRadius: "var(--radius-card)",
412
775
  border: "1px solid var(--color-border)",
413
- borderRadius: "var(--radius-card)"
776
+ boxShadow: "var(--shadow-elevation-3)",
777
+ padding: "var(--space-cardPadding)"
414
778
  },
415
779
  children: [
416
- /* @__PURE__ */ y(p, {
417
- size: 32,
418
- style: {
419
- color: "var(--color-text-muted)",
420
- margin: "0 auto 8px"
421
- }
422
- }),
423
- /* @__PURE__ */ y("p", {
780
+ /* @__PURE__ */ S("div", {
424
781
  style: {
425
- color: "var(--color-text-secondary)",
426
- fontWeight: "var(--font-weight-medium)"
782
+ display: "flex",
783
+ justifyContent: "space-between",
784
+ alignItems: "flex-start",
785
+ gap: 8,
786
+ marginBottom: "var(--space-controlGap)"
427
787
  },
428
- children: "No generations yet"
788
+ children: [/* @__PURE__ */ S("div", {
789
+ style: { minWidth: 0 },
790
+ children: [/* @__PURE__ */ x("h3", {
791
+ style: {
792
+ fontSize: "var(--font-size-heading-h4)",
793
+ fontWeight: "var(--font-weight-semibold)"
794
+ },
795
+ children: N.generatedSpec.name
796
+ }), N.generatedSpec.description && /* @__PURE__ */ x("p", {
797
+ style: {
798
+ fontSize: "var(--font-size-body-sm)",
799
+ color: "var(--color-text-muted)",
800
+ marginTop: 2
801
+ },
802
+ children: N.generatedSpec.description
803
+ })]
804
+ }), /* @__PURE__ */ x("button", {
805
+ onClick: () => P(null),
806
+ "aria-label": "Close preview",
807
+ style: {
808
+ display: "flex",
809
+ padding: 4,
810
+ borderRadius: "var(--radius-button)",
811
+ border: "none",
812
+ backgroundColor: "transparent",
813
+ color: "var(--color-text-muted)",
814
+ cursor: "pointer"
815
+ },
816
+ children: /* @__PURE__ */ x(ne, { size: 18 })
817
+ })]
429
818
  }),
430
- /* @__PURE__ */ y("p", {
819
+ /* @__PURE__ */ S("div", {
431
820
  style: {
821
+ fontSize: 11,
432
822
  color: "var(--color-text-muted)",
433
- fontSize: "var(--font-size-body-sm)",
434
- marginTop: 4
823
+ marginBottom: "var(--space-controlGap)"
435
824
  },
436
- children: "Describe a dashboard above to get started"
437
- })
825
+ children: [
826
+ N.generatedSpec.pages.reduce((e, t) => e + t.widgets.length, 0),
827
+ " widgets across",
828
+ " ",
829
+ N.generatedSpec.pages.length,
830
+ " page(s) ·",
831
+ " ",
832
+ Math.round(N.generatedSpec.overallConfidence * 100),
833
+ "% confidence"
834
+ ]
835
+ }),
836
+ N.generatedSpec.pages.map((e, t) => /* @__PURE__ */ S("div", {
837
+ style: { marginBottom: "var(--space-controlGap)" },
838
+ children: [/* @__PURE__ */ x("div", {
839
+ style: {
840
+ fontSize: "var(--font-size-body-sm)",
841
+ fontWeight: "var(--font-weight-medium)",
842
+ color: "var(--color-text-primary)",
843
+ marginBottom: 4
844
+ },
845
+ children: e.name
846
+ }), /* @__PURE__ */ x("div", {
847
+ style: {
848
+ display: "flex",
849
+ flexWrap: "wrap",
850
+ gap: 6
851
+ },
852
+ children: e.widgets.map((e, t) => /* @__PURE__ */ S("span", {
853
+ style: {
854
+ fontSize: 11,
855
+ padding: "3px 8px",
856
+ borderRadius: "var(--radius-pill)",
857
+ backgroundColor: "var(--color-bg-sunken)",
858
+ color: "var(--color-text-secondary)"
859
+ },
860
+ children: [
861
+ e.title,
862
+ " · ",
863
+ e.type
864
+ ]
865
+ }, t))
866
+ })]
867
+ }, t))
438
868
  ]
439
- }) : /* @__PURE__ */ y("div", {
869
+ })
870
+ }),
871
+ F && /* @__PURE__ */ x("div", {
872
+ role: "dialog",
873
+ "aria-modal": "true",
874
+ "aria-label": "Refine generation",
875
+ onClick: () => I(null),
876
+ style: {
877
+ position: "fixed",
878
+ inset: 0,
879
+ zIndex: 1e3,
880
+ backgroundColor: "var(--color-overlay-scrim)",
881
+ display: "flex",
882
+ alignItems: "center",
883
+ justifyContent: "center",
884
+ padding: "var(--space-pagePadding)"
885
+ },
886
+ children: /* @__PURE__ */ S("div", {
887
+ onClick: (e) => e.stopPropagation(),
440
888
  style: {
441
- display: "flex",
442
- flexDirection: "column",
443
- gap: 12
889
+ width: "min(520px, 100%)",
890
+ backgroundColor: "var(--color-bg-surface)",
891
+ borderRadius: "var(--radius-card)",
892
+ border: "1px solid var(--color-border)",
893
+ boxShadow: "var(--shadow-elevation-3)",
894
+ padding: "var(--space-cardPadding)"
444
895
  },
445
- children: R.map((e) => /* @__PURE__ */ y("div", {
446
- style: {
447
- padding: 16,
448
- borderRadius: "var(--radius-card)",
449
- border: "1px solid var(--color-border)",
450
- backgroundColor: "var(--color-bg-surface)"
451
- },
452
- children: /* @__PURE__ */ b("div", {
896
+ children: [
897
+ /* @__PURE__ */ x("h3", {
898
+ style: {
899
+ fontSize: "var(--font-size-heading-h4)",
900
+ fontWeight: "var(--font-weight-semibold)",
901
+ marginBottom: 4
902
+ },
903
+ children: "Refine dashboard"
904
+ }),
905
+ /* @__PURE__ */ x("p", {
906
+ style: {
907
+ fontSize: "var(--font-size-body-sm)",
908
+ color: "var(--color-text-muted)",
909
+ marginBottom: "var(--space-controlGap)"
910
+ },
911
+ children: "Describe what to change — the AI keeps the existing spec and applies your instructions."
912
+ }),
913
+ /* @__PURE__ */ x("textarea", {
914
+ value: L,
915
+ onChange: (e) => R(e.target.value),
916
+ maxLength: 2e3,
917
+ rows: 4,
918
+ placeholder: "e.g., Add a revenue-by-region map and remove the duplicate KPI cards",
919
+ style: {
920
+ width: "100%",
921
+ resize: "vertical",
922
+ padding: "var(--space-inputPadding, 8px)",
923
+ borderRadius: "var(--radius-input)",
924
+ border: "1px solid var(--color-border)",
925
+ backgroundColor: "var(--color-bg-canvas)",
926
+ color: "var(--color-text-primary)",
927
+ fontSize: "var(--font-size-body-sm)",
928
+ marginBottom: "var(--space-controlGap)"
929
+ }
930
+ }),
931
+ /* @__PURE__ */ S("div", {
453
932
  style: {
454
933
  display: "flex",
455
- justifyContent: "space-between",
456
- alignItems: "flex-start"
934
+ justifyContent: "flex-end",
935
+ gap: 8,
936
+ flexWrap: "wrap"
457
937
  },
458
- children: [/* @__PURE__ */ b("div", {
459
- style: { flex: 1 },
460
- children: [
461
- /* @__PURE__ */ b("div", {
462
- style: {
463
- display: "flex",
464
- alignItems: "center",
465
- gap: 8,
466
- marginBottom: 4
467
- },
468
- children: [
469
- D(e.status),
470
- /* @__PURE__ */ y("span", {
471
- style: {
472
- fontSize: "var(--font-size-body-sm)",
473
- fontWeight: "var(--font-weight-medium)",
474
- color: "var(--color-text-primary)"
475
- },
476
- children: e.generatedSpec?.name || "Generating..."
477
- }),
478
- /* @__PURE__ */ y("span", {
479
- style: {
480
- fontSize: 11,
481
- color: "var(--color-text-muted)",
482
- padding: "2px 6px",
483
- borderRadius: 4,
484
- backgroundColor: "var(--color-bg-sunken)"
485
- },
486
- children: O(e.status)
487
- })
488
- ]
489
- }),
490
- /* @__PURE__ */ y("p", {
491
- style: {
492
- fontSize: "var(--font-size-body-sm)",
493
- color: "var(--color-text-secondary)",
494
- marginBottom: 4
495
- },
496
- children: e.prompt.length > 120 ? e.prompt.slice(0, 120) + "..." : e.prompt
497
- }),
498
- e.generatedSpec && /* @__PURE__ */ b("div", {
499
- style: {
500
- fontSize: 11,
501
- color: "var(--color-text-muted)"
502
- },
503
- children: [
504
- e.generatedSpec.pages.reduce((e, t) => e + t.widgets.length, 0),
505
- " widgets across",
506
- " ",
507
- e.generatedSpec.pages.length,
508
- " page(s) ·",
509
- " ",
510
- Math.round(e.generatedSpec.overallConfidence * 100),
511
- "% confidence"
512
- ]
513
- }),
514
- e.errorMessage && /* @__PURE__ */ b("div", {
515
- style: {
516
- display: "flex",
517
- alignItems: "center",
518
- gap: 4,
519
- marginTop: 4,
520
- fontSize: "var(--font-size-body-sm)",
521
- color: "var(--color-status-error-text)"
522
- },
523
- children: [/* @__PURE__ */ y(c, { size: 14 }), e.errorMessage]
524
- })
525
- ]
526
- }), /* @__PURE__ */ b("div", {
938
+ children: [/* @__PURE__ */ x("button", {
939
+ onClick: () => I(null),
940
+ style: {
941
+ padding: "8px 16px",
942
+ borderRadius: "var(--radius-button)",
943
+ border: "1px solid var(--color-border)",
944
+ backgroundColor: "transparent",
945
+ color: "var(--color-text-primary)",
946
+ fontSize: "var(--font-size-body-sm)",
947
+ cursor: "pointer"
948
+ },
949
+ children: "Cancel"
950
+ }), /* @__PURE__ */ S("button", {
951
+ onClick: () => void fe(),
952
+ disabled: !L.trim() || j.has(F.id),
527
953
  style: {
528
954
  display: "flex",
529
- gap: 8
955
+ alignItems: "center",
956
+ gap: 6,
957
+ padding: "8px 16px",
958
+ borderRadius: "var(--radius-button)",
959
+ border: "none",
960
+ backgroundColor: "var(--color-action-primary-bg)",
961
+ color: "var(--color-action-primary-text)",
962
+ fontSize: "var(--font-size-body-sm)",
963
+ cursor: !L.trim() || j.has(F.id) ? "not-allowed" : "pointer",
964
+ opacity: L.trim() ? 1 : .6
530
965
  },
531
- children: [
532
- e.status === "COMPLETED" && !e.dashboardId && /* @__PURE__ */ b("button", {
533
- onClick: () => V(e.id),
534
- style: {
535
- display: "flex",
536
- alignItems: "center",
537
- gap: 4,
538
- padding: "6px 12px",
539
- borderRadius: "var(--radius-button)",
540
- backgroundColor: "var(--color-action-primary-bg)",
541
- color: "var(--color-action-primary-text)",
542
- border: "none",
543
- fontSize: "var(--font-size-body-sm)",
544
- cursor: "pointer"
545
- },
546
- children: ["Create ", /* @__PURE__ */ y(l, { size: 14 })]
547
- }),
548
- e.dashboardId && /* @__PURE__ */ b("button", {
549
- onClick: () => i(`/dashboards/${e.dashboardId}`),
550
- style: {
551
- display: "flex",
552
- alignItems: "center",
553
- gap: 4,
554
- padding: "6px 12px",
555
- borderRadius: "var(--radius-button)",
556
- border: "1px solid var(--color-border)",
557
- backgroundColor: "transparent",
558
- color: "var(--color-text-primary)",
559
- fontSize: "var(--font-size-body-sm)",
560
- cursor: "pointer"
561
- },
562
- children: ["View Dashboard ", /* @__PURE__ */ y(l, { size: 14 })]
563
- }),
564
- /* @__PURE__ */ y("button", {
565
- onClick: () => {
566
- n("medium"), H(e.id);
567
- },
568
- title: "Delete generation",
569
- style: {
570
- display: "flex",
571
- alignItems: "center",
572
- padding: 6,
573
- borderRadius: "var(--radius-button)",
574
- border: "1px solid var(--color-border)",
575
- backgroundColor: "transparent",
576
- color: "var(--color-text-muted)",
577
- cursor: "pointer"
578
- },
579
- children: /* @__PURE__ */ y(m, { size: 14 })
580
- })
581
- ]
966
+ children: [j.has(F.id) ? /* @__PURE__ */ x(p, {
967
+ size: 14,
968
+ className: "animate-spin"
969
+ }) : /* @__PURE__ */ x(g, { size: 14 }), "Apply refinement"]
582
970
  })]
583
971
  })
584
- }, e.id))
585
- })] })
586
- ]
587
- })
972
+ ]
973
+ })
974
+ })
975
+ ]
588
976
  });
589
977
  });
590
978
  //#endregion