@adyen/adyen-web 6.0.0-alpha.5 → 6.0.0-alpha.7
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 +10 -9
- 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 +41 -29
- package/dist/es/adyen.css +10 -9
- package/dist/es/adyen.css.map +1 -1
- package/dist/es/components/Address/Address.js +1 -1
- package/dist/es/components/Address/Address.js.map +1 -1
- package/dist/es/components/BacsDD/components/BacsInput.js +1 -1
- package/dist/es/components/BacsDD/components/BacsInput.js.map +1 -1
- package/dist/es/components/Blik/components/BlikInput.js +1 -1
- package/dist/es/components/Blik/components/BlikInput.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/defaultProps.js +1 -1
- package/dist/es/components/Card/components/CardInput/defaultProps.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/CashAppPay/CashAppPay.js +1 -1
- package/dist/es/components/CashAppPay/CashAppPay.js.map +1 -1
- package/dist/es/components/CashAppPay/components/CashAppComponent.js +1 -1
- package/dist/es/components/CashAppPay/components/CashAppComponent.js.map +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/InstantPaymentMethods.js.map +1 -1
- package/dist/es/components/GooglePay/components/GooglePayButton.js +1 -1
- package/dist/es/components/GooglePay/components/GooglePayButton.js.map +1 -1
- package/dist/es/components/GooglePay/defaultProps.js +1 -1
- package/dist/es/components/GooglePay/defaultProps.js.map +1 -1
- package/dist/es/components/PersonalDetails/PersonalDetails.js +1 -1
- package/dist/es/components/PersonalDetails/PersonalDetails.js.map +1 -1
- package/dist/es/components/internal/Address/Address.js +1 -1
- package/dist/es/components/internal/Address/Address.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPCards/CtPCards.js +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPCards/CtPCards.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPLogin/CtPLogin.js +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPLogin/CtPLogin.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePassword.js +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePassword.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.js +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/services/sdks/AbstractSrcInitiator.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/services/sdks/MastercardSdk.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/services/sdks/VisaSdk.js.map +1 -1
- package/dist/es/components/internal/ClickToPay/services/utils.js +1 -1
- package/dist/es/components/internal/ClickToPay/services/utils.js.map +1 -1
- package/dist/es/components/internal/CompanyDetails/CompanyDetails.js +1 -1
- package/dist/es/components/internal/CompanyDetails/CompanyDetails.js.map +1 -1
- package/dist/es/components/internal/FormFields/Field/Field.js +1 -1
- package/dist/es/components/internal/FormFields/Field/Field.js.map +1 -1
- package/dist/es/components/internal/FormFields/InputBase.js.map +1 -1
- package/dist/es/components/internal/FormFields/Select/components/SelectListItem.js +1 -1
- package/dist/es/components/internal/FormFields/Select/components/SelectListItem.js.map +1 -1
- package/dist/es/components/internal/Icon/constants.js +2 -0
- package/dist/es/components/internal/Icon/constants.js.map +1 -0
- package/dist/es/components/internal/OpenInvoice/OpenInvoice.js +1 -1
- package/dist/es/components/internal/OpenInvoice/OpenInvoice.js.map +1 -1
- package/dist/es/components/internal/OpenInvoice/useSRPanelForOpenInvoiceErrors.js +2 -0
- package/dist/es/components/internal/OpenInvoice/useSRPanelForOpenInvoiceErrors.js.map +1 -0
- 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/lib/CSF/extensions/createSecuredFields.js +1 -1
- package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleEncryption.js +1 -1
- package/dist/es/components/internal/SecuredFields/lib/CSF/extensions/handleEncryption.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/internal/Voucher/Voucher.js +1 -1
- package/dist/es/components/internal/Voucher/Voucher.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/constants.js +1 -1
- package/dist/es/core/Analytics/constants.js.map +1 -1
- package/dist/es/core/Analytics/utils.js.map +1 -1
- package/dist/es/core/Context/Resources.js +1 -1
- package/dist/es/core/Context/Resources.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/Environment/constants.js +2 -0
- package/dist/es/core/Environment/constants.js.map +1 -0
- package/dist/es/core/Errors/SRMessages.js +1 -1
- package/dist/es/core/Errors/SRMessages.js.map +1 -1
- package/dist/es/core/Errors/SRPanel.js +1 -1
- package/dist/es/core/Errors/SRPanel.js.map +1 -1
- package/dist/es/core/Services/analytics/collect-id.js +1 -1
- package/dist/es/core/Services/analytics/collect-id.js.map +1 -1
- package/dist/es/core/Services/analytics/log-event.js +1 -1
- package/dist/es/core/Services/get-translations.js +1 -1
- package/dist/es/core/Services/get-translations.js.map +1 -1
- package/dist/es/core/core.defaultProps.js +1 -1
- package/dist/es/core/core.defaultProps.js.map +1 -1
- package/dist/es/core/core.js +1 -1
- package/dist/es/core/core.js.map +1 -1
- package/dist/es/core/core.registry.js +1 -1
- package/dist/es/core/core.registry.js.map +1 -1
- package/dist/es/core/utils.js +1 -1
- package/dist/es/core/utils.js.map +1 -1
- package/dist/es/external/preact/dist/preact.js +1 -1
- package/dist/es/external/preact/dist/preact.js.map +1 -1
- package/dist/es/external/preact/hooks/dist/hooks.js +1 -1
- package/dist/es/external/preact/hooks/dist/hooks.js.map +1 -1
- package/dist/es/index.d.ts +41 -29
- package/dist/es/utils/arrayUtils.js +1 -1
- package/dist/es/utils/arrayUtils.js.map +1 -1
- package/dist/es/utils/useForm/useForm.js +1 -1
- package/dist/es/utils/validator-utils.js +1 -1
- package/dist/es/utils/validator-utils.js.map +1 -1
- package/dist/es-legacy/adyen.css +10 -9
- package/dist/es-legacy/adyen.css.map +1 -1
- package/dist/es-legacy/components/ANCV/ANCV.js +1 -1
- package/dist/es-legacy/components/ANCV/ANCV.js.map +1 -1
- package/dist/es-legacy/components/Ach/Ach.js +1 -1
- package/dist/es-legacy/components/Ach/Ach.js.map +1 -1
- package/dist/es-legacy/components/Ach/components/AchInput/AchInput.js +1 -1
- package/dist/es-legacy/components/Ach/components/AchInput/AchInput.js.map +1 -1
- package/dist/es-legacy/components/Address/Address.js +1 -1
- package/dist/es-legacy/components/Address/Address.js.map +1 -1
- package/dist/es-legacy/components/Affirm/Affirm.js +1 -1
- package/dist/es-legacy/components/Affirm/Affirm.js.map +1 -1
- package/dist/es-legacy/components/AfterPay/AfterPay.js +1 -1
- package/dist/es-legacy/components/AfterPay/AfterPay.js.map +1 -1
- package/dist/es-legacy/components/AfterPay/AfterPayB2B.js +1 -1
- package/dist/es-legacy/components/AfterPay/AfterPayB2B.js.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/AmazonPay/components/AmazonPayButton.js +1 -1
- package/dist/es-legacy/components/AmazonPay/components/AmazonPayButton.js.map +1 -1
- package/dist/es-legacy/components/AmazonPay/components/AmazonPayComponent.js +1 -1
- package/dist/es-legacy/components/AmazonPay/components/AmazonPayComponent.js.map +1 -1
- package/dist/es-legacy/components/AmazonPay/utils.js +1 -1
- package/dist/es-legacy/components/AmazonPay/utils.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/Atome/Atome.js +1 -1
- package/dist/es-legacy/components/Atome/Atome.js.map +1 -1
- package/dist/es-legacy/components/Atome/config.js +1 -1
- package/dist/es-legacy/components/Atome/config.js.map +1 -1
- package/dist/es-legacy/components/BacsDD/BacsDD.js +1 -1
- package/dist/es-legacy/components/BacsDD/BacsDD.js.map +1 -1
- package/dist/es-legacy/components/BacsDD/components/BacsInput.js +1 -1
- package/dist/es-legacy/components/BacsDD/components/BacsInput.js.map +1 -1
- package/dist/es-legacy/components/BankTransfer/BankTransfer.js +1 -1
- package/dist/es-legacy/components/BankTransfer/BankTransfer.js.map +1 -1
- package/dist/es-legacy/components/BillDesk/BillDeskOnline.js +1 -1
- package/dist/es-legacy/components/BillDesk/BillDeskOnline.js.map +1 -1
- package/dist/es-legacy/components/BillDesk/BillDeskWallet.js +1 -1
- package/dist/es-legacy/components/BillDesk/BillDeskWallet.js.map +1 -1
- package/dist/es-legacy/components/Blik/Blik.js +1 -1
- package/dist/es-legacy/components/Blik/Blik.js.map +1 -1
- package/dist/es-legacy/components/Blik/components/BlikInput.js +1 -1
- package/dist/es-legacy/components/Blik/components/BlikInput.js.map +1 -1
- package/dist/es-legacy/components/Boleto/Boleto.js +1 -1
- package/dist/es-legacy/components/Boleto/Boleto.js.map +1 -1
- package/dist/es-legacy/components/Boleto/components/BoletoInput/BoletoInput.js +1 -1
- package/dist/es-legacy/components/Boleto/components/BoletoInput/BoletoInput.js.map +1 -1
- package/dist/es-legacy/components/Card/Bancontact.js +1 -1
- package/dist/es-legacy/components/Card/Bancontact.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/IframeLabelAlternative.js +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/IframeLabelAlternative.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/StoredCardFields.js +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/StoredCardFields.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/defaultProps.js +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/defaultProps.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/CashAppPay/CashAppPay.js +1 -1
- package/dist/es-legacy/components/CashAppPay/CashAppPay.js.map +1 -1
- package/dist/es-legacy/components/CashAppPay/components/CashAppComponent.js +1 -1
- package/dist/es-legacy/components/CashAppPay/components/CashAppComponent.js.map +1 -1
- package/dist/es-legacy/components/ClickToPay/ClickToPay.js +1 -1
- package/dist/es-legacy/components/ClickToPay/ClickToPay.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/CustomCard/CustomCardInput/CustomCardInput.js +1 -1
- package/dist/es-legacy/components/CustomCard/CustomCardInput/CustomCardInput.js.map +1 -1
- package/dist/es-legacy/components/Doku/Doku.js +1 -1
- package/dist/es-legacy/components/Doku/Doku.js.map +1 -1
- package/dist/es-legacy/components/Donation/Donation.js +1 -1
- package/dist/es-legacy/components/Donation/Donation.js.map +1 -1
- package/dist/es-legacy/components/Donation/components/DonationComponent.js +1 -1
- package/dist/es-legacy/components/Donation/components/DonationComponent.js.map +1 -1
- package/dist/es-legacy/components/Dragonpay/Dragonpay.js +1 -1
- package/dist/es-legacy/components/Dragonpay/Dragonpay.js.map +1 -1
- package/dist/es-legacy/components/Dragonpay/components/DragonpayInput/DragonpayInput.js +1 -1
- package/dist/es-legacy/components/Dragonpay/components/DragonpayInput/DragonpayInput.js.map +1 -1
- package/dist/es-legacy/components/Dropin/Dropin.js +1 -1
- package/dist/es-legacy/components/Dropin/Dropin.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/InstantPaymentMethods.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/PaymentMethodList.js +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/PaymentMethodList.js.map +1 -1
- package/dist/es-legacy/components/Dropin/elements/createInstantPaymentElements.js +1 -1
- package/dist/es-legacy/components/Dropin/elements/createInstantPaymentElements.js.map +1 -1
- package/dist/es-legacy/components/Dropin/elements/createStoredElements.js +1 -1
- package/dist/es-legacy/components/Dropin/elements/createStoredElements.js.map +1 -1
- package/dist/es-legacy/components/EPS/index.js +1 -1
- package/dist/es-legacy/components/EPS/index.js.map +1 -1
- package/dist/es-legacy/components/Econtext/Econtext.js +1 -1
- package/dist/es-legacy/components/Econtext/Econtext.js.map +1 -1
- package/dist/es-legacy/components/FacilyPay/FacilyPay10x.js +1 -1
- package/dist/es-legacy/components/FacilyPay/FacilyPay10x.js.map +1 -1
- package/dist/es-legacy/components/FacilyPay/FacilyPay12x.js +1 -1
- package/dist/es-legacy/components/FacilyPay/FacilyPay12x.js.map +1 -1
- package/dist/es-legacy/components/FacilyPay/FacilyPay3x.js +1 -1
- package/dist/es-legacy/components/FacilyPay/FacilyPay3x.js.map +1 -1
- package/dist/es-legacy/components/FacilyPay/FacilyPay4x.js +1 -1
- package/dist/es-legacy/components/FacilyPay/FacilyPay4x.js.map +1 -1
- package/dist/es-legacy/components/FacilyPay/FacilyPay6x.js +1 -1
- package/dist/es-legacy/components/FacilyPay/FacilyPay6x.js.map +1 -1
- package/dist/es-legacy/components/Giftcard/Giftcard.js +1 -1
- package/dist/es-legacy/components/Giftcard/Giftcard.js.map +1 -1
- package/dist/es-legacy/components/Giftcard/components/GiftcardComponent.js +1 -1
- package/dist/es-legacy/components/Giftcard/components/GiftcardComponent.js.map +1 -1
- package/dist/es-legacy/components/Giftcard/components/GiftcardFields.js +1 -1
- package/dist/es-legacy/components/Giftcard/components/GiftcardFields.js.map +1 -1
- package/dist/es-legacy/components/Giropay/Giropay.js +1 -1
- package/dist/es-legacy/components/Giropay/Giropay.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/GooglePay/components/GooglePayButton.js +1 -1
- package/dist/es-legacy/components/GooglePay/components/GooglePayButton.js.map +1 -1
- package/dist/es-legacy/components/GooglePay/defaultProps.js +1 -1
- package/dist/es-legacy/components/GooglePay/defaultProps.js.map +1 -1
- package/dist/es-legacy/components/Klarna/KlarnaPayments.js +1 -1
- package/dist/es-legacy/components/Klarna/KlarnaPayments.js.map +1 -1
- package/dist/es-legacy/components/Klarna/components/KlarnaContainer/KlarnaContainer.js +1 -1
- package/dist/es-legacy/components/Klarna/components/KlarnaContainer/KlarnaContainer.js.map +1 -1
- package/dist/es-legacy/components/MBWay/MBWay.js +1 -1
- package/dist/es-legacy/components/MBWay/MBWay.js.map +1 -1
- package/dist/es-legacy/components/MBWay/components/MBWayInput/MBWayInput.js +1 -1
- package/dist/es-legacy/components/MBWay/components/MBWayInput/MBWayInput.js.map +1 -1
- package/dist/es-legacy/components/MealVoucherFR/MealVoucherFR.js +1 -1
- package/dist/es-legacy/components/MealVoucherFR/MealVoucherFR.js.map +1 -1
- package/dist/es-legacy/components/MealVoucherFR/components/MealVoucherFields.js +1 -1
- package/dist/es-legacy/components/MealVoucherFR/components/MealVoucherFields.js.map +1 -1
- package/dist/es-legacy/components/Multibanco/Multibanco.js +1 -1
- package/dist/es-legacy/components/Multibanco/Multibanco.js.map +1 -1
- package/dist/es-legacy/components/OnlineBankingCZ/index.js +1 -1
- package/dist/es-legacy/components/OnlineBankingCZ/index.js.map +1 -1
- package/dist/es-legacy/components/OnlineBankingIN/index.js +1 -1
- package/dist/es-legacy/components/OnlineBankingIN/index.js.map +1 -1
- package/dist/es-legacy/components/OnlineBankingPL/OnlineBankingPL.js +1 -1
- package/dist/es-legacy/components/OnlineBankingPL/OnlineBankingPL.js.map +1 -1
- package/dist/es-legacy/components/OnlineBankingSK/index.js +1 -1
- package/dist/es-legacy/components/OnlineBankingSK/index.js.map +1 -1
- package/dist/es-legacy/components/Oxxo/Oxxo.js +1 -1
- package/dist/es-legacy/components/Oxxo/Oxxo.js.map +1 -1
- package/dist/es-legacy/components/PayByBank/PayByBank.js +1 -1
- package/dist/es-legacy/components/PayByBank/PayByBank.js.map +1 -1
- 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/PayPal/components/PaypalButtons.js +1 -1
- package/dist/es-legacy/components/PayPal/components/PaypalButtons.js.map +1 -1
- package/dist/es-legacy/components/PayPal/components/PaypalComponent.js +1 -1
- package/dist/es-legacy/components/PayPal/components/PaypalComponent.js.map +1 -1
- package/dist/es-legacy/components/PayPal/utils/get-paypal-settings.js +1 -1
- package/dist/es-legacy/components/PayPal/utils/get-paypal-settings.js.map +1 -1
- package/dist/es-legacy/components/PayU/PayuCashcard.js +1 -1
- package/dist/es-legacy/components/PayU/PayuCashcard.js.map +1 -1
- package/dist/es-legacy/components/PayU/PayuNetBanking.js +1 -1
- package/dist/es-legacy/components/PayU/PayuNetBanking.js.map +1 -1
- package/dist/es-legacy/components/PersonalDetails/PersonalDetails.js +1 -1
- package/dist/es-legacy/components/PersonalDetails/PersonalDetails.js.map +1 -1
- package/dist/es-legacy/components/Pix/Pix.js +1 -1
- package/dist/es-legacy/components/Pix/Pix.js.map +1 -1
- package/dist/es-legacy/components/RatePay/RatePay.js +1 -1
- package/dist/es-legacy/components/RatePay/RatePay.js.map +1 -1
- package/dist/es-legacy/components/RatePay/RatePayDirectDebit.js +1 -1
- package/dist/es-legacy/components/RatePay/RatePayDirectDebit.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/Riverty/Riverty.js +1 -1
- package/dist/es-legacy/components/Riverty/Riverty.js.map +1 -1
- package/dist/es-legacy/components/Sepa/Sepa.js +1 -1
- package/dist/es-legacy/components/Sepa/Sepa.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/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/Trustly/Trustly.js +1 -1
- package/dist/es-legacy/components/Trustly/Trustly.js.map +1 -1
- package/dist/es-legacy/components/Twint/Twint.js +1 -1
- package/dist/es-legacy/components/Twint/Twint.js.map +1 -1
- package/dist/es-legacy/components/UPI/UPI.js +1 -1
- package/dist/es-legacy/components/UPI/UPI.js.map +1 -1
- package/dist/es-legacy/components/WalletIN/index.js +1 -1
- package/dist/es-legacy/components/WalletIN/index.js.map +1 -1
- package/dist/es-legacy/components/helpers/IssuerListContainer/IssuerListContainer.js +1 -1
- package/dist/es-legacy/components/helpers/IssuerListContainer/IssuerListContainer.js.map +1 -1
- package/dist/es-legacy/components/helpers/OpenInvoiceContainer/OpenInvoiceContainer.js +1 -1
- package/dist/es-legacy/components/helpers/OpenInvoiceContainer/OpenInvoiceContainer.js.map +1 -1
- package/dist/es-legacy/components/helpers/QRLoaderContainer/QRLoaderContainer.js +1 -1
- package/dist/es-legacy/components/helpers/QRLoaderContainer/QRLoaderContainer.js.map +1 -1
- package/dist/es-legacy/components/internal/Address/Address.js +1 -1
- package/dist/es-legacy/components/internal/Address/Address.js.map +1 -1
- package/dist/es-legacy/components/internal/Address/components/CountryField.js +1 -1
- package/dist/es-legacy/components/internal/Address/components/CountryField.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/ClickToPay/components/CtPCards/CtPCards.js +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPCards/CtPCards.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPLogin/CtPLogin.js +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPLogin/CtPLogin.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePassword.js +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePassword.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.js +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/services/ClickToPayService.js +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/services/ClickToPayService.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/services/sdks/AbstractSrcInitiator.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/services/sdks/MastercardSdk.js +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/services/sdks/MastercardSdk.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/services/sdks/VisaSdk.js +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/services/sdks/VisaSdk.js.map +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/services/utils.js +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/services/utils.js.map +1 -1
- package/dist/es-legacy/components/internal/CompanyDetails/CompanyDetails.js +1 -1
- package/dist/es-legacy/components/internal/CompanyDetails/CompanyDetails.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/Checkbox/Checkbox.js +1 -1
- package/dist/es-legacy/components/internal/FormFields/Checkbox/Checkbox.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/Field/Field.js +1 -1
- package/dist/es-legacy/components/internal/FormFields/Field/Field.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/InputBase.js +1 -1
- package/dist/es-legacy/components/internal/FormFields/InputBase.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/InputDate/InputDate.js +1 -1
- package/dist/es-legacy/components/internal/FormFields/InputDate/InputDate.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/InputEmail.js +1 -1
- package/dist/es-legacy/components/internal/FormFields/InputEmail.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/InputTelephone.js +1 -1
- package/dist/es-legacy/components/internal/FormFields/InputTelephone.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/InputText.js +1 -1
- package/dist/es-legacy/components/internal/FormFields/InputText.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/Select/components/SelectButton.js +1 -1
- package/dist/es-legacy/components/internal/FormFields/Select/components/SelectButton.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/Select/components/SelectListItem.js +1 -1
- package/dist/es-legacy/components/internal/FormFields/Select/components/SelectListItem.js.map +1 -1
- package/dist/es-legacy/components/internal/IbanInput/IbanInput.js +1 -1
- package/dist/es-legacy/components/internal/IbanInput/IbanInput.js.map +1 -1
- package/dist/es-legacy/components/internal/Icon/constants.js +2 -0
- package/dist/es-legacy/components/internal/Icon/constants.js.map +1 -0
- package/dist/es-legacy/components/internal/Img/Img.js +1 -1
- package/dist/es-legacy/components/internal/Img/Img.js.map +1 -1
- package/dist/es-legacy/components/internal/IssuerList/IssuerButtonGroup/IssuerButtonGroup.js +1 -1
- package/dist/es-legacy/components/internal/IssuerList/IssuerButtonGroup/IssuerButtonGroup.js.map +1 -1
- package/dist/es-legacy/components/internal/OpenInvoice/OpenInvoice.js +1 -1
- package/dist/es-legacy/components/internal/OpenInvoice/OpenInvoice.js.map +1 -1
- package/dist/es-legacy/components/internal/OpenInvoice/useSRPanelForOpenInvoiceErrors.js +2 -0
- package/dist/es-legacy/components/internal/OpenInvoice/useSRPanelForOpenInvoiceErrors.js.map +1 -0
- package/dist/es-legacy/components/internal/PayButton/PayButton.js +1 -1
- package/dist/es-legacy/components/internal/PayButton/PayButton.js.map +1 -1
- package/dist/es-legacy/components/internal/PersonalDetails/PersonalDetails.js +1 -1
- package/dist/es-legacy/components/internal/PersonalDetails/PersonalDetails.js.map +1 -1
- package/dist/es-legacy/components/internal/PhoneInput/PhoneInput.js +1 -1
- package/dist/es-legacy/components/internal/PhoneInput/PhoneInput.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/RedirectButton/RedirectButton.js +1 -1
- package/dist/es-legacy/components/internal/RedirectButton/RedirectButton.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/SFP/SecuredFieldsProviderHandlers.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/SFP/SecuredFieldsProviderHandlers.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/createSecuredFields.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/CSF/extensions/handleEncryption.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/CSF/extensions/handleEncryption.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/SecuredFields/lib/securedField/SecuredField.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/SecuredField.js.map +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/utils/processAriaConfig.js +1 -1
- package/dist/es-legacy/components/internal/SecuredFields/lib/securedField/utils/processAriaConfig.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/internal/Voucher/Voucher.js +1 -1
- package/dist/es-legacy/components/internal/Voucher/Voucher.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/constants.js +1 -1
- package/dist/es-legacy/core/Analytics/constants.js.map +1 -1
- package/dist/es-legacy/core/Analytics/utils.js.map +1 -1
- package/dist/es-legacy/core/Context/Resources.js +1 -1
- package/dist/es-legacy/core/Context/Resources.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/Environment/constants.js +2 -0
- package/dist/es-legacy/core/Environment/constants.js.map +1 -0
- package/dist/es-legacy/core/Errors/SRPanel.js +1 -1
- package/dist/es-legacy/core/Errors/SRPanel.js.map +1 -1
- package/dist/es-legacy/core/ProcessResponse/PaymentAction/actionTypes.js +1 -1
- package/dist/es-legacy/core/ProcessResponse/PaymentAction/actionTypes.js.map +1 -1
- package/dist/es-legacy/core/ProcessResponse/PaymentMethods/utils.js +1 -1
- package/dist/es-legacy/core/ProcessResponse/PaymentMethods/utils.js.map +1 -1
- package/dist/es-legacy/core/ProcessResponse/process-response.js +1 -1
- package/dist/es-legacy/core/ProcessResponse/process-response.js.map +1 -1
- package/dist/es-legacy/core/RiskModule/RiskModule.js +1 -1
- package/dist/es-legacy/core/RiskModule/RiskModule.js.map +1 -1
- package/dist/es-legacy/core/Services/analytics/collect-id.js +1 -1
- package/dist/es-legacy/core/Services/analytics/collect-id.js.map +1 -1
- package/dist/es-legacy/core/Services/analytics/log-event.js +1 -1
- package/dist/es-legacy/core/Services/get-translations.js +1 -1
- package/dist/es-legacy/core/Services/get-translations.js.map +1 -1
- package/dist/es-legacy/core/Services/http.js +1 -1
- package/dist/es-legacy/core/Services/http.js.map +1 -1
- package/dist/es-legacy/core/core.defaultProps.js +1 -1
- package/dist/es-legacy/core/core.defaultProps.js.map +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/core.registry.js +1 -1
- package/dist/es-legacy/core/core.registry.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/external/preact/dist/preact.js +1 -1
- package/dist/es-legacy/external/preact/dist/preact.js.map +1 -1
- package/dist/es-legacy/external/preact/hooks/dist/hooks.js +1 -1
- package/dist/es-legacy/external/preact/hooks/dist/hooks.js.map +1 -1
- package/dist/es-legacy/utils/arrayUtils.js +1 -1
- package/dist/es-legacy/utils/arrayUtils.js.map +1 -1
- package/dist/es-legacy/utils/useForm/reducer.js +1 -1
- package/dist/es-legacy/utils/useForm/reducer.js.map +1 -1
- package/dist/es-legacy/utils/useForm/useForm.js +1 -1
- package/dist/es-legacy/utils/validator-utils.js +1 -1
- package/dist/es-legacy/utils/validator-utils.js.map +1 -1
- package/package.json +144 -148
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createElement as t}from"../../external/preact/dist/preact.js";import{UIElement as e}from"../internal/UIElement/UIElement.js";import s from"../internal/Address/Address.js";import{CoreProvider as r}from"../../core/Context/CoreProvider.js";import{TxVariants as o}from"../tx-variants.js";class i extends e{static type=o.address;get data(){return this.state.data}get isValid(){return!!this.state.isValid}render(){return t(r,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(s,{setComponentRef:this.setComponentRef,...this.props,onChange:this.setState
|
|
1
|
+
import{createElement as t}from"../../external/preact/dist/preact.js";import{UIElement as e}from"../internal/UIElement/UIElement.js";import s from"../internal/Address/Address.js";import{CoreProvider as r}from"../../core/Context/CoreProvider.js";import{TxVariants as o}from"../tx-variants.js";class i extends e{static type=o.address;get data(){return this.state.data}get isValid(){return!!this.state.isValid}render(){return t(r,{i18n:this.props.i18n,loadingContext:this.props.loadingContext,resources:this.resources},t(s,{setComponentRef:this.setComponentRef,...this.props,onChange:this.setState}))}}export{i as AddressElement,i as default};
|
|
2
2
|
//# sourceMappingURL=Address.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Address.js","sources":["../../../../src/components/Address/Address.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport Address from '../internal/Address';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport { TxVariants } from '../tx-variants';\n\nexport class AddressElement extends UIElement {\n public static type = TxVariants.address;\n\n get data() {\n return this.state.data;\n }\n\n get isValid() {\n return !!this.state.isValid;\n }\n\n render() {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <Address\n setComponentRef={this.setComponentRef}\n {...this.props}\n onChange={this.setState}\n {...(process.env.NODE_ENV !== 'production' && { payButton: this.payButton })}\n />\n </CoreProvider>\n );\n }\n}\n\nexport default AddressElement;\n"],"names":["AddressElement","UIElement","static","TxVariants","address","data","this","state","isValid","render","h","CoreProvider","i18n","props","loadingContext","resources","Address","setComponentRef","onChange","setState"],"mappings":"mSAMO,MAAMA,UAAuBC,EAChCC,YAAqBC,EAAWC,QAEhC,QAAIC,GACA,OAAOC,KAAKC,MAAMF,IACtB,CAEA,WAAIG,GACA,QAASF,KAAKC,MAAMC,OACxB,CAEAC,MAAAA,GACI,OACIC,EAACC,EAAAA,CAAaC,KAAMN,KAAKO,MAAMD,KAAME,eAAgBR,KAAKO,MAAMC,eAAgBC,UAAWT,KAAKS,WAC5FL,EAACM,EAAAA,CACGC,gBAAiBX,KAAKW,mBAClBX,KAAKO,MACTK,SAAUZ,KAAKa,
|
|
1
|
+
{"version":3,"file":"Address.js","sources":["../../../../src/components/Address/Address.tsx"],"sourcesContent":["import { h } from 'preact';\nimport UIElement from '../internal/UIElement/UIElement';\nimport Address from '../internal/Address';\nimport { CoreProvider } from '../../core/Context/CoreProvider';\nimport { TxVariants } from '../tx-variants';\n\nexport class AddressElement extends UIElement {\n public static type = TxVariants.address;\n\n get data() {\n return this.state.data;\n }\n\n get isValid() {\n return !!this.state.isValid;\n }\n\n render() {\n return (\n <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>\n <Address\n setComponentRef={this.setComponentRef}\n {...this.props}\n onChange={this.setState}\n {...(process.env.NODE_ENV !== 'production' && { payButton: this.payButton })}\n />\n </CoreProvider>\n );\n }\n}\n\nexport default AddressElement;\n"],"names":["AddressElement","UIElement","static","TxVariants","address","data","this","state","isValid","render","h","CoreProvider","i18n","props","loadingContext","resources","Address","setComponentRef","onChange","setState"],"mappings":"mSAMO,MAAMA,UAAuBC,EAChCC,YAAqBC,EAAWC,QAEhC,QAAIC,GACA,OAAOC,KAAKC,MAAMF,IACtB,CAEA,WAAIG,GACA,QAASF,KAAKC,MAAMC,OACxB,CAEAC,MAAAA,GACI,OACIC,EAACC,EAAAA,CAAaC,KAAMN,KAAKO,MAAMD,KAAME,eAAgBR,KAAKO,MAAMC,eAAgBC,UAAWT,KAAKS,WAC5FL,EAACM,EAAAA,CACGC,gBAAiBX,KAAKW,mBAClBX,KAAKO,MACTK,SAAUZ,KAAKa,WAK/B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createElement as e}from"../../../external/preact/dist/preact.js";import{useState as a,useEffect as o}from"../../../external/preact/hooks/dist/hooks.js";import n from"../../../external/classnames/index.js";import{useCoreContext as t}from"../../../core/Context/CoreProvider.js";import
|
|
1
|
+
import{createElement as e}from"../../../external/preact/dist/preact.js";import{useState as a,useEffect as o}from"../../../external/preact/hooks/dist/hooks.js";import n from"../../../external/classnames/index.js";import{useCoreContext as t}from"../../../core/Context/CoreProvider.js";import r from"../../internal/FormFields/Field/Field.js";import c from"../../internal/FormFields/ConsentCheckbox/ConsentCheckbox.js";import{bacsFormatters as i,bacsValidationRules as s}from"./validate.js";import l from"../../../utils/useForm/useForm.js";import d from"../../../core/Context/useImage.js";import u from"../../internal/FormFields/InputText.js";import m from"../../internal/FormFields/InputEmail.js";import b from"../../internal/FormInstruction/FormInstruction.js";import{getErrorMessage as h}from"../../../utils/getErrorMessage.js";import{PREFIX as p}from"../../internal/Icon/constants.js";const k="enter-data",g="confirm-data";function f(f){const{i18n:N}=t(),_=d(),{handleChangeFor:C,triggerValidation:y,data:v,valid:I,errors:x,isValid:E}=l({schema:["holderName","bankAccountNumber","bankLocationId","shopperEmail","amountConsentCheckbox","accountConsentCheckbox"],defaultData:f.data,formatters:i,rules:s}),[F,j]=a(k);this.setStatus=j,this.showValidation=y;return o((()=>{f.onChange({data:v,valid:I,errors:x,isValid:E})}),[v,I,x,E]),e("div",{className:n({"adyen-checkout__bacs":!0,"adyen-checkout__bacs--confirm":F===g||"loading"===F})},f.showFormInstruction&&e(b,null),F==g&&e("div",{className:n({"adyen-checkout__bacs--edit":!0,"adyen-checkout__bacs--edit-dropin":f.isDropin})},e(u,{name:"bacsEdit",className:"adyen-checkout__bacs--edit-button",value:N.get("edit"),"aria-label":N.get("edit"),readonly:!0,onClick:()=>this.setStatus(k)})),e(r,{className:n({"adyen-checkout__bacs--holder-name":!0,"adyen-checkout__field--inactive":F===g||"loading"===F}),label:N.get("bacs.accountHolderName"),errorMessage:!!x.holderName&&N.get("bacs.accountHolderName.invalid"),isValid:I.holderName,name:"accountHolderName",i18n:N},e(u,{name:"bacs.accountHolderName",className:"adyen-checkout__bacs-input--holder-name",placeholder:f.placeholders.holderName,value:v.holderName,"aria-invalid":!I.holderName,"aria-label":N.get("bacs.accountHolderName"),"aria-required":"true",required:!0,readonly:F===g||"loading"===F,autocorrect:"off",onBlur:C("holderName","blur"),onInput:C("holderName","input")})),e("div",{className:"adyen-checkout__bacs__num-id adyen-checkout__field-wrapper"},e(r,{errorMessage:!!x.bankAccountNumber&&N.get("bacs.accountNumber.invalid"),label:N.get("bacs.accountNumber"),className:n({"adyen-checkout__bacs--bank-account-number":!0,"adyen-checkout__field--inactive":F===g||"loading"===F}),classNameModifiers:["col-70"],isValid:I.bankAccountNumber,name:"bankAccountNumber",i18n:N},e(u,{value:v.bankAccountNumber,className:"adyen-checkout__bacs-input--bank-account-number",placeholder:f.placeholders.bankAccountNumber,"aria-invalid":!I.bankAccountNumber,"aria-label":N.get("bacs.accountNumber"),"aria-required":"true",required:!0,readonly:F===g||"loading"===F,autocorrect:"off",onBlur:C("bankAccountNumber","blur"),onInput:C("bankAccountNumber","input")})),e(r,{errorMessage:!!x.bankLocationId&&N.get("bacs.bankLocationId.invalid"),label:N.get("bacs.bankLocationId"),className:n({"adyen-checkout__bacs--bank-location-id":!0,"adyen-checkout__field--inactive":F===g||"loading"===F}),classNameModifiers:["col-30"],isValid:I.bankLocationId,name:"bankLocationId",i18n:N},e(u,{value:v.bankLocationId,className:"adyen-checkout__bacs-input--bank-location-id",placeholder:f.placeholders.bankLocationId,"aria-invalid":!I.bankLocationId,"aria-label":N.get("bacs.bankLocationId"),"aria-required":"true",required:!0,readonly:F===g||"loading"===F,autocorrect:"off",onBlur:C("bankLocationId","blur"),onInput:C("bankLocationId","input")}))),e(r,{errorMessage:h(N,x.shopperEmail,N.get("shopperEmail")),label:N.get("shopperEmail"),className:n({"adyen-checkout__bacs--shopper-email":!0,"adyen-checkout__field--inactive":F===g||"loading"===F}),isValid:I.shopperEmail,name:"emailAddress",i18n:N},e(m,{value:v.shopperEmail,name:"shopperEmail",className:"adyen-checkout__bacs-input--shopper-email",classNameModifiers:["large"],placeholder:f.placeholders.shopperEmail,spellcheck:!1,"aria-invalid":!I.shopperEmail,"aria-label":N.get("shopperEmail"),"aria-required":"true",required:!0,readonly:F===g||"loading"===F,autocorrect:"off",onInput:C("shopperEmail","input"),onBlur:C("shopperEmail","blur")})),F===k&&e(c,{classNameModifiers:["amountConsentCheckbox"],errorMessage:!!x.amountConsentCheckbox,label:N.get("bacs.consent.amount"),onChange:C("amountConsentCheckbox"),checked:!!v.amountConsentCheckbox,i18n:N}),F===k&&e(c,{classNameModifiers:["accountConsentCheckbox"],errorMessage:!!x.accountConsentCheckbox,label:N.get("bacs.consent.account"),onChange:C("accountConsentCheckbox"),checked:!!v.accountConsentCheckbox,i18n:N}),f.showPayButton&&f.payButton({status:F,label:F===k?N.get("continue"):`${N.get("bacs.confirm")} ${f.amount?.value&&f.amount?.currency?N.amount(f.amount.value,f.amount.currency):""}`,icon:_({imageFolder:"components/"})(`${p}lock`),onClick:()=>E?F===k?this.setStatus(g):F===g?f.onSubmit():void 0:this.showValidation()}))}f.defaultProps={data:{},placeholders:{}};export{f as default};
|
|
2
2
|
//# sourceMappingURL=BacsInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BacsInput.js","sources":["../../../../../src/components/BacsDD/components/BacsInput.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useState, useEffect } from 'preact/hooks';\nimport classNames from 'classnames';\nimport { useCoreContext } from '../../../core/Context/CoreProvider';\nimport Field from '../../internal/FormFields/Field';\nimport ConsentCheckbox from '../../internal/FormFields/ConsentCheckbox';\nimport { bacsValidationRules, bacsFormatters } from './validate';\nimport { BacsDataState, BacsInputProps } from './types';\nimport './BacsInput.scss';\n\nimport useForm from '../../../utils/useForm';\nimport useImage from '../../../core/Context/useImage';\nimport InputText from '../../internal/FormFields/InputText';\nimport InputEmail from '../../internal/FormFields/InputEmail';\nimport FormInstruction from '../../internal/FormInstruction';\nimport { getErrorMessage } from '../../../utils/getErrorMessage';\n\nconst ENTER_STATE = 'enter-data';\nconst CONFIRM_STATE = 'confirm-data';\n\nfunction BacsInput(props: BacsInputProps) {\n const { i18n } = useCoreContext();\n const getImage = useImage();\n\n const { handleChangeFor, triggerValidation, data, valid, errors, isValid } = useForm<BacsDataState>({\n schema: ['holderName', 'bankAccountNumber', 'bankLocationId', 'shopperEmail', 'amountConsentCheckbox', 'accountConsentCheckbox'],\n defaultData: props.data,\n formatters: bacsFormatters,\n rules: bacsValidationRules\n });\n\n const [status, setStatus] = useState(ENTER_STATE);\n this.setStatus = setStatus;\n this.showValidation = triggerValidation;\n\n const handlePayButton = () => {\n if (!isValid) return this.showValidation();\n\n if (status === ENTER_STATE) {\n return this.setStatus(CONFIRM_STATE);\n } else if (status === CONFIRM_STATE) {\n return props.onSubmit();\n }\n };\n\n const handleEdit = () => {\n return this.setStatus(ENTER_STATE);\n };\n\n useEffect(() => {\n props.onChange({ data, valid, errors, isValid });\n }, [data, valid, errors, isValid]);\n\n return (\n <div\n className={classNames({\n 'adyen-checkout__bacs': true,\n 'adyen-checkout__bacs--confirm': status === CONFIRM_STATE || status === 'loading'\n })}\n >\n {props.showFormInstruction && <FormInstruction />}\n {status == CONFIRM_STATE && (\n <div\n className={classNames({\n 'adyen-checkout__bacs--edit': true,\n 'adyen-checkout__bacs--edit-dropin': props.isDropin\n })}\n >\n <InputText\n name={'bacsEdit'}\n className={'adyen-checkout__bacs--edit-button'}\n value={i18n.get('edit')}\n aria-label={i18n.get('edit')}\n readonly={true}\n onClick={handleEdit}\n />\n </div>\n )}\n\n <Field\n className={classNames({\n 'adyen-checkout__bacs--holder-name': true,\n 'adyen-checkout__field--inactive': status === CONFIRM_STATE || status === 'loading'\n })}\n label={i18n.get('bacs.accountHolderName')}\n errorMessage={errors.holderName ? i18n.get('bacs.accountHolderName.invalid') : false}\n isValid={valid.holderName}\n name={'accountHolderName'}\n i18n={i18n}\n >\n <InputText\n name={'bacs.accountHolderName'}\n className={'adyen-checkout__bacs-input--holder-name'}\n placeholder={props.placeholders.holderName}\n value={data.holderName}\n aria-invalid={!valid.holderName}\n aria-label={i18n.get('bacs.accountHolderName')}\n aria-required={'true'}\n required={true}\n readonly={status === CONFIRM_STATE || status === 'loading'}\n autocorrect={'off'}\n onBlur={handleChangeFor('holderName', 'blur')}\n onInput={handleChangeFor('holderName', 'input')}\n />\n </Field>\n\n <div className=\"adyen-checkout__bacs__num-id adyen-checkout__field-wrapper\">\n <Field\n errorMessage={!!errors.bankAccountNumber && i18n.get('bacs.accountNumber.invalid')}\n label={i18n.get('bacs.accountNumber')}\n className={classNames({\n 'adyen-checkout__bacs--bank-account-number': true,\n 'adyen-checkout__field--inactive': status === CONFIRM_STATE || status === 'loading'\n })}\n classNameModifiers={['col-70']}\n isValid={valid.bankAccountNumber}\n name={'bankAccountNumber'}\n i18n={i18n}\n >\n <InputText\n value={data.bankAccountNumber}\n className={'adyen-checkout__bacs-input--bank-account-number'}\n placeholder={props.placeholders.bankAccountNumber}\n aria-invalid={!valid.bankAccountNumber}\n aria-label={i18n.get('bacs.accountNumber')}\n aria-required={'true'}\n required={true}\n readonly={status === CONFIRM_STATE || status === 'loading'}\n autocorrect={'off'}\n onBlur={handleChangeFor('bankAccountNumber', 'blur')}\n onInput={handleChangeFor('bankAccountNumber', 'input')}\n />\n </Field>\n\n <Field\n errorMessage={!!errors.bankLocationId && i18n.get('bacs.bankLocationId.invalid')}\n label={i18n.get('bacs.bankLocationId')}\n className={classNames({\n 'adyen-checkout__bacs--bank-location-id': true,\n 'adyen-checkout__field--inactive': status === CONFIRM_STATE || status === 'loading'\n })}\n classNameModifiers={['col-30']}\n isValid={valid.bankLocationId}\n name={'bankLocationId'}\n i18n={i18n}\n >\n <InputText\n value={data.bankLocationId}\n className={'adyen-checkout__bacs-input--bank-location-id'}\n placeholder={props.placeholders.bankLocationId}\n aria-invalid={!valid.bankLocationId}\n aria-label={i18n.get('bacs.bankLocationId')}\n aria-required={'true'}\n required={true}\n readonly={status === CONFIRM_STATE || status === 'loading'}\n autocorrect={'off'}\n onBlur={handleChangeFor('bankLocationId', 'blur')}\n onInput={handleChangeFor('bankLocationId', 'input')}\n />\n </Field>\n </div>\n\n <Field\n errorMessage={getErrorMessage(i18n, errors.shopperEmail, i18n.get('shopperEmail'))}\n label={i18n.get('shopperEmail')}\n className={classNames({\n 'adyen-checkout__bacs--shopper-email': true,\n 'adyen-checkout__field--inactive': status === CONFIRM_STATE || status === 'loading'\n })}\n isValid={valid.shopperEmail}\n name={'emailAddress'}\n i18n={i18n}\n >\n <InputEmail\n value={data.shopperEmail}\n name={'shopperEmail'}\n className={'adyen-checkout__bacs-input--shopper-email'}\n classNameModifiers={['large']}\n placeholder={props.placeholders.shopperEmail}\n spellcheck={false}\n aria-invalid={!valid.shopperEmail}\n aria-label={i18n.get('shopperEmail')}\n aria-required={'true'}\n required={true}\n readonly={status === CONFIRM_STATE || status === 'loading'}\n autocorrect={'off'}\n onInput={handleChangeFor('shopperEmail', 'input')}\n onBlur={handleChangeFor('shopperEmail', 'blur')}\n />\n </Field>\n\n {status === ENTER_STATE && (\n <ConsentCheckbox\n classNameModifiers={['amountConsentCheckbox']}\n errorMessage={!!errors.amountConsentCheckbox}\n label={i18n.get('bacs.consent.amount')}\n onChange={handleChangeFor('amountConsentCheckbox')}\n checked={!!data.amountConsentCheckbox}\n i18n={i18n}\n />\n )}\n\n {status === ENTER_STATE && (\n <ConsentCheckbox\n classNameModifiers={['accountConsentCheckbox']}\n errorMessage={!!errors.accountConsentCheckbox}\n label={i18n.get('bacs.consent.account')}\n onChange={handleChangeFor('accountConsentCheckbox')}\n checked={!!data.accountConsentCheckbox}\n i18n={i18n}\n />\n )}\n\n {props.showPayButton &&\n props.payButton({\n status,\n label:\n status === ENTER_STATE\n ? i18n.get('continue')\n : `${i18n.get('bacs.confirm')} ${\n !!props.amount?.value && !!props.amount?.currency ? i18n.amount(props.amount.value, props.amount.currency) : ''\n }`,\n icon: getImage({ imageFolder: 'components/' })('lock'),\n onClick: handlePayButton\n })}\n </div>\n );\n}\n\nBacsInput.defaultProps = {\n data: {},\n placeholders: {}\n};\n\nexport default BacsInput;\n"],"names":["ENTER_STATE","CONFIRM_STATE","BacsInput","props","i18n","useCoreContext","getImage","useImage","handleChangeFor","triggerValidation","data","valid","errors","isValid","useForm","schema","defaultData","formatters","bacsFormatters","rules","bacsValidationRules","status","setStatus","useState","this","showValidation","useEffect","onChange","h","div","className","classNames","showFormInstruction","FormInstruction","isDropin","InputText","name","value","get","aria-label","readonly","onClick","Field","label","errorMessage","holderName","placeholder","placeholders","aria-invalid","aria-required","required","autocorrect","onBlur","onInput","bankAccountNumber","classNameModifiers","bankLocationId","getErrorMessage","shopperEmail","InputEmail","spellcheck","ConsentCheckbox","amountConsentCheckbox","checked","accountConsentCheckbox","showPayButton","payButton","amount","currency","icon","imageFolder","onSubmit","defaultProps"],"mappings":"2zBAiBA,MAAMA,EAAc,aACdC,EAAgB,eAEtB,SAASC,EAAUC,GACf,MAAMC,KAAEA,GAASC,IACXC,EAAWC,KAEXC,gBAAEA,EAAeC,kBAAEA,EAAiBC,KAAEA,EAAIC,MAAEA,EAAKC,OAAEA,EAAMC,QAAEA,GAAYC,EAAuB,CAChGC,OAAQ,CAAC,aAAc,oBAAqB,iBAAkB,eAAgB,wBAAyB,0BACvGC,YAAab,EAAMO,KACnBO,WAAYC,EACZC,MAAOC,KAGJC,EAAQC,GAAaC,EAASvB,GACrCwB,KAAKF,UAAYA,EACjBE,KAAKC,eAAiBhB,EAoBtB,OAJAiB,GAAU,KACNvB,EAAMwB,SAAS,CAAEjB,OAAMC,QAAOC,SAAQC,WAAQ,GAC/C,CAACH,EAAMC,EAAOC,EAAQC,IAGrBe,EAACC,MAAAA,CACGC,UAAWC,EAAW,CAClB,wBAAwB,EACxB,gCAAiCV,IAAWpB,GAA4B,YAAXoB,KAGhElB,EAAM6B,qBAAuBJ,EAACK,EAC9BZ,MAAAA,GAAUpB,GACP2B,EAACC,MAAAA,CACGC,UAAWC,EAAW,CAClB,8BAA8B,EAC9B,oCAAqC5B,EAAM+B,YAG/CN,EAACO,EAAAA,CACGC,KAAM,WACNN,UAAW,oCACXO,MAAOjC,EAAKkC,IAAI,QAChBC,aAAYnC,EAAKkC,IAAI,QACrBE,UAAU,EACVC,QA7BD,IACRjB,KAAKF,UAAUtB,MAiClB4B,EAACc,EAAAA,CACGZ,U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oD,uBACvBrB,MAAOvC,EAAKkC,IAAI,wBAChBX,SAAUnB,EAAgB,0BAC1BuD,UAAWrD,EAAKsD,uBAChB5D,KAAMA,IAIbD,EAAM8D,eACH9D,EAAM+D,UAAU,CACZ7C,SACAsB,MACItB,IAAWrB,EACLI,EAAKkC,IAAI,YACT,GAAGlC,EAAKkC,IAAI,mBACNnC,EAAMgE,QAAQ9B,OAAWlC,EAAMgE,QAAQC,SAAWhE,EAAK+D,OAAOhE,EAAMgE,OAAO9B,MAAOlC,EAAMgE,OAAOC,UAAY,KAE3HC,KAAM/D,EAAS,CAAEgE,YAAa,eAAxBhE,CAAyC,QAC/CmC,QA5LQ,IACf5B,EAEDQ,IAAWrB,EACJwB,KAAKF,UAAUrB,GACfoB,IAAWpB,EACXE,EAAMoE,gBADV,EAJc/C,KAAKC,mBA+LlC,CAEAvB,EAAUsE,aAAe,CACrB9D,KAAM,CAAC,EACPqC,aAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"BacsInput.js","sources":["../../../../../src/components/BacsDD/components/BacsInput.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useState, useEffect } from 'preact/hooks';\nimport classNames from 'classnames';\nimport { useCoreContext } from '../../../core/Context/CoreProvider';\nimport Field from '../../internal/FormFields/Field';\nimport ConsentCheckbox from '../../internal/FormFields/ConsentCheckbox';\nimport { bacsValidationRules, bacsFormatters } from './validate';\nimport { BacsDataState, BacsInputProps } from './types';\nimport './BacsInput.scss';\n\nimport useForm from '../../../utils/useForm';\nimport useImage from '../../../core/Context/useImage';\nimport InputText from '../../internal/FormFields/InputText';\nimport InputEmail from '../../internal/FormFields/InputEmail';\nimport FormInstruction from '../../internal/FormInstruction';\nimport { getErrorMessage } from '../../../utils/getErrorMessage';\nimport { PREFIX } from '../../internal/Icon/constants';\n\nconst ENTER_STATE = 'enter-data';\nconst CONFIRM_STATE = 'confirm-data';\n\nfunction BacsInput(props: BacsInputProps) {\n const { i18n } = useCoreContext();\n const getImage = useImage();\n\n const { handleChangeFor, triggerValidation, data, valid, errors, isValid } = useForm<BacsDataState>({\n schema: ['holderName', 'bankAccountNumber', 'bankLocationId', 'shopperEmail', 'amountConsentCheckbox', 'accountConsentCheckbox'],\n defaultData: props.data,\n formatters: bacsFormatters,\n rules: bacsValidationRules\n });\n\n const [status, setStatus] = useState(ENTER_STATE);\n this.setStatus = setStatus;\n this.showValidation = triggerValidation;\n\n const handlePayButton = () => {\n if (!isValid) return this.showValidation();\n\n if (status === ENTER_STATE) {\n return this.setStatus(CONFIRM_STATE);\n } else if (status === CONFIRM_STATE) {\n return props.onSubmit();\n }\n };\n\n const handleEdit = () => {\n return this.setStatus(ENTER_STATE);\n };\n\n useEffect(() => {\n props.onChange({ data, valid, errors, isValid });\n }, [data, valid, errors, isValid]);\n\n return (\n <div\n className={classNames({\n 'adyen-checkout__bacs': true,\n 'adyen-checkout__bacs--confirm': status === CONFIRM_STATE || status === 'loading'\n })}\n >\n {props.showFormInstruction && <FormInstruction />}\n {status == CONFIRM_STATE && (\n <div\n className={classNames({\n 'adyen-checkout__bacs--edit': true,\n 'adyen-checkout__bacs--edit-dropin': props.isDropin\n })}\n >\n <InputText\n name={'bacsEdit'}\n className={'adyen-checkout__bacs--edit-button'}\n value={i18n.get('edit')}\n aria-label={i18n.get('edit')}\n readonly={true}\n onClick={handleEdit}\n />\n </div>\n )}\n\n <Field\n className={classNames({\n 'adyen-checkout__bacs--holder-name': true,\n 'adyen-checkout__field--inactive': status === CONFIRM_STATE || status === 'loading'\n })}\n label={i18n.get('bacs.accountHolderName')}\n errorMessage={errors.holderName ? i18n.get('bacs.accountHolderName.invalid') : false}\n isValid={valid.holderName}\n name={'accountHolderName'}\n i18n={i18n}\n >\n <InputText\n name={'bacs.accountHolderName'}\n className={'adyen-checkout__bacs-input--holder-name'}\n placeholder={props.placeholders.holderName}\n value={data.holderName}\n aria-invalid={!valid.holderName}\n aria-label={i18n.get('bacs.accountHolderName')}\n aria-required={'true'}\n required={true}\n readonly={status === CONFIRM_STATE || status === 'loading'}\n autocorrect={'off'}\n onBlur={handleChangeFor('holderName', 'blur')}\n onInput={handleChangeFor('holderName', 'input')}\n />\n </Field>\n\n <div className=\"adyen-checkout__bacs__num-id adyen-checkout__field-wrapper\">\n <Field\n errorMessage={!!errors.bankAccountNumber && i18n.get('bacs.accountNumber.invalid')}\n label={i18n.get('bacs.accountNumber')}\n className={classNames({\n 'adyen-checkout__bacs--bank-account-number': true,\n 'adyen-checkout__field--inactive': status === CONFIRM_STATE || status === 'loading'\n })}\n classNameModifiers={['col-70']}\n isValid={valid.bankAccountNumber}\n name={'bankAccountNumber'}\n i18n={i18n}\n >\n <InputText\n value={data.bankAccountNumber}\n className={'adyen-checkout__bacs-input--bank-account-number'}\n placeholder={props.placeholders.bankAccountNumber}\n aria-invalid={!valid.bankAccountNumber}\n aria-label={i18n.get('bacs.accountNumber')}\n aria-required={'true'}\n required={true}\n readonly={status === CONFIRM_STATE || status === 'loading'}\n autocorrect={'off'}\n onBlur={handleChangeFor('bankAccountNumber', 'blur')}\n onInput={handleChangeFor('bankAccountNumber', 'input')}\n />\n </Field>\n\n <Field\n errorMessage={!!errors.bankLocationId && i18n.get('bacs.bankLocationId.invalid')}\n label={i18n.get('bacs.bankLocationId')}\n className={classNames({\n 'adyen-checkout__bacs--bank-location-id': true,\n 'adyen-checkout__field--inactive': status === CONFIRM_STATE || status === 'loading'\n })}\n classNameModifiers={['col-30']}\n isValid={valid.bankLocationId}\n name={'bankLocationId'}\n i18n={i18n}\n >\n <InputText\n value={data.bankLocationId}\n className={'adyen-checkout__bacs-input--bank-location-id'}\n placeholder={props.placeholders.bankLocationId}\n aria-invalid={!valid.bankLocationId}\n aria-label={i18n.get('bacs.bankLocationId')}\n aria-required={'true'}\n required={true}\n readonly={status === CONFIRM_STATE || status === 'loading'}\n autocorrect={'off'}\n onBlur={handleChangeFor('bankLocationId', 'blur')}\n onInput={handleChangeFor('bankLocationId', 'input')}\n />\n </Field>\n </div>\n\n <Field\n errorMessage={getErrorMessage(i18n, errors.shopperEmail, i18n.get('shopperEmail'))}\n label={i18n.get('shopperEmail')}\n className={classNames({\n 'adyen-checkout__bacs--shopper-email': true,\n 'adyen-checkout__field--inactive': status === CONFIRM_STATE || status === 'loading'\n })}\n isValid={valid.shopperEmail}\n name={'emailAddress'}\n i18n={i18n}\n >\n <InputEmail\n value={data.shopperEmail}\n name={'shopperEmail'}\n className={'adyen-checkout__bacs-input--shopper-email'}\n classNameModifiers={['large']}\n placeholder={props.placeholders.shopperEmail}\n spellcheck={false}\n aria-invalid={!valid.shopperEmail}\n aria-label={i18n.get('shopperEmail')}\n aria-required={'true'}\n required={true}\n readonly={status === CONFIRM_STATE || status === 'loading'}\n autocorrect={'off'}\n onInput={handleChangeFor('shopperEmail', 'input')}\n onBlur={handleChangeFor('shopperEmail', 'blur')}\n />\n </Field>\n\n {status === ENTER_STATE && (\n <ConsentCheckbox\n classNameModifiers={['amountConsentCheckbox']}\n errorMessage={!!errors.amountConsentCheckbox}\n label={i18n.get('bacs.consent.amount')}\n onChange={handleChangeFor('amountConsentCheckbox')}\n checked={!!data.amountConsentCheckbox}\n i18n={i18n}\n />\n )}\n\n {status === ENTER_STATE && (\n <ConsentCheckbox\n classNameModifiers={['accountConsentCheckbox']}\n errorMessage={!!errors.accountConsentCheckbox}\n label={i18n.get('bacs.consent.account')}\n onChange={handleChangeFor('accountConsentCheckbox')}\n checked={!!data.accountConsentCheckbox}\n i18n={i18n}\n />\n )}\n\n {props.showPayButton &&\n props.payButton({\n status,\n label:\n status === ENTER_STATE\n ? i18n.get('continue')\n : `${i18n.get('bacs.confirm')} ${\n !!props.amount?.value && !!props.amount?.currency ? i18n.amount(props.amount.value, props.amount.currency) : ''\n }`,\n icon: getImage({ imageFolder: 'components/' })(`${PREFIX}lock`),\n onClick: handlePayButton\n })}\n </div>\n );\n}\n\nBacsInput.defaultProps = {\n data: {},\n placeholders: {}\n};\n\nexport default BacsInput;\n"],"names":["ENTER_STATE","CONFIRM_STATE","BacsInput","props","i18n","useCoreContext","getImage","useImage","handleChangeFor","triggerValidation","data","valid","errors","isValid","useForm","schema","defaultData","formatters","bacsFormatters","rules","bacsValidationRules","status","setStatus","useState","this","showValidation","useEffect","onChange","h","div","className","classNames","showFormInstruction","FormInstruction","isDropin","InputText","name","value","get","aria-label","readonly","onClick","Field","label","errorMessage","holderName","placeholder","placeholders","aria-invalid","aria-required","required","autocorrect","onBlur","onInput","bankAccountNumber","classNameModifiers","bankLocationId","getErrorMessage","shopperEmail","InputEmail","spellcheck","ConsentCheckbox","amountConsentCheckbox","checked","accountConsentCheckbox","showPayButton","payButton","amount","currency","icon","imageFolder","PREFIX","onSubmit","defaultProps"],"mappings":"q3BAkBA,MAAMA,EAAc,aACdC,EAAgB,eAEtB,SAASC,EAAUC,GACf,MAAMC,KAAEA,GAASC,IACXC,EAAWC,KAEXC,gBAAEA,EAAeC,kBAAEA,EAAiBC,KAAEA,EAAIC,MAAEA,EAAKC,OAAEA,EAAMC,QAAEA,GAAYC,EAAuB,CAChGC,OAAQ,CAAC,aAAc,oBAAqB,iBAAkB,eAAgB,wBAAyB,0BACvGC,YAAab,EAAMO,KACnBO,WAAYC,EACZC,MAAOC,KAGJC,EAAQC,GAAaC,EAASvB,GACrCwB,KAAKF,UAAYA,EACjBE,KAAKC,eAAiBhB,EAoBtB,OAJAiB,GAAU,KACNvB,EAAMwB,SAAS,CAAEjB,OAAMC,QAAOC,SAAQC,WAAQ,GAC/C,CAACH,EAAMC,EAAOC,EAAQC,IAGrBe,EAACC,MAAAA,CACGC,UAAWC,EAAW,CAClB,wBAAwB,EACxB,gCAAiCV,IAAWpB,GAA4B,YAAXoB,KAGhElB,EAAM6B,qBAAuBJ,EAACK,EAC9BZ,MAAAA,GAAUpB,GACP2B,EAACC,MAAAA,CACGC,UAAWC,EAAW,CAClB,8BAA8B,EAC9B,oCAAqC5B,EAAM+B,YAG/CN,EAACO,EAAAA,CACGC,KAAM,WACNN,UAAW,oCACXO,MAAOjC,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BAC1BuD,UAAWrD,EAAKoD,sBAChB1D,KAAMA,IAIbiB,IAAWrB,GACR4B,EAACiC,EAAAA,CACGN,mBAAoB,CAAC,0BACrBX,eAAgBhC,EAAOoD,uBACvBrB,MAAOvC,EAAKkC,IAAI,wBAChBX,SAAUnB,EAAgB,0BAC1BuD,UAAWrD,EAAKsD,uBAChB5D,KAAMA,IAIbD,EAAM8D,eACH9D,EAAM+D,UAAU,CACZ7C,SACAsB,MACItB,IAAWrB,EACLI,EAAKkC,IAAI,YACT,GAAGlC,EAAKkC,IAAI,mBACNnC,EAAMgE,QAAQ9B,OAAWlC,EAAMgE,QAAQC,SAAWhE,EAAK+D,OAAOhE,EAAMgE,OAAO9B,MAAOlC,EAAMgE,OAAOC,UAAY,KAE3HC,KAAM/D,EAAS,CAAEgE,YAAa,eAAxBhE,CAAyC,GAAGiE,SAClD9B,QA5LQ,IACf5B,EAEDQ,IAAWrB,EACJwB,KAAKF,UAAUrB,GACfoB,IAAWpB,EACXE,EAAMqE,gBADV,EAJchD,KAAKC,mBA+LlC,CAEAvB,EAAUuE,aAAe,CACrB/D,KAAM,CAAC,EACPqC,aAAc,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createElement as e}from"../../../external/preact/dist/preact.js";import{useEffect as o,useState as
|
|
1
|
+
import{createElement as e}from"../../../external/preact/dist/preact.js";import{useEffect as o,useState as t}from"../../../external/preact/hooks/dist/hooks.js";import{useCoreContext as r}from"../../../core/Context/CoreProvider.js";import i from"../../internal/FormFields/Field/Field.js";import a from"../../../utils/useForm/useForm.js";import{digitsOnlyFormatter as s}from"../../../utils/Formatters/formatters.js";import l from"../../../core/Context/useImage.js";import d from"../../internal/FormFields/InputText.js";import{PREFIX as n}from"../../internal/Icon/constants.js";function m(m){const{i18n:c}=r(),u=l(),{handleChangeFor:p,triggerValidation:k,data:b,valid:f,errors:h,isValid:C}=a({schema:["blikCode"],rules:{blikCode:{validate:e=>6===e?.length,errorMessage:"blik.invalid",modes:["blur"]}},formatters:{blikCode:s}});o((()=>{m.onChange({data:b,errors:h,valid:f,isValid:C},this)}),[b,f,h,C]);const[g,F]=t("ready");return this.setStatus=F,this.showValidation=k,e("div",{className:"adyen-checkout__blik"},e("p",{className:"adyen-checkout__blik__helper"},c.get("blik.help")),e(i,{errorMessage:!!h.blikCode&&c.get(h.blikCode.errorMessage),label:c.get("blik.code"),classNameModifiers:["blikCode","50"],isValid:f.blikCode,dir:"ltr",name:"blikCode"},e(d,{value:b.blikCode,name:"blikCode",spellcheck:!1,required:!0,autocorrect:"off",autocomplete:"off",onInput:p("blikCode","input"),onBlur:p("blikCode","blur"),placeholder:m?.placeholders?.blikCode,inputMode:"numeric",maxLength:6})),m.showPayButton&&m.payButton({status:g,icon:u({imageFolder:"components/"})(`${n}lock`)}))}m.defaultProps={data:{blikCode:""}};export{m as default};
|
|
2
2
|
//# sourceMappingURL=BlikInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlikInput.js","sources":["../../../../../src/components/Blik/components/BlikInput.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useState, useEffect } from 'preact/hooks';\nimport { useCoreContext } from '../../../core/Context/CoreProvider';\nimport Field from '../../internal/FormFields/Field';\nimport './BlikInput.scss';\nimport useForm from '../../../utils/useForm';\nimport { digitsOnlyFormatter } from '../../../utils/Formatters/formatters';\nimport useImage from '../../../core/Context/useImage';\nimport InputText from '../../internal/FormFields/InputText';\nimport { UIElementProps } from '../../internal/UIElement/types';\n\ninterface BlikInputProps extends UIElementProps {\n data?: BlikInputDataState;\n placeholders?: BlikInputDataState;\n}\n\ninterface BlikInputDataState {\n blikCode: string;\n}\n\nfunction BlikInput(props: BlikInputProps) {\n const { i18n } = useCoreContext();\n const getImage = useImage();\n const { handleChangeFor, triggerValidation, data, valid, errors, isValid } = useForm<BlikInputDataState>({\n schema: ['blikCode'],\n rules: {\n blikCode: {\n validate: code => code?.length === 6,\n errorMessage: 'blik.invalid',\n modes: ['blur']\n }\n },\n formatters: {\n blikCode: digitsOnlyFormatter\n }\n });\n\n useEffect(() => {\n props.onChange({ data, errors, valid, isValid }, this);\n }, [data, valid, errors, isValid]);\n\n const [status, setStatus] = useState('ready');\n this.setStatus = setStatus;\n this.showValidation = triggerValidation;\n\n return (\n <div className=\"adyen-checkout__blik\">\n <p className=\"adyen-checkout__blik__helper\">{i18n.get('blik.help')}</p>\n <Field\n errorMessage={!!errors.blikCode && i18n.get(errors.blikCode.errorMessage)}\n label={i18n.get('blik.code')}\n classNameModifiers={['blikCode', '50']}\n isValid={valid.blikCode}\n dir={'ltr'}\n name={'blikCode'}\n >\n <InputText\n value={data.blikCode}\n name={'blikCode'}\n spellcheck={false}\n required={true}\n autocorrect={'off'}\n autocomplete={'off'}\n onInput={handleChangeFor('blikCode', 'input')}\n onBlur={handleChangeFor('blikCode', 'blur')}\n placeholder={props?.placeholders?.blikCode}\n inputMode={'numeric'}\n maxLength={6}\n />\n </Field>\n\n {props.showPayButton &&\n props.payButton({\n status,\n icon: getImage({ imageFolder: 'components/' })(
|
|
1
|
+
{"version":3,"file":"BlikInput.js","sources":["../../../../../src/components/Blik/components/BlikInput.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useState, useEffect } from 'preact/hooks';\nimport { useCoreContext } from '../../../core/Context/CoreProvider';\nimport Field from '../../internal/FormFields/Field';\nimport './BlikInput.scss';\nimport useForm from '../../../utils/useForm';\nimport { digitsOnlyFormatter } from '../../../utils/Formatters/formatters';\nimport useImage from '../../../core/Context/useImage';\nimport InputText from '../../internal/FormFields/InputText';\nimport { UIElementProps } from '../../internal/UIElement/types';\nimport { PREFIX } from '../../internal/Icon/constants';\n\ninterface BlikInputProps extends UIElementProps {\n data?: BlikInputDataState;\n placeholders?: BlikInputDataState;\n}\n\ninterface BlikInputDataState {\n blikCode: string;\n}\n\nfunction BlikInput(props: BlikInputProps) {\n const { i18n } = useCoreContext();\n const getImage = useImage();\n const { handleChangeFor, triggerValidation, data, valid, errors, isValid } = useForm<BlikInputDataState>({\n schema: ['blikCode'],\n rules: {\n blikCode: {\n validate: code => code?.length === 6,\n errorMessage: 'blik.invalid',\n modes: ['blur']\n }\n },\n formatters: {\n blikCode: digitsOnlyFormatter\n }\n });\n\n useEffect(() => {\n props.onChange({ data, errors, valid, isValid }, this);\n }, [data, valid, errors, isValid]);\n\n const [status, setStatus] = useState('ready');\n this.setStatus = setStatus;\n this.showValidation = triggerValidation;\n\n return (\n <div className=\"adyen-checkout__blik\">\n <p className=\"adyen-checkout__blik__helper\">{i18n.get('blik.help')}</p>\n <Field\n errorMessage={!!errors.blikCode && i18n.get(errors.blikCode.errorMessage)}\n label={i18n.get('blik.code')}\n classNameModifiers={['blikCode', '50']}\n isValid={valid.blikCode}\n dir={'ltr'}\n name={'blikCode'}\n >\n <InputText\n value={data.blikCode}\n name={'blikCode'}\n spellcheck={false}\n required={true}\n autocorrect={'off'}\n autocomplete={'off'}\n onInput={handleChangeFor('blikCode', 'input')}\n onBlur={handleChangeFor('blikCode', 'blur')}\n placeholder={props?.placeholders?.blikCode}\n inputMode={'numeric'}\n maxLength={6}\n />\n </Field>\n\n {props.showPayButton &&\n props.payButton({\n status,\n icon: getImage({ imageFolder: 'components/' })(`${PREFIX}lock`)\n })}\n </div>\n );\n}\n\nBlikInput.defaultProps = { data: { blikCode: '' } };\n\nexport default BlikInput;\n"],"names":["BlikInput","props","i18n","useCoreContext","getImage","useImage","handleChangeFor","triggerValidation","data","valid","errors","isValid","useForm","schema","rules","blikCode","validate","code","length","errorMessage","modes","formatters","digitsOnlyFormatter","useEffect","onChange","this","status","setStatus","useState","showValidation","h","div","className","p","get","Field","label","classNameModifiers","dir","name","InputText","value","spellcheck","required","autocorrect","autocomplete","onInput","onBlur","placeholder","placeholders","inputMode","maxLength","showPayButton","payButton","icon","imageFolder","PREFIX","defaultProps"],"mappings":"8jBAqBA,SAASA,EAAUC,GACf,MAAMC,KAAEA,GAASC,IACXC,EAAWC,KACXC,gBAAEA,EAAeC,kBAAEA,EAAiBC,KAAEA,EAAIC,MAAEA,EAAKC,OAAEA,EAAMC,QAAEA,GAAYC,EAA4B,CACrGC,OAAQ,CAAC,YACTC,MAAO,CACHC,SAAU,CACNC,SAAUC,GAAyB,IAAjBA,GAAMC,OACxBC,aAAc,eACdC,MAAO,CAAC,UAGhBC,WAAY,CACRN,SAAUO,KAIlBC,GAAU,KACNtB,EAAMuB,SAAS,CAAEhB,OAAME,SAAQD,QAAOE,WAAWc,KAAI,GACtD,CAACjB,EAAMC,EAAOC,EAAQC,IAEzB,MAAOe,EAAQC,GAAaC,EAAS,SAIrC,OAHAH,KAAKE,UAAYA,EACjBF,KAAKI,eAAiBtB,EAGlBuB,EAACC,MAAAA,CAAIC,UAAU,wBACXF,EAACG,IAAAA,CAAED,UAAU,gCAAgC9B,EAAKgC,IAAI,cACtDJ,EAACK,EAAAA,CACGhB,eAAgBT,EAAOK,UAAYb,EAAKgC,IAAIxB,EAAOK,SAASI,cAC5DiB,MAAOlC,EAAKgC,IAAI,aAChBG,mBAAoB,CAAC,WAAY,MACjC1B,QAASF,EAAMM,SACfuB,IAAK,MACLC,KAAM,YAENT,EAACU,EAAAA,CACGC,MAAOjC,EAAKO,SACZwB,KAAM,WACNG,YAAY,EACZC,UAAU,EACVC,YAAa,MACbC,aAAc,MACdC,QAASxC,EAAgB,WAAY,SACrCyC,OAAQzC,EAAgB,WAAY,QACpC0C,YAAa/C,GAAOgD,cAAclC,SAClCmC,UAAW,UACXC,UAAW,KAIlBlD,EAAMmD,eACHnD,EAAMoD,UAAU,CACZ3B,SACA4B,KAAMlD,EAAS,CAAEmD,YAAa,eAAxBnD,CAAyC,GAAGoD,WAItE,CAEAxD,EAAUyD,aAAe,CAAEjD,KAAM,CAAEO,SAAU"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createElement as e,Fragment as r}from"../../../../external/preact/dist/preact.js";import{useRef as s,useMemo as o,useState as t,useCallback as n,useEffect as a}from"../../../../external/preact/hooks/dist/hooks.js";import l from"../../../internal/SecuredFields/SFP/SecuredFieldsProvider.js";import i from"./defaultProps.js";import{AddressModeOptions as d}from"./types.js";import{
|
|
1
|
+
import{createElement as e,Fragment as r}from"../../../../external/preact/dist/preact.js";import{useRef as s,useMemo as o,useState as t,useCallback as n,useEffect as a}from"../../../../external/preact/hooks/dist/hooks.js";import l from"../../../internal/SecuredFields/SFP/SecuredFieldsProvider.js";import i from"./defaultProps.js";import{AddressModeOptions as d}from"./types.js";import{ENCRYPTED_CARD_NUMBER as u,DATE_POLICY_REQUIRED as c,CVC_POLICY_REQUIRED as m}from"../../../internal/SecuredFields/lib/constants.js";import{cardInputFormatters as p,cardInputValidationRules as h,getRuleByNameAndMode as f}from"./validate.js";import y from"../../../internal/SecuredFields/binLookup/extensions.js";import b from"../../../../utils/useForm/useForm.js";import{mapFieldKey as S,handlePartialAddressMode as N,extractPropsForSFP as g,extractPropsForCardFields as A,getLayout as F,lookupBlurBasedErrors as C}from"./utils.js";import{usePrevious as j}from"../../../../utils/hookUtils.js";import k from"../../../internal/Address/Specifications.js";import{StoredCardFieldsWrapper as R}from"./components/StoredCardFieldsWrapper.js";import{CardFieldsWrapper as x}from"./components/CardFieldsWrapper.js";import{getAutoJumpHandler as w,setFocusOnFirstField as P,getFocusHandler as B,getAddressHandler as I}from"./handlers.js";import v from"../../../../external/classnames/index.js";import{getPartialAddressValidationRules as V}from"../../../internal/Address/validate.js";import{ERROR_ACTION_BLUR_SCENARIO as E,ERROR_ACTION_FOCUS_FIELD as M}from"../../../../core/Errors/constants.js";import O from"../../../../core/Errors/useSRPanelContext.js";import q from"../../../../core/Context/useImage.js";import{getArrayDifferences as T}from"../../../../utils/arrayUtils.js";import D from"../../../internal/FormInstruction/FormInstruction.js";import{PREFIX as L}from"../../../internal/Icon/constants.js";const _=i=>{const _=s(null),K=s(!1),H=q(),{setSRMessagesFromObjects:U,setSRMessagesFromStrings:z,clearSRPanel:W,shouldMoveFocusSR:$}=O(),G=U?.({fieldTypeMappingFn:S}),J=s(null),Q=e=>{J.current=e},X=s({});Object.keys(X.current).length||i.setComponentRef(X.current);const Y=s(0),Z=s(!1),ee=o((()=>new k(i.specifications)),[i.specifications]);X.current.sfp=_;const[re,se]=t("ready"),[oe,te]=t({}),[ne,ae]=t({...i.holderNameRequired&&{holderName:!1}}),[le,ie]=t({...i.hasHolderName&&{holderName:i.data.holderName??""}}),[de,ue]=t(null),[ce,me]=t(""),[pe,he]=t(!1),[fe,ye]=t(c),[be,Se]=t(m),[Ne,ge]=t(null),[Ae,Fe]=t([]),[Ce,je]=t(i.storedPaymentMethodId?i.brand:""),ke=i.billingAddressMode!==d.none&&i.billingAddressRequired,Re=N(i.billingAddressMode),xe=s(Re&&i.data?.billingAddress?.country),[we,Pe]=t(!1),[Be,Ie]=t(ke?i.data.billingAddress:null),[ve,Ve]=t(!1),[Ee,Me]=t(""),[Oe,qe]=t({value:null}),[Te,De]=t(null),{handleChangeFor:Le,triggerValidation:_e,data:Ke,valid:He,errors:Ue,setSchema:ze,setData:We,setValid:$e,setErrors:Ge}=b({schema:[],defaultData:i.data,formatters:p,rules:h}),Je=!!Object.keys(i.installmentOptions).length&&"debit"!==i.fundingSource,Qe=i.showInstallmentAmounts??!0,Xe="kr"===(Ne??i.countryCode),Ye=i.configuration.koreanAuthenticationRequired&&Xe,Ze=ve&&"auto"===i.configuration.socialSecurityNumberMode||"show"===i.configuration.socialSecurityNumberMode,er=(e,r)=>{i.onFocus({fieldType:e,event:r})},rr=(e,r)=>{i.onBlur({fieldType:e,event:r})},sr=B(me,er,rr),or=()=>F({props:i,showKCP:Ye,showBrazilianSSN:Ze,...i.billingAddressRequired&&{countrySpecificSchemas:ee.getAddressSchemaForCountry(Be?.country),billingAddressRequiredFields:i.billingAddressRequiredFields}}),tr=n((e=>{const r="webInternalElement"!==e.fieldType?e.fieldType:e.name;De(r)}),[]),nr=I(We,$e,Ge),ar=w(Z,_,or()),lr=o((()=>y(i,{sfp:_},{dualBrandSelectElements:Ae,setDualBrandSelectElements:Fe,setSelectedBrandValue:je,issuingCountryCode:Ne,setIssuingCountryCode:ge},Y)),[Ae,Ne]);X.current.showValidation=()=>{K.current=!0,W?.(),_.current.showValidation(),_e(["holderName","socialSecurityNumber","taxNumber"]),J?.current&&J.current.showValidation()},X.current.processBinLookupResponse=(e,r)=>{lr.processBinLookup(e,r)},X.current.setStatus=se,a((()=>(X.current.setFocusOn=_.current.setFocusOn,X.current.updateStyles=_.current.updateStyles,X.current.handleUnsupportedCard=_.current.handleUnsupportedCard,()=>{_.current.destroy()})),[]),a((()=>{const e=[...i.hasHolderName?["holderName"]:[],...Ze?["socialSecurityNumber"]:[],...Ye?["taxNumber"]:[],...ke?["billingAddress"]:[]];ze(e)}),[i.hasHolderName,Ze,Ye]),a((()=>{ie({...le,holderName:Ke.holderName??"",taxNumber:Ke.taxNumber}),Me(Ke.socialSecurityNumber),ke&&Ie({...Ke.billingAddress}),ae({...ne,holderName:!i.holderNameRequired||He.holderName,socialSecurityNumber:!!He.socialSecurityNumber&&He.socialSecurityNumber,taxNumber:!!He.taxNumber&&He.taxNumber,billingAddress:!!He.billingAddress&&He.billingAddress});const e=!!Ue.billingAddress&&Object.entries(Ue.billingAddress).reduce(((e,[,r])=>e||null!=r),!1);te({...oe,holderName:i.holderNameRequired&&Ue.holderName?Ue.holderName:null,socialSecurityNumber:Ze&&Ue.socialSecurityNumber?Ue.socialSecurityNumber:null,taxNumber:Ye&&Ue.taxNumber?Ue.taxNumber:null,billingAddress:ke&&e?Ue.billingAddress:null})}),[Ke,He,Ue]);const ir=j(de);a((()=>{const e=ne.holderName,r=pe,s=!ke||ne.billingAddress,o=!Ye||!!ne.taxNumber&&!!ne.encryptedPassword,t=!Ze||!!ne.socialSecurityNumber,n=r&&e&&s&&o&&t,a=_.current.mapErrorsToValidationRuleResult(),l={...oe,...a},{billingAddress:d,...u}=l,c={...u,...d},m=G?.({errors:c,isValidating:K.current,layout:or(),countrySpecificLabels:ee.getAddressLabelsForCountry(Be?.country)??Re?.default?.labels}),p=m?.currentErrorsSortedByLayout;switch(ue(p),m?.action){case M:$&&P(K.current,_,m?.fieldToFocus),setTimeout((()=>{K.current=!1}),300);break;case E:{const e=T(p,ir,"field"),r=e?.[0];if(r){const e=C(r.errorCode)?r.errorMessage:null;z(e)}else W();break}}if(p){const e=T(p,ir,"field");e?.forEach((e=>{const r={fieldType:e.field,errorCode:e.errorCode};i.onValidationErrorAnalytics(r)}))}i.onChange({data:le,valid:ne,errors:l,isValid:n,billingAddress:Be,selectedBrandValue:Ce,storePaymentMethod:we,socialSecurityNumber:Ee,installments:Oe})}),[le,ne,oe,Ce,we,Oe]);const dr=i.storedPaymentMethodId?R:x;return e(r,null,e(l,{ref:_,...g(i),styles:{...i.styles},koreanAuthenticationRequired:i.configuration.koreanAuthenticationRequired,hasKoreanFields:!(!i.configuration.koreanAuthenticationRequired||"kr"!==i.countryCode),onChange:(e,r)=>{if(e.autoCompleteName){if(!i.hasHolderName)return;const r=f("holderName","blur")(e.autoCompleteName)?e.autoCompleteName:null;r&&(We("holderName",r),$e("holderName",!0),Ge("holderName",null))}else i.autoFocus&&Y.current>0&&"handleOnFieldValid"===r?.event&&r?.fieldType===u&&e.valid.encryptedCardNumber&&ar(),ie({...le,...e.data}),te({...oe,...e.errors}),ae({...ne,...e.valid}),he(e.isSfpValid),Se(e.cvcPolicy),Ve(e.showSocialSecurityNumber),ye(e.expiryDatePolicy)},onBrand:i.onBrand,onFocus:sr,type:i.brand,disableIOSArrowKeys:i.disableIOSArrowKeys?tr:null,render:({setRootNode:r,setFocusOn:s},o)=>e("div",{ref:r,className:v({"adyen-checkout__card-input":!0,"adyen-checkout-card-input__wrapper":!0,[`adyen-checkout__card-input--${i.fundingSource??"credit"}`]:!0,"adyen-checkout__card-input--loading":"loading"===re}),role:"form"},i.showFormInstruction&&e(D,null),e(dr,{...A(i),data:le,valid:ne,errors:oe,handleChangeFor:Le,focusedElement:ce,setFocusOn:s,sfpState:o,cvcPolicy:be,hasInstallments:Je,showAmountsInInstallments:Qe,handleInstallments:qe,brandsIcons:i.brandsIcons,formData:Ke,formErrors:Ue,formValid:He,expiryDatePolicy:fe,dualBrandSelectElements:Ae,extensions:lr,selectedBrandValue:Ce,showKCP:Ye,showBrazilianSSN:Ze,socialSecurityNumber:Ee,handleOnStoreDetails:Pe,setAddressRef:Q,billingAddress:Be,billingAddressValidationRules:Re&&V(xe.current),partialAddressSchema:Re,handleAddress:nr,onAddressLookup:i.onAddressLookup,onAddressSelected:i.onAddressSelected,addressSearchDebounceMs:i.addressSearchDebounceMs,iOSFocusedField:Te,onFieldFocusAnalytics:er,onFieldBlurAnalytics:rr}))}),i.showPayButton&&i.payButton({status:re,variant:i.isPayButtonPrimaryVariant?"primary":"secondary",icon:H({imageFolder:"components/"})(`${L}lock`)}))};_.defaultProps=i;export{_ as default};
|
|
2
2
|
//# sourceMappingURL=CardInput.js.map
|
|
@@ -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 { SetSRMessagesReturnObject, SortedErrorObject } from '../../../../core/Errors/types';\nimport { handlePartialAddressMode, extractPropsForCardFields, extractPropsForSFP, getLayout, lookupBlurBasedErrors, mapFieldKey } from './utils';\nimport { usePrevious } from '../../../../utils/hookUtils';\nimport Specifications from '../../../internal/Address/Specifications';\nimport { StoredCardFieldsWrapper } from './components/StoredCardFieldsWrapper';\nimport { CardFieldsWrapper } from './components/CardFieldsWrapper';\nimport { getAddressHandler, getAutoJumpHandler, getFocusHandler, setFocusOnFirstField } from './handlers';\nimport { InstallmentsObj } from './components/Installments/Installments';\nimport { TouchStartEventObj } from './components/types';\nimport classNames from 'classnames';\nimport { getPartialAddressValidationRules } from '../../../internal/Address/validate';\nimport { ERROR_ACTION_BLUR_SCENARIO, ERROR_ACTION_FOCUS_FIELD } from '../../../../core/Errors/constants';\nimport useSRPanelContext from '../../../../core/Errors/useSRPanelContext';\nimport { SetSRMessagesReturnFn } from '../../../../core/Errors/SRPanelProvider';\nimport useImage from '../../../../core/Context/useImage';\nimport { getArrayDifferences } from '../../../../utils/arrayUtils';\nimport FormInstruction from '../../../internal/FormInstruction';\nimport { AddressData } from '../../../../types/global-types';\nimport { CbObjOnFocus } from '../../../internal/SecuredFields/lib/types';\nimport { FieldErrorAnalyticsObject } from '../../../../core/Analytics/types';\n\nconst CardInput = (props: CardInputProps) => {\n const sfp = useRef(null);\n const isValidating = useRef(false);\n const getImage = useImage();\n\n /** SR stuff */\n const { setSRMessagesFromObjects, setSRMessagesFromStrings, clearSRPanel, shouldMoveFocusSR } = useSRPanelContext();\n\n // Generate a setSRMessages function - implemented as a partial, since the initial set of arguments don't change.\n const setSRMessages: SetSRMessagesReturnFn = setSRMessagesFromObjects?.({\n fieldTypeMappingFn: mapFieldKey\n });\n /** end SR stuff */\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 [sortedErrorList, setSortedErrorList] = useState<SortedErrorObject[]>(null);\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 * 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 | CbObjOnFocus) => {\n props.onFocus({ fieldType: who, event: e });\n };\n const onFieldBlurAnalytics = (who: string, e: Event | CbObjOnFocus) => {\n props.onBlur({ fieldType: who, event: e });\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 // Get the previous value\n const previousSortedErrors = usePrevious(sortedErrorList);\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 // Extract and then flatten billingAddress errors into a new object with *all* the field errors at top level\n const { billingAddress: extractedAddressErrors, ...errorsWithoutAddress } = mergedErrors;\n\n const errorsForPanel = { ...errorsWithoutAddress, ...extractedAddressErrors };\n\n // Pass dynamic props (errors, layout etc) to SRPanel via partial\n const srPanelResp: SetSRMessagesReturnObject = setSRMessages?.({\n errors: errorsForPanel,\n isValidating: isValidating.current,\n layout: retrieveLayout(),\n // If we don't have country specific address labels, we might have a label related to a partialAddressSchema (i.e. zipCode)\n countrySpecificLabels: specifications.getAddressLabelsForCountry(billingAddress?.country) ?? partialAddressSchema?.default?.labels\n });\n\n /**\n * Need extra actions after setting SRPanel messages in order to focus field (if required) and because we have some errors that are fired onBlur\n */\n const currentErrorsSortedByLayout = srPanelResp?.currentErrorsSortedByLayout;\n\n // Store the array of sorted error objects separately so that we can use it to make comparisons between the old and new arrays\n setSortedErrorList(currentErrorsSortedByLayout);\n\n switch (srPanelResp?.action) {\n // A call to focus the first field in error will always follow the call to validate the whole form\n case ERROR_ACTION_FOCUS_FIELD:\n if (shouldMoveFocusSR) setFocusOnFirstField(isValidating.current, sfp, srPanelResp?.fieldToFocus);\n // Remove 'showValidation' mode - allowing time for collation of all the fields in error whilst it is 'showValidation' mode (some errors come in a second render pass)\n setTimeout(() => {\n isValidating.current = false;\n }, 300);\n break;\n /** On blur scenario: not validating, i.e. trying to submit form, but there might be an error, either to set or to clear */\n case ERROR_ACTION_BLUR_SCENARIO: {\n const difference = getArrayDifferences<SortedErrorObject, string>(currentErrorsSortedByLayout, previousSortedErrors, 'field');\n\n const latestErrorMsg = difference?.[0];\n\n if (latestErrorMsg) {\n // Use the error code to look up whether error is actually a blur based one (most are but some SF ones aren't)\n const isBlurBasedError = lookupBlurBasedErrors(latestErrorMsg.errorCode);\n\n /**\n * ONLY ADD BLUR BASED ERRORS TO THE ERROR PANEL - doing this step prevents the non-blur based errors from being read out twice\n * (once from the aria-live, error panel & once from the aria-describedby element)\n */\n const latestSRError = isBlurBasedError ? latestErrorMsg.errorMessage : null;\n // console.log('### CardInput2::componentDidUpdate:: #2 (not validating) single error:: latestSRError', latestSRError);\n setSRMessagesFromStrings(latestSRError);\n } else {\n // called when previousSortedErrors.length >= currentErrorsSortedByLayout.length\n // console.log('### CardInput2::componentDidUpdate:: #3(not validating) clearing errors:: NO latestErrorMsg');\n clearSRPanel();\n }\n break;\n }\n default:\n break;\n }\n\n // Analytics\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 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={props.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 {props.showFormInstruction && <FormInstruction />}\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 {props.showPayButton &&\n props.payButton({\n status,\n variant: props.isPayButtonPrimaryVariant ? 'primary' : 'secondary',\n icon: getImage({ imageFolder: 'components/' })('lock')\n })}\n </Fragment>\n );\n};\n\nCardInput.defaultProps = defaultProps;\n\nexport default CardInput;\n"],"names":["CardInput","props","sfp","useRef","isValidating","getImage","useImage","setSRMessagesFromObjects","setSRMessagesFromStrings","clearSRPanel","shouldMoveFocusSR","useSRPanelContext","setSRMessages","fieldTypeMappingFn","mapFieldKey","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","sortedErrorList","setSortedErrorList","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","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","handleFocus","getFocusHandler","retrieveLayout","getLayout","countrySpecificSchemas","getAddressSchemaForCountry","billingAddressRequiredFields","handleTouchstartIOS","useCallback","obj","elementType","name","handleAddress","getAddressHandler","doPanAutoJump","getAutoJumpHandler","extensions","CIExtensions","showValidation","processBinLookupResponse","binLookupResponse","isReset","processBinLookup","useEffect","setFocusOn","updateStyles","handleUnsupportedCard","destroy","newSchema","taxNumber","addressHasErrors","entries","reduce","acc","error","previousSortedErrors","usePrevious","holderNameValid","sfpValid","addressValid","koreanAuthentication","encryptedPassword","socialSecurityNumberValid","isValid","sfStateErrorsObj","mapErrorsToValidationRuleResult","mergedErrors","extractedAddressErrors","errorsWithoutAddress","errorsForPanel","srPanelResp","layout","countrySpecificLabels","getAddressLabelsForCountry","default","labels","currentErrorsSortedByLayout","action","ERROR_ACTION_FOCUS_FIELD","setFocusOnFirstField","fieldToFocus","setTimeout","ERROR_ACTION_BLUR_SCENARIO","difference","getArrayDifferences","latestErrorMsg","latestSRError","lookupBlurBasedErrors","errorCode","errorMessage","newErrors","forEach","errorItem","aObj","field","onValidationErrorAnalytics","onChange","FieldToRender","StoredCardFieldsWrapper","CardFieldsWrapper","h","Fragment","SecuredFieldsProvider","extractPropsForSFP","styles","hasKoreanFields","sfState","eventDetails","autoCompleteName","acHolderName","getRuleByNameAndMode","holderNameValidationFn","autoFocus","ENCRYPTED_CARD_NUMBER","encryptedCardNumber","onBrand","type","disableIOSArrowKeys","render","setRootNode","sfpState","div","className","classNames","role","showFormInstruction","FormInstruction","extractPropsForCardFields","handleInstallments","brandsIcons","handleOnStoreDetails","billingAddressValidationRules","getPartialAddressValidationRules","onAddressLookup","onAddressSelected","addressSearchDebounceMs","showPayButton","payButton","variant","isPayButtonPrimaryVariant","icon","imageFolder","defaultProps"],"mappings":"yxDAiCA,MAAMA,EAAaC,IACf,MAAMC,EAAMC,EAAO,MACbC,EAAeD,GAAO,GACtBE,EAAWC,KAGXC,yBAAEA,EAAwBC,yBAAEA,EAAwBC,aAAEA,EAAYC,kBAAEA,GAAsBC,IAG1FC,EAAuCL,IAA2B,CACpEM,mBAAoBC,IAIlBC,EAAoBZ,EAAO,MAC3Ba,EAAgBC,IAClBF,EAAkBG,QAAUD,CAAAA,EAG1BE,EAAehB,EAAqB,CAAA,GAErCiB,OAAOC,KAAKF,EAAaD,SAASI,QACnCrB,EAAMsB,gBAAgBJ,EAAaD,SAGvC,MAAMM,EAAkBrB,EAAO,GACzBsB,EAAgBtB,GAAO,GAEvBuB,EAAiBC,GAAQ,IAAM,IAAIC,EAAe3B,EAAMyB,iBAAiB,CAACzB,EAAMyB,iBAGtFP,EAAaD,QAAQhB,IAAMA,EAK3B,MAAO2B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/B1B,EAACH,GAAAA,IAEO8B,EAA0BjO,GAG9BqC,KAAMA,GACNJ,MAAOA,GACPF,OAAQA,GACRmD,gBAAiBA,GACjBxC,eAAgBA,GAChBoG,WAAYA,EACZ4E,SAAUA,EACVzK,UAAWA,GACXiD,gBAAiBA,GACjBG,0BAA2BA,GAC3B6H,mBAAoBpJ,GAEpBqJ,YAAanO,EAAMmO,YACnB/I,SAAUA,GACVE,WAAYA,GACZD,UAAWA,GACXvC,iBAAkBA,GAClBQ,wBAAyBA,GACzBgF,WAAYA,GACZ9E,mBAAoBA,GAEpBiD,QAASA,GAETG,iBAAkBA,GAClBjC,qBAAsBA,GAEtByJ,qBAAsB7J,GAEtBxD,cAAeA,EACfqD,eAAgBA,GAChBiK,8BAA+BpK,IAAwBqK,EAAiCnK,GAAsBlD,SAC9GgD,qBAAsBA,GACtBiE,cAAeA,GACfqG,gBAAiBvO,EAAMuO,gBACvBC,kBAAmBxO,EAAMwO,kBACzBC,wBAAyBzO,EAAMyO,wBAE/BzJ,gBAAiBA,GAEjB8B,sBAAuBA,GACvBM,qBAAsBA,QAKrCpH,EAAM0O,eACH1O,EAAM2O,UAAU,CACZ/M,UACAgN,QAAS5O,EAAM6O,0BAA4B,UAAY,YACvDC,KAAM1O,EAAS,CAAE2O,YAAa,eAAxB3O,CAAyC,UACnD,EAKhBL,EAAUiP,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 { SetSRMessagesReturnObject, SortedErrorObject } from '../../../../core/Errors/types';\nimport { handlePartialAddressMode, extractPropsForCardFields, extractPropsForSFP, getLayout, lookupBlurBasedErrors, mapFieldKey } from './utils';\nimport { usePrevious } from '../../../../utils/hookUtils';\nimport Specifications from '../../../internal/Address/Specifications';\nimport { StoredCardFieldsWrapper } from './components/StoredCardFieldsWrapper';\nimport { CardFieldsWrapper } from './components/CardFieldsWrapper';\nimport { getAddressHandler, getAutoJumpHandler, getFocusHandler, setFocusOnFirstField } from './handlers';\nimport { InstallmentsObj } from './components/Installments/Installments';\nimport { TouchStartEventObj } from './components/types';\nimport classNames from 'classnames';\nimport { getPartialAddressValidationRules } from '../../../internal/Address/validate';\nimport { ERROR_ACTION_BLUR_SCENARIO, ERROR_ACTION_FOCUS_FIELD } from '../../../../core/Errors/constants';\nimport useSRPanelContext from '../../../../core/Errors/useSRPanelContext';\nimport { SetSRMessagesReturnFn } from '../../../../core/Errors/SRPanelProvider';\nimport useImage from '../../../../core/Context/useImage';\nimport { getArrayDifferences } from '../../../../utils/arrayUtils';\nimport FormInstruction from '../../../internal/FormInstruction';\nimport { AddressData } from '../../../../types/global-types';\nimport { CbObjOnFocus } from '../../../internal/SecuredFields/lib/types';\nimport { FieldErrorAnalyticsObject } from '../../../../core/Analytics/types';\nimport { PREFIX } from '../../../internal/Icon/constants';\n\nconst CardInput = (props: CardInputProps) => {\n const sfp = useRef(null);\n const isValidating = useRef(false);\n const getImage = useImage();\n\n /** SR stuff */\n const { setSRMessagesFromObjects, setSRMessagesFromStrings, clearSRPanel, shouldMoveFocusSR } = useSRPanelContext();\n\n // Generate a setSRMessages function - implemented as a partial, since the initial set of arguments don't change.\n const setSRMessages: SetSRMessagesReturnFn = setSRMessagesFromObjects?.({\n fieldTypeMappingFn: mapFieldKey\n });\n /** end SR stuff */\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 [sortedErrorList, setSortedErrorList] = useState<SortedErrorObject[]>(null);\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 * 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 | CbObjOnFocus) => {\n props.onFocus({ fieldType: who, event: e });\n };\n const onFieldBlurAnalytics = (who: string, e: Event | CbObjOnFocus) => {\n props.onBlur({ fieldType: who, event: e });\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 // Get the previous value\n const previousSortedErrors = usePrevious(sortedErrorList);\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 // Extract and then flatten billingAddress errors into a new object with *all* the field errors at top level\n const { billingAddress: extractedAddressErrors, ...errorsWithoutAddress } = mergedErrors;\n\n const errorsForPanel = { ...errorsWithoutAddress, ...extractedAddressErrors };\n\n // Pass dynamic props (errors, layout etc) to SRPanel via partial\n const srPanelResp: SetSRMessagesReturnObject = setSRMessages?.({\n errors: errorsForPanel,\n isValidating: isValidating.current,\n layout: retrieveLayout(),\n // If we don't have country specific address labels, we might have a label related to a partialAddressSchema (i.e. zipCode)\n countrySpecificLabels: specifications.getAddressLabelsForCountry(billingAddress?.country) ?? partialAddressSchema?.default?.labels\n });\n\n /**\n * Need extra actions after setting SRPanel messages in order to focus field (if required) and because we have some errors that are fired onBlur\n */\n const currentErrorsSortedByLayout = srPanelResp?.currentErrorsSortedByLayout;\n\n // Store the array of sorted error objects separately so that we can use it to make comparisons between the old and new arrays\n setSortedErrorList(currentErrorsSortedByLayout);\n\n switch (srPanelResp?.action) {\n // A call to focus the first field in error will always follow the call to validate the whole form\n case ERROR_ACTION_FOCUS_FIELD:\n if (shouldMoveFocusSR) setFocusOnFirstField(isValidating.current, sfp, srPanelResp?.fieldToFocus);\n // Remove 'showValidation' mode - allowing time for collation of all the fields in error whilst it is 'showValidation' mode (some errors come in a second render pass)\n setTimeout(() => {\n isValidating.current = false;\n }, 300);\n break;\n /** On blur scenario: not validating, i.e. trying to submit form, but there might be an error, either to set or to clear */\n case ERROR_ACTION_BLUR_SCENARIO: {\n const difference = getArrayDifferences<SortedErrorObject, string>(currentErrorsSortedByLayout, previousSortedErrors, 'field');\n\n const latestErrorMsg = difference?.[0];\n\n if (latestErrorMsg) {\n // Use the error code to look up whether error is actually a blur based one (most are but some SF ones aren't)\n const isBlurBasedError = lookupBlurBasedErrors(latestErrorMsg.errorCode);\n\n /**\n * ONLY ADD BLUR BASED ERRORS TO THE ERROR PANEL - doing this step prevents the non-blur based errors from being read out twice\n * (once from the aria-live, error panel & once from the aria-describedby element)\n */\n const latestSRError = isBlurBasedError ? latestErrorMsg.errorMessage : null;\n // console.log('### CardInput2::componentDidUpdate:: #2 (not validating) single error:: latestSRError', latestSRError);\n setSRMessagesFromStrings(latestSRError);\n } else {\n // called when previousSortedErrors.length >= currentErrorsSortedByLayout.length\n // console.log('### CardInput2::componentDidUpdate:: #3(not validating) clearing errors:: NO latestErrorMsg');\n clearSRPanel();\n }\n break;\n }\n default:\n break;\n }\n\n // Analytics\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 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={props.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 {props.showFormInstruction && <FormInstruction />}\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 {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","setSRMessagesFromObjects","setSRMessagesFromStrings","clearSRPanel","shouldMoveFocusSR","useSRPanelContext","setSRMessages","fieldTypeMappingFn","mapFieldKey","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","sortedErrorList","setSortedErrorList","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","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","handleFocus","getFocusHandler","retrieveLayout","getLayout","countrySpecificSchemas","getAddressSchemaForCountry","billingAddressRequiredFields","handleTouchstartIOS","useCallback","obj","elementType","name","handleAddress","getAddressHandler","doPanAutoJump","getAutoJumpHandler","extensions","CIExtensions","showValidation","processBinLookupResponse","binLookupResponse","isReset","processBinLookup","useEffect","setFocusOn","updateStyles","handleUnsupportedCard","destroy","newSchema","taxNumber","addressHasErrors","entries","reduce","acc","error","previousSortedErrors","usePrevious","holderNameValid","sfpValid","addressValid","koreanAuthentication","encryptedPassword","socialSecurityNumberValid","isValid","sfStateErrorsObj","mapErrorsToValidationRuleResult","mergedErrors","extractedAddressErrors","errorsWithoutAddress","errorsForPanel","srPanelResp","layout","countrySpecificLabels","getAddressLabelsForCountry","default","labels","currentErrorsSortedByLayout","action","ERROR_ACTION_FOCUS_FIELD","setFocusOnFirstField","fieldToFocus","setTimeout","ERROR_ACTION_BLUR_SCENARIO","difference","getArrayDifferences","latestErrorMsg","latestSRError","lookupBlurBasedErrors","errorCode","errorMessage","newErrors","forEach","errorItem","aObj","field","onValidationErrorAnalytics","onChange","FieldToRender","StoredCardFieldsWrapper","CardFieldsWrapper","h","Fragment","SecuredFieldsProvider","extractPropsForSFP","styles","hasKoreanFields","sfState","eventDetails","autoCompleteName","acHolderName","getRuleByNameAndMode","holderNameValidationFn","autoFocus","ENCRYPTED_CARD_NUMBER","encryptedCardNumber","onBrand","type","disableIOSArrowKeys","render","setRootNode","sfpState","div","className","classNames","role","showFormInstruction","FormInstruction","extractPropsForCardFields","handleInstallments","brandsIcons","handleOnStoreDetails","billingAddressValidationRules","getPartialAddressValidationRules","onAddressLookup","onAddressSelected","addressSearchDebounceMs","showPayButton","payButton","variant","isPayButtonPrimaryVariant","icon","imageFolder","PREFIX","defaultProps"],"mappings":"s1DAkCA,MAAMA,EAAaC,IACf,MAAMC,EAAMC,EAAO,MACbC,EAAeD,GAAO,GACtBE,EAAWC,KAGXC,yBAAEA,EAAwBC,yBAAEA,EAAwBC,aAAEA,EAAYC,kBAAEA,GAAsBC,IAG1FC,EAAuCL,IAA2B,CACpEM,mBAAoBC,IAIlBC,EAAoBZ,EAAO,MAC3Ba,EAAg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types.js";var o={type:"scheme",setComponentRef:()=>{},hasHolderName:!1,holderNameRequired:!1,enableStoreDetails:!1,hasCVC:!0,showBrandIcon:!0,positionHolderNameOnTop:!1,billingAddressRequired:!1,billingAddressMode:e.full,billingAddressRequiredFields:["street","houseNumberOrName","postalCode","city","stateOrProvince","country"],installmentOptions:{},configuration:{koreanAuthenticationRequired:!1,socialSecurityNumberMode:"auto"},autoFocus:!0,isPayButtonPrimaryVariant:!0,disableIOSArrowKeys:!1,showContextualElement:!0,onLoad:()=>{},onConfigSuccess:()=>{},onAllValid:()=>{},onFieldValid:()=>{},onBrand:()=>{},onError:()=>{},onBinValue:()=>{},onBlur:()=>{},onFocus:()=>{},onChange:()=>{},data:{billingAddress:{}},styles:{},placeholders:{}};export{o as default};
|
|
1
|
+
import{AddressModeOptions as e}from"./types.js";var o={type:"scheme",setComponentRef:()=>{},hasHolderName:!1,holderNameRequired:!1,enableStoreDetails:!1,hasCVC:!0,showBrandIcon:!0,positionHolderNameOnTop:!1,billingAddressRequired:!1,billingAddressMode:e.full,billingAddressRequiredFields:["street","houseNumberOrName","postalCode","city","stateOrProvince","country"],installmentOptions:{},configuration:{koreanAuthenticationRequired:!1,socialSecurityNumberMode:"auto"},autoFocus:!0,isPayButtonPrimaryVariant:!0,disableIOSArrowKeys:!1,showContextualElement:!0,exposeExpiryDate:!1,onLoad:()=>{},onConfigSuccess:()=>{},onAllValid:()=>{},onFieldValid:()=>{},onBrand:()=>{},onError:()=>{},onBinValue:()=>{},onBlur:()=>{},onFocus:()=>{},onChange:()=>{},data:{billingAddress:{}},styles:{},placeholders:{}};export{o as default};
|
|
2
2
|
//# sourceMappingURL=defaultProps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultProps.js","sources":["../../../../../../src/components/Card/components/CardInput/defaultProps.ts"],"sourcesContent":["import { SocialSecurityMode } from '../../types';\nimport { AddressModeOptions } from './types';\n\nexport default {\n type: 'scheme',\n\n setComponentRef: () => {},\n\n // Settings\n hasHolderName: false,\n holderNameRequired: false,\n enableStoreDetails: false,\n hasCVC: true,\n showBrandIcon: true,\n positionHolderNameOnTop: false,\n billingAddressRequired: false,\n billingAddressMode: AddressModeOptions.full,\n billingAddressRequiredFields: ['street', 'houseNumberOrName', 'postalCode', 'city', 'stateOrProvince', 'country'],\n installmentOptions: {},\n configuration: { koreanAuthenticationRequired: false, socialSecurityNumberMode: 'auto' as SocialSecurityMode },\n autoFocus: true,\n isPayButtonPrimaryVariant: true,\n disableIOSArrowKeys: false,\n showContextualElement: true,\n\n // Events\n onLoad: (): any => {},\n onConfigSuccess: (): any => {},\n onAllValid: (): any => {},\n onFieldValid: (): any => {},\n onBrand: (): any => {},\n onError: (): any => {},\n onBinValue: (): any => {},\n onBlur: (): any => {},\n onFocus: (): any => {},\n onChange: (): any => {},\n\n // Values\n data: {\n billingAddress: {}\n },\n\n // Customization\n styles: {},\n placeholders: {}\n};\n"],"names":["defaultProps","type","setComponentRef","hasHolderName","holderNameRequired","enableStoreDetails","hasCVC","showBrandIcon","positionHolderNameOnTop","billingAddressRequired","billingAddressMode","AddressModeOptions","full","billingAddressRequiredFields","installmentOptions","configuration","koreanAuthenticationRequired","socialSecurityNumberMode","autoFocus","isPayButtonPrimaryVariant","disableIOSArrowKeys","showContextualElement","onLoad","onConfigSuccess","onAllValid","onFieldValid","onBrand","onError","onBinValue","onBlur","onFocus","onChange","data","billingAddress","styles","placeholders"],"mappings":"gDAGA,IAAeA,EAAA,CACXC,KAAM,SAENC,gBAAiB,OAGjBC,eAAe,EACfC,oBAAoB,EACpBC,oBAAoB,EACpBC,QAAQ,EACRC,eAAe,EACfC,yBAAyB,EACzBC,wBAAwB,EACxBC,mBAAoBC,EAAmBC,KACvCC,6BAA8B,CAAC,SAAU,oBAAqB,aAAc,OAAQ,kBAAmB,WACvGC,mBAAoB,CAAC,EACrBC,cAAe,CAAEC,8BAA8B,EAAOC,yBAA0B,QAChFC,WAAW,EACXC,2BAA2B,EAC3BC,qBAAqB,EACrBC,uBAAuB,
|
|
1
|
+
{"version":3,"file":"defaultProps.js","sources":["../../../../../../src/components/Card/components/CardInput/defaultProps.ts"],"sourcesContent":["import { SocialSecurityMode } from '../../types';\nimport { AddressModeOptions } from './types';\n\nexport default {\n type: 'scheme',\n\n setComponentRef: () => {},\n\n // Settings\n hasHolderName: false,\n holderNameRequired: false,\n enableStoreDetails: false,\n hasCVC: true,\n showBrandIcon: true,\n positionHolderNameOnTop: false,\n billingAddressRequired: false,\n billingAddressMode: AddressModeOptions.full,\n billingAddressRequiredFields: ['street', 'houseNumberOrName', 'postalCode', 'city', 'stateOrProvince', 'country'],\n installmentOptions: {},\n configuration: { koreanAuthenticationRequired: false, socialSecurityNumberMode: 'auto' as SocialSecurityMode },\n autoFocus: true,\n isPayButtonPrimaryVariant: true,\n disableIOSArrowKeys: false,\n showContextualElement: true,\n exposeExpiryDate: false,\n\n // Events\n onLoad: (): any => {},\n onConfigSuccess: (): any => {},\n onAllValid: (): any => {},\n onFieldValid: (): any => {},\n onBrand: (): any => {},\n onError: (): any => {},\n onBinValue: (): any => {},\n onBlur: (): any => {},\n onFocus: (): any => {},\n onChange: (): any => {},\n\n // Values\n data: {\n billingAddress: {}\n },\n\n // Customization\n styles: {},\n placeholders: {}\n};\n"],"names":["defaultProps","type","setComponentRef","hasHolderName","holderNameRequired","enableStoreDetails","hasCVC","showBrandIcon","positionHolderNameOnTop","billingAddressRequired","billingAddressMode","AddressModeOptions","full","billingAddressRequiredFields","installmentOptions","configuration","koreanAuthenticationRequired","socialSecurityNumberMode","autoFocus","isPayButtonPrimaryVariant","disableIOSArrowKeys","showContextualElement","exposeExpiryDate","onLoad","onConfigSuccess","onAllValid","onFieldValid","onBrand","onError","onBinValue","onBlur","onFocus","onChange","data","billingAddress","styles","placeholders"],"mappings":"gDAGA,IAAeA,EAAA,CACXC,KAAM,SAENC,gBAAiB,OAGjBC,eAAe,EACfC,oBAAoB,EACpBC,oBAAoB,EACpBC,QAAQ,EACRC,eAAe,EACfC,yBAAyB,EACzBC,wBAAwB,EACxBC,mBAAoBC,EAAmBC,KACvCC,6BAA8B,CAAC,SAAU,oBAAqB,aAAc,OAAQ,kBAAmB,WACvGC,mBAAoB,CAAC,EACrBC,cAAe,CAAEC,8BAA8B,EAAOC,yBAA0B,QAChFC,WAAW,EACXC,2BAA2B,EAC3BC,qBAAqB,EACrBC,uBAAuB,EACvBC,kBAAkB,EAGlBC,OAAQ,OACRC,gBAAiB,OACjBC,WAAY,OACZC,aAAc,OACdC,QAAS,OACTC,QAAS,OACTC,WAAY,OACZC,OAAQ,OACRC,QAAS,OACTC,SAAU,OAGVC,KAAM,CACFC,eAAgB,CAAC,GAIrBC,OAAQ,CAAC,EACTC,aAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../../../../../src/components/Card/components/CardInput/types.ts"],"sourcesContent":["import Language from '../../../../language/Language';\nimport { BinLookupResponse, BrandConfiguration, CardBrandsConfiguration, CardBackendConfiguration, DualBrandSelectElement } from '../../types';\nimport { InstallmentOptions } from './components/types';\nimport { ValidationResult } from '../../../internal/PersonalDetails/types';\nimport { CVCPolicyType, DatePolicyType } from '../../../internal/SecuredFields/lib/types';\nimport Specifications from '../../../internal/Address/Specifications';\nimport { AddressSchema } from '../../../internal/Address/types';\nimport { CbObjOnError, 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 { FieldErrorAnalyticsObject } from '../../../../core/Analytics/types';\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\ntype PlaceholderKeys =\n | 'holderName'\n | 'cardNumber'\n | 'expiryDate'\n | 'expiryMonth'\n | 'expiryYear'\n | 'securityCodeThreeDigits'\n | 'securityCodeFourDigits'\n | 'password';\nexport type Placeholders = Partial<Record<PlaceholderKeys, string>>;\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 forceCompat?: boolean;\n fundingSource?: 'debit' | 'credit';\n hasCVC?: boolean;\n hasHolderName?: boolean;\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?: () => {};\n onAutoComplete?: () => {};\n onBinValue?: () => {};\n onBlur?: (e) => {};\n onBrand?: () => {};\n onConfigSuccess?: () => {};\n onChange?: (state) => {};\n onError?: () => {};\n onFieldValid?: () => {};\n onFocus?: (e) => {};\n onLoad?: () => {};\n onAddressLookup?: OnAddressLookupType;\n onAddressSelected?: OnAddressSelectedType;\n addressSearchDebounceMs?: number;\n payButton?: (obj) => {};\n placeholders?: Placeholders;\n positionHolderNameOnTop?: boolean;\n resources: Resources;\n setComponentRef?: (ref) => void;\n showBrandIcon?: boolean;\n showFormInstruction?: 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 disclaimerMessage?: DisclaimerMsgObject;\n onValidationErrorAnalytics?: (obj: FieldErrorAnalyticsObject) => {};\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: CbObjOnError) => 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":"
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../../../../src/components/Card/components/CardInput/types.ts"],"sourcesContent":["import Language from '../../../../language/Language';\nimport { BinLookupResponse, BrandConfiguration, CardBrandsConfiguration, CardBackendConfiguration, DualBrandSelectElement } from '../../types';\nimport { InstallmentOptions } from './components/types';\nimport { ValidationResult } from '../../../internal/PersonalDetails/types';\nimport { CVCPolicyType, DatePolicyType } from '../../../internal/SecuredFields/lib/types';\nimport Specifications from '../../../internal/Address/Specifications';\nimport { AddressSchema } from '../../../internal/Address/types';\nimport { CbObjOnError, 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 { FieldErrorAnalyticsObject } from '../../../../core/Analytics/types';\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\ntype PlaceholderKeys =\n | 'holderName'\n | 'cardNumber'\n | 'expiryDate'\n | 'expiryMonth'\n | 'expiryYear'\n | 'securityCodeThreeDigits'\n | 'securityCodeFourDigits'\n | 'password';\nexport type Placeholders = Partial<Record<PlaceholderKeys, string>>;\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 forceCompat?: boolean;\n fundingSource?: 'debit' | 'credit';\n hasCVC?: boolean;\n hasHolderName?: boolean;\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?: () => {};\n onAutoComplete?: () => {};\n onBinValue?: () => {};\n onBlur?: (e) => {};\n onBrand?: () => {};\n onConfigSuccess?: () => {};\n onChange?: (state) => {};\n onError?: () => {};\n onFieldValid?: () => {};\n onFocus?: (e) => {};\n onLoad?: () => {};\n onAddressLookup?: OnAddressLookupType;\n onAddressSelected?: OnAddressSelectedType;\n addressSearchDebounceMs?: number;\n payButton?: (obj) => {};\n placeholders?: Placeholders;\n positionHolderNameOnTop?: boolean;\n resources: Resources;\n setComponentRef?: (ref) => void;\n showBrandIcon?: boolean;\n showFormInstruction?: 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 onValidationErrorAnalytics?: (obj: FieldErrorAnalyticsObject) => {};\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: CbObjOnError) => 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":"OAkMYA,SAAAA,mDAAAA,CAAAA,IAAAA,EAAAA,CAAAA"}
|
|
@@ -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 i,KCP_CARD_NAME_BOTTOM as r,SSN_CARD_NAME_TOP as t,SSN_CARD_NAME_BOTTOM as a,CREDIT_CARD as s,KCP_CARD as l,SSN_CARD as d}from"./layouts.js";import{PARTIAL_ADDRESS_SCHEMA as u}from"../../../internal/Address/constants.js";import{BRAND_READABLE_NAME_MAP as c}from"../../../internal/SecuredFields/lib/constants.js";import{SF_ErrorCodes as m}from"../../../../core/Errors/constants.js";const p=(e,o)=>o({type:"card"===e?"nocard":e||"nocard",extension:"svg"})(e),C=e=>"revolving"===e?.plan||e?.value>1,h=({props:e,showKCP:u,showBrazilianSSN:c,countrySpecificSchemas:m=null,billingAddressRequiredFields:p=null})=>{let C=s;const h=e.hasHolderName&&e.holderNameRequired;if(h&&(C=e.positionHolderNameOnTop?o:n),u&&(C=l,h&&(C=e.positionHolderNameOnTop?i:r)),c&&(C=d,h&&(C=e.positionHolderNameOnTop?t:a)),m){const i=m.flat(2).filter((e=>"number"!=typeof e));let r=i;p&&(r=i.filter((e=>p.includes(e)))),C=s.concat(r),h&&(C=e.positionHolderNameOnTop?o.concat(r):n.concat(r))}return C},R=(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}},g=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}),y=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,minimumExpiryDate:e.minimumExpiryDate,onAdditionalSFConfig:e.onAdditionalSFConfig,onAdditionalSFRemoved:e.onAdditionalSFRemoved,onAllValid:e.onAllValid,onAutoComplete:e.onAutoComplete,onBinValue:e.onBinValue,onConfigSuccess:e.onConfigSuccess,onError:e.onError,onFieldValid:e.onFieldValid,onLoad:e.onLoad,placeholders:e.placeholders,resources:e.resources,showContextualElement:e.showContextualElement,showWarnings:e.showWarnings,trimTrailingSeparator:e.trimTrailingSeparator}),S=o=>o==e.partial?u:null;function f(e){return![m.ERROR_MSG_UNSUPPORTED_CARD_ENTERED,m.ERROR_MSG_CARD_TOO_OLD,m.ERROR_MSG_CARD_TOO_FAR_IN_FUTURE,m.ERROR_MSG_CARD_EXPIRES_TOO_SOON].includes(e)}function O(e){return c[e]??e}export{g as extractPropsForCardFields,y as extractPropsForSFP,p as getCardImageUrl,O as getFullBrandName,h as getLayout,S as handlePartialAddressMode,C as hasValidInstallmentsObject,f as lookupBlurBasedErrors,R as mapFieldKey};
|
|
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 i,KCP_CARD_NAME_BOTTOM as r,SSN_CARD_NAME_TOP as t,SSN_CARD_NAME_BOTTOM as a,CREDIT_CARD as s,KCP_CARD as l,SSN_CARD as d}from"./layouts.js";import{PARTIAL_ADDRESS_SCHEMA as u}from"../../../internal/Address/constants.js";import{BRAND_READABLE_NAME_MAP as c}from"../../../internal/SecuredFields/lib/constants.js";import{SF_ErrorCodes as m}from"../../../../core/Errors/constants.js";const p=(e,o)=>o({type:"card"===e?"nocard":e||"nocard",extension:"svg"})(e),C=e=>"revolving"===e?.plan||e?.value>1,h=({props:e,showKCP:u,showBrazilianSSN:c,countrySpecificSchemas:m=null,billingAddressRequiredFields:p=null})=>{let C=s;const h=e.hasHolderName&&e.holderNameRequired;if(h&&(C=e.positionHolderNameOnTop?o:n),u&&(C=l,h&&(C=e.positionHolderNameOnTop?i:r)),c&&(C=d,h&&(C=e.positionHolderNameOnTop?t:a)),m){const i=m.flat(2).filter((e=>"number"!=typeof e));let r=i;p&&(r=i.filter((e=>p.includes(e)))),C=s.concat(r),h&&(C=e.positionHolderNameOnTop?o.concat(r):n.concat(r))}return C},R=(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}},g=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}),y=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,onError:e.onError,onFieldValid:e.onFieldValid,onLoad:e.onLoad,placeholders:e.placeholders,resources:e.resources,showContextualElement:e.showContextualElement,showWarnings:e.showWarnings,trimTrailingSeparator:e.trimTrailingSeparator}),S=o=>o==e.partial?u:null;function f(e){return![m.ERROR_MSG_UNSUPPORTED_CARD_ENTERED,m.ERROR_MSG_CARD_TOO_OLD,m.ERROR_MSG_CARD_TOO_FAR_IN_FUTURE,m.ERROR_MSG_CARD_EXPIRES_TOO_SOON].includes(e)}function O(e){return c[e]??e}export{g as extractPropsForCardFields,y as extractPropsForSFP,p as getCardImageUrl,O as getFullBrandName,h as getLayout,S as handlePartialAddressMode,C as hasValidInstallmentsObject,f as lookupBlurBasedErrors,R as mapFieldKey};
|
|
2
2
|
//# sourceMappingURL=utils.js.map
|