@zonos/elements 1.3.230 → 1.3.231
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-ad82a680.js → cart-9b519566.js} +6 -2
- package/dist/cjs/hasInclusivePrice-12605be9.js +24 -0
- package/dist/cjs/index.cjs.js +7 -7
- package/dist/cjs/{localization-31e3dfe3.js → localization-38af974b.js} +118 -30
- package/dist/cjs/{paypal-88b5e878.js → paypal-e8fa2302.js} +3 -3
- package/dist/cjs/{placeTestOrder-6aefbf9c.js → placeTestOrder-6388881f.js} +11 -7
- package/dist/cjs/{renderFallback-87c908ad.js → renderFallback-bb2c4bce.js} +2 -2
- package/dist/cjs/{translationStore-b8b25e9d.js → translationStore-f2d5eae9.js} +420 -360
- package/dist/cjs/zonos-address_11.cjs.entry.js +21 -5
- package/dist/cjs/zonos-cart-items_13.cjs.entry.js +73 -13
- package/dist/cjs/zonos-checkout.cjs.entry.js +8 -5
- package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +3 -3
- package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +6 -6
- package/dist/cjs/zonos-collect.cjs.entry.js +5 -5
- package/dist/cjs/zonos-confirm-dialog_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-controller.cjs.entry.js +12 -5
- package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +9 -6
- package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +4 -4
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +55 -45
- package/dist/cjs/zonos-hello.cjs.entry.js +2 -2
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +68 -7
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-review/zonos-review.js +2 -1
- package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +7 -4
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +54 -43
- package/dist/collection/components/main/zonos-controller.js +5 -2
- package/dist/collection/components/store/hello/localization.js +47 -16
- package/dist/collection/components/store/translationStore/strings.arabic.js +21 -18
- package/dist/collection/components/store/translationStore/strings.base.js +21 -18
- package/dist/collection/components/store/translationStore/strings.chinese.js +21 -18
- package/dist/collection/components/store/translationStore/strings.danish.js +21 -18
- package/dist/collection/components/store/translationStore/strings.dutch.js +21 -18
- package/dist/collection/components/store/translationStore/strings.french.js +21 -18
- package/dist/collection/components/store/translationStore/strings.german.js +21 -18
- package/dist/collection/components/store/translationStore/strings.hebrew.js +21 -18
- package/dist/collection/components/store/translationStore/strings.indonesian.js +21 -18
- package/dist/collection/components/store/translationStore/strings.italian.js +21 -18
- package/dist/collection/components/store/translationStore/strings.japanese.js +21 -18
- package/dist/collection/components/store/translationStore/strings.korean.js +21 -18
- package/dist/collection/components/store/translationStore/strings.norwegian.js +21 -18
- package/dist/collection/components/store/translationStore/strings.polish.js +21 -18
- package/dist/collection/components/store/translationStore/strings.portuguese.js +21 -18
- package/dist/collection/components/store/translationStore/strings.russian.js +21 -18
- package/dist/collection/components/store/translationStore/strings.spanish.js +21 -18
- package/dist/collection/components/store/translationStore/strings.swedish.js +21 -18
- package/dist/collection/components/store/translationStore/strings.turkish.js +21 -18
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +21 -18
- package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +18 -2
- package/dist/collection/components/utils/api/{getInclusivePricing.js → getInclusivePriceConfigurations.js} +1 -1
- package/dist/collection/components/utils/api/getLocalization.js +2 -5
- package/dist/collection/components/utils/api/getZonosSettings.js +5 -0
- package/dist/collection/components/utils/api/prepCalculateLandedCost.js +6 -0
- package/dist/collection/components/utils/checkout/renderCheckoutCurrency.js +10 -5
- package/dist/collection/components/utils/checkout/watchBigcommerceDomesticCheckout.js +4 -1
- package/dist/collection/components/utils/getOverridenZCountry.js +11 -0
- package/dist/collection/components/utils/hasInclusivePrice.js +10 -0
- package/dist/collection/components/utils/hello/currencyConversion/applyInclusiveEffectiveRate.js +10 -0
- package/dist/collection/components/utils/hello/currencyConversion/applyInclusivePrice.js +39 -0
- package/dist/collection/components/utils/hello/currencyConversion/calculateInclusivePrice.js +32 -0
- package/dist/collection/components/utils/hello/currencyConversion/defaultCurrencyConverter.js +11 -6
- package/dist/collection/constants/key.js +9 -0
- package/dist/collection/types/InclusivePricing.js +1 -0
- package/dist/collection/types/generated/graphql.internal.types.js +87 -3
- package/dist/collection/types/index.js +1 -0
- package/dist/collection/utils/performBlurCurrency.js +38 -5
- package/dist/esm/{cart-c74f9aaa.js → cart-bc0e1598.js} +6 -2
- package/dist/esm/hasInclusivePrice-706cc09d.js +20 -0
- package/dist/esm/index.js +7 -7
- package/dist/esm/{localization-106476cb.js → localization-53f67640.js} +117 -31
- package/dist/esm/{paypal-bf3a2bdd.js → paypal-3a6a048d.js} +3 -3
- package/dist/esm/{placeTestOrder-891295e8.js → placeTestOrder-917731cf.js} +11 -7
- package/dist/esm/{renderFallback-ce0e238a.js → renderFallback-cd0e40d9.js} +2 -2
- package/dist/esm/{translationStore-766b7521.js → translationStore-d241dcf7.js} +420 -360
- package/dist/esm/zonos-address_11.entry.js +21 -5
- package/dist/esm/zonos-cart-items_13.entry.js +73 -13
- package/dist/esm/zonos-checkout.entry.js +8 -5
- package/dist/esm/zonos-collect-cart-items_3.entry.js +3 -3
- package/dist/esm/zonos-collect-finish_6.entry.js +6 -6
- package/dist/esm/zonos-collect.entry.js +5 -5
- package/dist/esm/zonos-confirm-dialog_2.entry.js +1 -1
- package/dist/esm/zonos-controller.entry.js +12 -5
- package/dist/esm/zonos-country-flag.entry.js +2 -2
- package/dist/esm/zonos-country-select_4.entry.js +9 -6
- package/dist/esm/zonos-empty-state-payment_4.entry.js +4 -4
- package/dist/esm/zonos-hello-dialog.entry.js +55 -45
- package/dist/esm/zonos-hello.entry.js +2 -2
- package/dist/esm/zonos-language-select_2.entry.js +2 -2
- package/dist/esm-es5/cart-bc0e1598.js +1 -0
- package/dist/esm-es5/hasInclusivePrice-706cc09d.js +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/localization-53f67640.js +1 -0
- package/dist/esm-es5/{paypal-bf3a2bdd.js → paypal-3a6a048d.js} +1 -1
- package/dist/esm-es5/placeTestOrder-917731cf.js +1 -0
- package/dist/esm-es5/{renderFallback-ce0e238a.js → renderFallback-cd0e40d9.js} +1 -1
- package/dist/esm-es5/translationStore-d241dcf7.js +1 -0
- package/dist/esm-es5/zonos-address_11.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-collect-cart-items_3.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
- package/dist/esm-es5/zonos-collect.entry.js +1 -1
- package/dist/esm-es5/zonos-confirm-dialog_2.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/blurCurrencyOnInit.js +1 -1
- package/dist/scripts/index.d.ts +31 -6
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.d.ts +2 -0
- package/dist/types/components/hello/zonos-hello-dialog/zonos-hello-dialog.d.ts +1 -1
- package/dist/types/components/store/checkout/cart.d.ts +3 -0
- package/dist/types/components/store/hello/localization.d.ts +14 -3
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.base.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.danish.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.french.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.german.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.italian.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.korean.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.polish.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.russian.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +18 -15
- package/dist/types/components/utils/api/getInclusivePriceConfigurations.d.ts +2 -0
- package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
- package/dist/types/components/utils/getOverridenZCountry.d.ts +5 -0
- package/dist/types/components/utils/hasInclusivePrice.d.ts +1 -0
- package/dist/types/components/utils/hello/currencyConversion/applyInclusiveEffectiveRate.d.ts +1 -0
- package/dist/types/components/utils/hello/currencyConversion/applyInclusivePrice.d.ts +1 -0
- package/dist/types/components/utils/hello/currencyConversion/calculateInclusivePrice.d.ts +27 -0
- package/dist/types/constants/key.d.ts +9 -0
- package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +1 -0
- package/dist/types/types/InclusivePricing.d.ts +13 -0
- package/dist/types/types/checkout/api/CalculateLandedCost.d.ts +1 -0
- package/dist/types/types/checkout/api/NormalizedTempCart.d.ts +2 -0
- package/dist/types/types/generated/graphql.frontend.types.d.ts +1 -1
- package/dist/types/types/generated/graphql.frontend.types.ts +1 -1
- package/dist/types/types/generated/graphql.internal.types.d.ts +184 -51
- package/dist/types/types/generated/graphql.internal.types.ts +221 -50
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/utils/ZonosSettings.d.ts +2 -0
- package/dist/types/utils/performBlurCurrency.d.ts +12 -0
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-c89e9d56.system.js → p-0047fecf.system.js} +1 -1
- package/dist/zonos-elements/{p-bd373de0.system.entry.js → p-0bc8e55c.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-964a4d85.js → p-2008df67.js} +1 -1
- package/dist/zonos-elements/{p-2db90c99.system.entry.js → p-22338b4a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-38f2f63f.system.entry.js → p-2eaa5013.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-288f5a5b.system.entry.js → p-304bdbc2.system.entry.js} +1 -1
- package/dist/zonos-elements/p-30981f80.entry.js +1 -0
- package/dist/zonos-elements/p-3a242dfc.system.js +1 -0
- package/dist/zonos-elements/{p-5608ac9d.entry.js → p-3eda5c2c.entry.js} +1 -1
- package/dist/zonos-elements/p-3f0ca5f9.js +1 -0
- package/dist/zonos-elements/{p-23f6a2fb.system.entry.js → p-3f35b8b1.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-de984173.system.js → p-419c292c.system.js} +1 -1
- package/dist/zonos-elements/{p-7a97e1cf.system.entry.js → p-4697f061.system.entry.js} +1 -1
- package/dist/zonos-elements/p-4f5be8f0.entry.js +1 -0
- package/dist/zonos-elements/p-516a9666.system.js +1 -0
- package/dist/zonos-elements/p-55c6ff14.system.entry.js +1 -0
- package/dist/zonos-elements/p-6d563f33.system.entry.js +1 -0
- package/dist/zonos-elements/{p-caebc1f8.system.js → p-7730879e.system.js} +1 -1
- package/dist/zonos-elements/p-7920d79c.system.js +1 -0
- package/dist/zonos-elements/p-7c96a585.js +1 -0
- package/dist/zonos-elements/p-81b357f7.system.js +1 -1
- package/dist/zonos-elements/{p-2b84039a.entry.js → p-91fa43ef.entry.js} +1 -1
- package/dist/zonos-elements/p-9a444a82.system.entry.js +1 -0
- package/dist/zonos-elements/p-9bdad585.system.entry.js +1 -0
- package/dist/zonos-elements/p-abc0fb80.js +1 -0
- package/dist/zonos-elements/{p-b0a75761.entry.js → p-ac26a931.entry.js} +1 -1
- package/dist/zonos-elements/p-bb707dfd.system.js +1 -0
- package/dist/zonos-elements/{p-10894d36.entry.js → p-bc963b03.entry.js} +1 -1
- package/dist/zonos-elements/p-c0e080e3.js +1 -0
- package/dist/zonos-elements/p-c20429ea.entry.js +1 -0
- package/dist/zonos-elements/p-c28da00e.entry.js +1 -0
- package/dist/zonos-elements/p-c9be03e0.entry.js +1 -0
- package/dist/zonos-elements/{p-6c8e4f01.system.entry.js → p-cb70de13.system.entry.js} +1 -1
- package/dist/zonos-elements/p-cec35a21.entry.js +1 -0
- package/dist/zonos-elements/{p-cf56b990.entry.js → p-d15cd138.entry.js} +1 -1
- package/dist/zonos-elements/{p-6f1024de.system.entry.js → p-d852d6da.system.entry.js} +1 -1
- package/dist/zonos-elements/p-d9486c57.entry.js +1 -0
- package/dist/zonos-elements/p-db73c11a.entry.js +1 -0
- package/dist/zonos-elements/{p-203c7fda.js → p-e27a9450.js} +1 -1
- package/dist/zonos-elements/{p-258570ce.entry.js → p-ede9e968.entry.js} +1 -1
- package/dist/zonos-elements/p-ee8fcde6.js +1 -0
- package/dist/zonos-elements/p-f688d7a4.system.js +1 -0
- package/dist/zonos-elements/{p-236e0144.system.entry.js → p-ff1722d0.system.entry.js} +1 -1
- package/dist/zonos-elements/p-ff522088.system.entry.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +3 -3
- package/dist/esm-es5/cart-c74f9aaa.js +0 -1
- package/dist/esm-es5/localization-106476cb.js +0 -1
- package/dist/esm-es5/placeTestOrder-891295e8.js +0 -1
- package/dist/esm-es5/translationStore-766b7521.js +0 -1
- package/dist/types/components/utils/api/getInclusivePricing.d.ts +0 -6
- package/dist/zonos-elements/p-053a042e.entry.js +0 -1
- package/dist/zonos-elements/p-1d15662c.js +0 -1
- package/dist/zonos-elements/p-21b251f0.system.entry.js +0 -1
- package/dist/zonos-elements/p-225a61c4.system.entry.js +0 -1
- package/dist/zonos-elements/p-462f8857.entry.js +0 -1
- package/dist/zonos-elements/p-57ee34aa.system.entry.js +0 -1
- package/dist/zonos-elements/p-595668d7.system.js +0 -1
- package/dist/zonos-elements/p-62803534.entry.js +0 -1
- package/dist/zonos-elements/p-6497ce22.entry.js +0 -1
- package/dist/zonos-elements/p-65db3219.entry.js +0 -1
- package/dist/zonos-elements/p-783e7fa7.entry.js +0 -1
- package/dist/zonos-elements/p-9972941a.entry.js +0 -1
- package/dist/zonos-elements/p-ad7be556.system.entry.js +0 -1
- package/dist/zonos-elements/p-b4fe3604.system.js +0 -1
- package/dist/zonos-elements/p-b8293509.js +0 -1
- package/dist/zonos-elements/p-c3c3cd98.js +0 -1
- package/dist/zonos-elements/p-c6d0e87d.system.entry.js +0 -1
- package/dist/zonos-elements/p-cdaf52f4.system.js +0 -1
- package/dist/zonos-elements/p-cef1e888.system.js +0 -1
- package/dist/zonos-elements/p-eea0d8af.js +0 -1
- package/dist/zonos-elements/p-f4085c23.entry.js +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const zonosStore = require('./zonosStore-5d489c65.js');
|
|
4
|
-
const localization = require('./localization-
|
|
5
|
-
const translationStore = require('./translationStore-
|
|
4
|
+
const localization = require('./localization-38af974b.js');
|
|
5
|
+
const translationStore = require('./translationStore-f2d5eae9.js');
|
|
6
6
|
const handleFetch = require('./handleFetch-954f30e1.js');
|
|
7
7
|
const VarianceTest = require('./VarianceTest-bec00ea8.js');
|
|
8
8
|
const isDarkColor = require('./isDarkColor-994c38e4.js');
|
|
@@ -75,6 +75,7 @@ const prepCartCalculateLandedCost = (cartId) => {
|
|
|
75
75
|
const { firstName: billingFirstName, lastName: billingLastName } = extractName({
|
|
76
76
|
name: translatedBillingAddress.name,
|
|
77
77
|
});
|
|
78
|
+
const checkoutSessionCountry = localization.getOverridenZCountry() || 'US';
|
|
78
79
|
return {
|
|
79
80
|
billingAddress: {
|
|
80
81
|
addressLine1: translatedBillingAddress.line1,
|
|
@@ -94,6 +95,9 @@ const prepCartCalculateLandedCost = (cartId) => {
|
|
|
94
95
|
// Use the first item's currency code
|
|
95
96
|
cartCurrencyCode: (_a = cartStore.items[0]) === null || _a === void 0 ? void 0 : _a.currencyCode,
|
|
96
97
|
cartId,
|
|
98
|
+
checkoutSessionCountry: checkoutSessionCountry ||
|
|
99
|
+
localization.localizationStore.selectedCountryCode ||
|
|
100
|
+
undefined,
|
|
97
101
|
checkoutSessionId: localization.storageStore.checkoutSessionId || '',
|
|
98
102
|
contact: {
|
|
99
103
|
companyName: stripeStore.companyName,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const localization = require('./localization-38af974b.js');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Since the backend and the frontend are using the same keys,
|
|
7
|
+
* make sure to not change the key value below since if it changes
|
|
8
|
+
* and the frontend script is cached, the formula may not work as expected.
|
|
9
|
+
*/
|
|
10
|
+
const DUTY_KEY = 'gkjqw123';
|
|
11
|
+
const TAXES_KEY = 'Kq93wqw3';
|
|
12
|
+
|
|
13
|
+
const hasInclusivePrice = () => {
|
|
14
|
+
var _a;
|
|
15
|
+
return (_a = localization.localizationStore.inclusivePricingConfigurations) === null || _a === void 0 ? void 0 : _a.some(x => {
|
|
16
|
+
var _a, _b;
|
|
17
|
+
return ((_a = x.configurations[DUTY_KEY]) === null || _a === void 0 ? void 0 : _a.status) === 'ENABLED' ||
|
|
18
|
+
((_b = x.configurations[TAXES_KEY]) === null || _b === void 0 ? void 0 : _b.status) === 'ENABLED';
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
exports.DUTY_KEY = DUTY_KEY;
|
|
23
|
+
exports.TAXES_KEY = TAXES_KEY;
|
|
24
|
+
exports.hasInclusivePrice = hasInclusivePrice;
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -132,7 +132,7 @@ const getZonosQaUrl = () => {
|
|
|
132
132
|
return null;
|
|
133
133
|
}
|
|
134
134
|
const qaUrl = extractZonosQaUrl(window.location.href);
|
|
135
|
-
const cdnUrl = "https://v1.3.
|
|
135
|
+
const cdnUrl = "https://v1.3.231.js.zonos.com";
|
|
136
136
|
// when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
|
|
137
137
|
if (!qaUrl &&
|
|
138
138
|
(cdnUrl.includes('test.') ||
|
|
@@ -380,10 +380,10 @@ const zonosLoadUrl = (() => {
|
|
|
380
380
|
return null;
|
|
381
381
|
})();
|
|
382
382
|
const startLoadTime = Date.now();
|
|
383
|
-
const ZONOS_URL = "https://v1.3.
|
|
384
|
-
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.
|
|
385
|
-
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.
|
|
386
|
-
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.
|
|
383
|
+
const ZONOS_URL = "https://v1.3.231.js.zonos.com";
|
|
384
|
+
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.231";
|
|
385
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.231";
|
|
386
|
+
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.231";
|
|
387
387
|
const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
|
|
388
388
|
const GOOGLE_FONT_REGEX = /^https:\/\/fonts\.googleapis\.com/;
|
|
389
389
|
class Zonos {
|
|
@@ -401,7 +401,7 @@ Zonos.iframeLogType = typeof window !== 'undefined'
|
|
|
401
401
|
? new URLSearchParams(window.location.search).get('iframeLogType')
|
|
402
402
|
: null;
|
|
403
403
|
Zonos.isBigCommerce = false;
|
|
404
|
-
Zonos.releaseDate = "
|
|
404
|
+
Zonos.releaseDate = "1754944720824";
|
|
405
405
|
Zonos.isLegacyCheckout = false;
|
|
406
406
|
Zonos.startLoadTime = startLoadTime;
|
|
407
407
|
Zonos.domain = typeof window !== 'undefined'
|
|
@@ -421,7 +421,7 @@ Zonos.isNpm = true;
|
|
|
421
421
|
Zonos.zonosQaUrl = null;
|
|
422
422
|
Zonos.zonosQaUrlApi = null;
|
|
423
423
|
Zonos.trackEventLogs = [];
|
|
424
|
-
Zonos.version = `v${"1.3.
|
|
424
|
+
Zonos.version = `v${"1.3.231"}`;
|
|
425
425
|
Zonos.modeAlerted = false;
|
|
426
426
|
Zonos.cartData = null;
|
|
427
427
|
Zonos.paypal = null;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const zonosStore = require('./zonosStore-5d489c65.js');
|
|
4
4
|
const handleFetch = require('./handleFetch-954f30e1.js');
|
|
5
5
|
const VarianceTest = require('./VarianceTest-bec00ea8.js');
|
|
6
|
-
const translationStore = require('./translationStore-
|
|
6
|
+
const translationStore = require('./translationStore-f2d5eae9.js');
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Check if the response contains at least one available test key that we support
|
|
@@ -137,7 +137,7 @@ const getExchangeRate = async ({ country, isGuaranteed, sourceCurrency, targetCu
|
|
|
137
137
|
return defaultUsExchangeRate;
|
|
138
138
|
};
|
|
139
139
|
|
|
140
|
-
const
|
|
140
|
+
const getInclusivePriceConfigurations = async (countryCode) => {
|
|
141
141
|
var _a;
|
|
142
142
|
if (!countryCode) {
|
|
143
143
|
return null;
|
|
@@ -188,12 +188,20 @@ const getZCountryUrlParam = (urlParams) => {
|
|
|
188
188
|
return zCountry || fallback || secondFallback;
|
|
189
189
|
};
|
|
190
190
|
|
|
191
|
+
/**
|
|
192
|
+
* Retrieve the zCountry from the URL or session storage.
|
|
193
|
+
*/
|
|
194
|
+
const getOverridenZCountry = () => {
|
|
195
|
+
const currentUrl = new URL(window.location.href);
|
|
196
|
+
// load and use country from session storage when zCountry query param is not present
|
|
197
|
+
const countryLoadedSession = window.sessionStorage.getItem('zonos--country');
|
|
198
|
+
const zCountry = getZCountryUrlParam(currentUrl.searchParams) || countryLoadedSession;
|
|
199
|
+
return zCountry;
|
|
200
|
+
};
|
|
201
|
+
|
|
191
202
|
const getLocalization = async () => {
|
|
192
203
|
try {
|
|
193
|
-
const
|
|
194
|
-
// load and use country from session storage when zCountry query param is not present
|
|
195
|
-
const countryLoadedSession = window.sessionStorage.getItem('zonos--country');
|
|
196
|
-
const zCountry = getZCountryUrlParam(currentUrl.searchParams) || countryLoadedSession;
|
|
204
|
+
const zCountry = getOverridenZCountry();
|
|
197
205
|
const searchParams = new URLSearchParams();
|
|
198
206
|
if (zCountry) {
|
|
199
207
|
searchParams.set('zCountry', zCountry);
|
|
@@ -228,6 +236,16 @@ const getShippingZones = async () => {
|
|
|
228
236
|
return shippingZones || null;
|
|
229
237
|
};
|
|
230
238
|
|
|
239
|
+
const applyInclusiveEffectiveRate = (amount) => {
|
|
240
|
+
const inclusivePrice = localizationStore.inclusivePricingConfigurations.find(x => x.shipToCountry === localizationStore.selectedCountryCode);
|
|
241
|
+
if (!inclusivePrice) {
|
|
242
|
+
return amount;
|
|
243
|
+
}
|
|
244
|
+
const effectiveRate = inclusivePrice.effectiveRate;
|
|
245
|
+
// Just multiply the amount by the effective rate to get the new amount for inclusive pricing
|
|
246
|
+
return amount * (1 + effectiveRate);
|
|
247
|
+
};
|
|
248
|
+
|
|
231
249
|
const currencyConvert = (value) => {
|
|
232
250
|
// TODO(potentially): Bring over the code for vanity checks
|
|
233
251
|
const { exchangeRate } = localizationStore;
|
|
@@ -391,15 +409,48 @@ const removeBlurCurrency = async () => {
|
|
|
391
409
|
});
|
|
392
410
|
window.zonosBlurCurrencyOnInitIntervalId = undefined;
|
|
393
411
|
};
|
|
394
|
-
|
|
412
|
+
/**
|
|
413
|
+
* This function is used to remove the blur effect from a specific element. (combined with performBlurSpecificElement)
|
|
414
|
+
* @returns void
|
|
415
|
+
*/
|
|
416
|
+
const removeBlurSpecificElement = async ({ specificSelector, timeoutId, }) => {
|
|
417
|
+
// Wait a bit to make sure price is fully rendered in DOM
|
|
418
|
+
await new Promise(resolve => setTimeout(resolve, 500));
|
|
419
|
+
if (timeoutId) {
|
|
420
|
+
clearTimeout(timeoutId);
|
|
421
|
+
}
|
|
422
|
+
specificSelector.classList.remove(BLUR_CURRENCY_CLASSNAME);
|
|
423
|
+
};
|
|
424
|
+
const blurCurrencyElements = ({ currencySelector, specificSelector, }) => {
|
|
395
425
|
// Do nothing if the currency selector is not provided or blurCurrencyOnInit is false
|
|
396
|
-
if (!currencySelector) {
|
|
426
|
+
if (!currencySelector && !specificSelector) {
|
|
397
427
|
return;
|
|
398
428
|
}
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
429
|
+
if (specificSelector) {
|
|
430
|
+
specificSelector.classList.add(BLUR_CURRENCY_CLASSNAME);
|
|
431
|
+
}
|
|
432
|
+
else {
|
|
433
|
+
const currencyElements = document.querySelectorAll([currencySelector].filter(Boolean).join(','));
|
|
434
|
+
currencyElements.forEach(element => {
|
|
435
|
+
element.classList.add(BLUR_CURRENCY_CLASSNAME);
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
};
|
|
439
|
+
const performBlurSpecificElement = (specificSelector) => {
|
|
440
|
+
if (typeof window === 'undefined') {
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
blurCurrencyElements({
|
|
444
|
+
specificSelector,
|
|
402
445
|
});
|
|
446
|
+
// The blur will be removed as soon as we got the exchange rate back. But if the exchange rate is not available for some reason, the blur effect will be automatically removed after 10 seconds
|
|
447
|
+
const timeoutId = setTimeout(() => {
|
|
448
|
+
void removeBlurSpecificElement({
|
|
449
|
+
specificSelector,
|
|
450
|
+
timeoutId,
|
|
451
|
+
});
|
|
452
|
+
}, BLUR_CURRENCY_DURATION);
|
|
453
|
+
return timeoutId;
|
|
403
454
|
};
|
|
404
455
|
const performBlurCurrency = () => {
|
|
405
456
|
if (typeof window === 'undefined') {
|
|
@@ -449,18 +500,20 @@ const convertCurrency = (element) => {
|
|
|
449
500
|
// Update currency when the country code changes
|
|
450
501
|
currentCountryValue !== localizationStore.selectedCountryCode)) {
|
|
451
502
|
// Hide the currency until DOM is ready to display the new value
|
|
452
|
-
|
|
503
|
+
const timeoutId = performBlurSpecificElement(element);
|
|
504
|
+
const appliedInclusivePrice = applyInclusiveEffectiveRate(amount);
|
|
453
505
|
const customizedCurrencyFormat = typeof zonosStore.zonosStore.currencyConverter === 'function' &&
|
|
454
506
|
zonosStore.zonosStore.currencyConverter({
|
|
455
507
|
convert: currencyConvert,
|
|
456
508
|
convertAndFormat: currencyConvertAndFormat,
|
|
457
509
|
currencyCode: localizationStore.targetCurrency,
|
|
458
510
|
format: (value) => currencyFormat({ amount: value }),
|
|
459
|
-
originalAmount:
|
|
511
|
+
originalAmount: appliedInclusivePrice,
|
|
460
512
|
selector: element,
|
|
461
513
|
});
|
|
462
514
|
// default to the currencyConvertAndFormat if the currencyConverter function does not return a value, or invalid value. This is to make sure we don't break the merchant's price.
|
|
463
|
-
const observedFormattedValue = customizedCurrencyFormat ||
|
|
515
|
+
const observedFormattedValue = customizedCurrencyFormat ||
|
|
516
|
+
currencyConvertAndFormat(appliedInclusivePrice);
|
|
464
517
|
if (observedFormattedValue !== element.textContent) {
|
|
465
518
|
// Only set textContent if the value has changed, this is to prevent it redrawing the element if the value is the same
|
|
466
519
|
element.textContent = observedFormattedValue;
|
|
@@ -470,9 +523,11 @@ const convertCurrency = (element) => {
|
|
|
470
523
|
// save the new value to the data-zintl attribute
|
|
471
524
|
element.setAttribute('data-zintl', observedFormattedValue);
|
|
472
525
|
element.setAttribute('data-zcountry-code', localizationStore.selectedCountryCode || '');
|
|
526
|
+
void removeBlurSpecificElement({
|
|
527
|
+
specificSelector: element,
|
|
528
|
+
timeoutId,
|
|
529
|
+
});
|
|
473
530
|
}
|
|
474
|
-
// Remove blur effect after the currency is converted
|
|
475
|
-
void removeBlurCurrency();
|
|
476
531
|
};
|
|
477
532
|
const defaultCurrencyConverter = () => {
|
|
478
533
|
const { currencyElementSelector } = zonosStore.zonosStore.helloSettings;
|
|
@@ -534,7 +589,8 @@ const { dispose: localizationDispose, onChange: localizationStoreOnChange, state
|
|
|
534
589
|
customMessages: [],
|
|
535
590
|
exchangeRate: null,
|
|
536
591
|
helloCountryList: null,
|
|
537
|
-
|
|
592
|
+
inclusivePricingConfigurations: [],
|
|
593
|
+
inclusivePricingIsFetching: false,
|
|
538
594
|
isDisabledCountry: true,
|
|
539
595
|
isShippableCountry: false,
|
|
540
596
|
localizationLoaded: false,
|
|
@@ -568,6 +624,17 @@ const getFallbackDefaultCountryCode = (allowedCountries) => {
|
|
|
568
624
|
// Don't check if it is allowed. If it is not allowed it will fallback to Albania (first option).
|
|
569
625
|
return DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT;
|
|
570
626
|
};
|
|
627
|
+
const refreshInclusivePricingConfigurations = async (countryCode) => {
|
|
628
|
+
if (!countryCode) {
|
|
629
|
+
return;
|
|
630
|
+
}
|
|
631
|
+
// These requests are only needed for Hello, so we can skip them for legacy checkout
|
|
632
|
+
localizationStore.inclusivePricingIsFetching = true;
|
|
633
|
+
const inclusivePricingConfigurations = await getInclusivePriceConfigurations(countryCode);
|
|
634
|
+
localizationStore.inclusivePricingConfigurations =
|
|
635
|
+
inclusivePricingConfigurations || [];
|
|
636
|
+
localizationStore.inclusivePricingIsFetching = false;
|
|
637
|
+
};
|
|
571
638
|
// This recursive function is for users who step away from their computer and come back needing a new exchange rate
|
|
572
639
|
const startExchangeRateTimeout = ({ isGuaranteed, maxAge, }) => {
|
|
573
640
|
if (localizationStore.exchangeRateTimeout) {
|
|
@@ -578,12 +645,14 @@ const startExchangeRateTimeout = ({ isGuaranteed, maxAge, }) => {
|
|
|
578
645
|
const maxAgeToUse = maxAge || defaultMaxAge;
|
|
579
646
|
// Recursively set timeouts to get new exchange rates when the current one expires
|
|
580
647
|
localizationStore.exchangeRateTimeout = setTimeout(async () => {
|
|
648
|
+
// Refresh inclusive pricing configurations before getting a new exchange rate, so hello can use the new effective rate
|
|
649
|
+
await refreshInclusivePricingConfigurations(localizationStore.selectedCountryCode);
|
|
581
650
|
const { maxAge: newMaxAge } = await triggerGetExchangeRate(isGuaranteed);
|
|
582
651
|
startExchangeRateTimeout({ isGuaranteed, maxAge: newMaxAge });
|
|
583
652
|
}, maxAgeToUse * 1000);
|
|
584
653
|
};
|
|
585
|
-
const getNewLocalization = async () => {
|
|
586
|
-
var _a;
|
|
654
|
+
const getNewLocalization = async ({ isInitializing, }) => {
|
|
655
|
+
var _a, _b;
|
|
587
656
|
VarianceTest.log('get new localization store');
|
|
588
657
|
const { isDisabledCountry, isShippableCountry, selectedCountryCode } = localizationStore;
|
|
589
658
|
if (zonosStore.zonosStore.helloSettings.currencyBehavior === 'DISABLED' ||
|
|
@@ -597,14 +666,22 @@ const getNewLocalization = async () => {
|
|
|
597
666
|
performBlurCurrency();
|
|
598
667
|
const { maxAge } = await triggerGetExchangeRate(isGuaranteed);
|
|
599
668
|
startExchangeRateTimeout({ isGuaranteed, maxAge });
|
|
669
|
+
if (isInitializing &&
|
|
670
|
+
((_a = window.Zonos.cartSettings) === null || _a === void 0 ? void 0 : _a.inclusivePriceConfigurations)) {
|
|
671
|
+
localizationStore.inclusivePricingConfigurations =
|
|
672
|
+
((_b = window.Zonos.cartSettings) === null || _b === void 0 ? void 0 : _b.inclusivePriceConfigurations) || [];
|
|
673
|
+
void removeBlurCurrency();
|
|
674
|
+
}
|
|
675
|
+
// These requests are only needed for Hello, so we can skip them for legacy checkout
|
|
600
676
|
if (!window.Zonos.isLegacyCheckout) {
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
(
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
677
|
+
localizationStore.inclusivePricingIsFetching = true;
|
|
678
|
+
const [countryLandedCost] = await Promise.all([
|
|
679
|
+
getCountryLandedCost(localizationStore.selectedCountryCode),
|
|
680
|
+
refreshInclusivePricingConfigurations(localizationStore.selectedCountryCode),
|
|
681
|
+
]);
|
|
682
|
+
localizationStore.countryLandedCost = countryLandedCost;
|
|
683
|
+
// Remove blur effect after the currency is converted
|
|
684
|
+
void removeBlurCurrency();
|
|
608
685
|
}
|
|
609
686
|
else {
|
|
610
687
|
VarianceTest.log('Skipping country landed cost and inclusive pricing requests, because this is a legacy checkout');
|
|
@@ -649,7 +726,7 @@ const getValidCountryCode = (countryCode) => {
|
|
|
649
726
|
}
|
|
650
727
|
return countryCode;
|
|
651
728
|
};
|
|
652
|
-
const localizationStoreUpdateSelectedCountryCode = (newSelectedCountryCode) => {
|
|
729
|
+
const localizationStoreUpdateSelectedCountryCode = ({ isInitializing, newSelectedCountryCode, }) => {
|
|
653
730
|
var _a, _b;
|
|
654
731
|
VarianceTest.log(`Updating selected country code to ${newSelectedCountryCode}`);
|
|
655
732
|
const isFirstTime = !localizationStore.selectedCountryCode;
|
|
@@ -685,7 +762,7 @@ const localizationStoreUpdateSelectedCountryCode = (newSelectedCountryCode) => {
|
|
|
685
762
|
return;
|
|
686
763
|
}
|
|
687
764
|
localizationStore.targetCurrency = currencyCode;
|
|
688
|
-
void getNewLocalization();
|
|
765
|
+
void getNewLocalization({ isInitializing: isInitializing });
|
|
689
766
|
// Save the country code to session storage for later use
|
|
690
767
|
window.sessionStorage.setItem('zonos--country', selectedCountryCode);
|
|
691
768
|
// Update the URL query param with the new country code
|
|
@@ -742,6 +819,7 @@ const localizationStoreUpdateSelectedLocale = (newSelectedLocale) => {
|
|
|
742
819
|
void getCustomMessages();
|
|
743
820
|
};
|
|
744
821
|
const initLocalizationStore = async () => {
|
|
822
|
+
var _a;
|
|
745
823
|
// all countries from countries.json, shipping zone and localization
|
|
746
824
|
const [allCountries, shippingZoneCountries, localization] = await Promise.all([getCountries(), getShippingZones(), getLocalization()]);
|
|
747
825
|
// Filter countries to only include countries in the shipping zone
|
|
@@ -751,13 +829,18 @@ const initLocalizationStore = async () => {
|
|
|
751
829
|
? Object.assign(Object.assign({}, acc), { [countryCode]: countryInfo }) : acc;
|
|
752
830
|
}, {});
|
|
753
831
|
localizationStore.shippingZoneCountries = filteredCountries || null;
|
|
832
|
+
localizationStore.inclusivePricingConfigurations =
|
|
833
|
+
((_a = window.Zonos.cartSettings) === null || _a === void 0 ? void 0 : _a.inclusivePriceConfigurations) || [];
|
|
754
834
|
// Initialize the country list for the hello widget
|
|
755
835
|
initHelloCountryList(allCountries || {});
|
|
756
836
|
const { country, locale } = localization;
|
|
757
837
|
VarianceTest.log(`Country code from localization: ${country}`);
|
|
758
838
|
VarianceTest.log(`Locale from localization: ${locale}`);
|
|
759
839
|
// update selected country code in store
|
|
760
|
-
localizationStoreUpdateSelectedCountryCode(
|
|
840
|
+
localizationStoreUpdateSelectedCountryCode({
|
|
841
|
+
isInitializing: true,
|
|
842
|
+
newSelectedCountryCode: country || null,
|
|
843
|
+
});
|
|
761
844
|
// use locale from params if it exists, otherwise use locale from localization
|
|
762
845
|
const overrideLocale = getOverrideLocale();
|
|
763
846
|
localizationStoreUpdateSelectedLocale(overrideLocale || locale || 'en');
|
|
@@ -771,18 +854,23 @@ const initLocalizationStore = async () => {
|
|
|
771
854
|
if (!localizationStore.selectedCountryCode &&
|
|
772
855
|
devSites.some(site => window.location.origin.includes(site))) {
|
|
773
856
|
// update selected country code in store
|
|
774
|
-
localizationStoreUpdateSelectedCountryCode(
|
|
857
|
+
localizationStoreUpdateSelectedCountryCode({
|
|
858
|
+
isInitializing: true,
|
|
859
|
+
newSelectedCountryCode: 'CA',
|
|
860
|
+
});
|
|
775
861
|
}
|
|
776
862
|
localizationStore.localizationLoaded = true;
|
|
777
863
|
};
|
|
778
864
|
|
|
779
865
|
exports.VARIANT_TEST_KEY_EXPIRATION = VARIANT_TEST_KEY_EXPIRATION;
|
|
866
|
+
exports.applyInclusiveEffectiveRate = applyInclusiveEffectiveRate;
|
|
780
867
|
exports.currencyConvert = currencyConvert;
|
|
781
868
|
exports.currencyConvertAndFormat = currencyConvertAndFormat;
|
|
782
869
|
exports.currencyDisplay = currencyDisplay;
|
|
783
870
|
exports.currencyFormat = currencyFormat;
|
|
784
871
|
exports.filterValidTests = filterValidTests;
|
|
785
872
|
exports.getFallbackDefaultCountryCode = getFallbackDefaultCountryCode;
|
|
873
|
+
exports.getOverridenZCountry = getOverridenZCountry;
|
|
786
874
|
exports.getZCountryUrlParam = getZCountryUrlParam;
|
|
787
875
|
exports.initLocalizationStore = initLocalizationStore;
|
|
788
876
|
exports.isValidSelector = isValidSelector;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const zonosStore = require('./zonosStore-5d489c65.js');
|
|
4
|
-
const cart = require('./cart-
|
|
5
|
-
const localization = require('./localization-
|
|
6
|
-
const translationStore = require('./translationStore-
|
|
4
|
+
const cart = require('./cart-9b519566.js');
|
|
5
|
+
const localization = require('./localization-38af974b.js');
|
|
6
|
+
const translationStore = require('./translationStore-f2d5eae9.js');
|
|
7
7
|
const handleFetch = require('./handleFetch-954f30e1.js');
|
|
8
8
|
const isDarkColor = require('./isDarkColor-994c38e4.js');
|
|
9
9
|
const VarianceTest = require('./VarianceTest-bec00ea8.js');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const cart = require('./cart-
|
|
4
|
-
const localization = require('./localization-
|
|
3
|
+
const cart = require('./cart-9b519566.js');
|
|
4
|
+
const localization = require('./localization-38af974b.js');
|
|
5
5
|
const handleFetch = require('./handleFetch-954f30e1.js');
|
|
6
6
|
|
|
7
7
|
const getDisplayCurrency = () => {
|
|
@@ -20,12 +20,16 @@ const getDisplayCurrency = () => {
|
|
|
20
20
|
const renderCheckoutCurrency = ({ amount, isForeign }) => {
|
|
21
21
|
var _a, _b;
|
|
22
22
|
const targetRate = ((_a = cart.cartStore.exchangeRate) === null || _a === void 0 ? void 0 : _a.rate) || 1;
|
|
23
|
+
// If the amount already in foreign currency, no need to apply the inclusive effective rate since it's already has the inclusive effective rate applied
|
|
24
|
+
const appliedAmount = isForeign
|
|
25
|
+
? amount
|
|
26
|
+
: localization.applyInclusiveEffectiveRate(amount);
|
|
23
27
|
const presentmentCurrency = cart.cartStore.currency;
|
|
24
28
|
const itemCurrency = (_b = cart.cartStore.items[0]) === null || _b === void 0 ? void 0 : _b.currencyCode;
|
|
25
29
|
// If the item currency is the same as the presentment currency, we can just return the amount in the presentment currency in the same format
|
|
26
30
|
if (itemCurrency === presentmentCurrency) {
|
|
27
31
|
return localization.currencyFormat({
|
|
28
|
-
amount,
|
|
32
|
+
amount: appliedAmount,
|
|
29
33
|
currency: presentmentCurrency,
|
|
30
34
|
});
|
|
31
35
|
}
|
|
@@ -34,8 +38,8 @@ const renderCheckoutCurrency = ({ amount, isForeign }) => {
|
|
|
34
38
|
if (isForeign) {
|
|
35
39
|
// Amount is in foreign currency, divide by the rate to convert it to the base currency if displaying in base currency
|
|
36
40
|
const displayAmount = shouldDisplayBaseCurrency
|
|
37
|
-
?
|
|
38
|
-
:
|
|
41
|
+
? appliedAmount / targetRate
|
|
42
|
+
: appliedAmount;
|
|
39
43
|
return localization.currencyFormat({
|
|
40
44
|
amount: displayAmount,
|
|
41
45
|
currency: displayCurrency,
|
|
@@ -43,8 +47,8 @@ const renderCheckoutCurrency = ({ amount, isForeign }) => {
|
|
|
43
47
|
}
|
|
44
48
|
// Amount is already in base currency, need to multiply rate to convert to foreign currency if display in foreign currency
|
|
45
49
|
const displayAmount = shouldDisplayBaseCurrency
|
|
46
|
-
?
|
|
47
|
-
:
|
|
50
|
+
? appliedAmount
|
|
51
|
+
: appliedAmount * targetRate;
|
|
48
52
|
return localization.currencyFormat({
|
|
49
53
|
amount: displayAmount,
|
|
50
54
|
currency: displayCurrency,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const zonosStore = require('./zonosStore-5d489c65.js');
|
|
4
|
-
const cart = require('./cart-
|
|
5
|
-
const localization = require('./localization-
|
|
4
|
+
const cart = require('./cart-9b519566.js');
|
|
5
|
+
const localization = require('./localization-38af974b.js');
|
|
6
6
|
const handleFetch = require('./handleFetch-954f30e1.js');
|
|
7
7
|
const VarianceTest = require('./VarianceTest-bec00ea8.js');
|
|
8
8
|
const index = require('./index-1c710d00.js');
|