@mx-cartographer/experiences 9.0.3 → 9.0.4-alpha.mm0

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 (93) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/{Account-BaJmiJAG.mjs → Account-DR7Plrqy.mjs} +10 -10
  3. package/dist/AccountDetailsDrawer-C8oJP3J4.mjs +921 -0
  4. package/dist/AccountDetailsHeader-ByGNPZpO.mjs +228 -0
  5. package/dist/{AccountUtils-T5_Odvos.mjs → AccountUtils-B8ZzWI-d.mjs} +3 -3
  6. package/dist/{Analytics-CzGzz_sE.mjs → Analytics-WeZYytR0.mjs} +3 -0
  7. package/dist/BeatMaterialIcon-1KOfRZrA.mjs +26 -0
  8. package/dist/{CategorySelectorDrawer-8soGrhB8.mjs → CategorySelectorDrawer-BArJC27L.mjs} +1 -1
  9. package/dist/Connect-BH0Pt6zc.mjs +42 -0
  10. package/dist/{ConnectCard-CCep7Zqe.mjs → ConnectCard-Dwfgv24k.mjs} +1 -1
  11. package/dist/{ConnectDrawer-Cnjr3Ddg.mjs → ConnectDrawer-DytyIhaF.mjs} +8 -9
  12. package/dist/{ConnectionsDrawer-CtfPXk0M.mjs → ConnectionsDrawer-BHJPKXYF.mjs} +8 -9
  13. package/dist/{CurrencyInput-adTIRtL3.mjs → CurrencyInput-DaGEQaLW.mjs} +1 -1
  14. package/dist/DateUtil-CzBmbjmA.mjs +74 -0
  15. package/dist/{DebtUtils-DD3186U-.mjs → DebtUtils-i4pI2Uoe.mjs} +6 -6
  16. package/dist/{EmbeddedCard-DPwJjqMH.mjs → EmbeddedCard-CQpbZrmP.mjs} +4 -4
  17. package/dist/{Error-Dogaw2jO.mjs → Error-Dtw6yxkf.mjs} +1 -1
  18. package/dist/{ExportCsvAction-Bw02ZJEj.mjs → ExportCsvAction-bovG-NJr.mjs} +2 -2
  19. package/dist/{GlobalAccountFilter-7Cg2-9A5.mjs → GlobalAccountFilter-CYqzqmAd.mjs} +10 -10
  20. package/dist/{Help-DJ8PrVHX.mjs → Help-5klKVqkX.mjs} +2 -2
  21. package/dist/{LineChart-CejWS_rh.mjs → LineChart-CUfiH86G.mjs} +1 -1
  22. package/dist/{ListItemAction-CzZ8s39Z.mjs → ListItemAction-BqUCLj_w.mjs} +1 -1
  23. package/dist/{ListItemWrapper-B5r-YQQ_.mjs → ListItemWrapper-BHIbqx7E.mjs} +3 -3
  24. package/dist/ManageIncome-Cz6hvpdA.mjs +902 -0
  25. package/dist/{MicroWidgetContainer-CfKdQfhi.mjs → MicroWidgetContainer-B2NnKBgW.mjs} +1 -1
  26. package/dist/{MiniWidgetContainer-BdPiUU-u.mjs → MiniWidgetContainer-Bmv_WeUd.mjs} +1 -1
  27. package/dist/{NetWorthUtils-DilGN1nW.mjs → NetWorthUtils-DfSH3z70.mjs} +2 -2
  28. package/dist/{NotificationSettings-B4JA5IKE.mjs → NotificationSettings-Ci89BBRI.mjs} +4 -4
  29. package/dist/{OriginalBalanceAction-BybTXDtO.mjs → OriginalBalanceAction-YrvxBYAl.mjs} +3 -3
  30. package/dist/{RecurringSettings-D2xbNb67.mjs → RecurringSettings-ClYjsmPz.mjs} +4 -4
  31. package/dist/RecurringTransactionsUtil-zOxq5pzY.mjs +298 -0
  32. package/dist/Select-CSpkK5cR.mjs +61 -0
  33. package/dist/{SpendingLegend-5Ct_FZ8o.mjs → SpendingLegend-Bn3DzGyK.mjs} +1 -1
  34. package/dist/TabContentContainer-B0eYJP5p.mjs +48 -0
  35. package/dist/{TransactionDetails-DctXr07p.mjs → TransactionDetails-DRN0GIaZ.mjs} +6 -6
  36. package/dist/{UserStore-CRpKQjpP.mjs → UserStore-DzWku3t0.mjs} +81 -40
  37. package/dist/{ViewMoreMicroCard-BD_MNc2z.mjs → ViewMoreMicroCard-Dxghxphh.mjs} +211 -231
  38. package/dist/{WidgetContainer-CmbU4CBH.mjs → WidgetContainer-D-LzIKFb.mjs} +3 -3
  39. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsDrawer.d.ts +6 -0
  40. package/dist/accounts/index.d.ts +1 -0
  41. package/dist/accounts/index.es.js +220 -1035
  42. package/dist/analytics/index.es.js +8 -8
  43. package/dist/budgets/index.es.js +11 -11
  44. package/dist/cashflow/index.es.js +41 -41
  45. package/dist/categories/index.es.js +1 -1
  46. package/dist/common/components/DataRow.d.ts +1 -0
  47. package/dist/common/constants/Analytics.d.ts +3 -0
  48. package/dist/common/index.es.js +82 -83
  49. package/dist/core/index.es.js +8 -8
  50. package/dist/core/stores/RecurringTransactionsStore.d.ts +27 -1
  51. package/dist/core/types/localization/RecurringCopy.d.ts +14 -1
  52. package/dist/core/utils/DateUtil.d.ts +2 -0
  53. package/dist/core/utils/RecurringTransactionsUtil.d.ts +2 -1
  54. package/dist/dashboard/index.es.js +4 -4
  55. package/dist/debts/index.es.js +73 -73
  56. package/dist/finstrong/index.es.js +17 -17
  57. package/dist/goals/index.es.js +22 -23
  58. package/dist/help/index.es.js +4 -4
  59. package/dist/{hooks-BaO_gOI6.mjs → hooks-97sNJ_lf.mjs} +9 -9
  60. package/dist/insights/index.es.js +4 -4
  61. package/dist/investments/index.es.js +6 -6
  62. package/dist/merchants/index.es.js +1 -1
  63. package/dist/microinsights/index.es.js +12 -11
  64. package/dist/networth/index.es.js +9 -9
  65. package/dist/notifications/index.es.js +9 -9
  66. package/dist/recurringtransactions/components/RecurringTransactionDetailsDrawer.d.ts +3 -0
  67. package/dist/recurringtransactions/components/RecurringTransactionList.d.ts +11 -0
  68. package/dist/recurringtransactions/components/UpcomingRecurrenceCard.d.ts +6 -0
  69. package/dist/recurringtransactions/components/actions/LinkTransactionDrawer.d.ts +10 -0
  70. package/dist/recurringtransactions/components/actions/MarkAsPaidDialog.d.ts +7 -0
  71. package/dist/recurringtransactions/components/actions/MarkAsUnpaidDialog.d.ts +7 -0
  72. package/dist/recurringtransactions/index.es.js +402 -376
  73. package/dist/settings/index.es.js +7 -7
  74. package/dist/spending/index.es.js +8 -8
  75. package/dist/transactions/index.es.js +12 -12
  76. package/dist/trends/index.es.js +13 -13
  77. package/dist/useAccountDisplayName-BsiXA0qf.mjs +23 -0
  78. package/dist/{useInsightsEnabled-DaNLPmUU.mjs → useInsightsEnabled-D5Sdm0TJ.mjs} +1 -1
  79. package/dist/{useWidgetLoadTimer-CJb-RELP.mjs → useWidgetLoadTimer-B0tB-yzL.mjs} +1 -1
  80. package/package.json +1 -1
  81. package/dist/Account-BxHMlV9R.mjs +0 -30
  82. package/dist/AccountDetailsHeader-DIysk_4w.mjs +0 -95
  83. package/dist/AccountDisplayName-CO7z3v99.mjs +0 -11
  84. package/dist/AccountFields-mwJ8NXsX.mjs +0 -141
  85. package/dist/AccountListItem-BDXHs4tV.mjs +0 -94
  86. package/dist/Accounts-CseLC3lL.mjs +0 -5
  87. package/dist/Connect-Dk6GZEsA.mjs +0 -39
  88. package/dist/DateUtil-Bhq59ZVg.mjs +0 -58
  89. package/dist/ManageIncome-D1yBODQi.mjs +0 -595
  90. package/dist/RecurringTransactionsUtil-B3rLEx_g.mjs +0 -253
  91. package/dist/Select-BFt-HD-L.mjs +0 -55
  92. package/dist/TabContentContainer-CnMXkVqr.mjs +0 -21
  93. package/dist/useAccountDisplayName-CFa_MrS6.mjs +0 -15
