@zonos/elements 1.3.11-alpha.1 → 1.3.11-alpha.3
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-d9e9ecfc.js → cart-fcddc0e6.js} +71 -8
- package/dist/cjs/{getBorderRadius-9d619bf6.js → getBorderRadius-4fa738c3.js} +1 -1
- package/dist/cjs/{getContrastColor-af2386af.js → getContrastColor-c72796c6.js} +1 -1
- package/dist/cjs/{isDarkColor-a68274cf.js → isDarkColor-7faf0a82.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{submitGtag-b7ef5d5b.js → submitGtag-ec6ead54.js} +15 -2
- package/dist/cjs/zonos-address_4.cjs.entry.js +12 -9
- package/dist/cjs/zonos-badge_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-banner.cjs.entry.js +1 -1
- package/dist/cjs/zonos-button_2.cjs.entry.js +5 -5
- package/dist/cjs/zonos-card_2.cjs.entry.js +4 -4
- package/dist/cjs/zonos-cart-items_10.cjs.entry.js +19 -21
- package/dist/cjs/zonos-checkout.cjs.entry.js +238 -13
- package/dist/cjs/zonos-controller.cjs.entry.js +4 -4
- package/dist/cjs/zonos-country-flag.cjs.entry.js +4 -4
- package/dist/cjs/zonos-country-select_3.cjs.entry.js +4 -4
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +5 -5
- package/dist/cjs/zonos-hello.cjs.entry.js +16 -4
- package/dist/cjs/zonos-icon.cjs.entry.js +1 -1
- package/dist/cjs/zonos-logo.cjs.entry.js +1 -1
- package/dist/cjs/zonos-notification.cjs.entry.js +1 -1
- package/dist/cjs/zonos-payment.cjs.entry.js +4 -4
- package/dist/cjs/zonos-select-dialog-header_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +3 -3
- package/dist/cjs/zonos-text.cjs.entry.js +1 -1
- package/dist/cjs/{zonosStore-21334303.js → zonosStore-bd2a0c59.js} +19 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +4 -5
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +91 -9
- package/dist/collection/components/checkout/zonos-checkout/zonos-review/zonos-review.css +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +1 -1
- package/dist/collection/components/common/zonos-button/zonos-button.js +1 -1
- package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +5 -5
- package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.css +1 -0
- package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +5 -4
- package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +5 -5
- package/dist/collection/components/common/zonos-icon/zonos-icon.js +2 -2
- package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js +7 -7
- package/dist/collection/components/hello/zonos-hello/zonos-hello.js +17 -2
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +5 -5
- package/dist/collection/components/store/checkout/stripe.js +8 -2
- package/dist/collection/components/store/translationStore/strings.arabic.js +3 -0
- package/dist/collection/components/store/translationStore/strings.base.js +3 -0
- package/dist/collection/components/store/translationStore/strings.chinese.js +3 -0
- package/dist/collection/components/store/translationStore/strings.danish.js +3 -0
- package/dist/collection/components/store/translationStore/strings.dutch.js +3 -0
- package/dist/collection/components/store/translationStore/strings.french.js +3 -0
- package/dist/collection/components/store/translationStore/strings.german.js +3 -0
- package/dist/collection/components/store/translationStore/strings.hebrew.js +3 -0
- package/dist/collection/components/store/translationStore/strings.indonesian.js +3 -0
- package/dist/collection/components/store/translationStore/strings.italian.js +3 -0
- package/dist/collection/components/store/translationStore/strings.japanese.js +3 -0
- package/dist/collection/components/store/translationStore/strings.korean.js +3 -0
- package/dist/collection/components/store/translationStore/strings.norwegian.js +3 -0
- package/dist/collection/components/store/translationStore/strings.polish.js +3 -0
- package/dist/collection/components/store/translationStore/strings.portuguese.js +3 -0
- package/dist/collection/components/store/translationStore/strings.russian.js +3 -0
- package/dist/collection/components/store/translationStore/strings.spanish.js +3 -0
- package/dist/collection/components/store/translationStore/strings.swedish.js +3 -0
- package/dist/collection/components/store/translationStore/strings.turkish.js +3 -0
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +3 -0
- package/dist/collection/components/store/zonosStore.js +19 -2
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +5 -2
- package/dist/collection/components/utils/api/buildCartItemsByTempCart.js +24 -0
- package/dist/collection/components/utils/api/tempCartItem/getAttributes.js +66 -0
- package/dist/collection/components/utils/api/tempCartItem/getMeasurements.js +58 -0
- package/dist/collection/components/utils/api/trackConversionEvent.js +2 -0
- package/dist/collection/components/utils/checkout/isShippableCountry.js +2 -0
- package/dist/collection/components/utils/createCustomEvent.js +9 -0
- package/dist/collection/scripts/zonosBase.js +1 -0
- package/dist/collection/styles/stripe/addressRuleStyle.js +0 -3
- package/dist/collection/types/checkout/api/TempCart.js +1 -0
- package/dist/collection/types/generated/graphql.customer.types.js +73 -0
- package/dist/components/stripe.js +68 -5
- package/dist/components/trackConversionEvent.js +2 -0
- package/dist/components/zonos-address2.js +5 -2
- package/dist/components/zonos-button2.js +1 -1
- package/dist/components/zonos-checkbox2.js +3 -3
- package/dist/components/zonos-checkout-finish2.js +14 -6
- package/dist/components/zonos-checkout-progress-tabs2.js +6 -6
- package/dist/components/zonos-checkout.js +238 -11
- package/dist/components/zonos-dialog2.js +3 -3
- package/dist/components/zonos-hello-dialog2.js +1 -1
- package/dist/components/zonos-hello.js +16 -2
- package/dist/components/zonos-review2.js +1 -1
- package/dist/components/zonos-shipping-rich-radio2.js +1 -1
- package/dist/components/zonos-shipping2.js +1 -1
- package/dist/components/zonosStore.js +19 -2
- package/dist/esm/{cart-6cfd7560.js → cart-228e1ef7.js} +71 -8
- package/dist/esm/{getBorderRadius-c5fb7746.js → getBorderRadius-a89e45fb.js} +1 -1
- package/dist/esm/{getContrastColor-a1a6f6aa.js → getContrastColor-5fbc4746.js} +1 -1
- package/dist/esm/{isDarkColor-810fcaa5.js → isDarkColor-6bf71e51.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{submitGtag-acca574d.js → submitGtag-c3727595.js} +15 -3
- package/dist/esm/zonos-address_4.entry.js +12 -9
- package/dist/esm/zonos-badge_2.entry.js +1 -1
- package/dist/esm/zonos-banner.entry.js +1 -1
- package/dist/esm/zonos-button_2.entry.js +5 -5
- package/dist/esm/zonos-card_2.entry.js +4 -4
- package/dist/esm/zonos-cart-items_10.entry.js +19 -21
- package/dist/esm/zonos-checkout.entry.js +238 -13
- package/dist/esm/zonos-controller.entry.js +4 -4
- package/dist/esm/zonos-country-flag.entry.js +4 -4
- package/dist/esm/zonos-country-select_3.entry.js +4 -4
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +5 -5
- package/dist/esm/zonos-hello.entry.js +16 -4
- package/dist/esm/zonos-icon.entry.js +1 -1
- package/dist/esm/zonos-logo.entry.js +1 -1
- package/dist/esm/zonos-notification.entry.js +1 -1
- package/dist/esm/zonos-payment.entry.js +4 -4
- package/dist/esm/zonos-select-dialog-header_2.entry.js +1 -1
- package/dist/esm/zonos-shipping-rich-radio.entry.js +3 -3
- package/dist/esm/zonos-text.entry.js +1 -1
- package/dist/esm/{zonosStore-e5f3d4da.js → zonosStore-c4c45591.js} +19 -2
- package/dist/esm-es5/cart-228e1ef7.js +1 -0
- package/dist/esm-es5/{getBorderRadius-c5fb7746.js → getBorderRadius-a89e45fb.js} +1 -1
- package/dist/esm-es5/getContrastColor-5fbc4746.js +1 -0
- package/dist/esm-es5/{isDarkColor-810fcaa5.js → isDarkColor-6bf71e51.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/submitGtag-c3727595.js +1 -0
- package/dist/esm-es5/zonos-address_4.entry.js +1 -1
- package/dist/esm-es5/zonos-badge_2.entry.js +1 -1
- package/dist/esm-es5/zonos-banner.entry.js +1 -1
- package/dist/esm-es5/zonos-button_2.entry.js +1 -1
- package/dist/esm-es5/zonos-card_2.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_10.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_3.entry.js +1 -1
- package/dist/esm-es5/zonos-elements.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-icon.entry.js +1 -1
- package/dist/esm-es5/zonos-logo.entry.js +1 -1
- package/dist/esm-es5/zonos-notification.entry.js +1 -1
- package/dist/esm-es5/zonos-payment.entry.js +1 -1
- package/dist/esm-es5/zonos-select-dialog-header_2.entry.js +1 -1
- package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
- package/dist/esm-es5/zonos-text.entry.js +1 -1
- package/dist/esm-es5/{zonosStore-e5f3d4da.js → zonosStore-c4c45591.js} +1 -1
- package/dist/scripts/getTempCartById.js +1 -0
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/scripts/zonosBase.js +1 -1
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +7 -0
- package/dist/types/components/common/zonos-checkbox/zonos-checkbox.d.ts +1 -1
- package/dist/types/components/common/zonos-dialog/zonos-dialog.d.ts +1 -1
- package/dist/types/components/common/zonos-icon/zonos-icon.d.ts +1 -1
- package/dist/types/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.d.ts +2 -1
- package/dist/types/components/hello/zonos-hello/zonos-hello.d.ts +1 -0
- package/dist/types/components/hello/zonos-hello-dialog/zonos-hello-dialog.d.ts +2 -1
- package/dist/types/components/store/checkout/cart.d.ts +9 -3
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.base.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.danish.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.french.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.german.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.italian.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.korean.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.polish.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.russian.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +3 -0
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +3 -0
- package/dist/types/components/store/zonosStore.d.ts +11 -2
- package/dist/types/components/utils/api/buildCartItemsByTempCart.d.ts +7 -0
- package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
- package/dist/types/components/utils/api/tempCartItem/getAttributes.d.ts +11 -0
- package/dist/types/components/utils/api/tempCartItem/getMeasurements.d.ts +7 -0
- package/dist/types/components/utils/changeDeepProperty.d.ts +1 -1
- package/dist/types/components/utils/changeDeepPropertyAtIndex.d.ts +1 -1
- package/dist/types/components/utils/createCustomEvent.d.ts +12 -0
- package/dist/types/components/utils/getBorderRadius.d.ts +1 -1
- package/dist/types/components/utils/handleFetch.d.ts +2 -1
- package/dist/types/components.d.ts +2 -4
- package/dist/types/scripts/zonosBase.d.ts +10 -1
- package/dist/types/styles/stripe/addressRuleStyle.d.ts +2 -1
- package/dist/types/types/checkout/CheckoutConfig.d.ts +6 -1
- package/dist/types/types/checkout/api/TempCart.d.ts +80 -0
- package/dist/types/types/generated/graphql.customer.types.d.ts +97 -0
- package/dist/types/types/generated/graphql.customer.types.ts +135 -1
- 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/global.d.ts +10 -0
- package/dist/types/types/utils/deep/IDeepKeyofAtIndex.d.ts +1 -1
- package/dist/zonos-elements/{p-7e00a5dc.system.entry.js → p-001518eb.system.entry.js} +1 -1
- package/dist/zonos-elements/p-0082c5be.system.entry.js +1 -0
- package/dist/zonos-elements/p-07022f11.js +1 -0
- package/dist/zonos-elements/{p-ff17c03b.entry.js → p-11f1b5fb.entry.js} +1 -1
- package/dist/zonos-elements/{p-0b51de7b.system.entry.js → p-145dd34a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-65a877e2.entry.js → p-14a2824f.entry.js} +1 -1
- package/dist/zonos-elements/{p-f8b03017.system.entry.js → p-15cd4a76.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-c4862aab.system.entry.js → p-160cdf4e.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-b1ee44c6.system.js → p-167b3369.system.js} +1 -1
- package/dist/zonos-elements/{p-59595553.entry.js → p-171eb334.entry.js} +1 -1
- package/dist/zonos-elements/{p-e74f27da.js → p-1bbdfae5.js} +1 -1
- package/dist/zonos-elements/{p-22db99c9.system.entry.js → p-1d833f22.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-b9cde0c3.entry.js → p-215cd7ec.entry.js} +1 -1
- package/dist/zonos-elements/{p-6a80f7f5.entry.js → p-223d72d8.entry.js} +1 -1
- package/dist/zonos-elements/{p-817e7f8e.entry.js → p-30cd191f.entry.js} +1 -1
- package/dist/zonos-elements/{p-824b8708.system.entry.js → p-35c328ba.system.entry.js} +1 -1
- package/dist/zonos-elements/p-397d8268.entry.js +1 -0
- package/dist/zonos-elements/{p-6db032ee.system.js → p-41c2b1c5.system.js} +1 -1
- package/dist/zonos-elements/{p-6dc606c6.entry.js → p-4515ec7b.entry.js} +1 -1
- package/dist/zonos-elements/{p-ac7155d7.entry.js → p-470284a3.entry.js} +1 -1
- package/dist/zonos-elements/{p-fd8c50e8.system.entry.js → p-499d7f5d.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-b76909ab.entry.js → p-4c9367f1.entry.js} +1 -1
- package/dist/zonos-elements/{p-9a2c3874.system.entry.js → p-4d7b27af.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-60ac5342.system.entry.js → p-55940b5a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-a641dfcd.entry.js → p-5d5c0fbf.entry.js} +1 -1
- package/dist/zonos-elements/{p-fac20c60.system.entry.js → p-5f6f0581.system.entry.js} +1 -1
- package/dist/zonos-elements/p-6484bf31.system.js +1 -0
- package/dist/zonos-elements/{p-b2c48954.system.entry.js → p-67ff446b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-212992ec.system.entry.js → p-6c5c5377.system.entry.js} +1 -1
- package/dist/zonos-elements/p-6e81adba.system.js +1 -1
- package/dist/zonos-elements/{p-ff962844.entry.js → p-72c6bf0f.entry.js} +1 -1
- package/dist/zonos-elements/p-7575a42a.js +1 -0
- package/dist/zonos-elements/p-770e5b9e.js +1 -0
- package/dist/zonos-elements/{p-a398bc59.system.entry.js → p-7ff3a533.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-0f414d6a.system.js → p-86034f1e.system.js} +1 -1
- package/dist/zonos-elements/{p-6daa64bf.entry.js → p-925ae524.entry.js} +1 -1
- package/dist/zonos-elements/p-93dafeea.system.entry.js +1 -0
- package/dist/zonos-elements/{p-ed4d8d71.system.js → p-94bbf247.system.js} +1 -1
- package/dist/zonos-elements/p-960e4021.system.js +1 -0
- package/dist/zonos-elements/{p-a1a477c9.js → p-9a90fb56.js} +1 -1
- package/dist/zonos-elements/{p-d96f8d89.system.entry.js → p-a144d26a.system.entry.js} +1 -1
- package/dist/zonos-elements/p-ac5aecca.entry.js +1 -0
- package/dist/zonos-elements/p-c815e8b4.system.entry.js +1 -0
- package/dist/zonos-elements/p-d11b2449.js +1 -0
- package/dist/zonos-elements/{p-26aee7a0.entry.js → p-d31e5fcc.entry.js} +1 -1
- package/dist/zonos-elements/p-db1adc42.entry.js +1 -0
- package/dist/zonos-elements/{p-b0e9226a.entry.js → p-e3de496a.entry.js} +1 -1
- package/dist/zonos-elements/p-e5b5cbfd.system.entry.js +1 -0
- package/dist/zonos-elements/{p-51c32b3d.entry.js → p-f1037168.entry.js} +1 -1
- package/dist/zonos-elements/{p-2d5a6a7f.system.entry.js → p-f42bffad.system.entry.js} +1 -1
- package/dist/zonos-elements/p-fe8de89b.entry.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/cart-6cfd7560.js +0 -1
- package/dist/esm-es5/getContrastColor-a1a6f6aa.js +0 -1
- package/dist/esm-es5/submitGtag-acca574d.js +0 -1
- package/dist/zonos-elements/p-0dfd549e.system.entry.js +0 -1
- package/dist/zonos-elements/p-0f8acb62.js +0 -1
- package/dist/zonos-elements/p-2fdec8bc.system.entry.js +0 -1
- package/dist/zonos-elements/p-352ba771.system.js +0 -1
- package/dist/zonos-elements/p-4051a42d.js +0 -1
- package/dist/zonos-elements/p-5162f4cc.system.entry.js +0 -1
- package/dist/zonos-elements/p-55b8b98b.js +0 -1
- package/dist/zonos-elements/p-5a40684c.entry.js +0 -1
- package/dist/zonos-elements/p-61e08de7.system.entry.js +0 -1
- package/dist/zonos-elements/p-66cc1554.system.js +0 -1
- package/dist/zonos-elements/p-a7bfe188.entry.js +0 -1
- package/dist/zonos-elements/p-c6e44a9b.entry.js +0 -1
- package/dist/zonos-elements/p-cde25873.js +0 -1
- package/dist/zonos-elements/p-e2131057.entry.js +0 -1
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-564fe383.js');
|
|
6
|
-
const zonosStore = require('./zonosStore-
|
|
7
|
-
const cart = require('./cart-
|
|
6
|
+
const zonosStore = require('./zonosStore-bd2a0c59.js');
|
|
7
|
+
const cart = require('./cart-fcddc0e6.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
9
|
const getHasMoreSpaceOnRight = require('./getHasMoreSpaceOnRight-4c94667f.js');
|
|
10
|
-
require('./isDarkColor-
|
|
11
|
-
require('./getBorderRadius-
|
|
10
|
+
require('./isDarkColor-7faf0a82.js');
|
|
11
|
+
require('./getBorderRadius-4fa738c3.js');
|
|
12
12
|
|
|
13
13
|
var root = zonosStore._root;
|
|
14
14
|
|
|
@@ -661,6 +661,8 @@ const ZonosHello = class {
|
|
|
661
661
|
this.helloRef.setAttribute('data-zonos-hello-loaded', '');
|
|
662
662
|
this.updateHelloOnPageChange();
|
|
663
663
|
this.watchPriceChange();
|
|
664
|
+
// update theme to browser preference theme if appearance theme is system
|
|
665
|
+
this.handleAppearanceSettingsOverrideChange();
|
|
664
666
|
clearInterval(initInterval);
|
|
665
667
|
}
|
|
666
668
|
}, 100);
|
|
@@ -707,6 +709,13 @@ const ZonosHello = class {
|
|
|
707
709
|
handleResize() {
|
|
708
710
|
debounce_1(this.render.bind(this), RESIZE_DEBOUNCE_DELAY_MS);
|
|
709
711
|
}
|
|
712
|
+
handleAppearanceSettingsOverrideChange() {
|
|
713
|
+
var _a;
|
|
714
|
+
if ((_a = this.appearanceSettingsOverride) === null || _a === void 0 ? void 0 : _a.theme) {
|
|
715
|
+
// update theme to browser preference theme if appearance theme is system
|
|
716
|
+
this.appearanceSettingsOverride.theme = zonosStore.getZonosStoreTheme(this.appearanceSettingsOverride.theme);
|
|
717
|
+
}
|
|
718
|
+
}
|
|
710
719
|
render() {
|
|
711
720
|
var _a, _b;
|
|
712
721
|
const isExcludedUrl = (_a = zonosStore.zonosStore.helloSettings.excludedUrlPatterns) === null || _a === void 0 ? void 0 : _a.some(pattern => new RegExp(pattern).test(window.location.href));
|
|
@@ -746,6 +755,9 @@ const ZonosHello = class {
|
|
|
746
755
|
'zonos--hello-dialog-wrapper-mobile-override',
|
|
747
756
|
]), style: { height: this.showDialog ? 'fit-content' : '0px' } }, index.h("zonos-hello-dialog", { animateFromLeftOverride: this.animateFromLeftOverride, appearanceSettings: appearanceSettings, isOpen: this.showDialog, mobileLocationOverride: this.mobileLocationOverride, restrictedItems: restrictedItemsOnPage, setIsOpen: this.changeShowDialog }))))));
|
|
748
757
|
}
|
|
758
|
+
static get watchers() { return {
|
|
759
|
+
"appearanceSettingsOverride": ["handleAppearanceSettingsOverrideChange"]
|
|
760
|
+
}; }
|
|
749
761
|
};
|
|
750
762
|
ZonosHello.style = ZonosHelloStyle0;
|
|
751
763
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-564fe383.js');
|
|
6
|
-
const zonosStore = require('./zonosStore-
|
|
6
|
+
const zonosStore = require('./zonosStore-bd2a0c59.js');
|
|
7
7
|
const isColorVariable = require('./isColorVariable-fff5e469.js');
|
|
8
8
|
|
|
9
9
|
const zonosIconCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex}:host svg{width:var(--width);height:var(--height);fill:var(--color);color:var(--color)}";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-564fe383.js');
|
|
6
|
-
const zonosStore = require('./zonosStore-
|
|
6
|
+
const zonosStore = require('./zonosStore-bd2a0c59.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
8
|
|
|
9
9
|
const zonosLogoCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex}:host img{-webkit-filter:var(--filter-color);filter:var(--filter-color);width:var(--width)}";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-564fe383.js');
|
|
6
|
-
const zonosStore = require('./zonosStore-
|
|
6
|
+
const zonosStore = require('./zonosStore-bd2a0c59.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
8
|
|
|
9
9
|
const zonosNotificationCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--notification-items{position:fixed;z-index:9999999;bottom:var(--amino-space-24);gap:var(--amino-space-8);display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--notification-item{cursor:pointer;-webkit-transition:all 0.3s ease;transition:all 0.3s ease;padding:var(--amino-space-8);border-radius:var(--border-radius, var(--amino-radius-6));opacity:0;-ms-flex-negative:0.0001;flex-shrink:0.0001;-webkit-transform:translateY(100%);transform:translateY(100%)}:host .zonos--notification-item+:host .zonos--notification-item{margin-top:8px}:host .zonos--notification-item.show{opacity:1;-webkit-transform:translateY(0);transform:translateY(0);-ms-flex-positive:1000;flex-grow:1000}:host .zonos--notification-item.success{background-color:var(--amino-green-700)}:host .zonos--notification-item.error{background-color:var(--amino-red-700)}:host .zonos--notification-item.warning{background-color:var(--amino-orange-700)}";
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-564fe383.js');
|
|
6
|
-
const cart = require('./cart-
|
|
7
|
-
require('./zonosStore-
|
|
8
|
-
require('./isDarkColor-
|
|
9
|
-
require('./getBorderRadius-
|
|
6
|
+
const cart = require('./cart-fcddc0e6.js');
|
|
7
|
+
require('./zonosStore-bd2a0c59.js');
|
|
8
|
+
require('./isDarkColor-7faf0a82.js');
|
|
9
|
+
require('./getBorderRadius-4fa738c3.js');
|
|
10
10
|
|
|
11
11
|
const zonosPaymentCss = ".sc-zonos-payment-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-payment-h *.sc-zonos-payment{font-family:var(--font-family, Inter), Inter}.sc-zonos-payment-h img.sc-zonos-payment{max-width:100%}.sc-zonos-payment-h dl.sc-zonos-payment,.sc-zonos-payment-h dd.sc-zonos-payment,.sc-zonos-payment-h h1.sc-zonos-payment,.sc-zonos-payment-h h2.sc-zonos-payment,.sc-zonos-payment-h h3.sc-zonos-payment,.sc-zonos-payment-h h4.sc-zonos-payment,.sc-zonos-payment-h h5.sc-zonos-payment,.sc-zonos-payment-h h6.sc-zonos-payment,.sc-zonos-payment-h hr.sc-zonos-payment,.sc-zonos-payment-h figure.sc-zonos-payment,.sc-zonos-payment-h p.sc-zonos-payment,.sc-zonos-payment-h pre.sc-zonos-payment{margin:0}.sc-zonos-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-payment-h .zonos--title.sc-zonos-payment{margin-bottom:var(--amino-space-16)}";
|
|
12
12
|
const ZonosPaymentStyle0 = zonosPaymentCss;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-564fe383.js');
|
|
6
|
-
const zonosStore = require('./zonosStore-
|
|
6
|
+
const zonosStore = require('./zonosStore-bd2a0c59.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
8
|
|
|
9
9
|
const RemoveIcon = `<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" clip-rule="evenodd"/><path fill="#4D505A" fill-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" clip-rule="evenodd"/></svg>`;
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-564fe383.js');
|
|
6
|
-
const zonosStore = require('./zonosStore-
|
|
6
|
+
const zonosStore = require('./zonosStore-bd2a0c59.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
|
-
const getBorderRadius = require('./getBorderRadius-
|
|
8
|
+
const getBorderRadius = require('./getBorderRadius-4fa738c3.js');
|
|
9
9
|
const isColorVariable = require('./isColorVariable-fff5e469.js');
|
|
10
10
|
|
|
11
11
|
const zonosShippingRichRadioCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host input{margin:0;accent-color:var(--selected-border-color, var(--amino-blue-600))}:host .zonos--shipping-rich-radio-item{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;padding:var(--amino-space-16);-ms-flex-align:center;align-items:center;gap:var(--amino-space-16);cursor:pointer;border:1px solid var(--amino-gray-200)}:host .zonos--shipping-rich-radio-item:first-child{border-top-left-radius:var(--border-radius, var(--amino-radius-10));border-top-right-radius:var(--border-radius, var(--amino-radius-10))}:host .zonos--shipping-rich-radio-item:last-child{border-bottom-right-radius:var(--border-radius, var(--amino-radius-10));border-bottom-left-radius:var(--border-radius, var(--amino-radius-10))}:host .zonos--shipping-rich-radio-item:not(:last-child){border-bottom:none}:host .zonos--shipping-rich-radio-item.selected{outline:1px solid var(--selected-border-color, var(--amino-blue-600));outline-offset:-1px}:host .zonos--shipping-info{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex:1;flex:1}:host .zonos--shipping-detail{-ms-flex:1;flex:1}:host .zonos--sub-detail{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-wrap:wrap;flex-wrap:wrap}";
|
|
@@ -47,7 +47,7 @@ const ZonosShippingRichRadio = class {
|
|
|
47
47
|
}
|
|
48
48
|
render() {
|
|
49
49
|
var _a;
|
|
50
|
-
return (index.h(index.Host, { key: '
|
|
50
|
+
return (index.h(index.Host, { key: 'a1c2ace211e4d0b9d63a784028cc725bab7229e7', class: "zonos--shipping-rich-radio zonos--elements", "data-theme": this.theme, style: Object.assign(Object.assign({}, this.getRadioItemStyleVariables()), { '--font-family': zonosStore.zonosStoreFontFamily() }) }, (_a = this.items) === null || _a === void 0 ? void 0 : _a.map(item => {
|
|
51
51
|
var _a;
|
|
52
52
|
const selected = ((_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.value) === item.value;
|
|
53
53
|
return (index.h("div", { "aria-hidden": "true", class: classes.classes([
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-564fe383.js');
|
|
6
|
-
const zonosStore = require('./zonosStore-
|
|
6
|
+
const zonosStore = require('./zonosStore-bd2a0c59.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
8
|
const isColorVariable = require('./isColorVariable-fff5e469.js');
|
|
9
9
|
|
|
@@ -2833,6 +2833,17 @@ const { reset, state: zonosStore } = createStore(() => ({
|
|
|
2833
2833
|
zonosApiKey: '',
|
|
2834
2834
|
}));
|
|
2835
2835
|
let savedZonosSettings = null;
|
|
2836
|
+
/**
|
|
2837
|
+
* Get theme from media query if theme is SYSTEM, otherwise return the theme
|
|
2838
|
+
*/
|
|
2839
|
+
const getZonosStoreTheme = (theme) => {
|
|
2840
|
+
if (theme === 'SYSTEM') {
|
|
2841
|
+
return window.matchMedia('(prefers-color-scheme: dark)').matches
|
|
2842
|
+
? 'DARK'
|
|
2843
|
+
: 'LIGHT';
|
|
2844
|
+
}
|
|
2845
|
+
return theme;
|
|
2846
|
+
};
|
|
2836
2847
|
/**
|
|
2837
2848
|
* Init setting from zonos setting
|
|
2838
2849
|
*/
|
|
@@ -2843,9 +2854,15 @@ const zonosStoreInitSetting = ({ overrideSettings, zonosSettings, }) => {
|
|
|
2843
2854
|
// save zonos settings to be used later
|
|
2844
2855
|
savedZonosSettings = zonosSettings;
|
|
2845
2856
|
}
|
|
2846
|
-
|
|
2857
|
+
const mergedAppearanceConfig = mergeConfig(zonosStore.appearance, (savedZonosSettings === null || savedZonosSettings === void 0 ? void 0 : savedZonosSettings.appearanceSettings) ||
|
|
2847
2858
|
(zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.appearanceSettings) ||
|
|
2848
2859
|
null, overrideSettings === null || overrideSettings === void 0 ? void 0 : overrideSettings.appearance);
|
|
2860
|
+
// override the theme to user browser preferences if it is set to SYSTEM
|
|
2861
|
+
if (mergedAppearanceConfig.theme === 'SYSTEM') {
|
|
2862
|
+
// update theme to user browser preferences
|
|
2863
|
+
mergedAppearanceConfig.theme = getZonosStoreTheme(mergedAppearanceConfig.theme);
|
|
2864
|
+
}
|
|
2865
|
+
zonosStore.appearance = mergedAppearanceConfig;
|
|
2849
2866
|
zonosStore.checkoutSettings = mergeConfig(zonosStore.checkoutSettings, (savedZonosSettings === null || savedZonosSettings === void 0 ? void 0 : savedZonosSettings.checkoutSettings) ||
|
|
2850
2867
|
(zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.checkoutSettings) ||
|
|
2851
2868
|
null, overrideSettings === null || overrideSettings === void 0 ? void 0 : overrideSettings.checkoutSettings);
|
|
@@ -2866,6 +2883,7 @@ exports._baseGetTag = _baseGetTag;
|
|
|
2866
2883
|
exports._root = _root;
|
|
2867
2884
|
exports.commonjsGlobal = commonjsGlobal;
|
|
2868
2885
|
exports.createStore = createStore;
|
|
2886
|
+
exports.getZonosStoreTheme = getZonosStoreTheme;
|
|
2869
2887
|
exports.isObjectLike_1 = isObjectLike_1;
|
|
2870
2888
|
exports.isObject_1 = isObject_1;
|
|
2871
2889
|
exports.mergeConfig = mergeConfig;
|
|
@@ -4,6 +4,7 @@ import { stripeStore, stripeStoreReset, stripeStoreRetrievePayment, } from "../.
|
|
|
4
4
|
import { translate } from "../../../store/translationStore";
|
|
5
5
|
import { zonosStore } from "../../../store/zonosStore";
|
|
6
6
|
import { trackConversionEvent } from "../../../utils/api/trackConversionEvent";
|
|
7
|
+
import { createCustomEvent } from "../../../utils/createCustomEvent";
|
|
7
8
|
import { getBorderRadius } from "../../../utils/getBorderRadius";
|
|
8
9
|
import { handleFetch } from "../../../utils/handleFetch";
|
|
9
10
|
import { sendErrorLog } from "../../../utils/logging/sendErrorLog";
|
|
@@ -101,10 +102,8 @@ export class ZonosCheckoutFinish {
|
|
|
101
102
|
void trackConversionEvent('checkout_paymentInfoCompleted', {
|
|
102
103
|
paymentMethod,
|
|
103
104
|
});
|
|
104
|
-
const successEvent =
|
|
105
|
-
|
|
106
|
-
message: 'Zonos Checkout successfully processed order',
|
|
107
|
-
},
|
|
105
|
+
const successEvent = createCustomEvent('zonos-checkout-success', {
|
|
106
|
+
message: 'Zonos Checkout successfully processed order',
|
|
108
107
|
});
|
|
109
108
|
document.dispatchEvent(successEvent);
|
|
110
109
|
}
|
|
@@ -154,7 +153,7 @@ export class ZonosCheckoutFinish {
|
|
|
154
153
|
// const totalItems = this.order?.items?.reduce((acc, item) => {
|
|
155
154
|
// return acc + item.quantity;
|
|
156
155
|
// }, 0);
|
|
157
|
-
return (h(Host, { key: '
|
|
156
|
+
return (h(Host, { key: '8c2087b3a0578cbbd7979fff5e6b696a4325e548', class: "zonos--checkout-finish zonos--elements", style: {
|
|
158
157
|
'--border-radius': getBorderRadius(this.borderRadius),
|
|
159
158
|
} }, this.isLoading && (h("div", { class: "loading-wrapper" }, h("zonos-spinner", null))), !this.isLoading && (h(Fragment, null, h("div", { class: "zonos--group" }, this.notificationType === 'success' ? (h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), h("zonos-text", null, this.notificationMessages.map(message => (h(Fragment, null, message, h("br", null))))), h("zonos-button", { onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, translate('Keep shopping')))))));
|
|
160
159
|
}
|
|
@@ -3,12 +3,14 @@ import { cartStore, cartStoreNextStep, cartStoreReset, cartStoreUpdateItems, car
|
|
|
3
3
|
import { initStripeElements, stripeStore, stripeStoreCleanupDomesticShippingSession, stripeStoreConfirmPayment, stripeStoreInitCheckoutSession, stripeStorePrefetchLandedCost, stripeStoreReset, } from "../../store/checkout/stripe";
|
|
4
4
|
import { localizationStore } from "../../store/hello/localization";
|
|
5
5
|
import { translate } from "../../store/translationStore";
|
|
6
|
-
import { zonosStore, } from "../../store/zonosStore";
|
|
6
|
+
import { getZonosStoreTheme, zonosStore, } from "../../store/zonosStore";
|
|
7
|
+
import { buildCartItemsByTempCart } from "../../utils/api/buildCartItemsByTempCart";
|
|
7
8
|
import { trackConversionEvent } from "../../utils/api/trackConversionEvent";
|
|
8
9
|
import { isCheckoutMobile } from "../../utils/checkout/isCheckoutMobile";
|
|
9
10
|
import { isShippableCountry } from "../../utils/checkout/isShippableCountry";
|
|
10
11
|
import { watchBigcommerceDomesticCheckout } from "../../utils/checkout/watchBigcommerceDomesticCheckout";
|
|
11
12
|
import { classes } from "../../utils/classes";
|
|
13
|
+
import { createCustomEvent } from "../../utils/createCustomEvent";
|
|
12
14
|
import { getBorderRadius } from "../../utils/getBorderRadius";
|
|
13
15
|
import { isDarkColor } from "../../utils/isDarkColor";
|
|
14
16
|
import { log } from "../../utils/logging/log";
|
|
@@ -60,6 +62,8 @@ export class ZonosCheckout {
|
|
|
60
62
|
this.zonosReviewRef = undefined;
|
|
61
63
|
this.storybookPaymentStatusOverride = undefined;
|
|
62
64
|
this.domesticRedirectedBtnSelector = '#zonos--domestic-redirected-checkout-button';
|
|
65
|
+
this.legacyCheckoutHiddenBtnSelector = '#legacy-checkout-hidden-button';
|
|
66
|
+
this.isLegacyCheckout = false;
|
|
63
67
|
}
|
|
64
68
|
/**
|
|
65
69
|
* Init cart info handler event
|
|
@@ -82,7 +86,12 @@ export class ZonosCheckout {
|
|
|
82
86
|
cartStore.step = 'customer-info';
|
|
83
87
|
}
|
|
84
88
|
async buildCartAndInit() {
|
|
85
|
-
if
|
|
89
|
+
// if tempCartUUID is provided, use it instead of buildCartDetail
|
|
90
|
+
if (window.Zonos.tempCartData) {
|
|
91
|
+
const tempCartData = buildCartItemsByTempCart(window.Zonos.tempCartData);
|
|
92
|
+
await cartStoreUpdateItems(tempCartData);
|
|
93
|
+
}
|
|
94
|
+
else if (zonosStore.checkoutSettings.buildCartDetail) {
|
|
86
95
|
log('build cart detail');
|
|
87
96
|
const cartItems = await zonosStore.checkoutSettings.buildCartDetail();
|
|
88
97
|
await cartStoreUpdateItems(cartItems);
|
|
@@ -149,12 +158,18 @@ export class ZonosCheckout {
|
|
|
149
158
|
button.setAttribute('data-zonos-checkout-attached', 'true');
|
|
150
159
|
// if this button is the hidden button, trigger the click event
|
|
151
160
|
if (button.matches(this.domesticRedirectedBtnSelector)) {
|
|
152
|
-
button.dispatchEvent(
|
|
161
|
+
button.dispatchEvent(createCustomEvent('click'));
|
|
153
162
|
// cleanup shipping session after button is clicked
|
|
154
163
|
stripeStoreCleanupDomesticShippingSession();
|
|
155
164
|
// remove the button after it's clicked
|
|
156
165
|
button.remove();
|
|
157
166
|
}
|
|
167
|
+
if (button.matches(this.legacyCheckoutHiddenBtnSelector)) {
|
|
168
|
+
this.isLegacyCheckout = true;
|
|
169
|
+
// trigger the click event on the button
|
|
170
|
+
button.dispatchEvent(createCustomEvent('click'));
|
|
171
|
+
button.remove();
|
|
172
|
+
}
|
|
158
173
|
});
|
|
159
174
|
}
|
|
160
175
|
appearanceSettingsOverrideChanged() {
|
|
@@ -164,6 +179,45 @@ export class ZonosCheckout {
|
|
|
164
179
|
// apply theme to stripe elements
|
|
165
180
|
void this.applyStripeTheme();
|
|
166
181
|
}
|
|
182
|
+
/**
|
|
183
|
+
* Set default address from query param if it's valid
|
|
184
|
+
*/
|
|
185
|
+
useLegacyQueryParam() {
|
|
186
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
187
|
+
const legacyShippingInfo = {
|
|
188
|
+
country: urlParams.get('country'),
|
|
189
|
+
customerAddress1: urlParams.get('customerAddress1'),
|
|
190
|
+
customerAddress2: urlParams.get('customerAddress2'),
|
|
191
|
+
customerCity: urlParams.get('customerCity'),
|
|
192
|
+
customerEmail: urlParams.get('customerEmail'),
|
|
193
|
+
customerName: urlParams.get('customerName'),
|
|
194
|
+
customerPhone: urlParams.get('customerPhone'),
|
|
195
|
+
customerState: urlParams.get('customerState'),
|
|
196
|
+
customerZip: urlParams.get('customerZip'),
|
|
197
|
+
};
|
|
198
|
+
// if one of the value is null, no need to preset the default address
|
|
199
|
+
if (!legacyShippingInfo.customerAddress1 ||
|
|
200
|
+
!legacyShippingInfo.customerCity ||
|
|
201
|
+
!legacyShippingInfo.customerName ||
|
|
202
|
+
!legacyShippingInfo.customerPhone ||
|
|
203
|
+
!legacyShippingInfo.customerState ||
|
|
204
|
+
!legacyShippingInfo.customerZip ||
|
|
205
|
+
!legacyShippingInfo.country) {
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
this.defaultAddress = {
|
|
209
|
+
address: {
|
|
210
|
+
city: legacyShippingInfo.customerCity,
|
|
211
|
+
country: legacyShippingInfo.country,
|
|
212
|
+
line1: legacyShippingInfo.customerAddress1,
|
|
213
|
+
line2: legacyShippingInfo.customerAddress2 || '',
|
|
214
|
+
postal_code: legacyShippingInfo.customerZip,
|
|
215
|
+
state: legacyShippingInfo.customerState,
|
|
216
|
+
},
|
|
217
|
+
name: legacyShippingInfo.customerName,
|
|
218
|
+
phone: legacyShippingInfo.customerPhone,
|
|
219
|
+
};
|
|
220
|
+
}
|
|
167
221
|
/**
|
|
168
222
|
* Setup all of the event listeners for the component on first load
|
|
169
223
|
*/
|
|
@@ -189,6 +243,12 @@ export class ZonosCheckout {
|
|
|
189
243
|
};
|
|
190
244
|
},
|
|
191
245
|
});
|
|
246
|
+
/**
|
|
247
|
+
* When temp cart data is available, set default address if exist
|
|
248
|
+
*/
|
|
249
|
+
if (window.Zonos.tempCartData) {
|
|
250
|
+
this.useLegacyQueryParam();
|
|
251
|
+
}
|
|
192
252
|
const hideInternationalOrderInterval = setInterval(() => {
|
|
193
253
|
const internationalSelector = window.Zonos.internationalHideSelector;
|
|
194
254
|
if (!internationalSelector) {
|
|
@@ -307,6 +367,12 @@ export class ZonosCheckout {
|
|
|
307
367
|
}
|
|
308
368
|
// reset cart store
|
|
309
369
|
cartStoreReset();
|
|
370
|
+
// redirect to vendor store url if this is legacy checkout.
|
|
371
|
+
if (this.isLegacyCheckout && window.Zonos.tempCartData) {
|
|
372
|
+
const contShoppingUrl = window.Zonos.tempCartData.contShoppingURL;
|
|
373
|
+
window.location.href = contShoppingUrl;
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
310
376
|
// reset url
|
|
311
377
|
const url = window.location.href;
|
|
312
378
|
// Remove query parameters
|
|
@@ -329,9 +395,18 @@ export class ZonosCheckout {
|
|
|
329
395
|
void this.applyStripeTheme();
|
|
330
396
|
log(`mobile: ${this.isMobile}`);
|
|
331
397
|
}
|
|
398
|
+
handleAppearanceSettingsOverrideChange() {
|
|
399
|
+
var _a;
|
|
400
|
+
if ((_a = this.appearanceSettingsOverride) === null || _a === void 0 ? void 0 : _a.theme) {
|
|
401
|
+
// update theme to browser preference theme if appearance theme is system
|
|
402
|
+
this.appearanceSettingsOverride.theme = getZonosStoreTheme(this.appearanceSettingsOverride.theme);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
332
405
|
componentWillLoad() {
|
|
333
406
|
void this.init();
|
|
334
407
|
this.isMobile = isCheckoutMobile(this.mobile);
|
|
408
|
+
// update theme to browser preference theme if appearance theme is system
|
|
409
|
+
this.handleAppearanceSettingsOverrideChange();
|
|
335
410
|
log(`mobile: ${this.isMobile}`);
|
|
336
411
|
}
|
|
337
412
|
// do clean up when component is unmounted
|
|
@@ -364,15 +439,17 @@ export class ZonosCheckout {
|
|
|
364
439
|
const localePageEnum = this.getCurrentLocalePageEnum();
|
|
365
440
|
const filteredMessages = customMessages.filter(x => x.pageName === localePageEnum);
|
|
366
441
|
const renderLogo = () => (h("div", { class: "zonos--logo" }, logoUrl && (h("img", { alt: `${zonosStore.organizationName} logo`, src: logoUrl, width: 100 }))));
|
|
367
|
-
const renderTopHeader = () =>
|
|
368
|
-
|
|
369
|
-
|
|
442
|
+
const renderTopHeader = () => {
|
|
443
|
+
return (h("zonos-v-stack", null, renderLogo(), h("zonos-checkout-progress-tabs", { backgroundColor:
|
|
444
|
+
// only use different contrast color when the secondary color is too off with the background in mobile
|
|
445
|
+
this.isMobile ? '--amino-gray-0' : null }), filteredMessages.map(x => (h("zonos-custom-message", { icon: MessageIcon, message: x.message })))));
|
|
446
|
+
};
|
|
370
447
|
const renderContent = () => {
|
|
371
448
|
return (h("div", { class: 'zonos--content', style: {
|
|
372
449
|
'--border-radius': getBorderRadius(style),
|
|
373
450
|
} }, cartStore.step !== 'finish' && cartStore.step !== 'error' && (h(Fragment, null, h("div", { class: "zonos--left", "data-theme": leftSideTheme, style: {
|
|
374
451
|
'--primary-color': !this.isMobile ? colorPrimary : '',
|
|
375
|
-
} }, !this.isMobile && renderTopHeader(), cartStore.step === 'customer-info' && (h("zonos-customer-info", { continueLoading: this.submitLoading, defaultAddress: this.defaultAddress, onContinueClicked: () => this.handleCustomerInfoContinue(), submitBtnColor: submitButtonColor })), cartStore.step === 'shipping' && (h("zonos-shipping", { continueLoading: this.submitLoading, onContinueClicked: () => this.handleShippingContinue(), submitBtnColor: submitButtonColor })), cartStore.step === 'payment' && (h("zonos-checkout-payment", { continueLoading: this.submitLoading, onContinueClicked: () => this.handleCheckoutPaymentContinue(), paymentError: this.paymentError, submitBtnColor: submitButtonColor }))), h("div", { class: "zonos--right", "data-theme": rightSideTheme }, this.isMobile && renderTopHeader(), h("zonos-button", { class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close checkout dialog", content: RemoveIcon }), noBackground: true, onClick: () => this.closeDialogHandler() }), h("div", { class: "flex--wrapper" }, h("div", { class: "zonos--wrapper" }, h("zonos-review", { collapsed: this.collapseReviewMobile, mobile: this.isMobile, onClick: () => {
|
|
452
|
+
} }, !this.isMobile && renderTopHeader(), cartStore.step === 'customer-info' && (h("zonos-customer-info", { continueLoading: this.submitLoading, defaultAddress: this.defaultAddress, onContinueClicked: () => this.handleCustomerInfoContinue(), submitBtnColor: submitButtonColor })), cartStore.step === 'shipping' && (h("zonos-shipping", { continueLoading: this.submitLoading, onContinueClicked: () => this.handleShippingContinue(), submitBtnColor: submitButtonColor })), cartStore.step === 'payment' && (h("zonos-checkout-payment", { continueLoading: this.submitLoading, onContinueClicked: () => this.handleCheckoutPaymentContinue(), paymentError: this.paymentError, submitBtnColor: submitButtonColor }))), h("div", { class: "zonos--right", "data-theme": rightSideTheme }, this.isMobile && renderTopHeader(), !this.isLegacyCheckout && (h("zonos-button", { class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close checkout dialog", content: RemoveIcon }), noBackground: true, onClick: () => this.closeDialogHandler() })), h("div", { class: "flex--wrapper" }, h("div", { class: "zonos--wrapper" }, h("zonos-review", { collapsed: this.collapseReviewMobile, mobile: this.isMobile, onClick: () => {
|
|
376
453
|
// do nothing if it's not mobile
|
|
377
454
|
if (!this.isMobile) {
|
|
378
455
|
return;
|
|
@@ -395,7 +472,7 @@ export class ZonosCheckout {
|
|
|
395
472
|
hasFooter && 'has-footer',
|
|
396
473
|
this.preview && 'preview',
|
|
397
474
|
this.isMobile && 'mobile',
|
|
398
|
-
]) }, this.preview ? (renderContent()) : (h("zonos-dialog", { borderStyle: style,
|
|
475
|
+
]) }, this.preview ? (renderContent()) : (h("zonos-dialog", { borderStyle: style, height: "980px", isLoading: dialogLoading, mobile: this.isMobile, noBodyPadding: true, noBorder: true, noClickOutside: true, noCloseButton: true, onCloseDialog: () => this.closeDialogHandler(), open: this.open, width: "1200px" }, renderContent()))));
|
|
399
476
|
}
|
|
400
477
|
static get is() { return "zonos-checkout"; }
|
|
401
478
|
static get encapsulation() { return "scoped"; }
|
|
@@ -526,7 +603,9 @@ export class ZonosCheckout {
|
|
|
526
603
|
"isMobile": {},
|
|
527
604
|
"zonosReviewRef": {},
|
|
528
605
|
"storybookPaymentStatusOverride": {},
|
|
529
|
-
"domesticRedirectedBtnSelector": {}
|
|
606
|
+
"domesticRedirectedBtnSelector": {},
|
|
607
|
+
"legacyCheckoutHiddenBtnSelector": {},
|
|
608
|
+
"isLegacyCheckout": {}
|
|
530
609
|
};
|
|
531
610
|
}
|
|
532
611
|
static get methods() {
|
|
@@ -604,6 +683,9 @@ export class ZonosCheckout {
|
|
|
604
683
|
}, {
|
|
605
684
|
"propName": "mobile",
|
|
606
685
|
"methodName": "handleMobileChange"
|
|
686
|
+
}, {
|
|
687
|
+
"propName": "appearanceSettingsOverride",
|
|
688
|
+
"methodName": "handleAppearanceSettingsOverrideChange"
|
|
607
689
|
}];
|
|
608
690
|
}
|
|
609
691
|
static get listeners() {
|
|
@@ -85,7 +85,7 @@ export class ZonosShipping {
|
|
|
85
85
|
}
|
|
86
86
|
render() {
|
|
87
87
|
var _a, _b;
|
|
88
|
-
return (h(Host, { key: 'ab881bdb575ac0177154ffa8a2d84d668151c46d', class: "zonos--shipping zonos--elements" }, h("div", { key: 'b8738e0fb5c32b329ae03ccd2cb2d1a178a05aa8', class: "zonos--group" }, h("zonos-text", { key: 'd942ab3f4e77631145a0a38dae95999454a92b56', class: "zonos--title", type: "semiBoldSubheader" }, translate('Shipping information')), h("zonos-text", { key: '6855f44cf3458891776b3c215417bec329de89dc', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, translate('Shipping method')), !((_a = this.serviceLevels) === null || _a === void 0 ? void 0 : _a.length) ? (h("zonos-banner", { bannerTitle:
|
|
88
|
+
return (h(Host, { key: 'ab881bdb575ac0177154ffa8a2d84d668151c46d', class: "zonos--shipping zonos--elements" }, h("div", { key: 'b8738e0fb5c32b329ae03ccd2cb2d1a178a05aa8', class: "zonos--group" }, h("zonos-text", { key: 'd942ab3f4e77631145a0a38dae95999454a92b56', class: "zonos--title", type: "semiBoldSubheader" }, translate('Shipping information')), h("zonos-text", { key: '6855f44cf3458891776b3c215417bec329de89dc', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, translate('Shipping method')), !((_a = this.serviceLevels) === null || _a === void 0 ? void 0 : _a.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.'), intent: "error" })) : (h("zonos-shipping-rich-radio", { initialSelectedValue: (_b = this.selectedShippingMethod) === null || _b === void 0 ? void 0 : _b.value, items: this.serviceLevels, onRadioSelected: e => this.handleRadioSelected(e) })), h("div", { key: 'f6398edeecd18c603680ad6c7c8e1aa5f5cebe4a', class: "zonos--group-btn" }, h("zonos-button", { key: 'a548fb385ed341308ff86e615d9088e7cd4ec34d', backgroundColor: this.submitBtnColor, isDisabled: this.disabled, loading: this.continueLoading || this.isSelecting, onClick: () => this.continueClickHandler(), size: "lg",
|
|
89
89
|
// use primary type when on mobile mode
|
|
90
90
|
variant: this.submitBtnType }, translate('Go to payment'))))));
|
|
91
91
|
}
|
|
@@ -60,7 +60,7 @@ export class ZonosButton {
|
|
|
60
60
|
// only set theme for button to change text color if variant is standard and override background is set
|
|
61
61
|
const buttonTheme = variant === 'standard' ? getButtonTheme(overrideBackground) : undefined;
|
|
62
62
|
const borderStyle = getBorderRadius(this.borderStyle);
|
|
63
|
-
const spinnerColor = buttonTheme === 'LIGHT' ? '
|
|
63
|
+
const spinnerColor = buttonTheme === 'LIGHT' ? 'white' : 'black';
|
|
64
64
|
return (h(Host, { key: '75f5e6900c6e0eb468ea639460d55f251b580200', class: classes(['zonos--elements']), "data-theme": this.theme || buttonTheme, disabled: disabled, style: styles({
|
|
65
65
|
'--background-color': overrideBackground,
|
|
66
66
|
'--border-radius': borderStyle,
|
|
@@ -27,14 +27,14 @@ export class ZonosCheckbox {
|
|
|
27
27
|
? 'var(--amino-gray-800)'
|
|
28
28
|
: 'var(--amino-gray-0)';
|
|
29
29
|
const borderStyle = getBorderRadius(this.borderStyle, '4px');
|
|
30
|
-
return (h(Host, { key: '
|
|
30
|
+
return (h(Host, { key: '2ae2a0d33d34aafe96cc91e1cd7c7ee530dede4b', class: classes(['zonos--elements zonos--checkbox']), style: {
|
|
31
31
|
'--background-color': backgroundColor,
|
|
32
32
|
'--border-radius': borderStyle,
|
|
33
33
|
'--font-family': zonosStoreFontFamily(),
|
|
34
34
|
'--size': `${this.size}px`,
|
|
35
|
-
} }, h("label", { key: '
|
|
35
|
+
} }, h("label", { key: 'b9630027581a9f20374c2dfe88faa94cb50203c9', class: classes([this.isDisabled && 'disabled']) }, h("input", { key: 'd1b2411d9f906692f18514a15df1bb290f662164', checked: this.isChecked, disabled: this.isDisabled, hidden: true, onChange: e => {
|
|
36
36
|
this.checkboxSelected.emit(e.target.checked);
|
|
37
|
-
}, type: "checkbox" }), h("span", { key: '
|
|
37
|
+
}, type: "checkbox" }), h("span", { key: '8fc3cda232615f446aff5db71cd992de5327b8e7', class: "checkmark-container" }, h("svg", { key: '5b91a7a26abfd80850eb3c2bb2e045ef73abfd7a', class: "checkmark", color: checkmarkColor, fill: "none", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '2046a40a75da63ac288c5def90d82ab0d0e0523c', "clip-rule": "evenodd", d: "M17.456 7.404a.75.75 0 0 1 .14 1.052l-6.5 8.5a.75.75 0 0 1-1.126.074l-4-4a.75.75 0 0 1 1.06-1.06l3.395 3.394 5.98-7.82a.75.75 0 0 1 1.05-.14Z", fill: "currentColor", "fill-rule": "evenodd" }))), this.label && (h("zonos-text", { size: this.fontSize }, this.label)))));
|
|
38
38
|
}
|
|
39
39
|
static get is() { return "zonos-checkbox"; }
|
|
40
40
|
static get encapsulation() { return "shadow"; }
|
|
@@ -178,8 +178,8 @@ export class ZonosCheckbox {
|
|
|
178
178
|
"references": {
|
|
179
179
|
"ElementsUiStyle": {
|
|
180
180
|
"location": "import",
|
|
181
|
-
"path": "src/types",
|
|
182
|
-
"id": "src/types/
|
|
181
|
+
"path": "src/types/generated/graphql.customer.types",
|
|
182
|
+
"id": "src/types/generated/graphql.customer.types.ts::ElementsUiStyle"
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
},
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
import { cartStore, } from "../../store/checkout/cart";
|
|
3
|
+
import { translate } from "../../store/translationStore";
|
|
3
4
|
import { zonosStore } from "../../store/zonosStore";
|
|
4
5
|
import { classes } from "../../utils/classes";
|
|
5
6
|
import { getContrastColor } from "../../utils/getContrastColor";
|
|
@@ -62,17 +63,17 @@ export class ZonosCheckoutProgressTabs {
|
|
|
62
63
|
color: labelSelectedColor,
|
|
63
64
|
})
|
|
64
65
|
: labelSelectedColor;
|
|
65
|
-
return (h(Host, { key: '
|
|
66
|
+
return (h(Host, { key: 'e79dc4967096d3b6f0ac25d58f02e77f773c8e95', class: "zonos--elements", style: {
|
|
66
67
|
'--color': contrastLabelColor,
|
|
67
68
|
'--progress-percent': this.getTotalSuccessStep(),
|
|
68
|
-
} }, h("div", { key: '
|
|
69
|
+
} }, h("div", { key: '20e500d31c28ee0705c1999e0f258b679af9d73a', class: "zonos--tab-wrapper" }, Object.values(cartStore.tabItems).map((tab, index) => {
|
|
69
70
|
const isSelected = tab.value === selectedStep;
|
|
70
71
|
return (h("button", { class: classes([
|
|
71
72
|
'zonos--tab-item',
|
|
72
73
|
tab.value === selectedStep && 'selected',
|
|
73
74
|
tab.isDone && 'done',
|
|
74
|
-
]), disabled: !this.isTabClickable(tab.value), key: tab.value, onClick: () => (cartStore.step = tab.value) }, h("div", { class: "zonos--tab-index" }, h("zonos-text", { class: "zonos--tab-index-label", textColor: isSelected ? contrastLabelColor : 'gray-1200', type: "label" }, index + 1), h("zonos-icon", { class: "zonos--tab-index-done-icon", content: TabCheckmark, iconColor: isSelected ? contrastLabelColor : 'gray-1200' })), h("zonos-text", { textColor: isSelected ? contrastLabelColor : 'gray-1200', type: "label" }, tab.label)));
|
|
75
|
-
})), h("div", { key: '
|
|
75
|
+
]), disabled: !this.isTabClickable(tab.value), key: tab.value, onClick: () => (cartStore.step = tab.value) }, h("div", { class: "zonos--tab-index" }, h("zonos-text", { class: "zonos--tab-index-label", textColor: isSelected ? contrastLabelColor : 'gray-1200', type: "label" }, index + 1), h("zonos-icon", { class: "zonos--tab-index-done-icon", content: TabCheckmark, iconColor: isSelected ? contrastLabelColor : 'gray-1200' })), h("zonos-text", { textColor: isSelected ? contrastLabelColor : 'gray-1200', type: "label" }, translate(tab.label))));
|
|
76
|
+
})), h("div", { key: '129502b873f339192ef5f4c67ac8c06d533ccfca', class: "zonos--tab-progress" }, h("div", { key: '728a074d6a411b400be30929bf9a5fdc8431745d', class: "zonos--progress-bar-fill" }))));
|
|
76
77
|
}
|
|
77
78
|
static get is() { return "zonos-checkout-progress-tabs"; }
|
|
78
79
|
static get encapsulation() { return "shadow"; }
|
|
@@ -47,7 +47,7 @@ export class ZonosDialog {
|
|
|
47
47
|
document.body.style.overflow = 'auto';
|
|
48
48
|
}
|
|
49
49
|
const borderStyle = getBorderRadius(this.borderStyle);
|
|
50
|
-
return (h(Host, { key: '
|
|
50
|
+
return (h(Host, { key: 'f0aee4766d2c62f3f4feff18c99dba62ea97ca06', class: classes([
|
|
51
51
|
'zonos--elements',
|
|
52
52
|
this.open && 'open',
|
|
53
53
|
this.isLoading && 'is-loading',
|
|
@@ -58,10 +58,10 @@ export class ZonosDialog {
|
|
|
58
58
|
'--font-family': zonosStoreFontFamily(),
|
|
59
59
|
'--height': this.height || 'initial',
|
|
60
60
|
'--width': this.width,
|
|
61
|
-
} }, h("div", { key: '
|
|
61
|
+
} }, h("div", { key: '42e8afd7ddc94ab9ec4951f4221e32729256694e', class: "zonos--backdrop" }), h("div", { key: '035c21c65ae5cabc12b41b6ad1684fa4dbc5b92e', "aria-hidden": "true", class: "zonos--dialog-layout", onClick: this.clickOutsideDialogHandler }, h("div", { key: 'b9a3299c9fb920f9af5783506b0489122b2eae11', class: "zonos--dialog" }, this.isLoading && (h("div", { class: "zonos--loading" }, h("zonos-spinner", { size: 30 }))), (this.headerText || !this.noCloseButton) && (h("div", { class: "zonos--header" }, this.headerText && (h("h3", { class: "zonos--header-text" }, this.headerText)), !this.noCloseButton && (h("zonos-button", { class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close dialog", content: RemoveIcon }), noBackground: true, onClick: this.closeButtonHandler })))), h("div", { key: 'f5e5a75782ca6acd4a2c004756b800f3c2558129', class: classes([
|
|
62
62
|
'zonos--body',
|
|
63
63
|
this.noBodyPadding && 'zonos--no-body-padding',
|
|
64
|
-
]) }, h("slot", { key: '
|
|
64
|
+
]) }, h("slot", { key: '3fe4ec47852e99f1dc5b6a7a84a8b918594b8b7f' })), h("slot", { key: '5515f4109274b178249c05c6e6c91fdc30ce528a', name: "dialog-footer" })))));
|
|
65
65
|
}
|
|
66
66
|
static get is() { return "zonos-dialog"; }
|
|
67
67
|
static get encapsulation() { return "shadow"; }
|
|
@@ -227,8 +227,8 @@ export class ZonosDialog {
|
|
|
227
227
|
"references": {
|
|
228
228
|
"ElementsUiStyle": {
|
|
229
229
|
"location": "import",
|
|
230
|
-
"path": "src/types",
|
|
231
|
-
"id": "src/types/
|
|
230
|
+
"path": "src/types/generated/graphql.customer.types",
|
|
231
|
+
"id": "src/types/generated/graphql.customer.types.ts::ElementsUiStyle"
|
|
232
232
|
}
|
|
233
233
|
}
|
|
234
234
|
},
|