@mx-cartographer/experiences 7.2.15-alpha.sms4 → 7.2.16-alpha.mm0

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.
@@ -1,56 +1,56 @@
1
- import { jsxs as l, jsx as e, Fragment as B } from "react/jsx-runtime";
2
- import f from "react";
1
+ import { jsxs as l, jsx as e, Fragment as M } from "react/jsx-runtime";
2
+ import g from "react";
3
3
  import { observer as C } from "mobx-react-lite";
4
4
  import v from "@mui/material/Divider";
5
5
  import E from "@mui/material/List";
6
6
  import O from "@mui/material/ListItem";
7
- import N from "@mui/material/ListItemText";
7
+ import L from "@mui/material/ListItemText";
8
8
  import V from "@mui/material/ListItemButton";
9
9
  import m from "@mui/material/Stack";
10
10
  import { ChevronRight as w, ExpandMore as K, Star as Q } from "@mxenabled/mx-icons";
11
- import { Text as x, InstitutionLogo as Y, H3 as U } from "@mxenabled/mxui";
11
+ import { Text as x, InstitutionLogo as Y, H3 as F } from "@mxenabled/mxui";
12
12
  import { endOfMonth as Z } from "date-fns/endOfMonth";
13
13
  import { startOfMonth as ee } from "date-fns/startOfMonth";
14
14
  import { DateCalendar as te } from "@mui/x-date-pickers/DateCalendar";
15
15
  import { LocalizationProvider as ne } from "@mui/x-date-pickers/LocalizationProvider";
16
16
  import { AdapterDateFns as ie } from "@mui/x-date-pickers/AdapterDateFnsV3";
17
- import { A as oe, T as F, a as P, N as y } from "./ToggleListItem-r0Kx56wF.mjs";
18
- import { u as D, s as T, p as A, d as se, g as ae, a as W, b as le } from "./hooks-D6XlXHf4.mjs";
19
- import { b as ce } from "./Localization-2MODESHW.mjs";
20
- import { b as re, f as de } from "./NumberFormatting-Buh7u8Oi.mjs";
21
- import { a as M } from "./Dialog-CWW597AF.mjs";
22
- import { C as me } from "./CurrencyInput-DUsQbkXb.mjs";
23
- import { u as he } from "./useScreenSize-B6JyS_Lj.mjs";
17
+ import { A as oe, T as R, a as P, N as y } from "./ToggleListItem-r0Kx56wF.mjs";
18
+ import { u as D, s as T, p as I, d as se, g as ae, a as W, n as ce, b as le } from "./hooks-D6XlXHf4.mjs";
19
+ import { b as re } from "./Localization-2MODESHW.mjs";
20
+ import { b as de, f as me } from "./NumberFormatting-Buh7u8Oi.mjs";
21
+ import { a as N } from "./Dialog-CWW597AF.mjs";
22
+ import { C as he } from "./CurrencyInput-DUsQbkXb.mjs";
23
+ import { u as _e } from "./useScreenSize-B6JyS_Lj.mjs";
24
24
  import { D as J } from "./Drawer-kEE73B87.mjs";
25
- import _e from "@mui/material/Collapse";
26
- import ue from "@mui/material/Card";
27
- import pe from "@mui/material/CardContent";
25
+ import ue from "@mui/material/Collapse";
26
+ import pe from "@mui/material/Card";
27
+ import fe from "@mui/material/CardContent";
28
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";
29
+ import j from "@mui/material/Button";
30
+ import U from "@mui/material/TextField";
31
+ import { u as ge } from "./useDimensions-27p2evRx.mjs";
32
32
  import X from "@mui/material/styles/useTheme";
