@burdenoff/microfe-subscriberbot 2026.1107.8 → 2026.1110.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/node_modules/clsx/dist/clsx.js +8 -7
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +134 -151
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
- package/dist/subscriberbot/SubscriberBotRoot.js +10 -7
- package/dist/subscriberbot/SubscriberBotRoot.js.map +1 -1
- package/dist/subscriberbot/SubscriberBotRoutes.js +1 -2
- package/dist/subscriberbot/SubscriberBotRoutes.js.map +1 -1
- package/dist/subscriberbot/admin/AdminDashboardPage.js +9 -10
- package/dist/subscriberbot/admin/AdminDashboardPage.js.map +1 -1
- package/dist/subscriberbot/admin/AdminRoot.js +2 -3
- package/dist/subscriberbot/admin/AdminRoot.js.map +1 -1
- package/dist/subscriberbot/admin/NegotiationDeskPanel.js +56 -57
- package/dist/subscriberbot/admin/NegotiationDeskPanel.js.map +1 -1
- package/dist/subscriberbot/admin/ProcurementDeskPanel.js +107 -108
- package/dist/subscriberbot/admin/ProcurementDeskPanel.js.map +1 -1
- package/dist/subscriberbot/admin/index.js +1 -1
- package/dist/subscriberbot/components/EmptyState.js +1 -2
- package/dist/subscriberbot/components/EmptyState.js.map +1 -1
- package/dist/subscriberbot/components/MetricsCard.js +1 -2
- package/dist/subscriberbot/components/MetricsCard.js.map +1 -1
- package/dist/subscriberbot/components/Modal.js +2 -3
- package/dist/subscriberbot/components/Modal.js.map +1 -1
- package/dist/subscriberbot/components/PageLayout.js +1 -2
- package/dist/subscriberbot/components/PageLayout.js.map +1 -1
- package/dist/subscriberbot/components/PostureOptions.js +7 -8
- package/dist/subscriberbot/components/PostureOptions.js.map +1 -1
- package/dist/subscriberbot/components/StateViews.js +1 -2
- package/dist/subscriberbot/components/StateViews.js.map +1 -1
- package/dist/subscriberbot/components/StatusBadge.js +2 -3
- package/dist/subscriberbot/components/StatusBadge.js.map +1 -1
- package/dist/subscriberbot/components/decisions/DecisionBanners.js +7 -8
- package/dist/subscriberbot/components/decisions/DecisionBanners.js.map +1 -1
- package/dist/subscriberbot/components/decisions/DecisionCard.js +65 -66
- package/dist/subscriberbot/components/decisions/DecisionCard.js.map +1 -1
- package/dist/subscriberbot/components/decisions/decisionModel.js +2 -3
- package/dist/subscriberbot/components/decisions/decisionModel.js.map +1 -1
- package/dist/subscriberbot/components/decisions/index.js +4 -3
- package/dist/subscriberbot/components/index.js +8 -7
- package/dist/subscriberbot/components/mobile/MobileDashboard.js +23 -24
- package/dist/subscriberbot/components/mobile/MobileDashboard.js.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.js +40 -49
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.js.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileScreen.js +1 -2
- package/dist/subscriberbot/components/mobile/MobileScreen.js.map +1 -1
- package/dist/subscriberbot/components/mobile/RelationshipGlyph.js +1 -2
- package/dist/subscriberbot/components/mobile/RelationshipGlyph.js.map +1 -1
- package/dist/subscriberbot/components/mobile/index.js +4 -3
- package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.js +1 -2
- package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.js.map +1 -1
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js +4 -5
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js.map +1 -1
- package/dist/subscriberbot/components/negotiations/OutcomeForm.js +4 -5
- package/dist/subscriberbot/components/negotiations/OutcomeForm.js.map +1 -1
- package/dist/subscriberbot/components/negotiations/index.js +5 -4
- package/dist/subscriberbot/components/negotiations/labels.js +1 -2
- package/dist/subscriberbot/components/negotiations/labels.js.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js +4 -5
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementStatusPill.js +1 -2
- package/dist/subscriberbot/components/procurement/ProcurementStatusPill.js.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementThread.js +4 -5
- package/dist/subscriberbot/components/procurement/ProcurementThread.js.map +1 -1
- package/dist/subscriberbot/components/procurement/index.js +5 -4
- package/dist/subscriberbot/components/procurement/labels.js +1 -2
- package/dist/subscriberbot/components/procurement/labels.js.map +1 -1
- package/dist/subscriberbot/components/savings/SavingsCards.js +90 -91
- package/dist/subscriberbot/components/savings/SavingsCards.js.map +1 -1
- package/dist/subscriberbot/components/savings/index.js +3 -2
- package/dist/subscriberbot/components/savings/savingsModel.js +2 -3
- package/dist/subscriberbot/components/savings/savingsModel.js.map +1 -1
- package/dist/subscriberbot/components/viz.js +2 -3
- package/dist/subscriberbot/components/viz.js.map +1 -1
- package/dist/subscriberbot/context/SubscriberBotContext.js +3 -3
- package/dist/subscriberbot/context/SubscriberBotContext.js.map +1 -1
- package/dist/subscriberbot/context/index.js +1 -1
- package/dist/subscriberbot/hooks/index.js +2 -2
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.js +2 -3
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.js.map +1 -1
- package/dist/subscriberbot/hooks/useBankingApi.js +2 -3
- package/dist/subscriberbot/hooks/useBankingApi.js.map +1 -1
- package/dist/subscriberbot/hooks/useCompactViewport.js +1 -2
- package/dist/subscriberbot/hooks/useCompactViewport.js.map +1 -1
- package/dist/subscriberbot/hooks/useFormError.js +1 -2
- package/dist/subscriberbot/hooks/useFormError.js.map +1 -1
- package/dist/subscriberbot/hooks/useFormatters.js +1 -2
- package/dist/subscriberbot/hooks/useFormatters.js.map +1 -1
- package/dist/subscriberbot/hooks/useNegotiationApi.js +2 -3
- package/dist/subscriberbot/hooks/useNegotiationApi.js.map +1 -1
- package/dist/subscriberbot/hooks/useProcurementApi.js +2 -3
- package/dist/subscriberbot/hooks/useProcurementApi.js.map +1 -1
- package/dist/subscriberbot/hooks/useRouteSelection.js +3 -3
- package/dist/subscriberbot/hooks/useRouteSelection.js.map +1 -1
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js +1 -2
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
- package/dist/subscriberbot/hooks/useTr.js +1 -2
- package/dist/subscriberbot/hooks/useTr.js.map +1 -1
- package/dist/subscriberbot/index.js +9 -8
- package/dist/subscriberbot/pages/AssetVaultPage.js +34 -35
- package/dist/subscriberbot/pages/AssetVaultPage.js.map +1 -1
- package/dist/subscriberbot/pages/DashboardPage.js +86 -87
- package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
- package/dist/subscriberbot/pages/InboxPage.js +194 -199
- package/dist/subscriberbot/pages/InboxPage.js.map +1 -1
- package/dist/subscriberbot/pages/InsightsPage.js +28 -29
- package/dist/subscriberbot/pages/InsightsPage.js.map +1 -1
- package/dist/subscriberbot/pages/InvoicesPage.js +179 -188
- package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -1
- package/dist/subscriberbot/pages/RenewalsPage.js +293 -298
- package/dist/subscriberbot/pages/RenewalsPage.js.map +1 -1
- package/dist/subscriberbot/pages/SavingsPage.js +25 -26
- package/dist/subscriberbot/pages/SavingsPage.js.map +1 -1
- package/dist/subscriberbot/pages/WorkflowsPage.js +67 -68
- package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js +126 -127
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentNewPage.js +10 -11
- package/dist/subscriberbot/pages/agents/AgentNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.js +23 -24
- package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.js +337 -359
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.js.map +1 -1
- package/dist/subscriberbot/pages/banking/ConnectBankModal.js +22 -27
- package/dist/subscriberbot/pages/banking/ConnectBankModal.js.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js +25 -26
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionsPage.js +34 -35
- package/dist/subscriberbot/pages/decisions/DecisionsPage.js.map +1 -1
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js +125 -130
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js +94 -95
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js +15 -16
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js +20 -21
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js +86 -87
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js +164 -165
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementPage.js +20 -21
- package/dist/subscriberbot/pages/procurement/ProcurementPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +350 -351
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderInsights.js +95 -96
- package/dist/subscriberbot/pages/providers/ProviderInsights.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js +11 -12
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js +62 -63
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +166 -172
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +12 -13
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +21 -22
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js +242 -255
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js.map +1 -1
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js +2 -3
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js.map +1 -1
- package/dist/subscriberbot/services/createSandboxAssistantTransport.js +1 -2
- package/dist/subscriberbot/services/createSandboxAssistantTransport.js.map +1 -1
- package/dist/subscriberbot/store/index.js +1 -1
- package/dist/subscriberbot/store/subscriberbotStore.js +1 -2
- package/dist/subscriberbot/store/subscriberbotStore.js.map +1 -1
- package/dist/subscriberbot/utils/bankRedirectLink.js +18 -19
- package/dist/subscriberbot/utils/bankRedirectLink.js.map +1 -1
- package/dist/subscriberbot/utils/chartScale.js +1 -2
- package/dist/subscriberbot/utils/chartScale.js.map +1 -1
- package/dist/subscriberbot/utils/cn.js +2 -3
- package/dist/subscriberbot/utils/cn.js.map +1 -1
- package/dist/subscriberbot/utils/formatters.js +4 -5
- package/dist/subscriberbot/utils/formatters.js.map +1 -1
- package/dist/subscriberbot/utils/navigation.js +1 -2
- package/dist/subscriberbot/utils/navigation.js.map +1 -1
- package/dist/subscriberbot/utils/pageContext.js +3 -4
- package/dist/subscriberbot/utils/pageContext.js.map +1 -1
- package/dist/subscriberbot/utils/plaidLink.js +21 -22
- package/dist/subscriberbot/utils/plaidLink.js.map +1 -1
- package/dist/subscriberbot/utils/portfolio.js +5 -6
- package/dist/subscriberbot/utils/portfolio.js.map +1 -1
- package/dist/subscriberbot/utils/renewals.js +1 -2
- package/dist/subscriberbot/utils/renewals.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useTr as t } from "../hooks/useTr.js";
|
|
3
|
-
import { useFormatters as n } from "../hooks/useFormatters.js";
|
|
4
|
-
import { PageLayout as r } from "../components/PageLayout.js";
|
|
5
|
-
import { MetricsCard as i } from "../components/MetricsCard.js";
|
|
6
|
-
import { StatusBadge as a } from "../components/StatusBadge.js";
|
|
7
|
-
import { EmptyState as o } from "../components/EmptyState.js";
|
|
8
|
-
import { ErrorView as ee, LoadingView as te, Section as s } from "../components/StateViews.js";
|
|
9
|
-
import { Donut as c, Legend as l, Timeline as u } from "../components/viz.js";
|
|
1
|
+
import { useFormatters as e } from "../hooks/useFormatters.js";
|
|
10
2
|
import "../components/index.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
3
|
+
import { useSubscriberBot as t } from "../context/SubscriberBotContext.js";
|
|
4
|
+
import { PageLayout as n } from "../components/PageLayout.js";
|
|
5
|
+
import { MetricsCard as r } from "../components/MetricsCard.js";
|
|
6
|
+
import { StatusBadge as i } from "../components/StatusBadge.js";
|
|
7
|
+
import { EmptyState as a } from "../components/EmptyState.js";
|
|
8
|
+
import { ErrorView as ee, LoadingView as te, Section as o } from "../components/StateViews.js";
|
|
9
|
+
import { Donut as s, Legend as c, Timeline as l } from "../components/viz.js";
|
|
10
|
+
import { useDecisions as u, useInboxMessages as d, useInvoices as f, useRelationships as p, useRenewalEvents as ne } from "../hooks/useSubscriberBotApi.js";
|
|
11
|
+
import { useTr as re } from "../hooks/useTr.js";
|
|
12
|
+
import { buildUpcomingRenewals as m, recurringSpend as h } from "../utils/portfolio.js";
|
|
13
|
+
import { useCompactViewport as g } from "../hooks/useCompactViewport.js";
|
|
14
|
+
import { MobileDashboard as _ } from "../components/mobile/MobileDashboard.js";
|
|
15
15
|
import "../components/mobile/index.js";
|
|
16
16
|
import { useMemo as v } from "react";
|
|
17
|
-
import { AlertTriangle as y, ArrowRight as b, ArrowUpRight as x, Bot as S, CalendarClock as C, Inbox as w, Repeat2 as T, ShieldCheck as E, Sparkles as
|
|
18
|
-
import { jsx as
|
|
19
|
-
import { GlassCard as
|
|
20
|
-
|
|
17
|
+
import { AlertTriangle as y, ArrowRight as b, ArrowUpRight as x, Bot as S, CalendarClock as C, Inbox as w, Repeat2 as T, ShieldCheck as E, Sparkles as D, Wallet as ie } from "lucide-react";
|
|
18
|
+
import { jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
19
|
+
import { GlassCard as A, PagePurpose as ae } from "@burdenoff/fe-libs/ui";
|
|
20
|
+
// src/subscriberbot/pages/DashboardPage.tsx
|
|
21
21
|
function j() {
|
|
22
|
-
let { formatCurrency: j, formatEnumLabel: M, formatRelativeTime: N } =
|
|
22
|
+
let { formatCurrency: j, formatEnumLabel: M, formatRelativeTime: N } = e(), { navigateTo: P, currentUser: F } = t(), I = re(), L = p({ pagination: {
|
|
23
23
|
limit: 100,
|
|
24
24
|
offset: 0
|
|
25
|
-
} }), R =
|
|
25
|
+
} }), R = f({ pagination: {
|
|
26
26
|
limit: 50,
|
|
27
27
|
offset: 0
|
|
28
|
-
} }), z =
|
|
28
|
+
} }), z = d({ pagination: {
|
|
29
29
|
limit: 50,
|
|
30
30
|
offset: 0
|
|
31
|
-
} }), B =
|
|
31
|
+
} }), B = ne({ upcomingOnly: !0 }), V = g(), H = u({ status: "PROPOSED" }, { enabled: V }), U = v(() => L.data?.items ?? [], [L.data]), W = v(() => R.data?.items ?? [], [R.data]), G = v(() => z.data?.items ?? [], [z.data]), K = v(() => B.data ?? [], [B.data]), q = v(() => {
|
|
32
32
|
let e = /* @__PURE__ */ new Map();
|
|
33
33
|
return U.forEach((t) => e.set(t.id, t)), e;
|
|
34
34
|
}, [U]), J = v(() => {
|
|
35
|
-
let e =
|
|
35
|
+
let e = h(U), t = G.filter((e) => e.actionRequired).length, n = W.filter((e) => e.status === "ISSUED" || e.status === "OVERDUE" || e.status === "FAILED"), r = n.reduce((e, t) => e + t.total, 0), i = U.filter((e) => e.status === "PAST_DUE" || e.status === "LAPSED").length;
|
|
36
36
|
return {
|
|
37
37
|
activeCount: e.activeCount,
|
|
38
38
|
totalCount: U.length,
|
|
@@ -53,7 +53,7 @@ function j() {
|
|
|
53
53
|
label: M(e),
|
|
54
54
|
value: t
|
|
55
55
|
}));
|
|
56
|
-
}, [U, M]), X = v(() =>
|
|
56
|
+
}, [U, M]), X = v(() => m(U, K, (e) => M(e)), [
|
|
57
57
|
U,
|
|
58
58
|
K,
|
|
59
59
|
M
|
|
@@ -68,17 +68,17 @@ function j() {
|
|
|
68
68
|
j,
|
|
69
69
|
N
|
|
70
70
|
]), Q = v(() => G.filter((e) => e.actionRequired), [G]), oe = L.isLoading || R.isLoading || z.isLoading || B.isLoading, se = L.isError && R.isError && z.isError && B.isError;
|
|
71
|
-
if (oe) return /* @__PURE__ */
|
|
71
|
+
if (oe) return /* @__PURE__ */ O(n, {
|
|
72
72
|
dataTour: "subscriberbot-home",
|
|
73
73
|
title: I("dashboard.title", "Overview"),
|
|
74
74
|
description: I("dashboard.description", "Your recurring digital relationships at a glance"),
|
|
75
|
-
children: /* @__PURE__ */
|
|
75
|
+
children: /* @__PURE__ */ O(te, { label: I("dashboard.loading", "Loading your subscription portfolio…") })
|
|
76
76
|
});
|
|
77
|
-
if (se) return /* @__PURE__ */
|
|
77
|
+
if (se) return /* @__PURE__ */ O(n, {
|
|
78
78
|
dataTour: "subscriberbot-home",
|
|
79
79
|
title: I("dashboard.title", "Overview"),
|
|
80
80
|
description: I("dashboard.description", "Your recurring digital relationships at a glance"),
|
|
81
|
-
children: /* @__PURE__ */
|
|
81
|
+
children: /* @__PURE__ */ O(ee, {
|
|
82
82
|
message: I("dashboard.error", "We couldn't reach the Subscriber Bot service. Please try again."),
|
|
83
83
|
onRetry: () => {
|
|
84
84
|
L.refetch(), R.refetch(), z.refetch(), B.refetch();
|
|
@@ -86,7 +86,7 @@ function j() {
|
|
|
86
86
|
})
|
|
87
87
|
});
|
|
88
88
|
let $ = F?.firstName || F?.name?.split(" ")[0];
|
|
89
|
-
if (V) return /* @__PURE__ */
|
|
89
|
+
if (V) return /* @__PURE__ */ O(_, {
|
|
90
90
|
greetingName: $ || void 0,
|
|
91
91
|
spend: {
|
|
92
92
|
monthly: J.monthlySpend,
|
|
@@ -107,7 +107,7 @@ function j() {
|
|
|
107
107
|
descriptionKey: "dashboard.quickActions.addRelationship.description",
|
|
108
108
|
fallbackLabel: "Add a relationship",
|
|
109
109
|
fallbackDescription: "Track a new subscription",
|
|
110
|
-
icon: /* @__PURE__ */
|
|
110
|
+
icon: /* @__PURE__ */ O(T, { className: "h-5 w-5" }),
|
|
111
111
|
path: "/relationships/new"
|
|
112
112
|
},
|
|
113
113
|
{
|
|
@@ -115,7 +115,7 @@ function j() {
|
|
|
115
115
|
descriptionKey: "dashboard.quickActions.discoverProviders.description",
|
|
116
116
|
fallbackLabel: "Discover providers",
|
|
117
117
|
fallbackDescription: "Browse the registry",
|
|
118
|
-
icon: /* @__PURE__ */ D
|
|
118
|
+
icon: /* @__PURE__ */ O(D, { className: "h-5 w-5" }),
|
|
119
119
|
path: "/providers"
|
|
120
120
|
},
|
|
121
121
|
{
|
|
@@ -123,7 +123,7 @@ function j() {
|
|
|
123
123
|
descriptionKey: "dashboard.quickActions.openInbox.description",
|
|
124
124
|
fallbackLabel: "Open inbox",
|
|
125
125
|
fallbackDescription: "Merged communications",
|
|
126
|
-
icon: /* @__PURE__ */
|
|
126
|
+
icon: /* @__PURE__ */ O(w, { className: "h-5 w-5" }),
|
|
127
127
|
path: "/inbox"
|
|
128
128
|
},
|
|
129
129
|
{
|
|
@@ -131,156 +131,156 @@ function j() {
|
|
|
131
131
|
descriptionKey: "dashboard.quickActions.configureAgents.description",
|
|
132
132
|
fallbackLabel: "Configure agents",
|
|
133
133
|
fallbackDescription: "Automate your portfolio",
|
|
134
|
-
icon: /* @__PURE__ */
|
|
134
|
+
icon: /* @__PURE__ */ O(S, { className: "h-5 w-5" }),
|
|
135
135
|
path: "/agents"
|
|
136
136
|
}
|
|
137
137
|
];
|
|
138
|
-
return /* @__PURE__ */
|
|
138
|
+
return /* @__PURE__ */ k(n, {
|
|
139
139
|
dataTour: "subscriberbot-home",
|
|
140
140
|
title: $ ? I("dashboard.welcomeBack", "Welcome back, {{name}}", { name: $ }) : I("dashboard.title", "Overview"),
|
|
141
141
|
description: I("dashboard.description", "Everything you pay for on repeat — in one intelligent console."),
|
|
142
142
|
children: [
|
|
143
|
-
/* @__PURE__ */
|
|
143
|
+
/* @__PURE__ */ O(ae, {
|
|
144
144
|
className: "mb-6",
|
|
145
145
|
children: I("dashboard.purpose", "Subscriber Bot is your system of record for every recurring digital relationship. See total recurring spend, what renews next, what needs action, and what to optimize — all from real data across your providers.")
|
|
146
146
|
}),
|
|
147
|
-
/* @__PURE__ */
|
|
147
|
+
/* @__PURE__ */ k("div", {
|
|
148
148
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
149
149
|
"data-tour": "subscriberbot-home-metrics",
|
|
150
150
|
children: [
|
|
151
|
-
/* @__PURE__ */
|
|
151
|
+
/* @__PURE__ */ O(r, {
|
|
152
152
|
featured: !0,
|
|
153
|
-
icon: /* @__PURE__ */
|
|
153
|
+
icon: /* @__PURE__ */ O(ie, {}),
|
|
154
154
|
value: j(J.monthlySpend, J.primaryCurrency, { maximumFractionDigits: 0 }),
|
|
155
155
|
label: I("dashboard.metrics.recurringSpend", "Recurring spend / month")
|
|
156
156
|
}),
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
-
icon: /* @__PURE__ */
|
|
157
|
+
/* @__PURE__ */ O(r, {
|
|
158
|
+
icon: /* @__PURE__ */ O(T, {}),
|
|
159
159
|
value: J.activeCount,
|
|
160
160
|
label: I("dashboard.metrics.activeRelationships", "Active relationships")
|
|
161
161
|
}),
|
|
162
|
-
/* @__PURE__ */
|
|
163
|
-
icon: /* @__PURE__ */
|
|
162
|
+
/* @__PURE__ */ O(r, {
|
|
163
|
+
icon: /* @__PURE__ */ O(C, {}),
|
|
164
164
|
value: X.length,
|
|
165
165
|
label: I("dashboard.metrics.upcomingRenewals", "Upcoming renewals")
|
|
166
166
|
}),
|
|
167
|
-
/* @__PURE__ */
|
|
168
|
-
icon: /* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ O(r, {
|
|
168
|
+
icon: /* @__PURE__ */ O(y, {}),
|
|
169
169
|
value: J.actionRequired,
|
|
170
170
|
label: I("dashboard.metrics.needsAction", "Need your action"),
|
|
171
171
|
trend: J.actionRequired > 0 ? "down" : void 0
|
|
172
172
|
})
|
|
173
173
|
]
|
|
174
174
|
}),
|
|
175
|
-
/* @__PURE__ */
|
|
175
|
+
/* @__PURE__ */ k("div", {
|
|
176
176
|
className: "mt-8 grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
177
|
-
children: [/* @__PURE__ */
|
|
177
|
+
children: [/* @__PURE__ */ O("div", {
|
|
178
178
|
className: "lg:col-span-2",
|
|
179
|
-
children: /* @__PURE__ */
|
|
179
|
+
children: /* @__PURE__ */ O(o, {
|
|
180
180
|
title: I("dashboard.renewals.title", "Upcoming renewals"),
|
|
181
181
|
description: I("dashboard.renewals.description", "What's charging next across your portfolio"),
|
|
182
182
|
className: "mt-0",
|
|
183
183
|
dataTour: "subscriberbot-home-renewals",
|
|
184
|
-
action: /* @__PURE__ */
|
|
184
|
+
action: /* @__PURE__ */ k("button", {
|
|
185
185
|
type: "button",
|
|
186
186
|
onClick: () => P("/relationships"),
|
|
187
187
|
className: "inline-flex items-center gap-1 text-sm font-medium text-text-link hover:underline",
|
|
188
188
|
children: [
|
|
189
189
|
I("common.viewAll", "View all"),
|
|
190
190
|
" ",
|
|
191
|
-
/* @__PURE__ */
|
|
191
|
+
/* @__PURE__ */ O(x, { className: "h-3.5 w-3.5" })
|
|
192
192
|
]
|
|
193
193
|
}),
|
|
194
|
-
children: /* @__PURE__ */
|
|
194
|
+
children: /* @__PURE__ */ O(A, {
|
|
195
195
|
treatment: "plain",
|
|
196
196
|
className: "p-5",
|
|
197
|
-
children: Z.length === 0 ? /* @__PURE__ */
|
|
197
|
+
children: Z.length === 0 ? /* @__PURE__ */ O(a, {
|
|
198
198
|
illustration: "empty-data",
|
|
199
199
|
title: I("dashboard.renewals.emptyTitle", "No upcoming renewals"),
|
|
200
200
|
description: I("dashboard.renewals.emptyDescription", "Renewals you track will appear here ahead of time.")
|
|
201
|
-
}) : /* @__PURE__ */
|
|
201
|
+
}) : /* @__PURE__ */ O(l, { items: Z })
|
|
202
202
|
})
|
|
203
203
|
})
|
|
204
|
-
}), /* @__PURE__ */
|
|
204
|
+
}), /* @__PURE__ */ k("div", {
|
|
205
205
|
className: "flex flex-col gap-6",
|
|
206
|
-
children: [/* @__PURE__ */
|
|
206
|
+
children: [/* @__PURE__ */ O(o, {
|
|
207
207
|
title: I("dashboard.portfolio.title", "Portfolio by status"),
|
|
208
208
|
description: I("dashboard.portfolio.description", "Where your relationships stand"),
|
|
209
209
|
className: "mt-0",
|
|
210
210
|
dataTour: "subscriberbot-home-portfolio",
|
|
211
|
-
children: /* @__PURE__ */
|
|
211
|
+
children: /* @__PURE__ */ O(A, {
|
|
212
212
|
treatment: "glass",
|
|
213
213
|
className: "p-5",
|
|
214
|
-
children: Y.length === 0 ? /* @__PURE__ */
|
|
214
|
+
children: Y.length === 0 ? /* @__PURE__ */ O(a, {
|
|
215
215
|
illustration: "empty-data",
|
|
216
216
|
title: I("dashboard.portfolio.emptyTitle", "No relationships yet"),
|
|
217
217
|
description: I("dashboard.portfolio.emptyDescription", "Add your first subscription to see the breakdown."),
|
|
218
|
-
action: /* @__PURE__ */
|
|
218
|
+
action: /* @__PURE__ */ O("button", {
|
|
219
219
|
type: "button",
|
|
220
220
|
onClick: () => P("/relationships/new"),
|
|
221
221
|
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
|
|
222
222
|
children: I("dashboard.portfolio.addRelationship", "Add relationship")
|
|
223
223
|
})
|
|
224
|
-
}) : /* @__PURE__ */
|
|
224
|
+
}) : /* @__PURE__ */ k("div", {
|
|
225
225
|
className: "flex flex-col items-center gap-5 sm:flex-row sm:items-center lg:flex-col xl:flex-row",
|
|
226
|
-
children: [/* @__PURE__ */
|
|
226
|
+
children: [/* @__PURE__ */ O(s, {
|
|
227
227
|
data: Y,
|
|
228
228
|
size: 148,
|
|
229
229
|
thickness: 20,
|
|
230
230
|
centerLabel: String(J.totalCount),
|
|
231
231
|
centerSub: I(J.totalCount === 1 ? "dashboard.portfolio.relationshipSingular" : "dashboard.portfolio.relationshipPlural", J.totalCount === 1 ? "relationship" : "relationships"),
|
|
232
232
|
className: "shrink-0"
|
|
233
|
-
}), /* @__PURE__ */
|
|
233
|
+
}), /* @__PURE__ */ O(c, {
|
|
234
234
|
data: Y,
|
|
235
235
|
className: "w-full min-w-0 flex-1"
|
|
236
236
|
})]
|
|
237
237
|
})
|
|
238
238
|
})
|
|
239
|
-
}), /* @__PURE__ */
|
|
239
|
+
}), /* @__PURE__ */ O(o, {
|
|
240
240
|
title: I("dashboard.needsAttention.title", "Needs attention"),
|
|
241
241
|
description: I("dashboard.needsAttention.description", "Required actions from the Universal Inbox"),
|
|
242
242
|
className: "mt-0",
|
|
243
243
|
dataTour: "subscriberbot-home-needs-attention",
|
|
244
|
-
action: /* @__PURE__ */
|
|
244
|
+
action: /* @__PURE__ */ O("button", {
|
|
245
245
|
type: "button",
|
|
246
246
|
onClick: () => P("/inbox"),
|
|
247
247
|
className: "text-sm font-medium text-text-link hover:underline",
|
|
248
248
|
children: I("dashboard.needsAttention.openInbox", "Open inbox")
|
|
249
249
|
}),
|
|
250
|
-
children: /* @__PURE__ */
|
|
250
|
+
children: /* @__PURE__ */ O(A, {
|
|
251
251
|
treatment: "plain",
|
|
252
252
|
className: "p-3",
|
|
253
|
-
children: Q.length === 0 ? /* @__PURE__ */
|
|
253
|
+
children: Q.length === 0 ? /* @__PURE__ */ k("div", {
|
|
254
254
|
className: "flex items-center gap-3 px-2 py-4",
|
|
255
|
-
children: [/* @__PURE__ */
|
|
255
|
+
children: [/* @__PURE__ */ O("span", {
|
|
256
256
|
className: "flex size-10 shrink-0 items-center justify-center rounded-lg bg-status-success-bg-subtle text-status-success-text",
|
|
257
|
-
children: /* @__PURE__ */
|
|
258
|
-
}), /* @__PURE__ */
|
|
257
|
+
children: /* @__PURE__ */ O(E, { className: "h-5 w-5" })
|
|
258
|
+
}), /* @__PURE__ */ k("div", {
|
|
259
259
|
className: "min-w-0",
|
|
260
|
-
children: [/* @__PURE__ */
|
|
260
|
+
children: [/* @__PURE__ */ O("p", {
|
|
261
261
|
className: "text-sm font-medium text-text-primary",
|
|
262
262
|
children: I("dashboard.needsAttention.allCaughtUp", "You're all caught up")
|
|
263
|
-
}), /* @__PURE__ */
|
|
263
|
+
}), /* @__PURE__ */ O("p", {
|
|
264
264
|
className: "text-xs text-text-secondary",
|
|
265
265
|
children: I("dashboard.needsAttention.allCaughtUpDescription", "Required actions across your channels will surface here.")
|
|
266
266
|
})]
|
|
267
267
|
})]
|
|
268
|
-
}) : /* @__PURE__ */
|
|
268
|
+
}) : /* @__PURE__ */ O("ul", {
|
|
269
269
|
className: "space-y-1",
|
|
270
|
-
children: Q.slice(0, 5).map((e) => /* @__PURE__ */
|
|
270
|
+
children: Q.slice(0, 5).map((e) => /* @__PURE__ */ O("li", { children: /* @__PURE__ */ k("button", {
|
|
271
271
|
type: "button",
|
|
272
272
|
onClick: () => P("/inbox"),
|
|
273
273
|
className: "flex w-full items-center gap-3 rounded-lg border-l-2 border-status-warning-text/60 bg-status-warning-bg-subtle/50 p-3 text-start transition-colors hover:bg-status-warning-bg-subtle",
|
|
274
|
-
children: [/* @__PURE__ */
|
|
274
|
+
children: [/* @__PURE__ */ k("div", {
|
|
275
275
|
className: "min-w-0 flex-1",
|
|
276
|
-
children: [/* @__PURE__ */
|
|
276
|
+
children: [/* @__PURE__ */ O("p", {
|
|
277
277
|
className: "truncate text-sm font-medium text-text-primary",
|
|
278
278
|
children: e.subject || I("dashboard.needsAttention.noSubject", "(no subject)")
|
|
279
|
-
}), e.preview && /* @__PURE__ */
|
|
279
|
+
}), e.preview && /* @__PURE__ */ O("p", {
|
|
280
280
|
className: "truncate text-xs text-text-secondary",
|
|
281
281
|
children: e.preview
|
|
282
282
|
})]
|
|
283
|
-
}), /* @__PURE__ */
|
|
283
|
+
}), /* @__PURE__ */ O(i, {
|
|
284
284
|
status: e.category,
|
|
285
285
|
className: "shrink-0"
|
|
286
286
|
})]
|
|
@@ -290,47 +290,47 @@ function j() {
|
|
|
290
290
|
})]
|
|
291
291
|
})]
|
|
292
292
|
}),
|
|
293
|
-
J.openInvoiceCount > 0 && /* @__PURE__ */
|
|
293
|
+
J.openInvoiceCount > 0 && /* @__PURE__ */ k("button", {
|
|
294
294
|
type: "button",
|
|
295
295
|
onClick: () => P("/invoices"),
|
|
296
296
|
className: "mt-6 flex w-full items-center justify-between gap-3 rounded-xl border border-status-warning-text/30 bg-status-warning-bg-subtle px-5 py-4 text-start transition-shadow hover:shadow-md",
|
|
297
|
-
children: [/* @__PURE__ */
|
|
297
|
+
children: [/* @__PURE__ */ k("div", {
|
|
298
298
|
className: "flex items-center gap-3",
|
|
299
|
-
children: [/* @__PURE__ */
|
|
299
|
+
children: [/* @__PURE__ */ O(y, { className: "h-5 w-5 shrink-0 text-status-warning-text" }), /* @__PURE__ */ O("span", {
|
|
300
300
|
className: "text-sm font-medium text-status-warning-text",
|
|
301
301
|
children: I("dashboard.openInvoices.label", "{{count}} open invoice · {{amount}} outstanding", {
|
|
302
302
|
count: J.openInvoiceCount,
|
|
303
303
|
amount: j(J.openInvoiceTotal, J.primaryCurrency)
|
|
304
304
|
})
|
|
305
305
|
})]
|
|
306
|
-
}), /* @__PURE__ */
|
|
306
|
+
}), /* @__PURE__ */ O(b, { className: "rtl:rotate-180 h-4 w-4 shrink-0 text-status-warning-text" })]
|
|
307
307
|
}),
|
|
308
|
-
/* @__PURE__ */
|
|
308
|
+
/* @__PURE__ */ O(o, {
|
|
309
309
|
title: I("dashboard.quickActions.title", "Quick actions"),
|
|
310
310
|
description: I("dashboard.quickActions.description", "Jump straight into your workflow"),
|
|
311
311
|
dataTour: "subscriberbot-home-quick-actions",
|
|
312
|
-
children: /* @__PURE__ */
|
|
312
|
+
children: /* @__PURE__ */ O("div", {
|
|
313
313
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4",
|
|
314
|
-
children: ce.map((e) => /* @__PURE__ */
|
|
314
|
+
children: ce.map((e) => /* @__PURE__ */ k("button", {
|
|
315
315
|
type: "button",
|
|
316
316
|
onClick: () => P(e.path),
|
|
317
317
|
className: "group flex items-center gap-3 rounded-xl border border-border-subtle bg-bg-surface p-4 text-start transition-all hover:-translate-y-0.5 hover:border-border-seam hover:shadow-md",
|
|
318
318
|
children: [
|
|
319
|
-
/* @__PURE__ */
|
|
319
|
+
/* @__PURE__ */ O("span", {
|
|
320
320
|
className: "flex size-10 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-primary",
|
|
321
321
|
children: e.icon
|
|
322
322
|
}),
|
|
323
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ k("span", {
|
|
324
324
|
className: "min-w-0 flex-1",
|
|
325
|
-
children: [/* @__PURE__ */
|
|
325
|
+
children: [/* @__PURE__ */ O("span", {
|
|
326
326
|
className: "block text-sm font-medium text-text-primary",
|
|
327
327
|
children: I(e.labelKey, e.fallbackLabel)
|
|
328
|
-
}), /* @__PURE__ */
|
|
328
|
+
}), /* @__PURE__ */ O("span", {
|
|
329
329
|
className: "block text-xs text-text-secondary",
|
|
330
330
|
children: I(e.descriptionKey, e.fallbackDescription)
|
|
331
331
|
})]
|
|
332
332
|
}),
|
|
333
|
-
/* @__PURE__ */
|
|
333
|
+
/* @__PURE__ */ O(b, { className: "rtl:rotate-180 h-4 w-4 shrink-0 text-text-secondary transition-transform group-hover:translate-x-0.5" })
|
|
334
334
|
]
|
|
335
335
|
}, e.path))
|
|
336
336
|
})
|
|
@@ -338,7 +338,6 @@ function j() {
|
|
|
338
338
|
]
|
|
339
339
|
});
|
|
340
340
|
}
|
|
341
|
-
//#endregion
|
|
342
341
|
export { j as DashboardPage };
|
|
343
342
|
|
|
344
343
|
//# sourceMappingURL=DashboardPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardPage.js","names":[],"sources":["../../../src/subscriberbot/pages/DashboardPage.tsx"],"sourcesContent":["import { useFormatters } from '../hooks/useFormatters';\n/**\n * Dashboard / Overview\n * @module subscriberbot/pages\n *\n * The Subscriber Bot landing page: a premium fintech console over every\n * recurring digital relationship — total recurring spend, portfolio-by-status,\n * upcoming renewals, the action-required inbox, and outstanding invoices. Every\n * number and chart is COMPUTED from real data returned by\n * `wspace-subscriberbot-svc` — nothing is mocked.\n */\n\nimport { useMemo } from 'react';\nimport {\n Repeat2,\n Wallet,\n CalendarClock,\n Inbox,\n AlertTriangle,\n ArrowRight,\n ArrowUpRight,\n Sparkles,\n Bot,\n ShieldCheck,\n} from 'lucide-react';\nimport { PagePurpose, GlassCard } from '@burdenoff/fe-libs/ui';\nimport {\n PageLayout,\n MetricsCard,\n StatusBadge,\n EmptyState,\n LoadingView,\n ErrorView,\n Section,\n Donut,\n Legend,\n Timeline,\n type Segment,\n type TimelineItem,\n} from '../components';\nimport { useSubscriberBot } from '../context/SubscriberBotContext';\nimport {\n useRelationships,\n useInvoices,\n useInboxMessages,\n useRenewalEvents,\n useDecisions,\n} from '../hooks/useSubscriberBotApi';\nimport { useTr } from '../hooks/useTr';\n\nimport { buildUpcomingRenewals, recurringSpend } from '../utils/portfolio';\nimport { useCompactViewport } from '../hooks/useCompactViewport';\nimport { MobileDashboard } from '../components/mobile';\nimport type { SubRelationship } from '../types';\n\nexport function DashboardPage() {\n const { formatCurrency, formatEnumLabel, formatRelativeTime } = useFormatters();\n\n const { navigateTo, currentUser } = useSubscriberBot();\n const tr = useTr();\n\n const relationshipsQ = useRelationships({ pagination: { limit: 100, offset: 0 } });\n const invoicesQ = useInvoices({ pagination: { limit: 50, offset: 0 } });\n const inboxQ = useInboxMessages({ pagination: { limit: 50, offset: 0 } });\n const renewalsQ = useRenewalEvents({ upcomingOnly: true });\n // Phone layout (BOFF-4010) also surfaces open AI recommendations; the\n // desktop console keeps them on the dedicated decisions page, so only\n // fetch them when the mobile overview will render them.\n const compact = useCompactViewport();\n const decisionsQ = useDecisions({ status: 'PROPOSED' }, { enabled: compact });\n\n const relationships = useMemo(() => relationshipsQ.data?.items ?? [], [relationshipsQ.data]);\n const invoices = useMemo(() => invoicesQ.data?.items ?? [], [invoicesQ.data]);\n const messages = useMemo(() => inboxQ.data?.items ?? [], [inboxQ.data]);\n const renewals = useMemo(() => renewalsQ.data ?? [], [renewalsQ.data]);\n\n // Fast label lookup so mobile AI-recommendation rows can name their relationship.\n const relationshipById = useMemo(() => {\n const map = new Map<string, SubRelationship>();\n relationships.forEach((r) => map.set(r.id, r));\n return map;\n }, [relationships]);\n\n const stats = useMemo(() => {\n const spend = recurringSpend(relationships);\n // BOFF-8660 — KPI must match the Universal Inbox \"need action\" counter\n // and the on-page Needs-attention list, both of which count by\n // `actionRequired` alone (read state is irrelevant). The previous\n // `&& !m.isRead` clause made the tile show 0 the moment the user read\n // the only action-required message, contradicting the surfaces below.\n const actionRequired = messages.filter((m) => m.actionRequired).length;\n const openInvoices = invoices.filter(\n (i) => i.status === 'ISSUED' || i.status === 'OVERDUE' || i.status === 'FAILED'\n );\n const openInvoiceTotal = openInvoices.reduce((sum, i) => sum + i.total, 0);\n const atRisk = relationships.filter(\n (r) => r.status === 'PAST_DUE' || r.status === 'LAPSED'\n ).length;\n\n return {\n activeCount: spend.activeCount,\n totalCount: relationships.length,\n monthlySpend: spend.monthly,\n primaryCurrency: spend.currency,\n actionRequired,\n openInvoiceCount: openInvoices.length,\n openInvoiceTotal,\n atRisk,\n };\n }, [relationships, messages, invoices]);\n\n // Portfolio-by-status → donut segments (grouped from real relationships).\n const statusSegments = useMemo<Segment[]>(() => {\n const counts = new Map<string, number>();\n relationships.forEach((r) => counts.set(r.status, (counts.get(r.status) ?? 0) + 1));\n return Array.from(counts.entries())\n .sort((a, b) => b[1] - a[1])\n .map(([status, value]) => ({ label: formatEnumLabel(status), value }));\n }, [relationships, formatEnumLabel]);\n\n // Upcoming renewals, soonest first: real renewal events when present,\n // otherwise each relationship's own future `renewsAt` (shared with mobile).\n const upcoming = useMemo(\n () => buildUpcomingRenewals(relationships, renewals, (eventType) => formatEnumLabel(eventType)),\n [relationships, renewals, formatEnumLabel]\n );\n\n const timelineItems = useMemo<TimelineItem[]>(\n () =>\n upcoming.slice(0, 6).map((u) => ({\n title: u.title,\n sub: formatRelativeTime(u.when),\n tone: u.soon ? 'warning' : 'default',\n meta:\n u.amount != null\n ? formatCurrency(u.amount, u.currency ?? stats.primaryCurrency, {\n maximumFractionDigits: 0,\n })\n : undefined,\n })),\n [upcoming, stats.primaryCurrency, formatCurrency, formatRelativeTime]\n );\n\n const actionMessages = useMemo(() => messages.filter((m) => m.actionRequired), [messages]);\n\n const isLoading =\n relationshipsQ.isLoading || invoicesQ.isLoading || inboxQ.isLoading || renewalsQ.isLoading;\n const isError =\n relationshipsQ.isError && invoicesQ.isError && inboxQ.isError && renewalsQ.isError;\n\n if (isLoading) {\n return (\n <PageLayout\n dataTour=\"subscriberbot-home\"\n title={tr('dashboard.title', 'Overview')}\n description={tr(\n 'dashboard.description',\n 'Your recurring digital relationships at a glance'\n )}\n >\n <LoadingView label={tr('dashboard.loading', 'Loading your subscription portfolio…')} />\n </PageLayout>\n );\n }\n\n if (isError) {\n return (\n <PageLayout\n dataTour=\"subscriberbot-home\"\n title={tr('dashboard.title', 'Overview')}\n description={tr(\n 'dashboard.description',\n 'Your recurring digital relationships at a glance'\n )}\n >\n <ErrorView\n message={tr(\n 'dashboard.error',\n \"We couldn't reach the Subscriber Bot service. Please try again.\"\n )}\n onRetry={() => {\n void relationshipsQ.refetch();\n void invoicesQ.refetch();\n void inboxQ.refetch();\n void renewalsQ.refetch();\n }}\n />\n </PageLayout>\n );\n }\n\n const greetingName = currentUser?.firstName || currentUser?.name?.split(' ')[0];\n\n if (compact) {\n return (\n <MobileDashboard\n greetingName={greetingName || undefined}\n spend={{\n monthly: stats.monthlySpend,\n currency: stats.primaryCurrency,\n activeCount: stats.activeCount,\n }}\n upcoming={upcoming}\n actionMessages={actionMessages}\n decisions={decisionsQ.data?.items ?? []}\n relationshipLabel={(id) => relationshipById.get(id)?.label}\n openInvoiceCount={stats.openInvoiceCount}\n openInvoiceTotal={stats.openInvoiceTotal}\n navigateTo={navigateTo}\n />\n );\n }\n\n const quickActions = [\n {\n labelKey: 'dashboard.quickActions.addRelationship.label',\n descriptionKey: 'dashboard.quickActions.addRelationship.description',\n fallbackLabel: 'Add a relationship',\n fallbackDescription: 'Track a new subscription',\n icon: <Repeat2 className=\"h-5 w-5\" />,\n path: '/relationships/new',\n },\n {\n labelKey: 'dashboard.quickActions.discoverProviders.label',\n descriptionKey: 'dashboard.quickActions.discoverProviders.description',\n fallbackLabel: 'Discover providers',\n fallbackDescription: 'Browse the registry',\n icon: <Sparkles className=\"h-5 w-5\" />,\n path: '/providers',\n },\n {\n labelKey: 'dashboard.quickActions.openInbox.label',\n descriptionKey: 'dashboard.quickActions.openInbox.description',\n fallbackLabel: 'Open inbox',\n fallbackDescription: 'Merged communications',\n icon: <Inbox className=\"h-5 w-5\" />,\n path: '/inbox',\n },\n {\n labelKey: 'dashboard.quickActions.configureAgents.label',\n descriptionKey: 'dashboard.quickActions.configureAgents.description',\n fallbackLabel: 'Configure agents',\n fallbackDescription: 'Automate your portfolio',\n icon: <Bot className=\"h-5 w-5\" />,\n path: '/agents',\n },\n ];\n\n return (\n <PageLayout\n dataTour=\"subscriberbot-home\"\n title={\n greetingName\n ? tr('dashboard.welcomeBack', 'Welcome back, {{name}}', { name: greetingName })\n : tr('dashboard.title', 'Overview')\n }\n description={tr(\n 'dashboard.description',\n 'Everything you pay for on repeat — in one intelligent console.'\n )}\n >\n <PagePurpose className=\"mb-6\">\n {tr(\n 'dashboard.purpose',\n 'Subscriber Bot is your system of record for every recurring digital relationship. See total recurring spend, what renews next, what needs action, and what to optimize — all from real data across your providers.'\n )}\n </PagePurpose>\n\n {/* KPI tiles */}\n <div\n className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4\"\n data-tour=\"subscriberbot-home-metrics\"\n >\n <MetricsCard\n featured\n icon={<Wallet />}\n value={formatCurrency(stats.monthlySpend, stats.primaryCurrency, {\n maximumFractionDigits: 0,\n })}\n label={tr('dashboard.metrics.recurringSpend', 'Recurring spend / month')}\n />\n <MetricsCard\n icon={<Repeat2 />}\n value={stats.activeCount}\n label={tr('dashboard.metrics.activeRelationships', 'Active relationships')}\n />\n <MetricsCard\n icon={<CalendarClock />}\n value={upcoming.length}\n label={tr('dashboard.metrics.upcomingRenewals', 'Upcoming renewals')}\n />\n <MetricsCard\n icon={<AlertTriangle />}\n value={stats.actionRequired}\n label={tr('dashboard.metrics.needsAction', 'Need your action')}\n trend={stats.actionRequired > 0 ? 'down' : undefined}\n />\n </div>\n\n {/* Main console: renewals (left) + portfolio donut & needs-attention (right) */}\n <div className=\"mt-8 grid grid-cols-1 gap-6 lg:grid-cols-3\">\n {/* Upcoming renewals timeline — spans two columns on desktop */}\n <div className=\"lg:col-span-2\">\n <Section\n title={tr('dashboard.renewals.title', 'Upcoming renewals')}\n description={tr(\n 'dashboard.renewals.description',\n \"What's charging next across your portfolio\"\n )}\n className=\"mt-0\"\n dataTour=\"subscriberbot-home-renewals\"\n action={\n <button\n type=\"button\"\n onClick={() => navigateTo('/relationships')}\n className=\"inline-flex items-center gap-1 text-sm font-medium text-text-link hover:underline\"\n >\n {tr('common.viewAll', 'View all')} <ArrowUpRight className=\"h-3.5 w-3.5\" />\n </button>\n }\n >\n <GlassCard treatment=\"plain\" className=\"p-5\">\n {timelineItems.length === 0 ? (\n <EmptyState\n illustration=\"empty-data\"\n title={tr('dashboard.renewals.emptyTitle', 'No upcoming renewals')}\n description={tr(\n 'dashboard.renewals.emptyDescription',\n 'Renewals you track will appear here ahead of time.'\n )}\n />\n ) : (\n <Timeline items={timelineItems} />\n )}\n </GlassCard>\n </Section>\n </div>\n\n {/* Right rail: portfolio-by-status donut + needs-attention panel */}\n <div className=\"flex flex-col gap-6\">\n <Section\n title={tr('dashboard.portfolio.title', 'Portfolio by status')}\n description={tr('dashboard.portfolio.description', 'Where your relationships stand')}\n className=\"mt-0\"\n dataTour=\"subscriberbot-home-portfolio\"\n >\n <GlassCard treatment=\"glass\" className=\"p-5\">\n {statusSegments.length === 0 ? (\n <EmptyState\n illustration=\"empty-data\"\n title={tr('dashboard.portfolio.emptyTitle', 'No relationships yet')}\n description={tr(\n 'dashboard.portfolio.emptyDescription',\n 'Add your first subscription to see the breakdown.'\n )}\n action={\n <button\n type=\"button\"\n onClick={() => navigateTo('/relationships/new')}\n className=\"rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90\"\n >\n {tr('dashboard.portfolio.addRelationship', 'Add relationship')}\n </button>\n }\n />\n ) : (\n <div className=\"flex flex-col items-center gap-5 sm:flex-row sm:items-center lg:flex-col xl:flex-row\">\n <Donut\n data={statusSegments}\n size={148}\n thickness={20}\n centerLabel={String(stats.totalCount)}\n centerSub={tr(\n stats.totalCount === 1\n ? 'dashboard.portfolio.relationshipSingular'\n : 'dashboard.portfolio.relationshipPlural',\n stats.totalCount === 1 ? 'relationship' : 'relationships'\n )}\n className=\"shrink-0\"\n />\n <Legend data={statusSegments} className=\"w-full min-w-0 flex-1\" />\n </div>\n )}\n </GlassCard>\n </Section>\n\n <Section\n title={tr('dashboard.needsAttention.title', 'Needs attention')}\n description={tr(\n 'dashboard.needsAttention.description',\n 'Required actions from the Universal Inbox'\n )}\n className=\"mt-0\"\n dataTour=\"subscriberbot-home-needs-attention\"\n action={\n <button\n type=\"button\"\n onClick={() => navigateTo('/inbox')}\n className=\"text-sm font-medium text-text-link hover:underline\"\n >\n {tr('dashboard.needsAttention.openInbox', 'Open inbox')}\n </button>\n }\n >\n <GlassCard treatment=\"plain\" className=\"p-3\">\n {actionMessages.length === 0 ? (\n <div className=\"flex items-center gap-3 px-2 py-4\">\n <span className=\"flex size-10 shrink-0 items-center justify-center rounded-lg bg-status-success-bg-subtle text-status-success-text\">\n <ShieldCheck className=\"h-5 w-5\" />\n </span>\n <div className=\"min-w-0\">\n <p className=\"text-sm font-medium text-text-primary\">\n {tr('dashboard.needsAttention.allCaughtUp', \"You're all caught up\")}\n </p>\n <p className=\"text-xs text-text-secondary\">\n {tr(\n 'dashboard.needsAttention.allCaughtUpDescription',\n 'Required actions across your channels will surface here.'\n )}\n </p>\n </div>\n </div>\n ) : (\n <ul className=\"space-y-1\">\n {actionMessages.slice(0, 5).map((message) => (\n <li key={message.id}>\n <button\n type=\"button\"\n onClick={() => navigateTo('/inbox')}\n className=\"flex w-full items-center gap-3 rounded-lg border-l-2 border-status-warning-text/60 bg-status-warning-bg-subtle/50 p-3 text-start transition-colors hover:bg-status-warning-bg-subtle\"\n >\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate text-sm font-medium text-text-primary\">\n {message.subject ||\n tr('dashboard.needsAttention.noSubject', '(no subject)')}\n </p>\n {message.preview && (\n <p className=\"truncate text-xs text-text-secondary\">\n {message.preview}\n </p>\n )}\n </div>\n <StatusBadge status={message.category} className=\"shrink-0\" />\n </button>\n </li>\n ))}\n </ul>\n )}\n </GlassCard>\n </Section>\n </div>\n </div>\n\n {/* Open-invoice call-out (only when there is real outstanding balance) */}\n {stats.openInvoiceCount > 0 && (\n <button\n type=\"button\"\n onClick={() => navigateTo('/invoices')}\n className=\"mt-6 flex w-full items-center justify-between gap-3 rounded-xl border border-status-warning-text/30 bg-status-warning-bg-subtle px-5 py-4 text-start transition-shadow hover:shadow-md\"\n >\n <div className=\"flex items-center gap-3\">\n <AlertTriangle className=\"h-5 w-5 shrink-0 text-status-warning-text\" />\n <span className=\"text-sm font-medium text-status-warning-text\">\n {tr(\n 'dashboard.openInvoices.label',\n '{{count}} open invoice · {{amount}} outstanding',\n {\n count: stats.openInvoiceCount,\n amount: formatCurrency(stats.openInvoiceTotal, stats.primaryCurrency),\n }\n )}\n </span>\n </div>\n <ArrowRight className=\"rtl:rotate-180 h-4 w-4 shrink-0 text-status-warning-text\" />\n </button>\n )}\n\n {/* Quick actions */}\n <Section\n title={tr('dashboard.quickActions.title', 'Quick actions')}\n description={tr('dashboard.quickActions.description', 'Jump straight into your workflow')}\n dataTour=\"subscriberbot-home-quick-actions\"\n >\n <div className=\"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4\">\n {quickActions.map((qa) => (\n <button\n key={qa.path}\n type=\"button\"\n onClick={() => navigateTo(qa.path)}\n className=\"group flex items-center gap-3 rounded-xl border border-border-subtle bg-bg-surface p-4 text-start transition-all hover:-translate-y-0.5 hover:border-border-seam hover:shadow-md\"\n >\n <span className=\"flex size-10 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-primary\">\n {qa.icon}\n </span>\n <span className=\"min-w-0 flex-1\">\n <span className=\"block text-sm font-medium text-text-primary\">\n {tr(qa.labelKey, qa.fallbackLabel)}\n </span>\n <span className=\"block text-xs text-text-secondary\">\n {tr(qa.descriptionKey, qa.fallbackDescription)}\n </span>\n </span>\n <ArrowRight className=\"rtl:rotate-180 h-4 w-4 shrink-0 text-text-secondary transition-transform group-hover:translate-x-0.5\" />\n </button>\n ))}\n </div>\n </Section>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAuDA,SAAgB,IAAgB;CAC9B,IAAM,EAAE,mBAAgB,oBAAiB,0BAAuB,EAAc,GAExE,EAAE,eAAY,mBAAgB,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AAK,MACjB,kBAAC,UAAD;MAEE,MAAK;MACL,eAAe,EAAW,EAAG,IAAI;MACjC,WAAU;gBAJZ;OAME,kBAAC,QAAD;QAAM,WAAU;kBACb,EAAG;OACA,CAAA;OACN,kBAAC,QAAD;QAAM,WAAU;kBAAhB,CACE,kBAAC,QAAD;SAAM,WAAU;mBACb,EAAG,EAAG,UAAU,EAAG,aAAa;QAC7B,CAAA,GACN,kBAAC,QAAD;SAAM,WAAU;mBACb,EAAG,EAAG,gBAAgB,EAAG,mBAAmB;QACzC,CAAA,CACF;;OACN,kBAAC,GAAD,EAAY,WAAU,uGAAwG,CAAA;MACxH;QAjBD,EAAG,IAiBF,CACT;IACE,CAAA;GACE,CAAA;EACC;;AAEhB"}
|
|
1
|
+
{"version":3,"file":"DashboardPage.js","names":["EmptyState","EmptyState$1","DashboardPage","useFormatters","useSubscriberBot","tr","useTr","relationshipsQ","useRelationships","invoicesQ","useInvoices","inboxQ","useInboxMessages","renewalsQ","useRenewalEvents","compact","useCompactViewport","decisionsQ","useDecisions","relationships","useMemo","invoices","messages","renewals","relationshipById","map","r","stats","spend","recurringSpend","actionRequired","m","openInvoices","i","openInvoiceTotal","sum","atRisk","statusSegments","counts","b","a","status","value","formatEnumLabel","upcoming","buildUpcomingRenewals","eventType","timelineItems","u","formatRelativeTime","formatCurrency","actionMessages","isLoading","isError","PageLayout","LoadingView","ErrorView","greetingName","currentUser","MobileDashboard","id","quickActions","Repeat2","Sparkles","Inbox","Bot","PagePurpose","MetricsCard","Wallet","CalendarClock","AlertTriangle","Section","navigateTo","ArrowUpRight","GlassCard","Timeline","Donut","Legend","ShieldCheck","message","StatusBadge","ArrowRight","qa"],"sources":["../../../src/subscriberbot/pages/DashboardPage.tsx"],"sourcesContent":["import { useFormatters } from '../hooks/useFormatters';\n/**\n * Dashboard / Overview\n * @module subscriberbot/pages\n *\n * The Subscriber Bot landing page: a premium fintech console over every\n * recurring digital relationship — total recurring spend, portfolio-by-status,\n * upcoming renewals, the action-required inbox, and outstanding invoices. Every\n * number and chart is COMPUTED from real data returned by\n * `wspace-subscriberbot-svc` — nothing is mocked.\n */\n\nimport { useMemo } from 'react';\nimport {\n Repeat2,\n Wallet,\n CalendarClock,\n Inbox,\n AlertTriangle,\n ArrowRight,\n ArrowUpRight,\n Sparkles,\n Bot,\n ShieldCheck,\n} from 'lucide-react';\nimport { PagePurpose, GlassCard } from '@burdenoff/fe-libs/ui';\nimport {\n PageLayout,\n MetricsCard,\n StatusBadge,\n EmptyState,\n LoadingView,\n ErrorView,\n Section,\n Donut,\n Legend,\n Timeline,\n type Segment,\n type TimelineItem,\n} from '../components';\nimport { useSubscriberBot } from '../context/SubscriberBotContext';\nimport {\n useRelationships,\n useInvoices,\n useInboxMessages,\n useRenewalEvents,\n useDecisions,\n} from '../hooks/useSubscriberBotApi';\nimport { useTr } from '../hooks/useTr';\n\nimport { buildUpcomingRenewals, recurringSpend } from '../utils/portfolio';\nimport { useCompactViewport } from '../hooks/useCompactViewport';\nimport { MobileDashboard } from '../components/mobile';\nimport type { SubRelationship } from '../types';\n\nexport function DashboardPage() {\n const { formatCurrency, formatEnumLabel, formatRelativeTime } = useFormatters();\n\n const { navigateTo, currentUser } = useSubscriberBot();\n const tr = useTr();\n\n const relationshipsQ = useRelationships({ pagination: { limit: 100, offset: 0 } });\n const invoicesQ = useInvoices({ pagination: { limit: 50, offset: 0 } });\n const inboxQ = useInboxMessages({ pagination: { limit: 50, offset: 0 } });\n const renewalsQ = useRenewalEvents({ upcomingOnly: true });\n // Phone layout (BOFF-4010) also surfaces open AI recommendations; the\n // desktop console keeps them on the dedicated decisions page, so only\n // fetch them when the mobile overview will render them.\n const compact = useCompactViewport();\n const decisionsQ = useDecisions({ status: 'PROPOSED' }, { enabled: compact });\n\n const relationships = useMemo(() => relationshipsQ.data?.items ?? [], [relationshipsQ.data]);\n const invoices = useMemo(() => invoicesQ.data?.items ?? [], [invoicesQ.data]);\n const messages = useMemo(() => inboxQ.data?.items ?? [], [inboxQ.data]);\n const renewals = useMemo(() => renewalsQ.data ?? [], [renewalsQ.data]);\n\n // Fast label lookup so mobile AI-recommendation rows can name their relationship.\n const relationshipById = useMemo(() => {\n const map = new Map<string, SubRelationship>();\n relationships.forEach((r) => map.set(r.id, r));\n return map;\n }, [relationships]);\n\n const stats = useMemo(() => {\n const spend = recurringSpend(relationships);\n // BOFF-8660 — KPI must match the Universal Inbox \"need action\" counter\n // and the on-page Needs-attention list, both of which count by\n // `actionRequired` alone (read state is irrelevant). The previous\n // `&& !m.isRead` clause made the tile show 0 the moment the user read\n // the only action-required message, contradicting the surfaces below.\n const actionRequired = messages.filter((m) => m.actionRequired).length;\n const openInvoices = invoices.filter(\n (i) => i.status === 'ISSUED' || i.status === 'OVERDUE' || i.status === 'FAILED'\n );\n const openInvoiceTotal = openInvoices.reduce((sum, i) => sum + i.total, 0);\n const atRisk = relationships.filter(\n (r) => r.status === 'PAST_DUE' || r.status === 'LAPSED'\n ).length;\n\n return {\n activeCount: spend.activeCount,\n totalCount: relationships.length,\n monthlySpend: spend.monthly,\n primaryCurrency: spend.currency,\n actionRequired,\n openInvoiceCount: openInvoices.length,\n openInvoiceTotal,\n atRisk,\n };\n }, [relationships, messages, invoices]);\n\n // Portfolio-by-status → donut segments (grouped from real relationships).\n const statusSegments = useMemo<Segment[]>(() => {\n const counts = new Map<string, number>();\n relationships.forEach((r) => counts.set(r.status, (counts.get(r.status) ?? 0) + 1));\n return Array.from(counts.entries())\n .sort((a, b) => b[1] - a[1])\n .map(([status, value]) => ({ label: formatEnumLabel(status), value }));\n }, [relationships, formatEnumLabel]);\n\n // Upcoming renewals, soonest first: real renewal events when present,\n // otherwise each relationship's own future `renewsAt` (shared with mobile).\n const upcoming = useMemo(\n () => buildUpcomingRenewals(relationships, renewals, (eventType) => formatEnumLabel(eventType)),\n [relationships, renewals, formatEnumLabel]\n );\n\n const timelineItems = useMemo<TimelineItem[]>(\n () =>\n upcoming.slice(0, 6).map((u) => ({\n title: u.title,\n sub: formatRelativeTime(u.when),\n tone: u.soon ? 'warning' : 'default',\n meta:\n u.amount != null\n ? formatCurrency(u.amount, u.currency ?? stats.primaryCurrency, {\n maximumFractionDigits: 0,\n })\n : undefined,\n })),\n [upcoming, stats.primaryCurrency, formatCurrency, formatRelativeTime]\n );\n\n const actionMessages = useMemo(() => messages.filter((m) => m.actionRequired), [messages]);\n\n const isLoading =\n relationshipsQ.isLoading || invoicesQ.isLoading || inboxQ.isLoading || renewalsQ.isLoading;\n const isError =\n relationshipsQ.isError && invoicesQ.isError && inboxQ.isError && renewalsQ.isError;\n\n if (isLoading) {\n return (\n <PageLayout\n dataTour=\"subscriberbot-home\"\n title={tr('dashboard.title', 'Overview')}\n description={tr(\n 'dashboard.description',\n 'Your recurring digital relationships at a glance'\n )}\n >\n <LoadingView label={tr('dashboard.loading', 'Loading your subscription portfolio…')} />\n </PageLayout>\n );\n }\n\n if (isError) {\n return (\n <PageLayout\n dataTour=\"subscriberbot-home\"\n title={tr('dashboard.title', 'Overview')}\n description={tr(\n 'dashboard.description',\n 'Your recurring digital relationships at a glance'\n )}\n >\n <ErrorView\n message={tr(\n 'dashboard.error',\n \"We couldn't reach the Subscriber Bot service. Please try again.\"\n )}\n onRetry={() => {\n void relationshipsQ.refetch();\n void invoicesQ.refetch();\n void inboxQ.refetch();\n void renewalsQ.refetch();\n }}\n />\n </PageLayout>\n );\n }\n\n const greetingName = currentUser?.firstName || currentUser?.name?.split(' ')[0];\n\n if (compact) {\n return (\n <MobileDashboard\n greetingName={greetingName || undefined}\n spend={{\n monthly: stats.monthlySpend,\n currency: stats.primaryCurrency,\n activeCount: stats.activeCount,\n }}\n upcoming={upcoming}\n actionMessages={actionMessages}\n decisions={decisionsQ.data?.items ?? []}\n relationshipLabel={(id) => relationshipById.get(id)?.label}\n openInvoiceCount={stats.openInvoiceCount}\n openInvoiceTotal={stats.openInvoiceTotal}\n navigateTo={navigateTo}\n />\n );\n }\n\n const quickActions = [\n {\n labelKey: 'dashboard.quickActions.addRelationship.label',\n descriptionKey: 'dashboard.quickActions.addRelationship.description',\n fallbackLabel: 'Add a relationship',\n fallbackDescription: 'Track a new subscription',\n icon: <Repeat2 className=\"h-5 w-5\" />,\n path: '/relationships/new',\n },\n {\n labelKey: 'dashboard.quickActions.discoverProviders.label',\n descriptionKey: 'dashboard.quickActions.discoverProviders.description',\n fallbackLabel: 'Discover providers',\n fallbackDescription: 'Browse the registry',\n icon: <Sparkles className=\"h-5 w-5\" />,\n path: '/providers',\n },\n {\n labelKey: 'dashboard.quickActions.openInbox.label',\n descriptionKey: 'dashboard.quickActions.openInbox.description',\n fallbackLabel: 'Open inbox',\n fallbackDescription: 'Merged communications',\n icon: <Inbox className=\"h-5 w-5\" />,\n path: '/inbox',\n },\n {\n labelKey: 'dashboard.quickActions.configureAgents.label',\n descriptionKey: 'dashboard.quickActions.configureAgents.description',\n fallbackLabel: 'Configure agents',\n fallbackDescription: 'Automate your portfolio',\n icon: <Bot className=\"h-5 w-5\" />,\n path: '/agents',\n },\n ];\n\n return (\n <PageLayout\n dataTour=\"subscriberbot-home\"\n title={\n greetingName\n ? tr('dashboard.welcomeBack', 'Welcome back, {{name}}', { name: greetingName })\n : tr('dashboard.title', 'Overview')\n }\n description={tr(\n 'dashboard.description',\n 'Everything you pay for on repeat — in one intelligent console.'\n )}\n >\n <PagePurpose className=\"mb-6\">\n {tr(\n 'dashboard.purpose',\n 'Subscriber Bot is your system of record for every recurring digital relationship. See total recurring spend, what renews next, what needs action, and what to optimize — all from real data across your providers.'\n )}\n </PagePurpose>\n\n {/* KPI tiles */}\n <div\n className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4\"\n data-tour=\"subscriberbot-home-metrics\"\n >\n <MetricsCard\n featured\n icon={<Wallet />}\n value={formatCurrency(stats.monthlySpend, stats.primaryCurrency, {\n maximumFractionDigits: 0,\n })}\n label={tr('dashboard.metrics.recurringSpend', 'Recurring spend / month')}\n />\n <MetricsCard\n icon={<Repeat2 />}\n value={stats.activeCount}\n label={tr('dashboard.metrics.activeRelationships', 'Active relationships')}\n />\n <MetricsCard\n icon={<CalendarClock />}\n value={upcoming.length}\n label={tr('dashboard.metrics.upcomingRenewals', 'Upcoming renewals')}\n />\n <MetricsCard\n icon={<AlertTriangle />}\n value={stats.actionRequired}\n label={tr('dashboard.metrics.needsAction', 'Need your action')}\n trend={stats.actionRequired > 0 ? 'down' : undefined}\n />\n </div>\n\n {/* Main console: renewals (left) + portfolio donut & needs-attention (right) */}\n <div className=\"mt-8 grid grid-cols-1 gap-6 lg:grid-cols-3\">\n {/* Upcoming renewals timeline — spans two columns on desktop */}\n <div className=\"lg:col-span-2\">\n <Section\n title={tr('dashboard.renewals.title', 'Upcoming renewals')}\n description={tr(\n 'dashboard.renewals.description',\n \"What's charging next across your portfolio\"\n )}\n className=\"mt-0\"\n dataTour=\"subscriberbot-home-renewals\"\n action={\n <button\n type=\"button\"\n onClick={() => navigateTo('/relationships')}\n className=\"inline-flex items-center gap-1 text-sm font-medium text-text-link hover:underline\"\n >\n {tr('common.viewAll', 'View all')} <ArrowUpRight className=\"h-3.5 w-3.5\" />\n </button>\n }\n >\n <GlassCard treatment=\"plain\" className=\"p-5\">\n {timelineItems.length === 0 ? (\n <EmptyState\n illustration=\"empty-data\"\n title={tr('dashboard.renewals.emptyTitle', 'No upcoming renewals')}\n description={tr(\n 'dashboard.renewals.emptyDescription',\n 'Renewals you track will appear here ahead of time.'\n )}\n />\n ) : (\n <Timeline items={timelineItems} />\n )}\n </GlassCard>\n </Section>\n </div>\n\n {/* Right rail: portfolio-by-status donut + needs-attention panel */}\n <div className=\"flex flex-col gap-6\">\n <Section\n title={tr('dashboard.portfolio.title', 'Portfolio by status')}\n description={tr('dashboard.portfolio.description', 'Where your relationships stand')}\n className=\"mt-0\"\n dataTour=\"subscriberbot-home-portfolio\"\n >\n <GlassCard treatment=\"glass\" className=\"p-5\">\n {statusSegments.length === 0 ? (\n <EmptyState\n illustration=\"empty-data\"\n title={tr('dashboard.portfolio.emptyTitle', 'No relationships yet')}\n description={tr(\n 'dashboard.portfolio.emptyDescription',\n 'Add your first subscription to see the breakdown.'\n )}\n action={\n <button\n type=\"button\"\n onClick={() => navigateTo('/relationships/new')}\n className=\"rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90\"\n >\n {tr('dashboard.portfolio.addRelationship', 'Add relationship')}\n </button>\n }\n />\n ) : (\n <div className=\"flex flex-col items-center gap-5 sm:flex-row sm:items-center lg:flex-col xl:flex-row\">\n <Donut\n data={statusSegments}\n size={148}\n thickness={20}\n centerLabel={String(stats.totalCount)}\n centerSub={tr(\n stats.totalCount === 1\n ? 'dashboard.portfolio.relationshipSingular'\n : 'dashboard.portfolio.relationshipPlural',\n stats.totalCount === 1 ? 'relationship' : 'relationships'\n )}\n className=\"shrink-0\"\n />\n <Legend data={statusSegments} className=\"w-full min-w-0 flex-1\" />\n </div>\n )}\n </GlassCard>\n </Section>\n\n <Section\n title={tr('dashboard.needsAttention.title', 'Needs attention')}\n description={tr(\n 'dashboard.needsAttention.description',\n 'Required actions from the Universal Inbox'\n )}\n className=\"mt-0\"\n dataTour=\"subscriberbot-home-needs-attention\"\n action={\n <button\n type=\"button\"\n onClick={() => navigateTo('/inbox')}\n className=\"text-sm font-medium text-text-link hover:underline\"\n >\n {tr('dashboard.needsAttention.openInbox', 'Open inbox')}\n </button>\n }\n >\n <GlassCard treatment=\"plain\" className=\"p-3\">\n {actionMessages.length === 0 ? (\n <div className=\"flex items-center gap-3 px-2 py-4\">\n <span className=\"flex size-10 shrink-0 items-center justify-center rounded-lg bg-status-success-bg-subtle text-status-success-text\">\n <ShieldCheck className=\"h-5 w-5\" />\n </span>\n <div className=\"min-w-0\">\n <p className=\"text-sm font-medium text-text-primary\">\n {tr('dashboard.needsAttention.allCaughtUp', \"You're all caught up\")}\n </p>\n <p className=\"text-xs text-text-secondary\">\n {tr(\n 'dashboard.needsAttention.allCaughtUpDescription',\n 'Required actions across your channels will surface here.'\n )}\n </p>\n </div>\n </div>\n ) : (\n <ul className=\"space-y-1\">\n {actionMessages.slice(0, 5).map((message) => (\n <li key={message.id}>\n <button\n type=\"button\"\n onClick={() => navigateTo('/inbox')}\n className=\"flex w-full items-center gap-3 rounded-lg border-l-2 border-status-warning-text/60 bg-status-warning-bg-subtle/50 p-3 text-start transition-colors hover:bg-status-warning-bg-subtle\"\n >\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate text-sm font-medium text-text-primary\">\n {message.subject ||\n tr('dashboard.needsAttention.noSubject', '(no subject)')}\n </p>\n {message.preview && (\n <p className=\"truncate text-xs text-text-secondary\">\n {message.preview}\n </p>\n )}\n </div>\n <StatusBadge status={message.category} className=\"shrink-0\" />\n </button>\n </li>\n ))}\n </ul>\n )}\n </GlassCard>\n </Section>\n </div>\n </div>\n\n {/* Open-invoice call-out (only when there is real outstanding balance) */}\n {stats.openInvoiceCount > 0 && (\n <button\n type=\"button\"\n onClick={() => navigateTo('/invoices')}\n className=\"mt-6 flex w-full items-center justify-between gap-3 rounded-xl border border-status-warning-text/30 bg-status-warning-bg-subtle px-5 py-4 text-start transition-shadow hover:shadow-md\"\n >\n <div className=\"flex items-center gap-3\">\n <AlertTriangle className=\"h-5 w-5 shrink-0 text-status-warning-text\" />\n <span className=\"text-sm font-medium text-status-warning-text\">\n {tr(\n 'dashboard.openInvoices.label',\n '{{count}} open invoice · {{amount}} outstanding',\n {\n count: stats.openInvoiceCount,\n amount: formatCurrency(stats.openInvoiceTotal, stats.primaryCurrency),\n }\n )}\n </span>\n </div>\n <ArrowRight className=\"rtl:rotate-180 h-4 w-4 shrink-0 text-status-warning-text\" />\n </button>\n )}\n\n {/* Quick actions */}\n <Section\n title={tr('dashboard.quickActions.title', 'Quick actions')}\n description={tr('dashboard.quickActions.description', 'Jump straight into your workflow')}\n dataTour=\"subscriberbot-home-quick-actions\"\n >\n <div className=\"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4\">\n {quickActions.map((qa) => (\n <button\n key={qa.path}\n type=\"button\"\n onClick={() => navigateTo(qa.path)}\n className=\"group flex items-center gap-3 rounded-xl border border-border-subtle bg-bg-surface p-4 text-start transition-all hover:-translate-y-0.5 hover:border-border-seam hover:shadow-md\"\n >\n <span className=\"flex size-10 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-primary\">\n {qa.icon}\n </span>\n <span className=\"min-w-0 flex-1\">\n <span className=\"block text-sm font-medium text-text-primary\">\n {tr(qa.labelKey, qa.fallbackLabel)}\n </span>\n <span className=\"block text-xs text-text-secondary\">\n {tr(qa.descriptionKey, qa.fallbackDescription)}\n </span>\n </span>\n <ArrowRight className=\"rtl:rotate-180 h-4 w-4 shrink-0 text-text-secondary transition-transform group-hover:translate-x-0.5\" />\n </button>\n ))}\n </div>\n </Section>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAuDA,SAAgBE,IAAgB;CAC9B,IAAM,EAAE,mBAAgB,oBAAiB,0BAAuBC,EAAc,GAExE,EAAE,eAAY,mBAAgBC,EAAiB,GAC/CC,IAAKC,GAAM,GAEXC,IAAiBC,EAAiB,EAAE,YAAY;EAAE,OAAO;EAAK,QAAQ;CAAE,EAAE,CAAC,GAC3EC,IAAYC,EAAY,EAAE,YAAY;EAAE,OAAO;EAAI,QAAQ;CAAE,EAAE,CAAC,GAChEC,IAASC,EAAiB,EAAE,YAAY;EAAE,OAAO;EAAI,QAAQ;CAAE,EAAE,CAAC,GAClEC,IAAYC,GAAiB,EAAE,cAAc,GAAK,CAAC,GAInDC,IAAUC,EAAmB,GAC7BC,IAAaC,EAAa,EAAE,QAAQ,WAAW,GAAG,EAAE,SAASH,EAAQ,CAAC,GAEtEI,IAAgBC,QAAcb,EAAe,MAAM,SAAS,CAAC,GAAG,CAACA,EAAe,IAAI,CAAC,GACrFc,IAAWD,QAAcX,EAAU,MAAM,SAAS,CAAC,GAAG,CAACA,EAAU,IAAI,CAAC,GACtEa,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