@mx-cartographer/experiences 7.0.3 → 7.0.4

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.
@@ -22,7 +22,7 @@ import { T as ot } from "../TransactionStore-DSyXtPek.mjs";
22
22
  import { S as Vs } from "../TransactionStore-DSyXtPek.mjs";
23
23
  import { T as Js } from "../TabContentContainer-j01JYR_7.mjs";
24
24
  import { I as ea } from "../IconBacking-B9oC6uL2.mjs";
25
- import { D as aa, F as ra, a as oa, c as na, R as ia, S as ca } from "../RepeatingTransaction-BPWfaB3f.mjs";
25
+ import { D as aa, F as ra, a as oa, c as na, R as ia, S as ca } from "../RepeatingTransaction-BW4J-jeJ.mjs";
26
26
  import { C as nt } from "../CashflowStore-D9Dpuz7X.mjs";
27
27
  import { I as la } from "../CashflowStore-D9Dpuz7X.mjs";
28
28
  import { b as it } from "../GoalStore-Drf76ell.mjs";
@@ -48,8 +48,8 @@ import { I as ja, P as Va, S as Za } from "../Account-BFol-JYA.mjs";
48
48
  import { b as E } from "../Category-CevNQ03n.mjs";
49
49
  import { C as tr, c as er, a as sr, P as ar } from "../Category-CevNQ03n.mjs";
50
50
  import { C as or, f as nr, b as ir, a as cr, g as dr, i as lr } from "../NumberFormatting-CtWHhyBX.mjs";
51
- import { R as mt } from "../RecurringTransactionsStore-BKLD3OWo.mjs";
52
- import { S as hr, T as gr } from "../RecurringTransactionsStore-BKLD3OWo.mjs";
51
+ import { R as mt } from "../RecurringTransactionsStore-D62XJtdL.mjs";
52
+ import { S as hr, T as gr } from "../RecurringTransactionsStore-D62XJtdL.mjs";
53
53
  import { G as mr, A as _r, B as yr, W as fr, c as Sr, k as br, g as wr, t as xr, l as Cr, x as Dr, e as vr, w as Ar, u as Er, m as Tr, a as Br, j as Ir, y as Nr, s as Fr, b as Mr, q as $r, n as Rr, z as Ur, h as kr, r as Lr, f as Or, v as Gr, o as Hr, p as Pr } from "../hooks-02T565vf.mjs";
54
54
  import { u as Wr } from "../useScreenSize-B6JyS_Lj.mjs";
55
55
  import { makeAutoObservable as m, runInAction as p, reaction as _t } from "mobx";
@@ -30,7 +30,7 @@ import Ue from "@mui/material/AccordionSummary";
30
30
  import Ve from "@mui/material/CardHeader";
31
31
  import { u as Ye } from "../useDimensions-27p2evRx.mjs";
32
32
  import { C as qe } from "../ConnectionsDrawer-Czp-E0-m.mjs";
33
- import { R as Je } from "../RecurringSettings-Dqn4pjZ0.mjs";
33
+ import { R as Je } from "../RecurringSettings-BkzYDzmO.mjs";
34
34
  import Qe from "@mui/material/TextField";
35
35
  import { u as xe } from "../useScreenSize-B6JyS_Lj.mjs";
36
36
  import { a as Ze } from "../Dialog-CWW597AF.mjs";
@@ -8,8 +8,8 @@ import { startOfToday as le } from "date-fns/startOfToday";
8
8
  import { subDays as de } from "date-fns/subDays";
9
9
  import re from "@mui/material/Skeleton";
10
10
  import c from "@mui/material/Stack";
11
- import { R as He } from "../RecurringSettings-Dqn4pjZ0.mjs";
12
- import { M as An } from "../RecurringSettings-Dqn4pjZ0.mjs";
11
+ import { R as He } from "../RecurringSettings-BkzYDzmO.mjs";
12
+ import { M as An } from "../RecurringSettings-BkzYDzmO.mjs";
13
13
  import { addMonths as ze } from "date-fns/addMonths";
