@burdenoff/microfe-subscriberbot 2026.1107.8 → 2026.1110.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/dist/node_modules/clsx/dist/clsx.js +8 -7
  2. package/dist/node_modules/clsx/dist/clsx.js.map +1 -1
  3. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +134 -151
  4. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
  5. package/dist/subscriberbot/SubscriberBotRoot.js +10 -7
  6. package/dist/subscriberbot/SubscriberBotRoot.js.map +1 -1
  7. package/dist/subscriberbot/SubscriberBotRoutes.js +1 -2
  8. package/dist/subscriberbot/SubscriberBotRoutes.js.map +1 -1
  9. package/dist/subscriberbot/admin/AdminDashboardPage.js +9 -10
  10. package/dist/subscriberbot/admin/AdminDashboardPage.js.map +1 -1
  11. package/dist/subscriberbot/admin/AdminRoot.js +2 -3
  12. package/dist/subscriberbot/admin/AdminRoot.js.map +1 -1
  13. package/dist/subscriberbot/admin/NegotiationDeskPanel.js +56 -57
  14. package/dist/subscriberbot/admin/NegotiationDeskPanel.js.map +1 -1
  15. package/dist/subscriberbot/admin/ProcurementDeskPanel.js +107 -108
  16. package/dist/subscriberbot/admin/ProcurementDeskPanel.js.map +1 -1
  17. package/dist/subscriberbot/admin/index.js +1 -1
  18. package/dist/subscriberbot/components/EmptyState.js +1 -2
  19. package/dist/subscriberbot/components/EmptyState.js.map +1 -1
  20. package/dist/subscriberbot/components/MetricsCard.js +1 -2
  21. package/dist/subscriberbot/components/MetricsCard.js.map +1 -1
  22. package/dist/subscriberbot/components/Modal.js +2 -3
  23. package/dist/subscriberbot/components/Modal.js.map +1 -1
  24. package/dist/subscriberbot/components/PageLayout.js +1 -2
  25. package/dist/subscriberbot/components/PageLayout.js.map +1 -1
  26. package/dist/subscriberbot/components/PostureOptions.js +7 -8
  27. package/dist/subscriberbot/components/PostureOptions.js.map +1 -1
  28. package/dist/subscriberbot/components/StateViews.js +1 -2
  29. package/dist/subscriberbot/components/StateViews.js.map +1 -1
  30. package/dist/subscriberbot/components/StatusBadge.js +2 -3
  31. package/dist/subscriberbot/components/StatusBadge.js.map +1 -1
  32. package/dist/subscriberbot/components/decisions/DecisionBanners.js +7 -8
  33. package/dist/subscriberbot/components/decisions/DecisionBanners.js.map +1 -1
  34. package/dist/subscriberbot/components/decisions/DecisionCard.js +65 -66
  35. package/dist/subscriberbot/components/decisions/DecisionCard.js.map +1 -1
  36. package/dist/subscriberbot/components/decisions/decisionModel.js +2 -3
  37. package/dist/subscriberbot/components/decisions/decisionModel.js.map +1 -1
  38. package/dist/subscriberbot/components/decisions/index.js +4 -3
  39. package/dist/subscriberbot/components/index.js +8 -7
  40. package/dist/subscriberbot/components/mobile/MobileDashboard.js +23 -24
  41. package/dist/subscriberbot/components/mobile/MobileDashboard.js.map +1 -1
  42. package/dist/subscriberbot/components/mobile/MobileRelationshipList.js +40 -49
  43. package/dist/subscriberbot/components/mobile/MobileRelationshipList.js.map +1 -1
  44. package/dist/subscriberbot/components/mobile/MobileScreen.js +1 -2
  45. package/dist/subscriberbot/components/mobile/MobileScreen.js.map +1 -1
  46. package/dist/subscriberbot/components/mobile/RelationshipGlyph.js +1 -2
  47. package/dist/subscriberbot/components/mobile/RelationshipGlyph.js.map +1 -1
  48. package/dist/subscriberbot/components/mobile/index.js +4 -3
  49. package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.js +1 -2
  50. package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.js.map +1 -1
  51. package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js +4 -5
  52. package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js.map +1 -1
  53. package/dist/subscriberbot/components/negotiations/OutcomeForm.js +4 -5
  54. package/dist/subscriberbot/components/negotiations/OutcomeForm.js.map +1 -1
  55. package/dist/subscriberbot/components/negotiations/index.js +5 -4
  56. package/dist/subscriberbot/components/negotiations/labels.js +1 -2
  57. package/dist/subscriberbot/components/negotiations/labels.js.map +1 -1
  58. package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js +4 -5
  59. package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js.map +1 -1
  60. package/dist/subscriberbot/components/procurement/ProcurementStatusPill.js +1 -2
  61. package/dist/subscriberbot/components/procurement/ProcurementStatusPill.js.map +1 -1
  62. package/dist/subscriberbot/components/procurement/ProcurementThread.js +4 -5
  63. package/dist/subscriberbot/components/procurement/ProcurementThread.js.map +1 -1
  64. package/dist/subscriberbot/components/procurement/index.js +5 -4
  65. package/dist/subscriberbot/components/procurement/labels.js +1 -2
  66. package/dist/subscriberbot/components/procurement/labels.js.map +1 -1
  67. package/dist/subscriberbot/components/savings/SavingsCards.js +90 -91
  68. package/dist/subscriberbot/components/savings/SavingsCards.js.map +1 -1
  69. package/dist/subscriberbot/components/savings/index.js +3 -2
  70. package/dist/subscriberbot/components/savings/savingsModel.js +2 -3
  71. package/dist/subscriberbot/components/savings/savingsModel.js.map +1 -1
  72. package/dist/subscriberbot/components/viz.js +2 -3
  73. package/dist/subscriberbot/components/viz.js.map +1 -1
  74. package/dist/subscriberbot/context/SubscriberBotContext.js +3 -3
  75. package/dist/subscriberbot/context/SubscriberBotContext.js.map +1 -1
  76. package/dist/subscriberbot/context/index.js +1 -1
  77. package/dist/subscriberbot/hooks/index.js +2 -2
  78. package/dist/subscriberbot/hooks/useAutonomousAgentMode.js +2 -3
  79. package/dist/subscriberbot/hooks/useAutonomousAgentMode.js.map +1 -1
  80. package/dist/subscriberbot/hooks/useBankingApi.js +2 -3
  81. package/dist/subscriberbot/hooks/useBankingApi.js.map +1 -1
  82. package/dist/subscriberbot/hooks/useCompactViewport.js +1 -2
  83. package/dist/subscriberbot/hooks/useCompactViewport.js.map +1 -1
  84. package/dist/subscriberbot/hooks/useFormError.js +1 -2
  85. package/dist/subscriberbot/hooks/useFormError.js.map +1 -1
  86. package/dist/subscriberbot/hooks/useFormatters.js +1 -2
  87. package/dist/subscriberbot/hooks/useFormatters.js.map +1 -1
  88. package/dist/subscriberbot/hooks/useNegotiationApi.js +2 -3
  89. package/dist/subscriberbot/hooks/useNegotiationApi.js.map +1 -1
  90. package/dist/subscriberbot/hooks/useProcurementApi.js +2 -3
  91. package/dist/subscriberbot/hooks/useProcurementApi.js.map +1 -1
  92. package/dist/subscriberbot/hooks/useRouteSelection.js +3 -3
  93. package/dist/subscriberbot/hooks/useRouteSelection.js.map +1 -1
  94. package/dist/subscriberbot/hooks/useSubscriberBotApi.js +1 -2
  95. package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
  96. package/dist/subscriberbot/hooks/useTr.js +1 -2
  97. package/dist/subscriberbot/hooks/useTr.js.map +1 -1
  98. package/dist/subscriberbot/index.js +9 -8
  99. package/dist/subscriberbot/pages/AssetVaultPage.js +34 -35
  100. package/dist/subscriberbot/pages/AssetVaultPage.js.map +1 -1
  101. package/dist/subscriberbot/pages/DashboardPage.js +86 -87
  102. package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
  103. package/dist/subscriberbot/pages/InboxPage.js +194 -199
  104. package/dist/subscriberbot/pages/InboxPage.js.map +1 -1
  105. package/dist/subscriberbot/pages/InsightsPage.js +28 -29
  106. package/dist/subscriberbot/pages/InsightsPage.js.map +1 -1
  107. package/dist/subscriberbot/pages/InvoicesPage.js +179 -188
  108. package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -1
  109. package/dist/subscriberbot/pages/RenewalsPage.js +293 -298
  110. package/dist/subscriberbot/pages/RenewalsPage.js.map +1 -1
  111. package/dist/subscriberbot/pages/SavingsPage.js +25 -26
  112. package/dist/subscriberbot/pages/SavingsPage.js.map +1 -1
  113. package/dist/subscriberbot/pages/WorkflowsPage.js +67 -68
  114. package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -1
  115. package/dist/subscriberbot/pages/agents/AgentDetailPage.js +126 -127
  116. package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
  117. package/dist/subscriberbot/pages/agents/AgentNewPage.js +10 -11
  118. package/dist/subscriberbot/pages/agents/AgentNewPage.js.map +1 -1
  119. package/dist/subscriberbot/pages/agents/AgentsListPage.js +23 -24
  120. package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
  121. package/dist/subscriberbot/pages/banking/BankConnectionsPage.js +337 -359
  122. package/dist/subscriberbot/pages/banking/BankConnectionsPage.js.map +1 -1
  123. package/dist/subscriberbot/pages/banking/ConnectBankModal.js +22 -27
  124. package/dist/subscriberbot/pages/banking/ConnectBankModal.js.map +1 -1
  125. package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js +25 -26
  126. package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js.map +1 -1
  127. package/dist/subscriberbot/pages/decisions/DecisionsPage.js +34 -35
  128. package/dist/subscriberbot/pages/decisions/DecisionsPage.js.map +1 -1
  129. package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js +125 -130
  130. package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js.map +1 -1
  131. package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js +94 -95
  132. package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js.map +1 -1
  133. package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js +15 -16
  134. package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js.map +1 -1
  135. package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js +20 -21
  136. package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js.map +1 -1
  137. package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js +86 -87
  138. package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js.map +1 -1
  139. package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js +164 -165
  140. package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js.map +1 -1
  141. package/dist/subscriberbot/pages/procurement/ProcurementPage.js +20 -21
  142. package/dist/subscriberbot/pages/procurement/ProcurementPage.js.map +1 -1
  143. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +350 -351
  144. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -1
  145. package/dist/subscriberbot/pages/providers/ProviderInsights.js +95 -96
  146. package/dist/subscriberbot/pages/providers/ProviderInsights.js.map +1 -1
  147. package/dist/subscriberbot/pages/providers/ProviderNewPage.js +11 -12
  148. package/dist/subscriberbot/pages/providers/ProviderNewPage.js.map +1 -1
  149. package/dist/subscriberbot/pages/providers/ProvidersListPage.js +62 -63
  150. package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -1
  151. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +166 -172
  152. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
  153. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +12 -13
  154. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js.map +1 -1
  155. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +21 -22
  156. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
  157. package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js +242 -255
  158. package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js.map +1 -1
  159. package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js +2 -3
  160. package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js.map +1 -1
  161. package/dist/subscriberbot/services/createSandboxAssistantTransport.js +1 -2
  162. package/dist/subscriberbot/services/createSandboxAssistantTransport.js.map +1 -1
  163. package/dist/subscriberbot/store/index.js +1 -1
  164. package/dist/subscriberbot/store/subscriberbotStore.js +1 -2
  165. package/dist/subscriberbot/store/subscriberbotStore.js.map +1 -1
  166. package/dist/subscriberbot/utils/bankRedirectLink.js +18 -19
  167. package/dist/subscriberbot/utils/bankRedirectLink.js.map +1 -1
  168. package/dist/subscriberbot/utils/chartScale.js +1 -2
  169. package/dist/subscriberbot/utils/chartScale.js.map +1 -1
  170. package/dist/subscriberbot/utils/cn.js +2 -3
  171. package/dist/subscriberbot/utils/cn.js.map +1 -1
  172. package/dist/subscriberbot/utils/formatters.js +4 -5
  173. package/dist/subscriberbot/utils/formatters.js.map +1 -1
  174. package/dist/subscriberbot/utils/navigation.js +1 -2
  175. package/dist/subscriberbot/utils/navigation.js.map +1 -1
  176. package/dist/subscriberbot/utils/pageContext.js +3 -4
  177. package/dist/subscriberbot/utils/pageContext.js.map +1 -1
  178. package/dist/subscriberbot/utils/plaidLink.js +21 -22
  179. package/dist/subscriberbot/utils/plaidLink.js.map +1 -1
  180. package/dist/subscriberbot/utils/portfolio.js +5 -6
  181. package/dist/subscriberbot/utils/portfolio.js.map +1 -1
  182. package/dist/subscriberbot/utils/renewals.js +1 -2
  183. package/dist/subscriberbot/utils/renewals.js.map +1 -1
  184. package/package.json +2 -2
