@mx-cartographer/experiences 7.10.30 → 7.10.32

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