@mx-cartographer/experiences 9.7.170 → 9.7.172
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 +8 -0
- package/dist/common/components/CurrencyDialog.es.js +40 -37
- package/dist/common/components/CurrencyDialog.es.js.map +1 -1
- package/dist/common/components/SubheaderRow.es.js +11 -8
- package/dist/common/components/SubheaderRow.es.js.map +1 -1
- package/dist/core/types/InsightsInstanceSlotData.d.ts +2 -0
- package/dist/core/types/InsightsInstanceSlotData.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js +35 -34
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/layout.d.ts +1 -1
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListCreditLimitHeader.d.ts +2 -4
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListCreditLimitHeader.es.js +43 -69
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListCreditLimitHeader.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSubscriptionHeader.es.js +16 -18
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSubscriptionHeader.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChart.d.ts +3 -1
- package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChart.es.js +15 -13
- package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChart.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js +43 -40
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.d.ts +6 -0
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.es.js +28 -7
- package/dist/insights-v2/blocks/ComponentBlocks/MerchantBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/components/CompactInsightCard.es.js +23 -17
- package/dist/insights-v2/components/CompactInsightCard.es.js.map +1 -1
- package/dist/insights-v2/components/P2PLogoStack.d.ts +7 -1
- package/dist/insights-v2/components/P2PLogoStack.es.js +22 -22
- package/dist/insights-v2/components/P2PLogoStack.es.js.map +1 -1
- package/dist/microinsights/MicroCardTemplate.es.js +1 -1
- package/dist/microinsights/MicroCardTemplate.es.js.map +1 -1
- package/dist/notifications/components/NotificationCard.es.js +18 -17
- package/dist/notifications/components/NotificationCard.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AmountInputModalBlock/layout.ts"],"sourcesContent":["import type { NotificationProfile, UserInsightProfile } from '../../../core'\nimport { AccountNotificationTypes } from '../../../core/types/Notification'\nimport {\n ANALYTICS_EVENTS_CONFIG,\n type AnalyticsEventConfigEntry,\n} from '../../analytics/analyticsEventsConfig'\nimport type { CtaHandlerName } from '../../ctaActions/ctaHandlers'\nimport { actionBlocksKey } from '../../mappings/actionBlocksKey'\nimport { asNumber } from '../../blocks/slotReaders'\nimport type { CurrencyDialogUnit } from '../../../common/components'\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 CREDIT_LIMIT_PERCENTAGE: 'credit_limit_percentage',\n} as const\n\n/** Opens the Create Budget dialog instead of an amount setting (Category Spending). */\nexport const CREATE_BUDGET_VARIANT = 'create_budget'\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/**\n * The variant the modal edits, from the CTA that opened it. ditto drives the shared\n * `amount_input_modal_block` by an explicit CTA variant, but gives Savings Opportunity's safety-net\n * reminder a dedicated `safety_net_block` with no variant, so there the block name selects it. An\n * explicit variant always wins (so an unknown one still falls to the block's \"unknown variant\" path).\n */\nexport const resolveAmountInputVariant = (cta?: {\n block?: string | null\n variant?: string | null\n}): string | undefined => {\n if (cta?.variant) return cta.variant\n if (cta?.block === actionBlocksKey.SAFETY_NET_ACTION_BLOCK)\n return AMOUNT_INPUT_VARIANTS.SAFETY_NET\n return undefined\n}\n\n/** Pulse v1's upper bound for a safety net; applied to both dollar settings. */\nconst MAX_AMOUNT = 1_000_000_000\n\nconst MAX_ALERT_PERCENT = 100\n\n/** A whole number from 1 to `max`, as pulse v1 validated its amount and threshold fields. */\nconst wholeNumberUpTo =\n (max: number) =>\n (value: string): boolean =>\n /^\\d+$/.test(value) && Number(value) >= 1 && Number(value) <= max\n\n/** Whole dollars from 1 to `MAX_AMOUNT`, as pulse v1 accepted for its dollar settings. */\nexport const isWholeAmount = wholeNumberUpTo(MAX_AMOUNT)\n\n/** tupac's default `credit_card_close_to_limit_percentage`, used when none (or an invalid one) is saved. */\nconst DEFAULT_CREDIT_LIMIT_ALERT_PERCENT = 75\n\n/** The user's credit-limit alert as a whole 1-100 percent, else the default; the dialog and the Spending header both read it. */\nexport const resolveCreditLimitAlertPercent = (\n profile?: Pick<UserInsightProfile, 'credit_card_close_to_limit_percentage'> | null,\n): number => {\n const saved = asNumber(profile?.credit_card_close_to_limit_percentage)\n // Rounded like the dialog's whole-number field, so a saved 60.6 shows 61 in both.\n const percent = saved === undefined ? undefined : Math.round(saved)\n return percent !== undefined && percent >= 1 && percent <= MAX_ALERT_PERCENT\n ? percent\n : DEFAULT_CREDIT_LIMIT_ALERT_PERCENT\n}\n\n/** A user insight profile field a variant prefills from and saves to. */\ntype InsightProfileField = keyof Pick<\n UserInsightProfile,\n 'savings_opportunity_minimum_checking_account_balance' | 'credit_card_close_to_limit_percentage'\n>\n\n/** Where a setting's value can live; the dialog loads both and each variant reads its own. */\ninterface AmountSources {\n insightProfile?: UserInsightProfile | null\n lowBalanceProfile?: NotificationProfile\n}\n\n/** A saved value read and written on a user insight profile field. */\nconst insightProfileField = (field: InsightProfileField) => ({\n read: ({ insightProfile }: AmountSources) => insightProfile?.[field],\n save: (amount: number): [CtaHandlerName, Record<string, unknown>] => [\n 'updateUserInsightProfile',\n { fields: { [field]: amount } },\n ],\n hasSource: ({ insightProfile }: AmountSources) => !!insightProfile,\n needsNotificationProfiles: false,\n})\n\n/** The account's low-balance alert threshold, on its notification profile. */\nconst lowBalanceThreshold = {\n read: ({ lowBalanceProfile }: AmountSources) => lowBalanceProfile?.threshold,\n save: (\n amount: number,\n { lowBalanceProfile }: AmountSources,\n ): [CtaHandlerName, Record<string, unknown>] => [\n 'updateNotificationProfileThreshold',\n { profileGuid: lowBalanceProfile?.guid, threshold: amount },\n ],\n hasSource: ({ lowBalanceProfile }: AmountSources) => !!lowBalanceProfile,\n needsNotificationProfiles: true,\n}\n\n/** What one variant edits, how it validates and words its field, and the pulse analytics it fires. */\ninterface AmountSetting {\n /** The saved value, from the setting's own source. */\n read: (sources: AmountSources) => number | null | undefined\n /** The CTA handler and params that save `amount`. */\n save: (amount: number, sources: AmountSources) => [CtaHandlerName, Record<string, unknown>]\n /** Whether the source the setting edits is loaded; without it the dialog shows the plain error. */\n hasSource: (sources: AmountSources) => boolean\n /** The source is the account's notification profile, which the dialog reloads on open. */\n needsNotificationProfiles: boolean\n isValid: (value: string) => boolean\n /** The `insights_feed.amount_input_modal` key of the validation message. */\n errorKey: 'whole_number_error' | 'percentage_error'\n unit: CurrencyDialogUnit\n hasCancel: boolean\n /** Switches to `title_edit` / `description_edit` once a value is saved. */\n hasEditCopy: boolean\n /** The account line under the title. */\n showsAccount: boolean\n analytics: {\n save: AnalyticsEventConfigEntry\n cancel: AnalyticsEventConfigEntry\n /** Pulse fires input-selected for the threshold dialogs only (EditThreshold.js). */\n inputSelected?: AnalyticsEventConfigEntry\n }\n}\n\nconst THRESHOLD_ANALYTICS = {\n save: ANALYTICS_EVENTS_CONFIG.EDIT_INSIGHT_THRESHOLD_SAVE,\n cancel: ANALYTICS_EVENTS_CONFIG.EDIT_INSIGHT_THRESHOLD_CANCELED,\n inputSelected: ANALYTICS_EVENTS_CONFIG.EDIT_INSIGHT_THRESHOLD_INPUT_SELECTED,\n}\n\n/** Per-variant behaviour of the amount setting dialog; a new variant adds an entry here. */\nexport const AMOUNT_SETTINGS: Record<AmountInputVariant, AmountSetting> = {\n [AMOUNT_INPUT_VARIANTS.LOW_BALANCE_THRESHOLD]: {\n ...lowBalanceThreshold,\n isValid: isWholeAmount,\n errorKey: 'whole_number_error',\n unit: 'currency',\n hasCancel: true,\n hasEditCopy: false,\n showsAccount: true,\n analytics: THRESHOLD_ANALYTICS,\n },\n [AMOUNT_INPUT_VARIANTS.SAFETY_NET]: {\n ...insightProfileField('savings_opportunity_minimum_checking_account_balance'),\n isValid: isWholeAmount,\n errorKey: 'whole_number_error',\n unit: 'currency',\n hasCancel: false,\n hasEditCopy: true,\n showsAccount: false,\n analytics: {\n save: ANALYTICS_EVENTS_CONFIG.EDIT_SAFETY_NET_SAVE,\n cancel: ANALYTICS_EVENTS_CONFIG.EDIT_SAFETY_NET_CANCEL,\n },\n },\n [AMOUNT_INPUT_VARIANTS.CREDIT_LIMIT_PERCENTAGE]: {\n ...insightProfileField('credit_card_close_to_limit_percentage'),\n // Same rule as the Spending header's marker, so the field and the marker always agree.\n read: ({ insightProfile }) => resolveCreditLimitAlertPercent(insightProfile),\n isValid: wholeNumberUpTo(MAX_ALERT_PERCENT),\n errorKey: 'percentage_error',\n unit: 'percent',\n hasCancel: true,\n hasEditCopy: false,\n showsAccount: false,\n analytics: THRESHOLD_ANALYTICS,\n },\n}\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":";;;;AAYA,IAAa,IAAwB;AAAA,EACnC,uBAAuB;AAAA,EACvB,YAAY;AAAA,EACZ,yBAAyB;AAC3B,GAGa,IAAwB,iBAIxB,IAAA,CAAwB,MACnC,OAAO,OAAe,CAAqB,EAAE,SAAS,KAAW,EAAE,GAQxD,IAAA,CAA6B,MAGhB;AACxB,MAAI,GAAK,QAAS,QAAO,EAAI;AAC7B,MAAI,GAAK,UAAU,EAAgB,wBACjC,QAAO,EAAsB;AAEjC,GAGM,IAAa,KAEb,IAAoB,KAGpB,IAAA,CACH,MAAA,CACA,MACC,QAAQ,KAAK,CAAK,KAAK,OAAO,CAAK,KAAK,KAAK,OAAO,CAAK,KAAK,GAGrD,IAAgB,EAAgB,CAAU,GAGjD,IAAqC,IAG9B,IAAA,CACX,MACW;AACX,QAAM,IAAQ,EAAS,GAAS,qCAAqC,GAE/D,IAAU,MAAU,SAAY,SAAY,KAAK,MAAM,CAAK;AAClE,SAAO,MAAY,UAAa,KAAW,KAAK,KAAW,IACvD,IACA;AACN,GAeM,IAAA,CAAuB,OAAgC;AAAA,EAC3D,MAAA,CAAO,EAAE,gBAAA,EAAA,MAAoC,IAAiB,CAAA;AAAA,EAC9D,MAAA,CAAO,MAA8D,CACnE,4BACA,EAAE,QAAQ,EAAA,CAAG,CAAA,GAAQ,EAAO,EAAE,CAChC;AAAA,EACA,WAAA,CAAY,EAAE,gBAAA,EAAA,MAAoC,CAAC,CAAC;AAAA,EACpD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,IAG3B,IAAA,CACX,GACA,MAEA,IACI,EAAS,KAAA,CACN,MACC,EAAQ,gBAAgB,KACxB,EAAQ,sBAAsB,EAAyB,iBAC3D,IACA"}
|
|
1
|
+
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AmountInputModalBlock/layout.ts"],"sourcesContent":["import type { NotificationProfile, UserInsightProfile } from '../../../core'\nimport { AccountNotificationTypes } from '../../../core/types/Notification'\nimport {\n ANALYTICS_EVENTS_CONFIG,\n type AnalyticsEventConfigEntry,\n} from '../../analytics/analyticsEventsConfig'\nimport type { CtaHandlerName } from '../../ctaActions/ctaHandlers'\nimport { actionBlocksKey } from '../../mappings/actionBlocksKey'\nimport { asNumber } from '../../blocks/slotReaders'\nimport type { CurrencyDialogUnit } from '../../../common/components'\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 CREDIT_LIMIT_PERCENTAGE: 'credit_limit_percentage',\n} as const\n\n/** Opens the Create Budget dialog instead of an amount setting (Category Spending). */\nexport const CREATE_BUDGET_VARIANT = 'create_budget'\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/**\n * The variant the modal edits, from the CTA that opened it. ditto drives the shared\n * `amount_input_modal_block` by an explicit CTA variant, but gives Savings Opportunity's safety-net\n * reminder a dedicated `safety_net_block` with no variant, so there the block name selects it. An\n * explicit variant always wins (so an unknown one still falls to the block's \"unknown variant\" path).\n */\nexport const resolveAmountInputVariant = (cta?: {\n block?: string | null\n variant?: string | null\n}): string | undefined => {\n if (cta?.variant) return cta.variant\n if (cta?.block === actionBlocksKey.SAFETY_NET_ACTION_BLOCK)\n return AMOUNT_INPUT_VARIANTS.SAFETY_NET\n return undefined\n}\n\n/** Pulse v1's upper bound for a safety net; applied to both dollar settings. */\nconst MAX_AMOUNT = 1_000_000_000\n\nconst MAX_ALERT_PERCENT = 100\n\n/** A whole number from 1 to `max`, as pulse v1 validated its amount and threshold fields. */\nconst wholeNumberUpTo =\n (max: number) =>\n (value: string): boolean =>\n /^\\d+$/.test(value) && Number(value) >= 1 && Number(value) <= max\n\n/** Whole dollars from 1 to `MAX_AMOUNT`, as pulse v1 accepted for its dollar settings. */\nexport const isWholeAmount = wholeNumberUpTo(MAX_AMOUNT)\n\n/** tupac's default `credit_card_close_to_limit_percentage`, used when none (or an invalid one) is saved. */\nconst DEFAULT_CREDIT_LIMIT_ALERT_PERCENT = 75\n\n/** The user's credit-limit alert as a whole 1-100 percent, else the default; the Edit Alert Limit dialog prefills it. */\nexport const resolveCreditLimitAlertPercent = (\n profile?: Pick<UserInsightProfile, 'credit_card_close_to_limit_percentage'> | null,\n): number => {\n const saved = asNumber(profile?.credit_card_close_to_limit_percentage)\n // Rounded like the dialog's whole-number field, so a saved 60.6 prefills 61.\n const percent = saved === undefined ? undefined : Math.round(saved)\n return percent !== undefined && percent >= 1 && percent <= MAX_ALERT_PERCENT\n ? percent\n : DEFAULT_CREDIT_LIMIT_ALERT_PERCENT\n}\n\n/** A user insight profile field a variant prefills from and saves to. */\ntype InsightProfileField = keyof Pick<\n UserInsightProfile,\n 'savings_opportunity_minimum_checking_account_balance' | 'credit_card_close_to_limit_percentage'\n>\n\n/** Where a setting's value can live; the dialog loads both and each variant reads its own. */\ninterface AmountSources {\n insightProfile?: UserInsightProfile | null\n lowBalanceProfile?: NotificationProfile\n}\n\n/** A saved value read and written on a user insight profile field. */\nconst insightProfileField = (field: InsightProfileField) => ({\n read: ({ insightProfile }: AmountSources) => insightProfile?.[field],\n save: (amount: number): [CtaHandlerName, Record<string, unknown>] => [\n 'updateUserInsightProfile',\n { fields: { [field]: amount } },\n ],\n hasSource: ({ insightProfile }: AmountSources) => !!insightProfile,\n needsNotificationProfiles: false,\n})\n\n/** The account's low-balance alert threshold, on its notification profile. */\nconst lowBalanceThreshold = {\n read: ({ lowBalanceProfile }: AmountSources) => lowBalanceProfile?.threshold,\n save: (\n amount: number,\n { lowBalanceProfile }: AmountSources,\n ): [CtaHandlerName, Record<string, unknown>] => [\n 'updateNotificationProfileThreshold',\n { profileGuid: lowBalanceProfile?.guid, threshold: amount },\n ],\n hasSource: ({ lowBalanceProfile }: AmountSources) => !!lowBalanceProfile,\n needsNotificationProfiles: true,\n}\n\n/** What one variant edits, how it validates and words its field, and the pulse analytics it fires. */\ninterface AmountSetting {\n /** The saved value, from the setting's own source. */\n read: (sources: AmountSources) => number | null | undefined\n /** The CTA handler and params that save `amount`. */\n save: (amount: number, sources: AmountSources) => [CtaHandlerName, Record<string, unknown>]\n /** Whether the source the setting edits is loaded; without it the dialog shows the plain error. */\n hasSource: (sources: AmountSources) => boolean\n /** The source is the account's notification profile, which the dialog reloads on open. */\n needsNotificationProfiles: boolean\n isValid: (value: string) => boolean\n /** The `insights_feed.amount_input_modal` key of the validation message. */\n errorKey: 'whole_number_error' | 'percentage_error'\n unit: CurrencyDialogUnit\n hasCancel: boolean\n /** Switches to `title_edit` / `description_edit` once a value is saved. */\n hasEditCopy: boolean\n /** The account line under the title. */\n showsAccount: boolean\n analytics: {\n save: AnalyticsEventConfigEntry\n cancel: AnalyticsEventConfigEntry\n /** Pulse fires input-selected for the threshold dialogs only (EditThreshold.js). */\n inputSelected?: AnalyticsEventConfigEntry\n }\n}\n\nconst THRESHOLD_ANALYTICS = {\n save: ANALYTICS_EVENTS_CONFIG.EDIT_INSIGHT_THRESHOLD_SAVE,\n cancel: ANALYTICS_EVENTS_CONFIG.EDIT_INSIGHT_THRESHOLD_CANCELED,\n inputSelected: ANALYTICS_EVENTS_CONFIG.EDIT_INSIGHT_THRESHOLD_INPUT_SELECTED,\n}\n\n/** Per-variant behaviour of the amount setting dialog; a new variant adds an entry here. */\nexport const AMOUNT_SETTINGS: Record<AmountInputVariant, AmountSetting> = {\n [AMOUNT_INPUT_VARIANTS.LOW_BALANCE_THRESHOLD]: {\n ...lowBalanceThreshold,\n isValid: isWholeAmount,\n errorKey: 'whole_number_error',\n unit: 'currency',\n hasCancel: true,\n hasEditCopy: false,\n showsAccount: true,\n analytics: THRESHOLD_ANALYTICS,\n },\n [AMOUNT_INPUT_VARIANTS.SAFETY_NET]: {\n ...insightProfileField('savings_opportunity_minimum_checking_account_balance'),\n isValid: isWholeAmount,\n errorKey: 'whole_number_error',\n unit: 'currency',\n hasCancel: false,\n hasEditCopy: true,\n showsAccount: false,\n analytics: {\n save: ANALYTICS_EVENTS_CONFIG.EDIT_SAFETY_NET_SAVE,\n cancel: ANALYTICS_EVENTS_CONFIG.EDIT_SAFETY_NET_CANCEL,\n },\n },\n [AMOUNT_INPUT_VARIANTS.CREDIT_LIMIT_PERCENTAGE]: {\n ...insightProfileField('credit_card_close_to_limit_percentage'),\n // A saved 0, over-100 or missing value prefills tupac's 75 default.\n read: ({ insightProfile }) => resolveCreditLimitAlertPercent(insightProfile),\n isValid: wholeNumberUpTo(MAX_ALERT_PERCENT),\n errorKey: 'percentage_error',\n unit: 'percent',\n hasCancel: true,\n hasEditCopy: false,\n showsAccount: false,\n analytics: THRESHOLD_ANALYTICS,\n },\n}\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":";;;;AAYA,IAAa,IAAwB;AAAA,EACnC,uBAAuB;AAAA,EACvB,YA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Ae,EAAwB;AACzC,GAGa,IAA6D;AAAA,EACvE,CAAA,EAAsB,qBAAA,GAAwB;AAAA,IAC7C,GAAG;AAAA,IACH,SAAS;AAAA,IACT,UAAU;AAAA,IACV,MAAM;AAAA,IACN,WAAW;AAAA,IACX,aAAa;AAAA,IACb,cAAc;AAAA,IACd,WAAW;AAAA,EACb;AAAA,EACC,CAAA,EAAsB,UAAA,GAAa;AAAA,IAClC,GAAG,EAAoB,sDAAsD;AAAA,IAC7E,SAAS;AAAA,IACT,UAAU;AAAA,IACV,MAAM;AAAA,IACN,WAAW;AAAA,IACX,aAAa;AAAA,IACb,cAAc;AAAA,IACd,WAAW;AAAA,MACT,MAAM,EAAwB;AAAA,MAC9B,QAAQ,EAAwB;AAAA,IAClC;AAAA,EACF;AAAA,EACC,CAAA,EAAsB,uBAAA,GAA0B;AAAA,IAC/C,GAAG,EAAoB,uCAAuC;AAAA,IAE9D,MAAA,CAAO,EAAE,gBAAA,EAAA,MAAqB,EAA+B,CAAc;AAAA,IAC3E,SAAS,EAAgB,CAAiB;AAAA,IAC1C,UAAU;AAAA,IACV,MAAM;AAAA,IACN,WAAW;AAAA,IACX,aAAa;AAAA,IACb,cAAc;AAAA,IACd,WAAW;AAAA,EACb;AACF,GAGa,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"}
|
package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListCreditLimitHeader.d.ts
CHANGED
|
@@ -4,8 +4,6 @@ export interface TransactionListCreditLimitHeaderProps {
|
|
|
4
4
|
header: CreditLimitHeader;
|
|
5
5
|
copy?: TransactionListBlockCopy;
|
|
6
6
|
}
|
|
7
|
-
/** The Spending list's credit-limit header: card, balance, limit and
|
|
8
|
-
export declare const TransactionListCreditLimitHeader: (
|
|
9
|
-
displayName: string;
|
|
10
|
-
};
|
|
7
|
+
/** The Spending list's credit-limit header: card, balance, limit and how much of the limit is used. */
|
|
8
|
+
export declare const TransactionListCreditLimitHeader: ({ copy, header, }: TransactionListCreditLimitHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
9
|
export default TransactionListCreditLimitHeader;
|
package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListCreditLimitHeader.es.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import { buildDynamicCopy as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import w from "../../components/LogoFromGuid.es.js";
|
|
5
|
-
import { resolveCreditLimitAlertPercent as C } from "../AmountInputModalBlock/layout.es.js";
|
|
6
|
-
import { observer as $ } from "mobx-react-lite";
|
|
1
|
+
import { buildDynamicCopy as b } from "../../../core/utils/Localization.es.js";
|
|
2
|
+
import { CURRENCY_FORMAT as s, formatCurrency as h } from "../../../core/utils/NumberFormatting.es.js";
|
|
3
|
+
import f from "../../components/LogoFromGuid.es.js";
|
|
7
4
|
import r from "@mui/material/Stack";
|
|
8
5
|
import { Text as e } from "@mxenabled/mxui";
|
|
9
6
|
import { jsx as i, jsxs as t } from "react/jsx-runtime";
|
|
10
|
-
import
|
|
11
|
-
var
|
|
12
|
-
const {
|
|
7
|
+
import l from "@mui/material/Box";
|
|
8
|
+
var G = ({ copy: a, header: u }) => {
|
|
9
|
+
const { accountName: d, balance: x, institutionGuid: c, institutionName: p, limit: g, utilization: o } = u, m = Math.min(o, 100), n = a?.credit_limit_header_utilization ? b(a.credit_limit_header_utilization, `${o}%`) : void 0;
|
|
13
10
|
return /* @__PURE__ */ t(r, {
|
|
14
11
|
"data-testid": "credit-limit-header",
|
|
15
12
|
sx: {
|
|
@@ -27,10 +24,10 @@ var k = $(function({ copy: a, header: x }) {
|
|
|
27
24
|
flexDirection: "row",
|
|
28
25
|
gap: 12
|
|
29
26
|
},
|
|
30
|
-
children: [/* @__PURE__ */ i(
|
|
31
|
-
logo:
|
|
32
|
-
guid:
|
|
33
|
-
alt:
|
|
27
|
+
children: [/* @__PURE__ */ i(f, {
|
|
28
|
+
logo: c ? {
|
|
29
|
+
guid: c,
|
|
30
|
+
alt: p
|
|
34
31
|
} : null,
|
|
35
32
|
size: 40
|
|
36
33
|
}), /* @__PURE__ */ t(r, {
|
|
@@ -50,7 +47,7 @@ var k = $(function({ copy: a, header: x }) {
|
|
|
50
47
|
bold: !0,
|
|
51
48
|
truncate: !0,
|
|
52
49
|
variant: "body1",
|
|
53
|
-
children:
|
|
50
|
+
children: d ?? ""
|
|
54
51
|
}), a?.credit_limit_header_credit_limit && /* @__PURE__ */ i(e, {
|
|
55
52
|
color: "text.secondary",
|
|
56
53
|
variant: "body2",
|
|
@@ -65,74 +62,51 @@ var k = $(function({ copy: a, header: x }) {
|
|
|
65
62
|
children: [/* @__PURE__ */ i(e, {
|
|
66
63
|
bold: !0,
|
|
67
64
|
variant: "body1",
|
|
68
|
-
children:
|
|
65
|
+
children: h(x, s.cents)
|
|
69
66
|
}), /* @__PURE__ */ i(e, {
|
|
70
67
|
color: "text.secondary",
|
|
71
68
|
variant: "body2",
|
|
72
|
-
children:
|
|
69
|
+
children: h(g, s.cents)
|
|
73
70
|
})]
|
|
74
71
|
})]
|
|
75
72
|
})]
|
|
76
73
|
}), /* @__PURE__ */ t(r, {
|
|
77
74
|
sx: { gap: 2 },
|
|
78
|
-
children: [
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
},
|
|
104
|
-
children: [/* @__PURE__ */ i(n, {
|
|
105
|
-
"aria-hidden": !0,
|
|
106
|
-
sx: {
|
|
107
|
-
bgcolor: "divider",
|
|
108
|
-
height: 8,
|
|
109
|
-
left: `${o}%`,
|
|
110
|
-
position: "absolute",
|
|
111
|
-
transform: `translateX(-${o}%)`,
|
|
112
|
-
width: "1px"
|
|
113
|
-
}
|
|
114
|
-
}), /* @__PURE__ */ i(e, {
|
|
115
|
-
sx: {
|
|
116
|
-
left: `${o}%`,
|
|
117
|
-
position: "absolute",
|
|
118
|
-
top: 8,
|
|
119
|
-
transform: `translateX(-${o}%)`
|
|
120
|
-
},
|
|
121
|
-
variant: "caption",
|
|
122
|
-
children: `${o}%`
|
|
123
|
-
})]
|
|
124
|
-
}),
|
|
125
|
-
d && /* @__PURE__ */ i(e, {
|
|
75
|
+
children: [/* @__PURE__ */ i(l, {
|
|
76
|
+
"aria-label": d ?? n,
|
|
77
|
+
"aria-valuemax": 100,
|
|
78
|
+
"aria-valuemin": 0,
|
|
79
|
+
"aria-valuenow": m,
|
|
80
|
+
"aria-valuetext": `${o}%`,
|
|
81
|
+
role: "meter",
|
|
82
|
+
sx: {
|
|
83
|
+
bgcolor: "neutral.light",
|
|
84
|
+
borderRadius: "4px",
|
|
85
|
+
height: 12,
|
|
86
|
+
overflow: "hidden"
|
|
87
|
+
},
|
|
88
|
+
children: /* @__PURE__ */ i(l, { sx: {
|
|
89
|
+
bgcolor: "warning.main",
|
|
90
|
+
borderRadius: "4px",
|
|
91
|
+
height: "100%",
|
|
92
|
+
width: `${m}%`
|
|
93
|
+
} })
|
|
94
|
+
}), /* @__PURE__ */ i(l, {
|
|
95
|
+
sx: {
|
|
96
|
+
height: 24,
|
|
97
|
+
pt: 4
|
|
98
|
+
},
|
|
99
|
+
children: n && /* @__PURE__ */ i(e, {
|
|
126
100
|
variant: "caption",
|
|
127
|
-
children:
|
|
101
|
+
children: n
|
|
128
102
|
})
|
|
129
|
-
]
|
|
103
|
+
})]
|
|
130
104
|
})]
|
|
131
105
|
});
|
|
132
|
-
}
|
|
106
|
+
};
|
|
133
107
|
export {
|
|
134
|
-
|
|
135
|
-
|
|
108
|
+
G as TransactionListCreditLimitHeader,
|
|
109
|
+
G as default
|
|
136
110
|
};
|
|
137
111
|
|
|
138
112
|
//# sourceMappingURL=TransactionListCreditLimitHeader.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionListCreditLimitHeader.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionListBlock/TransactionListCreditLimitHeader.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\
|
|
1
|
+
{"version":3,"file":"TransactionListCreditLimitHeader.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionListBlock/TransactionListCreditLimitHeader.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport type { TransactionListBlockCopy } from '../../../core/types/localization/InsightsFeedCopy'\nimport { buildDynamicCopy } from '../../../core/utils/Localization'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../core/utils/NumberFormatting'\nimport LogoFromGuid from '../../components/LogoFromGuid'\n\nimport type { CreditLimitHeader } from './layout'\n\nexport interface TransactionListCreditLimitHeaderProps {\n header: CreditLimitHeader\n copy?: TransactionListBlockCopy\n}\n\n/** The Spending list's credit-limit header: card, balance, limit and how much of the limit is used. */\nexport const TransactionListCreditLimitHeader = ({\n copy,\n header,\n}: TransactionListCreditLimitHeaderProps) => {\n const { accountName, balance, institutionGuid, institutionName, limit, utilization } = header\n const fillPercent = Math.min(utilization, 100)\n const utilizationText = copy?.credit_limit_header_utilization\n ? (buildDynamicCopy(copy.credit_limit_header_utilization, `${utilization}%`) as string)\n : undefined\n\n return (\n <Stack\n data-testid=\"credit-limit-header\"\n sx={{\n bgcolor: 'background.paper',\n borderBottom: 1,\n borderColor: 'divider',\n gap: 16,\n pb: 16,\n pt: 24,\n px: 24,\n }}\n >\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 12 }}>\n <LogoFromGuid\n logo={institutionGuid ? { guid: institutionGuid, alt: institutionName } : null}\n size={40}\n />\n <Stack sx={{ flexDirection: 'row', flexGrow: 1, gap: 12, minWidth: 0 }}>\n <Stack sx={{ flexGrow: 1, gap: 2, minWidth: 0 }}>\n <Text bold={true} truncate={true} variant=\"body1\">\n {accountName ?? ''}\n </Text>\n {copy?.credit_limit_header_credit_limit && (\n <Text color=\"text.secondary\" variant=\"body2\">\n {copy.credit_limit_header_credit_limit}\n </Text>\n )}\n </Stack>\n <Stack sx={{ alignItems: 'flex-end', fontVariantNumeric: 'tabular-nums', gap: 2 }}>\n <Text bold={true} variant=\"body1\">\n {formatCurrency(balance, CURRENCY_FORMAT.cents)}\n </Text>\n <Text color=\"text.secondary\" variant=\"body2\">\n {formatCurrency(limit, CURRENCY_FORMAT.cents)}\n </Text>\n </Stack>\n </Stack>\n </Stack>\n\n <Stack sx={{ gap: 2 }}>\n <Box\n aria-label={accountName ?? utilizationText}\n aria-valuemax={100}\n aria-valuemin={0}\n aria-valuenow={fillPercent}\n aria-valuetext={`${utilization}%`}\n role=\"meter\"\n sx={{ bgcolor: 'neutral.light', borderRadius: '4px', height: 12, overflow: 'hidden' }}\n >\n <Box\n sx={{\n bgcolor: 'warning.main',\n borderRadius: '4px',\n height: '100%',\n width: `${fillPercent}%`,\n }}\n />\n </Box>\n {/* Figma's 24px row under the bar, the utilization text 4px down. The alert tick is out until design confirms its placement. */}\n <Box sx={{ height: 24, pt: 4 }}>\n {utilizationText && <Text variant=\"caption\">{utilizationText}</Text>}\n </Box>\n </Stack>\n </Stack>\n )\n}\n\nexport default TransactionListCreditLimitHeader\n"],"mappings":";;;;;;;AAkBA,IAAa,IAAA,CAAoC,EAC/C,MAAA,GACA,QAAA,EAAA,MAC2C;AAC3C,QAAM,EAAE,aAAA,GAAa,SAAA,GAAS,iBAAA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 +1,14 @@
|
|
|
1
1
|
import { buildDynamicCopy as c } from "../../../core/utils/Localization.es.js";
|
|
2
|
-
import { DATE_FORMATS_INTL as
|
|
3
|
-
import { getLogoElevation as
|
|
2
|
+
import { DATE_FORMATS_INTL as m, formatDate as p } from "../../../core/constants/DateFormats.es.js";
|
|
3
|
+
import { getLogoElevation as d } from "../../components/logoShadow.es.js";
|
|
4
4
|
import { TipSection as l } from "../../../insights/components/shared/ChartDrawerTemplate/TipSection.es.js";
|
|
5
|
-
import { DRAWER_TIP_ICON as
|
|
6
|
-
import { TransactionListHeaderIconTile as
|
|
5
|
+
import { DRAWER_TIP_ICON as u } from "../../components/drawerTip.es.js";
|
|
6
|
+
import { TransactionListHeaderIconTile as g } from "./TransactionListHeaderIconTile.es.js";
|
|
7
7
|
import n from "@mui/material/Stack";
|
|
8
|
-
import { Text as
|
|
8
|
+
import { H2 as x, Text as _ } from "@mxenabled/mxui";
|
|
9
9
|
import { jsx as r, jsxs as e } from "react/jsx-runtime";
|
|
10
|
-
var L = ({ header: o, copy: i, tipTitle:
|
|
11
|
-
const
|
|
10
|
+
var L = ({ header: o, copy: i, tipTitle: s }) => {
|
|
11
|
+
const a = s && i.subscriptions_tip_message ? i.subscriptions_tip_message : void 0, t = o.month && i.subscriptions_in_month ? c(i.subscriptions_in_month, p(o.month, m.MONTH_LONG)) : void 0;
|
|
12
12
|
return /* @__PURE__ */ e(n, {
|
|
13
13
|
sx: {
|
|
14
14
|
gap: 16,
|
|
@@ -21,30 +21,28 @@ var L = ({ header: o, copy: i, tipTitle: a }) => {
|
|
|
21
21
|
alignItems: "center",
|
|
22
22
|
bgcolor: "background.paper",
|
|
23
23
|
borderRadius: "8px",
|
|
24
|
-
boxShadow:
|
|
24
|
+
boxShadow: d,
|
|
25
25
|
flexDirection: "row",
|
|
26
26
|
gap: 12,
|
|
27
27
|
p: 16
|
|
28
28
|
},
|
|
29
|
-
children: [/* @__PURE__ */ r(
|
|
29
|
+
children: [/* @__PURE__ */ r(g, { name: "currency_exchange" }), /* @__PURE__ */ e(n, {
|
|
30
30
|
"aria-label": t ? `${o.count} ${t}` : String(o.count),
|
|
31
31
|
role: "group",
|
|
32
|
-
children: [/* @__PURE__ */ r(
|
|
32
|
+
children: [/* @__PURE__ */ r(x, {
|
|
33
33
|
"aria-hidden": !0,
|
|
34
|
-
bold: !0,
|
|
35
|
-
component: "p",
|
|
36
|
-
variant: "h1",
|
|
37
34
|
children: o.count
|
|
38
|
-
}), t && /* @__PURE__ */ r(
|
|
35
|
+
}), t && /* @__PURE__ */ r(_, {
|
|
39
36
|
"aria-hidden": !0,
|
|
40
37
|
color: "text.secondary",
|
|
41
|
-
|
|
38
|
+
sx: { lineHeight: "20px" },
|
|
39
|
+
variant: "body2",
|
|
42
40
|
children: t
|
|
43
41
|
})]
|
|
44
42
|
})]
|
|
45
|
-
}),
|
|
46
|
-
icon:
|
|
47
|
-
message: c(
|
|
43
|
+
}), a && /* @__PURE__ */ r(l, {
|
|
44
|
+
icon: u,
|
|
45
|
+
message: c(a, /* @__PURE__ */ r("strong", { children: s })),
|
|
48
46
|
sx: { m: 0 }
|
|
49
47
|
})]
|
|
50
48
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionListSubscriptionHeader.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionListBlock/TransactionListSubscriptionHeader.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { DATE_FORMATS_INTL, formatDate } from '../../../core/constants'\nimport type { InsightsFeedCopy } from '../../../core/types/localization'\nimport { buildDynamicCopy } from '../../../core/utils/Localization'\nimport { TipSection } from '../../../insights/components/shared/ChartDrawerTemplate/TipSection'\nimport { getLogoElevation } from '../../components/logoShadow'\nimport { DRAWER_TIP_ICON } from '../../components/drawerTip'\n\nimport { TransactionListHeaderIconTile } from './TransactionListHeaderIconTile'\nimport type { SubscriptionListHeader } from './layout'\n\nexport interface TransactionListSubscriptionHeaderProps {\n header: SubscriptionListHeader\n /** The caption and tip strings the header reads. */\n copy: Pick<\n NonNullable<InsightsFeedCopy['transaction_list_block']>,\n 'subscriptions_in_month' | 'subscriptions_tip_message'\n >\n /** The bold tip label (\"Tip\"), `insights_feed.general.tip_section_title`. */\n tipTitle: string\n}\n\n/** The Subscriptions drawer's header: the count tile and the tip (Figma 1268:54330). */\nexport const TransactionListSubscriptionHeader = ({\n header,\n copy,\n tipTitle,\n}: TransactionListSubscriptionHeaderProps) => {\n // Both halves or neither: a tip without its bold label would read \": Review…\".\n const tip =\n tipTitle && copy.subscriptions_tip_message ? copy.subscriptions_tip_message : undefined\n const caption =\n header.month && copy.subscriptions_in_month\n ? (buildDynamicCopy(\n copy.subscriptions_in_month,\n formatDate(header.month, DATE_FORMATS_INTL.MONTH_LONG),\n ) as string)\n : undefined\n\n return (\n <Stack sx={{ gap: 16, px: 24, pt: 24, pb: 12 }}>\n <Stack\n sx={{\n alignItems: 'center',\n bgcolor: 'background.paper',\n borderRadius: '8px',\n boxShadow: getLogoElevation,\n flexDirection: 'row',\n gap: 12,\n p: 16,\n }}\n >\n <TransactionListHeaderIconTile name=\"currency_exchange\" />\n {/* Read as one label: \"3 Subscriptions in October\", never a bare \"3\" read twice. */}\n <Stack\n aria-label={caption ? `${header.count} ${caption}` : String(header.count)}\n role=\"group\"\n >\n <
|
|
1
|
+
{"version":3,"file":"TransactionListSubscriptionHeader.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionListBlock/TransactionListSubscriptionHeader.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport Stack from '@mui/material/Stack'\n\nimport { H2, Text } from '@mxenabled/mxui'\n\nimport { DATE_FORMATS_INTL, formatDate } from '../../../core/constants'\nimport type { InsightsFeedCopy } from '../../../core/types/localization'\nimport { buildDynamicCopy } from '../../../core/utils/Localization'\nimport { TipSection } from '../../../insights/components/shared/ChartDrawerTemplate/TipSection'\nimport { getLogoElevation } from '../../components/logoShadow'\nimport { DRAWER_TIP_ICON } from '../../components/drawerTip'\n\nimport { TransactionListHeaderIconTile } from './TransactionListHeaderIconTile'\nimport type { SubscriptionListHeader } from './layout'\n\nexport interface TransactionListSubscriptionHeaderProps {\n header: SubscriptionListHeader\n /** The caption and tip strings the header reads. */\n copy: Pick<\n NonNullable<InsightsFeedCopy['transaction_list_block']>,\n 'subscriptions_in_month' | 'subscriptions_tip_message'\n >\n /** The bold tip label (\"Tip\"), `insights_feed.general.tip_section_title`. */\n tipTitle: string\n}\n\n/** The Subscriptions drawer's header: the count tile and the tip (Figma 1268:54330). */\nexport const TransactionListSubscriptionHeader = ({\n header,\n copy,\n tipTitle,\n}: TransactionListSubscriptionHeaderProps) => {\n // Both halves or neither: a tip without its bold label would read \": Review…\".\n const tip =\n tipTitle && copy.subscriptions_tip_message ? copy.subscriptions_tip_message : undefined\n const caption =\n header.month && copy.subscriptions_in_month\n ? (buildDynamicCopy(\n copy.subscriptions_in_month,\n formatDate(header.month, DATE_FORMATS_INTL.MONTH_LONG),\n ) as string)\n : undefined\n\n return (\n <Stack sx={{ gap: 16, px: 24, pt: 24, pb: 12 }}>\n <Stack\n sx={{\n alignItems: 'center',\n bgcolor: 'background.paper',\n borderRadius: '8px',\n boxShadow: getLogoElevation,\n flexDirection: 'row',\n gap: 12,\n p: 16,\n }}\n >\n <TransactionListHeaderIconTile name=\"currency_exchange\" />\n {/* Read as one label: \"3 Subscriptions in October\", never a bare \"3\" read twice. */}\n <Stack\n aria-label={caption ? `${header.count} ${caption}` : String(header.count)}\n role=\"group\"\n >\n <H2 aria-hidden={true}>{header.count}</H2>\n {caption && (\n // Figma 13/400/20: mxui body2 (13/400) at a 20px line height.\n <Text\n aria-hidden={true}\n color=\"text.secondary\"\n sx={{ lineHeight: '20px' }}\n variant=\"body2\"\n >\n {caption}\n </Text>\n )}\n </Stack>\n </Stack>\n\n {tip && (\n <TipSection\n icon={DRAWER_TIP_ICON}\n message={buildDynamicCopy(tip, <strong>{tipTitle}</strong>) as ReactNode}\n sx={{ m: 0 }}\n />\n )}\n </Stack>\n )\n}\n\nexport default TransactionListSubscriptionHeader\n"],"mappings":";;;;;;;;;AA4BA,IAAa,IAAA,CAAqC,EAChD,QAAA,GACA,MAAA,GACA,UAAA,EAAA,MAC4C;AAE5C,QAAM,IACJ,KAAY,EAAK,4BAA4B,EAAK,4BAA4B,QAC1E,IACJ,EAAO,SAAS,EAAK,yBAChB,EACC,EAAK,wBACL,EAAW,EAAO,OAAO,EAAkB,UAAU,CACvD,IACA;AAEN,SACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI;AAAA,MAAE,KAAK;AAAA,MAAI,IAAI;AAAA,MAAI,IAAI;AAAA,MAAI,IAAI;AAAA,IAAG;AAAA,IAA7C,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA,QACF,YAAY;AAAA,QACZ,SAAS;AAAA,QACT,cAAc;AAAA,QACd,WAAW;AAAA,QACX,eAAe;AAAA,QACf,KAAK;AAAA,QACL,GAAG;AAAA,MACL;AAAA,MATF,UAAA,CAWE,gBAAA,EAAC,GAAD,EAA+B,MAAK,oBAAqB,CAAA,GAEzD,gBAAA,EAAC,GAAD;AAAA,QACE,cAAY,IAAU,GAAG,EAAO,KAAA,IAAS,CAAA,KAAY,OAAO,EAAO,KAAK;AAAA,QACxE,MAAK;AAAA,QAFP,UAAA,CAIE,gBAAA,EAAC,GAAD;AAAA,UAAI,eAAa;AAAA,UAAO,UAAA,EAAO;AAAA,QAAU,CAAA,GACxC,KAEC,gBAAA,EAAC,GAAD;AAAA,UACE,eAAa;AAAA,UACb,OAAM;AAAA,UACN,IAAI,EAAE,YAAY,OAAO;AAAA,UACzB,SAAQ;AAAA,UAEP,UAAA;AAAA,QACG,CAAA,CAEH;AAAA,MACF,CAAA,CAAA;AAAA,IAEN,CAAA,GAAA,KACC,gBAAA,EAAC,GAAD;AAAA,MACE,MAAM;AAAA,MACN,SAAS,EAAiB,GAAK,gBAAA,EAAC,UAAD,EAAA,UAAS,EAAiB,CAAA,CAAC;AAAA,MAC1D,IAAI,EAAE,GAAG,EAAE;AAAA,IACZ,CAAA,CAEE;AAAA;AAEX"}
|
|
@@ -8,6 +8,8 @@ interface DonutChartV2Props {
|
|
|
8
8
|
data: DonutSegment[];
|
|
9
9
|
centerLabel?: string;
|
|
10
10
|
centerValue: string;
|
|
11
|
+
/** The embedded card's donut: exactly the chart's box, with no padding around it. */
|
|
12
|
+
compact?: boolean;
|
|
11
13
|
}
|
|
12
|
-
declare const DonutChartV2: ({ data, centerLabel, centerValue }: DonutChartV2Props) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare const DonutChartV2: ({ data, centerLabel, centerValue, compact }: DonutChartV2Props) => import("react/jsx-runtime").JSX.Element;
|
|
13
15
|
export default DonutChartV2;
|
|
@@ -2,19 +2,21 @@ import o from "@mui/material/Stack";
|
|
|
2
2
|
import { Text as l } from "@mxenabled/mxui";
|
|
3
3
|
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
4
4
|
import c from "@mui/material/Box";
|
|
5
|
-
import { PieChart as
|
|
6
|
-
var
|
|
7
|
-
const d = a.some((t) => t.label && t.labelValue), r = !d,
|
|
5
|
+
import { PieChart as g } from "@mui/x-charts/PieChart";
|
|
6
|
+
var D = ({ data: a, centerLabel: n, centerValue: h, compact: u = !1 }) => {
|
|
7
|
+
const d = a.some((t) => t.label && t.labelValue), r = !d, x = a.map((t, s) => ({
|
|
8
8
|
id: s,
|
|
9
9
|
color: t.color,
|
|
10
10
|
value: t.value
|
|
11
|
-
})),
|
|
11
|
+
})), p = r ? 30 : 53, f = r ? 35 : 63, b = 2, m = () => r ? "body1" : n ? "h3" : "h2";
|
|
12
12
|
return /* @__PURE__ */ i(o, {
|
|
13
13
|
sx: {
|
|
14
14
|
alignItems: "center",
|
|
15
15
|
flexDirection: "row",
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
...!u && {
|
|
17
|
+
px: 16,
|
|
18
|
+
py: 4
|
|
19
|
+
}
|
|
18
20
|
},
|
|
19
21
|
children: [/* @__PURE__ */ i(c, {
|
|
20
22
|
sx: {
|
|
@@ -23,13 +25,13 @@ var w = ({ data: a, centerLabel: n, centerValue: h }) => {
|
|
|
23
25
|
justifyContent: "center",
|
|
24
26
|
position: "relative"
|
|
25
27
|
},
|
|
26
|
-
children: [/* @__PURE__ */ e(
|
|
28
|
+
children: [/* @__PURE__ */ e(g, {
|
|
27
29
|
height: r ? 72 : 125,
|
|
28
30
|
series: [{
|
|
29
|
-
cornerRadius:
|
|
30
|
-
data:
|
|
31
|
-
innerRadius:
|
|
32
|
-
outerRadius:
|
|
31
|
+
cornerRadius: b,
|
|
32
|
+
data: x,
|
|
33
|
+
innerRadius: p,
|
|
34
|
+
outerRadius: f
|
|
33
35
|
}],
|
|
34
36
|
slots: { tooltip: () => null },
|
|
35
37
|
width: r ? 72 : 125
|
|
@@ -40,7 +42,7 @@ var w = ({ data: a, centerLabel: n, centerValue: h }) => {
|
|
|
40
42
|
},
|
|
41
43
|
children: [/* @__PURE__ */ e(l, {
|
|
42
44
|
sx: { ...r && { fontWeight: 600 } },
|
|
43
|
-
variant:
|
|
45
|
+
variant: m(),
|
|
44
46
|
children: h
|
|
45
47
|
}), n && /* @__PURE__ */ e(l, {
|
|
46
48
|
sx: { color: "text.secondary" },
|
|
@@ -81,7 +83,7 @@ var w = ({ data: a, centerLabel: n, centerValue: h }) => {
|
|
|
81
83
|
});
|
|
82
84
|
};
|
|
83
85
|
export {
|
|
84
|
-
|
|
86
|
+
D as default
|
|
85
87
|
};
|
|
86
88
|
|
|
87
89
|
//# sourceMappingURL=DonutChart.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DonutChart.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChart.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport { Text } from '@mxenabled/mxui'\nimport { PieChart } from '@mui/x-charts/PieChart'\ninterface DonutSegment {\n color: string\n label?: string\n labelValue?: React.ReactNode\n value: number\n}\n\ninterface DonutChartV2Props {\n data: DonutSegment[]\n centerLabel?: string\n centerValue: string\n}\n\nconst DonutChartV2 = ({ data, centerLabel, centerValue }: DonutChartV2Props) => {\n const hasLegend = data.some((segment) => segment.label && segment.labelValue)\n const isEmbedded = !hasLegend\n\n const chartData = data.map((item, index) => ({\n id: index,\n color: item.color,\n value: item.value,\n }))\n const innerRadius = isEmbedded ? 30 : 53\n const outerRadius = isEmbedded ? 35 : 63\n const cornerRadius = 2\n\n const getCenterValueVariant = () => {\n if (isEmbedded) return 'body1'\n if (centerLabel) return 'h3'\n return 'h2'\n }\n\n return (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', px: 16, py: 4 }}>\n <Box\n sx={{\n alignItems: 'center',\n display: 'flex',\n justifyContent: 'center',\n position: 'relative',\n }}\n >\n <PieChart\n height={isEmbedded ? 72 : 125}\n series={[\n {\n cornerRadius,\n data: chartData,\n innerRadius,\n outerRadius,\n },\n ]}\n slots={{ tooltip: () => null }}\n width={isEmbedded ? 72 : 125}\n />\n\n <Box sx={{ position: 'absolute', textAlign: 'center' }}>\n <Text sx={{ ...(isEmbedded && { fontWeight: 600 }) }} variant={getCenterValueVariant()}>\n {centerValue}\n </Text>\n {centerLabel && (\n <Text sx={{ color: 'text.secondary' }} variant={isEmbedded ? 'caption' : 'body2'}>\n {centerLabel}\n </Text>\n )}\n </Box>\n </Box>\n\n {hasLegend && (\n <Stack sx={{ gap: 24, pl: 24 }}>\n {data.map(\n (segment, index) =>\n segment.label &&\n segment.labelValue && (\n <Stack key={segment.label ?? index}>\n <Stack sx={{ gap: 8, flexDirection: 'row', alignItems: 'center' }}>\n <Box\n sx={{\n backgroundColor: segment.color,\n borderRadius: '2px',\n height: 12,\n width: 12,\n }}\n />\n <Text sx={{ fontWeight: 400 }} variant=\"subtitle2\">\n {segment.label}\n </Text>\n </Stack>\n <Text sx={{ fontWeight: 400, pl: 20 }} variant=\"subtitle2\">\n {segment.labelValue}\n </Text>\n </Stack>\n ),\n )}\n </Stack>\n )}\n </Stack>\n )\n}\n\nexport default DonutChartV2\n"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"DonutChart.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ChartBlocks/DonutChartBlock/DonutChart.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport { Text } from '@mxenabled/mxui'\nimport { PieChart } from '@mui/x-charts/PieChart'\ninterface DonutSegment {\n color: string\n label?: string\n labelValue?: React.ReactNode\n value: number\n}\n\ninterface DonutChartV2Props {\n data: DonutSegment[]\n centerLabel?: string\n centerValue: string\n /** The embedded card's donut: exactly the chart's box, with no padding around it. */\n compact?: boolean\n}\n\nconst DonutChartV2 = ({ data, centerLabel, centerValue, compact = false }: DonutChartV2Props) => {\n const hasLegend = data.some((segment) => segment.label && segment.labelValue)\n const isEmbedded = !hasLegend\n\n const chartData = data.map((item, index) => ({\n id: index,\n color: item.color,\n value: item.value,\n }))\n const innerRadius = isEmbedded ? 30 : 53\n const outerRadius = isEmbedded ? 35 : 63\n const cornerRadius = 2\n\n const getCenterValueVariant = () => {\n if (isEmbedded) return 'body1'\n if (centerLabel) return 'h3'\n return 'h2'\n }\n\n return (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', ...(!compact && { px: 16, py: 4 }) }}>\n <Box\n sx={{\n alignItems: 'center',\n display: 'flex',\n justifyContent: 'center',\n position: 'relative',\n }}\n >\n <PieChart\n height={isEmbedded ? 72 : 125}\n series={[\n {\n cornerRadius,\n data: chartData,\n innerRadius,\n outerRadius,\n },\n ]}\n slots={{ tooltip: () => null }}\n width={isEmbedded ? 72 : 125}\n />\n\n <Box sx={{ position: 'absolute', textAlign: 'center' }}>\n <Text sx={{ ...(isEmbedded && { fontWeight: 600 }) }} variant={getCenterValueVariant()}>\n {centerValue}\n </Text>\n {centerLabel && (\n <Text sx={{ color: 'text.secondary' }} variant={isEmbedded ? 'caption' : 'body2'}>\n {centerLabel}\n </Text>\n )}\n </Box>\n </Box>\n\n {hasLegend && (\n <Stack sx={{ gap: 24, pl: 24 }}>\n {data.map(\n (segment, index) =>\n segment.label &&\n segment.labelValue && (\n <Stack key={segment.label ?? index}>\n <Stack sx={{ gap: 8, flexDirection: 'row', alignItems: 'center' }}>\n <Box\n sx={{\n backgroundColor: segment.color,\n borderRadius: '2px',\n height: 12,\n width: 12,\n }}\n />\n <Text sx={{ fontWeight: 400 }} variant=\"subtitle2\">\n {segment.label}\n </Text>\n </Stack>\n <Text sx={{ fontWeight: 400, pl: 20 }} variant=\"subtitle2\">\n {segment.labelValue}\n </Text>\n </Stack>\n ),\n )}\n </Stack>\n )}\n </Stack>\n )\n}\n\nexport default DonutChartV2\n"],"mappings":";;;;;AAmBA,IAAM,IAAA,CAAgB,EAAE,MAAA,GAAM,aAAA,GAAa,aAAA,GAAa,SAAA,IAAU,GAAA,MAA+B;AAC/F,QAAM,IAAY,EAAK,KAAA,CAAM,MAAY,EAAQ,SAAS,EAAQ,UAAU,GACtE,IAAa,CAAC,GAEd,IAAY,EAAK,IAAA,CAAK,GAAM,OAAW;AAAA,IAC3C,IAAI;AAAA,IACJ,OAAO,EAAK;AAAA,IACZ,OAAO,EAAK;AAAA,EACd,EAAE,GACI,IAAc,IAAa,KAAK,IAChC,IAAc,IAAa,KAAK,IAChC,IAAe,GAEf,IAAA,MACA,IAAmB,UACnB,IAAoB,OACjB;AAGT,SACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI;AAAA,MAAE,YAAY;AAAA,MAAU,eAAe;AAAA,MAAO,GAAI,CAAC,KAAW;AAAA,QAAE,IAAI;AAAA,QAAI,IAAI;AAAA,MAAE;AAAA,IAAG;AAAA,IAA5F,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA,QACF,YAA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AAA,GACD,gBAAA,EAAC,GAAD;AAAA,UAAM,IAAI,EAAE,YAAY,IAAI;AAAA,UAAG,SAAQ;AAAA,UACpC,UAAA,EAAQ;AAAA,QACL,CAAA,CACD;AAAA,MACP,CAAA,GAAA,gBAAA,EAAC,GAAD;AAAA,QAAM,IAAI;AAAA,UAAE,YAAY;AAAA,UAAK,IAAI;AAAA,QAAG;AAAA,QAAG,SAAQ;AAAA,QAC5C,UAAA,EAAQ;AAAA,MACL,CAAA,CACD,EAAA,GAjBK,EAAQ,SAAS,CAiBtB,CAEb;AAAA,IACK,CAAA,CAEJ;AAAA;AAEX"}
|
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
import { slot as n } from "../../../../core/types/Insights.es.js";
|
|
2
|
-
import { CURRENCY_FORMAT as O, formatCurrency as
|
|
3
|
-
import
|
|
4
|
-
import { resolveVariantConfig as
|
|
5
|
-
import { asLogoRef as
|
|
6
|
-
import
|
|
2
|
+
import { CURRENCY_FORMAT as O, formatCurrency as x } from "../../../../core/utils/NumberFormatting.es.js";
|
|
3
|
+
import A from "../../../components/StatusPill.es.js";
|
|
4
|
+
import { resolveVariantConfig as E } from "../../resolveVariantConfig.es.js";
|
|
5
|
+
import { asLogoRef as R, asNumber as y, asText as i, slotOrFlat as d } from "../../slotReaders.es.js";
|
|
6
|
+
import _, { isLogoGuid as z } from "../../../components/LogoFromGuid.es.js";
|
|
7
7
|
import B from "../../../components/LogoClusterCard.es.js";
|
|
8
8
|
import M from "../../../components/MerchantHighlightCard.es.js";
|
|
9
9
|
import N from "../../../components/P2PLogoStack.es.js";
|
|
10
10
|
import { MERCHANT_LAYOUT as P, merchantBlockVariant as T } from "./layout.es.js";
|
|
11
11
|
import V from "@mui/material/Stack";
|
|
12
|
-
import { Icon as
|
|
12
|
+
import { Icon as C } from "@mxenabled/mx-icons";
|
|
13
13
|
import { jsx as e } from "react/jsx-runtime";
|
|
14
|
-
var
|
|
14
|
+
var p = 64, b = 6, w = 72, F = 3, G = [
|
|
15
15
|
10,
|
|
16
16
|
20,
|
|
17
17
|
35
|
|
18
|
-
],
|
|
19
|
-
const r =
|
|
20
|
-
return r?.guid &&
|
|
21
|
-
},
|
|
18
|
+
], I = 32, g = (a) => {
|
|
19
|
+
const r = R(a);
|
|
20
|
+
return r?.guid && z(r.guid) ? r : void 0;
|
|
21
|
+
}, D = (a) => {
|
|
22
22
|
if (!Array.isArray(a)) return [];
|
|
23
23
|
const r = /* @__PURE__ */ new Map();
|
|
24
24
|
for (const t of a.map(g)) t?.guid && !r.has(t.guid) && r.set(t.guid, t);
|
|
25
25
|
return [...r.values()];
|
|
26
|
-
},
|
|
26
|
+
}, L = /* @__PURE__ */ e(C, {
|
|
27
27
|
"aria-hidden": !0,
|
|
28
28
|
"data-icon": "storefront",
|
|
29
29
|
name: "storefront",
|
|
30
|
-
size:
|
|
30
|
+
size: I,
|
|
31
31
|
sx: { color: "text.secondary" }
|
|
32
|
-
}), k = (a, r) => a.length ? a.map((t) => /* @__PURE__ */ e(
|
|
32
|
+
}), k = (a, r) => a.length ? a.map((t) => /* @__PURE__ */ e(_, {
|
|
33
33
|
logo: t,
|
|
34
34
|
size: r
|
|
35
|
-
}, t.guid)) : [
|
|
36
|
-
const { instance_slot: r } = a, { data: t } = r, o =
|
|
37
|
-
icon: /* @__PURE__ */ e(
|
|
35
|
+
}, t.guid)) : [L], ro = ({ payload: a }) => {
|
|
36
|
+
const { instance_slot: r } = a, { data: t } = r, o = E(P, r.variant, T.SingleStandard, "MerchantBlock"), u = i(d(r, "status_text")), m = o.status && u ? /* @__PURE__ */ e(A, {
|
|
37
|
+
icon: /* @__PURE__ */ e(C, {
|
|
38
38
|
"aria-hidden": !0,
|
|
39
39
|
"data-icon": "check_circle",
|
|
40
40
|
fill: !0,
|
|
@@ -42,22 +42,24 @@ var u = 64, p = 6, w = 72, z = 3, F = [
|
|
|
42
42
|
size: 16,
|
|
43
43
|
sx: { color: "success.700" }
|
|
44
44
|
}),
|
|
45
|
-
label:
|
|
45
|
+
label: u,
|
|
46
46
|
sx: o.kind === "single" ? void 0 : {
|
|
47
47
|
alignSelf: "stretch",
|
|
48
48
|
justifyContent: "center"
|
|
49
49
|
}
|
|
50
50
|
}) : void 0;
|
|
51
51
|
if (o.kind !== "single") {
|
|
52
|
-
const c =
|
|
53
|
-
|
|
52
|
+
const c = D(n(t, "logos"));
|
|
53
|
+
if (o.kind === "ranked" && c.length) return /* @__PURE__ */ e(B, {
|
|
54
54
|
background: o.background,
|
|
55
55
|
fullBleed: !0,
|
|
56
|
-
logos: k(c.slice(0,
|
|
57
|
-
overlap:
|
|
58
|
-
rankOffsets:
|
|
56
|
+
logos: k(c.slice(0, F), w),
|
|
57
|
+
overlap: b,
|
|
58
|
+
rankOffsets: G,
|
|
59
59
|
ranked: !0
|
|
60
|
-
})
|
|
60
|
+
});
|
|
61
|
+
const v = o.logo?.size ?? p;
|
|
62
|
+
return /* @__PURE__ */ e(V, {
|
|
61
63
|
sx: {
|
|
62
64
|
background: o.background,
|
|
63
65
|
bgcolor: o.background ? void 0 : o.bgcolor,
|
|
@@ -65,47 +67,48 @@ var u = 64, p = 6, w = 72, z = 3, F = [
|
|
|
65
67
|
width: "100%"
|
|
66
68
|
},
|
|
67
69
|
children: /* @__PURE__ */ e(N, {
|
|
68
|
-
borderColor: null,
|
|
69
|
-
logos: k(c,
|
|
70
|
-
|
|
70
|
+
borderColor: o.logo?.borderColor ?? null,
|
|
71
|
+
logos: k(c, v),
|
|
72
|
+
offsets: o.cascade?.offsets,
|
|
73
|
+
overlap: o.cascade?.overlap ?? b,
|
|
71
74
|
shadow: "elevation",
|
|
72
|
-
size:
|
|
73
|
-
status:
|
|
75
|
+
size: v,
|
|
76
|
+
status: m
|
|
74
77
|
})
|
|
75
78
|
});
|
|
76
79
|
}
|
|
77
80
|
const l = i(n(t, "primary_text")) || i(d(r, "merchant_name"));
|
|
78
81
|
if (!l) return null;
|
|
79
|
-
const s =
|
|
82
|
+
const s = y(d(r, "amount")), S = i(n(t, "header_text")) || i(n(t, "date")), f = g(n(t, "logo")) ?? g({
|
|
80
83
|
alt: l,
|
|
81
84
|
fallback_guid: r.category_guid,
|
|
82
85
|
guid: r.merchant_guid
|
|
83
|
-
}),
|
|
86
|
+
}), h = o.logo?.size ?? p;
|
|
84
87
|
return /* @__PURE__ */ e(M, {
|
|
85
|
-
amount: s !== void 0 && s !== 0 ?
|
|
88
|
+
amount: s !== void 0 && s !== 0 ? x(s, O.cents) : void 0,
|
|
86
89
|
amountPill: o.amountPill,
|
|
87
90
|
amountVariant: o.amountVariant,
|
|
88
91
|
background: o.background,
|
|
89
92
|
bgcolor: o.bgcolor,
|
|
90
93
|
borderColor: o.borderColor,
|
|
91
|
-
eyebrow: o.hideDate ? void 0 :
|
|
94
|
+
eyebrow: o.hideDate ? void 0 : S,
|
|
92
95
|
fullBleed: o.fullBleed,
|
|
93
96
|
gap: o.gap,
|
|
94
|
-
logo:
|
|
95
|
-
logo:
|
|
96
|
-
size:
|
|
97
|
-
}) :
|
|
97
|
+
logo: f ? /* @__PURE__ */ e(_, {
|
|
98
|
+
logo: f,
|
|
99
|
+
size: h
|
|
100
|
+
}) : L,
|
|
98
101
|
logoBorderColor: o.logo?.borderColor,
|
|
99
102
|
logoRadius: o.logo?.radius,
|
|
100
103
|
logoShadow: o.logo?.shadow,
|
|
101
|
-
logoSize:
|
|
104
|
+
logoSize: h,
|
|
102
105
|
name: l,
|
|
103
106
|
nameVariant: o.nameVariant,
|
|
104
|
-
trailing:
|
|
107
|
+
trailing: m
|
|
105
108
|
});
|
|
106
109
|
};
|
|
107
110
|
export {
|
|
108
|
-
|
|
111
|
+
ro as default
|
|
109
112
|
};
|
|
110
113
|
|
|
111
114
|
//# sourceMappingURL=MerchantBlock.es.js.map
|