@burdenoff/microfe-subscriberbot 2026.1023.2 → 2026.1030.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.
Files changed (54) hide show
  1. package/dist/subscriberbot/SubscriberBotRoutes.d.ts.map +1 -1
  2. package/dist/subscriberbot/SubscriberBotRoutes.js +2 -2
  3. package/dist/subscriberbot/SubscriberBotRoutes.js.map +1 -1
  4. package/dist/subscriberbot/admin/AdminDashboardPage.js +5 -5
  5. package/dist/subscriberbot/admin/AdminDashboardPage.js.map +1 -1
  6. package/dist/subscriberbot/components/PostureOptions.d.ts +10 -0
  7. package/dist/subscriberbot/components/PostureOptions.d.ts.map +1 -0
  8. package/dist/subscriberbot/components/PostureOptions.js +20 -0
  9. package/dist/subscriberbot/components/PostureOptions.js.map +1 -0
  10. package/dist/subscriberbot/components/index.d.ts +2 -0
  11. package/dist/subscriberbot/components/index.d.ts.map +1 -1
  12. package/dist/subscriberbot/components/index.js +1 -0
  13. package/dist/subscriberbot/hooks/index.d.ts +3 -0
  14. package/dist/subscriberbot/hooks/index.d.ts.map +1 -1
  15. package/dist/subscriberbot/hooks/index.js +3 -1
  16. package/dist/subscriberbot/hooks/useAutonomousAgentMode.d.ts +15 -0
  17. package/dist/subscriberbot/hooks/useAutonomousAgentMode.d.ts.map +1 -0
  18. package/dist/subscriberbot/hooks/useAutonomousAgentMode.js +13 -0
  19. package/dist/subscriberbot/hooks/useAutonomousAgentMode.js.map +1 -0
  20. package/dist/subscriberbot/hooks/useRouteSelection.d.ts +15 -0
  21. package/dist/subscriberbot/hooks/useRouteSelection.d.ts.map +1 -0
  22. package/dist/subscriberbot/hooks/useRouteSelection.js +18 -0
  23. package/dist/subscriberbot/hooks/useRouteSelection.js.map +1 -0
  24. package/dist/subscriberbot/pages/AssetVaultPage.js +16 -16
  25. package/dist/subscriberbot/pages/DashboardPage.js +23 -23
  26. package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
  27. package/dist/subscriberbot/pages/InboxPage.d.ts.map +1 -1
  28. package/dist/subscriberbot/pages/InboxPage.js +249 -248
  29. package/dist/subscriberbot/pages/InboxPage.js.map +1 -1
  30. package/dist/subscriberbot/pages/InsightsPage.js +14 -14
  31. package/dist/subscriberbot/pages/InvoicesPage.js +66 -66
  32. package/dist/subscriberbot/pages/WorkflowsPage.d.ts.map +1 -1
  33. package/dist/subscriberbot/pages/WorkflowsPage.js +183 -182
  34. package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -1
  35. package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts.map +1 -1
  36. package/dist/subscriberbot/pages/agents/AgentDetailPage.js +184 -182
  37. package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
  38. package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts.map +1 -1
  39. package/dist/subscriberbot/pages/agents/AgentNewPage.js +77 -79
  40. package/dist/subscriberbot/pages/agents/AgentNewPage.js.map +1 -1
  41. package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts.map +1 -1
  42. package/dist/subscriberbot/pages/agents/AgentsListPage.js +134 -133
  43. package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
  44. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +64 -64
  45. package/dist/subscriberbot/pages/providers/ProviderNewPage.js +3 -3
  46. package/dist/subscriberbot/pages/providers/ProvidersListPage.js +18 -18
  47. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +76 -76
  48. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +6 -6
  49. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +7 -7
  50. package/dist/subscriberbot/utils/pageContext.d.ts +43 -11
  51. package/dist/subscriberbot/utils/pageContext.d.ts.map +1 -1
  52. package/dist/subscriberbot/utils/pageContext.js +42 -37
  53. package/dist/subscriberbot/utils/pageContext.js.map +1 -1
  54. package/package.json +4 -2
@@ -5,16 +5,17 @@ import { formatDateTime as r, formatEnumLabel as i, formatRelativeTime as a } fr
5
5
  import { StatusBadge as o } from "../components/StatusBadge.js";
6
6
  import { EmptyState as s } from "../components/EmptyState.js";
7
7
  import { Modal as c } from "../components/Modal.js";
8
- import { ErrorView as l, LoadingView as u, Section as d } from "../components/StateViews.js";
9
- import { MiniProgress as f } from "../components/viz.js";
10
- import { useChannels as p, useCreateChannel as m, useInboxMessages as h, useIngestMessage as g, useMarkMessageRead as _, useVerifyChannel as v } from "../hooks/useSubscriberBotApi.js";
11
- import { useTr as y } from "../hooks/useTr.js";
12
- import { useState as b } from "react";
13
- import { AlertTriangle as x, BadgeCheck as S, Bell as C, ChevronRight as w, Hash as T, Inbox as E, Mail as D, MailOpen as O, MessageSquare as k, MessagesSquare as A, MousePointerClick as j, Phone as M, Plus as N, Radio as P, Send as F, ShieldAlert as I, Sparkles as L, Webhook as R } from "lucide-react";
14
- import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
15
- import { GlassCard as H, PagePurpose as U } from "@burdenoff/fe-libs/ui";
8
+ import { useTr as l } from "../hooks/useTr.js";
9
+ import { ErrorView as u, LoadingView as d, Section as f } from "../components/StateViews.js";
10
+ import { MiniProgress as p } from "../components/viz.js";
11
+ import { useChannels as m, useCreateChannel as h, useInboxMessages as g, useIngestMessage as _, useMarkMessageRead as v, useVerifyChannel as y } from "../hooks/useSubscriberBotApi.js";
12
+ import { useRouteSelection as b } from "../hooks/useRouteSelection.js";
13
+ import { useState as x } from "react";
14
+ import { AlertTriangle as S, BadgeCheck as C, Bell as w, ChevronRight as T, Hash as E, Inbox as D, Mail as O, MailOpen as k, MessageSquare as A, MessagesSquare as j, MousePointerClick as M, Phone as N, Plus as P, Radio as F, Send as I, ShieldAlert as L, Sparkles as R, Webhook as z } from "lucide-react";
15
+ import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
16
+ import { GlassCard as U, PagePurpose as W } from "@burdenoff/fe-libs/ui";
16
17
  //#region src/subscriberbot/pages/InboxPage.tsx
17
- var W = 25, G = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", K = "mb-1 block text-xs font-medium text-text-secondary", q = [
18
+ var G = 25, K = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", q = "mb-1 block text-xs font-medium text-text-secondary", J = [
18
19
  "BILLING",
19
20
  "RENEWAL",
20
21
  "REQUIRED_ACTION",
@@ -22,7 +23,7 @@ var W = 25, G = "w-full rounded-lg border border-border-subtle bg-bg-surface px-
22
23
  "PRODUCT_UPDATE",
23
24
  "MARKETING",
24
25
  "OTHER"
