@mx-cartographer/experiences 6.26.33-alpha.mm0 → 7.0.0-alpha.mega1
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 +2 -3
- package/dist/Account-DY6nxO7y.mjs +30 -0
- package/dist/AccountDetailsContent-DvPs81kL.mjs +677 -0
- package/dist/AccountDetailsHeader-W2U7ZVm_.mjs +119 -0
- package/dist/AccountFields-DAVcbZy5.mjs +135 -0
- package/dist/AccountListItem-DFlbdcmT.mjs +90 -0
- package/dist/AccountStore-CU7qV3vg.mjs +230 -0
- package/dist/Accounts-BLlrQA5m.mjs +9 -0
- package/dist/BeatApi-DLu87ijw.mjs +21 -0
- package/dist/BeatStore-By4aGoRM.mjs +81 -0
- package/dist/BudgetUtil-Ci1TN0J5.mjs +101 -0
- package/dist/CashflowStore-D9Dpuz7X.mjs +91 -0
- package/dist/Category-5S6uwuXz.mjs +301 -0
- package/dist/CategorySelectorDrawer-rHyHHYuh.mjs +397 -0
- package/dist/CategoryStore-B5EW6I1d.mjs +183 -0
- package/dist/CategoryUtil-DRyruNgi.mjs +78 -0
- package/dist/ConnectDrawer-D9cR5phc.mjs +508 -0
- package/dist/ConnectionsDrawer-BzGqljSp.mjs +52 -0
- package/dist/CurrencyInput-D74cemI2.mjs +83 -0
- package/dist/CurrencyText-YUhH2caW.mjs +20 -0
- package/dist/DateUtil-BcuH7ErC.mjs +48 -0
- package/dist/DebtsStore-S0l9kr0r.mjs +60 -0
- package/dist/Dialog-CWW597AF.mjs +123 -0
- package/dist/Donut-1UMNcG67.mjs +57 -0
- package/dist/Drawer-kEE73B87.mjs +113 -0
- package/dist/EmptyState-Dcb-o2tl.mjs +55 -0
- package/dist/Fetch-CkFKy79O.mjs +116 -0
- package/dist/FinstrongStore-mkALvztw.mjs +101 -0
- package/dist/GoalStore-DioeeL-s.mjs +263 -0
- package/dist/HeaderCell-DjuifqHJ.mjs +6 -0
- package/dist/Help-DhcC-C05.mjs +320 -0
- package/dist/Help-DpYRO8oA.mjs +3181 -0
- package/dist/IconBacking-B9oC6uL2.mjs +39 -0
- package/dist/InvestmentUtil-jOyOgzIB.mjs +134 -0
- package/dist/LineChart-CcyX38kK.mjs +499 -0
- package/dist/ListItemAction-BabpYivr.mjs +69 -0
- package/dist/Loader-Dp1P2gNw.mjs +14 -0
- package/dist/Localization-2MODESHW.mjs +30 -0
- package/dist/ManageIncome-ndMuhJMG.mjs +535 -0
- package/dist/MerchantStore-DVH-QOf0.mjs +37 -0
- package/dist/MicroWidgetContainer-CsvHLYKX.mjs +45 -0
- package/dist/MiniWidgetContainer-BoOp-A05.mjs +39 -0
- package/dist/NetWorthStore-PD-RUe09.mjs +150 -0
- package/dist/Notification-AMGWM1Al.mjs +78 -0
- package/dist/NotificationSettings-VhHuMAFU.mjs +667 -0
- package/dist/NotificationStore-DHtSGySy.mjs +67 -0
- package/dist/NumberFormatting-CtWHhyBX.mjs +40 -0
- package/dist/OriginalBalanceAction-D39mx6uE.mjs +115 -0
- package/dist/RecurringSettings-D_HnMYZP.mjs +57 -0
- package/dist/RecurringTransactionsStore-BKLD3OWo.mjs +263 -0
- package/dist/RepeatingTransaction-BPWfaB3f.mjs +282 -0
- package/dist/SearchBox-B2_zLv8-.mjs +42 -0
- package/dist/SettingsStore-CE7jDVFL.mjs +265 -0
- package/dist/SingleSegmentDonut-BgbLgwHi.mjs +69 -0
- package/dist/SpendingData-BkrxzHdr.mjs +55 -0
- package/dist/StatusBar-BK_uYHAB.mjs +30 -0
- package/dist/TabContentContainer-j01JYR_7.mjs +21 -0
- package/dist/Transaction-CA0FW2Ij.mjs +312 -0
- package/dist/TransactionApi-DbbcjI2L.mjs +86 -0
- package/dist/TransactionDetails-WBHFmbxL.mjs +1283 -0
- package/dist/TransactionStore-CeLdmVnC.mjs +669 -0
- package/dist/TrendsStore-BHJUapXF.mjs +487 -0
- package/dist/ViewMoreMicroCard-CAPFNz-J.mjs +1959 -0
- package/dist/WidgetContainer-DWCusxYI.mjs +556 -0
- package/dist/accounts/index.es.js +752 -0
- package/dist/analytics/index.es.js +171 -0
- package/dist/budgets/index.es.js +1075 -0
- package/dist/cashflow/index.es.js +1098 -0
- package/dist/categories/index.es.js +9 -0
- package/dist/common/components/WidgetContainer.d.ts +1 -1
- package/dist/common/components/charts/LineChart.d.ts +0 -1
- package/dist/common/constants/Analytics.d.ts +10 -20
- package/dist/common/context/hooks.d.ts +13 -13
- package/dist/common/index.es.js +1451 -0
- package/dist/dashboard/index.es.js +181 -0
- package/dist/debts/index.es.js +1460 -0
- package/dist/exportTransactionsToCSV-CmwsKl2D.mjs +47 -0
- package/dist/finstrong/index.es.js +1455 -0
- package/dist/goals/index.es.js +1209 -0
- package/dist/help/components/content/section/index.d.ts +15 -15
- package/dist/help/index.es.js +14 -0
- package/dist/hooks-30y_BLwc.mjs +71 -0
- package/dist/index.d.ts +0 -22
- package/dist/insights/index.d.ts +1 -0
- package/dist/insights/index.es.js +4 -0
- package/dist/investments/index.es.js +1638 -0
- package/dist/merchants/index.es.js +79 -0
- package/dist/microinsights/components/carouselheader/CarouselHeader.d.ts +0 -1
- package/dist/microinsights/components/microBeatCarousel/MicroBeatCarousel.d.ts +0 -1
- package/dist/microinsights/index.es.js +16 -0
- package/dist/networth/index.es.js +576 -0
- package/dist/notifications/index.es.js +192 -0
- package/dist/recurringtransactions/index.es.js +879 -0
- package/dist/settings/index.es.js +879 -0
- package/dist/spending/index.es.js +570 -0
- package/dist/transactions/index.es.js +587 -0
- package/dist/trends/index.es.js +1086 -0
- package/dist/useCombineEvents-DaDBSR_1.mjs +92 -0
- package/dist/useDimensions-27p2evRx.mjs +36 -0
- package/dist/useScreenSize-B6JyS_Lj.mjs +36 -0
- package/package.json +155 -3
- package/dist/index.es.js +0 -30564
- package/dist/index.es.js.map +0 -1
- package/dist/trends/constants/TrendsWidget.d.ts +0 -3
@@ -0,0 +1,69 @@
|
|
1
|
+
import { jsxs as e, jsx as r } from "react/jsx-runtime";
|
2
|
+
import b from "react";
|
3
|
+
import { observer as v } from "mobx-react-lite";
|
4
|
+
import x from "@mui/material/ListItem";
|
5
|
+
import C from "@mui/material/ListItemButton";
|
6
|
+
import I from "@mui/material/ListItemText";
|
7
|
+
import L from "@mui/material/Stack";
|
8
|
+
import { ChevronRight as g } from "@mxenabled/mx-icons";
|
9
|
+
import { Text as m } from "@mxenabled/mxui";
|
10
|
+
import { a as j } from "./Dialog-CWW597AF.mjs";
|
11
|
+
import { u as P } from "./hooks-30y_BLwc.mjs";
|
12
|
+
const D = v(
|
13
|
+
({
|
14
|
+
children: n,
|
15
|
+
isDisabled: i = !1,
|
16
|
+
isSaveDisabled: s = !1,
|
17
|
+
label: p,
|
18
|
+
onCancel: c,
|
19
|
+
onSave: l,
|
20
|
+
primaryText: f,
|
21
|
+
secondaryText: y,
|
22
|
+
zeroStateText: o
|
23
|
+
}) => {
|
24
|
+
const { common: a } = P(), [d, t] = b.useState(!1), h = () => {
|
25
|
+
t(!1), c?.();
|
26
|
+
}, u = () => {
|
27
|
+
t(!1), l();
|
28
|
+
};
|
29
|
+
return /* @__PURE__ */ e(x, { children: [
|
30
|
+
/* @__PURE__ */ e(C, { onClick: () => t(!i), children: [
|
31
|
+
/* @__PURE__ */ r(
|
32
|
+
I,
|
33
|
+
{
|
34
|
+
primary: /* @__PURE__ */ e(L, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
35
|
+
/* @__PURE__ */ r(m, { variant: "body1", children: f }),
|
36
|
+
/* @__PURE__ */ r(
|
37
|
+
m,
|
38
|
+
{
|
39
|
+
bold: !0,
|
40
|
+
color: o ? "primary.main" : "text.primary",
|
41
|
+
sx: { mr: 4 },
|
42
|
+
variant: "body1",
|
43
|
+
children: o || y
|
44
|
+
}
|
45
|
+
)
|
46
|
+
] }),
|
47
|
+
primaryTypographyProps: { variant: "body1" }
|
48
|
+
}
|
49
|
+
),
|
50
|
+
!i && !o && /* @__PURE__ */ r(g, {})
|
51
|
+
] }),
|
52
|
+
/* @__PURE__ */ r(
|
53
|
+
j,
|
54
|
+
{
|
55
|
+
copy: { title: p, close_aria: a.close_aria },
|
56
|
+
disablePrimaryButton: s,
|
57
|
+
isOpen: d,
|
58
|
+
onClose: h,
|
59
|
+
onPrimaryAction: u,
|
60
|
+
primaryText: a.save_button,
|
61
|
+
children: n
|
62
|
+
}
|
63
|
+
)
|
64
|
+
] });
|
65
|
+
}
|
66
|
+
);
|
67
|
+
export {
|
68
|
+
D as L
|
69
|
+
};
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { jsxs as s, jsx as o } from "react/jsx-runtime";
|
2
|
+
import c from "@mui/material/CircularProgress";
|
3
|
+
import i from "@mui/material/Stack";
|
4
|
+
import { useTokens as m, Text as a } from "@mxenabled/mxui";
|
5
|
+
const p = ({ height: t = 250, label: r = "", size: e = 32 }) => {
|
6
|
+
const n = m();
|
7
|
+
return /* @__PURE__ */ s(i, { alignItems: "center", gap: n.Spacing.XLarge, height: t, justifyContent: "center", children: [
|
8
|
+
/* @__PURE__ */ o(c, { size: e }),
|
9
|
+
r && /* @__PURE__ */ o(a, { children: r })
|
10
|
+
] });
|
11
|
+
}, x = p;
|
12
|
+
export {
|
13
|
+
x as L
|
14
|
+
};
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import u from "react";
|
2
|
+
const y = /(?<static>.*?)(?<dynamic>(?:_\d+{(?:.*?)}))|(?<staticEnd>.+)/g, h = (n, ...e) => {
|
3
|
+
if (!n) return "";
|
4
|
+
const s = e.some((i) => typeof i != "string"), a = [...n.matchAll(y)].reduce(
|
5
|
+
(i, d, m) => {
|
6
|
+
const o = [...i], t = d.groups;
|
7
|
+
if (t?.static && o.push(t.static), t?.dynamic) {
|
8
|
+
const l = t.dynamic.indexOf("{"), p = t.dynamic.substring(l + 1, t.dynamic.length - 1), r = Number(t.dynamic.substring(1, l));
|
9
|
+
if (u.isValidElement(e[r - 1])) {
|
10
|
+
const f = e[r - 1], g = u.cloneElement(f, {
|
11
|
+
key: `${p}-${m}`
|
12
|
+
});
|
13
|
+
o.push(g);
|
14
|
+
} else
|
15
|
+
o.push(e[r - 1]);
|
16
|
+
}
|
17
|
+
return t?.staticEnd && o.push(t.staticEnd), o;
|
18
|
+
},
|
19
|
+
[]
|
20
|
+
);
|
21
|
+
return s ? a : a.join("");
|
22
|
+
}, w = (n, e, s, ...c) => !n || !e ? "" : h(s === 1 ? n : e, ...c), E = () => {
|
23
|
+
const n = "en-us", e = ["en-us", "en-ca", "fr", "fr-ca", "es"], s = window?.app?.options?.language?.toLowerCase() ?? "", c = window.navigator.language.toLowerCase();
|
24
|
+
return s === "browser" && e.includes(c) ? c : e.includes(s) ? s : n;
|
25
|
+
};
|
26
|
+
export {
|
27
|
+
w as a,
|
28
|
+
h as b,
|
29
|
+
E as g
|
30
|
+
};
|
@@ -0,0 +1,535 @@
|
|
1
|
+
import { jsxs as s, jsx as e, Fragment as F } from "react/jsx-runtime";
|
2
|
+
import d from "react";
|
3
|
+
import { observer as D } from "mobx-react-lite";
|
4
|
+
import O from "@mui/material/Divider";
|
5
|
+
import j from "@mui/material/List";
|
6
|
+
import K from "@mui/material/ListItem";
|
7
|
+
import oe from "@mui/material/ListItemAvatar";
|
8
|
+
import Q from "@mui/material/ListItemButton";
|
9
|
+
import $ from "@mui/material/ListItemText";
|
10
|
+
import y from "@mui/material/Stack";
|
11
|
+
import { MerchantLogo as H, Text as v, H1 as ae, InstitutionLogo as ie, P as se, Icon as z } from "@mxenabled/mxui";
|
12
|
+
import { F as c, S as T, D as G, g as J, R as A, e as ce } from "./RepeatingTransaction-BPWfaB3f.mjs";
|
13
|
+
import { subDays as le } from "date-fns/subDays";
|
14
|
+
import { startOfToday as P } from "date-fns/startOfToday";
|
15
|
+
import { endOfMonth as de } from "date-fns/endOfMonth";
|
16
|
+
import ue from "@mui/material/Button";
|
17
|
+
import { Delete as _e } from "@mxenabled/mx-icons";
|
18
|
+
import { T as X, a as me, u as ye, S as pe, b as he } from "./TransactionDetails-WBHFmbxL.mjs";
|
19
|
+
import { getDayOfYear as fe } from "date-fns/getDayOfYear";
|
20
|
+
import { setDayOfYear as ge } from "date-fns/setDayOfYear";
|
21
|
+
import { AdapterDateFns as Ce } from "@mui/x-date-pickers/AdapterDateFnsV3";
|
22
|
+
import { DatePicker as be } from "@mui/x-date-pickers";
|
23
|
+
import { LocalizationProvider as we } from "@mui/x-date-pickers/LocalizationProvider";
|
24
|
+
import { u as x, f as N, g as q, a as ve, n as Z, o as Se } from "./hooks-30y_BLwc.mjs";
|
25
|
+
import { b as xe, f as V } from "./NumberFormatting-CtWHhyBX.mjs";
|
26
|
+
import { D as L } from "./Drawer-kEE73B87.mjs";
|
27
|
+
import { A as k } from "./WidgetContainer-DWCusxYI.mjs";
|
28
|
+
import { f as De, D as Ee, a as Ie } from "./Dialog-CWW597AF.mjs";
|
29
|
+
import { formatISO as Ae } from "date-fns/formatISO";
|
30
|
+
import { fromUnixTime as Oe } from "date-fns/fromUnixTime";
|
31
|
+
import Le from "@mui/material/Box";
|
32
|
+
import { S as Re } from "./SearchBox-B2_zLv8-.mjs";
|
33
|
+
import { h as Te } from "./DateUtil-BcuH7ErC.mjs";
|
34
|
+
import { c as B } from "./Category-5S6uwuXz.mjs";
|
35
|
+
import { T as ee } from "./Transaction-CA0FW2Ij.mjs";
|
36
|
+
const te = ({
|
37
|
+
frequency: t,
|
38
|
+
firstDay: n,
|
39
|
+
secondDay: o,
|
40
|
+
onFrequencyChange: l,
|
41
|
+
onFirstDayChange: i,
|
42
|
+
onSecondDayChange: a
|
43
|
+
}) => {
|
44
|
+
const { recurring: r } = x(), u = d.useMemo(
|
45
|
+
() => [
|
46
|
+
{ id: c.EveryWeek, label: r.frequency_every_week },
|
47
|
+
{ id: c.EveryOtherWeek, label: r.frequency_every_other_week },
|
48
|
+
{ id: c.TwiceAMonth, label: r.frequency_twice_a_month },
|
49
|
+
{ id: c.EveryMonth, label: r.frequency_every_month },
|
50
|
+
{ id: c.EveryOtherMonth, label: r.frequency_every_other_month },
|
51
|
+
{ id: c.EveryQuarter, label: r.frequency_every_quarter },
|
52
|
+
{ id: c.EveryOtherQuarter, label: r.frequency_every_other_quarter },
|
53
|
+
{ id: c.EveryYear, label: r.frequency_every_year }
|
54
|
+
],
|
55
|
+
[r]
|
56
|
+
), p = [
|
57
|
+
{ id: 0, label: r.weekday_sunday },
|
58
|
+
{ id: 1, label: r.weekday_monday },
|
59
|
+
{ id: 2, label: r.weekday_tuesday },
|
60
|
+
{ id: 3, label: r.weekday_wednesday },
|
61
|
+
{ id: 4, label: r.weekday_thursday },
|
62
|
+
{ id: 5, label: r.weekday_friday },
|
63
|
+
{ id: 6, label: r.weekday_saturday }
|
64
|
+
], h = [...Array(31).keys()].map((m) => ({
|
65
|
+
id: m + 1,
|
66
|
+
label: xe(m + 1)
|
67
|
+
}));
|
68
|
+
h[30].label += ` (${r.last_day_of_month})`;
|
69
|
+
const C = h.slice(0, 15), S = h.slice(14), b = t === c.EveryWeek || t === c.EveryOtherWeek, f = t === c.TwiceAMonth || t === c.EveryMonth || t === c.EveryOtherMonth || t === c.EveryQuarter || t === c.EveryOtherQuarter, E = ge(P(), n), g = (m) => {
|
70
|
+
m && i(fe(m));
|
71
|
+
};
|
72
|
+
return /* @__PURE__ */ s(y, { gap: 24, sx: { m: 24 }, children: [
|
73
|
+
/* @__PURE__ */ e(
|
74
|
+
T,
|
75
|
+
{
|
76
|
+
label: r.frequency,
|
77
|
+
onChange: l,
|
78
|
+
options: u,
|
79
|
+
value: t
|
80
|
+
}
|
81
|
+
),
|
82
|
+
b && /* @__PURE__ */ e(
|
83
|
+
T,
|
84
|
+
{
|
85
|
+
label: r.day_of_the_week,
|
86
|
+
onChange: i,
|
87
|
+
options: p,
|
88
|
+
value: n
|
89
|
+
}
|
90
|
+
),
|
91
|
+
f && /* @__PURE__ */ e(
|
92
|
+
T,
|
93
|
+
{
|
94
|
+
label: t === c.TwiceAMonth ? r.first_day_of_the_month : r.day_of_the_month,
|
95
|
+
onChange: i,
|
96
|
+
options: t === c.TwiceAMonth ? C : h,
|
97
|
+
value: n
|
98
|
+
}
|
99
|
+
),
|
100
|
+
t === c.TwiceAMonth && /* @__PURE__ */ e(
|
101
|
+
T,
|
102
|
+
{
|
103
|
+
label: r.second_day_of_the_month,
|
104
|
+
onChange: a,
|
105
|
+
options: S,
|
106
|
+
value: o || 0
|
107
|
+
}
|
108
|
+
),
|
109
|
+
t === c.EveryYear && /* @__PURE__ */ e(we, { dateAdapter: Ce, children: /* @__PURE__ */ e(
|
110
|
+
be,
|
111
|
+
{
|
112
|
+
disablePast: !0,
|
113
|
+
label: r.next_payment_date,
|
114
|
+
onChange: g,
|
115
|
+
value: E
|
116
|
+
}
|
117
|
+
) })
|
118
|
+
] });
|
119
|
+
}, ke = D(({ repeatingTransaction: t }) => {
|
120
|
+
const { recurring: n } = x(), { updateRepeatingTransaction: o } = N(), { onEvent: l } = q(), [i, a] = d.useState(!1), [r, u] = d.useState(t.recurrence_type), [p, h] = d.useState(t.recurrence_day), [C, S] = d.useState(t.second_recurrence_day), b = async () => {
|
121
|
+
await o({
|
122
|
+
...t,
|
123
|
+
recurrence_type: r,
|
124
|
+
recurrence_day: p,
|
125
|
+
second_recurrence_day: C
|
126
|
+
}), a(!1);
|
127
|
+
}, f = () => {
|
128
|
+
a(!0), l(k.RECURRING_TRANSACTIONS_DETAILS_CLICK_PAYMENT_SCHEDULE);
|
129
|
+
};
|
130
|
+
return /* @__PURE__ */ s(F, { children: [
|
131
|
+
/* @__PURE__ */ e(
|
132
|
+
G,
|
133
|
+
{
|
134
|
+
iconName: "sync",
|
135
|
+
label: n.activity_schedule,
|
136
|
+
onClick: f,
|
137
|
+
value: `${J(n, t, !0)}`
|
138
|
+
}
|
139
|
+
),
|
140
|
+
/* @__PURE__ */ e(
|
141
|
+
L,
|
142
|
+
{
|
143
|
+
ariaLabelClose: n.close_drawer_aria,
|
144
|
+
isOpen: i,
|
145
|
+
onClose: () => a(!1),
|
146
|
+
onPrimaryAction: b,
|
147
|
+
title: n.payment_schedule,
|
148
|
+
children: /* @__PURE__ */ e(
|
149
|
+
te,
|
150
|
+
{
|
151
|
+
firstDay: p,
|
152
|
+
frequency: r,
|
153
|
+
onFirstDayChange: h,
|
154
|
+
onFrequencyChange: u,
|
155
|
+
onSecondDayChange: S,
|
156
|
+
secondDay: C
|
157
|
+
}
|
158
|
+
)
|
159
|
+
}
|
160
|
+
)
|
161
|
+
] });
|
162
|
+
}), Ne = D(
|
163
|
+
({ onDeleted: t, recurringTransaction: n }) => {
|
164
|
+
const { recurring: o } = x(), { selectedAccountGuids: l } = ve(), { onEvent: i } = q(), { deleteRepeatingTransaction: a } = N(), { setFilter: r, transactions: u } = Z(), { amount: p, description: h, merchant_guid: C } = n, [S, b] = d.useState(!1), [f, E] = d.useState("");
|
165
|
+
d.useEffect(() => {
|
166
|
+
r({
|
167
|
+
accounts: l,
|
168
|
+
dateRange: { start: le(P(), 90), end: de(P()) },
|
169
|
+
custom: (_) => _.repeating_transaction_guid === n.guid
|
170
|
+
});
|
171
|
+
}, [n]);
|
172
|
+
const g = d.useMemo(
|
173
|
+
() => u.find((_) => _.guid === f),
|
174
|
+
[f, u]
|
175
|
+
), m = n.repeating_transaction_type === A.Income, R = async () => {
|
176
|
+
await a(n.guid), t();
|
177
|
+
}, M = () => {
|
178
|
+
b(!0), i(k.RECURRING_TRANSACTIONS_DETAILS_CLICK_DELETE);
|
179
|
+
};
|
180
|
+
return /* @__PURE__ */ s(y, { bgcolor: "background.default", direction: "column", height: "100%", children: [
|
181
|
+
/* @__PURE__ */ s(y, { direction: "column", m: 24, children: [
|
182
|
+
/* @__PURE__ */ e(
|
183
|
+
H,
|
184
|
+
{
|
185
|
+
categoryGuid: g?.category_guid || "",
|
186
|
+
merchantGuid: C,
|
187
|
+
size: 64,
|
188
|
+
sx: { mb: 12 }
|
189
|
+
}
|
190
|
+
),
|
191
|
+
/* @__PURE__ */ e(v, { bold: !0, variant: "body1", children: h }),
|
192
|
+
/* @__PURE__ */ s(ae, { color: m ? "success.main" : "text.primary", sx: { my: 4 }, children: [
|
193
|
+
m ? "+" : "",
|
194
|
+
V(p, "0,0.00")
|
195
|
+
] }),
|
196
|
+
/* @__PURE__ */ e(v, { color: "text.secondary", variant: "body2", children: `${o.next_payment_date}: ${De(
|
197
|
+
n.predicted_occurs_on,
|
198
|
+
Ee.MONTH_DAY_YEAR
|
199
|
+
)}` })
|
200
|
+
] }),
|
201
|
+
/* @__PURE__ */ s(j, { sx: { bgcolor: "background.paper" }, children: [
|
202
|
+
n.account && /* @__PURE__ */ s(F, { children: [
|
203
|
+
/* @__PURE__ */ e(
|
204
|
+
G,
|
205
|
+
{
|
206
|
+
iconName: "checkbook",
|
207
|
+
label: o.account,
|
208
|
+
value: n.account.institutionName || ""
|
209
|
+
}
|
210
|
+
),
|
211
|
+
/* @__PURE__ */ e(O, { variant: "inset" })
|
212
|
+
] }),
|
213
|
+
g?.category && /* @__PURE__ */ s(F, { children: [
|
214
|
+
/* @__PURE__ */ e(
|
215
|
+
G,
|
216
|
+
{
|
217
|
+
iconName: "monetization_on",
|
218
|
+
label: o.category,
|
219
|
+
value: g.category
|
220
|
+
}
|
221
|
+
),
|
222
|
+
/* @__PURE__ */ e(O, { variant: "inset" })
|
223
|
+
] }),
|
224
|
+
/* @__PURE__ */ e(ke, { repeatingTransaction: n }),
|
225
|
+
/* @__PURE__ */ e(O, {})
|
226
|
+
] }),
|
227
|
+
/* @__PURE__ */ e(
|
228
|
+
ue,
|
229
|
+
{
|
230
|
+
color: "error",
|
231
|
+
onClick: M,
|
232
|
+
startIcon: /* @__PURE__ */ e(_e, {}),
|
233
|
+
sx: { mx: 24, my: 16 },
|
234
|
+
variant: "text",
|
235
|
+
children: m ? o.delete_income_title : o.delete_expense_title
|
236
|
+
}
|
237
|
+
),
|
238
|
+
/* @__PURE__ */ e(v, { bold: !0, sx: { ml: 24, mt: 16 }, variant: "Body", children: o.paid_transactions }),
|
239
|
+
/* @__PURE__ */ e(X, { height: "30dvh", onClick: E }),
|
240
|
+
/* @__PURE__ */ e(
|
241
|
+
L,
|
242
|
+
{
|
243
|
+
ariaLabelClose: o.close_drawer_aria,
|
244
|
+
isOpen: !!f && !!g,
|
245
|
+
onClose: () => E(""),
|
246
|
+
title: o.transaction_details_drawer_title,
|
247
|
+
children: g && /* @__PURE__ */ e(me, { transaction: g })
|
248
|
+
}
|
249
|
+
),
|
250
|
+
/* @__PURE__ */ e(
|
251
|
+
Ie,
|
252
|
+
{
|
253
|
+
copy: {
|
254
|
+
title: m ? o.delete_income_title : o.delete_expense_title,
|
255
|
+
close_aria: o.close_drawer_aria
|
256
|
+
},
|
257
|
+
isOpen: S,
|
258
|
+
onClose: () => b(!1),
|
259
|
+
onPrimaryAction: R,
|
260
|
+
children: /* @__PURE__ */ e(v, { children: m ? o.delete_income_description : o.delete_expense_description })
|
261
|
+
}
|
262
|
+
)
|
263
|
+
] });
|
264
|
+
}
|
265
|
+
), Me = D(
|
266
|
+
({ onClick: t = () => {
|
267
|
+
}, repeatingTransaction: n }) => {
|
268
|
+
const { recurring: o } = x(), [l, i] = d.useState(!1), a = d.useMemo(
|
269
|
+
() => n.transactions.length === 0 ? "" : n.transactions[0].category_guid || "",
|
270
|
+
[n]
|
271
|
+
), r = n.account?.institutionName || "", u = n.repeating_transaction_type === A.Income, p = J(o, n, !0);
|
272
|
+
return /* @__PURE__ */ s(K, { disableGutters: !0, disablePadding: !0, children: [
|
273
|
+
/* @__PURE__ */ s(Q, { onClick: () => {
|
274
|
+
t(n), i(!0);
|
275
|
+
}, children: [
|
276
|
+
/* @__PURE__ */ e(oe, { children: /* @__PURE__ */ e(
|
277
|
+
H,
|
278
|
+
{
|
279
|
+
categoryGuid: a,
|
280
|
+
merchantGuid: n.merchant_guid
|
281
|
+
}
|
282
|
+
) }),
|
283
|
+
/* @__PURE__ */ e($, { children: /* @__PURE__ */ s(
|
284
|
+
y,
|
285
|
+
{
|
286
|
+
direction: "row",
|
287
|
+
gap: 4,
|
288
|
+
sx: { justifyContent: "space-between", textOverflow: "ellipsis", textWrap: "nowrap" },
|
289
|
+
children: [
|
290
|
+
/* @__PURE__ */ s(y, { direction: "column", width: "50%", children: [
|
291
|
+
/* @__PURE__ */ e(v, { bold: !0, variant: "body1", children: n.description }),
|
292
|
+
/* @__PURE__ */ s(y, { alignItems: "center", direction: "row", gap: 6, children: [
|
293
|
+
n.account?.institution_guid && /* @__PURE__ */ e(
|
294
|
+
ie,
|
295
|
+
{
|
296
|
+
alt: r,
|
297
|
+
institutionGuid: n.account?.institution_guid,
|
298
|
+
size: 12
|
299
|
+
}
|
300
|
+
),
|
301
|
+
/* @__PURE__ */ e(v, { variant: "caption", children: r })
|
302
|
+
] })
|
303
|
+
] }),
|
304
|
+
/* @__PURE__ */ s(y, { alignItems: "flex-end", width: "100%", children: [
|
305
|
+
/* @__PURE__ */ s(
|
306
|
+
v,
|
307
|
+
{
|
308
|
+
bold: !0,
|
309
|
+
color: u ? "success.main" : "text.primary",
|
310
|
+
variant: "body1",
|
311
|
+
children: [
|
312
|
+
u ? "+" : "",
|
313
|
+
V(n.amount, "0,0.00")
|
314
|
+
]
|
315
|
+
}
|
316
|
+
),
|
317
|
+
/* @__PURE__ */ e(
|
318
|
+
y,
|
319
|
+
{
|
320
|
+
direction: "row",
|
321
|
+
sx: {
|
322
|
+
alignItems: "center",
|
323
|
+
gap: 6,
|
324
|
+
justifyContent: "flex-end",
|
325
|
+
textTransform: "uppercase",
|
326
|
+
width: "100%"
|
327
|
+
},
|
328
|
+
children: /* @__PURE__ */ e(v, { bold: !0, color: "text.secondary", variant: "caption", children: p })
|
329
|
+
}
|
330
|
+
)
|
331
|
+
] })
|
332
|
+
]
|
333
|
+
}
|
334
|
+
) })
|
335
|
+
] }),
|
336
|
+
/* @__PURE__ */ e(
|
337
|
+
L,
|
338
|
+
{
|
339
|
+
ariaLabelClose: o.close_drawer_aria,
|
340
|
+
isOpen: l,
|
341
|
+
onClose: () => i(!1),
|
342
|
+
title: n.repeating_transaction_type === A.Income ? o.income_details : o.expense_details,
|
343
|
+
children: /* @__PURE__ */ e(
|
344
|
+
Ne,
|
345
|
+
{
|
346
|
+
onDeleted: () => i(!1),
|
347
|
+
recurringTransaction: n
|
348
|
+
}
|
349
|
+
)
|
350
|
+
}
|
351
|
+
)
|
352
|
+
] });
|
353
|
+
}
|
354
|
+
), Fe = D(
|
355
|
+
({
|
356
|
+
bgcolor: t = "background.default",
|
357
|
+
description: n,
|
358
|
+
onSearch: o,
|
359
|
+
onSelected: l
|
360
|
+
}) => {
|
361
|
+
const { recurring: i } = x(), { searchValue: a, setSearchValue: r } = ye();
|
362
|
+
return /* @__PURE__ */ s(y, { sx: { bgcolor: t, gap: 16, pt: 8 }, children: [
|
363
|
+
n && /* @__PURE__ */ e(se, { sx: { mx: 24 }, children: n }),
|
364
|
+
/* @__PURE__ */ e(
|
365
|
+
Re,
|
366
|
+
{
|
367
|
+
ariaLabel: i.select_transaction_search_aria,
|
368
|
+
cancelAriaLabel: i.select_transaction_search_cancel_aria,
|
369
|
+
onChange: (u) => {
|
370
|
+
r(u), o(u);
|
371
|
+
},
|
372
|
+
placeholder: i.select_transaction_search_placeholder,
|
373
|
+
searchValue: a
|
374
|
+
}
|
375
|
+
),
|
376
|
+
/* @__PURE__ */ e(X, { bgcolor: t, height: "auto", onClick: l, showLoader: !1 })
|
377
|
+
] });
|
378
|
+
}
|
379
|
+
), Ge = D(
|
380
|
+
({
|
381
|
+
bgcolor: t = "background.default",
|
382
|
+
firstDay: n,
|
383
|
+
secondDay: o,
|
384
|
+
frequency: l,
|
385
|
+
onFrequencyChange: i,
|
386
|
+
onFirstDayChange: a,
|
387
|
+
onSecondDayChange: r,
|
388
|
+
transaction: u
|
389
|
+
}) => {
|
390
|
+
const { recurring: p } = x();
|
391
|
+
return /* @__PURE__ */ s(y, { bgcolor: t, gap: 24, height: "100%", children: [
|
392
|
+
/* @__PURE__ */ s(y, { children: [
|
393
|
+
/* @__PURE__ */ e(pe, { bgcolor: t, children: Te(u.date) }),
|
394
|
+
/* @__PURE__ */ e(he, { transaction: u })
|
395
|
+
] }),
|
396
|
+
/* @__PURE__ */ e(v, { bold: !0, sx: { mx: 24 }, variant: "Body", children: p.payment_schedule }),
|
397
|
+
/* @__PURE__ */ e(
|
398
|
+
te,
|
399
|
+
{
|
400
|
+
firstDay: n,
|
401
|
+
frequency: l,
|
402
|
+
onFirstDayChange: a,
|
403
|
+
onFrequencyChange: i,
|
404
|
+
onSecondDayChange: r,
|
405
|
+
secondDay: o
|
406
|
+
}
|
407
|
+
)
|
408
|
+
] });
|
409
|
+
}
|
410
|
+
), Y = (t) => t.top_level_category_guid !== B.INCOME && t.transaction_type === ee.DEBIT, Pe = (t, n) => Y(t) ? t.payee?.toLowerCase().includes(n.toLowerCase()) || t.description.toLowerCase().includes(n.toLowerCase()) || t.feed_description.toLowerCase().includes(n.toLowerCase()) : !1, U = (t) => t.top_level_category_guid === B.INCOME || t.top_level_category_guid === B.TRANSFER && t.transaction_type === ee.CREDIT, Be = (t, n) => U(t) ? t.payee?.toLowerCase().includes(n.toLowerCase()) || t.description?.toLowerCase().includes(n.toLowerCase()) || t.feed_description?.toLowerCase().includes(n.toLowerCase()) : !1, Ye = D(
|
411
|
+
({
|
412
|
+
isIncome: t = !1,
|
413
|
+
label: n,
|
414
|
+
onAddRecurringTransaction: o = () => null
|
415
|
+
}) => {
|
416
|
+
const { recurring: l } = x(), { filter: i, setFilter: a, transactions: r } = Z(), { addRepeatingTransaction: u } = N(), { user: p } = Se(), [h, C] = d.useState(!1), [S, b] = d.useState(""), [f, E] = d.useState(c.EveryMonth), [g, m] = d.useState(1), [R, M] = d.useState(15), _ = d.useMemo(
|
417
|
+
() => r.find((w) => w.guid === S),
|
418
|
+
[S, r]
|
419
|
+
), ne = () => {
|
420
|
+
C(!0), a(t ? { ...i, custom: U } : { ...i, custom: Y });
|
421
|
+
}, re = async () => {
|
422
|
+
if (!_) {
|
423
|
+
W();
|
424
|
+
return;
|
425
|
+
}
|
426
|
+
o();
|
427
|
+
const w = ce(f, Oe(_.date)), I = {
|
428
|
+
account_guid: _.account_guid,
|
429
|
+
amount: _.amount,
|
430
|
+
created_by: 0,
|
431
|
+
// User
|
432
|
+
merchant_guid: _.merchant_guid,
|
433
|
+
description: _.payee || _.description || _.feed_description,
|
434
|
+
predicted_occurs_on: Ae(w, { representation: "date" }),
|
435
|
+
recurrence_day: g,
|
436
|
+
recurrence_type: f,
|
437
|
+
repeating_transaction_type: t ? A.Income : A.Bill,
|
438
|
+
second_recurrence_day: R,
|
439
|
+
transaction_type: _.transaction_type,
|
440
|
+
user_guid: p.guid
|
441
|
+
};
|
442
|
+
await u(I, _), W();
|
443
|
+
}, W = () => {
|
444
|
+
b(""), C(!1);
|
445
|
+
};
|
446
|
+
return /* @__PURE__ */ s(Le, { children: [
|
447
|
+
/* @__PURE__ */ e(K, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ e(Q, { onClick: ne, children: /* @__PURE__ */ e($, { children: /* @__PURE__ */ s(y, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
448
|
+
/* @__PURE__ */ s(y, { alignItems: "center", direction: "row", gap: 8, children: [
|
449
|
+
/* @__PURE__ */ e(z, { fill: !0, name: "add_box", size: 24, sx: { color: "primary.main" } }),
|
450
|
+
/* @__PURE__ */ e(v, { bold: !0, sx: { color: "primary.main" }, variant: "Body", children: n })
|
451
|
+
] }),
|
452
|
+
/* @__PURE__ */ e(z, { name: "chevron_right", size: 24, sx: { color: "primary.light" } })
|
453
|
+
] }) }) }) }),
|
454
|
+
/* @__PURE__ */ e(O, {}),
|
455
|
+
/* @__PURE__ */ e(
|
456
|
+
L,
|
457
|
+
{
|
458
|
+
ariaLabelClose: l.close_drawer_aria,
|
459
|
+
isOpen: h,
|
460
|
+
onClose: () => C(!1),
|
461
|
+
title: n,
|
462
|
+
children: /* @__PURE__ */ e(
|
463
|
+
Fe,
|
464
|
+
{
|
465
|
+
description: t ? l.add_income_description : l.add_expense_description,
|
466
|
+
onSearch: (w) => {
|
467
|
+
a({
|
468
|
+
...i,
|
469
|
+
custom: (I) => t ? w ? Be(I, w) : U(I) : w ? Pe(I, w) : Y(I)
|
470
|
+
});
|
471
|
+
},
|
472
|
+
onSelected: (w) => b(w)
|
473
|
+
}
|
474
|
+
)
|
475
|
+
}
|
476
|
+
),
|
477
|
+
/* @__PURE__ */ e(
|
478
|
+
L,
|
479
|
+
{
|
480
|
+
ariaLabelClose: l.close_drawer_aria,
|
481
|
+
isOpen: !!S,
|
482
|
+
onClose: () => b(""),
|
483
|
+
onPrimaryAction: re,
|
484
|
+
title: t ? l.income_details : l.expense_details,
|
485
|
+
children: _ && /* @__PURE__ */ e(
|
486
|
+
Ge,
|
487
|
+
{
|
488
|
+
firstDay: g,
|
489
|
+
frequency: f,
|
490
|
+
onFirstDayChange: m,
|
491
|
+
onFrequencyChange: E,
|
492
|
+
onSecondDayChange: M,
|
493
|
+
secondDay: R,
|
494
|
+
transaction: _
|
495
|
+
}
|
496
|
+
)
|
497
|
+
}
|
498
|
+
)
|
499
|
+
] });
|
500
|
+
}
|
501
|
+
), vt = D(() => {
|
502
|
+
const { recurring: t } = x(), { repeatingTransactions: n } = N(), { onEvent: o } = q(), l = (a) => {
|
503
|
+
o(k.RECURRING_TRANSACTIONS_CLICK_INCOME, {
|
504
|
+
repeating_transaction_guid: a.guid
|
505
|
+
});
|
506
|
+
}, i = () => {
|
507
|
+
o(k.RECURRING_TRANSACTIONS_CLICK_ADD_INCOME);
|
508
|
+
};
|
509
|
+
return /* @__PURE__ */ s(j, { sx: { bgcolor: "background.paper" }, children: [
|
510
|
+
n.filter(
|
511
|
+
(a) => a.repeating_transaction_type === A.Income && (a.transactions.length > 0 || a.recurrence_type === c.EveryYear)
|
512
|
+
).map((a, r) => /* @__PURE__ */ s(d.Fragment, { children: [
|
513
|
+
/* @__PURE__ */ e(Me, { onClick: l, repeatingTransaction: a }),
|
514
|
+
/* @__PURE__ */ e(O, { variant: r < n.length - 1 ? "inset" : "fullWidth" })
|
515
|
+
] }, a.guid)),
|
516
|
+
/* @__PURE__ */ e(
|
517
|
+
Ye,
|
518
|
+
{
|
519
|
+
isIncome: !0,
|
520
|
+
label: t.add_income,
|
521
|
+
onAddRecurringTransaction: i
|
522
|
+
}
|
523
|
+
)
|
524
|
+
] });
|
525
|
+
});
|
526
|
+
export {
|
527
|
+
Ye as A,
|
528
|
+
vt as M,
|
529
|
+
Me as R,
|
530
|
+
Fe as S,
|
531
|
+
Ne as a,
|
532
|
+
Ge as b,
|
533
|
+
U as c,
|
534
|
+
Be as i
|
535
|
+
};
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import { makeAutoObservable as m, runInAction as s } from "mobx";
|
2
|
+
import { F as p, A as c } from "./Fetch-CkFKy79O.mjs";
|
3
|
+
class h {
|
4
|
+
fetchInstance;
|
5
|
+
constructor(t, n) {
|
6
|
+
this.fetchInstance = new p(t, n);
|
7
|
+
}
|
8
|
+
getMerchants = async (t = [], n = [], r = 1, o = 25) => {
|
9
|
+
let a = c.MERCHANTS;
|
10
|
+
return a += `?page=${r}&per_page=${o}`, t.length && t.forEach((e) => a += `&fuzzy_name[]=${e}`), n.length && n.forEach((e) => a += `&guid[]=${e}`), this.fetchInstance.get(a).then((e) => e.merchants);
|
11
|
+
};
|
12
|
+
getMerchantByGuid = async (t) => this.fetchInstance.get(`${c.MERCHANTS}/${t}`).then((n) => n.merchant);
|
13
|
+
}
|
14
|
+
class l {
|
15
|
+
globalStore;
|
16
|
+
api = new h("/", "");
|
17
|
+
merchant = null;
|
18
|
+
merchants = [];
|
19
|
+
isLoading = !1;
|
20
|
+
constructor(t) {
|
21
|
+
this.globalStore = t, this.api = new h(t.endpoint, t.sessionToken), m(this);
|
22
|
+
}
|
23
|
+
loadMerchants = async (t = "") => {
|
24
|
+
this.isLoading = !0;
|
25
|
+
const n = await this.api.getMerchants([t]);
|
26
|
+
s(() => {
|
27
|
+
this.merchants = n, this.isLoading = !1;
|
28
|
+
});
|
29
|
+
};
|
30
|
+
loadMerchantByGuid = async (t) => {
|
31
|
+
const n = await this.api.getMerchantByGuid(t);
|
32
|
+
s(() => this.merchant = n);
|
33
|
+
};
|
34
|
+
}
|
35
|
+
export {
|
36
|
+
l as M
|
37
|
+
};
|