@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,4 +1,4 @@
|
|
|
1
|
-
import{f as require_root,h as require_baseGetTag,i as requireIsObjectLike,r as requireIsObject}from"./zonosStore-
|
|
1
|
+
import{f as require_root,h as require_baseGetTag,i as requireIsObjectLike,r as requireIsObject}from"./zonosStore-msUlqmSD.js";var now_1;var hasRequiredNow;function requireNow(){if(hasRequiredNow)return now_1;hasRequiredNow=1;var e=require_root();
|
|
2
2
|
/**
|
|
3
3
|
* Gets the timestamp of the number of milliseconds that have elapsed since
|
|
4
4
|
* the Unix epoch (1 January 1970 00:00:00 UTC).
|
|
@@ -77,7 +77,7 @@ import{f as require_root,h as require_baseGetTag,i as requireIsObjectLike,r as r
|
|
|
77
77
|
*
|
|
78
78
|
* _.toNumber('3.2');
|
|
79
79
|
* // => 3.2
|
|
80
|
-
*/function d(d){if(typeof d=="number"){return d}if(n(d)){return i}if(r(d)){var
|
|
80
|
+
*/function d(d){if(typeof d=="number"){return d}if(n(d)){return i}if(r(d)){var s=typeof d.valueOf=="function"?d.valueOf():d;d=r(s)?s+"":s}if(typeof d!="string"){return d===0?d:+d}d=e(d);var f=t.test(d);return f||o.test(d)?a(d.slice(2),f?2:8):u.test(d)?i:+d}toNumber_1=d;return toNumber_1}var debounce_1;var hasRequiredDebounce;function requireDebounce(){if(hasRequiredDebounce)return debounce_1;hasRequiredDebounce=1;var e=requireIsObject(),r=requireNow(),n=requireToNumber();
|
|
81
81
|
/** Error message constants. */var i="Expected a function";
|
|
82
82
|
/* Built-in method references for those with the same name as other `lodash` methods. */var u=Math.max,t=Math.min;
|
|
83
83
|
/**
|
|
@@ -133,21 +133,21 @@ import{f as require_root,h as require_baseGetTag,i as requireIsObjectLike,r as r
|
|
|
133
133
|
*
|
|
134
134
|
* // Cancel the trailing debounced invocation.
|
|
135
135
|
* jQuery(window).on('popstate', debounced.cancel);
|
|
136
|
-
*/function o(o,a,d){var f,
|
|
136
|
+
*/function o(o,a,d){var s,f,m,b,c,q,_=0,v=false,h=false,T=true;if(typeof o!="function"){throw new TypeError(i)}a=n(a)||0;if(e(d)){v=!!d.leading;h="maxWait"in d;m=h?u(n(d.maxWait)||0,a):m;T="trailing"in d?!!d.trailing:T}function I(e){var r=s,n=f;s=f=undefined;_=e;b=o.apply(n,r);return b}function l(e){
|
|
137
137
|
// Reset any `maxWait` timer.
|
|
138
138
|
_=e;
|
|
139
139
|
// Start the timer for the trailing edge.
|
|
140
140
|
c=setTimeout(N,a);
|
|
141
141
|
// Invoke the leading edge.
|
|
142
|
-
return v?I(e):b}function
|
|
142
|
+
return v?I(e):b}function R(e){var r=e-q,n=e-_,i=a-r;return h?t(i,m-n):i}function y(e){var r=e-q,n=e-_;
|
|
143
143
|
// Either this is the first call, activity has stopped and we're at the
|
|
144
144
|
// trailing edge, the system time has gone backwards and we're treating
|
|
145
145
|
// it as the trailing edge, or we've hit the `maxWait` limit.
|
|
146
146
|
return q===undefined||r>=a||r<0||h&&n>=m}function N(){var e=r();if(y(e)){return x(e)}
|
|
147
147
|
// Restart the timer.
|
|
148
|
-
c=setTimeout(N,
|
|
148
|
+
c=setTimeout(N,R(e))}function x(e){c=undefined;
|
|
149
149
|
// Only invoke if we have `lastArgs` which means `func` has been
|
|
150
150
|
// debounced at least once.
|
|
151
|
-
if(T&&
|
|
151
|
+
if(T&&s){return I(e)}s=f=undefined;return b}function w(){if(c!==undefined){clearTimeout(c)}_=0;s=q=f=c=undefined}function S(){return c===undefined?b:x(r())}function E(){var e=r(),n=y(e);s=arguments;f=this;q=e;if(n){if(c===undefined){return l(q)}if(h){
|
|
152
152
|
// Handle invocations in a tight loop.
|
|
153
|
-
clearTimeout(c);c=setTimeout(N,a);return I(q)}}if(c===undefined){c=setTimeout(N,a)}return b}
|
|
153
|
+
clearTimeout(c);c=setTimeout(N,a);return I(q)}}if(c===undefined){c=setTimeout(N,a)}return b}E.cancel=w;E.flush=S;return E}debounce_1=o;return debounce_1}export{requireDebounce as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as getDefaultExportFromCjs}from"./zonosStore-msUlqmSD.js";import{r as requireDebounce}from"./debounce-BR3PaG8X.js";var debounceExports=requireDebounce();var debounce=getDefaultExportFromCjs(debounceExports);export{debounce as d};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{U as extractName}from"./cart-
|
|
1
|
+
import{U as extractName}from"./cart-Cleo1j5P.js";
|
|
2
2
|
/**
|
|
3
3
|
* Minimum number of characters we treat as a valid postal code. Mirrors the
|
|
4
4
|
* landed-cost readiness check in `stripe.ts` (`isAddressReadyToRequestLandedCost`).
|
|
@@ -14,7 +14,7 @@ import{U as extractName}from"./cart-ekBk_gxV.js";
|
|
|
14
14
|
*
|
|
15
15
|
* Pure: the caller resolves `countryField` (via `getCountryField`) and passes it in, so
|
|
16
16
|
* this can be unit-tested without the stores.
|
|
17
|
-
*/var getMissingRequiredShippingFields=function(i){var e=i.countryField,a=i.event;var r,t,
|
|
17
|
+
*/var getMissingRequiredShippingFields=function(i){var e=i.countryField,a=i.event;var r,t,l;if(!a){return[]}var o=a.value;var v=[];
|
|
18
18
|
// Last name is always required for international shipping. Link's single name input
|
|
19
19
|
// often provides only a first name, leaving the extracted last name empty.
|
|
20
|
-
var s=extractName({firstName:
|
|
20
|
+
var s=extractName({firstName:o.firstName,lastName:o.lastName,name:o.name}).lastName;if(!s.trim()){v.push({key:"lastName"})}if((e===null||e===void 0?void 0:e.stateRequired)&&!((r=o.address.state)===null||r===void 0?void 0:r.trim())){v.push({key:"state"})}if((e===null||e===void 0?void 0:e.zipRequired)&&((l=(t=o.address.postal_code)===null||t===void 0?void 0:t.trim().length)!==null&&l!==void 0?l:0)<MIN_POSTAL_CODE_LENGTH){v.push({key:"postal_code"})}return v};export{MIN_POSTAL_CODE_LENGTH as M,getMissingRequiredShippingFields as g};
|
package/dist/esm-es5/index.js
CHANGED
|
@@ -54,7 +54,7 @@ var n=new URL(e).searchParams;var o=n.get("zonosQaUrl");if(!o){return null}var t
|
|
|
54
54
|
* When developing, if the script load is from `dev.elements.zonos.com`,
|
|
55
55
|
* it would load script from that same domain instead of loading from cdn
|
|
56
56
|
*/
|
|
57
|
-
var e=window&&window.location.href.includes("forceLoadCdn");if(typeof window==="undefined"||e){return null}var n=extractZonosQaUrl(window.location.href);var o="https://v1.3.
|
|
57
|
+
var e=window&&window.location.href.includes("forceLoadCdn");if(typeof window==="undefined"||e){return null}var n=extractZonosQaUrl(window.location.href);var o="https://v1.3.290.js.zonos.com";
|
|
58
58
|
// when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
|
|
59
59
|
if(!n&&(o.includes("test.")||
|
|
60
60
|
// Vercel git domain
|
|
@@ -79,9 +79,7 @@ var e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");var n=w
|
|
|
79
79
|
if(stripePromise$1!==null){return stripePromise$1}stripePromise$1=new Promise((function(n,o){if(typeof window==="undefined"||typeof document==="undefined"){
|
|
80
80
|
// Resolve to null when imported server side. This makes the module
|
|
81
81
|
// safe to import in an isomorphic code base.
|
|
82
|
-
n(null);return}if(window.Stripe){n(window.Stripe);return}try{var t=zonosStripeFindScript();if(t&&e){console.warn(EXISTING_SCRIPT_MESSAGE)}else if(!t){t=injectScript()}t===null||t===void 0?void 0:t.addEventListener("load",(function(){if(window.Stripe){n(window.Stripe)}else{o(new Error("Stripe.js not available"))}}));t===null||t===void 0?void 0:t.addEventListener("error",(function(){o(new Error("Failed to load Stripe.js"))}))}catch(e){o(e);return}}));return stripePromise$1};
|
|
83
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
84
|
-
var registerWrapper=function(e,n){if(!e||!e._registerWrapper){return}e._registerWrapper({name:"stripe-js",startTime:n})};var initStripe=function(e,n,o){if(e===null){return null}var t=e.apply(undefined,n);registerWrapper(t,o);return t};
|
|
82
|
+
n(null);return}if(window.Stripe){n(window.Stripe);return}try{var t=zonosStripeFindScript();if(t&&e){console.warn(EXISTING_SCRIPT_MESSAGE)}else if(!t){t=injectScript()}t===null||t===void 0?void 0:t.addEventListener("load",(function(){if(window.Stripe){n(window.Stripe)}else{o(new Error("Stripe.js not available"))}}));t===null||t===void 0?void 0:t.addEventListener("error",(function(){o(new Error("Failed to load Stripe.js"))}))}catch(e){o(e);return}}));return stripePromise$1};var registerWrapper=function(e,n){if(!e||!e._registerWrapper){return}e._registerWrapper({name:"stripe-js",startTime:n})};var initStripe=function(e,n,o){if(e===null){return null}var t=e.apply(undefined,n);registerWrapper(t,o);return t};
|
|
85
83
|
// Execute our own script injection after a tick to give users time to do their
|
|
86
84
|
// own script injection.
|
|
87
85
|
var hasCheckoutCartCallback=function(){var e,n;return typeof window!=="undefined"&&(typeof((e=window.Zonos)===null||e===void 0?void 0:e.createCartId)==="function"||typeof((n=window.Zonos)===null||n===void 0?void 0:n.buildCartDetail)==="function")};var stripePromise=Promise.resolve().then((function(){
|
|
@@ -99,19 +97,19 @@ return[4/*yield*/,new Promise((function(e){return setTimeout(e,500)}))];case 2:
|
|
|
99
97
|
e.sent();return[2/*return*/,getCartInfoById({cartId:d,retries:l-1})];case 3:if(c){return[2/*return*/,null]}return[2/*return*/,Object.assign(Object.assign({},s),{zonosMode:u})]}}))}))};var setupCartDataWithSettings=function(e){return __awaiter(void 0,void 0,void 0,(function(){var n,o,t,r;return __generator(this,(function(i){switch(i.label){case 0:n=_getIsValidCartId(e),o=n.isDgsCartId,t=n.isLegacyCartId;if(!t&&!o){logError("[ZONOS - loadZonos] invalid cart id");return[2/*return*/,null]}return[4/*yield*/,getCartInfoById({cartId:e,retries:5})];case 1:r=i.sent();log("[ZONOS - loadZonos] getting temp cart data","info",r);if(!r){logError("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process.");return[2/*return*/,null]}window.Zonos.storeId=r.cartData.storeId;window.Zonos.zonosApiKey=r.cartData.credentialToken;window.Zonos.zonosMode=r.zonosMode;return[2/*return*/,{cartData:r.cartData,settings:r.settings,storeFavicon:r.storeFaviconUrl,storeId:r.cartData.storeId,storeLogo:r.storeLogoUrl,zonosApiKey:r.cartData.credentialToken}]}}))}))};var _a;
|
|
100
98
|
/**
|
|
101
99
|
* Get the load version and url based on the loadScriptSrc, if the domain that used to load `zonos.js` is in white listed domains, use currentLoadScriptUrl as the load url instead, if zonosQaUrl exists, it would also fall under the white listed domain
|
|
102
|
-
*/var zonosLoadUrl=function(){if(typeof document==="undefined"){return null}var e=document.querySelector('script[src*="/zonos.js"]');var n=checkIfLoadVersionDomain({loadScriptSrc:e===null||e===void 0?void 0:e.src}),o=n.currentLoadScriptUrl,t=n.isWhiteListed;if(t){return o}return null}();var startLoadTime=Date.now();var ZONOS_URL="https://v1.3.
|
|
100
|
+
*/var zonosLoadUrl=function(){if(typeof document==="undefined"){return null}var e=document.querySelector('script[src*="/zonos.js"]');var n=checkIfLoadVersionDomain({loadScriptSrc:e===null||e===void 0?void 0:e.src}),o=n.currentLoadScriptUrl,t=n.isWhiteListed;if(t){return o}return null}();var startLoadTime=Date.now();var ZONOS_URL="https://v1.3.290.js.zonos.com";var JS_DELIVR_ZONOS_URL=zonosLoadUrl||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.290";var UNPKG_ZONOS_URL="https://unpkg.com/@zonos/elements@1.3.290";var CDNJS_ZONOS_URL="https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.290";var GOOGLE_FONT_URL="https://fonts.googleapis.com";var GOOGLE_FONT_REGEX=/^https:\/\/fonts\.googleapis\.com/;var Zonos=/** @class */function(){function e(){}return e}();_a=Zonos;Zonos.doneInit=false;Zonos.cartSettings=null;
|
|
103
101
|
// if query 'zonosDebug=1' param from url, debug mode is on
|
|
104
|
-
Zonos.debug=typeof window!=="undefined"&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/);Zonos.zonosConversionTest=typeof window!=="undefined"&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/);Zonos._paypalMockResponse=null;Zonos.iframeLogType=typeof window!=="undefined"?new URLSearchParams(window.location.search).get("iframeLogType"):null;Zonos.isBigCommerce=false;Zonos.releaseDate="
|
|
102
|
+
Zonos.debug=typeof window!=="undefined"&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/);Zonos.zonosConversionTest=typeof window!=="undefined"&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/);Zonos._paypalMockResponse=null;Zonos.iframeLogType=typeof window!=="undefined"?new URLSearchParams(window.location.search).get("iframeLogType"):null;Zonos.isBigCommerce=false;Zonos.releaseDate="1790609993128";Zonos.isLegacyCheckout=false;Zonos.googleAnalyticId=null;Zonos.googleAnalyticReady=false;Zonos.facebookPixelId=null;Zonos.facebookPixelReady=false;Zonos.startLoadTime=startLoadTime;Zonos.domain=typeof window!=="undefined"?// domain that embeds the iframe
|
|
105
103
|
window.location!=window.parent.location&&document.referrer||
|
|
106
104
|
// current domain
|
|
107
105
|
document.location.hostname:"";Zonos.showBaseForeign=typeof window!=="undefined"&&window.location.search.includes("zonosShowBaseForeign");Zonos.overrideUseCustomAddressForm=false;Zonos.isCollect=false;Zonos.isInvoice=false;
|
|
108
106
|
/**
|
|
109
107
|
* By default, the package will load from npm
|
|
110
|
-
*/Zonos.isNpm=true;Zonos.zonosQaUrl=null;Zonos.zonosQaUrlApi=null;Zonos.trackEventLogs=[];Zonos.version="v".concat("1.3.
|
|
108
|
+
*/Zonos.isNpm=true;Zonos.zonosQaUrl=null;Zonos.zonosQaUrlApi=null;Zonos.trackEventLogs=[];Zonos.version="v".concat("1.3.290");Zonos.modeAlerted=false;Zonos.cartData=null;Zonos.paypal=null;Zonos.zonosMode=null;Zonos.IframeService=IframeService;Zonos.getCurrentTimestamp=function(){return(new Date).getTime()};Zonos.zonosController=null;Zonos.loadTimeApiInfoList=[];Zonos.logIntervalId=null;Zonos.init=function(e){return __awaiter(void 0,void 0,void 0,(function(){var n,o,t,r,i,a,s,u,c,d,l,f,v,m,_;return __generator(this,(function(p){switch(p.label){case 0:n=e.appearance,o=e.checkoutSettings,t=e.currencyConverter,r=e.helloSettings,i=e.onCountryChange,a=e.overrideCurrencyFormat,s=e.storeId,u=e.zonosApiKey;_a.cartId=getCartIdFromQueryParam();
|
|
111
109
|
// Expose the checkout cart callbacks on the global so Stripe loading can be
|
|
112
110
|
// gated on whether at least one of them is configured.
|
|
113
111
|
_a.createCartId=o===null||o===void 0?void 0:o.createCartId;
|
|
114
|
-
// eslint-disable-next-line
|
|
112
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated -- intentionally mirror the (deprecated) callback so Stripe loading can be gated on it
|
|
115
113
|
_a.buildCartDetail=o===null||o===void 0?void 0:o.buildCartDetail;if(_a.doneInit){
|
|
116
114
|
// do nothing if zonos is already initialized
|
|
117
115
|
return[2/*return*/]}log("====== ZONOS DEBUG MODE: on (".concat(_a.version,") ======"));_a.zonosApiKey=u;_a.storeId=s;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,r,o){function n(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function a(e){try{d(o.next(e))}catch(e){i(e)}}function s(e){try{d(o["throw"](e))}catch(e){i(e)}}function d(e){e.done?r(e.value):n(e.value).then(a,s)}d((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,n,i,a=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return a.next=s(0),a["throw"]=s(1),a["return"]=s(2),typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return d([e,t])}}function d(s){if(o)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(r=0)),r)try{if(o=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{o=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{c as createStore,z as zonosStore}from"./zonosStore-
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,r,o){function n(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function a(e){try{d(o.next(e))}catch(e){i(e)}}function s(e){try{d(o["throw"](e))}catch(e){i(e)}}function d(e){e.done?r(e.value):n(e.value).then(a,s)}d((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,n,i,a=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return a.next=s(0),a["throw"]=s(1),a["return"]=s(2),typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return d([e,t])}}function d(s){if(o)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(r=0)),r)try{if(o=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{o=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{c as createStore,z as zonosStore}from"./zonosStore-msUlqmSD.js";import{d as cartStore,Y as cartStoreUpdateSelectedShippingOption,b as stripeStore,a0 as stripeStoreBuildAddressForPartyCreate}from"./cart-Cleo1j5P.js";import{s as storageStore}from"./localization-BiL8bPsY.js";import{h as handleFetch,s as sendErrorLog,l as logError}from"./handleFetch-D5GYDF-O.js";import{b as allLogs}from"./VarianceTest-BJmZPrZl.js";var invoiceStore=createStore((function(){return{amountTotalDue:null,isFetchingPayorInfo:true,landedCostShortId:null,partyBillingId:null,payorAddress:null}})).state;var invoiceStoreInitShippingInfo=function(e){return __awaiter(void 0,[e],void 0,(function(e){var t,r,o,n,i;var a=e.landedCostId,s=e.retries,d=s===void 0?5:s;return __generator(this,(function(e){switch(e.label){case 0:invoiceStore.isFetchingPayorInfo=true;return[4/*yield*/,handleFetch("/api/zonos-elements/invoice/get-payor-info-by-lc-id",{body:{landedCostId:a},method:"POST"})];case 1:n=e.sent();if(!n.errors.length)return[3/*break*/,4];if(!(d>0))return[3/*break*/,3];
|
|
2
2
|
// Wait for 1 second before retrying
|
|
3
3
|
return[4/*yield*/,new Promise((function(e){return setTimeout(e,1e3)}))];case 2:
|
|
4
4
|
// Wait for 1 second before retrying
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,a,t,r){function o(e){return e instanceof t?e:new t((function(a){a(e)}))}return new(t||(t=Promise))((function(t,n){function
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,a,t,r){function o(e){return e instanceof t?e:new t((function(a){a(e)}))}return new(t||(t=Promise))((function(t,n){function i(e){try{s(r.next(e))}catch(e){n(e)}}function l(e){try{s(r["throw"](e))}catch(e){n(e)}}function s(e){e.done?t(e.value):o(e.value).then(i,l)}s((r=r.apply(e,a||[])).next())}))};var __generator=this&&this.__generator||function(e,a){var t={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},r,o,n,i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=l(0),i["throw"]=l(1),i["return"]=l(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function l(e){return function(a){return s([e,a])}}function s(l){if(r)throw new TypeError("Generator is already executing.");while(i&&(i=0,l[0]&&(t=0)),t)try{if(r=1,o&&(n=l[0]&2?o["return"]:l[0]?o["throw"]||((n=o["return"])&&n.call(o),0):o.next)&&!(n=n.call(o,l[1])).done)return n;if(o=0,n)l=[l[0]&2,n.value];switch(l[0]){case 0:case 1:n=l;break;case 4:t.label++;return{value:l[1],done:false};case 5:t.label++;o=l[1];l=[0];continue;case 7:l=t.ops.pop();t.trys.pop();continue;default:if(!(n=t.trys,n=n.length>0&&n[n.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!n||l[1]>n[0]&&l[1]<n[3])){t.label=l[1];break}if(l[0]===6&&t.label<n[1]){t.label=n[1];n=l;break}if(n&&t.label<n[2]){t.label=n[2];t.ops.push(l);break}if(n[2])t.ops.pop();t.trys.pop();continue}l=a.call(e,t)}catch(e){l=[6,e];o=0}finally{r=n=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,a,t){if(t||arguments.length===2)for(var r=0,o=a.length,n;r<o;r++){if(n||!(r in a)){if(!n)n=Array.prototype.slice.call(a,0,r);n[r]=a[r]}}return e.concat(n||Array.prototype.slice.call(a))};import{c as createStore,z as zonosStore}from"./zonosStore-msUlqmSD.js";import{j as jsonParse,h as handleFetch,l as logError}from"./handleFetch-D5GYDF-O.js";import{a as availableTestKeys,l as log}from"./VarianceTest-BJmZPrZl.js";
|
|
2
2
|
/**
|
|
3
3
|
* Check if the response contains at least one available test key that we support
|
|
4
4
|
*/var hasAtLeastOneAvailableTestKey=function(e){var a=!!e.find((function(e){return e.testKey in availableTestKeys}));if(!a){log("No available test key found in response","info",{response:e})}return!!e.find((function(e){return e.testKey in availableTestKeys}))};
|
|
@@ -26,22 +26,19 @@ City:{value:"City"},"City/Town":{value:"City/Town"},"Click to copy the card numb
|
|
|
26
26
|
* translate('Above de minimis threshold for')
|
|
27
27
|
*/var translate=function(){var e=[];for(var a=0;a<arguments.length;a++){e[a]=arguments[a]}var t=e[0],r=e[1];var o,n;if(r){
|
|
28
28
|
// replace all variables in the string
|
|
29
|
-
var
|
|
29
|
+
var i=((o=translationStore.translatedChunks[t])===null||o===void 0?void 0:o.value)||t;Object.entries(r).forEach((function(e){var a=e[0],t=e[1];i=i.replace(new RegExp("\\[".concat(a,"\\]"),"g"),t.toString())}));return i}return((n=translationStore.translatedChunks[t])===null||n===void 0?void 0:n.value)||t};var getCountries=function(){return __awaiter(void 0,void 0,void 0,(function(){var e,a,t,r;return __generator(this,(function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);return[4/*yield*/,handleFetch("/api/zonos-elements/get-countries",{method:"GET"})];case 1:e=o.sent(),a=e.errors,t=e.json;if(a.length||!t){return[2/*return*/,null]}return[2/*return*/,t];case 2:r=o.sent();return[2/*return*/,null];case 3:return[2/*return*/]}}))}))};var getCountryLandedCost=function(e){return __awaiter(void 0,void 0,void 0,(function(){var a,t,r,o,n;return __generator(this,(function(i){switch(i.label){case 0:if(!e){return[2/*return*/,null]}t="/api/zonos-elements/country-landed-cost/".concat(e);return[4/*yield*/,handleFetch(t)];case 1:r=i.sent(),o=r.errors,n=r.json;if(o.length||!n){logError("Error fetching country landed cost: ".concat((a=o.find(Boolean))===null||a===void 0?void 0:a.message));return[2/*return*/,null]}return[2/*return*/,n||null]}}))}))};var defaultUsExchangeRate={exchangeRate:{rate:1,targetFormat:{currencyCode:"USD",decimalDelimiter:".",scale:2,symbol:"$",symbolLocation:"before",thousandsDelimiter:","}},maxAge:null};var getExchangeRate=function(e){return __awaiter(void 0,[e],void 0,(function(e){var a,t,r,o,n,i,l,s,u,d;var c=e.country,v=e.isGuaranteed,p=e.sourceCurrency,m=e.targetCurrency;return __generator(this,(function(e){switch(e.label){case 0:
|
|
30
30
|
// If source currency matches target currency (US -> US) and is not a guaranteed rate, return default exchange rate so we still format properly.
|
|
31
|
-
if(p===m&&!v){return[2/*return*/,defaultUsExchangeRate]}t=new URLSearchParams;t.set("sourceCurrency",p);t.set("targetCurrency",m);t.set("isGuaranteed",String(v));t.set("country",c||"");return[4/*yield*/,handleFetch("/api/zonos-elements/exchange-rates?".concat(t.toString()))];case 1:r=e.sent(),o=r.errors,n=r.json;if(o.length||!n){logError("Error fetching country landed cost: ".concat((a=o.find(Boolean))===null||a===void 0?void 0:a.message));return[2/*return*/,defaultUsExchangeRate]}
|
|
32
|
-
//
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return validateCountryCode(t)};var r=t("zCountry");
|
|
31
|
+
if(p===m&&!v){return[2/*return*/,defaultUsExchangeRate]}t=new URLSearchParams;t.set("sourceCurrency",p);t.set("targetCurrency",m);t.set("isGuaranteed",String(v));t.set("country",c||"");return[4/*yield*/,handleFetch("/api/zonos-elements/exchange-rates?".concat(t.toString()))];case 1:r=e.sent(),o=r.errors,n=r.json;if(o.length||!n){logError("Error fetching country landed cost: ".concat((a=o.find(Boolean))===null||a===void 0?void 0:a.message));return[2/*return*/,defaultUsExchangeRate]}i=n.exchangeRateCreate,l=i.rate,s=i.targetFormat;u=n.maxAge;if(l){sessionStorage.setItem(c+"_rate",JSON.stringify(l));d={rate:l,targetFormat:s};return[2/*return*/,{exchangeRate:d,maxAge:u}]}return[2/*return*/,defaultUsExchangeRate]}}))}))};var getInclusivePriceConfigurations=function(e){return __awaiter(void 0,void 0,void 0,(function(){var a,t,r,o;return __generator(this,(function(n){switch(n.label){case 0:if(!e){return[2/*return*/,null]}return[4/*yield*/,handleFetch("/api/zonos-elements/inclusive-prices/".concat(e))];case 1:t=n.sent(),r=t.errors,o=t.json;if(r.length||!o){logError("Error fetching country inclusive price setting: ".concat((a=r.find(Boolean))===null||a===void 0?void 0:a.message));return[2/*return*/,null]}return[2/*return*/,o||null]}}))}))};var getLocaleMessages=function(e){return __awaiter(void 0,[e],void 0,(function(e){var a,t,r,o,n;var i=e.countryCode,l=e.localeTo,s=e.storeId;return __generator(this,(function(e){switch(e.label){case 0:t=new URLSearchParams;t.set("countryCode",i);t.set("storeId",s.toString());if(l){t.set("localeTo",l)}return[4/*yield*/,handleFetch("/api/zonos-elements/locale-messages?".concat(t.toString()))];case 1:r=e.sent(),o=r.errors,n=r.json;if(o.length||!n){logError("Error fetching exchange rate",(a=o.find(Boolean))===null||a===void 0?void 0:a.message);return[2/*return*/,[]]}return[2/*return*/,n.locale_countryCodesPage]}}))}))};var isCountryCode=function(e){return/^[A-Z]{2}$/.test(e)};var COUNTRY_OVERRIDE_KEY="zonos--country";var withBlockedStorage=function(e){try{e()}catch(e){
|
|
32
|
+
// localStorage/sessionStorage can throw in blocked-storage contexts
|
|
33
|
+
// (Safari private mode, cross-origin iframes).
|
|
34
|
+
}};var clearSessionOverride=function(){window.sessionStorage.removeItem(COUNTRY_OVERRIDE_KEY)};var readStoredCountry=function(e){try{var a=e.getItem(COUNTRY_OVERRIDE_KEY);if(!a||!isCountryCode(a)){return null}return a}catch(e){return null}};var getCountryOverrideStorage=function(){var e;return(e=readStoredCountry(window.localStorage))!==null&&e!==void 0?e:readStoredCountry(window.sessionStorage)};var migrateCountryOverrideStorage=function(){withBlockedStorage((function(){if(readStoredCountry(window.localStorage)){clearSessionOverride()}}))};var setCountryOverrideStorage=function(e){withBlockedStorage((function(){window.localStorage.setItem(COUNTRY_OVERRIDE_KEY,e);clearSessionOverride()}))};var clearCountryOverrideStorage=function(){withBlockedStorage((function(){window.localStorage.removeItem(COUNTRY_OVERRIDE_KEY);clearSessionOverride()}))};var getZCountryUrlParam=function(e){var a=new URLSearchParams(e||window.location.search);var t=function(e){var t=a.get(e);if(t&&isCountryCode(t)){return t}return null};var r=t("zCountry");
|
|
36
35
|
// Fallback to legacy 'country'
|
|
37
36
|
var o=t("country");
|
|
38
37
|
// Fallback to customerCountry
|
|
39
38
|
var n=t("customerCountry");return r||o||n};
|
|
40
39
|
/**
|
|
41
|
-
* Retrieve the
|
|
42
|
-
*/var getOverridenZCountry=function(){var e=new URL(window.location.href);
|
|
43
|
-
// load and use country from session storage when zCountry query param is not present
|
|
44
|
-
var a=window.sessionStorage.getItem("zonos--country");var t=getZCountryUrlParam(e.searchParams)||a;return t};var getLocalization=function(){return __awaiter(void 0,void 0,void 0,(function(){var e,a,t,r,o,n;return __generator(this,(function(l){switch(l.label){case 0:l.trys.push([0,2,,3]);e=getOverridenZCountry();a=new URLSearchParams;if(e){a.set("zCountry",e)}return[4/*yield*/,handleFetch("/api/zonos-elements/localization?".concat(a.toString()))];case 1:t=l.sent(),r=t.errors,o=t.json;if(r.length||!o){return[2/*return*/,{country:null,locale:null}]}return[2/*return*/,{country:o.country,locale:o.locale}];case 2:n=l.sent();return[2/*return*/,{country:null,locale:null}];case 3:return[2/*return*/]}}))}))};var getShippingZones=function(){return __awaiter(void 0,void 0,void 0,(function(){var e,a,t,r,o,n,l;return __generator(this,(function(i){switch(i.label){case 0:if((e=window.Zonos.cartSettings)===null||e===void 0?void 0:e.shippingZones){return[2/*return*/,window.Zonos.cartSettings.shippingZones.flatMap((function(e){return e===null||e===void 0?void 0:e.countryCodes})).filter(Boolean)]}return[4/*yield*/,handleFetch("/api/zonos-elements/shipping-zones")];case 1:r=i.sent(),o=r.errors,n=r.json;if(o.length||!n){logError("Error fetching shipping zones: ".concat((a=o.find(Boolean))===null||a===void 0?void 0:a.message));return[2/*return*/,null]}l=(t=n===null||n===void 0?void 0:n.shippingZones)===null||t===void 0?void 0:t.flatMap((function(e){return e===null||e===void 0?void 0:e.countryCodes})).filter(Boolean);return[2/*return*/,l||null]}}))}))};
|
|
40
|
+
* Retrieve the shopper country override from the URL or remembered storage.
|
|
41
|
+
*/var getOverridenZCountry=function(){var e=new URL(window.location.href);return getZCountryUrlParam(e.searchParams)||getCountryOverrideStorage()};var getLocalization=function(){var e=[];for(var a=0;a<arguments.length;a++){e[a]=arguments[a]}return __awaiter(void 0,__spreadArray([],e,true),void 0,(function(e){var a,t,r,o,n,i;var l=e===void 0?{}:e,s=l.ignoreCountryOverride,u=s===void 0?false:s;return __generator(this,(function(e){switch(e.label){case 0:e.trys.push([0,2,,3]);a=u?null:getOverridenZCountry();t=new URLSearchParams;if(a){t.set("zCountry",a)}return[4/*yield*/,handleFetch("/api/zonos-elements/localization?".concat(t.toString()))];case 1:r=e.sent(),o=r.errors,n=r.json;if(o.length||!n){return[2/*return*/,{country:null,locale:null}]}return[2/*return*/,{country:n.country,locale:n.locale}];case 2:i=e.sent();return[2/*return*/,{country:null,locale:null}];case 3:return[2/*return*/]}}))}))};var getShippingZones=function(){return __awaiter(void 0,void 0,void 0,(function(){var e,a,t,r,o,n,i;return __generator(this,(function(l){switch(l.label){case 0:if((e=window.Zonos.cartSettings)===null||e===void 0?void 0:e.shippingZones){return[2/*return*/,window.Zonos.cartSettings.shippingZones.flatMap((function(e){return e===null||e===void 0?void 0:e.countryCodes})).filter(Boolean)]}return[4/*yield*/,handleFetch("/api/zonos-elements/shipping-zones")];case 1:r=l.sent(),o=r.errors,n=r.json;if(o.length||!n){logError("Error fetching shipping zones: ".concat((a=o.find(Boolean))===null||a===void 0?void 0:a.message));return[2/*return*/,null]}i=(t=n===null||n===void 0?void 0:n.shippingZones)===null||t===void 0?void 0:t.flatMap((function(e){return e===null||e===void 0?void 0:e.countryCodes})).filter(Boolean);return[2/*return*/,i||null]}}))}))};
|
|
45
42
|
/**
|
|
46
43
|
* Fetch the checkout/cart ID from the BigCommerce Storefront Cart API.
|
|
47
44
|
* The `/checkout` page URL does not include the checkout ID, so we
|
|
@@ -62,7 +59,26 @@ var a=window.sessionStorage.getItem("zonos--country");var t=getZCountryUrlParam(
|
|
|
62
59
|
* Whether the BigCommerce shopper is already logged in. We key off the
|
|
63
60
|
* customer's numeric `id` since the storefront API populates it only for
|
|
64
61
|
* authenticated sessions (guest checkouts have an empty `customer` object).
|
|
65
|
-
*/var isBigCommerceCustomerLoggedIn=function(e){var a;return!!((a=e===null||e===void 0?void 0:e.customer)===null||a===void 0?void 0:a.id)};
|
|
62
|
+
*/var isBigCommerceCustomerLoggedIn=function(e){var a;return!!((a=e===null||e===void 0?void 0:e.customer)===null||a===void 0?void 0:a.id)};var isCountryInShippingZone=function(e){var a;return!!e&&!!((a=localizationStore.shippingZoneCountries)===null||a===void 0?void 0:a[e])&&!zonosStore.disabledCountries.includes(e)};
|
|
63
|
+
/**
|
|
64
|
+
* Visibility rules for Hello, ignoring whether localization has finished
|
|
65
|
+
* loading. Used during init reconcile before `localizationLoaded` is set.
|
|
66
|
+
* Pass `countryCode` to evaluate a remembered country instead of the
|
|
67
|
+
* currently selected one.
|
|
68
|
+
*/var getHelloWidgetVisibility=function(e,a){if(e===void 0){e=true}if(a===void 0){a=localizationStore.selectedCountryCode}var t,r;var o=zonosStore.helloSettings,n=o.countryDisplayRules,i=o.showForCountries;var l=n===null||n===void 0?void 0:n.widgetVisibility;var s=a;var u=isCountryInShippingZone(a);
|
|
69
|
+
// Resolve behavior: deprecated showForCountries overrides widgetVisibility.behavior
|
|
70
|
+
// If showForCountries is an array of country codes, treat as legacy explicit list
|
|
71
|
+
var d=Array.isArray(i)?i:i!==null&&i!==void 0?i:l===null||l===void 0?void 0:l.behavior;if(e&&!u){log("Hello: not shippable country - Show for countries: ".concat(d))}
|
|
72
|
+
// Legacy: explicit list of country codes from deprecated showForCountries
|
|
73
|
+
if(Array.isArray(d)){return!!s&&d.includes(s)}
|
|
74
|
+
// Determine base visibility from behavior
|
|
75
|
+
var c;if(d==="ALL"){c=true}else{
|
|
76
|
+
// Default: ONLY_SHIPPABLE
|
|
77
|
+
c=u}
|
|
78
|
+
// Apply includedCountries — force show the widget for these countries
|
|
79
|
+
if(!c&&s&&((t=l===null||l===void 0?void 0:l.includedCountries)===null||t===void 0?void 0:t.includes(s))){c=true}
|
|
80
|
+
// Apply excludedCountries — force hide the widget for these countries
|
|
81
|
+
if(c&&s&&((r=l===null||l===void 0?void 0:l.excludedCountries)===null||r===void 0?void 0:r.includes(s))){c=false}return c};
|
|
66
82
|
/**
|
|
67
83
|
* Whether the Hello widget should be shown for the current shopper. This is the
|
|
68
84
|
* single source of truth for Hello's visibility decision — the `zonos-hello`
|
|
@@ -70,27 +86,10 @@ var a=window.sessionStorage.getItem("zonos--country");var t=getZCountryUrlParam(
|
|
|
70
86
|
* cleanup) gate on it so their behavior stays in lockstep with what the shopper
|
|
71
87
|
* actually sees.
|
|
72
88
|
*
|
|
73
|
-
* Resolves the configured `widgetVisibility` behavior (with the deprecated
|
|
74
|
-
* `showForCountries` override) against the selected country and shipping-zone
|
|
75
|
-
* state, then applies the include/exclude country overrides.
|
|
76
|
-
*
|
|
77
89
|
* @param showLog - emit a debug log when the shopper is not in a shipping zone.
|
|
78
90
|
* Defaults to `true`; pass `false` from non-rendering callers to avoid log
|
|
79
91
|
* noise.
|
|
80
|
-
*/var shouldShowHelloWidget=function(e){if(e===void 0){e=true}
|
|
81
|
-
// Resolve behavior: deprecated showForCountries overrides widgetVisibility.behavior
|
|
82
|
-
// If showForCountries is an array of country codes, treat as legacy explicit list
|
|
83
|
-
var s=Array.isArray(n)?n:n!==null&&n!==void 0?n:l===null||l===void 0?void 0:l.behavior;if(e&&!localizationStore.isShippableCountry){log("Hello: not shippable country - Show for countries: ".concat(s))}
|
|
84
|
-
// Legacy: explicit list of country codes from deprecated showForCountries
|
|
85
|
-
if(Array.isArray(s)){return!!i&&s.includes(i)}
|
|
86
|
-
// Determine base visibility from behavior
|
|
87
|
-
var u;if(s==="ALL"){u=true}else{
|
|
88
|
-
// Default: ONLY_SHIPPABLE
|
|
89
|
-
u=localizationStore.isShippableCountry}
|
|
90
|
-
// Apply includedCountries — force show the widget for these countries
|
|
91
|
-
if(!u&&i&&((a=l===null||l===void 0?void 0:l.includedCountries)===null||a===void 0?void 0:a.includes(i))){u=true}
|
|
92
|
-
// Apply excludedCountries — force hide the widget for these countries
|
|
93
|
-
if(u&&i&&((t=l===null||l===void 0?void 0:l.excludedCountries)===null||t===void 0?void 0:t.includes(i))){u=false}return u};
|
|
92
|
+
*/var shouldShowHelloWidget=function(e){if(e===void 0){e=true}if(!localizationStore.localizationLoaded){return false}return getHelloWidgetVisibility(e)};
|
|
94
93
|
/**
|
|
95
94
|
* Guard against overlapping passes. `removeBigcommerceCartShipping` is fired on
|
|
96
95
|
* every country change; without this flag, rapid country switches could stack
|
|
@@ -113,20 +112,20 @@ if(u&&i&&((t=l===null||l===void 0?void 0:l.excludedCountries)===null||t===void 0
|
|
|
113
112
|
* active checkout actually has a consignment. Because the reload happens only
|
|
114
113
|
* when a consignment is found and removed, the freshly-loaded page has none —
|
|
115
114
|
* so this cannot loop.
|
|
116
|
-
*/var removeBigcommerceCartShipping=function(){return __awaiter(void 0,void 0,void 0,(function(){var e,a,t,r,o,n,l
|
|
115
|
+
*/var removeBigcommerceCartShipping=function(){return __awaiter(void 0,void 0,void 0,(function(){var e,a,t,r,o,n,i,l;return __generator(this,(function(s){switch(s.label){case 0:if(typeof window==="undefined"||!((e=window.Zonos)===null||e===void 0?void 0:e.isBigCommerce)){return[2/*return*/]}
|
|
117
116
|
// Only on the cart page and only when Hello is shown — elsewhere there is no
|
|
118
117
|
// Grand Total to correct. Gate on Hello visibility (not raw shipping-zone
|
|
119
118
|
// membership) so include/exclude country overrides are respected.
|
|
120
119
|
if(window.location.pathname!=="/cart.php"||!localizationStore.isShippableCountry||!shouldShowHelloWidget(false)){return[2/*return*/]}if(isRemoving){return[2/*return*/]}isRemoving=true;s.label=1;case 1:s.trys.push([1,5,6,7]);return[4/*yield*/,fetchCheckoutId()];case 2:t=s.sent();if(!t){return[2/*return*/]}return[4/*yield*/,fetchBigCommerceCheckout(t)];case 3:r=s.sent();o=((a=r===null||r===void 0?void 0:r.consignments)!==null&&a!==void 0?a:[]).map((function(e){return e.id})).filter((function(e){return!!e}));
|
|
121
120
|
// Nothing to do if there is no domestic shipping quote on the cart.
|
|
122
|
-
if(!o.length){return[2/*return*/]}log("Removing ".concat(String(o.length)," BigCommerce cart consignment(s) for international shopper"),"info");return[4/*yield*/,Promise.all(o.map((function(e){return deleteBigCommerceConsignment(t,e)})))];case 4:n=s.sent();
|
|
121
|
+
if(!o.length){return[2/*return*/]}log("Removing ".concat(String(o.length)," BigCommerce cart consignment(s) for international shopper"),"info");return[4/*yield*/,Promise.all(o.map((function(e){return deleteBigCommerceConsignment(t,e)})))];case 4:n=s.sent();i=n.filter(Boolean).length;
|
|
123
122
|
// Only reload when at least one consignment was actually removed. If every
|
|
124
123
|
// DELETE failed, reloading would re-run this on init with the same
|
|
125
124
|
// consignments still present and trap the shopper in a reload loop.
|
|
126
|
-
if(!
|
|
125
|
+
if(!i){log("No BigCommerce cart consignments were removed; skipping reload to avoid a reload loop","warn");return[2/*return*/]}
|
|
127
126
|
// Reload so the server re-renders the cart consistently without the removed
|
|
128
127
|
// shipping, instead of surgically patching the DOM total.
|
|
129
|
-
window.location.reload();return[3/*break*/,7];case 5:
|
|
128
|
+
window.location.reload();return[3/*break*/,7];case 5:l=s.sent();logError("Error removing BigCommerce cart shipping consignment",l);return[3/*break*/,7];case 6:isRemoving=false;return[7/*endfinally*/];case 7:return[2/*return*/]}}))}))};var languages=[{code:"en",label:"English",translatedLabel:"English"},{code:"es",label:"Spanish",translatedLabel:"Español"},{code:"pt",label:"Portuguese",translatedLabel:"Português"},{code:"ru",label:"Russian",translatedLabel:"русский"},{code:"da",label:"Danish",translatedLabel:"dansk"},{code:"it",label:"Italian",translatedLabel:"Italiano"},{code:"pl",label:"Polish",translatedLabel:"Polskie"},{code:"ar",label:"Arabic",translatedLabel:"عربى"},{code:"de",label:"German",translatedLabel:"Deutsch"},{code:"ja",label:"Japanese",translatedLabel:"日本語"},{code:"no",label:"Norwegian",translatedLabel:"norsk"},{code:"vi",label:"Vietnamese",translatedLabel:"Tiếng Việt"},{code:"tr",label:"Turkish",translatedLabel:"Türkçe"},{code:"he",label:"Hebrew",translatedLabel:"עִברִית"},{code:"fr",label:"French",translatedLabel:"Français"},{code:"nl",label:"Dutch",translatedLabel:"Nederlands"},{code:"zh",label:"Chinese",translatedLabel:"中文"},{code:"sv",label:"Swedish",translatedLabel:"svenska"},{code:"id",label:"Indonesian",translatedLabel:"bahasa Indonesia"},{code:"ko",label:"Korean",translatedLabel:"한국어"}];
|
|
130
129
|
/**
|
|
131
130
|
* The languages offered in the language selector, honoring the merchant's
|
|
132
131
|
* `appearanceSettings.supportedLocales`. Falls back to every supported language when the
|
|
@@ -140,17 +139,17 @@ var a=localizationStore.exchangeRate;if(!a||!e||isNaN(e)){return e}var t=(a===nu
|
|
|
140
139
|
/**
|
|
141
140
|
* This function only to format the number in
|
|
142
141
|
* @returns
|
|
143
|
-
*/var numberFormat=function(e){var a=e.amount,t=e.currency,r=e.targetFormat;var o=t||localizationStore.targetCurrency;var n=(r===null||r===void 0?void 0:r.scale)||2;var
|
|
142
|
+
*/var numberFormat=function(e){var a=e.amount,t=e.currency,r=e.targetFormat;var o=t||localizationStore.targetCurrency;var n=(r===null||r===void 0?void 0:r.scale)||2;var i=window.navigator.userAgent.indexOf("MSIE ")!==-1;var l=typeof Intl==="object"&&Intl&&typeof Intl.NumberFormat==="function";if(i||!l){
|
|
144
143
|
// use native number formatting if it's IE.
|
|
145
144
|
var s=Number(a).toFixed(n).replace(".","|dec|").replace(",",(r===null||r===void 0?void 0:r.thousandsDelimiter)||"").replace("|dec|",(r===null||r===void 0?void 0:r.decimalDelimiter)||"");return s}var u=new Intl.NumberFormat(window.navigator.language,{currency:o,currencyDisplay:"code",minimumFractionDigits:n,style:"currency"}).format(a);return u.replace(new RegExp("".concat(o,"\\s+")),"")};var currencyFormat=function(e){var a=e.amount,t=e.currency;if(isNaN(a)||a!==0&&!a){return""}var r=zonosStore.overrideCurrencyFormat;var o=localizationStore.exchangeRate;var n=t||localizationStore.targetCurrency;
|
|
146
145
|
// Use user-defined currency format
|
|
147
|
-
if(typeof r==="function"){return r({amount:a,currencyCode:n,numberFormat:function(e){var a=e.amount;return numberFormat({amount:a,currency:n,targetFormat:(o===null||o===void 0?void 0:o.targetFormat)||null})}})}var
|
|
146
|
+
if(typeof r==="function"){return r({amount:a,currencyCode:n,numberFormat:function(e){var a=e.amount;return numberFormat({amount:a,currency:n,targetFormat:(o===null||o===void 0?void 0:o.targetFormat)||null})}})}var i=(o||{}).targetFormat;var l=i===null||i===void 0?void 0:i.scale;var s=window.navigator.userAgent.indexOf("MSIE ")!==-1;var u=typeof Intl==="object"&&Intl&&typeof Intl.NumberFormat==="function";if(s||!u){
|
|
148
147
|
// target format is mainly used to get the minimum fraction digits for IE or no Intl.NumberFormat is available
|
|
149
|
-
if(!
|
|
148
|
+
if(!i||!o){
|
|
150
149
|
// Return the amount as a string if no exchange rate is available
|
|
151
150
|
return"".concat(a.toFixed(2)," ").concat(n)}
|
|
152
151
|
// use native number formatting if it's IE.
|
|
153
|
-
var d=Number(a).toFixed(
|
|
152
|
+
var d=Number(a).toFixed(l||2).replace(".","|dec|").replace(",",i.thousandsDelimiter||"").replace("|dec|",i.decimalDelimiter||"");var c="".concat(d).concat(i.currencyCode!=="USD"?" ".concat(i.currencyCode):"");return c}var v=(r===null||r===void 0?void 0:r.currencyDisplay)||"symbol";var p=new Intl.NumberFormat(zonosStore.sourceCurrency==="AUD"?"en-AU":window.navigator.language,{currency:n,currencyDisplay:v,minimumFractionDigits:l,style:"currency"}).format(a);
|
|
154
153
|
// Move currency code to the end of the string if currencyDisplay is 'code'
|
|
155
154
|
var m=v==="code"?"".concat(p.replace(new RegExp("".concat(n,"\\s+")),"")," ").concat(n):p;return m};var currencyConvertAndFormat=function(e){var a=currencyConvert(e);var t=currencyFormat({amount:a});return t};
|
|
156
155
|
/**
|
|
@@ -196,13 +195,13 @@ setTimeout((function(){void removeBlurCurrency()}),BLUR_CURRENCY_DURATION)};var
|
|
|
196
195
|
// get rate
|
|
197
196
|
var o=parseFloat(e.getAttribute("data-zrate")||"1");var n=e.getAttribute("data-zcountry-code");
|
|
198
197
|
// do nothing if the target currency is the same
|
|
199
|
-
var
|
|
198
|
+
var i=localizationStore.exchangeRate&&localizationStore.targetCurrency===localizationStore.exchangeRate.targetFormat.currencyCode;var l=((a=localizationStore.exchangeRate)===null||a===void 0?void 0:a.rate)||1;
|
|
200
199
|
// if the current value on the element is different from the current intl value, update the data-zintl attribute
|
|
201
|
-
if(
|
|
200
|
+
if(i&&(
|
|
202
201
|
// Update currency if the value is not yet formatted
|
|
203
202
|
e.textContent!==r||
|
|
204
203
|
// Update rate when new rate is available
|
|
205
|
-
|
|
204
|
+
l!==o||
|
|
206
205
|
// Update currency when the country code changes
|
|
207
206
|
n!==localizationStore.selectedCountryCode)){var s=void 0;
|
|
208
207
|
// Only trigger blur effect if the source currency is different from the target currency
|
|
@@ -214,7 +213,7 @@ var c=d||currencyConvertAndFormat(u);if(c!==e.textContent){
|
|
|
214
213
|
// Only set textContent if the value has changed, this is to prevent it redrawing the element if the value is the same
|
|
215
214
|
e.textContent=c}
|
|
216
215
|
// save the new rate to the data-zrate attribute
|
|
217
|
-
e.setAttribute("data-zrate",
|
|
216
|
+
e.setAttribute("data-zrate",l.toString());
|
|
218
217
|
// save the new value to the data-zintl attribute
|
|
219
218
|
e.setAttribute("data-zintl",c);e.setAttribute("data-zcountry-code",localizationStore.selectedCountryCode||"");void removeBlurSpecificElement({specificSelector:e,timeoutId:s})}};var defaultCurrencyConverter=function(){var e=zonosStore.helloSettings.currencyElementSelector;var a=getCurrencyElements(e);
|
|
220
219
|
// do nothing if none of the currency elements are found
|
|
@@ -226,7 +225,20 @@ convertCurrency(e)}))};var currencyDisplay=function(){if(zonosStore.helloSetting
|
|
|
226
225
|
// differs from `zonosStore.sourceCurrency`, the DOM amounts are not in the
|
|
227
226
|
// currency Hello would convert *from* — running conversion would double-
|
|
228
227
|
// convert and produce wrong prices.
|
|
229
|
-
if(window.Zonos.isBigCommerce){var e=document.body.dataset.currencyCode;if(e&&e!==zonosStore.sourceCurrency){log('Skipping Hello currency conversion: BigCommerce native currency "'.concat(e,'" does not match sourceCurrency "').concat(zonosStore.sourceCurrency,'".'),"info");void removeBlurCurrency();return}}defaultCurrencyConverter()};var getCurrencyCode=function(e){var a;var t=(a=localizationStore.shippingZoneCountries)===null||a===void 0?void 0:a[e];if(t){return t.currencyCode}return null};
|
|
228
|
+
if(window.Zonos.isBigCommerce){var e=document.body.dataset.currencyCode;if(e&&e!==zonosStore.sourceCurrency){log('Skipping Hello currency conversion: BigCommerce native currency "'.concat(e,'" does not match sourceCurrency "').concat(zonosStore.sourceCurrency,'".'),"info");void removeBlurCurrency();return}}defaultCurrencyConverter()};var getCurrencyCode=function(e){var a;var t=(a=localizationStore.shippingZoneCountries)===null||a===void 0?void 0:a[e];if(t){return t.currencyCode}return null};
|
|
229
|
+
/**
|
|
230
|
+
* Drop a remembered Hello country when widgetVisibility would hide the
|
|
231
|
+
* widget for it, then fall back to geo.
|
|
232
|
+
*
|
|
233
|
+
* Does not mutate the localization store — the caller applies the returned
|
|
234
|
+
* country. Pass `geoCountry` when init already fetched IP localization so
|
|
235
|
+
* discard does not wait on a second round trip. Pass `urlCountryAtLoad`
|
|
236
|
+
* from the URL as it was at page load (before init writes `zCountry` for
|
|
237
|
+
* URL_PARAM merchants). Do not omit it after a live URL write — the
|
|
238
|
+
* default is `null`, not the current URL. Storage is cleared when geo
|
|
239
|
+
* succeeds, or when a load-time URL country won and the stored country
|
|
240
|
+
* would be hidden.
|
|
241
|
+
*/var reconcileRememberedCountryOverride=function(){var e=[];for(var a=0;a<arguments.length;a++){e[a]=arguments[a]}return __awaiter(void 0,__spreadArray([],e,true),void 0,(function(e){var a,t,r;var o=e===void 0?{}:e,n=o.geoCountry,i=o.urlCountryAtLoad,l=i===void 0?null:i;return __generator(this,(function(e){switch(e.label){case 0:a=getCountryOverrideStorage();if(!a){return[2/*return*/,null]}if(getHelloWidgetVisibility(false,a)){return[2/*return*/,null]}if(l){clearCountryOverrideStorage();return[2/*return*/,null]}if(!(n!==undefined))return[3/*break*/,1];r=n;return[3/*break*/,3];case 1:return[4/*yield*/,getLocalization({ignoreCountryOverride:true})];case 2:r=e.sent().country;e.label=3;case 3:t=r;if(!t){return[2/*return*/,null]}clearCountryOverrideStorage();return[2/*return*/,t]}}))}))};var setZCountryUrlParam=function(e){if(!e){return}var a=new URLSearchParams(window.location.search);
|
|
230
242
|
// Only append zCountry if it's already in the URL or the countryOverrideBehavior is URL_PARAM
|
|
231
243
|
var t=a.has("zCountry")||zonosStore.helloSettings.countryOverrideBehavior==="URL_PARAM";if(t){
|
|
232
244
|
// Only append zCountry if it's not already in the URL
|
|
@@ -267,11 +279,11 @@ localizationStore.exchangeRateTimeout=setTimeout((function(){return __awaiter(vo
|
|
|
267
279
|
// Refresh inclusive pricing configurations before getting a new exchange rate, so hello can use the new effective rate
|
|
268
280
|
return[4/*yield*/,refreshInclusivePricingConfigurations(localizationStore.selectedCountryCode)];case 1:
|
|
269
281
|
// Refresh inclusive pricing configurations before getting a new exchange rate, so hello can use the new effective rate
|
|
270
|
-
t.sent();return[4/*yield*/,triggerGetExchangeRate(a)];case 2:e=t.sent().maxAge;startExchangeRateTimeout({isGuaranteed:a,maxAge:e});return[2/*return*/]}}))}))}),o*1e3)};var getNewLocalization=function(e){return __awaiter(void 0,[e],void 0,(function(e){var a,t,r,o,n,l,
|
|
282
|
+
t.sent();return[4/*yield*/,triggerGetExchangeRate(a)];case 2:e=t.sent().maxAge;startExchangeRateTimeout({isGuaranteed:a,maxAge:e});return[2/*return*/]}}))}))}),o*1e3)};var getNewLocalization=function(e){return __awaiter(void 0,[e],void 0,(function(e){var a,t,r,o,n,i,l,s;var u=e.isInitializing;return __generator(this,(function(e){switch(e.label){case 0:log("get new localization store");r=localizationStore.isDisabledCountry,o=localizationStore.isShippableCountry,n=localizationStore.selectedCountryCode;if(zonosStore.helloSettings.currencyBehavior==="DISABLED"||!o||r||!n){return[2/*return*/]}i=zonosStore.checkoutSettings.visibilityStatus==="ENABLED";
|
|
271
283
|
// blur currency out before getting exchange rate
|
|
272
|
-
performBlurCurrency();return[4/*yield*/,triggerGetExchangeRate(
|
|
284
|
+
performBlurCurrency();return[4/*yield*/,triggerGetExchangeRate(i)];case 1:l=e.sent().maxAge;startExchangeRateTimeout({isGuaranteed:i,maxAge:l});if(u&&((a=window.Zonos.cartSettings)===null||a===void 0?void 0:a.inclusivePriceConfigurations)){localizationStore.inclusivePricingConfigurations=((t=window.Zonos.cartSettings)===null||t===void 0?void 0:t.inclusivePriceConfigurations)||[];void removeBlurCurrency()}if(!!window.Zonos.isLegacyCheckout)return[3/*break*/,3];localizationStore.inclusivePricingIsFetching=true;return[4/*yield*/,Promise.all([getCountryLandedCost(localizationStore.selectedCountryCode),refreshInclusivePricingConfigurations(localizationStore.selectedCountryCode)])];case 2:s=e.sent()[0];localizationStore.countryLandedCost=s;
|
|
273
285
|
// Remove blur effect after the currency is converted
|
|
274
|
-
void removeBlurCurrency();return[3/*break*/,4];case 3:log("Skipping country landed cost and inclusive pricing requests, because this is a legacy checkout");e.label=4;case 4:return[2/*return*/]}}))}))};var getCustomMessages=function(){return __awaiter(void 0,void 0,void 0,(function(){var e,a;return __generator(this,(function(
|
|
286
|
+
void removeBlurCurrency();return[3/*break*/,4];case 3:log("Skipping country landed cost and inclusive pricing requests, because this is a legacy checkout");e.label=4;case 4:return[2/*return*/]}}))}))};var getCustomMessages=function(){return __awaiter(void 0,void 0,void 0,(function(){var e,a,t;return __generator(this,(function(r){switch(r.label){case 0:e=localizationStore.selectedCountryCode;log("Getting custom messages for ".concat(e));if(!e||!zonosStore.storeId){return[2/*return*/]}return[4/*yield*/,getLocaleMessages({countryCode:e,localeTo:localizationStore.selectedLocale,storeId:zonosStore.storeId})];case 1:a=r.sent();if(localizationStore.selectedCountryCode!==e){return[2/*return*/]}t=a.flatMap((function(a){var t;return{countryCode:e,message:(t=a.countryCodesPageMessageLinks.find(Boolean))===null||t===void 0?void 0:t.message.textTo,pageName:a.pageName}}));localizationStore.customMessages=t;return[2/*return*/]}}))}))};var getOverrideLocale=function(){var e=new URL(window.location.href);var a=e.searchParams.get("zonosLocale");return a};var addInternationalHideClass=function(){if(localizationStore.isShippableCountry){document.body.classList.add("z-intl")}else{document.body.classList.remove("z-intl")}};var getValidCountryCode=function(e){if(e==="UK"){return"GB"}return e};
|
|
275
287
|
/**
|
|
276
288
|
* Clamps a locale to what the merchant offers. The requested locale comes from geolocation, the
|
|
277
289
|
* browser, or the `zonosLocale` param — none of which know about
|
|
@@ -279,11 +291,9 @@ void removeBlurCurrency();return[3/*break*/,4];case 3:log("Skipping country land
|
|
|
279
291
|
* merchant has removed, with no way to switch back to it once the selector hides it.
|
|
280
292
|
*/var getValidLocale=function(e){var a=getSupportedLanguages();if(a.some((function(a){return a.code===e}))){return e}
|
|
281
293
|
// prefer English when it is on offer, otherwise take the first language the merchant kept
|
|
282
|
-
var t=a.find((function(e){return e.code==="en"}))||a[0];log("Locale ".concat(e," is not offered, falling back to ").concat(t===null||t===void 0?void 0:t.code));return(t===null||t===void 0?void 0:t.code)||"en"};var localizationStoreUpdateSelectedCountryCode=function(e){var a=e.isInitializing,t=e.newSelectedCountryCode;var
|
|
283
|
-
// Make sure the country is not in the disabled countries list
|
|
284
|
-
!zonosStore.disabledCountries.includes(i);
|
|
294
|
+
var t=a.find((function(e){return e.code==="en"}))||a[0];log("Locale ".concat(e," is not offered, falling back to ").concat(t===null||t===void 0?void 0:t.code));return(t===null||t===void 0?void 0:t.code)||"en"};var syncSelectedCountryToPage=function(e){var a;setZCountryUrlParam(e);(a=document.querySelector("zonos-hello"))===null||a===void 0?void 0:a.setAttribute("z-country",e)};var localizationStoreUpdateSelectedCountryCode=function(e){var a=e.isInitializing,t=e.newSelectedCountryCode,r=e.persistOverride;var o;log("Updating selected country code to ".concat(t));var n=!localizationStore.selectedCountryCode;localizationStore.selectedCountryCode=getValidCountryCode(t);var i=localizationStore.selectedCountryCode;var l=isCountryInShippingZone(i);
|
|
285
295
|
// update shippable country
|
|
286
|
-
localizationStore.isShippableCountry=
|
|
296
|
+
localizationStore.isShippableCountry=l;log("".concat(localizationStore.selectedCountryCode," is a shippable country: ").concat(localizationStore.isShippableCountry));var s=!!i&&zonosStore.disabledCountries.includes(i);localizationStore.isDisabledCountry=s;log("".concat(localizationStore.selectedCountryCode," is a disabled country: ").concat(localizationStore.isDisabledCountry));addInternationalHideClass();
|
|
287
297
|
// Hide / restore BC's native currency selector based on the new
|
|
288
298
|
// shipping-zone state. Runs here (rather than inside `currencyDisplay`)
|
|
289
299
|
// because `currencyDisplay` is also invoked from the price-mutation
|
|
@@ -293,18 +303,16 @@ toggleBigcommerceNativeCurrencySelector();
|
|
|
293
303
|
// shopper added before switching to an international country so the Grand
|
|
294
304
|
// Total reflects only subtotal + coupon. No-ops off-cart, off-BigCommerce,
|
|
295
305
|
// for non-shippable countries, or when the cart has no consignment.
|
|
296
|
-
void removeBigcommerceCartShipping();if(!i){return}var
|
|
297
|
-
// Only trigger
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
(r=zonosStore.onCountryChange)===null||r===void 0?void 0:r.call(zonosStore,{countryCode:i,currencyCode:c,isShippableCountry:u})}if(!c){
|
|
306
|
+
void removeBigcommerceCartShipping();if(!i){return}var u=getCurrencyCode(i);var d=r!==null&&r!==void 0?r:!a;
|
|
307
|
+
// Only trigger onCountryChange after init — the first apply, and any
|
|
308
|
+
// reconcile fallback during init, are not shopper-selected changes.
|
|
309
|
+
if(!n&&!a){(o=zonosStore.onCountryChange)===null||o===void 0?void 0:o.call(zonosStore,{countryCode:i,currencyCode:u,isShippableCountry:l})}if(!u){
|
|
301
310
|
// Non-shippable country: revert any previously-converted international
|
|
302
311
|
// prices back to the merchant's domestic (source) currency before bailing.
|
|
303
|
-
if(localizationStore.exchangeRateTimeout){clearTimeout(localizationStore.exchangeRateTimeout);localizationStore.exchangeRateTimeout=undefined}var
|
|
304
|
-
//
|
|
305
|
-
//
|
|
306
|
-
|
|
307
|
-
window.sessionStorage.removeItem("zonos--country");setZCountryUrlParam(i);(o=document.querySelector("zonos-hello"))===null||o===void 0?void 0:o.setAttribute("z-country",i);return}localizationStore.targetCurrency=c;void getNewLocalization({isInitializing:a});if(!a){void getCustomMessages()}window.sessionStorage.setItem("zonos--country",i);setZCountryUrlParam(i);(n=document.querySelector("zonos-hello"))===null||n===void 0?void 0:n.setAttribute("z-country",i)};var initHelloCountryList=function(e){var a,t,r,o,n,l;var i=zonosStore.helloSettings,s=i.countryDisplayRules,u=i.showCountryList;var d=localizationStore.shippingZoneCountries;var c=s===null||s===void 0?void 0:s.countrySelector;
|
|
312
|
+
if(localizationStore.exchangeRateTimeout){clearTimeout(localizationStore.exchangeRateTimeout);localizationStore.exchangeRateTimeout=undefined}var c=zonosStore.sourceCurrency;localizationStore.targetCurrency=c;localizationStore.exchangeRate={rate:1,targetFormat:{currencyCode:c,decimalDelimiter:".",scale:2,symbol:"",symbolLocation:"before",thousandsDelimiter:","}};localizationStore.countryLandedCost=null;localizationStore.inclusivePricingConfigurations=[];currencyDisplay()}else{localizationStore.targetCurrency=u;
|
|
313
|
+
// Init may apply a remembered country that reconcile then discards. Fetch
|
|
314
|
+
// exchange rates once after reconcile for the final country instead.
|
|
315
|
+
if(!a){void getNewLocalization({isInitializing:false})}}if(!a){void getCustomMessages()}if(d){setCountryOverrideStorage(i)}if(!a){syncSelectedCountryToPage(i)}};var initHelloCountryList=function(e){var a,t,r,o,n,i;var l=zonosStore.helloSettings,s=l.countryDisplayRules,u=l.showCountryList;var d=localizationStore.shippingZoneCountries;var c=s===null||s===void 0?void 0:s.countrySelector;
|
|
308
316
|
// Resolve behavior: deprecated showCountryList overrides countrySelector.behavior
|
|
309
317
|
// If showCountryList is an array of country codes, treat as legacy explicit list
|
|
310
318
|
var v=Array.isArray(u)?u:u!==null&&u!==void 0?u:c===null||c===void 0?void 0:c.behavior;log("Country selector behavior","info",{behavior:c===null||c===void 0?void 0:c.behavior,excludedCount:(t=(a=c===null||c===void 0?void 0:c.excludedCountries)===null||a===void 0?void 0:a.length)!==null&&t!==void 0?t:0,includedCount:(o=(r=c===null||c===void 0?void 0:c.includedCountries)===null||r===void 0?void 0:r.length)!==null&&o!==void 0?o:0,showCountryList:u});
|
|
@@ -317,16 +325,14 @@ p=d?Object.assign({},d):{}}
|
|
|
317
325
|
// Apply includedCountries — add countries not already in the list
|
|
318
326
|
if((n=c===null||c===void 0?void 0:c.includedCountries)===null||n===void 0?void 0:n.length){for(var m=0,h=c.includedCountries;m<h.length;m++){var g=h[m];if(!p[g]&&e[g]){p[g]=e[g]}}}
|
|
319
327
|
// Apply excludedCountries — remove countries from the list
|
|
320
|
-
if((
|
|
328
|
+
if((i=c===null||c===void 0?void 0:c.excludedCountries)===null||i===void 0?void 0:i.length){for(var y=0,f=c.excludedCountries;y<f.length;y++){var g=f[y];delete p[g]}}localizationStore.helloCountryList=p};var updateCheckoutSessionLanguage=function(){return __awaiter(void 0,void 0,void 0,(function(){var e,a,t;return __generator(this,(function(r){switch(r.label){case 0:if(!storageStore.checkoutSessionId){return[2/*return*/,null]}return[4/*yield*/,handleFetch("/api/zonos-elements/update-checkout-session-metadata",{body:{id:storageStore.checkoutSessionId,metadata:[
|
|
321
329
|
// This is being used from the backend to determine the language of the checkout session
|
|
322
|
-
{key:"language",value:localizationStore.selectedLocale}]},method:"POST"})];case 1:e=r.sent(),a=e.errors,t=e.json;if(a.length||!t){logError("Error occurs when updating checkout session",JSON.stringify(a,null,2));return[2/*return*/,{errors:a,json:t}]}return[2/*return*/,{errors:[],json:t}]}}))}))};var localizationStoreUpdateSelectedLocale=function(e){var a=getValidLocale(e);localizationStore.selectedLocale=a;translationStoreUpdateLanguage(a);void updateCheckoutSessionLanguage();void getCustomMessages()};var initLocalizationStore=function(){return __awaiter(void 0,void 0,void 0,(function(){var e,a,t,r,o,n,l,
|
|
330
|
+
{key:"language",value:localizationStore.selectedLocale}]},method:"POST"})];case 1:e=r.sent(),a=e.errors,t=e.json;if(a.length||!t){logError("Error occurs when updating checkout session",JSON.stringify(a,null,2));return[2/*return*/,{errors:a,json:t}]}return[2/*return*/,{errors:[],json:t}]}}))}))};var localizationStoreUpdateSelectedLocale=function(e){var a=getValidLocale(e);localizationStore.selectedLocale=a;translationStoreUpdateLanguage(a);void updateCheckoutSessionLanguage();if(localizationStore.localizationLoaded){void getCustomMessages()}};var initLocalizationStore=function(){return __awaiter(void 0,void 0,void 0,(function(){var e,a,t,r,o,n,i,l,s,u,d,c,v,p,m,h;return __generator(this,(function(g){switch(g.label){case 0:migrateCountryOverrideStorage();a=getZCountryUrlParam();t=getCountryOverrideStorage();r=!!t&&!a;return[4/*yield*/,Promise.all([getCountries(),getShippingZones(),getLocalization(),r?getLocalization({ignoreCountryOverride:true}):Promise.resolve(undefined)])];case 1:o=g.sent(),n=o[0],i=o[1],l=o[2],s=o[3];u=i===null||i===void 0?void 0:i.reduce((function(e,a){var t;var r=n===null||n===void 0?void 0:n[a];return r?Object.assign(Object.assign({},e),(t={},t[a]=r,t)):e}),{});localizationStore.allCountries=n;localizationStore.shippingZoneCountries=u||null;localizationStore.inclusivePricingConfigurations=((e=window.Zonos.cartSettings)===null||e===void 0?void 0:e.inclusivePriceConfigurations)||[];
|
|
323
331
|
// Initialize the country list for the hello widget
|
|
324
|
-
initHelloCountryList(
|
|
332
|
+
initHelloCountryList(n||{});d=l.country,c=l.locale;log("Country code from localization: ".concat(d));log("Locale from localization: ".concat(c));
|
|
325
333
|
// update selected country code in store
|
|
326
|
-
localizationStoreUpdateSelectedCountryCode({isInitializing:true,newSelectedCountryCode:
|
|
334
|
+
localizationStoreUpdateSelectedCountryCode({isInitializing:true,newSelectedCountryCode:d||t});v=getOverrideLocale();localizationStoreUpdateSelectedLocale(v||c||"en");p=["dev.storybook.elements","dev.elements","dev.demo.elements","dev.dashboard"];m=new URLSearchParams(window.location.search);
|
|
327
335
|
// If the country code is not set, set it to the US for development (vercel can't get geo country in dev)
|
|
328
|
-
if(!localizationStore.selectedCountryCode&&(
|
|
336
|
+
if(!localizationStore.selectedCountryCode&&(p.some((function(e){return window.location.origin.includes(e)}))||m.get("zonosQaUrl")==="dev-elements")){
|
|
329
337
|
// update selected country code in store
|
|
330
|
-
localizationStoreUpdateSelectedCountryCode({isInitializing:true,newSelectedCountryCode:"CA"})}if(!localizationStore.localizationLoaded){localizationStore.localizationLoaded=true;void removeBigcommerceCartShipping();
|
|
331
|
-
// shouldShowHelloWidget is false because localization is not loaded yet
|
|
332
|
-
void toggleBigcommerceNativeCurrencySelector()}return[2/*return*/]}}))}))};export{applyInclusiveEffectiveRate as A,getFallbackDefaultCountryCode as B,localizationStoreUpdateSelectedLocale as C,VARIANT_TEST_KEY_EXPIRATION as V,fetchCheckoutId as a,fetchBigCommerceCheckout as b,localizationStoreUpdateSelectedCountryCode as c,storageStoreSetEnabledVariantTestKeys as d,localizationStoreOnChange as e,filterValidTests as f,getZCountryUrlParam as g,currencyFormat as h,isBigCommerceCustomerLoggedIn as i,languages as j,getOverridenZCountry as k,localizationStore as l,isValidSelector as m,initLocalizationStore as n,setZCountryUrlParam as o,currencyDisplay as p,currencyConvertAndFormat as q,currencyConvert as r,storageStore as s,translate as t,shouldShowHelloWidget as u,getExchangeRate as v,numberFormat as w,translationStoreOnChange as x,storageStoreOnChange as y,getSupportedLanguages as z};
|
|
338
|
+
localizationStoreUpdateSelectedCountryCode({isInitializing:true,newSelectedCountryCode:"CA"})}return[4/*yield*/,reconcileRememberedCountryOverride({geoCountry:s===null||s===void 0?void 0:s.country,urlCountryAtLoad:a})];case 2:h=g.sent();if(h){localizationStoreUpdateSelectedCountryCode({isInitializing:true,newSelectedCountryCode:h})}if(localizationStore.selectedCountryCode){syncSelectedCountryToPage(localizationStore.selectedCountryCode)}void getCustomMessages();void getNewLocalization({isInitializing:true});if(!localizationStore.localizationLoaded){localizationStore.localizationLoaded=true;void removeBigcommerceCartShipping();void toggleBigcommerceNativeCurrencySelector()}return[2/*return*/]}}))}))};export{getSupportedLanguages as A,applyInclusiveEffectiveRate as B,getFallbackDefaultCountryCode as C,localizationStoreUpdateSelectedLocale as D,VARIANT_TEST_KEY_EXPIRATION as V,fetchCheckoutId as a,fetchBigCommerceCheckout as b,isCountryInShippingZone as c,localizationStoreUpdateSelectedCountryCode as d,storageStoreSetEnabledVariantTestKeys as e,filterValidTests as f,getZCountryUrlParam as g,localizationStoreOnChange as h,isBigCommerceCustomerLoggedIn as i,currencyFormat as j,languages as k,localizationStore as l,getOverridenZCountry as m,isValidSelector as n,initLocalizationStore as o,setZCountryUrlParam as p,currencyDisplay as q,currencyConvertAndFormat as r,storageStore as s,translate as t,currencyConvert as u,shouldShowHelloWidget as v,getExchangeRate as w,numberFormat as x,translationStoreOnChange as y,storageStoreOnChange as z};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,r,t,n){function o(e){return e instanceof t?e:new t((function(r){r(e)}))}return new(t||(t=Promise))((function(t,a){function i(e){try{s(n.next(e))}catch(e){a(e)}}function u(e){try{s(n["throw"](e))}catch(e){a(e)}}function s(e){e.done?t(e.value):o(e.value).then(i,u)}s((n=n.apply(e,r||[])).next())}))};var __generator=this&&this.__generator||function(e,r){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=u(0),i["throw"]=u(1),i["return"]=u(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function u(e){return function(r){return s([e,r])}}function s(u){if(n)throw new TypeError("Generator is already executing.");while(i&&(i=0,u[0]&&(t=0)),t)try{if(n=1,o&&(a=u[0]&2?o["return"]:u[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,u[1])).done)return a;if(o=0,a)u=[u[0]&2,a.value];switch(u[0]){case 0:case 1:a=u;break;case 4:t.label++;return{value:u[1],done:false};case 5:t.label++;o=u[1];u=[0];continue;case 7:u=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){t.label=u[1];break}if(u[0]===6&&t.label<a[1]){t.label=a[1];a=u;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(u);break}if(a[2])t.ops.pop();t.trys.pop();continue}u=r.call(e,t)}catch(e){u=[6,e];o=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};import{z as zonosStore,c as createStore}from"./zonosStore-
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,r,t,n){function o(e){return e instanceof t?e:new t((function(r){r(e)}))}return new(t||(t=Promise))((function(t,a){function i(e){try{s(n.next(e))}catch(e){a(e)}}function u(e){try{s(n["throw"](e))}catch(e){a(e)}}function s(e){e.done?t(e.value):o(e.value).then(i,u)}s((n=n.apply(e,r||[])).next())}))};var __generator=this&&this.__generator||function(e,r){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=u(0),i["throw"]=u(1),i["return"]=u(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function u(e){return function(r){return s([e,r])}}function s(u){if(n)throw new TypeError("Generator is already executing.");while(i&&(i=0,u[0]&&(t=0)),t)try{if(n=1,o&&(a=u[0]&2?o["return"]:u[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,u[1])).done)return a;if(o=0,a)u=[u[0]&2,a.value];switch(u[0]){case 0:case 1:a=u;break;case 4:t.label++;return{value:u[1],done:false};case 5:t.label++;o=u[1];u=[0];continue;case 7:u=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){t.label=u[1];break}if(u[0]===6&&t.label<a[1]){t.label=a[1];a=u;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(u);break}if(a[2])t.ops.pop();t.trys.pop();continue}u=r.call(e,t)}catch(e){u=[6,e];o=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};import{z as zonosStore,c as createStore}from"./zonosStore-msUlqmSD.js";import{x as cartStoreNextStep,j as cartStoreClearCheckoutInterval,t as trackConversionEvent,y as isPolicyConsentRequired,G as policyConsentStore,C as validateCheckoutSession,b as stripeStore,d as cartStore,n as stripeStoreHandleInventoryCheck,A as storeCreditStoreApplyCredit,T as stripeStoreRecordPolicyConsent,B as storeCreditStoreCoversFullAmount,D as storeCreditStoreCreateOrder,K as storeCreditStoreGetEffectiveAmount}from"./cart-Cleo1j5P.js";import{s as storageStore,t as translate}from"./localization-BiL8bPsY.js";import{h as handleFetch,g as getIsTestMode,l as logError,j as jsonParse}from"./handleFetch-D5GYDF-O.js";import{i as isContrastColor}from"./isContrastColor-CWLU13s9.js";import{l as log}from"./VarianceTest-BJmZPrZl.js";import{i as isAnalyticsRelayInIframe,a as enqueueRelayEvent,s as submitGtag}from"./submitGtag-df9AQ2zL.js";
|
|
2
2
|
/*!
|
|
3
3
|
* paypal-js v8.4.2 (2025-09-04T17:21:30.135Z)
|
|
4
4
|
* Copyright 2020-present, PayPal, Inc. All rights reserved.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(r,t,e,n){function o(r){return r instanceof e?r:new e((function(t){t(r)}))}return new(e||(e=Promise))((function(e,i){function a(r){try{u(n.next(r))}catch(r){i(r)}}function c(r){try{u(n["throw"](r))}catch(r){i(r)}}function u(r){r.done?e(r.value):o(r.value).then(a,c)}u((n=n.apply(r,t||[])).next())}))};var __generator=this&&this.__generator||function(r,t){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return a.next=c(0),a["throw"]=c(1),a["return"]=c(2),typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(r){return function(t){return u([r,t])}}function u(c){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,c[0]&&(e=0)),e)try{if(n=1,o&&(i=c[0]&2?o["return"]:c[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,c[1])).done)return i;if(o=0,i)c=[c[0]&2,i.value];switch(c[0]){case 0:case 1:i=c;break;case 4:e.label++;return{value:c[1],done:false};case 5:e.label++;o=c[1];c=[0];continue;case 7:c=e.ops.pop();e.trys.pop();continue;default:if(!(i=e.trys,i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){e=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){e.label=c[1];break}if(c[0]===6&&e.label<i[1]){e.label=i[1];i=c;break}if(i&&e.label<i[2]){e.label=i[2];e.ops.push(c);break}if(i[2])e.ops.pop();e.trys.pop();continue}c=t.call(r,e)}catch(r){c=[6,r];o=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};import{d as cartStore}from"./cart-
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(r,t,e,n){function o(r){return r instanceof e?r:new e((function(t){t(r)}))}return new(e||(e=Promise))((function(e,i){function a(r){try{u(n.next(r))}catch(r){i(r)}}function c(r){try{u(n["throw"](r))}catch(r){i(r)}}function u(r){r.done?e(r.value):o(r.value).then(a,c)}u((n=n.apply(r,t||[])).next())}))};var __generator=this&&this.__generator||function(r,t){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return a.next=c(0),a["throw"]=c(1),a["return"]=c(2),typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(r){return function(t){return u([r,t])}}function u(c){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,c[0]&&(e=0)),e)try{if(n=1,o&&(i=c[0]&2?o["return"]:c[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,c[1])).done)return i;if(o=0,i)c=[c[0]&2,i.value];switch(c[0]){case 0:case 1:i=c;break;case 4:e.label++;return{value:c[1],done:false};case 5:e.label++;o=c[1];c=[0];continue;case 7:c=e.ops.pop();e.trys.pop();continue;default:if(!(i=e.trys,i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){e=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){e.label=c[1];break}if(c[0]===6&&e.label<i[1]){e.label=i[1];i=c;break}if(i&&e.label<i[2]){e.label=i[2];e.ops.push(c);break}if(i[2])e.ops.pop();e.trys.pop();continue}c=t.call(r,e)}catch(r){c=[6,r];o=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};import{d as cartStore}from"./cart-Cleo1j5P.js";import{s as storageStore}from"./localization-BiL8bPsY.js";import{l as logError,h as handleFetch}from"./handleFetch-D5GYDF-O.js";var placeTestOrder=function(){return __awaiter(void 0,void 0,void 0,(function(){var r,t,e,n,o,i,a,c,u;return __generator(this,(function(s){switch(s.label){case 0:e=(r=cartStore.partiesData.find((function(r){return r.type==="DESTINATION"})))===null||r===void 0?void 0:r.id;n=(t=cartStore.partiesData.find((function(r){return r.type==="PAYOR"})))===null||t===void 0?void 0:t.id;o=storageStore.checkoutSessionId;if(!o||!n||!e){logError("Missing required data",{billToPartyId:n,checkoutSessionId:o,shipToPartyId:e});return[2/*return*/,{errors:["Missing required data"],json:null}]}i={billToPartyId:n,checkoutSessionId:o,shipToPartyId:e};return[4/*yield*/,handleFetch("/api/zonos-elements/place-test-order",{body:i,method:"POST"})];case 1:a=s.sent(),c=a.errors,u=a.json;if(c.length||!u){logError("Error occurs when placing test order",c);return[2/*return*/,{errors:c.map((function(r){return r.message})),json:null}]}return[2/*return*/,{errors:[],json:u}]}}))}))};export{placeTestOrder as p};
|
package/dist/esm-es5/{renderCheckoutCurrency-BQANmZyM.js → renderCheckoutCurrency-BNbwijGo.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as cartStore}from"./cart-
|
|
1
|
+
import{d as cartStore}from"./cart-Cleo1j5P.js";import{B as applyInclusiveEffectiveRate,j as currencyFormat}from"./localization-BiL8bPsY.js";var getDisplayCurrency=function(){var r,a;var t=cartStore.displayBaseCurrency;var e=t&&((r=cartStore.exchangeRate)===null||r===void 0?void 0:r.sourceCurrencyCode)?(a=cartStore.exchangeRate)===null||a===void 0?void 0:a.sourceCurrencyCode:cartStore.currency;return e};
|
|
2
2
|
/**
|
|
3
3
|
* Unified currency rendering for checkout amounts.
|
|
4
4
|
* @note This is only to display, not for calculations.
|
package/dist/esm-es5/{shouldShowLanguageSelect-BQFCXouB.js → shouldShowLanguageSelect-B82gTfHz.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{A as getSupportedLanguages}from"./localization-BiL8bPsY.js";
|
|
2
2
|
/**
|
|
3
3
|
* Whether to offer the language selector. Hidden when the merchant has narrowed
|
|
4
4
|
* `appearanceSettings.supportedLocales` to a single language — there is nothing to pick, so the
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{z as zonosStore}from"./zonosStore-
|
|
1
|
+
import{z as zonosStore}from"./zonosStore-msUlqmSD.js";import{g as getIsTestMode}from"./handleFetch-D5GYDF-O.js";import{l as log}from"./VarianceTest-BJmZPrZl.js";
|
|
2
2
|
/** Message type for zonos-analytic events sent from iframe to parent. */var ZONOS_ANALYTIC_TYPE="zonos-analytic";
|
|
3
3
|
/** Ping sent by iframe to configure parent's analytics relay (e.g. GA, FB Pixel) and get ready signal. */var RELAY_PING_TYPE="zonos-analytics-relay-ping";
|
|
4
4
|
/** Response from parent when an analytics relay (e.g. gtag, fbq) is ready. */var RELAY_READY_TYPE="zonos-analytics-relay-ready";var providerReady={fbq:false,gtag:false};var queue=[];var listenerAdded=false;var isInIframe=function(){return typeof window!=="undefined"&&window.parent!==window};var flushQueue=function(){
|