25
- ], J = [
26
+ ], ee = [
26
27
  "EMAIL",
27
28
  "SMS",
28
29
  "SLACK",
@@ -38,7 +39,7 @@ var W = 25, G = "w-full rounded-lg border border-border-subtle bg-bg-surface px-
38
39
  PRODUCT_UPDATE: "inbox.categories.productUpdate",
39
40
  MARKETING: "inbox.categories.marketing",
40
41
  OTHER: "inbox.categories.other"
41
- }, ee = [
42
+ }, te = [
42
43
  {
43
44
  value: "",
44
45
  key: "inbox.categories.all",
@@ -79,7 +80,7 @@ var W = 25, G = "w-full rounded-lg border border-border-subtle bg-bg-surface px-
79
80
  key: Y.OTHER,
80
81
  fallback: "Other"
81
82
  }
82
- ], te = {
83
+ ], ne = {
83
84
  BILLING: "bg-[var(--color-accent-soft)] text-text-primary",
84
85
  RENEWAL: "bg-status-success-bg-subtle text-status-success-text",
85
86
  REQUIRED_ACTION: "bg-status-warning-bg-subtle text-status-warning-text",
@@ -88,125 +89,125 @@ var W = 25, G = "w-full rounded-lg border border-border-subtle bg-bg-surface px-
88
89
  MARKETING: "bg-bg-sunken text-text-secondary",
89
90
  OTHER: "bg-bg-sunken text-text-secondary"
90
91
  }, X = {
91
- EMAIL: D,
92
- SMS: k,
93
- SLACK: T,
94
- DISCORD: A,
95
- WHATSAPP: M,
96
- PUSH: C,
97
- WEBHOOK: R
92
+ EMAIL: O,
93
+ SMS: A,
94
+ SLACK: E,
95
+ DISCORD: j,
96
+ WHATSAPP: N,
97
+ PUSH: w,
98
+ WEBHOOK: z
98
99
  };
