@burdenoff/microfe-subscriberbot 2026.1103.2 → 2026.1105.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/index.js +3 -3
- package/dist/stories/Accessibility.stories.d.ts +13 -0
- package/dist/stories/Accessibility.stories.d.ts.map +1 -0
- package/dist/stories/pages/AgentNewPage.stories.d.ts.map +1 -1
- package/dist/stories/pages/BankConnectionsPage.stories.d.ts +1 -0
- package/dist/stories/pages/BankConnectionsPage.stories.d.ts.map +1 -1
- package/dist/stories/pages/EnterpriseSpendPage.stories.d.ts.map +1 -1
- package/dist/stories/pages/InboxPage.stories.d.ts.map +1 -1
- package/dist/subscriberbot/admin/AdminDashboardPage.d.ts.map +1 -1
- package/dist/subscriberbot/admin/AdminDashboardPage.js +168 -168
- package/dist/subscriberbot/admin/AdminDashboardPage.js.map +1 -1
- package/dist/subscriberbot/admin/NegotiationDeskPanel.d.ts.map +1 -1
- package/dist/subscriberbot/admin/NegotiationDeskPanel.js +116 -116
- package/dist/subscriberbot/admin/NegotiationDeskPanel.js.map +1 -1
- package/dist/subscriberbot/admin/ProcurementDeskPanel.d.ts.map +1 -1
- package/dist/subscriberbot/admin/ProcurementDeskPanel.js +211 -211
- package/dist/subscriberbot/admin/ProcurementDeskPanel.js.map +1 -1
- package/dist/subscriberbot/components/Modal.d.ts.map +1 -1
- package/dist/subscriberbot/components/Modal.js +43 -33
- package/dist/subscriberbot/components/Modal.js.map +1 -1
- package/dist/subscriberbot/components/PostureOptions.d.ts.map +1 -1
- package/dist/subscriberbot/components/PostureOptions.js +10 -10
- package/dist/subscriberbot/components/PostureOptions.js.map +1 -1
- package/dist/subscriberbot/components/StateViews.d.ts.map +1 -1
- package/dist/subscriberbot/components/StateViews.js +45 -37
- package/dist/subscriberbot/components/StateViews.js.map +1 -1
- package/dist/subscriberbot/components/StatusBadge.d.ts.map +1 -1
- package/dist/subscriberbot/components/StatusBadge.js +6 -6
- package/dist/subscriberbot/components/StatusBadge.js.map +1 -1
- package/dist/subscriberbot/components/decisions/DecisionBanners.js +6 -6
- package/dist/subscriberbot/components/decisions/DecisionCard.d.ts.map +1 -1
- package/dist/subscriberbot/components/decisions/DecisionCard.js +149 -147
- package/dist/subscriberbot/components/decisions/DecisionCard.js.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileDashboard.d.ts.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileDashboard.js +127 -127
- package/dist/subscriberbot/components/mobile/MobileDashboard.js.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.d.ts.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.js +114 -114
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.js.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileScreen.js +1 -1
- package/dist/subscriberbot/components/mobile/MobileScreen.js.map +1 -1
- package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.js +4 -4
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.d.ts.map +1 -1
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js +11 -11
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js.map +1 -1
- package/dist/subscriberbot/components/negotiations/OutcomeForm.d.ts.map +1 -1
- package/dist/subscriberbot/components/negotiations/OutcomeForm.js +29 -29
- package/dist/subscriberbot/components/negotiations/OutcomeForm.js.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.d.ts.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js +43 -43
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementStatusPill.js +4 -4
- package/dist/subscriberbot/components/procurement/ProcurementThread.d.ts.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementThread.js +14 -14
- package/dist/subscriberbot/components/procurement/ProcurementThread.js.map +1 -1
- package/dist/subscriberbot/components/savings/SavingsCards.d.ts.map +1 -1
- package/dist/subscriberbot/components/savings/SavingsCards.js +242 -237
- package/dist/subscriberbot/components/savings/SavingsCards.js.map +1 -1
- package/dist/subscriberbot/components/viz.d.ts +1 -0
- package/dist/subscriberbot/components/viz.d.ts.map +1 -1
- package/dist/subscriberbot/components/viz.js +100 -101
- package/dist/subscriberbot/components/viz.js.map +1 -1
- package/dist/subscriberbot/hooks/index.js +1 -1
- package/dist/subscriberbot/hooks/useFormError.d.ts +7 -0
- package/dist/subscriberbot/hooks/useFormError.d.ts.map +1 -0
- package/dist/subscriberbot/hooks/useFormError.js +28 -0
- package/dist/subscriberbot/hooks/useFormError.js.map +1 -0
- package/dist/subscriberbot/hooks/useFormatters.d.ts +11 -0
- package/dist/subscriberbot/hooks/useFormatters.d.ts.map +1 -0
- package/dist/subscriberbot/hooks/useFormatters.js +13 -0
- package/dist/subscriberbot/hooks/useFormatters.js.map +1 -0
- package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts.map +1 -1
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js +371 -370
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
- package/dist/subscriberbot/hooks/useTr.d.ts.map +1 -1
- package/dist/subscriberbot/hooks/useTr.js +1 -1
- package/dist/subscriberbot/hooks/useTr.js.map +1 -1
- package/dist/subscriberbot/index.js +1 -1
- package/dist/subscriberbot/pages/AssetVaultPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/AssetVaultPage.js +124 -124
- package/dist/subscriberbot/pages/AssetVaultPage.js.map +1 -1
- package/dist/subscriberbot/pages/DashboardPage.d.ts +0 -10
- package/dist/subscriberbot/pages/DashboardPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/DashboardPage.js +107 -98
- package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
- package/dist/subscriberbot/pages/InboxPage.d.ts +0 -10
- package/dist/subscriberbot/pages/InboxPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/InboxPage.js +421 -402
- 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 +130 -121
- package/dist/subscriberbot/pages/InsightsPage.js.map +1 -1
- package/dist/subscriberbot/pages/InvoicesPage.d.ts +0 -12
- package/dist/subscriberbot/pages/InvoicesPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/InvoicesPage.js +237 -215
- package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -1
- package/dist/subscriberbot/pages/RenewalsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/RenewalsPage.js +303 -295
- package/dist/subscriberbot/pages/RenewalsPage.js.map +1 -1
- package/dist/subscriberbot/pages/SavingsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/SavingsPage.js +57 -57
- package/dist/subscriberbot/pages/SavingsPage.js.map +1 -1
- package/dist/subscriberbot/pages/WorkflowsPage.d.ts +0 -13
- package/dist/subscriberbot/pages/WorkflowsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/WorkflowsPage.js +202 -196
- package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts +0 -18
- package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js +283 -275
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts +0 -6
- package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentNewPage.js +85 -77
- package/dist/subscriberbot/pages/agents/AgentNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts +0 -9
- package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.js +136 -136
- package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.d.ts +0 -9
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.js +267 -260
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.js.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.d.ts +0 -10
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js +96 -96
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionsPage.d.ts +0 -11
- package/dist/subscriberbot/pages/decisions/DecisionsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionsPage.js +46 -46
- package/dist/subscriberbot/pages/decisions/DecisionsPage.js.map +1 -1
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.d.ts +0 -11
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js +181 -171
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.d.ts +0 -9
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js +164 -164
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.d.ts +0 -9
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js +197 -181
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.d.ts +0 -8
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js +79 -79
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.d.ts +0 -9
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js +147 -147
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.d.ts +0 -10
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js +204 -188
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementPage.d.ts +0 -9
- package/dist/subscriberbot/pages/procurement/ProcurementPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementPage.js +80 -80
- package/dist/subscriberbot/pages/procurement/ProcurementPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.d.ts +0 -10
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +484 -458
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderNewPage.d.ts +0 -8
- package/dist/subscriberbot/pages/providers/ProviderNewPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js +146 -136
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProvidersListPage.d.ts +0 -10
- package/dist/subscriberbot/pages/providers/ProvidersListPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js +88 -87
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts +0 -11
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +520 -490
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.d.ts +0 -8
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +104 -90
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts +0 -8
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +97 -96
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js +76 -74
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js.map +1 -1
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.d.ts +5 -3
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.d.ts.map +1 -1
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js +26 -25
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js.map +1 -1
- package/dist/subscriberbot/utils/formatters.d.ts +16 -5
- package/dist/subscriberbot/utils/formatters.d.ts.map +1 -1
- package/dist/subscriberbot/utils/formatters.js +57 -25
- package/dist/subscriberbot/utils/formatters.js.map +1 -1
- package/dist/subscriberbot/utils/plaidLink.d.ts +2 -1
- package/dist/subscriberbot/utils/plaidLink.d.ts.map +1 -1
- package/dist/subscriberbot/utils/plaidLink.js +21 -21
- package/dist/subscriberbot/utils/plaidLink.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import { useSubscriberBot as e } from "../../context/SubscriberBotContext.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { ErrorView as
|
|
2
|
+
import { useTr as t } from "../../hooks/useTr.js";
|
|
3
|
+
import { useFormatters as n } from "../../hooks/useFormatters.js";
|
|
4
|
+
import { cn as r } from "../../utils/cn.js";
|
|
5
|
+
import { PageLayout as ee } from "../../components/PageLayout.js";
|
|
6
|
+
import { MetricsCard as i } from "../../components/MetricsCard.js";
|
|
7
|
+
import { StatusBadge as a } from "../../components/StatusBadge.js";
|
|
8
|
+
import { EmptyState as o } from "../../components/EmptyState.js";
|
|
9
|
+
import { Modal as s } from "../../components/Modal.js";
|
|
10
|
+
import { ErrorView as c, LoadingView as l, Section as u } from "../../components/StateViews.js";
|
|
11
11
|
import "../../components/index.js";
|
|
12
|
-
import {
|
|
12
|
+
import { useFormError as d } from "../../hooks/useFormError.js";
|
|
13
|
+
import { useBankAggregators as f, useBankConnections as p, useCompleteBankLink as m, useCreateBankLinkSession as h, useDismissRecurringCharge as g, useImportBankStatement as _, useRecurringCharges as v, useRemoveBankConnection as y, useRestoreRecurringCharge as te, useSyncBankConnection as b, useTrackRecurringCharge as x } from "../../hooks/useBankingApi.js";
|
|
13
14
|
import { openPlaidLink as S } from "../../utils/plaidLink.js";
|
|
14
15
|
import { useMemo as C, useState as w } from "react";
|
|
15
|
-
import { CalendarClock as T, FileUp as E, Landmark as
|
|
16
|
-
import { Fragment as
|
|
17
|
-
import { PagePurpose as
|
|
16
|
+
import { CalendarClock as T, FileUp as E, Landmark as D, Link2 as ne, RefreshCw as re, Repeat as O, ShieldCheck as k, Trash2 as ie } from "lucide-react";
|
|
17
|
+
import { Fragment as ae, jsx as A, jsxs as j } from "react/jsx-runtime";
|
|
18
|
+
import { PagePurpose as oe } from "@burdenoff/fe-libs/ui";
|
|
18
19
|
//#region src/subscriberbot/pages/banking/BankConnectionsPage.tsx
|
|
19
|
-
var
|
|
20
|
+
var M = "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)]", N = "inline-flex items-center gap-2 rounded-lg bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50", P = "inline-flex items-center gap-2 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-50", F = "inline-flex items-center gap-1.5 rounded-lg border border-border-subtle px-2.5 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-50", se = [
|
|
20
21
|
"DETECTED",
|
|
21
22
|
"TRACKED",
|
|
22
23
|
"DISMISSED"
|
|
23
|
-
],
|
|
24
|
+
], I = {
|
|
24
25
|
DETECTED: {
|
|
25
26
|
key: "banking.charges.detected",
|
|
26
27
|
fallback: "To review"
|
|
@@ -33,24 +34,24 @@ var k = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 t
|
|
|
33
34
|
key: "banking.charges.dismissed",
|
|
34
35
|
fallback: "Dismissed"
|
|
35
36
|
}
|
|
36
|
-
},
|
|
37
|
-
function
|
|
38
|
-
let
|
|
37
|
+
}, L = 2e6, R = (e, t) => e instanceof Error ? e.message : t("common.somethingWentWrong", "Something went wrong");
|
|
38
|
+
function z() {
|
|
39
|
+
let { formatCurrency: s, formatDate: d, formatIntervalSuffix: _ } = n(), M = t(), { navigateTo: L } = e(), [z, B] = w("DETECTED"), [le, V] = w(!1), [H, U] = w(null), [W, G] = w(!1), ue = f(), K = p(), q = v(z), J = v("DETECTED"), de = v("TRACKED"), fe = h(), pe = m(), me = b(), he = y(), ge = x(), Y = g(), _e = te(), X = ue.data?.find((e) => e.aggregator === "PLAID"), Z = K.data?.items ?? [], ve = q.data?.items ?? [], ye = C(() => {
|
|
39
40
|
let e = /* @__PURE__ */ new Map();
|
|
40
|
-
for (let t of
|
|
41
|
-
return [...e.entries()].map(([e, t]) =>
|
|
42
|
-
}, [
|
|
41
|
+
for (let t of J.data?.items ?? []) e.set(t.currency, (e.get(t.currency) ?? 0) + t.annualCost);
|
|
42
|
+
return [...e.entries()].map(([e, t]) => s(t, e)).join(" + ");
|
|
43
|
+
}, [J.data, s]), Q = (e) => M("banking.notice.synced", "{{added}} new transaction(s) from {{institution}}; {{recurring}} recurring charge(s) found.", {
|
|
43
44
|
added: e.added,
|
|
44
45
|
institution: e.connection.institutionName,
|
|
45
46
|
recurring: e.recurringDetected
|
|
46
|
-
}),
|
|
47
|
-
|
|
47
|
+
}), be = async () => {
|
|
48
|
+
U(null), G(!0);
|
|
48
49
|
try {
|
|
49
|
-
let e = await S((await
|
|
50
|
+
let e = await S((await fe.mutateAsync({ aggregator: "PLAID" })).linkToken, M);
|
|
50
51
|
if (!e) return;
|
|
51
|
-
|
|
52
|
+
U({
|
|
52
53
|
tone: "success",
|
|
53
|
-
text: Q(await
|
|
54
|
+
text: Q(await pe.mutateAsync({ input: {
|
|
54
55
|
aggregator: "PLAID",
|
|
55
56
|
publicToken: e.publicToken,
|
|
56
57
|
institutionId: e.institutionId,
|
|
@@ -58,218 +59,218 @@ function I() {
|
|
|
58
59
|
} }))
|
|
59
60
|
});
|
|
60
61
|
} catch (e) {
|
|
61
|
-
|
|
62
|
+
U({
|
|
62
63
|
tone: "error",
|
|
63
|
-
text:
|
|
64
|
+
text: R(e, M)
|
|
64
65
|
});
|
|
65
66
|
} finally {
|
|
66
|
-
|
|
67
|
+
G(!1);
|
|
67
68
|
}
|
|
68
|
-
},
|
|
69
|
-
|
|
69
|
+
}, xe = async (e) => {
|
|
70
|
+
U(null);
|
|
70
71
|
try {
|
|
71
|
-
|
|
72
|
+
U({
|
|
72
73
|
tone: "success",
|
|
73
|
-
text: Q(await
|
|
74
|
+
text: Q(await me.mutateAsync({ id: e.id }))
|
|
74
75
|
});
|
|
75
76
|
} catch (e) {
|
|
76
|
-
|
|
77
|
+
U({
|
|
77
78
|
tone: "error",
|
|
78
|
-
text:
|
|
79
|
+
text: R(e, M)
|
|
79
80
|
});
|
|
80
81
|
}
|
|
81
|
-
},
|
|
82
|
-
if (window.confirm(
|
|
83
|
-
|
|
82
|
+
}, Se = async (e) => {
|
|
83
|
+
if (window.confirm(M("banking.disconnect.confirm", "Disconnect {{institution}}? Its accounts and transactions are deleted from Subscriber Bot. Subscriptions you already track stay.", { institution: e.institutionName }))) {
|
|
84
|
+
U(null);
|
|
84
85
|
try {
|
|
85
|
-
await
|
|
86
|
+
await he.mutateAsync({ id: e.id }), U({
|
|
86
87
|
tone: "success",
|
|
87
|
-
text:
|
|
88
|
+
text: M("banking.notice.disconnected", "{{institution}} was disconnected.", { institution: e.institutionName })
|
|
88
89
|
});
|
|
89
90
|
} catch (e) {
|
|
90
|
-
|
|
91
|
+
U({
|
|
91
92
|
tone: "error",
|
|
92
|
-
text:
|
|
93
|
+
text: R(e, M)
|
|
93
94
|
});
|
|
94
95
|
}
|
|
95
96
|
}
|
|
96
97
|
}, $ = async (e, t) => {
|
|
97
|
-
|
|
98
|
+
U(null);
|
|
98
99
|
try {
|
|
99
100
|
let n = await {
|
|
100
|
-
track:
|
|
101
|
+
track: ge,
|
|
101
102
|
dismiss: Y,
|
|
102
|
-
restore:
|
|
103
|
+
restore: _e
|
|
103
104
|
}[e].mutateAsync({ id: t.id });
|
|
104
|
-
e === "track" &&
|
|
105
|
+
e === "track" && U({
|
|
105
106
|
tone: "success",
|
|
106
|
-
text:
|
|
107
|
+
text: M("banking.notice.tracked", "{{name}} is now tracked as a subscription.", { name: n.displayName })
|
|
107
108
|
});
|
|
108
109
|
} catch (e) {
|
|
109
|
-
|
|
110
|
+
U({
|
|
110
111
|
tone: "error",
|
|
111
|
-
text:
|
|
112
|
+
text: R(e, M)
|
|
112
113
|
});
|
|
113
114
|
}
|
|
114
|
-
},
|
|
115
|
+
}, Ce = /* @__PURE__ */ j("div", {
|
|
115
116
|
className: "flex flex-wrap gap-2",
|
|
116
|
-
children: [/* @__PURE__ */
|
|
117
|
+
children: [/* @__PURE__ */ j("button", {
|
|
117
118
|
type: "button",
|
|
118
|
-
className:
|
|
119
|
-
onClick: () =>
|
|
119
|
+
className: P,
|
|
120
|
+
onClick: () => V(!0),
|
|
120
121
|
children: [
|
|
121
|
-
/* @__PURE__ */
|
|
122
|
+
/* @__PURE__ */ A(E, {
|
|
122
123
|
className: "h-4 w-4",
|
|
123
124
|
"aria-hidden": !0
|
|
124
125
|
}),
|
|
125
126
|
" ",
|
|
126
|
-
|
|
127
|
+
M("banking.import.open", "Import a statement")
|
|
127
128
|
]
|
|
128
|
-
}), /* @__PURE__ */
|
|
129
|
+
}), /* @__PURE__ */ j("button", {
|
|
129
130
|
type: "button",
|
|
130
|
-
className:
|
|
131
|
-
onClick: () => void
|
|
132
|
-
disabled: !X?.available ||
|
|
133
|
-
title: X?.available ? void 0 :
|
|
134
|
-
children: [/* @__PURE__ */
|
|
131
|
+
className: N,
|
|
132
|
+
onClick: () => void be(),
|
|
133
|
+
disabled: !X?.available || W,
|
|
134
|
+
title: X?.available ? void 0 : M("banking.plaid.unavailable", "Bank linking is not switched on yet. Import a statement instead."),
|
|
135
|
+
children: [/* @__PURE__ */ A(ne, {
|
|
135
136
|
className: "h-4 w-4",
|
|
136
137
|
"aria-hidden": !0
|
|
137
|
-
}),
|
|
138
|
+
}), W ? M("banking.plaid.linking", "Connecting…") : M("banking.plaid.connect", "Connect a bank")]
|
|
138
139
|
})]
|
|
139
140
|
});
|
|
140
|
-
return /* @__PURE__ */
|
|
141
|
-
title:
|
|
142
|
-
description:
|
|
143
|
-
actions:
|
|
141
|
+
return /* @__PURE__ */ j(ee, {
|
|
142
|
+
title: M("banking.title", "Bank & card connections"),
|
|
143
|
+
description: M("banking.description", "Find every subscription in your bank and card transactions."),
|
|
144
|
+
actions: Ce,
|
|
144
145
|
children: [
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ A(oe, {
|
|
146
147
|
className: "mb-6",
|
|
147
|
-
children:
|
|
148
|
+
children: M("banking.purpose", "Connect a US bank or card through Plaid, or import the CSV export any bank lets you download. Subscriber Bot spots the charges that repeat every week, month, quarter or year so you can track them or wave them off. Your bank password is never shared with Subscriber Bot, and only you can see these accounts.")
|
|
148
149
|
}),
|
|
149
|
-
X && !X.available && /* @__PURE__ */
|
|
150
|
+
X && !X.available && /* @__PURE__ */ j("p", {
|
|
150
151
|
className: "mb-4 flex items-start gap-2 rounded-lg border border-border-subtle bg-bg-sunken px-3 py-2 text-sm text-text-secondary",
|
|
151
152
|
"data-testid": "plaid-unavailable",
|
|
152
|
-
children: [/* @__PURE__ */
|
|
153
|
+
children: [/* @__PURE__ */ A(k, {
|
|
153
154
|
className: "mt-0.5 h-4 w-4 shrink-0",
|
|
154
155
|
"aria-hidden": !0
|
|
155
|
-
}),
|
|
156
|
+
}), M("banking.plaid.unavailableLong", "Direct bank linking is being switched on. Until then, import a statement export: it finds the same recurring charges.")]
|
|
156
157
|
}),
|
|
157
|
-
|
|
158
|
-
role:
|
|
159
|
-
className:
|
|
158
|
+
H && /* @__PURE__ */ A("p", {
|
|
159
|
+
role: H.tone === "error" ? "alert" : "status",
|
|
160
|
+
className: r("mb-4 rounded-lg px-3 py-2 text-sm", H.tone === "error" ? "bg-status-error-bg-subtle text-status-error-text" : "bg-status-success-bg-subtle text-status-success-text"),
|
|
160
161
|
"data-testid": "banking-notice",
|
|
161
|
-
children:
|
|
162
|
+
children: H.text
|
|
162
163
|
}),
|
|
163
|
-
/* @__PURE__ */
|
|
164
|
+
/* @__PURE__ */ j("div", {
|
|
164
165
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
165
166
|
children: [
|
|
166
|
-
/* @__PURE__ */
|
|
167
|
-
icon: /* @__PURE__ */ D
|
|
168
|
-
value:
|
|
169
|
-
label:
|
|
167
|
+
/* @__PURE__ */ A(i, {
|
|
168
|
+
icon: /* @__PURE__ */ A(D, { className: "h-5 w-5" }),
|
|
169
|
+
value: K.isLoading ? "—" : Z.length,
|
|
170
|
+
label: M("banking.metrics.connections", "Connected accounts")
|
|
170
171
|
}),
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
-
icon: /* @__PURE__ */
|
|
173
|
-
value:
|
|
174
|
-
label:
|
|
172
|
+
/* @__PURE__ */ A(i, {
|
|
173
|
+
icon: /* @__PURE__ */ A(O, { className: "h-5 w-5" }),
|
|
174
|
+
value: J.isLoading ? "—" : J.data?.items.length ?? 0,
|
|
175
|
+
label: M("banking.metrics.detected", "Charges to review")
|
|
175
176
|
}),
|
|
176
|
-
/* @__PURE__ */
|
|
177
|
-
icon: /* @__PURE__ */
|
|
178
|
-
value:
|
|
179
|
-
label:
|
|
177
|
+
/* @__PURE__ */ A(i, {
|
|
178
|
+
icon: /* @__PURE__ */ A(T, { className: "h-5 w-5" }),
|
|
179
|
+
value: J.isLoading ? "—" : ye || s(0, "USD"),
|
|
180
|
+
label: M("banking.metrics.yearly", "Yearly cost to review")
|
|
180
181
|
}),
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
icon: /* @__PURE__ */
|
|
183
|
-
value:
|
|
184
|
-
label:
|
|
182
|
+
/* @__PURE__ */ A(i, {
|
|
183
|
+
icon: /* @__PURE__ */ A(k, { className: "h-5 w-5" }),
|
|
184
|
+
value: de.isLoading ? "—" : de.data?.items.length ?? 0,
|
|
185
|
+
label: M("banking.metrics.tracked", "Tracked from your bank")
|
|
185
186
|
})
|
|
186
187
|
]
|
|
187
188
|
}),
|
|
188
|
-
/* @__PURE__ */
|
|
189
|
-
title:
|
|
190
|
-
description:
|
|
191
|
-
children: [/* @__PURE__ */
|
|
189
|
+
/* @__PURE__ */ j(u, {
|
|
190
|
+
title: M("banking.charges.title", "Recurring charges found"),
|
|
191
|
+
description: M("banking.charges.description", "Charges from the same merchant at a steady amount and rhythm."),
|
|
192
|
+
children: [/* @__PURE__ */ A("div", {
|
|
192
193
|
role: "tablist",
|
|
193
|
-
"aria-label":
|
|
194
|
+
"aria-label": M("banking.charges.filter", "Charge status"),
|
|
194
195
|
className: "mb-3 flex gap-1.5",
|
|
195
|
-
children:
|
|
196
|
+
children: se.map((e) => /* @__PURE__ */ A("button", {
|
|
196
197
|
type: "button",
|
|
197
198
|
role: "tab",
|
|
198
|
-
"aria-selected":
|
|
199
|
-
onClick: () =>
|
|
200
|
-
className:
|
|
201
|
-
children:
|
|
199
|
+
"aria-selected": z === e,
|
|
200
|
+
onClick: () => B(e),
|
|
201
|
+
className: r("rounded-lg px-3 py-1.5 text-xs font-medium", z === e ? "bg-action-primary-bg text-action-primary-text" : "border border-border-subtle text-text-primary hover:bg-bg-sunken"),
|
|
202
|
+
children: M(I[e].key, I[e].fallback)
|
|
202
203
|
}, e))
|
|
203
|
-
}),
|
|
204
|
-
message:
|
|
205
|
-
onRetry: () => void
|
|
206
|
-
}) :
|
|
204
|
+
}), q.isLoading ? /* @__PURE__ */ A(l, { label: M("banking.charges.loading", "Loading recurring charges…") }) : q.isError ? /* @__PURE__ */ A(c, {
|
|
205
|
+
message: R(q.error, M),
|
|
206
|
+
onRetry: () => void q.refetch()
|
|
207
|
+
}) : ve.length === 0 ? /* @__PURE__ */ A(o, {
|
|
207
208
|
illustration: "empty-data",
|
|
208
|
-
title:
|
|
209
|
-
description:
|
|
210
|
-
}) : /* @__PURE__ */
|
|
209
|
+
title: M("banking.charges.empty.title", "Nothing here yet"),
|
|
210
|
+
description: M("banking.charges.empty.description", "Import a statement with at least two months of transactions, or connect a bank, and repeating charges show up here.")
|
|
211
|
+
}) : /* @__PURE__ */ A("ul", {
|
|
211
212
|
className: "grid grid-cols-1 gap-3 lg:grid-cols-2",
|
|
212
213
|
"data-testid": "recurring-charge-list",
|
|
213
|
-
children:
|
|
214
|
+
children: ve.map((e) => /* @__PURE__ */ j("li", {
|
|
214
215
|
className: "rounded-xl border border-border-subtle bg-bg-surface p-4",
|
|
215
216
|
"data-testid": "recurring-charge",
|
|
216
217
|
children: [
|
|
217
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ j("div", {
|
|
218
219
|
className: "flex items-start justify-between gap-3",
|
|
219
|
-
children: [/* @__PURE__ */
|
|
220
|
+
children: [/* @__PURE__ */ j("div", {
|
|
220
221
|
className: "min-w-0",
|
|
221
|
-
children: [/* @__PURE__ */
|
|
222
|
+
children: [/* @__PURE__ */ A("p", {
|
|
222
223
|
className: "truncate text-sm font-semibold text-text-primary",
|
|
223
224
|
children: e.displayName
|
|
224
|
-
}), /* @__PURE__ */
|
|
225
|
+
}), /* @__PURE__ */ A("p", {
|
|
225
226
|
className: "mt-0.5 text-xs text-text-secondary",
|
|
226
|
-
children:
|
|
227
|
+
children: M("banking.charges.meta", "{{count}} charges since {{first}} · {{confidence}}% sure", {
|
|
227
228
|
count: e.occurrences,
|
|
228
|
-
first:
|
|
229
|
+
first: d(e.firstChargedOn),
|
|
229
230
|
confidence: e.confidence
|
|
230
231
|
})
|
|
231
232
|
})]
|
|
232
|
-
}), /* @__PURE__ */
|
|
233
|
+
}), /* @__PURE__ */ j("span", {
|
|
233
234
|
className: "shrink-0 text-sm font-semibold text-text-primary",
|
|
234
|
-
children: [
|
|
235
|
+
children: [s(e.lastAmount, e.currency), _(e.interval)]
|
|
235
236
|
})]
|
|
236
237
|
}),
|
|
237
|
-
/* @__PURE__ */
|
|
238
|
+
/* @__PURE__ */ j("p", {
|
|
238
239
|
className: "mt-2 text-xs text-text-secondary",
|
|
239
240
|
children: [
|
|
240
|
-
|
|
241
|
-
e.nextExpectedOn && ` · ${
|
|
242
|
-
` · ${
|
|
241
|
+
M("banking.charges.dates", "Last charged {{last}}", { last: d(e.lastChargedOn) }),
|
|
242
|
+
e.nextExpectedOn && ` · ${M("banking.charges.next", "next expected {{next}}", { next: d(e.nextExpectedOn) })}`,
|
|
243
|
+
` · ${M("banking.charges.yearly", "{{amount}} a year", { amount: s(e.annualCost, e.currency) })}`
|
|
243
244
|
]
|
|
244
245
|
}),
|
|
245
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ j("div", {
|
|
246
247
|
className: "mt-3 flex flex-wrap gap-2",
|
|
247
248
|
children: [
|
|
248
|
-
e.status === "DETECTED" && /* @__PURE__ */
|
|
249
|
+
e.status === "DETECTED" && /* @__PURE__ */ j(ae, { children: [/* @__PURE__ */ A("button", {
|
|
249
250
|
type: "button",
|
|
250
|
-
className:
|
|
251
|
+
className: N,
|
|
251
252
|
onClick: () => void $("track", e),
|
|
252
|
-
disabled:
|
|
253
|
-
children:
|
|
254
|
-
}), /* @__PURE__ */
|
|
253
|
+
disabled: ge.isPending,
|
|
254
|
+
children: M("banking.charges.track", "Track as subscription")
|
|
255
|
+
}), /* @__PURE__ */ A("button", {
|
|
255
256
|
type: "button",
|
|
256
|
-
className:
|
|
257
|
+
className: P,
|
|
257
258
|
onClick: () => void $("dismiss", e),
|
|
258
259
|
disabled: Y.isPending,
|
|
259
|
-
children:
|
|
260
|
+
children: M("banking.charges.dismiss", "Not a subscription")
|
|
260
261
|
})] }),
|
|
261
|
-
e.status === "TRACKED" && e.relationshipId && /* @__PURE__ */
|
|
262
|
+
e.status === "TRACKED" && e.relationshipId && /* @__PURE__ */ A("button", {
|
|
262
263
|
type: "button",
|
|
263
|
-
className:
|
|
264
|
-
onClick: () =>
|
|
265
|
-
children:
|
|
264
|
+
className: P,
|
|
265
|
+
onClick: () => L(`/relationships/${e.relationshipId}`),
|
|
266
|
+
children: M("banking.charges.view", "View subscription")
|
|
266
267
|
}),
|
|
267
|
-
e.status === "DISMISSED" && /* @__PURE__ */
|
|
268
|
+
e.status === "DISMISSED" && /* @__PURE__ */ A("button", {
|
|
268
269
|
type: "button",
|
|
269
|
-
className:
|
|
270
|
+
className: P,
|
|
270
271
|
onClick: () => void $("restore", e),
|
|
271
|
-
disabled:
|
|
272
|
-
children:
|
|
272
|
+
disabled: _e.isPending,
|
|
273
|
+
children: M("banking.charges.restore", "Review again")
|
|
273
274
|
})
|
|
274
275
|
]
|
|
275
276
|
})
|
|
@@ -277,99 +278,99 @@ function I() {
|
|
|
277
278
|
}, e.id))
|
|
278
279
|
})]
|
|
279
280
|
}),
|
|
280
|
-
/* @__PURE__ */
|
|
281
|
-
title:
|
|
282
|
-
description:
|
|
283
|
-
children:
|
|
284
|
-
message:
|
|
285
|
-
onRetry: () => void
|
|
286
|
-
}) : Z.length === 0 ? /* @__PURE__ */
|
|
281
|
+
/* @__PURE__ */ A(u, {
|
|
282
|
+
title: M("banking.connections.title", "Your connections"),
|
|
283
|
+
description: M("banking.connections.description", "Disconnecting deletes the accounts and transactions from Subscriber Bot."),
|
|
284
|
+
children: K.isLoading ? /* @__PURE__ */ A(l, { label: M("banking.connections.loading", "Loading connections…") }) : K.isError ? /* @__PURE__ */ A(c, {
|
|
285
|
+
message: R(K.error, M),
|
|
286
|
+
onRetry: () => void K.refetch()
|
|
287
|
+
}) : Z.length === 0 ? /* @__PURE__ */ A(o, {
|
|
287
288
|
illustration: "empty-data",
|
|
288
|
-
title:
|
|
289
|
-
description:
|
|
290
|
-
action: /* @__PURE__ */
|
|
289
|
+
title: M("banking.connections.empty.title", "No bank or card connected"),
|
|
290
|
+
description: M("banking.connections.empty.description", "Download a CSV of your transactions from your bank or card website and import it, or connect a bank."),
|
|
291
|
+
action: /* @__PURE__ */ j("button", {
|
|
291
292
|
type: "button",
|
|
292
|
-
className:
|
|
293
|
-
onClick: () =>
|
|
293
|
+
className: N,
|
|
294
|
+
onClick: () => V(!0),
|
|
294
295
|
children: [
|
|
295
|
-
/* @__PURE__ */
|
|
296
|
+
/* @__PURE__ */ A(E, {
|
|
296
297
|
className: "h-4 w-4",
|
|
297
298
|
"aria-hidden": !0
|
|
298
299
|
}),
|
|
299
300
|
" ",
|
|
300
|
-
|
|
301
|
+
M("banking.import.open", "Import a statement")
|
|
301
302
|
]
|
|
302
303
|
})
|
|
303
|
-
}) : /* @__PURE__ */
|
|
304
|
+
}) : /* @__PURE__ */ A("ul", {
|
|
304
305
|
className: "space-y-3",
|
|
305
306
|
"data-testid": "bank-connection-list",
|
|
306
|
-
children: Z.map((e) => /* @__PURE__ */
|
|
307
|
+
children: Z.map((e) => /* @__PURE__ */ j("li", {
|
|
307
308
|
className: "flex flex-col gap-3 rounded-xl border border-border-subtle bg-bg-surface p-4 sm:flex-row sm:items-center sm:justify-between",
|
|
308
309
|
"data-testid": "bank-connection",
|
|
309
|
-
children: [/* @__PURE__ */
|
|
310
|
+
children: [/* @__PURE__ */ j("div", {
|
|
310
311
|
className: "min-w-0",
|
|
311
312
|
children: [
|
|
312
|
-
/* @__PURE__ */
|
|
313
|
+
/* @__PURE__ */ j("div", {
|
|
313
314
|
className: "flex items-center gap-2",
|
|
314
|
-
children: [/* @__PURE__ */
|
|
315
|
+
children: [/* @__PURE__ */ A("p", {
|
|
315
316
|
className: "truncate text-sm font-semibold text-text-primary",
|
|
316
317
|
children: e.institutionName
|
|
317
|
-
}), /* @__PURE__ */
|
|
318
|
+
}), /* @__PURE__ */ A(a, { status: e.status })]
|
|
318
319
|
}),
|
|
319
|
-
/* @__PURE__ */
|
|
320
|
+
/* @__PURE__ */ j("p", {
|
|
320
321
|
className: "mt-0.5 text-xs text-text-secondary",
|
|
321
322
|
children: [
|
|
322
|
-
e.aggregator === "PLAID" ?
|
|
323
|
+
e.aggregator === "PLAID" ? M("banking.connections.viaPlaid", "Linked with Plaid") : M("banking.connections.viaImport", "Statement import"),
|
|
323
324
|
" · ",
|
|
324
|
-
e.accounts.map((e) => e.mask ? `${e.name} ••${e.mask}` : e.name).join(", ") ||
|
|
325
|
+
e.accounts.map((e) => e.mask ? `${e.name} ••${e.mask}` : e.name).join(", ") || M("banking.connections.noAccounts", "no accounts yet"),
|
|
325
326
|
" · ",
|
|
326
|
-
|
|
327
|
-
e.lastSyncedAt && ` · ${
|
|
327
|
+
M("banking.connections.count", "{{count}} transactions", { count: e.transactionCount }),
|
|
328
|
+
e.lastSyncedAt && ` · ${M("banking.connections.synced", "updated {{date}}", { date: d(e.lastSyncedAt) })}`
|
|
328
329
|
]
|
|
329
330
|
}),
|
|
330
|
-
e.lastSyncError && /* @__PURE__ */
|
|
331
|
+
e.lastSyncError && /* @__PURE__ */ A("p", {
|
|
331
332
|
className: "mt-1 text-xs text-status-error-text",
|
|
332
333
|
children: e.lastSyncError
|
|
333
334
|
})
|
|
334
335
|
]
|
|
335
|
-
}), /* @__PURE__ */
|
|
336
|
+
}), /* @__PURE__ */ j("div", {
|
|
336
337
|
className: "flex shrink-0 gap-2",
|
|
337
|
-
children: [e.aggregator === "PLAID" && /* @__PURE__ */
|
|
338
|
+
children: [e.aggregator === "PLAID" && /* @__PURE__ */ j("button", {
|
|
338
339
|
type: "button",
|
|
339
|
-
className:
|
|
340
|
-
onClick: () => void
|
|
341
|
-
disabled:
|
|
340
|
+
className: F,
|
|
341
|
+
onClick: () => void xe(e),
|
|
342
|
+
disabled: me.isPending || !X?.available,
|
|
342
343
|
children: [
|
|
343
|
-
/* @__PURE__ */
|
|
344
|
+
/* @__PURE__ */ A(re, {
|
|
344
345
|
className: "h-3.5 w-3.5",
|
|
345
346
|
"aria-hidden": !0
|
|
346
347
|
}),
|
|
347
348
|
" ",
|
|
348
|
-
|
|
349
|
+
M("banking.connections.sync", "Sync")
|
|
349
350
|
]
|
|
350
|
-
}), /* @__PURE__ */
|
|
351
|
+
}), /* @__PURE__ */ j("button", {
|
|
351
352
|
type: "button",
|
|
352
|
-
className:
|
|
353
|
-
onClick: () => void
|
|
354
|
-
disabled:
|
|
353
|
+
className: F,
|
|
354
|
+
onClick: () => void Se(e),
|
|
355
|
+
disabled: he.isPending,
|
|
355
356
|
children: [
|
|
356
|
-
/* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ A(ie, {
|
|
357
358
|
className: "h-3.5 w-3.5",
|
|
358
359
|
"aria-hidden": !0
|
|
359
360
|
}),
|
|
360
361
|
" ",
|
|
361
|
-
|
|
362
|
+
M("banking.connections.disconnect", "Disconnect")
|
|
362
363
|
]
|
|
363
364
|
})]
|
|
364
365
|
})]
|
|
365
366
|
}, e.id))
|
|
366
367
|
})
|
|
367
368
|
}),
|
|
368
|
-
|
|
369
|
+
le && /* @__PURE__ */ A(ce, {
|
|
369
370
|
connections: Z.filter((e) => e.aggregator === "STATEMENT_IMPORT"),
|
|
370
|
-
onClose: () =>
|
|
371
|
+
onClose: () => V(!1),
|
|
371
372
|
onImported: (e) => {
|
|
372
|
-
|
|
373
|
+
V(!1), B("DETECTED"), U({
|
|
373
374
|
tone: "success",
|
|
374
375
|
text: Q(e)
|
|
375
376
|
});
|
|
@@ -378,135 +379,135 @@ function I() {
|
|
|
378
379
|
]
|
|
379
380
|
});
|
|
380
381
|
}
|
|
381
|
-
function
|
|
382
|
-
let i =
|
|
383
|
-
if (
|
|
384
|
-
if (e.size >
|
|
385
|
-
|
|
382
|
+
function ce({ connections: e, onClose: n, onImported: ee }) {
|
|
383
|
+
let i = t(), a = _(), [o, c] = w(""), [l, u] = w(""), [f, p] = w(""), [m, h] = w(""), [g, v] = w("USD"), [y, te] = w("OUTFLOW_NEGATIVE"), [b, x] = w("MDY"), [S, C] = w(""), [T, E, D, ne] = d(), re = async (e) => {
|
|
384
|
+
if (E(null), C(""), e) {
|
|
385
|
+
if (e.size > L) {
|
|
386
|
+
E(i("banking.import.tooLarge", "That file is larger than 2 MB. Export a shorter date range."), "statement-file");
|
|
386
387
|
return;
|
|
387
388
|
}
|
|
388
|
-
|
|
389
|
+
C(await e.text());
|
|
389
390
|
}
|
|
390
|
-
},
|
|
391
|
-
if (e.preventDefault(),
|
|
392
|
-
|
|
391
|
+
}, O = async (e) => {
|
|
392
|
+
if (e.preventDefault(), E(null), !S.trim()) {
|
|
393
|
+
E(i("banking.import.required", "Choose a CSV file or paste the statement."), ["statement-csv", "statement-file"]);
|
|
393
394
|
return;
|
|
394
395
|
}
|
|
395
396
|
try {
|
|
396
|
-
|
|
397
|
+
ee(await a.mutateAsync({ input: {
|
|
397
398
|
connectionId: o || null,
|
|
398
|
-
institutionName: o ? null :
|
|
399
|
-
accountName:
|
|
400
|
-
accountMask:
|
|
401
|
-
currency:
|
|
402
|
-
csv:
|
|
403
|
-
amountConvention:
|
|
404
|
-
dateFormat:
|
|
399
|
+
institutionName: o ? null : l || null,
|
|
400
|
+
accountName: f || null,
|
|
401
|
+
accountMask: m || null,
|
|
402
|
+
currency: g || "USD",
|
|
403
|
+
csv: S,
|
|
404
|
+
amountConvention: y,
|
|
405
|
+
dateFormat: b
|
|
405
406
|
} }));
|
|
406
407
|
} catch (e) {
|
|
407
|
-
|
|
408
|
+
E(R(e, i));
|
|
408
409
|
}
|
|
409
410
|
};
|
|
410
|
-
return /* @__PURE__ */
|
|
411
|
+
return /* @__PURE__ */ A(s, {
|
|
411
412
|
title: i("banking.import.title", "Import a bank or card statement"),
|
|
412
413
|
description: i("banking.import.description", "Download your transactions as CSV from your bank or card website (two months or more works best)."),
|
|
413
414
|
onClose: n,
|
|
414
415
|
maxWidthClassName: "max-w-xl",
|
|
415
|
-
children: /* @__PURE__ */
|
|
416
|
-
onSubmit: (e) => void
|
|
416
|
+
children: /* @__PURE__ */ j("form", {
|
|
417
|
+
onSubmit: (e) => void O(e),
|
|
417
418
|
className: "space-y-3",
|
|
418
419
|
"data-testid": "import-statement-form",
|
|
419
420
|
children: [
|
|
420
|
-
e.length > 0 && /* @__PURE__ */
|
|
421
|
+
e.length > 0 && /* @__PURE__ */ j("label", {
|
|
421
422
|
className: "block text-sm text-text-primary",
|
|
422
|
-
children: [i("banking.import.target", "Add to"), /* @__PURE__ */
|
|
423
|
-
className:
|
|
423
|
+
children: [i("banking.import.target", "Add to"), /* @__PURE__ */ j("select", {
|
|
424
|
+
className: r(M, "mt-1"),
|
|
424
425
|
value: o,
|
|
425
|
-
onChange: (e) =>
|
|
426
|
-
children: [/* @__PURE__ */
|
|
426
|
+
onChange: (e) => c(e.target.value),
|
|
427
|
+
children: [/* @__PURE__ */ A("option", {
|
|
427
428
|
value: "",
|
|
428
429
|
children: i("banking.import.newConnection", "A new connection")
|
|
429
|
-
}), e.map((e) => /* @__PURE__ */
|
|
430
|
+
}), e.map((e) => /* @__PURE__ */ A("option", {
|
|
430
431
|
value: e.id,
|
|
431
432
|
children: e.institutionName
|
|
432
433
|
}, e.id))]
|
|
433
434
|
})]
|
|
434
435
|
}),
|
|
435
|
-
!o && /* @__PURE__ */
|
|
436
|
+
!o && /* @__PURE__ */ j("label", {
|
|
436
437
|
className: "block text-sm text-text-primary",
|
|
437
|
-
children: [i("banking.import.institution", "Bank or card issuer"), /* @__PURE__ */
|
|
438
|
-
className:
|
|
439
|
-
value:
|
|
438
|
+
children: [i("banking.import.institution", "Bank or card issuer"), /* @__PURE__ */ A("input", {
|
|
439
|
+
className: r(M, "mt-1"),
|
|
440
|
+
value: l,
|
|
440
441
|
onChange: (e) => u(e.target.value),
|
|
441
442
|
placeholder: i("banking.import.institutionPlaceholder", "e.g. Chase"),
|
|
442
443
|
maxLength: 255
|
|
443
444
|
})]
|
|
444
445
|
}),
|
|
445
|
-
/* @__PURE__ */
|
|
446
|
+
/* @__PURE__ */ j("div", {
|
|
446
447
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-3",
|
|
447
|
-
children: [/* @__PURE__ */
|
|
448
|
+
children: [/* @__PURE__ */ j("label", {
|
|
448
449
|
className: "block text-sm text-text-primary sm:col-span-2",
|
|
449
|
-
children: [i("banking.import.account", "Account name"), /* @__PURE__ */
|
|
450
|
-
className:
|
|
451
|
-
value:
|
|
452
|
-
onChange: (e) =>
|
|
450
|
+
children: [i("banking.import.account", "Account name"), /* @__PURE__ */ A("input", {
|
|
451
|
+
className: r(M, "mt-1"),
|
|
452
|
+
value: f,
|
|
453
|
+
onChange: (e) => p(e.target.value),
|
|
453
454
|
placeholder: i("banking.import.accountPlaceholder", "e.g. Sapphire card"),
|
|
454
455
|
maxLength: 255
|
|
455
456
|
})]
|
|
456
|
-
}), /* @__PURE__ */
|
|
457
|
+
}), /* @__PURE__ */ j("label", {
|
|
457
458
|
className: "block text-sm text-text-primary",
|
|
458
|
-
children: [i("banking.import.mask", "Last 4 digits"), /* @__PURE__ */
|
|
459
|
-
className:
|
|
460
|
-
value:
|
|
461
|
-
onChange: (e) =>
|
|
459
|
+
children: [i("banking.import.mask", "Last 4 digits"), /* @__PURE__ */ A("input", {
|
|
460
|
+
className: r(M, "mt-1"),
|
|
461
|
+
value: m,
|
|
462
|
+
onChange: (e) => h(e.target.value.replace(/\D/g, "").slice(-4)),
|
|
462
463
|
inputMode: "numeric",
|
|
463
464
|
maxLength: 4
|
|
464
465
|
})]
|
|
465
466
|
})]
|
|
466
467
|
}),
|
|
467
|
-
/* @__PURE__ */
|
|
468
|
+
/* @__PURE__ */ j("div", {
|
|
468
469
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-3",
|
|
469
470
|
children: [
|
|
470
|
-
/* @__PURE__ */
|
|
471
|
+
/* @__PURE__ */ j("label", {
|
|
471
472
|
className: "block text-sm text-text-primary",
|
|
472
|
-
children: [i("banking.import.currency", "Currency"), /* @__PURE__ */
|
|
473
|
-
className:
|
|
474
|
-
value:
|
|
475
|
-
onChange: (e) =>
|
|
473
|
+
children: [i("banking.import.currency", "Currency"), /* @__PURE__ */ A("input", {
|
|
474
|
+
className: r(M, "mt-1 uppercase"),
|
|
475
|
+
value: g,
|
|
476
|
+
onChange: (e) => v(e.target.value.toUpperCase().slice(0, 3)),
|
|
476
477
|
maxLength: 3
|
|
477
478
|
})]
|
|
478
479
|
}),
|
|
479
|
-
/* @__PURE__ */
|
|
480
|
+
/* @__PURE__ */ j("label", {
|
|
480
481
|
className: "block text-sm text-text-primary",
|
|
481
|
-
children: [i("banking.import.convention", "Money out is"), /* @__PURE__ */
|
|
482
|
-
className:
|
|
483
|
-
value:
|
|
484
|
-
onChange: (e) =>
|
|
485
|
-
children: [/* @__PURE__ */
|
|
482
|
+
children: [i("banking.import.convention", "Money out is"), /* @__PURE__ */ j("select", {
|
|
483
|
+
className: r(M, "mt-1"),
|
|
484
|
+
value: y,
|
|
485
|
+
onChange: (e) => te(e.target.value),
|
|
486
|
+
children: [/* @__PURE__ */ A("option", {
|
|
486
487
|
value: "OUTFLOW_NEGATIVE",
|
|
487
488
|
children: i("banking.import.negative", "Negative (bank)")
|
|
488
|
-
}), /* @__PURE__ */
|
|
489
|
+
}), /* @__PURE__ */ A("option", {
|
|
489
490
|
value: "OUTFLOW_POSITIVE",
|
|
490
491
|
children: i("banking.import.positive", "Positive (card)")
|
|
491
492
|
})]
|
|
492
493
|
})]
|
|
493
494
|
}),
|
|
494
|
-
/* @__PURE__ */
|
|
495
|
+
/* @__PURE__ */ j("label", {
|
|
495
496
|
className: "block text-sm text-text-primary",
|
|
496
|
-
children: [i("banking.import.dateFormat", "Date format"), /* @__PURE__ */
|
|
497
|
-
className:
|
|
498
|
-
value:
|
|
499
|
-
onChange: (e) =>
|
|
497
|
+
children: [i("banking.import.dateFormat", "Date format"), /* @__PURE__ */ j("select", {
|
|
498
|
+
className: r(M, "mt-1"),
|
|
499
|
+
value: b,
|
|
500
|
+
onChange: (e) => x(e.target.value),
|
|
500
501
|
children: [
|
|
501
|
-
/* @__PURE__ */
|
|
502
|
+
/* @__PURE__ */ A("option", {
|
|
502
503
|
value: "MDY",
|
|
503
504
|
children: "MM/DD/YYYY"
|
|
504
505
|
}),
|
|
505
|
-
/* @__PURE__ */
|
|
506
|
+
/* @__PURE__ */ A("option", {
|
|
506
507
|
value: "DMY",
|
|
507
508
|
children: "DD/MM/YYYY"
|
|
508
509
|
}),
|
|
509
|
-
/* @__PURE__ */
|
|
510
|
+
/* @__PURE__ */ A("option", {
|
|
510
511
|
value: "YMD",
|
|
511
512
|
children: "YYYY-MM-DD"
|
|
512
513
|
})
|
|
@@ -515,41 +516,47 @@ function fe({ connections: e, onClose: n, onImported: r }) {
|
|
|
515
516
|
})
|
|
516
517
|
]
|
|
517
518
|
}),
|
|
518
|
-
/* @__PURE__ */
|
|
519
|
+
/* @__PURE__ */ j("label", {
|
|
519
520
|
className: "block text-sm text-text-primary",
|
|
520
|
-
children: [i("banking.import.file", "CSV file"), /* @__PURE__ */
|
|
521
|
+
children: [i("banking.import.file", "CSV file"), /* @__PURE__ */ A("input", {
|
|
521
522
|
type: "file",
|
|
522
523
|
accept: ".csv,text/csv,text/plain",
|
|
523
|
-
className:
|
|
524
|
-
onChange: (e) => void
|
|
524
|
+
className: r(M, "mt-1"),
|
|
525
|
+
onChange: (e) => void re(e.target.files?.[0]),
|
|
526
|
+
id: "statement-file",
|
|
527
|
+
...D("statement-file"),
|
|
525
528
|
"data-testid": "import-statement-file"
|
|
526
529
|
})]
|
|
527
530
|
}),
|
|
528
|
-
/* @__PURE__ */
|
|
531
|
+
/* @__PURE__ */ j("label", {
|
|
529
532
|
className: "block text-sm text-text-primary",
|
|
530
|
-
children: [i("banking.import.paste", "Or paste the statement"), /* @__PURE__ */
|
|
531
|
-
className:
|
|
532
|
-
value:
|
|
533
|
-
onChange: (e) =>
|
|
533
|
+
children: [i("banking.import.paste", "Or paste the statement"), /* @__PURE__ */ A("textarea", {
|
|
534
|
+
className: r(M, "mt-1 h-32 font-mono text-xs"),
|
|
535
|
+
value: S,
|
|
536
|
+
onChange: (e) => C(e.target.value),
|
|
534
537
|
placeholder: "Date,Description,Amount\n10/05/2026,NETFLIX.COM,-15.49",
|
|
538
|
+
id: "statement-csv",
|
|
539
|
+
...D("statement-csv"),
|
|
535
540
|
"data-testid": "import-statement-csv"
|
|
536
541
|
})]
|
|
537
542
|
}),
|
|
538
|
-
|
|
543
|
+
T && /* @__PURE__ */ A("p", {
|
|
544
|
+
id: ne,
|
|
545
|
+
tabIndex: -1,
|
|
539
546
|
role: "alert",
|
|
540
547
|
className: "text-sm text-status-error-text",
|
|
541
|
-
children:
|
|
548
|
+
children: T
|
|
542
549
|
}),
|
|
543
|
-
/* @__PURE__ */
|
|
550
|
+
/* @__PURE__ */ j("div", {
|
|
544
551
|
className: "flex justify-end gap-2 pt-1",
|
|
545
|
-
children: [/* @__PURE__ */
|
|
552
|
+
children: [/* @__PURE__ */ A("button", {
|
|
546
553
|
type: "button",
|
|
547
|
-
className:
|
|
554
|
+
className: P,
|
|
548
555
|
onClick: n,
|
|
549
556
|
children: i("common.cancel", "Cancel")
|
|
550
|
-
}), /* @__PURE__ */
|
|
557
|
+
}), /* @__PURE__ */ A("button", {
|
|
551
558
|
type: "submit",
|
|
552
|
-
className:
|
|
559
|
+
className: N,
|
|
553
560
|
disabled: a.isPending,
|
|
554
561
|
children: a.isPending ? i("banking.import.submitting", "Importing…") : i("banking.import.submit", "Import and find subscriptions")
|
|
555
562
|
})]
|
|
@@ -559,6 +566,6 @@ function fe({ connections: e, onClose: n, onImported: r }) {
|
|
|
559
566
|
});
|
|
560
567
|
}
|
|
561
568
|
//#endregion
|
|
562
|
-
export {
|
|
569
|
+
export { z as BankConnectionsPage };
|
|
563
570
|
|
|
564
571
|
//# sourceMappingURL=BankConnectionsPage.js.map
|