@mx-cartographer/experiences 9.7.40 → 9.7.42
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 +22 -0
- package/dist/core/types/InsightsInstanceSlotData.d.ts +6 -1
- package/dist/core/types/InsightsInstanceSlotData.es.js.map +1 -1
- package/dist/core/types/localization/InsightsFeedCopy.d.ts +2 -0
- package/dist/insights-v2/actionBlocks/ConnectWidgetActionBlock.es.js +20 -14
- package/dist/insights-v2/actionBlocks/ConnectWidgetActionBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/FeedbackModalActionBlock.d.ts +4 -4
- package/dist/insights-v2/actionBlocks/FeedbackModalActionBlock.es.js +45 -31
- package/dist/insights-v2/actionBlocks/FeedbackModalActionBlock.es.js.map +1 -1
- package/dist/insights-v2/analytics/analyticsEventsConfig.d.ts +6 -0
- package/dist/insights-v2/analytics/analyticsEventsConfig.es.js +4 -0
- package/dist/insights-v2/analytics/analyticsEventsConfig.es.js.map +1 -1
- package/dist/insights-v2/analytics/resolveAnalyticsEvent.es.js +7 -6
- package/dist/insights-v2/analytics/resolveAnalyticsEvent.es.js.map +1 -1
- package/dist/insights-v2/beatActions.d.ts +7 -2
- package/dist/insights-v2/beatActions.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountSwitchBlock/AccountSwitchBlock.d.ts +5 -2
- package/dist/insights-v2/blocks/ComponentBlocks/AccountSwitchBlock/AccountSwitchBlock.es.js +21 -23
- package/dist/insights-v2/blocks/ComponentBlocks/AccountSwitchBlock/AccountSwitchBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.es.js +29 -20
- package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/layout.es.js +27 -24
- package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/components/BaseLayout.es.js +1 -1
- package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
- package/dist/insights-v2/components/CompactInsightCard.es.js +148 -82
- package/dist/insights-v2/components/CompactInsightCard.es.js.map +1 -1
- package/dist/insights-v2/components/FeedbackModal.d.ts +5 -1
- package/dist/insights-v2/components/FeedbackModal.es.js +29 -28
- package/dist/insights-v2/components/FeedbackModal.es.js.map +1 -1
- package/dist/insights-v2/hooks/useBeatFeedbackFlow.es.js +27 -25
- package/dist/insights-v2/hooks/useBeatFeedbackFlow.es.js.map +1 -1
- package/dist/microinsights/beatActions.es.js +4 -4
- package/dist/microinsights/beatActions.es.js.map +1 -1
- package/package.json +1 -1
package/dist/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DetailedAccountBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.tsx"],"sourcesContent":["import { useTheme } from '@mui/material/styles'\n\nimport { slot, type InsightsPayload, type LogoRef } from '../../../../core'\nimport DirectDepositCard from '../../../components/DirectDepositCard'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\n\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\n\nimport { detailedAccountVariant, getLayoutConfig } from './layout'\n\ninterface DetailedAccountBlockProps {\n payload: InsightsPayload\n}\n\nconst
|
|
1
|
+
{"version":3,"file":"DetailedAccountBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.tsx"],"sourcesContent":["import { useContext } from 'react'\n\nimport { useTheme } from '@mui/material/styles'\n\nimport { GlobalDataContext } from '../../../../common/context/GlobalDataProvider'\nimport { slot, type InsightsPayload, type LogoRef } from '../../../../core'\nimport { buildDynamicCopy } from '../../../../core/utils/Localization'\nimport DirectDepositCard from '../../../components/DirectDepositCard'\nimport LogoFromGuid from '../../../components/LogoFromGuid'\n\nimport { resolveVariantConfig } from '../../resolveVariantConfig'\n\nimport { detailedAccountVariant, getLayoutConfig } from './layout'\n\ninterface DetailedAccountBlockProps {\n payload: InsightsPayload\n}\n\ntype InstanceSlot = InsightsPayload['instance_slot']\n\n/** `data` first; the flat field is the earlier shape. */\nconst readFact = (instanceSlot: InstanceSlot, name: keyof InstanceSlot): string | undefined =>\n slot<string>(instanceSlot.data, name) ?? (instanceSlot[name] as string | undefined)\n\n/** The slot's logo, else one built from the guid; the alt is worded as legacy (\"{institution} Institution Logo\"). */\nconst resolveLogo = (instanceSlot: InstanceSlot, altCopy?: string): LogoRef | undefined => {\n const dataLogo = slot<LogoRef>(instanceSlot.data, 'logo')\n const guid = readFact(instanceSlot, 'institution_guid')\n const name = dataLogo?.alt ?? readFact(instanceSlot, 'institution_name')\n\n const logo = dataLogo ?? (guid ? { guid, alt: name ?? guid } : undefined)\n if (!logo || !name) return logo\n\n return { ...logo, alt: altCopy ? (buildDynamicCopy(altCopy, name) as string) : name }\n}\n\nconst DetailedAccountBlock = ({ payload }: DetailedAccountBlockProps) => {\n const theme = useTheme()\n const { instance_slot } = payload\n // Optional: the micro widget renders this block without a GlobalDataProvider.\n const altCopy =\n useContext(GlobalDataContext)?.globalStore.copyStore.copy.insights_feed?.general\n ?.institution_Logo\n const logo = resolveLogo(instance_slot, altCopy)\n const layout = resolveVariantConfig(\n getLayoutConfig(theme),\n instance_slot.variant,\n detailedAccountVariant.Neutral,\n 'DetailedAccountBlock',\n )\n\n return (\n <DirectDepositCard\n {...layout}\n logo={logo?.guid ? <LogoFromGuid logo={logo} size={48} /> : null}\n name={readFact(instance_slot, 'account_name')}\n statusLabel={readFact(instance_slot, 'status_text')}\n subtitle={readFact(instance_slot, 'account_type')}\n />\n )\n}\n\nexport default DetailedAccountBlock\n"],"mappings":";;;;;;;;;;AAqBA,IAAM,IAAA,CAAY,GAA4B,MAC5C,EAAa,EAAa,MAAM,CAAI,KAAM,EAAa,CAAA,GAGnD,IAAA,CAAe,GAA4B,MAA0C;AACzF,QAAM,IAAW,EAAc,EAAa,MAAM,MAAM,GAClD,IAAO,EAAS,GAAc,kBAAkB,GAChD,IAAO,GAAU,OAAO,EAAS,GAAc,kBAAkB,GAEjE,IAAO,MAAa,IAAO;AAAA,IAAE,MAAA;AAAA,IAAM,KAAK,KAAQ;AAAA,EAAK,IAAI;AAC/D,SAAI,CAAC,KAAQ,CAAC,IAAa,IAEpB;AAAA,IAAE,GAAG;AAAA,IAAM,KAAK,IAAW,EAAiB,GAAS,CAAI,IAAe;AAAA,EAAK;AACtF,GAEM,IAAA,CAAwB,EAAE,SAAA,EAAA,MAAyC;AACvE,QAAM,IAAQ,EAAS,GACjB,EAAE,eAAA,EAAA,IAAkB,GAEpB,IACJ,EAAW,CAAiB,GAAG,YAAY,UAAU,KAAK,eAAe,SACrE,kBACA,IAAO,EAAY,GAAe,CAAO,GACzC,IAAS,EACb,EAAgB,CAAK,GACrB,EAAc,SACd,EAAuB,SACvB,sBACF;AAEA,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,GAAI;AAAA,IACJ,MAAM,GAAM,OAAO,gBAAA,EAAC,GAAD;AAAA,MAAoB,MAAA;AAAA,MAAM,MAAM;AAAA,IAAK,CAAA,IAAI;AAAA,IAC5D,MAAM,EAAS,GAAe,cAAc;AAAA,IAC5C,aAAa,EAAS,GAAe,aAAa;AAAA,IAClD,UAAU,EAAS,GAAe,cAAc;AAAA,EACjD,CAAA;AAEL"}
|
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
import { WARM_LIME_ACCENT_GRADIENT as d } from "../../../components/celebrationGradients.es.js";
|
|
2
|
-
var
|
|
2
|
+
var t = {
|
|
3
3
|
Neutral: "detailed_neutral",
|
|
4
4
|
Primary: "detailed_primary",
|
|
5
5
|
Success: "detailed_success",
|
|
6
6
|
Celebration: "detailed_celebration"
|
|
7
|
-
},
|
|
7
|
+
}, a = {
|
|
8
8
|
SetUpDirectDeposit: "set_up_direct_deposit",
|
|
9
9
|
DirectDepositComplete: "direct_deposit_complete",
|
|
10
10
|
MissingInterestRate: "missing_interest_rate",
|
|
11
11
|
InterestRateAdded: "interest_rate_added"
|
|
12
|
-
}, s = /* @__PURE__ */ new Set([...Object.values(
|
|
12
|
+
}, s = /* @__PURE__ */ new Set([...Object.values(t), ...Object.values(a)]), _ = (e) => e != null && s.has(e), g = {
|
|
13
13
|
light: "linear-gradient(180deg, #A0B9F8 0%, #2C64EF 100%)",
|
|
14
14
|
dark: "linear-gradient(180deg, #1F46A7 0%, #6B92F4 100%)"
|
|
15
15
|
}, p = {
|
|
16
16
|
light: "linear-gradient(180deg, #94C9B7 0%, #12875E 100%)",
|
|
17
17
|
dark: "linear-gradient(180deg, #0D5F42 0%, #59AB8E 100%)"
|
|
18
|
-
}, b = {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
}, b = (e) => {
|
|
19
|
+
const r = e === "dark" ? "grey.800" : "grey.100";
|
|
20
|
+
return {
|
|
21
|
+
bgcolor: r,
|
|
22
|
+
borderColor: r,
|
|
23
|
+
labelColor: "text.primary"
|
|
24
|
+
};
|
|
25
|
+
}, u = {
|
|
23
26
|
bgcolor: "primary.lighter",
|
|
24
27
|
borderColor: "primary.lighter",
|
|
25
28
|
labelColor: "text.primary"
|
|
@@ -27,18 +30,18 @@ var e = {
|
|
|
27
30
|
bgcolor: "success.main",
|
|
28
31
|
borderColor: "success.main",
|
|
29
32
|
labelColor: "success.contrastText"
|
|
30
|
-
}, A = (
|
|
31
|
-
const
|
|
33
|
+
}, A = (e) => {
|
|
34
|
+
const r = e.palette.mode, i = {
|
|
32
35
|
bgcolor: "primary.lighter",
|
|
33
36
|
nameVariant: "body2",
|
|
34
|
-
pill: b
|
|
37
|
+
pill: b(r)
|
|
35
38
|
}, o = {
|
|
36
|
-
backgroundImage: g[
|
|
39
|
+
backgroundImage: g[r],
|
|
37
40
|
bgcolor: "background.paper",
|
|
38
41
|
nameVariant: "body1",
|
|
39
|
-
pill:
|
|
42
|
+
pill: u
|
|
40
43
|
}, l = {
|
|
41
|
-
backgroundImage: p[
|
|
44
|
+
backgroundImage: p[r],
|
|
42
45
|
bgcolor: "background.paper",
|
|
43
46
|
nameVariant: "body1",
|
|
44
47
|
pill: c
|
|
@@ -53,19 +56,19 @@ var e = {
|
|
|
53
56
|
showConfetti: !0
|
|
54
57
|
};
|
|
55
58
|
return {
|
|
56
|
-
[
|
|
57
|
-
[
|
|
58
|
-
[
|
|
59
|
-
[
|
|
60
|
-
[
|
|
61
|
-
[
|
|
62
|
-
[
|
|
63
|
-
[
|
|
59
|
+
[t.Neutral]: i,
|
|
60
|
+
[t.Primary]: o,
|
|
61
|
+
[t.Success]: l,
|
|
62
|
+
[t.Celebration]: n,
|
|
63
|
+
[a.SetUpDirectDeposit]: i,
|
|
64
|
+
[a.MissingInterestRate]: o,
|
|
65
|
+
[a.InterestRateAdded]: l,
|
|
66
|
+
[a.DirectDepositComplete]: n
|
|
64
67
|
};
|
|
65
68
|
};
|
|
66
69
|
export {
|
|
67
|
-
|
|
68
|
-
|
|
70
|
+
t as detailedAccountVariant,
|
|
71
|
+
a as directDepositVariant,
|
|
69
72
|
A as getLayoutConfig,
|
|
70
73
|
_ as isDetailedAccountVariant
|
|
71
74
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/layout.ts"],"sourcesContent":["import type { Theme } from '@mui/material/styles'\n\nimport { WARM_LIME_ACCENT_GRADIENT } from '../../../components/celebrationGradients'\nimport type {\n DirectDepositCardStyleProps,\n DirectDepositPillConfig,\n} from '../../../components/DirectDepositCard'\n\nexport const detailedAccountVariant = {\n Neutral: 'detailed_neutral',\n Primary: 'detailed_primary',\n Success: 'detailed_success',\n Celebration: 'detailed_celebration',\n} as const\n\nexport type DetailedAccountVariant =\n (typeof detailedAccountVariant)[keyof typeof detailedAccountVariant]\n\nexport const directDepositVariant = {\n SetUpDirectDeposit: 'set_up_direct_deposit',\n DirectDepositComplete: 'direct_deposit_complete',\n MissingInterestRate: 'missing_interest_rate',\n InterestRateAdded: 'interest_rate_added',\n} as const\n\nexport type DirectDepositVariant = (typeof directDepositVariant)[keyof typeof directDepositVariant]\n\nconst VARIANTS = new Set<string>([\n ...Object.values(detailedAccountVariant),\n ...Object.values(directDepositVariant),\n])\n\nexport const isDetailedAccountVariant = (\n variant?: string | null,\n): variant is DetailedAccountVariant | DirectDepositVariant =>\n variant != null && VARIANTS.has(variant)\n\nconst MISSING_RATE_GRADIENTS = {\n light: 'linear-gradient(180deg, #A0B9F8 0%, #2C64EF 100%)',\n dark: 'linear-gradient(180deg, #1F46A7 0%, #6B92F4 100%)',\n} as const\n\nconst RATE_ADDED_GRADIENTS = {\n light: 'linear-gradient(180deg, #94C9B7 0%, #12875E 100%)',\n dark: 'linear-gradient(180deg, #0D5F42 0%, #59AB8E 100%)',\n} as const\n\nconst
|
|
1
|
+
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/DetailedAccountBlock/layout.ts"],"sourcesContent":["import type { Theme } from '@mui/material/styles'\n\nimport { WARM_LIME_ACCENT_GRADIENT } from '../../../components/celebrationGradients'\nimport type {\n DirectDepositCardStyleProps,\n DirectDepositPillConfig,\n} from '../../../components/DirectDepositCard'\n\nexport const detailedAccountVariant = {\n Neutral: 'detailed_neutral',\n Primary: 'detailed_primary',\n Success: 'detailed_success',\n Celebration: 'detailed_celebration',\n} as const\n\nexport type DetailedAccountVariant =\n (typeof detailedAccountVariant)[keyof typeof detailedAccountVariant]\n\nexport const directDepositVariant = {\n SetUpDirectDeposit: 'set_up_direct_deposit',\n DirectDepositComplete: 'direct_deposit_complete',\n MissingInterestRate: 'missing_interest_rate',\n InterestRateAdded: 'interest_rate_added',\n} as const\n\nexport type DirectDepositVariant = (typeof directDepositVariant)[keyof typeof directDepositVariant]\n\nconst VARIANTS = new Set<string>([\n ...Object.values(detailedAccountVariant),\n ...Object.values(directDepositVariant),\n])\n\nexport const isDetailedAccountVariant = (\n variant?: string | null,\n): variant is DetailedAccountVariant | DirectDepositVariant =>\n variant != null && VARIANTS.has(variant)\n\nconst MISSING_RATE_GRADIENTS = {\n light: 'linear-gradient(180deg, #A0B9F8 0%, #2C64EF 100%)',\n dark: 'linear-gradient(180deg, #1F46A7 0%, #6B92F4 100%)',\n} as const\n\nconst RATE_ADDED_GRADIENTS = {\n light: 'linear-gradient(180deg, #94C9B7 0%, #12875E 100%)',\n dark: 'linear-gradient(180deg, #0D5F42 0%, #59AB8E 100%)',\n} as const\n\n// Grey tokens don't change with the mode, so pick the one `text.primary` reads on.\nconst neutralPill = (mode: Theme['palette']['mode']): DirectDepositPillConfig => {\n const bgcolor = mode === 'dark' ? 'grey.800' : 'grey.100'\n\n return { bgcolor, borderColor: bgcolor, labelColor: 'text.primary' }\n}\n\nconst PRIMARY_TINT_PILL: DirectDepositPillConfig = {\n bgcolor: 'primary.lighter',\n borderColor: 'primary.lighter',\n labelColor: 'text.primary',\n}\n\nconst SUCCESS_PILL: DirectDepositPillConfig = {\n bgcolor: 'success.main',\n borderColor: 'success.main',\n labelColor: 'success.contrastText',\n}\n\nexport const getLayoutConfig = (\n theme: Theme,\n): Record<DetailedAccountVariant | DirectDepositVariant, DirectDepositCardStyleProps> => {\n const mode = theme.palette.mode\n const neutral: DirectDepositCardStyleProps = {\n bgcolor: 'primary.lighter',\n nameVariant: 'body2',\n pill: neutralPill(mode),\n }\n const primary: DirectDepositCardStyleProps = {\n backgroundImage: MISSING_RATE_GRADIENTS[mode],\n bgcolor: 'background.paper',\n nameVariant: 'body1',\n pill: PRIMARY_TINT_PILL,\n }\n const success: DirectDepositCardStyleProps = {\n backgroundImage: RATE_ADDED_GRADIENTS[mode],\n bgcolor: 'background.paper',\n nameVariant: 'body1',\n pill: SUCCESS_PILL,\n }\n const celebration: DirectDepositCardStyleProps = {\n backgroundImage: WARM_LIME_ACCENT_GRADIENT,\n bgcolor: 'background.paper',\n nameVariant: 'body2',\n pill: { ...SUCCESS_PILL, icon: 'check_circle' },\n showConfetti: true,\n }\n\n return {\n [detailedAccountVariant.Neutral]: neutral,\n [detailedAccountVariant.Primary]: primary,\n [detailedAccountVariant.Success]: success,\n [detailedAccountVariant.Celebration]: celebration,\n [directDepositVariant.SetUpDirectDeposit]: neutral,\n [directDepositVariant.MissingInterestRate]: primary,\n [directDepositVariant.InterestRateAdded]: success,\n [directDepositVariant.DirectDepositComplete]: celebration,\n }\n}\n"],"mappings":";AAQA,IAAa,IAAyB;AAAA,EACpC,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,aAAa;AACf,GAKa,IAAuB;AAAA,EAClC,oBAAoB;AAAA,EACpB,uBAAuB;AAAA,EACvB,qBAAqB;AAAA,EACrB,mBAAmB;AACrB,GAIM,IAAW,oBAAI,IAAY,CAC/B,GAAG,OAAO,OAAO,CAAsB,GACvC,GAAG,OAAO,OAAO,CAAoB,CACvC,CAAC,GAEY,IAAA,CACX,MAEA,KAAW,QAAQ,EAAS,IAAI,CAAO,GAEnC,IAAyB;AAAA,EAC7B,OAAO;AAAA,EACP,MAAM;AACR,GAEM,IAAuB;AAAA,EAC3B,OAAO;AAAA,EACP,MAAM;AACR,GAGM,IAAA,CAAe,MAA4D;AAC/E,QAAM,IAAU,MAAS,SAAS,aAAa;AAE/C,SAAO;AAAA,IAAE,SAAA;AAAA,IAAS,aAAa;AAAA,IAAS,YAAY;AAAA,EAAe;AACrE,GAEM,IAA6C;AAAA,EACjD,SAAS;AAAA,EACT,aAAa;AAAA,EACb,YAAY;AACd,GAEM,IAAwC;AAAA,EAC5C,SAAS;AAAA,EACT,aAAa;AAAA,EACb,YAAY;AACd,GAEa,IAAA,CACX,MACuF;AACvF,QAAM,IAAO,EAAM,QAAQ,MACrB,IAAuC;AAAA,IAC3C,SAAS;AAAA,IACT,aAAa;AAAA,IACb,MAAM,EAAY,CAAI;AAAA,EACxB,GACM,IAAuC;AAAA,IAC3C,iBAAiB,EAAuB,CAAA;AAAA,IACxC,SAAS;AAAA,IACT,aAAa;AAAA,IACb,MAAM;AAAA,EACR,GACM,IAAuC;AAAA,IAC3C,iBAAiB,EAAqB,CAAA;AAAA,IACtC,SAAS;AAAA,IACT,aAAa;AAAA,IACb,MAAM;AAAA,EACR,GACM,IAA2C;AAAA,IAC/C,iBAAiB;AAAA,IACjB,SAAS;AAAA,IACT,aAAa;AAAA,IACb,MAAM;AAAA,MAAE,GAAG;AAAA,MAAc,MAAM;AAAA,IAAe;AAAA,IAC9C,cAAc;AAAA,EAChB;AAEA,SAAO;AAAA,IACJ,CAAA,EAAuB,OAAA,GAAU;AAAA,IACjC,CAAA,EAAuB,OAAA,GAAU;AAAA,IACjC,CAAA,EAAuB,OAAA,GAAU;AAAA,IACjC,CAAA,EAAuB,WAAA,GAAc;AAAA,IACrC,CAAA,EAAqB,kBAAA,GAAqB;AAAA,IAC1C,CAAA,EAAqB,mBAAA,GAAsB;AAAA,IAC3C,CAAA,EAAqB,iBAAA,GAAoB;AAAA,IACzC,CAAA,EAAqB,qBAAA,GAAwB;AAAA,EAChD;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseLayout.es.js","names":[],"sources":["../../../src/insights-v2/components/BaseLayout.tsx"],"sourcesContent":["import { useMemo } from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Card from '@mui/material/Card'\nimport Stack from '@mui/material/Stack'\n\nimport { ChevronRight } from '@mxenabled/mx-icons'\nimport { P } from '@mxenabled/mxui'\n\nimport { blocks } from '../mappings/blocks'\nimport { actionBlocksKey } from '../mappings/actionBlocksKey'\nimport { isContactSupportCtaDisabled } from '../actionBlocks/ContactSupportActionBlock'\nimport { logoFromRef } from './shared/EntityLogo'\n\nimport Footer from './Footer'\nimport Header from './Header'\nimport FeedbackBar from './FeedbackBar'\nimport FeedbackDialog from './FeedbackDialog'\nimport DismissInsightDialog from './DismissInsightDialog'\nimport HiddenConfirmationCard from './HiddenConfirmationCard'\nimport ErrorCard from './ErrorCard'\nimport LoadingCard from './LoadingCard'\nimport { ObsolesceBanner, type ObsolesceBannerState } from './ObsolesceBanner'\nimport { useAppConfig, useGlobalCopyStore, useGlobalStore, useInsightsV2Store } from '../../common'\nimport type { Beat, PrimaryCTA, SecondaryCTA } from '../../core'\nimport { BeatActionsProvider, type BeatActions } from '../beatActions'\nimport { ActionBlockLayer } from '../actionBlocks/ActionBlockLayer'\nimport { reportCtaClick, useBeatCtaActions } from '../ctaActions'\nimport { useBeatFeedbackFlow } from '../hooks/useBeatFeedbackFlow'\n\nexport interface ObsoleteState {\n state: ObsolesceBannerState\n onRefresh: () => void\n onDismiss: () => void\n}\n\ninterface BaseLayoutProps {\n beat: Beat\n beatActions?: BeatActions\n obsolete?: ObsoleteState\n /** Swap only the block slot for a LoadingCard (e.g. while a sampled beat loads). */\n isLoading?: boolean\n /** Replace the entire card with an ErrorCard (e.g. when the sample fails to load). */\n isError?: boolean\n}\n\nconst NO_BEAT_ACTIONS: BeatActions = {}\n\nconst OBSOLETE_OVERLAY_SX = {\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n height: '100%',\n backgroundColor: 'background.default',\n opacity: 0.7,\n zIndex: 1,\n} as const\n\n// Mini CTA label styled like a Button.\nconst MINI_CTA_SX = {\n alignItems: 'center',\n alignSelf: 'flex-start',\n display: 'flex',\n fontWeight: 600,\n height: 44,\n px: 2,\n textTransform: 'none',\n} as const\n\nconst BaseLayout = observer(\n ({\n beat,\n beatActions = NO_BEAT_ACTIONS,\n obsolete,\n isLoading = false,\n isError = false,\n }: BaseLayoutProps) => {\n const copy = useGlobalCopyStore()\n const insightsV2Store = useInsightsV2Store()\n const { config } = useAppConfig()\n const flow = useBeatFeedbackFlow(beat, beatActions)\n\n const stores = useGlobalStore()\n const {\n runCta: handleCtaClick,\n primary: primaryCtaState,\n secondary: secondaryCtaState,\n } = useBeatCtaActions(\n beat,\n beatActions,\n beat.insights_payload?.primary_cta,\n beat.insights_payload?.secondary_cta,\n )\n\n // Guard: payload may not be loaded yet (isLoading/isError states).\n const isMini = beat.insights_payload?.widget_type === 'mini'\n\n // Memoized: an inline object here would change identity every render, making every\n // useAnalyticsEvent() consumer's callback (and its effect deps) unstable too.\n const beatActionsValue = useMemo(\n () => ({ ...flow.wrappedActions, beat }),\n [flow.wrappedActions, beat],\n )\n\n // Error replaces the entire card; loading only swaps the block slot (below).\n if (isError) return <ErrorCard />\n\n const insights_payload = beat.insights_payload\n\n if (!insights_payload) return null\n if (flow.cardState === 'dismissed') return null\n\n const { instance_slot, primary_cta, secondary_cta, sub_title, title, guid, dismissed_at } =\n insights_payload\n const { block } = instance_slot\n\n // Rebuild V1 subtitle shape; sub_title wins if present.\n const subtitle =\n sub_title ??\n (insights_payload.subtitle\n ? {\n logo: logoFromRef(insights_payload.logo),\n text: insights_payload.subtitle,\n }\n : undefined)\n\n // CTAs run via ctaActions; contact_support_block bypasses it.\n const isCtaDisabled = (ctaBlock: string | null | undefined) =>\n isContactSupportCtaDisabled(ctaBlock, config, beatActions.onContactSupport)\n\n const onCtaClick = async (slot: 'primary' | 'secondary', cta: PrimaryCTA | SecondaryCTA) => {\n if (isCtaDisabled(cta.block)) return\n\n if (cta.block === actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK) {\n // Bypasses the runner, but still reports the press like any other CTA: the generic\n // press event, and (on a first primary press) FIRST_TIME_PRIMARY_ACTION_SELECTED +\n // cta_clicked_at.\n reportCtaClick({ beat, stores, hostActions: beatActions, slot })\n beatActions.onContactSupport?.()\n return\n }\n\n await handleCtaClick(slot, cta)\n }\n\n const Block = blocks[block as keyof typeof blocks]\n\n const inDescriptionCta = insights_payload.in_description_cta\n // Full card: the envelope's link opens the drawer its block names. A link with no block (mini's\n // \"Make a Transfer\") is the card's action, drawn as the mini label below, never a dead link.\n const envelopeLink =\n !isMini && inDescriptionCta?.label && inDescriptionCta.block ? inDescriptionCta : undefined\n // The card's action label: the primary CTA's, else a block-less envelope link's (ditto ≥ 1.4.3\n // sends mini's action as in_description_cta). `||`, not `??`: the copy may send the primary label\n // as \"\" rather than omit it, and an empty string must fall through. It is a button only on a full\n // card with a primary CTA; otherwise a label, so a tap reaches the host's card handler.\n const ctaLabel =\n primary_cta?.label || (envelopeLink ? undefined : inDescriptionCta?.label) || undefined\n const isCtaButton = !isMini && !!primary_cta?.label\n const showSecondaryCta = !isMini && !!secondary_cta?.label\n const obsoleteCopy = copy.insights_feed?.general\n const isObsoleteDimmed =\n obsolete?.state === 'not_refreshable' && !dismissed_at && !!obsoleteCopy\n\n return (\n <BeatActionsProvider value={beatActionsValue}>\n <Stack sx={{ mb: 16 }}>\n {flow.cardState === 'confirming' ? (\n <HiddenConfirmationCard\n onClose={flow.collapseConfirmation}\n onLeaveFeedback={flow.openHideSurvey}\n onUndo={flow.undoDismiss}\n />\n ) : (\n <>\n {obsolete && obsoleteCopy && <ObsolesceBanner {...obsolete} copy={obsoleteCopy} />}\n <Card\n inert={isObsoleteDimmed}\n sx={{\n ...(isObsoleteDimmed && {\n position: 'relative',\n zIndex: 2,\n pointerEvents: 'none',\n }),\n }}\n >\n {isObsoleteDimmed && <Box sx={OBSOLETE_OVERLAY_SX} />}\n <Header isMini={isMini} subtitle={subtitle} title={title ?? ''} />\n {isLoading ? (\n <LoadingCard />\n ) : (\n Block && <Block beatGuid={guid} payload={insights_payload} />\n )}\n\n <Stack sx={{ gap: 6, pb: 16, pt: 12, px: 16 }}>\n <P\n dangerouslySetInnerHTML={{\n __html: insights_payload.description.html_text,\n }}\n variant=\"subtitle2\"\n />\n {/* V2: the envelope's link opens the action block it names. */}\n {envelopeLink && (\n <Button\n endIcon={<ChevronRight />}\n onClick={() =>\n insightsV2Store.openActionDrawer({ guid, trigger: 'inDescriptionCta' })\n }\n sx={{ height: 24, p: 4, width: 'max-content' }}\n >\n {envelopeLink.label}\n </Button>\n )}\n {/* V1: the legacy field, shown for beats that do not send the envelope link. */}\n {!inDescriptionCta?.label && beat?.in_description_cta && (\n <Button\n endIcon={<ChevronRight />}\n onClick={() => {}}\n sx={{ height: 24, p: 4, width: 'max-content' }}\n >\n {beat.in_description_cta}\n </Button>\n )}\n </Stack>\n\n {(ctaLabel || showSecondaryCta) && (\n <Stack sx={{ gap: 8, pb: 16, px: 16 }}>\n {ctaLabel &&\n !isCtaButton && (\n // The card's action when it has no primary CTA button (mini always; a full card whose\n // only link names no block). What the tap does is the host's decision (Pulse posts\n // `carousel/cta`, the same redirect a V1 mini card sends), never the action drawer the\n // full card's CTA opens. It is a real (blue, focusable) button for that tap, but has no\n // handler of its own and does not stop the click, so it reaches the host's card handler\n // exactly as a tap on the card does.\n <Button sx={MINI_CTA_SX} variant=\"text\">\n {ctaLabel}\n </Button>\n )}\n {isCtaButton && primary_cta && (\n <Button\n aria-disabled={isCtaDisabled(primary_cta.block) || primaryCtaState.disabled}\n disabled={primaryCtaState.disabled}\n onClick={() => onCtaClick('primary', primary_cta)}\n sx={{\n ...(isCtaDisabled(primary_cta.block) && { color: 'text.disabled' }),\n }}\n variant=\"outlined\"\n >\n {primary_cta.label}\n </Button>\n )}\n {/* Mini has room for one CTA. */}\n {showSecondaryCta && secondary_cta && (\n <Button\n aria-disabled={\n isCtaDisabled(secondary_cta.block) || secondaryCtaState.disabled\n }\n color=\"secondary\"\n disabled={secondaryCtaState.disabled}\n onClick={() => onCtaClick('secondary', secondary_cta)}\n >\n {secondary_cta.label}\n </Button>\n )}\n </Stack>\n )}\n\n <FeedbackBar onTellUsMore={flow.openRatingSurvey} show={flow.isFeedbackBarShown} />\n </Card>\n </>\n )}\n\n <ActionBlockLayer beat={beat} />\n\n <DismissInsightDialog\n isOpen={flow.isDismissOpen}\n onClose={flow.closeDismissDialog}\n onDismiss={flow.confirmDismiss}\n />\n\n {flow.isSurveyOpen && (\n <FeedbackDialog\n characterLimitLabel={flow.survey.characterLimitLabel}\n closeAriaLabel={flow.survey.closeAriaLabel}\n isOpen={true}\n onBackClick={flow.feedbackDialogCallbacks.onBackClick}\n onClose={flow.closeSurvey}\n onSubmit={flow.submitSurvey}\n onTextInputFocus={flow.feedbackDialogCallbacks.onTextInputFocus}\n options={flow.survey.options}\n primaryText={flow.survey.submitText}\n secondaryText={flow.survey.backText}\n title={flow.survey.title}\n />\n )}\n\n {flow.cardState === 'visible' && insights_payload.footer && (\n <Footer footer={insights_payload.footer} />\n )}\n </Stack>\n </BeatActionsProvider>\n )\n },\n)\n\nexport default BaseLayout\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,IAAM,KAA+B,CAAC,GAEhC,KAAsB;AAAA,EAC1B,UAAU;AAAA,EACV,KAAK;AAAA,EACL,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,iBAAiB;AAAA,EACjB,SAAS;AAAA,EACT,QAAQ;AACV,GAGM,KAAc;AAAA,EAClB,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,IAAI;AAAA,EACJ,eAAe;AACjB,GAEM,KAAa,GAAA,CAChB,EACC,MAAA,GACA,aAAA,IAAc,IACd,UAAA,GACA,WAAA,IAAY,IACZ,SAAA,IAAU,GAAA,MACW;AACrB,QAAM,IAAO,EAAmB,GAC1B,IAAkB,EAAmB,GACrC,EAAE,QAAA,EAAA,IAAW,EAAa,GAC1B,IAAO,GAAoB,GAAM,CAAW,GAE5C,IAAS,EAAe,GACxB,EACJ,QAAQ,GACR,SAAS,GACT,WAAW,EAAA,IACT,EACF,GACA,GACA,EAAK,kBAAkB,aACvB,EAAK,kBAAkB,aACzB,GAGM,IAAS,EAAK,kBAAkB,gBAAgB,QAIhD,IAAmB,GAAA,OAChB;AAAA,IAAE,GA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e,EAAW,aAAa,CAAa;AAAA,kBAEnD,UAAA,EAAc;AAAA,gBACT,CAAA;AAAA,cAEL;AAAA;YAGT,gBAAA,EAAC,IAAD;AAAA,cAAa,cAAc,EAAK;AAAA,cAAkB,MAAM,EAAK;AAAA,YAAqB,CAAA;AAAA,UAC9E;AAAA,QACN,CAAA,CAAA,EAAA,CAAA;AAAA,QAGJ,gBAAA,EAAC,IAAD,EAAwB,MAAA,EAAO,CAAA;AAAA,QAE/B,gBAAA,EAAC,IAAD;AAAA,UACE,QAAQ,EAAK;AAAA,UACb,SAAS,EAAK;AAAA,UACd,WAAW,EAAK;AAAA,QACjB,CAAA;AAAA,QAEA,EAAK,gBACJ,gBAAA,EAAC,GAAD;AAAA,UACE,qBAAqB,EAAK,OAAO;AAAA,UACjC,gBAAgB,EAAK,OAAO;AAAA,UAC5B,QAAQ;AAAA,UACR,aAAa,EAAK,wBAAwB;AAAA,UAC1C,SAAS,EAAK;AAAA,UACd,UAAU,EAAK;AAAA,UACf,kBAAkB,EAAK,wBAAwB;AAAA,UAC/C,SAAS,EAAK,OAAO;AAAA,UACrB,aAAa,EAAK,OAAO;AAAA,UACzB,eAAe,EAAK,OAAO;AAAA,UAC3B,OAAO,EAAK,OAAO;AAAA,QACpB,CAAA;AAAA,QAGF,EAAK,cAAc,aAAa,EAAiB,UAChD,gBAAA,EAAC,IAAD,EAAQ,QAAQ,EAAiB,OAAS,CAAA;AAAA,MAEvC;AAAA;EACY,CAAA;AAEzB,CACF"}
|
|
1
|
+
{"version":3,"file":"BaseLayout.es.js","names":[],"sources":["../../../src/insights-v2/components/BaseLayout.tsx"],"sourcesContent":["import { useMemo } from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Card from '@mui/material/Card'\nimport Stack from '@mui/material/Stack'\n\nimport { ChevronRight } from '@mxenabled/mx-icons'\nimport { P } from '@mxenabled/mxui'\n\nimport { blocks } from '../mappings/blocks'\nimport { actionBlocksKey } from '../mappings/actionBlocksKey'\nimport { isContactSupportCtaDisabled } from '../actionBlocks/ContactSupportActionBlock'\nimport { logoFromRef } from './shared/EntityLogo'\n\nimport Footer from './Footer'\nimport Header from './Header'\nimport FeedbackBar from './FeedbackBar'\nimport FeedbackDialog from './FeedbackDialog'\nimport DismissInsightDialog from './DismissInsightDialog'\nimport HiddenConfirmationCard from './HiddenConfirmationCard'\nimport ErrorCard from './ErrorCard'\nimport LoadingCard from './LoadingCard'\nimport { ObsolesceBanner, type ObsolesceBannerState } from './ObsolesceBanner'\nimport { useAppConfig, useGlobalCopyStore, useGlobalStore, useInsightsV2Store } from '../../common'\nimport type { Beat, PrimaryCTA, SecondaryCTA } from '../../core'\nimport { BeatActionsProvider, type BeatActions } from '../beatActions'\nimport { ActionBlockLayer } from '../actionBlocks/ActionBlockLayer'\nimport { reportCtaClick, useBeatCtaActions } from '../ctaActions'\nimport { useBeatFeedbackFlow } from '../hooks/useBeatFeedbackFlow'\n\nexport interface ObsoleteState {\n state: ObsolesceBannerState\n onRefresh: () => void\n onDismiss: () => void\n}\n\ninterface BaseLayoutProps {\n beat: Beat\n beatActions?: BeatActions\n obsolete?: ObsoleteState\n /** Swap only the block slot for a LoadingCard (e.g. while a sampled beat loads). */\n isLoading?: boolean\n /** Replace the entire card with an ErrorCard (e.g. when the sample fails to load). */\n isError?: boolean\n}\n\nconst NO_BEAT_ACTIONS: BeatActions = {}\n\nconst OBSOLETE_OVERLAY_SX = {\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n height: '100%',\n backgroundColor: 'background.default',\n opacity: 0.7,\n // Above every block's own z-index (hero card 1, AccountBlock 2), or that section shows through.\n zIndex: 3,\n} as const\n\n// Mini CTA label styled like a Button.\nconst MINI_CTA_SX = {\n alignItems: 'center',\n alignSelf: 'flex-start',\n display: 'flex',\n fontWeight: 600,\n height: 44,\n px: 2,\n textTransform: 'none',\n} as const\n\nconst BaseLayout = observer(\n ({\n beat,\n beatActions = NO_BEAT_ACTIONS,\n obsolete,\n isLoading = false,\n isError = false,\n }: BaseLayoutProps) => {\n const copy = useGlobalCopyStore()\n const insightsV2Store = useInsightsV2Store()\n const { config } = useAppConfig()\n const flow = useBeatFeedbackFlow(beat, beatActions)\n\n const stores = useGlobalStore()\n const {\n runCta: handleCtaClick,\n primary: primaryCtaState,\n secondary: secondaryCtaState,\n } = useBeatCtaActions(\n beat,\n beatActions,\n beat.insights_payload?.primary_cta,\n beat.insights_payload?.secondary_cta,\n )\n\n // Guard: payload may not be loaded yet (isLoading/isError states).\n const isMini = beat.insights_payload?.widget_type === 'mini'\n\n // Memoized: an inline object here would change identity every render, making every\n // useAnalyticsEvent() consumer's callback (and its effect deps) unstable too.\n const beatActionsValue = useMemo(\n () => ({ ...flow.wrappedActions, beat }),\n [flow.wrappedActions, beat],\n )\n\n // Error replaces the entire card; loading only swaps the block slot (below).\n if (isError) return <ErrorCard />\n\n const insights_payload = beat.insights_payload\n\n if (!insights_payload) return null\n if (flow.cardState === 'dismissed') return null\n\n const { instance_slot, primary_cta, secondary_cta, sub_title, title, guid, dismissed_at } =\n insights_payload\n const { block } = instance_slot\n\n // Rebuild V1 subtitle shape; sub_title wins if present.\n const subtitle =\n sub_title ??\n (insights_payload.subtitle\n ? {\n logo: logoFromRef(insights_payload.logo),\n text: insights_payload.subtitle,\n }\n : undefined)\n\n // CTAs run via ctaActions; contact_support_block bypasses it.\n const isCtaDisabled = (ctaBlock: string | null | undefined) =>\n isContactSupportCtaDisabled(ctaBlock, config, beatActions.onContactSupport)\n\n const onCtaClick = async (slot: 'primary' | 'secondary', cta: PrimaryCTA | SecondaryCTA) => {\n if (isCtaDisabled(cta.block)) return\n\n if (cta.block === actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK) {\n // Bypasses the runner, but still reports the press like any other CTA: the generic\n // press event, and (on a first primary press) FIRST_TIME_PRIMARY_ACTION_SELECTED +\n // cta_clicked_at.\n reportCtaClick({ beat, stores, hostActions: beatActions, slot })\n beatActions.onContactSupport?.()\n return\n }\n\n await handleCtaClick(slot, cta)\n }\n\n const Block = blocks[block as keyof typeof blocks]\n\n const inDescriptionCta = insights_payload.in_description_cta\n // Full card: the envelope's link opens the drawer its block names. A link with no block (mini's\n // \"Make a Transfer\") is the card's action, drawn as the mini label below, never a dead link.\n const envelopeLink =\n !isMini && inDescriptionCta?.label && inDescriptionCta.block ? inDescriptionCta : undefined\n // The card's action label: the primary CTA's, else a block-less envelope link's (ditto ≥ 1.4.3\n // sends mini's action as in_description_cta). `||`, not `??`: the copy may send the primary label\n // as \"\" rather than omit it, and an empty string must fall through. It is a button only on a full\n // card with a primary CTA; otherwise a label, so a tap reaches the host's card handler.\n const ctaLabel =\n primary_cta?.label || (envelopeLink ? undefined : inDescriptionCta?.label) || undefined\n const isCtaButton = !isMini && !!primary_cta?.label\n const showSecondaryCta = !isMini && !!secondary_cta?.label\n const obsoleteCopy = copy.insights_feed?.general\n const isObsoleteDimmed =\n obsolete?.state === 'not_refreshable' && !dismissed_at && !!obsoleteCopy\n\n return (\n <BeatActionsProvider value={beatActionsValue}>\n <Stack sx={{ mb: 16 }}>\n {flow.cardState === 'confirming' ? (\n <HiddenConfirmationCard\n onClose={flow.collapseConfirmation}\n onLeaveFeedback={flow.openHideSurvey}\n onUndo={flow.undoDismiss}\n />\n ) : (\n <>\n {obsolete && obsoleteCopy && <ObsolesceBanner {...obsolete} copy={obsoleteCopy} />}\n <Card\n inert={isObsoleteDimmed}\n sx={{\n ...(isObsoleteDimmed && {\n position: 'relative',\n zIndex: 2,\n pointerEvents: 'none',\n }),\n }}\n >\n {isObsoleteDimmed && <Box sx={OBSOLETE_OVERLAY_SX} />}\n <Header isMini={isMini} subtitle={subtitle} title={title ?? ''} />\n {isLoading ? (\n <LoadingCard />\n ) : (\n Block && <Block beatGuid={guid} payload={insights_payload} />\n )}\n\n <Stack sx={{ gap: 6, pb: 16, pt: 12, px: 16 }}>\n <P\n dangerouslySetInnerHTML={{\n __html: insights_payload.description.html_text,\n }}\n variant=\"subtitle2\"\n />\n {/* V2: the envelope's link opens the action block it names. */}\n {envelopeLink && (\n <Button\n endIcon={<ChevronRight />}\n onClick={() =>\n insightsV2Store.openActionDrawer({ guid, trigger: 'inDescriptionCta' })\n }\n sx={{ height: 24, p: 4, width: 'max-content' }}\n >\n {envelopeLink.label}\n </Button>\n )}\n {/* V1: the legacy field, shown for beats that do not send the envelope link. */}\n {!inDescriptionCta?.label && beat?.in_description_cta && (\n <Button\n endIcon={<ChevronRight />}\n onClick={() => {}}\n sx={{ height: 24, p: 4, width: 'max-content' }}\n >\n {beat.in_description_cta}\n </Button>\n )}\n </Stack>\n\n {(ctaLabel || showSecondaryCta) && (\n <Stack sx={{ gap: 8, pb: 16, px: 16 }}>\n {ctaLabel &&\n !isCtaButton && (\n // The card's action when it has no primary CTA button (mini always; a full card whose\n // only link names no block). What the tap does is the host's decision (Pulse posts\n // `carousel/cta`, the same redirect a V1 mini card sends), never the action drawer the\n // full card's CTA opens. It is a real (blue, focusable) button for that tap, but has no\n // handler of its own and does not stop the click, so it reaches the host's card handler\n // exactly as a tap on the card does.\n <Button sx={MINI_CTA_SX} variant=\"text\">\n {ctaLabel}\n </Button>\n )}\n {isCtaButton && primary_cta && (\n <Button\n aria-disabled={isCtaDisabled(primary_cta.block) || primaryCtaState.disabled}\n disabled={primaryCtaState.disabled}\n onClick={() => onCtaClick('primary', primary_cta)}\n sx={{\n ...(isCtaDisabled(primary_cta.block) && { color: 'text.disabled' }),\n }}\n variant=\"outlined\"\n >\n {primary_cta.label}\n </Button>\n )}\n {/* Mini has room for one CTA. */}\n {showSecondaryCta && secondary_cta && (\n <Button\n aria-disabled={\n isCtaDisabled(secondary_cta.block) || secondaryCtaState.disabled\n }\n color=\"secondary\"\n disabled={secondaryCtaState.disabled}\n onClick={() => onCtaClick('secondary', secondary_cta)}\n >\n {secondary_cta.label}\n </Button>\n )}\n </Stack>\n )}\n\n <FeedbackBar onTellUsMore={flow.openRatingSurvey} show={flow.isFeedbackBarShown} />\n </Card>\n </>\n )}\n\n <ActionBlockLayer beat={beat} />\n\n <DismissInsightDialog\n isOpen={flow.isDismissOpen}\n onClose={flow.closeDismissDialog}\n onDismiss={flow.confirmDismiss}\n />\n\n {flow.isSurveyOpen && (\n <FeedbackDialog\n characterLimitLabel={flow.survey.characterLimitLabel}\n closeAriaLabel={flow.survey.closeAriaLabel}\n isOpen={true}\n onBackClick={flow.feedbackDialogCallbacks.onBackClick}\n onClose={flow.closeSurvey}\n onSubmit={flow.submitSurvey}\n onTextInputFocus={flow.feedbackDialogCallbacks.onTextInputFocus}\n options={flow.survey.options}\n primaryText={flow.survey.submitText}\n secondaryText={flow.survey.backText}\n title={flow.survey.title}\n />\n )}\n\n {flow.cardState === 'visible' && insights_payload.footer && (\n <Footer footer={insights_payload.footer} />\n )}\n </Stack>\n </BeatActionsProvider>\n )\n },\n)\n\nexport default BaseLayout\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,IAAM,KAA+B,CAAC,GAEhC,KAAsB;AAAA,EAC1B,UAAU;AAAA,EACV,KAAK;AAAA,EACL,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,iBAAiB;AAAA,EACjB,SAAS;AAAA,EAET,QAAQ;AACV,GAGM,KAAc;AAAA,EAClB,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,IAAI;AAAA,EACJ,eAAe;AACjB,GAEM,KAAa,GAAA,CAChB,EACC,MAAA,GACA,aAAA,IAAc,IACd,UAAA,GACA,WAAA,IAAY,IACZ,SAAA,IAAU,GAAA,MACW;AACrB,QAAM,IAAO,EAAmB,GAC1B,IAAkB,EAAmB,GACrC,EAAE,QAAA,EAAA,IAAW,EAAa,GAC1B,IAAO,GAAoB,GAAM,CAAW,GAE5C,IAAS,EAAe,GACxB,EACJ,QAAQ,GACR,SAAS,GACT,WAAW,EAAA,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AAA,EAAC,GAAD;AAAA,kBACE,iBACE,EAAc,EAAc,KAAK,KAAK,EAAkB;AAAA,kBAE1D,OAAM;AAAA,kBACN,UAAU,EAAkB;AAAA,kBAC5B,SAAA,MAAe,EAAW,aAAa,CAAa;AAAA,kBAEnD,UAAA,EAAc;AAAA,gBACT,CAAA;AAAA,cAEL;AAAA;YAGT,gBAAA,EAAC,IAAD;AAAA,cAAa,cAAc,EAAK;AAAA,cAAkB,MAAM,EAAK;AAAA,YAAqB,CAAA;AAAA,UAC9E;AAAA,QACN,CAAA,CAAA,EAAA,CAAA;AAAA,QAGJ,gBAAA,EAAC,IAAD,EAAwB,MAAA,EAAO,CAAA;AAAA,QAE/B,gBAAA,EAAC,IAAD;AAAA,UACE,QAAQ,EAAK;AAAA,UACb,SAAS,EAAK;AAAA,UACd,WAAW,EAAK;AAAA,QACjB,CAAA;AAAA,QAEA,EAAK,gBACJ,gBAAA,EAAC,GAAD;AAAA,UACE,qBAAqB,EAAK,OAAO;AAAA,UACjC,gBAAgB,EAAK,OAAO;AAAA,UAC5B,QAAQ;AAAA,UACR,aAAa,EAAK,wBAAwB;AAAA,UAC1C,SAAS,EAAK;AAAA,UACd,UAAU,EAAK;AAAA,UACf,kBAAkB,EAAK,wBAAwB;AAAA,UAC/C,SAAS,EAAK,OAAO;AAAA,UACrB,aAAa,EAAK,OAAO;AAAA,UACzB,eAAe,EAAK,OAAO;AAAA,UAC3B,OAAO,EAAK,OAAO;AAAA,QACpB,CAAA;AAAA,QAGF,EAAK,cAAc,aAAa,EAAiB,UAChD,gBAAA,EAAC,IAAD,EAAQ,QAAQ,EAAiB,OAAS,CAAA;AAAA,MAEvC;AAAA;EACY,CAAA;AAEzB,CACF"}
|
|
@@ -1,101 +1,167 @@
|
|
|
1
|
-
import { useInsightsV2Store as
|
|
1
|
+
import { useInsightsV2Store as B } from "../../common/context/hooks.es.js";
|
|
2
2
|
import { slot as f } from "../../core/types/Insights.es.js";
|
|
3
|
-
import { getCategoryColor as
|
|
4
|
-
import { TinyBarChart as
|
|
5
|
-
import { BAR_ARIA_LABEL as
|
|
6
|
-
import { ThemedSVGImage as
|
|
7
|
-
import
|
|
8
|
-
import { createVariantBlock as
|
|
9
|
-
import { ActionBlockLayer as
|
|
10
|
-
import
|
|
11
|
-
import { InsightOptionsMenu as
|
|
12
|
-
import { ReactComponent as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import { P as
|
|
16
|
-
import
|
|
17
|
-
import { Icon as
|
|
18
|
-
import { Fragment as
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
var
|
|
3
|
+
import { getCategoryColor as D } from "../../core/utils/CategoryUtil.es.js";
|
|
4
|
+
import { TinyBarChart as L } from "../../common/components/TinyBarChart.es.js";
|
|
5
|
+
import { BAR_ARIA_LABEL as V, buildChartData as A, buildDataSeries as z } from "../blocks/ChartBlocks/BarchartBlock/utils.es.js";
|
|
6
|
+
import { ThemedSVGImage as R } from "./chartblocks/ThemedSVGImage.es.js";
|
|
7
|
+
import u from "./LogoFromGuid.es.js";
|
|
8
|
+
import { createVariantBlock as E } from "../blocks/createVariantBlock.es.js";
|
|
9
|
+
import { ActionBlockLayer as O } from "../actionBlocks/ActionBlockLayer.es.js";
|
|
10
|
+
import b from "./BadgedTile.es.js";
|
|
11
|
+
import { InsightOptionsMenu as P } from "./InsightOptionsMenu.es.js";
|
|
12
|
+
import { ReactComponent as T } from "./shared/images/FeeDetected.es.js";
|
|
13
|
+
import j from "./StatusBadge.es.js";
|
|
14
|
+
import h from "@mui/material/Stack";
|
|
15
|
+
import { P as F, Text as G } from "@mxenabled/mxui";
|
|
16
|
+
import K from "@mui/material/Button";
|
|
17
|
+
import { Icon as _ } from "@mxenabled/mx-icons";
|
|
18
|
+
import { Fragment as N, jsx as t, jsxs as s } from "react/jsx-runtime";
|
|
19
|
+
import o from "@mui/material/Box";
|
|
20
|
+
import W from "@mui/material/Card";
|
|
21
|
+
var c = 44, x = 32, k = ({ logo: r }) => r ? /* @__PURE__ */ t(u, {
|
|
22
22
|
logo: r,
|
|
23
|
-
size:
|
|
24
|
-
}) : /* @__PURE__ */ t(
|
|
23
|
+
size: c
|
|
24
|
+
}) : /* @__PURE__ */ t(o, {
|
|
25
25
|
"data-testid": "compact-insight-card-fallback-icon",
|
|
26
26
|
sx: {
|
|
27
27
|
alignItems: "center",
|
|
28
28
|
bgcolor: "primary.lighter",
|
|
29
29
|
display: "flex",
|
|
30
|
-
height:
|
|
30
|
+
height: c,
|
|
31
31
|
justifyContent: "center",
|
|
32
|
-
width:
|
|
32
|
+
width: c
|
|
33
33
|
},
|
|
34
|
-
children: /* @__PURE__ */ t(
|
|
34
|
+
children: /* @__PURE__ */ t(_, {
|
|
35
35
|
color: "primary",
|
|
36
36
|
fill: !0,
|
|
37
37
|
name: "lightbulb",
|
|
38
38
|
size: 24
|
|
39
39
|
})
|
|
40
|
-
}),
|
|
41
|
-
center: /* @__PURE__ */ t(
|
|
42
|
-
size:
|
|
40
|
+
}), y = ({ logo: r }) => /* @__PURE__ */ t(b, {
|
|
41
|
+
center: /* @__PURE__ */ t(k, { logo: r }),
|
|
42
|
+
size: c,
|
|
43
43
|
sx: { flexShrink: 0 }
|
|
44
|
-
}),
|
|
45
|
-
center: /* @__PURE__ */ t(
|
|
46
|
-
size:
|
|
44
|
+
}), H = ({ logo: r }) => /* @__PURE__ */ t(b, {
|
|
45
|
+
center: /* @__PURE__ */ t(k, { logo: r }),
|
|
46
|
+
size: c,
|
|
47
47
|
sx: { flexShrink: 0 },
|
|
48
|
-
topRight: /* @__PURE__ */ t(
|
|
49
|
-
}),
|
|
48
|
+
topRight: /* @__PURE__ */ t(j, { tone: "warning" })
|
|
49
|
+
}), M = () => /* @__PURE__ */ t(R, {
|
|
50
50
|
divProps: { style: {
|
|
51
51
|
flexShrink: 0,
|
|
52
52
|
lineHeight: 0,
|
|
53
53
|
width: "max-content"
|
|
54
54
|
} },
|
|
55
|
-
image:
|
|
56
|
-
}),
|
|
57
|
-
const a =
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
image: T
|
|
56
|
+
}), Z = ({ data: r }) => {
|
|
57
|
+
const { from_logo: i, to_logo: a } = r ?? {};
|
|
58
|
+
return /* @__PURE__ */ s(o, {
|
|
59
|
+
sx: {
|
|
60
|
+
flexShrink: 0,
|
|
61
|
+
height: 64,
|
|
62
|
+
position: "relative",
|
|
63
|
+
width: 64
|
|
64
|
+
},
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ t(o, {
|
|
67
|
+
sx: {
|
|
68
|
+
borderRadius: "6px",
|
|
69
|
+
left: 0,
|
|
70
|
+
overflow: "hidden",
|
|
71
|
+
position: "absolute",
|
|
72
|
+
top: 0
|
|
73
|
+
},
|
|
74
|
+
children: /* @__PURE__ */ t(u, {
|
|
75
|
+
logo: i,
|
|
76
|
+
size: x
|
|
77
|
+
})
|
|
78
|
+
}),
|
|
79
|
+
/* @__PURE__ */ t(o, {
|
|
80
|
+
"aria-hidden": !0,
|
|
81
|
+
sx: {
|
|
82
|
+
alignItems: "center",
|
|
83
|
+
bgcolor: "text.secondary",
|
|
84
|
+
borderRadius: "50%",
|
|
85
|
+
display: "flex",
|
|
86
|
+
height: 20,
|
|
87
|
+
justifyContent: "center",
|
|
88
|
+
left: 22,
|
|
89
|
+
position: "absolute",
|
|
90
|
+
top: 22,
|
|
91
|
+
width: 20,
|
|
92
|
+
zIndex: 1
|
|
93
|
+
},
|
|
94
|
+
children: /* @__PURE__ */ t(_, {
|
|
95
|
+
name: "link",
|
|
96
|
+
size: 14,
|
|
97
|
+
sx: { color: "primary.contrastText" }
|
|
98
|
+
})
|
|
99
|
+
}),
|
|
100
|
+
/* @__PURE__ */ t(o, {
|
|
101
|
+
sx: {
|
|
102
|
+
borderRadius: "6px",
|
|
103
|
+
bottom: 0,
|
|
104
|
+
overflow: "hidden",
|
|
105
|
+
position: "absolute",
|
|
106
|
+
right: 0
|
|
107
|
+
},
|
|
108
|
+
children: /* @__PURE__ */ t(u, {
|
|
109
|
+
logo: a,
|
|
110
|
+
size: x
|
|
111
|
+
})
|
|
112
|
+
})
|
|
113
|
+
]
|
|
114
|
+
});
|
|
115
|
+
}, $ = ({ data: r }) => {
|
|
116
|
+
const i = z(f(r, "series"));
|
|
117
|
+
if (!i.length) return null;
|
|
118
|
+
const a = f(r, "category_guid"), n = A(i, V).slice(-3);
|
|
119
|
+
return /* @__PURE__ */ t(o, {
|
|
61
120
|
"data-testid": "compact-insight-card-bar-chart",
|
|
62
121
|
sx: { flexShrink: 0 },
|
|
63
|
-
children: /* @__PURE__ */ t(
|
|
64
|
-
color: (
|
|
65
|
-
data:
|
|
122
|
+
children: /* @__PURE__ */ t(L, {
|
|
123
|
+
color: (l) => a ? D(a, l) : l.palette.primary.main,
|
|
124
|
+
data: n
|
|
66
125
|
})
|
|
67
126
|
});
|
|
68
|
-
},
|
|
127
|
+
}, q = E({
|
|
69
128
|
variants: {
|
|
70
|
-
category_color:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
129
|
+
category_color: $,
|
|
130
|
+
linked_logos: Z,
|
|
131
|
+
minimal: y,
|
|
132
|
+
with_illustration: M,
|
|
133
|
+
with_warning_badge: H
|
|
74
134
|
},
|
|
75
|
-
fallback:
|
|
135
|
+
fallback: y,
|
|
76
136
|
name: "InsightVisual"
|
|
77
|
-
}),
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
137
|
+
}), J = {
|
|
138
|
+
BillAmountNotStandard: {
|
|
139
|
+
key: "in_description_cta",
|
|
140
|
+
trigger: "inDescriptionCta"
|
|
141
|
+
},
|
|
142
|
+
ConnectDiscoveredAccountsV2: {
|
|
143
|
+
key: "in_description_cta",
|
|
144
|
+
trigger: "inDescriptionCta"
|
|
145
|
+
}
|
|
146
|
+
}, Q = (r) => r.stopPropagation(), yt = ({ beat: r, isCtaDisabled: i = !1, onCtaClick: a, onTap: n, payload: l }) => {
|
|
147
|
+
const { openActionDrawer: C } = B(), { description: I, instance_slot: m, primary_cta: p, title: v } = l, d = J[l.template ?? ""], g = d ? l[d.key] : p, w = f(m.data, "logo"), S = (e) => {
|
|
148
|
+
if (e.stopPropagation(), !(i || !g)) {
|
|
149
|
+
if (d) {
|
|
84
150
|
r && C({
|
|
85
151
|
guid: r.guid,
|
|
86
|
-
trigger:
|
|
152
|
+
trigger: d.trigger
|
|
87
153
|
});
|
|
88
154
|
return;
|
|
89
155
|
}
|
|
90
|
-
|
|
156
|
+
p && a?.(p);
|
|
91
157
|
}
|
|
92
158
|
};
|
|
93
|
-
return /* @__PURE__ */
|
|
159
|
+
return /* @__PURE__ */ s(N, { children: [/* @__PURE__ */ s(W, {
|
|
94
160
|
"data-testid": "compact-insight-card",
|
|
95
|
-
...
|
|
96
|
-
onClick:
|
|
97
|
-
onKeyDown: (
|
|
98
|
-
|
|
161
|
+
...n ? {
|
|
162
|
+
onClick: n,
|
|
163
|
+
onKeyDown: (e) => {
|
|
164
|
+
e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), n?.());
|
|
99
165
|
},
|
|
100
166
|
role: "button",
|
|
101
167
|
tabIndex: 0
|
|
@@ -106,9 +172,9 @@ var l = 44, y = ({ logo: r }) => r ? /* @__PURE__ */ t(L, {
|
|
|
106
172
|
pl: 8,
|
|
107
173
|
pr: 16,
|
|
108
174
|
pt: 8,
|
|
109
|
-
...
|
|
175
|
+
...n && { cursor: "pointer" }
|
|
110
176
|
},
|
|
111
|
-
children: [/* @__PURE__ */
|
|
177
|
+
children: [/* @__PURE__ */ s(h, {
|
|
112
178
|
sx: {
|
|
113
179
|
alignItems: "center",
|
|
114
180
|
flexDirection: "row",
|
|
@@ -117,59 +183,59 @@ var l = 44, y = ({ logo: r }) => r ? /* @__PURE__ */ t(L, {
|
|
|
117
183
|
pl: 8,
|
|
118
184
|
pt: 4
|
|
119
185
|
},
|
|
120
|
-
children: [/* @__PURE__ */ t(
|
|
186
|
+
children: [/* @__PURE__ */ t(G, {
|
|
121
187
|
bold: !0,
|
|
122
188
|
variant: "body1",
|
|
123
|
-
children:
|
|
124
|
-
}), /* @__PURE__ */ t(
|
|
125
|
-
onClick:
|
|
189
|
+
children: v ?? ""
|
|
190
|
+
}), /* @__PURE__ */ t(o, {
|
|
191
|
+
onClick: Q,
|
|
126
192
|
sx: { display: "flex" },
|
|
127
|
-
children: /* @__PURE__ */ t(
|
|
193
|
+
children: /* @__PURE__ */ t(P, {})
|
|
128
194
|
})]
|
|
129
|
-
}), /* @__PURE__ */
|
|
195
|
+
}), /* @__PURE__ */ s(h, {
|
|
130
196
|
sx: {
|
|
131
197
|
flexDirection: "row",
|
|
132
198
|
gap: 16,
|
|
133
199
|
pl: 8,
|
|
134
200
|
pt: 4
|
|
135
201
|
},
|
|
136
|
-
children: [/* @__PURE__ */
|
|
202
|
+
children: [/* @__PURE__ */ s(h, {
|
|
137
203
|
sx: {
|
|
138
204
|
flex: 1,
|
|
139
205
|
gap: 8,
|
|
140
206
|
minWidth: 0
|
|
141
207
|
},
|
|
142
|
-
children: [/* @__PURE__ */ t(
|
|
143
|
-
dangerouslySetInnerHTML: { __html:
|
|
208
|
+
children: [/* @__PURE__ */ t(F, {
|
|
209
|
+
dangerouslySetInnerHTML: { __html: I.html_text },
|
|
144
210
|
"data-testid": "compact-insight-card-description",
|
|
145
211
|
variant: "subtitle2"
|
|
146
|
-
}),
|
|
147
|
-
"aria-disabled":
|
|
148
|
-
onClick:
|
|
212
|
+
}), g?.label && /* @__PURE__ */ t(K, {
|
|
213
|
+
"aria-disabled": i,
|
|
214
|
+
onClick: S,
|
|
149
215
|
size: "small",
|
|
150
216
|
sx: {
|
|
151
217
|
alignSelf: "flex-start",
|
|
152
218
|
mt: 5,
|
|
153
219
|
ml: -8,
|
|
154
220
|
px: 8,
|
|
155
|
-
...
|
|
221
|
+
...i && {
|
|
156
222
|
color: "text.disabled",
|
|
157
223
|
cursor: "default"
|
|
158
224
|
}
|
|
159
225
|
},
|
|
160
226
|
variant: "text",
|
|
161
|
-
children:
|
|
227
|
+
children: g.label
|
|
162
228
|
})]
|
|
163
|
-
}), /* @__PURE__ */ t(
|
|
229
|
+
}), /* @__PURE__ */ t(q, {
|
|
164
230
|
data: m.data,
|
|
165
|
-
logo:
|
|
231
|
+
logo: w,
|
|
166
232
|
variant: m.variant
|
|
167
233
|
})]
|
|
168
234
|
})]
|
|
169
|
-
}), r && /* @__PURE__ */ t(
|
|
235
|
+
}), r && /* @__PURE__ */ t(O, { beat: r })] });
|
|
170
236
|
};
|
|
171
237
|
export {
|
|
172
|
-
|
|
238
|
+
yt as default
|
|
173
239
|
};
|
|
174
240
|
|
|
175
241
|
//# sourceMappingURL=CompactInsightCard.es.js.map
|