@mx-cartographer/experiences 9.7.155 → 9.7.157

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 (47) hide show
  1. package/CHANGELOG.md +14 -1
  2. package/dist/core/types/localization/InsightsFeedCopy.d.ts +6 -5
  3. package/dist/insights-v2/actionBlocks/AccountDetailsBlock/AccountDetailsBlock.es.js +19 -22
  4. package/dist/insights-v2/actionBlocks/AccountDetailsBlock/AccountDetailsBlock.es.js.map +1 -1
  5. package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.es.js +44 -49
  6. package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.es.js.map +1 -1
  7. package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js +37 -41
  8. package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js.map +1 -1
  9. package/dist/insights-v2/actionBlocks/BlockErrorMessage.d.ts +4 -0
  10. package/dist/insights-v2/actionBlocks/BlockErrorMessage.es.js +17 -0
  11. package/dist/insights-v2/actionBlocks/BlockErrorMessage.es.js.map +1 -0
  12. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js +116 -120
  13. package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js.map +1 -1
  14. package/dist/insights-v2/actionBlocks/ContactSupportActionBlock.es.js +14 -18
  15. package/dist/insights-v2/actionBlocks/ContactSupportActionBlock.es.js.map +1 -1
  16. package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationBlock.d.ts +0 -6
  17. package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationBlock.es.js +34 -26
  18. package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationBlock.es.js.map +1 -1
  19. package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationContent.d.ts +4 -4
  20. package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationContent.es.js +239 -220
  21. package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationContent.es.js.map +1 -1
  22. package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/layout.d.ts +2 -0
  23. package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/layout.es.js +36 -32
  24. package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/layout.es.js.map +1 -1
  25. package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/useCreditUtilizationPrepare.es.js +4 -8
  26. package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/useCreditUtilizationPrepare.es.js.map +1 -1
  27. package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsBlock.es.js +26 -28
  28. package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsBlock.es.js.map +1 -1
  29. package/dist/insights-v2/actionBlocks/HelpBlock/HelpBlock.es.js +11 -14
  30. package/dist/insights-v2/actionBlocks/HelpBlock/HelpBlock.es.js.map +1 -1
  31. package/dist/insights-v2/actionBlocks/OverdraftBlock/OverdraftBlock.es.js +28 -30
  32. package/dist/insights-v2/actionBlocks/OverdraftBlock/OverdraftBlock.es.js.map +1 -1
  33. package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.es.js +53 -55
  34. package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.es.js.map +1 -1
  35. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.es.js +26 -31
  36. package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.es.js.map +1 -1
  37. package/dist/insights-v2/actionBlocks/PlaceholderActionBlock.es.js.map +1 -1
  38. package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js +38 -41
  39. package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js.map +1 -1
  40. package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/TransactionDetailsBlock.es.js +11 -16
  41. package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/TransactionDetailsBlock.es.js.map +1 -1
  42. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js +39 -42
  43. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js.map +1 -1
  44. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +76 -78
  45. package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
  46. package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
  47. package/package.json +1 -1
