@mx-cartographer/experiences 6.26.18-alpha.mega4 → 6.26.18-alpha.sms2

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 (98) hide show
  1. package/dist/budgets/index.d.ts +1 -0
  2. package/dist/common/context/hooks.d.ts +13 -13
  3. package/dist/help/components/content/section/index.d.ts +15 -15
  4. package/dist/index.d.ts +22 -0
  5. package/dist/index.es.js +30336 -0
  6. package/dist/index.es.js.map +1 -0
  7. package/package.json +3 -155
  8. package/dist/Account-DM32_5k9.mjs +0 -30
  9. package/dist/AccountDetailsContent-B_qRSB8l.mjs +0 -677
  10. package/dist/AccountDetailsHeader-CAm6ADMq.mjs +0 -119
  11. package/dist/AccountFields-Bb4pds0q.mjs +0 -135
  12. package/dist/AccountListItem-G7iAesaO.mjs +0 -90
  13. package/dist/AccountStore-RSanus_m.mjs +0 -230
  14. package/dist/Accounts-BfAQRG8R.mjs +0 -9
  15. package/dist/BeatApi-DLu87ijw.mjs +0 -21
  16. package/dist/BeatStore-By4aGoRM.mjs +0 -81
  17. package/dist/BudgetUtil-DcqclhiQ.mjs +0 -101
  18. package/dist/CashflowStore-D9Dpuz7X.mjs +0 -91
  19. package/dist/Category-5S6uwuXz.mjs +0 -301
  20. package/dist/CategorySelectorDrawer-DgrePTRg.mjs +0 -397
  21. package/dist/CategoryStore-B5EW6I1d.mjs +0 -183
  22. package/dist/CategoryUtil-DRyruNgi.mjs +0 -78
  23. package/dist/ConnectDrawer-DPnfeIfn.mjs +0 -508
  24. package/dist/ConnectionsDrawer-BCzpuNsK.mjs +0 -52
  25. package/dist/CurrencyInput-DzsPiUsU.mjs +0 -83
  26. package/dist/CurrencyText-YUhH2caW.mjs +0 -20
  27. package/dist/DateUtil-BcuH7ErC.mjs +0 -48
  28. package/dist/DebtsStore-C6VcBnpG.mjs +0 -60
  29. package/dist/Dialog-CWW597AF.mjs +0 -123
  30. package/dist/Donut-1UMNcG67.mjs +0 -57
  31. package/dist/Drawer-kEE73B87.mjs +0 -113
  32. package/dist/EmptyState-Dcb-o2tl.mjs +0 -55
  33. package/dist/Fetch-CkFKy79O.mjs +0 -116
  34. package/dist/FinstrongStore-mkALvztw.mjs +0 -101
  35. package/dist/GoalStore-DyCr4wNc.mjs +0 -263
  36. package/dist/HeaderCell-DjuifqHJ.mjs +0 -6
  37. package/dist/Help-DhcC-C05.mjs +0 -320
  38. package/dist/Help-toqAK5eD.mjs +0 -3173
  39. package/dist/IconBacking-B9oC6uL2.mjs +0 -39
  40. package/dist/InvestmentUtil-jOyOgzIB.mjs +0 -134
  41. package/dist/LineChart-CQWu5KoO.mjs +0 -403
  42. package/dist/ListItemAction-Df3OPMOW.mjs +0 -69
  43. package/dist/Loader-Dp1P2gNw.mjs +0 -14
  44. package/dist/Localization-2MODESHW.mjs +0 -30
  45. package/dist/ManageIncome-BVt_XQbo.mjs +0 -535
  46. package/dist/MerchantStore-DVH-QOf0.mjs +0 -37
  47. package/dist/MicroWidgetContainer-DaLW43tE.mjs +0 -45
  48. package/dist/MiniWidgetContainer-BcNPxZt2.mjs +0 -39
  49. package/dist/NetWorthStore-DE8CQBMM.mjs +0 -150
  50. package/dist/Notification-AMGWM1Al.mjs +0 -78
  51. package/dist/NotificationSettings-CPZN0l8X.mjs +0 -667
  52. package/dist/NotificationStore-DHtSGySy.mjs +0 -67
  53. package/dist/NumberFormatting-CtWHhyBX.mjs +0 -40
  54. package/dist/OriginalBalanceAction-s9sUxofR.mjs +0 -115
  55. package/dist/RecurringSettings-DIEsympT.mjs +0 -57
  56. package/dist/RecurringTransactionsStore-BKLD3OWo.mjs +0 -263
  57. package/dist/RepeatingTransaction-BPWfaB3f.mjs +0 -282
  58. package/dist/SearchBox-B2_zLv8-.mjs +0 -42
  59. package/dist/SettingsStore-CE7jDVFL.mjs +0 -265
  60. package/dist/SingleSegmentDonut-BgbLgwHi.mjs +0 -69
  61. package/dist/SpendingData-ByFCw95X.mjs +0 -53
  62. package/dist/StatusBar-BK_uYHAB.mjs +0 -30
  63. package/dist/TabContentContainer-j01JYR_7.mjs +0 -21
  64. package/dist/Transaction-C-5-Iuab.mjs +0 -312
  65. package/dist/TransactionApi-DbbcjI2L.mjs +0 -86
  66. package/dist/TransactionDetails-B5qfs9Zh.mjs +0 -1283
  67. package/dist/TransactionStore-BWi6_2Ny.mjs +0 -669
  68. package/dist/TrendsStore-Borh98aN.mjs +0 -448
  69. package/dist/ViewMoreMicroCard-CAPFNz-J.mjs +0 -1959
  70. package/dist/WidgetContainer-CmGNZW0M.mjs +0 -548
  71. package/dist/accounts/index.es.js +0 -752
  72. package/dist/analytics/index.es.js +0 -171
  73. package/dist/budgets/index.es.js +0 -1070
  74. package/dist/cashflow/index.es.js +0 -1098
  75. package/dist/categories/index.es.js +0 -9
  76. package/dist/common/index.es.js +0 -1451
  77. package/dist/dashboard/index.es.js +0 -181
  78. package/dist/debts/index.es.js +0 -1460
  79. package/dist/exportTransactionsToCSV-j4g8bdVZ.mjs +0 -47
  80. package/dist/finstrong/index.es.js +0 -1455
  81. package/dist/goals/index.es.js +0 -1209
  82. package/dist/help/index.es.js +0 -14
  83. package/dist/hooks-ClhFlg78.mjs +0 -71
  84. package/dist/insights/index.d.ts +0 -1
  85. package/dist/insights/index.es.js +0 -4
  86. package/dist/investments/index.es.js +0 -1638
  87. package/dist/merchants/index.es.js +0 -79
  88. package/dist/microinsights/index.es.js +0 -16
  89. package/dist/networth/index.es.js +0 -542
  90. package/dist/notifications/index.es.js +0 -192
  91. package/dist/recurringtransactions/index.es.js +0 -879
  92. package/dist/settings/index.es.js +0 -879
  93. package/dist/spending/index.es.js +0 -570
  94. package/dist/transactions/index.es.js +0 -587
  95. package/dist/trends/index.es.js +0 -1103
  96. package/dist/useCombineEvents-DaDBSR_1.mjs +0 -92
  97. package/dist/useDimensions-27p2evRx.mjs +0 -36
  98. package/dist/useScreenSize-B6JyS_Lj.mjs +0 -36
