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