@@ -1 +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"}
1
+ {"version":3,"file":"CreditUtilizationBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationBlock.tsx"],"sourcesContent":["import { useState } from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport { Drawer, useAccountStore, useGlobalCopyStore } from '../../../common'\nimport type { Account } from '../../../core'\nimport type { ActionBlockProps } from '../../mappings/blocks'\nimport { AccountDetailsBlock } from '../AccountDetailsBlock'\nimport { BlockErrorMessage } from '../BlockErrorMessage'\n\nimport CreditUtilizationContent, { type CreditUtilizationCard } from './CreditUtilizationContent'\nimport { readCardRows, readSummary, type CreditCardRow } from './layout'\n\nconst toCard = (row: CreditCardRow, account?: Account): CreditUtilizationCard => ({\n ...row,\n accountLoaded: account !== undefined,\n institutionGuid: account?.institution_guid ?? '',\n})\n\nexport const CreditUtilizationBlock = observer(function CreditUtilizationBlock({\n beat,\n}: ActionBlockProps) {\n const [tappedAccountGuid, setTappedAccountGuid] = useState<string | null>(null)\n const { accounts: accountsCopy, insights_feed: insightsFeedCopy } = useGlobalCopyStore()\n const { accounts } = useAccountStore()\n const copy = insightsFeedCopy?.credit_utilization\n\n if (!copy) {\n return <BlockErrorMessage />\n }\n\n const data = beat.insights_payload?.instance_slot_data\n const accountByGuid = new Map(accounts.map((account) => [account.guid, account]))\n const cards = readCardRows(data?.data_series).map((row) =>\n toCard(row, accountByGuid.get(row.guid)),\n )\n\n return (\n <>\n <CreditUtilizationContent\n accountDetailsLabel={accountsCopy?.account_details}\n cards={cards}\n copy={copy}\n onCardClick={({ guid }) => setTappedAccountGuid(guid)}\n summary={readSummary(data)}\n />\n <Drawer\n ariaLabelClose={accountsCopy?.close_account_details_aria}\n isOpen={tappedAccountGuid !== null}\n onClose={() => setTappedAccountGuid(null)}\n title={accountsCopy?.account_details}\n >\n {tappedAccountGuid && (\n <AccountDetailsBlock\n beat={{ ...beat, primary_account: undefined, primary_account_guid: tappedAccountGuid }}\n />\n )}\n </Drawer>\n </>\n )\n})\n"],"mappings":";;;;;;;;;AAaA,IAAM,IAAA,CAAU,GAAoB,OAA8C;AAAA,EAChF,GAAG;AAAA,EACH,eAAe,MAAY;AAAA,EAC3B,iBAAiB,GAAS,oBAAoB;AAChD,IAEa,IAAyB,EAAS,SAAgC,EAC7E,MAAA,EAAA,GACmB;AACnB,QAAM,CAAC,GAAmB,CAAA,IAAwB,EAAwB,IAAI,GACxE,EAAE,UAAU,GAAc,eAAe,EAAA,IAAqB,EAAmB,GACjF,EAAE,UAAA,EAAA,IAAa,EAAgB,GAC/B,IAAO,GAAkB;AAE/B,MAAI,CAAC,EACH,QAAO,gBAAA,EAAC,GAAD,CAAoB,CAAA;AAG7B,QAAM,IAAO,EAAK,kBAAkB,oBAC9B,IAAgB,IAAI,IAAI,EAAS,IAAA,CAAK,MAAY,CAAC,EAAQ,MAAM,CAAO,CAAC,CAAC,GAC1E,IAAQ,EAAa,GAAM,WAAW,EAAE,IAAA,CAAK,MACjD,EAAO,GAAK,EAAc,IAAI,EAAI,IAAI,CAAC,CACzC;AAEA,SACE,gBAAA,EAAA,GAAA,EAAA,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,IACE,qBAAqB,GAAc;AAAA,IAC5B,OAAA;AAAA,IACD,MAAA;AAAA,IACN,aAAA,CAAc,EAAE,MAAA,EAAA,MAAW,EAAqB,CAAI;AAAA,IACpD,SAAS,EAAY,CAAI;AAAA,EAC1B,CAAA,GACD,gBAAA,EAAC,GAAD;AAAA,IACE,gBAAgB,GAAc;AAAA,IAC9B,QAAQ,MAAsB;AAAA,IAC9B,SAAA,MAAe,EAAqB,IAAI;AAAA,IACxC,OAAO,GAAc;AAAA,IAEpB,UAAA,KACC,gBAAA,EAAC,GAAD,EACE,MAAM;AAAA,MAAE,GAAG;AAAA,MAAM,iBAAiB;AAAA,MAAW,sBAAsB;AAAA,IAAkB,EACtF,CAAA;AAAA,EAEG,CAAA,CACR,EAAA,CAAA;AAEN,CAAC"}
@@ -1,16 +1,16 @@
1
1
  import { CreditUtilizationCopy } from '../../../core/types/localization/InsightsFeedCopy';
2
2
  import { CreditCardRow, CreditUtilizationSummary } from './layout';
3
3
  export interface CreditUtilizationCard extends CreditCardRow {
4
- /** Empty when no loaded account matches the row's guid. */
4
+ accountLoaded: boolean;
5
5
  institutionGuid: string;
6
6
  }
7
7
  export interface CreditUtilizationContentProps {
8
- title?: string;
9
- descriptionHtml?: string;
10
8
  summary?: CreditUtilizationSummary;
11
9
  cards: CreditUtilizationCard[];
12
10
  copy: CreditUtilizationCopy;
11
+ onCardClick?: (card: CreditUtilizationCard) => void;
12
+ accountDetailsLabel?: string;
13
13
  }
