@mx-cartographer/experiences 7.6.7 → 7.6.9

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 (55) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/{Account-CInGmc0-.mjs → Account-_uxi_9nO.mjs} +1 -1
  3. package/dist/{AccountDetailsHeader-CHnRF8JO.mjs → AccountDetailsHeader-DQ7XLdz1.mjs} +4 -4
  4. package/dist/{AccountFields-C1HYZrHp.mjs → AccountFields-BQPsS98r.mjs} +7 -7
  5. package/dist/{AccountListItem-0Ue0FDFm.mjs → AccountListItem-Di1Yze76.mjs} +3 -3
  6. package/dist/{AccountStore-4NJz-RwU.mjs → AccountStore-CJH6KiEh.mjs} +2 -2
  7. package/dist/{Accounts-oiIKNL3g.mjs → Accounts-CrbI2KoT.mjs} +1 -1
  8. package/dist/{CategorySelectorDrawer-DBOfaz2W.mjs → CategorySelectorDrawer-DywvMfPe.mjs} +1 -1
  9. package/dist/{CategoryStore-B5nzxgvr.mjs → CategoryStore-Cnw9yUys.mjs} +1 -1
  10. package/dist/{CategoryUtil-CKczWF-y.mjs → CategoryUtil-DZflYFam.mjs} +1 -1
  11. package/dist/{ConnectDrawer-DJV-yWGN.mjs → ConnectDrawer-CPvaP8lk.mjs} +2 -2
  12. package/dist/{ConnectionsDrawer-BFC4fpyR.mjs → ConnectionsDrawer-XlO1q6PK.mjs} +1 -1
  13. package/dist/{DateUtil-RJ9d88qV.mjs → DateUtil-D7U-nc1Y.mjs} +3 -3
  14. package/dist/{DebtsStore-CwY5g3GU.mjs → DebtsStore-BVMbvqHR.mjs} +1 -1
  15. package/dist/{Dialog-BlnUNqVo.mjs → Dialog-B4PI-_bL.mjs} +2 -2
  16. package/dist/{ExportCsvAction-Col0j3VJ.mjs → ExportCsvAction-HK5CeZWR.mjs} +2 -2
  17. package/dist/{FinstrongStore-DA67hQcM.mjs → FinstrongStore-bEn_im_e.mjs} +5 -5
  18. package/dist/{GoalStore-nm-xgH5C.mjs → GoalStore-DaQzJCFj.mjs} +2 -2
  19. package/dist/{ListItemAction-DjHOd3sz.mjs → ListItemAction-CU42h39I.mjs} +9 -9
  20. package/dist/{ManageIncome-DO3i-WA4.mjs → ManageIncome-1FRPmZFq.mjs} +6 -6
  21. package/dist/{NetWorthStore-btN67ddi.mjs → NetWorthStore-BRdkznL_.mjs} +2 -2
  22. package/dist/{NotificationSettings-Bp3Zsojv.mjs → NotificationSettings-D4Vh3z8I.mjs} +1 -1
  23. package/dist/{OriginalBalanceAction-BCSXD8XS.mjs → OriginalBalanceAction-ChGGq5AH.mjs} +1 -1
  24. package/dist/{RecurringSettings-B1hgFaEZ.mjs → RecurringSettings-z0XUW9qx.mjs} +3 -3
  25. package/dist/{RecurringTransactions-BQ383pPY.mjs → RecurringTransactions-Bf4lX0Cn.mjs} +2 -2
  26. package/dist/{RecurringTransactionsStore-BvQKKWmi.mjs → RecurringTransactionsStore-Caf1cq4v.mjs} +1 -1
  27. package/dist/{SpendingData-zOn0cwrq.mjs → SpendingData-BmL0bwnS.mjs} +1 -1
  28. package/dist/{SpendingLegend-CJFdclHt.mjs → SpendingLegend-BuDjbr2d.mjs} +2 -2
  29. package/dist/{TransactionDetails-vXstDuDk.mjs → TransactionDetails-BKoBKUNp.mjs} +5 -5
  30. package/dist/{TransactionStore-hK3XwZ-J.mjs → TransactionStore-DJwPaZuM.mjs} +3 -3
  31. package/dist/{TrendsStore-CQAsOAvy.mjs → TrendsStore-DXQnmdc8.mjs} +1 -1
  32. package/dist/{User-HWd73B4y.mjs → User-LJpEwPtn.mjs} +1 -1
  33. package/dist/{WidgetContainer-8RexRzms.mjs → WidgetContainer-COyiIVSd.mjs} +2 -2
  34. package/dist/accounts/index.es.js +894 -232
  35. package/dist/budgets/index.es.js +7 -7
  36. package/dist/cashflow/index.es.js +8 -8
  37. package/dist/categories/index.es.js +2 -2
  38. package/dist/common/index.es.js +24 -24
  39. package/dist/dashboard/index.es.js +1 -1
  40. package/dist/debts/index.es.js +8 -8
  41. package/dist/{exportTransactionsToCSV-CtfqJHuB.mjs → exportTransactionsToCSV-BrTYdSgJ.mjs} +2 -2
  42. package/dist/finstrong/index.es.js +13 -13
  43. package/dist/goals/index.es.js +376 -387
  44. package/dist/help/index.es.js +1 -1
  45. package/dist/investments/index.es.js +2 -2
  46. package/dist/networth/index.es.js +27 -27
  47. package/dist/notifications/index.es.js +2 -2
  48. package/dist/recurringtransactions/index.es.js +9 -9
  49. package/dist/settings/index.es.js +5 -5
  50. package/dist/spending/index.es.js +4 -4
  51. package/dist/transactions/index.es.js +12 -12
  52. package/dist/trends/index.es.js +523 -523
  53. package/dist/{useAccountDisplayName-DcNHwMST.mjs → useAccountDisplayName-Bh0NAiSw.mjs} +1 -1
  54. package/package.json +1 -1
  55. package/dist/AccountDetailsContent-C13fWjE9.mjs +0 -686
