@zonos/elements 1.3.171 → 1.3.172
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-f5e68e14.js → CheckoutConfig-c5943bbf.js} +1 -1
- package/dist/cjs/{cart-36799bbe.js → cart-d91d9507.js} +13 -8
- package/dist/cjs/{handleFetch-7b7f9f7c.js → handleFetch-ff25db40.js} +10 -6
- package/dist/cjs/index.cjs.js +9 -9
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{paypal-3eae38bd.js → paypal-82841277.js} +2 -2
- package/dist/cjs/zonos-address_7.cjs.entry.js +51 -18
- package/dist/cjs/zonos-cart-items_13.cjs.entry.js +10 -6
- package/dist/cjs/zonos-checkout.cjs.entry.js +104 -34
- package/dist/cjs/zonos-controller.cjs.entry.js +2 -2
- 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-elements.cjs.js +1 -1
- package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +3 -3
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -2
- package/dist/cjs/zonos-hello.cjs.entry.js +2 -2
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +112 -35
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +10 -6
- package/dist/collection/components/store/checkout/cart.js +5 -0
- package/dist/collection/components/store/checkout/stripe.js +5 -7
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +26 -15
- package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +27 -4
- package/dist/collection/components/utils/handleFetch.js +9 -6
- package/dist/collection/components/utils/logging/getAdditionalLogMetadata.js +1 -0
- package/dist/collection/styles/stripe/defaultVariable.js +2 -0
- package/dist/collection/types/generated/graphql.internal.types.js +7 -0
- package/dist/esm/{CheckoutConfig-2994efd9.js → CheckoutConfig-75af3742.js} +1 -1
- package/dist/esm/{cart-b2e57589.js → cart-52e208cc.js} +13 -8
- package/dist/esm/{handleFetch-8d72c8cd.js → handleFetch-0109fb78.js} +10 -6
- package/dist/esm/index.js +10 -10
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{paypal-38da5d52.js → paypal-2e1c560e.js} +2 -2
- package/dist/esm/zonos-address_7.entry.js +51 -18
- package/dist/esm/zonos-cart-items_13.entry.js +10 -6
- package/dist/esm/zonos-checkout.entry.js +104 -34
- package/dist/esm/zonos-controller.entry.js +2 -2
- 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-elements.js +1 -1
- package/dist/esm/zonos-empty-state-payment_4.entry.js +3 -3
- package/dist/esm/zonos-hello-dialog.entry.js +2 -2
- package/dist/esm/zonos-hello.entry.js +2 -2
- package/dist/esm/zonos-language-select_2.entry.js +2 -2
- package/dist/esm-es5/{CheckoutConfig-2994efd9.js → CheckoutConfig-75af3742.js} +1 -1
- package/dist/esm-es5/{cart-b2e57589.js → cart-52e208cc.js} +1 -1
- package/dist/esm-es5/handleFetch-0109fb78.js +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{paypal-38da5d52.js → paypal-2e1c560e.js} +1 -1
- package/dist/esm-es5/zonos-address_7.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_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-elements.js +1 -1
- package/dist/esm-es5/zonos-empty-state-payment_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/scripts/index.d.ts +25 -6
- 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.d.ts +17 -3
- package/dist/types/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.d.ts +1 -1
- package/dist/types/components/store/checkout/cart.d.ts +4 -0
- package/dist/types/components/store/checkout/stripe.d.ts +10 -1
- package/dist/types/components/stripe/zonos-address/zonos-address.d.ts +2 -2
- package/dist/types/components/stripe/zonos-link-authentication/zonos-link-authentication.d.ts +1 -1
- package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
- package/dist/types/components/utils/logging/getAdditionalLogMetadata.d.ts +1 -0
- package/dist/types/components.d.ts +8 -6
- package/dist/types/types/checkout/CheckoutConfig.d.ts +1 -0
- package/dist/types/types/checkout/api/CheckoutSession.d.ts +8 -0
- package/dist/types/types/generated/graphql.frontend.types.d.ts +1 -1
- package/dist/types/types/generated/graphql.frontend.types.ts +1 -1
- package/dist/types/types/generated/graphql.internal.types.d.ts +92 -0
- package/dist/types/types/generated/graphql.internal.types.ts +105 -0
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-56a8b1f6.system.entry.js → p-048e4b38.system.entry.js} +1 -1
- package/dist/zonos-elements/p-04c38987.system.js +1 -0
- package/dist/zonos-elements/{p-bf113a46.system.js → p-0ee42be2.system.js} +1 -1
- package/dist/zonos-elements/{p-ff1c6d9a.entry.js → p-10a9edf6.entry.js} +1 -1
- package/dist/zonos-elements/{p-864c7c7d.entry.js → p-14bd4766.entry.js} +1 -1
- package/dist/zonos-elements/{p-47f79a6d.js → p-1c488ecf.js} +1 -1
- package/dist/zonos-elements/{p-cb52cfdf.entry.js → p-1e3e4e22.entry.js} +1 -1
- package/dist/zonos-elements/p-221d4f15.system.entry.js +1 -0
- package/dist/zonos-elements/{p-e09cea9c.entry.js → p-246c3b28.entry.js} +1 -1
- package/dist/zonos-elements/p-2b8c5669.system.entry.js +1 -0
- package/dist/zonos-elements/{p-dd0259f4.js → p-2d2c70a3.js} +1 -1
- package/dist/zonos-elements/{p-c5c2976f.system.js → p-2ebb4fa7.system.js} +1 -1
- package/dist/zonos-elements/{p-a3888f1d.system.js → p-36c35a07.system.js} +1 -1
- package/dist/zonos-elements/p-46f6e5e9.system.js +1 -1
- package/dist/zonos-elements/{p-00ad3c73.entry.js → p-588ac238.entry.js} +1 -1
- package/dist/zonos-elements/{p-b0c39400.entry.js → p-68304407.entry.js} +1 -1
- package/dist/zonos-elements/{p-ecd4ec15.system.js → p-7de48475.system.js} +1 -1
- package/dist/zonos-elements/p-839448c3.js +1 -0
- package/dist/zonos-elements/{p-53cb8867.system.entry.js → p-85d2da79.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-1a20922f.system.entry.js → p-91a7ca64.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-0bfca3a9.system.entry.js → p-9a10a63b.system.entry.js} +1 -1
- package/dist/zonos-elements/p-a08fad84.entry.js +1 -0
- package/dist/zonos-elements/{p-bfa028a2.entry.js → p-a61ef92f.entry.js} +1 -1
- package/dist/zonos-elements/{p-0def1397.system.entry.js → p-aa754137.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-c82f488b.system.entry.js → p-aea22783.system.entry.js} +1 -1
- package/dist/zonos-elements/p-ba604bc4.entry.js +1 -0
- package/dist/zonos-elements/{p-48173901.js → p-bbf9dbe4.js} +1 -1
- package/dist/zonos-elements/{p-461ca324.entry.js → p-c719434a.entry.js} +1 -1
- package/dist/zonos-elements/{p-56758218.system.entry.js → p-e34c0f83.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-1edbfb1f.system.entry.js → p-eb716dcc.system.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/handleFetch-8d72c8cd.js +0 -1
- package/dist/zonos-elements/p-173d1fcd.system.entry.js +0 -1
- package/dist/zonos-elements/p-71539c8a.js +0 -1
- package/dist/zonos-elements/p-9261869c.system.js +0 -1
- package/dist/zonos-elements/p-934164df.entry.js +0 -1
- package/dist/zonos-elements/p-9f9e4f74.entry.js +0 -1
- package/dist/zonos-elements/p-fd352222.system.entry.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as createStore, z as zonosStore } from './zonosStore-d3c5a0a5.js';
|
|
2
|
-
import { h as handleFetch, b as logError, l as log, f as fallbackApiList, s as sendErrorLog, d as allLogs, j as jsonParse, a as getIsStagingMode } from './handleFetch-
|
|
2
|
+
import { h as handleFetch, b as logError, l as log, f as fallbackApiList, s as sendErrorLog, d as allLogs, j as jsonParse, a as getIsStagingMode } from './handleFetch-0109fb78.js';
|
|
3
3
|
import { i as isDarkColor } from './isDarkColor-446fccb7.js';
|
|
4
4
|
import { g as getBorderRadius } from './getBorderRadius-ada3ccad.js';
|
|
5
5
|
|
|
@@ -10940,6 +10940,8 @@ const defaultVariable = ({ borderStyle, theme, }) => {
|
|
|
10940
10940
|
default:
|
|
10941
10941
|
return {
|
|
10942
10942
|
borderRadius: getBorderRadius({ overrideBorderStyle: borderStyle }),
|
|
10943
|
+
iconMenuColor: 'var(--colorText)',
|
|
10944
|
+
iconMenuHoverColor: 'var(--colorText)',
|
|
10943
10945
|
};
|
|
10944
10946
|
}
|
|
10945
10947
|
};
|
|
@@ -10949,6 +10951,7 @@ const { onChange: onChange$1, reset: reset$1, state: stripeStore, } = createStor
|
|
|
10949
10951
|
clientSecret: sessionStorage.getItem('zonos--client-secret') || '',
|
|
10950
10952
|
companyName: '',
|
|
10951
10953
|
customErrorMessage: null,
|
|
10954
|
+
customerProfile: null,
|
|
10952
10955
|
fetchingLandedCostAbortController: null,
|
|
10953
10956
|
hasPaymentError: false,
|
|
10954
10957
|
isFetchingLandedCost: false,
|
|
@@ -10971,6 +10974,7 @@ const { onChange: onChange$1, reset: reset$1, state: stripeStore, } = createStor
|
|
|
10971
10974
|
stripeBillingAddressEventData: null,
|
|
10972
10975
|
stripeBillingAddressUsedWhenFetchingLC: null,
|
|
10973
10976
|
stripeBillingAddressUsedWhenValidatingAddress: null,
|
|
10977
|
+
stripeCustomerSessionClientSecret: null,
|
|
10974
10978
|
stripeElements: null,
|
|
10975
10979
|
stripeElementsForBillingAddress: null,
|
|
10976
10980
|
stripeElementsOptions: null,
|
|
@@ -11012,6 +11016,7 @@ const getStripeOptions = ({ clientSecret, overrideBorderRadius, overridePrimaryC
|
|
|
11012
11016
|
},
|
|
11013
11017
|
// Client secret can be undefined since we will load other elements that doesn't require client secret first, then load client secret and render one that requires it later
|
|
11014
11018
|
clientSecret: clientSecret || undefined,
|
|
11019
|
+
customerSessionClientSecret: stripeStore.stripeCustomerSessionClientSecret || undefined,
|
|
11015
11020
|
externalPaymentMethodTypes: [...paypalPaymentType],
|
|
11016
11021
|
locale: localizationStore.selectedLocale,
|
|
11017
11022
|
};
|
|
@@ -11467,6 +11472,7 @@ const getCheckoutSessionBody = () => {
|
|
|
11467
11472
|
adjustmentsAmount: cartStore.adjustments.reduce((prev, adj) => prev + adj.amount, 0),
|
|
11468
11473
|
cartId: window.Zonos.cartId,
|
|
11469
11474
|
currency: ((_a = cartStore.items.find(Boolean)) === null || _a === void 0 ? void 0 : _a.currencyCode) || '',
|
|
11475
|
+
customerAuthenticationToken: cartStore.customerAuthenticationToken || undefined,
|
|
11470
11476
|
itemsAmount: total,
|
|
11471
11477
|
metadata: [
|
|
11472
11478
|
{
|
|
@@ -11493,10 +11499,6 @@ const getCheckoutSessionBody = () => {
|
|
|
11493
11499
|
};
|
|
11494
11500
|
const stripeStoreGetPaymentIntent = async () => {
|
|
11495
11501
|
var _a;
|
|
11496
|
-
if (stripeStore.clientSecret) {
|
|
11497
|
-
log('Payment intent already exists, skipping fetching payment intent');
|
|
11498
|
-
return;
|
|
11499
|
-
}
|
|
11500
11502
|
if (!cartStore.checkoutSessionId) {
|
|
11501
11503
|
// We want to log the error anytime we fail to create a checkout session
|
|
11502
11504
|
void sendErrorLog({
|
|
@@ -11543,9 +11545,6 @@ const stripeStoreGetPaymentIntent = async () => {
|
|
|
11543
11545
|
});
|
|
11544
11546
|
return;
|
|
11545
11547
|
}
|
|
11546
|
-
// update stripe store with updated information
|
|
11547
|
-
stripeStore.clientSecret =
|
|
11548
|
-
json.checkoutSessionPaymentIntentCreate.clientSecret;
|
|
11549
11548
|
// update cart store checkout session with updated from checkout session payment intent creation call so the checkout session and payment intent are in sync
|
|
11550
11549
|
cartStoreSetCheckoutSession(json.checkoutSessionPaymentIntentCreate);
|
|
11551
11550
|
};
|
|
@@ -11622,6 +11621,7 @@ const stripeStoreUpdateCheckoutSession = async ({ adjustmentsAmount, cartId, cur
|
|
|
11622
11621
|
adjustmentsAmount,
|
|
11623
11622
|
cartId,
|
|
11624
11623
|
currency,
|
|
11624
|
+
customerAuthenticationToken: cartStore.customerAuthenticationToken || undefined,
|
|
11625
11625
|
id,
|
|
11626
11626
|
itemsAmount,
|
|
11627
11627
|
landedCostId,
|
|
@@ -11792,6 +11792,7 @@ const { onChange, reset, state: cartStore, } = createStore(() => ({
|
|
|
11792
11792
|
checkoutTimeoutInterval: null,
|
|
11793
11793
|
currency: 'USD',
|
|
11794
11794
|
customQuotingError: null,
|
|
11795
|
+
customerAuthenticationToken: null,
|
|
11795
11796
|
displayBaseCurrency: false,
|
|
11796
11797
|
dutiesTaxesFees: null,
|
|
11797
11798
|
dutiesTaxesFeesEstimate: null,
|
|
@@ -11944,7 +11945,11 @@ const cartStoreHasOneEligibleItem = () => {
|
|
|
11944
11945
|
};
|
|
11945
11946
|
const cartStoreSetCheckoutSession = (checkoutSession) => {
|
|
11946
11947
|
var _a, _b, _c, _d, _e;
|
|
11948
|
+
// update stripe store with updated information
|
|
11947
11949
|
stripeStore.clientSecret = checkoutSession.clientSecret;
|
|
11950
|
+
stripeStore.stripeCustomerSessionClientSecret =
|
|
11951
|
+
checkoutSession.customerSessionClientSecret;
|
|
11952
|
+
stripeStore.customerProfile = checkoutSession.customerProfile;
|
|
11948
11953
|
cartStore.checkoutSession = checkoutSession;
|
|
11949
11954
|
cartStore.checkoutSessionId = checkoutSession.id;
|
|
11950
11955
|
// Check if there is a redirect URL in the metadata to override
|
|
@@ -152,6 +152,7 @@ const getAdditionalLogMetadata = () => {
|
|
|
152
152
|
connectionEffectiveType: baseConnection === null || baseConnection === void 0 ? void 0 : baseConnection.effectiveType,
|
|
153
153
|
connectionRtt: baseConnection === null || baseConnection === void 0 ? void 0 : baseConnection.rtt,
|
|
154
154
|
connectionSaveData: baseConnection === null || baseConnection === void 0 ? void 0 : baseConnection.saveData,
|
|
155
|
+
isHostedCheckout: window.Zonos.isLegacyCheckout,
|
|
155
156
|
screenHeight: window.screen.height,
|
|
156
157
|
screenWidth: window.screen.width,
|
|
157
158
|
userAgent: userAgentData && userAgentData.brands.length > 0
|
|
@@ -398,12 +399,15 @@ const handleRequestWithFallback = async ({ basePathType: _basePathType, options,
|
|
|
398
399
|
log(`${path} (${duration.toFixed(2)}ms)`, 'info');
|
|
399
400
|
// No need to send the load time api log for the log-script-load endpoint
|
|
400
401
|
const internalDuration = response === null || response === void 0 ? void 0 : response.headers.get('Zonos-Duration');
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
402
|
+
// Only record if the response status is 200, some endpoint will return 200 with error
|
|
403
|
+
if ((response === null || response === void 0 ? void 0 : response.status) === 200) {
|
|
404
|
+
prepLoadTimeApiLog({
|
|
405
|
+
apiPath: path,
|
|
406
|
+
apiType: basePathType,
|
|
407
|
+
loadTimeInternal: internalDuration ? Number(internalDuration) : 0,
|
|
408
|
+
loadTimeTotal: duration,
|
|
409
|
+
});
|
|
410
|
+
}
|
|
407
411
|
const nextFallbackApiType = getNextFallbackApiType(basePathType);
|
|
408
412
|
const unknownError = errors.find(({ type }) => type === 'unknown');
|
|
409
413
|
const isUnknownError = !!unknownError || (response === null || response === void 0 ? void 0 : response.status) === 404;
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { g as getIsTestMode, a as getIsStagingMode, l as log, h as handleFetch, b as logError } from './handleFetch-
|
|
2
|
-
import { s as setupCartData, c as checkoutHiddenBtnSelector } from './CheckoutConfig-
|
|
3
|
-
export { c as checkoutHiddenBtnSelector, d as domesticRedirectedBtnSelector } from './CheckoutConfig-
|
|
1
|
+
import { g as getIsTestMode, a as getIsStagingMode, l as log, h as handleFetch, b as logError } from './handleFetch-0109fb78.js';
|
|
2
|
+
import { s as setupCartData, c as checkoutHiddenBtnSelector } from './CheckoutConfig-75af3742.js';
|
|
3
|
+
export { c as checkoutHiddenBtnSelector, d as domesticRedirectedBtnSelector } from './CheckoutConfig-75af3742.js';
|
|
4
4
|
export { c as countryRequireTaxId, s as shipToTaxIdLabels } from './TaxId-915ef042.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -126,7 +126,7 @@ const getZonosQaUrl = () => {
|
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
128
128
|
const qaUrl = extractZonosQaUrl(window.location.href);
|
|
129
|
-
const cdnUrl = "https://v1.3.
|
|
129
|
+
const cdnUrl = "https://v1.3.172.js.zonos.com";
|
|
130
130
|
// when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
|
|
131
131
|
if (!qaUrl &&
|
|
132
132
|
(cdnUrl.includes('test.') ||
|
|
@@ -310,10 +310,10 @@ const zonosLoadUrl = (() => {
|
|
|
310
310
|
}
|
|
311
311
|
return null;
|
|
312
312
|
})();
|
|
313
|
-
const ZONOS_URL = "https://v1.3.
|
|
314
|
-
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.
|
|
315
|
-
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.
|
|
316
|
-
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.
|
|
313
|
+
const ZONOS_URL = "https://v1.3.172.js.zonos.com";
|
|
314
|
+
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.172";
|
|
315
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.172";
|
|
316
|
+
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.172";
|
|
317
317
|
const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
|
|
318
318
|
const GOOGLE_FONT_REGEX = /^https:\/\/fonts\.googleapis\.com/;
|
|
319
319
|
class Zonos {
|
|
@@ -327,7 +327,7 @@ Zonos.zonosConversionTest = typeof window !== 'undefined' &&
|
|
|
327
327
|
!!window.location.search.match(/\?.*(&*)zonosConversionTest/);
|
|
328
328
|
Zonos._paypalMockResponse = null;
|
|
329
329
|
Zonos.isBigCommerce = false;
|
|
330
|
-
Zonos.releaseDate = "
|
|
330
|
+
Zonos.releaseDate = "1742308902831";
|
|
331
331
|
Zonos.isLegacyCheckout = false;
|
|
332
332
|
Zonos.domain = typeof window !== 'undefined'
|
|
333
333
|
? // domain that embeds the iframe
|
|
@@ -343,7 +343,7 @@ Zonos.showBaseForeign = typeof window !== 'undefined' &&
|
|
|
343
343
|
Zonos.isNpm = true;
|
|
344
344
|
Zonos.zonosQaUrl = null;
|
|
345
345
|
Zonos.zonosQaUrlApi = null;
|
|
346
|
-
Zonos.version = `v${"1.3.
|
|
346
|
+
Zonos.version = `v${"1.3.172"}`;
|
|
347
347
|
Zonos.modeAlerted = false;
|
|
348
348
|
Zonos.cartData = null;
|
|
349
349
|
Zonos.paypal = null;
|
package/dist/esm/loader.js
CHANGED
|
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await globalScripts();
|
|
8
|
-
return bootstrapLazy(JSON.parse("[[\"zonos-checkout\",[[2,\"zonos-checkout\",{\"appearanceSettingsOverride\":[16],\"preview\":[4],\"mobile\":[4],\"overrideStagingMode\":[4,\"override-staging-mode\"],\"defaultAddress\":[16],\"forceDialogOpen\":[4,\"force-dialog-open\"],\"defaultAddressParams\":[32],\"open\":[32],\"stripe\":[32],\"submitLoading\":[32],\"collapseReviewMobile\":[32],\"isAttachError\":[32],\"isMobile\":[32],\"isIframed\":[32],\"zonosReviewRef\":[32],\"storybookPaymentStatusOverride\":[32],\"isLegacyCheckout\":[32],\"confirmDialogOpen\":[32],\"isCartExpired\":[32],\"payInUsdConfirmDialogOpen\":[32],\"inventoryCheckErrorMessage\":[32],\"placedOrderInfo\":[32],\"clientSecret\":[32],\"closeDialogHandler\":[64],\"init\":[64],\"setToFinishStep\":[64],\"mockCheckoutSession\":[64]},[[16,\"zonos--init-cart-info\",\"initCartInfoHandler\"],[4,\"keydown\",\"handleKeyPress\"],[9,\"resize\",\"handleWindowResize\"]],{\"appearanceSettingsOverride\":[\"appearanceSettingsOverrideChanged\",\"handleAppearanceSettingsOverrideChange\"],\"overrideStagingMode\":[\"overrideStagingModeChanged\"],\"mobile\":[\"handleMobileChange\"],\"defaultAddress\":[\"handleAddressChange\"],\"clientSecret\":[\"handleClientSecretChange\"],\"open\":[\"handleOpenChange\"]}]]],[\"zonos-hello\",[[1,\"zonos-hello\",{\"mobileLocationOverride\":[1,\"mobile-location-override\"],\"animateFromLeftOverride\":[4,\"animate-from-left-override\"],\"appearanceSettingsOverride\":[16],\"showPeekMessage\":[32],\"zonosStoreHelloSettings\":[32],\"showDialog\":[32],\"peekMessage\":[32],\"initialUrl\":[32],\"allRestrictedItems\":[32],\"allFoundProducts\":[32],\"productsOnPage\":[32],\"isHelloWidgetRendered\":[32],\"isMobile\":[32],\"getCountryList\":[64],\"displayCurrency\":[64],\"convertAndFormat\":[64],\"convert\":[64],\"format\":[64],\"openHelloDialog\":[64]},[[9,\"resize\",\"handleResize\"]],{\"appearanceSettingsOverride\":[\"handleAppearanceSettingsOverrideChange\"]}]]],[\"zonos-controller\",[[1,\"zonos-controller\",{\"config\":[16],\"zonosApiKey\":[1,\"zonos-api-key\"],\"initCheckoutElement\":[64],\"setupGoogleFont\":[64],\"showNotification\":[64],\"reset\":[64],\"overrideConfig\":[64],\"overrideCountry\":[64],\"getAppearanceSetting\":[64],\"updateOrganizationName\":[64]},[[8,\"locationchange\",\"handleLocationChange\"]]]]],[\"zonos-tooltip\",[[1,\"zonos-tooltip\",{\"label\":[1],\"subtitle\":[1],\"showTooltip\":[32]}]]],[\"zonos-component\",[[1,\"zonos-component\",{\"first\":[1],\"middle\":[1],\"last\":[1]}]]],[\"zonos-link\",[[1,\"zonos-link\",{\"href\":[1],\"rel\":[1],\"target\":[1],\"linkTitle\":[1,\"link-title\"]}]]],[\"zonos-logo\",[[1,\"zonos-logo\",{\"theme\":[1],\"width\":[1]}]]],[\"zonos-hello-dialog\",[[1,\"zonos-hello-dialog\",{\"isOpen\":[4,\"is-open\"],\"setIsOpen\":[16],\"mobileLocationOverride\":[1,\"mobile-location-override\"],\"animateFromLeftOverride\":[4,\"animate-from-left-override\"],\"appearanceSettings\":[16],\"restrictedItems\":[16],\"welcomeMessage\":[32],\"showCountrySelect\":[32],\"showLanguageSelect\":[32]},[[4,\"click\",\"globalClickHandler\"]],{\"isOpen\":[\"isOpenHandler\"]}]]],[\"zonos-badge\",[[1,\"zonos-badge\",{\"bold\":[4],\"badgeColor\":[1,\"badge-color\"],\"icon\":[16],\"iconRight\":[4,\"icon-right\"],\"size\":[1],\"rounded\":[4],\"loading\":[4],\"dismissHandler\":[16]}]]],[\"zonos-shipping-rich-radio\",[[1,\"zonos-shipping-rich-radio\",{\"items\":[16],\"borderColor\":[1,\"border-color\"],\"borderStyle\":[1,\"border-style\"],\"theme\":[1],\"selectedItem\":[16]}]]],[\"zonos-toggle\",[[1,\"zonos-toggle\",{\"options\":[16],\"value\":[1]}]]],[\"zonos-collapse\",[[1,\"zonos-collapse\",{\"collapsed\":[4],\"collapseSize\":[2,\"collapse-size\"],\"height\":[32],\"iframe\":[32]}]]],[\"zonos-stripe-input\",[[1,\"zonos-stripe-input\",{\"inputValue\":[1,\"input-value\"],\"inputLabel\":[1,\"input-label\"],\"overridePrimaryColor\":[1,\"override-primary-color\"],\"overrideSecondaryColor\":[1,\"override-secondary-color\"],\"isDisabled\":[4,\"is-disabled\"],\"isError\":[4,\"is-error\"],\"inputPlaceholder\":[1,\"input-placeholder\"],\"value\":[1025],\"internalValue\":[32]},null,{\"inputValue\":[\"onInputValueChange\"],\"value\":[\"onValueChange\"]}]]],[\"zonos-card\",[[1,\"zonos-card\",{\"actions\":[16],\"backgroundColor\":[1,\"background-color\"],\"borderRadius\":[2,\"border-radius\"],\"footerActions\":[16],\"footerContent\":[16],\"footerHeight\":[2,\"footer-height\"],\"label\":[16],\"spacing\":[1]}]]],[\"zonos-input\",[[1,\"zonos-input\",{\"inputValue\":[1,\"input-value\"],\"inputLabel\":[1,\"input-label\"],\"inputSize\":[1,\"input-size\"],\"isDisabled\":[4,\"is-disabled\"],\"isError\":[4,\"is-error\"],\"inputPlaceholder\":[1,\"input-placeholder\"],\"value\":[32]},null,{\"inputValue\":[\"onInputValueChange\"]}]]],[\"zonos-text\",[[1,\"zonos-text\",{\"textColor\":[1,\"text-color\"],\"size\":[1],\"type\":[1],\"weight\":[2],\"ready\":[32]}]]],[\"zonos-banner\",[[1,\"zonos-banner\",{\"bannerTitle\":[1,\"banner-title\"],\"intent\":[1],\"hasContent\":[32]}]]],[\"zonos-country-flag\",[[1,\"zonos-country-flag\",{\"countryCode\":[1,\"country-code\"],\"size\":[2]}]]],[\"zonos-v-stack\",[[1,\"zonos-v-stack\",{\"spacing\":[2]}]]],[\"zonos-empty-state-payment_4\",[[1,\"zonos-empty-state-payment\",{\"emptyStateText\":[1,\"empty-state-text\"],\"theme\":[1]}],[2,\"zonos-payment\",{\"titleText\":[1,\"title-text\"],\"stripe\":[32],\"stripeElements\":[32]},null,{\"stripeElements\":[\"watchInitStripe\"],\"stripe\":[\"watchInitStripe\"]}],[2,\"zonos-paypal-payment\"],[1,\"zonos-notification\",{\"notificationArray\":[32],\"showNotification\":[64]}]]],[\"zonos-button_3\",[[17,\"zonos-button\",{\"buttonColor\":[1,\"button-color\"],\"backgroundColor\":[1,\"background-color\"],\"borderStyle\":[1,\"border-style\"],\"isDisabled\":[4,\"is-disabled\"],\"icon\":[16],\"iconRight\":[4,\"icon-right\"],\"size\":[1],\"variant\":[1],\"noBackground\":[4,\"no-background\"],\"withBoxShadow\":[4,\"with-box-shadow\"],\"noPaddingLeft\":[4,\"no-padding-left\"],\"noPaddingRight\":[4,\"no-padding-right\"],\"loading\":[4],\"justifyContent\":[1,\"justify-content\"],\"bold\":[4],\"theme\":[1],\"hasIcon\":[32],\"hasContent\":[32]},[[2,\"click\",\"clickHandler\"]],{\"icon\":[\"iconChangeHandler\"]}],[1,\"zonos-spinner\",{\"size\":[2],\"spinnerColor\":[1,\"spinner-color\"]}],[1,\"zonos-icon\",{\"autoHeight\":[4,\"auto-height\"],\"iconColor\":[1,\"icon-color\"],\"content\":[1],\"size\":[2]}]]],[\"zonos-language-select_2\",[[1,\"zonos-language-select\",{\"handleOnClose\":[16]}],[1,\"zonos-select-dialog-header\",{\"handleOnClose\":[16],\"label\":[1]}]]],[\"zonos-country-select_4\",[[1,\"zonos-country-select\",{\"handleOnClose\":[16],\"inputValue\":[32]}],[1,\"zonos-hello-dialog-footer\",{\"appearanceSettings\":[16],\"setShowCountrySelect\":[16],\"setShowLanguageSelect\":[16]}],[1,\"zonos-custom-message\",{\"icon\":[1],\"message\":[1]}],[2,\"zonos-virtual-scroll\",{\"renderItem\":[16],\"itemWidth\":[2,\"item-width\"],\"fallbackItemHeight\":[2,\"fallback-item-height\"],\"itemHeights\":[16],\"container\":[32],\"scrollTop\":[32],\"totalHeight\":[32]},null,{\"itemHeights\":[\"updateTotalHeight\"],\"fallbackItemHeight\":[\"updateTotalHeight\"]}]]],[\"zonos-address_7\",[[1,\"zonos-address-update-dialog\",{\"continueLoading\":[4,\"continue-loading\"],\"dialogLoading\":[4,\"dialog-loading\"],\"dialogOpen\":[4,\"dialog-open\"],\"submitBtnType\":[1,\"submit-btn-type\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"isMobile\":[4,\"is-mobile\"],\"shippingAddress\":[16],\"billingAddress\":[16],\"translatedShippingAddress\":[16],\"translatedBillingAddress\":[16],\"showErrorBanner\":[32],\"translatedShippingAddressState\":[32],\"translatedBillingAddressState\":[32]},null,{\"translatedShippingAddress\":[\"watchTranslatedShippingAddress\"],\"translatedBillingAddress\":[\"watchTranslatedBillingAddress\"]}],[2,\"zonos-address\",{\"type\":[1],\"titleText\":[1,\"title-text\"],\"defaultAddress\":[16],\"stripe\":[32],\"isDirtyAddress\":[32]},null,{\"stripe\":[\"watchInitStripe\"],\"defaultAddress\":[\"defaultAddressChanged\"]}],[2,\"zonos-link-authentication\",{\"titleText\":[1,\"title-text\"],\"defaultEmail\":[1,\"default-email\"],\"isEmailError\":[4,\"is-email-error\"],\"stripe\":[32],\"isStagingMode\":[32],\"clientSecret\":[32]},null,{\"isStagingMode\":[\"watchIsStagingMode\"],\"stripe\":[\"watchInitStripe\"],\"clientSecret\":[\"watchInitStripe\"],\"defaultEmail\":[\"watchDefaultEmail\"]}],[1,\"zonos-checkbox\",{\"backgroundColor\":[1,\"background-color\"],\"label\":[1],\"isChecked\":[4,\"is-checked\"],\"isDisabled\":[4,\"is-disabled\"],\"size\":[2],\"fontSize\":[1,\"font-size\"],\"borderStyle\":[1,\"border-style\"]},[[1,\"click\",\"onClick\"]]],[1,\"zonos-dialog\",{\"open\":[4],\"headerText\":[1,\"header-text\"],\"width\":[1],\"height\":[1],\"minHeight\":[1,\"min-height\"],\"noHeader\":[4,\"no-header\"],\"noBodyPadding\":[4,\"no-body-padding\"],\"noBorder\":[4,\"no-border\"],\"borderStyle\":[1,\"border-style\"],\"noCloseButton\":[4,\"no-close-button\"],\"noClickOutside\":[4,\"no-click-outside\"],\"mobile\":[4],\"isLoading\":[4,\"is-loading\"],\"isMobile\":[32]},[[9,\"resize\",\"handleWindowResize\"],[4,\"keydown\",\"handleKeyDown\"]]],[1,\"zonos-address-display\",{\"currentAddress\":[16],\"addressType\":[1,\"address-type\"]}],[1,\"zonos-address-form\",{\"currentAddress\":[16],\"translatedAddress\":[16],\"addressType\":[1,\"address-type\"],\"localAddress\":[32]},null,{\"translatedAddress\":[\"watchCurrentAddress\"]}]]],[\"zonos-cart-items_13\",[[2,\"zonos-customer-info\",{\"continueLoading\":[4,\"continue-loading\"],\"submitBtnType\":[1,\"submit-btn-type\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"isMobile\":[4,\"is-mobile\"],\"defaultAddress\":[16],\"showErrorBanner\":[32],\"shippingCountry\":[32],\"isCheckingForRestrictedItems\":[32],\"isValidatingAddress\":[32],\"isTaxIdError\":[32],\"invalidShippingCharacterList\":[32],\"invalidBillingCharacterList\":[32],\"openAddressValidationDialog\":[32],\"isEmailError\":[32]}],[2,\"zonos-checkout-payment\",{\"submitBtnType\":[1,\"submit-btn-type\"],\"continueLoading\":[4,\"continue-loading\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"isMobile\":[4,\"is-mobile\"],\"overridePrimaryColor\":[1,\"override-primary-color\"],\"showErrorBanner\":[32],\"hasStripePaymentError\":[32],\"stagingOrderCreateErrorMessage\":[32],\"internalContinueLoading\":[32]},null,{\"continueLoading\":[\"continueLoadingWatcher\"],\"hasStripePaymentError\":[\"stripePaymentErrorWatcher\"]}],[1,\"zonos-checkout-footer\",{\"mobile\":[4],\"dataTheme\":[1,\"data-theme\"],\"showLanguageDialog\":[32],\"isMobile\":[32]},[[4,\"click\",\"handleGlobalClick\"]],{\"mobile\":[\"handleMobileChange\"]}],[2,\"zonos-shipping\",{\"continueLoading\":[4,\"continue-loading\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"submitBtnType\":[1,\"submit-btn-type\"],\"selectedShippingMethod\":[32],\"collapsedDAPOptions\":[32],\"isSelecting\":[32],\"showErrorBanner\":[32],\"serviceLevelsDDP\":[32],\"serviceLevelsDAP\":[32],\"serviceLevelsOther\":[32],\"serviceLevelsAll\":[32],\"displayBaseCurrency\":[32]}],[1,\"zonos-cart-subtotal\",{\"submitBtnType\":[1,\"submit-btn-type\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"loading\":[32]}],[1,\"zonos-cart-restricted-items\",{\"hide\":[4],\"errorImages\":[32],\"internalCollapsed\":[32],\"firstRender\":[32]}],[1,\"zonos-checkout-finish\",{\"borderRadius\":[1,\"border-radius\"],\"storybookForceStatus\":[1,\"storybook-force-status\"],\"overrideNotification\":[16],\"isLoading\":[32],\"notificationType\":[32],\"notificationTitle\":[32],\"notificationMessages\":[32],\"notificationActionText\":[32],\"order\":[32],\"isWaitingToRedirect\":[32]}],[1,\"zonos-confirm-dialog\",{\"dialogTitle\":[1,\"dialog-title\"],\"dialogIntent\":[1,\"dialog-intent\"],\"dialogSubtitle\":[1,\"dialog-subtitle\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"dialogConfirmBtnText\":[1,\"dialog-confirm-btn-text\"],\"dialogWidth\":[2,\"dialog-width\"],\"dialogCancelBtnText\":[1,\"dialog-cancel-btn-text\"],\"dialogType\":[1,\"dialog-type\"],\"isMobile\":[4,\"is-mobile\"],\"dialogOpen\":[4,\"dialog-open\"],\"noClickOutside\":[4,\"no-click-outside\"]},[[4,\"keydown\",\"handleKeyDown\"]]],[1,\"zonos-checkout-progress-tabs\",{\"tabColor\":[1,\"tab-color\"],\"backgroundColor\":[1,\"background-color\"],\"setTabItems\":[64],\"setTabSelected\":[64]}],[1,\"zonos-review\",{\"mobile\":[4],\"collapsed\":[4],\"isMobile\":[32]},[[9,\"resize\",\"handleWindowResize\"]]],[1,\"zonos-cart-items\",{\"errorImages\":[32]}],[1,\"zonos-currency-toggle\",{\"errorImages\":[32]}],[1,\"zonos-rest-state\",{\"restStateSubtitle\":[1,\"rest-state-subtitle\"],\"restStateTitle\":[1,\"rest-state-title\"],\"restStateType\":[1,\"rest-state-type\"],\"isErrorImageLoad\":[32]}]]]]"), options);
|
|
8
|
+
return bootstrapLazy(JSON.parse("[[\"zonos-checkout\",[[2,\"zonos-checkout\",{\"appearanceSettingsOverride\":[16],\"preview\":[4],\"mobile\":[4],\"overrideStagingMode\":[4,\"override-staging-mode\"],\"defaultAddress\":[16],\"forceDialogOpen\":[4,\"force-dialog-open\"],\"defaultAddressParams\":[32],\"defaultCustomerProfileAddress\":[32],\"customerProfile\":[32],\"open\":[32],\"stripe\":[32],\"submitLoading\":[32],\"collapseReviewMobile\":[32],\"isAttachError\":[32],\"isMobile\":[32],\"isIframed\":[32],\"zonosReviewRef\":[32],\"storybookPaymentStatusOverride\":[32],\"isLegacyCheckout\":[32],\"confirmDialogOpen\":[32],\"isCartExpired\":[32],\"payInUsdConfirmDialogOpen\":[32],\"inventoryCheckErrorMessage\":[32],\"placedOrderInfo\":[32],\"clientSecret\":[32],\"stripeCustomerSessionClientSecret\":[32],\"closeDialogHandler\":[64],\"init\":[64],\"setToFinishStep\":[64],\"mockCheckoutSession\":[64]},[[16,\"zonos--init-cart-info\",\"initCartInfoHandler\"],[4,\"keydown\",\"handleKeyPress\"],[9,\"resize\",\"handleWindowResize\"]],{\"appearanceSettingsOverride\":[\"appearanceSettingsOverrideChanged\",\"handleAppearanceSettingsOverrideChange\"],\"overrideStagingMode\":[\"overrideStagingModeChanged\"],\"mobile\":[\"handleMobileChange\"],\"defaultAddress\":[\"handleAddressChange\"],\"customerProfile\":[\"handleCustomerProfileChange\"],\"clientSecret\":[\"handleClientSecretChange\"],\"stripeCustomerSessionClientSecret\":[\"handleClientSecretChange\"],\"open\":[\"handleOpenChange\"]}]]],[\"zonos-hello\",[[1,\"zonos-hello\",{\"mobileLocationOverride\":[1,\"mobile-location-override\"],\"animateFromLeftOverride\":[4,\"animate-from-left-override\"],\"appearanceSettingsOverride\":[16],\"showPeekMessage\":[32],\"zonosStoreHelloSettings\":[32],\"showDialog\":[32],\"peekMessage\":[32],\"initialUrl\":[32],\"allRestrictedItems\":[32],\"allFoundProducts\":[32],\"productsOnPage\":[32],\"isHelloWidgetRendered\":[32],\"isMobile\":[32],\"getCountryList\":[64],\"displayCurrency\":[64],\"convertAndFormat\":[64],\"convert\":[64],\"format\":[64],\"openHelloDialog\":[64]},[[9,\"resize\",\"handleResize\"]],{\"appearanceSettingsOverride\":[\"handleAppearanceSettingsOverrideChange\"]}]]],[\"zonos-controller\",[[1,\"zonos-controller\",{\"config\":[16],\"zonosApiKey\":[1,\"zonos-api-key\"],\"initCheckoutElement\":[64],\"setupGoogleFont\":[64],\"showNotification\":[64],\"reset\":[64],\"overrideConfig\":[64],\"overrideCountry\":[64],\"getAppearanceSetting\":[64],\"updateOrganizationName\":[64]},[[8,\"locationchange\",\"handleLocationChange\"]]]]],[\"zonos-tooltip\",[[1,\"zonos-tooltip\",{\"label\":[1],\"subtitle\":[1],\"showTooltip\":[32]}]]],[\"zonos-component\",[[1,\"zonos-component\",{\"first\":[1],\"middle\":[1],\"last\":[1]}]]],[\"zonos-link\",[[1,\"zonos-link\",{\"href\":[1],\"rel\":[1],\"target\":[1],\"linkTitle\":[1,\"link-title\"]}]]],[\"zonos-logo\",[[1,\"zonos-logo\",{\"theme\":[1],\"width\":[1]}]]],[\"zonos-hello-dialog\",[[1,\"zonos-hello-dialog\",{\"isOpen\":[4,\"is-open\"],\"setIsOpen\":[16],\"mobileLocationOverride\":[1,\"mobile-location-override\"],\"animateFromLeftOverride\":[4,\"animate-from-left-override\"],\"appearanceSettings\":[16],\"restrictedItems\":[16],\"welcomeMessage\":[32],\"showCountrySelect\":[32],\"showLanguageSelect\":[32]},[[4,\"click\",\"globalClickHandler\"]],{\"isOpen\":[\"isOpenHandler\"]}]]],[\"zonos-badge\",[[1,\"zonos-badge\",{\"bold\":[4],\"badgeColor\":[1,\"badge-color\"],\"icon\":[16],\"iconRight\":[4,\"icon-right\"],\"size\":[1],\"rounded\":[4],\"loading\":[4],\"dismissHandler\":[16]}]]],[\"zonos-shipping-rich-radio\",[[1,\"zonos-shipping-rich-radio\",{\"items\":[16],\"borderColor\":[1,\"border-color\"],\"borderStyle\":[1,\"border-style\"],\"theme\":[1],\"selectedItem\":[16]}]]],[\"zonos-toggle\",[[1,\"zonos-toggle\",{\"options\":[16],\"value\":[1]}]]],[\"zonos-collapse\",[[1,\"zonos-collapse\",{\"collapsed\":[4],\"collapseSize\":[2,\"collapse-size\"],\"height\":[32],\"iframe\":[32]}]]],[\"zonos-stripe-input\",[[1,\"zonos-stripe-input\",{\"inputValue\":[1,\"input-value\"],\"inputLabel\":[1,\"input-label\"],\"overridePrimaryColor\":[1,\"override-primary-color\"],\"overrideSecondaryColor\":[1,\"override-secondary-color\"],\"isDisabled\":[4,\"is-disabled\"],\"isError\":[4,\"is-error\"],\"inputPlaceholder\":[1,\"input-placeholder\"],\"value\":[1025],\"internalValue\":[32]},null,{\"inputValue\":[\"onInputValueChange\"],\"value\":[\"onValueChange\"]}]]],[\"zonos-card\",[[1,\"zonos-card\",{\"actions\":[16],\"backgroundColor\":[1,\"background-color\"],\"borderRadius\":[2,\"border-radius\"],\"footerActions\":[16],\"footerContent\":[16],\"footerHeight\":[2,\"footer-height\"],\"label\":[16],\"spacing\":[1]}]]],[\"zonos-input\",[[1,\"zonos-input\",{\"inputValue\":[1,\"input-value\"],\"inputLabel\":[1,\"input-label\"],\"inputSize\":[1,\"input-size\"],\"isDisabled\":[4,\"is-disabled\"],\"isError\":[4,\"is-error\"],\"inputPlaceholder\":[1,\"input-placeholder\"],\"value\":[32]},null,{\"inputValue\":[\"onInputValueChange\"]}]]],[\"zonos-text\",[[1,\"zonos-text\",{\"textColor\":[1,\"text-color\"],\"size\":[1],\"type\":[1],\"weight\":[2],\"ready\":[32]}]]],[\"zonos-banner\",[[1,\"zonos-banner\",{\"bannerTitle\":[1,\"banner-title\"],\"intent\":[1],\"hasContent\":[32]}]]],[\"zonos-country-flag\",[[1,\"zonos-country-flag\",{\"countryCode\":[1,\"country-code\"],\"size\":[2]}]]],[\"zonos-v-stack\",[[1,\"zonos-v-stack\",{\"spacing\":[2]}]]],[\"zonos-empty-state-payment_4\",[[1,\"zonos-empty-state-payment\",{\"emptyStateText\":[1,\"empty-state-text\"],\"theme\":[1]}],[2,\"zonos-payment\",{\"titleText\":[1,\"title-text\"],\"stripe\":[32],\"stripeElements\":[32]},null,{\"stripeElements\":[\"watchInitStripe\"],\"stripe\":[\"watchInitStripe\"]}],[2,\"zonos-paypal-payment\"],[1,\"zonos-notification\",{\"notificationArray\":[32],\"showNotification\":[64]}]]],[\"zonos-button_3\",[[17,\"zonos-button\",{\"buttonColor\":[1,\"button-color\"],\"backgroundColor\":[1,\"background-color\"],\"borderStyle\":[1,\"border-style\"],\"isDisabled\":[4,\"is-disabled\"],\"icon\":[16],\"iconRight\":[4,\"icon-right\"],\"size\":[1],\"variant\":[1],\"noBackground\":[4,\"no-background\"],\"withBoxShadow\":[4,\"with-box-shadow\"],\"noPaddingLeft\":[4,\"no-padding-left\"],\"noPaddingRight\":[4,\"no-padding-right\"],\"loading\":[4],\"justifyContent\":[1,\"justify-content\"],\"bold\":[4],\"theme\":[1],\"hasIcon\":[32],\"hasContent\":[32]},[[2,\"click\",\"clickHandler\"]],{\"icon\":[\"iconChangeHandler\"]}],[1,\"zonos-spinner\",{\"size\":[2],\"spinnerColor\":[1,\"spinner-color\"]}],[1,\"zonos-icon\",{\"autoHeight\":[4,\"auto-height\"],\"iconColor\":[1,\"icon-color\"],\"content\":[1],\"size\":[2]}]]],[\"zonos-language-select_2\",[[1,\"zonos-language-select\",{\"handleOnClose\":[16]}],[1,\"zonos-select-dialog-header\",{\"handleOnClose\":[16],\"label\":[1]}]]],[\"zonos-country-select_4\",[[1,\"zonos-country-select\",{\"handleOnClose\":[16],\"inputValue\":[32]}],[1,\"zonos-hello-dialog-footer\",{\"appearanceSettings\":[16],\"setShowCountrySelect\":[16],\"setShowLanguageSelect\":[16]}],[1,\"zonos-custom-message\",{\"icon\":[1],\"message\":[1]}],[2,\"zonos-virtual-scroll\",{\"renderItem\":[16],\"itemWidth\":[2,\"item-width\"],\"fallbackItemHeight\":[2,\"fallback-item-height\"],\"itemHeights\":[16],\"container\":[32],\"scrollTop\":[32],\"totalHeight\":[32]},null,{\"itemHeights\":[\"updateTotalHeight\"],\"fallbackItemHeight\":[\"updateTotalHeight\"]}]]],[\"zonos-address_7\",[[1,\"zonos-address-update-dialog\",{\"continueLoading\":[4,\"continue-loading\"],\"dialogLoading\":[4,\"dialog-loading\"],\"dialogOpen\":[4,\"dialog-open\"],\"submitBtnType\":[1,\"submit-btn-type\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"isMobile\":[4,\"is-mobile\"],\"shippingAddress\":[16],\"billingAddress\":[16],\"translatedShippingAddress\":[16],\"translatedBillingAddress\":[16],\"showErrorBanner\":[32],\"translatedShippingAddressState\":[32],\"translatedBillingAddressState\":[32]},null,{\"translatedShippingAddress\":[\"watchTranslatedShippingAddress\"],\"translatedBillingAddress\":[\"watchTranslatedBillingAddress\"]}],[2,\"zonos-address\",{\"type\":[1],\"titleText\":[1,\"title-text\"],\"defaultAddress\":[16],\"stripe\":[32],\"isDirtyAddress\":[32]},null,{\"stripe\":[\"watchInitStripe\"],\"defaultAddress\":[\"defaultAddressChanged\"]}],[2,\"zonos-link-authentication\",{\"titleText\":[1,\"title-text\"],\"defaultEmail\":[1,\"default-email\"],\"isEmailError\":[4,\"is-email-error\"],\"stripe\":[32],\"isStagingMode\":[32],\"clientSecret\":[32]},null,{\"isStagingMode\":[\"watchIsStagingMode\"],\"stripe\":[\"watchInitStripe\"],\"clientSecret\":[\"watchInitStripe\"],\"defaultEmail\":[\"watchDefaultEmail\"]}],[1,\"zonos-checkbox\",{\"backgroundColor\":[1,\"background-color\"],\"label\":[1],\"isChecked\":[4,\"is-checked\"],\"isDisabled\":[4,\"is-disabled\"],\"size\":[2],\"fontSize\":[1,\"font-size\"],\"borderStyle\":[1,\"border-style\"]},[[1,\"click\",\"onClick\"]]],[1,\"zonos-dialog\",{\"open\":[4],\"headerText\":[1,\"header-text\"],\"width\":[1],\"height\":[1],\"minHeight\":[1,\"min-height\"],\"noHeader\":[4,\"no-header\"],\"noBodyPadding\":[4,\"no-body-padding\"],\"noBorder\":[4,\"no-border\"],\"borderStyle\":[1,\"border-style\"],\"noCloseButton\":[4,\"no-close-button\"],\"noClickOutside\":[4,\"no-click-outside\"],\"mobile\":[4],\"isLoading\":[4,\"is-loading\"],\"isMobile\":[32]},[[9,\"resize\",\"handleWindowResize\"],[4,\"keydown\",\"handleKeyDown\"]]],[1,\"zonos-address-display\",{\"currentAddress\":[16],\"addressType\":[1,\"address-type\"]}],[1,\"zonos-address-form\",{\"currentAddress\":[16],\"translatedAddress\":[16],\"addressType\":[1,\"address-type\"],\"localAddress\":[32]},null,{\"translatedAddress\":[\"watchCurrentAddress\"]}]]],[\"zonos-cart-items_13\",[[2,\"zonos-customer-info\",{\"continueLoading\":[4,\"continue-loading\"],\"submitBtnType\":[1,\"submit-btn-type\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"isMobile\":[4,\"is-mobile\"],\"defaultAddress\":[16],\"showErrorBanner\":[32],\"shippingCountry\":[32],\"isCheckingForRestrictedItems\":[32],\"isValidatingAddress\":[32],\"isTaxIdError\":[32],\"invalidShippingCharacterList\":[32],\"invalidBillingCharacterList\":[32],\"openAddressValidationDialog\":[32],\"isEmailError\":[32]}],[2,\"zonos-checkout-payment\",{\"submitBtnType\":[1,\"submit-btn-type\"],\"continueLoading\":[4,\"continue-loading\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"isMobile\":[4,\"is-mobile\"],\"overridePrimaryColor\":[1,\"override-primary-color\"],\"showErrorBanner\":[32],\"hasStripePaymentError\":[32],\"stagingOrderCreateErrorMessage\":[32],\"internalContinueLoading\":[32]},null,{\"continueLoading\":[\"continueLoadingWatcher\"],\"hasStripePaymentError\":[\"stripePaymentErrorWatcher\"]}],[1,\"zonos-checkout-footer\",{\"mobile\":[4],\"dataTheme\":[1,\"data-theme\"],\"showLanguageDialog\":[32],\"isMobile\":[32]},[[4,\"click\",\"handleGlobalClick\"]],{\"mobile\":[\"handleMobileChange\"]}],[2,\"zonos-shipping\",{\"continueLoading\":[4,\"continue-loading\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"submitBtnType\":[1,\"submit-btn-type\"],\"selectedShippingMethod\":[32],\"collapsedDAPOptions\":[32],\"isSelecting\":[32],\"showErrorBanner\":[32],\"serviceLevelsDDP\":[32],\"serviceLevelsDAP\":[32],\"serviceLevelsOther\":[32],\"serviceLevelsAll\":[32],\"displayBaseCurrency\":[32]}],[1,\"zonos-cart-subtotal\",{\"submitBtnType\":[1,\"submit-btn-type\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"loading\":[32]}],[1,\"zonos-cart-restricted-items\",{\"hide\":[4],\"errorImages\":[32],\"internalCollapsed\":[32],\"firstRender\":[32]}],[1,\"zonos-checkout-finish\",{\"borderRadius\":[1,\"border-radius\"],\"storybookForceStatus\":[1,\"storybook-force-status\"],\"overrideNotification\":[16],\"isLoading\":[32],\"notificationType\":[32],\"notificationTitle\":[32],\"notificationMessages\":[32],\"notificationActionText\":[32],\"order\":[32],\"isWaitingToRedirect\":[32]}],[1,\"zonos-confirm-dialog\",{\"dialogTitle\":[1,\"dialog-title\"],\"dialogIntent\":[1,\"dialog-intent\"],\"dialogSubtitle\":[1,\"dialog-subtitle\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"dialogConfirmBtnText\":[1,\"dialog-confirm-btn-text\"],\"dialogWidth\":[2,\"dialog-width\"],\"dialogCancelBtnText\":[1,\"dialog-cancel-btn-text\"],\"dialogType\":[1,\"dialog-type\"],\"isMobile\":[4,\"is-mobile\"],\"dialogOpen\":[4,\"dialog-open\"],\"noClickOutside\":[4,\"no-click-outside\"]},[[4,\"keydown\",\"handleKeyDown\"]]],[1,\"zonos-checkout-progress-tabs\",{\"tabColor\":[1,\"tab-color\"],\"backgroundColor\":[1,\"background-color\"],\"setTabItems\":[64],\"setTabSelected\":[64]}],[1,\"zonos-review\",{\"mobile\":[4],\"collapsed\":[4],\"isMobile\":[32]},[[9,\"resize\",\"handleWindowResize\"]]],[1,\"zonos-cart-items\",{\"errorImages\":[32]}],[1,\"zonos-currency-toggle\",{\"errorImages\":[32]}],[1,\"zonos-rest-state\",{\"restStateSubtitle\":[1,\"rest-state-subtitle\"],\"restStateTitle\":[1,\"rest-state-title\"],\"restStateType\":[1,\"rest-state-type\"],\"isErrorImageLoad\":[32]}]]]]"), options);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export { defineCustomElements };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z as zonosStore, c as createStore } from './zonosStore-d3c5a0a5.js';
|
|
2
|
-
import { F as validateCheckoutSession, f as stripeStore, e as cartStore, z as stripeStoreHandleInventoryCheck, r as translate, x as cartStoreNextStep, k as cartStoreClearCheckoutInterval } from './cart-
|
|
3
|
-
import { h as handleFetch, l as log, b as logError, j as jsonParse } from './handleFetch-
|
|
2
|
+
import { F as validateCheckoutSession, f as stripeStore, e as cartStore, z as stripeStoreHandleInventoryCheck, r as translate, x as cartStoreNextStep, k as cartStoreClearCheckoutInterval } from './cart-52e208cc.js';
|
|
3
|
+
import { h as handleFetch, l as log, b as logError, j as jsonParse } from './handleFetch-0109fb78.js';
|
|
4
4
|
import { t as tinycolor } from './isDarkColor-446fccb7.js';
|
|
5
5
|
|
|
6
6
|
/*!
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, d as getElement } from './index-d82f06f2.js';
|
|
2
|
-
import { f as stripeStore, V as getFallbackDefaultCountryCode, r as translate, l as localizationStore, e as cartStore } from './cart-
|
|
2
|
+
import { f as stripeStore, V as getFallbackDefaultCountryCode, r as translate, l as localizationStore, e as cartStore } from './cart-52e208cc.js';
|
|
3
3
|
import { z as zonosStore, d as zonosStoreFontFamily } from './zonosStore-d3c5a0a5.js';
|
|
4
4
|
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
5
|
-
import { b as logError, l as log } from './handleFetch-
|
|
5
|
+
import { b as logError, l as log } from './handleFetch-0109fb78.js';
|
|
6
6
|
import { i as isTextContainsNonLatinChars, c as containsNonLatinChars } from './containsNonLatinChars-2d8810c3.js';
|
|
7
7
|
import { c as classes } from './classes-0d95c529.js';
|
|
8
8
|
import { R as RemoveIcon$1 } from './RemoveIcon-9dc5dd1a.js';
|
|
@@ -22,7 +22,7 @@ const ZonosAddress = class {
|
|
|
22
22
|
this.isAutoCompleteAdjusted = false;
|
|
23
23
|
this.type = undefined;
|
|
24
24
|
this.titleText = undefined;
|
|
25
|
-
this.defaultAddress =
|
|
25
|
+
this.defaultAddress = [];
|
|
26
26
|
this.stripe = window.Zonos.stripe;
|
|
27
27
|
this.isDirtyAddress = false;
|
|
28
28
|
}
|
|
@@ -58,19 +58,15 @@ const ZonosAddress = class {
|
|
|
58
58
|
stripeStore.stripeBillingAddressElement = stripeAddressElement;
|
|
59
59
|
}
|
|
60
60
|
async watchInitStripe() {
|
|
61
|
-
var _a, _b;
|
|
62
61
|
this.stripe = window.Zonos.stripe;
|
|
63
62
|
const { stripeAddressEventData, stripeElements } = this.getStripeAddressInstance();
|
|
64
63
|
if (!this.stripe || !stripeElements) {
|
|
65
64
|
logError("Stripe is not initialized. Couldn't load stripe element.");
|
|
66
65
|
return;
|
|
67
66
|
}
|
|
68
|
-
|
|
69
|
-
if
|
|
70
|
-
|
|
71
|
-
// will throw error if key phone exist and its value is empty or 'undefined'.
|
|
72
|
-
(_b = this.defaultAddress) === null || _b === void 0 ? true : delete _b.phone;
|
|
73
|
-
}
|
|
67
|
+
// remove phone from default address if it's not provided, stripe
|
|
68
|
+
// will throw error if key phone exist and its value is empty or 'undefined'.
|
|
69
|
+
const defaultAddress = this.defaultAddress.map(address => (Object.assign(Object.assign({}, address), { name: address.name, phone: address.phone || undefined })));
|
|
74
70
|
const shippableCountries = localizationStore.shippingZoneCountries;
|
|
75
71
|
const shippingZone = shippableCountries
|
|
76
72
|
? Object.values(shippableCountries).map(country => country.code)
|
|
@@ -84,8 +80,8 @@ const ZonosAddress = class {
|
|
|
84
80
|
const addressElement = stripeElements.create('address', {
|
|
85
81
|
allowedCountries: checkoutAllCountries ? [] : allowedCountries,
|
|
86
82
|
// only show the default address if stripeAddressEventData is not provided
|
|
87
|
-
contacts:
|
|
88
|
-
?
|
|
83
|
+
contacts: defaultAddress.length && !stripeAddressEventData
|
|
84
|
+
? this.defaultAddress
|
|
89
85
|
: [],
|
|
90
86
|
defaultValues: {
|
|
91
87
|
address: Object.assign(Object.assign({}, stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address), { country: defaultAddressCountry }),
|
|
@@ -143,12 +139,27 @@ const ZonosAddress = class {
|
|
|
143
139
|
type: this.type,
|
|
144
140
|
});
|
|
145
141
|
}
|
|
146
|
-
defaultAddressChanged() {
|
|
142
|
+
defaultAddressChanged(oldAddress, newAddress) {
|
|
143
|
+
// check if stringified json of oldAddress is different from newAddress
|
|
144
|
+
const oldAddressString = JSON.stringify(oldAddress);
|
|
145
|
+
const newAddressString = JSON.stringify(newAddress);
|
|
146
|
+
// No need to reset address element if the default address is the same
|
|
147
|
+
if (oldAddressString === newAddressString) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
147
150
|
log('Reset address element when default address property is changed', 'info', {
|
|
148
151
|
defaultAddress: this.defaultAddress,
|
|
149
152
|
});
|
|
150
153
|
const stripeElement = this.getStripeAddressInstance().stripeAddressElement;
|
|
154
|
+
stripeElement === null || stripeElement === void 0 ? void 0 : stripeElement.clear();
|
|
151
155
|
stripeElement === null || stripeElement === void 0 ? void 0 : stripeElement.destroy();
|
|
156
|
+
// Reset stripe address event data
|
|
157
|
+
if (this.type === 'shipping') {
|
|
158
|
+
stripeStore.stripeAddressEventData = null;
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
stripeStore.stripeBillingAddressEventData = null;
|
|
162
|
+
}
|
|
152
163
|
void this.watchInitStripe();
|
|
153
164
|
}
|
|
154
165
|
renderCompanyNameInput() {
|
|
@@ -182,7 +193,7 @@ const ZonosAddress = class {
|
|
|
182
193
|
}
|
|
183
194
|
render() {
|
|
184
195
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
185
|
-
return (h(Host, { key: '
|
|
196
|
+
return (h(Host, { key: '455356fe5ca9910fe34df12eb02b499316167bc7', class: "zonos--address zonos--elements" }, h("zonos-text", { key: '44ae4b872ca4aea9e9d8e1cfa0de5e421e4ea524', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), this.renderCompanyNameInput(), h("div", { key: '188976d8eef8c23b41c1b82fc7d5c4d2069fc92b', class: "zonos--address-component" })));
|
|
186
197
|
}
|
|
187
198
|
get el() { return getElement(this); }
|
|
188
199
|
static get watchers() { return {
|
|
@@ -630,7 +641,7 @@ const ZonosLinkAuthentication = class {
|
|
|
630
641
|
// Create and mount the Authentication Element in ${type} mode
|
|
631
642
|
const linkAuthenticationElement = stripeStore.stripeLinkElement ||
|
|
632
643
|
stripeStore.stripeElements.create('linkAuthentication', {
|
|
633
|
-
defaultValues: defaultValues
|
|
644
|
+
defaultValues: defaultValues,
|
|
634
645
|
});
|
|
635
646
|
const linkAuthenticationElementContainer = this.el.querySelector('.zonos--link-authentication-component');
|
|
636
647
|
if (!linkAuthenticationElementContainer) {
|
|
@@ -645,11 +656,33 @@ const ZonosLinkAuthentication = class {
|
|
|
645
656
|
});
|
|
646
657
|
stripeStore.stripeLinkElement = linkAuthenticationElement;
|
|
647
658
|
}
|
|
648
|
-
watchDefaultEmail() {
|
|
649
|
-
|
|
659
|
+
watchDefaultEmail(newDefaultEmail, oldDefaultEmail) {
|
|
660
|
+
var _a, _b;
|
|
661
|
+
log('Default email is changed', 'info', {
|
|
662
|
+
newDefaultEmail,
|
|
663
|
+
oldDefaultEmail,
|
|
664
|
+
});
|
|
665
|
+
if (oldDefaultEmail === newDefaultEmail) {
|
|
650
666
|
return;
|
|
651
667
|
}
|
|
652
|
-
|
|
668
|
+
if (!newDefaultEmail) {
|
|
669
|
+
stripeStore.stripeLinkEventData = null;
|
|
670
|
+
}
|
|
671
|
+
// Only set value for Stripe input input to stripeLinkEventData when checkout is in staging mode
|
|
672
|
+
if (cartStore.isStagingMode) {
|
|
673
|
+
this.setCustomEmailInputToLinkEvent(newDefaultEmail || '');
|
|
674
|
+
return;
|
|
675
|
+
}
|
|
676
|
+
(_a = stripeStore.stripeLinkElement) === null || _a === void 0 ? void 0 : _a.clear();
|
|
677
|
+
(_b = stripeStore.stripeLinkElement) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
678
|
+
stripeStore.stripeLinkElement = null;
|
|
679
|
+
stripeStore.stripeLinkEventData = null;
|
|
680
|
+
log('Reset stripe link element when default email is changed', 'info', {
|
|
681
|
+
defaultEmail: newDefaultEmail,
|
|
682
|
+
});
|
|
683
|
+
setTimeout(() => {
|
|
684
|
+
void this.watchInitStripe();
|
|
685
|
+
}, 5);
|
|
653
686
|
}
|
|
654
687
|
componentDidLoad() {
|
|
655
688
|
// @Watch doesn't get trigger on initial load
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as registerInstance, a as getAssetPath, h, H as Host, F as Fragment, c as createEvent, d as getElement } from './index-d82f06f2.js';
|
|
2
|
-
import { e as cartStore, E as currencyFormat, r as translate, M as cartStoreHasOneEligibleItem, N as stripeStoreApplyPromoCode, O as stripeStoreRemovePromoCode, f as stripeStore, C as stripeStoreReset, d as stripeStoreRetrievePayment, t as trackConversionEvent, P as stripeStoreResetPromoCode, Q as stripeStoreMessageBasedOnStatus, l as localizationStore, x as cartStoreNextStep, R as stripeStoreTranslateAddressToLatin, S as cartStoreUpdateSelectedShippingOption, T as cartStoreGetShippingTransitInfo, U as sortServiceLevelOptionsByAmount } from './cart-
|
|
2
|
+
import { e as cartStore, E as currencyFormat, r as translate, M as cartStoreHasOneEligibleItem, N as stripeStoreApplyPromoCode, O as stripeStoreRemovePromoCode, f as stripeStore, C as stripeStoreReset, d as stripeStoreRetrievePayment, t as trackConversionEvent, P as stripeStoreResetPromoCode, Q as stripeStoreMessageBasedOnStatus, l as localizationStore, x as cartStoreNextStep, R as stripeStoreTranslateAddressToLatin, S as cartStoreUpdateSelectedShippingOption, T as cartStoreGetShippingTransitInfo, U as sortServiceLevelOptionsByAmount } from './cart-52e208cc.js';
|
|
3
3
|
import { c as classes } from './classes-0d95c529.js';
|
|
4
|
-
import { s as submitGtag, c as paypalStoreReset, b as paypalStore, i as isContrastColor } from './paypal-
|
|
4
|
+
import { s as submitGtag, c as paypalStoreReset, b as paypalStore, i as isContrastColor } from './paypal-2e1c560e.js';
|
|
5
5
|
import { z as zonosStore, g as getZonosStoreTheme, d as zonosStoreFontFamily } from './zonosStore-d3c5a0a5.js';
|
|
6
|
-
import { h as handleFetch, l as log, s as sendErrorLog, j as jsonParse, g as getIsTestMode, d as allLogs, b as logError, a as getIsStagingMode } from './handleFetch-
|
|
6
|
+
import { h as handleFetch, l as log, s as sendErrorLog, j as jsonParse, g as getIsTestMode, d as allLogs, b as logError, a as getIsStagingMode } from './handleFetch-0109fb78.js';
|
|
7
7
|
import { c as createCustomEvent } from './createCustomEvent-58159025.js';
|
|
8
8
|
import { g as getBorderRadius } from './getBorderRadius-ada3ccad.js';
|
|
9
9
|
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
@@ -2335,7 +2335,7 @@ const ZonosCustomerInfo = class {
|
|
|
2335
2335
|
this.submitBtnType = undefined;
|
|
2336
2336
|
this.submitBtnColor = undefined;
|
|
2337
2337
|
this.isMobile = false;
|
|
2338
|
-
this.defaultAddress =
|
|
2338
|
+
this.defaultAddress = [];
|
|
2339
2339
|
this.showErrorBanner = false;
|
|
2340
2340
|
this.shippingCountry = '';
|
|
2341
2341
|
this.isCheckingForRestrictedItems = false;
|
|
@@ -2392,7 +2392,7 @@ const ZonosCustomerInfo = class {
|
|
|
2392
2392
|
} }), this.isTaxIdError && (h("zonos-text", { textColor: 'red-600', type: "caption" }, translate('Tax id is required')))));
|
|
2393
2393
|
}
|
|
2394
2394
|
render() {
|
|
2395
|
-
var _a, _b;
|
|
2395
|
+
var _a, _b, _c, _d, _e, _f;
|
|
2396
2396
|
if (!stripeStore.stripeElements) {
|
|
2397
2397
|
return null;
|
|
2398
2398
|
}
|
|
@@ -2411,11 +2411,15 @@ const ZonosCustomerInfo = class {
|
|
|
2411
2411
|
const showBilling = !stripeStore.stripeShippingSameAsBilling;
|
|
2412
2412
|
// Get theme for the update dialog, inherit from the theme, no from this component theme
|
|
2413
2413
|
const theme = getZonosStoreTheme(zonosStore.appearance.theme);
|
|
2414
|
+
// Attempt to get the email from email from customer profile's locations, if not provided, just use the email from root customer profile
|
|
2415
|
+
const defaultEmail = ((_b = this.defaultAddress.find(Boolean)) === null || _b === void 0 ? void 0 : _b.email) ||
|
|
2416
|
+
((_e = (_d = (_c = stripeStore.customerProfile) === null || _c === void 0 ? void 0 : _c.locations) === null || _d === void 0 ? void 0 : _d.find(Boolean)) === null || _e === void 0 ? void 0 : _e.email) ||
|
|
2417
|
+
((_f = stripeStore.customerProfile) === null || _f === void 0 ? void 0 : _f.email);
|
|
2414
2418
|
// start validate on typing after error banner is shown, and hide it if the form is complete
|
|
2415
2419
|
if (this.showErrorBanner) {
|
|
2416
2420
|
this.showErrorBanner = !this.handleValidate();
|
|
2417
2421
|
}
|
|
2418
|
-
return (h(Host, { class: "zonos--customer-info zonos--elements" }, h("div", { class: "zonos--group" }, h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, translate('Customer information')), this.showErrorBanner && (h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, translate('Missing required fields. Make sure all fields are completed.'))), h("zonos-link-authentication", { defaultEmail:
|
|
2422
|
+
return (h(Host, { class: "zonos--customer-info zonos--elements" }, h("div", { class: "zonos--group" }, h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, translate('Customer information')), this.showErrorBanner && (h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, translate('Missing required fields. Make sure all fields are completed.'))), h("zonos-link-authentication", { defaultEmail: defaultEmail, isEmailError: this.isEmailError, onLinkAuthenticationChange: this.handleEmailValidation, titleText: translate('Contact') }), h("zonos-address", { defaultAddress: this.defaultAddress, titleText: translate('Address'), type: "shipping" }), this.renderTaxIdInput(this.shippingCountry), h("zonos-checkbox", { class: "zonos--shipping-same-as-billing-cbx", isChecked: stripeStore.stripeShippingSameAsBilling, label: translate('Shipping address same as billing'), onCheckboxSelected: e => {
|
|
2419
2423
|
stripeStore.stripeShippingSameAsBilling = e.detail;
|
|
2420
2424
|
} }), h("zonos-collapse", { collapsed: !showBilling }, h("zonos-address", { defaultAddress: this.defaultAddress, titleText: translate('Billing address'), type: "billing" })), h("div", { class: "zonos--group-btn" }, h("zonos-button", { backgroundColor: this.submitBtnColor, bold: true, loading: this.continueLoading, onClick: () => this.continueClickHandler(), size: "lg",
|
|
2421
2425
|
// use primary type when on mobile mode
|