@mx-cartographer/experiences 9.7.31 → 9.7.33

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 (43) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/core/constants/InstitutionLogo.d.ts +2 -0
  3. package/dist/core/constants/InstitutionLogo.es.js +6 -0
  4. package/dist/core/constants/InstitutionLogo.es.js.map +1 -0
  5. package/dist/core/constants/index.d.ts +1 -0
  6. package/dist/core/index.es.js +137 -135
  7. package/dist/core/types/InsightsInstanceSlotData.d.ts +6 -1
  8. package/dist/core/types/InsightsInstanceSlotData.es.js.map +1 -1
  9. package/dist/core/types/localization/InsightsFeedCopy.d.ts +20 -0
  10. package/dist/core/types/localization/index.d.ts +1 -1
  11. package/dist/core/utils/SanitizeHtml.d.ts +2 -0
  12. package/dist/core/utils/SanitizeHtml.es.js +44 -0
  13. package/dist/core/utils/SanitizeHtml.es.js.map +1 -0
  14. package/dist/core/utils/index.d.ts +1 -0
  15. package/dist/dashboard/WelcomeDialog.es.js +78 -115
  16. package/dist/dashboard/WelcomeDialog.es.js.map +1 -1
  17. package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationBlock.d.ts +10 -0
  18. package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationBlock.es.js +32 -0
  19. package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationBlock.es.js.map +1 -0
  20. package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationContent.d.ts +16 -0
  21. package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationContent.es.js +287 -0
  22. package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationContent.es.js.map +1 -0
  23. package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/index.d.ts +2 -0
  24. package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/layout.d.ts +32 -0
  25. package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/layout.es.js +66 -0
  26. package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/layout.es.js.map +1 -0
  27. package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/useCreditUtilizationPrepare.d.ts +1 -0
  28. package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/useCreditUtilizationPrepare.es.js +13 -0
  29. package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/useCreditUtilizationPrepare.es.js.map +1 -0
  30. package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js +31 -30
  31. package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js.map +1 -1
  32. package/dist/insights-v2/actionBlocks/RemainingCashBlock/layout.d.ts +0 -6
  33. package/dist/insights-v2/actionBlocks/RemainingCashBlock/layout.es.js +13 -14
  34. package/dist/insights-v2/actionBlocks/RemainingCashBlock/layout.es.js.map +1 -1
  35. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/layout.d.ts +1 -1
  36. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/layout.es.js +3 -3
  37. package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/layout.es.js.map +1 -1
  38. package/dist/insights-v2/mappings/actionBlocksKey.d.ts +1 -0
  39. package/dist/insights-v2/mappings/actionBlocksKey.es.js +1 -0
  40. package/dist/insights-v2/mappings/actionBlocksKey.es.js.map +1 -1
  41. package/dist/insights-v2/mappings/blocks.es.js +76 -69
  42. package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
  43. package/package.json +1 -1
@@ -1,97 +1,60 @@
1
- import { buildDynamicCopy as w } from "../core/utils/Localization.es.js";
2
- import { useAgreementStore as C, useEvent as D, useGlobalCopyStore as I, useGlobalStore as T } from "../common/context/hooks.es.js";
1
+ import { buildDynamicCopy as C } from "../core/utils/Localization.es.js";
2
+ import { sanitizeHtml as k } from "../core/utils/SanitizeHtml.es.js";
3
+ import { useAgreementStore as D, useEvent as I, useGlobalCopyStore as W, useGlobalStore as A } from "../common/context/hooks.es.js";
3
4
  import { useScreenSize as E } from "../common/hooks/useScreenSize.es.js";
4
- import { ANALYTICS_EVENTS as L } from "../common/constants/Analytics.es.js";
5
- import W from "../common/components/Loader.es.js";
6
- import z from "react";
5
+ import { ANALYTICS_EVENTS as T } from "../common/constants/Analytics.es.js";
6
+ import L from "../common/components/Loader.es.js";
7
+ import M from "react";
7
8
  import { observer as H } from "mobx-react-lite";
8
- import i from "@mui/material/Stack";
9
- import { Icon as u, P as g, Text as h } from "@mxenabled/mxui";
10
- import x from "@mui/material/Button";
11
- import { Fragment as M, jsx as e, jsxs as o } from "react/jsx-runtime";
9
+ import r from "@mui/material/Stack";
10
+ import { Icon as x, P as p, Text as g } from "@mxenabled/mxui";
11
+ import h from "@mui/material/Button";
12
+ import { Fragment as z, jsx as e, jsxs as i } from "react/jsx-runtime";
12
13
  import { alpha as R } from "@mui/material/styles";
