@zonos/elements 1.3.84 → 1.3.86
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-a06f18e2.js → cart-c5152dfc.js} +123 -162
- package/dist/cjs/{createCustomEvent-8d9cf9ac.js → createCustomEvent-557f8120.js} +1 -1
- package/dist/cjs/index.cjs.js +7 -7
- package/dist/cjs/{paypal-078f3cef.js → paypal-922c7e45.js} +1 -1
- package/dist/cjs/zonos-address_7.cjs.entry.js +1 -1
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +32 -15
- package/dist/cjs/zonos-checkout.cjs.entry.js +3 -3
- package/dist/cjs/zonos-controller.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +1 -1
- package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-notification_3.cjs.entry.js +4 -4
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.js +3 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +12 -3
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.css +2 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +3 -2
- package/dist/collection/components/store/checkout/cart.js +22 -12
- package/dist/collection/components/store/checkout/stripe.js +16 -9
- package/dist/collection/components/store/hello/localization.js +1 -1
- package/dist/collection/components/store/translationStore/strings.arabic.js +4 -7
- package/dist/collection/components/store/translationStore/strings.base.js +4 -7
- package/dist/collection/components/store/translationStore/strings.chinese.js +4 -7
- package/dist/collection/components/store/translationStore/strings.danish.js +4 -7
- package/dist/collection/components/store/translationStore/strings.dutch.js +4 -7
- package/dist/collection/components/store/translationStore/strings.french.js +4 -7
- package/dist/collection/components/store/translationStore/strings.german.js +4 -7
- package/dist/collection/components/store/translationStore/strings.hebrew.js +4 -7
- package/dist/collection/components/store/translationStore/strings.indonesian.js +4 -7
- package/dist/collection/components/store/translationStore/strings.italian.js +4 -7
- package/dist/collection/components/store/translationStore/strings.japanese.js +4 -7
- package/dist/collection/components/store/translationStore/strings.korean.js +4 -7
- package/dist/collection/components/store/translationStore/strings.norwegian.js +4 -7
- package/dist/collection/components/store/translationStore/strings.polish.js +4 -7
- package/dist/collection/components/store/translationStore/strings.portuguese.js +4 -7
- package/dist/collection/components/store/translationStore/strings.russian.js +4 -7
- package/dist/collection/components/store/translationStore/strings.spanish.js +4 -7
- package/dist/collection/components/store/translationStore/strings.swedish.js +4 -7
- package/dist/collection/components/store/translationStore/strings.turkish.js +4 -7
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +4 -7
- package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +2 -2
- package/dist/collection/components/utils/getContrastColor.js +8 -3
- package/dist/collection/styles/stripe/addressRuleStyle.js +4 -0
- package/dist/collection/types/generated/graphql.frontend.types.js +5 -5
- package/dist/esm/{cart-40e0d619.js → cart-9d7e0950.js} +123 -162
- package/dist/esm/{createCustomEvent-1f615c82.js → createCustomEvent-e93c38eb.js} +1 -1
- package/dist/esm/index.js +7 -7
- package/dist/esm/{paypal-a45fb0bb.js → paypal-6c55d504.js} +1 -1
- package/dist/esm/zonos-address_7.entry.js +1 -1
- package/dist/esm/zonos-cart-items_12.entry.js +32 -15
- package/dist/esm/zonos-checkout.entry.js +3 -3
- package/dist/esm/zonos-controller.entry.js +1 -1
- package/dist/esm/zonos-country-flag.entry.js +1 -1
- package/dist/esm/zonos-country-select_4.entry.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm/zonos-hello.entry.js +1 -1
- package/dist/esm/zonos-language-select_2.entry.js +1 -1
- package/dist/esm/zonos-notification_3.entry.js +4 -4
- package/dist/esm-es5/cart-9d7e0950.js +1 -0
- package/dist/esm-es5/{createCustomEvent-1f615c82.js → createCustomEvent-e93c38eb.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{paypal-a45fb0bb.js → paypal-6c55d504.js} +1 -1
- package/dist/esm-es5/zonos-address_7.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
- package/dist/scripts/index.d.ts +1 -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/store/checkout/cart.d.ts +7 -3
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.base.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.danish.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.french.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.german.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.italian.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.korean.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.polish.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.russian.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +2 -5
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +2 -5
- package/dist/types/components/store/translationStore.d.ts +1 -1
- package/dist/types/types/generated/graphql.frontend.types.d.ts +28 -29
- package/dist/types/types/generated/graphql.frontend.types.ts +43 -44
- package/dist/types/types/generated/graphql.internal.types.d.ts +3 -3
- package/dist/types/types/generated/graphql.internal.types.ts +3 -3
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-181de82e.entry.js → p-04781437.entry.js} +1 -1
- package/dist/zonos-elements/{p-60c543e7.entry.js → p-077a6d1e.entry.js} +1 -1
- package/dist/zonos-elements/{p-5d325c13.system.entry.js → p-0c2c5edf.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-1348c46d.js → p-1161bb85.js} +1 -1
- package/dist/zonos-elements/{p-b1381434.system.entry.js → p-217e862c.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-ac6562c7.system.entry.js → p-21becaac.system.entry.js} +1 -1
- package/dist/zonos-elements/p-28f00b59.js +1 -0
- package/dist/zonos-elements/{p-019b202c.entry.js → p-2ee020dd.entry.js} +1 -1
- package/dist/zonos-elements/{p-9013751a.entry.js → p-3c6503d0.entry.js} +1 -1
- package/dist/zonos-elements/{p-c224f43a.system.entry.js → p-423aa2cd.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-7096814b.system.entry.js → p-5348f8f4.system.entry.js} +1 -1
- package/dist/zonos-elements/p-5bdfdced.system.js +1 -0
- package/dist/zonos-elements/p-5f51136c.entry.js +1 -0
- package/dist/zonos-elements/{p-47d5a081.system.js → p-8161254a.system.js} +1 -1
- package/dist/zonos-elements/{p-b39b794a.js → p-82034a27.js} +1 -1
- package/dist/zonos-elements/{p-c3314b3b.entry.js → p-84adf4cf.entry.js} +1 -1
- package/dist/zonos-elements/{p-e563eb3f.entry.js → p-8e210b51.entry.js} +1 -1
- package/dist/zonos-elements/{p-3d9a0e52.system.js → p-9821d158.system.js} +2 -2
- package/dist/zonos-elements/p-af49128f.entry.js +1 -0
- package/dist/zonos-elements/{p-e2adfe87.system.js → p-baccbe8c.system.js} +1 -1
- package/dist/zonos-elements/p-c78dd680.system.js +1 -1
- package/dist/zonos-elements/{p-ba10b830.entry.js → p-cdbd5532.entry.js} +1 -1
- package/dist/zonos-elements/{p-ec8ff301.system.entry.js → p-de99079d.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-78ca17aa.system.entry.js → p-ed846c78.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-9367aeca.system.entry.js → p-f00bb583.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-0a15de43.entry.js → p-f2860f7d.entry.js} +1 -1
- package/dist/zonos-elements/{p-5ef15d65.system.entry.js → p-f45d19ab.system.entry.js} +1 -1
- package/dist/zonos-elements/p-fa36817b.system.entry.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/cart-40e0d619.js +0 -1
- package/dist/zonos-elements/p-189a2cae.entry.js +0 -1
- package/dist/zonos-elements/p-c1fbe220.js +0 -1
- package/dist/zonos-elements/p-d043cf10.system.entry.js +0 -1
- package/dist/zonos-elements/p-d31368f1.entry.js +0 -1
- package/dist/zonos-elements/p-e6f2948c.system.js +0 -1
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -97,7 +97,7 @@ const getZonosQaUrl = () => {
|
|
|
97
97
|
return null;
|
|
98
98
|
}
|
|
99
99
|
const qaUrl = extractZonosQaUrl(window.location.href);
|
|
100
|
-
const cdnUrl = "https://v1.3.
|
|
100
|
+
const cdnUrl = "https://v1.3.86.js.zonos.com";
|
|
101
101
|
// when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
|
|
102
102
|
if (!qaUrl &&
|
|
103
103
|
(cdnUrl.includes('test.') ||
|
|
@@ -281,10 +281,10 @@ const zonosLoadUrl = (() => {
|
|
|
281
281
|
}
|
|
282
282
|
return null;
|
|
283
283
|
})();
|
|
284
|
-
const ZONOS_URL = "https://v1.3.
|
|
285
|
-
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.
|
|
286
|
-
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.
|
|
287
|
-
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.
|
|
284
|
+
const ZONOS_URL = "https://v1.3.86.js.zonos.com";
|
|
285
|
+
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.86";
|
|
286
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.86";
|
|
287
|
+
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.86";
|
|
288
288
|
const INTER_FONT_URL = 'https://rsms.me';
|
|
289
289
|
const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
|
|
290
290
|
const INTER_FONT_REGEX = /^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;
|
|
@@ -299,7 +299,7 @@ Zonos.zonosConversionTest = typeof window !== 'undefined' &&
|
|
|
299
299
|
!!window.location.search.match(/\?.*(&*)zonosConversionTest/);
|
|
300
300
|
Zonos._paypalMockResponse = null;
|
|
301
301
|
Zonos.isBigCommerce = false;
|
|
302
|
-
Zonos.releaseDate = "
|
|
302
|
+
Zonos.releaseDate = "1728763184534";
|
|
303
303
|
Zonos.isLegacyCheckout = false;
|
|
304
304
|
/**
|
|
305
305
|
* By default, the package will load from npm
|
|
@@ -307,7 +307,7 @@ Zonos.isLegacyCheckout = false;
|
|
|
307
307
|
Zonos.isNpm = true;
|
|
308
308
|
Zonos.zonosQaUrl = null;
|
|
309
309
|
Zonos.zonosQaUrlApi = null;
|
|
310
|
-
Zonos.version = `v${"1.3.
|
|
310
|
+
Zonos.version = `v${"1.3.86"}`;
|
|
311
311
|
Zonos.modeAlerted = false;
|
|
312
312
|
Zonos.cartData = null;
|
|
313
313
|
Zonos.paypal = null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
4
|
-
const cart = require('./cart-
|
|
4
|
+
const cart = require('./cart-c5152dfc.js');
|
|
5
5
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
6
6
|
const isDarkColor = require('./isDarkColor-5efc8367.js');
|
|
7
7
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-c5152dfc.js');
|
|
7
7
|
const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
|
|
8
8
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
9
9
|
const containsNonLatinChars = require('./containsNonLatinChars-2be5129b.js');
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-c5152dfc.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
|
-
const paypal = require('./paypal-
|
|
8
|
+
const paypal = require('./paypal-922c7e45.js');
|
|
9
9
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
10
|
-
const createCustomEvent = require('./createCustomEvent-
|
|
10
|
+
const createCustomEvent = require('./createCustomEvent-557f8120.js');
|
|
11
11
|
const getBorderRadius = require('./getBorderRadius-5a64574c.js');
|
|
12
12
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
13
13
|
const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
|
|
@@ -31,11 +31,13 @@ const ZonosCartItems = class {
|
|
|
31
31
|
const nonRestrictedItems = cart.cartStore.items.filter(item => !item.isRestricted);
|
|
32
32
|
return (index.h(index.Host, { key: '7bdf8d1972edb2d11669441b3d8ec6643fca1f4b', class: "zonos--cart-items zonos--elements" }, index.h("table", { key: '1c2fe6d444ea93e40b981a8935d16192bf61928c', class: "zonos--cart-table" }, index.h("tbody", { key: '84279bea6821077bf117a7a13ca497155276c622' }, nonRestrictedItems.map(item => {
|
|
33
33
|
const itemImg = item.imageUrl;
|
|
34
|
+
// Split the name by <br> tag
|
|
35
|
+
const namesWithNewLine = item.name.split(/<br\s*\/*>/);
|
|
34
36
|
return (index.h("tr", { class: "zonos--cart-item" }, index.h("td", { class: "zonos--column zonos--cart-item-image" }, itemImg && !this.errorImages.includes(itemImg) ? (index.h("img", { alt: item.name, onError: () => {
|
|
35
37
|
this.errorImages = [...this.errorImages, itemImg];
|
|
36
38
|
}, src: item.imageUrl, style: {
|
|
37
39
|
'min-width': '40px',
|
|
38
|
-
}, width: 40 })) : (index.h("img", { alt: item.name, src: emptyItemImg, width: 40 }))), index.h("td", { class: "zonos--column zonos--cart-item-name" }, index.h("zonos-text", { type: "label" },
|
|
40
|
+
}, width: 40 })) : (index.h("img", { alt: item.name, src: emptyItemImg, width: 40 }))), index.h("td", { class: "zonos--column zonos--cart-item-name" }, index.h("div", null, namesWithNewLine.map(name => (index.h("zonos-text", { type: "label" }, name)))), index.h("zonos-text", { textColor: "gray-600", type: "caption" }, cart.translate('Quantity'), ": ", item.quantity)), index.h("td", { class: "zonos--column zonos--cart-item-price" }, index.h("zonos-text", { type: "semiBoldLabel", weight: 600 }, cart.currencyFormat({
|
|
39
41
|
amount: item.amount * rate * item.quantity,
|
|
40
42
|
currency: cart.cartStore.currency,
|
|
41
43
|
})))));
|
|
@@ -170,14 +172,14 @@ const ZonosCartSubtotal = class {
|
|
|
170
172
|
};
|
|
171
173
|
const renderLandedCost = () => {
|
|
172
174
|
if (cart.cartStore.landedCostMethod === 'DAP') {
|
|
173
|
-
return (index.h(index.Fragment, null, index.h("td", { class: "zonos--column zonos--cart-subtotal-title" }, index.h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, cart.translate('Duties, taxes, and fees')), cart.cartStore.dutiesTaxesFeesEstimate
|
|
175
|
+
return (index.h(index.Fragment, null, index.h("td", { class: "zonos--column zonos--cart-subtotal-title" }, index.h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, cart.translate('Duties, taxes, and fees')), cart.cartStore.dutiesTaxesFeesEstimate !== null
|
|
174
176
|
? `${cart.translate('Estimated')} ${cart.currencyFormat({
|
|
175
177
|
amount: cart.cartStore.dutiesTaxesFeesEstimate,
|
|
176
178
|
currency: cart.cartStore.currency,
|
|
177
179
|
})}`
|
|
178
180
|
: '-'), index.h("td", { class: "zonos--column zonos--cart-subtotal-price" }, index.h("div", { class: "zonos--cart-duty-tax-price" }, cart.translate('Due at delivery')))));
|
|
179
181
|
}
|
|
180
|
-
return (index.h(index.Fragment, null, index.h("td", { class: "zonos--column zonos--cart-subtotal-title" }, index.h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, cart.translate('Duties, taxes, and fees')), index.h("zonos-text", { class: "zonos--caption", type: "caption" }, cart.translate('Nothing due at the door'))), index.h("td", { class: "zonos--column zonos--cart-subtotal-price" }, index.h("div", { class: "zonos--cart-duty-tax-price" }, cart.cartStore.dutiesTaxesFees
|
|
182
|
+
return (index.h(index.Fragment, null, index.h("td", { class: "zonos--column zonos--cart-subtotal-title" }, index.h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, cart.translate('Duties, taxes, and fees')), index.h("zonos-text", { class: "zonos--caption", type: "caption" }, cart.translate('Nothing due at the door'))), index.h("td", { class: "zonos--column zonos--cart-subtotal-price" }, index.h("div", { class: "zonos--cart-duty-tax-price" }, cart.cartStore.dutiesTaxesFees !== null
|
|
181
183
|
? cart.currencyFormat({
|
|
182
184
|
amount: cart.cartStore.dutiesTaxesFees,
|
|
183
185
|
currency: cart.cartStore.currency,
|
|
@@ -540,6 +542,7 @@ const ZonosCheckoutPayment = class {
|
|
|
540
542
|
this.showErrorBanner = false;
|
|
541
543
|
}
|
|
542
544
|
render() {
|
|
545
|
+
var _a;
|
|
543
546
|
if (!cart.stripeStore.stripeElements) {
|
|
544
547
|
return null;
|
|
545
548
|
}
|
|
@@ -549,16 +552,24 @@ const ZonosCheckoutPayment = class {
|
|
|
549
552
|
}
|
|
550
553
|
const isTestMode = createCustomEvent.getIsTestMode();
|
|
551
554
|
const hasPaypalEnabled = paypal.paypalStoreHasPaypalEnabled();
|
|
552
|
-
|
|
555
|
+
const isPaypalTabSelected = ((_a = cart.stripeStore.stripePaymentEventData) === null || _a === void 0 ? void 0 : _a.value.type) === 'external_paypal';
|
|
556
|
+
return (index.h(index.Host, { class: "zonos--checkout-payment zonos--elements" }, index.h("div", { class: "zonos--group" }, index.h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, cart.translate('Payment method')), this.showErrorBanner && (index.h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, cart.translate('Missing required fields. Make sure all fields are completed.'))), cart.stripeStore.hasPaymentError && (index.h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, cart.translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypal.paypalStore.paypalErrorMessage && (index.h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypal.paypalStore.paypalErrorMessage)), index.h("zonos-payment", null), index.h("div", { class: "zonos--group-btn" }, !isPaypalTabSelected && (index.h("zonos-button", { backgroundColor: this.submitBtnColor, loading: this.continueLoading, onClick: () => {
|
|
557
|
+
if (!hasPaypalEnabled) {
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
560
|
+
this.continueClickHandler();
|
|
561
|
+
}, size: "lg",
|
|
553
562
|
// use primary type when on mobile mode
|
|
554
563
|
variant: this.submitBtnType }, cart.translate('Pay [orderTotal]', {
|
|
555
564
|
orderTotal: cart.currencyFormat({
|
|
556
565
|
amount: cart.cartStore.total,
|
|
557
566
|
currency: cart.cartStore.currency,
|
|
558
567
|
}),
|
|
559
|
-
}))
|
|
568
|
+
}))), index.h("zonos-paypal-payment", { onPaypalSessionDone: ({ detail: { orderId } }) => {
|
|
560
569
|
this.paypalSessionDone.emit(orderId);
|
|
561
|
-
}, onPaypalSessionFail: () => this.paypalSessionFailed.emit()
|
|
570
|
+
}, onPaypalSessionFail: () => this.paypalSessionFailed.emit(), style: {
|
|
571
|
+
display: isPaypalTabSelected ? 'block' : 'none',
|
|
572
|
+
} })), isTestMode && (index.h("zonos-card", { backgroundColor: "gray-100", borderRadius: 12, class: "zonos--test-cards" }, index.h("zonos-v-stack", { spacing: 16 }, index.h("div", null, index.h("zonos-text", { type: "semiBoldLabel" }, cart.translate('Test cards')), index.h("zonos-text", { textColor: "gray-700" }, cart.translate('Click to copy the card number. Use any future expiration date and three number CVC.'))), index.h("zonos-button", { icon: index.h("zonos-icon", { content: CheckmarkLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4242424242424242') }, cart.translate('Success'), " (****4242)"), index.h("zonos-button", { icon: index.h("zonos-icon", { content: RemoveLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4000000000000002') }, cart.translate('Failure'), " (****0002)")), index.h("zonos-notification", null))))));
|
|
562
573
|
}
|
|
563
574
|
};
|
|
564
575
|
ZonosCheckoutPayment.style = ZonosCheckoutPaymentStyle0;
|
|
@@ -576,9 +587,14 @@ const getContrastColor = ({ backgroundColor, color, }) => {
|
|
|
576
587
|
if (isDarkColor.isDarkColor(color)) {
|
|
577
588
|
return '#ffffff';
|
|
578
589
|
}
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
590
|
+
const newDarkerColor = isDarkColor.tinycolor(color).darken(25).toHexString();
|
|
591
|
+
const newLigherColor = isDarkColor.tinycolor(color).lighten(25).toHexString();
|
|
592
|
+
// get readibility of the color
|
|
593
|
+
const isNewColorContrastEnough = paypal.isContrastColor({
|
|
594
|
+
backgroundColor1: backgroundColor,
|
|
595
|
+
backgroundColor2: newDarkerColor,
|
|
596
|
+
});
|
|
597
|
+
return isNewColorContrastEnough ? newDarkerColor : newLigherColor;
|
|
582
598
|
};
|
|
583
599
|
|
|
584
600
|
const TabCheckmark = `<svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -1069,7 +1085,7 @@ const ChevronUpIcon = `<svg width="25" height="24" viewBox="0 0 25 24" fill="non
|
|
|
1069
1085
|
</svg>
|
|
1070
1086
|
`;
|
|
1071
1087
|
|
|
1072
|
-
const zonosShippingCss = ".sc-zonos-shipping-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-shipping-h *.sc-zonos-shipping{font-family:var(--font-family, Inter), Inter}.sc-zonos-shipping-h img.sc-zonos-shipping{max-width:100%}.sc-zonos-shipping-h dl.sc-zonos-shipping,.sc-zonos-shipping-h dd.sc-zonos-shipping,.sc-zonos-shipping-h h1.sc-zonos-shipping,.sc-zonos-shipping-h h2.sc-zonos-shipping,.sc-zonos-shipping-h h3.sc-zonos-shipping,.sc-zonos-shipping-h h4.sc-zonos-shipping,.sc-zonos-shipping-h h5.sc-zonos-shipping,.sc-zonos-shipping-h h6.sc-zonos-shipping,.sc-zonos-shipping-h hr.sc-zonos-shipping,.sc-zonos-shipping-h figure.sc-zonos-shipping,.sc-zonos-shipping-h p.sc-zonos-shipping,.sc-zonos-shipping-h pre.sc-zonos-shipping{margin:0}.sc-zonos-shipping-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-shipping-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-shipping-h .zonos--shipping-method-title.sc-zonos-shipping{margin-bottom:-16px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping{margin-bottom:20px;overflow:auto;padding:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px;-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar{width:10px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-shipping-h .zonos--error-banner.sc-zonos-shipping{margin-bottom:16px}.sc-zonos-shipping-h .zonos--shipping-method-error.sc-zonos-shipping{margin-top:24px}.sc-zonos-shipping-h zonos-button.sc-zonos-shipping{-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-shipping-h .zonos--group-btn.sc-zonos-shipping{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;bottom:0;margin-top:12px;background:var(--primary-color, var(--zonos-elements-gray-0))}.sc-zonos-shipping-h .zonos--group-btn.sc-zonos-shipping zonos-button.sc-zonos-shipping{width:100%}.sc-zonos-shipping-h .zonos--shipping-options-wrapper.sc-zonos-shipping{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.sc-zonos-shipping{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:24px;-ms-flex-align:center;align-items:center;background:
|
|
1088
|
+
const zonosShippingCss = ".sc-zonos-shipping-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-shipping-h *.sc-zonos-shipping{font-family:var(--font-family, Inter), Inter}.sc-zonos-shipping-h img.sc-zonos-shipping{max-width:100%}.sc-zonos-shipping-h dl.sc-zonos-shipping,.sc-zonos-shipping-h dd.sc-zonos-shipping,.sc-zonos-shipping-h h1.sc-zonos-shipping,.sc-zonos-shipping-h h2.sc-zonos-shipping,.sc-zonos-shipping-h h3.sc-zonos-shipping,.sc-zonos-shipping-h h4.sc-zonos-shipping,.sc-zonos-shipping-h h5.sc-zonos-shipping,.sc-zonos-shipping-h h6.sc-zonos-shipping,.sc-zonos-shipping-h hr.sc-zonos-shipping,.sc-zonos-shipping-h figure.sc-zonos-shipping,.sc-zonos-shipping-h p.sc-zonos-shipping,.sc-zonos-shipping-h pre.sc-zonos-shipping{margin:0}.sc-zonos-shipping-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-shipping-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-shipping-h .zonos--shipping-method-title.sc-zonos-shipping{margin-bottom:-16px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping{margin-bottom:20px;overflow:auto;padding:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px;-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar{width:10px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-shipping-h .zonos--error-banner.sc-zonos-shipping{margin-bottom:16px}.sc-zonos-shipping-h .zonos--shipping-method-error.sc-zonos-shipping{margin-top:24px}.sc-zonos-shipping-h zonos-button.sc-zonos-shipping{-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-shipping-h .zonos--group-btn.sc-zonos-shipping{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;bottom:0;z-index:1;margin-top:12px;background:var(--primary-color, var(--zonos-elements-gray-0))}.sc-zonos-shipping-h .zonos--group-btn.sc-zonos-shipping zonos-button.sc-zonos-shipping{width:100%}.sc-zonos-shipping-h .zonos--shipping-options-wrapper.sc-zonos-shipping{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.sc-zonos-shipping{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:24px;-ms-flex-align:center;align-items:center;background:transparent;width:100%;border:none;cursor:pointer;position:-webkit-sticky;position:sticky;top:0;z-index:1;-webkit-transition:0.5s all ease;transition:0.5s all ease}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.sc-zonos-shipping zonos-icon.sc-zonos-shipping{-webkit-transition:-webkit-transform 0.3s ease;transition:-webkit-transform 0.3s ease;transition:transform 0.3s ease;transition:transform 0.3s ease, -webkit-transform 0.3s ease}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.collapsed.sc-zonos-shipping{margin-bottom:0}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.collapsed.sc-zonos-shipping zonos-icon.sc-zonos-shipping{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.sc-zonos-shipping::before,.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.sc-zonos-shipping::after{content:\"\";display:block;width:80%;height:1px;background-color:var(--zonos-elements-border-color);-ms-flex-negative:1;flex-shrink:1}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.sc-zonos-shipping .zonos--title-wrapper.sc-zonos-shipping{-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:row;flex-direction:row;gap:8px;-ms-flex-align:center;align-items:center}.sc-zonos-shipping-h .zonos--dap-wrapper.sc-zonos-shipping{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px}";
|
|
1073
1089
|
const ZonosShippingStyle0 = zonosShippingCss;
|
|
1074
1090
|
|
|
1075
1091
|
const ZonosShipping = class {
|
|
@@ -1212,12 +1228,13 @@ const ZonosShipping = class {
|
|
|
1212
1228
|
if (this.showErrorBanner) {
|
|
1213
1229
|
this.showErrorBanner = !this.handleValidate();
|
|
1214
1230
|
}
|
|
1215
|
-
return (index.h(index.Host, { key: 'e376545666893a373bca1591083a868892804fb1', class: "zonos--shipping zonos--elements" }, index.h("div", { key: 'f8901d3d8fbeb6a285a7a33b9cea940476413c68', class: "zonos--group" }, index.h("zonos-text", { key: '83e02010c5e11647064ebf28468def163dd3395a', class: "zonos--title", type: "semiBoldSubheader" }, cart.translate('Delivery options')), this.showErrorBanner && !!allServiceLevels.length && (index.h("zonos-banner", { key: 'e65f0ce2e968612bd7c1efeca8309e69a03a8c65', class: "zonos--error-banner", intent: "error" }, cart.translate('No shipping method selected'))), index.h("zonos-text", { key: 'cdae794614c6879477e96de435d5c4e59f469fe9', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, cart.translate('Shipping method')), !allServiceLevels.length ? (index.h("zonos-banner", { bannerTitle: cart.translate('No shipping methods found - please review and update your address details by selecting the "Customer" tab above. If you continue to encounter issues, contact our support team for assistance.'), class: "zonos--shipping-method-error", intent: "error" })) : (index.h("div", { class: "zonos--shipping-options-wrapper" }, index.h("zonos-shipping-rich-radio", { items: defaultShownServiceLevels, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }),
|
|
1231
|
+
return (index.h(index.Host, { key: 'e376545666893a373bca1591083a868892804fb1', class: "zonos--shipping zonos--elements" }, index.h("div", { key: 'f8901d3d8fbeb6a285a7a33b9cea940476413c68', class: "zonos--group" }, index.h("zonos-text", { key: '83e02010c5e11647064ebf28468def163dd3395a', class: "zonos--title", type: "semiBoldSubheader" }, cart.translate('Delivery options')), this.showErrorBanner && !!allServiceLevels.length && (index.h("zonos-banner", { key: 'e65f0ce2e968612bd7c1efeca8309e69a03a8c65', class: "zonos--error-banner", intent: "error" }, cart.translate('No shipping method selected'))), index.h("zonos-text", { key: 'cdae794614c6879477e96de435d5c4e59f469fe9', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, cart.translate('Shipping method')), !allServiceLevels.length ? (index.h("zonos-banner", { bannerTitle: cart.translate('No shipping methods found - please review and update your address details by selecting the "Customer" tab above. If you continue to encounter issues, contact our support team for assistance.'), class: "zonos--shipping-method-error", intent: "error" })) : (index.h("div", { class: "zonos--shipping-options-wrapper" }, index.h("zonos-shipping-rich-radio", { items: defaultShownServiceLevels, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }), !!defaultShownServiceLevels.length &&
|
|
1232
|
+
!!this.serviceLevelsDAP.length && (index.h("button", { class: classes.classes([
|
|
1216
1233
|
'zonos--shipping-options-collapse-trigger',
|
|
1217
1234
|
this.collapsedDAPOptions && 'collapsed',
|
|
1218
1235
|
]), onClick: () => {
|
|
1219
1236
|
this.collapsedDAPOptions = !this.collapsedDAPOptions;
|
|
1220
|
-
} }, index.h("div", { class: "zonos--title-wrapper" }, index.h("zonos-text", { type: "label" }, `${cart.translate(this.collapsedDAPOptions ? 'Show non
|
|
1237
|
+
} }, index.h("div", { class: "zonos--title-wrapper" }, index.h("zonos-text", { type: "label" }, `${cart.translate(this.collapsedDAPOptions ? 'Show non-prepaid options' : 'Hide non-prepaid options')} `), index.h("zonos-icon", { content: ChevronUpIcon })))), index.h("zonos-collapse", { collapsed: this.collapsedDAPOptions }, index.h("div", { class: "zonos--dap-wrapper" }, index.h("zonos-banner", { bannerTitle: cart.translate('Duties and taxes will be charged upon delivery.'), intent: "warning" }, cart.translate('You may incur additional fees from the shipping carrier by not prepaying.')), index.h("zonos-shipping-rich-radio", { items: this.serviceLevelsDAP, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }))))), index.h("div", { key: '2dded1f7168a16ed6432ea0b147b8ec78fd774a6', class: "zonos--group-btn" }, index.h("zonos-button", { key: '54c05db9336209c34a7c7c518bbdf859e97b51f1', backgroundColor: this.submitBtnColor, loading: this.continueLoading || this.isSelecting, onClick: () => this.continueClickHandler(), size: "lg",
|
|
1221
1238
|
// use primary type when on mobile mode
|
|
1222
1239
|
variant: this.submitBtnType }, cart.translate('Go to payment'))))));
|
|
1223
1240
|
}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
7
|
-
const paypal = require('./paypal-
|
|
6
|
+
const cart = require('./cart-c5152dfc.js');
|
|
7
|
+
const paypal = require('./paypal-922c7e45.js');
|
|
8
8
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
9
|
-
const createCustomEvent = require('./createCustomEvent-
|
|
9
|
+
const createCustomEvent = require('./createCustomEvent-557f8120.js');
|
|
10
10
|
const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
|
|
11
11
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
12
12
|
const classes = require('./classes-b7918f56.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-c5152dfc.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
8
8
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
9
9
|
require('./isDarkColor-5efc8367.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-c5152dfc.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
9
|
require('./handleFetch-45e76490.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-c5152dfc.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
8
8
|
const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
|
|
9
9
|
const isDarkColor = require('./isDarkColor-5efc8367.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-c5152dfc.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
9
|
const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
6
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
7
|
-
const cart = require('./cart-
|
|
7
|
+
const cart = require('./cart-c5152dfc.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
9
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
10
10
|
const getHasMoreSpaceOnRight = require('./getHasMoreSpaceOnRight-4c94667f.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-c5152dfc.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
8
8
|
const ILanguage = require('./ILanguage-98b04442.js');
|
|
9
9
|
require('./handleFetch-45e76490.js');
|
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
6
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
|
-
const cart = require('./cart-
|
|
8
|
+
const cart = require('./cart-c5152dfc.js');
|
|
9
9
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
10
|
-
const paypal = require('./paypal-
|
|
10
|
+
const paypal = require('./paypal-922c7e45.js');
|
|
11
11
|
require('./isDarkColor-5efc8367.js');
|
|
12
12
|
require('./getBorderRadius-5a64574c.js');
|
|
13
13
|
|
|
@@ -91,7 +91,7 @@ const ZonosPayment = class {
|
|
|
91
91
|
// Create and mount the Authentication Element in ${type} mode
|
|
92
92
|
const paymentElement = cart.stripeStore.stripePaymentElement ||
|
|
93
93
|
this.stripeElements.create('payment', {
|
|
94
|
-
layout: '
|
|
94
|
+
layout: 'tabs',
|
|
95
95
|
});
|
|
96
96
|
const paymentElementContainer = this.el.querySelector('.zonos--payment-component');
|
|
97
97
|
if (!paymentElementContainer) {
|
|
@@ -110,7 +110,7 @@ const ZonosPayment = class {
|
|
|
110
110
|
}
|
|
111
111
|
render() {
|
|
112
112
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
113
|
-
return (index.h(index.Host, { key: '
|
|
113
|
+
return (index.h(index.Host, { key: 'cf616ec959fd1b7396ed86b23561f459e0da8722', class: "zonos--payment zonos--elements" }, this.titleText && (index.h("zonos-text", { key: 'e5564db71ba2c0d67d372cb1804d6d462cdf1b33', class: "zonos--title", type: "semiBoldLabel" }, this.titleText)), index.h("div", { key: '3ea47f2c0a541590210d181bc73ecb3fb27e7783', class: "zonos--payment-component" }), index.h("div", { key: 'd3a46a127448568caf4309806e88556594075c12', class: "zonos--payment-paypal-container" })));
|
|
114
114
|
}
|
|
115
115
|
get el() { return index.getElement(this); }
|
|
116
116
|
static get watchers() { return {
|
package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.js
CHANGED
|
@@ -13,11 +13,13 @@ export class ZonosCartItems {
|
|
|
13
13
|
const nonRestrictedItems = cartStore.items.filter(item => !item.isRestricted);
|
|
14
14
|
return (h(Host, { key: '7bdf8d1972edb2d11669441b3d8ec6643fca1f4b', class: "zonos--cart-items zonos--elements" }, h("table", { key: '1c2fe6d444ea93e40b981a8935d16192bf61928c', class: "zonos--cart-table" }, h("tbody", { key: '84279bea6821077bf117a7a13ca497155276c622' }, nonRestrictedItems.map(item => {
|
|
15
15
|
const itemImg = item.imageUrl;
|
|
16
|
+
// Split the name by <br> tag
|
|
17
|
+
const namesWithNewLine = item.name.split(/<br\s*\/*>/);
|
|
16
18
|
return (h("tr", { class: "zonos--cart-item" }, h("td", { class: "zonos--column zonos--cart-item-image" }, itemImg && !this.errorImages.includes(itemImg) ? (h("img", { alt: item.name, onError: () => {
|
|
17
19
|
this.errorImages = [...this.errorImages, itemImg];
|
|
18
20
|
}, src: item.imageUrl, style: {
|
|
19
21
|
'min-width': '40px',
|
|
20
|
-
}, width: 40 })) : (h("img", { alt: item.name, src: emptyItemImg, width: 40 }))), h("td", { class: "zonos--column zonos--cart-item-name" }, h("zonos-text", { type: "label" },
|
|
22
|
+
}, width: 40 })) : (h("img", { alt: item.name, src: emptyItemImg, width: 40 }))), h("td", { class: "zonos--column zonos--cart-item-name" }, h("div", null, namesWithNewLine.map(name => (h("zonos-text", { type: "label" }, name)))), h("zonos-text", { textColor: "gray-600", type: "caption" }, translate('Quantity'), ": ", item.quantity)), h("td", { class: "zonos--column zonos--cart-item-price" }, h("zonos-text", { type: "semiBoldLabel", weight: 600 }, currencyFormat({
|
|
21
23
|
amount: item.amount * rate * item.quantity,
|
|
22
24
|
currency: cartStore.currency,
|
|
23
25
|
})))));
|
|
@@ -40,14 +40,14 @@ export class ZonosCartSubtotal {
|
|
|
40
40
|
};
|
|
41
41
|
const renderLandedCost = () => {
|
|
42
42
|
if (cartStore.landedCostMethod === 'DAP') {
|
|
43
|
-
return (h(Fragment, null, h("td", { class: "zonos--column zonos--cart-subtotal-title" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Duties, taxes, and fees')), cartStore.dutiesTaxesFeesEstimate
|
|
43
|
+
return (h(Fragment, null, h("td", { class: "zonos--column zonos--cart-subtotal-title" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Duties, taxes, and fees')), cartStore.dutiesTaxesFeesEstimate !== null
|
|
44
44
|
? `${translate('Estimated')} ${currencyFormat({
|
|
45
45
|
amount: cartStore.dutiesTaxesFeesEstimate,
|
|
46
46
|
currency: cartStore.currency,
|
|
47
47
|
})}`
|
|
48
48
|
: '-'), h("td", { class: "zonos--column zonos--cart-subtotal-price" }, h("div", { class: "zonos--cart-duty-tax-price" }, translate('Due at delivery')))));
|
|
49
49
|
}
|
|
50
|
-
return (h(Fragment, null, h("td", { class: "zonos--column zonos--cart-subtotal-title" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Duties, taxes, and fees')), h("zonos-text", { class: "zonos--caption", type: "caption" }, translate('Nothing due at the door'))), h("td", { class: "zonos--column zonos--cart-subtotal-price" }, h("div", { class: "zonos--cart-duty-tax-price" }, cartStore.dutiesTaxesFees
|
|
50
|
+
return (h(Fragment, null, h("td", { class: "zonos--column zonos--cart-subtotal-title" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Duties, taxes, and fees')), h("zonos-text", { class: "zonos--caption", type: "caption" }, translate('Nothing due at the door'))), h("td", { class: "zonos--column zonos--cart-subtotal-price" }, h("div", { class: "zonos--cart-duty-tax-price" }, cartStore.dutiesTaxesFees !== null
|
|
51
51
|
? currencyFormat({
|
|
52
52
|
amount: cartStore.dutiesTaxesFees,
|
|
53
53
|
currency: cartStore.currency,
|
|
@@ -42,6 +42,7 @@ export class ZonosCheckoutPayment {
|
|
|
42
42
|
this.showErrorBanner = false;
|
|
43
43
|
}
|
|
44
44
|
render() {
|
|
45
|
+
var _a;
|
|
45
46
|
if (!stripeStore.stripeElements) {
|
|
46
47
|
return null;
|
|
47
48
|
}
|
|
@@ -51,16 +52,24 @@ export class ZonosCheckoutPayment {
|
|
|
51
52
|
}
|
|
52
53
|
const isTestMode = getIsTestMode();
|
|
53
54
|
const hasPaypalEnabled = paypalStoreHasPaypalEnabled();
|
|
54
|
-
|
|
55
|
+
const isPaypalTabSelected = ((_a = stripeStore.stripePaymentEventData) === null || _a === void 0 ? void 0 : _a.value.type) === 'external_paypal';
|
|
56
|
+
return (h(Host, { class: "zonos--checkout-payment zonos--elements" }, h("div", { class: "zonos--group" }, h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, translate('Payment method')), this.showErrorBanner && (h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, translate('Missing required fields. Make sure all fields are completed.'))), stripeStore.hasPaymentError && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypalStore.paypalErrorMessage && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypalStore.paypalErrorMessage)), h("zonos-payment", null), h("div", { class: "zonos--group-btn" }, !isPaypalTabSelected && (h("zonos-button", { backgroundColor: this.submitBtnColor, loading: this.continueLoading, onClick: () => {
|
|
57
|
+
if (!hasPaypalEnabled) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
this.continueClickHandler();
|
|
61
|
+
}, size: "lg",
|
|
55
62
|
// use primary type when on mobile mode
|
|
56
63
|
variant: this.submitBtnType }, translate('Pay [orderTotal]', {
|
|
57
64
|
orderTotal: currencyFormat({
|
|
58
65
|
amount: cartStore.total,
|
|
59
66
|
currency: cartStore.currency,
|
|
60
67
|
}),
|
|
61
|
-
}))
|
|
68
|
+
}))), h("zonos-paypal-payment", { onPaypalSessionDone: ({ detail: { orderId } }) => {
|
|
62
69
|
this.paypalSessionDone.emit(orderId);
|
|
63
|
-
}, onPaypalSessionFail: () => this.paypalSessionFailed.emit()
|
|
70
|
+
}, onPaypalSessionFail: () => this.paypalSessionFailed.emit(), style: {
|
|
71
|
+
display: isPaypalTabSelected ? 'block' : 'none',
|
|
72
|
+
} })), isTestMode && (h("zonos-card", { backgroundColor: "gray-100", borderRadius: 12, class: "zonos--test-cards" }, h("zonos-v-stack", { spacing: 16 }, h("div", null, h("zonos-text", { type: "semiBoldLabel" }, translate('Test cards')), h("zonos-text", { textColor: "gray-700" }, translate('Click to copy the card number. Use any future expiration date and three number CVC.'))), h("zonos-button", { icon: h("zonos-icon", { content: CheckmarkLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4242424242424242') }, translate('Success'), " (****4242)"), h("zonos-button", { icon: h("zonos-icon", { content: RemoveLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4000000000000002') }, translate('Failure'), " (****0002)")), h("zonos-notification", null))))));
|
|
64
73
|
}
|
|
65
74
|
static get is() { return "zonos-checkout-payment"; }
|
|
66
75
|
static get encapsulation() { return "scoped"; }
|
package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.css
CHANGED
|
@@ -77,6 +77,7 @@
|
|
|
77
77
|
display: flex;
|
|
78
78
|
justify-content: center;
|
|
79
79
|
bottom: 0;
|
|
80
|
+
z-index: 1;
|
|
80
81
|
margin-top: 12px;
|
|
81
82
|
background: var(--primary-color, var(--zonos-elements-gray-0));
|
|
82
83
|
}
|
|
@@ -93,7 +94,7 @@
|
|
|
93
94
|
flex-direction: row;
|
|
94
95
|
gap: 24px;
|
|
95
96
|
align-items: center;
|
|
96
|
-
background:
|
|
97
|
+
background: transparent;
|
|
97
98
|
width: 100%;
|
|
98
99
|
border: none;
|
|
99
100
|
cursor: pointer;
|
|
@@ -146,12 +146,13 @@ export class ZonosShipping {
|
|
|
146
146
|
if (this.showErrorBanner) {
|
|
147
147
|
this.showErrorBanner = !this.handleValidate();
|
|
148
148
|
}
|
|
149
|
-
return (h(Host, { key: 'e376545666893a373bca1591083a868892804fb1', class: "zonos--shipping zonos--elements" }, h("div", { key: 'f8901d3d8fbeb6a285a7a33b9cea940476413c68', class: "zonos--group" }, h("zonos-text", { key: '83e02010c5e11647064ebf28468def163dd3395a', class: "zonos--title", type: "semiBoldSubheader" }, translate('Delivery options')), this.showErrorBanner && !!allServiceLevels.length && (h("zonos-banner", { key: 'e65f0ce2e968612bd7c1efeca8309e69a03a8c65', class: "zonos--error-banner", intent: "error" }, translate('No shipping method selected'))), h("zonos-text", { key: 'cdae794614c6879477e96de435d5c4e59f469fe9', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, translate('Shipping method')), !allServiceLevels.length ? (h("zonos-banner", { bannerTitle: translate('No shipping methods found - please review and update your address details by selecting the "Customer" tab above. If you continue to encounter issues, contact our support team for assistance.'), class: "zonos--shipping-method-error", intent: "error" })) : (h("div", { class: "zonos--shipping-options-wrapper" }, h("zonos-shipping-rich-radio", { items: defaultShownServiceLevels, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }),
|
|
149
|
+
return (h(Host, { key: 'e376545666893a373bca1591083a868892804fb1', class: "zonos--shipping zonos--elements" }, h("div", { key: 'f8901d3d8fbeb6a285a7a33b9cea940476413c68', class: "zonos--group" }, h("zonos-text", { key: '83e02010c5e11647064ebf28468def163dd3395a', class: "zonos--title", type: "semiBoldSubheader" }, translate('Delivery options')), this.showErrorBanner && !!allServiceLevels.length && (h("zonos-banner", { key: 'e65f0ce2e968612bd7c1efeca8309e69a03a8c65', class: "zonos--error-banner", intent: "error" }, translate('No shipping method selected'))), h("zonos-text", { key: 'cdae794614c6879477e96de435d5c4e59f469fe9', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, translate('Shipping method')), !allServiceLevels.length ? (h("zonos-banner", { bannerTitle: translate('No shipping methods found - please review and update your address details by selecting the "Customer" tab above. If you continue to encounter issues, contact our support team for assistance.'), class: "zonos--shipping-method-error", intent: "error" })) : (h("div", { class: "zonos--shipping-options-wrapper" }, h("zonos-shipping-rich-radio", { items: defaultShownServiceLevels, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }), !!defaultShownServiceLevels.length &&
|
|
150
|
+
!!this.serviceLevelsDAP.length && (h("button", { class: classes([
|
|
150
151
|
'zonos--shipping-options-collapse-trigger',
|
|
151
152
|
this.collapsedDAPOptions && 'collapsed',
|
|
152
153
|
]), onClick: () => {
|
|
153
154
|
this.collapsedDAPOptions = !this.collapsedDAPOptions;
|
|
154
|
-
} }, h("div", { class: "zonos--title-wrapper" }, h("zonos-text", { type: "label" }, `${translate(this.collapsedDAPOptions ? 'Show non
|
|
155
|
+
} }, h("div", { class: "zonos--title-wrapper" }, h("zonos-text", { type: "label" }, `${translate(this.collapsedDAPOptions ? 'Show non-prepaid options' : 'Hide non-prepaid options')} `), h("zonos-icon", { content: ChevronUpIcon })))), h("zonos-collapse", { collapsed: this.collapsedDAPOptions }, h("div", { class: "zonos--dap-wrapper" }, h("zonos-banner", { bannerTitle: translate('Duties and taxes will be charged upon delivery.'), intent: "warning" }, translate('You may incur additional fees from the shipping carrier by not prepaying.')), h("zonos-shipping-rich-radio", { items: this.serviceLevelsDAP, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }))))), h("div", { key: '2dded1f7168a16ed6432ea0b147b8ec78fd774a6', class: "zonos--group-btn" }, h("zonos-button", { key: '54c05db9336209c34a7c7c518bbdf859e97b51f1', backgroundColor: this.submitBtnColor, loading: this.continueLoading || this.isSelecting, onClick: () => this.continueClickHandler(), size: "lg",
|
|
155
156
|
// use primary type when on mobile mode
|
|
156
157
|
variant: this.submitBtnType }, translate('Go to payment'))))));
|
|
157
158
|
}
|
|
@@ -13,8 +13,8 @@ const { onChange, reset, state: cartStore, } = createStore(() => ({
|
|
|
13
13
|
checkoutTimeoutInterval: null,
|
|
14
14
|
currency: 'USD',
|
|
15
15
|
doneSteps: [],
|
|
16
|
-
dutiesTaxesFees:
|
|
17
|
-
dutiesTaxesFeesEstimate:
|
|
16
|
+
dutiesTaxesFees: null,
|
|
17
|
+
dutiesTaxesFeesEstimate: null,
|
|
18
18
|
error: null,
|
|
19
19
|
exchangeRate: null,
|
|
20
20
|
externalConfirmationPageURL: null,
|
|
@@ -138,15 +138,16 @@ const cartStoreUpdateToErrorState = ({ messages, title, }) => {
|
|
|
138
138
|
title,
|
|
139
139
|
};
|
|
140
140
|
};
|
|
141
|
-
const cartStoreApplySubtotals = (subtotals,
|
|
141
|
+
const cartStoreApplySubtotals = ({ dutiesTaxesFeesEstimate, method, subtotals, }) => {
|
|
142
142
|
// update exchange rate so we can use it to display cart items
|
|
143
143
|
cartStore.exchangeRate = subtotals.exchangeRate;
|
|
144
144
|
cartStore.adjustmentTotal = subtotals.adjustments;
|
|
145
|
-
cartStore.dutiesTaxesFees =
|
|
145
|
+
cartStore.dutiesTaxesFees =
|
|
146
|
+
method === 'DAP' ? null : subtotals.landedCostTotal;
|
|
146
147
|
cartStore.subtotal = subtotals.items;
|
|
147
148
|
cartStore.total = subtotals.total;
|
|
148
149
|
cartStore.currency = subtotals.presentmentCurrencyCode;
|
|
149
|
-
cartStore.dutiesTaxesFeesEstimate = dutiesTaxesFeesEstimate ||
|
|
150
|
+
cartStore.dutiesTaxesFeesEstimate = dutiesTaxesFeesEstimate || null;
|
|
150
151
|
};
|
|
151
152
|
/**
|
|
152
153
|
* Detect if there are any items in cart that are not restricted and have positive amount, exclude negative amount items
|
|
@@ -170,10 +171,15 @@ const cartStoreSetCheckoutSession = (checkoutSession) => {
|
|
|
170
171
|
}
|
|
171
172
|
};
|
|
172
173
|
const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency, dutiesTaxesFeesEstimate, itemsAmount, landedCostId, }) => {
|
|
174
|
+
var _a;
|
|
173
175
|
if (landedCostId && cartStore.selectedLandedCost) {
|
|
174
176
|
// update cart total right away if we have landed cost id to avoid order total flickering
|
|
175
177
|
const subtotals = cartStore.selectedLandedCost.subtotals;
|
|
176
|
-
cartStoreApplySubtotals(
|
|
178
|
+
cartStoreApplySubtotals({
|
|
179
|
+
dutiesTaxesFeesEstimate,
|
|
180
|
+
method: cartStore.landedCostMethod,
|
|
181
|
+
subtotals,
|
|
182
|
+
});
|
|
177
183
|
log('Exchange rate updated for cart items (landed cost subtotal)', 'info', cartStore.exchangeRate);
|
|
178
184
|
}
|
|
179
185
|
// update checkout session
|
|
@@ -204,7 +210,10 @@ const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency,
|
|
|
204
210
|
if (!landedCostId) {
|
|
205
211
|
// This is when we first open the checkout modal and we just want to get info from the old cart session.
|
|
206
212
|
// use subtotals from checkout session to update cart total
|
|
207
|
-
cartStoreApplySubtotals(
|
|
213
|
+
cartStoreApplySubtotals({
|
|
214
|
+
method: ((_a = json.checkoutSessionUpdate.landedCost) === null || _a === void 0 ? void 0 : _a.method) || 'DDP',
|
|
215
|
+
subtotals: json.checkoutSessionUpdate.subtotals,
|
|
216
|
+
});
|
|
208
217
|
log('Exchange rate updated for cart items (checkout session update)', 'info', cartStore.exchangeRate);
|
|
209
218
|
}
|
|
210
219
|
cartStoreSetCheckoutSession(json.checkoutSessionUpdate);
|
|
@@ -229,12 +238,13 @@ const cartStoreUpdateSelectedShippingOption = async (selectedShippingOption, lan
|
|
|
229
238
|
// do nothing if we can't find landed cost for selected shipping option
|
|
230
239
|
return false;
|
|
231
240
|
}
|
|
232
|
-
// If the quote is DAP,
|
|
233
|
-
const
|
|
234
|
-
|
|
235
|
-
const
|
|
241
|
+
// If the quote is DAP, then convert manually.
|
|
242
|
+
const landedCostAmount = ((_b = selectedLandedCost.landedCost.amountSubtotals) === null || _b === void 0 ? void 0 : _b.landedCostTotal) || 0;
|
|
243
|
+
// Convert using checkout presentment exchange rate
|
|
244
|
+
const exchangeRate = selectedLandedCost.subtotals.exchangeRate.rate;
|
|
245
|
+
const dutiesTaxesFeesEstimate = landedCostAmount * exchangeRate;
|
|
236
246
|
if (dutiesTaxesFeesEstimate) {
|
|
237
|
-
log(`DAP quote, using estimate
|
|
247
|
+
log(`DAP quote, using estimate: ${dutiesTaxesFeesEstimate}`, 'info');
|
|
238
248
|
}
|
|
239
249
|
cartStore.landedCostMethod = selectedLandedCost.landedCost.method || 'DDP';
|
|
240
250
|
// update shipping value and dutiesTaxFees on selectedShippingOption change
|
|
@@ -66,6 +66,7 @@ const getStripeOptions = ({ clientSecret, overrideBorderRadius, overridePrimaryC
|
|
|
66
66
|
}),
|
|
67
67
|
},
|
|
68
68
|
clientSecret,
|
|
69
|
+
externalPaymentMethodTypes: ['external_paypal'],
|
|
69
70
|
locale: localizationStore.selectedLocale,
|
|
70
71
|
};
|
|
71
72
|
};
|
|
@@ -242,13 +243,16 @@ const stripeStorePrefetchLandedCost = async (params) => {
|
|
|
242
243
|
if (subtotals) {
|
|
243
244
|
// prefetch landed cost will not update shipping and taxes since we haven't selected shipping method yet
|
|
244
245
|
cartStoreApplySubtotals({
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
246
|
+
method: (matchLandedCost === null || matchLandedCost === void 0 ? void 0 : matchLandedCost.landedCost.method) || 'DDP',
|
|
247
|
+
subtotals: {
|
|
248
|
+
adjustments: subtotals.adjustments,
|
|
249
|
+
exchangeRate: subtotals.exchangeRate,
|
|
250
|
+
items: subtotals.items,
|
|
251
|
+
landedCostTotal: subtotals.landedCostTotal,
|
|
252
|
+
presentmentCurrencyCode: subtotals.presentmentCurrencyCode,
|
|
253
|
+
shipping: subtotals.shipping,
|
|
254
|
+
total: subtotals.total,
|
|
255
|
+
},
|
|
252
256
|
});
|
|
253
257
|
}
|
|
254
258
|
}
|
|
@@ -406,7 +410,7 @@ const stripeStoreConfirmPayment = async () => {
|
|
|
406
410
|
* @returns {boolean} whether or not the checkout session is successfully created
|
|
407
411
|
*/
|
|
408
412
|
const stripeStoreInitCheckoutSession = async () => {
|
|
409
|
-
var _a;
|
|
413
|
+
var _a, _b;
|
|
410
414
|
const total = cartStore.items.reduce((amount, item) => amount + item.amount * item.quantity, 0);
|
|
411
415
|
if (!total || !localizationStore.targetCurrency) {
|
|
412
416
|
logError('Failed to create checkout session - invalid total or currency');
|
|
@@ -434,7 +438,10 @@ const stripeStoreInitCheckoutSession = async () => {
|
|
|
434
438
|
// update cart store with updated information
|
|
435
439
|
cartStoreSetCheckoutSession(result);
|
|
436
440
|
stripeStore.clientSecret = result.clientSecret;
|
|
437
|
-
cartStoreApplySubtotals(
|
|
441
|
+
cartStoreApplySubtotals({
|
|
442
|
+
method: ((_b = result.landedCost) === null || _b === void 0 ? void 0 : _b.method) || 'DDP',
|
|
443
|
+
subtotals: Object.assign(Object.assign({}, result.subtotals), { landedCostTotal: 0, shipping: 0, total: result.subtotals.items }),
|
|
444
|
+
});
|
|
438
445
|
log('Exchange rate updated for cart items (checkout session create)', 'info', cartStore.exchangeRate);
|
|
439
446
|
log('done-init-checkout-session');
|
|
440
447
|
return true;
|