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