@burdenoff/microfe-subscriberbot 2026.1103.2 → 2026.1105.2
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/DashboardPage.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/PageLayout.d.ts +6 -0
- package/dist/subscriberbot/components/PageLayout.d.ts.map +1 -1
- package/dist/subscriberbot/components/PageLayout.js +2 -1
- package/dist/subscriberbot/components/PageLayout.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 +2 -0
- package/dist/subscriberbot/components/StateViews.d.ts.map +1 -1
- package/dist/subscriberbot/components/StateViews.js +46 -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 +143 -135
- 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.d.ts +3 -0
- package/dist/subscriberbot/components/mobile/MobileScreen.d.ts.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileScreen.js +5 -3
- 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 +115 -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 +272 -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 +112 -91
- 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,222 @@ 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
|
-
|
|
117
|
+
"data-tour": "subscriberbot-banking-connect",
|
|
118
|
+
children: [/* @__PURE__ */ j("button", {
|
|
117
119
|
type: "button",
|
|
118
|
-
className:
|
|
119
|
-
onClick: () =>
|
|
120
|
+
className: P,
|
|
121
|
+
onClick: () => V(!0),
|
|
120
122
|
children: [
|
|
121
|
-
/* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ A(E, {
|
|
122
124
|
className: "h-4 w-4",
|
|
123
125
|
"aria-hidden": !0
|
|
124
126
|
}),
|
|
125
127
|
" ",
|
|
126
|
-
|
|
128
|
+
M("banking.import.open", "Import a statement")
|
|
127
129
|
]
|
|
128
|
-
}), /* @__PURE__ */
|
|
130
|
+
}), /* @__PURE__ */ j("button", {
|
|
129
131
|
type: "button",
|
|
130
|
-
className:
|
|
131
|
-
onClick: () => void
|
|
132
|
-
disabled: !X?.available ||
|
|
133
|
-
title: X?.available ? void 0 :
|
|
134
|
-
children: [/* @__PURE__ */
|
|
132
|
+
className: N,
|
|
133
|
+
onClick: () => void be(),
|
|
134
|
+
disabled: !X?.available || W,
|
|
135
|
+
title: X?.available ? void 0 : M("banking.plaid.unavailable", "Bank linking is not switched on yet. Import a statement instead."),
|
|
136
|
+
children: [/* @__PURE__ */ A(ne, {
|
|
135
137
|
className: "h-4 w-4",
|
|
136
138
|
"aria-hidden": !0
|
|
137
|
-
}),
|
|
139
|
+
}), W ? M("banking.plaid.linking", "Connecting…") : M("banking.plaid.connect", "Connect a bank")]
|
|
138
140
|
})]
|
|
139
141
|
});
|
|
140
|
-
return /* @__PURE__ */
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
return /* @__PURE__ */ j(ee, {
|
|
143
|
+
dataTour: "subscriberbot-banking",
|
|
144
|
+
title: M("banking.title", "Bank & card connections"),
|
|
145
|
+
description: M("banking.description", "Find every subscription in your bank and card transactions."),
|
|
146
|
+
actions: Ce,
|
|
144
147
|
children: [
|
|
145
|
-
/* @__PURE__ */
|
|
148
|
+
/* @__PURE__ */ A(oe, {
|
|
146
149
|
className: "mb-6",
|
|
147
|
-
children:
|
|
150
|
+
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
151
|
}),
|
|
149
|
-
X && !X.available && /* @__PURE__ */
|
|
152
|
+
X && !X.available && /* @__PURE__ */ j("p", {
|
|
150
153
|
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
154
|
"data-testid": "plaid-unavailable",
|
|
152
|
-
children: [/* @__PURE__ */
|
|
155
|
+
children: [/* @__PURE__ */ A(k, {
|
|
153
156
|
className: "mt-0.5 h-4 w-4 shrink-0",
|
|
154
157
|
"aria-hidden": !0
|
|
155
|
-
}),
|
|
158
|
+
}), M("banking.plaid.unavailableLong", "Direct bank linking is being switched on. Until then, import a statement export: it finds the same recurring charges.")]
|
|
156
159
|
}),
|
|
157
|
-
|
|
158
|
-
role:
|
|
159
|
-
className:
|
|
160
|
+
H && /* @__PURE__ */ A("p", {
|
|
161
|
+
role: H.tone === "error" ? "alert" : "status",
|
|
162
|
+
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
163
|
"data-testid": "banking-notice",
|
|
161
|
-
children:
|
|
164
|
+
children: H.text
|
|
162
165
|
}),
|
|
163
|
-
/* @__PURE__ */
|
|
166
|
+
/* @__PURE__ */ j("div", {
|
|
164
167
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
168
|
+
"data-tour": "subscriberbot-banking-metrics",
|
|
165
169
|
children: [
|
|
166
|
-
/* @__PURE__ */
|
|
167
|
-
icon: /* @__PURE__ */ D
|
|
168
|
-
value:
|
|
169
|
-
label:
|
|
170
|
+
/* @__PURE__ */ A(i, {
|
|
171
|
+
icon: /* @__PURE__ */ A(D, { className: "h-5 w-5" }),
|
|
172
|
+
value: K.isLoading ? "—" : Z.length,
|
|
173
|
+
label: M("banking.metrics.connections", "Connected accounts")
|
|
170
174
|
}),
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
-
icon: /* @__PURE__ */
|
|
173
|
-
value:
|
|
174
|
-
label:
|
|
175
|
+
/* @__PURE__ */ A(i, {
|
|
176
|
+
icon: /* @__PURE__ */ A(O, { className: "h-5 w-5" }),
|
|
177
|
+
value: J.isLoading ? "—" : J.data?.items.length ?? 0,
|
|
178
|
+
label: M("banking.metrics.detected", "Charges to review")
|
|
175
179
|
}),
|
|
176
|
-
/* @__PURE__ */
|
|
177
|
-
icon: /* @__PURE__ */
|
|
178
|
-
value:
|
|
179
|
-
label:
|
|
180
|
+
/* @__PURE__ */ A(i, {
|
|
181
|
+
icon: /* @__PURE__ */ A(T, { className: "h-5 w-5" }),
|
|
182
|
+
value: J.isLoading ? "—" : ye || s(0, "USD"),
|
|
183
|
+
label: M("banking.metrics.yearly", "Yearly cost to review")
|
|
180
184
|
}),
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
icon: /* @__PURE__ */
|
|
183
|
-
value:
|
|
184
|
-
label:
|
|
185
|
+
/* @__PURE__ */ A(i, {
|
|
186
|
+
icon: /* @__PURE__ */ A(k, { className: "h-5 w-5" }),
|
|
187
|
+
value: de.isLoading ? "—" : de.data?.items.length ?? 0,
|
|
188
|
+
label: M("banking.metrics.tracked", "Tracked from your bank")
|
|
185
189
|
})
|
|
186
190
|
]
|
|
187
191
|
}),
|
|
188
|
-
/* @__PURE__ */
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
+
/* @__PURE__ */ j(u, {
|
|
193
|
+
dataTour: "subscriberbot-banking-charges",
|
|
194
|
+
title: M("banking.charges.title", "Recurring charges found"),
|
|
195
|
+
description: M("banking.charges.description", "Charges from the same merchant at a steady amount and rhythm."),
|
|
196
|
+
children: [/* @__PURE__ */ A("div", {
|
|
192
197
|
role: "tablist",
|
|
193
|
-
"aria-label":
|
|
198
|
+
"aria-label": M("banking.charges.filter", "Charge status"),
|
|
194
199
|
className: "mb-3 flex gap-1.5",
|
|
195
|
-
children:
|
|
200
|
+
children: se.map((e) => /* @__PURE__ */ A("button", {
|
|
196
201
|
type: "button",
|
|
197
202
|
role: "tab",
|
|
198
|
-
"aria-selected":
|
|
199
|
-
onClick: () =>
|
|
200
|
-
className:
|
|
201
|
-
children:
|
|
203
|
+
"aria-selected": z === e,
|
|
204
|
+
onClick: () => B(e),
|
|
205
|
+
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"),
|
|
206
|
+
children: M(I[e].key, I[e].fallback)
|
|
202
207
|
}, e))
|
|
203
|
-
}),
|
|
204
|
-
message:
|
|
205
|
-
onRetry: () => void
|
|
206
|
-
}) :
|
|
208
|
+
}), q.isLoading ? /* @__PURE__ */ A(l, { label: M("banking.charges.loading", "Loading recurring charges…") }) : q.isError ? /* @__PURE__ */ A(c, {
|
|
209
|
+
message: R(q.error, M),
|
|
210
|
+
onRetry: () => void q.refetch()
|
|
211
|
+
}) : ve.length === 0 ? /* @__PURE__ */ A(o, {
|
|
207
212
|
illustration: "empty-data",
|
|
208
|
-
title:
|
|
209
|
-
description:
|
|
210
|
-
}) : /* @__PURE__ */
|
|
213
|
+
title: M("banking.charges.empty.title", "Nothing here yet"),
|
|
214
|
+
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.")
|
|
215
|
+
}) : /* @__PURE__ */ A("ul", {
|
|
211
216
|
className: "grid grid-cols-1 gap-3 lg:grid-cols-2",
|
|
212
217
|
"data-testid": "recurring-charge-list",
|
|
213
|
-
children:
|
|
218
|
+
children: ve.map((e) => /* @__PURE__ */ j("li", {
|
|
214
219
|
className: "rounded-xl border border-border-subtle bg-bg-surface p-4",
|
|
215
220
|
"data-testid": "recurring-charge",
|
|
216
221
|
children: [
|
|
217
|
-
/* @__PURE__ */
|
|
222
|
+
/* @__PURE__ */ j("div", {
|
|
218
223
|
className: "flex items-start justify-between gap-3",
|
|
219
|
-
children: [/* @__PURE__ */
|
|
224
|
+
children: [/* @__PURE__ */ j("div", {
|
|
220
225
|
className: "min-w-0",
|
|
221
|
-
children: [/* @__PURE__ */
|
|
226
|
+
children: [/* @__PURE__ */ A("p", {
|
|
222
227
|
className: "truncate text-sm font-semibold text-text-primary",
|
|
223
228
|
children: e.displayName
|
|
224
|
-
}), /* @__PURE__ */
|
|
229
|
+
}), /* @__PURE__ */ A("p", {
|
|
225
230
|
className: "mt-0.5 text-xs text-text-secondary",
|
|
226
|
-
children:
|
|
231
|
+
children: M("banking.charges.meta", "{{count}} charges since {{first}} · {{confidence}}% sure", {
|
|
227
232
|
count: e.occurrences,
|
|
228
|
-
first:
|
|
233
|
+
first: d(e.firstChargedOn),
|
|
229
234
|
confidence: e.confidence
|
|
230
235
|
})
|
|
231
236
|
})]
|
|
232
|
-
}), /* @__PURE__ */
|
|
237
|
+
}), /* @__PURE__ */ j("span", {
|
|
233
238
|
className: "shrink-0 text-sm font-semibold text-text-primary",
|
|
234
|
-
children: [
|
|
239
|
+
children: [s(e.lastAmount, e.currency), _(e.interval)]
|
|
235
240
|
})]
|
|
236
241
|
}),
|
|
237
|
-
/* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ j("p", {
|
|
238
243
|
className: "mt-2 text-xs text-text-secondary",
|
|
239
244
|
children: [
|
|
240
|
-
|
|
241
|
-
e.nextExpectedOn && ` · ${
|
|
242
|
-
` · ${
|
|
245
|
+
M("banking.charges.dates", "Last charged {{last}}", { last: d(e.lastChargedOn) }),
|
|
246
|
+
e.nextExpectedOn && ` · ${M("banking.charges.next", "next expected {{next}}", { next: d(e.nextExpectedOn) })}`,
|
|
247
|
+
` · ${M("banking.charges.yearly", "{{amount}} a year", { amount: s(e.annualCost, e.currency) })}`
|
|
243
248
|
]
|
|
244
249
|
}),
|
|
245
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ j("div", {
|
|
246
251
|
className: "mt-3 flex flex-wrap gap-2",
|
|
247
252
|
children: [
|
|
248
|
-
e.status === "DETECTED" && /* @__PURE__ */
|
|
253
|
+
e.status === "DETECTED" && /* @__PURE__ */ j(ae, { children: [/* @__PURE__ */ A("button", {
|
|
249
254
|
type: "button",
|
|
250
|
-
className:
|
|
255
|
+
className: N,
|
|
251
256
|
onClick: () => void $("track", e),
|
|
252
|
-
disabled:
|
|
253
|
-
children:
|
|
254
|
-
}), /* @__PURE__ */
|
|
257
|
+
disabled: ge.isPending,
|
|
258
|
+
children: M("banking.charges.track", "Track as subscription")
|
|
259
|
+
}), /* @__PURE__ */ A("button", {
|
|
255
260
|
type: "button",
|
|
256
|
-
className:
|
|
261
|
+
className: P,
|
|
257
262
|
onClick: () => void $("dismiss", e),
|
|
258
263
|
disabled: Y.isPending,
|
|
259
|
-
children:
|
|
264
|
+
children: M("banking.charges.dismiss", "Not a subscription")
|
|
260
265
|
})] }),
|
|
261
|
-
e.status === "TRACKED" && e.relationshipId && /* @__PURE__ */
|
|
266
|
+
e.status === "TRACKED" && e.relationshipId && /* @__PURE__ */ A("button", {
|
|
262
267
|
type: "button",
|
|
263
|
-
className:
|
|
264
|
-
onClick: () =>
|
|
265
|
-
children:
|
|
268
|
+
className: P,
|
|
269
|
+
onClick: () => L(`/relationships/${e.relationshipId}`),
|
|
270
|
+
children: M("banking.charges.view", "View subscription")
|
|
266
271
|
}),
|
|
267
|
-
e.status === "DISMISSED" && /* @__PURE__ */
|
|
272
|
+
e.status === "DISMISSED" && /* @__PURE__ */ A("button", {
|
|
268
273
|
type: "button",
|
|
269
|
-
className:
|
|
274
|
+
className: P,
|
|
270
275
|
onClick: () => void $("restore", e),
|
|
271
|
-
disabled:
|
|
272
|
-
children:
|
|
276
|
+
disabled: _e.isPending,
|
|
277
|
+
children: M("banking.charges.restore", "Review again")
|
|
273
278
|
})
|
|
274
279
|
]
|
|
275
280
|
})
|
|
@@ -277,99 +282,100 @@ function I() {
|
|
|
277
282
|
}, e.id))
|
|
278
283
|
})]
|
|
279
284
|
}),
|
|
280
|
-
/* @__PURE__ */
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
285
|
+
/* @__PURE__ */ A(u, {
|
|
286
|
+
dataTour: "subscriberbot-banking-connections",
|
|
287
|
+
title: M("banking.connections.title", "Your connections"),
|
|
288
|
+
description: M("banking.connections.description", "Disconnecting deletes the accounts and transactions from Subscriber Bot."),
|
|
289
|
+
children: K.isLoading ? /* @__PURE__ */ A(l, { label: M("banking.connections.loading", "Loading connections…") }) : K.isError ? /* @__PURE__ */ A(c, {
|
|
290
|
+
message: R(K.error, M),
|
|
291
|
+
onRetry: () => void K.refetch()
|
|
292
|
+
}) : Z.length === 0 ? /* @__PURE__ */ A(o, {
|
|
287
293
|
illustration: "empty-data",
|
|
288
|
-
title:
|
|
289
|
-
description:
|
|
290
|
-
action: /* @__PURE__ */
|
|
294
|
+
title: M("banking.connections.empty.title", "No bank or card connected"),
|
|
295
|
+
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."),
|
|
296
|
+
action: /* @__PURE__ */ j("button", {
|
|
291
297
|
type: "button",
|
|
292
|
-
className:
|
|
293
|
-
onClick: () =>
|
|
298
|
+
className: N,
|
|
299
|
+
onClick: () => V(!0),
|
|
294
300
|
children: [
|
|
295
|
-
/* @__PURE__ */
|
|
301
|
+
/* @__PURE__ */ A(E, {
|
|
296
302
|
className: "h-4 w-4",
|
|
297
303
|
"aria-hidden": !0
|
|
298
304
|
}),
|
|
299
305
|
" ",
|
|
300
|
-
|
|
306
|
+
M("banking.import.open", "Import a statement")
|
|
301
307
|
]
|
|
302
308
|
})
|
|
303
|
-
}) : /* @__PURE__ */
|
|
309
|
+
}) : /* @__PURE__ */ A("ul", {
|
|
304
310
|
className: "space-y-3",
|
|
305
311
|
"data-testid": "bank-connection-list",
|
|
306
|
-
children: Z.map((e) => /* @__PURE__ */
|
|
312
|
+
children: Z.map((e) => /* @__PURE__ */ j("li", {
|
|
307
313
|
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
314
|
"data-testid": "bank-connection",
|
|
309
|
-
children: [/* @__PURE__ */
|
|
315
|
+
children: [/* @__PURE__ */ j("div", {
|
|
310
316
|
className: "min-w-0",
|
|
311
317
|
children: [
|
|
312
|
-
/* @__PURE__ */
|
|
318
|
+
/* @__PURE__ */ j("div", {
|
|
313
319
|
className: "flex items-center gap-2",
|
|
314
|
-
children: [/* @__PURE__ */
|
|
320
|
+
children: [/* @__PURE__ */ A("p", {
|
|
315
321
|
className: "truncate text-sm font-semibold text-text-primary",
|
|
316
322
|
children: e.institutionName
|
|
317
|
-
}), /* @__PURE__ */
|
|
323
|
+
}), /* @__PURE__ */ A(a, { status: e.status })]
|
|
318
324
|
}),
|
|
319
|
-
/* @__PURE__ */
|
|
325
|
+
/* @__PURE__ */ j("p", {
|
|
320
326
|
className: "mt-0.5 text-xs text-text-secondary",
|
|
321
327
|
children: [
|
|
322
|
-
e.aggregator === "PLAID" ?
|
|
328
|
+
e.aggregator === "PLAID" ? M("banking.connections.viaPlaid", "Linked with Plaid") : M("banking.connections.viaImport", "Statement import"),
|
|
323
329
|
" · ",
|
|
324
|
-
e.accounts.map((e) => e.mask ? `${e.name} ••${e.mask}` : e.name).join(", ") ||
|
|
330
|
+
e.accounts.map((e) => e.mask ? `${e.name} ••${e.mask}` : e.name).join(", ") || M("banking.connections.noAccounts", "no accounts yet"),
|
|
325
331
|
" · ",
|
|
326
|
-
|
|
327
|
-
e.lastSyncedAt && ` · ${
|
|
332
|
+
M("banking.connections.count", "{{count}} transactions", { count: e.transactionCount }),
|
|
333
|
+
e.lastSyncedAt && ` · ${M("banking.connections.synced", "updated {{date}}", { date: d(e.lastSyncedAt) })}`
|
|
328
334
|
]
|
|
329
335
|
}),
|
|
330
|
-
e.lastSyncError && /* @__PURE__ */
|
|
336
|
+
e.lastSyncError && /* @__PURE__ */ A("p", {
|
|
331
337
|
className: "mt-1 text-xs text-status-error-text",
|
|
332
338
|
children: e.lastSyncError
|
|
333
339
|
})
|
|
334
340
|
]
|
|
335
|
-
}), /* @__PURE__ */
|
|
341
|
+
}), /* @__PURE__ */ j("div", {
|
|
336
342
|
className: "flex shrink-0 gap-2",
|
|
337
|
-
children: [e.aggregator === "PLAID" && /* @__PURE__ */
|
|
343
|
+
children: [e.aggregator === "PLAID" && /* @__PURE__ */ j("button", {
|
|
338
344
|
type: "button",
|
|
339
|
-
className:
|
|
340
|
-
onClick: () => void
|
|
341
|
-
disabled:
|
|
345
|
+
className: F,
|
|
346
|
+
onClick: () => void xe(e),
|
|
347
|
+
disabled: me.isPending || !X?.available,
|
|
342
348
|
children: [
|
|
343
|
-
/* @__PURE__ */
|
|
349
|
+
/* @__PURE__ */ A(re, {
|
|
344
350
|
className: "h-3.5 w-3.5",
|
|
345
351
|
"aria-hidden": !0
|
|
346
352
|
}),
|
|
347
353
|
" ",
|
|
348
|
-
|
|
354
|
+
M("banking.connections.sync", "Sync")
|
|
349
355
|
]
|
|
350
|
-
}), /* @__PURE__ */
|
|
356
|
+
}), /* @__PURE__ */ j("button", {
|
|
351
357
|
type: "button",
|
|
352
|
-
className:
|
|
353
|
-
onClick: () => void
|
|
354
|
-
disabled:
|
|
358
|
+
className: F,
|
|
359
|
+
onClick: () => void Se(e),
|
|
360
|
+
disabled: he.isPending,
|
|
355
361
|
children: [
|
|
356
|
-
/* @__PURE__ */
|
|
362
|
+
/* @__PURE__ */ A(ie, {
|
|
357
363
|
className: "h-3.5 w-3.5",
|
|
358
364
|
"aria-hidden": !0
|
|
359
365
|
}),
|
|
360
366
|
" ",
|
|
361
|
-
|
|
367
|
+
M("banking.connections.disconnect", "Disconnect")
|
|
362
368
|
]
|
|
363
369
|
})]
|
|
364
370
|
})]
|
|
365
371
|
}, e.id))
|
|
366
372
|
})
|
|
367
373
|
}),
|
|
368
|
-
|
|
374
|
+
le && /* @__PURE__ */ A(ce, {
|
|
369
375
|
connections: Z.filter((e) => e.aggregator === "STATEMENT_IMPORT"),
|
|
370
|
-
onClose: () =>
|
|
376
|
+
onClose: () => V(!1),
|
|
371
377
|
onImported: (e) => {
|
|
372
|
-
|
|
378
|
+
V(!1), B("DETECTED"), U({
|
|
373
379
|
tone: "success",
|
|
374
380
|
text: Q(e)
|
|
375
381
|
});
|
|
@@ -378,135 +384,135 @@ function I() {
|
|
|
378
384
|
]
|
|
379
385
|
});
|
|
380
386
|
}
|
|
381
|
-
function
|
|
382
|
-
let i =
|
|
383
|
-
if (
|
|
384
|
-
if (e.size >
|
|
385
|
-
|
|
387
|
+
function ce({ connections: e, onClose: n, onImported: ee }) {
|
|
388
|
+
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) => {
|
|
389
|
+
if (E(null), C(""), e) {
|
|
390
|
+
if (e.size > L) {
|
|
391
|
+
E(i("banking.import.tooLarge", "That file is larger than 2 MB. Export a shorter date range."), "statement-file");
|
|
386
392
|
return;
|
|
387
393
|
}
|
|
388
|
-
|
|
394
|
+
C(await e.text());
|
|
389
395
|
}
|
|
390
|
-
},
|
|
391
|
-
if (e.preventDefault(),
|
|
392
|
-
|
|
396
|
+
}, O = async (e) => {
|
|
397
|
+
if (e.preventDefault(), E(null), !S.trim()) {
|
|
398
|
+
E(i("banking.import.required", "Choose a CSV file or paste the statement."), ["statement-csv", "statement-file"]);
|
|
393
399
|
return;
|
|
394
400
|
}
|
|
395
401
|
try {
|
|
396
|
-
|
|
402
|
+
ee(await a.mutateAsync({ input: {
|
|
397
403
|
connectionId: o || null,
|
|
398
|
-
institutionName: o ? null :
|
|
399
|
-
accountName:
|
|
400
|
-
accountMask:
|
|
401
|
-
currency:
|
|
402
|
-
csv:
|
|
403
|
-
amountConvention:
|
|
404
|
-
dateFormat:
|
|
404
|
+
institutionName: o ? null : l || null,
|
|
405
|
+
accountName: f || null,
|
|
406
|
+
accountMask: m || null,
|
|
407
|
+
currency: g || "USD",
|
|
408
|
+
csv: S,
|
|
409
|
+
amountConvention: y,
|
|
410
|
+
dateFormat: b
|
|
405
411
|
} }));
|
|
406
412
|
} catch (e) {
|
|
407
|
-
|
|
413
|
+
E(R(e, i));
|
|
408
414
|
}
|
|
409
415
|
};
|
|
410
|
-
return /* @__PURE__ */
|
|
416
|
+
return /* @__PURE__ */ A(s, {
|
|
411
417
|
title: i("banking.import.title", "Import a bank or card statement"),
|
|
412
418
|
description: i("banking.import.description", "Download your transactions as CSV from your bank or card website (two months or more works best)."),
|
|
413
419
|
onClose: n,
|
|
414
420
|
maxWidthClassName: "max-w-xl",
|
|
415
|
-
children: /* @__PURE__ */
|
|
416
|
-
onSubmit: (e) => void
|
|
421
|
+
children: /* @__PURE__ */ j("form", {
|
|
422
|
+
onSubmit: (e) => void O(e),
|
|
417
423
|
className: "space-y-3",
|
|
418
424
|
"data-testid": "import-statement-form",
|
|
419
425
|
children: [
|
|
420
|
-
e.length > 0 && /* @__PURE__ */
|
|
426
|
+
e.length > 0 && /* @__PURE__ */ j("label", {
|
|
421
427
|
className: "block text-sm text-text-primary",
|
|
422
|
-
children: [i("banking.import.target", "Add to"), /* @__PURE__ */
|
|
423
|
-
className:
|
|
428
|
+
children: [i("banking.import.target", "Add to"), /* @__PURE__ */ j("select", {
|
|
429
|
+
className: r(M, "mt-1"),
|
|
424
430
|
value: o,
|
|
425
|
-
onChange: (e) =>
|
|
426
|
-
children: [/* @__PURE__ */
|
|
431
|
+
onChange: (e) => c(e.target.value),
|
|
432
|
+
children: [/* @__PURE__ */ A("option", {
|
|
427
433
|
value: "",
|
|
428
434
|
children: i("banking.import.newConnection", "A new connection")
|
|
429
|
-
}), e.map((e) => /* @__PURE__ */
|
|
435
|
+
}), e.map((e) => /* @__PURE__ */ A("option", {
|
|
430
436
|
value: e.id,
|
|
431
437
|
children: e.institutionName
|
|
432
438
|
}, e.id))]
|
|
433
439
|
})]
|
|
434
440
|
}),
|
|
435
|
-
!o && /* @__PURE__ */
|
|
441
|
+
!o && /* @__PURE__ */ j("label", {
|
|
436
442
|
className: "block text-sm text-text-primary",
|
|
437
|
-
children: [i("banking.import.institution", "Bank or card issuer"), /* @__PURE__ */
|
|
438
|
-
className:
|
|
439
|
-
value:
|
|
443
|
+
children: [i("banking.import.institution", "Bank or card issuer"), /* @__PURE__ */ A("input", {
|
|
444
|
+
className: r(M, "mt-1"),
|
|
445
|
+
value: l,
|
|
440
446
|
onChange: (e) => u(e.target.value),
|
|
441
447
|
placeholder: i("banking.import.institutionPlaceholder", "e.g. Chase"),
|
|
442
448
|
maxLength: 255
|
|
443
449
|
})]
|
|
444
450
|
}),
|
|
445
|
-
/* @__PURE__ */
|
|
451
|
+
/* @__PURE__ */ j("div", {
|
|
446
452
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-3",
|
|
447
|
-
children: [/* @__PURE__ */
|
|
453
|
+
children: [/* @__PURE__ */ j("label", {
|
|
448
454
|
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) =>
|
|
455
|
+
children: [i("banking.import.account", "Account name"), /* @__PURE__ */ A("input", {
|
|
456
|
+
className: r(M, "mt-1"),
|
|
457
|
+
value: f,
|
|
458
|
+
onChange: (e) => p(e.target.value),
|
|
453
459
|
placeholder: i("banking.import.accountPlaceholder", "e.g. Sapphire card"),
|
|
454
460
|
maxLength: 255
|
|
455
461
|
})]
|
|
456
|
-
}), /* @__PURE__ */
|
|
462
|
+
}), /* @__PURE__ */ j("label", {
|
|
457
463
|
className: "block text-sm text-text-primary",
|
|
458
|
-
children: [i("banking.import.mask", "Last 4 digits"), /* @__PURE__ */
|
|
459
|
-
className:
|
|
460
|
-
value:
|
|
461
|
-
onChange: (e) =>
|
|
464
|
+
children: [i("banking.import.mask", "Last 4 digits"), /* @__PURE__ */ A("input", {
|
|
465
|
+
className: r(M, "mt-1"),
|
|
466
|
+
value: m,
|
|
467
|
+
onChange: (e) => h(e.target.value.replace(/\D/g, "").slice(-4)),
|
|
462
468
|
inputMode: "numeric",
|
|
463
469
|
maxLength: 4
|
|
464
470
|
})]
|
|
465
471
|
})]
|
|
466
472
|
}),
|
|
467
|
-
/* @__PURE__ */
|
|
473
|
+
/* @__PURE__ */ j("div", {
|
|
468
474
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-3",
|
|
469
475
|
children: [
|
|
470
|
-
/* @__PURE__ */
|
|
476
|
+
/* @__PURE__ */ j("label", {
|
|
471
477
|
className: "block text-sm text-text-primary",
|
|
472
|
-
children: [i("banking.import.currency", "Currency"), /* @__PURE__ */
|
|
473
|
-
className:
|
|
474
|
-
value:
|
|
475
|
-
onChange: (e) =>
|
|
478
|
+
children: [i("banking.import.currency", "Currency"), /* @__PURE__ */ A("input", {
|
|
479
|
+
className: r(M, "mt-1 uppercase"),
|
|
480
|
+
value: g,
|
|
481
|
+
onChange: (e) => v(e.target.value.toUpperCase().slice(0, 3)),
|
|
476
482
|
maxLength: 3
|
|
477
483
|
})]
|
|
478
484
|
}),
|
|
479
|
-
/* @__PURE__ */
|
|
485
|
+
/* @__PURE__ */ j("label", {
|
|
480
486
|
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__ */
|
|
487
|
+
children: [i("banking.import.convention", "Money out is"), /* @__PURE__ */ j("select", {
|
|
488
|
+
className: r(M, "mt-1"),
|
|
489
|
+
value: y,
|
|
490
|
+
onChange: (e) => te(e.target.value),
|
|
491
|
+
children: [/* @__PURE__ */ A("option", {
|
|
486
492
|
value: "OUTFLOW_NEGATIVE",
|
|
487
493
|
children: i("banking.import.negative", "Negative (bank)")
|
|
488
|
-
}), /* @__PURE__ */
|
|
494
|
+
}), /* @__PURE__ */ A("option", {
|
|
489
495
|
value: "OUTFLOW_POSITIVE",
|
|
490
496
|
children: i("banking.import.positive", "Positive (card)")
|
|
491
497
|
})]
|
|
492
498
|
})]
|
|
493
499
|
}),
|
|
494
|
-
/* @__PURE__ */
|
|
500
|
+
/* @__PURE__ */ j("label", {
|
|
495
501
|
className: "block text-sm text-text-primary",
|
|
496
|
-
children: [i("banking.import.dateFormat", "Date format"), /* @__PURE__ */
|
|
497
|
-
className:
|
|
498
|
-
value:
|
|
499
|
-
onChange: (e) =>
|
|
502
|
+
children: [i("banking.import.dateFormat", "Date format"), /* @__PURE__ */ j("select", {
|
|
503
|
+
className: r(M, "mt-1"),
|
|
504
|
+
value: b,
|
|
505
|
+
onChange: (e) => x(e.target.value),
|
|
500
506
|
children: [
|
|
501
|
-
/* @__PURE__ */
|
|
507
|
+
/* @__PURE__ */ A("option", {
|
|
502
508
|
value: "MDY",
|
|
503
509
|
children: "MM/DD/YYYY"
|
|
504
510
|
}),
|
|
505
|
-
/* @__PURE__ */
|
|
511
|
+
/* @__PURE__ */ A("option", {
|
|
506
512
|
value: "DMY",
|
|
507
513
|
children: "DD/MM/YYYY"
|
|
508
514
|
}),
|
|
509
|
-
/* @__PURE__ */
|
|
515
|
+
/* @__PURE__ */ A("option", {
|
|
510
516
|
value: "YMD",
|
|
511
517
|
children: "YYYY-MM-DD"
|
|
512
518
|
})
|
|
@@ -515,41 +521,47 @@ function fe({ connections: e, onClose: n, onImported: r }) {
|
|
|
515
521
|
})
|
|
516
522
|
]
|
|
517
523
|
}),
|
|
518
|
-
/* @__PURE__ */
|
|
524
|
+
/* @__PURE__ */ j("label", {
|
|
519
525
|
className: "block text-sm text-text-primary",
|
|
520
|
-
children: [i("banking.import.file", "CSV file"), /* @__PURE__ */
|
|
526
|
+
children: [i("banking.import.file", "CSV file"), /* @__PURE__ */ A("input", {
|
|
521
527
|
type: "file",
|
|
522
528
|
accept: ".csv,text/csv,text/plain",
|
|
523
|
-
className:
|
|
524
|
-
onChange: (e) => void
|
|
529
|
+
className: r(M, "mt-1"),
|
|
530
|
+
onChange: (e) => void re(e.target.files?.[0]),
|
|
531
|
+
id: "statement-file",
|
|
532
|
+
...D("statement-file"),
|
|
525
533
|
"data-testid": "import-statement-file"
|
|
526
534
|
})]
|
|
527
535
|
}),
|
|
528
|
-
/* @__PURE__ */
|
|
536
|
+
/* @__PURE__ */ j("label", {
|
|
529
537
|
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) =>
|
|
538
|
+
children: [i("banking.import.paste", "Or paste the statement"), /* @__PURE__ */ A("textarea", {
|
|
539
|
+
className: r(M, "mt-1 h-32 font-mono text-xs"),
|
|
540
|
+
value: S,
|
|
541
|
+
onChange: (e) => C(e.target.value),
|
|
534
542
|
placeholder: "Date,Description,Amount\n10/05/2026,NETFLIX.COM,-15.49",
|
|
543
|
+
id: "statement-csv",
|
|
544
|
+
...D("statement-csv"),
|
|
535
545
|
"data-testid": "import-statement-csv"
|
|
536
546
|
})]
|
|
537
547
|
}),
|
|
538
|
-
|
|
548
|
+
T && /* @__PURE__ */ A("p", {
|
|
549
|
+
id: ne,
|
|
550
|
+
tabIndex: -1,
|
|
539
551
|
role: "alert",
|
|
540
552
|
className: "text-sm text-status-error-text",
|
|
541
|
-
children:
|
|
553
|
+
children: T
|
|
542
554
|
}),
|
|
543
|
-
/* @__PURE__ */
|
|
555
|
+
/* @__PURE__ */ j("div", {
|
|
544
556
|
className: "flex justify-end gap-2 pt-1",
|
|
545
|
-
children: [/* @__PURE__ */
|
|
557
|
+
children: [/* @__PURE__ */ A("button", {
|
|
546
558
|
type: "button",
|
|
547
|
-
className:
|
|
559
|
+
className: P,
|
|
548
560
|
onClick: n,
|
|
549
561
|
children: i("common.cancel", "Cancel")
|
|
550
|
-
}), /* @__PURE__ */
|
|
562
|
+
}), /* @__PURE__ */ A("button", {
|
|
551
563
|
type: "submit",
|
|
552
|
-
className:
|
|
564
|
+
className: N,
|
|
553
565
|
disabled: a.isPending,
|
|
554
566
|
children: a.isPending ? i("banking.import.submitting", "Importing…") : i("banking.import.submit", "Import and find subscriptions")
|
|
555
567
|
})]
|
|
@@ -559,6 +571,6 @@ function fe({ connections: e, onClose: n, onImported: r }) {
|
|
|
559
571
|
});
|
|
560
572
|
}
|
|
561
573
|
//#endregion
|
|
562
|
-
export {
|
|
574
|
+
export { z as BankConnectionsPage };
|
|
563
575
|
|
|
564
576
|
//# sourceMappingURL=BankConnectionsPage.js.map
|