@zonos/elements 1.3.288 → 1.3.290
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-CV4buPlT.js → cart-7DceSLKl.js} +3 -3
- package/dist/cjs/{collect-jzWKzrV7.js → collect-C08DUE1L.js} +3 -3
- package/dist/cjs/{debounce-5sZmmlCI.js → debounce-Cd2emZPn.js} +2 -2
- package/dist/cjs/{debounce-Nu2lJW4A.js → debounce-vY0QYT6o.js} +1 -1
- package/dist/cjs/{getBorderRadius-DGZiQu09.js → getBorderRadius-CyYZw4qq.js} +1 -1
- package/dist/cjs/{getMissingRequiredShippingFields-r5vYIqoX.js → getMissingRequiredShippingFields-Duz8xpmf.js} +1 -1
- package/dist/cjs/{hasInclusivePrice-BZMQohG9.js → hasInclusivePrice-C-iyXqJ0.js} +1 -1
- package/dist/cjs/index.cjs.js +8 -9
- package/dist/cjs/{invoice-CHw-mJdS.js → invoice-DSuHUQpi.js} +3 -3
- package/dist/cjs/{localization-CxXsmxs5.js → localization-BJqYz_PB.js} +192 -69
- package/dist/cjs/{paypal-BLuHeOJH.js → paypal-CZoctP9S.js} +4 -4
- package/dist/cjs/{placeTestOrder-VK_CMeq0.js → placeTestOrder-D7baFuaV.js} +2 -2
- package/dist/cjs/{renderCheckoutCurrency-CC4CAy-a.js → renderCheckoutCurrency-Ca2HH1Gc.js} +2 -2
- package/dist/cjs/{shouldShowLanguageSelect-Bj_jKWPK.js → shouldShowLanguageSelect-FyTdz7U_.js} +1 -1
- package/dist/cjs/{submitGtag-CcEL-w5D.js → submitGtag-D79e8u6s.js} +1 -1
- package/dist/cjs/{throttle-BcxGntLr.js → throttle-zSVRQLC0.js} +2 -2
- package/dist/cjs/{updateCheckoutSessionAttributes-Dltl5RBx.js → updateCheckoutSessionAttributes-jMtfOL2m.js} +1 -1
- package/dist/cjs/zonos-address-completion-dialog_7.cjs.entry.js +11 -11
- package/dist/cjs/zonos-address-display_2.cjs.entry.js +3 -3
- package/dist/cjs/zonos-address_4.cjs.entry.js +8 -8
- package/dist/cjs/zonos-airwallex-payment.cjs.entry.js +5 -5
- package/dist/cjs/zonos-badge.cjs.entry.js +1 -1
- package/dist/cjs/zonos-banner.cjs.entry.js +1 -1
- package/dist/cjs/zonos-button_3.cjs.entry.js +2 -2
- package/dist/cjs/zonos-card_5.cjs.entry.js +7 -7
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +15 -15
- package/dist/cjs/zonos-checkbox_2.cjs.entry.js +2 -2
- package/dist/cjs/zonos-checkout.cjs.entry.js +12 -12
- package/dist/cjs/zonos-collapse.cjs.entry.js +1 -1
- package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +4 -4
- package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +11 -11
- package/dist/cjs/zonos-collect.cjs.entry.js +7 -7
- package/dist/cjs/zonos-controller.cjs.entry.js +7 -7
- package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +3 -3
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +3 -3
- package/dist/cjs/zonos-hello.cjs.entry.js +129 -51
- package/dist/cjs/zonos-input.cjs.entry.js +2 -2
- package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +6 -6
- package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +11 -11
- package/dist/cjs/zonos-invoice.cjs.entry.js +7 -7
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
- package/dist/cjs/zonos-logo.cjs.entry.js +1 -1
- package/dist/cjs/zonos-policy-consent_2.cjs.entry.js +5 -5
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +2 -2
- package/dist/cjs/zonos-stripe-input.cjs.entry.js +3 -3
- package/dist/cjs/zonos-text.cjs.entry.js +1 -1
- package/dist/cjs/zonos-v-stack.cjs.entry.js +1 -1
- package/dist/cjs/{zonosStore-BCNYr6Tk.js → zonosStore-Bx9jK82G.js} +2 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +1 -1
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-payment/zonos-collect-payment.js +1 -1
- package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-payment/zonos-invoice-payment.js +1 -1
- package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.js +1 -1
- package/dist/collection/components/hello/zonos-hello/zonos-hello.css +17 -15
- package/dist/collection/components/hello/zonos-hello/zonos-hello.js +29 -52
- package/dist/collection/components/main/zonos-controller.js +2 -2
- package/dist/collection/components/paypal/zonos-paypal-payment.js +1 -2
- package/dist/collection/components/store/hello/localization.js +69 -34
- package/dist/collection/components/store/zonosStore.js +2 -0
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +2 -2
- package/dist/collection/components/stripe/zonos-custom-address/zonos-address-suggestions/zonos-address-suggestions.js +2 -3
- package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.js +2 -2
- package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +0 -1
- package/dist/collection/components/utils/api/getLocalization.js +2 -2
- package/dist/collection/components/utils/checkout/isShippableCountry.js +2 -4
- package/dist/collection/components/utils/checkout/watchBigcommerceDomesticCheckout.js +1 -0
- package/dist/collection/components/utils/checkout/watchImmediateBigcommerceDomesticCheckoutRedirect.js +2 -0
- package/dist/collection/components/utils/formatDate.js +1 -3
- package/dist/collection/components/utils/getOverridenZCountry.js +3 -5
- package/dist/collection/components/utils/hello/countryOverrideStorage.js +49 -0
- package/dist/collection/components/utils/hello/getZCountryUrlParam.js +5 -9
- package/dist/collection/components/utils/hello/isCountryCode.js +1 -0
- package/dist/collection/components/utils/hello/isCountryInShippingZone.js +8 -0
- package/dist/collection/components/utils/hello/reconcileRememberedCountryOverride.js +37 -0
- package/dist/collection/components/utils/hello/resolveHelloFloatPlacement.js +98 -0
- package/dist/collection/components/utils/hello/shouldShowHelloWidget.js +27 -20
- package/dist/collection/environment.js +0 -1
- package/dist/collection/scripts/_stripe.js +0 -2
- package/dist/collection/scripts/_zonosBase.js +1 -1
- package/dist/collection/types/generated/graphql.frontend.types.js +218 -63
- package/dist/collection/types/generated/graphql.internal.types.js +815 -152
- package/dist/collection/utils/formattedCloudflareApiUrl.js +1 -0
- package/dist/collection/utils/generateCloudflareDeployUrl.js +5 -2
- package/dist/esm/{cart-ekBk_gxV.js → cart-Cleo1j5P.js} +3 -3
- package/dist/esm/{collect-33rMINDo.js → collect-CspdWIRo.js} +3 -3
- package/dist/esm/{debounce-D4ko2kvZ.js → debounce-BR3PaG8X.js} +1 -1
- package/dist/esm/{debounce-DWPsxJsW.js → debounce-CrmpwbEE.js} +2 -2
- package/dist/esm/{getBorderRadius-HwG64EKM.js → getBorderRadius-DYfkeXdx.js} +1 -1
- package/dist/esm/{getMissingRequiredShippingFields-u1nhQzJ1.js → getMissingRequiredShippingFields-B1IL1-gn.js} +1 -1
- package/dist/esm/{hasInclusivePrice-CAVXi310.js → hasInclusivePrice-DKRplpLX.js} +1 -1
- package/dist/esm/index.js +8 -9
- package/dist/esm/{invoice-BNDWuVsD.js → invoice-D49igPQ9.js} +3 -3
- package/dist/esm/{localization-AOqYXGdP.js → localization-BiL8bPsY.js} +192 -70
- package/dist/esm/{paypal-CW1D2XqZ.js → paypal-D4vWRxHJ.js} +4 -4
- package/dist/esm/{placeTestOrder-nhmsLLOA.js → placeTestOrder-BNmc5RCo.js} +2 -2
- package/dist/esm/{renderCheckoutCurrency-BQANmZyM.js → renderCheckoutCurrency-BNbwijGo.js} +2 -2
- package/dist/esm/{shouldShowLanguageSelect-BQFCXouB.js → shouldShowLanguageSelect-B82gTfHz.js} +1 -1
- package/dist/esm/{submitGtag-CCGQS060.js → submitGtag-df9AQ2zL.js} +1 -1
- package/dist/esm/{throttle-D5GyA3yr.js → throttle-Cvlvb-dm.js} +2 -2
- package/dist/esm/{updateCheckoutSessionAttributes-eRSqdC74.js → updateCheckoutSessionAttributes-4Jq6V4pO.js} +1 -1
- package/dist/esm/zonos-address-completion-dialog_7.entry.js +11 -11
- package/dist/esm/zonos-address-display_2.entry.js +3 -3
- package/dist/esm/zonos-address_4.entry.js +8 -8
- package/dist/esm/zonos-airwallex-payment.entry.js +5 -5
- package/dist/esm/zonos-badge.entry.js +1 -1
- package/dist/esm/zonos-banner.entry.js +1 -1
- package/dist/esm/zonos-button_3.entry.js +2 -2
- package/dist/esm/zonos-card_5.entry.js +7 -7
- package/dist/esm/zonos-cart-items_12.entry.js +15 -15
- package/dist/esm/zonos-checkbox_2.entry.js +2 -2
- package/dist/esm/zonos-checkout.entry.js +12 -12
- package/dist/esm/zonos-collapse.entry.js +1 -1
- package/dist/esm/zonos-collect-cart-items_3.entry.js +4 -4
- package/dist/esm/zonos-collect-finish_6.entry.js +11 -11
- package/dist/esm/zonos-collect.entry.js +7 -7
- package/dist/esm/zonos-controller.entry.js +7 -7
- package/dist/esm/zonos-country-flag.entry.js +2 -2
- package/dist/esm/zonos-country-select_4.entry.js +3 -3
- package/dist/esm/zonos-hello-dialog.entry.js +3 -3
- package/dist/esm/zonos-hello.entry.js +129 -51
- package/dist/esm/zonos-input.entry.js +2 -2
- package/dist/esm/zonos-invoice-cart-items_2.entry.js +6 -6
- package/dist/esm/zonos-invoice-finish_5.entry.js +11 -11
- package/dist/esm/zonos-invoice.entry.js +7 -7
- package/dist/esm/zonos-language-select_2.entry.js +2 -2
- package/dist/esm/zonos-logo.entry.js +1 -1
- package/dist/esm/zonos-policy-consent_2.entry.js +5 -5
- package/dist/esm/zonos-shipping-rich-radio.entry.js +2 -2
- package/dist/esm/zonos-stripe-input.entry.js +3 -3
- package/dist/esm/zonos-text.entry.js +1 -1
- package/dist/esm/zonos-v-stack.entry.js +1 -1
- package/dist/esm/{zonosStore-DrIOAz4M.js → zonosStore-msUlqmSD.js} +2 -0
- package/dist/esm-es5/{cart-ekBk_gxV.js → cart-Cleo1j5P.js} +8 -8
- package/dist/esm-es5/{collect-33rMINDo.js → collect-CspdWIRo.js} +1 -1
- package/dist/esm-es5/{debounce-D4ko2kvZ.js → debounce-BR3PaG8X.js} +7 -7
- package/dist/esm-es5/debounce-CrmpwbEE.js +1 -0
- package/dist/esm-es5/{getBorderRadius-HwG64EKM.js → getBorderRadius-DYfkeXdx.js} +1 -1
- package/dist/esm-es5/{getMissingRequiredShippingFields-u1nhQzJ1.js → getMissingRequiredShippingFields-B1IL1-gn.js} +3 -3
- package/dist/esm-es5/{hasInclusivePrice-CAVXi310.js → hasInclusivePrice-DKRplpLX.js} +1 -1
- package/dist/esm-es5/index.js +6 -8
- package/dist/esm-es5/{invoice-BNDWuVsD.js → invoice-D49igPQ9.js} +1 -1
- package/dist/esm-es5/{localization-AOqYXGdP.js → localization-BiL8bPsY.js} +74 -68
- package/dist/esm-es5/{paypal-CW1D2XqZ.js → paypal-D4vWRxHJ.js} +1 -1
- package/dist/esm-es5/{placeTestOrder-nhmsLLOA.js → placeTestOrder-BNmc5RCo.js} +1 -1
- package/dist/esm-es5/{renderCheckoutCurrency-BQANmZyM.js → renderCheckoutCurrency-BNbwijGo.js} +1 -1
- package/dist/esm-es5/{shouldShowLanguageSelect-BQFCXouB.js → shouldShowLanguageSelect-B82gTfHz.js} +1 -1
- package/dist/esm-es5/{submitGtag-CCGQS060.js → submitGtag-df9AQ2zL.js} +1 -1
- package/dist/esm-es5/{throttle-D5GyA3yr.js → throttle-Cvlvb-dm.js} +2 -2
- package/dist/esm-es5/{updateCheckoutSessionAttributes-eRSqdC74.js → updateCheckoutSessionAttributes-4Jq6V4pO.js} +1 -1
- package/dist/esm-es5/zonos-address-completion-dialog_7.entry.js +3 -3
- package/dist/esm-es5/zonos-address-display_2.entry.js +1 -1
- package/dist/esm-es5/zonos-address_4.entry.js +2 -2
- package/dist/esm-es5/zonos-airwallex-payment.entry.js +1 -1
- package/dist/esm-es5/zonos-badge.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_5.entry.js +2 -2
- package/dist/esm-es5/zonos-cart-items_12.entry.js +2 -2
- package/dist/esm-es5/zonos-checkbox_2.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +6 -6
- package/dist/esm-es5/zonos-collapse.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-finish_6.entry.js +2 -2
- package/dist/esm-es5/zonos-collect.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +3 -3
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_4.entry.js +2 -2
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +21 -24
- package/dist/esm-es5/zonos-input.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +2 -2
- package/dist/esm-es5/zonos-invoice-finish_5.entry.js +2 -2
- package/dist/esm-es5/zonos-invoice.entry.js +3 -3
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-logo.entry.js +1 -1
- package/dist/esm-es5/zonos-policy-consent_2.entry.js +1 -1
- package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
- package/dist/esm-es5/zonos-stripe-input.entry.js +2 -2
- package/dist/esm-es5/zonos-text.entry.js +1 -1
- package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
- package/dist/esm-es5/{zonosStore-DrIOAz4M.js → zonosStore-msUlqmSD.js} +1 -1
- package/dist/scripts/index.d.ts +36 -6
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/hello/zonos-hello/zonos-hello.d.ts +5 -3
- package/dist/types/components/store/hello/localization.d.ts +2 -1
- package/dist/types/components/utils/api/getLocalization.d.ts +3 -1
- package/dist/types/components/utils/getOverridenZCountry.d.ts +2 -3
- package/dist/types/components/utils/hello/countryOverrideStorage.d.ts +5 -0
- package/dist/types/components/utils/hello/isCountryCode.d.ts +2 -0
- package/dist/types/components/utils/hello/isCountryInShippingZone.d.ts +2 -0
- package/dist/types/components/utils/hello/reconcileRememberedCountryOverride.d.ts +18 -0
- package/dist/types/components/utils/hello/resolveHelloFloatPlacement.d.ts +39 -0
- package/dist/types/components/utils/hello/shouldShowHelloWidget.d.ts +8 -4
- package/dist/types/components.d.ts +4 -6
- package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +10 -0
- package/dist/types/types/generated/graphql.frontend.types.d.ts +41 -52
- package/dist/types/types/generated/graphql.frontend.types.ts +226 -114
- package/dist/types/types/generated/graphql.internal.types.d.ts +465 -100
- package/dist/types/types/generated/graphql.internal.types.ts +1007 -253
- package/dist/types/types/hello/HelloConfig.d.ts +12 -0
- package/dist/types/utils/formattedCloudflareApiUrl.d.ts +1 -0
- package/dist/types/utils/generateCloudflareDeployUrl.d.ts +5 -2
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-39c8a898.entry.js → p-028e0500.entry.js} +1 -1
- package/dist/zonos-elements/p-079af8c0.system.entry.js +118 -0
- package/dist/zonos-elements/{p-058f07aa.system.entry.js → p-0a4a7742.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-04cc0dac.system.entry.js → p-0dca8a26.system.entry.js} +47 -47
- package/dist/zonos-elements/{p-d33dfc78.system.entry.js → p-0ee74bf3.system.entry.js} +30 -30
- package/dist/zonos-elements/{p-e284d329.entry.js → p-11bab88b.entry.js} +1 -1
- package/dist/zonos-elements/{p-7a5d2211.system.entry.js → p-13d3a372.system.entry.js} +18 -18
- package/dist/zonos-elements/{p-1568ab06.system.entry.js → p-1409de3b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-8328f44d.entry.js → p-193d9722.entry.js} +1 -1
- package/dist/zonos-elements/{p-dcdbc610.system.entry.js → p-195f6e38.system.entry.js} +2 -2
- package/dist/zonos-elements/{p-daf9fa07.system.entry.js → p-1b77464d.system.entry.js} +16 -16
- package/dist/zonos-elements/{p-cc5306fe.system.entry.js → p-1bac5ac1.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-128485dc.entry.js → p-1c150f26.entry.js} +1 -1
- package/dist/zonos-elements/{p-cf5688f7.entry.js → p-234c202c.entry.js} +1 -1
- package/dist/zonos-elements/{p-5a631080.system.entry.js → p-23f6346b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-cc949df1.system.entry.js → p-244e0302.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-7681798d.entry.js → p-24f3c547.entry.js} +1 -1
- package/dist/zonos-elements/{p-5c08d36b.entry.js → p-2603dce0.entry.js} +1 -1
- package/dist/zonos-elements/{p-6b0afaa7.entry.js → p-26295311.entry.js} +1 -1
- package/dist/zonos-elements/{p-d4c4a00e.entry.js → p-34c5e145.entry.js} +1 -1
- package/dist/zonos-elements/{p-f6e0aeba.system.entry.js → p-35509b10.system.entry.js} +185 -185
- package/dist/zonos-elements/{p-4a54f664.entry.js → p-35539d3d.entry.js} +1 -1
- package/dist/zonos-elements/{p-5024df2d.system.entry.js → p-3c800376.system.entry.js} +61 -61
- package/dist/zonos-elements/{p-f8fd756a.system.entry.js → p-474e8a92.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-d55b9664.system.entry.js → p-481ecc23.system.entry.js} +20 -20
- package/dist/zonos-elements/{p-4973f8d8.system.entry.js → p-4fd78ecf.system.entry.js} +14 -14
- package/dist/zonos-elements/{p-8cd3f1e2.entry.js → p-52d9fd3a.entry.js} +1 -1
- package/dist/zonos-elements/{p-a6faab6a.entry.js → p-55916c90.entry.js} +1 -1
- package/dist/zonos-elements/p-5b06f069.entry.js +1 -0
- package/dist/zonos-elements/{p-5d3079e8.entry.js → p-5df25a1a.entry.js} +1 -1
- package/dist/zonos-elements/{p-450ed170.system.entry.js → p-5f347f91.system.entry.js} +3 -3
- package/dist/zonos-elements/{p-beeb9d36.system.entry.js → p-756d303f.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-5836d426.system.entry.js → p-79ddb12a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f27317d3.system.entry.js → p-7d284341.system.entry.js} +4 -4
- package/dist/zonos-elements/{p-f6ba59f6.system.entry.js → p-7e1050dd.system.entry.js} +10 -10
- package/dist/zonos-elements/{p-02ef0f99.system.entry.js → p-7ee2af6e.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-34d1545a.entry.js → p-83aa1c8c.entry.js} +1 -1
- package/dist/zonos-elements/{p-9818f823.entry.js → p-84c9ce16.entry.js} +1 -1
- package/dist/zonos-elements/{p-CaUXHglQ.system.js → p-8PPEbm_0.system.js} +9 -9
- package/dist/zonos-elements/{p-b6deae2b.system.entry.js → p-92fe9a1f.system.entry.js} +2 -2
- package/dist/zonos-elements/{p-f57495dc.entry.js → p-990b49f2.entry.js} +1 -1
- package/dist/zonos-elements/{p-cadf6b63.system.entry.js → p-9ef0f69e.system.entry.js} +10 -10
- package/dist/zonos-elements/{p-CZl1nwqv.system.js → p-B4Ufchqh.system.js} +3 -3
- package/dist/zonos-elements/{p-BtMauqj_.system.js → p-B5NDhB1w.system.js} +6 -8
- package/dist/zonos-elements/{p-CJCoACvU.js → p-BDrM4x5N.js} +2 -2
- package/dist/zonos-elements/p-BGktDPwA.system.js +1 -0
- package/dist/zonos-elements/{p-C19J2XSh.js → p-BJzAgoqz.js} +1 -1
- package/dist/zonos-elements/p-BKoLoalh.js +1 -0
- package/dist/zonos-elements/{p-Dj-O6VfM.system.js → p-BT9_ehlh.system.js} +2 -2
- package/dist/zonos-elements/{p-B2EZRfoq.system.js → p-B_5RofQ9.system.js} +15 -15
- package/dist/zonos-elements/p-BaF00SfB.js +1 -0
- package/dist/zonos-elements/{p-D0erXw7p.js → p-BpDCLBwW.js} +1 -1
- package/dist/zonos-elements/{p-DkpYo2Fs.js → p-BtWDzGMx.js} +1 -1
- package/dist/zonos-elements/p-Bu9WCfUC.system.js +1 -1
- package/dist/zonos-elements/{p-CPnR_T0a.system.js → p-BuU_p5DP.system.js} +58 -58
- package/dist/zonos-elements/{p-D5AtAlJx.system.js → p-CASTsiDR.system.js} +3 -3
- package/dist/zonos-elements/{p-CaAod213.system.js → p-CBx5nYet.system.js} +1 -1
- package/dist/zonos-elements/{p-DIJaXkiE.system.js → p-CEmXVahp.system.js} +111 -105
- package/dist/zonos-elements/{p-nU86HJ5w.js → p-CUaf1cEg.js} +1 -1
- package/dist/zonos-elements/p-CX_vfdWt.js +1 -0
- package/dist/zonos-elements/p-C_z9WL8a.js +1 -0
- package/dist/zonos-elements/p-CcJF6xhQ.js +1 -0
- package/dist/zonos-elements/{p-DjuFsKLG.js → p-CewmhMGk.js} +1 -1
- package/dist/zonos-elements/{p-CYdt69j5.system.js → p-Cpe_ISNt.system.js} +18 -18
- package/dist/zonos-elements/{p-DTgv0QpG.js → p-Cuk0LLGQ.js} +1 -1
- package/dist/zonos-elements/p-Cxuiqv1I.js +1 -0
- package/dist/zonos-elements/p-DQZncB2d.system.js +9 -0
- package/dist/zonos-elements/{p-D-DawUYF.system.js → p-DVITR-Eu.system.js} +1 -1
- package/dist/zonos-elements/{p-DGsEWFDU.system.js → p-DYIisqF7.system.js} +1 -1
- package/dist/zonos-elements/{p-uV7m6KrY.system.js → p-DoEHepOc.system.js} +1 -1
- package/dist/zonos-elements/{p-DHwpNxG9.js → p-DwkyNtpD.js} +1 -1
- package/dist/zonos-elements/{p-CKTIJ2Gr.js → p-NJVOYjda.js} +1 -1
- package/dist/zonos-elements/{p-CtEsvWI6.js → p-W82paT5F.js} +1 -1
- package/dist/zonos-elements/{p-04bfcd72.system.entry.js → p-a571beaa.system.entry.js} +13 -13
- package/dist/zonos-elements/{p-5562a955.system.entry.js → p-a5c25829.system.entry.js} +3 -3
- package/dist/zonos-elements/{p-b68ca96f.entry.js → p-a938c174.entry.js} +1 -1
- package/dist/zonos-elements/{p-844a743a.entry.js → p-ab54d0a1.entry.js} +1 -1
- package/dist/zonos-elements/{p-9ebe9a36.entry.js → p-acd50b0b.entry.js} +1 -1
- package/dist/zonos-elements/{p-0f603278.system.entry.js → p-b5882fbb.system.entry.js} +2 -2
- package/dist/zonos-elements/{p-891b47d7.entry.js → p-ba510730.entry.js} +1 -1
- package/dist/zonos-elements/{p-e9320825.entry.js → p-c3b02dbf.entry.js} +1 -1
- package/dist/zonos-elements/{p-be64d823.system.entry.js → p-c403f004.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-64e7bc5b.entry.js → p-c4ad6d4b.entry.js} +1 -1
- package/dist/zonos-elements/p-ca3175d9.entry.js +1 -0
- package/dist/zonos-elements/{p-a38e62cc.entry.js → p-d3d0656a.entry.js} +1 -1
- package/dist/zonos-elements/{p-9b6482ef.entry.js → p-d4d2b39e.entry.js} +1 -1
- package/dist/zonos-elements/{p-ea8790aa.entry.js → p-d6b72f6d.entry.js} +1 -1
- package/dist/zonos-elements/p-d74bc3e8.entry.js +1 -0
- package/dist/zonos-elements/p-db75322d.entry.js +1 -0
- package/dist/zonos-elements/p-dd8ca91e.entry.js +1 -0
- package/dist/zonos-elements/{p-7ae48e31.entry.js → p-ddca5ee1.entry.js} +1 -1
- package/dist/zonos-elements/{p-bdba7d9e.system.entry.js → p-dfc87b10.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-e101d722.system.entry.js → p-f37b8aaf.system.entry.js} +2 -2
- package/dist/zonos-elements/{p-b14819ab.system.entry.js → p-fb869759.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-i1iCWKdv.js → p-sz4L-ZnB.js} +1 -1
- package/dist/zonos-elements/{p-D31lQiWo.system.js → p-tGJYTlGL.system.js} +4 -4
- package/dist/zonos-elements/p-tkSf-lrO.system.js +13 -0
- package/dist/zonos-elements/{p-DPW1yXt9.system.js → p-uuZUZPIm.system.js} +61 -61
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +12 -11
- package/dist/esm-es5/debounce-DWPsxJsW.js +0 -1
- package/dist/zonos-elements/p-0466650f.entry.js +0 -1
- package/dist/zonos-elements/p-2ba738ec.entry.js +0 -1
- package/dist/zonos-elements/p-3ERbuo5a.js +0 -1
- package/dist/zonos-elements/p-6f742021.entry.js +0 -1
- package/dist/zonos-elements/p-89ddab88.entry.js +0 -1
- package/dist/zonos-elements/p-BANhKkF2.system.js +0 -1
- package/dist/zonos-elements/p-BJufDgh3.js +0 -1
- package/dist/zonos-elements/p-BSgVcCxT.system.js +0 -9
- package/dist/zonos-elements/p-CQqNJo0D.system.js +0 -13
- package/dist/zonos-elements/p-LypTHRUC.js +0 -1
- package/dist/zonos-elements/p-adfee3a3.entry.js +0 -1
- package/dist/zonos-elements/p-f2cedbcd.system.entry.js +0 -121
- package/dist/zonos-elements/p-lGLcGvEA.js +0 -1
- package/dist/zonos-elements/p-pfIceXbY.js +0 -1
- package/dist/zonos-elements/p-t_ClFAJR.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,h as e,F as s,a as t,g as n}from"./p-_lt63o7c.js";import{a1 as r,G as a,a2 as i,a3 as l,a4 as c,R as d,a5 as m,a6 as p,K as h}from"./p-DHwpNxG9.js";import{l as z,t as g}from"./p-DTgv0QpG.js";import{z as x,a as f}from"./p-CtEsvWI6.js";import{r as u}from"./p-pfIceXbY.js";import{g as y}from"./p-3ERbuo5a.js";import"./p-BJmZPrZl.js";import"./p-DE4a-QD5.js";import"./p-YdrG78th.js";import"./p-Cye-evFK.js";const v="POLICIES",b=class{constructor(e){o(this,e)}render(){const o=r();if(!o.length)return null;const n=Intl.ListFormat,i=(n?new n(z.selectedLocale,{style:"long",type:"conjunction"}).formatToParts(o.map((o=>o.name))):o.flatMap(((o,e)=>0===e?[{type:"element",value:o.name}]:[{type:"literal",value:", "},{type:"element",value:o.name}]))).map((s=>{if("literal"===s.type)return s.value;const t=o.find((o=>o.name===s.value));return t?e("a",{href:t.url,onClick:o=>{o.preventDefault(),o.stopPropagation(),window.open(t.url,"_blank","noopener,noreferrer")},rel:"noopener noreferrer",target:"_blank"},s.value):s.value})),l=x.organizationName,c=l?g("I agree to [merchantName]'s [policies]",{merchantName:l,policies:v}):g("I agree to the [policies]",{policies:v}),[d="",m=""]=c.split(v),p=a.showError,h="zonos--policy-consent-error";return e(t,{class:"zonos--policy-consent-host"},e("div",{class:"zonos--policy-consent"+(p?" zonos--policy-consent--error":"")},e("label",{class:"zonos--policy-consent-label"},e("input",{"aria-describedby":p?h:void 0,"aria-invalid":p?"true":"false",checked:a.accepted,class:"zonos--policy-consent-checkbox",disabled:a.locked,onChange:o=>{const e=o.target.checked;a.accepted=e,e?(a.acceptedAt||(a.acceptedAt=(new Date).toISOString()),a.showError=!1):a.acceptedAt=null},type:"checkbox"}),e("span",{class:"zonos--policy-consent-text"},d,e(s,null,i),m))),p&&e("div",{class:"zonos--policy-consent-error",id:h,role:"alert"},g("You must accept the policies to place this order")))}};b.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--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:block;margin-top:20px}.zonos--policy-consent{background-color:var(--zonos-elements-gray-50);border:1px solid var(--zonos-elements-gray-200);border-radius:8px;padding:12px 14px;-webkit-transition:border-color 0.15s ease, background-color 0.15s ease;transition:border-color 0.15s ease, background-color 0.15s ease}.zonos--policy-consent:hover{border-color:var(--zonos-elements-gray-300)}.zonos--policy-consent--error{background-color:var(--zonos-elements-red-50);border-color:var(--zonos-elements-red-400)}.zonos--policy-consent-label{-ms-flex-align:center;align-items:center;cursor:pointer;display:-ms-flexbox;display:flex;gap:10px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.zonos--policy-consent-checkbox{accent-color:var(--zonos-elements-blue-600);cursor:pointer;-ms-flex-negative:0;flex-shrink:0;height:18px;margin:0;width:18px}.zonos--policy-consent-text{color:var(--zonos-elements-gray-800);font-size:14px;line-height:1.45}.zonos--policy-consent-text a{color:var(--zonos-elements-blue-600);text-decoration:underline;text-underline-offset:2px}.zonos--policy-consent-text a:hover{color:var(--zonos-elements-blue-700)}.zonos--policy-consent-error{color:var(--zonos-elements-red-600);font-size:13px;line-height:1.4;margin-top:8px;padding:0 4px}";var k='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true">\n <path fill="currentColor" fill-rule="evenodd" d="M4 5a3 3 0 0 0-3 3v8a3 3 0 0 0 3 3h16a3 3 0 0 0 3-3V8a3 3 0 0 0-3-3H4Zm16 2H4a1 1 0 0 0-1 1v1h18V8a1 1 0 0 0-1-1ZM2 11h20v3a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-3Zm6 4.5a1 1 0 0 1 1-1h2a1 1 0 0 1 0 2H9a1 1 0 0 1-1-1Z" clip-rule="evenodd"/>\n</svg>\n';const w="full",C="custom",I=class{constructor(e){o(this,e),this.enabled=!0,this.customAmountInput="",this.handleUseStoreCreditChange=o=>{i(o),o&&l(!0),c()},this.handleAmountModeChange=o=>{const e=o===w;l(e),e||(this.customAmountInput=""),c()},this.handleCustomAmountChange=o=>{this.customAmountInput=o,d.error=null},this.handleApplyCustomAmount=()=>{const o=parseFloat(this.customAmountInput);!isNaN(o)&&o>0?m(o):m(null),d.error||c()}}async componentWillLoad(){await p()}render(){if(!this.enabled)return null;const{colorPrimary:o}=x.appearance,n=y({}),r=d.availableBalance,a=null!==r&&r>0,i=d.isEnabled,l=d.useFullBalance,c=d.error,m=h(),p=u({amount:null!=r?r:0,isForeign:!0});return e(t,{class:"zonos--elements zonos--store-credit",style:{"--zonos--border-radius":n,"--zonos--font-family":f(),"--zonos--primary-color":o}},e("div",{class:"zonos--store-credit-container"},e("div",{class:"zonos--store-credit-header"},e("div",{class:"zonos--store-credit-title-row"},e("div",{class:"zonos--store-credit-title-left"},e("div",{"aria-hidden":"true",class:"zonos--store-credit-title-icon"},e("zonos-icon",{content:k,iconColor:"gray-500",size:22})),e("zonos-text",{type:"semiBoldLabel"},g("Store credit"))),a&&e("div",{class:"zonos--store-credit-balance-badge"},e("zonos-text",{textColor:"gray-600",type:"caption"},p)))),e(s,null,a?e("div",{class:"zonos--store-credit-content"},e("div",{class:"zonos--store-credit-checkbox"},e("zonos-checkbox",{isChecked:i,label:g("Use store credit"),onCheckboxSelected:o=>this.handleUseStoreCreditChange(o.detail),size:16})),i&&e("div",{class:"zonos--store-credit-options"},e("div",{class:"zonos--store-credit-toggle-row"},e("zonos-toggle",{onToggleChanged:o=>this.handleAmountModeChange(o.detail),options:[{label:g("Apply full balance"),value:w},{label:g("Enter amount"),value:C}],value:l?w:C})),!l&&e("div",{class:"zonos--store-credit-custom-amount"},e("div",{class:"zonos--store-credit-custom-amount-row"},e("zonos-input",{inputLabel:g("Enter amount"),inputValue:this.customAmountInput,isError:!!c,onInputChange:o=>this.handleCustomAmountChange(o.detail)}),e("zonos-button",{onClick:this.handleApplyCustomAmount,size:"sm",variant:"primary"},g("Apply")))),c&&e("div",{class:"zonos--store-credit-error"},e("zonos-text",{textColor:"red-600",type:"caption"},c)),e("div",{class:"zonos--store-credit-summary"},e("zonos-text",{textColor:"gray-800",type:"semiBoldLabel"},g("Amount to apply: [amount]",{amount:u({amount:m,isForeign:!0})}))))):e("div",{class:"zonos--store-credit-empty"},e("div",{"aria-hidden":"true",class:"zonos--store-credit-empty-icon"},e("zonos-icon",{content:k,iconColor:"gray-500",size:28})),e("zonos-text",{textColor:"gray-600",type:"caption"},g("No store credit available"))))))}get el(){return n(this)}};I.style=':host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--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:block;margin-bottom:var(--zonos-elements-font-size-xl)}:host .zonos--store-credit-container{background:-webkit-gradient(linear, left top, left bottom, from(var(--zonos-elements-gray-0)), to(var(--zonos-elements-gray-50)));background:linear-gradient(180deg, var(--zonos-elements-gray-0) 0%, var(--zonos-elements-gray-50) 100%);border:1px solid var(--zonos-elements-gray-200);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-8));-webkit-box-shadow:var(--zonos-elements-v3-shadow-base);box-shadow:var(--zonos-elements-v3-shadow-base);overflow:hidden;padding:0;position:relative}:host .zonos--store-credit-container::before{background:var(--zonos--primary-color, var(--zonos-elements-gray-400));content:"";height:3px;left:0;position:absolute;right:0;top:0}:host .zonos--store-credit-header{padding:var(--zonos-elements-radius-12) var(--zonos-elements-font-size-l) 0}:host .zonos--store-credit-title-row{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .zonos--store-credit-title-left{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:var(--zonos-elements-font-size-s)}:host .zonos--store-credit-title-icon{-ms-flex-align:center;align-items:center;background:color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 14%, transparent);border-radius:calc(var(--zonos--border-radius, var(--zonos-elements-radius-8)) * 0.75);display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0;height:22px;-ms-flex-pack:center;justify-content:center;width:22px}:host .zonos--store-credit-balance-badge{background:color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 8%, var(--zonos-elements-gray-50));border:1px solid color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 22%, var(--zonos-elements-gray-200));border-radius:calc(var(--zonos--border-radius, var(--zonos-elements-radius-8)) * 0.65);padding:2px var(--zonos-elements-font-size-s)}:host .zonos--store-credit-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--zonos-elements-font-size-s);padding:var(--zonos-elements-font-size-s) var(--zonos-elements-font-size-l) var(--zonos-elements-radius-12)}:host .zonos--store-credit-checkbox{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex}:host .zonos--store-credit-options{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--zonos-elements-font-size-s)}:host .zonos--store-credit-toggle-row{display:-ms-flexbox;display:flex}:host .zonos--store-credit-custom-amount{max-width:240px}:host .zonos--store-credit-custom-amount-row{-ms-flex-align:end;align-items:flex-end;display:-ms-flexbox;display:flex;gap:var(--zonos-elements-font-size-s)}:host .zonos--store-credit-custom-amount-row zonos-input{-ms-flex:1;flex:1}:host .zonos--store-credit-error{margin-top:2px}:host .zonos--store-credit-summary{background:color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 6%, var(--zonos-elements-gray-50));border-radius:calc(var(--zonos--border-radius, var(--zonos-elements-radius-8)) * 0.65);padding:var(--zonos-elements-radius-10) var(--zonos-elements-font-size-s)}:host .zonos--store-credit-empty{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--zonos-elements-font-size-s);padding:var(--zonos-elements-font-size-xl) var(--zonos-elements-font-size-l) 22px;text-align:center}:host .zonos--store-credit-empty-icon{-ms-flex-align:center;align-items:center;background:var(--zonos-elements-gray-100);border-radius:50%;display:-ms-flexbox;display:flex;height:52px;-ms-flex-pack:center;justify-content:center;opacity:0.95;width:52px}';export{b as zonos_policy_consent,I as zonos_store_credit}
|
|
1
|
+
import{r as o,h as e,F as s,a as t,g as n}from"./p-_lt63o7c.js";import{a1 as r,G as a,a2 as i,a3 as l,a4 as c,R as d,a5 as m,a6 as p,K as z}from"./p-DwkyNtpD.js";import{l as h,t as g}from"./p-Cuk0LLGQ.js";import{z as x,a as f}from"./p-W82paT5F.js";import{r as u}from"./p-CX_vfdWt.js";import{g as y}from"./p-C_z9WL8a.js";import"./p-BJmZPrZl.js";import"./p-DE4a-QD5.js";import"./p-YdrG78th.js";import"./p-Cye-evFK.js";const v="POLICIES",b=class{constructor(e){o(this,e)}render(){const o=r();if(!o.length)return null;const n=Intl.ListFormat,i=(n?new n(h.selectedLocale,{style:"long",type:"conjunction"}).formatToParts(o.map((o=>o.name))):o.flatMap(((o,e)=>0===e?[{type:"element",value:o.name}]:[{type:"literal",value:", "},{type:"element",value:o.name}]))).map((s=>{if("literal"===s.type)return s.value;const t=o.find((o=>o.name===s.value));return t?e("a",{href:t.url,onClick:o=>{o.preventDefault(),o.stopPropagation(),window.open(t.url,"_blank","noopener,noreferrer")},rel:"noopener noreferrer",target:"_blank"},s.value):s.value})),l=x.organizationName,c=l?g("I agree to [merchantName]'s [policies]",{merchantName:l,policies:v}):g("I agree to the [policies]",{policies:v}),[d="",m=""]=c.split(v),p=a.showError,z="zonos--policy-consent-error";return e(t,{class:"zonos--policy-consent-host"},e("div",{class:"zonos--policy-consent"+(p?" zonos--policy-consent--error":"")},e("label",{class:"zonos--policy-consent-label"},e("input",{"aria-describedby":p?z:void 0,"aria-invalid":p?"true":"false",checked:a.accepted,class:"zonos--policy-consent-checkbox",disabled:a.locked,onChange:o=>{const e=o.target.checked;a.accepted=e,e?(a.acceptedAt||(a.acceptedAt=(new Date).toISOString()),a.showError=!1):a.acceptedAt=null},type:"checkbox"}),e("span",{class:"zonos--policy-consent-text"},d,e(s,null,i),m))),p&&e("div",{class:"zonos--policy-consent-error",id:z,role:"alert"},g("You must accept the policies to place this order")))}};b.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--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:block;margin-top:20px}.zonos--policy-consent{background-color:var(--zonos-elements-gray-50);border:1px solid var(--zonos-elements-gray-200);border-radius:8px;padding:12px 14px;-webkit-transition:border-color 0.15s ease, background-color 0.15s ease;transition:border-color 0.15s ease, background-color 0.15s ease}.zonos--policy-consent:hover{border-color:var(--zonos-elements-gray-300)}.zonos--policy-consent--error{background-color:var(--zonos-elements-red-50);border-color:var(--zonos-elements-red-400)}.zonos--policy-consent-label{-ms-flex-align:center;align-items:center;cursor:pointer;display:-ms-flexbox;display:flex;gap:10px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.zonos--policy-consent-checkbox{accent-color:var(--zonos-elements-blue-600);cursor:pointer;-ms-flex-negative:0;flex-shrink:0;height:18px;margin:0;width:18px}.zonos--policy-consent-text{color:var(--zonos-elements-gray-800);font-size:14px;line-height:1.45}.zonos--policy-consent-text a{color:var(--zonos-elements-blue-600);text-decoration:underline;text-underline-offset:2px}.zonos--policy-consent-text a:hover{color:var(--zonos-elements-blue-700)}.zonos--policy-consent-error{color:var(--zonos-elements-red-600);font-size:13px;line-height:1.4;margin-top:8px;padding:0 4px}";var k='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true">\n <path fill="currentColor" fill-rule="evenodd" d="M4 5a3 3 0 0 0-3 3v8a3 3 0 0 0 3 3h16a3 3 0 0 0 3-3V8a3 3 0 0 0-3-3H4Zm16 2H4a1 1 0 0 0-1 1v1h18V8a1 1 0 0 0-1-1ZM2 11h20v3a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-3Zm6 4.5a1 1 0 0 1 1-1h2a1 1 0 0 1 0 2H9a1 1 0 0 1-1-1Z" clip-rule="evenodd"/>\n</svg>\n';const w="full",C="custom",j=class{constructor(e){o(this,e),this.enabled=!0,this.customAmountInput="",this.handleUseStoreCreditChange=o=>{i(o),o&&l(!0),c()},this.handleAmountModeChange=o=>{const e=o===w;l(e),e||(this.customAmountInput=""),c()},this.handleCustomAmountChange=o=>{this.customAmountInput=o,d.error=null},this.handleApplyCustomAmount=()=>{const o=parseFloat(this.customAmountInput);!isNaN(o)&&o>0?m(o):m(null),d.error||c()}}async componentWillLoad(){await p()}render(){if(!this.enabled)return null;const{colorPrimary:o}=x.appearance,n=y({}),r=d.availableBalance,a=null!==r&&r>0,i=d.isEnabled,l=d.useFullBalance,c=d.error,m=z(),p=u({amount:null!=r?r:0,isForeign:!0});return e(t,{class:"zonos--elements zonos--store-credit",style:{"--zonos--border-radius":n,"--zonos--font-family":f(),"--zonos--primary-color":o}},e("div",{class:"zonos--store-credit-container"},e("div",{class:"zonos--store-credit-header"},e("div",{class:"zonos--store-credit-title-row"},e("div",{class:"zonos--store-credit-title-left"},e("div",{"aria-hidden":"true",class:"zonos--store-credit-title-icon"},e("zonos-icon",{content:k,iconColor:"gray-500",size:22})),e("zonos-text",{type:"semiBoldLabel"},g("Store credit"))),a&&e("div",{class:"zonos--store-credit-balance-badge"},e("zonos-text",{textColor:"gray-600",type:"caption"},p)))),e(s,null,a?e("div",{class:"zonos--store-credit-content"},e("div",{class:"zonos--store-credit-checkbox"},e("zonos-checkbox",{isChecked:i,label:g("Use store credit"),onCheckboxSelected:o=>this.handleUseStoreCreditChange(o.detail),size:16})),i&&e("div",{class:"zonos--store-credit-options"},e("div",{class:"zonos--store-credit-toggle-row"},e("zonos-toggle",{onToggleChanged:o=>this.handleAmountModeChange(o.detail),options:[{label:g("Apply full balance"),value:w},{label:g("Enter amount"),value:C}],value:l?w:C})),!l&&e("div",{class:"zonos--store-credit-custom-amount"},e("div",{class:"zonos--store-credit-custom-amount-row"},e("zonos-input",{inputLabel:g("Enter amount"),inputValue:this.customAmountInput,isError:!!c,onInputChange:o=>this.handleCustomAmountChange(o.detail)}),e("zonos-button",{onClick:this.handleApplyCustomAmount,size:"sm",variant:"primary"},g("Apply")))),c&&e("div",{class:"zonos--store-credit-error"},e("zonos-text",{textColor:"red-600",type:"caption"},c)),e("div",{class:"zonos--store-credit-summary"},e("zonos-text",{textColor:"gray-800",type:"semiBoldLabel"},g("Amount to apply: [amount]",{amount:u({amount:m,isForeign:!0})}))))):e("div",{class:"zonos--store-credit-empty"},e("div",{"aria-hidden":"true",class:"zonos--store-credit-empty-icon"},e("zonos-icon",{content:k,iconColor:"gray-500",size:28})),e("zonos-text",{textColor:"gray-600",type:"caption"},g("No store credit available"))))))}get el(){return n(this)}};j.style=':host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--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:block;margin-bottom:var(--zonos-elements-font-size-xl)}:host .zonos--store-credit-container{background:-webkit-gradient(linear, left top, left bottom, from(var(--zonos-elements-gray-0)), to(var(--zonos-elements-gray-50)));background:linear-gradient(180deg, var(--zonos-elements-gray-0) 0%, var(--zonos-elements-gray-50) 100%);border:1px solid var(--zonos-elements-gray-200);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-8));-webkit-box-shadow:var(--zonos-elements-v3-shadow-base);box-shadow:var(--zonos-elements-v3-shadow-base);overflow:hidden;padding:0;position:relative}:host .zonos--store-credit-container::before{background:var(--zonos--primary-color, var(--zonos-elements-gray-400));content:"";height:3px;left:0;position:absolute;right:0;top:0}:host .zonos--store-credit-header{padding:var(--zonos-elements-radius-12) var(--zonos-elements-font-size-l) 0}:host .zonos--store-credit-title-row{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .zonos--store-credit-title-left{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:var(--zonos-elements-font-size-s)}:host .zonos--store-credit-title-icon{-ms-flex-align:center;align-items:center;background:color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 14%, transparent);border-radius:calc(var(--zonos--border-radius, var(--zonos-elements-radius-8)) * 0.75);display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0;height:22px;-ms-flex-pack:center;justify-content:center;width:22px}:host .zonos--store-credit-balance-badge{background:color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 8%, var(--zonos-elements-gray-50));border:1px solid color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 22%, var(--zonos-elements-gray-200));border-radius:calc(var(--zonos--border-radius, var(--zonos-elements-radius-8)) * 0.65);padding:2px var(--zonos-elements-font-size-s)}:host .zonos--store-credit-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--zonos-elements-font-size-s);padding:var(--zonos-elements-font-size-s) var(--zonos-elements-font-size-l) var(--zonos-elements-radius-12)}:host .zonos--store-credit-checkbox{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex}:host .zonos--store-credit-options{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--zonos-elements-font-size-s)}:host .zonos--store-credit-toggle-row{display:-ms-flexbox;display:flex}:host .zonos--store-credit-custom-amount{max-width:240px}:host .zonos--store-credit-custom-amount-row{-ms-flex-align:end;align-items:flex-end;display:-ms-flexbox;display:flex;gap:var(--zonos-elements-font-size-s)}:host .zonos--store-credit-custom-amount-row zonos-input{-ms-flex:1;flex:1}:host .zonos--store-credit-error{margin-top:2px}:host .zonos--store-credit-summary{background:color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 6%, var(--zonos-elements-gray-50));border-radius:calc(var(--zonos--border-radius, var(--zonos-elements-radius-8)) * 0.65);padding:var(--zonos-elements-radius-10) var(--zonos-elements-font-size-s)}:host .zonos--store-credit-empty{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--zonos-elements-font-size-s);padding:var(--zonos-elements-font-size-xl) var(--zonos-elements-font-size-l) 22px;text-align:center}:host .zonos--store-credit-empty-icon{-ms-flex-align:center;align-items:center;background:var(--zonos-elements-gray-100);border-radius:50%;display:-ms-flexbox;display:flex;height:52px;-ms-flex-pack:center;justify-content:center;opacity:0.95;width:52px}';export{b as zonos_policy_consent,j as zonos_store_credit}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,h as s,a as e,F as t}from"./p-_lt63o7c.js";import{c,a as l,b as n,d as i,e as a,f as r,g as z,h as d,i as h}from"./p-DjuFsKLG.js";import{b as m,i as p,d as u,c as f,r as g,e as b,k as x,l as w,z as v,E as y,J as k,H as C,f as j}from"./p-DHwpNxG9.js";import{p as I,a as S}from"./p-CJCoACvU.js";import{s as L,t as E,e as A,h as T,j as D,l as O}from"./p-DTgv0QpG.js";import{z as U}from"./p-CtEsvWI6.js";import{b as P}from"./p-BycjkdlE.js";import{h as N,s as _,l as B,g as R}from"./p-DE4a-QD5.js";import{i as W,a as F}from"./p-DGlnuxEX.js";import{c as H}from"./p-BJHSB96f.js";import{l as X}from"./p-BJmZPrZl.js";import{r as G}from"./p-BXjdMMUy.js";import"./p-YdrG78th.js";import"./p-3ERbuo5a.js";import"./p-Cye-evFK.js";import"./p-CICjAi70.js";import"./p-i1iCWKdv.js";const K=class{constructor(s){o(this,s),this.storeUnsubscribeList=[],this.onChangeLocaleListener=()=>{},this.mobile=!1,this.tablet=!1,this.stripe=window.Zonos.stripe,this.showLanguageDialogMobile=!1,this.submitLoading=!1,this.collapseReview=!0,this.isMobile=!1,this.isTablet=!1,this.isOverlayLoading=!0,this.isCartCollected=!1,this.isCartExpired=!1,this.payInUsdConfirmDialogOpen=!1,this.inventoryCheckErrorMessage=null,this.confirmationId=null,this.clientSecret=m.clientSecret,this.stripeCustomerSessionClientSecret=m.stripeCustomerSessionClientSecret,this.getBaseCurrencySettlementInfo=()=>{const o=u.selectedLandedCost;if(!o)return null;const{landedCost:{amountSubtotals:s}}=o;return s?{settlementAmount:(s.discounts||0)+s.items+s.landedCostTotal+s.shipping}:null},this.applyStripeTheme=async()=>{const o=U.appearance.theme;await p({overrideTheme:this.isMobile?o:void 0,paypalEnabled:I()})},this.fetchCheckoutSession=async o=>{const{json:s}=await N("/api/zonos-elements/collect/get-checkout-session",{body:{checkoutSessionId:o},method:"POST"});return s},this.initPaymentProcessor=async()=>{var o;const s=L.checkoutSessionId;if(s){const e=await this.fetchCheckoutSession(s);if(c.paymentProcessor=(null==e?void 0:e.checkoutSession.paymentProcessor)||null,"AIRWALLEX"===c.paymentProcessor){if(!e||!l(e.checkoutSession))throw new Error("Airwallex checkout session is missing a client secret");const{checkoutSession:s}=e;n.currency=u.currency,this.confirmationId=(null===(o=s.landedCost)||void 0===o?void 0:o.shortId)||null;let t=!!s.completedAt||!!s.order;if(!t&&s.clientSecret&&s.paymentIntentId){const{status:o}=await i(s.paymentIntentId);t=a(o)}return t?void this.setToFinishStep():void r()}}this.applyStripeTheme()},this.checkStripePaymentIntentStatus=async()=>{var o;const s=!!window.Zonos.cartData,e=new URL(window.location.href).searchParams,t=e.get("payment_intent_client_secret"),c=e.get("zonosCheckoutSessionId");if(X("Payment intent exist, checking stripe payment intent status"),!t)return X("No stripe client secret found in the URL, proceed to order if cart data is available"),{shouldAllowOrder:s};const{error:l,status:n}=await f({clientSecret:t});if(new URLSearchParams(window.location.search).get("redirect_status")&&c){X(l?"Payment intent failed, show status from error":"Payment intent is succeeded or in a good state to move forward, show success screen");const s=await this.fetchCheckoutSession(c);return this.confirmationId=(null===(o=null==s?void 0:s.checkoutSession.landedCost)||void 0===o?void 0:o.shortId)||null,L.checkoutSessionId=c,m.clientSecret=t,this.setToFinishStep(n),{shouldAllowOrder:!1}}return s?(X("Payment intent is not succeeded, proceed to order"),{shouldAllowOrder:!0}):(X("Cart data is not available, only check payment intent status, skip order."),{shouldAllowOrder:!1})},this.recoverCompletedCollectSession=async o=>{var s;const e=await this.fetchCheckoutSession(o);if(!e)return!1;const{checkoutSession:t}=e;this.confirmationId=(null===(s=t.landedCost)||void 0===s?void 0:s.shortId)||null,c.paymentProcessor=t.paymentProcessor||null;const r="AIRWALLEX"===t.paymentProcessor;if(r&&t.clientSecret&&(l(t),n.currency=u.currency),t.completedAt||t.order)return this.setToFinishStep("succeeded"),!0;if(r){if(t.clientSecret&&t.paymentIntentId){const{status:o}=await i(t.paymentIntentId);if(a(o))return this.setToFinishStep(),!0}}else if(t.clientSecret){const{status:o}=await f({clientSecret:t.clientSecret});if("processing"===o||"succeeded"===o)return m.clientSecret=t.clientSecret,this.setToFinishStep(o),!0}return!1}}resizeListener(){this.isMobile=W(this.mobile),this.isTablet=F(this.tablet)}async setToFinishStep(o){m.stripe=window.Zonos.stripe,u.step="finish",this.storybookPaymentStatusOverride=o,this.isOverlayLoading=!1}async initCollectCart(){var o,s,e,t,l,i,a,r,h,m,p;if(!window.Zonos.cartData)return;const f=null===(s=null===(o=window.Zonos.cartData)||void 0===o?void 0:o.items[0])||void 0===s?void 0:s.currencyCode;f&&(u.currency=f);const v=null===(t=null===(e=window.Zonos.cartData)||void 0===e?void 0:e.references)||void 0===t?void 0:t.checkoutSessionId,y=null===(i=null===(l=window.Zonos.cartData)||void 0===l?void 0:l.references)||void 0===i?void 0:i.landedCostId;if(!y)return void g({messages:[E("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:U.organizationName})],title:E("Invalid session")});v?(X("Setting checkout session id from cart reference","info",v),L.checkoutSessionId=v):(X("Clear checkout session id from storage so we start from a fresh session for the collect cart"),L.checkoutSessionId=null);const{shouldAllowOrder:k}=await this.checkStripePaymentIntentStatus();if(k){try{const{adjustments:o,cartItems:s}=P(window.Zonos.cartData);if(await b({adjustments:o,cartItems:s,landedCostId:y,shouldInitSessionOnFailure:!1}),!L.checkoutSessionId&&!v){const o=await x();if(X(`stripeStoreInitCheckoutSession: ${o}`),!o)throw new Error("Failed to initialize checkout session! The cart might be created with LIVE Collect quote but being used with sandbox credential")}if((!u.checkoutSession||(null===(a=u.checkoutSession)||void 0===a?void 0:a.completedAt))&&v){if(await this.recoverCompletedCollectSession(v))return;throw _({endpoint:"INVALID_COLLECT_CHECKOUT_SESSION",errors:["Invalid checkout session, can not retrieve the checkout session after failing to update it"],metadata:{cartCheckoutSessionId:v,cartId:null===(r=window.Zonos.cartData)||void 0===r?void 0:r.id,cartLandedCostId:y}}),new Error("Invalid checkout session, can not retrieve the checkout session after failing to update it")}if(!u.checkoutSession)throw _({endpoint:"FAIL_TO_UPDATE_CREATE_CHECKOUT_SESSION",errors:["Could not update/create checkout session for this collect cart"],metadata:{cartCheckoutSessionId:v||"N/A",cartId:null===(h=window.Zonos.cartData)||void 0===h?void 0:h.id,cartLandedCostId:y||"N/A"}}),new Error("Could not update/create checkout session for this collect cart");c.paymentProcessor=u.checkoutSession.paymentProcessor,"AIRWALLEX"===c.paymentProcessor?(await w(),(null===(m=u.checkoutSession)||void 0===m?void 0:m.clientSecret)&&(n.clientSecret=u.checkoutSession.clientSecret,n.currency=u.currency)):w();const e=null===(p=u.checkoutSession)||void 0===p?void 0:p.landedCost;if(!e)throw new Error("Landed cost could not be found in checkout session after creating/updating them");await z(Object.assign(Object.assign({},u.checkoutSession),{id:L.checkoutSessionId||""})),d({landedCostId:e.id}),await this.initPaymentProcessor()}catch(o){B(o),g({messages:[E("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:U.organizationName})],title:E("Invalid session")})}this.isOverlayLoading=!1}}toggleLanguageDialog(){this.showLanguageDialogMobile=!this.showLanguageDialogMobile}async handleStripePaymentContinue(){var o,s,e,t;if(null===(o=m.stripeBillingAddressElement)||void 0===o||o.getValue(),null===(s=m.stripeLinkEventData)||void 0===s?void 0:s.complete)if(null===(e=m.stripeBillingAddressEventData)||void 0===e?void 0:e.complete)if("USD"!==m.checkoutSettlementCurrency||!m.shouldRenderPayInUsdButton||this.payInUsdConfirmDialogOpen){if(this.payInUsdConfirmDialogOpen=!1,S.paypalErrorMessage=null,m.hasPaymentError=!1,this.submitLoading=!0,u.inventoryCheckErrorMessage=null,!await v())return m.hasPaymentError=!0,m.customErrorMessage=E("Unable to complete payment in [currency]. Please try again or select a different currency. If the issue persists, contact our support team for assistance.",{currency:m.checkoutSettlementCurrency}),void(this.submitLoading=!1);await h();try{return await y({noLandedCostCheck:!0}),u.step="finish",void(this.confirmationId=c.landedCostShortId||(null===(t=u.selectedLandedCost)||void 0===t?void 0:t.landedCostId)||null)}catch(o){B(o),m.hasPaymentError=!0}this.submitLoading=!1}else this.payInUsdConfirmDialogOpen=!0;else{const o=document.querySelector(".zonos--billing-address");null==o||o.scrollIntoView({behavior:"smooth"})}else{const o=document.querySelector("zonos-link-authentication");null==o||o.scrollIntoView({behavior:"smooth"})}}componentWillLoad(){m.stripe=window.Zonos.stripe,u.step="payment",this.initCollectCart(),this.resizeListener(),this.storeUnsubscribeList=[k("clientSecret",(()=>{this.applyStripeTheme()})),A("selectedLocale",(()=>{this.applyStripeTheme()}))],X(`mobile: ${this.isMobile}`)}disconnectedCallback(){C(),j(),this.onChangeLocaleListener(),this.storeUnsubscribeList.forEach((o=>o()))}render(){this.clientSecret=m.clientSecret,m.stripeCustomerSessionClientSecret&&(this.stripeCustomerSessionClientSecret=m.stripeCustomerSessionClientSecret);const o=this.getBaseCurrencySettlementInfo(),{logoUrl:l,theme:n}=U.appearance,i=c.originCompanyName,a=()=>{var o;const e=c.collectLogoUrl?c.collectLogoUrl:(null===(o=U.genericSettings)||void 0===o?void 0:o.shouldFallbackToOrganizationLogoForCollect)&&l?`${l}?timestamp=${Date.now()}`:"";return e?s("div",{class:"zonos--logo"},s("img",{alt:`${i||U.organizationName} logo`,src:e})):null},r=R(),z=()=>{var o;const e=new URLSearchParams(window.location.search),l=e.get("zonosQaUrl"),n=e.get("zonosDebug"),z=null===(o=D.find((o=>o.code===O.selectedLocale)))||void 0===o?void 0:o.label;return s(t,null,s("zonos-h-stack",{class:"zonos--header-wrapper",spacing:16},s("div",{class:"zonos--logo-wrapper"},a(),r&&s("zonos-badge",{badgeColor:"orange",size:"small"},E("Test mode")),"1"===n&&s("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),l&&s("zonos-badge",{badgeColor:"purple",size:"small"},l)),s("div",{class:"zonos--header-right"},s("zonos-button",{backgroundColor:"gray-0",class:"zonos--header-right-button",onClick:()=>this.toggleLanguageDialog(),variant:"outline"},z,s("zonos-icon",{"aria-label":"Language select",content:'<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>',iconColor:"gray-1200"})),s("div",{class:H(["zonos--collect-language-dialog",this.showLanguageDialogMobile&&"zonos--collect-language-dialog-open"])},s("zonos-language-select",{handleOnClose:()=>this.toggleLanguageDialog()})))),G({content:s("zonos-text",{class:"zonos--header-title",type:"header"},i?E("Customs charges for your recent purchase from [companyName] are available for payment",{companyName:i}):E("Customs charges from your recent purchase are available for payment")),isLoading:c.isFetchingShippingInfo,skeletonHeight:"34px",skeletonWidth:"600px"}))};return s(e,{class:H(["zonos--collect zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"]),"data-theme":n},(()=>this.isOverlayLoading||m.isFetchingSession?null:s("div",{class:"zonos--content"},"finish"!==u.step&&"error"!==u.step&&s(t,null,(this.isMobile||this.isTablet)&&z(),s("div",{class:"zonos--left","data-theme":n},!this.isMobile&&!this.isTablet&&z(),"AIRWALLEX"!==c.paymentProcessor&&s(t,null,s("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},E("Billing info")),s("zonos-v-stack",{spacing:16},s("zonos-link-authentication",{titleText:""}),s("zonos-address",{titleText:"",type:"billing"}))),s("zonos-collect-payment",{class:H(["zonos--collect-container"]),continueLoading:this.submitLoading,onAirwallexPaymentDone:()=>{var o;u.step="finish",this.confirmationId=c.landedCostShortId||(null===(o=u.selectedLandedCost)||void 0===o?void 0:o.landedCostId)||null},onContinueClicked:async()=>{await this.handleStripePaymentContinue()}})),s("div",{class:"zonos--right","data-theme":n},s("zonos-collect-review",{mobile:this.isMobile,tablet:this.isTablet}),s("div",{class:"zonos--order-details-container"},s("zonos-collect-order-details",{collapsed:this.collapseReview,mobile:this.isMobile,onCollapseClicked:()=>{this.collapseReview=!this.collapseReview}})),s("div",{class:"flex--wrapper"},s("zonos-v-stack",{spacing:16},s("zonos-collect-subtotal",null)),!this.isMobile&&!this.isTablet&&s("zonos-collect-footer",{"data-theme":n,mobile:this.isMobile,tablet:this.isTablet})))),("finish"===u.step||"error"===u.step)&&s("div",{class:"zonos--done","data-theme":n},s("div",{class:"zonos--header"},a()),s("zonos-collect-finish",{confirmationId:this.confirmationId,overrideNotification:"error"===u.step&&u.error?Object.assign(Object.assign({},u.error),{type:"error"}):void 0,storybookForceStatus:this.storybookPaymentStatusOverride})),(this.isMobile||this.isTablet||"finish"===u.step||"error"===u.step)&&s("zonos-collect-footer",{"data-theme":n,mobile:this.isMobile,tablet:this.isTablet})))(),o&&s("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:E("Cancel"),dialogConfirmBtnText:E("Pay [orderTotal]",{orderTotal:T({amount:o.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:E("By paying in USD, your card will be charged directly with no currency conversion. However, using a non-USD based card may result in additional currency conversion fees at the bank level."),dialogTitle:E("Pay in USD (United States Dollar)?"),dialogType:"confirm",dialogWidth:480,onCancelClicked:()=>{this.payInUsdConfirmDialogOpen=!1},onConfirmClicked:()=>this.handleStripePaymentContinue()}),s("zonos-loading-overlay",{open:this.isOverlayLoading}))}static get assetsDirs(){return["assets"]}};K.style=".sc-zonos-collect-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-collect-h *.sc-zonos-collect{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-collect-h img.sc-zonos-collect{max-width:100%}.sc-zonos-collect-h dl.sc-zonos-collect,.sc-zonos-collect-h dd.sc-zonos-collect,.sc-zonos-collect-h h1.sc-zonos-collect,.sc-zonos-collect-h h2.sc-zonos-collect,.sc-zonos-collect-h h3.sc-zonos-collect,.sc-zonos-collect-h h4.sc-zonos-collect,.sc-zonos-collect-h h5.sc-zonos-collect,.sc-zonos-collect-h h6.sc-zonos-collect,.sc-zonos-collect-h hr.sc-zonos-collect,.sc-zonos-collect-h figure.sc-zonos-collect,.sc-zonos-collect-h p.sc-zonos-collect,.sc-zonos-collect-h pre.sc-zonos-collect{margin:0}.sc-zonos-collect-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-collect-h{z-index:2147483647;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;top:0;left:0;width:100%;height:100%;-ms-flex-align:center;align-items:center;background-color:var(--zonos-elements-gray-0)}.sc-zonos-collect-h *.sc-zonos-collect{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar{width:10px}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-collect-h .zonos--content.sc-zonos-collect{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;width:100%;-ms-flex-pack:center;justify-content:center}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{-ms-flex:1;flex:1;padding:56px 80px 60px;max-width:800px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect{background-color:var(--zonos--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200);overflow:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:32px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{background-color:var(--zonos-elements-gray-0)}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect{display:-ms-flexbox;display:flex;width:100%;max-width:1400px;height:calc(100% - 100px);overflow:auto;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:start;justify-content:flex-start;padding:24px;padding-bottom:50px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect .zonos--header.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect .zonos--logo.sc-zonos-collect{margin-bottom:0}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect zonos-collect-finish.sc-zonos-collect{-ms-flex:1;flex:1;min-height:0}.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{max-width:800px}.sc-zonos-collect-h .zonos--left.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-collect-h .zonos--left.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{padding:0 8px 8px}.sc-zonos-collect-h .zonos--left.sc-zonos-collect .zonos--payment-error-banner.sc-zonos-collect{margin-top:24px}.sc-zonos-collect-h .zonos--right.sc-zonos-collect{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-collect-h .zonos--right.sc-zonos-collect .zonos--order-details-container.sc-zonos-collect{overflow:hidden}.sc-zonos-collect-h .zonos--wrapper.sc-zonos-collect{overflow:auto;max-height:100%;position:relative}.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%;margin-top:32px}.sc-zonos-collect-h .zonos--logo-wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center;-ms-flex:1;flex:1}.sc-zonos-collect-h .zonos--logo-wrapper.sc-zonos-collect>*.sc-zonos-collect{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-collect-h .zonos--header-right.sc-zonos-collect{display:none}.sc-zonos-collect-h .zonos--logo.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-collect-h .zonos--logo.sc-zonos-collect img.sc-zonos-collect{max-height:70px;max-width:100%;-o-object-position:left center;object-position:left center;-o-object-fit:contain;object-fit:contain}.sc-zonos-collect-h .zonos--collect-container.sc-zonos-collect{overflow:visible}.mobile.sc-zonos-collect-h,.tablet.sc-zonos-collect-h{min-width:auto}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{padding-bottom:0}}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--review.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--review.sc-zonos-collect{margin-bottom:0}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--cart-items.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--cart-items.sc-zonos-collect{margin-top:8px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect zonos-checkout-footer.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect zonos-checkout-footer.sc-zonos-collect{-ms-flex-order:3;order:3}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{max-height:100%}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--footer.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--footer.sc-zonos-collect{-ms-flex-order:3;order:3}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect{width:auto}.mobile.sc-zonos-collect-h .zonos--cart-subtotal.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--cart-subtotal.sc-zonos-collect{margin:0}.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{position:-webkit-sticky;position:sticky;top:0;width:100%;padding:16px;background-color:var(--zonos-elements-gray-0);z-index:3}.mobile.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{max-width:800px;padding:0 16px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect{overflow:auto;-ms-flex-pack:unset;justify-content:unset;-ms-flex-align:center;align-items:center;gap:24px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{overflow:visible;width:100%}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{gap:32px}.mobile.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect{margin-top:0}.mobile.sc-zonos-collect-h zonos-collect-footer.sc-zonos-collect,.tablet.sc-zonos-collect-h zonos-collect-footer.sc-zonos-collect{-ms-flex-order:3;order:3;left:0}.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{padding-top:56px;top:-56px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--header-right.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{padding-top:28px;top:-28px}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect{position:fixed;left:0;right:0;bottom:0;-webkit-transform-origin:bottom center;transform-origin:bottom center;width:100vw;background:var(--zonos-elements-surface-color);-webkit-box-shadow:var(--zonos-elements-v3-shadow-xl);box-shadow:var(--zonos-elements-v3-shadow-xl);border-radius:var(--zonos-elements-radius-12);max-width:100vw;max-height:500px;z-index:2147483011;overflow:auto;-webkit-transform:scale(0);transform:scale(0);opacity:0;-webkit-transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;-ms-scroll-chaining:none;overscroll-behavior:contain}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar{width:10px}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.zonos--collect-language-dialog-open.sc-zonos-collect{opacity:1;-webkit-transform:scale(1);transform:scale(1)}.iframed.sc-zonos-collect-h .zonos--content.sc-zonos-collect{-ms-scroll-chaining:chained;overscroll-behavior:auto}";export{K as zonos_collect}
|
|
1
|
+
import{r as o,h as s,a as e,F as t}from"./p-_lt63o7c.js";import{c,a as l,b as n,d as i,e as a,f as r,g as z,h as d,i as h}from"./p-CewmhMGk.js";import{b as m,i as p,d as u,c as f,r as g,e as b,k as w,l as x,z as v,E as y,J as k,H as C,f as j}from"./p-DwkyNtpD.js";import{p as S,a as I}from"./p-BDrM4x5N.js";import{s as L,t as A,h as E,j as T,k as D,l as O}from"./p-Cuk0LLGQ.js";import{z as U}from"./p-W82paT5F.js";import{b as P}from"./p-BycjkdlE.js";import{h as N,s as _,l as B,g as R}from"./p-DE4a-QD5.js";import{i as W,a as F}from"./p-DGlnuxEX.js";import{c as H}from"./p-BJHSB96f.js";import{l as X}from"./p-BJmZPrZl.js";import{r as M}from"./p-BXjdMMUy.js";import"./p-YdrG78th.js";import"./p-C_z9WL8a.js";import"./p-Cye-evFK.js";import"./p-CICjAi70.js";import"./p-sz4L-ZnB.js";const $=class{constructor(s){o(this,s),this.storeUnsubscribeList=[],this.onChangeLocaleListener=()=>{},this.mobile=!1,this.tablet=!1,this.stripe=window.Zonos.stripe,this.showLanguageDialogMobile=!1,this.submitLoading=!1,this.collapseReview=!0,this.isMobile=!1,this.isTablet=!1,this.isOverlayLoading=!0,this.isCartCollected=!1,this.isCartExpired=!1,this.payInUsdConfirmDialogOpen=!1,this.inventoryCheckErrorMessage=null,this.confirmationId=null,this.clientSecret=m.clientSecret,this.stripeCustomerSessionClientSecret=m.stripeCustomerSessionClientSecret,this.getBaseCurrencySettlementInfo=()=>{const o=u.selectedLandedCost;if(!o)return null;const{landedCost:{amountSubtotals:s}}=o;return s?{settlementAmount:(s.discounts||0)+s.items+s.landedCostTotal+s.shipping}:null},this.applyStripeTheme=async()=>{const o=U.appearance.theme;await p({overrideTheme:this.isMobile?o:void 0,paypalEnabled:S()})},this.fetchCheckoutSession=async o=>{const{json:s}=await N("/api/zonos-elements/collect/get-checkout-session",{body:{checkoutSessionId:o},method:"POST"});return s},this.initPaymentProcessor=async()=>{var o;const s=L.checkoutSessionId;if(s){const e=await this.fetchCheckoutSession(s);if(c.paymentProcessor=(null==e?void 0:e.checkoutSession.paymentProcessor)||null,"AIRWALLEX"===c.paymentProcessor){if(!e||!l(e.checkoutSession))throw new Error("Airwallex checkout session is missing a client secret");const{checkoutSession:s}=e;n.currency=u.currency,this.confirmationId=(null===(o=s.landedCost)||void 0===o?void 0:o.shortId)||null;let t=!!s.completedAt||!!s.order;if(!t&&s.clientSecret&&s.paymentIntentId){const{status:o}=await i(s.paymentIntentId);t=a(o)}return t?void this.setToFinishStep():void r()}}this.applyStripeTheme()},this.checkStripePaymentIntentStatus=async()=>{var o;const s=!!window.Zonos.cartData,e=new URL(window.location.href).searchParams,t=e.get("payment_intent_client_secret"),c=e.get("zonosCheckoutSessionId");if(X("Payment intent exist, checking stripe payment intent status"),!t)return X("No stripe client secret found in the URL, proceed to order if cart data is available"),{shouldAllowOrder:s};const{error:l,status:n}=await f({clientSecret:t});if(new URLSearchParams(window.location.search).get("redirect_status")&&c){X(l?"Payment intent failed, show status from error":"Payment intent is succeeded or in a good state to move forward, show success screen");const s=await this.fetchCheckoutSession(c);return this.confirmationId=(null===(o=null==s?void 0:s.checkoutSession.landedCost)||void 0===o?void 0:o.shortId)||null,L.checkoutSessionId=c,m.clientSecret=t,this.setToFinishStep(n),{shouldAllowOrder:!1}}return s?(X("Payment intent is not succeeded, proceed to order"),{shouldAllowOrder:!0}):(X("Cart data is not available, only check payment intent status, skip order."),{shouldAllowOrder:!1})},this.recoverCompletedCollectSession=async o=>{var s;const e=await this.fetchCheckoutSession(o);if(!e)return!1;const{checkoutSession:t}=e;this.confirmationId=(null===(s=t.landedCost)||void 0===s?void 0:s.shortId)||null,c.paymentProcessor=t.paymentProcessor||null;const r="AIRWALLEX"===t.paymentProcessor;if(r&&t.clientSecret&&(l(t),n.currency=u.currency),t.completedAt||t.order)return this.setToFinishStep("succeeded"),!0;if(r){if(t.clientSecret&&t.paymentIntentId){const{status:o}=await i(t.paymentIntentId);if(a(o))return this.setToFinishStep(),!0}}else if(t.clientSecret){const{status:o}=await f({clientSecret:t.clientSecret});if("processing"===o||"succeeded"===o)return m.clientSecret=t.clientSecret,this.setToFinishStep(o),!0}return!1}}resizeListener(){this.isMobile=W(this.mobile),this.isTablet=F(this.tablet)}async setToFinishStep(o){m.stripe=window.Zonos.stripe,u.step="finish",this.storybookPaymentStatusOverride=o,this.isOverlayLoading=!1}async initCollectCart(){var o,s,e,t,l,i,a,r,h,m,p;if(!window.Zonos.cartData)return;const f=null===(s=null===(o=window.Zonos.cartData)||void 0===o?void 0:o.items[0])||void 0===s?void 0:s.currencyCode;f&&(u.currency=f);const v=null===(t=null===(e=window.Zonos.cartData)||void 0===e?void 0:e.references)||void 0===t?void 0:t.checkoutSessionId,y=null===(i=null===(l=window.Zonos.cartData)||void 0===l?void 0:l.references)||void 0===i?void 0:i.landedCostId;if(!y)return void g({messages:[A("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:U.organizationName})],title:A("Invalid session")});v?(X("Setting checkout session id from cart reference","info",v),L.checkoutSessionId=v):(X("Clear checkout session id from storage so we start from a fresh session for the collect cart"),L.checkoutSessionId=null);const{shouldAllowOrder:k}=await this.checkStripePaymentIntentStatus();if(k){try{const{adjustments:o,cartItems:s}=P(window.Zonos.cartData);if(await b({adjustments:o,cartItems:s,landedCostId:y,shouldInitSessionOnFailure:!1}),!L.checkoutSessionId&&!v){const o=await w();if(X(`stripeStoreInitCheckoutSession: ${o}`),!o)throw new Error("Failed to initialize checkout session! The cart might be created with LIVE Collect quote but being used with sandbox credential")}if((!u.checkoutSession||(null===(a=u.checkoutSession)||void 0===a?void 0:a.completedAt))&&v){if(await this.recoverCompletedCollectSession(v))return;throw _({endpoint:"INVALID_COLLECT_CHECKOUT_SESSION",errors:["Invalid checkout session, can not retrieve the checkout session after failing to update it"],metadata:{cartCheckoutSessionId:v,cartId:null===(r=window.Zonos.cartData)||void 0===r?void 0:r.id,cartLandedCostId:y}}),new Error("Invalid checkout session, can not retrieve the checkout session after failing to update it")}if(!u.checkoutSession)throw _({endpoint:"FAIL_TO_UPDATE_CREATE_CHECKOUT_SESSION",errors:["Could not update/create checkout session for this collect cart"],metadata:{cartCheckoutSessionId:v||"N/A",cartId:null===(h=window.Zonos.cartData)||void 0===h?void 0:h.id,cartLandedCostId:y||"N/A"}}),new Error("Could not update/create checkout session for this collect cart");c.paymentProcessor=u.checkoutSession.paymentProcessor,"AIRWALLEX"===c.paymentProcessor?(await x(),(null===(m=u.checkoutSession)||void 0===m?void 0:m.clientSecret)&&(n.clientSecret=u.checkoutSession.clientSecret,n.currency=u.currency)):x();const e=null===(p=u.checkoutSession)||void 0===p?void 0:p.landedCost;if(!e)throw new Error("Landed cost could not be found in checkout session after creating/updating them");await z(Object.assign(Object.assign({},u.checkoutSession),{id:L.checkoutSessionId||""})),d({landedCostId:e.id}),await this.initPaymentProcessor()}catch(o){B(o),g({messages:[A("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:U.organizationName})],title:A("Invalid session")})}this.isOverlayLoading=!1}}toggleLanguageDialog(){this.showLanguageDialogMobile=!this.showLanguageDialogMobile}async handleStripePaymentContinue(){var o,s,e,t;if(null===(o=m.stripeBillingAddressElement)||void 0===o||o.getValue(),null===(s=m.stripeLinkEventData)||void 0===s?void 0:s.complete)if(null===(e=m.stripeBillingAddressEventData)||void 0===e?void 0:e.complete)if("USD"!==m.checkoutSettlementCurrency||!m.shouldRenderPayInUsdButton||this.payInUsdConfirmDialogOpen){if(this.payInUsdConfirmDialogOpen=!1,I.paypalErrorMessage=null,m.hasPaymentError=!1,this.submitLoading=!0,u.inventoryCheckErrorMessage=null,!await v())return m.hasPaymentError=!0,m.customErrorMessage=A("Unable to complete payment in [currency]. Please try again or select a different currency. If the issue persists, contact our support team for assistance.",{currency:m.checkoutSettlementCurrency}),void(this.submitLoading=!1);await h();try{return await y({noLandedCostCheck:!0}),u.step="finish",void(this.confirmationId=c.landedCostShortId||(null===(t=u.selectedLandedCost)||void 0===t?void 0:t.landedCostId)||null)}catch(o){B(o),m.hasPaymentError=!0}this.submitLoading=!1}else this.payInUsdConfirmDialogOpen=!0;else{const o=document.querySelector(".zonos--billing-address");null==o||o.scrollIntoView({behavior:"smooth"})}else{const o=document.querySelector("zonos-link-authentication");null==o||o.scrollIntoView({behavior:"smooth"})}}componentWillLoad(){m.stripe=window.Zonos.stripe,u.step="payment",this.initCollectCart(),this.resizeListener(),this.storeUnsubscribeList=[k("clientSecret",(()=>{this.applyStripeTheme()})),E("selectedLocale",(()=>{this.applyStripeTheme()}))],X(`mobile: ${this.isMobile}`)}disconnectedCallback(){C(),j(),this.onChangeLocaleListener(),this.storeUnsubscribeList.forEach((o=>o()))}render(){this.clientSecret=m.clientSecret,m.stripeCustomerSessionClientSecret&&(this.stripeCustomerSessionClientSecret=m.stripeCustomerSessionClientSecret);const o=this.getBaseCurrencySettlementInfo(),{logoUrl:l,theme:n}=U.appearance,i=c.originCompanyName,a=()=>{var o;const e=c.collectLogoUrl?c.collectLogoUrl:(null===(o=U.genericSettings)||void 0===o?void 0:o.shouldFallbackToOrganizationLogoForCollect)&&l?`${l}?timestamp=${Date.now()}`:"";return e?s("div",{class:"zonos--logo"},s("img",{alt:`${i||U.organizationName} logo`,src:e})):null},r=R(),z=()=>{var o;const e=new URLSearchParams(window.location.search),l=e.get("zonosQaUrl"),n=e.get("zonosDebug"),z=null===(o=D.find((o=>o.code===O.selectedLocale)))||void 0===o?void 0:o.label;return s(t,null,s("zonos-h-stack",{class:"zonos--header-wrapper",spacing:16},s("div",{class:"zonos--logo-wrapper"},a(),r&&s("zonos-badge",{badgeColor:"orange",size:"small"},A("Test mode")),"1"===n&&s("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),l&&s("zonos-badge",{badgeColor:"purple",size:"small"},l)),s("div",{class:"zonos--header-right"},s("zonos-button",{backgroundColor:"gray-0",class:"zonos--header-right-button",onClick:()=>this.toggleLanguageDialog(),variant:"outline"},z,s("zonos-icon",{"aria-label":"Language select",content:'<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>',iconColor:"gray-1200"})),s("div",{class:H(["zonos--collect-language-dialog",this.showLanguageDialogMobile&&"zonos--collect-language-dialog-open"])},s("zonos-language-select",{handleOnClose:()=>this.toggleLanguageDialog()})))),M({content:s("zonos-text",{class:"zonos--header-title",type:"header"},i?A("Customs charges for your recent purchase from [companyName] are available for payment",{companyName:i}):A("Customs charges from your recent purchase are available for payment")),isLoading:c.isFetchingShippingInfo,skeletonHeight:"34px",skeletonWidth:"600px"}))};return s(e,{class:H(["zonos--collect zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"]),"data-theme":n},(()=>this.isOverlayLoading||m.isFetchingSession?null:s("div",{class:"zonos--content"},"finish"!==u.step&&"error"!==u.step&&s(t,null,(this.isMobile||this.isTablet)&&z(),s("div",{class:"zonos--left","data-theme":n},!this.isMobile&&!this.isTablet&&z(),"AIRWALLEX"!==c.paymentProcessor&&s(t,null,s("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},A("Billing info")),s("zonos-v-stack",{spacing:16},s("zonos-link-authentication",{titleText:""}),s("zonos-address",{titleText:"",type:"billing"}))),s("zonos-collect-payment",{class:H(["zonos--collect-container"]),continueLoading:this.submitLoading,onAirwallexPaymentDone:()=>{var o;u.step="finish",this.confirmationId=c.landedCostShortId||(null===(o=u.selectedLandedCost)||void 0===o?void 0:o.landedCostId)||null},onContinueClicked:async()=>{await this.handleStripePaymentContinue()}})),s("div",{class:"zonos--right","data-theme":n},s("zonos-collect-review",{mobile:this.isMobile,tablet:this.isTablet}),s("div",{class:"zonos--order-details-container"},s("zonos-collect-order-details",{collapsed:this.collapseReview,mobile:this.isMobile,onCollapseClicked:()=>{this.collapseReview=!this.collapseReview}})),s("div",{class:"flex--wrapper"},s("zonos-v-stack",{spacing:16},s("zonos-collect-subtotal",null)),!this.isMobile&&!this.isTablet&&s("zonos-collect-footer",{"data-theme":n,mobile:this.isMobile,tablet:this.isTablet})))),("finish"===u.step||"error"===u.step)&&s("div",{class:"zonos--done","data-theme":n},s("div",{class:"zonos--header"},a()),s("zonos-collect-finish",{confirmationId:this.confirmationId,overrideNotification:"error"===u.step&&u.error?Object.assign(Object.assign({},u.error),{type:"error"}):void 0,storybookForceStatus:this.storybookPaymentStatusOverride})),(this.isMobile||this.isTablet||"finish"===u.step||"error"===u.step)&&s("zonos-collect-footer",{"data-theme":n,mobile:this.isMobile,tablet:this.isTablet})))(),o&&s("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:A("Cancel"),dialogConfirmBtnText:A("Pay [orderTotal]",{orderTotal:T({amount:o.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:A("By paying in USD, your card will be charged directly with no currency conversion. However, using a non-USD based card may result in additional currency conversion fees at the bank level."),dialogTitle:A("Pay in USD (United States Dollar)?"),dialogType:"confirm",dialogWidth:480,onCancelClicked:()=>{this.payInUsdConfirmDialogOpen=!1},onConfirmClicked:()=>this.handleStripePaymentContinue()}),s("zonos-loading-overlay",{open:this.isOverlayLoading}))}static get assetsDirs(){return["assets"]}};$.style=".sc-zonos-collect-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-collect-h *.sc-zonos-collect{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-collect-h img.sc-zonos-collect{max-width:100%}.sc-zonos-collect-h dl.sc-zonos-collect,.sc-zonos-collect-h dd.sc-zonos-collect,.sc-zonos-collect-h h1.sc-zonos-collect,.sc-zonos-collect-h h2.sc-zonos-collect,.sc-zonos-collect-h h3.sc-zonos-collect,.sc-zonos-collect-h h4.sc-zonos-collect,.sc-zonos-collect-h h5.sc-zonos-collect,.sc-zonos-collect-h h6.sc-zonos-collect,.sc-zonos-collect-h hr.sc-zonos-collect,.sc-zonos-collect-h figure.sc-zonos-collect,.sc-zonos-collect-h p.sc-zonos-collect,.sc-zonos-collect-h pre.sc-zonos-collect{margin:0}.sc-zonos-collect-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-collect-h{z-index:2147483647;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;top:0;left:0;width:100%;height:100%;-ms-flex-align:center;align-items:center;background-color:var(--zonos-elements-gray-0)}.sc-zonos-collect-h *.sc-zonos-collect{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar{width:10px}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-collect-h .zonos--content.sc-zonos-collect{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;width:100%;-ms-flex-pack:center;justify-content:center}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{-ms-flex:1;flex:1;padding:56px 80px 60px;max-width:800px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect{background-color:var(--zonos--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200);overflow:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:32px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{background-color:var(--zonos-elements-gray-0)}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect{display:-ms-flexbox;display:flex;width:100%;max-width:1400px;height:calc(100% - 100px);overflow:auto;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:start;justify-content:flex-start;padding:24px;padding-bottom:50px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect .zonos--header.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect .zonos--logo.sc-zonos-collect{margin-bottom:0}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect zonos-collect-finish.sc-zonos-collect{-ms-flex:1;flex:1;min-height:0}.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{max-width:800px}.sc-zonos-collect-h .zonos--left.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-collect-h .zonos--left.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{padding:0 8px 8px}.sc-zonos-collect-h .zonos--left.sc-zonos-collect .zonos--payment-error-banner.sc-zonos-collect{margin-top:24px}.sc-zonos-collect-h .zonos--right.sc-zonos-collect{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-collect-h .zonos--right.sc-zonos-collect .zonos--order-details-container.sc-zonos-collect{overflow:hidden}.sc-zonos-collect-h .zonos--wrapper.sc-zonos-collect{overflow:auto;max-height:100%;position:relative}.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%;margin-top:32px}.sc-zonos-collect-h .zonos--logo-wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center;-ms-flex:1;flex:1}.sc-zonos-collect-h .zonos--logo-wrapper.sc-zonos-collect>*.sc-zonos-collect{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-collect-h .zonos--header-right.sc-zonos-collect{display:none}.sc-zonos-collect-h .zonos--logo.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-collect-h .zonos--logo.sc-zonos-collect img.sc-zonos-collect{max-height:70px;max-width:100%;-o-object-position:left center;object-position:left center;-o-object-fit:contain;object-fit:contain}.sc-zonos-collect-h .zonos--collect-container.sc-zonos-collect{overflow:visible}.mobile.sc-zonos-collect-h,.tablet.sc-zonos-collect-h{min-width:auto}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{padding-bottom:0}}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--review.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--review.sc-zonos-collect{margin-bottom:0}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--cart-items.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--cart-items.sc-zonos-collect{margin-top:8px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect zonos-checkout-footer.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect zonos-checkout-footer.sc-zonos-collect{-ms-flex-order:3;order:3}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{max-height:100%}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--footer.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--footer.sc-zonos-collect{-ms-flex-order:3;order:3}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect{width:auto}.mobile.sc-zonos-collect-h .zonos--cart-subtotal.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--cart-subtotal.sc-zonos-collect{margin:0}.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{position:-webkit-sticky;position:sticky;top:0;width:100%;padding:16px;background-color:var(--zonos-elements-gray-0);z-index:3}.mobile.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{max-width:800px;padding:0 16px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect{overflow:auto;-ms-flex-pack:unset;justify-content:unset;-ms-flex-align:center;align-items:center;gap:24px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{overflow:visible;width:100%}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{gap:32px}.mobile.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect{margin-top:0}.mobile.sc-zonos-collect-h zonos-collect-footer.sc-zonos-collect,.tablet.sc-zonos-collect-h zonos-collect-footer.sc-zonos-collect{-ms-flex-order:3;order:3;left:0}.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{padding-top:56px;top:-56px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--header-right.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{padding-top:28px;top:-28px}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect{position:fixed;left:0;right:0;bottom:0;-webkit-transform-origin:bottom center;transform-origin:bottom center;width:100vw;background:var(--zonos-elements-surface-color);-webkit-box-shadow:var(--zonos-elements-v3-shadow-xl);box-shadow:var(--zonos-elements-v3-shadow-xl);border-radius:var(--zonos-elements-radius-12);max-width:100vw;max-height:500px;z-index:2147483011;overflow:auto;-webkit-transform:scale(0);transform:scale(0);opacity:0;-webkit-transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;-ms-scroll-chaining:none;overscroll-behavior:contain}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar{width:10px}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.zonos--collect-language-dialog-open.sc-zonos-collect{opacity:1;-webkit-transform:scale(1);transform:scale(1)}.iframed.sc-zonos-collect-h .zonos--content.sc-zonos-collect{-ms-scroll-chaining:chained;overscroll-behavior:auto}";export{$ as zonos_collect}
|