@zonos/elements 1.3.7-alpha.0 → 1.3.7
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-ecc80eb0.js → cart-eee85bda.js} +145 -100
- package/dist/cjs/formatStringWithLinks-52341fc7.js +17 -0
- package/dist/cjs/{getBorderRadius-834c321d.js → getBorderRadius-d8f18958.js} +1 -1
- package/dist/cjs/{isDarkColor-924e6a7a.js → isDarkColor-57860b44.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/submitGtag-a2e1f652.js +55 -0
- package/dist/cjs/zonos-address_4.cjs.entry.js +21 -16
- package/dist/cjs/zonos-badge_2.cjs.entry.js +6 -6
- package/dist/cjs/zonos-banner.cjs.entry.js +1 -1
- package/dist/cjs/zonos-button_3.cjs.entry.js +8 -8
- package/dist/cjs/zonos-card_2.cjs.entry.js +8 -8
- package/dist/cjs/zonos-cart-items_9.cjs.entry.js +35 -33
- package/dist/cjs/zonos-checkout.cjs.entry.js +159 -23
- package/dist/cjs/zonos-component.cjs.entry.js +1 -1
- package/dist/cjs/zonos-controller.cjs.entry.js +28 -9
- package/dist/cjs/zonos-country-flag.cjs.entry.js +4 -4
- package/dist/cjs/zonos-country-select_3.cjs.entry.js +18 -10
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +9 -7
- package/dist/cjs/zonos-hello.cjs.entry.js +25 -11
- package/dist/cjs/zonos-link.cjs.entry.js +24 -0
- package/dist/cjs/zonos-logo.cjs.entry.js +3 -3
- package/dist/cjs/zonos-notification.cjs.entry.js +1 -1
- package/dist/cjs/zonos-payment.cjs.entry.js +6 -7
- package/dist/cjs/zonos-select-dialog-header_2.cjs.entry.js +5 -5
- 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-49d4c92a.js → zonosStore-138c5555.js} +5 -3
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +1 -6
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +19 -10
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.css +3 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +41 -20
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.css +3 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +2 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-review/zonos-review.js +1 -6
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.css +3 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +5 -0
- package/dist/collection/components/common/component-template/zonos-link/zonos-link.css +54 -0
- package/dist/collection/components/common/component-template/zonos-link/zonos-link.js +97 -0
- package/dist/collection/components/common/zonos-badge/zonos-badge.js +3 -3
- package/dist/collection/components/common/zonos-button/zonos-button.css +2 -0
- package/dist/collection/components/common/zonos-button/zonos-button.js +4 -4
- package/dist/collection/components/common/zonos-card/zonos-card.js +2 -2
- package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +3 -3
- package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +13 -6
- package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +8 -2
- package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +4 -2
- package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +3 -3
- package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +2 -2
- package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -2
- package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +2 -2
- package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js +1 -1
- package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
- package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -2
- package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
- package/dist/collection/components/hello/zonos-hello/zonos-hello.js +52 -13
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +2 -2
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +5 -3
- package/dist/collection/components/main/zonos-controller.js +1 -2
- package/dist/collection/components/store/checkout/cart.js +2 -2
- package/dist/collection/components/store/checkout/stripe.js +26 -4
- package/dist/collection/components/store/hello/localization.js +7 -6
- package/dist/collection/components/store/zonosStore.js +5 -3
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +1 -1
- package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +3 -3
- package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +3 -3
- package/dist/collection/components/utils/api/getLocaleMessages.js +2 -2
- package/dist/collection/components/utils/api/trackConversionEvent.js +22 -0
- package/dist/collection/components/utils/checkout/isShippableCountry.js +15 -0
- package/dist/collection/components/utils/checkout/watchBigcommerceDomesticCheckout.js +111 -0
- package/dist/collection/components/utils/formatStringWithLinks.js +13 -0
- package/dist/collection/components/utils/handleFetch.js +1 -1
- package/dist/collection/components/utils/hello/currencyConversion/defaultCurrencyConverter.js +25 -28
- package/dist/collection/components/utils/hello/currencyConversion/getCurrencyElements.js +2 -3
- package/dist/collection/components/utils/hello/currencyConversion/getInitialElementAmount.js +8 -6
- package/dist/collection/components/utils/hello/initHello.js +23 -3
- package/dist/collection/components/utils/logging/log.js +19 -14
- package/dist/collection/components/utils/logging/logError.js +2 -2
- package/dist/collection/components/utils/logging/sendErrorLog.js +12 -0
- package/dist/collection/scripts/checkIfLoadVersionDomain.js +35 -0
- package/dist/collection/scripts/zonosBase.js +21 -34
- package/dist/collection/styles/stripe/addressRuleStyle.js +4 -0
- package/dist/collection/types/generated/graphql.customer.types.js +1 -4
- package/dist/collection/types/generated/graphql.frontend.types.js +3 -0
- package/dist/components/stripe.js +140 -98
- package/dist/components/trackConversionEvent.js +24 -0
- package/dist/components/zonos-address2.js +1 -1
- package/dist/components/zonos-badge2.js +3 -3
- package/dist/components/zonos-button2.js +5 -5
- package/dist/components/zonos-card2.js +2 -2
- package/dist/components/zonos-cart-subtotal2.js +1 -6
- package/dist/components/zonos-checkbox2.js +3 -3
- package/dist/components/zonos-checkout-finish2.js +32 -12
- package/dist/components/zonos-checkout-payment2.js +1 -1
- package/dist/components/zonos-checkout.js +158 -20
- package/dist/components/zonos-collapse2.js +13 -6
- package/dist/components/zonos-component.js +1 -1
- package/dist/components/zonos-controller.js +25 -6
- package/dist/components/zonos-country-select2.js +9 -3
- package/dist/components/zonos-custom-message2.js +18 -3
- package/dist/components/zonos-customer-info2.js +3 -1
- package/dist/components/zonos-dialog2.js +3 -3
- package/dist/components/zonos-hello-dialog-footer2.js +2 -2
- package/dist/components/zonos-hello-dialog2.js +6 -5
- package/dist/components/zonos-hello.js +24 -9
- package/dist/components/zonos-language-select2.js +3 -3
- package/dist/components/zonos-link-authentication2.js +3 -4
- package/dist/components/zonos-link.d.ts +11 -0
- package/dist/components/zonos-link.js +43 -0
- package/dist/components/zonos-logo.js +2 -2
- package/dist/components/zonos-payment2.js +3 -4
- package/dist/components/zonos-review2.js +1 -6
- package/dist/components/zonos-select-dialog-header2.js +2 -2
- package/dist/components/zonos-shipping-rich-radio2.js +1 -1
- package/dist/components/zonos-shipping2.js +7 -2
- package/dist/components/zonos-tooltip2.js +2 -2
- package/dist/components/zonos-v-stack2.js +2 -2
- package/dist/components/zonosStore.js +5 -3
- package/dist/esm/{cart-2a0a6871.js → cart-e261efc1.js} +143 -101
- package/dist/esm/formatStringWithLinks-9e819405.js +15 -0
- package/dist/esm/{getBorderRadius-0c7dfcf0.js → getBorderRadius-19787feb.js} +1 -1
- package/dist/esm/{isDarkColor-d0a57fd2.js → isDarkColor-2344e7a5.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/submitGtag-dfc6f1dc.js +51 -0
- package/dist/esm/zonos-address_4.entry.js +21 -16
- package/dist/esm/zonos-badge_2.entry.js +6 -6
- package/dist/esm/zonos-banner.entry.js +1 -1
- package/dist/esm/zonos-button_3.entry.js +8 -8
- package/dist/esm/zonos-card_2.entry.js +8 -8
- package/dist/esm/zonos-cart-items_9.entry.js +35 -33
- package/dist/esm/zonos-checkout.entry.js +159 -23
- package/dist/esm/zonos-component.entry.js +1 -1
- package/dist/esm/zonos-controller.entry.js +28 -9
- package/dist/esm/zonos-country-flag.entry.js +4 -4
- package/dist/esm/zonos-country-select_3.entry.js +19 -11
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +9 -7
- package/dist/esm/zonos-hello.entry.js +25 -11
- package/dist/esm/zonos-link.entry.js +20 -0
- package/dist/esm/zonos-logo.entry.js +3 -3
- package/dist/esm/zonos-notification.entry.js +1 -1
- package/dist/esm/zonos-payment.entry.js +6 -7
- package/dist/esm/zonos-select-dialog-header_2.entry.js +5 -5
- package/dist/esm/zonos-shipping-rich-radio.entry.js +3 -3
- package/dist/esm/zonos-text.entry.js +1 -1
- package/dist/esm/{zonosStore-dec6bd7e.js → zonosStore-00bce01b.js} +5 -3
- package/dist/esm-es5/{cart-2a0a6871.js → cart-e261efc1.js} +1 -1
- package/dist/esm-es5/formatStringWithLinks-9e819405.js +1 -0
- package/dist/esm-es5/{getBorderRadius-0c7dfcf0.js → getBorderRadius-19787feb.js} +1 -1
- package/dist/esm-es5/{isDarkColor-d0a57fd2.js → isDarkColor-2344e7a5.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/submitGtag-dfc6f1dc.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_3.entry.js +1 -1
- package/dist/esm-es5/zonos-card_2.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_9.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-component.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-link.entry.js +1 -0
- 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-dec6bd7e.js → zonosStore-00bce01b.js} +1 -1
- package/dist/scripts/checkIfLoadVersionDomain.js +1 -0
- package/dist/scripts/loadStripe.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/stripe.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 +1 -1
- package/dist/types/components/common/component-template/zonos-link/zonos-link.d.ts +19 -0
- package/dist/types/components/common/zonos-collapse/zonos-collapse.d.ts +1 -0
- package/dist/types/components/common/zonos-country-select/zonos-country-select.d.ts +2 -0
- package/dist/types/components/hello/zonos-hello/zonos-hello.d.ts +9 -3
- package/dist/types/components/store/checkout/cart.d.ts +6 -3
- package/dist/types/components/store/checkout/stripe.d.ts +22 -1
- package/dist/types/components/store/hello/localization.d.ts +2 -3
- package/dist/types/components/store/zonosStore.d.ts +1 -0
- package/dist/types/components/utils/api/trackConversionEvent.d.ts +3 -0
- package/dist/types/components/utils/checkout/isShippableCountry.d.ts +1 -0
- package/dist/types/components/utils/checkout/watchBigcommerceDomesticCheckout.d.ts +20 -0
- package/dist/types/components/utils/formatStringWithLinks.d.ts +1 -0
- package/dist/types/components/utils/hello/currencyConversion/getCurrencyElements.d.ts +1 -1
- package/dist/types/components/utils/logging/log.d.ts +1 -1
- package/dist/types/components/utils/logging/sendErrorLog.d.ts +7 -0
- package/dist/types/components.d.ts +53 -3
- package/dist/types/scripts/checkIfLoadVersionDomain.d.ts +13 -0
- package/dist/types/scripts/zonosBase.d.ts +2 -0
- package/dist/types/types/checkout/CheckoutConfig.d.ts +1 -1
- package/dist/types/types/generated/graphql.customer.types.d.ts +8 -53
- package/dist/types/types/generated/graphql.customer.types.ts +18 -62
- package/dist/types/types/generated/graphql.frontend.types.d.ts +8 -0
- package/dist/types/types/generated/graphql.frontend.types.ts +18 -0
- package/dist/zonos-elements/p-066c5893.system.js +1 -1
- package/dist/zonos-elements/p-07966463.entry.js +1 -0
- package/dist/zonos-elements/p-0c0aa552.js +1 -0
- package/dist/zonos-elements/{p-dfd3edcf.entry.js → p-0c91720b.entry.js} +1 -1
- package/dist/zonos-elements/p-1119dddf.system.entry.js +1 -0
- package/dist/zonos-elements/p-127b480c.entry.js +1 -0
- package/dist/zonos-elements/{p-e855966f.system.entry.js → p-143dc0d9.system.entry.js} +1 -1
- package/dist/zonos-elements/p-14c3ef38.entry.js +1 -0
- package/dist/zonos-elements/{p-55970b10.system.entry.js → p-14d27ce1.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-7d1d862f.system.entry.js → p-165d469e.system.entry.js} +1 -1
- package/dist/zonos-elements/p-17e87be1.entry.js +1 -0
- package/dist/zonos-elements/{p-a95c034c.entry.js → p-1e0dd491.entry.js} +1 -1
- package/dist/zonos-elements/{p-34efed1d.entry.js → p-279d1c5f.entry.js} +1 -1
- package/dist/zonos-elements/p-2d6557ee.system.js +1 -0
- package/dist/zonos-elements/p-314be538.system.entry.js +1 -0
- package/dist/zonos-elements/{p-79b910bf.system.entry.js → p-328b7f6f.system.entry.js} +1 -1
- package/dist/zonos-elements/p-354603b3.system.entry.js +1 -0
- package/dist/zonos-elements/{p-1f85a98c.system.entry.js → p-389599d3.system.entry.js} +1 -1
- package/dist/zonos-elements/p-3a1e685f.entry.js +1 -0
- package/dist/zonos-elements/{p-a219689f.entry.js → p-3b23e462.entry.js} +1 -1
- package/dist/zonos-elements/{p-591eb6dd.system.js → p-49f6a985.system.js} +1 -1
- package/dist/zonos-elements/p-4fb77a38.system.entry.js +1 -0
- package/dist/zonos-elements/{p-5b44abc8.system.js → p-5496951a.system.js} +1 -1
- package/dist/zonos-elements/{p-06652d87.system.entry.js → p-58e2f6a1.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-cc63a29f.system.entry.js → p-5c176b23.system.entry.js} +1 -1
- package/dist/zonos-elements/p-5d9a000a.system.entry.js +1 -0
- package/dist/zonos-elements/p-5f4ba44c.entry.js +1 -0
- package/dist/zonos-elements/{p-88a55076.system.entry.js → p-61e5cf29.system.entry.js} +1 -1
- package/dist/zonos-elements/p-69e2c59e.entry.js +1 -0
- package/dist/zonos-elements/p-745cd869.system.entry.js +1 -0
- package/dist/zonos-elements/p-78ba2928.system.js +1 -0
- package/dist/zonos-elements/{p-67737613.system.entry.js → p-799d8a17.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-375c472a.system.entry.js → p-79b24786.system.entry.js} +1 -1
- package/dist/zonos-elements/p-7b87b82f.js +1 -0
- package/dist/zonos-elements/{p-e2770968.system.entry.js → p-7c45ce37.system.entry.js} +1 -1
- package/dist/zonos-elements/p-7f4f45b3.entry.js +1 -0
- package/dist/zonos-elements/{p-2d2e1831.entry.js → p-857cfe35.entry.js} +1 -1
- package/dist/zonos-elements/{p-ec4d08b3.system.js → p-91797d4e.system.js} +1 -1
- package/dist/zonos-elements/{p-34c03be2.js → p-95e0fc06.js} +1 -1
- package/dist/zonos-elements/p-9e6b489d.system.entry.js +1 -0
- package/dist/zonos-elements/p-9f4e02a1.entry.js +1 -0
- package/dist/zonos-elements/{p-afe40057.entry.js → p-a3cc0f84.entry.js} +1 -1
- package/dist/zonos-elements/p-a87561b8.js +1 -0
- package/dist/zonos-elements/{p-e161a08c.entry.js → p-ac0a7b8f.entry.js} +1 -1
- package/dist/zonos-elements/{p-549c181b.system.js → p-b4725505.system.js} +1 -1
- package/dist/zonos-elements/p-c060d475.js +1 -0
- package/dist/zonos-elements/p-c2e58ee1.system.entry.js +1 -0
- package/dist/zonos-elements/{p-9878a770.js → p-da767f8b.js} +1 -1
- package/dist/zonos-elements/p-dd9e8589.entry.js +1 -0
- package/dist/zonos-elements/p-f11a3d9e.entry.js +1 -0
- package/dist/zonos-elements/{p-8aeb4679.system.entry.js → p-f6eaef7b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-c7098c3b.entry.js → p-f7c36fcc.entry.js} +1 -1
- package/dist/zonos-elements/{p-a4de3fb2.entry.js → p-ff64ddc5.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/submitGtag-907e71d3.js +0 -21
- package/dist/collection/scripts/extractZonosQaUrl.js +0 -26
- package/dist/esm/submitGtag-a38aed23.js +0 -19
- package/dist/esm-es5/submitGtag-a38aed23.js +0 -1
- package/dist/types/scripts/extractZonosQaUrl.d.ts +0 -11
- package/dist/zonos-elements/p-0057e374.entry.js +0 -1
- package/dist/zonos-elements/p-0c72fb79.system.entry.js +0 -1
- package/dist/zonos-elements/p-290c3670.entry.js +0 -1
- package/dist/zonos-elements/p-2f1e1cbb.system.entry.js +0 -1
- package/dist/zonos-elements/p-33080cde.system.entry.js +0 -1
- package/dist/zonos-elements/p-561e44d6.entry.js +0 -1
- package/dist/zonos-elements/p-5c4dc123.js +0 -1
- package/dist/zonos-elements/p-656c836b.entry.js +0 -1
- package/dist/zonos-elements/p-8d645a00.entry.js +0 -1
- package/dist/zonos-elements/p-a3d72a33.entry.js +0 -1
- package/dist/zonos-elements/p-a93c594f.entry.js +0 -1
- package/dist/zonos-elements/p-b10ff468.entry.js +0 -1
- package/dist/zonos-elements/p-b6992dc2.system.entry.js +0 -1
- package/dist/zonos-elements/p-bce46c41.js +0 -1
- package/dist/zonos-elements/p-c56d4a44.entry.js +0 -1
- package/dist/zonos-elements/p-cbb1e700.system.js +0 -1
- package/dist/zonos-elements/p-cd8bd5e9.system.entry.js +0 -1
- package/dist/zonos-elements/p-d36faf87.system.entry.js +0 -1
- package/dist/zonos-elements/p-e2c6ad57.entry.js +0 -1
- package/dist/zonos-elements/p-ea93943a.system.entry.js +0 -1
- package/dist/zonos-elements/p-f455e08c.js +0 -1
|
@@ -136,7 +136,7 @@ const ZonosAddress = /*@__PURE__*/ proxyCustomElement(class ZonosAddress extends
|
|
|
136
136
|
}
|
|
137
137
|
render() {
|
|
138
138
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
139
|
-
return (h(Host, { key: '
|
|
139
|
+
return (h(Host, { key: '8d762300d8f599a277806d861d13d2beb6a0a5a6', class: "zonos--address zonos--elements" }, h("zonos-text", { key: 'c355eece2f193cb0595ede434238f062b2c07c7c', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), h("div", { key: '59c3bd68cd67c8d733fd2ca5d9f4b4114c84db4a', class: "zonos--address-component" })));
|
|
140
140
|
}
|
|
141
141
|
get el() { return this; }
|
|
142
142
|
static get watchers() { return {
|
|
@@ -19,16 +19,16 @@ const ZonosBadge = /*@__PURE__*/ proxyCustomElement(class ZonosBadge extends HTM
|
|
|
19
19
|
this.rounded = false;
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
22
|
-
return (h(Host, { key: '
|
|
22
|
+
return (h(Host, { key: '1cece57ce37e04873f625d05ad5a0bea6368b46b', class: classes(['zonos--elements zonos--badge']), style: {
|
|
23
23
|
'--font-family': zonosStoreFontFamily(),
|
|
24
|
-
} }, h("div", { key: '
|
|
24
|
+
} }, h("div", { key: '8caf3f2ffb7deda215c44ad0c6c0892936d526c2', class: classes([
|
|
25
25
|
'zonos--badge-content',
|
|
26
26
|
this.badgeColor,
|
|
27
27
|
this.rounded && 'rounded',
|
|
28
28
|
this.iconRight && 'icon-right',
|
|
29
29
|
this.size,
|
|
30
30
|
this.bold && 'bold',
|
|
31
|
-
]) }, this.icon, h("zonos-text", { key: '
|
|
31
|
+
]) }, this.icon, h("zonos-text", { key: 'fb8ac7f09675f9cfd829ecea54c61f5c699caa00' }, h("slot", { key: '978bc876e427d932662a0100043e04b105e9df8d' })))));
|
|
32
32
|
}
|
|
33
33
|
static get style() { return ZonosBadgeStyle0; }
|
|
34
34
|
}, [1, "zonos-badge", {
|
|
@@ -20,7 +20,7 @@ const getButtonTheme = (overrideBackground) => {
|
|
|
20
20
|
return buttonTheme;
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
const zonosButtonCss = ":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 .zonos--spinner-wrapper{position:absolute;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;background-color:var(--amino-surface-color);-ms-flex-pack:center;justify-content:center;border-radius:var(--amino-radius-10);gap:var(--amino-space-8)}:host button{width:100%;position:relative;font-size:14px;-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background-color:var(--amino-surface-color);border:none;outline:1px solid var(--amino-surface-color);border-radius:var(--border-radius, var(--amino-radius-10));-webkit-transition:var(--amino-transition);transition:var(--amino-transition);font-weight:500;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-family:var(--font-family, Inter), Inter;letter-spacing:normal;cursor:pointer;white-space:nowrap;padding:var(--amino-space-8) var(--amino-space-24);color:var(--color, var(--amino-gray-1200));}:host button.sm.no-background,:host button.md.no-background,:host button.lg.no-background{background:none;outline:none}:host button.sm.no-padding-left,:host button.md.no-padding-left,:host button.lg.no-padding-left{padding-left:0}:host button.sm.no-padding-right,:host button.md.no-padding-right,:host button.lg.no-padding-right{padding-right:0}:host button[disabled]{cursor:not-allowed;background-color:var(--background-color, var(--amino-gray-200))}:host button[disabled] .zonos--spinner-wrapper{background-color:var(--background-color, var(--amino-gray-200))}:host button:active{-webkit-transform:scale(0.99);transform:scale(0.99)}:host button.sm{height:var(--amino-size-sm);line-height:var(--amino-size-sm);padding:var(--amino-space-4) var(--amino-space-8)}:host button.sm:not(.has-content).has-icon{padding:0 var(--amino-space-4)}:host button.md{height:var(--amino-size-md);line-height:var(--amino-size-md);padding:var(--amino-space-8) var(--amino-space-16)}:host button.md:not(.has-content).has-icon{padding:0 var(--amino-space-8)}:host button.lg{height:var(--amino-size-lg);line-height:var(--amino-size-lg);padding:var(--amino-space-12) var(--amino-space-24)}:host button.lg:not(.has-content).has-icon{padding:0 var(--amino-space-16)}:host button:not(.only-icon).has-icon{gap:var(--amino-space-8)}@media (max-width: 400px){:host button:not(.only-icon).has-icon{font-size:var(--amino-font-size-s)}}:host button.override-background{background-color:var(--background-color, var(--amino-gray-0));color:var(--color, var(--amino-gray-1200));outline:1px solid var(--background-color, var(--amino-gray-0))}:host button.override-background:disabled{opacity:0.8}:host button.override-background:not(:disabled):hover{opacity:0.9}:host button:not(.override-background){}:host button:not(.override-background).primary{background:var(--amino-blue-600);outline:1px solid var(--amino-blue-600);color:var(--amino-gray-0)}:host button:not(.override-background).primary:not([disabled]):hover{background-image:var(--amino-button-primary-hover)}:host button:not(.override-background).primary:not([disabled]):active{background:var(--amino-blue-700)}:host button:not(.override-background).primary:not([disabled]):focus{-webkit-box-shadow:var(--amino-focus-button);box-shadow:var(--amino-focus-button)}:host button:not(.override-background).primary[disabled]{background:var(--amino-blue-400)}:host button:not(.override-background).primary[disabled] .zonos--spinner-wrapper{background-color:var(--amino-blue-400)}:host button:not(.override-background).primary .zonos--spinner-wrapper{background-color:var(--amino-blue-600)}:host button:not(.override-background).success{background:var(--amino-green-600);outline:1px solid var(--amino-green-600);color:var(--amino-gray-0)}:host button:not(.override-background).success:not([disabled]):hover{background-image:var(--amino-button-success-hover)}:host button:not(.override-background).success:not([disabled]):active{background:var(--amino-green-700)}:host button:not(.override-background).success:not([disabled]):focus{-webkit-box-shadow:var(--amino-focus-button);box-shadow:var(--amino-focus-button)}:host button:not(.override-background).success[disabled]{background:var(--amino-green-400)}:host button:not(.override-background).success[disabled] .zonos--spinner-wrapper{background-color:var(--amino-green-400)}:host button:not(.override-background).danger{background:var(--amino-red-600);outline:1px solid var(--amino-red-600);color:var(--amino-gray-0)}:host button:not(.override-background).danger:not([disabled]):hover{background-image:var(--amino-button-danger-hover)}:host button:not(.override-background).danger:not([disabled]):active{background:var(--amino-red-700)}:host button:not(.override-background).danger:not([disabled]):focus{-webkit-box-shadow:var(--amino-focus-button);box-shadow:var(--amino-focus-button)}:host button:not(.override-background).danger[disabled]{background:var(--amino-red-400)}:host button:not(.override-background).danger[disabled] .zonos--spinner-wrapper{background-color:var(--amino-red-400)}:host button:not(.override-background).warning{background:var(--amino-orange-600);outline:1px solid var(--amino-orange-600);color:var(--amino-gray-0)}:host button:not(.override-background).warning:not([disabled]):hover{background-image:var(--amino-button-warning-hover)}:host button:not(.override-background).warning:not([disabled]):active{background:var(--amino-orange-700)}:host button:not(.override-background).warning:not([disabled]):focus{-webkit-box-shadow:var(--amino-focus-button);box-shadow:var(--amino-focus-button)}:host button:not(.override-background).warning[disabled]{background:var(--amino-orange-400)}:host button:not(.override-background).warning[disabled] .zonos--spinner-wrapper{background-color:var(--amino-orange-400)}:host button:not(.override-background).subtle{background:transparent;color:var(--color);outline:none}:host button:not(.override-background).subtle:not([disabled]):hover{background:var(--amino-gray-100)}:host button:not(.override-background).subtle:not([disabled]):active{background:var(--amino-gray-200)}:host button:not(.override-background).subtle:focus{-webkit-box-shadow:var(--amino-button-focus-ring);box-shadow:var(--amino-button-focus-ring)}:host button:not(.override-background).subtle[disabled] .content{opacity:0.6}:host button:not(.override-background).subtle[disabled] .zonos--spinner-wrapper{background-color:var(--amino-gray-0)}:host button:not(.override-background).outline{background:transparent;outline:1px solid var(--amino-gray-700)}:host button:not(.override-background).outline:not([disabled]):hover{background-color:var(--amino-gray-100)}:host button:not(.override-background).outline:not([disabled]):active{background:var(--amino-gray-200)}:host .zonos--footer-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--amino-v3-shadow-medium);box-shadow:var(--amino-v3-shadow-medium);z-index:10;justify-self:center;border-radius:var(--amino-radius-4);width:24px}";
|
|
23
|
+
const zonosButtonCss = ":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;border-radius:var(--border-radius, var(--amino-radius-10))}:host .zonos--spinner-wrapper{position:absolute;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;background-color:var(--amino-surface-color);-ms-flex-pack:center;justify-content:center;border-radius:var(--amino-radius-10);gap:var(--amino-space-8)}:host button{width:100%;position:relative;font-size:14px;-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background-color:var(--amino-surface-color);border:none;outline:1px solid var(--amino-surface-color);border-radius:var(--border-radius, var(--amino-radius-10));-webkit-transition:var(--amino-transition);transition:var(--amino-transition);font-weight:500;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-family:var(--font-family, Inter), Inter;letter-spacing:normal;cursor:pointer;white-space:nowrap;padding:var(--amino-space-8) var(--amino-space-24);color:var(--color, var(--amino-gray-1200));margin:1px;}:host button.sm.no-background,:host button.md.no-background,:host button.lg.no-background{background:none;outline:none}:host button.sm.no-padding-left,:host button.md.no-padding-left,:host button.lg.no-padding-left{padding-left:0}:host button.sm.no-padding-right,:host button.md.no-padding-right,:host button.lg.no-padding-right{padding-right:0}:host button[disabled]{cursor:not-allowed;background-color:var(--background-color, var(--amino-gray-200))}:host button[disabled] .zonos--spinner-wrapper{background-color:var(--background-color, var(--amino-gray-200))}:host button:active{-webkit-transform:scale(0.99);transform:scale(0.99)}:host button.sm{height:var(--amino-size-sm);line-height:var(--amino-size-sm);padding:var(--amino-space-4) var(--amino-space-8)}:host button.sm:not(.has-content).has-icon{padding:0 var(--amino-space-4)}:host button.md{height:var(--amino-size-md);line-height:var(--amino-size-md);padding:var(--amino-space-8) var(--amino-space-16)}:host button.md:not(.has-content).has-icon{padding:0 var(--amino-space-8)}:host button.lg{height:var(--amino-size-lg);line-height:var(--amino-size-lg);padding:var(--amino-space-12) var(--amino-space-24)}:host button.lg:not(.has-content).has-icon{padding:0 var(--amino-space-16)}:host button:not(.only-icon).has-icon{gap:var(--amino-space-8)}@media (max-width: 400px){:host button:not(.only-icon).has-icon{font-size:var(--amino-font-size-s)}}:host button.override-background{background-color:var(--background-color, var(--amino-gray-0));color:var(--color, var(--amino-gray-1200));outline:1px solid var(--background-color, var(--amino-gray-0))}:host button.override-background:disabled{opacity:0.8}:host button.override-background:not(:disabled):hover{opacity:0.9}:host button:not(.override-background){}:host button:not(.override-background).primary{background:var(--amino-blue-600);outline:1px solid var(--amino-blue-600);color:var(--amino-gray-0)}:host button:not(.override-background).primary:not([disabled]):hover{background-image:var(--amino-button-primary-hover)}:host button:not(.override-background).primary:not([disabled]):active{background:var(--amino-blue-700)}:host button:not(.override-background).primary:not([disabled]):focus{-webkit-box-shadow:var(--amino-focus-button);box-shadow:var(--amino-focus-button)}:host button:not(.override-background).primary[disabled]{background:var(--amino-blue-400)}:host button:not(.override-background).primary[disabled] .zonos--spinner-wrapper{background-color:var(--amino-blue-400)}:host button:not(.override-background).primary .zonos--spinner-wrapper{background-color:var(--amino-blue-600)}:host button:not(.override-background).success{background:var(--amino-green-600);outline:1px solid var(--amino-green-600);color:var(--amino-gray-0)}:host button:not(.override-background).success:not([disabled]):hover{background-image:var(--amino-button-success-hover)}:host button:not(.override-background).success:not([disabled]):active{background:var(--amino-green-700)}:host button:not(.override-background).success:not([disabled]):focus{-webkit-box-shadow:var(--amino-focus-button);box-shadow:var(--amino-focus-button)}:host button:not(.override-background).success[disabled]{background:var(--amino-green-400)}:host button:not(.override-background).success[disabled] .zonos--spinner-wrapper{background-color:var(--amino-green-400)}:host button:not(.override-background).danger{background:var(--amino-red-600);outline:1px solid var(--amino-red-600);color:var(--amino-gray-0)}:host button:not(.override-background).danger:not([disabled]):hover{background-image:var(--amino-button-danger-hover)}:host button:not(.override-background).danger:not([disabled]):active{background:var(--amino-red-700)}:host button:not(.override-background).danger:not([disabled]):focus{-webkit-box-shadow:var(--amino-focus-button);box-shadow:var(--amino-focus-button)}:host button:not(.override-background).danger[disabled]{background:var(--amino-red-400)}:host button:not(.override-background).danger[disabled] .zonos--spinner-wrapper{background-color:var(--amino-red-400)}:host button:not(.override-background).warning{background:var(--amino-orange-600);outline:1px solid var(--amino-orange-600);color:var(--amino-gray-0)}:host button:not(.override-background).warning:not([disabled]):hover{background-image:var(--amino-button-warning-hover)}:host button:not(.override-background).warning:not([disabled]):active{background:var(--amino-orange-700)}:host button:not(.override-background).warning:not([disabled]):focus{-webkit-box-shadow:var(--amino-focus-button);box-shadow:var(--amino-focus-button)}:host button:not(.override-background).warning[disabled]{background:var(--amino-orange-400)}:host button:not(.override-background).warning[disabled] .zonos--spinner-wrapper{background-color:var(--amino-orange-400)}:host button:not(.override-background).subtle{background:transparent;color:var(--color);outline:none}:host button:not(.override-background).subtle:not([disabled]):hover{background:var(--amino-gray-100)}:host button:not(.override-background).subtle:not([disabled]):active{background:var(--amino-gray-200)}:host button:not(.override-background).subtle:focus{-webkit-box-shadow:var(--amino-button-focus-ring);box-shadow:var(--amino-button-focus-ring)}:host button:not(.override-background).subtle[disabled] .content{opacity:0.6}:host button:not(.override-background).subtle[disabled] .zonos--spinner-wrapper{background-color:var(--amino-gray-0)}:host button:not(.override-background).outline{background:transparent;outline:1px solid var(--amino-gray-700)}:host button:not(.override-background).outline:not([disabled]):hover{background-color:var(--amino-gray-100)}:host button:not(.override-background).outline:not([disabled]):active{background:var(--amino-gray-200)}:host .zonos--footer-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--amino-v3-shadow-medium);box-shadow:var(--amino-v3-shadow-medium);z-index:10;justify-self:center;border-radius:var(--amino-radius-4);width:24px}";
|
|
24
24
|
const ZonosButtonStyle0 = zonosButtonCss;
|
|
25
25
|
|
|
26
26
|
const ZonosButton = /*@__PURE__*/ proxyCustomElement(class ZonosButton extends HTMLElement {
|
|
@@ -80,13 +80,13 @@ const ZonosButton = /*@__PURE__*/ proxyCustomElement(class ZonosButton extends H
|
|
|
80
80
|
// only set theme for button to change text color if variant is standard and override background is set
|
|
81
81
|
const buttonTheme = variant === 'standard' ? getButtonTheme(overrideBackground) : undefined;
|
|
82
82
|
const borderStyle = getBorderRadius(this.borderStyle);
|
|
83
|
-
const spinnerColor = buttonTheme === 'LIGHT' ? '
|
|
84
|
-
return (h(Host, { key: '
|
|
83
|
+
const spinnerColor = buttonTheme === 'LIGHT' ? 'black' : 'white';
|
|
84
|
+
return (h(Host, { key: 'f3374eedd37ec6293260fba7b19d66aa013d3484', class: classes(['zonos--elements']), "data-theme": this.theme || buttonTheme, disabled: disabled, style: {
|
|
85
85
|
'--background-color': overrideBackground,
|
|
86
86
|
'--border-radius': borderStyle,
|
|
87
87
|
'--color': color,
|
|
88
88
|
'--font-family': zonosStoreFontFamily(),
|
|
89
|
-
} }, h("button", { key: '
|
|
89
|
+
} }, h("button", { key: '352ce427591b20b8042dcd19ce159b77c1fc2faf', class: classes([
|
|
90
90
|
this.hasIcon && 'has-icon',
|
|
91
91
|
this.hasContent && 'has-content',
|
|
92
92
|
this.noBackground && 'no-background',
|
|
@@ -99,7 +99,7 @@ const ZonosButton = /*@__PURE__*/ proxyCustomElement(class ZonosButton extends H
|
|
|
99
99
|
overrideBackground &&
|
|
100
100
|
variant === 'standard' &&
|
|
101
101
|
'override-background',
|
|
102
|
-
]), disabled: disabled }, this.loading && (h("div", { class: "zonos--spinner-wrapper" }, h("zonos-spinner", { size: 16, spinnerColor: spinnerColor }))), !this.loading && !this.iconRight && this.icon, h("slot", { key: '
|
|
102
|
+
]), disabled: disabled }, this.loading && (h("div", { class: "zonos--spinner-wrapper" }, h("zonos-spinner", { size: 16, spinnerColor: spinnerColor }))), !this.loading && !this.iconRight && this.icon, h("slot", { key: '554cc1fd9bb58d833339ae21e837d586adc248c2', onSlotchange: this.handleSlotChange }), !this.loading && this.iconRight && this.icon)));
|
|
103
103
|
}
|
|
104
104
|
static get watchers() { return {
|
|
105
105
|
"icon": ["iconChangeHandler"]
|
|
@@ -19,9 +19,9 @@ const ZonosCard = /*@__PURE__*/ proxyCustomElement(class ZonosCard extends HTMLE
|
|
|
19
19
|
this.spacing = '24px';
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
22
|
-
return (h(Host, { key: '
|
|
22
|
+
return (h(Host, { key: 'b350f7a592ea35c3b6beaf5eefaa2ab0208975dd', style: {
|
|
23
23
|
'--font-family': zonosStoreFontFamily(),
|
|
24
|
-
} }, h("div", { key: '
|
|
24
|
+
} }, h("div", { key: '125e8b550cd8f371e28a012536722f48402774f2', class: classes(['styled-card']), style: { padding: this.spacing } }, this.label && (h("header", { class: "card-header", style: { padding: this.spacing } }, h("zonos-text", { type: "subheader" }, this.label), h("h-stack", { spacing: 8 }, this.actions))), h("slot", { key: '3cf038c62910ebac736ed1c37ecf1a490c8e1d0e' }), (this.footerActions || this.footerContent) && (h("footer", { class: "card-footer", style: {
|
|
25
25
|
height: this.footerHeight ? `${this.footerHeight}px` : 'auto',
|
|
26
26
|
padding: this.spacing,
|
|
27
27
|
} }, h("div", null, this.footerContent), h("h-stack", { spacing: 8 }, this.footerActions))))));
|
|
@@ -22,7 +22,6 @@ const ZonosCartSubtotal = /*@__PURE__*/ proxyCustomElement(class ZonosCartSubtot
|
|
|
22
22
|
this.__attachShadow();
|
|
23
23
|
}
|
|
24
24
|
render() {
|
|
25
|
-
const totalWithoutTaxes = cartStore.total - cartStore.dutiesTaxFees;
|
|
26
25
|
const showDutyTaxesInfo = cartStore.step === 'payment' || cartStore.step === 'shipping';
|
|
27
26
|
const renderShippingInfo = () => {
|
|
28
27
|
if (!cartStore.selectedShippingOption) {
|
|
@@ -44,11 +43,7 @@ const ZonosCartSubtotal = /*@__PURE__*/ proxyCustomElement(class ZonosCartSubtot
|
|
|
44
43
|
currency: cartStore.currency,
|
|
45
44
|
})
|
|
46
45
|
: '-', cartStore.isSelectedShippingGuarantee && (h("zonos-badge", null, translate('Guaranteed'))))))), h("tr", { class: "zonos--row zonos--cart-pay-total" }, h("td", { class: "zonos--column" }), h("td", { class: "zonos--column" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Order total'))), h("td", { class: "zonos--column" }, h("zonos-text", { type: "semiBoldLabel" }, formatCurrency({
|
|
47
|
-
amount:
|
|
48
|
-
// show total without taxes when step is shipping, show total with taxes when step is payment
|
|
49
|
-
cartStore.step === 'shipping'
|
|
50
|
-
? totalWithoutTaxes
|
|
51
|
-
: cartStore.total,
|
|
46
|
+
amount: cartStore.total,
|
|
52
47
|
currency: cartStore.currency,
|
|
53
48
|
})))))));
|
|
54
49
|
}
|
|
@@ -46,14 +46,14 @@ const ZonosCheckbox = /*@__PURE__*/ proxyCustomElement(class ZonosCheckbox exten
|
|
|
46
46
|
? 'var(--amino-gray-800)'
|
|
47
47
|
: 'var(--amino-gray-0)';
|
|
48
48
|
const borderStyle = getBorderRadius(this.borderStyle, '4px');
|
|
49
|
-
return (h(Host, { key: '
|
|
49
|
+
return (h(Host, { key: '5f8516f5933b739cc3f21d901e50dec1c761fa58', class: classes(['zonos--elements zonos--checkbox']), style: {
|
|
50
50
|
'--background-color': backgroundColor,
|
|
51
51
|
'--border-radius': borderStyle,
|
|
52
52
|
'--font-family': zonosStoreFontFamily(),
|
|
53
53
|
'--size': `${this.size}px`,
|
|
54
|
-
} }, h("label", { key: '
|
|
54
|
+
} }, h("label", { key: '6544f51a8c892d616123ab4194d069b055e3dc86', class: classes([this.isDisabled && 'disabled']) }, h("input", { key: '958e35bf16be575230748fccdb1a3916942c3a30', checked: this.isChecked, disabled: this.isDisabled, hidden: true, onChange: e => {
|
|
55
55
|
this.checkboxSelected.emit(e.target.checked);
|
|
56
|
-
}, type: "checkbox" }), h("span", { key: '
|
|
56
|
+
}, type: "checkbox" }), h("span", { key: '2c55e0a190b092dd083c433c35143e253910f54f', class: "checkmark-container" }, h("svg", { key: '0aa1f705b728055835159a399173a170aee4f7c0', class: "checkmark", color: checkmarkColor, fill: "none", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: 'd526bbafde4d4399be3f3a0a7cc87e92634d9548', "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)))));
|
|
57
57
|
}
|
|
58
58
|
static get style() { return ZonosCheckboxStyle0; }
|
|
59
59
|
}, [1, "zonos-checkbox", {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host, Fragment } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { u as handleFetch, q as stripeStoreReset, c as cartStore, s as stripeStore, v as stripeStoreRetrievePayment, t as translate } from './stripe.js';
|
|
3
3
|
import { z as zonosStore } from './zonosStore.js';
|
|
4
|
+
import { t as trackConversionEvent } from './trackConversionEvent.js';
|
|
4
5
|
import { g as getBorderRadius } from './getBorderRadius.js';
|
|
5
6
|
import { s as submitGtag } from './submitGtag.js';
|
|
6
7
|
import { d as defineCustomElement$4 } from './zonos-button2.js';
|
|
@@ -8,6 +9,18 @@ import { d as defineCustomElement$3 } from './zonos-icon2.js';
|
|
|
8
9
|
import { d as defineCustomElement$2 } from './zonos-spinner2.js';
|
|
9
10
|
import { d as defineCustomElement$1 } from './zonos-text2.js';
|
|
10
11
|
|
|
12
|
+
const sendErrorLog = async ({ endpoint, errors, metadata }) => {
|
|
13
|
+
const errorObject = {
|
|
14
|
+
endpoint,
|
|
15
|
+
errors,
|
|
16
|
+
metadata,
|
|
17
|
+
};
|
|
18
|
+
void handleFetch(`${"https://v1.route.js.zonos.com"}/api/zonos-elements/log-error`, {
|
|
19
|
+
body: errorObject,
|
|
20
|
+
method: 'POST',
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
|
|
11
24
|
const RemoveIcon = `<svg color="var(--amino-red-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-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" data-is-secondary-color="true" fill="var(--amino-red-200)" fill-rule="evenodd"></path><path clip-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" fill="currentColor" fill-rule="evenodd"></path></svg>`;
|
|
12
25
|
|
|
13
26
|
const SuccessIcon = `<svg color="var(--amino-blue-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Z" data-is-secondary-color="true" fill="var(--amino-blue-100)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M15.707 9.293a1 1 0 0 1 0 1.414l-3.646 3.647a1.5 1.5 0 0 1-2.122 0l-1.646-1.647a1 1 0 1 1 1.414-1.414L11 12.586l3.293-3.293a1 1 0 0 1 1.414 0Z" fill="currentColor" fill-rule="evenodd"></path></svg>`;
|
|
@@ -36,13 +49,17 @@ const ZonosCheckoutFinish = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout
|
|
|
36
49
|
this.handleSuccessBehavior = (orderId) => {
|
|
37
50
|
const { successBehavior } = zonosStore.checkoutSettings;
|
|
38
51
|
switch (successBehavior) {
|
|
39
|
-
case 'REDIRECT_TO_SUCCESS_PAGE':
|
|
52
|
+
case 'REDIRECT_TO_SUCCESS_PAGE': {
|
|
40
53
|
const redirectUrl = zonosStore.checkoutSettings.successRedirectUrl;
|
|
41
54
|
if (redirectUrl) {
|
|
55
|
+
// reset store and checkout session id before redirecting
|
|
56
|
+
stripeStoreReset();
|
|
57
|
+
cartStore.checkoutSessionId = null;
|
|
42
58
|
window.location.href = `${redirectUrl}?zOrderNumber=${orderId}`;
|
|
43
59
|
}
|
|
44
60
|
// If no redirect URL, break and display Zonos success page
|
|
45
61
|
break;
|
|
62
|
+
}
|
|
46
63
|
case 'CLOSE_MODAL':
|
|
47
64
|
this.closeClickHandler();
|
|
48
65
|
break;
|
|
@@ -57,6 +74,7 @@ const ZonosCheckoutFinish = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout
|
|
|
57
74
|
this.getPullOrder = async (attempts = 0) => {
|
|
58
75
|
const order = await this.pullOrder();
|
|
59
76
|
if (order) {
|
|
77
|
+
void trackConversionEvent('checkout_orderCompleted');
|
|
60
78
|
this.order = order;
|
|
61
79
|
this.handleSuccessBehavior(order.id);
|
|
62
80
|
}
|
|
@@ -68,18 +86,16 @@ const ZonosCheckoutFinish = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout
|
|
|
68
86
|
else {
|
|
69
87
|
// Set loading to false to display generic success page and log error
|
|
70
88
|
this.isLoading = false;
|
|
71
|
-
const
|
|
72
|
-
|
|
89
|
+
const baseUrl = "https://v1.route.js.zonos.com";
|
|
90
|
+
const checkoutSessionId = cartStore.checkoutSessionId;
|
|
91
|
+
void sendErrorLog({
|
|
92
|
+
endpoint: `${baseUrl}/api/zonos-elements/get-order?checkoutSessionId=${checkoutSessionId}`,
|
|
73
93
|
errors: ['Order not found after multiple attempts'],
|
|
74
94
|
metadata: {
|
|
75
95
|
checkoutSessionId: cartStore.checkoutSessionId || '',
|
|
76
96
|
domain: window.location.hostname,
|
|
77
97
|
storeId: zonosStore.storeId,
|
|
78
98
|
},
|
|
79
|
-
};
|
|
80
|
-
void handleFetch(`${"https://v1.route.js.zonos.com"}/api/zonos-elements/log-error`, {
|
|
81
|
-
body: errorObject,
|
|
82
|
-
method: 'POST',
|
|
83
99
|
});
|
|
84
100
|
}
|
|
85
101
|
};
|
|
@@ -87,7 +103,7 @@ const ZonosCheckoutFinish = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout
|
|
|
87
103
|
this.isLoading = true;
|
|
88
104
|
const clientSecret = new URLSearchParams(window.location.search).get('payment_intent_client_secret') || stripeStore.clientSecret;
|
|
89
105
|
if (clientSecret || this.storybookForceStatus) {
|
|
90
|
-
const { error, messages } = await stripeStoreRetrievePayment({
|
|
106
|
+
const { error, messages, paymentMethod } = await stripeStoreRetrievePayment({
|
|
91
107
|
clientSecret,
|
|
92
108
|
storybookForceStatus: this.storybookForceStatus,
|
|
93
109
|
});
|
|
@@ -101,6 +117,9 @@ const ZonosCheckoutFinish = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout
|
|
|
101
117
|
}
|
|
102
118
|
else {
|
|
103
119
|
submitGtag('zonos-checkout-success');
|
|
120
|
+
void trackConversionEvent('checkout_paymentInfoCompleted', {
|
|
121
|
+
paymentMethod,
|
|
122
|
+
});
|
|
104
123
|
const successEvent = new CustomEvent('zonos-checkout-success', {
|
|
105
124
|
detail: {
|
|
106
125
|
message: 'Zonos Checkout successfully processed order',
|
|
@@ -110,7 +129,8 @@ const ZonosCheckoutFinish = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout
|
|
|
110
129
|
}
|
|
111
130
|
// Attempt to pull the order details from the graph every second on 5 attempts
|
|
112
131
|
if (this.notificationType === 'success') {
|
|
113
|
-
|
|
132
|
+
// wait this to finish before resetting store and checkout session id
|
|
133
|
+
await this.getPullOrder();
|
|
114
134
|
}
|
|
115
135
|
else {
|
|
116
136
|
this.isLoading = false;
|
|
@@ -153,7 +173,7 @@ const ZonosCheckoutFinish = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout
|
|
|
153
173
|
// const totalItems = this.order?.items?.reduce((acc, item) => {
|
|
154
174
|
// return acc + item.quantity;
|
|
155
175
|
// }, 0);
|
|
156
|
-
return (h(Host, { key: '
|
|
176
|
+
return (h(Host, { key: 'fe08bfd0c0b60f4dce1aa9a6f3ba273dccd70a92', class: "zonos--checkout-finish zonos--elements", style: {
|
|
157
177
|
'--border-radius': getBorderRadius(this.borderRadius),
|
|
158
178
|
} }, 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')))))));
|
|
159
179
|
}
|
|
@@ -203,4 +223,4 @@ function defineCustomElement() {
|
|
|
203
223
|
} });
|
|
204
224
|
}
|
|
205
225
|
|
|
206
|
-
export { ZonosCheckoutFinish as Z, defineCustomElement as d };
|
|
226
|
+
export { ZonosCheckoutFinish as Z, defineCustomElement as d, sendErrorLog as s };
|
|
@@ -8,7 +8,7 @@ import { d as defineCustomElement$3 } from './zonos-payment2.js';
|
|
|
8
8
|
import { d as defineCustomElement$2 } from './zonos-spinner2.js';
|
|
9
9
|
import { d as defineCustomElement$1 } from './zonos-text2.js';
|
|
10
10
|
|
|
11
|
-
const zonosCheckoutPaymentCss = ".sc-zonos-checkout-payment-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-checkout-payment-h *.sc-zonos-checkout-payment{font-family:var(--font-family, Inter), Inter}.sc-zonos-checkout-payment-h img.sc-zonos-checkout-payment{max-width:100%}.sc-zonos-checkout-payment-h dl.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h dd.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h1.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h2.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h3.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h4.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h5.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h6.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h hr.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h figure.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h p.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h pre.sc-zonos-checkout-payment{margin:0}.sc-zonos-checkout-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-payment-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-checkout-payment-h .zonos--title.sc-zonos-checkout-payment{margin-bottom:var(--amino-space-24)}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment{margin-bottom:var(--amino-space-20);overflow:auto;padding:5px}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar{width:10px}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-track{background:var(--amino-gray-50)}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-payment-h .zonos--payment-error-banner.sc-zonos-checkout-payment{margin-bottom:var(--amino-space-8)}.sc-zonos-checkout-payment-h .zonos--group-btn.sc-zonos-checkout-payment{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;bottom:0;margin-top:var(--amino-space-12);background:var(--primary-color, var(--amino-gray-0))}.sc-zonos-checkout-payment-h .zonos--group-btn.sc-zonos-checkout-payment zonos-button.sc-zonos-checkout-payment{width:100%}";
|
|
11
|
+
const zonosCheckoutPaymentCss = ".sc-zonos-checkout-payment-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-checkout-payment-h *.sc-zonos-checkout-payment{font-family:var(--font-family, Inter), Inter}.sc-zonos-checkout-payment-h img.sc-zonos-checkout-payment{max-width:100%}.sc-zonos-checkout-payment-h dl.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h dd.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h1.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h2.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h3.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h4.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h5.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h6.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h hr.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h figure.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h p.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h pre.sc-zonos-checkout-payment{margin:0}.sc-zonos-checkout-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-payment-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-checkout-payment-h .zonos--title.sc-zonos-checkout-payment{margin-bottom:var(--amino-space-24)}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment{margin-bottom:var(--amino-space-20);overflow:auto;padding:5px}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar{width:10px}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-track{background:var(--amino-gray-50)}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-payment-h .zonos--payment-error-banner.sc-zonos-checkout-payment{margin-bottom:var(--amino-space-8)}.sc-zonos-checkout-payment-h zonos-button.sc-zonos-checkout-payment{-webkit-box-shadow:0 0 1px 0 var(--amino-gray-600);box-shadow:0 0 1px 0 var(--amino-gray-600)}.sc-zonos-checkout-payment-h .zonos--group-btn.sc-zonos-checkout-payment{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;bottom:0;margin-top:var(--amino-space-12);background:var(--primary-color, var(--amino-gray-0))}.sc-zonos-checkout-payment-h .zonos--group-btn.sc-zonos-checkout-payment zonos-button.sc-zonos-checkout-payment{width:100%}";
|
|
12
12
|
const ZonosCheckoutPaymentStyle0 = zonosCheckoutPaymentCss;
|
|
13
13
|
|
|
14
14
|
const ZonosCheckoutPayment = /*@__PURE__*/ proxyCustomElement(class ZonosCheckoutPayment extends HTMLElement {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host, Fragment } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { b as localizationStore, d as log, e as stripeStoreGetDomesticShippingSession, f as localizationStoreUpdateSelectedCountryCode, g as stripeStoreCleanupDomesticShippingSession, l as logError, h as stripeStoreSaveDomesticShippingSession, i as initStripeElements, c as cartStore, j as cartStoreUpdateItems, k as cartStoreReset, s as stripeStore, m as stripeStoreInitCheckoutSession, n as cartStoreUpdateToErrorState, t as translate, a as stripeStorePrefetchLandedCost, o as cartStoreNextStep, p as stripeStoreConfirmPayment, q as stripeStoreReset, r as cartStorePreviousStep } from './stripe.js';
|
|
3
3
|
import { z as zonosStore, m as mergeConfig } from './zonosStore.js';
|
|
4
|
+
import { t as trackConversionEvent } from './trackConversionEvent.js';
|
|
4
5
|
import { i as isCheckoutMobile } from './isCheckoutMobile.js';
|
|
6
|
+
import { s as sendErrorLog, d as defineCustomElement$k } from './zonos-checkout-finish2.js';
|
|
5
7
|
import { c as classes } from './classes.js';
|
|
6
8
|
import { g as getBorderRadius } from './getBorderRadius.js';
|
|
7
9
|
import { i as isDarkColor } from './isDarkColor.js';
|
|
@@ -14,7 +16,6 @@ import { d as defineCustomElement$o } from './zonos-card2.js';
|
|
|
14
16
|
import { d as defineCustomElement$n } from './zonos-cart-items2.js';
|
|
15
17
|
import { d as defineCustomElement$m } from './zonos-cart-subtotal2.js';
|
|
16
18
|
import { d as defineCustomElement$l } from './zonos-checkbox2.js';
|
|
17
|
-
import { d as defineCustomElement$k } from './zonos-checkout-finish2.js';
|
|
18
19
|
import { d as defineCustomElement$j } from './zonos-checkout-footer2.js';
|
|
19
20
|
import { d as defineCustomElement$i } from './zonos-checkout-payment2.js';
|
|
20
21
|
import { d as defineCustomElement$h } from './zonos-collapse2.js';
|
|
@@ -34,6 +35,126 @@ import { d as defineCustomElement$4 } from './zonos-text2.js';
|
|
|
34
35
|
import { d as defineCustomElement$3 } from './zonos-tooltip2.js';
|
|
35
36
|
import { d as defineCustomElement$2 } from './zonos-v-stack2.js';
|
|
36
37
|
|
|
38
|
+
const isShippableCountry = (showLog = true) => {
|
|
39
|
+
if (!localizationStore.localizationLoaded) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
// if localization is loaded and the localization is not a shippable country, keep the original click event
|
|
43
|
+
if (!localizationStore.isShippableCountry) {
|
|
44
|
+
if (showLog) {
|
|
45
|
+
log(`Checkout: not shippable country`);
|
|
46
|
+
}
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
return true;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Watch for changes in domestic checkout step, this is to redirect user to home page and open checkout if user enters the ship to country that's in the shipping zone
|
|
54
|
+
* @note Only works on default bigcommerce checkout page
|
|
55
|
+
*/
|
|
56
|
+
const watchBigcommerceDomesticCheckout = ({ domesticRedirectedBtnSelector, onShippingAddressSessionFound, }) => {
|
|
57
|
+
if (!window.Zonos.isBigCommerce) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const observer = new MutationObserver(async () => {
|
|
61
|
+
const domesticRedirectedButton = document.querySelector(domesticRedirectedBtnSelector);
|
|
62
|
+
const shippingAddressSession = stripeStoreGetDomesticShippingSession();
|
|
63
|
+
// append a hidden button to the body if the shipping address session is found
|
|
64
|
+
if (!domesticRedirectedButton && shippingAddressSession) {
|
|
65
|
+
// create a hidden button to trigger the click event
|
|
66
|
+
const button = document.createElement('button');
|
|
67
|
+
button.style.display = 'none';
|
|
68
|
+
button.id = 'zonos--domestic-redirected-checkout-button';
|
|
69
|
+
document.body.appendChild(button);
|
|
70
|
+
onShippingAddressSessionFound === null || onShippingAddressSessionFound === void 0 ? void 0 : onShippingAddressSessionFound(shippingAddressSession);
|
|
71
|
+
// disconnect the observer after we found the shipping continue button
|
|
72
|
+
observer.disconnect();
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const shipToCountryElement = document.querySelector('select[name="shippingAddress.countryCode"]');
|
|
76
|
+
// make sure the continue button is available
|
|
77
|
+
const shippingCountinueBtnEle = document.querySelector('#checkout-shipping-continue');
|
|
78
|
+
if (!shipToCountryElement || !shippingCountinueBtnEle) {
|
|
79
|
+
// do nothing if shipping country and the continue button is not found
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
// disconnect the observer after we found the shipping continue button
|
|
83
|
+
observer.disconnect();
|
|
84
|
+
shippingCountinueBtnEle.addEventListener('click', async (e) => {
|
|
85
|
+
var _a, _b;
|
|
86
|
+
const shippingCountry = shipToCountryElement.value;
|
|
87
|
+
if (!shippingCountry) {
|
|
88
|
+
// do nothing if shipping country is not found
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
// update the country code in localization store and check if it's shippable
|
|
92
|
+
localizationStoreUpdateSelectedCountryCode(shippingCountry);
|
|
93
|
+
// do nothing if the country is still domestic
|
|
94
|
+
if (!isShippableCountry(false)) {
|
|
95
|
+
// cleanup the domestic shipping session if it's domestic because we will open the intl checkout after redirecting
|
|
96
|
+
stripeStoreCleanupDomesticShippingSession();
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
// get value of shipping address state
|
|
100
|
+
const shipToFormElement = document.querySelector('form');
|
|
101
|
+
if (!shipToFormElement) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
const formData = new FormData(shipToFormElement);
|
|
105
|
+
const shipAddress1Element = document.querySelector('input#addressLine1Input');
|
|
106
|
+
const shippingAddress = {
|
|
107
|
+
address1: (_a = formData.get('shippingAddress.address1')) !== null && _a !== void 0 ? _a :
|
|
108
|
+
// in Canada, the address1 is not included in the form, try to get value from input id instead.
|
|
109
|
+
(shipAddress1Element && shipAddress1Element.value),
|
|
110
|
+
address2: formData.get('shippingAddress.address2'),
|
|
111
|
+
city: formData.get('shippingAddress.city'),
|
|
112
|
+
countryCode: formData.get('shippingAddress.countryCode'),
|
|
113
|
+
firstName: formData.get('shippingAddress.firstName'),
|
|
114
|
+
lastName: formData.get('shippingAddress.lastName'),
|
|
115
|
+
phone: formData.get('shippingAddress.phone'),
|
|
116
|
+
postalCode: formData.get('shippingAddress.postalCode'),
|
|
117
|
+
stateOrProvince: (_b = formData.get('shippingAddress.stateOrProvince')) !== null && _b !== void 0 ? _b : formData.get('shippingAddress.stateOrProvinceCode'),
|
|
118
|
+
};
|
|
119
|
+
if (Object.values(shippingAddress).some(value => value === undefined || value === null)) {
|
|
120
|
+
logError('One or more shipping address field is missing', Object.entries(shippingAddress));
|
|
121
|
+
void sendErrorLog({
|
|
122
|
+
endpoint: 'No endpoint, domestic checkout form missing fields',
|
|
123
|
+
errors: [
|
|
124
|
+
'Bigcommerce: One or more shipping address field is missing in the domestic checkout form',
|
|
125
|
+
JSON.stringify(Object.entries(shippingAddress)),
|
|
126
|
+
],
|
|
127
|
+
metadata: {
|
|
128
|
+
domain: window.location.hostname,
|
|
129
|
+
storeId: zonosStore.storeId,
|
|
130
|
+
},
|
|
131
|
+
});
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
// save the shipping address to session storage
|
|
135
|
+
stripeStoreSaveDomesticShippingSession({
|
|
136
|
+
address1: shippingAddress.address1,
|
|
137
|
+
address2: shippingAddress.address2,
|
|
138
|
+
city: shippingAddress.city,
|
|
139
|
+
countryCode: shippingAddress.countryCode,
|
|
140
|
+
firstName: shippingAddress.firstName,
|
|
141
|
+
lastName: shippingAddress.lastName,
|
|
142
|
+
phone: shippingAddress.phone,
|
|
143
|
+
postalCode: shippingAddress.postalCode,
|
|
144
|
+
state: shippingAddress.stateOrProvince,
|
|
145
|
+
});
|
|
146
|
+
e.preventDefault();
|
|
147
|
+
e.stopPropagation();
|
|
148
|
+
// redirect to home page, home page then will open the checkout dialog if having domestic shipping session
|
|
149
|
+
window.location.href = '/';
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
observer.observe(document.body, {
|
|
153
|
+
childList: true,
|
|
154
|
+
subtree: true,
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
|
|
37
158
|
const LeftArrow = `<svg color="var(--amino-gray-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M9.707 16.707a1 1 0 0 1-1.414 0l-3.647-3.646a1.5 1.5 0 0 1 0-2.122l3.647-3.646a1 1 0 0 1 1.414 1.414L7.414 11H19a1 1 0 1 1 0 2H7.414l2.293 2.293a1 1 0 0 1 0 1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>`;
|
|
38
159
|
|
|
39
160
|
const MessageIcon = `<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">
|
|
@@ -61,19 +182,6 @@ const ZonosCheckout$1 = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout ext
|
|
|
61
182
|
overrideTheme: this.isMobile ? theme : undefined,
|
|
62
183
|
});
|
|
63
184
|
};
|
|
64
|
-
this.isShippableCountry = (showLog = true) => {
|
|
65
|
-
if (!localizationStore.localizationLoaded) {
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
// if localization is loaded and the localization is not a shippable country, keep the original click event
|
|
69
|
-
if (!localizationStore.isShippableCountry) {
|
|
70
|
-
if (showLog) {
|
|
71
|
-
log(`Checkout: not shippable country`);
|
|
72
|
-
}
|
|
73
|
-
return false;
|
|
74
|
-
}
|
|
75
|
-
return true;
|
|
76
|
-
};
|
|
77
185
|
this.getCurrentLocalePageEnum = () => {
|
|
78
186
|
switch (cartStore.step) {
|
|
79
187
|
case 'customer-info':
|
|
@@ -100,6 +208,7 @@ const ZonosCheckout$1 = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout ext
|
|
|
100
208
|
this.isMobile = false;
|
|
101
209
|
this.zonosReviewRef = undefined;
|
|
102
210
|
this.storybookPaymentStatusOverride = undefined;
|
|
211
|
+
this.domesticRedirectedBtnSelector = '#zonos--domestic-redirected-checkout-button';
|
|
103
212
|
}
|
|
104
213
|
/**
|
|
105
214
|
* Init cart info handler event
|
|
@@ -145,7 +254,8 @@ const ZonosCheckout$1 = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout ext
|
|
|
145
254
|
// do nothing if button element is not found
|
|
146
255
|
return;
|
|
147
256
|
}
|
|
148
|
-
|
|
257
|
+
// also attach event to hidden button if user was redirected with shipping address session
|
|
258
|
+
const buttonAnchorElements = document.querySelectorAll(`${buttonAnchorSelector}, ${this.domesticRedirectedBtnSelector}`);
|
|
149
259
|
// only attach event once, and looping through all of the button elements
|
|
150
260
|
buttonAnchorElements.forEach(button => {
|
|
151
261
|
const isEventAttached = button.getAttribute('data-zonos-checkout-attached');
|
|
@@ -155,7 +265,7 @@ const ZonosCheckout$1 = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout ext
|
|
|
155
265
|
}
|
|
156
266
|
button.addEventListener('click', async (e) => {
|
|
157
267
|
// do nothing if it's not shippable country
|
|
158
|
-
if (!
|
|
268
|
+
if (!isShippableCountry()) {
|
|
159
269
|
return;
|
|
160
270
|
}
|
|
161
271
|
e.preventDefault();
|
|
@@ -171,6 +281,7 @@ const ZonosCheckout$1 = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout ext
|
|
|
171
281
|
throw new Error('Error building cart');
|
|
172
282
|
}
|
|
173
283
|
submitGtag('zonos-checkout-start');
|
|
284
|
+
void trackConversionEvent('checkout_open');
|
|
174
285
|
}
|
|
175
286
|
catch (err) {
|
|
176
287
|
// stop loading
|
|
@@ -185,6 +296,14 @@ const ZonosCheckout$1 = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout ext
|
|
|
185
296
|
});
|
|
186
297
|
button.removeAttribute('disabled');
|
|
187
298
|
button.setAttribute('data-zonos-checkout-attached', 'true');
|
|
299
|
+
// if this button is the hidden button, trigger the click event
|
|
300
|
+
if (button.matches(this.domesticRedirectedBtnSelector)) {
|
|
301
|
+
button.dispatchEvent(new CustomEvent('click'));
|
|
302
|
+
// cleanup shipping session after button is clicked
|
|
303
|
+
stripeStoreCleanupDomesticShippingSession();
|
|
304
|
+
// remove the button after it's clicked
|
|
305
|
+
button.remove();
|
|
306
|
+
}
|
|
188
307
|
});
|
|
189
308
|
}
|
|
190
309
|
appearanceSettingsOverrideChanged() {
|
|
@@ -200,6 +319,25 @@ const ZonosCheckout$1 = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout ext
|
|
|
200
319
|
async init() {
|
|
201
320
|
stripeStore.stripe = window.Zonos.stripe;
|
|
202
321
|
this.stripe = window.Zonos.stripe;
|
|
322
|
+
// check if bigcommerce, if user enters the shipping address that's in the shipping zone at bigcommerce checkout
|
|
323
|
+
watchBigcommerceDomesticCheckout({
|
|
324
|
+
domesticRedirectedBtnSelector: this.domesticRedirectedBtnSelector,
|
|
325
|
+
onShippingAddressSessionFound: shippingAddressSession => {
|
|
326
|
+
// prefilled the default address if shipping address session is found for checkout on open
|
|
327
|
+
this.defaultAddress = {
|
|
328
|
+
address: {
|
|
329
|
+
city: shippingAddressSession.city,
|
|
330
|
+
country: shippingAddressSession.countryCode,
|
|
331
|
+
line1: shippingAddressSession.address1,
|
|
332
|
+
line2: shippingAddressSession.address2,
|
|
333
|
+
postal_code: shippingAddressSession.postalCode,
|
|
334
|
+
state: shippingAddressSession.state,
|
|
335
|
+
},
|
|
336
|
+
name: `${shippingAddressSession.firstName} ${shippingAddressSession.lastName}`,
|
|
337
|
+
phone: shippingAddressSession.phone,
|
|
338
|
+
};
|
|
339
|
+
},
|
|
340
|
+
});
|
|
203
341
|
const hideInternationalOrderInterval = setInterval(() => {
|
|
204
342
|
const internationalSelector = window.Zonos.internationalHideSelector;
|
|
205
343
|
if (!internationalSelector) {
|
|
@@ -208,7 +346,7 @@ const ZonosCheckout$1 = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout ext
|
|
|
208
346
|
return;
|
|
209
347
|
}
|
|
210
348
|
// hide the selector if it's international
|
|
211
|
-
const isInternationalOrder =
|
|
349
|
+
const isInternationalOrder = isShippableCountry(false);
|
|
212
350
|
const selector = document.querySelectorAll(internationalSelector);
|
|
213
351
|
if (!isInternationalOrder) {
|
|
214
352
|
// show the selector when it's domestic
|
|
@@ -303,8 +441,7 @@ const ZonosCheckout$1 = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout ext
|
|
|
303
441
|
cartStoreNextStep();
|
|
304
442
|
}
|
|
305
443
|
catch (err) {
|
|
306
|
-
|
|
307
|
-
console.error(err);
|
|
444
|
+
logError(err);
|
|
308
445
|
this.paymentError = true;
|
|
309
446
|
}
|
|
310
447
|
this.submitLoading = false;
|
|
@@ -430,6 +567,7 @@ const ZonosCheckout$1 = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout ext
|
|
|
430
567
|
"isMobile": [32],
|
|
431
568
|
"zonosReviewRef": [32],
|
|
432
569
|
"storybookPaymentStatusOverride": [32],
|
|
570
|
+
"domesticRedirectedBtnSelector": [32],
|
|
433
571
|
"closeDialogHandler": [64],
|
|
434
572
|
"init": [64],
|
|
435
573
|
"setToFinishStep": [64]
|
|
@@ -12,6 +12,7 @@ const ZonosCollapse = /*@__PURE__*/ proxyCustomElement(class ZonosCollapse exten
|
|
|
12
12
|
this.collapsed = false;
|
|
13
13
|
this.collapseSize = 0;
|
|
14
14
|
this.height = this.el.scrollHeight;
|
|
15
|
+
this.iframe = null;
|
|
15
16
|
}
|
|
16
17
|
getElementHeight() {
|
|
17
18
|
const fullHeight = `${this.height}px`;
|
|
@@ -23,12 +24,17 @@ const ZonosCollapse = /*@__PURE__*/ proxyCustomElement(class ZonosCollapse exten
|
|
|
23
24
|
}
|
|
24
25
|
componentDidRender() {
|
|
25
26
|
var _a, _b, _c;
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
this.iframe =
|
|
28
|
+
((_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('iframe')) || null;
|
|
29
|
+
(_c = (_b = this.iframe) === null || _b === void 0 ? void 0 : _b.contentWindow) === null || _c === void 0 ? void 0 : _c.addEventListener('resize', () => {
|
|
30
|
+
if (!this.iframe) {
|
|
31
|
+
// this should never happen since it's inside of resize callback
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
this.height = parseFloat(getComputedStyle(this.iframe).height);
|
|
28
35
|
});
|
|
29
36
|
}
|
|
30
37
|
render() {
|
|
31
|
-
this.height = this.el.scrollHeight;
|
|
32
38
|
if (!this.collapsed) {
|
|
33
39
|
// wait for the collapse animation to finish, then set overflow to visible
|
|
34
40
|
setTimeout(() => {
|
|
@@ -42,17 +48,18 @@ const ZonosCollapse = /*@__PURE__*/ proxyCustomElement(class ZonosCollapse exten
|
|
|
42
48
|
// set overflow to hidden to prevent content from showing when collapsed
|
|
43
49
|
this.el.style.overflow = 'hidden';
|
|
44
50
|
}
|
|
45
|
-
return (h(Host, { key: '
|
|
51
|
+
return (h(Host, { key: '7ac8b898feadfb4424b3b48a98135cb18994f4e0', class: 'zonos--elements zonos--collapse', style: {
|
|
46
52
|
'--font-family': zonosStoreFontFamily(),
|
|
47
53
|
height: this.getElementHeight(),
|
|
48
|
-
} }, h("div", { key: '
|
|
54
|
+
} }, h("div", { key: '4a527ec319b59041196284d4d9a8f22b943a74e6' }, h("iframe", { key: '2fb51c16e13ca90561b1b1e6cab89d87e4a37a47', class: "height-change-listener", tabindex: "-1", title: "collapse-height-change-listener" }), h("slot", { key: '6d7849f6c35be611446b0da36d657396e5ca3122' }))));
|
|
49
55
|
}
|
|
50
56
|
get el() { return this; }
|
|
51
57
|
static get style() { return ZonosCollapseStyle0; }
|
|
52
58
|
}, [1, "zonos-collapse", {
|
|
53
59
|
"collapsed": [4],
|
|
54
60
|
"collapseSize": [2, "collapse-size"],
|
|
55
|
-
"height": [32]
|
|
61
|
+
"height": [32],
|
|
62
|
+
"iframe": [32]
|
|
56
63
|
}]);
|
|
57
64
|
function defineCustomElement() {
|
|
58
65
|
if (typeof customElements === "undefined") {
|
|
@@ -20,7 +20,7 @@ const ZonosComponent$1 = /*@__PURE__*/ proxyCustomElement(class ZonosComponent e
|
|
|
20
20
|
return format(this.first, this.middle, this.last);
|
|
21
21
|
}
|
|
22
22
|
render() {
|
|
23
|
-
return h("div", { key: '
|
|
23
|
+
return h("div", { key: '3b7429a0c03b00f0a80e15a94bebd08aedaafe51' }, "Hello, World! I'm ", this.getText());
|
|
24
24
|
}
|
|
25
25
|
static get style() { return ZonosComponentStyle0; }
|
|
26
26
|
}, [1, "zonos-component", {
|