@mx-cartographer/experiences 7.13.6 → 7.13.8
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.
- package/CHANGELOG.md +8 -0
- package/dist/{ManageIncome-CYQVQmjx.mjs → ManageIncome-XrztG-9d.mjs} +1 -1
- package/dist/{RecurringSettings-BoMIzZGw.mjs → RecurringSettings-O2PM8MWW.mjs} +1 -1
- package/dist/{TransactionDetails-C9DVd4nm.mjs → TransactionDetails-CkQxd3Ao.mjs} +295 -293
- package/dist/accounts/index.es.js +1 -1
- package/dist/budgets/components/BudgetDetailsDrawerV2.d.ts +3 -1
- package/dist/budgets/index.es.js +659 -654
- package/dist/cashflow/index.es.js +2 -2
- package/dist/finstrong/index.es.js +2 -2
- package/dist/insights/index.es.js +1 -1
- package/dist/recurringtransactions/index.es.js +4 -4
- package/dist/spending/index.es.js +1 -1
- package/dist/transactions/index.es.js +2 -2
- package/dist/trends/index.es.js +1 -1
- package/package.json +1 -1
|
@@ -11,11 +11,11 @@ import { P as j, Text as x, H2 as Be, MerchantLogo as Ne, Toast as $e, CategoryI
|
|
|
11
11
|
import { g as Ke, C as Fe, a as He, b as Ue, i as Ve } from "./BudgetUtil-CLhRnCoX.mjs";
|
|
12
12
|
import oe from "@mui/material/Button";
|
|
13
13
|
import We from "@mui/material/FormGroup";
|
|
14
|
-
import
|
|
14
|
+
import ae from "@mui/material/IconButton";
|
|
15
15
|
import Le from "@mui/material/TextField";
|
|
16
16
|
import { u as pe } from "./useAriaLive-MkYebyUR.mjs";
|
|
17
17
|
import { O as y } from "./Transaction-CqjlF6SO.mjs";
|
|
18
|
-
import { u as
|
|
18
|
+
import { u as S, h as O, m as Ye, d as ze, l as we, g as w, b as je, o as qe } from "./hooks-BxkfR-Ff.mjs";
|
|
19
19
|
import { A as H } from "./Analytics-BYItVAe-.mjs";
|
|
20
20
|
import Xe from "@mui/material/ToggleButton";
|
|
21
21
|
import { ChevronRight as Re, Icon as D, Delete as _e, Cancel as me, Search as Je, Edit as Qe, Flag as Ze } from "@mxenabled/mx-icons";
|
|
@@ -34,9 +34,9 @@ import { b as I } from "./Localization-CPkpIwIx.mjs";
|
|
|
34
34
|
import { getUnixTime as rt } from "date-fns/getUnixTime";
|
|
35
35
|
import { D as ie } from "./Drawer-Bbe4AMB1.mjs";
|
|
36
36
|
import { f as q } from "./NumberFormatting-QCaNwbjv.mjs";
|
|
37
|
-
import
|
|
37
|
+
import nt from "@mui/material/styles/useTheme";
|
|
38
38
|
import De from "@mui/material/InputAdornment";
|
|
39
|
-
import
|
|
39
|
+
import at from "@mui/material/Checkbox";
|
|
40
40
|
import { startOfMonth as ot } from "date-fns/startOfMonth";
|
|
41
41
|
import { endOfMonth as it } from "date-fns/endOfMonth";
|
|
42
42
|
import { i as st } from "./DateUtil-wcYTmDRD.mjs";
|
|
@@ -44,7 +44,7 @@ import fe from "@mui/material/Grid";
|
|
|
44
44
|
import { C as ct } from "./CurrencyInput-DuMktPu3.mjs";
|
|
45
45
|
import lt from "@mui/material/Switch";
|
|
46
46
|
import { L as dt } from "./Loader-D3rjKx72.mjs";
|
|
47
|
-
var
|
|
47
|
+
var ne = /* @__PURE__ */ ((t) => (t[t.Category = 0] = "Category", t[t.Date = 1] = "Date", t[t.Memo = 2] = "Memo", t[t.Tags = 3] = "Tags", t))(ne || {}), Z = /* @__PURE__ */ ((t) => (t[t.MerchantBudget = 0] = "MerchantBudget", t[t.SplitTransaction = 1] = "SplitTransaction", t[t.HideTransaction = 2] = "HideTransaction", t[t.MerchantLogo = 3] = "MerchantLogo", t))(Z || {});
|
|
48
48
|
const ut = [
|
|
49
49
|
0,
|
|
50
50
|
1,
|
|
@@ -58,15 +58,15 @@ const ut = [
|
|
|
58
58
|
/* MerchantLogo */
|
|
59
59
|
], mt = ({
|
|
60
60
|
startDate: t,
|
|
61
|
-
onViewHistory:
|
|
61
|
+
onViewHistory: a,
|
|
62
62
|
totalTransaction: i,
|
|
63
63
|
amount: r,
|
|
64
64
|
spentPercentage: o,
|
|
65
|
-
remainingAmount:
|
|
65
|
+
remainingAmount: n,
|
|
66
66
|
iconColor: s,
|
|
67
67
|
icon: l
|
|
68
68
|
}) => {
|
|
69
|
-
const { budgets: _ } =
|
|
69
|
+
const { budgets: _ } = S();
|
|
70
70
|
return /* @__PURE__ */ e(d.Fragment, { children: /* @__PURE__ */ c(
|
|
71
71
|
F,
|
|
72
72
|
{
|
|
@@ -90,7 +90,7 @@ const ut = [
|
|
|
90
90
|
},
|
|
91
91
|
children: [
|
|
92
92
|
/* @__PURE__ */ e(j, { bold: !0, variant: "subtitle1", children: st(t) }),
|
|
93
|
-
|
|
93
|
+
a && /* @__PURE__ */ e(oe, { endIcon: /* @__PURE__ */ e(Re, {}), onClick: a, sx: { height: 28 }, children: /* @__PURE__ */ e(x, { bold: !0, variant: "body2", children: _.spending_history }) })
|
|
94
94
|
]
|
|
95
95
|
}
|
|
96
96
|
),
|
|
@@ -109,7 +109,7 @@ const ut = [
|
|
|
109
109
|
percentComplete: o,
|
|
110
110
|
rightLabel: I(
|
|
111
111
|
_.balance_left,
|
|
112
|
-
q(
|
|
112
|
+
q(n, "0,0.00")
|
|
113
113
|
),
|
|
114
114
|
sx: {
|
|
115
115
|
pb: 24,
|
|
@@ -123,13 +123,13 @@ const ut = [
|
|
|
123
123
|
) });
|
|
124
124
|
}, pt = ({
|
|
125
125
|
merchantBudget: t,
|
|
126
|
-
transaction:
|
|
126
|
+
transaction: a,
|
|
127
127
|
onClose: i,
|
|
128
128
|
isOpen: r,
|
|
129
129
|
setCurrencyDialogAction: o,
|
|
130
|
-
renderingToast:
|
|
130
|
+
renderingToast: n
|
|
131
131
|
}) => {
|
|
132
|
-
const { budgets: s, common: l } =
|
|
132
|
+
const { budgets: s, common: l } = S(), { sortedTransactions: _ } = O(), u = d.useMemo(() => _.reduce((m, f) => f.parent_guid ? m : m + f.amount, 0), [_]), { remainingAmount: g, spentPercentage: p, iconColor: h } = Ke(
|
|
133
133
|
u,
|
|
134
134
|
t.amount ?? 0
|
|
135
135
|
);
|
|
@@ -164,36 +164,36 @@ const ut = [
|
|
|
164
164
|
icon: /* @__PURE__ */ e(
|
|
165
165
|
Ne,
|
|
166
166
|
{
|
|
167
|
-
categoryGuid:
|
|
168
|
-
merchantGuid:
|
|
167
|
+
categoryGuid: a.top_level_category_guid || "",
|
|
168
|
+
merchantGuid: a.merchant_guid || ""
|
|
169
169
|
}
|
|
170
170
|
),
|
|
171
|
-
iconColor:
|
|
172
|
-
remainingAmount:
|
|
173
|
-
spentPercentage:
|
|
174
|
-
startDate:
|
|
171
|
+
iconColor: h,
|
|
172
|
+
remainingAmount: g,
|
|
173
|
+
spentPercentage: p,
|
|
174
|
+
startDate: a.date,
|
|
175
175
|
totalTransaction: u
|
|
176
176
|
}
|
|
177
177
|
),
|
|
178
178
|
/* @__PURE__ */ e(tt, {}),
|
|
179
|
-
|
|
179
|
+
n?.()
|
|
180
180
|
]
|
|
181
181
|
}
|
|
182
182
|
);
|
|
183
183
|
}, gt = E(pt);
|
|
184
184
|
var Se = /* @__PURE__ */ ((t) => (t.CREATE = "create", t.EDIT = "edit", t.DELETE = "delete", t))(Se || {});
|
|
185
185
|
const ht = E(({ transaction: t }) => {
|
|
186
|
-
const [
|
|
187
|
-
addMerchantBudget:
|
|
188
|
-
updateMerchantBudget:
|
|
189
|
-
deleteMerchantBudget:
|
|
190
|
-
getMerchantBudgetByMerchantGuid:
|
|
186
|
+
const [a, i] = d.useState(null), [r, o] = d.useState(""), [n, s] = d.useState(!1), l = d.useRef(!1), [_, u] = d.useState(null), g = U(), {
|
|
187
|
+
addMerchantBudget: p,
|
|
188
|
+
updateMerchantBudget: h,
|
|
189
|
+
deleteMerchantBudget: m,
|
|
190
|
+
getMerchantBudgetByMerchantGuid: f,
|
|
191
191
|
alert: L,
|
|
192
192
|
setAlert: k
|
|
193
|
-
} = Ye(), { setFilter:
|
|
194
|
-
u(
|
|
193
|
+
} = Ye(), { setFilter: A } = O(), { accounts: T } = ze(), R = g.palette.mode === "dark" ? "grey.800" : "grey.100", { budgets: b, common: Q } = S(), { announce: ge, ariaLive: he } = pe(), [ee, te] = d.useState(!1), K = t?.merchant_guid ? f(t.merchant_guid) : void 0, re = () => {
|
|
194
|
+
u(a), i(null), o("");
|
|
195
195
|
}, ye = () => {
|
|
196
|
-
K ?
|
|
196
|
+
K ? te(!0) : i(
|
|
197
197
|
"create"
|
|
198
198
|
/* CREATE */
|
|
199
199
|
);
|
|
@@ -218,7 +218,7 @@ const ht = E(({ transaction: t }) => {
|
|
|
218
218
|
b.alert_budget_created,
|
|
219
219
|
t.description
|
|
220
220
|
),
|
|
221
|
-
apiTrigger: async () => await
|
|
221
|
+
apiTrigger: async () => await p(t.merchant_guid, Number(r))
|
|
222
222
|
},
|
|
223
223
|
edit: {
|
|
224
224
|
content: I(
|
|
@@ -239,7 +239,7 @@ const ht = E(({ transaction: t }) => {
|
|
|
239
239
|
b.success_alert_edit_merchant_budget,
|
|
240
240
|
t.description
|
|
241
241
|
),
|
|
242
|
-
apiTrigger: async () => await
|
|
242
|
+
apiTrigger: async () => await h({
|
|
243
243
|
...K,
|
|
244
244
|
amount: Number(r)
|
|
245
245
|
})
|
|
@@ -263,25 +263,25 @@ const ht = E(({ transaction: t }) => {
|
|
|
263
263
|
b.success_alert_delete_merchant_budget,
|
|
264
264
|
t.description
|
|
265
265
|
),
|
|
266
|
-
apiTrigger: async () => await
|
|
266
|
+
apiTrigger: async () => await m(K.guid)
|
|
267
267
|
}
|
|
268
268
|
}, P = async () => {
|
|
269
269
|
if (l.current) return;
|
|
270
270
|
l.current = !0;
|
|
271
|
-
const { apiTrigger: M, successAlertMessage: G, errorAlertMessage: Te } = C[
|
|
272
|
-
|
|
271
|
+
const { apiTrigger: M, successAlertMessage: G, errorAlertMessage: Te } = C[a], { isSuccess: be } = await M(), Ee = be ? G : Te;
|
|
272
|
+
re(), s(!be), k(Ee), ge(Ee), be && a === "delete" && te(!1), l.current = !1;
|
|
273
273
|
};
|
|
274
274
|
d.useEffect(() => {
|
|
275
275
|
const M = {
|
|
276
276
|
start: ot(new Date(t.date * 1e3)),
|
|
277
277
|
end: it(new Date(t.date * 1e3))
|
|
278
278
|
};
|
|
279
|
-
|
|
279
|
+
A({
|
|
280
280
|
accounts: T.map((G) => G.guid),
|
|
281
|
-
custom:
|
|
281
|
+
custom: ee ? (G) => G.merchant_guid === t.merchant_guid : (G) => G.guid === t.guid,
|
|
282
282
|
dateRange: M
|
|
283
283
|
});
|
|
284
|
-
}, [
|
|
284
|
+
}, [ee, t, T]);
|
|
285
285
|
const N = () => /* @__PURE__ */ e(
|
|
286
286
|
$e,
|
|
287
287
|
{
|
|
@@ -292,8 +292,8 @@ const ht = E(({ transaction: t }) => {
|
|
|
292
292
|
message: L,
|
|
293
293
|
onActionClick: C[_]?.errorRetryAction,
|
|
294
294
|
open: !!L,
|
|
295
|
-
severity:
|
|
296
|
-
showAction:
|
|
295
|
+
severity: n ? "error" : "success",
|
|
296
|
+
showAction: n,
|
|
297
297
|
showClose: !0
|
|
298
298
|
}
|
|
299
299
|
);
|
|
@@ -314,9 +314,9 @@ const ht = E(({ transaction: t }) => {
|
|
|
314
314
|
!!K && /* @__PURE__ */ e(
|
|
315
315
|
gt,
|
|
316
316
|
{
|
|
317
|
-
isOpen:
|
|
317
|
+
isOpen: ee,
|
|
318
318
|
merchantBudget: K,
|
|
319
|
-
onClose: () =>
|
|
319
|
+
onClose: () => te(!1),
|
|
320
320
|
renderingToast: () => L && N(),
|
|
321
321
|
setCurrencyDialogAction: (M) => {
|
|
322
322
|
M === "edit" && o(K?.amount.toString() || ""), i(M);
|
|
@@ -324,31 +324,31 @@ const ht = E(({ transaction: t }) => {
|
|
|
324
324
|
transaction: t
|
|
325
325
|
}
|
|
326
326
|
),
|
|
327
|
-
|
|
327
|
+
a && /* @__PURE__ */ e(
|
|
328
328
|
Fe,
|
|
329
329
|
{
|
|
330
330
|
closeAriaLabel: Q.close_aria,
|
|
331
|
-
content: C[
|
|
331
|
+
content: C[a].content,
|
|
332
332
|
handleInputChange: o,
|
|
333
|
-
handleModalClose:
|
|
333
|
+
handleModalClose: re,
|
|
334
334
|
handlePrimaryAction: P,
|
|
335
|
-
handleSecondaryAction:
|
|
336
|
-
inputLabel:
|
|
335
|
+
handleSecondaryAction: re,
|
|
336
|
+
inputLabel: a !== "delete" ? Q.amount_text : "",
|
|
337
337
|
inputValue: r,
|
|
338
|
-
isOpen: !!
|
|
339
|
-
primaryText: C[
|
|
338
|
+
isOpen: !!a,
|
|
339
|
+
primaryText: C[a].primaryButtonText,
|
|
340
340
|
secondaryText: Q.cancel_button,
|
|
341
|
-
title: C[
|
|
341
|
+
title: C[a].title
|
|
342
342
|
}
|
|
343
343
|
),
|
|
344
344
|
!!L && N()
|
|
345
345
|
] });
|
|
346
346
|
}), yt = ({ transaction: t }) => {
|
|
347
|
-
const { addOrUpdateTransactionRule:
|
|
348
|
-
await i({ ...t, category_guid:
|
|
347
|
+
const { addOrUpdateTransactionRule: a, updateTransaction: i } = O(), { categories: r } = we(), { onEvent: o } = w(), { setShouldDisableDrawerScroll: n, updateManualTransaction: s } = J(), { transactions: l } = S(), _ = U(), [u, g] = d.useState(!1), [p, h] = d.useState(""), m = async (T) => {
|
|
348
|
+
await i({ ...t, category_guid: p }), T && await a(p, t), h(""), o(H.TRANSACTION_DETAILS_CLICK_CATEGORY, {
|
|
349
349
|
transaction_guid: t.guid
|
|
350
350
|
});
|
|
351
|
-
},
|
|
351
|
+
}, f = (T) => {
|
|
352
352
|
if (t.is_manual && !t.guid) {
|
|
353
353
|
const R = r.find((b) => b.guid === T);
|
|
354
354
|
s({
|
|
@@ -358,23 +358,23 @@ const ht = E(({ transaction: t }) => {
|
|
|
358
358
|
top_level_category_guid: R?.parent_guid || T
|
|
359
359
|
});
|
|
360
360
|
} else
|
|
361
|
-
|
|
361
|
+
h(T);
|
|
362
362
|
L();
|
|
363
363
|
}, L = () => {
|
|
364
|
-
|
|
364
|
+
g(!1), n(!1);
|
|
365
365
|
}, k = d.useMemo(
|
|
366
|
-
() => r.find((T) => T.guid ===
|
|
367
|
-
[
|
|
368
|
-
),
|
|
366
|
+
() => r.find((T) => T.guid === p),
|
|
367
|
+
[p]
|
|
368
|
+
), A = _.palette.mode === "dark" ? "grey.800" : "grey.100";
|
|
369
369
|
return /* @__PURE__ */ c(B, { disableGutters: !0, disablePadding: !0, children: [
|
|
370
370
|
/* @__PURE__ */ c(
|
|
371
371
|
Y,
|
|
372
372
|
{
|
|
373
373
|
onClick: () => {
|
|
374
|
-
o(y.ON_TRANSACTION_CATEGORY_CLICK),
|
|
374
|
+
o(y.ON_TRANSACTION_CATEGORY_CLICK), g(!0);
|
|
375
375
|
},
|
|
376
376
|
children: [
|
|
377
|
-
/* @__PURE__ */ e(W, { children: /* @__PURE__ */ e(V, { sx: { bgcolor:
|
|
377
|
+
/* @__PURE__ */ e(W, { children: /* @__PURE__ */ e(V, { sx: { bgcolor: A }, variant: "rounded", children: /* @__PURE__ */ e(
|
|
378
378
|
Ie,
|
|
379
379
|
{
|
|
380
380
|
categoryGuid: t.top_level_category_guid,
|
|
@@ -400,7 +400,7 @@ const ht = E(({ transaction: t }) => {
|
|
|
400
400
|
{
|
|
401
401
|
initialSelected: t.category_guid,
|
|
402
402
|
onClose: L,
|
|
403
|
-
onSelect:
|
|
403
|
+
onSelect: f,
|
|
404
404
|
showDrawer: u,
|
|
405
405
|
title: l.actions_select_a_category
|
|
406
406
|
}
|
|
@@ -414,10 +414,10 @@ const ht = E(({ transaction: t }) => {
|
|
|
414
414
|
t.description
|
|
415
415
|
)
|
|
416
416
|
},
|
|
417
|
-
isOpen: !!
|
|
418
|
-
onClose: () =>
|
|
419
|
-
onPrimaryAction: () =>
|
|
420
|
-
onSecondaryAction: () =>
|
|
417
|
+
isOpen: !!p,
|
|
418
|
+
onClose: () => h(""),
|
|
419
|
+
onPrimaryAction: () => m(!0),
|
|
420
|
+
onSecondaryAction: () => m(!1),
|
|
421
421
|
primaryText: l.actions_apply_to_all,
|
|
422
422
|
secondaryText: l.actions_this_time_only,
|
|
423
423
|
children: /* @__PURE__ */ e(j, { variant: "subtitle1", children: I(
|
|
@@ -429,28 +429,28 @@ const ht = E(({ transaction: t }) => {
|
|
|
429
429
|
)
|
|
430
430
|
] });
|
|
431
431
|
}, Tt = ({ transaction: t }) => {
|
|
432
|
-
const { onEvent:
|
|
433
|
-
|
|
434
|
-
},
|
|
432
|
+
const { onEvent: a } = w(), { updateTransaction: i } = O(), { updateManualTransaction: r } = J(), { common: o, transactions: n } = S(), s = U(), [l, _] = d.useState(!1), [u, g] = d.useState(t.date), p = (f) => {
|
|
433
|
+
g(rt(f));
|
|
434
|
+
}, h = async () => {
|
|
435
435
|
if (t.is_manual && !t.guid) {
|
|
436
436
|
r({ ...t, date: u }), _(!1);
|
|
437
437
|
return;
|
|
438
438
|
}
|
|
439
|
-
await i({ ...t, date: u }),
|
|
440
|
-
},
|
|
439
|
+
await i({ ...t, date: u }), a(H.TRANSACTION_DETAILS_CLICK_DATE, { transaction_guid: t.guid }), _(!1);
|
|
440
|
+
}, m = s.palette.mode === "dark" ? "grey.800" : "grey.100";
|
|
441
441
|
return /* @__PURE__ */ c(B, { className: "mx-txn-date-action", disableGutters: !0, disablePadding: !0, children: [
|
|
442
442
|
/* @__PURE__ */ c(
|
|
443
443
|
Y,
|
|
444
444
|
{
|
|
445
445
|
onClick: () => {
|
|
446
|
-
|
|
446
|
+
a(y.ON_TRANSACTION_DATE_CLICK), _(!0);
|
|
447
447
|
},
|
|
448
448
|
children: [
|
|
449
|
-
/* @__PURE__ */ e(W, { children: /* @__PURE__ */ e(V, { sx: { bgcolor:
|
|
449
|
+
/* @__PURE__ */ e(W, { children: /* @__PURE__ */ e(V, { sx: { bgcolor: m }, variant: "rounded", children: /* @__PURE__ */ e(D, { name: "calendar_month", sx: { color: "text.primary" } }) }) }),
|
|
450
450
|
/* @__PURE__ */ e(
|
|
451
451
|
$,
|
|
452
452
|
{
|
|
453
|
-
primary:
|
|
453
|
+
primary: n.date_title,
|
|
454
454
|
primaryTypographyProps: { variant: "caption" },
|
|
455
455
|
secondary: /* @__PURE__ */ e(x, { bold: !0, sx: { color: "text.primary" }, variant: "body1", children: Me(Ae(t.date), ke.YEAR_MONTH_DAY) })
|
|
456
456
|
}
|
|
@@ -465,20 +465,20 @@ const ht = E(({ transaction: t }) => {
|
|
|
465
465
|
ariaLabelClose: o.close_aria,
|
|
466
466
|
isOpen: l,
|
|
467
467
|
onClose: () => _(!1),
|
|
468
|
-
onPrimaryAction:
|
|
468
|
+
onPrimaryAction: h,
|
|
469
469
|
primaryText: o.save_button,
|
|
470
470
|
secondaryText: o.cancel_button,
|
|
471
|
-
title:
|
|
471
|
+
title: n.date_edit_title,
|
|
472
472
|
children: /* @__PURE__ */ e(v, { alignItems: "center", mt: 40, children: /* @__PURE__ */ e(
|
|
473
473
|
He,
|
|
474
474
|
{
|
|
475
475
|
beginDate: Ae(u),
|
|
476
476
|
copy: {
|
|
477
|
-
nextAria:
|
|
478
|
-
prevAria:
|
|
477
|
+
nextAria: n.date_next_aria,
|
|
478
|
+
prevAria: n.date_prev_aria,
|
|
479
479
|
today: o.date_range_picker.today
|
|
480
480
|
},
|
|
481
|
-
onDateSelected:
|
|
481
|
+
onDateSelected: p,
|
|
482
482
|
selectionType: Ue.Single
|
|
483
483
|
}
|
|
484
484
|
) })
|
|
@@ -486,23 +486,23 @@ const ht = E(({ transaction: t }) => {
|
|
|
486
486
|
)
|
|
487
487
|
] });
|
|
488
488
|
}, bt = ({ transaction: t }) => {
|
|
489
|
-
const { onEvent:
|
|
490
|
-
await i(t.guid),
|
|
489
|
+
const { onEvent: a } = w(), { removeTransaction: i } = O(), { setShouldDisableDrawerScroll: r } = J(), { common: o, transactions: n } = S(), [s, l] = d.useState(!1), _ = async () => {
|
|
490
|
+
await i(t.guid), a(y.ON_TRANSACTION_DELETE_DELETED);
|
|
491
491
|
};
|
|
492
492
|
return /* @__PURE__ */ c(F, { className: "mx-txn-delete", children: [
|
|
493
493
|
t && /* @__PURE__ */ e(B, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ c(
|
|
494
494
|
Y,
|
|
495
495
|
{
|
|
496
496
|
onClick: () => {
|
|
497
|
-
|
|
497
|
+
a(y.ON_TRANSACTION_DELETE_CLICK), r(!0), l(!0);
|
|
498
498
|
},
|
|
499
499
|
children: [
|
|
500
500
|
/* @__PURE__ */ e(W, { children: /* @__PURE__ */ e(V, { variant: "rounded", children: /* @__PURE__ */ e(_e, { color: "secondary", fontSize: "small" }) }) }),
|
|
501
501
|
/* @__PURE__ */ e(
|
|
502
502
|
$,
|
|
503
503
|
{
|
|
504
|
-
primary:
|
|
505
|
-
secondary:
|
|
504
|
+
primary: n.manual_transaction_delete_title,
|
|
505
|
+
secondary: n.manual_transaction_delete_subtitle
|
|
506
506
|
}
|
|
507
507
|
),
|
|
508
508
|
/* @__PURE__ */ e(z, { children: /* @__PURE__ */ e(_e, {}) })
|
|
@@ -512,35 +512,35 @@ const ht = E(({ transaction: t }) => {
|
|
|
512
512
|
/* @__PURE__ */ e(
|
|
513
513
|
X,
|
|
514
514
|
{
|
|
515
|
-
copy: { title:
|
|
515
|
+
copy: { title: n.manual_transaction_delete_title },
|
|
516
516
|
isOpen: s,
|
|
517
517
|
onClose: () => {
|
|
518
518
|
r(!1), l(!1);
|
|
519
519
|
},
|
|
520
520
|
onPrimaryAction: _,
|
|
521
|
-
onSecondaryAction: () =>
|
|
521
|
+
onSecondaryAction: () => a(y.ON_TRANSACTION_DELETE_CANCEL),
|
|
522
522
|
primaryText: o.delete_button,
|
|
523
523
|
secondaryText: o.cancel_button,
|
|
524
|
-
children: /* @__PURE__ */ e(x, { sx: { whiteSpace: "normal" }, variant: "subtitle1", children:
|
|
524
|
+
children: /* @__PURE__ */ e(x, { sx: { whiteSpace: "normal" }, variant: "subtitle1", children: n.manual_transaction_delete_description })
|
|
525
525
|
}
|
|
526
526
|
)
|
|
527
527
|
] });
|
|
528
528
|
}, Ct = E(bt), xt = ({ transaction: t }) => {
|
|
529
|
-
const { onEvent:
|
|
530
|
-
await i({ ...t, merchant_guid: "" }),
|
|
529
|
+
const { onEvent: a } = w(), { updateTransaction: i } = O(), { setShouldDisableDrawerScroll: r } = J(), { common: o, transactions: n } = S(), s = U(), [l, _] = d.useState(!1), u = async () => {
|
|
530
|
+
await i({ ...t, merchant_guid: "" }), a(H.TRANSACTION_DETAILS_CLICK_DELETE_LOGO, {
|
|
531
531
|
transaction_guid: t.guid
|
|
532
532
|
});
|
|
533
|
-
},
|
|
533
|
+
}, g = s.palette.mode === "dark" ? "grey.800" : "grey.100";
|
|
534
534
|
return /* @__PURE__ */ e(d.Fragment, { children: t && /* @__PURE__ */ c(B, { className: "mx-txn-delete-logo", disableGutters: !0, disablePadding: !0, children: [
|
|
535
535
|
/* @__PURE__ */ c(
|
|
536
536
|
Y,
|
|
537
537
|
{
|
|
538
538
|
onClick: () => {
|
|
539
|
-
|
|
539
|
+
a(y.ON_TRANSACTION_DELETE_LOGO_CLICK), _(!0);
|
|
540
540
|
},
|
|
541
541
|
children: [
|
|
542
|
-
/* @__PURE__ */ e(W, { children: /* @__PURE__ */ e(V, { sx: { bgcolor:
|
|
543
|
-
/* @__PURE__ */ e($, { primary:
|
|
542
|
+
/* @__PURE__ */ e(W, { children: /* @__PURE__ */ e(V, { sx: { bgcolor: g }, variant: "rounded", children: /* @__PURE__ */ e(D, { name: "delete", sx: { color: "text.primary" } }) }) }),
|
|
543
|
+
/* @__PURE__ */ e($, { primary: n.merchant_logo_title, secondary: n.merchant_logo_desc }),
|
|
544
544
|
/* @__PURE__ */ e(z, { children: /* @__PURE__ */ e(D, { name: "chevron_right", sx: { color: "text.primary" } }) })
|
|
545
545
|
]
|
|
546
546
|
}
|
|
@@ -548,29 +548,29 @@ const ht = E(({ transaction: t }) => {
|
|
|
548
548
|
/* @__PURE__ */ c(
|
|
549
549
|
X,
|
|
550
550
|
{
|
|
551
|
-
copy: { title:
|
|
551
|
+
copy: { title: n.merchant_logo_modal_title },
|
|
552
552
|
isOpen: l,
|
|
553
553
|
onClose: () => {
|
|
554
554
|
r(!1), _(!1);
|
|
555
555
|
},
|
|
556
556
|
onPrimaryAction: u,
|
|
557
|
-
onSecondaryAction: () =>
|
|
557
|
+
onSecondaryAction: () => a(y.ON_TRANSACTION_DELETE_LOGO_CANCEL),
|
|
558
558
|
primaryText: o.delete_button,
|
|
559
559
|
secondaryText: o.cancel_button,
|
|
560
|
-
title:
|
|
560
|
+
title: n.merchant_logo_modal_title,
|
|
561
561
|
children: [
|
|
562
|
-
/* @__PURE__ */ e(x, { sx: { whiteSpace: "normal" }, variant: "subtitle1", children:
|
|
563
|
-
/* @__PURE__ */ e(x, { bold: !0, sx: { whiteSpace: "normal" }, variant: "subtitle1", children: ` ${
|
|
562
|
+
/* @__PURE__ */ e(x, { sx: { whiteSpace: "normal" }, variant: "subtitle1", children: n.merchant_logo_modal_desc }),
|
|
563
|
+
/* @__PURE__ */ e(x, { bold: !0, sx: { whiteSpace: "normal" }, variant: "subtitle1", children: ` ${n.merchant_logo_modal_desc_bold}` })
|
|
564
564
|
]
|
|
565
565
|
}
|
|
566
566
|
)
|
|
567
567
|
] }) });
|
|
568
568
|
}, ft = E(xt), At = ({ transaction: t }) => {
|
|
569
|
-
const { onEvent:
|
|
570
|
-
await i({ ...t, is_hidden: !t.is_hidden }),
|
|
569
|
+
const { onEvent: a } = w(), { updateTransaction: i } = O(), { setShouldDisableDrawerScroll: r } = J(), { common: o, transactions: n } = S(), s = U(), [l, _] = d.useState(!1), u = t.is_hidden, g = async () => {
|
|
570
|
+
await i({ ...t, is_hidden: !t.is_hidden }), a(
|
|
571
571
|
u ? y.ON_TRANSACTION_UNHIDDEN : y.ON_TRANSACTION_HIDDEN
|
|
572
572
|
);
|
|
573
|
-
},
|
|
573
|
+
}, p = s.palette.mode === "dark" ? "grey.800" : "grey.100";
|
|
574
574
|
return /* @__PURE__ */ e(d.Fragment, { children: t && /* @__PURE__ */ c(B, { className: "mx-txn-hide-transaction", disableGutters: !0, disablePadding: !0, children: [
|
|
575
575
|
/* @__PURE__ */ c(
|
|
576
576
|
Y,
|
|
@@ -578,9 +578,9 @@ const ht = E(({ transaction: t }) => {
|
|
|
578
578
|
"aria-checked": u,
|
|
579
579
|
"aria-labelledby": "hide-transaction-text",
|
|
580
580
|
onClick: () => {
|
|
581
|
-
|
|
581
|
+
a(
|
|
582
582
|
u ? y.ON_TRANSACTION_UNHIDE_CLICK : y.ON_TRANSACTION_HIDE_CLICK
|
|
583
|
-
),
|
|
583
|
+
), a(
|
|
584
584
|
u ? "transaction_details_click_unhide_transaction" : "transaction_details_click_hide_transaction",
|
|
585
585
|
{
|
|
586
586
|
transaction_guid: t.guid
|
|
@@ -589,13 +589,13 @@ const ht = E(({ transaction: t }) => {
|
|
|
589
589
|
},
|
|
590
590
|
role: "switch",
|
|
591
591
|
children: [
|
|
592
|
-
/* @__PURE__ */ e(W, { children: /* @__PURE__ */ e(V, { sx: { bgcolor:
|
|
592
|
+
/* @__PURE__ */ e(W, { children: /* @__PURE__ */ e(V, { sx: { bgcolor: p }, variant: "rounded", children: u ? /* @__PURE__ */ e(D, { name: "visibility_off", sx: { color: "text.primary" } }) : /* @__PURE__ */ e(D, { name: "visibility", sx: { color: "text.primary" } }) }) }),
|
|
593
593
|
/* @__PURE__ */ e(
|
|
594
594
|
$,
|
|
595
595
|
{
|
|
596
596
|
id: "hide-transaction-text",
|
|
597
|
-
primary: u ?
|
|
598
|
-
secondary: u ?
|
|
597
|
+
primary: u ? n.hide_trnx_subtitle_unhide_trnx : n.hide_trnx_subtitle_hide_trnx,
|
|
598
|
+
secondary: u ? n.hide_trnx_desc_unhiding : n.hide_trnx_desc_hiding
|
|
599
599
|
}
|
|
600
600
|
),
|
|
601
601
|
/* @__PURE__ */ e(z, { "aria-hidden": "true", children: /* @__PURE__ */ e(
|
|
@@ -614,24 +614,24 @@ const ht = E(({ transaction: t }) => {
|
|
|
614
614
|
X,
|
|
615
615
|
{
|
|
616
616
|
copy: {
|
|
617
|
-
title: u ?
|
|
617
|
+
title: u ? n.hide_trnx_subtitle_unhide_trnx : n.hide_trnx_subtitle_hide_trnx
|
|
618
618
|
},
|
|
619
619
|
isOpen: l,
|
|
620
620
|
onClose: () => {
|
|
621
621
|
r(!1), _(!1);
|
|
622
622
|
},
|
|
623
|
-
onPrimaryAction:
|
|
624
|
-
onSecondaryAction: () =>
|
|
623
|
+
onPrimaryAction: g,
|
|
624
|
+
onSecondaryAction: () => a(
|
|
625
625
|
u ? y.ON_TRANSACTION_UNHIDE_CANCEL_CLICK : y.ON_TRANSACTION_HIDE_CANCEL_CLICK
|
|
626
626
|
),
|
|
627
627
|
primaryText: u ? o.unhide_button : o.hide_button,
|
|
628
628
|
secondaryText: o.cancel_button,
|
|
629
|
-
children: /* @__PURE__ */ e(x, { truncate: !1, variant: "subtitle1", children: u ?
|
|
629
|
+
children: /* @__PURE__ */ e(x, { truncate: !1, variant: "subtitle1", children: u ? n.hide_trnx_desc_unhiding : n.hide_trnx_desc_hiding })
|
|
630
630
|
}
|
|
631
631
|
)
|
|
632
632
|
] }) });
|
|
633
633
|
}, St = E(At), Ge = ({ transaction: t }) => {
|
|
634
|
-
const { amount:
|
|
634
|
+
const { amount: a, description: i, isIncome: r, merchant_guid: o, payee: n, top_level_category_guid: s } = t;
|
|
635
635
|
return /* @__PURE__ */ c(v, { className: "mx-txn-amount-header", direction: "row", gap: 12, px: 16, py: 24, children: [
|
|
636
636
|
/* @__PURE__ */ e(
|
|
637
637
|
Ne,
|
|
@@ -642,38 +642,38 @@ const ht = E(({ transaction: t }) => {
|
|
|
642
642
|
}
|
|
643
643
|
),
|
|
644
644
|
/* @__PURE__ */ c(v, { overflow: "hidden'", children: [
|
|
645
|
-
/* @__PURE__ */ e(x, { bold: !0, mb: 4, truncate: !0, variant: "body1", children: i ||
|
|
645
|
+
/* @__PURE__ */ e(x, { bold: !0, mb: 4, truncate: !0, variant: "body1", children: i || n }),
|
|
646
646
|
/* @__PURE__ */ c(j, { color: r ? "success.main" : "text.primary", truncate: !0, variant: "h1", children: [
|
|
647
647
|
r ? "+" : "",
|
|
648
|
-
q(
|
|
648
|
+
q(a, "0,0.00")
|
|
649
649
|
] })
|
|
650
650
|
] })
|
|
651
651
|
] });
|
|
652
652
|
}, Nt = ({ transaction: t }) => {
|
|
653
|
-
const { onEvent:
|
|
653
|
+
const { onEvent: a } = w(), { updateTransaction: i } = O(), { updateManualTransaction: r } = J(), { common: o, transactions: n } = S(), s = U(), [l, _] = d.useState(!1), [u, g] = d.useState("");
|
|
654
654
|
d.useEffect(() => {
|
|
655
|
-
l &&
|
|
655
|
+
l && g(t.memo ? t.memo : "");
|
|
656
656
|
}, [l]);
|
|
657
|
-
const
|
|
657
|
+
const p = async () => {
|
|
658
658
|
if (t.is_manual && !t.guid) {
|
|
659
659
|
r({ ...t, memo: u }), _(!1);
|
|
660
660
|
return;
|
|
661
661
|
}
|
|
662
|
-
await i({ ...t, memo: u }),
|
|
663
|
-
},
|
|
662
|
+
await i({ ...t, memo: u }), a(H.TRANSACTION_DETAILS_CLICK_MEMO, { transaction_guid: t.guid }), _(!1);
|
|
663
|
+
}, h = s.palette.mode === "dark" ? "grey.800" : "grey.100";
|
|
664
664
|
return /* @__PURE__ */ c(B, { className: "mx-txn-memo-action", disableGutters: !0, disablePadding: !0, children: [
|
|
665
665
|
/* @__PURE__ */ c(
|
|
666
666
|
Y,
|
|
667
667
|
{
|
|
668
668
|
onClick: () => {
|
|
669
|
-
|
|
669
|
+
a(y.ON_TRANSACTION_MEMO_CLICK), _(!0);
|
|
670
670
|
},
|
|
671
671
|
children: [
|
|
672
|
-
/* @__PURE__ */ e(W, { children: /* @__PURE__ */ e(V, { sx: { bgcolor:
|
|
672
|
+
/* @__PURE__ */ e(W, { children: /* @__PURE__ */ e(V, { sx: { bgcolor: h }, variant: "rounded", children: /* @__PURE__ */ e(D, { name: "article", sx: { color: "text.primary" } }) }) }),
|
|
673
673
|
/* @__PURE__ */ e(
|
|
674
674
|
$,
|
|
675
675
|
{
|
|
676
|
-
primary:
|
|
676
|
+
primary: n.memo_title,
|
|
677
677
|
primaryTypographyProps: { variant: "caption" },
|
|
678
678
|
secondary: /* @__PURE__ */ e(
|
|
679
679
|
x,
|
|
@@ -681,7 +681,7 @@ const ht = E(({ transaction: t }) => {
|
|
|
681
681
|
bold: !0,
|
|
682
682
|
sx: { overflowWrap: "break-word", whiteSpace: "wrap", color: "text.primary" },
|
|
683
683
|
variant: "body1",
|
|
684
|
-
children: t.memo ? t.memo :
|
|
684
|
+
children: t.memo ? t.memo : n.memo_desc
|
|
685
685
|
}
|
|
686
686
|
)
|
|
687
687
|
}
|
|
@@ -696,19 +696,19 @@ const ht = E(({ transaction: t }) => {
|
|
|
696
696
|
ariaLabelClose: o.close_aria,
|
|
697
697
|
isOpen: l,
|
|
698
698
|
onClose: () => _(!1),
|
|
699
|
-
onPrimaryAction:
|
|
700
|
-
title:
|
|
699
|
+
onPrimaryAction: p,
|
|
700
|
+
title: n.memo_title,
|
|
701
701
|
children: [
|
|
702
702
|
/* @__PURE__ */ e(Ge, { transaction: t }),
|
|
703
703
|
/* @__PURE__ */ e(
|
|
704
704
|
Le,
|
|
705
705
|
{
|
|
706
|
-
"aria-label":
|
|
706
|
+
"aria-label": n.memo_desc_aria,
|
|
707
707
|
focused: !0,
|
|
708
708
|
multiline: !0,
|
|
709
709
|
name: "memo",
|
|
710
|
-
onChange: (
|
|
711
|
-
placeholder:
|
|
710
|
+
onChange: (m) => g(m.target.value),
|
|
711
|
+
placeholder: n.memo_desc,
|
|
712
712
|
rows: 4,
|
|
713
713
|
sx: { mx: 16, width: "calc(100% - 32px)" },
|
|
714
714
|
value: u
|
|
@@ -720,22 +720,22 @@ const ht = E(({ transaction: t }) => {
|
|
|
720
720
|
] });
|
|
721
721
|
}, It = E(Nt), vt = ({
|
|
722
722
|
index: t,
|
|
723
|
-
onDeleteRow:
|
|
723
|
+
onDeleteRow: a,
|
|
724
724
|
onCategoryChanged: i,
|
|
725
725
|
onUpdateAmount: r,
|
|
726
726
|
split: o
|
|
727
727
|
}) => {
|
|
728
|
-
const { onEvent:
|
|
729
|
-
isNaN(Number(
|
|
728
|
+
const { onEvent: n } = w(), { transactions: s } = S(), [l, _] = d.useState(`${o.amount}`), [u, g] = d.useState(!1), p = t === 0, h = (m) => {
|
|
729
|
+
isNaN(Number(m)) || (_(m), r(t, Number(m)));
|
|
730
730
|
};
|
|
731
731
|
return /* @__PURE__ */ c(F, { bgcolor: "background.paper", className: "mx-txn-split-manager-row", pb: 4, px: 8, children: [
|
|
732
|
-
/* @__PURE__ */ c(fe, { alignItems:
|
|
732
|
+
/* @__PURE__ */ c(fe, { alignItems: p ? "center" : "start", container: !0, children: [
|
|
733
733
|
/* @__PURE__ */ e(fe, { item: !0, xs: 7, children: /* @__PURE__ */ c(v, { alignItems: "start", children: [
|
|
734
734
|
/* @__PURE__ */ e(
|
|
735
735
|
oe,
|
|
736
736
|
{
|
|
737
737
|
endIcon: /* @__PURE__ */ e(Re, {}),
|
|
738
|
-
onClick: () =>
|
|
738
|
+
onClick: () => g(!0),
|
|
739
739
|
startIcon: /* @__PURE__ */ e(Ie, { categoryGuid: o.top_level_category_guid }),
|
|
740
740
|
sx: { px: 12, py: 8 },
|
|
741
741
|
children: o.category
|
|
@@ -746,7 +746,7 @@ const ht = E(({ transaction: t }) => {
|
|
|
746
746
|
/* @__PURE__ */ e(x, { variant: "body2", children: s.split_transaction_errors_select_category })
|
|
747
747
|
] }) })
|
|
748
748
|
] }) }),
|
|
749
|
-
/* @__PURE__ */ e(fe, { item: !0, xs: 5, children:
|
|
749
|
+
/* @__PURE__ */ e(fe, { item: !0, xs: 5, children: p ? /* @__PURE__ */ e("div", { className: "mx-txn-split-manager-row-top-container", children: /* @__PURE__ */ e(x, { children: q(o.amount, "0,0.00") }) }) : /* @__PURE__ */ c(v, { alignItems: "start", children: [
|
|
750
750
|
/* @__PURE__ */ c(v, { alignItems: "start", direction: "row", gap: 8, children: [
|
|
751
751
|
/* @__PURE__ */ e(
|
|
752
752
|
ct,
|
|
@@ -756,7 +756,7 @@ const ht = E(({ transaction: t }) => {
|
|
|
756
756
|
label: s.split_transaction_edit_split_amount,
|
|
757
757
|
minAmount: 0.01,
|
|
758
758
|
name: "split-amount-input",
|
|
759
|
-
setAmount:
|
|
759
|
+
setAmount: h,
|
|
760
760
|
sx: {
|
|
761
761
|
".MuiOutlinedInput-input": { p: 12 }
|
|
762
762
|
},
|
|
@@ -764,12 +764,12 @@ const ht = E(({ transaction: t }) => {
|
|
|
764
764
|
}
|
|
765
765
|
),
|
|
766
766
|
/* @__PURE__ */ e(
|
|
767
|
-
|
|
767
|
+
ae,
|
|
768
768
|
{
|
|
769
769
|
"aria-label": s.split_transaction_delete_split_btn,
|
|
770
770
|
color: "secondary",
|
|
771
771
|
onClick: () => {
|
|
772
|
-
|
|
772
|
+
n(y.ON_TRANSACTION_SPLIT_DELETE_CLICK), a(t);
|
|
773
773
|
},
|
|
774
774
|
sx: { w: 44, h: 44 },
|
|
775
775
|
children: /* @__PURE__ */ e(_e, {})
|
|
@@ -786,9 +786,9 @@ const ht = E(({ transaction: t }) => {
|
|
|
786
786
|
Pe,
|
|
787
787
|
{
|
|
788
788
|
initialSelected: o.category_guid,
|
|
789
|
-
onClose: () =>
|
|
790
|
-
onSelect: (
|
|
791
|
-
i(t,
|
|
789
|
+
onClose: () => g(!1),
|
|
790
|
+
onSelect: (m) => {
|
|
791
|
+
i(t, m), g(!1);
|
|
792
792
|
},
|
|
793
793
|
showDrawer: u,
|
|
794
794
|
title: s.actions_select_a_category
|
|
@@ -797,36 +797,36 @@ const ht = E(({ transaction: t }) => {
|
|
|
797
797
|
] });
|
|
798
798
|
}, Et = E(vt), Dt = ({
|
|
799
799
|
onAddSplit: t,
|
|
800
|
-
onCategoryChanged:
|
|
800
|
+
onCategoryChanged: a,
|
|
801
801
|
onDeleteSplit: i,
|
|
802
802
|
onUpdateAmount: r,
|
|
803
803
|
splits: o,
|
|
804
|
-
transaction:
|
|
804
|
+
transaction: n
|
|
805
805
|
}) => {
|
|
806
|
-
const { transactions: s } =
|
|
806
|
+
const { transactions: s } = S(), { onEvent: l } = w(), [_, u] = d.useState(""), { announce: g, ariaLive: p } = pe();
|
|
807
807
|
return d.useEffect(() => {
|
|
808
808
|
if (o.length <= 1)
|
|
809
|
-
u(s.split_transaction_errors_min_splits),
|
|
809
|
+
u(s.split_transaction_errors_min_splits), g(s.split_transaction_errors_min_splits);
|
|
810
810
|
else if (o[0].amount < 0) {
|
|
811
|
-
const
|
|
811
|
+
const h = I(
|
|
812
812
|
s.split_transaction_errors_totals_must_equal_amount,
|
|
813
|
-
q(
|
|
813
|
+
q(n.amount, "0,0.00")
|
|
814
814
|
);
|
|
815
|
-
u(
|
|
815
|
+
u(h), g(h);
|
|
816
816
|
} else
|
|
817
|
-
u(""),
|
|
817
|
+
u(""), g("");
|
|
818
818
|
}, [o]), /* @__PURE__ */ c(F, { className: "mx-txn-split-manager", children: [
|
|
819
|
-
|
|
820
|
-
o.map((
|
|
819
|
+
p,
|
|
820
|
+
o.map((h, m) => /* @__PURE__ */ e(
|
|
821
821
|
Et,
|
|
822
822
|
{
|
|
823
|
-
index:
|
|
824
|
-
onCategoryChanged:
|
|
823
|
+
index: m,
|
|
824
|
+
onCategoryChanged: a,
|
|
825
825
|
onDeleteRow: i,
|
|
826
826
|
onUpdateAmount: r,
|
|
827
|
-
split:
|
|
827
|
+
split: h
|
|
828
828
|
},
|
|
829
|
-
|
|
829
|
+
m
|
|
830
830
|
)),
|
|
831
831
|
_ && /* @__PURE__ */ c(v, { bgcolor: "background.paper", color: "error.main", direction: "row", gap: 8, p: 16, children: [
|
|
832
832
|
/* @__PURE__ */ e("span", { "aria-label": "error", role: "img", children: /* @__PURE__ */ e(me, { sx: { fontSize: 15 } }) }),
|
|
@@ -844,13 +844,13 @@ const ht = E(({ transaction: t }) => {
|
|
|
844
844
|
) })
|
|
845
845
|
] });
|
|
846
846
|
}, Ot = E(Dt), Lt = ({ transaction: t }) => {
|
|
847
|
-
const { onEvent:
|
|
847
|
+
const { onEvent: a } = w(), { announce: i, ariaLive: r } = pe(), { splitTransaction: o, unSplitTransaction: n } = O(), { common: s, transactions: l } = S(), { setShouldDisableDrawerScroll: _ } = J(), { categories: u } = we(), g = U(), p = {
|
|
848
848
|
...t,
|
|
849
849
|
amount: t.amount - 1,
|
|
850
850
|
guid: "",
|
|
851
851
|
has_been_split: !1,
|
|
852
852
|
parent_guid: t.guid
|
|
853
|
-
},
|
|
853
|
+
}, h = {
|
|
854
854
|
...t,
|
|
855
855
|
amount: 1,
|
|
856
856
|
category_guid: void 0,
|
|
@@ -859,9 +859,9 @@ const ht = E(({ transaction: t }) => {
|
|
|
859
859
|
has_been_split: !1,
|
|
860
860
|
parent_guid: t.guid,
|
|
861
861
|
top_level_category_guid: void 0
|
|
862
|
-
}, [
|
|
863
|
-
const C = [...
|
|
864
|
-
C.push({ ...
|
|
862
|
+
}, [m, f] = d.useState(!1), [L, k] = d.useState(!1), [A, T] = d.useState([]), R = () => {
|
|
863
|
+
const C = [...A];
|
|
864
|
+
C.push({ ...h }), C[0].amount -= 1, T(C), i(
|
|
865
865
|
I(
|
|
866
866
|
l.split_transaction_add_split_announcement,
|
|
867
867
|
C.length
|
|
@@ -869,19 +869,19 @@ const ht = E(({ transaction: t }) => {
|
|
|
869
869
|
);
|
|
870
870
|
}, b = (C) => {
|
|
871
871
|
if (C > 0) {
|
|
872
|
-
const P =
|
|
872
|
+
const P = A[C], N = [...A];
|
|
873
873
|
N.splice(C, 1), N[0].amount += P.amount, T(N), i(
|
|
874
874
|
I(l.split_transaction_delete_split_announcement, C + 1)
|
|
875
875
|
);
|
|
876
876
|
}
|
|
877
877
|
}, Q = (C, P) => {
|
|
878
|
-
const N = [...
|
|
878
|
+
const N = [...A];
|
|
879
879
|
N[C].amount = P, N[0].amount = t.amount - N.reduce(
|
|
880
880
|
(M, G, Te) => M + (Te !== 0 ? G.amount : 0),
|
|
881
881
|
0
|
|
882
882
|
), T(N);
|
|
883
883
|
}, ge = (C, P) => {
|
|
884
|
-
const N = [...
|
|
884
|
+
const N = [...A], M = u.find((G) => G.guid === P);
|
|
885
885
|
M && (N[C] = {
|
|
886
886
|
...N[C],
|
|
887
887
|
category_guid: P,
|
|
@@ -899,23 +899,23 @@ const ht = E(({ transaction: t }) => {
|
|
|
899
899
|
k(!0);
|
|
900
900
|
return;
|
|
901
901
|
}
|
|
902
|
-
T([{ ...
|
|
902
|
+
T([{ ...p }, { ...h }]), a(H.TRANSACTION_DETAILS_CLICK_SPLIT, {
|
|
903
903
|
transaction_guid: t.guid
|
|
904
|
-
}),
|
|
905
|
-
}, Z = async () => {
|
|
906
|
-
n(y.ON_TRANSACTION_SPLIT_SAVE_CLICK), await o({ ...t, has_been_split: !0 }, f), S(!1);
|
|
904
|
+
}), f(!0);
|
|
907
905
|
}, ee = async () => {
|
|
908
|
-
|
|
906
|
+
a(y.ON_TRANSACTION_SPLIT_SAVE_CLICK), await o({ ...t, has_been_split: !0 }, A), f(!1);
|
|
907
|
+
}, te = async () => {
|
|
908
|
+
a(y.ON_TRANSACTION_SPLIT_CANCEL_CLICK), T([{ ...p }, { ...h }]), f(!1);
|
|
909
909
|
}, K = async () => {
|
|
910
|
-
|
|
910
|
+
a(H.TRANSACTION_DETAILS_CLICK_UNSPLIT, {
|
|
911
911
|
transaction_guid: t.guid
|
|
912
912
|
});
|
|
913
913
|
const C = t.parent_guid ?? t.guid;
|
|
914
|
-
await
|
|
915
|
-
},
|
|
916
|
-
const C =
|
|
914
|
+
await n(C);
|
|
915
|
+
}, re = d.useMemo(() => {
|
|
916
|
+
const C = A.some((N) => !N.category_guid), P = A.some((N) => N.amount <= 0);
|
|
917
917
|
return C || P;
|
|
918
|
-
}, [
|
|
918
|
+
}, [A]), ye = g.palette.mode === "dark" ? "grey.800" : "grey.100";
|
|
919
919
|
return /* @__PURE__ */ e(d.Fragment, { children: t && /* @__PURE__ */ c(B, { disableGutters: !0, disablePadding: !0, children: [
|
|
920
920
|
/* @__PURE__ */ c(Y, { onClick: he, children: [
|
|
921
921
|
/* @__PURE__ */ e(W, { children: /* @__PURE__ */ e(V, { sx: { bgcolor: ye }, variant: "rounded", children: /* @__PURE__ */ e(D, { name: "call_split", sx: { color: "text.primary" } }) }) }),
|
|
@@ -932,10 +932,10 @@ const ht = E(({ transaction: t }) => {
|
|
|
932
932
|
ie,
|
|
933
933
|
{
|
|
934
934
|
ariaLabelClose: s.close_aria,
|
|
935
|
-
isOpen:
|
|
936
|
-
isPrimaryDisabled:
|
|
937
|
-
onClose:
|
|
938
|
-
onPrimaryAction:
|
|
935
|
+
isOpen: m,
|
|
936
|
+
isPrimaryDisabled: re,
|
|
937
|
+
onClose: te,
|
|
938
|
+
onPrimaryAction: ee,
|
|
939
939
|
primaryText: s.save_button,
|
|
940
940
|
secondaryText: s.cancel_button,
|
|
941
941
|
title: l.split_transaction_title,
|
|
@@ -949,7 +949,7 @@ const ht = E(({ transaction: t }) => {
|
|
|
949
949
|
onCategoryChanged: ge,
|
|
950
950
|
onDeleteSplit: b,
|
|
951
951
|
onUpdateAmount: Q,
|
|
952
|
-
splits:
|
|
952
|
+
splits: A,
|
|
953
953
|
transaction: t
|
|
954
954
|
}
|
|
955
955
|
)
|
|
@@ -966,7 +966,7 @@ const ht = E(({ transaction: t }) => {
|
|
|
966
966
|
},
|
|
967
967
|
onPrimaryAction: K,
|
|
968
968
|
onSecondaryAction: () => {
|
|
969
|
-
|
|
969
|
+
a(y.ON_TRANSACTION_UNSPLIT_CANCEL);
|
|
970
970
|
},
|
|
971
971
|
primaryText: s.delete_button,
|
|
972
972
|
secondaryText: s.cancel_button,
|
|
@@ -978,16 +978,16 @@ const ht = E(({ transaction: t }) => {
|
|
|
978
978
|
)
|
|
979
979
|
] }) });
|
|
980
980
|
}, wt = E(Lt), Rt = () => {
|
|
981
|
-
const t =
|
|
981
|
+
const t = nt(), { onEvent: a } = w(), { addTag: i } = O(), { transactions: r } = S(), [o, n] = d.useState(!1), [s, l] = d.useState(""), [_, u] = d.useState(""), g = d.useRef(null);
|
|
982
982
|
d.useEffect(() => {
|
|
983
|
-
o &&
|
|
983
|
+
o && g?.current?.focus();
|
|
984
984
|
}, [o]);
|
|
985
|
-
const
|
|
986
|
-
|
|
985
|
+
const p = () => {
|
|
986
|
+
a(
|
|
987
987
|
o ? y.ON_TRANSACTION_TAGS_TAG_ADD_CANCEL_CLICK : y.ON_TRANSACTION_TAGS_TAG_ADD_CLICK
|
|
988
|
-
), o || l(""),
|
|
989
|
-
},
|
|
990
|
-
|
|
988
|
+
), o || l(""), n(!o);
|
|
989
|
+
}, h = async () => {
|
|
990
|
+
a(y.ON_TRANSACTION_TAGS_TAG_ADDED), await i(s), n(!1);
|
|
991
991
|
};
|
|
992
992
|
return d.useEffect(() => {
|
|
993
993
|
u(s.length > 40 ? r.tags_error_name_must_be_40_chars : "");
|
|
@@ -1008,7 +1008,7 @@ const ht = E(({ transaction: t }) => {
|
|
|
1008
1008
|
{
|
|
1009
1009
|
"aria-expanded": o,
|
|
1010
1010
|
"aria-label": r.tags_add_tag_btn_aria,
|
|
1011
|
-
onClick:
|
|
1011
|
+
onClick: p,
|
|
1012
1012
|
children: r.tags_add_tag_btn
|
|
1013
1013
|
}
|
|
1014
1014
|
)
|
|
@@ -1020,16 +1020,16 @@ const ht = E(({ transaction: t }) => {
|
|
|
1020
1020
|
{
|
|
1021
1021
|
copy: { title: r.tags_add_tag_btn },
|
|
1022
1022
|
isOpen: o,
|
|
1023
|
-
onClose: () =>
|
|
1024
|
-
onPrimaryAction:
|
|
1025
|
-
onSecondaryAction: () =>
|
|
1023
|
+
onClose: () => n(!1),
|
|
1024
|
+
onPrimaryAction: h,
|
|
1025
|
+
onSecondaryAction: () => n(!1),
|
|
1026
1026
|
children: [
|
|
1027
1027
|
/* @__PURE__ */ e(
|
|
1028
1028
|
ve,
|
|
1029
1029
|
{
|
|
1030
1030
|
"aria-label": r.tags_placeholder,
|
|
1031
1031
|
name: "add-tag",
|
|
1032
|
-
onChange: (
|
|
1032
|
+
onChange: (m) => l(m.target.value),
|
|
1033
1033
|
placeholder: r.tags_placeholder,
|
|
1034
1034
|
sx: { width: "100%" },
|
|
1035
1035
|
value: s
|
|
@@ -1040,9 +1040,9 @@ const ht = E(({ transaction: t }) => {
|
|
|
1040
1040
|
}
|
|
1041
1041
|
)
|
|
1042
1042
|
] });
|
|
1043
|
-
}, Mt = E(Rt), kt = ({ onSearchValueChanged: t, searchValue:
|
|
1044
|
-
const { common: i, transactions: r } =
|
|
1045
|
-
|
|
1043
|
+
}, Mt = E(Rt), kt = ({ onSearchValueChanged: t, searchValue: a }) => {
|
|
1044
|
+
const { common: i, transactions: r } = S(), o = /* @__PURE__ */ e(
|
|
1045
|
+
ae,
|
|
1046
1046
|
{
|
|
1047
1047
|
"aria-label": r.tags_cancel_search || "Search",
|
|
1048
1048
|
onClick: () => t(""),
|
|
@@ -1054,29 +1054,29 @@ const ht = E(({ transaction: t }) => {
|
|
|
1054
1054
|
{
|
|
1055
1055
|
InputProps: {
|
|
1056
1056
|
startAdornment: /* @__PURE__ */ e(De, { position: "start", children: /* @__PURE__ */ e(Je, { color: "disabled" }) }),
|
|
1057
|
-
endAdornment: /* @__PURE__ */ e(De, { position: "end", sx: { padding: 0 }, children:
|
|
1057
|
+
endAdornment: /* @__PURE__ */ e(De, { position: "end", sx: { padding: 0 }, children: a ? o : null })
|
|
1058
1058
|
},
|
|
1059
1059
|
"aria-label": i.search_aria,
|
|
1060
1060
|
name: "search",
|
|
1061
|
-
onChange: (
|
|
1061
|
+
onChange: (n) => t(n.target.value),
|
|
1062
1062
|
placeholder: i.search_placeholder,
|
|
1063
1063
|
sx: { bgcolor: "background.paper", width: "100%" },
|
|
1064
|
-
value:
|
|
1064
|
+
value: a
|
|
1065
1065
|
}
|
|
1066
1066
|
) });
|
|
1067
|
-
}, Pt = E(kt), Gt = ({ onTagChecked: t, selectedTags:
|
|
1068
|
-
const { onEvent: r } = w(), { removeTag: o, updateTag:
|
|
1069
|
-
r(y.ON_TRANSACTION_TAGS_TAG_EDIT_SAVED), i && await
|
|
1070
|
-
},
|
|
1071
|
-
r(y.ON_TRANSACTION_TAGS_TAG_DELETED), await o(i.guid),
|
|
1067
|
+
}, Pt = E(kt), Gt = ({ onTagChecked: t, selectedTags: a, tag: i }) => {
|
|
1068
|
+
const { onEvent: r } = w(), { removeTag: o, updateTag: n } = O(), { common: s, transactions: l } = S(), [_, u] = d.useState(!1), [g, p] = d.useState(!1), [h, m] = d.useState(""), [f, L] = d.useState(""), k = async () => {
|
|
1069
|
+
r(y.ON_TRANSACTION_TAGS_TAG_EDIT_SAVED), i && await n({ ...i, name: h }), u(!1);
|
|
1070
|
+
}, A = async () => {
|
|
1071
|
+
r(y.ON_TRANSACTION_TAGS_TAG_DELETED), await o(i.guid), p(!1);
|
|
1072
1072
|
};
|
|
1073
1073
|
d.useEffect(() => {
|
|
1074
|
-
L(
|
|
1075
|
-
}, [
|
|
1074
|
+
L(h.length > 40 ? l.tags_error_name_must_be_40_chars : "");
|
|
1075
|
+
}, [h]);
|
|
1076
1076
|
const T = () => {
|
|
1077
|
-
r(y.ON_TRANSACTION_TAGS_TAG_EDIT_CLICK),
|
|
1077
|
+
r(y.ON_TRANSACTION_TAGS_TAG_EDIT_CLICK), m(i.name), u(!0);
|
|
1078
1078
|
}, R = () => {
|
|
1079
|
-
r(y.ON_TRANSACTION_TAGS_TAG_DELETE_CLICK),
|
|
1079
|
+
r(y.ON_TRANSACTION_TAGS_TAG_DELETE_CLICK), p(!0);
|
|
1080
1080
|
};
|
|
1081
1081
|
return /* @__PURE__ */ c(
|
|
1082
1082
|
B,
|
|
@@ -1086,7 +1086,7 @@ const ht = E(({ transaction: t }) => {
|
|
|
1086
1086
|
disablePadding: !0,
|
|
1087
1087
|
secondaryAction: !i.is_default_tag && /* @__PURE__ */ c(v, { direction: "row", children: [
|
|
1088
1088
|
/* @__PURE__ */ e(
|
|
1089
|
-
|
|
1089
|
+
ae,
|
|
1090
1090
|
{
|
|
1091
1091
|
"aria-label": `Edit ${i.name} tag`,
|
|
1092
1092
|
color: "secondary",
|
|
@@ -1095,7 +1095,7 @@ const ht = E(({ transaction: t }) => {
|
|
|
1095
1095
|
}
|
|
1096
1096
|
),
|
|
1097
1097
|
/* @__PURE__ */ e(
|
|
1098
|
-
|
|
1098
|
+
ae,
|
|
1099
1099
|
{
|
|
1100
1100
|
"aria-label": `Delete ${i.name} tag`,
|
|
1101
1101
|
color: "secondary",
|
|
@@ -1108,15 +1108,15 @@ const ht = E(({ transaction: t }) => {
|
|
|
1108
1108
|
/* @__PURE__ */ c(
|
|
1109
1109
|
Y,
|
|
1110
1110
|
{
|
|
1111
|
-
"aria-checked":
|
|
1111
|
+
"aria-checked": a.includes(i.guid),
|
|
1112
1112
|
onClick: () => t(i.guid),
|
|
1113
1113
|
role: "checkbox",
|
|
1114
1114
|
children: [
|
|
1115
1115
|
/* @__PURE__ */ e(z, { sx: { ml: 0 }, children: /* @__PURE__ */ e(
|
|
1116
|
-
|
|
1116
|
+
at,
|
|
1117
1117
|
{
|
|
1118
1118
|
"aria-hidden": !0,
|
|
1119
|
-
checked:
|
|
1119
|
+
checked: a.includes(i.guid),
|
|
1120
1120
|
edge: "start",
|
|
1121
1121
|
tabIndex: -1
|
|
1122
1122
|
}
|
|
@@ -1137,16 +1137,16 @@ const ht = E(({ transaction: t }) => {
|
|
|
1137
1137
|
/* @__PURE__ */ e(
|
|
1138
1138
|
ve,
|
|
1139
1139
|
{
|
|
1140
|
-
"aria-describedby":
|
|
1140
|
+
"aria-describedby": f ? "update-tag-error" : void 0,
|
|
1141
1141
|
"aria-label": l.tags_update_the_tag_name,
|
|
1142
1142
|
name: "update-tag",
|
|
1143
|
-
onChange: (b) =>
|
|
1143
|
+
onChange: (b) => m(b.target.value),
|
|
1144
1144
|
placeholder: "Tag name",
|
|
1145
1145
|
sx: { width: "100%" },
|
|
1146
|
-
value:
|
|
1146
|
+
value: h
|
|
1147
1147
|
}
|
|
1148
1148
|
),
|
|
1149
|
-
/* @__PURE__ */ e(j, { id: "update-tag-error", sx: { color: "error.main" }, variant: "subtitle2", children:
|
|
1149
|
+
/* @__PURE__ */ e(j, { id: "update-tag-error", sx: { color: "error.main" }, variant: "subtitle2", children: f })
|
|
1150
1150
|
]
|
|
1151
1151
|
}
|
|
1152
1152
|
),
|
|
@@ -1154,9 +1154,9 @@ const ht = E(({ transaction: t }) => {
|
|
|
1154
1154
|
X,
|
|
1155
1155
|
{
|
|
1156
1156
|
copy: { title: l.tags_delete_title },
|
|
1157
|
-
isOpen:
|
|
1158
|
-
onClose: () =>
|
|
1159
|
-
onPrimaryAction:
|
|
1157
|
+
isOpen: g,
|
|
1158
|
+
onClose: () => p(!1),
|
|
1159
|
+
onPrimaryAction: A,
|
|
1160
1160
|
onSecondaryAction: () => r(y.ON_TRANSACTION_TAGS_TAG_DELETE_CANCEL_CLICK),
|
|
1161
1161
|
primaryText: s.delete_button,
|
|
1162
1162
|
secondaryText: s.cancel_button,
|
|
@@ -1166,8 +1166,8 @@ const ht = E(({ transaction: t }) => {
|
|
|
1166
1166
|
]
|
|
1167
1167
|
}
|
|
1168
1168
|
);
|
|
1169
|
-
}, Bt = E(Gt), $t = ({ selectedTags: t, onTagChecked:
|
|
1170
|
-
const { tags: i } = O(), [r, o] = d.useState(""),
|
|
1169
|
+
}, Bt = E(Gt), $t = ({ selectedTags: t, onTagChecked: a }) => {
|
|
1170
|
+
const { tags: i } = O(), [r, o] = d.useState(""), n = i.filter(
|
|
1171
1171
|
(s) => s.name.toLowerCase().includes(r.toLowerCase())
|
|
1172
1172
|
);
|
|
1173
1173
|
return /* @__PURE__ */ c("div", { className: "mx-txn-tag-manager", children: [
|
|
@@ -1179,28 +1179,28 @@ const ht = E(({ transaction: t }) => {
|
|
|
1179
1179
|
}
|
|
1180
1180
|
),
|
|
1181
1181
|
/* @__PURE__ */ e(Mt, {}),
|
|
1182
|
-
/* @__PURE__ */ e(ce, { sx: { boxShadow: "none" }, children: /* @__PURE__ */ e(ue, { children:
|
|
1183
|
-
/* @__PURE__ */ e(Bt, { onTagChecked:
|
|
1182
|
+
/* @__PURE__ */ e(ce, { sx: { boxShadow: "none" }, children: /* @__PURE__ */ e(ue, { children: n.map((s) => /* @__PURE__ */ c(d.Fragment, { children: [
|
|
1183
|
+
/* @__PURE__ */ e(Bt, { onTagChecked: a, selectedTags: t, tag: s }),
|
|
1184
1184
|
/* @__PURE__ */ e(de, { sx: { ml: 24 } })
|
|
1185
1185
|
] }, s.guid)) }) })
|
|
1186
1186
|
] });
|
|
1187
1187
|
}, Kt = E($t), Ft = ({ transaction: t }) => {
|
|
1188
|
-
const { onEvent:
|
|
1188
|
+
const { onEvent: a } = w(), { tags: i, updateTaggings: r, updateTransaction: o } = O(), { common: n, transactions: s } = S(), { updateManualTransaction: l } = J(), _ = U(), [u, g] = d.useState(!1), [p, h] = d.useState(t.tags);
|
|
1189
1189
|
d.useEffect(() => {
|
|
1190
|
-
|
|
1190
|
+
h(t.tags);
|
|
1191
1191
|
}, [u, t]);
|
|
1192
|
-
const
|
|
1193
|
-
const T = [...
|
|
1194
|
-
R >= 0 ? T.splice(R, 1) : T.push(
|
|
1195
|
-
},
|
|
1192
|
+
const m = (A) => {
|
|
1193
|
+
const T = [...p], R = p.indexOf(A);
|
|
1194
|
+
R >= 0 ? T.splice(R, 1) : T.push(A), h(T);
|
|
1195
|
+
}, f = async () => {
|
|
1196
1196
|
if (t.is_manual && !t.guid) {
|
|
1197
|
-
l({ ...t, tags:
|
|
1197
|
+
l({ ...t, tags: p }), g(!1);
|
|
1198
1198
|
return;
|
|
1199
1199
|
}
|
|
1200
|
-
await r(
|
|
1200
|
+
await r(p, t.guid), await o({ ...t, tags: p }), a(H.TRANSACTION_DETAILS_CLICK_TAGS, { transaction_guid: t.guid }), g(!1);
|
|
1201
1201
|
}, L = d.useMemo(
|
|
1202
1202
|
() => t.tags.map(
|
|
1203
|
-
(
|
|
1203
|
+
(A, T, R) => `${i.find((b) => b.guid === A)?.name}${T < R.length - 1 ? " / " : ""}`
|
|
1204
1204
|
),
|
|
1205
1205
|
[i, t]
|
|
1206
1206
|
), k = _.palette.mode === "dark" ? "grey.800" : "grey.100";
|
|
@@ -1209,7 +1209,7 @@ const ht = E(({ transaction: t }) => {
|
|
|
1209
1209
|
Y,
|
|
1210
1210
|
{
|
|
1211
1211
|
onClick: () => {
|
|
1212
|
-
|
|
1212
|
+
a(y.ON_TRANSACTION_TAGS_CLICK), g(!0);
|
|
1213
1213
|
},
|
|
1214
1214
|
children: [
|
|
1215
1215
|
/* @__PURE__ */ e(W, { children: /* @__PURE__ */ e(V, { sx: { bgcolor: k }, variant: "rounded", children: /* @__PURE__ */ e(D, { name: "local_offer", sx: { color: "text.primary" } }) }) }),
|
|
@@ -1228,28 +1228,28 @@ const ht = E(({ transaction: t }) => {
|
|
|
1228
1228
|
/* @__PURE__ */ e(
|
|
1229
1229
|
ie,
|
|
1230
1230
|
{
|
|
1231
|
-
ariaLabelClose:
|
|
1231
|
+
ariaLabelClose: n.close_aria,
|
|
1232
1232
|
isOpen: u,
|
|
1233
|
-
onClose: () =>
|
|
1234
|
-
onPrimaryAction:
|
|
1235
|
-
primaryText:
|
|
1236
|
-
secondaryText:
|
|
1233
|
+
onClose: () => g(!1),
|
|
1234
|
+
onPrimaryAction: f,
|
|
1235
|
+
primaryText: n.save_button,
|
|
1236
|
+
secondaryText: n.cancel_button,
|
|
1237
1237
|
title: s.tags_title,
|
|
1238
|
-
children: /* @__PURE__ */ e(Kt, { onTagChecked:
|
|
1238
|
+
children: /* @__PURE__ */ e(Kt, { onTagChecked: m, selectedTags: p })
|
|
1239
1239
|
}
|
|
1240
1240
|
)
|
|
1241
1241
|
] });
|
|
1242
|
-
}, Ht = E(Ft), Ut = ({ transaction: t, viewOnly:
|
|
1243
|
-
const { updateTransaction: i } = O(), { common: r, transactions: o } =
|
|
1242
|
+
}, Ht = E(Ft), Ut = ({ transaction: t, viewOnly: a = !1 }) => {
|
|
1243
|
+
const { updateTransaction: i } = O(), { common: r, transactions: o } = S(), { onEvent: n } = w(), { announce: s, ariaLive: l } = pe(), [_, u] = d.useState(!1), [g, p] = d.useState(""), h = d.useRef(null);
|
|
1244
1244
|
d.useEffect(() => {
|
|
1245
|
-
_ && (
|
|
1245
|
+
_ && (p(t.description), h?.current?.focus());
|
|
1246
1246
|
}, [_]);
|
|
1247
|
-
const
|
|
1248
|
-
u(!0),
|
|
1249
|
-
},
|
|
1250
|
-
|
|
1247
|
+
const m = () => {
|
|
1248
|
+
u(!0), n(y.ON_TRANSACTION_DESCRIPTION_EDIT_CLICK), setTimeout(() => document.getElementById("transaction-description-input")?.focus(), 0);
|
|
1249
|
+
}, f = async () => {
|
|
1250
|
+
n(H.TRANSACTION_DETAILS_CLICK_DESCRIPTION, {
|
|
1251
1251
|
transaction_guid: t.guid
|
|
1252
|
-
}), await i({ ...t, description:
|
|
1252
|
+
}), await i({ ...t, description: g }), u(!1), s(`${o.payee_title}: ${g}`), setTimeout(() => document.getElementById("transaction-description-edit-button")?.focus(), 0);
|
|
1253
1253
|
};
|
|
1254
1254
|
return /* @__PURE__ */ c(F, { className: "mx-txn-transaction-description", children: [
|
|
1255
1255
|
l,
|
|
@@ -1262,22 +1262,22 @@ const ht = E(({ transaction: t }) => {
|
|
|
1262
1262
|
inputProps: { maxLength: 140 },
|
|
1263
1263
|
label: o.payee_title,
|
|
1264
1264
|
name: o.payee_title,
|
|
1265
|
-
onChange: (L) =>
|
|
1266
|
-
ref:
|
|
1265
|
+
onChange: (L) => p(L.target.value),
|
|
1266
|
+
ref: h,
|
|
1267
1267
|
sx: {
|
|
1268
1268
|
backgroundColor: "background.paper",
|
|
1269
1269
|
".MuiOutlinedInput-root": { borderTopRightRadius: 0, borderBottomRightRadius: 0 },
|
|
1270
1270
|
".MuiOutlinedInput-input": { p: 11 },
|
|
1271
1271
|
width: 250
|
|
1272
1272
|
},
|
|
1273
|
-
value:
|
|
1273
|
+
value: g
|
|
1274
1274
|
}
|
|
1275
1275
|
),
|
|
1276
1276
|
/* @__PURE__ */ e(
|
|
1277
1277
|
oe,
|
|
1278
1278
|
{
|
|
1279
|
-
disabled: !
|
|
1280
|
-
onClick:
|
|
1279
|
+
disabled: !g,
|
|
1280
|
+
onClick: f,
|
|
1281
1281
|
sx: {
|
|
1282
1282
|
borderTopLeftRadius: 0,
|
|
1283
1283
|
borderBottomLeftRadius: 0
|
|
@@ -1288,12 +1288,12 @@ const ht = E(({ transaction: t }) => {
|
|
|
1288
1288
|
)
|
|
1289
1289
|
] }) : /* @__PURE__ */ c(v, { alignItems: "center", direction: "row", gap: 4, sx: { minHeight: 44 }, children: [
|
|
1290
1290
|
/* @__PURE__ */ e(x, { bold: !0, children: t.description }),
|
|
1291
|
-
!
|
|
1292
|
-
|
|
1291
|
+
!a && /* @__PURE__ */ e(
|
|
1292
|
+
ae,
|
|
1293
1293
|
{
|
|
1294
1294
|
"aria-label": o.payee_edit,
|
|
1295
1295
|
id: "transaction-description-edit-button",
|
|
1296
|
-
onClick:
|
|
1296
|
+
onClick: m,
|
|
1297
1297
|
sx: { color: "action.active" },
|
|
1298
1298
|
children: /* @__PURE__ */ e(le, { name: "create", size: 22 })
|
|
1299
1299
|
}
|
|
@@ -1301,44 +1301,44 @@ const ht = E(({ transaction: t }) => {
|
|
|
1301
1301
|
] })
|
|
1302
1302
|
] });
|
|
1303
1303
|
}, Vt = E(Ut), Wt = ({ transaction: t }) => {
|
|
1304
|
-
const { updateTransaction:
|
|
1305
|
-
r(H.TRANSACTION_DETAILS_CLICK_FLAG, { transaction_guid: t.guid }), await
|
|
1304
|
+
const { updateTransaction: a } = O(), { transactions: i } = S(), { onEvent: r } = w(), o = U(), n = o.palette.mode === "dark", s = async () => {
|
|
1305
|
+
r(H.TRANSACTION_DETAILS_CLICK_FLAG, { transaction_guid: t.guid }), await a({ ...t, is_flagged: !t.is_flagged });
|
|
1306
1306
|
};
|
|
1307
1307
|
return /* @__PURE__ */ e("div", { className: "mx-txn-transaction-flag", children: /* @__PURE__ */ e(
|
|
1308
1308
|
Xe,
|
|
1309
1309
|
{
|
|
1310
1310
|
"aria-label": i.flag_btn_aria,
|
|
1311
1311
|
"aria-pressed": t.is_flagged,
|
|
1312
|
-
color:
|
|
1312
|
+
color: n ? "primary" : "warning",
|
|
1313
1313
|
onClick: s,
|
|
1314
1314
|
selected: t.is_flagged,
|
|
1315
1315
|
sx: {
|
|
1316
1316
|
borderRadius: 6,
|
|
1317
|
-
color:
|
|
1317
|
+
color: n ? "common.white" : "secondary.main",
|
|
1318
1318
|
"&.Mui-selected": {
|
|
1319
|
-
color:
|
|
1320
|
-
backgroundColor:
|
|
1319
|
+
color: n ? "primary.main" : "common.white",
|
|
1320
|
+
backgroundColor: n ? Ce(o.palette.primary.main, 0.25) : "warning.dark",
|
|
1321
1321
|
":hover": {
|
|
1322
|
-
color:
|
|
1323
|
-
backgroundColor:
|
|
1322
|
+
color: n ? "primary.main" : "common.white",
|
|
1323
|
+
backgroundColor: n ? Ce(o.palette.primary.main, 0.2) : "warning.main"
|
|
1324
1324
|
}
|
|
1325
1325
|
},
|
|
1326
1326
|
":hover": {
|
|
1327
|
-
color:
|
|
1328
|
-
backgroundColor:
|
|
1327
|
+
color: n ? "common.white" : "warning.contrastText",
|
|
1328
|
+
backgroundColor: n ? Ce(o.palette.primary.main, 0.2) : "warning.light"
|
|
1329
1329
|
}
|
|
1330
1330
|
},
|
|
1331
1331
|
value: "flagged",
|
|
1332
1332
|
children: /* @__PURE__ */ e(Ze, { color: "inherit" })
|
|
1333
1333
|
}
|
|
1334
1334
|
) });
|
|
1335
|
-
}, Yt = E(Wt), se = (t,
|
|
1335
|
+
}, Yt = E(Wt), se = (t, a, i, r = !0, o = "inset") => r ? /* @__PURE__ */ c(d.Fragment, { children: [
|
|
1336
1336
|
/* @__PURE__ */ c(B, { disableGutters: !0, disablePadding: !0, children: [
|
|
1337
1337
|
/* @__PURE__ */ e(W, { children: /* @__PURE__ */ e(V, { sx: { bgcolor: "border.light" }, variant: "rounded", children: t }) }),
|
|
1338
1338
|
/* @__PURE__ */ e(
|
|
1339
1339
|
$,
|
|
1340
1340
|
{
|
|
1341
|
-
primary:
|
|
1341
|
+
primary: a,
|
|
1342
1342
|
primaryTypographyProps: { variant: "caption" },
|
|
1343
1343
|
secondary: i
|
|
1344
1344
|
}
|
|
@@ -1346,9 +1346,9 @@ const ht = E(({ transaction: t }) => {
|
|
|
1346
1346
|
] }),
|
|
1347
1347
|
/* @__PURE__ */ e(de, { variant: o })
|
|
1348
1348
|
] }) : null, zt = ({ transaction: t }) => {
|
|
1349
|
-
const { transactions:
|
|
1350
|
-
const o = new Map(i.map((
|
|
1351
|
-
return t.tags.map((
|
|
1349
|
+
const { transactions: a } = S(), { tags: i } = O(), r = d.useMemo(() => {
|
|
1350
|
+
const o = new Map(i.map((n) => [n.guid, n.name]));
|
|
1351
|
+
return t.tags.map((n) => o.get(n)).filter(Boolean).join(" / ");
|
|
1352
1352
|
}, [i, t.tags]);
|
|
1353
1353
|
return /* @__PURE__ */ c(ue, { sx: { "& .MuiListItem-root": { px: 24, py: 12 } }, children: [
|
|
1354
1354
|
se(
|
|
@@ -1361,42 +1361,44 @@ const ht = E(({ transaction: t }) => {
|
|
|
1361
1361
|
variant: Oe.Transparent
|
|
1362
1362
|
}
|
|
1363
1363
|
),
|
|
1364
|
-
|
|
1365
|
-
/* @__PURE__ */ e(x, { bold: !0, variant: "body1", children: t.category ??
|
|
1364
|
+
a.category_title,
|
|
1365
|
+
/* @__PURE__ */ e(x, { bold: !0, variant: "body1", children: t.category ?? a.actions_select_a_category })
|
|
1366
1366
|
),
|
|
1367
1367
|
se(
|
|
1368
1368
|
/* @__PURE__ */ e(le, { name: "calendar_month", sx: { color: "text.primary" }, weight: xe.Dark }),
|
|
1369
|
-
|
|
1369
|
+
a.date_title,
|
|
1370
1370
|
/* @__PURE__ */ e(x, { bold: !0, variant: "body1", children: Me(Ae(t.date), ke.YEAR_MONTH_DAY) })
|
|
1371
1371
|
),
|
|
1372
1372
|
se(
|
|
1373
1373
|
/* @__PURE__ */ e(le, { name: "article", sx: { color: "text.primary" }, weight: xe.Dark }),
|
|
1374
|
-
|
|
1375
|
-
/* @__PURE__ */ e(x, { bold: !0, sx: { overflowWrap: "break-word", whiteSpace: "wrap" }, variant: "body1", children: t.memo ??
|
|
1374
|
+
a.memo_title,
|
|
1375
|
+
/* @__PURE__ */ e(x, { bold: !0, sx: { overflowWrap: "break-word", whiteSpace: "wrap" }, variant: "body1", children: t.memo ?? a.memo_desc }),
|
|
1376
1376
|
!!t.memo,
|
|
1377
1377
|
t.tags?.length > 0 ? "inset" : "fullWidth"
|
|
1378
1378
|
),
|
|
1379
1379
|
se(
|
|
1380
1380
|
/* @__PURE__ */ e(le, { name: "local_offer", sx: { color: "text.primary" }, weight: xe.Dark }),
|
|
1381
|
-
|
|
1382
|
-
/* @__PURE__ */ e(x, { bold: !0, variant: "body1", children: t.tags?.length ? r :
|
|
1381
|
+
a.tags_title,
|
|
1382
|
+
/* @__PURE__ */ e(x, { bold: !0, variant: "body1", children: t.tags?.length ? r : a.tags_desc }),
|
|
1383
1383
|
!!t.tags?.length,
|
|
1384
1384
|
"fullWidth"
|
|
1385
1385
|
)
|
|
1386
1386
|
] });
|
|
1387
1387
|
}, jt = E(zt), qt = ({
|
|
1388
1388
|
bottomActions: t = _t,
|
|
1389
|
-
canFlagTransaction:
|
|
1389
|
+
canFlagTransaction: a = !0,
|
|
1390
1390
|
topActions: i = ut,
|
|
1391
1391
|
transaction: r
|
|
1392
1392
|
}) => {
|
|
1393
|
-
const { onEvent: o } = w(), { isCopyLoaded:
|
|
1394
|
-
|
|
1393
|
+
const { onEvent: o } = w(), { isCopyLoaded: n } = je(), { userFeatures: s } = qe(), { accounts: l } = S(), _ = U(), u = r?.number && r.number.length > 4;
|
|
1394
|
+
d.useEffect(
|
|
1395
1395
|
() => o(H.TRANSACTION_DETAILS_VIEW, { transaction_guid: r.guid }),
|
|
1396
1396
|
[]
|
|
1397
|
-
)
|
|
1397
|
+
);
|
|
1398
|
+
const g = t.includes(Z.MerchantBudget) && !r?.merchant_guid ? t.filter((m) => m !== Z.MerchantBudget) : t;
|
|
1399
|
+
if (!n)
|
|
1398
1400
|
return /* @__PURE__ */ e(dt, {});
|
|
1399
|
-
const p = Ve(s, "MX_TXN_DETAILS_VIEW_ONLY"),
|
|
1401
|
+
const p = Ve(s, "MX_TXN_DETAILS_VIEW_ONLY"), h = _.palette.mode === "dark" ? "grey.800" : "grey.100";
|
|
1400
1402
|
return /* @__PURE__ */ e(F, { className: "mx-txn-transaction-details", width: "100%", children: r && /* @__PURE__ */ c(v, { children: [
|
|
1401
1403
|
/* @__PURE__ */ c(v, { gap: 12, p: 24, children: [
|
|
1402
1404
|
/* @__PURE__ */ e(ce, { elevation: 2, sx: { width: 64 }, children: /* @__PURE__ */ e(
|
|
@@ -1413,40 +1415,40 @@ const ht = E(({ transaction: t }) => {
|
|
|
1413
1415
|
r.isIncome ? "+" : "",
|
|
1414
1416
|
q(r.amount, "0,0.00")
|
|
1415
1417
|
] }),
|
|
1416
|
-
!p &&
|
|
1418
|
+
!p && a && /* @__PURE__ */ e(Yt, { transaction: r })
|
|
1417
1419
|
] }),
|
|
1418
|
-
/* @__PURE__ */ c(v, { sx: { bgcolor:
|
|
1420
|
+
/* @__PURE__ */ c(v, { sx: { bgcolor: h, borderRadius: "4px", gap: 4, p: 8 }, children: [
|
|
1419
1421
|
/* @__PURE__ */ e(x, { bold: !0, children: `${r.account}
|
|
1420
1422
|
${u ? r.number : "•".repeat(4).concat(r.number ?? "")}` }),
|
|
1421
1423
|
/* @__PURE__ */ e(x, { bold: !0, variant: "tiny", children: r.feed_description })
|
|
1422
1424
|
] })
|
|
1423
1425
|
] }),
|
|
1424
|
-
/* @__PURE__ */ e(ce, { square: !0, sx: { boxShadow: "none" }, children: p ? /* @__PURE__ */ e(jt, { transaction: r }) : /* @__PURE__ */ e(ue, { children: i.map((m,
|
|
1425
|
-
m ===
|
|
1426
|
-
m ===
|
|
1427
|
-
m ===
|
|
1428
|
-
m ===
|
|
1426
|
+
/* @__PURE__ */ e(ce, { square: !0, sx: { boxShadow: "none" }, children: p ? /* @__PURE__ */ e(jt, { transaction: r }) : /* @__PURE__ */ e(ue, { children: i.map((m, f) => /* @__PURE__ */ c(d.Fragment, { children: [
|
|
1427
|
+
m === ne.Category && /* @__PURE__ */ e(yt, { transaction: r }),
|
|
1428
|
+
m === ne.Date && /* @__PURE__ */ e(Tt, { transaction: r }),
|
|
1429
|
+
m === ne.Memo && /* @__PURE__ */ e(It, { transaction: r }),
|
|
1430
|
+
m === ne.Tags && /* @__PURE__ */ e(Ht, { transaction: r }),
|
|
1429
1431
|
/* @__PURE__ */ e(
|
|
1430
1432
|
de,
|
|
1431
1433
|
{
|
|
1432
1434
|
component: "li",
|
|
1433
|
-
variant:
|
|
1435
|
+
variant: f < i.length - 1 ? "inset" : "fullWidth"
|
|
1434
1436
|
}
|
|
1435
1437
|
)
|
|
1436
1438
|
] }, m)) }) }),
|
|
1437
|
-
!p &&
|
|
1439
|
+
!p && g.length > 0 && /* @__PURE__ */ c(d.Fragment, { children: [
|
|
1438
1440
|
/* @__PURE__ */ e(x, { bold: !0, mb: 8, ml: 26, mt: 16, variant: "body1", children: l.actions }),
|
|
1439
1441
|
/* @__PURE__ */ e(ce, { square: !0, sx: { boxShadow: "none" }, children: /* @__PURE__ */ c(ue, { children: [
|
|
1440
|
-
|
|
1441
|
-
m ===
|
|
1442
|
-
m ===
|
|
1443
|
-
m ===
|
|
1444
|
-
m ===
|
|
1442
|
+
g.map((m, f) => /* @__PURE__ */ c(d.Fragment, { children: [
|
|
1443
|
+
m === Z.MerchantBudget && /* @__PURE__ */ e(ht, { transaction: r }),
|
|
1444
|
+
m === Z.SplitTransaction && /* @__PURE__ */ e(wt, { transaction: r }),
|
|
1445
|
+
m === Z.HideTransaction && /* @__PURE__ */ e(St, { transaction: r }),
|
|
1446
|
+
m === Z.MerchantLogo && /* @__PURE__ */ e(ft, { transaction: r }),
|
|
1445
1447
|
/* @__PURE__ */ e(
|
|
1446
1448
|
de,
|
|
1447
1449
|
{
|
|
1448
1450
|
component: "li",
|
|
1449
|
-
variant:
|
|
1451
|
+
variant: f < g.length - 1 ? "inset" : "fullWidth"
|
|
1450
1452
|
}
|
|
1451
1453
|
)
|
|
1452
1454
|
] }, m)),
|
|
@@ -1456,12 +1458,12 @@ const ht = E(({ transaction: t }) => {
|
|
|
1456
1458
|
] }) });
|
|
1457
1459
|
}, Hr = E(qt);
|
|
1458
1460
|
export {
|
|
1459
|
-
|
|
1461
|
+
Z as B,
|
|
1460
1462
|
yt as C,
|
|
1461
1463
|
Tt as D,
|
|
1462
1464
|
It as M,
|
|
1463
1465
|
Hr as T,
|
|
1464
1466
|
Ht as a,
|
|
1465
|
-
|
|
1467
|
+
ne as b,
|
|
1466
1468
|
mt as c
|
|
1467
1469
|
};
|