33
- import { u as ge } from "./useInsightsEnabled-DBpwEq10.mjs";
34
- import { L as ye } from "./Loader-DUaFpDGv.mjs";
35
- const be = C(() => {
36
- const { common: n, settings: t } = D(), { sendEmailVerification: s } = T(), { user: c } = A(), i = X(), [d, a] = f.useState(!1), o = () => {
33
+ import { u as ye } from "./useInsightsEnabled-DBpwEq10.mjs";
34
+ import { L as be } from "./Loader-DUaFpDGv.mjs";
35
+ const xe = C(() => {
36
+ const { common: n, settings: t } = D(), { sendEmailVerification: o } = T(), { user: r } = I(), s = X(), [c, a] = g.useState(!1), i = () => {
37
37
  a(!1);
38
- }, h = () => {
38
+ }, _ = () => {
39
39
  a(!0);
40
40
  };
41
- return /* @__PURE__ */ l(f.Fragment, { children: [
42
- /* @__PURE__ */ l(R, { onClick: h, sx: { height: "auto", p: 4, width: "fit-content" }, children: [
41
+ return /* @__PURE__ */ l(g.Fragment, { children: [
42
+ /* @__PURE__ */ l(j, { onClick: _, sx: { height: "auto", p: 4, width: "fit-content" }, children: [
43
43
  /* @__PURE__ */ e(x, { variant: "Small", children: t.verify_email }),
44
44
  /* @__PURE__ */ e(w, {})
45
45
  ] }),
46
46
  /* @__PURE__ */ e(
47
- M,
47
+ N,
48
48
  {
49
49
  copy: { title: "" },
50
- isOpen: d,
51
- onClose: o,
52
- onPrimaryAction: s,
53
- onSecondaryAction: o,
50
+ isOpen: c,
51
+ onClose: i,
52
+ onPrimaryAction: o,
53
+ onSecondaryAction: i,
54
54
  primaryText: t.send_verification,
55
55
  secondaryText: n.back,
56
56
  sx: {
@@ -68,12 +68,12 @@ const be = C(() => {
68
68
  x,
69
69
  {
70
70
  sx: {
71
- border: `1px solid ${i.palette.border.light}`,
71
+ border: `1px solid ${s.palette.border.light}`,
72
72
  borderRadius: "4px",
73
73
  p: "16px 32px"
74
74
  },
75
75
  variant: "H3",
76
- children: c.email
76
+ children: r.email
77
77
  }
78
78
  ),
79
79
  /* @__PURE__ */ e(x, { truncate: !1, variant: "Small", children: t.verification_notice_email })
@@ -81,19 +81,19 @@ const be = C(() => {
81
81
  }
82
82
  )
83
83
  ] });
84
- }), xe = C(
85
- ({ handleClose: n, handleVerify: t, isOpen: s }) => {
86
- const { common: c, settings: i } = D(), [d, a] = f.useState("");
84
+ }), Ce = C(
85
+ ({ handleClose: n, handleVerify: t, isOpen: o }) => {
86
+ const { common: r, settings: s } = D(), [c, a] = g.useState("");
87
87
  return /* @__PURE__ */ e(
88
- M,
88
+ N,
89
89
  {
90
- copy: { title: i.enter_verification_code },
91
- isOpen: s,
90
+ copy: { title: s.enter_verification_code },
91
+ isOpen: o,
92
92
  onClose: n,
93
- onPrimaryAction: () => t(d),
93
+ onPrimaryAction: () => t(c),
94
94
  onSecondaryAction: n,
95
- primaryText: i.verify,
96
- secondaryText: c.cancel_button,
95
+ primaryText: s.verify,
96
+ secondaryText: r.cancel_button,
97
97
  sx: {
98
98
  "& .MuiDialogContent-root": { pt: 0, width: 400 },
99
99
  "& .MuiToolbar-root:last-child": {
@@ -102,37 +102,37 @@ const be = C(() => {
102
102
  justifyContent: "flex-end"
103
103
  }
104
104
  },
105
- children: /* @__PURE__ */ e(m, { children: /* @__PURE__ */ e(L, { onChange: (o) => a(o.target.value), sx: { width: 352 }, value: d }) })
105
+ children: /* @__PURE__ */ e(m, { children: /* @__PURE__ */ e(U, { onChange: (i) => a(i.target.value), sx: { width: 352 }, value: c }) })
106
106
  }
107
107
  );
108
108
  }
109
- ), Ce = C(() => {
110
- const { common: n, settings: t } = D(), { sendPhoneVerification: s, verifyPhoneToken: c } = T(), { user: i } = A(), d = X(), [a, o] = f.useState(!1), [h, r] = f.useState(!1), _ = () => {
111
- o(!1);
109
+ ), ve = C(() => {
110
+ const { common: n, settings: t } = D(), { sendPhoneVerification: o, verifyPhoneToken: r } = T(), { user: s } = I(), c = X(), [a, i] = g.useState(!1), [_, d] = g.useState(!1), h = () => {
111
+ i(!1);
112
112
  }, u = () => {
113
- o(!0);
114
- }, g = () => {
115
- s().finally(() => {
116
- r(!0);
113
+ i(!0);
114
+ }, f = () => {
115
+ o().finally(() => {
116
+ d(!0);
117
117
  });
118
118
  }, p = (b) => {
119
- c(b).finally(() => {
120
- r(!1);
119
+ r(b).finally(() => {
120
+ d(!1);
121
121
  });
122
122
  };
123
- return /* @__PURE__ */ l(f.Fragment, { children: [
124
- /* @__PURE__ */ l(R, { onClick: u, sx: { height: "auto", p: 4, width: "fit-content" }, children: [
123
+ return /* @__PURE__ */ l(g.Fragment, { children: [
124
+ /* @__PURE__ */ l(j, { onClick: u, sx: { height: "auto", p: 4, width: "fit-content" }, children: [
125
125
  /* @__PURE__ */ e(x, { variant: "Small", children: t.verify_phone }),
126
126
  /* @__PURE__ */ e(w, {})
127
127
  ] }),
128
128
  /* @__PURE__ */ e(
129
- M,
129
+ N,
130
130
  {
131
131
  copy: { title: "" },
132
132
  isOpen: a,
133
- onClose: _,
134
- onPrimaryAction: g,
135
- onSecondaryAction: _,
133
+ onClose: h,
134
+ onPrimaryAction: f,
135
+ onSecondaryAction: h,
136
136
  primaryText: t.send_verification,
137
137
  secondaryText: n.back,
138
138
  sx: {
@@ -150,12 +150,12 @@ const be = C(() => {
150
150
  x,
151
151
  {
152
152
  sx: {
153
- border: `1px solid ${d.palette.border.light}`,
153
+ border: `1px solid ${c.palette.border.light}`,
154
154
  borderRadius: "4px",
155
155
  p: "16px 32px"
156
156
  },
157
157
  variant: "H3",
158
- children: i.phone
158
+ children: s.phone
159
159
  }
160
160
  ),
161
161
  /* @__PURE__ */ e(x, { truncate: !1, variant: "Small", children: t.verification_notice_phone })
@@ -163,27 +163,27 @@ const be = C(() => {
163
163
  }
164
164
  ),
165
165
  /* @__PURE__ */ e(
166
- xe,
166
+ Ce,
167
167
  {
168
- handleClose: () => r(!1),
168
+ handleClose: () => d(!1),
169
169
  handleVerify: p,
170
- isOpen: h
170
+ isOpen: _
171
171
  }
172
172
  )
173
173
  ] });
174
- }), ve = C(
174
+ }), Te = C(
175
175
  ({ onProfileUpdated: n, profile: t }) => {
176
- const { common: s, recurring: c, settings: i } = D(), { updateAccount: d } = se(), a = t.notification_type === oe.DebtPaymentReminder, [o, h] = f.useState(!1), [r, _] = f.useState(t.threshold || 0), [u, g] = f.useState(
176
+ const { common: o, recurring: r, settings: s } = D(), { updateAccount: c } = se(), a = t.notification_type === oe.DebtPaymentReminder, [i, _] = g.useState(!1), [d, h] = g.useState(t.threshold || 0), [u, f] = g.useState(
177
177
  t.account?.day_payment_is_due || 0
178
- ), p = t.account?.name || t.account?.feed_name || "", b = t.account?.day_payment_is_due ? ce(
179
- i.notification_debt_payment_date,
180
- re(t.account?.day_payment_is_due)
181
- ) : i.notification_debt_payment_zero_state, S = a ? b : de(t.threshold ?? 0, "0,0"), I = async () => {
182
- a && t.account ? await d({ ...t.account, day_payment_is_due: u }) : n({ ...t, threshold: r });
178
+ ), p = t.account?.name || t.account?.feed_name || "", b = t.account?.day_payment_is_due ? re(
179
+ s.notification_debt_payment_date,
180
+ de(t.account?.day_payment_is_due)
181
+ ) : s.notification_debt_payment_zero_state, S = a ? b : me(t.threshold ?? 0, "0,0"), A = async () => {
182
+ a && t.account ? await c({ ...t.account, day_payment_is_due: u }) : n({ ...t, threshold: d });
183
183
  };
184
184
  return /* @__PURE__ */ l(m, { children: [
185
185
  /* @__PURE__ */ e(
186
- F,
186
+ R,
187
187
  {
188
188
  avatar: t.account?.institution_guid ? /* @__PURE__ */ e(
189
189
  Y,
@@ -195,7 +195,7 @@ const be = C(() => {
195
195
  endIcon: /* @__PURE__ */ e(w, {}),
196
196
  isChecked: t.is_enabled,
197
197
  isPrimaryTextBold: !0,
198
- onClick: () => h(!0),
198
+ onClick: () => _(!0),
199
199
  onToggle: () => n({
200
200
  ...t,
201
201
  is_enabled: !t.is_enabled
@@ -205,24 +205,24 @@ const be = C(() => {
205
205
  }
206
206
  ),
207
207
  /* @__PURE__ */ e(
208
- M,
208
+ N,
209
209
  {
210
210
  copy: {
211
- title: a ? c.day_of_the_month : i.notification_threshold_label,
212
- close_aria: s.close_aria
211
+ title: a ? r.day_of_the_month : s.notification_threshold_label,
212
+ close_aria: o.close_aria
213
213
  },
214
214
  disablePrimaryButton: a && u === 0,
215
- isOpen: o,
216
- onClose: () => h(!1),
217
- onPrimaryAction: I,
218
- primaryText: s.save_button,
215
+ isOpen: i,
216
+ onClose: () => _(!1),
217
+ onPrimaryAction: A,
218
+ primaryText: o.save_button,
219
219
  children: a ? /* @__PURE__ */ e(ne, { dateAdapter: ie, children: /* @__PURE__ */ e(
220
220
  te,
221
221
  {
222
222
  maxDate: Z(/* @__PURE__ */ new Date()),
223
223
  minDate: ee(/* @__PURE__ */ new Date()),
224
224
  onChange: (k) => {
225
- g(k.getDate());
225
+ f(k.getDate());
226
226
  },
227
227
  slots: {
228
228
  // Hides the arrows
@@ -238,13 +238,13 @@ const be = C(() => {
238
238
  views: ["day"]
239
239
  }
240
240
  ) }) : /* @__PURE__ */ e(
241
- me,
241
+ he,
242
242
  {
243
- amount: r,
243
+ amount: d,
244
244
  autoFocus: !0,
245
245
  fullWidth: !0,
246
246
  minAmount: 0,
247
- setAmount: (k) => _(Number(k) || 0),
247
+ setAmount: (k) => h(Number(k) || 0),
248
248
  sx: { ".MuiTypography-Body": { p: 0 } }
249
249
  }
250
250
  )
@@ -252,63 +252,63 @@ const be = C(() => {
252
252
  )
253
253
  ] });
254
254
  }
255
- ), Te = C(
255
+ ), Pe = C(
256
256
  ({ onUpdateProfile: n, profile: t }) => {
257
- const { settings: s } = D(), { user: c } = A(), { clientCommunicationProfile: i, userCommunicationsProfile: d } = T(), { isMobile: a } = he(), o = t.notification_type > 2, {
258
- opted_out_of_email_notifications: h,
259
- opted_out_of_push_notifications: r,
260
- opted_out_of_sms_notifications: _
261
- } = d, {
257
+ const { settings: o } = D(), { user: r } = I(), { clientCommunicationProfile: s, userCommunicationsProfile: c } = T(), { isMobile: a } = _e(), i = t.notification_type > 2, {
258
+ opted_out_of_email_notifications: _,
259
+ opted_out_of_push_notifications: d,
260
+ opted_out_of_sms_notifications: h
261
+ } = c, {
262
262
  email_notifications_enabled: u,
263
- push_notifications_enabled: g,
263
+ push_notifications_enabled: f,
264
264
  sms_notifications_enabled: p
265
- } = i;
265
+ } = s;
266
266
  return /* @__PURE__ */ l(m, { children: [
267
- (u || p || g) && /* @__PURE__ */ l(B, { children: [
268
- /* @__PURE__ */ e(x, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "caption", children: s.delivery_method_title }),
267
+ (u || p || f) && /* @__PURE__ */ l(M, { children: [
268
+ /* @__PURE__ */ e(x, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "caption", children: o.delivery_method_title }),
269
269
  /* @__PURE__ */ l(E, { sx: { bgcolor: "background.paper" }, children: [
270
270
  u && /* @__PURE__ */ e(m, { sx: { pl: 24 }, children: /* @__PURE__ */ e(
271
271
  P,
272
272
  {
273
- isChecked: !h && t.email_channel && !!c.email,
274
- isDisabled: h || !c.email,
273
+ isChecked: !_ && t.email_channel && !!r.email,
274
+ isDisabled: _ || !r.email,
275
275
  onToggle: () => n({ ...t, email_channel: !t.email_channel }),
276
- primaryText: s.delivery_method_email_label,
277
- secondaryText: h || !t.email_channel || !c.email ? s.notification_disabled : s.notification_enabled,
276
+ primaryText: o.delivery_method_email_label,
277
+ secondaryText: _ || !t.email_channel || !r.email ? o.notification_disabled : o.notification_enabled,
278
278
  useExtraPadding: !1
279
279
  }
280
280
  ) }),
281
- u && (p || g) && /* @__PURE__ */ e(v, { sx: { ml: a ? 0 : 24 } }),
281
+ u && (p || f) && /* @__PURE__ */ e(v, { sx: { ml: a ? 0 : 24 } }),
282
282
  p && /* @__PURE__ */ e(m, { sx: { pl: 24 }, children: /* @__PURE__ */ e(
283
283
  P,
284
284
  {
285
- isChecked: !_ && t.sms_channel && !!c.phone,
286
- isDisabled: _ || !c.phone,
285
+ isChecked: !h && t.sms_channel && !!r.phone,
286
+ isDisabled: h || !r.phone,
287
287
  onToggle: () => n({ ...t, sms_channel: !t.sms_channel }),
288
- primaryText: `${s.delivery_method_sms_label}`,
289
- secondaryText: _ || !t.sms_channel || !c.phone ? s.notification_disabled : s.notification_enabled,
288
+ primaryText: `${o.delivery_method_sms_label}`,
289
+ secondaryText: h || !t.sms_channel || !r.phone ? o.notification_disabled : o.notification_enabled,
290
290
  useExtraPadding: !1
291
291
  }
292
292
  ) }),
293
- p && g && /* @__PURE__ */ e(v, { sx: { ml: a ? 0 : 24 } }),
294
- g && /* @__PURE__ */ e(m, { sx: { pl: 24 }, children: /* @__PURE__ */ e(
293
+ p && f && /* @__PURE__ */ e(v, { sx: { ml: a ? 0 : 24 } }),
294
+ f && /* @__PURE__ */ e(m, { sx: { pl: 24 }, children: /* @__PURE__ */ e(
295
295
  P,
296
296
  {
297
- isChecked: !r && t.push_channel,
298
- isDisabled: r,
297
+ isChecked: !d && t.push_channel,
298
+ isDisabled: d,
299
299
  onToggle: () => n({ ...t, push_channel: !t.push_channel }),
300
- primaryText: s.delivery_method_push_label,
301
- secondaryText: s.delivery_method_push_subtitle,
300
+ primaryText: o.delivery_method_push_label,
301
+ secondaryText: o.delivery_method_push_subtitle,
302
302
  useExtraPadding: !1
303
303
  }
304
304
  ) }),
305
305
  /* @__PURE__ */ e(v, {})
306
306
  ] })
307
307
  ] }),
308
- o && !!t.children?.length && /* @__PURE__ */ l(m, { children: [
309
- /* @__PURE__ */ e(x, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "caption", children: s.accounts_threshold_title }),
308
+ i && !!t.children?.length && /* @__PURE__ */ l(m, { children: [
309
+ /* @__PURE__ */ e(x, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "caption", children: o.accounts_threshold_title }),
310
310
  /* @__PURE__ */ e(E, { sx: { bgcolor: "background.paper" }, children: t.children?.map((b) => /* @__PURE__ */ e(
311
- ve,
311
+ Te,
312
312
  {
313
313
  onProfileUpdated: n,
314
314
  profile: b
@@ -319,42 +319,42 @@ const be = C(() => {
319
319
  ] });
320
320
  }
321
321
  ), H = C(() => {
322
- const { accountProfiles: n, updateNotificationProfile: t } = T(), [s, c] = f.useState(""), i = f.useMemo(
323
- () => n.find((o) => o.guid === s),
324
- [n, s]
325
- ), d = async (o) => {
322
+ const { accountProfiles: n, updateNotificationProfile: t } = T(), [o, r] = g.useState(""), s = g.useMemo(
323
+ () => n.find((i) => i.guid === o),
324
+ [n, o]
325
+ ), c = async (i) => {
326
326
  await t({
327
- ...o,
328
- is_enabled: !o.is_enabled
327
+ ...i,
328
+ is_enabled: !i.is_enabled
329
329
  });
330
- }, a = async (o) => {
331
- await t(o);
330
+ }, a = async (i) => {
331
+ await t(i);
332
332
  };
333
333
  return /* @__PURE__ */ l(m, { sx: { backgroundColor: "background.paper" }, children: [
334
- n.filter((o) => o.children && o.children.length > 0).map((o) => /* @__PURE__ */ e(
335
- F,
334
+ n.filter((i) => i.children && i.children.length > 0).map((i) => /* @__PURE__ */ e(
335
+ R,
336
336
  {
337
337
  endIcon: /* @__PURE__ */ e(w, {}),
338
- isChecked: o.is_enabled,
339
- isDisabled: !o.is_enabled,
340
- onClick: () => c(o.guid),
341
- onToggle: () => d(o),
342
- primaryText: o.label,
343
- secondaryText: o.is_enabled ? o.deliveryMethodsLabel : void 0
338
+ isChecked: i.is_enabled,
339
+ isDisabled: !i.is_enabled,
340
+ onClick: () => r(i.guid),
341
+ onToggle: () => c(i),
342
+ primaryText: i.label,
343
+ secondaryText: i.is_enabled ? i.deliveryMethodsLabel : void 0
344
344
  },
345
- o.guid
345
+ i.guid
346
346
  )),
347
347
  /* @__PURE__ */ e(
348
348
  J,
349
349
  {
350
- isOpen: !!i,
351
- onClose: () => c(""),
352
- title: i ? i.label : "",
353
- children: i && /* @__PURE__ */ e(
354
- Te,
350
+ isOpen: !!s,
351
+ onClose: () => r(""),
352
+ title: s ? s.label : "",
353
+ children: s && /* @__PURE__ */ e(
354
+ Pe,
355
355
  {
356
356
  onUpdateProfile: a,
357
- profile: i
357
+ profile: s
358
358
  }
359
359
  )
360
360
  }
@@ -363,49 +363,49 @@ const be = C(() => {
363
363
  }), q = C(({ profile: n }) => {
364
364
  const { settings: t } = D(), {
365
365
  clientCommunicationProfile: {
366
- email_notifications_enabled: s,
367
- push_notifications_enabled: c,
368
- sms_notifications_enabled: i
366
+ email_notifications_enabled: o,
367
+ push_notifications_enabled: r,
368
+ sms_notifications_enabled: s
369
369
  },
370
- updateNotificationProfile: d,
370
+ updateNotificationProfile: c,
371
371
  userCommunicationsProfile: {
372
372
  opted_out_of_email_notifications: a,
373
- opted_out_of_push_notifications: o,
374
- opted_out_of_sms_notifications: h
373
+ opted_out_of_push_notifications: i,
374
+ opted_out_of_sms_notifications: _
375
375
  }
376
- } = T(), { user: r } = A(), [_, u] = f.useState(!1), g = async () => {
376
+ } = T(), { user: d } = I(), [h, u] = g.useState(!1), f = async () => {
377
377
  await p({ ...n, is_enabled: !n.is_enabled }), n.is_enabled && u(!1);
378
378
  }, p = async (S) => {
379
- await d(S);
380
- }, b = s || i || c;
379
+ await c(S);
380
+ }, b = o || s || r;
381
381
  return /* @__PURE__ */ l(E, { sx: { bgcolor: "background.paper" }, children: [
382
382
  /* @__PURE__ */ e(
383
- F,
383
+ R,
384
384
  {
385
385
  endIcon: b ? /* @__PURE__ */ e(
386
386
  K,
387
387
  {
388
388
  sx: {
389
389
  transition: "transform 0.3s ease-in-out",
390
- transform: _ ? "rotate(180deg)" : "rotate(0deg)"
390
+ transform: h ? "rotate(180deg)" : "rotate(0deg)"
391
391
  }
392
392
  }
393
393
  ) : void 0,
394
394
  isChecked: n.is_enabled,
395
395
  isDisabled: !n.is_enabled,
396
- onClick: () => u(!_),
397
- onToggle: () => g(),
396
+ onClick: () => u(!h),
397
+ onToggle: () => f(),
398
398
  primaryText: n.label,
399
399
  secondaryText: n.is_enabled ? n.deliveryMethodsLabel : void 0
400
400
  },
401
401
  n.guid
402
402
  ),
403
- b && /* @__PURE__ */ e(_e, { in: _, children: /* @__PURE__ */ l(E, { sx: { bgcolor: "background.paper" }, children: [
404
- s && /* @__PURE__ */ e(
403
+ b && /* @__PURE__ */ e(ue, { in: h, children: /* @__PURE__ */ l(E, { sx: { bgcolor: "background.paper" }, children: [
404
+ o && /* @__PURE__ */ e(
405
405
  P,
406
406
  {
407
- isChecked: !a && n.email_channel && !!r.email,
408
- isDisabled: a || !r.email,
407
+ isChecked: !a && n.email_channel && !!d.email,
408
+ isDisabled: a || !d.email,
409
409
  onToggle: () => p({
410
410
  ...n,
411
411
  email_channel: !n.email_channel
@@ -413,12 +413,12 @@ const be = C(() => {
413
413
  primaryText: t.delivery_method_email_label
414
414
  }
415
415
  ),
416
- s && (i || c) && /* @__PURE__ */ e(v, { sx: { ml: 48 } }),
417
- i && /* @__PURE__ */ e(
416
+ o && (s || r) && /* @__PURE__ */ e(v, { sx: { ml: 48 } }),
417
+ s && /* @__PURE__ */ e(
418
418
  P,
419
419
  {
420
- isChecked: !h && n.sms_channel && !!r.phone,
421
- isDisabled: h || !r.phone,
420
+ isChecked: !_ && n.sms_channel && !!d.phone,
421
+ isDisabled: _ || !d.phone,
422
422
  onToggle: () => p({
423
423
  ...n,
424
424
  sms_channel: !n.sms_channel
@@ -426,12 +426,12 @@ const be = C(() => {
426
426
  primaryText: t.delivery_method_sms_label
427
427
  }
428
428
  ),
429
- i && c && /* @__PURE__ */ e(v, { sx: { ml: 48 } }),
430
- c && /* @__PURE__ */ e(
429
+ s && r && /* @__PURE__ */ e(v, { sx: { ml: 48 } }),
430
+ r && /* @__PURE__ */ e(
431
431
  P,
432
432
  {
433
- isChecked: !o && n.push_channel,
434
- isDisabled: o,
433
+ isChecked: !i && n.push_channel,
434
+ isDisabled: i,
435
435
  onToggle: () => p({
436
436
  ...n,
437
437
  push_channel: !n.push_channel
@@ -445,56 +445,56 @@ const be = C(() => {
445
445
  }), z = C(() => {
446
446
  const { budgetProfiles: n } = T();
447
447
  return /* @__PURE__ */ e(m, { children: n.map((t) => /* @__PURE__ */ e(q, { profile: t }, t.guid)) });
448
- }), Pe = C(() => {
448
+ }), De = C(() => {
449
449
  const { onEvent: n } = ae(), { settings: t } = D(), {
450
- clientCommunicationProfile: s,
451
- updateUserCommunicationProfile: c,
452
- userCommunicationsProfile: i
453
- } = T(), { user: d } = A(), a = async (o, h) => {
454
- const r = { ...i, [o]: h };
450
+ clientCommunicationProfile: o,
451
+ updateUserCommunicationProfile: r,
452
+ userCommunicationsProfile: s
453
+ } = T(), { user: c } = I(), a = async (i, _) => {
454
+ const d = { ...s, [i]: _ };
455
455
  if (n) {
456
- const u = o.split("_")[3];
457
- h === !1 ? n("opt_in_notification_method", { notificationType: u }) : n("opt_out_notification_method", { notificationType: u });
456
+ const u = i.split("_")[3];
457
+ _ === !1 ? n("opt_in_notification_method", { notificationType: u }) : n("opt_out_notification_method", { notificationType: u });
458
458
  }
459
- await c(r);
459
+ await r(d);
460
460
  };
461
461
  return /* @__PURE__ */ l(m, { children: [
462
- /* @__PURE__ */ e(U, { sx: { mt: 24 }, children: t.delivery_method_title }),
463
- s.email_notifications_enabled && /* @__PURE__ */ l(B, { children: [
462
+ /* @__PURE__ */ e(F, { sx: { mt: 24 }, children: t.delivery_method_title }),
463
+ o.email_notifications_enabled && /* @__PURE__ */ l(M, { children: [
464
464
  /* @__PURE__ */ e(
465
465
  P,
466
466
  {
467
- isChecked: !!d.email && !i.opted_out_of_email_notifications,
468
- isDisabled: !d.email,
467
+ isChecked: !!c.email && !s.opted_out_of_email_notifications,
468
+ isDisabled: !c.email,
469
469
  onToggle: () => a(
470
470
  "opted_out_of_email_notifications",
471
- !i.opted_out_of_email_notifications
471
+ !s.opted_out_of_email_notifications
472
472
  ),
473
473
  primaryText: t.delivery_method_email_title,
474
- secondaryText: d.email && !i.opted_out_of_email_notifications ? t.notification_enabled : t.notification_disabled,
474
+ secondaryText: c.email && !s.opted_out_of_email_notifications ? t.notification_enabled : t.notification_disabled,
475
475
  useExtraPadding: !1
476
476
  }
477
477
  ),
478
- (s.sms_notifications_enabled || s.push_notifications_enabled) && /* @__PURE__ */ e(v, {})
478
+ (o.sms_notifications_enabled || o.push_notifications_enabled) && /* @__PURE__ */ e(v, {})
479
479
  ] }),
480
- s.sms_notifications_enabled && /* @__PURE__ */ l(B, { children: [
480
+ o.sms_notifications_enabled && /* @__PURE__ */ l(M, { children: [
481
481
  /* @__PURE__ */ e(
482
482
  P,
483
483
  {
484
- isChecked: !!d.phone && !i.opted_out_of_sms_notifications,
485
- isDisabled: !d.phone,
486
- onToggle: () => a("opted_out_of_sms_notifications", !i.opted_out_of_sms_notifications),
484
+ isChecked: !!c.phone && !s.opted_out_of_sms_notifications,
485
+ isDisabled: !c.phone,
486
+ onToggle: () => a("opted_out_of_sms_notifications", !s.opted_out_of_sms_notifications),
487
487
  primaryText: t.delivery_method_sms_title,
488
- secondaryText: d.phone && !i.opted_out_of_sms_notifications ? t.notification_enabled : t.notification_disabled,
488
+ secondaryText: c.phone && !s.opted_out_of_sms_notifications ? t.notification_enabled : t.notification_disabled,
489
489
  useExtraPadding: !1
490
490
  }
491
491
  ),
492
- s.push_notifications_enabled && /* @__PURE__ */ e(v, {})
492
+ o.push_notifications_enabled && /* @__PURE__ */ e(v, {})
493
493
  ] }),
494
- s.push_notifications_enabled && /* @__PURE__ */ e(
494
+ o.push_notifications_enabled && /* @__PURE__ */ e(
495
495
  P,
496
496
  {
497
- isChecked: !i.opted_out_of_push_notifications,
497
+ isChecked: !s.opted_out_of_push_notifications,
498
498
  isDisabled: !0,
499
499
  onToggle: () => {
500
500
  },
@@ -503,7 +503,7 @@ const be = C(() => {
503
503
  useExtraPadding: !1
504
504
  }
505
505
  ),
506
- s.sms_notifications_enabled && /* @__PURE__ */ e(ue, { sx: { backgroundColor: "background.default", mt: 12 }, variant: "outlined", children: /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ l(m, { alignItems: "flex-start", direction: "row", gap: 6, children: [
506
+ o.sms_notifications_enabled && /* @__PURE__ */ e(pe, { sx: { backgroundColor: "background.default", mt: 12 }, variant: "outlined", children: /* @__PURE__ */ e(fe, { children: /* @__PURE__ */ l(m, { alignItems: "flex-start", direction: "row", gap: 6, children: [
507
507
  /* @__PURE__ */ e(Q, { color: "primary", filled: !0 }),
508
508
  /* @__PURE__ */ e(x, { sx: { whiteSpace: "wrap" }, variant: "XSmall", children: t.delivery_method_sms_note_1 })
509
509
  ] }) }) })
@@ -511,28 +511,28 @@ const be = C(() => {
511
511
  }), $ = C(() => {
512
512
  const { insightsProfiles: n } = T();
513
513
  return /* @__PURE__ */ e(m, { children: n.map((t) => /* @__PURE__ */ e(q, { profile: t }, t.guid)) });
514
- }), De = () => {
515
- const { config: n } = W(), [t, { width: s }] = fe(), { common: c, settings: i } = D(), { updateUser: d } = T(), { user: a } = A(), [o, h] = f.useState(!1), [r, _] = f.useState({
514
+ }), Se = () => {
515
+ const { config: n } = W(), [t, { width: o }] = ge(), { common: r, settings: s } = D(), { updateUser: c } = T(), { user: a } = I(), [i, _] = g.useState(!1), [d, h] = g.useState({
516
516
  email: a.email,
517
517
  phone: a.phone
518
- }), u = r.email && !a.email_is_verified && !o, g = r.phone && !a.phone_is_verified && !o, p = (S) => {
519
- const { name: I, value: k } = S.target, j = { ...r, [I]: k };
520
- _(j), h(JSON.stringify({ ...a, ...j }) !== JSON.stringify(a));
518
+ }), u = d.email && !a.email_is_verified && !i, f = d.phone && !a.phone_is_verified && !i, p = (S) => {
519
+ const { name: A, value: k } = S.target, B = { ...d, [A]: k };
520
+ h(B), _(JSON.stringify({ ...a, ...B }) !== JSON.stringify(a));
521
521
  }, b = async () => {
522
- await d({ ...a, ...r }), h(!1);
522
+ await c({ ...a, ...d }), _(!1);
523
523
  };
524
524
  return /* @__PURE__ */ l(m, { ref: t, children: [
525
525
  /* @__PURE__ */ e(v, {}),
526
526
  /* @__PURE__ */ l(m, { sx: { pt: 12 }, children: [
527
- /* @__PURE__ */ e(U, { sx: { lineHeight: "20px", pb: 4, pt: 16 }, children: i.personal_details }),
528
- /* @__PURE__ */ l(m, { sx: { flexDirection: s <= 768 ? "column" : "row", gap: 24, py: 16 }, children: [
527
+ /* @__PURE__ */ e(F, { sx: { lineHeight: "20px", pb: 4, pt: 16 }, children: s.personal_details }),
528
+ /* @__PURE__ */ l(m, { sx: { flexDirection: o <= 768 ? "column" : "row", gap: 24, py: 16 }, children: [
529
529
  n.display_email_edit_field_in_settings && /* @__PURE__ */ l(m, { sx: { flex: 1, pb: 14 }, children: [
530
530
  /* @__PURE__ */ e(
531
- L,
531
+ U,
532
532
  {
533
533
  defaultValue: a.email,
534
534
  fullWidth: !0,
535
- label: i.email_address,
535
+ label: s.email_address,
536
536
  name: "email",
537
537
  onChange: p
538
538
  }
@@ -549,22 +549,22 @@ const be = C(() => {
549
549
  }
550
550
  }
551
551
  },
552
- children: /* @__PURE__ */ e(be, {})
552
+ children: /* @__PURE__ */ e(xe, {})
553
553
  }
554
554
  )
555
555
  ] }),
556
556
  n.display_sms_edit_field_in_settings && /* @__PURE__ */ l(m, { sx: { flex: 1, pb: 14 }, children: [
557
557
  /* @__PURE__ */ e(
558
- L,
558
+ U,
559
559
  {
560
560
  defaultValue: a.phone,
561
561
  fullWidth: !0,
562
- label: i.mobile_number,
562
+ label: s.mobile_number,
563
563
  name: "phone",
564
564
  onChange: p
565
565
  }
566
566
  ),
567
- g && /* @__PURE__ */ e(
567
+ f && /* @__PURE__ */ e(
568
568
  G,
569
569
  {
570
570
  sx: {
@@ -576,83 +576,85 @@ const be = C(() => {
576
576
  }
577
577
  }
578
578
  },
579
- children: /* @__PURE__ */ e(Ce, {})
579
+ children: /* @__PURE__ */ e(ve, {})
580
580
  }
581
581
  )
582
582
  ] })
583
583
  ] }),
584
584
  /* @__PURE__ */ e(
585
- R,
585
+ j,
586
586
  {
587
- disabled: !o,
587
+ disabled: !i,
588
588
  onClick: b,
589
589
  sx: { width: 84 },
590
590
  variant: "contained",
591
- children: c.save_button
591
+ children: r.save_button
592
592
  }
593
593
  )
594
594
  ] })
595
595
  ] });
596
- }, Se = C(De), lt = C(
596
+ }, ke = C(Se), lt = C(
597
597
  ({
598
598
  notificationTypes: n = [y.Accounts, y.Budgets],
599
599
  showPersonalDetails: t = !1,
600
- view: s
600
+ view: o
601
601
  }) => {
602
- const { config: c } = W(), { settings: i } = D(), { isInitialized: d } = le(), { clientCommunicationProfile: a, loadNotificationProfiles: o } = T(), h = ge(), [r, _] = f.useState(
602
+ const { onLoad: r } = ce(), { config: s } = W(), { settings: c } = D(), { isInitialized: a } = le(), { clientCommunicationProfile: i, loadNotificationProfiles: _ } = T(), d = ye(), [h, u] = g.useState(
603
603
  void 0
604
604
  );
605
- if (n.length > 0 && h && n.push(y.Insights), f.useEffect(() => {
606
- d && o().finally();
607
- }, [d]), !d)
608
- return /* @__PURE__ */ e(ye, {});
609
- let u = i.manage_account_notifications;
610
- r === y.Budgets ? u = i.manage_budget_notifications : r === y.Insights && (u = i.manage_insights_notifications);
605
+ if (n.length > 0 && d && n.push(y.Insights), g.useEffect(() => {
606
+ a && _().finally(() => {
607
+ r?.("NotificationSettings");
608
+ });
609
+ }, [a]), !a)
610
+ return /* @__PURE__ */ e(be, {});
611
+ let f = c.manage_account_notifications;
612
+ h === y.Budgets ? f = c.manage_budget_notifications : h === y.Insights && (f = c.manage_insights_notifications);
611
613
  const {
612
- email_notifications_enabled: g,
613
- sms_notifications_enabled: p,
614
- push_notifications_enabled: b
615
- } = a, S = g || p || b;
616
- if (s === "accounts")
614
+ email_notifications_enabled: p,
615
+ sms_notifications_enabled: b,
616
+ push_notifications_enabled: S
617
+ } = i, A = p || b || S;
618
+ if (o === "accounts")
617
619
  return /* @__PURE__ */ e(H, {});
618
- if (s === "budgets")
620
+ if (o === "budgets")
619
621
  return /* @__PURE__ */ e(z, {});
620
- if (s === "insights")
622
+ if (o === "insights")
621
623
  return /* @__PURE__ */ e($, {});
622
- const I = c.display_email_edit_field_in_settings || c.display_sms_edit_field_in_settings, k = t && a.can_edit_contact_info && I;
623
- return /* @__PURE__ */ l(m, { sx: { pt: S ? 0 : 24 }, children: [
624
+ const k = s.display_email_edit_field_in_settings || s.display_sms_edit_field_in_settings, B = t && i.can_edit_contact_info && k;
625
+ return /* @__PURE__ */ l(m, { sx: { pt: A ? 0 : 24 }, children: [
624
626
  /* @__PURE__ */ l(m, { sx: { px: 24 }, children: [
625
- S && /* @__PURE__ */ l(B, { children: [
626
- /* @__PURE__ */ e(Pe, {}),
627
+ A && /* @__PURE__ */ l(M, { children: [
628
+ /* @__PURE__ */ e(De, {}),
627
629
  /* @__PURE__ */ e(v, { sx: { my: 24 } })
628
630
  ] }),
629
- /* @__PURE__ */ e(U, { sx: { mb: 4 }, children: i.notification_types_title })
631
+ /* @__PURE__ */ e(F, { sx: { mb: 4 }, children: c.notification_types_title })
630
632
  ] }),
631
633
  /* @__PURE__ */ l(E, { children: [
632
- n.includes(y.Accounts) && /* @__PURE__ */ e(O, { children: /* @__PURE__ */ l(V, { onClick: () => _(y.Accounts), children: [
633
- /* @__PURE__ */ e(N, { primary: i.accounts_title, secondary: i.accounts_subtitle }),
634
+ n.includes(y.Accounts) && /* @__PURE__ */ e(O, { children: /* @__PURE__ */ l(V, { onClick: () => u(y.Accounts), children: [
635
+ /* @__PURE__ */ e(L, { primary: c.accounts_title, secondary: c.accounts_subtitle }),
634
636
  /* @__PURE__ */ e(w, {})
635
637
  ] }) }),
636
- n.includes(y.Budgets) && /* @__PURE__ */ e(O, { children: /* @__PURE__ */ l(V, { onClick: () => _(y.Budgets), children: [
637
- /* @__PURE__ */ e(N, { primary: i.budgets_title, secondary: i.budgets_subtitle }),
638
+ n.includes(y.Budgets) && /* @__PURE__ */ e(O, { children: /* @__PURE__ */ l(V, { onClick: () => u(y.Budgets), children: [
639
+ /* @__PURE__ */ e(L, { primary: c.budgets_title, secondary: c.budgets_subtitle }),
638
640
  /* @__PURE__ */ e(w, {})
639
641
  ] }) }),
640
- n.includes(y.Insights) && /* @__PURE__ */ e(O, { children: /* @__PURE__ */ l(V, { onClick: () => _(y.Insights), children: [
641
- /* @__PURE__ */ e(N, { primary: i.insights_title, secondary: i.insights_subtitle }),
642
+ n.includes(y.Insights) && /* @__PURE__ */ e(O, { children: /* @__PURE__ */ l(V, { onClick: () => u(y.Insights), children: [
643
+ /* @__PURE__ */ e(L, { primary: c.insights_title, secondary: c.insights_subtitle }),
642
644
  /* @__PURE__ */ e(w, {})
643
645
  ] }) })
644
646
  ] }),
645
- k && /* @__PURE__ */ e(m, { sx: { px: 24 }, children: /* @__PURE__ */ e(Se, {}) }),
647
+ B && /* @__PURE__ */ e(m, { sx: { px: 24 }, children: /* @__PURE__ */ e(ke, {}) }),
646
648
  /* @__PURE__ */ e(
647
649
  J,
648
650
  {
649
- isOpen: !!r,
650
- onClose: () => _(void 0),
651
- title: u,
651
+ isOpen: !!h,
652
+ onClose: () => u(void 0),
653
+ title: f,
652
654
  children: /* @__PURE__ */ l(m, { children: [
653
- r === y.Accounts && /* @__PURE__ */ e(H, {}),
654
- r === y.Budgets && /* @__PURE__ */ e(z, {}),
655
- r === y.Insights && /* @__PURE__ */ e($, {})
655
+ h === y.Accounts && /* @__PURE__ */ e(H, {}),
656
+ h === y.Budgets && /* @__PURE__ */ e(z, {}),
657
+ h === y.Insights && /* @__PURE__ */ e($, {})
656
658
  ] })
657
659
  }
658
660
  )
@@ -664,6 +666,6 @@ export {
664
666
  z as B,
665
667
  $ as I,
666
668
  lt as N,
667
- be as V,
668
- Ce as a
669
+ xe as V,
670
+ ve as a
669
671
  };