@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,879 @@
|
|
1
|
+
import { jsx as e, jsxs as o, Fragment as K } from "react/jsx-runtime";
|
2
|
+
import h from "react";
|
3
|
+
import { observer as T } from "mobx-react-lite";
|
4
|
+
import { endOfMonth as z } from "date-fns/endOfMonth";
|
5
|
+
import { endOfToday as ce } from "date-fns/endOfToday";
|
6
|
+
import { startOfMonth as k } from "date-fns/startOfMonth";
|
7
|
+
import { startOfToday as le } from "date-fns/startOfToday";
|
8
|
+
import { subDays as de } from "date-fns/subDays";
|
9
|
+
import re from "@mui/material/Skeleton";
|
10
|
+
import c from "@mui/material/Stack";
|
11
|
+
import { R as He } from "../RecurringSettings-D_HnMYZP.mjs";
|
12
|
+
import { M as An } from "../RecurringSettings-D_HnMYZP.mjs";
|
13
|
+
import { addMonths as ze } from "date-fns/addMonths";
|
14
|
+
import { subMonths as Be } from "date-fns/subMonths";
|
15
|
+
import { isBefore as Ue } from "date-fns/isBefore";
|
16
|
+
import oe from "@mui/material/Unstable_Grid2";
|
17
|
+
import be from "@mui/material/IconButton";
|
18
|
+
import Re from "@mui/material/Tab";
|
19
|
+
import Fe from "@mui/material/Tabs";
|
20
|
+
import { Schedule as je, MonetizationOn as Ke, Cancel as ve, CheckCircle as Me, ChevronLeft as Ye, ChevronRight as Ve, CurrencyExchange as Xe } from "@mxenabled/mx-icons";
|
21
|
+
import { Text as p, MerchantLogo as ue, InstitutionLogo as Ze, H3 as qe, P as ae } from "@mxenabled/mxui";
|
22
|
+
import { getWeeksInMonth as Te } from "date-fns/getWeeksInMonth";
|
23
|
+
import me from "@mui/material/styles/useTheme";
|
24
|
+
import { AdapterDateFns as Je } from "@mui/x-date-pickers/AdapterDateFnsV3";
|
25
|
+
import { DateCalendar as Qe } from "@mui/x-date-pickers/DateCalendar";
|
26
|
+
import { LocalizationProvider as et } from "@mui/x-date-pickers/LocalizationProvider";
|
27
|
+
import { isSameDay as tt } from "date-fns/isSameDay";
|
28
|
+
import nt from "@mui/material/Badge";
|
29
|
+
import { PickersDay as it } from "@mui/x-date-pickers/PickersDay";
|
30
|
+
import { I as Y } from "../IconBacking-B9oC6uL2.mjs";
|
31
|
+
import { u as D, a as V, f as v, g as X, c as pe, n as ge, p as rt } from "../hooks-30y_BLwc.mjs";
|
32
|
+
import { c as M, a as R, g as De, f as ot } from "../RepeatingTransaction-BPWfaB3f.mjs";
|
33
|
+
import { T as P } from "../RecurringTransactionsStore-BKLD3OWo.mjs";
|
34
|
+
import { R as Gn } from "../RecurringTransactionsStore-BKLD3OWo.mjs";
|
35
|
+
import { A as _, W as at } from "../WidgetContainer-DWCusxYI.mjs";
|
36
|
+
import st from "@mui/material/Button";
|
37
|
+
import se from "@mui/material/Divider";
|
38
|
+
import Se from "@mui/material/List";
|
39
|
+
import Le from "@mui/material/ListItem";
|
40
|
+
import ct from "@mui/material/ListSubheader";
|
41
|
+
import lt from "@mui/material/ListItemAvatar";
|
42
|
+
import dt from "@mui/material/ListItemButton";
|
43
|
+
import ut from "@mui/material/ListItemText";
|
44
|
+
import { a as mt } from "../ManageIncome-ndMuhJMG.mjs";
|
45
|
+
import { b as On, M as kn, S as Wn } from "../ManageIncome-ndMuhJMG.mjs";
|
46
|
+
import { f as L } from "../NumberFormatting-CtWHhyBX.mjs";
|
47
|
+
import { D as Ae } from "../Drawer-kEE73B87.mjs";
|
48
|
+
import { b as N } from "../Localization-2MODESHW.mjs";
|
49
|
+
import { f as A, D as E } from "../Dialog-CWW597AF.mjs";
|
50
|
+
import O from "@mui/material/Box";
|
51
|
+
import { S as Ee } from "../StatusBar-BK_uYHAB.mjs";
|
52
|
+
import { u as Ge } from "../useScreenSize-B6JyS_Lj.mjs";
|
53
|
+
import { L as j } from "../Loader-Dp1P2gNw.mjs";
|
54
|
+
import { M as pt } from "../MiniWidgetContainer-BoOp-A05.mjs";
|
55
|
+
import { u as gt } from "../useDimensions-27p2evRx.mjs";
|
56
|
+
import { M as ht } from "../MicroWidgetContainer-CsvHLYKX.mjs";
|
57
|
+
const Z = {
|
58
|
+
gridRow: 1,
|
59
|
+
gridColumn: 1,
|
60
|
+
zIndex: 2
|
61
|
+
}, q = (t) => t ? { margin: "0 0 -6px -4px" } : void 0, he = ({ isOffset: t = !1, size: n = 16 }) => /* @__PURE__ */ e(Y, { size: n, sx: { ...q(t) }, children: /* @__PURE__ */ e(je, { color: "primary", filled: !0, sx: { fontSize: n, ...Z } }) }), fe = ({ isOffset: t = !1, size: n = 16 }) => /* @__PURE__ */ e(Y, { size: n, sx: { ...q(t) }, children: /* @__PURE__ */ e(
|
62
|
+
Ke,
|
63
|
+
{
|
64
|
+
filled: !0,
|
65
|
+
sx: { color: "categories.income", fontSize: n, ...Z }
|
66
|
+
}
|
67
|
+
) }), xe = ({ isOffset: t = !1, size: n = 16 }) => /* @__PURE__ */ e(Y, { size: n, sx: { ...q(t) }, children: /* @__PURE__ */ e(ve, { color: "error", filled: !0, sx: { fontSize: n, ...Z } }) }), ye = ({ isOffset: t = !1, size: n = 16 }) => /* @__PURE__ */ e(Y, { size: n, sx: { ...q(t) }, children: /* @__PURE__ */ e(Me, { color: "success", filled: !0, sx: { fontSize: n, ...Z } }) }), ft = T(
|
68
|
+
({ day: t, outsideCurrentMonth: n, ...i }) => {
|
69
|
+
const { recurring: a } = D(), { selectedAccountGuids: r } = V(), { recurrences: l, setSelectedDay: u } = v(), s = h.useMemo(
|
70
|
+
() => l.filter((d) => r.includes(d.accountGuid)),
|
71
|
+
[r, l]
|
72
|
+
).filter(
|
73
|
+
(d) => tt(d.occurredOnDate || d.expectedDate, t)
|
74
|
+
), m = s.some(
|
75
|
+
(d) => d.type !== M.Income && d.status === R.Upcoming
|
76
|
+
), f = s.some(
|
77
|
+
(d) => d.type !== M.Income && d.status === R.Missed
|
78
|
+
), x = s.some(
|
79
|
+
(d) => d.type !== M.Income && d.status === R.Paid
|
80
|
+
), b = s.some((d) => d.type === M.Income), y = (m ? 1 : 0) + (f ? 1 : 0) + (x ? 1 : 0) + (b ? 1 : 0);
|
81
|
+
return /* @__PURE__ */ e(
|
82
|
+
nt,
|
83
|
+
{
|
84
|
+
badgeContent: s.length > 0 && /* @__PURE__ */ o(K, { children: [
|
85
|
+
f && /* @__PURE__ */ e(xe, { isOffset: !0 }),
|
86
|
+
x && /* @__PURE__ */ e(ye, { isOffset: !0 }),
|
87
|
+
m && /* @__PURE__ */ e(he, { isOffset: !0 }),
|
88
|
+
b && /* @__PURE__ */ e(fe, { isOffset: !0 })
|
89
|
+
] }),
|
90
|
+
overlap: "circular",
|
91
|
+
sx: {
|
92
|
+
"& .MuiBadge-badge": {
|
93
|
+
padding: 0,
|
94
|
+
marginRight: `${(y - 1) * 6 + 1}px`,
|
95
|
+
flexWrap: "nowrap"
|
96
|
+
}
|
97
|
+
},
|
98
|
+
children: /* @__PURE__ */ e(
|
99
|
+
it,
|
100
|
+
{
|
101
|
+
"aria-label": `
|
102
|
+
${x && a.paid},
|
103
|
+
${f && a.missed},
|
104
|
+
${m && a.upcoming},
|
105
|
+
${b && a.income}`,
|
106
|
+
day: t,
|
107
|
+
onClick: () => u(t),
|
108
|
+
outsideCurrentMonth: n,
|
109
|
+
sx: {
|
110
|
+
"&.MuiPickersDay-root": {
|
111
|
+
...n && {
|
112
|
+
color: "text.disabled"
|
113
|
+
}
|
114
|
+
}
|
115
|
+
},
|
116
|
+
...i
|
117
|
+
}
|
118
|
+
)
|
119
|
+
}
|
120
|
+
);
|
121
|
+
}
|
122
|
+
), F = ({ icon: t, label: n }) => /* @__PURE__ */ o(c, { alignItems: "center", flexDirection: "row", sx: { gap: 6 }, children: [
|
123
|
+
/* @__PURE__ */ e(t, {}),
|
124
|
+
/* @__PURE__ */ e(p, { variant: "XSmall", children: n })
|
125
|
+
] }), xt = T(() => {
|
126
|
+
const { recurring: t } = D();
|
127
|
+
return /* @__PURE__ */ o(
|
128
|
+
c,
|
129
|
+
{
|
130
|
+
alignItems: "center",
|
131
|
+
"aria-hidden": !0,
|
132
|
+
flexDirection: "row",
|
133
|
+
gap: 16,
|
134
|
+
justifyContent: "center",
|
135
|
+
mt: 12,
|
136
|
+
children: [
|
137
|
+
/* @__PURE__ */ e(F, { icon: he, label: t.expense }),
|
138
|
+
/* @__PURE__ */ e(F, { icon: fe, label: t.income }),
|
139
|
+
/* @__PURE__ */ e(F, { icon: xe, label: t.missed }),
|
140
|
+
/* @__PURE__ */ e(F, { icon: ye, label: t.paid })
|
141
|
+
]
|
142
|
+
}
|
143
|
+
);
|
144
|
+
}), Ie = 58, Ne = T(() => {
|
145
|
+
const t = me(), { onEvent: n } = X(), { selectedDay: i, setDateRange: a } = v(), [r, l] = h.useState(
|
146
|
+
Te(/* @__PURE__ */ new Date()) * P + Ie
|
147
|
+
), u = (s) => {
|
148
|
+
l(Te(s) * P + Ie), a({
|
149
|
+
start: k(s),
|
150
|
+
end: z(s)
|
151
|
+
}), n(_.RECURRING_TRANSACTIONS_CLICK_CALENDAR_RIGHT);
|
152
|
+
}, g = /* @__PURE__ */ e(
|
153
|
+
Qe,
|
154
|
+
{
|
155
|
+
minDate: k(/* @__PURE__ */ new Date()),
|
156
|
+
onMonthChange: u,
|
157
|
+
showDaysOutsideCurrentMonth: !0,
|
158
|
+
slots: {
|
159
|
+
day: ft
|
160
|
+
},
|
161
|
+
sx: {
|
162
|
+
"& .MuiPickersArrowSwitcher-button": {
|
163
|
+
color: "primary.main",
|
164
|
+
"&:disabled": {
|
165
|
+
color: "action.disabled"
|
166
|
+
}
|
167
|
+
},
|
168
|
+
"& .MuiButtonBase-root.MuiPickersDay-root": {
|
169
|
+
borderRadius: "4px",
|
170
|
+
"&:focus, &:hover": {
|
171
|
+
borderRadius: "4px"
|
172
|
+
}
|
173
|
+
},
|
174
|
+
"& .MuiPickersCalendarHeader-root": {
|
175
|
+
mt: 0,
|
176
|
+
pl: 16,
|
177
|
+
pr: 8
|
178
|
+
},
|
179
|
+
"& .MuiPickersCalendarHeader-label": {
|
180
|
+
fontSize: t.typography.Body.fontSize,
|
181
|
+
fontWeight: 600
|
182
|
+
},
|
183
|
+
"& .MuiDayCalendar-slideTransition": {
|
184
|
+
minHeight: r
|
185
|
+
},
|
186
|
+
"&.MuiDateCalendar-root": {
|
187
|
+
minHeight: r + P
|
188
|
+
},
|
189
|
+
"& .MuiButtonBase-root, .MuiDayCalendar-weekDayLabel": {
|
190
|
+
height: P,
|
191
|
+
width: P,
|
192
|
+
margin: 0
|
193
|
+
},
|
194
|
+
"& .MuiDayCalendar-weekDayLabel": {
|
195
|
+
fontFamily: t.typography.h3.fontFamily,
|
196
|
+
fontSize: t.typography.body2.fontSize
|
197
|
+
}
|
198
|
+
},
|
199
|
+
value: i,
|
200
|
+
views: ["day"]
|
201
|
+
}
|
202
|
+
);
|
203
|
+
return /* @__PURE__ */ e(c, { justifyContent: "center", children: /* @__PURE__ */ o(et, { dateAdapter: Je, children: [
|
204
|
+
i && g,
|
205
|
+
!i && g,
|
206
|
+
/* @__PURE__ */ e(xt, {})
|
207
|
+
] }) });
|
208
|
+
}), yt = (t) => {
|
209
|
+
if (t.type === M.Income)
|
210
|
+
return /* @__PURE__ */ e(fe, {});
|
211
|
+
switch (t.status) {
|
212
|
+
case R.Missed:
|
213
|
+
return /* @__PURE__ */ e(xe, {});
|
214
|
+
case R.Paid:
|
215
|
+
return /* @__PURE__ */ e(ye, {});
|
216
|
+
default:
|
217
|
+
return /* @__PURE__ */ e(he, {});
|
218
|
+
}
|
219
|
+
}, Ct = (t, n) => {
|
220
|
+
switch (t.status) {
|
221
|
+
case R.Paid:
|
222
|
+
return t.expectedDate ? N(
|
223
|
+
n.paid_on,
|
224
|
+
A(
|
225
|
+
t.occurredOnDate || t.expectedDate,
|
226
|
+
E.MONTH_DAY
|
227
|
+
)
|
228
|
+
) : n.paid;
|
229
|
+
case R.Missed:
|
230
|
+
return N(
|
231
|
+
n.missed_on,
|
232
|
+
A(t.expectedDate, E.MONTH_DAY)
|
233
|
+
);
|
234
|
+
case R.Upcoming:
|
235
|
+
return N(
|
236
|
+
n.upcoming_on,
|
237
|
+
A(t.expectedDate, E.MONTH_DAY)
|
238
|
+
);
|
239
|
+
default:
|
240
|
+
return n.unknown;
|
241
|
+
}
|
242
|
+
}, we = ({
|
243
|
+
recurrence: t,
|
244
|
+
isMini: n = !1,
|
245
|
+
onRecurrenceClick: i = () => {
|
246
|
+
},
|
247
|
+
showOrdinal: a = !1
|
248
|
+
}) => {
|
249
|
+
const { recurring: r } = D(), { repeatingTransactions: l } = v(), [u, g] = h.useState(!1), s = h.useMemo(
|
250
|
+
() => l.find((S) => S.guid === t.repeatingTransactionGuid),
|
251
|
+
[t, l]
|
252
|
+
), m = t.type === M.Income, f = t.status === R.Paid, x = t.status === R.Missed, b = t.status === R.Upcoming;
|
253
|
+
let y = r.paid?.toLowerCase();
|
254
|
+
return x ? y = r.missed?.toLowerCase() : b && (y = a ? De(r, s || {}, !0) : De(r, s || {}, !1)), //TODO: implement common/components/ListItemRow.tsx
|
255
|
+
/* @__PURE__ */ o(Le, { disableGutters: !0, disablePadding: !0, children: [
|
256
|
+
/* @__PURE__ */ o(dt, { onClick: () => {
|
257
|
+
g(!0), i(t);
|
258
|
+
}, children: [
|
259
|
+
/* @__PURE__ */ e(lt, { children: /* @__PURE__ */ e(
|
260
|
+
ue,
|
261
|
+
{
|
262
|
+
categoryGuid: t.categoryGuid,
|
263
|
+
merchantGuid: t.merchantGuid
|
264
|
+
}
|
265
|
+
) }),
|
266
|
+
/* @__PURE__ */ e(ut, { children: /* @__PURE__ */ o(
|
267
|
+
c,
|
268
|
+
{
|
269
|
+
direction: "row",
|
270
|
+
gap: 4,
|
271
|
+
sx: { justifyContent: "space-between", textOverflow: "ellipsis", textWrap: "nowrap" },
|
272
|
+
children: [
|
273
|
+
/* @__PURE__ */ o(c, { direction: "column", width: "50%", children: [
|
274
|
+
/* @__PURE__ */ e(p, { bold: !0, variant: "body1", children: t.name }),
|
275
|
+
/* @__PURE__ */ e(c, { alignItems: "center", direction: "row", gap: 6, children: n ? /* @__PURE__ */ o(c, { direction: "row", gap: 4, children: [
|
276
|
+
yt(t),
|
277
|
+
/* @__PURE__ */ e(p, { variant: "caption", children: Ct(t, r) })
|
278
|
+
] }) : /* @__PURE__ */ o(K, { children: [
|
279
|
+
t.institutionGuid && /* @__PURE__ */ e(
|
280
|
+
Ze,
|
281
|
+
{
|
282
|
+
alt: t.institutionName,
|
283
|
+
institutionGuid: t.institutionGuid,
|
284
|
+
size: 12
|
285
|
+
}
|
286
|
+
),
|
287
|
+
/* @__PURE__ */ e(p, { sx: { maxWidth: 250 }, variant: "caption", children: t.institutionName })
|
288
|
+
] }) })
|
289
|
+
] }),
|
290
|
+
/* @__PURE__ */ o(c, { alignItems: "flex-end", width: "100%", children: [
|
291
|
+
/* @__PURE__ */ o(p, { bold: !0, color: m ? "success.main" : "text.primary", variant: "body1", children: [
|
292
|
+
m ? "+" : "",
|
293
|
+
L(t.amount, "0,0.00")
|
294
|
+
] }),
|
295
|
+
!n && /* @__PURE__ */ o(
|
296
|
+
c,
|
297
|
+
{
|
298
|
+
direction: "row",
|
299
|
+
sx: {
|
300
|
+
alignItems: "center",
|
301
|
+
gap: 6,
|
302
|
+
justifyContent: "flex-end",
|
303
|
+
textTransform: "uppercase",
|
304
|
+
width: "100%"
|
305
|
+
},
|
306
|
+
children: [
|
307
|
+
f && /* @__PURE__ */ e(Me, { color: "success", filled: !0, size: 12 }),
|
308
|
+
x && /* @__PURE__ */ e(ve, { color: "error", filled: !0, size: 12 }),
|
309
|
+
/* @__PURE__ */ e(p, { bold: !0, color: "text.secondary", variant: "caption", children: y })
|
310
|
+
]
|
311
|
+
}
|
312
|
+
)
|
313
|
+
] })
|
314
|
+
]
|
315
|
+
}
|
316
|
+
) })
|
317
|
+
] }),
|
318
|
+
/* @__PURE__ */ e(
|
319
|
+
Ae,
|
320
|
+
{
|
321
|
+
ariaLabelClose: r.close_drawer_aria,
|
322
|
+
isOpen: u,
|
323
|
+
onClose: () => g(!1),
|
324
|
+
title: t.type === M.Income ? r.income_details : r.expense_details,
|
325
|
+
children: s && /* @__PURE__ */ e(
|
326
|
+
mt,
|
327
|
+
{
|
328
|
+
onDeleted: () => g(!1),
|
329
|
+
recurringTransaction: s
|
330
|
+
}
|
331
|
+
)
|
332
|
+
}
|
333
|
+
)
|
334
|
+
] });
|
335
|
+
}, H = T(
|
336
|
+
({
|
337
|
+
recurrences: t,
|
338
|
+
isMini: n = !1,
|
339
|
+
onResetClick: i,
|
340
|
+
onRecurrenceClick: a,
|
341
|
+
sx: r = {},
|
342
|
+
title: l
|
343
|
+
}) => {
|
344
|
+
const { recurring: u } = D(), g = h.useMemo(() => ot(t), [t]);
|
345
|
+
return /* @__PURE__ */ o(c, { sx: { gap: 8, mt: 4, ...r }, children: [
|
346
|
+
l && /* @__PURE__ */ o(
|
347
|
+
c,
|
348
|
+
{
|
349
|
+
sx: { alignItems: "top", direction: "row", justifyContent: "space-between", px: 24 },
|
350
|
+
children: [
|
351
|
+
/* @__PURE__ */ e(p, { bold: !0, variant: "body1", children: l }),
|
352
|
+
i && /* @__PURE__ */ e(st, { onClick: i, sx: { mt: -12 }, variant: "text", children: u.reset })
|
353
|
+
]
|
354
|
+
}
|
355
|
+
),
|
356
|
+
t.length === 0 ? /* @__PURE__ */ e(p, { fontStyle: "italic", sx: { py: 24, textAlign: "center" }, children: u.no_activities }) : /* @__PURE__ */ e(Se, { children: n ? t.map((s, m) => /* @__PURE__ */ o(h.Fragment, { children: [
|
357
|
+
/* @__PURE__ */ e(
|
358
|
+
we,
|
359
|
+
{
|
360
|
+
isMini: n,
|
361
|
+
onRecurrenceClick: a,
|
362
|
+
recurrence: s
|
363
|
+
}
|
364
|
+
),
|
365
|
+
/* @__PURE__ */ e(se, { sx: { mx: 24 } })
|
366
|
+
] }, `recurrence-${m}`)) : g.map((s, m) => /* @__PURE__ */ o(h.Fragment, { children: [
|
367
|
+
/* @__PURE__ */ e(Le, { children: /* @__PURE__ */ e(
|
368
|
+
Se,
|
369
|
+
{
|
370
|
+
subheader: /* @__PURE__ */ e(ct, { sx: { bgcolor: "background.paper", ml: 8, pb: 4, pt: 12 }, children: /* @__PURE__ */ e(p, { bold: !0, variant: "caption", children: A(s.date, E.DAY_OF_WEEK_MONTH_DAY) }) }),
|
371
|
+
sx: { width: "100%" },
|
372
|
+
children: s.recurrences.map((f, x) => /* @__PURE__ */ e(h.Fragment, { children: /* @__PURE__ */ e(
|
373
|
+
we,
|
374
|
+
{
|
375
|
+
isMini: n,
|
376
|
+
onRecurrenceClick: a,
|
377
|
+
recurrence: f
|
378
|
+
}
|
379
|
+
) }, `day-recurrence-${x}`))
|
380
|
+
}
|
381
|
+
) }, s.id),
|
382
|
+
/* @__PURE__ */ e(se, { sx: { mx: 24 } })
|
383
|
+
] }, `recurrence-${m}`)) })
|
384
|
+
] });
|
385
|
+
}
|
386
|
+
), _e = T(
|
387
|
+
({ expected: t, isExpense: n = !0, missed: i, paid: a, title: r, total: l, upcoming: u }) => {
|
388
|
+
const g = me(), { isSmallMobile: s } = Ge(), { recurring: m } = D(), f = h.useMemo(() => {
|
389
|
+
const x = [{ color: g.palette.success.main, percentage: `${a / t}` }];
|
390
|
+
return i && x.push({ color: g.palette.error.main, percentage: `${i / t}` }), x;
|
391
|
+
}, [a, t, i]);
|
392
|
+
return /* @__PURE__ */ o(c, { sx: { px: 24 }, children: [
|
393
|
+
/* @__PURE__ */ o(c, { sx: { flexDirection: "row", justifyContent: "space-between", pb: 12 }, children: [
|
394
|
+
/* @__PURE__ */ e(p, { bold: !0, variant: "body1", children: `${r} (${l})` }),
|
395
|
+
/* @__PURE__ */ e(p, { bold: !0, color: n ? "text.primary" : "success.main", variant: "body1", children: `${n ? "-" : "+"}${L(t, "0,0.00")}` })
|
396
|
+
] }),
|
397
|
+
/* @__PURE__ */ e(Ee, { data: f, height: 12 }),
|
398
|
+
/* @__PURE__ */ o(c, { sx: { alignItems: "center", flexDirection: "row", gap: 2, my: 8 }, children: [
|
399
|
+
/* @__PURE__ */ e(O, { sx: { bgcolor: "success.main", height: 8, mr: 8, width: 8 } }),
|
400
|
+
!s && /* @__PURE__ */ e(p, { bold: !0, variant: "body2", children: L(a, "0,0.00") }),
|
401
|
+
/* @__PURE__ */ e(p, { variant: "caption", children: m.paid?.toLowerCase() }),
|
402
|
+
i !== void 0 && /* @__PURE__ */ o(K, { children: [
|
403
|
+
/* @__PURE__ */ e(O, { sx: { bgcolor: "error.main", height: 8, ml: 16, mr: 8, width: 8 } }),
|
404
|
+
!s && /* @__PURE__ */ e(p, { bold: !0, variant: "body2", children: L(i, "0,0.00") }),
|
405
|
+
/* @__PURE__ */ e(p, { variant: "caption", children: m.missed?.toLowerCase() })
|
406
|
+
] }),
|
407
|
+
/* @__PURE__ */ e(O, { sx: { bgcolor: "divider", height: 8, ml: 16, mr: 8, width: 8 } }),
|
408
|
+
!s && /* @__PURE__ */ e(p, { bold: !0, variant: "body2", children: L(u, "0,0.00") }),
|
409
|
+
/* @__PURE__ */ e(p, { variant: "caption", children: m.upcoming })
|
410
|
+
] })
|
411
|
+
] });
|
412
|
+
}
|
413
|
+
), bt = T(() => {
|
414
|
+
const { recurring: t } = D(), { isDesktop: n, isSmallMobile: i } = Ge(), { onEvent: a } = X(), {
|
415
|
+
currentMonthExpenses: r,
|
416
|
+
currentMonthIncome: l,
|
417
|
+
dateRange: u,
|
418
|
+
expenseTotal: g,
|
419
|
+
incomeTotal: s,
|
420
|
+
missedExpenseTotal: m,
|
421
|
+
pastRecurrences: f,
|
422
|
+
paidExpenseTotal: x,
|
423
|
+
paidIncomeTotal: b,
|
424
|
+
selectedDay: y,
|
425
|
+
selectedDayRecurrences: d,
|
426
|
+
setDateRange: S,
|
427
|
+
upcomingExpenseTotal: W,
|
428
|
+
upcomingIncomeTotal: J,
|
429
|
+
upcomingRecurrences: B
|
430
|
+
} = v(), [$, Q] = h.useState(0), ee = Ue(u.start, /* @__PURE__ */ new Date()), I = (C, ie) => {
|
431
|
+
Q(ie);
|
432
|
+
}, U = (C) => {
|
433
|
+
a(_.RECURRING_TRANSACTIONS_CLICK_UPCOMING, {
|
434
|
+
transaction_guid: C.transaction?.guid
|
435
|
+
});
|
436
|
+
}, w = (C) => {
|
437
|
+
a(_.RECURRING_TRANSACTIONS_CLICK_PAID, {
|
438
|
+
transaction_guid: C.transaction?.guid
|
439
|
+
});
|
440
|
+
}, te = () => {
|
441
|
+
const C = ze(u.start, 1);
|
442
|
+
S({
|
443
|
+
start: k(C),
|
444
|
+
end: z(C)
|
445
|
+
});
|
446
|
+
}, ne = () => {
|
447
|
+
const C = Be(u.start, 1);
|
448
|
+
S({
|
449
|
+
start: k(C),
|
450
|
+
end: z(C)
|
451
|
+
});
|
452
|
+
};
|
453
|
+
return /* @__PURE__ */ o(oe, { container: !0, sx: { pt: 16, px: 24, spacing: 24 }, children: [
|
454
|
+
/* @__PURE__ */ e(oe, { md: !0, sm: 12, width: "100%", children: /* @__PURE__ */ o(c, { sx: { gap: 16 }, children: [
|
455
|
+
/* @__PURE__ */ o(c, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
456
|
+
/* @__PURE__ */ e(qe, { sx: { px: 24 }, children: N(
|
457
|
+
t.header_title,
|
458
|
+
A(u.start, E.MONTH_LONG)
|
459
|
+
) }),
|
460
|
+
!n && /* @__PURE__ */ o(c, { direction: "row", gap: 4, children: [
|
461
|
+
/* @__PURE__ */ e(
|
462
|
+
be,
|
463
|
+
{
|
464
|
+
color: "primary",
|
465
|
+
disabled: ee,
|
466
|
+
onClick: ne,
|
467
|
+
children: /* @__PURE__ */ e(Ye, {})
|
468
|
+
}
|
469
|
+
),
|
470
|
+
/* @__PURE__ */ e(be, { color: "primary", onClick: te, children: /* @__PURE__ */ e(Ve, {}) })
|
471
|
+
] })
|
472
|
+
] }),
|
473
|
+
/* @__PURE__ */ e(
|
474
|
+
_e,
|
475
|
+
{
|
476
|
+
expected: g,
|
477
|
+
missed: m,
|
478
|
+
paid: x,
|
479
|
+
title: t.expenses,
|
480
|
+
total: r.length,
|
481
|
+
upcoming: W
|
482
|
+
}
|
483
|
+
),
|
484
|
+
/* @__PURE__ */ e(
|
485
|
+
_e,
|
486
|
+
{
|
487
|
+
expected: s,
|
488
|
+
isExpense: !1,
|
489
|
+
paid: b,
|
490
|
+
title: t.deposits,
|
491
|
+
total: l.length,
|
492
|
+
upcoming: J
|
493
|
+
}
|
494
|
+
),
|
495
|
+
n && /* @__PURE__ */ e(
|
496
|
+
H,
|
497
|
+
{
|
498
|
+
onRecurrenceClick: U,
|
499
|
+
recurrences: B,
|
500
|
+
title: t.upcoming_activity
|
501
|
+
}
|
502
|
+
),
|
503
|
+
!n && /* @__PURE__ */ o(c, { children: [
|
504
|
+
/* @__PURE__ */ o(Fe, { onChange: I, value: $, variant: "fullWidth", children: [
|
505
|
+
/* @__PURE__ */ e(
|
506
|
+
Re,
|
507
|
+
{
|
508
|
+
label: /* @__PURE__ */ e(p, { bold: !0, sx: { textTransform: "none" }, variant: "body1", children: i ? t.upcoming : t.upcoming_activity })
|
509
|
+
}
|
510
|
+
),
|
511
|
+
/* @__PURE__ */ e(
|
512
|
+
Re,
|
513
|
+
{
|
514
|
+
label: /* @__PURE__ */ e(p, { bold: !0, sx: { textTransform: "none" }, variant: "body1", children: i ? t.past : t.past_transactions })
|
515
|
+
}
|
516
|
+
)
|
517
|
+
] }),
|
518
|
+
$ === 0 && /* @__PURE__ */ e(
|
519
|
+
H,
|
520
|
+
{
|
521
|
+
onRecurrenceClick: U,
|
522
|
+
recurrences: B
|
523
|
+
}
|
524
|
+
),
|
525
|
+
$ === 1 && /* @__PURE__ */ e(
|
526
|
+
H,
|
527
|
+
{
|
528
|
+
onRecurrenceClick: w,
|
529
|
+
recurrences: f
|
530
|
+
}
|
531
|
+
)
|
532
|
+
] })
|
533
|
+
] }) }),
|
534
|
+
n && /* @__PURE__ */ e(oe, { sx: { minWidth: 450 }, xs: "auto", children: /* @__PURE__ */ o(c, { gap: 24, children: [
|
535
|
+
/* @__PURE__ */ e(Ne, {}),
|
536
|
+
/* @__PURE__ */ e(
|
537
|
+
H,
|
538
|
+
{
|
539
|
+
onRecurrenceClick: w,
|
540
|
+
recurrences: d || f,
|
541
|
+
title: y ? N(
|
542
|
+
t.day_transactions,
|
543
|
+
A(y, E.MONTH_DAY)
|
544
|
+
) : t.past_transactions
|
545
|
+
}
|
546
|
+
)
|
547
|
+
] }) })
|
548
|
+
] });
|
549
|
+
}), wn = T(({ onBackClick: t, sx: n = {} }) => {
|
550
|
+
const { accounts: i } = pe(), { recurring: a } = D(), { isCopyLoaded: r, isInitialized: l, selectedAccountGuids: u, setSelectedAccounts: g } = V(), { isDataLoaded: s, loadRepeatingTransactions: m, setDateRange: f } = v(), { setFilter: x } = ge(), { onEvent: b } = X(), [y, d] = h.useState(!1);
|
551
|
+
return h.useEffect(() => {
|
552
|
+
g(i);
|
553
|
+
}, [i]), h.useEffect(() => {
|
554
|
+
l && (x({
|
555
|
+
dateRange: { start: de(le(), 90), end: ce() },
|
556
|
+
accounts: u
|
557
|
+
}), f({ start: k(/* @__PURE__ */ new Date()), end: z(/* @__PURE__ */ new Date()) }), m().finally());
|
558
|
+
}, [l]), r ? /* @__PURE__ */ o(
|
559
|
+
at,
|
560
|
+
{
|
561
|
+
accountOptions: i,
|
562
|
+
actions: [
|
563
|
+
{
|
564
|
+
label: a.settings,
|
565
|
+
iconName: "settings",
|
566
|
+
onClick: () => {
|
567
|
+
d(!0), b(_.RECURRING_TRANSACTIONS_CLICK_SETTINGS);
|
568
|
+
}
|
569
|
+
}
|
570
|
+
],
|
571
|
+
onAccountsFilterClick: () => b(_.RECURRING_TRANSACTIONS_CLICK_FILTER),
|
572
|
+
onBackClick: t,
|
573
|
+
sx: n,
|
574
|
+
title: a.title,
|
575
|
+
children: [
|
576
|
+
l && s ? /* @__PURE__ */ e(bt, {}) : /* @__PURE__ */ o(c, { direction: "column", p: 48, spacing: 24, children: [
|
577
|
+
/* @__PURE__ */ e(re, { height: 100, variant: "rounded", width: "100%" }),
|
578
|
+
/* @__PURE__ */ e(re, { height: 100, variant: "rounded", width: "100%" }),
|
579
|
+
/* @__PURE__ */ e(re, { height: 600, variant: "rounded", width: "100%" })
|
580
|
+
] }),
|
581
|
+
/* @__PURE__ */ e(
|
582
|
+
Ae,
|
583
|
+
{
|
584
|
+
ariaLabelClose: a.close_drawer_aria,
|
585
|
+
isOpen: y,
|
586
|
+
onClose: () => d(!1),
|
587
|
+
shouldShowHeaderBorders: !1,
|
588
|
+
title: a.settings,
|
589
|
+
children: /* @__PURE__ */ e(He, {})
|
590
|
+
}
|
591
|
+
)
|
592
|
+
]
|
593
|
+
}
|
594
|
+
) : /* @__PURE__ */ e(j, {});
|
595
|
+
}), Rt = T(() => {
|
596
|
+
const { recurring: t } = D(), { availableWidth: n } = rt(), { selectedDay: i, selectedDayRecurrences: a, setSelectedDay: r, upcomingRecurrences: l } = v(), u = n < 750;
|
597
|
+
return /* @__PURE__ */ o(c, { flexDirection: u ? "column" : "row", width: "100%", children: [
|
598
|
+
/* @__PURE__ */ e(Ne, {}),
|
599
|
+
!u && /* @__PURE__ */ e(se, { flexItem: !0, orientation: "vertical", sx: { my: 16, ml: 16 } }),
|
600
|
+
/* @__PURE__ */ e(
|
601
|
+
H,
|
602
|
+
{
|
603
|
+
isMini: !0,
|
604
|
+
onResetClick: i ? () => r(i) : void 0,
|
605
|
+
recurrences: a || l.slice(0, 5),
|
606
|
+
sx: { width: u ? "100%" : "calc(100% - 336px)", mt: 12 },
|
607
|
+
title: i ? N(
|
608
|
+
t.day_transactions,
|
609
|
+
A(i, E.MONTH_DAY)
|
610
|
+
) : t.upcoming_activity
|
611
|
+
}
|
612
|
+
)
|
613
|
+
] });
|
614
|
+
}), _n = T(
|
615
|
+
({ onPrimaryCtaClick: t, sx: n }) => {
|
616
|
+
const { accounts: i } = pe(), { recurring: a } = D(), { setFilter: r } = ge(), { isDataLoaded: l, loadRepeatingTransactions: u } = v(), { isCopyLoaded: g, isInitialized: s, setSelectedAccounts: m, selectedAccountGuids: f } = V();
|
617
|
+
return h.useEffect(() => {
|
618
|
+
s && m(i);
|
619
|
+
}, [s]), h.useEffect(() => {
|
620
|
+
f.length > 0 && (r({
|
621
|
+
dateRange: { start: de(le(), 90), end: ce() },
|
622
|
+
accounts: f
|
623
|
+
}), u().finally());
|
624
|
+
}, [f]), !g || !s ? /* @__PURE__ */ e(j, {}) : /* @__PURE__ */ e(
|
625
|
+
pt,
|
626
|
+
{
|
627
|
+
className: "mx-exp-recurring-transactions-miniwidget",
|
628
|
+
onPrimaryCtaClick: t,
|
629
|
+
primaryCtaLabel: a.primary_cta,
|
630
|
+
subTitle: a.sub_title,
|
631
|
+
sx: n,
|
632
|
+
title: a.mini_title,
|
633
|
+
children: l ? /* @__PURE__ */ e(Rt, {}) : /* @__PURE__ */ e(j, {})
|
634
|
+
}
|
635
|
+
);
|
636
|
+
}
|
637
|
+
), Tt = ({
|
638
|
+
upcomingRecurrences: t,
|
639
|
+
maxLogos: n = 3
|
640
|
+
}) => /* @__PURE__ */ e(c, { sx: { flexDirection: "row", gap: 4 }, children: t?.slice(0, n).map((i, a) => /* @__PURE__ */ e(
|
641
|
+
ue,
|
642
|
+
{
|
643
|
+
categoryGuid: i.categoryGuid || "",
|
644
|
+
merchantGuid: i.merchantGuid || ""
|
645
|
+
},
|
646
|
+
`${i.categoryGuid}-${i.merchantGuid}-${a}`
|
647
|
+
)) }), Dt = ({
|
648
|
+
upcomingRecurrences: t,
|
649
|
+
logoSize: n = 32,
|
650
|
+
maxLogos: i = 3
|
651
|
+
}) => {
|
652
|
+
const a = (r) => r * (n / 2);
|
653
|
+
return /* @__PURE__ */ e(
|
654
|
+
O,
|
655
|
+
{
|
656
|
+
sx: {
|
657
|
+
position: "relative",
|
658
|
+
width: 64
|
659
|
+
},
|
660
|
+
children: t.map((r, l) => l < i ? /* @__PURE__ */ e(
|
661
|
+
O,
|
662
|
+
{
|
663
|
+
sx: {
|
664
|
+
borderRadius: "4px",
|
665
|
+
left: a(l),
|
666
|
+
outlineColor: "common.white",
|
667
|
+
outlineStyle: "solid",
|
668
|
+
outlineWidth: 2,
|
669
|
+
position: "absolute"
|
670
|
+
},
|
671
|
+
children: /* @__PURE__ */ e(
|
672
|
+
ue,
|
673
|
+
{
|
674
|
+
categoryGuid: r.categoryGuid || "",
|
675
|
+
merchantGuid: r.merchantGuid || "",
|
676
|
+
size: n
|
677
|
+
}
|
678
|
+
)
|
679
|
+
},
|
680
|
+
`${r.categoryGuid}-${r.merchantGuid}-${l}`
|
681
|
+
) : null)
|
682
|
+
}
|
683
|
+
);
|
684
|
+
}, St = ({
|
685
|
+
amount: t,
|
686
|
+
bgcolor: n,
|
687
|
+
isLargeScreen: i,
|
688
|
+
isSmallScreen: a,
|
689
|
+
label: r
|
690
|
+
}) => /* @__PURE__ */ o(c, { sx: { alignItems: "center", flexDirection: "row", gap: 8 }, children: [
|
691
|
+
/* @__PURE__ */ e(
|
692
|
+
O,
|
693
|
+
{
|
694
|
+
sx: {
|
695
|
+
borderRadius: "2px",
|
696
|
+
bgcolor: n,
|
697
|
+
height: 8,
|
698
|
+
width: 8
|
699
|
+
}
|
700
|
+
}
|
701
|
+
),
|
702
|
+
/* @__PURE__ */ o(c, { sx: { alignItems: "center", flexDirection: "row", gap: 2 }, children: [
|
703
|
+
!a && /* @__PURE__ */ e(p, { bold: !0, variant: "caption", children: L(t, t === 0 || !i ? "0,0" : "0,0.00") }),
|
704
|
+
/* @__PURE__ */ e(p, { variant: "caption", children: r })
|
705
|
+
] })
|
706
|
+
] }), It = T(() => {
|
707
|
+
const { recurring: t } = D();
|
708
|
+
return /* @__PURE__ */ o(c, { sx: { alignItems: "start", flexDirection: "row", gap: 12 }, children: [
|
709
|
+
/* @__PURE__ */ e(Xe, { size: 32 }),
|
710
|
+
/* @__PURE__ */ o(c, { children: [
|
711
|
+
/* @__PURE__ */ e(ae, { fontWeight: 600, variant: "body1", children: t.zero_state_content_header }),
|
712
|
+
/* @__PURE__ */ e(ae, { color: "text.secondary", variant: "subtitle2", children: t.zero_state_content_description })
|
713
|
+
] })
|
714
|
+
] });
|
715
|
+
}), vn = T(
|
716
|
+
({ onCTAClick: t }) => {
|
717
|
+
const [n, i] = h.useState(!1), { onEvent: a } = X(), r = me(), { accounts: l } = pe(), [u, { width: g }] = gt(), { isCopyLoaded: s, isInitialized: m, selectedAccountGuids: f, setSelectedAccounts: x } = V(), {
|
718
|
+
loadRepeatingTransactions: b,
|
719
|
+
upcomingRecurrences: y,
|
720
|
+
expenseTotal: d,
|
721
|
+
missedExpenseTotal: S,
|
722
|
+
paidExpenseTotal: W,
|
723
|
+
repeatingTransactions: J,
|
724
|
+
setDateRange: B,
|
725
|
+
upcomingExpenseTotal: $,
|
726
|
+
isDataLoaded: Q
|
727
|
+
} = v(), { setFilter: ee } = ge(), { recurring: I, budgets: U } = D();
|
728
|
+
h.useEffect(() => {
|
729
|
+
x(l);
|
730
|
+
}, [l]), h.useEffect(() => {
|
731
|
+
m && (ee({
|
732
|
+
dateRange: { start: de(le(), 90), end: ce() },
|
733
|
+
accounts: f
|
734
|
+
}), B({ start: k(/* @__PURE__ */ new Date()), end: z(/* @__PURE__ */ new Date()) }), b().finally(), i(!0));
|
735
|
+
}, [m]), h.useEffect(() => {
|
736
|
+
n && a(_.RECURRING_TRANSACTIONS_LOAD_WIDGET, {
|
737
|
+
state: y.length > 0 ? "default" : "zeroState"
|
738
|
+
});
|
739
|
+
}, [n]);
|
740
|
+
const w = g <= 288, te = g >= 450, ne = h.useMemo(() => {
|
741
|
+
const G = [
|
742
|
+
{ color: r.palette.success.main, percentage: `${W / d}` }
|
743
|
+
];
|
744
|
+
return S && G.push({
|
745
|
+
color: r.palette.error.main,
|
746
|
+
percentage: `${S / d}`
|
747
|
+
}), G;
|
748
|
+
}, [
|
749
|
+
W,
|
750
|
+
d,
|
751
|
+
S,
|
752
|
+
r.palette.success.main,
|
753
|
+
r.palette.error.main
|
754
|
+
]), C = h.useMemo(() => L(d, d === 0 ? "0,0" : "0,0.00"), [d]), ie = () => {
|
755
|
+
a(
|
756
|
+
y.length > 0 ? _.RECURRING_TRANSACTIONS_CLICK_GET_STARTED : _.RECURRING_TRANSACTIONS_CLICK_VIEW_ALL
|
757
|
+
), t();
|
758
|
+
};
|
759
|
+
if (!s || !n || !Q) return /* @__PURE__ */ e(j, { height: 100 });
|
760
|
+
const Oe = 32, ke = y.length > 0, We = () => ke ? w ? /* @__PURE__ */ e(
|
761
|
+
Dt,
|
762
|
+
{
|
763
|
+
logoSize: Oe,
|
764
|
+
maxLogos: 3,
|
765
|
+
upcomingRecurrences: y.slice(0, 3)
|
766
|
+
}
|
767
|
+
) : /* @__PURE__ */ e(Tt, { maxLogos: 3, upcomingRecurrences: y.slice(0, 3) }) : /* @__PURE__ */ e(c, { sx: { width: w ? 64 : 104 } }), $e = [
|
768
|
+
{
|
769
|
+
amount: W,
|
770
|
+
bgColor: "success.main",
|
771
|
+
label: I.paid
|
772
|
+
},
|
773
|
+
{
|
774
|
+
amount: S,
|
775
|
+
bgColor: "error.main",
|
776
|
+
label: I.missed
|
777
|
+
},
|
778
|
+
{
|
779
|
+
amount: $,
|
780
|
+
bgColor: "border.light",
|
781
|
+
label: I.upcoming
|
782
|
+
}
|
783
|
+
], Ce = !J?.length;
|
784
|
+
return /* @__PURE__ */ e(
|
785
|
+
ht,
|
786
|
+
{
|
787
|
+
className: "mx-recurring-transaction-microwidget",
|
788
|
+
ctaLabel: Ce ? U.get_started_cta : I.primary_cta,
|
789
|
+
onCTAClick: ie,
|
790
|
+
title: I.recurring_expenses,
|
791
|
+
children: Ce ? /* @__PURE__ */ e(It, {}) : /* @__PURE__ */ o(K, { children: [
|
792
|
+
/* @__PURE__ */ o(
|
793
|
+
c,
|
794
|
+
{
|
795
|
+
ref: u,
|
796
|
+
sx: {
|
797
|
+
flexDirection: "row",
|
798
|
+
justifyContent: "space-between"
|
799
|
+
},
|
800
|
+
children: [
|
801
|
+
/* @__PURE__ */ o(
|
802
|
+
c,
|
803
|
+
{
|
804
|
+
sx: [
|
805
|
+
C.length >= 10 && w ? { flexDirection: "column" } : { flexDirection: "row", gap: 2 },
|
806
|
+
{
|
807
|
+
alignItems: "baseline",
|
808
|
+
overflow: "hidden",
|
809
|
+
textOverflow: "ellipsis",
|
810
|
+
whiteSpace: "nowrap"
|
811
|
+
}
|
812
|
+
],
|
813
|
+
children: [
|
814
|
+
/* @__PURE__ */ e(
|
815
|
+
p,
|
816
|
+
{
|
817
|
+
sx: { width: "100%" },
|
818
|
+
variant: C.length >= 10 && w ? "H3" : "H2",
|
819
|
+
children: C
|
820
|
+
}
|
821
|
+
),
|
822
|
+
/* @__PURE__ */ e(
|
823
|
+
ae,
|
824
|
+
{
|
825
|
+
sx: {
|
826
|
+
pr: 12
|
827
|
+
},
|
828
|
+
variant: "XSmall",
|
829
|
+
children: I.expected
|
830
|
+
}
|
831
|
+
)
|
832
|
+
]
|
833
|
+
}
|
834
|
+
),
|
835
|
+
We()
|
836
|
+
]
|
837
|
+
}
|
838
|
+
),
|
839
|
+
/* @__PURE__ */ o(c, { sx: { pt: 12 }, children: [
|
840
|
+
/* @__PURE__ */ e(Ee, { data: ne }),
|
841
|
+
/* @__PURE__ */ e(
|
842
|
+
c,
|
843
|
+
{
|
844
|
+
sx: {
|
845
|
+
alignItems: "center",
|
846
|
+
flexDirection: "row",
|
847
|
+
gap: 16,
|
848
|
+
mt: 4
|
849
|
+
},
|
850
|
+
children: $e.map((G, Pe) => /* @__PURE__ */ e(
|
851
|
+
St,
|
852
|
+
{
|
853
|
+
amount: G.amount,
|
854
|
+
bgcolor: G.bgColor,
|
855
|
+
isLargeScreen: te,
|
856
|
+
isSmallScreen: w,
|
857
|
+
label: G.label
|
858
|
+
},
|
859
|
+
`recurrence-legend-${Pe}`
|
860
|
+
))
|
861
|
+
}
|
862
|
+
)
|
863
|
+
] })
|
864
|
+
] })
|
865
|
+
}
|
866
|
+
);
|
867
|
+
}
|
868
|
+
);
|
869
|
+
export {
|
870
|
+
On as AddRecurringTransactionDetails,
|
871
|
+
An as ManageExpenses,
|
872
|
+
kn as ManageIncome,
|
873
|
+
He as RecurringSettings,
|
874
|
+
vn as RecurringTransactionsMicroWidget,
|
875
|
+
_n as RecurringTransactionsMiniWidget,
|
876
|
+
Gn as RecurringTransactionsStore,
|
877
|
+
wn as RecurringTransactionsWidget,
|
878
|
+
Wn as SelectTransaction
|
879
|
+
};
|