@zonos/elements 1.3.144 → 1.3.146
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{cart-2398abd4.js → cart-a262c92c.js} +6 -4
- package/dist/cjs/index.cjs.js +7 -7
- package/dist/cjs/{paypal-7ed9dfb7.js → paypal-0895372a.js} +1 -1
- package/dist/cjs/zonos-address_8.cjs.entry.js +2 -2
- package/dist/cjs/zonos-cart-items_13.cjs.entry.js +3 -3
- package/dist/cjs/zonos-checkout.cjs.entry.js +80 -24
- package/dist/cjs/zonos-controller.cjs.entry.js +31 -4
- 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 +2 -2
- 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 +78 -22
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.css +1 -0
- package/dist/collection/components/main/zonos-controller.js +30 -3
- package/dist/collection/components/store/translationStore/strings.danish.js +1 -1
- package/dist/collection/components/store/translationStore/strings.korean.js +1 -1
- package/dist/collection/components/store/translationStore/strings.russian.js +1 -1
- package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +1 -1
- package/dist/collection/components/utils/hello/getZCountryUrlParam.js +3 -1
- package/dist/esm/{cart-3427ee25.js → cart-a0b95207.js} +6 -4
- package/dist/esm/index.js +7 -7
- package/dist/esm/{paypal-4e2f9753.js → paypal-f1005b82.js} +1 -1
- package/dist/esm/zonos-address_8.entry.js +2 -2
- package/dist/esm/zonos-cart-items_13.entry.js +3 -3
- package/dist/esm/zonos-checkout.entry.js +80 -24
- package/dist/esm/zonos-controller.entry.js +31 -4
- package/dist/esm/zonos-country-flag.entry.js +1 -1
- package/dist/esm/zonos-country-select_4.entry.js +1 -1
- package/dist/esm/zonos-empty-state-payment_4.entry.js +2 -2
- package/dist/esm/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm/zonos-hello.entry.js +1 -1
- package/dist/esm/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/{cart-3427ee25.js → cart-a0b95207.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{paypal-4e2f9753.js → paypal-f1005b82.js} +1 -1
- package/dist/esm-es5/zonos-address_8.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-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 +20 -1
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +2 -0
- package/dist/types/components/main/zonos-controller.d.ts +1 -0
- package/dist/types/types/checkout/CheckoutConfig.d.ts +20 -1
- package/dist/types/types/generated/graphql.internal.types.d.ts +12 -10
- package/dist/types/types/generated/graphql.internal.types.ts +12 -10
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-0e6a3cd2.system.js → p-0101da8c.system.js} +1 -1
- package/dist/zonos-elements/{p-e2f1fa53.entry.js → p-07a8a124.entry.js} +1 -1
- package/dist/zonos-elements/{p-485d89a4.js → p-0ab922d1.js} +1 -1
- package/dist/zonos-elements/{p-9e05e259.system.entry.js → p-0f02083d.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-ea35b237.system.entry.js → p-23ea1883.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f3b0a097.system.js → p-2d152241.system.js} +1 -1
- package/dist/zonos-elements/{p-e01ccb27.entry.js → p-2d450227.entry.js} +1 -1
- package/dist/zonos-elements/p-4456cc80.entry.js +1 -0
- package/dist/zonos-elements/{p-7e47f6cf.entry.js → p-469dd116.entry.js} +1 -1
- package/dist/zonos-elements/p-46f6e5e9.system.js +1 -1
- package/dist/zonos-elements/{p-50896f89.entry.js → p-576f95f8.entry.js} +1 -1
- package/dist/zonos-elements/p-60ea5e25.system.entry.js +1 -0
- package/dist/zonos-elements/{p-d6061c79.entry.js → p-68f80c51.entry.js} +1 -1
- package/dist/zonos-elements/{p-bb92882d.system.entry.js → p-6ad1541e.system.entry.js} +1 -1
- package/dist/zonos-elements/p-89dcf124.system.entry.js +1 -0
- package/dist/zonos-elements/{p-5834c218.system.js → p-931d7fb7.system.js} +1 -1
- package/dist/zonos-elements/{p-7302a081.system.entry.js → p-9e934cc7.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-2deae669.entry.js → p-ae95877a.entry.js} +1 -1
- package/dist/zonos-elements/p-badca4a1.entry.js +1 -0
- package/dist/zonos-elements/{p-48bca3d4.system.entry.js → p-bcc65b55.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-1423ebbe.js → p-c23e256e.js} +1 -1
- package/dist/zonos-elements/{p-a8cf3542.system.entry.js → p-d2214283.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-84e5fc0b.entry.js → p-d2477bcf.entry.js} +1 -1
- package/dist/zonos-elements/{p-c8b0bc02.system.entry.js → p-d787a694.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-463e44b6.system.entry.js → p-e619ff1e.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-00136c20.entry.js → p-ff8d0109.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/zonos-elements/p-515e3606.system.entry.js +0 -1
- package/dist/zonos-elements/p-9951462e.entry.js +0 -1
- package/dist/zonos-elements/p-b262b93e.entry.js +0 -1
- package/dist/zonos-elements/p-da6a29e4.system.entry.js +0 -1
|
@@ -174,7 +174,7 @@ export const stringsRussian = {
|
|
|
174
174
|
value: 'Страны не найдены',
|
|
175
175
|
},
|
|
176
176
|
'No payment method needed for staging': {
|
|
177
|
-
value: '
|
|
177
|
+
value: 'Для постановки не требуется способ оплаты',
|
|
178
178
|
},
|
|
179
179
|
'No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.': {
|
|
180
180
|
value: 'Не выбран рейтинг доставки. Пожалуйста, вернитесь к шагу "Доставка" и выберите рейтинг доставки, чтобы продолжить.',
|
package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js
CHANGED
|
@@ -48,7 +48,7 @@ export class ZonosLinkAuthentication {
|
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
50
|
// No need to initialize link if this is staging mode since we will render the email input field
|
|
51
|
-
if (cartStore.isStagingMode) {
|
|
51
|
+
if (cartStore.isStagingMode || !this.clientSecret) {
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
54
|
const defaultValues = this.defaultEmail
|
|
@@ -15,5 +15,7 @@ export const getZCountryUrlParam = (urlParams) => {
|
|
|
15
15
|
const zCountry = getCountryParam('zCountry');
|
|
16
16
|
// Fallback to legacy 'country'
|
|
17
17
|
const fallback = getCountryParam('country');
|
|
18
|
-
|
|
18
|
+
// Fallback to customerCountry
|
|
19
|
+
const secondFallback = getCountryParam('customerCountry');
|
|
20
|
+
return zCountry || fallback || secondFallback;
|
|
19
21
|
};
|
|
@@ -1574,7 +1574,7 @@ const stringsDanish = {
|
|
|
1574
1574
|
value: 'Ingen lande fundet',
|
|
1575
1575
|
},
|
|
1576
1576
|
'No payment method needed for staging': {
|
|
1577
|
-
value: 'Ingen betalingsmetode nødvendig
|
|
1577
|
+
value: 'Ingen betalingsmetode nødvendig til iscenesættelse',
|
|
1578
1578
|
},
|
|
1579
1579
|
'No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.': {
|
|
1580
1580
|
value: 'Ingen forsendelsesvurdering valgt. Gå venligst tilbage til "Forsendelse"-trinnet og vælg en forsendelsesvurdering for at fortsætte.',
|
|
@@ -5294,7 +5294,7 @@ const stringsKorean = {
|
|
|
5294
5294
|
value: '국가를 찾을 수 없습니다',
|
|
5295
5295
|
},
|
|
5296
5296
|
'No payment method needed for staging': {
|
|
5297
|
-
value: '스테이징에 결제
|
|
5297
|
+
value: '스테이징에 결제 수단이 필요하지 않습니다',
|
|
5298
5298
|
},
|
|
5299
5299
|
'No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.': {
|
|
5300
5300
|
value: '배송 등급이 선택되지 않았습니다. "배송" 단계로 돌아가서 배송 등급을 선택하여 진행하세요.',
|
|
@@ -7154,7 +7154,7 @@ const stringsRussian = {
|
|
|
7154
7154
|
value: 'Страны не найдены',
|
|
7155
7155
|
},
|
|
7156
7156
|
'No payment method needed for staging': {
|
|
7157
|
-
value: '
|
|
7157
|
+
value: 'Для постановки не требуется способ оплаты',
|
|
7158
7158
|
},
|
|
7159
7159
|
'No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.': {
|
|
7160
7160
|
value: 'Не выбран рейтинг доставки. Пожалуйста, вернитесь к шагу "Доставка" и выберите рейтинг доставки, чтобы продолжить.',
|
|
@@ -9506,7 +9506,9 @@ const getZCountryUrlParam = (urlParams) => {
|
|
|
9506
9506
|
const zCountry = getCountryParam('zCountry');
|
|
9507
9507
|
// Fallback to legacy 'country'
|
|
9508
9508
|
const fallback = getCountryParam('country');
|
|
9509
|
-
|
|
9509
|
+
// Fallback to customerCountry
|
|
9510
|
+
const secondFallback = getCountryParam('customerCountry');
|
|
9511
|
+
return zCountry || fallback || secondFallback;
|
|
9510
9512
|
};
|
|
9511
9513
|
|
|
9512
9514
|
const getLocalization = async () => {
|
package/dist/esm/index.js
CHANGED
|
@@ -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.146.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.146.js.zonos.com";
|
|
314
|
+
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.146";
|
|
315
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.146";
|
|
316
|
+
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.146";
|
|
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 = "1736455756547";
|
|
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.146"}`;
|
|
347
347
|
Zonos.modeAlerted = false;
|
|
348
348
|
Zonos.cartData = null;
|
|
349
349
|
Zonos.paypal = null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z as zonosStore, c as createStore } from './zonosStore-44efd080.js';
|
|
2
|
-
import { C as validateCheckoutSession, f as stripeStore, e as cartStore, x as stripeStoreHandleInventoryCheck, q as translate, w as cartStoreNextStep, k as cartStoreClearCheckoutInterval } from './cart-
|
|
2
|
+
import { C as validateCheckoutSession, f as stripeStore, e as cartStore, x as stripeStoreHandleInventoryCheck, q as translate, w as cartStoreNextStep, k as cartStoreClearCheckoutInterval } from './cart-a0b95207.js';
|
|
3
3
|
import { h as handleFetch, l as log, b as logError, j as jsonParse } from './handleFetch-b4633675.js';
|
|
4
4
|
import { t as tinycolor } from './isDarkColor-10f38df6.js';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, d as getElement } from './index-d82f06f2.js';
|
|
2
|
-
import { f as stripeStore, T as getFallbackDefaultCountryCode, l as localizationStore, q as translate, e as cartStore } from './cart-
|
|
2
|
+
import { f as stripeStore, T as getFallbackDefaultCountryCode, l as localizationStore, q as translate, e as cartStore } from './cart-a0b95207.js';
|
|
3
3
|
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
4
4
|
import { b as logError, l as log } from './handleFetch-b4633675.js';
|
|
5
5
|
import { i as isTextContainsNonLatinChars, c as containsNonLatinChars } from './containsNonLatinChars-2d8810c3.js';
|
|
@@ -581,7 +581,7 @@ const ZonosLinkAuthentication = class {
|
|
|
581
581
|
return;
|
|
582
582
|
}
|
|
583
583
|
// No need to initialize link if this is staging mode since we will render the email input field
|
|
584
|
-
if (cartStore.isStagingMode) {
|
|
584
|
+
if (cartStore.isStagingMode || !this.clientSecret) {
|
|
585
585
|
return;
|
|
586
586
|
}
|
|
587
587
|
const defaultValues = this.defaultEmail
|
|
@@ -1,7 +1,7 @@
|
|
|
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, J as currencyFormat, q as translate, K as cartStoreHasOneEligibleItem, L as stripeStoreApplyPromoCode, M as stripeStoreRemovePromoCode, f as stripeStore, A as stripeStoreReset, d as stripeStoreRetrievePayment, t as trackConversionEvent, N as stripeStoreResetPromoCode, O as stripeStoreMessageBasedOnStatus, l as localizationStore, w as cartStoreNextStep, P as stripeStoreTranslateAddressToLatin, Q as cartStoreUpdateSelectedShippingOption, R as cartStoreGetShippingTransitInfo, S as sortServiceLevelOptionsByAmount } from './cart-
|
|
2
|
+
import { e as cartStore, J as currencyFormat, q as translate, K as cartStoreHasOneEligibleItem, L as stripeStoreApplyPromoCode, M as stripeStoreRemovePromoCode, f as stripeStore, A as stripeStoreReset, d as stripeStoreRetrievePayment, t as trackConversionEvent, N as stripeStoreResetPromoCode, O as stripeStoreMessageBasedOnStatus, l as localizationStore, w as cartStoreNextStep, P as stripeStoreTranslateAddressToLatin, Q as cartStoreUpdateSelectedShippingOption, R as cartStoreGetShippingTransitInfo, S as sortServiceLevelOptionsByAmount } from './cart-a0b95207.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-f1005b82.js';
|
|
5
5
|
import { z as zonosStore, g as getZonosStoreTheme, d as zonosStoreFontFamily } from './zonosStore-44efd080.js';
|
|
6
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-b4633675.js';
|
|
7
7
|
import { c as createCustomEvent } from './createCustomEvent-58159025.js';
|
|
@@ -2129,7 +2129,7 @@ const ZonosCurrencyToggle = class {
|
|
|
2129
2129
|
static get assetsDirs() { return ["assets"]; }
|
|
2130
2130
|
};
|
|
2131
2131
|
|
|
2132
|
-
const zonosCustomerInfoCss = ".sc-zonos-customer-info-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-customer-info-h *.sc-zonos-customer-info{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-customer-info-h img.sc-zonos-customer-info{max-width:100%}.sc-zonos-customer-info-h dl.sc-zonos-customer-info,.sc-zonos-customer-info-h dd.sc-zonos-customer-info,.sc-zonos-customer-info-h h1.sc-zonos-customer-info,.sc-zonos-customer-info-h h2.sc-zonos-customer-info,.sc-zonos-customer-info-h h3.sc-zonos-customer-info,.sc-zonos-customer-info-h h4.sc-zonos-customer-info,.sc-zonos-customer-info-h h5.sc-zonos-customer-info,.sc-zonos-customer-info-h h6.sc-zonos-customer-info,.sc-zonos-customer-info-h hr.sc-zonos-customer-info,.sc-zonos-customer-info-h figure.sc-zonos-customer-info,.sc-zonos-customer-info-h p.sc-zonos-customer-info,.sc-zonos-customer-info-h pre.sc-zonos-customer-info{margin:0}.sc-zonos-customer-info-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-customer-info-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-customer-info-h .zonos--title.sc-zonos-customer-info{margin-bottom:20px}.sc-zonos-customer-info-h .zonos--link-authentication.sc-zonos-customer-info{margin-bottom:32px}.sc-zonos-customer-info-h .zonos--address.sc-zonos-customer-info{margin-bottom:16px}.sc-zonos-customer-info-h .zonos--checkbox.sc-zonos-customer-info{margin-bottom:16px}.sc-zonos-customer-info-h .zonos--checkbox.sc-zonos-customer-info+.zonos--address.sc-zonos-customer-info{margin-bottom:0}.sc-zonos-customer-info-h zonos-button.sc-zonos-customer-info{-webkit-box-shadow:0 0 1px 0 var(--zonos-elements-gray-600);box-shadow:0 0 1px 0 var(--zonos-elements-gray-600)}.sc-zonos-customer-info-h .zonos--error-banner.sc-zonos-customer-info{margin-bottom:16px}.sc-zonos-customer-info-h .zonos--tax-id-input.sc-zonos-customer-info{margin-bottom:16px}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info{margin-bottom:20px;overflow:auto;padding:5px;-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar{width:10px}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-customer-info-h .zonos--group-btn.sc-zonos-customer-info{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;bottom:-5px;padding-top:8px;margin-top:12px;background:var(--zonos--primary-color, var(--zonos-elements-gray-0))}.sc-zonos-customer-info-h .zonos--group-btn.sc-zonos-customer-info zonos-button.sc-zonos-customer-info{width:100%}";
|
|
2132
|
+
const zonosCustomerInfoCss = ".sc-zonos-customer-info-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-customer-info-h *.sc-zonos-customer-info{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-customer-info-h img.sc-zonos-customer-info{max-width:100%}.sc-zonos-customer-info-h dl.sc-zonos-customer-info,.sc-zonos-customer-info-h dd.sc-zonos-customer-info,.sc-zonos-customer-info-h h1.sc-zonos-customer-info,.sc-zonos-customer-info-h h2.sc-zonos-customer-info,.sc-zonos-customer-info-h h3.sc-zonos-customer-info,.sc-zonos-customer-info-h h4.sc-zonos-customer-info,.sc-zonos-customer-info-h h5.sc-zonos-customer-info,.sc-zonos-customer-info-h h6.sc-zonos-customer-info,.sc-zonos-customer-info-h hr.sc-zonos-customer-info,.sc-zonos-customer-info-h figure.sc-zonos-customer-info,.sc-zonos-customer-info-h p.sc-zonos-customer-info,.sc-zonos-customer-info-h pre.sc-zonos-customer-info{margin:0}.sc-zonos-customer-info-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-customer-info-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-customer-info-h .zonos--title.sc-zonos-customer-info{margin-bottom:20px}.sc-zonos-customer-info-h .zonos--link-authentication.sc-zonos-customer-info{margin-bottom:32px}.sc-zonos-customer-info-h .zonos--address.sc-zonos-customer-info{margin-bottom:16px}.sc-zonos-customer-info-h .zonos--checkbox.sc-zonos-customer-info{margin-bottom:16px}.sc-zonos-customer-info-h .zonos--checkbox.sc-zonos-customer-info+.zonos--address.sc-zonos-customer-info{margin-bottom:0}.sc-zonos-customer-info-h zonos-button.sc-zonos-customer-info{-webkit-box-shadow:0 0 1px 0 var(--zonos-elements-gray-600);box-shadow:0 0 1px 0 var(--zonos-elements-gray-600)}.sc-zonos-customer-info-h .zonos--error-banner.sc-zonos-customer-info{margin-bottom:16px}.sc-zonos-customer-info-h .zonos--tax-id-input.sc-zonos-customer-info{margin-bottom:16px}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info{margin-bottom:20px;overflow:auto;padding:5px;-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar{width:10px}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-customer-info-h .zonos--group-btn.sc-zonos-customer-info{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;bottom:-5px;padding-top:8px;margin-top:12px;background:var(--zonos--primary-color, var(--zonos-elements-gray-0));z-index:1}.sc-zonos-customer-info-h .zonos--group-btn.sc-zonos-customer-info zonos-button.sc-zonos-customer-info{width:100%}";
|
|
2133
2133
|
const ZonosCustomerInfoStyle0 = zonosCustomerInfoCss;
|
|
2134
2134
|
|
|
2135
2135
|
const ZonosCustomerInfo = class {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, F as Fragment } from './index-d82f06f2.js';
|
|
2
|
-
import { l as localizationStore, s as stripeStoreGetDomesticShippingSession, a as localizationStoreUpdateSelectedCountryCode, b as stripeStoreCleanupDomesticShippingSession, c as stripeStoreSaveDomesticShippingSession, i as initStripeElements, d as stripeStoreRetrievePayment, e as cartStore, f as stripeStore, g as cartStoreUpdateItems, h as cartStoreReset, j as cartStoreResetTabItems, k as cartStoreClearCheckoutInterval, m as stripeStoreInitCheckoutSession, n as cartStoreStartCheckoutInterval, t as trackConversionEvent, o as getCheckoutSessionBody, p as cartStoreUpdateToErrorState, q as translate, r as getZCountryUrlParam, u as cartStoreSetCheckoutSession, v as stripeStorePrefetchLandedCost, w as cartStoreNextStep, x as stripeStoreHandleInventoryCheck, y as stripeStoreConfirmPayment, z as stripeStoreHandleInventoryRefund, A as stripeStoreReset, B as localizationStoreOnUpdate } from './cart-
|
|
3
|
-
import { p as paypalStoreHasPaypalEnabled, s as submitGtag, a as paypalInitScript, b as paypalStore } from './paypal-
|
|
2
|
+
import { l as localizationStore, s as stripeStoreGetDomesticShippingSession, a as localizationStoreUpdateSelectedCountryCode, b as stripeStoreCleanupDomesticShippingSession, c as stripeStoreSaveDomesticShippingSession, i as initStripeElements, d as stripeStoreRetrievePayment, e as cartStore, f as stripeStore, g as cartStoreUpdateItems, h as cartStoreReset, j as cartStoreResetTabItems, k as cartStoreClearCheckoutInterval, m as stripeStoreInitCheckoutSession, n as cartStoreStartCheckoutInterval, t as trackConversionEvent, o as getCheckoutSessionBody, p as cartStoreUpdateToErrorState, q as translate, r as getZCountryUrlParam, u as cartStoreSetCheckoutSession, v as stripeStorePrefetchLandedCost, w as cartStoreNextStep, x as stripeStoreHandleInventoryCheck, y as stripeStoreConfirmPayment, z as stripeStoreHandleInventoryRefund, A as stripeStoreReset, B as localizationStoreOnUpdate } from './cart-a0b95207.js';
|
|
3
|
+
import { p as paypalStoreHasPaypalEnabled, s as submitGtag, a as paypalInitScript, b as paypalStore } from './paypal-f1005b82.js';
|
|
4
4
|
import { z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-44efd080.js';
|
|
5
5
|
import { h as handleFetch, l as log, b as logError, s as sendErrorLog, c as getElapsedTime, d as allLogs, g as getIsTestMode, j as jsonParse, a as getIsStagingMode } from './handleFetch-b4633675.js';
|
|
6
6
|
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
@@ -438,21 +438,20 @@ const ZonosCheckout = class {
|
|
|
438
438
|
(_b = (_a = zonosStore.checkoutSettings).onClose) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
439
439
|
}
|
|
440
440
|
async buildCartAndInit() {
|
|
441
|
-
// if tempCartUUID is provided, use it instead of buildCartDetail
|
|
442
|
-
if (window.Zonos.cartData) {
|
|
443
|
-
log('tempCartUUID is provided, start building cart');
|
|
444
|
-
const isExpired = this.handleCartExpiredCheck();
|
|
445
|
-
if (isExpired) {
|
|
446
|
-
// Do not proceed if the cart is expired
|
|
447
|
-
return false;
|
|
448
|
-
}
|
|
449
|
-
const { adjustments, cartItems } = buildCartItemsByTempCart(window.Zonos.cartData);
|
|
450
|
-
await cartStoreUpdateItems({ adjustments, cartItems });
|
|
451
|
-
}
|
|
452
441
|
// if createCartId is provided, use it to build cart. Merchant will provide create a cart from their server side and give the cart id to us.
|
|
453
|
-
|
|
442
|
+
if (typeof zonosStore.checkoutSettings.createCartId === 'function') {
|
|
454
443
|
log('"createCartId" is provided, start building cart');
|
|
455
|
-
const
|
|
444
|
+
const cartIdResult = await zonosStore.checkoutSettings.createCartId();
|
|
445
|
+
let cartId;
|
|
446
|
+
if (typeof cartIdResult === 'object') {
|
|
447
|
+
log('object detected, use cartId and prefill address from createCartId');
|
|
448
|
+
cartId = cartIdResult.cartId;
|
|
449
|
+
// set prefill address if provided in createCartId callback result
|
|
450
|
+
this.useShippingDataFromCreateCartId(cartIdResult.shippingData);
|
|
451
|
+
}
|
|
452
|
+
else {
|
|
453
|
+
cartId = cartIdResult;
|
|
454
|
+
}
|
|
456
455
|
window.Zonos.cartId = cartId;
|
|
457
456
|
const cartResult = await setupCartData(cartId);
|
|
458
457
|
const cartData = cartResult === null || cartResult === void 0 ? void 0 : cartResult.cartData;
|
|
@@ -469,6 +468,17 @@ const ZonosCheckout = class {
|
|
|
469
468
|
const { adjustments, cartItems } = buildCartItemsByTempCart(cartData);
|
|
470
469
|
await cartStoreUpdateItems({ adjustments, cartItems });
|
|
471
470
|
}
|
|
471
|
+
// if tempCartUUID is provided, use it instead of buildCartDetail
|
|
472
|
+
else if (window.Zonos.cartData) {
|
|
473
|
+
log('tempCartUUID is provided, start building cart');
|
|
474
|
+
const isExpired = this.handleCartExpiredCheck();
|
|
475
|
+
if (isExpired) {
|
|
476
|
+
// Do not proceed if the cart is expired
|
|
477
|
+
return false;
|
|
478
|
+
}
|
|
479
|
+
const { adjustments, cartItems } = buildCartItemsByTempCart(window.Zonos.cartData);
|
|
480
|
+
await cartStoreUpdateItems({ adjustments, cartItems });
|
|
481
|
+
}
|
|
472
482
|
else if (zonosStore.checkoutSettings.buildCartDetail &&
|
|
473
483
|
localizationStore.selectedCountryCode) {
|
|
474
484
|
log('build cart detail');
|
|
@@ -703,6 +713,30 @@ const ZonosCheckout = class {
|
|
|
703
713
|
// apply theme to stripe elements
|
|
704
714
|
void this.applyStripeTheme();
|
|
705
715
|
}
|
|
716
|
+
useShippingDataFromCreateCartId(prefillAddress) {
|
|
717
|
+
// Do only if prefill address is provided
|
|
718
|
+
if (!prefillAddress) {
|
|
719
|
+
return;
|
|
720
|
+
}
|
|
721
|
+
log('shipping data from createCartId result', 'info', Object.entries(prefillAddress));
|
|
722
|
+
const { customerAddress1, customerAddress2, customerCity, customerCountry, customerEmail, customerName, customerPhone, customerState, customerZip, } = prefillAddress;
|
|
723
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
724
|
+
const country = // fallback to selected country code if country is not provided
|
|
725
|
+
customerCountry ||
|
|
726
|
+
getZCountryUrlParam(urlParams) ||
|
|
727
|
+
localizationStore.selectedCountryCode;
|
|
728
|
+
this.applyPrefillAddress({
|
|
729
|
+
customerAddress1,
|
|
730
|
+
customerAddress2,
|
|
731
|
+
customerCity,
|
|
732
|
+
customerCountry: country,
|
|
733
|
+
customerEmail,
|
|
734
|
+
customerName,
|
|
735
|
+
customerPhone,
|
|
736
|
+
customerState,
|
|
737
|
+
customerZip,
|
|
738
|
+
});
|
|
739
|
+
}
|
|
706
740
|
/**
|
|
707
741
|
* Set default address from query param if it's valid
|
|
708
742
|
*/
|
|
@@ -716,17 +750,39 @@ const ZonosCheckout = class {
|
|
|
716
750
|
}
|
|
717
751
|
return value;
|
|
718
752
|
};
|
|
719
|
-
const
|
|
753
|
+
const customerCountry =
|
|
720
754
|
// fallback to selected country code if country is not provided
|
|
721
755
|
getZCountryUrlParam(urlParams) || localizationStore.selectedCountryCode;
|
|
722
|
-
const
|
|
723
|
-
const
|
|
724
|
-
const
|
|
725
|
-
const
|
|
726
|
-
const
|
|
727
|
-
const
|
|
728
|
-
const
|
|
729
|
-
const
|
|
756
|
+
const customerCity = getParam('customerCity');
|
|
757
|
+
const customerEmail = getParam('customerEmail');
|
|
758
|
+
const customerAddress1 = getParam('customerAddress1');
|
|
759
|
+
const customerAddress2 = getParam('customerAddress2');
|
|
760
|
+
const customerName = getParam('customerName');
|
|
761
|
+
const customerPhone = getParam('customerPhone');
|
|
762
|
+
const customerZip = getParam('customerZip');
|
|
763
|
+
const customerState = getParam('customerState');
|
|
764
|
+
this.applyPrefillAddress({
|
|
765
|
+
customerAddress1,
|
|
766
|
+
customerAddress2,
|
|
767
|
+
customerCity,
|
|
768
|
+
customerCountry,
|
|
769
|
+
customerEmail,
|
|
770
|
+
customerName,
|
|
771
|
+
customerPhone,
|
|
772
|
+
customerState,
|
|
773
|
+
customerZip,
|
|
774
|
+
});
|
|
775
|
+
}
|
|
776
|
+
applyPrefillAddress({ customerAddress1, customerAddress2, customerCity, customerCountry, customerEmail, customerName, customerPhone, customerState, customerZip, }) {
|
|
777
|
+
const line1 = customerAddress1 || '';
|
|
778
|
+
const country = customerCountry || '';
|
|
779
|
+
const line2 = customerAddress2 || '';
|
|
780
|
+
const city = customerCity || '';
|
|
781
|
+
const email = customerEmail || '';
|
|
782
|
+
const name = customerName || '';
|
|
783
|
+
const phone = customerPhone || '';
|
|
784
|
+
const postal_code = customerZip || '';
|
|
785
|
+
const state = customerState || '';
|
|
730
786
|
/**
|
|
731
787
|
* If one of the value is null, no need to preset the default address.
|
|
732
788
|
* City and state are optional (they are not always provided for example Puerto Rico)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-d82f06f2.js';
|
|
2
|
-
import { D as isValidSelector, f as stripeStore, E as initLocalizationStore, e as cartStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-
|
|
2
|
+
import { D as isValidSelector, f as stripeStore, E as initLocalizationStore, e as cartStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-a0b95207.js';
|
|
3
3
|
import { z as zonosStore, b as zonosStoreInitSetting, d as zonosStoreFontFamily } from './zonosStore-44efd080.js';
|
|
4
4
|
import { h as handleFetch, b as logError, l as log } from './handleFetch-b4633675.js';
|
|
5
5
|
import './isDarkColor-10f38df6.js';
|
|
@@ -239,17 +239,44 @@ const ZonosController = class {
|
|
|
239
239
|
return oldReplaceState.apply(this, arguments);
|
|
240
240
|
};
|
|
241
241
|
}
|
|
242
|
+
injectCustomHTML(htmlString) {
|
|
243
|
+
if (!htmlString) {
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
// Skip injecting custom HTML for legacy checkout
|
|
247
|
+
if (!window.Zonos.isLegacyCheckout) {
|
|
248
|
+
log('=== Skip injecting custom HTML for hosted checkout', 'info');
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
log('=== Injecting custom HTML for hosted checkout');
|
|
252
|
+
const template = document.createElement('template');
|
|
253
|
+
template.innerHTML = htmlString;
|
|
254
|
+
const scripts = template.content.querySelectorAll('script');
|
|
255
|
+
scripts.forEach(script => {
|
|
256
|
+
const scriptToInject = document.createElement('script');
|
|
257
|
+
if (script.src) {
|
|
258
|
+
scriptToInject.src = script.src;
|
|
259
|
+
scriptToInject.async = script.async;
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
scriptToInject.textContent = script.innerHTML;
|
|
263
|
+
}
|
|
264
|
+
document.body.appendChild(scriptToInject);
|
|
265
|
+
});
|
|
266
|
+
}
|
|
242
267
|
async componentWillLoad() {
|
|
243
268
|
this.initHistoryListener();
|
|
244
269
|
zonosStore.zonosApiKey = this.zonosApiKey;
|
|
245
270
|
// running with scope async function to avoid blocking the main thread
|
|
246
271
|
(async () => {
|
|
247
|
-
var _a, _b;
|
|
272
|
+
var _a, _b, _c;
|
|
248
273
|
const { errors, json, zonosMode } = await getZonosSettings();
|
|
249
274
|
if (((_a = errors[0]) === null || _a === void 0 ? void 0 : _a.type.toString()) === '403') {
|
|
250
275
|
log('Failed to load zonos settings. This domain may not have access', 'warn');
|
|
251
276
|
return;
|
|
252
277
|
}
|
|
278
|
+
const customHTML = ((_b = json === null || json === void 0 ? void 0 : json.checkoutSettings) === null || _b === void 0 ? void 0 : _b.customHTML) || '';
|
|
279
|
+
this.injectCustomHTML(customHTML);
|
|
253
280
|
// init zonos notification
|
|
254
281
|
this.initZonosNotification();
|
|
255
282
|
const getLogoUrl = () => {
|
|
@@ -284,7 +311,7 @@ const ZonosController = class {
|
|
|
284
311
|
// init localization store
|
|
285
312
|
await initLocalizationStore();
|
|
286
313
|
// checkout init
|
|
287
|
-
const publishableKey = ((
|
|
314
|
+
const publishableKey = ((_c = json === null || json === void 0 ? void 0 : json.checkoutSettings) === null || _c === void 0 ? void 0 : _c.externalServiceTokens.find(item => item.type === 'STRIPE_PUBLISHABLE_TOKEN')) || null;
|
|
288
315
|
if (!publishableKey || !this.stripeInitEvent) {
|
|
289
316
|
log('Checkout failed to load -- missing publishable key', 'warn');
|
|
290
317
|
return;
|
|
@@ -353,7 +380,7 @@ const ZonosController = class {
|
|
|
353
380
|
zonosStore.organizationName = organizationName;
|
|
354
381
|
}
|
|
355
382
|
render() {
|
|
356
|
-
return h(Host, { key: '
|
|
383
|
+
return h(Host, { key: '001f728dc41550b734fd1b5c9cf15f43c0c4cbdb', class: "zonos--elements" });
|
|
357
384
|
}
|
|
358
385
|
};
|
|
359
386
|
ZonosController.style = ZonosControllerStyle0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, d as getElement } from './index-d82f06f2.js';
|
|
2
|
-
import { l as localizationStore } from './cart-
|
|
2
|
+
import { l as localizationStore } from './cart-a0b95207.js';
|
|
3
3
|
import { d as zonosStoreFontFamily } from './zonosStore-44efd080.js';
|
|
4
4
|
import { c as classes } from './classes-0d95c529.js';
|
|
5
5
|
import './handleFetch-b4633675.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, d as getElement } from './index-d82f06f2.js';
|
|
2
|
-
import { a as localizationStoreUpdateSelectedCountryCode, q as translate, l as localizationStore } from './cart-
|
|
2
|
+
import { a as localizationStoreUpdateSelectedCountryCode, q as translate, l as localizationStore } from './cart-a0b95207.js';
|
|
3
3
|
import { d as zonosStoreFontFamily } from './zonosStore-44efd080.js';
|
|
4
4
|
import { f as formatStringWithLinks } from './formatStringWithLinks-9e819405.js';
|
|
5
5
|
import { i as isDarkColor } from './isDarkColor-10f38df6.js';
|
|
@@ -2,9 +2,9 @@ import { r as registerInstance, h, H as Host, d as getElement, c as createEvent
|
|
|
2
2
|
import { d as zonosStoreFontFamily } from './zonosStore-44efd080.js';
|
|
3
3
|
import { c as classes } from './classes-0d95c529.js';
|
|
4
4
|
import { g as getBorderRadius } from './getBorderRadius-b32d4218.js';
|
|
5
|
-
import { f as stripeStore } from './cart-
|
|
5
|
+
import { f as stripeStore } from './cart-a0b95207.js';
|
|
6
6
|
import { b as logError, l as log } from './handleFetch-b4633675.js';
|
|
7
|
-
import { d as paypalStoreInitButtons } from './paypal-
|
|
7
|
+
import { d as paypalStoreInitButtons } from './paypal-f1005b82.js';
|
|
8
8
|
import './isDarkColor-10f38df6.js';
|
|
9
9
|
|
|
10
10
|
const PaymentEmptyStateDarkIcon = `<svg width="536" height="200" viewBox="0 0 536 200" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host } from './index-d82f06f2.js';
|
|
2
|
-
import { q as translate, l as localizationStore, J as currencyFormat } from './cart-
|
|
2
|
+
import { q as translate, l as localizationStore, J as currencyFormat } from './cart-a0b95207.js';
|
|
3
3
|
import { z as zonosStore } from './zonosStore-44efd080.js';
|
|
4
4
|
import { c as classes } from './classes-0d95c529.js';
|
|
5
5
|
import { f as formatStringWithLinks } from './formatStringWithLinks-9e819405.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host } from './index-d82f06f2.js';
|
|
2
2
|
import { _ as _root, e as _baseGetTag, i as isObjectLike_1, f as isObject_1, z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-44efd080.js';
|
|
3
|
-
import { l as localizationStore, D as isValidSelector, q as translate, r as getZCountryUrlParam, F as setZCountryUrlParam, G as currencyDisplay, H as currencyConvertAndFormat, I as currencyConvert, J as currencyFormat } from './cart-
|
|
3
|
+
import { l as localizationStore, D as isValidSelector, q as translate, r as getZCountryUrlParam, F as setZCountryUrlParam, G as currencyDisplay, H as currencyConvertAndFormat, I as currencyConvert, J as currencyFormat } from './cart-a0b95207.js';
|
|
4
4
|
import { c as classes } from './classes-0d95c529.js';
|
|
5
5
|
import { h as handleFetch, b as logError, l as log } from './handleFetch-b4633675.js';
|
|
6
6
|
import { g as getHasMoreSpaceOnRight } from './getHasMoreSpaceOnRight-70eb913a.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host } from './index-d82f06f2.js';
|
|
2
|
-
import { U as localizationStoreUpdateSelectedLocale, q as translate, l as localizationStore } from './cart-
|
|
2
|
+
import { U as localizationStoreUpdateSelectedLocale, q as translate, l as localizationStore } from './cart-a0b95207.js';
|
|
3
3
|
import { d as zonosStoreFontFamily } from './zonosStore-44efd080.js';
|
|
4
4
|
import { l as languages } from './ILanguage-cd6acb72.js';
|
|
5
5
|
import './handleFetch-b4633675.js';
|