@zonos/elements 1.3.288 → 1.3.289
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-CV4buPlT.js → cart-WLQb2hbe.js} +1 -1
- package/dist/cjs/{collect-jzWKzrV7.js → collect-B92uIdsY.js} +2 -2
- package/dist/cjs/{getMissingRequiredShippingFields-r5vYIqoX.js → getMissingRequiredShippingFields-5w62gTIB.js} +1 -1
- package/dist/cjs/{hasInclusivePrice-BZMQohG9.js → hasInclusivePrice-hmV0Inld.js} +1 -1
- package/dist/cjs/index.cjs.js +8 -9
- package/dist/cjs/{invoice-CHw-mJdS.js → invoice-Bal1mqYR.js} +2 -2
- package/dist/cjs/{localization-CxXsmxs5.js → localization-C5HPlCNK.js} +191 -68
- package/dist/cjs/{paypal-BLuHeOJH.js → paypal-o164C26_.js} +2 -2
- package/dist/cjs/{placeTestOrder-VK_CMeq0.js → placeTestOrder-C7tAipav.js} +2 -2
- package/dist/cjs/{renderCheckoutCurrency-CC4CAy-a.js → renderCheckoutCurrency-Bpx-vrTQ.js} +2 -2
- package/dist/cjs/{shouldShowLanguageSelect-Bj_jKWPK.js → shouldShowLanguageSelect-CtwkMt8b.js} +1 -1
- package/dist/cjs/zonos-address-completion-dialog_7.cjs.entry.js +7 -7
- package/dist/cjs/zonos-address-display_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-address_4.cjs.entry.js +4 -4
- package/dist/cjs/zonos-airwallex-payment.cjs.entry.js +3 -3
- package/dist/cjs/zonos-card_5.cjs.entry.js +4 -4
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +9 -9
- package/dist/cjs/zonos-checkout.cjs.entry.js +6 -6
- package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +2 -2
- package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +8 -8
- package/dist/cjs/zonos-collect.cjs.entry.js +4 -4
- package/dist/cjs/zonos-controller.cjs.entry.js +4 -4
- package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +2 -2
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -2
- package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
- package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +4 -4
- package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +8 -8
- package/dist/cjs/zonos-invoice.cjs.entry.js +4 -4
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-policy-consent_2.cjs.entry.js +3 -3
- package/dist/cjs/zonos-stripe-input.cjs.entry.js +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +1 -1
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-payment/zonos-collect-payment.js +1 -1
- package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-payment/zonos-invoice-payment.js +1 -1
- package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.js +1 -1
- package/dist/collection/components/main/zonos-controller.js +2 -2
- package/dist/collection/components/paypal/zonos-paypal-payment.js +1 -2
- package/dist/collection/components/store/hello/localization.js +69 -34
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +2 -2
- package/dist/collection/components/stripe/zonos-custom-address/zonos-address-suggestions/zonos-address-suggestions.js +2 -3
- package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.js +2 -2
- package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +0 -1
- package/dist/collection/components/utils/api/getLocalization.js +2 -2
- package/dist/collection/components/utils/checkout/isShippableCountry.js +2 -4
- package/dist/collection/components/utils/checkout/watchBigcommerceDomesticCheckout.js +1 -0
- package/dist/collection/components/utils/checkout/watchImmediateBigcommerceDomesticCheckoutRedirect.js +2 -0
- package/dist/collection/components/utils/formatDate.js +1 -3
- package/dist/collection/components/utils/getOverridenZCountry.js +3 -5
- package/dist/collection/components/utils/hello/countryOverrideStorage.js +49 -0
- package/dist/collection/components/utils/hello/getZCountryUrlParam.js +5 -9
- package/dist/collection/components/utils/hello/isCountryCode.js +1 -0
- package/dist/collection/components/utils/hello/isCountryInShippingZone.js +8 -0
- package/dist/collection/components/utils/hello/reconcileRememberedCountryOverride.js +37 -0
- package/dist/collection/components/utils/hello/shouldShowHelloWidget.js +27 -20
- package/dist/collection/environment.js +0 -1
- package/dist/collection/scripts/_stripe.js +0 -2
- package/dist/collection/scripts/_zonosBase.js +1 -1
- package/dist/collection/types/generated/graphql.frontend.types.js +218 -63
- package/dist/collection/types/generated/graphql.internal.types.js +643 -147
- package/dist/collection/utils/formattedCloudflareApiUrl.js +1 -0
- package/dist/collection/utils/generateCloudflareDeployUrl.js +5 -2
- package/dist/esm/{cart-ekBk_gxV.js → cart-BDc4RTBJ.js} +1 -1
- package/dist/esm/{collect-33rMINDo.js → collect-NRCK3t-M.js} +2 -2
- package/dist/esm/{getMissingRequiredShippingFields-u1nhQzJ1.js → getMissingRequiredShippingFields-D-B-N1NH.js} +1 -1
- package/dist/esm/{hasInclusivePrice-CAVXi310.js → hasInclusivePrice-Bti4iudO.js} +1 -1
- package/dist/esm/index.js +8 -9
- package/dist/esm/{invoice-BNDWuVsD.js → invoice-DsvQvu4a.js} +2 -2
- package/dist/esm/{localization-AOqYXGdP.js → localization-Bs6hVcKV.js} +191 -69
- package/dist/esm/{paypal-CW1D2XqZ.js → paypal-BqyEZS_u.js} +2 -2
- package/dist/esm/{placeTestOrder-nhmsLLOA.js → placeTestOrder-x3xwMAnW.js} +2 -2
- package/dist/esm/{renderCheckoutCurrency-BQANmZyM.js → renderCheckoutCurrency-DIBdWKN1.js} +2 -2
- package/dist/esm/{shouldShowLanguageSelect-BQFCXouB.js → shouldShowLanguageSelect-Bb9sbQ41.js} +1 -1
- package/dist/esm/zonos-address-completion-dialog_7.entry.js +7 -7
- package/dist/esm/zonos-address-display_2.entry.js +1 -1
- package/dist/esm/zonos-address_4.entry.js +4 -4
- package/dist/esm/zonos-airwallex-payment.entry.js +3 -3
- package/dist/esm/zonos-card_5.entry.js +4 -4
- package/dist/esm/zonos-cart-items_12.entry.js +9 -9
- package/dist/esm/zonos-checkout.entry.js +6 -6
- package/dist/esm/zonos-collect-cart-items_3.entry.js +2 -2
- package/dist/esm/zonos-collect-finish_6.entry.js +8 -8
- package/dist/esm/zonos-collect.entry.js +4 -4
- package/dist/esm/zonos-controller.entry.js +4 -4
- package/dist/esm/zonos-country-flag.entry.js +1 -1
- package/dist/esm/zonos-country-select_4.entry.js +2 -2
- package/dist/esm/zonos-hello-dialog.entry.js +2 -2
- package/dist/esm/zonos-hello.entry.js +1 -1
- package/dist/esm/zonos-invoice-cart-items_2.entry.js +4 -4
- package/dist/esm/zonos-invoice-finish_5.entry.js +8 -8
- package/dist/esm/zonos-invoice.entry.js +4 -4
- package/dist/esm/zonos-language-select_2.entry.js +1 -1
- package/dist/esm/zonos-policy-consent_2.entry.js +3 -3
- package/dist/esm/zonos-stripe-input.entry.js +1 -1
- package/dist/esm-es5/{cart-ekBk_gxV.js → cart-BDc4RTBJ.js} +1 -1
- package/dist/esm-es5/{collect-33rMINDo.js → collect-NRCK3t-M.js} +1 -1
- package/dist/esm-es5/{getMissingRequiredShippingFields-u1nhQzJ1.js → getMissingRequiredShippingFields-D-B-N1NH.js} +1 -1
- package/dist/esm-es5/{hasInclusivePrice-CAVXi310.js → hasInclusivePrice-Bti4iudO.js} +1 -1
- package/dist/esm-es5/index.js +6 -8
- package/dist/esm-es5/{invoice-BNDWuVsD.js → invoice-DsvQvu4a.js} +1 -1
- package/dist/esm-es5/{localization-AOqYXGdP.js → localization-Bs6hVcKV.js} +74 -68
- package/dist/esm-es5/{paypal-CW1D2XqZ.js → paypal-BqyEZS_u.js} +1 -1
- package/dist/esm-es5/{placeTestOrder-nhmsLLOA.js → placeTestOrder-x3xwMAnW.js} +1 -1
- package/dist/esm-es5/{renderCheckoutCurrency-BQANmZyM.js → renderCheckoutCurrency-DIBdWKN1.js} +1 -1
- package/dist/esm-es5/{shouldShowLanguageSelect-BQFCXouB.js → shouldShowLanguageSelect-Bb9sbQ41.js} +1 -1
- package/dist/esm-es5/zonos-address-completion-dialog_7.entry.js +3 -3
- package/dist/esm-es5/zonos-address-display_2.entry.js +1 -1
- package/dist/esm-es5/zonos-address_4.entry.js +2 -2
- package/dist/esm-es5/zonos-airwallex-payment.entry.js +1 -1
- package/dist/esm-es5/zonos-card_5.entry.js +2 -2
- package/dist/esm-es5/zonos-cart-items_12.entry.js +2 -2
- package/dist/esm-es5/zonos-checkout.entry.js +4 -4
- package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-finish_6.entry.js +2 -2
- package/dist/esm-es5/zonos-collect.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +3 -3
- 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-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice-finish_5.entry.js +2 -2
- package/dist/esm-es5/zonos-invoice.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-policy-consent_2.entry.js +1 -1
- package/dist/esm-es5/zonos-stripe-input.entry.js +1 -1
- 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/store/hello/localization.d.ts +2 -1
- package/dist/types/components/utils/api/getLocalization.d.ts +3 -1
- package/dist/types/components/utils/getOverridenZCountry.d.ts +2 -3
- package/dist/types/components/utils/hello/countryOverrideStorage.d.ts +5 -0
- package/dist/types/components/utils/hello/isCountryCode.d.ts +2 -0
- package/dist/types/components/utils/hello/isCountryInShippingZone.d.ts +2 -0
- package/dist/types/components/utils/hello/reconcileRememberedCountryOverride.d.ts +18 -0
- package/dist/types/components/utils/hello/shouldShowHelloWidget.d.ts +8 -4
- package/dist/types/types/generated/graphql.frontend.types.d.ts +41 -52
- package/dist/types/types/generated/graphql.frontend.types.ts +226 -114
- package/dist/types/types/generated/graphql.internal.types.d.ts +231 -94
- package/dist/types/types/generated/graphql.internal.types.ts +712 -245
- package/dist/types/utils/formattedCloudflareApiUrl.d.ts +1 -0
- package/dist/types/utils/generateCloudflareDeployUrl.d.ts +5 -2
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/p-02628b9f.entry.js +1 -0
- package/dist/zonos-elements/{p-04cc0dac.system.entry.js → p-02ff6f8b.system.entry.js} +38 -38
- package/dist/zonos-elements/p-037d3688.entry.js +1 -0
- package/dist/zonos-elements/{p-02ef0f99.system.entry.js → p-03fbe813.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-5a631080.system.entry.js → p-0ff26236.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f2cedbcd.system.entry.js → p-163b81c0.system.entry.js} +6 -6
- package/dist/zonos-elements/{p-e9320825.entry.js → p-18021e6b.entry.js} +1 -1
- package/dist/zonos-elements/{p-dcdbc610.system.entry.js → p-22fab1ba.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-b14819ab.system.entry.js → p-2466b5f0.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-daf9fa07.system.entry.js → p-317d4665.system.entry.js} +19 -19
- package/dist/zonos-elements/{p-d55b9664.system.entry.js → p-36559431.system.entry.js} +17 -17
- package/dist/zonos-elements/{p-f27317d3.system.entry.js → p-3cc27e0e.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-891b47d7.entry.js → p-3d536086.entry.js} +1 -1
- package/dist/zonos-elements/{p-a38e62cc.entry.js → p-3e59d41c.entry.js} +1 -1
- package/dist/zonos-elements/{p-64e7bc5b.entry.js → p-4625058a.entry.js} +1 -1
- package/dist/zonos-elements/{p-5024df2d.system.entry.js → p-56159b7c.system.entry.js} +60 -60
- package/dist/zonos-elements/p-5e074243.entry.js +1 -0
- package/dist/zonos-elements/{p-9818f823.entry.js → p-5eb82be3.entry.js} +1 -1
- package/dist/zonos-elements/{p-cf5688f7.entry.js → p-628a0f7f.entry.js} +1 -1
- package/dist/zonos-elements/{p-5d3079e8.entry.js → p-635341d6.entry.js} +1 -1
- package/dist/zonos-elements/{p-d4c4a00e.entry.js → p-68e0180a.entry.js} +1 -1
- package/dist/zonos-elements/{p-6b0afaa7.entry.js → p-6c6c65f0.entry.js} +1 -1
- package/dist/zonos-elements/{p-04bfcd72.system.entry.js → p-72b6a006.system.entry.js} +18 -18
- package/dist/zonos-elements/{p-4973f8d8.system.entry.js → p-8cac7911.system.entry.js} +8 -8
- package/dist/zonos-elements/p-97f848f6.entry.js +1 -0
- package/dist/zonos-elements/p-9H2p9XKE.js +1 -0
- package/dist/zonos-elements/{p-CJCoACvU.js → p-B6X55m0b.js} +2 -2
- package/dist/zonos-elements/p-Bu9WCfUC.system.js +1 -1
- package/dist/zonos-elements/{p-D31lQiWo.system.js → p-BybDGrH4.system.js} +4 -4
- package/dist/zonos-elements/{p-DTgv0QpG.js → p-CGkdA4pY.js} +1 -1
- package/dist/zonos-elements/{p-D5AtAlJx.system.js → p-CH6tsv9B.system.js} +1 -1
- package/dist/zonos-elements/{p-CYdt69j5.system.js → p-CQyFoOXW.system.js} +23 -23
- package/dist/zonos-elements/{p-B2EZRfoq.system.js → p-CVQ7-7E2.system.js} +18 -18
- package/dist/zonos-elements/{p-DIJaXkiE.system.js → p-Cd9xIgx7.system.js} +111 -105
- package/dist/zonos-elements/{p-CQqNJo0D.system.js → p-ClUEwqZW.system.js} +4 -4
- package/dist/zonos-elements/{p-DkpYo2Fs.js → p-CpvnCfKt.js} +1 -1
- package/dist/zonos-elements/p-CtKp6AQ4.js +1 -0
- package/dist/zonos-elements/{p-DGsEWFDU.system.js → p-CuhGrJBA.system.js} +1 -1
- package/dist/zonos-elements/{p-D-DawUYF.system.js → p-D2fOB4Wn.system.js} +1 -1
- package/dist/zonos-elements/{p-BtMauqj_.system.js → p-D4WI0B6-.system.js} +6 -8
- package/dist/zonos-elements/{p-CKTIJ2Gr.js → p-DdpeA8cH.js} +1 -1
- package/dist/zonos-elements/p-DkirvyAh.js +1 -0
- package/dist/zonos-elements/{p-DHwpNxG9.js → p-DqEtY53c.js} +1 -1
- package/dist/zonos-elements/{p-DjuFsKLG.js → p-MHVIIOVE.js} +1 -1
- package/dist/zonos-elements/{p-DPW1yXt9.system.js → p-NL_Eiq6m.system.js} +65 -65
- package/dist/zonos-elements/{p-Dj-O6VfM.system.js → p-UM1aYZBV.system.js} +2 -2
- package/dist/zonos-elements/p-a6354d15.entry.js +1 -0
- package/dist/zonos-elements/{p-8cd3f1e2.entry.js → p-b78bab27.entry.js} +1 -1
- package/dist/zonos-elements/{p-f6ba59f6.system.entry.js → p-b88e521e.system.entry.js} +14 -14
- package/dist/zonos-elements/{p-450ed170.system.entry.js → p-b96666ca.system.entry.js} +3 -3
- package/dist/zonos-elements/{p-39c8a898.entry.js → p-c090cc60.entry.js} +1 -1
- package/dist/zonos-elements/{p-cadf6b63.system.entry.js → p-c4713ff1.system.entry.js} +10 -10
- package/dist/zonos-elements/{p-ea8790aa.entry.js → p-c5f17bad.entry.js} +1 -1
- package/dist/zonos-elements/{p-f57495dc.entry.js → p-cc17a230.entry.js} +1 -1
- package/dist/zonos-elements/{p-7ae48e31.entry.js → p-cf53f67a.entry.js} +1 -1
- package/dist/zonos-elements/{p-7a5d2211.system.entry.js → p-d261f27c.system.entry.js} +15 -15
- package/dist/zonos-elements/{p-e101d722.system.entry.js → p-d451d5bc.system.entry.js} +4 -4
- package/dist/zonos-elements/{p-d33dfc78.system.entry.js → p-d9527bd7.system.entry.js} +35 -35
- package/dist/zonos-elements/{p-f6e0aeba.system.entry.js → p-e126e9bd.system.entry.js} +176 -176
- package/dist/zonos-elements/{p-e284d329.entry.js → p-e582ae2a.entry.js} +1 -1
- package/dist/zonos-elements/{p-5562a955.system.entry.js → p-e9a3bc27.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-844a743a.entry.js → p-f44631d5.entry.js} +1 -1
- package/dist/zonos-elements/{p-5836d426.system.entry.js → p-fcfac62f.system.entry.js} +1 -1
- package/dist/zonos-elements/p-opB7B9YB.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +12 -11
- package/dist/zonos-elements/p-2ba738ec.entry.js +0 -1
- package/dist/zonos-elements/p-4a54f664.entry.js +0 -1
- package/dist/zonos-elements/p-6f742021.entry.js +0 -1
- package/dist/zonos-elements/p-89ddab88.entry.js +0 -1
- package/dist/zonos-elements/p-C19J2XSh.js +0 -1
- package/dist/zonos-elements/p-LypTHRUC.js +0 -1
- package/dist/zonos-elements/p-adfee3a3.entry.js +0 -1
- package/dist/zonos-elements/p-lGLcGvEA.js +0 -1
- package/dist/zonos-elements/p-pfIceXbY.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var zonosStore = require('./zonosStore-BCNYr6Tk.js');
|
|
4
|
-
var localization = require('./localization-
|
|
4
|
+
var localization = require('./localization-C5HPlCNK.js');
|
|
5
5
|
var VarianceTest = require('./VarianceTest-C98whVgO.js');
|
|
6
6
|
var handleFetch = require('./handleFetch-DQLhurnE.js');
|
|
7
7
|
var isDarkColor = require('./isDarkColor-f-fD9c2l.js');
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var zonosStore = require('./zonosStore-BCNYr6Tk.js');
|
|
4
|
-
var localization = require('./localization-
|
|
4
|
+
var localization = require('./localization-C5HPlCNK.js');
|
|
5
5
|
var handleFetch = require('./handleFetch-DQLhurnE.js');
|
|
6
6
|
var VarianceTest = require('./VarianceTest-C98whVgO.js');
|
|
7
|
-
var cart = require('./cart-
|
|
7
|
+
var cart = require('./cart-WLQb2hbe.js');
|
|
8
8
|
|
|
9
9
|
// src/constant/common.ts
|
|
10
10
|
function _array_like_to_array(arr, len) {
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -131,7 +131,7 @@ const getZonosQaUrl = () => {
|
|
|
131
131
|
return null;
|
|
132
132
|
}
|
|
133
133
|
const qaUrl = extractZonosQaUrl(window.location.href);
|
|
134
|
-
const cdnUrl = "https://v1.3.
|
|
134
|
+
const cdnUrl = "https://v1.3.289.js.zonos.com";
|
|
135
135
|
// when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
|
|
136
136
|
if (!qaUrl &&
|
|
137
137
|
(cdnUrl.includes('test.') ||
|
|
@@ -258,7 +258,6 @@ const zonosStripeLoadScript = (params) => {
|
|
|
258
258
|
});
|
|
259
259
|
return stripePromise$1;
|
|
260
260
|
};
|
|
261
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
262
261
|
const registerWrapper = (stripe, startTime) => {
|
|
263
262
|
if (!stripe || !stripe._registerWrapper) {
|
|
264
263
|
return;
|
|
@@ -395,10 +394,10 @@ const zonosLoadUrl = (() => {
|
|
|
395
394
|
return null;
|
|
396
395
|
})();
|
|
397
396
|
const startLoadTime = Date.now();
|
|
398
|
-
const ZONOS_URL = "https://v1.3.
|
|
399
|
-
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.
|
|
400
|
-
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.
|
|
401
|
-
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.
|
|
397
|
+
const ZONOS_URL = "https://v1.3.289.js.zonos.com";
|
|
398
|
+
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.289";
|
|
399
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.289";
|
|
400
|
+
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.289";
|
|
402
401
|
const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
|
|
403
402
|
const GOOGLE_FONT_REGEX = /^https:\/\/fonts\.googleapis\.com/;
|
|
404
403
|
class Zonos {
|
|
@@ -416,7 +415,7 @@ Zonos.iframeLogType = typeof window !== 'undefined'
|
|
|
416
415
|
? new URLSearchParams(window.location.search).get('iframeLogType')
|
|
417
416
|
: null;
|
|
418
417
|
Zonos.isBigCommerce = false;
|
|
419
|
-
Zonos.releaseDate = "
|
|
418
|
+
Zonos.releaseDate = "1790008861725";
|
|
420
419
|
Zonos.isLegacyCheckout = false;
|
|
421
420
|
Zonos.googleAnalyticId = null;
|
|
422
421
|
Zonos.googleAnalyticReady = false;
|
|
@@ -441,7 +440,7 @@ Zonos.isNpm = true;
|
|
|
441
440
|
Zonos.zonosQaUrl = null;
|
|
442
441
|
Zonos.zonosQaUrlApi = null;
|
|
443
442
|
Zonos.trackEventLogs = [];
|
|
444
|
-
Zonos.version = `v${"1.3.
|
|
443
|
+
Zonos.version = `v${"1.3.289"}`;
|
|
445
444
|
Zonos.modeAlerted = false;
|
|
446
445
|
Zonos.cartData = null;
|
|
447
446
|
Zonos.paypal = null;
|
|
@@ -457,7 +456,7 @@ Zonos.init = async (params) => {
|
|
|
457
456
|
// Expose the checkout cart callbacks on the global so Stripe loading can be
|
|
458
457
|
// gated on whether at least one of them is configured.
|
|
459
458
|
_a.createCartId = checkoutSettings === null || checkoutSettings === void 0 ? void 0 : checkoutSettings.createCartId;
|
|
460
|
-
// eslint-disable-next-line
|
|
459
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated -- intentionally mirror the (deprecated) callback so Stripe loading can be gated on it
|
|
461
460
|
_a.buildCartDetail = checkoutSettings === null || checkoutSettings === void 0 ? void 0 : checkoutSettings.buildCartDetail;
|
|
462
461
|
if (_a.doneInit) {
|
|
463
462
|
// do nothing if zonos is already initialized
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var zonosStore = require('./zonosStore-BCNYr6Tk.js');
|
|
4
|
-
var cart = require('./cart-
|
|
5
|
-
var localization = require('./localization-
|
|
4
|
+
var cart = require('./cart-WLQb2hbe.js');
|
|
5
|
+
var localization = require('./localization-C5HPlCNK.js');
|
|
6
6
|
var handleFetch = require('./handleFetch-DQLhurnE.js');
|
|
7
7
|
var VarianceTest = require('./VarianceTest-C98whVgO.js');
|
|
8
8
|
|
|
@@ -17654,19 +17654,65 @@ const getLocaleMessages = async ({ countryCode, localeTo, storeId, }) => {
|
|
|
17654
17654
|
return json.locale_countryCodesPage;
|
|
17655
17655
|
};
|
|
17656
17656
|
|
|
17657
|
-
const
|
|
17658
|
-
|
|
17659
|
-
|
|
17660
|
-
|
|
17657
|
+
const isCountryCode = (value) => /^[A-Z]{2}$/.test(value);
|
|
17658
|
+
|
|
17659
|
+
const COUNTRY_OVERRIDE_KEY = 'zonos--country';
|
|
17660
|
+
const withBlockedStorage = (run) => {
|
|
17661
|
+
try {
|
|
17662
|
+
run();
|
|
17661
17663
|
}
|
|
17662
|
-
|
|
17664
|
+
catch (_a) {
|
|
17665
|
+
// localStorage/sessionStorage can throw in blocked-storage contexts
|
|
17666
|
+
// (Safari private mode, cross-origin iframes).
|
|
17667
|
+
}
|
|
17668
|
+
};
|
|
17669
|
+
const clearSessionOverride = () => {
|
|
17670
|
+
window.sessionStorage.removeItem(COUNTRY_OVERRIDE_KEY);
|
|
17663
17671
|
};
|
|
17672
|
+
const readStoredCountry = (storage) => {
|
|
17673
|
+
try {
|
|
17674
|
+
const value = storage.getItem(COUNTRY_OVERRIDE_KEY);
|
|
17675
|
+
if (!value || !isCountryCode(value)) {
|
|
17676
|
+
return null;
|
|
17677
|
+
}
|
|
17678
|
+
return value;
|
|
17679
|
+
}
|
|
17680
|
+
catch (_a) {
|
|
17681
|
+
return null;
|
|
17682
|
+
}
|
|
17683
|
+
};
|
|
17684
|
+
const getCountryOverrideStorage = () => {
|
|
17685
|
+
var _a;
|
|
17686
|
+
return (_a = readStoredCountry(window.localStorage)) !== null && _a !== void 0 ? _a : readStoredCountry(window.sessionStorage);
|
|
17687
|
+
};
|
|
17688
|
+
const migrateCountryOverrideStorage = () => {
|
|
17689
|
+
withBlockedStorage(() => {
|
|
17690
|
+
if (readStoredCountry(window.localStorage)) {
|
|
17691
|
+
clearSessionOverride();
|
|
17692
|
+
}
|
|
17693
|
+
});
|
|
17694
|
+
};
|
|
17695
|
+
const setCountryOverrideStorage = (countryCode) => {
|
|
17696
|
+
withBlockedStorage(() => {
|
|
17697
|
+
window.localStorage.setItem(COUNTRY_OVERRIDE_KEY, countryCode);
|
|
17698
|
+
clearSessionOverride();
|
|
17699
|
+
});
|
|
17700
|
+
};
|
|
17701
|
+
const clearCountryOverrideStorage = () => {
|
|
17702
|
+
withBlockedStorage(() => {
|
|
17703
|
+
window.localStorage.removeItem(COUNTRY_OVERRIDE_KEY);
|
|
17704
|
+
clearSessionOverride();
|
|
17705
|
+
});
|
|
17706
|
+
};
|
|
17707
|
+
|
|
17664
17708
|
const getZCountryUrlParam = (urlParams) => {
|
|
17665
17709
|
const urlSearchParams = new URLSearchParams(urlParams || window.location.search);
|
|
17666
17710
|
const getCountryParam = (param) => {
|
|
17667
17711
|
const country = urlSearchParams.get(param);
|
|
17668
|
-
|
|
17669
|
-
|
|
17712
|
+
if (country && isCountryCode(country)) {
|
|
17713
|
+
return country;
|
|
17714
|
+
}
|
|
17715
|
+
return null;
|
|
17670
17716
|
};
|
|
17671
17717
|
const zCountry = getCountryParam('zCountry');
|
|
17672
17718
|
// Fallback to legacy 'country'
|
|
@@ -17677,19 +17723,16 @@ const getZCountryUrlParam = (urlParams) => {
|
|
|
17677
17723
|
};
|
|
17678
17724
|
|
|
17679
17725
|
/**
|
|
17680
|
-
* Retrieve the
|
|
17726
|
+
* Retrieve the shopper country override from the URL or remembered storage.
|
|
17681
17727
|
*/
|
|
17682
17728
|
const getOverridenZCountry = () => {
|
|
17683
17729
|
const currentUrl = new URL(window.location.href);
|
|
17684
|
-
|
|
17685
|
-
const countryLoadedSession = window.sessionStorage.getItem('zonos--country');
|
|
17686
|
-
const zCountry = getZCountryUrlParam(currentUrl.searchParams) || countryLoadedSession;
|
|
17687
|
-
return zCountry;
|
|
17730
|
+
return (getZCountryUrlParam(currentUrl.searchParams) || getCountryOverrideStorage());
|
|
17688
17731
|
};
|
|
17689
17732
|
|
|
17690
|
-
const getLocalization = async () => {
|
|
17733
|
+
const getLocalization = async ({ ignoreCountryOverride = false, } = {}) => {
|
|
17691
17734
|
try {
|
|
17692
|
-
const zCountry = getOverridenZCountry();
|
|
17735
|
+
const zCountry = ignoreCountryOverride ? null : getOverridenZCountry();
|
|
17693
17736
|
const searchParams = new URLSearchParams();
|
|
17694
17737
|
if (zCountry) {
|
|
17695
17738
|
searchParams.set('zCountry', zCountry);
|
|
@@ -17809,35 +17852,31 @@ const deleteBigCommerceConsignment = async (checkoutId, consignmentId) => {
|
|
|
17809
17852
|
*/
|
|
17810
17853
|
const isBigCommerceCustomerLoggedIn = (checkout) => { var _a; return !!((_a = checkout === null || checkout === void 0 ? void 0 : checkout.customer) === null || _a === void 0 ? void 0 : _a.id); };
|
|
17811
17854
|
|
|
17855
|
+
const isCountryInShippingZone = (countryCode) => {
|
|
17856
|
+
var _a;
|
|
17857
|
+
return !!countryCode &&
|
|
17858
|
+
!!((_a = localizationStore.shippingZoneCountries) === null || _a === void 0 ? void 0 : _a[countryCode]) &&
|
|
17859
|
+
!zonosStore.zonosStore.disabledCountries.includes(countryCode);
|
|
17860
|
+
};
|
|
17861
|
+
|
|
17812
17862
|
/**
|
|
17813
|
-
*
|
|
17814
|
-
*
|
|
17815
|
-
*
|
|
17816
|
-
*
|
|
17817
|
-
* actually sees.
|
|
17818
|
-
*
|
|
17819
|
-
* Resolves the configured `widgetVisibility` behavior (with the deprecated
|
|
17820
|
-
* `showForCountries` override) against the selected country and shipping-zone
|
|
17821
|
-
* state, then applies the include/exclude country overrides.
|
|
17822
|
-
*
|
|
17823
|
-
* @param showLog - emit a debug log when the shopper is not in a shipping zone.
|
|
17824
|
-
* Defaults to `true`; pass `false` from non-rendering callers to avoid log
|
|
17825
|
-
* noise.
|
|
17863
|
+
* Visibility rules for Hello, ignoring whether localization has finished
|
|
17864
|
+
* loading. Used during init reconcile before `localizationLoaded` is set.
|
|
17865
|
+
* Pass `countryCode` to evaluate a remembered country instead of the
|
|
17866
|
+
* currently selected one.
|
|
17826
17867
|
*/
|
|
17827
|
-
const
|
|
17868
|
+
const getHelloWidgetVisibility = (showLog = true, countryCode = localizationStore.selectedCountryCode) => {
|
|
17828
17869
|
var _a, _b;
|
|
17829
|
-
if (!localizationStore.localizationLoaded) {
|
|
17830
|
-
return false;
|
|
17831
|
-
}
|
|
17832
17870
|
const { countryDisplayRules, showForCountries } = zonosStore.zonosStore.helloSettings;
|
|
17833
17871
|
const visibilityRules = countryDisplayRules === null || countryDisplayRules === void 0 ? void 0 : countryDisplayRules.widgetVisibility;
|
|
17834
|
-
const selectedCountry =
|
|
17872
|
+
const selectedCountry = countryCode;
|
|
17873
|
+
const isShippableCountry = isCountryInShippingZone(countryCode);
|
|
17835
17874
|
// Resolve behavior: deprecated showForCountries overrides widgetVisibility.behavior
|
|
17836
17875
|
// If showForCountries is an array of country codes, treat as legacy explicit list
|
|
17837
17876
|
const behavior = Array.isArray(showForCountries)
|
|
17838
17877
|
? showForCountries
|
|
17839
17878
|
: (showForCountries !== null && showForCountries !== void 0 ? showForCountries : visibilityRules === null || visibilityRules === void 0 ? void 0 : visibilityRules.behavior);
|
|
17840
|
-
if (showLog && !
|
|
17879
|
+
if (showLog && !isShippableCountry) {
|
|
17841
17880
|
VarianceTest.log(`Hello: not shippable country - Show for countries: ${behavior}`);
|
|
17842
17881
|
}
|
|
17843
17882
|
// Legacy: explicit list of country codes from deprecated showForCountries
|
|
@@ -17851,7 +17890,7 @@ const shouldShowHelloWidget = (showLog = true) => {
|
|
|
17851
17890
|
}
|
|
17852
17891
|
else {
|
|
17853
17892
|
// Default: ONLY_SHIPPABLE
|
|
17854
|
-
isVisible =
|
|
17893
|
+
isVisible = isShippableCountry;
|
|
17855
17894
|
}
|
|
17856
17895
|
// Apply includedCountries — force show the widget for these countries
|
|
17857
17896
|
if (!isVisible &&
|
|
@@ -17867,6 +17906,23 @@ const shouldShowHelloWidget = (showLog = true) => {
|
|
|
17867
17906
|
}
|
|
17868
17907
|
return isVisible;
|
|
17869
17908
|
};
|
|
17909
|
+
/**
|
|
17910
|
+
* Whether the Hello widget should be shown for the current shopper. This is the
|
|
17911
|
+
* single source of truth for Hello's visibility decision — the `zonos-hello`
|
|
17912
|
+
* component renders by it, and other features (e.g. BigCommerce cart shipping
|
|
17913
|
+
* cleanup) gate on it so their behavior stays in lockstep with what the shopper
|
|
17914
|
+
* actually sees.
|
|
17915
|
+
*
|
|
17916
|
+
* @param showLog - emit a debug log when the shopper is not in a shipping zone.
|
|
17917
|
+
* Defaults to `true`; pass `false` from non-rendering callers to avoid log
|
|
17918
|
+
* noise.
|
|
17919
|
+
*/
|
|
17920
|
+
const shouldShowHelloWidget = (showLog = true) => {
|
|
17921
|
+
if (!localizationStore.localizationLoaded) {
|
|
17922
|
+
return false;
|
|
17923
|
+
}
|
|
17924
|
+
return getHelloWidgetVisibility(showLog);
|
|
17925
|
+
};
|
|
17870
17926
|
|
|
17871
17927
|
/**
|
|
17872
17928
|
* Guard against overlapping passes. `removeBigcommerceCartShipping` is fired on
|
|
@@ -18333,6 +18389,41 @@ const getCurrencyCode = (code) => {
|
|
|
18333
18389
|
return null;
|
|
18334
18390
|
};
|
|
18335
18391
|
|
|
18392
|
+
/**
|
|
18393
|
+
* Drop a remembered Hello country when widgetVisibility would hide the
|
|
18394
|
+
* widget for it, then fall back to geo.
|
|
18395
|
+
*
|
|
18396
|
+
* Does not mutate the localization store — the caller applies the returned
|
|
18397
|
+
* country. Pass `geoCountry` when init already fetched IP localization so
|
|
18398
|
+
* discard does not wait on a second round trip. Pass `urlCountryAtLoad`
|
|
18399
|
+
* from the URL as it was at page load (before init writes `zCountry` for
|
|
18400
|
+
* URL_PARAM merchants). Do not omit it after a live URL write — the
|
|
18401
|
+
* default is `null`, not the current URL. Storage is cleared when geo
|
|
18402
|
+
* succeeds, or when a load-time URL country won and the stored country
|
|
18403
|
+
* would be hidden.
|
|
18404
|
+
*/
|
|
18405
|
+
const reconcileRememberedCountryOverride = async ({ geoCountry, urlCountryAtLoad = null, } = {}) => {
|
|
18406
|
+
const storedCountry = getCountryOverrideStorage();
|
|
18407
|
+
if (!storedCountry) {
|
|
18408
|
+
return null;
|
|
18409
|
+
}
|
|
18410
|
+
if (getHelloWidgetVisibility(false, storedCountry)) {
|
|
18411
|
+
return null;
|
|
18412
|
+
}
|
|
18413
|
+
if (urlCountryAtLoad) {
|
|
18414
|
+
clearCountryOverrideStorage();
|
|
18415
|
+
return null;
|
|
18416
|
+
}
|
|
18417
|
+
const country = geoCountry !== undefined
|
|
18418
|
+
? geoCountry
|
|
18419
|
+
: (await getLocalization({ ignoreCountryOverride: true })).country;
|
|
18420
|
+
if (!country) {
|
|
18421
|
+
return null;
|
|
18422
|
+
}
|
|
18423
|
+
clearCountryOverrideStorage();
|
|
18424
|
+
return country;
|
|
18425
|
+
};
|
|
18426
|
+
|
|
18336
18427
|
const setZCountryUrlParam = (selectedCountryCode) => {
|
|
18337
18428
|
if (!selectedCountryCode) {
|
|
18338
18429
|
return;
|
|
@@ -18504,19 +18595,23 @@ const getNewLocalization = async ({ isInitializing, }) => {
|
|
|
18504
18595
|
}
|
|
18505
18596
|
};
|
|
18506
18597
|
const getCustomMessages = async () => {
|
|
18507
|
-
|
|
18508
|
-
|
|
18598
|
+
const countryCode = localizationStore.selectedCountryCode;
|
|
18599
|
+
VarianceTest.log(`Getting custom messages for ${countryCode}`);
|
|
18600
|
+
if (!countryCode || !zonosStore.zonosStore.storeId) {
|
|
18509
18601
|
return;
|
|
18510
18602
|
}
|
|
18511
18603
|
const localeMessages = await getLocaleMessages({
|
|
18512
|
-
countryCode
|
|
18604
|
+
countryCode,
|
|
18513
18605
|
localeTo: localizationStore.selectedLocale,
|
|
18514
18606
|
storeId: zonosStore.zonosStore.storeId,
|
|
18515
18607
|
});
|
|
18608
|
+
if (localizationStore.selectedCountryCode !== countryCode) {
|
|
18609
|
+
return;
|
|
18610
|
+
}
|
|
18516
18611
|
const allMessages = localeMessages.flatMap(x => {
|
|
18517
18612
|
var _a;
|
|
18518
18613
|
return {
|
|
18519
|
-
countryCode
|
|
18614
|
+
countryCode,
|
|
18520
18615
|
message: (_a = x.countryCodesPageMessageLinks.find(Boolean)) === null || _a === void 0 ? void 0 : _a.message.textTo,
|
|
18521
18616
|
pageName: x.pageName,
|
|
18522
18617
|
};
|
|
@@ -18559,17 +18654,19 @@ const getValidLocale = (locale) => {
|
|
|
18559
18654
|
VarianceTest.log(`Locale ${locale} is not offered, falling back to ${fallback === null || fallback === void 0 ? void 0 : fallback.code}`);
|
|
18560
18655
|
return (fallback === null || fallback === void 0 ? void 0 : fallback.code) || 'en';
|
|
18561
18656
|
};
|
|
18562
|
-
const
|
|
18563
|
-
var _a
|
|
18657
|
+
const syncSelectedCountryToPage = (selectedCountryCode) => {
|
|
18658
|
+
var _a;
|
|
18659
|
+
setZCountryUrlParam(selectedCountryCode);
|
|
18660
|
+
(_a = document
|
|
18661
|
+
.querySelector('zonos-hello')) === null || _a === void 0 ? void 0 : _a.setAttribute('z-country', selectedCountryCode);
|
|
18662
|
+
};
|
|
18663
|
+
const localizationStoreUpdateSelectedCountryCode = ({ isInitializing, newSelectedCountryCode, persistOverride, }) => {
|
|
18664
|
+
var _a;
|
|
18564
18665
|
VarianceTest.log(`Updating selected country code to ${newSelectedCountryCode}`);
|
|
18565
18666
|
const isFirstTime = !localizationStore.selectedCountryCode;
|
|
18566
18667
|
localizationStore.selectedCountryCode = getValidCountryCode(newSelectedCountryCode);
|
|
18567
|
-
const { selectedCountryCode
|
|
18568
|
-
const isShippableCountry =
|
|
18569
|
-
!!selectedCountryCode &&
|
|
18570
|
-
!!shippingZoneCountries[selectedCountryCode] &&
|
|
18571
|
-
// Make sure the country is not in the disabled countries list
|
|
18572
|
-
!zonosStore.zonosStore.disabledCountries.includes(selectedCountryCode);
|
|
18668
|
+
const { selectedCountryCode } = localizationStore;
|
|
18669
|
+
const isShippableCountry = isCountryInShippingZone(selectedCountryCode);
|
|
18573
18670
|
// update shippable country
|
|
18574
18671
|
localizationStore.isShippableCountry = isShippableCountry;
|
|
18575
18672
|
VarianceTest.log(`${localizationStore.selectedCountryCode} is a shippable country: ${localizationStore.isShippableCountry}`);
|
|
@@ -18592,9 +18689,10 @@ const localizationStoreUpdateSelectedCountryCode = ({ isInitializing, newSelecte
|
|
|
18592
18689
|
return;
|
|
18593
18690
|
}
|
|
18594
18691
|
const currencyCode = getCurrencyCode(selectedCountryCode);
|
|
18595
|
-
|
|
18596
|
-
|
|
18597
|
-
|
|
18692
|
+
const shouldPersistOverride = persistOverride !== null && persistOverride !== void 0 ? persistOverride : !isInitializing;
|
|
18693
|
+
// Only trigger onCountryChange after init — the first apply, and any
|
|
18694
|
+
// reconcile fallback during init, are not shopper-selected changes.
|
|
18695
|
+
if (!isFirstTime && !isInitializing) {
|
|
18598
18696
|
(_a = zonosStore.zonosStore.onCountryChange) === null || _a === void 0 ? void 0 : _a.call(zonosStore.zonosStore, {
|
|
18599
18697
|
countryCode: selectedCountryCode,
|
|
18600
18698
|
currencyCode,
|
|
@@ -18624,27 +18722,24 @@ const localizationStoreUpdateSelectedCountryCode = ({ isInitializing, newSelecte
|
|
|
18624
18722
|
localizationStore.countryLandedCost = null;
|
|
18625
18723
|
localizationStore.inclusivePricingConfigurations = [];
|
|
18626
18724
|
currencyDisplay();
|
|
18725
|
+
}
|
|
18726
|
+
else {
|
|
18727
|
+
localizationStore.targetCurrency = currencyCode;
|
|
18728
|
+
// Init may apply a remembered country that reconcile then discards. Fetch
|
|
18729
|
+
// exchange rates once after reconcile for the final country instead.
|
|
18627
18730
|
if (!isInitializing) {
|
|
18628
|
-
void
|
|
18731
|
+
void getNewLocalization({ isInitializing: false });
|
|
18629
18732
|
}
|
|
18630
|
-
// Clear session so the next visit falls back to geolocation, but keep
|
|
18631
|
-
// the current shopper's explicit selection visible in the URL (so a
|
|
18632
|
-
// same-tab reload still honors it) and on the hello element.
|
|
18633
|
-
window.sessionStorage.removeItem('zonos--country');
|
|
18634
|
-
setZCountryUrlParam(selectedCountryCode);
|
|
18635
|
-
(_b = document
|
|
18636
|
-
.querySelector('zonos-hello')) === null || _b === void 0 ? void 0 : _b.setAttribute('z-country', selectedCountryCode);
|
|
18637
|
-
return;
|
|
18638
18733
|
}
|
|
18639
|
-
localizationStore.targetCurrency = currencyCode;
|
|
18640
|
-
void getNewLocalization({ isInitializing: isInitializing });
|
|
18641
18734
|
if (!isInitializing) {
|
|
18642
18735
|
void getCustomMessages();
|
|
18643
18736
|
}
|
|
18644
|
-
|
|
18645
|
-
|
|
18646
|
-
|
|
18647
|
-
|
|
18737
|
+
if (shouldPersistOverride) {
|
|
18738
|
+
setCountryOverrideStorage(selectedCountryCode);
|
|
18739
|
+
}
|
|
18740
|
+
if (!isInitializing) {
|
|
18741
|
+
syncSelectedCountryToPage(selectedCountryCode);
|
|
18742
|
+
}
|
|
18648
18743
|
};
|
|
18649
18744
|
const initHelloCountryList = (allCountries) => {
|
|
18650
18745
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -18723,12 +18818,25 @@ const localizationStoreUpdateSelectedLocale = (requestedLocale) => {
|
|
|
18723
18818
|
localizationStore.selectedLocale = newSelectedLocale;
|
|
18724
18819
|
translationStoreUpdateLanguage(newSelectedLocale);
|
|
18725
18820
|
void updateCheckoutSessionLanguage();
|
|
18726
|
-
|
|
18821
|
+
if (localizationStore.localizationLoaded) {
|
|
18822
|
+
void getCustomMessages();
|
|
18823
|
+
}
|
|
18727
18824
|
};
|
|
18728
18825
|
const initLocalizationStore = async () => {
|
|
18729
18826
|
var _a;
|
|
18827
|
+
migrateCountryOverrideStorage();
|
|
18828
|
+
const urlCountryAtLoad = getZCountryUrlParam();
|
|
18829
|
+
const storedCountryAtLoad = getCountryOverrideStorage();
|
|
18830
|
+
const shouldPrefetchGeo = !!storedCountryAtLoad && !urlCountryAtLoad;
|
|
18730
18831
|
// all countries from countries.json, shipping zone and localization
|
|
18731
|
-
const [allCountries, shippingZoneCountries, localization] = await Promise.all([
|
|
18832
|
+
const [allCountries, shippingZoneCountries, localization, geoLocalization] = await Promise.all([
|
|
18833
|
+
getCountries(),
|
|
18834
|
+
getShippingZones(),
|
|
18835
|
+
getLocalization(),
|
|
18836
|
+
shouldPrefetchGeo
|
|
18837
|
+
? getLocalization({ ignoreCountryOverride: true })
|
|
18838
|
+
: Promise.resolve(undefined),
|
|
18839
|
+
]);
|
|
18732
18840
|
// Filter countries to only include countries in the shipping zone
|
|
18733
18841
|
const filteredCountries = shippingZoneCountries === null || shippingZoneCountries === void 0 ? void 0 : shippingZoneCountries.reduce((acc, countryCode) => {
|
|
18734
18842
|
const countryInfo = allCountries === null || allCountries === void 0 ? void 0 : allCountries[countryCode];
|
|
@@ -18747,7 +18855,7 @@ const initLocalizationStore = async () => {
|
|
|
18747
18855
|
// update selected country code in store
|
|
18748
18856
|
localizationStoreUpdateSelectedCountryCode({
|
|
18749
18857
|
isInitializing: true,
|
|
18750
|
-
newSelectedCountryCode: country ||
|
|
18858
|
+
newSelectedCountryCode: country || storedCountryAtLoad,
|
|
18751
18859
|
});
|
|
18752
18860
|
// use locale from params if it exists, otherwise use locale from localization
|
|
18753
18861
|
const overrideLocale = getOverrideLocale();
|
|
@@ -18769,10 +18877,24 @@ const initLocalizationStore = async () => {
|
|
|
18769
18877
|
newSelectedCountryCode: 'CA',
|
|
18770
18878
|
});
|
|
18771
18879
|
}
|
|
18880
|
+
const fallbackCountry = await reconcileRememberedCountryOverride({
|
|
18881
|
+
geoCountry: geoLocalization === null || geoLocalization === void 0 ? void 0 : geoLocalization.country,
|
|
18882
|
+
urlCountryAtLoad,
|
|
18883
|
+
});
|
|
18884
|
+
if (fallbackCountry) {
|
|
18885
|
+
localizationStoreUpdateSelectedCountryCode({
|
|
18886
|
+
isInitializing: true,
|
|
18887
|
+
newSelectedCountryCode: fallbackCountry,
|
|
18888
|
+
});
|
|
18889
|
+
}
|
|
18890
|
+
if (localizationStore.selectedCountryCode) {
|
|
18891
|
+
syncSelectedCountryToPage(localizationStore.selectedCountryCode);
|
|
18892
|
+
}
|
|
18893
|
+
void getCustomMessages();
|
|
18894
|
+
void getNewLocalization({ isInitializing: true });
|
|
18772
18895
|
if (!localizationStore.localizationLoaded) {
|
|
18773
18896
|
localizationStore.localizationLoaded = true;
|
|
18774
18897
|
void removeBigcommerceCartShipping();
|
|
18775
|
-
// shouldShowHelloWidget is false because localization is not loaded yet
|
|
18776
18898
|
void toggleBigcommerceNativeCurrencySelector();
|
|
18777
18899
|
}
|
|
18778
18900
|
};
|
|
@@ -18793,6 +18915,7 @@ exports.getSupportedLanguages = getSupportedLanguages;
|
|
|
18793
18915
|
exports.getZCountryUrlParam = getZCountryUrlParam;
|
|
18794
18916
|
exports.initLocalizationStore = initLocalizationStore;
|
|
18795
18917
|
exports.isBigCommerceCustomerLoggedIn = isBigCommerceCustomerLoggedIn;
|
|
18918
|
+
exports.isCountryInShippingZone = isCountryInShippingZone;
|
|
18796
18919
|
exports.isValidSelector = isValidSelector;
|
|
18797
18920
|
exports.languages = languages;
|
|
18798
18921
|
exports.localizationStore = localizationStore;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var zonosStore = require('./zonosStore-BCNYr6Tk.js');
|
|
4
|
-
var cart = require('./cart-
|
|
5
|
-
var localization = require('./localization-
|
|
4
|
+
var cart = require('./cart-WLQb2hbe.js');
|
|
5
|
+
var localization = require('./localization-C5HPlCNK.js');
|
|
6
6
|
var handleFetch = require('./handleFetch-DQLhurnE.js');
|
|
7
7
|
var isContrastColor = require('./isContrastColor-B9ldIdpa.js');
|
|
8
8
|
var VarianceTest = require('./VarianceTest-C98whVgO.js');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var cart = require('./cart-
|
|
4
|
-
var localization = require('./localization-
|
|
3
|
+
var cart = require('./cart-WLQb2hbe.js');
|
|
4
|
+
var localization = require('./localization-C5HPlCNK.js');
|
|
5
5
|
var handleFetch = require('./handleFetch-DQLhurnE.js');
|
|
6
6
|
|
|
7
7
|
const placeTestOrder = async () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var cart = require('./cart-
|
|
4
|
-
var localization = require('./localization-
|
|
3
|
+
var cart = require('./cart-WLQb2hbe.js');
|
|
4
|
+
var localization = require('./localization-C5HPlCNK.js');
|
|
5
5
|
|
|
6
6
|
const getDisplayCurrency = () => {
|
|
7
7
|
var _a, _b;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-DAAr465v.js');
|
|
4
|
-
var localization = require('./localization-
|
|
4
|
+
var localization = require('./localization-C5HPlCNK.js');
|
|
5
5
|
var zonosStore = require('./zonosStore-BCNYr6Tk.js');
|
|
6
|
-
var getMissingRequiredShippingFields = require('./getMissingRequiredShippingFields-
|
|
6
|
+
var getMissingRequiredShippingFields = require('./getMissingRequiredShippingFields-5w62gTIB.js');
|
|
7
7
|
var classes = require('./classes-D_DL168u.js');
|
|
8
|
-
var cart = require('./cart-
|
|
8
|
+
var cart = require('./cart-WLQb2hbe.js');
|
|
9
9
|
var RemoveIcon$1 = require('./RemoveIcon-CuM1YmjP.js');
|
|
10
10
|
var containsNonLatinChars = require('./containsNonLatinChars-D_OggJN6.js');
|
|
11
11
|
var getBorderRadius = require('./getBorderRadius-DGZiQu09.js');
|
|
@@ -271,9 +271,9 @@ const ZonosAddressSuggestions = class {
|
|
|
271
271
|
return segments;
|
|
272
272
|
}
|
|
273
273
|
render() {
|
|
274
|
-
return (index.h(index.Host, { key: '
|
|
274
|
+
return (index.h(index.Host, { key: '34018ecc951c0335041e24102329eb83a8d68439', class: "zonos--address-suggestions", role: "group", style: {
|
|
275
275
|
'--zonos--border-radius': getBorderRadius.getBorderRadius(),
|
|
276
|
-
} }, index.h("ul", { key: '
|
|
276
|
+
} }, index.h("ul", { key: '80433831c875845e57225a1317c430e2626edf9a', "aria-label": "Suggestions", class: "wrapper", role: "listbox" }, !!this.localSuggestions.length && (index.h("li", { key: '3510ef51b56b1cb0a36334e842792bccc2daeca5', "aria-selected": false, class: "powered-by option", role: "option" }, index.h("div", { key: '72773af6f9c7e0644ebc5239e4bf585bba6e164a', class: "powered-by-container" }, index.h("zonos-text", { key: '7fabccbe33cbc8d037dfd25f6e5b0a5bdaf97b2f', type: "caption" }, "Suggestions powered by"), index.h("zonos-text", { key: '2d88a3b8d7369a44e910ec60f5c7ac0c3f0ce801', type: "semiBoldLabel" }, "Google")), index.h("zonos-button", { key: '74315c248cc84617d854a3b51d0bad8300c6b762', "aria-label": "Clear suggestions", icon: index.h("zonos-icon", { content: RemoveIcon }), noBackground: true, onClick: () => {
|
|
277
277
|
this.localSuggestions = [];
|
|
278
278
|
} }))), this.localSuggestions.map(suggestion => (
|
|
279
279
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events
|
|
@@ -1453,10 +1453,10 @@ const ZonosAddress = class {
|
|
|
1453
1453
|
this.country = localization.localizationStore.selectedCountryCode;
|
|
1454
1454
|
}
|
|
1455
1455
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
1456
|
-
return (index.h(index.Host, { key: '
|
|
1456
|
+
return (index.h(index.Host, { key: '9d178094ee341623633d1e3822bd79f254a27e51', class: classes.classes([
|
|
1457
1457
|
'zonos--address zonos--elements',
|
|
1458
1458
|
`zonos--${this.type}-address`,
|
|
1459
|
-
]) }, index.h("zonos-text", { key: '
|
|
1459
|
+
]) }, index.h("zonos-text", { key: 'c36b4ce9b63cce95664894fd8929ffe15807a22a', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), index.h("slot", { key: '661eab7074f99b6dca52d5f7f546cfbd29322fbf', name: "below-title" }), this.renderCompanyNameInput(), this.renderTaxIdInput(), this.renderShortAddressCodeInput(), this.renderCustomAddressForm()));
|
|
1460
1460
|
}
|
|
1461
1461
|
get el() { return index.getElement(this); }
|
|
1462
1462
|
static get watchers() { return {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-DAAr465v.js');
|
|
4
|
-
var localization = require('./localization-
|
|
4
|
+
var localization = require('./localization-C5HPlCNK.js');
|
|
5
5
|
var containsNonLatinChars = require('./containsNonLatinChars-D_OggJN6.js');
|
|
6
6
|
var zonosStore = require('./zonosStore-BCNYr6Tk.js');
|
|
7
7
|
var classes = require('./classes-D_DL168u.js');
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var index = require('./index-DAAr465v.js');
|
|
4
4
|
var throttle = require('./throttle-BcxGntLr.js');
|
|
5
|
-
var cart = require('./cart-
|
|
6
|
-
var localization = require('./localization-
|
|
5
|
+
var cart = require('./cart-WLQb2hbe.js');
|
|
6
|
+
var localization = require('./localization-C5HPlCNK.js');
|
|
7
7
|
var zonosStore = require('./zonosStore-BCNYr6Tk.js');
|
|
8
8
|
var handleFetch = require('./handleFetch-DQLhurnE.js');
|
|
9
9
|
var shouldRenderTaxIdInput = require('./shouldRenderTaxIdInput-TxekHCp7.js');
|
|
@@ -416,11 +416,11 @@ const ZonosAddress = class {
|
|
|
416
416
|
this.isAddressFilled = true;
|
|
417
417
|
}
|
|
418
418
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
419
|
-
return (index.h(index.Host, { key: '
|
|
419
|
+
return (index.h(index.Host, { key: '302dafde973c4bf2d847640d8f0e064d88f350f8', class: classes.classes([
|
|
420
420
|
'zonos--address',
|
|
421
421
|
'zonos--elements',
|
|
422
422
|
`zonos--${this.type}-address`,
|
|
423
|
-
]) }, this.titleText && (index.h("zonos-text", { key: '
|
|
423
|
+
]) }, this.titleText && (index.h("zonos-text", { key: '706204604ad32eed710e38adbe8133b3384044eb', class: "zonos--title", type: "semiBoldLabel" }, this.titleText)), index.h("slot", { key: '0edc4c5d6c3ff965be6edbf680acaed892c71a16', name: "below-title" }), this.renderCompanyNameInput(), this.renderTaxIdInput(), this.renderShortAddressCodeInput(), index.h("div", { key: '6aa6e4e86a76f1081c5af1f2b5f3282dfd91f3c5', class: "zonos--address-component" })));
|
|
424
424
|
}
|
|
425
425
|
get el() { return index.getElement(this); }
|
|
426
426
|
static get watchers() { return {
|