@mx-cartographer/experiences 9.7.154 → 9.7.156
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.
- package/CHANGELOG.md +13 -0
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/AccountDetailsBlock.es.js +19 -22
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/AccountDetailsBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.es.js +43 -48
- package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js +30 -34
- package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js +52 -52
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/BlockErrorMessage.d.ts +4 -0
- package/dist/insights-v2/actionBlocks/BlockErrorMessage.es.js +17 -0
- package/dist/insights-v2/actionBlocks/BlockErrorMessage.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js +131 -135
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/ContactSupportActionBlock.es.js +14 -18
- package/dist/insights-v2/actionBlocks/ContactSupportActionBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationBlock.es.js +19 -25
- package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsBlock.es.js +26 -28
- package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/HelpBlock/HelpBlock.es.js +11 -14
- package/dist/insights-v2/actionBlocks/HelpBlock/HelpBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.es.js +12 -12
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/OverdraftBlock/OverdraftBlock.es.js +28 -30
- package/dist/insights-v2/actionBlocks/OverdraftBlock/OverdraftBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.es.js +53 -55
- package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.es.js +26 -31
- package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesContent.es.js +18 -18
- package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesContent.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/PlaceholderActionBlock.es.js +23 -22
- package/dist/insights-v2/actionBlocks/PlaceholderActionBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js +38 -41
- package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js +44 -44
- package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/SurveyModalActionBlock.es.js +24 -24
- package/dist/insights-v2/actionBlocks/SurveyModalActionBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/TransactionDetailsBlock.es.js +11 -16
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/TransactionDetailsBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/useTransactionDetailsBlock.es.js +20 -20
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/useTransactionDetailsBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/util.d.ts +1 -2
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/util.es.js +3 -7
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/util.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js +39 -42
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +102 -104
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare.es.js +11 -11
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.es.js +58 -58
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.d.ts +7 -0
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.es.js +28 -0
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSubscriptionHeader.es.js +14 -33
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSubscriptionHeader.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.es.js +24 -41
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/useOpenedCta.d.ts +9 -0
- package/dist/insights-v2/actionBlocks/useOpenedCta.es.js +11 -0
- package/dist/insights-v2/actionBlocks/useOpenedCta.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/util.d.ts +2 -1
- package/dist/insights-v2/actionBlocks/util.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useBeatActions as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
sx: { p: 24 },
|
|
14
|
-
children: /* @__PURE__ */ p(f, { children: c?.error_message ?? "" })
|
|
15
|
-
});
|
|
16
|
-
}), d = (t, r, o) => t === "contact_support_block" && (!r.enable_support_requests || !o);
|
|
1
|
+
import { useInsightsV2Store as e } from "../../common/context/hooks.es.js";
|
|
2
|
+
import { useBeatActions as s } from "../beatActions.es.js";
|
|
3
|
+
import { BlockErrorMessage as c } from "./BlockErrorMessage.es.js";
|
|
4
|
+
import { useEffect as n } from "react";
|
|
5
|
+
import { observer as i } from "mobx-react-lite";
|
|
6
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
7
|
+
var _ = i(function(r) {
|
|
8
|
+
const { onContactSupport: o } = s(), { closeActionDrawer: p } = e();
|
|
9
|
+
return n(() => {
|
|
10
|
+
o && (p(), o());
|
|
11
|
+
}, [p, o]), o ? null : /* @__PURE__ */ u(c, {});
|
|
12
|
+
}), b = (t, r, o) => t === "contact_support_block" && (!r.enable_support_requests || !o);
|
|
17
13
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
_ as ContactSupportActionBlock,
|
|
15
|
+
b as isContactSupportCtaDisabled
|
|
20
16
|
};
|
|
21
17
|
|
|
22
18
|
//# sourceMappingURL=ContactSupportActionBlock.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContactSupportActionBlock.es.js","names":[],"sources":["../../../src/insights-v2/actionBlocks/ContactSupportActionBlock.tsx"],"sourcesContent":["import { useEffect } from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport
|
|
1
|
+
{"version":3,"file":"ContactSupportActionBlock.es.js","names":[],"sources":["../../../src/insights-v2/actionBlocks/ContactSupportActionBlock.tsx"],"sourcesContent":["import { useEffect } from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport { useInsightsV2Store } from '../../common'\nimport { useBeatActions } from '../beatActions'\nimport type { ActionBlockProps } from '../mappings/blocks'\nimport { BlockErrorMessage } from './BlockErrorMessage'\n\n/**\n * `contact_support_block` (`insights_v2.2.md` §7.3) is the help module's contact-support flow,\n * but insights-v2 must **not** import it: hosts that don't ship the Help widget (pulse's webpack\n * config `IgnorePlugin`s every `help` resource inside `@mx-cartographer/experiences/dist`) would\n * get a `webpackMissingModule` stub and crash at import time. So the flow is injected instead:\n *\n * - Feed / mini cards: the host passes `beatActions.onContactSupport` (pulse already threads\n * `beatActions` into `BaseLayout`). `BaseLayout` calls it directly instead of opening a drawer.\n * - Transaction details drawer: the host passes `onContactSupport` to `TransactionDetails`.\n * - The experiences Help widget is itself a host and wires `RequestSupport` through the same hook.\n *\n * The CTA renders disabled (label shown, `aria-disabled`, nothing opens or posts) whenever the\n * client's `enable_support_requests` is off **or** the host supplied no handler — see\n * `isContactSupportCtaDisabled`.\n *\n * This registry entry is only a safety net for a drawer opened by a path that bypassed that gate\n * (e.g. a stale `actionDrawer` state): it hands off to the host handler if one exists, otherwise\n * closes the drawer and shows the generic error.\n */\nexport const ContactSupportActionBlock = observer(function ContactSupportActionBlock(\n _props: ActionBlockProps,\n) {\n const { onContactSupport } = useBeatActions()\n const { closeActionDrawer } = useInsightsV2Store()\n\n useEffect(() => {\n if (onContactSupport) {\n closeActionDrawer()\n onContactSupport()\n }\n }, [closeActionDrawer, onContactSupport])\n\n if (onContactSupport) return null\n\n return <BlockErrorMessage />\n})\n\n/**\n * Whether a host must render a CTA disabled. Only `contact_support_block` is gated: by the client's\n * `enable_support_requests` config (default false) and by whether the host actually wired a handler.\n * Every other block is always enabled. No fallback to a host post message when it is off.\n */\nexport const isContactSupportCtaDisabled = (\n block: string | null | undefined,\n config: { enable_support_requests?: boolean },\n onContactSupport?: (() => void) | null,\n): boolean =>\n block === 'contact_support_block' && (!config.enable_support_requests || !onContactSupport)\n"],"mappings":";;;;;;AA2BA,IAAa,IAA4B,EAAS,SAChD,GACA;AACA,QAAM,EAAE,kBAAA,EAAA,IAAqB,EAAe,GACtC,EAAE,mBAAA,EAAA,IAAsB,EAAmB;AASjD,SAPA,EAAA,MAAgB;AACd,IAAI,MACF,EAAkB,GAClB,EAAiB;AAAA,EAErB,GAAG,CAAC,GAAmB,CAAgB,CAAC,GAEpC,IAAyB,OAEtB,gBAAA,EAAC,GAAD,CAAoB,CAAA;AAC7B,CAAC,GAOY,IAAA,CACX,GACA,GACA,MAEA,MAAU,4BAA4B,CAAC,EAAO,2BAA2B,CAAC"}
|
|
@@ -1,32 +1,26 @@
|
|
|
1
|
-
import { useAccountStore as
|
|
2
|
-
import
|
|
3
|
-
import { readCardRows as
|
|
4
|
-
import
|
|
5
|
-
import { observer as
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var b = (e, i) => ({
|
|
10
|
-
...e,
|
|
1
|
+
import { useAccountStore as p, useGlobalCopyStore as l } from "../../../common/context/hooks.es.js";
|
|
2
|
+
import { BlockErrorMessage as u } from "../BlockErrorMessage.es.js";
|
|
3
|
+
import { readCardRows as f, readSummary as g } from "./layout.es.js";
|
|
4
|
+
import y from "./CreditUtilizationContent.es.js";
|
|
5
|
+
import { observer as C } from "mobx-react-lite";
|
|
6
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
7
|
+
var _ = (r, i) => ({
|
|
8
|
+
...r,
|
|
11
9
|
institutionGuid: i
|
|
12
|
-
}),
|
|
13
|
-
const {
|
|
14
|
-
if (!
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
copy: n,
|
|
23
|
-
descriptionHtml: r?.description?.html_text,
|
|
24
|
-
summary: _(s),
|
|
25
|
-
title: r?.title
|
|
10
|
+
}), S = C(function({ beat: i }) {
|
|
11
|
+
const { insights_feed: a } = l(), { accounts: c } = p(), e = a?.credit_utilization;
|
|
12
|
+
if (!e) return /* @__PURE__ */ s(u, {});
|
|
13
|
+
const o = i.insights_payload, n = o?.instance_slot_data, d = new Map(c.map((t) => [t.guid, t.institution_guid ?? ""])), m = f(n?.data_series).map((t) => _(t, d.get(t.guid) ?? ""));
|
|
14
|
+
return /* @__PURE__ */ s(y, {
|
|
15
|
+
cards: m,
|
|
16
|
+
copy: e,
|
|
17
|
+
descriptionHtml: o?.description?.html_text,
|
|
18
|
+
summary: g(n),
|
|
19
|
+
title: o?.title
|
|
26
20
|
});
|
|
27
21
|
});
|
|
28
22
|
export {
|
|
29
|
-
|
|
23
|
+
S as CreditUtilizationBlock
|
|
30
24
|
};
|
|
31
25
|
|
|
32
26
|
//# sourceMappingURL=CreditUtilizationBlock.es.js.map
|
package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationBlock.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreditUtilizationBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationBlock.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"CreditUtilizationBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationBlock.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\n\nimport { useAccountStore, useGlobalCopyStore } from '../../../common'\nimport type { ActionBlockProps } from '../../mappings/blocks'\nimport { BlockErrorMessage } from '../BlockErrorMessage'\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 { 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 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":";;;;;;AASA,IAAM,IAAA,CAAU,GAAoB,OAAoD;AAAA,EACtF,GAAG;AAAA,EACH,iBAAA;AACF,IAQa,IAAyB,EAAS,SAAgC,EAC7E,MAAA,EAAA,GACmB;AACnB,QAAM,EAAE,eAAe,EAAA,IAAqB,EAAmB,GACzD,EAAE,UAAA,EAAA,IAAa,EAAgB,GAC/B,IAAO,GAAkB;AAE/B,MAAI,CAAC,EACH,QAAO,gBAAA,EAAC,GAAD,CAAoB,CAAA;AAG7B,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,15 +1,16 @@
|
|
|
1
|
-
import { buildDynamicCopy as
|
|
1
|
+
import { buildDynamicCopy as f } from "../../../core/utils/Localization.es.js";
|
|
2
2
|
import { useGlobalCopyStore as v } from "../../../common/context/hooks.es.js";
|
|
3
|
-
import { CURRENCY_FORMAT as s, formatCurrency as
|
|
3
|
+
import { CURRENCY_FORMAT as s, formatCurrency as p } from "../../../core/utils/NumberFormatting.es.js";
|
|
4
|
+
import { BlockErrorMessage as x } from "../BlockErrorMessage.es.js";
|
|
4
5
|
import { asNumber as _ } from "../../blocks/slotReaders.es.js";
|
|
5
6
|
import { variants as h } from "../../blocks/ChartBlocks/StepChartBlock/index.es.js";
|
|
6
7
|
import { stepForBalance as y } from "./layout.es.js";
|
|
7
8
|
import { SavingsCalculator as C } from "./SavingsCalculator.es.js";
|
|
8
|
-
import { observer as
|
|
9
|
-
import
|
|
10
|
-
import { Text as
|
|
11
|
-
import { jsx as o, jsxs as
|
|
12
|
-
var m = ({ label: i, value:
|
|
9
|
+
import { observer as k } from "mobx-react-lite";
|
|
10
|
+
import a from "@mui/material/Stack";
|
|
11
|
+
import { Text as c } from "@mxenabled/mxui";
|
|
12
|
+
import { jsx as o, jsxs as t } from "react/jsx-runtime";
|
|
13
|
+
var m = ({ label: i, value: e }) => /* @__PURE__ */ t(a, {
|
|
13
14
|
"aria-label": i,
|
|
14
15
|
role: "group",
|
|
15
16
|
sx: {
|
|
@@ -20,58 +21,55 @@ var m = ({ label: i, value: a }) => /* @__PURE__ */ n(e, {
|
|
|
20
21
|
gap: 4,
|
|
21
22
|
p: 12
|
|
22
23
|
},
|
|
23
|
-
children: [/* @__PURE__ */ o(
|
|
24
|
+
children: [/* @__PURE__ */ o(c, {
|
|
24
25
|
color: "text.secondary",
|
|
25
26
|
variant: "caption",
|
|
26
27
|
children: i
|
|
27
|
-
}), /* @__PURE__ */ o(
|
|
28
|
+
}), /* @__PURE__ */ o(c, {
|
|
28
29
|
bold: !0,
|
|
29
30
|
component: "p",
|
|
30
31
|
variant: "h3",
|
|
31
|
-
children:
|
|
32
|
+
children: e
|
|
32
33
|
})]
|
|
33
|
-
}), U =
|
|
34
|
-
const {
|
|
35
|
-
if (!r) return /* @__PURE__ */ o(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
});
|
|
39
|
-
const t = _(a.insights_payload?.drilldown_data?.savings_account_balance) ?? 0, { goal: l, index: u, labelKey: b } = y(t), { WithText: f } = h;
|
|
40
|
-
return /* @__PURE__ */ n(e, {
|
|
34
|
+
}), U = k(function({ beat: e }) {
|
|
35
|
+
const { insights_feed: d } = v(), r = d?.emergency_savings;
|
|
36
|
+
if (!r) return /* @__PURE__ */ o(x, {});
|
|
37
|
+
const n = _(e.insights_payload?.drilldown_data?.savings_account_balance) ?? 0, { goal: l, index: g, labelKey: u } = y(n), { WithText: b } = h;
|
|
38
|
+
return /* @__PURE__ */ t(a, {
|
|
41
39
|
sx: {
|
|
42
40
|
bgcolor: "background.default",
|
|
43
41
|
gap: 24,
|
|
44
42
|
p: 24
|
|
45
43
|
},
|
|
46
|
-
children: [/* @__PURE__ */
|
|
44
|
+
children: [/* @__PURE__ */ t(a, {
|
|
47
45
|
sx: {
|
|
48
46
|
bgcolor: "background.paper",
|
|
49
47
|
borderRadius: "8px",
|
|
50
48
|
gap: 16,
|
|
51
49
|
p: 16
|
|
52
50
|
},
|
|
53
|
-
children: [/* @__PURE__ */ o(
|
|
54
|
-
completed_steps:
|
|
55
|
-
label_1: r[
|
|
56
|
-
label_2:
|
|
57
|
-
} }), /* @__PURE__ */
|
|
51
|
+
children: [/* @__PURE__ */ o(b, { slotData: {
|
|
52
|
+
completed_steps: g,
|
|
53
|
+
label_1: r[u].toUpperCase(),
|
|
54
|
+
label_2: f(r.amount_in_savings, p(l, s.whole))
|
|
55
|
+
} }), /* @__PURE__ */ t(a, {
|
|
58
56
|
sx: {
|
|
59
57
|
flexDirection: "row",
|
|
60
58
|
gap: 12
|
|
61
59
|
},
|
|
62
60
|
children: [/* @__PURE__ */ o(m, {
|
|
63
61
|
label: r.total_savings_balance,
|
|
64
|
-
value:
|
|
62
|
+
value: p(n, s.cents)
|
|
65
63
|
}), /* @__PURE__ */ o(m, {
|
|
66
64
|
label: r.savings_goal,
|
|
67
|
-
value:
|
|
65
|
+
value: p(l, s.whole)
|
|
68
66
|
})]
|
|
69
67
|
})]
|
|
70
68
|
}), /* @__PURE__ */ o(C, {
|
|
71
|
-
balance:
|
|
69
|
+
balance: n,
|
|
72
70
|
copy: r,
|
|
73
71
|
goal: l
|
|
74
|
-
},
|
|
72
|
+
}, e.guid)]
|
|
75
73
|
});
|
|
76
74
|
});
|
|
77
75
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmergencySavingsBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsBlock.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport { useGlobalCopyStore } from '../../../common'\nimport { buildDynamicCopy } from '../../../core'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../core/utils/NumberFormatting'\nimport { variants as stepChartVariants } from '../../blocks/ChartBlocks/StepChartBlock'\nimport { asNumber } from '../../blocks/slotReaders'\nimport type { ActionBlockProps } from '../../mappings/blocks'\n\nimport { SavingsCalculator } from './SavingsCalculator'\nimport { stepForBalance } from './layout'\n\nconst AmountBox = ({ label, value }: { label: string; value: string }) => (\n <Stack\n aria-label={label}\n role=\"group\"\n sx={{\n border: '1px solid',\n borderColor: 'divider',\n borderRadius: '8px',\n flex: 1,\n gap: 4,\n p: 12,\n }}\n >\n <Text color=\"text.secondary\" variant=\"caption\">\n {label}\n </Text>\n <Text bold={true} component=\"p\" variant=\"h3\">\n {value}\n </Text>\n </Stack>\n)\n\nexport const EmergencySavingsBlock = observer(function EmergencySavingsBlock({\n beat,\n}: ActionBlockProps) {\n const {
|
|
1
|
+
{"version":3,"file":"EmergencySavingsBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsBlock.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport { useGlobalCopyStore } from '../../../common'\nimport { buildDynamicCopy } from '../../../core'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../core/utils/NumberFormatting'\nimport { variants as stepChartVariants } from '../../blocks/ChartBlocks/StepChartBlock'\nimport { asNumber } from '../../blocks/slotReaders'\nimport type { ActionBlockProps } from '../../mappings/blocks'\nimport { BlockErrorMessage } from '../BlockErrorMessage'\n\nimport { SavingsCalculator } from './SavingsCalculator'\nimport { stepForBalance } from './layout'\n\nconst AmountBox = ({ label, value }: { label: string; value: string }) => (\n <Stack\n aria-label={label}\n role=\"group\"\n sx={{\n border: '1px solid',\n borderColor: 'divider',\n borderRadius: '8px',\n flex: 1,\n gap: 4,\n p: 12,\n }}\n >\n <Text color=\"text.secondary\" variant=\"caption\">\n {label}\n </Text>\n <Text bold={true} component=\"p\" variant=\"h3\">\n {value}\n </Text>\n </Stack>\n)\n\nexport const EmergencySavingsBlock = observer(function EmergencySavingsBlock({\n beat,\n}: ActionBlockProps) {\n const { insights_feed: insightsFeedCopy } = useGlobalCopyStore()\n const copy = insightsFeedCopy?.emergency_savings\n\n if (!copy) {\n return <BlockErrorMessage />\n }\n\n const balance = asNumber(beat.insights_payload?.drilldown_data?.savings_account_balance) ?? 0\n const { goal, index, labelKey } = stepForBalance(balance)\n const { WithText: Stepper } = stepChartVariants\n\n return (\n <Stack sx={{ bgcolor: 'background.default', gap: 24, p: 24 }}>\n <Stack sx={{ bgcolor: 'background.paper', borderRadius: '8px', gap: 16, p: 16 }}>\n <Stepper\n slotData={{\n completed_steps: index,\n label_1: copy[labelKey].toUpperCase(),\n label_2: buildDynamicCopy(\n copy.amount_in_savings,\n formatCurrency(goal, CURRENCY_FORMAT.whole),\n ) as string,\n }}\n />\n <Stack sx={{ flexDirection: 'row', gap: 12 }}>\n <AmountBox\n label={copy.total_savings_balance}\n value={formatCurrency(balance, CURRENCY_FORMAT.cents)}\n />\n <AmountBox\n label={copy.savings_goal}\n value={formatCurrency(goal, CURRENCY_FORMAT.whole)}\n />\n </Stack>\n </Stack>\n <SavingsCalculator balance={balance} copy={copy} goal={goal} key={beat.guid} />\n </Stack>\n )\n})\n"],"mappings":";;;;;;;;;;;;AAgBA,IAAM,IAAA,CAAa,EAAE,OAAA,GAAO,OAAA,EAAA,MAC1B,gBAAA,EAAC,GAAD;AAAA,EACE,cAAY;AAAA,EACZ,MAAK;AAAA,EACL,IAAI;AAAA,IACF,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,cAAc;AAAA,IACd,MAAM;AAAA,IACN,KAAK;AAAA,IACL,GAAG;AAAA,EACL;AAAA,EAVF,UAAA,CAYE,gBAAA,EAAC,GAAD;AAAA,IAAM,OAAM;AAAA,IAAiB,SAAQ;AAAA,IAClC,UAAA;AAAA,EACG,CAAA,GACN,gBAAA,EAAC,GAAD;AAAA,IAAM,MAAM;AAAA,IAAM,WAAU;AAAA,IAAI,SAAQ;AAAA,IACrC,UAAA;AAAA,EACG,CAAA,CACD;IAGI,IAAwB,EAAS,SAA+B,EAC3E,MAAA,EAAA,GACmB;AACnB,QAAM,EAAE,eAAe,EAAA,IAAqB,EAAmB,GACzD,IAAO,GAAkB;AAE/B,MAAI,CAAC,EACH,QAAO,gBAAA,EAAC,GAAD,CAAoB,CAAA;AAG7B,QAAM,IAAU,EAAS,EAAK,kBAAkB,gBAAgB,uBAAuB,KAAK,GACtF,EAAE,MAAA,GAAM,OAAA,GAAO,UAAA,EAAA,IAAa,EAAe,CAAO,GAClD,EAAE,UAAU,EAAA,IAAY;AAE9B,SACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI;AAAA,MAAE,SAAS;AAAA,MAAsB,KAAK;AAAA,MAAI,GAAG;AAAA,IAAG;AAAA,IAA3D,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,MAAO,IAAI;AAAA,QAAE,SAAS;AAAA,QAAoB,cAAc;AAAA,QAAO,KAAK;AAAA,QAAI,GAAG;AAAA,MAAG;AAAA,MAA9E,UAAA,CACE,gBAAA,EAAC,GAAD,EACE,UAAU;AAAA,QACR,iBAAiB;AAAA,QACjB,SAAS,EAAK,CAAA,EAAU,YAAY;AAAA,QACpC,SAAS,EACP,EAAK,mBACL,EAAe,GAAM,EAAgB,KAAK,CAC5C;AAAA,MACF,EACD,CAAA,GACD,gBAAA,EAAC,GAAD;AAAA,QAAO,IAAI;AAAA,UAAE,eAAe;AAAA,UAAO,KAAK;AAAA,QAAG;AAAA,QAA3C,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,UACE,OAAO,EAAK;AAAA,UACZ,OAAO,EAAe,GAAS,EAAgB,KAAK;AAAA,QACrD,CAAA,GACD,gBAAA,EAAC,GAAD;AAAA,UACE,OAAO,EAAK;AAAA,UACZ,OAAO,EAAe,GAAM,EAAgB,KAAK;AAAA,QAClD,CAAA,CACI;AAAA,MACF,CAAA,CAAA;AAAA,IACP,CAAA,GAAA,gBAAA,EAAC,GAAD;AAAA,MAA4B,SAAA;AAAA,MAAe,MAAA;AAAA,MAAY,MAAA;AAAA,IAAuB,GAAZ,EAAK,IAAO,CACzE;AAAA;AAEX,CAAC"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { sanitizeHtml as
|
|
2
|
-
import {
|
|
1
|
+
import { sanitizeHtml as l } from "../../../core/utils/SanitizeHtml.es.js";
|
|
2
|
+
import { BlockErrorMessage as m } from "../BlockErrorMessage.es.js";
|
|
3
3
|
import { readHelp as i } from "./layout.es.js";
|
|
4
|
-
import { observer as
|
|
5
|
-
import
|
|
4
|
+
import { observer as n } from "mobx-react-lite";
|
|
5
|
+
import p from "@mui/material/Stack";
|
|
6
6
|
import { Text as t } from "@mxenabled/mxui";
|
|
7
|
-
import { jsx as o, jsxs as
|
|
7
|
+
import { jsx as o, jsxs as a } from "react/jsx-runtime";
|
|
8
8
|
var s = {
|
|
9
9
|
"& > *": { m: 0 },
|
|
10
10
|
"& > * + *": { mt: 24 },
|
|
11
11
|
"& ul, & ol": { pl: 24 }
|
|
12
|
-
},
|
|
13
|
-
const
|
|
14
|
-
return r ? /* @__PURE__ */
|
|
12
|
+
}, x = n(function({ beat: e }) {
|
|
13
|
+
const r = i(e.insights_payload?.drilldown_data);
|
|
14
|
+
return r ? /* @__PURE__ */ a(p, {
|
|
15
15
|
sx: {
|
|
16
16
|
bgcolor: "background.paper",
|
|
17
17
|
gap: 8,
|
|
@@ -24,17 +24,14 @@ var s = {
|
|
|
24
24
|
children: r.title
|
|
25
25
|
}), /* @__PURE__ */ o(t, {
|
|
26
26
|
component: "div",
|
|
27
|
-
dangerouslySetInnerHTML: { __html:
|
|
27
|
+
dangerouslySetInnerHTML: { __html: l(r.html) },
|
|
28
28
|
sx: s,
|
|
29
29
|
variant: "body1"
|
|
30
30
|
})]
|
|
31
|
-
}) : /* @__PURE__ */ o(
|
|
32
|
-
sx: { p: 24 },
|
|
33
|
-
children: /* @__PURE__ */ o(t, { children: l.error_message })
|
|
34
|
-
});
|
|
31
|
+
}) : /* @__PURE__ */ o(m, {});
|
|
35
32
|
});
|
|
36
33
|
export {
|
|
37
|
-
|
|
34
|
+
x as HelpBlock
|
|
38
35
|
};
|
|
39
36
|
|
|
40
37
|
//# sourceMappingURL=HelpBlock.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HelpBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/HelpBlock/HelpBlock.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport {
|
|
1
|
+
{"version":3,"file":"HelpBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/HelpBlock/HelpBlock.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport type { Beat } from '../../../core'\nimport { sanitizeHtml } from '../../../core/utils/SanitizeHtml'\nimport { BlockErrorMessage } from '../BlockErrorMessage'\nimport { readHelp } from './layout'\n\nconst HELP_HTML_SX = {\n '& > *': { m: 0 },\n '& > * + *': { mt: 24 },\n '& ul, & ol': { pl: 24 },\n} as const\n\nexport interface HelpBlockProps {\n beat: Beat\n}\n\n/**\n * The \"How was this calculated?\" drawer: the beat's pre-localized help title and body, read from\n * the payload's `drilldown_data` (`help_title`, `help_html`). Opened by a CTA naming `help_block`\n * and by the Transaction List drawer's \"Learn More\" link.\n */\nexport const HelpBlock = observer(function HelpBlock({ beat }: HelpBlockProps) {\n const help = readHelp(beat.insights_payload?.drilldown_data)\n\n if (!help) {\n return <BlockErrorMessage />\n }\n\n return (\n <Stack sx={{ bgcolor: 'background.paper', gap: 8, p: 24 }}>\n <Text bold={true} component=\"h3\" variant=\"h3\">\n {help.title}\n </Text>\n <Text\n component=\"div\"\n dangerouslySetInnerHTML={{ __html: sanitizeHtml(help.html) }}\n sx={HELP_HTML_SX}\n variant=\"body1\"\n />\n </Stack>\n )\n})\n"],"mappings":";;;;;;;AAUA,IAAM,IAAe;AAAA,EACnB,SAAS,EAAE,GAAG,EAAE;AAAA,EAChB,aAAa,EAAE,IAAI,GAAG;AAAA,EACtB,cAAc,EAAE,IAAI,GAAG;AACzB,GAWa,IAAY,EAAS,SAAmB,EAAE,MAAA,EAAA,GAAwB;AAC7E,QAAM,IAAO,EAAS,EAAK,kBAAkB,cAAc;AAE3D,SAAK,IAKH,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI;AAAA,MAAE,SAAS;AAAA,MAAoB,KAAK;AAAA,MAAG,GAAG;AAAA,IAAG;AAAA,IAAxD,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,MAAM,MAAM;AAAA,MAAM,WAAU;AAAA,MAAK,SAAQ;AAAA,MACtC,UAAA,EAAK;AAAA,IACF,CAAA,GACN,gBAAA,EAAC,GAAD;AAAA,MACE,WAAU;AAAA,MACV,yBAAyB,EAAE,QAAQ,EAAa,EAAK,IAAI,EAAE;AAAA,MAC3D,IAAI;AAAA,MACJ,SAAQ;AAAA,IACT,CAAA,CACI;AAAA,OAdA,gBAAA,EAAC,GAAD,CAAoB,CAAA;AAgB/B,CAAC"}
|
package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.es.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { useGlobalCopyStore as
|
|
2
|
-
import {
|
|
3
|
-
import { resolveMakeTransferSlotData as a, resolveMakeTransferVariant as
|
|
4
|
-
import { MakeTransferActionBlock as
|
|
5
|
-
import { observer as
|
|
6
|
-
import { jsx as
|
|
7
|
-
var
|
|
8
|
-
const {
|
|
9
|
-
return /* @__PURE__ */
|
|
1
|
+
import { useGlobalCopyStore as n } from "../../../common/context/hooks.es.js";
|
|
2
|
+
import { useOpenedCta as s } from "../useOpenedCta.es.js";
|
|
3
|
+
import { resolveMakeTransferSlotData as a, resolveMakeTransferVariant as i } from "./layout.es.js";
|
|
4
|
+
import { MakeTransferActionBlock as f } from "./MakeTransferActionBlock.es.js";
|
|
5
|
+
import { observer as l } from "mobx-react-lite";
|
|
6
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
7
|
+
var T = l(function({ beat: r }) {
|
|
8
|
+
const { insights_feed: e } = n(), o = s(r), t = a(o?.drilldown_data) ?? a(r.insights_payload?.drilldown_data);
|
|
9
|
+
return /* @__PURE__ */ m(f, {
|
|
10
10
|
copy: e.make_transfer,
|
|
11
|
-
slotData:
|
|
12
|
-
variant:
|
|
11
|
+
slotData: t,
|
|
12
|
+
variant: i(o?.variant)
|
|
13
13
|
});
|
|
14
14
|
});
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
T as MakeTransferActionBlockLayer
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
//# sourceMappingURL=MakeTransferActionBlockLayer.es.js.map
|
package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MakeTransferActionBlockLayer.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\n\nimport { useGlobalCopyStore
|
|
1
|
+
{"version":3,"file":"MakeTransferActionBlockLayer.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\n\nimport { useGlobalCopyStore } from '../../../common'\n\nimport type { Beat } from '../../../core'\n\nimport { useOpenedCta } from '../useOpenedCta'\nimport { MakeTransferActionBlock } from './MakeTransferActionBlock'\nimport { resolveMakeTransferSlotData, resolveMakeTransferVariant } from './layout'\n\n/**\n * Adapter that plugs MakeTransfer into the ActionBlock registry.\n *\n * The variants are content-only — ActionBlockLayer owns the surrounding Drawer\n * (open/close/title). This adapter derives the variant from the clicked CTA, the\n * copy from GlobalCopyStore, and passes the slot data through; each variant reads\n * the fields it needs.\n */\nexport const MakeTransferActionBlockLayer = observer(function MakeTransferActionBlockLayer({\n beat,\n}: {\n beat: Beat\n}) {\n const { insights_feed: insightsFeedCopy } = useGlobalCopyStore()\n\n const cta = useOpenedCta(beat)\n // Per-CTA facts win over the envelope's.\n const slotData =\n resolveMakeTransferSlotData(cta?.drilldown_data) ??\n resolveMakeTransferSlotData(beat.insights_payload?.drilldown_data)\n\n return (\n <MakeTransferActionBlock\n copy={insightsFeedCopy.make_transfer}\n slotData={slotData}\n variant={resolveMakeTransferVariant(cta?.variant)}\n />\n )\n})\n"],"mappings":";;;;;;AAkBA,IAAa,IAA+B,EAAS,SAAsC,EACzF,MAAA,EAAA,GAGC;AACD,QAAM,EAAE,eAAe,EAAA,IAAqB,EAAmB,GAEzD,IAAM,EAAa,CAAI,GAEvB,IACJ,EAA4B,GAAK,cAAc,KAC/C,EAA4B,EAAK,kBAAkB,cAAc;AAEnE,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,MAAM,EAAiB;AAAA,IACb,UAAA;AAAA,IACV,SAAS,EAA2B,GAAK,OAAO;AAAA,EACjD,CAAA;AAEL,CAAC"}
|
|
@@ -1,32 +1,30 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useAccountStore as l, useGlobalCopyStore as
|
|
3
|
-
import { CURRENCY_FORMAT as
|
|
1
|
+
import u from "../../../common/utils/AccountDisplayName.es.js";
|
|
2
|
+
import { useAccountStore as l, useGlobalCopyStore as v } from "../../../common/context/hooks.es.js";
|
|
3
|
+
import { CURRENCY_FORMAT as g, formatCurrency as x } from "../../../core/utils/NumberFormatting.es.js";
|
|
4
|
+
import { BlockErrorMessage as h } from "../BlockErrorMessage.es.js";
|
|
4
5
|
import { resolveOverdraftFacts as y, resolvePrimaryAccount as _ } from "./layout.es.js";
|
|
5
6
|
import { ConfidenceMeter as b } from "./ConfidenceMeter.es.js";
|
|
6
7
|
import { useEffect as C } from "react";
|
|
7
8
|
import { observer as I } from "mobx-react-lite";
|
|
8
|
-
import
|
|
9
|
-
import { InstitutionLogo as
|
|
10
|
-
import { Icon as
|
|
11
|
-
import { Fragment as
|
|
9
|
+
import n from "@mui/material/Stack";
|
|
10
|
+
import { InstitutionLogo as k, Text as c } from "@mxenabled/mxui";
|
|
11
|
+
import { Icon as A } from "@mxenabled/mx-icons";
|
|
12
|
+
import { Fragment as F, jsx as r, jsxs as o } from "react/jsx-runtime";
|
|
12
13
|
var G = ({ beat: s }) => {
|
|
13
|
-
const { accountsLoaded:
|
|
14
|
+
const { accountsLoaded: e, loadAccounts: i } = l();
|
|
14
15
|
C(() => {
|
|
15
|
-
!s.primary_account && !
|
|
16
|
+
!s.primary_account && !e && i();
|
|
16
17
|
}, []);
|
|
17
|
-
}, L = I(function({ beat:
|
|
18
|
-
const {
|
|
19
|
-
if (!
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
});
|
|
23
|
-
const a = _(n, f), m = a ? v(a) : "", { amount: p, confidence: d } = y(n);
|
|
24
|
-
return /* @__PURE__ */ t(o, {
|
|
18
|
+
}, L = I(function({ beat: e }) {
|
|
19
|
+
const { insights_feed: i } = v(), { accounts: f } = l(), t = i?.transparent_overdraft;
|
|
20
|
+
if (!t) return /* @__PURE__ */ r(h, {});
|
|
21
|
+
const a = _(e, f), m = a ? u(a) : "", { amount: p, confidence: d } = y(e);
|
|
22
|
+
return /* @__PURE__ */ o(n, {
|
|
25
23
|
sx: {
|
|
26
24
|
bgcolor: "background.paper",
|
|
27
25
|
pb: 24
|
|
28
26
|
},
|
|
29
|
-
children: [/* @__PURE__ */
|
|
27
|
+
children: [/* @__PURE__ */ o(n, {
|
|
30
28
|
sx: {
|
|
31
29
|
alignItems: "center",
|
|
32
30
|
gap: 4,
|
|
@@ -34,49 +32,49 @@ var G = ({ beat: s }) => {
|
|
|
34
32
|
py: 16
|
|
35
33
|
},
|
|
36
34
|
children: [
|
|
37
|
-
m && /* @__PURE__ */
|
|
35
|
+
m && /* @__PURE__ */ o(n, {
|
|
38
36
|
sx: {
|
|
39
37
|
alignItems: "center",
|
|
40
38
|
flexDirection: "row",
|
|
41
39
|
gap: 12
|
|
42
40
|
},
|
|
43
|
-
children: [/* @__PURE__ */ r(
|
|
41
|
+
children: [/* @__PURE__ */ r(k, {
|
|
44
42
|
alt: "",
|
|
45
43
|
institutionGuid: a?.institution_guid ?? "",
|
|
46
44
|
size: 20
|
|
47
|
-
}), /* @__PURE__ */ r(
|
|
45
|
+
}), /* @__PURE__ */ r(c, {
|
|
48
46
|
bold: !0,
|
|
49
47
|
component: "p",
|
|
50
48
|
variant: "body1",
|
|
51
49
|
children: m
|
|
52
50
|
})]
|
|
53
51
|
}),
|
|
54
|
-
p !== void 0 && /* @__PURE__ */ r(
|
|
52
|
+
p !== void 0 && /* @__PURE__ */ r(c, {
|
|
55
53
|
bold: !0,
|
|
56
54
|
component: "p",
|
|
57
55
|
variant: "h1",
|
|
58
|
-
children:
|
|
56
|
+
children: x(p, g.cents)
|
|
59
57
|
}),
|
|
60
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ o(n, {
|
|
61
59
|
sx: {
|
|
62
60
|
alignItems: "center",
|
|
63
61
|
flexDirection: "row",
|
|
64
62
|
gap: 4
|
|
65
63
|
},
|
|
66
|
-
children: [/* @__PURE__ */ r(
|
|
64
|
+
children: [/* @__PURE__ */ r(A, {
|
|
67
65
|
"aria-hidden": "true",
|
|
68
66
|
fill: !0,
|
|
69
67
|
name: "error",
|
|
70
68
|
size: 16,
|
|
71
69
|
sx: { color: "warning.main" }
|
|
72
|
-
}), /* @__PURE__ */ r(
|
|
70
|
+
}), /* @__PURE__ */ r(c, {
|
|
73
71
|
color: "text.secondary",
|
|
74
72
|
variant: "body2",
|
|
75
|
-
children:
|
|
73
|
+
children: t.to_occur_within_the_next_seven_days
|
|
76
74
|
})]
|
|
77
75
|
})
|
|
78
76
|
]
|
|
79
|
-
}), d !== void 0 && /* @__PURE__ */
|
|
77
|
+
}), d !== void 0 && /* @__PURE__ */ o(F, { children: [/* @__PURE__ */ r(c, {
|
|
80
78
|
bold: !0,
|
|
81
79
|
component: "h3",
|
|
82
80
|
sx: {
|
|
@@ -85,9 +83,9 @@ var G = ({ beat: s }) => {
|
|
|
85
83
|
textTransform: "uppercase"
|
|
86
84
|
},
|
|
87
85
|
variant: "caption",
|
|
88
|
-
children:
|
|
86
|
+
children: t.confidence_level
|
|
89
87
|
}), /* @__PURE__ */ r(b, {
|
|
90
|
-
copy:
|
|
88
|
+
copy: t,
|
|
91
89
|
level: d
|
|
92
90
|
})] })]
|
|
93
91
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverdraftBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/OverdraftBlock/OverdraftBlock.tsx"],"sourcesContent":["import { useEffect } from 'react'\n\nimport Stack from '@mui/material/Stack'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { InstitutionLogo, Text } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport { useAccountStore, useGlobalCopyStore } from '../../../common'\nimport getAccountDisplayName from '../../../common/utils/AccountDisplayName'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../core/utils/NumberFormatting'\nimport type { ActionBlockProps } from '../../mappings/blocks'\n\nimport { ConfidenceMeter } from './ConfidenceMeter'\nimport { resolvePrimaryAccount, resolveOverdraftFacts } from './layout'\n\n/** Loads accounts once per open when the host did not attach the beat's primary account. */\nexport const useOverdraftPrepare = ({ beat }: ActionBlockProps) => {\n const { accountsLoaded, loadAccounts } = useAccountStore()\n\n useEffect(() => {\n if (!beat.primary_account && !accountsLoaded) void loadAccounts()\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n}\n\n/**\n * Transparent Overdraft's \"Learn more\" drawer (MEW2-3355): the account at risk, the projected\n * overdraft amount, when it is expected, and the confidence meter. Everything is on the beat; the\n * account store is read only to name the account when the host did not attach it.\n */\nexport const OverdraftBlock = observer(function OverdraftBlock({ beat }: ActionBlockProps) {\n const {
|
|
1
|
+
{"version":3,"file":"OverdraftBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/OverdraftBlock/OverdraftBlock.tsx"],"sourcesContent":["import { useEffect } from 'react'\n\nimport Stack from '@mui/material/Stack'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { InstitutionLogo, Text } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport { useAccountStore, useGlobalCopyStore } from '../../../common'\nimport getAccountDisplayName from '../../../common/utils/AccountDisplayName'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../core/utils/NumberFormatting'\nimport type { ActionBlockProps } from '../../mappings/blocks'\nimport { BlockErrorMessage } from '../BlockErrorMessage'\n\nimport { ConfidenceMeter } from './ConfidenceMeter'\nimport { resolvePrimaryAccount, resolveOverdraftFacts } from './layout'\n\n/** Loads accounts once per open when the host did not attach the beat's primary account. */\nexport const useOverdraftPrepare = ({ beat }: ActionBlockProps) => {\n const { accountsLoaded, loadAccounts } = useAccountStore()\n\n useEffect(() => {\n if (!beat.primary_account && !accountsLoaded) void loadAccounts()\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n}\n\n/**\n * Transparent Overdraft's \"Learn more\" drawer (MEW2-3355): the account at risk, the projected\n * overdraft amount, when it is expected, and the confidence meter. Everything is on the beat; the\n * account store is read only to name the account when the host did not attach it.\n */\nexport const OverdraftBlock = observer(function OverdraftBlock({ beat }: ActionBlockProps) {\n const { insights_feed: insightsFeedCopy } = useGlobalCopyStore()\n const { accounts } = useAccountStore()\n const copy = insightsFeedCopy?.transparent_overdraft\n\n if (!copy) {\n return <BlockErrorMessage />\n }\n\n const account = resolvePrimaryAccount(beat, accounts)\n const accountName = account ? getAccountDisplayName(account) : ''\n const { amount, confidence } = resolveOverdraftFacts(beat)\n\n return (\n <Stack sx={{ bgcolor: 'background.paper', pb: 24 }}>\n <Stack sx={{ alignItems: 'center', gap: 4, px: 24, py: 16 }}>\n {accountName && (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 12 }}>\n <InstitutionLogo alt=\"\" institutionGuid={account?.institution_guid ?? ''} size={20} />\n <Text bold={true} component=\"p\" variant=\"body1\">\n {accountName}\n </Text>\n </Stack>\n )}\n {amount !== undefined && (\n <Text bold={true} component=\"p\" variant=\"h1\">\n {formatCurrency(amount, CURRENCY_FORMAT.cents)}\n </Text>\n )}\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 4 }}>\n <Icon\n aria-hidden=\"true\"\n fill={true}\n name=\"error\"\n size={16}\n sx={{ color: 'warning.main' }}\n />\n <Text color=\"text.secondary\" variant=\"body2\">\n {copy.to_occur_within_the_next_seven_days}\n </Text>\n </Stack>\n </Stack>\n {confidence !== undefined && (\n <>\n <Text\n bold={true}\n component=\"h3\"\n sx={{ px: 24, py: 12, textTransform: 'uppercase' }}\n variant=\"caption\"\n >\n {copy.confidence_level}\n </Text>\n <ConfidenceMeter copy={copy} level={confidence} />\n </>\n )}\n </Stack>\n )\n})\n"],"mappings":";;;;;;;;;;;;AAkBA,IAAa,IAAA,CAAuB,EAAE,MAAA,EAAA,MAA6B;AACjE,QAAM,EAAE,gBAAA,GAAgB,cAAA,EAAA,IAAiB,EAAgB;AAEzD,EAAA,EAAA,MAAgB;AACd,IAAI,CAAC,EAAK,mBAAmB,CAAC,KAAgB,EAAkB;AAAA,EAElE,GAAG,CAAC,CAAC;AACP,GAOa,IAAiB,EAAS,SAAwB,EAAE,MAAA,EAAA,GAA0B;AACzF,QAAM,EAAE,eAAe,EAAA,IAAqB,EAAmB,GACzD,EAAE,UAAA,EAAA,IAAa,EAAgB,GAC/B,IAAO,GAAkB;AAE/B,MAAI,CAAC,EACH,QAAO,gBAAA,EAAC,GAAD,CAAoB,CAAA;AAG7B,QAAM,IAAU,EAAsB,GAAM,CAAQ,GAC9C,IAAc,IAAU,EAAsB,CAAO,IAAI,IACzD,EAAE,QAAA,GAAQ,YAAA,EAAA,IAAe,EAAsB,CAAI;AAEzD,SACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI;AAAA,MAAE,SAAS;AAAA,MAAoB,IAAI;AAAA,IAAG;AAAA,IAAjD,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,MAAO,IAAI;AAAA,QAAE,YAAY;AAAA,QAAU,KAAK;AAAA,QAAG,IAAI;AAAA,QAAI,IAAI;AAAA,MAAG;AAAA,MAA1D,UAAA;AAAA,QACG,KACC,gBAAA,EAAC,GAAD;AAAA,UAAO,IAAI;AAAA,YAAE,YAAY;AAAA,YAAU,eAAe;AAAA,YAAO,KAAK;AAAA,UAAG;AAAA,UAAjE,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,YAAiB,KAAI;AAAA,YAAG,iBAAiB,GAAS,oBAAoB;AAAA,YAAI,MAAM;AAAA,UAAK,CAAA,GACrF,gBAAA,EAAC,GAAD;AAAA,YAAM,MAAM;AAAA,YAAM,WAAU;AAAA,YAAI,SAAQ;AAAA,YACrC,UAAA;AAAA,UACG,CAAA,CACD;AAAA;QAER,MAAW,UACV,gBAAA,EAAC,GAAD;AAAA,UAAM,MAAM;AAAA,UAAM,WAAU;AAAA,UAAI,SAAQ;AAAA,UACrC,UAAA,EAAe,GAAQ,EAAgB,KAAK;AAAA,QACzC,CAAA;AAAA,QAER,gBAAA,EAAC,GAAD;AAAA,UAAO,IAAI;AAAA,YAAE,YAAY;AAAA,YAAU,eAAe;AAAA,YAAO,KAAK;AAAA,UAAE;AAAA,UAAhE,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,YACE,eAAY;AAAA,YACZ,MAAM;AAAA,YACN,MAAK;AAAA,YACL,MAAM;AAAA,YACN,IAAI,EAAE,OAAO,eAAe;AAAA,UAC7B,CAAA,GACD,gBAAA,EAAC,GAAD;AAAA,YAAM,OAAM;AAAA,YAAiB,SAAQ;AAAA,YAClC,UAAA,EAAK;AAAA,UACF,CAAA,CACD;AAAA;MACF;AAAA,IACN,CAAA,GAAA,MAAe,UACd,gBAAA,EAAA,GAAA,EAAA,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,MACE,MAAM;AAAA,MACN,WAAU;AAAA,MACV,IAAI;AAAA,QAAE,IAAI;AAAA,QAAI,IAAI;AAAA,QAAI,eAAe;AAAA,MAAY;AAAA,MACjD,SAAQ;AAAA,MAEP,UAAA,EAAK;AAAA,IACF,CAAA,GACN,gBAAA,EAAC,GAAD;AAAA,MAAuB,MAAA;AAAA,MAAM,OAAO;AAAA,IAAa,CAAA,CACjD,EAAA,CAAA,CAEC;AAAA;AAEX,CAAC"}
|