@zonos/elements 1.3.45 → 1.3.47
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-89b4f62d.js → cart-85870c2e.js} +187 -62
- package/dist/cjs/{sendErrorLog-a966a8c1.js → createCustomEvent-aacc2833.js} +2 -22
- package/dist/cjs/index.cjs.js +13 -8
- package/dist/cjs/{paypal-1a1882c4.js → paypal-e4428dbf.js} +3 -3
- package/dist/cjs/zonos-address_8.cjs.entry.js +1 -1
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +25 -19
- package/dist/cjs/zonos-checkout.cjs.entry.js +10 -10
- package/dist/cjs/zonos-controller.cjs.entry.js +6 -6
- package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +1 -1
- package/dist/cjs/zonos-hello.cjs.entry.js +2 -3
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-notification_3.cjs.entry.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +14 -8
- package/dist/collection/components/main/zonos-controller.js +4 -3
- package/dist/collection/components/store/checkout/stripe.js +4 -7
- package/dist/collection/components/store/hello/localization.js +1 -1
- package/dist/collection/components/utils/api/calculateLandedCost.js +1 -2
- package/dist/collection/components/utils/api/checkItemRestrictions.js +1 -2
- package/dist/collection/components/utils/api/getCountries.js +1 -1
- package/dist/collection/components/utils/api/getCountryLandedCost.js +1 -1
- package/dist/collection/components/utils/api/getExchangeRate.js +6 -2
- package/dist/collection/components/utils/api/getInclusivePricing.js +1 -2
- package/dist/collection/components/utils/api/getLocaleMessages.js +7 -2
- package/dist/collection/components/utils/api/getLocalization.js +3 -6
- package/dist/collection/components/utils/api/getShippingZones.js +1 -2
- package/dist/collection/components/utils/api/getZonosSettings.js +1 -2
- package/dist/collection/components/utils/api/paypalCaptureOrder.js +1 -1
- package/dist/collection/components/utils/api/paypalCreateOrder.js +1 -1
- package/dist/collection/components/utils/api/trackConversionEvent.js +1 -2
- package/dist/collection/components/utils/api/triggerBuildLandedCost.js +3 -2
- package/dist/collection/components/utils/getNextFallbackApi.js +18 -0
- package/dist/collection/components/utils/handleFetch.js +84 -20
- package/dist/collection/components/utils/logging/sendErrorLog.js +33 -6
- package/dist/collection/components/utils/logging/sendLoadScriptLog.js +1 -1
- package/dist/collection/environment.js +15 -78
- package/dist/collection/scripts/_getZonosQaUrl.js +6 -2
- package/dist/collection/scripts/_zonosBase.js +1 -0
- package/dist/collection/utils/formattedCloudflareApiUrl.js +43 -0
- package/dist/collection/utils/formattedUrl.js +80 -0
- package/dist/collection/utils/generateCloudflareDeployUrl.js +21 -0
- package/dist/esm/{cart-9f40efd7.js → cart-3aae6236.js} +188 -64
- package/dist/esm/{sendErrorLog-aea606c0.js → createCustomEvent-ccb20b48.js} +3 -22
- package/dist/esm/index.js +13 -8
- package/dist/esm/{paypal-f4bb6ce7.js → paypal-b1589e7b.js} +3 -3
- package/dist/esm/zonos-address_8.entry.js +1 -1
- package/dist/esm/zonos-cart-items_12.entry.js +17 -11
- package/dist/esm/zonos-checkout.entry.js +3 -3
- package/dist/esm/zonos-controller.entry.js +6 -6
- package/dist/esm/zonos-country-flag.entry.js +1 -1
- package/dist/esm/zonos-country-select_4.entry.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm/zonos-hello.entry.js +2 -3
- package/dist/esm/zonos-language-select_2.entry.js +1 -1
- package/dist/esm/zonos-notification_3.entry.js +2 -2
- package/dist/esm-es5/{cart-9f40efd7.js → cart-3aae6236.js} +1 -1
- package/dist/esm-es5/createCustomEvent-ccb20b48.js +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/paypal-b1589e7b.js +17 -0
- package/dist/esm-es5/zonos-address_8.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_12.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.d.ts +11 -0
- 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/utils/getNextFallbackApi.d.ts +10 -0
- package/dist/types/components/utils/handleFetch.d.ts +10 -1
- package/dist/types/components/utils/logging/sendErrorLog.d.ts +7 -1
- package/dist/types/environment.d.ts +8 -9
- package/dist/types/scripts/_getNextFallbackUrl.d.ts +1 -1
- package/dist/types/scripts/_zonosBase.d.ts +5 -0
- package/dist/types/utils/formattedCloudflareApiUrl.d.ts +20 -0
- package/dist/types/utils/formattedUrl.d.ts +9 -0
- package/dist/types/utils/generateCloudflareDeployUrl.d.ts +10 -0
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-7b8099ed.js → p-08a43211.js} +1 -1
- package/dist/zonos-elements/p-1738fe3f.entry.js +1 -0
- package/dist/zonos-elements/p-284520ae.js +17 -0
- package/dist/zonos-elements/{p-578f42c1.entry.js → p-3225705b.entry.js} +1 -1
- package/dist/zonos-elements/{p-8630168f.system.entry.js → p-3403a81a.system.entry.js} +1 -1
- package/dist/zonos-elements/p-3fb9e320.system.js +17 -0
- package/dist/zonos-elements/{p-acf9a97e.system.entry.js → p-3fd66f5b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-8bf1af28.entry.js → p-57c67bbf.entry.js} +1 -1
- package/dist/zonos-elements/{p-4204ccf9.system.entry.js → p-6d613cee.system.entry.js} +1 -1
- package/dist/zonos-elements/p-7d0663ab.system.entry.js +1 -0
- package/dist/zonos-elements/{p-7bd28076.system.entry.js → p-8949d4a2.system.entry.js} +1 -1
- package/dist/zonos-elements/p-8b02985f.entry.js +1 -0
- package/dist/zonos-elements/p-90935326.system.entry.js +1 -0
- package/dist/zonos-elements/{p-c7952400.entry.js → p-9c9e8288.entry.js} +1 -1
- package/dist/zonos-elements/{p-43d3cafd.system.js → p-a576cbb8.system.js} +1 -1
- package/dist/zonos-elements/p-aa0127b3.system.js +1 -0
- package/dist/zonos-elements/{p-d014791e.entry.js → p-b9815df4.entry.js} +1 -1
- package/dist/zonos-elements/{p-ca0a5c22.system.entry.js → p-c035c64f.system.entry.js} +1 -1
- package/dist/zonos-elements/p-c3ca9e48.system.entry.js +1 -0
- package/dist/zonos-elements/p-c78dd680.system.js +1 -1
- package/dist/zonos-elements/{p-5845029a.system.entry.js → p-d5741e4e.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-8618e185.entry.js → p-d5b21512.entry.js} +1 -1
- package/dist/zonos-elements/{p-37c9fdd2.system.entry.js → p-e4033aa7.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-567b457b.entry.js → p-ea58a4a6.entry.js} +1 -1
- package/dist/zonos-elements/{p-f9754e48.entry.js → p-ed496e98.entry.js} +1 -1
- package/dist/zonos-elements/p-eefeab02.js +1 -0
- package/dist/zonos-elements/p-f25559fd.entry.js +1 -0
- package/dist/zonos-elements/p-f9b50965.system.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/paypal-f4bb6ce7.js +0 -17
- package/dist/esm-es5/sendErrorLog-aea606c0.js +0 -1
- package/dist/zonos-elements/p-0bfe455c.system.entry.js +0 -1
- package/dist/zonos-elements/p-13618b27.system.entry.js +0 -1
- package/dist/zonos-elements/p-29f4cce5.system.js +0 -17
- package/dist/zonos-elements/p-2d01b8e6.system.entry.js +0 -1
- package/dist/zonos-elements/p-3490d40f.js +0 -17
- package/dist/zonos-elements/p-5b9f2535.system.js +0 -1
- package/dist/zonos-elements/p-6f759c76.system.js +0 -1
- package/dist/zonos-elements/p-757166b8.entry.js +0 -1
- package/dist/zonos-elements/p-76291114.entry.js +0 -1
- package/dist/zonos-elements/p-9aef3a35.entry.js +0 -1
- package/dist/zonos-elements/p-d99e58f2.js +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, F as Fragment } from './index-86b8247e.js';
|
|
2
|
-
import { l as localizationStore, s as stripeStoreGetDomesticShippingSession, a as localizationStoreUpdateSelectedCountryCode, b as stripeStoreCleanupDomesticShippingSession, c as stripeStoreSaveDomesticShippingSession, i as initStripeElements,
|
|
3
|
-
import { s as submitGtag, p as paypalInitScript } from './paypal-
|
|
2
|
+
import { l as localizationStore, s as stripeStoreGetDomesticShippingSession, a as localizationStoreUpdateSelectedCountryCode, b as stripeStoreCleanupDomesticShippingSession, c as sendErrorLog, d as stripeStoreSaveDomesticShippingSession, i as initStripeElements, e as cartStore, f as cartStoreUpdateItems, g as cartStoreReset, h as cartStoreResetTabItems, j as cartStoreClearCheckoutInterval, k as stripeStore, m as stripeStoreInitCheckoutSession, n as cartStoreStartCheckoutInterval, o as cartStoreUpdateToErrorState, t as translate, p as stripeStorePrefetchLandedCost, q as cartStoreNextStep, r as stripeStoreHandleInventoryCheck, u as stripeStoreConfirmPayment, v as stripeStoreReset, w as localizationStoreOnUpdate } from './cart-3aae6236.js';
|
|
3
|
+
import { s as submitGtag, p as paypalInitScript } from './paypal-b1589e7b.js';
|
|
4
4
|
import { z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-8fc9ceb2.js';
|
|
5
|
-
import { c as createCustomEvent,
|
|
5
|
+
import { c as createCustomEvent, t as trackConversionEvent, g as getIsTestMode } from './createCustomEvent-ccb20b48.js';
|
|
6
6
|
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
7
7
|
import { l as log, a as logError } from './logError-c456c092.js';
|
|
8
8
|
import { c as classes } from './classes-0d95c529.js';
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-86b8247e.js';
|
|
2
|
-
import {
|
|
2
|
+
import { x as handleFetch, z as isValidSelector, k as stripeStore, A as initLocalizationStore, e as cartStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-3aae6236.js';
|
|
3
3
|
import { z as zonosStore, b as zonosStoreInitSetting, d as zonosStoreFontFamily } from './zonosStore-8fc9ceb2.js';
|
|
4
4
|
import { a as logError, l as log } from './logError-c456c092.js';
|
|
5
5
|
import './isDarkColor-3119e351.js';
|
|
6
6
|
import './getBorderRadius-3ba98361.js';
|
|
7
7
|
|
|
8
8
|
const getZonosSettings = async () => {
|
|
9
|
-
const
|
|
10
|
-
const { errors, json, zonosMode } = await handleFetch(url);
|
|
9
|
+
const { errors, json, zonosMode } = await handleFetch('/api/zonos-elements/zonos-settings');
|
|
11
10
|
if (errors.length) {
|
|
12
11
|
logError(`Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings`);
|
|
13
12
|
return { errors, json: null, zonosMode };
|
|
@@ -165,8 +164,9 @@ const ZonosController = class {
|
|
|
165
164
|
log(`[FONT] Just applied Inter , but no need to inject since we already inject Inter on start`, 'warn');
|
|
166
165
|
zonosStore.appearance = Object.assign(Object.assign({}, zonosStore.appearance), { fontFamily: overrideFont });
|
|
167
166
|
}
|
|
168
|
-
const
|
|
169
|
-
|
|
167
|
+
const searchParams = new URLSearchParams();
|
|
168
|
+
searchParams.set('family', fontSelected);
|
|
169
|
+
const { errors, json } = await handleFetch(`/api/zonos-elements/get-font-detail?${searchParams.toString()}`);
|
|
170
170
|
if (errors.length > 0 || !json) {
|
|
171
171
|
log(`Failed to load font ${fontSelected}`, 'warn');
|
|
172
172
|
return;
|
|
@@ -300,7 +300,7 @@ const ZonosController = class {
|
|
|
300
300
|
zonosStore.organizationName = organizationName;
|
|
301
301
|
}
|
|
302
302
|
render() {
|
|
303
|
-
return h(Host, { key: '
|
|
303
|
+
return h(Host, { key: 'b8a056dc3bbd14495e048a89a11f27a6fb3fdb10', class: "zonos--elements" });
|
|
304
304
|
}
|
|
305
305
|
};
|
|
306
306
|
ZonosController.style = ZonosControllerStyle0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, d as getElement } from './index-86b8247e.js';
|
|
2
|
-
import { l as localizationStore } from './cart-
|
|
2
|
+
import { l as localizationStore } from './cart-3aae6236.js';
|
|
3
3
|
import { d as zonosStoreFontFamily } from './zonosStore-8fc9ceb2.js';
|
|
4
4
|
import { c as classes } from './classes-0d95c529.js';
|
|
5
5
|
import './logError-c456c092.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, d as getElement } from './index-86b8247e.js';
|
|
2
|
-
import { a as localizationStoreUpdateSelectedCountryCode, t as translate, l as localizationStore } from './cart-
|
|
2
|
+
import { a as localizationStoreUpdateSelectedCountryCode, t as translate, l as localizationStore } from './cart-3aae6236.js';
|
|
3
3
|
import { d as zonosStoreFontFamily } from './zonosStore-8fc9ceb2.js';
|
|
4
4
|
import { f as formatStringWithLinks } from './formatStringWithLinks-9e819405.js';
|
|
5
5
|
import { i as isDarkColor } from './isDarkColor-3119e351.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host } from './index-86b8247e.js';
|
|
2
|
-
import { t as translate, l as localizationStore,
|
|
2
|
+
import { t as translate, l as localizationStore, G as currencyFormat } from './cart-3aae6236.js';
|
|
3
3
|
import { z as zonosStore } from './zonosStore-8fc9ceb2.js';
|
|
4
4
|
import { c as classes } from './classes-0d95c529.js';
|
|
5
5
|
import { f as formatStringWithLinks } from './formatStringWithLinks-9e819405.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host } from './index-86b8247e.js';
|
|
2
2
|
import { _ as _root, e as _baseGetTag, i as isObjectLike_1, f as isObject_1, z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-8fc9ceb2.js';
|
|
3
|
-
import {
|
|
3
|
+
import { x as handleFetch, l as localizationStore, z as isValidSelector, t as translate, B as getZCountryUrlParam, C as setZCountryUrlParam, D as currencyDisplay, E as currencyConvertAndFormat, F as currencyConvert, G as currencyFormat } from './cart-3aae6236.js';
|
|
4
4
|
import { c as classes } from './classes-0d95c529.js';
|
|
5
5
|
import { a as logError, l as log } from './logError-c456c092.js';
|
|
6
6
|
import { g as getHasMoreSpaceOnRight } from './getHasMoreSpaceOnRight-70eb913a.js';
|
|
@@ -361,13 +361,12 @@ var debounce_1 = debounce;
|
|
|
361
361
|
|
|
362
362
|
const checkItemRestrictions = async ({ items, shipFrom, shipTo, }) => {
|
|
363
363
|
var _a;
|
|
364
|
-
const url = `${"https://v1.route.js.zonos.com"}/api/zonos-elements/check-item-restrictions`;
|
|
365
364
|
const body = {
|
|
366
365
|
items,
|
|
367
366
|
shipFrom,
|
|
368
367
|
shipTo,
|
|
369
368
|
};
|
|
370
|
-
const { errors, json } = await handleFetch(
|
|
369
|
+
const { errors, json } = await handleFetch('/api/zonos-elements/check-item-restrictions', { body, method: 'POST' });
|
|
371
370
|
if (errors.length || !json) {
|
|
372
371
|
logError(`Error fetching item restrictions: ${(_a = errors.find(Boolean)) === null || _a === void 0 ? void 0 : _a.message}`);
|
|
373
372
|
return [];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host } from './index-86b8247e.js';
|
|
2
|
-
import {
|
|
2
|
+
import { N as localizationStoreUpdateSelectedLocale, t as translate, l as localizationStore } from './cart-3aae6236.js';
|
|
3
3
|
import { d as zonosStoreFontFamily } from './zonosStore-8fc9ceb2.js';
|
|
4
4
|
import { l as languages } from './ILanguage-cd6acb72.js';
|
|
5
5
|
import './logError-c456c092.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, d as getElement, c as createEvent } from './index-86b8247e.js';
|
|
2
2
|
import { d as zonosStoreFontFamily } from './zonosStore-8fc9ceb2.js';
|
|
3
3
|
import { c as classes } from './classes-0d95c529.js';
|
|
4
|
-
import {
|
|
4
|
+
import { k as stripeStore } from './cart-3aae6236.js';
|
|
5
5
|
import { a as logError, l as log } from './logError-c456c092.js';
|
|
6
|
-
import { d as paypalStoreInitButtons } from './paypal-
|
|
6
|
+
import { d as paypalStoreInitButtons } from './paypal-b1589e7b.js';
|
|
7
7
|
import './isDarkColor-3119e351.js';
|
|
8
8
|
import './getBorderRadius-3ba98361.js';
|
|
9
9
|
|