@mx-cartographer/experiences 9.5.2 → 9.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/common/components/CurrencyDialog.d.ts +10 -2
  3. package/dist/common/components/CurrencyDialog.es.js +56 -50
  4. package/dist/common/components/CurrencyDialog.es.js.map +1 -1
  5. package/dist/common/components/ListItemWrapper.d.ts +5 -0
  6. package/dist/common/components/ListItemWrapper.es.js +10 -9
  7. package/dist/common/components/ListItemWrapper.es.js.map +1 -1
  8. package/dist/core/types/localization/InsightsFeedCopy.d.ts +21 -0
  9. package/dist/core/types/localization/index.d.ts +1 -1
  10. package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js +31 -25
  11. package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js.map +1 -1
  12. package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.d.ts +13 -0
  13. package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js +128 -0
  14. package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js.map +1 -0
  15. package/dist/insights-v2/actionBlocks/AmountInputModalBlock/index.d.ts +1 -0
  16. package/dist/insights-v2/actionBlocks/AmountInputModalBlock/layout.d.ts +14 -0
  17. package/dist/insights-v2/actionBlocks/AmountInputModalBlock/layout.es.js +14 -0
  18. package/dist/insights-v2/actionBlocks/AmountInputModalBlock/layout.es.js.map +1 -0
  19. package/dist/insights-v2/components/BaseLayout.es.js +22 -22
  20. package/dist/insights-v2/ctaActions/runCtaAction.es.js +10 -10
  21. package/dist/insights-v2/ctaActions/runCtaAction.es.js.map +1 -1
  22. package/dist/insights-v2/index.es.js +17 -17
  23. package/dist/insights-v2/mappings/actionBlocksKey.d.ts +1 -0
  24. package/dist/insights-v2/mappings/actionBlocksKey.es.js +2 -1
  25. package/dist/insights-v2/mappings/actionBlocksKey.es.js.map +1 -1
  26. package/dist/insights-v2/mappings/blocks.d.ts +2 -1
  27. package/dist/insights-v2/mappings/blocks.es.js +62 -62
  28. package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
  29. package/dist/insights-v2/mappings/hasDrawerBlock.d.ts +1 -0
  30. package/dist/insights-v2/mappings/hasDrawerBlock.es.js +13 -0
  31. package/dist/insights-v2/mappings/hasDrawerBlock.es.js.map +1 -0
  32. package/dist/recurringtransactions/components/shared/recurringsettings/SelectTransaction.d.ts +4 -2
  33. package/dist/recurringtransactions/components/shared/recurringsettings/SelectTransaction.es.js +18 -18
  34. package/dist/recurringtransactions/components/shared/recurringsettings/SelectTransaction.es.js.map +1 -1
  35. package/dist/transactions/components/shared/TransactionList.d.ts +5 -0
  36. package/dist/transactions/components/shared/TransactionList.es.js +39 -38
  37. package/dist/transactions/components/shared/TransactionList.es.js.map +1 -1
  38. package/dist/transactions/components/shared/transactionlist/TransactionRow.d.ts +2 -0
  39. package/dist/transactions/components/shared/transactionlist/TransactionRow.es.js +27 -26
  40. package/dist/transactions/components/shared/transactionlist/TransactionRow.es.js.map +1 -1
  41. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AmountInputModalBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.tsx"],"sourcesContent":["import React from 'react'\n\nimport Stack from '@mui/material/Stack'\n\nimport MuiDialog from '@mui/material/Dialog'\nimport IconButton from '@mui/material/IconButton'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { H3, InstitutionLogo, Text } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport {\n CurrencyDialog,\n Loader,\n buildDynamicCopy,\n useGlobalCopyStore,\n useInsightsV2Store,\n useSettingsStore,\n useUserStore,\n} from '../../../common'\nimport getAccountDisplayName from '../../../common/utils/AccountDisplayName'\nimport { useBeatActions } from '../../beatActions'\nimport { useCtaHandler } from '../../ctaActions'\nimport type { ActionBlockProps } from '../../mappings/blocks'\nimport { getDynamicCtaBasedOnTriggers } from '../util'\n\nimport {\n AMOUNT_INPUT_VARIANTS,\n findLowBalanceProfile,\n isAmountInputVariant,\n isWholeAmount,\n toInputValue,\n} from './layout'\n\n/**\n * The dialog frame for the states that have no form: loading, and a non-retriable problem. Named by\n * its heading and closable by button, Esc and backdrop, like the form dialog.\n */\nconst StatusDialog = ({\n children,\n closeAriaLabel,\n heading,\n onClose,\n}: React.PropsWithChildren<{ closeAriaLabel?: string; heading?: string; onClose: () => void }>) => {\n const headingId = React.useId()\n\n return (\n <MuiDialog\n aria-labelledby={heading ? headingId : undefined}\n maxWidth=\"xs\"\n onClose={onClose}\n open={true}\n >\n <Stack sx={{ gap: 12, p: 24, position: 'relative' }}>\n {heading && <H3 id={headingId}>{heading}</H3>}\n <IconButton\n aria-label={closeAriaLabel || 'Close'}\n onClick={onClose}\n sx={{ position: 'absolute', right: 8, top: 18 }}\n >\n <Icon name=\"close\" sx={{ color: 'action.active' }} />\n </IconButton>\n {children}\n </Stack>\n </MuiDialog>\n )\n}\n\n/**\n * `amount_input_modal_block`: one whole-dollar setting edited in a dialog (Figma 441:24913 and\n * 5402:34137). The CTA's variant picks what is edited:\n * - `low_balance_threshold`: the `threshold` on the beat account's low-balance alert profile;\n * - `safety_net`: `savings_opportunity_minimum_checking_account_balance` on the insight profile.\n *\n * Registered with `presentation: 'modal'`, so no drawer opens behind it; closing the dialog ends\n * the action-drawer session. `observer` is required: the starting values are read from stores.\n */\nexport const AmountInputModalBlock = observer(function AmountInputModalBlock({\n beat,\n}: ActionBlockProps) {\n const { common: commonCopy, insights_feed: insightsFeedCopy } = useGlobalCopyStore()\n const { actionDrawer, closeActionDrawer } = useInsightsV2Store()\n const settingsStore = useSettingsStore()\n const { userInsightProfile } = useUserStore()\n const runHandler = useCtaHandler(beat, useBeatActions())\n\n const { primary_cta, secondary_cta } = beat.insights_payload ?? {}\n const variant = getDynamicCtaBasedOnTriggers(actionDrawer, primary_cta, secondary_cta)?.variant\n const copy = insightsFeedCopy?.amount_input_modal\n const isLowBalance = variant === AMOUNT_INPUT_VARIANTS.LOW_BALANCE_THRESHOLD\n\n const lowBalanceProfile = isLowBalance\n ? findLowBalanceProfile(settingsStore.notificationProfiles, beat.primary_account_guid)\n : undefined\n const savedAmount = isLowBalance\n ? lowBalanceProfile?.threshold\n : userInsightProfile?.savings_opportunity_minimum_checking_account_balance\n\n // Mounted only while open (modal presentation), so mounting is the open: profiles are reloaded\n // here on each open, so the threshold prefills as saved now. `SettingsStore` swallows a failed\n // request, which leaves no profile for the account: the missing-profile error below covers it.\n const [isLoadingProfiles, setIsLoadingProfiles] = React.useState(isLowBalance)\n // False once unmounted: a save that resolves after the user closed the dialog must not close\n // (or update) whatever action session is open by then.\n const isMounted = React.useRef(true)\n\n React.useEffect(() => {\n isMounted.current = true\n\n return () => {\n isMounted.current = false\n }\n }, [])\n\n React.useEffect(() => {\n if (!isLowBalance) return\n\n void settingsStore.loadNotificationProfiles().finally(() => {\n if (isMounted.current) setIsLoadingProfiles(false)\n })\n }, [isLowBalance, settingsStore])\n\n // `null` until the user types: the field shows the saved amount until then.\n const [typed, setTyped] = React.useState<string | null>(null)\n const [isSaving, setIsSaving] = React.useState(false)\n const [saveFailed, setSaveFailed] = React.useState(false)\n\n const value = typed ?? toInputValue(savedAmount)\n\n if (isLoadingProfiles) {\n return (\n <StatusDialog closeAriaLabel={commonCopy?.close_aria} onClose={closeActionDrawer}>\n <Loader />\n </StatusDialog>\n )\n }\n\n // Copy ships separately (see the doc's Rollout order), so check every string the form renders:\n // a partial ship falls to the error dialog instead of throwing mid-render.\n const variantCopy = isAmountInputVariant(variant) ? copy?.[variant] : undefined\n const hasCopy =\n !!variantCopy?.title &&\n !!variantCopy.description &&\n !!variantCopy.input_label &&\n !!copy?.whole_number_error &&\n !!copy.save_error &&\n !!commonCopy?.save_button &&\n // Cancel renders for the low-balance variant only.\n (!isLowBalance || !!commonCopy.cancel_button) &&\n !!commonCopy.close_aria\n const hasProfile = isLowBalance ? !!lowBalanceProfile : !!userInsightProfile\n\n if (!copy || !variantCopy || !hasCopy || !hasProfile) {\n // One message to the user; distinct warnings so a rollout problem can be traced to its cause.\n console.warn(\n `amount_input_modal_block: ${\n !copy\n ? 'copy namespace missing'\n : !isAmountInputVariant(variant)\n ? `unknown variant \"${variant}\"`\n : !hasCopy\n ? `copy incomplete for \"${variant}\"`\n : isLowBalance\n ? 'no low-balance profile for the account'\n : 'user insight profile not set by the host'\n }`,\n )\n\n return (\n <StatusDialog\n closeAriaLabel={commonCopy?.close_aria}\n heading={commonCopy?.error_heading}\n onClose={closeActionDrawer}\n >\n <Text>{commonCopy?.error_message}</Text>\n </StatusDialog>\n )\n }\n\n const isEdit = !isLowBalance && !!savedAmount\n const accountName = beat.primary_account ? getAccountDisplayName(beat.primary_account) : ''\n const isValid = isWholeAmount(value)\n const isInvalid = value !== '' && !isValid\n\n const handleSave = async () => {\n // Guarded here too, not only by the disabled button: Enter submits the dialog's form directly.\n if (!isValid || isSaving) return\n\n const amount = Number(value)\n\n setIsSaving(true)\n setSaveFailed(false)\n\n const ok = isLowBalance\n ? await runHandler('updateNotificationProfileThreshold', {\n profileGuid: lowBalanceProfile?.guid,\n threshold: amount,\n })\n : await runHandler('updateUserInsightProfile', {\n fields: { savings_opportunity_minimum_checking_account_balance: amount },\n })\n\n if (!isMounted.current) return\n\n setIsSaving(false)\n\n if (ok) closeActionDrawer()\n else setSaveFailed(true)\n }\n\n return (\n <CurrencyDialog\n closeAriaLabel={commonCopy.close_aria}\n // Only strings and the <strong> go in, so the result is renderable (the helper's type also\n // admits raw DOM nodes).\n content={\n buildDynamicCopy(\n (isEdit && variantCopy.description_edit) || variantCopy.description,\n <strong key=\"account\">{accountName}</strong>,\n ) as React.ReactNode\n }\n errorText={isInvalid ? copy.whole_number_error : saveFailed ? copy.save_error : undefined}\n handleInputChange={(next) => {\n setTyped(next)\n setSaveFailed(false)\n }}\n handleModalClose={closeActionDrawer}\n handlePrimaryAction={() => void handleSave()}\n handleSecondaryAction={closeActionDrawer}\n inputLabel={variantCopy.input_label}\n inputValue={value}\n isOpen={true}\n isPrimaryDisabled={isSaving || !isValid}\n primaryText={commonCopy.save_button}\n secondaryText={isLowBalance ? commonCopy.cancel_button : undefined}\n subtitle={\n isLowBalance && beat.primary_account ? (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 8 }}>\n {/* Decorative: the account name is the visible text beside it. */}\n <InstitutionLogo\n alt=\"\"\n institutionGuid={beat.primary_account.institution_guid ?? ''}\n size={16}\n />\n <Text color=\"text.secondary\" uppercase={true} variant=\"body2\">\n {accountName}\n </Text>\n </Stack>\n ) : undefined\n }\n title={(isEdit && variantCopy.title_edit) || variantCopy.title}\n />\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;AAsCA,IAAM,IAAA,CAAgB,EACpB,UAAA,GACA,gBAAA,GACA,SAAA,GACA,SAAA,EAAA,MACiG;AACjG,QAAM,IAAY,EAAM,MAAM;AAE9B,SACE,gBAAA,EAAC,IAAD;AAAA,IACE,mBAAiB,IAAU,IAAY;AAAA,IACvC,UAAS;AAAA,IACA,SAAA;AAAA,IACT,MAAM;AAAA,IAEN,UAAA,gBAAA,EAAC,GAAD;AAAA,MAAO,IAAI;AAAA,QAAE,KAAK;AAAA,QAAI,GAAG;AAAA,QAAI,UAAU;AAAA,MAAW;AAAA,MAAlD,UAAA;AAAA,QACG,KAAW,gBAAA,EAAC,IAAD;AAAA,UAAI,IAAI;AAAA,UAAY,UAAA;AAAA,QAAY,CAAA;AAAA,QAC5C,gBAAA,EAAC,IAAD;AAAA,UACE,cAAY,KAAkB;AAAA,UAC9B,SAAS;AAAA,UACT,IAAI;AAAA,YAAE,UAAU;AAAA,YAAY,OAAO;AAAA,YAAG,KAAK;AAAA,UAAG;AAAA,UAE9C,UAAA,gBAAA,EAAC,IAAD;AAAA,YAAM,MAAK;AAAA,YAAQ,IAAI,EAAE,OAAO,gBAAgB;A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IACrB,EAAc,EAAI;AAAA,EACzB;AAEA,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,gBAAgB,EAAW;AAAA,IAG3B,SACE,EACG,KAAU,EAAY,oBAAqB,EAAY,aACxD,gBAAA,EAAC,UAAD,EAAA,UAAuB,EAAoB,GAA/B,SAA+B,CAC7C;AAAA,IAEF,WAAW,IAAY,EAAK,qBAAqB,IAAa,EAAK,aAAa;AAAA,IAChF,mBAAA,CAAoB,MAAS;AAC3B,MAAA,EAAS,CAAI,GACb,EAAc,EAAK;AAAA,IACrB;AAAA,IACA,kBAAkB;AAAA,IAClB,qBAAA,MAAA;AAA2B,MAAK,EAAW;AAAA;AAAA,IAC3C,uBAAuB;AAAA,IACvB,YAAY,EAAY;AAAA,IACxB,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,mBAAmB,KAAY,CAAC;AAAA,IAChC,aAAa,EAAW;AAAA,IACxB,eAAe,IAAe,EAAW,gBAAgB;AAAA,IACzD,UACE,KAAgB,EAAK,kBACnB,gBAAA,EAAC,GAAD;AAAA,MAAO,IAAI;AAAA,QAAE,YAAY;AAAA,QAAU,eAAe;AAAA,QAAO,KAAK;AAAA,MAAE;AAAA,MAAhE,UAAA,CAEE,gBAAA,EAAC,IAAD;AAAA,QACE,KAAI;AAAA,QACJ,iBAAiB,EAAK,gBAAgB,oBAAoB;AAAA,QAC1D,MAAM;AAAA,MACP,CAAA,GACD,gBAAA,EAAC,GAAD;AAAA,QAAM,OAAM;AAAA,QAAiB,WAAW;AAAA,QAAM,SAAQ;AAAA,QACnD,UAAA;AAAA,MACG,CAAA,CACD;AAAA,IACL,CAAA,IAAA;AAAA,IAEN,OAAQ,KAAU,EAAY,cAAe,EAAY;AAAA,EAC1D,CAAA;AAEL,CAAC"}
@@ -0,0 +1 @@
1
+ export { AmountInputModalBlock } from './AmountInputModalBlock';
@@ -0,0 +1,14 @@
1
+ import { NotificationProfile } from '../../../core';
2
+ /** CTA variants `amount_input_modal_block` serves (ditto sets one on the beat's CTA). */
3
+ export declare const AMOUNT_INPUT_VARIANTS: {
4
+ readonly LOW_BALANCE_THRESHOLD: "low_balance_threshold";
5
+ readonly SAFETY_NET: "safety_net";
6
+ };
7
+ export type AmountInputVariant = (typeof AMOUNT_INPUT_VARIANTS)[keyof typeof AMOUNT_INPUT_VARIANTS];
8
+ export declare const isAmountInputVariant: (variant?: string | null) => variant is AmountInputVariant;
9
+ /** Whole dollars from 1 to `MAX_AMOUNT`, as pulse v1 accepted for both settings. */
10
+ export declare const isWholeAmount: (value: string) => boolean;
11
+ /** A saved amount as the field's starting text; nothing saved (or zero) starts empty. */
12
+ export declare const toInputValue: (amount?: number | null) => string;
13
+ /** The account's low-balance alert profile, which holds the threshold (as pulse v1 looked it up). */
14
+ export declare const findLowBalanceProfile: (profiles: NotificationProfile[], accountGuid?: string | null) => NotificationProfile | undefined;
@@ -0,0 +1,14 @@
1
+ import { AccountNotificationTypes as o } from "../../../core/types/Notification.es.js";
2
+ var a = {
3
+ LOW_BALANCE_THRESHOLD: "low_balance_threshold",
4
+ SAFETY_NET: "safety_net"
5
+ }, A = (t) => Object.values(a).includes(t ?? ""), i = 1e9, _ = (t) => /^\d+$/.test(t) && Number(t) >= 1 && Number(t) <= i, c = (t) => t ? String(Math.round(t)) : "", N = (t, n) => n ? t.find((e) => e.entity_guid === n && e.notification_type === o.AccountBalanceLow) : void 0;
6
+ export {
7
+ a as AMOUNT_INPUT_VARIANTS,
8
+ N as findLowBalanceProfile,
9
+ A as isAmountInputVariant,
10
+ _ as isWholeAmount,
11
+ c as toInputValue
12
+ };
13
+
14
+ //# sourceMappingURL=layout.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AmountInputModalBlock/layout.ts"],"sourcesContent":["import type { NotificationProfile } from '../../../core'\nimport { AccountNotificationTypes } from '../../../core/types/Notification'\n\n/** CTA variants `amount_input_modal_block` serves (ditto sets one on the beat's CTA). */\nexport const AMOUNT_INPUT_VARIANTS = {\n LOW_BALANCE_THRESHOLD: 'low_balance_threshold',\n SAFETY_NET: 'safety_net',\n} as const\n\nexport type AmountInputVariant = (typeof AMOUNT_INPUT_VARIANTS)[keyof typeof AMOUNT_INPUT_VARIANTS]\n\nexport const isAmountInputVariant = (variant?: string | null): variant is AmountInputVariant =>\n Object.values<string>(AMOUNT_INPUT_VARIANTS).includes(variant ?? '')\n\n/** Pulse v1's upper bound for a safety net; applied to both variants. */\nconst MAX_AMOUNT = 1_000_000_000\n\n/** Whole dollars from 1 to `MAX_AMOUNT`, as pulse v1 accepted for both settings. */\nexport const isWholeAmount = (value: string): boolean =>\n /^\\d+$/.test(value) && Number(value) >= 1 && Number(value) <= MAX_AMOUNT\n\n/** A saved amount as the field's starting text; nothing saved (or zero) starts empty. */\nexport const toInputValue = (amount?: number | null): string =>\n amount ? String(Math.round(amount)) : ''\n\n/** The account's low-balance alert profile, which holds the threshold (as pulse v1 looked it up). */\nexport const findLowBalanceProfile = (\n profiles: NotificationProfile[],\n accountGuid?: string | null,\n): NotificationProfile | undefined =>\n accountGuid\n ? profiles.find(\n (profile) =>\n profile.entity_guid === accountGuid &&\n profile.notification_type === AccountNotificationTypes.AccountBalanceLow,\n )\n : undefined\n"],"mappings":";AAIA,IAAa,IAAwB;AAAA,EACnC,uBAAuB;AAAA,EACvB,YAAY;AACd,GAIa,IAAA,CAAwB,MACnC,OAAO,OAAe,CAAqB,EAAE,SAAS,KAAW,EAAE,GAG/D,IAAa,KAGN,IAAA,CAAiB,MAC5B,QAAQ,KAAK,CAAK,KAAK,OAAO,CAAK,KAAK,KAAK,OAAO,CAAK,KAAK,GAGnD,IAAA,CAAgB,MAC3B,IAAS,OAAO,KAAK,MAAM,CAAM,CAAC,IAAI,IAG3B,IAAA,CACX,GACA,MAEA,IACI,EAAS,KAAA,CACN,MACC,EAAQ,gBAAgB,KACxB,EAAQ,sBAAsB,EAAyB,iBAC3D,IACA"}
@@ -4,17 +4,17 @@ import { isContactSupportCtaDisabled as H } from "../actionBlocks/ContactSupport
4
4
  import { logoFromRef as M } from "./shared/EntityLogo.es.js";
5
5
  import { actionBlocksKey as P } from "../mappings/actionBlocksKey.es.js";
6
6
  import { ErrorCard as U } from "./ErrorCard.es.js";
7
- import { blocks as j } from "../mappings/blocks.es.js";
8
- import z from "./Footer.es.js";
9
- import G from "./Header.es.js";
10
- import { FeedbackBar as K } from "./FeedbackBar.es.js";
11
- import X from "./FeedbackDialog.es.js";
12
- import { DismissInsightDialog as V } from "./DismissInsightDialog.es.js";
13
- import { HiddenConfirmationCard as W } from "./HiddenConfirmationCard.es.js";
14
- import { LoadingCard as Y } from "./LoadingCard.es.js";
15
- import { ObsolesceBanner as q } from "./ObsolesceBanner.es.js";
16
- import { ActionBlockLayer as J } from "../actionBlocks/ActionBlockLayer.es.js";
17
- import { useBeatCtaActions as Q } from "../ctaActions/useCtaAction.es.js";
7
+ import { useBeatCtaActions as j } from "../ctaActions/useCtaAction.es.js";
8
+ import { blocks as z } from "../mappings/blocks.es.js";
9
+ import G from "./Footer.es.js";
10
+ import K from "./Header.es.js";
11
+ import { FeedbackBar as X } from "./FeedbackBar.es.js";
12
+ import V from "./FeedbackDialog.es.js";
13
+ import { DismissInsightDialog as W } from "./DismissInsightDialog.es.js";
14
+ import { HiddenConfirmationCard as Y } from "./HiddenConfirmationCard.es.js";
15
+ import { LoadingCard as q } from "./LoadingCard.es.js";
16
+ import { ObsolesceBanner as J } from "./ObsolesceBanner.es.js";
17
+ import { ActionBlockLayer as Q } from "../actionBlocks/ActionBlockLayer.es.js";
18
18
  import { useBeatFeedbackFlow as Z } from "../hooks/useBeatFeedbackFlow.es.js";
19
19
  import { observer as $ } from "mobx-react-lite";
20
20
  import b from "@mui/material/Stack";
@@ -42,7 +42,7 @@ var so = {}, no = {
42
42
  px: 2,
43
43
  textTransform: "none"
44
44
  }, Ro = $(({ beat: t, beatActions: s = so, obsolete: c, isLoading: x = !1, isError: _ = !1 }) => {
45
- const v = N(), { config: S } = E(), o = Z(t, s), { runCta: T, primary: C, secondary: g } = Q(t, s, t.insights_payload?.primary_cta, t.insights_payload?.secondary_cta);
45
+ const v = N(), { config: S } = E(), o = Z(t, s), { runCta: T, primary: C, secondary: g } = j(t, s, t.insights_payload?.primary_cta, t.insights_payload?.secondary_cta);
46
46
  if (_) return /* @__PURE__ */ i(U, {});
47
47
  const e = t.insights_payload;
48
48
  if (!e || o.cardState === "dismissed") return null;
@@ -57,17 +57,17 @@ var so = {}, no = {
57
57
  }
58
58
  await T(f, u);
59
59
  }
60
- }, k = j[A], d = L === "mini", m = v.insights_feed?.general, p = c?.state === "not_refreshable" && !F && !!m;
60
+ }, k = z[A], d = L === "mini", m = v.insights_feed?.general, p = c?.state === "not_refreshable" && !F && !!m;
61
61
  return /* @__PURE__ */ i(R, {
62
62
  value: o.wrappedActions,
63
63
  children: /* @__PURE__ */ a(b, {
64
64
  sx: { mb: 16 },
65
65
  children: [
66
- o.cardState === "confirming" ? /* @__PURE__ */ i(W, {
66
+ o.cardState === "confirming" ? /* @__PURE__ */ i(Y, {
67
67
  onClose: o.collapseConfirmation,
68
68
  onLeaveFeedback: o.openHideSurvey,
69
69
  onUndo: o.undoDismiss
70
- }) : /* @__PURE__ */ a(to, { children: [c && m && /* @__PURE__ */ i(q, {
70
+ }) : /* @__PURE__ */ a(to, { children: [c && m && /* @__PURE__ */ i(J, {
71
71
  ...c,
72
72
  copy: m
73
73
  }), /* @__PURE__ */ a(ao, {
@@ -79,12 +79,12 @@ var so = {}, no = {
79
79
  } },
80
80
  children: [
81
81
  p && /* @__PURE__ */ i(ro, { sx: no }),
82
- /* @__PURE__ */ i(G, {
82
+ /* @__PURE__ */ i(K, {
83
83
  isMini: d,
84
84
  subtitle: w,
85
85
  title: D ?? ""
86
86
  }),
87
- x ? /* @__PURE__ */ i(Y, {}) : k && /* @__PURE__ */ i(k, {
87
+ x ? /* @__PURE__ */ i(q, {}) : k && /* @__PURE__ */ i(k, {
88
88
  beatGuid: I,
89
89
  payload: e
90
90
  }),
@@ -136,19 +136,19 @@ var so = {}, no = {
136
136
  children: n.label
137
137
  })]
138
138
  }),
139
- /* @__PURE__ */ i(K, {
139
+ /* @__PURE__ */ i(X, {
140
140
  onTellUsMore: o.openRatingSurvey,
141
141
  show: o.isFeedbackBarShown
142
142
  })
143
143
  ]
144
144
  })] }),
145
- /* @__PURE__ */ i(J, { beat: t }),
146
- /* @__PURE__ */ i(V, {
145
+ /* @__PURE__ */ i(Q, { beat: t }),
146
+ /* @__PURE__ */ i(W, {
147
147
  isOpen: o.isDismissOpen,
148
148
  onClose: o.closeDismissDialog,
149
149
  onDismiss: o.confirmDismiss
150
150
  }),
151
- o.isSurveyOpen && /* @__PURE__ */ i(X, {
151
+ o.isSurveyOpen && /* @__PURE__ */ i(V, {
152
152
  characterLimitLabel: o.survey.characterLimitLabel,
153
153
  closeAriaLabel: o.survey.closeAriaLabel,
154
154
  isOpen: !0,
@@ -161,7 +161,7 @@ var so = {}, no = {
161
161
  secondaryText: o.survey.backText,
162
162
  title: o.survey.title
163
163
  }),
164
- o.cardState === "visible" && e.footer && /* @__PURE__ */ i(z, { footer: e.footer })
164
+ o.cardState === "visible" && e.footer && /* @__PURE__ */ i(G, { footer: e.footer })
165
165
  ]
166
166
  })
167
167
  });
@@ -1,10 +1,10 @@
1
1
  import { sendBeatCta as l } from "../../common/utils/PostMessage.es.js";
2
- import { hasDrawerBlock as f } from "../mappings/blocks.es.js";
3
- import { HOST_ACTIONS as m } from "./hostActions.es.js";
4
- import { ctaActions as C } from "./ctaConfig.es.js";
5
- import { ctaHandlers as v } from "./ctaHandlers.es.js";
6
- import { resolveCtaMetadata as g } from "./ctaPostMessages.es.js";
7
- var w = {}, o = ({ cta: t }) => t.action_key && C[t.action_key] || w, H = (t) => {
2
+ import { HOST_ACTIONS as f } from "./hostActions.es.js";
3
+ import { ctaActions as m } from "./ctaConfig.es.js";
4
+ import { ctaHandlers as C } from "./ctaHandlers.es.js";
5
+ import { resolveCtaMetadata as v } from "./ctaPostMessages.es.js";
6
+ import { hasDrawerBlock as g } from "../mappings/hasDrawerBlock.es.js";
7
+ var w = {}, o = ({ cta: t }) => t.action_key && m[t.action_key] || w, H = (t) => {
8
8
  const a = o(t);
9
9
  return { disabled: t.stores.insightsV2Store.ctaStatus[t.beat.guid] === "pending" || (a.disabledWhen?.(t) ?? !1) };
10
10
  }, n = ({ beat: t, slot: a, stores: r }) => {
@@ -20,17 +20,17 @@ var w = {}, o = ({ cta: t }) => t.action_key && C[t.action_key] || w, H = (t) =>
20
20
  userGuid: t.insights_payload?.user_guid ?? t.user_guid
21
21
  });
22
22
  }, S = (t) => {
23
- f(t.cta.block) && n(t);
23
+ g(t.cta.block) && n(t);
24
24
  }, _ = (t, { beat: a, stores: r }) => {
25
25
  t === "refreshBeat" && r.emitUpdate({ staleBeatGuid: a.guid });
26
26
  }, y = ({ beat: t, slot: a, hostActions: r }) => {
27
27
  a !== "primary" || t.cta_clicked_at || Promise.resolve().then(() => r.onCtaAction?.({
28
28
  beatGuid: t.guid,
29
- name: m.markCtaClicked
29
+ name: f.markCtaClicked
30
30
  })).catch(() => {
31
31
  });
32
32
  }, c = async (t, a, r) => {
33
- const e = v[a];
33
+ const e = C[a];
34
34
  if (!e) throw new Error(`Unknown CTA handler "${a}"`);
35
35
  await e(t);
36
36
  for (const s of r) _(s, t);
@@ -56,7 +56,7 @@ var w = {}, o = ({ cta: t }) => t.action_key && C[t.action_key] || w, H = (t) =>
56
56
  };
57
57
  a.skipCtaClicked || y(e), await u(e, async () => {
58
58
  a.run && await c(e, a.run, a.onSuccess ?? []);
59
- const s = g(e);
59
+ const s = v(e);
60
60
  s && h(e, s);
61
61
  const i = a.next ?? (a.run ? "none" : "default");
62
62
  i === "default" ? S(e) : i === "drawer" && n(e);
@@ -1 +1 @@
1
- {"version":3,"file":"runCtaAction.es.js","names":[],"sources":["../../../src/insights-v2/ctaActions/runCtaAction.ts"],"sourcesContent":["import { sendBeatCta } from '../../common/utils/PostMessage'\nimport { hasDrawerBlock } from '../mappings/blocks'\nimport { ctaActions } from './ctaConfig'\nimport { resolveCtaMetadata } from './ctaPostMessages'\nimport { ctaHandlers, type CtaHandlerName } from './ctaHandlers'\nimport { HOST_ACTIONS } from './hostActions'\nimport type { CtaPostMessageMetadata } from '../../core'\nimport type {\n CtaContext,\n CtaEffect,\n CtaHandler,\n CtaHandlerContext,\n CtaState,\n CtaStateContext,\n CtaStep,\n RunHandlerOptions,\n} from './types'\n\nconst DEFAULT_STEP: CtaStep = {}\n\n// ─── Resolution ─────────────────────────────────────────────────────────────\n\n/** The beat's own context (input a block collected for it), `{}` until something is written. */\nexport const beatContextOf = ({ beat, stores }: Pick<CtaStateContext, 'beat' | 'stores'>) =>\n stores.insightsV2Store.beatContext[beat.guid] ?? {}\n\n/** The step named by the CTA's `action_key`, or the empty default (no key / unknown key). */\nexport const resolveStep = ({ cta }: Pick<CtaStateContext, 'cta'>): CtaStep =>\n (cta.action_key && ctaActions[cta.action_key]) || DEFAULT_STEP\n\n/** Pending always disables; the step's `disabledWhen` may add to that. */\nexport const resolveCtaState = (ctx: CtaStateContext): CtaState => {\n const step = resolveStep(ctx)\n const pending = ctx.stores.insightsV2Store.ctaStatus[ctx.beat.guid] === 'pending'\n\n return { disabled: pending || (step.disabledWhen?.(ctx) ?? false) }\n}\n\n// ─── Targets and effects ────────────────────────────────────────────────────\n\n/** Opens the beat's drawer for whichever slot triggered the current step. */\nconst openDrawerForSlot = ({\n beat,\n slot,\n stores,\n}: Pick<CtaContext, 'beat' | 'slot' | 'stores'>) => {\n stores.insightsV2Store.openCtaDrawer(\n beat.guid,\n slot === 'primary' ? 'primaryCta' : 'secondaryCta',\n )\n}\n\n/**\n * Posts this CTA's resolved message (event, op and beat-specific payload, from the backend's\n * `cta.metadata` or the template's `ctaPostMessages` entry) to the host.\n */\nconst postCtaMessage = ({ beat, stores }: CtaContext, metadata: CtaPostMessageMetadata) => {\n const { is_mobile_webview, clientConfig } = stores.appDataStore.appConfig\n const { event, action, payload } = metadata\n\n sendBeatCta(beat, {\n event: event ?? undefined,\n op: action ?? undefined,\n extras: payload ?? undefined,\n isMobileWebview: is_mobile_webview,\n webviewScheme: clientConfig?.master?.ui_message_webview_url_scheme,\n userGuid: beat.insights_payload?.user_guid ?? beat.user_guid,\n })\n}\n\n/**\n * Default target: open the drawer for a real block, otherwise nothing. A post message is never\n * implied by a missing block; it is sent only when one resolves (see runCtaAction).\n */\nconst runDefaultTarget = (ctx: CtaContext) => {\n if (hasDrawerBlock(ctx.cta.block)) openDrawerForSlot(ctx)\n}\n\nconst runEffect = (effect: CtaEffect, { beat, stores }: CtaContext) => {\n switch (effect) {\n case 'refreshBeat':\n stores.emitUpdate({ staleBeatGuid: beat.guid })\n break\n }\n}\n\n/**\n * First primary click records `cta_clicked_at` through the host. Fire-and-forget: whatever the\n * host does (reject, throw, return nothing) must never fail the user's action.\n */\nconst markCtaClicked = ({ beat, slot, hostActions }: CtaContext) => {\n if (slot !== 'primary' || beat.cta_clicked_at) return\n\n // Wrapping the call in `.then` turns a synchronous throw into a rejection, and the `.catch`\n // swallows both: a failed cta_clicked_at write is not the user's action.\n Promise.resolve()\n .then(() =>\n hostActions.onCtaAction?.({ beatGuid: beat.guid, name: HOST_ACTIONS.markCtaClicked }),\n )\n .catch(() => {})\n}\n\n// ─── Shared bookkeeping ─────────────────────────────────────────────────────\n\n/** Runs a named handler, then its `onSuccess` effects. Shared by card CTAs and drawer saves. */\nconst runHandlerWithEffects = async (\n ctx: CtaContext,\n handlerName: CtaHandlerName,\n onSuccess: CtaEffect[],\n): Promise<void> => {\n // Names are typed, but the map is still indexed defensively: config can come from anywhere.\n const handler = (ctaHandlers as Record<string, CtaHandler>)[handlerName]\n\n if (!handler) throw new Error(`Unknown CTA handler \"${handlerName}\"`)\n\n await handler(ctx)\n\n for (const effect of onSuccess) runEffect(effect, ctx)\n}\n\n/** Per-beat status around `work`: `pending` -> `done` | `error` (+ captureException). */\nconst withCtaStatus = async (\n { beat, stores }: Pick<CtaContext, 'beat' | 'stores'>,\n work: () => Promise<void>,\n captureContext: Record<string, string> = {},\n): Promise<boolean> => {\n const { insightsV2Store } = stores\n\n insightsV2Store.setCtaStatus(beat.guid, 'pending')\n\n try {\n await work()\n insightsV2Store.setCtaStatus(beat.guid, 'done')\n\n return true\n } catch (error) {\n insightsV2Store.setCtaStatus(beat.guid, 'error')\n stores.captureException(error, {\n store: 'ctaActions',\n template: beat.template,\n ...captureContext,\n })\n\n return false\n }\n}\n\n// ─── Entry points ───────────────────────────────────────────────────────────\n\n/**\n * Runs the CTA's step: `run` handler, `onSuccess` effects, the CTA's post message if one resolves\n * (backend `cta.metadata` or the template's `ctaPostMessages` entry; skipped when the handler\n * throws), then the `next` target. No resolved message = no post.\n */\nexport const runCtaAction = async (ctx: CtaContext): Promise<void> => {\n const step = resolveStep(ctx)\n const stepParams = typeof step.params === 'function' ? step.params(ctx) : step.params\n const stepCtx: CtaContext = { ...ctx, params: { ...stepParams, ...ctx.params } }\n\n if (!step.skipCtaClicked) markCtaClicked(stepCtx)\n\n await withCtaStatus(stepCtx, async () => {\n if (step.run) await runHandlerWithEffects(stepCtx, step.run, step.onSuccess ?? [])\n\n const metadata = resolveCtaMetadata(stepCtx)\n\n if (metadata) postCtaMessage(stepCtx, metadata)\n\n const target = step.next ?? (step.run ? 'none' : 'default')\n\n if (target === 'default') runDefaultTarget(stepCtx)\n else if (target === 'drawer') openDrawerForSlot(stepCtx)\n })\n}\n\n/** Placeholder CTA for handlers run from inside a drawer, where no card slot is involved. */\nconst DIRECT_CTA = { label: '', block: '' }\n\n/** Runs a handler directly (drawer Save buttons): same bookkeeping as a card CTA. True on success. */\nexport const runCtaHandler = (\n ctx: CtaHandlerContext,\n handlerName: CtaHandlerName,\n { onSuccess = [] }: RunHandlerOptions = {},\n): Promise<boolean> => {\n const fullCtx: CtaContext = { ...ctx, cta: DIRECT_CTA, slot: 'primary' }\n\n return withCtaStatus(fullCtx, () => runHandlerWith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,CAAQ;AAE9C,UAAM,IAAS,EAAK,SAAS,EAAK,MAAM,SAAS;AAEjD,IAAI,MAAW,YAAW,EAAiB,CAAO,IACzC,MAAW,YAAU,EAAkB,CAAO;AAAA,EACzD,CAAC;AACH,GAGM,IAAa;AAAA,EAAE,OAAO;AAAA,EAAI,OAAO;AAAG,GAG7B,IAAA,CACX,GACA,GACA,EAAE,WAAA,IAAY,CAAC,EAAA,IAAyB,CAAC,MACpB;AACrB,QAAM,IAAsB;AAAA,IAAE,GAAG;AAAA,IAAK,KAAK;AAAA,IAAY,MAAM;AAAA,EAAU;AAEvE,SAAO,EAAc,GAAA,MAAe,EAAsB,GAAS,GAAa,CAAS,GAAG,EAC1F,SAAS,EACX,CAAC;AACH"}
1
+ {"version":3,"file":"runCtaAction.es.js","names":[],"sources":["../../../src/insights-v2/ctaActions/runCtaAction.ts"],"sourcesContent":["import { sendBeatCta } from '../../common/utils/PostMessage'\nimport { hasDrawerBlock } from '../mappings/hasDrawerBlock'\nimport { ctaActions } from './ctaConfig'\nimport { resolveCtaMetadata } from './ctaPostMessages'\nimport { ctaHandlers, type CtaHandlerName } from './ctaHandlers'\nimport { HOST_ACTIONS } from './hostActions'\nimport type { CtaPostMessageMetadata } from '../../core'\nimport type {\n CtaContext,\n CtaEffect,\n CtaHandler,\n CtaHandlerContext,\n CtaState,\n CtaStateContext,\n CtaStep,\n RunHandlerOptions,\n} from './types'\n\nconst DEFAULT_STEP: CtaStep = {}\n\n// ─── Resolution ─────────────────────────────────────────────────────────────\n\n/** The beat's own context (input a block collected for it), `{}` until something is written. */\nexport const beatContextOf = ({ beat, stores }: Pick<CtaStateContext, 'beat' | 'stores'>) =>\n stores.insightsV2Store.beatContext[beat.guid] ?? {}\n\n/** The step named by the CTA's `action_key`, or the empty default (no key / unknown key). */\nexport const resolveStep = ({ cta }: Pick<CtaStateContext, 'cta'>): CtaStep =>\n (cta.action_key && ctaActions[cta.action_key]) || DEFAULT_STEP\n\n/** Pending always disables; the step's `disabledWhen` may add to that. */\nexport const resolveCtaState = (ctx: CtaStateContext): CtaState => {\n const step = resolveStep(ctx)\n const pending = ctx.stores.insightsV2Store.ctaStatus[ctx.beat.guid] === 'pending'\n\n return { disabled: pending || (step.disabledWhen?.(ctx) ?? false) }\n}\n\n// ─── Targets and effects ────────────────────────────────────────────────────\n\n/** Opens the beat's drawer for whichever slot triggered the current step. */\nconst openDrawerForSlot = ({\n beat,\n slot,\n stores,\n}: Pick<CtaContext, 'beat' | 'slot' | 'stores'>) => {\n stores.insightsV2Store.openCtaDrawer(\n beat.guid,\n slot === 'primary' ? 'primaryCta' : 'secondaryCta',\n )\n}\n\n/**\n * Posts this CTA's resolved message (event, op and beat-specific payload, from the backend's\n * `cta.metadata` or the template's `ctaPostMessages` entry) to the host.\n */\nconst postCtaMessage = ({ beat, stores }: CtaContext, metadata: CtaPostMessageMetadata) => {\n const { is_mobile_webview, clientConfig } = stores.appDataStore.appConfig\n const { event, action, payload } = metadata\n\n sendBeatCta(beat, {\n event: event ?? undefined,\n op: action ?? undefined,\n extras: payload ?? undefined,\n isMobileWebview: is_mobile_webview,\n webviewScheme: clientConfig?.master?.ui_message_webview_url_scheme,\n userGuid: beat.insights_payload?.user_guid ?? beat.user_guid,\n })\n}\n\n/**\n * Default target: open the drawer for a real block, otherwise nothing. A post message is never\n * implied by a missing block; it is sent only when one resolves (see runCtaAction).\n */\nconst runDefaultTarget = (ctx: CtaContext) => {\n if (hasDrawerBlock(ctx.cta.block)) openDrawerForSlot(ctx)\n}\n\nconst runEffect = (effect: CtaEffect, { beat, stores }: CtaContext) => {\n switch (effect) {\n case 'refreshBeat':\n stores.emitUpdate({ staleBeatGuid: beat.guid })\n break\n }\n}\n\n/**\n * First primary click records `cta_clicked_at` through the host. Fire-and-forget: whatever the\n * host does (reject, throw, return nothing) must never fail the user's action.\n */\nconst markCtaClicked = ({ beat, slot, hostActions }: CtaContext) => {\n if (slot !== 'primary' || beat.cta_clicked_at) return\n\n // Wrapping the call in `.then` turns a synchronous throw into a rejection, and the `.catch`\n // swallows both: a failed cta_clicked_at write is not the user's action.\n Promise.resolve()\n .then(() =>\n hostActions.onCtaAction?.({ beatGuid: beat.guid, name: HOST_ACTIONS.markCtaClicked }),\n )\n .catch(() => {})\n}\n\n// ─── Shared bookkeeping ─────────────────────────────────────────────────────\n\n/** Runs a named handler, then its `onSuccess` effects. Shared by card CTAs and drawer saves. */\nconst runHandlerWithEffects = async (\n ctx: CtaContext,\n handlerName: CtaHandlerName,\n onSuccess: CtaEffect[],\n): Promise<void> => {\n // Names are typed, but the map is still indexed defensively: config can come from anywhere.\n const handler = (ctaHandlers as Record<string, CtaHandler>)[handlerName]\n\n if (!handler) throw new Error(`Unknown CTA handler \"${handlerName}\"`)\n\n await handler(ctx)\n\n for (const effect of onSuccess) runEffect(effect, ctx)\n}\n\n/** Per-beat status around `work`: `pending` -> `done` | `error` (+ captureException). */\nconst withCtaStatus = async (\n { beat, stores }: Pick<CtaContext, 'beat' | 'stores'>,\n work: () => Promise<void>,\n captureContext: Record<string, string> = {},\n): Promise<boolean> => {\n const { insightsV2Store } = stores\n\n insightsV2Store.setCtaStatus(beat.guid, 'pending')\n\n try {\n await work()\n insightsV2Store.setCtaStatus(beat.guid, 'done')\n\n return true\n } catch (error) {\n insightsV2Store.setCtaStatus(beat.guid, 'error')\n stores.captureException(error, {\n store: 'ctaActions',\n template: beat.template,\n ...captureContext,\n })\n\n return false\n }\n}\n\n// ─── Entry points ───────────────────────────────────────────────────────────\n\n/**\n * Runs the CTA's step: `run` handler, `onSuccess` effects, the CTA's post message if one resolves\n * (backend `cta.metadata` or the template's `ctaPostMessages` entry; skipped when the handler\n * throws), then the `next` target. No resolved message = no post.\n */\nexport const runCtaAction = async (ctx: CtaContext): Promise<void> => {\n const step = resolveStep(ctx)\n const stepParams = typeof step.params === 'function' ? step.params(ctx) : step.params\n const stepCtx: CtaContext = { ...ctx, params: { ...stepParams, ...ctx.params } }\n\n if (!step.skipCtaClicked) markCtaClicked(stepCtx)\n\n await withCtaStatus(stepCtx, async () => {\n if (step.run) await runHandlerWithEffects(stepCtx, step.run, step.onSuccess ?? [])\n\n const metadata = resolveCtaMetadata(stepCtx)\n\n if (metadata) postCtaMessage(stepCtx, metadata)\n\n const target = step.next ?? (step.run ? 'none' : 'default')\n\n if (target === 'default') runDefaultTarget(stepCtx)\n else if (target === 'drawer') openDrawerForSlot(stepCtx)\n })\n}\n\n/** Placeholder CTA for handlers run from inside a drawer, where no card slot is involved. */\nconst DIRECT_CTA = { label: '', block: '' }\n\n/** Runs a handler directly (drawer Save buttons): same bookkeeping as a card CTA. True on success. */\nexport const runCtaHandler = (\n ctx: CtaHandlerContext,\n handlerName: CtaHandlerName,\n { onSuccess = [] }: RunHandlerOptions = {},\n): Promise<boolean> => {\n const fullCtx: CtaContext = { ...ctx, cta: DIRECT_CTA, slot: 'primary' }\n\n return withCtaStatus(fullCtx, () => runHandlerWithEffects(fullCtx, handlerName, onSuccess), {\n handler: handlerName,\n })\n}\n"],"mappings":";;;;;;AAkBA,IAAM,IAAwB,CAAC,GASlB,IAAA,CAAe,EAAE,KAAA,EAAA,MAC3B,EAAI,cAAc,EAAW,EAAI,UAAA,KAAgB,GAGvC,IAAA,CAAmB,MAAmC;AACjE,QAAM,IAAO,EAAY,CAAG;AAG5B,SAAO,EAAE,UAFO,EAAI,OAAO,gBAAgB,UAAU,EAAI,KAAK,IAAA,MAAU,cAEzC,EAAK,eAAe,CAAG,KAAK,IAAO;AACpE,GAKM,IAAA,CAAqB,EACzB,MAAA,GACA,MAAA,GACA,QAAA,EAAA,MACkD;AAClD,EAAA,EAAO,gBAAgB,cACrB,EAAK,MACL,MAAS,YAAY,eAAe,cACtC;AACF,GAMM,IAAA,CAAkB,EAAE,MAAA,GAAM,QAAA,EAAA,GAAsB,MAAqC;AACzF,QAAM,EAAE,mBAAA,GAAmB,cAAA,EAAA,IAAiB,EAAO,aAAa,WAC1D,EAAE,OAAA,GAAO,QAAA,GAAQ,SAAA,EAA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/C,EAAO,iBAAiB,GAAO;AAAA,MAC7B,OAAO;AAAA,MACP,UAAU,EAAK;AAAA,MACf,GAAG;AAAA,IACL,CAAC,GAEM;AAAA,EACT;AACF,GASa,IAAe,OAAO,MAAmC;AACpE,QAAM,IAAO,EAAY,CAAG,GACtB,IAAa,OAAO,EAAK,UAAW,aAAa,EAAK,OAAO,CAAG,IAAI,EAAK,QACzE,IAAsB;AAAA,IAAE,GAAG;AAAA,IAAK,QAAQ;AAAA,MAAE,GAAG;AAAA,MAAY,GAAG,EAAI;AAAA,IAAO;AAAA,EAAE;AAE/E,EAAK,EAAK,kBAAgB,EAAe,CAAO,GAEhD,MAAM,EAAc,GAAS,YAAY;AACvC,IAAI,EAAK,OAAK,MAAM,EAAsB,GAAS,EAAK,KAAK,EAAK,aAAa,CAAC,CAAC;AAEjF,UAAM,IAAW,EAAmB,CAAO;AAE3C,IAAI,KAAU,EAAe,GAAS,CAAQ;AAE9C,UAAM,IAAS,EAAK,SAAS,EAAK,MAAM,SAAS;AAEjD,IAAI,MAAW,YAAW,EAAiB,CAAO,IACzC,MAAW,YAAU,EAAkB,CAAO;AAAA,EACzD,CAAC;AACH,GAGM,IAAa;AAAA,EAAE,OAAO;AAAA,EAAI,OAAO;AAAG,GAG7B,IAAA,CACX,GACA,GACA,EAAE,WAAA,IAAY,CAAC,EAAA,IAAyB,CAAC,MACpB;AACrB,QAAM,IAAsB;AAAA,IAAE,GAAG;AAAA,IAAK,KAAK;AAAA,IAAY,MAAM;AAAA,EAAU;AAEvE,SAAO,EAAc,GAAA,MAAe,EAAsB,GAAS,GAAa,CAAS,GAAG,EAC1F,SAAS,EACX,CAAC;AACH"}
@@ -32,14 +32,14 @@ import { SVGImageBlock as lr } from "./blocks/ImageBlocks/SVGImageBlock/SVGImage
32
32
  import Cr from "./components/AmountPill.es.js";
33
33
  import Br from "./components/DesignateEmergencySavingsCard.es.js";
34
34
  import { ErrorCard as hr } from "./components/ErrorCard.es.js";
35
- import { FeedbackBar as Sr } from "./components/FeedbackBar.es.js";
36
- import Ar from "./components/FeedbackDialog.es.js";
37
- import { DismissInsightDialog as br } from "./components/DismissInsightDialog.es.js";
38
- import { HiddenConfirmationCard as Lr } from "./components/HiddenConfirmationCard.es.js";
39
- import { LoadingCard as vr } from "./components/LoadingCard.es.js";
40
- import { ObsolesceBanner as wr } from "./components/ObsolesceBanner.es.js";
41
- import { HOST_ACTIONS as Pr } from "./ctaActions/hostActions.es.js";
42
- import { useBeatCtaActions as Mr, useCtaHandler as Vr } from "./ctaActions/useCtaAction.es.js";
35
+ import { HOST_ACTIONS as Sr } from "./ctaActions/hostActions.es.js";
36
+ import { useBeatCtaActions as Ar, useCtaHandler as Tr } from "./ctaActions/useCtaAction.es.js";
37
+ import { FeedbackBar as Ir } from "./components/FeedbackBar.es.js";
38
+ import Hr from "./components/FeedbackDialog.es.js";
39
+ import { DismissInsightDialog as Or } from "./components/DismissInsightDialog.es.js";
40
+ import { HiddenConfirmationCard as Er } from "./components/HiddenConfirmationCard.es.js";
41
+ import { LoadingCard as Rr } from "./components/LoadingCard.es.js";
42
+ import { ObsolesceBanner as Vr } from "./components/ObsolesceBanner.es.js";
43
43
  import yr from "./components/BaseLayout.es.js";
44
44
  import Gr from "./components/StatusMessageCard.es.js";
45
45
  import Nr from "./components/LogoTile.es.js";
@@ -63,24 +63,24 @@ export {
63
63
  Br as DesignateEmergencySavingsCard,
64
64
  J as DirectDepositBlock,
65
65
  q as DirectDepositCard,
66
- br as DismissInsightDialog,
66
+ Or as DismissInsightDialog,
67
67
  R as DonutChartBlock,
68
68
  O as DoubleBarChartBlock,
69
69
  V as DoubleProgressBarBlock,
70
70
  hr as ErrorCard,
71
- Sr as FeedbackBar,
72
- Ar as FeedbackDialog,
73
- Pr as HOST_ACTIONS,
74
- Lr as HiddenConfirmationCard,
71
+ Ir as FeedbackBar,
72
+ Hr as FeedbackDialog,
73
+ Sr as HOST_ACTIONS,
74
+ Er as HiddenConfirmationCard,
75
75
  S as InsightErrorCard,
76
76
  c as InsightOptionsMenu,
77
77
  or as InsightTransactionRow,
78
- vr as LoadingCard,
78
+ Rr as LoadingCard,
79
79
  Ur as LogoClusterCard,
80
80
  d as LogoFromGuid,
81
81
  Nr as LogoTile,
82
82
  qr as MerchantHighlightCard,
83
- wr as ObsolesceBanner,
83
+ Vr as ObsolesceBanner,
84
84
  n as OverflowMenu,
85
85
  Jr as P2PLogoStack,
86
86
  lr as SVGImageBlock,
@@ -105,6 +105,6 @@ export {
105
105
  C as isLogoGuid,
106
106
  m as resolveInsightRender,
107
107
  a as useBeatActions,
108
- Mr as useBeatCtaActions,
109
- Vr as useCtaHandler
108
+ Ar as useBeatCtaActions,
109
+ Tr as useCtaHandler
110
110
  };
@@ -7,4 +7,5 @@ export declare const actionBlocksKey: {
7
7
  RECURRING_TRANSACTION_ACTION_BLOCK: string;
8
8
  TRANSACTION_LIST_ACTION_BLOCK: string;
9
9
  REMAINING_CASH_ACTION_BLOCK: string;
10
+ AMOUNT_INPUT_MODAL_ACTION_BLOCK: string;
10
11
  };
@@ -6,7 +6,8 @@ var _ = {
6
6
  CONTACT_SUPPORT_ACTION_BLOCK: "contact_support_block",
7
7
  RECURRING_TRANSACTION_ACTION_BLOCK: "recurring_transaction_block",
8
8
  TRANSACTION_LIST_ACTION_BLOCK: "transaction_list_block",
9
- REMAINING_CASH_ACTION_BLOCK: "remaining_cash_block"
9
+ REMAINING_CASH_ACTION_BLOCK: "remaining_cash_block",
10
+ AMOUNT_INPUT_MODAL_ACTION_BLOCK: "amount_input_modal_block"
10
11
  };
11
12
  export {
12
13
  _ as actionBlocksKey
@@ -1 +1 @@
1
- {"version":3,"file":"actionBlocksKey.es.js","names":[],"sources":["../../../src/insights-v2/mappings/actionBlocksKey.ts"],"sourcesContent":["// Keys for the drawer drilldown registry in `blocks.ts`, extracted into their own module.\n//\n// Why: chart blocks (e.g. BarchartBlock, DoubleBarChartBlock) need\n// `TRANSCATION_HISTORY_ACTION_BLOCK` to tag a chart bar's drilldown context, but they are\n// themselves re-exported through `../blocks` -> `mappings/blocks.ts` imports from that same\n// barrel to build its `blocks` registry. Importing the key straight from `mappings/blocks.ts`\n// closed that loop into a circular import: evaluating `mappings/blocks.ts` pulled in the\n// `blocks` barrel, which (before it got to `ComponentBlocks`/`AccountBlock`) loaded\n// `BarchartBlock`, which imported back into the still-initializing `mappings/blocks.ts` —\n// tripping a \"Cannot access 'AccountBlock' before initialization\" TDZ error in Storybook/Vite.\n//\n// Keeping the keys here (no dependency on `mappings/blocks.ts`) lets chart blocks reference\n// them without re-entering that module.\n//\n// Names follow ditto: its registry ends every CTA block in `_block` and the V2 envelope copies those\n// names verbatim (`transaction_details_block`, `contact_support_block`). `make_transfer` is a legacy\n// name that stays as an alias until the last legacy payload is gone.\nexport const actionBlocksKey = {\n PLACEHOLDER_ACTION_BLOCK: 'PlaceholderActionBlock',\n MAKE_TRANSFER_ACTION_BLOCK: 'make_transfer',\n TRANSCATION_HISTORY_ACTION_BLOCK: 'transaction_history_block',\n TRANSACTION_DETAILS_ACTION_BLOCK: 'transaction_details_block',\n CONTACT_SUPPORT_ACTION_BLOCK: 'contact_support_block',\n RECURRING_TRANSACTION_ACTION_BLOCK: 'recurring_transaction_block',\n TRANSACTION_LIST_ACTION_BLOCK: 'transaction_list_block',\n REMAINING_CASH_ACTION_BLOCK: 'remaining_cash_block',\n}\n"],"mappings":"AAiBA,IAAa,IAAkB;AAAA,EAC7B,0BAA0B;AAAA,EAC1B,4BAA4B;AAAA,EAC5B,kCAAkC;AAAA,EAClC,kCAAkC;AAAA,EAClC,8BAA8B;AAAA,EAC9B,oCAAoC;AAAA,EACpC,+BAA+B;AAAA,EAC/B,6BAA6B;AAC/B"}
1
+ {"version":3,"file":"actionBlocksKey.es.js","names":[],"sources":["../../../src/insights-v2/mappings/actionBlocksKey.ts"],"sourcesContent":["// Keys for the drawer drilldown registry in `blocks.ts`, extracted into their own module.\n//\n// Why: chart blocks (e.g. BarchartBlock, DoubleBarChartBlock) need\n// `TRANSCATION_HISTORY_ACTION_BLOCK` to tag a chart bar's drilldown context, but they are\n// themselves re-exported through `../blocks` -> `mappings/blocks.ts` imports from that same\n// barrel to build its `blocks` registry. Importing the key straight from `mappings/blocks.ts`\n// closed that loop into a circular import: evaluating `mappings/blocks.ts` pulled in the\n// `blocks` barrel, which (before it got to `ComponentBlocks`/`AccountBlock`) loaded\n// `BarchartBlock`, which imported back into the still-initializing `mappings/blocks.ts` —\n// tripping a \"Cannot access 'AccountBlock' before initialization\" TDZ error in Storybook/Vite.\n//\n// Keeping the keys here (no dependency on `mappings/blocks.ts`) lets chart blocks reference\n// them without re-entering that module.\n//\n// Names follow ditto: its registry ends every CTA block in `_block` and the V2 envelope copies those\n// names verbatim (`transaction_details_block`, `contact_support_block`). `make_transfer` is a legacy\n// name that stays as an alias until the last legacy payload is gone.\nexport const actionBlocksKey = {\n PLACEHOLDER_ACTION_BLOCK: 'PlaceholderActionBlock',\n MAKE_TRANSFER_ACTION_BLOCK: 'make_transfer',\n TRANSCATION_HISTORY_ACTION_BLOCK: 'transaction_history_block',\n TRANSACTION_DETAILS_ACTION_BLOCK: 'transaction_details_block',\n CONTACT_SUPPORT_ACTION_BLOCK: 'contact_support_block',\n RECURRING_TRANSACTION_ACTION_BLOCK: 'recurring_transaction_block',\n TRANSACTION_LIST_ACTION_BLOCK: 'transaction_list_block',\n REMAINING_CASH_ACTION_BLOCK: 'remaining_cash_block',\n AMOUNT_INPUT_MODAL_ACTION_BLOCK: 'amount_input_modal_block',\n}\n"],"mappings":"AAiBA,IAAa,IAAkB;AAAA,EAC7B,0BAA0B;AAAA,EAC1B,4BAA4B;AAAA,EAC5B,kCAAkC;AAAA,EAClC,kCAAkC;AAAA,EAClC,8BAA8B;AAAA,EAC9B,oCAAoC;AAAA,EACpC,+BAA+B;AAAA,EAC/B,6BAA6B;AAAA,EAC7B,iCAAiC;AACnC"}
@@ -2,11 +2,12 @@ import { Beat, GlobalCopy, InsightsPayload } from '../../core';
2
2
  export interface ActionBlockProps {
3
3
  beat: Beat;
4
4
  }
5
- export declare const hasDrawerBlock: (block?: string | null) => boolean;
5
+ export { hasDrawerBlock } from './hasDrawerBlock';
6
6
  export interface ActionBlockEntry {
7
7
  Component: React.ComponentType<ActionBlockProps>;
8
8
  usePrepare: (props: ActionBlockProps) => void;
9
9
  title?: (variant: string | null | undefined, copy: GlobalCopy, beat?: Beat) => string;
10
+ presentation?: 'drawer' | 'modal';
10
11
  }
11
12
  export declare const actionBlocks: Record<string, ActionBlockEntry>;
12
13
  export declare const blocks: Record<string, React.ComponentType<{
@@ -1,99 +1,99 @@
1
- import { ContactSupportActionBlock as l } from "../actionBlocks/ContactSupportActionBlock.es.js";
2
- import { actionBlocksKey as r } from "./actionBlocksKey.es.js";
3
- import { BarchartBlock as n } from "../blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js";
4
- import { DoubleBarChartBlock as m } from "../blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js";
5
- import _ from "../blocks/ChartBlocks/StepChartBlock/StepChartBlock.es.js";
6
- import p from "../blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.es.js";
1
+ import { ContactSupportActionBlock as m } from "../actionBlocks/ContactSupportActionBlock.es.js";
2
+ import { actionBlocksKey as o } from "./actionBlocksKey.es.js";
3
+ import { BarchartBlock as l } from "../blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js";
4
+ import { DoubleBarChartBlock as n } from "../blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js";
5
+ import p from "../blocks/ChartBlocks/StepChartBlock/StepChartBlock.es.js";
6
+ import _ from "../blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.es.js";
7
7
  import s from "../blocks/ChartBlocks/DoubleProgressBarBlock/DoubleProgressBarBlock.es.js";
8
8
  import k from "../blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js";
9
9
  import C from "../blocks/ComponentBlocks/AccountSwitchBlock/AccountSwitchBlock.es.js";
10
10
  import B from "../blocks/ComponentBlocks/DirectDepositBlock/DirectDepositBlock.es.js";
11
11
  import { BudgetBlock as T } from "../blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js";
12
- import f from "../blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.es.js";
13
- import { TransactionBlock as u } from "../blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js";
14
- import A from "../blocks/ComponentBlocks/WithdrawalBlock/WithdrawalBlock.es.js";
12
+ import A from "../blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.es.js";
13
+ import { TransactionBlock as f } from "../blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js";
14
+ import u from "../blocks/ComponentBlocks/WithdrawalBlock/WithdrawalBlock.es.js";
15
15
  import O from "../blocks/ImageBlocks/ImageBlock.es.js";
16
- import { SVGImageBlock as b } from "../blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js";
17
- import { PlaceholderActionBlock as N } from "../actionBlocks/PlaceholderActionBlock.es.js";
18
- import { getMakeTransferDrawerTitle as h } from "../actionBlocks/MakeTransferActionBlock/layout.es.js";
19
- import { MakeTransferActionBlockLayer as I } from "../actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.es.js";
20
- import { getDrawerHeaderTitle as d } from "../actionBlocks/TransactionHistoryBlock/utils.es.js";
21
- import { TransactionDetailsBlock as g } from "../actionBlocks/TransactionDetailsBlock/TransactionDetailsBlock.es.js";
16
+ import { SVGImageBlock as N } from "../blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js";
17
+ import { PlaceholderActionBlock as b } from "../actionBlocks/PlaceholderActionBlock.es.js";
18
+ import { getMakeTransferDrawerTitle as I } from "../actionBlocks/MakeTransferActionBlock/layout.es.js";
19
+ import { MakeTransferActionBlockLayer as h } from "../actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.es.js";
20
+ import { getDrawerHeaderTitle as g } from "../actionBlocks/TransactionHistoryBlock/utils.es.js";
21
+ import { TransactionDetailsBlock as d } from "../actionBlocks/TransactionDetailsBlock/TransactionDetailsBlock.es.js";
22
22
  import { useTransactionDetailsPrepare as a } from "../actionBlocks/TransactionDetailsBlock/useTransactionDetailsPrepare.es.js";
23
23
  import { TransactionHistoryBlock as L } from "../actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js";
24
24
  import { useRecurringTransactionPrepare as i } from "../actionBlocks/RecurringTransactionBlock/useRecurringTransactionPrepare.es.js";
25
- import { RecurringTransactionBlock as S } from "../actionBlocks/RecurringTransactionBlock/RecurringTransactionBlock.es.js";
25
+ import { RecurringTransactionBlock as P } from "../actionBlocks/RecurringTransactionBlock/RecurringTransactionBlock.es.js";
26
26
  import { TransactionListBlock as R } from "../actionBlocks/TransactionListBlock/TransactionListBlock.es.js";
27
- import { RemainingCashBlock as P } from "../actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js";
28
- var e = (t) => {
29
- }, D = /* @__PURE__ */ new Set([
30
- "",
31
- "null",
32
- "undefined"
33
- ]), io = (t) => {
34
- const o = t?.trim().toLowerCase();
35
- return !!o && !D.has(o);
36
- }, co = {
37
- [r.PLACEHOLDER_ACTION_BLOCK]: {
38
- Component: N,
39
- usePrepare: e,
27
+ import { RemainingCashBlock as D } from "../actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js";
28
+ import { hasDrawerBlock as co } from "./hasDrawerBlock.es.js";
29
+ import { AmountInputModalBlock as S } from "../actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js";
30
+ var t = (e) => {
31
+ }, lo = {
32
+ [o.PLACEHOLDER_ACTION_BLOCK]: {
33
+ Component: b,
34
+ usePrepare: t,
40
35
  title: () => "Action Block Layer Drilldown"
41
36
  },
42
- [r.MAKE_TRANSFER_ACTION_BLOCK]: {
43
- Component: I,
44
- usePrepare: e,
45
- title: h
37
+ [o.MAKE_TRANSFER_ACTION_BLOCK]: {
38
+ Component: h,
39
+ usePrepare: t,
40
+ title: I
46
41
  },
47
- [r.TRANSCATION_HISTORY_ACTION_BLOCK]: {
42
+ [o.TRANSCATION_HISTORY_ACTION_BLOCK]: {
48
43
  Component: L,
49
- usePrepare: e,
50
- title: d
44
+ usePrepare: t,
45
+ title: g
51
46
  },
52
- [r.TRANSACTION_DETAILS_ACTION_BLOCK]: {
53
- Component: g,
47
+ [o.TRANSACTION_DETAILS_ACTION_BLOCK]: {
48
+ Component: d,
54
49
  usePrepare: a,
55
50
  title: () => "Transaction Details"
56
51
  },
57
- [r.RECURRING_TRANSACTION_ACTION_BLOCK]: {
58
- Component: S,
52
+ [o.RECURRING_TRANSACTION_ACTION_BLOCK]: {
53
+ Component: P,
59
54
  usePrepare: i,
60
- title: (t, o) => o.recurring?.expense_details ?? ""
55
+ title: (e, r) => r.recurring?.expense_details ?? ""
61
56
  },
62
- [r.REMAINING_CASH_ACTION_BLOCK]: {
63
- Component: P,
57
+ [o.REMAINING_CASH_ACTION_BLOCK]: {
58
+ Component: D,
64
59
  usePrepare: i,
65
- title: (t, o) => o.insights_feed?.remaining_cash?.title ?? ""
60
+ title: (e, r) => r.insights_feed?.remaining_cash?.title ?? ""
66
61
  },
67
- [r.CONTACT_SUPPORT_ACTION_BLOCK]: {
68
- Component: l,
69
- usePrepare: e,
70
- title: (t, o) => o.help?.request_support ?? ""
62
+ [o.CONTACT_SUPPORT_ACTION_BLOCK]: {
63
+ Component: m,
64
+ usePrepare: t,
65
+ title: (e, r) => r.help?.request_support ?? ""
71
66
  },
72
- [r.TRANSACTION_LIST_ACTION_BLOCK]: {
67
+ [o.TRANSACTION_LIST_ACTION_BLOCK]: {
73
68
  Component: R,
74
69
  usePrepare: a,
75
- title: (t, o, c) => c?.insights_payload?.title ?? ""
70
+ title: (e, r, c) => c?.insights_payload?.title ?? ""
71
+ },
72
+ [o.AMOUNT_INPUT_MODAL_ACTION_BLOCK]: {
73
+ Component: S,
74
+ presentation: "modal",
75
+ usePrepare: t
76
76
  }
77
- }, lo = {
77
+ }, no = {
78
78
  account_block: k,
79
79
  account_switch_block: C,
80
80
  direct_deposit_block: B,
81
- bar_chart_block: n,
81
+ bar_chart_block: l,
82
82
  budget_block: T,
83
- donut_chart_block: p,
84
- double_bar_chart_block: m,
83
+ donut_chart_block: _,
84
+ double_bar_chart_block: n,
85
85
  double_progress_bar_block: s,
86
86
  image_block: O,
87
- save_extra_block: f,
88
- step_chart_block: _,
89
- svg_image_block: b,
90
- withdrawal_block: A,
91
- transaction_block: u
87
+ save_extra_block: A,
88
+ step_chart_block: p,
89
+ svg_image_block: N,
90
+ withdrawal_block: u,
91
+ transaction_block: f
92
92
  };
93
93
  export {
94
- co as actionBlocks,
95
- lo as blocks,
96
- io as hasDrawerBlock
94
+ lo as actionBlocks,
95
+ no as blocks,
96
+ co as hasDrawerBlock
97
97
  };
98
98
 
99
99
  //# sourceMappingURL=blocks.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"blocks.es.js","names":[],"sources":["../../../src/insights-v2/mappings/blocks.ts"],"sourcesContent":["import {\n AccountBlock,\n AccountSwitchBlock,\n DirectDepositBlock,\n BarchartBlock,\n BudgetBlock,\n DonutChartBlock,\n DoubleBarChartBlock,\n DoubleProgressBarBlock,\n SaveExtraBlock,\n SVGImageBlock,\n WithdrawalBlock,\n TransactionBlock,\n} from '../blocks'\nimport StepChartBlock from '../blocks/ChartBlocks/StepChartBlock'\nimport ImageBlock from '../blocks/ImageBlocks/ImageBlock'\n\nimport type { Beat, GlobalCopy, InsightsPayload } from '../../core'\nimport { ContactSupportActionBlock } from '../actionBlocks/ContactSupportActionBlock'\nimport { PlaceholderActionBlock } from '../actionBlocks/PlaceholderActionBlock'\nimport { MakeTransferActionBlockLayer } from '../actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer'\nimport { getMakeTransferDrawerTitle } from '../actionBlocks/MakeTransferActionBlock/layout'\nimport { TransactionHistoryBlock } from '../actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock'\nimport { getDrawerHeaderTitle } from '../actionBlocks/TransactionHistoryBlock/utils'\nimport {\n TransactionDetailsBlock,\n useTransactionDetailsPrepare,\n} from '../actionBlocks/TransactionDetailsBlock'\nimport {\n RecurringTransactionBlock,\n useRecurringTransactionPrepare,\n} from '../actionBlocks/RecurringTransactionBlock'\nimport { TransactionListBlock } from '../actionBlocks/TransactionListBlock'\nimport { RemainingCashBlock } from '../actionBlocks/RemainingCashBlock'\n// Keys live in ./actionBlocksKey (imported directly by chart blocks/tests too) to avoid a\n// circular import between this module and the chart blocks — see that file for details.\nimport { actionBlocksKey } from './actionBlocksKey'\n\n// Drilldown indexes are not passed down: action blocks read them from\n// InsightsV2Store (useInsightsV2Store().actionDrawer).\nexport interface ActionBlockProps {\n beat: Beat\n}\n\nconst noop = (_: ActionBlockProps) => {}\n\n// A CTA opens a drawer only when it carries a real `block`. The backend may send\n// an empty/absent block (or the literal strings \"null\"/\"undefined\") for CTAs\n// that trigger something else (e.g. a postMessage) instead of a drilldown.\nconst NON_BLOCK_VALUES = new Set(['', 'null', 'undefined'])\nexport const hasDrawerBlock = (block?: string | null): boolean => {\n const normalized = block?.trim().toLowerCase()\n return !!normalized && !NON_BLOCK_VALUES.has(normalized)\n}\n\nexport interface ActionBlockEntry {\n Component: React.ComponentType<ActionBlockProps>\n usePrepare: (props: ActionBlockProps) => void // required; default to noop in each entry\n // Resolves the drawer title from the clicked CTA's variant + copy, with the beat available\n // for blocks that title from beat fields (e.g. transaction-list reads insights_payload.title).\n // Falls back to the CTA label when the resolver returns an empty string / is absent.\n title?: (variant: string | null | undefined, copy: GlobalCopy, beat?: Beat) => string\n}\n\n// Registry of drawer drilldowns, keyed by the `block` name the backend sends\n// on a beat's CTA. To add one: create a component taking ActionBlockProps,\n// read the clicked indexes from useInsightsV2Store().actionDrawer, and\n// register it here. Add\n// `usePrepare` when the block needs to load data before rendering.\n\nexport const actionBlocks = {\n [actionBlocksKey.PLACEHOLDER_ACTION_BLOCK]: {\n Component: PlaceholderActionBlock,\n usePrepare: noop,\n title: () => 'Action Block Layer Drilldown',\n },\n [actionBlocksKey.MAKE_TRANSFER_ACTION_BLOCK]: {\n Component: MakeTransferActionBlockLayer,\n usePrepare: noop,\n title: getMakeTransferDrawerTitle,\n },\n [actionBlocksKey.TRANSCATION_HISTORY_ACTION_BLOCK]: {\n Component: TransactionHistoryBlock,\n usePrepare: noop,\n title: getDrawerHeaderTitle,\n },\n [actionBlocksKey.TRANSACTION_DETAILS_ACTION_BLOCK]: {\n Component: TransactionDetailsBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: () => 'Transaction Details',\n },\n // Expense Details for one recurring subscription. Which subscription a beat names is resolved in\n // `RecurringTransactionBlock/subscriptionBeats.ts`, not through this registry.\n [actionBlocksKey.RECURRING_TRANSACTION_ACTION_BLOCK]: {\n Component: RecurringTransactionBlock,\n usePrepare: useRecurringTransactionPrepare,\n title: (_variant, copy) => copy.recurring?.expense_details ?? '',\n },\n // Remaining Cash for the Payday Cash Left Over Status beat. Store-driven: reuses the recurring\n // loader, which also loads accounts and categories, so CashflowStore's computeds are ready.\n [actionBlocksKey.REMAINING_CASH_ACTION_BLOCK]: {\n Component: RemainingCashBlock,\n usePrepare: useRecurringTransactionPrepare,\n title: (_variant, copy) => copy.insights_feed?.remaining_cash?.title ?? '',\n },\n // The block renders its own drawer (the help module's RequestSupport) on top of the action\n // drawer, so the action drawer's title is the CTA label.\n [actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK]: {\n Component: ContactSupportActionBlock,\n usePrepare: noop,\n title: (_variant, copy) => copy.help?.request_support ?? '',\n },\n [actionBlocksKey.TRANSACTION_LIST_ACTION_BLOCK]: {\n Component: TransactionListBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: (_variant, _copy, beat) => beat?.insights_payload?.title ?? '',\n },\n} as Record<string, ActionBlockEntry>\n\nexport const blocks = {\n account_block: AccountBlock,\n account_switch_block: AccountSwitchBlock,\n direct_deposit_block: DirectDepositBlock,\n bar_chart_block: BarchartBlock,\n budget_block: BudgetBlock,\n donut_chart_block: DonutChartBlock,\n double_bar_chart_block: DoubleBarChartBlock,\n double_progress_bar_block: DoubleProgressBarBlock,\n image_block: ImageBlock,\n save_extra_block: SaveExtraBlock,\n step_chart_block: StepChartBlock,\n svg_image_block: SVGImageBlock,\n withdrawal_block: WithdrawalBlock,\n transaction_block: TransactionBlock,\n} as Record<string, React.ComponentType<{ payload: InsightsPayload; beatGuid?: string }>>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,IAAM,IAAA,CAAQ,MAAwB;AAAC,GAKjC,IAAmB,oBAAI,IAAI;AAAA,EAAC;AAAA,EAAI;AAAA,EAAQ;AAAW,CAAC,GAC7C,KAAA,CAAkB,MAAmC;AAChE,QAAM,IAAa,GAAO,KAAK,EAAE,YAAY;AAC7C,SAAO,CAAC,CAAC,KAAc,CAAC,EAAiB,IAAI,CAAU;AACzD,GAiBa,KAAe;AAAA,EACzB,CAAA,EAAgB,wBAAA,GAA2B;AAAA,IAC1C,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAA,MAAa;AAAA,EACf;AAAA,EACC,CAAA,EAAgB,0BAAA,GAA6B;AAAA,IAC5C,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAO;AAAA,EACT;AAAA,EACC,CAAA,EAAgB,gCAAA,GAAmC;AAAA,IAClD,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAO;AAAA,EACT;AAAA,EACC,CAAA,EAAgB,gCAAA,GAAmC;AAAA,IAClD,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAA,MAAa;AAAA,EACf;AAAA,EAGC,CAAA,EAAgB,kCAAA,GAAqC;AAAA,IACpD,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAA,CAAQ,GAAU,MAAS,EAAK,WAAW,mBAAmB;AAAA,EAChE;AAAA,EAGC,CAAA,EAAgB,2BAAA,GAA8B;AAAA,IAC7C,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAA,CAAQ,GAAU,MAAS,EAAK,eAAe,gBAAgB,SAAS;AAAA,EAC1E;AAAA,EAGC,CAAA,EAAgB,4BAAA,GAA+B;AAAA,IAC9C,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAA,CAAQ,GAAU,MAAS,EAAK,MAAM,mBAAmB;AAAA,EAC3D;AAAA,EACC,CAAA,EAAgB,6BAAA,GAAgC;AAAA,IAC/C,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAA,CAAQ,GAAU,GAAO,MAAS,GAAM,kBAAkB,SAAS;AAAA,EACrE;AACF,GAEa,KAAS;AAAA,EACpB,eAAe;AAAA,EACf,sBAAsB;AAAA,EACtB,sBAAsB;AAAA,EACtB,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,mBAAmB;AAAA,EACnB,wBAAwB;AAAA,EACxB,2BAA2B;AAAA,EAC3B,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,mBAAmB;AACrB"}
1
+ {"version":3,"file":"blocks.es.js","names":[],"sources":["../../../src/insights-v2/mappings/blocks.ts"],"sourcesContent":["import {\n AccountBlock,\n AccountSwitchBlock,\n DirectDepositBlock,\n BarchartBlock,\n BudgetBlock,\n DonutChartBlock,\n DoubleBarChartBlock,\n DoubleProgressBarBlock,\n SaveExtraBlock,\n SVGImageBlock,\n WithdrawalBlock,\n TransactionBlock,\n} from '../blocks'\nimport StepChartBlock from '../blocks/ChartBlocks/StepChartBlock'\nimport ImageBlock from '../blocks/ImageBlocks/ImageBlock'\n\nimport type { Beat, GlobalCopy, InsightsPayload } from '../../core'\nimport { ContactSupportActionBlock } from '../actionBlocks/ContactSupportActionBlock'\nimport { PlaceholderActionBlock } from '../actionBlocks/PlaceholderActionBlock'\nimport { MakeTransferActionBlockLayer } from '../actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer'\nimport { getMakeTransferDrawerTitle } from '../actionBlocks/MakeTransferActionBlock/layout'\nimport { TransactionHistoryBlock } from '../actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock'\nimport { getDrawerHeaderTitle } from '../actionBlocks/TransactionHistoryBlock/utils'\nimport {\n TransactionDetailsBlock,\n useTransactionDetailsPrepare,\n} from '../actionBlocks/TransactionDetailsBlock'\nimport {\n RecurringTransactionBlock,\n useRecurringTransactionPrepare,\n} from '../actionBlocks/RecurringTransactionBlock'\nimport { TransactionListBlock } from '../actionBlocks/TransactionListBlock'\nimport { RemainingCashBlock } from '../actionBlocks/RemainingCashBlock'\nimport { AmountInputModalBlock } from '../actionBlocks/AmountInputModalBlock'\n// Keys live in ./actionBlocksKey (imported directly by chart blocks/tests too) to avoid a\n// circular import between this module and the chart blocks — see that file for details.\nimport { actionBlocksKey } from './actionBlocksKey'\n\n// Drilldown indexes are not passed down: action blocks read them from\n// InsightsV2Store (useInsightsV2Store().actionDrawer).\nexport interface ActionBlockProps {\n beat: Beat\n}\n\nconst noop = (_: ActionBlockProps) => {}\n\n// Re-exported so existing `hasDrawerBlock` imports from this module keep working.\nexport { hasDrawerBlock } from './hasDrawerBlock'\n\nexport interface ActionBlockEntry {\n Component: React.ComponentType<ActionBlockProps>\n usePrepare: (props: ActionBlockProps) => void // required; default to noop in each entry\n // Resolves the drawer title from the clicked CTA's variant + copy, with the beat available\n // for blocks that title from beat fields (e.g. transaction-list reads insights_payload.title).\n // Falls back to the CTA label when the resolver returns an empty string / is absent.\n title?: (variant: string | null | undefined, copy: GlobalCopy, beat?: Beat) => string\n // 'modal' blocks render their own dialog, so the layer skips the Drawer (and its title) and mounts\n // the block only while it is open for this beat. Defaults to 'drawer'.\n presentation?: 'drawer' | 'modal'\n}\n\n// Registry of drawer drilldowns, keyed by the `block` name the backend sends\n// on a beat's CTA. To add one: create a component taking ActionBlockProps,\n// read the clicked indexes from useInsightsV2Store().actionDrawer, and\n// register it here. Add\n// `usePrepare` when the block needs to load data before rendering.\n\nexport const actionBlocks = {\n [actionBlocksKey.PLACEHOLDER_ACTION_BLOCK]: {\n Component: PlaceholderActionBlock,\n usePrepare: noop,\n title: () => 'Action Block Layer Drilldown',\n },\n [actionBlocksKey.MAKE_TRANSFER_ACTION_BLOCK]: {\n Component: MakeTransferActionBlockLayer,\n usePrepare: noop,\n title: getMakeTransferDrawerTitle,\n },\n [actionBlocksKey.TRANSCATION_HISTORY_ACTION_BLOCK]: {\n Component: TransactionHistoryBlock,\n usePrepare: noop,\n title: getDrawerHeaderTitle,\n },\n [actionBlocksKey.TRANSACTION_DETAILS_ACTION_BLOCK]: {\n Component: TransactionDetailsBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: () => 'Transaction Details',\n },\n // Expense Details for one recurring subscription. Which subscription a beat names is resolved in\n // `RecurringTransactionBlock/subscriptionBeats.ts`, not through this registry.\n [actionBlocksKey.RECURRING_TRANSACTION_ACTION_BLOCK]: {\n Component: RecurringTransactionBlock,\n usePrepare: useRecurringTransactionPrepare,\n title: (_variant, copy) => copy.recurring?.expense_details ?? '',\n },\n // Remaining Cash for the Payday Cash Left Over Status beat. Store-driven: reuses the recurring\n // loader, which also loads accounts and categories, so CashflowStore's computeds are ready.\n [actionBlocksKey.REMAINING_CASH_ACTION_BLOCK]: {\n Component: RemainingCashBlock,\n usePrepare: useRecurringTransactionPrepare,\n title: (_variant, copy) => copy.insights_feed?.remaining_cash?.title ?? '',\n },\n // The block renders its own drawer (the help module's RequestSupport) on top of the action\n // drawer, so the action drawer's title is the CTA label.\n [actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK]: {\n Component: ContactSupportActionBlock,\n usePrepare: noop,\n title: (_variant, copy) => copy.help?.request_support ?? '',\n },\n [actionBlocksKey.TRANSACTION_LIST_ACTION_BLOCK]: {\n Component: TransactionListBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: (_variant, _copy, beat) => beat?.insights_payload?.title ?? '',\n },\n // One whole-dollar setting in a dialog; the CTA variant picks which (low-balance threshold or\n // safety net). A modal: no drawer, so no drawer title.\n [actionBlocksKey.AMOUNT_INPUT_MODAL_ACTION_BLOCK]: {\n Component: AmountInputModalBlock,\n presentation: 'modal',\n // Loads inside the block: it mounts only while open, so mounting is the open-time load.\n usePrepare: noop,\n },\n} as Record<string, ActionBlockEntry>\n\nexport const blocks = {\n account_block: AccountBlock,\n account_switch_block: AccountSwitchBlock,\n direct_deposit_block: DirectDepositBlock,\n bar_chart_block: BarchartBlock,\n budget_block: BudgetBlock,\n donut_chart_block: DonutChartBlock,\n double_bar_chart_block: DoubleBarChartBlock,\n double_progress_bar_block: DoubleProgressBarBlock,\n image_block: ImageBlock,\n save_extra_block: SaveExtraBlock,\n step_chart_block: StepChartBlock,\n svg_image_block: SVGImageBlock,\n withdrawal_block: WithdrawalBlock,\n transaction_block: TransactionBlock,\n} as Record<string, React.ComponentType<{ payload: InsightsPayload; beatGuid?: string }>>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,IAAM,IAAA,CAAQ,MAAwB;AAAC,GAuB1B,KAAe;AAAA,EACzB,CAAA,EAAgB,wBAAA,GAA2B;AAAA,IAC1C,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAA,MAAa;AAAA,EACf;AAAA,EACC,CAAA,EAAgB,0BAAA,GAA6B;AAAA,IAC5C,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAO;AAAA,EACT;AAAA,EACC,CAAA,EAAgB,gCAAA,GAAmC;AAAA,IAClD,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAO;AAAA,EACT;AAAA,EACC,CAAA,EAAgB,gCAAA,GAAmC;AAAA,IAClD,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAA,MAAa;AAAA,EACf;AAAA,EAGC,CAAA,EAAgB,kCAAA,GAAqC;AAAA,IACpD,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAA,CAAQ,GAAU,MAAS,EAAK,WAAW,mBAAmB;AAAA,EAChE;AAAA,EAGC,CAAA,EAAgB,2BAAA,GAA8B;AAAA,IAC7C,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAA,CAAQ,GAAU,MAAS,EAAK,eAAe,gBAAgB,SAAS;AAAA,EAC1E;AAAA,EAGC,CAAA,EAAgB,4BAAA,GAA+B;AAAA,IAC9C,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAA,CAAQ,GAAU,MAAS,EAAK,MAAM,mBAAmB;AAAA,EAC3D;AAAA,EACC,CAAA,EAAgB,6BAAA,GAAgC;AAAA,IAC/C,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAA,CAAQ,GAAU,GAAO,MAAS,GAAM,kBAAkB,SAAS;AAAA,EACrE;AAAA,EAGC,CAAA,EAAgB,+BAAA,GAAkC;AAAA,IACjD,WAAW;AAAA,IACX,cAAc;AAAA,IAEd,YAAY;AAAA,EACd;AACF,GAEa,KAAS;AAAA,EACpB,eAAe;AAAA,EACf,sBAAsB;AAAA,EACtB,sBAAsB;AAAA,EACtB,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,mBAAmB;AAAA,EACnB,wBAAwB;AAAA,EACxB,2BAA2B;AAAA,EAC3B,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,mBAAmB;AACrB"}
@@ -0,0 +1 @@
1
+ export declare const hasDrawerBlock: (block?: string | null) => boolean;
@@ -0,0 +1,13 @@
1
+ var a = /* @__PURE__ */ new Set([
2
+ "",
3
+ "null",
4
+ "undefined"
5
+ ]), n = (r) => {
6
+ const e = r?.trim().toLowerCase();
7
+ return !!e && !a.has(e);
8
+ };
9
+ export {
10
+ n as hasDrawerBlock
11
+ };
12
+
13
+ //# sourceMappingURL=hasDrawerBlock.es.js.map