@mx-cartographer/experiences 9.7.166 → 9.7.167
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 +6 -2
- package/dist/common/components/dialog/Dialog.es.js +26 -29
- package/dist/common/components/dialog/Dialog.es.js.map +1 -1
- package/dist/transactions/components/shared/transactiondetails/actions/CategoryAction.es.js +51 -49
- package/dist/transactions/components/shared/transactiondetails/actions/CategoryAction.es.js.map +1 -1
- package/dist/transactions/components/transactionwidget/actions/EditCategoryAction.es.js +25 -23
- package/dist/transactions/components/transactionwidget/actions/EditCategoryAction.es.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
+
## [9.7.167] - 11-16-2026
|
|
2
|
+
|
|
3
|
+
- **FIXED** - Shared dialog titles are read by screen readers and wrap instead of being cut off, and dialogs use the paper background (WELL-202)
|
|
4
|
+
|
|
1
5
|
## [9.7.166] - 11-16-2026
|
|
2
6
|
|
|
3
7
|
- **FIXED** - Save Enough to Live On: 8px corners on the card table and the Make Transfer drawer's bottom card (WEC-2330)
|
|
4
|
-
- **CHANGED** - The Make Transfer drawer (Save Enough to Live On, Save an Extra
|
|
8
|
+
- **CHANGED** - The Make Transfer drawer (Save Enough to Live On, Save an Extra $100) uses the default back arrow, not a close X (WEC-2330)
|
|
5
9
|
- **FIXED** - Switch Direct Deposit's default card wash is at Figma's 127° (WEC-2330)
|
|
6
10
|
- **FIXED** - Upcoming Bill's drawer tip has no close button (WEC-2330)
|
|
7
11
|
- **CHANGED** - Upcoming Bill's drawer shows only the paid bills and opens on the latest (WEC-2330)
|
|
8
|
-
- **REMOVED** - Upcoming Bill's projected-bill tab and its "Projected amount" row, and the
|
|
12
|
+
- **REMOVED** - Upcoming Bill's projected-bill tab and its "Projected amount" row, and the unused `projected_amount` field of the insights feed copy type (WEC-2330)
|
|
9
13
|
|
|
10
14
|
## [9.7.165] - 11-16-2026
|
|
11
15
|
|
|
@@ -1,45 +1,42 @@
|
|
|
1
|
-
import { useScreenSize as
|
|
2
|
-
import { useFocusReturn as
|
|
3
|
-
import
|
|
4
|
-
import { DialogFooter as
|
|
5
|
-
import { jsx as o, jsxs as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
var G = ({ className: l, copy:
|
|
9
|
-
const { sx: a, ...
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
t && t(),
|
|
1
|
+
import { useScreenSize as W } from "../../hooks/useScreenSize.es.js";
|
|
2
|
+
import { useFocusReturn as j } from "../../hooks/useFocusReturn.es.js";
|
|
3
|
+
import v from "react";
|
|
4
|
+
import { DialogFooter as z, DialogHeader as H } from "@mxenabled/mxui";
|
|
5
|
+
import { jsx as o, jsxs as I } from "react/jsx-runtime";
|
|
6
|
+
import _ from "@mui/material/Dialog";
|
|
7
|
+
import C from "@mui/material/DialogContent";
|
|
8
|
+
var G = ({ className: l, copy: r, disablePrimaryButton: n = !1, showActions: m = !0, isOpen: e = !1, onClose: i, onPrimaryAction: c, primaryColor: d = "primary", primaryText: f = "Confirm", returnFocusTo: p, onSecondaryAction: t, secondaryColor: x = "primary", secondaryText: u = "Cancel", children: g, ...h }) => {
|
|
9
|
+
const { sx: a, ...b } = h, y = r?.title ?? "", D = r?.close_aria ?? "Close", s = v.useId(), { isSmallMobile: S } = W(), { onExited: P, onFocus: A, rootRef: F } = j(e, p), R = () => {
|
|
10
|
+
c?.(), i();
|
|
11
|
+
}, M = () => {
|
|
12
|
+
t && t(), i();
|
|
13
13
|
};
|
|
14
14
|
return /* @__PURE__ */ o("div", {
|
|
15
15
|
className: `mx-cmn-dialog ${l}`,
|
|
16
|
-
children: /* @__PURE__ */
|
|
16
|
+
children: /* @__PURE__ */ I(_, {
|
|
17
17
|
"aria-labelledby": s,
|
|
18
18
|
maxWidth: "xs",
|
|
19
|
-
onClose:
|
|
19
|
+
onClose: i,
|
|
20
20
|
open: e,
|
|
21
21
|
sx: [{
|
|
22
|
-
"& .MuiDialog-paperScrollPaper": { backgroundColor: "background.default" },
|
|
23
22
|
...S && { "& .MuiDialog-paper": { minWidth: "100%" } },
|
|
24
23
|
height: "100%"
|
|
25
24
|
}, ...a ? [a] : []],
|
|
26
|
-
...
|
|
25
|
+
...b,
|
|
27
26
|
disableRestoreFocus: !0,
|
|
28
27
|
onFocus: A,
|
|
29
28
|
ref: F,
|
|
30
29
|
slotProps: { transition: { onExited: P } },
|
|
31
30
|
children: [
|
|
32
|
-
/* @__PURE__ */ o(
|
|
33
|
-
ariaHidden: !0,
|
|
31
|
+
/* @__PURE__ */ o(H, {
|
|
34
32
|
copy: {
|
|
35
|
-
title:
|
|
36
|
-
close_aria:
|
|
33
|
+
title: y,
|
|
34
|
+
close_aria: D
|
|
37
35
|
},
|
|
38
36
|
id: s,
|
|
39
|
-
onClose:
|
|
40
|
-
truncate: !0
|
|
37
|
+
onClose: i
|
|
41
38
|
}),
|
|
42
|
-
/* @__PURE__ */ o(
|
|
39
|
+
/* @__PURE__ */ o(C, {
|
|
43
40
|
sx: {
|
|
44
41
|
boxSizing: "border-box",
|
|
45
42
|
lineHeight: 1.5,
|
|
@@ -47,14 +44,14 @@ var G = ({ className: l, copy: i, disablePrimaryButton: n = !1, showActions: c =
|
|
|
47
44
|
},
|
|
48
45
|
children: g
|
|
49
46
|
}),
|
|
50
|
-
|
|
47
|
+
m && /* @__PURE__ */ o(z, {
|
|
51
48
|
isPrimaryDisabled: n,
|
|
52
|
-
onPrimaryAction:
|
|
53
|
-
onSecondaryAction:
|
|
49
|
+
onPrimaryAction: R,
|
|
50
|
+
onSecondaryAction: M,
|
|
54
51
|
primaryColor: d,
|
|
55
|
-
primaryText:
|
|
56
|
-
secondaryColor:
|
|
57
|
-
secondaryText:
|
|
52
|
+
primaryText: f,
|
|
53
|
+
secondaryColor: x,
|
|
54
|
+
secondaryText: u
|
|
58
55
|
})
|
|
59
56
|
]
|
|
60
57
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.es.js","names":[],"sources":["../../../../src/common/components/dialog/Dialog.tsx"],"sourcesContent":["import React from 'react'\n\nimport MuiDialog from '@mui/material/Dialog'\nimport { DialogProps as MuiDialogProps } from '@mui/material/Dialog'\nimport DialogContent from '@mui/material/DialogContent'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { DialogFooter, DialogHeader } from '@mxenabled/mxui'\nimport { useScreenSize } from '../../hooks'\nimport { useFocusReturn } from '../../hooks/useFocusReturn'\n\nexport type CopyObject = {\n close_aria?: string\n title: string\n}\n\ntype OwnedMuiProps =\n | 'disableRestoreFocus'\n | 'onFocus'\n | 'open'\n | 'slotProps'\n | 'slots'\n | 'TransitionComponent'\n | 'TransitionProps'\n\nexport interface DialogProps extends Omit<MuiDialogProps, OwnedMuiProps> {\n className?: string\n copy: CopyObject\n disablePrimaryButton?: boolean\n /** Render the footer action buttons. Default true; content-only dialogs (e.g. the insights survey modal) pass false. */\n showActions?: boolean\n isOpen: boolean\n onClose: (event?: unknown, reason?: string) => void\n onPrimaryAction?: () => void\n onSecondaryAction?: () => void\n primaryColor?: 'primary' | 'inherit' | 'secondary' | 'success' | 'error' | 'info' | 'warning'\n primaryText?: string\n /** Where focus goes on close. Takes precedence over the element that opened the dialog. */\n returnFocusTo?: React.RefObject<HTMLElement | null>\n secondaryColor?: 'primary' | 'inherit' | 'secondary' | 'success' | 'error' | 'info' | 'warning'\n secondaryText?: string\n}\n\nconst Dialog: React.FC<React.PropsWithChildren<DialogProps>> = ({\n className,\n copy,\n disablePrimaryButton = false,\n showActions = true,\n isOpen = false,\n onClose,\n onPrimaryAction,\n primaryColor = 'primary',\n primaryText = 'Confirm',\n returnFocusTo,\n onSecondaryAction,\n secondaryColor = 'primary',\n secondaryText = 'Cancel',\n children,\n ...rest\n}) => {\n // Extract sx from rest to merge with Dialog's own styles instead of overwriting\n const { sx: restSx, ...restProps } = rest\n const title = copy?.title ?? ''\n const closeAria = copy?.close_aria ?? 'Close'\n\n
|
|
1
|
+
{"version":3,"file":"Dialog.es.js","names":[],"sources":["../../../../src/common/components/dialog/Dialog.tsx"],"sourcesContent":["import React from 'react'\n\nimport MuiDialog from '@mui/material/Dialog'\nimport { DialogProps as MuiDialogProps } from '@mui/material/Dialog'\nimport DialogContent from '@mui/material/DialogContent'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { DialogFooter, DialogHeader } from '@mxenabled/mxui'\nimport { useScreenSize } from '../../hooks'\nimport { useFocusReturn } from '../../hooks/useFocusReturn'\n\nexport type CopyObject = {\n close_aria?: string\n title: string\n}\n\ntype OwnedMuiProps =\n | 'disableRestoreFocus'\n | 'onFocus'\n | 'open'\n | 'slotProps'\n | 'slots'\n | 'TransitionComponent'\n | 'TransitionProps'\n\nexport interface DialogProps extends Omit<MuiDialogProps, OwnedMuiProps> {\n className?: string\n copy: CopyObject\n disablePrimaryButton?: boolean\n /** Render the footer action buttons. Default true; content-only dialogs (e.g. the insights survey modal) pass false. */\n showActions?: boolean\n isOpen: boolean\n onClose: (event?: unknown, reason?: string) => void\n onPrimaryAction?: () => void\n onSecondaryAction?: () => void\n primaryColor?: 'primary' | 'inherit' | 'secondary' | 'success' | 'error' | 'info' | 'warning'\n primaryText?: string\n /** Where focus goes on close. Takes precedence over the element that opened the dialog. */\n returnFocusTo?: React.RefObject<HTMLElement | null>\n secondaryColor?: 'primary' | 'inherit' | 'secondary' | 'success' | 'error' | 'info' | 'warning'\n secondaryText?: string\n}\n\nconst Dialog: React.FC<React.PropsWithChildren<DialogProps>> = ({\n className,\n copy,\n disablePrimaryButton = false,\n showActions = true,\n isOpen = false,\n onClose,\n onPrimaryAction,\n primaryColor = 'primary',\n primaryText = 'Confirm',\n returnFocusTo,\n onSecondaryAction,\n secondaryColor = 'primary',\n secondaryText = 'Cancel',\n children,\n ...rest\n}) => {\n // Extract sx from rest to merge with Dialog's own styles instead of overwriting\n const { sx: restSx, ...restProps } = rest\n const title = copy?.title ?? ''\n const closeAria = copy?.close_aria ?? 'Close'\n\n const titleId = React.useId()\n\n const { isSmallMobile } = useScreenSize()\n\n const { onExited, onFocus, rootRef } = useFocusReturn(isOpen, returnFocusTo)\n\n const handlePrimaryAction = () => {\n onPrimaryAction?.()\n onClose()\n }\n\n const handleSecondaryAction = () => {\n if (onSecondaryAction) {\n onSecondaryAction()\n }\n onClose()\n }\n\n return (\n <div className={`mx-cmn-dialog ${className}`}>\n <MuiDialog\n aria-labelledby={titleId}\n maxWidth=\"xs\"\n onClose={onClose}\n open={isOpen}\n sx={\n [\n {\n ...(isSmallMobile && { '& .MuiDialog-paper': { minWidth: '100%' } }),\n height: '100%',\n },\n ...(restSx ? [restSx] : []),\n ] as SxProps\n }\n {...restProps}\n disableRestoreFocus={true}\n onFocus={onFocus}\n ref={rootRef}\n slotProps={{ transition: { onExited } }}\n >\n {/* Do not aria-hide the heading: JAWS then reads no dialog name. */}\n <DialogHeader copy={{ title, close_aria: closeAria }} id={titleId} onClose={onClose} />\n\n <DialogContent sx={{ boxSizing: 'border-box', lineHeight: 1.5, maxWidth: '100%' }}>\n {children}\n </DialogContent>\n\n {showActions && (\n <DialogFooter\n isPrimaryDisabled={disablePrimaryButton}\n onPrimaryAction={handlePrimaryAction}\n onSecondaryAction={handleSecondaryAction}\n primaryColor={primaryColor}\n primaryText={primaryText}\n secondaryColor={secondaryColor}\n secondaryText={secondaryText}\n />\n )}\n </MuiDialog>\n </div>\n )\n}\n\nexport default Dialog\n"],"mappings":";;;;;;;AA2CA,IAAM,IAAA,CAA0D,EAC9D,WAAA,GACA,MAAA,GACA,sBAAA,IAAuB,IACvB,aAAA,IAAc,IACd,QAAA,IAAS,IACT,SAAA,GACA,iBAAA,GACA,cAAA,IAAe,WACf,aAAA,IAAc,WACd,eAAA,GACA,mBAAA,GACA,gBAAA,IAAiB,WACjB,eAAA,IAAgB,UAChB,UAAA,GACA,GAAG,EAAA,MACC;AAEJ,QAAM,EAAE,IAAI,GAAQ,GAAG,EAAA,IAAc,GAC/B,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A,UACG,gBAAA;AAAA,UACD,eAAA;AAAA,QAChB,CAAA;AAAA,MAEM;AAAA;EACR,CAAA;AAET"}
|
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
import { buildDynamicCopy as
|
|
2
|
-
import { useCategoryStore as
|
|
3
|
-
import
|
|
4
|
-
import { ANALYTICS_EVENTS as
|
|
5
|
-
import { useTransactionsUiStore as
|
|
6
|
-
import { ON_CLICK_EVENTS as
|
|
7
|
-
import
|
|
1
|
+
import { buildDynamicCopy as y } from "../../../../../core/utils/Localization.es.js";
|
|
2
|
+
import { useCategoryStore as L, useEvent as E, useGlobalCopyStore as N, useTransactionStore as O } from "../../../../../common/context/hooks.es.js";
|
|
3
|
+
import R from "../../../../../common/components/dialog/Dialog.es.js";
|
|
4
|
+
import { ANALYTICS_EVENTS as w } from "../../../../../common/constants/Analytics.es.js";
|
|
5
|
+
import { useTransactionsUiStore as D } from "../../../../context/hooks.es.js";
|
|
6
|
+
import { ON_CLICK_EVENTS as G } from "../../../../constants/OnClickEvents.es.js";
|
|
7
|
+
import P from "../../../../../categories/components/CategorySelectorDrawer.es.js";
|
|
8
8
|
import i from "react";
|
|
9
|
-
import { CategoryIcon as
|
|
10
|
-
import { Icon as
|
|
11
|
-
import { jsx as t, jsxs as
|
|
12
|
-
import { useTheme as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
var
|
|
20
|
-
const { addOrUpdateTransactionRule:
|
|
21
|
-
await
|
|
9
|
+
import { CategoryIcon as K, CategoryIconVariants as V, P as Y, Text as j } from "@mxenabled/mxui";
|
|
10
|
+
import { Icon as k } from "@mxenabled/mx-icons";
|
|
11
|
+
import { jsx as t, jsxs as g } from "react/jsx-runtime";
|
|
12
|
+
import { useTheme as z } from "@mui/material/styles";
|
|
13
|
+
import B from "@mui/material/ListItem";
|
|
14
|
+
import M from "@mui/material/Avatar";
|
|
15
|
+
import U from "@mui/material/ListItemAvatar";
|
|
16
|
+
import F from "@mui/material/ListItemButton";
|
|
17
|
+
import W from "@mui/material/ListItemIcon";
|
|
18
|
+
import $ from "@mui/material/ListItemText";
|
|
19
|
+
var pe = ({ transaction: e }) => {
|
|
20
|
+
const { addOrUpdateTransactionRule: f, updateTransaction: C } = O(), { categories: s } = L(), { onEvent: c } = E(), { setShouldDisableDrawerScroll: T, updateManualTransaction: h } = D(), { transactions: r } = N(), S = z(), l = i.useRef(null), m = i.useId(), [I, d] = i.useState(!1), [a, n] = i.useState(""), p = async (o) => {
|
|
21
|
+
await C({
|
|
22
22
|
...e,
|
|
23
23
|
category_guid: a
|
|
24
|
-
}), o && await
|
|
25
|
-
},
|
|
24
|
+
}), o && await f(a, e), n(""), c(w.TRANSACTION_DETAILS_CLICK_CATEGORY, { transaction_guid: e.guid });
|
|
25
|
+
}, x = (o) => {
|
|
26
26
|
if (e.is_manual && !e.guid) {
|
|
27
|
-
const _ = s.find((
|
|
28
|
-
|
|
27
|
+
const _ = s.find((b) => b.guid === o);
|
|
28
|
+
h({
|
|
29
29
|
...e,
|
|
30
30
|
category: _?.name,
|
|
31
31
|
category_guid: o,
|
|
32
32
|
top_level_category_guid: _?.parent_guid || o
|
|
33
33
|
});
|
|
34
34
|
} else n(o);
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
return /* @__PURE__ */
|
|
35
|
+
u();
|
|
36
|
+
}, u = () => {
|
|
37
|
+
d(!1), T(!1);
|
|
38
|
+
}, A = i.useMemo(() => s.find((o) => o.guid === a), [a]), v = S.palette.mode === "dark" ? "grey.800" : "grey.100";
|
|
39
|
+
return /* @__PURE__ */ g(B, {
|
|
40
40
|
disableGutters: !0,
|
|
41
41
|
disablePadding: !0,
|
|
42
42
|
children: [
|
|
43
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ g(F, {
|
|
44
44
|
ref: l,
|
|
45
45
|
onClick: () => {
|
|
46
|
-
c(
|
|
46
|
+
c(G.ON_TRANSACTION_CATEGORY_CLICK), d(!0);
|
|
47
47
|
},
|
|
48
48
|
children: [
|
|
49
|
-
/* @__PURE__ */ t(
|
|
50
|
-
sx: { bgcolor:
|
|
49
|
+
/* @__PURE__ */ t(U, { children: /* @__PURE__ */ t(M, {
|
|
50
|
+
sx: { bgcolor: v },
|
|
51
51
|
variant: "rounded",
|
|
52
|
-
children: /* @__PURE__ */ t(
|
|
52
|
+
children: /* @__PURE__ */ t(K, {
|
|
53
53
|
categoryGuid: e.top_level_category_guid,
|
|
54
54
|
icon_ratio: 1,
|
|
55
55
|
size: 20,
|
|
56
56
|
sx: { color: "text.primary" },
|
|
57
|
-
variant:
|
|
57
|
+
variant: V.Transparent
|
|
58
58
|
})
|
|
59
59
|
}) }),
|
|
60
|
-
/* @__PURE__ */ t(
|
|
60
|
+
/* @__PURE__ */ t($, {
|
|
61
61
|
primary: r.category_title,
|
|
62
|
-
secondary: /* @__PURE__ */ t(
|
|
62
|
+
secondary: /* @__PURE__ */ t(j, {
|
|
63
63
|
bold: !0,
|
|
64
64
|
sx: { color: "text.primary" },
|
|
65
65
|
variant: "body1",
|
|
@@ -71,38 +71,40 @@ var de = ({ transaction: e }) => {
|
|
|
71
71
|
fontWeight: "normal"
|
|
72
72
|
} }
|
|
73
73
|
}),
|
|
74
|
-
/* @__PURE__ */ t(
|
|
74
|
+
/* @__PURE__ */ t(W, { children: /* @__PURE__ */ t(k, {
|
|
75
75
|
name: "chevron_right",
|
|
76
76
|
sx: { color: "text.primary" }
|
|
77
77
|
}) })
|
|
78
78
|
]
|
|
79
79
|
}),
|
|
80
|
-
/* @__PURE__ */ t(
|
|
80
|
+
/* @__PURE__ */ t(P, {
|
|
81
81
|
initialSelected: e.category_guid,
|
|
82
|
-
onClose:
|
|
83
|
-
onSelect:
|
|
84
|
-
showDrawer:
|
|
82
|
+
onClose: u,
|
|
83
|
+
onSelect: x,
|
|
84
|
+
showDrawer: I,
|
|
85
85
|
title: r.actions_select_a_category
|
|
86
86
|
}),
|
|
87
|
-
/* @__PURE__ */ t(
|
|
88
|
-
|
|
87
|
+
/* @__PURE__ */ t(R, {
|
|
88
|
+
"aria-describedby": m,
|
|
89
|
+
copy: { title: y(r.actions_apply_to_all_transaction_types, e.description) },
|
|
89
90
|
isOpen: !!a,
|
|
90
91
|
onClose: () => n(""),
|
|
91
|
-
onPrimaryAction: () =>
|
|
92
|
-
onSecondaryAction: () =>
|
|
92
|
+
onPrimaryAction: () => p(!0),
|
|
93
|
+
onSecondaryAction: () => p(!1),
|
|
93
94
|
primaryText: r.actions_apply_to_all,
|
|
94
95
|
returnFocusTo: l,
|
|
95
96
|
secondaryText: r.actions_this_time_only,
|
|
96
|
-
children: /* @__PURE__ */ t(
|
|
97
|
+
children: /* @__PURE__ */ t(Y, {
|
|
98
|
+
id: m,
|
|
97
99
|
variant: "subtitle1",
|
|
98
|
-
children:
|
|
100
|
+
children: y(r.actions_all_past_and_future, /* @__PURE__ */ t("strong", { children: e.description }), A?.name)
|
|
99
101
|
})
|
|
100
102
|
})
|
|
101
103
|
]
|
|
102
104
|
});
|
|
103
105
|
};
|
|
104
106
|
export {
|
|
105
|
-
|
|
107
|
+
pe as default
|
|
106
108
|
};
|
|
107
109
|
|
|
108
110
|
//# sourceMappingURL=CategoryAction.es.js.map
|
package/dist/transactions/components/shared/transactiondetails/actions/CategoryAction.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CategoryAction.es.js","names":[],"sources":["../../../../../../src/transactions/components/shared/transactiondetails/actions/CategoryAction.tsx"],"sourcesContent":["import React from 'react'\n\nimport Avatar from '@mui/material/Avatar'\nimport ListItem from '@mui/material/ListItem'\nimport ListItemAvatar from '@mui/material/ListItemAvatar'\nimport ListItemButton from '@mui/material/ListItemButton'\nimport ListItemIcon from '@mui/material/ListItemIcon'\nimport ListItemText from '@mui/material/ListItemText'\nimport { useTheme } from '@mui/material/styles'\n\nimport { CategoryIcon, CategoryIconVariants, P, Text } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\nimport { CategorySelectorDrawer } from '../../../../../categories'\n\nimport {\n ANALYTICS_EVENTS,\n Dialog,\n useCategoryStore,\n useGlobalCopyStore,\n} from '../../../../../common'\nimport type { Transaction } from '../../../../../core'\n\nimport { ON_CLICK_EVENTS } from '../../../../constants/OnClickEvents'\nimport { useTransactionsUiStore } from '../../../../context/hooks'\nimport { useEvent, useTransactionStore } from '../../../../../common'\nimport { buildDynamicCopy } from '../../../../../core/utils/Localization'\n\ninterface CategoryActionProps {\n transaction: Transaction\n}\n\nconst CategoryAction: React.FC<CategoryActionProps> = ({ transaction }) => {\n const { addOrUpdateTransactionRule, updateTransaction } = useTransactionStore()\n const { categories } = useCategoryStore()\n const { onEvent } = useEvent()\n const { setShouldDisableDrawerScroll, updateManualTransaction } = useTransactionsUiStore()\n const { transactions: copy } = useGlobalCopyStore()\n\n const theme = useTheme()\n\n const categoryRowRef = React.useRef<HTMLDivElement>(null)\n const [open, setOpen] = React.useState(false)\n const [selectedGuid, setSelectedGuid] = React.useState('')\n\n const handleCategoryChange = async (applyToAll: boolean) => {\n await updateTransaction({ ...transaction, category_guid: selectedGuid })\n if (applyToAll) {\n await addOrUpdateTransactionRule(selectedGuid, transaction)\n }\n setSelectedGuid('')\n onEvent(ANALYTICS_EVENTS.TRANSACTION_DETAILS_CLICK_CATEGORY, {\n transaction_guid: transaction.guid,\n })\n }\n\n const handleSelected = (guid: string) => {\n if (transaction.is_manual && !transaction.guid) {\n const category = categories.find((c) => c.guid === guid)\n updateManualTransaction({\n ...transaction,\n category: category?.name,\n category_guid: guid,\n top_level_category_guid: category?.parent_guid || guid,\n })\n } else {\n setSelectedGuid(guid)\n }\n\n handleCloseDrawer()\n }\n\n const handleCloseDrawer = () => {\n setOpen(false)\n setShouldDisableDrawerScroll(false)\n }\n\n const category = React.useMemo(\n () => categories.find((item) => item.guid === selectedGuid),\n [selectedGuid],\n )\n\n const bgColor = theme.palette.mode === 'dark' ? 'grey.800' : 'grey.100'\n\n return (\n <ListItem disableGutters={true} disablePadding={true}>\n <ListItemButton\n ref={categoryRowRef}\n onClick={() => {\n onEvent(ON_CLICK_EVENTS.ON_TRANSACTION_CATEGORY_CLICK)\n setOpen(true)\n }}\n >\n <ListItemAvatar>\n <Avatar sx={{ bgcolor: bgColor }} variant=\"rounded\">\n <CategoryIcon\n categoryGuid={transaction.top_level_category_guid}\n icon_ratio={1}\n size={20}\n sx={{ color: 'text.primary' }}\n variant={CategoryIconVariants.Transparent}\n />\n </Avatar>\n </ListItemAvatar>\n <ListItemText\n primary={copy.category_title}\n secondary={\n <Text bold={true} sx={{ color: 'text.primary' }} variant=\"body1\">\n {transaction.category ?? copy.actions_select_a_category}\n </Text>\n }\n slotProps={{ primary: { variant: 'caption', fontSize: 11, fontWeight: 'normal' } }}\n />\n <ListItemIcon>\n <Icon name=\"chevron_right\" sx={{ color: 'text.primary' }} />\n </ListItemIcon>\n </ListItemButton>\n\n <CategorySelectorDrawer\n initialSelected={transaction.category_guid}\n onClose={handleCloseDrawer}\n onSelect={handleSelected}\n showDrawer={open}\n title={copy.actions_select_a_category}\n />\n\n <Dialog\n copy={{\n title: buildDynamicCopy(\n copy.actions_apply_to_all_transaction_types,\n transaction.description,\n ) as string,\n }}\n isOpen={Boolean(selectedGuid)}\n onClose={() => setSelectedGuid('')}\n onPrimaryAction={() => handleCategoryChange(true)}\n onSecondaryAction={() => handleCategoryChange(false)}\n primaryText={copy.actions_apply_to_all}\n returnFocusTo={categoryRowRef}\n secondaryText={copy.actions_this_time_only}\n >\n <P variant=\"subtitle1\">\n {\n buildDynamicCopy(\n copy.actions_all_past_and_future,\n transaction.description
|
|
1
|
+
{"version":3,"file":"CategoryAction.es.js","names":[],"sources":["../../../../../../src/transactions/components/shared/transactiondetails/actions/CategoryAction.tsx"],"sourcesContent":["import React from 'react'\n\nimport Avatar from '@mui/material/Avatar'\nimport ListItem from '@mui/material/ListItem'\nimport ListItemAvatar from '@mui/material/ListItemAvatar'\nimport ListItemButton from '@mui/material/ListItemButton'\nimport ListItemIcon from '@mui/material/ListItemIcon'\nimport ListItemText from '@mui/material/ListItemText'\nimport { useTheme } from '@mui/material/styles'\n\nimport { CategoryIcon, CategoryIconVariants, P, Text } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\nimport { CategorySelectorDrawer } from '../../../../../categories'\n\nimport {\n ANALYTICS_EVENTS,\n Dialog,\n useCategoryStore,\n useGlobalCopyStore,\n} from '../../../../../common'\nimport type { Transaction } from '../../../../../core'\n\nimport { ON_CLICK_EVENTS } from '../../../../constants/OnClickEvents'\nimport { useTransactionsUiStore } from '../../../../context/hooks'\nimport { useEvent, useTransactionStore } from '../../../../../common'\nimport { buildDynamicCopy } from '../../../../../core/utils/Localization'\n\ninterface CategoryActionProps {\n transaction: Transaction\n}\n\nconst CategoryAction: React.FC<CategoryActionProps> = ({ transaction }) => {\n const { addOrUpdateTransactionRule, updateTransaction } = useTransactionStore()\n const { categories } = useCategoryStore()\n const { onEvent } = useEvent()\n const { setShouldDisableDrawerScroll, updateManualTransaction } = useTransactionsUiStore()\n const { transactions: copy } = useGlobalCopyStore()\n\n const theme = useTheme()\n\n const categoryRowRef = React.useRef<HTMLDivElement>(null)\n const messageId = React.useId()\n const [open, setOpen] = React.useState(false)\n const [selectedGuid, setSelectedGuid] = React.useState('')\n\n const handleCategoryChange = async (applyToAll: boolean) => {\n await updateTransaction({ ...transaction, category_guid: selectedGuid })\n if (applyToAll) {\n await addOrUpdateTransactionRule(selectedGuid, transaction)\n }\n setSelectedGuid('')\n onEvent(ANALYTICS_EVENTS.TRANSACTION_DETAILS_CLICK_CATEGORY, {\n transaction_guid: transaction.guid,\n })\n }\n\n const handleSelected = (guid: string) => {\n if (transaction.is_manual && !transaction.guid) {\n const category = categories.find((c) => c.guid === guid)\n updateManualTransaction({\n ...transaction,\n category: category?.name,\n category_guid: guid,\n top_level_category_guid: category?.parent_guid || guid,\n })\n } else {\n setSelectedGuid(guid)\n }\n\n handleCloseDrawer()\n }\n\n const handleCloseDrawer = () => {\n setOpen(false)\n setShouldDisableDrawerScroll(false)\n }\n\n const category = React.useMemo(\n () => categories.find((item) => item.guid === selectedGuid),\n [selectedGuid],\n )\n\n const bgColor = theme.palette.mode === 'dark' ? 'grey.800' : 'grey.100'\n\n return (\n <ListItem disableGutters={true} disablePadding={true}>\n <ListItemButton\n ref={categoryRowRef}\n onClick={() => {\n onEvent(ON_CLICK_EVENTS.ON_TRANSACTION_CATEGORY_CLICK)\n setOpen(true)\n }}\n >\n <ListItemAvatar>\n <Avatar sx={{ bgcolor: bgColor }} variant=\"rounded\">\n <CategoryIcon\n categoryGuid={transaction.top_level_category_guid}\n icon_ratio={1}\n size={20}\n sx={{ color: 'text.primary' }}\n variant={CategoryIconVariants.Transparent}\n />\n </Avatar>\n </ListItemAvatar>\n <ListItemText\n primary={copy.category_title}\n secondary={\n <Text bold={true} sx={{ color: 'text.primary' }} variant=\"body1\">\n {transaction.category ?? copy.actions_select_a_category}\n </Text>\n }\n slotProps={{ primary: { variant: 'caption', fontSize: 11, fontWeight: 'normal' } }}\n />\n <ListItemIcon>\n <Icon name=\"chevron_right\" sx={{ color: 'text.primary' }} />\n </ListItemIcon>\n </ListItemButton>\n\n <CategorySelectorDrawer\n initialSelected={transaction.category_guid}\n onClose={handleCloseDrawer}\n onSelect={handleSelected}\n showDrawer={open}\n title={copy.actions_select_a_category}\n />\n\n <Dialog\n aria-describedby={messageId}\n copy={{\n title: buildDynamicCopy(\n copy.actions_apply_to_all_transaction_types,\n transaction.description,\n ) as string,\n }}\n isOpen={Boolean(selectedGuid)}\n onClose={() => setSelectedGuid('')}\n onPrimaryAction={() => handleCategoryChange(true)}\n onSecondaryAction={() => handleCategoryChange(false)}\n primaryText={copy.actions_apply_to_all}\n returnFocusTo={categoryRowRef}\n secondaryText={copy.actions_this_time_only}\n >\n <P id={messageId} variant=\"subtitle1\">\n {\n buildDynamicCopy(\n copy.actions_all_past_and_future,\n <strong>{transaction.description}</strong>,\n category?.name,\n ) as React.ReactNode\n }\n </P>\n </Dialog>\n </ListItem>\n )\n}\n\nexport default CategoryAction\n"],"mappings":";;;;;;;;;;;;;;;;;;AA+BA,IAAM,KAAA,CAAiD,EAAE,aAAA,EAAA,MAAkB;AACzE,QAAM,EAAE,4BAAA,GAA4B,mBAAA,EAAA,IAAsB,EAAoB,GACxE,EAAE,YAAA,EAAA,IAAe,EAAiB,GAClC,EAAE,SAAA,EAAA,IAAY,EAAS,GACvB,EAAE,8BAAA,GAA8B,yBAAA,EAAA,IAA4B,EAAuB,GACnF,EAAE,cAAc,EAAA,IAAS,EAAmB,GAE5C,IAAQ,EAAS,GAEjB,IAAiB,EAAM,OAAuB,IAAI,GAClD,IAAY,EAAM,MAAM,GACxB,CAAC,GAAM,CAAA,IAAW,EAAM,SAAS,EAAK,GACtC,CAAC,GAAc,CAAA,IAAmB,EAAM,SAAS,EAAE,GAEnD,IAAuB,OAAO,MAAwB;AAC1D,UAAM,EAAkB;AAAA,MAAE,GAAG;AAAA,MAAa,eAAe;AAAA,IAAa,CAAC,GACnE,KACF,MAAM,EAA2B,GAAc,CAAW,GAE5D,EAAgB,EAAE,GAClB,EAAQ,EAAiB,oCAAoC,EAC3D,kBAAkB,EAAY,KAChC,CAAC;AAAA,EACH,GAEM,IAAA,CAAkB,MAAiB;AACvC,QAAI,EAAY,aAAa,CAAC,EAAY,MAAM;AAC9C,YAAM,IAAW,EAAW,KAAA,CAAM,MAAM,EAAE,SAAS,CAAI;AACvD,MAAA,EAAwB;AAAA,QACtB,GAAG;AAAA,QACH,UAAU,GAAU;AAAA,QACpB,eAAe;AAAA,QACf,yBAAyB,GAAU,eAAe;AAAA,MACpD,CAAC;AAAA,IACH,MACE,CAAA,EAAgB,CAAI;AAGtB,IAAA,EAAkB;AAAA,EACpB,GAEM,IAAA,MAA0B;AAC9B,IAAA,EAAQ,EAAK,GACb,EAA6B,EAAK;AAAA,E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AAD;AAAA,QACE,iBAAiB,EAAY;AAAA,QAC7B,SAAS;AAAA,QACT,UAAU;AAAA,QACV,YAAY;AAAA,QACZ,OAAO,EAAK;AAAA,MACb,CAAA;AAAA,MAED,gBAAA,EAAC,GAAD;AAAA,QACE,oBAAkB;AAAA,QAClB,MAAM,EACJ,OAAO,EACL,EAAK,wCACL,EAAY,WACd,EACF;AAAA,QACA,QAAQ,EAAQ;AAAA,QAChB,SAAA,MAAe,EAAgB,EAAE;AAAA,QACjC,iBAAA,MAAuB,EAAqB,EAAI;AAAA,QAChD,mBAAA,MAAyB,EAAqB,EAAK;AAAA,QACnD,aAAa,EAAK;AAAA,QAClB,eAAe;AAAA,QACf,eAAe,EAAK;AAAA,QAEpB,UAAA,gBAAA,EAAC,GAAD;AAAA,UAAG,IAAI;AAAA,UAAW,SAAQ;AAAA,UAEtB,UAAA,EACE,EAAK,6BACL,gBAAA,EAAC,UAAD,EAAA,UAAS,EAAY,YAAoB,CAAA,GACzC,GAAU,IACZ;AAAA,QAED,CAAA;AAAA,MACG,CAAA;AAAA,IACA;AAAA;AAEd"}
|
|
@@ -1,38 +1,40 @@
|
|
|
1
|
-
import { buildDynamicCopy as
|
|
2
|
-
import { useCategoryStore as _, useGlobalCopyStore as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { buildDynamicCopy as l } from "../../../../core/utils/Localization.es.js";
|
|
2
|
+
import { useCategoryStore as _, useGlobalCopyStore as g, useTransactionStore as f } from "../../../../common/context/hooks.es.js";
|
|
3
|
+
import C from "../../../../common/components/dialog/Dialog.es.js";
|
|
4
|
+
import h from "../../../../categories/components/CategorySelectorDrawer.es.js";
|
|
5
|
+
import s from "react";
|
|
6
6
|
import { observer as x } from "mobx-react-lite";
|
|
7
7
|
import { P as S } from "@mxenabled/mxui";
|
|
8
|
-
import { jsx as
|
|
8
|
+
import { jsx as r, jsxs as b } from "react/jsx-runtime";
|
|
9
9
|
import w from "@mui/material/Box";
|
|
10
10
|
var T = ({ onClose: c, transaction: t }) => {
|
|
11
|
-
const { addOrUpdateTransactionRule:
|
|
12
|
-
await
|
|
11
|
+
const { addOrUpdateTransactionRule: m, updateTransaction: y } = f(), { transactions: e } = g(), { categories: p } = _(), [o, n] = s.useState(""), d = s.useId(), u = s.useMemo(() => p.find((a) => a.guid === o), [o]), i = async (a) => {
|
|
12
|
+
await y({
|
|
13
13
|
...t,
|
|
14
|
-
category_guid:
|
|
15
|
-
}), a && await
|
|
14
|
+
category_guid: o
|
|
15
|
+
}), a && await m(o, t), n(""), c();
|
|
16
16
|
};
|
|
17
|
-
return /* @__PURE__ */
|
|
17
|
+
return /* @__PURE__ */ b(w, {
|
|
18
18
|
className: "mx-txn-edit-category-action",
|
|
19
|
-
children: [/* @__PURE__ */
|
|
19
|
+
children: [/* @__PURE__ */ r(h, {
|
|
20
20
|
initialSelected: t.category_guid,
|
|
21
21
|
onClose: c,
|
|
22
22
|
onSelect: (a) => n(a),
|
|
23
23
|
showDrawer: !!t,
|
|
24
|
-
title:
|
|
25
|
-
}), /* @__PURE__ */
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
title: e.actions_select_a_category
|
|
25
|
+
}), /* @__PURE__ */ r(C, {
|
|
26
|
+
"aria-describedby": d,
|
|
27
|
+
copy: { title: l(e.actions_apply_to_all_transaction_types, t.description) },
|
|
28
|
+
isOpen: !!o,
|
|
29
|
+
onClose: () => i(!1),
|
|
30
|
+
onPrimaryAction: () => i(!0),
|
|
31
|
+
onSecondaryAction: () => i(!1),
|
|
32
|
+
primaryText: e.actions_apply_to_all,
|
|
33
|
+
secondaryText: e.actions_this_time_only,
|
|
34
|
+
children: /* @__PURE__ */ r(S, {
|
|
35
|
+
id: d,
|
|
34
36
|
variant: "subtitle1",
|
|
35
|
-
children:
|
|
37
|
+
children: l(e.actions_all_past_and_future, /* @__PURE__ */ r("strong", { children: t.description }), u?.name)
|
|
36
38
|
})
|
|
37
39
|
})]
|
|
38
40
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditCategoryAction.es.js","names":[],"sources":["../../../../../src/transactions/components/transactionwidget/actions/EditCategoryAction.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\n\nimport { P } from '@mxenabled/mxui'\n\nimport { CategorySelectorDrawer } from '../../../../categories'\n\nimport { Dialog, useCategoryStore, useGlobalCopyStore } from '../../../../common'\nimport type { Transaction } from '../../../../core'\n\nimport { useTransactionStore } from '../../../../common'\nimport { buildDynamicCopy } from '../../../../core/utils/Localization'\n\ninterface EditCategoryActionProps {\n onClose: () => void\n transaction: Transaction\n}\n\nconst EditCategoryAction: React.FC<EditCategoryActionProps> = ({ onClose, transaction }) => {\n const { addOrUpdateTransactionRule, updateTransaction } = useTransactionStore()\n const { transactions: copy } = useGlobalCopyStore()\n\n const { categories } = useCategoryStore()\n\n const [categoryGuid, setCategoryGuid] = React.useState('')\n\n const category = React.useMemo(\n () => categories.find((item) => item.guid === categoryGuid),\n [categoryGuid],\n )\n\n const handleCategoryChanged = async (applyToAll: boolean) => {\n await updateTransaction({ ...transaction, category_guid: categoryGuid })\n if (applyToAll) {\n await addOrUpdateTransactionRule(categoryGuid, transaction)\n }\n\n setCategoryGuid('')\n onClose()\n }\n\n return (\n <Box className=\"mx-txn-edit-category-action\">\n <CategorySelectorDrawer\n initialSelected={transaction.category_guid}\n onClose={onClose}\n onSelect={(guid: string) => setCategoryGuid(guid)}\n showDrawer={!!transaction}\n title={copy.actions_select_a_category}\n />\n <Dialog\n copy={{\n title: buildDynamicCopy(\n copy.actions_apply_to_all_transaction_types,\n transaction.description,\n ) as string,\n }}\n isOpen={!!categoryGuid}\n onClose={() => handleCategoryChanged(false)}\n onPrimaryAction={() => handleCategoryChanged(true)}\n onSecondaryAction={() => handleCategoryChanged(false)}\n primaryText={copy.actions_apply_to_all}\n secondaryText={copy.actions_this_time_only}\n >\n <P variant=\"subtitle1\">\n {\n buildDynamicCopy(\n copy.actions_all_past_and_future,\n transaction.description
|
|
1
|
+
{"version":3,"file":"EditCategoryAction.es.js","names":[],"sources":["../../../../../src/transactions/components/transactionwidget/actions/EditCategoryAction.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\n\nimport { P } from '@mxenabled/mxui'\n\nimport { CategorySelectorDrawer } from '../../../../categories'\n\nimport { Dialog, useCategoryStore, useGlobalCopyStore } from '../../../../common'\nimport type { Transaction } from '../../../../core'\n\nimport { useTransactionStore } from '../../../../common'\nimport { buildDynamicCopy } from '../../../../core/utils/Localization'\n\ninterface EditCategoryActionProps {\n onClose: () => void\n transaction: Transaction\n}\n\nconst EditCategoryAction: React.FC<EditCategoryActionProps> = ({ onClose, transaction }) => {\n const { addOrUpdateTransactionRule, updateTransaction } = useTransactionStore()\n const { transactions: copy } = useGlobalCopyStore()\n\n const { categories } = useCategoryStore()\n\n const [categoryGuid, setCategoryGuid] = React.useState('')\n const messageId = React.useId()\n\n const category = React.useMemo(\n () => categories.find((item) => item.guid === categoryGuid),\n [categoryGuid],\n )\n\n const handleCategoryChanged = async (applyToAll: boolean) => {\n await updateTransaction({ ...transaction, category_guid: categoryGuid })\n if (applyToAll) {\n await addOrUpdateTransactionRule(categoryGuid, transaction)\n }\n\n setCategoryGuid('')\n onClose()\n }\n\n return (\n <Box className=\"mx-txn-edit-category-action\">\n <CategorySelectorDrawer\n initialSelected={transaction.category_guid}\n onClose={onClose}\n onSelect={(guid: string) => setCategoryGuid(guid)}\n showDrawer={!!transaction}\n title={copy.actions_select_a_category}\n />\n <Dialog\n aria-describedby={messageId}\n copy={{\n title: buildDynamicCopy(\n copy.actions_apply_to_all_transaction_types,\n transaction.description,\n ) as string,\n }}\n isOpen={!!categoryGuid}\n onClose={() => handleCategoryChanged(false)}\n onPrimaryAction={() => handleCategoryChanged(true)}\n onSecondaryAction={() => handleCategoryChanged(false)}\n primaryText={copy.actions_apply_to_all}\n secondaryText={copy.actions_this_time_only}\n >\n <P id={messageId} variant=\"subtitle1\">\n {\n buildDynamicCopy(\n copy.actions_all_past_and_future,\n <strong>{transaction.description}</strong>,\n category?.name,\n ) as React.ReactNode\n }\n </P>\n </Dialog>\n </Box>\n )\n}\n\nexport default observer(EditCategoryAction)\n"],"mappings":";;;;;;;;;AAoBA,IAAM,IAAA,CAAyD,EAAE,SAAA,GAAS,aAAA,EAAA,MAAkB;AAC1F,QAAM,EAAE,4BAAA,GAA4B,mBAAA,EAAA,IAAsB,EAAoB,GACxE,EAAE,cAAc,EAAA,IAAS,EAAmB,GAE5C,EAAE,YAAA,EAAA,IAAe,EAAiB,GAElC,CAAC,GAAc,CAAA,IAAmB,EAAM,SAAS,EAAE,GACnD,IAAY,EAAM,MAAM,GAExB,IAAW,EAAM,QAAA,MACf,EAAW,KAAA,CAAM,MAAS,EAAK,SAAS,CAAY,GAC1D,CAAC,CAAY,CACf,GAEM,IAAwB,OAAO,MAAwB;AAC3D,UAAM,EAAkB;AAAA,MAAE,GAAG;AAAA,MAAa,eAAe;AAAA,IAAa,CAAC,GACnE,KACF,MAAM,EAA2B,GAAc,CAAW,GAG5D,EAAgB,EAAE,GAClB,EAAQ;AAAA,EACV;AAEA,SACE,gBAAA,EAAC,GAAD;AAAA,IAAK,WAAU;AAAA,IAAf,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,MACE,iBAAiB,EAAY;AAAA,MACpB,SAAA;AAAA,MACT,UAAA,CAAW,MAAiB,EAAgB,CAAI;AAAA,MAChD,YAAY,CAAC,CAAC;AAAA,MACd,OAAO,EAAK;AAAA,IACb,CAAA,GACD,gBAAA,EAAC,GAAD;AAAA,MACE,oBAAkB;AAAA,MAClB,MAAM,EACJ,OAAO,EACL,EAAK,wCACL,EAAY,WACd,EACF;AAAA,MACA,QAAQ,CAAC,CAAC;AAAA,MACV,SAAA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