14
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;
15
+ declare const CreditUtilizationContent: ({ accountDetailsLabel, cards, copy, onCardClick, summary, }: CreditUtilizationContentProps) => import("react/jsx-runtime").JSX.Element;
16
16
  export default CreditUtilizationContent;
@@ -1,53 +1,78 @@
1
- import { buildDynamicCopy as v } from "../../../core/utils/Localization.es.js";
2
- import { sanitizeHtml as f } from "../../../core/utils/SanitizeHtml.es.js";
3
- import { DEFAULT_INSTITUTION_LOGO_URL as _ } from "../../../core/constants/InstitutionLogo.es.js";
4
- import { CURRENCY_FORMAT as w, formatCurrency as C } from "../../../core/utils/NumberFormatting.es.js";
5
- import I from "../../blocks/ChartBlocks/DonutChartBlock/DonutChart.es.js";
6
- import { UTILIZATION_BANDS as b, getUtilizationBand as g } from "./layout.es.js";
7
- import d from "@mui/material/Stack";
8
- import { Icon as D, InstitutionLogo as S, Text as l } from "@mxenabled/mxui";
9
- import { Fragment as z, jsx as e, jsxs as o } from "react/jsx-runtime";
10
- import { useTheme as x } from "@mui/material/styles";
11
- import m from "@mui/material/Box";
12
- var h = (t) => C(t, w.cents), u = ({ children: t }) => /* @__PURE__ */ e(d, {
13
- sx: {
14
- bgcolor: "background.paper",
15
- p: 24
16
- },
17
- children: t
18
- }), p = ({ children: t, mb: r = 16 }) => /* @__PURE__ */ e(l, {
1
+ import { sanitizeHtml as w } from "../../../core/utils/SanitizeHtml.es.js";
2
+ import { DEFAULT_INSTITUTION_LOGO_URL as T } from "../../../core/constants/InstitutionLogo.es.js";
3
+ import { CURRENCY_FORMAT as x, formatCurrency as g } from "../../../core/utils/NumberFormatting.es.js";
4
+ import { ELEVATION_SHADOW as R } from "../../components/shared/elevation.es.js";
5
+ import { TipSection as L } from "../../../insights/components/shared/ChartDrawerTemplate/TipSection.es.js";
6
+ import { DRAWER_TIP_ICON as S } from "../../components/drawerTip.es.js";
7
+ import { UTILIZATION_BANDS as h, getLegendPosition as $, getUtilizationBand as f } from "./layout.es.js";
8
+ import l from "@mui/material/Stack";
9
+ import { Icon as k, InstitutionLogo as z, Text as d } from "@mxenabled/mxui";
10
+ import { jsx as e, jsxs as n } from "react/jsx-runtime";
11
+ import { useTheme as v } from "@mui/material/styles";
12
+ import a from "@mui/material/Box";
13
+ import A from "@mui/material/ButtonBase";
14
+ var _ = (o) => o.vars?.overlays?.[1] ?? "none", c = 20, D = "30%", b = ({ children: o }) => /* @__PURE__ */ e(d, {
19
15
  bold: !0,
20
16
  component: "h3",
21
- sx: { mb: r },
17
+ sx: { mb: 12 },
22
18
  variant: "body1",
23
- children: t
24
- }), T = ({ copy: t, summary: { balance: r, limit: n, percentage: i } }) => {
25
- const a = x(), c = v(t.total_credit_utilized_aria, h(r), h(n), String(i));
26
- return /* @__PURE__ */ e(m, {
27
- "aria-label": c,
28
- role: "img",
29
- children: /* @__PURE__ */ e(I, {
30
- centerValue: `${i}%`,
31
- data: [{
32
- color: g(i).color(a),
33
- label: t.total_credit_utilized,
34
- labelValue: `${h(r)} / ${h(n)}`,
35
- value: i
36
- }, {
37
- color: a.palette.divider,
38
- value: 100 - i
39
- }]
40
- })
19
+ children: o
20
+ }), O = ({ definition: o, term: i }) => /* @__PURE__ */ e(a, {
21
+ component: "li",
22
+ sx: {
23
+ backgroundImage: _,
24
+ bgcolor: "background.default",
25
+ borderRadius: "8px",
26
+ px: 8,
27
+ py: 6
28
+ },
29
+ children: /* @__PURE__ */ n(d, {
30
+ component: "p",
31
+ variant: "body2",
32
+ children: [i && /* @__PURE__ */ n("b", { children: [i, " "] }), o]
33
+ })
34
+ }), U = ({ copy: o }) => {
35
+ const i = o.ratio_definition && o.utilization_definition ? [{
36
+ definition: o.ratio_definition,
37
+ term: o.ratio_term
38
+ }, {
39
+ definition: o.utilization_definition,
40
+ term: o.utilization_term
41
+ }] : [{ definition: o.ratio_explanation }];
42
+ return /* @__PURE__ */ e(l, {
43
+ component: "ul",
44
+ role: "list",
45
+ sx: {
46
+ gap: 12,
47
+ listStyle: "none",
48
+ m: 0,
49
+ p: 0
50
+ },
51
+ children: i.map((t) => /* @__PURE__ */ e(O, { ...t }, t.definition))
41
52
  });
42
- }, y = ({ copy: t }) => {
43
- const r = x(), n = b.length - 1;
44
- return /* @__PURE__ */ o(u, { children: [
45
- /* @__PURE__ */ e(p, {
46
- mb: 24,
47
- children: t.what_does_this_mean
48
- }),
49
- /* @__PURE__ */ e(d, {
50
- "aria-label": t.what_does_this_mean,
53
+ }, B = ({ copy: o, percentage: i }) => {
54
+ const t = v(), r = h.length - 1, m = i === void 0 ? void 0 : f(i);
55
+ return /* @__PURE__ */ n(a, {
56
+ sx: {
57
+ mt: 24,
58
+ position: "relative"
59
+ },
60
+ children: [m && i !== void 0 && /* @__PURE__ */ e(a, {
61
+ "aria-label": `${i}% ${o[m.band]}`,
62
+ role: "img",
63
+ sx: {
64
+ bgcolor: "background.paper",
65
+ border: "4px solid",
66
+ borderColor: m.color(t),
67
+ borderRadius: "50%",
68
+ height: c,
69
+ left: `clamp(0px, calc(${$(i)}% - ${c / 2}px), calc(100% - ${c}px))`,
70
+ position: "absolute",
71
+ top: -4,
72
+ width: c
73
+ }
74
+ }), /* @__PURE__ */ e(l, {
75
+ "aria-label": o.what_does_this_mean,
51
76
  component: "ul",
52
77
  role: "list",
53
78
  sx: {
@@ -55,10 +80,9 @@ var h = (t) => C(t, w.cents), u = ({ children: t }) => /* @__PURE__ */ e(d, {
55
80
  gap: 2,
56
81
  listStyle: "none",
57
82
  m: 0,
58
- mb: 24,
59
83
  p: 0
60
84
  },
61
- children: b.map(({ band: i, color: a, range: c }, s) => /* @__PURE__ */ o(m, {
85
+ children: h.map(({ band: s, color: u, range: I }, p) => /* @__PURE__ */ n(a, {
62
86
  component: "li",
63
87
  sx: {
64
88
  flex: 1,
@@ -66,205 +90,198 @@ var h = (t) => C(t, w.cents), u = ({ children: t }) => /* @__PURE__ */ e(d, {
66
90
  overflowWrap: "anywhere"
67
91
  },
68
92
  children: [
69
- /* @__PURE__ */ e(m, {
93
+ /* @__PURE__ */ e(a, {
70
94
  "aria-hidden": !0,
71
95
  sx: {
72
- bgcolor: a(r),
73
- borderRadius: s === 0 ? "8px 0 0 8px" : s === n ? "0 8px 8px 0" : void 0,
96
+ bgcolor: u(t),
97
+ borderRadius: p === 0 ? "8px 0 0 8px" : p === r ? "0 8px 8px 0" : void 0,
74
98
  height: 12,
75
99
  mb: 8
76
100
  }
77
101
  }),
78
- /* @__PURE__ */ e(l, {
102
+ /* @__PURE__ */ e(d, {
79
103
  bold: !0,
80
104
  component: "p",
81
105
  variant: "caption",
82
- children: c
106
+ children: I
83
107
  }),
84
- /* @__PURE__ */ e(l, {
108
+ /* @__PURE__ */ e(d, {
85
109
  component: "p",
86
110
  variant: "caption",
87
- children: t[i]
111
+ children: o[s]
88
112
  })
89
113
  ]
90
- }, i))
91
- }),
92
- /* @__PURE__ */ e(l, {
93
- component: "p",
94
- variant: "body2",
95
- children: t.ratio_explanation
96
- }),
97
- /* @__PURE__ */ e(l, {
98
- component: "p",
99
- sx: { mt: 16 },
100
- variant: "body2",
101
- children: t.recommendation
102
- })
103
- ] });
104
- }, R = ({ card: t, copy: r }) => {
105
- const n = x(), { limit: i, percentage: a } = t, c = i !== null && a !== null, s = c ? g(a).color(n) : n.palette.text.disabled;
106
- return /* @__PURE__ */ o(m, {
107
- component: "li",
108
- sx: {
109
- border: "1px solid",
110
- borderColor: "divider",
111
- borderRadius: "8px",
112
- p: 16
113
- },
114
- children: [/* @__PURE__ */ o(d, {
114
+ }, s))
115
+ })]
116
+ });
117
+ }, E = ({ card: { label: o, percentage: i } }) => {
118
+ const t = v();
119
+ return i === null ? null : /* @__PURE__ */ n(a, {
120
+ sx: { mt: 16 },
121
+ children: [/* @__PURE__ */ e(a, {
122
+ "aria-label": o,
123
+ "aria-valuemax": 100,
124
+ "aria-valuemin": 0,
125
+ "aria-valuenow": i,
126
+ "aria-valuetext": `${i}%`,
127
+ role: "meter",
115
128
  sx: {
116
- alignItems: "center",
117
- flexDirection: "row",
118
- gap: 12
129
+ bgcolor: "divider",
130
+ borderRadius: 999,
131
+ height: 8,
132
+ overflow: "hidden"
119
133
  },
120
- children: [/* @__PURE__ */ e(S, {
121
- alt: "",
122
- institutionGuid: t.institutionGuid,
123
- logoUrl: t.institutionGuid ? void 0 : _,
124
- size: 40
125
- }), /* @__PURE__ */ o(d, {
126
- sx: {
127
- flexGrow: 1,
128
- gap: 4,
129
- minWidth: 0
130
- },
131
- children: [/* @__PURE__ */ e(l, {
132
- bold: !0,
133
- truncate: !0,
134
- variant: "body2",
135
- children: t.label
136
- }), c ? /* @__PURE__ */ e(m, {
137
- "aria-label": t.label,
138
- "aria-valuemax": 100,
139
- "aria-valuemin": 0,
140
- "aria-valuenow": a,
141
- "aria-valuetext": `${a}%`,
142
- role: "meter",
143
- sx: {
144
- bgcolor: "neutral.light",
145
- borderRadius: 999,
146
- height: 8,
147
- overflow: "hidden"
148
- },
149
- children: /* @__PURE__ */ e(m, { sx: {
150
- bgcolor: s,
151
- borderRadius: 999,
152
- height: "100%",
153
- width: `${a}%`
154
- } })
155
- }) : /* @__PURE__ */ o(d, {
156
- sx: {
157
- alignItems: "center",
158
- flexDirection: "row",
159
- gap: 4
160
- },
161
- children: [/* @__PURE__ */ e(D, {
162
- name: "info",
163
- size: 14,
164
- sx: { color: "text.secondary" }
165
- }), /* @__PURE__ */ e(l, {
166
- color: "text.secondary",
167
- variant: "caption",
168
- children: r.credit_limit_not_shared
169
- })]
170
- })]
171
- })]
172
- }), /* @__PURE__ */ o(d, {
134
+ children: /* @__PURE__ */ e(a, { sx: {
135
+ bgcolor: f(i).color(t),
136
+ borderRadius: 999,
137
+ height: "100%",
138
+ width: `${i}%`
139
+ } })
140
+ }), /* @__PURE__ */ n(l, {
141
+ "aria-hidden": !0,
173
142
  sx: {
174
- gap: 12,
175
- mt: 24,
176
- pl: 52
143
+ alignItems: "center",
144
+ ml: "30%",
145
+ transform: "translateX(-50%)",
146
+ width: "max-content"
177
147
  },
178
- children: [/* @__PURE__ */ o(d, {
148
+ children: [/* @__PURE__ */ e(a, { sx: {
149
+ bgcolor: "divider",
150
+ height: 6,
151
+ width: "1px"
152
+ } }), /* @__PURE__ */ e(d, {
153
+ variant: "caption",
154
+ children: D
155
+ })]
156
+ })]
157
+ });
158
+ }, C = (o, i) => [
159
+ o.label,
160
+ g(o.amount, x.cents),
161
+ o.percentage === null ? void 0 : `${o.percentage}%`,
162
+ i
163
+ ].filter(Boolean).join(", "), H = ({ accountDetailsLabel: o, card: i, copy: t, onClick: r }) => /* @__PURE__ */ e(a, {
164
+ component: "li",
165
+ children: /* @__PURE__ */ n(a, {
166
+ ...r && {
167
+ "aria-haspopup": "dialog",
168
+ "aria-label": C(i, o),
169
+ component: A,
170
+ onClick: r
171
+ },
172
+ sx: {
173
+ backgroundImage: _,
174
+ bgcolor: "background.paper",
175
+ borderRadius: "8px",
176
+ boxShadow: R[1],
177
+ display: "block",
178
+ p: 16,
179
+ textAlign: "left",
180
+ width: "100%",
181
+ ...r && {
182
+ "&:hover": { bgcolor: "action.hover" },
183
+ "&.Mui-focusVisible": { bgcolor: "action.focus" }
184
+ }
185
+ },
186
+ children: [
187
+ /* @__PURE__ */ n(l, {
179
188
  sx: {
180
- alignItems: "center",
181
- borderBottom: "1px solid",
182
- borderColor: "divider",
189
+ alignItems: "flex-start",
183
190
  flexDirection: "row",
184
- justifyContent: "space-between",
185
- pb: 10
191
+ gap: 12
186
192
  },
187
- children: [/* @__PURE__ */ o(d, {
188
- sx: {
189
- alignItems: "center",
190
- flexDirection: "row",
191
- gap: 8
192
- },
193
- children: [/* @__PURE__ */ e(m, { sx: {
194
- bgcolor: s,
195
- borderRadius: "1px",
196
- flexShrink: 0,
197
- height: 8,
198
- width: 8
199
- } }), /* @__PURE__ */ e(l, {
200
- variant: "caption",
201
- children: r.credit_utilized
202
- })]
203
- }), /* @__PURE__ */ o(d, {
204
- sx: {
205
- flexDirection: "row",
206
- fontVariantNumeric: "tabular-nums",
207
- gap: 4
208
- },
209
- children: [/* @__PURE__ */ e(l, {
193
+ children: [
194
+ /* @__PURE__ */ e(z, {
195
+ alt: "",
196
+ institutionGuid: i.institutionGuid,
197
+ logoUrl: i.institutionGuid ? void 0 : T,
198
+ size: 40
199
+ }),
200
+ /* @__PURE__ */ n(l, {
201
+ sx: {
202
+ flexGrow: 1,
203
+ minWidth: 0
204
+ },
205
+ children: [/* @__PURE__ */ e(d, {
206
+ bold: !0,
207
+ truncate: !0,
208
+ variant: "body1",
209
+ children: i.label
210
+ }), /* @__PURE__ */ e(d, {
211
+ variant: "body2",
212
+ children: g(i.amount, x.cents)
213
+ })]
214
+ }),
215
+ i.percentage !== null && /* @__PURE__ */ n(d, {
210
216
  bold: !0,
211
- variant: "caption",
212
- children: h(t.amount)
213
- }), c && /* @__PURE__ */ o(z, { children: [/* @__PURE__ */ e(l, {
214
- variant: "caption",
215
- children: "/"
216
- }), /* @__PURE__ */ e(l, {
217
- variant: "caption",
218
- children: h(i)
219
- })] })]
220
- })]
221
- }), c && /* @__PURE__ */ o(d, {
217
+ variant: "body1",
218
+ children: [i.percentage, "%"]
219
+ })
220
+ ]
221
+ }),
222
+ i.percentage === null && /* @__PURE__ */ n(l, {
222
223
  sx: {
224
+ alignItems: "center",
223
225
  flexDirection: "row",
224
- justifyContent: "space-between"
226
+ gap: 4,
227
+ mt: 16
225
228
  },
226
- children: [/* @__PURE__ */ e(l, {
229
+ children: [/* @__PURE__ */ e(k, {
230
+ name: "info",
231
+ size: 14,
232
+ sx: { color: "text.secondary" }
233
+ }), /* @__PURE__ */ e(d, {
234
+ color: "text.secondary",
227
235
  variant: "caption",
228
- children: r.credit_utilization_ratio
229
- }), /* @__PURE__ */ o(l, {
230
- bold: !0,
231
- variant: "caption",
232
- children: [a, "%"]
236
+ children: t.credit_limit_not_shared
233
237
  })]
234
- })]
235
- })]
236
- });
237
- }, U = (t) => {
238
- const r = /* @__PURE__ */ new Map();
239
- return t.map((n) => {
240
- const i = (r.get(n.guid) ?? 0) + 1;
241
- return r.set(n.guid, i), {
242
- card: n,
243
- key: i === 1 ? n.guid : `${n.guid}-${i}`
238
+ }),
239
+ /* @__PURE__ */ e(E, { card: i })
240
+ ]
241
+ })
242
+ }), N = (o) => {
243
+ const i = /* @__PURE__ */ new Map();
244
+ return o.map((t) => {
245
+ const r = (i.get(t.guid) ?? 0) + 1;
246
+ return i.set(t.guid, r), {
247
+ card: t,
248
+ key: r === 1 ? t.guid : `${t.guid}-${r}`
244
249
  };
245
250
  });
246
- }, F = ({ cards: t, copy: r, descriptionHtml: n, summary: i, title: a }) => /* @__PURE__ */ o(d, {
251
+ }, J = ({ accountDetailsLabel: o, cards: i, copy: t, onCardClick: r, summary: m }) => /* @__PURE__ */ n(l, {
247
252
  sx: {
248
253
  bgcolor: "background.default",
249
- gap: 8,
250
- pb: 24
254
+ minHeight: "100%"
251
255
  },
252
- children: [
253
- (a || i || n) && /* @__PURE__ */ o(u, { children: [
254
- a && /* @__PURE__ */ e(p, { children: a }),
255
- i && /* @__PURE__ */ e(T, {
256
- copy: r,
257
- summary: i
256
+ children: [/* @__PURE__ */ n(l, {
257
+ sx: {
258
+ bgcolor: "background.paper",
259
+ p: 24
260
+ },
261
+ children: [
262
+ /* @__PURE__ */ e(b, { children: t.what_does_this_mean }),
263
+ /* @__PURE__ */ e(U, { copy: t }),
264
+ /* @__PURE__ */ e(B, {
265
+ copy: t,
266
+ percentage: m?.percentage
258
267
  }),
259
- n && /* @__PURE__ */ e(l, {
260
- component: "p",
261
- dangerouslySetInnerHTML: { __html: f(n) },
262
- sx: { mt: 16 },
263
- variant: "body2"
268
+ /* @__PURE__ */ e(L, {
269
+ icon: S,
270
+ message: /* @__PURE__ */ e("span", { dangerouslySetInnerHTML: { __html: w(t.tip || t.recommendation) } }),
271
+ sx: {
272
+ mb: 0,
273
+ mt: 24,
274
+ mx: 0
275
+ }
264
276
  })
265
- ] }),
266
- /* @__PURE__ */ e(y, { copy: r }),
267
- t.length > 0 && /* @__PURE__ */ o(u, { children: [/* @__PURE__ */ e(p, { children: r.per_card_header }), /* @__PURE__ */ e(d, {
277
+ ]
278
+ }), i.length > 0 && /* @__PURE__ */ n(l, {
279
+ sx: {
280
+ borderTop: "1px solid",
281
+ borderTopColor: "divider",
282
+ p: 24
283
+ },
284
+ children: [/* @__PURE__ */ e(b, { children: t.your_cards || t.per_card_header }), /* @__PURE__ */ e(l, {
268
285
  component: "ul",
269
286
  role: "list",
270
287
  sx: {
@@ -273,15 +290,17 @@ var h = (t) => C(t, w.cents), u = ({ children: t }) => /* @__PURE__ */ e(d, {
273
290
  m: 0,
274
291
  p: 0
275
292
  },
276
- children: U(t).map(({ card: c, key: s }) => /* @__PURE__ */ e(R, {
277
- card: c,
278
- copy: r
279
- }, s))
280
- })] })
281
- ]
293
+ children: N(i).map(({ card: s, key: u }) => /* @__PURE__ */ e(H, {
294
+ accountDetailsLabel: o,
295
+ card: s,
296
+ copy: t,
297
+ onClick: r && s.accountLoaded ? () => r(s) : void 0
298
+ }, u))
299
+ })]
300
+ })]
282
301
  });
283
302
  export {
284
- F as default
303
+ J as default
285
304
  };
286
305
 
287
306
  //# sourceMappingURL=CreditUtilizationContent.es.js.map