@@ -1,667 +0,0 @@
1
- import { jsxs as c, jsx as e, Fragment as M } from "react/jsx-runtime";
2
- import f from "react";
3
- import { observer as C } from "mobx-react-lite";
4
- import v from "@mui/material/Divider";
5
- import E from "@mui/material/List";
6
- import O from "@mui/material/ListItem";
7
- import N from "@mui/material/ListItemText";
8
- import V from "@mui/material/ListItemButton";
9
- import _ from "@mui/material/Stack";
10
- import { ChevronRight as k, ExpandMore as K, Star as Q } from "@mxenabled/mx-icons";
11
- import { Text as x, InstitutionLogo as Y, H3 as U } from "@mxenabled/mxui";
12
- import { endOfMonth as Z } from "date-fns/endOfMonth";
13
- import { startOfMonth as ee } from "date-fns/startOfMonth";
14
- import { DateCalendar as te } from "@mui/x-date-pickers/DateCalendar";
15
- import { LocalizationProvider as ne } from "@mui/x-date-pickers/LocalizationProvider";
16
- import { AdapterDateFns as ie } from "@mui/x-date-pickers/AdapterDateFnsV3";
17
- import { A as oe, T as F, a as P, N as b } from "./Notification-AMGWM1Al.mjs";
18
- import { u as D, r as T, o as w, c as se, g as ae, j as W, a as ce } from "./hooks-ClhFlg78.mjs";
19
- import { b as le } from "./Localization-2MODESHW.mjs";
20
- import { b as re, f as de } from "./NumberFormatting-CtWHhyBX.mjs";
21
- import { a as B } from "./Dialog-CWW597AF.mjs";
22
- import { C as me } from "./CurrencyInput-DzsPiUsU.mjs";
23
- import { u as _e } from "./useScreenSize-B6JyS_Lj.mjs";
24
- import { D as J } from "./Drawer-kEE73B87.mjs";
25
- import he from "@mui/material/Collapse";
26
- import ue from "@mui/material/Card";
27
- import pe from "@mui/material/CardContent";
28
- import G from "@mui/material/Box";
29
- import R from "@mui/material/Button";
30
- import L from "@mui/material/TextField";
31
- import { u as fe } from "./useDimensions-27p2evRx.mjs";
32
- import X from "@mui/material/styles/useTheme";
33
- import { L as ge } from "./Loader-Dp1P2gNw.mjs";
34
- const ye = C(() => {
35
- const { common: n, settings: t } = D(), { sendEmailVerification: s } = T(), { user: l } = w(), i = X(), [d, a] = f.useState(!1), o = () => {
36
- a(!1);
37
- }, m = () => {
38
- a(!0);
39
- };
40
- return /* @__PURE__ */ c(f.Fragment, { children: [
41
- /* @__PURE__ */ c(R, { onClick: m, sx: { height: "auto", p: 4, width: "fit-content" }, children: [
42
- /* @__PURE__ */ e(x, { variant: "Small", children: t.verify_email }),
43
- /* @__PURE__ */ e(k, {})
44
- ] }),
45
- /* @__PURE__ */ e(
46
- B,
47
- {
48
- copy: { title: "" },
49
- isOpen: d,
50
- onClose: o,
51
- onPrimaryAction: s,
52
- onSecondaryAction: o,
53
- primaryText: t.send_verification,
54
- secondaryText: n.back,
55
- sx: {
56
- "& .MuiDialogContent-root": { pt: 0, width: 400 },
57
- "& .MuiToolbar-root:last-child": {
58
- gap: 16,
59
- padding: "32px 60px 48px",
60
- justifyContent: "center"
61
- }
62
- },
63
- children: /* @__PURE__ */ c(_, { spacing: 16, sx: { px: 40, textAlign: "center", width: "100%" }, children: [
64
- /* @__PURE__ */ e(x, { bold: !0, truncate: !1, variant: "Body", children: t.confirm_your_email }),
65
- /* @__PURE__ */ e(x, { truncate: !1, variant: "Small", children: t.confirm_email }),
66
- /* @__PURE__ */ e(
67
- x,
68
- {
69
- sx: {
70
- border: `1px solid ${i.palette.border.light}`,
71
- borderRadius: "4px",
72
- p: "16px 32px"
73
- },
74
- variant: "H3",
75
- children: l.email
76
- }
77
- ),
78
- /* @__PURE__ */ e(x, { truncate: !1, variant: "Small", children: t.verification_notice_email })
79
- ] })
80
- }
81
- )
82
- ] });
83
- }), be = C(
84
- ({ handleClose: n, handleVerify: t, isOpen: s }) => {
85
- const { common: l, settings: i } = D(), [d, a] = f.useState("");
86
- return /* @__PURE__ */ e(
87
- B,
88
- {
89
- copy: { title: i.enter_verification_code },
90
- isOpen: s,
91
- onClose: n,
92
- onPrimaryAction: () => t(d),
93
- onSecondaryAction: n,
94
- primaryText: i.verify,
95
- secondaryText: l.cancel_button,
96
- sx: {
97
- "& .MuiDialogContent-root": { pt: 0, width: 400 },
98
- "& .MuiToolbar-root:last-child": {
99
- gap: 8,
100
- padding: 24,
101
- justifyContent: "flex-end"
102
- }
103
- },
104
- children: /* @__PURE__ */ e(_, { children: /* @__PURE__ */ e(L, { onChange: (o) => a(o.target.value), sx: { width: 352 }, value: d }) })
105
- }
106
- );
107
- }
108
- ), xe = C(() => {
109
- const { common: n, settings: t } = D(), { sendPhoneVerification: s, verifyPhoneToken: l } = T(), { user: i } = w(), d = X(), [a, o] = f.useState(!1), [m, r] = f.useState(!1), h = () => {
110
- o(!1);
111
- }, u = () => {
112
- o(!0);
113
- }, g = () => {
114
- s().finally(() => {
115
- r(!0);
116
- });
117
- }, p = (y) => {
118
- l(y).finally(() => {
119
- r(!1);
120
- });
121
- };
122
- return /* @__PURE__ */ c(f.Fragment, { children: [
123
- /* @__PURE__ */ c(R, { onClick: u, sx: { height: "auto", p: 4, width: "fit-content" }, children: [
124
- /* @__PURE__ */ e(x, { variant: "Small", children: t.verify_phone }),
125
- /* @__PURE__ */ e(k, {})
126
- ] }),
127
- /* @__PURE__ */ e(
128
- B,
129
- {
130
- copy: { title: "" },
131
- isOpen: a,
132
- onClose: h,
133
- onPrimaryAction: g,
134
- onSecondaryAction: h,
135
- primaryText: t.send_verification,
136
- secondaryText: n.back,
137
- sx: {
138
- "& .MuiDialogContent-root": { pt: 0, width: 400 },
139
- "& .MuiToolbar-root:last-child": {
140
- gap: 16,
141
- padding: "32px 60px 48px",
142
- justifyContent: "center"
143
- }
144
- },
145
- children: /* @__PURE__ */ c(_, { spacing: 16, sx: { px: 40, textAlign: "center", width: "100%" }, children: [
146
- /* @__PURE__ */ e(x, { bold: !0, truncate: !1, variant: "Body", children: t.confirm_your_phone }),
147
- /* @__PURE__ */ e(x, { truncate: !1, variant: "Small", children: t.confirm_phone }),
148
- /* @__PURE__ */ e(
149
- x,
150
- {
151
- sx: {
152
- border: `1px solid ${d.palette.border.light}`,
153
- borderRadius: "4px",
154
- p: "16px 32px"
155
- },
156
- variant: "H3",
157
- children: i.phone
158
- }
159
- ),
160
- /* @__PURE__ */ e(x, { truncate: !1, variant: "Small", children: t.verification_notice_phone })
161
- ] })
162
- }
163
- ),
164
- /* @__PURE__ */ e(
165
- be,
166
- {
167
- handleClose: () => r(!1),
168
- handleVerify: p,
169
- isOpen: m
170
- }
171
- )
172
- ] });
173
- }), Ce = C(
174
- ({ onProfileUpdated: n, profile: t }) => {
175
- const { common: s, recurring: l, settings: i } = D(), { updateAccount: d } = se(), a = t.notification_type === oe.DebtPaymentReminder, [o, m] = f.useState(!1), [r, h] = f.useState(t.threshold || 0), [u, g] = f.useState(
176
- t.account?.day_payment_is_due || 0
177
- ), p = t.account?.name || t.account?.feed_name || "", y = t.account?.day_payment_is_due ? le(
178
- i.notification_debt_payment_date,
179
- re(t.account?.day_payment_is_due)
180
- ) : i.notification_debt_payment_zero_state, S = a ? y : de(t.threshold ?? 0, "0,0"), A = async () => {
181
- a && t.account ? await d({ ...t.account, day_payment_is_due: u }) : n({ ...t, threshold: r });
182
- };
183
- return /* @__PURE__ */ c(_, { children: [
184
- /* @__PURE__ */ e(
185
- F,
186
- {
187
- avatar: t.account?.institution_guid ? /* @__PURE__ */ e(
188
- Y,
189
- {
190
- alt: t.label,
191
- institutionGuid: t.account?.institution_guid
192
- }
193
- ) : void 0,
194
- endIcon: /* @__PURE__ */ e(k, {}),
195
- isChecked: t.is_enabled,
196
- onClick: () => m(!0),
197
- onToggle: () => n({
198
- ...t,
199
- is_enabled: !t.is_enabled
200
- }),
201
- primaryText: p,
202
- secondaryText: S
203
- }
204
- ),
205
- /* @__PURE__ */ e(
206
- B,
207
- {
208
- copy: {
209
- title: a ? l.day_of_the_month : i.notification_threshold_label,
210
- close_aria: s.close_aria
211
- },
212
- disablePrimaryButton: a && u === 0,
213
- isOpen: o,
214
- onClose: () => m(!1),
215
- onPrimaryAction: A,
216
- primaryText: s.save_button,
217
- children: a ? /* @__PURE__ */ e(ne, { dateAdapter: ie, children: /* @__PURE__ */ e(
218
- te,
219
- {
220
- maxDate: Z(/* @__PURE__ */ new Date()),
221
- minDate: ee(/* @__PURE__ */ new Date()),
222
- onChange: (I) => {
223
- g(I.getDate());
224
- },
225
- slots: {
226
- // Hides the arrows
227
- leftArrowIcon: () => null,
228
- rightArrowIcon: () => null
229
- },
230
- sx: {
231
- // TODO: Needs to be updated in MXUI
232
- "& .MuiPickersDay-today": {
233
- color: "primary.main"
234
- }
235
- },
236
- views: ["day"]
237
- }
238
- ) }) : /* @__PURE__ */ e(
239
- me,
240
- {
241
- amount: r,
242
- autoFocus: !0,
243
- fullWidth: !0,
244
- minAmount: 0,
245
- setAmount: (I) => h(Number(I) || 0),
246
- sx: { ".MuiTypography-Body": { p: 0 } }
247
- }
248
- )
249
- }
250
- )
251
- ] });
252
- }
253
- ), ve = C(
254
- ({ onUpdateProfile: n, profile: t }) => {
255
- const { settings: s } = D(), { user: l } = w(), { clientCommunicationProfile: i, userCommunicationsProfile: d } = T(), { isMobile: a } = _e(), o = t.notification_type > 2, {
256
- opted_out_of_email_notifications: m,
257
- opted_out_of_push_notifications: r,
258
- opted_out_of_sms_notifications: h
259
- } = d, {
260
- email_notifications_enabled: u,
261
- push_notifications_enabled: g,
262
- sms_notifications_enabled: p
263
- } = i;
264
- return /* @__PURE__ */ c(_, { children: [
265
- (u || p || g) && /* @__PURE__ */ c(M, { children: [
266
- /* @__PURE__ */ e(x, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "caption", children: s.delivery_method_title }),
267
- /* @__PURE__ */ c(E, { sx: { bgcolor: "background.paper" }, children: [
268
- u && /* @__PURE__ */ e(_, { sx: { pl: 24 }, children: /* @__PURE__ */ e(
269
- P,
270
- {
271
- isChecked: !m && t.email_channel && !!l.email,
272
- isDisabled: m || !l.email,
273
- onToggle: () => n({ ...t, email_channel: !t.email_channel }),
274
- primaryText: s.delivery_method_email_label,
275
- secondaryText: t.email_channel ? s.notification_enabled : s.notification_disabled,
276
- useExtraPadding: !1
277
- }
278
- ) }),
279
- u && (p || g) && /* @__PURE__ */ e(v, { sx: { ml: a ? 0 : 24 } }),
280
- p && /* @__PURE__ */ e(_, { sx: { pl: 24 }, children: /* @__PURE__ */ e(
281
- P,
282
- {
283
- isChecked: !h && t.sms_channel && !!l.phone,
284
- isDisabled: h || !l.phone,
285
- onToggle: () => n({ ...t, sms_channel: !t.sms_channel }),
286
- primaryText: `${s.delivery_method_sms_label}`,
287
- secondaryText: t.sms_channel ? s.notification_enabled : s.notification_disabled,
288
- useExtraPadding: !1
289
- }
290
- ) }),
291
- p && g && /* @__PURE__ */ e(v, { sx: { ml: a ? 0 : 24 } }),
292
- g && /* @__PURE__ */ e(_, { sx: { pl: 24 }, children: /* @__PURE__ */ e(
293
- P,
294
- {
295
- isChecked: !r && t.push_channel,
296
- isDisabled: r,
297
- onToggle: () => n({ ...t, push_channel: !t.push_channel }),
298
- primaryText: s.delivery_method_push_label,
299
- secondaryText: s.delivery_method_push_subtitle,
300
- useExtraPadding: !1
301
- }
302
- ) }),
303
- /* @__PURE__ */ e(v, {})
304
- ] })
305
- ] }),
306
- o && !!t.children?.length && /* @__PURE__ */ c(_, { children: [
307
- /* @__PURE__ */ e(x, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "caption", children: s.accounts_threshold_title }),
308
- /* @__PURE__ */ e(E, { sx: { bgcolor: "background.paper" }, children: t.children?.map((y) => /* @__PURE__ */ e(
309
- Ce,
310
- {
311
- onProfileUpdated: n,
312
- profile: y
313
- },
314
- y.guid
315
- )) })
316
- ] })
317
- ] });
318
- }
319
- ), H = C(() => {
320
- const { accountProfiles: n, updateNotificationProfile: t } = T(), [s, l] = f.useState(""), i = f.useMemo(
321
- () => n.find((o) => o.guid === s),
322
- [n, s]
323
- ), d = async (o) => {
324
- await t({
325
- ...o,
326
- is_enabled: !o.is_enabled
327
- });
328
- }, a = async (o) => {
329
- await t(o);
330
- };
331
- return /* @__PURE__ */ c(_, { sx: { backgroundColor: "background.paper" }, children: [
332
- n.filter((o) => o.children && o.children.length > 0).map((o) => /* @__PURE__ */ e(
333
- F,
334
- {
335
- endIcon: /* @__PURE__ */ e(k, {}),
336
- isChecked: o.is_enabled,
337
- isDisabled: !o.is_enabled,
338
- onClick: () => l(o.guid),
339
- onToggle: () => d(o),
340
- primaryText: o.label,
341
- secondaryText: o.is_enabled ? o.deliveryMethodsLabel : void 0
342
- },
343
- o.guid
344
- )),
345
- /* @__PURE__ */ e(
346
- J,
347
- {
348
- isOpen: !!i,
349
- onClose: () => l(""),
350
- title: i ? i.label : "",
351
- children: i && /* @__PURE__ */ e(
352
- ve,
353
- {
354
- onUpdateProfile: a,
355
- profile: i
356
- }
357
- )
358
- }
359
- )
360
- ] });
361
- }), q = C(({ profile: n }) => {
362
- const { settings: t } = D(), {
363
- clientCommunicationProfile: {
364
- email_notifications_enabled: s,
365
- push_notifications_enabled: l,
366
- sms_notifications_enabled: i
367
- },
368
- updateNotificationProfile: d,
369
- userCommunicationsProfile: {
370
- opted_out_of_email_notifications: a,
371
- opted_out_of_push_notifications: o,
372
- opted_out_of_sms_notifications: m
373
- }
374
- } = T(), { user: r } = w(), [h, u] = f.useState(!1), g = async () => {
375
- await p({ ...n, is_enabled: !n.is_enabled }), n.is_enabled && u(!1);
376
- }, p = async (S) => {
377
- await d(S);
378
- }, y = s || i || l;
379
- return /* @__PURE__ */ c(E, { sx: { bgcolor: "background.paper" }, children: [
380
- /* @__PURE__ */ e(
381
- F,
382
- {
383
- endIcon: y ? /* @__PURE__ */ e(
384
- K,
385
- {
386
- sx: {
387
- transition: "transform 0.3s ease-in-out",
388
- transform: h ? "rotate(180deg)" : "rotate(0deg)"
389
- }
390
- }
391
- ) : void 0,
392
- isChecked: n.is_enabled,
393
- isDisabled: !n.is_enabled,
394
- onClick: () => u(!h),
395
- onToggle: () => g(),
396
- primaryText: n.label,
397
- secondaryText: n.is_enabled ? n.deliveryMethodsLabel : void 0
398
- },
399
- n.guid
400
- ),
401
- y && /* @__PURE__ */ e(he, { in: h, children: /* @__PURE__ */ c(E, { sx: { bgcolor: "background.paper" }, children: [
402
- s && /* @__PURE__ */ e(
403
- P,
404
- {
405
- isChecked: !a && n.email_channel && !!r.email,
406
- isDisabled: a || !r.email,
407
- onToggle: () => p({
408
- ...n,
409
- email_channel: !n.email_channel
410
- }),
411
- primaryText: t.delivery_method_email_label
412
- }
413
- ),
414
- s && (i || l) && /* @__PURE__ */ e(v, { sx: { ml: 48 } }),
415
- i && /* @__PURE__ */ e(
416
- P,
417
- {
418
- isChecked: !m && n.sms_channel && !!r.phone,
419
- isDisabled: m || !r.phone,
420
- onToggle: () => p({
421
- ...n,
422
- sms_channel: !n.sms_channel
423
- }),
424
- primaryText: t.delivery_method_sms_label
425
- }
426
- ),
427
- i && l && /* @__PURE__ */ e(v, { sx: { ml: 48 } }),
428
- l && /* @__PURE__ */ e(
429
- P,
430
- {
431
- isChecked: !o && n.push_channel,
432
- isDisabled: o,
433
- onToggle: () => p({
434
- ...n,
435
- push_channel: !n.push_channel
436
- }),
437
- primaryText: t.delivery_method_push_label
438
- }
439
- )
440
- ] }) }),
441
- /* @__PURE__ */ e(v, {})
442
- ] }, n.guid);
443
- }), z = C(() => {
444
- const { budgetProfiles: n } = T();
445
- return /* @__PURE__ */ e(_, { children: n.map((t) => /* @__PURE__ */ e(q, { profile: t }, t.guid)) });
446
- }), Te = C(() => {
447
- const { onEvent: n } = ae(), { settings: t } = D(), {
448
- clientCommunicationProfile: s,
449
- updateUserCommunicationProfile: l,
450
- userCommunicationsProfile: i
451
- } = T(), { user: d } = w(), a = async (o, m) => {
452
- const r = { ...i, [o]: m };
453
- if (n) {
454
- const u = o.split("_")[3];
455
- m === !1 ? n("opt_in_notification_method", { notificationType: u }) : n("opt_out_notification_method", { notificationType: u });
456
- }
457
- await l(r);
458
- };
459
- return /* @__PURE__ */ c(_, { children: [
460
- /* @__PURE__ */ e(U, { sx: { mt: 24 }, children: t.delivery_method_title }),
461
- s.email_notifications_enabled && /* @__PURE__ */ c(M, { children: [
462
- /* @__PURE__ */ e(
463
- P,
464
- {
465
- isChecked: !!d.email && !i.opted_out_of_email_notifications,
466
- isDisabled: !d.email,
467
- onToggle: () => a(
468
- "opted_out_of_email_notifications",
469
- !i.opted_out_of_email_notifications
470
- ),
471
- primaryText: t.delivery_method_email_title,
472
- secondaryText: i.opted_out_of_email_notifications ? t.notification_disabled : t.notification_enabled,
473
- useExtraPadding: !1
474
- }
475
- ),
476
- (s.sms_notifications_enabled || s.push_notifications_enabled) && /* @__PURE__ */ e(v, {})
477
- ] }),
478
- s.sms_notifications_enabled && /* @__PURE__ */ c(M, { children: [
479
- /* @__PURE__ */ e(
480
- P,
481
- {
482
- isChecked: !!d.phone && !i.opted_out_of_sms_notifications,
483
- isDisabled: !d.phone,
484
- onToggle: () => a("opted_out_of_sms_notifications", !i.opted_out_of_sms_notifications),
485
- primaryText: t.delivery_method_sms_title,
486
- secondaryText: i.opted_out_of_sms_notifications ? t.notification_disabled : t.notification_enabled,
487
- useExtraPadding: !1
488
- }
489
- ),
490
- s.push_notifications_enabled && /* @__PURE__ */ e(v, {})
491
- ] }),
492
- s.push_notifications_enabled && /* @__PURE__ */ e(
493
- P,
494
- {
495
- isChecked: !i.opted_out_of_push_notifications,
496
- isDisabled: !0,
497
- onToggle: () => {
498
- },
499
- primaryText: t.delivery_method_push_title,
500
- secondaryText: t.delivery_method_push_subtitle,
501
- useExtraPadding: !1
502
- }
503
- ),
504
- s.sms_notifications_enabled && /* @__PURE__ */ e(ue, { sx: { backgroundColor: "background.default", mt: 12 }, variant: "outlined", children: /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ c(_, { alignItems: "flex-start", direction: "row", gap: 6, children: [
505
- /* @__PURE__ */ e(Q, { color: "primary", filled: !0 }),
506
- /* @__PURE__ */ e(x, { sx: { whiteSpace: "wrap" }, variant: "XSmall", children: t.delivery_method_sms_note_1 })
507
- ] }) }) })
508
- ] });
509
- }), $ = C(() => {
510
- const { insightsProfiles: n } = T();
511
- return /* @__PURE__ */ e(_, { children: n.map((t) => /* @__PURE__ */ e(q, { profile: t }, t.guid)) });
512
- }), Pe = () => {
513
- const { config: n } = W(), [t, { width: s }] = fe(), { common: l, settings: i } = D(), { updateUser: d } = T(), { user: a } = w(), [o, m] = f.useState(!1), [r, h] = f.useState({
514
- email: a.email,
515
- phone: a.phone
516
- }), u = r.email && !a.email_is_verified && !o, g = r.phone && !a.phone_is_verified && !o, p = (S) => {
517
- const { name: A, value: I } = S.target, j = { ...r, [A]: I };
518
- h(j), m(JSON.stringify({ ...a, ...j }) !== JSON.stringify(a));
519
- }, y = async () => {
520
- await d({ ...a, ...r }), m(!1);
521
- };
522
- return /* @__PURE__ */ c(_, { ref: t, children: [
523
- /* @__PURE__ */ e(v, {}),
524
- /* @__PURE__ */ c(_, { sx: { pt: 12 }, children: [
525
- /* @__PURE__ */ e(U, { sx: { lineHeight: "20px", pb: 4, pt: 16 }, children: i.personal_details }),
526
- /* @__PURE__ */ c(_, { sx: { flexDirection: s <= 768 ? "column" : "row", gap: 24, py: 16 }, children: [
527
- n.display_email_edit_field_in_settings && /* @__PURE__ */ c(_, { sx: { flex: 1, pb: 14 }, children: [
528
- /* @__PURE__ */ e(
529
- L,
530
- {
531
- defaultValue: a.email,
532
- fullWidth: !0,
533
- label: i.email_address,
534
- name: "email",
535
- onChange: p
536
- }
537
- ),
538
- u && /* @__PURE__ */ e(
539
- G,
540
- {
541
- sx: {
542
- height: 20,
543
- ".MuiButton-root": {
544
- px: 0,
545
- ":hover": {
546
- bgcolor: "transparent"
547
- }
548
- }
549
- },
550
- children: /* @__PURE__ */ e(ye, {})
551
- }
552
- )
553
- ] }),
554
- n.display_sms_edit_field_in_settings && /* @__PURE__ */ c(_, { sx: { flex: 1, pb: 14 }, children: [
555
- /* @__PURE__ */ e(
556
- L,
557
- {
558
- defaultValue: a.phone,
559
- fullWidth: !0,
560
- label: i.mobile_number,
561
- name: "phone",
562
- onChange: p
563
- }
564
- ),
565
- g && /* @__PURE__ */ e(
566
- G,
567
- {
568
- sx: {
569
- height: 20,
570
- ".MuiButton-root": {
571
- px: 0,
572
- ":hover": {
573
- bgcolor: "transparent"
574
- }
575
- }
576
- },
577
- children: /* @__PURE__ */ e(xe, {})
578
- }
579
- )
580
- ] })
581
- ] }),
582
- /* @__PURE__ */ e(
583
- R,
584
- {
585
- disabled: !o,
586
- onClick: y,
587
- sx: { width: 84 },
588
- variant: "contained",
589
- children: l.save_button
590
- }
591
- )
592
- ] })
593
- ] });
594
- }, De = C(Pe), st = C(
595
- ({
596
- notificationTypes: n = [b.Accounts, b.Budgets],
597
- showPersonalDetails: t = !1,
598
- view: s
599
- }) => {
600
- const { config: l } = W(), { settings: i } = D(), { isInitialized: d } = ce(), { clientCommunicationProfile: a, loadNotificationProfiles: o } = T(), [m, r] = f.useState(
601
- void 0
602
- );
603
- if (f.useEffect(() => {
604
- d && o().finally();
605
- }, [d]), !d)
606
- return /* @__PURE__ */ e(ge, {});
607
- let h = i.manage_account_notifications;
608
- m === b.Budgets ? h = i.manage_budget_notifications : m === b.Insights && (h = i.manage_insights_notifications);
609
- const {
610
- email_notifications_enabled: u,
611
- sms_notifications_enabled: g,
612
- push_notifications_enabled: p
613
- } = a, y = u || g || p;
614
- if (s === "accounts")
615
- return /* @__PURE__ */ e(H, {});
616
- if (s === "budgets")
617
- return /* @__PURE__ */ e(z, {});
618
- if (s === "insights")
619
- return /* @__PURE__ */ e($, {});
620
- const S = l.display_email_edit_field_in_settings || l.display_sms_edit_field_in_settings, A = t && a.can_edit_contact_info && S;
621
- return /* @__PURE__ */ c(_, { sx: { pt: y ? 0 : 24 }, children: [
622
- /* @__PURE__ */ c(_, { sx: { px: 24 }, children: [
623
- y && /* @__PURE__ */ c(M, { children: [
624
- /* @__PURE__ */ e(Te, {}),
625
- /* @__PURE__ */ e(v, { sx: { my: 24 } })
626
- ] }),
627
- /* @__PURE__ */ e(U, { sx: { mb: 4 }, children: i.notification_types_title })
628
- ] }),
629
- /* @__PURE__ */ c(E, { children: [
630
- n.includes(b.Accounts) && /* @__PURE__ */ e(O, { children: /* @__PURE__ */ c(V, { onClick: () => r(b.Accounts), children: [
631
- /* @__PURE__ */ e(N, { primary: i.accounts_title, secondary: i.accounts_subtitle }),
632
- /* @__PURE__ */ e(k, {})
633
- ] }) }),
634
- n.includes(b.Budgets) && /* @__PURE__ */ e(O, { children: /* @__PURE__ */ c(V, { onClick: () => r(b.Budgets), children: [
635
- /* @__PURE__ */ e(N, { primary: i.budgets_title, secondary: i.budgets_subtitle }),
636
- /* @__PURE__ */ e(k, {})
637
- ] }) }),
638
- n.includes(b.Insights) && /* @__PURE__ */ e(O, { children: /* @__PURE__ */ c(V, { onClick: () => r(b.Insights), children: [
639
- /* @__PURE__ */ e(N, { primary: i.insights_title, secondary: i.insights_subtitle }),
640
- /* @__PURE__ */ e(k, {})
641
- ] }) })
642
- ] }),
643
- A && /* @__PURE__ */ e(_, { sx: { px: 24 }, children: /* @__PURE__ */ e(De, {}) }),
644
- /* @__PURE__ */ e(
645
- J,
646
- {
647
- isOpen: !!m,
648
- onClose: () => r(void 0),
649
- title: h,
650
- children: /* @__PURE__ */ c(_, { children: [
651
- m === b.Accounts && /* @__PURE__ */ e(H, {}),
652
- m === b.Budgets && /* @__PURE__ */ e(z, {}),
653
- m === b.Insights && /* @__PURE__ */ e($, {})
654
- ] })
655
- }
656
- )
657
- ] });
658
- }
659
- );
660
- export {
661
- H as A,
662
- z as B,
663
- $ as I,
664
- st as N,
665
- ye as V,
666
- xe as a
667
- };