@@ -1,5 +1,5 @@
1
1
  import s from "react";
2
- import { g as e } from "./ConnectDrawer-DJV-yWGN.mjs";
2
+ import { g as e } from "./ConnectDrawer-CPvaP8lk.mjs";
3
3
  import { a as n } from "./hooks-ZMp65DFz.mjs";
4
4
  const i = (o) => {
5
5
  const { config: a } = n();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "7.6.7",
3
+ "version": "7.6.9",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",
@@ -1,686 +0,0 @@
1
- import { jsxs as u, Fragment as g, jsx as t } from "react/jsx-runtime";
2
- import _ from "react";
3
- import { observer as T } from "mobx-react-lite";
4
- import B from "@mui/material/Tab";
5
- import nt from "@mui/material/Tabs";
6
- import $ from "@mui/material/List";
7
- import Y from "@mui/material/ListSubheader";
8
- import ot from "@mui/material/Switch";
9
- import { Text as b, Icon as k, THEMES as H } from "@mxenabled/mxui";
10
- import I from "@mui/material/Divider";
11
- import v from "@mui/material/ListItem";
12
- import N from "@mui/material/ListItemButton";
13
- import w from "@mui/material/ListItemText";
14
- import { u as D } from "./AccountDetailsHeader-CHnRF8JO.mjs";
15
- import { d as z, u as E, g as O, h as X } from "./hooks-ZMp65DFz.mjs";
16
- import { A as at } from "./AccountListItem-0Ue0FDFm.mjs";
17
- import { A as M } from "./WidgetContainer-8RexRzms.mjs";
18
- import { D as V, f as G, a as K } from "./Dialog-BlnUNqVo.mjs";
19
- import { b as h } from "./Localization-2MODESHW.mjs";
20
- import { D as J } from "./Drawer-DV4NTsFg.mjs";
21
- import P from "@mui/material/ListItemAvatar";
22
- import ct from "@mui/material/Stack";
23
- import st from "@mui/material/styles/useTheme";
24
- import { Error as q, CheckCircle as it, Language as rt } from "@mxenabled/mx-icons";
25
- import { n as m, N as Q, l as Z, F as R } from "./ConnectDrawer-DJV-yWGN.mjs";
26
- import { fromUnixTime as lt } from "date-fns/fromUnixTime";
27
- import { isToday as ut } from "date-fns/isToday";
28
- import { isYesterday as dt } from "date-fns/isYesterday";
29
- import { I as F } from "./IconBacking-B9oC6uL2.mjs";
30
- import { addMonths as _t } from "date-fns/addMonths";
31
- import { alpha as mt } from "@mui/material/styles";
32
- import { AdapterDateFns as pt } from "@mui/x-date-pickers/AdapterDateFnsV3";
33
- import { DateCalendar as ht } from "@mui/x-date-pickers/DateCalendar";
34
- import gt from "@mui/material/FormControl";
35
- import Ct from "@mui/material/InputLabel";
36
- import { LocalizationProvider as ft } from "@mui/x-date-pickers-pro";
37
- import bt from "@mui/material/MenuItem";
38
- import At from "@mui/material/Select";
39
- import Tt from "@mui/material/TextField";
40
- import { C as St } from "./CurrencyInput-itK0R3wV.mjs";
41
- import { b as Dt } from "./AccountFields-C1HYZrHp.mjs";
42
- import Et from "@mui/material/Alert";
43
- import yt from "@mui/material/AlertTitle";
44
- import xt from "@mui/material/Link";
45
- import wt from "@mui/material/Paper";
46
- import { subDays as Mt, startOfToday as kt, endOfToday as It } from "date-fns";
47
- import { T as vt, a as Lt } from "./TransactionDetails-vXstDuDk.mjs";
48
- import { T as j } from "./TabContentContainer-j01JYR_7.mjs";
49
- const U = ({
50
- children: e,
51
- isLast: o = !1,
52
- onClick: n,
53
- primaryText: c,
54
- secondaryText: i
55
- }) => /* @__PURE__ */ u(g, { children: [
56
- /* @__PURE__ */ t(v, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ u(N, { onClick: n, children: [
57
- /* @__PURE__ */ t(w, { primary: c, secondary: i }),
58
- e
59
- ] }) }),
60
- /* @__PURE__ */ t(I, { sx: { ml: o ? 0 : 24 } })
61
- ] }), Nt = () => {
62
- const { accounts: e } = z(), { selectedAccount: o, selectedMember: n } = D();
63
- return e.filter(
64
- (c) => c.member_guid === n.guid && n.successfully_aggregated_at && c.guid !== o.guid
65
- );
66
- }, Ot = () => {
67
- const [e, o] = _.useState(!1), [n, c] = _.useState(!1), [i, d] = _.useState(!1), [l, s] = _.useState({}), { selectedAccount: r } = D(), { mergeAccounts: y, updateAccount: S } = z(), { accounts: a } = E(), C = Nt(), { onEvent: A } = O(), { modifyTransactionByAccountGuid: x } = X(), L = async (f) => {
68
- await S({
69
- ...r,
70
- ...f
71
- }), "is_closed" in f && f.is_closed !== r.is_closed && x(r.guid, { accountIsClosed: f.is_closed });
72
- }, p = () => {
73
- y([r.guid, l.guid]).finally(
74
- () => c(!1)
75
- );
76
- };
77
- return /* @__PURE__ */ u(g, { children: [
78
- /* @__PURE__ */ t(Y, { sx: { backgroundColor: "transparent", mb: 4, mt: 12, mx: 8 }, children: /* @__PURE__ */ t(b, { bold: !0, component: "h2", variant: "XSmall", children: a.actions }) }),
79
- /* @__PURE__ */ t(
80
- U,
81
- {
82
- onClick: () => {
83
- L({ is_hidden: !r.is_hidden }), A(M.ACCOUNT_DETAILS_CLICK_HIDE, { account_guid: r.guid });
84
- },
85
- primaryText: r.is_hidden ? a.unhide_account : a.hide_Account,
86
- secondaryText: r.is_hidden ? a.include_this_account : a.exclude_this_account,
87
- children: /* @__PURE__ */ t(ot, { checked: r.is_hidden })
88
- }
89
- ),
90
- /* @__PURE__ */ t(
91
- U,
92
- {
93
- onClick: () => {
94
- o(!0), A(M.ACCOUNT_DETAILS_CLICK_MARK_CLOSED, {
95
- account_guid: r.guid
96
- });
97
- },
98
- primaryText: r.is_closed ? a.mark_as_open : a.mark_as_closed,
99
- secondaryText: r.is_closed ? a.this_will_set_the_closed_account : a.this_will_set_the_account_balance_to_0,
100
- children: /* @__PURE__ */ t(k, { name: "chevron_right" })
101
- }
102
- ),
103
- C.length > 0 && /* @__PURE__ */ t(
104
- U,
105
- {
106
- isLast: !0,
107
- onClick: () => {
108
- c(!0), A(M.ACCOUNT_DETAILS_CLICK_MARK_DUPLICATE, {
109
- account_guid: r.guid
110
- });
111
- },
112
- primaryText: a.mark_as_duplicate,
113
- secondaryText: a.if_a_connected_account_is_showing_up_twice,
114
- children: /* @__PURE__ */ t(k, { name: "chevron_right" })
115
- }
116
- ),
117
- /* @__PURE__ */ t(
118
- V,
119
- {
120
- copy: {
121
- close_aria: a.close_modal,
122
- title: r.is_closed ? a.confirm_mark_as_open : a.confirm_mark_closed
123
- },
124
- isOpen: e,
125
- onClose: () => {
126
- o(!1);
127
- },
128
- onPrimaryAction: () => L({ is_closed: !r.is_closed }),
129
- children: /* @__PURE__ */ t(b, { truncate: !1, children: h(
130
- r.is_closed ? a.this_will_resume_updating_the_balance : a.this_will_set_the_balance_of_your_account,
131
- r.name
132
- ) })
133
- }
134
- ),
135
- /* @__PURE__ */ t(
136
- J,
137
- {
138
- ariaLabelClose: a.close_drawer,
139
- isOpen: n,
140
- onClose: () => c(!1),
141
- title: a.mark_as_duplicate,
142
- children: /* @__PURE__ */ t($, { children: C.map((f) => {
143
- const et = C.indexOf(f) === C.length - 1;
144
- return /* @__PURE__ */ u(_.Fragment, { children: [
145
- /* @__PURE__ */ t(
146
- at,
147
- {
148
- account: f,
149
- onRowClick: () => {
150
- d(!0), s(f);
151
- }
152
- }
153
- ),
154
- /* @__PURE__ */ t($, { sx: { ml: et ? 0 : 24 } })
155
- ] }, f.guid);
156
- }) })
157
- }
158
- ),
159
- i && /* @__PURE__ */ u(
160
- V,
161
- {
162
- copy: {
163
- close_aria: a.close_modal,
164
- title: a.confirm_merge
165
- },
166
- isOpen: i,
167
- onClose: () => d(!1),
168
- onPrimaryAction: p,
169
- children: [
170
- /* @__PURE__ */ t(b, { truncate: !1, children: h(
171
- a.this_means_accounts_will_be_merged,
172
- r.name,
173
- l.name
174
- ) }),
175
- /* @__PURE__ */ t(b, { color: "error", sx: { mt: 24 }, children: a.this_action_cannot_be_undone })
176
- ]
177
- }
178
- )
179
- ] });
180
- }, Pt = T(Ot), tt = (e, o) => {
181
- const { connection_messages: n } = o;
182
- switch (e.connection_status) {
183
- case m.CHALLENGED:
184
- return {
185
- cta: n.challenged_cta,
186
- main: h(
187
- n.challenged_connection_description,
188
- e.name
189
- ),
190
- statusName: o.connection_statuses[e.connection_status],
191
- title: n.challenged_connection_title
192
- };
193
- case m.CLOSED:
194
- return {
195
- main: n.closed_connection_description,
196
- statusName: o.connection_statuses[e.connection_status],
197
- title: n.closed_connection_title
198
- };
199
- case m.DEGRADED:
200
- return {
201
- main: n.degraded_connection_description,
202
- statusName: o.connection_statuses[e.connection_status],
203
- title: n.degraded_connection_title
204
- };
205
- case m.DELAYED:
206
- return {
207
- main: h(
208
- n.delayed_connection_description,
209
- e.name
210
- ),
211
- statusName: o.connection_statuses[e.connection_status],
212
- title: n.delayed_connection_title
213
- };
214
- case m.DENIED:
215
- return {
216
- cta: n.denied_cta,
217
- main: h(
218
- n.denied_connection_description,
219
- e.name
220
- ),
221
- statusName: o.connection_statuses[e.connection_status],
222
- title: n.denied_connection_title
223
- };
224
- case m.DISABLED:
225
- return {
226
- main: n.disabled_connection_description,
227
- statusName: o.connection_statuses[e.connection_status],
228
- title: n.disabled_connection_title
229
- };
230
- case m.DISCONNECTED:
231
- return {
232
- main: h(
233
- n.disconnected_connection_description,
234
- e.name
235
- ),
236
- statusName: o.connection_statuses[e.connection_status],
237
- title: n.disconnected_connection_title
238
- };
239
- case m.DISCONTINUED:
240
- return {
241
- main: n.discontinued_connection_description,
242
- statusName: o.connection_statuses[e.connection_status],
243
- title: n.discontinued_connection_title
244
- };
245
- case m.EXPIRED:
246
- return {
247
- cta: n.expired_cta,
248
- main: n.expired_connection_description,
249
- statusName: o.connection_statuses[e.connection_status],
250
- title: n.expired_connection_title
251
- };
252
- case m.FAILED:
253
- return {
254
- main: h(
255
- n.failed_connection_description,
256
- e.name
257
- ),
258
- statusName: o.connection_statuses[e.connection_status],
259
- title: n.failed_connection_title
260
- };
261
- case m.IMPAIRED:
262
- return {
263
- cta: n.impaired_cta,
264
- main: h(
265
- n.impaired_connection_description,
266
- e.name
267
- ),
268
- statusName: o.connection_statuses[e.connection_status],
269
- title: n.impaired_connection_title
270
- };
271
- case m.IMPEDED:
272
- return {
273
- main: h(
274
- n.impeded_connection_description,
275
- e.name,
276
- e.name
277
- ),
278
- statusName: o.connection_statuses[e.connection_status],
279
- title: n.impeded_connection_title
280
- };
281
- case m.IMPORTED:
282
- return {
283
- cta: n.imported_cta,
284
- main: h(
285
- n.imported_connection_description,
286
- e.name
287
- ),
288
- statusName: o.connection_statuses[e.connection_status],
289
- title: n.imported_connection_title
290
- };
291
- case m.LOCKED:
292
- return {
293
- cta: n.locked_cta,
294
- main: h(
295
- n.locked_connection_description,
296
- e.name
297
- ),
298
- statusName: o.connection_statuses[e.connection_status],
299
- title: n.locked_connection_title
300
- };
301
- case m.PREVENTED:
302
- return {
303
- cta: n.prevented_cta,
304
- main: n.prevented_connection_description,
305
- statusName: o.connection_statuses[e.connection_status],
306
- title: n.prevented_connection_title
307
- };
308
- case m.REJECTED:
309
- return {
310
- cta: n.rejected_cta,
311
- main: n.rejected_connection_description,
312
- statusName: o.connection_statuses[e.connection_status],
313
- title: n.rejected_connection_title
314
- };
315
- default: {
316
- const c = () => {
317
- const i = e.successfully_aggregated_at ? lt(e.successfully_aggregated_at) : void 0, d = i && G(i, K.TIME_STAMP_HOUR_MINUTE);
318
- if (d)
319
- return ut(i) ? h(o.last_updated_at, o.today, d) : dt(i) ? h(o.last_updated_at, o.yesterday, d) : h(
320
- o.last_updated_at,
321
- G(i, K.MONTH_DAY_YEAR),
322
- d
323
- );
324
- };
325
- return {
326
- statusName: o.connection_statuses[6],
327
- // Connected
328
- title: c()
329
- };
330
- }
331
- }
332
- }, W = {
333
- color: "background.default",
334
- fontSize: 20,
335
- gridRow: 1,
336
- gridColumn: 1,
337
- zIndex: 2
338
- }, Rt = () => {
339
- const [e, o] = _.useState(!1), {
340
- palette: { mode: n }
341
- } = st(), { selectedMember: c } = D(), { accounts: i, connect: d } = E(), l = tt(c, d), s = Q.includes(c.connection_status) ? {
342
- color: "error.main",
343
- ctaCopy: l.cta ?? "",
344
- icon: /* @__PURE__ */ t(q, { filled: !0, sx: { ...W } }),
345
- mainMessage: l.statusName,
346
- secondaryMessage: `${l.title}.`
347
- } : {
348
- color: "success.main",
349
- icon: /* @__PURE__ */ t(it, { filled: !0, sx: { ...W } }),
350
- mainMessage: l.statusName,
351
- secondaryMessage: l.title
352
- };
353
- return /* @__PURE__ */ u(g, { children: [
354
- /* @__PURE__ */ t(Y, { sx: { mb: 4, mt: 12, mx: 8 }, children: /* @__PURE__ */ t(b, { bold: !0, component: "h2", variant: "XSmall", children: i.connection_status }) }),
355
- /* @__PURE__ */ t(v, { sx: { backgroundColor: "background.paper" }, children: c.is_manual || !s.ctaCopy ? /* @__PURE__ */ u(ct, { alignItems: "center", direction: "row", px: 24, py: 12, children: [
356
- /* @__PURE__ */ t(P, { children: /* @__PURE__ */ t(F, { backingSx: { backgroundColor: s.color, borderRadius: 1 }, size: 32, children: s.icon }) }),
357
- /* @__PURE__ */ t(w, { primary: s.mainMessage, secondary: s.secondaryMessage })
358
- ] }) : /* @__PURE__ */ u(N, { onClick: () => o(!0), children: [
359
- /* @__PURE__ */ t(P, { children: /* @__PURE__ */ t(F, { backingSx: { backgroundColor: s.color, borderRadius: 1 }, size: 32, children: s.icon }) }),
360
- /* @__PURE__ */ t(
361
- w,
362
- {
363
- primary: s.mainMessage,
364
- secondary: s.secondaryMessage && /* @__PURE__ */ u(g, { children: [
365
- s.secondaryMessage,
366
- " ",
367
- /* @__PURE__ */ t(b, { bold: !0, sx: { color: "action.active" }, variant: "XSmall", children: s.ctaCopy })
368
- ] })
369
- }
370
- ),
371
- /* @__PURE__ */ t(k, { name: "chevron_right" })
372
- ] }) }),
373
- /* @__PURE__ */ t(I, { sx: { ml: c.is_manual || !c.institution_url ? 0 : 24 } }),
374
- !c.is_manual && c.institution_url && /* @__PURE__ */ u(g, { children: [
375
- /* @__PURE__ */ t(v, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ u(N, { component: "a", href: c.institution_url, target: "_blank", children: [
376
- /* @__PURE__ */ t(P, { children: /* @__PURE__ */ t(
377
- F,
378
- {
379
- backingSx: {
380
- backgroundColor: n === H.LIGHT ? "grey.300" : "grey.700",
381
- borderRadius: 1
382
- },
383
- size: 32,
384
- children: /* @__PURE__ */ t(
385
- rt,
386
- {
387
- sx: {
388
- ...W,
389
- color: n === H.LIGHT ? "grey.900" : "common.white"
390
- }
391
- }
392
- )
393
- }
394
- ) }),
395
- /* @__PURE__ */ t(w, { primary: c.name, secondary: c.institution_url }),
396
- /* @__PURE__ */ t(k, { name: "launch" })
397
- ] }) }),
398
- /* @__PURE__ */ t(I, {})
399
- ] }),
400
- e && /* @__PURE__ */ t(
401
- Z,
402
- {
403
- loadWidgetProps: { current_member_guid: c.guid },
404
- onClose: () => o(!1),
405
- showConnectWidget: e,
406
- title: i.manage_connection
407
- }
408
- )
409
- ] });
410
- }, Ft = T(Rt), Ut = ({ field: e, isOpen: o, onClose: n }) => {
411
- const { updateAccount: c } = z(), { selectedAccount: i } = D(), { accounts: d } = E(), [l, s] = _.useState(i[e.name]), [r, y] = _.useState(""), [S, a] = _.useState(!0), C = () => {
412
- s(""), y(""), n();
413
- }, A = () => {
414
- switch (e.type) {
415
- case R.Select:
416
- return /* @__PURE__ */ u(gt, { fullWidth: !0, children: [
417
- /* @__PURE__ */ t(Ct, { id: `${e.label}-select-label`, children: e.label }),
418
- /* @__PURE__ */ t(
419
- At,
420
- {
421
- id: `${e.label}-select`,
422
- inputProps: {
423
- sx: {
424
- backgroundColor: "background.paper"
425
- }
426
- },
427
- label: e.label,
428
- labelId: `${e.label}-select-label`,
429
- onChange: (p) => s(p.target.value),
430
- placeholder: e.placeholder,
431
- value: l,
432
- children: e.options?.map((p) => /* @__PURE__ */ t(bt, { value: p.value, children: p.label }, p.value))
433
- }
434
- )
435
- ] });
436
- case R.Currency:
437
- return /* @__PURE__ */ t(
438
- St,
439
- {
440
- amount: l || "",
441
- ariaLabel: e.placeholder,
442
- fullWidth: !0,
443
- label: e.label,
444
- placeholder: e.placeholder,
445
- setAmount: s,
446
- setHasValidInput: a
447
- }
448
- );
449
- case R.Date:
450
- return /* @__PURE__ */ t(ft, { dateAdapter: pt, children: /* @__PURE__ */ t(
451
- ht,
452
- {
453
- maxDate: _t(/* @__PURE__ */ new Date(), 1),
454
- minDate: /* @__PURE__ */ new Date(),
455
- onChange: (p) => {
456
- i[e.name] && Number(i[e.name]) <= 31 ? s(p.getDate()) : s(p);
457
- },
458
- sx: {
459
- "& .MuiPickersDay-today": {
460
- color: "primary.lighter"
461
- },
462
- "& .MuiPickersArrowSwitcher-button": {
463
- color: "primary.lighter",
464
- "&:hover": {
465
- backgroundColor: (p) => mt(p.palette.primary.light, 0.1)
466
- }
467
- }
468
- },
469
- views: ["day"]
470
- }
471
- ) });
472
- default:
473
- return /* @__PURE__ */ t(
474
- Tt,
475
- {
476
- defaultValue: i[e.name],
477
- error: !!r,
478
- fullWidth: !0,
479
- helperText: r,
480
- inputProps: {
481
- "aria-label": e.placeholder
482
- },
483
- onChange: L,
484
- placeholder: e.placeholder
485
- }
486
- );
487
- }
488
- }, x = () => {
489
- i[e.name] !== l && c({
490
- ...i,
491
- [e.name]: l
492
- }), C();
493
- }, L = (p) => {
494
- s(p.target.value), e.validation && y(e.validation(p.target.value));
495
- };
496
- return /* @__PURE__ */ t(
497
- V,
498
- {
499
- copy: {
500
- close_aria: d.close_aria,
501
- title: h(d.edit_field, e.label)
502
- },
503
- disablePrimaryButton: !!r || !S,
504
- isOpen: o,
505
- onClose: C,
506
- onPrimaryAction: x,
507
- primaryText: d.save,
508
- sx: {
509
- "& .MuiButton-root:focus-visible, & .MuiButton-root:focus": {
510
- outline: "2px solid",
511
- outlineColor: "primary.main",
512
- outlineOffset: "2px"
513
- }
514
- },
515
- children: A()
516
- }
517
- );
518
- }, Wt = T(Ut), $t = () => {
519
- const e = window.app?.config, { onEvent: o } = O(), { selectedAccount: n } = D(), { accounts: c } = E(), i = Dt(n, c), d = n.member_is_managed_by_user || !n.member_is_managed_by_user && e.enable_renaming_home_accounts, [l, s] = _.useState(!1), [r, y] = _.useState(i[0]), S = i.filter(
520
- (a) => d || n[a.name] || n[a.name] === 0
521
- );
522
- return /* @__PURE__ */ u(g, { children: [
523
- S.map((a) => {
524
- const C = n[a.name] || n[a.name] === 0, A = S.indexOf(a) === S.length - 1, x = /* @__PURE__ */ t(
525
- w,
526
- {
527
- disableTypography: !0,
528
- primary: /* @__PURE__ */ t(b, { sx: { fontSize: 11 }, children: a.label }),
529
- secondary: /* @__PURE__ */ t(b, { bold: !0, sx: { fontSize: 15 }, children: C ? a.valueFormatter(n[a.name]) : a.placeholder })
530
- }
531
- );
532
- return /* @__PURE__ */ t(_.Fragment, { children: d ? /* @__PURE__ */ u(g, { children: [
533
- /* @__PURE__ */ t(v, { sx: { backgroundColor: "background.paper", px: 0 }, children: /* @__PURE__ */ u(
534
- N,
535
- {
536
- onClick: () => {
537
- y(a), s(!0), a?.event && o(a.event, { account_guid: n.guid });
538
- },
539
- children: [
540
- x,
541
- /* @__PURE__ */ t(k, { name: "chevron_right" })
542
- ]
543
- }
544
- ) }),
545
- /* @__PURE__ */ t(I, { sx: { ml: A ? 0 : 24 } })
546
- ] }) : C && /* @__PURE__ */ u(g, { children: [
547
- /* @__PURE__ */ t(v, { sx: { backgroundColor: "background.paper", px: 24 }, children: x }),
548
- /* @__PURE__ */ t(I, { sx: { ml: A ? 0 : 24 } })
549
- ] }) }, a.name);
550
- }),
551
- l && r && /* @__PURE__ */ t(
552
- Wt,
553
- {
554
- field: r,
555
- isOpen: l,
556
- onClose: () => s(!1)
557
- }
558
- )
559
- ] });
560
- }, Vt = T($t), zt = () => {
561
- const { onEvent: e } = O();
562
- return _.useEffect(() => e(M.ACCOUNT_DETAILS_VIEW), []), /* @__PURE__ */ u($, { children: [
563
- /* @__PURE__ */ t(Vt, {}),
564
- /* @__PURE__ */ t(Ft, {}),
565
- /* @__PURE__ */ t(Pt, {})
566
- ] });
567
- }, Bt = T(zt), Ht = ({ setTabValue: e }) => {
568
- const [o, n] = _.useState(!1), { selectedMember: c } = D(), { accounts: i, connect: d } = E(), l = c.connection_status && Q.includes(c.connection_status);
569
- if (_.useEffect(() => {
570
- l && e(1);
571
- }, [l]), !l) return;
572
- const s = tt(c, d);
573
- return /* @__PURE__ */ u(g, { children: [
574
- /* @__PURE__ */ t(
575
- wt,
576
- {
577
- sx: {
578
- mb: 16,
579
- mt: 24,
580
- mx: 24
581
- },
582
- children: /* @__PURE__ */ u(
583
- Et,
584
- {
585
- icon: /* @__PURE__ */ t(q, { filled: !0 }),
586
- severity: "error",
587
- sx: {
588
- borderLeft: 5,
589
- borderTopLeftRadius: 6,
590
- borderBottomLeftRadius: 6,
591
- borderColor: "error.main",
592
- color: "text.primary",
593
- "&.MuiPaper-root": {
594
- backgroundColor: "background.paper"
595
- }
596
- },
597
- children: [
598
- s.title && /* @__PURE__ */ t(yt, { sx: { fontWeight: 600, marginTop: 2 }, variant: "Body", children: s.title }),
599
- /* @__PURE__ */ t(b, { component: "p", sx: { whiteSpace: "wrap" }, variant: "ParagraphSmall", children: s.main }),
600
- s.cta && /* @__PURE__ */ t(
601
- xt,
602
- {
603
- onClick: () => n(!0),
604
- sx: { fontSize: 15, fontWeight: 600, ml: 0 },
605
- children: s.cta
606
- }
607
- )
608
- ]
609
- }
610
- )
611
- }
612
- ),
613
- o && /* @__PURE__ */ t(
614
- Z,
615
- {
616
- loadWidgetProps: { current_member_guid: c.guid },
617
- onClose: () => n(!1),
618
- showConnectWidget: o,
619
- title: i.manage_connection
620
- }
621
- )
622
- ] });
623
- }, Gt = T(Ht), Kt = () => {
624
- const [e, o] = _.useState(""), { onEvent: n } = O(), { selectedAccount: c } = D(), { accounts: i } = E(), { setFilter: d, sortedTransactions: l } = X(), s = _.useMemo(
625
- () => l.find((r) => r.guid === e),
626
- [e, l]
627
- );
628
- return _.useEffect(() => {
629
- d({
630
- dateRange: { start: Mt(kt(), 90), end: It() },
631
- accounts: [c.guid]
632
- });
633
- }, [c]), _.useEffect(() => n(M.ACCOUNT_DETAILS_VIEW_TRANSACTIONS), []), /* @__PURE__ */ u(g, { children: [
634
- /* @__PURE__ */ t(vt, { onClick: o }),
635
- s && /* @__PURE__ */ t(
636
- J,
637
- {
638
- ariaLabelClose: i.close_drawer,
639
- isOpen: !!e,
640
- onClose: () => o(""),
641
- title: i.transaction_drawer_title,
642
- children: /* @__PURE__ */ t(Lt, { transaction: s })
643
- }
644
- )
645
- ] });
646
- }, jt = T(Kt), Yt = () => {
647
- const [e, o] = _.useState(0), { accounts: n } = E();
648
- return /* @__PURE__ */ u(g, { children: [
649
- /* @__PURE__ */ t(Gt, { setTabValue: o }),
650
- /* @__PURE__ */ u(
651
- nt,
652
- {
653
- "aria-label": n.transactions_and_details_aria,
654
- centered: !0,
655
- onChange: (c, i) => o(i),
656
- textColor: "primary",
657
- value: e,
658
- variant: "fullWidth",
659
- children: [
660
- /* @__PURE__ */ t(
661
- B,
662
- {
663
- "aria-controls": "transaction-details-tabpanel-0",
664
- id: "transaction-details-tab-0",
665
- label: n.transactions
666
- }
667
- ),
668
- /* @__PURE__ */ t(
669
- B,
670
- {
671
- "aria-controls": "account-details-tabpanel-1",
672
- id: "account-details-tab-1",
673
- label: n.account_details
674
- }
675
- )
676
- ]
677
- }
678
- ),
679
- /* @__PURE__ */ t(j, { index: 0, name: "transaction-details", value: e, children: /* @__PURE__ */ t(jt, {}) }),
680
- /* @__PURE__ */ t(j, { index: 1, name: "account-details", value: e, children: /* @__PURE__ */ t(Bt, {}) })
681
- ] });
682
- }, Be = T(Yt);
683
- export {
684
- Be as A,
685
- Nt as u
686
- };