99
100
  function Z({ category: e }) {
100
- return /* @__PURE__ */ B("span", {
101
- className: t("inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium", te[e]),
101
+ return /* @__PURE__ */ V("span", {
102
+ className: t("inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium", ne[e]),
102
103
  children: i(e)
103
104
  });
104
105
  }
105
106
  function Q({ className: e }) {
106
- let n = y();
107
- return /* @__PURE__ */ V("span", {
107
+ let n = l();
108
+ return /* @__PURE__ */ H("span", {
108
109
  title: n("inbox.message.actionRequiredTitle", "Action required"),
109
110
  className: t("inline-flex items-center gap-1 rounded-full bg-status-warning-bg-subtle px-2 py-0.5 text-[10px] font-medium text-status-warning-text", e),
110
111
  children: [
111
- /* @__PURE__ */ B(x, { className: "h-3 w-3" }),
112
+ /* @__PURE__ */ V(S, { className: "h-3 w-3" }),
112
113
  " ",
113
114
  n("inbox.message.actionFlag", "Action")
114
115
  ]
115
116
  });
116
117
  }
117
- function ne({ onClose: e }) {
118
- let t = y(), n = m(), [r, a] = b("EMAIL"), [o, s] = b(""), [l, u] = b(""), [d, f] = b(!0), [p, h] = b(null);
119
- return /* @__PURE__ */ B(c, {
118
+ function re({ onClose: e }) {
119
+ let t = l(), n = h(), [r, a] = x("EMAIL"), [o, s] = x(""), [u, d] = x(""), [f, p] = x(!0), [m, g] = x(null);
120
+ return /* @__PURE__ */ V(c, {
120
121
  title: t("inbox.addChannelModal.title", "Add channel"),
121
122
  onClose: e,
122
123
  maxWidthClassName: "max-w-xl",
123
- children: /* @__PURE__ */ V("form", {
124
+ children: /* @__PURE__ */ H("form", {
124
125
  onSubmit: (i) => {
125
- if (i.preventDefault(), h(null), !o.trim()) {
126
- h(t("inbox.addChannelModal.addressRequired", "An address is required."));
126
+ if (i.preventDefault(), g(null), !o.trim()) {
127
+ g(t("inbox.addChannelModal.addressRequired", "An address is required."));
127
128
  return;
128
129
  }
129
130
  n.mutate({
130
131
  type: r,
131
132
  address: o.trim(),
132
- ingestEnabled: d,
133
- ...l.trim() ? { label: l.trim() } : {}
133
+ ingestEnabled: f,
134
+ ...u.trim() ? { label: u.trim() } : {}
134
135
  }, {
135
136
  onSuccess: () => e(),
136
- onError: (e) => h(e instanceof Error ? e.message : t("inbox.addChannelModal.error", "Could not add channel."))
137
+ onError: (e) => g(e instanceof Error ? e.message : t("inbox.addChannelModal.error", "Could not add channel."))
137
138
  });
138
139
  },
139
140
  className: "space-y-4",
140
141
  children: [
141
- p && /* @__PURE__ */ B("div", {
142
+ m && /* @__PURE__ */ V("div", {
142
143
  className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
143
- children: p
144
+ children: m
144
145
  }),
145
- /* @__PURE__ */ V("div", {
146
+ /* @__PURE__ */ H("div", {
146
147
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
147
- children: [/* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("label", {
148
+ children: [/* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("label", {
148
149
  htmlFor: "ch-type",
149
- className: K,
150
+ className: q,
150
151
  children: t("inbox.addChannelModal.typeLabel", "Type")
151
- }), /* @__PURE__ */ B("select", {
152
+ }), /* @__PURE__ */ V("select", {
152
153
  id: "ch-type",
153
154
  value: r,
154
155
  onChange: (e) => a(e.target.value),
155
- className: G,
156
- children: J.map((e) => /* @__PURE__ */ B("option", {
156
+ className: K,
157
+ children: ee.map((e) => /* @__PURE__ */ V("option", {
157
158
  value: e,
158
159
  children: i(e)
159
160
  }, e))
160
- })] }), /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("label", {
161
+ })] }), /* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("label", {
161
162
  htmlFor: "ch-label",
162
- className: K,
163
+ className: q,
163
164
  children: t("inbox.addChannelModal.labelLabel", "Label")
164
- }), /* @__PURE__ */ B("input", {
165
+ }), /* @__PURE__ */ V("input", {
165
166
  id: "ch-label",
166
167
  type: "text",
167
- value: l,
168
- onChange: (e) => u(e.target.value),
168
+ value: u,
169
+ onChange: (e) => d(e.target.value),
169
170
  placeholder: t("inbox.addChannelModal.labelPlaceholder", "e.g. Billing inbox"),
170
- className: G
171
+ className: K
171
172
  })] })]
172
173
  }),
173
- /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ V("label", {
174
+ /* @__PURE__ */ H("div", { children: [/* @__PURE__ */ H("label", {
174
175
  htmlFor: "ch-address",
175
- className: K,
176
+ className: q,
176
177
  children: [
177
178
  t("inbox.addChannelModal.addressLabel", "Address"),
178
179
  " ",
179
- /* @__PURE__ */ B("span", {
180
+ /* @__PURE__ */ V("span", {
180
181
  className: "text-status-error-text",
181
182
  children: "*"
182
183
  })
183
184
  ]
184
- }), /* @__PURE__ */ B("input", {
185
+ }), /* @__PURE__ */ V("input", {
185
186
  id: "ch-address",
186
187
  type: "text",
187
188
  value: o,
188
189
  onChange: (e) => s(e.target.value),
189
190
  placeholder: t("inbox.addChannelModal.addressPlaceholder", "e.g. billing@acme.com, +1…, a webhook URL"),
190
- className: G,
191
+ className: K,
191
192
  required: !0
192
193
  })] }),
193
- /* @__PURE__ */ V("label", {
194
+ /* @__PURE__ */ H("label", {
194
195
  className: "flex items-center gap-2 text-sm text-text-primary",
195
- children: [/* @__PURE__ */ B("input", {
196
+ children: [/* @__PURE__ */ V("input", {
196
197
  type: "checkbox",
197
- checked: d,
198
- onChange: (e) => f(e.target.checked),
198
+ checked: f,
199
+ onChange: (e) => p(e.target.checked),
199
200
  className: "size-4 rounded border-border-subtle"
200
201
  }), t("inbox.addChannelModal.ingestLabel", "Ingest messages from this channel")]
201
202
  }),
202
- /* @__PURE__ */ V("div", {
203
+ /* @__PURE__ */ H("div", {
203
204
  className: "flex justify-end gap-3",
204
- children: [/* @__PURE__ */ B("button", {
205
+ children: [/* @__PURE__ */ V("button", {
205
206
  type: "button",
206
207
  onClick: e,
207
208
  className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
208
209
  children: t("inbox.addChannelModal.cancel", "Cancel")
209
- }), /* @__PURE__ */ B("button", {
210
+ }), /* @__PURE__ */ V("button", {
210
211
  type: "submit",
211
212
  disabled: n.isPending,
212
213
  className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50",
@@ -217,86 +218,86 @@ function ne({ onClose: e }) {
217
218
  })
218
219
  });
219
220
  }
220
- function re({ channel: e, onClose: t }) {
221
- let n = y(), r = g(), [a, o] = b(""), [s, l] = b(""), [u, d] = b("OTHER"), [f, p] = b(!1), [m, h] = b(null);
222
- return /* @__PURE__ */ B(c, {
221
+ function ie({ channel: e, onClose: t }) {
222
+ let n = l(), r = _(), [a, o] = x(""), [s, u] = x(""), [d, f] = x("OTHER"), [p, m] = x(!1), [h, g] = x(null);
223
+ return /* @__PURE__ */ V(c, {
223
224
  title: n("inbox.logMessageModal.title", "Log test message"),
224
225
  description: n("inbox.logMessageModal.description", "Simulate an ingested message from {channel}.", { channel: e.label || e.address }),
225
226
  onClose: t,
226
- children: /* @__PURE__ */ V("form", {
227
+ children: /* @__PURE__ */ H("form", {
227
228
  onSubmit: (i) => {
228
- i.preventDefault(), h(null), r.mutate({
229
+ i.preventDefault(), g(null), r.mutate({
229
230
  channelId: e.id,
230
231
  receivedAt: (/* @__PURE__ */ new Date()).toISOString(),
231
- category: u,
232
- actionRequired: f,
232
+ category: d,
233
+ actionRequired: p,
233
234
  ...a.trim() ? { subject: a.trim() } : {},
234
235
  ...s.trim() ? { preview: s.trim() } : {}
235
236
  }, {
236
237
  onSuccess: () => t(),
237
- onError: (e) => h(e instanceof Error ? e.message : n("inbox.logMessageModal.error", "Could not log the message."))
238
+ onError: (e) => g(e instanceof Error ? e.message : n("inbox.logMessageModal.error", "Could not log the message."))
238
239
  });
239
240
  },
240
241
  className: "space-y-4",
241
242
  children: [
242
- m && /* @__PURE__ */ B("div", {
243
+ h && /* @__PURE__ */ V("div", {
243
244
  className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
244
- children: m
245
+ children: h
245
246
  }),
246
- /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("label", {
247
+ /* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("label", {
247
248
  htmlFor: "msg-subject",
248
- className: K,
249
+ className: q,
249
250
  children: n("inbox.logMessageModal.subjectLabel", "Subject")
250
- }), /* @__PURE__ */ B("input", {
251
+ }), /* @__PURE__ */ V("input", {
251
252
  id: "msg-subject",
252
253
  type: "text",
253
254
  value: a,
254
255
  onChange: (e) => o(e.target.value),
255
256
  placeholder: n("inbox.logMessageModal.subjectPlaceholder", "e.g. Your plan renews in 3 days"),
256
- className: G
257
+ className: K
257
258
  })] }),
258
- /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("label", {
259
+ /* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("label", {
259
260
  htmlFor: "msg-preview",
260
- className: K,
261
+ className: q,
261
262
  children: n("inbox.logMessageModal.previewLabel", "Preview")
262
- }), /* @__PURE__ */ B("textarea", {
263
+ }), /* @__PURE__ */ V("textarea", {
263
264
  id: "msg-preview",
264
265
  value: s,
265
- onChange: (e) => l(e.target.value),
266
+ onChange: (e) => u(e.target.value),
266
267
  rows: 2,
267
- className: G
268
+ className: K
268
269
  })] }),
269
- /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("label", {
270
+ /* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V("label", {
270
271
  htmlFor: "msg-category",
271
- className: K,
272
+ className: q,
272
273
  children: n("inbox.logMessageModal.categoryLabel", "Category")
273
- }), /* @__PURE__ */ B("select", {
274
+ }), /* @__PURE__ */ V("select", {
274
275
  id: "msg-category",
275
- value: u,
276
- onChange: (e) => d(e.target.value),
277
- className: G,
278
- children: q.map((e) => /* @__PURE__ */ B("option", {
276
+ value: d,
277
+ onChange: (e) => f(e.target.value),
278
+ className: K,
279
+ children: J.map((e) => /* @__PURE__ */ V("option", {
279
280
  value: e,
280
281
  children: n(Y[e], i(e))
281
282
  }, e))
282
283
  })] }),
283
- /* @__PURE__ */ V("label", {
284
+ /* @__PURE__ */ H("label", {
284
285
  className: "flex items-center gap-2 text-sm text-text-primary",
285
- children: [/* @__PURE__ */ B("input", {
286
+ children: [/* @__PURE__ */ V("input", {
286
287
  type: "checkbox",
287
- checked: f,
288
- onChange: (e) => p(e.target.checked),
288
+ checked: p,
289
+ onChange: (e) => m(e.target.checked),
289
290
  className: "size-4 rounded border-border-subtle"
290
291
  }), n("inbox.logMessageModal.actionRequired", "Requires action")]
291
292
  }),
292
- /* @__PURE__ */ V("div", {
293
+ /* @__PURE__ */ H("div", {
293
294
  className: "flex justify-end gap-3",
294
- children: [/* @__PURE__ */ B("button", {
295
+ children: [/* @__PURE__ */ V("button", {
295
296
  type: "button",
296
297
  onClick: t,
297
298
  className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
298
299
  children: n("inbox.logMessageModal.cancel", "Cancel")
299
- }), /* @__PURE__ */ B("button", {
300
+ }), /* @__PURE__ */ V("button", {
300
301
  type: "submit",
301
302
  disabled: r.isPending,
302
303
  className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50",
@@ -307,67 +308,67 @@ function re({ channel: e, onClose: t }) {
307
308
  })
308
309
  });
309
310
  }
310
- function ie({ channel: e, onVerify: t, verifying: n, onLog: r }) {
311
- let a = y(), s = X[e.type] ?? P, c = e.status === "VERIFIED";
312
- return /* @__PURE__ */ V(H, {
311
+ function ae({ channel: e, onVerify: t, verifying: n, onLog: r }) {
312
+ let a = l(), s = X[e.type] ?? F, c = e.status === "VERIFIED";
313
+ return /* @__PURE__ */ H(U, {
313
314
  treatment: "metric",
314
315
  className: "flex flex-col p-4",
315
316
  children: [
316
- /* @__PURE__ */ V("div", {
317
+ /* @__PURE__ */ H("div", {
317
318
  className: "flex items-start justify-between gap-2",
318
- children: [/* @__PURE__ */ V("div", {
319
+ children: [/* @__PURE__ */ H("div", {
319
320
  className: "flex min-w-0 items-center gap-2.5",
320
- children: [/* @__PURE__ */ B("span", {
321
+ children: [/* @__PURE__ */ V("span", {
321
322
  className: "flex size-9 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-primary",
322
- children: /* @__PURE__ */ B(s, { className: "h-4 w-4" })
323
- }), /* @__PURE__ */ V("div", {
323
+ children: /* @__PURE__ */ V(s, { className: "h-4 w-4" })
324
+ }), /* @__PURE__ */ H("div", {
324
325
  className: "min-w-0",
325
- children: [/* @__PURE__ */ B("p", {
326
+ children: [/* @__PURE__ */ V("p", {
326
327
  className: "truncate text-sm font-semibold text-text-primary",
327
328
  children: i(e.type)
328
- }), e.label && /* @__PURE__ */ B("p", {
329
+ }), e.label && /* @__PURE__ */ V("p", {
329
330
  className: "truncate text-xs text-text-secondary",
330
331
  children: e.label
331
332
  })]
332
333
  })]
333
- }), /* @__PURE__ */ B(o, { status: e.status })]
334
+ }), /* @__PURE__ */ V(o, { status: e.status })]
334
335
  }),
335
- /* @__PURE__ */ V("div", {
336
+ /* @__PURE__ */ H("div", {
336
337
  className: "mt-3 border-t border-border-subtle pt-3",
337
- children: [/* @__PURE__ */ B("p", {
338
+ children: [/* @__PURE__ */ V("p", {
338
339
  className: "text-[11px] uppercase tracking-wide text-text-secondary",
339
340
  children: e.ingestEnabled ? a("inbox.channels.ingestingFrom", "Ingesting from") : a("inbox.channels.ingestPaused", "Ingest paused")
340
- }), /* @__PURE__ */ B("p", {
341
+ }), /* @__PURE__ */ V("p", {
341
342
  className: "mt-0.5 truncate text-sm text-text-primary",
342
343
  title: e.address,
343
344
  children: e.address
344
345
  })]
345
346
  }),
346
- /* @__PURE__ */ V("div", {
347
+ /* @__PURE__ */ H("div", {
347
348
  className: "mt-auto flex flex-wrap items-center gap-2 pt-3",
348
349
  children: [
349
- e.status === "PENDING" && /* @__PURE__ */ V("button", {
350
+ e.status === "PENDING" && /* @__PURE__ */ H("button", {
350
351
  type: "button",
351
352
  disabled: n,
352
353
  onClick: () => t(e.id),
353
354
  className: "inline-flex items-center gap-1 rounded-lg bg-action-primary-bg px-3 py-1.5 text-xs font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50",
354
355
  children: [
355
- /* @__PURE__ */ B(S, { className: "h-3.5 w-3.5" }),
356
+ /* @__PURE__ */ V(C, { className: "h-3.5 w-3.5" }),
356
357
  " ",
357
358
  a("inbox.channels.verify", "Verify")
358
359
  ]
359
360
  }),
360
- c && e.ingestEnabled && /* @__PURE__ */ V("button", {
361
+ c && e.ingestEnabled && /* @__PURE__ */ H("button", {
361
362
  type: "button",
362
363
  onClick: () => r(e),
363
364
  className: "inline-flex items-center gap-1 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
364
365
  children: [
365
- /* @__PURE__ */ B(F, { className: "h-3.5 w-3.5" }),
366
+ /* @__PURE__ */ V(I, { className: "h-3.5 w-3.5" }),
366
367
  " ",
367
368
  a("inbox.channels.logTestMessage", "Log test message")
368
369
  ]
369
370
  }),
370
- e.status === "DISABLED" && /* @__PURE__ */ B("span", {
371
+ e.status === "DISABLED" && /* @__PURE__ */ V("span", {
371
372
  className: "text-xs text-text-secondary",
372
373
  children: a("inbox.channels.disabled", "Channel disabled")
373
374
  })
@@ -376,65 +377,65 @@ function ie({ channel: e, onVerify: t, verifying: n, onLog: r }) {
376
377
  ]
377
378
  });
378
379
  }
379
- function ae() {
380
- let e = y(), { data: t, isLoading: n, isError: r, refetch: i } = p(), a = v(), [o, c] = b(!1), [f, m] = b(null), h = t ?? [], g = h.filter((e) => e.status === "VERIFIED").length, _ = h.filter((e) => e.status === "PENDING").length;
381
- return /* @__PURE__ */ V(d, {
380
+ function oe() {
381
+ let e = l(), { data: t, isLoading: n, isError: r, refetch: i } = m(), a = y(), [o, c] = x(!1), [p, h] = x(null), g = t ?? [], _ = g.filter((e) => e.status === "VERIFIED").length, v = g.filter((e) => e.status === "PENDING").length;
382
+ return /* @__PURE__ */ H(f, {
382
383
  title: e("inbox.channels.title", "Ingest channels"),
383
384
  description: e("inbox.channels.description", "The sources the Universal Inbox pulls subscription communication from"),
384
- action: /* @__PURE__ */ V("button", {
385
+ action: /* @__PURE__ */ H("button", {
385
386
  type: "button",
386
387
  onClick: () => c(!0),
387
388
  className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-3 py-1.5 text-xs font-medium text-action-primary-text hover:opacity-90",
388
389
  children: [
389
- /* @__PURE__ */ B(N, { className: "h-3.5 w-3.5" }),
390
+ /* @__PURE__ */ V(P, { className: "h-3.5 w-3.5" }),
390
391
  " ",
391
392
  e("inbox.channels.add", "Add channel")
392
393
  ]
393
394
  }),
394
395
  children: [
395
- n ? /* @__PURE__ */ B(u, { label: e("inbox.channels.loading", "Loading channels…") }) : r ? /* @__PURE__ */ B(l, {
396
+ n ? /* @__PURE__ */ V(d, { label: e("inbox.channels.loading", "Loading channels…") }) : r ? /* @__PURE__ */ V(u, {
396
397
  message: e("inbox.channels.error", "Could not load channels."),
397
398
  onRetry: () => void i()
398
- }) : h.length === 0 ? /* @__PURE__ */ B(s, {
399
+ }) : g.length === 0 ? /* @__PURE__ */ V(s, {
399
400
  illustration: "empty-data",
400
- icon: /* @__PURE__ */ B(P, { className: "h-12 w-12" }),
401
+ icon: /* @__PURE__ */ V(F, { className: "h-12 w-12" }),
401
402
  title: e("inbox.channels.emptyTitle", "No channels yet"),
402
403
  description: e("inbox.channels.emptyDescription", "Add an email, SMS, Slack or webhook channel to start ingesting subscription communication.")
403
- }) : /* @__PURE__ */ V(z, { children: [(g > 0 || _ > 0) && /* @__PURE__ */ V("div", {
404
+ }) : /* @__PURE__ */ H(B, { children: [(_ > 0 || v > 0) && /* @__PURE__ */ H("div", {
404
405
  className: "mb-3 flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-text-secondary",
405
- children: [/* @__PURE__ */ V("span", {
406
+ children: [/* @__PURE__ */ H("span", {
406
407
  className: "inline-flex items-center gap-1.5",
407
- children: [/* @__PURE__ */ B("span", {
408
+ children: [/* @__PURE__ */ V("span", {
408
409
  className: "size-1.5 rounded-full bg-status-success-text",
409
410
  "aria-hidden": !0
410
- }), e("inbox.channels.verified", "{{count}} verified", { count: g })]
411
- }), _ > 0 && /* @__PURE__ */ V("span", {
411
+ }), e("inbox.channels.verified", "{{count}} verified", { count: _ })]
412
+ }), v > 0 && /* @__PURE__ */ H("span", {
412
413
  className: "inline-flex items-center gap-1.5",
413
- children: [/* @__PURE__ */ B("span", {
414
+ children: [/* @__PURE__ */ V("span", {
414
415
  className: "size-1.5 rounded-full bg-status-warning-text",
415
416
  "aria-hidden": !0
416
- }), e("inbox.channels.pending", "{{count}} pending verification", { count: _ })]
417
+ }), e("inbox.channels.pending", "{{count}} pending verification", { count: v })]
417
418
  })]
418
- }), /* @__PURE__ */ B("div", {
419
+ }), /* @__PURE__ */ V("div", {
419
420
  className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",
420
- children: h.map((e) => /* @__PURE__ */ B(ie, {
421
+ children: g.map((e) => /* @__PURE__ */ V(ae, {
421
422
  channel: e,
422
423
  verifying: a.isPending,
423
424
  onVerify: (e) => a.mutate(e),
424
- onLog: (e) => m(e)
425
+ onLog: (e) => h(e)
425
426
  }, e.id))
426
427
  })] }),
427
- o && /* @__PURE__ */ B(ne, { onClose: () => c(!1) }),
428
- f && /* @__PURE__ */ B(re, {
429
- channel: f,
430
- onClose: () => m(null)
428
+ o && /* @__PURE__ */ V(re, { onClose: () => c(!1) }),
429
+ p && /* @__PURE__ */ V(ie, {
430
+ channel: p,
431
+ onClose: () => h(null)
431
432
  })
432
433
  ]
433
434
  });
434
435
  }
435
- function oe({ message: e, active: n, onSelect: r, onMarkRead: i, markPending: o, onViewRelationship: s }) {
436
- let c = y(), l = !e.isRead;
437
- return /* @__PURE__ */ V("div", {
436
+ function se({ message: e, active: n, onSelect: r, onMarkRead: i, markPending: o, onViewRelationship: s }) {
437
+ let c = l(), u = !e.isRead;
438
+ return /* @__PURE__ */ H("div", {
438
439
  role: "button",
439
440
  tabIndex: 0,
440
441
  "aria-pressed": n,
@@ -442,46 +443,46 @@ function oe({ message: e, active: n, onSelect: r, onMarkRead: i, markPending: o,
442
443
  onKeyDown: (e) => {
443
444
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), r());
444
445
  },
445
- className: t("relative flex cursor-pointer items-start gap-3 p-4 transition-colors", "focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] focus-visible:ring-inset", n ? "bg-bg-sunken" : l ? "bg-accent-wash" : "hover:bg-bg-sunken/60"),
446
+ className: t("relative flex cursor-pointer items-start gap-3 p-4 transition-colors", "focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] focus-visible:ring-inset", n ? "bg-bg-sunken" : u ? "bg-accent-wash" : "hover:bg-bg-sunken/60"),
446
447
  children: [
447
- l && /* @__PURE__ */ B("span", {
448
+ u && /* @__PURE__ */ V("span", {
448
449
  "aria-hidden": !0,
449
450
  className: "absolute inset-y-0 left-0 w-0.5 bg-text-link"
450
451
  }),
451
- /* @__PURE__ */ B("span", {
452
+ /* @__PURE__ */ V("span", {
452
453
  className: "mt-0.5 shrink-0 text-text-secondary",
453
- children: l ? /* @__PURE__ */ B(D, { className: "h-4 w-4 text-text-link" }) : /* @__PURE__ */ B(O, { className: "h-4 w-4" })
454
+ children: u ? /* @__PURE__ */ V(O, { className: "h-4 w-4 text-text-link" }) : /* @__PURE__ */ V(k, { className: "h-4 w-4" })
454
455
  }),
455
- /* @__PURE__ */ V("div", {
456
+ /* @__PURE__ */ H("div", {
456
457
  className: "min-w-0 flex-1",
457
458
  children: [
458
- /* @__PURE__ */ V("div", {
459
+ /* @__PURE__ */ H("div", {
459
460
  className: "flex items-center gap-2",
460
461
  children: [
461
- l && /* @__PURE__ */ B("span", {
462
+ u && /* @__PURE__ */ V("span", {
462
463
  "aria-label": c("inbox.message.unreadAria", "Unread"),
463
464
  className: "size-1.5 shrink-0 rounded-full bg-text-link"
464
465
  }),
465
- /* @__PURE__ */ B("p", {
466
- className: t("min-w-0 flex-1 truncate text-sm", l ? "font-semibold text-text-primary" : "font-normal text-text-primary"),
466
+ /* @__PURE__ */ V("p", {
467
+ className: t("min-w-0 flex-1 truncate text-sm", u ? "font-semibold text-text-primary" : "font-normal text-text-primary"),
467
468
  children: e.subject || c("inbox.message.noSubject", "(no subject)")
468
469
  }),
469
- /* @__PURE__ */ B("span", {
470
+ /* @__PURE__ */ V("span", {
470
471
  className: "shrink-0 text-xs tabular-nums text-text-secondary",
471
472
  children: a(e.receivedAt)
472
473
  })
473
474
  ]
474
475
  }),
475
- e.preview && /* @__PURE__ */ B("p", {
476
+ e.preview && /* @__PURE__ */ V("p", {
476
477
  className: "mt-0.5 line-clamp-2 text-xs text-text-secondary",
477
478
  children: e.preview
478
479
  }),
479
- /* @__PURE__ */ V("div", {
480
+ /* @__PURE__ */ H("div", {
480
481
  className: "mt-1.5 flex flex-wrap items-center gap-2",
481
482
  children: [
482
- /* @__PURE__ */ B(Z, { category: e.category }),
483
- e.actionRequired && /* @__PURE__ */ B(Q, {}),
484
- s && /* @__PURE__ */ B("button", {
483
+ /* @__PURE__ */ V(Z, { category: e.category }),
484
+ e.actionRequired && /* @__PURE__ */ V(Q, {}),
485
+ s && /* @__PURE__ */ V("button", {
485
486
  type: "button",
486
487
  onClick: (e) => {
487
488
  e.stopPropagation(), s();
@@ -489,7 +490,7 @@ function oe({ message: e, active: n, onSelect: r, onMarkRead: i, markPending: o,
489
490
  className: "text-xs font-medium text-text-link hover:underline",
490
491
  children: c("inbox.message.viewRelationship", "View relationship")
491
492
  }),
492
- l && /* @__PURE__ */ B("button", {
493
+ u && /* @__PURE__ */ V("button", {
493
494
  type: "button",
494
495
  disabled: o,
495
496
  onClick: (e) => {
@@ -505,34 +506,34 @@ function oe({ message: e, active: n, onSelect: r, onMarkRead: i, markPending: o,
505
506
  ]
506
507
  });
507
508
  }
508
- function se({ message: e, channel: t, onMarkRead: n, markPending: i, onViewRelationship: a }) {
509
- let o = y();
510
- if (!e) return /* @__PURE__ */ V(H, {
509
+ function ce({ message: e, channel: t, onMarkRead: n, markPending: i, onViewRelationship: a }) {
510
+ let o = l();
511
+ if (!e) return /* @__PURE__ */ H(U, {
511
512
  treatment: "metric",
512
513
  className: "flex min-h-[20rem] flex-col items-center justify-center p-8 text-center",
513
514
  children: [
514
- /* @__PURE__ */ B(j, { className: "h-10 w-10 text-text-secondary" }),
515
- /* @__PURE__ */ B("p", {
515
+ /* @__PURE__ */ V(M, { className: "h-10 w-10 text-text-secondary" }),
516
+ /* @__PURE__ */ V("p", {
516
517
  className: "mt-3 text-sm font-medium text-text-primary",
517
518
  children: o("inbox.readingPane.selectTitle", "Select a message")
518
519
  }),
519
- /* @__PURE__ */ B("p", {
520
+ /* @__PURE__ */ V("p", {
520
521
  className: "mt-1 max-w-[16rem] text-xs text-text-secondary",
521
522
  children: o("inbox.readingPane.selectDescription", "Pick any message from the list to read the full details here.")
522
523
  })
523
524
  ]
524
525
  });
525
- let s = t ? X[t.type] ?? P : P, c = e.categoryConfidence == null ? null : Math.round(Math.max(0, Math.min(1, e.categoryConfidence)) * 100);
526
- return /* @__PURE__ */ V(H, {
526
+ let s = t ? X[t.type] ?? F : F, c = e.categoryConfidence == null ? null : Math.round(Math.max(0, Math.min(1, e.categoryConfidence)) * 100);
527
+ return /* @__PURE__ */ H(U, {
527
528
  treatment: "metric",
528
529
  className: "flex flex-col p-5",
529
530
  children: [
530
- /* @__PURE__ */ V("div", {
531
+ /* @__PURE__ */ H("div", {
531
532
  className: "flex items-start justify-between gap-3",
532
- children: [/* @__PURE__ */ B("h3", {
533
+ children: [/* @__PURE__ */ V("h3", {
533
534
  className: "text-base font-semibold text-text-primary",
534
535
  children: e.subject || o("inbox.message.noSubject", "(no subject)")
535
- }), !e.isRead && /* @__PURE__ */ B("button", {
536
+ }), !e.isRead && /* @__PURE__ */ V("button", {
536
537
  type: "button",
537
538
  disabled: i,
538
539
  onClick: n,
@@ -540,79 +541,79 @@ function se({ message: e, channel: t, onMarkRead: n, markPending: i, onViewRelat
540
541
  children: o("inbox.message.markRead", "Mark read")
541
542
  })]
542
543
  }),
543
- t && /* @__PURE__ */ V("div", {
544
+ t && /* @__PURE__ */ H("div", {
544
545
  className: "mt-2 flex items-center gap-2 text-sm",
545
- children: [/* @__PURE__ */ B(s, { className: "h-4 w-4 shrink-0 text-text-secondary" }), /* @__PURE__ */ B("span", {
546
+ children: [/* @__PURE__ */ V(s, { className: "h-4 w-4 shrink-0 text-text-secondary" }), /* @__PURE__ */ V("span", {
546
547
  className: "truncate text-text-secondary",
547
548
  title: t.address,
548
549
  children: t.address
549
550
  })]
550
551
  }),
551
- /* @__PURE__ */ V("div", {
552
+ /* @__PURE__ */ H("div", {
552
553
  className: "mt-3 flex flex-wrap items-center gap-2",
553
554
  children: [
554
- /* @__PURE__ */ B(Z, { category: e.category }),
555
- e.actionRequired && /* @__PURE__ */ B(Q, {}),
556
- /* @__PURE__ */ B("span", {
555
+ /* @__PURE__ */ V(Z, { category: e.category }),
556
+ e.actionRequired && /* @__PURE__ */ V(Q, {}),
557
+ /* @__PURE__ */ V("span", {
557
558
  className: "text-xs text-text-secondary",
558
559
  children: r(e.receivedAt)
559
560
  })
560
561
  ]
561
562
  }),
562
- c != null && /* @__PURE__ */ V("div", {
563
+ c != null && /* @__PURE__ */ H("div", {
563
564
  className: "mt-4 rounded-lg border border-border-subtle bg-bg-surface p-3",
564
- children: [/* @__PURE__ */ V("div", {
565
+ children: [/* @__PURE__ */ H("div", {
565
566
  className: "flex items-center justify-between text-xs",
566
- children: [/* @__PURE__ */ V("span", {
567
+ children: [/* @__PURE__ */ H("span", {
567
568
  className: "inline-flex items-center gap-1.5 font-medium text-text-primary",
568
569
  children: [
569
- /* @__PURE__ */ B(L, { className: "h-3.5 w-3.5 text-text-link" }),
570
+ /* @__PURE__ */ V(R, { className: "h-3.5 w-3.5 text-text-link" }),
570
571
  " ",
571
572
  o("inbox.readingPane.aiCategorization", "AI categorization")
572
573
  ]
573
- }), /* @__PURE__ */ B("span", {
574
+ }), /* @__PURE__ */ V("span", {
574
575
  className: "tabular-nums text-text-secondary",
575
576
  children: o("inbox.readingPane.confidence", "{{pct}}% confidence", { pct: c })
576
577
  })]
577
- }), /* @__PURE__ */ B(f, {
578
+ }), /* @__PURE__ */ V(p, {
578
579
  value: c,
579
580
  max: 100,
580
581
  tone: c >= 66 ? "positive" : c >= 33 ? "accent" : "warning",
581
582
  className: "mt-2"
582
583
  })]
583
584
  }),
584
- /* @__PURE__ */ B("div", {
585
+ /* @__PURE__ */ V("div", {
585
586
  className: "mt-4 border-t border-border-subtle pt-4",
586
- children: e.preview ? /* @__PURE__ */ B("p", {
587
+ children: e.preview ? /* @__PURE__ */ V("p", {
587
588
  className: "whitespace-pre-wrap text-sm leading-relaxed text-text-primary",
588
589
  children: e.preview
589
- }) : /* @__PURE__ */ B("p", {
590
+ }) : /* @__PURE__ */ V("p", {
590
591
  className: "text-sm italic text-text-secondary",
591
592
  children: o("inbox.readingPane.noPreview", "No preview available for this message.")
592
593
  })
593
594
  }),
594
- e.actionRequired && /* @__PURE__ */ V("div", {
595
+ e.actionRequired && /* @__PURE__ */ H("div", {
595
596
  className: "mt-4 flex items-start gap-2 rounded-lg border border-status-warning-text/30 bg-status-warning-bg-subtle p-3",
596
- children: [/* @__PURE__ */ B(I, { className: "mt-0.5 h-4 w-4 shrink-0 text-status-warning-text" }), /* @__PURE__ */ B("p", {
597
+ children: [/* @__PURE__ */ V(L, { className: "mt-0.5 h-4 w-4 shrink-0 text-status-warning-text" }), /* @__PURE__ */ V("p", {
597
598
  className: "text-xs text-status-warning-text",
598
599
  children: o("inbox.readingPane.attention", "This message needs your attention — review it before its provider deadline.")
599
600
  })]
600
601
  }),
601
- a && /* @__PURE__ */ V("button", {
602
+ a && /* @__PURE__ */ H("button", {
602
603
  type: "button",
603
604
  onClick: a,
604
605
  className: "mt-4 inline-flex items-center gap-1 self-start text-sm font-medium text-text-link hover:underline",
605
606
  children: [
606
607
  o("inbox.message.viewRelationship", "View relationship"),
607
608
  " ",
608
- /* @__PURE__ */ B(w, { className: "h-4 w-4" })
609
+ /* @__PURE__ */ V(T, { className: "h-4 w-4" })
609
610
  ]
610
611
  })
611
612
  ]
612
613
  });
613
614
  }
614
615
  function $({ active: e, onClick: n, children: r, tone: i = "default" }) {
615
- return /* @__PURE__ */ B("button", {
616
+ return /* @__PURE__ */ V("button", {
616
617
  type: "button",
617
618
  onClick: n,
618
619
  "aria-pressed": e,
@@ -620,158 +621,158 @@ function $({ active: e, onClick: n, children: r, tone: i = "default" }) {
620
621
  children: r
621
622
  });
622
623
  }
623
- function ce() {
624
- let r = y(), { navigateTo: i } = e(), [a, o] = b(0), [c, d] = b(""), [f, m] = b(!1), [g, v] = b(!1), [S, C] = b(null), { data: w, isLoading: T, isError: O, refetch: k, isFetching: A } = h({
624
+ function le() {
625
+ let r = l(), { navigateTo: i } = e(), [a, o] = x(0), [c, f] = x(""), [p, h] = x(!1), [_, y] = x(!1), [C, w] = b("inbox"), { data: T, isLoading: E, isError: k, refetch: A, isFetching: j } = g({
625
626
  category: c || void 0,
626
- unreadOnly: f || void 0,
627
+ unreadOnly: p || void 0,
627
628
  pagination: {
628
- limit: W,
629
- offset: a * W
629
+ limit: G,
630
+ offset: a * G
630
631
  }
631
- }), { data: j } = p(), M = _(), N = w?.items ?? [], P = w?.pageInfo.hasMore ?? !1, F = g ? N.filter((e) => e.actionRequired) : N, I = N.filter((e) => !e.isRead).length, L = N.filter((e) => e.actionRequired).length, R = new Map((j ?? []).map((e) => [e.id, e])), z = F.find((e) => e.id === S) ?? null, H = z ? R.get(z.channelId) : void 0, G = () => {
632
- o(0), C(null);
632
+ }), { data: M } = m(), N = v(), P = T?.items ?? [], F = T?.pageInfo.hasMore ?? !1, I = _ ? P.filter((e) => e.actionRequired) : P, L = P.filter((e) => !e.isRead).length, R = P.filter((e) => e.actionRequired).length, z = new Map((M ?? []).map((e) => [e.id, e])), B = I.find((e) => e.id === C) ?? null, U = B ? z.get(B.channelId) : void 0, K = () => {
633
+ o(0), w(null);
633
634
  };
634
- return /* @__PURE__ */ V(n, {
635
+ return /* @__PURE__ */ H(n, {
635
636
  title: r("inbox.title", "Universal Inbox"),
636
637
  description: r("inbox.description", "Every subscription communication, merged and categorized"),
637
638
  children: [
638
- /* @__PURE__ */ B(U, {
639
+ /* @__PURE__ */ V(W, {
639
640
  className: "mb-4",
640
641
  children: r("inbox.purpose", "Subscription communication is noisy and scattered. The Universal Inbox merges every channel a provider uses and uses AI to categorize each message so you never miss a renewal, required action or security notice.")
641
642
  }),
642
- /* @__PURE__ */ B("div", {
643
+ /* @__PURE__ */ V("div", {
643
644
  className: "-mx-1 flex gap-2 overflow-x-auto px-1 pb-1",
644
- children: ee.map((e) => /* @__PURE__ */ B("span", {
645
+ children: te.map((e) => /* @__PURE__ */ V("span", {
645
646
  className: "shrink-0",
646
- children: /* @__PURE__ */ B($, {
647
+ children: /* @__PURE__ */ V($, {
647
648
  active: c === e.value,
648
649
  onClick: () => {
649
- d(e.value), G();
650
+ f(e.value), K();
650
651
  },
651
652
  children: r(e.key, e.fallback)
652
653
  })
653
654
  }, e.value))
654
655
  }),
655
- /* @__PURE__ */ V("div", {
656
+ /* @__PURE__ */ H("div", {
656
657
  className: "mt-3 flex flex-wrap items-center gap-2",
657
658
  children: [
658
- /* @__PURE__ */ V($, {
659
- active: g,
659
+ /* @__PURE__ */ H($, {
660
+ active: _,
660
661
  tone: "warning",
661
662
  onClick: () => {
662
- v((e) => !e), C(null);
663
+ y((e) => !e), w(null);
663
664
  },
664
665
  children: [
665
- /* @__PURE__ */ B(x, { className: "h-3.5 w-3.5" }),
666
+ /* @__PURE__ */ V(S, { className: "h-3.5 w-3.5" }),
666
667
  " ",
667
668
  r("inbox.filters.actionRequired", "Action required")
668
669
  ]
669
670
  }),
670
- /* @__PURE__ */ V($, {
671
- active: f,
671
+ /* @__PURE__ */ H($, {
672
+ active: p,
672
673
  onClick: () => {
673
- m((e) => !e), G();
674
+ h((e) => !e), K();
674
675
  },
675
676
  children: [
676
- /* @__PURE__ */ B(D, { className: "h-3.5 w-3.5" }),
677
+ /* @__PURE__ */ V(O, { className: "h-3.5 w-3.5" }),
677
678
  " ",
678
679
  r("inbox.filters.unreadOnly", "Unread only")
679
680
  ]
680
681
  }),
681
- !T && !O && N.length > 0 && /* @__PURE__ */ V("p", {
682
+ !E && !k && P.length > 0 && /* @__PURE__ */ H("p", {
682
683
  className: "ml-auto text-xs text-text-secondary",
683
684
  children: [
684
- r("inbox.filters.unreadCount", "{{count}} unread", { count: I }),
685
+ r("inbox.filters.unreadCount", "{{count}} unread", { count: L }),
685
686
  " · ",
686
- r("inbox.filters.actionCount", "{{count}} need action", { count: L }),
687
- A ? ` · ${r("inbox.filters.refreshing", "refreshing…")}` : ""
687
+ r("inbox.filters.actionCount", "{{count}} need action", { count: R }),
688
+ j ? ` · ${r("inbox.filters.refreshing", "refreshing…")}` : ""
688
689
  ]
689
690
  })
690
691
  ]
691
692
  }),
692
- T ? /* @__PURE__ */ B(u, { label: r("inbox.loading", "Loading inbox…") }) : O ? /* @__PURE__ */ B(l, {
693
+ E ? /* @__PURE__ */ V(d, { label: r("inbox.loading", "Loading inbox…") }) : k ? /* @__PURE__ */ V(u, {
693
694
  message: r("inbox.error", "Could not load the inbox."),
694
- onRetry: () => void k()
695
- }) : N.length === 0 ? /* @__PURE__ */ B("div", {
695
+ onRetry: () => void A()
696
+ }) : P.length === 0 ? /* @__PURE__ */ V("div", {
696
697
  className: "mt-6",
697
- children: /* @__PURE__ */ B(s, {
698
+ children: /* @__PURE__ */ V(s, {
698
699
  illustration: "empty-inbox",
699
- icon: /* @__PURE__ */ B(E, { className: "h-12 w-12" }),
700
+ icon: /* @__PURE__ */ V(D, { className: "h-12 w-12" }),
700
701
  title: r("inbox.emptyTitle", "Inbox is empty"),
701
- description: f || c ? r("inbox.emptyDescriptionFiltered", "No messages match these filters.") : r("inbox.emptyDescription", "Merged subscription communications will appear here once channels start ingesting.")
702
+ description: p || c ? r("inbox.emptyDescriptionFiltered", "No messages match these filters.") : r("inbox.emptyDescription", "Merged subscription communications will appear here once channels start ingesting.")
702
703
  })
703
- }) : /* @__PURE__ */ V("div", {
704
+ }) : /* @__PURE__ */ H("div", {
704
705
  className: "mt-5 grid grid-cols-1 gap-5 lg:grid-cols-[minmax(0,1fr)_380px]",
705
- children: [/* @__PURE__ */ V("div", {
706
+ children: [/* @__PURE__ */ H("div", {
706
707
  className: "min-w-0",
707
- children: [F.length === 0 ? /* @__PURE__ */ V("div", {
708
+ children: [I.length === 0 ? /* @__PURE__ */ H("div", {
708
709
  className: "rounded-xl border border-border-subtle bg-bg-surface p-8 text-center",
709
710
  children: [
710
- /* @__PURE__ */ B(x, { className: "mx-auto h-8 w-8 text-text-secondary" }),
711
- /* @__PURE__ */ B("p", {
711
+ /* @__PURE__ */ V(S, { className: "mx-auto h-8 w-8 text-text-secondary" }),
712
+ /* @__PURE__ */ V("p", {
712
713
  className: "mt-2 text-sm font-medium text-text-primary",
713
714
  children: r("inbox.noActionTitle", "No action-required messages on this page")
714
715
  }),
715
- /* @__PURE__ */ B("p", {
716
+ /* @__PURE__ */ V("p", {
716
717
  className: "mt-1 text-xs text-text-secondary",
717
718
  children: r("inbox.noActionDescription", "Turn off the “Action required” lens or move to another page.")
718
719
  })
719
720
  ]
720
- }) : /* @__PURE__ */ B("div", {
721
+ }) : /* @__PURE__ */ V("div", {
721
722
  className: "divide-y divide-border-subtle overflow-hidden rounded-xl border border-border-subtle bg-bg-surface",
722
- children: F.map((e) => /* @__PURE__ */ B(oe, {
723
+ children: I.map((e) => /* @__PURE__ */ V(se, {
723
724
  message: e,
724
- active: e.id === S,
725
- onSelect: () => C(e.id),
726
- onMarkRead: () => M.mutate(e.id),
727
- markPending: M.isPending,
725
+ active: e.id === C,
726
+ onSelect: () => w(e.id),
727
+ onMarkRead: () => N.mutate(e.id),
728
+ markPending: N.isPending,
728
729
  onViewRelationship: e.relationshipId ? () => i(`/relationships/${e.relationshipId}`) : null
729
730
  }, e.id))
730
- }), /* @__PURE__ */ V("div", {
731
+ }), /* @__PURE__ */ H("div", {
731
732
  className: "mt-4 flex items-center justify-between",
732
- children: [/* @__PURE__ */ V("p", {
733
+ children: [/* @__PURE__ */ H("p", {
733
734
  className: "text-xs text-text-secondary",
734
- children: [r("inbox.pagination.page", "Page {{page}}", { page: a + 1 }), A ? ` · ${r("inbox.filters.refreshing", "refreshing…")}` : ""]
735
- }), /* @__PURE__ */ V("div", {
735
+ children: [r("inbox.pagination.page", "Page {{page}}", { page: a + 1 }), j ? ` · ${r("inbox.filters.refreshing", "refreshing…")}` : ""]
736
+ }), /* @__PURE__ */ H("div", {
736
737
  className: "flex gap-2",
737
- children: [/* @__PURE__ */ B("button", {
738
+ children: [/* @__PURE__ */ V("button", {
738
739
  type: "button",
739
740
  disabled: a === 0,
740
741
  onClick: () => {
741
- o((e) => Math.max(0, e - 1)), C(null);
742
+ o((e) => Math.max(0, e - 1)), w(null);
742
743
  },
743
744
  className: t("rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium", a === 0 ? "cursor-not-allowed text-text-secondary opacity-50" : "text-text-primary hover:bg-bg-sunken"),
744
745
  children: r("inbox.pagination.previous", "Previous")
745
- }), /* @__PURE__ */ B("button", {
746
+ }), /* @__PURE__ */ V("button", {
746
747
  type: "button",
747
- disabled: !P,
748
+ disabled: !F,
748
749
  onClick: () => {
749
- o((e) => e + 1), C(null);
750
+ o((e) => e + 1), w(null);
750
751
  },
751
- className: t("rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium", P ? "text-text-primary hover:bg-bg-sunken" : "cursor-not-allowed text-text-secondary opacity-50"),
752
+ className: t("rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium", F ? "text-text-primary hover:bg-bg-sunken" : "cursor-not-allowed text-text-secondary opacity-50"),
752
753
  children: r("inbox.pagination.next", "Next")
753
754
  })]
754
755
  })]
755
756
  })]
756
- }), /* @__PURE__ */ B("aside", {
757
+ }), /* @__PURE__ */ V("aside", {
757
758
  className: "hidden lg:block",
758
- children: /* @__PURE__ */ B("div", {
759
+ children: /* @__PURE__ */ V("div", {
759
760
  className: "lg:sticky lg:top-4",
760
- children: /* @__PURE__ */ B(se, {
761
- message: z,
762
- channel: H,
763
- onMarkRead: () => z && M.mutate(z.id),
764
- markPending: M.isPending,
765
- onViewRelationship: z?.relationshipId ? () => i(`/relationships/${z.relationshipId}`) : null
761
+ children: /* @__PURE__ */ V(ce, {
762
+ message: B,
763
+ channel: U,
764
+ onMarkRead: () => B && N.mutate(B.id),
765
+ markPending: N.isPending,
766
+ onViewRelationship: B?.relationshipId ? () => i(`/relationships/${B.relationshipId}`) : null
766
767
  })
767
768
  })
768
769
  })]
769
770
  }),
770
- /* @__PURE__ */ B(ae, {})
771
+ /* @__PURE__ */ V(oe, {})
771
772
  ]
772
773
  });
773
774
  }
774
775
  //#endregion
775
- export { ce as InboxPage };
776
+ export { le as InboxPage };
776
777
 
777
778
  //# sourceMappingURL=InboxPage.js.map