13
- import m from "@mui/material/Box";
14
- import O from "@mui/material/Dialog";
15
- import G from "@mui/material/DialogContent";
16
- import N from "@mui/material/IconButton";
17
- import B from "@mui/material/Divider";
18
- import j from "@mui/material/Link";
19
- import c from "dompurify";
20
- var F = {
21
- ALLOWED_TAGS: [
22
- "a",
23
- "b",
24
- "br",
25
- "div",
26
- "em",
27
- "h1",
28
- "h2",
29
- "h3",
30
- "h4",
31
- "h5",
32
- "h6",
33
- "i",
34
- "li",
35
- "ol",
36
- "p",
37
- "span",
38
- "strong",
39
- "u",
40
- "ul"
41
- ],
42
- ALLOWED_ATTR: [
43
- "href",
44
- "target",
45
- "rel"
46
- ]
47
- }, P = (n) => {
48
- n.tagName === "A" && n.getAttribute("target") === "_blank" && n.setAttribute("rel", "noopener noreferrer");
49
- }, V = (n) => {
50
- if (!c.isSupported) return "";
51
- c.addHook("afterSanitizeAttributes", P);
52
- try {
53
- return c.sanitize(n, F);
54
- } finally {
55
- c.removeHook("afterSanitizeAttributes");
56
- }
57
- }, Y = ({ isOpen: n, onContinue: b }) => {
58
- const { copyStore: _ } = T(), { common: d } = I(), { isSmallMobile: r } = E(), l = C(), { onEvent: y } = D(), [a, p] = z.useState(!1);
59
- if (!_.isInitialized) return null;
60
- const t = d.welcome_dialog, v = () => {
61
- p(!0), y(L.WELCOME_DIALOG_VIEW_TERMS), l.isLoaded || l.loadAgreement();
62
- }, S = (s, f) => {
63
- f === "escapeKeyDown" && a && p(!1);
64
- }, A = () => l.hasError ? /* @__PURE__ */ o(i, {
14
+ import c from "@mui/material/Box";
15
+ import B from "@mui/material/Dialog";
16
+ import j from "@mui/material/DialogContent";
17
+ import G from "@mui/material/IconButton";
18
+ import F from "@mui/material/Divider";
19
+ import N from "@mui/material/Link";
20
+ var O = ({ isOpen: f, onContinue: u }) => {
21
+ const { copyStore: b } = A(), { common: m } = W(), { isSmallMobile: o } = E(), n = D(), { onEvent: _ } = I(), [l, s] = M.useState(!1);
22
+ if (!b.isInitialized) return null;
23
+ const t = m.welcome_dialog, y = () => {
24
+ s(!0), _(T.WELCOME_DIALOG_VIEW_TERMS), n.isLoaded || n.loadAgreement();
25
+ }, v = (a, d) => {
26
+ d === "escapeKeyDown" && l && s(!1);
27
+ }, S = () => n.hasError ? /* @__PURE__ */ i(r, {
65
28
  sx: {
66
29
  alignItems: "center",
67
30
  gap: 16,
68
31
  py: 24
69
32
  },
70
- children: [/* @__PURE__ */ e(g, {
33
+ children: [/* @__PURE__ */ e(p, {
71
34
  color: "error.main",
72
35
  role: "alert",
73
36
  sx: { textAlign: "center" },
74
37
  truncate: !1,
75
38
  children: t.terms_error
76
- }), /* @__PURE__ */ e(x, {
77
- onClick: () => l.loadAgreement(),
39
+ }), /* @__PURE__ */ e(h, {
40
+ onClick: () => n.loadAgreement(),
78
41
  variant: "outlined",
79
- children: d.refresh_button
42
+ children: m.refresh_button
80
43
  })]
81
- }) : l.isLoaded ? /* @__PURE__ */ e(m, {
44
+ }) : n.isLoaded ? /* @__PURE__ */ e(c, {
82
45
  "aria-labelledby": "welcome-dialog-terms-title",
83
- dangerouslySetInnerHTML: { __html: V(l.agreement?.text ?? "") },
46
+ dangerouslySetInnerHTML: { __html: k(n.agreement?.text ?? "") },
84
47
  role: "region",
85
48
  tabIndex: 0,
86
49
  sx: {
87
50
  overflowY: "auto",
88
51
  "& *": { maxWidth: "100%" },
89
- ...r ? {
52
+ ...o ? {
90
53
  flex: 1,
91
54
  minHeight: 0
92
55
  } : { maxHeight: 400 }
93
56
  }
94
- }) : /* @__PURE__ */ e(W, { height: 400 }), k = [
57
+ }) : /* @__PURE__ */ e(L, { height: 400 }), w = [
95
58
  {
96
59
  description: t.financial_views_description,
97
60
  icon: "account_balance",
@@ -108,94 +71,94 @@ var F = {
108
71
  title: t.budgets_title
109
72
  }
110
73
  ];
111
- return /* @__PURE__ */ e(O, {
112
- "aria-labelledby": a ? "welcome-dialog-terms-title" : "welcome-dialog-title",
113
- fullScreen: r,
74
+ return /* @__PURE__ */ e(B, {
75
+ "aria-labelledby": l ? "welcome-dialog-terms-title" : "welcome-dialog-title",
76
+ fullScreen: o,
114
77
  maxWidth: "sm",
115
- onClose: S,
116
- open: n,
78
+ onClose: v,
79
+ open: f,
117
80
  role: "dialog",
118
- scroll: r ? "paper" : "body",
81
+ scroll: o ? "paper" : "body",
119
82
  sx: {
120
83
  "& .MuiDialog-paper": {
121
- borderRadius: r ? 0 : "8px",
122
- margin: r ? 0 : "32px auto",
123
- padding: a || r ? "24px" : "64px",
84
+ borderRadius: o ? 0 : "8px",
85
+ margin: o ? 0 : "32px auto",
86
+ padding: l || o ? "24px" : "64px",
124
87
  maxWidth: 500,
125
88
  width: "100%"
126
89
  },
127
90
  "& .MuiDialogContent-root": {
128
91
  padding: 0,
129
- ...a && {
92
+ ...l && {
130
93
  overflow: "visible",
131
- ...r && {
94
+ ...o && {
132
95
  display: "flex",
133
96
  flexDirection: "column"
134
97
  }
135
98
  }
136
99
  }
137
100
  },
138
- children: /* @__PURE__ */ e(G, { children: a ? /* @__PURE__ */ o(i, {
101
+ children: /* @__PURE__ */ e(j, { children: l ? /* @__PURE__ */ i(r, {
139
102
  sx: {
140
103
  gap: 16,
141
- ...r && {
104
+ ...o && {
142
105
  flex: 1,
143
106
  minHeight: 0
144
107
  }
145
108
  },
146
109
  children: [
147
- /* @__PURE__ */ o(i, {
110
+ /* @__PURE__ */ i(r, {
148
111
  sx: {
149
112
  alignItems: "center",
150
113
  flexDirection: "row",
151
114
  gap: 8
152
115
  },
153
- children: [/* @__PURE__ */ e(N, {
154
- "aria-label": d.back,
155
- onClick: () => p(!1),
116
+ children: [/* @__PURE__ */ e(G, {
117
+ "aria-label": m.back,
118
+ onClick: () => s(!1),
156
119
  sx: {
157
120
  color: "primary.main",
158
121
  ml: -8
159
122
  },
160
- children: /* @__PURE__ */ e(u, {
123
+ children: /* @__PURE__ */ e(x, {
161
124
  name: "chevron_left",
162
125
  size: 24
163
126
  })
164
- }), /* @__PURE__ */ e(h, {
127
+ }), /* @__PURE__ */ e(g, {
165
128
  bold: !0,
166
129
  component: "h2",
167
130
  id: "welcome-dialog-terms-title",
168
131
  variant: "h3",
169
- children: l.agreement?.title || t.terms_link
132
+ children: n.agreement?.title || t.terms_link
170
133
  })]
171
134
  }),
172
- /* @__PURE__ */ e(B, { sx: { mx: -24 } }),
173
- A()
135
+ /* @__PURE__ */ e(F, { sx: { mx: -24 } }),
136
+ S()
174
137
  ]
175
- }) : /* @__PURE__ */ o(M, { children: [
176
- /* @__PURE__ */ e(i, {
138
+ }) : /* @__PURE__ */ i(z, { children: [
139
+ /* @__PURE__ */ e(r, {
177
140
  sx: {
178
141
  alignItems: "center",
179
142
  mb: 32,
180
143
  textAlign: "center"
181
144
  },
182
- children: /* @__PURE__ */ o(h, {
145
+ children: /* @__PURE__ */ i(g, {
183
146
  bold: !0,
184
147
  component: "h2",
185
148
  id: "welcome-dialog-title",
186
149
  variant: "h3",
187
- children: [/* @__PURE__ */ e(m, {
150
+ children: [/* @__PURE__ */ e(c, {
188
151
  component: "span",
189
152
  sx: { display: "block" },
190
153
  children: t.title_line_1
191
- }), /* @__PURE__ */ e(m, {
154
+ }), /* @__PURE__ */ e(c, {
192
155
  component: "span",
193
156
  sx: { display: "block" },
194
157
  children: t.title_line_2
195
158
  })]
196
159
  })
197
160
  }),
198
- /* @__PURE__ */ e(i, {
161
+ /* @__PURE__ */ e(r, {
199
162
  sx: {
200
163
  border: 1,
201
164
  borderColor: "divider",
@@ -203,45 +166,45 @@ var F = {
203
166
  p: 16,
204
167
  gap: 16
205
168
  },
206
- children: k.map((s) => /* @__PURE__ */ o(i, {
169
+ children: w.map((a) => /* @__PURE__ */ i(r, {
207
170
  sx: {
208
171
  alignItems: "center",
209
172
  flexDirection: "row",
210
173
  gap: 16
211
174
  },
212
- children: [/* @__PURE__ */ e(m, {
175
+ children: [/* @__PURE__ */ e(c, {
213
176
  sx: {
214
177
  alignItems: "center",
215
- bgcolor: (f) => R(f.palette.primary.main, 0.1),
178
+ bgcolor: (d) => R(d.palette.primary.main, 0.1),
216
179
  borderRadius: 1,
217
180
  display: "flex",
218
181
  flexShrink: 0,
219
182
  justifyContent: "center",
220
183
  p: 8
221
184
  },
222
- children: /* @__PURE__ */ e(u, {
223
- name: s.icon,
185
+ children: /* @__PURE__ */ e(x, {
186
+ name: a.icon,
224
187
  size: 24,
225
188
  sx: { color: "primary.main" }
226
189
  })
227
- }), /* @__PURE__ */ o(i, {
190
+ }), /* @__PURE__ */ i(r, {
228
191
  sx: { gap: 2 },
229
- children: [/* @__PURE__ */ e(h, {
192
+ children: [/* @__PURE__ */ e(g, {
230
193
  bold: !0,
231
194
  variant: "body1",
232
- children: s.title
233
- }), /* @__PURE__ */ e(g, {
195
+ children: a.title
196
+ }), /* @__PURE__ */ e(p, {
234
197
  color: "text.secondary",
235
198
  truncate: !1,
236
199
  variant: "caption",
237
- children: s.description
200
+ children: a.description
238
201
  })]
239
202
  })]
240
- }, s.title))
203
+ }, a.title))
241
204
  }),
242
- /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ e(x, {
205
+ /* @__PURE__ */ i(r, { children: [/* @__PURE__ */ e(h, {
243
206
  fullWidth: !0,
244
- onClick: b,
207
+ onClick: u,
245
208
  sx: {
246
209
  maxWidth: 324,
247
210
  mt: 64,
@@ -249,7 +212,7 @@ var F = {
249
212
  },
250
213
  variant: "contained",
251
214
  children: t.continue_button
252
- }), /* @__PURE__ */ e(g, {
215
+ }), /* @__PURE__ */ e(p, {
253
216
  color: "text.secondary",
254
217
  sx: {
255
218
  mt: 16,
@@ -257,9 +220,9 @@ var F = {
257
220
  },
258
221
  truncate: !1,
259
222
  variant: "body2",
260
- children: w(t.terms_agreement, /* @__PURE__ */ e(j, {
223
+ children: C(t.terms_agreement, /* @__PURE__ */ e(N, {
261
224
  component: "button",
262
- onClick: v,
225
+ onClick: y,
263
226
  rel: "noopener",
264
227
  sx: {
265
228
  display: "block",
@@ -273,9 +236,9 @@ var F = {
273
236
  })] })
274
237
  ] }) })
275
238
  });
276
- }, de = H(Y);
239
+ }, ce = H(O);
277
240
  export {
278
- de as default
241
+ ce as default
279
242
  };
280
243
 
281
244
  //# sourceMappingURL=WelcomeDialog.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"WelcomeDialog.es.js","names":[],"sources":["../../src/dashboard/WelcomeDialog.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\nimport DOMPurify from 'dompurify'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Dialog from '@mui/material/Dialog'\nimport DialogContent from '@mui/material/DialogContent'\nimport Divider from '@mui/material/Divider'\nimport IconButton from '@mui/material/IconButton'\nimport Link from '@mui/material/Link'\nimport Stack from '@mui/material/Stack'\nimport { alpha } from '@mui/material/styles'\n\nimport { Icon, P, Text } from '@mxenabled/mxui'\n\nimport {\n ANALYTICS_EVENTS,\n buildDynamicCopy,\n Loader,\n useAgreementStore,\n useEvent,\n useGlobalCopyStore,\n useGlobalStore,\n useScreenSize,\n} from '../common'\n\n// Terms HTML is server-controlled, so render it fail-closed and against an explicit\n// allowlist — no script/style/form/event-handler content can reach the DOM.\nconst SANITIZE_CONFIG = {\n ALLOWED_TAGS: [\n 'a',\n 'b',\n 'br',\n 'div',\n 'em',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'i',\n 'li',\n 'ol',\n 'p',\n 'span',\n 'strong',\n 'u',\n 'ul',\n ],\n ALLOWED_ATTR: ['href', 'target', 'rel'],\n}\n\n// Any anchor that opens a new tab must not leak the opener (reverse tabnabbing).\nconst forceSafeRel = (node: Element) => {\n if (node.tagName === 'A' && node.getAttribute('target') === '_blank') {\n node.setAttribute('rel', 'noopener noreferrer')\n }\n}\n\n// Fail closed: when DOMPurify has no DOM to sanitize against, render nothing rather\n// than passing raw server HTML straight through to `dangerouslySetInnerHTML`.\nconst sanitizeTermsHtml = (html: string) => {\n if (!DOMPurify.isSupported) {\n return ''\n }\n\n // Scope the hook to this single call so it never alters the shared DOMPurify\n // singleton's behavior for other sanitize() callers (and never stacks).\n DOMPurify.addHook('afterSanitizeAttributes', forceSafeRel)\n try {\n return DOMPurify.sanitize(html, SANITIZE_CONFIG)\n } finally {\n DOMPurify.removeHook('afterSanitizeAttributes')\n }\n}\n\nexport interface WelcomeDialogProps {\n isOpen: boolean\n onContinue: () => void\n}\n\nconst WelcomeDialog: React.FC<WelcomeDialogProps> = ({ isOpen, onContinue }) => {\n const { copyStore } = useGlobalStore()\n const { common: commonCopy } = useGlobalCopyStore()\n const { isSmallMobile } = useScreenSize()\n const agreementStore = useAgreementStore()\n const { onEvent } = useEvent()\n\n const [showTerms, setShowTerms] = React.useState(false)\n\n if (!copyStore.isInitialized) {\n return null\n }\n\n const copy = commonCopy.welcome_dialog\n\n const openTerms = () => {\n setShowTerms(true)\n onEvent(ANALYTICS_EVENTS.WELCOME_DIALOG_VIEW_TERMS)\n if (!agreementStore.isLoaded) {\n agreementStore.loadAgreement()\n }\n }\n\n // MUI only fires onClose for backdrop clicks and Escape. This is a consent gate, so\n // neither dismisses it (Continue is the only way out); Escape just backs out of the\n // terms sub-view, mirroring the back button.\n const handleClose = (_event: object, reason: 'backdropClick' | 'escapeKeyDown') => {\n if (reason === 'escapeKeyDown' && showTerms) {\n setShowTerms(false)\n }\n }\n\n const renderTermsBody = () => {\n if (agreementStore.hasError) {\n return (\n <Stack sx={{ alignItems: 'center', gap: 16, py: 24 }}>\n <P color=\"error.main\" role=\"alert\" sx={{ textAlign: 'center' }} truncate={false}>\n {copy.terms_error}\n </P>\n <Button onClick={() => agreementStore.loadAgreement()} variant=\"outlined\">\n {commonCopy.refresh_button}\n </Button>\n </Stack>\n )\n }\n\n if (!agreementStore.isLoaded) {\n return <Loader height={400} />\n }\n\n return (\n <Box\n aria-labelledby=\"welcome-dialog-terms-title\"\n dangerouslySetInnerHTML={{\n __html: sanitizeTermsHtml(agreementStore.agreement?.text ?? ''),\n }}\n role=\"region\"\n tabIndex={0}\n sx={{\n overflowY: 'auto',\n '& *': { maxWidth: '100%' },\n ...(isSmallMobile ? { flex: 1, minHeight: 0 } : { maxHeight: 400 }),\n }}\n />\n )\n }\n\n const features = [\n {\n description: copy.financial_views_description,\n icon: 'account_balance',\n title: copy.financial_views_title,\n },\n {\n description: copy.smart_spending_description,\n icon: 'receipt_long',\n title: copy.smart_spending_title,\n },\n {\n description: copy.budgets_description,\n icon: 'bubble_chart',\n title: copy.budgets_title,\n },\n ]\n\n const titleId = showTerms ? 'welcome-dialog-terms-title' : 'welcome-dialog-title'\n\n return (\n <Dialog\n aria-labelledby={titleId}\n fullScreen={isSmallMobile}\n maxWidth=\"sm\"\n onClose={handleClose}\n open={isOpen}\n role=\"dialog\"\n scroll={isSmallMobile ? 'paper' : 'body'}\n sx={{\n '& .MuiDialog-paper': {\n borderRadius: isSmallMobile ? 0 : '8px',\n margin: isSmallMobile ? 0 : '32px auto',\n padding: showTerms || isSmallMobile ? '24px' : '64px',\n maxWidth: 500,\n width: '100%',\n },\n '& .MuiDialogContent-root': {\n padding: 0,\n ...(showTerms && {\n overflow: 'visible',\n ...(isSmallMobile && { display: 'flex', flexDirection: 'column' }),\n }),\n },\n }}\n >\n <DialogContent>\n {showTerms ? (\n <Stack sx={{ gap: 16, ...(isSmallMobile && { flex: 1, minHeight: 0 }) }}>\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 8 }}>\n <IconButton\n aria-label={commonCopy.back}\n onClick={() => setShowTerms(false)}\n sx={{ color: 'primary.main', ml: -8 }}\n >\n <Icon name=\"chevron_left\" size={24} />\n </IconButton>\n <Text bold={true} component=\"h2\" id=\"welcome-dialog-terms-title\" variant=\"h3\">\n {agreementStore.agreement?.title || copy.terms_link}\n </Text>\n </Stack>\n\n <Divider sx={{ mx: -24 }} />\n\n {renderTermsBody()}\n </Stack>\n ) : (\n <>\n <Stack sx={{ alignItems: 'center', mb: 32, textAlign: 'center' }}>\n <Text bold={true} component=\"h2\" id=\"welcome-dialog-title\" variant=\"h3\">\n <Box component=\"span\" sx={{ display: 'block' }}>\n {copy.title_line_1}\n </Box>\n <Box component=\"span\" sx={{ display: 'block' }}>\n {copy.title_line_2}\n </Box>\n </Text>\n </Stack>\n\n <Stack sx={{ border: 1, borderColor: 'divider', borderRadius: '8px', p: 16, gap: 16 }}>\n {features.map((feature) => (\n <Stack\n key={feature.title}\n sx={{ alignItems: 'center', flexDirection: 'row', gap: 16 }}\n >\n <Box\n sx={{\n alignItems: 'center',\n bgcolor: (theme) => alpha(theme.palette.primary.main, 0.1),\n borderRadius: 1,\n display: 'flex',\n flexShrink: 0,\n justifyContent: 'center',\n p: 8,\n }}\n >\n <Icon name={feature.icon} size={24} sx={{ color: 'primary.main' }} />\n </Box>\n <Stack sx={{ gap: 2 }}>\n <Text bold={true} variant=\"body1\">\n {feature.title}\n </Text>\n <P color=\"text.secondary\" truncate={false} variant=\"caption\">\n {feature.description}\n </P>\n </Stack>\n </Stack>\n ))}\n </Stack>\n\n <Stack>\n <Button\n fullWidth={true}\n onClick={onContinue}\n sx={{ maxWidth: 324, mt: 64, mx: 'auto' }}\n variant=\"contained\"\n >\n {copy.continue_button}\n </Button>\n\n <P\n color=\"text.secondary\"\n sx={{ mt: 16, textAlign: 'center' }}\n truncate={false}\n variant=\"body2\"\n >\n {\n buildDynamicCopy(\n copy.terms_agreement,\n <Link\n component=\"button\"\n onClick={openTerms}\n rel=\"noopener\"\n sx={{ display: 'block', fontWeight: 600, lineHeight: 2, mx: 'auto' }}\n type=\"button\"\n >\n {copy.terms_link}\n </Link>,\n ) as string\n }\n </P>\n </Stack>\n </>\n )}\n </DialogContent>\n </Dialog>\n )\n}\n\nexport default observer(WelcomeDialog)\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA6BA,IAAM,IAAkB;AAAA,EACtB,cAAc;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,cAAc;AAAA,IAAC;AAAA,IAAQ;AAAA,IAAU;AAAA,EAAK;AACxC,GAGM,IAAA,CAAgB,MAAkB;AACtC,EAAI,EAAK,YAAY,OAAO,EAAK,aAAa,QAAQ,MAAM,YAC1D,EAAK,aAAa,OAAO,qBAAqB;AAElD,GAIM,IAAA,CAAqB,MAAiB;AAC1C,MAAI,CAAC,EAAU,YACb,QAAO;AAKT,EAAA,EAAU,QAAQ,2BAA2B,CAAY;AACzD,MAAI;AACF,WAAO,EAAU,SAAS,GAAM,CAAe;AAAA,EACjD,UAAA;AACE,IAAA,EAAU,WAAW,yBAAyB;AAAA,EAChD;AACF,GAOM,IAAA,CAA+C,EAAE,QAAA,GAAQ,YAAA,EAAA,MAAiB;AAC9E,QAAM,EAAE,WAAA,EAAA,IAAc,EAAe,GAC/B,EAAE,QAAQ,EAAA,IAAe,EAAm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QACN,IAAI;AAAA,UAAE,IAAI;AAAA,UAAI,WAAW;AAAA,QAAS;AAAA,QAClC,UAAU;AAAA,QACV,SAAQ;AAAA,QAGN,UAAA,EACE,EAAK,iBACL,gBAAA,EAAC,GAAD;AAAA,UACE,WAAU;AAAA,UACV,SAAS;AAAA,UACT,KAAI;AAAA,UACJ,IAAI;AAAA,YAAE,SAAS;AAAA,YAAS,YAAY;AAAA,YAAK,YAAY;AAAA,YAAG,IAAI;AAAA,UAAO;AAAA,UACnE,MAAK;AAAA,UAEJ,UAAA,EAAK;AAAA,QACF,CAAA,CACR;AAAA,MAED,CAAA,CACE,EAAA,CAAA;AAAA,IACP,EAAA,CAAA,EAES,CAAA;AAAA,EACT,CAAA;AAEZ,GAEA,KAAe,EAAS,CAAa"}
1
+ {"version":3,"file":"WelcomeDialog.es.js","names":[],"sources":["../../src/dashboard/WelcomeDialog.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Dialog from '@mui/material/Dialog'\nimport DialogContent from '@mui/material/DialogContent'\nimport Divider from '@mui/material/Divider'\nimport IconButton from '@mui/material/IconButton'\nimport Link from '@mui/material/Link'\nimport Stack from '@mui/material/Stack'\nimport { alpha } from '@mui/material/styles'\n\nimport { Icon, P, Text } from '@mxenabled/mxui'\n\nimport {\n ANALYTICS_EVENTS,\n buildDynamicCopy,\n Loader,\n useAgreementStore,\n useEvent,\n useGlobalCopyStore,\n useGlobalStore,\n useScreenSize,\n} from '../common'\nimport { sanitizeHtml } from '../core/utils/SanitizeHtml'\n\nexport interface WelcomeDialogProps {\n isOpen: boolean\n onContinue: () => void\n}\n\nconst WelcomeDialog: React.FC<WelcomeDialogProps> = ({ isOpen, onContinue }) => {\n const { copyStore } = useGlobalStore()\n const { common: commonCopy } = useGlobalCopyStore()\n const { isSmallMobile } = useScreenSize()\n const agreementStore = useAgreementStore()\n const { onEvent } = useEvent()\n\n const [showTerms, setShowTerms] = React.useState(false)\n\n if (!copyStore.isInitialized) {\n return null\n }\n\n const copy = commonCopy.welcome_dialog\n\n const openTerms = () => {\n setShowTerms(true)\n onEvent(ANALYTICS_EVENTS.WELCOME_DIALOG_VIEW_TERMS)\n if (!agreementStore.isLoaded) {\n agreementStore.loadAgreement()\n }\n }\n\n // MUI only fires onClose for backdrop clicks and Escape. This is a consent gate, so\n // neither dismisses it (Continue is the only way out); Escape just backs out of the\n // terms sub-view, mirroring the back button.\n const handleClose = (_event: object, reason: 'backdropClick' | 'escapeKeyDown') => {\n if (reason === 'escapeKeyDown' && showTerms) {\n setShowTerms(false)\n }\n }\n\n const renderTermsBody = () => {\n if (agreementStore.hasError) {\n return (\n <Stack sx={{ alignItems: 'center', gap: 16, py: 24 }}>\n <P color=\"error.main\" role=\"alert\" sx={{ textAlign: 'center' }} truncate={false}>\n {copy.terms_error}\n </P>\n <Button onClick={() => agreementStore.loadAgreement()} variant=\"outlined\">\n {commonCopy.refresh_button}\n </Button>\n </Stack>\n )\n }\n\n if (!agreementStore.isLoaded) {\n return <Loader height={400} />\n }\n\n return (\n <Box\n aria-labelledby=\"welcome-dialog-terms-title\"\n dangerouslySetInnerHTML={{\n __html: sanitizeHtml(agreementStore.agreement?.text ?? ''),\n }}\n role=\"region\"\n tabIndex={0}\n sx={{\n overflowY: 'auto',\n '& *': { maxWidth: '100%' },\n ...(isSmallMobile ? { flex: 1, minHeight: 0 } : { maxHeight: 400 }),\n }}\n />\n )\n }\n\n const features = [\n {\n description: copy.financial_views_description,\n icon: 'account_balance',\n title: copy.financial_views_title,\n },\n {\n description: copy.smart_spending_description,\n icon: 'receipt_long',\n title: copy.smart_spending_title,\n },\n {\n description: copy.budgets_description,\n icon: 'bubble_chart',\n title: copy.budgets_title,\n },\n ]\n\n const titleId = showTerms ? 'welcome-dialog-terms-title' : 'welcome-dialog-title'\n\n return (\n <Dialog\n aria-labelledby={titleId}\n fullScreen={isSmallMobile}\n maxWidth=\"sm\"\n onClose={handleClose}\n open={isOpen}\n role=\"dialog\"\n scroll={isSmallMobile ? 'paper' : 'body'}\n sx={{\n '& .MuiDialog-paper': {\n borderRadius: isSmallMobile ? 0 : '8px',\n margin: isSmallMobile ? 0 : '32px auto',\n padding: showTerms || isSmallMobile ? '24px' : '64px',\n maxWidth: 500,\n width: '100%',\n },\n '& .MuiDialogContent-root': {\n padding: 0,\n ...(showTerms && {\n overflow: 'visible',\n ...(isSmallMobile && { display: 'flex', flexDirection: 'column' }),\n }),\n },\n }}\n >\n <DialogContent>\n {showTerms ? (\n <Stack sx={{ gap: 16, ...(isSmallMobile && { flex: 1, minHeight: 0 }) }}>\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 8 }}>\n <IconButton\n aria-label={commonCopy.back}\n onClick={() => setShowTerms(false)}\n sx={{ color: 'primary.main', ml: -8 }}\n >\n <Icon name=\"chevron_left\" size={24} />\n </IconButton>\n <Text bold={true} component=\"h2\" id=\"welcome-dialog-terms-title\" variant=\"h3\">\n {agreementStore.agreement?.title || copy.terms_link}\n </Text>\n </Stack>\n\n <Divider sx={{ mx: -24 }} />\n\n {renderTermsBody()}\n </Stack>\n ) : (\n <>\n <Stack sx={{ alignItems: 'center', mb: 32, textAlign: 'center' }}>\n <Text bold={true} component=\"h2\" id=\"welcome-dialog-title\" variant=\"h3\">\n <Box component=\"span\" sx={{ display: 'block' }}>\n {copy.title_line_1}\n </Box>\n <Box component=\"span\" sx={{ display: 'block' }}>\n {copy.title_line_2}\n </Box>\n </Text>\n </Stack>\n\n <Stack sx={{ border: 1, borderColor: 'divider', borderRadius: '8px', p: 16, gap: 16 }}>\n {features.map((feature) => (\n <Stack\n key={feature.title}\n sx={{ alignItems: 'center', flexDirection: 'row', gap: 16 }}\n >\n <Box\n sx={{\n alignItems: 'center',\n bgcolor: (theme) => alpha(theme.palette.primary.main, 0.1),\n borderRadius: 1,\n display: 'flex',\n flexShrink: 0,\n justifyContent: 'center',\n p: 8,\n }}\n >\n <Icon name={feature.icon} size={24} sx={{ color: 'primary.main' }} />\n </Box>\n <Stack sx={{ gap: 2 }}>\n <Text bold={true} variant=\"body1\">\n {feature.title}\n </Text>\n <P color=\"text.secondary\" truncate={false} variant=\"caption\">\n {feature.description}\n </P>\n </Stack>\n </Stack>\n ))}\n </Stack>\n\n <Stack>\n <Button\n fullWidth={true}\n onClick={onContinue}\n sx={{ maxWidth: 324, mt: 64, mx: 'auto' }}\n variant=\"contained\"\n >\n {copy.continue_button}\n </Button>\n\n <P\n color=\"text.secondary\"\n sx={{ mt: 16, textAlign: 'center' }}\n truncate={false}\n variant=\"body2\"\n >\n {\n buildDynamicCopy(\n copy.terms_agreement,\n <Link\n component=\"button\"\n onClick={openTerms}\n rel=\"noopener\"\n sx={{ display: 'block', fontWeight: 600, lineHeight: 2, mx: 'auto' }}\n type=\"button\"\n >\n {copy.terms_link}\n </Link>,\n ) as string\n }\n </P>\n </Stack>\n </>\n )}\n </DialogContent>\n </Dialog>\n )\n}\n\nexport default observer(WelcomeDialog)\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAgCA,IAAM,IAAA,CAA+C,EAAE,QAAA,GAAQ,YAAA,EAAA,MAAiB;AAC9E,QAAM,EAAE,WAAA,EAAA,IAAc,EAAe,GAC/B,EAAE,QAAQ,EAAA,IAAe,EAAmB,GAC5C,EAAE,eAAA,EAAA,IAAkB,EAAc,GAClC,IAAiB,EAAkB,GACnC,EAAE,SAAA,EAAA,IAAY,EAAS,GAEvB,CAAC,GAAW,CAAA,IAAgB,EAAM,SAAS,EAAK;AAEtD,MAAI,CAAC,EAAU,cACb,QAAO;AAGT,QAAM,IAAO,EAAW,gBAElB,IAAA,MAAkB;AACtB,IAAA,EAAa,EAAI,GACjB,EAAQ,EAAiB,yBAAyB,GAC7C,EAAe,YAClB,EAAe,cAAc;AAAA,EAEjC,GAKM,IAAA,CAAe,GAAgB,MAA8C;AACjF,IAAI,MAAW,mBAAmB,KAChC,EAAa,EAAK;AAAA,EAEtB,GAEM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A,EAES,CAAA;AAAA,EACT,CAAA;AAEZ,GAEA,KAAe,EAAS,CAAa"}
@@ -0,0 +1,10 @@
1
+ import { ActionBlockProps } from '../../mappings/blocks';
2
+ /**
3
+ * Credit Utilization drawer (MEW2-3356): the beat's donut summary, the utilization legend and one
4
+ * row per card from `instance_slot_data.data_series`. Rows are joined to the loaded accounts by guid
5
+ * for the institution logo only, so the drawer renders as soon as copy is in and the logos fill in
6
+ * when the accounts arrive. `observer`: reads copy and accounts from MobX stores.
7
+ */
8
+ export declare const CreditUtilizationBlock: (({ beat, }: ActionBlockProps) => import("react/jsx-runtime").JSX.Element) & {
9
+ displayName: string;
10
+ };
@@ -0,0 +1,32 @@
1
+ import { useAccountStore as u, useGlobalCopyStore as f, useGlobalStore as g } from "../../../common/context/hooks.es.js";
2
+ import y from "../../../common/components/Loader.es.js";
3
+ import { readCardRows as C, readSummary as _ } from "./layout.es.js";
4
+ import h from "./CreditUtilizationContent.es.js";
5
+ import { observer as S } from "mobx-react-lite";
6
+ import x from "@mui/material/Stack";
7
+ import { Text as z } from "@mxenabled/mxui";
8
+ import { jsx as o } from "react/jsx-runtime";
9
+ var b = (e, i) => ({
10
+ ...e,
11
+ institutionGuid: i
12
+ }), F = S(function({ beat: i }) {
13
+ const { copyStore: a } = g(), { common: m, insights_feed: c } = f(), { accounts: d } = u(), n = c?.credit_utilization;
14
+ if (!a.isInitialized) return /* @__PURE__ */ o(y, {});
15
+ if (!n) return /* @__PURE__ */ o(x, {
16
+ sx: { p: 24 },
17
+ children: /* @__PURE__ */ o(z, { children: m?.error_message ?? "Something went wrong." })
18
+ });
19
+ const r = i.insights_payload, s = r?.instance_slot_data, p = new Map(d.map((t) => [t.guid, t.institution_guid ?? ""])), l = C(s?.data_series).map((t) => b(t, p.get(t.guid) ?? ""));
20
+ return /* @__PURE__ */ o(h, {
21
+ cards: l,
22
+ copy: n,
23
+ descriptionHtml: r?.description?.html_text,
24
+ summary: _(s),
25
+ title: r?.title
26
+ });
27
+ });
28
+ export {
29
+ F as CreditUtilizationBlock
30
+ };
31
+
32
+ //# sourceMappingURL=CreditUtilizationBlock.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CreditUtilizationBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationBlock.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport { Loader, useAccountStore, useGlobalCopyStore, useGlobalStore } from '../../../common'\nimport type { ActionBlockProps } from '../../mappings/blocks'\n\nimport CreditUtilizationContent, { type CreditUtilizationCard } from './CreditUtilizationContent'\nimport { readCardRows, readSummary, type CreditCardRow } from './layout'\n\nconst toCard = (row: CreditCardRow, institutionGuid: string): CreditUtilizationCard => ({\n ...row,\n institutionGuid,\n})\n\n/**\n * Credit Utilization drawer (MEW2-3356): the beat's donut summary, the utilization legend and one\n * row per card from `instance_slot_data.data_series`. Rows are joined to the loaded accounts by guid\n * for the institution logo only, so the drawer renders as soon as copy is in and the logos fill in\n * when the accounts arrive. `observer`: reads copy and accounts from MobX stores.\n */\nexport const CreditUtilizationBlock = observer(function CreditUtilizationBlock({\n beat,\n}: ActionBlockProps) {\n const { copyStore } = useGlobalStore()\n const { common: commonCopy, insights_feed: insightsFeedCopy } = useGlobalCopyStore()\n const { accounts } = useAccountStore()\n const copy = insightsFeedCopy?.credit_utilization\n\n if (!copyStore.isInitialized) return <Loader />\n\n // Copy loads once at app start, so a retry cannot clear a missing namespace: a plain message, never\n // an endless loader.\n if (!copy) {\n return (\n <Stack sx={{ p: 24 }}>\n <Text>{commonCopy?.error_message ?? 'Something went wrong.'}</Text>\n </Stack>\n )\n }\n\n const payload = beat.insights_payload\n const data = payload?.instance_slot_data\n const institutionByAccount = new Map(\n accounts.map((account) => [account.guid, account.institution_guid ?? '']),\n )\n const cards = readCardRows(data?.data_series).map((row) =>\n toCard(row, institutionByAccount.get(row.guid) ?? ''),\n )\n\n return (\n <CreditUtilizationContent\n cards={cards}\n copy={copy}\n descriptionHtml={payload?.description?.html_text}\n summary={readSummary(data)}\n title={payload?.title}\n />\n )\n})\n"],"mappings":";;;;;;;;AAWA,IAAM,IAAA,CAAU,GAAoB,OAAoD;AAAA,EACtF,GAAG;AAAA,EACH,iBAAA;AACF,IAQa,IAAyB,EAAS,SAAgC,EAC7E,MAAA,EAAA,GACmB;AACnB,QAAM,EAAE,WAAA,EAAA,IAAc,EAAe,GAC/B,EAAE,QAAQ,GAAY,eAAe,EAAA,IAAqB,EAAmB,GAC7E,EAAE,UAAA,EAAA,IAAa,EAAgB,GAC/B,IAAO,GAAkB;AAE/B,MAAI,CAAC,EAAU,cAAe,QAAO,gBAAA,EAAC,GAAD,CAAS,CAAA;AAI9C,MAAI,CAAC,EACH,QACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI,EAAE,GAAG,GAAG;AAAA,IACjB,UAAA,gBAAA,EAAC,GAAD,EAAA,UAAO,GAAY,iBAAiB,wBAA8B,CAAA;AAAA,EAC7D,CAAA;AAIX,QAAM,IAAU,EAAK,kBACf,IAAO,GAAS,oBAChB,IAAuB,IAAI,IAC/B,EAAS,IAAA,CAAK,MAAY,CAAC,EAAQ,MAAM,EAAQ,oBAAoB,EAAE,CAAC,CAC1E,GACM,IAAQ,EAAa,GAAM,WAAW,EAAE,IAAA,CAAK,MACjD,EAAO,GAAK,EAAqB,IAAI,EAAI,IAAI,KAAK,EAAE,CACtD;AAEA,SACE,gBAAA,EAAC,GAAD;AAAA,IACS,OAAA;AAAA,IACD,MAAA;AAAA,IACN,iBAAiB,GAAS,aAAa;AAAA,IACvC,SAAS,EAAY,CAAI;AAAA,IACzB,OAAO,GAAS;AAAA,EACjB,CAAA;AAEL,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { CreditUtilizationCopy } from '../../../core/types/localization/InsightsFeedCopy';
2
+ import { CreditCardRow, CreditUtilizationSummary } from './layout';
3
+ export interface CreditUtilizationCard extends CreditCardRow {
4
+ /** Empty when no loaded account matches the row's guid. */
5
+ institutionGuid: string;
6
+ }
7
+ export interface CreditUtilizationContentProps {
8
+ title?: string;
9
+ descriptionHtml?: string;
10
+ summary?: CreditUtilizationSummary;
11
+ cards: CreditUtilizationCard[];
12
+ copy: CreditUtilizationCopy;
13
+ }
14
+ /** Presentational body of the Credit Utilization drawer, minus the drawer header. */
15
+ declare const CreditUtilizationContent: ({ cards, copy, descriptionHtml, summary, title, }: CreditUtilizationContentProps) => import("react/jsx-runtime").JSX.Element;
16
+ export default CreditUtilizationContent;