@mx-cartographer/experiences 6.26.1-alpha.mega1 → 6.26.1

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 (92) hide show
  1. package/CHANGELOG.md +9 -5
  2. package/dist/categories/util/CategoryUtil.d.ts +2 -3
  3. package/dist/common/context/hooks.d.ts +13 -13
  4. package/dist/common/types/Category.d.ts +8 -2
  5. package/dist/common/types/index.d.ts +1 -1
  6. package/dist/help/components/content/section/index.d.ts +15 -15
  7. package/dist/index.d.ts +22 -0
  8. package/dist/index.es.js +29896 -0
  9. package/dist/index.es.js.map +1 -0
  10. package/dist/trends/components/CategoriesList.d.ts +5 -5
  11. package/dist/trends/components/CategoriesListItem.d.ts +4 -7
  12. package/dist/trends/components/CategoryDetailChart.d.ts +1 -5
  13. package/dist/trends/stores/TrendsStore.d.ts +16 -11
  14. package/package.json +3 -91
  15. package/dist/AccountStore-DkL93tXL.mjs +0 -317
  16. package/dist/AccountStore-DkL93tXL.mjs.map +0 -1
  17. package/dist/BudgetUtil-CVqAdv-j.mjs +0 -187
  18. package/dist/BudgetUtil-CVqAdv-j.mjs.map +0 -1
  19. package/dist/CashflowStore-gPEEBiXo.mjs +0 -53
  20. package/dist/CashflowStore-gPEEBiXo.mjs.map +0 -1
  21. package/dist/CategoryStore-m7oieLzP.mjs +0 -260
  22. package/dist/CategoryStore-m7oieLzP.mjs.map +0 -1
  23. package/dist/ConnectMiniWidget-CQWafYtQ.mjs +0 -22966
  24. package/dist/ConnectMiniWidget-CQWafYtQ.mjs.map +0 -1
  25. package/dist/DebtsStore-cUhIgJx6.mjs +0 -145
  26. package/dist/DebtsStore-cUhIgJx6.mjs.map +0 -1
  27. package/dist/Donut-CGNFni9y.mjs +0 -58
  28. package/dist/Donut-CGNFni9y.mjs.map +0 -1
  29. package/dist/FinstrongStore-BDG7l0nI.mjs +0 -183
  30. package/dist/FinstrongStore-BDG7l0nI.mjs.map +0 -1
  31. package/dist/GoalStore-o2waGeyf.mjs +0 -293
  32. package/dist/GoalStore-o2waGeyf.mjs.map +0 -1
  33. package/dist/Loader-CwdK8lfx.mjs +0 -147
  34. package/dist/Loader-CwdK8lfx.mjs.map +0 -1
  35. package/dist/MerchantStore-Cck9IGIH.mjs +0 -125
  36. package/dist/MerchantStore-Cck9IGIH.mjs.map +0 -1
  37. package/dist/NetWorthStore-D5eUfGQt.mjs +0 -66
  38. package/dist/NetWorthStore-D5eUfGQt.mjs.map +0 -1
  39. package/dist/NotificationStore-DCxw8W7u.mjs +0 -141
  40. package/dist/NotificationStore-DCxw8W7u.mjs.map +0 -1
  41. package/dist/RecurringTransactionsStore-Bijrgllq.mjs +0 -337
  42. package/dist/RecurringTransactionsStore-Bijrgllq.mjs.map +0 -1
  43. package/dist/SettingsStore-BhOYgUOa.mjs +0 -352
  44. package/dist/SettingsStore-BhOYgUOa.mjs.map +0 -1
  45. package/dist/TransactionApi-Dnbyi1JL.mjs +0 -175
  46. package/dist/TransactionApi-Dnbyi1JL.mjs.map +0 -1
  47. package/dist/TransactionStore-CiEtt5XJ.mjs +0 -417
  48. package/dist/TransactionStore-CiEtt5XJ.mjs.map +0 -1
  49. package/dist/TrendsStore-Idq3QfoA.mjs +0 -131
  50. package/dist/TrendsStore-Idq3QfoA.mjs.map +0 -1
  51. package/dist/accounts/index.es.js +0 -18
  52. package/dist/accounts/index.es.js.map +0 -1
  53. package/dist/analytics/index.es.js +0 -170
  54. package/dist/analytics/index.es.js.map +0 -1
  55. package/dist/budgets/index.es.js +0 -1116
  56. package/dist/budgets/index.es.js.map +0 -1
  57. package/dist/cashflow/index.es.js +0 -118
  58. package/dist/cashflow/index.es.js.map +0 -1
  59. package/dist/categories/index.es.js +0 -10
  60. package/dist/categories/index.es.js.map +0 -1
  61. package/dist/common/index.es.js +0 -1549
  62. package/dist/common/index.es.js.map +0 -1
  63. package/dist/dashboard/index.es.js +0 -257
  64. package/dist/dashboard/index.es.js.map +0 -1
  65. package/dist/debts/index.es.js +0 -9
  66. package/dist/debts/index.es.js.map +0 -1
  67. package/dist/finstrong/index.es.js +0 -11
  68. package/dist/finstrong/index.es.js.map +0 -1
  69. package/dist/goals/index.es.js +0 -9
  70. package/dist/goals/index.es.js.map +0 -1
  71. package/dist/help/index.es.js +0 -6
  72. package/dist/help/index.es.js.map +0 -1
  73. package/dist/investments/index.es.js +0 -1694
  74. package/dist/investments/index.es.js.map +0 -1
  75. package/dist/merchants/index.es.js +0 -7
  76. package/dist/merchants/index.es.js.map +0 -1
  77. package/dist/microinsights/index.es.js +0 -21
  78. package/dist/microinsights/index.es.js.map +0 -1
  79. package/dist/networth/index.es.js +0 -11
  80. package/dist/networth/index.es.js.map +0 -1
  81. package/dist/notifications/index.es.js +0 -116
  82. package/dist/notifications/index.es.js.map +0 -1
  83. package/dist/recurringtransactions/index.es.js +0 -14
  84. package/dist/recurringtransactions/index.es.js.map +0 -1
  85. package/dist/settings/index.es.js +0 -112
  86. package/dist/settings/index.es.js.map +0 -1
  87. package/dist/spending/index.es.js +0 -632
  88. package/dist/spending/index.es.js.map +0 -1
  89. package/dist/transactions/index.es.js +0 -19
  90. package/dist/transactions/index.es.js.map +0 -1
  91. package/dist/trends/index.es.js +0 -10
  92. package/dist/trends/index.es.js.map +0 -1
