@mx-cartographer/experiences 9.0.2 → 9.1.0-alpha.bb1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/dist/Analytics-BKzTPees.mjs +61 -0
  2. package/dist/GlobalCopyApi-BeXzaDH9.mjs +487 -0
  3. package/dist/HeaderCell-EhCUSjvj.mjs +10 -0
  4. package/dist/Loader-BlVzRtUd.mjs +73 -0
  5. package/dist/MiniWidgetContainer-COwnjfy7.mjs +110 -0
  6. package/dist/OriginalBalanceAction-sbiqaxok.mjs +110 -0
  7. package/dist/SpendingLegend-D15ixlQ1.mjs +222 -0
  8. package/dist/accounts/index.es.js +12 -1598
  9. package/dist/accounts-DkyAiLpg.mjs +15632 -0
  10. package/dist/analytics/index.es.js +155 -139
  11. package/dist/budgets/index.es.js +1317 -1266
  12. package/dist/cashflow/index.es.js +1047 -942
  13. package/dist/categories/index.es.js +4 -4
  14. package/dist/common/index.es.js +101 -310
  15. package/dist/core/index.es.js +80 -104
  16. package/dist/core-BexP5oiV.mjs +4047 -0
  17. package/dist/dashboard/index.es.js +185 -141
  18. package/dist/debts/index.es.js +1384 -1272
  19. package/dist/finstrong/index.es.js +3366 -3471
  20. package/dist/goals/index.es.js +1103 -984
  21. package/dist/help/index.es.js +3 -25
  22. package/dist/help-CctDYrAH.mjs +2308 -0
  23. package/dist/insights/index.es.js +93 -4843
  24. package/dist/investments/index.es.js +1533 -1522
  25. package/dist/merchants/index.es.js +75 -64
  26. package/dist/microinsights/index.es.js +15 -824
  27. package/dist/microinsights-CRf3ChsJ.mjs +1814 -0
  28. package/dist/networth/index.es.js +550 -503
  29. package/dist/notifications/index.es.js +169 -161
  30. package/dist/recurringtransactions/index.es.js +10 -962
  31. package/dist/recurringtransactions-gbJ_NA8u.mjs +1564 -0
  32. package/dist/settings/index.es.js +13 -880
  33. package/dist/settings-ZMHe439l.mjs +1526 -0
  34. package/dist/spending/index.es.js +400 -456
  35. package/dist/transactions/index.es.js +10 -603
  36. package/dist/trends/index.es.js +1268 -1407
  37. package/package.json +28 -28
  38. package/dist/Account-BaJmiJAG.mjs +0 -118
  39. package/dist/Account-BxHMlV9R.mjs +0 -30
  40. package/dist/AccountDetailsHeader-DIysk_4w.mjs +0 -95
  41. package/dist/AccountDisplayName-CO7z3v99.mjs +0 -11
  42. package/dist/AccountFields-mwJ8NXsX.mjs +0 -141
  43. package/dist/AccountListItem-BDXHs4tV.mjs +0 -94
  44. package/dist/AccountUtils-T5_Odvos.mjs +0 -27
  45. package/dist/Accounts-CseLC3lL.mjs +0 -5
  46. package/dist/Analytics-CkYXKvco.mjs +0 -53
  47. package/dist/Analytics-CzGzz_sE.mjs +0 -136
  48. package/dist/ApiEndpoints-DXwIYNUV.mjs +0 -49
  49. package/dist/BudgetUtil-Bg2AQJpQ.mjs +0 -74
  50. package/dist/Category-DEKZGLYe.mjs +0 -301
  51. package/dist/CategorySelectorDrawer-8soGrhB8.mjs +0 -430
  52. package/dist/Connect-Dk6GZEsA.mjs +0 -39
  53. package/dist/ConnectCard-CCep7Zqe.mjs +0 -54
  54. package/dist/ConnectDrawer-Cnjr3Ddg.mjs +0 -58
  55. package/dist/ConnectionsDrawer-CtfPXk0M.mjs +0 -54
  56. package/dist/CurrencyDialog-DumQCTPO.mjs +0 -373
  57. package/dist/CurrencyInput-adTIRtL3.mjs +0 -87
  58. package/dist/CurrencyText-CCbE6MmF.mjs +0 -20
  59. package/dist/DateFormats-HudZ3Bjs.mjs +0 -64
  60. package/dist/DateUtil-Bhq59ZVg.mjs +0 -58
  61. package/dist/DebtUtils-DD3186U-.mjs +0 -153
  62. package/dist/Dialog-Bvd2n8hz.mjs +0 -66
  63. package/dist/Donut-SzzfZDHF.mjs +0 -88
  64. package/dist/Drawer-BXqqBMxg.mjs +0 -174
  65. package/dist/EmbeddedCard-DPwJjqMH.mjs +0 -856
  66. package/dist/EmptyState-CJUDc3kD.mjs +0 -84
  67. package/dist/Error-Dogaw2jO.mjs +0 -84
  68. package/dist/ErrorBoundary-CsdOcnJ9.mjs +0 -23
  69. package/dist/ExportCsvAction-Bw02ZJEj.mjs +0 -24
  70. package/dist/GlobalAccountFilter-7Cg2-9A5.mjs +0 -237
  71. package/dist/GlobalCopyApi-wcnDUzMV.mjs +0 -128
  72. package/dist/GoalsUtil-C9EnLWvC.mjs +0 -107
  73. package/dist/HeaderCell-P8w6CmfO.mjs +0 -6
  74. package/dist/Help-CkQTjORd.mjs +0 -299
  75. package/dist/Help-DJ8PrVHX.mjs +0 -3209
  76. package/dist/IconBacking-DgT8DCeh.mjs +0 -39
  77. package/dist/InformationTooltip-4su8bn1e.mjs +0 -41
  78. package/dist/InvestmentUtil-BItV7uEs.mjs +0 -134
  79. package/dist/LineChart-CejWS_rh.mjs +0 -612
  80. package/dist/ListItemAction-CzZ8s39Z.mjs +0 -69
  81. package/dist/ListItemRow-kH1rn8Xu.mjs +0 -67
  82. package/dist/ListItemWrapper-B5r-YQQ_.mjs +0 -42
  83. package/dist/Loader-CxeBwuPG.mjs +0 -21
  84. package/dist/Localization-DnoVyBNK.mjs +0 -38
  85. package/dist/ManageIncome-D1yBODQi.mjs +0 -595
  86. package/dist/MicroWidgetContainer-CfKdQfhi.mjs +0 -45
  87. package/dist/MiniWidgetContainer-BdPiUU-u.mjs +0 -66
  88. package/dist/NetWorthUtils-DilGN1nW.mjs +0 -95
  89. package/dist/Notification-DTNYSd8P.mjs +0 -7
  90. package/dist/NotificationSettings-B4JA5IKE.mjs +0 -677
  91. package/dist/NotificationUtils-BRGFTePr.mjs +0 -23
  92. package/dist/NumberFormatting--XMeeBfr.mjs +0 -49
  93. package/dist/OriginalBalanceAction-BybTXDtO.mjs +0 -114
  94. package/dist/RecurringSettings-D2xbNb67.mjs +0 -88
  95. package/dist/RecurringTransactionsUtil-B3rLEx_g.mjs +0 -253
  96. package/dist/ResponsiveButton-CC9F_Ezk.mjs +0 -45
  97. package/dist/SearchBox-Cpgu_gdO.mjs +0 -50
  98. package/dist/Select-BFt-HD-L.mjs +0 -55
  99. package/dist/SelectionBox-B4xELRgp.mjs +0 -48
  100. package/dist/SingleSegmentDonut-7Uy6VEld.mjs +0 -69
  101. package/dist/Sizes-DISGrlUg.mjs +0 -6
  102. package/dist/SkeletonLoader-BaNboJjD.mjs +0 -38
  103. package/dist/SpendingData-PKlh8caU.mjs +0 -53
  104. package/dist/SpendingLegend-5Ct_FZ8o.mjs +0 -193
  105. package/dist/StatusBar-CPfSXe80.mjs +0 -30
  106. package/dist/TabContentContainer-CnMXkVqr.mjs +0 -21
  107. package/dist/ToggleListItem-Dl1lXNwj.mjs +0 -91
  108. package/dist/TransactionDetails-DctXr07p.mjs +0 -1714
  109. package/dist/TransactionUtils-BphBJBbU.mjs +0 -234
  110. package/dist/TrendsUtil-D9z3kIj_.mjs +0 -69
  111. package/dist/UserStore-CRpKQjpP.mjs +0 -3002
  112. package/dist/ViewMoreMicroCard-BD_MNc2z.mjs +0 -1295
  113. package/dist/WidgetContainer-CmbU4CBH.mjs +0 -482
  114. package/dist/hooks-BaO_gOI6.mjs +0 -77
  115. package/dist/useAccountDisplayName-CFa_MrS6.mjs +0 -15
  116. package/dist/useAriaLive-MkYebyUR.mjs +0 -35
  117. package/dist/useDimensions-CeDR9V8N.mjs +0 -36
  118. package/dist/useInsightsEnabled-DaNLPmUU.mjs +0 -11
  119. package/dist/useScreenSize-mWpmnh5w.mjs +0 -36
  120. package/dist/useWidgetLoadTimer-CJb-RELP.mjs +0 -19
