@burdenoff/microfe-subscriberbot 2026.1103.1 → 2026.1105.1

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