@mx-cartographer/experiences 7.11.5 → 7.11.7

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