@mx-cartographer/experiences 7.10.21 → 7.10.22

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 (36) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/{AccountStore-yQyWbrio.mjs → AccountStore-Bv74StpR.mjs} +1 -1
  3. package/dist/Analytics-i5h6BxR1.mjs +124 -0
  4. package/dist/{ExportCsvAction-D5PGUKAT.mjs → ExportCsvAction-8uWKc_e2.mjs} +2 -2
  5. package/dist/{ManageIncome-UYZbu_-I.mjs → ManageIncome-C6iolYLZ.mjs} +11 -10
  6. package/dist/{RecurringSettings-D2uU-HNE.mjs → RecurringSettings-CDdjajPZ.mjs} +3 -3
  7. package/dist/{RepeatingTransaction-CIrVdIet.mjs → RecurringTransactions-B_I4_FGO.mjs} +3 -2
  8. package/dist/{RecurringTransactionsStore-BJrH7BJ7.mjs → RecurringTransactionsStore-DAX5ozGz.mjs} +1 -1
  9. package/dist/Transaction-RmKYEKSk.mjs +80 -0
  10. package/dist/TransactionDetails-B9cwOn5s.mjs +1193 -0
  11. package/dist/TransactionList-5JxQV7f6.mjs +204 -0
  12. package/dist/{TransactionStore-BrAMgM2Q.mjs → TransactionStore-B-fc3CsB.mjs} +2 -2
  13. package/dist/User-Bs3hX0dH.mjs +237 -0
  14. package/dist/WidgetContainer-CiyWaTc1.mjs +440 -0
  15. package/dist/accounts/index.es.js +62 -60
  16. package/dist/budgets/index.es.js +25 -23
  17. package/dist/cashflow/index.es.js +25 -24
  18. package/dist/common/index.es.js +165 -163
  19. package/dist/debts/index.es.js +30 -29
  20. package/dist/{exportTransactionsToCSV-DK9U4Lmk.mjs → exportTransactionsToCSV-RUWymyA3.mjs} +5 -5
  21. package/dist/finstrong/index.es.js +5 -5
  22. package/dist/goals/index.es.js +9 -8
  23. package/dist/help/index.es.js +1 -1
  24. package/dist/insights/components/index.d.ts +1 -0
  25. package/dist/insights/index.es.js +1014 -937
  26. package/dist/investments/index.es.js +25 -24
  27. package/dist/networth/index.es.js +41 -40
  28. package/dist/recurringtransactions/index.es.js +34 -33
  29. package/dist/settings/index.es.js +1 -1
  30. package/dist/spending/index.es.js +48 -46
  31. package/dist/transactions/index.es.js +40 -37
  32. package/dist/trends/index.es.js +19 -17
  33. package/package.json +1 -1
  34. package/dist/TransactionDetails-LEP8qGrR.mjs +0 -1375
  35. package/dist/User-CYt9qNY3.mjs +0 -314
  36. package/dist/WidgetContainer-BxRQazKR.mjs +0 -560
