@zonos/elements 1.3.201 → 1.3.203
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-0d91ad0b.js +1955 -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-9953115b.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} +105 -82
- 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 +9 -4
- 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 +28 -18
- 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 +26 -7
- package/dist/collection/types/index.js +1 -0
- package/dist/esm/VarianceTest-fef2d958.js +10 -0
- package/dist/esm/cart-db61eb95.js +1918 -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-2e0ffb07.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} +54 -32
- 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-db61eb95.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-2e0ffb07.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 +844 -766
- 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 +5 -2
- 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 +206 -22
- package/dist/types/types/generated/graphql.internal.types.ts +235 -19
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/utils/ZonosSettings.d.ts +7 -6
- 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-7d5d89f2.system.js → p-0693422b.system.js} +2 -2
- package/dist/zonos-elements/p-06f25f75.entry.js +1 -0
- package/dist/zonos-elements/p-0c62cfb3.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-25970cb8.system.entry.js +1 -0
- 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-2bb8ca7d.system.entry.js +1 -0
- package/dist/zonos-elements/p-2f70d0eb.entry.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-411b8e10.entry.js +1 -0
- 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-54cdc47f.system.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-6b6a9dd6.system.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-7cd09f1f.system.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-9af5e93a.entry.js +1 -0
- package/dist/zonos-elements/{p-5de59662.js → p-a9307caa.js} +2 -2
- package/dist/zonos-elements/p-aa1193bc.entry.js +1 -0
- package/dist/zonos-elements/p-ab176281.system.entry.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-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-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-cdd3087f.system.entry.js +1 -0
- package/dist/zonos-elements/p-d2165441.system.entry.js +1 -0
- 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-b2241919.entry.js → p-d6a10007.entry.js} +1 -1
- package/dist/zonos-elements/p-d99d9e00.js +1 -0
- package/dist/zonos-elements/p-db025dfc.system.entry.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-dfd1ba1d.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
|
@@ -2,12 +2,15 @@ import { Fragment, h, Host, } from "@stencil/core";
|
|
|
2
2
|
import { cartStore, cartStoreClearCheckoutInterval, cartStoreNextStep, cartStoreReset, cartStoreResetTabItems, cartStoreSetCheckoutSession, cartStoreStartCheckoutInterval, cartStoreUpdateItems, cartStoreUpdateToErrorState, } from "../../store/checkout/cart";
|
|
3
3
|
import { paypalInitScript, paypalStore, paypalStoreHasPaypalEnabled, } from "../../store/checkout/paypal";
|
|
4
4
|
import { getCheckoutSessionBody, initStripeElements, stripeStore, stripeStoreCleanupDomesticShippingSession, stripeStoreConfirmPayment, stripeStoreGetPaymentIntent, stripeStoreHandleInventoryCheck, stripeStoreHandleInventoryRefund, stripeStoreInitCheckoutSession, stripeStorePrefetchLandedCost, stripeStoreReset, stripeStoreRetrievePayment, stripeStoreUpdateCheckoutSessionBaseCurrency, } from "../../store/checkout/stripe";
|
|
5
|
-
import { localizationStore,
|
|
5
|
+
import { localizationStore, localizationStoreOnChange, } from "../../store/hello/localization";
|
|
6
|
+
import { storageStore, storageStoreSetEnabledVariantTestKeys, VARIANT_TEST_KEY_EXPIRATION, } from "../../store/storageStore";
|
|
6
7
|
import { translate } from "../../store/translationStore";
|
|
7
8
|
import { getZonosStoreTheme, zonosStore, } from "../../store/zonosStore";
|
|
8
9
|
import { buildCartItemsByTempCart } from "../../utils/api/buildCartItemsByTempCart";
|
|
9
10
|
import { isStoreDiscountEnabled } from "../../utils/api/isStoreDiscountEnabl";
|
|
11
|
+
import { selectVarianceTest } from "../../utils/api/selectVarianceTest";
|
|
10
12
|
import { trackConversionEvent } from "../../utils/api/trackConversionEvent";
|
|
13
|
+
import { buildCartUrl } from "../../utils/buildCartUrl";
|
|
11
14
|
import { getIsStagingMode } from "../../utils/checkout/getIsStagingMode";
|
|
12
15
|
import { getIsTestMode } from "../../utils/checkout/getIsTestMode";
|
|
13
16
|
import { isCheckoutMobile } from "../../utils/checkout/isCheckoutMobile";
|
|
@@ -17,6 +20,7 @@ import { watchBigcommerceDomesticCheckout } from "../../utils/checkout/watchBigc
|
|
|
17
20
|
import { classes } from "../../utils/classes";
|
|
18
21
|
import { createCustomEvent } from "../../utils/createCustomEvent";
|
|
19
22
|
import { getBorderRadius } from "../../utils/getBorderRadius";
|
|
23
|
+
import { getLegacyQueryParams } from "../../utils/getLegacyQueryParams";
|
|
20
24
|
import { handleFetch } from "../../utils/handleFetch";
|
|
21
25
|
import { currencyFormat } from "../../utils/hello/currencyConversion/currencyFormat";
|
|
22
26
|
import { getZCountryUrlParam } from "../../utils/hello/getZCountryUrlParam";
|
|
@@ -31,6 +35,10 @@ import { sendLoadNativeCheckoutLog } from "../../utils/logging/sendLoadNativeChe
|
|
|
31
35
|
import { mergeConfig } from "../../utils/mergeConfig";
|
|
32
36
|
import { styles } from "../../utils/styles";
|
|
33
37
|
import { submitGtag } from "../../utils/submitGtag";
|
|
38
|
+
import { filterExpiredTests } from "../../utils/varianceTest/filterExpiredTests";
|
|
39
|
+
import { getSelectedTestVariant } from "../../utils/varianceTest/getSelectedTestVariant";
|
|
40
|
+
import { isTestEnabled } from "../../utils/varianceTest/isTestEnabl";
|
|
41
|
+
import { mergeTest } from "../../utils/varianceTest/mergeTest";
|
|
34
42
|
import { setupCartData } from "../../../scripts/cart/_setupCartData";
|
|
35
43
|
import { checkoutHiddenBtnSelector, checkoutHiddenInternationalBtnSelector, domesticRedirectedBtnSelector, } from "../../../types/checkout/CheckoutConfig";
|
|
36
44
|
/** These assets need to be in relative path as https://www.npmjs.com/package/stencil-inline-svg suggested */
|
|
@@ -95,7 +103,7 @@ export class ZonosCheckout {
|
|
|
95
103
|
log('Payment intent failed, show status from error');
|
|
96
104
|
}
|
|
97
105
|
this.open = true;
|
|
98
|
-
|
|
106
|
+
storageStore.checkoutSessionId = zonosCheckoutSessionId;
|
|
99
107
|
stripeStore.clientSecret = stripeClientSecret;
|
|
100
108
|
void this.setToFinishStep(status);
|
|
101
109
|
return { shouldAllowOrder: false };
|
|
@@ -107,6 +115,121 @@ export class ZonosCheckout {
|
|
|
107
115
|
log('Payment intent is not succeeded, proceed to order');
|
|
108
116
|
return { shouldAllowOrder: true };
|
|
109
117
|
};
|
|
118
|
+
this.initializeTestKeys = () => {
|
|
119
|
+
// cleanup expired test keys
|
|
120
|
+
storageStore.enabledVariantTestKeys = filterExpiredTests(storageStore.enabledVariantTestKeys || []);
|
|
121
|
+
// map existingSelection to the enabled variant test keys from database
|
|
122
|
+
const existingSelectionMap = zonosStore.enabledVariantTestKeys.map(testKey => {
|
|
123
|
+
var _a;
|
|
124
|
+
// We will attempt to get the enabled selection from localStorage first and only re-fetch if the testKeys are changed
|
|
125
|
+
const existingSelection = (_a = storageStore.enabledVariantTestKeys) === null || _a === void 0 ? void 0 : _a.find(({ testKey: key }) => key === testKey);
|
|
126
|
+
return {
|
|
127
|
+
expiresAt: (existingSelection === null || existingSelection === void 0 ? void 0 : existingSelection.expiresAt) ||
|
|
128
|
+
Date.now() + VARIANT_TEST_KEY_EXPIRATION,
|
|
129
|
+
selectedVariantKey: (existingSelection === null || existingSelection === void 0 ? void 0 : existingSelection.selectedVariantKey) || null,
|
|
130
|
+
testKey,
|
|
131
|
+
};
|
|
132
|
+
});
|
|
133
|
+
storageStoreSetEnabledVariantTestKeys(existingSelectionMap);
|
|
134
|
+
return {
|
|
135
|
+
allSelected: false,
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
this.shouldAllowHostedVsNativeTest = () => {
|
|
139
|
+
// This test is only applicable to checkout that's using createCartid callback
|
|
140
|
+
if (typeof zonosStore.checkoutSettings.createCartId !== 'function') {
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
const hostedVsNativeTest = zonosStore.enabledVariantTestKeys.includes('hosted_vs_native');
|
|
144
|
+
// Should not do anything if the test is not enabled
|
|
145
|
+
if (!hostedVsNativeTest) {
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
return true;
|
|
149
|
+
};
|
|
150
|
+
// Register test hosted vs native if needed to get the variant selection for this test
|
|
151
|
+
this.registerTestHostedVsNative = async () => {
|
|
152
|
+
// This test is only applicable to checkout that's using createCartid callback
|
|
153
|
+
const isAllowedHostedVsNativeTest = this.shouldAllowHostedVsNativeTest();
|
|
154
|
+
if (!isAllowedHostedVsNativeTest) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
log(`[TEST] - Registering hosted vs native test`);
|
|
158
|
+
const selectedVariantKey = getSelectedTestVariant('hosted_vs_native');
|
|
159
|
+
// No need to request variant test for this test if the test already has variant selected
|
|
160
|
+
if (selectedVariantKey) {
|
|
161
|
+
log(`[TEST] - Hosted vs native test already has variant selected: ${selectedVariantKey}`);
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
// Get variance test selection from the testKey not yet selected
|
|
165
|
+
const response = await selectVarianceTest({
|
|
166
|
+
testKeys: ['hosted_vs_native'],
|
|
167
|
+
});
|
|
168
|
+
// Do not prevent user from proceeding if the test is not enabled or failed to get selection
|
|
169
|
+
if (!response) {
|
|
170
|
+
log(`[TEST] - Failed to get selection for hosted vs native test`);
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
// At this point, all test keys should already have variant selected. Update and map the selected variant to the existing test keys
|
|
174
|
+
const mappedEnabledVariantTestKeys = mergeTest({
|
|
175
|
+
baseTestObj: storageStore.enabledVariantTestKeys || [],
|
|
176
|
+
mergeTestObj: response,
|
|
177
|
+
});
|
|
178
|
+
// Set the selected variant to the storage store
|
|
179
|
+
storageStoreSetEnabledVariantTestKeys(mappedEnabledVariantTestKeys);
|
|
180
|
+
};
|
|
181
|
+
// Handle hosted vs native test
|
|
182
|
+
this.handleHostedVsNative = async () => {
|
|
183
|
+
var _a;
|
|
184
|
+
// This test is only applicable to checkout that's using createCartid callback
|
|
185
|
+
const isAllowedHostedVsNativeTest = this.shouldAllowHostedVsNativeTest();
|
|
186
|
+
if (!isAllowedHostedVsNativeTest) {
|
|
187
|
+
return {
|
|
188
|
+
redirected: false,
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
const selectedVariantTest = getSelectedTestVariant('hosted_vs_native');
|
|
192
|
+
log(`[TEST] - hosted_vs_native: ${selectedVariantTest}`);
|
|
193
|
+
// This test is only applicable to checkout that's using createCartid callback
|
|
194
|
+
if (typeof zonosStore.checkoutSettings.createCartId !== 'function') {
|
|
195
|
+
log(`[TEST] - createCartId is not provided, skipping hosted vs native test`);
|
|
196
|
+
return {
|
|
197
|
+
redirected: false,
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
// No need to do anything if the test is enabled for native
|
|
201
|
+
if (selectedVariantTest !== 'hosted') {
|
|
202
|
+
log(`[TEST] - Hosted vs native test is enabled for native, skipping`);
|
|
203
|
+
return {
|
|
204
|
+
redirected: false,
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
if (!((_a = zonosStore.genericSettings) === null || _a === void 0 ? void 0 : _a.hostedCheckoutUrl)) {
|
|
208
|
+
log('[TEST] - Hosted checkout URL is not provided');
|
|
209
|
+
return {
|
|
210
|
+
redirected: false,
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
log('"createCartId" is provided, start building cart');
|
|
214
|
+
const cartIdResult = await zonosStore.checkoutSettings.createCartId();
|
|
215
|
+
let cartId;
|
|
216
|
+
let shippingData = null;
|
|
217
|
+
if (typeof cartIdResult === 'object') {
|
|
218
|
+
cartId = cartIdResult.cartId;
|
|
219
|
+
shippingData = cartIdResult.shippingData || null;
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
cartId = cartIdResult;
|
|
223
|
+
}
|
|
224
|
+
const legacyQueryParams = getLegacyQueryParams();
|
|
225
|
+
const cartUrl = buildCartUrl(Object.assign(Object.assign({ cartId, checkoutSessionId: storageStore.checkoutSessionId || undefined, hostedCheckoutUrl: zonosStore.genericSettings.hostedCheckoutUrl, isTestMode: getIsTestMode(), isVariantTest: true }, legacyQueryParams), shippingData));
|
|
226
|
+
log(`[TEST] - Redirecting to: ${cartUrl}`);
|
|
227
|
+
// Open new page with the cart URL
|
|
228
|
+
window.open(cartUrl, '_blank');
|
|
229
|
+
return {
|
|
230
|
+
redirected: true,
|
|
231
|
+
};
|
|
232
|
+
};
|
|
110
233
|
this.formatDate = (timestamp) => {
|
|
111
234
|
if (!timestamp) {
|
|
112
235
|
return '';
|
|
@@ -167,6 +290,74 @@ export class ZonosCheckout {
|
|
|
167
290
|
}
|
|
168
291
|
return this.defaultAddressParams;
|
|
169
292
|
};
|
|
293
|
+
/**
|
|
294
|
+
* Message listener from the hosted checkout tab just openned from the hosted vs native variant test
|
|
295
|
+
*/
|
|
296
|
+
this.handleHostedOpenWindowCallback = (e) => {
|
|
297
|
+
var _a;
|
|
298
|
+
// check if it's from origin of hosted checkout url
|
|
299
|
+
const hostedCheckoutUrl = (_a = zonosStore.genericSettings) === null || _a === void 0 ? void 0 : _a.hostedCheckoutUrl;
|
|
300
|
+
// Do nothing if hosted checkout url is not set
|
|
301
|
+
if (!origin) {
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
// Do nothing if it's not from the origin of hosted checkout url
|
|
305
|
+
const isDev = ['dev.checkout.elements.zonos.com'].some(dev => e.origin.includes(dev));
|
|
306
|
+
// Do not allow to receive message if not from origin we expected when it's not dev environment
|
|
307
|
+
if (e.origin !== hostedCheckoutUrl && !isDev) {
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
switch (e.data.type) {
|
|
311
|
+
case 'zonos-checkout-session-update':
|
|
312
|
+
// Update and set checkout session id to storage so that if user come back to merchant site, it will persist the test variance selection
|
|
313
|
+
storageStore.checkoutSessionId = e.data.checkoutSessionId;
|
|
314
|
+
break;
|
|
315
|
+
default:
|
|
316
|
+
break;
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
/**
|
|
320
|
+
* Capture params from the url and set to the store when it's redirected from hosted checkout url for variant test
|
|
321
|
+
*/
|
|
322
|
+
this.captureParamsRedirectedForVariantTest = () => {
|
|
323
|
+
const url = new URL(window.location.href);
|
|
324
|
+
const zonosVariantTest = url.searchParams.get('zonosVariantTest') === '1';
|
|
325
|
+
// Do nothing if the url is not loaded from hosted vs native variant test
|
|
326
|
+
if (!zonosVariantTest) {
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
const checkoutSessionId = url.searchParams.get('zonosCheckoutSessionId');
|
|
330
|
+
if (checkoutSessionId) {
|
|
331
|
+
storageStore.checkoutSessionId = checkoutSessionId;
|
|
332
|
+
}
|
|
333
|
+
// merge variant test input from url to storageStore.enabledVariantTestKeys
|
|
334
|
+
const enabledVariantTestKeys = storageStore.enabledVariantTestKeys || [];
|
|
335
|
+
// override the selected variant key if it's not "hosted" since we are in hosted checkout tab
|
|
336
|
+
if (window.Zonos.isLegacyCheckout) {
|
|
337
|
+
const selectedVariantKey = getSelectedTestVariant('hosted_vs_native');
|
|
338
|
+
// Set selected variant key "hosted" to enabledVariantTestKeys if it's not in enabledVariantTestKeys already
|
|
339
|
+
if (!selectedVariantKey) {
|
|
340
|
+
enabledVariantTestKeys.push({
|
|
341
|
+
expiresAt: Date.now() + VARIANT_TEST_KEY_EXPIRATION,
|
|
342
|
+
selectedVariantKey: 'hosted',
|
|
343
|
+
testKey: 'hosted_vs_native',
|
|
344
|
+
});
|
|
345
|
+
storageStoreSetEnabledVariantTestKeys(enabledVariantTestKeys);
|
|
346
|
+
}
|
|
347
|
+
else {
|
|
348
|
+
storageStoreSetEnabledVariantTestKeys(enabledVariantTestKeys.map((x) => {
|
|
349
|
+
if (x.testKey === 'hosted_vs_native') {
|
|
350
|
+
return Object.assign(Object.assign({}, x), { selectedVariantKey: 'hosted' });
|
|
351
|
+
}
|
|
352
|
+
return x;
|
|
353
|
+
}));
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
// Remove query params from the url
|
|
357
|
+
url.searchParams.delete('zonosCheckoutSessionId');
|
|
358
|
+
url.searchParams.delete('zonosVariantTest');
|
|
359
|
+
window.history.replaceState({}, '', url.toString());
|
|
360
|
+
};
|
|
170
361
|
this.appearanceSettingsOverride = undefined;
|
|
171
362
|
this.preview = false;
|
|
172
363
|
this.hiddenMode = false;
|
|
@@ -178,6 +369,7 @@ export class ZonosCheckout {
|
|
|
178
369
|
this.defaultCustomerProfileAddress = [];
|
|
179
370
|
this.customerProfile = null;
|
|
180
371
|
this.open = this.forceDialogOpen;
|
|
372
|
+
this.isOverlayLoading = false;
|
|
181
373
|
this.stripe = window.Zonos.stripe;
|
|
182
374
|
this.submitLoading = false;
|
|
183
375
|
this.collapseReviewMobile = true;
|
|
@@ -298,7 +490,7 @@ export class ZonosCheckout {
|
|
|
298
490
|
await cartStoreUpdateItems({ adjustments, cartItems: cartItemsFiltered });
|
|
299
491
|
}
|
|
300
492
|
// if checkoutSessionId is not available, request a new one.
|
|
301
|
-
if (!
|
|
493
|
+
if (!storageStore.checkoutSessionId) {
|
|
302
494
|
const success = await stripeStoreInitCheckoutSession();
|
|
303
495
|
log(`stripeStoreInitCheckoutSession: ${success}`);
|
|
304
496
|
if (!success) {
|
|
@@ -344,13 +536,13 @@ export class ZonosCheckout {
|
|
|
344
536
|
confirmProceedWithOrderDuplication() {
|
|
345
537
|
// Reset the placed order info
|
|
346
538
|
this.placedOrderInfo = null;
|
|
347
|
-
if (!
|
|
539
|
+
if (!storageStore.checkoutSessionId) {
|
|
348
540
|
return;
|
|
349
541
|
}
|
|
350
542
|
// Record the order duplication consent so we know user did see the notification and proceed with the order duplication
|
|
351
543
|
void handleFetch('/api/zonos-elements/update-checkout-session-metadata', {
|
|
352
544
|
body: {
|
|
353
|
-
id:
|
|
545
|
+
id: storageStore.checkoutSessionId,
|
|
354
546
|
metadata: [
|
|
355
547
|
{
|
|
356
548
|
key: 'orderDuplicationConsent',
|
|
@@ -415,7 +607,7 @@ export class ZonosCheckout {
|
|
|
415
607
|
button,
|
|
416
608
|
});
|
|
417
609
|
button.addEventListener('click', async (e) => {
|
|
418
|
-
var _a;
|
|
610
|
+
var _a, _b;
|
|
419
611
|
// Start tracking load time
|
|
420
612
|
const startTime = performance.now();
|
|
421
613
|
const isAlwaysTriggerInternationalCheckout = alwaysTriggerInternationalCheckoutSelector &&
|
|
@@ -458,6 +650,17 @@ export class ZonosCheckout {
|
|
|
458
650
|
void sendBulkLoadTimeApiLog();
|
|
459
651
|
}, 2000);
|
|
460
652
|
}
|
|
653
|
+
// Send request to get what kind of variant we are applying
|
|
654
|
+
if (isTestEnabled('hosted_vs_native')) {
|
|
655
|
+
this.isOverlayLoading = true;
|
|
656
|
+
await this.registerTestHostedVsNative();
|
|
657
|
+
const { redirected } = await this.handleHostedVsNative();
|
|
658
|
+
this.isOverlayLoading = false;
|
|
659
|
+
// Stop the process if the user is being redirected to the hosted checkout page
|
|
660
|
+
if (redirected) {
|
|
661
|
+
return;
|
|
662
|
+
}
|
|
663
|
+
}
|
|
461
664
|
// start loading
|
|
462
665
|
stripeStore.isFetchingSession = true;
|
|
463
666
|
this.open = true;
|
|
@@ -467,13 +670,17 @@ export class ZonosCheckout {
|
|
|
467
670
|
if (!result) {
|
|
468
671
|
throw new Error('Error building cart');
|
|
469
672
|
}
|
|
673
|
+
(_a = window.opener) === null || _a === void 0 ? void 0 : _a.postMessage({
|
|
674
|
+
checkoutSessionId: storageStore.checkoutSessionId,
|
|
675
|
+
type: 'zonos-checkout-session-update',
|
|
676
|
+
}, '*');
|
|
470
677
|
// start the timer to validate the price
|
|
471
678
|
cartStoreStartCheckoutInterval({
|
|
472
679
|
isPreview: this.preview,
|
|
473
680
|
sessionTimeout: CHECKOUT_SESSION_TIMEOUT,
|
|
474
681
|
});
|
|
475
682
|
submitGtag('zonos-checkout-start');
|
|
476
|
-
const checkoutSessionId =
|
|
683
|
+
const checkoutSessionId = storageStore.checkoutSessionId;
|
|
477
684
|
void trackConversionEvent({
|
|
478
685
|
checkoutSessionId,
|
|
479
686
|
eventName: 'checkout_open',
|
|
@@ -496,13 +703,13 @@ export class ZonosCheckout {
|
|
|
496
703
|
const message = err.message;
|
|
497
704
|
if (message === 'Cart is expired.') {
|
|
498
705
|
this.isCartExpired = true;
|
|
499
|
-
return;
|
|
500
706
|
}
|
|
501
707
|
}
|
|
502
708
|
// stop loading
|
|
503
709
|
stripeStore.isFetchingSession = false;
|
|
504
710
|
logError(err);
|
|
505
711
|
if (this.isCartExpired) {
|
|
712
|
+
stripeStore.isFetchingSession = true;
|
|
506
713
|
return;
|
|
507
714
|
}
|
|
508
715
|
// We want to log the error anytime we fail to create a checkout session
|
|
@@ -514,7 +721,7 @@ export class ZonosCheckout {
|
|
|
514
721
|
cartId: window.Zonos.cartId,
|
|
515
722
|
checkoutSessionBody: getCheckoutSessionBody(),
|
|
516
723
|
href: window.location.href,
|
|
517
|
-
storeBaseUrl: ((
|
|
724
|
+
storeBaseUrl: ((_b = window.Zonos.cartData) === null || _b === void 0 ? void 0 : _b.storeBaseUrl) ||
|
|
518
725
|
zonosStore.onlineStoreSettings.url,
|
|
519
726
|
},
|
|
520
727
|
});
|
|
@@ -563,7 +770,7 @@ export class ZonosCheckout {
|
|
|
563
770
|
return;
|
|
564
771
|
}
|
|
565
772
|
log('shipping data from createCartId result', 'info', Object.entries(prefillAddress));
|
|
566
|
-
const { customerAddress1, customerAddress2, customerCity, customerCountry, customerEmail, customerName, customerPhone, customerState, customerZip, } = prefillAddress;
|
|
773
|
+
const { customerAddress1, customerAddress2, customerCity, customerCountry, customerEmail, customerFirstName, customerLastName, customerName, customerPhone, customerState, customerZip, } = prefillAddress;
|
|
567
774
|
const urlParams = new URLSearchParams(window.location.search);
|
|
568
775
|
const country = // fallback to selected country code if country is not provided
|
|
569
776
|
customerCountry ||
|
|
@@ -575,6 +782,8 @@ export class ZonosCheckout {
|
|
|
575
782
|
customerCity,
|
|
576
783
|
customerCountry: country,
|
|
577
784
|
customerEmail,
|
|
785
|
+
customerFirstName,
|
|
786
|
+
customerLastName,
|
|
578
787
|
customerName,
|
|
579
788
|
customerPhone,
|
|
580
789
|
customerState,
|
|
@@ -623,7 +832,9 @@ export class ZonosCheckout {
|
|
|
623
832
|
const line2 = address.customerAddress2 || '';
|
|
624
833
|
const city = address.customerCity || '';
|
|
625
834
|
const email = address.customerEmail || '';
|
|
626
|
-
const name = address.
|
|
835
|
+
const name = address.customerFirstName && address.customerLastName
|
|
836
|
+
? `${address.customerFirstName} ${address.customerLastName}`
|
|
837
|
+
: address.customerName || '';
|
|
627
838
|
const phone = address.customerPhone || '';
|
|
628
839
|
const postal_code = address.customerZip || '';
|
|
629
840
|
const state = address.customerState || '';
|
|
@@ -774,7 +985,7 @@ export class ZonosCheckout {
|
|
|
774
985
|
async handleCustomerInfoContinue() {
|
|
775
986
|
// submit google tag when the form is complete
|
|
776
987
|
submitGtag('zonos-checkout-customer-info');
|
|
777
|
-
const checkoutSessionId =
|
|
988
|
+
const checkoutSessionId = storageStore.checkoutSessionId;
|
|
778
989
|
void trackConversionEvent({
|
|
779
990
|
checkoutSessionId,
|
|
780
991
|
eventName: 'checkout_customerInfoCompleted',
|
|
@@ -1044,13 +1255,20 @@ export class ZonosCheckout {
|
|
|
1044
1255
|
this.isMobile = isCheckoutMobile(this.mobile);
|
|
1045
1256
|
this.isIframed = window.self !== window.top;
|
|
1046
1257
|
log(`iframed: ${this.isIframed}`);
|
|
1258
|
+
// Set checkout session if redirect
|
|
1259
|
+
if (window.Zonos.isLegacyCheckout) {
|
|
1260
|
+
this.captureParamsRedirectedForVariantTest();
|
|
1261
|
+
}
|
|
1047
1262
|
// update theme to browser preference theme if appearance theme is system
|
|
1048
1263
|
this.handleAppearanceSettingsOverrideChange();
|
|
1049
1264
|
// listen to selected locale code change
|
|
1050
|
-
this.onChangeLocaleListener =
|
|
1265
|
+
this.onChangeLocaleListener = localizationStoreOnChange('selectedLocale', () => {
|
|
1051
1266
|
// Update stripe locale when selected country code is changed
|
|
1052
1267
|
void this.applyStripeTheme();
|
|
1053
1268
|
});
|
|
1269
|
+
// Initialize test keys
|
|
1270
|
+
this.initializeTestKeys();
|
|
1271
|
+
window.addEventListener('message', this.handleHostedOpenWindowCallback);
|
|
1054
1272
|
log(`mobile: ${this.isMobile}`);
|
|
1055
1273
|
}
|
|
1056
1274
|
// do clean up when component is unmounted
|
|
@@ -1061,6 +1279,7 @@ export class ZonosCheckout {
|
|
|
1061
1279
|
cartStoreReset();
|
|
1062
1280
|
// cleanup onChange listener
|
|
1063
1281
|
this.onChangeLocaleListener();
|
|
1282
|
+
window.removeEventListener('message', this.handleHostedOpenWindowCallback);
|
|
1064
1283
|
}
|
|
1065
1284
|
render() {
|
|
1066
1285
|
var _a, _b, _c, _d;
|
|
@@ -1197,7 +1416,7 @@ export class ZonosCheckout {
|
|
|
1197
1416
|
// If dialog is in open state, the message should not be null
|
|
1198
1417
|
dialogSubtitle: translate('You are being sent back to the shop to re-add items to your cart.'), dialogTitle: translate('Shopping cart expired'), dialogType: "alert",
|
|
1199
1418
|
// Mark user selected confirm to close the dialog
|
|
1200
|
-
onConfirmClicked: () => this.handleCartExpiredDialogConfirm() })));
|
|
1419
|
+
onConfirmClicked: () => this.handleCartExpiredDialogConfirm() }), h("zonos-loading-overlay", { open: this.isOverlayLoading })));
|
|
1201
1420
|
}
|
|
1202
1421
|
static get is() { return "zonos-checkout"; }
|
|
1203
1422
|
static get encapsulation() { return "scoped"; }
|
|
@@ -1372,6 +1591,7 @@ export class ZonosCheckout {
|
|
|
1372
1591
|
"defaultCustomerProfileAddress": {},
|
|
1373
1592
|
"customerProfile": {},
|
|
1374
1593
|
"open": {},
|
|
1594
|
+
"isOverlayLoading": {},
|
|
1375
1595
|
"stripe": {},
|
|
1376
1596
|
"submitLoading": {},
|
|
1377
1597
|
"collapseReviewMobile": {},
|
|
@@ -1461,7 +1681,7 @@ export class ZonosCheckout {
|
|
|
1461
1681
|
"signature": "(session: CheckoutSessionDetailsFragment) => Promise<void>",
|
|
1462
1682
|
"parameters": [{
|
|
1463
1683
|
"name": "session",
|
|
1464
|
-
"type": "{ cartId: string | null; clientSecret: string; customerProfile: { email: string | null; locations: { administrativeArea: string; countryCode: CountryCode; email: string | null; line1: string; line2: string | null; locality: string; name: string | null; phone: string | null; postalCode: string; }[] | null; name: string | null; } | null; customerSessionClientSecret: string | null; id: string; landedCost: { amountSubtotals: { discounts: number | null; duties: number; fees: number; items: number; landedCostTotal: number; shipping: number; taxes: number; } | null; id: string; landedCostGuaranteeCode: LandedCostGuaranteeCode; method: IncotermCode; shipmentRating: { displayName: string; }; } | null; metadata: ({ key: string; value: string; } | null)[] | null; organizationId: string; subtotals: { adjustments: number; duties: number; exchangeRate: { id: string; rate: number; sourceCurrencyCode: CurrencyCode; targetCurrencyCode: CurrencyCode; type: ExchangeRateType; }; fees: number; items: number; landedCostTotal: number; presentmentCurrencyCode: CurrencyCode; shipping: number; taxes: number; total: number; }; }",
|
|
1684
|
+
"type": "{ cartId: string | null; clientSecret: string; customerProfile: { email: string | null; locations: { administrativeArea: string; countryCode: CountryCode; email: string | null; line1: string; line2: string | null; locality: string; name: string | null; phone: string | null; postalCode: string; }[] | null; name: string | null; } | null; customerSessionClientSecret: string | null; id: string; landedCost: { amountSubtotals: { discounts: number | null; duties: number; fees: number; items: number; landedCostTotal: number; shipping: number; taxes: number; } | null; id: string; landedCostGuaranteeCode: LandedCostGuaranteeCode; method: IncotermCode; shipmentRating: { displayName: string; }; } | null; metadata: ({ key: string; value: string; } | null)[] | null; organizationId: string; subtotals: { adjustments: number; duties: number; exchangeRate: { id: string; rate: number; sourceCurrencyCode: CurrencyCode; targetCurrencyCode: CurrencyCode; type: ExchangeRateType; }; fees: number; items: number; landedCostTotal: number; presentmentCurrencyCode: CurrencyCode; shipping: number; taxes: number; total: number; }; varianceTestResults: { selectedVariantKey: string; testKey: string; }[] | null; }",
|
|
1465
1685
|
"docs": ""
|
|
1466
1686
|
}],
|
|
1467
1687
|
"references": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h, Host, } from "@stencil/core";
|
|
2
|
-
import { cartStore } from "../../../store/checkout/cart";
|
|
3
2
|
import { stripeStore, stripeStoreTranslateAddressToLatin, } from "../../../store/checkout/stripe";
|
|
4
3
|
import { localizationStore } from "../../../store/hello/localization";
|
|
4
|
+
import { storageStore } from "../../../store/storageStore";
|
|
5
5
|
import { translate } from "../../../store/translationStore";
|
|
6
6
|
import { getZonosStoreTheme, zonosStore, } from "../../../store/zonosStore";
|
|
7
7
|
import { containsNonLatinChars } from "../../../utils/containsNonLatinChars";
|
|
@@ -218,11 +218,11 @@ export class ZonosCustomerInfo {
|
|
|
218
218
|
!!((_b = (_a = zonosStore.genericSettings) === null || _a === void 0 ? void 0 : _a.countryCustomAddressEnabled) === null || _b === void 0 ? void 0 : _b.includes(localizationStore.selectedCountryCode));
|
|
219
219
|
// Should only record the form type used once
|
|
220
220
|
if (type === 'shipping' &&
|
|
221
|
-
|
|
221
|
+
storageStore.checkoutSessionId &&
|
|
222
222
|
!this.recordedFormTypeUsed) {
|
|
223
223
|
void handleFetch('/api/zonos-elements/update-checkout-session-metadata', {
|
|
224
224
|
body: {
|
|
225
|
-
id:
|
|
225
|
+
id: storageStore.checkoutSessionId,
|
|
226
226
|
metadata: [
|
|
227
227
|
{
|
|
228
228
|
key: 'ZONOS_FORM_TYPE_USING',
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Fragment, h, Host, } from "@stencil/core";
|
|
2
|
-
import { cartStore, cartStoreGetShippingTransitInfo, cartStoreUpdateSelectedShippingOption, } from "../../../store/checkout/cart";
|
|
2
|
+
import { cartStore, cartStoreGetMethod, cartStoreGetShippingTransitInfo, cartStoreUpdateSelectedShippingOption, } from "../../../store/checkout/cart";
|
|
3
3
|
import { stripeStore } from "../../../store/checkout/stripe";
|
|
4
|
+
import { storageStore } from "../../../store/storageStore";
|
|
4
5
|
import { translate } from "../../../store/translationStore";
|
|
5
6
|
import { trackConversionEvent } from "../../../utils/api/trackConversionEvent";
|
|
6
7
|
import { renderCheckoutCurrency } from "../../../utils/checkout/renderCheckoutCurrency";
|
|
@@ -52,7 +53,7 @@ export class ZonosShipping {
|
|
|
52
53
|
}
|
|
53
54
|
// submit google tag when the form is complete
|
|
54
55
|
submitGtag('zonos-checkout-shipping-info');
|
|
55
|
-
const checkoutSessionId =
|
|
56
|
+
const checkoutSessionId = storageStore.checkoutSessionId;
|
|
56
57
|
void trackConversionEvent({
|
|
57
58
|
checkoutSessionId,
|
|
58
59
|
eventName: 'checkout_shippingInfoCompleted',
|
|
@@ -85,11 +86,15 @@ export class ZonosShipping {
|
|
|
85
86
|
const matchedLandedCosts = (_a = cartStore.landedCostData) === null || _a === void 0 ? void 0 : _a.filter(landedCostItem => { var _a; return ((_a = landedCostItem.landedCost) === null || _a === void 0 ? void 0 : _a.shipmentRating.id) === item.id; });
|
|
86
87
|
return ((matchedLandedCosts === null || matchedLandedCosts === void 0 ? void 0 : matchedLandedCosts.map(landedCost => {
|
|
87
88
|
const shippingAmount = landedCost.subtotals.shipping;
|
|
89
|
+
/**
|
|
90
|
+
* For some service levels, the landed cost that's DAP and we do remittance on behalf of the merchant, these landed cost should be treated as DDP
|
|
91
|
+
*/
|
|
92
|
+
const method = cartStoreGetMethod(landedCost.landedCost);
|
|
88
93
|
const option = {
|
|
89
94
|
amount: shippingAmount,
|
|
90
|
-
label: `${item.displayName}${this.getLandedCostMethodLabelSuffix(
|
|
95
|
+
label: `${item.displayName}${this.getLandedCostMethodLabelSuffix(method)}`,
|
|
91
96
|
landedCostId: landedCost.landedCostId,
|
|
92
|
-
method
|
|
97
|
+
method,
|
|
93
98
|
price: renderCheckoutCurrency({
|
|
94
99
|
amount: shippingAmount,
|
|
95
100
|
isForeign: true,
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
font-family: var(--zonos--font-family, Inter), Inter;
|
|
3
|
+
display: block;
|
|
4
|
+
white-space: normal;
|
|
5
|
+
}
|
|
6
|
+
:host * {
|
|
7
|
+
font-family: var(--zonos--font-family, Inter), Inter;
|
|
8
|
+
}
|
|
9
|
+
:host img {
|
|
10
|
+
max-width: 100%;
|
|
11
|
+
}
|
|
12
|
+
:host dl,
|
|
13
|
+
:host dd,
|
|
14
|
+
:host h1,
|
|
15
|
+
:host h2,
|
|
16
|
+
:host h3,
|
|
17
|
+
:host h4,
|
|
18
|
+
:host h5,
|
|
19
|
+
:host h6,
|
|
20
|
+
:host hr,
|
|
21
|
+
:host figure,
|
|
22
|
+
:host p,
|
|
23
|
+
:host pre {
|
|
24
|
+
margin: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* All sets of variable are here */
|
|
28
|
+
/* smooth font rendering */
|
|
29
|
+
:host {
|
|
30
|
+
-moz-osx-font-smoothing: grayscale;
|
|
31
|
+
-webkit-font-smoothing: antialiased;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:host {
|
|
35
|
+
position: fixed;
|
|
36
|
+
inset: 0;
|
|
37
|
+
z-index: 2147483010;
|
|
38
|
+
pointer-events: none;
|
|
39
|
+
display: block;
|
|
40
|
+
}
|
|
41
|
+
:host .zonos--loading-overlay {
|
|
42
|
+
position: fixed;
|
|
43
|
+
inset: 0;
|
|
44
|
+
width: 100vw;
|
|
45
|
+
height: 100vh;
|
|
46
|
+
background: var(--zonos-elements-backdrop-color);
|
|
47
|
+
display: flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
justify-content: center;
|
|
50
|
+
opacity: 0;
|
|
51
|
+
visibility: hidden;
|
|
52
|
+
transition: opacity 0.3s ease, visibility 0.3s ease;
|
|
53
|
+
z-index: 2147483010;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
:host(.zonos--open) {
|
|
57
|
+
pointer-events: auto;
|
|
58
|
+
}
|
|
59
|
+
:host(.zonos--open) .zonos--loading-overlay {
|
|
60
|
+
opacity: 0.65;
|
|
61
|
+
visibility: visible;
|
|
62
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
import { classes } from "../../utils/classes";
|
|
3
|
+
export class ZonosLoadingOverlay {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.open = false;
|
|
6
|
+
this.spinnerColor = undefined;
|
|
7
|
+
this.size = 40;
|
|
8
|
+
}
|
|
9
|
+
render() {
|
|
10
|
+
return (h(Host, { key: 'eff20c3fe4c4a998748ac07567cc5449efc398cd', class: classes(['zonos--elements', this.open && 'zonos--open']) }, h("div", { key: '1b37bfc1a150720e0f4f84075ac661e5395aee3b', class: "zonos--loading-overlay" }, h("zonos-spinner", { key: '42ac91e723802b23897b6e5cd99e0aea7d964da5', size: this.size, spinnerColor: this.spinnerColor }))));
|
|
11
|
+
}
|
|
12
|
+
static get is() { return "zonos-loading-overlay"; }
|
|
13
|
+
static get encapsulation() { return "shadow"; }
|
|
14
|
+
static get originalStyleUrls() {
|
|
15
|
+
return {
|
|
16
|
+
"$": ["zonos-loading-overlay.scss"]
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
static get styleUrls() {
|
|
20
|
+
return {
|
|
21
|
+
"$": ["zonos-loading-overlay.css"]
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
static get properties() {
|
|
25
|
+
return {
|
|
26
|
+
"open": {
|
|
27
|
+
"type": "boolean",
|
|
28
|
+
"mutable": false,
|
|
29
|
+
"complexType": {
|
|
30
|
+
"original": "boolean",
|
|
31
|
+
"resolved": "boolean",
|
|
32
|
+
"references": {}
|
|
33
|
+
},
|
|
34
|
+
"required": false,
|
|
35
|
+
"optional": false,
|
|
36
|
+
"docs": {
|
|
37
|
+
"tags": [{
|
|
38
|
+
"name": "default",
|
|
39
|
+
"text": "false"
|
|
40
|
+
}],
|
|
41
|
+
"text": "Whether or not the overlay is open"
|
|
42
|
+
},
|
|
43
|
+
"getter": false,
|
|
44
|
+
"setter": false,
|
|
45
|
+
"attribute": "open",
|
|
46
|
+
"reflect": false,
|
|
47
|
+
"defaultValue": "false"
|
|
48
|
+
},
|
|
49
|
+
"spinnerColor": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"mutable": false,
|
|
52
|
+
"complexType": {
|
|
53
|
+
"original": "| 'primary'\n | 'info'\n | 'success'\n | 'danger'\n | 'warning'\n | 'black'\n | 'white'",
|
|
54
|
+
"resolved": "\"black\" | \"danger\" | \"info\" | \"primary\" | \"success\" | \"warning\" | \"white\" | undefined",
|
|
55
|
+
"references": {}
|
|
56
|
+
},
|
|
57
|
+
"required": false,
|
|
58
|
+
"optional": true,
|
|
59
|
+
"docs": {
|
|
60
|
+
"tags": [],
|
|
61
|
+
"text": "Spinner color (optional)"
|
|
62
|
+
},
|
|
63
|
+
"getter": false,
|
|
64
|
+
"setter": false,
|
|
65
|
+
"attribute": "spinner-color",
|
|
66
|
+
"reflect": false
|
|
67
|
+
},
|
|
68
|
+
"size": {
|
|
69
|
+
"type": "number",
|
|
70
|
+
"mutable": false,
|
|
71
|
+
"complexType": {
|
|
72
|
+
"original": "number",
|
|
73
|
+
"resolved": "number",
|
|
74
|
+
"references": {}
|
|
75
|
+
},
|
|
76
|
+
"required": false,
|
|
77
|
+
"optional": false,
|
|
78
|
+
"docs": {
|
|
79
|
+
"tags": [],
|
|
80
|
+
"text": "Spinner size (optional, default 40)"
|
|
81
|
+
},
|
|
82
|
+
"getter": false,
|
|
83
|
+
"setter": false,
|
|
84
|
+
"attribute": "size",
|
|
85
|
+
"reflect": false,
|
|
86
|
+
"defaultValue": "40"
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -10,11 +10,11 @@ export class ZonosLogo {
|
|
|
10
10
|
const filterColor = this.theme === 'DARK'
|
|
11
11
|
? 'invert(100%) sepia(100%) saturate(0%) hue-rotate(288deg) brightness(102%) contrast(102%)'
|
|
12
12
|
: 'whiteinvert(0%) sepia(100%) saturate(32%) hue-rotate(92deg) brightness(107%) contrast(107%)';
|
|
13
|
-
return (h(Host, { key: '
|
|
13
|
+
return (h(Host, { key: 'c41a277084d4880e1f452a1f7ca097ad3507059f', class: classes(['zonos--elements zonos--logo']), style: {
|
|
14
14
|
'--zonos--filter-color': filterColor,
|
|
15
15
|
'--zonos--font-family': zonosStoreFontFamily(),
|
|
16
16
|
'--zonos--width': this.width,
|
|
17
|
-
} }, h("img", { key: '
|
|
17
|
+
} }, h("img", { key: '01361446c08074a8f8b4cac206a999e381d5d903', alt: "Zonos Logo", src: getAssetPath('./assets/ZonosLogo.png') })));
|
|
18
18
|
}
|
|
19
19
|
static get is() { return "zonos-logo"; }
|
|
20
20
|
static get encapsulation() { return "shadow"; }
|