@adyen/adyen-web 6.14.0 → 6.16.0
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/dist/cjs/adyen.css +12 -5
- package/dist/cjs/adyen.css.map +1 -1
- package/dist/cjs/index.cjs +2 -2
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +282 -131
- package/dist/es/adyen.css +12 -5
- package/dist/es/adyen.css.map +1 -1
- package/dist/es/components/AmazonPay/AmazonPay.js +1 -1
- package/dist/es/components/AmazonPay/AmazonPay.js.map +1 -1
- package/dist/es/components/ApplePay/ApplePay.js +1 -1
- package/dist/es/components/ApplePay/ApplePay.js.map +1 -1
- package/dist/es/components/Card/Card.js +1 -1
- package/dist/es/components/Card/Card.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/CardInput.js +1 -1
- package/dist/es/components/Card/components/CardInput/CardInput.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/components/CardFields.js +1 -1
- package/dist/es/components/Card/components/CardInput/components/CardFields.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/components/CardFieldsWrapper.js +1 -1
- package/dist/es/components/Card/components/CardInput/components/CardFieldsWrapper.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/components/CardNumber.js +1 -1
- package/dist/es/components/Card/components/CardInput/components/CardNumber.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/components/DualBrandingIcon/DualBrandingIcon.js +1 -1
- package/dist/es/components/Card/components/CardInput/components/DualBrandingIcon/DualBrandingIcon.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/types.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/utils.js +1 -1
- package/dist/es/components/Card/components/CardInput/utils.js.map +1 -1
- package/dist/es/components/Card/components/Fastlane/FastlaneSignup.js +1 -1
- package/dist/es/components/Card/components/Fastlane/FastlaneSignup.js.map +1 -1
- package/dist/es/components/CustomCard/CustomCard.js +1 -1
- package/dist/es/components/CustomCard/CustomCard.js.map +1 -1
- package/dist/es/components/Dropin/components/DropinComponent.js +1 -1
- package/dist/es/components/Dropin/components/DropinComponent.js.map +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js.map +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js.map +1 -1
- package/dist/es/components/GooglePay/GooglePay.js +1 -1
- package/dist/es/components/GooglePay/GooglePay.js.map +1 -1
- package/dist/es/components/PayByBankPix/PayByBankPix.js +2 -0
- package/dist/es/components/PayByBankPix/PayByBankPix.js.map +1 -0
- package/dist/es/components/PayByBankPix/components/Enrollment/Enrollment.js +2 -0
- package/dist/es/components/PayByBankPix/components/Enrollment/Enrollment.js.map +1 -0
- package/dist/es/components/PayByBankPix/components/Enrollment/components/AwaitLogoContainer.js +2 -0
- package/dist/es/components/PayByBankPix/components/Enrollment/components/AwaitLogoContainer.js.map +1 -0
- package/dist/es/components/PayByBankPix/components/Enrollment/components/IssuerListIntroduction.js +2 -0
- package/dist/es/components/PayByBankPix/components/Enrollment/components/IssuerListIntroduction.js.map +1 -0
- package/dist/es/components/PayByBankPix/components/Enrollment/components/PayByBankPixAwait.js +2 -0
- package/dist/es/components/PayByBankPix/components/Enrollment/components/PayByBankPixAwait.js.map +1 -0
- package/dist/es/components/PayByBankPix/components/Enrollment/getEnrollmentStatus.js +2 -0
- package/dist/es/components/PayByBankPix/components/Enrollment/getEnrollmentStatus.js.map +1 -0
- package/dist/es/components/PayByBankPix/components/Enrollment/useIssuerWithLogo.js +2 -0
- package/dist/es/components/PayByBankPix/components/Enrollment/useIssuerWithLogo.js.map +1 -0
- package/dist/es/components/PayByBankPix/components/StoredPayment/StoredPayment.js +2 -0
- package/dist/es/components/PayByBankPix/components/StoredPayment/StoredPayment.js.map +1 -0
- package/dist/es/components/PayByBankPix/components/StoredPayment/getAuthorizationStatus.js +2 -0
- package/dist/es/components/PayByBankPix/components/StoredPayment/getAuthorizationStatus.js.map +1 -0
- package/dist/es/components/PayByBankPix/services/PasskeySdkLoader.js +2 -0
- package/dist/es/components/PayByBankPix/services/PasskeySdkLoader.js.map +1 -0
- package/dist/es/components/PayByBankPix/services/PasskeyService.js +2 -0
- package/dist/es/components/PayByBankPix/services/PasskeyService.js.map +1 -0
- package/dist/es/components/PayByBankPix/services/authorizeEnrollment.js +2 -0
- package/dist/es/components/PayByBankPix/services/authorizeEnrollment.js.map +1 -0
- package/dist/es/components/PayByBankPix/services/authorizePayment.js +2 -0
- package/dist/es/components/PayByBankPix/services/authorizePayment.js.map +1 -0
- package/dist/es/components/PayByBankPix/services/types.js +2 -0
- package/dist/es/components/PayByBankPix/services/types.js.map +1 -0
- package/dist/es/components/PayPal/Paypal.js +1 -1
- package/dist/es/components/PayPal/Paypal.js.map +1 -1
- package/dist/es/components/Redirect/Redirect.js +1 -1
- package/dist/es/components/Redirect/Redirect.js.map +1 -1
- package/dist/es/components/ThreeDS2/ThreeDS2Challenge.js +1 -1
- package/dist/es/components/ThreeDS2/ThreeDS2Challenge.js.map +1 -1
- package/dist/es/components/ThreeDS2/ThreeDS2DeviceFingerprint.js +1 -1
- package/dist/es/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +1 -1
- package/dist/es/components/ThreeDS2/callSubmit3DS2Fingerprint.js +1 -1
- package/dist/es/components/ThreeDS2/callSubmit3DS2Fingerprint.js.map +1 -1
- package/dist/es/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js +1 -1
- package/dist/es/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js.map +1 -1
- package/dist/es/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js +1 -1
- package/dist/es/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js.map +1 -1
- package/dist/es/components/ThreeDS2/constants.js +1 -1
- package/dist/es/components/ThreeDS2/constants.js.map +1 -1
- package/dist/es/components/UPI/components/VpaInput/VpaInput.js +1 -1
- package/dist/es/components/UPI/components/VpaInput/VpaInput.js.map +1 -1
- package/dist/es/components/components-name-map.js +1 -1
- package/dist/es/components/components-name-map.js.map +1 -1
- package/dist/es/components/index.js +1 -1
- package/dist/es/components/internal/Await/Await.js +1 -1
- package/dist/es/components/internal/Await/Await.js.map +1 -1
- package/dist/es/components/internal/BaseElement/BaseElement.js +1 -1
- package/dist/es/components/internal/BaseElement/BaseElement.js.map +1 -1
- package/dist/es/components/internal/DisclaimerMessage/DisclaimerMessage.js +1 -1
- package/dist/es/components/internal/DisclaimerMessage/DisclaimerMessage.js.map +1 -1
- package/dist/es/components/internal/ExpandButton/ExpandButton.js +1 -1
- package/dist/es/components/internal/ExpandButton/ExpandButton.js.map +1 -1
- package/dist/es/components/internal/FormFields/Fieldset/Fieldset.js.map +1 -1
- package/dist/es/components/internal/FormFields/RadioGroupExtended/RadioButtonIcon.js +2 -0
- package/dist/es/components/internal/FormFields/RadioGroupExtended/RadioButtonIcon.js.map +1 -0
- package/dist/es/components/internal/FormFields/RadioGroupExtended/RadioGroupExtended.js +2 -0
- package/dist/es/components/internal/FormFields/RadioGroupExtended/RadioGroupExtended.js.map +1 -0
- package/dist/es/components/internal/IssuerList/IssuerList.js +1 -1
- package/dist/es/components/internal/IssuerList/IssuerList.js.map +1 -1
- package/dist/es/components/internal/QRLoader/QRLoader.js +1 -1
- package/dist/es/components/internal/QRLoader/QRLoader.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js +1 -1
- package/dist/es/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/binLookup/createCardVariantSwitcher.js +1 -1
- package/dist/es/components/internal/SecuredFields/binLookup/createCardVariantSwitcher.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/binLookup/extensions.js +1 -1
- package/dist/es/components/internal/SecuredFields/binLookup/extensions.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleBrandFromBinLookup.js +1 -1
- package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleBrandFromBinLookup.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/lib/constants.js +1 -1
- package/dist/es/components/internal/SecuredFields/lib/constants.js.map +1 -1
- package/dist/es/components/internal/UIElement/UIElement.js +1 -1
- package/dist/es/components/internal/UIElement/UIElement.js.map +1 -1
- package/dist/es/components/tx-variants.js +1 -1
- package/dist/es/components/tx-variants.js.map +1 -1
- package/dist/es/core/Analytics/Analytics.js +1 -1
- package/dist/es/core/Analytics/Analytics.js.map +1 -1
- package/dist/es/core/Analytics/AnalyticsErrorEvent.js +2 -0
- package/dist/es/core/Analytics/AnalyticsErrorEvent.js.map +1 -0
- package/dist/es/core/Analytics/AnalyticsEvent.js +2 -0
- package/dist/es/core/Analytics/AnalyticsEvent.js.map +1 -0
- package/dist/es/core/Analytics/AnalyticsInfoEvent.js +2 -0
- package/dist/es/core/Analytics/AnalyticsInfoEvent.js.map +1 -0
- package/dist/es/core/Analytics/AnalyticsLogEvent.js +2 -0
- package/dist/es/core/Analytics/AnalyticsLogEvent.js.map +1 -0
- package/dist/es/core/Analytics/utils.js +1 -1
- package/dist/es/core/Analytics/utils.js.map +1 -1
- package/dist/es/core/Environment/Environment.js +1 -1
- package/dist/es/core/Environment/Environment.js.map +1 -1
- package/dist/es/core/ProcessResponse/PaymentMethods/filters.js +1 -1
- package/dist/es/core/ProcessResponse/PaymentMethods/filters.js.map +1 -1
- package/dist/es/core/Services/analytics/collect-id.js +1 -1
- package/dist/es/core/core.js +1 -1
- package/dist/es/core/core.js.map +1 -1
- package/dist/es/core/utils.js +1 -1
- package/dist/es/core/utils.js.map +1 -1
- package/dist/es/index.d.ts +282 -131
- package/dist/es/index.js +1 -1
- package/dist/es/utils/base64.js.map +1 -1
- package/dist/es/utils/clipboard.js.map +1 -1
- package/dist/es-legacy/adyen.css +12 -5
- package/dist/es-legacy/adyen.css.map +1 -1
- package/dist/es-legacy/components/AmazonPay/AmazonPay.js +1 -1
- package/dist/es-legacy/components/AmazonPay/AmazonPay.js.map +1 -1
- package/dist/es-legacy/components/ApplePay/ApplePay.js +1 -1
- package/dist/es-legacy/components/ApplePay/ApplePay.js.map +1 -1
- package/dist/es-legacy/components/Card/Card.js +1 -1
- package/dist/es-legacy/components/Card/Card.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/CardInput.js +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/CardInput.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/CardFields.js +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/CardFields.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/CardFieldsWrapper.js +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/CardFieldsWrapper.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/CardNumber.js +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/CardNumber.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/DualBrandingIcon/DualBrandingIcon.js +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/DualBrandingIcon/DualBrandingIcon.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/types.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/utils.js +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/utils.js.map +1 -1
- package/dist/es-legacy/components/Card/components/Fastlane/FastlaneSignup.js +1 -1
- package/dist/es-legacy/components/Card/components/Fastlane/FastlaneSignup.js.map +1 -1
- package/dist/es-legacy/components/CustomCard/CustomCard.js +1 -1
- package/dist/es-legacy/components/CustomCard/CustomCard.js.map +1 -1
- package/dist/es-legacy/components/Dropin/components/DropinComponent.js +1 -1
- package/dist/es-legacy/components/Dropin/components/DropinComponent.js.map +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js.map +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodsContainer.js.map +1 -1
- package/dist/es-legacy/components/GooglePay/GooglePay.js +1 -1
- package/dist/es-legacy/components/GooglePay/GooglePay.js.map +1 -1
- package/dist/es-legacy/components/PayByBankPix/PayByBankPix.js +2 -0
- package/dist/es-legacy/components/PayByBankPix/PayByBankPix.js.map +1 -0
- package/dist/es-legacy/components/PayByBankPix/components/Enrollment/Enrollment.js +2 -0
- package/dist/es-legacy/components/PayByBankPix/components/Enrollment/Enrollment.js.map +1 -0
- package/dist/es-legacy/components/PayByBankPix/components/Enrollment/components/AwaitLogoContainer.js +2 -0
- package/dist/es-legacy/components/PayByBankPix/components/Enrollment/components/AwaitLogoContainer.js.map +1 -0
- package/dist/es-legacy/components/PayByBankPix/components/Enrollment/components/IssuerListIntroduction.js +2 -0
- package/dist/es-legacy/components/PayByBankPix/components/Enrollment/components/IssuerListIntroduction.js.map +1 -0
- package/dist/es-legacy/components/PayByBankPix/components/Enrollment/components/PayByBankPixAwait.js +2 -0
- package/dist/es-legacy/components/PayByBankPix/components/Enrollment/components/PayByBankPixAwait.js.map +1 -0
- package/dist/es-legacy/components/PayByBankPix/components/Enrollment/getEnrollmentStatus.js +2 -0
- package/dist/es-legacy/components/PayByBankPix/components/Enrollment/getEnrollmentStatus.js.map +1 -0
- package/dist/es-legacy/components/PayByBankPix/components/Enrollment/useIssuerWithLogo.js +2 -0
- package/dist/es-legacy/components/PayByBankPix/components/Enrollment/useIssuerWithLogo.js.map +1 -0
- package/dist/es-legacy/components/PayByBankPix/components/StoredPayment/StoredPayment.js +2 -0
- package/dist/es-legacy/components/PayByBankPix/components/StoredPayment/StoredPayment.js.map +1 -0
- package/dist/es-legacy/components/PayByBankPix/components/StoredPayment/getAuthorizationStatus.js +2 -0
- package/dist/es-legacy/components/PayByBankPix/components/StoredPayment/getAuthorizationStatus.js.map +1 -0
- package/dist/es-legacy/components/PayByBankPix/services/PasskeySdkLoader.js +2 -0
- package/dist/es-legacy/components/PayByBankPix/services/PasskeySdkLoader.js.map +1 -0
- package/dist/es-legacy/components/PayByBankPix/services/PasskeyService.js +2 -0
- package/dist/es-legacy/components/PayByBankPix/services/PasskeyService.js.map +1 -0
- package/dist/es-legacy/components/PayByBankPix/services/authorizeEnrollment.js +2 -0
- package/dist/es-legacy/components/PayByBankPix/services/authorizeEnrollment.js.map +1 -0
- package/dist/es-legacy/components/PayByBankPix/services/authorizePayment.js +2 -0
- package/dist/es-legacy/components/PayByBankPix/services/authorizePayment.js.map +1 -0
- package/dist/es-legacy/components/PayByBankPix/services/types.js +2 -0
- package/dist/es-legacy/components/PayByBankPix/services/types.js.map +1 -0
- package/dist/es-legacy/components/PayPal/Paypal.js +1 -1
- package/dist/es-legacy/components/PayPal/Paypal.js.map +1 -1
- package/dist/es-legacy/components/Redirect/Redirect.js +1 -1
- package/dist/es-legacy/components/Redirect/Redirect.js.map +1 -1
- package/dist/es-legacy/components/ThreeDS2/ThreeDS2Challenge.js +1 -1
- package/dist/es-legacy/components/ThreeDS2/ThreeDS2Challenge.js.map +1 -1
- package/dist/es-legacy/components/ThreeDS2/ThreeDS2DeviceFingerprint.js +1 -1
- package/dist/es-legacy/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +1 -1
- package/dist/es-legacy/components/ThreeDS2/callSubmit3DS2Fingerprint.js +1 -1
- package/dist/es-legacy/components/ThreeDS2/callSubmit3DS2Fingerprint.js.map +1 -1
- package/dist/es-legacy/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js +1 -1
- package/dist/es-legacy/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js.map +1 -1
- package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js +1 -1
- package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js.map +1 -1
- package/dist/es-legacy/components/ThreeDS2/constants.js +1 -1
- package/dist/es-legacy/components/ThreeDS2/constants.js.map +1 -1
- package/dist/es-legacy/components/UPI/components/VpaInput/VpaInput.js +1 -1
- package/dist/es-legacy/components/UPI/components/VpaInput/VpaInput.js.map +1 -1
- package/dist/es-legacy/components/components-name-map.js +1 -1
- package/dist/es-legacy/components/components-name-map.js.map +1 -1
- package/dist/es-legacy/components/index.js +1 -1
- package/dist/es-legacy/components/internal/Await/Await.js +1 -1
- package/dist/es-legacy/components/internal/Await/Await.js.map +1 -1
- package/dist/es-legacy/components/internal/BaseElement/BaseElement.js +1 -1
- package/dist/es-legacy/components/internal/BaseElement/BaseElement.js.map +1 -1
- package/dist/es-legacy/components/internal/DisclaimerMessage/DisclaimerMessage.js +1 -1
- package/dist/es-legacy/components/internal/DisclaimerMessage/DisclaimerMessage.js.map +1 -1
- package/dist/es-legacy/components/internal/ExpandButton/ExpandButton.js +1 -1
- package/dist/es-legacy/components/internal/ExpandButton/ExpandButton.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/Fieldset/Fieldset.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/RadioGroupExtended/RadioButtonIcon.js +2 -0
- package/dist/es-legacy/components/internal/FormFields/RadioGroupExtended/RadioButtonIcon.js.map +1 -0
- package/dist/es-legacy/components/internal/FormFields/RadioGroupExtended/RadioGroupExtended.js +2 -0
- package/dist/es-legacy/components/internal/FormFields/RadioGroupExtended/RadioGroupExtended.js.map +1 -0
- package/dist/es-legacy/components/internal/IssuerList/IssuerList.js +1 -1
- package/dist/es-legacy/components/internal/IssuerList/IssuerList.js.map +1 -1
- package/dist/es-legacy/components/internal/QRLoader/QRLoader.js +1 -1
- package/dist/es-legacy/components/internal/QRLoader/QRLoader.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProvider.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/binLookup/createCardVariantSwitcher.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/binLookup/createCardVariantSwitcher.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/binLookup/extensions.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/binLookup/extensions.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleBrandFromBinLookup.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleBrandFromBinLookup.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/constants.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/constants.js.map +1 -1
- package/dist/es-legacy/components/internal/UIElement/UIElement.js +1 -1
- package/dist/es-legacy/components/internal/UIElement/UIElement.js.map +1 -1
- package/dist/es-legacy/components/tx-variants.js +1 -1
- package/dist/es-legacy/components/tx-variants.js.map +1 -1
- package/dist/es-legacy/core/Analytics/Analytics.js +1 -1
- package/dist/es-legacy/core/Analytics/Analytics.js.map +1 -1
- package/dist/es-legacy/core/Analytics/AnalyticsErrorEvent.js +2 -0
- package/dist/es-legacy/core/Analytics/AnalyticsErrorEvent.js.map +1 -0
- package/dist/es-legacy/core/Analytics/AnalyticsEvent.js +2 -0
- package/dist/es-legacy/core/Analytics/AnalyticsEvent.js.map +1 -0
- package/dist/es-legacy/core/Analytics/AnalyticsInfoEvent.js +2 -0
- package/dist/es-legacy/core/Analytics/AnalyticsInfoEvent.js.map +1 -0
- package/dist/es-legacy/core/Analytics/AnalyticsLogEvent.js +2 -0
- package/dist/es-legacy/core/Analytics/AnalyticsLogEvent.js.map +1 -0
- package/dist/es-legacy/core/Analytics/utils.js +1 -1
- package/dist/es-legacy/core/Analytics/utils.js.map +1 -1
- package/dist/es-legacy/core/Environment/Environment.js +1 -1
- package/dist/es-legacy/core/Environment/Environment.js.map +1 -1
- package/dist/es-legacy/core/ProcessResponse/PaymentMethods/filters.js +1 -1
- package/dist/es-legacy/core/ProcessResponse/PaymentMethods/filters.js.map +1 -1
- package/dist/es-legacy/core/Services/analytics/collect-id.js +1 -1
- package/dist/es-legacy/core/core.js +1 -1
- package/dist/es-legacy/core/core.js.map +1 -1
- package/dist/es-legacy/core/utils.js +1 -1
- package/dist/es-legacy/core/utils.js.map +1 -1
- package/dist/es-legacy/index.js +1 -1
- package/dist/es-legacy/utils/base64.js.map +1 -1
- package/dist/es-legacy/utils/clipboard.js.map +1 -1
- package/package.json +3 -4
- package/styles/adyen.css +12 -5
- package/dist/es/core/Analytics/analyticsPreProcessor.js +0 -2
- package/dist/es/core/Analytics/analyticsPreProcessor.js.map +0 -1
- package/dist/es-legacy/core/Analytics/analyticsPreProcessor.js +0 -2
- package/dist/es-legacy/core/Analytics/analyticsPreProcessor.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardInput.js","sources":["../../../../../../src/components/Card/components/CardInput/CardInput.tsx"],"sourcesContent":["import { h, Fragment } from 'preact';\nimport { useState, useEffect, useRef, useMemo, useCallback } from 'preact/hooks';\nimport SecuredFieldsProvider from '../../../internal/SecuredFields/SFP/SecuredFieldsProvider';\nimport { OnChangeEventDetails, SFPState } from '../../../internal/SecuredFields/SFP/types';\nimport defaultProps from './defaultProps';\nimport './CardInput.scss';\nimport { AddressModeOptions, CardInputDataState, CardInputErrorState, CardInputProps, CardInputRef, CardInputValidState } from './types';\nimport { CVC_POLICY_REQUIRED, DATE_POLICY_REQUIRED, ENCRYPTED_CARD_NUMBER } from '../../../internal/SecuredFields/lib/constants';\nimport { BinLookupResponse } from '../../types';\nimport { cardInputFormatters, cardInputValidationRules, getRuleByNameAndMode } from './validate';\nimport CIExtensions from '../../../internal/SecuredFields/binLookup/extensions';\nimport useForm from '../../../../utils/useForm';\nimport { SortedErrorObject } from '../../../../core/Errors/types';\nimport { handlePartialAddressMode, extractPropsForCardFields, extractPropsForSFP, getLayout } from './utils';\nimport Specifications from '../../../internal/Address/Specifications';\nimport { StoredCardFieldsWrapper } from './components/StoredCardFieldsWrapper';\nimport { CardFieldsWrapper } from './components/CardFieldsWrapper';\nimport { getAddressHandler, getAutoJumpHandler, getFocusHandler } from './handlers';\nimport { InstallmentsObj } from './components/Installments/Installments';\nimport { TouchStartEventObj } from './components/types';\nimport classNames from 'classnames';\nimport { getPartialAddressValidationRules } from '../../../internal/Address/validate';\nimport useImage from '../../../../core/Context/useImage';\nimport { getArrayDifferences } from '../../../../utils/arrayUtils';\nimport FormInstruction from '../../../internal/FormInstruction';\nimport { AddressData } from '../../../../types/global-types';\nimport { CardBrandData, CardFocusData } from '../../../internal/SecuredFields/lib/types';\nimport { FieldErrorAnalyticsObject } from '../../../../core/Analytics/types';\nimport { PREFIX } from '../../../internal/Icon/constants';\nimport useSRPanelForCardInputErrors from './useSRPanelForCardInputErrors';\nimport FastlaneSignup from '../Fastlane/FastlaneSignup';\n\nconst CardInput = (props: CardInputProps) => {\n const sfp = useRef(null);\n const isValidating = useRef(false);\n const getImage = useImage();\n\n const billingAddressRef = useRef(null);\n const setAddressRef = ref => {\n billingAddressRef.current = ref;\n };\n\n const cardInputRef = useRef<CardInputRef>({});\n // Just call once to create the object by which we expose the members expected by the parent Card comp\n if (!Object.keys(cardInputRef.current).length) {\n props.setComponentRef(cardInputRef.current);\n }\n\n const hasPanLengthRef = useRef(0);\n const isAutoJumping = useRef(false);\n\n const specifications = useMemo(() => new Specifications(props.specifications), [props.specifications]);\n\n // Store ref to sfp (useful for 'deep' debugging)\n cardInputRef.current.sfp = sfp;\n\n /**\n * STATE HOOKS\n */\n const [status, setStatus] = useState('ready');\n\n const [errors, setErrors] = useState<CardInputErrorState>({});\n const [valid, setValid] = useState<CardInputValidState>({\n ...(props.holderNameRequired && { holderName: false })\n });\n const [data, setData] = useState<CardInputDataState>({\n ...(props.hasHolderName && { holderName: props.data.holderName ?? '' })\n });\n\n const [focusedElement, setFocusedElement] = useState('');\n const [isSfpValid, setIsSfpValid] = useState(false);\n const [expiryDatePolicy, setExpiryDatePolicy] = useState(DATE_POLICY_REQUIRED);\n const [cvcPolicy, setCvcPolicy] = useState(CVC_POLICY_REQUIRED);\n const [issuingCountryCode, setIssuingCountryCode] = useState<string>(null);\n\n const [dualBrandSelectElements, setDualBrandSelectElements] = useState([]);\n const [selectedBrandValue, setSelectedBrandValue] = useState(props.storedPaymentMethodId ? props.brand : ''); // If this is a storedCard comp initialise state with the storedCard's brand\n\n const showBillingAddress = props.billingAddressMode !== AddressModeOptions.none && props.billingAddressRequired;\n\n const partialAddressSchema = handlePartialAddressMode(props.billingAddressMode);\n // Keeps the value of the country set initially by the merchant, before the Address Component mutates it\n const partialAddressCountry = useRef<string>(partialAddressSchema && props.data?.billingAddress?.country);\n\n const [storePaymentMethod, setStorePaymentMethod] = useState(false);\n const [billingAddress, setBillingAddress] = useState<AddressData>(showBillingAddress ? props.data.billingAddress : null);\n const [showSocialSecurityNumber, setShowSocialSecurityNumber] = useState(false);\n const [socialSecurityNumber, setSocialSecurityNumber] = useState('');\n const [installments, setInstallments] = useState<InstallmentsObj>({ value: null });\n\n // re. Disable arrows for iOS: The name of the element calling for other elements to be disabled\n // - either a securedField type (like 'encryptedCardNumber') when call is coming from SF\n // or else the name of an internal, Adyen-web, element (like 'holderName')\n const [iOSFocusedField, setIOSFocusedField] = useState(null);\n\n /**\n * This stores the brand as detected by the internal regEx.\n * It eventually gets overwritten by the brand as detected by the /binLookup, but will revert back to the regEx detection\n * if the PAN length drops below the /binLookup digit threshold.\n * Default value, 'card', indicates no brand detected\n */\n const [internallyDetectedBrand, setInternallyDetectedBrand] = useState('card');\n\n /**\n * LOCAL VARS\n */\n const {\n handleChangeFor,\n triggerValidation,\n data: formData,\n valid: formValid,\n errors: formErrors,\n setSchema,\n setData: setFormData,\n setValid: setFormValid,\n setErrors: setFormErrors\n } = useForm<CardInputDataState>({\n schema: [],\n defaultData: props.data,\n formatters: cardInputFormatters,\n rules: cardInputValidationRules\n });\n\n const hasInstallments = !!Object.keys(props.installmentOptions).length && props.fundingSource !== 'debit';\n const showAmountsInInstallments = props.showInstallmentAmounts ?? true;\n\n const cardCountryCode: string = issuingCountryCode ?? props.countryCode;\n const isKorea = cardCountryCode === 'kr'; // If issuingCountryCode or the merchant defined countryCode is set to 'kr'\n const showKCP = props.configuration.koreanAuthenticationRequired && isKorea;\n\n const showBrazilianSSN: boolean =\n (showSocialSecurityNumber && props.configuration.socialSecurityNumberMode === 'auto') ||\n props.configuration.socialSecurityNumberMode === 'show';\n\n /**\n * HANDLERS\n */\n // Handlers for focus & blur on all fields. Can be renamed to onFieldFocus once the onFocusField is renamed in Field.tsx\n const onFieldFocusAnalytics = (who: string, e: Event | CardFocusData) => {\n props.onFocus({ fieldType: who, event: e });\n };\n const onFieldBlurAnalytics = (who: string, e: Event | CardFocusData) => {\n props.onBlur({ fieldType: who, event: e });\n };\n\n const onBrand = useCallback((obj: CardBrandData) => {\n setInternallyDetectedBrand(obj.brand);\n props.onBrand(obj);\n }, []);\n\n // Make SecuredFields aware of the focus & blur handlers\n const handleFocus = getFocusHandler(setFocusedElement, onFieldFocusAnalytics, onFieldBlurAnalytics);\n\n const retrieveLayout = (): string[] => {\n return getLayout({\n props,\n showKCP,\n showBrazilianSSN,\n ...(props.billingAddressRequired && {\n countrySpecificSchemas: specifications.getAddressSchemaForCountry(billingAddress?.country),\n billingAddressRequiredFields: props.billingAddressRequiredFields\n })\n });\n };\n\n /**\n * re. Disabling arrow keys in iOS:\n * Only by disabling all fields in the Card PM except for the active securedField input can we force the iOS soft keyboard arrow keys to disable\n *\n * NOTE: only called if ua.__IS_IOS = true && this.config.disableIOSArrowKeys = true (as referenced in CSF)\n *\n * @param obj - has fieldType prop saying whether this function is being called in response to an securedFields click ('encryptedCardNumber' etc)\n * - in which case we should disable all non-SF fields\n * or,\n * due to an internal action ('webInternalElement') - in which case we can enable all non-SF fields\n */\n const handleTouchstartIOS = useCallback((obj: TouchStartEventObj) => {\n const elementType = obj.fieldType !== 'webInternalElement' ? obj.fieldType : obj.name;\n setIOSFocusedField(elementType);\n }, []);\n\n const handleAddress = getAddressHandler(setFormData, setFormValid, setFormErrors);\n\n const doPanAutoJump = getAutoJumpHandler(isAutoJumping, sfp, retrieveLayout());\n\n const handleSecuredFieldsChange = (sfState: SFPState, eventDetails?: OnChangeEventDetails): void => {\n /**\n * Handling auto complete value for holderName (but only if the component is using a holderName field)\n */\n if (sfState.autoCompleteName) {\n if (!props.hasHolderName) return;\n const holderNameValidationFn = getRuleByNameAndMode('holderName', 'blur');\n const acHolderName = holderNameValidationFn(sfState.autoCompleteName) ? sfState.autoCompleteName : null;\n if (acHolderName) {\n setFormData('holderName', acHolderName);\n setFormValid('holderName', true); // only if holderName is valid does this fny get called - so we know it's valid and w/o error\n setFormErrors('holderName', null);\n }\n return;\n }\n\n /**\n * Decide if we can shift focus to the expiryDate field.\n *\n * We can if... the config prop, autoFocus, is true AND we have a panLength value from binLookup\n * AND we are responding to a handleOnFieldValid message about the PAN that says it is valid\n */\n if (\n props.autoFocus &&\n hasPanLengthRef.current > 0 &&\n eventDetails?.event === 'handleOnFieldValid' &&\n eventDetails?.fieldType === ENCRYPTED_CARD_NUMBER &&\n sfState.valid.encryptedCardNumber\n ) {\n doPanAutoJump();\n }\n\n /**\n * Process SFP state\n */\n setData({ ...data, ...sfState.data });\n setErrors({ ...errors, ...sfState.errors });\n setValid({ ...valid, ...sfState.valid });\n\n setIsSfpValid(sfState.isSfpValid);\n\n // Values relating to /binLookup response\n setCvcPolicy(sfState.cvcPolicy);\n setShowSocialSecurityNumber(sfState.showSocialSecurityNumber);\n setExpiryDatePolicy(sfState.expiryDatePolicy);\n };\n\n // Farm the handlers for binLookup related functionality out to another 'extensions' file\n const extensions = useMemo(\n () =>\n CIExtensions(\n props,\n { sfp },\n {\n dualBrandSelectElements,\n setDualBrandSelectElements,\n setSelectedBrandValue,\n issuingCountryCode,\n setIssuingCountryCode\n },\n hasPanLengthRef\n ),\n [dualBrandSelectElements, issuingCountryCode]\n );\n\n /**\n * EXPOSE METHODS expected by Card.tsx\n */\n cardInputRef.current.showValidation = () => {\n // set flag\n isValidating.current = true;\n\n /**\n * Clear errors prior to validating so that the screenreader will read them *all* again, and in the right order\n * - only using aria-atomic on the error panel will read them in the wrong order\n */\n clearSRPanel?.(); // TODO - recheck if this is still true\n\n // Validate SecuredFields\n sfp.current.showValidation();\n\n // Validate holderName & SSN & KCP (taxNumber) but *not* billingAddress\n triggerValidation(['holderName', 'socialSecurityNumber', 'taxNumber']);\n\n // Validate Address\n if (billingAddressRef?.current) billingAddressRef.current.showValidation();\n };\n\n cardInputRef.current.processBinLookupResponse = (binLookupResponse: BinLookupResponse, isReset: boolean) => {\n extensions.processBinLookup(binLookupResponse, isReset);\n };\n\n cardInputRef.current.setStatus = setStatus;\n\n /**\n * EFFECT HOOKS\n */\n useEffect(() => {\n // componentDidMount - expose more methods expected by Card.tsx\n cardInputRef.current.setFocusOn = sfp.current.setFocusOn;\n cardInputRef.current.updateStyles = sfp.current.updateStyles;\n cardInputRef.current.handleUnsupportedCard = sfp.current.handleUnsupportedCard;\n\n // componentWillUnmount\n return () => {\n sfp.current.destroy();\n };\n }, []);\n\n /**\n * Handle form schema updates\n */\n useEffect(() => {\n const newSchema = [\n ...(props.hasHolderName ? ['holderName'] : []),\n ...(showBrazilianSSN ? ['socialSecurityNumber'] : []),\n ...(showKCP ? ['taxNumber'] : []),\n ...(showBillingAddress ? ['billingAddress'] : [])\n ];\n setSchema(newSchema);\n }, [props.hasHolderName, showBrazilianSSN, showKCP]);\n\n /**\n * Handle updates from useForm\n */\n useEffect(() => {\n setData({ ...data, holderName: formData.holderName ?? '', taxNumber: formData.taxNumber });\n\n setSocialSecurityNumber(formData.socialSecurityNumber);\n\n if (showBillingAddress) setBillingAddress({ ...formData.billingAddress });\n\n setValid({\n ...valid,\n holderName: props.holderNameRequired ? formValid.holderName : true,\n // Setting value to false if it's falsy keeps in line with existing, expected behaviour\n // - but there is an argument to allow 'undefined' as a value to indicate the non-presence of the field\n socialSecurityNumber: formValid.socialSecurityNumber ? formValid.socialSecurityNumber : false,\n taxNumber: formValid.taxNumber ? formValid.taxNumber : false,\n billingAddress: formValid.billingAddress ? formValid.billingAddress : false\n });\n\n // Check if billingAddress errors object has any properties that aren't null or undefined\n const addressHasErrors = formErrors.billingAddress\n ? Object.entries(formErrors.billingAddress).reduce((acc, [, error]) => acc || error != null, false)\n : false;\n\n // Errors\n setErrors({\n ...errors,\n holderName: props.holderNameRequired && !!formErrors.holderName ? formErrors.holderName : null,\n socialSecurityNumber: showBrazilianSSN && !!formErrors.socialSecurityNumber ? formErrors.socialSecurityNumber : null,\n taxNumber: showKCP && !!formErrors.taxNumber ? formErrors.taxNumber : null,\n billingAddress: showBillingAddress && addressHasErrors ? formErrors.billingAddress : null\n });\n }, [formData, formValid, formErrors]);\n\n // Use the custom hook to set (or clear) errors in the SRPanel\n const {\n sortedErrorList: currentErrorsSortedByLayout,\n previousSortedErrors,\n clearSRPanel\n } = useSRPanelForCardInputErrors({\n errors,\n props,\n isValidating,\n retrieveLayout,\n specifications,\n billingAddress,\n sfp\n });\n\n // Analytics: ValidationErrors\n if (currentErrorsSortedByLayout) {\n const newErrors = getArrayDifferences<SortedErrorObject, string>(currentErrorsSortedByLayout, previousSortedErrors, 'field');\n newErrors?.forEach(errorItem => {\n const aObj: FieldErrorAnalyticsObject = {\n fieldType: errorItem.field,\n errorCode: errorItem.errorCode\n };\n\n props.onValidationErrorAnalytics(aObj);\n });\n }\n\n /**\n * Main 'componentDidUpdate' handler\n */\n useEffect(() => {\n const holderNameValid: boolean = valid.holderName;\n\n const sfpValid: boolean = isSfpValid;\n const addressValid: boolean = showBillingAddress ? valid.billingAddress : true;\n\n const koreanAuthentication: boolean = showKCP ? !!valid.taxNumber && !!valid.encryptedPassword : true;\n\n const socialSecurityNumberValid: boolean = showBrazilianSSN ? !!valid.socialSecurityNumber : true;\n\n const isValid: boolean = sfpValid && holderNameValid && addressValid && koreanAuthentication && socialSecurityNumberValid;\n\n const sfStateErrorsObj = sfp.current.mapErrorsToValidationRuleResult();\n const mergedErrors = { ...errors, ...sfStateErrorsObj }; // maps sfErrors AND solves race condition problems for sfp from showValidation\n\n props.onChange({\n data,\n valid,\n errors: mergedErrors,\n isValid,\n billingAddress,\n selectedBrandValue,\n storePaymentMethod,\n socialSecurityNumber,\n installments\n });\n }, [data, valid, errors, selectedBrandValue, storePaymentMethod, installments]);\n\n /**\n * RENDER\n */\n const FieldToRender = props.storedPaymentMethodId ? StoredCardFieldsWrapper : CardFieldsWrapper;\n\n return (\n <Fragment>\n <SecuredFieldsProvider\n ref={sfp}\n {...extractPropsForSFP(props)}\n styles={{ ...props.styles }}\n koreanAuthenticationRequired={props.configuration.koreanAuthenticationRequired}\n hasKoreanFields={!!(props.configuration.koreanAuthenticationRequired && props.countryCode === 'kr')}\n onChange={handleSecuredFieldsChange}\n onBrand={onBrand}\n onFocus={handleFocus}\n type={props.brand}\n disableIOSArrowKeys={props.disableIOSArrowKeys ? handleTouchstartIOS : null}\n render={({ setRootNode, setFocusOn }, sfpState) => (\n <div\n ref={setRootNode}\n className={classNames({\n 'adyen-checkout__card-input': true,\n 'adyen-checkout-card-input__wrapper': true,\n [`adyen-checkout__card-input--${props.fundingSource ?? 'credit'}`]: true,\n 'adyen-checkout__card-input--loading': status === 'loading'\n })}\n role={'form'}\n >\n <FormInstruction />\n\n <FieldToRender\n // Extract exact props that we need to pass down\n {...extractPropsForCardFields(props)}\n // Pass on vars created in CardInput:\n // Base (shared w. StoredCard)\n data={data}\n valid={valid}\n errors={errors}\n handleChangeFor={handleChangeFor}\n focusedElement={focusedElement}\n setFocusOn={setFocusOn}\n sfpState={sfpState}\n cvcPolicy={cvcPolicy}\n hasInstallments={hasInstallments}\n showAmountsInInstallments={showAmountsInInstallments}\n handleInstallments={setInstallments}\n // For Card\n brandsIcons={props.brandsIcons}\n formData={formData}\n formErrors={formErrors}\n formValid={formValid}\n expiryDatePolicy={expiryDatePolicy}\n dualBrandSelectElements={dualBrandSelectElements}\n extensions={extensions}\n selectedBrandValue={selectedBrandValue}\n // For KCP\n showKCP={showKCP}\n // For SSN\n showBrazilianSSN={showBrazilianSSN}\n socialSecurityNumber={socialSecurityNumber}\n // For Store details\n handleOnStoreDetails={setStorePaymentMethod}\n // For Address\n setAddressRef={setAddressRef}\n billingAddress={billingAddress}\n billingAddressValidationRules={partialAddressSchema && getPartialAddressValidationRules(partialAddressCountry.current)}\n partialAddressSchema={partialAddressSchema}\n handleAddress={handleAddress}\n onAddressLookup={props.onAddressLookup}\n onAddressSelected={props.onAddressSelected}\n addressSearchDebounceMs={props.addressSearchDebounceMs}\n //\n iOSFocusedField={iOSFocusedField}\n //\n onFieldFocusAnalytics={onFieldFocusAnalytics}\n onFieldBlurAnalytics={onFieldBlurAnalytics}\n />\n </div>\n )}\n />\n\n {props.fastlaneConfiguration && (\n <FastlaneSignup\n {...props.fastlaneConfiguration}\n currentDetectedBrand={internallyDetectedBrand}\n onChange={props.onChange}\n onSubmitAnalytics={props.onSubmitAnalytics}\n />\n )}\n\n {props.showPayButton &&\n props.payButton({\n status,\n variant: props.isPayButtonPrimaryVariant ? 'primary' : 'secondary',\n icon: getImage({ imageFolder: 'components/' })(`${PREFIX}lock`)\n })}\n </Fragment>\n );\n};\n\nCardInput.defaultProps = defaultProps;\n\nexport default CardInput;\n"],"names":["CardInput","props","sfp","useRef","isValidating","getImage","useImage","billingAddressRef","setAddressRef","ref","current","cardInputRef","Object","keys","length","setComponentRef","hasPanLengthRef","isAutoJumping","specifications","useMemo","Specifications","status","setStatus","useState","errors","setErrors","valid","setValid","holderNameRequired","holderName","data","setData","hasHolderName","focusedElement","setFocusedElement","isSfpValid","setIsSfpValid","expiryDatePolicy","setExpiryDatePolicy","DATE_POLICY_REQUIRED","cvcPolicy","setCvcPolicy","CVC_POLICY_REQUIRED","issuingCountryCode","setIssuingCountryCode","dualBrandSelectElements","setDualBrandSelectElements","selectedBrandValue","setSelectedBrandValue","storedPaymentMethodId","brand","showBillingAddress","billingAddressMode","AddressModeOptions","none","billingAddressRequired","partialAddressSchema","handlePartialAddressMode","partialAddressCountry","billingAddress","country","storePaymentMethod","setStorePaymentMethod","setBillingAddress","showSocialSecurityNumber","setShowSocialSecurityNumber","socialSecurityNumber","setSocialSecurityNumber","installments","setInstallments","value","iOSFocusedField","setIOSFocusedField","internallyDetectedBrand","setInternallyDetectedBrand","handleChangeFor","triggerValidation","formData","formValid","formErrors","setSchema","setFormData","setFormValid","setFormErrors","useForm","schema","defaultData","formatters","cardInputFormatters","rules","cardInputValidationRules","hasInstallments","installmentOptions","fundingSource","showAmountsInInstallments","showInstallmentAmounts","isKorea","countryCode","showKCP","configuration","koreanAuthenticationRequired","showBrazilianSSN","socialSecurityNumberMode","onFieldFocusAnalytics","who","e","onFocus","fieldType","event","onFieldBlurAnalytics","onBlur","onBrand","useCallback","obj","handleFocus","getFocusHandler","retrieveLayout","getLayout","countrySpecificSchemas","getAddressSchemaForCountry","billingAddressRequiredFields","handleTouchstartIOS","elementType","name","handleAddress","getAddressHandler","doPanAutoJump","getAutoJumpHandler","extensions","CIExtensions","showValidation","clearSRPanel","processBinLookupResponse","binLookupResponse","isReset","processBinLookup","useEffect","setFocusOn","updateStyles","handleUnsupportedCard","destroy","newSchema","taxNumber","addressHasErrors","entries","reduce","acc","error","sortedErrorList","currentErrorsSortedByLayout","previousSortedErrors","useSRPanelForCardInputErrors","newErrors","getArrayDifferences","forEach","errorItem","aObj","field","errorCode","onValidationErrorAnalytics","holderNameValid","sfpValid","addressValid","koreanAuthentication","encryptedPassword","socialSecurityNumberValid","isValid","sfStateErrorsObj","mapErrorsToValidationRuleResult","mergedErrors","onChange","FieldToRender","StoredCardFieldsWrapper","CardFieldsWrapper","h","Fragment","SecuredFieldsProvider","extractPropsForSFP","styles","hasKoreanFields","sfState","eventDetails","autoCompleteName","acHolderName","getRuleByNameAndMode","holderNameValidationFn","autoFocus","ENCRYPTED_CARD_NUMBER","encryptedCardNumber","type","disableIOSArrowKeys","render","setRootNode","sfpState","div","className","classNames","role","FormInstruction","extractPropsForCardFields","handleInstallments","brandsIcons","handleOnStoreDetails","billingAddressValidationRules","getPartialAddressValidationRules","onAddressLookup","onAddressSelected","addressSearchDebounceMs","fastlaneConfiguration","FastlaneSignup","currentDetectedBrand","onSubmitAnalytics","showPayButton","payButton","variant","isPayButtonPrimaryVariant","icon","imageFolder","PREFIX","defaultProps"],"mappings":"0nDAgCA,MAAMA,EAAaC,IACf,MAAMC,EAAMC,EAAO,MACbC,EAAeD,GAAO,GACtBE,EAAWC,IAEXC,EAAoBJ,EAAO,MAC3BK,EAAgBC,IAClBF,EAAkBG,QAAUD,CAAAA,EAG1BE,EAAeR,EAAqB,IAErCS,OAAOC,KAAKF,EAAaD,SAASI,QACnCb,EAAMc,gBAAgBJ,EAAaD,SAGvC,MAAMM,EAAkBb,EAAO,GACzBc,EAAgBd,GAAO,GAEvBe,EAAiBC,GAAQ,IAAM,IAAIC,EAAenB,EAAMiB,iBAAiB,CAACjB,EAAMiB,iBAGtFP,EAAaD,QAAQR,IAAMA,EAK3B,MAAOmB,EAAQC,GAAaC,EAAS,UAE9BC,EAAQC,GAAaF,EAA8B,CAAA,IACnDG,EAAOC,GAAYJ,EAA8B,IAChDtB,EAAM2B,oBAAsB,CAAEC,YAAY,MAE3CC,EAAMC,GAAWR,EAA6B,IAC7CtB,EAAM+B,eAAiB,CAAEH,WAAY5B,EAAM6B,KAAKD,YAAc,OAG/DI,EAAgBC,IAAqBX,EAAS,KAC9CY,GAAYC,IAAiBb,GAAS,IACtCc,GAAkBC,IAAuBf,EAASgB,IAClDC,GAAWC,IAAgBlB,EAASmB,IACpCC,GAAoBC,IAAyBrB,EAAiB,OAE9DsB,GAAyBC,IAA8BvB,EAAS,KAChEwB,GAAoBC,IAAyBzB,EAAStB,EAAMgD,sBAAwBhD,EAA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WACtD,EAKhB1N,EAAU2N,aAAeA"}
|
|
1
|
+
{"version":3,"file":"CardInput.js","sources":["../../../../../../src/components/Card/components/CardInput/CardInput.tsx"],"sourcesContent":["import { h, Fragment } from 'preact';\nimport { useState, useEffect, useRef, useMemo, useCallback } from 'preact/hooks';\nimport SecuredFieldsProvider from '../../../internal/SecuredFields/SFP/SecuredFieldsProvider';\nimport { OnChangeEventDetails, SFPState } from '../../../internal/SecuredFields/SFP/types';\nimport defaultProps from './defaultProps';\nimport './CardInput.scss';\nimport { AddressModeOptions, CardInputDataState, CardInputErrorState, CardInputProps, CardInputRef, CardInputValidState } from './types';\nimport { CVC_POLICY_REQUIRED, DATE_POLICY_REQUIRED, ENCRYPTED_CARD_NUMBER } from '../../../internal/SecuredFields/lib/constants';\nimport { BinLookupResponse } from '../../types';\nimport { cardInputFormatters, cardInputValidationRules, getRuleByNameAndMode } from './validate';\nimport CIExtensions from '../../../internal/SecuredFields/binLookup/extensions';\nimport useForm from '../../../../utils/useForm';\nimport { SortedErrorObject } from '../../../../core/Errors/types';\nimport { handlePartialAddressMode, extractPropsForCardFields, extractPropsForSFP, getLayout } from './utils';\nimport Specifications from '../../../internal/Address/Specifications';\nimport { StoredCardFieldsWrapper } from './components/StoredCardFieldsWrapper';\nimport { CardFieldsWrapper } from './components/CardFieldsWrapper';\nimport { getAddressHandler, getAutoJumpHandler, getFocusHandler } from './handlers';\nimport { InstallmentsObj } from './components/Installments/Installments';\nimport { TouchStartEventObj } from './components/types';\nimport classNames from 'classnames';\nimport { getPartialAddressValidationRules } from '../../../internal/Address/validate';\nimport useImage from '../../../../core/Context/useImage';\nimport { getArrayDifferences } from '../../../../utils/arrayUtils';\nimport FormInstruction from '../../../internal/FormInstruction';\nimport { AddressData } from '../../../../types/global-types';\nimport { CardBrandData, CardFocusData } from '../../../internal/SecuredFields/lib/types';\nimport { PREFIX } from '../../../internal/Icon/constants';\nimport useSRPanelForCardInputErrors from './useSRPanelForCardInputErrors';\nimport FastlaneSignup from '../Fastlane/FastlaneSignup';\nimport { ANALYTICS_VALIDATION_ERROR_STR, ANALYTICS_DISPLAYED_STR, ANALYTICS_SELECTED_STR } from '../../../../core/Analytics/constants';\nimport { fieldTypeToSnakeCase } from '../../../internal/SecuredFields/utils';\nimport { getErrorMessageFromCode } from '../../../../core/Errors/utils';\nimport { SF_ErrorCodes } from '../../../../core/Errors/constants';\nimport { usePrevious } from '../../../../utils/hookUtils';\nimport { AnalyticsInfoEvent } from '../../../../core/Analytics/AnalyticsInfoEvent';\n\nconst DUAL_BRAND_BUTTON = 'dual_brand_button';\n\nconst CardInput = (props: CardInputProps) => {\n const sfp = useRef(null);\n const isValidating = useRef(false);\n const getImage = useImage();\n\n const billingAddressRef = useRef(null);\n const setAddressRef = ref => {\n billingAddressRef.current = ref;\n };\n\n const cardInputRef = useRef<CardInputRef>({});\n // Just call once to create the object by which we expose the members expected by the parent Card comp\n if (!Object.keys(cardInputRef.current).length) {\n props.setComponentRef(cardInputRef.current);\n }\n\n const hasPanLengthRef = useRef(0);\n const isAutoJumping = useRef(false);\n\n const specifications = useMemo(() => new Specifications(props.specifications), [props.specifications]);\n\n // Store ref to sfp (useful for 'deep' debugging)\n cardInputRef.current.sfp = sfp;\n\n /**\n * STATE HOOKS\n */\n const [status, setStatus] = useState('ready');\n\n const [errors, setErrors] = useState<CardInputErrorState>({});\n const [valid, setValid] = useState<CardInputValidState>({\n ...(props.holderNameRequired && { holderName: false })\n });\n const [data, setData] = useState<CardInputDataState>({\n ...(props.hasHolderName && { holderName: props.data.holderName ?? '' })\n });\n\n const [focusedElement, setFocusedElement] = useState('');\n const [isSfpValid, setIsSfpValid] = useState(false);\n const [expiryDatePolicy, setExpiryDatePolicy] = useState(DATE_POLICY_REQUIRED);\n const [cvcPolicy, setCvcPolicy] = useState(CVC_POLICY_REQUIRED);\n const [issuingCountryCode, setIssuingCountryCode] = useState<string>(null);\n\n const [dualBrandSelectElements, setDualBrandSelectElements] = useState([]);\n const [selectedBrandValue, setSelectedBrandValue] = useState(props.storedPaymentMethodId ? props.brand : ''); // If this is a storedCard comp initialise state with the storedCard's brand\n\n const showBillingAddress = props.billingAddressMode !== AddressModeOptions.none && props.billingAddressRequired;\n\n const partialAddressSchema = handlePartialAddressMode(props.billingAddressMode);\n // Keeps the value of the country set initially by the merchant, before the Address Component mutates it\n const partialAddressCountry = useRef<string>(partialAddressSchema && props.data?.billingAddress?.country);\n\n const [storePaymentMethod, setStorePaymentMethod] = useState(false);\n const [billingAddress, setBillingAddress] = useState<AddressData>(showBillingAddress ? props.data.billingAddress : null);\n const [showSocialSecurityNumber, setShowSocialSecurityNumber] = useState(false);\n const [socialSecurityNumber, setSocialSecurityNumber] = useState('');\n const [installments, setInstallments] = useState<InstallmentsObj>({ value: null });\n\n // re. Disable arrows for iOS: The name of the element calling for other elements to be disabled\n // - either a securedField type (like 'encryptedCardNumber') when call is coming from SF\n // or else the name of an internal, Adyen-web, element (like 'holderName')\n const [iOSFocusedField, setIOSFocusedField] = useState(null);\n\n /**\n * This stores the brand as detected by the internal regEx.\n * It eventually gets overwritten by the brand as detected by the /binLookup, but will revert back to the regEx detection\n * if the PAN length drops below the /binLookup digit threshold.\n * Default value, 'card', indicates no brand detected\n */\n const [internallyDetectedBrand, setInternallyDetectedBrand] = useState('card');\n\n /**\n * Used tho show and hide the pay button and instructions text\n * Should mimic the same logic as CardInput loading wrapper\n */\n const [showCardUIElements, setShowCardUIElements] = useState(false);\n\n /**\n * LOCAL VARS\n */\n const {\n handleChangeFor,\n triggerValidation,\n data: formData,\n valid: formValid,\n errors: formErrors,\n setSchema,\n setData: setFormData,\n setValid: setFormValid,\n setErrors: setFormErrors\n } = useForm<CardInputDataState>({\n schema: [],\n defaultData: props.data,\n formatters: cardInputFormatters,\n rules: cardInputValidationRules\n });\n\n const hasInstallments = !!Object.keys(props.installmentOptions).length && props.fundingSource !== 'debit';\n const showAmountsInInstallments = props.showInstallmentAmounts ?? true;\n\n const cardCountryCode: string = issuingCountryCode ?? props.countryCode;\n const isKorea = cardCountryCode === 'kr'; // If issuingCountryCode or the merchant defined countryCode is set to 'kr'\n const showKCP = props.configuration.koreanAuthenticationRequired && isKorea;\n\n const showBrazilianSSN: boolean =\n (showSocialSecurityNumber && props.configuration.socialSecurityNumberMode === 'auto') ||\n props.configuration.socialSecurityNumberMode === 'show';\n\n /**\n * HANDLERS\n */\n // Handlers for focus & blur on all fields. Can be renamed to onFieldFocus once the onFocusField is renamed in Field.tsx\n const onFieldFocusAnalytics = (who: string, e: Event | CardFocusData) => {\n props.onFocus({ fieldType: who, event: e });\n };\n const onFieldBlurAnalytics = (who: string, e: Event | CardFocusData) => {\n props.onBlur({ fieldType: who, event: e });\n };\n\n const onBrand = useCallback((obj: CardBrandData) => {\n setInternallyDetectedBrand(obj.brand);\n props.onBrand(obj);\n }, []);\n\n // Make SecuredFields aware of the focus & blur handlers\n const handleFocus = getFocusHandler(setFocusedElement, onFieldFocusAnalytics, onFieldBlurAnalytics);\n\n const retrieveLayout = (): string[] => {\n return getLayout({\n props,\n showKCP,\n showBrazilianSSN,\n ...(props.billingAddressRequired && {\n countrySpecificSchemas: specifications.getAddressSchemaForCountry(billingAddress?.country),\n billingAddressRequiredFields: props.billingAddressRequiredFields\n })\n });\n };\n\n /**\n * re. Disabling arrow keys in iOS:\n * Only by disabling all fields in the Card PM except for the active securedField input can we force the iOS soft keyboard arrow keys to disable\n *\n * NOTE: only called if ua.__IS_IOS = true && this.config.disableIOSArrowKeys = true (as referenced in CSF)\n *\n * @param obj - has fieldType prop saying whether this function is being called in response to an securedFields click ('encryptedCardNumber' etc)\n * - in which case we should disable all non-SF fields\n * or,\n * due to an internal action ('webInternalElement') - in which case we can enable all non-SF fields\n */\n const handleTouchstartIOS = useCallback((obj: TouchStartEventObj) => {\n const elementType = obj.fieldType !== 'webInternalElement' ? obj.fieldType : obj.name;\n setIOSFocusedField(elementType);\n }, []);\n\n const handleAddress = getAddressHandler(setFormData, setFormValid, setFormErrors);\n\n const doPanAutoJump = getAutoJumpHandler(isAutoJumping, sfp, retrieveLayout());\n\n const handleSecuredFieldsChange = (sfState: SFPState, eventDetails?: OnChangeEventDetails): void => {\n /**\n * Handling auto complete value for holderName (but only if the component is using a holderName field)\n */\n if (sfState.autoCompleteName) {\n if (!props.hasHolderName) return;\n const holderNameValidationFn = getRuleByNameAndMode('holderName', 'blur');\n const acHolderName = holderNameValidationFn(sfState.autoCompleteName) ? sfState.autoCompleteName : null;\n if (acHolderName) {\n setFormData('holderName', acHolderName);\n setFormValid('holderName', true); // only if holderName is valid does this fny get called - so we know it's valid and w/o error\n setFormErrors('holderName', null);\n }\n return;\n }\n\n /**\n * Decide if we can shift focus to the expiryDate field.\n *\n * We can if... the config prop, autoFocus, is true AND we have a panLength value from binLookup\n * AND we are responding to a handleOnFieldValid message about the PAN that says it is valid\n */\n if (\n props.autoFocus &&\n hasPanLengthRef.current > 0 &&\n eventDetails?.event === 'handleOnFieldValid' &&\n eventDetails?.fieldType === ENCRYPTED_CARD_NUMBER &&\n sfState.valid.encryptedCardNumber\n ) {\n doPanAutoJump();\n }\n\n /**\n * Process SFP state\n */\n setData({ ...data, ...sfState.data });\n setErrors({ ...errors, ...sfState.errors });\n setValid({ ...valid, ...sfState.valid });\n\n setIsSfpValid(sfState.isSfpValid);\n\n // Values relating to /binLookup response\n setCvcPolicy(sfState.cvcPolicy);\n setShowSocialSecurityNumber(sfState.showSocialSecurityNumber);\n setExpiryDatePolicy(sfState.expiryDatePolicy);\n };\n\n /**\n * Listen to the full SecureFieldsProvider state and handle actions\n * Used right now to mimic the loading status changes, this can only be done this way\n * Trying to do it via onConfiguSuccess or onChange has side effects\n */\n const handleSFPStateUpdate = useCallback(\n sfpState => {\n mimicLoadingStatusChange(sfpState);\n },\n [showCardUIElements, setShowCardUIElements]\n );\n\n /**\n * This function implements the same logic that LoadingProvider uses to show and hide elements\n * We want to mimic this behavior so we can hide and show the pay button or the instructions text\n * Deciding to do it this way since we garante there's no DOM changes to merchants\n * We can break this in the next major version (v7)\n */\n const mimicLoadingStatusChange = sfpState => {\n if (!sfpState.status) return;\n if (sfpState.status == 'loading') {\n setShowCardUIElements(false);\n } else {\n setShowCardUIElements(true);\n }\n };\n\n // Farm the handlers for binLookup related functionality out to another 'extensions' file\n const extensions = useMemo(\n () =>\n CIExtensions(\n props,\n { sfp },\n {\n dualBrandSelectElements,\n setDualBrandSelectElements,\n setSelectedBrandValue,\n issuingCountryCode,\n setIssuingCountryCode\n },\n hasPanLengthRef\n ),\n [dualBrandSelectElements, issuingCountryCode]\n );\n\n /**\n * EXPOSE METHODS expected by Card.tsx\n */\n cardInputRef.current.showValidation = () => {\n // set flag\n isValidating.current = true;\n\n /**\n * Clear errors prior to validating so that the screenreader will read them *all* again, and in the right order\n * - only using aria-atomic on the error panel will read them in the wrong order\n */\n clearSRPanel?.(); // TODO - recheck if this is still true\n\n // Validate SecuredFields\n sfp.current.showValidation();\n\n // Validate holderName & SSN & KCP (taxNumber) but *not* billingAddress\n triggerValidation(['holderName', 'socialSecurityNumber', 'taxNumber']);\n\n // Validate Address\n if (billingAddressRef?.current) billingAddressRef.current.showValidation();\n };\n\n cardInputRef.current.processBinLookupResponse = (binLookupResponse: BinLookupResponse, isReset: boolean) => {\n extensions.processBinLookup(binLookupResponse, isReset);\n };\n\n cardInputRef.current.setStatus = setStatus;\n\n /**\n * EFFECT HOOKS\n */\n useEffect(() => {\n // componentDidMount - expose more methods expected by Card.tsx\n cardInputRef.current.setFocusOn = sfp.current.setFocusOn;\n cardInputRef.current.updateStyles = sfp.current.updateStyles;\n cardInputRef.current.handleUnsupportedCard = sfp.current.handleUnsupportedCard;\n\n // componentWillUnmount\n return () => {\n sfp.current.destroy();\n };\n }, []);\n\n /**\n * Handle form schema updates\n */\n useEffect(() => {\n const newSchema = [\n ...(props.hasHolderName ? ['holderName'] : []),\n ...(showBrazilianSSN ? ['socialSecurityNumber'] : []),\n ...(showKCP ? ['taxNumber'] : []),\n ...(showBillingAddress ? ['billingAddress'] : [])\n ];\n setSchema(newSchema);\n }, [props.hasHolderName, showBrazilianSSN, showKCP]);\n\n /**\n * Handle updates from useForm\n */\n useEffect(() => {\n setData({ ...data, holderName: formData.holderName ?? '', taxNumber: formData.taxNumber });\n\n setSocialSecurityNumber(formData.socialSecurityNumber);\n\n if (showBillingAddress) setBillingAddress({ ...formData.billingAddress });\n\n setValid({\n ...valid,\n holderName: props.holderNameRequired ? formValid.holderName : true,\n // Setting value to false if it's falsy keeps in line with existing, expected behaviour\n // - but there is an argument to allow 'undefined' as a value to indicate the non-presence of the field\n socialSecurityNumber: formValid.socialSecurityNumber ? formValid.socialSecurityNumber : false,\n taxNumber: formValid.taxNumber ? formValid.taxNumber : false,\n billingAddress: formValid.billingAddress ? formValid.billingAddress : false\n });\n\n // Check if billingAddress errors object has any properties that aren't null or undefined\n const addressHasErrors = formErrors.billingAddress\n ? Object.entries(formErrors.billingAddress).reduce((acc, [, error]) => acc || error != null, false)\n : false;\n\n // Errors\n setErrors({\n ...errors,\n holderName: props.holderNameRequired && !!formErrors.holderName ? formErrors.holderName : null,\n socialSecurityNumber: showBrazilianSSN && !!formErrors.socialSecurityNumber ? formErrors.socialSecurityNumber : null,\n taxNumber: showKCP && !!formErrors.taxNumber ? formErrors.taxNumber : null,\n billingAddress: showBillingAddress && addressHasErrors ? formErrors.billingAddress : null\n });\n }, [formData, formValid, formErrors]);\n\n // Use the custom hook to set (or clear) errors in the SRPanel\n const {\n sortedErrorList: currentErrorsSortedByLayout,\n previousSortedErrors,\n clearSRPanel\n } = useSRPanelForCardInputErrors({\n errors,\n props,\n isValidating,\n retrieveLayout,\n specifications,\n billingAddress,\n sfp\n });\n\n // Analytics: ValidationErrors\n useEffect(() => {\n if (currentErrorsSortedByLayout) {\n const newErrors = getArrayDifferences<SortedErrorObject, string>(currentErrorsSortedByLayout, previousSortedErrors, 'field');\n\n newErrors?.forEach(errorItem => {\n const event = new AnalyticsInfoEvent({\n type: ANALYTICS_VALIDATION_ERROR_STR,\n target: fieldTypeToSnakeCase(errorItem.field),\n validationErrorCode: errorItem.errorCode,\n validationErrorMessage: getErrorMessageFromCode(errorItem.errorCode, SF_ErrorCodes)\n });\n props.onSubmitAnalytics(event);\n });\n }\n }, [currentErrorsSortedByLayout]);\n\n /**\n * Main 'componentDidUpdate' handler\n */\n useEffect(() => {\n const holderNameValid: boolean = valid.holderName;\n\n const sfpValid: boolean = isSfpValid;\n const addressValid: boolean = showBillingAddress ? valid.billingAddress : true;\n\n const koreanAuthentication: boolean = showKCP ? !!valid.taxNumber && !!valid.encryptedPassword : true;\n\n const socialSecurityNumberValid: boolean = showBrazilianSSN ? !!valid.socialSecurityNumber : true;\n\n const isValid: boolean = sfpValid && holderNameValid && addressValid && koreanAuthentication && socialSecurityNumberValid;\n\n const sfStateErrorsObj = sfp.current.mapErrorsToValidationRuleResult();\n const mergedErrors = { ...errors, ...sfStateErrorsObj }; // maps sfErrors AND solves race condition problems for sfp from showValidation\n\n props.onChange({\n data,\n valid,\n errors: mergedErrors,\n isValid,\n billingAddress,\n selectedBrandValue,\n storePaymentMethod,\n socialSecurityNumber,\n installments\n });\n }, [data, valid, errors, selectedBrandValue, storePaymentMethod, installments]);\n\n /**\n * \"Update\" handler related to dual brand buttons being initially displayed\n */\n useEffect(() => {\n if (dualBrandSelectElements.length > 0 && dualBrandSelectElements) {\n const dualBrandsArr = dualBrandSelectElements.map(item => item.id);\n const brand = dualBrandsArr[0]; // initially selected brand\n const dualBrands = dualBrandsArr.toString();\n\n const event = new AnalyticsInfoEvent({\n type: ANALYTICS_DISPLAYED_STR,\n target: DUAL_BRAND_BUTTON,\n brand,\n configData: { dualBrands }\n });\n\n props.onSubmitAnalytics(event);\n }\n }, [dualBrandSelectElements]);\n\n const previousSelectedBrandValue = usePrevious(selectedBrandValue);\n\n /**\n * \"Update\" handler related to a dual brand button being selected\n */\n useEffect(() => {\n if (previousSelectedBrandValue?.length && selectedBrandValue?.length) {\n const event = new AnalyticsInfoEvent({ type: ANALYTICS_SELECTED_STR, target: DUAL_BRAND_BUTTON, brand: selectedBrandValue });\n\n props.onSubmitAnalytics(event);\n }\n }, [selectedBrandValue]);\n\n /**\n * RENDER\n */\n const FieldToRender = props.storedPaymentMethodId ? StoredCardFieldsWrapper : CardFieldsWrapper;\n\n return (\n <Fragment>\n <SecuredFieldsProvider\n ref={sfp}\n {...extractPropsForSFP(props)}\n styles={{ ...props.styles }}\n koreanAuthenticationRequired={props.configuration.koreanAuthenticationRequired}\n hasKoreanFields={!!(props.configuration.koreanAuthenticationRequired && props.countryCode === 'kr')}\n onChange={handleSecuredFieldsChange}\n onBrand={onBrand}\n onFocus={handleFocus}\n onStateUpdate={handleSFPStateUpdate}\n type={props.brand}\n disableIOSArrowKeys={props.disableIOSArrowKeys ? handleTouchstartIOS : null}\n render={({ setRootNode, setFocusOn }, sfpState) => (\n <div\n ref={setRootNode}\n className={classNames({\n 'adyen-checkout__card-input': true,\n 'adyen-checkout-card-input__wrapper': true,\n [`adyen-checkout__card-input--${props.fundingSource ?? 'credit'}`]: true,\n 'adyen-checkout__card-input--loading': status === 'loading'\n })}\n role={'form'}\n >\n {showCardUIElements && <FormInstruction />}\n\n <FieldToRender\n // Extract exact props that we need to pass down\n {...extractPropsForCardFields(props)}\n // Pass on vars created in CardInput:\n // Base (shared w. StoredCard)\n data={data}\n valid={valid}\n errors={errors}\n handleChangeFor={handleChangeFor}\n focusedElement={focusedElement}\n setFocusOn={setFocusOn}\n sfpState={sfpState}\n cvcPolicy={cvcPolicy}\n hasInstallments={hasInstallments}\n showAmountsInInstallments={showAmountsInInstallments}\n handleInstallments={setInstallments}\n // For Card\n brandsIcons={props.brandsIcons}\n formData={formData}\n formErrors={formErrors}\n formValid={formValid}\n expiryDatePolicy={expiryDatePolicy}\n dualBrandSelectElements={dualBrandSelectElements}\n extensions={extensions}\n selectedBrandValue={selectedBrandValue}\n // For KCP\n showKCP={showKCP}\n // For SSN\n showBrazilianSSN={showBrazilianSSN}\n socialSecurityNumber={socialSecurityNumber}\n // For Store details\n handleOnStoreDetails={setStorePaymentMethod}\n // For Address\n setAddressRef={setAddressRef}\n billingAddress={billingAddress}\n billingAddressValidationRules={partialAddressSchema && getPartialAddressValidationRules(partialAddressCountry.current)}\n partialAddressSchema={partialAddressSchema}\n handleAddress={handleAddress}\n onAddressLookup={props.onAddressLookup}\n onAddressSelected={props.onAddressSelected}\n addressSearchDebounceMs={props.addressSearchDebounceMs}\n //\n iOSFocusedField={iOSFocusedField}\n //\n onFieldFocusAnalytics={onFieldFocusAnalytics}\n onFieldBlurAnalytics={onFieldBlurAnalytics}\n />\n </div>\n )}\n />\n\n {props.fastlaneConfiguration && (\n <FastlaneSignup\n {...props.fastlaneConfiguration}\n currentDetectedBrand={internallyDetectedBrand}\n onChange={props.onChange}\n onSubmitAnalytics={props.onSubmitAnalytics}\n />\n )}\n\n {showCardUIElements &&\n props.showPayButton &&\n props.payButton({\n status,\n variant: props.isPayButtonPrimaryVariant ? 'primary' : 'secondary',\n icon: getImage({ imageFolder: 'components/' })(`${PREFIX}lock`)\n })}\n </Fragment>\n );\n};\n\nCardInput.defaultProps = defaultProps;\n\nexport default CardInput;\n"],"names":["DUAL_BRAND_BUTTON","CardInput","props","sfp","useRef","isValidating","getImage","useImage","billingAddressRef","setAddressRef","ref","current","cardInputRef","Object","keys","length","setComponentRef","hasPanLengthRef","isAutoJumping","specifications","useMemo","Specifications","status","setStatus","useState","errors","setErrors","valid","setValid","holderNameRequired","holderName","data","setData","hasHolderName","focusedElement","setFocusedElement","isSfpValid","setIsSfpValid","expiryDatePolicy","setExpiryDatePolicy","DATE_POLICY_REQUIRED","cvcPolicy","setCvcPolicy","CVC_POLICY_REQUIRED","issuingCountryCode","setIssuingCountryCode","dualBrandSelectElements","setDualBrandSelectElements","selectedBrandValue","setSelectedBrandValue","storedPaymentMethodId","brand","showBillingAddress","billingAddressMode","AddressModeOptions","none","billingAddressRequired","partialAddressSchema","handlePartialAddressMode","partialAddressCountry","billingAddress","country","storePaymentMethod","setStorePaymentMethod","setBillingAddress","showSocialSecurityNumber","setShowSocialSecurityNumber","socialSecurityNumber","setSocialSecurityNumber","installments","setInstallments","value","iOSFocusedField","setIOSFocusedField","internallyDetectedBrand","setInternallyDetectedBrand","showCardUIElements","setShowCardUIElements","handleChangeFor","triggerValidation","formData","formValid","formErrors","setSchema","setFormData","setFormValid","setFormErrors","useForm","schema","defaultData","formatters","cardInputFormatters","rules","cardInputValidationRules","hasInstallments","installmentOptions","fundingSource","showAmountsInInstallments","showInstallmentAmounts","isKorea","countryCode","showKCP","configuration","koreanAuthenticationRequired","showBrazilianSSN","socialSecurityNumberMode","onFieldFocusAnalytics","who","e","onFocus","fieldType","event","onFieldBlurAnalytics","onBlur","onBrand","useCallback","obj","handleFocus","getFocusHandler","retrieveLayout","getLayout","countrySpecificSchemas","getAddressSchemaForCountry","billingAddressRequiredFields","handleTouchstartIOS","elementType","name","handleAddress","getAddressHandler","doPanAutoJump","getAutoJumpHandler","handleSFPStateUpdate","sfpState","mimicLoadingStatusChange","extensions","CIExtensions","showValidation","clearSRPanel","processBinLookupResponse","binLookupResponse","isReset","processBinLookup","useEffect","setFocusOn","updateStyles","handleUnsupportedCard","destroy","newSchema","taxNumber","addressHasErrors","entries","reduce","acc","error","sortedErrorList","currentErrorsSortedByLayout","previousSortedErrors","useSRPanelForCardInputErrors","newErrors","getArrayDifferences","forEach","errorItem","AnalyticsInfoEvent","type","ANALYTICS_VALIDATION_ERROR_STR","target","fieldTypeToSnakeCase","field","validationErrorCode","errorCode","validationErrorMessage","getErrorMessageFromCode","SF_ErrorCodes","onSubmitAnalytics","holderNameValid","sfpValid","addressValid","koreanAuthentication","encryptedPassword","socialSecurityNumberValid","isValid","sfStateErrorsObj","mapErrorsToValidationRuleResult","mergedErrors","onChange","dualBrandsArr","map","item","id","dualBrands","toString","ANALYTICS_DISPLAYED_STR","configData","previousSelectedBrandValue","usePrevious","ANALYTICS_SELECTED_STR","FieldToRender","StoredCardFieldsWrapper","CardFieldsWrapper","h","Fragment","SecuredFieldsProvider","extractPropsForSFP","styles","hasKoreanFields","sfState","eventDetails","autoCompleteName","acHolderName","getRuleByNameAndMode","holderNameValidationFn","autoFocus","ENCRYPTED_CARD_NUMBER","encryptedCardNumber","onStateUpdate","disableIOSArrowKeys","render","setRootNode","div","className","classNames","role","FormInstruction","extractPropsForCardFields","handleInstallments","brandsIcons","handleOnStoreDetails","billingAddressValidationRules","getPartialAddressValidationRules","onAddressLookup","onAddressSelected","addressSearchDebounceMs","fastlaneConfiguration","FastlaneSignup","currentDetectedBrand","showPayButton","payButton","variant","isPayButtonPrimaryVariant","icon","imageFolder","PREFIX","defaultProps"],"mappings":"+nEAqCA,MAAMA,EAAoB,oBAEpBC,EAAaC,IACf,MAAMC,EAAMC,EAAO,MACbC,EAAeD,GAAO,GACtBE,EAAWC,IAEXC,EAAoBJ,EAAO,MAC3BK,EAAgBC,IAClBF,EAAkBG,QAAUD,CAAAA,EAG1BE,EAAeR,EAAqB,IAErCS,OAAOC,KAAKF,EAAaD,SAASI,QACnCb,EAAMc,gBAAgBJ,EAAaD,SAGvC,MAAMM,EAAkBb,EAAO,GACzBc,EAAgBd,GAAO,GAEvBe,EAAiBC,GAAQ,IAAM,IAAIC,EAAenB,EAAMiB,iBAAiB,CAACjB,EAAMiB,iBAGtFP,EAAaD,QAAQR,IAAMA,EAK3B,MAAOmB,GAAQC,IAAaC,EAAS,UAE9BC,GAAQC,IAAaF,EAA8B,CAAA,IACnDG,GAAOC,IAAYJ,EAA8B,IAChDtB,EAAM2B,oBAAsB,CAAEC,YAAY,MAE3CC,GAAMC,IAAWR,EAA6B,IAC7CtB,EAAM+B,eAAiB,CAAEH,WAAY5B,EAAM6B,KAAKD,YAAc,OAG/DI,GAAgBC,IAAqBX,EAAS,KAC9CY,GAAYC,IAAiBb,GAAS,IACtCc,GAAkBC,IAAuBf,EAASgB,IAClDC,GAAWC,IAAgBlB,EAASmB,IACpCC,GAAoBC,IAAyBrB,EAAiB,OAE9DsB,GA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,GAAAA,IAEO2B,EAA0B7N,GAG9B6B,KAAMA,GACNJ,MAAOA,GACPF,OAAQA,GACRqD,gBAAiBA,GACjB5C,eAAgBA,GAChB6G,WAAYA,EACZX,SAAUA,EACV3F,UAAWA,GACXqD,gBAAiBA,GACjBG,0BAA2BA,GAC3B+H,mBAAoB1J,GAEpB2J,YAAa/N,EAAM+N,YACnBjJ,SAAUA,GACVE,WAAYA,GACZD,UAAWA,GACX3C,iBAAkBA,GAClBQ,wBAAyBA,GACzBwF,WAAYA,GACZtF,mBAAoBA,GAEpBqD,QAASA,GAETG,iBAAkBA,GAClBrC,qBAAsBA,GAEtB+J,qBAAsBnK,GAEtBtD,cAAeA,EACfmD,eAAgBA,GAChBuK,8BAA+B1K,IAAwB2K,EAAiCzK,GAAsBhD,SAC9G8C,qBAAsBA,GACtBsE,cAAeA,GACfsG,gBAAiBnO,EAAMmO,gBACvBC,kBAAmBpO,EAAMoO,kBACzBC,wBAAyBrO,EAAMqO,wBAE/B/J,gBAAiBA,GAEjBkC,sBAAuBA,GACvBM,qBAAsBA,QAMrC9G,EAAMsO,uBACHjC,EAACkC,EAAAA,IACOvO,EAAMsO,sBACVE,qBAAsBhK,GACtB8G,SAAUtL,EAAMsL,SAChBX,kBAAmB3K,EAAM2K,oBAIhCjG,IACG1E,EAAMyO,eACNzO,EAAM0O,UAAU,CACZtN,UACAuN,QAAS3O,EAAM4O,0BAA4B,UAAY,YACvDC,KAAMzO,EAAS,CAAE0O,YAAa,eAAxB1O,CAAyC,GAAG2O,WACtD,EAKhBhP,EAAUiP,aAAeA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createElement as e}from"../../../../../external/preact/dist/preact.js";import r from"./CardNumber.js";import t from"./CVC.js";import a from"./ExpirationDate.js";import{useCoreContext as d}from"../../../../../core/Context/CoreProvider.js";import
|
|
1
|
+
import{createElement as e}from"../../../../../external/preact/dist/preact.js";import r from"./CardNumber.js";import t from"./CVC.js";import a from"./ExpirationDate.js";import{useCoreContext as d}from"../../../../../core/Context/CoreProvider.js";import c from"../../../../../_virtual/index.js";import{BRAND_ICON_UI_EXCLUSION_LIST as o,ENCRYPTED_CARD_NUMBER as i,DATE_POLICY_HIDDEN as n,ENCRYPTED_EXPIRY_DATE as l,ENCRYPTED_SECURITY_CODE as s}from"../../../../internal/SecuredFields/lib/constants.js";import u from"./AvailableBrands/AvailableBrands.js";function p({brand:p,brandsIcons:m,brandsConfiguration:y,dualBrandingElements:x,errors:C,focusedElement:f,hasCVC:_,cvcPolicy:b,expiryDatePolicy:h,onFocusField:g,showBrandIcon:v,valid:E,showContextualElement:F}){const{i18n:N}=d(),j=(e,r)=>e[r]?N.get(e[r]):null,B=m?.filter((e=>!o?.includes(e.name))),k="amex"===p,w=k?N.get("creditCard.securityCode.contextualText.4digits"):N.get("creditCard.securityCode.contextualText.3digits");return e("div",{className:"adyen-checkout__card__form"},e(r,{brand:p,brandsConfiguration:y,error:j(C,i),focused:f===i,isValid:!!E.encryptedCardNumber,label:N.get("creditCard.cardNumber.label"),onFocusField:g,filled:!!C.encryptedCardNumber||!!E.encryptedCardNumber,showBrandIcon:v,dualBrandingElements:x}),e(u,{activeBrand:p,brands:B}),e("div",{className:c("adyen-checkout__card__exp-cvc adyen-checkout__field-wrapper",{"adyen-checkout__card__exp-cvc__exp-date__input--hidden":h===n})},e(a,{error:j(C,l),focused:f===l,isValid:!!E.encryptedExpiryMonth&&!!E.encryptedExpiryYear,filled:!!C.encryptedExpiryDate||!!E.encryptedExpiryYear,label:N.get("creditCard.expiryDate.label"),onFocusField:g,className:"adyen-checkout__field--50",expiryDatePolicy:h,showContextualElement:F,contextualText:N.get("creditCard.expiryDate.contextualText")}),_&&e(t,{error:j(C,s),focused:f===s,cvcPolicy:b,isValid:!!E.encryptedSecurityCode,filled:!!C.encryptedSecurityCode||!!E.encryptedSecurityCode,label:N.get("creditCard.securityCode.label"),onFocusField:g,className:"adyen-checkout__field--50",frontCVC:k,showContextualElement:F,contextualText:w})))}export{p as default};
|
|
2
2
|
//# sourceMappingURL=CardFields.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardFields.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/CardFields.tsx"],"sourcesContent":["import { h } from 'preact';\nimport CardNumber from './CardNumber';\nimport CVC from './CVC';\nimport ExpirationDate from './ExpirationDate';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport { CardFieldsProps } from './types';\nimport classNames from 'classnames';\nimport {\n BRAND_ICON_UI_EXCLUSION_LIST,\n DATE_POLICY_HIDDEN,\n ENCRYPTED_CARD_NUMBER,\n ENCRYPTED_EXPIRY_DATE,\n ENCRYPTED_SECURITY_CODE\n} from '../../../../internal/SecuredFields/lib/constants';\nimport AvailableBrands from './AvailableBrands';\n\nexport default function CardFields({\n brand,\n brandsIcons,\n brandsConfiguration,\n dualBrandingElements,\n
|
|
1
|
+
{"version":3,"file":"CardFields.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/CardFields.tsx"],"sourcesContent":["import { h } from 'preact';\nimport CardNumber from './CardNumber';\nimport CVC from './CVC';\nimport ExpirationDate from './ExpirationDate';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport { CardFieldsProps } from './types';\nimport classNames from 'classnames';\nimport {\n BRAND_ICON_UI_EXCLUSION_LIST,\n DATE_POLICY_HIDDEN,\n ENCRYPTED_CARD_NUMBER,\n ENCRYPTED_EXPIRY_DATE,\n ENCRYPTED_SECURITY_CODE\n} from '../../../../internal/SecuredFields/lib/constants';\nimport AvailableBrands from './AvailableBrands';\n\nexport default function CardFields({\n brand,\n brandsIcons,\n brandsConfiguration,\n dualBrandingElements,\n errors,\n focusedElement,\n hasCVC,\n cvcPolicy,\n expiryDatePolicy,\n onFocusField,\n showBrandIcon,\n valid,\n showContextualElement\n}: CardFieldsProps) {\n const { i18n } = useCoreContext();\n\n const getError = (errors, fieldType) => {\n return errors[fieldType] ? i18n.get(errors[fieldType]) : null;\n };\n\n // A set of brands filtered to exclude those that can never appear in the UI\n const allowedBrands = brandsIcons?.filter(brandsIcons => !BRAND_ICON_UI_EXCLUSION_LIST?.includes(brandsIcons.name));\n const isAmex = brand === 'amex';\n const cvcContextualText = isAmex\n ? i18n.get('creditCard.securityCode.contextualText.4digits')\n : i18n.get('creditCard.securityCode.contextualText.3digits');\n\n return (\n <div className=\"adyen-checkout__card__form\">\n <CardNumber\n brand={brand}\n brandsConfiguration={brandsConfiguration}\n error={getError(errors, ENCRYPTED_CARD_NUMBER)}\n focused={focusedElement === ENCRYPTED_CARD_NUMBER}\n isValid={!!valid.encryptedCardNumber}\n label={i18n.get('creditCard.cardNumber.label')}\n onFocusField={onFocusField}\n filled={!!errors.encryptedCardNumber || !!valid.encryptedCardNumber}\n showBrandIcon={showBrandIcon}\n dualBrandingElements={dualBrandingElements}\n />\n\n <AvailableBrands activeBrand={brand} brands={allowedBrands} />\n\n <div\n className={classNames('adyen-checkout__card__exp-cvc adyen-checkout__field-wrapper', {\n 'adyen-checkout__card__exp-cvc__exp-date__input--hidden': expiryDatePolicy === DATE_POLICY_HIDDEN\n })}\n >\n <ExpirationDate\n error={getError(errors, ENCRYPTED_EXPIRY_DATE)}\n focused={focusedElement === ENCRYPTED_EXPIRY_DATE}\n isValid={!!valid.encryptedExpiryMonth && !!valid.encryptedExpiryYear}\n filled={!!errors.encryptedExpiryDate || !!valid.encryptedExpiryYear}\n label={i18n.get('creditCard.expiryDate.label')}\n onFocusField={onFocusField}\n className={'adyen-checkout__field--50'}\n expiryDatePolicy={expiryDatePolicy}\n showContextualElement={showContextualElement}\n contextualText={i18n.get('creditCard.expiryDate.contextualText')}\n />\n\n {hasCVC && (\n <CVC\n error={getError(errors, ENCRYPTED_SECURITY_CODE)}\n focused={focusedElement === ENCRYPTED_SECURITY_CODE}\n cvcPolicy={cvcPolicy}\n isValid={!!valid.encryptedSecurityCode}\n filled={!!errors.encryptedSecurityCode || !!valid.encryptedSecurityCode}\n label={i18n.get('creditCard.securityCode.label')}\n onFocusField={onFocusField}\n className={'adyen-checkout__field--50'}\n frontCVC={isAmex}\n showContextualElement={showContextualElement}\n contextualText={cvcContextualText}\n />\n )}\n </div>\n </div>\n );\n}\n"],"names":["CardFields","brand","brandsIcons","brandsConfiguration","dualBrandingElements","errors","focusedElement","hasCVC","cvcPolicy","expiryDatePolicy","onFocusField","showBrandIcon","valid","showContextualElement","i18n","useCoreContext","getError","fieldType","get","allowedBrands","filter","BRAND_ICON_UI_EXCLUSION_LIST","includes","name","isAmex","cvcContextualText","h","div","className","CardNumber","error","ENCRYPTED_CARD_NUMBER","focused","isValid","encryptedCardNumber","label","filled","AvailableBrands","activeBrand","brands","classNames","DATE_POLICY_HIDDEN","ExpirationDate","ENCRYPTED_EXPIRY_DATE","encryptedExpiryMonth","encryptedExpiryYear","encryptedExpiryDate","contextualText","CVC","ENCRYPTED_SECURITY_CODE","encryptedSecurityCode","frontCVC"],"mappings":"uiBAgBe,SAASA,GAAWC,MAC/BA,EAAKC,YACLA,EAAWC,oBACXA,EAAmBC,qBACnBA,EAAoBC,OACpBA,EAAMC,eACNA,EAAcC,OACdA,EAAMC,UACNA,EAASC,iBACTA,EAAgBC,aAChBA,EAAYC,cACZA,EAAaC,MACbA,EAAKC,sBACLA,IAEA,MAAMC,KAAEA,GAASC,IAEXC,EAAW,CAACX,EAAQY,IACfZ,EAAOY,GAAaH,EAAKI,IAAIb,EAAOY,IAAc,KAIvDE,EAAgBjB,GAAakB,QAAOlB,IAAgBmB,GAA8BC,SAASpB,EAAYqB,QACvGC,EAAmB,SAAVvB,EACTwB,EAAoBD,EACpBV,EAAKI,IAAI,kDACTJ,EAAKI,IAAI,kDAEf,OACIQ,EAACC,MAAAA,CAAIC,UAAU,8BACXF,EAACG,EAAAA,CACG5B,MAAOA,EACPE,oBAAqBA,EACrB2B,MAAOd,EAASX,EAAQ0B,GACxBC,QAAS1B,IAAmByB,EAC5BE,UAAWrB,EAAMsB,oBACjBC,MAAOrB,EAAKI,IAAI,+BAChBR,aAAcA,EACd0B,SAAU/B,EAAO6B,uBAAyBtB,EAAMsB,oBAChDvB,cAAeA,EACfP,qBAAsBA,IAG1BsB,EAACW,EAAAA,CAAgBC,YAAarC,EAAOsC,OAAQpB,IAE7CO,EAACC,MAAAA,CACGC,UAAWY,EAAW,8DAA+D,CACjF,yDAA0D/B,IAAqBgC,KAGnFf,EAACgB,EAAAA,CACGZ,MAAOd,EAASX,EAAQsC,GACxBX,QAAS1B,IAAmBqC,EAC5BV,UAAWrB,EAAMgC,wBAA0BhC,EAAMiC,oBACjDT,SAAU/B,EAAOyC,uBAAyBlC,EAAMiC,oBAChDV,MAAOrB,EAAKI,IAAI,+BAChBR,aAAcA,EACdkB,UAAW,4BACXnB,iBAAkBA,EAClBI,sBAAuBA,EACvBkC,eAAgBjC,EAAKI,IAAI,0CAG5BX,GACGmB,EAACsB,EAAAA,CACGlB,MAAOd,EAASX,EAAQ4C,GACxBjB,QAAS1B,IAAmB2C,EAC5BzC,UAAWA,EACXyB,UAAWrB,EAAMsC,sBACjBd,SAAU/B,EAAO6C,yBAA2BtC,EAAMsC,sBAClDf,MAAOrB,EAAKI,IAAI,iCAChBR,aAAcA,EACdkB,UAAW,4BACXuB,SAAU3B,EACVX,sBAAuBA,EACvBkC,eAAgBtB,KAMxC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createElement as e}from"../../../../../external/preact/dist/preact.js";import r from"../../../../internal/LoadingWrapper/LoadingWrapper.js";import
|
|
1
|
+
import{createElement as e}from"../../../../../external/preact/dist/preact.js";import r from"../../../../internal/LoadingWrapper/LoadingWrapper.js";import s from"./CardFields.js";import a from"./KCPAuthentication.js";import l from"../../../../internal/SocialSecurityNumberBrazil/SocialSecurityNumberBrazil.js";import o from"../../../../internal/StoreDetails/StoreDetails.js";import i from"../../../../internal/Address/Address.js";import n from"./CardHolderName.js";import t from"./Installments/Installments.js";import d from"../../../../internal/DisclaimerMessage/DisclaimerMessage.js";import u from"../../../../internal/FormFields/RadioGroupExtended/RadioGroupExtended.js";import{mapDualBrandButtons as c}from"../utils.js";import m from"../../../../internal/FormFields/Fieldset/Fieldset.js";import{useCoreContext as p}from"../../../../../core/Context/CoreProvider.js";const h=({data:h,valid:b,errors:F,handleChangeFor:y,sfpState:N,setFocusOn:S,cvcPolicy:f,focusedElement:A,hasInstallments:C,handleInstallments:g,showAmountsInInstallments:x,brandsIcons:B,formData:w,formErrors:v,formValid:j,expiryDatePolicy:D,dualBrandSelectElements:I,extensions:E,selectedBrandValue:P,showKCP:k,showBrazilianSSN:O,socialSecurityNumber:R,handleOnStoreDetails:q,billingAddress:V,handleAddress:M,setAddressRef:T,partialAddressSchema:L,onAddressLookup:_,onAddressSelected:z,addressSearchDebounceMs:H,amount:G,billingAddressRequired:K,billingAddressRequiredFields:W,billingAddressAllowedCountries:$,billingAddressValidationRules:J=null,brandsConfiguration:Q,showStoreDetailsCheckbox:U,hasCVC:X,hasHolderName:Y,holderNameRequired:Z,installmentOptions:ee,placeholders:re,positionHolderNameOnTop:se,showBrandIcon:ae,showContextualElement:le,iOSFocusedField:oe,disclaimerMessage:ie,onFieldFocusAnalytics:ne,onFieldBlurAnalytics:te})=>{const{i18n:de}=p(),ue=e(n,{required:Z,placeholder:re.holderName,value:w.holderName,error:!!v.holderName&&Z,isValid:!!j.holderName,onBlur:y("holderName","blur"),onInput:y("holderName","input"),disabled:oe&&"holderName"!==oe,onFieldFocusAnalytics:ne,onFieldBlurAnalytics:te});return e(r,{status:N.status},Y&&se&&ue,e(s,{showBrandIcon:ae,showContextualElement:le,brand:N.brand,brandsIcons:B,brandsConfiguration:Q,focusedElement:A,onFocusField:S,hasCVC:X,cvcPolicy:f,expiryDatePolicy:D,errors:N.errors,valid:N.valid,dualBrandingElements:I.length>0&&I}),Y&&!se&&ue,I.length>0&&I&&e(m,{classNameModifiers:["dual-brand-switcher"],label:de.get("creditCard.dualBrand.title")},e("p",{className:"adyen-checkout-form-instruction"},de.get("creditCard.dualBrand.description")),e(u,{name:"dualBrandSwitcher",value:P,items:c(I,Q),onChange:E.handleDualBrandSelection,required:!0,showSelectedTick:!0})),k&&e(a,{onFocusField:S,focusedElement:A,encryptedPasswordState:{data:N.encryptedPassword,valid:!!N.valid&&N.valid.encryptedPassword,errors:!!N.errors&&N.errors.encryptedPassword},value:h.taxNumber,error:!!F.taxNumber,isValid:!!b.taxNumber,onBlur:y("taxNumber","blur"),onInput:y("taxNumber","input"),disabled:oe&&"kcpTaxNumberOrDOB"!==oe,placeholder:re.taxNumber,onFieldFocusAnalytics:ne,onFieldBlurAnalytics:te}),O&&e("div",{className:"adyen-checkout__card__socialSecurityNumber"},e(l,{onBlur:y("socialSecurityNumber","blur"),onInput:y("socialSecurityNumber","input"),error:F?.socialSecurityNumber,valid:b?.socialSecurityNumber,data:R,required:!0,disabled:oe&&"socialSecurityNumber"!==oe,onFieldFocusAnalytics:ne,onFieldBlurAnalytics:te})),U&&e(o,{onChange:q}),C&&e(t,{amount:G,brand:N.brand,installmentOptions:ee,onChange:g,type:x?"amount":"months"}),K&&e(i,{label:"billingAddress",data:V,onChange:M,allowedCountries:$,requiredFields:W,setComponentRef:T,validationRules:J,specifications:L,iOSFocusedField:oe,onAddressLookup:_,showContextualElement:le,onAddressSelected:z,addressSearchDebounceMs:H,onFieldFocusAnalytics:ne,onFieldBlurAnalytics:te}),ie&&e(d,{message:ie.message.replace("%{linkText}",`%#${ie.linkText}%#`),urls:[ie.link]}))};export{h as CardFieldsWrapper};
|
|
2
2
|
//# sourceMappingURL=CardFieldsWrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardFieldsWrapper.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/CardFieldsWrapper.tsx"],"sourcesContent":["import { h } from 'preact';\nimport LoadingWrapper from '../../../../internal/LoadingWrapper';\nimport CardFields from './CardFields';\nimport KCPAuthentication from './KCPAuthentication';\nimport SocialSecurityNumberBrazil from '../../../../internal/SocialSecurityNumberBrazil/SocialSecurityNumberBrazil';\nimport StoreDetails from '../../../../internal/StoreDetails';\nimport Address from '../../../../internal/Address';\nimport CardHolderName from './CardHolderName';\nimport Installments from './Installments';\nimport DisclaimerMessage from '../../../../internal/DisclaimerMessage';\n\nexport const CardFieldsWrapper = ({\n // vars created in CardInput:\n // base (shared)\n data,\n valid,\n errors,\n handleChangeFor,\n sfpState,\n setFocusOn,\n cvcPolicy,\n focusedElement,\n hasInstallments,\n handleInstallments,\n showAmountsInInstallments,\n // Card\n brandsIcons,\n formData,\n formErrors,\n formValid,\n expiryDatePolicy,\n dualBrandSelectElements,\n extensions,\n selectedBrandValue,\n // KCP\n showKCP,\n // SSN\n showBrazilianSSN,\n socialSecurityNumber,\n // Store details\n handleOnStoreDetails,\n // Address\n billingAddress,\n handleAddress,\n setAddressRef,\n partialAddressSchema,\n onAddressLookup,\n onAddressSelected,\n addressSearchDebounceMs,\n // For this comp (props passed through from CardInput)\n amount,\n billingAddressRequired,\n billingAddressRequiredFields,\n billingAddressAllowedCountries,\n billingAddressValidationRules = null,\n brandsConfiguration,\n showStoreDetailsCheckbox,\n hasCVC,\n hasHolderName,\n holderNameRequired,\n installmentOptions,\n placeholders,\n positionHolderNameOnTop,\n // For CardFields > CardNumber\n showBrandIcon,\n showContextualElement,\n //\n iOSFocusedField,\n disclaimerMessage,\n //\n onFieldFocusAnalytics,\n onFieldBlurAnalytics\n}) => {\n const cardHolderField = (\n <CardHolderName\n required={holderNameRequired}\n placeholder={placeholders.holderName}\n value={formData.holderName}\n error={!!formErrors.holderName && holderNameRequired}\n isValid={!!formValid.holderName}\n onBlur={handleChangeFor('holderName', 'blur')}\n onInput={handleChangeFor('holderName', 'input')}\n disabled={iOSFocusedField && iOSFocusedField !== 'holderName'}\n onFieldFocusAnalytics={onFieldFocusAnalytics}\n onFieldBlurAnalytics={onFieldBlurAnalytics}\n />\n );\n\n return (\n <LoadingWrapper status={sfpState.status}>\n {hasHolderName && positionHolderNameOnTop && cardHolderField}\n\n <CardFields\n showBrandIcon={showBrandIcon}\n showContextualElement={showContextualElement}\n brand={sfpState.brand}\n brandsIcons={brandsIcons}\n brandsConfiguration={brandsConfiguration}\n focusedElement={focusedElement}\n onFocusField={setFocusOn}\n hasCVC={hasCVC}\n cvcPolicy={cvcPolicy}\n expiryDatePolicy={expiryDatePolicy}\n errors={sfpState.errors}\n valid={sfpState.valid}\n dualBrandingElements={dualBrandSelectElements.length > 0 && dualBrandSelectElements}\n dualBrandingChangeHandler={extensions.handleDualBrandSelection}\n dualBrandingSelected={selectedBrandValue}\n />\n\n {hasHolderName && !positionHolderNameOnTop && cardHolderField}\n\n {showKCP && (\n <KCPAuthentication\n onFocusField={setFocusOn}\n focusedElement={focusedElement}\n encryptedPasswordState={{\n data: sfpState.encryptedPassword,\n valid: sfpState.valid ? sfpState.valid.encryptedPassword : false,\n errors: sfpState.errors ? sfpState.errors.encryptedPassword : false\n }}\n value={data.taxNumber}\n error={!!errors.taxNumber}\n isValid={!!valid.taxNumber}\n onBlur={handleChangeFor('taxNumber', 'blur')}\n onInput={handleChangeFor('taxNumber', 'input')}\n disabled={iOSFocusedField && iOSFocusedField !== 'kcpTaxNumberOrDOB'}\n placeholder={placeholders.taxNumber}\n onFieldFocusAnalytics={onFieldFocusAnalytics}\n onFieldBlurAnalytics={onFieldBlurAnalytics}\n />\n )}\n\n {showBrazilianSSN && (\n <div className=\"adyen-checkout__card__socialSecurityNumber\">\n <SocialSecurityNumberBrazil\n onBlur={handleChangeFor('socialSecurityNumber', 'blur')}\n onInput={handleChangeFor('socialSecurityNumber', 'input')}\n error={errors?.socialSecurityNumber}\n valid={valid?.socialSecurityNumber}\n data={socialSecurityNumber}\n required={true}\n disabled={iOSFocusedField && iOSFocusedField !== 'socialSecurityNumber'}\n onFieldFocusAnalytics={onFieldFocusAnalytics}\n onFieldBlurAnalytics={onFieldBlurAnalytics}\n />\n </div>\n )}\n\n {showStoreDetailsCheckbox && <StoreDetails onChange={handleOnStoreDetails} />}\n\n {hasInstallments && (\n <Installments\n amount={amount}\n brand={sfpState.brand}\n installmentOptions={installmentOptions}\n onChange={handleInstallments}\n type={showAmountsInInstallments ? 'amount' : 'months'}\n />\n )}\n\n {billingAddressRequired && (\n <Address\n label=\"billingAddress\"\n data={billingAddress}\n onChange={handleAddress}\n allowedCountries={billingAddressAllowedCountries}\n requiredFields={billingAddressRequiredFields}\n setComponentRef={setAddressRef}\n validationRules={billingAddressValidationRules}\n specifications={partialAddressSchema}\n iOSFocusedField={iOSFocusedField}\n onAddressLookup={onAddressLookup}\n showContextualElement={showContextualElement}\n onAddressSelected={onAddressSelected}\n addressSearchDebounceMs={addressSearchDebounceMs}\n onFieldFocusAnalytics={onFieldFocusAnalytics}\n onFieldBlurAnalytics={onFieldBlurAnalytics}\n />\n )}\n\n {disclaimerMessage && (\n <DisclaimerMessage\n message={disclaimerMessage.message.replace('%{linkText}', `%#${disclaimerMessage.linkText}%#`)}\n urls={[disclaimerMessage.link]}\n />\n )}\n </LoadingWrapper>\n );\n};\n"],"names":["CardFieldsWrapper","data","valid","errors","handleChangeFor","sfpState","setFocusOn","cvcPolicy","focusedElement","hasInstallments","handleInstallments","showAmountsInInstallments","brandsIcons","formData","formErrors","formValid","expiryDatePolicy","dualBrandSelectElements","extensions","selectedBrandValue","showKCP","showBrazilianSSN","socialSecurityNumber","handleOnStoreDetails","billingAddress","handleAddress","setAddressRef","partialAddressSchema","onAddressLookup","onAddressSelected","addressSearchDebounceMs","amount","billingAddressRequired","billingAddressRequiredFields","billingAddressAllowedCountries","billingAddressValidationRules","brandsConfiguration","showStoreDetailsCheckbox","hasCVC","hasHolderName","holderNameRequired","installmentOptions","placeholders","positionHolderNameOnTop","showBrandIcon","showContextualElement","iOSFocusedField","disclaimerMessage","onFieldFocusAnalytics","onFieldBlurAnalytics","cardHolderField","h","CardHolderName","required","placeholder","holderName","value","error","isValid","onBlur","onInput","disabled","LoadingWrapper","status","CardFields","brand","onFocusField","dualBrandingElements","length","dualBrandingChangeHandler","handleDualBrandSelection","dualBrandingSelected","KCPAuthentication","encryptedPasswordState","encryptedPassword","taxNumber","div","className","SocialSecurityNumberBrazil","StoreDetails","onChange","Installments","type","Address","label","allowedCountries","requiredFields","setComponentRef","validationRules","specifications","DisclaimerMessage","message","replace","linkText","urls","link"],"mappings":"ykBAWaA,MAAAA,EAAoB,EAG7BC,OACAC,QACAC,SACAC,kBACAC,WACAC,aACAC,YACAC,iBACAC,kBACAC,qBACAC,4BAEAC,cACAC,WACAC,aACAC,YACAC,mBACAC,0BACAC,aACAC,qBAEAC,UAEAC,mBACAC,uBAEAC,uBAEAC,iBACAC,gBACAC,gBACAC,uBACAC,kBACAC,oBACAC,0BAEAC,SACAC,yBACAC,+BACAC,iCACAC,gCAAgC,KAChCC,sBACAC,2BACAC,SACAC,gBACAC,qBACAC,qBACAC,eACAC,0BAEAC,gBACAC,yBAEAC,mBACAC,qBAEAC,yBACAC,4BAEA,MAAMC,GACFC,EAACC,EAAAA,CACGC,SAAUb,EACVc,YAAaZ,EAAaa,WAC1BC,MAAO3C,EAAS0C,WAChBE,QAAS3C,EAAWyC,YAAcf,EAClCkB,UAAW3C,EAAUwC,WACrBI,OAAQvD,EAAgB,aAAc,QACtCwD,QAASxD,EAAgB,aAAc,SACvCyD,SAAUf,IAAuC,eAApBA,GAC7BE,sBAAuBA,GACvBC,qBAAsBA,KAI9B,OACIE,EAACW,EAAAA,CAAeC,OAAQ1D,EAAS0D,QAC5BxB,GAAiBI,GAA2BO,GAE7CC,EAACa,EAAAA,CACGpB,cAAeA,EACfC,sBAAuBA,GACvBoB,MAAO5D,EAAS4D,MAChBrD,YAAaA,EACbwB,oBAAqBA,EACrB5B,eAAgBA,EAChB0D,aAAc5D,EACdgC,OAAQA,EACR/B,UAAWA,EACXS,iBAAkBA,EAClBb,OAAQE,EAASF,OACjBD,MAAOG,EAASH,MAChBiE,qBAAsBlD,EAAwBmD,OAAS,GAAKnD,EAC5DoD,0BAA2BnD,EAAWoD,yBACtCC,qBAAsB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QAAS5C,GAAkB4C,QAAQC,QAAQ,cAAe,KAAK7C,GAAkB8C,cACjFC,KAAM,CAAC/C,GAAkBgD"}
|
|
1
|
+
{"version":3,"file":"CardFieldsWrapper.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/CardFieldsWrapper.tsx"],"sourcesContent":["import { h } from 'preact';\nimport LoadingWrapper from '../../../../internal/LoadingWrapper';\nimport CardFields from './CardFields';\nimport KCPAuthentication from './KCPAuthentication';\nimport SocialSecurityNumberBrazil from '../../../../internal/SocialSecurityNumberBrazil/SocialSecurityNumberBrazil';\nimport StoreDetails from '../../../../internal/StoreDetails';\nimport Address from '../../../../internal/Address';\nimport CardHolderName from './CardHolderName';\nimport Installments from './Installments';\nimport DisclaimerMessage from '../../../../internal/DisclaimerMessage';\nimport RadioGroupExtended from '../../../../internal/FormFields/RadioGroupExtended';\nimport { mapDualBrandButtons } from '../utils';\nimport Fieldset from '../../../../internal/FormFields/Fieldset';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\n\nexport const CardFieldsWrapper = ({\n // vars created in CardInput:\n // base (shared)\n data,\n valid,\n errors,\n handleChangeFor,\n sfpState,\n setFocusOn,\n cvcPolicy,\n focusedElement,\n hasInstallments,\n handleInstallments,\n showAmountsInInstallments,\n // Card\n brandsIcons,\n formData,\n formErrors,\n formValid,\n expiryDatePolicy,\n dualBrandSelectElements,\n extensions,\n selectedBrandValue,\n // KCP\n showKCP,\n // SSN\n showBrazilianSSN,\n socialSecurityNumber,\n // Store details\n handleOnStoreDetails,\n // Address\n billingAddress,\n handleAddress,\n setAddressRef,\n partialAddressSchema,\n onAddressLookup,\n onAddressSelected,\n addressSearchDebounceMs,\n // For this comp (props passed through from CardInput)\n amount,\n billingAddressRequired,\n billingAddressRequiredFields,\n billingAddressAllowedCountries,\n billingAddressValidationRules = null,\n brandsConfiguration,\n showStoreDetailsCheckbox,\n hasCVC,\n hasHolderName,\n holderNameRequired,\n installmentOptions,\n placeholders,\n positionHolderNameOnTop,\n // For CardFields > CardNumber\n showBrandIcon,\n showContextualElement,\n //\n iOSFocusedField,\n disclaimerMessage,\n //\n onFieldFocusAnalytics,\n onFieldBlurAnalytics\n}) => {\n const { i18n } = useCoreContext();\n\n const cardHolderField = (\n <CardHolderName\n required={holderNameRequired}\n placeholder={placeholders.holderName}\n value={formData.holderName}\n error={!!formErrors.holderName && holderNameRequired}\n isValid={!!formValid.holderName}\n onBlur={handleChangeFor('holderName', 'blur')}\n onInput={handleChangeFor('holderName', 'input')}\n disabled={iOSFocusedField && iOSFocusedField !== 'holderName'}\n onFieldFocusAnalytics={onFieldFocusAnalytics}\n onFieldBlurAnalytics={onFieldBlurAnalytics}\n />\n );\n\n return (\n <LoadingWrapper status={sfpState.status}>\n {hasHolderName && positionHolderNameOnTop && cardHolderField}\n\n <CardFields\n showBrandIcon={showBrandIcon}\n showContextualElement={showContextualElement}\n brand={sfpState.brand}\n brandsIcons={brandsIcons}\n brandsConfiguration={brandsConfiguration}\n focusedElement={focusedElement}\n onFocusField={setFocusOn}\n hasCVC={hasCVC}\n cvcPolicy={cvcPolicy}\n expiryDatePolicy={expiryDatePolicy}\n errors={sfpState.errors}\n valid={sfpState.valid}\n dualBrandingElements={dualBrandSelectElements.length > 0 && dualBrandSelectElements}\n />\n\n {hasHolderName && !positionHolderNameOnTop && cardHolderField}\n\n {dualBrandSelectElements.length > 0 && dualBrandSelectElements && (\n <Fieldset classNameModifiers={['dual-brand-switcher']} label={i18n.get('creditCard.dualBrand.title')}>\n <p className={'adyen-checkout-form-instruction'}>{i18n.get('creditCard.dualBrand.description')}</p>\n <RadioGroupExtended\n name={'dualBrandSwitcher'}\n value={selectedBrandValue} // Set which button is in a selected (checked) state\n items={mapDualBrandButtons(dualBrandSelectElements, brandsConfiguration)}\n onChange={extensions.handleDualBrandSelection}\n required={true}\n showSelectedTick={true}\n />\n </Fieldset>\n )}\n\n {showKCP && (\n <KCPAuthentication\n onFocusField={setFocusOn}\n focusedElement={focusedElement}\n encryptedPasswordState={{\n data: sfpState.encryptedPassword,\n valid: sfpState.valid ? sfpState.valid.encryptedPassword : false,\n errors: sfpState.errors ? sfpState.errors.encryptedPassword : false\n }}\n value={data.taxNumber}\n error={!!errors.taxNumber}\n isValid={!!valid.taxNumber}\n onBlur={handleChangeFor('taxNumber', 'blur')}\n onInput={handleChangeFor('taxNumber', 'input')}\n disabled={iOSFocusedField && iOSFocusedField !== 'kcpTaxNumberOrDOB'}\n placeholder={placeholders.taxNumber}\n onFieldFocusAnalytics={onFieldFocusAnalytics}\n onFieldBlurAnalytics={onFieldBlurAnalytics}\n />\n )}\n\n {showBrazilianSSN && (\n <div className=\"adyen-checkout__card__socialSecurityNumber\">\n <SocialSecurityNumberBrazil\n onBlur={handleChangeFor('socialSecurityNumber', 'blur')}\n onInput={handleChangeFor('socialSecurityNumber', 'input')}\n error={errors?.socialSecurityNumber}\n valid={valid?.socialSecurityNumber}\n data={socialSecurityNumber}\n required={true}\n disabled={iOSFocusedField && iOSFocusedField !== 'socialSecurityNumber'}\n onFieldFocusAnalytics={onFieldFocusAnalytics}\n onFieldBlurAnalytics={onFieldBlurAnalytics}\n />\n </div>\n )}\n\n {showStoreDetailsCheckbox && <StoreDetails onChange={handleOnStoreDetails} />}\n\n {hasInstallments && (\n <Installments\n amount={amount}\n brand={sfpState.brand}\n installmentOptions={installmentOptions}\n onChange={handleInstallments}\n type={showAmountsInInstallments ? 'amount' : 'months'}\n />\n )}\n\n {billingAddressRequired && (\n <Address\n label=\"billingAddress\"\n data={billingAddress}\n onChange={handleAddress}\n allowedCountries={billingAddressAllowedCountries}\n requiredFields={billingAddressRequiredFields}\n setComponentRef={setAddressRef}\n validationRules={billingAddressValidationRules}\n specifications={partialAddressSchema}\n iOSFocusedField={iOSFocusedField}\n onAddressLookup={onAddressLookup}\n showContextualElement={showContextualElement}\n onAddressSelected={onAddressSelected}\n addressSearchDebounceMs={addressSearchDebounceMs}\n onFieldFocusAnalytics={onFieldFocusAnalytics}\n onFieldBlurAnalytics={onFieldBlurAnalytics}\n />\n )}\n\n {disclaimerMessage && (\n <DisclaimerMessage\n message={disclaimerMessage.message.replace('%{linkText}', `%#${disclaimerMessage.linkText}%#`)}\n urls={[disclaimerMessage.link]}\n />\n )}\n </LoadingWrapper>\n );\n};\n"],"names":["CardFieldsWrapper","data","valid","errors","handleChangeFor","sfpState","setFocusOn","cvcPolicy","focusedElement","hasInstallments","handleInstallments","showAmountsInInstallments","brandsIcons","formData","formErrors","formValid","expiryDatePolicy","dualBrandSelectElements","extensions","selectedBrandValue","showKCP","showBrazilianSSN","socialSecurityNumber","handleOnStoreDetails","billingAddress","handleAddress","setAddressRef","partialAddressSchema","onAddressLookup","onAddressSelected","addressSearchDebounceMs","amount","billingAddressRequired","billingAddressRequiredFields","billingAddressAllowedCountries","billingAddressValidationRules","brandsConfiguration","showStoreDetailsCheckbox","hasCVC","hasHolderName","holderNameRequired","installmentOptions","placeholders","positionHolderNameOnTop","showBrandIcon","showContextualElement","iOSFocusedField","disclaimerMessage","onFieldFocusAnalytics","onFieldBlurAnalytics","i18n","useCoreContext","cardHolderField","h","CardHolderName","required","placeholder","holderName","value","error","isValid","onBlur","onInput","disabled","LoadingWrapper","status","CardFields","brand","onFocusField","dualBrandingElements","length","Fieldset","classNameModifiers","label","get","p","className","RadioGroupExtended","name","items","mapDualBrandButtons","onChange","handleDualBrandSelection","showSelectedTick","KCPAuthentication","encryptedPasswordState","encryptedPassword","taxNumber","div","SocialSecurityNumberBrazil","StoreDetails","Installments","type","Address","allowedCountries","requiredFields","setComponentRef","validationRules","specifications","DisclaimerMessage","message","replace","linkText","urls","link"],"mappings":"o2BAeaA,MAAAA,EAAoB,EAG7BC,OACAC,QACAC,SACAC,kBACAC,WACAC,aACAC,YACAC,iBACAC,kBACAC,qBACAC,4BAEAC,cACAC,WACAC,aACAC,YACAC,mBACAC,0BACAC,aACAC,qBAEAC,UAEAC,mBACAC,uBAEAC,uBAEAC,iBACAC,gBACAC,gBACAC,uBACAC,kBACAC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|
1
|
-
import{createElement as e}from"../../../../../external/preact/dist/preact.js";import
|
|
1
|
+
import{createElement as e}from"../../../../../external/preact/dist/preact.js";import r from"../../../../../_virtual/index.js";import n from"./BrandIcon.js";import a from"./DualBrandingIcon/DualBrandingIcon.js";import o from"../../../../internal/FormFields/Field/Field.js";import{useCoreContext as i}from"../../../../../core/Context/CoreProvider.js";import d from"./DataSfSpan.js";import{ENCRYPTED_CARD_NUMBER as t}from"../../../../internal/SecuredFields/lib/constants.js";import{alternativeLabelContent as c}from"./FieldLabelAlternative.js";function l(l){const{i18n:s}=i(),{error:u="",isValid:m=!1,onFocusField:_=()=>{},dualBrandingElements:f}=l,p=()=>{_(t)};return e(o,{label:l.label,focused:l.focused,filled:l.filled,classNameModifiers:["cardNumber"],onFocusField:()=>_(t),errorMessage:u,isValid:m,dir:"ltr",name:t,showValidIcon:!1,i18n:s,contextVisibleToScreenReader:!1,useLabelElement:!1,renderAlternativeToLabel:c},e(d,{encryptedFieldType:t,className:r({"adyen-checkout__input":!0,"adyen-checkout__input--large":!0,"adyen-checkout__card__cardNumber__input":!0,"adyen-checkout__input--error":u,"adyen-checkout__input--focus":l.focused,"adyen-checkout__input--valid":m,"adyen-checkout__card__cardNumber__input--noBrand":!l.showBrandIcon})}),l.showBrandIcon&&!f&&e(n,{brandsConfiguration:l.brandsConfiguration,brand:l.brand,onClick:p}),f&&!u&&e("div",{className:r(["adyen-checkout__card__dual-branding__icons"])},f.map((r=>e(a,{key:r.id,brand:r.id,brandsConfiguration:l.brandsConfiguration,dataValue:r.id,onClick:p})))))}export{l as default};
|
|
2
2
|
//# sourceMappingURL=CardNumber.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardNumber.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/CardNumber.tsx"],"sourcesContent":["import { h } from 'preact';\nimport classNames from 'classnames';\nimport BrandIcon from './BrandIcon';\nimport DualBrandingIcon from './DualBrandingIcon/DualBrandingIcon';\nimport Field from '../../../../internal/FormFields/Field';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport { CardNumberProps } from './types';\nimport DataSfSpan from './DataSfSpan';\nimport { ENCRYPTED_CARD_NUMBER } from '../../../../internal/SecuredFields/lib/constants';\nimport { alternativeLabelContent } from './FieldLabelAlternative';\n\nexport default function CardNumber(props: CardNumberProps) {\n const { i18n } = useCoreContext();\n const { error = '', isValid = false, onFocusField = () => {}, dualBrandingElements
|
|
1
|
+
{"version":3,"file":"CardNumber.js","sources":["../../../../../../../src/components/Card/components/CardInput/components/CardNumber.tsx"],"sourcesContent":["import { h } from 'preact';\nimport classNames from 'classnames';\nimport BrandIcon from './BrandIcon';\nimport DualBrandingIcon from './DualBrandingIcon/DualBrandingIcon';\nimport Field from '../../../../internal/FormFields/Field';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport { CardNumberProps } from './types';\nimport DataSfSpan from './DataSfSpan';\nimport { ENCRYPTED_CARD_NUMBER } from '../../../../internal/SecuredFields/lib/constants';\nimport { alternativeLabelContent } from './FieldLabelAlternative';\n\nexport default function CardNumber(props: CardNumberProps) {\n const { i18n } = useCoreContext();\n const { error = '', isValid = false, onFocusField = () => {}, dualBrandingElements } = props;\n\n const handleIconClick = () => {\n onFocusField(ENCRYPTED_CARD_NUMBER);\n };\n\n return (\n <Field\n label={props.label}\n focused={props.focused}\n filled={props.filled}\n classNameModifiers={['cardNumber']}\n onFocusField={() => onFocusField(ENCRYPTED_CARD_NUMBER)}\n errorMessage={error}\n isValid={isValid}\n dir={'ltr'}\n name={ENCRYPTED_CARD_NUMBER}\n showValidIcon={false}\n i18n={i18n}\n contextVisibleToScreenReader={false} // securedFields have their own, internal, aria-describedby element\n useLabelElement={false}\n renderAlternativeToLabel={alternativeLabelContent}\n >\n <DataSfSpan\n encryptedFieldType={ENCRYPTED_CARD_NUMBER}\n className={classNames({\n 'adyen-checkout__input': true,\n 'adyen-checkout__input--large': true,\n 'adyen-checkout__card__cardNumber__input': true,\n 'adyen-checkout__input--error': error,\n 'adyen-checkout__input--focus': props.focused,\n 'adyen-checkout__input--valid': isValid,\n 'adyen-checkout__card__cardNumber__input--noBrand': !props.showBrandIcon\n })}\n ></DataSfSpan>\n\n {props.showBrandIcon && !dualBrandingElements && (\n <BrandIcon brandsConfiguration={props.brandsConfiguration} brand={props.brand} onClick={handleIconClick} />\n )}\n\n {dualBrandingElements && !error && (\n <div className={classNames(['adyen-checkout__card__dual-branding__icons'])}>\n {dualBrandingElements.map(element => (\n <DualBrandingIcon\n key={element.id}\n brand={element.id}\n brandsConfiguration={props.brandsConfiguration}\n dataValue={element.id}\n onClick={handleIconClick}\n />\n ))}\n </div>\n )}\n </Field>\n );\n}\n"],"names":["CardNumber","props","i18n","useCoreContext","error","isValid","onFocusField","dualBrandingElements","handleIconClick","ENCRYPTED_CARD_NUMBER","h","Field","label","focused","filled","classNameModifiers","errorMessage","dir","name","showValidIcon","contextVisibleToScreenReader","useLabelElement","renderAlternativeToLabel","alternativeLabelContent","DataSfSpan","encryptedFieldType","className","classNames","showBrandIcon","BrandIcon","brandsConfiguration","brand","onClick","div","map","element","DualBrandingIcon","key","id","dataValue"],"mappings":"6hBAWe,SAASA,EAAWC,GAC/B,MAAMC,KAAEA,GAASC,KACXC,MAAEA,EAAQ,GAAEC,QAAEA,GAAU,EAAKC,aAAEA,EAAe,OAAQC,qBAAEA,GAAyBN,EAEjFO,EAAkB,KACpBF,EAAaG,EAAAA,EAGjB,OACIC,EAACC,EAAAA,CACGC,MAAOX,EAAMW,MACbC,QAASZ,EAAMY,QACfC,OAAQb,EAAMa,OACdC,mBAAoB,CAAC,cACrBT,aAAc,IAAMA,EAAaG,GACjCO,aAAcZ,EACdC,QAASA,EACTY,IAAK,MACLC,KAAMT,EACNU,eAAe,EACfjB,KAAMA,EACNkB,8BAA8B,EAC9BC,iBAAiB,EACjBC,yBAA0BC,GAE1Bb,EAACc,EAAAA,CACGC,mBAAoBhB,EACpBiB,UAAWC,EAAW,CAClB,yBAAyB,EACzB,gCAAgC,EAChC,2CAA2C,EAC3C,+BAAgCvB,EAChC,+BAAgCH,EAAMY,QACtC,+BAAgCR,EAChC,oDAAqDJ,EAAM2B,kBAIlE3B,EAAM2B,gBAAkBrB,GACrBG,EAACmB,EAAAA,CAAUC,oBAAqB7B,EAAM6B,oBAAqBC,MAAO9B,EAAM8B,MAAOC,QAASxB,IAG3FD,IAAyBH,GACtBM,EAACuB,MAAAA,CAAIP,UAAWC,EAAW,CAAC,gDACvBpB,EAAqB2B,KAAIC,GACtBzB,EAAC0B,EAAAA,CACGC,IAAKF,EAAQG,GACbP,MAAOI,EAAQG,GACfR,oBAAqB7B,EAAM6B,oBAC3BS,UAAWJ,EAAQG,GACnBN,QAASxB,OAOrC"}
|
package/dist/es/components/Card/components/CardInput/components/DualBrandingIcon/DualBrandingIcon.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createElement as
|
|
1
|
+
import{createElement as a}from"../../../../../../external/preact/dist/preact.js";import{getCardImageUrl as r,getFullBrandName as t}from"../../utils.js";import e from"../../../../../../core/Context/useImage.js";const o=({brand:o,onClick:c,dataValue:n,brandsConfiguration:s={}})=>{const d=e(),i="card"===o?"nocard":o,l=s[o]?.icon??r(i,d);return a("img",{className:"adyen-checkout-card-input__icon adyen-checkout__card__cardNumber__brandIcon",onError:a=>{a.target.style.cssText="display: none"},alt:t(o),src:l,onClick:c,"data-value":n})};export{o as default};
|
|
2
2
|
//# sourceMappingURL=DualBrandingIcon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DualBrandingIcon.js","sources":["../../../../../../../../src/components/Card/components/CardInput/components/DualBrandingIcon/DualBrandingIcon.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { getCardImageUrl, getFullBrandName } from '../../utils';\nimport { DualBrandingIconProps } from '../types';\nimport './DualBrandingIcon.scss';\nimport useImage from '../../../../../../core/Context/useImage';\n\nconst DualBrandingIcon = ({ brand, onClick, dataValue,
|
|
1
|
+
{"version":3,"file":"DualBrandingIcon.js","sources":["../../../../../../../../src/components/Card/components/CardInput/components/DualBrandingIcon/DualBrandingIcon.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { getCardImageUrl, getFullBrandName } from '../../utils';\nimport { DualBrandingIconProps } from '../types';\nimport './DualBrandingIcon.scss';\nimport useImage from '../../../../../../core/Context/useImage';\n\nconst DualBrandingIcon = ({ brand, onClick, dataValue, brandsConfiguration = {} }: DualBrandingIconProps) => {\n const getImage = useImage();\n const imageName = brand === 'card' ? 'nocard' : brand;\n const imageUrl = brandsConfiguration[brand]?.icon ?? getCardImageUrl(imageName, getImage);\n const handleError = e => {\n e.target.style.cssText = 'display: none';\n };\n\n return (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-noninteractive-element-interactions\n <img\n className={`adyen-checkout-card-input__icon adyen-checkout__card__cardNumber__brandIcon`}\n onError={handleError}\n alt={getFullBrandName(brand)}\n src={imageUrl}\n onClick={onClick}\n data-value={dataValue}\n />\n );\n};\n\nexport default DualBrandingIcon;\n"],"names":["DualBrandingIcon","brand","onClick","dataValue","brandsConfiguration","getImage","useImage","imageName","imageUrl","icon","getCardImageUrl","h","img","className","onError","e","target","style","cssText","alt","getFullBrandName","src","data-value"],"mappings":"kNAMA,MAAMA,EAAmB,EAAGC,QAAOC,UAASC,YAAWC,sBAAsB,CAAA,MACzE,MAAMC,EAAWC,IACXC,EAAsB,SAAVN,EAAmB,SAAWA,EAC1CO,EAAWJ,EAAoBH,IAAQQ,MAAQC,EAAgBH,EAAWF,GAKhF,OAEIM,EAACC,MAAAA,CACGC,UAAW,8EACXC,QARYC,IAChBA,EAAEC,OAAOC,MAAMC,QAAU,eAAA,EAQrBC,IAAKC,EAAiBnB,GACtBoB,IAAKb,EACLN,QAASA,EACToB,aAAYnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../../../../../src/components/Card/components/CardInput/types.ts"],"sourcesContent":["import Language from '../../../../language/Language';\nimport type {\n BinLookupResponse,\n BrandConfiguration,\n CardBrandsConfiguration,\n CardBackendConfiguration,\n DualBrandSelectElement,\n CardPlaceholders\n} from '../../types';\nimport { InstallmentOptions } from './components/types';\nimport { ValidationResult } from '../../../internal/PersonalDetails/types';\nimport {\n CardAllValidData,\n CardAutoCompleteData,\n CardBinValueData,\n CardBrandData,\n CardConfigSuccessData,\n CardFieldValidData,\n CardLoadData,\n CVCPolicyType,\n DatePolicyType\n} from '../../../internal/SecuredFields/lib/types';\nimport Specifications from '../../../internal/Address/Specifications';\nimport { AddressSchema } from '../../../internal/Address/types';\nimport { CardErrorData, StylesObject } from '../../../internal/SecuredFields/lib/types';\nimport { Resources } from '../../../../core/Context/Resources';\nimport { SRPanel } from '../../../../core/Errors/SRPanel';\nimport RiskElement from '../../../../core/RiskModule';\nimport { DisclaimerMsgObject } from '../../../internal/DisclaimerMessage/DisclaimerMessage';\nimport { OnAddressLookupType, OnAddressSelectedType } from '../../../internal/Address/components/AddressSearch';\nimport { ComponentMethodsRef } from '../../../internal/UIElement/types';\nimport { AddressData, PaymentAmount } from '../../../../types/global-types';\nimport { AnalyticsModule } from '../../../../types/global-types';\nimport {
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../../../../src/components/Card/components/CardInput/types.ts"],"sourcesContent":["import Language from '../../../../language/Language';\nimport type {\n BinLookupResponse,\n BrandConfiguration,\n CardBrandsConfiguration,\n CardBackendConfiguration,\n DualBrandSelectElement,\n CardPlaceholders\n} from '../../types';\nimport { InstallmentOptions } from './components/types';\nimport { ValidationResult } from '../../../internal/PersonalDetails/types';\nimport {\n CardAllValidData,\n CardAutoCompleteData,\n CardBinValueData,\n CardBrandData,\n CardConfigSuccessData,\n CardFieldValidData,\n CardLoadData,\n CVCPolicyType,\n DatePolicyType\n} from '../../../internal/SecuredFields/lib/types';\nimport Specifications from '../../../internal/Address/Specifications';\nimport { AddressSchema } from '../../../internal/Address/types';\nimport { CardErrorData, StylesObject } from '../../../internal/SecuredFields/lib/types';\nimport { Resources } from '../../../../core/Context/Resources';\nimport { SRPanel } from '../../../../core/Errors/SRPanel';\nimport RiskElement from '../../../../core/RiskModule';\nimport { DisclaimerMsgObject } from '../../../internal/DisclaimerMessage/DisclaimerMessage';\nimport { OnAddressLookupType, OnAddressSelectedType } from '../../../internal/Address/components/AddressSearch';\nimport { ComponentMethodsRef } from '../../../internal/UIElement/types';\nimport { AddressData, PaymentAmount } from '../../../../types/global-types';\nimport { AnalyticsModule } from '../../../../types/global-types';\nimport type { FastlaneSignupConfiguration } from '../../../PayPalFastlane/types';\nimport { AnalyticsEvent } from '../../../../core/Analytics/AnalyticsEvent';\n\nexport interface CardInputValidState {\n holderName?: boolean;\n billingAddress?: boolean;\n socialSecurityNumber?: boolean;\n encryptedCardNumber?: boolean;\n encryptedExpiryMonth?: boolean;\n encryptedExpiryYear?: boolean;\n encryptedSecurityCode?: boolean;\n taxNumber?: boolean;\n encryptedPassword?: boolean;\n}\n\nexport interface CardInputErrorState {\n holderName?: ValidationResult;\n billingAddress?: ValidationResult;\n socialSecurityNumber?: ValidationResult;\n encryptedCardNumber?: boolean;\n encryptedExpiryDate?: boolean;\n encryptedSecurityCode?: boolean;\n taxNumber?: ValidationResult;\n encryptedPassword?: boolean;\n}\n\nexport interface CardInputDataState {\n holderName?: string;\n billingAddress?: AddressData;\n socialSecurityNumber?: string;\n taxNumber?: string;\n}\n\n/**\n * Should be the subset of the props sent to CardInput that are *actually* used by CardInput\n * - either in the comp itself or are passed on to its children\n */\nexport interface CardInputProps {\n amount?: PaymentAmount;\n isPayButtonPrimaryVariant?: boolean;\n autoFocus?: boolean;\n billingAddressAllowedCountries?: string[];\n billingAddressRequired?: boolean;\n billingAddressRequiredFields?: string[];\n billingAddressMode?: AddressModeOptions;\n brand?: string;\n brands?: string[];\n brandsConfiguration?: CardBrandsConfiguration;\n brandsIcons: Array<BrandConfiguration>;\n clientKey: string;\n configuration?: CardBackendConfiguration;\n countryCode?: string;\n cvcPolicy?: CVCPolicyType;\n data?: CardInputDataState;\n disableIOSArrowKeys?: boolean;\n enableStoreDetails?: boolean;\n expiryMonth?: string;\n expiryYear?: string;\n fastlaneConfiguration?: FastlaneSignupConfiguration;\n forceCompat?: boolean;\n fundingSource?: 'debit' | 'credit';\n hasCVC?: boolean;\n hasHolderName?: boolean;\n holderName?: string;\n holderNameRequired?: boolean;\n i18n?: Language;\n implementationType?: string;\n installmentOptions?: InstallmentOptions;\n keypadFix?: boolean;\n lastFour?: string;\n loadingContext: string;\n legacyInputMode?: boolean;\n minimumExpiryDate?: string;\n modules?: {\n srPanel: SRPanel;\n analytics: AnalyticsModule;\n risk: RiskElement;\n resources: Resources;\n };\n onAdditionalSFConfig?: () => {};\n onAdditionalSFRemoved?: () => {};\n onAllValid?: (o: CardAllValidData) => {};\n onAutoComplete?: (o: CardAutoCompleteData) => {};\n onBinValue?: (o: CardBinValueData) => {};\n onBlur?: (e) => {};\n onBrand?: (o: CardBrandData) => {};\n onConfigSuccess?: (O: CardConfigSuccessData) => {};\n onChange?: (state) => {};\n onError?: () => {};\n onFieldValid?: (o: CardFieldValidData) => {};\n onFocus?: (e) => {};\n onLoad?: (o: CardLoadData) => {};\n onSubmitAnalytics?: (event: AnalyticsEvent) => void;\n handleKeyPress?: (obj: KeyboardEvent) => void;\n onAddressLookup?: OnAddressLookupType;\n onAddressSelected?: OnAddressSelectedType;\n addressSearchDebounceMs?: number;\n payButton?: (obj) => {};\n placeholders?: CardPlaceholders;\n positionHolderNameOnTop?: boolean;\n resources: Resources;\n setComponentRef?: (ref) => void;\n showBrandIcon?: boolean;\n showInstallmentAmounts?: boolean;\n showPayButton: boolean;\n showStoreDetailsCheckbox?: boolean;\n showWarnings?: boolean;\n showContextualElement?: boolean;\n specifications?: Specifications;\n storedPaymentMethodId?: string;\n styles?: StylesObject;\n trimTrailingSeparator?: boolean;\n type?: string;\n maskSecurityCode?: boolean;\n exposeExpiryDate?: boolean;\n disclaimerMessage?: DisclaimerMsgObject;\n}\n\nexport interface CardInputState {\n dualBrandSelectElements: DualBrandSelectElement[];\n selectedBrandValue: string;\n billingAddress: object;\n brand?: string;\n data?: object;\n errors?: object;\n focusedElement: string;\n cvcPolicy: CVCPolicyType;\n expiryDatePolicy: DatePolicyType;\n isValid: boolean;\n status: string;\n valid?: object;\n issuingCountryCode: string;\n showSocialSecurityNumber?: boolean;\n}\n\n// An interface for the members exposed by CardInput to its parent Card/UIElement\nexport interface CardInputRef extends ComponentMethodsRef {\n sfp?: any;\n setFocusOn?: (who) => void;\n processBinLookupResponse?: (binLookupResponse: BinLookupResponse, isReset: boolean) => void;\n updateStyles?: (stylesObj: StylesObject) => void;\n handleUnsupportedCard?: (errObj: CardErrorData) => boolean;\n}\n\nexport interface FieldError {\n errorMessage?: string;\n errorI18n?: string;\n}\n\nexport interface SFError {\n isValid?: boolean;\n errorMessage?: string;\n errorI18n?: string;\n error: string;\n rootNode: HTMLElement;\n detectedBrands?: string[];\n}\n\nexport interface SFStateErrorObj {\n [key: string]: SFError;\n}\n\nexport interface LayoutObj {\n props: CardInputProps;\n showKCP: boolean;\n showBrazilianSSN: boolean;\n countrySpecificSchemas: AddressSchema;\n billingAddressRequiredFields?: string[];\n}\n\nexport enum AddressModeOptions {\n full = 'full',\n partial = 'partial',\n none = 'none'\n}\n"],"names":["AddressModeOptions"],"mappings":"AA2MO,IAAAA,EAAKA,SAAAA,GAAAA,uDAAAA,CAIX,CAJWA,CAIX,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{AddressModeOptions as e}from"./types.js";import{CREDIT_CARD_NAME_TOP as o,CREDIT_CARD_NAME_BOTTOM as n,KCP_CARD_NAME_TOP as
|
|
1
|
+
import{AddressModeOptions as e}from"./types.js";import{CREDIT_CARD_NAME_TOP as o,CREDIT_CARD_NAME_BOTTOM as n,KCP_CARD_NAME_TOP as s,KCP_CARD_NAME_BOTTOM as i,SSN_CARD_NAME_TOP as a,SSN_CARD_NAME_BOTTOM as r,CREDIT_CARD as t,KCP_CARD as l,SSN_CARD as d}from"./layouts.js";import{PARTIAL_ADDRESS_SCHEMA as u}from"../../../internal/Address/constants.js";import{DEFAULT_CARD_GROUP_TYPES as c,BRAND_READABLE_NAME_MAP as m}from"../../../internal/SecuredFields/lib/constants.js";import p from"../../../../core/Context/useImage.js";import{SF_ErrorCodes as h}from"../../../../core/Errors/constants.js";import{DEFAULT_CHALLENGE_WINDOW_SIZE as g}from"../../../ThreeDS2/constants.js";import C from"./defaultProps.js";import{isConfigurationValid as y}from"../Fastlane/utils/validate-configuration.js";import{notFalsy as b}from"../../../../utils/commonUtils.js";const f=(e,o)=>o({type:"card"===e?"nocard":e||"nocard",extension:"svg"})(e),S=e=>"revolving"===e?.plan||e?.value>1,O=({props:e,showKCP:u,showBrazilianSSN:c,countrySpecificSchemas:m=null,billingAddressRequiredFields:p=null})=>{let h=t;const g=e.hasHolderName&&e.holderNameRequired;if(g&&(h=e.positionHolderNameOnTop?o:n),u&&(h=l,g&&(h=e.positionHolderNameOnTop?s:i)),c&&(h=d,g&&(h=e.positionHolderNameOnTop?a:r)),m){const s=m.flat(2).filter((e=>"number"!=typeof e));let i=s;p&&(i=s.filter((e=>p.includes(e)))),h=t.concat(i),g&&(h=e.positionHolderNameOnTop?o.concat(i):n.concat(i))}return h},A=(e,o,n)=>{switch(e){case"socialSecurityNumber":return o.get(`boleto.${e}`);case"street":case"houseNumberOrName":case"postalCode":case"stateOrProvince":case"city":case"country":return n?.[e]?o.get(n?.[e]):o.get(e);default:return null}},R=e=>({amount:e.amount,billingAddressRequired:e.billingAddressRequired,billingAddressRequiredFields:e.billingAddressRequiredFields,billingAddressAllowedCountries:e.billingAddressAllowedCountries,brandsConfiguration:e.brandsConfiguration,showStoreDetailsCheckbox:e.showStoreDetailsCheckbox,hasCVC:e.hasCVC,hasHolderName:e.hasHolderName,holderNameRequired:e.holderNameRequired,installmentOptions:e.installmentOptions,placeholders:e.placeholders,positionHolderNameOnTop:e.positionHolderNameOnTop,showBrandIcon:e.showBrandIcon,showContextualElement:e.showContextualElement,lastFour:e.lastFour,expiryMonth:e.expiryMonth,expiryYear:e.expiryYear,disclaimerMessage:e.disclaimerMessage}),F=e=>({autoFocus:e.autoFocus,brands:e.brands,brandsConfiguration:e.brandsConfiguration,clientKey:e.clientKey,countryCode:e.countryCode,forceCompat:e.forceCompat,i18n:e.i18n,implementationType:e.implementationType,keypadFix:e.keypadFix,legacyInputMode:e.legacyInputMode,loadingContext:e.loadingContext,maskSecurityCode:e.maskSecurityCode,exposeExpiryDate:e.exposeExpiryDate,minimumExpiryDate:e.minimumExpiryDate,onAdditionalSFConfig:e.onAdditionalSFConfig,onAdditionalSFRemoved:e.onAdditionalSFRemoved,onAllValid:e.onAllValid,onAutoComplete:e.onAutoComplete,onBinValue:e.onBinValue,onConfigSuccess:e.onConfigSuccess,handleKeyPress:e.handleKeyPress,onError:e.onError,onFieldValid:e.onFieldValid,onLoad:e.onLoad,placeholders:e.placeholders,resources:e.resources,showContextualElement:e.showContextualElement,showWarnings:e.showWarnings,trimTrailingSeparator:e.trimTrailingSeparator}),x=o=>o==e.partial?u:null;function N(e){return![h.ERROR_MSG_UNSUPPORTED_CARD_ENTERED,h.ERROR_MSG_CARD_TOO_OLD,h.ERROR_MSG_CARD_TOO_FAR_IN_FUTURE,h.ERROR_MSG_CARD_EXPIRES_TOO_SOON].includes(e)}function E(e){return m[e]??e}const w=e=>{const{autoFocus:o,billingAddressAllowedCountries:n,billingAddressMode:s,billingAddressRequired:i,billingAddressRequiredFields:a,brands:r=c,brandsConfiguration:t,challengeWindowSize:l=g,configuration:d,countryCode:u,data:m,disclaimerMessage:p,disableIOSArrowKeys:h,doBinLookup:f,enableStoreDetails:S,exposeExpiryDate:O,fastlaneConfiguration:A,forceCompat:R,hasHolderName:F,hideCVC:x,holderNameRequired:N,installmentOptions:E,keypadFix:w,legacyInputMode:B,maskSecurityCode:D,minimumExpiryDate:T,name:k,placeholders:M,positionHolderNameOnTop:V,showBrandIcon:_,showInstallmentAmounts:P,showPayButton:I=!1,styles:q,onAllValid:H,onBinLookup:L,onBinValue:j,onBlur:v,onBrand:K,onConfigSuccess:U,onEnterKeyPressed:G,onFieldValid:W,onFocus:z,onLoad:J}=e,Y=JSON.stringify(C.data),X=e.modules?.srPanel?.enabled,$=e.modules?.srPanel?.moveFocus,Q=e.modules?.risk?.enabled,Z=y(A),ee=e.onAddressLookup?"lookup":s;let oe="none";!0===d?.koreanAuthenticationRequired&&(oe="kr"===u?.toLowerCase()?"atStart":"auto");return{autoFocus:o,...n?.length>0&&{billingAddressAllowedCountries:n.toString().substring(0,128)},billingAddressMode:ee,billingAddressRequired:i,billingAddressRequiredFields:a?.toString()?.substring(0,128),brands:r?.toString()?.substring(0,128),challengeWindowSize:l,disableIOSArrowKeys:h,doBinLookup:f,enableStoreDetails:S,exposeExpiryDate:O,forceCompat:R,hasBrandsConfiguration:b(t),hasData:m&&JSON.stringify(e.data)!==Y,hasDisclaimerMessage:!!p,hasHolderName:F,hasInstallmentOptions:b(E),hasPlaceholders:b(M),hasStylesConfigured:b(q),hideCVC:x,holderNameRequired:N,keypadFix:w,legacyInputMode:B,maskSecurityCode:D,minimumExpiryDate:!!T,name:k,positionHolderNameOnTop:V,riskEnabled:Q,showBrandIcon:_,showInstallmentAmounts:!!P,showKCPType:oe,showPayButton:I,socialSecurityNumberMode:d?.socialSecurityNumberMode,srPanelEnabled:X,srPanelMoveFocus:$,hasOnAllValid:H!==C.onAllValid,hasOnBinValue:j!==C.onBinValue,hasOnBlur:v!==C.onBlur,hasOnBrand:K!==C.onBrand,hasOnConfigSuccess:U!==C.onConfigSuccess,hasOnFieldValid:W!==C.onFieldValid,hasOnFocus:z!==C.onFocus,hasOnLoad:J!==C.onLoad,hasOnBinLookup:!!L,hasOnEnterKeyPressed:!!G,...Z&&{hasFastlaneConfigured:!0,isFastlaneConsentDefaultOn:A.defaultToggleState}}},B=(e,o)=>e.map((e=>{const n=e.id,s=p(),i="card"===n?"nocard":n,a=o[n]?.icon??f(i,s);return{id:e.id,name:e.brandObject.localeBrand||e.brandObject.brand,imageURL:a,altName:E(n)}}));export{R as extractPropsForCardFields,F as extractPropsForSFP,w as getCardConfigData,f as getCardImageUrl,E as getFullBrandName,O as getLayout,x as handlePartialAddressMode,S as hasValidInstallmentsObject,N as lookupBlurBasedErrors,B as mapDualBrandButtons,A as mapFieldKey};
|
|
2
2
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../../../src/components/Card/components/CardInput/utils.ts"],"sourcesContent":["import Language from '../../../../language/Language';\nimport { AddressModeOptions, CardInputProps, LayoutObj } from './types';\nimport {\n CREDIT_CARD,\n CREDIT_CARD_NAME_BOTTOM,\n CREDIT_CARD_NAME_TOP,\n KCP_CARD,\n KCP_CARD_NAME_BOTTOM,\n KCP_CARD_NAME_TOP,\n SSN_CARD,\n SSN_CARD_NAME_BOTTOM,\n SSN_CARD_NAME_TOP\n} from './layouts';\nimport { AddressSpecifications, StringObject } from '../../../internal/Address/types';\nimport { PARTIAL_ADDRESS_SCHEMA } from '../../../internal/Address/constants';\nimport { InstallmentsObj } from './components/Installments/Installments';\nimport { SFPProps } from '../../../internal/SecuredFields/SFP/types';\nimport { BRAND_READABLE_NAME_MAP } from '../../../internal/SecuredFields/lib/constants';\nimport { UseImageHookType } from '../../../../core/Context/useImage';\nimport { SF_ErrorCodes } from '../../../../core/Errors/constants';\n\nexport const getCardImageUrl = (brand: string, getImage: UseImageHookType): string => {\n const imageOptions = {\n type: brand === 'card' ? 'nocard' : brand || 'nocard',\n extension: 'svg'\n };\n\n return getImage(imageOptions)(brand);\n};\n\n/**\n * Verifies that installment object is valid to send to the Backend.\n * Valid means that it has 'revolving' plan set, or the number of installments is bigger than one\n */\nexport const hasValidInstallmentsObject = (installments?: InstallmentsObj) => {\n return installments?.plan === 'revolving' || installments?.value > 1;\n};\n\nexport const getLayout = ({\n props,\n showKCP,\n showBrazilianSSN,\n countrySpecificSchemas = null,\n billingAddressRequiredFields = null\n}: LayoutObj): string[] => {\n let layout = CREDIT_CARD;\n const hasRequiredHolderName = props.hasHolderName && props.holderNameRequired;\n\n if (hasRequiredHolderName) {\n layout = props.positionHolderNameOnTop ? CREDIT_CARD_NAME_TOP : CREDIT_CARD_NAME_BOTTOM;\n }\n\n if (showKCP) {\n layout = KCP_CARD;\n if (hasRequiredHolderName) {\n layout = props.positionHolderNameOnTop ? KCP_CARD_NAME_TOP : KCP_CARD_NAME_BOTTOM;\n }\n }\n\n if (showBrazilianSSN) {\n layout = SSN_CARD;\n if (hasRequiredHolderName) {\n layout = props.positionHolderNameOnTop ? SSN_CARD_NAME_TOP : SSN_CARD_NAME_BOTTOM;\n }\n }\n\n // w. Billing address\n if (countrySpecificSchemas) {\n // Flatten array and remove any numbers that describe how fields should be aligned\n const countrySpecificSchemasFlat: string[] = countrySpecificSchemas['flat'](2).filter(item => typeof item !== 'number') as string[];\n\n let countryBasedAddressLayout = countrySpecificSchemasFlat;\n\n if (billingAddressRequiredFields) {\n // Get intersection of the 2 arrays\n countryBasedAddressLayout = countrySpecificSchemasFlat.filter(x => billingAddressRequiredFields.includes(x));\n }\n\n layout = CREDIT_CARD.concat(countryBasedAddressLayout);\n if (hasRequiredHolderName) {\n layout = props.positionHolderNameOnTop\n ? CREDIT_CARD_NAME_TOP.concat(countryBasedAddressLayout)\n : CREDIT_CARD_NAME_BOTTOM.concat(countryBasedAddressLayout);\n }\n // TODO we are not yet creating a layout for AVS + SSN field (w. or w/o holderName) - is AVS + SSN a real world scenario?\n }\n return layout;\n};\n\n/**\n * Lookup service to map local (CardInput) field refs to a key, possibly region specific, by which to retrieve the translation\n */\nexport const mapFieldKey = (key: string, i18n: Language, countrySpecificLabels: StringObject): string => {\n // console.log('### utils::mapFieldKey:: key', key);\n switch (key) {\n case 'socialSecurityNumber':\n return i18n.get(`boleto.${key}`);\n // Address related - if we have a country specific key for the field - use that to get the translation\n case 'street':\n case 'houseNumberOrName':\n case 'postalCode':\n case 'stateOrProvince':\n case 'city':\n case 'country':\n return countrySpecificLabels?.[key] ? i18n.get(countrySpecificLabels?.[key]) : i18n.get(key);\n // We know that the translated error messages do contain a reference to the field they refer to, so we won't need to map them (currently applies mostly to SecuredFields related errors)\n default:\n return null;\n }\n};\n\nexport const extractPropsForCardFields = (props: CardInputProps) => {\n return {\n // Extract props for CardFieldsWrapper & StoredCardFieldsWrapper(just needs amount, hasCVC, installmentOptions)\n amount: props.amount,\n billingAddressRequired: props.billingAddressRequired,\n billingAddressRequiredFields: props.billingAddressRequiredFields,\n billingAddressAllowedCountries: props.billingAddressAllowedCountries,\n brandsConfiguration: props.brandsConfiguration,\n showStoreDetailsCheckbox: props.showStoreDetailsCheckbox,\n hasCVC: props.hasCVC,\n hasHolderName: props.hasHolderName,\n holderNameRequired: props.holderNameRequired,\n installmentOptions: props.installmentOptions,\n placeholders: props.placeholders,\n positionHolderNameOnTop: props.positionHolderNameOnTop,\n // Extract props for CardFields > CardNumber\n showBrandIcon: props.showBrandIcon,\n showContextualElement: props.showContextualElement,\n // Extract props for StoredCardFields\n lastFour: props.lastFour,\n expiryMonth: props.expiryMonth,\n expiryYear: props.expiryYear,\n disclaimerMessage: props.disclaimerMessage\n };\n};\n\nexport const extractPropsForSFP = (props: CardInputProps) => {\n return {\n autoFocus: props.autoFocus,\n brands: props.brands,\n brandsConfiguration: props.brandsConfiguration,\n clientKey: props.clientKey,\n countryCode: props.countryCode,\n forceCompat: props.forceCompat,\n i18n: props.i18n,\n implementationType: props.implementationType,\n keypadFix: props.keypadFix,\n legacyInputMode: props.legacyInputMode,\n loadingContext: props.loadingContext,\n maskSecurityCode: props.maskSecurityCode,\n exposeExpiryDate: props.exposeExpiryDate,\n minimumExpiryDate: props.minimumExpiryDate,\n onAdditionalSFConfig: props.onAdditionalSFConfig,\n onAdditionalSFRemoved: props.onAdditionalSFRemoved,\n onAllValid: props.onAllValid,\n onAutoComplete: props.onAutoComplete,\n onBinValue: props.onBinValue,\n onConfigSuccess: props.onConfigSuccess,\n handleKeyPress: props.handleKeyPress,\n onError: props.onError,\n onFieldValid: props.onFieldValid,\n onLoad: props.onLoad,\n placeholders: props.placeholders,\n resources: props.resources,\n showContextualElement: props.showContextualElement,\n showWarnings: props.showWarnings,\n trimTrailingSeparator: props.trimTrailingSeparator\n } as SFPProps; // Can't set as return type on fn or it will complain about missing, mandatory, props\n};\n\nexport const handlePartialAddressMode = (addressMode: AddressModeOptions): AddressSpecifications | null => {\n return addressMode == AddressModeOptions.partial ? PARTIAL_ADDRESS_SCHEMA : null;\n};\n\n// Almost all errors are blur based, but some SF ones are not i.e. when an unsupported card is entered or the expiry date is out of range\nexport function lookupBlurBasedErrors(errorCode) {\n // If it's NOT one of these, then it's a blur based error\n return ![\n SF_ErrorCodes.ERROR_MSG_UNSUPPORTED_CARD_ENTERED,\n SF_ErrorCodes.ERROR_MSG_CARD_TOO_OLD,\n SF_ErrorCodes.ERROR_MSG_CARD_TOO_FAR_IN_FUTURE,\n SF_ErrorCodes.ERROR_MSG_CARD_EXPIRES_TOO_SOON\n ].includes(errorCode);\n}\n\nexport function getFullBrandName(brand) {\n return BRAND_READABLE_NAME_MAP[brand] ?? brand;\n}\n"],"names":["getCardImageUrl","brand","getImage","type","extension","hasValidInstallmentsObject","installments","plan","value","getLayout","props","showKCP","showBrazilianSSN","countrySpecificSchemas","billingAddressRequiredFields","layout","CREDIT_CARD","hasRequiredHolderName","hasHolderName","holderNameRequired","positionHolderNameOnTop","CREDIT_CARD_NAME_TOP","CREDIT_CARD_NAME_BOTTOM","KCP_CARD","KCP_CARD_NAME_TOP","KCP_CARD_NAME_BOTTOM","SSN_CARD","SSN_CARD_NAME_TOP","SSN_CARD_NAME_BOTTOM","countrySpecificSchemasFlat","filter","item","countryBasedAddressLayout","x","includes","concat","mapFieldKey","key","i18n","countrySpecificLabels","get","extractPropsForCardFields","amount","billingAddressRequired","billingAddressAllowedCountries","brandsConfiguration","showStoreDetailsCheckbox","hasCVC","installmentOptions","placeholders","showBrandIcon","showContextualElement","lastFour","expiryMonth","expiryYear","disclaimerMessage","extractPropsForSFP","autoFocus","brands","clientKey","countryCode","forceCompat","implementationType","keypadFix","legacyInputMode","loadingContext","maskSecurityCode","exposeExpiryDate","minimumExpiryDate","onAdditionalSFConfig","onAdditionalSFRemoved","onAllValid","onAutoComplete","onBinValue","onConfigSuccess","handleKeyPress","onError","onFieldValid","onLoad","resources","showWarnings","trimTrailingSeparator","handlePartialAddressMode","addressMode","AddressModeOptions","partial","PARTIAL_ADDRESS_SCHEMA","lookupBlurBasedErrors","errorCode","SF_ErrorCodes","ERROR_MSG_UNSUPPORTED_CARD_ENTERED","ERROR_MSG_CARD_TOO_OLD","ERROR_MSG_CARD_TOO_FAR_IN_FUTURE","ERROR_MSG_CARD_EXPIRES_TOO_SOON","getFullBrandName","BRAND_READABLE_NAME_MAP"],"mappings":"ggBAqBO,MAAMA,EAAkB,CAACC,EAAeC,IAMpCA,EALc,CACjBC,KAAgB,SAAVF,EAAmB,SAAWA,GAAS,SAC7CG,UAAW,OAGRF,CAAuBD,GAOrBI,EAA8BC,GACT,cAAvBA,GAAcC,MAAwBD,GAAcE,MAAQ,EAG1DC,EAAY,EACrBC,QACAC,UACAC,mBACAC,yBAAyB,KACzBC,+BAA+B,SAE/B,IAAIC,EAASC,EACb,MAAMC,EAAwBP,EAAMQ,eAAiBR,EAAMS,mBAqB3D,GAnBIF,IACAF,EAASL,EAAMU,wBAA0BC,EAAuBC,GAGhEX,IACAI,EAASQ,EACLN,IACAF,EAASL,EAAMU,wBAA0BI,EAAoBC,IAIjEb,IACAG,EAASW,EACLT,IACAF,EAASL,EAAMU,wBAA0BO,EAAoBC,IAKjEf,EAAwB,CAExB,MAAMgB,EAAuChB,EAA8B,KAAC,GAAGiB,QAAOC,GAAwB,iBAATA,IAErG,IAAIC,EAA4BH,EAE5Bf,IAEAkB,EAA4BH,EAA2BC,QAAOG,GAAKnB,E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BACxBC,iBAAkBzD,EAAMyD,iBACxBC,kBAAmB1D,EAAM0D,kBACzBC,qBAAsB3D,EAAM2D,qBAC5BC,sBAAuB5D,EAAM4D,sBAC7BC,WAAY7D,EAAM6D,WAClBC,eAAgB9D,EAAM8D,eACtBC,WAAY/D,EAAM+D,WAClBC,gBAAiBhE,EAAMgE,gBACvBC,eAAgBjE,EAAMiE,eACtBC,QAASlE,EAAMkE,QACfC,aAAcnE,EAAMmE,aACpBC,OAAQpE,EAAMoE,OACd7B,aAAcvC,EAAMuC,aACpB8B,UAAWrE,EAAMqE,UACjB5B,sBAAuBzC,EAAMyC,sBAC7B6B,aAActE,EAAMsE,aACpBC,sBAAuBvE,EAAMuE,wBAIxBC,EAA4BC,GAC9BA,GAAeC,EAAmBC,QAAUC,EAAyB,KAIzE,SAASC,EAAsBC,GAElC,OAAQ,CACJC,EAAcC,mCACdD,EAAcE,uBACdF,EAAcG,iCACdH,EAAcI,iCAChB3D,SAASsD,EACf,CAEO,SAASM,EAAiB7F,GAC7B,OAAO8F,EAAwB9F,IAAUA,CAC7C"}
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../../../src/components/Card/components/CardInput/utils.ts"],"sourcesContent":["import Language from '../../../../language/Language';\nimport { AddressModeOptions, CardInputProps, LayoutObj } from './types';\nimport {\n CREDIT_CARD,\n CREDIT_CARD_NAME_BOTTOM,\n CREDIT_CARD_NAME_TOP,\n KCP_CARD,\n KCP_CARD_NAME_BOTTOM,\n KCP_CARD_NAME_TOP,\n SSN_CARD,\n SSN_CARD_NAME_BOTTOM,\n SSN_CARD_NAME_TOP\n} from './layouts';\nimport { AddressSpecifications, StringObject } from '../../../internal/Address/types';\nimport { PARTIAL_ADDRESS_SCHEMA } from '../../../internal/Address/constants';\nimport { InstallmentsObj } from './components/Installments/Installments';\nimport { SFPProps } from '../../../internal/SecuredFields/SFP/types';\nimport { BRAND_READABLE_NAME_MAP, DEFAULT_CARD_GROUP_TYPES } from '../../../internal/SecuredFields/lib/constants';\nimport useImage, { UseImageHookType } from '../../../../core/Context/useImage';\nimport { SF_ErrorCodes } from '../../../../core/Errors/constants';\nimport { CardBrandsConfiguration, CardConfiguration, DualBrandSelectElement } from '../../types';\nimport { CardConfigData } from '../../../../core/Analytics/types';\nimport { DEFAULT_CHALLENGE_WINDOW_SIZE } from '../../../ThreeDS2/constants';\nimport CardInputDefaultProps from './defaultProps';\nimport { isConfigurationValid as isFastlaneComponentConfigValid } from '../Fastlane/utils/validate-configuration';\nimport { notFalsy } from '../../../../utils/commonUtils';\n\nexport const getCardImageUrl = (brand: string, getImage: UseImageHookType): string => {\n const imageOptions = {\n type: brand === 'card' ? 'nocard' : brand || 'nocard',\n extension: 'svg'\n };\n\n return getImage(imageOptions)(brand);\n};\n\n/**\n * Verifies that installment object is valid to send to the Backend.\n * Valid means that it has 'revolving' plan set, or the number of installments is bigger than one\n */\nexport const hasValidInstallmentsObject = (installments?: InstallmentsObj) => {\n return installments?.plan === 'revolving' || installments?.value > 1;\n};\n\nexport const getLayout = ({\n props,\n showKCP,\n showBrazilianSSN,\n countrySpecificSchemas = null,\n billingAddressRequiredFields = null\n}: LayoutObj): string[] => {\n let layout = CREDIT_CARD;\n const hasRequiredHolderName = props.hasHolderName && props.holderNameRequired;\n\n if (hasRequiredHolderName) {\n layout = props.positionHolderNameOnTop ? CREDIT_CARD_NAME_TOP : CREDIT_CARD_NAME_BOTTOM;\n }\n\n if (showKCP) {\n layout = KCP_CARD;\n if (hasRequiredHolderName) {\n layout = props.positionHolderNameOnTop ? KCP_CARD_NAME_TOP : KCP_CARD_NAME_BOTTOM;\n }\n }\n\n if (showBrazilianSSN) {\n layout = SSN_CARD;\n if (hasRequiredHolderName) {\n layout = props.positionHolderNameOnTop ? SSN_CARD_NAME_TOP : SSN_CARD_NAME_BOTTOM;\n }\n }\n\n // w. Billing address\n if (countrySpecificSchemas) {\n // Flatten array and remove any numbers that describe how fields should be aligned\n const countrySpecificSchemasFlat: string[] = countrySpecificSchemas['flat'](2).filter(item => typeof item !== 'number') as string[];\n\n let countryBasedAddressLayout = countrySpecificSchemasFlat;\n\n if (billingAddressRequiredFields) {\n // Get intersection of the 2 arrays\n countryBasedAddressLayout = countrySpecificSchemasFlat.filter(x => billingAddressRequiredFields.includes(x));\n }\n\n layout = CREDIT_CARD.concat(countryBasedAddressLayout);\n if (hasRequiredHolderName) {\n layout = props.positionHolderNameOnTop\n ? CREDIT_CARD_NAME_TOP.concat(countryBasedAddressLayout)\n : CREDIT_CARD_NAME_BOTTOM.concat(countryBasedAddressLayout);\n }\n // TODO we are not yet creating a layout for AVS + SSN field (w. or w/o holderName) - is AVS + SSN a real world scenario?\n }\n return layout;\n};\n\n/**\n * Lookup service to map local (CardInput) field refs to a key, possibly region specific, by which to retrieve the translation\n */\nexport const mapFieldKey = (key: string, i18n: Language, countrySpecificLabels: StringObject): string => {\n // console.log('### utils::mapFieldKey:: key', key);\n switch (key) {\n case 'socialSecurityNumber':\n return i18n.get(`boleto.${key}`);\n // Address related - if we have a country specific key for the field - use that to get the translation\n case 'street':\n case 'houseNumberOrName':\n case 'postalCode':\n case 'stateOrProvince':\n case 'city':\n case 'country':\n return countrySpecificLabels?.[key] ? i18n.get(countrySpecificLabels?.[key]) : i18n.get(key);\n // We know that the translated error messages do contain a reference to the field they refer to, so we won't need to map them (currently applies mostly to SecuredFields related errors)\n default:\n return null;\n }\n};\n\nexport const extractPropsForCardFields = (props: CardInputProps) => {\n return {\n // Extract props for CardFieldsWrapper & StoredCardFieldsWrapper(just needs amount, hasCVC, installmentOptions)\n amount: props.amount,\n billingAddressRequired: props.billingAddressRequired,\n billingAddressRequiredFields: props.billingAddressRequiredFields,\n billingAddressAllowedCountries: props.billingAddressAllowedCountries,\n brandsConfiguration: props.brandsConfiguration,\n showStoreDetailsCheckbox: props.showStoreDetailsCheckbox,\n hasCVC: props.hasCVC,\n hasHolderName: props.hasHolderName,\n holderNameRequired: props.holderNameRequired,\n installmentOptions: props.installmentOptions,\n placeholders: props.placeholders,\n positionHolderNameOnTop: props.positionHolderNameOnTop,\n // Extract props for CardFields > CardNumber\n showBrandIcon: props.showBrandIcon,\n showContextualElement: props.showContextualElement,\n // Extract props for StoredCardFields\n lastFour: props.lastFour,\n expiryMonth: props.expiryMonth,\n expiryYear: props.expiryYear,\n disclaimerMessage: props.disclaimerMessage\n };\n};\n\nexport const extractPropsForSFP = (props: CardInputProps) => {\n return {\n autoFocus: props.autoFocus,\n brands: props.brands,\n brandsConfiguration: props.brandsConfiguration,\n clientKey: props.clientKey,\n countryCode: props.countryCode,\n forceCompat: props.forceCompat,\n i18n: props.i18n,\n implementationType: props.implementationType,\n keypadFix: props.keypadFix,\n legacyInputMode: props.legacyInputMode,\n loadingContext: props.loadingContext,\n maskSecurityCode: props.maskSecurityCode,\n exposeExpiryDate: props.exposeExpiryDate,\n minimumExpiryDate: props.minimumExpiryDate,\n onAdditionalSFConfig: props.onAdditionalSFConfig,\n onAdditionalSFRemoved: props.onAdditionalSFRemoved,\n onAllValid: props.onAllValid,\n onAutoComplete: props.onAutoComplete,\n onBinValue: props.onBinValue,\n onConfigSuccess: props.onConfigSuccess,\n handleKeyPress: props.handleKeyPress,\n onError: props.onError,\n onFieldValid: props.onFieldValid,\n onLoad: props.onLoad,\n placeholders: props.placeholders,\n resources: props.resources,\n showContextualElement: props.showContextualElement,\n showWarnings: props.showWarnings,\n trimTrailingSeparator: props.trimTrailingSeparator\n } as SFPProps; // Can't set as return type on fn or it will complain about missing, mandatory, props\n};\n\nexport const handlePartialAddressMode = (addressMode: AddressModeOptions): AddressSpecifications | null => {\n return addressMode == AddressModeOptions.partial ? PARTIAL_ADDRESS_SCHEMA : null;\n};\n\n// Almost all errors are blur based, but some SF ones are not i.e. when an unsupported card is entered or the expiry date is out of range\nexport function lookupBlurBasedErrors(errorCode) {\n // If it's NOT one of these, then it's a blur based error\n return ![\n SF_ErrorCodes.ERROR_MSG_UNSUPPORTED_CARD_ENTERED,\n SF_ErrorCodes.ERROR_MSG_CARD_TOO_OLD,\n SF_ErrorCodes.ERROR_MSG_CARD_TOO_FAR_IN_FUTURE,\n SF_ErrorCodes.ERROR_MSG_CARD_EXPIRES_TOO_SOON\n ].includes(errorCode);\n}\n\nexport function getFullBrandName(brand) {\n return BRAND_READABLE_NAME_MAP[brand] ?? brand;\n}\n\nexport const getCardConfigData = (cardProps: CardConfiguration): CardConfigData => {\n const MAX_LENGTH = 128;\n\n // Extract props from cardProps - mostly setting a default value, if prop not found\n const {\n autoFocus,\n billingAddressAllowedCountries,\n billingAddressMode,\n billingAddressRequired,\n billingAddressRequiredFields,\n brands = DEFAULT_CARD_GROUP_TYPES,\n brandsConfiguration,\n challengeWindowSize = DEFAULT_CHALLENGE_WINDOW_SIZE,\n configuration,\n countryCode,\n data,\n disclaimerMessage,\n disableIOSArrowKeys,\n doBinLookup,\n enableStoreDetails,\n exposeExpiryDate,\n fastlaneConfiguration,\n forceCompat,\n hasHolderName,\n hideCVC,\n holderNameRequired,\n installmentOptions,\n keypadFix,\n legacyInputMode,\n maskSecurityCode,\n minimumExpiryDate,\n name, // = 'none',\n placeholders,\n positionHolderNameOnTop,\n showBrandIcon,\n showInstallmentAmounts,\n showPayButton = false, // hard coded default\n styles,\n onAllValid,\n onBinLookup,\n onBinValue,\n onBlur,\n onBrand,\n onConfigSuccess,\n onEnterKeyPressed,\n onFieldValid,\n onFocus,\n onLoad\n } = cardProps;\n\n const dataString = JSON.stringify(CardInputDefaultProps.data);\n\n const srPanelEnabled = cardProps.modules?.srPanel?.enabled;\n const srPanelMoveFocus = cardProps.modules?.srPanel?.moveFocus;\n\n const riskEnabled = cardProps.modules?.risk?.enabled;\n\n const isFastlaneConfigValid = isFastlaneComponentConfigValid(fastlaneConfiguration);\n\n const billingAddressModeValue = cardProps.onAddressLookup ? 'lookup' : billingAddressMode;\n\n let showKCPType: 'none' | 'auto' | 'atStart' = 'none';\n if (configuration?.koreanAuthenticationRequired === true) {\n showKCPType = countryCode?.toLowerCase() === 'kr' ? 'atStart' : 'auto';\n }\n\n const configData: CardConfigData = {\n autoFocus,\n ...(billingAddressAllowedCountries?.length > 0 && {\n billingAddressAllowedCountries: billingAddressAllowedCountries.toString().substring(0, MAX_LENGTH)\n }),\n billingAddressMode: billingAddressModeValue,\n billingAddressRequired,\n billingAddressRequiredFields: billingAddressRequiredFields?.toString()?.substring(0, MAX_LENGTH),\n // Probably just for development - in real life we wouldn't expect the number of supported brands to push the endpoint limit on 128 chars\n brands: brands?.toString()?.substring(0, MAX_LENGTH),\n challengeWindowSize,\n disableIOSArrowKeys,\n doBinLookup,\n enableStoreDetails,\n exposeExpiryDate,\n forceCompat,\n hasBrandsConfiguration: notFalsy(brandsConfiguration),\n hasData: data && JSON.stringify(cardProps.data) !== dataString,\n hasDisclaimerMessage: !!disclaimerMessage,\n hasHolderName,\n hasInstallmentOptions: notFalsy(installmentOptions),\n hasPlaceholders: notFalsy(placeholders), // has merchant defined placeholders\n hasStylesConfigured: notFalsy(styles),\n hideCVC,\n holderNameRequired,\n keypadFix,\n legacyInputMode,\n maskSecurityCode,\n minimumExpiryDate: !!minimumExpiryDate, // Potentially, in the future, we can send the actual string value\n name,\n positionHolderNameOnTop,\n riskEnabled,\n showBrandIcon,\n showInstallmentAmounts: !!showInstallmentAmounts,\n showKCPType,\n showPayButton,\n socialSecurityNumberMode: configuration?.socialSecurityNumberMode,\n srPanelEnabled,\n srPanelMoveFocus,\n /** callbacks */\n // We need to detect if the merchant themselves has defined these, not if we've set them as a default\n hasOnAllValid: onAllValid !== CardInputDefaultProps.onAllValid,\n hasOnBinValue: onBinValue !== CardInputDefaultProps.onBinValue,\n hasOnBlur: onBlur !== CardInputDefaultProps.onBlur,\n hasOnBrand: onBrand !== CardInputDefaultProps.onBrand,\n hasOnConfigSuccess: onConfigSuccess !== CardInputDefaultProps.onConfigSuccess,\n hasOnFieldValid: onFieldValid !== CardInputDefaultProps.onFieldValid,\n hasOnFocus: onFocus !== CardInputDefaultProps.onFocus,\n hasOnLoad: onLoad !== CardInputDefaultProps.onLoad,\n // Card level props\n hasOnBinLookup: !!onBinLookup,\n hasOnEnterKeyPressed: !!onEnterKeyPressed,\n /**\n * Fastlane\n */\n ...(isFastlaneConfigValid && {\n hasFastlaneConfigured: true,\n isFastlaneConsentDefaultOn: fastlaneConfiguration.defaultToggleState\n })\n };\n\n return configData;\n};\n\nexport const mapDualBrandButtons = (dualBrandSelectElements: DualBrandSelectElement[], brandsConfiguration: CardBrandsConfiguration): any => {\n return dualBrandSelectElements.map(item => {\n const brand = item.id;\n const getImage = useImage();\n const imageName = brand === 'card' ? 'nocard' : brand;\n const imageURL = brandsConfiguration[brand]?.icon ?? getCardImageUrl(imageName, getImage);\n\n // TODO - check below if we have to still generate altName through the mapping function or whether it just\n // corresponds to item.brandObject.localeBrand\n return {\n id: item.id,\n name: item.brandObject.localeBrand || item.brandObject.brand,\n imageURL,\n altName: getFullBrandName(brand)\n };\n });\n};\n"],"names":["getCardImageUrl","brand","getImage","type","extension","hasValidInstallmentsObject","installments","plan","value","getLayout","props","showKCP","showBrazilianSSN","countrySpecificSchemas","billingAddressRequiredFields","layout","CREDIT_CARD","hasRequiredHolderName","hasHolderName","holderNameRequired","positionHolderNameOnTop","CREDIT_CARD_NAME_TOP","CREDIT_CARD_NAME_BOTTOM","KCP_CARD","KCP_CARD_NAME_TOP","KCP_CARD_NAME_BOTTOM","SSN_CARD","SSN_CARD_NAME_TOP","SSN_CARD_NAME_BOTTOM","countrySpecificSchemasFlat","filter","item","countryBasedAddressLayout","x","includes","concat","mapFieldKey","key","i18n","countrySpecificLabels","get","extractPropsForCardFields","amount","billingAddressRequired","billingAddressAllowedCountries","brandsConfiguration","showStoreDetailsCheckbox","hasCVC","installmentOptions","placeholders","showBrandIcon","showContextualElement","lastFour","expiryMonth","expiryYear","disclaimerMessage","extractPropsForSFP","autoFocus","brands","clientKey","countryCode","forceCompat","implementationType","keypadFix","legacyInputMode","loadingContext","maskSecurityCode","exposeExpiryDate","minimumExpiryDate","onAdditionalSFConfig","onAdditionalSFRemoved","onAllValid","onAutoComplete","onBinValue","onConfigSuccess","handleKeyPress","onError","onFieldValid","onLoad","resources","showWarnings","trimTrailingSeparator","handlePartialAddressMode","addressMode","AddressModeOptions","partial","PARTIAL_ADDRESS_SCHEMA","lookupBlurBasedErrors","errorCode","SF_ErrorCodes","ERROR_MSG_UNSUPPORTED_CARD_ENTERED","ERROR_MSG_CARD_TOO_OLD","ERROR_MSG_CARD_TOO_FAR_IN_FUTURE","ERROR_MSG_CARD_EXPIRES_TOO_SOON","getFullBrandName","BRAND_READABLE_NAME_MAP","getCardConfigData","cardProps","billingAddressMode","DEFAULT_CARD_GROUP_TYPES","challengeWindowSize","DEFAULT_CHALLENGE_WINDOW_SIZE","configuration","data","disableIOSArrowKeys","doBinLookup","enableStoreDetails","fastlaneConfiguration","hideCVC","name","showInstallmentAmounts","showPayButton","styles","onBinLookup","onBlur","onBrand","onEnterKeyPressed","onFocus","dataString","JSON","stringify","CardInputDefaultProps","srPanelEnabled","modules","srPanel","enabled","srPanelMoveFocus","moveFocus","riskEnabled","risk","isFastlaneConfigValid","isFastlaneComponentConfigValid","billingAddressModeValue","onAddressLookup","showKCPType","koreanAuthenticationRequired","toLowerCase","length","toString","substring","hasBrandsConfiguration","notFalsy","hasData","hasDisclaimerMessage","hasInstallmentOptions","hasPlaceholders","hasStylesConfigured","socialSecurityNumberMode","hasOnAllValid","hasOnBinValue","hasOnBlur","hasOnBrand","hasOnConfigSuccess","hasOnFieldValid","hasOnFocus","hasOnLoad","hasOnBinLookup","hasOnEnterKeyPressed","hasFastlaneConfigured","isFastlaneConsentDefaultOn","defaultToggleState","configData","mapDualBrandButtons","dualBrandSelectElements","map","id","useImage","imageName","imageURL","icon","brandObject","localeBrand","altName"],"mappings":"i1BA2BO,MAAMA,EAAkB,CAACC,EAAeC,IAMpCA,EALc,CACjBC,KAAgB,SAAVF,EAAmB,SAAWA,GAAS,SAC7CG,UAAW,OAGRF,CAAuBD,GAOrBI,EAA8BC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