@@ -0,0 +1,1193 @@
1
+ import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
+ import _ from "react";
3
+ import { observer as D } from "mobx-react-lite";
4
+ import L from "@mui/material/Box";
5
+ import Q from "@mui/material/Divider";
6
+ import Z from "@mui/material/List";
7
+ import q from "@mui/material/Paper";
8
+ import I from "@mui/material/Stack";
9
+ import { CategoryIcon as _e, CategoryIconVariants as ge, Text as S, Icon as A, IconWeight as b, P as V, useTokens as ae, MerchantLogo as he, TextField as me } from "@mxenabled/mxui";
10
+ import { C as we, a as Le, i as ke } from "./User-Bs3hX0dH.mjs";
11
+ import ne from "@mui/material/Button";
12
+ import Re from "@mui/material/FormGroup";
13
+ import Y from "@mui/material/IconButton";
14
+ import Te from "@mui/material/TextField";
15
+ import { u as ue } from "./useAriaLive-MkYebyUR.mjs";
16
+ import { O as g } from "./Transaction-RmKYEKSk.mjs";
17
+ import { h as E, m as ye, g as v, u as O, b as Pe, o as Ge } from "./hooks-DWJQ4phS.mjs";
18
+ import { A as k } from "./Analytics-i5h6BxR1.mjs";
19
+ import Me from "@mui/material/ToggleButton";
20
+ import Se from "@mui/material/styles/useTheme";
21
+ import { Delete as ee, ChevronRight as Ke, Cancel as te, Search as Be, Edit as $e, Flag as Fe } from "@mxenabled/mx-icons";
22
+ import { fromUnixTime as de } from "date-fns/fromUnixTime";
23
+ import M from "@mui/material/Avatar";
24
+ import R from "@mui/material/ListItem";
25
+ import K from "@mui/material/ListItemAvatar";
26
+ import P from "@mui/material/ListItemText";
27
+ import { f as Ce, D as fe } from "./DateFormats-Cs-NbEZ7.mjs";
28
+ import B from "@mui/material/ListItemButton";
29
+ import $ from "@mui/material/ListItemIcon";
30
+ import { a as Ae } from "./CategorySelectorDrawer-CPIIt1lu.mjs";
31
+ import { u as H } from "./TransactionList-5JxQV7f6.mjs";
32
+ import { D as F } from "./Dialog-BqUCsQvo.mjs";
33
+ import { b as X } from "./Localization-2MODESHW.mjs";
34
+ import { getUnixTime as He } from "date-fns/getUnixTime";
35
+ import { D as re } from "./Drawer-DV4NTsFg.mjs";
36
+ import { f as oe } from "./NumberFormatting-DjTD0t3W.mjs";
37
+ import pe from "@mui/material/InputAdornment";
38
+ import Ue from "@mui/material/Checkbox";
39
+ import ce from "@mui/material/Grid";
40
+ import { C as Xe } from "./CurrencyInput-niY2izw5.mjs";
41
+ import ze from "@mui/material/Switch";
42
+ import { L as Ve } from "./Loader-DUaFpDGv.mjs";
43
+ var W = /* @__PURE__ */ ((t) => (t[t.Category = 0] = "Category", t[t.Date = 1] = "Date", t[t.Memo = 2] = "Memo", t[t.Tags = 3] = "Tags", t))(W || {}), J = /* @__PURE__ */ ((t) => (t[t.SplitTransaction = 0] = "SplitTransaction", t[t.HideTransaction = 1] = "HideTransaction", t[t.MerchantLogo = 2] = "MerchantLogo", t))(J || {});
44
+ const We = [
45
+ 0,
46
+ 1,
47
+ 2,
48
+ 3
49
+ /* Tags */
50
+ ], Ye = [
51
+ 0,
52
+ 1,
53
+ 2
54
+ /* MerchantLogo */
55
+ ], je = ({ transaction: t }) => {
56
+ const { addOrUpdateTransactionRule: o, updateTransaction: l } = E(), { categories: a } = ye(), { onEvent: r } = v(), { setShouldDisableDrawerScroll: n, updateManualTransaction: s } = H(), { transactions: i } = O(), [d, m] = _.useState(!1), [u, p] = _.useState(""), T = async (h) => {
57
+ await l({ ...t, category_guid: u }), h && await o(u, t), p(""), r(k.TRANSACTION_DETAILS_CLICK_CATEGORY, {
58
+ transaction_guid: t.guid
59
+ });
60
+ }, y = (h) => {
61
+ if (t.is_manual && !t.guid) {
62
+ const N = a.find((U) => U.guid === h);
63
+ s({
64
+ ...t,
65
+ category: N?.name,
66
+ category_guid: h,
67
+ top_level_category_guid: N?.parent_guid || h
68
+ });
69
+ } else
70
+ p(h);
71
+ C();
72
+ }, C = () => {
73
+ m(!1), n(!1);
74
+ }, w = _.useMemo(
75
+ () => a.find((h) => h.guid === u),
76
+ [u]
77
+ );
78
+ return /* @__PURE__ */ c(_.Fragment, { children: [
79
+ /* @__PURE__ */ e(R, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ c(
80
+ B,
81
+ {
82
+ onClick: () => {
83
+ r(g.ON_TRANSACTION_CATEGORY_CLICK), m(!0);
84
+ },
85
+ children: [
86
+ /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(M, { sx: { bgcolor: "border.light" }, variant: "rounded", children: /* @__PURE__ */ e(
87
+ _e,
88
+ {
89
+ categoryGuid: t.top_level_category_guid,
90
+ size: 24,
91
+ sx: { color: "text.primary" },
92
+ variant: ge.Transparent
93
+ }
94
+ ) }) }),
95
+ /* @__PURE__ */ e(
96
+ P,
97
+ {
98
+ primary: i.category_title,
99
+ primaryTypographyProps: { variant: "XSmall" },
100
+ secondary: /* @__PURE__ */ e(S, { bold: !0, variant: "Body", children: t.category ?? i.actions_select_a_category })
101
+ }
102
+ ),
103
+ /* @__PURE__ */ e($, { children: /* @__PURE__ */ e(A, { name: "chevron_right", weight: b.Dark }) })
104
+ ]
105
+ }
106
+ ) }),
107
+ /* @__PURE__ */ e(
108
+ Ae,
109
+ {
110
+ initialSelected: t.category_guid,
111
+ onClose: C,
112
+ onSelect: y,
113
+ showDrawer: d,
114
+ title: i.actions_select_a_category
115
+ }
116
+ ),
117
+ /* @__PURE__ */ e(
118
+ F,
119
+ {
120
+ copy: {
121
+ title: X(
122
+ i.actions_apply_to_all_transaction_types,
123
+ t.description
124
+ )
125
+ },
126
+ isOpen: !!u,
127
+ onClose: () => p(""),
128
+ onPrimaryAction: () => T(!0),
129
+ onSecondaryAction: () => T(!1),
130
+ primaryText: i.actions_apply_to_all,
131
+ secondaryText: i.actions_this_time_only,
132
+ children: /* @__PURE__ */ e(V, { variant: "Paragraph", children: X(
133
+ i.actions_all_past_and_future,
134
+ t.description,
135
+ w?.name
136
+ ) })
137
+ }
138
+ )
139
+ ] });
140
+ }, qe = ({ transaction: t }) => {
141
+ const o = ae(), { onEvent: l } = v(), { updateTransaction: a } = E(), { updateManualTransaction: r } = H(), { common: n, transactions: s } = O(), [i, d] = _.useState(!1), [m, u] = _.useState(t.date), p = (y) => {
142
+ u(He(y));
143
+ }, T = async () => {
144
+ if (t.is_manual && !t.guid) {
145
+ r({ ...t, date: m }), d(!1);
146
+ return;
147
+ }
148
+ await a({ ...t, date: m }), l(k.TRANSACTION_DETAILS_CLICK_DATE, { transaction_guid: t.guid }), d(!1);
149
+ };
150
+ return /* @__PURE__ */ c(L, { className: "mx-txn-date-action", children: [
151
+ /* @__PURE__ */ e(R, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ c(
152
+ B,
153
+ {
154
+ onClick: () => {
155
+ l(g.ON_TRANSACTION_DATE_CLICK), d(!0);
156
+ },
157
+ children: [
158
+ /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(M, { sx: { bgcolor: "border.light" }, variant: "rounded", children: /* @__PURE__ */ e(A, { name: "calendar_month", sx: { color: "text.primary" }, weight: b.Dark }) }) }),
159
+ /* @__PURE__ */ e(
160
+ P,
161
+ {
162
+ primary: s.date_title,
163
+ primaryTypographyProps: { variant: "XSmall" },
164
+ secondary: /* @__PURE__ */ e(S, { bold: !0, variant: "Body", children: Ce(de(t.date), fe.YEAR_MONTH_DAY) })
165
+ }
166
+ ),
167
+ /* @__PURE__ */ e($, { children: /* @__PURE__ */ e(A, { name: "chevron_right", weight: b.Dark }) })
168
+ ]
169
+ }
170
+ ) }),
171
+ /* @__PURE__ */ e(
172
+ re,
173
+ {
174
+ ariaLabelClose: n.close_aria,
175
+ isOpen: i,
176
+ onClose: () => d(!1),
177
+ onPrimaryAction: T,
178
+ primaryText: n.save_button,
179
+ secondaryText: n.cancel_button,
180
+ title: s.date_edit_title,
181
+ children: /* @__PURE__ */ e(I, { alignItems: "center", mt: o.Spacing.XXLarge, children: /* @__PURE__ */ e(
182
+ we,
183
+ {
184
+ beginDate: de(m),
185
+ copy: {
186
+ nextAria: s.date_next_aria,
187
+ prevAria: s.date_prev_aria,
188
+ today: n.date_range_picker.today
189
+ },
190
+ onDateSelected: p,
191
+ selectionType: Le.Single
192
+ }
193
+ ) })
194
+ }
195
+ )
196
+ ] });
197
+ }, Je = ({ transaction: t }) => {
198
+ const { onEvent: o } = v(), { removeTransaction: l } = E(), { setShouldDisableDrawerScroll: a } = H(), { common: r, transactions: n } = O(), [s, i] = _.useState(!1), d = async () => {
199
+ await l(t.guid), o(g.ON_TRANSACTION_DELETE_DELETED);
200
+ };
201
+ return /* @__PURE__ */ c(L, { className: "mx-txn-delete", children: [
202
+ t && /* @__PURE__ */ e(R, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ c(
203
+ B,
204
+ {
205
+ onClick: () => {
206
+ o(g.ON_TRANSACTION_DELETE_CLICK), a(!0), i(!0);
207
+ },
208
+ children: [
209
+ /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(M, { variant: "rounded", children: /* @__PURE__ */ e(ee, { color: "secondary", fontSize: "small" }) }) }),
210
+ /* @__PURE__ */ e(
211
+ P,
212
+ {
213
+ primary: n.manual_transaction_delete_title,
214
+ secondary: n.manual_transaction_delete_subtitle
215
+ }
216
+ ),
217
+ /* @__PURE__ */ e($, { children: /* @__PURE__ */ e(ee, {}) })
218
+ ]
219
+ }
220
+ ) }),
221
+ /* @__PURE__ */ e(
222
+ F,
223
+ {
224
+ copy: { title: n.manual_transaction_delete_title },
225
+ isOpen: s,
226
+ onClose: () => {
227
+ a(!1), i(!1);
228
+ },
229
+ onPrimaryAction: d,
230
+ onSecondaryAction: () => o(g.ON_TRANSACTION_DELETE_CANCEL),
231
+ primaryText: r.delete_button,
232
+ secondaryText: r.cancel_button,
233
+ children: /* @__PURE__ */ e(S, { sx: { whiteSpace: "normal" }, variant: "Paragraph", children: n.manual_transaction_delete_description })
234
+ }
235
+ )
236
+ ] });
237
+ }, Qe = D(Je), Ze = ({ transaction: t }) => {
238
+ const { onEvent: o } = v(), { updateTransaction: l } = E(), { setShouldDisableDrawerScroll: a } = H(), { common: r, transactions: n } = O(), [s, i] = _.useState(!1), d = async () => {
239
+ await l({ ...t, merchant_guid: "" }), o(k.TRANSACTION_DETAILS_CLICK_DELETE_LOGO, {
240
+ transaction_guid: t.guid
241
+ });
242
+ };
243
+ return /* @__PURE__ */ c(L, { className: "mx-txn-delete-logo", children: [
244
+ t && /* @__PURE__ */ e(R, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ c(
245
+ B,
246
+ {
247
+ onClick: () => {
248
+ o(g.ON_TRANSACTION_DELETE_LOGO_CLICK), i(!0);
249
+ },
250
+ children: [
251
+ /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(M, { sx: { bgcolor: "border.light" }, variant: "rounded", children: /* @__PURE__ */ e(A, { name: "delete", sx: { color: "text.primary" }, weight: b.Dark }) }) }),
252
+ /* @__PURE__ */ e(P, { primary: n.merchant_logo_title, secondary: n.merchant_logo_desc }),
253
+ /* @__PURE__ */ e($, { children: /* @__PURE__ */ e(A, { name: "chevron_right", weight: b.Dark }) })
254
+ ]
255
+ }
256
+ ) }),
257
+ /* @__PURE__ */ c(
258
+ F,
259
+ {
260
+ copy: { title: n.merchant_logo_modal_title },
261
+ isOpen: s,
262
+ onClose: () => {
263
+ a(!1), i(!1);
264
+ },
265
+ onPrimaryAction: d,
266
+ onSecondaryAction: () => o(g.ON_TRANSACTION_DELETE_LOGO_CANCEL),
267
+ primaryText: r.delete_button,
268
+ secondaryText: r.cancel_button,
269
+ title: n.merchant_logo_modal_title,
270
+ children: [
271
+ /* @__PURE__ */ e(S, { sx: { whiteSpace: "normal" }, variant: "Paragraph", children: n.merchant_logo_modal_desc }),
272
+ /* @__PURE__ */ e(S, { bold: !0, sx: { whiteSpace: "normal" }, variant: "Paragraph", children: ` ${n.merchant_logo_modal_desc_bold}` })
273
+ ]
274
+ }
275
+ )
276
+ ] });
277
+ }, et = D(Ze), tt = ({ transaction: t }) => {
278
+ const { onEvent: o } = v(), { updateTransaction: l } = E(), { setShouldDisableDrawerScroll: a } = H(), { common: r, transactions: n } = O(), [s, i] = _.useState(!1), d = t.is_hidden, m = async () => {
279
+ await l({ ...t, is_hidden: !t.is_hidden }), o(
280
+ d ? g.ON_TRANSACTION_UNHIDDEN : g.ON_TRANSACTION_HIDDEN
281
+ );
282
+ };
283
+ return /* @__PURE__ */ c(L, { className: "mx-txn-hide-transaction", children: [
284
+ t && /* @__PURE__ */ e(R, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ c(
285
+ B,
286
+ {
287
+ "aria-checked": d,
288
+ onClick: () => {
289
+ o(
290
+ d ? g.ON_TRANSACTION_UNHIDE_CLICK : g.ON_TRANSACTION_HIDE_CLICK
291
+ ), o(
292
+ d ? "transaction_details_click_unhide_transaction" : "transaction_details_click_hide_transaction",
293
+ {
294
+ transaction_guid: t.guid
295
+ }
296
+ ), i(!0);
297
+ },
298
+ role: "switch",
299
+ children: [
300
+ /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(M, { sx: { bgcolor: "border.light" }, variant: "rounded", children: d ? /* @__PURE__ */ e(
301
+ A,
302
+ {
303
+ name: "visibilityOff",
304
+ sx: { color: "text.primary" },
305
+ weight: b.Dark
306
+ }
307
+ ) : /* @__PURE__ */ e(A, { name: "visibility", sx: { color: "text.primary" }, weight: b.Dark }) }) }),
308
+ /* @__PURE__ */ e(
309
+ P,
310
+ {
311
+ primary: d ? n.hide_trnx_subtitle_unhide_trnx : n.hide_trnx_subtitle_hide_trnx,
312
+ secondary: d ? n.hide_trnx_desc_unhiding : n.hide_trnx_desc_hiding
313
+ }
314
+ ),
315
+ /* @__PURE__ */ e($, { children: /* @__PURE__ */ e(
316
+ ze,
317
+ {
318
+ checked: d,
319
+ id: "hide-transaction",
320
+ name: "hide-transaction",
321
+ tabIndex: -1
322
+ }
323
+ ) })
324
+ ]
325
+ }
326
+ ) }),
327
+ /* @__PURE__ */ e(
328
+ F,
329
+ {
330
+ copy: {
331
+ title: d ? n.hide_trnx_subtitle_unhide_trnx : n.hide_trnx_subtitle_hide_trnx
332
+ },
333
+ isOpen: s,
334
+ onClose: () => {
335
+ a(!1), i(!1);
336
+ },
337
+ onPrimaryAction: m,
338
+ onSecondaryAction: () => o(
339
+ d ? g.ON_TRANSACTION_UNHIDE_CANCEL_CLICK : g.ON_TRANSACTION_HIDE_CANCEL_CLICK
340
+ ),
341
+ primaryText: d ? r.unhide_button : r.hide_button,
342
+ secondaryText: r.cancel_button,
343
+ children: /* @__PURE__ */ e(S, { truncate: !1, variant: "Paragraph", children: d ? n.hide_trnx_desc_unhiding : n.hide_trnx_desc_hiding })
344
+ }
345
+ )
346
+ ] });
347
+ }, at = D(tt), be = ({ transaction: t }) => {
348
+ const { amount: o, description: l, isIncome: a, merchant_guid: r, payee: n, top_level_category_guid: s } = t;
349
+ return /* @__PURE__ */ c(I, { className: "mx-txn-amount-header", direction: "row", gap: 12, px: 16, py: 24, children: [
350
+ /* @__PURE__ */ e(
351
+ he,
352
+ {
353
+ categoryGuid: s || "",
354
+ merchantGuid: r || "",
355
+ size: 64
356
+ }
357
+ ),
358
+ /* @__PURE__ */ c(I, { overflow: "hidden'", children: [
359
+ /* @__PURE__ */ e(S, { bold: !0, mb: 4, truncate: !0, variant: "Body", children: l || n }),
360
+ /* @__PURE__ */ c(V, { color: a ? "success.main" : "text.primary", truncate: !0, variant: "H1", children: [
361
+ a ? "+" : "",
362
+ oe(o, "0,0.00")
363
+ ] })
364
+ ] })
365
+ ] });
366
+ }, nt = ({ transaction: t }) => {
367
+ const { onEvent: o } = v(), { updateTransaction: l } = E(), { updateManualTransaction: a } = H(), { common: r, transactions: n } = O(), [s, i] = _.useState(!1), [d, m] = _.useState("");
368
+ _.useEffect(() => {
369
+ s && m(t.memo ? t.memo : "");
370
+ }, [s]);
371
+ const u = async () => {
372
+ if (t.is_manual && !t.guid) {
373
+ a({ ...t, memo: d }), i(!1);
374
+ return;
375
+ }
376
+ await l({ ...t, memo: d }), o(k.TRANSACTION_DETAILS_CLICK_MEMO, { transaction_guid: t.guid }), i(!1);
377
+ };
378
+ return /* @__PURE__ */ c("div", { className: "mx-txn-memo-action", children: [
379
+ /* @__PURE__ */ e(R, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ c(
380
+ B,
381
+ {
382
+ onClick: () => {
383
+ o(g.ON_TRANSACTION_MEMO_CLICK), i(!0);
384
+ },
385
+ children: [
386
+ /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(M, { sx: { bgcolor: "border.light" }, variant: "rounded", children: /* @__PURE__ */ e(A, { name: "article", sx: { color: "text.primary" }, weight: b.Dark }) }) }),
387
+ /* @__PURE__ */ e(
388
+ P,
389
+ {
390
+ primary: n.memo_title,
391
+ primaryTypographyProps: { variant: "XSmall" },
392
+ secondary: /* @__PURE__ */ e(
393
+ S,
394
+ {
395
+ bold: !0,
396
+ sx: { overflowWrap: "break-word", whiteSpace: "wrap" },
397
+ variant: "Body",
398
+ children: t.memo ? t.memo : n.memo_desc
399
+ }
400
+ )
401
+ }
402
+ ),
403
+ /* @__PURE__ */ e($, { children: /* @__PURE__ */ e(A, { name: "chevron_right", weight: b.Dark }) })
404
+ ]
405
+ }
406
+ ) }),
407
+ /* @__PURE__ */ c(
408
+ re,
409
+ {
410
+ ariaLabelClose: r.close_aria,
411
+ isOpen: s,
412
+ onClose: () => i(!1),
413
+ onPrimaryAction: u,
414
+ title: n.memo_title,
415
+ children: [
416
+ /* @__PURE__ */ e(be, { transaction: t }),
417
+ /* @__PURE__ */ e(
418
+ Te,
419
+ {
420
+ "aria-label": n.memo_desc_aria,
421
+ focused: !0,
422
+ multiline: !0,
423
+ name: "memo",
424
+ onChange: (p) => m(p.target.value),
425
+ placeholder: n.memo_desc,
426
+ rows: 4,
427
+ sx: { mx: 16, width: "calc(100% - 32px)" },
428
+ value: d
429
+ }
430
+ )
431
+ ]
432
+ }
433
+ )
434
+ ] });
435
+ }, rt = D(nt), ot = ({
436
+ index: t,
437
+ onDeleteRow: o,
438
+ onCategoryChanged: l,
439
+ onUpdateAmount: a,
440
+ split: r
441
+ }) => {
442
+ const n = ae(), { onEvent: s } = v(), { transactions: i } = O(), [d, m] = _.useState(`${r.amount}`), [u, p] = _.useState(!1), T = t === 0, y = (C) => {
443
+ isNaN(Number(C)) || (m(C), a(t, Number(C)));
444
+ };
445
+ return /* @__PURE__ */ c(
446
+ L,
447
+ {
448
+ bgcolor: "background.paper",
449
+ className: "mx-txn-split-manager-row",
450
+ pb: n.Spacing.Tiny,
451
+ px: n.Spacing.XSmall,
452
+ children: [
453
+ /* @__PURE__ */ c(ce, { alignItems: T ? "center" : "start", container: !0, children: [
454
+ /* @__PURE__ */ e(ce, { item: !0, xs: 7, children: /* @__PURE__ */ c(I, { alignItems: "start", children: [
455
+ /* @__PURE__ */ e(
456
+ ne,
457
+ {
458
+ endIcon: /* @__PURE__ */ e(Ke, {}),
459
+ onClick: () => p(!0),
460
+ startIcon: /* @__PURE__ */ e(_e, { categoryGuid: r.top_level_category_guid }),
461
+ sx: { px: n.Spacing.Small, py: n.Spacing.XSmall },
462
+ children: r.category
463
+ }
464
+ ),
465
+ /* @__PURE__ */ e(L, { children: !r.category_guid && /* @__PURE__ */ c(
466
+ I,
467
+ {
468
+ color: "error.main",
469
+ direction: "row",
470
+ gap: n.Spacing.XSmall,
471
+ p: n.Spacing.Small,
472
+ children: [
473
+ /* @__PURE__ */ e("span", { "aria-label": "error", role: "img", children: /* @__PURE__ */ e(te, { sx: { fontSize: n.FontSize.Body } }) }),
474
+ /* @__PURE__ */ e(S, { variant: "Small", children: i.split_transaction_errors_select_category })
475
+ ]
476
+ }
477
+ ) })
478
+ ] }) }),
479
+ /* @__PURE__ */ e(ce, { item: !0, xs: 5, children: T ? /* @__PURE__ */ e("div", { className: "mx-txn-split-manager-row-top-container", children: /* @__PURE__ */ e(S, { children: oe(r.amount, "0,0.00") }) }) : /* @__PURE__ */ c(I, { alignItems: "start", children: [
480
+ /* @__PURE__ */ c(I, { alignItems: "start", direction: "row", gap: n.Spacing.XSmall, children: [
481
+ /* @__PURE__ */ e(
482
+ Xe,
483
+ {
484
+ amount: d,
485
+ ariaLabel: i.split_transaction_edit_split_amount,
486
+ minAmount: 0.01,
487
+ name: "split-amount-input",
488
+ setAmount: y,
489
+ sx: {
490
+ ".MuiOutlinedInput-input": { p: n.Spacing.Small }
491
+ },
492
+ type: "number"
493
+ }
494
+ ),
495
+ /* @__PURE__ */ e(
496
+ Y,
497
+ {
498
+ "aria-label": i.split_transaction_delete_split_btn,
499
+ color: "secondary",
500
+ onClick: () => {
501
+ s(g.ON_TRANSACTION_SPLIT_DELETE_CLICK), o(t);
502
+ },
503
+ sx: { w: 44, h: 44 },
504
+ children: /* @__PURE__ */ e(ee, {})
505
+ }
506
+ )
507
+ ] }),
508
+ !d && /* @__PURE__ */ c(
509
+ I,
510
+ {
511
+ color: "error.main",
512
+ direction: "row",
513
+ gap: n.Spacing.XSmall,
514
+ py: n.Spacing.Small,
515
+ children: [
516
+ /* @__PURE__ */ e("span", { "aria-label": "error", role: "img", children: /* @__PURE__ */ e(te, { sx: { fontSize: n.FontSize.Body } }) }),
517
+ /* @__PURE__ */ e(S, { variant: "Small", children: i.split_transaction_errors_enter_an_amount })
518
+ ]
519
+ }
520
+ )
521
+ ] }) })
522
+ ] }),
523
+ /* @__PURE__ */ e(
524
+ Ae,
525
+ {
526
+ initialSelected: r.category_guid,
527
+ onClose: () => p(!1),
528
+ onSelect: (C) => {
529
+ l(t, C), p(!1);
530
+ },
531
+ showDrawer: u,
532
+ title: i.actions_select_a_category
533
+ }
534
+ )
535
+ ]
536
+ }
537
+ );
538
+ }, it = D(ot), lt = ({
539
+ onAddSplit: t,
540
+ onCategoryChanged: o,
541
+ onDeleteSplit: l,
542
+ onUpdateAmount: a,
543
+ splits: r,
544
+ transaction: n
545
+ }) => {
546
+ const s = ae(), { transactions: i } = O(), { onEvent: d } = v(), [m, u] = _.useState(""), { announce: p, ariaLive: T } = ue();
547
+ return _.useEffect(() => {
548
+ if (r.length <= 1)
549
+ u(i.split_transaction_errors_min_splits), p(i.split_transaction_errors_min_splits);
550
+ else if (r[0].amount < 0) {
551
+ const y = X(
552
+ i.split_transaction_errors_totals_must_equal_amount,
553
+ oe(n.amount, "0,0.00")
554
+ );
555
+ u(y), p(y);
556
+ } else
557
+ u(""), p("");
558
+ }, [r]), /* @__PURE__ */ c(L, { className: "mx-txn-split-manager", children: [
559
+ T,
560
+ r.map((y, C) => /* @__PURE__ */ e(
561
+ it,
562
+ {
563
+ index: C,
564
+ onCategoryChanged: o,
565
+ onDeleteRow: l,
566
+ onUpdateAmount: a,
567
+ split: y
568
+ },
569
+ C
570
+ )),
571
+ m && /* @__PURE__ */ c(
572
+ I,
573
+ {
574
+ color: "error.main",
575
+ direction: "row",
576
+ gap: s.Spacing.XSmall,
577
+ p: s.Spacing.Medium,
578
+ children: [
579
+ /* @__PURE__ */ e("span", { "aria-label": "error", role: "img", children: /* @__PURE__ */ e(te, { sx: { fontSize: s.FontSize.Body } }) }),
580
+ /* @__PURE__ */ e(S, { variant: "Small", children: m })
581
+ ]
582
+ }
583
+ ),
584
+ /* @__PURE__ */ e(L, { p: s.Spacing.Medium, children: /* @__PURE__ */ e(
585
+ ne,
586
+ {
587
+ "aria-label": i.split_transaction_add_split_btn,
588
+ onClick: () => {
589
+ d(g.ON_TRANSACTION_SPLIT_ADD_CLICK), t();
590
+ },
591
+ children: i.split_transaction_add_split_btn
592
+ }
593
+ ) })
594
+ ] });
595
+ }, st = D(lt), ct = ({ transaction: t }) => {
596
+ const { onEvent: o } = v(), { announce: l, ariaLive: a } = ue(), { splitTransaction: r, unSplitTransaction: n } = E(), { common: s, transactions: i } = O(), { setShouldDisableDrawerScroll: d } = H(), { categories: m } = ye(), u = {
597
+ ...t,
598
+ amount: t.amount - 1,
599
+ guid: "",
600
+ has_been_split: !1,
601
+ parent_guid: t.guid
602
+ }, p = {
603
+ ...t,
604
+ amount: 1,
605
+ category_guid: void 0,
606
+ category: i.split_transaction_select_category_btn,
607
+ guid: "",
608
+ has_been_split: !1,
609
+ parent_guid: t.guid,
610
+ top_level_category_guid: void 0
611
+ }, [T, y] = _.useState(!1), [C, w] = _.useState(!1), [h, N] = _.useState([]), U = () => {
612
+ const f = [...h];
613
+ f.push({ ...p }), f[0].amount -= 1, N(f), l(
614
+ X(
615
+ i.split_transaction_add_split_announcement,
616
+ f.length
617
+ )
618
+ );
619
+ }, ie = (f) => {
620
+ if (f > 0) {
621
+ const G = h[f], x = [...h];
622
+ x.splice(f, 1), x[0].amount += G.amount, N(x), l(
623
+ X(i.split_transaction_delete_split_announcement, f + 1)
624
+ );
625
+ }
626
+ }, le = (f, G) => {
627
+ const x = [...h];
628
+ x[f].amount = G, x[0].amount = t.amount - x.reduce(
629
+ (z, se, Ee) => z + (Ee !== 0 ? se.amount : 0),
630
+ 0
631
+ ), N(x);
632
+ }, Ne = (f, G) => {
633
+ const x = [...h], z = m.find((se) => se.guid === G);
634
+ z && (x[f] = {
635
+ ...x[f],
636
+ category_guid: G,
637
+ category: z.name,
638
+ top_level_category_guid: z.parent_guid || G
639
+ }, N(x), l(
640
+ X(
641
+ i.split_transaction_select_category_announcement,
642
+ z.name,
643
+ f + 1
644
+ )
645
+ ));
646
+ }, xe = () => {
647
+ if (t.parent_guid || t.has_been_split) {
648
+ w(!0);
649
+ return;
650
+ }
651
+ N([{ ...u }, { ...p }]), o(k.TRANSACTION_DETAILS_CLICK_SPLIT, {
652
+ transaction_guid: t.guid
653
+ }), y(!0);
654
+ }, Ie = async () => {
655
+ o(g.ON_TRANSACTION_SPLIT_SAVE_CLICK), await r({ ...t, has_been_split: !0 }, h), y(!1);
656
+ }, De = async () => {
657
+ o(g.ON_TRANSACTION_SPLIT_CANCEL_CLICK), N([{ ...u }, { ...p }]), y(!1);
658
+ }, Oe = async () => {
659
+ o(k.TRANSACTION_DETAILS_CLICK_UNSPLIT, {
660
+ transaction_guid: t.guid
661
+ });
662
+ const f = t.parent_guid ?? t.guid;
663
+ await n(f);
664
+ }, ve = _.useMemo(() => {
665
+ const f = h.some((x) => !x.category_guid), G = h.some((x) => x.amount <= 0);
666
+ return f || G;
667
+ }, [h]);
668
+ return /* @__PURE__ */ c(_.Fragment, { children: [
669
+ t && /* @__PURE__ */ e(R, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ c(B, { onClick: xe, children: [
670
+ /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(M, { sx: { bgcolor: "border.light" }, variant: "rounded", children: /* @__PURE__ */ e(A, { name: "call_split", sx: { color: "text.primary" }, weight: b.Dark }) }) }),
671
+ /* @__PURE__ */ e(
672
+ P,
673
+ {
674
+ primary: t.has_been_split || t.parent_guid ? i.split_transaction_unsplit_title : i.split_transaction_title,
675
+ secondary: t.has_been_split || t.parent_guid ? i.split_transaction_unsplit_subtitle : i.split_transaction_desc
676
+ }
677
+ ),
678
+ /* @__PURE__ */ e($, { children: t.has_been_split || t.parent_guid ? /* @__PURE__ */ e(A, { name: "delete", weight: b.Dark }) : /* @__PURE__ */ e(A, { name: "chevron_right", weight: b.Dark }) })
679
+ ] }) }),
680
+ /* @__PURE__ */ c(
681
+ re,
682
+ {
683
+ ariaLabelClose: s.close_aria,
684
+ isOpen: T,
685
+ isPrimaryDisabled: ve,
686
+ onClose: De,
687
+ onPrimaryAction: Ie,
688
+ primaryText: s.save_button,
689
+ secondaryText: s.cancel_button,
690
+ title: i.split_transaction_title,
691
+ children: [
692
+ a,
693
+ /* @__PURE__ */ e(be, { transaction: t }),
694
+ /* @__PURE__ */ e(
695
+ st,
696
+ {
697
+ onAddSplit: U,
698
+ onCategoryChanged: Ne,
699
+ onDeleteSplit: ie,
700
+ onUpdateAmount: le,
701
+ splits: h,
702
+ transaction: t
703
+ }
704
+ )
705
+ ]
706
+ }
707
+ ),
708
+ /* @__PURE__ */ e(
709
+ F,
710
+ {
711
+ copy: { title: i.split_transaction_unsplit_title },
712
+ isOpen: C,
713
+ onClose: () => {
714
+ d(!1), w(!1);
715
+ },
716
+ onPrimaryAction: Oe,
717
+ onSecondaryAction: () => {
718
+ o(g.ON_TRANSACTION_UNSPLIT_CANCEL);
719
+ },
720
+ primaryText: s.delete_button,
721
+ secondaryText: s.cancel_button,
722
+ children: /* @__PURE__ */ e(V, { variant: "Paragraph", children: X(
723
+ i.split_transaction_unsplit_description,
724
+ t.description
725
+ ) })
726
+ }
727
+ )
728
+ ] });
729
+ }, dt = D(ct), _t = () => {
730
+ const t = Se(), { onEvent: o } = v(), { addTag: l } = E(), { transactions: a } = O(), [r, n] = _.useState(!1), [s, i] = _.useState(""), [d, m] = _.useState(""), u = _.useRef(null);
731
+ _.useEffect(() => {
732
+ r && u?.current?.focus();
733
+ }, [r]);
734
+ const p = () => {
735
+ o(
736
+ r ? g.ON_TRANSACTION_TAGS_TAG_ADD_CANCEL_CLICK : g.ON_TRANSACTION_TAGS_TAG_ADD_CLICK
737
+ ), r || i(""), n(!r);
738
+ }, T = async () => {
739
+ o(g.ON_TRANSACTION_TAGS_TAG_ADDED), await l(s), n(!1);
740
+ };
741
+ return _.useEffect(() => {
742
+ m(s.length > 40 ? a.tags_error_name_must_be_40_chars : "");
743
+ }, [s]), /* @__PURE__ */ c(L, { className: "mx-txn-tag-manager-header", children: [
744
+ /* @__PURE__ */ c(
745
+ I,
746
+ {
747
+ alignItems: "center",
748
+ bgcolor: t.palette.background.default,
749
+ direction: "row",
750
+ justifyContent: "space-between",
751
+ px: 24,
752
+ py: 16,
753
+ children: [
754
+ /* @__PURE__ */ e(S, { bold: !0, children: a.tags_your_tags }),
755
+ /* @__PURE__ */ e(
756
+ ne,
757
+ {
758
+ "aria-expanded": r,
759
+ "aria-label": a.tags_add_tag_btn_aria,
760
+ onClick: p,
761
+ children: a.tags_add_tag_btn
762
+ }
763
+ )
764
+ ]
765
+ }
766
+ ),
767
+ /* @__PURE__ */ c(
768
+ F,
769
+ {
770
+ copy: { title: a.tags_add_tag_btn },
771
+ isOpen: r,
772
+ onClose: () => n(!1),
773
+ onPrimaryAction: T,
774
+ onSecondaryAction: () => n(!1),
775
+ children: [
776
+ /* @__PURE__ */ e(
777
+ me,
778
+ {
779
+ "aria-label": a.tags_placeholder,
780
+ name: "add-tag",
781
+ onChange: (y) => i(y.target.value),
782
+ placeholder: a.tags_placeholder,
783
+ sx: { width: "100%" },
784
+ value: s
785
+ }
786
+ ),
787
+ /* @__PURE__ */ e(V, { id: "add-tag-error", sx: { color: "error.main" }, variant: "ParagraphSmall", children: d })
788
+ ]
789
+ }
790
+ )
791
+ ] });
792
+ }, mt = D(_t), ut = ({ onSearchValueChanged: t, searchValue: o }) => {
793
+ const { common: l, transactions: a } = O(), r = ae(), n = /* @__PURE__ */ e(
794
+ Y,
795
+ {
796
+ "aria-label": a.tags_cancel_search || "Search",
797
+ onClick: () => t(""),
798
+ children: /* @__PURE__ */ e(te, {})
799
+ }
800
+ );
801
+ return /* @__PURE__ */ e(L, { className: "mx-txn-tag-manager-search", px: r.Spacing.Large, py: r.Spacing.Medium, children: /* @__PURE__ */ e(
802
+ me,
803
+ {
804
+ InputProps: {
805
+ startAdornment: /* @__PURE__ */ e(pe, { position: "start", children: /* @__PURE__ */ e(Be, { color: "disabled" }) }),
806
+ endAdornment: /* @__PURE__ */ e(pe, { position: "end", sx: { padding: 0 }, children: o ? n : null })
807
+ },
808
+ "aria-label": l.search_aria,
809
+ name: "search",
810
+ onChange: (s) => t(s.target.value),
811
+ placeholder: l.search_placeholder,
812
+ sx: { bgcolor: "background.paper", width: "100%" },
813
+ value: o
814
+ }
815
+ ) });
816
+ }, pt = D(ut), gt = ({ onTagChecked: t, selectedTags: o, tag: l }) => {
817
+ const { onEvent: a } = v(), { removeTag: r, updateTag: n } = E(), { common: s, transactions: i } = O(), [d, m] = _.useState(!1), [u, p] = _.useState(!1), [T, y] = _.useState(""), [C, w] = _.useState(""), h = async () => {
818
+ a(g.ON_TRANSACTION_TAGS_TAG_EDIT_SAVED), l && await n({ ...l, name: T }), m(!1);
819
+ }, N = async () => {
820
+ a(g.ON_TRANSACTION_TAGS_TAG_DELETED), await r(l.guid), p(!1);
821
+ };
822
+ _.useEffect(() => {
823
+ w(T.length > 40 ? i.tags_error_name_must_be_40_chars : "");
824
+ }, [T]);
825
+ const U = () => {
826
+ a(g.ON_TRANSACTION_TAGS_TAG_EDIT_CLICK), y(l.name), m(!0);
827
+ }, ie = () => {
828
+ a(g.ON_TRANSACTION_TAGS_TAG_DELETE_CLICK), p(!0);
829
+ };
830
+ return /* @__PURE__ */ c(
831
+ R,
832
+ {
833
+ className: "mx-txn-transaction-manager-row",
834
+ disableGutters: !0,
835
+ disablePadding: !0,
836
+ secondaryAction: !l.is_default_tag && /* @__PURE__ */ c(I, { direction: "row", children: [
837
+ /* @__PURE__ */ e(
838
+ Y,
839
+ {
840
+ "aria-label": `Edit ${l.name} tag`,
841
+ color: "secondary",
842
+ onClick: U,
843
+ children: /* @__PURE__ */ e($e, { color: "secondary" })
844
+ }
845
+ ),
846
+ /* @__PURE__ */ e(
847
+ Y,
848
+ {
849
+ "aria-label": `Delete ${l.name} tag`,
850
+ color: "secondary",
851
+ onClick: ie,
852
+ children: /* @__PURE__ */ e(ee, { color: "secondary" })
853
+ }
854
+ )
855
+ ] }),
856
+ children: [
857
+ /* @__PURE__ */ c(
858
+ B,
859
+ {
860
+ "aria-checked": o.includes(l.guid),
861
+ onClick: () => t(l.guid),
862
+ role: "checkbox",
863
+ children: [
864
+ /* @__PURE__ */ e($, { sx: { ml: 0 }, children: /* @__PURE__ */ e(Ue, { checked: o.includes(l.guid), edge: "start", tabIndex: -1 }) }),
865
+ /* @__PURE__ */ e(P, { children: l.name })
866
+ ]
867
+ }
868
+ ),
869
+ /* @__PURE__ */ c(
870
+ F,
871
+ {
872
+ copy: { title: "Update tag name" },
873
+ isOpen: d,
874
+ onClose: () => m(!1),
875
+ onPrimaryAction: h,
876
+ onSecondaryAction: () => m(!1),
877
+ children: [
878
+ /* @__PURE__ */ e(
879
+ me,
880
+ {
881
+ "aria-describedby": C ? "update-tag-error" : void 0,
882
+ "aria-label": i.tags_update_the_tag_name,
883
+ name: "update-tag",
884
+ onChange: (le) => y(le.target.value),
885
+ placeholder: "Tag name",
886
+ sx: { width: "100%" },
887
+ value: T
888
+ }
889
+ ),
890
+ /* @__PURE__ */ e(V, { id: "update-tag-error", sx: { color: "error.main" }, variant: "ParagraphSmall", children: C })
891
+ ]
892
+ }
893
+ ),
894
+ /* @__PURE__ */ e(
895
+ F,
896
+ {
897
+ copy: { title: i.tags_delete_title },
898
+ isOpen: u,
899
+ onClose: () => p(!1),
900
+ onPrimaryAction: N,
901
+ onSecondaryAction: () => a(g.ON_TRANSACTION_TAGS_TAG_DELETE_CANCEL_CLICK),
902
+ primaryText: s.delete_button,
903
+ secondaryText: s.cancel_button,
904
+ children: /* @__PURE__ */ e(S, { truncate: !1, children: i.tags_deleting_this_tag_will_remove_it })
905
+ }
906
+ )
907
+ ]
908
+ }
909
+ );
910
+ }, ht = D(gt), Tt = ({ selectedTags: t, onTagChecked: o }) => {
911
+ const { tags: l } = E(), [a, r] = _.useState(""), n = l.filter(
912
+ (s) => s.name.toLowerCase().includes(a.toLowerCase())
913
+ );
914
+ return /* @__PURE__ */ c("div", { className: "mx-txn-tag-manager", children: [
915
+ /* @__PURE__ */ e(
916
+ pt,
917
+ {
918
+ onSearchValueChanged: (s) => r(s),
919
+ searchValue: a
920
+ }
921
+ ),
922
+ /* @__PURE__ */ e(mt, {}),
923
+ /* @__PURE__ */ e(q, { sx: { boxShadow: "none" }, children: /* @__PURE__ */ e(Z, { children: n.map((s) => /* @__PURE__ */ c(_.Fragment, { children: [
924
+ /* @__PURE__ */ e(ht, { onTagChecked: o, selectedTags: t, tag: s }),
925
+ /* @__PURE__ */ e(Q, { sx: { ml: 24 } })
926
+ ] }, s.guid)) }) })
927
+ ] });
928
+ }, yt = D(Tt), St = ({ transaction: t }) => {
929
+ const { onEvent: o } = v(), { tags: l, updateTaggings: a, updateTransaction: r } = E(), { common: n, transactions: s } = O(), { updateManualTransaction: i } = H(), [d, m] = _.useState(!1), [u, p] = _.useState(t.tags);
930
+ _.useEffect(() => {
931
+ p(t.tags);
932
+ }, [d, t]);
933
+ const T = (w) => {
934
+ const h = [...u], N = u.indexOf(w);
935
+ N >= 0 ? h.splice(N, 1) : h.push(w), p(h);
936
+ }, y = async () => {
937
+ if (t.is_manual && !t.guid) {
938
+ i({ ...t, tags: u }), m(!1);
939
+ return;
940
+ }
941
+ await a(u, t.guid), await r({ ...t, tags: u }), o(k.TRANSACTION_DETAILS_CLICK_TAGS, { transaction_guid: t.guid }), m(!1);
942
+ }, C = _.useMemo(
943
+ () => t.tags.map(
944
+ (w, h, N) => `${l.find((U) => U.guid === w)?.name}${h < N.length - 1 ? " / " : ""}`
945
+ ),
946
+ [l, t]
947
+ );
948
+ return /* @__PURE__ */ c(_.Fragment, { children: [
949
+ /* @__PURE__ */ e(R, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ c(
950
+ B,
951
+ {
952
+ onClick: () => {
953
+ o(g.ON_TRANSACTION_TAGS_CLICK), m(!0);
954
+ },
955
+ children: [
956
+ /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(M, { sx: { bgcolor: "border.light" }, variant: "rounded", children: /* @__PURE__ */ e(A, { name: "local_offer", sx: { color: "text.primary" }, weight: b.Dark }) }) }),
957
+ /* @__PURE__ */ e(
958
+ P,
959
+ {
960
+ primary: s.tags_title,
961
+ primaryTypographyProps: { variant: "XSmall" },
962
+ secondary: /* @__PURE__ */ e(S, { bold: !0, variant: "Body", children: t.tags?.length > 0 ? C : s.tags_desc })
963
+ }
964
+ ),
965
+ /* @__PURE__ */ e($, { children: /* @__PURE__ */ e(A, { name: "chevron_right", weight: b.Dark }) })
966
+ ]
967
+ }
968
+ ) }),
969
+ /* @__PURE__ */ e(
970
+ re,
971
+ {
972
+ ariaLabelClose: n.close_aria,
973
+ isOpen: d,
974
+ onClose: () => m(!1),
975
+ onPrimaryAction: y,
976
+ primaryText: n.save_button,
977
+ secondaryText: n.cancel_button,
978
+ title: s.tags_title,
979
+ children: /* @__PURE__ */ e(yt, { onTagChecked: T, selectedTags: u })
980
+ }
981
+ )
982
+ ] });
983
+ }, Ct = D(St), ft = ({ transaction: t, viewOnly: o = !1 }) => {
984
+ const { updateTransaction: l } = E(), { common: a, transactions: r } = O(), { onEvent: n } = v(), { announce: s, ariaLive: i } = ue(), [d, m] = _.useState(!1), [u, p] = _.useState(""), T = _.useRef(null);
985
+ _.useEffect(() => {
986
+ d && (p(t.description), T?.current?.focus());
987
+ }, [d]);
988
+ const y = () => {
989
+ m(!0), n(g.ON_TRANSACTION_DESCRIPTION_EDIT_CLICK), setTimeout(() => document.getElementById("transaction-description-input")?.focus(), 0);
990
+ }, C = async () => {
991
+ n(k.TRANSACTION_DETAILS_CLICK_DESCRIPTION, {
992
+ transaction_guid: t.guid
993
+ }), await l({ ...t, description: u }), m(!1), s(`${r.payee_title}: ${u}`), setTimeout(() => document.getElementById("transaction-description-edit-button")?.focus(), 0);
994
+ };
995
+ return /* @__PURE__ */ c(L, { className: "mx-txn-transaction-description", children: [
996
+ i,
997
+ d ? /* @__PURE__ */ c(Re, { row: !0, children: [
998
+ /* @__PURE__ */ e(
999
+ Te,
1000
+ {
1001
+ "aria-label": r.payee_title,
1002
+ id: "transaction-description-input",
1003
+ label: r.payee_title,
1004
+ name: r.payee_title,
1005
+ onChange: (w) => p(w.target.value),
1006
+ ref: T,
1007
+ sx: {
1008
+ backgroundColor: "background.paper",
1009
+ ".MuiOutlinedInput-root": { borderTopRightRadius: 0, borderBottomRightRadius: 0 },
1010
+ ".MuiOutlinedInput-input": { p: 11 },
1011
+ width: 250
1012
+ },
1013
+ value: u
1014
+ }
1015
+ ),
1016
+ /* @__PURE__ */ e(
1017
+ ne,
1018
+ {
1019
+ disabled: !u,
1020
+ onClick: C,
1021
+ sx: {
1022
+ borderTopLeftRadius: 0,
1023
+ borderBottomLeftRadius: 0
1024
+ },
1025
+ variant: "outlined",
1026
+ children: a.save_button
1027
+ }
1028
+ )
1029
+ ] }) : /* @__PURE__ */ c(I, { alignItems: "center", direction: "row", gap: 4, sx: { minHeight: 44 }, children: [
1030
+ /* @__PURE__ */ e(S, { bold: !0, children: t.description }),
1031
+ !o && /* @__PURE__ */ e(
1032
+ Y,
1033
+ {
1034
+ "aria-label": r.payee_edit,
1035
+ id: "transaction-description-edit-button",
1036
+ onClick: y,
1037
+ sx: { color: "action.active" },
1038
+ children: /* @__PURE__ */ e(A, { name: "create", size: 22 })
1039
+ }
1040
+ )
1041
+ ] })
1042
+ ] });
1043
+ }, At = D(ft), bt = ({ transaction: t }) => {
1044
+ const { updateTransaction: o } = E(), { transactions: l } = O(), { onEvent: a } = v(), r = Se(), n = async () => {
1045
+ a(k.TRANSACTION_DETAILS_CLICK_FLAG, { transaction_guid: t.guid }), await o({ ...t, is_flagged: !t.is_flagged });
1046
+ };
1047
+ return /* @__PURE__ */ e("div", { className: "mx-txn-transaction-flag", children: /* @__PURE__ */ e(
1048
+ Me,
1049
+ {
1050
+ "aria-label": l.flag_btn_aria,
1051
+ "aria-pressed": t.is_flagged,
1052
+ color: "warning",
1053
+ onClick: n,
1054
+ selected: t.is_flagged,
1055
+ sx: {
1056
+ borderRadius: 6,
1057
+ color: r.palette.secondary.main,
1058
+ "&.Mui-selected": {
1059
+ color: r.palette.common.white,
1060
+ backgroundColor: r.palette.warning.dark,
1061
+ ":hover": {
1062
+ color: r.palette.common.white,
1063
+ backgroundColor: r.palette.warning.main
1064
+ }
1065
+ },
1066
+ ":hover": {
1067
+ color: r.palette.warning.contrastText,
1068
+ backgroundColor: r.palette.warning.light
1069
+ }
1070
+ },
1071
+ value: "flagged",
1072
+ children: /* @__PURE__ */ e(Fe, { color: "inherit" })
1073
+ }
1074
+ ) });
1075
+ }, Nt = D(bt), j = (t, o, l, a = !0, r = "inset") => a ? /* @__PURE__ */ c(_.Fragment, { children: [
1076
+ /* @__PURE__ */ c(R, { disableGutters: !0, disablePadding: !0, children: [
1077
+ /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(M, { sx: { bgcolor: "border.light" }, variant: "rounded", children: t }) }),
1078
+ /* @__PURE__ */ e(
1079
+ P,
1080
+ {
1081
+ primary: o,
1082
+ primaryTypographyProps: { variant: "XSmall" },
1083
+ secondary: l
1084
+ }
1085
+ )
1086
+ ] }),
1087
+ /* @__PURE__ */ e(Q, { variant: r })
1088
+ ] }) : null, xt = ({ transaction: t }) => {
1089
+ const { transactions: o } = O(), { tags: l } = E(), a = _.useMemo(() => {
1090
+ const r = new Map(l.map((n) => [n.guid, n.name]));
1091
+ return t.tags.map((n) => r.get(n)).filter(Boolean).join(" / ");
1092
+ }, [l, t.tags]);
1093
+ return /* @__PURE__ */ c(Z, { sx: { "& .MuiListItem-root": { px: 24, py: 12 } }, children: [
1094
+ j(
1095
+ /* @__PURE__ */ e(
1096
+ _e,
1097
+ {
1098
+ categoryGuid: t.top_level_category_guid,
1099
+ size: 24,
1100
+ sx: { color: "text.primary" },
1101
+ variant: ge.Transparent
1102
+ }
1103
+ ),
1104
+ o.category_title,
1105
+ /* @__PURE__ */ e(S, { bold: !0, variant: "Body", children: t.category ?? o.actions_select_a_category })
1106
+ ),
1107
+ j(
1108
+ /* @__PURE__ */ e(A, { name: "calendar_month", sx: { color: "text.primary" }, weight: b.Dark }),
1109
+ o.date_title,
1110
+ /* @__PURE__ */ e(S, { bold: !0, variant: "Body", children: Ce(de(t.date), fe.YEAR_MONTH_DAY) })
1111
+ ),
1112
+ j(
1113
+ /* @__PURE__ */ e(A, { name: "article", sx: { color: "text.primary" }, weight: b.Dark }),
1114
+ o.memo_title,
1115
+ /* @__PURE__ */ e(S, { bold: !0, sx: { overflowWrap: "break-word", whiteSpace: "wrap" }, variant: "Body", children: t.memo ?? o.memo_desc }),
1116
+ !!t.memo,
1117
+ t.tags?.length > 0 ? "inset" : "fullWidth"
1118
+ ),
1119
+ j(
1120
+ /* @__PURE__ */ e(A, { name: "local_offer", sx: { color: "text.primary" }, weight: b.Dark }),
1121
+ o.tags_title,
1122
+ /* @__PURE__ */ e(S, { bold: !0, variant: "Body", children: t.tags?.length ? a : o.tags_desc }),
1123
+ !!t.tags?.length,
1124
+ "fullWidth"
1125
+ )
1126
+ ] });
1127
+ }, It = D(xt), Dt = ({
1128
+ bottomActions: t = Ye,
1129
+ canFlagTransaction: o = !0,
1130
+ topActions: l = We,
1131
+ transaction: a
1132
+ }) => {
1133
+ const { onEvent: r } = v(), { isCopyLoaded: n } = Pe(), { userFeatures: s } = Ge(), i = a?.number && a.number.length > 4;
1134
+ if (_.useEffect(
1135
+ () => r(k.TRANSACTION_DETAILS_VIEW, { transaction_guid: a.guid }),
1136
+ []
1137
+ ), !n)
1138
+ return /* @__PURE__ */ e(Ve, {});
1139
+ const d = ke(s, "MX_TXN_DETAILS_VIEW_ONLY");
1140
+ return /* @__PURE__ */ e(L, { className: "mx-txn-transaction-details", width: "100%", children: a && /* @__PURE__ */ c(I, { children: [
1141
+ /* @__PURE__ */ c(I, { gap: 12, p: 24, children: [
1142
+ /* @__PURE__ */ e(q, { elevation: 2, sx: { width: 64 }, children: /* @__PURE__ */ e(
1143
+ he,
1144
+ {
1145
+ categoryGuid: a.top_level_category_guid || "",
1146
+ merchantGuid: a.merchant_guid || "",
1147
+ size: 64
1148
+ }
1149
+ ) }),
1150
+ /* @__PURE__ */ e(At, { transaction: a, viewOnly: d }),
1151
+ /* @__PURE__ */ c(I, { direction: "row", justifyContent: "space-between", sx: { minHeight: 44 }, children: [
1152
+ /* @__PURE__ */ c(V, { color: a.isIncome ? "success.main" : "text.primary", variant: "H1", children: [
1153
+ a.isIncome ? "+" : "",
1154
+ oe(a.amount, "0,0.00")
1155
+ ] }),
1156
+ !d && o && /* @__PURE__ */ e(Nt, { transaction: a })
1157
+ ] }),
1158
+ /* @__PURE__ */ c(I, { bgcolor: "background.highlight", borderRadius: "12px", gap: 4, p: 8, children: [
1159
+ /* @__PURE__ */ e(S, { bold: !0, children: `${a.account}
1160
+ ${i ? a.number : "•".repeat(4).concat(a.number ?? "")}` }),
1161
+ /* @__PURE__ */ e(S, { bold: !0, color: "secondary", variant: "Tiny", children: a.feed_description })
1162
+ ] })
1163
+ ] }),
1164
+ /* @__PURE__ */ e(q, { square: !0, sx: { boxShadow: "none" }, children: d ? /* @__PURE__ */ e(It, { transaction: a }) : /* @__PURE__ */ e(Z, { children: l.map((m, u) => /* @__PURE__ */ c(_.Fragment, { children: [
1165
+ m === W.Category && /* @__PURE__ */ e(je, { transaction: a }),
1166
+ m === W.Date && /* @__PURE__ */ e(qe, { transaction: a }),
1167
+ m === W.Memo && /* @__PURE__ */ e(rt, { transaction: a }),
1168
+ m === W.Tags && /* @__PURE__ */ e(Ct, { transaction: a }),
1169
+ /* @__PURE__ */ e(Q, { variant: u < l.length - 1 ? "inset" : "fullWidth" })
1170
+ ] }, m)) }) }),
1171
+ !d && t.length > 0 && /* @__PURE__ */ c(_.Fragment, { children: [
1172
+ /* @__PURE__ */ e(S, { bold: !0, mb: 8, ml: 26, mt: 16, variant: "Body", children: "Actions" }),
1173
+ /* @__PURE__ */ e(q, { square: !0, sx: { boxShadow: "none" }, children: /* @__PURE__ */ c(Z, { children: [
1174
+ t.map((m, u) => /* @__PURE__ */ c(_.Fragment, { children: [
1175
+ m === J.SplitTransaction && /* @__PURE__ */ e(dt, { transaction: a }),
1176
+ m === J.HideTransaction && /* @__PURE__ */ e(at, { transaction: a }),
1177
+ m === J.MerchantLogo && /* @__PURE__ */ e(et, { transaction: a }),
1178
+ /* @__PURE__ */ e(Q, { variant: u < t.length - 1 ? "inset" : "fullWidth" })
1179
+ ] }, m)),
1180
+ a.is_manual && !a.parent_guid && !a.has_been_split && /* @__PURE__ */ e(Qe, { transaction: a })
1181
+ ] }) })
1182
+ ] })
1183
+ ] }) });
1184
+ }, ha = D(Dt);
1185
+ export {
1186
+ J as B,
1187
+ je as C,
1188
+ qe as D,
1189
+ rt as M,
1190
+ ha as T,
1191
+ Ct as a,
1192
+ W as b
1193
+ };