@zonos/elements 1.3.54 → 1.3.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{CheckoutConfig-ca67953a.js → CheckoutConfig-4d03e084.js} +1 -1
- package/dist/cjs/{cart-03b08131.js → cart-6c7bf457.js} +4 -4
- package/dist/cjs/{createCustomEvent-532569f1.js → createCustomEvent-a10ed604.js} +2 -2
- package/dist/cjs/{handleFetch-4b296adc.js → handleFetch-c0e07666.js} +5 -2
- package/dist/cjs/index.cjs.js +9 -9
- package/dist/cjs/{paypal-bdc19559.js → paypal-ec9ebaf5.js} +4 -4
- package/dist/cjs/zonos-address_8.cjs.entry.js +2 -2
- package/dist/cjs/zonos-badge_13.cjs.entry.js +4 -4
- package/dist/cjs/zonos-checkout.cjs.entry.js +10 -7
- package/dist/cjs/zonos-controller.cjs.entry.js +4 -4
- package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
- 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 +5 -5
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
- package/dist/cjs/zonos-notification_3.cjs.entry.js +3 -3
- package/dist/collection/__mocks__/vercel-app/localization.js +1 -1
- package/dist/collection/__mocks__/zonos-url/localization.js +2899 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +5 -2
- package/dist/collection/components/main/zonos-controller.js +2 -2
- package/dist/collection/components/store/checkout/paypal.js +2 -2
- package/dist/collection/components/store/checkout/stripe.js +3 -3
- package/dist/collection/components/utils/handleFetch.js +2 -2
- package/dist/collection/components/utils/hello/detectItemRestrictions.js +1 -1
- package/dist/collection/components/utils/hello/getProductsOnPage.js +2 -2
- package/dist/collection/components/utils/logging/sendErrorLog.js +3 -0
- package/dist/collection/types/generated/graphql.customer.types.js +9 -0
- package/dist/collection/utils/formattedCloudflareApiUrl.js +1 -1
- package/dist/collection/utils/formattedUrl.js +1 -1
- package/dist/esm/{CheckoutConfig-bf2a28bd.js → CheckoutConfig-7fe6442e.js} +1 -1
- package/dist/esm/{cart-008dea87.js → cart-a845a902.js} +4 -4
- package/dist/esm/{createCustomEvent-a10320c1.js → createCustomEvent-0797e187.js} +2 -2
- package/dist/esm/{handleFetch-99b944a2.js → handleFetch-613fbc00.js} +5 -2
- package/dist/esm/index.js +10 -10
- package/dist/esm/{paypal-b90fc7ff.js → paypal-6d80dfd9.js} +4 -4
- package/dist/esm/zonos-address_8.entry.js +2 -2
- package/dist/esm/zonos-badge_13.entry.js +4 -4
- package/dist/esm/zonos-checkout.entry.js +10 -7
- package/dist/esm/zonos-controller.entry.js +4 -4
- package/dist/esm/zonos-country-flag.entry.js +2 -2
- 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 +5 -5
- package/dist/esm/zonos-language-select_2.entry.js +2 -2
- package/dist/esm/zonos-notification_3.entry.js +3 -3
- package/dist/esm-es5/{CheckoutConfig-bf2a28bd.js → CheckoutConfig-7fe6442e.js} +1 -1
- package/dist/esm-es5/{cart-008dea87.js → cart-a845a902.js} +1 -1
- package/dist/esm-es5/{createCustomEvent-a10320c1.js → createCustomEvent-0797e187.js} +1 -1
- package/dist/esm-es5/handleFetch-613fbc00.js +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{paypal-b90fc7ff.js → paypal-6d80dfd9.js} +2 -2
- package/dist/esm-es5/zonos-address_8.entry.js +1 -1
- package/dist/esm-es5/zonos-badge_13.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-notification_3.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/types/generated/graphql.customer.types.d.ts +11 -0
- package/dist/types/types/generated/graphql.customer.types.ts +15 -0
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-ca4efb81.system.entry.js → p-0954e8fe.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f9bfbf42.system.js → p-0fc80040.system.js} +1 -1
- package/dist/zonos-elements/{p-3149985c.entry.js → p-173f8e5b.entry.js} +1 -1
- package/dist/zonos-elements/{p-3cfbbf17.system.entry.js → p-17ea3429.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-92faa378.system.js → p-1df63802.system.js} +1 -1
- package/dist/zonos-elements/{p-7f93c97a.system.js → p-206cf031.system.js} +1 -1
- package/dist/zonos-elements/{p-546aabc0.system.entry.js → p-298df70c.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f6e385f8.system.entry.js → p-324a8c0d.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-2bc6342f.system.entry.js → p-3492c75f.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f5bac726.system.entry.js → p-35122d9c.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-e672e4de.entry.js → p-35ca4dcc.entry.js} +1 -1
- package/dist/zonos-elements/{p-ada937d6.system.entry.js → p-40001536.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-2673dd6d.system.entry.js → p-40f73fb4.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-710b8292.js → p-472a6c19.js} +1 -1
- package/dist/zonos-elements/{p-fb28f27f.entry.js → p-4b205b2f.entry.js} +1 -1
- package/dist/zonos-elements/{p-72cfc372.system.entry.js → p-4dd2f617.system.entry.js} +1 -1
- package/dist/zonos-elements/p-51d82a07.entry.js +1 -0
- package/dist/zonos-elements/{p-997cc826.entry.js → p-556d4ddb.entry.js} +1 -1
- package/dist/zonos-elements/{p-baff865d.entry.js → p-6f87b869.entry.js} +1 -1
- package/dist/zonos-elements/{p-e6b9cf45.system.js → p-8260b820.system.js} +1 -1
- package/dist/zonos-elements/{p-88c2057e.entry.js → p-921d3603.entry.js} +1 -1
- package/dist/zonos-elements/{p-3566044a.entry.js → p-95a18511.entry.js} +1 -1
- package/dist/zonos-elements/{p-1c29081a.js → p-9fd3995f.js} +1 -1
- package/dist/zonos-elements/p-a99620c8.entry.js +1 -0
- package/dist/zonos-elements/{p-4b7c05a8.system.entry.js → p-b65b3e7b.system.entry.js} +1 -1
- package/dist/zonos-elements/p-c78dd680.system.js +1 -1
- package/dist/zonos-elements/{p-66cc2bbd.system.js → p-d067bb64.system.js} +2 -2
- package/dist/zonos-elements/p-d20f6cf1.js +17 -0
- package/dist/zonos-elements/{p-18802362.entry.js → p-d42018fc.entry.js} +1 -1
- package/dist/zonos-elements/p-e89c2805.system.js +1 -0
- package/dist/zonos-elements/{p-b914e98e.js → p-f9c2288f.js} +1 -1
- package/dist/zonos-elements/p-fb59c3c3.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/handleFetch-99b944a2.js +0 -1
- package/dist/zonos-elements/p-7400bcd3.js +0 -1
- package/dist/zonos-elements/p-7a3118e7.entry.js +0 -1
- package/dist/zonos-elements/p-7eac524d.system.js +0 -1
- package/dist/zonos-elements/p-dfbc9605.js +0 -17
- package/dist/zonos-elements/p-e7e22128.entry.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const handleFetch = require('./handleFetch-
|
|
3
|
+
const handleFetch = require('./handleFetch-c0e07666.js');
|
|
4
4
|
|
|
5
5
|
const getTempCartById = async (cartId) => {
|
|
6
6
|
const { errors, json } = await handleFetch.handleFetch('/api/zonos-elements/get-temp-cart', {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const zonosStore = require('./zonosStore-67139f0e.js');
|
|
4
|
-
const handleFetch = require('./handleFetch-
|
|
4
|
+
const handleFetch = require('./handleFetch-c0e07666.js');
|
|
5
5
|
const isDarkColor = require('./isDarkColor-7a056d05.js');
|
|
6
6
|
const getBorderRadius = require('./getBorderRadius-a6a3b35e.js');
|
|
7
7
|
|
|
@@ -8381,7 +8381,7 @@ const stripeStorePrefetchLandedCost = async () => {
|
|
|
8381
8381
|
}
|
|
8382
8382
|
}
|
|
8383
8383
|
catch (err) {
|
|
8384
|
-
// default to empty array if we
|
|
8384
|
+
// default to empty array if we failed to fetch landed cost, so we can show the error message
|
|
8385
8385
|
cartStore.landedCostData = [];
|
|
8386
8386
|
cartStore.shippingData = [];
|
|
8387
8387
|
handleFetch.logError(err);
|
|
@@ -8505,7 +8505,7 @@ const stripeStoreInitCheckoutSession = async () => {
|
|
|
8505
8505
|
var _a;
|
|
8506
8506
|
const total = cartStore.items.reduce((amount, item) => amount + item.amount * item.quantity, 0);
|
|
8507
8507
|
if (!total || !localizationStore.targetCurrency) {
|
|
8508
|
-
handleFetch.logError('
|
|
8508
|
+
handleFetch.logError('Failed to create checkout session - invalid total or currency');
|
|
8509
8509
|
return false;
|
|
8510
8510
|
}
|
|
8511
8511
|
stripeStore.isFetchingSession = true;
|
|
@@ -8647,7 +8647,7 @@ const stripeStoreTranslateAddressToLatin = async ({ addressInvalidCharactersList
|
|
|
8647
8647
|
});
|
|
8648
8648
|
if (errors.length || !json) {
|
|
8649
8649
|
handleFetch.logError('Error occurs when translating address to latin', JSON.stringify(errors, null, 2));
|
|
8650
|
-
// reset translated address if we
|
|
8650
|
+
// reset translated address if we Failed to translate and let user manually fix it
|
|
8651
8651
|
stripeStore.translatedAddress = {
|
|
8652
8652
|
address: {},
|
|
8653
8653
|
billingAddress: {},
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const cart = require('./cart-
|
|
3
|
+
const cart = require('./cart-6c7bf457.js');
|
|
4
4
|
const zonosStore = require('./zonosStore-67139f0e.js');
|
|
5
|
-
const handleFetch = require('./handleFetch-
|
|
5
|
+
const handleFetch = require('./handleFetch-c0e07666.js');
|
|
6
6
|
|
|
7
7
|
const trackConversionEvent = async (eventName, metadata) => {
|
|
8
8
|
var _a, _b;
|
|
@@ -116,6 +116,9 @@ const sendErrorLog = async ({ endpoint, errors, metadata, shouldPostReleaseError
|
|
|
116
116
|
// use native fetch because in handleFetch also calls sendErrorLog and it will possibly cause circular dependencies issue
|
|
117
117
|
void fetch(`${MAIN_BASE_API}/api/zonos-elements/log-error`, {
|
|
118
118
|
body: JSON.stringify(errorObject),
|
|
119
|
+
headers: {
|
|
120
|
+
'Zonos-Referer': window.location.hostname,
|
|
121
|
+
},
|
|
119
122
|
method: 'POST',
|
|
120
123
|
});
|
|
121
124
|
}
|
|
@@ -195,7 +198,7 @@ const handleRequest = async ({ basePathType, options, path, }) => {
|
|
|
195
198
|
zonosMode: null,
|
|
196
199
|
};
|
|
197
200
|
}
|
|
198
|
-
const message = '
|
|
201
|
+
const message = 'Failed to fetch';
|
|
199
202
|
return {
|
|
200
203
|
baseUrl,
|
|
201
204
|
errors: [{ message, type: 'unknown' }],
|
|
@@ -262,7 +265,7 @@ const handleRequestWithFallback = async ({ basePathType: _basePathType, options,
|
|
|
262
265
|
const unknownError = errors.find(({ type }) => type === 'unknown');
|
|
263
266
|
const isUnknownError = !!unknownError || (response === null || response === void 0 ? void 0 : response.status) === 404;
|
|
264
267
|
const shouldCallFallback =
|
|
265
|
-
// If next fallback is available, and the error is unknown (
|
|
268
|
+
// If next fallback is available, and the error is unknown (Failed to fetch) or 404
|
|
266
269
|
nextFallbackApiType && isUnknownError;
|
|
267
270
|
// Should log the error if it's unknown error
|
|
268
271
|
if (isUnknownError) {
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const handleFetch = require('./handleFetch-
|
|
6
|
-
const CheckoutConfig = require('./CheckoutConfig-
|
|
5
|
+
const handleFetch = require('./handleFetch-c0e07666.js');
|
|
6
|
+
const CheckoutConfig = require('./CheckoutConfig-4d03e084.js');
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Get the load version and url based on the loadScriptSrc and version
|
|
@@ -96,7 +96,7 @@ const getZonosQaUrl = () => {
|
|
|
96
96
|
return null;
|
|
97
97
|
}
|
|
98
98
|
const qaUrl = extractZonosQaUrl(window.location.href);
|
|
99
|
-
const cdnUrl = "https://v1.3.
|
|
99
|
+
const cdnUrl = "https://v1.3.56.js.zonos.com";
|
|
100
100
|
// when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
|
|
101
101
|
if (!qaUrl &&
|
|
102
102
|
(cdnUrl.includes('test.') ||
|
|
@@ -280,10 +280,10 @@ const zonosLoadUrl = (() => {
|
|
|
280
280
|
}
|
|
281
281
|
return null;
|
|
282
282
|
})();
|
|
283
|
-
const ZONOS_URL = "https://v1.3.
|
|
284
|
-
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.
|
|
285
|
-
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.
|
|
286
|
-
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.
|
|
283
|
+
const ZONOS_URL = "https://v1.3.56.js.zonos.com";
|
|
284
|
+
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.56";
|
|
285
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.56";
|
|
286
|
+
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.56";
|
|
287
287
|
const INTER_FONT_URL = 'https://rsms.me';
|
|
288
288
|
const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
|
|
289
289
|
const INTER_FONT_REGEX = /^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;
|
|
@@ -298,14 +298,14 @@ Zonos.zonosConversionTest = typeof window !== 'undefined' &&
|
|
|
298
298
|
!!window.location.search.match(/\?.*(&*)zonosConversionTest/);
|
|
299
299
|
Zonos._paypalMockResponse = null;
|
|
300
300
|
Zonos.isBigCommerce = false;
|
|
301
|
-
Zonos.releaseDate = "
|
|
301
|
+
Zonos.releaseDate = "1727278094755";
|
|
302
302
|
Zonos.isLegacyCheckout = false;
|
|
303
303
|
/**
|
|
304
304
|
* By default, the package will load from npm
|
|
305
305
|
*/
|
|
306
306
|
Zonos.isNpm = true;
|
|
307
307
|
Zonos.zonosQaUrl = null;
|
|
308
|
-
Zonos.version = `v${"1.3.
|
|
308
|
+
Zonos.version = `v${"1.3.56"}`;
|
|
309
309
|
Zonos.modeAlerted = false;
|
|
310
310
|
Zonos.cartData = null;
|
|
311
311
|
Zonos.paypal = null;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const zonosStore = require('./zonosStore-67139f0e.js');
|
|
4
|
-
const cart = require('./cart-
|
|
5
|
-
const handleFetch = require('./handleFetch-
|
|
4
|
+
const cart = require('./cart-6c7bf457.js');
|
|
5
|
+
const handleFetch = require('./handleFetch-c0e07666.js');
|
|
6
6
|
const isDarkColor = require('./isDarkColor-7a056d05.js');
|
|
7
7
|
|
|
8
8
|
/*!
|
|
@@ -394,7 +394,7 @@ const paypalInitScript = async ({ currency }) => {
|
|
|
394
394
|
}
|
|
395
395
|
const paypalClientId = zonosStore.zonosStore.checkoutSettings.externalServiceTokens.find(item => item.type === 'PAYPAL_CLIENT_ID');
|
|
396
396
|
if (!paypalClientId) {
|
|
397
|
-
handleFetch.log('
|
|
397
|
+
handleFetch.log('Failed to load paypal -- missing paypal publishable key', 'warn');
|
|
398
398
|
return;
|
|
399
399
|
}
|
|
400
400
|
/**
|
|
@@ -437,7 +437,7 @@ const paypalStoreInitButtons = (props) => {
|
|
|
437
437
|
fundingSource }, props))), { fundingSource }))) || null;
|
|
438
438
|
}
|
|
439
439
|
catch (err) {
|
|
440
|
-
handleFetch.log(`=====
|
|
440
|
+
handleFetch.log(`===== Failed to load paypal's "${fundingSource}" button`, 'warn', err);
|
|
441
441
|
}
|
|
442
442
|
if (button === null || button === void 0 ? void 0 : button.isEligible()) {
|
|
443
443
|
handleFetch.log(`==== Paypal button ${fundingSource} loaded`);
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-6c7bf457.js');
|
|
7
7
|
const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
|
|
8
|
-
const handleFetch = require('./handleFetch-
|
|
8
|
+
const handleFetch = require('./handleFetch-c0e07666.js');
|
|
9
9
|
const containsNonLatinChars = require('./containsNonLatinChars-2be5129b.js');
|
|
10
10
|
const zonosStore = require('./zonosStore-67139f0e.js');
|
|
11
11
|
const classes = require('./classes-b7918f56.js');
|
|
@@ -5,11 +5,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
6
|
const zonosStore = require('./zonosStore-67139f0e.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
|
-
const cart = require('./cart-
|
|
9
|
-
const paypal = require('./paypal-
|
|
10
|
-
const createCustomEvent = require('./createCustomEvent-
|
|
8
|
+
const cart = require('./cart-6c7bf457.js');
|
|
9
|
+
const paypal = require('./paypal-ec9ebaf5.js');
|
|
10
|
+
const createCustomEvent = require('./createCustomEvent-a10ed604.js');
|
|
11
11
|
const getBorderRadius = require('./getBorderRadius-a6a3b35e.js');
|
|
12
|
-
const handleFetch = require('./handleFetch-
|
|
12
|
+
const handleFetch = require('./handleFetch-c0e07666.js');
|
|
13
13
|
const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
|
|
14
14
|
const ILanguage = require('./ILanguage-98b04442.js');
|
|
15
15
|
const isDarkColor = require('./isDarkColor-7a056d05.js');
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
7
|
-
const paypal = require('./paypal-
|
|
6
|
+
const cart = require('./cart-6c7bf457.js');
|
|
7
|
+
const paypal = require('./paypal-ec9ebaf5.js');
|
|
8
8
|
const zonosStore = require('./zonosStore-67139f0e.js');
|
|
9
|
-
const createCustomEvent = require('./createCustomEvent-
|
|
9
|
+
const createCustomEvent = require('./createCustomEvent-a10ed604.js');
|
|
10
10
|
const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
|
|
11
|
-
const handleFetch = require('./handleFetch-
|
|
11
|
+
const handleFetch = require('./handleFetch-c0e07666.js');
|
|
12
12
|
const classes = require('./classes-b7918f56.js');
|
|
13
13
|
const getBorderRadius = require('./getBorderRadius-a6a3b35e.js');
|
|
14
14
|
const isDarkColor = require('./isDarkColor-7a056d05.js');
|
|
15
|
-
const CheckoutConfig = require('./CheckoutConfig-
|
|
15
|
+
const CheckoutConfig = require('./CheckoutConfig-4d03e084.js');
|
|
16
16
|
const RemoveIcon = require('./RemoveIcon-081ac073.js');
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -281,7 +281,7 @@ const ZonosCheckout = class {
|
|
|
281
281
|
const cartResult = await CheckoutConfig.setupCartData(cartId);
|
|
282
282
|
const cartData = cartResult === null || cartResult === void 0 ? void 0 : cartResult.cartData;
|
|
283
283
|
if (!cartData) {
|
|
284
|
-
handleFetch.logError('
|
|
284
|
+
handleFetch.logError('Failed to build cart, please try again.');
|
|
285
285
|
return;
|
|
286
286
|
}
|
|
287
287
|
const { adjustments, cartItems } = buildCartItemsByTempCart(cartData);
|
|
@@ -411,7 +411,9 @@ const ZonosCheckout = class {
|
|
|
411
411
|
useLegacyQueryParam() {
|
|
412
412
|
const urlParams = new URLSearchParams(window.location.search);
|
|
413
413
|
const legacyShippingInfo = {
|
|
414
|
-
country:
|
|
414
|
+
country:
|
|
415
|
+
// fallback to selected country code if country is not provided
|
|
416
|
+
urlParams.get('country') || cart.localizationStore.selectedCountryCode,
|
|
415
417
|
customerAddress1: urlParams.get('customerAddress1'),
|
|
416
418
|
customerAddress2: urlParams.get('customerAddress2'),
|
|
417
419
|
customerCity: urlParams.get('customerCity'),
|
|
@@ -429,6 +431,7 @@ const ZonosCheckout = class {
|
|
|
429
431
|
!legacyShippingInfo.customerState ||
|
|
430
432
|
!legacyShippingInfo.customerZip ||
|
|
431
433
|
!legacyShippingInfo.country) {
|
|
434
|
+
handleFetch.log('Missing some query params so it can not be prefilled', 'info', legacyShippingInfo);
|
|
432
435
|
return;
|
|
433
436
|
}
|
|
434
437
|
this.defaultAddress = {
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-6c7bf457.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-67139f0e.js');
|
|
8
|
-
const handleFetch = require('./handleFetch-
|
|
8
|
+
const handleFetch = require('./handleFetch-c0e07666.js');
|
|
9
9
|
require('./isDarkColor-7a056d05.js');
|
|
10
10
|
require('./getBorderRadius-a6a3b35e.js');
|
|
11
11
|
|
|
@@ -230,7 +230,7 @@ const ZonosController = class {
|
|
|
230
230
|
// override subscription status
|
|
231
231
|
const config = Object.assign(Object.assign({}, this.config), { checkoutSettings: this.config.checkoutSettings
|
|
232
232
|
? Object.assign(Object.assign({}, this.config.checkoutSettings), { subscriptionStatus: undefined }) : undefined });
|
|
233
|
-
// load default setting if
|
|
233
|
+
// load default setting if failed to load user settings
|
|
234
234
|
zonosStore.zonosStoreInitSetting({
|
|
235
235
|
overrideSettings: config,
|
|
236
236
|
zonosSettings: json,
|
|
@@ -319,7 +319,7 @@ const ZonosController = class {
|
|
|
319
319
|
zonosStore.zonosStore.organizationName = organizationName;
|
|
320
320
|
}
|
|
321
321
|
render() {
|
|
322
|
-
return index.h(index.Host, { key: '
|
|
322
|
+
return index.h(index.Host, { key: '7ec14cc108aea8ac9c552c76410c00b698fae8f8', class: "zonos--elements" });
|
|
323
323
|
}
|
|
324
324
|
};
|
|
325
325
|
ZonosController.style = ZonosControllerStyle0;
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-6c7bf457.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-67139f0e.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
|
-
require('./handleFetch-
|
|
9
|
+
require('./handleFetch-c0e07666.js');
|
|
10
10
|
require('./isDarkColor-7a056d05.js');
|
|
11
11
|
require('./getBorderRadius-a6a3b35e.js');
|
|
12
12
|
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-6c7bf457.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-67139f0e.js');
|
|
8
8
|
const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
|
|
9
9
|
const isDarkColor = require('./isDarkColor-7a056d05.js');
|
|
10
10
|
const ILanguage = require('./ILanguage-98b04442.js');
|
|
11
|
-
require('./handleFetch-
|
|
11
|
+
require('./handleFetch-c0e07666.js');
|
|
12
12
|
require('./getBorderRadius-a6a3b35e.js');
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-6c7bf457.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-67139f0e.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
9
|
const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
|
|
10
10
|
const getHasMoreSpaceOnRight = require('./getHasMoreSpaceOnRight-4c94667f.js');
|
|
11
|
-
require('./handleFetch-
|
|
11
|
+
require('./handleFetch-c0e07666.js');
|
|
12
12
|
require('./isDarkColor-7a056d05.js');
|
|
13
13
|
require('./getBorderRadius-a6a3b35e.js');
|
|
14
14
|
|
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
6
|
const zonosStore = require('./zonosStore-67139f0e.js');
|
|
7
|
-
const cart = require('./cart-
|
|
7
|
+
const cart = require('./cart-6c7bf457.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
|
-
const handleFetch = require('./handleFetch-
|
|
9
|
+
const handleFetch = require('./handleFetch-c0e07666.js');
|
|
10
10
|
const getHasMoreSpaceOnRight = require('./getHasMoreSpaceOnRight-4c94667f.js');
|
|
11
11
|
require('./isDarkColor-7a056d05.js');
|
|
12
12
|
require('./getBorderRadius-a6a3b35e.js');
|
|
@@ -384,7 +384,7 @@ const detectItemRestrictions = async (newProducts) => {
|
|
|
384
384
|
}
|
|
385
385
|
const { selectedCountryCode } = cart.localizationStore;
|
|
386
386
|
if (!selectedCountryCode) {
|
|
387
|
-
handleFetch.logError('Hello
|
|
387
|
+
handleFetch.logError('Hello could not check item restrictions - No country code selected');
|
|
388
388
|
return [];
|
|
389
389
|
}
|
|
390
390
|
const items = newProducts.map(product => ({
|
|
@@ -430,7 +430,7 @@ const getProductsOnPage = () => {
|
|
|
430
430
|
var _a, _b;
|
|
431
431
|
const { productAddToCartElementSelector, productDescriptionElementSelector, productTitleElementSelector, restrictionBehavior, } = zonosStore.zonosStore.helloSettings;
|
|
432
432
|
if (!productTitleElementSelector || !productDescriptionElementSelector) {
|
|
433
|
-
handleFetch.logError(`Hello
|
|
433
|
+
handleFetch.logError(`Hello could not check item restrictions - must provide title and description selectors.`);
|
|
434
434
|
}
|
|
435
435
|
const titleNodes = (productTitleElementSelector &&
|
|
436
436
|
cart.isValidSelector(productTitleElementSelector) &&
|
|
@@ -442,7 +442,7 @@ const getProductsOnPage = () => {
|
|
|
442
442
|
[];
|
|
443
443
|
if (titleNodes.length !== descriptionNodes.length) {
|
|
444
444
|
// If the title and description selectors don't match, kill item restrictions altogether
|
|
445
|
-
handleFetch.logError('Hello
|
|
445
|
+
handleFetch.logError('Hello could not check item restrictions - Title and description selectors do not match');
|
|
446
446
|
return [];
|
|
447
447
|
}
|
|
448
448
|
const shouldDisableCart = restrictionBehavior === 'RESTRICT_AND_BLOCK';
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-6c7bf457.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-67139f0e.js');
|
|
8
8
|
const ILanguage = require('./ILanguage-98b04442.js');
|
|
9
|
-
require('./handleFetch-
|
|
9
|
+
require('./handleFetch-c0e07666.js');
|
|
10
10
|
require('./isDarkColor-7a056d05.js');
|
|
11
11
|
require('./getBorderRadius-a6a3b35e.js');
|
|
12
12
|
|
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
6
|
const zonosStore = require('./zonosStore-67139f0e.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
|
-
const cart = require('./cart-
|
|
9
|
-
const handleFetch = require('./handleFetch-
|
|
10
|
-
const paypal = require('./paypal-
|
|
8
|
+
const cart = require('./cart-6c7bf457.js');
|
|
9
|
+
const handleFetch = require('./handleFetch-c0e07666.js');
|
|
10
|
+
const paypal = require('./paypal-ec9ebaf5.js');
|
|
11
11
|
require('./isDarkColor-7a056d05.js');
|
|
12
12
|
require('./getBorderRadius-a6a3b35e.js');
|
|
13
13
|
|