@burdenoff/microfe-conversations 2026.608.1 → 2026.625.1

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.
@@ -8,8 +8,9 @@ import { Activity as c, Archive as l, CheckCircle2 as u, Package as d, ShieldChe
8
8
  import { gql as m } from "@apollo/client";
9
9
  import { useMutation as h, useQuery as g } from "@apollo/client/react";
10
10
  import { jsx as _, jsxs as v } from "react/jsx-runtime";
11
+ import { Button as y, CTAOverflowMenu as b, GlassCard as x, ShowMore as S } from "@burdenoff/fe-libs/ui";
11
12
  //#region src/conversations/pages/ConversationAdminPages.tsx
12
- var y = m`
13
+ var C = m`
13
14
  query ConversationAdminMessageReports(
14
15
  $first: Int
15
16
  $filter: MessageReportFilter
@@ -37,7 +38,7 @@ var y = m`
37
38
  }
38
39
  }
39
40
  }
40
- `, b = m`
41
+ `, w = m`
41
42
  mutation ConversationAdminResolveMessageReport(
42
43
  $input: ResolveMessageReportInput!
43
44
  ) {
@@ -52,7 +53,7 @@ var y = m`
52
53
  }
53
54
  }
54
55
  }
55
- `, x = m`
56
+ `, T = m`
56
57
  query ConversationAdminBulkConversations(
57
58
  $first: Int
58
59
  $filter: ConversationFilter
@@ -69,7 +70,7 @@ var y = m`
69
70
  }
70
71
  }
71
72
  }
72
- `, S = m`
73
+ `, E = m`
73
74
  mutation ConversationAdminBulkUpdate(
74
75
  $input: BulkConversationOperationInput!
75
76
  ) {
@@ -85,7 +86,7 @@ var y = m`
85
86
  }
86
87
  }
87
88
  }
88
- `, C = m`
89
+ `, D = m`
89
90
  query ConversationAdminAuditLog($filter: ActivityLogFilter) {
90
91
  getActivities(filter: $filter) {
91
92
  id
@@ -97,7 +98,7 @@ var y = m`
97
98
  timestamp
98
99
  }
99
100
  }
100
- `, w = m`
101
+ `, O = m`
101
102
  query ConversationAdminAppInstallations($workspaceId: ID) {
102
103
  appInstallations(workspaceId: $workspaceId) {
103
104
  id
@@ -111,7 +112,7 @@ var y = m`
111
112
  updatedAt
112
113
  }
113
114
  }
114
- `, T = m`
115
+ `, k = m`
115
116
  mutation ConversationAdminInstallApp($input: InstallAppInput!) {
116
117
  installApp(input: $input) {
117
118
  id
@@ -121,7 +122,7 @@ var y = m`
121
122
  installedAt
122
123
  }
123
124
  }
124
- `, E = m`
125
+ `, A = m`
125
126
  mutation ConversationAdminUpdateAppSettings($id: ID!, $settings: JSON!) {
126
127
  updateAppSettings(id: $id, settings: $settings) {
127
128
  id
@@ -129,7 +130,7 @@ var y = m`
129
130
  updatedAt
130
131
  }
131
132
  }