@@ -1,595 +0,0 @@
1
- import { jsxs as c, jsx as e, Fragment as k } from "react/jsx-runtime";
2
- import _ from "react";
3
- import { observer as I } from "mobx-react-lite";
4
- import F from "@mui/material/Box";
5
- import T from "@mui/material/Divider";
6
- import Q from "@mui/material/List";
7
- import p from "@mui/material/Stack";
8
- import { MerchantLogo as $, Text as S, P as G, InstitutionLogo as se } from "@mxenabled/mxui";
9
- import ce from "@mui/material/ListItem";
10
- import de from "@mui/material/ListItemAvatar";
11
- import le from "@mui/material/ListItemButton";
12
- import _e from "@mui/material/ListItemText";
13
- import { b as ue, f as H } from "./NumberFormatting--XMeeBfr.mjs";
14
- import { F as l, g as X, R as L, c as Z } from "./RecurringTransactionsUtil-B3rLEx_g.mjs";
15
- import { subDays as J } from "date-fns/subDays";
16
- import { startOfToday as E } from "date-fns/startOfToday";
17
- import { endOfMonth as me } from "date-fns/endOfMonth";
18
- import { parseISO as pe } from "date-fns/parseISO";
19
- import V from "@mui/material/Button";
20
- import { Delete as ye, Add as he, ReceiptLong as fe } from "@mxenabled/mx-icons";
21
- import { T as ee, u as ge, S as Ce, a as be } from "./EmbeddedCard-DPwJjqMH.mjs";
22
- import { T as xe } from "./TransactionDetails-DctXr07p.mjs";
23
- import { addYears as j } from "date-fns/addYears";
24
- import { getDayOfYear as Se } from "date-fns/getDayOfYear";
25
- import { setDayOfYear as ve } from "date-fns/setDayOfYear";
26
- import { AdapterDateFns as De } from "@mui/x-date-pickers/AdapterDateFnsV3";
27
- import { DatePicker as we } from "@mui/x-date-pickers";
28
- import { LocalizationProvider as Ae } from "@mui/x-date-pickers/LocalizationProvider";
29
- import { u as w, i as Y, g as P, b as Ie, h as te, C as Re } from "./hooks-BaO_gOI6.mjs";
30
- import { S as M, D as z } from "./Select-BFt-HD-L.mjs";
31
- import { D as N } from "./Drawer-BXqqBMxg.mjs";
32
- import { A as O } from "./Analytics-CzGzz_sE.mjs";
33
- import { f as Ee, D as Le } from "./DateFormats-HudZ3Bjs.mjs";
34
- import { D as Oe } from "./Dialog-Bvd2n8hz.mjs";
35
- import { formatISO as Te } from "date-fns/formatISO";
36
- import { fromUnixTime as ke } from "date-fns/fromUnixTime";
37
- import { S as Ne } from "./SearchBox-Cpgu_gdO.mjs";
38
- import { i as Me } from "./DateUtil-Bhq59ZVg.mjs";
39
- import { C as q } from "./Category-DEKZGLYe.mjs";
40
- import { T as ne } from "./TransactionUtils-BphBJBbU.mjs";
41
- const re = ({
42
- frequency: n,
43
- firstDay: t,
44
- secondDay: o,
45
- onFrequencyChange: i,
46
- onFirstDayChange: s,
47
- onSecondDayChange: d
48
- }) => {
49
- const { recurring: r } = w(), a = _.useMemo(
50
- () => [
51
- { id: l.EveryWeek, label: r.frequency_every_week },
52
- { id: l.EveryOtherWeek, label: r.frequency_every_other_week },
53
- { id: l.TwiceAMonth, label: r.frequency_twice_a_month },
54
- { id: l.EveryMonth, label: r.frequency_every_month },
55
- { id: l.EveryOtherMonth, label: r.frequency_every_other_month },
56
- { id: l.EveryQuarter, label: r.frequency_every_quarter },
57
- { id: l.EveryOtherQuarter, label: r.frequency_every_other_quarter },
58
- { id: l.EveryYear, label: r.frequency_every_year }
59
- ],
60
- [r]
61
- ), m = [
62
- { id: 0, label: r.weekday_sunday },
63
- { id: 1, label: r.weekday_monday },
64
- { id: 2, label: r.weekday_tuesday },
65
- { id: 3, label: r.weekday_wednesday },
66
- { id: 4, label: r.weekday_thursday },
67
- { id: 5, label: r.weekday_friday },
68
- { id: 6, label: r.weekday_saturday }
69
- ], h = [...Array(31).keys()].map((b) => ({
70
- id: b + 1,
71
- label: ue(b + 1)
72
- }));
73
- h[30].label += ` (${r.last_day_of_month})`;
74
- const g = h.slice(0, 15), v = h.slice(14), C = n === l.EveryWeek || n === l.EveryOtherWeek, f = n === l.TwiceAMonth || n === l.EveryMonth || n === l.EveryOtherMonth || n === l.EveryQuarter || n === l.EveryOtherQuarter, A = ve(E(), t), y = A < E() ? j(A, 1) : A, D = (b) => {
75
- b && s(Se(b));
76
- };
77
- return /* @__PURE__ */ c(p, { gap: 24, sx: { m: 24 }, children: [
78
- /* @__PURE__ */ e(
79
- M,
80
- {
81
- label: r.frequency,
82
- onChange: i,
83
- options: a,
84
- value: n
85
- }
86
- ),
87
- C && /* @__PURE__ */ e(
88
- M,
89
- {
90
- label: r.day_of_the_week,
91
- onChange: s,
92
- options: m,
93
- value: t
94
- }
95
- ),
96
- f && /* @__PURE__ */ e(
97
- M,
98
- {
99
- label: n === l.TwiceAMonth ? r.first_day_of_the_month : r.day_of_the_month,
100
- onChange: s,
101
- options: n === l.TwiceAMonth ? g : h,
102
- value: t
103
- }
104
- ),
105
- n === l.TwiceAMonth && /* @__PURE__ */ e(
106
- M,
107
- {
108
- label: r.second_day_of_the_month,
109
- onChange: d,
110
- options: v,
111
- value: o || 0
112
- }
113
- ),
114
- n === l.EveryYear && /* @__PURE__ */ e(Ae, { dateAdapter: De, children: /* @__PURE__ */ e(
115
- we,
116
- {
117
- disablePast: !0,
118
- label: r.next_payment_date,
119
- maxDate: J(j(E(), 1), 1),
120
- minDate: E(),
121
- onChange: D,
122
- value: y
123
- }
124
- ) })
125
- ] });
126
- }, Fe = I(({ repeatingTransaction: n }) => {
127
- const { recurring: t } = w(), { updateRepeatingTransaction: o } = Y(), { onEvent: i } = P(), [s, d] = _.useState(!1), [r, a] = _.useState(n.recurrence_type), [m, h] = _.useState(n.recurrence_day), [g, v] = _.useState(n.second_recurrence_day), C = async () => {
128
- await o({
129
- ...n,
130
- recurrence_type: r,
131
- recurrence_day: m,
132
- second_recurrence_day: g
133
- }), d(!1);
134
- }, f = () => {
135
- d(!0), i(O.RECURRING_TRANSACTIONS_DETAILS_CLICK_PAYMENT_SCHEDULE);
136
- };
137
- return /* @__PURE__ */ c(k, { children: [
138
- /* @__PURE__ */ e(
139
- z,
140
- {
141
- iconName: "sync",
142
- label: t.activity_schedule,
143
- onClick: f,
144
- value: `${X(t, n, !0)}`
145
- }
146
- ),
147
- /* @__PURE__ */ e(
148
- N,
149
- {
150
- ariaLabelClose: t.close_drawer_aria,
151
- isOpen: s,
152
- onClose: () => d(!1),
153
- onPrimaryAction: C,
154
- title: t.payment_schedule,
155
- children: /* @__PURE__ */ e(
156
- re,
157
- {
158
- firstDay: m,
159
- frequency: r,
160
- onFirstDayChange: h,
161
- onFrequencyChange: a,
162
- onSecondDayChange: v,
163
- secondDay: g
164
- }
165
- )
166
- }
167
- )
168
- ] });
169
- }), Ge = I(
170
- ({ onDeleted: n, recurringTransaction: t }) => {
171
- const { recurring: o } = w(), { selectedAccountGuids: i } = Ie(), { onEvent: s } = P(), { deleteRepeatingTransaction: d } = Y(), { setFilter: r, transactions: a } = te(), { amount: m, description: h, merchant_guid: g } = t, [v, C] = _.useState(!1), [f, A] = _.useState("");
172
- _.useEffect(() => {
173
- r({
174
- accounts: i,
175
- dateRange: { start: J(E(), 90), end: me(E()) },
176
- custom: (u) => u.repeating_transaction_guid === t.guid
177
- });
178
- }, [t]);
179
- const y = _.useMemo(
180
- () => a.find((u) => u.guid === f),
181
- [f, a]
182
- ), D = t.repeating_transaction_type === L.Income, b = async () => {
183
- await d(t.guid), n();
184
- }, U = () => {
185
- C(!0), s(O.RECURRING_TRANSACTIONS_DETAILS_CLICK_DELETE);
186
- };
187
- return /* @__PURE__ */ c(p, { bgcolor: "background.default", direction: "column", height: "100%", children: [
188
- /* @__PURE__ */ c(p, { direction: "column", m: 24, children: [
189
- /* @__PURE__ */ e(
190
- $,
191
- {
192
- categoryGuid: y?.category_guid || "",
193
- merchantGuid: g,
194
- size: 64,
195
- sx: { mb: 12 }
196
- }
197
- ),
198
- /* @__PURE__ */ e(S, { bold: !0, variant: "body1", children: h }),
199
- /* @__PURE__ */ c(G, { color: D ? "success.main" : "text.primary", sx: { my: 4 }, variant: "h1", children: [
200
- D ? "+" : "",
201
- H(m, "0,0.00")
202
- ] }),
203
- /* @__PURE__ */ e(S, { color: "text.secondary", variant: "body2", children: `${o.next_payment_date}: ${Ee(
204
- Z(
205
- t.recurrence_type,
206
- pe(t.predicted_occurs_on),
207
- t.recurrence_day
208
- ),
209
- Le.MONTH_DAY_YEAR
210
- )}` })
211
- ] }),
212
- /* @__PURE__ */ c(Q, { sx: { bgcolor: "background.paper" }, children: [
213
- t.account && /* @__PURE__ */ c(k, { children: [
214
- /* @__PURE__ */ e(
215
- z,
216
- {
217
- iconName: "checkbook",
218
- label: o.account,
219
- value: t.account.displayName || ""
220
- }
221
- ),
222
- /* @__PURE__ */ e(T, { variant: "inset" })
223
- ] }),
224
- y?.category && /* @__PURE__ */ c(k, { children: [
225
- /* @__PURE__ */ e(
226
- z,
227
- {
228
- iconName: "monetization_on",
229
- label: o.category,
230
- value: y.category
231
- }
232
- ),
233
- /* @__PURE__ */ e(T, { variant: "inset" })
234
- ] }),
235
- /* @__PURE__ */ e(Fe, { repeatingTransaction: t }),
236
- /* @__PURE__ */ e(T, {})
237
- ] }),
238
- /* @__PURE__ */ e(
239
- V,
240
- {
241
- color: "error",
242
- onClick: U,
243
- startIcon: /* @__PURE__ */ e(ye, {}),
244
- sx: { mx: 24, my: 16 },
245
- variant: "text",
246
- children: D ? o.delete_income_title : o.delete_expense_title
247
- }
248
- ),
249
- /* @__PURE__ */ e(S, { bold: !0, sx: { ml: 24, mt: 16 }, variant: "body1", children: o.paid_transactions }),
250
- /* @__PURE__ */ e(ee, { height: "30dvh", onClick: A }),
251
- /* @__PURE__ */ e(
252
- N,
253
- {
254
- ariaLabelClose: o.close_drawer_aria,
255
- isOpen: !!f && !!y,
256
- onClose: () => A(""),
257
- title: o.transaction_details_drawer_title,
258
- children: y && /* @__PURE__ */ e(xe, { transaction: y })
259
- }
260
- ),
261
- /* @__PURE__ */ e(
262
- Oe,
263
- {
264
- copy: {
265
- title: D ? o.delete_income_title : o.delete_expense_title,
266
- close_aria: o.close_drawer_aria
267
- },
268
- isOpen: v,
269
- onClose: () => C(!1),
270
- onPrimaryAction: b,
271
- children: /* @__PURE__ */ e(S, { children: D ? o.delete_income_description : o.delete_expense_description })
272
- }
273
- )
274
- ] });
275
- }
276
- ), Ye = I(
277
- ({ onClick: n = () => {
278
- }, repeatingTransaction: t }) => {
279
- const { recurring: o } = w(), [i, s] = _.useState(!1), d = _.useMemo(
280
- () => t.transactions.length === 0 ? "" : t.transactions[0].category_guid || "",
281
- [t]
282
- ), r = t.account?.displayName || "", a = t.repeating_transaction_type === L.Income, m = X(o, t, !0);
283
- return /* @__PURE__ */ c(ce, { disableGutters: !0, disablePadding: !0, children: [
284
- /* @__PURE__ */ c(le, { onClick: () => {
285
- n(t), s(!0);
286
- }, children: [
287
- /* @__PURE__ */ e(de, { children: /* @__PURE__ */ e(
288
- $,
289
- {
290
- categoryGuid: d,
291
- merchantGuid: t.merchant_guid
292
- }
293
- ) }),
294
- /* @__PURE__ */ e(_e, { children: /* @__PURE__ */ c(p, { direction: "row", gap: 4, sx: { justifyContent: "space-between" }, children: [
295
- /* @__PURE__ */ c(p, { direction: "column", sx: { width: "50%" }, children: [
296
- /* @__PURE__ */ e(S, { bold: !0, variant: "body1", children: t.description }),
297
- /* @__PURE__ */ c(p, { alignItems: "center", direction: "row", gap: 6, children: [
298
- t.account?.institution_guid && /* @__PURE__ */ e(
299
- se,
300
- {
301
- alt: r,
302
- institutionGuid: t.account?.institution_guid,
303
- size: 12
304
- }
305
- ),
306
- /* @__PURE__ */ e(S, { variant: "caption", children: r })
307
- ] })
308
- ] }),
309
- /* @__PURE__ */ c(p, { alignItems: "flex-end", sx: { width: "50%" }, children: [
310
- /* @__PURE__ */ c(
311
- S,
312
- {
313
- bold: !0,
314
- color: a ? "success.main" : "text.primary",
315
- variant: "body1",
316
- children: [
317
- a ? "+" : "",
318
- H(t.amount, "0,0.00")
319
- ]
320
- }
321
- ),
322
- /* @__PURE__ */ e(
323
- p,
324
- {
325
- direction: "row",
326
- sx: {
327
- alignItems: "center",
328
- gap: 6,
329
- justifyContent: "flex-end",
330
- textTransform: "uppercase",
331
- width: "100%"
332
- },
333
- children: /* @__PURE__ */ e(S, { bold: !0, color: "text.secondary", variant: "caption", children: m })
334
- }
335
- )
336
- ] })
337
- ] }) })
338
- ] }),
339
- /* @__PURE__ */ e(
340
- N,
341
- {
342
- ariaLabelClose: o.close_drawer_aria,
343
- isOpen: i,
344
- onClose: () => s(!1),
345
- title: t.repeating_transaction_type === L.Income ? o.income_details : o.expense_details,
346
- children: /* @__PURE__ */ e(
347
- Ge,
348
- {
349
- onDeleted: () => s(!1),
350
- recurringTransaction: t
351
- }
352
- )
353
- }
354
- )
355
- ] });
356
- }
357
- ), Pe = I(
358
- ({
359
- bgcolor: n = "background.default",
360
- description: t,
361
- onSearch: o,
362
- onSelected: i
363
- }) => {
364
- const { recurring: s } = w(), { searchValue: d, setSearchValue: r } = ge();
365
- return /* @__PURE__ */ c(p, { sx: { bgcolor: n, gap: 16, pt: 8 }, children: [
366
- t && /* @__PURE__ */ e(G, { sx: { mx: 24 }, children: t }),
367
- /* @__PURE__ */ e(
368
- Ne,
369
- {
370
- ariaLabel: s.select_transaction_search_aria,
371
- cancelAriaLabel: s.select_transaction_search_cancel_aria,
372
- onChange: (a) => {
373
- r(a), o(a);
374
- },
375
- placeholder: s.select_transaction_search_placeholder,
376
- searchValue: d
377
- }
378
- ),
379
- /* @__PURE__ */ e(
380
- ee,
381
- {
382
- bgcolor: n,
383
- filter: (a) => !!a.merchant_guid,
384
- height: "auto",
385
- onClick: i,
386
- showLoader: !1
387
- }
388
- )
389
- ] });
390
- }
391
- ), Ue = I(
392
- ({
393
- bgcolor: n = "background.default",
394
- firstDay: t,
395
- secondDay: o,
396
- frequency: i,
397
- onFrequencyChange: s,
398
- onFirstDayChange: d,
399
- onSecondDayChange: r,
400
- transaction: a
401
- }) => {
402
- const { recurring: m } = w();
403
- return /* @__PURE__ */ c(p, { bgcolor: n, gap: 24, height: "100%", children: [
404
- /* @__PURE__ */ c(p, { children: [
405
- /* @__PURE__ */ e(Ce, { bgcolor: n, children: Me(a.date) }),
406
- /* @__PURE__ */ e(be, { transaction: a })
407
- ] }),
408
- /* @__PURE__ */ c(F, { children: [
409
- /* @__PURE__ */ e(S, { bold: !0, sx: { mx: 24 }, variant: "body1", children: m.payment_schedule }),
410
- /* @__PURE__ */ e(
411
- re,
412
- {
413
- firstDay: t,
414
- frequency: i,
415
- onFirstDayChange: d,
416
- onFrequencyChange: s,
417
- onSecondDayChange: r,
418
- secondDay: o
419
- }
420
- )
421
- ] })
422
- ] });
423
- }
424
- ), B = (n) => n.top_level_category_guid !== q.INCOME && n.transaction_type === ne.DEBIT, ze = (n, t) => B(n) ? n.payee?.toLowerCase().includes(t.toLowerCase()) || n.description.toLowerCase().includes(t.toLowerCase()) || n.feed_description.toLowerCase().includes(t.toLowerCase()) : !1, W = (n) => n.top_level_category_guid === q.INCOME || n.top_level_category_guid === q.TRANSFER && n.transaction_type === ne.CREDIT, qe = (n, t) => W(n) ? n.payee?.toLowerCase().includes(t.toLowerCase()) || n.description?.toLowerCase().includes(t.toLowerCase()) || n.feed_description?.toLowerCase().includes(t.toLowerCase()) : !1, oe = I(
425
- ({
426
- isIncome: n = !1,
427
- label: t,
428
- onAddRecurringTransaction: o = () => null
429
- }) => {
430
- const { recurring: i } = w(), { filter: s, setFilter: d, transactions: r } = te(), { addRepeatingTransaction: a } = Y(), { user: m } = Re(), [h, g] = _.useState(!1), [v, C] = _.useState(""), [f, A] = _.useState(l.EveryMonth), [y, D] = _.useState(1), [b, U] = _.useState(15), u = _.useMemo(
431
- () => r.find((x) => x.guid === v),
432
- [v, r]
433
- ), ae = () => {
434
- g(!0), d(n ? { ...s, custom: W } : { ...s, custom: B });
435
- }, ie = async () => {
436
- if (!u) {
437
- K();
438
- return;
439
- }
440
- o();
441
- const x = Z(f, ke(u.date), y), R = {
442
- account_guid: u.account_guid,
443
- amount: u.amount,
444
- created_by: 0,
445
- // User
446
- merchant_guid: u.merchant_guid,
447
- description: u.payee || u.description || u.feed_description,
448
- predicted_occurs_on: Te(x, { representation: "date" }),
449
- recurrence_day: y,
450
- recurrence_type: f,
451
- repeating_transaction_type: n ? L.Income : L.Bill,
452
- second_recurrence_day: b,
453
- transaction_type: u.transaction_type,
454
- user_guid: m.guid
455
- };
456
- await a(R, u), K();
457
- }, K = () => {
458
- C(""), g(!1);
459
- };
460
- return /* @__PURE__ */ c(k, { children: [
461
- /* @__PURE__ */ e(V, { onClick: ae, startIcon: /* @__PURE__ */ e(he, { size: 24 }), variant: "contained", children: t }),
462
- /* @__PURE__ */ e(
463
- N,
464
- {
465
- ariaLabelClose: i.close_drawer_aria,
466
- isOpen: h,
467
- onClose: () => g(!1),
468
- title: t,
469
- children: /* @__PURE__ */ e(
470
- Pe,
471
- {
472
- description: n ? i.add_income_description : i.add_expense_description,
473
- onSearch: (x) => {
474
- d({
475
- ...s,
476
- custom: (R) => n ? x ? qe(R, x) : W(R) : x ? ze(R, x) : B(R)
477
- });
478
- },
479
- onSelected: (x) => C(x)
480
- }
481
- )
482
- }
483
- ),
484
- /* @__PURE__ */ e(
485
- N,
486
- {
487
- ariaLabelClose: i.close_drawer_aria,
488
- isOpen: !!v,
489
- onClose: () => C(""),
490
- onPrimaryAction: ie,
491
- title: n ? i.income_details : i.expense_details,
492
- children: u && /* @__PURE__ */ e(
493
- Ue,
494
- {
495
- firstDay: y,
496
- frequency: f,
497
- onFirstDayChange: D,
498
- onFrequencyChange: A,
499
- onSecondDayChange: U,
500
- secondDay: b,
501
- transaction: u
502
- }
503
- )
504
- }
505
- )
506
- ] });
507
- }
508
- ), Be = I(
509
- ({ zeroStateFor: n }) => {
510
- const { recurring: t } = w(), { onEvent: o } = P(), i = n === "income", s = i ? t.recurring_setting_zero_state_income_title : t.recurring_setting_zero_state_expenses_title, d = i ? t.recurring_setting_zero_state_income_description : t.recurring_setting_zero_state_expenses_description, r = i ? t.add_income : t.add_expense;
511
- return /* @__PURE__ */ c(p, { sx: { alignItems: "center", p: 24, pt: 48 }, children: [
512
- /* @__PURE__ */ e(fe, { size: 48 }),
513
- /* @__PURE__ */ e(G, { sx: { my: 8, fontWeight: 600 }, variant: "body1", children: s }),
514
- /* @__PURE__ */ e(G, { color: "text.secondary", sx: { mb: 32 }, variant: "subtitle2", children: d }),
515
- /* @__PURE__ */ e(
516
- oe,
517
- {
518
- isIncome: i,
519
- label: r,
520
- onAddRecurringTransaction: () => {
521
- o(
522
- i ? O.RECURRING_TRANSACTIONS_CLICK_ADD_INCOME : O.RECURRING_ACTIVITY_CLICK_ADD_EXPENSE
523
- );
524
- }
525
- }
526
- )
527
- ] });
528
- }
529
- ), Lt = I(({ forOverview: n = !1 }) => {
530
- const { recurring: t } = w(), { detailedRepeatingTransactions: o } = Y(), { onEvent: i } = P(), s = (a) => {
531
- i(O.RECURRING_TRANSACTIONS_CLICK_INCOME, {
532
- repeating_transaction_guid: a.guid
533
- });
534
- }, d = () => {
535
- i(O.RECURRING_TRANSACTIONS_CLICK_ADD_INCOME);
536
- }, r = o.filter(
537
- (a) => a.repeating_transaction_type === L.Income && (a.transactions.length > 0 || a.recurrence_type === l.EveryYear)
538
- );
539
- return /* @__PURE__ */ e(k, { children: r.length !== 0 ? /* @__PURE__ */ c(
540
- p,
541
- {
542
- sx: {
543
- height: n ? "calc(100vh - 62px)" : "calc(100vh - 109px)",
544
- maxHeight: n ? "calc(100vh - 62px)" : "calc(100vh - 109px)"
545
- },
546
- children: [
547
- n && /* @__PURE__ */ e(S, { bold: !0, sx: { mb: 4, mt: 12, mx: 24 }, variant: "body2", children: t.income }),
548
- /* @__PURE__ */ e(F, { sx: { flex: 1, overflow: "auto" }, children: /* @__PURE__ */ e(Q, { sx: { bgcolor: "background.paper" }, children: r.map((a, m) => /* @__PURE__ */ c(_.Fragment, { children: [
549
- /* @__PURE__ */ e(Ye, { onClick: s, repeatingTransaction: a }),
550
- /* @__PURE__ */ e(
551
- T,
552
- {
553
- variant: m < r.length - 1 ? "inset" : "fullWidth"
554
- }
555
- )
556
- ] }, a.guid)) }) }),
557
- /* @__PURE__ */ c(F, { children: [
558
- /* @__PURE__ */ e(T, {}),
559
- /* @__PURE__ */ e(
560
- F,
561
- {
562
- sx: {
563
- alignContent: "center",
564
- bgcolor: "background.paper",
565
- justifyContent: "flex-end",
566
- px: 24,
567
- py: 12,
568
- textAlign: "right"
569
- },
570
- children: /* @__PURE__ */ e(
571
- oe,
572
- {
573
- isIncome: !0,
574
- label: t.add_income,
575
- onAddRecurringTransaction: d
576
- }
577
- )
578
- }
579
- )
580
- ] })
581
- ]
582
- }
583
- ) : /* @__PURE__ */ e(Be, { zeroStateFor: "income" }) });
584
- });
585
- export {
586
- oe as A,
587
- Lt as M,
588
- Ye as R,
589
- Pe as S,
590
- Be as a,
591
- W as b,
592
- Ue as c,
593
- Ge as d,
594
- qe as i
595
- };
@@ -1,45 +0,0 @@
1
- import { jsx as r, jsxs as p, Fragment as f } from "react/jsx-runtime";
2
- import x from "@mui/material/Button";
3
- import C from "@mui/material/Card";
4
- import b from "@mui/material/CardContent";
5
- import g from "@mui/material/CardHeader";
6
- import { H3 as u, P as v } from "@mxenabled/mxui";
7
- import { ChevronRight as W } from "@mxenabled/mx-icons";
8
- import { u as w } from "./useDimensions-CeDR9V8N.mjs";
9
- import { W as H } from "./hooks-BaO_gOI6.mjs";
10
- const D = ({
11
- children: i,
12
- className: o,
13
- ctaLabel: n,
14
- onCTAClick: a,
15
- subHeader: t,
16
- sx: s,
17
- title: d,
18
- variant: c = "borderless"
19
- }) => {
20
- const [m, { height: l, width: h }] = w(), e = /* @__PURE__ */ p(f, { children: [
21
- /* @__PURE__ */ r(
22
- g,
23
- {
24
- action: /* @__PURE__ */ r(
25
- x,
26
- {
27
- endIcon: /* @__PURE__ */ r(W, { size: 20 }),
28
- onClick: a,
29
- size: "small",
30
- variant: "text",
31
- children: n
32
- }
33
- ),
34
- subheader: t && /* @__PURE__ */ r(v, { sx: { color: "text.secondary" }, variant: "body2", children: t }),
35
- sx: { p: 0, pb: 8, width: "calc(100% - 8px)", "& .MuiCardHeader-action": { mt: 0 } },
36
- title: /* @__PURE__ */ r(u, { sx: { width: "calc(100% - 10px)" }, children: d })
37
- }
38
- ),
39
- /* @__PURE__ */ r(b, { ref: m, sx: { p: 0, ":last-child": { pb: 0 } }, children: /* @__PURE__ */ r(H, { availableHeight: l, availableWidth: h, children: i }) })
40
- ] });
41
- return c === "borderless" ? e : /* @__PURE__ */ r(C, { className: o, sx: { alignItems: "center", p: 16, ...s }, children: e });
42
- };
43
- export {
44
- D as M
45
- };