14
14
  import { subMonths as Be } from "date-fns/subMonths";
15
15
  import { isBefore as Ue } from "date-fns/isBefore";
@@ -29,9 +29,9 @@ import nt from "@mui/material/Badge";
29
29
  import { PickersDay as it } from "@mui/x-date-pickers/PickersDay";
30
30
  import { I as Y } from "../IconBacking-B9oC6uL2.mjs";
31
31
  import { u as D, a as V, h as v, e as X, c as pe, f as ge, p as rt } from "../hooks-02T565vf.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";
32
+ import { c as M, a as R, g as De, f as ot } from "../RepeatingTransaction-BW4J-jeJ.mjs";
33
+ import { T as P } from "../RecurringTransactionsStore-D62XJtdL.mjs";
34
+ import { R as Gn } from "../RecurringTransactionsStore-D62XJtdL.mjs";
35
35
  import { A as _, W as at } from "../WidgetContainer-BG-fdDOf.mjs";
36
36
  import st from "@mui/material/Button";
37
37
  import se from "@mui/material/Divider";
@@ -41,8 +41,8 @@ import ct from "@mui/material/ListSubheader";
41
41
  import lt from "@mui/material/ListItemAvatar";
42
42
  import dt from "@mui/material/ListItemButton";
43
43
  import ut from "@mui/material/ListItemText";
44
- import { b as mt } from "../ManageIncome-BtKRPjvO.mjs";
45
- import { c as On, M as kn, S as Wn } from "../ManageIncome-BtKRPjvO.mjs";
44
+ import { b as mt } from "../ManageIncome-DG7a42eZ.mjs";
45
+ import { c as On, M as kn, S as Wn } from "../ManageIncome-DG7a42eZ.mjs";
46
46
  import { f as L } from "../NumberFormatting-CtWHhyBX.mjs";
47
47
  import { D as Ae } from "../Drawer-kEE73B87.mjs";
48
48
  import { b as N } from "../Localization-2MODESHW.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "7.0.3",
