@zonos/elements 1.3.7-alpha.0 → 1.3.7-alpha.1
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/{cart-ecc80eb0.js → cart-89d9fff4.js} +150 -95
- package/dist/cjs/formatStringWithLinks-52341fc7.js +17 -0
- package/dist/cjs/{getBorderRadius-834c321d.js → getBorderRadius-d8f18958.js} +1 -1
- package/dist/cjs/{isDarkColor-924e6a7a.js → isDarkColor-57860b44.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/submitGtag-24740560.js +55 -0
- package/dist/cjs/zonos-address_4.cjs.entry.js +20 -14
- package/dist/cjs/zonos-badge_2.cjs.entry.js +6 -6
- package/dist/cjs/zonos-banner.cjs.entry.js +1 -1
- package/dist/cjs/zonos-button_3.cjs.entry.js +8 -8
- package/dist/cjs/zonos-card_2.cjs.entry.js +8 -8
- package/dist/cjs/zonos-cart-items_9.cjs.entry.js +35 -33
- package/dist/cjs/zonos-checkout.cjs.entry.js +158 -21
- package/dist/cjs/zonos-component.cjs.entry.js +1 -1
- package/dist/cjs/zonos-controller.cjs.entry.js +28 -8
- package/dist/cjs/zonos-country-flag.cjs.entry.js +4 -4
- package/dist/cjs/zonos-country-select_3.cjs.entry.js +18 -10
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +9 -7
- package/dist/cjs/zonos-hello.cjs.entry.js +24 -9
- package/dist/cjs/zonos-link.cjs.entry.js +24 -0
- package/dist/cjs/zonos-logo.cjs.entry.js +3 -3
- package/dist/cjs/zonos-notification.cjs.entry.js +1 -1
- package/dist/cjs/zonos-payment.cjs.entry.js +5 -5
- package/dist/cjs/zonos-select-dialog-header_2.cjs.entry.js +5 -5
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +3 -3
- package/dist/cjs/zonos-text.cjs.entry.js +1 -1
- package/dist/cjs/{zonosStore-49d4c92a.js → zonosStore-138c5555.js} +5 -3
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +1 -6
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +19 -10
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.css +3 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +39 -18
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.css +3 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +2 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-review/zonos-review.js +1 -6
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.css +3 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +5 -0
- package/dist/collection/components/common/component-template/zonos-link/zonos-link.css +54 -0
- package/dist/collection/components/common/component-template/zonos-link/zonos-link.js +97 -0
- package/dist/collection/components/common/zonos-badge/zonos-badge.js +3 -3
- package/dist/collection/components/common/zonos-button/zonos-button.css +2 -0
- package/dist/collection/components/common/zonos-button/zonos-button.js +4 -4
- package/dist/collection/components/common/zonos-card/zonos-card.js +2 -2
- package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +3 -3
- package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +13 -6
- package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +8 -2
- package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +4 -2
- package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +3 -3
- package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +2 -2
- package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -2
- package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +2 -2
- package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js +1 -1
- 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/component-template/zonos-component/zonos-component.js +1 -1
- package/dist/collection/components/hello/zonos-hello/zonos-hello.js +50 -11
- 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 +5 -3
- package/dist/collection/components/main/zonos-controller.js +1 -1
- package/dist/collection/components/store/checkout/cart.js +2 -2
- package/dist/collection/components/store/checkout/stripe.js +26 -4
- package/dist/collection/components/store/hello/localization.js +7 -6
- package/dist/collection/components/store/zonosStore.js +5 -3
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +1 -1
- package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +1 -1
- package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
- package/dist/collection/components/utils/api/trackConversionEvent.js +22 -0
- package/dist/collection/components/utils/checkout/isShippableCountry.js +15 -0
- package/dist/collection/components/utils/checkout/watchBigcommerceDomesticCheckout.js +111 -0
- package/dist/collection/components/utils/formatStringWithLinks.js +13 -0
- package/dist/collection/components/utils/handleFetch.js +1 -1
- package/dist/collection/components/utils/hello/currencyConversion/defaultCurrencyConverter.js +25 -28
- package/dist/collection/components/utils/hello/currencyConversion/getCurrencyElements.js +2 -1
- package/dist/collection/components/utils/hello/currencyConversion/getInitialElementAmount.js +8 -6
- package/dist/collection/components/utils/hello/initHello.js +23 -3
- package/dist/collection/components/utils/logging/log.js +20 -9
- package/dist/collection/components/utils/logging/logError.js +2 -1
- package/dist/collection/components/utils/logging/sendErrorLog.js +12 -0
- package/dist/collection/scripts/checkIfLoadVersionDomain.js +35 -0
- package/dist/collection/scripts/zonosBase.js +21 -31
- package/dist/collection/styles/stripe/addressRuleStyle.js +4 -0
- package/dist/collection/types/generated/graphql.customer.types.js +1 -4
- package/dist/collection/types/generated/graphql.frontend.types.js +3 -0
- package/dist/components/stripe.js +145 -93
- package/dist/components/trackConversionEvent.js +24 -0
- package/dist/components/zonos-address2.js +1 -1
- package/dist/components/zonos-badge2.js +3 -3
- package/dist/components/zonos-button2.js +5 -5
- package/dist/components/zonos-card2.js +2 -2
- package/dist/components/zonos-cart-subtotal2.js +1 -6
- package/dist/components/zonos-checkbox2.js +3 -3
- package/dist/components/zonos-checkout-finish2.js +32 -12
- package/dist/components/zonos-checkout-payment2.js +1 -1
- package/dist/components/zonos-checkout.js +157 -18
- package/dist/components/zonos-collapse2.js +13 -6
- package/dist/components/zonos-component.js +1 -1
- package/dist/components/zonos-controller.js +25 -5
- package/dist/components/zonos-country-select2.js +9 -3
- package/dist/components/zonos-custom-message2.js +18 -3
- package/dist/components/zonos-customer-info2.js +3 -1
- package/dist/components/zonos-dialog2.js +3 -3
- package/dist/components/zonos-hello-dialog-footer2.js +2 -2
- package/dist/components/zonos-hello-dialog2.js +6 -5
- package/dist/components/zonos-hello.js +23 -7
- package/dist/components/zonos-language-select2.js +3 -3
- package/dist/components/zonos-link-authentication2.js +1 -1
- package/dist/components/zonos-link.d.ts +11 -0
- package/dist/components/zonos-link.js +43 -0
- package/dist/components/zonos-logo.js +2 -2
- package/dist/components/zonos-payment2.js +1 -1
- package/dist/components/zonos-review2.js +1 -6
- package/dist/components/zonos-select-dialog-header2.js +2 -2
- package/dist/components/zonos-shipping-rich-radio2.js +1 -1
- package/dist/components/zonos-shipping2.js +7 -2
- package/dist/components/zonos-tooltip2.js +2 -2
- package/dist/components/zonos-v-stack2.js +2 -2
- package/dist/components/zonosStore.js +5 -3
- package/dist/esm/{cart-2a0a6871.js → cart-1bbb7662.js} +148 -96
- package/dist/esm/formatStringWithLinks-9e819405.js +15 -0
- package/dist/esm/{getBorderRadius-0c7dfcf0.js → getBorderRadius-19787feb.js} +1 -1
- package/dist/esm/{isDarkColor-d0a57fd2.js → isDarkColor-2344e7a5.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/submitGtag-d3d11f1a.js +51 -0
- package/dist/esm/zonos-address_4.entry.js +20 -14
- package/dist/esm/zonos-badge_2.entry.js +6 -6
- package/dist/esm/zonos-banner.entry.js +1 -1
- package/dist/esm/zonos-button_3.entry.js +8 -8
- package/dist/esm/zonos-card_2.entry.js +8 -8
- package/dist/esm/zonos-cart-items_9.entry.js +35 -33
- package/dist/esm/zonos-checkout.entry.js +158 -21
- package/dist/esm/zonos-component.entry.js +1 -1
- package/dist/esm/zonos-controller.entry.js +28 -8
- package/dist/esm/zonos-country-flag.entry.js +4 -4
- package/dist/esm/zonos-country-select_3.entry.js +19 -11
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +9 -7
- package/dist/esm/zonos-hello.entry.js +24 -9
- package/dist/esm/zonos-link.entry.js +20 -0
- package/dist/esm/zonos-logo.entry.js +3 -3
- package/dist/esm/zonos-notification.entry.js +1 -1
- package/dist/esm/zonos-payment.entry.js +5 -5
- package/dist/esm/zonos-select-dialog-header_2.entry.js +5 -5
- package/dist/esm/zonos-shipping-rich-radio.entry.js +3 -3
- package/dist/esm/zonos-text.entry.js +1 -1
- package/dist/esm/{zonosStore-dec6bd7e.js → zonosStore-00bce01b.js} +5 -3
- package/dist/esm-es5/{cart-2a0a6871.js → cart-1bbb7662.js} +1 -1
- package/dist/esm-es5/formatStringWithLinks-9e819405.js +1 -0
- package/dist/esm-es5/{getBorderRadius-0c7dfcf0.js → getBorderRadius-19787feb.js} +1 -1
- package/dist/esm-es5/{isDarkColor-d0a57fd2.js → isDarkColor-2344e7a5.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/submitGtag-d3d11f1a.js +1 -0
- package/dist/esm-es5/zonos-address_4.entry.js +1 -1
- package/dist/esm-es5/zonos-badge_2.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_2.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_9.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.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_3.entry.js +1 -1
- package/dist/esm-es5/zonos-elements.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-link.entry.js +1 -0
- package/dist/esm-es5/zonos-logo.entry.js +1 -1
- package/dist/esm-es5/zonos-notification.entry.js +1 -1
- package/dist/esm-es5/zonos-payment.entry.js +1 -1
- package/dist/esm-es5/zonos-select-dialog-header_2.entry.js +1 -1
- package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
- package/dist/esm-es5/zonos-text.entry.js +1 -1
- package/dist/esm-es5/{zonosStore-dec6bd7e.js → zonosStore-00bce01b.js} +1 -1
- package/dist/scripts/checkIfLoadVersionDomain.js +1 -0
- package/dist/scripts/loadStripe.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/stripe.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/scripts/zonosBase.js +1 -1
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +1 -1
- package/dist/types/components/common/component-template/zonos-link/zonos-link.d.ts +19 -0
- package/dist/types/components/common/zonos-collapse/zonos-collapse.d.ts +1 -0
- package/dist/types/components/common/zonos-country-select/zonos-country-select.d.ts +2 -0
- package/dist/types/components/hello/zonos-hello/zonos-hello.d.ts +9 -3
- package/dist/types/components/store/checkout/cart.d.ts +6 -3
- package/dist/types/components/store/checkout/stripe.d.ts +22 -1
- package/dist/types/components/store/hello/localization.d.ts +1 -1
- package/dist/types/components/store/zonosStore.d.ts +1 -0
- package/dist/types/components/utils/api/trackConversionEvent.d.ts +3 -0
- package/dist/types/components/utils/checkout/isShippableCountry.d.ts +1 -0
- package/dist/types/components/utils/checkout/watchBigcommerceDomesticCheckout.d.ts +20 -0
- package/dist/types/components/utils/formatStringWithLinks.d.ts +1 -0
- package/dist/types/components/utils/hello/currencyConversion/getCurrencyElements.d.ts +1 -1
- package/dist/types/components/utils/logging/log.d.ts +1 -1
- package/dist/types/components/utils/logging/sendErrorLog.d.ts +7 -0
- package/dist/types/components.d.ts +53 -3
- package/dist/types/scripts/checkIfLoadVersionDomain.d.ts +13 -0
- package/dist/types/scripts/zonosBase.d.ts +2 -0
- package/dist/types/types/checkout/CheckoutConfig.d.ts +1 -1
- package/dist/types/types/generated/graphql.customer.types.d.ts +8 -53
- package/dist/types/types/generated/graphql.customer.types.ts +18 -62
- package/dist/types/types/generated/graphql.frontend.types.d.ts +8 -0
- package/dist/types/types/generated/graphql.frontend.types.ts +18 -0
- package/dist/zonos-elements/p-0318632a.entry.js +1 -0
- package/dist/zonos-elements/p-066c5893.system.js +1 -1
- package/dist/zonos-elements/p-07966463.entry.js +1 -0
- package/dist/zonos-elements/p-0c0aa552.js +1 -0
- package/dist/zonos-elements/p-127b480c.entry.js +1 -0
- package/dist/zonos-elements/p-135ab559.system.entry.js +1 -0
- package/dist/zonos-elements/{p-e855966f.system.entry.js → p-143dc0d9.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-55970b10.system.entry.js → p-14d27ce1.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-a93c594f.entry.js → p-15a80c4a.entry.js} +1 -1
- package/dist/zonos-elements/p-17e87be1.entry.js +1 -0
- package/dist/zonos-elements/{p-a95c034c.entry.js → p-1e0dd491.entry.js} +1 -1
- package/dist/zonos-elements/{p-34efed1d.entry.js → p-279d1c5f.entry.js} +1 -1
- package/dist/zonos-elements/p-2d6557ee.system.js +1 -0
- package/dist/zonos-elements/p-314be538.system.entry.js +1 -0
- package/dist/zonos-elements/{p-79b910bf.system.entry.js → p-328b7f6f.system.entry.js} +1 -1
- package/dist/zonos-elements/p-354603b3.system.entry.js +1 -0
- package/dist/zonos-elements/{p-591eb6dd.system.js → p-49f6a985.system.js} +1 -1
- package/dist/zonos-elements/p-57b65321.system.entry.js +1 -0
- package/dist/zonos-elements/{p-5b44abc8.system.js → p-58c1ddef.system.js} +1 -1
- package/dist/zonos-elements/{p-06652d87.system.entry.js → p-58e2f6a1.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-7d1d862f.system.entry.js → p-5ee03db0.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-88a55076.system.entry.js → p-61e5cf29.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-67737613.system.entry.js → p-799d8a17.system.entry.js} +1 -1
- package/dist/zonos-elements/p-7a32526c.entry.js +1 -0
- package/dist/zonos-elements/p-7b87b82f.js +1 -0
- package/dist/zonos-elements/{p-e2770968.system.entry.js → p-7c45ce37.system.entry.js} +1 -1
- package/dist/zonos-elements/p-84f4f00f.entry.js +1 -0
- package/dist/zonos-elements/{p-2d2e1831.entry.js → p-857cfe35.entry.js} +1 -1
- package/dist/zonos-elements/{p-dfd3edcf.entry.js → p-87e9c42f.entry.js} +1 -1
- package/dist/zonos-elements/{p-ec4d08b3.system.js → p-91797d4e.system.js} +1 -1
- package/dist/zonos-elements/{p-34c03be2.js → p-95e0fc06.js} +1 -1
- package/dist/zonos-elements/{p-afe40057.entry.js → p-a3cc0f84.entry.js} +1 -1
- package/dist/zonos-elements/p-a5f12396.entry.js +1 -0
- package/dist/zonos-elements/p-a87561b8.js +1 -0
- package/dist/zonos-elements/{p-e161a08c.entry.js → p-ac0a7b8f.entry.js} +1 -1
- package/dist/zonos-elements/{p-9878a770.js → p-ae82a9ae.js} +1 -1
- package/dist/zonos-elements/p-b0462325.system.entry.js +1 -0
- package/dist/zonos-elements/{p-1f85a98c.system.entry.js → p-b2c0ec71.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-549c181b.system.js → p-b4725505.system.js} +1 -1
- package/dist/zonos-elements/p-bef54fb1.entry.js +1 -0
- package/dist/zonos-elements/{p-0c72fb79.system.entry.js → p-c0d431f6.system.entry.js} +1 -1
- package/dist/zonos-elements/p-d054788b.system.js +1 -0
- package/dist/zonos-elements/{p-375c472a.system.entry.js → p-d407c93a.system.entry.js} +1 -1
- package/dist/zonos-elements/p-e55dd932.js +1 -0
- package/dist/zonos-elements/p-ec37439e.entry.js +1 -0
- package/dist/zonos-elements/p-edace42b.entry.js +1 -0
- package/dist/zonos-elements/{p-cc63a29f.system.entry.js → p-f478c814.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-8aeb4679.system.entry.js → p-f6eaef7b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-c7098c3b.entry.js → p-f7c36fcc.entry.js} +1 -1
- package/dist/zonos-elements/p-f862b97f.system.entry.js +1 -0
- package/dist/zonos-elements/p-fd642725.entry.js +1 -0
- package/dist/zonos-elements/p-fdb72530.system.entry.js +1 -0
- package/dist/zonos-elements/{p-a4de3fb2.entry.js → p-ff64ddc5.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/submitGtag-907e71d3.js +0 -21
- package/dist/collection/scripts/extractZonosQaUrl.js +0 -26
- package/dist/esm/submitGtag-a38aed23.js +0 -19
- package/dist/esm-es5/submitGtag-a38aed23.js +0 -1
- package/dist/types/scripts/extractZonosQaUrl.d.ts +0 -11
- package/dist/zonos-elements/p-0057e374.entry.js +0 -1
- package/dist/zonos-elements/p-290c3670.entry.js +0 -1
- package/dist/zonos-elements/p-2f1e1cbb.system.entry.js +0 -1
- package/dist/zonos-elements/p-33080cde.system.entry.js +0 -1
- package/dist/zonos-elements/p-561e44d6.entry.js +0 -1
- package/dist/zonos-elements/p-5c4dc123.js +0 -1
- package/dist/zonos-elements/p-656c836b.entry.js +0 -1
- package/dist/zonos-elements/p-8d645a00.entry.js +0 -1
- package/dist/zonos-elements/p-a219689f.entry.js +0 -1
- package/dist/zonos-elements/p-a3d72a33.entry.js +0 -1
- package/dist/zonos-elements/p-b10ff468.entry.js +0 -1
- package/dist/zonos-elements/p-b6992dc2.system.entry.js +0 -1
- package/dist/zonos-elements/p-bce46c41.js +0 -1
- package/dist/zonos-elements/p-c56d4a44.entry.js +0 -1
- package/dist/zonos-elements/p-cbb1e700.system.js +0 -1
- package/dist/zonos-elements/p-cd8bd5e9.system.entry.js +0 -1
- package/dist/zonos-elements/p-d36faf87.system.entry.js +0 -1
- package/dist/zonos-elements/p-e2c6ad57.entry.js +0 -1
- package/dist/zonos-elements/p-ea93943a.system.entry.js +0 -1
- package/dist/zonos-elements/p-f455e08c.js +0 -1
|
@@ -2821,6 +2821,7 @@ const { reset, state: zonosStore } = createStore(() => ({
|
|
|
2821
2821
|
restrictionBehavior: 'DISABLED',
|
|
2822
2822
|
},
|
|
2823
2823
|
loadedConfig: false,
|
|
2824
|
+
organizationId: '',
|
|
2824
2825
|
organizationName: '',
|
|
2825
2826
|
sourceCurrency: 'USD',
|
|
2826
2827
|
storeId: null,
|
|
@@ -2833,7 +2834,7 @@ let savedZonosSettings = null;
|
|
|
2833
2834
|
* Init setting from zonos setting
|
|
2834
2835
|
*/
|
|
2835
2836
|
const zonosStoreInitSetting = ({ overrideSettings, zonosSettings, }) => {
|
|
2836
|
-
var _a, _b, _c;
|
|
2837
|
+
var _a, _b, _c, _d;
|
|
2837
2838
|
reset();
|
|
2838
2839
|
if (zonosSettings) {
|
|
2839
2840
|
// save zonos settings to be used later
|
|
@@ -2848,8 +2849,9 @@ const zonosStoreInitSetting = ({ overrideSettings, zonosSettings, }) => {
|
|
|
2848
2849
|
zonosStore.helloSettings = mergeConfig(zonosStore.helloSettings, (savedZonosSettings === null || savedZonosSettings === void 0 ? void 0 : savedZonosSettings.helloSettings) || (zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.helloSettings) || null, overrideSettings === null || overrideSettings === void 0 ? void 0 : overrideSettings.helloSettings);
|
|
2849
2850
|
// set flag to true to indicate that config is ready
|
|
2850
2851
|
zonosStore.loadedConfig = true;
|
|
2851
|
-
zonosStore.
|
|
2852
|
-
zonosStore.
|
|
2852
|
+
zonosStore.organizationId = ((_a = zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.organization) === null || _a === void 0 ? void 0 : _a.id) || '';
|
|
2853
|
+
zonosStore.organizationName = ((_b = zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.organization) === null || _b === void 0 ? void 0 : _b.name) || '';
|
|
2854
|
+
zonosStore.storeId = ((_d = (_c = zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.organization) === null || _c === void 0 ? void 0 : _c.references) === null || _d === void 0 ? void 0 : _d.storeId) || null;
|
|
2853
2855
|
zonosStore.currencyConverter = overrideSettings === null || overrideSettings === void 0 ? void 0 : overrideSettings.currencyConverter;
|
|
2854
2856
|
};
|
|
2855
2857
|
const zonosStoreFontFamily = () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as createStore, z as zonosStore } from './zonosStore-
|
|
2
|
-
import { i as isDarkColor } from './isDarkColor-
|
|
3
|
-
import { g as getBorderRadius } from './getBorderRadius-
|
|
1
|
+
import { c as createStore, z as zonosStore } from './zonosStore-00bce01b.js';
|
|
2
|
+
import { i as isDarkColor } from './isDarkColor-2344e7a5.js';
|
|
3
|
+
import { g as getBorderRadius } from './getBorderRadius-19787feb.js';
|
|
4
4
|
|
|
5
5
|
const stringsArabic = {
|
|
6
6
|
'Above de minimis threshold for': {
|
|
@@ -3546,7 +3546,7 @@ const handleFetch = async (url, _opts) => {
|
|
|
3546
3546
|
const modifiedUrl = new URL(url);
|
|
3547
3547
|
modifiedUrl.searchParams.set('zToken', encodeString(window.location.hostname));
|
|
3548
3548
|
// headers content type
|
|
3549
|
-
const headers = Object.assign({ 'Content-Type': 'application/json', 'Zonos-Is-BigCommerce': window.Zonos.isBigCommerce.toString(), 'Zonos-Referer': window.location.hostname, 'Zonos-Version': window.Zonos.version, credentialtoken: window.Zonos.zonosApiKey }, opts.headers);
|
|
3549
|
+
const headers = Object.assign({ 'Content-Type': 'application/json', 'Zonos-Is-BigCommerce': window.Zonos.isBigCommerce.toString(), 'Zonos-Referer': window.location.hostname, 'Zonos-Version': window.Zonos.version, credentialtoken: window.Zonos.zonosApiKey || 'Empty credential token from zonos-elements' }, opts.headers);
|
|
3550
3550
|
const options = Object.assign(Object.assign({}, opts), { body: method === 'GET' ? undefined : body, headers,
|
|
3551
3551
|
method });
|
|
3552
3552
|
return handleRequest(modifiedUrl.toString(), options);
|
|
@@ -3567,9 +3567,65 @@ const getCountries = async () => {
|
|
|
3567
3567
|
}
|
|
3568
3568
|
};
|
|
3569
3569
|
|
|
3570
|
+
const log = (message, type, ...additionalInfo) => {
|
|
3571
|
+
var _a, _b;
|
|
3572
|
+
const isDebug = !((_a = window.Zonos) === null || _a === void 0 ? void 0 : _a.debug) ||
|
|
3573
|
+
!window.location.search.match(/\?.*(&*)zonosDebug=1/);
|
|
3574
|
+
// if debug is false, do not log
|
|
3575
|
+
if (!isDebug) {
|
|
3576
|
+
// log errors to the console if the type is error
|
|
3577
|
+
if (type === 'error') {
|
|
3578
|
+
// eslint-disable-next-line no-console
|
|
3579
|
+
console.error(message, ...additionalInfo);
|
|
3580
|
+
}
|
|
3581
|
+
return;
|
|
3582
|
+
}
|
|
3583
|
+
let loggingIframe = document.querySelector('iframe#zonos---debug-logging-iframe');
|
|
3584
|
+
if (!loggingIframe) {
|
|
3585
|
+
// add a hidden iframe
|
|
3586
|
+
loggingIframe = document.createElement('iframe');
|
|
3587
|
+
loggingIframe.id = 'zonos---debug-logging-iframe';
|
|
3588
|
+
loggingIframe.style.display = 'none';
|
|
3589
|
+
loggingIframe.style.opacity = '0';
|
|
3590
|
+
loggingIframe.style.position = 'absolute';
|
|
3591
|
+
loggingIframe.style.top = '-9999px';
|
|
3592
|
+
loggingIframe.style.left = '-9999px';
|
|
3593
|
+
loggingIframe.style.width = '1px';
|
|
3594
|
+
loggingIframe.style.height = '1px';
|
|
3595
|
+
loggingIframe.style.border = 'none';
|
|
3596
|
+
loggingIframe.style.overflow = 'hidden';
|
|
3597
|
+
loggingIframe.style.visibility = 'hidden';
|
|
3598
|
+
document.body.appendChild(loggingIframe);
|
|
3599
|
+
}
|
|
3600
|
+
// use the logging iframe's console to log just in case the console is disabled (overriden) by the site owner
|
|
3601
|
+
const zConsole = ((_b = loggingIframe.contentWindow) === null || _b === void 0 ? void 0 : _b.window.console) || window.console;
|
|
3602
|
+
switch (type) {
|
|
3603
|
+
case 'warn':
|
|
3604
|
+
// eslint-disable-next-line no-console
|
|
3605
|
+
zConsole.warn(message, ...additionalInfo);
|
|
3606
|
+
break;
|
|
3607
|
+
case 'info':
|
|
3608
|
+
// eslint-disable-next-line no-console
|
|
3609
|
+
zConsole.info(message, ...additionalInfo);
|
|
3610
|
+
break;
|
|
3611
|
+
case 'error':
|
|
3612
|
+
// eslint-disable-next-line no-console
|
|
3613
|
+
zConsole.error(message, ...additionalInfo);
|
|
3614
|
+
break;
|
|
3615
|
+
default:
|
|
3616
|
+
// eslint-disable-next-line no-console
|
|
3617
|
+
zConsole.groupCollapsed(message, ...additionalInfo);
|
|
3618
|
+
// eslint-disable-next-line no-console
|
|
3619
|
+
zConsole.trace();
|
|
3620
|
+
// eslint-disable-next-line no-console
|
|
3621
|
+
zConsole.groupEnd();
|
|
3622
|
+
break;
|
|
3623
|
+
}
|
|
3624
|
+
};
|
|
3625
|
+
|
|
3570
3626
|
const logError = (message, ...rest) => {
|
|
3571
3627
|
// eslint-disable-next-line no-console
|
|
3572
|
-
|
|
3628
|
+
log(message, 'error', ...rest);
|
|
3573
3629
|
};
|
|
3574
3630
|
|
|
3575
3631
|
const getCountryLandedCost = async (countryCode) => {
|
|
@@ -3731,51 +3787,6 @@ const isValidSelector = (selector) => {
|
|
|
3731
3787
|
return true;
|
|
3732
3788
|
};
|
|
3733
3789
|
|
|
3734
|
-
const log = (message, type, ...additionalInfo) => {
|
|
3735
|
-
var _a;
|
|
3736
|
-
// if type is error and debug is false, do not log
|
|
3737
|
-
if (!window.Zonos.debug) {
|
|
3738
|
-
return;
|
|
3739
|
-
}
|
|
3740
|
-
let loggingIframe = document.querySelector('iframe#zonos---debug-logging-iframe');
|
|
3741
|
-
if (!loggingIframe) {
|
|
3742
|
-
// add a hidden iframe
|
|
3743
|
-
loggingIframe = document.createElement('iframe');
|
|
3744
|
-
loggingIframe.id = 'zonos---debug-logging-iframe';
|
|
3745
|
-
loggingIframe.style.display = 'none';
|
|
3746
|
-
loggingIframe.style.opacity = '0';
|
|
3747
|
-
loggingIframe.style.position = 'absolute';
|
|
3748
|
-
loggingIframe.style.top = '-9999px';
|
|
3749
|
-
loggingIframe.style.left = '-9999px';
|
|
3750
|
-
loggingIframe.style.width = '1px';
|
|
3751
|
-
loggingIframe.style.height = '1px';
|
|
3752
|
-
loggingIframe.style.border = 'none';
|
|
3753
|
-
loggingIframe.style.overflow = 'hidden';
|
|
3754
|
-
loggingIframe.style.visibility = 'hidden';
|
|
3755
|
-
document.body.appendChild(loggingIframe);
|
|
3756
|
-
}
|
|
3757
|
-
// use the logging iframe's console to log just in case the console is disabled (overriden) by the site owner
|
|
3758
|
-
const console = ((_a = loggingIframe.contentWindow) === null || _a === void 0 ? void 0 : _a.window.console) || window.console;
|
|
3759
|
-
switch (type) {
|
|
3760
|
-
case 'warn':
|
|
3761
|
-
// eslint-disable-next-line no-console
|
|
3762
|
-
console.warn(message, ...additionalInfo);
|
|
3763
|
-
break;
|
|
3764
|
-
case 'info':
|
|
3765
|
-
// eslint-disable-next-line no-console
|
|
3766
|
-
console.info(message, ...additionalInfo);
|
|
3767
|
-
break;
|
|
3768
|
-
default:
|
|
3769
|
-
// eslint-disable-next-line no-console
|
|
3770
|
-
console.groupCollapsed(message, ...additionalInfo);
|
|
3771
|
-
// eslint-disable-next-line no-console
|
|
3772
|
-
console.trace();
|
|
3773
|
-
// eslint-disable-next-line no-console
|
|
3774
|
-
console.groupEnd();
|
|
3775
|
-
break;
|
|
3776
|
-
}
|
|
3777
|
-
};
|
|
3778
|
-
|
|
3779
3790
|
const getCurrencyElements = (selector) => {
|
|
3780
3791
|
const currencySelector = selector || '.money';
|
|
3781
3792
|
if (!isValidSelector(currencySelector)) {
|
|
@@ -3789,18 +3800,21 @@ const getCurrencyElements = (selector) => {
|
|
|
3789
3800
|
log(`No currency elements found with selector "${currencySelector}"`, 'warn');
|
|
3790
3801
|
return null;
|
|
3791
3802
|
}
|
|
3792
|
-
return
|
|
3803
|
+
// return array of currency elements instead of a NodeList
|
|
3804
|
+
return Array.from(currencyElements);
|
|
3793
3805
|
};
|
|
3794
3806
|
|
|
3795
3807
|
const getInitialElementAmount = (element) => {
|
|
3796
3808
|
var _a;
|
|
3797
3809
|
const domesticValue = element.getAttribute('data-domestic');
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3810
|
+
const intlValue = element.getAttribute('data-zintl');
|
|
3811
|
+
// Only keep numbers, decimal, and hyphens
|
|
3812
|
+
const cleanedText = (_a = element.textContent) === null || _a === void 0 ? void 0 : _a.replace(/[^\d.-]/g, '');
|
|
3813
|
+
if (!cleanedText) {
|
|
3814
|
+
return null;
|
|
3815
|
+
}
|
|
3816
|
+
// If the element has no data-domestic attribute, or the text content is different from the data-zintl attribute, set the data-domestic attribute
|
|
3817
|
+
if (!domesticValue || element.textContent !== intlValue) {
|
|
3804
3818
|
// Store the original value on the element once, and international on every new conversion
|
|
3805
3819
|
element.setAttribute('data-domestic', cleanedText);
|
|
3806
3820
|
return parseFloat(cleanedText);
|
|
@@ -3808,9 +3822,32 @@ const getInitialElementAmount = (element) => {
|
|
|
3808
3822
|
return parseFloat(domesticValue);
|
|
3809
3823
|
};
|
|
3810
3824
|
|
|
3825
|
+
const convertCurrency = (element) => {
|
|
3826
|
+
var _a;
|
|
3827
|
+
const amount = getInitialElementAmount(element);
|
|
3828
|
+
if (!amount || isNaN(amount)) {
|
|
3829
|
+
return;
|
|
3830
|
+
}
|
|
3831
|
+
const currentIntlValue = element.getAttribute('data-zintl');
|
|
3832
|
+
const currentCountryValue = element.getAttribute('data-zcountry-code');
|
|
3833
|
+
// do nothing if the target currency is the same
|
|
3834
|
+
const isExchangeRateReady = localizationStore.targetCurrency ===
|
|
3835
|
+
((_a = localizationStore.exchangeRate) === null || _a === void 0 ? void 0 : _a.targetFormat.currencyCode);
|
|
3836
|
+
// if the current value on the element is different from the current intl value, update the data-zintl attribute
|
|
3837
|
+
if (isExchangeRateReady &&
|
|
3838
|
+
(element.textContent !== currentIntlValue ||
|
|
3839
|
+
currentCountryValue !== localizationStore.selectedCountryCode)) {
|
|
3840
|
+
const observedFormattedValue = currencyConvertAndFormat(amount);
|
|
3841
|
+
element.textContent = observedFormattedValue;
|
|
3842
|
+
// save the new value to the data-zintl attribute
|
|
3843
|
+
element.setAttribute('data-zintl', observedFormattedValue);
|
|
3844
|
+
element.setAttribute('data-zcountry-code', localizationStore.selectedCountryCode || '');
|
|
3845
|
+
}
|
|
3846
|
+
};
|
|
3811
3847
|
const defaultCurrencyConverter = () => {
|
|
3812
3848
|
const { currencyElementSelector } = zonosStore.helloSettings;
|
|
3813
3849
|
const currencyElements = getCurrencyElements(currencyElementSelector);
|
|
3850
|
+
// do nothing if none of the currency elements are found
|
|
3814
3851
|
if (!(currencyElements === null || currencyElements === void 0 ? void 0 : currencyElements.length)) {
|
|
3815
3852
|
return;
|
|
3816
3853
|
}
|
|
@@ -3819,33 +3856,8 @@ const defaultCurrencyConverter = () => {
|
|
|
3819
3856
|
return;
|
|
3820
3857
|
}
|
|
3821
3858
|
currencyElements.forEach((element) => {
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
return;
|
|
3825
|
-
}
|
|
3826
|
-
element.setAttribute('data-zintl', currencyConvert(amount).toString());
|
|
3827
|
-
// Check if an observer is already attached to the element
|
|
3828
|
-
let observer = element._mutationObserver;
|
|
3829
|
-
if (!observer) {
|
|
3830
|
-
observer = new MutationObserver(() => {
|
|
3831
|
-
const observedFormattedValue = currencyConvertAndFormat(amount);
|
|
3832
|
-
element.textContent = observedFormattedValue;
|
|
3833
|
-
});
|
|
3834
|
-
observer.observe(element, {
|
|
3835
|
-
characterData: true,
|
|
3836
|
-
childList: true,
|
|
3837
|
-
});
|
|
3838
|
-
element._mutationObserver = observer;
|
|
3839
|
-
}
|
|
3840
|
-
// Temporarily disconnect the observer to prevent an infinite loop
|
|
3841
|
-
observer.disconnect();
|
|
3842
|
-
const formattedValue = currencyConvertAndFormat(amount);
|
|
3843
|
-
element.textContent = formattedValue;
|
|
3844
|
-
// Reconnect the observer after the update is complete
|
|
3845
|
-
observer.observe(element, {
|
|
3846
|
-
characterData: true,
|
|
3847
|
-
childList: true,
|
|
3848
|
-
});
|
|
3859
|
+
// convert the currency and save the formatted value to the data-zintl attribute
|
|
3860
|
+
convertCurrency(element);
|
|
3849
3861
|
});
|
|
3850
3862
|
};
|
|
3851
3863
|
|
|
@@ -3927,11 +3939,9 @@ const getNewLocalization = async () => {
|
|
|
3927
3939
|
!selectedCountryCode) {
|
|
3928
3940
|
return;
|
|
3929
3941
|
}
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
startExchangeRateTimeout({ isGuaranteed, maxAge });
|
|
3934
|
-
}
|
|
3942
|
+
const isGuaranteed = zonosStore.checkoutSettings.visibilityStatus === 'ENABLED';
|
|
3943
|
+
const { maxAge } = await triggerGetExchangeRate(isGuaranteed);
|
|
3944
|
+
startExchangeRateTimeout({ isGuaranteed, maxAge });
|
|
3935
3945
|
localizationStore.countryLandedCost = await getCountryLandedCost(localizationStore.selectedCountryCode);
|
|
3936
3946
|
};
|
|
3937
3947
|
const getCustomMessages = async () => {
|
|
@@ -3958,7 +3968,8 @@ const getOverrideLocale = () => {
|
|
|
3958
3968
|
const zonosLocale = currentUrl.searchParams.get('zonosLocale');
|
|
3959
3969
|
return zonosLocale;
|
|
3960
3970
|
};
|
|
3961
|
-
const localizationStoreUpdateSelectedCountryCode =
|
|
3971
|
+
const localizationStoreUpdateSelectedCountryCode = (newSelectedCountryCode) => {
|
|
3972
|
+
var _a;
|
|
3962
3973
|
log('update selected country code');
|
|
3963
3974
|
localizationStore.selectedCountryCode = newSelectedCountryCode;
|
|
3964
3975
|
const { selectedCountryCode, shippingZoneCountries } = localizationStore;
|
|
@@ -3982,6 +3993,8 @@ const localizationStoreUpdateSelectedCountryCode = async (newSelectedCountryCode
|
|
|
3982
3993
|
window.sessionStorage.setItem('zonos--country', selectedCountryCode);
|
|
3983
3994
|
// Update the URL query param with the new country code
|
|
3984
3995
|
setZCountryUrlParam(selectedCountryCode);
|
|
3996
|
+
(_a = document
|
|
3997
|
+
.querySelector('zonos-hello')) === null || _a === void 0 ? void 0 : _a.setAttribute('z-country', selectedCountryCode);
|
|
3985
3998
|
};
|
|
3986
3999
|
const initLocalizationStore = async () => {
|
|
3987
4000
|
// all countries from countries.json, shipping zone and localization
|
|
@@ -4137,11 +4150,26 @@ const calculateLandedCost = async (abortController) => {
|
|
|
4137
4150
|
return json;
|
|
4138
4151
|
};
|
|
4139
4152
|
|
|
4153
|
+
const jsonParse = (_data) => {
|
|
4154
|
+
if (typeof _data === 'string') {
|
|
4155
|
+
try {
|
|
4156
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
4157
|
+
const json = JSON.parse(_data);
|
|
4158
|
+
return json;
|
|
4159
|
+
}
|
|
4160
|
+
catch (_error) {
|
|
4161
|
+
return null;
|
|
4162
|
+
}
|
|
4163
|
+
}
|
|
4164
|
+
return null;
|
|
4165
|
+
};
|
|
4166
|
+
|
|
4140
4167
|
const addressRuleStyle = ({ theme, }) => {
|
|
4141
4168
|
switch (theme) {
|
|
4142
4169
|
default:
|
|
4143
4170
|
return {
|
|
4144
4171
|
'.Input': {
|
|
4172
|
+
boxShadow: 'none',
|
|
4145
4173
|
// need to reset everything and the paddingTop to default, otherwise the paddingTop will not be updated.
|
|
4146
4174
|
padding: '0',
|
|
4147
4175
|
paddingBottom: '8px',
|
|
@@ -4150,6 +4178,9 @@ const addressRuleStyle = ({ theme, }) => {
|
|
|
4150
4178
|
// any value here will be add up to the default paddingTop (20px).
|
|
4151
4179
|
paddingTop: '6px',
|
|
4152
4180
|
},
|
|
4181
|
+
'.Input:focus': {
|
|
4182
|
+
boxShadow: 'none',
|
|
4183
|
+
},
|
|
4153
4184
|
};
|
|
4154
4185
|
}
|
|
4155
4186
|
};
|
|
@@ -4216,6 +4247,17 @@ const getStripeOptions = ({ clientSecret, overrideBorderRaidus, overridePrimaryC
|
|
|
4216
4247
|
locale: localizationStore.selectedLocale,
|
|
4217
4248
|
};
|
|
4218
4249
|
};
|
|
4250
|
+
const stripeStoreCleanupDomesticShippingSession = () => {
|
|
4251
|
+
window.sessionStorage.removeItem('zonos--bigcommerce-domestic-checkout-shipping');
|
|
4252
|
+
};
|
|
4253
|
+
// Save shipping address to session storage
|
|
4254
|
+
const stripeStoreSaveDomesticShippingSession = (props) => {
|
|
4255
|
+
window.sessionStorage.setItem('zonos--bigcommerce-domestic-checkout-shipping', JSON.stringify(props));
|
|
4256
|
+
};
|
|
4257
|
+
const stripeStoreGetDomesticShippingSession = () => {
|
|
4258
|
+
const session = window.sessionStorage.getItem('zonos--bigcommerce-domestic-checkout-shipping');
|
|
4259
|
+
return jsonParse(session);
|
|
4260
|
+
};
|
|
4219
4261
|
const initStripeElements = async (props) => {
|
|
4220
4262
|
var _a, _b;
|
|
4221
4263
|
const clientSecret = stripeStore.clientSecret;
|
|
@@ -4317,12 +4359,18 @@ const stripeStorePrefetchLandedCost = async () => {
|
|
|
4317
4359
|
try {
|
|
4318
4360
|
const abortController = new AbortController();
|
|
4319
4361
|
stripeStore.fetchingLandedCostAbordController = abortController;
|
|
4320
|
-
const { checkoutSessionWorkflow, shipmentRatingCalculateWorkflow } = await calculateLandedCost(abortController);
|
|
4362
|
+
const { checkoutSessionWorkflow, landedCostCalculateWorkflow, shipmentRatingCalculateWorkflow, } = await calculateLandedCost(abortController);
|
|
4321
4363
|
// reset abort controller after we are done
|
|
4322
4364
|
stripeStore.fetchingLandedCostAbordController = null;
|
|
4323
4365
|
// update cart store with landed cost info
|
|
4324
4366
|
cartStore.landedCostData =
|
|
4325
|
-
(checkoutSessionWorkflow === null || checkoutSessionWorkflow === void 0 ? void 0 : checkoutSessionWorkflow.
|
|
4367
|
+
(checkoutSessionWorkflow === null || checkoutSessionWorkflow === void 0 ? void 0 : checkoutSessionWorkflow.map(checkoutSession => {
|
|
4368
|
+
const foundLandedCost = landedCostCalculateWorkflow === null || landedCostCalculateWorkflow === void 0 ? void 0 : landedCostCalculateWorkflow.find(item => { var _a; return (item === null || item === void 0 ? void 0 : item.id) === ((_a = checkoutSession.landedCost) === null || _a === void 0 ? void 0 : _a.id); });
|
|
4369
|
+
if (!foundLandedCost) {
|
|
4370
|
+
return null;
|
|
4371
|
+
}
|
|
4372
|
+
return Object.assign(Object.assign({}, checkoutSession), { landedCost: foundLandedCost });
|
|
4373
|
+
}).filter(Boolean)) || null;
|
|
4326
4374
|
cartStore.shippingData =
|
|
4327
4375
|
(shipmentRatingCalculateWorkflow === null || shipmentRatingCalculateWorkflow === void 0 ? void 0 : shipmentRatingCalculateWorkflow.filter(Boolean)) || null;
|
|
4328
4376
|
// apply new subtotal and total, this is mainly to show items in the presentment currency
|
|
@@ -4407,7 +4455,11 @@ const stripeStoreRetrievePayment = async ({ clientSecret: _clientSecret, storybo
|
|
|
4407
4455
|
const { paymentIntent } = await stripeStore.stripe.retrievePaymentIntent(clientSecret);
|
|
4408
4456
|
const status = paymentIntent === null || paymentIntent === void 0 ? void 0 : paymentIntent.status;
|
|
4409
4457
|
const { isError, messages } = getStripeMessageBasedOnStatus(status);
|
|
4410
|
-
return {
|
|
4458
|
+
return {
|
|
4459
|
+
error: isError,
|
|
4460
|
+
messages,
|
|
4461
|
+
paymentMethod: paymentIntent === null || paymentIntent === void 0 ? void 0 : paymentIntent.payment_method,
|
|
4462
|
+
};
|
|
4411
4463
|
};
|
|
4412
4464
|
const stripeStoreConfirmPayment = async () => {
|
|
4413
4465
|
var _a, _b, _c;
|
|
@@ -4599,14 +4651,14 @@ const cartStoreReCalculateTotal = async ({ currency, itemsAmount, landedCostId,
|
|
|
4599
4651
|
logError('Could not update cart total without checkout session id');
|
|
4600
4652
|
return false;
|
|
4601
4653
|
}
|
|
4602
|
-
const { json } = await stripeStoreUpdateCheckoutSession({
|
|
4654
|
+
const { errors, json } = await stripeStoreUpdateCheckoutSession({
|
|
4603
4655
|
currency,
|
|
4604
4656
|
id: cartStore.checkoutSessionId,
|
|
4605
4657
|
itemsAmount,
|
|
4606
4658
|
landedCostId,
|
|
4607
4659
|
presentmentCountryCode: localizationStore.selectedCountryCode,
|
|
4608
4660
|
});
|
|
4609
|
-
if (!json) {
|
|
4661
|
+
if (errors.length > 0 || !json) {
|
|
4610
4662
|
// do nothing if we can't get checkout session
|
|
4611
4663
|
logError('Error occurs when updating checkout session');
|
|
4612
4664
|
cartStoreUpdateToErrorState({
|
|
@@ -4717,4 +4769,4 @@ const cartStorePreviousStep = () => {
|
|
|
4717
4769
|
}
|
|
4718
4770
|
};
|
|
4719
4771
|
|
|
4720
|
-
export {
|
|
4772
|
+
export { currencyConvertAndFormat as A, currencyConvert as B, currencyFormat as C, stripeStoreRetrievePayment as D, cartStoreUpdateSelectedShippingOption as E, cartStoreGetShippingTransitInfo as F, localizationStoreUpdateSelectedLocale as G, log as a, localizationStoreUpdateSelectedCountryCode as b, stripeStoreCleanupDomesticShippingSession as c, logError as d, stripeStoreSaveDomesticShippingSession as e, cartStore as f, cartStoreUpdateItems as g, cartStoreReset as h, initStripeElements as i, stripeStore as j, stripeStoreInitCheckoutSession as k, localizationStore as l, cartStoreUpdateToErrorState as m, stripeStorePrefetchLandedCost as n, cartStoreNextStep as o, stripeStoreConfirmPayment as p, stripeStoreReset as q, cartStorePreviousStep as r, stripeStoreGetDomesticShippingSession as s, translate as t, handleFetch as u, isValidSelector as v, initLocalizationStore as w, getZCountryUrlParam as x, setZCountryUrlParam as y, currencyDisplay as z };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const formatStringWithLinks = (str) => {
|
|
2
|
+
// Match Markdown-style links or standalone URLs not in Markdown format
|
|
3
|
+
const linkRegex = /\[([^\]]+)\]\((https?:\/\/[^\s\)]+)\)|(https?:\/\/[^\s]+)/g;
|
|
4
|
+
const messageWithLinks = str.replace(linkRegex, (_match, text, markdownUrl, url) => {
|
|
5
|
+
if (markdownUrl) {
|
|
6
|
+
return `<zonos-link href="${markdownUrl}" target="_blank" rel="noopener noreferrer">${text}</zonos-link>`;
|
|
7
|
+
}
|
|
8
|
+
else {
|
|
9
|
+
return `<zonos-link href="${url}" target="_blank" rel="noopener noreferrer">${url}</zonos-link>`;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
return messageWithLinks;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export { formatStringWithLinks as f };
|
package/dist/esm/loader.js
CHANGED
|
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await globalScripts();
|
|
8
|
-
return bootstrapLazy([["zonos-checkout",[[2,"zonos-checkout",{"appearanceSettingsOverride":[16],"preview":[4],"mobile":[4],"defaultAddress":[16],"forceDialogOpen":[4,"force-dialog-open"],"open":[32],"stripe":[32],"submitLoading":[32],"paymentError":[32],"collapseReviewMobile":[32],"isAttachError":[32],"isMobile":[32],"zonosReviewRef":[32],"storybookPaymentStatusOverride":[32],"closeDialogHandler":[64],"init":[64],"setToFinishStep":[64]},[[16,"zonos--init-cart-info","initCartInfoHandler"],[9,"resize","handleWindowResize"]],{"appearanceSettingsOverride":["appearanceSettingsOverrideChanged"],"mobile":["handleMobileChange"]}]]],["zonos-hello",[[1,"zonos-hello",{"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettingsOverride":[16],"showPeekMessage":[32],"zonosStoreHelloSettings":[32],"showDialog":[32],"peekMessage":[32],"initialUrl":[32],"allRestrictedItems":[32],"allFoundProducts":[32],"productsOnPage":[32],"displayCurrency":[64],"convertAndFormat":[64],"convert":[64],"format":[64]},[[9,"resize","handleResize"]]]]],["zonos-controller",[[1,"zonos-controller",{"config":[16],"zonosApiKey":[1,"zonos-api-key"],"initCheckoutElement":[64],"setupGoogleFont":[64],"showNotification":[64],"overrideConfig":[64],"overrideCountry":[64],"getAppearanceSetting":[64],"updateOrganizationName":[64]}]]],["zonos-component",[[1,"zonos-component",{"first":[1],"middle":[1],"last":[1]}]]],["zonos-
|
|
8
|
+
return bootstrapLazy([["zonos-checkout",[[2,"zonos-checkout",{"appearanceSettingsOverride":[16],"preview":[4],"mobile":[4],"defaultAddress":[16],"forceDialogOpen":[4,"force-dialog-open"],"open":[32],"stripe":[32],"submitLoading":[32],"paymentError":[32],"collapseReviewMobile":[32],"isAttachError":[32],"isMobile":[32],"zonosReviewRef":[32],"storybookPaymentStatusOverride":[32],"domesticRedirectedBtnSelector":[32],"closeDialogHandler":[64],"init":[64],"setToFinishStep":[64]},[[16,"zonos--init-cart-info","initCartInfoHandler"],[9,"resize","handleWindowResize"]],{"appearanceSettingsOverride":["appearanceSettingsOverrideChanged"],"mobile":["handleMobileChange"]}]]],["zonos-hello",[[1,"zonos-hello",{"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettingsOverride":[16],"showPeekMessage":[32],"zonosStoreHelloSettings":[32],"showDialog":[32],"peekMessage":[32],"initialUrl":[32],"allRestrictedItems":[32],"allFoundProducts":[32],"productsOnPage":[32],"displayCurrency":[64],"convertAndFormat":[64],"convert":[64],"format":[64],"openHelloDialog":[64]},[[9,"resize","handleResize"]]]]],["zonos-controller",[[1,"zonos-controller",{"config":[16],"zonosApiKey":[1,"zonos-api-key"],"initCheckoutElement":[64],"setupGoogleFont":[64],"showNotification":[64],"overrideConfig":[64],"overrideCountry":[64],"getAppearanceSetting":[64],"updateOrganizationName":[64]}]]],["zonos-component",[[1,"zonos-component",{"first":[1],"middle":[1],"last":[1]}]]],["zonos-link",[[1,"zonos-link",{"href":[1],"rel":[1],"target":[1],"linkTitle":[1,"link-title"]}]]],["zonos-logo",[[1,"zonos-logo",{"theme":[1],"width":[1]}]]],["zonos-text",[[1,"zonos-text",{"textColor":[1,"text-color"],"size":[1],"type":[1],"weight":[2],"content":[1],"ready":[32]}]]],["zonos-hello-dialog",[[1,"zonos-hello-dialog",{"isOpen":[4,"is-open"],"setIsOpen":[16],"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettings":[16],"restrictedItems":[16],"welcomeMessage":[32],"showCountrySelect":[32],"showLanguageSelect":[32]},[[4,"click","globalClickHandler"]],{"isOpen":["isOpenHandler"]}]]],["zonos-notification",[[1,"zonos-notification",{"notificationArray":[32],"showNotification":[64]}]]],["zonos-payment",[[2,"zonos-payment",{"titleText":[1,"title-text"],"stripe":[32],"stripeElements":[32]},null,{"stripeElements":["watchInitStripe"],"stripe":["watchInitStripe"]}]]],["zonos-shipping-rich-radio",[[1,"zonos-shipping-rich-radio",{"items":[16],"borderColor":[1,"border-color"],"borderStyle":[1,"border-style"],"theme":[1],"selectedItem":[32]}]]],["zonos-badge_2",[[1,"zonos-badge",{"bold":[4],"badgeColor":[1,"badge-color"],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"rounded":[4]}],[1,"zonos-tooltip",{"label":[1],"subtitle":[1],"showTooltip":[32]}]]],["zonos-country-flag",[[1,"zonos-country-flag",{"countryCode":[1,"country-code"],"size":[2]}]]],["zonos-banner",[[1,"zonos-banner",{"bannerTitle":[1,"banner-title"],"intent":[1],"hasContent":[32]}]]],["zonos-button_3",[[1,"zonos-button",{"buttonColor":[1,"button-color"],"backgroundColor":[1,"background-color"],"borderStyle":[1,"border-style"],"isDisabled":[4,"is-disabled"],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"variant":[1],"noBackground":[4,"no-background"],"noPaddingLeft":[4,"no-padding-left"],"noPaddingRight":[4,"no-padding-right"],"loading":[4],"theme":[1],"hasIcon":[32],"hasContent":[32]},[[2,"click","clickHandler"]],{"icon":["iconChangeHandler"]}],[1,"zonos-icon",{"autoHeight":[4,"auto-height"],"iconColor":[1,"icon-color"],"content":[1],"size":[2]}],[1,"zonos-spinner",{"size":[2],"spinnerColor":[1,"spinner-color"]}]]],["zonos-select-dialog-header_2",[[1,"zonos-select-dialog-header",{"handleOnClose":[16],"label":[1]}],[1,"zonos-v-stack",{"spacing":[2]}]]],["zonos-card_2",[[1,"zonos-language-select",{"handleOnClose":[16]}],[1,"zonos-card",{"actions":[16],"footerActions":[16],"footerContent":[16],"footerHeight":[2,"footer-height"],"label":[16],"spacing":[1]}]]],["zonos-country-select_3",[[1,"zonos-country-select",{"handleOnClose":[16],"inputValue":[32]}],[1,"zonos-hello-dialog-footer",{"appearanceSettings":[16],"setShowCountrySelect":[16],"setShowLanguageSelect":[16]}],[1,"zonos-custom-message",{"icon":[1],"message":[1]}]]],["zonos-address_4",[[2,"zonos-address",{"type":[1],"titleText":[1,"title-text"],"defaultAddress":[16],"stripe":[32],"isDirtyAddress":[32]},null,{"stripe":["watchInitStripe"]}],[1,"zonos-checkbox",{"backgroundColor":[1,"background-color"],"label":[1],"isChecked":[4,"is-checked"],"isDisabled":[4,"is-disabled"],"size":[2],"fontSize":[1,"font-size"],"borderStyle":[1,"border-style"]}],[2,"zonos-link-authentication",{"titleText":[1,"title-text"],"stripe":[32]},null,{"stripe":["watchInitStripe"]}],[1,"zonos-collapse",{"collapsed":[4],"collapseSize":[2,"collapse-size"],"height":[32],"iframe":[32]}]]],["zonos-cart-items_9",[[1,"zonos-checkout-footer",{"showDialog":[32]},[[4,"click","handleGlobalClick"]]],[2,"zonos-customer-info",{"continueLoading":[4,"continue-loading"],"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"defaultAddress":[16],"disabled":[32]},null,{"disabled":["watchFormComplete"]}],[2,"zonos-checkout-payment",{"paymentError":[4,"payment-error"],"submitBtnType":[1,"submit-btn-type"],"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"disabled":[32]},null,{"disabled":["watchFormComplete"]}],[2,"zonos-shipping",{"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"submitBtnType":[1,"submit-btn-type"],"selectedShippingMethod":[32],"disabled":[32]},null,{"disabled":["watchFormComplete"]}],[1,"zonos-cart-subtotal"],[1,"zonos-checkout-finish",{"borderRadius":[1,"border-radius"],"storybookForceStatus":[1,"storybook-force-status"],"overrideNotification":[16],"isLoading":[32],"notificationType":[32],"notificationTitle":[32],"notificationMessages":[32],"order":[32]}],[1,"zonos-dialog",{"open":[4],"headerText":[1,"header-text"],"width":[1],"height":[1],"noHeader":[4,"no-header"],"noBodyPadding":[4,"no-body-padding"],"noBorder":[4,"no-border"],"footerRightAction":[16],"borderStyle":[1,"border-style"],"noCloseButton":[4,"no-close-button"],"noClickOutside":[4,"no-click-outside"],"mobile":[4],"isLoading":[4,"is-loading"],"isMobile":[32]},[[9,"resize","handleWindowResize"]]],[1,"zonos-review",{"mobile":[4],"collapsed":[4],"isMobile":[32]},[[9,"resize","handleWindowResize"]]],[1,"zonos-cart-items",{"errorImages":[32]}]]]], options);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export { defineCustomElements };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { u as handleFetch, l as localizationStore, a as log } from './cart-1bbb7662.js';
|
|
2
|
+
import { z as zonosStore } from './zonosStore-00bce01b.js';
|
|
3
|
+
|
|
4
|
+
const trackConversionEvent = async (eventName, metadata) => {
|
|
5
|
+
// If a Zonos domain, we don't want analytics to be tracked
|
|
6
|
+
if (window.location.href.includes('zonos.com')) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
const url = `${"https://v1.route.js.zonos.com"}/api/zonos-elements/track-conversion-event`;
|
|
10
|
+
const countryCode = localizationStore.selectedCountryCode;
|
|
11
|
+
const organizationId = zonosStore.organizationId;
|
|
12
|
+
const body = {
|
|
13
|
+
countryCode,
|
|
14
|
+
eventName,
|
|
15
|
+
metadata,
|
|
16
|
+
organizationId,
|
|
17
|
+
};
|
|
18
|
+
await handleFetch(url, {
|
|
19
|
+
body,
|
|
20
|
+
method: 'POST',
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const sendErrorLog = async ({ endpoint, errors, metadata }) => {
|
|
25
|
+
const errorObject = {
|
|
26
|
+
endpoint,
|
|
27
|
+
errors,
|
|
28
|
+
metadata,
|
|
29
|
+
};
|
|
30
|
+
void handleFetch(`${"https://v1.route.js.zonos.com"}/api/zonos-elements/log-error`, {
|
|
31
|
+
body: errorObject,
|
|
32
|
+
method: 'POST',
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Submit a gtag event if the gtag function is available.
|
|
38
|
+
*/
|
|
39
|
+
const submitGtag = (event) => {
|
|
40
|
+
const googleAnalyticSetting = zonosStore.checkoutSettings.analyticsProviders.find(item => item.type === 'GOOGLE_ANALYTICS');
|
|
41
|
+
// only submit if googleAnalytic in checkout setting is on.
|
|
42
|
+
if (!googleAnalyticSetting || (googleAnalyticSetting === null || googleAnalyticSetting === void 0 ? void 0 : googleAnalyticSetting.status) === 'DISABLED') {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (typeof window.gtag === 'function') {
|
|
46
|
+
log('Zonos submits gtag event', 'log', event);
|
|
47
|
+
window.gtag('event', event, {});
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export { submitGtag as a, sendErrorLog as s, trackConversionEvent as t };
|