@zonos/elements 1.3.201 → 1.3.202
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/VarianceTest-0cb1e118.js +12 -0
- package/dist/cjs/cart-637ba3d0.js +1943 -0
- package/dist/cjs/{debounce-d393fafe.js → debounce-94e1b7ff.js} +1 -1
- package/dist/cjs/{getBorderRadius-3d0a563e.js → getBorderRadius-8d3b1049.js} +1 -1
- package/dist/cjs/index.cjs.js +10 -8
- package/dist/cjs/{isDarkColor-92a10a85.js → isDarkColor-bcf49625.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{cart-e73cde62.js → localization-2f17c95f.js} +74 -1941
- package/dist/cjs/{paypal-39bbbd1a.js → paypal-0eceff03.js} +10 -9
- package/dist/cjs/zonos-address_11.cjs.entry.js +98 -72
- package/dist/cjs/zonos-badge.cjs.entry.js +2 -1
- package/dist/cjs/zonos-banner.cjs.entry.js +2 -1
- package/dist/cjs/zonos-button_3.cjs.entry.js +4 -3
- package/dist/cjs/zonos-card.cjs.entry.js +3 -2
- package/dist/cjs/{zonos-cart-items_13.cjs.entry.js → zonos-cart-items_14.cjs.entry.js} +99 -80
- package/dist/cjs/zonos-checkout.cjs.entry.js +395 -50
- package/dist/cjs/zonos-collapse.cjs.entry.js +2 -1
- package/dist/cjs/zonos-component.cjs.entry.js +1 -1
- package/dist/cjs/zonos-controller.cjs.entry.js +13 -11
- package/dist/cjs/zonos-country-flag.cjs.entry.js +4 -5
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +13 -13
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +10 -8
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +41 -42
- package/dist/cjs/zonos-hello.cjs.entry.js +30 -31
- package/dist/cjs/zonos-input.cjs.entry.js +3 -2
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +8 -9
- package/dist/cjs/zonos-logo.cjs.entry.js +4 -3
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +3 -2
- package/dist/cjs/zonos-stripe-input.cjs.entry.js +8 -7
- package/dist/cjs/zonos-text.cjs.entry.js +2 -1
- package/dist/cjs/zonos-toggle.cjs.entry.js +4 -3
- package/dist/cjs/zonos-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/zonos-v-stack.cjs.entry.js +4 -3
- package/dist/cjs/{zonosStore-c466b127.js → zonosStore-9264749e.js} +15 -5
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +18 -17
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +235 -15
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +3 -3
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +2 -1
- package/dist/collection/components/common/zonos-loading-overlay/zonos-loading-overlay.css +62 -0
- package/dist/collection/components/common/zonos-loading-overlay/zonos-loading-overlay.js +90 -0
- package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -2
- package/dist/collection/components/common/zonos-rest-state/zonos-rest-state.js +3 -3
- package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +2 -2
- package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.js +4 -4
- package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js +5 -5
- package/dist/collection/components/common/zonos-stripe-select/zonos-stripe-select.js +5 -5
- 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 +3 -3
- package/dist/collection/components/paypal/zonos-paypal-payment.js +1 -1
- package/dist/collection/components/store/checkout/cart.js +15 -16
- package/dist/collection/components/store/checkout/paypal.js +2 -1
- package/dist/collection/components/store/checkout/stripe.js +16 -11
- package/dist/collection/components/store/hello/localization.js +5 -5
- package/dist/collection/components/store/storageStore.js +32 -0
- package/dist/collection/components/store/zonosStore.js +12 -6
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +18 -6
- package/dist/collection/components/stripe/zonos-custom-address/zonos-address-suggestions/zonos-address-suggestions.js +2 -2
- package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.js +19 -7
- package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +3 -3
- package/dist/collection/components/utils/api/getCheckoutSession.js +3 -3
- package/dist/collection/components/utils/api/placeTestOrder.js +2 -1
- package/dist/collection/components/utils/api/prepCalculateLandedCost.js +3 -2
- package/dist/collection/components/utils/api/selectVarianceTest.js +20 -0
- package/dist/collection/components/utils/buildCartUrl.js +44 -0
- package/dist/collection/components/utils/getLegacyQueryParams.js +42 -0
- package/dist/collection/components/utils/varianceTest/filterExpiredTests.js +6 -0
- package/dist/collection/components/utils/varianceTest/filterValidTests.js +23 -0
- package/dist/collection/components/utils/varianceTest/getSelectedTestVariant.js +6 -0
- package/dist/collection/components/utils/varianceTest/hasAtLeastOneAvailableTestKey.js +14 -0
- package/dist/collection/components/utils/varianceTest/isInAvailableTestKey.js +4 -0
- package/dist/collection/components/utils/varianceTest/isTestEnabled.js +4 -0
- package/dist/collection/components/utils/varianceTest/isTestKeysAllVariantSelected.js +6 -0
- package/dist/collection/components/utils/varianceTest/mergeTest.js +13 -0
- package/dist/collection/scripts/_getZonosQaUrl.js +2 -2
- package/dist/collection/types/checkout/api/VarianceTest.js +8 -0
- package/dist/collection/types/generated/graphql.internal.types.js +12 -0
- package/dist/collection/types/index.js +1 -0
- package/dist/esm/VarianceTest-fef2d958.js +10 -0
- package/dist/esm/cart-b7c15b61.js +1907 -0
- package/dist/esm/{debounce-a2121722.js → debounce-3a9f27a0.js} +1 -1
- package/dist/esm/{getBorderRadius-413e97eb.js → getBorderRadius-78b28b4d.js} +1 -1
- package/dist/esm/index.js +9 -8
- package/dist/esm/{isDarkColor-4c7b2ffc.js → isDarkColor-31dd7dff.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{cart-f79c8021.js → localization-bf7224aa.js} +70 -1907
- package/dist/esm/{paypal-6d4667d1.js → paypal-932fd3dd.js} +5 -4
- package/dist/esm/zonos-address_11.entry.js +54 -28
- package/dist/esm/zonos-badge.entry.js +2 -1
- package/dist/esm/zonos-banner.entry.js +2 -1
- package/dist/esm/zonos-button_3.entry.js +4 -3
- package/dist/esm/zonos-card.entry.js +3 -2
- package/dist/esm/{zonos-cart-items_13.entry.js → zonos-cart-items_14.entry.js} +48 -30
- package/dist/esm/zonos-checkout.entry.js +363 -18
- package/dist/esm/zonos-collapse.entry.js +2 -1
- package/dist/esm/zonos-component.entry.js +1 -1
- package/dist/esm/zonos-controller.entry.js +8 -6
- package/dist/esm/zonos-country-flag.entry.js +3 -4
- package/dist/esm/zonos-country-select_4.entry.js +8 -8
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm/zonos-empty-state-payment_4.entry.js +10 -8
- package/dist/esm/zonos-hello-dialog.entry.js +7 -8
- package/dist/esm/zonos-hello.entry.js +4 -5
- package/dist/esm/zonos-input.entry.js +3 -2
- package/dist/esm/zonos-language-select_2.entry.js +5 -6
- package/dist/esm/zonos-logo.entry.js +4 -3
- package/dist/esm/zonos-shipping-rich-radio.entry.js +3 -2
- package/dist/esm/zonos-stripe-input.entry.js +8 -7
- package/dist/esm/zonos-text.entry.js +2 -1
- package/dist/esm/zonos-toggle.entry.js +4 -3
- package/dist/esm/zonos-tooltip.entry.js +2 -2
- package/dist/esm/zonos-v-stack.entry.js +4 -3
- package/dist/esm/{zonosStore-cdabc848.js → zonosStore-d10a829f.js} +15 -5
- package/dist/esm-es5/VarianceTest-fef2d958.js +1 -0
- package/dist/esm-es5/cart-b7c15b61.js +1 -0
- package/dist/esm-es5/{debounce-a2121722.js → debounce-3a9f27a0.js} +1 -1
- package/dist/esm-es5/{getBorderRadius-413e97eb.js → getBorderRadius-78b28b4d.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{isDarkColor-4c7b2ffc.js → isDarkColor-31dd7dff.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/localization-bf7224aa.js +1 -0
- package/dist/esm-es5/{paypal-6d4667d1.js → paypal-932fd3dd.js} +2 -2
- package/dist/esm-es5/zonos-address_11.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_14.entry.js +1 -0
- 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-empty-state-payment_4.entry.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-logo.entry.js +1 -1
- package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
- package/dist/esm-es5/zonos-stripe-input.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-d10a829f.js +1 -0
- package/dist/scripts/index.d.ts +839 -765
- 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-checkout.d.ts +16 -0
- package/dist/types/components/common/zonos-loading-overlay/zonos-loading-overlay.d.ts +16 -0
- package/dist/types/components/store/checkout/cart.d.ts +0 -1
- package/dist/types/components/store/checkout/stripe.d.ts +2 -2
- package/dist/types/components/store/hello/localization.d.ts +2 -2
- package/dist/types/components/store/storageStore.d.ts +13 -0
- package/dist/types/components/store/zonosStore.d.ts +7 -2
- package/dist/types/components/stripe/zonos-address/zonos-address.d.ts +2 -0
- package/dist/types/components/stripe/zonos-custom-address/zonos-custom-address.d.ts +2 -0
- package/dist/types/components/utils/api/selectVarianceTest.d.ts +6 -0
- package/dist/types/components/utils/buildCartUrl.d.ts +10 -0
- package/dist/types/components/utils/getLegacyQueryParams.d.ts +2 -0
- package/dist/types/components/utils/varianceTest/filterExpiredTests.d.ts +2 -0
- package/dist/types/components/utils/varianceTest/filterValidTests.d.ts +9 -0
- package/dist/types/components/utils/varianceTest/getSelectedTestVariant.d.ts +2 -0
- package/dist/types/components/utils/varianceTest/hasAtLeastOneAvailableTestKey.d.ts +8 -0
- package/dist/types/components/utils/varianceTest/isInAvailableTestKey.d.ts +2 -0
- package/dist/types/components/utils/varianceTest/isTestEnabled.d.ts +2 -0
- package/dist/types/components/utils/varianceTest/isTestKeysAllVariantSelected.d.ts +9 -0
- package/dist/types/components/utils/varianceTest/mergeTest.d.ts +5 -0
- package/dist/types/components.d.ts +51 -0
- package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +7 -0
- package/dist/types/types/checkout/CheckoutConfig.d.ts +13 -1
- package/dist/types/types/checkout/api/CheckoutSession.d.ts +7 -0
- package/dist/types/types/checkout/api/VarianceTest.d.ts +30 -0
- package/dist/types/types/generated/graphql.internal.types.d.ts +163 -0
- package/dist/types/types/generated/graphql.internal.types.ts +199 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/utils/ZonosSettings.d.ts +7 -6
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-609c32a3.system.entry.js → p-01987cb2.system.entry.js} +1 -1
- package/dist/zonos-elements/p-04a01cb1.js +1 -0
- package/dist/zonos-elements/p-04b43dd5.entry.js +1 -0
- package/dist/zonos-elements/p-0f77d087.system.entry.js +1 -0
- package/dist/zonos-elements/{p-7831b52c.system.entry.js → p-1dcdb65f.system.entry.js} +1 -1
- package/dist/zonos-elements/p-26a634a5.system.entry.js +1 -0
- package/dist/zonos-elements/p-27987298.system.entry.js +1 -0
- package/dist/zonos-elements/p-2af2eb6f.system.entry.js +1 -0
- package/dist/zonos-elements/p-2b8f787a.entry.js +1 -0
- package/dist/zonos-elements/p-30cfa524.entry.js +1 -0
- package/dist/zonos-elements/p-32320d9a.system.js +1 -0
- package/dist/zonos-elements/p-3284f459.system.entry.js +1 -0
- package/dist/zonos-elements/{p-13796f98.js → p-3d82a352.js} +1 -1
- package/dist/zonos-elements/p-452070af.system.entry.js +1 -0
- package/dist/zonos-elements/p-45ebc788.entry.js +1 -0
- package/dist/zonos-elements/p-4c81112f.entry.js +1 -0
- package/dist/zonos-elements/p-4efa8187.js +1 -0
- package/dist/zonos-elements/p-5170bc41.entry.js +1 -0
- package/dist/zonos-elements/p-5a2dd041.system.js +1 -0
- package/dist/zonos-elements/p-5c74e5c9.system.entry.js +1 -0
- package/dist/zonos-elements/p-5d0f7364.system.js +1 -0
- package/dist/zonos-elements/p-6a52a2bc.system.entry.js +1 -0
- package/dist/zonos-elements/p-715d0f59.system.entry.js +1 -0
- package/dist/zonos-elements/{p-b8d87932.js → p-72f37935.js} +1 -1
- package/dist/zonos-elements/p-7ae5cd60.entry.js +1 -0
- package/dist/zonos-elements/p-80bbd9c0.system.entry.js +1 -0
- package/dist/zonos-elements/p-851c642e.system.entry.js +1 -0
- package/dist/zonos-elements/{p-4300d944.entry.js → p-8d870d4c.entry.js} +1 -1
- package/dist/zonos-elements/p-98b65387.entry.js +1 -0
- package/dist/zonos-elements/p-9af5e93a.entry.js +1 -0
- package/dist/zonos-elements/p-aa1193bc.entry.js +1 -0
- package/dist/zonos-elements/{p-5de59662.js → p-aae60057.js} +2 -2
- package/dist/zonos-elements/p-ab176281.system.entry.js +1 -0
- package/dist/zonos-elements/p-b52aba52.entry.js +1 -0
- package/dist/zonos-elements/p-bc220d35.system.js +1 -0
- package/dist/zonos-elements/p-bc8bda92.entry.js +1 -0
- package/dist/zonos-elements/p-be5afc91.system.entry.js +1 -0
- package/dist/zonos-elements/p-bec2a3ce.entry.js +1 -0
- package/dist/zonos-elements/p-c291bac1.entry.js +1 -0
- package/dist/zonos-elements/p-c3d2422e.entry.js +1 -0
- package/dist/zonos-elements/{p-f28eb1dd.system.js → p-c50b3100.system.js} +1 -1
- package/dist/zonos-elements/p-c58acd4c.system.entry.js +1 -0
- package/dist/zonos-elements/p-c5fcbc92.system.entry.js +1 -0
- package/dist/zonos-elements/p-c767242b.entry.js +1 -0
- package/dist/zonos-elements/p-c9aa902e.system.entry.js +1 -0
- package/dist/zonos-elements/p-cb823c4d.system.js +1 -0
- package/dist/zonos-elements/{p-7d5d89f2.system.js → p-d2466fbd.system.js} +2 -2
- package/dist/zonos-elements/{p-d422ad1d.system.js → p-d42dfd32.system.js} +1 -1
- package/dist/zonos-elements/p-d46349d3.system.entry.js +1 -0
- package/dist/zonos-elements/p-d60ca44b.system.entry.js +1 -0
- package/dist/zonos-elements/{p-b2241919.entry.js → p-d6a10007.entry.js} +1 -1
- package/dist/zonos-elements/p-db025dfc.system.entry.js +1 -0
- package/dist/zonos-elements/p-db3968a2.js +1 -0
- package/dist/zonos-elements/p-dcd6acd4.system.entry.js +1 -0
- package/dist/zonos-elements/p-dd1cfa74.entry.js +1 -0
- package/dist/zonos-elements/p-df4c46a6.entry.js +1 -0
- package/dist/zonos-elements/{p-4593324c.js → p-e26c9e83.js} +1 -1
- package/dist/zonos-elements/p-e68d5219.entry.js +1 -0
- package/dist/zonos-elements/p-ea6d87a1.system.js +1 -1
- package/dist/zonos-elements/p-ef3e05e5.system.js +1 -0
- package/dist/zonos-elements/p-f255e822.js +1 -0
- package/dist/zonos-elements/p-f655ec36.entry.js +1 -0
- package/dist/zonos-elements/{p-e91b244c.entry.js → p-f891d470.entry.js} +1 -1
- package/dist/zonos-elements/p-f8d0d488.system.entry.js +1 -0
- package/dist/zonos-elements/{p-240ee490.system.entry.js → p-fbe36bc8.system.entry.js} +1 -1
- package/dist/zonos-elements/p-fcc2e712.entry.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/cart-f79c8021.js +0 -1
- package/dist/esm-es5/zonos-cart-items_13.entry.js +0 -1
- package/dist/esm-es5/zonosStore-cdabc848.js +0 -1
- package/dist/zonos-elements/p-0302a254.entry.js +0 -1
- package/dist/zonos-elements/p-06ed3582.system.js +0 -1
- package/dist/zonos-elements/p-147ca395.entry.js +0 -1
- package/dist/zonos-elements/p-1998d8b3.entry.js +0 -1
- package/dist/zonos-elements/p-1eddec23.entry.js +0 -1
- package/dist/zonos-elements/p-20030bf5.system.js +0 -1
- package/dist/zonos-elements/p-24a2e899.system.entry.js +0 -1
- package/dist/zonos-elements/p-264f46a5.entry.js +0 -1
- package/dist/zonos-elements/p-2882b9f4.entry.js +0 -1
- package/dist/zonos-elements/p-2c915112.system.entry.js +0 -1
- package/dist/zonos-elements/p-327aebf5.entry.js +0 -1
- package/dist/zonos-elements/p-33488109.system.entry.js +0 -1
- package/dist/zonos-elements/p-337fab4e.js +0 -1
- package/dist/zonos-elements/p-3ddecaa4.system.entry.js +0 -1
- package/dist/zonos-elements/p-48f70043.system.entry.js +0 -1
- package/dist/zonos-elements/p-49a31b14.system.entry.js +0 -1
- package/dist/zonos-elements/p-4cd867d5.js +0 -1
- package/dist/zonos-elements/p-55711b80.system.entry.js +0 -1
- package/dist/zonos-elements/p-578bf5d7.entry.js +0 -1
- package/dist/zonos-elements/p-5c061a35.entry.js +0 -1
- package/dist/zonos-elements/p-6096c1c5.entry.js +0 -1
- package/dist/zonos-elements/p-65a8f19d.entry.js +0 -1
- package/dist/zonos-elements/p-6adc6e27.entry.js +0 -1
- package/dist/zonos-elements/p-6cd9b6a1.system.entry.js +0 -1
- package/dist/zonos-elements/p-79070ee6.entry.js +0 -1
- package/dist/zonos-elements/p-7bb9c330.entry.js +0 -1
- package/dist/zonos-elements/p-82aa4f9f.system.entry.js +0 -1
- package/dist/zonos-elements/p-8540f3e2.system.entry.js +0 -1
- package/dist/zonos-elements/p-8a9d4605.system.entry.js +0 -1
- package/dist/zonos-elements/p-932bed54.system.entry.js +0 -1
- package/dist/zonos-elements/p-94e3e50d.system.entry.js +0 -1
- package/dist/zonos-elements/p-9f6dd86a.entry.js +0 -1
- package/dist/zonos-elements/p-a64ab131.system.entry.js +0 -1
- package/dist/zonos-elements/p-aac95779.system.entry.js +0 -1
- package/dist/zonos-elements/p-ad3c5358.entry.js +0 -1
- package/dist/zonos-elements/p-af6af82e.system.js +0 -1
- package/dist/zonos-elements/p-b66b3306.system.entry.js +0 -1
- package/dist/zonos-elements/p-b6afcf3f.system.entry.js +0 -1
- package/dist/zonos-elements/p-b8d91f99.entry.js +0 -1
- package/dist/zonos-elements/p-c770044a.system.entry.js +0 -1
- package/dist/zonos-elements/p-d4842d10.system.entry.js +0 -1
- package/dist/zonos-elements/p-d6c3aec8.system.entry.js +0 -1
- package/dist/zonos-elements/p-daf73a4c.system.js +0 -1
- package/dist/zonos-elements/p-de388ea0.entry.js +0 -1
- package/dist/zonos-elements/p-e14d89de.entry.js +0 -1
- package/dist/zonos-elements/p-f6e587bb.entry.js +0 -1
- package/dist/zonos-elements/p-f818bdf5.entry.js +0 -1
- package/dist/zonos-elements/p-fce6bffe.system.entry.js +0 -1
package/dist/scripts/index.d.ts
CHANGED
|
@@ -68,6 +68,85 @@ declare class IframeService {
|
|
|
68
68
|
}) => HTMLIFrameElement;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
type CustomEventMap = {
|
|
72
|
+
legacyCheckoutError: string;
|
|
73
|
+
'zonos-checkout-success': {
|
|
74
|
+
message: string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
declare const _envClientSchema: z.ZodObject<{
|
|
79
|
+
NEXT_PUBLIC_FLAG_URL: z.ZodString;
|
|
80
|
+
NEXT_PUBLIC_RELEASE_DATE: z.ZodString;
|
|
81
|
+
NEXT_PUBLIC_ZONOS_API_KEY: z.ZodString;
|
|
82
|
+
NEXT_PUBLIC_ZONOS_CDNJS_CDN_URL: z.ZodString;
|
|
83
|
+
NEXT_PUBLIC_ZONOS_CDN_URL: z.ZodString;
|
|
84
|
+
NEXT_PUBLIC_ZONOS_CLOUDFLARE_URL: z.ZodString;
|
|
85
|
+
NEXT_PUBLIC_ZONOS_JS_DELIVR_CDN_URL: z.ZodString;
|
|
86
|
+
NEXT_PUBLIC_ZONOS_PACKAGE_VERSION: z.ZodString;
|
|
87
|
+
NEXT_PUBLIC_ZONOS_ROUTE_URL: z.ZodString;
|
|
88
|
+
NEXT_PUBLIC_ZONOS_UNPKG_CDN_URL: z.ZodString;
|
|
89
|
+
}, "strip", z.ZodTypeAny, {
|
|
90
|
+
NEXT_PUBLIC_FLAG_URL: string;
|
|
91
|
+
NEXT_PUBLIC_RELEASE_DATE: string;
|
|
92
|
+
NEXT_PUBLIC_ZONOS_API_KEY: string;
|
|
93
|
+
NEXT_PUBLIC_ZONOS_CDNJS_CDN_URL: string;
|
|
94
|
+
NEXT_PUBLIC_ZONOS_CDN_URL: string;
|
|
95
|
+
NEXT_PUBLIC_ZONOS_CLOUDFLARE_URL: string;
|
|
96
|
+
NEXT_PUBLIC_ZONOS_JS_DELIVR_CDN_URL: string;
|
|
97
|
+
NEXT_PUBLIC_ZONOS_PACKAGE_VERSION: string;
|
|
98
|
+
NEXT_PUBLIC_ZONOS_ROUTE_URL: string;
|
|
99
|
+
NEXT_PUBLIC_ZONOS_UNPKG_CDN_URL: string;
|
|
100
|
+
}, {
|
|
101
|
+
NEXT_PUBLIC_FLAG_URL: string;
|
|
102
|
+
NEXT_PUBLIC_RELEASE_DATE: string;
|
|
103
|
+
NEXT_PUBLIC_ZONOS_API_KEY: string;
|
|
104
|
+
NEXT_PUBLIC_ZONOS_CDNJS_CDN_URL: string;
|
|
105
|
+
NEXT_PUBLIC_ZONOS_CDN_URL: string;
|
|
106
|
+
NEXT_PUBLIC_ZONOS_CLOUDFLARE_URL: string;
|
|
107
|
+
NEXT_PUBLIC_ZONOS_JS_DELIVR_CDN_URL: string;
|
|
108
|
+
NEXT_PUBLIC_ZONOS_PACKAGE_VERSION: string;
|
|
109
|
+
NEXT_PUBLIC_ZONOS_ROUTE_URL: string;
|
|
110
|
+
NEXT_PUBLIC_ZONOS_UNPKG_CDN_URL: string;
|
|
111
|
+
}>;
|
|
112
|
+
interface Env extends z.infer<typeof _envClientSchema> {
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/* eslint-disable no-relative-import-paths/no-relative-import-paths */
|
|
116
|
+
|
|
117
|
+
declare global {
|
|
118
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
|
|
119
|
+
interface Document {
|
|
120
|
+
addEventListener<K extends keyof CustomEventMap>(
|
|
121
|
+
type: K,
|
|
122
|
+
listener: (this: Document, ev: CustomEvent<CustomEventMap[K]>) => void,
|
|
123
|
+
): void;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
|
|
127
|
+
interface Window {
|
|
128
|
+
Stripe?: StripeConstructor;
|
|
129
|
+
Zonos: Zonos;
|
|
130
|
+
/**
|
|
131
|
+
* A flag to determine if the current page is a BigCommerce page
|
|
132
|
+
*/
|
|
133
|
+
bcConfig?: unknown;
|
|
134
|
+
/**
|
|
135
|
+
* This flag would be set to true if zonosQaUrl is present in the query params and preview script loadZonos.js is injected to DOM
|
|
136
|
+
*/
|
|
137
|
+
isZonosPreview?: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* A flag to determine if the current page is a BigCommerce page
|
|
140
|
+
*/
|
|
141
|
+
stencilBootstrap?: unknown;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
namespace NodeJS {
|
|
145
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
|
|
146
|
+
interface ProcessEnv extends Env {}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
71
150
|
declare const adjustmentSource: {
|
|
72
151
|
readonly ApiRequest: "API_REQUEST";
|
|
73
152
|
readonly PromoCode: "PROMO_CODE";
|
|
@@ -1008,6 +1087,13 @@ type CartCheckoutWorkflowQuery = {
|
|
|
1008
1087
|
}>;
|
|
1009
1088
|
updatedAt: string;
|
|
1010
1089
|
updatedBy: string;
|
|
1090
|
+
varianceTestRegistrations: Array<{
|
|
1091
|
+
testKey: string;
|
|
1092
|
+
varianceAllocation: Array<{
|
|
1093
|
+
percentage: number;
|
|
1094
|
+
variantKey: string;
|
|
1095
|
+
}>;
|
|
1096
|
+
}> | null;
|
|
1011
1097
|
visibilityStatus: CheckoutVisibilityStatus;
|
|
1012
1098
|
};
|
|
1013
1099
|
credentialTokenId: string;
|
|
@@ -1109,6 +1195,10 @@ type CheckoutSessionDetailsFragment = {
|
|
|
1109
1195
|
taxes: number;
|
|
1110
1196
|
total: number;
|
|
1111
1197
|
};
|
|
1198
|
+
varianceTestResults: Array<{
|
|
1199
|
+
selectedVariantKey: string;
|
|
1200
|
+
testKey: string;
|
|
1201
|
+
}> | null;
|
|
1112
1202
|
};
|
|
1113
1203
|
type GetOrderQuery = {
|
|
1114
1204
|
order: {
|
|
@@ -1222,6 +1312,167 @@ type GetOrderQuery = {
|
|
|
1222
1312
|
} | null;
|
|
1223
1313
|
};
|
|
1224
1314
|
|
|
1315
|
+
type TranslatedText = {
|
|
1316
|
+
[key: string]: string;
|
|
1317
|
+
};
|
|
1318
|
+
type EnteredInfo = {
|
|
1319
|
+
city: string;
|
|
1320
|
+
country: CountryCode;
|
|
1321
|
+
email: string;
|
|
1322
|
+
line1: string;
|
|
1323
|
+
line2: string;
|
|
1324
|
+
name: string;
|
|
1325
|
+
phone: string;
|
|
1326
|
+
postal_code: string;
|
|
1327
|
+
state: string;
|
|
1328
|
+
};
|
|
1329
|
+
type ValidateAddressFields = Omit<StripeAddressElementChangeEvent['value']['address'], 'country'> & {
|
|
1330
|
+
name: string;
|
|
1331
|
+
};
|
|
1332
|
+
type TranslatedAddressObject = {
|
|
1333
|
+
[key in keyof ValidateAddressFields]?: TranslatedText;
|
|
1334
|
+
};
|
|
1335
|
+
|
|
1336
|
+
type SubmitEventData = {
|
|
1337
|
+
billingAddress: Record<keyof TranslatedAddressObject, string> | null;
|
|
1338
|
+
shippingAddress: Record<keyof TranslatedAddressObject, string>;
|
|
1339
|
+
};
|
|
1340
|
+
|
|
1341
|
+
declare const colorPrefixes: readonly ["blue", "cyan", "green", "orange", "purple", "red", "gray", "glass"];
|
|
1342
|
+
declare const colorContrasts: readonly ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900", "950"];
|
|
1343
|
+
type ColorContrast = (typeof colorContrasts)[number];
|
|
1344
|
+
type ColorPrefix = (typeof colorPrefixes)[number];
|
|
1345
|
+
type Color = 'gray-0' | 'gray-50' | 'glass-0' | 'glass-50' | `${ColorPrefix}-${ColorContrast}` | 'gray-1000' | 'glass-1100' | 'glass-1200';
|
|
1346
|
+
declare const checkboxColorPrefix: readonly ["blue", "cyan", "green", "orange", "purple", "red", "gray"];
|
|
1347
|
+
type CheckboxColorPrefix = (typeof checkboxColorPrefix)[number];
|
|
1348
|
+
|
|
1349
|
+
type BannerIntent = 'default' | 'error' | 'success' | 'warning' | 'info';
|
|
1350
|
+
|
|
1351
|
+
declare const textOptions: {
|
|
1352
|
+
readonly pageHeader: {
|
|
1353
|
+
readonly label: "Page Header (3XL) · 34px (2.125rem)";
|
|
1354
|
+
readonly size: "3xl";
|
|
1355
|
+
readonly tag: "h2";
|
|
1356
|
+
readonly weight: 900;
|
|
1357
|
+
};
|
|
1358
|
+
readonly secondaryPageHeader: {
|
|
1359
|
+
readonly label: "Secondary Page Header (3XL) • 34px, 500 \"Medium\"";
|
|
1360
|
+
readonly size: "3xl";
|
|
1361
|
+
readonly tag: "h2";
|
|
1362
|
+
readonly weight: 500;
|
|
1363
|
+
};
|
|
1364
|
+
readonly header: {
|
|
1365
|
+
readonly label: "Header (2XL) · 28px (1.75rem)";
|
|
1366
|
+
readonly size: "2xl";
|
|
1367
|
+
readonly tag: "h3";
|
|
1368
|
+
readonly weight: 700;
|
|
1369
|
+
};
|
|
1370
|
+
readonly descriptionHeader: {
|
|
1371
|
+
readonly label: "Description Header (2XL) · 28px (1.75rem)";
|
|
1372
|
+
readonly size: "2xl";
|
|
1373
|
+
readonly tag: "h3";
|
|
1374
|
+
readonly weight: 700;
|
|
1375
|
+
};
|
|
1376
|
+
readonly title: {
|
|
1377
|
+
readonly label: "Title (XL) • 22px (1.375rem)";
|
|
1378
|
+
readonly size: "xl";
|
|
1379
|
+
readonly tag: "h4";
|
|
1380
|
+
readonly weight: 600;
|
|
1381
|
+
};
|
|
1382
|
+
readonly boldSubheader: {
|
|
1383
|
+
readonly label: "Bold Subheader (L) • 18px (1.125rem)";
|
|
1384
|
+
readonly size: "l";
|
|
1385
|
+
readonly tag: "h5";
|
|
1386
|
+
readonly weight: 700;
|
|
1387
|
+
};
|
|
1388
|
+
readonly semiBoldSubheader: {
|
|
1389
|
+
readonly label: "Semi Bold Subheader (L / H4) • 18px (1.125rem)";
|
|
1390
|
+
readonly size: "l";
|
|
1391
|
+
readonly tag: "h5";
|
|
1392
|
+
readonly weight: 600;
|
|
1393
|
+
};
|
|
1394
|
+
readonly subheader: {
|
|
1395
|
+
readonly label: "Subheader (L) • 18px (1.125rem)";
|
|
1396
|
+
readonly size: "l";
|
|
1397
|
+
readonly tag: "h5";
|
|
1398
|
+
readonly weight: 500;
|
|
1399
|
+
};
|
|
1400
|
+
readonly boldLabel: {
|
|
1401
|
+
readonly label: "Bold Label (Base) • 14px (.875rem)";
|
|
1402
|
+
readonly size: "base";
|
|
1403
|
+
readonly tag: "span";
|
|
1404
|
+
readonly weight: 700;
|
|
1405
|
+
};
|
|
1406
|
+
readonly semiBoldLabel: {
|
|
1407
|
+
readonly label: "Semi Bold Label (Base) • 14px (.875rem)";
|
|
1408
|
+
readonly size: "base";
|
|
1409
|
+
readonly tag: "span";
|
|
1410
|
+
readonly weight: 600;
|
|
1411
|
+
};
|
|
1412
|
+
readonly label: {
|
|
1413
|
+
readonly label: "Label (Base) • 14px (.875rem)";
|
|
1414
|
+
readonly size: "base";
|
|
1415
|
+
readonly tag: "span";
|
|
1416
|
+
readonly weight: 500;
|
|
1417
|
+
};
|
|
1418
|
+
readonly body: {
|
|
1419
|
+
readonly label: "Body (Base) • 14px (.875rem)";
|
|
1420
|
+
readonly size: "base";
|
|
1421
|
+
readonly tag: "span";
|
|
1422
|
+
readonly weight: 400;
|
|
1423
|
+
};
|
|
1424
|
+
readonly smallHeader: {
|
|
1425
|
+
readonly label: "Small header (S) • 12px (.75rem)";
|
|
1426
|
+
readonly size: "s";
|
|
1427
|
+
readonly tag: "span";
|
|
1428
|
+
readonly weight: 600;
|
|
1429
|
+
};
|
|
1430
|
+
readonly caption: {
|
|
1431
|
+
readonly label: "Caption (S) • 12px (.75rem)";
|
|
1432
|
+
readonly size: "s";
|
|
1433
|
+
readonly tag: "span";
|
|
1434
|
+
readonly weight: 400;
|
|
1435
|
+
};
|
|
1436
|
+
readonly hintText: {
|
|
1437
|
+
readonly label: "Hint text (XS) • 10px (.625rem)";
|
|
1438
|
+
readonly size: "xs";
|
|
1439
|
+
readonly tag: "span";
|
|
1440
|
+
readonly weight: 400;
|
|
1441
|
+
};
|
|
1442
|
+
};
|
|
1443
|
+
type TextOptions = typeof textOptions;
|
|
1444
|
+
type Size = TextOptions[keyof TextOptions]['size'];
|
|
1445
|
+
type Type = keyof TextOptions;
|
|
1446
|
+
type FontWeight = TextOptions[keyof TextOptions]['weight'];
|
|
1447
|
+
|
|
1448
|
+
type CustomAddressErrors = {
|
|
1449
|
+
city: string;
|
|
1450
|
+
firstName: string;
|
|
1451
|
+
lastName: string;
|
|
1452
|
+
line1: string;
|
|
1453
|
+
phone: string;
|
|
1454
|
+
postalCode: string;
|
|
1455
|
+
/**
|
|
1456
|
+
* Toggle to indicate if the error message should be shown
|
|
1457
|
+
*/
|
|
1458
|
+
showError: boolean;
|
|
1459
|
+
state: string;
|
|
1460
|
+
};
|
|
1461
|
+
|
|
1462
|
+
type StripeStoreContactOption = {
|
|
1463
|
+
address: {
|
|
1464
|
+
city: string;
|
|
1465
|
+
country: string;
|
|
1466
|
+
line1: string;
|
|
1467
|
+
line2?: string;
|
|
1468
|
+
postal_code: string;
|
|
1469
|
+
state: string;
|
|
1470
|
+
};
|
|
1471
|
+
email: string;
|
|
1472
|
+
name: string;
|
|
1473
|
+
phone?: string;
|
|
1474
|
+
};
|
|
1475
|
+
|
|
1225
1476
|
type TabItem = {
|
|
1226
1477
|
index: number;
|
|
1227
1478
|
isDone: boolean;
|
|
@@ -1260,761 +1511,144 @@ type CartItem = {
|
|
|
1260
1511
|
sku?: string;
|
|
1261
1512
|
};
|
|
1262
1513
|
|
|
1263
|
-
type
|
|
1264
|
-
amount: number;
|
|
1265
|
-
name?: string | null;
|
|
1266
|
-
productId: string | null;
|
|
1267
|
-
promoCode?: string | null;
|
|
1268
|
-
sku: string | null;
|
|
1269
|
-
type: LandedCostAdjustmentType;
|
|
1270
|
-
};
|
|
1271
|
-
type Extensions = {
|
|
1272
|
-
[key: string]: unknown;
|
|
1273
|
-
} & {
|
|
1274
|
-
rule?: {
|
|
1275
|
-
description: string;
|
|
1276
|
-
id: string;
|
|
1277
|
-
name: string;
|
|
1278
|
-
};
|
|
1279
|
-
ruleMessageType?: 'CUSTOM' | 'DEFAULT';
|
|
1280
|
-
};
|
|
1281
|
-
type ApiError = {
|
|
1282
|
-
extensions?: Extensions | null;
|
|
1514
|
+
type NotificationInit = {
|
|
1283
1515
|
message: string;
|
|
1284
|
-
};
|
|
1285
|
-
type CalculateLandedCostRequest = {
|
|
1286
|
-
billingAddress: {
|
|
1287
|
-
addressLine1: string;
|
|
1288
|
-
addressLine2?: string | undefined;
|
|
1289
|
-
city: string;
|
|
1290
|
-
country: CountryCode;
|
|
1291
|
-
postalCode: string;
|
|
1292
|
-
state: string;
|
|
1293
|
-
};
|
|
1294
|
-
billingContact: {
|
|
1295
|
-
firstName: string;
|
|
1296
|
-
lastName: string;
|
|
1297
|
-
phone: string;
|
|
1298
|
-
};
|
|
1299
|
-
checkoutSessionId: string;
|
|
1300
|
-
contact: {
|
|
1301
|
-
companyName?: string;
|
|
1302
|
-
email?: string;
|
|
1303
|
-
firstName: string;
|
|
1304
|
-
lastName: string;
|
|
1305
|
-
phone: string;
|
|
1306
|
-
};
|
|
1307
1516
|
/**
|
|
1308
|
-
*
|
|
1517
|
+
* Time in milliseconds
|
|
1518
|
+
* @default 4000
|
|
1309
1519
|
*/
|
|
1310
|
-
|
|
1311
|
-
items: CartItem[];
|
|
1312
|
-
landedCostAdjustments?: CalculateLandedCostAdjustmentInput[];
|
|
1313
|
-
metadata?: {
|
|
1314
|
-
key: string;
|
|
1315
|
-
value: string;
|
|
1316
|
-
}[];
|
|
1520
|
+
timeout?: number;
|
|
1317
1521
|
/**
|
|
1318
|
-
*
|
|
1522
|
+
* Type of notification
|
|
1523
|
+
* @default 'success'
|
|
1319
1524
|
*/
|
|
1320
|
-
|
|
1321
|
-
shippingAddress: {
|
|
1322
|
-
addressLine1: string;
|
|
1323
|
-
addressLine2?: string | undefined;
|
|
1324
|
-
city: string;
|
|
1325
|
-
country: CountryCode;
|
|
1326
|
-
postalCode: string;
|
|
1327
|
-
state: string;
|
|
1328
|
-
};
|
|
1525
|
+
type?: 'error' | 'success' | 'warning';
|
|
1329
1526
|
};
|
|
1330
1527
|
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1528
|
+
declare const localeElementsSupportedLocationCodeEnum: {
|
|
1529
|
+
readonly Ar: "ar";
|
|
1530
|
+
readonly Da: "da";
|
|
1531
|
+
readonly De: "de";
|
|
1532
|
+
readonly En: "en";
|
|
1533
|
+
readonly Es: "es";
|
|
1534
|
+
readonly Fr: "fr";
|
|
1535
|
+
readonly He: "he";
|
|
1536
|
+
readonly Id: "id";
|
|
1537
|
+
readonly It: "it";
|
|
1538
|
+
readonly Ja: "ja";
|
|
1539
|
+
readonly Ko: "ko";
|
|
1540
|
+
readonly Nl: "nl";
|
|
1541
|
+
readonly No: "no";
|
|
1542
|
+
readonly Pl: "pl";
|
|
1543
|
+
readonly Pt: "pt";
|
|
1544
|
+
readonly Ru: "ru";
|
|
1545
|
+
readonly Sv: "sv";
|
|
1546
|
+
readonly Tr: "tr";
|
|
1547
|
+
readonly Vi: "vi";
|
|
1548
|
+
readonly Zh: "zh";
|
|
1340
1549
|
};
|
|
1341
|
-
type
|
|
1342
|
-
errors: ApiError[];
|
|
1343
|
-
}) | null;
|
|
1550
|
+
type Locale_ElementsSupportedLocationCode_Enum = (typeof localeElementsSupportedLocationCodeEnum)[keyof typeof localeElementsSupportedLocationCodeEnum];
|
|
1344
1551
|
|
|
1345
|
-
type
|
|
1552
|
+
type ICountry = {
|
|
1553
|
+
bigcommerceDisplayName?: string;
|
|
1554
|
+
code: CountryCode;
|
|
1555
|
+
currencyCode: string;
|
|
1556
|
+
displayName: string;
|
|
1557
|
+
languageCode: Locale_ElementsSupportedLocationCode_Enum;
|
|
1558
|
+
};
|
|
1559
|
+
type ICountryJson = {
|
|
1560
|
+
[countryCode: string]: ICountry;
|
|
1561
|
+
};
|
|
1346
1562
|
|
|
1347
|
-
type
|
|
1348
|
-
|
|
1349
|
-
|
|
1563
|
+
type Items = CheckItemRestrictionsMutation['itemRestrictionApply']['items'];
|
|
1564
|
+
type RestrictedItem = Items[number] & {
|
|
1565
|
+
name?: string;
|
|
1350
1566
|
};
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1567
|
+
|
|
1568
|
+
declare const restStateType: readonly ["Boxes", "Earth", "EmptyBox", "Lock", "PigBank", "Scribble", "Search", "Settings", "ShoppingCart", "SpilledCup", "Switch", "TaxId", "Truck", "Warning"];
|
|
1569
|
+
type RestStateType = (typeof restStateType)[number];
|
|
1570
|
+
|
|
1571
|
+
type ShippingRichRadioItem = {
|
|
1572
|
+
amount: number;
|
|
1573
|
+
caption?: string;
|
|
1574
|
+
label: string;
|
|
1575
|
+
landedCostId: string;
|
|
1576
|
+
method: IncotermCode;
|
|
1577
|
+
price: string;
|
|
1578
|
+
shipmentRatingId: string;
|
|
1579
|
+
sublabel?: string;
|
|
1580
|
+
value: string | number;
|
|
1365
1581
|
};
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1582
|
+
|
|
1583
|
+
type SpinnerColor = 'primary' | 'info' | 'success' | 'danger' | 'warning' | 'black' | 'white';
|
|
1584
|
+
|
|
1585
|
+
type CountryFieldLabelStateLabel = 'Commune' | 'County' | 'County or sector' | 'Department' | 'Derzhava' | 'District' | 'Do/Si' | 'Island' | 'Municipality' | 'Oblast' | 'Parish' | 'Prefecture' | 'Province' | 'Region' | 'State' | 'State or Territory' | 'State or province' | 'Village';
|
|
1586
|
+
type CountryFieldLabelAddress1Label = 'Address line 1' | 'Address1' | 'Adresa vulytsi' | 'Street address' | 'Street or avenue' | 'Ulica';
|
|
1587
|
+
type CountryFieldLabelAddress2Label = '' | 'Address 2' | 'Address line 2' | 'Address2' | 'Sector' | 'Street address 2';
|
|
1588
|
+
type CountryFieldLabelAddress3Label = '' | 'Address line 3' | 'Address3' | 'CEDEX' | 'Street address 3';
|
|
1589
|
+
type CountryFieldLabelCityLabel = '' | 'Area' | 'City' | 'City/Town' | 'Emirate' | 'Gorod' | 'Locality' | 'Misto' | 'Town' | 'Town / City' | 'Town or city';
|
|
1590
|
+
type CountryFieldLabelZipLabel = '' | 'Code postal' | 'Indeks' | 'Kodepos' | 'Poshtovyy indeks' | 'Postal code' | 'Postcode' | 'ZIP code' | 'Zip';
|
|
1591
|
+
type ICountryFieldLabelRegion = {
|
|
1592
|
+
interpayCode: string;
|
|
1370
1593
|
};
|
|
1371
|
-
type
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1594
|
+
type CountryFields = {
|
|
1595
|
+
address1Label: CountryFieldLabelAddress1Label;
|
|
1596
|
+
address1Required: boolean;
|
|
1597
|
+
address1Show: boolean;
|
|
1598
|
+
address2Label: CountryFieldLabelAddress2Label;
|
|
1599
|
+
address2Required: boolean;
|
|
1600
|
+
address2Show: boolean;
|
|
1601
|
+
address3Label: CountryFieldLabelAddress3Label;
|
|
1602
|
+
address3Required: boolean;
|
|
1603
|
+
address3Show: boolean;
|
|
1604
|
+
cityLabel: CountryFieldLabelCityLabel;
|
|
1605
|
+
cityRequired: boolean;
|
|
1606
|
+
cityShow: boolean;
|
|
1607
|
+
countryCode: CountryCode;
|
|
1608
|
+
countryCodeLabel?: string;
|
|
1609
|
+
displayName: string;
|
|
1610
|
+
nameLabel: string;
|
|
1611
|
+
phoneCode: number;
|
|
1612
|
+
phoneFormat: string | null;
|
|
1613
|
+
phonePlaceholder: string | null;
|
|
1614
|
+
regions: Record<string, ICountryFieldLabelRegion> | null;
|
|
1615
|
+
stateLabel: CountryFieldLabelStateLabel;
|
|
1616
|
+
stateRequired: boolean;
|
|
1617
|
+
stateShow: boolean;
|
|
1618
|
+
zipFormat: string | null;
|
|
1619
|
+
zipLabel: CountryFieldLabelZipLabel;
|
|
1620
|
+
zipRegex: string | null;
|
|
1621
|
+
zipRequired: boolean;
|
|
1622
|
+
zipShow: boolean;
|
|
1623
|
+
};
|
|
1624
|
+
|
|
1625
|
+
type GenericZonosSettings = {
|
|
1394
1626
|
/**
|
|
1395
|
-
*
|
|
1627
|
+
* Country that should be enable the custom address fields in the checkout based on the country user is from.
|
|
1396
1628
|
*/
|
|
1397
|
-
|
|
1629
|
+
countryCustomAddressEnabled?: CountryCode[];
|
|
1398
1630
|
/**
|
|
1399
|
-
*
|
|
1400
|
-
* @default 3_600 (1 hour)
|
|
1631
|
+
* List of countries and
|
|
1401
1632
|
*/
|
|
1402
|
-
|
|
1633
|
+
countryFields?: Record<CountryCode, CountryFields>;
|
|
1403
1634
|
/**
|
|
1404
|
-
*
|
|
1405
|
-
* @note if set to true, the place order button will not be enabled or disabled
|
|
1635
|
+
* URL of the hosted checkout.
|
|
1406
1636
|
*/
|
|
1407
|
-
|
|
1408
|
-
externalPaymentMethods: Array<{
|
|
1409
|
-
status: ExternalPaymentMethodStatus;
|
|
1410
|
-
type: ExternalPaymentMethodType;
|
|
1411
|
-
}> | null;
|
|
1412
|
-
externalServiceTokens: {
|
|
1413
|
-
token: string;
|
|
1414
|
-
type: ExternalServiceTokenType;
|
|
1415
|
-
}[];
|
|
1637
|
+
hostedCheckoutUrl?: string;
|
|
1416
1638
|
/**
|
|
1417
|
-
*
|
|
1418
|
-
* @default TEST
|
|
1639
|
+
* Use custom address fields in the checkout based on the country user is from.
|
|
1419
1640
|
*/
|
|
1420
|
-
|
|
1421
|
-
orderNotifications: {
|
|
1422
|
-
abandonedCart: {
|
|
1423
|
-
delay: number;
|
|
1424
|
-
discountPercent: number;
|
|
1425
|
-
status: {
|
|
1426
|
-
active: NotificationActiveStatus;
|
|
1427
|
-
sendCopiesTo: Array<string>;
|
|
1428
|
-
};
|
|
1429
|
-
};
|
|
1430
|
-
orderCancelled: {
|
|
1431
|
-
active: NotificationActiveStatus;
|
|
1432
|
-
sendCopiesTo: Array<string>;
|
|
1433
|
-
};
|
|
1434
|
-
orderShipped: {
|
|
1435
|
-
active: NotificationActiveStatus;
|
|
1436
|
-
sendCopiesTo: Array<string>;
|
|
1437
|
-
};
|
|
1438
|
-
};
|
|
1439
|
-
organization: string;
|
|
1641
|
+
shouldEnabledCustomAddress?: boolean;
|
|
1440
1642
|
/**
|
|
1441
|
-
*
|
|
1643
|
+
* Signed token for Google Places API iframe access.
|
|
1442
1644
|
*/
|
|
1443
|
-
|
|
1645
|
+
signedTokenGooglePlaces?: string;
|
|
1444
1646
|
/**
|
|
1445
|
-
*
|
|
1446
|
-
*
|
|
1447
|
-
* **NOTE: this value can't be overridden in Zonos.init**
|
|
1647
|
+
* List of countries that are allowed to use USD denominated cards for settlement.
|
|
1448
1648
|
*/
|
|
1449
|
-
|
|
1450
|
-
successBehavior: CheckoutSuccessBehavior;
|
|
1451
|
-
/**
|
|
1452
|
-
* The success page action text for checkout.
|
|
1453
|
-
* @note Default text supports translation automatically, but any custom text will not be translated.
|
|
1454
|
-
*/
|
|
1455
|
-
successPageActionText?: string;
|
|
1456
|
-
/**
|
|
1457
|
-
* The success page subtitle text for checkout. Each item in the array will appear on a new line.
|
|
1458
|
-
* @note Default text supports translation automatically, but any custom text will not be translated.
|
|
1459
|
-
*/
|
|
1460
|
-
successPageSubtitleText?: string[];
|
|
1461
|
-
/**
|
|
1462
|
-
* The success page title text for checkout.
|
|
1463
|
-
* @note Default text supports translation automatically, but any custom text will not be translated.
|
|
1464
|
-
*/
|
|
1465
|
-
successPageTitleText?: string;
|
|
1466
|
-
successRedirectUrl: string;
|
|
1467
|
-
visibilityStatus: CheckoutVisibilityStatus;
|
|
1468
|
-
/**
|
|
1469
|
-
* Cart info callback for checkout (optional),
|
|
1470
|
-
* @deprecated This is deprecated in favor of the new callback `createCartId`. The new API would only need the cart ID to retrieve cart data.
|
|
1471
|
-
* @note will attempt to use cart data if available
|
|
1472
|
-
* User can dispatch an event 'zonos--init-cart-info' to update the cart
|
|
1473
|
-
* @example
|
|
1474
|
-
* const initEvent = new CustomEvent<CartItem[]>('zonos--init-cart-info', {
|
|
1475
|
-
* detail: cartItems,
|
|
1476
|
-
* });
|
|
1477
|
-
* document.body.dispatchEvent(initEvent);
|
|
1478
|
-
* @returns {object[]} - object with the the item info to be added to cart:
|
|
1479
|
-
* - amount: number;
|
|
1480
|
-
* - countryOfOrigin?: string;
|
|
1481
|
-
* - currencyCode: string;
|
|
1482
|
-
* - description?: string;
|
|
1483
|
-
* - hsCode?: string;
|
|
1484
|
-
* - imageUrl?: string;
|
|
1485
|
-
* - name: string;
|
|
1486
|
-
* - productId?: string;
|
|
1487
|
-
* - quantity: number;
|
|
1488
|
-
*/
|
|
1489
|
-
buildCartDetail?: (params: BuildCardDetailParams) => Promise<CartItem[]>;
|
|
1490
|
-
/**
|
|
1491
|
-
* Calculate landed cost callback for checkout (optional)
|
|
1492
|
-
* @deprecated This is deprecated in favor of the new callback `createCartId`. When using the new callback, the cart details will be retrieved using the cart ID, so this callback would no longer be needed.
|
|
1493
|
-
* @note will attempt to use cart data if available
|
|
1494
|
-
*/
|
|
1495
|
-
buildLandedCost?: (params: BuildLandedCostParams) => Promise<BuildLandedCostResponse>;
|
|
1496
|
-
/**
|
|
1497
|
-
* A callback that returns the cart id from `cartCreate` mutation. You would use your cart data to call the `cartCreate` mutation and return the cart ID that was created.
|
|
1498
|
-
* @note
|
|
1499
|
-
* The mutation `cartCreate` should be called on the server side
|
|
1500
|
-
* @returns string - Cart ID
|
|
1501
|
-
*/
|
|
1502
|
-
createCartId?: () => PromiseOrValue<string | CreateCartIdObject>;
|
|
1503
|
-
/**
|
|
1504
|
-
* Callback trigger when the checkout is closed
|
|
1505
|
-
*/
|
|
1506
|
-
onClose?: () => void;
|
|
1507
|
-
/**
|
|
1508
|
-
* This callback is optional. If provided, it will be called right before the payment is processed.
|
|
1509
|
-
* @param items - The cart items.
|
|
1510
|
-
* @returns {string | null} - The error message to display to the user. If the message is empty or null, the payment will proceed.
|
|
1511
|
-
* @example
|
|
1512
|
-
* onInventoryCheck: async ({ items }) => {
|
|
1513
|
-
* // Check if all items are available from the server. If the fetch is throwing an error, show a generic error message "Unable to check inventory. Please try again.".
|
|
1514
|
-
* const itemsInfo = await fetch('https://yourserver.com/api/get-available-items', {
|
|
1515
|
-
* method: 'POST',
|
|
1516
|
-
* body: JSON.stringify({ items }),
|
|
1517
|
-
* });
|
|
1518
|
-
* const items = await itemsInfo.json();
|
|
1519
|
-
* // Filter out unavailable items.
|
|
1520
|
-
* const unavailableItems = items.filter(item => !item.available);
|
|
1521
|
-
* if (unavailableItems.length) {
|
|
1522
|
-
* // Display an error message to the user.
|
|
1523
|
-
* return `The following items are not available: ${unavailableItems.map(item => item.name).join(', ')}`;
|
|
1524
|
-
* }
|
|
1525
|
-
* // Proceed with the payment if you return an empty string or null.
|
|
1526
|
-
* return '';
|
|
1527
|
-
* }
|
|
1528
|
-
*/
|
|
1529
|
-
onInventoryCheck?: (params: {
|
|
1530
|
-
items: CartItem[];
|
|
1531
|
-
}) => Promise<string | null>;
|
|
1532
|
-
/**
|
|
1533
|
-
* Callback trigger when payment succeeds
|
|
1534
|
-
*/
|
|
1535
|
-
onOrderSuccess?: (props: {
|
|
1536
|
-
zonosApiRoute: string;
|
|
1537
|
-
zonosOrder: ZonosOrder;
|
|
1538
|
-
}) => Promise<void>;
|
|
1539
|
-
};
|
|
1540
|
-
|
|
1541
|
-
type CountryOverrideBehavior = 'URL_PARAM' | 'SESSION';
|
|
1542
|
-
type ShowForCountries = 'ALL' | 'ONLY_SHIPPABLE' | CountryCode[];
|
|
1543
|
-
type ShowCountryList = 'ALL' | 'ONLY_SHIPPABLE' | CountryCode[];
|
|
1544
|
-
type HelloConfig = {
|
|
1545
|
-
anchorElementSelector: string;
|
|
1546
|
-
cartUrlPattern: string | null;
|
|
1547
|
-
/**
|
|
1548
|
-
* The behavior to use when determining the country to use for the user.
|
|
1549
|
-
* @default 'URL_PARAM'
|
|
1550
|
-
*/
|
|
1551
|
-
countryOverrideBehavior?: CountryOverrideBehavior;
|
|
1552
|
-
currencyBehavior: HelloCurrencyBehavior;
|
|
1553
|
-
currencyElementSelector: string;
|
|
1554
|
-
desktopLocation?: HelloMobileLocation | null;
|
|
1555
|
-
excludedUrlPatterns: Array<string>;
|
|
1556
|
-
homepageUrlPattern: string | null;
|
|
1557
|
-
mobileLocation: HelloMobileLocation | null;
|
|
1558
|
-
mode: Mode;
|
|
1559
|
-
/**
|
|
1560
|
-
* Position of floating hello if `anchorElementSelector` is not found after 3 seconds
|
|
1561
|
-
*
|
|
1562
|
-
* null: don't render if not found
|
|
1563
|
-
*
|
|
1564
|
-
* @default null
|
|
1565
|
-
*/
|
|
1566
|
-
notFoundElementFallback: HelloMobileLocation | null;
|
|
1567
|
-
organization: string;
|
|
1568
|
-
peekMessageBehavior: HelloPeekMessageBehavior;
|
|
1569
|
-
peekMessageDelay: number;
|
|
1570
|
-
productAddToCartElementSelector: string | null;
|
|
1571
|
-
productDescriptionElementSelector: string | null;
|
|
1572
|
-
productDetailUrlPattern: string | null;
|
|
1573
|
-
productListUrlPattern: string | null;
|
|
1574
|
-
productTitleElementSelector: string | null;
|
|
1575
|
-
restrictionBehavior: HelloRestrictionBehavior;
|
|
1576
|
-
/**
|
|
1577
|
-
* The countries to include in the country list dropdown of the Hello widget.
|
|
1578
|
-
* @default ONLY_SHIPPABLE
|
|
1579
|
-
*/
|
|
1580
|
-
showCountryList?: ShowCountryList;
|
|
1581
|
-
/**
|
|
1582
|
-
* The countries to show the widget for.
|
|
1583
|
-
* @default ONLY_SHIPPABLE
|
|
1584
|
-
*/
|
|
1585
|
-
showForCountries?: ShowForCountries;
|
|
1586
|
-
visibilityStatus?: 'ENABLED' | 'DISABLED';
|
|
1587
|
-
/**
|
|
1588
|
-
* Callback function to run after the Hello widget has been initialized. This should be triggered only once when hello is attached to the DOM.
|
|
1589
|
-
* **Note**: If hello is detached from the DOM and reattached, this callback will be called again.
|
|
1590
|
-
* @param params - The parameters containing the country code and currency code that hello is initialized with.
|
|
1591
|
-
*/
|
|
1592
|
-
onInitSuccess?: (params: {
|
|
1593
|
-
countryCode: CountryCode;
|
|
1594
|
-
currencyCode: CurrencyCode;
|
|
1595
|
-
}) => Promise<void>;
|
|
1596
|
-
};
|
|
1597
|
-
|
|
1598
|
-
type CountryFieldLabelStateLabel = 'Commune' | 'County' | 'County or sector' | 'Department' | 'Derzhava' | 'District' | 'Do/Si' | 'Island' | 'Municipality' | 'Oblast' | 'Parish' | 'Prefecture' | 'Province' | 'Region' | 'State' | 'State or Territory' | 'State or province' | 'Village';
|
|
1599
|
-
type CountryFieldLabelAddress1Label = 'Address line 1' | 'Address1' | 'Adresa vulytsi' | 'Street address' | 'Street or avenue' | 'Ulica';
|
|
1600
|
-
type CountryFieldLabelAddress2Label = '' | 'Address 2' | 'Address line 2' | 'Address2' | 'Sector' | 'Street address 2';
|
|
1601
|
-
type CountryFieldLabelAddress3Label = '' | 'Address line 3' | 'Address3' | 'CEDEX' | 'Street address 3';
|
|
1602
|
-
type CountryFieldLabelCityLabel = '' | 'Area' | 'City' | 'City/Town' | 'Emirate' | 'Gorod' | 'Locality' | 'Misto' | 'Town' | 'Town / City' | 'Town or city';
|
|
1603
|
-
type CountryFieldLabelZipLabel = '' | 'Code postal' | 'Indeks' | 'Kodepos' | 'Poshtovyy indeks' | 'Postal code' | 'Postcode' | 'ZIP code' | 'Zip';
|
|
1604
|
-
type ICountryFieldLabelRegion = {
|
|
1605
|
-
interpayCode: string;
|
|
1606
|
-
};
|
|
1607
|
-
type CountryFields = {
|
|
1608
|
-
address1Label: CountryFieldLabelAddress1Label;
|
|
1609
|
-
address1Required: boolean;
|
|
1610
|
-
address1Show: boolean;
|
|
1611
|
-
address2Label: CountryFieldLabelAddress2Label;
|
|
1612
|
-
address2Required: boolean;
|
|
1613
|
-
address2Show: boolean;
|
|
1614
|
-
address3Label: CountryFieldLabelAddress3Label;
|
|
1615
|
-
address3Required: boolean;
|
|
1616
|
-
address3Show: boolean;
|
|
1617
|
-
cityLabel: CountryFieldLabelCityLabel;
|
|
1618
|
-
cityRequired: boolean;
|
|
1619
|
-
cityShow: boolean;
|
|
1620
|
-
countryCode: CountryCode;
|
|
1621
|
-
countryCodeLabel?: string;
|
|
1622
|
-
displayName: string;
|
|
1623
|
-
nameLabel: string;
|
|
1624
|
-
phoneCode: number;
|
|
1625
|
-
phoneFormat: string | null;
|
|
1626
|
-
phonePlaceholder: string | null;
|
|
1627
|
-
regions: Record<string, ICountryFieldLabelRegion> | null;
|
|
1628
|
-
stateLabel: CountryFieldLabelStateLabel;
|
|
1629
|
-
stateRequired: boolean;
|
|
1630
|
-
stateShow: boolean;
|
|
1631
|
-
zipFormat: string | null;
|
|
1632
|
-
zipLabel: CountryFieldLabelZipLabel;
|
|
1633
|
-
zipRegex: string | null;
|
|
1634
|
-
zipRequired: boolean;
|
|
1635
|
-
zipShow: boolean;
|
|
1636
|
-
};
|
|
1637
|
-
|
|
1638
|
-
type GenericZonosSettings = {
|
|
1639
|
-
/**
|
|
1640
|
-
* Whether to enable company name input in the checkout.
|
|
1641
|
-
*/
|
|
1642
|
-
companyNameInputEnabled?: boolean;
|
|
1643
|
-
/**
|
|
1644
|
-
* Country that should be enable the custom address fields in the checkout based on the country user is from.
|
|
1645
|
-
*/
|
|
1646
|
-
countryCustomAddressEnabled?: CountryCode[];
|
|
1647
|
-
/**
|
|
1648
|
-
* List of countries and
|
|
1649
|
-
*/
|
|
1650
|
-
countryFields?: Record<CountryCode, CountryFields>;
|
|
1651
|
-
/**
|
|
1652
|
-
* Use custom address fields in the checkout based on the country user is from.
|
|
1653
|
-
*/
|
|
1654
|
-
shouldEnabledCustomAddress?: boolean;
|
|
1655
|
-
/**
|
|
1656
|
-
* Signed token for Google Places API iframe access.
|
|
1657
|
-
*/
|
|
1658
|
-
signedTokenGooglePlaces?: string;
|
|
1659
|
-
/**
|
|
1660
|
-
* List of countries that are allowed to use USD denominated cards for settlement.
|
|
1661
|
-
*/
|
|
1662
|
-
usdSettlementCountryEnabled?: CountryCode[];
|
|
1663
|
-
};
|
|
1664
|
-
|
|
1665
|
-
type AppearanceConfig = {
|
|
1666
|
-
colorPrimary?: string;
|
|
1667
|
-
colorSecondary?: string;
|
|
1668
|
-
fontFamily: string;
|
|
1669
|
-
fontSize2XL?: number;
|
|
1670
|
-
fontSize3XL?: number;
|
|
1671
|
-
fontSizeBase?: number;
|
|
1672
|
-
fontSizeInputLabel?: number;
|
|
1673
|
-
fontSizeInputValue?: number;
|
|
1674
|
-
fontSizeL?: number;
|
|
1675
|
-
fontSizeS?: number;
|
|
1676
|
-
fontSizeXL?: number;
|
|
1677
|
-
fontSizeXS?: number;
|
|
1678
|
-
logoUrl: string;
|
|
1679
|
-
style: ElementsUiStyle;
|
|
1680
|
-
theme: ElementsUiTheme;
|
|
1681
|
-
zonosAttribution: ZonosAttribution | null;
|
|
1682
|
-
};
|
|
1683
|
-
|
|
1684
|
-
declare const fallbackApiType: readonly ["cloudflare", "vercel"];
|
|
1685
|
-
type FallBackApiType = (typeof fallbackApiType)[number];
|
|
1686
|
-
|
|
1687
|
-
type LogBulkLoadRequestPayload = {
|
|
1688
|
-
data: {
|
|
1689
|
-
apiType: FallBackApiType;
|
|
1690
|
-
connectionType?: string;
|
|
1691
|
-
href: string;
|
|
1692
|
-
isHostedCheckout: boolean;
|
|
1693
|
-
isMobile: boolean;
|
|
1694
|
-
loadTimeBrowserApi: number;
|
|
1695
|
-
loadTimeInternal: number;
|
|
1696
|
-
loadTimeTotal: number;
|
|
1697
|
-
metadata: Record<string, unknown>;
|
|
1698
|
-
screenHeight: number;
|
|
1699
|
-
screenWidth: number;
|
|
1700
|
-
userAgent: string;
|
|
1701
|
-
}[];
|
|
1702
|
-
storeId: number;
|
|
1703
|
-
};
|
|
1704
|
-
|
|
1705
|
-
type LoadTimeApiLogInfo = LogBulkLoadRequestPayload['data'][number];
|
|
1706
|
-
|
|
1707
|
-
type CustomEventMap = {
|
|
1708
|
-
legacyCheckoutError: string;
|
|
1709
|
-
'zonos-checkout-success': {
|
|
1710
|
-
message: string;
|
|
1711
|
-
};
|
|
1712
|
-
};
|
|
1713
|
-
|
|
1714
|
-
declare const _envClientSchema: z.ZodObject<{
|
|
1715
|
-
NEXT_PUBLIC_FLAG_URL: z.ZodString;
|
|
1716
|
-
NEXT_PUBLIC_RELEASE_DATE: z.ZodString;
|
|
1717
|
-
NEXT_PUBLIC_ZONOS_API_KEY: z.ZodString;
|
|
1718
|
-
NEXT_PUBLIC_ZONOS_CDNJS_CDN_URL: z.ZodString;
|
|
1719
|
-
NEXT_PUBLIC_ZONOS_CDN_URL: z.ZodString;
|
|
1720
|
-
NEXT_PUBLIC_ZONOS_CLOUDFLARE_URL: z.ZodString;
|
|
1721
|
-
NEXT_PUBLIC_ZONOS_JS_DELIVR_CDN_URL: z.ZodString;
|
|
1722
|
-
NEXT_PUBLIC_ZONOS_PACKAGE_VERSION: z.ZodString;
|
|
1723
|
-
NEXT_PUBLIC_ZONOS_ROUTE_URL: z.ZodString;
|
|
1724
|
-
NEXT_PUBLIC_ZONOS_UNPKG_CDN_URL: z.ZodString;
|
|
1725
|
-
}, "strip", z.ZodTypeAny, {
|
|
1726
|
-
NEXT_PUBLIC_FLAG_URL: string;
|
|
1727
|
-
NEXT_PUBLIC_RELEASE_DATE: string;
|
|
1728
|
-
NEXT_PUBLIC_ZONOS_API_KEY: string;
|
|
1729
|
-
NEXT_PUBLIC_ZONOS_CDNJS_CDN_URL: string;
|
|
1730
|
-
NEXT_PUBLIC_ZONOS_CDN_URL: string;
|
|
1731
|
-
NEXT_PUBLIC_ZONOS_CLOUDFLARE_URL: string;
|
|
1732
|
-
NEXT_PUBLIC_ZONOS_JS_DELIVR_CDN_URL: string;
|
|
1733
|
-
NEXT_PUBLIC_ZONOS_PACKAGE_VERSION: string;
|
|
1734
|
-
NEXT_PUBLIC_ZONOS_ROUTE_URL: string;
|
|
1735
|
-
NEXT_PUBLIC_ZONOS_UNPKG_CDN_URL: string;
|
|
1736
|
-
}, {
|
|
1737
|
-
NEXT_PUBLIC_FLAG_URL: string;
|
|
1738
|
-
NEXT_PUBLIC_RELEASE_DATE: string;
|
|
1739
|
-
NEXT_PUBLIC_ZONOS_API_KEY: string;
|
|
1740
|
-
NEXT_PUBLIC_ZONOS_CDNJS_CDN_URL: string;
|
|
1741
|
-
NEXT_PUBLIC_ZONOS_CDN_URL: string;
|
|
1742
|
-
NEXT_PUBLIC_ZONOS_CLOUDFLARE_URL: string;
|
|
1743
|
-
NEXT_PUBLIC_ZONOS_JS_DELIVR_CDN_URL: string;
|
|
1744
|
-
NEXT_PUBLIC_ZONOS_PACKAGE_VERSION: string;
|
|
1745
|
-
NEXT_PUBLIC_ZONOS_ROUTE_URL: string;
|
|
1746
|
-
NEXT_PUBLIC_ZONOS_UNPKG_CDN_URL: string;
|
|
1747
|
-
}>;
|
|
1748
|
-
interface Env extends z.infer<typeof _envClientSchema> {
|
|
1749
|
-
}
|
|
1750
|
-
|
|
1751
|
-
/* eslint-disable no-relative-import-paths/no-relative-import-paths */
|
|
1752
|
-
|
|
1753
|
-
declare global {
|
|
1754
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
|
|
1755
|
-
interface Document {
|
|
1756
|
-
addEventListener<K extends keyof CustomEventMap>(
|
|
1757
|
-
type: K,
|
|
1758
|
-
listener: (this: Document, ev: CustomEvent<CustomEventMap[K]>) => void,
|
|
1759
|
-
): void;
|
|
1760
|
-
}
|
|
1761
|
-
|
|
1762
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
|
|
1763
|
-
interface Window {
|
|
1764
|
-
Stripe?: StripeConstructor;
|
|
1765
|
-
Zonos: Zonos;
|
|
1766
|
-
/**
|
|
1767
|
-
* A flag to determine if the current page is a BigCommerce page
|
|
1768
|
-
*/
|
|
1769
|
-
bcConfig?: unknown;
|
|
1770
|
-
/**
|
|
1771
|
-
* This flag would be set to true if zonosQaUrl is present in the query params and preview script loadZonos.js is injected to DOM
|
|
1772
|
-
*/
|
|
1773
|
-
isZonosPreview?: boolean;
|
|
1774
|
-
/**
|
|
1775
|
-
* A flag to determine if the current page is a BigCommerce page
|
|
1776
|
-
*/
|
|
1777
|
-
stencilBootstrap?: unknown;
|
|
1778
|
-
}
|
|
1779
|
-
|
|
1780
|
-
namespace NodeJS {
|
|
1781
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
|
|
1782
|
-
interface ProcessEnv extends Env {}
|
|
1783
|
-
}
|
|
1784
|
-
}
|
|
1785
|
-
|
|
1786
|
-
type TranslatedText = {
|
|
1787
|
-
[key: string]: string;
|
|
1788
|
-
};
|
|
1789
|
-
type EnteredInfo = {
|
|
1790
|
-
city: string;
|
|
1791
|
-
country: CountryCode;
|
|
1792
|
-
email: string;
|
|
1793
|
-
line1: string;
|
|
1794
|
-
line2: string;
|
|
1795
|
-
name: string;
|
|
1796
|
-
phone: string;
|
|
1797
|
-
postal_code: string;
|
|
1798
|
-
state: string;
|
|
1799
|
-
};
|
|
1800
|
-
type ValidateAddressFields = Omit<StripeAddressElementChangeEvent['value']['address'], 'country'> & {
|
|
1801
|
-
name: string;
|
|
1802
|
-
};
|
|
1803
|
-
type TranslatedAddressObject = {
|
|
1804
|
-
[key in keyof ValidateAddressFields]?: TranslatedText;
|
|
1805
|
-
};
|
|
1806
|
-
|
|
1807
|
-
type SubmitEventData = {
|
|
1808
|
-
billingAddress: Record<keyof TranslatedAddressObject, string> | null;
|
|
1809
|
-
shippingAddress: Record<keyof TranslatedAddressObject, string>;
|
|
1810
|
-
};
|
|
1811
|
-
|
|
1812
|
-
declare const colorPrefixes: readonly ["blue", "cyan", "green", "orange", "purple", "red", "gray", "glass"];
|
|
1813
|
-
declare const colorContrasts: readonly ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900", "950"];
|
|
1814
|
-
type ColorContrast = (typeof colorContrasts)[number];
|
|
1815
|
-
type ColorPrefix = (typeof colorPrefixes)[number];
|
|
1816
|
-
type Color = 'gray-0' | 'gray-50' | 'glass-0' | 'glass-50' | `${ColorPrefix}-${ColorContrast}` | 'gray-1000' | 'glass-1100' | 'glass-1200';
|
|
1817
|
-
declare const checkboxColorPrefix: readonly ["blue", "cyan", "green", "orange", "purple", "red", "gray"];
|
|
1818
|
-
type CheckboxColorPrefix = (typeof checkboxColorPrefix)[number];
|
|
1819
|
-
|
|
1820
|
-
type BannerIntent = 'default' | 'error' | 'success' | 'warning' | 'info';
|
|
1821
|
-
|
|
1822
|
-
declare const textOptions: {
|
|
1823
|
-
readonly pageHeader: {
|
|
1824
|
-
readonly label: "Page Header (3XL) · 34px (2.125rem)";
|
|
1825
|
-
readonly size: "3xl";
|
|
1826
|
-
readonly tag: "h2";
|
|
1827
|
-
readonly weight: 900;
|
|
1828
|
-
};
|
|
1829
|
-
readonly secondaryPageHeader: {
|
|
1830
|
-
readonly label: "Secondary Page Header (3XL) • 34px, 500 \"Medium\"";
|
|
1831
|
-
readonly size: "3xl";
|
|
1832
|
-
readonly tag: "h2";
|
|
1833
|
-
readonly weight: 500;
|
|
1834
|
-
};
|
|
1835
|
-
readonly header: {
|
|
1836
|
-
readonly label: "Header (2XL) · 28px (1.75rem)";
|
|
1837
|
-
readonly size: "2xl";
|
|
1838
|
-
readonly tag: "h3";
|
|
1839
|
-
readonly weight: 700;
|
|
1840
|
-
};
|
|
1841
|
-
readonly descriptionHeader: {
|
|
1842
|
-
readonly label: "Description Header (2XL) · 28px (1.75rem)";
|
|
1843
|
-
readonly size: "2xl";
|
|
1844
|
-
readonly tag: "h3";
|
|
1845
|
-
readonly weight: 700;
|
|
1846
|
-
};
|
|
1847
|
-
readonly title: {
|
|
1848
|
-
readonly label: "Title (XL) • 22px (1.375rem)";
|
|
1849
|
-
readonly size: "xl";
|
|
1850
|
-
readonly tag: "h4";
|
|
1851
|
-
readonly weight: 600;
|
|
1852
|
-
};
|
|
1853
|
-
readonly boldSubheader: {
|
|
1854
|
-
readonly label: "Bold Subheader (L) • 18px (1.125rem)";
|
|
1855
|
-
readonly size: "l";
|
|
1856
|
-
readonly tag: "h5";
|
|
1857
|
-
readonly weight: 700;
|
|
1858
|
-
};
|
|
1859
|
-
readonly semiBoldSubheader: {
|
|
1860
|
-
readonly label: "Semi Bold Subheader (L / H4) • 18px (1.125rem)";
|
|
1861
|
-
readonly size: "l";
|
|
1862
|
-
readonly tag: "h5";
|
|
1863
|
-
readonly weight: 600;
|
|
1864
|
-
};
|
|
1865
|
-
readonly subheader: {
|
|
1866
|
-
readonly label: "Subheader (L) • 18px (1.125rem)";
|
|
1867
|
-
readonly size: "l";
|
|
1868
|
-
readonly tag: "h5";
|
|
1869
|
-
readonly weight: 500;
|
|
1870
|
-
};
|
|
1871
|
-
readonly boldLabel: {
|
|
1872
|
-
readonly label: "Bold Label (Base) • 14px (.875rem)";
|
|
1873
|
-
readonly size: "base";
|
|
1874
|
-
readonly tag: "span";
|
|
1875
|
-
readonly weight: 700;
|
|
1876
|
-
};
|
|
1877
|
-
readonly semiBoldLabel: {
|
|
1878
|
-
readonly label: "Semi Bold Label (Base) • 14px (.875rem)";
|
|
1879
|
-
readonly size: "base";
|
|
1880
|
-
readonly tag: "span";
|
|
1881
|
-
readonly weight: 600;
|
|
1882
|
-
};
|
|
1883
|
-
readonly label: {
|
|
1884
|
-
readonly label: "Label (Base) • 14px (.875rem)";
|
|
1885
|
-
readonly size: "base";
|
|
1886
|
-
readonly tag: "span";
|
|
1887
|
-
readonly weight: 500;
|
|
1888
|
-
};
|
|
1889
|
-
readonly body: {
|
|
1890
|
-
readonly label: "Body (Base) • 14px (.875rem)";
|
|
1891
|
-
readonly size: "base";
|
|
1892
|
-
readonly tag: "span";
|
|
1893
|
-
readonly weight: 400;
|
|
1894
|
-
};
|
|
1895
|
-
readonly smallHeader: {
|
|
1896
|
-
readonly label: "Small header (S) • 12px (.75rem)";
|
|
1897
|
-
readonly size: "s";
|
|
1898
|
-
readonly tag: "span";
|
|
1899
|
-
readonly weight: 600;
|
|
1900
|
-
};
|
|
1901
|
-
readonly caption: {
|
|
1902
|
-
readonly label: "Caption (S) • 12px (.75rem)";
|
|
1903
|
-
readonly size: "s";
|
|
1904
|
-
readonly tag: "span";
|
|
1905
|
-
readonly weight: 400;
|
|
1906
|
-
};
|
|
1907
|
-
readonly hintText: {
|
|
1908
|
-
readonly label: "Hint text (XS) • 10px (.625rem)";
|
|
1909
|
-
readonly size: "xs";
|
|
1910
|
-
readonly tag: "span";
|
|
1911
|
-
readonly weight: 400;
|
|
1912
|
-
};
|
|
1913
|
-
};
|
|
1914
|
-
type TextOptions = typeof textOptions;
|
|
1915
|
-
type Size = TextOptions[keyof TextOptions]['size'];
|
|
1916
|
-
type Type = keyof TextOptions;
|
|
1917
|
-
type FontWeight = TextOptions[keyof TextOptions]['weight'];
|
|
1918
|
-
|
|
1919
|
-
type CustomAddressErrors = {
|
|
1920
|
-
city: string;
|
|
1921
|
-
firstName: string;
|
|
1922
|
-
lastName: string;
|
|
1923
|
-
line1: string;
|
|
1924
|
-
phone: string;
|
|
1925
|
-
postalCode: string;
|
|
1926
|
-
/**
|
|
1927
|
-
* Toggle to indicate if the error message should be shown
|
|
1928
|
-
*/
|
|
1929
|
-
showError: boolean;
|
|
1930
|
-
state: string;
|
|
1931
|
-
};
|
|
1932
|
-
|
|
1933
|
-
type StripeStoreContactOption = {
|
|
1934
|
-
address: {
|
|
1935
|
-
city: string;
|
|
1936
|
-
country: string;
|
|
1937
|
-
line1: string;
|
|
1938
|
-
line2?: string;
|
|
1939
|
-
postal_code: string;
|
|
1940
|
-
state: string;
|
|
1941
|
-
};
|
|
1942
|
-
email: string;
|
|
1943
|
-
name: string;
|
|
1944
|
-
phone?: string;
|
|
1945
|
-
};
|
|
1946
|
-
|
|
1947
|
-
type NotificationInit = {
|
|
1948
|
-
message: string;
|
|
1949
|
-
/**
|
|
1950
|
-
* Time in milliseconds
|
|
1951
|
-
* @default 4000
|
|
1952
|
-
*/
|
|
1953
|
-
timeout?: number;
|
|
1954
|
-
/**
|
|
1955
|
-
* Type of notification
|
|
1956
|
-
* @default 'success'
|
|
1957
|
-
*/
|
|
1958
|
-
type?: 'error' | 'success' | 'warning';
|
|
1959
|
-
};
|
|
1960
|
-
|
|
1961
|
-
declare const localeElementsSupportedLocationCodeEnum: {
|
|
1962
|
-
readonly Ar: "ar";
|
|
1963
|
-
readonly Da: "da";
|
|
1964
|
-
readonly De: "de";
|
|
1965
|
-
readonly En: "en";
|
|
1966
|
-
readonly Es: "es";
|
|
1967
|
-
readonly Fr: "fr";
|
|
1968
|
-
readonly He: "he";
|
|
1969
|
-
readonly Id: "id";
|
|
1970
|
-
readonly It: "it";
|
|
1971
|
-
readonly Ja: "ja";
|
|
1972
|
-
readonly Ko: "ko";
|
|
1973
|
-
readonly Nl: "nl";
|
|
1974
|
-
readonly No: "no";
|
|
1975
|
-
readonly Pl: "pl";
|
|
1976
|
-
readonly Pt: "pt";
|
|
1977
|
-
readonly Ru: "ru";
|
|
1978
|
-
readonly Sv: "sv";
|
|
1979
|
-
readonly Tr: "tr";
|
|
1980
|
-
readonly Vi: "vi";
|
|
1981
|
-
readonly Zh: "zh";
|
|
1982
|
-
};
|
|
1983
|
-
type Locale_ElementsSupportedLocationCode_Enum = (typeof localeElementsSupportedLocationCodeEnum)[keyof typeof localeElementsSupportedLocationCodeEnum];
|
|
1984
|
-
|
|
1985
|
-
type ICountry = {
|
|
1986
|
-
bigcommerceDisplayName?: string;
|
|
1987
|
-
code: CountryCode;
|
|
1988
|
-
currencyCode: string;
|
|
1989
|
-
displayName: string;
|
|
1990
|
-
languageCode: Locale_ElementsSupportedLocationCode_Enum;
|
|
1991
|
-
};
|
|
1992
|
-
type ICountryJson = {
|
|
1993
|
-
[countryCode: string]: ICountry;
|
|
1994
|
-
};
|
|
1995
|
-
|
|
1996
|
-
type Items = CheckItemRestrictionsMutation['itemRestrictionApply']['items'];
|
|
1997
|
-
type RestrictedItem = Items[number] & {
|
|
1998
|
-
name?: string;
|
|
1999
|
-
};
|
|
2000
|
-
|
|
2001
|
-
declare const restStateType: readonly ["Boxes", "Earth", "EmptyBox", "Lock", "PigBank", "Scribble", "Search", "Settings", "ShoppingCart", "SpilledCup", "Switch", "TaxId", "Truck", "Warning"];
|
|
2002
|
-
type RestStateType = (typeof restStateType)[number];
|
|
2003
|
-
|
|
2004
|
-
type ShippingRichRadioItem = {
|
|
2005
|
-
amount: number;
|
|
2006
|
-
caption?: string;
|
|
2007
|
-
label: string;
|
|
2008
|
-
landedCostId: string;
|
|
2009
|
-
method: IncotermCode;
|
|
2010
|
-
price: string;
|
|
2011
|
-
shipmentRatingId: string;
|
|
2012
|
-
sublabel?: string;
|
|
2013
|
-
value: string | number;
|
|
1649
|
+
usdSettlementCountryEnabled?: CountryCode[];
|
|
2014
1650
|
};
|
|
2015
1651
|
|
|
2016
|
-
type SpinnerColor = 'primary' | 'info' | 'success' | 'danger' | 'warning' | 'black' | 'white';
|
|
2017
|
-
|
|
2018
1652
|
type ToggleItem<TValue> = {
|
|
2019
1653
|
isDisabled?: boolean;
|
|
2020
1654
|
label: string;
|
|
@@ -2908,6 +2542,27 @@ declare namespace Components {
|
|
|
2908
2542
|
*/
|
|
2909
2543
|
"titleText": string;
|
|
2910
2544
|
}
|
|
2545
|
+
interface ZonosLoadingOverlay {
|
|
2546
|
+
/**
|
|
2547
|
+
* Whether or not the overlay is open
|
|
2548
|
+
* @default false
|
|
2549
|
+
*/
|
|
2550
|
+
"open": boolean;
|
|
2551
|
+
/**
|
|
2552
|
+
* Spinner size (optional, default 40)
|
|
2553
|
+
*/
|
|
2554
|
+
"size": number;
|
|
2555
|
+
/**
|
|
2556
|
+
* Spinner color (optional)
|
|
2557
|
+
*/
|
|
2558
|
+
"spinnerColor"?: | 'primary'
|
|
2559
|
+
| 'info'
|
|
2560
|
+
| 'success'
|
|
2561
|
+
| 'danger'
|
|
2562
|
+
| 'warning'
|
|
2563
|
+
| 'black'
|
|
2564
|
+
| 'white';
|
|
2565
|
+
}
|
|
2911
2566
|
interface ZonosLogo {
|
|
2912
2567
|
/**
|
|
2913
2568
|
* Theme to change the color of the logo
|
|
@@ -3750,6 +3405,12 @@ declare global {
|
|
|
3750
3405
|
prototype: HTMLZonosLinkAuthenticationElement;
|
|
3751
3406
|
new (): HTMLZonosLinkAuthenticationElement;
|
|
3752
3407
|
};
|
|
3408
|
+
interface HTMLZonosLoadingOverlayElement extends Components.ZonosLoadingOverlay, HTMLStencilElement {
|
|
3409
|
+
}
|
|
3410
|
+
var HTMLZonosLoadingOverlayElement: {
|
|
3411
|
+
prototype: HTMLZonosLoadingOverlayElement;
|
|
3412
|
+
new (): HTMLZonosLoadingOverlayElement;
|
|
3413
|
+
};
|
|
3753
3414
|
interface HTMLZonosLogoElement extends Components.ZonosLogo, HTMLStencilElement {
|
|
3754
3415
|
}
|
|
3755
3416
|
var HTMLZonosLogoElement: {
|
|
@@ -3989,6 +3650,7 @@ declare global {
|
|
|
3989
3650
|
"zonos-language-select": HTMLZonosLanguageSelectElement;
|
|
3990
3651
|
"zonos-link": HTMLZonosLinkElement;
|
|
3991
3652
|
"zonos-link-authentication": HTMLZonosLinkAuthenticationElement;
|
|
3653
|
+
"zonos-loading-overlay": HTMLZonosLoadingOverlayElement;
|
|
3992
3654
|
"zonos-logo": HTMLZonosLogoElement;
|
|
3993
3655
|
"zonos-notification": HTMLZonosNotificationElement;
|
|
3994
3656
|
"zonos-payment": HTMLZonosPaymentElement;
|
|
@@ -4901,6 +4563,27 @@ declare namespace LocalJSX {
|
|
|
4901
4563
|
*/
|
|
4902
4564
|
"titleText": string;
|
|
4903
4565
|
}
|
|
4566
|
+
interface ZonosLoadingOverlay {
|
|
4567
|
+
/**
|
|
4568
|
+
* Whether or not the overlay is open
|
|
4569
|
+
* @default false
|
|
4570
|
+
*/
|
|
4571
|
+
"open"?: boolean;
|
|
4572
|
+
/**
|
|
4573
|
+
* Spinner size (optional, default 40)
|
|
4574
|
+
*/
|
|
4575
|
+
"size"?: number;
|
|
4576
|
+
/**
|
|
4577
|
+
* Spinner color (optional)
|
|
4578
|
+
*/
|
|
4579
|
+
"spinnerColor"?: | 'primary'
|
|
4580
|
+
| 'info'
|
|
4581
|
+
| 'success'
|
|
4582
|
+
| 'danger'
|
|
4583
|
+
| 'warning'
|
|
4584
|
+
| 'black'
|
|
4585
|
+
| 'white';
|
|
4586
|
+
}
|
|
4904
4587
|
interface ZonosLogo {
|
|
4905
4588
|
/**
|
|
4906
4589
|
* Theme to change the color of the logo
|
|
@@ -5313,6 +4996,7 @@ declare namespace LocalJSX {
|
|
|
5313
4996
|
"zonos-language-select": ZonosLanguageSelect;
|
|
5314
4997
|
"zonos-link": ZonosLink;
|
|
5315
4998
|
"zonos-link-authentication": ZonosLinkAuthentication;
|
|
4999
|
+
"zonos-loading-overlay": ZonosLoadingOverlay;
|
|
5316
5000
|
"zonos-logo": ZonosLogo;
|
|
5317
5001
|
"zonos-notification": ZonosNotification;
|
|
5318
5002
|
"zonos-payment": ZonosPayment;
|
|
@@ -5375,6 +5059,7 @@ declare module "@stencil/core" {
|
|
|
5375
5059
|
"zonos-language-select": LocalJSX.ZonosLanguageSelect & JSXBase.HTMLAttributes<HTMLZonosLanguageSelectElement>;
|
|
5376
5060
|
"zonos-link": LocalJSX.ZonosLink & JSXBase.HTMLAttributes<HTMLZonosLinkElement>;
|
|
5377
5061
|
"zonos-link-authentication": LocalJSX.ZonosLinkAuthentication & JSXBase.HTMLAttributes<HTMLZonosLinkAuthenticationElement>;
|
|
5062
|
+
"zonos-loading-overlay": LocalJSX.ZonosLoadingOverlay & JSXBase.HTMLAttributes<HTMLZonosLoadingOverlayElement>;
|
|
5378
5063
|
"zonos-logo": LocalJSX.ZonosLogo & JSXBase.HTMLAttributes<HTMLZonosLogoElement>;
|
|
5379
5064
|
"zonos-notification": LocalJSX.ZonosNotification & JSXBase.HTMLAttributes<HTMLZonosNotificationElement>;
|
|
5380
5065
|
"zonos-payment": LocalJSX.ZonosPayment & JSXBase.HTMLAttributes<HTMLZonosPaymentElement>;
|
|
@@ -5405,6 +5090,74 @@ declare module "@stencil/core" {
|
|
|
5405
5090
|
}
|
|
5406
5091
|
}
|
|
5407
5092
|
|
|
5093
|
+
type CalculateLandedCostAdjustmentInput = {
|
|
5094
|
+
amount: number;
|
|
5095
|
+
name?: string | null;
|
|
5096
|
+
productId: string | null;
|
|
5097
|
+
promoCode?: string | null;
|
|
5098
|
+
sku: string | null;
|
|
5099
|
+
type: LandedCostAdjustmentType;
|
|
5100
|
+
};
|
|
5101
|
+
type Extensions = {
|
|
5102
|
+
[key: string]: unknown;
|
|
5103
|
+
} & {
|
|
5104
|
+
rule?: {
|
|
5105
|
+
description: string;
|
|
5106
|
+
id: string;
|
|
5107
|
+
name: string;
|
|
5108
|
+
};
|
|
5109
|
+
ruleMessageType?: 'CUSTOM' | 'DEFAULT';
|
|
5110
|
+
};
|
|
5111
|
+
type ApiError = {
|
|
5112
|
+
extensions?: Extensions | null;
|
|
5113
|
+
message: string;
|
|
5114
|
+
};
|
|
5115
|
+
type CalculateLandedCostRequest = {
|
|
5116
|
+
billingAddress: {
|
|
5117
|
+
addressLine1: string;
|
|
5118
|
+
addressLine2?: string | undefined;
|
|
5119
|
+
city: string;
|
|
5120
|
+
country: CountryCode;
|
|
5121
|
+
postalCode: string;
|
|
5122
|
+
state: string;
|
|
5123
|
+
};
|
|
5124
|
+
billingContact: {
|
|
5125
|
+
firstName: string;
|
|
5126
|
+
lastName: string;
|
|
5127
|
+
phone: string;
|
|
5128
|
+
};
|
|
5129
|
+
checkoutSessionId: string;
|
|
5130
|
+
contact: {
|
|
5131
|
+
companyName?: string;
|
|
5132
|
+
email?: string;
|
|
5133
|
+
firstName: string;
|
|
5134
|
+
lastName: string;
|
|
5135
|
+
phone: string;
|
|
5136
|
+
};
|
|
5137
|
+
/**
|
|
5138
|
+
* When this is set, the created quote will not be shown on the Quote List page in the Zonos Dashboard.
|
|
5139
|
+
*/
|
|
5140
|
+
isTest?: boolean;
|
|
5141
|
+
items: CartItem[];
|
|
5142
|
+
landedCostAdjustments?: CalculateLandedCostAdjustmentInput[];
|
|
5143
|
+
metadata?: {
|
|
5144
|
+
key: string;
|
|
5145
|
+
value: string;
|
|
5146
|
+
}[];
|
|
5147
|
+
/**
|
|
5148
|
+
* TaxId that the some destination countries require for the shipment.
|
|
5149
|
+
*/
|
|
5150
|
+
shipToTaxId?: string;
|
|
5151
|
+
shippingAddress: {
|
|
5152
|
+
addressLine1: string;
|
|
5153
|
+
addressLine2?: string | undefined;
|
|
5154
|
+
city: string;
|
|
5155
|
+
country: CountryCode;
|
|
5156
|
+
postalCode: string;
|
|
5157
|
+
state: string;
|
|
5158
|
+
};
|
|
5159
|
+
};
|
|
5160
|
+
|
|
5408
5161
|
type NormalizedItemAttribute = {
|
|
5409
5162
|
key: string;
|
|
5410
5163
|
value: string;
|
|
@@ -5423,50 +5176,371 @@ type NormalizedTempCartItem = {
|
|
|
5423
5176
|
unitOfMeasure: ItemUnitOfMeasure;
|
|
5424
5177
|
value: number;
|
|
5425
5178
|
}[];
|
|
5426
|
-
name: string | null;
|
|
5427
|
-
productId: string | null;
|
|
5428
|
-
quantity: number;
|
|
5429
|
-
sku: string | null;
|
|
5179
|
+
name: string | null;
|
|
5180
|
+
productId: string | null;
|
|
5181
|
+
quantity: number;
|
|
5182
|
+
sku: string | null;
|
|
5183
|
+
};
|
|
5184
|
+
type NormalizedTempCart = {
|
|
5185
|
+
adjustments: {
|
|
5186
|
+
amount: number;
|
|
5187
|
+
currencyCode: CurrencyCode;
|
|
5188
|
+
description: string | null;
|
|
5189
|
+
productId: string | null;
|
|
5190
|
+
promoCode?: string | null;
|
|
5191
|
+
sku: string | null;
|
|
5192
|
+
type: CartAdjustmentType;
|
|
5193
|
+
}[];
|
|
5194
|
+
createdAt: string;
|
|
5195
|
+
credentialToken: string;
|
|
5196
|
+
id: string;
|
|
5197
|
+
items: NormalizedTempCartItem[];
|
|
5198
|
+
metadata: {
|
|
5199
|
+
key: string;
|
|
5200
|
+
value: string;
|
|
5201
|
+
}[];
|
|
5202
|
+
storeBaseUrl: string;
|
|
5203
|
+
storeId: number;
|
|
5204
|
+
};
|
|
5205
|
+
type Settings = Omit<CartCheckoutWorkflowQuery['cartCheckoutWorkflow'], 'cart'> & {
|
|
5206
|
+
genericSettings: GenericZonosSettings | null;
|
|
5207
|
+
};
|
|
5208
|
+
type CartCheckoutResult = {
|
|
5209
|
+
cartData: NormalizedTempCart;
|
|
5210
|
+
settings: Settings & {
|
|
5211
|
+
organization: {
|
|
5212
|
+
id: string;
|
|
5213
|
+
name: string;
|
|
5214
|
+
references: {
|
|
5215
|
+
storeId: number | null;
|
|
5216
|
+
} | null;
|
|
5217
|
+
};
|
|
5218
|
+
};
|
|
5219
|
+
storeFaviconUrl: string;
|
|
5220
|
+
storeLogoUrl: string;
|
|
5221
|
+
};
|
|
5222
|
+
|
|
5223
|
+
type BuildLandedCostParams = {
|
|
5224
|
+
billingAddress: CalculateLandedCostRequest['billingAddress'];
|
|
5225
|
+
billingContact: CalculateLandedCostRequest['billingContact'];
|
|
5226
|
+
checkoutSessionId: string;
|
|
5227
|
+
contact: CalculateLandedCostRequest['contact'];
|
|
5228
|
+
landedCostAdjustments?: CalculateLandedCostRequest['landedCostAdjustments'];
|
|
5229
|
+
publicCredential: string;
|
|
5230
|
+
shippingAddress: CalculateLandedCostRequest['shippingAddress'];
|
|
5231
|
+
zonosApiRoute: string;
|
|
5232
|
+
};
|
|
5233
|
+
type BuildLandedCostResponse = (CalculateLandedCostMutation & {
|
|
5234
|
+
errors: ApiError[];
|
|
5235
|
+
}) | null;
|
|
5236
|
+
|
|
5237
|
+
type ZonosOrder = GetOrderQuery['order'];
|
|
5238
|
+
|
|
5239
|
+
type BuildCardDetailParams = {
|
|
5240
|
+
countryCode: CountryCode;
|
|
5241
|
+
currencyCode: CurrencyCode;
|
|
5242
|
+
};
|
|
5243
|
+
type PromiseOrValue<T> = T | Promise<T>;
|
|
5244
|
+
type PrefillAddress = {
|
|
5245
|
+
customerAddress1: string;
|
|
5246
|
+
customerAddress2?: string;
|
|
5247
|
+
customerCity?: string;
|
|
5248
|
+
/**
|
|
5249
|
+
* If country is not provided, it will try to pull from query params `zCountry` or `country` or `customerCountry` in the URL or fallback to user's selected country
|
|
5250
|
+
*/
|
|
5251
|
+
customerCountry?: string;
|
|
5252
|
+
customerEmail: string;
|
|
5253
|
+
/**
|
|
5254
|
+
* Will use this value to prefill the first name field in the checkout form instead of `customerName`
|
|
5255
|
+
*/
|
|
5256
|
+
customerFirstName: string;
|
|
5257
|
+
/**
|
|
5258
|
+
* Will use this value to prefill the last name field in the checkout form instead of `customerName`
|
|
5259
|
+
*/
|
|
5260
|
+
customerLastName: string;
|
|
5261
|
+
/**
|
|
5262
|
+
* Will use this value to prefill if customerFirstName and customerLastName are not provided
|
|
5263
|
+
* @deprecated Use `customerFirstName` and `customerLastName` since Checkout uses 2 inputs for first and last name, there is not a good way to split the name into first and last name for some countries.
|
|
5264
|
+
*/
|
|
5265
|
+
customerName?: string;
|
|
5266
|
+
customerPhone: string;
|
|
5267
|
+
customerState?: string;
|
|
5268
|
+
customerZip: string;
|
|
5269
|
+
};
|
|
5270
|
+
type CreateCartIdObject = {
|
|
5271
|
+
cartId: string;
|
|
5272
|
+
customerAuthenticationToken?: string;
|
|
5273
|
+
shippingData?: PrefillAddress | null;
|
|
5274
|
+
};
|
|
5275
|
+
type CheckoutConfig = {
|
|
5276
|
+
/**
|
|
5277
|
+
* Validate address to allow specific character sets
|
|
5278
|
+
* @default ALL
|
|
5279
|
+
*/
|
|
5280
|
+
allowedCharacterSets?: 'ALL' | 'LATIN';
|
|
5281
|
+
/**
|
|
5282
|
+
* Enable settlement currencies to pay in USD
|
|
5283
|
+
* @default LOCAL
|
|
5284
|
+
*/
|
|
5285
|
+
allowedSettlementCurrencies: AllowedSettlementCurrencies;
|
|
5286
|
+
/**
|
|
5287
|
+
* Always trigger International Checkout with this selector regardless of shipping zone
|
|
5288
|
+
*/
|
|
5289
|
+
alwaysTriggerInternationalCheckoutSelector?: string | null;
|
|
5290
|
+
analyticsProviders: Array<{
|
|
5291
|
+
status: AnalyticsProviderStatus;
|
|
5292
|
+
type: AnalyticsProviderType;
|
|
5293
|
+
}>;
|
|
5294
|
+
/**
|
|
5295
|
+
* Time that payment will be captured after the order is placed. Can't be overridden in Zonos.init
|
|
5296
|
+
*/
|
|
5297
|
+
captureDelay?: number;
|
|
5298
|
+
/**
|
|
5299
|
+
* @default DISABLED - when false, company fields would not show up in the checkout form
|
|
5300
|
+
*/
|
|
5301
|
+
companyFieldsStatus: 'ENABLED' | 'DISABLED';
|
|
5302
|
+
/**
|
|
5303
|
+
* Duration (in seconds) for which the cart remains valid for checkout in hosted checkout.
|
|
5304
|
+
* @default 3_600 (1 hour)
|
|
5305
|
+
*/
|
|
5306
|
+
defaultCartExpiration?: number;
|
|
5307
|
+
/**
|
|
5308
|
+
* @default false - when false, the place order button will be disabled until the script is loaded
|
|
5309
|
+
* @note if set to true, the place order button will not be enabled or disabled
|
|
5310
|
+
*/
|
|
5311
|
+
disablePlaceOrderButtonActivation?: boolean;
|
|
5312
|
+
externalPaymentMethods: Array<{
|
|
5313
|
+
status: ExternalPaymentMethodStatus;
|
|
5314
|
+
type: ExternalPaymentMethodType;
|
|
5315
|
+
}> | null;
|
|
5316
|
+
externalServiceTokens: {
|
|
5317
|
+
token: string;
|
|
5318
|
+
type: ExternalServiceTokenType;
|
|
5319
|
+
}[];
|
|
5320
|
+
/**
|
|
5321
|
+
* Test mode for checkout (sandbox or production)
|
|
5322
|
+
* @default TEST
|
|
5323
|
+
*/
|
|
5324
|
+
mode: Mode;
|
|
5325
|
+
orderNotifications: {
|
|
5326
|
+
abandonedCart: {
|
|
5327
|
+
delay: number;
|
|
5328
|
+
discountPercent: number;
|
|
5329
|
+
status: {
|
|
5330
|
+
active: NotificationActiveStatus;
|
|
5331
|
+
sendCopiesTo: Array<string>;
|
|
5332
|
+
};
|
|
5333
|
+
};
|
|
5334
|
+
orderCancelled: {
|
|
5335
|
+
active: NotificationActiveStatus;
|
|
5336
|
+
sendCopiesTo: Array<string>;
|
|
5337
|
+
};
|
|
5338
|
+
orderShipped: {
|
|
5339
|
+
active: NotificationActiveStatus;
|
|
5340
|
+
sendCopiesTo: Array<string>;
|
|
5341
|
+
};
|
|
5342
|
+
};
|
|
5343
|
+
organization: string;
|
|
5344
|
+
/**
|
|
5345
|
+
* Place order button selector that only trigger International Checkout when shopper is in merchant's shipping zones
|
|
5346
|
+
*/
|
|
5347
|
+
placeOrderButtonSelector: string | null;
|
|
5348
|
+
/**
|
|
5349
|
+
* @param subscriptionStatus subscription status for checkout, checkout only available if subscription status is ENABLED and visibility status is ENABLED
|
|
5350
|
+
*
|
|
5351
|
+
* **NOTE: this value can't be overridden in Zonos.init**
|
|
5352
|
+
*/
|
|
5353
|
+
subscriptionStatus: CheckoutSubscriptionStatus;
|
|
5354
|
+
successBehavior: CheckoutSuccessBehavior;
|
|
5355
|
+
/**
|
|
5356
|
+
* The success page action text for checkout.
|
|
5357
|
+
* @note Default text supports translation automatically, but any custom text will not be translated.
|
|
5358
|
+
*/
|
|
5359
|
+
successPageActionText?: string;
|
|
5360
|
+
/**
|
|
5361
|
+
* The success page subtitle text for checkout. Each item in the array will appear on a new line.
|
|
5362
|
+
* @note Default text supports translation automatically, but any custom text will not be translated.
|
|
5363
|
+
*/
|
|
5364
|
+
successPageSubtitleText?: string[];
|
|
5365
|
+
/**
|
|
5366
|
+
* The success page title text for checkout.
|
|
5367
|
+
* @note Default text supports translation automatically, but any custom text will not be translated.
|
|
5368
|
+
*/
|
|
5369
|
+
successPageTitleText?: string;
|
|
5370
|
+
successRedirectUrl: string;
|
|
5371
|
+
visibilityStatus: CheckoutVisibilityStatus;
|
|
5372
|
+
/**
|
|
5373
|
+
* Cart info callback for checkout (optional),
|
|
5374
|
+
* @deprecated This is deprecated in favor of the new callback `createCartId`. The new API would only need the cart ID to retrieve cart data.
|
|
5375
|
+
* @note will attempt to use cart data if available
|
|
5376
|
+
* User can dispatch an event 'zonos--init-cart-info' to update the cart
|
|
5377
|
+
* @example
|
|
5378
|
+
* const initEvent = new CustomEvent<CartItem[]>('zonos--init-cart-info', {
|
|
5379
|
+
* detail: cartItems,
|
|
5380
|
+
* });
|
|
5381
|
+
* document.body.dispatchEvent(initEvent);
|
|
5382
|
+
* @returns {object[]} - object with the the item info to be added to cart:
|
|
5383
|
+
* - amount: number;
|
|
5384
|
+
* - countryOfOrigin?: string;
|
|
5385
|
+
* - currencyCode: string;
|
|
5386
|
+
* - description?: string;
|
|
5387
|
+
* - hsCode?: string;
|
|
5388
|
+
* - imageUrl?: string;
|
|
5389
|
+
* - name: string;
|
|
5390
|
+
* - productId?: string;
|
|
5391
|
+
* - quantity: number;
|
|
5392
|
+
*/
|
|
5393
|
+
buildCartDetail?: (params: BuildCardDetailParams) => Promise<CartItem[]>;
|
|
5394
|
+
/**
|
|
5395
|
+
* Calculate landed cost callback for checkout (optional)
|
|
5396
|
+
* @deprecated This is deprecated in favor of the new callback `createCartId`. When using the new callback, the cart details will be retrieved using the cart ID, so this callback would no longer be needed.
|
|
5397
|
+
* @note will attempt to use cart data if available
|
|
5398
|
+
*/
|
|
5399
|
+
buildLandedCost?: (params: BuildLandedCostParams) => Promise<BuildLandedCostResponse>;
|
|
5400
|
+
/**
|
|
5401
|
+
* A callback that returns the cart id from `cartCreate` mutation. You would use your cart data to call the `cartCreate` mutation and return the cart ID that was created.
|
|
5402
|
+
* @note
|
|
5403
|
+
* The mutation `cartCreate` should be called on the server side
|
|
5404
|
+
* @returns string - Cart ID
|
|
5405
|
+
*/
|
|
5406
|
+
createCartId?: () => PromiseOrValue<string | CreateCartIdObject>;
|
|
5407
|
+
/**
|
|
5408
|
+
* Callback trigger when the checkout is closed
|
|
5409
|
+
*/
|
|
5410
|
+
onClose?: () => void;
|
|
5411
|
+
/**
|
|
5412
|
+
* This callback is optional. If provided, it will be called right before the payment is processed.
|
|
5413
|
+
* @param items - The cart items.
|
|
5414
|
+
* @returns {string | null} - The error message to display to the user. If the message is empty or null, the payment will proceed.
|
|
5415
|
+
* @example
|
|
5416
|
+
* onInventoryCheck: async ({ items }) => {
|
|
5417
|
+
* // Check if all items are available from the server. If the fetch is throwing an error, show a generic error message "Unable to check inventory. Please try again.".
|
|
5418
|
+
* const itemsInfo = await fetch('https://yourserver.com/api/get-available-items', {
|
|
5419
|
+
* method: 'POST',
|
|
5420
|
+
* body: JSON.stringify({ items }),
|
|
5421
|
+
* });
|
|
5422
|
+
* const items = await itemsInfo.json();
|
|
5423
|
+
* // Filter out unavailable items.
|
|
5424
|
+
* const unavailableItems = items.filter(item => !item.available);
|
|
5425
|
+
* if (unavailableItems.length) {
|
|
5426
|
+
* // Display an error message to the user.
|
|
5427
|
+
* return `The following items are not available: ${unavailableItems.map(item => item.name).join(', ')}`;
|
|
5428
|
+
* }
|
|
5429
|
+
* // Proceed with the payment if you return an empty string or null.
|
|
5430
|
+
* return '';
|
|
5431
|
+
* }
|
|
5432
|
+
*/
|
|
5433
|
+
onInventoryCheck?: (params: {
|
|
5434
|
+
items: CartItem[];
|
|
5435
|
+
}) => Promise<string | null>;
|
|
5436
|
+
/**
|
|
5437
|
+
* Callback trigger when payment succeeds
|
|
5438
|
+
*/
|
|
5439
|
+
onOrderSuccess?: (props: {
|
|
5440
|
+
zonosApiRoute: string;
|
|
5441
|
+
zonosOrder: ZonosOrder;
|
|
5442
|
+
}) => Promise<void>;
|
|
5430
5443
|
};
|
|
5431
|
-
|
|
5432
|
-
|
|
5433
|
-
|
|
5444
|
+
|
|
5445
|
+
type CountryOverrideBehavior = 'URL_PARAM' | 'SESSION';
|
|
5446
|
+
type ShowForCountries = 'ALL' | 'ONLY_SHIPPABLE' | CountryCode[];
|
|
5447
|
+
type ShowCountryList = 'ALL' | 'ONLY_SHIPPABLE' | CountryCode[];
|
|
5448
|
+
type HelloConfig = {
|
|
5449
|
+
anchorElementSelector: string;
|
|
5450
|
+
cartUrlPattern: string | null;
|
|
5451
|
+
/**
|
|
5452
|
+
* The behavior to use when determining the country to use for the user.
|
|
5453
|
+
* @default 'URL_PARAM'
|
|
5454
|
+
*/
|
|
5455
|
+
countryOverrideBehavior?: CountryOverrideBehavior;
|
|
5456
|
+
currencyBehavior: HelloCurrencyBehavior;
|
|
5457
|
+
currencyElementSelector: string;
|
|
5458
|
+
desktopLocation?: HelloMobileLocation | null;
|
|
5459
|
+
excludedUrlPatterns: Array<string>;
|
|
5460
|
+
homepageUrlPattern: string | null;
|
|
5461
|
+
mobileLocation: HelloMobileLocation | null;
|
|
5462
|
+
mode: Mode;
|
|
5463
|
+
/**
|
|
5464
|
+
* Position of floating hello if `anchorElementSelector` is not found after 3 seconds
|
|
5465
|
+
*
|
|
5466
|
+
* null: don't render if not found
|
|
5467
|
+
*
|
|
5468
|
+
* @default null
|
|
5469
|
+
*/
|
|
5470
|
+
notFoundElementFallback: HelloMobileLocation | null;
|
|
5471
|
+
organization: string;
|
|
5472
|
+
peekMessageBehavior: HelloPeekMessageBehavior;
|
|
5473
|
+
peekMessageDelay: number;
|
|
5474
|
+
productAddToCartElementSelector: string | null;
|
|
5475
|
+
productDescriptionElementSelector: string | null;
|
|
5476
|
+
productDetailUrlPattern: string | null;
|
|
5477
|
+
productListUrlPattern: string | null;
|
|
5478
|
+
productTitleElementSelector: string | null;
|
|
5479
|
+
restrictionBehavior: HelloRestrictionBehavior;
|
|
5480
|
+
/**
|
|
5481
|
+
* The countries to include in the country list dropdown of the Hello widget.
|
|
5482
|
+
* @default ONLY_SHIPPABLE
|
|
5483
|
+
*/
|
|
5484
|
+
showCountryList?: ShowCountryList;
|
|
5485
|
+
/**
|
|
5486
|
+
* The countries to show the widget for.
|
|
5487
|
+
* @default ONLY_SHIPPABLE
|
|
5488
|
+
*/
|
|
5489
|
+
showForCountries?: ShowForCountries;
|
|
5490
|
+
visibilityStatus?: 'ENABLED' | 'DISABLED';
|
|
5491
|
+
/**
|
|
5492
|
+
* Callback function to run after the Hello widget has been initialized. This should be triggered only once when hello is attached to the DOM.
|
|
5493
|
+
* **Note**: If hello is detached from the DOM and reattached, this callback will be called again.
|
|
5494
|
+
* @param params - The parameters containing the country code and currency code that hello is initialized with.
|
|
5495
|
+
*/
|
|
5496
|
+
onInitSuccess?: (params: {
|
|
5497
|
+
countryCode: CountryCode;
|
|
5434
5498
|
currencyCode: CurrencyCode;
|
|
5435
|
-
|
|
5436
|
-
|
|
5437
|
-
|
|
5438
|
-
|
|
5439
|
-
|
|
5440
|
-
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
|
|
5447
|
-
|
|
5499
|
+
}) => Promise<void>;
|
|
5500
|
+
};
|
|
5501
|
+
|
|
5502
|
+
declare const fallbackApiType: readonly ["cloudflare", "vercel"];
|
|
5503
|
+
type FallBackApiType = (typeof fallbackApiType)[number];
|
|
5504
|
+
|
|
5505
|
+
type LogBulkLoadRequestPayload = {
|
|
5506
|
+
data: {
|
|
5507
|
+
apiType: FallBackApiType;
|
|
5508
|
+
connectionType?: string;
|
|
5509
|
+
href: string;
|
|
5510
|
+
isHostedCheckout: boolean;
|
|
5511
|
+
isMobile: boolean;
|
|
5512
|
+
loadTimeBrowserApi: number;
|
|
5513
|
+
loadTimeInternal: number;
|
|
5514
|
+
loadTimeTotal: number;
|
|
5515
|
+
metadata: Record<string, unknown>;
|
|
5516
|
+
screenHeight: number;
|
|
5517
|
+
screenWidth: number;
|
|
5518
|
+
userAgent: string;
|
|
5448
5519
|
}[];
|
|
5449
|
-
storeBaseUrl: string;
|
|
5450
5520
|
storeId: number;
|
|
5451
5521
|
};
|
|
5452
|
-
|
|
5453
|
-
|
|
5454
|
-
|
|
5455
|
-
|
|
5456
|
-
|
|
5457
|
-
|
|
5458
|
-
|
|
5459
|
-
|
|
5460
|
-
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
|
|
5467
|
-
|
|
5522
|
+
|
|
5523
|
+
type AppearanceConfig = {
|
|
5524
|
+
colorPrimary?: string;
|
|
5525
|
+
colorSecondary?: string;
|
|
5526
|
+
fontFamily: string;
|
|
5527
|
+
fontSize2XL?: number;
|
|
5528
|
+
fontSize3XL?: number;
|
|
5529
|
+
fontSizeBase?: number;
|
|
5530
|
+
fontSizeInputLabel?: number;
|
|
5531
|
+
fontSizeInputValue?: number;
|
|
5532
|
+
fontSizeL?: number;
|
|
5533
|
+
fontSizeS?: number;
|
|
5534
|
+
fontSizeXL?: number;
|
|
5535
|
+
fontSizeXS?: number;
|
|
5536
|
+
logoUrl: string;
|
|
5537
|
+
style: ElementsUiStyle;
|
|
5538
|
+
theme: ElementsUiTheme;
|
|
5539
|
+
zonosAttribution: ZonosAttribution | null;
|
|
5468
5540
|
};
|
|
5469
5541
|
|
|
5542
|
+
type LoadTimeApiLogInfo = LogBulkLoadRequestPayload['data'][number];
|
|
5543
|
+
|
|
5470
5544
|
type TrackEventLog = {
|
|
5471
5545
|
checkoutSessionId: string | null;
|
|
5472
5546
|
eventCreated: number;
|