@@ -1,1549 +0,0 @@
1
- import { ae as y, af as l, bj as at, bk as rt, bl as it, bm as M, b5 as L, aK as E, bn as ot, bc as nt, bo as ct, bp as dt, bq as lt } from "../ConnectMiniWidget-CQWafYtQ.mjs";
2
- import { b9 as Sa, a$ as wa, bZ as Ca, b_ as xa, aq as va, b$ as Da, aS as Aa, c0 as Ea, br as Ta, ar as Ba, bH as Ia, bI as Na, bQ as Fa, aY as Ma, bR as $a, bA as ka, b0 as Oa, aT as Ua, c1 as La, bT as Ra, bf as Ha, bB as Ga, aJ as Pa, by as qa, bL as Wa, bg as Qa, b8 as Ya, be as za, bs as Xa, aU as Ka, c9 as ja, c6 as Va, bN as Za, bx as Ja, bz as tr, a_ as er, bJ as sr, bC as ar, bD as rr, c7 as ir, aW as or, bt as nr, c2 as cr, c8 as dr, b3 as lr, bM as ur, bO as pr, bS as hr, aV as gr, c3 as _r, c4 as mr, aP as yr, aQ as br, ca as fr, bP as Sr, bu as wr, bE as Cr, bv as xr, bi as vr, bU as Dr, bK as Ar, bh as Er, c5 as Tr, bV as Br, bw as Ir, bF as Nr, bG as Fr, aN as Mr, b2 as $r, aw as kr, cb as Or, aL as Ur, cd as Lr, aM as Rr, aI as Hr, cf as Gr, ba as Pr, cc as qr, cg as Wr, ce as Qr, ch as Yr, bW as zr, bX as Xr, bY as Kr, av as jr } from "../ConnectMiniWidget-CQWafYtQ.mjs";
3
- import { C as ut } from "../CategoryStore-m7oieLzP.mjs";
4
- import { a as Zr } from "../CategoryStore-m7oieLzP.mjs";
5
- import { N as pt } from "../NotificationStore-DCxw8W7u.mjs";
6
- import { a as ti } from "../NotificationStore-DCxw8W7u.mjs";
7
- import "bowser";
8
- import "date-fns/getUnixTime";
9
- import "date-fns/intlFormat";
10
- import { addMonths as ht } from "date-fns/addMonths";
11
- import "date-fns/addQuarters";
12
- import "date-fns/addWeeks";
13
- import "date-fns/addYears";
14
- import "date-fns/getDay";
15
- import "date-fns/isBefore";
16
- import "date-fns/nextDay";
17
- import "date-fns/setDate";
18
- import { startOfToday as R } from "date-fns/startOfToday";
19
- import "date-fns/fromUnixTime";
20
- import J, { useRef as gt, useEffect as _t } from "react";
21
- import "numeral";
22
- import { alpha as mt, lighten as H, darken as G } from "@mui/material";
23
- import { jsxs as m, jsx as o } from "react/jsx-runtime";
24
- import yt from "@mui/material/Button";
25
- import { useTokens as w, Text as B } from "@mxenabled/mxui";
26
- import bt from "@mui/material/Tooltip";
27
- import "@mui/material/Box";
28
- import ft from "@mui/material/IconButton";
29
- import { G as si, z as ai, L as ri, M as ii, W as oi, A as ni, f as ci, g as di, u as li, m as ui, h as pi, n as hi, c as gi, o as _i, b as mi, e as yi, d as bi, p as fi, q as Si, j as wi, r as Ci, s as xi, t as vi, v as Di, l as Ai, w as Ei, i as Ti, x as Bi, y as Ii, k as Ni } from "../Loader-CwdK8lfx.mjs";
30
- import St from "@mui/material/styles/useTheme";
31
- import "@mui/material/useMediaQuery";
32
- import { css as C, keyframes as wt } from "@mxenabled/cssinjs";
33
- import "date-fns/addDays";
34
- import "date-fns/eachDayOfInterval";
35
- import "date-fns/eachWeekOfInterval";
36
- import { endOfMonth as tt } from "date-fns/endOfMonth";
37
- import "date-fns/format";
38
- import "date-fns/isSameMonth";
39
- import { startOfMonth as et } from "date-fns/startOfMonth";
40
- import "date-fns/subMonths";
41
- import "@mui/material/Paper";
42
- import "@mxenabled/mx-icons";
43
- import "date-fns/isSameDay";
44
- import "date-fns/isWithinInterval";
45
- import "d3";
46
- import "@mui/material/styles";
47
- import "@mui/x-charts";
48
- import "@mui/x-charts/ChartsTooltip";
49
- import "@mui/material/Stack";
50
- import "date-fns/differenceInCalendarDays";
51
- import "date-fns/endOfToday";
52
- import "date-fns/endOfYear";
53
- import "date-fns/startOfYear";
54
- import "date-fns/subDays";
55
- import "date-fns/subYears";
56
- import "@mui/material/ButtonGroup";
57
- import "@mui/material/Tab";
58
- import "@mui/material/Tabs";
59
- import "@mui/material/ToggleButton";
60
- import "@mui/material/ToggleButtonGroup";
61
- import "@mui/material/Dialog";
62
- import "@mui/material/DialogContent";
63
- import "@mui/material/Card";
64
- import "@mui/material/CardContent";
65
- import "@mui/material/CardHeader";
66
- import "uuid";
67
- import "@mui/material/CircularProgress";
68
- import "@mui/material/FormControlLabel";
69
- import "@mui/material/Radio";
70
- import "@mui/material/Avatar";
71
- import "@mui/material/ListItem";
72
- import "@mui/material/ListItemAvatar";
73
- import "@mui/material/ListItemButton";
74
- import "@mui/material/ListItemText";
75
- import "@mui/material/ListItemIcon";
76
- import "@mui/material/MenuItem";
77
- import "@mui/material/TextField";
78
- import "@mui/material/Switch";
79
- import { makeAutoObservable as _, runInAction as p, reaction as Ct } from "mobx";
80
- import xt from "posthog-js";
81
- import "date-fns/differenceInDays";
82
- import "@mui/x-data-grid-pro";
83
- import "date-fns";
84
- import "@mui/material/Divider";
85
- import "@mui/material/List";
86
- import "date-fns/formatISO";
87
- import "date-fns/isAfter";
88
- import "date-fns/parseISO";
89
- import "date-fns/subQuarters";
90
- import "date-fns/lastDayOfMonth";
91
- import "date-fns/setDayOfYear";
92
- import "date-fns/addSeconds";
93
- import "date-fns/differenceInCalendarMonths";
94
- import { getMonth as T } from "date-fns/getMonth";
95
- import { D as Mi } from "../Donut-CGNFni9y.mjs";
96
- import { f as vt, a as Dt, b as P } from "../BudgetUtil-CVqAdv-j.mjs";
97
- import { g as ki, e as Oi, c as Ui, d as Li, i as Ri } from "../BudgetUtil-CVqAdv-j.mjs";
98
- import { C as At } from "../CashflowStore-gPEEBiXo.mjs";
99
- import { D as Et } from "../DebtsStore-cUhIgJx6.mjs";
100
- import { a as Tt } from "../FinstrongStore-BDG7l0nI.mjs";
101
- import { a as Bt } from "../GoalStore-o2waGeyf.mjs";
102
- import { M as It } from "../MerchantStore-Cck9IGIH.mjs";
103
- import { N as Nt } from "../NetWorthStore-D5eUfGQt.mjs";
104
- import { a as Ft } from "../SettingsStore-BhOYgUOa.mjs";
105
- import { T as Mt } from "../TransactionStore-CiEtt5XJ.mjs";
106
- import { R as $t } from "../RecurringTransactionsStore-Bijrgllq.mjs";
107
- import { T as kt } from "../TrendsStore-Idq3QfoA.mjs";
108
- import { a as Ot } from "../AccountStore-DkL93tXL.mjs";
109
- var Ut = /* @__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))(Ut || {});
110
- const ca = [
111
- { id: 0, copy: "frequency_unknown" },
112
- { id: 1, copy: "frequency_every_week" },
113
- { id: 2, copy: "frequency_every_other_week" },
114
- { id: 3, copy: "frequency_every_month" },
115
- { id: 4, copy: "frequency_every_other_month" },
116
- { id: 5, copy: "frequency_every_quarter" },
117
- { id: 6, copy: "frequency_every_other_quarter" },
118
- { id: 7, copy: "frequency_every_year" }
119
- ], da = {
120
- ERROR: "ERROR",
121
- LOADING: "LOADING",
122
- SUCCESS: "SUCCESS"
123
- };
124
- var Lt = /* @__PURE__ */ ((e) => (e[e.SpendingPlan = 0] = "SpendingPlan", e[e.Budgets = 1] = "Budgets", e))(Lt || {}), Rt = /* @__PURE__ */ ((e) => (e[e.RecurringExpense = 0] = "RecurringExpense", e[e.PlannedExpense = 1] = "PlannedExpense", e[e.Other = 2] = "Other", e[e.Income = 3] = "Income", e))(Rt || {});
125
- const la = (e, t) => {
126
- const s = e.palette.mode === "dark", a = (c, d) => {
127
- const n = t?.[c];
128
- return {
129
- lighter: n ? H(n, 0.5) : d.lighter,
130
- light: n ? H(n, 0.25) : d.light,
131
- main: n || d.main,
132
- dark: n ? G(n, 0.25) : d.dark,
133
- darker: n ? G(n, 0.5) : d.darker
134
- };
135
- }, r = {
136
- primary: a(s ? "primary_color_dark" : "primary_color", e.palette.primary),
137
- secondary: a(s ? "neutral_color_dark" : "neutral_color", e.palette.secondary),
138
- error: a(s ? "error_color_dark" : "error_color", e.palette.error),
139
- warning: a(s ? "warning_color_dark" : "warning_color", e.palette.warning),
140
- info: a(s ? "info_color_dark" : "info_color", e.palette.info),
141
- success: a(s ? "success_color_dark" : "success_color", e.palette.success)
142
- }, i = {
143
- MuiTabs: {
144
- styleOverrides: {
145
- indicator: {
146
- backgroundColor: r.primary.light
147
- }
148
- }
149
- },
150
- MuiPickersCalendarHeader: {
151
- styleOverrides: {
152
- switchViewButton: {
153
- color: r.primary.lighter,
154
- "&:hover": {
155
- backgroundColor: mt(r.primary.light, 0.1)
156
- }
157
- }
158
- }
159
- },
160
- ...t?.button_corner_radius ? {
161
- MuiButton: {
162
- styleOverrides: {
163
- root: {
164
- borderRadius: `${t.button_corner_radius}px`
165
- }
166
- }
167
- }
168
- } : {},
169
- ...t?.card_corner_radius ? {
170
- MuiCard: {
171
- styleOverrides: {
172
- root: {
173
- borderRadius: `${t.card_corner_radius}px`
174
- }
175
- }
176
- },
177
- MuiPaper: {
178
- styleOverrides: {
179
- root: {
180
- borderRadius: `${t.card_corner_radius}px`
181
- }
182
- }
183
- }
184
- } : {}
185
- };
186
- return {
187
- typography: {
188
- fontFamily: t?.system_font ?? e.typography.fontFamily,
189
- H1: {
190
- fontFamily: t?.system_font ?? e.typography.fontFamily
191
- },
192
- h1: {
193
- fontFamily: t?.system_font ?? e.typography.fontFamily
194
- },
195
- H2: {
196
- fontFamily: t?.system_font ?? e.typography.fontFamily
197
- },
198
- h2: {
199
- fontFamily: t?.system_font ?? e.typography.fontFamily
200
- },
201
- H3: {
202
- fontFamily: t?.system_font ?? e.typography.fontFamily
203
- },
204
- h3: {
205
- fontFamily: t?.system_font ?? e.typography.fontFamily
206
- },
207
- Body: {
208
- fontFamily: t?.system_font ?? e.typography.fontFamily
209
- },
210
- body1: {
211
- fontFamily: t?.system_font ?? e.typography.fontFamily
212
- },
213
- Small: {
214
- fontFamily: t?.system_font ?? e.typography.fontFamily
215
- },
216
- body2: {
217
- fontFamily: t?.system_font ?? e.typography.fontFamily
218
- },
219
- Button: {
220
- fontFamily: t?.system_font ?? e.typography.fontFamily
221
- },
222
- button: {
223
- fontFamily: t?.system_font ?? e.typography.fontFamily
224
- },
225
- XSmall: {
226
- fontFamily: t?.system_font ?? e.typography.fontFamily
227
- },
228
- caption: {
229
- fontFamily: t?.system_font ?? e.typography.fontFamily
230
- },
231
- Paragraph: {
232
- fontFamily: t?.system_font ?? e.typography.fontFamily
233
- },
234
- subtitle1: {
235
- fontFamily: t?.system_font ?? e.typography.fontFamily
236
- },
237
- ParagraphSmall: {
238
- fontFamily: t?.system_font ?? e.typography.fontFamily
239
- },
240
- subtitle2: {
241
- fontFamily: t?.system_font ?? e.typography.fontFamily
242
- },
243
- Tiny: {
244
- fontFamily: t?.system_font ?? e.typography.fontFamily
245
- },
246
- tiny: {
247
- fontFamily: t?.system_font ?? e.typography.fontFamily
248
- }
249
- },
250
- palette: r,
251
- components: i,
252
- shape: {
253
- borderRadius: t?.button_corner_radius ?? e.shape.borderRadius
254
- }
255
- };
256
- };
257
- class q {
258
- fetchInstance;
259
- constructor(t) {
260
- this.fetchInstance = new y(t, "", {
261
- Accept: "application/json",
262
- "Content-Type": "application/json"
263
- });
264
- }
265
- getBanner = async (t) => {
266
- try {
267
- const s = `/banner/${t}/account_widget_banner`;
268
- return this.fetchInstance?.get(s).then((a) => a.banner) ?? {};
269
- } catch (s) {
270
- return console.error("Error fetching banner:", s), null;
271
- }
272
- };
273
- }
274
- class ua {
275
- fetchInstance;
276
- constructor(t, s) {
277
- this.fetchInstance = new y(t, s);
278
- }
279
- getLocalizedCopy = async (t) => this.fetchInstance.post(l.LOCALIZED_COPY, t).then((s) => s);
280
- getLocalizedContent = async (t) => this.fetchInstance.post(`${l.LOCALIZED_CONTENT}/${t}`).then((s) => s);
281
- }
282
- class pa {
283
- fetchInstance;
284
- constructor(t, s) {
285
- this.fetchInstance = new y(t, s);
286
- }
287
- addScheduledPayment = async (t) => this.fetchInstance.post(l.SCHEDULED_PAYMENTS, {
288
- ...t,
289
- is_recurring: "true",
290
- transaction_type: at.DEBIT
291
- }).then((s) => s.scheduled_payment);
292
- getScheduledPayments = async () => this.fetchInstance.get(l.SCHEDULED_PAYMENTS).then((t) => t.scheduled_payments);
293
- updateScheduledPayment = async (t) => this.fetchInstance.put(`${l.SCHEDULED_PAYMENTS}/${t.guid}`, t).then((s) => s.scheduled_payment);
294
- deleteScheduledPayment = async (t) => this.fetchInstance.delete(`${l.SCHEDULED_PAYMENTS}/${t}`).then((s) => s);
295
- }
296
- class $ {
297
- fetchInstance;
298
- constructor(t, s) {
299
- this.fetchInstance = new y(t, s);
300
- }
301
- getUserFeatures = async () => this.fetchInstance.get(l.USER_FEATURES).then((t) => t.user_features).catch((t) => t);
302
- updateUser = async (t) => this.fetchInstance.put(l.USER, t).then((s) => s.user);
303
- updateUserProfile = async (t) => this.fetchInstance.put(`${l.USER_PROFILES}/${t.guid}`, t).then((s) => s.user_profile);
304
- }
305
- class W {
306
- fetchInstance;
307
- constructor(t, s) {
308
- this.fetchInstance = new y(t, s);
309
- }
310
- requestWidgetUrl = async (t) => this.fetchInstance.post(l.WIDGET_URLS, t).then((s) => s.widget_url);
311
- }
312
- const ha = (e) => {
313
- const t = gt();
314
- return _t(() => {
315
- t.current = e;
316
- }, [e]), t.current;
317
- }, Ht = ({ color: e, labelAverage: t, labelMain: s }) => {
318
- const a = w(), r = Gt(a, e);
319
- return /* @__PURE__ */ m("div", { className: `mx-cmn-bar-chart-legend ${r}`, children: [
320
- /* @__PURE__ */ o("div", { "aria-label": s, className: "mx-cmn-color-square", role: "img" }),
321
- /* @__PURE__ */ o(B, { variant: "XSmall", children: s }),
322
- /* @__PURE__ */ m("div", { "aria-label": t, className: "mx-cmn-triple-dot", role: "img", children: [
323
- /* @__PURE__ */ o("div", { className: "mx-cmn-dot" }),
324
- /* @__PURE__ */ o("div", { className: "mx-cmn-dot" }),
325
- /* @__PURE__ */ o("div", { className: "mx-cmn-dot" })
326
- ] }),
327
- /* @__PURE__ */ o(B, { variant: "XSmall", children: t })
328
- ] });
329
- }, Gt = (e, t) => C({
330
- alignItems: "center",
331
- display: "flex",
332
- gap: e.Spacing.XSmall,
333
- justifyContent: "flex-end",
334
- marginRight: e.Spacing.XLarge,
335
- paddingBottom: e.Spacing.XSmall,
336
- width: "100%",
337
- "& .mx-cmn-color-square": {
338
- backgroundColor: t,
339
- height: 6,
340
- width: 6
341
- },
342
- "& .mx-cmn-triple-dot": {
343
- display: "flex",
344
- gap: 1
345
- },
346
- "& .mx-cmn-dot": {
347
- backgroundColor: e.Color.Neutral500,
348
- height: 3,
349
- width: 3,
350
- borderRadius: 1.5
351
- },
352
- "& > .kyper-text": {
353
- marginRight: e.Spacing.XSmall
354
- }
355
- }), Q = ({
356
- ariaLabel: e,
357
- color: t,
358
- height: s,
359
- index: a,
360
- label: r,
361
- onClick: i,
362
- selectedIndex: c,
363
- value: d
364
- }) => {
365
- const n = w(), u = Pt(n, t, s), h = (f) => {
366
- i && (f.key === " " || f.key === "Enter") && i(a);
367
- }, b = c === void 0 || c === a ? "primary" : "secondary", g = () => /* @__PURE__ */ o(
368
- B,
369
- {
370
- "aria-hidden": !0,
371
- bold: c === a,
372
- className: "mx-cmn-bar-text",
373
- color: b,
374
- component: "div",
375
- variant: "Small",
376
- children: r
377
- }
378
- );
379
- return /* @__PURE__ */ m("div", { className: `mx-cmn-bar-container ${u} ${d < 0 ? "mx-cmn-negative" : ""}`, children: [
380
- d >= 0 && /* @__PURE__ */ o(g, {}),
381
- /* @__PURE__ */ o(
382
- "div",
383
- {
384
- "aria-label": e,
385
- className: `mx-cmn-bar ${i ? "mx-cmn-clickable" : ""} ${d < 0 ? "mx-cmn-bar-negative" : ""}`,
386
- onClick: i ? () => i?.(a) : void 0,
387
- onKeyDown: h,
388
- role: e ? "button" : void 0,
389
- tabIndex: e ? 0 : void 0
390
- }
391
- ),
392
- d < 0 && /* @__PURE__ */ o(g, {})
393
- ] });
394
- }, Pt = (e, t, s) => {
395
- const a = `expandBar-${Math.round(s)}`, r = wt(a, { from: { height: 0 }, to: { height: s } });
396
- return C({
397
- display: "flex",
398
- flexDirection: "column",
399
- justifyContent: "flex-end",
400
- height: "100%",
401
- "&.mx-cmn-negative": {
402
- justifyContent: "flex-start"
403
- },
404
- "& .mx-cmn-bar": {
405
- animationDelay: ".5s",
406
- animationDuration: "1s",
407
- animationFillMode: "forwards",
408
- animationName: r,
409
- animationTimingFunction: e.Easing.Default,
410
- backgroundColor: t,
411
- borderRadius: `${e.BorderRadius.Medium}px ${e.BorderRadius.Medium}px 0 0`,
412
- maxHeight: s
413
- },
414
- "& .mx-cmn-bar-negative": {
415
- borderRadius: `0 0 ${e.BorderRadius.Medium}px ${e.BorderRadius.Medium}px`,
416
- marginTop: -e.Spacing.XTiny
417
- },
418
- "& .mx-cmn-bar-text": {
419
- display: "flex",
420
- justifyContent: "center",
421
- marginBottom: e.Spacing.Tiny,
422
- marginTop: e.Spacing.Tiny,
423
- whiteSpace: "nowrap",
424
- width: "100%"
425
- }
426
- });
427
- }, Y = ({
428
- ariaLabel: e,
429
- averageLineHeight: t,
430
- bottomHeight: s,
431
- color: a,
432
- index: r = -1,
433
- onClick: i,
434
- range: c,
435
- selectedIndex: d,
436
- topHeight: n,
437
- value: u,
438
- valueLabel: h = "",
439
- width: b,
440
- xAxisLabel: g = ""
441
- }) => {
442
- const f = w(), x = qt(f, b), v = u / c * n, D = Math.abs(u) / c * s, A = d === void 0 || d === r ? "primary" : "secondary";
443
- return /* @__PURE__ */ m("div", { className: `mx-cmn-barchart-bar-column ${x}`, children: [
444
- /* @__PURE__ */ o("div", { style: { height: n }, children: u >= 0 && /* @__PURE__ */ o(
445
- Q,
446
- {
447
- ariaLabel: e,
448
- color: a,
449
- height: v,
450
- index: r,
451
- label: h,
452
- onClick: i,
453
- selectedIndex: d,
454
- value: u
455
- }
456
- ) }),
457
- /* @__PURE__ */ o("div", { className: "mx-cmn-zero-line" }),
458
- t !== 0 && /* @__PURE__ */ o("div", { className: "mx-cmn-chart-average", style: { bottom: t } }),
459
- /* @__PURE__ */ o("div", { style: { height: s }, children: u < 0 && /* @__PURE__ */ o(
460
- Q,
461
- {
462
- ariaLabel: e,
463
- color: a,
464
- height: D,
465
- index: r,
466
- label: h,
467
- onClick: i,
468
- value: u
469
- }
470
- ) }),
471
- /* @__PURE__ */ o(
472
- "div",
473
- {
474
- className: `mx-cmn-bar-label ${i ? "mx-cmn-clickable" : ""}`,
475
- onClick: i ? () => i(r) : void 0,
476
- children: /* @__PURE__ */ o(B, { bold: d === r, color: A, variant: "Small", children: g })
477
- }
478
- )
479
- ] });
480
- }, qt = (e, t) => C({
481
- display: "flex",
482
- flexDirection: "column",
483
- flexGrow: t === void 0 ? 1 : 0,
484
- width: t,
485
- "& .mx-cmn-chart-average": {
486
- borderTop: `${e.Spacing.XTiny}px dotted ${e.Color.Neutral500}`,
487
- position: "relative",
488
- marginRight: e.Spacing.XTiny
489
- },
490
- "& .mx-cmn-zero-line": {
491
- borderBottom: "1px solid text.primary",
492
- width: "100%"
493
- },
494
- "& .mx-cmn-bar-label": {
495
- minHeight: e.Spacing.Medium,
496
- maxHeight: e.Spacing.Medium,
497
- marginBottom: e.Spacing.XSmall,
498
- marginTop: e.Spacing.XSmall,
499
- textAlign: "center",
500
- width: "100%"
501
- },
502
- "& .mx-cmn-clickable": {
503
- cursor: "pointer"
504
- }
505
- }), Wt = (e, t) => e + t, Qt = (e, t) => Math.abs(t) > e ? Math.abs(t) : e, Yt = (e, t) => [...e, t.value], z = (e, t, s) => {
506
- const a = e && t ? s / 2 : s;
507
- return e ? a : 0;
508
- }, zt = (e, t, s, a) => e / (t < 0 ? -s : t) * a || 0, ga = ({
509
- average: e,
510
- barWidth: t = "8%",
511
- color: s,
512
- data: a,
513
- height: r,
514
- legendLabelAverage: i,
515
- legendLabelMain: c,
516
- onBarClick: d,
517
- selectedIndex: n,
518
- valueFormatter: u = (h) => `${h}`
519
- }) => {
520
- const h = w(), b = Xt(h), g = a.reduce(Yt, []), f = e !== void 0 ? e : g.reduce(Wt, 0) / g.length, x = Math.max(...g), v = Math.min(...g), D = g.reduce(Qt, 0), A = x >= 0, k = v < 0, I = z(A, k, r), N = z(k, A, r), O = zt(f, x, v, I || N), st = (S) => n === void 0 || S === n ? s : `${s}80`, U = () => /* @__PURE__ */ o(
521
- Y,
522
- {
523
- averageLineHeight: O,
524
- bottomHeight: N,
525
- color: "",
526
- range: D,
527
- topHeight: I,
528
- value: 0,
529
- width: void 0
530
- }
531
- );
532
- return /* @__PURE__ */ m("div", { className: `mx-cmn-bar-chart ${b}`, children: [
533
- /* @__PURE__ */ m("div", { className: "mx-cmn-chart-container", children: [
534
- /* @__PURE__ */ o(U, {}),
535
- a.map((S, F) => /* @__PURE__ */ m(J.Fragment, { children: [
536
- /* @__PURE__ */ o(
537
- Y,
538
- {
539
- ariaLabel: S.ariaLabel,
540
- averageLineHeight: O,
541
- bottomHeight: N,
542
- color: st(F),
543
- index: F,
544
- onClick: d,
545
- range: D,
546
- selectedIndex: n,
547
- topHeight: I,
548
- value: S.value,
549
- valueLabel: u(S.value),
550
- width: t,
551
- xAxisLabel: S.label
552
- }
553
- ),
554
- /* @__PURE__ */ o(U, {})
555
- ] }, `column-${F}`))
556
- ] }),
557
- /* @__PURE__ */ o(Ht, { color: s, labelAverage: i, labelMain: c })
558
- ] });
559
- }, Xt = (e) => C({
560
- "& .mx-cmn-chart-container": {
561
- alignItems: "flex-end",
562
- display: "flex",
563
- justifyContent: "space-evenly",
564
- marginTop: e.Spacing.Large,
565
- marginBottom: e.Spacing.Medium
566
- }
567
- }), _a = ({
568
- hasGap: e = !1,
569
- segments: t,
570
- size: s = rt,
571
- strokeWidth: a = it,
572
- children: r
573
- }) => {
574
- const i = w(), c = Kt(i, s), d = (s - a) / 2, n = s / 2;
575
- let u = -90 - (e ? 1 : 0), h = 0;
576
- return /* @__PURE__ */ m("div", { className: `mx-cmn-multi-segment-donut ${c}`, children: [
577
- /* @__PURE__ */ m("svg", { height: s, width: s, children: [
578
- /* @__PURE__ */ o(
579
- "circle",
580
- {
581
- cx: n,
582
- cy: n,
583
- fill: "none",
584
- r: d,
585
- stroke: i.Color.Neutral300,
586
- strokeWidth: a
587
- }
588
- ),
589
- t.map((b, g) => (u += 360 * h + (e ? 1 : 0), h = (b.percent - (e ? 0.3 : 0)) / 100, /* @__PURE__ */ o(
590
- "circle",
591
- {
592
- cx: n,
593
- cy: n,
594
- fill: "none",
595
- r: d,
596
- stroke: b.color,
597
- strokeDasharray: 2 * Math.PI * d,
598
- strokeDashoffset: 2 * Math.PI * d * (1 - h),
599
- strokeWidth: a,
600
- transform: `rotate(${u}, ${n}, ${n})`
601
- },
602
- g
603
- )))
604
- ] }),
605
- /* @__PURE__ */ o("div", { className: "mx-cmn-multi-segment-donut-children", children: r })
606
- ] });
607
- }, Kt = (e, t) => C({
608
- height: t,
609
- marginTop: `-${e.Spacing.XSmall}px`,
610
- position: "relative",
611
- width: t,
612
- "& .mx-cmn-multi-segment-donut-children": {
613
- left: "50%",
614
- position: "absolute",
615
- textAlign: "center",
616
- top: "50%",
617
- transform: "translate(-50%, -50%)"
618
- }
619
- }), ma = ({
620
- icon: e,
621
- label: t,
622
- onClick: s,
623
- placement: a = "bottom",
624
- tooltipText: r,
625
- variant: i = "text"
626
- }) => {
627
- const c = St();
628
- return /* @__PURE__ */ m(J.Fragment, { children: [
629
- /* @__PURE__ */ o(
630
- yt,
631
- {
632
- onClick: s,
633
- startIcon: e,
634
- sx: {
635
- [c.breakpoints.down("lg")]: { display: "none" },
636
- [c.breakpoints.up("lg")]: { display: "inline-flex" }
637
- },
638
- title: r,
639
- variant: i,
640
- children: t
641
- }
642
- ),
643
- /* @__PURE__ */ o(
644
- bt,
645
- {
646
- describeChild: !0,
647
- placement: a,
648
- sx: { display: { xs: "inline-flex", lg: "none" } },
649
- title: r,
650
- children: /* @__PURE__ */ o(ft, { onClick: s, children: e })
651
- }
652
- )
653
- ] });
654
- };
655
- class jt {
656
- globalStore;
657
- api = new M("/", "");
658
- copy = {};
659
- featureNamespace = "experiences";
660
- isInitialized = !1;
661
- constructor(t) {
662
- this.globalStore = t, this.api = new M(t.endpoint, t.sessionToken), _(this);
663
- }
664
- // DEPRECATED: Initialize api in constructor and use loadCopy instead
665
- // TODO: Remove this function
666
- initialize = async (t, s) => {
667
- this.api = new M(t, s), await this.loadCopy();
668
- };
669
- loadCopy = async () => {
670
- await this.getCopy(this.featureNamespace), p(() => {
671
- this.isInitialized = !0;
672
- });
673
- };
674
- getCopy = async (t, s = "") => {
675
- try {
676
- const a = await this.api.getGlobalCopy(t, s);
677
- p(() => {
678
- this.copy = a[t];
679
- });
680
- } catch (a) {
681
- console.error(`Error occurred while fetching ${this.featureNamespace} copy: ${a}`);
682
- }
683
- };
684
- }
685
- class Vt {
686
- globalStore;
687
- survey = null;
688
- currentQuestionIndex = 0;
689
- question = null;
690
- response = null;
691
- responses = {};
692
- constructor(t) {
693
- this.globalStore = t, _(this);
694
- }
695
- get isLastQuestion() {
696
- return this.currentQuestionIndex === this.surveyQuestions.length - 1;
697
- }
698
- get questionCount() {
699
- return `${this.currentQuestionIndex + 1}/${this.surveyQuestions.length}`;
700
- }
701
- get responsePayload() {
702
- return {
703
- $survey_id: this.surveyId,
704
- ...this.responses
705
- };
706
- }
707
- // TODO hardcode elsewhere
708
- get surveyId() {
709
- return window.app?.postHogPublicKey === "phc_KclQGnOZEaYCttkpiVpuyOYeBlixGo6xNphYgWV4CXo" ? "0196caa6-9b37-0000-98a7-f04e8d56faf5" : "0196a6b0-ccde-0000-b980-0b84ea2fef4a";
710
- }
711
- get surveyQuestions() {
712
- return this.survey ? this.survey.questions : [];
713
- }
714
- loadSurvey = (t = !1) => {
715
- xt.getActiveMatchingSurveys((s) => {
716
- p(() => {
717
- if (s.length > 0) {
718
- const a = s.find((r) => r.id === this.surveyId);
719
- a && (this.survey = a, this.currentQuestionIndex = 0, this.question = a.questions[0], this.response = null, this.responses = {});
720
- }
721
- });
722
- }, t);
723
- };
724
- nextQuestion = () => {
725
- this.currentQuestionIndex < this.surveyQuestions.length - 1 && (this.currentQuestionIndex += 1), this.response = null, this.question = this.surveyQuestions[this.currentQuestionIndex];
726
- };
727
- resetStore = () => {
728
- this.survey = null, this.currentQuestionIndex = 0, this.question = null, this.response = null, this.responses = {};
729
- };
730
- setResponse = (t) => {
731
- this.response = t, this.question && (this.responses[`$survey_response_${this.question.id}`] = t);
732
- };
733
- }
734
- function Zt(e, t, s, a = "asc") {
735
- const r = a === "desc" ? -1 : 1;
736
- return [...e, ...t].sort((i, c) => i[s] < c[s] ? -1 * r : i[s] > c[s] ? 1 * r : 0);
737
- }
738
- const Jt = (e) => ({
739
- ...e,
740
- //fields that are offer specific, adding here for visibility
741
- image_url: e.image_url,
742
- guid: e.guid,
743
- created_at: e.created_at,
744
- dismissed_at: e.dismissed_at,
745
- active_at: e.campaign_activated_at,
746
- displayed_at: e.has_been_viewed,
747
- post_message_secondary: e.pulse_post_message_secondary,
748
- //offer fields mapped to beat fields for functionality
749
- title: e.pulse_title || e.campaign_name,
750
- html_title: e.pulse_title || e.campaign_name,
751
- short_title: e.pulse_title || e.campaign_name,
752
- html_short_title: e.pulse_title || e.campaign_name,
753
- micro_title: e.pulse_title || e.campaign_name,
754
- html_micro_title: e.pulse_title || e.campaign_name,
755
- supporting_action: e.pulse_call_to_action_text_secondary,
756
- description: e.pulse_body,
757
- html_description: e.pulse_body,
758
- micro_description: e.pulse_body,
759
- html_micro_description: e.pulse_body,
760
- call_to_action: e.pulse_call_to_action_text,
761
- html_micro_call_to_action: e.pulse_call_to_action_text,
762
- micro_call_to_action: e.pulse_call_to_action_text,
763
- is_dismissed: e.has_been_dismissed,
764
- icon_type: 5,
765
- template: "MarketingOffer",
766
- //beat fields we null out
767
- account_guids: [],
768
- data_series: {},
769
- has_been_displayed: !1,
770
- is_obsolete: !1,
771
- is_refreshable: !1,
772
- is_sampled: !1,
773
- merchant_guids: [],
774
- payload: {},
775
- pulse_campaign_name: e.campaign_name,
776
- scheduled_payment_guids: [],
777
- transaction_guids: [],
778
- user_guid: "",
779
- user_verification: 0
780
- });
781
- class te {
782
- globalStore;
783
- api = new L("/", "");
784
- beats = [];
785
- isLoading = !1;
786
- constructor(t) {
787
- this.globalStore = t, this.api = new L(t.endpoint, t.sessionToken), _(this);
788
- }
789
- loadBeats = async () => {
790
- this.isLoading = !0;
791
- const t = await this.api.getBeats(), a = (await this.api.getOffers()).map((r) => Jt(r));
792
- p(() => {
793
- this.beats = Zt(t, a, "active_at", "desc"), this.isLoading = !1;
794
- });
795
- };
796
- getBeatsByCategories(t) {
797
- return this.beats.filter((s) => s.category_guids?.some((a) => t.includes(a)));
798
- }
799
- }
800
- class X {
801
- fetchInstance;
802
- constructor(t, s) {
803
- this.fetchInstance = new y(t, s);
804
- }
805
- addBudget = async (t, s, a = null) => this.fetchInstance.post(l.BUDGETS, {
806
- amount: s,
807
- category_guid: t.guid,
808
- category_name: t.name,
809
- parent_guid: a
810
- }).then((r) => r.budget).catch((r) => {
811
- throw r;
812
- });
813
- deleteBudget = async (t) => this.fetchInstance.delete(`${l.BUDGETS}/${t}`).then((s) => s).catch((s) => {
814
- throw s;
815
- });
816
- getBudgets = async () => this.fetchInstance.get(l.BUDGETS).then((t) => t.budgets).catch((t) => t);
817
- updateBudget = async (t) => this.fetchInstance.put(`${l.BUDGETS}/${t.guid}`, t).then((s) => s.budget).catch((s) => {
818
- throw s;
819
- });
820
- }
821
- class ee {
822
- api = new X("/", "");
823
- globalStore;
824
- alert = "";
825
- dateRange = { start: et(R()), end: tt(R()) };
826
- budgets = [];
827
- selectedBudget;
828
- selectedSubBudget;
829
- isDataLoaded = !1;
830
- theme = {};
831
- constructor(t) {
832
- this.globalStore = t, this.api = new X(t.endpoint, t.sessionToken), _(this);
833
- }
834
- loadBudgetData = async () => {
835
- await this.loadBudgets(), Ct(
836
- () => this.detailedBudgets,
837
- (t) => {
838
- if (t) {
839
- const s = this.selectedBudget;
840
- s && (this.selectedBudget = vt(t, s.guid));
841
- const a = this.selectedSubBudget;
842
- a && a.parent_guid && (this.selectedSubBudget = Dt(
843
- t,
844
- a.guid,
845
- a.parent_guid
846
- ));
847
- }
848
- }
849
- );
850
- };
851
- get detailedBudgets() {
852
- return P(
853
- this.budgets.filter(
854
- (t) => t.category_guid !== E.INCOME && t.category_guid !== E.TRANSFER && t.category_guid !== E.INVESTMENTS
855
- ),
856
- this.globalStore.categoryStore.detailedCategories,
857
- this.globalStore.copyStore.copy.budgets,
858
- this.theme
859
- ).sort((t, s) => t.percentage > s.percentage ? -1 : t.percentage < s.percentage ? 1 : 0);
860
- }
861
- get incomeBudget() {
862
- return P(
863
- this.budgets.filter((a) => !a.parent_guid),
864
- this.globalStore.categoryStore.detailedCategories,
865
- this.globalStore.copyStore.copy.budgets,
866
- this.theme
867
- ).reduce(
868
- (a, r) => r.category_guid !== E.INCOME ? a : !a || r.percentage > a.percentage ? r : a,
869
- void 0
870
- )?.amount;
871
- }
872
- get unbudgetedCategories() {
873
- return this.globalStore.categoryStore.spendCategories.filter(
874
- (t) => !this.detailedBudgets.find((s) => s.category_guid === t.guid)
875
- );
876
- }
877
- get totalBudgeted() {
878
- return this.detailedBudgets.reduce((t, s) => t + s.amount, 0);
879
- }
880
- addBudget = async (t, s, a = null) => {
881
- try {
882
- const r = await this.api.addBudget(t, s, a);
883
- p(() => {
884
- this.budgets.push(r);
885
- });
886
- } catch (r) {
887
- console.error(`Error adding budget: ${r}`);
888
- }
889
- };
890
- deleteBudget = async (t) => {
891
- try {
892
- await this.api.deleteBudget(t), p(() => {
893
- const s = this.budgets.findIndex((a) => a.guid === t);
894
- s >= 0 && this.budgets.splice(s, 1);
895
- });
896
- } catch (s) {
897
- console.error(`Error deleting budget: ${s}`);
898
- }
899
- };
900
- loadBudgets = async () => {
901
- try {
902
- const t = await this.api.getBudgets();
903
- p(() => {
904
- this.budgets = t, this.isDataLoaded = !0;
905
- });
906
- } catch (t) {
907
- throw console.error(`Error occurred while loading budgets: ${t}`), t;
908
- }
909
- };
910
- setAlert = (t) => this.alert = t;
911
- setDateRange = (t) => this.dateRange = t;
912
- setSelectedBudget = (t) => this.selectedBudget = t;
913
- setSelectedSubBudget = (t) => this.selectedSubBudget = t;
914
- setTheme = (t) => this.theme = t;
915
- /**
916
- * Recalculate budget by using the average amount from top-level categories
917
- * @param categories Detailed categories
918
- */
919
- recalculateBudgets = async (t) => {
920
- try {
921
- for (const a of t) {
922
- const r = this.budgets.find((i) => i.category_guid === a.guid);
923
- r ? await this.api.updateBudget({
924
- ...r,
925
- amount: a.totalAverageAmount
926
- }) : await this.api.addBudget(a, a.totalAverageAmount);
927
- }
928
- const s = this.budgets.filter(
929
- (a) => !t.find((r) => r.guid === a.category_guid)
930
- );
931
- for (const a of s)
932
- await this.api.deleteBudget(a.guid);
933
- return await this.loadBudgets(), { data: this.budgets, isSuccess: !0 };
934
- } catch (s) {
935
- return console.error("error recalculating budgets", s), { data: [], isSuccess: !1 };
936
- }
937
- };
938
- updateBudget = async (t) => {
939
- try {
940
- const s = await this.api.updateBudget(t);
941
- p(() => {
942
- const a = this.budgets.findIndex((r) => r.guid === t.guid);
943
- a >= 0 && (this.budgets[a] = s);
944
- });
945
- } catch (s) {
946
- console.error(`Error updating budget: ${s}`);
947
- }
948
- };
949
- }
950
- var se = /* @__PURE__ */ ((e) => (e[e.UNKNOWN = 0] = "UNKNOWN", e[e.CORRECT = 1] = "CORRECT", e[e.INCORRECT = 2] = "INCORRECT", e))(se || {}), ae = /* @__PURE__ */ ((e) => (e.Missed = "Missed", e.Paid = "Paid", e.Upcoming = "Upcoming expense", e.Income = "Income", e))(ae || {}), re = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.Subscription = 1] = "Subscription", e[e.Bill = 2] = "Bill", e))(re || {}), ie = /* @__PURE__ */ ((e) => (e.Desktop = "Desktop", e.Mobile = "Mobile", e))(ie || {});
951
- class K {
952
- fetchInstance;
953
- constructor(t, s) {
954
- this.fetchInstance = new y(t, s);
955
- }
956
- createSupportTicket = async (t) => this.fetchInstance.post(l.SUPPORT_TICKETS, t).then((s) => s);
957
- }
958
- const oe = (e, t) => e.guid === "general" || e.guid === "insights" ? !0 : e.flags ? e.flags.every((s) => t[s]) : !1, ne = (e, t) => {
959
- const s = [];
960
- for (const a of ot) {
961
- const r = t[a.guid];
962
- if (!r) continue;
963
- const i = {
964
- ...a,
965
- title: r.label,
966
- topics: a.topics.map(({ topicKey: c }, d) => ({
967
- topicKey: c,
968
- label: r.topics[d]
969
- }))
970
- };
971
- oe(i, e) && s.push(i);
972
- }
973
- return s;
974
- };
975
- class ce {
976
- alert = { message: "", severity: void 0 };
977
- api = new K("/", "");
978
- appConfig;
979
- globalStore;
980
- isLoading = !1;
981
- constructor(t) {
982
- this.globalStore = t, this.api = new K(t.endpoint, t.sessionToken), _(this);
983
- }
984
- createSupportTicket = async (t) => {
985
- try {
986
- this.isLoading = !0, await this.api.createSupportTicket(t), this.setAlert(this.copy.request_support_submit_success_message, "success");
987
- } catch (s) {
988
- this.setAlert(this.copy.request_support_submit_failure_message, "error"), console.error("Error occurred while submitting:", s);
989
- } finally {
990
- this.isLoading = !1;
991
- }
992
- };
993
- setAlert = (t, s = void 0) => this.alert = { message: t, severity: s };
994
- get copy() {
995
- return this.globalStore.copyStore.copy.help;
996
- }
997
- get helpCategories() {
998
- const { client_communication_profile: t, client_profile: s } = this.globalStore.appDataStore.appData, {
999
- help: { category_list: a }
1000
- } = this.globalStore.copyStore.copy;
1001
- return ne(
1002
- {
1003
- ...t,
1004
- ...s,
1005
- ...this.globalStore.appConfig.config
1006
- },
1007
- a
1008
- );
1009
- }
1010
- }
1011
- class j {
1012
- fetchInstance;
1013
- constructor(t, s) {
1014
- this.fetchInstance = new y(t, s);
1015
- }
1016
- getHoldings = async () => this.fetchInstance.get(l.HOLDINGS).then((t) => t.holdings);
1017
- updateHoldings = async (t) => this.fetchInstance.put(`${l.HOLDINGS}/${t.guid}`, t).then((s) => s.holding);
1018
- }
1019
- class de {
1020
- analysisType = nt.Stocks;
1021
- api = new j("/", "");
1022
- holdings = [];
1023
- holdingsLoaded = !1;
1024
- globalStore;
1025
- showConnectionsWidget = !1;
1026
- constructor(t) {
1027
- this.globalStore = t, this.api = new j(t.endpoint, t.sessionToken), _(this);
1028
- }
1029
- get analysisChartData() {
1030
- return ct(dt(this.visibleHoldings), this.analysisType);
1031
- }
1032
- get analysisDetails() {
1033
- return lt(this.visibleHoldings)[this.analysisType] || {};
1034
- }
1035
- get visibleHoldings() {
1036
- return this.holdings.filter(
1037
- (t) => this.globalStore.globalUiStore.selectedAccountGuids.includes(t.account_guid)
1038
- );
1039
- }
1040
- setShowConnectionsWidget = (t) => {
1041
- this.showConnectionsWidget = t;
1042
- };
1043
- loadHoldings = async () => {
1044
- try {
1045
- const t = await this.api.getHoldings();
1046
- p(() => {
1047
- this.holdings = [...t], this.holdingsLoaded = !0;
1048
- });
1049
- } catch (t) {
1050
- console.error(`Error occured while getting holdings: ${t}`);
1051
- }
1052
- };
1053
- setAnalysisType = (t) => {
1054
- this.analysisType = t;
1055
- };
1056
- updateHoldings = async (t) => {
1057
- this.holdingsLoaded = !1;
1058
- try {
1059
- const s = await this.api.updateHoldings(t), a = this.holdings.findIndex(({ guid: r }) => r === t.guid);
1060
- if (a >= 0) {
1061
- const r = [...this.holdings];
1062
- r[a] = s, p(() => {
1063
- this.holdings = r, this.holdingsLoaded = !0;
1064
- });
1065
- }
1066
- } catch (s) {
1067
- console.error(`Error occurred while updating holding: ${s}`);
1068
- }
1069
- };
1070
- }
1071
- const V = {
1072
- clientConfig: {},
1073
- clientStyleProfile: {},
1074
- config: {
1075
- assets_prefix: "/assets",
1076
- bundle: "widgetLoader",
1077
- client_guid: "",
1078
- dashboard_accounts_index: 6,
1079
- dashboard_accounts_location: 0,
1080
- dashboard_activity_index: 2,
1081
- dashboard_activity_location: 0,
1082
- dashboard_budgets_index: 5,
1083
- dashboard_budgets_location: 1,
1084
- dashboard_cash_flow_index: 0,
1085
- dashboard_cash_flow_location: 0,
1086
- dashboard_connect_index: 7,
1087
- dashboard_connect_location: 1,
1088
- dashboard_insights_index: 3,
1089
- dashboard_insights_location: 1,
1090
- dashboard_spending_index: 1,
1091
- dashboard_spending_location: 1,
1092
- dashboard_trends_index: 4,
1093
- dashboard_trends_location: 0,
1094
- display_account_number_in_accounts: !0,
1095
- display_add_manual_transaction_in_transactions: !0,
1096
- display_available_balance_in_accounts: !0,
1097
- display_email_edit_field_in_settings: !0,
1098
- display_mobile_devices_in_settings: !0,
1099
- display_notification_settings_in_settings: !0,
1100
- display_only_external_accounts_in_accounts: !1,
1101
- display_password_options_in_settings: !0,
1102
- display_sms_edit_field_in_settings: !0,
1103
- display_terms_and_conditions: !0,
1104
- display_user_profile_in_settings: !0,
1105
- display_user_transaction_rules_in_settings: !0,
1106
- enable_add_account_in_zero_state: !0,
1107
- enable_aggregation_prompts: !0,
1108
- enable_external_accounts_in_goals_widget: !0,
1109
- enable_funds_transfers_in_goals_widget: !1,
1110
- enable_manual_accounts: !0,
1111
- enable_mark_account_closed_for_held_accounts: !0,
1112
- enable_mark_account_duplicate_for_held_accounts: !0,
1113
- enable_renaming_home_accounts: !0,
1114
- enable_support_requests: !1,
1115
- language: "en-US",
1116
- product_name: "Money Dashboard",
1117
- session_token: "",
1118
- show_account_nicknames_in_master: !1,
1119
- show_accounts_widget_in_master: !0,
1120
- show_budgets_widget_in_master: !0,
1121
- show_carousel_card_border_in_pulse_micro_widget: !1,
1122
- show_cash_flow_widget_in_master: !0,
1123
- show_connections_widget_in_master: !0,
1124
- show_cta_colocated_with_text_in_pulse_micro_widget: !0,
1125
- show_debts_widget_in_master: !0,
1126
- show_finstrong_widget_in_master: !0,
1127
- show_full_experience_link_in_pulse_micro_widget: !1,
1128
- show_full_experience_link_in_pulse_mini_widget: !1,
1129
- show_goals_widget_in_master: !0,
1130
- show_help_widget_in_master: !0,
1131
- show_horizontal_padding_in_pulse_micro_widget: !0,
1132
- show_icon_in_pulse_micro_widget: !0,
1133
- show_insights_widget_in_master: !0,
1134
- show_investments_widget_in_master: !1,
1135
- show_mx_branding: !0,
1136
- show_navigation_controls_in_pulse_micro_widget: !0,
1137
- show_net_worth_widget_in_master: !0,
1138
- show_notifications_widget_in_master: !0,
1139
- show_recurring_transactions_widget_in_master: !0,
1140
- show_settings_widget_in_master: !0,
1141
- show_spending_plan_widget_in_master: !1,
1142
- show_spending_widget_in_master: !0,
1143
- show_transactions_widget_in_master: !0,
1144
- show_trends_widget_in_master: !0,
1145
- type: "money-dashboard",
1146
- websocket: {
1147
- hmac: "",
1148
- token: "",
1149
- url: ""
1150
- },
1151
- widgets_display_name: "Money Dashboard "
1152
- },
1153
- honeyBadgerPublicKey: "",
1154
- options: {
1155
- assets_prefix: "/assets",
1156
- brokaw_auth: {
1157
- token: "",
1158
- hmac: "",
1159
- url: ""
1160
- },
1161
- brokaw_websocket_url: "",
1162
- bundle: "widgetLoader",
1163
- custom_copy_namespace: "",
1164
- language: "en-US",
1165
- product_name: "Master Widget",
1166
- session_token: "",
1167
- subtype: "master",
1168
- type: "money_dashboard"
1169
- },
1170
- postHogPublicKey: "phc_1fVYJICC69TpW4wagp9o2XqQ8E7X98cAmcR5psSpfkE",
1171
- userFeatures: []
1172
- };
1173
- class Z {
1174
- fetchInstance;
1175
- constructor(t, s) {
1176
- this.fetchInstance = new y(t, s);
1177
- }
1178
- getAppData = async () => this.fetchInstance.get(l.APP_DATA).then((t) => t);
1179
- }
1180
- class le {
1181
- globalStore;
1182
- api = new Z("/", "");
1183
- bannerApi = new q("/");
1184
- appData = {};
1185
- banner = {};
1186
- constructor(t) {
1187
- this.globalStore = t, this.api = new Z(t.endpoint, t.sessionToken), _(this);
1188
- }
1189
- get appConfig() {
1190
- return this.globalStore.appConfig;
1191
- }
1192
- get clientCommunicationProfile() {
1193
- return this.appData.client_communication_profile;
1194
- }
1195
- get clientInsightProfile() {
1196
- return this.appData.client_insight_profile;
1197
- }
1198
- get user() {
1199
- return this.appData.user;
1200
- }
1201
- get userCommunicationProfile() {
1202
- return this.appData.user_communication_profile;
1203
- }
1204
- get userProfile() {
1205
- return this.appData.user_profile;
1206
- }
1207
- loadAppData = async (t) => {
1208
- try {
1209
- const s = t || await this.api.getAppData();
1210
- p(() => {
1211
- this.appData = s, this.bannerApi = new q(s.address?.bullseye || "/");
1212
- });
1213
- } catch (s) {
1214
- console.error(`Error loading app data: ${s}`);
1215
- }
1216
- };
1217
- loadBanner = async () => {
1218
- try {
1219
- const t = this.user?.guid ?? null, s = t ? await this.bannerApi.getBanner(t) : {};
1220
- p(() => {
1221
- this.banner = s;
1222
- });
1223
- } catch (t) {
1224
- console.error(`Error loading banner: ${t}`);
1225
- }
1226
- };
1227
- setUser = (t) => this.appData.user = t;
1228
- setUserCommunicationProfile = (t) => this.appData.user_communication_profile = t;
1229
- setUserProfile = (t) => this.appData.user_profile = t;
1230
- }
1231
- class ue {
1232
- globalStore;
1233
- widgetApi = new W("/", "");
1234
- constructor(t) {
1235
- this.globalStore = t, this.widgetApi = new W(t.endpoint, t.sessionToken), _(this);
1236
- }
1237
- loadWidget = async ({ widget: t = "connect_widget", mode: s = "light", ...a }) => await this.widgetApi.requestWidgetUrl({
1238
- widget_url: { widget_type: t, color_scheme: s, ...a }
1239
- });
1240
- }
1241
- class pe {
1242
- globalStore;
1243
- isInitialized = !1;
1244
- selectedAccounts = [];
1245
- selectedAccountGuids = this.selectedAccounts.map((t) => t.guid);
1246
- displayedDate = /* @__PURE__ */ new Date();
1247
- displayedDateRange = {
1248
- start: et(this.displayedDate),
1249
- end: tt(this.displayedDate)
1250
- };
1251
- constructor(t) {
1252
- _(this), this.globalStore = t;
1253
- }
1254
- get isCopyLoaded() {
1255
- return this.globalStore.copyStore.isInitialized;
1256
- }
1257
- setInitialized = (t) => {
1258
- this.isInitialized = t;
1259
- };
1260
- // for the global account filter
1261
- // if excluded from 1 widget, excluded from all
1262
- setSelectedAccounts = (t) => {
1263
- this.selectedAccounts = t.filter(
1264
- (s) => !(s.is_excluded_from_accounts || s.is_excluded_from_budgets || s.is_excluded_from_cash_flow || s.is_excluded_from_debts || s.is_excluded_from_goals || s.is_excluded_from_investments || s.is_excluded_from_net_worth || s.is_excluded_from_spending || s.is_excluded_from_transactions || s.is_excluded_from_trends)
1265
- ), this.selectedAccountGuids = this.selectedAccounts.map((s) => s.guid);
1266
- };
1267
- // Sets an array of selected account guids for the AccountFilter component
1268
- setSelectedAccountGuids = async (t) => {
1269
- const s = new Set(this.selectedAccountGuids), a = new Set(t), r = [...a].filter((c) => !s.has(c)), i = [...s].filter((c) => !a.has(c));
1270
- r.length > 0 && this.globalStore.accountStore.updateAccountFiltering(r, !1), i.length > 0 && this.globalStore.accountStore.updateAccountFiltering(i, !0), this.selectedAccountGuids = t;
1271
- };
1272
- setDisplayedDate = (t, s) => {
1273
- this.displayedDate = s, this.displayedDateRange = {
1274
- start: t,
1275
- end: s
1276
- };
1277
- };
1278
- get shouldDisableNextDate() {
1279
- const t = T(this.displayedDate), s = T(ht(/* @__PURE__ */ new Date(), 1));
1280
- return t === s;
1281
- }
1282
- get shouldDisablePrevDate() {
1283
- const t = T(this.displayedDate), s = T(/* @__PURE__ */ new Date());
1284
- return t === s;
1285
- }
1286
- }
1287
- class he {
1288
- globalStore;
1289
- api = new $("/", "");
1290
- userFeatures = [];
1291
- constructor(t) {
1292
- this.globalStore = t, this.api = new $(t.endpoint, t.sessionToken), _(this);
1293
- }
1294
- // DEPRECATED: Initialize api in constructor and use loadUserFeatures instead
1295
- // TODO: Remove this function
1296
- initialize = async (t, s) => {
1297
- this.api = new $(t, s), await this.loadUserFeatures();
1298
- };
1299
- get userProfile() {
1300
- return this.globalStore.appDataStore.userProfile;
1301
- }
1302
- get user() {
1303
- return this.globalStore.appDataStore.user;
1304
- }
1305
- loadUserFeatures = async (t) => {
1306
- try {
1307
- const s = t || await this.api.getUserFeatures();
1308
- p(() => {
1309
- this.userFeatures = s;
1310
- });
1311
- } catch (s) {
1312
- console.error(`Error occurred while loading user features: ${s}`);
1313
- }
1314
- };
1315
- updateUser = async (t) => {
1316
- try {
1317
- const s = await this.api.updateUser(t);
1318
- this.globalStore.appDataStore.setUser(s);
1319
- } catch (s) {
1320
- console.error(`Error updating User: ${s}`);
1321
- }
1322
- };
1323
- updateUserProfile = async (t) => {
1324
- try {
1325
- const s = await this.api.updateUserProfile(t);
1326
- this.globalStore.appDataStore.setUserProfile(s);
1327
- } catch (s) {
1328
- console.error(`Error occurred while updating user profile: ${s}`);
1329
- }
1330
- };
1331
- }
1332
- class ya {
1333
- // Global properties
1334
- appConfig = V;
1335
- endpoint = "/";
1336
- sessionToken = "";
1337
- // Data Stores
1338
- accountStore;
1339
- appDataStore;
1340
- analyticsStore;
1341
- beatStore;
1342
- budgetsStore;
1343
- cashflowStore;
1344
- categoryStore;
1345
- connectStore;
1346
- copyStore;
1347
- debtsStore;
1348
- finstrongStore;
1349
- goalStore;
1350
- helpStore;
1351
- holdingStore;
1352
- merchantStore;
1353
- netWorthStore;
1354
- notificationStore;
1355
- recurringTransactionsStore;
1356
- settingsStore;
1357
- transactionStore;
1358
- trendsStore;
1359
- userStore;
1360
- // UI Stores
1361
- globalUiStore;
1362
- constructor(t = V, s = "/") {
1363
- this.appConfig = t, this.endpoint = s, this.sessionToken = t.options.session_token ?? "", this.accountStore = new Ot(this), this.appDataStore = new le(this), this.analyticsStore = new Vt(this), this.beatStore = new te(this), this.budgetsStore = new ee(this), this.cashflowStore = new At(this), this.categoryStore = new ut(this), this.connectStore = new ue(this), this.copyStore = new jt(this), this.debtsStore = new Et(this), this.finstrongStore = new Tt(this), this.goalStore = new Bt(this), this.helpStore = new ce(this), this.holdingStore = new de(this), this.merchantStore = new It(this), this.netWorthStore = new Nt(this), this.notificationStore = new pt(this), this.recurringTransactionsStore = new $t(this), this.settingsStore = new Ft(this), this.transactionStore = new Mt(this), this.trendsStore = new kt(this), this.userStore = new he(this), this.globalUiStore = new pe(this), _(this);
1364
- }
1365
- get isInitialized() {
1366
- return this.globalUiStore.isInitialized;
1367
- }
1368
- loadData = async ({
1369
- accounts: t,
1370
- appData: s,
1371
- associatedBeats: a,
1372
- categories: r,
1373
- institutions: i,
1374
- transactionRules: c,
1375
- transactions: d,
1376
- userFeatures: n
1377
- } = {}) => {
1378
- await Promise.all([
1379
- // Load copy, config and quser data
1380
- this.copyStore.loadCopy(),
1381
- this.appDataStore.loadAppData(s),
1382
- this.userStore.loadUserFeatures(n)
1383
- ]), await Promise.all([
1384
- this.accountStore.loadAccountData({ accounts: t, institutions: i }),
1385
- this.categoryStore.loadCategories(r),
1386
- this.transactionStore.loadTransactionData({
1387
- associatedBeats: a,
1388
- transactionRules: c,
1389
- transactions: d
1390
- })
1391
- ]), this.globalUiStore.setInitialized(!0);
1392
- };
1393
- }
1394
- export {
1395
- Sa as ANALYTICS_EVENTS,
1396
- wa as AccountFilter,
1397
- Ca as AccountIcon,
1398
- xa as AccountIconVariants,
1399
- va as AccountNotificationTypes,
1400
- Da as AccountSubType,
1401
- Aa as AccountType,
1402
- Ea as AccountTypeName,
1403
- Ta as AnalyticsApi,
1404
- l as ApiEndpoints,
1405
- q as BannerApi,
1406
- ga as BarChart,
1407
- L as BeatApi,
1408
- Ba as BudgetNotificationTypes,
1409
- Ia as Calendar,
1410
- Na as CalendarSelectionTypes,
1411
- Zr as CategoryApi,
1412
- Fa as CategoryColors,
1413
- Ma as CategoryGuidToName,
1414
- E as CategoryGuids,
1415
- $a as CategoryIcon,
1416
- ka as ConnectCard,
1417
- Oa as ConnectDrawer,
1418
- Ua as ConnectionStatus,
1419
- La as ConnectionStatusEnums,
1420
- Ra as CurrencyCodes,
1421
- Ha as CurrencyInput,
1422
- Ga as CurrencyText,
1423
- Pa as DATE_FORMATS_INTL,
1424
- rt as DEFAULT_DONUT_SIZE,
1425
- it as DEFAULT_STROKE_WIDTH,
1426
- qa as DataRow,
1427
- Wa as DateRangeSelector,
1428
- Qa as Dialog,
1429
- Mi as Donut,
1430
- Ya as Drawer,
1431
- za as EmptyState,
1432
- Xa as ErrorBoundary,
1433
- Ka as ErrorStatuses,
1434
- ae as ExpenseStatus,
1435
- y as Fetch,
1436
- ja as Frequency,
1437
- M as GlobalCopyApi,
1438
- jt as GlobalCopyStore,
1439
- si as GlobalDataContext,
1440
- ai as GlobalDataProvider,
1441
- ya as GlobalStore,
1442
- Va as GoalType,
1443
- Za as INCOME_ACCOUNT_TYPES,
1444
- Ja as IconBacking,
1445
- tr as InformationTooltip,
1446
- er as InsightNotificationTypes,
1447
- Rt as IterationItemTypes,
1448
- da as LOADING_STATUS,
1449
- sr as LineChart,
1450
- ar as ListItemAction,
1451
- rr as ListItemWrapper,
1452
- ri as Loader,
1453
- ua as LocalizedCopyApi,
1454
- ir as MetaType,
1455
- or as MfaStatuses,
1456
- nr as MicroWidgetContainer,
1457
- ii as MiniWidgetContainer,
1458
- _a as MultiSegmentDonut,
1459
- cr as NonConnectedStatuses,
1460
- ti as NotificationApi,
1461
- dr as NotificationTypes,
1462
- lr as ORDINAL_DATE_FORMAT,
1463
- ur as ORDINAL_MONTH_DAY_YEAR_FORMAT,
1464
- pr as PAYMENT_ACCOUNT_TYPES,
1465
- hr as PaymentCategories,
1466
- Lt as PlanTypes,
1467
- gr as ProcessingStatuses,
1468
- _r as PropertyType,
1469
- mr as PropertyTypeName,
1470
- ca as RECURRENCE_COPY,
1471
- yr as RecurrenceStatus,
1472
- br as RecurrenceType,
1473
- Ut as RecurrenceTypes,
1474
- fr as RepeatingType,
1475
- ma as ResponsiveButton,
1476
- Sr as SPENDING_ACCOUNT_TYPES,
1477
- re as ScheduledPaymentTypes,
1478
- pa as ScheduledPaymentsApi,
1479
- ie as ScreenSize,
1480
- wr as SearchBox,
1481
- Cr as Select,
1482
- xr as SelectionBox,
1483
- vr as SingleSegmentDonut,
1484
- Dr as Sizes,
1485
- Ar as StackedLineChart,
1486
- Er as StatusBar,
1487
- Tr as StatusName,
1488
- Br as TOUCH_TARGET,
1489
- Ir as TabContentContainer,
1490
- Nr as ToggleButtonListItem,
1491
- Fr as ToggleListItem,
1492
- Mr as TrackType,
1493
- $r as TransactionStatus,
1494
- at as TransactionType,
1495
- $ as UserApi,
1496
- he as UserStore,
1497
- se as UserVerification,
1498
- W as WidgetApi,
1499
- kr as WidgetContainer,
1500
- oi as WidgetContainerContext,
1501
- ni as WidgetContainerProvider,
1502
- Or as analyticsSession,
1503
- Ur as buildDynamicCopy,
1504
- Lr as buildPluralCopy,
1505
- Rr as formatCurrency,
1506
- Hr as formatDate,
1507
- Gr as formatOrdinal,
1508
- Pr as formatPercentage,
1509
- qr as fromTimestampToMonthYear,
1510
- ki as getCategory,
1511
- Oi as getCategoryTotalsByParent,
1512
- la as getClientTheme,
1513
- Wr as getCurrencyCodes,
1514
- Ui as getDetailedCategory,
1515
- Li as getDetailedSubCategory,
1516
- Qr as getLocale,
1517
- Ri as isIncome,
1518
- Yr as isValidNumber,
1519
- ci as useAccountStore,
1520
- di as useAppConfig,
1521
- li as useBudgetsStore,
1522
- ui as useCashflowStore,
1523
- pi as useCategoryStore,
1524
- zr as useCombineEvents,
1525
- Xr as useCombinePageviews,
1526
- hi as useDebtStore,
1527
- gi as useEvent,
1528
- _i as useFinstrongStore,
1529
- mi as useGlobalCopyStore,
1530
- yi as useGlobalStore,
1531
- bi as useGlobalUiStore,
1532
- fi as useGoalStore,
1533
- Si as useHelpStore,
1534
- wi as useHoldingStore,
1535
- Kr as useInsightsEnabled,
1536
- Ci as useMerchantStore,
1537
- xi as useNetWorthStore,
1538
- vi as useNotificationStore,
1539
- Di as usePageView,
1540
- ha as usePrevious,
1541
- Ai as useRecurringTransactionsStore,
1542
- jr as useScreenSize,
1543
- Ei as useSettingsStore,
1544
- Ti as useTransactionStore,
1545
- Bi as useTrendsStore,
1546
- Ii as useUserStore,
1547
- Ni as useWidgetContainerProvider
1548
- };
1549
- //# sourceMappingURL=index.es.js.map