@zonos/elements 1.3.75 → 1.3.77
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-6dd9e3cd.js → cart-307b8dc7.js} +23 -17
- package/dist/cjs/{createCustomEvent-4efb5ab7.js → createCustomEvent-8b7e430f.js} +1 -1
- package/dist/cjs/index.cjs.js +7 -7
- package/dist/cjs/{paypal-f0d2a8cf.js → paypal-f0e6424f.js} +1 -1
- package/dist/cjs/zonos-address_8.cjs.entry.js +1 -1
- package/dist/cjs/zonos-badge_13.cjs.entry.js +3 -3
- package/dist/cjs/zonos-checkout.cjs.entry.js +10 -8
- package/dist/cjs/zonos-controller.cjs.entry.js +3 -3
- 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 +1 -1
- 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 +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +9 -7
- package/dist/collection/components/checkout/zonos-checkout/zonos-review/zonos-review.js +1 -1
- package/dist/collection/components/common/zonos-button/zonos-button.js +4 -4
- package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +2 -2
- package/dist/collection/components/common/zonos-country-flag/zonos-country-flag.js +2 -2
- package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +2 -2
- package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -2
- package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js +4 -4
- package/dist/collection/components/hello/zonos-hello/zonos-hello.js +2 -2
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +2 -2
- package/dist/collection/components/main/zonos-controller.js +4 -4
- package/dist/collection/components/store/checkout/cart.js +4 -4
- package/dist/collection/components/store/checkout/stripe.js +6 -6
- package/dist/collection/components/store/hello/localization.js +11 -5
- package/dist/collection/components/utils/api/prepCalculateLandedCost.js +1 -1
- package/dist/collection/components/utils/checkout/{buildTranslateRequestBody.js → buildTranslateRequest.js} +2 -2
- package/dist/collection/types/checkout/api/CalculateLandedCost.js +1 -0
- package/dist/collection/types/checkout/api/CheckoutSession.js +1 -0
- package/dist/collection/types/checkout/api/Paypal.js +1 -0
- package/dist/collection/types/checkout/api/ValidateAddress.js +1 -0
- package/dist/collection/types/generated/{graphql.customer.types.js → graphql.internal.types.js} +8 -0
- package/dist/collection/types/index.js +9 -1
- package/dist/esm/{cart-66d17f99.js → cart-0345943b.js} +23 -17
- package/dist/esm/{createCustomEvent-4ac32a26.js → createCustomEvent-11fa43d2.js} +1 -1
- package/dist/esm/index.js +7 -7
- package/dist/esm/{paypal-3e2c7b41.js → paypal-7592a690.js} +1 -1
- package/dist/esm/zonos-address_8.entry.js +1 -1
- package/dist/esm/zonos-badge_13.entry.js +3 -3
- package/dist/esm/zonos-checkout.entry.js +10 -8
- package/dist/esm/zonos-controller.entry.js +3 -3
- 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 +1 -1
- 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-66d17f99.js → cart-0345943b.js} +1 -1
- package/dist/esm-es5/{createCustomEvent-4ac32a26.js → createCustomEvent-11fa43d2.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{paypal-3e2c7b41.js → paypal-7592a690.js} +1 -1
- 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.d.ts +51 -50
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.d.ts +1 -1
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.d.ts +1 -1
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +2 -2
- package/dist/types/components/common/zonos-button/zonos-button.d.ts +1 -1
- package/dist/types/components/common/zonos-checkbox/zonos-checkbox.d.ts +1 -1
- package/dist/types/components/common/zonos-country-flag/zonos-country-flag.d.ts +1 -1
- package/dist/types/components/common/zonos-dialog/zonos-dialog.d.ts +1 -1
- package/dist/types/components/common/zonos-logo/zonos-logo.d.ts +1 -1
- package/dist/types/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.d.ts +1 -1
- package/dist/types/components/hello/zonos-hello/zonos-hello.d.ts +1 -1
- package/dist/types/components/hello/zonos-hello-dialog/zonos-hello-dialog.d.ts +1 -1
- package/dist/types/components/main/zonos-controller.d.ts +1 -1
- package/dist/types/components/store/checkout/cart.d.ts +8 -8
- package/dist/types/components/store/checkout/paypal.d.ts +1 -1
- package/dist/types/components/store/checkout/stripe.d.ts +3 -15
- package/dist/types/components/store/hello/localization.d.ts +1 -1
- package/dist/types/components/store/zonosStore.d.ts +1 -1
- package/dist/types/components/utils/api/calculateLandedCost.d.ts +1 -1
- package/dist/types/components/utils/api/calculateLandedCostNormalized.d.ts +1 -1
- package/dist/types/components/utils/api/cartCalculateLandedCost.d.ts +1 -1
- package/dist/types/components/utils/api/checkItemRestrictions.d.ts +4 -13
- package/dist/types/components/utils/api/getInclusivePricing.d.ts +1 -1
- package/dist/types/components/utils/api/getShippingZones.d.ts +1 -1
- package/dist/types/components/utils/api/getZonosSettings.d.ts +1 -1
- package/dist/types/components/utils/api/paypalCaptureOrder.d.ts +3 -7
- package/dist/types/components/utils/api/paypalCreateOrder.d.ts +3 -6
- package/dist/types/components/utils/api/prepCalculateLandedCost.d.ts +1 -1
- package/dist/types/components/utils/api/trackConversionEvent.d.ts +1 -2
- package/dist/types/components/utils/api/triggerBuildLandedCost.d.ts +2 -2
- package/dist/types/components/utils/checkout/{buildTranslateRequestBody.d.ts → buildTranslateRequest.d.ts} +3 -3
- package/dist/types/components/utils/getBorderRadius.d.ts +1 -1
- package/dist/types/components/utils/hello/currencyConversion/currencyFormat.d.ts +1 -1
- package/dist/types/components/utils/hello/currencyConversion/getCurrencyCode.d.ts +1 -1
- package/dist/types/components/utils/hello/currencyConversion/numberFormat.d.ts +1 -1
- package/dist/types/components/utils/hello/detectItemRestrictions.d.ts +2 -2
- package/dist/types/components/utils/hello/initHello.d.ts +1 -1
- package/dist/types/components/utils/logging/sendLoadScriptLog.d.ts +2 -2
- package/dist/types/components.d.ts +2 -2
- package/dist/types/scripts/_zonosBase.d.ts +1 -1
- package/dist/types/scripts/cart/_setupCartData.d.ts +1 -1
- package/dist/types/styles/stripe/addressRuleStyle.d.ts +1 -1
- package/dist/types/styles/stripe/defaultVariable.d.ts +1 -1
- package/dist/types/types/ConversionEvent.d.ts +12 -0
- package/dist/types/types/ICountryJson.d.ts +1 -1
- package/dist/types/types/{LogErrorRequestBody.d.ts → LogError.d.ts} +1 -1
- package/dist/types/types/{LogLoadScriptRequestBody.d.ts → LogLoadScript.d.ts} +1 -1
- package/dist/types/types/Version.d.ts +12 -0
- package/dist/types/types/checkout/CheckoutConfig.d.ts +1 -1
- package/dist/types/types/checkout/TranslatedText.d.ts +1 -1
- package/dist/types/types/checkout/api/{CalculateLandedCostRequest.d.ts → CalculateLandedCost.d.ts} +12 -11
- package/dist/types/types/checkout/api/CheckoutSession.d.ts +30 -0
- package/dist/types/types/checkout/api/NormalizedTempCart.d.ts +1 -1
- package/dist/types/types/checkout/api/Paypal.d.ts +8 -0
- package/dist/types/types/checkout/api/{ValidateAddressRequest.d.ts → ValidateAddress.d.ts} +2 -2
- package/dist/types/types/generated/{graphql.customer.types.d.ts → graphql.internal.types.d.ts} +10 -0
- package/dist/types/types/generated/{graphql.customer.types.ts → graphql.internal.types.ts} +14 -0
- package/dist/types/types/hello/HelloConfig.d.ts +1 -1
- package/dist/types/types/hello/RestrictedItem.d.ts +10 -1
- package/dist/types/types/index.d.ts +9 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/p-05001ce2.entry.js +1 -0
- package/dist/zonos-elements/{p-c86fa519.system.js → p-2f9e087c.system.js} +1 -1
- package/dist/zonos-elements/{p-3088517c.system.js → p-320e3627.system.js} +2 -2
- package/dist/zonos-elements/{p-0d719ad2.system.js → p-3b78b5db.system.js} +1 -1
- package/dist/zonos-elements/{p-325233e3.js → p-4e21f719.js} +2 -2
- package/dist/zonos-elements/{p-432a5555.system.entry.js → p-514b94ec.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-6488e805.system.entry.js → p-54d31641.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-01a8ec15.system.entry.js → p-55020546.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-ea340dbf.entry.js → p-70acd15f.entry.js} +1 -1
- package/dist/zonos-elements/{p-dbbf8d3e.system.js → p-71382e47.system.js} +1 -1
- package/dist/zonos-elements/{p-ffaef730.js → p-76b9668f.js} +1 -1
- package/dist/zonos-elements/{p-bc803391.system.entry.js → p-78abda17.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-d0ae7ede.system.entry.js → p-794b932c.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-b6e58c30.js → p-8478f4ee.js} +1 -1
- package/dist/zonos-elements/{p-0a411ee0.system.entry.js → p-8915c7ff.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-1b101d0f.entry.js → p-94d92a0b.entry.js} +1 -1
- package/dist/zonos-elements/{p-0819aa2d.system.entry.js → p-9a88fb19.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-882d2619.entry.js → p-a57f0556.entry.js} +1 -1
- package/dist/zonos-elements/{p-3ec5cfe1.entry.js → p-be6c49ec.entry.js} +1 -1
- package/dist/zonos-elements/{p-438ac9d0.entry.js → p-c6e90e75.entry.js} +1 -1
- package/dist/zonos-elements/p-c78dd680.system.js +1 -1
- package/dist/zonos-elements/{p-b362e3c9.entry.js → p-cab296cc.entry.js} +1 -1
- package/dist/zonos-elements/{p-72345655.entry.js → p-cf61027a.entry.js} +1 -1
- package/dist/zonos-elements/{p-999c1c0b.entry.js → p-dc430b34.entry.js} +1 -1
- package/dist/zonos-elements/{p-bad47d15.system.entry.js → p-e3068a5f.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-ac3cd38e.system.entry.js → p-eacd1669.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-a6223def.system.entry.js → p-f7965bc8.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-ea124e18.entry.js → p-f8cbd1b8.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +2 -1
- package/dist/zonos-elements/p-913efe84.entry.js +0 -1
- /package/dist/collection/types/{LogErrorRequestBody.js → ConversionEvent.js} +0 -0
- /package/dist/collection/types/{LogLoadScriptRequestBody.js → LogError.js} +0 -0
- /package/dist/collection/types/{checkout/api/CalculateLandedCostRequest.js → LogLoadScript.js} +0 -0
- /package/dist/collection/types/{checkout/api/ValidateAddressRequest.js → Version.js} +0 -0
|
@@ -162,7 +162,7 @@ const cartStoreSetCheckoutSession = (checkoutSession) => {
|
|
|
162
162
|
cartStore.externalConfirmationPageURL = externalConfirmationPageURL;
|
|
163
163
|
}
|
|
164
164
|
};
|
|
165
|
-
const cartStoreReCalculateTotal = async ({
|
|
165
|
+
const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency, itemsAmount, landedCostId, }) => {
|
|
166
166
|
if (landedCostId && cartStore.selectedLandedCost) {
|
|
167
167
|
// update cart total right away if we have landed cost id to avoid order total flickering
|
|
168
168
|
const subtotals = cartStore.selectedLandedCost.subtotals;
|
|
@@ -175,7 +175,7 @@ const cartStoreReCalculateTotal = async ({ adjustmentAmount, cartId, currency, i
|
|
|
175
175
|
return false;
|
|
176
176
|
}
|
|
177
177
|
const { errors, json } = await stripeStoreUpdateCheckoutSession({
|
|
178
|
-
|
|
178
|
+
adjustmentsAmount,
|
|
179
179
|
cartId,
|
|
180
180
|
currency,
|
|
181
181
|
id: cartStore.checkoutSessionId,
|
|
@@ -229,7 +229,7 @@ const cartStoreUpdateSelectedShippingOption = async (selectedShippingOption, lan
|
|
|
229
229
|
cartStore.isSelectedShippingGuarantee = isGuarantee;
|
|
230
230
|
// update session with selected landed cost
|
|
231
231
|
const updateCalculateStatus = await cartStoreReCalculateTotal({
|
|
232
|
-
|
|
232
|
+
adjustmentsAmount: cartStore.adjustmentTotal,
|
|
233
233
|
cartId: window.Zonos.cartId,
|
|
234
234
|
landedCostId: (_e = selectedLandedCost.landedCost) === null || _e === void 0 ? void 0 : _e.id,
|
|
235
235
|
});
|
|
@@ -288,7 +288,7 @@ const cartStoreUpdateItems = async ({ adjustments, cartItems, }) => {
|
|
|
288
288
|
// set loading state here because this is the first load checkout session when we already have checkout session id stored
|
|
289
289
|
stripeStore.isFetchingSession = true;
|
|
290
290
|
await cartStoreReCalculateTotal({
|
|
291
|
-
|
|
291
|
+
adjustmentsAmount: adjustmentTotal,
|
|
292
292
|
cartId: window.Zonos.cartId,
|
|
293
293
|
currency: currency,
|
|
294
294
|
itemsAmount: total,
|
|
@@ -4,7 +4,7 @@ import { localizationStore } from "../hello/localization";
|
|
|
4
4
|
import { translate } from "../translationStore";
|
|
5
5
|
import { zonosStore } from "../zonosStore";
|
|
6
6
|
import { calculateLandedCostNormalized } from "../../utils/api/calculateLandedCostNormaliz";
|
|
7
|
-
import {
|
|
7
|
+
import { buildTranslateRequest } from "../../utils/checkout/buildTranslateRequest";
|
|
8
8
|
import { handleFetch } from "../../utils/handleFetch";
|
|
9
9
|
import { isDarkColor } from "../../utils/isDarkColor";
|
|
10
10
|
import { jsonParse } from "../../utils/jsonParse";
|
|
@@ -361,7 +361,7 @@ const stripeStoreInitCheckoutSession = async () => {
|
|
|
361
361
|
stripeStore.isFetchingSession = true;
|
|
362
362
|
const { errors, json } = await handleFetch('/api/zonos-elements/create-checkout-session', {
|
|
363
363
|
body: {
|
|
364
|
-
|
|
364
|
+
adjustmentsAmount: cartStore.adjustments.reduce((prev, adj) => prev + adj.amount, 0),
|
|
365
365
|
cartId: window.Zonos.cartId,
|
|
366
366
|
currency: ((_a = cartStore.items.find(Boolean)) === null || _a === void 0 ? void 0 : _a.currencyCode) || '',
|
|
367
367
|
itemsAmount: total,
|
|
@@ -372,7 +372,7 @@ const stripeStoreInitCheckoutSession = async () => {
|
|
|
372
372
|
});
|
|
373
373
|
stripeStore.isFetchingSession = false;
|
|
374
374
|
if (errors.length || !json) {
|
|
375
|
-
logError('Error
|
|
375
|
+
logError('Error occured when creating checkout session', JSON.stringify(errors, null, 2));
|
|
376
376
|
return false;
|
|
377
377
|
}
|
|
378
378
|
const result = json.checkoutSessionCreate;
|
|
@@ -387,12 +387,12 @@ const stripeStoreInitCheckoutSession = async () => {
|
|
|
387
387
|
/**
|
|
388
388
|
* Update checkout session. Use for updating amount with landed cost id, or update session when cart items change
|
|
389
389
|
*/
|
|
390
|
-
const stripeStoreUpdateCheckoutSession = async ({
|
|
390
|
+
const stripeStoreUpdateCheckoutSession = async ({ adjustmentsAmount, cartId, currency, id, itemsAmount, landedCostId, presentmentCountryCode, }) => {
|
|
391
391
|
// No need to set loading state here because this function will be called under the hood to update
|
|
392
392
|
// landed cost id for the section.
|
|
393
393
|
const { errors, json } = await handleFetch('/api/zonos-elements/update-checkout-session', {
|
|
394
394
|
body: {
|
|
395
|
-
|
|
395
|
+
adjustmentsAmount,
|
|
396
396
|
cartId,
|
|
397
397
|
currency,
|
|
398
398
|
id,
|
|
@@ -471,7 +471,7 @@ const buildTranslatedAddress = ({ currentAddress, translatedAddressResult, }) =>
|
|
|
471
471
|
*/
|
|
472
472
|
const stripeStoreTranslateAddressToLatin = async ({ addressInvalidCharactersList, billingAddressInvalidCharactersList, }) => {
|
|
473
473
|
var _a, _b, _c, _d;
|
|
474
|
-
const requestBody =
|
|
474
|
+
const requestBody = buildTranslateRequest({
|
|
475
475
|
addressInvalidCharactersList,
|
|
476
476
|
billingAddressInvalidCharactersList,
|
|
477
477
|
stripeAddressEventData: stripeStore.stripeAddressEventData,
|
|
@@ -60,11 +60,17 @@ const getNewLocalization = async () => {
|
|
|
60
60
|
var _a;
|
|
61
61
|
log('get new localization store');
|
|
62
62
|
const { isDisabledCountry, isShippableCountry, selectedCountryCode } = localizationStore;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
if (!window.Zonos.isLegacyCheckout) {
|
|
64
|
+
// These requests are only needed for Hello, so we can skip them for legacy checkout
|
|
65
|
+
localizationStore.countryLandedCost = await getCountryLandedCost(localizationStore.selectedCountryCode);
|
|
66
|
+
localizationStore.inclusivePricing =
|
|
67
|
+
((_a = (await getInclusivePricing(selectedCountryCode))) === null || _a === void 0 ? void 0 : _a.setting) || null;
|
|
68
|
+
if (localizationStore.inclusivePricing) {
|
|
69
|
+
log(`Inclusive price setting found for this country (${selectedCountryCode}) ${JSON.stringify(localizationStore.inclusivePricing, null, 2)}`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
log('Skipping country landed cost and inclusive pricing requests, because this is a legacy checkout');
|
|
68
74
|
}
|
|
69
75
|
if (zonosStore.helloSettings.currencyBehavior === 'DISABLED' ||
|
|
70
76
|
!isShippableCountry ||
|
|
@@ -10,7 +10,7 @@ const getTranslatedAddress = ({ currentAddress, translatedAddress, }) => {
|
|
|
10
10
|
[currentAddress.value.firstName, currentAddress.value.lastName].join(' ');
|
|
11
11
|
return {
|
|
12
12
|
city: ((_a = translatedAddress.city) === null || _a === void 0 ? void 0 : _a[city]) || city,
|
|
13
|
-
country,
|
|
13
|
+
country: country,
|
|
14
14
|
line1: ((_b = translatedAddress.line1) === null || _b === void 0 ? void 0 : _b[line1]) || line1,
|
|
15
15
|
line2: ((_c = translatedAddress.line2) === null || _c === void 0 ? void 0 : _c[line2 || '']) || line2 || '',
|
|
16
16
|
name: ((_d = translatedAddress.name) === null || _d === void 0 ? void 0 : _d[name]) || name,
|
|
@@ -49,9 +49,9 @@ const getExcludeAddressFieldsObject = ({ address, invalidAdddressList, }) => {
|
|
|
49
49
|
* @param {StripeAddressEventData} params.stripeBillingAddressEventData - The Stripe event data for the billing address.
|
|
50
50
|
* @param {boolean} params.stripeShippingSameAsBilling - A flag indicating whether the shipping address is the same as the billing address.
|
|
51
51
|
*
|
|
52
|
-
* @returns {
|
|
52
|
+
* @returns {ValidateAddressRequest | null} - An object that contains the address fields that have invalid characters, the destination country, and the first and last name. If the conditions are not met, the function returns null.
|
|
53
53
|
*/
|
|
54
|
-
export const
|
|
54
|
+
export const buildTranslateRequest = ({ addressInvalidCharactersList, billingAddressInvalidCharactersList, stripeAddressEventData, stripeBillingAddressEventData, stripeShippingSameAsBilling, }) => {
|
|
55
55
|
var _a, _b, _c, _d;
|
|
56
56
|
const isStripeAddressReady = !!(stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.complete);
|
|
57
57
|
const isStripeBillingAddressReady = stripeShippingSameAsBilling
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/collection/types/generated/{graphql.customer.types.js → graphql.internal.types.js}
RENAMED
|
@@ -43,6 +43,10 @@ export const adjustmentRecordType = {
|
|
|
43
43
|
CreditNote: 'CREDIT_NOTE',
|
|
44
44
|
InvoiceLineRecord: 'INVOICE_LINE_RECORD',
|
|
45
45
|
};
|
|
46
|
+
export const adjustmentSource = {
|
|
47
|
+
ApiRequest: 'API_REQUEST',
|
|
48
|
+
PromoCode: 'PROMO_CODE',
|
|
49
|
+
};
|
|
46
50
|
export const adjustmentType = {
|
|
47
51
|
Charge: 'CHARGE',
|
|
48
52
|
Credit: 'CREDIT',
|
|
@@ -1764,6 +1768,10 @@ export const matchType = {
|
|
|
1764
1768
|
NoMatch: 'NO_MATCH',
|
|
1765
1769
|
PartialMatch: 'PARTIAL_MATCH',
|
|
1766
1770
|
};
|
|
1771
|
+
export const merchantOfRecordType = {
|
|
1772
|
+
Merchant: 'MERCHANT',
|
|
1773
|
+
Zonos: 'ZONOS',
|
|
1774
|
+
};
|
|
1767
1775
|
export const mode = {
|
|
1768
1776
|
Live: 'LIVE',
|
|
1769
1777
|
Test: 'TEST',
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
|
|
2
2
|
import "./global.d";
|
|
3
3
|
export * from '../components.d';
|
|
4
|
-
export * from './checkout/api/
|
|
4
|
+
export * from './checkout/api/CalculateLandedCost';
|
|
5
|
+
export * from './checkout/api/CheckoutSession';
|
|
6
|
+
export * from './checkout/api/NormalizedTempCart';
|
|
7
|
+
export * from './checkout/api/Paypal';
|
|
8
|
+
export * from './checkout/api/ValidateAddress';
|
|
5
9
|
export * from './checkout/CheckoutConfig';
|
|
10
|
+
export * from './ConversionEvent';
|
|
6
11
|
export * from './hello/HelloConfig';
|
|
7
12
|
export * from './JsonError';
|
|
13
|
+
export * from './LogError';
|
|
14
|
+
export * from './LogLoadScript';
|
|
8
15
|
export * from './NoInfer';
|
|
9
16
|
export * from './stripe/Apperance';
|
|
10
17
|
export * from './Translation';
|
|
11
18
|
export * from './utils/deep/IDeepKeyof';
|
|
12
19
|
export * from './utils/deep/IDeepKeyofAtIndex';
|
|
20
|
+
export * from './Version';
|
|
@@ -7842,11 +7842,17 @@ const getNewLocalization = async () => {
|
|
|
7842
7842
|
var _a;
|
|
7843
7843
|
log('get new localization store');
|
|
7844
7844
|
const { isDisabledCountry, isShippableCountry, selectedCountryCode } = localizationStore;
|
|
7845
|
-
|
|
7846
|
-
|
|
7847
|
-
|
|
7848
|
-
|
|
7849
|
-
|
|
7845
|
+
if (!window.Zonos.isLegacyCheckout) {
|
|
7846
|
+
// These requests are only needed for Hello, so we can skip them for legacy checkout
|
|
7847
|
+
localizationStore.countryLandedCost = await getCountryLandedCost(localizationStore.selectedCountryCode);
|
|
7848
|
+
localizationStore.inclusivePricing =
|
|
7849
|
+
((_a = (await getInclusivePricing(selectedCountryCode))) === null || _a === void 0 ? void 0 : _a.setting) || null;
|
|
7850
|
+
if (localizationStore.inclusivePricing) {
|
|
7851
|
+
log(`Inclusive price setting found for this country (${selectedCountryCode}) ${JSON.stringify(localizationStore.inclusivePricing, null, 2)}`);
|
|
7852
|
+
}
|
|
7853
|
+
}
|
|
7854
|
+
else {
|
|
7855
|
+
log('Skipping country landed cost and inclusive pricing requests, because this is a legacy checkout');
|
|
7850
7856
|
}
|
|
7851
7857
|
if (zonosStore.helloSettings.currencyBehavior === 'DISABLED' ||
|
|
7852
7858
|
!isShippableCountry ||
|
|
@@ -8025,7 +8031,7 @@ const getTranslatedAddress = ({ currentAddress, translatedAddress, }) => {
|
|
|
8025
8031
|
[currentAddress.value.firstName, currentAddress.value.lastName].join(' ');
|
|
8026
8032
|
return {
|
|
8027
8033
|
city: ((_a = translatedAddress.city) === null || _a === void 0 ? void 0 : _a[city]) || city,
|
|
8028
|
-
country,
|
|
8034
|
+
country: country,
|
|
8029
8035
|
line1: ((_b = translatedAddress.line1) === null || _b === void 0 ? void 0 : _b[line1]) || line1,
|
|
8030
8036
|
line2: ((_c = translatedAddress.line2) === null || _c === void 0 ? void 0 : _c[line2 || '']) || line2 || '',
|
|
8031
8037
|
name: ((_d = translatedAddress.name) === null || _d === void 0 ? void 0 : _d[name]) || name,
|
|
@@ -8314,9 +8320,9 @@ const getExcludeAddressFieldsObject = ({ address, invalidAdddressList, }) => {
|
|
|
8314
8320
|
* @param {StripeAddressEventData} params.stripeBillingAddressEventData - The Stripe event data for the billing address.
|
|
8315
8321
|
* @param {boolean} params.stripeShippingSameAsBilling - A flag indicating whether the shipping address is the same as the billing address.
|
|
8316
8322
|
*
|
|
8317
|
-
* @returns {
|
|
8323
|
+
* @returns {ValidateAddressRequest | null} - An object that contains the address fields that have invalid characters, the destination country, and the first and last name. If the conditions are not met, the function returns null.
|
|
8318
8324
|
*/
|
|
8319
|
-
const
|
|
8325
|
+
const buildTranslateRequest = ({ addressInvalidCharactersList, billingAddressInvalidCharactersList, stripeAddressEventData, stripeBillingAddressEventData, stripeShippingSameAsBilling, }) => {
|
|
8320
8326
|
var _a, _b, _c, _d;
|
|
8321
8327
|
const isStripeAddressReady = !!(stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.complete);
|
|
8322
8328
|
const isStripeBillingAddressReady = stripeShippingSameAsBilling
|
|
@@ -8768,7 +8774,7 @@ const stripeStoreInitCheckoutSession = async () => {
|
|
|
8768
8774
|
stripeStore.isFetchingSession = true;
|
|
8769
8775
|
const { errors, json } = await handleFetch('/api/zonos-elements/create-checkout-session', {
|
|
8770
8776
|
body: {
|
|
8771
|
-
|
|
8777
|
+
adjustmentsAmount: cartStore.adjustments.reduce((prev, adj) => prev + adj.amount, 0),
|
|
8772
8778
|
cartId: window.Zonos.cartId,
|
|
8773
8779
|
currency: ((_a = cartStore.items.find(Boolean)) === null || _a === void 0 ? void 0 : _a.currencyCode) || '',
|
|
8774
8780
|
itemsAmount: total,
|
|
@@ -8779,7 +8785,7 @@ const stripeStoreInitCheckoutSession = async () => {
|
|
|
8779
8785
|
});
|
|
8780
8786
|
stripeStore.isFetchingSession = false;
|
|
8781
8787
|
if (errors.length || !json) {
|
|
8782
|
-
logError('Error
|
|
8788
|
+
logError('Error occured when creating checkout session', JSON.stringify(errors, null, 2));
|
|
8783
8789
|
return false;
|
|
8784
8790
|
}
|
|
8785
8791
|
const result = json.checkoutSessionCreate;
|
|
@@ -8794,12 +8800,12 @@ const stripeStoreInitCheckoutSession = async () => {
|
|
|
8794
8800
|
/**
|
|
8795
8801
|
* Update checkout session. Use for updating amount with landed cost id, or update session when cart items change
|
|
8796
8802
|
*/
|
|
8797
|
-
const stripeStoreUpdateCheckoutSession = async ({
|
|
8803
|
+
const stripeStoreUpdateCheckoutSession = async ({ adjustmentsAmount, cartId, currency, id, itemsAmount, landedCostId, presentmentCountryCode, }) => {
|
|
8798
8804
|
// No need to set loading state here because this function will be called under the hood to update
|
|
8799
8805
|
// landed cost id for the section.
|
|
8800
8806
|
const { errors, json } = await handleFetch('/api/zonos-elements/update-checkout-session', {
|
|
8801
8807
|
body: {
|
|
8802
|
-
|
|
8808
|
+
adjustmentsAmount,
|
|
8803
8809
|
cartId,
|
|
8804
8810
|
currency,
|
|
8805
8811
|
id,
|
|
@@ -8878,7 +8884,7 @@ const buildTranslatedAddress = ({ currentAddress, translatedAddressResult, }) =>
|
|
|
8878
8884
|
*/
|
|
8879
8885
|
const stripeStoreTranslateAddressToLatin = async ({ addressInvalidCharactersList, billingAddressInvalidCharactersList, }) => {
|
|
8880
8886
|
var _a, _b, _c, _d;
|
|
8881
|
-
const requestBody =
|
|
8887
|
+
const requestBody = buildTranslateRequest({
|
|
8882
8888
|
addressInvalidCharactersList,
|
|
8883
8889
|
billingAddressInvalidCharactersList,
|
|
8884
8890
|
stripeAddressEventData: stripeStore.stripeAddressEventData,
|
|
@@ -9102,7 +9108,7 @@ const cartStoreSetCheckoutSession = (checkoutSession) => {
|
|
|
9102
9108
|
cartStore.externalConfirmationPageURL = externalConfirmationPageURL;
|
|
9103
9109
|
}
|
|
9104
9110
|
};
|
|
9105
|
-
const cartStoreReCalculateTotal = async ({
|
|
9111
|
+
const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency, itemsAmount, landedCostId, }) => {
|
|
9106
9112
|
if (landedCostId && cartStore.selectedLandedCost) {
|
|
9107
9113
|
// update cart total right away if we have landed cost id to avoid order total flickering
|
|
9108
9114
|
const subtotals = cartStore.selectedLandedCost.subtotals;
|
|
@@ -9115,7 +9121,7 @@ const cartStoreReCalculateTotal = async ({ adjustmentAmount, cartId, currency, i
|
|
|
9115
9121
|
return false;
|
|
9116
9122
|
}
|
|
9117
9123
|
const { errors, json } = await stripeStoreUpdateCheckoutSession({
|
|
9118
|
-
|
|
9124
|
+
adjustmentsAmount,
|
|
9119
9125
|
cartId,
|
|
9120
9126
|
currency,
|
|
9121
9127
|
id: cartStore.checkoutSessionId,
|
|
@@ -9169,7 +9175,7 @@ const cartStoreUpdateSelectedShippingOption = async (selectedShippingOption, lan
|
|
|
9169
9175
|
cartStore.isSelectedShippingGuarantee = isGuarantee;
|
|
9170
9176
|
// update session with selected landed cost
|
|
9171
9177
|
const updateCalculateStatus = await cartStoreReCalculateTotal({
|
|
9172
|
-
|
|
9178
|
+
adjustmentsAmount: cartStore.adjustmentTotal,
|
|
9173
9179
|
cartId: window.Zonos.cartId,
|
|
9174
9180
|
landedCostId: (_e = selectedLandedCost.landedCost) === null || _e === void 0 ? void 0 : _e.id,
|
|
9175
9181
|
});
|
|
@@ -9228,7 +9234,7 @@ const cartStoreUpdateItems = async ({ adjustments, cartItems, }) => {
|
|
|
9228
9234
|
// set loading state here because this is the first load checkout session when we already have checkout session id stored
|
|
9229
9235
|
stripeStore.isFetchingSession = true;
|
|
9230
9236
|
await cartStoreReCalculateTotal({
|
|
9231
|
-
|
|
9237
|
+
adjustmentsAmount: adjustmentTotal,
|
|
9232
9238
|
cartId: window.Zonos.cartId,
|
|
9233
9239
|
currency: currency,
|
|
9234
9240
|
itemsAmount: total,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as cartStore, l as localizationStore } from './cart-
|
|
1
|
+
import { d as cartStore, l as localizationStore } from './cart-0345943b.js';
|
|
2
2
|
import { z as zonosStore } from './zonosStore-0dc7a947.js';
|
|
3
3
|
import { h as handleFetch } from './handleFetch-80ecfb91.js';
|
|
4
4
|
|
package/dist/esm/index.js
CHANGED
|
@@ -94,7 +94,7 @@ const getZonosQaUrl = () => {
|
|
|
94
94
|
return null;
|
|
95
95
|
}
|
|
96
96
|
const qaUrl = extractZonosQaUrl(window.location.href);
|
|
97
|
-
const cdnUrl = "https://v1.3.
|
|
97
|
+
const cdnUrl = "https://v1.3.77.js.zonos.com";
|
|
98
98
|
// when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
|
|
99
99
|
if (!qaUrl &&
|
|
100
100
|
(cdnUrl.includes('test.') ||
|
|
@@ -278,10 +278,10 @@ const zonosLoadUrl = (() => {
|
|
|
278
278
|
}
|
|
279
279
|
return null;
|
|
280
280
|
})();
|
|
281
|
-
const ZONOS_URL = "https://v1.3.
|
|
282
|
-
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.
|
|
283
|
-
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.
|
|
284
|
-
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.
|
|
281
|
+
const ZONOS_URL = "https://v1.3.77.js.zonos.com";
|
|
282
|
+
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.77";
|
|
283
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.77";
|
|
284
|
+
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.77";
|
|
285
285
|
const INTER_FONT_URL = 'https://rsms.me';
|
|
286
286
|
const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
|
|
287
287
|
const INTER_FONT_REGEX = /^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;
|
|
@@ -296,7 +296,7 @@ Zonos.zonosConversionTest = typeof window !== 'undefined' &&
|
|
|
296
296
|
!!window.location.search.match(/\?.*(&*)zonosConversionTest/);
|
|
297
297
|
Zonos._paypalMockResponse = null;
|
|
298
298
|
Zonos.isBigCommerce = false;
|
|
299
|
-
Zonos.releaseDate = "
|
|
299
|
+
Zonos.releaseDate = "1728578161999";
|
|
300
300
|
Zonos.isLegacyCheckout = false;
|
|
301
301
|
/**
|
|
302
302
|
* By default, the package will load from npm
|
|
@@ -304,7 +304,7 @@ Zonos.isLegacyCheckout = false;
|
|
|
304
304
|
Zonos.isNpm = true;
|
|
305
305
|
Zonos.zonosQaUrl = null;
|
|
306
306
|
Zonos.zonosQaUrlApi = null;
|
|
307
|
-
Zonos.version = `v${"1.3.
|
|
307
|
+
Zonos.version = `v${"1.3.77"}`;
|
|
308
308
|
Zonos.modeAlerted = false;
|
|
309
309
|
Zonos.cartData = null;
|
|
310
310
|
Zonos.paypal = null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z as zonosStore, c as createStore } from './zonosStore-0dc7a947.js';
|
|
2
|
-
import { d as cartStore, r as stripeStoreHandleInventoryCheck, t as translate, q as cartStoreNextStep, h as cartStoreClearCheckoutInterval } from './cart-
|
|
2
|
+
import { d as cartStore, r as stripeStoreHandleInventoryCheck, t as translate, q as cartStoreNextStep, h as cartStoreClearCheckoutInterval } from './cart-0345943b.js';
|
|
3
3
|
import { h as handleFetch, l as log, a as logError, j as jsonParse } from './handleFetch-80ecfb91.js';
|
|
4
4
|
import { t as tinycolor } from './isDarkColor-b3afa948.js';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, d as getElement } from './index-86b8247e.js';
|
|
2
|
-
import { j as stripeStore, l as localizationStore, t as translate } from './cart-
|
|
2
|
+
import { j as stripeStore, l as localizationStore, t as translate } from './cart-0345943b.js';
|
|
3
3
|
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
4
4
|
import { a as logError } from './handleFetch-80ecfb91.js';
|
|
5
5
|
import { i as isTextContainsNonLatinChars, c as containsNonLatinChars } from './containsNonLatinChars-2d8810c3.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, a as getAssetPath, F as Fragment, c as createEvent, d as getElement } from './index-86b8247e.js';
|
|
2
2
|
import { d as zonosStoreFontFamily, z as zonosStore, g as getZonosStoreTheme } from './zonosStore-0dc7a947.js';
|
|
3
3
|
import { c as classes } from './classes-0d95c529.js';
|
|
4
|
-
import { d as cartStore, E as currencyFormat, F as cartStoreHasOneEligibleItem, t as translate, v as stripeStoreReset, j as stripeStore, G as stripeStoreRetrievePayment, H as stripeStoreMessageBasedOnStatus, l as localizationStore, I as stripeStoreTranslateAddressToLatin, J as cartStoreUpdateSelectedShippingOption, K as cartStoreGetShippingTransitInfo } from './cart-
|
|
5
|
-
import { s as submitGtag, a as paypalStore, b as paypalStoreReset, c as paypalStoreHasPaypalEnabled, i as isContrastColor } from './paypal-
|
|
6
|
-
import { t as trackConversionEvent, c as createCustomEvent, g as getIsTestMode } from './createCustomEvent-
|
|
4
|
+
import { d as cartStore, E as currencyFormat, F as cartStoreHasOneEligibleItem, t as translate, v as stripeStoreReset, j as stripeStore, G as stripeStoreRetrievePayment, H as stripeStoreMessageBasedOnStatus, l as localizationStore, I as stripeStoreTranslateAddressToLatin, J as cartStoreUpdateSelectedShippingOption, K as cartStoreGetShippingTransitInfo } from './cart-0345943b.js';
|
|
5
|
+
import { s as submitGtag, a as paypalStore, b as paypalStoreReset, c as paypalStoreHasPaypalEnabled, i as isContrastColor } from './paypal-7592a690.js';
|
|
6
|
+
import { t as trackConversionEvent, c as createCustomEvent, g as getIsTestMode } from './createCustomEvent-11fa43d2.js';
|
|
7
7
|
import { g as getBorderRadius } from './getBorderRadius-cff1e39b.js';
|
|
8
8
|
import { h as handleFetch, s as sendErrorLog } from './handleFetch-80ecfb91.js';
|
|
9
9
|
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
@@ -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, d as cartStore, e as cartStoreUpdateItems, f as cartStoreReset, g as cartStoreResetTabItems, h as cartStoreClearCheckoutInterval, j as stripeStore, k as stripeStoreInitCheckoutSession, m as cartStoreStartCheckoutInterval, n as cartStoreUpdateToErrorState, t as translate, o as cartStoreSetCheckoutSession, p as stripeStorePrefetchLandedCost, q as cartStoreNextStep, r as stripeStoreHandleInventoryCheck, u as stripeStoreConfirmPayment, v as stripeStoreReset, w as localizationStoreOnUpdate } from './cart-
|
|
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 stripeStoreSaveDomesticShippingSession, i as initStripeElements, d as cartStore, e as cartStoreUpdateItems, f as cartStoreReset, g as cartStoreResetTabItems, h as cartStoreClearCheckoutInterval, j as stripeStore, k as stripeStoreInitCheckoutSession, m as cartStoreStartCheckoutInterval, n as cartStoreUpdateToErrorState, t as translate, o as cartStoreSetCheckoutSession, p as stripeStorePrefetchLandedCost, q as cartStoreNextStep, r as stripeStoreHandleInventoryCheck, u as stripeStoreConfirmPayment, v as stripeStoreReset, w as localizationStoreOnUpdate } from './cart-0345943b.js';
|
|
3
|
+
import { s as submitGtag, p as paypalInitScript } from './paypal-7592a690.js';
|
|
4
4
|
import { z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-0dc7a947.js';
|
|
5
|
-
import { c as createCustomEvent, t as trackConversionEvent, g as getIsTestMode } from './createCustomEvent-
|
|
5
|
+
import { c as createCustomEvent, t as trackConversionEvent, g as getIsTestMode } from './createCustomEvent-11fa43d2.js';
|
|
6
6
|
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
7
7
|
import { l as log, a as logError, s as sendErrorLog } from './handleFetch-80ecfb91.js';
|
|
8
8
|
import { c as classes } from './classes-0d95c529.js';
|
|
@@ -417,7 +417,7 @@ const ZonosCheckout = class {
|
|
|
417
417
|
/**
|
|
418
418
|
* Set default address from query param if it's valid
|
|
419
419
|
*/
|
|
420
|
-
|
|
420
|
+
useLegacyQueryParams() {
|
|
421
421
|
const urlParams = new URLSearchParams(window.location.search);
|
|
422
422
|
const legacyShippingInfo = {
|
|
423
423
|
country:
|
|
@@ -437,7 +437,6 @@ const ZonosCheckout = class {
|
|
|
437
437
|
!legacyShippingInfo.customerCity ||
|
|
438
438
|
!legacyShippingInfo.customerName ||
|
|
439
439
|
!legacyShippingInfo.customerPhone ||
|
|
440
|
-
!legacyShippingInfo.customerZip ||
|
|
441
440
|
!legacyShippingInfo.country) {
|
|
442
441
|
log('Missing some query params so it can not be prefilled', 'info', legacyShippingInfo);
|
|
443
442
|
return;
|
|
@@ -448,7 +447,7 @@ const ZonosCheckout = class {
|
|
|
448
447
|
country: legacyShippingInfo.country,
|
|
449
448
|
line1: legacyShippingInfo.customerAddress1,
|
|
450
449
|
line2: legacyShippingInfo.customerAddress2 || '',
|
|
451
|
-
postal_code: legacyShippingInfo.customerZip,
|
|
450
|
+
postal_code: legacyShippingInfo.customerZip || '',
|
|
452
451
|
state: legacyShippingInfo.customerState || '',
|
|
453
452
|
},
|
|
454
453
|
email: legacyShippingInfo.customerEmail || '',
|
|
@@ -486,7 +485,7 @@ const ZonosCheckout = class {
|
|
|
486
485
|
* When temp cart data is available, set default address if it exists
|
|
487
486
|
*/
|
|
488
487
|
if (window.Zonos) {
|
|
489
|
-
this.
|
|
488
|
+
this.useLegacyQueryParams();
|
|
490
489
|
}
|
|
491
490
|
// only initialize checkout if visitor's country is in the shipping zones.
|
|
492
491
|
const interval = setInterval(() => {
|
|
@@ -717,7 +716,10 @@ const ZonosCheckout = class {
|
|
|
717
716
|
};
|
|
718
717
|
const isTestMode = getIsTestMode();
|
|
719
718
|
const renderTopHeader = () => {
|
|
720
|
-
|
|
719
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
720
|
+
const zonosQaUrl = urlParams.get('zonosQaUrl');
|
|
721
|
+
const zonosDebug = urlParams.get('zonosDebug');
|
|
722
|
+
return (h("zonos-v-stack", null, h("div", { class: "zonos--logo-wrapper" }, renderLogo(), isTestMode && (h("zonos-badge", { badgeColor: "orange", size: "small" }, translate('Test mode'))), zonosDebug === '1' && (h("zonos-badge", { badgeColor: "cyan", size: "small" }, "debug")), zonosQaUrl && (h("zonos-badge", { badgeColor: "purple", size: "small" }, zonosQaUrl))), h("zonos-checkout-progress-tabs", { backgroundColor:
|
|
721
723
|
// only use different contrast color when the secondary color is too off with the background in mobile
|
|
722
724
|
this.isMobile ? '--zonos-elements-gray-0' : null }), filteredMessages.map(x => (h("zonos-custom-message", { icon: MessageIcon, message: x.message })))));
|
|
723
725
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-86b8247e.js';
|
|
2
|
-
import { x as isValidSelector, j as stripeStore, y as initLocalizationStore, d as cartStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-
|
|
2
|
+
import { x as isValidSelector, j as stripeStore, y as initLocalizationStore, d as cartStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-0345943b.js';
|
|
3
3
|
import { z as zonosStore, b as zonosStoreInitSetting, d as zonosStoreFontFamily } from './zonosStore-0dc7a947.js';
|
|
4
4
|
import { h as handleFetch, a as logError, l as log } from './handleFetch-80ecfb91.js';
|
|
5
5
|
import './isDarkColor-b3afa948.js';
|
|
@@ -233,7 +233,7 @@ const ZonosController = class {
|
|
|
233
233
|
// Try to use new settings first for legacy stores
|
|
234
234
|
return (((_a = json === null || json === void 0 ? void 0 : json.appearanceSettings) === null || _a === void 0 ? void 0 : _a.logoUrl) || ((_b = this.config.appearance) === null || _b === void 0 ? void 0 : _b.logoUrl));
|
|
235
235
|
}
|
|
236
|
-
//
|
|
236
|
+
// Otherwise respect override
|
|
237
237
|
return (_c = this.config.appearance) === null || _c === void 0 ? void 0 : _c.logoUrl;
|
|
238
238
|
};
|
|
239
239
|
// override subscription status
|
|
@@ -328,7 +328,7 @@ const ZonosController = class {
|
|
|
328
328
|
zonosStore.organizationName = organizationName;
|
|
329
329
|
}
|
|
330
330
|
render() {
|
|
331
|
-
return h(Host, { key: '
|
|
331
|
+
return h(Host, { key: 'c168f24dcc30dffd48c604f8888b093a7a3f1525', class: "zonos--elements" });
|
|
332
332
|
}
|
|
333
333
|
};
|
|
334
334
|
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-0345943b.js';
|
|
3
3
|
import { d as zonosStoreFontFamily } from './zonosStore-0dc7a947.js';
|
|
4
4
|
import { c as classes } from './classes-0d95c529.js';
|
|
5
5
|
import './handleFetch-80ecfb91.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-0345943b.js';
|
|
3
3
|
import { d as zonosStoreFontFamily } from './zonosStore-0dc7a947.js';
|
|
4
4
|
import { f as formatStringWithLinks } from './formatStringWithLinks-9e819405.js';
|
|
5
5
|
import { i as isDarkColor } from './isDarkColor-b3afa948.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, E as currencyFormat } from './cart-
|
|
2
|
+
import { t as translate, l as localizationStore, E as currencyFormat } from './cart-0345943b.js';
|
|
3
3
|
import { z as zonosStore } from './zonosStore-0dc7a947.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-0dc7a947.js';
|
|
3
|
-
import { l as localizationStore, x as isValidSelector, t as translate, z as getZCountryUrlParam, A as setZCountryUrlParam, B as currencyDisplay, C as currencyConvertAndFormat, D as currencyConvert, E as currencyFormat } from './cart-
|
|
3
|
+
import { l as localizationStore, x as isValidSelector, t as translate, z as getZCountryUrlParam, A as setZCountryUrlParam, B as currencyDisplay, C as currencyConvertAndFormat, D as currencyConvert, E as currencyFormat } from './cart-0345943b.js';
|
|
4
4
|
import { c as classes } from './classes-0d95c529.js';
|
|
5
5
|
import { h as handleFetch, a as logError, l as log } from './handleFetch-80ecfb91.js';
|
|
6
6
|
import { g as getHasMoreSpaceOnRight } from './getHasMoreSpaceOnRight-70eb913a.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host } from './index-86b8247e.js';
|
|
2
|
-
import { L as localizationStoreUpdateSelectedLocale, t as translate, l as localizationStore } from './cart-
|
|
2
|
+
import { L as localizationStoreUpdateSelectedLocale, t as translate, l as localizationStore } from './cart-0345943b.js';
|
|
3
3
|
import { d as zonosStoreFontFamily } from './zonosStore-0dc7a947.js';
|
|
4
4
|
import { l as languages } from './ILanguage-cd6acb72.js';
|
|
5
5
|
import './handleFetch-80ecfb91.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-0dc7a947.js';
|
|
3
3
|
import { c as classes } from './classes-0d95c529.js';
|
|
4
|
-
import { j as stripeStore } from './cart-
|
|
4
|
+
import { j as stripeStore } from './cart-0345943b.js';
|
|
5
5
|
import { a as logError, l as log } from './handleFetch-80ecfb91.js';
|
|
6
|
-
import { d as paypalStoreInitButtons } from './paypal-
|
|
6
|
+
import { d as paypalStoreInitButtons } from './paypal-7592a690.js';
|
|
7
7
|
import './isDarkColor-b3afa948.js';
|
|
8
8
|
import './getBorderRadius-cff1e39b.js';
|
|
9
9
|
|