@@ -1,29 +1,29 @@
1
- import { useSubscriberBot as e } from "../../context/SubscriberBotContext.js";
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";
1
+ import { useFormError as e } from "../../hooks/useFormError.js";
2
+ import { useFormatters as t } from "../../hooks/useFormatters.js";
3
+ import "../../components/index.js";
4
+ import { useSubscriberBot as n } from "../../context/SubscriberBotContext.js";
5
+ import { PageLayout as r } from "../../components/PageLayout.js";
6
6
  import { MetricsCard as i } from "../../components/MetricsCard.js";
7
7
  import { StatusBadge as a } from "../../components/StatusBadge.js";
8
8
  import { EmptyState as o } from "../../components/EmptyState.js";
9
9
  import { Modal as s } from "../../components/Modal.js";
10
10
  import { ErrorView as c, LoadingView as l, Section as u } from "../../components/StateViews.js";
11
- import "../../components/index.js";
12
- import { useFormError as d } from "../../hooks/useFormError.js";
13
- import { useBankAggregators as f, useBankConnections as te, useCompleteBankLink as p, useCreateBankLinkSession as ne, useDismissRecurringCharge as m, useImportBankStatement as re, useRecurringCharges as h, useRemoveBankConnection as g, useRestoreRecurringCharge as ie, useSyncBankConnection as _, useTrackRecurringCharge as ae } from "../../hooks/useBankingApi.js";
14
- import { consumeBankRedirect as v, savePendingBankLink as y } from "../../utils/bankRedirectLink.js";
15
- import { openPlaidLink as b } from "../../utils/plaidLink.js";
16
- import { ConnectBankModal as x } from "./ConnectBankModal.js";
17
- import { useEffect as S, useMemo as C, useRef as oe, useState as w } from "react";
18
- import { CalendarClock as se, FileUp as ce, Landmark as le, Link2 as T, RefreshCw as ue, Repeat as de, ShieldCheck as fe, Trash2 as pe } from "lucide-react";
19
- import { Fragment as me, jsx as E, jsxs as D } from "react/jsx-runtime";
20
- import { PagePurpose as he } from "@burdenoff/fe-libs/ui";
21
- //#region src/subscriberbot/pages/banking/BankConnectionsPage.tsx
22
- var O = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", k = "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", A = "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", j = "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", ge = [
11
+ import { useBankAggregators as d, useBankConnections as ee, useCompleteBankLink as f, useCreateBankLinkSession as te, useDismissRecurringCharge as p, useImportBankStatement as ne, useRecurringCharges as m, useRemoveBankConnection as h, useRestoreRecurringCharge as re, useSyncBankConnection as g, useTrackRecurringCharge as ie } from "../../hooks/useBankingApi.js";
12
+ import { useTr as _ } from "../../hooks/useTr.js";
13
+ import { cn as v } from "../../utils/cn.js";
14
+ import { consumeBankRedirect as y, savePendingBankLink as b } from "../../utils/bankRedirectLink.js";
15
+ import { openPlaidLink as x } from "../../utils/plaidLink.js";
16
+ import { ConnectBankModal as S } from "./ConnectBankModal.js";
17
+ import { useEffect as C, useMemo as w, useRef as ae, useState as T } from "react";
18
+ import { CalendarClock as oe, FileUp as se, Landmark as ce, Link2 as E, RefreshCw as le, Repeat as ue, ShieldCheck as de, Trash2 as fe } from "lucide-react";
19
+ import { Fragment as pe, jsx as D, jsxs as O } from "react/jsx-runtime";
20
+ import { PagePurpose as me } from "@burdenoff/fe-libs/ui";
21
+ // src/subscriberbot/pages/banking/BankConnectionsPage.tsx
22
+ var k = "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)]", A = "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", j = "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", M = "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", he = [
23
23
  "DETECTED",
24
24
  "TRACKED",
25
25
  "DISMISSED"
26
- ], _e = {
26
+ ], ge = {
27
27
  DETECTED: {
28
28
  key: "banking.charges.detected",
29
29
  fallback: "To review"
@@ -36,11 +36,11 @@ var O = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 t
36
36
  key: "banking.charges.dismissed",
37
37
  fallback: "Dismissed"
38
38
  }
39
- }, ve = 2e6, M = new Set([
39
+ }, _e = 2e6, N = /* @__PURE__ */ new Set([
40
40
  "PLAID",
41
41
  "TRUELAYER",
42
42
  "ACCOUNT_AGGREGATOR"
43
- ]), ye = {
43
+ ]), ve = {
44
44
  PLAID: {
45
45
  key: "banking.connections.viaPlaid",
46
46
  fallback: "Linked with Plaid"
@@ -57,455 +57,443 @@ var O = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 t
57
57
  key: "banking.connections.viaImport",
58
58
  fallback: "Statement import"
59
59
  }
60
- }, be = (e) => {
60
+ }, ye = (e) => {
61
61
  if (!e) return !1;
62
62
  try {
63
63
  return new URL(e).protocol === "https:";
64
64
  } catch {
65
65
  return !1;
66
66
  }
67
- }, N = (e, t) => e instanceof Error ? e.message : t("common.somethingWentWrong", "Something went wrong");
68
- function P() {
69
- let { formatCurrency: s, formatDate: d, formatIntervalSuffix: re } = n(), O = t(), { navigateTo: ve } = e(), [P, Se] = w("DETECTED"), [Ce, F] = w(!1), [I, L] = w(null), [R, z] = w(!1), [B, V] = w(null), we = oe(!1), H = f(), U = te(), W = h(P), G = h("DETECTED"), Te = h("TRACKED"), K = ne(), Ee = p(), q = _(), De = g(), Oe = ae(), ke = m(), Ae = ie(), J = C(() => (H.data ?? []).filter((e) => M.has(e.aggregator)), [H.data]), Y = J.some((e) => e.available), je = (e) => J.some((t) => t.aggregator === e && t.available), X = U.data?.items ?? [], Me = W.data?.items ?? [], Ne = C(() => {
70
- let e = /* @__PURE__ */ new Map();
71
- for (let t of G.data?.items ?? []) e.set(t.currency, (e.get(t.currency) ?? 0) + t.annualCost);
72
- return [...e.entries()].map(([e, t]) => s(t, e)).join(" + ");
73
- }, [G.data, s]), Z = (e) => O("banking.notice.synced", "{{added}} new transaction(s) from {{institution}}; {{recurring}} recurring charge(s) found.", {
67
+ }, P = (e, t) => e instanceof Error ? e.message : t("common.somethingWentWrong", "Something went wrong");
68
+ function F() {
69
+ let { formatCurrency: e, formatDate: s, formatIntervalSuffix: ne } = t(), k = _(), { navigateTo: _e } = n(), [F, xe] = T("DETECTED"), [Se, I] = T(!1), [L, R] = T(null), [z, B] = T(!1), [V, H] = T(null), Ce = ae(!1), U = d(), W = ee(), G = m(F), K = m("DETECTED"), we = m("TRACKED"), q = te(), Te = f(), J = g(), Ee = h(), De = ie(), Oe = p(), ke = re(), Y = w(() => (U.data ?? []).filter((e) => N.has(e.aggregator)), [U.data]), X = Y.some((e) => e.available), Ae = (e) => Y.some((t) => t.aggregator === e && t.available), Z = W.data?.items ?? [], je = G.data?.items ?? [], Me = w(() => {
70
+ let t = /* @__PURE__ */ new Map();
71
+ for (let e of K.data?.items ?? []) t.set(e.currency, (t.get(e.currency) ?? 0) + e.annualCost);
72
+ return [...t.entries()].map(([t, n]) => e(n, t)).join(" + ");
73
+ }, [K.data, e]), Q = (e) => k("banking.notice.synced", "{{added}} new transaction(s) from {{institution}}; {{recurring}} recurring charge(s) found.", {
74
74
  added: e.added,
75
75
  institution: e.connection.institutionName,
76
76
  recurring: e.recurringDetected
77
- }), Pe = async () => {
78
- L(null), z(!0);
77
+ }), Ne = async () => {
78
+ R(null), B(!0);
79
79
  try {
80
- let e = await b((await K.mutateAsync({ aggregator: "PLAID" })).linkToken, O);
81
- if (!e) return;
82
- L({
80
+ let e = await q.mutateAsync({ aggregator: "PLAID" }), t = await x(e.linkToken, k);
81
+ if (!t) return;
82
+ let n = await Te.mutateAsync({ input: {
83
+ aggregator: "PLAID",
84
+ publicToken: t.publicToken,
85
+ institutionId: t.institutionId,
86
+ institutionName: t.institutionName
87
+ } });
88
+ R({
83
89
  tone: "success",
84
- text: Z(await Ee.mutateAsync({ input: {
85
- aggregator: "PLAID",
86
- publicToken: e.publicToken,
87
- institutionId: e.institutionId,
88
- institutionName: e.institutionName
89
- } }))
90
+ text: Q(n)
90
91
  });
91
92
  } catch (e) {
92
- L({
93
+ R({
93
94
  tone: "error",
94
- text: N(e, O)
95
+ text: P(e, k)
95
96
  });
96
97
  } finally {
97
- z(!1);
98
+ B(!1);
98
99
  }
99
- }, Fe = async (e, t, n) => {
100
- L(null), z(!0);
100
+ }, Pe = async (e, t, n) => {
101
+ R(null), B(!0);
101
102
  try {
102
- let r = await K.mutateAsync({
103
+ let r = await q.mutateAsync({
103
104
  aggregator: e,
104
105
  ...n ? { connectionId: n.id } : {},
105
106
  ...t ? { customerIdentifier: t } : {}
106
107
  });
107
- if (!be(r.linkUrl)) throw Error(O("common.somethingWentWrong", "Something went wrong"));
108
- y({
108
+ if (!ye(r.linkUrl)) throw Error(k("common.somethingWentWrong", "Something went wrong"));
109
+ b({
109
110
  aggregator: e,
110
111
  linkToken: r.linkToken,
111
112
  connectionId: n?.id ?? null
112
113
  }), window.location.assign(r.linkUrl);
113
114
  } catch (e) {
114
- L({
115
+ R({
115
116
  tone: "error",
116
- text: N(e, O)
117
- }), z(!1);
117
+ text: P(e, k)
118
+ }), B(!1);
118
119
  }
119
- }, Ie = (e, t) => {
120
- let n = B?.connection ?? null;
121
- if (V(null), e === "PLAID") {
122
- n ? Q(n) : Pe();
123
- return;
124
- }
125
- Fe(e, t, n);
120
+ }, Fe = (e, t) => {
121
+ let n = V?.connection ?? null;
122
+ H(null), e === "PLAID" ? n ? Ie(n) : Ne() : Pe(e, t, n);
126
123
  };
127
- S(() => {
128
- if (we.current) return;
129
- we.current = !0;
130
- let e = v();
131
- if (e) {
132
- if (e.kind === "expired") {
133
- L({
134
- tone: "error",
135
- text: O("banking.redirect.expired", "That bank link could not be finished here. Start connecting the bank again.")
136
- });
137
- return;
138
- }
139
- if (e.kind === "declined") {
140
- L({
141
- tone: "error",
142
- text: O("banking.redirect.declined", "The bank or Account Aggregator did not grant access, so nothing was connected.")
143
- });
144
- return;
145
- }
146
- z(!0), Ee.mutateAsync({ input: {
147
- aggregator: e.aggregator,
148
- publicToken: e.publicToken,
149
- state: e.state
150
- } }).then((e) => L({
151
- tone: "success",
152
- text: Z(e)
153
- })).catch((e) => L({
154
- tone: "error",
155
- text: N(e, O)
156
- })).finally(() => z(!1));
157
- }
124
+ C(() => {
125
+ if (Ce.current) return;
126
+ Ce.current = !0;
127
+ let e = y();
128
+ e && (e.kind === "expired" ? R({
129
+ tone: "error",
130
+ text: k("banking.redirect.expired", "That bank link could not be finished here. Start connecting the bank again.")
131
+ }) : e.kind === "declined" ? R({
132
+ tone: "error",
133
+ text: k("banking.redirect.declined", "The bank or Account Aggregator did not grant access, so nothing was connected.")
134
+ }) : (B(!0), Te.mutateAsync({ input: {
135
+ aggregator: e.aggregator,
136
+ publicToken: e.publicToken,
137
+ state: e.state
138
+ } }).then((e) => R({
139
+ tone: "success",
140
+ text: Q(e)
141
+ })).catch((e) => R({
142
+ tone: "error",
143
+ text: P(e, k)
144
+ })).finally(() => B(!1))));
158
145
  }, []);
159
- let Q = async (e) => {
160
- L(null), z(!0);
146
+ let Ie = async (e) => {
147
+ R(null), B(!0);
161
148
  try {
162
- if (!await b((await K.mutateAsync({
149
+ let t = await q.mutateAsync({
163
150
  aggregator: "PLAID",
164
151
  connectionId: e.id
165
- })).linkToken, O)) return;
166
- L({
152
+ });
153
+ if (!await x(t.linkToken, k)) return;
154
+ R({
167
155
  tone: "success",
168
- text: Z(await q.mutateAsync({ id: e.id }))
156
+ text: Q(await J.mutateAsync({ id: e.id }))
169
157
  });
170
158
  } catch (e) {
171
- L({
159
+ R({
172
160
  tone: "error",
173
- text: N(e, O)
161
+ text: P(e, k)
174
162
  });
175
163
  } finally {
176
- z(!1);
164
+ B(!1);
177
165
  }
178
166
  }, Le = async (e) => {
179
- L(null);
167
+ R(null);
180
168
  try {
181
- L({
169
+ R({
182
170
  tone: "success",
183
- text: Z(await q.mutateAsync({ id: e.id }))
171
+ text: Q(await J.mutateAsync({ id: e.id }))
184
172
  });
185
173
  } catch (e) {
186
- L({
174
+ R({
187
175
  tone: "error",
188
- text: N(e, O)
176
+ text: P(e, k)
189
177
  });
190
178
  }
191
179
  }, Re = async (e) => {
192
- if (window.confirm(O("banking.disconnect.confirm", "Disconnect {{institution}}? Its accounts and transactions are deleted from Subscriber Bot. Subscriptions you already track stay.", { institution: e.institutionName }))) {
193
- L(null);
180
+ if (window.confirm(k("banking.disconnect.confirm", "Disconnect {{institution}}? Its accounts and transactions are deleted from Subscriber Bot. Subscriptions you already track stay.", { institution: e.institutionName }))) {
181
+ R(null);
194
182
  try {
195
- await De.mutateAsync({ id: e.id }), L({
183
+ await Ee.mutateAsync({ id: e.id }), R({
196
184
  tone: "success",
197
- text: O("banking.notice.disconnected", "{{institution}} was disconnected.", { institution: e.institutionName })
185
+ text: k("banking.notice.disconnected", "{{institution}} was disconnected.", { institution: e.institutionName })
198
186
  });
199
187
  } catch (e) {
200
- L({
188
+ R({
201
189
  tone: "error",
202
- text: N(e, O)
190
+ text: P(e, k)
203
191
  });
204
192
  }
205
193
  }
206
194
  }, $ = async (e, t) => {
207
- L(null);
195
+ R(null);
208
196
  try {
209
197
  let n = await {
210
- track: Oe,
211
- dismiss: ke,
212
- restore: Ae
198
+ track: De,
199
+ dismiss: Oe,
200
+ restore: ke
213
201
  }[e].mutateAsync({ id: t.id });
214
- e === "track" && L({
202
+ e === "track" && R({
215
203
  tone: "success",
216
- text: O("banking.notice.tracked", "{{name}} is now tracked as a subscription.", { name: n.displayName })
204
+ text: k("banking.notice.tracked", "{{name}} is now tracked as a subscription.", { name: n.displayName })
217
205
  });
218
206
  } catch (e) {
219
- L({
207
+ R({
220
208
  tone: "error",
221
- text: N(e, O)
209
+ text: P(e, k)
222
210
  });
223
211
  }
224
- }, ze = /* @__PURE__ */ D("div", {
212
+ }, ze = /* @__PURE__ */ O("div", {
225
213
  className: "flex flex-wrap gap-2",
226
214
  "data-tour": "subscriberbot-banking-connect",
227
- children: [/* @__PURE__ */ D("button", {
215
+ children: [/* @__PURE__ */ O("button", {
228
216
  type: "button",
229
- className: A,
230
- onClick: () => F(!0),
217
+ className: j,
218
+ onClick: () => I(!0),
231
219
  children: [
232
- /* @__PURE__ */ E(ce, {
220
+ /* @__PURE__ */ D(se, {
233
221
  className: "h-4 w-4",
234
222
  "aria-hidden": !0
235
223
  }),
236
224
  " ",
237
- O("banking.import.open", "Import a statement")
225
+ k("banking.import.open", "Import a statement")
238
226
  ]
239
- }), /* @__PURE__ */ D("button", {
227
+ }), /* @__PURE__ */ O("button", {
240
228
  type: "button",
241
- className: k,
242
- onClick: () => V({ connection: null }),
243
- disabled: !Y || R,
229
+ className: A,
230
+ onClick: () => H({ connection: null }),
231
+ disabled: !X || z,
244
232
  "data-testid": "connect-bank",
245
- title: Y ? void 0 : O("banking.plaid.unavailable", "Bank linking is not switched on yet. Import a statement instead."),
246
- children: [/* @__PURE__ */ E(T, {
233
+ title: X ? void 0 : k("banking.plaid.unavailable", "Bank linking is not switched on yet. Import a statement instead."),
234
+ children: [/* @__PURE__ */ D(E, {
247
235
  className: "h-4 w-4",
248
236
  "aria-hidden": !0
249
- }), R ? O("banking.plaid.linking", "Connecting…") : O("banking.plaid.connect", "Connect a bank")]
237
+ }), z ? k("banking.plaid.linking", "Connecting…") : k("banking.plaid.connect", "Connect a bank")]
250
238
  })]
251
239
  });
252
- return /* @__PURE__ */ D(ee, {
240
+ return /* @__PURE__ */ O(r, {
253
241
  dataTour: "subscriberbot-banking",
254
- title: O("banking.title", "Bank & card connections"),
255
- description: O("banking.description", "Find every subscription in your bank and card transactions."),
242
+ title: k("banking.title", "Bank & card connections"),
243
+ description: k("banking.description", "Find every subscription in your bank and card transactions."),
256
244
  actions: ze,
257
245
  children: [
258
- /* @__PURE__ */ E(he, {
246
+ /* @__PURE__ */ D(me, {
259
247
  className: "mb-6",
260
- children: O("banking.purpose", "Connect a bank or card (US through Plaid, UK and Europe through open banking, India through an Account Aggregator), 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.")
248
+ children: k("banking.purpose", "Connect a bank or card (US through Plaid, UK and Europe through open banking, India through an Account Aggregator), 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.")
261
249
  }),
262
- H.data && !Y && /* @__PURE__ */ D("p", {
250
+ U.data && !X && /* @__PURE__ */ O("p", {
263
251
  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",
264
252
  "data-testid": "plaid-unavailable",
265
- children: [/* @__PURE__ */ E(fe, {
253
+ children: [/* @__PURE__ */ D(de, {
266
254
  className: "mt-0.5 h-4 w-4 shrink-0",
267
255
  "aria-hidden": !0
268
- }), O("banking.plaid.unavailableLong", "Direct bank linking is being switched on. Until then, import a statement export: it finds the same recurring charges.")]
256
+ }), k("banking.plaid.unavailableLong", "Direct bank linking is being switched on. Until then, import a statement export: it finds the same recurring charges.")]
269
257
  }),
270
- I && /* @__PURE__ */ E("p", {
271
- role: I.tone === "error" ? "alert" : "status",
272
- className: r("mb-4 rounded-lg px-3 py-2 text-sm", I.tone === "error" ? "bg-status-error-bg-subtle text-status-error-text" : "bg-status-success-bg-subtle text-status-success-text"),
258
+ L && /* @__PURE__ */ D("p", {
259
+ role: L.tone === "error" ? "alert" : "status",
260
+ className: v("mb-4 rounded-lg px-3 py-2 text-sm", L.tone === "error" ? "bg-status-error-bg-subtle text-status-error-text" : "bg-status-success-bg-subtle text-status-success-text"),
273
261
  "data-testid": "banking-notice",
274
- children: I.text
262
+ children: L.text
275
263
  }),
276
- /* @__PURE__ */ D("div", {
264
+ /* @__PURE__ */ O("div", {
277
265
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
278
266
  "data-tour": "subscriberbot-banking-metrics",
279
267
  children: [
280
- /* @__PURE__ */ E(i, {
281
- icon: /* @__PURE__ */ E(le, { className: "h-5 w-5" }),
282
- value: U.isLoading ? "—" : X.length,
283
- label: O("banking.metrics.connections", "Connected accounts")
268
+ /* @__PURE__ */ D(i, {
269
+ icon: /* @__PURE__ */ D(ce, { className: "h-5 w-5" }),
270
+ value: W.isLoading ? "—" : Z.length,
271
+ label: k("banking.metrics.connections", "Connected accounts")
284
272
  }),
285
- /* @__PURE__ */ E(i, {
286
- icon: /* @__PURE__ */ E(de, { className: "h-5 w-5" }),
287
- value: G.isLoading ? "—" : G.data?.items.length ?? 0,
288
- label: O("banking.metrics.detected", "Charges to review")
273
+ /* @__PURE__ */ D(i, {
274
+ icon: /* @__PURE__ */ D(ue, { className: "h-5 w-5" }),
275
+ value: K.isLoading ? "—" : K.data?.items.length ?? 0,
276
+ label: k("banking.metrics.detected", "Charges to review")
289
277
  }),
290
- /* @__PURE__ */ E(i, {
291
- icon: /* @__PURE__ */ E(se, { className: "h-5 w-5" }),
292
- value: G.isLoading ? "—" : Ne || s(0, "USD"),
293
- label: O("banking.metrics.yearly", "Yearly cost to review")
278
+ /* @__PURE__ */ D(i, {
279
+ icon: /* @__PURE__ */ D(oe, { className: "h-5 w-5" }),
280
+ value: K.isLoading ? "—" : Me || e(0, "USD"),
281
+ label: k("banking.metrics.yearly", "Yearly cost to review")
294
282
  }),
295
- /* @__PURE__ */ E(i, {
296
- icon: /* @__PURE__ */ E(fe, { className: "h-5 w-5" }),
297
- value: Te.isLoading ? "—" : Te.data?.items.length ?? 0,
298
- label: O("banking.metrics.tracked", "Tracked from your bank")
283
+ /* @__PURE__ */ D(i, {
284
+ icon: /* @__PURE__ */ D(de, { className: "h-5 w-5" }),
285
+ value: we.isLoading ? "—" : we.data?.items.length ?? 0,
286
+ label: k("banking.metrics.tracked", "Tracked from your bank")
299
287
  })
300
288
  ]
301
289
  }),
302
- /* @__PURE__ */ D(u, {
290
+ /* @__PURE__ */ O(u, {
303
291
  dataTour: "subscriberbot-banking-charges",
304
- title: O("banking.charges.title", "Recurring charges found"),
305
- description: O("banking.charges.description", "Charges from the same merchant at a steady amount and rhythm."),
306
- children: [/* @__PURE__ */ E("div", {
292
+ title: k("banking.charges.title", "Recurring charges found"),
293
+ description: k("banking.charges.description", "Charges from the same merchant at a steady amount and rhythm."),
294
+ children: [/* @__PURE__ */ D("div", {
307
295
  role: "tablist",
308
- "aria-label": O("banking.charges.filter", "Charge status"),
296
+ "aria-label": k("banking.charges.filter", "Charge status"),
309
297
  className: "mb-3 flex gap-1.5",
310
- children: ge.map((e) => /* @__PURE__ */ E("button", {
298
+ children: he.map((e) => /* @__PURE__ */ D("button", {
311
299
  type: "button",
312
300
  role: "tab",
313
- "aria-selected": P === e,
314
- onClick: () => Se(e),
315
- className: r("rounded-lg px-3 py-1.5 text-xs font-medium", P === e ? "bg-action-primary-bg text-action-primary-text" : "border border-border-subtle text-text-primary hover:bg-bg-sunken"),
316
- children: O(_e[e].key, _e[e].fallback)
301
+ "aria-selected": F === e,
302
+ onClick: () => xe(e),
303
+ className: v("rounded-lg px-3 py-1.5 text-xs font-medium", F === e ? "bg-action-primary-bg text-action-primary-text" : "border border-border-subtle text-text-primary hover:bg-bg-sunken"),
304
+ children: k(ge[e].key, ge[e].fallback)
317
305
  }, e))
318
- }), W.isLoading ? /* @__PURE__ */ E(l, { label: O("banking.charges.loading", "Loading recurring charges…") }) : W.isError ? /* @__PURE__ */ E(c, {
319
- message: N(W.error, O),
320
- onRetry: () => void W.refetch()
321
- }) : Me.length === 0 ? /* @__PURE__ */ E(o, {
306
+ }), G.isLoading ? /* @__PURE__ */ D(l, { label: k("banking.charges.loading", "Loading recurring charges…") }) : G.isError ? /* @__PURE__ */ D(c, {
307
+ message: P(G.error, k),
308
+ onRetry: () => void G.refetch()
309
+ }) : je.length === 0 ? /* @__PURE__ */ D(o, {
322
310
  illustration: "empty-data",
323
- title: O("banking.charges.empty.title", "Nothing here yet"),
324
- description: O("banking.charges.empty.description", "Import a statement with at least two months of transactions, or connect a bank, and repeating charges show up here.")
325
- }) : /* @__PURE__ */ E("ul", {
311
+ title: k("banking.charges.empty.title", "Nothing here yet"),
312
+ description: k("banking.charges.empty.description", "Import a statement with at least two months of transactions, or connect a bank, and repeating charges show up here.")
313
+ }) : /* @__PURE__ */ D("ul", {
326
314
  className: "grid grid-cols-1 gap-3 lg:grid-cols-2",
327
315
  "data-testid": "recurring-charge-list",
328
- children: Me.map((e) => /* @__PURE__ */ D("li", {
316
+ children: je.map((t) => /* @__PURE__ */ O("li", {
329
317
  className: "rounded-xl border border-border-subtle bg-bg-surface p-4",
330
318
  "data-testid": "recurring-charge",
331
319
  children: [
332
- /* @__PURE__ */ D("div", {
320
+ /* @__PURE__ */ O("div", {
333
321
  className: "flex items-start justify-between gap-3",
334
- children: [/* @__PURE__ */ D("div", {
322
+ children: [/* @__PURE__ */ O("div", {
335
323
  className: "min-w-0",
336
- children: [/* @__PURE__ */ E("p", {
324
+ children: [/* @__PURE__ */ D("p", {
337
325
  className: "truncate text-sm font-semibold text-text-primary",
338
- children: e.displayName
339
- }), /* @__PURE__ */ E("p", {
326
+ children: t.displayName
327
+ }), /* @__PURE__ */ D("p", {
340
328
  className: "mt-0.5 text-xs text-text-secondary",
341
- children: O("banking.charges.meta", "{{count}} charges since {{first}} · {{confidence}}% sure", {
342
- count: e.occurrences,
343
- first: d(e.firstChargedOn),
344
- confidence: e.confidence
329
+ children: k("banking.charges.meta", "{{count}} charges since {{first}} · {{confidence}}% sure", {
330
+ count: t.occurrences,
331
+ first: s(t.firstChargedOn),
332
+ confidence: t.confidence
345
333
  })
346
334
  })]
347
- }), /* @__PURE__ */ D("span", {
335
+ }), /* @__PURE__ */ O("span", {
348
336
  className: "shrink-0 text-sm font-semibold text-text-primary",
349
- children: [s(e.lastAmount, e.currency), re(e.interval)]
337
+ children: [e(t.lastAmount, t.currency), ne(t.interval)]
350
338
  })]
351
339
  }),
352
- /* @__PURE__ */ D("p", {
340
+ /* @__PURE__ */ O("p", {
353
341
  className: "mt-2 text-xs text-text-secondary",
354
342
  children: [
355
- O("banking.charges.dates", "Last charged {{last}}", { last: d(e.lastChargedOn) }),
356
- e.nextExpectedOn && ` · ${O("banking.charges.next", "next expected {{next}}", { next: d(e.nextExpectedOn) })}`,
357
- ` · ${O("banking.charges.yearly", "{{amount}} a year", { amount: s(e.annualCost, e.currency) })}`
343
+ k("banking.charges.dates", "Last charged {{last}}", { last: s(t.lastChargedOn) }),
344
+ t.nextExpectedOn && ` · ${k("banking.charges.next", "next expected {{next}}", { next: s(t.nextExpectedOn) })}`,
345
+ ` · ${k("banking.charges.yearly", "{{amount}} a year", { amount: e(t.annualCost, t.currency) })}`
358
346
  ]
359
347
  }),
360
- /* @__PURE__ */ D("div", {
348
+ /* @__PURE__ */ O("div", {
361
349
  className: "mt-3 flex flex-wrap gap-2",
362
350
  children: [
363
- e.status === "DETECTED" && /* @__PURE__ */ D(me, { children: [/* @__PURE__ */ E("button", {
364
- type: "button",
365
- className: k,
366
- onClick: () => void $("track", e),
367
- disabled: Oe.isPending,
368
- children: O("banking.charges.track", "Track as subscription")
369
- }), /* @__PURE__ */ E("button", {
351
+ t.status === "DETECTED" && /* @__PURE__ */ O(pe, { children: [/* @__PURE__ */ D("button", {
370
352
  type: "button",
371
353
  className: A,
372
- onClick: () => void $("dismiss", e),
373
- disabled: ke.isPending,
374
- children: O("banking.charges.dismiss", "Not a subscription")
354
+ onClick: () => void $("track", t),
355
+ disabled: De.isPending,
356
+ children: k("banking.charges.track", "Track as subscription")
357
+ }), /* @__PURE__ */ D("button", {
358
+ type: "button",
359
+ className: j,
360
+ onClick: () => void $("dismiss", t),
361
+ disabled: Oe.isPending,
362
+ children: k("banking.charges.dismiss", "Not a subscription")
375
363
  })] }),
376
- e.status === "TRACKED" && e.relationshipId && /* @__PURE__ */ E("button", {
364
+ t.status === "TRACKED" && t.relationshipId && /* @__PURE__ */ D("button", {
377
365
  type: "button",
378
- className: A,
379
- onClick: () => ve(`/relationships/${e.relationshipId}`),
380
- children: O("banking.charges.view", "View subscription")
366
+ className: j,
367
+ onClick: () => _e(`/relationships/${t.relationshipId}`),
368
+ children: k("banking.charges.view", "View subscription")
381
369
  }),
382
- e.status === "DISMISSED" && /* @__PURE__ */ E("button", {
370
+ t.status === "DISMISSED" && /* @__PURE__ */ D("button", {
383
371
  type: "button",
384
- className: A,
385
- onClick: () => void $("restore", e),
386
- disabled: Ae.isPending,
387
- children: O("banking.charges.restore", "Review again")
372
+ className: j,
373
+ onClick: () => void $("restore", t),
374
+ disabled: ke.isPending,
375
+ children: k("banking.charges.restore", "Review again")
388
376
  })
389
377
  ]
390
378
  })
391
379
  ]
392
- }, e.id))
380
+ }, t.id))
393
381
  })]
394
382
  }),
395
- /* @__PURE__ */ E(u, {
383
+ /* @__PURE__ */ D(u, {
396
384
  dataTour: "subscriberbot-banking-connections",
397
- title: O("banking.connections.title", "Your connections"),
398
- description: O("banking.connections.description", "Disconnecting deletes the accounts and transactions from Subscriber Bot."),
399
- children: U.isLoading ? /* @__PURE__ */ E(l, { label: O("banking.connections.loading", "Loading connections…") }) : U.isError ? /* @__PURE__ */ E(c, {
400
- message: N(U.error, O),
401
- onRetry: () => void U.refetch()
402
- }) : X.length === 0 ? /* @__PURE__ */ E(o, {
385
+ title: k("banking.connections.title", "Your connections"),
386
+ description: k("banking.connections.description", "Disconnecting deletes the accounts and transactions from Subscriber Bot."),
387
+ children: W.isLoading ? /* @__PURE__ */ D(l, { label: k("banking.connections.loading", "Loading connections…") }) : W.isError ? /* @__PURE__ */ D(c, {
388
+ message: P(W.error, k),
389
+ onRetry: () => void W.refetch()
390
+ }) : Z.length === 0 ? /* @__PURE__ */ D(o, {
403
391
  illustration: "empty-data",
404
- title: O("banking.connections.empty.title", "No bank or card connected"),
405
- description: O("banking.connections.empty.description", "Download a CSV of your transactions from your bank or card website and import it, or connect a bank."),
406
- action: /* @__PURE__ */ D("button", {
392
+ title: k("banking.connections.empty.title", "No bank or card connected"),
393
+ description: k("banking.connections.empty.description", "Download a CSV of your transactions from your bank or card website and import it, or connect a bank."),
394
+ action: /* @__PURE__ */ O("button", {
407
395
  type: "button",
408
- className: k,
409
- onClick: () => F(!0),
396
+ className: A,
397
+ onClick: () => I(!0),
410
398
  children: [
411
- /* @__PURE__ */ E(ce, {
399
+ /* @__PURE__ */ D(se, {
412
400
  className: "h-4 w-4",
413
401
  "aria-hidden": !0
414
402
  }),
415
403
  " ",
416
- O("banking.import.open", "Import a statement")
404
+ k("banking.import.open", "Import a statement")
417
405
  ]
418
406
  })
419
- }) : /* @__PURE__ */ E("ul", {
407
+ }) : /* @__PURE__ */ D("ul", {
420
408
  className: "space-y-3",
421
409
  "data-testid": "bank-connection-list",
422
- children: X.map((e) => /* @__PURE__ */ D("li", {
410
+ children: Z.map((e) => /* @__PURE__ */ O("li", {
423
411
  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",
424
412
  "data-testid": "bank-connection",
425
- children: [/* @__PURE__ */ D("div", {
413
+ children: [/* @__PURE__ */ O("div", {
426
414
  className: "min-w-0",
427
415
  children: [
428
- /* @__PURE__ */ D("div", {
416
+ /* @__PURE__ */ O("div", {
429
417
  className: "flex items-center gap-2",
430
- children: [/* @__PURE__ */ E("p", {
418
+ children: [/* @__PURE__ */ D("p", {
431
419
  className: "truncate text-sm font-semibold text-text-primary",
432
420
  children: e.institutionName
433
- }), /* @__PURE__ */ E(a, { status: e.status })]
421
+ }), /* @__PURE__ */ D(a, { status: e.status })]
434
422
  }),
435
- /* @__PURE__ */ D("p", {
423
+ /* @__PURE__ */ O("p", {
436
424
  className: "mt-0.5 text-xs text-text-secondary",
437
425
  children: [
438
- O(ye[e.aggregator].key, ye[e.aggregator].fallback),
426
+ k(ve[e.aggregator].key, ve[e.aggregator].fallback),
439
427
  " · ",
440
- e.accounts.map((e) => e.mask ? `${e.name} ••${e.mask}` : e.name).join(", ") || O("banking.connections.noAccounts", "no accounts yet"),
428
+ e.accounts.map((e) => e.mask ? `${e.name} ••${e.mask}` : e.name).join(", ") || k("banking.connections.noAccounts", "no accounts yet"),
441
429
  " · ",
442
- O("banking.connections.count", "{{count}} transactions", { count: e.transactionCount }),
443
- e.lastSyncedAt && ` · ${O("banking.connections.synced", "updated {{date}}", { date: d(e.lastSyncedAt) })}`
430
+ k("banking.connections.count", "{{count}} transactions", { count: e.transactionCount }),
431
+ e.lastSyncedAt && ` · ${k("banking.connections.synced", "updated {{date}}", { date: s(e.lastSyncedAt) })}`
444
432
  ]
445
433
  }),
446
- e.consentExpiresAt && e.status !== "REVOKED" && /* @__PURE__ */ E("p", {
434
+ e.consentExpiresAt && e.status !== "REVOKED" && /* @__PURE__ */ D("p", {
447
435
  className: "mt-0.5 text-xs text-text-secondary",
448
436
  "data-testid": "bank-connection-consent",
449
- children: O("banking.connections.consentUntil", "Consent valid until {{date}}", { date: d(e.consentExpiresAt) })
437
+ children: k("banking.connections.consentUntil", "Consent valid until {{date}}", { date: s(e.consentExpiresAt) })
450
438
  }),
451
- e.lastSyncError && /* @__PURE__ */ E("p", {
439
+ e.lastSyncError && /* @__PURE__ */ D("p", {
452
440
  className: "mt-1 text-xs text-status-error-text",
453
441
  children: e.lastSyncError
454
442
  }),
455
- e.status === "NEEDS_REAUTH" && /* @__PURE__ */ E("p", {
443
+ e.status === "NEEDS_REAUTH" && /* @__PURE__ */ D("p", {
456
444
  className: "mt-1 text-xs text-status-warning-text",
457
445
  "data-testid": "bank-connection-hint",
458
- children: O("banking.connections.needsReauth", "The bank needs you to sign in again. Reconnect to keep syncing; your history is kept.")
446
+ children: k("banking.connections.needsReauth", "The bank needs you to sign in again. Reconnect to keep syncing; your history is kept.")
459
447
  }),
460
- e.status === "REVOKED" && /* @__PURE__ */ E("p", {
448
+ e.status === "REVOKED" && /* @__PURE__ */ D("p", {
461
449
  className: "mt-1 text-xs text-text-secondary",
462
450
  "data-testid": "bank-connection-hint",
463
- children: O("banking.connections.revoked", "Access was revoked at the bank. Disconnect this connection and link the bank again to keep tracking it.")
451
+ children: k("banking.connections.revoked", "Access was revoked at the bank. Disconnect this connection and link the bank again to keep tracking it.")
464
452
  })
465
453
  ]
466
- }), /* @__PURE__ */ D("div", {
454
+ }), /* @__PURE__ */ O("div", {
467
455
  className: "flex shrink-0 gap-2",
468
456
  children: [
469
- M.has(e.aggregator) && e.status === "NEEDS_REAUTH" && /* @__PURE__ */ D("button", {
457
+ N.has(e.aggregator) && e.status === "NEEDS_REAUTH" && /* @__PURE__ */ O("button", {
470
458
  type: "button",
471
- className: j,
472
- onClick: () => e.aggregator === "PLAID" ? void Q(e) : V({ connection: e }),
473
- disabled: R || !je(e.aggregator),
459
+ className: M,
460
+ onClick: () => e.aggregator === "PLAID" ? void Ie(e) : H({ connection: e }),
461
+ disabled: z || !Ae(e.aggregator),
474
462
  children: [
475
- /* @__PURE__ */ E(T, {
463
+ /* @__PURE__ */ D(E, {
476
464
  className: "h-3.5 w-3.5",
477
465
  "aria-hidden": !0
478
466
  }),
479
467
  " ",
480
- O("banking.connections.reconnect", "Reconnect")
468
+ k("banking.connections.reconnect", "Reconnect")
481
469
  ]
482
470
  }),
483
- M.has(e.aggregator) && e.status !== "REVOKED" && e.status !== "NEEDS_REAUTH" && /* @__PURE__ */ D("button", {
471
+ N.has(e.aggregator) && e.status !== "REVOKED" && e.status !== "NEEDS_REAUTH" && /* @__PURE__ */ O("button", {
484
472
  type: "button",
485
- className: j,
473
+ className: M,
486
474
  onClick: () => void Le(e),
487
- disabled: q.isPending || !je(e.aggregator),
475
+ disabled: J.isPending || !Ae(e.aggregator),
488
476
  children: [
489
- /* @__PURE__ */ E(ue, {
477
+ /* @__PURE__ */ D(le, {
490
478
  className: "h-3.5 w-3.5",
491
479
  "aria-hidden": !0
492
480
  }),
493
481
  " ",
494
- O("banking.connections.sync", "Sync")
482
+ k("banking.connections.sync", "Sync")
495
483
  ]
496
484
  }),
497
- /* @__PURE__ */ D("button", {
485
+ /* @__PURE__ */ O("button", {
498
486
  type: "button",
499
- className: j,
487
+ className: M,
500
488
  onClick: () => void Re(e),
501
- disabled: De.isPending,
489
+ disabled: Ee.isPending,
502
490
  children: [
503
- /* @__PURE__ */ E(pe, {
491
+ /* @__PURE__ */ D(fe, {
504
492
  className: "h-3.5 w-3.5",
505
493
  "aria-hidden": !0
506
494
  }),
507
495
  " ",
508
- O("banking.connections.disconnect", "Disconnect")
496
+ k("banking.connections.disconnect", "Disconnect")
509
497
  ]
510
498
  })
511
499
  ]
@@ -513,155 +501,146 @@ function P() {
513
501
  }, e.id))
514
502
  })
515
503
  }),
516
- B && /* @__PURE__ */ E(x, {
517
- aggregators: J,
518
- connection: B.connection,
519
- busy: R,
520
- onClose: () => V(null),
521
- onConnect: Ie
504
+ V && /* @__PURE__ */ D(S, {
505
+ aggregators: Y,
506
+ connection: V.connection,
507
+ busy: z,
508
+ onClose: () => H(null),
509
+ onConnect: Fe
522
510
  }),
523
- Ce && /* @__PURE__ */ E(xe, {
524
- connections: X.filter((e) => e.aggregator === "STATEMENT_IMPORT"),
525
- onClose: () => F(!1),
511
+ Se && /* @__PURE__ */ D(be, {
512
+ connections: Z.filter((e) => e.aggregator === "STATEMENT_IMPORT"),
513
+ onClose: () => I(!1),
526
514
  onImported: (e) => {
527
- F(!1), Se("DETECTED"), L({
515
+ I(!1), xe("DETECTED"), R({
528
516
  tone: "success",
529
- text: Z(e)
517
+ text: Q(e)
530
518
  });
531
519
  }
532
520
  })
533
521
  ]
534
522
  });
535
523
  }
536
- function xe({ connections: e, onClose: n, onImported: ee }) {
537
- let i = t(), a = re(), [o, c] = w(""), [l, u] = w(""), [f, te] = w(""), [p, ne] = w(""), [m, h] = w("USD"), [g, ie] = w("OUTFLOW_NEGATIVE"), [_, ae] = w("MDY"), [v, y] = w(""), [b, x, S, C] = d(), oe = async (e) => {
538
- if (x(null), y(""), e) {
539
- if (e.size > ve) {
540
- x(i("banking.import.tooLarge", "That file is larger than 2 MB. Export a shorter date range."), "statement-file");
541
- return;
542
- }
543
- y(await e.text());
544
- }
545
- }, se = async (e) => {
546
- if (e.preventDefault(), x(null), !v.trim()) {
547
- x(i("banking.import.required", "Choose a CSV file or paste the statement."), ["statement-csv", "statement-file"]);
548
- return;
549
- }
550
- try {
551
- ee(await a.mutateAsync({ input: {
524
+ function be({ connections: t, onClose: n, onImported: r }) {
525
+ let i = _(), a = ne(), [o, c] = T(""), [l, u] = T(""), [d, ee] = T(""), [f, te] = T(""), [p, m] = T("USD"), [h, re] = T("OUTFLOW_NEGATIVE"), [g, ie] = T("MDY"), [y, b] = T(""), [x, S, C, w] = e(), ae = async (e) => {
526
+ S(null), b(""), e && (e.size > _e ? S(i("banking.import.tooLarge", "That file is larger than 2 MB. Export a shorter date range."), "statement-file") : b(await e.text()));
527
+ }, oe = async (e) => {
528
+ if (e.preventDefault(), S(null), !y.trim()) S(i("banking.import.required", "Choose a CSV file or paste the statement."), ["statement-csv", "statement-file"]);
529
+ else try {
530
+ r(await a.mutateAsync({ input: {
552
531
  connectionId: o || null,
553
532
  institutionName: o ? null : l || null,
554
- accountName: f || null,
555
- accountMask: p || null,
556
- currency: m || "USD",
557
- csv: v,
558
- amountConvention: g,
559
- dateFormat: _
533
+ accountName: d || null,
534
+ accountMask: f || null,
535
+ currency: p || "USD",
536
+ csv: y,
537
+ amountConvention: h,
538
+ dateFormat: g
560
539
  } }));
561
540
  } catch (e) {
562
- x(N(e, i));
541
+ S(P(e, i));
563
542
  }
564
543
  };
565
- return /* @__PURE__ */ E(s, {
544
+ return /* @__PURE__ */ D(s, {
566
545
  title: i("banking.import.title", "Import a bank or card statement"),
567
546
  description: i("banking.import.description", "Download your transactions as CSV from your bank or card website (two months or more works best)."),
568
547
  onClose: n,
569
548
  maxWidthClassName: "max-w-xl",
570
- children: /* @__PURE__ */ D("form", {
571
- onSubmit: (e) => void se(e),
549
+ children: /* @__PURE__ */ O("form", {
550
+ onSubmit: (e) => void oe(e),
572
551
  className: "space-y-3",
573
552
  "data-testid": "import-statement-form",
574
553
  children: [
575
- e.length > 0 && /* @__PURE__ */ D("label", {
554
+ t.length > 0 && /* @__PURE__ */ O("label", {
576
555
  className: "block text-sm text-text-primary",
577
- children: [i("banking.import.target", "Add to"), /* @__PURE__ */ D("select", {
578
- className: r(O, "mt-1"),
556
+ children: [i("banking.import.target", "Add to"), /* @__PURE__ */ O("select", {
557
+ className: v(k, "mt-1"),
579
558
  value: o,
580
559
  onChange: (e) => c(e.target.value),
581
- children: [/* @__PURE__ */ E("option", {
560
+ children: [/* @__PURE__ */ D("option", {
582
561
  value: "",
583
562
  children: i("banking.import.newConnection", "A new connection")
584
- }), e.map((e) => /* @__PURE__ */ E("option", {
563
+ }), t.map((e) => /* @__PURE__ */ D("option", {
585
564
  value: e.id,
586
565
  children: e.institutionName
587
566
  }, e.id))]
588
567
  })]
589
568
  }),
590
- !o && /* @__PURE__ */ D("label", {
569
+ !o && /* @__PURE__ */ O("label", {
591
570
  className: "block text-sm text-text-primary",
592
- children: [i("banking.import.institution", "Bank or card issuer"), /* @__PURE__ */ E("input", {
593
- className: r(O, "mt-1"),
571
+ children: [i("banking.import.institution", "Bank or card issuer"), /* @__PURE__ */ D("input", {
572
+ className: v(k, "mt-1"),
594
573
  value: l,
595
574
  onChange: (e) => u(e.target.value),
596
575
  placeholder: i("banking.import.institutionPlaceholder", "e.g. Chase"),
597
576
  maxLength: 255
598
577
  })]
599
578
  }),
600
- /* @__PURE__ */ D("div", {
579
+ /* @__PURE__ */ O("div", {
601
580
  className: "grid grid-cols-1 gap-3 sm:grid-cols-3",
602
- children: [/* @__PURE__ */ D("label", {
581
+ children: [/* @__PURE__ */ O("label", {
603
582
  className: "block text-sm text-text-primary sm:col-span-2",
604
- children: [i("banking.import.account", "Account name"), /* @__PURE__ */ E("input", {
605
- className: r(O, "mt-1"),
606
- value: f,
607
- onChange: (e) => te(e.target.value),
583
+ children: [i("banking.import.account", "Account name"), /* @__PURE__ */ D("input", {
584
+ className: v(k, "mt-1"),
585
+ value: d,
586
+ onChange: (e) => ee(e.target.value),
608
587
  placeholder: i("banking.import.accountPlaceholder", "e.g. Sapphire card"),
609
588
  maxLength: 255
610
589
  })]
611
- }), /* @__PURE__ */ D("label", {
590
+ }), /* @__PURE__ */ O("label", {
612
591
  className: "block text-sm text-text-primary",
613
- children: [i("banking.import.mask", "Last 4 digits"), /* @__PURE__ */ E("input", {
614
- className: r(O, "mt-1"),
615
- value: p,
616
- onChange: (e) => ne(e.target.value.replace(/\D/g, "").slice(-4)),
592
+ children: [i("banking.import.mask", "Last 4 digits"), /* @__PURE__ */ D("input", {
593
+ className: v(k, "mt-1"),
594
+ value: f,
595
+ onChange: (e) => te(e.target.value.replace(/\D/g, "").slice(-4)),
617
596
  inputMode: "numeric",
618
597
  maxLength: 4
619
598
  })]
620
599
  })]
621
600
  }),
622
- /* @__PURE__ */ D("div", {
601
+ /* @__PURE__ */ O("div", {
623
602
  className: "grid grid-cols-1 gap-3 sm:grid-cols-3",
624
603
  children: [
625
- /* @__PURE__ */ D("label", {
604
+ /* @__PURE__ */ O("label", {
626
605
  className: "block text-sm text-text-primary",
627
- children: [i("banking.import.currency", "Currency"), /* @__PURE__ */ E("input", {
628
- className: r(O, "mt-1 uppercase"),
629
- value: m,
630
- onChange: (e) => h(e.target.value.toUpperCase().slice(0, 3)),
606
+ children: [i("banking.import.currency", "Currency"), /* @__PURE__ */ D("input", {
607
+ className: v(k, "mt-1 uppercase"),
608
+ value: p,
609
+ onChange: (e) => m(e.target.value.toUpperCase().slice(0, 3)),
631
610
  maxLength: 3
632
611
  })]
633
612
  }),
634
- /* @__PURE__ */ D("label", {
613
+ /* @__PURE__ */ O("label", {
635
614
  className: "block text-sm text-text-primary",
636
- children: [i("banking.import.convention", "Money out is"), /* @__PURE__ */ D("select", {
637
- className: r(O, "mt-1"),
638
- value: g,
639
- onChange: (e) => ie(e.target.value),
640
- children: [/* @__PURE__ */ E("option", {
615
+ children: [i("banking.import.convention", "Money out is"), /* @__PURE__ */ O("select", {
616
+ className: v(k, "mt-1"),
617
+ value: h,
618
+ onChange: (e) => re(e.target.value),
619
+ children: [/* @__PURE__ */ D("option", {
641
620
  value: "OUTFLOW_NEGATIVE",
642
621
  children: i("banking.import.negative", "Negative (bank)")
643
- }), /* @__PURE__ */ E("option", {
622
+ }), /* @__PURE__ */ D("option", {
644
623
  value: "OUTFLOW_POSITIVE",
645
624
  children: i("banking.import.positive", "Positive (card)")
646
625
  })]
647
626
  })]
648
627
  }),
649
- /* @__PURE__ */ D("label", {
628
+ /* @__PURE__ */ O("label", {
650
629
  className: "block text-sm text-text-primary",
651
- children: [i("banking.import.dateFormat", "Date format"), /* @__PURE__ */ D("select", {
652
- className: r(O, "mt-1"),
653
- value: _,
654
- onChange: (e) => ae(e.target.value),
630
+ children: [i("banking.import.dateFormat", "Date format"), /* @__PURE__ */ O("select", {
631
+ className: v(k, "mt-1"),
632
+ value: g,
633
+ onChange: (e) => ie(e.target.value),
655
634
  children: [
656
- /* @__PURE__ */ E("option", {
635
+ /* @__PURE__ */ D("option", {
657
636
  value: "MDY",
658
637
  children: "MM/DD/YYYY"
659
638
  }),
660
- /* @__PURE__ */ E("option", {
639
+ /* @__PURE__ */ D("option", {
661
640
  value: "DMY",
662
641
  children: "DD/MM/YYYY"
663
642
  }),
664
- /* @__PURE__ */ E("option", {
643
+ /* @__PURE__ */ D("option", {
665
644
  value: "YMD",
666
645
  children: "YYYY-MM-DD"
667
646
  })
@@ -670,47 +649,47 @@ function xe({ connections: e, onClose: n, onImported: ee }) {
670
649
  })
671
650
  ]
672
651
  }),
673
- /* @__PURE__ */ D("label", {
652
+ /* @__PURE__ */ O("label", {
674
653
  className: "block text-sm text-text-primary",
675
- children: [i("banking.import.file", "CSV file"), /* @__PURE__ */ E("input", {
654
+ children: [i("banking.import.file", "CSV file"), /* @__PURE__ */ D("input", {
676
655
  type: "file",
677
656
  accept: ".csv,text/csv,text/plain",
678
- className: r(O, "mt-1"),
679
- onChange: (e) => void oe(e.target.files?.[0]),
657
+ className: v(k, "mt-1"),
658
+ onChange: (e) => void ae(e.target.files?.[0]),
680
659
  id: "statement-file",
681
- ...S("statement-file"),
660
+ ...C("statement-file"),
682
661
  "data-testid": "import-statement-file"
683
662
  })]
684
663
  }),
685
- /* @__PURE__ */ D("label", {
664
+ /* @__PURE__ */ O("label", {
686
665
  className: "block text-sm text-text-primary",
687
- children: [i("banking.import.paste", "Or paste the statement"), /* @__PURE__ */ E("textarea", {
688
- className: r(O, "mt-1 h-32 font-mono text-xs"),
689
- value: v,
690
- onChange: (e) => y(e.target.value),
666
+ children: [i("banking.import.paste", "Or paste the statement"), /* @__PURE__ */ D("textarea", {
667
+ className: v(k, "mt-1 h-32 font-mono text-xs"),
668
+ value: y,
669
+ onChange: (e) => b(e.target.value),
691
670
  placeholder: "Date,Description,Amount\n10/05/2026,NETFLIX.COM,-15.49",
692
671
  id: "statement-csv",
693
- ...S("statement-csv"),
672
+ ...C("statement-csv"),
694
673
  "data-testid": "import-statement-csv"
695
674
  })]
696
675
  }),
697
- b && /* @__PURE__ */ E("p", {
698
- id: C,
676
+ x && /* @__PURE__ */ D("p", {
677
+ id: w,
699
678
  tabIndex: -1,
700
679
  role: "alert",
701
680
  className: "text-sm text-status-error-text",
702
- children: b
681
+ children: x
703
682
  }),
704
- /* @__PURE__ */ D("div", {
683
+ /* @__PURE__ */ O("div", {
705
684
  className: "flex justify-end gap-2 pt-1",
706
- children: [/* @__PURE__ */ E("button", {
685
+ children: [/* @__PURE__ */ D("button", {
707
686
  type: "button",
708
- className: A,
687
+ className: j,
709
688
  onClick: n,
710
689
  children: i("common.cancel", "Cancel")
711
- }), /* @__PURE__ */ E("button", {
690
+ }), /* @__PURE__ */ D("button", {
712
691
  type: "submit",
713
- className: k,
692
+ className: A,
714
693
  disabled: a.isPending,
715
694
  children: a.isPending ? i("banking.import.submitting", "Importing…") : i("banking.import.submit", "Import and find subscriptions")
716
695
  })]
@@ -719,7 +698,6 @@ function xe({ connections: e, onClose: n, onImported: ee }) {
719
698
  })
720
699
  });
721
700
  }
722
- //#endregion
723
- export { P as BankConnectionsPage };
701
+ export { F as BankConnectionsPage };
724
702
 
725
703
  //# sourceMappingURL=BankConnectionsPage.js.map