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