132
- `, D = m`
133
+ `, j = m`
133
134
  mutation ConversationAdminUninstallApp($id: ID!) {
134
135
  uninstallApp(id: $id) {
135
136
  appInstallationId
@@ -137,7 +138,7 @@ var y = m`
137
138
  }
138
139
  }
139
140
  `;
140
- function O(e) {
141
+ function M(e) {
141
142
  if (typeof e == "string") return e;
142
143
  if (e && typeof e == "object" && "text" in e) {
143
144
  let t = e.text;
@@ -149,27 +150,27 @@ function O(e) {
149
150
  return "Message content unavailable";
150
151
  }
151
152
  }
152
- var k = new Intl.DateTimeFormat(void 0, {
153
+ var N = new Intl.DateTimeFormat(void 0, {
153
154
  dateStyle: "medium",
154
155
  timeStyle: "short"
155
156
  });
156
- function A(e) {
157
- return k.format(new Date(e));
157
+ function P(e) {
158
+ return N.format(new Date(e));
158
159
  }
159
- function j({ children: e }) {
160
+ function F({ children: e }) {
160
161
  return /* @__PURE__ */ _("span", {
161
- className: "rounded-full border border-border bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground",
162
+ className: "rounded-full border border-border-subtle bg-bg-sunken px-2 py-0.5 text-xs font-medium text-text-secondary",
162
163
  children: e
163
164
  });
164
165
  }
165
- function M() {
166
- let n = t(), { workspaceId: a } = e(), { data: o, loading: s, error: c, refetch: l } = g(y, {
166
+ function I() {
167
+ let n = t(), { workspaceId: a } = e(), { data: o, loading: s, error: c, refetch: l } = g(C, {
167
168
  variables: {
168
169
  first: 50,
169
170
  filter: { statuses: ["PENDING", "REVIEWING"] }
170
171
  },
171
172
  skip: !a
172
- }), [d, { loading: p }] = h(b, { onCompleted: () => void l() }), m = o?.messageReports.edges.map((e) => e.node) ?? [];
173
+ }), [d, { loading: p }] = h(w, { onCompleted: () => void l() }), m = o?.messageReports.edges.map((e) => e.node) ?? [];
173
174
  return /* @__PURE__ */ v(i, {
174
175
  title: n("conversations.admin.moderationPageTitle", "Moderation queue"),
175
176
  subtitle: n("conversations.admin.moderationPageDescription", "Review reported messages and apply moderator decisions."),
@@ -188,11 +189,11 @@ function M() {
188
189
  })
189
190
  }),
190
191
  a && s && /* @__PURE__ */ _("p", {
191
- className: "text-sm text-muted-foreground",
192
+ className: "text-sm text-text-secondary",
192
193
  children: "Loading reports…"
193
194
  }),
194
195
  a && c && /* @__PURE__ */ _("p", {
195
- className: "text-sm text-destructive",
196
+ className: "text-sm text-status-error-text",
196
197
  children: c.message
197
198
  }),
198
199
  a && !s && !c && m.length === 0 && /* @__PURE__ */ _(r, {
@@ -205,34 +206,35 @@ function M() {
205
206
  }),
206
207
  /* @__PURE__ */ _("div", {
207
208
  className: "grid gap-3",
208
- children: m.map((e) => /* @__PURE__ */ _("article", {
209
- className: "rounded-lg border border-border bg-card p-4 shadow-sm",
209
+ children: m.map((e) => /* @__PURE__ */ _(x, {
210
+ treatment: "glass",
211
+ className: "border-border-seam p-4",
210
212
  children: /* @__PURE__ */ v("div", {
211
213
  className: "flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",
212
214
  children: [/* @__PURE__ */ v("div", {
213
- className: "space-y-2",
215
+ className: "space-y-2 min-w-0",
214
216
  children: [
215
217
  /* @__PURE__ */ v("div", {
216
218
  className: "flex flex-wrap items-center gap-2",
217
219
  children: [
218
- /* @__PURE__ */ _(j, { children: e.status }),
219
- e.message.isHidden && /* @__PURE__ */ _(j, { children: "Hidden" }),
220
+ /* @__PURE__ */ _(F, { children: e.status }),
221
+ e.message.isHidden && /* @__PURE__ */ _(F, { children: "Hidden" }),
220
222
  /* @__PURE__ */ v("span", {
221
- className: "text-xs text-muted-foreground",
222
- children: ["Reported ", A(e.createdAt)]
223
+ className: "text-xs text-text-secondary",
224
+ children: ["Reported ", P(e.createdAt)]
223
225
  })
224
226
  ]
225
227
  }),
226
228
  /* @__PURE__ */ _("p", {
227
- className: "text-sm font-medium text-foreground",
229
+ className: "text-sm font-medium text-text-primary",
228
230
  children: e.reason
229
231
  }),
230
232
  /* @__PURE__ */ _("p", {
231
- className: "rounded-md bg-muted p-3 text-sm text-muted-foreground",
232
- children: O(e.message.content)
233
+ className: "rounded-md border border-border-seam bg-bg-sunken p-3 text-sm text-text-secondary",
234
+ children: M(e.message.content)
233
235
  }),
234
236
  /* @__PURE__ */ v("p", {
235
- className: "text-xs text-muted-foreground",
237
+ className: "text-xs text-text-secondary",
236
238
  children: [
237
239
  "Message ",
238
240
  e.messageId,
@@ -246,27 +248,24 @@ function M() {
246
248
  ]
247
249
  })
248
250
  ]
249
- }), /* @__PURE__ */ v("div", {
250
- className: "flex flex-wrap gap-2",
251
- children: [/* @__PURE__ */ _("button", {
252
- type: "button",
251
+ }), /* @__PURE__ */ _(b, {
252
+ className: "shrink-0",
253
+ primary: {
254
+ label: "Hide and resolve",
253
255
  disabled: p,
254
- className: "rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground hover:bg-accent disabled:opacity-50",
255
- onClick: () => void d({ variables: { input: {
256
+ onSelect: () => void d({ variables: { input: {
256
257
  reportId: e.id,
257
- action: "DISMISS"
258
- } } }),
259
- children: "Dismiss"
260
- }), /* @__PURE__ */ _("button", {
261
- type: "button",
258
+ action: "HIDE_MESSAGE"
259
+ } } })
260
+ },
261
+ actions: [{
262
+ label: "Dismiss",
262
263
  disabled: p,
263
- className: "rounded-md bg-primary px-3 py-2 text-sm text-primary-foreground hover:bg-primary/90 disabled:opacity-50",
264
- onClick: () => void d({ variables: { input: {
264
+ onSelect: () => void d({ variables: { input: {
265
265
  reportId: e.id,
266
- action: "HIDE_MESSAGE"
267
- } } }),
268
- children: "Hide and resolve"
269
- })]
266
+ action: "DISMISS"
267
+ } } })
268
+ }]
270
269
  })]
271
270
  })
272
271
  }, e.id))
@@ -274,13 +273,13 @@ function M() {
274
273
  ]
275
274
  });
276
275
  }
277
- function N() {
278
- let n = t(), { workspaceId: a } = e(), [o, c] = s(() => /* @__PURE__ */ new Set()), [u, d] = s("ARCHIVE"), { data: f, loading: p, error: m, refetch: y } = g(x, {
276
+ function L() {
277
+ let n = t(), { workspaceId: a } = e(), [o, c] = s(() => /* @__PURE__ */ new Set()), [u, d] = s("ARCHIVE"), { data: f, loading: p, error: m, refetch: b } = g(T, {
279
278
  variables: { first: 100 },
280
279
  skip: !a
281
- }), [b, { data: C, loading: w }] = h(S, { onCompleted: () => {
282
- c(/* @__PURE__ */ new Set()), y();
283
- } }), T = f?.conversations.edges.map((e) => e.node) ?? [], E = (e) => {
280
+ }), [S, { data: C, loading: w }] = h(E, { onCompleted: () => {
281
+ c(/* @__PURE__ */ new Set()), b();
282
+ } }), D = f?.conversations.edges.map((e) => e.node) ?? [], O = (e) => {
284
283
  c((t) => {
285
284
  let n = new Set(t);
286
285
  return n.has(e) ? n.delete(e) : n.add(e), n;
@@ -299,7 +298,8 @@ function N() {
299
298
  children: [/* @__PURE__ */ v("select", {
300
299
  value: u,
301
300
  onChange: (e) => d(e.target.value),
302
- className: "rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground",
301
+ "aria-label": "Bulk action",
302
+ className: "min-h-11 rounded-md border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
303
303
  children: [
304
304
  /* @__PURE__ */ _("option", {
305
305
  value: "ARCHIVE",
@@ -314,11 +314,11 @@ function N() {
314
314
  children: "Delete"
315
315
  })
316
316
  ]
317
- }), /* @__PURE__ */ v("button", {
317
+ }), /* @__PURE__ */ v(y, {
318
318
  type: "button",
319
+ size: "sm",
319
320
  disabled: o.size === 0 || w,
320
- className: "rounded-md bg-primary px-3 py-2 text-sm text-primary-foreground hover:bg-primary/90 disabled:opacity-50",
321
- onClick: () => void b({ variables: { input: {
321
+ onClick: () => void S({ variables: { input: {
322
322
  conversationIds: Array.from(o),
323
323
  action: u
324
324
  } } }),
@@ -335,46 +335,53 @@ function N() {
335
335
  })
336
336
  }),
337
337
  a && p && /* @__PURE__ */ _("p", {
338
- className: "text-sm text-muted-foreground",
338
+ className: "text-sm text-text-secondary",
339
339
  children: "Loading conversations…"
340
340
  }),
341
341
  a && m && /* @__PURE__ */ _("p", {
342
- className: "text-sm text-destructive",
342
+ className: "text-sm text-status-error-text",
343
343
  children: m.message
344
344
  }),
345
- C?.bulkUpdateConversations && /* @__PURE__ */ v("div", {
346
- className: "rounded-lg border border-border bg-muted p-3 text-sm text-muted-foreground",
347
- children: [
348
- C.bulkUpdateConversations.successCount,
349
- " succeeded,",
350
- " ",
351
- C.bulkUpdateConversations.failureCount,
352
- " failed."
353
- ]
345
+ C?.bulkUpdateConversations && /* @__PURE__ */ v(x, {
346
+ treatment: "metric",
347
+ className: "grid grid-cols-2 gap-4 border-border-seam p-4 sm:max-w-md",
348
+ children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
349
+ className: "text-2xl font-semibold tabular-nums text-status-success-text",
350
+ children: C.bulkUpdateConversations.successCount
351
+ }), /* @__PURE__ */ _("p", {
352
+ className: "text-xs text-text-secondary",
353
+ children: "Succeeded"
354
+ })] }), /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
355
+ className: "text-2xl font-semibold tabular-nums text-text-primary",
356
+ children: C.bulkUpdateConversations.failureCount
357
+ }), /* @__PURE__ */ _("p", {
358
+ className: "text-xs text-text-secondary",
359
+ children: "Failed"
360
+ })] })]
354
361
  }),
355
362
  a && /* @__PURE__ */ _("div", {
356
- className: "overflow-hidden rounded-lg border border-border bg-card",
357
- children: T.map((e) => /* @__PURE__ */ v("label", {
358
- className: "flex cursor-pointer items-center gap-3 border-b border-border px-4 py-3 last:border-b-0 hover:bg-accent",
363
+ className: "overflow-hidden rounded-lg border border-border-seam bg-bg-surface",
364
+ children: D.map((e) => /* @__PURE__ */ v("label", {
365
+ className: "flex min-h-11 cursor-pointer items-center gap-3 border-b border-border-seam px-4 py-3 last:border-b-0 hover:bg-accent",
359
366
  children: [/* @__PURE__ */ _("input", {
360
367
  type: "checkbox",
361
368
  "aria-label": `Select ${e.title || "untitled conversation"}`,
362
369
  checked: o.has(e.id),
363
- onChange: () => E(e.id)
370
+ onChange: () => O(e.id)
364
371
  }), /* @__PURE__ */ v("div", {
365
372
  className: "min-w-0 flex-1",
366
373
  children: [/* @__PURE__ */ _("p", {
367
- className: "truncate text-sm font-medium text-foreground",
374
+ className: "truncate text-sm font-medium text-text-primary",
368
375
  children: e.title || "Untitled conversation"
369
376
  }), /* @__PURE__ */ v("p", {
370
- className: "text-xs text-muted-foreground",
377
+ className: "text-xs text-text-secondary",
371
378
  children: [
372
379
  e.type,
373
380
  " · ",
374
381
  e.state,
375
382
  " · Updated",
376
383
  " ",
377
- A(e.updatedAt)
384
+ P(e.updatedAt)
378
385
  ]
379
386
  })]
380
387
  })]
@@ -383,8 +390,8 @@ function N() {
383
390
  ]
384
391
  });
385
392
  }
386
- function P() {
387
- let n = t(), { workspaceId: a } = e(), { data: o, loading: s, error: l } = g(C, {
393
+ function R() {
394
+ let n = t(), { workspaceId: a } = e(), { data: o, loading: s, error: l } = g(D, {
388
395
  variables: { filter: {
389
396
  workspaceId: a,
390
397
  resourceType: "conversation",
@@ -402,11 +409,11 @@ function P() {
402
409
  maxWidth: "2xl",
403
410
  children: [
404
411
  s && /* @__PURE__ */ _("p", {
405
- className: "text-sm text-muted-foreground",
412
+ className: "text-sm text-text-secondary",
406
413
  children: "Loading activity…"
407
414
  }),
408
415
  l && /* @__PURE__ */ _("p", {
409
- className: "text-sm text-destructive",
416
+ className: "text-sm text-status-error-text",
410
417
  children: l.message
411
418
  }),
412
419
  !s && !l && u.length === 0 && /* @__PURE__ */ _(r, {
@@ -415,25 +422,26 @@ function P() {
415
422
  }),
416
423
  /* @__PURE__ */ _("div", {
417
424
  className: "grid gap-3",
418
- children: u.map((e) => /* @__PURE__ */ v("article", {
419
- className: "rounded-lg border border-border bg-card p-4",
425
+ children: u.map((e) => /* @__PURE__ */ v(x, {
426
+ treatment: "plain",
427
+ className: "border-border-seam p-4",
420
428
  children: [
421
429
  /* @__PURE__ */ v("div", {
422
430
  className: "flex flex-wrap items-center justify-between gap-2",
423
431
  children: [/* @__PURE__ */ _("p", {
424
- className: "text-sm font-medium text-foreground",
432
+ className: "text-sm font-medium text-text-primary",
425
433
  children: e.action
426
434
  }), /* @__PURE__ */ _("span", {
427
- className: "text-xs text-muted-foreground",
428
- children: A(e.timestamp)
435
+ className: "text-xs tabular-nums text-text-secondary",
436
+ children: P(e.timestamp)
429
437
  })]
430
438
  }),
431
439
  /* @__PURE__ */ _("p", {
432
- className: "mt-1 text-sm text-muted-foreground",
440
+ className: "mt-1 text-sm text-text-secondary",
433
441
  children: e.description || "No description provided"
434
442
  }),
435
443
  /* @__PURE__ */ v("p", {
436
- className: "mt-2 text-xs text-muted-foreground",
444
+ className: "mt-2 text-xs text-text-secondary",
437
445
  children: [
438
446
  "User ",
439
447
  e.userId,
@@ -447,20 +455,20 @@ function P() {
447
455
  ]
448
456
  });
449
457
  }
450
- function F() {
451
- let r = t(), { workspaceId: c } = e(), [l, u] = s(""), [f, m] = s("{}"), [y, b] = s({}), [x, S] = s(null), { data: C, loading: O, error: k, refetch: M } = g(w, {
458
+ function z() {
459
+ let r = t(), { workspaceId: c } = e(), [l, u] = s(""), [f, m] = s("{}"), [C, w] = s({}), [T, E] = s(null), { data: D, loading: M, error: N, refetch: I } = g(O, {
452
460
  variables: { workspaceId: c },
453
461
  skip: !c
454
- }), [N, { loading: P }] = h(T, { onCompleted: () => void M() }), [F, { loading: I }] = h(E, { onCompleted: () => void M() }), [L, { loading: R }] = h(D, { onCompleted: () => void M() }), z = o(() => C?.appInstallations ?? [], [C?.appInstallations]);
462
+ }), [L, { loading: R }] = h(k, { onCompleted: () => void I() }), [z, { loading: B }] = h(A, { onCompleted: () => void I() }), [V, { loading: H }] = h(j, { onCompleted: () => void I() }), U = o(() => D?.appInstallations ?? [], [D?.appInstallations]);
455
463
  a(() => {
456
- b((e) => {
457
- if (z.every((t) => e[t.id])) return e;
464
+ w((e) => {
465
+ if (U.every((t) => e[t.id])) return e;
458
466
  let t = { ...e };
459
- for (let e of z) t[e.id] || (t[e.id] = JSON.stringify(e.settings ?? {}, null, 2));
467
+ for (let e of U) t[e.id] || (t[e.id] = JSON.stringify(e.settings ?? {}, null, 2));
460
468
  return t;
461
469
  });
462
- }, [z]);
463
- let B = (e) => {
470
+ }, [U]);
471
+ let W = (e) => {
464
472
  try {
465
473
  let t = JSON.parse(e);
466
474
  return t && typeof t == "object" && !Array.isArray(t) ? t : null;
@@ -481,33 +489,33 @@ function F() {
481
489
  title: "Install app",
482
490
  description: "Install a workspace-scoped conversation app by app ID.",
483
491
  children: [/* @__PURE__ */ v("div", {
484
- className: "grid gap-3 rounded-lg border border-border bg-card p-4 sm:grid-cols-[minmax(0,1fr)_minmax(0,2fr)_auto]",
492
+ className: "grid gap-3 rounded-lg border border-border-seam bg-bg-surface p-4 sm:grid-cols-[minmax(0,1fr)_minmax(0,2fr)_auto]",
485
493
  children: [
486
494
  /* @__PURE__ */ _("input", {
487
495
  value: l,
488
496
  onChange: (e) => u(e.target.value),
489
497
  placeholder: "app-id",
490
498
  "aria-label": "App ID",
491
- className: "rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground"
499
+ className: "min-h-11 rounded-md border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
492
500
  }),
493
501
  /* @__PURE__ */ _("textarea", {
494
502
  value: f,
495
503
  onChange: (e) => m(e.target.value),
496
504
  rows: 3,
497
505
  "aria-label": "App settings JSON",
498
- className: "rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground"
506
+ className: "rounded-md border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
499
507
  }),
500
- /* @__PURE__ */ _("button", {
508
+ /* @__PURE__ */ _(y, {
501
509
  type: "button",
502
- disabled: P,
503
- className: "rounded-md bg-primary px-3 py-2 text-sm text-primary-foreground hover:bg-primary/90 disabled:opacity-50",
510
+ size: "sm",
511
+ disabled: R,
504
512
  onClick: () => {
505
- let e = B(f);
513
+ let e = W(f);
506
514
  if (!l.trim() || !e) {
507
- S("Enter an app ID and a valid JSON settings object.");
515
+ E("Enter an app ID and a valid JSON settings object.");
508
516
  return;
509
517
  }
510
- S(null), N({ variables: { input: {
518
+ E(null), L({ variables: { input: {
511
519
  appId: l.trim(),
512
520
  workspaceId: c,
513
521
  settings: e
@@ -516,81 +524,97 @@ function F() {
516
524
  children: "Install"
517
525
  })
518
526
  ]
519
- }), x && /* @__PURE__ */ _("p", {
520
- className: "text-sm text-destructive",
521
- children: x
527
+ }), T && /* @__PURE__ */ _("p", {
528
+ className: "text-sm text-status-error-text",
529
+ children: T
522
530
  })]
523
531
  }),
524
- O && /* @__PURE__ */ _("p", {
525
- className: "text-sm text-muted-foreground",
532
+ M && /* @__PURE__ */ _("p", {
533
+ className: "text-sm text-text-secondary",
526
534
  children: "Loading app installations…"
527
535
  }),
528
- k && /* @__PURE__ */ _("p", {
529
- className: "text-sm text-destructive",
530
- children: k.message
536
+ N && /* @__PURE__ */ _("p", {
537
+ className: "text-sm text-status-error-text",
538
+ children: N.message
531
539
  }),
532
540
  /* @__PURE__ */ _("div", {
533
541
  className: "grid gap-3",
534
- children: z.map((e) => /* @__PURE__ */ v("article", {
535
- className: "rounded-lg border border-border bg-card p-4",
542
+ children: U.map((e) => /* @__PURE__ */ v(x, {
543
+ treatment: "glass",
544
+ className: "border-border-seam p-4",
536
545
  children: [/* @__PURE__ */ v("div", {
537
546
  className: "flex flex-wrap items-start justify-between gap-3",
538
- children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("div", {
539
- className: "flex items-center gap-2",
540
- children: [/* @__PURE__ */ _("h3", {
541
- className: "text-sm font-semibold text-foreground",
542
- children: e.appId
543
- }), /* @__PURE__ */ _(j, { children: e.state })]
544
- }), /* @__PURE__ */ v("p", {
545
- className: "text-xs text-muted-foreground",
546
- children: [
547
- "Version ",
548
- e.appVersion,
549
- " · Installed by",
550
- " ",
551
- e.installedBy,
552
- " on",
553
- " ",
554
- A(e.installedAt)
555
- ]
556
- })] }), /* @__PURE__ */ v("button", {
557
- type: "button",
558
- disabled: R,
559
- className: "inline-flex items-center gap-2 rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground hover:bg-accent disabled:opacity-50",
560
- onClick: () => void L({ variables: { id: e.id } }),
561
- children: [/* @__PURE__ */ _(p, {
562
- className: "size-4",
563
- "aria-hidden": "true"
564
- }), "Uninstall"]
565
- })]
566
- }), /* @__PURE__ */ v("div", {
567
- className: "mt-3 grid gap-2",
568
- children: [/* @__PURE__ */ _("textarea", {
569
- rows: 5,
570
- "aria-label": `Settings for ${e.appId}`,
571
- value: y[e.id] ?? "{}",
572
- onChange: (t) => b((n) => ({
573
- ...n,
574
- [e.id]: t.target.value
575
- })),
576
- className: "rounded-md border border-border bg-background px-3 py-2 font-mono text-xs text-foreground"
577
- }), /* @__PURE__ */ _("button", {
578
- type: "button",
579
- disabled: I,
580
- className: "w-fit rounded-md bg-secondary px-3 py-2 text-sm text-secondary-foreground hover:bg-secondary/90 disabled:opacity-50",
581
- onClick: () => {
582
- let t = B(y[e.id] ?? "{}");
583
- if (!t) {
584
- S("Installation settings must be a valid JSON object.");
585
- return;
547
+ children: [/* @__PURE__ */ v("div", {
548
+ className: "min-w-0",
549
+ children: [/* @__PURE__ */ v("div", {
550
+ className: "flex items-center gap-2",
551
+ children: [/* @__PURE__ */ _("h3", {
552
+ className: "text-sm font-semibold text-text-primary",
553
+ children: e.appId
554
+ }), /* @__PURE__ */ _(F, { children: e.state })]
555
+ }), /* @__PURE__ */ v("p", {
556
+ className: "text-xs text-text-secondary",
557
+ children: [
558
+ "Version ",
559
+ e.appVersion,
560
+ " · Installed by",
561
+ " ",
562
+ e.installedBy,
563
+ " on",
564
+ " ",
565
+ P(e.installedAt)
566
+ ]
567
+ })]
568
+ }), /* @__PURE__ */ _(b, {
569
+ className: "shrink-0",
570
+ actions: [{
571
+ label: "Uninstall",
572
+ intent: "destructive",
573
+ disabled: H,
574
+ icon: /* @__PURE__ */ _(p, {
575
+ className: "size-4",
576
+ "aria-hidden": "true"
577
+ }),
578
+ onSelect: () => {
579
+ window.confirm(`Uninstall ${e.appId}? This removes the app and its settings from this workspace.`) && V({ variables: { id: e.id } });
586
580
  }
587
- S(null), F({ variables: {
588
- id: e.id,
589
- settings: t
590
- } });
591
- },
592
- children: "Save settings"
581
+ }]
593
582
  })]
583
+ }), /* @__PURE__ */ _(S, {
584
+ className: "mt-3",
585
+ collapsedHeight: 0,
586
+ label: "Edit settings (JSON)",
587
+ children: /* @__PURE__ */ v("div", {
588
+ className: "grid gap-2 pt-2",
589
+ children: [/* @__PURE__ */ _("textarea", {
590
+ rows: 5,
591
+ "aria-label": `Settings for ${e.appId}`,
592
+ value: C[e.id] ?? "{}",
593
+ onChange: (t) => w((n) => ({
594
+ ...n,
595
+ [e.id]: t.target.value
596
+ })),
597
+ className: "rounded-md border border-border-seam bg-bg-surface px-3 py-2 font-mono text-xs text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
598
+ }), /* @__PURE__ */ _(y, {
599
+ type: "button",
600
+ variant: "secondary",
601
+ size: "sm",
602
+ disabled: B,
603
+ className: "w-fit",
604
+ onClick: () => {
605
+ let t = W(C[e.id] ?? "{}");
606
+ if (!t) {
607
+ E("Installation settings must be a valid JSON object.");
608
+ return;
609
+ }
610
+ E(null), z({ variables: {
611
+ id: e.id,
612
+ settings: t
613
+ } });
614
+ },
615
+ children: "Save settings"
616
+ })]
617
+ })
594
618
  })]
595
619
  }, e.id))
596
620
  })
@@ -598,6 +622,6 @@ function F() {
598
622
  });
599
623
  }
600
624
  //#endregion
601
- export { F as AppInstallationsPage, N as BulkOperationsPage, P as ConversationAuditLogPage, M as ModerationQueuePage };
625
+ export { z as AppInstallationsPage, L as BulkOperationsPage, R as ConversationAuditLogPage, I as ModerationQueuePage };
602
626
 
603
627
  //# sourceMappingURL=ConversationAdminPages.js.map