3
+ "version": "7.0.4",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",
@@ -1,282 +0,0 @@
1
- import { jsxs as O, Fragment as Y, jsx as d } from "react/jsx-runtime";
2
- import B from "@mui/material/Avatar";
3
- import M from "@mui/material/ListItem";
4
- import P from "@mui/material/ListItemAvatar";
5
- import L from "@mui/material/ListItemButton";
6
- import U from "@mui/material/ListItemText";
7
- import { Icon as w, IconWeight as G } from "@mxenabled/mxui";
8
- import S from "@mui/material/ListItemIcon";
9
- import C from "@mui/material/MenuItem";
10
- import $ from "@mui/material/TextField";
11
- import { ExpandMore as j } from "@mxenabled/mx-icons";
12
- import { addDays as W } from "date-fns/addDays";
13
- import { addMonths as z } from "date-fns/addMonths";
14
- import { addQuarters as Q } from "date-fns/addQuarters";
15
- import { addYears as K } from "date-fns/addYears";
16
- import { formatISO as H } from "date-fns/formatISO";
17
- import { fromUnixTime as V } from "date-fns/fromUnixTime";
18
- import { getUnixTime as y } from "date-fns/getUnixTime";
19
- import { isAfter as l } from "date-fns/isAfter";
20
- import { isBefore as u } from "date-fns/isBefore";
21
- import { isSameDay as X } from "date-fns/isSameDay";
22
- import { nextDay as k } from "date-fns/nextDay";
23
- import { parseISO as J } from "date-fns/parseISO";
24
- import { setDate as E } from "date-fns/setDate";
25
- import { startOfToday as g } from "date-fns/startOfToday";
26
- import { subDays as p } from "date-fns/subDays";
27
- import { subMonths as Z } from "date-fns/subMonths";
28
- import { subQuarters as A } from "date-fns/subQuarters";
29
- import { subYears as T } from "date-fns/subYears";
30
- import { lastDayOfMonth as q } from "date-fns/lastDayOfMonth";
31
- import { setDayOfYear as F } from "date-fns/setDayOfYear";
32
- import { g as R, a as ee, b as te, c as re, d as oe, e as ae, f as ne } from "./DateUtil-BcuH7ErC.mjs";
33
- import { b as I } from "./NumberFormatting-CtWHhyBX.mjs";
34
- import { f as x, D as v } from "./Dialog-CWW597AF.mjs";
35
- import { b as h } from "./Localization-2MODESHW.mjs";
36
- const se = ({ iconName: e, label: o, onClick: t, value: n }) => {
37
- const a = /* @__PURE__ */ O(Y, { children: [
38
- /* @__PURE__ */ d(P, { children: /* @__PURE__ */ d(B, { sx: { bgcolor: "border.light" }, variant: "rounded", children: /* @__PURE__ */ d(w, { name: e, sx: { color: "text.primary" }, weight: G.Dark }) }) }),
39
- /* @__PURE__ */ d(
40
- U,
41
- {
42
- primary: o,
43
- primaryTypographyProps: { variant: "XSmall" },
44
- secondary: n,
45
- secondaryTypographyProps: { color: "text.default", variant: "Body", fontWeight: 600 }
46
- }
47
- )
48
- ] });
49
- return t ? /* @__PURE__ */ d(M, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ O(L, { onClick: t, children: [
50
- a,
51
- /* @__PURE__ */ d(S, { children: /* @__PURE__ */ d(w, { name: "chevron_right", size: 24 }) })
52
- ] }) }) : /* @__PURE__ */ d(M, { disableGutters: !1, disablePadding: !1, children: a });
53
- }, Fe = se, Re = ({ label: e, onChange: o, options: t, value: n }) => /* @__PURE__ */ d(
54
- $,
55
- {
56
- InputLabelProps: { shrink: !0 },
57
- SelectProps: {
58
- IconComponent: (r) => /* @__PURE__ */ d(j, { size: 20, sx: { mr: 4 }, ...r })
59
- },
60
- defaultValue: 0,
61
- label: e,
62
- onChange: (r) => {
63
- o(Number(r.target.value));
64
- },
65
- select: !0,
66
- value: n,
67
- variant: "outlined",
68
- children: t.map((r) => /* @__PURE__ */ d(C, { value: r.id, children: r.label }, r.id))
69
- }
70
- ), ce = (e) => {
71
- if (!e) return "";
72
- let o = e.user_name || e.feed_name || "";
73
- return e.account_number && (o = `${o} *${e.account_number}`), o;
74
- }, ie = (e, o) => {
75
- const t = [], n = e.transactions.find(
76
- (m) => m.repeating_transaction_guid === e.guid
77
- );
78
- if (!n) return [];
79
- const a = J(e.predicted_occurs_on), r = {
80
- accountGuid: e.account?.guid || "",
81
- amount: e.amount,
82
- categoryGuid: n.category_guid || "",
83
- expectedDate: a,
84
- frequency: e.recurrence_type,
85
- institutionGuid: e.account?.institution_guid || "",
86
- institutionName: ce(e.account),
87
- merchantGuid: e.merchant_guid,
88
- name: e.description,
89
- recurrenceDay: e.recurrence_day,
90
- repeatingTransactionGuid: e.guid,
91
- secondRecurrenceDay: e.second_recurrence_day,
92
- status: f.Upcoming,
93
- type: e.repeating_transaction_type === N.Income ? b.Income : b.Expense,
94
- transaction: void 0
95
- }, i = o.start, c = o.end;
96
- switch (e.recurrence_type) {
97
- case s.EveryWeek:
98
- t.push(...ue(r, i, c));
99
- break;
100
- case s.EveryOtherWeek:
101
- t.push(...de(r, i, c));
102
- break;
103
- case s.TwiceAMonth:
104
- t.push(...me(r, i));
105
- break;
106
- case s.EveryMonth:
107
- t.push(...he(r, i));
108
- break;
109
- case s.EveryOtherMonth:
110
- t.push(...le(r, i, c));
111
- break;
112
- case s.EveryQuarter:
113
- t.push(...fe(r, i, c));
114
- break;
115
- case s.EveryOtherQuarter:
116
- t.push(...ye(r, i, c));
117
- break;
118
- case s.EveryYear:
119
- t.push(...pe(r, i, c));
120
- break;
121
- }
122
- for (const m of t) {
123
- const D = e.transactions.find(
124
- (_) => _.repeating_transaction_guid === e.guid && _.date > y(p(m.expectedDate, 5)) && _.date < y(W(m.expectedDate, 5))
125
- );
126
- D ? (m.transaction = D, m.status = f.Paid, m.occurredOnDate = V(D.date)) : u(m.expectedDate, p(g(), 3)) && (m.status = f.Missed);
127
- }
128
- return t;
129
- }, ue = (e, o, t) => {
130
- const n = [];
131
- let a = k(o, e.recurrenceDay);
132
- for (; u(a, t); )
133
- n.push({ ...e, expectedDate: a }), a = k(a, e.recurrenceDay);
134
- return n;
135
- }, de = (e, o, t) => {
136
- const n = [], a = e.expectedDate;
137
- if (u(a, t)) {
138
- let r = p(a, 14);
139
- for (; l(r, o) || X(r, o); )
140
- n.push({ ...e, expectedDate: r }), r = p(r, 14);
141
- for (r = a; l(r, o) && u(r, t); )
142
- n.push({ ...e, expectedDate: r }), r = W(r, 14);
143
- }
144
- return n;
145
- }, me = (e, o) => {
146
- const t = [], n = E(o, e.recurrenceDay), a = e.secondRecurrenceDay && e.secondRecurrenceDay < 28 ? E(o, e.secondRecurrenceDay) : q(o);
147
- return t.push({ ...e, expectedDate: n }), t.push({ ...e, expectedDate: a }), t;
148
- }, he = (e, o) => {
149
- const t = [], n = E(o, e.recurrenceDay);
150
- return t.push({ ...e, expectedDate: n }), t;
151
- }, le = (e, o, t) => {
152
- const n = [], a = e.expectedDate;
153
- let r = u(a, t) ? a : Z(a, 2);
154
- for (; u(r, t); )
155
- l(r, o) && n.push({ ...e, expectedDate: r }), r = z(r, 2);
156
- return n;
157
- }, fe = (e, o, t) => {
158
- const n = [], a = e.expectedDate;
159
- let r = u(a, t) ? a : A(a, 1);
160
- for (; u(r, t); )
161
- l(r, o) && n.push({ ...e, expectedDate: r }), r = Q(r, 1);
162
- return n;
163
- }, ye = (e, o, t) => {
164
- const n = [], a = e.expectedDate;
165
- let r = u(a, t) ? a : A(a, 2);
166
- for (; u(r, t); )
167
- l(r, o) && n.push({ ...e, expectedDate: r }), r = Q(r, 2);
168
- return n;
169
- }, pe = (e, o, t) => {
170
- const n = [], a = e.expectedDate;
171
- let r = u(a, t) ? a : T(a, 1);
172
- for (; u(r, t); )
173
- l(r, o) && n.push({ ...e, expectedDate: r }), r = K(r, 1);
174
- return n;
175
- }, et = (e, o) => {
176
- const t = [];
177
- for (const n of e) {
178
- const a = ie(n, o);
179
- t.push(...a);
180
- }
181
- return t.sort(
182
- (n, a) => y(n.occurredOnDate || n.expectedDate) - y(a.occurredOnDate || a.expectedDate)
183
- );
184
- }, tt = (e, o, t) => {
185
- const n = [];
186
- for (const a of o) {
187
- const r = t.filter(
188
- (i) => i.repeating_transaction_guid === a.guid
189
- );
190
- t.length > 0 && n.push({
191
- ...a,
192
- account: e.find((i) => i.guid === a.account_guid),
193
- transactions: r
194
- });
195
- }
196
- return n;
197
- }, rt = (e) => e.reduce((o, t) => {
198
- const n = H(t.expectedDate, { representation: "date" }), a = o.find(
199
- (r) => r.date.toString() === t.expectedDate.toString()
200
- );
201
- return a ? a.recurrences.push(t) : o.push({
202
- date: t.expectedDate,
203
- id: `date-${n}`,
204
- recurrences: [t]
205
- }), o;
206
- }, []), ot = (e, o, t) => {
207
- const n = k(g(), o.recurrence_day), a = F(g(), o.recurrence_day), r = I(o.recurrence_day), i = o.second_recurrence_day ? I(o.second_recurrence_day) : "";
208
- let c = t ? h(e.monthly_ordinal, r) : e.monthly;
209
- switch (o.recurrence_type) {
210
- case s.EveryQuarter:
211
- c = t ? h(e.quarterly_ordinal, r) : e.quarterly;
212
- break;
213
- case s.EveryWeek:
214
- c = t ? h(
215
- e.weekly_ordinal,
216
- x(n, v.DAY_OF_WEEK)
217
- ) : e.weekly;
218
- break;
219
- case s.EveryYear:
220
- c = t ? h(
221
- e.anually_ordinal,
222
- x(a, v.MONTH_DAY)
223
- ) : e.anually;
224
- break;
225
- case s.EveryOtherWeek:
226
- c = t ? h(
227
- e.every_other_week_ordinal,
228
- x(n, v.DAY_OF_WEEK)
229
- ) : e.every_other_week;
230
- break;
231
- case s.EveryOtherMonth:
232
- c = t ? h(e.every_other_month_ordinal, r) : e.every_other_month;
233
- break;
234
- case s.EveryOtherQuarter:
235
- c = t ? h(e.every_other_quarter_ordinal, r) : e.every_other_quarter;
236
- break;
237
- case s.TwiceAMonth:
238
- c = t ? h(e.twice_a_month_ordinal, r, i) : e.twice_a_month;
239
- break;
240
- }
241
- return c;
242
- }, at = (e, o) => {
243
- let t = o;
244
- switch (e) {
245
- case s.EveryWeek:
246
- t = ne(o);
247
- break;
248
- case s.EveryOtherWeek:
249
- t = ae(o);
250
- break;
251
- case s.EveryMonth:
252
- t = oe(o);
253
- break;
254
- case s.EveryOtherMonth:
255
- t = re(o);
256
- break;
257
- case s.EveryQuarter:
258
- t = te(o);
259
- break;
260
- case s.EveryOtherQuarter:
261
- t = ee(o);
262
- break;
263
- case s.EveryYear:
264
- t = R(o);
265
- break;
266
- }
267
- return t;
268
- };
269
- var s = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.EveryWeek = 1] = "EveryWeek", e[e.EveryOtherWeek = 2] = "EveryOtherWeek", e[e.EveryMonth = 3] = "EveryMonth", e[e.EveryOtherMonth = 4] = "EveryOtherMonth", e[e.EveryQuarter = 5] = "EveryQuarter", e[e.EveryOtherQuarter = 6] = "EveryOtherQuarter", e[e.EveryYear = 7] = "EveryYear", e[e.TwiceAMonth = 8] = "TwiceAMonth", e))(s || {}), f = /* @__PURE__ */ ((e) => (e[e.Paid = 0] = "Paid", e[e.Missed = 1] = "Missed", e[e.Upcoming = 2] = "Upcoming", e))(f || {}), b = /* @__PURE__ */ ((e) => (e[e.Expense = 0] = "Expense", e[e.Income = 1] = "Income", e))(b || {}), N = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.Subscription = 1] = "Subscription", e[e.Bill = 2] = "Bill", e[e.Income = 3] = "Income", e[e.Transfer = 4] = "Transfer", e))(N || {});
270
- export {
271
- Fe as D,
272
- s as F,
273
- N as R,
274
- Re as S,
275
- f as a,
276
- et as b,
277
- b as c,
278
- tt as d,
279
- at as e,
280
- rt as f,
281
- ot as g
282
- };