@zonos/elements 1.3.207 → 1.3.208
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-4afc683b.js → CheckoutConfig-27c82f94.js} +19 -0
- package/dist/cjs/{cart-3d961c6e.js → cart-47c17ebf.js} +1 -25
- package/dist/cjs/index.cjs.js +28 -8
- package/dist/cjs/{localization-ff33875b.js → localization-e9089be5.js} +1 -0
- package/dist/cjs/{paypal-dee5c109.js → paypal-3a803d21.js} +2 -2
- package/dist/cjs/updateCheckoutSessionAttributes-d0332530.js +50 -0
- package/dist/cjs/zonos-address_11.cjs.entry.js +2 -2
- package/dist/cjs/zonos-cart-items_14.cjs.entry.js +13 -14
- package/dist/cjs/zonos-checkout.cjs.entry.js +47 -15
- package/dist/cjs/zonos-controller.cjs.entry.js +2 -2
- 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-empty-state-payment_4.cjs.entry.js +3 -3
- 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/collection/components/checkout/zonos-checkout/zonos-checkout.js +43 -12
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +9 -12
- package/dist/collection/components/store/checkout/stripe.js +0 -24
- package/dist/collection/components/store/hello/localization.js +1 -0
- package/dist/collection/components/utils/api/updateCheckoutSessionAttributes.js +46 -0
- package/dist/collection/components/utils/checkout/getAbandonedCartRenewTokenValue.js +17 -0
- package/dist/collection/scripts/_getCartInfoById.js +3 -0
- package/dist/collection/types/checkout/api/CheckoutSession.js +14 -1
- package/dist/collection/types/generated/graphql.frontend.types.js +2 -0
- package/dist/collection/types/generated/graphql.internal.types.js +12 -0
- package/dist/esm/{CheckoutConfig-eb7d6954.js → CheckoutConfig-724d7bae.js} +19 -1
- package/dist/esm/{cart-5835676d.js → cart-5b417c0d.js} +4 -28
- package/dist/esm/{debounce-eaee3a94.js → debounce-7ebfa15b.js} +1 -1
- package/dist/esm/{getBorderRadius-b18c924f.js → getBorderRadius-174305ff.js} +1 -1
- package/dist/esm/index.js +27 -10
- package/dist/esm/{isDarkColor-d8bb8659.js → isDarkColor-915b06b8.js} +1 -1
- package/dist/esm/{localization-4c7f64e8.js → localization-669a1714.js} +2 -1
- package/dist/esm/{paypal-b4f106be.js → paypal-3a0cf86b.js} +4 -4
- package/dist/esm/updateCheckoutSessionAttributes-183ca6c1.js +48 -0
- package/dist/esm/zonos-address_11.entry.js +6 -6
- package/dist/esm/zonos-badge.entry.js +1 -1
- package/dist/esm/zonos-banner.entry.js +1 -1
- package/dist/esm/zonos-button_3.entry.js +3 -3
- package/dist/esm/zonos-card.entry.js +2 -2
- package/dist/esm/zonos-cart-items_14.entry.js +16 -17
- package/dist/esm/zonos-checkout.entry.js +50 -18
- package/dist/esm/zonos-collapse.entry.js +1 -1
- package/dist/esm/zonos-controller.entry.js +5 -5
- package/dist/esm/zonos-country-flag.entry.js +2 -2
- package/dist/esm/zonos-country-select_4.entry.js +3 -3
- package/dist/esm/zonos-empty-state-payment_4.entry.js +6 -6
- package/dist/esm/zonos-hello-dialog.entry.js +2 -2
- package/dist/esm/zonos-hello.entry.js +3 -3
- package/dist/esm/zonos-input.entry.js +2 -2
- package/dist/esm/zonos-language-select_2.entry.js +2 -2
- package/dist/esm/zonos-logo.entry.js +1 -1
- package/dist/esm/zonos-shipping-rich-radio.entry.js +2 -2
- package/dist/esm/zonos-stripe-input.entry.js +3 -3
- package/dist/esm/zonos-text.entry.js +1 -1
- package/dist/esm/zonos-toggle.entry.js +1 -1
- package/dist/esm/zonos-v-stack.entry.js +1 -1
- package/dist/esm/{zonosStore-1e015fa5.js → zonosStore-504a7030.js} +1 -1
- package/dist/esm-es5/CheckoutConfig-724d7bae.js +1 -0
- package/dist/esm-es5/{cart-5835676d.js → cart-5b417c0d.js} +1 -1
- package/dist/esm-es5/{debounce-eaee3a94.js → debounce-7ebfa15b.js} +1 -1
- package/dist/esm-es5/{getBorderRadius-b18c924f.js → getBorderRadius-174305ff.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{isDarkColor-d8bb8659.js → isDarkColor-915b06b8.js} +1 -1
- package/dist/esm-es5/{localization-4c7f64e8.js → localization-669a1714.js} +1 -1
- package/dist/esm-es5/{paypal-b4f106be.js → paypal-3a0cf86b.js} +1 -1
- package/dist/esm-es5/updateCheckoutSessionAttributes-183ca6c1.js +1 -0
- package/dist/esm-es5/zonos-address_11.entry.js +1 -1
- package/dist/esm-es5/zonos-badge.entry.js +1 -1
- package/dist/esm-es5/zonos-banner.entry.js +1 -1
- package/dist/esm-es5/zonos-button_3.entry.js +1 -1
- package/dist/esm-es5/zonos-card.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_14.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-collapse.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-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-input.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-logo.entry.js +1 -1
- package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
- package/dist/esm-es5/zonos-stripe-input.entry.js +1 -1
- package/dist/esm-es5/zonos-text.entry.js +1 -1
- package/dist/esm-es5/zonos-toggle.entry.js +1 -1
- package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
- package/dist/esm-es5/{zonosStore-1e015fa5.js → zonosStore-504a7030.js} +1 -1
- package/dist/scripts/index.d.ts +2 -0
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +2 -0
- package/dist/types/components/utils/api/updateCheckoutSessionAttributes.d.ts +7 -0
- package/dist/types/components/utils/checkout/getAbandonedCartRenewTokenValue.d.ts +1 -0
- package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +1 -0
- package/dist/types/types/checkout/api/CheckoutSession.d.ts +14 -0
- package/dist/types/types/checkout/api/NormalizedTempCart.d.ts +2 -0
- package/dist/types/types/generated/graphql.frontend.types.d.ts +2 -0
- package/dist/types/types/generated/graphql.frontend.types.ts +2 -0
- package/dist/types/types/generated/graphql.internal.types.d.ts +40 -0
- package/dist/types/types/generated/graphql.internal.types.ts +79 -0
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-265af369.system.entry.js → p-02463cc1.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-eca09508.system.entry.js → p-066afca1.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-74bcb5cc.entry.js → p-0731fbba.entry.js} +1 -1
- package/dist/zonos-elements/{p-bab19e2a.entry.js → p-07905246.entry.js} +1 -1
- package/dist/zonos-elements/{p-9f78b79e.entry.js → p-0794c530.entry.js} +1 -1
- package/dist/zonos-elements/{p-019f8637.entry.js → p-081fa4a8.entry.js} +1 -1
- package/dist/zonos-elements/{p-1327b935.system.js → p-0d908c15.system.js} +1 -1
- package/dist/zonos-elements/p-0f368368.system.js +1 -0
- package/dist/zonos-elements/p-0fb14108.entry.js +1 -0
- package/dist/zonos-elements/{p-93aeba62.system.entry.js → p-1530f958.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-2866fd29.system.entry.js → p-160da12a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-c4e0f49a.system.entry.js → p-1b3e92ea.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-4cb8b87f.system.entry.js → p-1f706fc9.system.entry.js} +1 -1
- package/dist/zonos-elements/p-2d4e0280.entry.js +1 -0
- package/dist/zonos-elements/{p-abe218ab.system.entry.js → p-39039ab7.system.entry.js} +1 -1
- package/dist/zonos-elements/p-39428328.system.js +1 -0
- package/dist/zonos-elements/{p-620deb03.system.entry.js → p-3d6f6367.system.entry.js} +1 -1
- package/dist/zonos-elements/p-3ee44728.system.js +1 -1
- package/dist/zonos-elements/{p-f9664811.js → p-40a2a649.js} +1 -1
- package/dist/zonos-elements/p-40a4c8a2.system.js +1 -0
- package/dist/zonos-elements/{p-c666d557.system.js → p-4451a598.system.js} +1 -1
- package/dist/zonos-elements/{p-ed20f2f7.js → p-4bf54953.js} +1 -1
- package/dist/zonos-elements/{p-abc83d01.entry.js → p-4f04b499.entry.js} +1 -1
- package/dist/zonos-elements/{p-f4d741de.system.entry.js → p-51d596a0.system.entry.js} +1 -1
- package/dist/zonos-elements/p-5539386e.system.entry.js +1 -0
- package/dist/zonos-elements/{p-1bc09abe.system.entry.js → p-5c772fab.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-42a9557f.entry.js → p-5d909d3d.entry.js} +1 -1
- package/dist/zonos-elements/{p-e337fa88.js → p-5f2a2ca7.js} +1 -1
- package/dist/zonos-elements/{p-1aa24297.system.entry.js → p-63ca1242.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-0c4c8d63.entry.js → p-67f807bc.entry.js} +1 -1
- package/dist/zonos-elements/{p-3196bf98.entry.js → p-6b406abd.entry.js} +1 -1
- package/dist/zonos-elements/{p-9b8a5372.entry.js → p-6be43ba8.entry.js} +1 -1
- package/dist/zonos-elements/{p-536f69eb.entry.js → p-6c991320.entry.js} +1 -1
- package/dist/zonos-elements/{p-469ccc66.system.entry.js → p-7e346632.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-91c996d3.system.js → p-7f568108.system.js} +1 -1
- package/dist/zonos-elements/{p-858b7908.system.entry.js → p-803e59d2.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-666164d9.system.js → p-91553cf0.system.js} +1 -1
- package/dist/zonos-elements/{p-1ad099ec.system.entry.js → p-963fa567.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-4fb88ebc.system.entry.js → p-a09bdd20.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-edcfb3a3.js → p-a158b406.js} +1 -1
- package/dist/zonos-elements/{p-3afc27ef.entry.js → p-a3a8ba10.entry.js} +1 -1
- package/dist/zonos-elements/p-a4d995a2.system.js +1 -0
- package/dist/zonos-elements/{p-719e14a8.system.entry.js → p-a63bac79.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-22cb6880.system.entry.js → p-a958c4f0.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-7777d85f.system.entry.js → p-ab6efb03.system.entry.js} +1 -1
- package/dist/zonos-elements/p-b2d81c98.js +1 -0
- package/dist/zonos-elements/{p-16678764.js → p-b3fa7f19.js} +1 -1
- package/dist/zonos-elements/{p-658936c9.js → p-b7a5b367.js} +2 -2
- package/dist/zonos-elements/{p-848e08e8.entry.js → p-bb850bb7.entry.js} +1 -1
- package/dist/zonos-elements/{p-4e9c8f9e.system.js → p-c5455a34.system.js} +1 -1
- package/dist/zonos-elements/{p-41c1d7c4.entry.js → p-c607d026.entry.js} +1 -1
- package/dist/zonos-elements/p-c740353c.js +1 -0
- package/dist/zonos-elements/{p-eb2560b6.system.entry.js → p-cd376c7a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-5616b304.entry.js → p-d096d7f2.entry.js} +1 -1
- package/dist/zonos-elements/{p-e0587eeb.entry.js → p-d1a31577.entry.js} +1 -1
- package/dist/zonos-elements/{p-9fa17353.js → p-d35d17f3.js} +1 -1
- package/dist/zonos-elements/{p-9e9ac7a2.system.js → p-d5bdbbb3.system.js} +1 -1
- package/dist/zonos-elements/{p-18149db1.entry.js → p-da304b78.entry.js} +1 -1
- package/dist/zonos-elements/{p-12cd9d3a.entry.js → p-e1c2b8f8.entry.js} +1 -1
- package/dist/zonos-elements/p-ea30d92d.system.entry.js +1 -0
- package/dist/zonos-elements/{p-47e2cd31.entry.js → p-ef594c0c.entry.js} +1 -1
- package/dist/zonos-elements/p-f1f3a846.entry.js +1 -0
- package/dist/zonos-elements/{p-30778fde.system.entry.js → p-f49834d4.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-b21b0330.entry.js → p-fc3a6495.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/CheckoutConfig-eb7d6954.js +0 -1
- package/dist/zonos-elements/p-0de2c731.system.js +0 -1
- package/dist/zonos-elements/p-3a50124e.entry.js +0 -1
- package/dist/zonos-elements/p-3f1a2d31.js +0 -1
- package/dist/zonos-elements/p-5e1b2654.system.js +0 -1
- package/dist/zonos-elements/p-a2b55d11.entry.js +0 -1
- package/dist/zonos-elements/p-aafcd40f.system.entry.js +0 -1
- package/dist/zonos-elements/p-b922c441.system.js +0 -1
- package/dist/zonos-elements/p-ba027b70.system.entry.js +0 -1
- package/dist/zonos-elements/p-dbd23bea.entry.js +0 -1
|
@@ -203,6 +203,7 @@ const updateCheckoutSessionLanguage = async () => {
|
|
|
203
203
|
body: {
|
|
204
204
|
id: storageStore.checkoutSessionId,
|
|
205
205
|
metadata: [
|
|
206
|
+
// This is being used from the backend to determine the language of the checkout session
|
|
206
207
|
{
|
|
207
208
|
key: 'language',
|
|
208
209
|
value: localizationStore.selectedLocale,
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import debounce from "lodash/debounce";
|
|
2
|
+
import { handleFetch } from "../handleFetch";
|
|
3
|
+
import { logError } from "../logging/logError";
|
|
4
|
+
const attributesToUpdate = {};
|
|
5
|
+
// Store debounced functions per session to ensure proper debouncing
|
|
6
|
+
const debouncedFunctions = {};
|
|
7
|
+
const createDebouncedFetch = (sessionId) => {
|
|
8
|
+
return debounce(async () => {
|
|
9
|
+
var _a, _b;
|
|
10
|
+
// Get latest attributes from the map
|
|
11
|
+
const latestAttributes = Array.from(((_a = attributesToUpdate[sessionId]) === null || _a === void 0 ? void 0 : _a.entries()) || []).map(([key, value]) => ({ key, value }));
|
|
12
|
+
const { errors, json } = await handleFetch('/api/zonos-elements/update-checkout-session-attributes', {
|
|
13
|
+
body: {
|
|
14
|
+
attributes: latestAttributes,
|
|
15
|
+
id: sessionId,
|
|
16
|
+
},
|
|
17
|
+
method: 'POST',
|
|
18
|
+
});
|
|
19
|
+
if (errors.length) {
|
|
20
|
+
logError('Error updating checkout session attributes', errors);
|
|
21
|
+
return { success: false };
|
|
22
|
+
}
|
|
23
|
+
(_b = attributesToUpdate[sessionId]) === null || _b === void 0 ? void 0 : _b.clear();
|
|
24
|
+
return { success: !!(json === null || json === void 0 ? void 0 : json.success) };
|
|
25
|
+
}, 1000, { maxWait: 5000 });
|
|
26
|
+
};
|
|
27
|
+
export const updateCheckoutSessionAttributes = async ({ attributes, checkoutSessionId, }) => {
|
|
28
|
+
// Merge the new attributes with the attributes in the list, if key exist, override it
|
|
29
|
+
// init the map if not exist
|
|
30
|
+
attributesToUpdate[checkoutSessionId] || (attributesToUpdate[checkoutSessionId] = new Map());
|
|
31
|
+
attributes.forEach(attribute => {
|
|
32
|
+
var _a;
|
|
33
|
+
if (attribute.value) {
|
|
34
|
+
(_a = attributesToUpdate[checkoutSessionId]) === null || _a === void 0 ? void 0 : _a.set(attribute.key, attribute.value);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
if (!attributes.length) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
// Get or create the debounced function for this session
|
|
41
|
+
if (!debouncedFunctions[checkoutSessionId]) {
|
|
42
|
+
debouncedFunctions[checkoutSessionId] =
|
|
43
|
+
createDebouncedFetch(checkoutSessionId);
|
|
44
|
+
}
|
|
45
|
+
return debouncedFunctions[checkoutSessionId]();
|
|
46
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const getAbandonedCartRenewTokenValue = () => {
|
|
2
|
+
const validityToken = new URLSearchParams(window.location.search).get('validityToken');
|
|
3
|
+
// check if validityToken length is base64 encoded
|
|
4
|
+
if (!validityToken ||
|
|
5
|
+
!/^[A-Za-z0-9+/]+={0,2}$/.test(validityToken) ||
|
|
6
|
+
validityToken.length % 4 !== 0) {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
try {
|
|
10
|
+
// check if it can be decoded
|
|
11
|
+
atob(validityToken);
|
|
12
|
+
return validityToken;
|
|
13
|
+
}
|
|
14
|
+
catch (_a) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { getGenericSettingsOverride } from "../components/utils/api/getGenericSettingsOverride";
|
|
2
|
+
import { getAbandonedCartRenewTokenValue } from "../components/utils/checkout/getAbandonedCartRenewTokenValue";
|
|
2
3
|
import { getIsTestMode } from "../components/utils/checkout/getIsTestMode";
|
|
3
4
|
import { handleFetch } from "../components/utils/handleFetch";
|
|
4
5
|
import { log } from "../components/utils/logging/log";
|
|
5
6
|
export const getCartInfoById = async ({ cartId, retries, }) => {
|
|
6
7
|
const isTestMode = getIsTestMode();
|
|
7
8
|
const overrideSettings = getGenericSettingsOverride();
|
|
9
|
+
const renewCartExpirationToken = getAbandonedCartRenewTokenValue() || undefined;
|
|
8
10
|
const params = new URLSearchParams();
|
|
9
11
|
if (overrideSettings.overrideShouldEnabledCustomAddress) {
|
|
10
12
|
params.set('overrideShouldEnabledCustomAddress', overrideSettings.overrideShouldEnabledCustomAddress);
|
|
@@ -12,6 +14,7 @@ export const getCartInfoById = async ({ cartId, retries, }) => {
|
|
|
12
14
|
const { errors, json, zonosMode } = await handleFetch(`/api/zonos-elements/get-cart?${params.toString()}`, {
|
|
13
15
|
body: {
|
|
14
16
|
isTestMode,
|
|
17
|
+
renewCartExpirationToken,
|
|
15
18
|
tempCartUUID: cartId,
|
|
16
19
|
},
|
|
17
20
|
headers: {
|
|
@@ -1 +1,14 @@
|
|
|
1
|
-
export
|
|
1
|
+
export const checkoutSessionMutableAttributeKeys = [
|
|
2
|
+
'ZONOS_FORM_TYPE_USING',
|
|
3
|
+
'APP_VERSION',
|
|
4
|
+
'APP_VERSION_NPM_INTEGRATION',
|
|
5
|
+
'LEGACY_CHECKOUT_FACADE',
|
|
6
|
+
];
|
|
7
|
+
export const checkoutSessionImmutableAttributeKeys = [
|
|
8
|
+
'ORDER_DUPLICATION_CONSENT',
|
|
9
|
+
'WITH_ABANDONED_CART_TOKEN',
|
|
10
|
+
];
|
|
11
|
+
export const checkoutSessionAttributeKeys = [
|
|
12
|
+
...checkoutSessionMutableAttributeKeys,
|
|
13
|
+
...checkoutSessionImmutableAttributeKeys,
|
|
14
|
+
];
|
|
@@ -2883,6 +2883,9 @@ export function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
2883
2883
|
checkoutSessionUpdate(variables, requestHeaders) {
|
|
2884
2884
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'checkoutSessionUpdate', 'mutation');
|
|
2885
2885
|
},
|
|
2886
|
+
checkoutSessionUpdateAttributes(variables, requestHeaders) {
|
|
2887
|
+
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'checkoutSessionUpdateAttributes', 'mutation');
|
|
2888
|
+
},
|
|
2886
2889
|
checkoutSessionUpdateMetadata(variables, requestHeaders) {
|
|
2887
2890
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'checkoutSessionUpdateMetadata', 'mutation');
|
|
2888
2891
|
},
|
|
@@ -2910,6 +2913,9 @@ export function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
2910
2913
|
getCheckoutSession(variables, requestHeaders) {
|
|
2911
2914
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'getCheckoutSession', 'query');
|
|
2912
2915
|
},
|
|
2916
|
+
getCheckoutSessionAttributes(variables, requestHeaders) {
|
|
2917
|
+
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'getCheckoutSessionAttributes', 'query');
|
|
2918
|
+
},
|
|
2913
2919
|
getInclusivePriceSettingByCountry(variables, requestHeaders) {
|
|
2914
2920
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'getInclusivePriceSettingByCountry', 'query');
|
|
2915
2921
|
},
|
|
@@ -2928,6 +2934,9 @@ export function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
2928
2934
|
helloSettings(variables, requestHeaders) {
|
|
2929
2935
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'helloSettings', 'query');
|
|
2930
2936
|
},
|
|
2937
|
+
landedCostSettings(variables, requestHeaders) {
|
|
2938
|
+
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'landedCostSettings', 'query');
|
|
2939
|
+
},
|
|
2931
2940
|
onlineStoreSettings(variables, requestHeaders) {
|
|
2932
2941
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'onlineStoreSettings', 'query');
|
|
2933
2942
|
},
|
|
@@ -2958,6 +2967,9 @@ export function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
2958
2967
|
removeTrackingNumber(variables, requestHeaders) {
|
|
2959
2968
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'removeTrackingNumber', 'mutation');
|
|
2960
2969
|
},
|
|
2970
|
+
renewCartExpirationToken(variables, requestHeaders) {
|
|
2971
|
+
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'renewCartExpirationToken', 'mutation');
|
|
2972
|
+
},
|
|
2961
2973
|
selectCheckoutVarianceTest(variables, requestHeaders) {
|
|
2962
2974
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'selectCheckoutVarianceTest', 'mutation');
|
|
2963
2975
|
},
|
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
const getAbandonedCartRenewTokenValue = () => {
|
|
2
|
+
const validityToken = new URLSearchParams(window.location.search).get('validityToken');
|
|
3
|
+
// check if validityToken length is base64 encoded
|
|
4
|
+
if (!validityToken ||
|
|
5
|
+
!/^[A-Za-z0-9+/]+={0,2}$/.test(validityToken) ||
|
|
6
|
+
validityToken.length % 4 !== 0) {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
try {
|
|
10
|
+
// check if it can be decoded
|
|
11
|
+
atob(validityToken);
|
|
12
|
+
return validityToken;
|
|
13
|
+
}
|
|
14
|
+
catch (_a) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
1
19
|
const baseRe = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/;
|
|
2
20
|
const uuidRe = new RegExp(`^${baseRe.source}$`);
|
|
3
21
|
const cartUuidRe = new RegExp(`^cart_${baseRe.source}$`);
|
|
@@ -29,4 +47,4 @@ const checkoutHiddenBtnSelector = 'zonos--checkout-hidden-button';
|
|
|
29
47
|
const checkoutHiddenInternationalBtnSelector = 'zonos--checkout-hidden-international-button';
|
|
30
48
|
const domesticRedirectedBtnSelector = 'zonos--domestic-redirected-checkout-button';
|
|
31
49
|
|
|
32
|
-
export { _getIsValidCartId as _, checkoutHiddenInternationalBtnSelector as a, checkoutHiddenBtnSelector as c, domesticRedirectedBtnSelector as d };
|
|
50
|
+
export { _getIsValidCartId as _, checkoutHiddenInternationalBtnSelector as a, checkoutHiddenBtnSelector as c, domesticRedirectedBtnSelector as d, getAbandonedCartRenewTokenValue as g };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { z as zonosStore, c as createStore } from './zonosStore-
|
|
2
|
-
import { s as storageStore, l as localizationStore, t as translate, f as filterValidTests, b as storageStoreSetEnabledVariantTestKeys } from './localization-
|
|
1
|
+
import { z as zonosStore, c as createStore } from './zonosStore-504a7030.js';
|
|
2
|
+
import { s as storageStore, l as localizationStore, t as translate, f as filterValidTests, b as storageStoreSetEnabledVariantTestKeys } from './localization-669a1714.js';
|
|
3
3
|
import { l as log, f as fallbackApiList, h as handleFetch, g as getIsTestMode, a as getIsStagingMode, s as sendErrorLog, d as allLogs, b as logError, j as jsonParse } from './handleFetch-621e45bc.js';
|
|
4
|
-
import { i as isDarkColor } from './isDarkColor-
|
|
5
|
-
import { g as getBorderRadius } from './getBorderRadius-
|
|
4
|
+
import { i as isDarkColor } from './isDarkColor-915b06b8.js';
|
|
5
|
+
import { g as getBorderRadius } from './getBorderRadius-174305ff.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Extract value from translated object
|
|
@@ -1175,18 +1175,6 @@ const getCheckoutSessionBody = () => {
|
|
|
1175
1175
|
key: 'language',
|
|
1176
1176
|
value: localizationStore.selectedLocale,
|
|
1177
1177
|
},
|
|
1178
|
-
{
|
|
1179
|
-
key: 'appVersion',
|
|
1180
|
-
value: window.Zonos.version,
|
|
1181
|
-
},
|
|
1182
|
-
{
|
|
1183
|
-
key: 'appVersionNpmIntegration',
|
|
1184
|
-
value: window.Zonos.isNpm ? '1' : '0',
|
|
1185
|
-
},
|
|
1186
|
-
{
|
|
1187
|
-
key: 'legacyCheckoutFacade',
|
|
1188
|
-
value: window.Zonos.isLegacyCheckout ? '1' : '0',
|
|
1189
|
-
},
|
|
1190
1178
|
],
|
|
1191
1179
|
presentmentCountryCode: localizationStore.selectedCountryCode,
|
|
1192
1180
|
skipPaymentIntent: stripeStore.skipPaymentIntent,
|
|
@@ -1334,18 +1322,6 @@ const stripeStoreUpdateCheckoutSession = async ({ adjustmentsAmount, cartId, cur
|
|
|
1334
1322
|
key: 'language',
|
|
1335
1323
|
value: localizationStore.selectedLocale,
|
|
1336
1324
|
},
|
|
1337
|
-
{
|
|
1338
|
-
key: 'appVersion',
|
|
1339
|
-
value: window.Zonos.version,
|
|
1340
|
-
},
|
|
1341
|
-
{
|
|
1342
|
-
key: 'appVersionNpmIntegration',
|
|
1343
|
-
value: window.Zonos.isNpm ? '1' : '0',
|
|
1344
|
-
},
|
|
1345
|
-
{
|
|
1346
|
-
key: 'legacyCheckoutFacade',
|
|
1347
|
-
value: window.Zonos.isLegacyCheckout ? '1' : '0',
|
|
1348
|
-
},
|
|
1349
1325
|
],
|
|
1350
1326
|
presentmentCountryCode,
|
|
1351
1327
|
skipPaymentIntent: stripeStore.skipPaymentIntent,
|
package/dist/esm/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { c as createCustomEvent } from './createCustomEvent-58159025.js';
|
|
2
2
|
import { g as getGenericSettingsOverride, I as IframeService } from './getGenericSettingsOverride-0bc3e118.js';
|
|
3
3
|
import { g as getIsTestMode, a as getIsStagingMode, l as log, h as handleFetch, b as logError } from './handleFetch-621e45bc.js';
|
|
4
|
-
import { _ as _getIsValidCartId, c as checkoutHiddenBtnSelector, a as checkoutHiddenInternationalBtnSelector } from './CheckoutConfig-
|
|
5
|
-
export { c as checkoutHiddenBtnSelector, a as checkoutHiddenInternationalBtnSelector, d as domesticRedirectedBtnSelector } from './CheckoutConfig-
|
|
4
|
+
import { g as getAbandonedCartRenewTokenValue, _ as _getIsValidCartId, c as checkoutHiddenBtnSelector, a as checkoutHiddenInternationalBtnSelector } from './CheckoutConfig-724d7bae.js';
|
|
5
|
+
export { c as checkoutHiddenBtnSelector, a as checkoutHiddenInternationalBtnSelector, d as domesticRedirectedBtnSelector } from './CheckoutConfig-724d7bae.js';
|
|
6
6
|
export { a as availableTestKeys } from './VarianceTest-fef2d958.js';
|
|
7
7
|
export { c as countryRequireTaxId, e as euCountryCodes, s as shipToTaxIdLabels } from './TaxId-50d72254.js';
|
|
8
8
|
|
|
@@ -129,7 +129,7 @@ const getZonosQaUrl = () => {
|
|
|
129
129
|
return null;
|
|
130
130
|
}
|
|
131
131
|
const qaUrl = extractZonosQaUrl(window.location.href);
|
|
132
|
-
const cdnUrl = "https://v1.3.
|
|
132
|
+
const cdnUrl = "https://v1.3.208.js.zonos.com";
|
|
133
133
|
// when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
|
|
134
134
|
if (!qaUrl &&
|
|
135
135
|
(cdnUrl.includes('test.') ||
|
|
@@ -299,6 +299,7 @@ const getCartIdFromQueryParam = () => {
|
|
|
299
299
|
const getCartInfoById = async ({ cartId, retries, }) => {
|
|
300
300
|
const isTestMode = getIsTestMode();
|
|
301
301
|
const overrideSettings = getGenericSettingsOverride();
|
|
302
|
+
const renewCartExpirationToken = getAbandonedCartRenewTokenValue() || undefined;
|
|
302
303
|
const params = new URLSearchParams();
|
|
303
304
|
if (overrideSettings.overrideShouldEnabledCustomAddress) {
|
|
304
305
|
params.set('overrideShouldEnabledCustomAddress', overrideSettings.overrideShouldEnabledCustomAddress);
|
|
@@ -306,6 +307,7 @@ const getCartInfoById = async ({ cartId, retries, }) => {
|
|
|
306
307
|
const { errors, json, zonosMode } = await handleFetch(`/api/zonos-elements/get-cart?${params.toString()}`, {
|
|
307
308
|
body: {
|
|
308
309
|
isTestMode,
|
|
310
|
+
renewCartExpirationToken,
|
|
309
311
|
tempCartUUID: cartId,
|
|
310
312
|
},
|
|
311
313
|
headers: {
|
|
@@ -370,10 +372,10 @@ const zonosLoadUrl = (() => {
|
|
|
370
372
|
}
|
|
371
373
|
return null;
|
|
372
374
|
})();
|
|
373
|
-
const ZONOS_URL = "https://v1.3.
|
|
374
|
-
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.
|
|
375
|
-
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.
|
|
376
|
-
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.
|
|
375
|
+
const ZONOS_URL = "https://v1.3.208.js.zonos.com";
|
|
376
|
+
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.208";
|
|
377
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.208";
|
|
378
|
+
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.208";
|
|
377
379
|
const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
|
|
378
380
|
const GOOGLE_FONT_REGEX = /^https:\/\/fonts\.googleapis\.com/;
|
|
379
381
|
class Zonos {
|
|
@@ -391,7 +393,7 @@ Zonos.iframeLogType = typeof window !== 'undefined'
|
|
|
391
393
|
? new URLSearchParams(window.location.search).get('iframeLogType')
|
|
392
394
|
: null;
|
|
393
395
|
Zonos.isBigCommerce = false;
|
|
394
|
-
Zonos.releaseDate = "
|
|
396
|
+
Zonos.releaseDate = "1748878470643";
|
|
395
397
|
Zonos.isLegacyCheckout = false;
|
|
396
398
|
Zonos.domain = typeof window !== 'undefined'
|
|
397
399
|
? // domain that embeds the iframe
|
|
@@ -409,7 +411,7 @@ Zonos.isNpm = true;
|
|
|
409
411
|
Zonos.zonosQaUrl = null;
|
|
410
412
|
Zonos.zonosQaUrlApi = null;
|
|
411
413
|
Zonos.trackEventLogs = [];
|
|
412
|
-
Zonos.version = `v${"1.3.
|
|
414
|
+
Zonos.version = `v${"1.3.208"}`;
|
|
413
415
|
Zonos.modeAlerted = false;
|
|
414
416
|
Zonos.cartData = null;
|
|
415
417
|
Zonos.paypal = null;
|
|
@@ -921,4 +923,19 @@ Zonos.injectSupportGoogleFont = (fontUrl) => {
|
|
|
921
923
|
log(`[FONT] ${fontFamily} font injected!`);
|
|
922
924
|
};
|
|
923
925
|
|
|
924
|
-
|
|
926
|
+
const checkoutSessionMutableAttributeKeys = [
|
|
927
|
+
'ZONOS_FORM_TYPE_USING',
|
|
928
|
+
'APP_VERSION',
|
|
929
|
+
'APP_VERSION_NPM_INTEGRATION',
|
|
930
|
+
'LEGACY_CHECKOUT_FACADE',
|
|
931
|
+
];
|
|
932
|
+
const checkoutSessionImmutableAttributeKeys = [
|
|
933
|
+
'ORDER_DUPLICATION_CONSENT',
|
|
934
|
+
'WITH_ABANDONED_CART_TOKEN',
|
|
935
|
+
];
|
|
936
|
+
const checkoutSessionAttributeKeys = [
|
|
937
|
+
...checkoutSessionMutableAttributeKeys,
|
|
938
|
+
...checkoutSessionImmutableAttributeKeys,
|
|
939
|
+
];
|
|
940
|
+
|
|
941
|
+
export { Zonos, checkoutSessionAttributeKeys, checkoutSessionImmutableAttributeKeys, checkoutSessionMutableAttributeKeys };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as createStore, z as zonosStore } from './zonosStore-
|
|
1
|
+
import { c as createStore, z as zonosStore } from './zonosStore-504a7030.js';
|
|
2
2
|
import { l as log, j as jsonParse, h as handleFetch, b as logError } from './handleFetch-621e45bc.js';
|
|
3
3
|
import { a as availableTestKeys } from './VarianceTest-fef2d958.js';
|
|
4
4
|
|
|
@@ -14007,6 +14007,7 @@ const updateCheckoutSessionLanguage = async () => {
|
|
|
14007
14007
|
body: {
|
|
14008
14008
|
id: storageStore.checkoutSessionId,
|
|
14009
14009
|
metadata: [
|
|
14010
|
+
// This is being used from the backend to determine the language of the checkout session
|
|
14010
14011
|
{
|
|
14011
14012
|
key: 'language',
|
|
14012
14013
|
value: localizationStore.selectedLocale,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { z as zonosStore, c as createStore } from './zonosStore-
|
|
2
|
-
import { t as trackConversionEvent, z as validateCheckoutSession, c as stripeStore, e as cartStore, v as stripeStoreHandleInventoryCheck, r as cartStoreNextStep, j as cartStoreClearCheckoutInterval } from './cart-
|
|
3
|
-
import { t as translate, s as storageStore } from './localization-
|
|
1
|
+
import { z as zonosStore, c as createStore } from './zonosStore-504a7030.js';
|
|
2
|
+
import { t as trackConversionEvent, z as validateCheckoutSession, c as stripeStore, e as cartStore, v as stripeStoreHandleInventoryCheck, r as cartStoreNextStep, j as cartStoreClearCheckoutInterval } from './cart-5b417c0d.js';
|
|
3
|
+
import { t as translate, s as storageStore } from './localization-669a1714.js';
|
|
4
4
|
import { h as handleFetch, l as log, b as logError, j as jsonParse } from './handleFetch-621e45bc.js';
|
|
5
|
-
import { t as tinycolor } from './isDarkColor-
|
|
5
|
+
import { t as tinycolor } from './isDarkColor-915b06b8.js';
|
|
6
6
|
|
|
7
7
|
/*!
|
|
8
8
|
* paypal-js v8.1.0 (2024-06-07T16:55:00.122Z)
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { d as debounce_1 } from './debounce-7ebfa15b.js';
|
|
2
|
+
import { h as handleFetch, b as logError } from './handleFetch-621e45bc.js';
|
|
3
|
+
|
|
4
|
+
const attributesToUpdate = {};
|
|
5
|
+
// Store debounced functions per session to ensure proper debouncing
|
|
6
|
+
const debouncedFunctions = {};
|
|
7
|
+
const createDebouncedFetch = (sessionId) => {
|
|
8
|
+
return debounce_1(async () => {
|
|
9
|
+
var _a, _b;
|
|
10
|
+
// Get latest attributes from the map
|
|
11
|
+
const latestAttributes = Array.from(((_a = attributesToUpdate[sessionId]) === null || _a === void 0 ? void 0 : _a.entries()) || []).map(([key, value]) => ({ key, value }));
|
|
12
|
+
const { errors, json } = await handleFetch('/api/zonos-elements/update-checkout-session-attributes', {
|
|
13
|
+
body: {
|
|
14
|
+
attributes: latestAttributes,
|
|
15
|
+
id: sessionId,
|
|
16
|
+
},
|
|
17
|
+
method: 'POST',
|
|
18
|
+
});
|
|
19
|
+
if (errors.length) {
|
|
20
|
+
logError('Error updating checkout session attributes', errors);
|
|
21
|
+
return { success: false };
|
|
22
|
+
}
|
|
23
|
+
(_b = attributesToUpdate[sessionId]) === null || _b === void 0 ? void 0 : _b.clear();
|
|
24
|
+
return { success: !!(json === null || json === void 0 ? void 0 : json.success) };
|
|
25
|
+
}, 1000, { maxWait: 5000 });
|
|
26
|
+
};
|
|
27
|
+
const updateCheckoutSessionAttributes = async ({ attributes, checkoutSessionId, }) => {
|
|
28
|
+
// Merge the new attributes with the attributes in the list, if key exist, override it
|
|
29
|
+
// init the map if not exist
|
|
30
|
+
attributesToUpdate[checkoutSessionId] || (attributesToUpdate[checkoutSessionId] = new Map());
|
|
31
|
+
attributes.forEach(attribute => {
|
|
32
|
+
var _a;
|
|
33
|
+
if (attribute.value) {
|
|
34
|
+
(_a = attributesToUpdate[checkoutSessionId]) === null || _a === void 0 ? void 0 : _a.set(attribute.key, attribute.value);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
if (!attributes.length) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
// Get or create the debounced function for this session
|
|
41
|
+
if (!debouncedFunctions[checkoutSessionId]) {
|
|
42
|
+
debouncedFunctions[checkoutSessionId] =
|
|
43
|
+
createDebouncedFetch(checkoutSessionId);
|
|
44
|
+
}
|
|
45
|
+
return debouncedFunctions[checkoutSessionId]();
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export { updateCheckoutSessionAttributes as u };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, d as getElement } from './index-5ea9f81d.js';
|
|
2
|
-
import { c as stripeStore, t as trackConversionEvent, e as cartStore } from './cart-
|
|
3
|
-
import { s as storageStore, n as storageStoreOnChange, o as getFallbackDefaultCountryCode, t as translate, l as localizationStore } from './localization-
|
|
4
|
-
import { z as zonosStore,
|
|
2
|
+
import { c as stripeStore, t as trackConversionEvent, e as cartStore } from './cart-5b417c0d.js';
|
|
3
|
+
import { s as storageStore, n as storageStoreOnChange, o as getFallbackDefaultCountryCode, t as translate, l as localizationStore } from './localization-669a1714.js';
|
|
4
|
+
import { z as zonosStore, f as zonosStoreFontFamily, d as isObject_1 } from './zonosStore-504a7030.js';
|
|
5
5
|
import { b as logError, l as log, i as isCheckoutMobile } from './handleFetch-621e45bc.js';
|
|
6
6
|
import { s as shouldRenderTaxIdInput, i as isTextContainsNonLatinChars, c as containsNonLatinChars } from './shouldRenderTaxIdInput-8bc112bb.js';
|
|
7
7
|
import { c as countryRequireTaxId, s as shipToTaxIdLabels } from './TaxId-50d72254.js';
|
|
8
8
|
import { c as classes } from './classes-0d95c529.js';
|
|
9
|
-
import { g as getBorderRadius } from './getBorderRadius-
|
|
9
|
+
import { g as getBorderRadius } from './getBorderRadius-174305ff.js';
|
|
10
10
|
import { R as RemoveIcon$2 } from './RemoveIcon-9dc5dd1a.js';
|
|
11
|
-
import { i as isDarkColor } from './isDarkColor-
|
|
12
|
-
import { d as debounce_1 } from './debounce-
|
|
11
|
+
import { i as isDarkColor } from './isDarkColor-915b06b8.js';
|
|
12
|
+
import { d as debounce_1 } from './debounce-7ebfa15b.js';
|
|
13
13
|
import { i as inheritAriaAttributes, a as inheritAttributes } from './helpers-2f6955b1.js';
|
|
14
14
|
import './VarianceTest-fef2d958.js';
|
|
15
15
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host } from './index-5ea9f81d.js';
|
|
2
|
-
import {
|
|
2
|
+
import { f as zonosStoreFontFamily } from './zonosStore-504a7030.js';
|
|
3
3
|
import { c as classes } from './classes-0d95c529.js';
|
|
4
4
|
import './VarianceTest-fef2d958.js';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host } from './index-5ea9f81d.js';
|
|
2
|
-
import {
|
|
2
|
+
import { f as zonosStoreFontFamily } from './zonosStore-504a7030.js';
|
|
3
3
|
import { c as classes } from './classes-0d95c529.js';
|
|
4
4
|
import './VarianceTest-fef2d958.js';
|
|
5
5
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, d as getElement } from './index-5ea9f81d.js';
|
|
2
|
-
import { z as zonosStore,
|
|
2
|
+
import { z as zonosStore, f as zonosStoreFontFamily } from './zonosStore-504a7030.js';
|
|
3
3
|
import { i as inheritAriaAttributes, a as inheritAttributes } from './helpers-2f6955b1.js';
|
|
4
4
|
import { c as classes } from './classes-0d95c529.js';
|
|
5
|
-
import { g as getBorderRadius } from './getBorderRadius-
|
|
5
|
+
import { g as getBorderRadius } from './getBorderRadius-174305ff.js';
|
|
6
6
|
import { i as isColorVariable } from './isColorVariable-0a94004f.js';
|
|
7
|
-
import { i as isDarkColor } from './isDarkColor-
|
|
7
|
+
import { i as isDarkColor } from './isDarkColor-915b06b8.js';
|
|
8
8
|
import { s as styles } from './styles-6fc2fad9.js';
|
|
9
9
|
import './VarianceTest-fef2d958.js';
|
|
10
10
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host } from './index-5ea9f81d.js';
|
|
2
|
-
import {
|
|
2
|
+
import { f as zonosStoreFontFamily } from './zonosStore-504a7030.js';
|
|
3
3
|
import { c as classes } from './classes-0d95c529.js';
|
|
4
|
-
import { g as getBorderRadius } from './getBorderRadius-
|
|
4
|
+
import { g as getBorderRadius } from './getBorderRadius-174305ff.js';
|
|
5
5
|
import './VarianceTest-fef2d958.js';
|
|
6
6
|
|
|
7
7
|
const zonosCardCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .styled-card{border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-6));padding:var(--spacing, 24px);text-align:left;background-color:var(--zonos--background-color);overflow:hidden}:host .styled-card hr{margin-left:calc(var(--spacing, 24px) * -1);margin-right:calc(var(--spacing, 24px) * -1)}:host .styled-card .card-header{margin:calc(var(--spacing, 24px) * -1);padding:var(--spacing, 24px);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-bottom:var(--spacing, 24px);border-bottom:var(--zonos-elements-border);height:65px;line-height:65px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host .styled-card .card-header h5{margin-bottom:0;-ms-flex:1;flex:1}:host .styled-card .card-footer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;margin:calc(var(--spacing, 24px) * -1);padding:var(--spacing, 24px);border-top:var(--zonos-elements-border);background:var(--zonos-elements-surface-color-secondary);margin-top:var(--spacing, 24px);border-bottom-left-radius:var(--zonos-elements-radius-8);border-bottom-right-radius:var(--zonos-elements-radius-8);height:var(--footerHeight)}";
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import { r as registerInstance, a as getAssetPath, h, H as Host, F as Fragment, c as createEvent, d as getElement } from './index-5ea9f81d.js';
|
|
2
|
-
import { e as cartStore, A as cartStoreHasOneEligibleItem, B as stripeStoreApplyPromoCode, C as stripeStoreRemovePromoCode, c as stripeStore, y as stripeStoreReset, d as stripeStoreRetrievePayment, t as trackConversionEvent, D as stripeStoreResetPromoCode, E as stripeStoreMessageBasedOnStatus, r as cartStoreNextStep, F as stripeStoreTranslateAddressToLatin, G as cartStoreUpdateSelectedShippingOption, H as cartStoreGetShippingTransitInfo, I as sortServiceLevelOptionsByAmount, J as cartStoreGetMethod } from './cart-
|
|
3
|
-
import { d as currencyFormat, t as translate, s as storageStore, l as localizationStore } from './localization-
|
|
2
|
+
import { e as cartStore, A as cartStoreHasOneEligibleItem, B as stripeStoreApplyPromoCode, C as stripeStoreRemovePromoCode, c as stripeStore, y as stripeStoreReset, d as stripeStoreRetrievePayment, t as trackConversionEvent, D as stripeStoreResetPromoCode, E as stripeStoreMessageBasedOnStatus, r as cartStoreNextStep, F as stripeStoreTranslateAddressToLatin, G as cartStoreUpdateSelectedShippingOption, H as cartStoreGetShippingTransitInfo, I as sortServiceLevelOptionsByAmount, J as cartStoreGetMethod } from './cart-5b417c0d.js';
|
|
3
|
+
import { d as currencyFormat, t as translate, s as storageStore, l as localizationStore } from './localization-669a1714.js';
|
|
4
4
|
import { c as classes } from './classes-0d95c529.js';
|
|
5
|
-
import { s as submitGtag, c as paypalStoreReset, b as paypalStore, i as isContrastColor } from './paypal-
|
|
6
|
-
import { z as zonosStore, g as getZonosStoreTheme,
|
|
5
|
+
import { s as submitGtag, c as paypalStoreReset, b as paypalStore, i as isContrastColor } from './paypal-3a0cf86b.js';
|
|
6
|
+
import { z as zonosStore, g as getZonosStoreTheme, f as zonosStoreFontFamily } from './zonosStore-504a7030.js';
|
|
7
7
|
import { h as handleFetch, l as log, s as sendErrorLog, j as jsonParse, g as getIsTestMode, d as allLogs, i as isCheckoutMobile, b as logError, a as getIsStagingMode } from './handleFetch-621e45bc.js';
|
|
8
8
|
import { c as createCustomEvent } from './createCustomEvent-58159025.js';
|
|
9
|
-
import { g as getBorderRadius } from './getBorderRadius-
|
|
9
|
+
import { g as getBorderRadius } from './getBorderRadius-174305ff.js';
|
|
10
10
|
import { l as languages } from './ILanguage-cd6acb72.js';
|
|
11
|
-
import { i as isDarkColor, t as tinycolor } from './isDarkColor-
|
|
11
|
+
import { i as isDarkColor, t as tinycolor } from './isDarkColor-915b06b8.js';
|
|
12
12
|
import { i as isColorVariable } from './isColorVariable-0a94004f.js';
|
|
13
|
+
import { u as updateCheckoutSessionAttributes } from './updateCheckoutSessionAttributes-183ca6c1.js';
|
|
13
14
|
import { s as shouldRenderTaxIdInput, c as containsNonLatinChars } from './shouldRenderTaxIdInput-8bc112bb.js';
|
|
14
15
|
import { e as euCountryCodes } from './TaxId-50d72254.js';
|
|
15
16
|
import './VarianceTest-fef2d958.js';
|
|
17
|
+
import './debounce-7ebfa15b.js';
|
|
16
18
|
|
|
17
19
|
const getDisplayCurrency = () => {
|
|
18
20
|
var _a, _b;
|
|
@@ -2607,17 +2609,14 @@ const ZonosCustomerInfo = class {
|
|
|
2607
2609
|
if (type === 'shipping' &&
|
|
2608
2610
|
storageStore.checkoutSessionId &&
|
|
2609
2611
|
!this.recordedFormTypeUsed) {
|
|
2610
|
-
void
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
],
|
|
2619
|
-
},
|
|
2620
|
-
method: 'POST',
|
|
2612
|
+
void updateCheckoutSessionAttributes({
|
|
2613
|
+
attributes: [
|
|
2614
|
+
{
|
|
2615
|
+
key: 'ZONOS_FORM_TYPE_USING',
|
|
2616
|
+
value: shouldUseCustomAddressForm ? 'custom' : 'stripe',
|
|
2617
|
+
},
|
|
2618
|
+
],
|
|
2619
|
+
checkoutSessionId: storageStore.checkoutSessionId,
|
|
2621
2620
|
});
|
|
2622
2621
|
this.recordedFormTypeUsed = true;
|
|
2623
2622
|
}
|