@adyen/adyen-web 6.47.0-alpha.eada81f → 6.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/adyen.css +20 -22
- 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 +122 -581
- package/dist/es/adyen.css +20 -22
- package/dist/es/adyen.css.map +1 -1
- package/dist/es/components/AmazonPay/AmazonPay.js +1 -1
- package/dist/es/components/AmazonPay/AmazonPay.js.map +1 -1
- package/dist/es/components/AmazonPay/components/AmazonPayButton.js +1 -1
- package/dist/es/components/AmazonPay/components/AmazonPayButton.js.map +1 -1
- package/dist/es/components/AmazonPay/components/AmazonPayComponent.js +1 -1
- package/dist/es/components/AmazonPay/components/AmazonPayComponent.js.map +1 -1
- package/dist/es/components/AmazonPay/components/OrderButton.js +1 -1
- package/dist/es/components/AmazonPay/components/OrderButton.js.map +1 -1
- package/dist/es/components/AmazonPay/components/SignOutButton.js +1 -1
- package/dist/es/components/AmazonPay/components/SignOutButton.js.map +1 -1
- package/dist/es/components/AmazonPay/utils.js +1 -1
- package/dist/es/components/AmazonPay/utils.js.map +1 -1
- package/dist/es/components/ApplePay/services/ApplePaySdkLoader.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/components/Installments/Installments.js +1 -1
- package/dist/es/components/Card/components/CardInput/components/Installments/Installments.js.map +1 -1
- package/dist/es/components/Card/components/CardInput/types.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/CashAppPay/services/CashAppService.js +1 -1
- package/dist/es/components/CashAppPay/services/CashAppService.js.map +1 -1
- package/dist/es/components/CashAppPay/services/types.js.map +1 -1
- package/dist/es/components/CustomCard/CustomCard.js +1 -1
- package/dist/es/components/CustomCard/CustomCard.js.map +1 -1
- package/dist/es/components/Donation/components/DonationComponent.js.map +1 -1
- package/dist/es/components/Donation/components/FixedAmounts.js.map +1 -1
- package/dist/es/components/Dragonpay/components/DragonpayVoucherResult/DragonpayVoucherResult.js +1 -1
- package/dist/es/components/Dragonpay/components/DragonpayVoucherResult/DragonpayVoucherResult.js.map +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/DisableOneClickConfirmation.js +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/DisableOneClickConfirmation.js.map +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js +1 -1
- package/dist/es/components/Dropin/components/PaymentMethod/PaymentMethodItem/PaymentMethodItem.js.map +1 -1
- package/dist/es/components/Giftcard/Giftcard.js +1 -1
- package/dist/es/components/Giftcard/Giftcard.js.map +1 -1
- package/dist/es/components/Giftcard/components/GiftcardComponent.js +1 -1
- package/dist/es/components/Giftcard/components/GiftcardComponent.js.map +1 -1
- package/dist/es/components/Giftcard/types.js +2 -0
- package/dist/es/components/Giftcard/types.js.map +1 -0
- package/dist/es/components/Giftcard/utils.js +2 -0
- package/dist/es/components/Giftcard/utils.js.map +1 -0
- package/dist/es/components/GooglePay/GooglePay.js.map +1 -1
- package/dist/es/components/PayByBankPix/PayByBankPix.js +1 -1
- package/dist/es/components/PayByBankPix/PayByBankPix.js.map +1 -1
- package/dist/es/components/PayByBankPix/components/Enrollment/useIssuerWithLogo.js +1 -1
- package/dist/es/components/PayByBankPix/components/Enrollment/useIssuerWithLogo.js.map +1 -1
- package/dist/es/components/PayByBankUS/PayByBankUS.js +1 -1
- package/dist/es/components/PayByBankUS/PayByBankUS.js.map +1 -1
- package/dist/es/components/PayPal/Paypal.js +1 -1
- package/dist/es/components/PayPal/Paypal.js.map +1 -1
- package/dist/es/components/PayPal/components/PaypalButtons.js +1 -1
- package/dist/es/components/PayPal/components/PaypalButtons.js.map +1 -1
- package/dist/es/components/PayPal/components/PaypalComponent.js +1 -1
- package/dist/es/components/PayPal/components/PaypalComponent.js.map +1 -1
- package/dist/es/components/PayPal/config.js +1 -1
- package/dist/es/components/PayPal/config.js.map +1 -1
- package/dist/es/components/PayPal/utils/get-paypal-locale.js +1 -1
- package/dist/es/components/PayPal/utils/get-paypal-locale.js.map +1 -1
- package/dist/es/components/PayPal/utils/get-paypal-settings.js +1 -1
- package/dist/es/components/PayPal/utils/get-paypal-settings.js.map +1 -1
- package/dist/es/components/PayPal/utils/get-paypal-url.js +1 -1
- package/dist/es/components/PayPal/utils/get-paypal-url.js.map +1 -1
- package/dist/es/components/PayPalFastlane/Fastlane.js +1 -1
- package/dist/es/components/PayPalFastlane/Fastlane.js.map +1 -1
- package/dist/es/components/PayPalFastlane/FastlaneSDK.js +1 -1
- package/dist/es/components/PayPalFastlane/FastlaneSDK.js.map +1 -1
- package/dist/es/components/ThreeDS2/ThreeDS2Challenge.js +1 -1
- package/dist/es/components/ThreeDS2/ThreeDS2Challenge.js.map +1 -1
- package/dist/es/components/ThreeDS2/ThreeDS2DeviceFingerprint.js +1 -1
- package/dist/es/components/ThreeDS2/ThreeDS2DeviceFingerprint.js.map +1 -1
- package/dist/es/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js +1 -1
- package/dist/es/components/ThreeDS2/components/Challenge/PrepareChallenge3DS2.js.map +1 -1
- package/dist/es/components/ThreeDS2/components/DeviceFingerprint/DoFingerprint3DS2.js.map +1 -1
- package/dist/es/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js +1 -1
- package/dist/es/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js.map +1 -1
- package/dist/es/components/ThreeDS2/components/Form/ThreeDS2Form.js +1 -1
- package/dist/es/components/ThreeDS2/components/Form/ThreeDS2Form.js.map +1 -1
- package/dist/es/components/ThreeDS2/components/utils.js +1 -1
- package/dist/es/components/ThreeDS2/components/utils.js.map +1 -1
- package/dist/es/components/components-name-map.js +1 -1
- package/dist/es/components/components-name-map.js.map +1 -1
- package/dist/es/components/helpers/IssuerListContainer/IssuerListContainer.js +1 -1
- package/dist/es/components/helpers/IssuerListContainer/IssuerListContainer.js.map +1 -1
- package/dist/es/components/index.js +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/Address/Specifications.js +1 -1
- package/dist/es/components/internal/Address/Specifications.js.map +1 -1
- package/dist/es/components/internal/Address/components/AddressSearch.js +1 -1
- package/dist/es/components/internal/Address/components/AddressSearch.js.map +1 -1
- package/dist/es/components/internal/Address/components/CountryField.js +1 -1
- package/dist/es/components/internal/Address/components/CountryField.js.map +1 -1
- package/dist/es/components/internal/Address/components/FieldContainer.js +1 -1
- package/dist/es/components/internal/Address/components/FieldContainer.js.map +1 -1
- package/dist/es/components/internal/Address/components/StateField.js +1 -1
- package/dist/es/components/internal/Address/components/StateField.js.map +1 -1
- package/dist/es/components/internal/Address/constants.js.map +1 -1
- package/dist/es/components/internal/Address/utils.js.map +1 -1
- package/dist/es/components/internal/Address/validate.formats.js +1 -1
- package/dist/es/components/internal/Address/validate.formats.js.map +1 -1
- package/dist/es/components/internal/BaseElement/BaseElement.js +1 -1
- package/dist/es/components/internal/BaseElement/BaseElement.js.map +1 -1
- package/dist/es/components/internal/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/components/CtPSection/CtPLogoutLink.js +1 -1
- package/dist/es/components/internal/ClickToPay/components/CtPSection/CtPLogoutLink.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/CompanyDetails/validate.js +1 -1
- package/dist/es/components/internal/CompanyDetails/validate.js.map +1 -1
- package/dist/es/components/internal/ConsentCheckboxLabel/ConsentCheckboxLabel.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 +1 -1
- package/dist/es/components/internal/FormFields/InputBase.js.map +1 -1
- package/dist/es/components/internal/FormFields/InputDate/InputDate.js +1 -1
- package/dist/es/components/internal/FormFields/InputDate/InputDate.js.map +1 -1
- package/dist/es/components/internal/FormFields/InputDate/utils.js.map +1 -1
- package/dist/es/components/internal/FormFields/Select/Select.js +1 -1
- package/dist/es/components/internal/FormFields/Select/Select.js.map +1 -1
- package/dist/es/components/internal/FormFields/Select/components/SelectButton.js +1 -1
- package/dist/es/components/internal/FormFields/Select/components/SelectButton.js.map +1 -1
- package/dist/es/components/internal/IbanInput/IbanInput.js +1 -1
- package/dist/es/components/internal/IbanInput/IbanInput.js.map +1 -1
- package/dist/es/components/internal/IbanInput/specifications.js.map +1 -1
- package/dist/es/components/internal/IbanInput/utils.js +1 -1
- package/dist/es/components/internal/IbanInput/utils.js.map +1 -1
- package/dist/es/components/internal/PayButton/utils.js.map +1 -1
- package/dist/es/components/internal/PersonalDetails/PersonalDetails.js +1 -1
- package/dist/es/components/internal/PersonalDetails/PersonalDetails.js.map +1 -1
- package/dist/es/components/internal/PersonalDetails/validate.js +1 -1
- package/dist/es/components/internal/PersonalDetails/validate.js.map +1 -1
- package/dist/es/components/internal/PhoneInput/PhoneInputFields.js +1 -1
- package/dist/es/components/internal/PhoneInput/PhoneInputFields.js.map +1 -1
- package/dist/es/components/internal/PhoneInput/PhoneInputForm.js +1 -1
- package/dist/es/components/internal/PhoneInput/PhoneInputForm.js.map +1 -1
- package/dist/es/components/internal/QRLoader/QRLoader.js.map +1 -1
- package/dist/es/components/internal/SecuredFields/lib/securedField/utils/processAriaConfig.js +1 -1
- package/dist/es/components/internal/SecuredFields/lib/securedField/utils/processAriaConfig.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/UIElement/utils.js.map +1 -1
- package/dist/es/components/tx-variants.js +1 -1
- package/dist/es/components/tx-variants.js.map +1 -1
- package/dist/es/core/Services/http.js.map +1 -1
- package/dist/es/core/config.js +1 -1
- package/dist/es/core/config.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/utils.js +1 -1
- package/dist/es/core/utils.js.map +1 -1
- package/dist/es/hooks/usePaymentStatusTimer/usePaymentStatusTimer.js +1 -1
- package/dist/es/hooks/usePaymentStatusTimer/usePaymentStatusTimer.js.map +1 -1
- package/dist/es/index.d.ts +122 -581
- package/dist/es/index.js +1 -1
- package/dist/es/language/Language.js +1 -1
- package/dist/es/language/Language.js.map +1 -1
- package/dist/es/language/utils.js +1 -1
- package/dist/es/language/utils.js.map +1 -1
- package/dist/es/utils/Script.js.map +1 -1
- package/dist/es/utils/Validator/ValidationRuleResult.js.map +1 -1
- package/dist/es/utils/Validator/Validator.js +1 -1
- package/dist/es/utils/Validator/Validator.js.map +1 -1
- package/dist/es/utils/Validator/defaultRules.js +1 -1
- package/dist/es/utils/Validator/defaultRules.js.map +1 -1
- package/dist/es/utils/amount-util.js +1 -1
- package/dist/es/utils/amount-util.js.map +1 -1
- package/dist/es/utils/browserInfo.js.map +1 -1
- package/dist/es/utils/createSdkData.js +1 -1
- package/dist/es/utils/createSdkData.js.map +1 -1
- package/dist/es/utils/get-issuer-image.js +1 -1
- package/dist/es/utils/get-issuer-image.js.map +1 -1
- package/dist/es/utils/get-process-message-handler.js.map +1 -1
- package/dist/es/utils/getConsentUrl.js +1 -1
- package/dist/es/utils/getConsentUrl.js.map +1 -1
- package/dist/es/utils/getErrorMessage.js.map +1 -1
- package/dist/es/utils/getOrigin.js.map +1 -1
- package/dist/es/utils/isValidURL.js +1 -1
- package/dist/es/utils/isValidURL.js.map +1 -1
- package/dist/es/utils/promiseTimeout.js.map +1 -1
- package/dist/es/utils/useAutoFocus.js.map +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 +20 -22
- package/dist/es-legacy/adyen.css.map +1 -1
- package/dist/es-legacy/components/AmazonPay/AmazonPay.js +1 -1
- package/dist/es-legacy/components/AmazonPay/AmazonPay.js.map +1 -1
- package/dist/es-legacy/components/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/components/OrderButton.js +1 -1
- package/dist/es-legacy/components/AmazonPay/components/OrderButton.js.map +1 -1
- package/dist/es-legacy/components/AmazonPay/components/SignOutButton.js +1 -1
- package/dist/es-legacy/components/AmazonPay/components/SignOutButton.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/services/ApplePaySdkLoader.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/Installments/Installments.js +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/components/Installments/Installments.js.map +1 -1
- package/dist/es-legacy/components/Card/components/CardInput/types.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/CashAppPay/services/CashAppService.js +1 -1
- package/dist/es-legacy/components/CashAppPay/services/CashAppService.js.map +1 -1
- package/dist/es-legacy/components/CashAppPay/services/types.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/Donation/components/DonationComponent.js.map +1 -1
- package/dist/es-legacy/components/Donation/components/FixedAmounts.js.map +1 -1
- package/dist/es-legacy/components/Dragonpay/components/DragonpayVoucherResult/DragonpayVoucherResult.js +1 -1
- package/dist/es-legacy/components/Dragonpay/components/DragonpayVoucherResult/DragonpayVoucherResult.js.map +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/DisableOneClickConfirmation.js +1 -1
- package/dist/es-legacy/components/Dropin/components/PaymentMethod/DisableOneClickConfirmation.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/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/types.js +2 -0
- package/dist/es-legacy/components/Giftcard/types.js.map +1 -0
- package/dist/es-legacy/components/Giftcard/utils.js +2 -0
- package/dist/es-legacy/components/Giftcard/utils.js.map +1 -0
- package/dist/es-legacy/components/GooglePay/GooglePay.js.map +1 -1
- package/dist/es-legacy/components/PayByBankPix/PayByBankPix.js +1 -1
- package/dist/es-legacy/components/PayByBankPix/PayByBankPix.js.map +1 -1
- package/dist/es-legacy/components/PayByBankPix/components/Enrollment/useIssuerWithLogo.js +1 -1
- package/dist/es-legacy/components/PayByBankPix/components/Enrollment/useIssuerWithLogo.js.map +1 -1
- package/dist/es-legacy/components/PayByBankUS/PayByBankUS.js +1 -1
- package/dist/es-legacy/components/PayByBankUS/PayByBankUS.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/config.js +1 -1
- package/dist/es-legacy/components/PayPal/config.js.map +1 -1
- package/dist/es-legacy/components/PayPal/utils/get-paypal-locale.js +1 -1
- package/dist/es-legacy/components/PayPal/utils/get-paypal-locale.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/PayPal/utils/get-paypal-url.js +1 -1
- package/dist/es-legacy/components/PayPal/utils/get-paypal-url.js.map +1 -1
- package/dist/es-legacy/components/PayPalFastlane/Fastlane.js +1 -1
- package/dist/es-legacy/components/PayPalFastlane/Fastlane.js.map +1 -1
- package/dist/es-legacy/components/PayPalFastlane/FastlaneSDK.js +1 -1
- package/dist/es-legacy/components/PayPalFastlane/FastlaneSDK.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/DoFingerprint3DS2.js.map +1 -1
- package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js +1 -1
- package/dist/es-legacy/components/ThreeDS2/components/DeviceFingerprint/PrepareFingerprint3DS2.js.map +1 -1
- package/dist/es-legacy/components/ThreeDS2/components/Form/ThreeDS2Form.js +1 -1
- package/dist/es-legacy/components/ThreeDS2/components/Form/ThreeDS2Form.js.map +1 -1
- package/dist/es-legacy/components/ThreeDS2/components/utils.js +1 -1
- package/dist/es-legacy/components/ThreeDS2/components/utils.js.map +1 -1
- package/dist/es-legacy/components/components-name-map.js +1 -1
- package/dist/es-legacy/components/components-name-map.js.map +1 -1
- package/dist/es-legacy/components/helpers/IssuerListContainer/IssuerListContainer.js +1 -1
- package/dist/es-legacy/components/helpers/IssuerListContainer/IssuerListContainer.js.map +1 -1
- package/dist/es-legacy/components/index.js +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/Specifications.js +1 -1
- package/dist/es-legacy/components/internal/Address/Specifications.js.map +1 -1
- package/dist/es-legacy/components/internal/Address/components/AddressSearch.js +1 -1
- package/dist/es-legacy/components/internal/Address/components/AddressSearch.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/Address/components/FieldContainer.js +1 -1
- package/dist/es-legacy/components/internal/Address/components/FieldContainer.js.map +1 -1
- package/dist/es-legacy/components/internal/Address/components/StateField.js +1 -1
- package/dist/es-legacy/components/internal/Address/components/StateField.js.map +1 -1
- package/dist/es-legacy/components/internal/Address/constants.js.map +1 -1
- package/dist/es-legacy/components/internal/Address/utils.js.map +1 -1
- package/dist/es-legacy/components/internal/Address/validate.formats.js +1 -1
- package/dist/es-legacy/components/internal/Address/validate.formats.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/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/components/CtPSection/CtPLogoutLink.js +1 -1
- package/dist/es-legacy/components/internal/ClickToPay/components/CtPSection/CtPLogoutLink.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/CompanyDetails/validate.js +1 -1
- package/dist/es-legacy/components/internal/CompanyDetails/validate.js.map +1 -1
- package/dist/es-legacy/components/internal/ConsentCheckboxLabel/ConsentCheckboxLabel.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/InputDate/utils.js.map +1 -1
- package/dist/es-legacy/components/internal/FormFields/Select/Select.js +1 -1
- package/dist/es-legacy/components/internal/FormFields/Select/Select.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/IbanInput/IbanInput.js +1 -1
- package/dist/es-legacy/components/internal/IbanInput/IbanInput.js.map +1 -1
- package/dist/es-legacy/components/internal/IbanInput/specifications.js.map +1 -1
- package/dist/es-legacy/components/internal/IbanInput/utils.js +1 -1
- package/dist/es-legacy/components/internal/IbanInput/utils.js.map +1 -1
- package/dist/es-legacy/components/internal/PayButton/utils.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/PersonalDetails/validate.js +1 -1
- package/dist/es-legacy/components/internal/PersonalDetails/validate.js.map +1 -1
- package/dist/es-legacy/components/internal/PhoneInput/PhoneInputFields.js +1 -1
- package/dist/es-legacy/components/internal/PhoneInput/PhoneInputFields.js.map +1 -1
- package/dist/es-legacy/components/internal/PhoneInput/PhoneInputForm.js +1 -1
- package/dist/es-legacy/components/internal/PhoneInput/PhoneInputForm.js.map +1 -1
- package/dist/es-legacy/components/internal/QRLoader/QRLoader.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/UIElement/utils.js.map +1 -1
- package/dist/es-legacy/components/tx-variants.js +1 -1
- package/dist/es-legacy/components/tx-variants.js.map +1 -1
- package/dist/es-legacy/core/Services/http.js.map +1 -1
- package/dist/es-legacy/core/config.js +1 -1
- package/dist/es-legacy/core/config.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/utils.js +1 -1
- package/dist/es-legacy/core/utils.js.map +1 -1
- package/dist/es-legacy/hooks/usePaymentStatusTimer/usePaymentStatusTimer.js +1 -1
- package/dist/es-legacy/hooks/usePaymentStatusTimer/usePaymentStatusTimer.js.map +1 -1
- package/dist/es-legacy/index.js +1 -1
- package/dist/es-legacy/language/Language.js +1 -1
- package/dist/es-legacy/language/Language.js.map +1 -1
- package/dist/es-legacy/language/utils.js +1 -1
- package/dist/es-legacy/language/utils.js.map +1 -1
- package/dist/es-legacy/utils/Script.js.map +1 -1
- package/dist/es-legacy/utils/Validator/ValidationRuleResult.js.map +1 -1
- package/dist/es-legacy/utils/Validator/Validator.js +1 -1
- package/dist/es-legacy/utils/Validator/Validator.js.map +1 -1
- package/dist/es-legacy/utils/Validator/defaultRules.js +1 -1
- package/dist/es-legacy/utils/Validator/defaultRules.js.map +1 -1
- package/dist/es-legacy/utils/amount-util.js +1 -1
- package/dist/es-legacy/utils/amount-util.js.map +1 -1
- package/dist/es-legacy/utils/browserInfo.js.map +1 -1
- package/dist/es-legacy/utils/createSdkData.js +1 -1
- package/dist/es-legacy/utils/createSdkData.js.map +1 -1
- package/dist/es-legacy/utils/get-issuer-image.js +1 -1
- package/dist/es-legacy/utils/get-issuer-image.js.map +1 -1
- package/dist/es-legacy/utils/get-process-message-handler.js.map +1 -1
- package/dist/es-legacy/utils/getConsentUrl.js +1 -1
- package/dist/es-legacy/utils/getConsentUrl.js.map +1 -1
- package/dist/es-legacy/utils/getErrorMessage.js.map +1 -1
- package/dist/es-legacy/utils/getOrigin.js.map +1 -1
- package/dist/es-legacy/utils/isValidURL.js +1 -1
- package/dist/es-legacy/utils/isValidURL.js.map +1 -1
- package/dist/es-legacy/utils/promiseTimeout.js.map +1 -1
- package/dist/es-legacy/utils/useAutoFocus.js.map +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 +25 -24
- package/styles/adyen.css +20 -22
- package/dist/es/components/PayPal/PayPalCredit.js +0 -2
- package/dist/es/components/PayPal/PayPalCredit.js.map +0 -1
- package/dist/es/components/PayPal/PayPalPaylater.js +0 -2
- package/dist/es/components/PayPal/PayPalPaylater.js.map +0 -1
- package/dist/es/components/PayPal/Venmo.js +0 -2
- package/dist/es/components/PayPal/Venmo.js.map +0 -1
- package/dist/es/components/PayPal/components/PayPalButton.js +0 -2
- package/dist/es/components/PayPal/components/PayPalButton.js.map +0 -1
- package/dist/es/components/PayPal/components/PayPalComponentV6.js +0 -2
- package/dist/es/components/PayPal/components/PayPalComponentV6.js.map +0 -1
- package/dist/es/components/PayPal/components/PayPalComponentV6.module.scss.js +0 -2
- package/dist/es/components/PayPal/components/PayPalComponentV6.module.scss.js.map +0 -1
- package/dist/es/components/PayPal/components/PayPalCreditButton.js +0 -2
- package/dist/es/components/PayPal/components/PayPalCreditButton.js.map +0 -1
- package/dist/es/components/PayPal/components/PayPalCreditComponent.js +0 -2
- package/dist/es/components/PayPal/components/PayPalCreditComponent.js.map +0 -1
- package/dist/es/components/PayPal/components/PayPalMessaging.js +0 -2
- package/dist/es/components/PayPal/components/PayPalMessaging.js.map +0 -1
- package/dist/es/components/PayPal/components/PayPalPayLaterButton.js +0 -2
- package/dist/es/components/PayPal/components/PayPalPayLaterButton.js.map +0 -1
- package/dist/es/components/PayPal/components/PayPalPaylaterComponent.js +0 -2
- package/dist/es/components/PayPal/components/PayPalPaylaterComponent.js.map +0 -1
- package/dist/es/components/PayPal/components/PayPalPaylaterComponent.module.scss.js +0 -2
- package/dist/es/components/PayPal/components/PayPalPaylaterComponent.module.scss.js.map +0 -1
- package/dist/es/components/PayPal/components/PayPalProcessingSpinner.js +0 -2
- package/dist/es/components/PayPal/components/PayPalProcessingSpinner.js.map +0 -1
- package/dist/es/components/PayPal/components/PayPalSpinner.js +0 -2
- package/dist/es/components/PayPal/components/PayPalSpinner.js.map +0 -1
- package/dist/es/components/PayPal/components/VenmoButton.js +0 -2
- package/dist/es/components/PayPal/components/VenmoButton.js.map +0 -1
- package/dist/es/components/PayPal/components/VenmoComponent.js +0 -2
- package/dist/es/components/PayPal/components/VenmoComponent.js.map +0 -1
- package/dist/es/components/PayPal/hooks/usePayPalButtonEligibility.js +0 -2
- package/dist/es/components/PayPal/hooks/usePayPalButtonEligibility.js.map +0 -1
- package/dist/es/components/PayPal/hooks/usePayPalOneTimeSession.js +0 -2
- package/dist/es/components/PayPal/hooks/usePayPalOneTimeSession.js.map +0 -1
- package/dist/es/components/PayPal/hooks/usePayPalSaveSession.js +0 -2
- package/dist/es/components/PayPal/hooks/usePayPalSaveSession.js.map +0 -1
- package/dist/es/components/PayPal/hooks/usePayPalSessionOptions.js +0 -2
- package/dist/es/components/PayPal/hooks/usePayPalSessionOptions.js.map +0 -1
- package/dist/es/components/PayPal/hooks/usePayPalStatus.js +0 -2
- package/dist/es/components/PayPal/hooks/usePayPalStatus.js.map +0 -1
- package/dist/es/components/PayPal/hooks/useStartPayPalSession.js +0 -2
- package/dist/es/components/PayPal/hooks/useStartPayPalSession.js.map +0 -1
- package/dist/es/components/PayPal/models/BasePayPalElement.js +0 -2
- package/dist/es/components/PayPal/models/BasePayPalElement.js.map +0 -1
- package/dist/es/components/PayPal/services/PayPalSdkLoader.js +0 -2
- package/dist/es/components/PayPal/services/PayPalSdkLoader.js.map +0 -1
- package/dist/es/components/PayPal/services/PayPalService.js +0 -2
- package/dist/es/components/PayPal/services/PayPalService.js.map +0 -1
- package/dist/es/components/PayPal/services/request-paypal-oauth-token.js +0 -2
- package/dist/es/components/PayPal/services/request-paypal-oauth-token.js.map +0 -1
- package/dist/es/components/PayPal/services/request-paypal-order-details.js +0 -2
- package/dist/es/components/PayPal/services/request-paypal-order-details.js.map +0 -1
- package/dist/es/components/PayPal/utils/is-paypal-service-config-equal.js +0 -2
- package/dist/es/components/PayPal/utils/is-paypal-service-config-equal.js.map +0 -1
- package/dist/es/utils/is-live-environment.js +0 -2
- package/dist/es/utils/is-live-environment.js.map +0 -1
- package/dist/es-legacy/components/PayPal/PayPalCredit.js +0 -2
- package/dist/es-legacy/components/PayPal/PayPalCredit.js.map +0 -1
- package/dist/es-legacy/components/PayPal/PayPalPaylater.js +0 -2
- package/dist/es-legacy/components/PayPal/PayPalPaylater.js.map +0 -1
- package/dist/es-legacy/components/PayPal/Venmo.js +0 -2
- package/dist/es-legacy/components/PayPal/Venmo.js.map +0 -1
- package/dist/es-legacy/components/PayPal/components/PayPalButton.js +0 -2
- package/dist/es-legacy/components/PayPal/components/PayPalButton.js.map +0 -1
- package/dist/es-legacy/components/PayPal/components/PayPalComponentV6.js +0 -2
- package/dist/es-legacy/components/PayPal/components/PayPalComponentV6.js.map +0 -1
- package/dist/es-legacy/components/PayPal/components/PayPalComponentV6.module.scss.js +0 -2
- package/dist/es-legacy/components/PayPal/components/PayPalComponentV6.module.scss.js.map +0 -1
- package/dist/es-legacy/components/PayPal/components/PayPalCreditButton.js +0 -2
- package/dist/es-legacy/components/PayPal/components/PayPalCreditButton.js.map +0 -1
- package/dist/es-legacy/components/PayPal/components/PayPalCreditComponent.js +0 -2
- package/dist/es-legacy/components/PayPal/components/PayPalCreditComponent.js.map +0 -1
- package/dist/es-legacy/components/PayPal/components/PayPalMessaging.js +0 -2
- package/dist/es-legacy/components/PayPal/components/PayPalMessaging.js.map +0 -1
- package/dist/es-legacy/components/PayPal/components/PayPalPayLaterButton.js +0 -2
- package/dist/es-legacy/components/PayPal/components/PayPalPayLaterButton.js.map +0 -1
- package/dist/es-legacy/components/PayPal/components/PayPalPaylaterComponent.js +0 -2
- package/dist/es-legacy/components/PayPal/components/PayPalPaylaterComponent.js.map +0 -1
- package/dist/es-legacy/components/PayPal/components/PayPalPaylaterComponent.module.scss.js +0 -2
- package/dist/es-legacy/components/PayPal/components/PayPalPaylaterComponent.module.scss.js.map +0 -1
- package/dist/es-legacy/components/PayPal/components/PayPalProcessingSpinner.js +0 -2
- package/dist/es-legacy/components/PayPal/components/PayPalProcessingSpinner.js.map +0 -1
- package/dist/es-legacy/components/PayPal/components/PayPalSpinner.js +0 -2
- package/dist/es-legacy/components/PayPal/components/PayPalSpinner.js.map +0 -1
- package/dist/es-legacy/components/PayPal/components/VenmoButton.js +0 -2
- package/dist/es-legacy/components/PayPal/components/VenmoButton.js.map +0 -1
- package/dist/es-legacy/components/PayPal/components/VenmoComponent.js +0 -2
- package/dist/es-legacy/components/PayPal/components/VenmoComponent.js.map +0 -1
- package/dist/es-legacy/components/PayPal/hooks/usePayPalButtonEligibility.js +0 -2
- package/dist/es-legacy/components/PayPal/hooks/usePayPalButtonEligibility.js.map +0 -1
- package/dist/es-legacy/components/PayPal/hooks/usePayPalOneTimeSession.js +0 -2
- package/dist/es-legacy/components/PayPal/hooks/usePayPalOneTimeSession.js.map +0 -1
- package/dist/es-legacy/components/PayPal/hooks/usePayPalSaveSession.js +0 -2
- package/dist/es-legacy/components/PayPal/hooks/usePayPalSaveSession.js.map +0 -1
- package/dist/es-legacy/components/PayPal/hooks/usePayPalSessionOptions.js +0 -2
- package/dist/es-legacy/components/PayPal/hooks/usePayPalSessionOptions.js.map +0 -1
- package/dist/es-legacy/components/PayPal/hooks/usePayPalStatus.js +0 -2
- package/dist/es-legacy/components/PayPal/hooks/usePayPalStatus.js.map +0 -1
- package/dist/es-legacy/components/PayPal/hooks/useStartPayPalSession.js +0 -2
- package/dist/es-legacy/components/PayPal/hooks/useStartPayPalSession.js.map +0 -1
- package/dist/es-legacy/components/PayPal/models/BasePayPalElement.js +0 -2
- package/dist/es-legacy/components/PayPal/models/BasePayPalElement.js.map +0 -1
- package/dist/es-legacy/components/PayPal/services/PayPalSdkLoader.js +0 -2
- package/dist/es-legacy/components/PayPal/services/PayPalSdkLoader.js.map +0 -1
- package/dist/es-legacy/components/PayPal/services/PayPalService.js +0 -2
- package/dist/es-legacy/components/PayPal/services/PayPalService.js.map +0 -1
- package/dist/es-legacy/components/PayPal/services/request-paypal-oauth-token.js +0 -2
- package/dist/es-legacy/components/PayPal/services/request-paypal-oauth-token.js.map +0 -1
- package/dist/es-legacy/components/PayPal/services/request-paypal-order-details.js +0 -2
- package/dist/es-legacy/components/PayPal/services/request-paypal-order-details.js.map +0 -1
- package/dist/es-legacy/components/PayPal/utils/is-paypal-service-config-equal.js +0 -2
- package/dist/es-legacy/components/PayPal/utils/is-paypal-service-config-equal.js.map +0 -1
- package/dist/es-legacy/utils/is-live-environment.js +0 -2
- package/dist/es-legacy/utils/is-live-environment.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Specifications.js","sources":["../../../../../src/components/internal/Address/Specifications.ts"],"sourcesContent":["import { AddressSchema, AddressSpecifications, StringObject } from './types';\nimport { ADDRESS_SPECIFICATIONS } from './constants';\nimport { AddressField } from '../../../types/global-types';\n\nconst SCHEMA_MAX_DEPTH = 2;\n\nclass Specifications {\n private specifications: AddressSpecifications
|
|
1
|
+
{"version":3,"file":"Specifications.js","sources":["../../../../../src/components/internal/Address/Specifications.ts"],"sourcesContent":["import { AddressSchema, AddressSpecifications, StringObject } from './types';\nimport { ADDRESS_SPECIFICATIONS } from './constants';\nimport { AddressField } from '../../../types/global-types';\n\nconst SCHEMA_MAX_DEPTH = 2;\n\nclass Specifications {\n private specifications: Partial<AddressSpecifications>;\n\n constructor(specifications?: AddressSpecifications) {\n this.specifications = { ...ADDRESS_SPECIFICATIONS, ...specifications };\n }\n\n /**\n * Checks if a certain country has a dataset.\n * @param country - The selected country\n * @returns Boolean\n */\n countryHasDataset(country: string): boolean {\n return !!this.specifications?.[country]?.hasDataset;\n }\n\n /**\n * Checks if a certain country has the passed field in their optional fields array.\n * @param country - The selected country\n * @param fieldName - The field to be checked\n * @returns Boolean\n */\n countryHasOptionalField(country: string, fieldName: AddressField): boolean {\n return !!this.specifications?.[country]?.optionalFields?.includes(fieldName);\n }\n\n /**\n * Returns the address schema of the selected country or the default address schema.\n * @param country - The selected country\n * @returns AddressSchema\n */\n getAddressSchemaForCountry(country?: string): AddressSchema {\n return (country && this.specifications?.[country]?.schema) || this.specifications?.default?.schema || ADDRESS_SPECIFICATIONS.default.schema;\n }\n\n /**\n * Returns the address labels of the selected country or the default address labels.\n * @param country - The selected country\n * @returns StringObject\n */\n getAddressLabelsForCountry(country?: string): StringObject | undefined {\n return (country && this.specifications?.[country]?.labels) || this.specifications?.default?.labels;\n }\n\n /**\n * Returns the optional fields of the selected country or the default optional fields.\n * @param country - The selected country\n * @returns Optional fields array\n */\n getOptionalFieldsForCountry(country?: string): string[] {\n return (country && this.specifications?.[country]?.optionalFields) || this.specifications?.default?.optionalFields || [];\n }\n\n /**\n * Returns the key for a field of the passed country or the default key for that field.\n * @param fieldName - The field to be searched\n * @param country - The selected country\n */\n getKeyForField(fieldName: string, country?: string): string {\n return (country && this.specifications?.[country]?.labels?.[fieldName]) || this.specifications?.default?.labels?.[fieldName] || fieldName;\n }\n\n /**\n * Returns the placeholder key for a field of the passed country or the default key for that field.\n * @param fieldName - The field to be searched\n * @param country - The selected country\n */\n getPlaceholderKeyForField(fieldName: string, country: string): string | undefined {\n return this.specifications?.[country]?.placeholders?.[fieldName] || this.specifications?.default?.placeholders?.[fieldName];\n }\n\n /**\n * Returns an array with the address schema of the selected country or the default address schema\n * Flat version of getAddressSchemaForCountry\n * @param country - The selected country\n * @returns Array\n */\n getAddressSchemaForCountryFlat(country?: string): AddressField[] {\n return this.getAddressSchemaForCountry(country)\n .flat(SCHEMA_MAX_DEPTH)\n .filter((element): element is AddressField => typeof element === 'string');\n }\n}\n\nexport default Specifications;\n"],"names":["Specifications","countryHasDataset","country","this","specifications","hasDataset","countryHasOptionalField","fieldName","optionalFields","includes","getAddressSchemaForCountry","schema","default","ADDRESS_SPECIFICATIONS","getAddressLabelsForCountry","labels","getOptionalFieldsForCountry","getKeyForField","getPlaceholderKeyForField","placeholders","getAddressSchemaForCountryFlat","flat","filter","element","constructor"],"mappings":"wDAMA,MAAMA,EAYFC,iBAAAA,CAAkBC,GACd,QAASC,KAAKC,iBAAiBF,IAAUG,UAC7C,CAQAC,uBAAAA,CAAwBJ,EAAiBK,GACrC,QAASJ,KAAKC,iBAAiBF,IAAUM,gBAAgBC,SAASF,EACtE,CAOAG,0BAAAA,CAA2BR,GACvB,OAAOA,GAAYC,KAAKC,iBAAiBF,IAAUS,QAAWR,KAAKC,gBAAgBQ,SAASD,QAAUE,EAAuBD,QAAQD,MACzI,CAOAG,0BAAAA,CAA2BZ,GACvB,OAAOA,GAAYC,KAAKC,iBAAiBF,IAAUa,QAAWZ,KAAKC,gBAAgBQ,SAASG,MAChG,CAOAC,2BAAAA,CAA4Bd,GACxB,OAAOA,GAAYC,KAAKC,iBAAiBF,IAAUM,gBAAmBL,KAAKC,gBAAgBQ,SAASJ,gBAAkB,EAC1H,CAOAS,cAAAA,CAAeV,EAAmBL,GAC9B,OAAQA,GAAWC,KAAKC,iBAAiBF,IAAUa,SAASR,IAAeJ,KAAKC,gBAAgBQ,SAASG,SAASR,IAAcA,CACpI,CAOAW,yBAAAA,CAA0BX,EAAmBL,GACzC,OAAOC,KAAKC,iBAAiBF,IAAUiB,eAAeZ,IAAcJ,KAAKC,gBAAgBQ,SAASO,eAAeZ,EACrH,CAQAa,8BAAAA,CAA+BlB,GAC3B,OAAOC,KAAKO,2BAA2BR,GAClCmB,KAjFY,GAkFZC,OAAQC,GAAwD,iBAAZA,EAC7D,CA9EA,WAAAC,CAAYpB,yBAFJA,sBAARD,4FAGIA,KAAKC,eAAiB,IAAKS,KAA2BT,EAC1D"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"../../FormFields/Field/Field.js";import{createElement as s}from"../../../../external/preact/dist/preact.js";import{useState as a,useCallback as t,useEffect as r,useMemo as o}from"../../../../external/preact/hooks/dist/hooks.js";import{useCoreContext as n}from"../../../../core/Context/CoreProvider.js";import{debounce as d}from"../../../../utils/debounce.js";import c from"../../FormFields/Select/Select.js";function l({onAddressLookup:l,onAddressSelected:u,onSelect:i,onManualAddress:m,externalErrorMessage:h,hideManualButton:_,showContextualElement:p,contextualText:f,placeholder:k,addressSearchDebounceMs:b}){const[x,g]=a([]),[y,
|
|
1
|
+
import e from"../../FormFields/Field/Field.js";import{createElement as s}from"../../../../external/preact/dist/preact.js";import{useState as a,useCallback as t,useEffect as r,useMemo as o}from"../../../../external/preact/hooks/dist/hooks.js";import{useCoreContext as n}from"../../../../core/Context/CoreProvider.js";import{debounce as d}from"../../../../utils/debounce.js";import c from"../../FormFields/Select/Select.js";function l({onAddressLookup:l,onAddressSelected:u,onSelect:i,onManualAddress:m,externalErrorMessage:h,hideManualButton:_,showContextualElement:p,contextualText:f,placeholder:k,addressSearchDebounceMs:b}){const[x,g]=a([]),[y,v]=a([]),[M,j]=a(""),{i18n:C}=n(),F=t(e=>{e?.errorMessage&&j(e.errorMessage)},[]),S=t(e=>{new Promise((s,a)=>{l(e,{resolve:s,reject:a})}).then(e=>{v(e),g(e.map(({id:e,name:s})=>({id:e,name:s}))),j("")}).catch(e=>F(e))},[l]);r(()=>{j(h)},[h]);const w=o(()=>d(S,b),[]);return s("div",{className:"adyen-checkout__address-search adyen-checkout__field-group"},s(e,{label:C.get("address"),classNameModifiers:["address-search"],errorMessage:M,name:"address-search",showContextualElement:p,contextualText:f},s(c,{name:"address-search",className:"adyen-checkout__address-search__dropdown",placeholder:k,onInput:w,items:x,onChange:e=>{if(!e.target.value)return void j(C.get("address.errors.incomplete"));const s=y.find(s=>s.id===e.target.value);return s?"function"!=typeof u?(i(s),void g([])):void new Promise((e,a)=>{u(s,{resolve:e,reject:a})}).then(e=>{i(e),g([])}).catch(e=>F(e)):void 0},disableTextFilter:!0,blurOnClose:!0})),!_&&s("span",{className:"adyen-checkout__address-search__manual-add"},s("button",{type:"button",className:"adyen-checkout__button adyen-checkout__button--inline adyen-checkout__button--link adyen-checkout__address-search__manual-add__button",onClick:m},"+ "+C.get("address.enterManually"))))}export{l as default};
|
|
2
2
|
//# sourceMappingURL=AddressSearch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddressSearch.js","sources":["../../../../../../src/components/internal/Address/components/AddressSearch.tsx"],"sourcesContent":["import Field from '../../FormFields/Field';\nimport { h } from 'preact';\nimport { AddressLookupItem } from '../types';\nimport { useCallback, useEffect, useState, useMemo } from 'preact/hooks';\nimport './AddressSearch.scss';\nimport { useCoreContext } from '../../../../core/Context/CoreProvider';\nimport { debounce } from '../../../../utils/debounce';\nimport Select from '../../FormFields/Select';\nimport { AddressData } from '../../../../types';\n\nexport type OnAddressLookupType = (\n value: string,\n actions: {\n resolve: (value: Array<AddressLookupItem>) => void;\n reject: (reason?: RejectionReason) => void;\n }\n) => Promise<void>;\n\nexport type OnAddressSelectedType = (\n value: AddressLookupItem,\n actions: {\n resolve: (value: AddressLookupItem) => void;\n reject: (reason?: RejectionReason) => void;\n }\n) => Promise<void>;\n\ninterface AddressSearchProps {\n onAddressLookup
|
|
1
|
+
{"version":3,"file":"AddressSearch.js","sources":["../../../../../../src/components/internal/Address/components/AddressSearch.tsx"],"sourcesContent":["import Field from '../../FormFields/Field';\nimport { h } from 'preact';\nimport { AddressLookupItem } from '../types';\nimport { useCallback, useEffect, useState, useMemo } from 'preact/hooks';\nimport './AddressSearch.scss';\nimport { useCoreContext } from '../../../../core/Context/CoreProvider';\nimport { debounce } from '../../../../utils/debounce';\nimport Select from '../../FormFields/Select';\nimport { AddressData } from '../../../../types';\n\nexport type OnAddressLookupType = (\n value: string,\n actions: {\n resolve: (value: Array<AddressLookupItem>) => void;\n reject: (reason?: RejectionReason) => void;\n }\n) => Promise<void>;\n\nexport type OnAddressSelectedType = (\n value: AddressLookupItem,\n actions: {\n resolve: (value: AddressLookupItem) => void;\n reject: (reason?: RejectionReason) => void;\n }\n) => Promise<void>;\n\ninterface AddressSearchProps {\n onAddressLookup: OnAddressLookupType;\n onAddressSelected?: OnAddressSelectedType;\n onSelect: (addressItem: AddressData) => void;\n onManualAddress: () => void;\n externalErrorMessage: string;\n hideManualButton: boolean;\n showContextualElement?: boolean;\n contextualText?: string;\n placeholder?: string;\n addressSearchDebounceMs?: number;\n}\n\ninterface RejectionReason {\n errorMessage: string;\n}\n\nexport default function AddressSearch({\n onAddressLookup,\n onAddressSelected,\n onSelect,\n onManualAddress,\n externalErrorMessage,\n hideManualButton,\n showContextualElement,\n contextualText,\n placeholder,\n addressSearchDebounceMs\n}: Readonly<AddressSearchProps>) {\n const [formattedData, setFormattedData] = useState<AddressLookupItem[]>([]);\n const [originalData, setOriginalData] = useState<AddressLookupItem[]>([]);\n\n const [errorMessage, setErrorMessage] = useState('');\n\n const { i18n } = useCoreContext();\n const mapDataToSelect = data => data.map(({ id, name }) => ({ id, name }));\n\n const handlePromiseReject = useCallback((reason: RejectionReason) => {\n if (reason?.errorMessage) {\n setErrorMessage(reason.errorMessage);\n }\n }, []);\n\n const onTextInput = useCallback(\n (inputValue: string) => {\n new Promise<Array<AddressLookupItem>>((resolve, reject) => {\n void onAddressLookup(inputValue, { resolve, reject });\n })\n .then(searchArray => {\n setOriginalData(searchArray);\n setFormattedData(mapDataToSelect(searchArray));\n setErrorMessage('');\n })\n .catch(reason => handlePromiseReject(reason));\n },\n [onAddressLookup]\n );\n\n // update error message when there's a new one\n useEffect(() => {\n setErrorMessage(externalErrorMessage);\n }, [externalErrorMessage]);\n\n const onSelectItem = event => {\n if (!event.target.value) {\n setErrorMessage(i18n.get('address.errors.incomplete'));\n return;\n }\n const value = originalData.find(item => item.id === event.target.value);\n if (!value) return;\n\n // 1. in case we don't get a function just select item\n if (typeof onAddressSelected !== 'function') {\n onSelect(value);\n setFormattedData([]);\n return;\n }\n\n // 2. in case callback is provided, create and call onAddressSelected\n new Promise<AddressLookupItem>((resolve, reject) => {\n void onAddressSelected(value, { resolve, reject });\n })\n .then(fullData => {\n onSelect(fullData);\n setFormattedData([]);\n })\n .catch(reason => handlePromiseReject(reason));\n };\n\n const debounceInputHandler = useMemo(() => debounce(onTextInput, addressSearchDebounceMs), []);\n\n return (\n // The search field is intentionally rendered before the manual entry button in the DOM.\n // See: ../a11y.md\n <div className={'adyen-checkout__address-search adyen-checkout__field-group'}>\n <Field\n label={i18n.get('address')}\n classNameModifiers={['address-search']}\n errorMessage={errorMessage}\n name={'address-search'}\n showContextualElement={showContextualElement}\n contextualText={contextualText}\n >\n <Select\n name={'address-search'}\n className={'adyen-checkout__address-search__dropdown'}\n placeholder={placeholder}\n onInput={debounceInputHandler}\n items={formattedData}\n onChange={onSelectItem}\n disableTextFilter={true}\n blurOnClose={true}\n />\n </Field>\n {!hideManualButton && (\n <span className=\"adyen-checkout__address-search__manual-add\">\n <button\n type=\"button\"\n className=\"adyen-checkout__button adyen-checkout__button--inline adyen-checkout__button--link adyen-checkout__address-search__manual-add__button\"\n onClick={onManualAddress}\n >\n {'+ ' + i18n.get('address.enterManually')}\n </button>\n </span>\n )}\n </div>\n );\n}\n"],"names":["AddressSearch","onAddressLookup","onAddressSelected","onSelect","onManualAddress","externalErrorMessage","hideManualButton","showContextualElement","contextualText","placeholder","addressSearchDebounceMs","formattedData","setFormattedData","useState","originalData","setOriginalData","errorMessage","setErrorMessage","i18n","useCoreContext","handlePromiseReject","useCallback","reason","onTextInput","inputValue","Promise","resolve","reject","then","searchArray","map","id","name","catch","useEffect","debounceInputHandler","useMemo","debounce","h","div","className","Field","label","get","classNameModifiers","Select","onInput","items","onChange","event","target","value","find","item","fullData","disableTextFilter","blurOnClose","span","button","type","onClick"],"mappings":"saA2Ce,SAASA,GAAcC,gBAClCA,EAAeC,kBACfA,EAAiBC,SACjBA,EAAQC,gBACRA,EAAeC,qBACfA,EAAoBC,iBACpBA,EAAgBC,sBAChBA,EAAqBC,eACrBA,EAAcC,YACdA,EAAWC,wBACXA,IAEA,MAAOC,EAAeC,GAAoBC,EAA8B,KACjEC,EAAcC,GAAmBF,EAA8B,KAE/DG,EAAcC,GAAmBJ,EAAS,KAE3CK,KAAEA,GAASC,IAGXC,EAAsBC,EAAaC,IACjCA,GAAQN,cACRC,EAAgBK,EAAON,eAE5B,IAEGO,EAAcF,EACfG,IACG,IAAIC,QAAkC,CAACC,EAASC,KACvC1B,EAAgBuB,EAAY,CAAEE,UAASC,aAE3CC,KAAKC,IACFd,EAAgBc,GAChBjB,EAAiCiB,EAfZC,IAAI,EAAGC,KAAIC,WAAM,CAAQD,KAAIC,WAgBlDf,EAAgB,MAEnBgB,MAAMX,GAAUF,EAAoBE,KAE7C,CAACrB,IAILiC,EAAU,KACNjB,EAAgBZ,IACjB,CAACA,IAEJ,MA0BM8B,EAAuBC,EAAQ,IAAMC,EAASd,EAAab,GAA0B,IAE3F,OAGI4B,EAACC,MAAAA,CAAIC,UAAW,8DACZF,EAACG,EAAAA,CACGC,MAAOxB,EAAKyB,IAAI,WAChBC,mBAAoB,CAAC,kBACrB5B,aAAcA,EACdgB,KAAM,iBACNzB,sBAAuBA,EACvBC,eAAgBA,GAEhB8B,EAACO,EAAAA,CACGb,KAAM,iBACNQ,UAAW,2CACX/B,YAAaA,EACbqC,QAASX,EACTY,MAAOpC,EACPqC,SA9CKC,IACjB,IAAKA,EAAMC,OAAOC,MAEd,YADAlC,EAAgBC,EAAKyB,IAAI,8BAG7B,MAAMQ,EAAQrC,EAAasC,KAAKC,GAAQA,EAAKtB,KAAOkB,EAAMC,OAAOC,OACjE,OAAKA,EAG4B,mBAAtBjD,GACPC,EAASgD,QACTvC,EAAiB,UAKrB,IAAIa,QAA2B,CAACC,EAASC,KAChCzB,EAAkBiD,EAAO,CAAEzB,UAASC,aAExCC,KAAK0B,IACFnD,EAASmD,GACT1C,EAAiB,MAEpBqB,MAAMX,GAAUF,EAAoBE,SAjBzC,GAyCYiC,mBAAmB,EACnBC,aAAa,MAGnBlD,GACEgC,EAACmB,OAAAA,CAAKjB,UAAU,8CACZF,EAACoB,SAAAA,CACGC,KAAK,SACLnB,UAAU,wIACVoB,QAASxD,GAER,KAAOc,EAAKyB,IAAI,2BAMzC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createElement as e}from"../../../../external/preact/dist/preact.js";import{useState as r,useLayoutEffect as o}from"../../../../external/preact/hooks/dist/hooks.js";import t from"../../FormFields/Field/Field.js";import{useCoreContext as a}from"../../../../core/Context/CoreProvider.js";import s from"../../../../core/Services/get-dataset.js";import n from"../../FormFields/Select/Select.js";function
|
|
1
|
+
import{createElement as e}from"../../../../external/preact/dist/preact.js";import{useState as r,useLayoutEffect as o}from"../../../../external/preact/hooks/dist/hooks.js";import t from"../../FormFields/Field/Field.js";import{useCoreContext as a}from"../../../../core/Context/CoreProvider.js";import s from"../../../../core/Services/get-dataset.js";import n from"../../FormFields/Select/Select.js";function i(i){const{allowedCountries:l=[],classNameModifiers:c=[],errorMessage:m,onDropdownChange:d,value:u,required:p}=i,{i18n:f,loadingContext:g}=a(),[h,y]=r([]),[j,C]=r(!1),[F,x]=r(i.readOnly);return o(()=>{s("countries",g,f.translationsLocale).then(e=>{const r=((e,r)=>{const o=e=>({...e,name:e.name,selectedOptionName:e.name});return r.length?e.filter(e=>r.includes(e.id)).map(o):e.map(o)})(e,l);y(r||[]),x(1===r.length||F),C(!0)}).catch(e=>{console.error(e),y([]),C(!0)})},[]),j?e(t,{name:"country",label:f.get("country"),errorMessage:m,classNameModifiers:c,isValid:!!u,showValidIcon:!1,i18n:f,readOnly:F&&!!u},e(n,{onChange:d,name:"country",selectedValue:u,items:h,readonly:F&&!!u,required:p})):null}export{i as default};
|
|
2
2
|
//# sourceMappingURL=CountryField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CountryField.js","sources":["../../../../../../src/components/internal/Address/components/CountryField.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useLayoutEffect, useState } from 'preact/hooks';\nimport Field from '../../FormFields/Field';\nimport { useCoreContext } from '../../../../core/Context/CoreProvider';\nimport getDataset from '../../../../core/Services/get-dataset';\nimport { CountryFieldProps, CountryFieldItem } from '../types';\nimport Select from '../../FormFields/Select';\n\nconst formatCountries = (countries: Array<CountryFieldItem>, allowedCountries: string[]) => {\n const applyFilter = (country: CountryFieldItem) => allowedCountries.includes(country.id);\n const applyMapper = (country: CountryFieldItem) => {\n return {\n ...country,\n name: country.name,\n selectedOptionName: country.name\n };\n };\n return allowedCountries.length ? countries.filter(applyFilter).map(applyMapper) : countries.map(applyMapper);\n};\n\nexport default function CountryField(props: Readonly<CountryFieldProps>) {\n const { allowedCountries = [], classNameModifiers = [], errorMessage, onDropdownChange, value, required } = props;\n const { i18n, loadingContext } = useCoreContext();\n const [countries, setCountries] = useState<CountryFieldItem[]>([]);\n const [loaded, setLoaded] = useState<boolean>(false);\n const [readOnly, setReadOnly] = useState(props.readOnly);\n\n useLayoutEffect(() => {\n getDataset<CountryFieldItem[]>('countries', loadingContext, i18n.
|
|
1
|
+
{"version":3,"file":"CountryField.js","sources":["../../../../../../src/components/internal/Address/components/CountryField.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useLayoutEffect, useState } from 'preact/hooks';\nimport Field from '../../FormFields/Field';\nimport { useCoreContext } from '../../../../core/Context/CoreProvider';\nimport getDataset from '../../../../core/Services/get-dataset';\nimport { CountryFieldProps, CountryFieldItem } from '../types';\nimport Select from '../../FormFields/Select';\n\nconst formatCountries = (countries: Array<CountryFieldItem>, allowedCountries: string[]) => {\n const applyFilter = (country: CountryFieldItem) => allowedCountries.includes(country.id);\n const applyMapper = (country: CountryFieldItem) => {\n return {\n ...country,\n name: country.name,\n selectedOptionName: country.name\n };\n };\n return allowedCountries.length ? countries.filter(applyFilter).map(applyMapper) : countries.map(applyMapper);\n};\n\nexport default function CountryField(props: Readonly<CountryFieldProps>) {\n const { allowedCountries = [], classNameModifiers = [], errorMessage, onDropdownChange, value, required } = props;\n const { i18n, loadingContext } = useCoreContext();\n const [countries, setCountries] = useState<CountryFieldItem[]>([]);\n const [loaded, setLoaded] = useState<boolean>(false);\n const [readOnly, setReadOnly] = useState(props.readOnly);\n\n useLayoutEffect(() => {\n getDataset<CountryFieldItem[]>('countries', loadingContext, i18n.translationsLocale)\n .then(response => {\n const newCountries = formatCountries(response, allowedCountries);\n setCountries(newCountries || []);\n setReadOnly(newCountries.length === 1 || readOnly);\n setLoaded(true);\n })\n .catch(error => {\n console.error(error);\n setCountries([]);\n setLoaded(true);\n });\n }, []);\n\n if (!loaded) return null;\n\n return (\n <Field\n name={'country'}\n label={i18n.get('country')}\n errorMessage={errorMessage}\n classNameModifiers={classNameModifiers}\n isValid={!!value}\n showValidIcon={false}\n i18n={i18n}\n readOnly={readOnly && !!value}\n >\n <Select\n onChange={onDropdownChange}\n name={'country'}\n selectedValue={value}\n items={countries}\n readonly={readOnly && !!value}\n required={required}\n />\n </Field>\n );\n}\n"],"names":["CountryField","props","allowedCountries","classNameModifiers","errorMessage","onDropdownChange","value","required","i18n","loadingContext","useCoreContext","countries","setCountries","useState","loaded","setLoaded","readOnly","setReadOnly","useLayoutEffect","getDataset","translationsLocale","then","response","newCountries","applyMapper","country","name","selectedOptionName","length","filter","includes","id","map","formatCountries","catch","error","console","h","Field","label","get","isValid","showValidIcon","Select","onChange","selectedValue","items","readonly"],"mappings":"6YAoBe,SAASA,EAAaC,GACjC,MAAMC,iBAAEA,EAAmB,GAAEC,mBAAEA,EAAqB,GAAEC,aAAEA,EAAYC,iBAAEA,EAAgBC,MAAEA,EAAKC,SAAEA,GAAaN,GACtGO,KAAEA,EAAIC,eAAEA,GAAmBC,KAC1BC,EAAWC,GAAgBC,EAA6B,KACxDC,EAAQC,GAAaF,GAAkB,IACvCG,EAAUC,GAAeJ,EAASZ,EAAMe,UAiB/C,OAfAE,EAAgB,KACZC,EAA+B,YAAaV,EAAgBD,EAAKY,oBAC5DC,KAAKC,IACF,MAAMC,EAtBE,EAACZ,EAAoCT,KACzD,MACMsB,EAAeC,IACV,IACAA,EACHC,KAAMD,EAAQC,KACdC,mBAAoBF,EAAQC,OAGpC,OAAOxB,EAAiB0B,OAASjB,EAAUkB,OARtBJ,GAA8BvB,EAAiB4B,SAASL,EAAQM,KAQtBC,IAAIR,GAAeb,EAAUqB,IAAIR,IAa/DS,CAAgBX,EAAUpB,GAC/CU,EAAaW,GAAgB,IAC7BN,EAAoC,IAAxBM,EAAaK,QAAgBZ,GACzCD,GAAU,KAEbmB,MAAMC,IACHC,QAAQD,MAAMA,GACdvB,EAAa,IACbG,GAAU,MAEnB,IAEED,EAGDuB,EAACC,EAAAA,CACGZ,KAAM,UACNa,MAAO/B,EAAKgC,IAAI,WAChBpC,aAAcA,EACdD,mBAAoBA,EACpBsC,UAAWnC,EACXoC,eAAe,EACflC,KAAMA,EACNQ,SAAUA,KAAcV,GAExB+B,EAACM,EAAAA,CACGC,SAAUvC,EACVqB,KAAM,UACNmB,cAAevC,EACfwC,MAAOnC,EACPoC,SAAU/B,KAAcV,EACxBC,SAAUA,KAnBF,IAuBxB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createElement as e}from"../../../../external/preact/dist/preact.js";import r from"../../FormFields/Field/Field.js";import o from"./StateField.js";import i from"./CountryField.js";import{useCoreContext as s}from"../../../../core/Context/CoreProvider.js";import t from"../../FormFields/InputText.js";import{ADDRESS_FIELD_TOKEN_MAP as n}from"../constants.js";function a(e,r){const o=n[e];if(o)return"billingAddress"===r?`billing ${o}`:"deliveryAddress"===r?`shipping ${o}`:o}function l(n){const{i18n:l}=s(),{classNameModifiers:d=[],data:c,errors:u,valid:m,fieldName:p,onInput:f,onBlur:g,trimOnBlur:F,maxLength:y,disabled:C,addressType:M}=n,b=c[p],j=c.country,v
|
|
1
|
+
import{createElement as e}from"../../../../external/preact/dist/preact.js";import r from"../../FormFields/Field/Field.js";import o from"./StateField.js";import i from"./CountryField.js";import{useCoreContext as s}from"../../../../core/Context/CoreProvider.js";import t from"../../FormFields/InputText.js";import{ADDRESS_FIELD_TOKEN_MAP as n}from"../constants.js";function a(e,r){const o=n[e];if(o)return"billingAddress"===r?`billing ${o}`:"deliveryAddress"===r?`shipping ${o}`:o}function l(n){const{i18n:l}=s(),{classNameModifiers:d=[],data:c,errors:u,valid:m,fieldName:p,onInput:f,onBlur:g,trimOnBlur:F,maxLength:y,disabled:C,addressType:M}=n,b=c[p],j=c.country,v=!!j&&n.specifications.countryHasOptionalField(j,p),h=n.specifications.getKeyForField(p,j),w=v?` ${l.get("field.title.optional")}`:"",x=`${l.get(h)}${w}`,B=function(e,r,o,i){if("object"==typeof e[r]?.errorMessage){const{translationKey:i,translationObject:s}=e[r].errorMessage;return o.get(i,s)}return o.get(e[r]?.errorMessage,{values:{label:i.toLowerCase()}})||!!e[r]}(u,p,l,x);return"country"===p?e(i,{allowedCountries:n.allowedCountries,classNameModifiers:d,label:x,errorMessage:B,onDropdownChange:n.onDropdownChange,value:b,required:!v}):"stateOrProvince"===p?e(o,{classNameModifiers:d,label:x,errorMessage:B,onDropdownChange:n.onDropdownChange,selectedCountry:j,specifications:n.specifications,value:b,required:!v}):e(r,{label:x,classNameModifiers:d,errorMessage:B,isValid:m[p],name:p,i18n:l,onFocus:e=>n.onFieldFocusAnalytics?.(p,e),onBlur:e=>n.onFieldBlurAnalytics?.(p,e)},e(t,{name:p,classNameModifiers:d,value:b,onInput:f,onBlur:g,maxlength:y,trimOnBlur:F,disabled:C,required:!v,autocomplete:a(p,M)}))}export{l as default};
|
|
2
2
|
//# sourceMappingURL=FieldContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldContainer.js","sources":["../../../../../../src/components/internal/Address/components/FieldContainer.tsx"],"sourcesContent":["import { h } from 'preact';\nimport Field from '../../FormFields/Field';\nimport StateField from './StateField';\nimport CountryField from './CountryField';\nimport { AddressStateError, AddressType, FieldContainerProps } from '../types';\nimport { useCoreContext } from '../../../../core/Context/CoreProvider';\nimport Language from '../../../../language/Language';\nimport InputText from '../../FormFields/InputText';\nimport { AutocompleteValue } from '../../FormFields/types';\nimport { ADDRESS_FIELD_TOKEN_MAP } from '../constants';\nimport { AddressField } from '../../../../types';\n\nfunction getErrorMessage(errors: AddressStateError, fieldName: string, i18n: Language, label: string): string | boolean {\n if (typeof errors[fieldName]?.errorMessage === 'object') {\n const { translationKey, translationObject } = errors[fieldName].errorMessage;\n return i18n.get(translationKey, translationObject);\n }\n // Default error msg: Enter the [label name]\n const errorMsg = i18n.get(errors[fieldName]?.errorMessage, { values: { label: label.toLowerCase() } });\n return errorMsg || !!errors[fieldName];\n}\n\n/**\n * USAGE: Specifically defined as a util to provide a wrapper for fields created within the Address component\n *\n * NOT TO BE USED: if you just want to add a Country or State dropdown outside of an Address component\n * - then you should implement <CountryField> or <StateField> directly\n */\nfunction getAddressAutocomplete(fieldName: string, addressType: AddressType): AutocompleteValue {\n const token = ADDRESS_FIELD_TOKEN_MAP[fieldName];\n if (!token) return undefined;\n if (addressType === 'billingAddress') return `billing ${token}` as AutocompleteValue;\n if (addressType === 'deliveryAddress') return `shipping ${token}` as AutocompleteValue;\n // Fallback: bare token (no prefix) when address type is unspecified\n return token as AutocompleteValue;\n}\n\nfunction FieldContainer(props: Readonly<FieldContainerProps>) {\n const { i18n } = useCoreContext();\n const { classNameModifiers = [], data, errors, valid, fieldName, onInput, onBlur, trimOnBlur, maxLength, disabled, addressType } = props;\n\n const value: string = data[fieldName];\n const selectedCountry
|
|
1
|
+
{"version":3,"file":"FieldContainer.js","sources":["../../../../../../src/components/internal/Address/components/FieldContainer.tsx"],"sourcesContent":["import { h } from 'preact';\nimport Field from '../../FormFields/Field';\nimport StateField from './StateField';\nimport CountryField from './CountryField';\nimport { AddressStateError, AddressType, FieldContainerProps } from '../types';\nimport { useCoreContext } from '../../../../core/Context/CoreProvider';\nimport Language from '../../../../language/Language';\nimport InputText from '../../FormFields/InputText';\nimport { AutocompleteValue } from '../../FormFields/types';\nimport { ADDRESS_FIELD_TOKEN_MAP } from '../constants';\nimport { AddressField } from '../../../../types';\n\nfunction getErrorMessage(errors: AddressStateError, fieldName: string, i18n: Language, label: string): string | boolean {\n if (typeof errors[fieldName]?.errorMessage === 'object') {\n const { translationKey, translationObject } = errors[fieldName].errorMessage;\n return i18n.get(translationKey, translationObject);\n }\n // Default error msg: Enter the [label name]\n const errorMsg = i18n.get(errors[fieldName]?.errorMessage, { values: { label: label.toLowerCase() } });\n return errorMsg || !!errors[fieldName];\n}\n\n/**\n * USAGE: Specifically defined as a util to provide a wrapper for fields created within the Address component\n *\n * NOT TO BE USED: if you just want to add a Country or State dropdown outside of an Address component\n * - then you should implement <CountryField> or <StateField> directly\n */\nfunction getAddressAutocomplete(fieldName: string, addressType: AddressType): AutocompleteValue {\n const token = ADDRESS_FIELD_TOKEN_MAP[fieldName];\n if (!token) return undefined;\n if (addressType === 'billingAddress') return `billing ${token}` as AutocompleteValue;\n if (addressType === 'deliveryAddress') return `shipping ${token}` as AutocompleteValue;\n // Fallback: bare token (no prefix) when address type is unspecified\n return token as AutocompleteValue;\n}\n\nfunction FieldContainer(props: Readonly<FieldContainerProps>) {\n const { i18n } = useCoreContext();\n const { classNameModifiers = [], data, errors, valid, fieldName, onInput, onBlur, trimOnBlur, maxLength, disabled, addressType } = props;\n\n const value: string = data[fieldName];\n const selectedCountry = data.country;\n const isOptional = selectedCountry ? props.specifications.countryHasOptionalField(selectedCountry, fieldName as AddressField) : false;\n const labelKey = props.specifications.getKeyForField(fieldName, selectedCountry);\n const optionalLabel = isOptional ? ` ${i18n.get('field.title.optional')}` : '';\n const label = `${i18n.get(labelKey)}${optionalLabel}`;\n const errorMessage = getErrorMessage(errors, fieldName, i18n, label);\n\n if (fieldName === 'country') {\n return (\n <CountryField\n allowedCountries={props.allowedCountries}\n classNameModifiers={classNameModifiers}\n label={label}\n errorMessage={errorMessage}\n onDropdownChange={props.onDropdownChange}\n value={value}\n required={!isOptional}\n />\n );\n }\n\n if (fieldName === 'stateOrProvince') {\n return (\n <StateField\n classNameModifiers={classNameModifiers}\n label={label}\n errorMessage={errorMessage}\n onDropdownChange={props.onDropdownChange}\n selectedCountry={selectedCountry}\n specifications={props.specifications}\n value={value}\n required={!isOptional}\n />\n );\n }\n\n return (\n <Field\n label={label}\n classNameModifiers={classNameModifiers}\n errorMessage={errorMessage}\n isValid={valid[fieldName]}\n name={fieldName}\n i18n={i18n}\n onFocus={e => props.onFieldFocusAnalytics?.(fieldName, e)}\n onBlur={e => props.onFieldBlurAnalytics?.(fieldName, e)}\n >\n <InputText\n name={fieldName}\n classNameModifiers={classNameModifiers}\n value={value}\n onInput={onInput}\n onBlur={onBlur}\n maxlength={maxLength}\n trimOnBlur={trimOnBlur}\n disabled={disabled}\n required={!isOptional}\n autocomplete={getAddressAutocomplete(fieldName, addressType)}\n />\n </Field>\n );\n}\n\nexport default FieldContainer;\n"],"names":["getAddressAutocomplete","fieldName","addressType","token","ADDRESS_FIELD_TOKEN_MAP","FieldContainer","props","i18n","useCoreContext","classNameModifiers","data","errors","valid","onInput","onBlur","trimOnBlur","maxLength","disabled","value","selectedCountry","country","isOptional","specifications","countryHasOptionalField","labelKey","getKeyForField","optionalLabel","get","label","errorMessage","translationKey","translationObject","values","toLowerCase","getErrorMessage","h","CountryField","allowedCountries","onDropdownChange","required","StateField","Field","isValid","name","onFocus","e","onFieldFocusAnalytics","onFieldBlurAnalytics","InputText","maxlength","autocomplete"],"mappings":"2WA4BA,SAASA,EAAuBC,EAAmBC,GAC/C,MAAMC,EAAQC,EAAwBH,GACtC,GAAKE,EACL,MAAoB,mBAAhBD,EAAyC,WAAWC,IACpC,oBAAhBD,EAA0C,YAAYC,IAEnDA,CACX,CAEA,SAASE,EAAeC,GACpB,MAAMC,KAAEA,GAASC,KACXC,mBAAEA,EAAqB,GAAEC,KAAEA,EAAIC,OAAEA,EAAMC,MAAEA,EAAKX,UAAEA,EAASY,QAAEA,EAAOC,OAAEA,EAAMC,WAAEA,EAAUC,UAAEA,EAASC,SAAEA,EAAQf,YAAEA,GAAgBI,EAE7HY,EAAgBR,EAAKT,GACrBkB,EAAkBT,EAAKU,QACvBC,IAAaF,GAAkBb,EAAMgB,eAAeC,wBAAwBJ,EAAiBlB,GAC7FuB,EAAWlB,EAAMgB,eAAeG,eAAexB,EAAWkB,GAC1DO,EAAgBL,EAAa,IAAId,EAAKoB,IAAI,0BAA4B,GACtEC,EAAQ,GAAGrB,EAAKoB,IAAIH,KAAYE,IAChCG,EAnCV,SAAyBlB,EAA2BV,EAAmBM,EAAgBqB,GACnF,GAA+C,iBAApCjB,EAAOV,IAAY4B,aAA2B,CACrD,MAAMC,eAAEA,EAAcC,kBAAEA,GAAsBpB,EAAOV,GAAW4B,aAChE,OAAOtB,EAAKoB,IAAIG,EAAgBC,EACpC,CAGA,OADiBxB,EAAKoB,IAAIhB,EAAOV,IAAY4B,aAAc,CAAEG,OAAQ,CAAEJ,MAAOA,EAAMK,oBAC/DtB,EAAOV,EAChC,CA2ByBiC,CAAgBvB,EAAQV,EAAWM,EAAMqB,GAE9D,MAAkB,YAAd3B,EAEIkC,EAACC,EAAAA,CACGC,iBAAkB/B,EAAM+B,iBACxB5B,mBAAoBA,EACpBmB,MAAOA,EACPC,aAAcA,EACdS,iBAAkBhC,EAAMgC,iBACxBpB,MAAOA,EACPqB,UAAWlB,IAKL,oBAAdpB,EAEIkC,EAACK,EAAAA,CACG/B,mBAAoBA,EACpBmB,MAAOA,EACPC,aAAcA,EACdS,iBAAkBhC,EAAMgC,iBACxBnB,gBAAiBA,EACjBG,eAAgBhB,EAAMgB,eACtBJ,MAAOA,EACPqB,UAAWlB,IAMnBc,EAACM,EAAAA,CACGb,MAAOA,EACPnB,mBAAoBA,EACpBoB,aAAcA,EACda,QAAS9B,EAAMX,GACf0C,KAAM1C,EACNM,KAAMA,EACNqC,QAASC,GAAKvC,EAAMwC,wBAAwB7C,EAAW4C,GACvD/B,OAAQ+B,GAAKvC,EAAMyC,uBAAuB9C,EAAW4C,IAErDV,EAACa,EAAAA,CACGL,KAAM1C,EACNQ,mBAAoBA,EACpBS,MAAOA,EACPL,QAASA,EACTC,OAAQA,EACRmC,UAAWjC,EACXD,WAAYA,EACZE,SAAUA,EACVsB,UAAWlB,EACX6B,aAAclD,EAAuBC,EAAWC,KAIhE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createElement as e}from"../../../../external/preact/dist/preact.js";import{useState as
|
|
1
|
+
import{createElement as e}from"../../../../external/preact/dist/preact.js";import{useState as t,useLayoutEffect as r}from"../../../../external/preact/hooks/dist/hooks.js";import o from"../../FormFields/Field/Field.js";import{useCoreContext as s}from"../../../../core/Context/CoreProvider.js";import a from"../../../../core/Services/get-dataset.js";import i from"../../FormFields/Select/Select.js";function n(n){const{classNameModifiers:l,label:c,onDropdownChange:d,readOnly:m,selectedCountry:f,specifications:u,value:p,required:h}=n,{i18n:g,loadingContext:j}=s(),[v,y]=t([]),[C,F]=t(!1);return r(()=>{if(!f||!u.countryHasDataset(f))return y([]),void F(!0);a(`states/${f}`,j,g.translationsLocale).then(e=>{const t=e&&e.length?e:[];y(t),F(!0)}).catch(()=>{y([]),F(!0)})},[f]),C&&v.length?e(o,{label:c,classNameModifiers:l,errorMessage:n.errorMessage,isValid:!!p,showValidIcon:!1,name:"stateOrProvince",i18n:g,readOnly:m&&!!p},e(i,{name:"stateOrProvince",onChange:d,selectedValue:p,items:v,required:h,readonly:m&&!!p})):null}export{n as default};
|
|
2
2
|
//# sourceMappingURL=StateField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StateField.js","sources":["../../../../../../src/components/internal/Address/components/StateField.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useState, useLayoutEffect } from 'preact/hooks';\nimport Field from '../../FormFields/Field';\nimport { useCoreContext } from '../../../../core/Context/CoreProvider';\nimport getDataset from '../../../../core/Services/get-dataset';\nimport { StateFieldItem, StateFieldProps } from '../types';\nimport Select from '../../FormFields/Select';\n\nexport default function StateField(props: Readonly<StateFieldProps>) {\n const { classNameModifiers, label, onDropdownChange, readOnly, selectedCountry, specifications, value, required } = props;\n const { i18n, loadingContext } = useCoreContext();\n const [states, setStates] = useState<StateFieldItem[]>([]);\n const [loaded, setLoaded] = useState<boolean>(false);\n\n useLayoutEffect(() => {\n if (!selectedCountry || !specifications.countryHasDataset(selectedCountry)) {\n setStates([]);\n setLoaded(true);\n return;\n }\n\n getDataset<StateFieldItem[]>(`states/${selectedCountry}`, loadingContext, i18n.
|
|
1
|
+
{"version":3,"file":"StateField.js","sources":["../../../../../../src/components/internal/Address/components/StateField.tsx"],"sourcesContent":["import { h } from 'preact';\nimport { useState, useLayoutEffect } from 'preact/hooks';\nimport Field from '../../FormFields/Field';\nimport { useCoreContext } from '../../../../core/Context/CoreProvider';\nimport getDataset from '../../../../core/Services/get-dataset';\nimport { StateFieldItem, StateFieldProps } from '../types';\nimport Select from '../../FormFields/Select';\n\nexport default function StateField(props: Readonly<StateFieldProps>) {\n const { classNameModifiers, label, onDropdownChange, readOnly, selectedCountry, specifications, value, required } = props;\n const { i18n, loadingContext } = useCoreContext();\n const [states, setStates] = useState<StateFieldItem[]>([]);\n const [loaded, setLoaded] = useState<boolean>(false);\n\n useLayoutEffect(() => {\n if (!selectedCountry || !specifications.countryHasDataset(selectedCountry)) {\n setStates([]);\n setLoaded(true);\n return;\n }\n\n getDataset<StateFieldItem[]>(`states/${selectedCountry}`, loadingContext, i18n.translationsLocale)\n .then(response => {\n const newStates = response && response.length ? response : [];\n setStates(newStates);\n setLoaded(true);\n })\n .catch(() => {\n setStates([]);\n setLoaded(true);\n });\n }, [selectedCountry]);\n\n if (!loaded || !states.length) return null;\n\n return (\n <Field\n label={label}\n classNameModifiers={classNameModifiers}\n errorMessage={props.errorMessage}\n isValid={!!value}\n showValidIcon={false}\n name={'stateOrProvince'}\n i18n={i18n}\n readOnly={readOnly && !!value}\n >\n <Select\n name={'stateOrProvince'}\n onChange={onDropdownChange}\n selectedValue={value}\n items={states}\n required={required}\n readonly={readOnly && !!value}\n />\n </Field>\n );\n}\n"],"names":["StateField","props","classNameModifiers","label","onDropdownChange","readOnly","selectedCountry","specifications","value","required","i18n","loadingContext","useCoreContext","states","setStates","useState","loaded","setLoaded","useLayoutEffect","countryHasDataset","getDataset","translationsLocale","then","response","newStates","length","catch","h","Field","errorMessage","isValid","showValidIcon","name","Select","onChange","selectedValue","items","readonly"],"mappings":"6YAQe,SAASA,EAAWC,GAC/B,MAAMC,mBAAEA,EAAkBC,MAAEA,EAAKC,iBAAEA,EAAgBC,SAAEA,EAAQC,gBAAEA,EAAeC,eAAEA,EAAcC,MAAEA,EAAKC,SAAEA,GAAaR,GAC9GS,KAAEA,EAAIC,eAAEA,GAAmBC,KAC1BC,EAAQC,GAAaC,EAA2B,KAChDC,EAAQC,GAAaF,GAAkB,GAqB9C,OAnBAG,EAAgB,KACZ,IAAKZ,IAAoBC,EAAeY,kBAAkBb,GAGtD,OAFAQ,EAAU,SACVG,GAAU,GAIdG,EAA6B,UAAUd,IAAmBK,EAAgBD,EAAKW,oBAC1EC,KAAKC,IACF,MAAMC,EAAYD,GAAYA,EAASE,OAASF,EAAW,GAC3DT,EAAUU,GACVP,GAAU,KAEbS,MAAM,KACHZ,EAAU,IACVG,GAAU,MAEnB,CAACX,IAECU,GAAWH,EAAOY,OAGnBE,EAACC,EAAAA,CACGzB,MAAOA,EACPD,mBAAoBA,EACpB2B,aAAc5B,EAAM4B,aACpBC,UAAWtB,EACXuB,eAAe,EACfC,KAAM,kBACNtB,KAAMA,EACNL,SAAUA,KAAcG,GAExBmB,EAACM,EAAAA,CACGD,KAAM,kBACNE,SAAU9B,EACV+B,cAAe3B,EACf4B,MAAOvB,EACPJ,SAAUA,EACV4B,SAAUhC,KAAcG,KAnBE,IAuB1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../../../src/components/internal/Address/constants.ts"],"sourcesContent":["import { AddressSpecifications } from './types';\n\nexport const FALLBACK_VALUE = 'N/A';\nexport const ADDRESS_SCHEMA = ['street', 'houseNumberOrName', 'postalCode', 'city', 'stateOrProvince', 'country'] as const;\nexport const [STREET, HOUSE_NUMBER_OR_NAME, POSTAL_CODE, CITY, STATE_OR_PROVINCE, COUNTRY] = ADDRESS_SCHEMA;\n\n// WCAG 2.2 - Address field autocomplete tokens\nexport const ADDRESS_FIELD_TOKEN_MAP: Record<string, string> = {\n street: 'address-line1',\n houseNumberOrName: 'address-line2',\n postalCode: 'postal-code',\n city: 'address-level2'\n};\n\n// prettier-ignore\nexport const ADDRESS_SPECIFICATIONS
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../../src/components/internal/Address/constants.ts"],"sourcesContent":["import { AddressSpecifications } from './types';\n\nexport const FALLBACK_VALUE = 'N/A';\nexport const ADDRESS_SCHEMA = ['street', 'houseNumberOrName', 'postalCode', 'city', 'stateOrProvince', 'country'] as const;\nexport const [STREET, HOUSE_NUMBER_OR_NAME, POSTAL_CODE, CITY, STATE_OR_PROVINCE, COUNTRY] = ADDRESS_SCHEMA;\n\n// WCAG 2.2 - Address field autocomplete tokens\nexport const ADDRESS_FIELD_TOKEN_MAP: Record<string, string> = {\n street: 'address-line1',\n houseNumberOrName: 'address-line2',\n postalCode: 'postal-code',\n city: 'address-level2'\n};\n\n// prettier-ignore\nexport const ADDRESS_SPECIFICATIONS = {\n AU: {\n hasDataset: true,\n labels: {\n [HOUSE_NUMBER_OR_NAME]: 'apartmentSuite',\n [STATE_OR_PROVINCE]: 'state',\n [STREET]: 'address'\n },\n optionalFields: [HOUSE_NUMBER_OR_NAME],\n placeholders: {\n [STATE_OR_PROVINCE]: 'select.state'\n },\n schema: [COUNTRY, STREET, HOUSE_NUMBER_OR_NAME, CITY, [[STATE_OR_PROVINCE, 50], [POSTAL_CODE, 50]]]\n },\n BR: {\n hasDataset: true,\n labels: {\n [STATE_OR_PROVINCE]: 'state'\n },\n placeholders: {\n [STATE_OR_PROVINCE]: 'select.state'\n },\n },\n CA: {\n hasDataset: true,\n labels: {\n [HOUSE_NUMBER_OR_NAME]: 'apartmentSuite',\n [STATE_OR_PROVINCE]: 'provinceOrTerritory',\n [STREET]: 'address'\n },\n optionalFields: [HOUSE_NUMBER_OR_NAME],\n schema: [COUNTRY, STREET, HOUSE_NUMBER_OR_NAME, [[CITY, 70], [POSTAL_CODE, 30]], STATE_OR_PROVINCE]\n },\n GB: {\n labels: {\n [CITY]: 'cityTown'\n },\n schema: [COUNTRY, [[HOUSE_NUMBER_OR_NAME, 30], [STREET, 70]], [[CITY, 70], [POSTAL_CODE, 30]], STATE_OR_PROVINCE]\n },\n JP: {\n hasDataset: true,\n labels: {\n [STATE_OR_PROVINCE]: 'prefecture',\n [CITY]: 'cityTown',\n [STREET]: 'streetNameAndBlockNumber',\n [HOUSE_NUMBER_OR_NAME]: 'buildingNameRoomNumber'\n },\n optionalFields: [HOUSE_NUMBER_OR_NAME],\n schema: [COUNTRY, [[POSTAL_CODE, 50], [STATE_OR_PROVINCE, 50]], CITY, STREET, HOUSE_NUMBER_OR_NAME]\n },\n US: {\n hasDataset: true,\n labels: {\n [POSTAL_CODE]: 'zipCode',\n [HOUSE_NUMBER_OR_NAME]: 'apartmentSuite',\n [STATE_OR_PROVINCE]: 'state',\n [STREET]: 'address'\n },\n optionalFields: [HOUSE_NUMBER_OR_NAME],\n placeholders: {\n [STATE_OR_PROVINCE]: 'select.state'\n },\n schema: [COUNTRY, STREET, HOUSE_NUMBER_OR_NAME, CITY, [[STATE_OR_PROVINCE, 50], [POSTAL_CODE, 50]]]\n },\n default: {\n optionalFields: [],\n placeholders: {\n [STATE_OR_PROVINCE]: 'select.provinceOrTerritory'\n },\n schema: [COUNTRY, [[STREET, 70], [HOUSE_NUMBER_OR_NAME, 30]], [[POSTAL_CODE, 30], [CITY, 70]], STATE_OR_PROVINCE],\n }\n} satisfies AddressSpecifications;\n\nexport const PARTIAL_ADDRESS_SCHEMA: AddressSpecifications = Object.keys(ADDRESS_SPECIFICATIONS).reduce((acc, countryCode) => {\n acc[countryCode] = {\n labels: ADDRESS_SPECIFICATIONS[countryCode].labels,\n schema: [POSTAL_CODE]\n };\n return acc;\n}, {} as AddressSpecifications);\n\nexport const COUNTRIES_WITH_CUSTOM_SPECIFICATION = Object.keys(ADDRESS_SPECIFICATIONS);\n"],"names":["FALLBACK_VALUE","ADDRESS_SCHEMA","STREET","HOUSE_NUMBER_OR_NAME","POSTAL_CODE","CITY","STATE_OR_PROVINCE","COUNTRY","ADDRESS_FIELD_TOKEN_MAP","street","houseNumberOrName","postalCode","city","ADDRESS_SPECIFICATIONS","AU","hasDataset","labels","optionalFields","placeholders","schema","BR","CA","GB","JP","US","default","PARTIAL_ADDRESS_SCHEMA","Object","keys","reduce","acc","countryCode","COUNTRIES_WITH_CUSTOM_SPECIFICATION"],"mappings":"AAEO,MAAMA,EAAiB,MACjBC,EAAiB,CAAC,SAAU,oBAAqB,aAAc,OAAQ,kBAAmB,YACzFC,EAAQC,EAAsBC,EAAaC,EAAMC,EAAmBC,GAAWN,EAGhFO,EAAkD,CAC3DC,OAAQ,gBACRC,kBAAmB,gBACnBC,WAAY,cACZC,KAAM,kBAIGC,EAAyB,CAClCC,GAAI,CACAC,YAAY,EACZC,OAAQ,CACJb,CAACA,GAAuB,iBACxBG,CAACA,GAAoB,QACrBJ,CAACA,GAAS,WAEde,eAAgB,CAACd,GACjBe,aAAc,CACVZ,CAACA,GAAoB,gBAEzBa,OAAQ,CAACZ,EAASL,EAAQC,EAAsBE,EAAM,CAAC,CAACC,EAAmB,IAAK,CAACF,EAAa,OAElGgB,GAAI,CACAL,YAAY,EACZC,OAAQ,CACJV,CAACA,GAAoB,SAEzBY,aAAc,CACVZ,CAACA,GAAoB,iBAG7Be,GAAI,CACAN,YAAY,EACZC,OAAQ,CACJb,CAACA,GAAuB,iBACxBG,CAACA,GAAoB,sBACrBJ,CAACA,GAAS,WAEde,eAAgB,CAACd,GACjBgB,OAAQ,CAACZ,EAASL,EAAQC,EAAsB,CAAC,CAACE,EAAM,IAAK,CAACD,EAAa,KAAME,IAErFgB,GAAI,CACAN,OAAQ,CACJX,CAACA,GAAO,YAEZc,OAAQ,CAACZ,EAAS,CAAC,CAACJ,EAAsB,IAAK,CAACD,EAAQ,KAAM,CAAC,CAACG,EAAM,IAAK,CAACD,EAAa,KAAME,IAEnGiB,GAAI,CACAR,YAAY,EACZC,OAAQ,CACJV,CAACA,GAAoB,aACrBD,CAACA,GAAO,WACRH,CAACA,GAAS,2BACVC,CAACA,GAAuB,0BAE5Bc,eAAgB,CAACd,GACjBgB,OAAQ,CAACZ,EAAS,CAAC,CAACH,EAAa,IAAK,CAACE,EAAmB,KAAMD,EAAMH,EAAQC,IAElFqB,GAAI,CACAT,YAAY,EACZC,OAAQ,CACJZ,CAACA,GAAc,UACfD,CAACA,GAAuB,iBACxBG,CAACA,GAAoB,QACrBJ,CAACA,GAAS,WAEde,eAAgB,CAACd,GACjBe,aAAc,CACVZ,CAACA,GAAoB,gBAEzBa,OAAQ,CAACZ,EAASL,EAAQC,EAAsBE,EAAM,CAAC,CAACC,EAAmB,IAAK,CAACF,EAAa,OAElGqB,QAAS,CACLR,eAAgB,GAChBC,aAAc,CACVZ,CAACA,GAAoB,8BAEzBa,OAAQ,CAACZ,EAAS,CAAC,CAACL,EAAQ,IAAK,CAACC,EAAsB,KAAM,CAAC,CAACC,EAAa,IAAK,CAACC,EAAM,KAAMC,KAI1FoB,EAAgDC,OAAOC,KAAKf,GAAwBgB,OAAO,CAACC,EAAKC,KAC1GD,EAAIC,GAAe,CACff,OAAQH,EAAuBkB,GAAaf,OAC5CG,OAAQ,CAACf,IAEN0B,GACR,CAAA,GAEUE,EAAsCL,OAAOC,KAAKf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../../src/components/internal/Address/utils.ts"],"sourcesContent":["import Language from '../../../language';\nimport { ADDRESS_SCHEMA } from './constants';\nimport { AddressField } from '../../../types/global-types';\nimport { StringObject, AddressType } from './types';\n\n/**\n * Used by the SRPanel sorting function to tell it whether we need to prepend the field type to the SR panel message, and, if so, we retrieve the correct translation for the field type.\n * (Whether we need to prepend the field type depends on whether we know that the error message correctly reflects the label of the field. Ultimately all error messages should do this\n * and this mapping fn will become redundant)\n */\nexport const mapFieldKey = (key: string, i18n: Language, countrySpecificLabels: StringObject): string => {\n if (ADDRESS_SCHEMA.includes(key as AddressField)) {\n return countrySpecificLabels?.[key] ? i18n.get(countrySpecificLabels?.[key]) : i18n.get(key);\n }\n return null;\n};\n\nexport const getAddressTypeFromLabel = (addressType: AddressType, label: string): AddressType => {\n if (addressType) {\n return addressType;\n }\n if (label === 'billingAddress' || label === 'deliveryAddress') {\n return label;\n }\n return undefined;\n};\n"],"names":["mapFieldKey","key","i18n","countrySpecificLabels","ADDRESS_SCHEMA","includes","get","getAddressTypeFromLabel","addressType","label"],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../../src/components/internal/Address/utils.ts"],"sourcesContent":["import Language from '../../../language';\nimport { ADDRESS_SCHEMA } from './constants';\nimport { AddressField } from '../../../types/global-types';\nimport { StringObject, AddressType } from './types';\n\n/**\n * Used by the SRPanel sorting function to tell it whether we need to prepend the field type to the SR panel message, and, if so, we retrieve the correct translation for the field type.\n * (Whether we need to prepend the field type depends on whether we know that the error message correctly reflects the label of the field. Ultimately all error messages should do this\n * and this mapping fn will become redundant)\n *\n * TODO: This function should probably be using Specifications instead of hardcoded ADDRESS_SCHEMA\n */\nexport const mapFieldKey = (key: string, i18n: Language, countrySpecificLabels: StringObject): string | null => {\n if (ADDRESS_SCHEMA.includes(key as AddressField)) {\n return countrySpecificLabels?.[key] ? i18n.get(countrySpecificLabels?.[key]) : i18n.get(key);\n }\n return null;\n};\n\nexport const getAddressTypeFromLabel = (addressType: AddressType, label: string): AddressType => {\n if (addressType) {\n return addressType;\n }\n if (label === 'billingAddress' || label === 'deliveryAddress') {\n return label;\n }\n return undefined;\n};\n"],"names":["mapFieldKey","key","i18n","countrySpecificLabels","ADDRESS_SCHEMA","includes","get","getAddressTypeFromLabel","addressType","label"],"mappings":"gDAYO,MAAMA,EAAc,CAACC,EAAaC,EAAgBC,IACjDC,EAAeC,SAASJ,GACjBE,IAAwBF,GAAOC,EAAKI,IAAIH,IAAwBF,IAAQC,EAAKI,IAAIL,GAErF,KAGEM,EAA0B,CAACC,EAA0BC,IAC1DD,IAGU,mBAAVC,GAAwC,oBAAVA,EACvBA,OADX"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{getFormattingRegEx as o,stripInvalidChars as t}from"../../../utils/validator-utils.js";import{convertFullToHalf as a}from"../FormFields/utils.js";const e=t=>({formatterFn:a=>a.replace(o("^\\d","g"),"").substring(0,t),format:new Array(t).fill("9").join(""),maxlength:t}),r=o=>o,l={postalCode:{formatterFn:(o,t)=>{const a=t.state.data.country,e=s[a]?.postalCode.formatterFn;return e?e(o):o}},street:{formatterFn:r},houseNumberOrName:{formatterFn:r},city:{formatterFn:r}},s={AT:{postalCode:e(4)},AU:{postalCode:e(4)},BE:{postalCode:e(4)},BG:{postalCode:e(4)},BR:{postalCode:{formatterFn:t=>{const a=t.replace(o("^\\d-","g"),""),e=a.includes("-")?9:8;return a.substring(0,e)},format:"12345678 or 12345-678",maxlength:9}},CA:{postalCode:{format:"A9A 9A9 or A9A9A9",maxlength:7}},CH:{postalCode:e(4)},CY:{postalCode:e(4)},CZ:{postalCode:{format:"999 99",maxlength:6}},DE:{postalCode:e(5)},DK:{postalCode:{format:"9999",maxlength:7}},EE:{postalCode:e(5)},ES:{postalCode:e(5)},FI:{postalCode:e(5)},FR:{postalCode:e(5)},GB:{postalCode:{formatterFn:o=>t(o).substring(0,8),format:"AA99 9AA or A99 9AA or A9 9AA",maxlength:8}},GR:{postalCode:{format:"999 99",maxlength:6}},HR:{postalCode:{format:"[1-5]9999",maxlength:5}},HU:{postalCode:e(4)},IE:{postalCode:{format:"A99 A999",maxlength:8}},IS:{postalCode:e(3)},IT:{postalCode:e(5)},LI:{postalCode:e(4)},LT:{postalCode:{format:"9999 or 99999 or LT-99999",maxlength:8}},LU:{postalCode:e(4)},LV:{postalCode:{format:"9999 or LV-9999",maxlength:7}},MC:{postalCode:{format:"980NN",maxlength:5}},MT:{postalCode:{format:"AA99 or AAA99 or AA9999 or AAA9999",maxlength:8}},MY:{postalCode:e(5)},NL:{postalCode:{format:"9999AA",maxlength:7}},NZ:{postalCode:e(4)},NO:{postalCode:e(4)},PL:{postalCode:{formatterFn:t=>{const a=t.replace(o("^\\d-","g"),""),e=a.includes("-")?6:5;return a.substring(0,e)},format:"99999 or 99-999",maxlength:6}},PT:{postalCode:{formatterFn:t=>t.replace(o("^\\d-","g"),"").substring(0,8),format:"9999-999",maxlength:8}},RO:{postalCode:e(6)},SI:{postalCode:{format:"9999 or SI-9999",maxlength:7}},SE:{postalCode:e(5)},SG:{postalCode:e(6)},SK:{postalCode:{format:"99999 or SK-99999",maxlength:8}},JP:{postalCode:{formatterFn:t=>a(t).replace(o("^\\d-","g"),"").substring(0,8),format:"999-9999",maxlength:8}},US:{postalCode:{formatterFn:t=>{const a=t.replace(o("^\\d-","g"),""),e=a.includes("-")?10:5;return a.substring(0,e)},format:"99999 or 99999-9999"}}};export{l as addressFormatters,s as countrySpecificFormatters};
|
|
1
|
+
import{getFormattingRegEx as o,stripInvalidChars as t}from"../../../utils/validator-utils.js";import{convertFullToHalf as a}from"../FormFields/utils.js";const e=t=>({formatterFn:a=>a.replace(o("^\\d","g"),"").substring(0,t),format:new Array(t).fill("9").join(""),maxlength:t}),r=o=>o,l={postalCode:{formatterFn:(o,t)=>{const a=t.state.data.country,e=a?s[a]?.postalCode.formatterFn:void 0;return e?e(o):o}},street:{formatterFn:r},houseNumberOrName:{formatterFn:r},city:{formatterFn:r}},s={AT:{postalCode:e(4)},AU:{postalCode:e(4)},BE:{postalCode:e(4)},BG:{postalCode:e(4)},BR:{postalCode:{formatterFn:t=>{const a=t.replace(o("^\\d-","g"),""),e=a.includes("-")?9:8;return a.substring(0,e)},format:"12345678 or 12345-678",maxlength:9}},CA:{postalCode:{format:"A9A 9A9 or A9A9A9",maxlength:7}},CH:{postalCode:e(4)},CY:{postalCode:e(4)},CZ:{postalCode:{format:"999 99",maxlength:6}},DE:{postalCode:e(5)},DK:{postalCode:{format:"9999",maxlength:7}},EE:{postalCode:e(5)},ES:{postalCode:e(5)},FI:{postalCode:e(5)},FR:{postalCode:e(5)},GB:{postalCode:{formatterFn:o=>t(o).substring(0,8),format:"AA99 9AA or A99 9AA or A9 9AA",maxlength:8}},GR:{postalCode:{format:"999 99",maxlength:6}},HR:{postalCode:{format:"[1-5]9999",maxlength:5}},HU:{postalCode:e(4)},IE:{postalCode:{format:"A99 A999",maxlength:8}},IS:{postalCode:e(3)},IT:{postalCode:e(5)},LI:{postalCode:e(4)},LT:{postalCode:{format:"9999 or 99999 or LT-99999",maxlength:8}},LU:{postalCode:e(4)},LV:{postalCode:{format:"9999 or LV-9999",maxlength:7}},MC:{postalCode:{format:"980NN",maxlength:5}},MT:{postalCode:{format:"AA99 or AAA99 or AA9999 or AAA9999",maxlength:8}},MY:{postalCode:e(5)},NL:{postalCode:{format:"9999AA",maxlength:7}},NZ:{postalCode:e(4)},NO:{postalCode:e(4)},PL:{postalCode:{formatterFn:t=>{const a=t.replace(o("^\\d-","g"),""),e=a.includes("-")?6:5;return a.substring(0,e)},format:"99999 or 99-999",maxlength:6}},PT:{postalCode:{formatterFn:t=>t.replace(o("^\\d-","g"),"").substring(0,8),format:"9999-999",maxlength:8}},RO:{postalCode:e(6)},SI:{postalCode:{format:"9999 or SI-9999",maxlength:7}},SE:{postalCode:e(5)},SG:{postalCode:e(6)},SK:{postalCode:{format:"99999 or SK-99999",maxlength:8}},JP:{postalCode:{formatterFn:t=>a(t).replace(o("^\\d-","g"),"").substring(0,8),format:"999-9999",maxlength:8}},US:{postalCode:{formatterFn:t=>{const a=t.replace(o("^\\d-","g"),""),e=a.includes("-")?10:5;return a.substring(0,e)},format:"99999 or 99999-9999"}}};export{l as addressFormatters,s as countrySpecificFormatters};
|
|
2
2
|
//# sourceMappingURL=validate.formats.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.formats.js","sources":["../../../../../src/components/internal/Address/validate.formats.ts"],"sourcesContent":["import { FormatterContext } from '../../../utils/Formatters/types';\nimport { CountryFormatRules, FormatRules } from '../../../utils/Validator/types';\nimport { Formatter } from '../../../utils/useForm/types';\nimport { getFormattingRegEx, stripInvalidChars } from '../../../utils/validator-utils';\nimport { convertFullToHalf } from '../FormFields/utils';\n\nconst asCountryFormatRules = <T extends CountryFormatRules>(rules: T): T & CountryFormatRules => rules;\n\nconst createFormatByDigits = (digits: number): Formatter => {\n const format = new Array(digits).fill('9').join('');\n return {\n // Formatter - excludes non digits and limits to maxlength\n formatterFn: val => val.replace(getFormattingRegEx('^\\\\d', 'g'), '').substring(0, digits),\n format,\n maxlength: digits\n };\n};\n\nconst defaultFormattingFn = (val: string) => val;\n\nexport const addressFormatters: FormatRules = {\n postalCode: {\n formatterFn: (val: string, context: FormatterContext) => {\n const country = context.state.data.country;\n\n // Country specific formatting rule\n const specificRule = countrySpecificFormatters[country]?.postalCode.formatterFn;\n if (specificRule) {\n return specificRule(val);\n }\n\n // Default formatting rule: allow anything\n return val;\n }\n },\n street: {\n formatterFn: defaultFormattingFn\n },\n houseNumberOrName: {\n formatterFn: defaultFormattingFn\n },\n city: {\n formatterFn: defaultFormattingFn\n }\n};\n\n// TODO make proper formatter fns for those entries that don't just have a straightforward, x number of digits, no spaces, format\n// check against our internal documentation on address postal code\n// which, for example, says BR isn't just 8 digits (it can be spilt by a hyphen) & CZ can also be 5 digits, no spaces\nexport const countrySpecificFormatters = asCountryFormatRules({\n AT: {\n postalCode: createFormatByDigits(4)\n },\n AU: {\n postalCode: createFormatByDigits(4)\n },\n BE: {\n postalCode: createFormatByDigits(4)\n },\n BG: {\n postalCode: createFormatByDigits(4)\n },\n BR: {\n postalCode: {\n // Formatter - excludes non digits, but allows hyphens, and limits to a maxlength that varies depending on whether a hyphen is present or not\n formatterFn: val => {\n const nuVal = val.replace(getFormattingRegEx('^\\\\d-', 'g'), '');\n const maxlength = nuVal.includes('-') ? 9 : 8;\n return nuVal.substring(0, maxlength);\n },\n format: '12345678 or 12345-678',\n maxlength: 9\n }\n },\n CA: {\n postalCode: {\n format: 'A9A 9A9 or A9A9A9',\n maxlength: 7\n }\n },\n CH: {\n postalCode: createFormatByDigits(4)\n },\n CY: {\n postalCode: createFormatByDigits(4)\n },\n CZ: {\n postalCode: {\n format: '999 99',\n maxlength: 6\n }\n },\n DE: {\n postalCode: createFormatByDigits(5)\n },\n DK: {\n postalCode: {\n format: '9999',\n maxlength: 7\n }\n },\n EE: {\n postalCode: createFormatByDigits(5)\n },\n ES: {\n postalCode: createFormatByDigits(5)\n },\n FI: {\n postalCode: createFormatByDigits(5)\n },\n FR: {\n postalCode: createFormatByDigits(5)\n },\n GB: {\n postalCode: {\n formatterFn: val => stripInvalidChars(val).substring(0, 8),\n format: 'AA99 9AA or A99 9AA or A9 9AA',\n maxlength: 8\n }\n },\n GR: {\n postalCode: {\n format: '999 99',\n maxlength: 6\n }\n },\n HR: {\n postalCode: {\n format: '[1-5]9999',\n maxlength: 5\n }\n },\n HU: {\n postalCode: createFormatByDigits(4)\n },\n IE: {\n postalCode: {\n format: 'A99 A999',\n maxlength: 8\n }\n },\n IS: {\n postalCode: createFormatByDigits(3)\n },\n IT: {\n postalCode: createFormatByDigits(5)\n },\n LI: {\n postalCode: createFormatByDigits(4)\n },\n LT: {\n postalCode: {\n format: '9999 or 99999 or LT-99999',\n maxlength: 8\n }\n },\n LU: {\n postalCode: createFormatByDigits(4)\n },\n LV: {\n postalCode: {\n format: '9999 or LV-9999',\n maxlength: 7\n }\n },\n MC: {\n postalCode: {\n format: '980NN',\n maxlength: 5\n }\n },\n MT: {\n postalCode: {\n format: 'AA99 or AAA99 or AA9999 or AAA9999',\n maxlength: 8\n }\n },\n MY: {\n postalCode: createFormatByDigits(5)\n },\n NL: {\n postalCode: {\n format: '9999AA',\n maxlength: 7\n }\n },\n NZ: {\n postalCode: createFormatByDigits(4)\n },\n NO: {\n postalCode: createFormatByDigits(4)\n },\n PL: {\n postalCode: {\n // Formatter - excludes non digits, but allows hyphens, and limits to a maxlength that varies depending on whether a hyphen is present or not\n formatterFn: val => {\n const nuVal = val.replace(getFormattingRegEx('^\\\\d-', 'g'), '');\n const maxlength = nuVal.includes('-') ? 6 : 5;\n return nuVal.substring(0, maxlength);\n },\n format: '99999 or 99-999',\n maxlength: 6\n }\n },\n PT: {\n postalCode: {\n formatterFn: val => {\n const nuVal = val.replace(getFormattingRegEx('^\\\\d-', 'g'), '');\n return nuVal.substring(0, 8);\n },\n format: '9999-999',\n maxlength: 8\n }\n },\n RO: {\n postalCode: createFormatByDigits(6)\n },\n SI: {\n postalCode: {\n format: '9999 or SI-9999',\n maxlength: 7\n }\n },\n SE: {\n postalCode: createFormatByDigits(5)\n },\n SG: {\n postalCode: createFormatByDigits(6)\n },\n SK: {\n postalCode: {\n format: '99999 or SK-99999',\n maxlength: 8\n }\n },\n JP: {\n postalCode: {\n // Formatter - converts full-width characters (common on Japanese keyboards, e.g. '107-0052') to their\n // half-width equivalent, then strips any remaining non-digit/hyphen characters (e.g. the postal mark '〒')\n formatterFn: val => convertFullToHalf(val).replace(getFormattingRegEx('^\\\\d-', 'g'), '').substring(0, 8),\n format: '999-9999',\n maxlength: 8\n }\n },\n US: {\n postalCode: {\n formatterFn: val => {\n const nuVal = val.replace(getFormattingRegEx('^\\\\d-', 'g'), '');\n const maxlength = nuVal.includes('-') ? 10 : 5;\n return nuVal.substring(0, maxlength);\n },\n format: '99999 or 99999-9999'\n }\n }\n});\n"],"names":["createFormatByDigits","digits","formatterFn","val","replace","getFormattingRegEx","substring","format","Array","fill","join","maxlength","defaultFormattingFn","addressFormatters","postalCode","context","country","state","data","specificRule","countrySpecificFormatters","street","houseNumberOrName","city","AT","AU","BE","BG","BR","nuVal","includes","CA","CH","CY","CZ","DE","DK","EE","ES","FI","FR","GB","stripInvalidChars","GR","HR","HU","IE","IS","IT","LI","LT","LU","LV","MC","MT","MY","NL","NZ","NO","PL","PT","RO","SI","SE","SG","SK","JP","convertFullToHalf","US"],"mappings":"yJAMA,MAEMA,EAAwBC,IAEnB,CAEHC,YAAaC,GAAOA,EAAIC,QAAQC,EAAmB,OAAQ,KAAM,IAAIC,UAAU,EAAGL,GAClFM,OAJW,IAAIC,MAAMP,GAAQQ,KAAK,KAAKC,KAAK,IAK5CC,UAAWV,IAIbW,EAAuBT,GAAgBA,EAEhCU,EAAiC,CAC1CC,WAAY,CACRZ,YAAa,CAACC,EAAaY,KACvB,MAAMC,EAAUD,EAAQE,MAAMC,KAAKF,QAG7BG,EAAeC,EAA0BJ,IAAUF,WAAWZ,YACpE,OAAIiB,EACOA,EAAahB,GAIjBA,IAGfkB,OAAQ,CACJnB,YAAaU,GAEjBU,kBAAmB,CACfpB,YAAaU,GAEjBW,KAAM,CACFrB,YAAaU,IAORQ,EAAiD,CAC1DI,GAAI,CACAV,WAAYd,EAAqB,IAErCyB,GAAI,CACAX,WAAYd,EAAqB,IAErC0B,GAAI,CACAZ,WAAYd,EAAqB,IAErC2B,GAAI,CACAb,WAAYd,EAAqB,IAErC4B,GAAI,CACAd,WAAY,CAERZ,YAAaC,IACT,MAAM0B,EAAQ1B,EAAIC,QAAQC,EAAmB,QAAS,KAAM,IACtDM,EAAYkB,EAAMC,SAAS,KAAO,EAAI,EAC5C,OAAOD,EAAMvB,UAAU,EAAGK,IAE9BJ,OAAQ,wBACRI,UAAW,IAGnBoB,GAAI,CACAjB,WAAY,CACRP,OAAQ,oBACRI,UAAW,IAGnBqB,GAAI,CACAlB,WAAYd,EAAqB,IAErCiC,GAAI,CACAnB,WAAYd,EAAqB,IAErCkC,GAAI,CACApB,WAAY,CACRP,OAAQ,SACRI,UAAW,IAGnBwB,GAAI,CACArB,WAAYd,EAAqB,IAErCoC,GAAI,CACAtB,WAAY,CACRP,OAAQ,OACRI,UAAW,IAGnB0B,GAAI,CACAvB,WAAYd,EAAqB,IAErCsC,GAAI,CACAxB,WAAYd,EAAqB,IAErCuC,GAAI,CACAzB,WAAYd,EAAqB,IAErCwC,GAAI,CACA1B,WAAYd,EAAqB,IAErCyC,GAAI,CACA3B,WAAY,CACRZ,YAAaC,GAAOuC,EAAkBvC,GAAKG,UAAU,EAAG,GACxDC,OAAQ,gCACRI,UAAW,IAGnBgC,GAAI,CACA7B,WAAY,CACRP,OAAQ,SACRI,UAAW,IAGnBiC,GAAI,CACA9B,WAAY,CACRP,OAAQ,YACRI,UAAW,IAGnBkC,GAAI,CACA/B,WAAYd,EAAqB,IAErC8C,GAAI,CACAhC,WAAY,CACRP,OAAQ,WACRI,UAAW,IAGnBoC,GAAI,CACAjC,WAAYd,EAAqB,IAErCgD,GAAI,CACAlC,WAAYd,EAAqB,IAErCiD,GAAI,CACAnC,WAAYd,EAAqB,IAErCkD,GAAI,CACApC,WAAY,CACRP,OAAQ,4BACRI,UAAW,IAGnBwC,GAAI,CACArC,WAAYd,EAAqB,IAErCoD,GAAI,CACAtC,WAAY,CACRP,OAAQ,kBACRI,UAAW,IAGnB0C,GAAI,CACAvC,WAAY,CACRP,OAAQ,QACRI,UAAW,IAGnB2C,GAAI,CACAxC,WAAY,CACRP,OAAQ,qCACRI,UAAW,IAGnB4C,GAAI,CACAzC,WAAYd,EAAqB,IAErCwD,GAAI,CACA1C,WAAY,CACRP,OAAQ,SACRI,UAAW,IAGnB8C,GAAI,CACA3C,WAAYd,EAAqB,IAErC0D,GAAI,CACA5C,WAAYd,EAAqB,IAErC2D,GAAI,CACA7C,WAAY,CAERZ,YAAaC,IACT,MAAM0B,EAAQ1B,EAAIC,QAAQC,EAAmB,QAAS,KAAM,IACtDM,EAAYkB,EAAMC,SAAS,KAAO,EAAI,EAC5C,OAAOD,EAAMvB,UAAU,EAAGK,IAE9BJ,OAAQ,kBACRI,UAAW,IAGnBiD,GAAI,CACA9C,WAAY,CACRZ,YAAaC,GACKA,EAAIC,QAAQC,EAAmB,QAAS,KAAM,IAC/CC,UAAU,EAAG,GAE9BC,OAAQ,WACRI,UAAW,IAGnBkD,GAAI,CACA/C,WAAYd,EAAqB,IAErC8D,GAAI,CACAhD,WAAY,CACRP,OAAQ,kBACRI,UAAW,IAGnBoD,GAAI,CACAjD,WAAYd,EAAqB,IAErCgE,GAAI,CACAlD,WAAYd,EAAqB,IAErCiE,GAAI,CACAnD,WAAY,CACRP,OAAQ,oBACRI,UAAW,IAGnBuD,GAAI,CACApD,WAAY,CAGRZ,YAAaC,GAAOgE,EAAkBhE,GAAKC,QAAQC,EAAmB,QAAS,KAAM,IAAIC,UAAU,EAAG,GACtGC,OAAQ,WACRI,UAAW,IAGnByD,GAAI,CACAtD,WAAY,CACRZ,YAAaC,IACT,MAAM0B,EAAQ1B,EAAIC,QAAQC,EAAmB,QAAS,KAAM,IACtDM,EAAYkB,EAAMC,SAAS,KAAO,GAAK,EAC7C,OAAOD,EAAMvB,UAAU,EAAGK,IAE9BJ,OAAQ"}
|
|
1
|
+
{"version":3,"file":"validate.formats.js","sources":["../../../../../src/components/internal/Address/validate.formats.ts"],"sourcesContent":["import { FormatterContext } from '../../../utils/Formatters/types';\nimport { CountryFormatRules, FormatRules } from '../../../utils/Validator/types';\nimport { Formatter } from '../../../utils/useForm/types';\nimport { getFormattingRegEx, stripInvalidChars } from '../../../utils/validator-utils';\nimport { convertFullToHalf } from '../FormFields/utils';\n\nconst asCountryFormatRules = <T extends CountryFormatRules>(rules: T): T & CountryFormatRules => rules;\n\nconst createFormatByDigits = (digits: number): Formatter => {\n const format = new Array(digits).fill('9').join('');\n return {\n // Formatter - excludes non digits and limits to maxlength\n formatterFn: val => val.replace(getFormattingRegEx('^\\\\d', 'g'), '').substring(0, digits),\n format,\n maxlength: digits\n };\n};\n\nconst defaultFormattingFn = (val: string) => val;\n\nexport const addressFormatters: FormatRules = {\n postalCode: {\n formatterFn: (val: string, context: FormatterContext) => {\n const country = context.state.data.country;\n\n // Country specific formatting rule\n const specificRule = country ? countrySpecificFormatters[country]?.postalCode.formatterFn : undefined;\n if (specificRule) {\n return specificRule(val);\n }\n\n // Default formatting rule: allow anything\n return val;\n }\n },\n street: {\n formatterFn: defaultFormattingFn\n },\n houseNumberOrName: {\n formatterFn: defaultFormattingFn\n },\n city: {\n formatterFn: defaultFormattingFn\n }\n};\n\n// TODO make proper formatter fns for those entries that don't just have a straightforward, x number of digits, no spaces, format\n// check against our internal documentation on address postal code\n// which, for example, says BR isn't just 8 digits (it can be spilt by a hyphen) & CZ can also be 5 digits, no spaces\nexport const countrySpecificFormatters = asCountryFormatRules({\n AT: {\n postalCode: createFormatByDigits(4)\n },\n AU: {\n postalCode: createFormatByDigits(4)\n },\n BE: {\n postalCode: createFormatByDigits(4)\n },\n BG: {\n postalCode: createFormatByDigits(4)\n },\n BR: {\n postalCode: {\n // Formatter - excludes non digits, but allows hyphens, and limits to a maxlength that varies depending on whether a hyphen is present or not\n formatterFn: val => {\n const nuVal = val.replace(getFormattingRegEx('^\\\\d-', 'g'), '');\n const maxlength = nuVal.includes('-') ? 9 : 8;\n return nuVal.substring(0, maxlength);\n },\n format: '12345678 or 12345-678',\n maxlength: 9\n }\n },\n CA: {\n postalCode: {\n format: 'A9A 9A9 or A9A9A9',\n maxlength: 7\n }\n },\n CH: {\n postalCode: createFormatByDigits(4)\n },\n CY: {\n postalCode: createFormatByDigits(4)\n },\n CZ: {\n postalCode: {\n format: '999 99',\n maxlength: 6\n }\n },\n DE: {\n postalCode: createFormatByDigits(5)\n },\n DK: {\n postalCode: {\n format: '9999',\n maxlength: 7\n }\n },\n EE: {\n postalCode: createFormatByDigits(5)\n },\n ES: {\n postalCode: createFormatByDigits(5)\n },\n FI: {\n postalCode: createFormatByDigits(5)\n },\n FR: {\n postalCode: createFormatByDigits(5)\n },\n GB: {\n postalCode: {\n formatterFn: val => stripInvalidChars(val).substring(0, 8),\n format: 'AA99 9AA or A99 9AA or A9 9AA',\n maxlength: 8\n }\n },\n GR: {\n postalCode: {\n format: '999 99',\n maxlength: 6\n }\n },\n HR: {\n postalCode: {\n format: '[1-5]9999',\n maxlength: 5\n }\n },\n HU: {\n postalCode: createFormatByDigits(4)\n },\n IE: {\n postalCode: {\n format: 'A99 A999',\n maxlength: 8\n }\n },\n IS: {\n postalCode: createFormatByDigits(3)\n },\n IT: {\n postalCode: createFormatByDigits(5)\n },\n LI: {\n postalCode: createFormatByDigits(4)\n },\n LT: {\n postalCode: {\n format: '9999 or 99999 or LT-99999',\n maxlength: 8\n }\n },\n LU: {\n postalCode: createFormatByDigits(4)\n },\n LV: {\n postalCode: {\n format: '9999 or LV-9999',\n maxlength: 7\n }\n },\n MC: {\n postalCode: {\n format: '980NN',\n maxlength: 5\n }\n },\n MT: {\n postalCode: {\n format: 'AA99 or AAA99 or AA9999 or AAA9999',\n maxlength: 8\n }\n },\n MY: {\n postalCode: createFormatByDigits(5)\n },\n NL: {\n postalCode: {\n format: '9999AA',\n maxlength: 7\n }\n },\n NZ: {\n postalCode: createFormatByDigits(4)\n },\n NO: {\n postalCode: createFormatByDigits(4)\n },\n PL: {\n postalCode: {\n // Formatter - excludes non digits, but allows hyphens, and limits to a maxlength that varies depending on whether a hyphen is present or not\n formatterFn: val => {\n const nuVal = val.replace(getFormattingRegEx('^\\\\d-', 'g'), '');\n const maxlength = nuVal.includes('-') ? 6 : 5;\n return nuVal.substring(0, maxlength);\n },\n format: '99999 or 99-999',\n maxlength: 6\n }\n },\n PT: {\n postalCode: {\n formatterFn: val => {\n const nuVal = val.replace(getFormattingRegEx('^\\\\d-', 'g'), '');\n return nuVal.substring(0, 8);\n },\n format: '9999-999',\n maxlength: 8\n }\n },\n RO: {\n postalCode: createFormatByDigits(6)\n },\n SI: {\n postalCode: {\n format: '9999 or SI-9999',\n maxlength: 7\n }\n },\n SE: {\n postalCode: createFormatByDigits(5)\n },\n SG: {\n postalCode: createFormatByDigits(6)\n },\n SK: {\n postalCode: {\n format: '99999 or SK-99999',\n maxlength: 8\n }\n },\n JP: {\n postalCode: {\n // Formatter - converts full-width characters (common on Japanese keyboards, e.g. '107-0052') to their\n // half-width equivalent, then strips any remaining non-digit/hyphen characters (e.g. the postal mark '〒')\n formatterFn: val => convertFullToHalf(val).replace(getFormattingRegEx('^\\\\d-', 'g'), '').substring(0, 8),\n format: '999-9999',\n maxlength: 8\n }\n },\n US: {\n postalCode: {\n formatterFn: val => {\n const nuVal = val.replace(getFormattingRegEx('^\\\\d-', 'g'), '');\n const maxlength = nuVal.includes('-') ? 10 : 5;\n return nuVal.substring(0, maxlength);\n },\n format: '99999 or 99999-9999'\n }\n }\n});\n"],"names":["createFormatByDigits","digits","formatterFn","val","replace","getFormattingRegEx","substring","format","Array","fill","join","maxlength","defaultFormattingFn","addressFormatters","postalCode","context","country","state","data","specificRule","countrySpecificFormatters","undefined","street","houseNumberOrName","city","AT","AU","BE","BG","BR","nuVal","includes","CA","CH","CY","CZ","DE","DK","EE","ES","FI","FR","GB","stripInvalidChars","GR","HR","HU","IE","IS","IT","LI","LT","LU","LV","MC","MT","MY","NL","NZ","NO","PL","PT","RO","SI","SE","SG","SK","JP","convertFullToHalf","US"],"mappings":"yJAMA,MAEMA,EAAwBC,IAEnB,CAEHC,YAAaC,GAAOA,EAAIC,QAAQC,EAAmB,OAAQ,KAAM,IAAIC,UAAU,EAAGL,GAClFM,OAJW,IAAIC,MAAMP,GAAQQ,KAAK,KAAKC,KAAK,IAK5CC,UAAWV,IAIbW,EAAuBT,GAAgBA,EAEhCU,EAAiC,CAC1CC,WAAY,CACRZ,YAAa,CAACC,EAAaY,KACvB,MAAMC,EAAUD,EAAQE,MAAMC,KAAKF,QAG7BG,EAAeH,EAAUI,EAA0BJ,IAAUF,WAAWZ,iBAAcmB,EAC5F,OAAIF,EACOA,EAAahB,GAIjBA,IAGfmB,OAAQ,CACJpB,YAAaU,GAEjBW,kBAAmB,CACfrB,YAAaU,GAEjBY,KAAM,CACFtB,YAAaU,IAORQ,EAAiD,CAC1DK,GAAI,CACAX,WAAYd,EAAqB,IAErC0B,GAAI,CACAZ,WAAYd,EAAqB,IAErC2B,GAAI,CACAb,WAAYd,EAAqB,IAErC4B,GAAI,CACAd,WAAYd,EAAqB,IAErC6B,GAAI,CACAf,WAAY,CAERZ,YAAaC,IACT,MAAM2B,EAAQ3B,EAAIC,QAAQC,EAAmB,QAAS,KAAM,IACtDM,EAAYmB,EAAMC,SAAS,KAAO,EAAI,EAC5C,OAAOD,EAAMxB,UAAU,EAAGK,IAE9BJ,OAAQ,wBACRI,UAAW,IAGnBqB,GAAI,CACAlB,WAAY,CACRP,OAAQ,oBACRI,UAAW,IAGnBsB,GAAI,CACAnB,WAAYd,EAAqB,IAErCkC,GAAI,CACApB,WAAYd,EAAqB,IAErCmC,GAAI,CACArB,WAAY,CACRP,OAAQ,SACRI,UAAW,IAGnByB,GAAI,CACAtB,WAAYd,EAAqB,IAErCqC,GAAI,CACAvB,WAAY,CACRP,OAAQ,OACRI,UAAW,IAGnB2B,GAAI,CACAxB,WAAYd,EAAqB,IAErCuC,GAAI,CACAzB,WAAYd,EAAqB,IAErCwC,GAAI,CACA1B,WAAYd,EAAqB,IAErCyC,GAAI,CACA3B,WAAYd,EAAqB,IAErC0C,GAAI,CACA5B,WAAY,CACRZ,YAAaC,GAAOwC,EAAkBxC,GAAKG,UAAU,EAAG,GACxDC,OAAQ,gCACRI,UAAW,IAGnBiC,GAAI,CACA9B,WAAY,CACRP,OAAQ,SACRI,UAAW,IAGnBkC,GAAI,CACA/B,WAAY,CACRP,OAAQ,YACRI,UAAW,IAGnBmC,GAAI,CACAhC,WAAYd,EAAqB,IAErC+C,GAAI,CACAjC,WAAY,CACRP,OAAQ,WACRI,UAAW,IAGnBqC,GAAI,CACAlC,WAAYd,EAAqB,IAErCiD,GAAI,CACAnC,WAAYd,EAAqB,IAErCkD,GAAI,CACApC,WAAYd,EAAqB,IAErCmD,GAAI,CACArC,WAAY,CACRP,OAAQ,4BACRI,UAAW,IAGnByC,GAAI,CACAtC,WAAYd,EAAqB,IAErCqD,GAAI,CACAvC,WAAY,CACRP,OAAQ,kBACRI,UAAW,IAGnB2C,GAAI,CACAxC,WAAY,CACRP,OAAQ,QACRI,UAAW,IAGnB4C,GAAI,CACAzC,WAAY,CACRP,OAAQ,qCACRI,UAAW,IAGnB6C,GAAI,CACA1C,WAAYd,EAAqB,IAErCyD,GAAI,CACA3C,WAAY,CACRP,OAAQ,SACRI,UAAW,IAGnB+C,GAAI,CACA5C,WAAYd,EAAqB,IAErC2D,GAAI,CACA7C,WAAYd,EAAqB,IAErC4D,GAAI,CACA9C,WAAY,CAERZ,YAAaC,IACT,MAAM2B,EAAQ3B,EAAIC,QAAQC,EAAmB,QAAS,KAAM,IACtDM,EAAYmB,EAAMC,SAAS,KAAO,EAAI,EAC5C,OAAOD,EAAMxB,UAAU,EAAGK,IAE9BJ,OAAQ,kBACRI,UAAW,IAGnBkD,GAAI,CACA/C,WAAY,CACRZ,YAAaC,GACKA,EAAIC,QAAQC,EAAmB,QAAS,KAAM,IAC/CC,UAAU,EAAG,GAE9BC,OAAQ,WACRI,UAAW,IAGnBmD,GAAI,CACAhD,WAAYd,EAAqB,IAErC+D,GAAI,CACAjD,WAAY,CACRP,OAAQ,kBACRI,UAAW,IAGnBqD,GAAI,CACAlD,WAAYd,EAAqB,IAErCiE,GAAI,CACAnD,WAAYd,EAAqB,IAErCkE,GAAI,CACApD,WAAY,CACRP,OAAQ,oBACRI,UAAW,IAGnBwD,GAAI,CACArD,WAAY,CAGRZ,YAAaC,GAAOiE,EAAkBjE,GAAKC,QAAQC,EAAmB,QAAS,KAAM,IAAIC,UAAU,EAAG,GACtGC,OAAQ,WACRI,UAAW,IAGnB0D,GAAI,CACAvD,WAAY,CACRZ,YAAaC,IACT,MAAM2B,EAAQ3B,EAAIC,QAAQC,EAAmB,QAAS,KAAM,IACtDM,EAAYmB,EAAMC,SAAS,KAAO,GAAK,EAC7C,OAAOD,EAAMxB,UAAU,EAAGK,IAE9BJ,OAAQ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{render as t}from"../../../external/preact/dist/preact.js";import e from"../../../utils/uuid.js";import o from"../../../core/Errors/AdyenCheckoutError.js";import{NO_CHECKOUT_ATTEMPT_ID as
|
|
1
|
+
import{render as t}from"../../../external/preact/dist/preact.js";import e from"../../../utils/uuid.js";import o from"../../../core/Errors/AdyenCheckoutError.js";import{NO_CHECKOUT_ATTEMPT_ID as r}from"../../../core/Analytics/constants.js";import{on as n,off as s}from"../../../utils/listenerUtils.js";import{createSdkData as i}from"../../../utils/createSdkData.js";import a from"../../components-name-map.js";import{PAYMENT_METHOD_BEHAVIOR as h}from"../../../core/config.js";function d(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}const c="Component could not mount. Root node was not found.";class u{buildElementProps(t){this.props=this.formatProps({...this.constructor.defaultProps,...t})}formatProps(t){return t}formatData(){return{}}submitAnalytics(t){}handleKeyDown(t){}get mountedNode(){if(!this._node)throw new Error(c);return this._node}setState(t){this.state={...this.state,...t}}get data(){const t=this.state.order||this.props.order,e=this.formatData(),o=Boolean(a(e.paymentMethod?.type)),n=this.core.modules.risk.riskData,s=this.core.modules.analytics.checkoutAttemptId??r,d=o?h.NATIVE:h.GENERIC,c=i(s,n,d);return e.paymentMethod&&s&&(e.paymentMethod.checkoutAttemptId=s),e.paymentMethod&&c&&(e.paymentMethod.sdkData=c),{...n&&{riskData:{clientData:n}},...t&&{order:{orderData:t.orderData,pspReference:t.pspReference}},...e,clientStateDataIndicator:!0}}activate(){}render(){throw new Error("Payment method cannot be rendered.")}mount(e){const o="string"==typeof e?document.querySelector(e):e;if(!o)throw new Error(c);return this._node&&this.unmount(),this._node=o,n(this._node,"keydown",this.handleKeyDown,!1),this._component=this.render(),t(this._component,o),this}update(t){return this.props=this.formatProps({...this.props,...t}),this.state={},this.unmount().mount(this.mountedNode)}unmount(){return this._node&&(s(this._node,"keydown",this.handleKeyDown),t(null,this._node)),this}remove(){this.unmount(),this.core&&this.core.remove(this)}constructor(t,r){d(this,"_id",`${this.constructor.type}-${e()}`),d(this,"core",void 0),d(this,"props",void 0),d(this,"state",{}),d(this,"_component",void 0),d(this,"_node",null);const n=function(t){return!!t&&("function"==typeof t.initialize&&"function"==typeof t.createFromAction)}(t);if(!n)throw new o("IMPLEMENTATION_ERROR",`Trying to initialise the component '${this.constructor.type}' without a reference to an instance of AdyenCheckout`);this.core=t,this.buildElementProps(r),this.handleKeyDown=this.handleKeyDown.bind(this)}}d(u,"defaultProps",{});export{u as default};
|
|
2
2
|
//# sourceMappingURL=BaseElement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseElement.js","sources":["../../../../../src/components/internal/BaseElement/BaseElement.ts"],"sourcesContent":["import { ComponentChild, h, render, TargetedKeyboardEvent } from 'preact';\nimport uuid from '../../../utils/uuid';\nimport AdyenCheckoutError from '../../../core/Errors/AdyenCheckoutError';\nimport { NO_CHECKOUT_ATTEMPT_ID } from '../../../core/Analytics/constants';\nimport type { ICore } from '../../../core/types';\nimport type { BaseElementProps, BaseElementState, IBaseElement } from './types';\nimport type { PaymentData } from '../../../types/global-types';\nimport { off, on } from '../../../utils/listenerUtils';\nimport { AbstractAnalyticsEvent } from '../../../core/Analytics/events/AbstractAnalyticsEvent';\nimport { createSdkData, CreateSdkDataParams } from '../../../utils/createSdkData';\nimport getComponentNameOfPaymentType from '../../components-name-map';\nimport { PAYMENT_METHOD_BEHAVIOR } from '../../../core/config';\n\n/**\n * Verify if the first parameter is instance of Core.\n * We do not use 'instanceof' to avoid importing the Core class directly into this class.\n * @param checkout\n */\nfunction assertIsCoreInstance(checkout: ICore): checkout is ICore {\n if (!checkout) return false;\n const isCoreObject = typeof checkout.initialize === 'function' && typeof checkout.createFromAction === 'function';\n return isCoreObject;\n}\n\nabstract class BaseElement<P extends BaseElementProps, S extends BaseElementState = BaseElementState> implements IBaseElement<P> {\n public readonly _id = `${this.constructor['type']}-${uuid()}`;\n public readonly core: ICore;\n\n public props: P;\n public state: S = {} as S;\n public _component: ComponentChild | undefined;\n\n protected _node: HTMLElement = null;\n\n protected static readonly defaultProps = {};\n\n constructor(checkout: ICore, props?: P) {\n const isCoreInstance = assertIsCoreInstance(checkout);\n\n if (!isCoreInstance) {\n throw new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n `Trying to initialise the component '${this.constructor['type']}' without a reference to an instance of AdyenCheckout`\n );\n }\n\n this.core = checkout;\n this.buildElementProps(props);\n\n this.handleKeyDown = this.handleKeyDown.bind(this);\n }\n\n protected buildElementProps(componentProps?: P) {\n this.props = this.formatProps({ ...this.constructor['defaultProps'], ...componentProps });\n }\n\n /**\n * Executed during creation of any payment element.\n * Gives a chance to any paymentMethod to format the props we're receiving.\n */\n protected formatProps(props: P) {\n return props;\n }\n\n /**\n * Executed on the `data` getter.\n * Returns the component data necessary for the /payments request\n */\n protected formatData(): PaymentData {\n return {} as PaymentData;\n }\n\n protected submitAnalytics(_analyticsObj?: AbstractAnalyticsEvent) {\n return null;\n }\n\n protected handleKeyDown(_e: TargetedKeyboardEvent<HTMLInputElement>) {\n return null;\n }\n\n protected setState(newState: S): void {\n this.state = { ...this.state, ...newState };\n }\n\n protected get sdkDataPaymentMethodConfiguration(): CreateSdkDataParams['paymentMethodConfiguration'] {\n return undefined;\n }\n\n /**\n * Returns the component payment data ready to submit to the Checkout API\n * Note: this does not ensure validity, check isValid first\n */\n public get data(): PaymentData {\n const order = this.state.order || this.props.order;\n const componentData = this.formatData();\n const doesPaymentMethodHaveNativeComponent = Boolean(getComponentNameOfPaymentType(componentData.paymentMethod?.type));\n const clientData = this.core.modules.risk.riskData;\n const checkoutAttemptId = this.core.modules.analytics.checkoutAttemptId ?? NO_CHECKOUT_ATTEMPT_ID;\n const paymentMethodBehavior = doesPaymentMethodHaveNativeComponent ? PAYMENT_METHOD_BEHAVIOR.NATIVE : PAYMENT_METHOD_BEHAVIOR.GENERIC;\n const sdkDataPaymentMethodConfiguration = this.sdkDataPaymentMethodConfiguration;\n\n const sdkData = createSdkData({\n checkoutAttemptId,\n clientData,\n paymentMethodBehavior,\n paymentMethodConfiguration: sdkDataPaymentMethodConfiguration\n });\n\n if (componentData.paymentMethod && checkoutAttemptId) {\n componentData.paymentMethod.checkoutAttemptId = checkoutAttemptId;\n }\n\n if (componentData.paymentMethod && sdkData) {\n componentData.paymentMethod.sdkData = sdkData;\n }\n\n return {\n ...(clientData && { riskData: { clientData } }),\n ...(order && { order: { orderData: order.orderData, pspReference: order.pspReference } }),\n ...componentData,\n clientStateDataIndicator: true\n };\n }\n\n /**\n * Method used to make the payment method active\n * (Useful when there are different payment methods available and activating one PM must trigger a specific task)\n */\n public activate(): void {\n return;\n }\n\n public render(): ComponentChild | Error {\n // render() not implemented in the element\n throw new Error('Payment method cannot be rendered.');\n }\n\n /**\n * Mounts an element into the dom\n * @param domNode - Node (or selector) where we will mount the payment element\n * @returns this - the payment element instance we mounted\n */\n public mount(domNode: HTMLElement | string): this {\n const node = typeof domNode === 'string' ? document.querySelector<HTMLElement>(domNode) : domNode;\n\n if (!node) {\n throw new Error('Component could not mount. Root node was not found.');\n }\n\n if (this._node) {\n this.unmount(); // new, if this._node exists then we are \"remounting\" so we first need to unmount if it's not already been done\n }\n\n this._node = node;\n\n // Add listener for key down events, notably 'Enter' key presses\n on(this._node, 'keydown', this.handleKeyDown, false);\n\n this._component = this.render();\n\n render(this._component, node);\n\n return this;\n }\n\n /**\n * Updates props, resets the internal state and remounts the element.\n *\n * @param props - props to update\n * @returns this - the element instance\n */\n public update(props: Partial<P>): this {\n this.props = this.formatProps({ ...this.props, ...props });\n this.state = {} as S;\n\n return this.unmount().mount(this._node); // for new mount fny\n }\n\n /**\n * Unmounts a payment element from the DOM\n */\n public unmount(): this {\n // Remove listener\n off(this._node, 'keydown', this.handleKeyDown);\n\n if (this._node) {\n render(null, this._node);\n }\n\n return this;\n }\n\n /**\n * Unmounts an element and removes it from the parent instance\n * For \"destroy\" type cleanup - when you don't intend to use the component again\n */\n public remove() {\n this.unmount();\n\n if (this.core) {\n this.core.remove(this);\n }\n }\n}\n\nexport default BaseElement;\n"],"names":["BaseElement","buildElementProps","componentProps","this","props","formatProps","constructor","formatData","submitAnalytics","_analyticsObj","handleKeyDown","_e","setState","newState","state","sdkDataPaymentMethodConfiguration","data","order","componentData","doesPaymentMethodHaveNativeComponent","Boolean","getComponentNameOfPaymentType","paymentMethod","type","clientData","core","modules","risk","riskData","checkoutAttemptId","analytics","NO_CHECKOUT_ATTEMPT_ID","paymentMethodBehavior","PAYMENT_METHOD_BEHAVIOR","NATIVE","GENERIC","sdkData","createSdkData","paymentMethodConfiguration","orderData","pspReference","clientStateDataIndicator","activate","render","Error","mount","domNode","node","document","querySelector","_node","unmount","on","_component","update","off","remove","checkout","_define_property","_id","uuid","isCoreInstance","initialize","createFromAction","assertIsCoreInstance","AdyenCheckoutError","bind","defaultProps"],"mappings":"mlBAwBA,MAAeA,EA4BDC,iBAAAA,CAAkBC,GACxBC,KAAKC,MAAQD,KAAKE,YAAY,IAAKF,KAAKG,YAAY,gBAAoBJ,GAC5E,CAMUG,WAAAA,CAAYD,GAClB,OAAOA,CACX,CAMA,UAAAG,GACI,MAAO,CAAA,CACX,CAEUC,eAAAA,CAAgBC,GACtB,OAAO,IACX,CAEUC,aAAAA,CAAcC,GACpB,OAAO,IACX,CAEUC,QAAAA,CAASC,GACfV,KAAKW,MAAQ,IAAKX,KAAKW,SAAUD,EACrC,CAEA,qCAAcE,GAEd,CAMA,QAAWC,GACP,MAAMC,EAAQd,KAAKW,MAAMG,OAASd,KAAKC,MAAMa,MACvCC,EAAgBf,KAAKI,aACrBY,EAAuCC,QAAQC,EAA8BH,EAAcI,eAAeC,OAC1GC,EAAarB,KAAKsB,KAAKC,QAAQC,KAAKC,SACpCC,EAAoB1B,KAAKsB,KAAKC,QAAQI,UAAUD,mBAAqBE,EACrEC,EAAwBb,EAAuCc,EAAwBC,OAASD,EAAwBE,QACxHpB,EAAoCZ,KAAKY,kCAEzCqB,EAAUC,EAAc,CAC1BR,oBACAL,aACAQ,wBACAM,2BAA4BvB,IAWhC,OARIG,EAAcI,eAAiBO,IAC/BX,EAAcI,cAAcO,kBAAoBA,GAGhDX,EAAcI,eAAiBc,IAC/BlB,EAAcI,cAAcc,QAAUA,GAGnC,IACCZ,GAAc,CAAEI,SAAU,CAAEJ,kBAC5BP,GAAS,CAAEA,MAAO,CAAEsB,UAAWtB,EAAMsB,UAAWC,aAAcvB,EAAMuB,kBACrEtB,EACHuB,0BAA0B,EAElC,CAMA,QAAAC,GAEA,CAEOC,MAAAA,GAEH,MAAM,IAAIC,MAAM,qCACpB,CAOOC,KAAAA,CAAMC,GACT,MAAMC,EAA0B,iBAAZD,EAAuBE,SAASC,cAA2BH,GAAWA,EAE1F,IAAKC,EACD,MAAM,IAAIH,MAAM,uDAgBpB,OAbIzC,KAAK+C,OACL/C,KAAKgD,UAGThD,KAAK+C,MAAQH,EAGbK,EAAGjD,KAAK+C,MAAO,UAAW/C,KAAKO,eAAe,GAE9CP,KAAKkD,WAAalD,KAAKwC,SAEvBA,EAAOxC,KAAKkD,WAAYN,GAEjB5C,IACX,CAQOmD,MAAAA,CAAOlD,GAIV,OAHAD,KAAKC,MAAQD,KAAKE,YAAY,IAAKF,KAAKC,SAAUA,IAClDD,KAAKW,MAAQ,CAAA,EAENX,KAAKgD,UAAUN,MAAM1C,KAAK+C,MACrC,CAKA,OAAAC,GAQI,OANAI,EAAIpD,KAAK+C,MAAO,UAAW/C,KAAKO,eAE5BP,KAAK+C,OACLP,EAAO,KAAMxC,KAAK+C,OAGf/C,IACX,CAMA,MAAAqD,GACIrD,KAAKgD,UAEDhD,KAAKsB,MACLtB,KAAKsB,KAAK+B,OAAOrD,KAEzB,CAtKA,WAAAG,CAAYmD,EAAiBrD,GAX7BsD,EAAAvD,KAAgBwD,MAAM,GAAGxD,KAAKG,YAAY,QAAWsD,OACrDF,EAAAvD,KAAgBsB,eAEhBiC,EAAAvD,KAAOC,gBACPsD,EAAAvD,KAAOW,QAAW,IAClB4C,EAAAvD,KAAOkD,qBAEPK,EAAAvD,KAAU+C,QAAqB,MAK3B,MAAMW,EAnBd,SAA8BJ,GAC1B,QAAKA,IAC+C,mBAAxBA,EAASK,YAAkE,mBAA9BL,EAASM,iBAEtF,CAe+BC,CAAqBP,GAE5C,IAAKI,EACD,MAAM,IAAII,EACN,uBACA,uCAAuC9D,KAAKG,YAAY,6DAIhEH,KAAKsB,KAAOgC,EACZtD,KAAKF,kBAAkBG,GAEvBD,KAAKO,cAAgBP,KAAKO,cAAcwD,KAAK/D,KACjD,EAhBAuD,EAVW1D,EAUemE,eAAe"}
|
|
1
|
+
{"version":3,"file":"BaseElement.js","sources":["../../../../../src/components/internal/BaseElement/BaseElement.ts"],"sourcesContent":["import { ComponentChild, h, render, TargetedKeyboardEvent } from 'preact';\nimport uuid from '../../../utils/uuid';\nimport AdyenCheckoutError from '../../../core/Errors/AdyenCheckoutError';\nimport { NO_CHECKOUT_ATTEMPT_ID } from '../../../core/Analytics/constants';\nimport type { ICore } from '../../../core/types';\nimport type { BaseElementProps, BaseElementState, IBaseElement } from './types';\nimport type { PaymentData } from '../../../types/global-types';\nimport { off, on } from '../../../utils/listenerUtils';\nimport { AbstractAnalyticsEvent } from '../../../core/Analytics/events/AbstractAnalyticsEvent';\nimport { createSdkData } from '../../../utils/createSdkData';\nimport getComponentNameOfPaymentType from '../../components-name-map';\nimport { PAYMENT_METHOD_BEHAVIOR } from '../../../core/config';\n\nconst ROOT_NODE_NOT_FOUND = 'Component could not mount. Root node was not found.';\n\n/**\n * Verify if the first parameter is instance of Core.\n * We do not use 'instanceof' to avoid importing the Core class directly into this class.\n * @param checkout\n */\nfunction assertIsCoreInstance(checkout: ICore): checkout is ICore {\n if (!checkout) return false;\n const isCoreObject = typeof checkout.initialize === 'function' && typeof checkout.createFromAction === 'function';\n return isCoreObject;\n}\n\nabstract class BaseElement<P extends BaseElementProps, S extends BaseElementState = BaseElementState> implements IBaseElement<P> {\n public readonly _id = `${this.constructor['type']}-${uuid()}`;\n public readonly core: ICore;\n\n public props: P;\n public state: S = {} as S;\n public _component: ComponentChild | undefined;\n\n protected _node: HTMLElement | null = null;\n\n protected static readonly defaultProps = {};\n\n constructor(checkout: ICore, props?: P) {\n const isCoreInstance = assertIsCoreInstance(checkout);\n\n if (!isCoreInstance) {\n throw new AdyenCheckoutError(\n 'IMPLEMENTATION_ERROR',\n `Trying to initialise the component '${this.constructor['type']}' without a reference to an instance of AdyenCheckout`\n );\n }\n\n this.core = checkout;\n this.buildElementProps(props);\n\n this.handleKeyDown = this.handleKeyDown.bind(this);\n }\n\n protected buildElementProps(componentProps?: P) {\n this.props = this.formatProps({ ...this.constructor['defaultProps'], ...componentProps });\n }\n\n /**\n * Executed during creation of any payment element.\n * Gives a chance to any paymentMethod to format the props we're receiving.\n */\n protected formatProps(props: P) {\n return props;\n }\n\n /**\n * Executed on the `data` getter.\n * Returns the component data necessary for the /payments request\n */\n protected formatData(): PaymentData {\n return {} as PaymentData;\n }\n\n protected submitAnalytics(_analyticsObj?: AbstractAnalyticsEvent): void {\n return;\n }\n\n protected handleKeyDown(_e: TargetedKeyboardEvent<HTMLInputElement>): void {\n return;\n }\n\n /**\n * The node the element is currently mounted into.\n * Throws the same error as `mount()` when the element has not been mounted yet.\n */\n protected get mountedNode(): HTMLElement {\n if (!this._node) {\n throw new Error(ROOT_NODE_NOT_FOUND);\n }\n return this._node;\n }\n\n protected setState(newState: S): void {\n this.state = { ...this.state, ...newState };\n }\n\n /**\n * Returns the component payment data ready to submit to the Checkout API\n * Note: this does not ensure validity, check isValid first\n */\n public get data(): PaymentData {\n const order = this.state.order || this.props.order;\n const componentData = this.formatData();\n const doesPaymentMethodHaveNativeComponent = Boolean(getComponentNameOfPaymentType(componentData.paymentMethod?.type));\n const clientData = this.core.modules.risk.riskData;\n const checkoutAttemptId = this.core.modules.analytics.checkoutAttemptId ?? NO_CHECKOUT_ATTEMPT_ID;\n const paymentMethodBehavior = doesPaymentMethodHaveNativeComponent ? PAYMENT_METHOD_BEHAVIOR.NATIVE : PAYMENT_METHOD_BEHAVIOR.GENERIC;\n\n const sdkData = createSdkData(checkoutAttemptId, clientData, paymentMethodBehavior);\n if (componentData.paymentMethod && checkoutAttemptId) {\n componentData.paymentMethod.checkoutAttemptId = checkoutAttemptId;\n }\n\n if (componentData.paymentMethod && sdkData) {\n componentData.paymentMethod.sdkData = sdkData;\n }\n\n return {\n ...(clientData && { riskData: { clientData } }),\n ...(order && { order: { orderData: order.orderData, pspReference: order.pspReference } }),\n ...componentData,\n clientStateDataIndicator: true\n };\n }\n\n /**\n * Method used to make the payment method active\n * (Useful when there are different payment methods available and activating one PM must trigger a specific task)\n */\n public activate(): void {\n return;\n }\n\n public render(): ComponentChild | Error {\n // render() not implemented in the element\n throw new Error('Payment method cannot be rendered.');\n }\n\n /**\n * Mounts an element into the dom\n * @param domNode - Node (or selector) where we will mount the payment element\n * @returns this - the payment element instance we mounted\n */\n public mount(domNode: HTMLElement | string): this {\n const node = typeof domNode === 'string' ? document.querySelector<HTMLElement>(domNode) : domNode;\n\n if (!node) {\n throw new Error(ROOT_NODE_NOT_FOUND);\n }\n\n if (this._node) {\n this.unmount(); // new, if this._node exists then we are \"remounting\" so we first need to unmount if it's not already been done\n }\n\n this._node = node;\n\n // Add listener for key down events, notably 'Enter' key presses\n on(this._node, 'keydown', this.handleKeyDown, false);\n\n this._component = this.render();\n\n render(this._component, node);\n\n return this;\n }\n\n /**\n * Updates props, resets the internal state and remounts the element.\n *\n * @param props - props to update\n * @returns this - the element instance\n */\n public update(props: Partial<P>): this {\n this.props = this.formatProps({ ...this.props, ...props });\n this.state = {} as S;\n\n return this.unmount().mount(this.mountedNode); // for new mount fny\n }\n\n /**\n * Unmounts a payment element from the DOM\n */\n public unmount(): this {\n if (this._node) {\n // Remove listener\n off(this._node, 'keydown', this.handleKeyDown);\n render(null, this._node);\n }\n\n return this;\n }\n\n /**\n * Unmounts an element and removes it from the parent instance\n * For \"destroy\" type cleanup - when you don't intend to use the component again\n */\n public remove() {\n this.unmount();\n\n if (this.core) {\n this.core.remove(this);\n }\n }\n}\n\nexport default BaseElement;\n"],"names":["ROOT_NODE_NOT_FOUND","BaseElement","buildElementProps","componentProps","this","props","formatProps","constructor","formatData","submitAnalytics","_analyticsObj","handleKeyDown","_e","mountedNode","_node","Error","setState","newState","state","data","order","componentData","doesPaymentMethodHaveNativeComponent","Boolean","getComponentNameOfPaymentType","paymentMethod","type","clientData","core","modules","risk","riskData","checkoutAttemptId","analytics","NO_CHECKOUT_ATTEMPT_ID","paymentMethodBehavior","PAYMENT_METHOD_BEHAVIOR","NATIVE","GENERIC","sdkData","createSdkData","orderData","pspReference","clientStateDataIndicator","activate","render","mount","domNode","node","document","querySelector","unmount","on","_component","update","off","remove","checkout","_define_property","_id","uuid","isCoreInstance","initialize","createFromAction","assertIsCoreInstance","AdyenCheckoutError","bind","defaultProps"],"mappings":"mlBAaA,MAAMA,EAAsB,sDAa5B,MAAeC,EA4BDC,iBAAAA,CAAkBC,GACxBC,KAAKC,MAAQD,KAAKE,YAAY,IAAKF,KAAKG,YAAY,gBAAoBJ,GAC5E,CAMUG,WAAAA,CAAYD,GAClB,OAAOA,CACX,CAMA,UAAAG,GACI,MAAO,CAAA,CACX,CAEUC,eAAAA,CAAgBC,GAE1B,CAEUC,aAAAA,CAAcC,GAExB,CAMA,eAAcC,GACV,IAAKT,KAAKU,MACN,MAAM,IAAIC,MAAMf,GAEpB,OAAOI,KAAKU,KAChB,CAEUE,QAAAA,CAASC,GACfb,KAAKc,MAAQ,IAAKd,KAAKc,SAAUD,EACrC,CAMA,QAAWE,GACP,MAAMC,EAAQhB,KAAKc,MAAME,OAAShB,KAAKC,MAAMe,MACvCC,EAAgBjB,KAAKI,aACrBc,EAAuCC,QAAQC,EAA8BH,EAAcI,eAAeC,OAC1GC,EAAavB,KAAKwB,KAAKC,QAAQC,KAAKC,SACpCC,EAAoB5B,KAAKwB,KAAKC,QAAQI,UAAUD,mBAAqBE,EACrEC,EAAwBb,EAAuCc,EAAwBC,OAASD,EAAwBE,QAExHC,EAAUC,EAAcR,EAAmBL,EAAYQ,GAS7D,OARId,EAAcI,eAAiBO,IAC/BX,EAAcI,cAAcO,kBAAoBA,GAGhDX,EAAcI,eAAiBc,IAC/BlB,EAAcI,cAAcc,QAAUA,GAGnC,IACCZ,GAAc,CAAEI,SAAU,CAAEJ,kBAC5BP,GAAS,CAAEA,MAAO,CAAEqB,UAAWrB,EAAMqB,UAAWC,aAActB,EAAMsB,kBACrErB,EACHsB,0BAA0B,EAElC,CAMA,QAAAC,GAEA,CAEOC,MAAAA,GAEH,MAAM,IAAI9B,MAAM,qCACpB,CAOO+B,KAAAA,CAAMC,GACT,MAAMC,EAA0B,iBAAZD,EAAuBE,SAASC,cAA2BH,GAAWA,EAE1F,IAAKC,EACD,MAAM,IAAIjC,MAAMf,GAgBpB,OAbII,KAAKU,OACLV,KAAK+C,UAGT/C,KAAKU,MAAQkC,EAGbI,EAAGhD,KAAKU,MAAO,UAAWV,KAAKO,eAAe,GAE9CP,KAAKiD,WAAajD,KAAKyC,SAEvBA,EAAOzC,KAAKiD,WAAYL,GAEjB5C,IACX,CAQOkD,MAAAA,CAAOjD,GAIV,OAHAD,KAAKC,MAAQD,KAAKE,YAAY,IAAKF,KAAKC,SAAUA,IAClDD,KAAKc,MAAQ,CAAA,EAENd,KAAK+C,UAAUL,MAAM1C,KAAKS,YACrC,CAKA,OAAAsC,GAOI,OANI/C,KAAKU,QAELyC,EAAInD,KAAKU,MAAO,UAAWV,KAAKO,eAChCkC,EAAO,KAAMzC,KAAKU,QAGfV,IACX,CAMA,MAAAoD,GACIpD,KAAK+C,UAED/C,KAAKwB,MACLxB,KAAKwB,KAAK4B,OAAOpD,KAEzB,CArKA,WAAAG,CAAYkD,EAAiBpD,GAX7BqD,EAAAtD,KAAgBuD,MAAM,GAAGvD,KAAKG,YAAY,QAAWqD,OACrDF,EAAAtD,KAAgBwB,eAEhB8B,EAAAtD,KAAOC,gBACPqD,EAAAtD,KAAOc,QAAW,IAClBwC,EAAAtD,KAAOiD,qBAEPK,EAAAtD,KAAUU,QAA4B,MAKlC,MAAM+C,EAnBd,SAA8BJ,GAC1B,QAAKA,IAC+C,mBAAxBA,EAASK,YAAkE,mBAA9BL,EAASM,iBAEtF,CAe+BC,CAAqBP,GAE5C,IAAKI,EACD,MAAM,IAAII,EACN,uBACA,uCAAuC7D,KAAKG,YAAY,6DAIhEH,KAAKwB,KAAO6B,EACZrD,KAAKF,kBAAkBG,GAEvBD,KAAKO,cAAgBP,KAAKO,cAAcuD,KAAK9D,KACjD,EAhBAsD,EAVWzD,EAUekE,eAAe"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createElement as e}from"../../../../../../external/preact/dist/preact.js";import{useState as t,useEffect as o,useCallback as r}from"../../../../../../external/preact/hooks/dist/hooks.js";import s from"../../../context/useClickToPayContext.js";import n from"../../../../../../_virtual/index.js";import{useCoreContext as c}from"../../../../../../core/Context/CoreProvider.js";import{useA11yReporter as a}from"../../../../../../core/Errors/useA11yReporter.js";import i from"../../../../Icon/Icon.js";import{isSrciError as d}from"../../../services/utils.js";import{PREFIX as
|
|
1
|
+
import{createElement as e}from"../../../../../../external/preact/dist/preact.js";import{useState as t,useEffect as o,useCallback as r}from"../../../../../../external/preact/hooks/dist/hooks.js";import s from"../../../context/useClickToPayContext.js";import n from"../../../../../../_virtual/index.js";import{useCoreContext as c}from"../../../../../../core/Context/CoreProvider.js";import{useA11yReporter as a}from"../../../../../../core/Errors/useA11yReporter.js";import i from"../../../../Icon/Icon.js";import{isSrciError as d}from"../../../services/utils.js";import{PREFIX as l}from"../../../../Icon/constants.js";import p from"../../../../Button/Button.js";const m=({onError:m,onResendCode:u,disabled:f})=>{const[k,C]=t(null),[h,j]=t(!1),{i18n:y}=c(),{startIdentityValidation:v}=s(),[_,b]=t(null);a(_),o(()=>{let e;return k>0&&(e=setTimeout(()=>C(k-1),1e3)),60===k?b(`${y.get("ctp.otp.resendCode")} - ${k}s`):0===k&&b(y.get("ctp.otp.resendCode")),()=>clearTimeout(e)},[k]),o(()=>{let e;return h&&(e=setTimeout(()=>{j(!1),C(60)},2e3)),()=>clearTimeout(e)},[h]);const x=r(async e=>{e.preventDefault();try{u(),j(!0),await v()}catch(e){if(C(0),j(!1),!d(e))return void console.error(e);m(e.reason)}},[v,m,u]);return h?e("div",{role:"alert",className:"adyen-checkout-ctp__otp-resend-code--confirmation"},y.get("ctp.otp.codeResent"),e(i,{type:`${l}checkmark_black`,height:14,width:14})):k>0?e("div",{role:"timer",className:"adyen-checkout-ctp__otp-resend-code--disabled"},y.get("ctp.otp.resendCode")," -"," ",e("span",{className:"adyen-checkout-ctp__otp-resend-code-counter"}," ",k>0&&`${k}s`," ")):e(p,{classNameModifiers:[n("otp-resend-code",{"otp-resend-code--disabled":f})],onClick:x,variant:"link",inline:!0,label:y.get("ctp.otp.resendCode"),disabled:f})};export{m as default};
|
|
2
2
|
//# sourceMappingURL=CtPResendOtpLink.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CtPResendOtpLink.js","sources":["../../../../../../../../src/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.tsx"],"sourcesContent":["import { h, TargetedMouseEvent } from 'preact';\nimport { useCallback, useEffect, useState } from 'preact/hooks';\nimport useClickToPayContext from '../../../context/useClickToPayContext';\nimport classnames from 'classnames';\nimport { useCoreContext } from '../../../../../../core/Context/CoreProvider';\nimport { useA11yReporter } from '../../../../../../core/Errors/useA11yReporter';\nimport Icon from '../../../../Icon';\nimport { isSrciError } from '../../../services/utils';\nimport { PREFIX } from '../../../../Icon/constants';\nimport Button from '../../../../Button';\n\nconst CONFIRMATION_SHOWING_TIME = 2000;\nconst RESEND_OTP_COUNTDOWN_SECONDS = 60;\n\ninterface CtPResendOtpLinkProps {\n onError(errorCode: string): void;\n onResendCode(): void;\n disabled: boolean;\n}\n\nconst CtPResendOtpLink = ({ onError, onResendCode, disabled }: Readonly<CtPResendOtpLinkProps>): h.JSX.Element => {\n const [counter, setCounter] = useState<number | null>(null);\n const [showConfirmation, setShowConfirmation] = useState<boolean>(false);\n const { i18n } = useCoreContext();\n const { startIdentityValidation } = useClickToPayContext();\n const [resendStatusMessage, setResendStatusMessage] = useState<string | null>(null);\n useA11yReporter(resendStatusMessage);\n\n useEffect(() => {\n let timeout: ReturnType<typeof setTimeout> | undefined;\n if (counter > 0) {\n timeout = setTimeout(() => setCounter(counter - 1), 1000);\n }\n if (counter === RESEND_OTP_COUNTDOWN_SECONDS) {\n setResendStatusMessage(`${i18n.get('ctp.otp.resendCode')} - ${counter}s`);\n } else if (counter === 0) {\n setResendStatusMessage(i18n.get('ctp.otp.resendCode'));\n }\n return () => clearTimeout(timeout);\n }, [counter]);\n\n useEffect(() => {\n let timeout: ReturnType<typeof setTimeout> | undefined;\n\n if (showConfirmation) {\n timeout = setTimeout(() => {\n setShowConfirmation(false);\n setCounter(RESEND_OTP_COUNTDOWN_SECONDS);\n }, CONFIRMATION_SHOWING_TIME);\n }\n return () => clearTimeout(timeout);\n }, [showConfirmation]);\n\n const handleResendCodeClick = useCallback(\n async (event: TargetedMouseEvent<HTMLButtonElement>) => {\n event.preventDefault();\n\n try {\n onResendCode();\n setShowConfirmation(true);\n await startIdentityValidation();\n } catch (error: unknown) {\n setCounter(0);\n setShowConfirmation(false);\n\n if (!isSrciError(error)) {\n console.error(error);\n return;\n }\n\n onError(error.reason);\n }\n },\n [startIdentityValidation, onError, onResendCode]\n );\n\n if (showConfirmation) {\n return (\n <div role=\"alert\" className=\"adyen-checkout-ctp__otp-resend-code--confirmation\">\n {i18n.get('ctp.otp.codeResent')}\n <Icon type={`${PREFIX}checkmark_black`} height={14} width={14} />\n </div>\n );\n }\n\n if (counter > 0) {\n return (\n <div role=\"timer\" className=\"adyen-checkout-ctp__otp-resend-code--disabled\">\n {i18n.get('ctp.otp.resendCode')} -{' '}\n <span className=\"adyen-checkout-ctp__otp-resend-code-counter\"> {counter > 0 && `${counter}s`} </span>\n </div>\n );\n }\n\n return (\n <Button\n classNameModifiers={[classnames('otp-resend-code', { 'otp-resend-code--disabled': disabled })]}\n onClick={handleResendCodeClick}\n variant=\"link\"\n inline={true}\n
|
|
1
|
+
{"version":3,"file":"CtPResendOtpLink.js","sources":["../../../../../../../../src/components/internal/ClickToPay/components/CtPOneTimePassword/CtPOneTimePasswordInput/CtPResendOtpLink.tsx"],"sourcesContent":["import { h, TargetedMouseEvent } from 'preact';\nimport { useCallback, useEffect, useState } from 'preact/hooks';\nimport useClickToPayContext from '../../../context/useClickToPayContext';\nimport classnames from 'classnames';\nimport { useCoreContext } from '../../../../../../core/Context/CoreProvider';\nimport { useA11yReporter } from '../../../../../../core/Errors/useA11yReporter';\nimport Icon from '../../../../Icon';\nimport { isSrciError } from '../../../services/utils';\nimport { PREFIX } from '../../../../Icon/constants';\nimport Button from '../../../../Button';\n\nconst CONFIRMATION_SHOWING_TIME = 2000;\nconst RESEND_OTP_COUNTDOWN_SECONDS = 60;\n\ninterface CtPResendOtpLinkProps {\n onError(errorCode: string): void;\n onResendCode(): void;\n disabled: boolean;\n}\n\nconst CtPResendOtpLink = ({ onError, onResendCode, disabled }: Readonly<CtPResendOtpLinkProps>): h.JSX.Element => {\n const [counter, setCounter] = useState<number | null>(null);\n const [showConfirmation, setShowConfirmation] = useState<boolean>(false);\n const { i18n } = useCoreContext();\n const { startIdentityValidation } = useClickToPayContext();\n const [resendStatusMessage, setResendStatusMessage] = useState<string | null>(null);\n useA11yReporter(resendStatusMessage);\n\n useEffect(() => {\n let timeout: ReturnType<typeof setTimeout> | undefined;\n if (counter > 0) {\n timeout = setTimeout(() => setCounter(counter - 1), 1000);\n }\n if (counter === RESEND_OTP_COUNTDOWN_SECONDS) {\n setResendStatusMessage(`${i18n.get('ctp.otp.resendCode')} - ${counter}s`);\n } else if (counter === 0) {\n setResendStatusMessage(i18n.get('ctp.otp.resendCode'));\n }\n return () => clearTimeout(timeout);\n }, [counter]);\n\n useEffect(() => {\n let timeout: ReturnType<typeof setTimeout> | undefined;\n\n if (showConfirmation) {\n timeout = setTimeout(() => {\n setShowConfirmation(false);\n setCounter(RESEND_OTP_COUNTDOWN_SECONDS);\n }, CONFIRMATION_SHOWING_TIME);\n }\n return () => clearTimeout(timeout);\n }, [showConfirmation]);\n\n const handleResendCodeClick = useCallback(\n async (event: TargetedMouseEvent<HTMLButtonElement>) => {\n event.preventDefault();\n\n try {\n onResendCode();\n setShowConfirmation(true);\n await startIdentityValidation();\n } catch (error: unknown) {\n setCounter(0);\n setShowConfirmation(false);\n\n if (!isSrciError(error)) {\n console.error(error);\n return;\n }\n\n onError(error.reason);\n }\n },\n [startIdentityValidation, onError, onResendCode]\n );\n\n if (showConfirmation) {\n return (\n <div role=\"alert\" className=\"adyen-checkout-ctp__otp-resend-code--confirmation\">\n {i18n.get('ctp.otp.codeResent')}\n <Icon type={`${PREFIX}checkmark_black`} height={14} width={14} />\n </div>\n );\n }\n\n if (counter > 0) {\n return (\n <div role=\"timer\" className=\"adyen-checkout-ctp__otp-resend-code--disabled\">\n {i18n.get('ctp.otp.resendCode')} -{' '}\n <span className=\"adyen-checkout-ctp__otp-resend-code-counter\"> {counter > 0 && `${counter}s`} </span>\n </div>\n );\n }\n\n return (\n <Button\n classNameModifiers={[classnames('otp-resend-code', { 'otp-resend-code--disabled': disabled })]}\n onClick={handleResendCodeClick}\n variant=\"link\"\n inline={true}\n label={i18n.get('ctp.otp.resendCode')}\n disabled={disabled}\n />\n );\n};\n\nexport default CtPResendOtpLink;\n"],"names":["CtPResendOtpLink","onError","onResendCode","disabled","counter","setCounter","useState","showConfirmation","setShowConfirmation","i18n","useCoreContext","startIdentityValidation","useClickToPayContext","resendStatusMessage","setResendStatusMessage","useA11yReporter","useEffect","timeout","setTimeout","get","clearTimeout","handleResendCodeClick","useCallback","async","event","preventDefault","error","isSrciError","console","reason","h","div","role","className","Icon","type","PREFIX","height","width","span","Button","classNameModifiers","classnames","onClick","variant","inline","label"],"mappings":"opBAWA,MASMA,EAAmB,EAAGC,UAASC,eAAcC,eAC/C,MAAOC,EAASC,GAAcC,EAAwB,OAC/CC,EAAkBC,GAAuBF,GAAkB,IAC5DG,KAAEA,GAASC,KACXC,wBAAEA,GAA4BC,KAC7BC,EAAqBC,GAA0BR,EAAwB,MAC9ES,EAAgBF,GAEhBG,EAAU,KACN,IAAIC,EASJ,OARIb,EAAU,IACVa,EAAUC,WAAW,IAAMb,EAAWD,EAAU,GAAI,MAnB3B,KAqBzBA,EACAU,EAAuB,GAAGL,EAAKU,IAAI,2BAA2Bf,MAC3C,IAAZA,GACPU,EAAuBL,EAAKU,IAAI,uBAE7B,IAAMC,aAAaH,IAC3B,CAACb,IAEJY,EAAU,KACN,IAAIC,EAQJ,OANIV,IACAU,EAAUC,WAAW,KACjBV,GAAoB,GACpBH,EAnCqB,KADH,MAuCnB,IAAMe,aAAaH,IAC3B,CAACV,IAEJ,MAAMc,EAAwBC,EAC1BC,MAAOC,IACHA,EAAMC,iBAEN,IACIvB,IACAM,GAAoB,SACdG,GACV,CAAE,MAAOe,GAIL,GAHArB,EAAW,GACXG,GAAoB,IAEfmB,EAAYD,GAEb,YADAE,QAAQF,MAAMA,GAIlBzB,EAAQyB,EAAMG,OAClB,GAEJ,CAAClB,EAAyBV,EAASC,IAGvC,OAAIK,EAEIuB,EAACC,MAAAA,CAAIC,KAAK,QAAQC,UAAU,qDACvBxB,EAAKU,IAAI,sBACVW,EAACI,EAAAA,CAAKC,KAAM,GAAGC,mBAAyBC,OAAQ,GAAIC,MAAO,MAKnElC,EAAU,EAEN0B,EAACC,MAAAA,CAAIC,KAAK,QAAQC,UAAU,iDACvBxB,EAAKU,IAAI,sBAAsB,KAAG,IACnCW,EAACS,OAAAA,CAAKN,UAAU,+CAA8C,IAAE7B,EAAU,GAAK,GAAGA,KAAW,MAMrG0B,EAACU,EAAAA,CACGC,mBAAoB,CAACC,EAAW,kBAAmB,CAAE,4BAA6BvC,KAClFwC,QAAStB,EACTuB,QAAQ,OACRC,QAAQ,EACRC,MAAOrC,EAAKU,IAAI,sBAChBhB,SAAUA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createElement as t}from"../../../../../external/preact/dist/preact.js";import o from"../../context/useClickToPayContext.js";import{CtpState as e}from"../../services/ClickToPayService.js";import r from"../../../../../_virtual/index.js";import{useMemo as n}from"../../../../../external/preact/hooks/dist/hooks.js";import{useCoreContext as s}from"../../../../../core/Context/CoreProvider.js";import i from"../../../Button/Button.js";const a=()=>{const{ctpState:a,logoutShopper:l,status:c,cards:u}=o(),{i18n:d}=s();if(!1===[e.Ready,e.OneTimePassword].includes(a))return null;const m=n(()=>a===e.Ready&&u.length>1?d.get("ctp.logout.notYourCards"):a===e.Ready&&1===u.length?d.get("ctp.logout.notYourCard"):a===e.Ready&&0===u.length?d.get("ctp.logout.notYourProfile"):d.get("ctp.logout.notYou"),[d,a]);return t(i,{classNameModifiers:[r("section-logout-button",{"section-logout-button--disabled":"loading"===c})],disabled:"loading"===c,onClick:l,variant:"link",inline:!0
|
|
1
|
+
import{createElement as t}from"../../../../../external/preact/dist/preact.js";import o from"../../context/useClickToPayContext.js";import{CtpState as e}from"../../services/ClickToPayService.js";import r from"../../../../../_virtual/index.js";import{useMemo as n}from"../../../../../external/preact/hooks/dist/hooks.js";import{useCoreContext as s}from"../../../../../core/Context/CoreProvider.js";import i from"../../../Button/Button.js";const a=()=>{const{ctpState:a,logoutShopper:l,status:c,cards:u}=o(),{i18n:d}=s();if(!1===[e.Ready,e.OneTimePassword].includes(a))return null;const m=n(()=>a===e.Ready&&u.length>1?d.get("ctp.logout.notYourCards"):a===e.Ready&&1===u.length?d.get("ctp.logout.notYourCard"):a===e.Ready&&0===u.length?d.get("ctp.logout.notYourProfile"):d.get("ctp.logout.notYou"),[d,a]);return t(i,{classNameModifiers:[r("section-logout-button",{"section-logout-button--disabled":"loading"===c})],disabled:"loading"===c,onClick:l,variant:"link",inline:!0,label:m})};export{a as default};
|
|
2
2
|
//# sourceMappingURL=CtPLogoutLink.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CtPLogoutLink.js","sources":["../../../../../../../src/components/internal/ClickToPay/components/CtPSection/CtPLogoutLink.tsx"],"sourcesContent":["import { h } from 'preact';\nimport useClickToPayContext from '../../context/useClickToPayContext';\nimport { CtpState } from '../../services/ClickToPayService';\nimport classnames from 'classnames';\nimport { useMemo } from 'preact/hooks';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport './CtPLogoutLink.scss';\nimport Button from '../../../Button';\n\nconst CtPLogoutLink = () => {\n const { ctpState, logoutShopper, status, cards } = useClickToPayContext();\n const { i18n } = useCoreContext();\n\n if ([CtpState.Ready, CtpState.OneTimePassword].includes(ctpState) === false) {\n return null;\n }\n\n const label = useMemo(() => {\n if (ctpState === CtpState.Ready && cards.length > 1) return i18n.get('ctp.logout.notYourCards');\n if (ctpState === CtpState.Ready && cards.length === 1) return i18n.get('ctp.logout.notYourCard');\n if (ctpState === CtpState.Ready && cards.length === 0) return i18n.get('ctp.logout.notYourProfile');\n return i18n.get('ctp.logout.notYou');\n }, [i18n, ctpState]);\n\n return (\n <Button\n classNameModifiers={[\n classnames('section-logout-button', {\n 'section-logout-button--disabled': status === 'loading'\n })\n ]}\n disabled={status === 'loading'}\n onClick={logoutShopper}\n variant=\"link\"\n inline={true}\n
|
|
1
|
+
{"version":3,"file":"CtPLogoutLink.js","sources":["../../../../../../../src/components/internal/ClickToPay/components/CtPSection/CtPLogoutLink.tsx"],"sourcesContent":["import { h } from 'preact';\nimport useClickToPayContext from '../../context/useClickToPayContext';\nimport { CtpState } from '../../services/ClickToPayService';\nimport classnames from 'classnames';\nimport { useMemo } from 'preact/hooks';\nimport { useCoreContext } from '../../../../../core/Context/CoreProvider';\nimport './CtPLogoutLink.scss';\nimport Button from '../../../Button';\n\nconst CtPLogoutLink = () => {\n const { ctpState, logoutShopper, status, cards } = useClickToPayContext();\n const { i18n } = useCoreContext();\n\n if ([CtpState.Ready, CtpState.OneTimePassword].includes(ctpState) === false) {\n return null;\n }\n\n const label = useMemo(() => {\n if (ctpState === CtpState.Ready && cards.length > 1) return i18n.get('ctp.logout.notYourCards');\n if (ctpState === CtpState.Ready && cards.length === 1) return i18n.get('ctp.logout.notYourCard');\n if (ctpState === CtpState.Ready && cards.length === 0) return i18n.get('ctp.logout.notYourProfile');\n return i18n.get('ctp.logout.notYou');\n }, [i18n, ctpState]);\n\n return (\n <Button\n classNameModifiers={[\n classnames('section-logout-button', {\n 'section-logout-button--disabled': status === 'loading'\n })\n ]}\n disabled={status === 'loading'}\n onClick={logoutShopper}\n variant=\"link\"\n inline={true}\n label={label}\n />\n );\n};\n\nexport default CtPLogoutLink;\n"],"names":["CtPLogoutLink","ctpState","logoutShopper","status","cards","useClickToPayContext","i18n","useCoreContext","CtpState","Ready","OneTimePassword","includes","label","useMemo","length","get","h","Button","classNameModifiers","classnames","disabled","onClick","variant","inline"],"mappings":"qbASA,MAAMA,EAAgB,KAClB,MAAMC,SAAEA,EAAQC,cAAEA,EAAaC,OAAEA,EAAMC,MAAEA,GAAUC,KAC7CC,KAAEA,GAASC,IAEjB,IAAsE,IAAlE,CAACC,EAASC,MAAOD,EAASE,iBAAiBC,SAASV,GACpD,OAAO,KAGX,MAAMW,EAAQC,EAAQ,IACdZ,IAAaO,EAASC,OAASL,EAAMU,OAAS,EAAUR,EAAKS,IAAI,2BACjEd,IAAaO,EAASC,OAA0B,IAAjBL,EAAMU,OAAqBR,EAAKS,IAAI,0BACnEd,IAAaO,EAASC,OAA0B,IAAjBL,EAAMU,OAAqBR,EAAKS,IAAI,6BAChET,EAAKS,IAAI,qBACjB,CAACT,EAAML,IAEV,OACIe,EAACC,EAAAA,CACGC,mBAAoB,CAChBC,EAAW,wBAAyB,CAChC,kCAA8C,YAAXhB,KAG3CiB,SAAqB,YAAXjB,EACVkB,QAASnB,EACToB,QAAQ,OACRC,QAAQ,EACRX,MAAOA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createElement as e}from"../../../external/preact/dist/preact.js";import{useRef as r,useEffect as
|
|
1
|
+
import{createElement as e}from"../../../external/preact/dist/preact.js";import{useRef as r,useEffect as t}from"../../../external/preact/hooks/dist/hooks.js";import a from"../FormFields/Fieldset/Fieldset.js";import i from"../FormFields/Field/Field.js";import s from"./ReadOnlyCompanyDetails.js";import{companyDetailsValidationRules as o}from"./validate.js";import{useCoreContext as n}from"../../../core/Context/CoreProvider.js";import{getFormattedData as l}from"./utils.js";import m from"../../../utils/useForm/useForm.js";import"../SecuredFields/lib/CSF/utils/userAgent.js";import u from"../FormFields/InputText.js";const d=["name","registrationNumber"];function c(c){const{label:p="",namePrefix:f,requiredFields:g=d,visibility:b="editable",data:F={},onChange:N=()=>{},validationRules:j=o}=c,{i18n:h}=n(),{handleChangeFor:v,triggerValidation:y,data:C,valid:M,errors:x,isValid:k}=m({schema:g,rules:{...o,...j},defaultData:F}),$=r({});Object.keys($.current).length||c.setComponentRef?.($.current),$.current.showValidation=()=>{y()};const D=e=>`${f?`${f}.`:""}${e}`,R=e=>r=>{const{name:t}=r.target,a=f?t.split(`${f}.`).pop():t;a&&v(a,e)(r)},V=e=>r=>{const{name:t}=r.target,a=f?t.split(`${f}.`).pop():t;a&&v(a,e)(r)};return t(()=>{const e=l(C);N({data:e,valid:M,errors:x,isValid:k})},[C,M,x,k]),"hidden"===b?null:"readOnly"===b?e(s,{...c,data:C}):e(a,{classNameModifiers:[p],label:p},g.includes("name")&&e(i,{label:h.get("companyDetails.name"),classNameModifiers:["name"],errorMessage:!!x.name,i18n:h,name:D("companyName")},e(u,{name:D("name"),value:C.name,classNameModifiers:["name"],onInput:V("input"),onBlur:R("blur"),spellcheck:!1,autocomplete:"organization"})),g.includes("registrationNumber")&&e(i,{label:h.get("companyDetails.registrationNumber"),classNameModifiers:["registrationNumber"],errorMessage:!!x.registrationNumber,i18n:h,name:D("registrationNumber")},e(u,{name:D("registrationNumber"),value:C.registrationNumber,classNameModifiers:["registrationNumber"],onInput:V("input"),onBlur:R("blur"),spellcheck:!1,autocomplete:void 0})))}export{d as COMPANY_DETAILS_SCHEMA,c as default};
|
|
2
2
|
//# sourceMappingURL=CompanyDetails.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompanyDetails.js","sources":["../../../../../src/components/internal/CompanyDetails/CompanyDetails.tsx"],"sourcesContent":["import { h, FocusEventHandler, InputEventHandler } from 'preact';\nimport { useEffect, useRef } from 'preact/hooks';\nimport Fieldset from '../FormFields/Fieldset';\nimport Field from '../FormFields/Field';\nimport ReadOnlyCompanyDetails from './ReadOnlyCompanyDetails';\nimport { companyDetailsValidationRules } from './validate';\nimport { useCoreContext } from '../../../core/Context/CoreProvider';\nimport { getFormattedData } from './utils';\nimport { CompanyDetailsSchema, CompanyDetailsProps } from './types';\nimport useForm from '../../../utils/useForm';\nimport InputText from '../FormFields/InputText';\nimport { ComponentMethodsRef } from '../UIElement/types';\nimport { HandleChangeForModeType } from '../../../utils/useForm/types';\n\nexport const COMPANY_DETAILS_SCHEMA = ['name', 'registrationNumber'];\n\nexport default function CompanyDetails(props: Readonly<CompanyDetailsProps>) {\n const {
|
|
1
|
+
{"version":3,"file":"CompanyDetails.js","sources":["../../../../../src/components/internal/CompanyDetails/CompanyDetails.tsx"],"sourcesContent":["import { h, FocusEventHandler, InputEventHandler } from 'preact';\nimport { useEffect, useRef } from 'preact/hooks';\nimport Fieldset from '../FormFields/Fieldset';\nimport Field from '../FormFields/Field';\nimport ReadOnlyCompanyDetails from './ReadOnlyCompanyDetails';\nimport { companyDetailsValidationRules } from './validate';\nimport { useCoreContext } from '../../../core/Context/CoreProvider';\nimport { getFormattedData } from './utils';\nimport { CompanyDetailsSchema, CompanyDetailsProps } from './types';\nimport useForm from '../../../utils/useForm';\nimport InputText from '../FormFields/InputText';\nimport { ComponentMethodsRef } from '../UIElement/types';\nimport { HandleChangeForModeType } from '../../../utils/useForm/types';\n\nexport const COMPANY_DETAILS_SCHEMA = ['name', 'registrationNumber'];\n\nexport default function CompanyDetails(props: Readonly<CompanyDetailsProps>) {\n const {\n label = '',\n namePrefix,\n requiredFields = COMPANY_DETAILS_SCHEMA,\n visibility = 'editable',\n data: initialData = {},\n onChange = () => {},\n validationRules = companyDetailsValidationRules\n } = props;\n const { i18n } = useCoreContext();\n const { handleChangeFor, triggerValidation, data, valid, errors, isValid } = useForm<CompanyDetailsSchema>({\n schema: requiredFields,\n rules: { ...companyDetailsValidationRules, ...validationRules },\n defaultData: initialData\n });\n\n /** An object by which to expose 'public' members to the parent UIElement */\n const companyDetailsRef = useRef<ComponentMethodsRef>({});\n // Just call once\n if (!Object.keys(companyDetailsRef.current).length) {\n props.setComponentRef?.(companyDetailsRef.current);\n }\n\n // Expose method expected by (parent) Address.tsx\n companyDetailsRef.current.showValidation = () => {\n triggerValidation();\n };\n\n const generateFieldName = (name: string): string => `${namePrefix ? `${namePrefix}.` : ''}${name}`;\n\n const eventHandler =\n (mode: HandleChangeForModeType): FocusEventHandler<HTMLInputElement> =>\n (e): void => {\n const { name } = e.target as HTMLInputElement;\n const key = namePrefix ? name.split(`${namePrefix}.`).pop() : name;\n\n if (!key) return;\n handleChangeFor(key, mode)(e);\n };\n\n const inputEventHandler =\n (mode: HandleChangeForModeType): InputEventHandler<HTMLInputElement> =>\n (e): void => {\n const { name } = e.target as HTMLInputElement;\n const key = namePrefix ? name.split(`${namePrefix}.`).pop() : name;\n\n if (!key) return;\n handleChangeFor(key, mode)(e);\n };\n\n useEffect(() => {\n const formattedData = getFormattedData(data);\n onChange({ data: formattedData, valid, errors, isValid });\n }, [data, valid, errors, isValid]);\n\n if (visibility === 'hidden') return null;\n if (visibility === 'readOnly') return <ReadOnlyCompanyDetails {...props} data={data} />;\n\n return (\n <Fieldset classNameModifiers={[label]} label={label}>\n {requiredFields.includes('name') && (\n <Field\n label={i18n.get('companyDetails.name')}\n classNameModifiers={['name']}\n errorMessage={!!errors.name}\n i18n={i18n}\n name={generateFieldName('companyName')}\n >\n <InputText\n name={generateFieldName('name')}\n value={data.name}\n classNameModifiers={['name']}\n onInput={inputEventHandler('input')}\n onBlur={eventHandler('blur')}\n spellcheck={false}\n autocomplete={'organization'}\n />\n </Field>\n )}\n\n {requiredFields.includes('registrationNumber') && (\n <Field\n label={i18n.get('companyDetails.registrationNumber')}\n classNameModifiers={['registrationNumber']}\n errorMessage={!!errors.registrationNumber}\n i18n={i18n}\n name={generateFieldName('registrationNumber')}\n >\n <InputText\n name={generateFieldName('registrationNumber')}\n value={data.registrationNumber}\n classNameModifiers={['registrationNumber']}\n onInput={inputEventHandler('input')}\n onBlur={eventHandler('blur')}\n spellcheck={false}\n autocomplete={undefined}\n />\n </Field>\n )}\n </Fieldset>\n );\n}\n"],"names":["COMPANY_DETAILS_SCHEMA","CompanyDetails","props","label","namePrefix","requiredFields","visibility","data","initialData","onChange","validationRules","companyDetailsValidationRules","i18n","useCoreContext","handleChangeFor","triggerValidation","valid","errors","isValid","useForm","schema","rules","defaultData","companyDetailsRef","useRef","Object","keys","current","length","setComponentRef","showValidation","generateFieldName","name","eventHandler","mode","e","target","key","split","pop","inputEventHandler","useEffect","formattedData","getFormattedData","h","ReadOnlyCompanyDetails","Fieldset","classNameModifiers","includes","Field","get","errorMessage","InputText","value","onInput","onBlur","spellcheck","autocomplete","registrationNumber","undefined"],"mappings":"8mBAcaA,EAAyB,CAAC,OAAQ,sBAEhC,SAASC,EAAeC,GACnC,MAAMC,MACFA,EAAQ,GAAEC,WACVA,EAAUC,eACVA,EAAiBL,EAAsBM,WACvCA,EAAa,WACbC,KAAMC,EAAc,CAAA,EAAEC,SACtBA,EAAW,OAAQC,gBACnBA,EAAkBC,GAClBT,GACEU,KAAEA,GAASC,KACXC,gBAAEA,EAAeC,kBAAEA,EAAiBR,KAAEA,EAAIS,MAAEA,EAAKC,OAAEA,EAAMC,QAAEA,GAAYC,EAA8B,CACvGC,OAAQf,EACRgB,MAAO,IAAKV,KAAkCD,GAC9CY,YAAad,IAIXe,EAAoBC,EAA4B,IAEjDC,OAAOC,KAAKH,EAAkBI,SAASC,QACxC1B,EAAM2B,kBAAkBN,EAAkBI,SAI9CJ,EAAkBI,QAAQG,eAAiB,KACvCf,KAGJ,MAAMgB,EAAqBC,GAAyB,GAAG5B,EAAa,GAAGA,KAAgB,KAAK4B,IAEtFC,EACDC,GACAC,IACG,MAAMH,KAAEA,GAASG,EAAEC,OACbC,EAAMjC,EAAa4B,EAAKM,MAAM,GAAGlC,MAAemC,MAAQP,EAEzDK,GACLvB,EAAgBuB,EAAKH,EAArBpB,CAA2BqB,IAG7BK,EACDN,GACAC,IACG,MAAMH,KAAEA,GAASG,EAAEC,OACbC,EAAMjC,EAAa4B,EAAKM,MAAM,GAAGlC,MAAemC,MAAQP,EAEzDK,GACLvB,EAAgBuB,EAAKH,EAArBpB,CAA2BqB,IAQnC,OALAM,EAAU,KACN,MAAMC,EAAgBC,EAAiBpC,GACvCE,EAAS,CAAEF,KAAMmC,EAAe1B,QAAOC,SAAQC,aAChD,CAACX,EAAMS,EAAOC,EAAQC,IAEN,WAAfZ,EAAgC,KACjB,aAAfA,EAAkCsC,EAACC,EAAAA,IAA2B3C,EAAOK,KAAMA,IAG3EqC,EAACE,EAAAA,CAASC,mBAAoB,CAAC5C,GAAQA,MAAOA,GACzCE,EAAe2C,SAAS,SACrBJ,EAACK,EAAAA,CACG9C,MAAOS,EAAKsC,IAAI,uBAChBH,mBAAoB,CAAC,QACrBI,eAAgBlC,EAAOe,KACvBpB,KAAMA,EACNoB,KAAMD,EAAkB,gBAExBa,EAACQ,EAAAA,CACGpB,KAAMD,EAAkB,QACxBsB,MAAO9C,EAAKyB,KACZe,mBAAoB,CAAC,QACrBO,QAASd,EAAkB,SAC3Be,OAAQtB,EAAa,QACrBuB,YAAY,EACZC,aAAc,kBAKzBpD,EAAe2C,SAAS,uBACrBJ,EAACK,EAAAA,CACG9C,MAAOS,EAAKsC,IAAI,qCAChBH,mBAAoB,CAAC,sBACrBI,eAAgBlC,EAAOyC,mBACvB9C,KAAMA,EACNoB,KAAMD,EAAkB,uBAExBa,EAACQ,EAAAA,CACGpB,KAAMD,EAAkB,sBACxBsB,MAAO9C,EAAKmD,mBACZX,mBAAoB,CAAC,sBACrBO,QAASd,EAAkB,SAC3Be,OAAQtB,EAAa,QACrBuB,YAAY,EACZC,kBAAcE,KAMtC"}
|