@@ -0,0 +1,921 @@
1
+ import { jsx as e, jsxs as u, Fragment as T } from "react/jsx-runtime";
2
+ import { observer as x } from "mobx-react-lite";
3
+ import { useTheme as $, alpha as rt } from "@mui/material/styles";
4
+ import { u as S, a as lt, b as dt, A as ut } from "./AccountDetailsHeader-ByGNPZpO.mjs";
5
+ import { L as _t } from "./LineChart-CUfiH86G.mjs";
6
+ import { g as mt, a as pt, b as ht } from "./SpendingData-Fii_xATx.mjs";
7
+ import { l as gt, u as D, c as V, i as Ct, f as P, g as Q } from "./hooks-97sNJ_lf.mjs";
8
+ import { c as Y, C as G, e as m, N as Z } from "./Account-DR7Plrqy.mjs";
9
+ import { I as tt, P as et, S as nt, T as H } from "./TabContentContainer-B0eYJP5p.mjs";
10
+ import _ from "react";
11
+ import j from "@mui/material/Tab";
12
+ import ft from "@mui/material/Tabs";
13
+ import ot from "@mui/material/List";
14
+ import at from "@mui/material/ListSubheader";
15
+ import bt from "@mui/material/Switch";
16
+ import { InstitutionLogo as At, Text as g, Icon as M } from "@mxenabled/mxui";
17
+ import w from "@mui/material/ListItem";
18
+ import k from "@mui/material/ListItemButton";
19
+ import v from "@mui/material/ListItemText";
20
+ import { b as h } from "./Localization-DnoVyBNK.mjs";
21
+ import yt from "@mui/material/Badge";
22
+ import K from "@mui/material/Box";
23
+ import L from "@mui/material/ListItemAvatar";
24
+ import { Error as W, Language as Tt, CheckCircle as xt } from "@mxenabled/mx-icons";
25
+ import { I as O } from "./IconBacking-DgT8DCeh.mjs";
26
+ import { f as Dt } from "./NumberFormatting--XMeeBfr.mjs";
27
+ import { u as St } from "./useAccountDisplayName-BsiXA0qf.mjs";
28
+ import { A as I } from "./Analytics-WeZYytR0.mjs";
29
+ import { D as U } from "./Dialog-Bvd2n8hz.mjs";
30
+ import { D as z } from "./Drawer-BXqqBMxg.mjs";
31
+ import Et from "@mui/material/Stack";
32
+ import { C as st } from "./ConnectDrawer-DytyIhaF.mjs";
33
+ import { fromUnixTime as vt } from "date-fns/fromUnixTime";
34
+ import { isToday as wt } from "date-fns/isToday";
35
+ import { isYesterday as It } from "date-fns/isYesterday";
36
+ import { f as X, D as q } from "./DateFormats-HudZ3Bjs.mjs";
37
+ import { addMonths as Mt } from "date-fns/addMonths";
38
+ import { AdapterDateFns as kt } from "@mui/x-date-pickers/AdapterDateFnsV3";
39
+ import { DateCalendar as Nt } from "@mui/x-date-pickers/DateCalendar";
40
+ import Lt from "@mui/material/FormControl";
41
+ import Ot from "@mui/material/InputLabel";
42
+ import { LocalizationProvider as Pt } from "@mui/x-date-pickers-pro";
43
+ import J from "@mui/material/MenuItem";
44
+ import Rt from "@mui/material/Select";
45
+ import Bt from "@mui/material/TextField";
46
+ import { F as R } from "./Connect-BH0Pt6zc.mjs";
47
+ import { C as Ft } from "./CurrencyInput-DaGEQaLW.mjs";
48
+ import Ut from "@mui/material/Alert";
49
+ import $t from "@mui/material/AlertTitle";
50
+ import Vt from "@mui/material/Link";
51
+ import Wt from "@mui/material/Paper";
52
+ import { endOfToday as zt, subDays as Yt, startOfToday as Gt } from "date-fns";
53
+ import { T as Ht } from "./EmbeddedCard-CQpbZrmP.mjs";
54
+ import { T as jt } from "./TransactionDetails-DRN0GIaZ.mjs";
55
+ const Kt = (t, o) => {
56
+ const n = tt.includes(o) ? mt(t) : [], a = et.includes(o) ? pt(t) : [], c = nt.includes(o) ? ht(t) : [];
57
+ return [n, a, c].filter((l) => l.length > 0);
58
+ }, Xt = (t, o, n) => {
59
+ const [a, c] = t, l = a, d = c ?? a, s = [];
60
+ if (l && d && tt.includes(o)) {
61
+ const r = l[l.length - 1].y;
62
+ s.push({ label: n.income_label, amount: r });
63
+ } else if (et.includes(o)) {
64
+ const r = l[l.length - 1].y;
65
+ s.push({ label: n.payments_label, amount: r });
66
+ }
67
+ if (d && nt.includes(o)) {
68
+ const r = d[d.length - 1].y;
69
+ s.push({ label: n.spending_label, amount: r });
70
+ }
71
+ return s;
72
+ }, qt = () => {
73
+ const t = $(), { selectedAccount: o } = S(), { monthlyCategoryTotals: n } = gt(), { trends: a } = D(), c = [t.palette.chart?.chart1, t.palette.chart?.chart2], l = Kt(n, o.account_type), d = Xt(l, o.account_type, a), s = [Y.LOAN, Y.MORTGAGE].includes(o.account_type);
74
+ return /* @__PURE__ */ e("div", { "data-testid": "TrendsChart", children: /* @__PURE__ */ e(
75
+ _t,
76
+ {
77
+ colors: c,
78
+ datasets: l,
79
+ height: 185,
80
+ labels: d,
81
+ showAverage: s,
82
+ showAxisHighlight: !0,
83
+ showBars: s,
84
+ showLegend: !0,
85
+ showTooltip: !0,
86
+ showXAxis: !0,
87
+ showXAxisTicks: !0,
88
+ showYAxis: !0,
89
+ showYAxisTicks: !0,
90
+ valueFormatterString: "0,0"
91
+ }
92
+ ) });
93
+ }, Jt = x(qt), B = ({
94
+ ariaPressed: t,
95
+ children: o,
96
+ isLast: n = !1,
97
+ onClick: a,
98
+ primaryText: c,
99
+ secondaryText: l
100
+ }) => /* @__PURE__ */ e(
101
+ w,
102
+ {
103
+ sx: {
104
+ backgroundColor: "background.paper",
105
+ position: "relative",
106
+ "&::after": {
107
+ content: '""',
108
+ position: "absolute",
109
+ bottom: 0,
110
+ right: 0,
111
+ left: n ? 0 : 24,
112
+ borderBottom: "1px solid",
113
+ borderColor: "divider"
114
+ }
115
+ },
116
+ children: /* @__PURE__ */ u(k, { "aria-pressed": t, onClick: a, children: [
117
+ /* @__PURE__ */ e(v, { primary: c, secondary: l }),
118
+ o
119
+ ] })
120
+ }
121
+ ), Qt = () => {
122
+ const { accounts: t } = V(), { selectedAccount: o, selectedMember: n } = S();
123
+ return t.filter(
124
+ (a) => a.member_guid === n.guid && n.successfully_aggregated_at && a.guid !== o.guid
125
+ );
126
+ }, Zt = {
127
+ gridRow: 1,
128
+ gridColumn: 1,
129
+ zIndex: 2
130
+ }, te = ({ size: t = 20 }) => /* @__PURE__ */ e(O, { size: t, children: /* @__PURE__ */ e(W, { color: "error", filled: !0, sx: { fontSize: t, ...Zt } }) }), ee = ({
131
+ account: t,
132
+ onRowClick: o,
133
+ listItemProps: n,
134
+ shouldShowConnectionStatus: a = !1
135
+ }) => {
136
+ const c = $(), l = St(t), { config: d } = Ct(), { accounts: s } = D(), { firstSubtitle: r, firstValue: f, secondSubtitle: b, secondValue: i } = lt(
137
+ t,
138
+ s,
139
+ d.display_available_balance_in_accounts
140
+ );
141
+ let C;
142
+ (t.connectionStatus === G.Error || t.connectionStatus === G.RequiresMfa) && (C = /* @__PURE__ */ e(te, { size: 16 }));
143
+ const A = /* @__PURE__ */ u(T, { children: [
144
+ /* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(
145
+ yt,
146
+ {
147
+ badgeContent: a ? C : void 0,
148
+ sx: {
149
+ "& .MuiBadge-badge": {
150
+ right: -1
151
+ }
152
+ },
153
+ children: /* @__PURE__ */ e(At, { alt: "MX", institutionGuid: t.institution_guid || "" })
154
+ }
155
+ ) }),
156
+ /* @__PURE__ */ e(
157
+ v,
158
+ {
159
+ disableTypography: !0,
160
+ primary: /* @__PURE__ */ u(
161
+ g,
162
+ {
163
+ bold: !0,
164
+ color: t.is_hidden ? c.palette.text.secondary : void 0,
165
+ variant: "body1",
166
+ children: [
167
+ `${l} ${t.account_number ? `*${t.account_number}` : ""}`,
168
+ " ",
169
+ t.is_hidden && !t.is_closed && s.is_hidden,
170
+ t.is_closed && s.is_closed
171
+ ]
172
+ }
173
+ ),
174
+ secondary: /* @__PURE__ */ u(T, { children: [
175
+ /* @__PURE__ */ u(K, { sx: { alignItems: "center", display: "flex", justifyContent: "space-between" }, children: [
176
+ /* @__PURE__ */ e(g, { variant: "caption", children: r }),
177
+ /* @__PURE__ */ e(g, { bold: !0, variant: "body2", children: Dt(f, "0,0.00") })
178
+ ] }),
179
+ /* @__PURE__ */ u(K, { sx: { alignItems: "center", display: "flex", justifyContent: "space-between" }, children: [
180
+ /* @__PURE__ */ e(g, { variant: "caption", children: b }),
181
+ /* @__PURE__ */ e(g, { ml: "auto", variant: "caption", children: i })
182
+ ] })
183
+ ] })
184
+ }
185
+ )
186
+ ] });
187
+ return /* @__PURE__ */ e(
188
+ w,
189
+ {
190
+ ...n,
191
+ sx: {
192
+ backgroundColor: "background.paper",
193
+ color: t.is_closed ? "grey.700" : "",
194
+ ...n?.sx
195
+ },
196
+ children: o ? /* @__PURE__ */ e(k, { alignItems: "flex-start", onClick: o, sx: { px: 24 }, children: A }) : A
197
+ }
198
+ );
199
+ }, ne = x(ee), oe = () => {
200
+ const [t, o] = _.useState(!1), [n, a] = _.useState(!1), [c, l] = _.useState(!1), [d, s] = _.useState({}), { selectedAccount: r } = S(), { mergeAccounts: f, updateAccount: b } = V(), { accounts: i } = D(), C = Qt(), { onEvent: A } = P(), { modifyTransactionByAccountGuid: E } = Q(), N = async (y) => {
201
+ await b({
202
+ ...r,
203
+ ...y
204
+ }), "is_closed" in y && y.is_closed !== r.is_closed && E(r.guid, { accountIsClosed: y.is_closed });
205
+ }, p = () => {
206
+ f([r.guid, d.guid]).finally(
207
+ () => a(!1)
208
+ );
209
+ };
210
+ return /* @__PURE__ */ u(T, { children: [
211
+ /* @__PURE__ */ e(at, { sx: { backgroundColor: "transparent", mb: 4, mt: 12, mx: 8 }, children: /* @__PURE__ */ e(g, { bold: !0, component: "h2", variant: "caption", children: i.actions }) }),
212
+ /* @__PURE__ */ e(
213
+ B,
214
+ {
215
+ ariaPressed: r.is_hidden,
216
+ onClick: () => {
217
+ N({ is_hidden: !r.is_hidden }), A(I.ACCOUNT_DETAILS_CLICK_HIDE, { account_guid: r.guid });
218
+ },
219
+ primaryText: r.is_hidden ? i.unhide_account : i.hide_Account,
220
+ secondaryText: r.is_hidden ? i.include_this_account : i.exclude_this_account,
221
+ children: /* @__PURE__ */ e(bt, { "aria-hidden": !0, checked: r.is_hidden, tabIndex: -1 })
222
+ }
223
+ ),
224
+ /* @__PURE__ */ u(
225
+ B,
226
+ {
227
+ onClick: () => {
228
+ o(!0), A(I.ACCOUNT_DETAILS_CLICK_MARK_CLOSED, {
229
+ account_guid: r.guid
230
+ });
231
+ },
232
+ primaryText: r.is_closed ? i.mark_as_open : i.mark_as_closed,
233
+ secondaryText: r.is_closed ? i.this_will_set_the_closed_account : i.this_will_set_the_account_balance_to_0,
234
+ children: [
235
+ /* @__PURE__ */ e(M, { name: "chevron_right" }),
236
+ /* @__PURE__ */ e("div", { onClick: (y) => y.stopPropagation(), children: /* @__PURE__ */ e(
237
+ U,
238
+ {
239
+ copy: {
240
+ close_aria: i.close_modal,
241
+ title: r.is_closed ? i.confirm_mark_as_open : i.confirm_mark_closed
242
+ },
243
+ isOpen: t,
244
+ onClose: () => {
245
+ o(!1);
246
+ },
247
+ onPrimaryAction: () => N({ is_closed: !r.is_closed }),
248
+ children: /* @__PURE__ */ e(g, { truncate: !1, children: h(
249
+ r.is_closed ? i.this_will_resume_updating_the_balance : i.this_will_set_the_balance_of_your_account,
250
+ r.name
251
+ ) })
252
+ }
253
+ ) })
254
+ ]
255
+ }
256
+ ),
257
+ C.length > 0 && /* @__PURE__ */ e(
258
+ B,
259
+ {
260
+ isLast: !0,
261
+ onClick: () => {
262
+ a(!0), A(I.ACCOUNT_DETAILS_CLICK_MARK_DUPLICATE, {
263
+ account_guid: r.guid
264
+ });
265
+ },
266
+ primaryText: i.mark_as_duplicate,
267
+ secondaryText: i.if_a_connected_account_is_showing_up_twice,
268
+ children: /* @__PURE__ */ e(M, { name: "chevron_right" })
269
+ }
270
+ ),
271
+ /* @__PURE__ */ u(
272
+ z,
273
+ {
274
+ ariaLabelClose: i.close_drawer,
275
+ isOpen: n,
276
+ onClose: () => a(!1),
277
+ title: i.mark_as_duplicate,
278
+ children: [
279
+ /* @__PURE__ */ e(ot, { children: C.map((y) => {
280
+ const ct = C.indexOf(y) === C.length - 1;
281
+ return /* @__PURE__ */ e(
282
+ ne,
283
+ {
284
+ account: y,
285
+ listItemProps: {
286
+ sx: {
287
+ position: "relative",
288
+ "&::after": {
289
+ content: '""',
290
+ position: "absolute",
291
+ bottom: 0,
292
+ right: 0,
293
+ left: ct ? 0 : 24,
294
+ borderBottom: "1px solid",
295
+ borderColor: "divider"
296
+ }
297
+ }
298
+ },
299
+ onRowClick: () => {
300
+ l(!0), s(y);
301
+ }
302
+ },
303
+ y.guid
304
+ );
305
+ }) }),
306
+ c && /* @__PURE__ */ u(
307
+ U,
308
+ {
309
+ copy: {
310
+ close_aria: i.close_modal,
311
+ title: i.confirm_merge
312
+ },
313
+ isOpen: c,
314
+ onClose: () => l(!1),
315
+ onPrimaryAction: p,
316
+ children: [
317
+ /* @__PURE__ */ e(g, { truncate: !1, children: h(
318
+ i.this_means_accounts_will_be_merged,
319
+ r.name,
320
+ d.name
321
+ ) }),
322
+ /* @__PURE__ */ e(g, { color: "error", sx: { mt: 24 }, children: i.this_action_cannot_be_undone })
323
+ ]
324
+ }
325
+ )
326
+ ]
327
+ }
328
+ )
329
+ ] });
330
+ }, ae = x(oe), it = (t, o) => {
331
+ const { connection_messages: n } = o;
332
+ switch (t.connection_status) {
333
+ case m.CHALLENGED:
334
+ return {
335
+ cta: n.challenged_cta,
336
+ main: h(
337
+ n.challenged_connection_description,
338
+ t.name
339
+ ),
340
+ statusName: o.connection_statuses[t.connection_status],
341
+ title: n.challenged_connection_title
342
+ };
343
+ case m.CLOSED:
344
+ return {
345
+ main: n.closed_connection_description,
346
+ statusName: o.connection_statuses[t.connection_status],
347
+ title: n.closed_connection_title
348
+ };
349
+ case m.DEGRADED:
350
+ return {
351
+ main: n.degraded_connection_description,
352
+ statusName: o.connection_statuses[t.connection_status],
353
+ title: n.degraded_connection_title
354
+ };
355
+ case m.DELAYED:
356
+ return {
357
+ main: h(
358
+ n.delayed_connection_description,
359
+ t.name
360
+ ),
361
+ statusName: o.connection_statuses[t.connection_status],
362
+ title: n.delayed_connection_title
363
+ };
364
+ case m.DENIED:
365
+ return {
366
+ cta: n.denied_cta,
367
+ main: h(
368
+ n.denied_connection_description,
369
+ t.name
370
+ ),
371
+ statusName: o.connection_statuses[t.connection_status],
372
+ title: n.denied_connection_title
373
+ };
374
+ case m.DISABLED:
375
+ return {
376
+ main: n.disabled_connection_description,
377
+ statusName: o.connection_statuses[t.connection_status],
378
+ title: n.disabled_connection_title
379
+ };
380
+ case m.DISCONNECTED:
381
+ return {
382
+ main: h(
383
+ n.disconnected_connection_description,
384
+ t.name
385
+ ),
386
+ statusName: o.connection_statuses[t.connection_status],
387
+ title: n.disconnected_connection_title
388
+ };
389
+ case m.DISCONTINUED:
390
+ return {
391
+ main: n.discontinued_connection_description,
392
+ statusName: o.connection_statuses[t.connection_status],
393
+ title: n.discontinued_connection_title
394
+ };
395
+ case m.EXPIRED:
396
+ return {
397
+ cta: n.expired_cta,
398
+ main: n.expired_connection_description,
399
+ statusName: o.connection_statuses[t.connection_status],
400
+ title: n.expired_connection_title
401
+ };
402
+ case m.FAILED:
403
+ return {
404
+ main: h(
405
+ n.failed_connection_description,
406
+ t.name
407
+ ),
408
+ statusName: o.connection_statuses[t.connection_status],
409
+ title: n.failed_connection_title
410
+ };
411
+ case m.IMPAIRED:
412
+ return {
413
+ cta: n.impaired_cta,
414
+ main: h(
415
+ n.impaired_connection_description,
416
+ t.name
417
+ ),
418
+ statusName: o.connection_statuses[t.connection_status],
419
+ title: n.impaired_connection_title
420
+ };
421
+ case m.IMPEDED:
422
+ return {
423
+ main: h(
424
+ n.impeded_connection_description,
425
+ t.name,
426
+ t.name
427
+ ),
428
+ statusName: o.connection_statuses[t.connection_status],
429
+ title: n.impeded_connection_title
430
+ };
431
+ case m.IMPORTED:
432
+ return {
433
+ cta: n.imported_cta,
434
+ main: h(
435
+ n.imported_connection_description,
436
+ t.name
437
+ ),
438
+ statusName: o.connection_statuses[t.connection_status],
439
+ title: n.imported_connection_title
440
+ };
441
+ case m.LOCKED:
442
+ return {
443
+ cta: n.locked_cta,
444
+ main: h(
445
+ n.locked_connection_description,
446
+ t.name
447
+ ),
448
+ statusName: o.connection_statuses[t.connection_status],
449
+ title: n.locked_connection_title
450
+ };
451
+ case m.PREVENTED:
452
+ return {
453
+ cta: n.prevented_cta,
454
+ main: n.prevented_connection_description,
455
+ statusName: o.connection_statuses[t.connection_status],
456
+ title: n.prevented_connection_title
457
+ };
458
+ case m.REJECTED:
459
+ return {
460
+ cta: n.rejected_cta,
461
+ main: n.rejected_connection_description,
462
+ statusName: o.connection_statuses[t.connection_status],
463
+ title: n.rejected_connection_title
464
+ };
465
+ default: {
466
+ const a = () => {
467
+ const c = t.successfully_aggregated_at ? vt(t.successfully_aggregated_at) : void 0, l = c && X(c, q.TIME_STAMP_HOUR_MINUTE);
468
+ if (l)
469
+ return wt(c) ? h(o.last_updated_at, o.today, l) : It(c) ? h(o.last_updated_at, o.yesterday, l) : h(
470
+ o.last_updated_at,
471
+ X(c, q.MONTH_DAY_YEAR),
472
+ l
473
+ );
474
+ };
475
+ return {
476
+ statusName: o.connection_statuses[6],
477
+ // Connected
478
+ title: a()
479
+ };
480
+ }
481
+ }
482
+ }, F = {
483
+ color: "background.default",
484
+ fontSize: 20,
485
+ gridRow: 1,
486
+ gridColumn: 1,
487
+ zIndex: 2
488
+ }, se = () => {
489
+ const [t, o] = _.useState(!1), {
490
+ palette: { mode: n }
491
+ } = $(), { selectedMember: a } = S(), { accounts: c, connect: l } = D(), d = it(a, l), s = Z.includes(a.connection_status) ? {
492
+ color: "error.main",
493
+ ctaCopy: d.cta ?? "",
494
+ icon: /* @__PURE__ */ e(W, { filled: !0, sx: { ...F } }),
495
+ mainMessage: d.statusName,
496
+ secondaryMessage: `${d.title}.`
497
+ } : {
498
+ color: "success.main",
499
+ icon: /* @__PURE__ */ e(xt, { filled: !0, sx: { ...F } }),
500
+ mainMessage: d.statusName,
501
+ secondaryMessage: d.title
502
+ };
503
+ return /* @__PURE__ */ u(T, { children: [
504
+ /* @__PURE__ */ e(at, { sx: { mb: 4, mt: 12, mx: 8 }, children: /* @__PURE__ */ e(g, { bold: !0, component: "h2", variant: "caption", children: c.connection_status }) }),
505
+ /* @__PURE__ */ e(
506
+ w,
507
+ {
508
+ sx: {
509
+ backgroundColor: "background.paper",
510
+ position: "relative",
511
+ "&::after": {
512
+ content: '""',
513
+ position: "absolute",
514
+ bottom: 0,
515
+ right: 0,
516
+ left: a.is_manual || !a.institution_url ? 0 : 24,
517
+ borderBottom: "1px solid",
518
+ borderColor: "divider"
519
+ }
520
+ },
521
+ children: a.is_manual || !s.ctaCopy ? /* @__PURE__ */ u(Et, { alignItems: "center", direction: "row", px: 24, py: 12, children: [
522
+ /* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(O, { backingSx: { backgroundColor: s.color, borderRadius: 1 }, size: 32, children: s.icon }) }),
523
+ /* @__PURE__ */ e(v, { primary: s.mainMessage, secondary: s.secondaryMessage })
524
+ ] }) : /* @__PURE__ */ u(k, { onClick: () => o(!0), children: [
525
+ /* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(O, { backingSx: { backgroundColor: s.color, borderRadius: 1 }, size: 32, children: s.icon }) }),
526
+ /* @__PURE__ */ e(
527
+ v,
528
+ {
529
+ primary: s.mainMessage,
530
+ secondary: s.secondaryMessage && /* @__PURE__ */ u(T, { children: [
531
+ s.secondaryMessage,
532
+ " ",
533
+ /* @__PURE__ */ e(g, { bold: !0, sx: { color: "action.active" }, variant: "caption", children: s.ctaCopy })
534
+ ] })
535
+ }
536
+ ),
537
+ /* @__PURE__ */ e(M, { name: "chevron_right" })
538
+ ] })
539
+ }
540
+ ),
541
+ !a.is_manual && a.institution_url && /* @__PURE__ */ e(T, { children: /* @__PURE__ */ e(
542
+ w,
543
+ {
544
+ sx: {
545
+ backgroundColor: "background.paper",
546
+ borderBottom: "1px solid",
547
+ borderColor: "divider"
548
+ },
549
+ children: /* @__PURE__ */ u(k, { component: "a", href: a.institution_url, target: "_blank", children: [
550
+ /* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(
551
+ O,
552
+ {
553
+ backingSx: {
554
+ backgroundColor: n === "light" ? "grey.300" : "grey.700",
555
+ borderRadius: 1
556
+ },
557
+ size: 32,
558
+ children: /* @__PURE__ */ e(
559
+ Tt,
560
+ {
561
+ sx: {
562
+ ...F,
563
+ color: n === "light" ? "grey.900" : "common.white"
564
+ }
565
+ }
566
+ )
567
+ }
568
+ ) }),
569
+ /* @__PURE__ */ e(v, { primary: a.name, secondary: a.institution_url }),
570
+ /* @__PURE__ */ e(M, { name: "launch" })
571
+ ] })
572
+ }
573
+ ) }),
574
+ t && /* @__PURE__ */ e(
575
+ st,
576
+ {
577
+ loadWidgetProps: { current_member_guid: a.guid },
578
+ onClose: () => o(!1),
579
+ showConnectWidget: t,
580
+ title: c.manage_connection
581
+ }
582
+ )
583
+ ] });
584
+ }, ie = x(se), ce = ({ field: t, isOpen: o, onClose: n }) => {
585
+ const { updateAccount: a } = V(), { selectedAccount: c } = S(), { accounts: l } = D(), [d, s] = _.useState(c[t.name]), [r, f] = _.useState(""), [b, i] = _.useState(!0), C = () => {
586
+ s(""), f(""), n();
587
+ }, A = () => {
588
+ switch (t.type) {
589
+ case R.Select:
590
+ return /* @__PURE__ */ u(Lt, { fullWidth: !0, children: [
591
+ /* @__PURE__ */ e(Ot, { id: `${t.label}-select-label`, children: t.label }),
592
+ /* @__PURE__ */ u(
593
+ Rt,
594
+ {
595
+ displayEmpty: !0,
596
+ id: `${t.label}-select`,
597
+ label: t.label,
598
+ labelId: `${t.label}-select-label`,
599
+ onChange: (p) => s(p.target.value),
600
+ slotProps: {
601
+ input: {
602
+ sx: {
603
+ backgroundColor: "background.paper"
604
+ }
605
+ }
606
+ },
607
+ value: d,
608
+ children: [
609
+ !d && /* @__PURE__ */ e(J, { disabled: !0, value: "", children: t.placeholder }),
610
+ t.options?.map((p) => /* @__PURE__ */ e(J, { value: p.value, children: p.label }, p.value))
611
+ ]
612
+ }
613
+ )
614
+ ] });
615
+ case R.Currency:
616
+ return /* @__PURE__ */ e(
617
+ Ft,
618
+ {
619
+ amount: d || "",
620
+ ariaLabel: t.placeholder,
621
+ fullWidth: !0,
622
+ label: t.label,
623
+ placeholder: t.placeholder,
624
+ setAmount: s,
625
+ setHasValidInput: i
626
+ }
627
+ );
628
+ case R.Date:
629
+ return /* @__PURE__ */ e(Pt, { dateAdapter: kt, children: /* @__PURE__ */ e(
630
+ Nt,
631
+ {
632
+ maxDate: Mt(/* @__PURE__ */ new Date(), 1),
633
+ minDate: /* @__PURE__ */ new Date(),
634
+ onChange: (p) => {
635
+ c[t.name] && Number(c[t.name]) <= 31 ? s(p.getDate()) : s(p);
636
+ },
637
+ sx: {
638
+ "& .MuiPickersDay-today": {
639
+ color: "primary.lighter"
640
+ },
641
+ "& .MuiPickersArrowSwitcher-button": {
642
+ color: "primary.lighter",
643
+ "&:hover": {
644
+ backgroundColor: (p) => rt(p.palette.primary.light, 0.1)
645
+ }
646
+ }
647
+ },
648
+ views: ["day"]
649
+ }
650
+ ) });
651
+ default:
652
+ return /* @__PURE__ */ e(
653
+ Bt,
654
+ {
655
+ defaultValue: c[t.name],
656
+ error: !!r,
657
+ fullWidth: !0,
658
+ helperText: r,
659
+ onChange: N,
660
+ placeholder: t.placeholder,
661
+ slotProps: {
662
+ htmlInput: {
663
+ "aria-label": t.placeholder
664
+ }
665
+ }
666
+ }
667
+ );
668
+ }
669
+ }, E = () => {
670
+ c[t.name] !== d && a({
671
+ ...c,
672
+ [t.name]: d
673
+ }), C();
674
+ }, N = (p) => {
675
+ s(p.target.value), t.validation && f(t.validation(p.target.value));
676
+ };
677
+ return /* @__PURE__ */ e(
678
+ U,
679
+ {
680
+ copy: {
681
+ close_aria: l.close_aria,
682
+ title: h(l.edit_field, t.label)
683
+ },
684
+ disablePrimaryButton: !!r || !b,
685
+ isOpen: o,
686
+ onClose: C,
687
+ onPrimaryAction: E,
688
+ primaryText: l.save,
689
+ sx: {
690
+ "& .MuiButton-root:focus-visible, & .MuiButton-root:focus": {
691
+ outline: "2px solid",
692
+ outlineColor: "primary.main",
693
+ outlineOffset: "2px"
694
+ }
695
+ },
696
+ children: A()
697
+ }
698
+ );
699
+ }, re = x(ce), le = () => {
700
+ const t = window.app?.config, { onEvent: o } = P(), { selectedAccount: n } = S(), { accounts: a } = D(), c = dt(n, a), l = n.member_is_managed_by_user || !n.member_is_managed_by_user && t.enable_renaming_home_accounts, [d, s] = _.useState(!1), [r, f] = _.useState(c[0]), b = c.filter(
701
+ (i) => l || n[i.name] || n[i.name] === 0
702
+ );
703
+ return /* @__PURE__ */ u(T, { children: [
704
+ b.map((i) => {
705
+ const C = n[i.name] || n[i.name] === 0, A = b.indexOf(i) === b.length - 1, E = /* @__PURE__ */ e(
706
+ v,
707
+ {
708
+ disableTypography: !0,
709
+ primary: /* @__PURE__ */ e(g, { sx: { fontSize: 11 }, children: i.label }),
710
+ secondary: /* @__PURE__ */ e(g, { bold: !0, sx: { fontSize: 15 }, children: C ? i.valueFormatter(n[i.name]) : i.placeholder })
711
+ }
712
+ );
713
+ return /* @__PURE__ */ e(_.Fragment, { children: l ? /* @__PURE__ */ e(
714
+ w,
715
+ {
716
+ sx: {
717
+ backgroundColor: "background.paper",
718
+ px: 0,
719
+ position: "relative",
720
+ "&::after": {
721
+ content: '""',
722
+ position: "absolute",
723
+ bottom: 0,
724
+ right: 0,
725
+ left: A ? 0 : 24,
726
+ borderBottom: "1px solid",
727
+ borderColor: "divider"
728
+ }
729
+ },
730
+ children: /* @__PURE__ */ u(
731
+ k,
732
+ {
733
+ onClick: () => {
734
+ f(i), s(!0), i?.event && o(i.event, { account_guid: n.guid });
735
+ },
736
+ children: [
737
+ E,
738
+ /* @__PURE__ */ e(M, { name: "chevron_right" })
739
+ ]
740
+ }
741
+ )
742
+ }
743
+ ) : C && /* @__PURE__ */ e(
744
+ w,
745
+ {
746
+ sx: {
747
+ backgroundColor: "background.paper",
748
+ px: 24,
749
+ position: "relative",
750
+ "&::after": {
751
+ content: '""',
752
+ position: "absolute",
753
+ bottom: 0,
754
+ right: 0,
755
+ left: A ? 0 : 24,
756
+ borderBottom: "1px solid",
757
+ borderColor: "divider"
758
+ }
759
+ },
760
+ children: E
761
+ }
762
+ ) }, i.name);
763
+ }),
764
+ d && r && /* @__PURE__ */ e(
765
+ re,
766
+ {
767
+ field: r,
768
+ isOpen: d,
769
+ onClose: () => s(!1)
770
+ }
771
+ )
772
+ ] });
773
+ }, de = x(le), ue = () => {
774
+ const { onEvent: t } = P();
775
+ return _.useEffect(() => t(I.ACCOUNT_DETAILS_VIEW), []), /* @__PURE__ */ u(ot, { children: [
776
+ /* @__PURE__ */ e(de, {}),
777
+ /* @__PURE__ */ e(ie, {}),
778
+ /* @__PURE__ */ e(ae, {})
779
+ ] });
780
+ }, _e = x(ue), me = ({ setTabValue: t }) => {
781
+ const [o, n] = _.useState(!1), { selectedMember: a } = S(), { accounts: c, connect: l } = D(), d = a.connection_status && Z.includes(a.connection_status);
782
+ if (_.useEffect(() => {
783
+ d && t(1);
784
+ }, [d]), !d) return;
785
+ const s = it(a, l);
786
+ return /* @__PURE__ */ u(T, { children: [
787
+ /* @__PURE__ */ e(
788
+ Wt,
789
+ {
790
+ sx: {
791
+ mb: 16,
792
+ mt: 24,
793
+ mx: 24
794
+ },
795
+ children: /* @__PURE__ */ u(
796
+ Ut,
797
+ {
798
+ icon: /* @__PURE__ */ e(W, { filled: !0 }),
799
+ role: "none",
800
+ severity: "error",
801
+ sx: {
802
+ borderLeft: 5,
803
+ borderTopLeftRadius: 6,
804
+ borderBottomLeftRadius: 6,
805
+ borderColor: "error.main",
806
+ color: "text.primary",
807
+ "&.MuiPaper-root": {
808
+ backgroundColor: "background.paper"
809
+ }
810
+ },
811
+ children: [
812
+ s.title && /* @__PURE__ */ e($t, { sx: { fontWeight: 600, marginTop: 2 }, variant: "body1", children: s.title }),
813
+ /* @__PURE__ */ e(g, { component: "p", variant: "subtitle2", children: s.main }),
814
+ s.cta && /* @__PURE__ */ e(
815
+ Vt,
816
+ {
817
+ onClick: () => n(!0),
818
+ sx: { fontSize: 15, fontWeight: 600, ml: 0 },
819
+ children: s.cta
820
+ }
821
+ )
822
+ ]
823
+ }
824
+ )
825
+ }
826
+ ),
827
+ o && /* @__PURE__ */ e(
828
+ st,
829
+ {
830
+ loadWidgetProps: { current_member_guid: a.guid },
831
+ onClose: () => n(!1),
832
+ showConnectWidget: o,
833
+ title: c.manage_connection
834
+ }
835
+ )
836
+ ] });
837
+ }, pe = x(me), he = () => {
838
+ const [t, o] = _.useState(""), { onEvent: n } = P(), { selectedAccount: a } = S(), { accounts: c } = D(), { isTransactionDataLoaded: l, loadTransactionData: d, setFilter: s, sortedTransactions: r } = Q();
839
+ _.useEffect(() => {
840
+ l || d().finally();
841
+ }, []);
842
+ const f = _.useMemo(
843
+ () => r.find((b) => b.guid === t),
844
+ [t, r]
845
+ );
846
+ return _.useEffect(() => {
847
+ s({
848
+ dateRange: { start: Yt(Gt(), 90), end: zt() },
849
+ accounts: [a.guid]
850
+ });
851
+ }, [a]), _.useEffect(() => n(I.ACCOUNT_DETAILS_VIEW_TRANSACTIONS), []), /* @__PURE__ */ u(T, { children: [
852
+ /* @__PURE__ */ e(Ht, { onClick: o }),
853
+ f && /* @__PURE__ */ e(
854
+ z,
855
+ {
856
+ ariaLabelClose: c.close_drawer,
857
+ isOpen: !!t,
858
+ onClose: () => o(""),
859
+ title: c.transaction_drawer_title,
860
+ children: /* @__PURE__ */ e(jt, { transaction: f })
861
+ }
862
+ )
863
+ ] });
864
+ }, ge = x(he), Ce = () => {
865
+ const [t, o] = _.useState(0), { accounts: n } = D();
866
+ return /* @__PURE__ */ u(T, { children: [
867
+ /* @__PURE__ */ e(pe, { setTabValue: o }),
868
+ /* @__PURE__ */ u(
869
+ ft,
870
+ {
871
+ "aria-label": n.transactions_and_details_aria,
872
+ centered: !0,
873
+ onChange: (a, c) => o(c),
874
+ textColor: "primary",
875
+ value: t,
876
+ variant: "fullWidth",
877
+ children: [
878
+ /* @__PURE__ */ e(
879
+ j,
880
+ {
881
+ "aria-controls": "transaction-details-tabpanel-0",
882
+ id: "transaction-details-tab-0",
883
+ label: n.transactions
884
+ }
885
+ ),
886
+ /* @__PURE__ */ e(
887
+ j,
888
+ {
889
+ "aria-controls": "account-details-tabpanel-1",
890
+ id: "account-details-tab-1",
891
+ label: n.account_details
892
+ }
893
+ )
894
+ ]
895
+ }
896
+ ),
897
+ /* @__PURE__ */ e(H, { index: 0, name: "transaction-details", value: t, children: /* @__PURE__ */ e(ge, {}) }),
898
+ /* @__PURE__ */ e(H, { index: 1, name: "account-details", value: t, children: /* @__PURE__ */ e(_e, {}) })
899
+ ] });
900
+ }, fe = x(Ce), An = ({ isOpen: t, onClose: o }) => {
901
+ const { accounts: n } = D();
902
+ return /* @__PURE__ */ u(
903
+ z,
904
+ {
905
+ ariaLabelClose: n.close_account_details_aria,
906
+ isOpen: t,
907
+ onClose: o,
908
+ title: n.account_details,
909
+ children: [
910
+ /* @__PURE__ */ e(ut, { ChartComponent: Jt }),
911
+ /* @__PURE__ */ e(fe, {})
912
+ ]
913
+ }
914
+ );
915
+ };
916
+ export {
917
+ ne as A,
918
+ An as a,
919
+ fe as b,
920
+ Qt as u
921
+ };