@zonos/elements 1.3.141 → 1.3.143
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/{CheckoutConfig-165db6b6.js → CheckoutConfig-eaaf62a1.js} +1 -1
- package/dist/cjs/TaxId-4632639d.js +29 -0
- package/dist/cjs/{cart-e1b59d03.js → cart-6ac8dc06.js} +258 -8
- package/dist/cjs/{getBorderRadius-f72d8edf.js → getBorderRadius-f97c99ad.js} +1 -1
- package/dist/cjs/{handleFetch-4a90f091.js → handleFetch-864d3c53.js} +5 -5
- package/dist/cjs/{index-d56e0a8b.js → index-b678ce0c.js} +42 -8
- package/dist/cjs/index.cjs.js +12 -9
- package/dist/cjs/{isDarkColor-dd6d723b.js → isDarkColor-434d71dd.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{paypal-86cc51e4.js → paypal-ea8b4ca0.js} +5 -5
- package/dist/cjs/{zonos-address_7.cjs.entry.js → zonos-address_8.cjs.entry.js} +64 -9
- package/dist/cjs/zonos-badge.cjs.entry.js +2 -2
- package/dist/cjs/zonos-banner.cjs.entry.js +2 -2
- package/dist/cjs/zonos-button_3.cjs.entry.js +4 -4
- package/dist/cjs/zonos-card.cjs.entry.js +3 -3
- package/dist/cjs/zonos-cart-items_13.cjs.entry.js +33 -12
- package/dist/cjs/zonos-checkout.cjs.entry.js +9 -9
- package/dist/cjs/zonos-collapse.cjs.entry.js +2 -2
- package/dist/cjs/zonos-component.cjs.entry.js +2 -2
- package/dist/cjs/zonos-controller.cjs.entry.js +7 -7
- package/dist/cjs/zonos-country-flag.cjs.entry.js +6 -6
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +10 -10
- package/dist/cjs/zonos-elements.cjs.js +3 -3
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +10 -10
- package/dist/cjs/zonos-hello.cjs.entry.js +6 -6
- package/dist/cjs/zonos-input.cjs.entry.js +3 -3
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +6 -6
- package/dist/cjs/zonos-link.cjs.entry.js +1 -1
- package/dist/cjs/zonos-logo.cjs.entry.js +2 -2
- package/dist/cjs/zonos-notification_3.cjs.entry.js +9 -9
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +3 -3
- package/dist/cjs/zonos-text.cjs.entry.js +2 -2
- package/dist/cjs/zonos-toggle.cjs.entry.js +4 -4
- package/dist/cjs/zonos-tooltip.cjs.entry.js +3 -3
- package/dist/cjs/zonos-v-stack.cjs.entry.js +4 -4
- package/dist/cjs/{zonosStore-293bb3ba.js → zonosStore-8971eb65.js} +1 -1
- package/dist/collection/collection-manifest.json +3 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-currency-toggle/zonos-currency-toggle.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.css +3 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +22 -1
- package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +1 -1
- package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.css +162 -0
- package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.js +220 -0
- package/dist/collection/components/common/zonos-toggle/zonos-toggle.js +2 -2
- package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
- package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -2
- package/dist/collection/components/common/zonos-virtual-scroll/zonos-virtual-scroll.js +2 -2
- package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +2 -2
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +4 -4
- package/dist/collection/components/main/zonos-controller.js +1 -1
- package/dist/collection/components/paypal/zonos-paypal-payment.js +1 -1
- package/dist/collection/components/store/checkout/paypal.js +1 -1
- package/dist/collection/components/store/checkout/stripe.js +9 -1
- package/dist/collection/components/store/translationStore/strings.arabic.js +12 -0
- package/dist/collection/components/store/translationStore/strings.base.js +12 -0
- package/dist/collection/components/store/translationStore/strings.chinese.js +12 -0
- package/dist/collection/components/store/translationStore/strings.danish.js +12 -0
- package/dist/collection/components/store/translationStore/strings.dutch.js +12 -0
- package/dist/collection/components/store/translationStore/strings.french.js +12 -0
- package/dist/collection/components/store/translationStore/strings.german.js +12 -0
- package/dist/collection/components/store/translationStore/strings.hebrew.js +12 -0
- package/dist/collection/components/store/translationStore/strings.indonesian.js +12 -0
- package/dist/collection/components/store/translationStore/strings.italian.js +12 -0
- package/dist/collection/components/store/translationStore/strings.japanese.js +12 -0
- package/dist/collection/components/store/translationStore/strings.korean.js +12 -0
- package/dist/collection/components/store/translationStore/strings.norwegian.js +12 -0
- package/dist/collection/components/store/translationStore/strings.polish.js +12 -0
- package/dist/collection/components/store/translationStore/strings.portuguese.js +12 -0
- package/dist/collection/components/store/translationStore/strings.russian.js +12 -0
- package/dist/collection/components/store/translationStore/strings.spanish.js +12 -0
- package/dist/collection/components/store/translationStore/strings.swedish.js +12 -0
- package/dist/collection/components/store/translationStore/strings.turkish.js +12 -0
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +12 -0
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +1 -1
- package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +2 -2
- package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
- package/dist/collection/components/utils/api/getCountries.js +1 -1
- package/dist/collection/components/utils/api/getLocalization.js +1 -1
- package/dist/collection/components/utils/api/prepCalculateLandedCost.js +2 -0
- package/dist/collection/components/utils/handleFetch.js +2 -2
- package/dist/collection/components/utils/isValidSelector.js +1 -1
- package/dist/collection/components/utils/jsonParse.js +1 -1
- package/dist/collection/components/utils/logging/log.js +1 -1
- package/dist/collection/components/utils/logging/sendErrorLog.js +1 -1
- package/dist/collection/environment.js +1 -1
- package/dist/collection/types/checkout/TaxId.js +24 -0
- package/dist/collection/types/generated/graphql.internal.types.js +52 -0
- package/dist/collection/types/index.js +1 -0
- package/dist/collection/types/stripe/Apperance.js +0 -58
- package/dist/esm/{CheckoutConfig-930107d4.js → CheckoutConfig-262008fe.js} +1 -1
- package/dist/esm/TaxId-915ef042.js +26 -0
- package/dist/esm/{cart-709f053f.js → cart-acba54d0.js} +258 -8
- package/dist/esm/{getBorderRadius-bdd709e7.js → getBorderRadius-4aca63d4.js} +1 -1
- package/dist/esm/{handleFetch-22cb914b.js → handleFetch-badf4543.js} +5 -5
- package/dist/esm/{index-86b8247e.js → index-986b5ff2.js} +42 -8
- package/dist/esm/index.js +11 -10
- package/dist/esm/{isDarkColor-c6924924.js → isDarkColor-4915739f.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{paypal-77a60c44.js → paypal-3401f757.js} +5 -5
- package/dist/esm/{zonos-address_7.entry.js → zonos-address_8.entry.js} +64 -10
- package/dist/esm/zonos-badge.entry.js +2 -2
- package/dist/esm/zonos-banner.entry.js +2 -2
- package/dist/esm/zonos-button_3.entry.js +4 -4
- package/dist/esm/zonos-card.entry.js +3 -3
- package/dist/esm/zonos-cart-items_13.entry.js +33 -12
- package/dist/esm/zonos-checkout.entry.js +9 -9
- package/dist/esm/zonos-collapse.entry.js +2 -2
- package/dist/esm/zonos-component.entry.js +2 -2
- package/dist/esm/zonos-controller.entry.js +7 -7
- package/dist/esm/zonos-country-flag.entry.js +6 -6
- package/dist/esm/zonos-country-select_4.entry.js +10 -10
- package/dist/esm/zonos-elements.js +4 -4
- package/dist/esm/zonos-hello-dialog.entry.js +10 -10
- package/dist/esm/zonos-hello.entry.js +6 -6
- package/dist/esm/zonos-input.entry.js +3 -3
- package/dist/esm/zonos-language-select_2.entry.js +6 -6
- package/dist/esm/zonos-link.entry.js +1 -1
- package/dist/esm/zonos-logo.entry.js +2 -2
- package/dist/esm/zonos-notification_3.entry.js +9 -9
- package/dist/esm/zonos-shipping-rich-radio.entry.js +3 -3
- package/dist/esm/zonos-text.entry.js +2 -2
- package/dist/esm/zonos-toggle.entry.js +4 -4
- package/dist/esm/zonos-tooltip.entry.js +3 -3
- package/dist/esm/zonos-v-stack.entry.js +4 -4
- package/dist/esm/{zonosStore-c493c4fe.js → zonosStore-708637e7.js} +1 -1
- package/dist/esm-es5/{CheckoutConfig-930107d4.js → CheckoutConfig-262008fe.js} +1 -1
- package/dist/esm-es5/TaxId-915ef042.js +1 -0
- package/dist/esm-es5/cart-acba54d0.js +1 -0
- package/dist/esm-es5/{getBorderRadius-bdd709e7.js → getBorderRadius-4aca63d4.js} +1 -1
- package/dist/esm-es5/index-986b5ff2.js +2 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{isDarkColor-c6924924.js → isDarkColor-4915739f.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{paypal-77a60c44.js → paypal-3401f757.js} +1 -1
- package/dist/esm-es5/{zonos-address_7.entry.js → zonos-address_8.entry.js} +1 -1
- package/dist/esm-es5/zonos-badge.entry.js +1 -1
- package/dist/esm-es5/zonos-banner.entry.js +1 -1
- package/dist/esm-es5/zonos-button_3.entry.js +1 -1
- package/dist/esm-es5/zonos-card.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-collapse.entry.js +1 -1
- package/dist/esm-es5/zonos-component.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
- package/dist/esm-es5/zonos-elements.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-input.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-link.entry.js +1 -1
- package/dist/esm-es5/zonos-logo.entry.js +1 -1
- package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
- package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
- package/dist/esm-es5/zonos-text.entry.js +1 -1
- package/dist/esm-es5/zonos-toggle.entry.js +1 -1
- package/dist/esm-es5/zonos-tooltip.entry.js +1 -1
- package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
- package/dist/esm-es5/{zonosStore-c493c4fe.js → zonosStore-708637e7.js} +1 -1
- package/dist/scripts/index.d.ts +113 -9
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.d.ts +5 -0
- package/dist/types/components/common/zonos-stripe-input/zonos-stripe-input.d.ts +42 -0
- package/dist/types/components/store/checkout/cart.d.ts +2 -3
- package/dist/types/components/store/checkout/stripe.d.ts +10 -2
- package/dist/types/components/store/hello/localization.d.ts +0 -1
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.base.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.danish.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.french.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.german.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.italian.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.korean.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.polish.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.russian.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +12 -0
- package/dist/types/components/store/translationStore.d.ts +1 -1
- package/dist/types/components/store/zonosStore.d.ts +1 -1
- package/dist/types/components/utils/api/checkItemRestrictions.d.ts +3 -3
- package/dist/types/components/utils/api/getLocaleMessages.d.ts +3 -3
- package/dist/types/components/utils/changeDeepProperty.d.ts +2 -2
- package/dist/types/components/utils/changeDeepPropertyAtIndex.d.ts +2 -1
- package/dist/types/components/utils/createCustomEvent.d.ts +3 -3
- package/dist/types/components/utils/hello/detectItemRestrictions.d.ts +3 -3
- package/dist/types/components/utils/hello/getCurrentHelloLocalePage.d.ts +1 -1
- package/dist/types/components/utils/hello/initHello.d.ts +2 -2
- package/dist/types/components/utils/resetToSelectedTab.d.ts +1 -1
- package/dist/types/components.d.ts +102 -2
- package/dist/types/environment.d.ts +2 -2
- package/dist/types/scripts/_stripe.d.ts +1 -1
- package/dist/types/stencil-public-runtime.d.ts +6 -0
- package/dist/types/styles/stripe/defaultVariable.d.ts +1 -1
- package/dist/types/types/checkout/TaxId.d.ts +20 -0
- package/dist/types/types/checkout/api/CalculateLandedCost.d.ts +8 -0
- package/dist/types/types/generated/graphql.frontend.types.d.ts +1 -1
- package/dist/types/types/generated/graphql.frontend.types.ts +1 -1
- package/dist/types/types/generated/graphql.internal.types.d.ts +71 -109
- package/dist/types/types/generated/graphql.internal.types.ts +91 -98
- package/dist/types/types/global.d.ts +0 -5
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/stripe/Apperance.d.ts +1 -2
- package/dist/types/utils/formattedUrl.d.ts +1 -1
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-e205ef1c.system.entry.js → p-0197a9bf.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-b9efc660.entry.js → p-0ab29580.entry.js} +1 -1
- package/dist/zonos-elements/{p-6b0aa1bb.system.js → p-0b5c9f89.system.js} +1 -1
- package/dist/zonos-elements/{p-87ed2e17.system.entry.js → p-0b5f4ca7.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-289ded20.system.entry.js → p-0db28495.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-35b8dcde.entry.js → p-1198c874.entry.js} +1 -1
- package/dist/zonos-elements/p-12a6b7bd.system.js +1 -0
- package/dist/zonos-elements/{p-b7307c61.js → p-1460f917.js} +1 -1
- package/dist/zonos-elements/{p-9589bd08.entry.js → p-1e3ea4ae.entry.js} +1 -1
- package/dist/zonos-elements/p-21b538ea.system.js +1 -0
- package/dist/zonos-elements/{p-0fc96872.system.entry.js → p-2761ad55.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-bc8b22ad.entry.js → p-28295342.entry.js} +1 -1
- package/dist/zonos-elements/{p-22d69480.system.entry.js → p-2ab5e362.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f07c01c5.system.entry.js → p-2cfc00b8.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f8ca3e71.entry.js → p-302f5d25.entry.js} +1 -1
- package/dist/zonos-elements/{p-4319600a.system.entry.js → p-33e1d25e.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-10efff62.system.js → p-36dfc7ac.system.js} +1 -1
- package/dist/zonos-elements/{p-7a60deef.system.entry.js → p-381874b0.system.entry.js} +1 -1
- package/dist/zonos-elements/p-386325ae.system.js +1 -0
- package/dist/zonos-elements/{p-1c4ff7b2.system.entry.js → p-38d0c496.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-00d4bff1.entry.js → p-39cac2c1.entry.js} +1 -1
- package/dist/zonos-elements/{p-5c32689e.entry.js → p-3f991022.entry.js} +1 -1
- package/dist/zonos-elements/{p-9b59704a.entry.js → p-44dd4269.entry.js} +1 -1
- package/dist/zonos-elements/{p-edc16f69.js → p-4b685549.js} +1 -1
- package/dist/zonos-elements/{p-ad1d6ea2.entry.js → p-4c7f0417.entry.js} +1 -1
- package/dist/zonos-elements/{p-d633ced9.entry.js → p-54058b57.entry.js} +1 -1
- package/dist/zonos-elements/{p-ad4bc6a2.entry.js → p-545c05ce.entry.js} +1 -1
- package/dist/zonos-elements/p-5bd927f2.js +1 -0
- package/dist/zonos-elements/{p-01ad5be8.system.entry.js → p-654fc23d.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-5b90dd6d.entry.js → p-675f60b4.entry.js} +1 -1
- package/dist/zonos-elements/p-680d3694.js +2 -0
- package/dist/zonos-elements/{p-461624ce.system.entry.js → p-6a8862a6.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-10d6fe23.js → p-766dd01f.js} +1 -1
- package/dist/zonos-elements/{p-3dd503fd.system.entry.js → p-78e4f877.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-7ef573f0.entry.js → p-7c5c0a85.entry.js} +1 -1
- package/dist/zonos-elements/{p-bb418544.system.js → p-7c643376.system.js} +1 -1
- package/dist/zonos-elements/{p-ffe4a999.system.entry.js → p-8ac02349.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-25c7e4fa.system.entry.js → p-8e30228d.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-be2feba6.entry.js → p-8f26cc7e.entry.js} +1 -1
- package/dist/zonos-elements/{p-fce202ab.entry.js → p-9306a835.entry.js} +1 -1
- package/dist/zonos-elements/{p-04a6a167.entry.js → p-9d7a860c.entry.js} +1 -1
- package/dist/zonos-elements/p-9da2d116.entry.js +1 -0
- package/dist/zonos-elements/{p-cd1fd09e.entry.js → p-9dec2b74.entry.js} +1 -1
- package/dist/zonos-elements/{p-cf72603f.system.entry.js → p-9e84f647.system.entry.js} +1 -1
- package/dist/zonos-elements/p-a08ea336.js +1 -0
- package/dist/zonos-elements/{p-ee1e1d94.system.entry.js → p-a13d5957.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-dc09df19.system.entry.js → p-a2bce31d.system.entry.js} +1 -1
- package/dist/zonos-elements/p-a4f045d4.js +17 -0
- package/dist/zonos-elements/{p-f2867195.entry.js → p-ab6973a5.entry.js} +1 -1
- package/dist/zonos-elements/{p-d10ffd69.js → p-b0174a8f.js} +1 -1
- package/dist/zonos-elements/{p-8368a79e.entry.js → p-b2ea7adb.entry.js} +1 -1
- package/dist/zonos-elements/{p-fd061229.system.js → p-b50667b6.system.js} +1 -1
- package/dist/zonos-elements/{p-46a5ec52.system.js → p-c0164a3c.system.js} +1 -1
- package/dist/zonos-elements/p-c437d76c.system.js +1 -0
- package/dist/zonos-elements/{p-64a04391.system.entry.js → p-d1afd314.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-7acf6802.entry.js → p-d3867033.entry.js} +1 -1
- package/dist/zonos-elements/{p-896ab1ed.system.entry.js → p-d5a3851d.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-0c027d2e.entry.js → p-d9511c4a.entry.js} +1 -1
- package/dist/zonos-elements/{p-010f5797.system.entry.js → p-dba6147b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-896d62a4.system.entry.js → p-df9c0bfa.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-0aee2e4c.system.entry.js → p-e6554a6f.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-c78dd680.system.js → p-e9964a5a.system.js} +1 -1
- package/dist/zonos-elements/{p-b832ec52.entry.js → p-f2d07062.entry.js} +1 -1
- package/dist/zonos-elements/{p-8f9affb3.system.entry.js → p-f9aef1fc.system.entry.js} +1 -1
- package/dist/zonos-elements/p-fa538a74.system.entry.js +1 -0
- package/dist/zonos-elements/{p-3a26cae5.entry.js → p-fc4658a6.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/dist/zonos-elements/zonos-elements.js +1 -1
- package/package.json +68 -67
- package/dist/collection/__mocks__/vercel-app/loadZonos.js +0 -492
- package/dist/collection/__mocks__/vercel-app/localization.js +0 -1
- package/dist/collection/__mocks__/vercel-app/zonos-hello.entry.js +0 -1
- package/dist/collection/__mocks__/zonos-url/index.js +0 -1
- package/dist/collection/__mocks__/zonos-url/loadZonos.js +0 -492
- package/dist/collection/__mocks__/zonos-url/localization.js +0 -2899
- package/dist/collection/__mocks__/zonos-url/zonos-hello.entry.js +0 -1
- package/dist/esm-es5/cart-709f053f.js +0 -1
- package/dist/esm-es5/index-86b8247e.js +0 -2
- package/dist/zonos-elements/p-49e4ca08.system.entry.js +0 -1
- package/dist/zonos-elements/p-5b7da777.js +0 -2
- package/dist/zonos-elements/p-6b6cd6c3.system.js +0 -1
- package/dist/zonos-elements/p-a58731ec.system.js +0 -1
- package/dist/zonos-elements/p-afffdfc2.js +0 -1
- package/dist/zonos-elements/p-d35376d3.js +0 -17
- package/dist/zonos-elements/p-e6c31531.entry.js +0 -1
- package/dist/zonos-elements/p-f8e8b50e.system.js +0 -1
- /package/dist/esm-es5/{handleFetch-22cb914b.js → handleFetch-badf4543.js} +0 -0
- /package/dist/zonos-elements/{p-860e46ab.js → p-a5b294d7.js} +0 -0
- /package/dist/zonos-elements/{p-febc72e7.system.js → p-bfcfd29b.system.js} +0 -0
package/dist/scripts/zonos.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";const e=performance.now(),o=e=>{if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(o){if(e&&"function"==typeof e.toString){return e.toString()}return"Unable to stringify info"}},t=(t,n,...r)=>{var s,i;const{elapsedTimePretty:a}=(()=>{const o=performance.now()-e,t=o>1e3?`${(o/1e3).toFixed(2)}s`:`${o.toFixed(2)}ms`;return{elapsedTime:o,elapsedTimePretty:t}})(),c=[`(${a})`,...r];c.map(o).join(" ");if(!(!!(null===(s=window.Zonos)||void 0===s?void 0:s.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===n&&console.error(t,...c));let l=document.querySelector("iframe#zonos---debug-logging-iframe");l||(l=document.createElement("iframe"),l.id="zonos---debug-logging-iframe",l.style.display="none",l.style.opacity="0",l.style.position="absolute",l.style.top="-9999px",l.style.left="-9999px",l.style.width="1px",l.style.height="1px",l.style.border="none",l.style.overflow="hidden",l.style.visibility="hidden",document.body.appendChild(l));const d=(null===(i=l.contentWindow)||void 0===i?void 0:i.window.console)||window.console;switch(n){case"warn":d.warn(t,...c);break;case"info":d.info(t,...c);break;case"error":d.error(t,...c);break;default:d.groupCollapsed(t,...c),d.trace(),d.groupEnd()}},n=(e,...o)=>{t(e,"error",...o)},r=["jsdelivr","cdnjs","unpkg","vercel"],s="jsdelivr",i=e=>{const o=r.indexOf(e);return r[o+1]||null};function a(e,o){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)o.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(t[n[r]]=e[n[r]])}return t}"function"==typeof SuppressedError&&SuppressedError;const c=["cloudflare","vercel"],l=c[0],d={cloudflare:"https://route.elements.zonos.com",vercel:"https://route.js.zonos.com"},u=d[l],p=(e=l)=>{const o=c.indexOf(e),t=c[o+1];return t||null},m=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){return null}return null},w=async({response:e,shouldLog:o=!0,shouldThrow:t=!1})=>{try{const o=await e.text(),t=m(o);if(!t)throw new Error(`Failed to parse content: ${o}`);return t}catch(e){if(t)throw e;return o&&console.error(e),null}},h=async({basePathType:e,options:o,path:t})=>{let n;const r=window.Zonos.zonosQaUrlApi||d[e]||l,s=new URL(r+t),i=window.Zonos.cartId?`${window.location.hostname}-${window.Zonos.cartId}`:window.location.hostname;s.searchParams.set("zToken",(e=>{try{return btoa(e).replace(/=/g,"")}catch(o){return e.replace(/[^A-Za-z0-9]/g,"").split("").reverse().join("")}})(i));try{n=await fetch(s.toString(),o)}catch(e){if(e instanceof Error)return{baseUrl:r,errors:[{message:e.message,type:"unknown"}],json:null,response:null,zonosMode:null};return{baseUrl:r,errors:[{message:"Failed to fetch",type:"unknown"}],json:null,response:null,zonosMode:null}}const a=n.headers.get("Zonos-Mode"),c=window.Zonos.zonosQaUrl;if(!window.Zonos.modeAlerted&&a&&c&&(window.Zonos.modeAlerted=!0),n.ok){return{baseUrl:r,errors:[],json:await w({response:n}),response:n,zonosMode:a}}const u=n.status.toString();try{const e=await w({response:n,shouldThrow:!0});return{baseUrl:r,errors:[{message:JSON.stringify(e),type:u}],json:null,response:n,zonosMode:a}}catch(e){return{baseUrl:r,errors:[{message:`${u}: ${"Unknown error"}`,type:u}],json:null,response:null,zonosMode:a}}},y=async({basePathType:e,options:o,path:n})=>{var r,s;const i=n.startsWith("/api/bigcommerce")?"vercel":e,c=await h({basePathType:i,options:o,path:n}),{errors:l,response:w}=c,f=a(c,["errors","response"]),g=p(i),v=!!l.find((({type:e})=>"unknown"===e))||404===(null==w?void 0:w.status),b=g&&v;return v&&(async({endpoint:e,errors:o,metadata:n,shouldPostReleaseErrorReporting:r})=>{if(t("sendErrorLog","warn",e,n,o),r){const e=Number(window.Zonos.releaseDate);if((new Date).getTime()-e>36e5)return}const s="userAgentData"in window.navigator?window.navigator.userAgentData:null,i={endpoint:e,errors:o,href:window.location.href,metadata:Object.assign({appVersion:window.Zonos.version,domain:window.Zonos.domain,publicCredential:window.Zonos.zonosApiKey,userAgent:s&&s.brands.length>0?s:window.navigator.userAgent},n)};try{fetch(`${u}/api/zonos-elements/log-error`,{body:JSON.stringify(i),headers:{"Zonos-Referer":window.location.hostname},method:"POST"})}catch(e){const o=p();if(!o)return;fetch(`${d[o]}/api/zonos-elements/log-error`,{body:JSON.stringify(i),method:"POST"})}})({endpoint:d[i]+n,errors:l.map((({message:e})=>`API: ${e}`)),metadata:{currentBasePath:i,nextFallbackApiType:g,requestHeaders:null==o?void 0:o.headers,requestPayload:m(null===(r=null==o?void 0:o.body)||void 0===r?void 0:r.toString())||(null===(s=null==o?void 0:o.body)||void 0===s?void 0:s.toString()),status:null==w?void 0:w.status,statusText:null==w?void 0:w.statusText},shouldPostReleaseErrorReporting:!0}),b?(t(`=== "${n}" failed to fetch, trying next fallback ${g}`),y({basePathType:g,options:o,path:n})):Object.assign({errors:l,response:w},f)},f=async(e,o)=>{const n=a(o||{},[]),r=n.body?JSON.stringify(n.body):void 0,s=n.method||"GET",i=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey||"Empty credential token from zonos-elements"},n.headers),c=Object.assign(Object.assign({},n),{body:"GET"===s?void 0:r,headers:i,method:s}),d=new URLSearchParams(window.location.search).get("useFallbackApi");return t(e,"info"),y({basePathType:d||l,options:c,path:e})},g=()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const o=(e=>{if(!e)return null;const o=new URL(e).searchParams.get("zonosQaUrl");return o?/[^a-zA-Z0-9-_]+/.test(o)?null:o:null})(window.location.href),n="https://v1.3.141.js.zonos.com";if(!o&&(n.includes("test.")||n.includes("test-")))return n;if(!o&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!o)return null;if("dev-elements"===o)return"https://dev.elements.zonos.com";const r=`https://${o}.preview.js.zonos.com`;return t(`[ZONOS-WARNING] using '${r}' for loading elements script`,"warn"),fetch(r).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${r}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:o}=window.location,t=`${o}?${e.toString()}`;return window.history.replaceState(window.history.state,"",t),window.location.reload(),null})),r},v="https://js.stripe.com/v3",b=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,S="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let z=null;const j=e=>(null!==z||(z=new Promise(((o,t)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(S),window.Stripe)o(window.Stripe);else try{let r=(()=>{const e=document.querySelectorAll(`script[src^="${v}"]`);for(let o=0;o<e.length;o++){const t=e[o];if(t&&b.test(t.src))return t}return null})();r&&e?console.warn(S):r||(r=(e=>{const o=document.createElement("script");o.src=`${v}`;const t=document.head||document.body;return t?(t.appendChild(o),o):(n("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})()),null==r||r.addEventListener("load",(()=>{window.Stripe?o(window.Stripe):t(new Error("Stripe.js not available"))})),null==r||r.addEventListener("error",(()=>{t(new Error("Failed to load Stripe.js"))}))}catch(e){return void t(e)}else o(null)}))),z),C=Promise.resolve().then((()=>j(null)));let O=!1;C.catch((e=>{O||console.warn(e)}));const Z=async({cartId:e,retries:o})=>{const n="1"===new URLSearchParams(window.location.search).get("zonosTestMode"),{errors:r,json:s}=await f("/api/zonos-elements/get-temp-cart",{body:{isTestMode:n,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),i=!s||r.length;return i&&o?(t("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:o}),await new Promise((e=>setTimeout(e,500))),Z({cartId:e,retries:o-1})):i?null:s},k=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/,I=new RegExp(`^${k.source}$`),E=new RegExp(`^cart_${k.source}$`),A=async e=>{const{isDgsCartId:o,isLegacyCartId:r}=(e=>e?E.test(e)?{isDgsCartId:!0,isLegacyCartId:!1}:I.test(e)?{isDgsCartId:!1,isLegacyCartId:!0}:{isDgsCartId:!1,isLegacyCartId:!1}:{isDgsCartId:!1,isLegacyCartId:!1})(e);if(!r&&!o)return n("[ZONOS - loadZonos] invalid cart id"),null;const s=await Z({cartId:e,retries:5});return t("[ZONOS - loadZonos] getting temp cart data","info",s),s?(window.Zonos.storeId=s.cartData.storeId,window.Zonos.zonosApiKey=s.cartData.credentialToken,{cartData:s.cartData,storeFavicon:s.storeFaviconUrl,storeId:s.cartData.storeId,storeLogo:s.storeLogoUrl,zonosApiKey:s.cartData.credentialToken}):(n("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)};var L;const T=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:o,isWhiteListed:t}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const o=new URL(e).origin,t=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>o.includes(e))),n=["qa.js.zonos.com"].some((e=>o.includes(e)));return{currentLoadScriptUrl:o,isForceLoadVersionDomain:n,isWhiteListed:t}})({loadScriptSrc:null==e?void 0:e.src});return t?o:null})(),N="https://v1.3.141.js.zonos.com",$=T||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.141",U="https://fonts.googleapis.com",P=/^https:\/\/fonts\.googleapis\.com/;class D{}L=D,D.doneInit=!1,D.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),D.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),D._paypalMockResponse=null,D.isBigCommerce=!1,D.releaseDate="1734130633682",D.isLegacyCheckout=!1,D.domain="undefined"!=typeof window?window.location!=window.parent.location&&document.referrer||document.location.hostname:"",D.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),D.isNpm=!0,D.zonosQaUrl=null,D.zonosQaUrlApi=null,D.version="v1.3.141",D.modeAlerted=!1,D.cartData=null,D.paypal=null,D.getCurrentTimestamp=()=>(new Date).getTime(),D.zonosController=null,D.init=async e=>{const{appearance:o,checkoutSettings:r,currencyConverter:s,helloSettings:i,onCountryChange:a,overrideCurrencyFormat:c,storeId:l,zonosApiKey:d}=e;if(L.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),L.doneInit)return;if(t(`====== ZONOS DEBUG MODE: on (${L.version}) ======`),L.zonosApiKey=d,L.storeId=l,L.isNpm){t("====== ZONOS LOADING FROM NPM ======");const o=g();if(o&&!window.isZonosPreview){t(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${o} ======`,"info");const n=document.createElement("script");return n.src=`${o}/dist/scripts/zonos.js`,document.head.appendChild(n),n.addEventListener("load",(()=>{window.Zonos.isNpm=L.isNpm,window.Zonos.isBigCommerce=L.isBigCommerce,window.Zonos.isLegacyCheckout=L.isLegacyCheckout,window.Zonos.init(e)})),n.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${o}`)})),void(window.isZonosPreview=!0)}if(!d&&!L.cartId)return void n("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!L.cartData&&L.cartId){t("Initialize cart data");const e=await A(L.cartId);if(!e)return void n("Failed to get cart data");L.cartData=e.cartData,L.zonosApiKey=e.zonosApiKey}const r=await(async()=>{if(!window.location.search.includes("zonosTestMode=1")||!window.Zonos.zonosApiKey)return null;if(t("[ZONOS - loadZonos] Attempt test public credential","info"),window.Zonos.zonosApiKey.includes("credential_test"))return t("[ZONOS - loadZonos] Test mode is enabled but the API key is already a test key","info"),null;const{errors:e,json:o}=await f("/api/get-test-public-credential");if(e.length||!o)return n("[ZONOS - loadZonos] Failed to get test public credential. Keep using production key",e),null;const r=o.publicCredential;return r?(t(`[ZONOS - loadZonos] Retrieve new test public token ${r}`,"info"),r):(n("[ZONOS - loadZonos] No test public key credential. Keep using production key"),null)})();r&&(L.zonosApiKey=r)}const u=new URL(window.location.href).searchParams.get("payment_intent_client_secret")||sessionStorage.getItem("zonos--client-secret");if(L.cartId&&L.cartData||!!u){t("Cart data or stripe client secret is available, inject hidden button and trigger checkout");const e=document.createElement("button");e.style.display="none",e.id="zonos--checkout-hidden-button",document.body.appendChild(e)}t("init zonos"),L.injectCustomScriptForHostedCheckout(),L.injectZonosCdn(),L.injectZonosCss(),L.injectFonts(),L.injectController({config:{appearance:o,checkoutSettings:r,currencyConverter:s,helloSettings:i,onCountryChange:a,overrideCurrencyFormat:c}}),L.doneInit=!0},D.injectCustomScriptForHostedCheckout=()=>{const e=L.cartData,o=(null==e?void 0:e.metadata)||[],n=o.find((e=>"customHeaderScript"===e.key)),r=o.find((e=>"customFooterScript"===e.key));if(window.Zonos.isLegacyCheckout&&(n||r)){if(n){t("Injecting custom header script");const e=document.createElement("script");e.textContent=n.value,document.head.appendChild(e)}if(r){t("Injecting custom footer script");const e=document.createElement("script");e.textContent=r.value,document.body.appendChild(e)}}else t("Skip injecting custom script for hosted checkout","info",{footerScript:r,headerScript:n,isLegacyCheckout:window.Zonos.isLegacyCheckout})},D.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},D.openHelloDialog=e=>{const o=document.querySelector("zonos-hello");o&&o.openHelloDialog(null==e||e)},D.showNotification=e=>{var o;null===(o=L.zonosController)||void 0===o||o.showNotification(e)},D.updateOrganizationName=e=>{var o;null===(o=L.zonosController)||void 0===o||o.updateOrganizationName(e)},D.disablePlaceOrderButtons=({autoEnable:e=!0,config:o,disable:t,placeOrderButtonSelector:n})=>{var r;if(!(null===(r=o.checkoutSettings)||void 0===r?void 0:r.disablePlaceOrderButtonActivation)&&n){const o=document.querySelectorAll(n),r=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};o.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(t?(e.setAttribute("disabled","true"),e.addEventListener("click",r)):(e.removeAttribute("disabled"),e.removeEventListener("click",r)))})),e&&t&&setTimeout((()=>{o.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",r)}))}),5e3)}},D.injectController=({config:e})=>{var o;if(document.querySelector("zonos-controller"))return;if(null===(o=e.checkoutSettings)||void 0===o?void 0:o.placeOrderButtonSelector){const o=e.checkoutSettings.placeOrderButtonSelector;L.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:o});new MutationObserver((()=>{L.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:o})})).observe(document.body,{childList:!0,subtree:!0})}const r=document.createElement("zonos-controller");r.config=e,r.zonosApiKey=L.zonosApiKey||"",r.addEventListener("stripeInitEvent",(async e=>{const{detail:o}=e;t("loading Stripe");const s=await(async(...e)=>{O=!0;const o=Date.now();return C.then((t=>((e,o,t)=>{if(null===e)return null;const n=e.apply(void 0,o);return((e,o)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:o})})(n,t),n})(t,e,o)))})(o.publishableKey);s?(window.Zonos.stripe=s,r.initCheckoutElement(s)):n("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(r),L.zonosController=r,t("Zonos controller injected!")},D.injectScript=({cdnType:e,isModule:o,theRestUrl:r})=>{const s=`${L.getZonosUrl(e)}/${r}`;if(document.querySelector(`script[src="${s}"]`))return void t(`Zonos script "${s}" already exists in the document`,"warn");const a=document.head||document.body,c=document.createElement("script");o?c.type="module":c.noModule=!0,c.src=s,c.crossOrigin="anonymous",c.onerror=()=>{n(`Failed to load ${c.src}`);const t=i(e);t&&L.injectScript({cdnType:t,isModule:o,theRestUrl:r})},a.appendChild(c)},D.getZonosUrl=e=>{const o=()=>{switch(e){case"jsdelivr":return $;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.141";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.141";case"vercel":return N}};if(L.isNpm){return g()||o()}return o()},D.injectZonosCdn=()=>{L.injectScript({cdnType:s,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),L.injectScript({cdnType:s,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),t("Zonos cdn script injected!")},D.injectStylesheet=({cdnType:e,theRestUrl:o})=>{const t=L.getZonosUrl(e),r=document.head||document.body,s=document.createElement("link");s.rel="preconnect",s.href=`${N}/`,r.appendChild(s);const a=document.createElement("link");a.rel="stylesheet",a.href=`${t}/${o}`,a.onerror=()=>{n(`Failed to load ${a.href}`);const t=i(e);t&&L.injectStylesheet({cdnType:t,theRestUrl:o})},r.appendChild(a)},D.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?t("Zonos style links already injected","warn"):(L.injectStylesheet({cdnType:s,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),t("Zonos style css injected!"))},D.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${U}"]`);for(let o=0;o<e.length;o++){const t=e[o];if(t&&!P.test(t.href))return t}return null})())return void t("Inter font already injected","warn");const e=document.head||document.body,o=document.createElement("link");o.rel="preconnect",o.href=U,e.appendChild(o);const n=document.createElement("link");n.rel="stylesheet",n.href=`${U}/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap`,e.appendChild(n),t("Zonos font injected!")},D.setupGoogleFont=e=>{var o;null===(o=L.zonosController)||void 0===o||o.setupGoogleFont(e)},D.injectSupportGoogleFont=e=>{var o;t(`[FONT] injecting ${e}`);const n=null===(o=e.match(/family=(.*?):/))||void 0===o?void 0:o[1],r=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${U}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=U,r.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void t(`[FONT] ${n} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=e,r.appendChild(s),t(`[FONT] ${n} font injected!`)},window.Zonos&&window.Zonos.doneInit||(window.Zonos=D)})();
|
|
1
|
+
(function(){"use strict";const e=performance.now(),o=e=>{if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(o){if(e&&"function"==typeof e.toString){return e.toString()}return"Unable to stringify info"}},t=(t,n,...r)=>{var s,i;const{elapsedTimePretty:a}=(()=>{const o=performance.now()-e,t=o>1e3?`${(o/1e3).toFixed(2)}s`:`${o.toFixed(2)}ms`;return{elapsedTime:o,elapsedTimePretty:t}})(),c=[`(${a})`,...r];c.map(o).join(" ");if(!(!!(null===(s=window.Zonos)||void 0===s?void 0:s.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===n&&console.error(t,...c));let l=document.querySelector("iframe#zonos---debug-logging-iframe");l||(l=document.createElement("iframe"),l.id="zonos---debug-logging-iframe",l.style.display="none",l.style.opacity="0",l.style.position="absolute",l.style.top="-9999px",l.style.left="-9999px",l.style.width="1px",l.style.height="1px",l.style.border="none",l.style.overflow="hidden",l.style.visibility="hidden",document.body.appendChild(l));const d=(null===(i=l.contentWindow)||void 0===i?void 0:i.window.console)||window.console;switch(n){case"warn":d.warn(t,...c);break;case"info":d.info(t,...c);break;case"error":d.error(t,...c);break;default:d.groupCollapsed(t,...c),d.trace(),d.groupEnd()}},n=(e,...o)=>{t(e,"error",...o)},r=["jsdelivr","cdnjs","unpkg","vercel"],s="jsdelivr",i=e=>{const o=r.indexOf(e);return r[o+1]||null};function a(e,o){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)o.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(t[n[r]]=e[n[r]])}return t}"function"==typeof SuppressedError&&SuppressedError;const c=["cloudflare","vercel"],l=c[0],d={cloudflare:"https://route.elements.zonos.com",vercel:"https://route.js.zonos.com"},u=d[l],p=(e=l)=>{const o=c.indexOf(e),t=c[o+1];return t||null},m=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){return null}return null},w=async({response:e,shouldLog:o=!0,shouldThrow:t=!1})=>{try{const o=await e.text(),t=m(o);if(!t)throw new Error(`Failed to parse content: ${o}`);return t}catch(e){if(t)throw e;return o&&console.error(e),null}},h=async({basePathType:e,options:o,path:t})=>{let n;const r=window.Zonos.zonosQaUrlApi||d[e]||l,s=new URL(r+t),i=window.Zonos.cartId?`${window.location.hostname}-${window.Zonos.cartId}`:window.location.hostname;s.searchParams.set("zToken",(e=>{try{return btoa(e).replace(/=/g,"")}catch(o){return e.replace(/[^A-Za-z0-9]/g,"").split("").reverse().join("")}})(i));try{n=await fetch(s.toString(),o)}catch(e){if(e instanceof Error)return{baseUrl:r,errors:[{message:e.message,type:"unknown"}],json:null,response:null,zonosMode:null};return{baseUrl:r,errors:[{message:"Failed to fetch",type:"unknown"}],json:null,response:null,zonosMode:null}}const a=n.headers.get("Zonos-Mode"),c=window.Zonos.zonosQaUrl;if(!window.Zonos.modeAlerted&&a&&c&&(window.Zonos.modeAlerted=!0),n.ok){return{baseUrl:r,errors:[],json:await w({response:n}),response:n,zonosMode:a}}const u=n.status.toString();try{const e=await w({response:n,shouldThrow:!0});return{baseUrl:r,errors:[{message:JSON.stringify(e),type:u}],json:null,response:n,zonosMode:a}}catch(e){return{baseUrl:r,errors:[{message:`${u}: ${"Unknown error"}`,type:u}],json:null,response:null,zonosMode:a}}},y=async({basePathType:e,options:o,path:n})=>{var r,s;const i=n.startsWith("/api/bigcommerce")?"vercel":e,c=await h({basePathType:i,options:o,path:n}),{errors:l,response:w}=c,f=a(c,["errors","response"]),g=p(i),v=!!l.find((({type:e})=>"unknown"===e))||404===(null==w?void 0:w.status),b=g&&v;return v&&(async({endpoint:e,errors:o,metadata:n,shouldPostReleaseErrorReporting:r})=>{if(t("sendErrorLog","warn",e,n,o),r){const e=Number(window.Zonos.releaseDate);if((new Date).getTime()-e>36e5)return}const s="userAgentData"in window.navigator?window.navigator.userAgentData:null,i={endpoint:e,errors:o,href:window.location.href,metadata:Object.assign({appVersion:window.Zonos.version,domain:window.Zonos.domain,publicCredential:window.Zonos.zonosApiKey,userAgent:s&&s.brands.length>0?s:window.navigator.userAgent},n)};try{fetch(`${u}/api/zonos-elements/log-error`,{body:JSON.stringify(i),headers:{"Zonos-Referer":window.location.hostname},method:"POST"})}catch(e){const o=p();if(!o)return;fetch(`${d[o]}/api/zonos-elements/log-error`,{body:JSON.stringify(i),method:"POST"})}})({endpoint:d[i]+n,errors:l.map((({message:e})=>`API: ${e}`)),metadata:{currentBasePath:i,nextFallbackApiType:g,requestHeaders:null==o?void 0:o.headers,requestPayload:m(null===(r=null==o?void 0:o.body)||void 0===r?void 0:r.toString())||(null===(s=null==o?void 0:o.body)||void 0===s?void 0:s.toString()),status:null==w?void 0:w.status,statusText:null==w?void 0:w.statusText},shouldPostReleaseErrorReporting:!0}),b?(t(`=== "${n}" failed to fetch, trying next fallback ${g}`),y({basePathType:g,options:o,path:n})):Object.assign({errors:l,response:w},f)},f=async(e,o)=>{const n=a(o||{},[]),r=n.body?JSON.stringify(n.body):void 0,s=n.method||"GET",i=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey||"Empty credential token from zonos-elements"},n.headers),c=Object.assign(Object.assign({},n),{body:"GET"===s?void 0:r,headers:i,method:s}),d=new URLSearchParams(window.location.search).get("useFallbackApi");return t(e,"info"),y({basePathType:d||l,options:c,path:e})},g=()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const o=(e=>{if(!e)return null;const o=new URL(e).searchParams.get("zonosQaUrl");return o?/[^a-zA-Z0-9-_]+/.test(o)?null:o:null})(window.location.href),n="https://v1.3.143.js.zonos.com";if(!o&&(n.includes("test.")||n.includes("test-")))return n;if(!o&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!o)return null;if("dev-elements"===o)return"https://dev.elements.zonos.com";const r=`https://${o}.preview.js.zonos.com`;return t(`[ZONOS-WARNING] using '${r}' for loading elements script`,"warn"),fetch(r).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${r}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:o}=window.location,t=`${o}?${e.toString()}`;return window.history.replaceState(window.history.state,"",t),window.location.reload(),null})),r},v="https://js.stripe.com/v3",b=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,S="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let z=null;const j=e=>(null!==z||(z=new Promise(((o,t)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(S),window.Stripe)o(window.Stripe);else try{let r=(()=>{const e=document.querySelectorAll(`script[src^="${v}"]`);for(let o=0;o<e.length;o++){const t=e[o];if(t&&b.test(t.src))return t}return null})();r&&e?console.warn(S):r||(r=(e=>{const o=document.createElement("script");o.src=`${v}`;const t=document.head||document.body;return t?(t.appendChild(o),o):(n("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})()),null==r||r.addEventListener("load",(()=>{window.Stripe?o(window.Stripe):t(new Error("Stripe.js not available"))})),null==r||r.addEventListener("error",(()=>{t(new Error("Failed to load Stripe.js"))}))}catch(e){return void t(e)}else o(null)}))),z),C=Promise.resolve().then((()=>j(null)));let O=!1;C.catch((e=>{O||console.warn(e)}));const Z=async({cartId:e,retries:o})=>{const n="1"===new URLSearchParams(window.location.search).get("zonosTestMode"),{errors:r,json:s}=await f("/api/zonos-elements/get-temp-cart",{body:{isTestMode:n,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),i=!s||r.length;return i&&o?(t("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:o}),await new Promise((e=>setTimeout(e,500))),Z({cartId:e,retries:o-1})):i?null:s},k=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/,I=new RegExp(`^${k.source}$`),E=new RegExp(`^cart_${k.source}$`),A=async e=>{const{isDgsCartId:o,isLegacyCartId:r}=(e=>e?E.test(e)?{isDgsCartId:!0,isLegacyCartId:!1}:I.test(e)?{isDgsCartId:!1,isLegacyCartId:!0}:{isDgsCartId:!1,isLegacyCartId:!1}:{isDgsCartId:!1,isLegacyCartId:!1})(e);if(!r&&!o)return n("[ZONOS - loadZonos] invalid cart id"),null;const s=await Z({cartId:e,retries:5});return t("[ZONOS - loadZonos] getting temp cart data","info",s),s?(window.Zonos.storeId=s.cartData.storeId,window.Zonos.zonosApiKey=s.cartData.credentialToken,{cartData:s.cartData,storeFavicon:s.storeFaviconUrl,storeId:s.cartData.storeId,storeLogo:s.storeLogoUrl,zonosApiKey:s.cartData.credentialToken}):(n("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)};var L;const T=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:o,isWhiteListed:t}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const o=new URL(e).origin,t=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>o.includes(e))),n=["qa.js.zonos.com"].some((e=>o.includes(e)));return{currentLoadScriptUrl:o,isForceLoadVersionDomain:n,isWhiteListed:t}})({loadScriptSrc:null==e?void 0:e.src});return t?o:null})(),N="https://v1.3.143.js.zonos.com",$=T||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.143",U="https://fonts.googleapis.com",P=/^https:\/\/fonts\.googleapis\.com/;class D{}L=D,D.doneInit=!1,D.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),D.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),D._paypalMockResponse=null,D.isBigCommerce=!1,D.releaseDate="1734972995904",D.isLegacyCheckout=!1,D.domain="undefined"!=typeof window?window.location!=window.parent.location&&document.referrer||document.location.hostname:"",D.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),D.isNpm=!0,D.zonosQaUrl=null,D.zonosQaUrlApi=null,D.version="v1.3.143",D.modeAlerted=!1,D.cartData=null,D.paypal=null,D.getCurrentTimestamp=()=>(new Date).getTime(),D.zonosController=null,D.init=async e=>{const{appearance:o,checkoutSettings:r,currencyConverter:s,helloSettings:i,onCountryChange:a,overrideCurrencyFormat:c,storeId:l,zonosApiKey:d}=e;if(L.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),L.doneInit)return;if(t(`====== ZONOS DEBUG MODE: on (${L.version}) ======`),L.zonosApiKey=d,L.storeId=l,L.isNpm){t("====== ZONOS LOADING FROM NPM ======");const o=g();if(o&&!window.isZonosPreview){t(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${o} ======`,"info");const n=document.createElement("script");return n.src=`${o}/dist/scripts/zonos.js`,document.head.appendChild(n),n.addEventListener("load",(()=>{window.Zonos.isNpm=L.isNpm,window.Zonos.isBigCommerce=L.isBigCommerce,window.Zonos.isLegacyCheckout=L.isLegacyCheckout,window.Zonos.init(e)})),n.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${o}`)})),void(window.isZonosPreview=!0)}if(!d&&!L.cartId)return void n("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!L.cartData&&L.cartId){t("Initialize cart data");const e=await A(L.cartId);if(!e)return void n("Failed to get cart data");L.cartData=e.cartData,L.zonosApiKey=e.zonosApiKey}const r=await(async()=>{if(!window.location.search.includes("zonosTestMode=1")||!window.Zonos.zonosApiKey)return null;if(t("[ZONOS - loadZonos] Attempt test public credential","info"),window.Zonos.zonosApiKey.includes("credential_test"))return t("[ZONOS - loadZonos] Test mode is enabled but the API key is already a test key","info"),null;const{errors:e,json:o}=await f("/api/get-test-public-credential");if(e.length||!o)return n("[ZONOS - loadZonos] Failed to get test public credential. Keep using production key",e),null;const r=o.publicCredential;return r?(t(`[ZONOS - loadZonos] Retrieve new test public token ${r}`,"info"),r):(n("[ZONOS - loadZonos] No test public key credential. Keep using production key"),null)})();r&&(L.zonosApiKey=r)}const u=new URL(window.location.href).searchParams.get("payment_intent_client_secret")||sessionStorage.getItem("zonos--client-secret");if(L.cartId&&L.cartData||!!u){t("Cart data or stripe client secret is available, inject hidden button and trigger checkout");const e=document.createElement("button");e.style.display="none",e.id="zonos--checkout-hidden-button",document.body.appendChild(e)}t("init zonos"),L.injectCustomScriptForHostedCheckout(),L.injectZonosCdn(),L.injectZonosCss(),L.injectFonts(),L.injectController({config:{appearance:o,checkoutSettings:r,currencyConverter:s,helloSettings:i,onCountryChange:a,overrideCurrencyFormat:c}}),L.doneInit=!0},D.injectCustomScriptForHostedCheckout=()=>{const e=L.cartData,o=(null==e?void 0:e.metadata)||[],n=o.find((e=>"customHeaderScript"===e.key)),r=o.find((e=>"customFooterScript"===e.key));if(window.Zonos.isLegacyCheckout&&(n||r)){if(n){t("Injecting custom header script");const e=document.createElement("script");e.textContent=n.value,document.head.appendChild(e)}if(r){t("Injecting custom footer script");const e=document.createElement("script");e.textContent=r.value,document.body.appendChild(e)}}else t("Skip injecting custom script for hosted checkout","info",{footerScript:r,headerScript:n,isLegacyCheckout:window.Zonos.isLegacyCheckout})},D.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},D.openHelloDialog=e=>{const o=document.querySelector("zonos-hello");o&&o.openHelloDialog(null==e||e)},D.showNotification=e=>{var o;null===(o=L.zonosController)||void 0===o||o.showNotification(e)},D.updateOrganizationName=e=>{var o;null===(o=L.zonosController)||void 0===o||o.updateOrganizationName(e)},D.disablePlaceOrderButtons=({autoEnable:e=!0,config:o,disable:t,placeOrderButtonSelector:n})=>{var r;if(!(null===(r=o.checkoutSettings)||void 0===r?void 0:r.disablePlaceOrderButtonActivation)&&n){const o=document.querySelectorAll(n),r=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};o.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(t?(e.setAttribute("disabled","true"),e.addEventListener("click",r)):(e.removeAttribute("disabled"),e.removeEventListener("click",r)))})),e&&t&&setTimeout((()=>{o.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",r)}))}),5e3)}},D.injectController=({config:e})=>{var o;if(document.querySelector("zonos-controller"))return;if(null===(o=e.checkoutSettings)||void 0===o?void 0:o.placeOrderButtonSelector){const o=e.checkoutSettings.placeOrderButtonSelector;L.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:o});new MutationObserver((()=>{L.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:o})})).observe(document.body,{childList:!0,subtree:!0})}const r=document.createElement("zonos-controller");r.config=e,r.zonosApiKey=L.zonosApiKey||"",r.addEventListener("stripeInitEvent",(async e=>{const{detail:o}=e;t("loading Stripe");const s=await(async(...e)=>{O=!0;const o=Date.now();return C.then((t=>((e,o,t)=>{if(null===e)return null;const n=e.apply(void 0,o);return((e,o)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:o})})(n,t),n})(t,e,o)))})(o.publishableKey);s?(window.Zonos.stripe=s,r.initCheckoutElement(s)):n("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(r),L.zonosController=r,t("Zonos controller injected!")},D.injectScript=({cdnType:e,isModule:o,theRestUrl:r})=>{const s=`${L.getZonosUrl(e)}/${r}`;if(document.querySelector(`script[src="${s}"]`))return void t(`Zonos script "${s}" already exists in the document`,"warn");const a=document.head||document.body,c=document.createElement("script");o?c.type="module":c.noModule=!0,c.src=s,c.crossOrigin="anonymous",c.onerror=()=>{n(`Failed to load ${c.src}`);const t=i(e);t&&L.injectScript({cdnType:t,isModule:o,theRestUrl:r})},a.appendChild(c)},D.getZonosUrl=e=>{const o=()=>{switch(e){case"jsdelivr":return $;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.143";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.143";case"vercel":return N}};if(L.isNpm){return g()||o()}return o()},D.injectZonosCdn=()=>{L.injectScript({cdnType:s,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),L.injectScript({cdnType:s,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),t("Zonos cdn script injected!")},D.injectStylesheet=({cdnType:e,theRestUrl:o})=>{const t=L.getZonosUrl(e),r=document.head||document.body,s=document.createElement("link");s.rel="preconnect",s.href=`${N}/`,r.appendChild(s);const a=document.createElement("link");a.rel="stylesheet",a.href=`${t}/${o}`,a.onerror=()=>{n(`Failed to load ${a.href}`);const t=i(e);t&&L.injectStylesheet({cdnType:t,theRestUrl:o})},r.appendChild(a)},D.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?t("Zonos style links already injected","warn"):(L.injectStylesheet({cdnType:s,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),t("Zonos style css injected!"))},D.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${U}"]`);for(let o=0;o<e.length;o++){const t=e[o];if(t&&!P.test(t.href))return t}return null})())return void t("Inter font already injected","warn");const e=document.head||document.body,o=document.createElement("link");o.rel="preconnect",o.href=U,e.appendChild(o);const n=document.createElement("link");n.rel="stylesheet",n.href=`${U}/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap`,e.appendChild(n),t("Zonos font injected!")},D.setupGoogleFont=e=>{var o;null===(o=L.zonosController)||void 0===o||o.setupGoogleFont(e)},D.injectSupportGoogleFont=e=>{var o;t(`[FONT] injecting ${e}`);const n=null===(o=e.match(/family=(.*?):/))||void 0===o?void 0:o[1],r=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${U}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=U,r.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void t(`[FONT] ${n} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=e,r.appendChild(s),t(`[FONT] ${n} font injected!`)},window.Zonos&&window.Zonos.doneInit||(window.Zonos=D)})();
|
package/dist/types/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.d.ts
CHANGED
|
@@ -66,5 +66,10 @@ export declare class ZonosCustomerInfo {
|
|
|
66
66
|
private handleValidate;
|
|
67
67
|
private handleEmailValidation;
|
|
68
68
|
private prepareAddressObject;
|
|
69
|
+
private isInTaxIdCountry;
|
|
70
|
+
/**
|
|
71
|
+
* Render tax id input based on ship to country code
|
|
72
|
+
*/
|
|
73
|
+
private renderTaxIdInput;
|
|
69
74
|
render(): any;
|
|
70
75
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
+
/**
|
|
3
|
+
* This component is input that has similar style to Stripe since we will use it with other Stripe elements when we don't want to use Link authentication element
|
|
4
|
+
*/
|
|
5
|
+
export declare class ZonosStripeInput {
|
|
6
|
+
el: HTMLZonosStripeInputElement;
|
|
7
|
+
/**
|
|
8
|
+
* Value of the stripeInput
|
|
9
|
+
*/
|
|
10
|
+
inputValue: string;
|
|
11
|
+
/**
|
|
12
|
+
* Input label
|
|
13
|
+
*/
|
|
14
|
+
inputLabel: string;
|
|
15
|
+
/**
|
|
16
|
+
* Primary color to override primary color from appearance primary color in setting.
|
|
17
|
+
*/
|
|
18
|
+
overridePrimaryColor?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Secondary color to override secondary color from appearance secondary color in setting
|
|
21
|
+
*/
|
|
22
|
+
overrideSecondaryColor?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Disables the input
|
|
25
|
+
*/
|
|
26
|
+
isDisabled: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Error state of the input
|
|
29
|
+
*/
|
|
30
|
+
isError: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Placeholder for the input
|
|
33
|
+
*/
|
|
34
|
+
inputPlaceholder: string;
|
|
35
|
+
/**
|
|
36
|
+
* Event to emit when input value changes
|
|
37
|
+
*/
|
|
38
|
+
inputChange: EventEmitter<string>;
|
|
39
|
+
value: string;
|
|
40
|
+
onInputValueChange(newValue: string): void;
|
|
41
|
+
render(): any;
|
|
42
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import type { CalculateLandedCostMutation, CartQuery, CheckoutPresentmentFragment, CheckoutSessionDetailsFragment, CountryCode, CurrencyCode, IncotermCode, ItemMeasurementType, ItemType, ItemUnitOfMeasure, LandedCostFragment, ShipmentRatingFragment } from "../../../types/generated/graphql.internal.types";
|
|
3
2
|
type Step = 'customer-info' | 'shipping' | 'payment' | 'finish' | 'error';
|
|
4
3
|
export type TabItem = {
|
|
@@ -143,10 +142,10 @@ declare const cartStoreCheckItemRestrictions: (itemsWorkflow: ItemWorkflowInfo[]
|
|
|
143
142
|
reason: string;
|
|
144
143
|
};
|
|
145
144
|
amount: number;
|
|
146
|
-
attributes:
|
|
145
|
+
attributes: Array<{
|
|
147
146
|
key: string | null;
|
|
148
147
|
value: string | null;
|
|
149
|
-
} | null
|
|
148
|
+
} | null> | null;
|
|
150
149
|
description: string | null;
|
|
151
150
|
id: string;
|
|
152
151
|
imageUrl: string | null;
|
|
@@ -52,6 +52,14 @@ type StripeStore = {
|
|
|
52
52
|
* @default true
|
|
53
53
|
* */
|
|
54
54
|
stripeShippingSameAsBilling: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Optional tax id for the destination country that requires it
|
|
57
|
+
*/
|
|
58
|
+
taxId: string;
|
|
59
|
+
/**
|
|
60
|
+
* Tax id used when fetching landed cost
|
|
61
|
+
*/
|
|
62
|
+
taxIdUsedWhenFetchingLC: string;
|
|
55
63
|
translatedAddress: {
|
|
56
64
|
address: TranslatedAddressObject;
|
|
57
65
|
billingAddress: TranslatedAddressObject;
|
|
@@ -92,7 +100,7 @@ declare const stripeStorePrefetchLandedCost: (params?: {
|
|
|
92
100
|
declare const stripeStoreApplyPromoCode: () => Promise<void>;
|
|
93
101
|
declare const stripeStoreResetPromoCode: () => void;
|
|
94
102
|
declare const stripeStoreRemovePromoCode: () => Promise<void>;
|
|
95
|
-
declare const stripeStoreMessageBasedOnStatus: (status?: PaymentIntent[
|
|
103
|
+
declare const stripeStoreMessageBasedOnStatus: (status?: PaymentIntent["status"]) => {
|
|
96
104
|
isError: boolean;
|
|
97
105
|
messages: string[];
|
|
98
106
|
};
|
|
@@ -106,7 +114,7 @@ declare const stripeStoreHandleInventoryCheck: () => Promise<string | null>;
|
|
|
106
114
|
declare const stripeStoreHandleInventoryRefund: () => Promise<void>;
|
|
107
115
|
declare const stripeStoreRetrievePayment: ({ clientSecret: _clientSecret, storybookForceStatus, }: {
|
|
108
116
|
clientSecret: string | null;
|
|
109
|
-
storybookForceStatus?: PaymentIntent[
|
|
117
|
+
storybookForceStatus?: PaymentIntent["status"];
|
|
110
118
|
}) => Promise<{
|
|
111
119
|
error: boolean;
|
|
112
120
|
messages: string[];
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { type CountryLandedCost } from "../../utils/api/getCountryLandedCost";
|
|
3
2
|
import { type TargetFormat } from "../../utils/api/getExchangeRate";
|
|
4
3
|
import type { Locale_ElementsSupportedLocationCode_Enum, Locale_PageName_Enum } from "../../../types/generated/graphql.frontend.types";
|
|
@@ -38,6 +38,9 @@ export declare const stringsArabic: {
|
|
|
38
38
|
'Billing address': {
|
|
39
39
|
value: string;
|
|
40
40
|
};
|
|
41
|
+
'CPF/CNPJ number': {
|
|
42
|
+
value: string;
|
|
43
|
+
};
|
|
41
44
|
Cancel: {
|
|
42
45
|
value: string;
|
|
43
46
|
};
|
|
@@ -221,6 +224,9 @@ export declare const stringsArabic: {
|
|
|
221
224
|
"Payment processing. We'll update you when payment is received.": {
|
|
222
225
|
value: string;
|
|
223
226
|
};
|
|
227
|
+
'Personal Customers Clearance Code': {
|
|
228
|
+
value: string;
|
|
229
|
+
};
|
|
224
230
|
'Phone number': {
|
|
225
231
|
value: string;
|
|
226
232
|
};
|
|
@@ -266,6 +272,9 @@ export declare const stringsArabic: {
|
|
|
266
272
|
Quantity: {
|
|
267
273
|
value: string;
|
|
268
274
|
};
|
|
275
|
+
'RFC number': {
|
|
276
|
+
value: string;
|
|
277
|
+
};
|
|
269
278
|
Reload: {
|
|
270
279
|
value: string;
|
|
271
280
|
};
|
|
@@ -371,6 +380,9 @@ export declare const stringsArabic: {
|
|
|
371
380
|
'Unable to retrieve the checkout session at the moment. Please try again or contact our support team.': {
|
|
372
381
|
value: string;
|
|
373
382
|
};
|
|
383
|
+
'Unique Labor Identification Code': {
|
|
384
|
+
value: string;
|
|
385
|
+
};
|
|
374
386
|
'Update address': {
|
|
375
387
|
value: string;
|
|
376
388
|
};
|
|
@@ -38,6 +38,9 @@ export declare const stringsBase: {
|
|
|
38
38
|
'Billing address': {
|
|
39
39
|
value: string;
|
|
40
40
|
};
|
|
41
|
+
'CPF/CNPJ number': {
|
|
42
|
+
value: string;
|
|
43
|
+
};
|
|
41
44
|
Cancel: {
|
|
42
45
|
value: string;
|
|
43
46
|
};
|
|
@@ -221,6 +224,9 @@ export declare const stringsBase: {
|
|
|
221
224
|
"Payment processing. We'll update you when payment is received.": {
|
|
222
225
|
value: string;
|
|
223
226
|
};
|
|
227
|
+
'Personal Customers Clearance Code': {
|
|
228
|
+
value: string;
|
|
229
|
+
};
|
|
224
230
|
'Phone number': {
|
|
225
231
|
value: string;
|
|
226
232
|
};
|
|
@@ -266,6 +272,9 @@ export declare const stringsBase: {
|
|
|
266
272
|
Quantity: {
|
|
267
273
|
value: string;
|
|
268
274
|
};
|
|
275
|
+
'RFC number': {
|
|
276
|
+
value: string;
|
|
277
|
+
};
|
|
269
278
|
Reload: {
|
|
270
279
|
value: string;
|
|
271
280
|
};
|
|
@@ -371,6 +380,9 @@ export declare const stringsBase: {
|
|
|
371
380
|
'Unable to retrieve the checkout session at the moment. Please try again or contact our support team.': {
|
|
372
381
|
value: string;
|
|
373
382
|
};
|
|
383
|
+
'Unique Labor Identification Code': {
|
|
384
|
+
value: string;
|
|
385
|
+
};
|
|
374
386
|
'Update address': {
|
|
375
387
|
value: string;
|
|
376
388
|
};
|
|
@@ -38,6 +38,9 @@ export declare const stringsChinese: {
|
|
|
38
38
|
'Billing address': {
|
|
39
39
|
value: string;
|
|
40
40
|
};
|
|
41
|
+
'CPF/CNPJ number': {
|
|
42
|
+
value: string;
|
|
43
|
+
};
|
|
41
44
|
Cancel: {
|
|
42
45
|
value: string;
|
|
43
46
|
};
|
|
@@ -221,6 +224,9 @@ export declare const stringsChinese: {
|
|
|
221
224
|
"Payment processing. We'll update you when payment is received.": {
|
|
222
225
|
value: string;
|
|
223
226
|
};
|
|
227
|
+
'Personal Customers Clearance Code': {
|
|
228
|
+
value: string;
|
|
229
|
+
};
|
|
224
230
|
'Phone number': {
|
|
225
231
|
value: string;
|
|
226
232
|
};
|
|
@@ -266,6 +272,9 @@ export declare const stringsChinese: {
|
|
|
266
272
|
Quantity: {
|
|
267
273
|
value: string;
|
|
268
274
|
};
|
|
275
|
+
'RFC number': {
|
|
276
|
+
value: string;
|
|
277
|
+
};
|
|
269
278
|
Reload: {
|
|
270
279
|
value: string;
|
|
271
280
|
};
|
|
@@ -371,6 +380,9 @@ export declare const stringsChinese: {
|
|
|
371
380
|
'Unable to retrieve the checkout session at the moment. Please try again or contact our support team.': {
|
|
372
381
|
value: string;
|
|
373
382
|
};
|
|
383
|
+
'Unique Labor Identification Code': {
|
|
384
|
+
value: string;
|
|
385
|
+
};
|
|
374
386
|
'Update address': {
|
|
375
387
|
value: string;
|
|
376
388
|
};
|
|
@@ -38,6 +38,9 @@ export declare const stringsDanish: {
|
|
|
38
38
|
'Billing address': {
|
|
39
39
|
value: string;
|
|
40
40
|
};
|
|
41
|
+
'CPF/CNPJ number': {
|
|
42
|
+
value: string;
|
|
43
|
+
};
|
|
41
44
|
Cancel: {
|
|
42
45
|
value: string;
|
|
43
46
|
};
|
|
@@ -221,6 +224,9 @@ export declare const stringsDanish: {
|
|
|
221
224
|
"Payment processing. We'll update you when payment is received.": {
|
|
222
225
|
value: string;
|
|
223
226
|
};
|
|
227
|
+
'Personal Customers Clearance Code': {
|
|
228
|
+
value: string;
|
|
229
|
+
};
|
|
224
230
|
'Phone number': {
|
|
225
231
|
value: string;
|
|
226
232
|
};
|
|
@@ -266,6 +272,9 @@ export declare const stringsDanish: {
|
|
|
266
272
|
Quantity: {
|
|
267
273
|
value: string;
|
|
268
274
|
};
|
|
275
|
+
'RFC number': {
|
|
276
|
+
value: string;
|
|
277
|
+
};
|
|
269
278
|
Reload: {
|
|
270
279
|
value: string;
|
|
271
280
|
};
|
|
@@ -371,6 +380,9 @@ export declare const stringsDanish: {
|
|
|
371
380
|
'Unable to retrieve the checkout session at the moment. Please try again or contact our support team.': {
|
|
372
381
|
value: string;
|
|
373
382
|
};
|
|
383
|
+
'Unique Labor Identification Code': {
|
|
384
|
+
value: string;
|
|
385
|
+
};
|
|
374
386
|
'Update address': {
|
|
375
387
|
value: string;
|
|
376
388
|
};
|
|
@@ -38,6 +38,9 @@ export declare const stringsDutch: {
|
|
|
38
38
|
'Billing address': {
|
|
39
39
|
value: string;
|
|
40
40
|
};
|
|
41
|
+
'CPF/CNPJ number': {
|
|
42
|
+
value: string;
|
|
43
|
+
};
|
|
41
44
|
Cancel: {
|
|
42
45
|
value: string;
|
|
43
46
|
};
|
|
@@ -221,6 +224,9 @@ export declare const stringsDutch: {
|
|
|
221
224
|
"Payment processing. We'll update you when payment is received.": {
|
|
222
225
|
value: string;
|
|
223
226
|
};
|
|
227
|
+
'Personal Customers Clearance Code': {
|
|
228
|
+
value: string;
|
|
229
|
+
};
|
|
224
230
|
'Phone number': {
|
|
225
231
|
value: string;
|
|
226
232
|
};
|
|
@@ -266,6 +272,9 @@ export declare const stringsDutch: {
|
|
|
266
272
|
Quantity: {
|
|
267
273
|
value: string;
|
|
268
274
|
};
|
|
275
|
+
'RFC number': {
|
|
276
|
+
value: string;
|
|
277
|
+
};
|
|
269
278
|
Reload: {
|
|
270
279
|
value: string;
|
|
271
280
|
};
|
|
@@ -371,6 +380,9 @@ export declare const stringsDutch: {
|
|
|
371
380
|
'Unable to retrieve the checkout session at the moment. Please try again or contact our support team.': {
|
|
372
381
|
value: string;
|
|
373
382
|
};
|
|
383
|
+
'Unique Labor Identification Code': {
|
|
384
|
+
value: string;
|
|
385
|
+
};
|
|
374
386
|
'Update address': {
|
|
375
387
|
value: string;
|
|
376
388
|
};
|
|
@@ -38,6 +38,9 @@ export declare const stringsFrench: {
|
|
|
38
38
|
'Billing address': {
|
|
39
39
|
value: string;
|
|
40
40
|
};
|
|
41
|
+
'CPF/CNPJ number': {
|
|
42
|
+
value: string;
|
|
43
|
+
};
|
|
41
44
|
Cancel: {
|
|
42
45
|
value: string;
|
|
43
46
|
};
|
|
@@ -221,6 +224,9 @@ export declare const stringsFrench: {
|
|
|
221
224
|
"Payment processing. We'll update you when payment is received.": {
|
|
222
225
|
value: string;
|
|
223
226
|
};
|
|
227
|
+
'Personal Customers Clearance Code': {
|
|
228
|
+
value: string;
|
|
229
|
+
};
|
|
224
230
|
'Phone number': {
|
|
225
231
|
value: string;
|
|
226
232
|
};
|
|
@@ -266,6 +272,9 @@ export declare const stringsFrench: {
|
|
|
266
272
|
Quantity: {
|
|
267
273
|
value: string;
|
|
268
274
|
};
|
|
275
|
+
'RFC number': {
|
|
276
|
+
value: string;
|
|
277
|
+
};
|
|
269
278
|
Reload: {
|
|
270
279
|
value: string;
|
|
271
280
|
};
|
|
@@ -371,6 +380,9 @@ export declare const stringsFrench: {
|
|
|
371
380
|
'Unable to retrieve the checkout session at the moment. Please try again or contact our support team.': {
|
|
372
381
|
value: string;
|
|
373
382
|
};
|
|
383
|
+
'Unique Labor Identification Code': {
|
|
384
|
+
value: string;
|
|
385
|
+
};
|
|
374
386
|
'Update address': {
|
|
375
387
|
value: string;
|
|
376
388
|
};
|
|
@@ -38,6 +38,9 @@ export declare const stringsGerman: {
|
|
|
38
38
|
'Billing address': {
|
|
39
39
|
value: string;
|
|
40
40
|
};
|
|
41
|
+
'CPF/CNPJ number': {
|
|
42
|
+
value: string;
|
|
43
|
+
};
|
|
41
44
|
Cancel: {
|
|
42
45
|
value: string;
|
|
43
46
|
};
|
|
@@ -221,6 +224,9 @@ export declare const stringsGerman: {
|
|
|
221
224
|
"Payment processing. We'll update you when payment is received.": {
|
|
222
225
|
value: string;
|
|
223
226
|
};
|
|
227
|
+
'Personal Customers Clearance Code': {
|
|
228
|
+
value: string;
|
|
229
|
+
};
|
|
224
230
|
'Phone number': {
|
|
225
231
|
value: string;
|
|
226
232
|
};
|
|
@@ -266,6 +272,9 @@ export declare const stringsGerman: {
|
|
|
266
272
|
Quantity: {
|
|
267
273
|
value: string;
|
|
268
274
|
};
|
|
275
|
+
'RFC number': {
|
|
276
|
+
value: string;
|
|
277
|
+
};
|
|
269
278
|
Reload: {
|
|
270
279
|
value: string;
|
|
271
280
|
};
|
|
@@ -371,6 +380,9 @@ export declare const stringsGerman: {
|
|
|
371
380
|
'Unable to retrieve the checkout session at the moment. Please try again or contact our support team.': {
|
|
372
381
|
value: string;
|
|
373
382
|
};
|
|
383
|
+
'Unique Labor Identification Code': {
|
|
384
|
+
value: string;
|
|
385
|
+
};
|
|
374
386
|
'Update address': {
|
|
375
387
|
value: string;
|
|
376
388
|
};
|
|
@@ -38,6 +38,9 @@ export declare const stringsHebrew: {
|
|
|
38
38
|
'Billing address': {
|
|
39
39
|
value: string;
|
|
40
40
|
};
|
|
41
|
+
'CPF/CNPJ number': {
|
|
42
|
+
value: string;
|
|
43
|
+
};
|
|
41
44
|
Cancel: {
|
|
42
45
|
value: string;
|
|
43
46
|
};
|
|
@@ -221,6 +224,9 @@ export declare const stringsHebrew: {
|
|
|
221
224
|
"Payment processing. We'll update you when payment is received.": {
|
|
222
225
|
value: string;
|
|
223
226
|
};
|
|
227
|
+
'Personal Customers Clearance Code': {
|
|
228
|
+
value: string;
|
|
229
|
+
};
|
|
224
230
|
'Phone number': {
|
|
225
231
|
value: string;
|
|
226
232
|
};
|
|
@@ -266,6 +272,9 @@ export declare const stringsHebrew: {
|
|
|
266
272
|
Quantity: {
|
|
267
273
|
value: string;
|
|
268
274
|
};
|
|
275
|
+
'RFC number': {
|
|
276
|
+
value: string;
|
|
277
|
+
};
|
|
269
278
|
Reload: {
|
|
270
279
|
value: string;
|
|
271
280
|
};
|
|
@@ -371,6 +380,9 @@ export declare const stringsHebrew: {
|
|
|
371
380
|
'Unable to retrieve the checkout session at the moment. Please try again or contact our support team.': {
|
|
372
381
|
value: string;
|
|
373
382
|
};
|
|
383
|
+
'Unique Labor Identification Code': {
|
|
384
|
+
value: string;
|
|
385
|
+
};
|
|
374
386
|
'Update address': {
|
|
375
387
|
value: string;
|
|
376
388
|
};
|
|
@@ -38,6 +38,9 @@ export declare const stringsIndonesian: {
|
|
|
38
38
|
'Billing address': {
|
|
39
39
|
value: string;
|
|
40
40
|
};
|
|
41
|
+
'CPF/CNPJ number': {
|
|
42
|
+
value: string;
|
|
43
|
+
};
|
|
41
44
|
Cancel: {
|
|
42
45
|
value: string;
|
|
43
46
|
};
|
|
@@ -221,6 +224,9 @@ export declare const stringsIndonesian: {
|
|
|
221
224
|
"Payment processing. We'll update you when payment is received.": {
|
|
222
225
|
value: string;
|
|
223
226
|
};
|
|
227
|
+
'Personal Customers Clearance Code': {
|
|
228
|
+
value: string;
|
|
229
|
+
};
|
|
224
230
|
'Phone number': {
|
|
225
231
|
value: string;
|
|
226
232
|
};
|
|
@@ -266,6 +272,9 @@ export declare const stringsIndonesian: {
|
|
|
266
272
|
Quantity: {
|
|
267
273
|
value: string;
|
|
268
274
|
};
|
|
275
|
+
'RFC number': {
|
|
276
|
+
value: string;
|
|
277
|
+
};
|
|
269
278
|
Reload: {
|
|
270
279
|
value: string;
|
|
271
280
|
};
|
|
@@ -371,6 +380,9 @@ export declare const stringsIndonesian: {
|
|
|
371
380
|
'Unable to retrieve the checkout session at the moment. Please try again or contact our support team.': {
|
|
372
381
|
value: string;
|
|
373
382
|
};
|
|
383
|
+
'Unique Labor Identification Code': {
|
|
384
|
+
value: string;
|
|
385
|
+
};
|
|
374
386
|
'Update address': {
|
|
375
387
|
value: string;
|
|
376
388
|
};
|
|
@@ -38,6 +38,9 @@ export declare const stringsItalian: {
|
|
|
38
38
|
'Billing address': {
|
|
39
39
|
value: string;
|
|
40
40
|
};
|
|
41
|
+
'CPF/CNPJ number': {
|
|
42
|
+
value: string;
|
|
43
|
+
};
|
|
41
44
|
Cancel: {
|
|
42
45
|
value: string;
|
|
43
46
|
};
|
|
@@ -221,6 +224,9 @@ export declare const stringsItalian: {
|
|
|
221
224
|
"Payment processing. We'll update you when payment is received.": {
|
|
222
225
|
value: string;
|
|
223
226
|
};
|
|
227
|
+
'Personal Customers Clearance Code': {
|
|
228
|
+
value: string;
|
|
229
|
+
};
|
|
224
230
|
'Phone number': {
|
|
225
231
|
value: string;
|
|
226
232
|
};
|
|
@@ -266,6 +272,9 @@ export declare const stringsItalian: {
|
|
|
266
272
|
Quantity: {
|
|
267
273
|
value: string;
|
|
268
274
|
};
|
|
275
|
+
'RFC number': {
|
|
276
|
+
value: string;
|
|
277
|
+
};
|
|
269
278
|
Reload: {
|
|
270
279
|
value: string;
|
|
271
280
|
};
|
|
@@ -371,6 +380,9 @@ export declare const stringsItalian: {
|
|
|
371
380
|
'Unable to retrieve the checkout session at the moment. Please try again or contact our support team.': {
|
|
372
381
|
value: string;
|
|
373
382
|
};
|
|
383
|
+
'Unique Labor Identification Code': {
|
|
384
|
+
value: string;
|
|
385
|
+
};
|
|
374
386
|
'Update address': {
|
|
375
387
|
value: string;
|
|
376
388
|
};
|
|
@@ -38,6 +38,9 @@ export declare const stringsJapanese: {
|
|
|
38
38
|
'Billing address': {
|
|
39
39
|
value: string;
|
|
40
40
|
};
|
|
41
|
+
'CPF/CNPJ number': {
|
|
42
|
+
value: string;
|
|
43
|
+
};
|
|
41
44
|
Cancel: {
|
|
42
45
|
value: string;
|
|
43
46
|
};
|
|
@@ -221,6 +224,9 @@ export declare const stringsJapanese: {
|
|
|
221
224
|
"Payment processing. We'll update you when payment is received.": {
|
|
222
225
|
value: string;
|
|
223
226
|
};
|
|
227
|
+
'Personal Customers Clearance Code': {
|
|
228
|
+
value: string;
|
|
229
|
+
};
|
|
224
230
|
'Phone number': {
|
|
225
231
|
value: string;
|
|
226
232
|
};
|
|
@@ -266,6 +272,9 @@ export declare const stringsJapanese: {
|
|
|
266
272
|
Quantity: {
|
|
267
273
|
value: string;
|
|
268
274
|
};
|
|
275
|
+
'RFC number': {
|
|
276
|
+
value: string;
|
|
277
|
+
};
|
|
269
278
|
Reload: {
|
|
270
279
|
value: string;
|
|
271
280
|
};
|
|
@@ -371,6 +380,9 @@ export declare const stringsJapanese: {
|
|
|
371
380
|
'Unable to retrieve the checkout session at the moment. Please try again or contact our support team.': {
|
|
372
381
|
value: string;
|
|
373
382
|
};
|
|
383
|
+
'Unique Labor Identification Code': {
|
|
384
|
+
value: string;
|
|
385
|
+
};
|
|
374
386
|
'Update address': {
|
|
375
387
|
value: string;
|
|
376
388
|
};
|